diff --git a/bundles/org.eclipse.jst.jsp.ui/.classpath b/bundles/org.eclipse.jst.jsp.ui/.classpath
deleted file mode 100644
index cb01053..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src/"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.jst.jsp.ui/.cvsignore b/bundles/org.eclipse.jst.jsp.ui/.cvsignore
deleted file mode 100644
index fd271b4..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-bin
-jspeditor.jar
-temp.folder
-org.eclipse.jst.jsp.ui_6.0.0.jar
-build.xml
-@dot
-src.zip
diff --git a/bundles/org.eclipse.jst.jsp.ui/.options b/bundles/org.eclipse.jst.jsp.ui/.options
deleted file mode 100644
index 7174d60..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/.options
+++ /dev/null
@@ -1,2 +0,0 @@
-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
deleted file mode 100644
index 2d42e46..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 04d30dc..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,69 +0,0 @@
-#Mon May 30 17:57:20 EDT 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-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.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-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.indirectStaticAccess=warning
-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=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-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.missingSerialVersion=warning
-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=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-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.unusedLocal=warning
-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=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.jst.jsp.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 42fb716..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Fri May 27 23:56:32 EDT 2005
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-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
deleted file mode 100644
index 879c78f..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,59 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jst.jsp.ui; singleton:=true
-Bundle-Version: 1.0.1.qualifier
-Bundle-Activator: org.eclipse.jst.jsp.ui.internal.JSPUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jst.jsp.ui,
- org.eclipse.jst.jsp.ui.internal,
- org.eclipse.jst.jsp.ui.internal.autoedit,
- org.eclipse.jst.jsp.ui.internal.breakpointproviders,
- org.eclipse.jst.jsp.ui.internal.contentassist,
- org.eclipse.jst.jsp.ui.internal.derived,
- org.eclipse.jst.jsp.ui.internal.editor,
- org.eclipse.jst.jsp.ui.internal.format,
- org.eclipse.jst.jsp.ui.internal.hyperlink,
- org.eclipse.jst.jsp.ui.internal.java.refactoring,
- org.eclipse.jst.jsp.ui.internal.java.search,
- org.eclipse.jst.jsp.ui.internal.java.search.ui,
- org.eclipse.jst.jsp.ui.internal.preferences,
- org.eclipse.jst.jsp.ui.internal.preferences.ui,
- org.eclipse.jst.jsp.ui.internal.projection,
- org.eclipse.jst.jsp.ui.internal.registry,
- org.eclipse.jst.jsp.ui.internal.style,
- org.eclipse.jst.jsp.ui.internal.style.java,
- org.eclipse.jst.jsp.ui.internal.taginfo,
- org.eclipse.jst.jsp.ui.internal.templates,
- org.eclipse.jst.jsp.ui.internal.text,
- org.eclipse.jst.jsp.ui.internal.wizard,
- org.eclipse.jst.jsp.ui.views.contentoutline
-Require-Bundle: org.eclipse.ui.ide,
- org.eclipse.ui.views,
- org.eclipse.jface.text,
- org.eclipse.ui.workbench.texteditor,
- org.eclipse.ui.editors,
- org.eclipse.ui,
- org.eclipse.wst.sse.ui,
- org.eclipse.wst.html.ui,
- org.eclipse.wst.css.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.jst.jsp.core,
- org.eclipse.wst.html.core,
- org.eclipse.wst.css.core,
- org.eclipse.wst.xml.core,
- org.eclipse.wst.sse.core,
- org.eclipse.jdt.ui,
- org.eclipse.jdt.core,
- org.eclipse.debug.core,
- org.eclipse.jdt.debug,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.search,
- org.eclipse.ltk.core.refactoring,
- org.eclipse.ltk.ui.refactoring,
- org.eclipse.wst.common.uriresolver,
- org.eclipse.ui.ide,
- org.eclipse.wst.javascript.ui
-Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.jst.jsp.ui/about.html b/bundles/org.eclipse.jst.jsp.ui/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>February 24, 2005</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.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/build.properties b/bundles/org.eclipse.jst.jsp.ui/build.properties
deleted file mode 100644
index 6b33ae3..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/build.properties
+++ /dev/null
@@ -1,21 +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
-###############################################################################
-source.. = src/
-bin.includes = .,\
-               templates/,\
-               plugin.xml,\
-               META-INF/,\
-               icons/,\
-               plugin.properties,\
-               about.html
-bin.excludes = @dot/**,\
-               temp.folder/**
-src.includes = build.properties
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
deleted file mode 100644
index 5ff9b39..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/dtool16/newjsp_wiz.gif
+++ /dev/null
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
deleted file mode 100644
index 14944ac..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/etool16/newjsp_wiz.gif
+++ /dev/null
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
deleted file mode 100644
index c00118d..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/class_obj.gif
+++ /dev/null
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
deleted file mode 100644
index 49a1461..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/default_co.gif
+++ /dev/null
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
deleted file mode 100644
index 6929d3d..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_default_obj.gif
+++ /dev/null
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
deleted file mode 100644
index 1fe064e..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_private_obj.gif
+++ /dev/null
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
deleted file mode 100644
index 3377b1e..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_protected_obj.gif
+++ /dev/null
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
deleted file mode 100644
index d4cb425..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_public_obj.gif
+++ /dev/null
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
deleted file mode 100644
index 4244a7f..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_default_obj.gif
+++ /dev/null
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
deleted file mode 100644
index 7392f19..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_private_obj.gif
+++ /dev/null
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
deleted file mode 100644
index 5105577..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_protected_obj.gif
+++ /dev/null
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
deleted file mode 100644
index e4c2a83..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_public_obj.gif
+++ /dev/null
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
deleted file mode 100644
index ab1b576..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_default_obj.gif
+++ /dev/null
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
deleted file mode 100644
index a1cbff3..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_private_obj.gif
+++ /dev/null
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
deleted file mode 100644
index f58eef0..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_protected_obj.gif
+++ /dev/null
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
deleted file mode 100644
index 2ebc46e..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_public_obj.gif
+++ /dev/null
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
deleted file mode 100644
index 8adce95..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/localvariable_obj.gif
+++ /dev/null
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
deleted file mode 100644
index 131c28d..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/package_obj.gif
+++ /dev/null
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
deleted file mode 100644
index 5b881d8..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/private_co.gif
+++ /dev/null
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
deleted file mode 100644
index cd83b96..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/protected_co.gif
+++ /dev/null
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
deleted file mode 100644
index 7d24707..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public.gif
+++ /dev/null
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
deleted file mode 100644
index a9af5d5..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public_co.gif
+++ /dev/null
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
deleted file mode 100644
index 75ebdb8..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/sourceEditor.gif
+++ /dev/null
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
deleted file mode 100644
index 65f516e..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-generic.gif
+++ /dev/null
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
deleted file mode 100644
index 4084602..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-jsp.gif
+++ /dev/null
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
deleted file mode 100644
index 5d1f81b..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-template.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/wizban/newjspfile_wiz.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/wizban/newjspfile_wiz.gif
deleted file mode 100644
index 972597b..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/wizban/newjspfile_wiz.gif
+++ /dev/null
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
deleted file mode 100644
index 35f48ef..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspdecl.gif
+++ /dev/null
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
deleted file mode 100644
index ab4d74b..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspexp.gif
+++ /dev/null
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
deleted file mode 100644
index 2584c31..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspincl.gif
+++ /dev/null
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
deleted file mode 100644
index 1753b96..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspscr.gif
+++ /dev/null
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
deleted file mode 100644
index cb55e33..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jsptaglib.gif
+++ /dev/null
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
deleted file mode 100644
index 5e7fb33..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-generic.gif
+++ /dev/null
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
deleted file mode 100644
index ea4de33..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-jsp.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/plugin.properties b/bundles/org.eclipse.jst.jsp.ui/plugin.properties
deleted file mode 100644
index 8620236..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.properties
+++ /dev/null
@@ -1,86 +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
-###############################################################################
-providerName=Eclipse.org
-pluginName=SSE JSP Source Editor
-nlFeatureName=SSE JSP Source Editor NL Support
-JSP_Source_Page_Editor.name=JSP Editor
-JSP_Files.name=JSP Files
-JSP_Source.name=JSP Source
-JSP_Templates.name=JSP Templates
-JSP_Styles.name=JSP Styles
-JSP_Annotations.name=JSP Annotations
-
-# 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
-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
-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
-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
-_UI_WIZARD_CREATE_NEW_FILE = Create a new JavaServer Page
-##
-AddTask.label=Add &Task...
-AddTask.tooltip=Add Task...
-AddBookmark.label=Add Boo&kmark...
-AddBookmark.tooltip=Add Bookmark...
-SelectRuler.label=Select Ruler
-## EL Error Message
-JSPEL_Syntax_Error=JSP EL Syntax Error
-##
-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
diff --git a/bundles/org.eclipse.jst.jsp.ui/plugin.xml b/bundles/org.eclipse.jst.jsp.ui/plugin.xml
deleted file mode 100644
index 6c28b24..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.xml
+++ /dev/null
@@ -1,552 +0,0 @@
-<?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="icons//full/obj16/sourceEditor.gif"
-			extensions="jsp, jsf, jspf, jspx, tag, 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>
-	</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" />
-		<propertySheetConfiguration
-			class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
-			target="org.eclipse.jst.jsp.core.jspsource" />
-		<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="structuredtextfoldingprovider"
-			class="org.eclipse.jst.jsp.ui.internal.projection.StructuredTextFoldingProviderJSP"
-			target="org.eclipse.jst.jsp.core.jspsource" />
-		<provisionalDefinition
-			type="preferencepages"
-			value="org.eclipse.wst.sse.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"
-			target="org.eclipse.jst.jsp.core.jspsource" />
-		<provisionalDefinition
-			type="showintarget"
-			value="org.eclipse.jdt.ui.PackageExplorer"
-			target="org.eclipse.jst.jsp.core.jspsource" />
-	</extension>
-
-	<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.sse.ui.internal.provisional.preferences"
-			class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPFilesPreferencePage"
-			id="org.eclipse.wst.sse.ui.preferences.jsp" />
-
-		<page
-			name="%JSP_Source.name"
-			category="org.eclipse.wst.sse.ui.preferences.jsp"
-			class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPSourcePreferencePage"
-			id="org.eclipse.wst.sse.ui.preferences.jsp.source" />
-
-		<page
-			name="%JSP_Templates.name"
-			category="org.eclipse.wst.sse.ui.preferences.jsp"
-			class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPTemplatePreferencePage"
-			id="org.eclipse.wst.sse.ui.preferences.jsp.templates" />
-
-		<page
-			name="%JSP_Styles.name"
-			category="org.eclipse.wst.sse.ui.preferences.jsp"
-			class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPColorPage"
-			id="org.eclipse.wst.sse.ui.preferences.jsp.styles" />
-
-	</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
-				extensions="jsp, jspf, jsf"
-				class="org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider"
-				id="org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider">
-				</provider>
-			-->
-			<provider
-				contentTypes="org.eclipse.jst.jsp.core.jspsource"
-				class="org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider:*jsp,jsp_servlet._*"
-				id="org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider" />
-		</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>
-	</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.ui.textEditorScope"
-			description="%scope.structured.text.editor.jsp.description"
-			id="org.eclipse.jst.jsp.ui.structured.text.editor.jsp.scope">
-		</context>
-	</extension>
-	
-	<!-- Keybindings for jsp source editor -->
-	<extension point="org.eclipse.ui.bindings">
-		<!-- rename refactor -->
-		<key
-			sequence="Alt+Shift+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="Alt+Shift+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="%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="icons/full/etool16/newjsp_wiz.gif">
-			<description>%_UI_WIZARD_CREATE_NEW_FILE</description>
-			<selection class="org.eclipse.core.resources.IResource" />
-		</wizard>
-	</extension>
-
-	<!-- Add new JSP wizard to J2EE Project Navigator -->
-	<extension
-		id="org.eclipse.jst.jsp.commonWizard.newJSP"
-		point="org.eclipse.wst.common.navigator.workbench.commonWizard">
-		<commonWizard
-			type="new"
-			wizardId="org.eclipse.jst.jsp.ui.internal.wizard.NewJSPWizard">
-			<enablement>
-				<or>
-					<objectClass
-						name="org.eclipse.core.resources.IProject" />
-
-					<objectClass
-						name="org.eclipse.core.resources.IFolder" />
-
-					<objectClass
-						name="org.eclipse.core.resources.IFile" />
-
-				</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>
-	</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>
-</plugin>
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
deleted file mode 100644
index 0943cf6..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
+++ /dev/null
@@ -1,432 +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.jst.jsp.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jdt.ui.text.IJavaPartitions;
-import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
-import org.eclipse.jdt.ui.text.JavaTextTools;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.formatter.IContentFormatter;
-import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.information.IInformationPresenter;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jst.jsp.core.internal.provisional.text.IJSPPartitionTypes;
-import org.eclipse.jst.jsp.core.internal.text.StructuredTextPartitionerForJSP;
-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.contentassist.JSPContentAssistProcessor;
-import org.eclipse.jst.jsp.ui.internal.contentassist.JSPELContentAssistProcessor;
-import org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaContentAssistProcessor;
-import org.eclipse.jst.jsp.ui.internal.contentassist.NoRegionContentAssistProcessorForJSP;
-import org.eclipse.jst.jsp.ui.internal.format.FormattingStrategyJSPJava;
-import org.eclipse.jst.jsp.ui.internal.hyperlink.JSPJavaHyperlinkDetector;
-import org.eclipse.jst.jsp.ui.internal.hyperlink.TaglibHyperlinkDetector;
-import org.eclipse.jst.jsp.ui.internal.hyperlink.XMLHyperlinkDetector;
-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.jst.jsp.ui.internal.taginfo.JSPJavaJavadocHoverProcessor;
-import org.eclipse.jst.jsp.ui.internal.taginfo.JSPTagInfoHoverProcessor;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.wst.css.core.internal.provisional.text.ICSSPartitionTypes;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
-import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
-import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
-
-/**
- * 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;
-
-	/**
-	 * 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 == IJSPPartitionTypes.JSP_CONTENT_JAVA) {
-			// jsp java autoedit strategies
-			List allStrategies = new ArrayList(0);
-
-			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 == IHTMLPartitionTypes.HTML_DEFAULT || contentType == IHTMLPartitionTypes.HTML_DECLARATION) {
-			// 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;
-	}
-
-	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
-		IContentAssistProcessor[] processors = null;
-
-		if (partitionType == IHTMLPartitionTypes.SCRIPT) {
-			// HTML JavaScript
-			IContentAssistant htmlContentAssistant = getHTMLSourceViewerConfiguration().getContentAssistant(sourceViewer);
-			IContentAssistProcessor processor = htmlContentAssistant.getContentAssistProcessor(IHTMLPartitionTypes.SCRIPT);
-			processors = new IContentAssistProcessor[]{processor};
-		}
-		else if (partitionType == ICSSPartitionTypes.STYLE) {
-			// HTML CSS
-			IContentAssistant htmlContentAssistant = getHTMLSourceViewerConfiguration().getContentAssistant(sourceViewer);
-			IContentAssistProcessor processor = htmlContentAssistant.getContentAssistProcessor(ICSSPartitionTypes.STYLE);
-			processors = new IContentAssistProcessor[]{processor};
-		}
-		// // jspcontentassistprocessor handles this?
-		// else if ((partitionType == IHTMLPartitionTypes.HTML_DEFAULT) ||
-		// (partitionType == IHTMLPartitionTypes.HTML_COMMENT)) {
-		// processors = new IContentAssistProcessor[]{new
-		// HTMLContentAssistProcessor()};
-		// }
-		else if ((partitionType == IXMLPartitions.XML_DEFAULT) || (partitionType == IHTMLPartitionTypes.HTML_DEFAULT) || (partitionType == IHTMLPartitionTypes.HTML_COMMENT) || (partitionType == IJSPPartitionTypes.JSP_DEFAULT) || (partitionType == IJSPPartitionTypes.JSP_DIRECTIVE) || (partitionType == IJSPPartitionTypes.JSP_CONTENT_DELIMITER) || (partitionType == IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT) || (partitionType == IJSPPartitionTypes.JSP_COMMENT)) {
-			// jsp
-			processors = new IContentAssistProcessor[]{new JSPContentAssistProcessor()};
-		}
-		else if ((partitionType == IXMLPartitions.XML_CDATA) || (partitionType == IJSPPartitionTypes.JSP_CONTENT_JAVA)) {
-			// jsp java
-			processors = new IContentAssistProcessor[]{new JSPJavaContentAssistProcessor()};
-		}
-		else if (partitionType == IJSPPartitionTypes.JSP_DEFAULT_EL) {
-			// jsp el
-			processors = new IContentAssistProcessor[]{new JSPELContentAssistProcessor()};
-		}
-		else if (partitionType == IStructuredPartitionTypes.UNKNOWN_PARTITION) {
-			// unknown
-			processors = new IContentAssistProcessor[]{new NoRegionContentAssistProcessorForJSP()};
-		}
-
-		return processors;
-	}
-
-	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
-		MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);
-
-		formatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
-		formatter.setSlaveStrategy(new FormattingStrategyJSPJava(), IJSPPartitionTypes.JSP_CONTENT_JAVA);
-
-		return formatter;
-	}
-
-	public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
-		ITextDoubleClickStrategy strategy = null;
-
-		// html or javascript
-		if (contentType == IHTMLPartitionTypes.HTML_DEFAULT || contentType == IHTMLPartitionTypes.SCRIPT)
-			strategy = getHTMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, contentType);
-		else if (contentType == IJSPPartitionTypes.JSP_CONTENT_JAVA || contentType == IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT)
-			// JSP Java or JSP JavaScript
-			strategy = getJavaSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, contentType);
-		else if (contentType == IJSPPartitionTypes.JSP_DEFAULT)
-			// JSP (just treat like html)
-			strategy = getHTMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, IHTMLPartitionTypes.HTML_DEFAULT);
-		else
-			strategy = super.getDoubleClickStrategy(sourceViewer, contentType);
-
-		return strategy;
-	}
-
-	private StructuredTextViewerConfiguration getHTMLSourceViewerConfiguration() {
-		if (fHTMLSourceViewerConfiguration == null) {
-			fHTMLSourceViewerConfiguration = new StructuredTextViewerConfigurationHTML();
-		}
-		return fHTMLSourceViewerConfiguration;
-	}
-
-	public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
-		if (fPreferenceStore == null)
-			return null;
-		if (sourceViewer == null || !fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED))
-			return null;
-
-		List allDetectors = new ArrayList(0);
-		allDetectors.add(new JSPJavaHyperlinkDetector());
-		allDetectors.add(new TaglibHyperlinkDetector());
-		allDetectors.add(new XMLHyperlinkDetector());
-
-		IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer);
-		for (int m = 0; m < superDetectors.length; m++) {
-			IHyperlinkDetector detector = superDetectors[m];
-			if (!allDetectors.contains(detector)) {
-				allDetectors.add(detector);
-			}
-		}
-		return (IHyperlinkDetector[]) allDetectors.toArray(new IHyperlinkDetector[0]);
-	}
-
-	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;
-	}
-
-	protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
-		IInformationProvider provider = null;
-		if (partitionType == IHTMLPartitionTypes.HTML_DEFAULT) {
-			// HTML
-			IInformationPresenter htmlPresenter = getHTMLSourceViewerConfiguration().getInformationPresenter(sourceViewer);
-			provider = htmlPresenter.getInformationProvider(IHTMLPartitionTypes.HTML_DEFAULT);
-		}
-		else if (partitionType == IHTMLPartitionTypes.SCRIPT) {
-			// HTML JavaScript
-			IInformationPresenter htmlPresenter = getHTMLSourceViewerConfiguration().getInformationPresenter(sourceViewer);
-			provider = htmlPresenter.getInformationProvider(IHTMLPartitionTypes.SCRIPT);
-		}
-		else if (partitionType == IXMLPartitions.XML_DEFAULT) {
-			// XML
-			IInformationPresenter xmlPresenter = getXMLSourceViewerConfiguration().getInformationPresenter(sourceViewer);
-			provider = xmlPresenter.getInformationProvider(IXMLPartitions.XML_DEFAULT);
-		}
-		return provider;
-	}
-
-	private JavaSourceViewerConfiguration getJavaSourceViewerConfiguration() {
-		if (fJavaSourceViewerConfiguration == null) {
-			IPreferenceStore store = PreferenceConstants.getPreferenceStore();
-			JavaTextTools javaTextTools = new JavaTextTools(store);
-			/*
-			 * 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(javaTextTools.getColorManager(), store, null, IJavaPartitions.JAVA_PARTITIONING);
-		}
-		return fJavaSourceViewerConfiguration;
-	}
-
-	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
-		LineStyleProvider[] providers = null;
-
-		if (partitionType == IHTMLPartitionTypes.HTML_DEFAULT || partitionType == IHTMLPartitionTypes.HTML_COMMENT || partitionType == IHTMLPartitionTypes.HTML_DECLARATION) {
-			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitionTypes.HTML_DEFAULT);
-		}
-		else if (partitionType == IHTMLPartitionTypes.SCRIPT || partitionType == IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT) {
-			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitionTypes.SCRIPT);
-		}
-		else if (partitionType == ICSSPartitionTypes.STYLE) {
-			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, ICSSPartitionTypes.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 == IJSPPartitionTypes.JSP_CONTENT_JAVA) {
-			providers = new LineStyleProvider[]{getLineStyleProviderForJava()};
-		}
-		else if (partitionType == IJSPPartitionTypes.JSP_DEFAULT_EL) {
-			providers = new LineStyleProvider[]{getLineStyleProviderForJSPEL()};
-		}
-		else if (partitionType == IJSPPartitionTypes.JSP_COMMENT || partitionType == IJSPPartitionTypes.JSP_CONTENT_DELIMITER || partitionType == IJSPPartitionTypes.JSP_DEFAULT || partitionType == IJSPPartitionTypes.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 ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
-		ITextHover hover = null;
-
-		if (contentType == IHTMLPartitionTypes.HTML_DEFAULT || contentType == IHTMLPartitionTypes.SCRIPT) {
-			// html and javascript regions
-			hover = getHTMLSourceViewerConfiguration().getTextHover(sourceViewer, contentType, stateMask);
-		}
-		else if (contentType == IXMLPartitions.XML_DEFAULT) {
-			// xml regions
-			hover = getXMLSourceViewerConfiguration().getTextHover(sourceViewer, contentType, stateMask);
-		}
-		else if ((contentType == IJSPPartitionTypes.JSP_DEFAULT) || (contentType == IJSPPartitionTypes.JSP_DIRECTIVE) || (contentType == IJSPPartitionTypes.JSP_CONTENT_JAVA)) {
-			TextHoverManager manager = SSEUIPlugin.getDefault().getTextHoverManager();
-			TextHoverManager.TextHoverDescriptor[] hoverDescs = manager.getTextHovers();
-			int i = 0;
-			while (i < hoverDescs.length && hover == null) {
-				if (hoverDescs[i].isEnabled() && EditorUtility.computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
-					String hoverType = hoverDescs[i].getId();
-					if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType)) {
-						if ((contentType == IJSPPartitionTypes.JSP_DEFAULT) || (contentType == IJSPPartitionTypes.JSP_DIRECTIVE)) {
-							// JSP
-							hover = manager.createBestMatchHover(new JSPTagInfoHoverProcessor());
-						}
-						else {
-							// JSP Java
-							hover = manager.createBestMatchHover(new JSPJavaJavadocHoverProcessor());
-						}
-					}
-					else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType)) {
-						if ((contentType == IJSPPartitionTypes.JSP_DEFAULT) || (contentType == IJSPPartitionTypes.JSP_DIRECTIVE)) {
-							// JSP
-							hover = new JSPTagInfoHoverProcessor();
-						}
-						else {
-							// JSP Java
-							hover = new JSPJavaJavadocHoverProcessor();
-						}
-					}
-				}
-				i++;
-			}
-		}
-
-		// no appropriate text hovers found, try super
-		if (hover == null)
-			hover = super.getTextHover(sourceViewer, contentType, stateMask);
-		return hover;
-	}
-
-	private StructuredTextViewerConfiguration getXMLSourceViewerConfiguration() {
-		if (fXMLSourceViewerConfiguration == null) {
-			fXMLSourceViewerConfiguration = new StructuredTextViewerConfigurationXML();
-		}
-		return fXMLSourceViewerConfiguration;
-	}
-}
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
deleted file mode 100644
index a400780..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionConstantsJSP.java
+++ /dev/null
@@ -1,19 +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
- *******************************************************************************/
-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
deleted file mode 100644
index f90607e..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionDefinitionIdsJSP.java
+++ /dev/null
@@ -1,21 +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
- *******************************************************************************/
-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
deleted file mode 100644
index aeff150..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java
+++ /dev/null
@@ -1,96 +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.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;
-
-	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 _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_JSP;
-	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 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;
-	
-	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;
-	}
-}
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
deleted file mode 100644
index 8aaeba0..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPlugin.java
+++ /dev/null
@@ -1,98 +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
- *******************************************************************************/
-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);
-			
-			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
deleted file mode 100644
index a447662..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
+++ /dev/null
@@ -1,74 +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
-###############################################################################
-## 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}.
-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
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
deleted file mode 100644
index a4373ab..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/Logger.java
+++ /dev/null
@@ -1,144 +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
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal;
-
-import java.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);
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 2a2c4f8..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/AutoEditStrategyForTabs.java
+++ /dev/null
@@ -1,187 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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
deleted file mode 100644
index 757faa7..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java
+++ /dev/null
@@ -1,104 +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
- *******************************************************************************/
-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.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.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-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) {
-					if (command.text.equals("%")) { //$NON-NLS-1$
-						// scriptlet - add end %>
-						IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
-						if (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("{")) { //$NON-NLS-1$
-						IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
-						if ((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();
-		}
-	}
-
-	/**
-	 * 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;
-		}
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index f074770..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/AbstractBreakpointProvider.java
+++ /dev/null
@@ -1,268 +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
- *******************************************************************************/
-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
deleted file mode 100644
index f436070..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaBreakpointProvider.java
+++ /dev/null
@@ -1,105 +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
- *******************************************************************************/
-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
deleted file mode 100644
index d32295c..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaScriptBreakpointProvider.java
+++ /dev/null
@@ -1,81 +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
- *******************************************************************************/
-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
deleted file mode 100644
index 2827c09..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
+++ /dev/null
@@ -1,172 +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
- *******************************************************************************/
-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.Status;
-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.internal.provisional.text.IJSPPartitionTypes;
-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 String fClassPattern = 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; //res.getName();// res.getFullPath().removeFirstSegments(2).toString();
-				IBreakpoint point = JDIDebugModel.createStratumBreakpoint(res, "JSP", res.getName(), path, getClassPattern(), 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(), 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$
-				}
-			}
-		}
-		if (status == null) {
-			status = new Status(IStatus.OK, JSPUIPlugin.ID, IStatus.OK, JSPUIMessages.OK, null);
-		}
-		return status;
-	}
-
-	private String getClassPattern() {
-		return fClassPattern;
-	}
-
-
-	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 == IJSPPartitionTypes.JSP_CONTENT_JAVA || type == IJSPPartitionTypes.JSP_DIRECTIVE) {
-							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 {
-		if (data != null) {
-			if (data instanceof String && data.toString().length() > 0) {
-				fClassPattern = (String) 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
deleted file mode 100644
index 68580d9..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavascriptLineBreakpoint.java
+++ /dev/null
@@ -1,64 +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
- *******************************************************************************/
-/*
- * 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/BeanInfoProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/BeanInfoProvider.java
deleted file mode 100644
index 1b74c67..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/BeanInfoProvider.java
+++ /dev/null
@@ -1,442 +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
- *******************************************************************************/
-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 java.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
deleted file mode 100644
index d95c7fb..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.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 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.internal.util.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
deleted file mode 100644
index 7487e3c..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IBeanInfoProvider.java
+++ /dev/null
@@ -1,20 +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
- *******************************************************************************/
-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
deleted file mode 100644
index 1606a2e..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IJavaPropertyDescriptor.java
+++ /dev/null
@@ -1,27 +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
- *******************************************************************************/
-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
deleted file mode 100644
index 0741695..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java
+++ /dev/null
@@ -1,273 +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
- *******************************************************************************/
-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.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.jst.jsp.ui.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.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;
-import org.osgi.framework.BundleException;
-
-
-/**
- * @plannedfor 1.0
- */
-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;
-
-	/**
-	 * 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);
-
-		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)
-				fTranslationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
-			if (fTranslationAdapter != null) {
-
-				JSPTranslation translation = fTranslationAdapter.getJSPTranslation();
-				fJavaPosition = translation.getJavaOffset(getDocumentPosition());
-
-				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, 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.
-	 */
-	protected void initializeJavaPlugins() {
-		try {
-			Bundle bundle = Platform.getBundle(JDT_CORE_PLUGIN_ID);
-			bundle.start();
-		}
-		catch (BundleException exc) {
-			Logger.logException("Could not initialize the JDT Plugins", exc);//$NON-NLS-1$
-		}
-	}
-
-	public void release() {
-		fTranslationAdapter = null;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index e0e6c3b..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
-import org.eclipse.jface.text.ITextViewer;
-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  {
-
-	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) {
-		super.apply(viewer, trigger, stateMask, offset);
-		viewer.setSelectedRange(getCursorPosition(), 0);
-	}
-}
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
deleted file mode 100644
index 77a04bb..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java
+++ /dev/null
@@ -1,1200 +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
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-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.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.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-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.provisional.text.IJSPPartitionTypes;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-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.preferences.JSPUIPreferenceNames;
-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.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.JSPCMDocument;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
-import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor;
-import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
-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.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.IStructuredPartitionTypes;
-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.internal.util.StringUtils;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-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.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.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction;
-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.provisional.text.IXMLPartitions;
-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.NonValidatingModelQueryAction;
-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.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
- * 
- * @plannedfor 1.0
- */
-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();
-
-	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());
-	}
-
-	/**
-	 * 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();
-		JavaScriptContentAssistProcessor javascriptProcessor = new JavaScriptContentAssistProcessor();
-
-		fPartitionToProcessorMap.put(IHTMLPartitionTypes.HTML_DEFAULT, htmlProcessor);
-		fPartitionToProcessorMap.put(IXMLPartitions.XML_DEFAULT, xmlProcessor);
-		fPartitionToProcessorMap.put(IStructuredPartitionTypes.DEFAULT_PARTITION, htmlProcessor);
-		fPartitionToProcessorMap.put(IJSPPartitionTypes.JSP_DEFAULT, jspJavaProcessor);
-		fPartitionToProcessorMap.put(IJSPPartitionTypes.JSP_DIRECTIVE, xmlProcessor);
-		fPartitionToProcessorMap.put(IHTMLPartitionTypes.HTML_COMMENT, htmlProcessor);
-		fPartitionToProcessorMap.put(IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT, javascriptProcessor);
-		fPartitionToProcessorMap.put(IJSPPartitionTypes.JSP_DEFAULT_EL, jspJavaProcessor);
-		fPartitionToProcessorMap.put(IHTMLPartitionTypes.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) {
-		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;
-		}
-
-		String attributeName = null;
-		if (nameRegion != null)
-			attributeName = open.getText(nameRegion);
-		String currentValue = null;
-		if (attributeName != null)
-			currentValue = node.getAttributes().getNamedItem(attributeName).getNodeValue();
-
-		// on an empty value, add all the JSP and taglib tags
-		if ((contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS && contentAssistRequest.getReplacementLength() == 0) || (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE && (currentValue == null || currentValue.length() == 0))) {
-			List rejectElements = new ArrayList();
-			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.DIRECTIVE_TAGLIB);
-			rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
-			rejectElements.add(JSP12Namespace.ElementName.USEBEAN);
-			rejectElements.add(JSP12Namespace.ElementName.SETPROPERTY);
-			rejectElements.add(JSP12Namespace.ElementName.FORWARD);
-			rejectElements.add(JSP12Namespace.ElementName.PLUGIN);
-			rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
-			rejectElements.add(JSP12Namespace.ElementName.PARAMS);
-
-			List additionalElements = getAdditionalChildren(new ArrayList(), node, -1);
-			for (i = 0; i < additionalElements.size(); i++) {
-				CMElementDeclaration ed = (CMElementDeclaration) additionalElements.get(i);
-				if (rejectElements.contains(ed.getNodeName()))
-					continue;
-				String tagname = getContentGenerator().getRequiredName(node, ed);
-				StringBuffer contents = new StringBuffer("\""); //$NON-NLS-1$
-				getContentGenerator().generateTag(node, ed, contents);
-				contents.append('"');
-				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$
-			}
-		}
-
-
-	}
-
-	private List getAdditionalChildren(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);
-				// this shouldn't have to have the prefix coded in
-				if (!(doc != null && (doc instanceof JSPCMDocument || doc instanceof CMNodeWrapper || node.getNodeName().startsWith("jsp:")))) { //$NON-NLS-1$
-					// get jsp namespace elements and insert their contents
-					CMDocument JCMDoc = HTMLCMDocumentFactory.getCMDocument(CMDocType.JSP11_DOC_TYPE);
-					CMNamedNodeMap jspelements = JCMDoc.getElements();
-
-					if (jspelements != null) {
-						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
-						if (!isXMLFormat(domDoc)) {
-							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);
-						}
-						// always exclude jsp:directive.taglib
-						if (isInternalAdapter) {
-							rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
-							rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
-							rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
-							rejectElements.add(JSP12Namespace.ElementName.USEBEAN);
-							rejectElements.add(JSP12Namespace.ElementName.SETPROPERTY);
-							rejectElements.add(JSP12Namespace.ElementName.FORWARD);
-							rejectElements.add(JSP12Namespace.ElementName.PLUGIN);
-							rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
-							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);
-						}
-					}
-				}
-			}
-		}
-		return elementDecls;
-	}
-
-	protected List getAvailableChildrenAtIndex(Element parent, int index, int validityChecking) {
-		List list = new ArrayList();
-		List additionalElements = getAdditionalChildren(new ArrayList(), parent, index);
-		for (int i = 0; i < additionalElements.size(); i++) {
-			ModelQueryAction insertAction = new NonValidatingModelQueryAction((CMElementDeclaration) additionalElements.get(i), ModelQueryAction.INSERT, 0, parent.getChildNodes().getLength(), null);
-			list.add(insertAction);
-		}
-
-		// add allowed children of implicit tags that don't already exist
-		NodeList children = parent.getChildNodes();
-		List childNames = new ArrayList();
-		if (children != null) {
-			for (int i = 0; i < children.getLength(); i++) {
-				Node child = children.item(i);
-				if (child.getNodeType() == Node.ELEMENT_NODE)
-					childNames.add(child.getNodeName().toLowerCase());
-			}
-		}
-		List allActions = new ArrayList();
-		Iterator iterator = list.iterator();
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(parent.getOwnerDocument());
-		while (iterator.hasNext()) {
-			ModelQueryAction action = (ModelQueryAction) iterator.next();
-			allActions.add(action);
-			if (action.getCMNode() instanceof HTMLElementDeclaration) {
-				HTMLElementDeclaration ed = (HTMLElementDeclaration) action.getCMNode();
-				String ommission = (String) ed.getProperty(HTMLCMProperties.OMIT_TYPE);
-				if (!childNames.contains(ed.getNodeName().toLowerCase()) && ((ommission != null) && (ommission.equals(HTMLCMProperties.Values.OMIT_BOTH)))) {
-					List implicitValidActions = new ArrayList();
-					modelQuery.getInsertActions(parent, ed, 0, ModelQuery.INCLUDE_CHILD_NODES, ModelQuery.VALIDITY_NONE, implicitValidActions);
-					if (implicitValidActions != null) {
-						Iterator implicitValidActionsIterator = implicitValidActions.iterator();
-						while (implicitValidActionsIterator.hasNext()) {
-							ModelQueryAction insertAction = new NonValidatingModelQueryAction(((ModelQueryAction) implicitValidActionsIterator.next()).getCMNode(), ModelQueryAction.INSERT, 0, parent.getChildNodes().getLength(), null);
-							allActions.add(insertAction);
-						}
-					}
-				}
-			}
-		}
-		return allActions;
-	}
-
-	protected List getAvailableRootChildren(Document document, int childIndex) {
-		List list = new ArrayList();
-		if (!isXMLFormat(document))
-			getAdditionalChildren(list, document, childIndex);
-		return list;
-	}
-
-	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((StructuredTextViewer) viewer, documentPosition);
-		fViewer = viewer;
-		ICompletionProposal[] jspResults = EMPTY_PROPOSAL_SET;
-		ICompletionProposal[] embeddedResults = EMPTY_PROPOSAL_SET;
-
-		// check the actual partition type
-		String partitionType = getPartitionType((StructuredTextViewer) 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 == IJSPPartitionTypes.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 == IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitionTypes.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 == IJSPPartitionTypes.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((StructuredTextViewer) 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((StructuredTextViewer) viewer, documentPosition - 1);
-						if (checkType != IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT) { // this
-							// check
-							// is
-							// failing
-							// for
-							// XML-JSP
-							// (region
-							// is
-							// not
-							// javascript...)
-							return getJSPJavaCompletionProposals(viewer, documentPosition);
-						} 
-						partitionType = IJSPPartitionTypes.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((StructuredTextViewer) viewer, documentPosition - 1);
-							if (checkType != IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT) {
-								return getJSPJavaCompletionProposals(viewer, documentPosition);
-							} 
-							partitionType = IJSPPartitionTypes.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 == IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitionTypes.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 (!(p instanceof JavaScriptContentAssistProcessor || p instanceof CSSContentAssistProcessor)) {
-			fTemplateContexts.clear();
-			jspResults = super.computeCompletionProposals(viewer, documentPosition);
-		}
-		if (useEmbeddedResults) {
-			if (embeddedResults != null && embeddedResults.length > 0) {
-				List results = new ArrayList();
-				for (int i = 0; i < embeddedResults.length; i++)
-					results.add(embeddedResults[i]);
-				if (jspResults != null) {
-					for (int i = 0; i < jspResults.length; i++)
-						results.add(jspResults[i]);
-				}
-				jspResults = new ICompletionProposal[results.size()];
-				Collections.sort(results, new ProposalComparator());
-				for (int i = 0; i < results.size(); i++)
-					jspResults[i] = (ICompletionProposal) results.get(i);
-
-			}
-		}
-		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 == IJSPPartitionTypes.JSP_COMMENT) {
-			if (sdRegion.getStartOffset() == documentPosition) {
-				ICompletionProposal[] htmlResults = getHTMLCompletionProposals(viewer, documentPosition);
-				jspResults = merge(jspResults, htmlResults);
-			}
-		}
-		return jspResults;
-	}
-
-	/**
-	 * Adds 2 arrays of ICompletionProposals and sorts them with a
-	 * ProposalComparator.
-	 * 
-	 * @param jspResults
-	 * @param htmlResults
-	 * @return
-	 */
-	private ICompletionProposal[] merge(ICompletionProposal[] jspResults, ICompletionProposal[] htmlResults) {
-		List results = new ArrayList();
-		List jsps = Arrays.asList(jspResults);
-		List htmls = Arrays.asList(htmlResults);
-
-		results.addAll(jsps);
-		results.addAll(htmls);
-
-		Collections.sort(results, new ProposalComparator());
-		return (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()]);
-	}
-
-	/*
-	 * 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(IHTMLPartitionTypes.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(IJSPPartitionTypes.JSP_DEFAULT);
-		return p.computeCompletionProposals(viewer, documentPosition);
-	}
-
-	/**
-	 * @param viewer
-	 * @param documentPosition
-	 * @return String
-	 */
-	protected String getPartitionType(StructuredTextViewer viewer, int documentPosition) {
-		String partitionType = null;
-		try {
-			partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, viewer.modelOffset2WidgetOffset(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() {
-		IPreferenceStore store = JSPUIPlugin.getDefault().getPreferenceStore();
-		String key = JSPUIPreferenceNames.AUTO_PROPOSE_CODE;
-
-		String chars = store.getString(key);
-		return (chars != null) ? chars.toCharArray() : new char[0];
-	}
-
-	/*
-	 * @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((StructuredTextViewer) 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));
-				}
-			}
-		}
-		
-		addTemplates(request, TemplateContextTypeIdsJSP.ALL);
-		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) {
-		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, contentAssistRequest.getReplacementBeginPosition());
-				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);
-
-		super.addTagInsertionProposals(contentAssistRequest, childPosition);
-		if (isInternalAdapter)
-			useEmbeddedResults = false;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index cbab2b8..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java
+++ /dev/null
@@ -1,310 +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
- *******************************************************************************/
-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.XMLContentModelGenerator;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This class is a "null" version of AbstractContentAssistProcessor
- * 
- * @plannedfor 1.0
- */
-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 void addXMLProposal(ContentAssistRequest contentAssistRequest) {
-		super.addXMLProposal(contentAssistRequest);
-	}
-
-
-	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);
-	}
-
-}
\ No newline at end of file
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
deleted file mode 100644
index 0ef4b79..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-
-public class JSPELCompletionProcessor extends JSPCompletionProcessor {
-	protected JSPProposalCollector getProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
-		return new JSPELProposalCollector(cu, translation);
-	}
-}
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
deleted file mode 100644
index 0d717f2..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java
+++ /dev/null
@@ -1,139 +0,0 @@
-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;
-
-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((StructuredTextViewer) 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
deleted file mode 100644
index ecad40e..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java
+++ /dev/null
@@ -1,77 +0,0 @@
-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() + 1;
-			
-			// replacement length
-			int length = proposal.getReplaceEnd() - offset + 1;
-			
-			// 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);
-			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/JSPJavaContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
deleted file mode 100644
index 177b99d..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
+++ /dev/null
@@ -1,239 +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
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.jst.jsp.core.internal.provisional.text.IJSPPartitionTypes;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-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.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.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
- */
-public class JSPJavaContentAssistProcessor implements IContentAssistProcessor, IReleasable {
-	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;
-
-	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((StructuredTextViewer) 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() {
-		return completionProposalAutoActivationCharacters;
-	}
-
-	/**
-	 * 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() {
-		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 == IJSPPartitionTypes.JSP_DEFAULT || type == IJSPPartitionTypes.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();
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 416ca67..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java
+++ /dev/null
@@ -1,259 +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
- *******************************************************************************/
-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.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.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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.util.StringUtils;
-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.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;
-
-/**
- * This class computes attribute value completion proposals for &lt;jsp:[gs]etProperty&gt; tags.
- * @plannedfor 1.0
- */
-public class JSPPropertyContentAssistProcessor extends JSPDummyContentAssistProcessor {
-	public JSPPropertyContentAssistProcessor() {
-		super();
-	}
-
-	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
-		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
-		// 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("'")) && contentAssistRequest.getMatchString().length() > 0) //$NON-NLS-1$ //$NON-NLS-2$
-			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);
-			}
-		}
-	}
-
-	private void addBeanPropertyProposals(ContentAssistRequest contentAssistRequest, IDOMNode node, boolean isGetProperty, String matchString) {
-		// 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 != null && 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 (useBean.getAttribute(JSP11Namespace.ATTR_NAME_ID).equals(useBeanName)) {
-							typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_CLASS);
-							if (typeName == null || typeName.length() < 1) {
-								typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_TYPE);
-							}
-							if (typeName == null || 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 = 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);
-							}
-						}
-					}
-				}
-			}
-		}
-	}
-
-	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()) {
-					id = StringUtils.strip(useBean.getAttribute(JSP11Namespace.ATTR_NAME_ID));
-					displayString = null;
-					classOrType = null;
-					imageName = JSPEditorPluginImages.IMG_OBJ_CLASS_OBJ;
-					// set the Image based on whether the class, type, or beanName attribute is present
-					classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_CLASS);
-					if (classOrType == null || classOrType.length() < 1) {
-						classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_TYPE);
-						imageName = JSPEditorPluginImages.IMG_OBJ_PUBLIC;
-					}
-					if (classOrType == null || classOrType.length() < 1) {
-						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);
-						}
-					}
-				}
-			}
-		}
-	}
-	
-	/**
-	 * Returns project request is in
-	 * 
-	 * @param request
-	 * @return
-	 */
-	private 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;
-	}
-}
\ 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
deleted file mode 100644
index af7392d..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
+++ /dev/null
@@ -1,194 +0,0 @@
-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.Signature;
-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.JSP2ServletNameUtil;
-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 String fJspName;
-	private String fMangledName;
-	private JSPTranslation fTranslation;
-	private Comparator fComparator;
-	
-	public JSPProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
-		super(cu);
-		if(cu != null) {
-			// set some names for fixing up mangled name in proposals
-			// set mangled (servlet) name
-			String cuName = cu.getPath().lastSegment();
-			setMangledName(cuName.substring(0, cuName.lastIndexOf('.')));
-			// set name of jsp file
-			String unmangled = JSP2ServletNameUtil.unmangle(cuName);
-			setJspName(unmangled.substring(unmangled.lastIndexOf('/') + 1));
-		}
-		
-		if(translation == null)
-			throw new IllegalArgumentException("JSPTranslation cannot be null"); //$NON-NLS-1$
-		
-		fTranslation = translation;
-	}
-
-	/**
-	 * 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;
-		
-		// from proposal
-		String completion = String.valueOf(proposal.getCompletion());
-		String mangledName = getMangledName();
-		
-		// ignore constructor proposals
-		// (they will include mangled servlet name)
-		if(mangledName != null && completion.indexOf(mangledName) == -1) {
-			
-			// 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);
-			Image image = javaProposal.getImage();
-			String displayString = javaProposal.getDisplayString();
-			displayString = fixupDisplayString(displayString);
-			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);
-		}
-		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;
-	}
-
-	/**
-	 * Replaces mangled (servlet) name with jsp file name.
-	 * 
-	 * @param displayString
-	 * @return
-	 */
-	private String fixupDisplayString(String displayString) {
-		StringBuffer fixedName = new StringBuffer(displayString);
-		String mangledName = getMangledName();
-		if(mangledName != null) {
-			int index = displayString.indexOf(mangledName);
-			if(index != -1) {
-				fixedName = new StringBuffer();
-				fixedName.append(displayString.substring(0, index));
-				fixedName.append(getJspName());
-				fixedName.append(displayString.substring(index + mangledName.length()));
-			}
-		}
-		return fixedName.toString();
-	}
-	
-	private String getMangledName() {
-		return fMangledName;
-	}
-
-	private void setMangledName(String mangledName) {
-		fMangledName = mangledName;
-	}
-
-	private String getJspName() {
-		return fJspName;
-	}
-
-	private void setJspName(String jspName) {
-		fJspName = jspName;
-	}
-	
-	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/JSPTemplateCompletionProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplateCompletionProcessor.java
deleted file mode 100644
index f3214dc..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplateCompletionProcessor.java
+++ /dev/null
@@ -1,79 +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
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-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.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.
- * 
- * @plannedfor 1.0
- */
-class JSPTemplateCompletionProcessor extends TemplateCompletionProcessor {
-	private String fContextTypeId = 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 JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP);
-	}
-
-	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/JSPUseBeanContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java
deleted file mode 100644
index ac2997a..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java
+++ /dev/null
@@ -1,173 +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
- *******************************************************************************/
-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.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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.util.StringUtils;
-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;
-
-/**
- * @plannedfor 1.0
- */
-public class JSPUseBeanContentAssistProcessor extends JSPDummyContentAssistProcessor {
-
-	public JSPUseBeanContentAssistProcessor() {
-		super();
-	}
-
-	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
-
-		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
-		// 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 = 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 = 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 = 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);
-						}
-					}
-				}
-			}
-		}
-	}
-
-	/**
-	 * Returns project request is in
-	 * 
-	 * @param request
-	 * @return
-	 */
-	private 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;
-	}
-
-}
\ No newline at end of file
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
deleted file mode 100644
index 3eb1f56..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaParameterListValidator.java
+++ /dev/null
@@ -1,216 +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
- *******************************************************************************/
-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;
-        }
-        
-        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
deleted file mode 100644
index f6d877a..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java
+++ /dev/null
@@ -1,300 +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
- *******************************************************************************/
-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.internal.util.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);
-	}
-
-}
\ No newline at end of file
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
deleted file mode 100644
index b3120d6..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeFinder.java
+++ /dev/null
@@ -1,134 +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
- *******************************************************************************/
-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;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index c254d14..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeNameRequestor.java
+++ /dev/null
@@ -1,121 +0,0 @@
-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.javascript.ui.internal.common.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/NoRegionContentAssistProcessorForJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java
deleted file mode 100644
index 43ca5b6..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java
+++ /dev/null
@@ -1,96 +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
- *******************************************************************************/
-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.provisional.text.IJSPPartitionTypes;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
-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.internal.provisional.text.IStructuredPartitionTypes;
-import org.eclipse.wst.xml.core.internal.provisional.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(IStructuredPartitionTypes.DEFAULT_PARTITION, jspContentAssistProcessor);
-		addPartitionProcessor(IXMLPartitions.XML_DEFAULT, jspContentAssistProcessor);
-		addPartitionProcessor(IHTMLPartitionTypes.HTML_DEFAULT, jspContentAssistProcessor);
-		addPartitionProcessor(IHTMLPartitionTypes.HTML_COMMENT, jspContentAssistProcessor);
-		addPartitionProcessor(IJSPPartitionTypes.JSP_DEFAULT, jspContentAssistProcessor);
-		addPartitionProcessor(IJSPPartitionTypes.JSP_DIRECTIVE, jspContentAssistProcessor);
-		addPartitionProcessor(IJSPPartitionTypes.JSP_CONTENT_DELIMITER, jspContentAssistProcessor);
-		addPartitionProcessor(IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT, jspContentAssistProcessor);
-
-		IContentAssistProcessor jspJavaContentAssistProcessor = new JSPJavaContentAssistProcessor();
-		addPartitionProcessor(IJSPPartitionTypes.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(IJSPPartitionTypes.JSP_CONTENT_JAVA);
-		}
-		return p;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 0a7cdec..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/derived/SingleCharReader.java
+++ /dev/null
@@ -1,66 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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
deleted file mode 100644
index fec333c..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java
+++ /dev/null
@@ -1,90 +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
- *******************************************************************************/
-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.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.DOT);
-		this.renameElementAction.setActionDefinitionId(IActionDefinitionIdsJSP.RENAME_ELEMENT);
-		
-		this.moveElementAction = new RetargetTextEditorAction(bundle, IActionConstantsJSP.ACTION_NAME_MOVE_ELEMENT + StructuredTextEditorActionConstants.DOT);
-		this.moveElementAction.setActionDefinitionId(IActionDefinitionIdsJSP.MOVE_ELEMENT);
-		
-		// 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
deleted file mode 100644
index a07242c..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,53 +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
- *******************************************************************************/
-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$
-}
\ No newline at end of file
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
deleted file mode 100644
index b659b9b..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImageHelper.java
+++ /dev/null
@@ -1,179 +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
- *******************************************************************************/
-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;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index d86c04b..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImages.java
+++ /dev/null
@@ -1,48 +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
- *******************************************************************************/
-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.gif"; //$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
deleted file mode 100644
index d31cb31..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSourceEditingTextTools.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-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);
-					String langValue = pageDirective.getAttribute(JSP11Namespace.ATTR_NAME_LANGUAGE);
-					// last one to declare a language wins
-					if (langValue != null)
-						language = langValue;
-				}
-			}
-		}
-		// 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
deleted file mode 100644
index 2c9b02d..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java
+++ /dev/null
@@ -1,110 +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
- *******************************************************************************/
-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/hyperlink/ExternalFileEditorInput.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileEditorInput.java
deleted file mode 100644
index 4b50266..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileEditorInput.java
+++ /dev/null
@@ -1,160 +0,0 @@
-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
deleted file mode 100644
index f25d937..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ /dev/null
@@ -1,60 +0,0 @@
-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.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 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() {
-		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.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
deleted file mode 100644
index 539f959..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import org.eclipse.jdt.core.IJavaElement;
-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.Logger;
-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() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
-	 */
-	public String getHyperlinkText() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (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
deleted file mode 100644
index be5c52d..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java
+++ /dev/null
@@ -1,237 +0,0 @@
-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.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-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.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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 implements IHyperlinkDetector {
-
-	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) {
-						String uriString = sModel.getResolver().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 && file.exists()) {
-						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) {
-			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;
-	}
-	/**
-	 * 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/TaglibHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
deleted file mode 100644
index 3422b2d..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
+++ /dev/null
@@ -1,230 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-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.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.URLHyperlink;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.jst.jsp.core.internal.provisional.text.IJSPPartitionTypes;
-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.ui.internal.Logger;
-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.StructuredModelManager;
-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.util.StringUtils;
-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.Element;
-import org.w3c.dom.Node;
-
-/**
- * Detects hyperlinks for taglibs.
- */
-public class TaglibHyperlinkDetector implements IHyperlinkDetector {
-	private final String HTTP_PROTOCOL = "http://";//$NON-NLS-1$
-
-	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() == IJSPPartitionTypes.JSP_DIRECTIVE) {
-						// check if jsp taglib directive
-						Node currentNode = getCurrentNode(doc, region.getOffset());
-						if (currentNode != null && currentNode.getNodeType() == Node.ELEMENT_NODE && JSP11Namespace.ElementName.DIRECTIVE_TAGLIB.equalsIgnoreCase(currentNode.getNodeName())) {
-							// get the uri attribute
-							Attr taglibNode = ((Element) currentNode).getAttributeNode(JSP11Namespace.ATTR_NAME_URI);
-							ITaglibRecord reference = TaglibIndex.resolve(getBaseLocationForTaglib(doc), taglibNode.getValue(), false);
-							if (reference != null) {
-								// handle taglibs
-								switch (reference.getRecordType()) {
-									case (ITaglibRecord.TLD) : {
-										ITLDRecord record = (ITLDRecord) reference;
-										String uriString = record.getPath().toString();
-										IRegion hyperlinkRegion = getHyperlinkRegion(taglibNode);
-										hyperlink = createHyperlink(uriString, hyperlinkRegion, doc, taglibNode);
-									}
-										break;
-									case (ITaglibRecord.JAR) :
-									case (ITaglibRecord.URL) : {
-										IRegion hyperlinkRegion = getHyperlinkRegion(taglibNode);
-										hyperlink = new TaglibJarUriHyperlink(hyperlinkRegion, reference);
-									}
-								}
-							}
-						}
-					}
-				}
-				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 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 = ++regOffset;
-						regLength = regLength - 2;
-					}
-					hyperRegion = new Region(regOffset, regLength);
-				}
-			}
-		}
-		return hyperRegion;
-	}
-
-	/**
-	 * Returns an IFile from the given uri if possible, null if cannot find
-	 * file from uri.
-	 * 
-	 * @param fileString
-	 *            file system or workspace-relative 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];
-		}
-		if (file == null) {
-			file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fileString));
-		}
-
-		return file;
-	}
-
-	/**
-	 * 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);
-			}
-
-			// try to locate the file in the workspace
-			IFile file = getFile(uriString);
-			if (file != null && file.exists()) {
-				// 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
-				File externalFile = new File(uriString);
-				link = new ExternalFileHyperlink(hyperlinkRegion, externalFile);
-			}
-		}
-
-		return link;
-	}
-
-	/**
-	 * 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;
-	}
-}
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
deleted file mode 100644
index 6762926..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java
+++ /dev/null
@@ -1,114 +0,0 @@
-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.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() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
-	 */
-	public String getHyperlinkText() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	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
deleted file mode 100644
index 1cf7086..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java
+++ /dev/null
@@ -1,75 +0,0 @@
-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;
-
-/**
- * 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() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
-	 */
-	public String getHyperlinkText() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	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
deleted file mode 100644
index 4ce016f..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java
+++ /dev/null
@@ -1,161 +0,0 @@
-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.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-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;
-
-/**
- * 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 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 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;
-
-	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() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
-	 */
-	public String getHyperlinkText() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (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/WorkspaceFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
deleted file mode 100644
index 17aaa0a..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ /dev/null
@@ -1,79 +0,0 @@
-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.Logger;
-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() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
-	 */
-	public String getHyperlinkText() {
-		// 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).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/XMLHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLHyperlinkDetector.java
deleted file mode 100644
index 3c60920..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLHyperlinkDetector.java
+++ /dev/null
@@ -1,503 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import java.io.File;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-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.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.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;
-
-/**
- * Detects hyperlinks in XML tags. Includes detection in DOCTYPE and attribute
- * values. Resolves references to schemas, dtds, etc using the Common URI
- * Resolver.
- * 
- */
-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.jst.jsp.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 && file.exists()) {
-					// 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 = ++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.exists();
-		}
-		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.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
deleted file mode 100644
index e505f4d..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
+++ /dev/null
@@ -1,372 +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
- *******************************************************************************/
-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 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.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.Document;
-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.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.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.encoding.CodedStreamCreator;
-
-/**
- * Creates document change(s) for an IJavaElement rename.
- * Changes are created for every type "match" in the workspace
- * @author pavery
- */
-public class BasicRefactorSearchRequestor extends SearchRequestor {
-	
-	/**
-	 * 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 SaveJspFileOp
-	
-	/**
-	 * Change class that wraps a text edit on the jsp document
-	 */
-	private class RenameChange extends DocumentChange {
-
-		private TextEdit fEdit = null;
-		private IFile fJSPFile = null;
-		private IDocument fJSPDoc = null;
-		private String fDescription = JSPUIMessages.BasicRefactorSearchRequestor_0;
-		
-		public RenameChange(IFile jspFile, IDocument jspDoc, TextEdit edit, String description) {
-			super(JSPUIMessages.BasicRefactorSearchRequestor_6, jspDoc);
-			this.fEdit = edit;
-			this.fJSPFile = jspFile;
-			this.fJSPDoc = jspDoc;
-			this.fDescription = description;
-		}
-		
-		public RefactoringStatus isValid(IProgressMonitor pm)throws CoreException {
-			return new RefactoringStatus();
-		}
-		
-		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;
-		}
-		
-		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(JSPSearchSupport.getInstance().getProgressMonitor());
-			} catch (InvocationTargetException e) {
-				Logger.logException(e);
-			} catch (InterruptedException e) {
-				Logger.logException(e);
-			}
-		}
-
-		/**
-		 * 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 String getName() {
-			return this.fDescription;
-		}
-		
-		public Object getModifiedElement() {
-			return getElement();
-		}
-	}
-	// end inner class RenameChange
-	
-	
-	/** 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);
-			
-			// add it for the correct document
-			addJavaEdit(searchDoc.getPath(), new ReplaceEdit(javaMatch.getOffset(), javaMatch.getLength(), renameText));
-		}
-	}
-	
-	/**
-	 * @param searchDoc
-	 * @return
-	 */
-	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);
-		}
-	}
-	
-	/**
-	 * 
-	 * @return all JSP changes for the search matches for the given Type
-	 */
-	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()]);
-	}
-	
-	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 RenameChange(searchDoc.getFile(), doc, edit, description);
-	}
-	
-	// 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$
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 1ac5f8a..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
+++ /dev/null
@@ -1,58 +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
- *     
- *******************************************************************************/
-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.internal.provisional.StructuredModelManager;
-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
-			IDOMModel xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(document);
-			try {
-				if (xmlModel != null) {
-					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 (xmlModel != null)
-					xmlModel.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
deleted file mode 100644
index 485ff11..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameChange.java
+++ /dev/null
@@ -1,67 +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
- *******************************************************************************/
-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;
-
-/**
- * @author pavery
- */
-public class JSPMethodRenameChange extends Change {
-
-	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;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index edac9c8..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
+++ /dev/null
@@ -1,80 +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
- *******************************************************************************/
-/*
- * 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.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.jdt.core.JavaModelException;
-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.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-
-/**
- * @author pavery
- */
-public class JSPMethodRenameParticipant extends RenameParticipant {
-	
-	private IMethod fMethod = null;
-	
-	/**
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
-	 */
-	protected boolean initialize(Object element) {
-		if(element instanceof IMethod) {
-			this.fMethod = (IMethod) element;
-			return true;
-		}
-		return false;
-	}
-	
-	/**
-	 * @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 (JavaModelException e) {
-				Logger.logException(e);
-			}
-		}
-		return name;
-	}
-	/* (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(JSPUIMessages.JSP_changes, changes); //$NON-NLS-1$
-		return multiChange;
-	}
-}
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
deleted file mode 100644
index 6147208..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameRequestor.java
+++ /dev/null
@@ -1,47 +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
- *******************************************************************************/
-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
deleted file mode 100644
index 53a3d01..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
+++ /dev/null
@@ -1,153 +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.jst.jsp.ui.internal.java.refactoring;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor;
-import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter;
-import org.eclipse.jdt.internal.ui.refactoring.reorg.CreateTargetQueries;
-import org.eclipse.jdt.internal.ui.refactoring.reorg.ReorgMoveWizard;
-import org.eclipse.jdt.internal.ui.refactoring.reorg.ReorgQueries;
-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.ltk.core.refactoring.participants.MoveRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-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 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) {
-		IJavaElement[] elements = getSelectedElements();
-		if (elements.length > 0) {
-
-			// need to check if it's movable
-			try {
-				JavaMoveProcessor processor = JavaMoveProcessor.create(getResources(elements), elements/*
-																										 * ,
-																										 * getCodeGenerationSettings()
-																										 */);
-				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
-	}
-
-	private IJavaElement[] getSelectedElements() {
-
-		IJavaElement[] elements = new IJavaElement[0];
-		if (fEditor instanceof ITextEditor)
-			elements = JSPJavaSelectionProvider.getSelection((ITextEditor) fEditor);
-		return elements;
-	}
-
-	private IResource[] getResources(IJavaElement[] elements) {
-		IResource[] resources = new IResource[elements.length];
-		for (int i = 0; i < elements.length; i++) {
-			try {
-				resources[i] = elements[i].getPrimaryElement().getCorrespondingResource();// elements[i].getResource();
-			}
-			catch (JavaModelException e) {
-				Logger.logException(e);
-			}
-		}
-		return resources;
-	}
-	
-	/**
-	 * will change post 3.0 with public move support
-	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=61817
-	 */
-	private RefactoringWizard createWizard(MoveRefactoring refactoring) {
-		return new ReorgMoveWizard(refactoring);
-	}
-}
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
deleted file mode 100644
index d15e089..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-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;
-
-/**
- * @author pavery
- */
-public class JSPPackageRenameChange extends Change {
-
-	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;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 3903d39..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
+++ /dev/null
@@ -1,74 +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
- *******************************************************************************/
-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.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.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-
-/**
- * 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#initialize(java.lang.Object)
-	 */
-	protected boolean initialize(Object element) {
-		if(element instanceof IPackageFragment) {
-			this.fPkg = (IPackageFragment) element;
-			return true;
-		}
-		return false;
-	}
-	
-	/**
-	 * @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#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(JSPUIMessages.JSP_changes, changes); //$NON-NLS-1$
-	     return multiChange;
-	}
-	
-	
-}
\ No newline at end of file
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
deleted file mode 100644
index 3cffa0c..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameRequestor.java
+++ /dev/null
@@ -1,41 +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
- *******************************************************************************/
-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/JSPRenameElementActionDelegate.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java
deleted file mode 100644
index f487fc5..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java
+++ /dev/null
@@ -1,109 +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.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/JSPTypeMoveChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java
deleted file mode 100644
index facd680..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java
+++ /dev/null
@@ -1,66 +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
- *******************************************************************************/
-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;
-
-/**
- * @author pavery
- */
-public class JSPTypeMoveChange extends Change {
-
-	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;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 40c80b1..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
+++ /dev/null
@@ -1,82 +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
- *******************************************************************************/
-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.jdt.core.IType;
-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.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
-
-/**
- * @author pavery
- */
-public class JSPTypeMoveParticipant extends MoveParticipant {
-	
-	IType fType = null;
-	
-	/* (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;
-	}
-
-	/* (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#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(JSPUIMessages.JSP_changes, changes); //$NON-NLS-1$
-		}
-		return multiChange;
-	}
-	
-	
-}
\ No newline at end of file
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
deleted file mode 100644
index edd02f2..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
+++ /dev/null
@@ -1,60 +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
- *******************************************************************************/
-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);
-	}
-	
-	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$
-		}
-		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
deleted file mode 100644
index 99f1666..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java
+++ /dev/null
@@ -1,69 +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
- *******************************************************************************/
-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;
-
-
-/**
- * @author pavery
- */
-public class JSPTypeRenameChange extends Change {
-
-	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;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index e6a16de..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
+++ /dev/null
@@ -1,80 +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
- *******************************************************************************/
-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.jdt.core.JavaModelException;
-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.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-
-/**
- * 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#initialize(java.lang.Object)
-	 */
-	protected boolean initialize(Object element) {
-		if(element instanceof IType) {
-			this.fType = (IType) element;
-			return true;
-		}
-		return false;
-	}
-	
-	/**
-	 * @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 (JavaModelException e) {
-				Logger.logException(e);
-			}
-		}
-		return name;
-	}
-
-	/**
-	 * @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(JSPUIMessages.JSP_changes, changes); //$NON-NLS-1$
-		return multiChange;
-	}
-	
-	
-}
\ No newline at end of file
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
deleted file mode 100644
index d93ccf7..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
+++ /dev/null
@@ -1,63 +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
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.java.refactoring;
-
-import java.text.MessageFormat;
-
-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();
-		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
-		if(trans.isImport(javaMatch.getOffset()) || /*trans.isUseBean(javaMatch.getOffset()) ||*/ isFullyQualified(matchText)) {
-			if(!pkg.equals("")) //$NON-NLS-1$
-				renameText = pkg + "." + 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/search/BasicJSPSearchRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/BasicJSPSearchRequestor.java
deleted file mode 100644
index ae3dbc4..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/BasicJSPSearchRequestor.java
+++ /dev/null
@@ -1,141 +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
- *******************************************************************************/
-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$
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 2eaeec0..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesActionDelegate.java
+++ /dev/null
@@ -1,40 +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.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);
-//			 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.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
deleted file mode 100644
index a8742cb..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java
+++ /dev/null
@@ -1,82 +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.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.provisional.text.IJSPPartitionTypes;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.search.ui.ISearchQuery;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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;
-
-/**
- * Configures a FindOccurrencesProcessor with JSP partitions and regions
- */
-public class JSPFindOccurrencesProcessor extends FindOccurrencesProcessor {
-
-	protected String[] getPartitionTypes() {
-		return new String[]{IJSPPartitionTypes.JSP_DEFAULT, IJSPPartitionTypes.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
deleted file mode 100644
index f1d4f8e..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPOccurrencesSearchResult.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-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 ((JSPSearchQuery)getQuery()).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
deleted file mode 100644
index 5f96141..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchQuery.java
+++ /dev/null
@@ -1,117 +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
- *******************************************************************************/
-package org.eclipse.jst.jsp.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.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.osgi.util.NLS;
-import org.eclipse.search.ui.ISearchResult;
-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);
-		this.fElement = element;
-	}
-	
-	public IJavaElement getJavaElement() {
-		return this.fElement;
-	}
-	
-	// for access by inner class
-	public JSPSearchQuery getInstance() {
-		return this;
-	}
-	
-	protected IStatus doQuery() {
-		
-		clearMatches();
-		
-		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[] args = {getSearchText(), getOccurrencesCountText(), getFilename()};
-		return NLS.bind(JSPUIMessages.OccurrencesSearchQuery_0, args);
-	}
-
-	private String getFilename() {
-		String filename = JSPUIMessages.OccurrencesSearchQuery_2;
-		if(getFile() != null)
-			filename = getFile().getName();
-		return filename;
-	}
-	
-	private String getOccurrencesCountText() {
-		String count = ""; //$NON-NLS-1$
-		// pa_TODO make dynamic
-		return count;
-	}
-
-	protected String getSearchText() {
-		return fElement.getElementName();
-	}
-	
-	public boolean canRerun() {
-		
-		return false;
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.ISearchQuery#canRunInBackground()
-	 */
-	public boolean canRunInBackground() {
-		return true;
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.ISearchQuery#getSearchResult()
-	 */
-	public ISearchResult getSearchResult() {
-		
-		return new JSPOccurrencesSearchResult(this);
-	}
-
-}
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
deleted file mode 100644
index 9dc8275..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchRequestor.java
+++ /dev/null
@@ -1,81 +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
- *******************************************************************************/
-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(e);
-		}
-		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);
-		}
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 4e35d83..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSingleFileSearchRequestor.java
+++ /dev/null
@@ -1,38 +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
- *******************************************************************************/
-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);
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 74b1a26..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPMatchPresentation.java
+++ /dev/null
@@ -1,45 +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
- *******************************************************************************/
-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
deleted file mode 100644
index badbf18..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPQueryParticipant.java
+++ /dev/null
@@ -1,98 +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
- *******************************************************************************/
-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.java.search.JSPSearchRequestor;
-
-/**
- * @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 {
-		
-		//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();
-	}
-
-}
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
deleted file mode 100644
index 7b2649a..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java
+++ /dev/null
@@ -1,70 +0,0 @@
-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.text.templates.Template;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
-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();
-
-		// 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 styleValue = ColorHelper.getColorString(127, 0, 127) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, styleValue);
-
-		styleValue = ColorHelper.getColorString(42, 0, 255) + NOBACKGROUNDBOLD;
-		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.getColorString(63, 95, 191) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.COMMENT_BORDER, styleValue);
-		store.setDefault(IStyleConstantsXML.COMMENT_TEXT, styleValue);
-
-		styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.TAG_BORDER, styleValue);
-
-		styleValue = ColorHelper.getColorString(63, 127, 127) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.TAG_NAME, styleValue);
-
-		styleValue = ColorHelper.getColorString(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 differnt language)
-		 */
-		String templateName = ""; //$NON-NLS-1$
-		Template template = JSPUIPlugin.getDefault().getTemplateStore().findTemplateById("org.eclipse.jst.jsp.ui.templates.jsphtml"); //$NON-NLS-1$
-		if (template != null)
-			templateName = template.getName();
-		store.setDefault(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
-	}
-
-}
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
deleted file mode 100644
index c185063..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java
+++ /dev/null
@@ -1,65 +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.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$
-}
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
deleted file mode 100644
index 1a9c56e..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java
+++ /dev/null
@@ -1,167 +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
- *******************************************************************************/
-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.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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;
-
-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/JSPFilesPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
deleted file mode 100644
index 991a942..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
+++ /dev/null
@@ -1,113 +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
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.IPreferenceStore;
-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.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.html.ui.internal.preferences.ui.HTMLFilesPreferencePage;
-
-public class JSPFilesPreferencePage extends HTMLFilesPreferencePage {
-	private Button fValidateFragments;
-
-	protected Preferences getModelPreferences() {
-		return JSPCorePlugin.getDefault().getPluginPreferences();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
-	 */
-	protected IPreferenceStore doGetPreferenceStore() {
-		return JSPUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	protected void doSavePreferenceStore() {
-		JSPCorePlugin.getDefault().savePluginPreferences(); // model
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
-	 */
-	protected Control createContents(Composite parent) {
-		Control c = super.createContents(parent);
-
-		Group g = createGroup((Composite)c, 1);
-		g.setText(JSPUIMessages.JSPFilesPreferencePage_0);
-		fValidateFragments = createCheckBox(g, JSPUIMessages.JSPFilesPreferencePage_1);
-		boolean validateFragments = getModelPreferences().getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS);
-		fValidateFragments.setSelection(validateFragments);
-
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.JSP_PREFWEBX_FILES_HELPID);
-		return c;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#createContentsForLoadingGroup(org.eclipse.swt.widgets.Composite)
-	 */
-	protected void createContentsForLoadingGroup(Composite parent) {
-		// no loading preferences
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#initializeValuesForLoadingGroup()
-	 */
-	protected void initializeValuesForLoadingGroup() {
-		// no loading preferences
-	}
-
-	protected void performDefaults() {
-		super.performDefaults();
-
-		boolean validateFragments = getModelPreferences().getDefaultBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS);
-		fValidateFragments.setSelection(validateFragments);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#performDefaultsForLoadingGroup()
-	 */
-	protected void performDefaultsForLoadingGroup() {
-		// no loading preferences
-	}
-
-	protected void storeValues() {
-		boolean validateFragments = fValidateFragments.getSelection();
-		getModelPreferences().setValue(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, validateFragments);
-		super.storeValues();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#storeValuesForLoadingGroup()
-	 */
-	protected void storeValuesForLoadingGroup() {
-		// no loading preferences
-	}
-}
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
deleted file mode 100644
index 5381ecb..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSourcePreferencePage.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.preferences.ui;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-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.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 = createScrolledComposite(parent);
-
-		Text label = new Text(composite, SWT.READ_ONLY);
-		label.setText(JSPUIMessages.JSPSourcePreferencePage_0);
-		GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
-		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(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
-		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(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
-		data.horizontalIndent = 5;
-		contentTypeArea.getControl().setLayoutData(data);
-
-		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);
-		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;
-	}
-
-	private void setSize(Composite composite) {
-		if (composite != null) {
-			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);
-			}
-		}
-	}
-
-	private Composite createComposite(Composite parent) {
-		Composite composite = new Composite(parent, SWT.NULL);
-
-		// GridLayout
-		GridLayout layout = new GridLayout();
-		layout.marginWidth = 0;
-		layout.marginHeight = 0;
-		composite.setLayout(layout);
-
-		// GridData
-		GridData data = new GridData(GridData.FILL);
-		data.horizontalIndent = 0;
-		data.verticalAlignment = GridData.FILL;
-		data.horizontalAlignment = GridData.FILL;
-		composite.setLayoutData(data);
-
-		composite.setFont(parent.getFont());
-		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
deleted file mode 100644
index 19bd809..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPStyledTextColorPicker.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 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/JSPTemplatePreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java
deleted file mode 100644
index e4151c3..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java
+++ /dev/null
@@ -1,58 +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
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.preferences.ui;
-
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
-
-
-/**
- * Preference page for JSP templates
- */
-public class JSPTemplatePreferencePage extends TemplatePreferencePage {
-
-	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;
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
deleted file mode 100644
index f6d639d..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
+++ /dev/null
@@ -1,105 +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.jst.jsp.ui.internal.projection;
-
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-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.INodeNotifier;
-import org.w3c.dom.Node;
-
-public class ProjectionModelNodeAdapterFactoryHTML extends AbstractAdapterFactory {
-	// copies of this class located in:
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-
-	private ProjectionViewer fProjectionViewer;
-
-	public ProjectionModelNodeAdapterFactoryHTML(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-	public ProjectionModelNodeAdapterFactoryHTML(Object adapterKey) {
-		super(adapterKey);
-	}
-
-	public ProjectionModelNodeAdapterFactoryHTML() {
-		this(ProjectionModelNodeAdapterHTML.class);
-	}
-
-	/**
-	 * Actually creates an adapter for the parent of target if target is the
-	 * "adapt-able" node
-	 */
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		if ((fProjectionViewer != null) && (target instanceof Node) && ((Node) target).getNodeType() == Node.ELEMENT_NODE) {
-			Node node = (Node) target;
-			if (isNodeProjectable(node)) {
-
-				// actually work with the parent node to listen for add,
-				// delete events
-				Node parent = node.getParentNode();
-				if (parent instanceof INodeNotifier) {
-					INodeNotifier parentNotifier = (INodeNotifier) parent;
-					ProjectionModelNodeAdapterHTML parentAdapter = (ProjectionModelNodeAdapterHTML) parentNotifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
-					if (parentAdapter == null) {
-						// create a new adapter for parent
-						parentAdapter = new ProjectionModelNodeAdapterHTML(this);
-						parentNotifier.addAdapter(parentAdapter);
-					}
-					// call update on parent because a new node has just been
-					// added
-					parentAdapter.updateAdapter(parent);
-				}
-			}
-		}
-
-		return null;
-	}
-
-	ProjectionViewer getProjectionViewer() {
-		return fProjectionViewer;
-	}
-
-	/**
-	 * Returns true if node is a node type able to fold
-	 * 
-	 * @param node
-	 * @return boolean true if node is projectable, false otherwise
-	 */
-	boolean isNodeProjectable(Node node) {
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			String tagName = node.getNodeName();
-			// node is only projectable if it is head, body, script, style,
-			// table tags
-			if (HTML40Namespace.ElementName.HEAD.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.BODY.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.SCRIPT.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.STYLE.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.TABLE.equalsIgnoreCase((tagName)))
-				return true;
-		}
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.AbstractAdapterFactory#release()
-	 */
-	public void release() {
-		fProjectionViewer = null;
-
-		super.release();
-	}
-
-	void setProjectionViewer(ProjectionViewer viewer) {
-		fProjectionViewer = viewer;
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryJSP.java
deleted file mode 100644
index e7b2170..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryJSP.java
+++ /dev/null
@@ -1,77 +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.jst.jsp.ui.internal.projection;
-
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Node;
-
-public class ProjectionModelNodeAdapterFactoryJSP extends ProjectionModelNodeAdapterFactoryHTML {
-	public ProjectionModelNodeAdapterFactoryJSP() {
-		this(ProjectionModelNodeAdapterJSP.class);
-	}
-
-	public ProjectionModelNodeAdapterFactoryJSP(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-	public ProjectionModelNodeAdapterFactoryJSP(Object adapterKey) {
-		super(adapterKey);
-	}
-
-	/**
-	 * Actually creates an adapter for the parent of target if target is the
-	 * "adapt-able" node
-	 */
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		if ((getProjectionViewer() != null) && (target instanceof Node) && ((Node) target).getNodeType() == Node.ELEMENT_NODE) {
-			Node node = (Node) target;
-			if (isNodeProjectable(node)) {
-
-				// actually work with the parent node to listen for add,
-				// delete events
-				Node parent = node.getParentNode();
-				if (parent instanceof INodeNotifier) {
-					INodeNotifier parentNotifier = (INodeNotifier) parent;
-					ProjectionModelNodeAdapterJSP parentAdapter = (ProjectionModelNodeAdapterJSP) parentNotifier.getExistingAdapter(ProjectionModelNodeAdapterJSP.class);
-					if (parentAdapter == null) {
-						// create a new adapter for parent
-						parentAdapter = new ProjectionModelNodeAdapterJSP(this);
-						parentNotifier.addAdapter(parentAdapter);
-					}
-					// call update on parent because a new node has just been
-					// added
-					parentAdapter.updateAdapter(parent);
-				}
-			}
-		}
-
-		return null;
-	}
-
-	/**
-	 * Returns true if node is a node type able to fold
-	 * 
-	 * @param node
-	 * @return boolean true if node is projectable, false otherwise
-	 */
-	boolean isNodeProjectable(Node node) {
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			String tagName = node.getNodeName();
-			// node is only projectable if it is jsp scriptlet tag
-			if (JSP11Namespace.ElementName.SCRIPTLET.equalsIgnoreCase(tagName))
-				return true;
-		}
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterHTML.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
deleted file mode 100644
index 8f8d660..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
+++ /dev/null
@@ -1,263 +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.jst.jsp.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.wst.html.ui.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.IndexedRegion;
-import org.w3c.dom.Node;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterHTML implements INodeAdapter {
-
-	private class TagProjectionAnnotation extends ProjectionAnnotation {
-		private boolean fIsVisible = false; /* workaround for BUG85874 */
-		private Node fNode;
-
-		public TagProjectionAnnotation(Node node, boolean isCollapsed) {
-			super(isCollapsed);
-			fNode = node;
-		}
-
-		public Node getNode() {
-			return fNode;
-		}
-
-		public void setNode(Node node) {
-			fNode = node;
-		}
-
-		/**
-		 * Does not paint hidden annotations. Annotations are hidden when they
-		 * only span one line.
-		 * 
-		 * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC,
-		 *      org.eclipse.swt.widgets.Canvas,
-		 *      org.eclipse.swt.graphics.Rectangle)
-		 */
-		public void paint(GC gc, Canvas canvas, Rectangle rectangle) {
-			/* workaround for BUG85874 */
-			/*
-			 * only need to check annotations that are expanded because hidden
-			 * annotations should never have been given the chance to
-			 * collapse.
-			 */
-			if (!isCollapsed()) {
-				// working with rectangle, so need the styledtext line height
-				int lineHeight = fAdapterFactory.getProjectionViewer().getTextWidget().getLineHeight();
-
-				// do not draw annotations that only span one line and mark
-				// them as not visible
-				if ((rectangle.height / lineHeight) <= 1) {
-					fIsVisible = false;
-					return;
-				}
-			}
-			fIsVisible = true;
-			super.paint(gc, canvas, rectangle);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.text.source.projection.ProjectionAnnotation#markCollapsed()
-		 */
-		public void markCollapsed() {
-			/* workaround for BUG85874 */
-			// do not mark collapsed if annotation is not visible
-			if (fIsVisible)
-				super.markCollapsed();
-		}
-	}
-
-	// copies of this class located in:
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.html.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	ProjectionModelNodeAdapterFactoryHTML fAdapterFactory;
-	private Map fTagAnnotations = new HashMap();
-
-	public ProjectionModelNodeAdapterHTML(ProjectionModelNodeAdapterFactoryHTML factory) {
-		fAdapterFactory = factory;
-	}
-
-	/**
-	 * Create a projection position from the given node. Able to get
-	 * projection position if node isNodeProjectable.
-	 * 
-	 * @param node
-	 * @return null if no projection position possible, a Position otherwise
-	 */
-	private Position createProjectionPosition(Node node) {
-		Position pos = null;
-		if (fAdapterFactory.isNodeProjectable(node) && node instanceof IndexedRegion) {
-			IDocument document = fAdapterFactory.getProjectionViewer().getDocument();
-			if (document != null) {
-				IndexedRegion inode = (IndexedRegion) node;
-				int start = inode.getStartOffset();
-				int end = inode.getEndOffset();
-				if (start >= 0 && start < end) {
-					try {
-//						// region-based
-//						// extra line when collapsed, but no region increase when add newline
-//						pos = new Position(start, end - start);
-						
-//						// line-based
-//						// extra line when collapsed, but no region increase when add newline
-//						IRegion startLineRegion = document.getLineInformationOfOffset(start);
-//						IRegion endLineRegion = document.getLineInformationOfOffset(end);
-//						int startOffset = startLineRegion.getOffset();
-//						int endOffset = endLineRegion.getOffset() + endLineRegion.getLength();
-//						if (endOffset > startOffset) {
-//							pos = new Position(startOffset, endOffset - startOffset);
-//						}
-						
-						// line-based
-						// no extra line when collapsed, but region increase when add newline
-						int startLine = document.getLineOfOffset(start);
-						int endLine = document.getLineOfOffset(end);
-						if (endLine + 1 < document.getNumberOfLines()) {
-							int offset = document.getLineOffset(startLine);
-							int endOffset = document.getLineOffset(endLine + 1);
-							pos = new Position(offset, endOffset - offset);
-						}
-					} catch (BadLocationException x) {
-						Logger.log(Logger.WARNING_DEBUG, null, x);
-					}
-				}
-			}
-		}
-		return pos;
-	}
-
-	/**
-	 * Find TagProjectionAnnotation for node in the current list of projection
-	 * annotations for this adapter
-	 * 
-	 * @param node
-	 * @return TagProjectionAnnotation
-	 */
-	private TagProjectionAnnotation getExistingAnnotation(Node node) {
-		TagProjectionAnnotation anno = null;
-
-		if ((node != null) && (!fTagAnnotations.isEmpty())) {
-			Iterator it = fTagAnnotations.keySet().iterator();
-			while (it.hasNext() && anno == null) {
-				TagProjectionAnnotation a = (TagProjectionAnnotation) it.next();
-				Node n = a.getNode();
-				if (node.equals(n)) {
-					anno = a;
-				}
-			}
-		}
-		return anno;
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return type == ProjectionModelNodeAdapterHTML.class;
-	}
-
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		// check if folding is even enabled, if not, just ignore notifyChanged
-		// events
-		if (fAdapterFactory.getProjectionViewer() == null) {
-			return;
-		}
-
-		if ((eventType == INodeNotifier.STRUCTURE_CHANGED) && (notifier instanceof Node)) {
-			updateAdapter((Node) notifier);
-		}
-	}
-
-	/**
-	 * Update the projection annotation of all the nodes that are children of
-	 * node
-	 * 
-	 * @param node
-	 */
-	void updateAdapter(Node node) {
-		long start = System.currentTimeMillis();
-
-		Map additions = new HashMap();
-		Map projectionAnnotations = new HashMap();
-
-		// go through immediate child nodes and figure out projection
-		// model annotations
-		if (node != null) {
-			Node childNode = node.getFirstChild();
-			while (childNode != null) {
-				Position newPos = createProjectionPosition(childNode);
-				if (newPos != null) {
-					TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(childNode, false);
-					TagProjectionAnnotation existing = getExistingAnnotation(childNode);
-					if (existing == null) {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(newAnnotation, newPos);
-						// add to map containing annotations to add
-						additions.put(newAnnotation, newPos);
-					} else {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(existing, newPos);
-						// remove from map containing annotations to delete
-						fTagAnnotations.remove(existing);
-					}
-				}
-				childNode = childNode.getNextSibling();
-			}
-
-			// in the end, want to delete anything leftover in old list, add
-			// everything in additions, and update everything in
-			// projectionAnnotations
-			ProjectionAnnotation[] oldList = null;
-			if (!fTagAnnotations.isEmpty()) {
-				oldList = (ProjectionAnnotation[]) fTagAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-			ProjectionAnnotation[] modifyList = null;
-			if (!projectionAnnotations.isEmpty()) {
-				modifyList = (ProjectionAnnotation[]) projectionAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-			ProjectionViewer viewer = fAdapterFactory.getProjectionViewer();
-			ProjectionAnnotationModel annotationModel = viewer.getProjectionAnnotationModel();
-			annotationModel.modifyAnnotations(oldList, additions, modifyList);
-		}
-
-		// save new list of annotations
-		fTagAnnotations = additions;
-
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf) {
-			String nodeName = node != null ? node.getNodeName() : "null"; //$NON-NLS-1$
-			System.out.println("ProjectionModelNodeAdapterHTML.updateAdapter (" + nodeName + "):" + (end - start)); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterJSP.java
deleted file mode 100644
index a195368..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterJSP.java
+++ /dev/null
@@ -1,26 +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.jst.jsp.ui.internal.projection;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterJSP extends ProjectionModelNodeAdapterHTML {
-	public ProjectionModelNodeAdapterJSP(ProjectionModelNodeAdapterFactoryJSP factory) {
-		super(factory);
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return type == ProjectionModelNodeAdapterJSP.class;
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java
deleted file mode 100644
index f4316f9..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java
+++ /dev/null
@@ -1,275 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.projection;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-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.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Updates the projection model of a structured model for JSP.
- */
-public class StructuredTextFoldingProviderJSP implements IStructuredTextFoldingProvider, IProjectionListener {
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-	
-	private IDocument fDocument;
-	private ProjectionViewer fViewer;
-
-	/**
-	 * Adds an adapter to node and its children
-	 * 
-	 * @param node
-	 * @param level
-	 */
-	private void addAdapterToNodeAndChildren(Node node, int level) {
-		if (node instanceof INodeNotifier) {
-			INodeNotifier notifier = (INodeNotifier) node;
-
-			// try and get the adapter for the current node and update the
-			// adapter with projection information
-			ProjectionModelNodeAdapterJSP adapter = (ProjectionModelNodeAdapterJSP) notifier.getExistingAdapter(ProjectionModelNodeAdapterJSP.class);
-			if (adapter != null) {
-				adapter.updateAdapter(node);
-			}
-			else {
-				// just call getadapter so the adapter is created and
-				// automatically initialized
-				notifier.getAdapterFor(ProjectionModelNodeAdapterJSP.class);
-			}
-			ProjectionModelNodeAdapterHTML adapter2 = (ProjectionModelNodeAdapterHTML) notifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
-			if (adapter2 != null) {
-				adapter2.updateAdapter(node);
-			}
-			else {
-				// just call getadapter so the adapter is created and
-				// automatically initialized
-				notifier.getAdapterFor(ProjectionModelNodeAdapterHTML.class);
-			}
-
-			Node nextChild = node.getFirstChild();
-			while (nextChild != null) {
-				Node childNode = nextChild;
-				nextChild = childNode.getNextSibling();
-
-				addAdapterToNodeAndChildren(childNode, level + 1);
-			}
-		}
-	}
-
-	/**
-	 * Goes through every node and adds an adapter onto each for tracking
-	 * purposes
-	 */
-	private void addAllAdapters() {
-		long start = System.currentTimeMillis();
-		
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-			if (sModel != null) {
-				int startOffset = 0;
-				IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
-				if (startNode instanceof Node) {
-					int level = 0;
-					Node nextSibling = (Node) startNode;
-					while (nextSibling != null) {
-						Node currentNode = nextSibling;
-						nextSibling = currentNode.getNextSibling();
-
-						addAdapterToNodeAndChildren(currentNode, level);
-					}
-				}
-			}
-		}
-		finally {
-			if (sModel != null) {
-				sModel.releaseFromRead();
-			}
-		}
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf)
-			System.out.println("StructuredTextFoldingProviderJSP.addAllAdapters: " + (end - start)); //$NON-NLS-1$
-	}
-
-	/**
-	 * Get the ProjectionModelNodeAdapterFactoryHTML to use with this
-	 * provider.
-	 * 
-	 * @return ProjectionModelNodeAdapterFactoryHTML
-	 */
-	private ProjectionModelNodeAdapterFactoryHTML getAdapterFactoryHTML(boolean createIfNeeded) {
-		long start = System.currentTimeMillis();
-		
-		ProjectionModelNodeAdapterFactoryHTML factory = null;
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-			if (sModel != null) {
-				FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
-				// getting the projectionmodelnodeadapter for the first time
-				// so do some initializing
-				if (!factoryRegistry.contains(ProjectionModelNodeAdapterHTML.class) && createIfNeeded) {
-					ProjectionModelNodeAdapterFactoryHTML newFactory = new ProjectionModelNodeAdapterFactoryHTML();
-
-					// add factory to factory registry
-					factoryRegistry.addFactory(newFactory);
-
-					// add factory to propogating adapter
-					IDOMModel domModel = (IDOMModel) sModel;
-					Document document = domModel.getDocument();
-					PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
-					if (propagatingAdapter != null) {
-						propagatingAdapter.addAdaptOnCreateFactory(newFactory);
-					}
-				}
-
-				// try and get the factory
-				factory = (ProjectionModelNodeAdapterFactoryHTML) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterHTML.class);
-			}
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-		
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf)
-			System.out.println("StructuredTextFoldingProviderJSP.getAdapterFactoryHTML: " + (end - start)); //$NON-NLS-1$
-		return factory;
-	}
-
-	/**
-	 * Get the ProjectionModelNodeAdapterFactoryJSP to use with this provider.
-	 * 
-	 * @return ProjectionModelNodeAdapterFactoryJSP
-	 */
-	private ProjectionModelNodeAdapterFactoryJSP getAdapterFactoryJSP(boolean createIfNeeded) {
-		long start = System.currentTimeMillis();
-		
-		ProjectionModelNodeAdapterFactoryJSP factory = null;
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-			if (sModel != null) {
-				FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
-				// getting the projectionmodelnodeadapter for the first time
-				// so do some initializing
-				if (!factoryRegistry.contains(ProjectionModelNodeAdapterJSP.class) && createIfNeeded) {
-					ProjectionModelNodeAdapterFactoryJSP newFactory = new ProjectionModelNodeAdapterFactoryJSP();
-
-					// add factory to factory registry
-					factoryRegistry.addFactory(newFactory);
-
-					// add factory to propogating adapter
-					IDOMModel domModel = (IDOMModel) sModel;
-					Document document = domModel.getDocument();
-					PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
-					if (propagatingAdapter != null) {
-						propagatingAdapter.addAdaptOnCreateFactory(newFactory);
-					}
-				}
-
-				// try and get the factory
-				factory = (ProjectionModelNodeAdapterFactoryJSP) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterJSP.class);
-			}
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-		
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf)
-			System.out.println("StructuredTextFoldingProviderJSP.getAdapterFactoryJSP: " + (end - start)); //$NON-NLS-1$
-		return factory;
-	}
-
-	/**
-	 * Initialize this provider with the correct document. Assumes projection
-	 * is enabled. (otherwise, only install would have been called)
-	 */
-	public void initialize() {
-		if (!isInstalled())
-			return;
-
-		// set projection viewer to null on old document's adapter factory
-		projectionDisabled();
-
-		// clear out all annotations
-		if (fViewer.getProjectionAnnotationModel() != null)
-			fViewer.getProjectionAnnotationModel().removeAllAnnotations();
-		fDocument = fViewer.getDocument();
-
-		if (fDocument != null) {
-			// set projection viewer on new document's adapter factory
-			ProjectionModelNodeAdapterFactoryJSP factory = getAdapterFactoryJSP(true);
-			if (factory != null) {
-				factory.setProjectionViewer(fViewer);
-			}
-			ProjectionModelNodeAdapterFactoryHTML factory2 = getAdapterFactoryHTML(true);
-			if (factory2 != null) {
-				factory2.setProjectionViewer(fViewer);
-			}
-
-			addAllAdapters();
-		}
-	}
-
-	/**
-	 * Associate a ProjectionViewer with this IStructuredTextFoldingProvider
-	 * 
-	 * @param viewer
-	 */
-	public void install(ProjectionViewer viewer) {
-		// uninstall before trying to install new viewer
-		if (isInstalled()) {
-			uninstall();
-		}
-		fViewer = viewer;
-		fViewer.addProjectionListener(this);
-	}
-
-	private boolean isInstalled() {
-		return fViewer != null;
-	}
-
-	public void projectionDisabled() {
-		ProjectionModelNodeAdapterFactoryJSP factory = getAdapterFactoryJSP(false);
-		if (factory != null) {
-			factory.setProjectionViewer(null);
-		}
-		ProjectionModelNodeAdapterFactoryHTML factory2 = getAdapterFactoryHTML(false);
-		if (factory2 != null) {
-			factory2.setProjectionViewer(null);
-		}
-
-		fDocument = null;
-	}
-
-	public void projectionEnabled() {
-		initialize();
-	}
-
-	/**
-	 * Disconnect this IStructuredTextFoldingProvider from projection viewer
-	 */
-	public void uninstall() {
-		if (isInstalled()) {
-			projectionDisabled();
-
-			fViewer.removeProjectionListener(this);
-			fViewer = null;
-		}
-	}
-}
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
deleted file mode 100644
index ec08c15..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/registry/AdapterFactoryProviderForJSP.java
+++ /dev/null
@@ -1,79 +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
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.registry;
-
-import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapterFactory;
-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);
-		}
-
-		factory = factoryRegistry.getFactoryFor(IJSPTranslation.class);
-		if (factory == null) {
-			factory = new JSPTranslationAdapterFactory();
-			factoryRegistry.addFactory(factory);
-		}
-	}
-
-	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
deleted file mode 100644
index 2b81bf8..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/IStyleConstantsJSP.java
+++ /dev/null
@@ -1,5 +0,0 @@
-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
deleted file mode 100644
index 56bcc43..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/LineStyleProviderForJSP.java
+++ /dev/null
@@ -1,224 +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
- *******************************************************************************/
-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)) {
-					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);
-			}
-		}
-		// 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/IStyleConstantsJSPJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/IStyleConstantsJSPJava.java
deleted file mode 100644
index 29e39e8..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/IStyleConstantsJSPJava.java
+++ /dev/null
@@ -1,20 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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
deleted file mode 100644
index 528ed65..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaCodeScanner.java
+++ /dev/null
@@ -1,106 +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
- *******************************************************************************/
-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);
-
-
-		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
deleted file mode 100644
index d943561..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaColorProvider.java
+++ /dev/null
@@ -1,82 +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
- *******************************************************************************/
-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
deleted file mode 100644
index 381893e..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWhitespaceDetector.java
+++ /dev/null
@@ -1,26 +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
- *******************************************************************************/
-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
deleted file mode 100644
index 77fe762..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWordDetector.java
+++ /dev/null
@@ -1,32 +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
- *******************************************************************************/
-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
deleted file mode 100644
index a10936a..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/LineStyleProviderForJava.java
+++ /dev/null
@@ -1,347 +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
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.style.java;
-
-import java.util.Collection;
-import java.util.HashMap;
-
-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.IPropertyChangeListener;
-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.swt.widgets.Display;
-import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-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 implements LineStyleProvider{
-	private class PropertyChangeListener implements 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);
-		}
-	}
-
-	private IDocument fDocument;
-	private Highlighter fHighlighter;
-	private boolean fIsInitialized = false;
-	private PropertyChangeListener fPreferenceListener = new PropertyChangeListener();
-	/** The scanner it uses */
-	private JavaCodeScanner fScanner;
-	/** Contains all text attributes pretaining to this line style provider */
-	private HashMap fTextAttributes = null;
-
-	public LineStyleProviderForJava() {
-		super();
-		fScanner = new JavaCodeScanner();
-	}
-
-	/**
-	 * 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 addTextAttribute(String colorKey) {
-		if (getColorPreferences() != null) {
-			String prefString = getColorPreferences().getString(colorKey);
-			String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
-			if (stylePrefs != null) {
-				RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
-				RGB background = ColorHelper.toRGB(stylePrefs[1]);
-				boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
-				getTextAttributes().put(colorKey, createTextAttribute(foreground, background, bold));
-			}
-		}
-	}
-	
-	/**
-	 * 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);
-				ta = createTextAttribute(foreground, null, bold, italics);
-			} 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);
-				ta = createTextAttribute(foreground, null, bold, italics);
-			} 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);
-				ta = createTextAttribute(foreground, null, bold, italics);
-			} 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);
-				ta = createTextAttribute(foreground, null, bold, italics);
-			}
-			if (ta != null) {
-				getTextAttributes().put(colorKey, ta);
-				fScanner.setTokenData(colorKey, ta);
-			}
-		}
-	}
-
-	private TextAttribute createTextAttribute(RGB foreground, RGB background, boolean bold) {
-		return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, bold ? SWT.BOLD : SWT.NORMAL);
-	}
-	
-	private TextAttribute createTextAttribute(RGB foreground, RGB background, boolean bold, boolean italics) {
-		int style = bold ? SWT.BOLD : SWT.NORMAL;
-		if (italics)
-			style |= SWT.ITALIC;
-		
-		return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, style);
-	}
-	
-	/**
-	 * Returns the hashtable containing all the text attributes for this line
-	 * style provider. Lazily creates a hashtable if one has not already been
-	 * created.
-	 * 
-	 * @return
-	 */
-	private HashMap getTextAttributes() {
-		if (fTextAttributes == null) {
-			fTextAttributes = new HashMap();
-			loadColors();
-		}
-		return fTextAttributes;
-	}
-	
-	/**
-	 * 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; 
-	}
-	
-	public void init(IStructuredDocument document, Highlighter highlighter) {
-		fDocument = document;
-		fHighlighter = highlighter;
-		
-		if (fIsInitialized)
-			return;
-
-		registerPreferenceListener();
-
-		fIsInitialized = true;
-	}
-
-	private void loadColors() {
-		addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
-		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
-		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
-		
-		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 (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
-			fHighlighter.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;
-	}
-	
-	private void registerPreferenceListener() {
-		getColorPreferences().addPropertyChangeListener(fPreferenceListener);
-		getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
-	}
-	
-	public void release() {
-		unregisterPreferenceManager();
-		if (fTextAttributes != null) {
-			fTextAttributes.clear();
-			fTextAttributes = null;
-		}
-	}
-
-	private void unregisterPreferenceManager() {
-		getColorPreferences().removePropertyChangeListener(fPreferenceListener);
-		getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
-	}
-	
-	private IPreferenceStore getColorPreferences() {
-		return JSPUIPlugin.getDefault().getPreferenceStore();
-	}
-	
-	private IPreferenceStore getJavaColorPreferences() {
-		return PreferenceConstants.getPreferenceStore();
-	}
-}
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
deleted file mode 100644
index 256ed22..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/IStyleConstantsJSPEL.java
+++ /dev/null
@@ -1,18 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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
deleted file mode 100644
index e7f7cc9..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELCodeScanner.java
+++ /dev/null
@@ -1,83 +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
- *******************************************************************************/
-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
deleted file mode 100644
index 716071f..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELColorProvider.java
+++ /dev/null
@@ -1,102 +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
- *******************************************************************************/
-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
deleted file mode 100644
index 5c2345d..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWhitespaceDetector.java
+++ /dev/null
@@ -1,26 +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
- *******************************************************************************/
-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
deleted file mode 100644
index 4676e23..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWordDetector.java
+++ /dev/null
@@ -1,32 +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
- *******************************************************************************/
-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
deleted file mode 100644
index 8f000a0..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/LineStyleProviderForJSPEL.java
+++ /dev/null
@@ -1,333 +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
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.style.jspel;
-
-import java.util.Collection;
-import java.util.HashMap;
-
-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.IPropertyChangeListener;
-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.IStructuredDocument;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-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 implements LineStyleProvider {
-	private class PropertyChangeListener implements 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);
-		}
-	}
-
-	private IDocument fDocument;
-	private Highlighter fHighlighter;
-	private boolean fIsInitialized = false;
-	private PropertyChangeListener fPreferenceListener = new PropertyChangeListener();
-	/** The scanner it uses */
-	private JSPELCodeScanner fScanner;
-	/** Contains all text attributes pretaining to this line style provider */
-	private HashMap fTextAttributes = null;
-
-	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 addTextAttribute(String colorKey) {
-		if (getColorPreferences() != null) {
-			String prefString = getColorPreferences().getString(colorKey);
-			String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
-			if (stylePrefs != null) {
-				RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
-				RGB background = ColorHelper.toRGB(stylePrefs[1]);
-				boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
-				getTextAttributes().put(colorKey, createTextAttribute(foreground, background, bold));
-			}
-		}
-	}
-
-	/**
-	 * 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);
-				ta = createTextAttribute(foreground, null, bold, italics);
-			} 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);
-				ta = createTextAttribute(foreground, null, bold, italics);
-			}
-			if (ta != null) {
-				getTextAttributes().put(colorKey, ta);
-				fScanner.setTokenData(colorKey, ta);
-			}
-		}
-	}
-
-	private TextAttribute createTextAttribute(RGB foreground, RGB background, boolean bold) {
-		return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, bold ? SWT.BOLD : SWT.NORMAL);
-	}
-
-	private TextAttribute createTextAttribute(RGB foreground, RGB background, boolean bold, boolean italics) {
-		int style = bold ? SWT.BOLD : SWT.NORMAL;
-		if (italics)
-			style |= SWT.ITALIC;
-
-		return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, style);
-	}
-
-	/**
-	 * Returns the hashtable containing all the text attributes for this line
-	 * style provider. Lazily creates a hashtable if one has not already been
-	 * created.
-	 * 
-	 * @return
-	 */
-	private HashMap getTextAttributes() {
-		if (fTextAttributes == null) {
-			fTextAttributes = new HashMap();
-			loadColors();
-		}
-		return fTextAttributes;
-	}
-
-	/**
-	 * 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;
-	}
-
-	public void init(IStructuredDocument document, Highlighter highlighter) {
-		fDocument = document;
-		fHighlighter = highlighter;
-
-		if (fIsInitialized)
-			return;
-
-		registerPreferenceListener();
-
-		fIsInitialized = true;
-	}
-
-	private 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
-			fHighlighter.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;
-	}
-	
-	private void registerPreferenceListener() {
-		getColorPreferences().addPropertyChangeListener(fPreferenceListener);
-		getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
-	}
-	
-	public void release() {
-		unRegisterPreferenceManager();
-		if (fTextAttributes != null) {
-			fTextAttributes.clear();
-			fTextAttributes = null;
-		}
-	}
-
-	private void unRegisterPreferenceManager() {
-		getColorPreferences().removePropertyChangeListener(fPreferenceListener);
-		getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
-	}
-
-	private IPreferenceStore getColorPreferences() {
-		return JSPUIPlugin.getDefault().getPreferenceStore();
-	}
-	
-	private IPreferenceStore getJavaColorPreferences() {
-		return PreferenceConstants.getPreferenceStore();
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.java
deleted file mode 100644
index 031b108..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.java
+++ /dev/null
@@ -1,223 +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
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.taginfo;
-
-
-import java.io.IOException;
-import java.io.Reader;
-import java.net.URL;
-
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-
-/**
- * Provides a set of convenience methods for creating HTML pages.
- * 
- * Based on org.eclipse.jdt.internal.ui.text.HTMLPrinter
- */
-class HTMLPrinter {
-
-	static RGB BG_COLOR_RGB = null;
-
-	static {
-		// try to do in advance
-		getSystemBGColor();
-	}
-
-	private static RGB getSystemBGColor() {
-		RGB result = null;
-		if (BG_COLOR_RGB == null) {
-			final Display display = Display.getCurrent();
-			if (display != null && !display.isDisposed()) {
-
-				display.asyncExec(new Runnable() {
-					public void run() {
-						if (display != null && !display.isDisposed()) {
-							BG_COLOR_RGB = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
-						}
-					}
-				});
-
-			}
-		}
-		else {
-			result = BG_COLOR_RGB;
-		}
-		return result;
-	}
-
-	private HTMLPrinter() {
-		super();
-	}
-
-	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 String convertToHTMLContent(String content) {
-		content = replace(content, '<', "&lt;"); //$NON-NLS-1$
-		return replace(content, '>', "&gt;"); //$NON-NLS-1$
-	}
-
-	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.logException(x);
-		}
-
-		return null;
-	}
-
-	public static void insertPageProlog(StringBuffer buffer, int position, RGB bgRGB, URL styleSheetURL) {
-
-		if (bgRGB == null)
-			insertPageProlog(buffer, position, styleSheetURL);
-		else {
-			StringBuffer pageProlog = new StringBuffer(300);
-
-			pageProlog.append("<html>"); //$NON-NLS-1$
-
-			appendStyleSheetLink(pageProlog, styleSheetURL);
-
-			pageProlog.append("<body text=\"#000000\" bgcolor=\""); //$NON-NLS-1$
-			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) {
-		if (bgRGB == null)
-			insertPageProlog(buffer, position);
-		else {
-			StringBuffer pageProlog = new StringBuffer(60);
-			pageProlog.append("<html><body text=\"#000000\" bgcolor=\""); //$NON-NLS-1$
-			appendColor(pageProlog, bgRGB);
-			pageProlog.append("\"><font size=-1>"); //$NON-NLS-1$
-			buffer.insert(position, pageProlog.toString());
-		}
-	}
-
-	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$
-	}
-
-	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));
-	}
-
-	public static void insertPageProlog(StringBuffer buffer, int position) {
-		insertPageProlog(buffer, position, getBgColor()); //$NON-NLS-1$
-	}
-
-	public static void insertPageProlog(StringBuffer buffer, int position, URL styleSheetURL) {
-		insertPageProlog(buffer, position, getBgColor(), styleSheetURL); //$NON-NLS-1$
-	}
-
-	static RGB getBgColor() {
-		RGB result = getSystemBGColor();
-		if (result == null) {
-			// use RGB value of default info bg color
-			// on WindowsXP
-			result = new RGB(255, 255, 225);
-		}
-		return result;
-
-	}
-
-	public static void addPageProlog(StringBuffer buffer) {
-		insertPageProlog(buffer, buffer.length());
-	}
-
-	public static void addPageEpilog(StringBuffer buffer) {
-		buffer.append("</font></body></html>"); //$NON-NLS-1$
-	}
-
-	public static void startBulletList(StringBuffer buffer) {
-		buffer.append("<ul>"); //$NON-NLS-1$
-	}
-
-	public static void endBulletList(StringBuffer buffer) {
-		buffer.append("</ul>"); //$NON-NLS-1$
-	}
-
-	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 addSmallHeader(StringBuffer buffer, String header) {
-		if (header != null) {
-			buffer.append("<h5>"); //$NON-NLS-1$
-			buffer.append(header);
-			buffer.append("</h5>"); //$NON-NLS-1$
-		}
-	}
-
-	public static void addParagraph(StringBuffer buffer, String paragraph) {
-		if (paragraph != null) {
-			buffer.append("<p>"); //$NON-NLS-1$
-			buffer.append(paragraph);
-		}
-	}
-
-	public static void addParagraph(StringBuffer buffer, Reader paragraphReader) {
-		if (paragraphReader != null)
-			addParagraph(buffer, read(paragraphReader));
-	}
-}
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
deleted file mode 100644
index 7ee1293..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java
+++ /dev/null
@@ -1,129 +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
- *******************************************************************************/
-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.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-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.internal.provisional.StructuredModelManager;
-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 implements ITextHover {
-	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;
-	
-	private String getInfoText(IJavaElement member) {
-		String label= JavaElementLabels.getElementLabel(member, LABEL_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();
-	}
-	
-	private 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);
-				} catch (JavaModelException ex) {
-					return null;
-				}
-				if (reader != null) {
-					HTMLPrinter.addParagraph(buffer, reader);
-				}
-			} else if (curr.getElementType() == IJavaElement.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 = (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 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);
-	}
-
-}
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
deleted file mode 100644
index 2a234ca..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPTagInfoHoverProcessor.java
+++ /dev/null
@@ -1,51 +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
- *******************************************************************************/
-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
deleted file mode 100644
index d3c5b67..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JavaWordFinder.java
+++ /dev/null
@@ -1,69 +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
- *******************************************************************************/
-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) {
-		
-		int start= -1;
-		int end= -1;
-		
-		
-		try {
-			
-			int pos= offset;
-			char c;
-			
-			while (pos >= 0) {
-				c= document.getChar(pos);
-				if (!Character.isJavaIdentifierPart(c))
-					break;
-				--pos;
-			}
-			
-			start= pos;
-			
-			pos= offset;
-			int length= document.getLength();
-			
-			while (pos < length) {
-				c= document.getChar(pos);
-				if (!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/templates/EncodingTemplateVariableResolverJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/EncodingTemplateVariableResolverJSP.java
deleted file mode 100644
index 23b1058..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/EncodingTemplateVariableResolverJSP.java
+++ /dev/null
@@ -1,38 +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.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
deleted file mode 100644
index 8e5d9e3..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeIdsJSP.java
+++ /dev/null
@@ -1,50 +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.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();
-
-	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
deleted file mode 100644
index a907d25..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeJSP.java
+++ /dev/null
@@ -1,33 +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
- *******************************************************************************/
-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
deleted file mode 100644
index ae12677..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JSPDocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,28 +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
- *******************************************************************************/
-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/JavaCodeReader.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCodeReader.java
deleted file mode 100644
index 2483dd2..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCodeReader.java
+++ /dev/null
@@ -1,252 +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
- *******************************************************************************/
-/*
- * 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.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;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 0a55e93..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaPairMatcher.java
+++ /dev/null
@@ -1,202 +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
- *******************************************************************************/
-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;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 95ece8c..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java
+++ /dev/null
@@ -1,474 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.wizard;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-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.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;
-
-/**
- * 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);
-
-		// Create linked text to just to templates preference page
-		Link link = new Link(innerParent, SWT.NONE);
-		link.setText(JSPUIMessages.NewJSPTemplatesWizardPage_6);
-		data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
-		link.setLayoutData(data);
-		link.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				linkClicked();
-			}
-		});
-
-		// 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);
-
-		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) {
-		SourceViewer viewer = new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		SourceViewerConfiguration configuration = new SourceViewerConfiguration();
-		viewer.configure(configuration);
-		IDocument document = new Document();
-		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);
-		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() {
-		String templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
-		if (templateName == null || templateName.length() == 0) {
-			fLastSelectedTemplateName = ""; //$NON-NLS-1$
-			fUseTemplateButton.setSelection(false);
-		}
-		else {
-			fLastSelectedTemplateName = templateName;
-			fUseTemplateButton.setSelection(true);
-		}
-		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
deleted file mode 100644
index c96288e..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.wizard;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStreamWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-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.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-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.osgi.util.NLS;
-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.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-public class NewJSPWizard extends Wizard implements INewWizard {
-	private WizardNewFileCreationPage fNewFilePage;
-	private NewJSPTemplatesWizardPage fNewFileTemplatesPage;
-	private IStructuredSelection fSelection;
-	private List fValidExtensions = null;
-
-	/**
-	 * Get list of valid extensions for JSP Content type
-	 * 
-	 * @return
-	 */
-	List getValidExtensions() {
-		if (fValidExtensions == null) {
-			IContentType type = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
-			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
-		}
-		return fValidExtensions;
-	}
-
-	public void addPages() {
-		fNewFilePage = new WizardNewFileCreationPage("JSPWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))) { //$NON-NLS-1$
-			protected boolean validatePage() {
-				IPath handlePath = new Path(getFileName());
-				String extension = handlePath.getFileExtension();
-				if (extension == null || !getValidExtensions().contains(extension)) {
-					setErrorMessage(NLS.bind(JSPUIMessages._ERROR_FILENAME_MUST_END_JSP, getValidExtensions().toString()));
-					return false;
-				}
-				setErrorMessage(null);
-				return super.validatePage();
-			}
-		};
-		fNewFilePage.setTitle(JSPUIMessages._UI_WIZARD_NEW_HEADING);
-		fNewFilePage.setDescription(JSPUIMessages._UI_WIZARD_NEW_DESCRIPTION);
-
-		addPage(fNewFilePage);
-
-		fNewFileTemplatesPage = new NewJSPTemplatesWizardPage();
-		addPage(fNewFileTemplatesPage);
-	}
-
-	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) {
-			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() {
-		// save user options for next use
-		fNewFileTemplatesPage.saveLastSavedPreferences();
-
-		// create a new empty file
-		IFile file = fNewFilePage.createNewFile();
-
-		// put template contents into file
-		String templateString = fNewFileTemplatesPage.getTemplateString();
-		if (templateString != null) {
-			// 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
-		openEditor(file);
-		return true;
-	}
-
-}
\ 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
deleted file mode 100644
index f9a1570..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPContentOutlineConfiguration.java
+++ /dev/null
@@ -1,51 +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.jst.jsp.ui.views.contentoutline;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration;
-
-/**
- * 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();
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties b/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties
deleted file mode 100644
index 0e4cc2b..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties
+++ /dev/null
@@ -1,40 +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
-###############################################################################
-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="" prefix="${cursor}" %>
-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">\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>
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml b/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml
deleted file mode 100644
index 3539631..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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>
-</templates>
diff --git a/bundles/org.eclipse.wst.css.core/.classpath b/bundles/org.eclipse.wst.css.core/.classpath
deleted file mode 100644
index cb01053..0000000
--- a/bundles/org.eclipse.wst.css.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src/"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.css.core/.cvsignore b/bundles/org.eclipse.wst.css.core/.cvsignore
deleted file mode 100644
index 2e30db3..0000000
--- a/bundles/org.eclipse.wst.css.core/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-bin
-temp.folder
-cssmodel.jar
-build.xml
-dev.properties
-@dot
-src.zip
diff --git a/bundles/org.eclipse.wst.css.core/.options b/bundles/org.eclipse.wst.css.core/.options
deleted file mode 100644
index 490975b..0000000
--- a/bundles/org.eclipse.wst.css.core/.options
+++ /dev/null
@@ -1,2 +0,0 @@
-org.eclipse.wst.css.core/debug=true
-org.eclipse.wst.css.core/debug/tracefilter=
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/.project b/bundles/org.eclipse.wst.css.core/.project
deleted file mode 100644
index bb046e9..0000000
--- a/bundles/org.eclipse.wst.css.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.css.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.css.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2e1acf0..0000000
--- a/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,48 +0,0 @@
-#Mon May 30 17:56:59 EDT 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-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.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-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.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-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=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-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.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.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 42fb716..0000000
--- a/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Fri May 27 23:56:32 EDT 2005
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-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.css.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF
deleted file mode 100644
index b14badc..0000000
--- a/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,40 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.css.core; singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.wst.css.core.internal.CSSCorePlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.css.core.internal,
- org.eclipse.wst.css.core.internal.cleanup,
- org.eclipse.wst.css.core.internal.contentmodel,
- org.eclipse.wst.css.core.internal.contenttype,
- org.eclipse.wst.css.core.internal.document,
- org.eclipse.wst.css.core.internal.encoding,
- org.eclipse.wst.css.core.internal.event,
- org.eclipse.wst.css.core.internal.eventimpl,
- org.eclipse.wst.css.core.internal.format,
- org.eclipse.wst.css.core.internal.formatter,
- org.eclipse.wst.css.core.internal.metamodel,
- org.eclipse.wst.css.core.internal.metamodel.util,
- org.eclipse.wst.css.core.internal.metamodelimpl,
- org.eclipse.wst.css.core.internal.modelhandler,
- org.eclipse.wst.css.core.internal.parser,
- org.eclipse.wst.css.core.internal.parser.regions,
- org.eclipse.wst.css.core.internal.parserz,
- org.eclipse.wst.css.core.internal.preferences,
- org.eclipse.wst.css.core.internal.provisional.adapters,
- org.eclipse.wst.css.core.internal.provisional.contenttype,
- org.eclipse.wst.css.core.internal.provisional.document,
- org.eclipse.wst.css.core.internal.provisional.preferences,
- org.eclipse.wst.css.core.internal.provisional.text,
- org.eclipse.wst.css.core.internal.tasks,
- org.eclipse.wst.css.core.internal.text,
- org.eclipse.wst.css.core.internal.util,
- org.eclipse.wst.css.core.internal.util.declaration
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.wst.xml.core,
- org.eclipse.wst.sse.core
-Eclipse-AutoStart: true; exceptions="org.eclipse.wst.css.core.internal.contenttype"
diff --git a/bundles/org.eclipse.wst.css.core/about.html b/bundles/org.eclipse.wst.css.core/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/bundles/org.eclipse.wst.css.core/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>February 24, 2005</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.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/build.properties b/bundles/org.eclipse.wst.css.core/build.properties
deleted file mode 100644
index 411f804..0000000
--- a/bundles/org.eclipse.wst.css.core/build.properties
+++ /dev/null
@@ -1,24 +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
-###############################################################################
-bin.includes = plugin.xml,\
-               cssprofile/,\
-               .options,\
-               plugin.properties,\
-               META-INF/,\
-               .,\
-               about.html
-bin.excludes = bin/**,\
-               @dot/**,\
-               temp.folder/**
-src.includes = component.xml,\
-               build.properties
-source.. = src/
-               
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/component.xml b/bundles/org.eclipse.wst.css.core/component.xml
deleted file mode 100644
index 476033a..0000000
--- a/bundles/org.eclipse.wst.css.core/component.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.wst.css">
-	<description url="http://eclipse.org/webtools/wst/components/css/overview.html"></description>
-	<component-depends unrestricted="true"></component-depends>
-	<plugin id="org.eclipse.wst.css.core" fragment="false" />
-	<plugin id="org.eclipse.wst.css.ui" fragment="false" />
-	<package name="org.eclipse.wst.css.ui.views.properties" api="false">
-		<type name="CSSPropertySheetConfiguration" subclass="true" instantiate="true" />
-	</package>
-	<package name="org.eclipse.wst.css.ui" api="false">
-		<type name="StructuredTextViewerConfigurationCSS" subclass="true" instantiate="true" />
-	</package>
-	<package name="org.eclipse.wst.css.ui.views.contentoutline" api="false">
-		<type name="CSSContentOutlineConfiguration" subclass="true" instantiate="true" />
-	</package>
-</component>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/css-profile.dtd b/bundles/org.eclipse.wst.css.core/cssprofile/css-profile.dtd
deleted file mode 100644
index 35535a8..0000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/css-profile.dtd
+++ /dev/null
@@ -1,132 +0,0 @@
-<!-- DTD for CSS Meta Model Profile -->
-
-<!-- Entities -->
-
-<!-- name-definition	: In defining meta model object, object name -->
-<!-- is given by using this attribute. -->
-
-<!ENTITY % name-definition 'name CDATA #REQUIRED' >
-
-<!-- name-reference		: used to refer meta model object that defined -->
-<!-- by name-definition -->
-
-<!ENTITY % name-reference 'name CDATA #REQUIRED' >
-
-<!-- availability		: CSS Meta Model Profile permit importing -->
-<!-- other profile and describe difference for it. -->
-
-<!ENTITY % availability 'enabled (true | false) "true"' >
-<!ENTITY % overwrite 'overwrite (true | false) "false"' >
-
-<!-- ******************** -->
-<!--  elments/attributes  -->
-<!-- ******************** -->
-
-<!ELEMENT css-profile (profile-import? , (stylesheet-def | charset-rule-def | import-rule-def | page-rule-def | media-rule-def | fontface-rule-def | style-rule-def | property-def | descriptor-def | container-def | function-def | number-def | unit-def | keyword-def | category-def | pseudo-element-def | pseudo-class-def)*) >
-
-<!-- a profile can include other profile -->
-
-<!ELEMENT profile-import EMPTY >
-<!ATTLIST profile-import name CDATA #REQUIRED >
-
-<!-- which type of rule can be used? -->
-
-<!ELEMENT stylesheet-def (description? , (charset-rule | import-rule | page-rule | media-rule | fontface-rule | style-rule)*) >
-<!ATTLIST stylesheet-def %overwrite; >
-
-<!ELEMENT charset-rule EMPTY >
-<!ATTLIST charset-rule %availability; >
-<!ELEMENT import-rule EMPTY >
-<!ATTLIST import-rule %availability; >
-<!ELEMENT page-rule EMPTY >
-<!ATTLIST page-rule %availability; >
-<!ELEMENT media-rule EMPTY >
-<!ATTLIST media-rule %availability; >
-<!ELEMENT fontface-rule EMPTY >
-<!ATTLIST fontface-rule %availability; >
-<!ELEMENT style-rule EMPTY >
-<!ATTLIST style-rule %availability; >
-
-<!ELEMENT charset-rule-def (description?) >
-<!ATTLIST charset-rule-def %overwrite; >
-
-<!ELEMENT import-rule-def (description?) >
-<!ATTLIST import-rule-def %overwrite; >
-
-<!ELEMENT page-rule-def (description? , (property | pseudo-class)*) >
-<!ATTLIST page-rule-def %overwrite; >
-
-<!ELEMENT media-rule-def (description?) >
-<!ATTLIST media-rule-def %overwrite; >
-
-<!ELEMENT fontface-rule-def (description? , descriptor*) >
-<!ATTLIST fontface-rule-def %overwrite; >
-
-<!ELEMENT style-rule-def (description? , (property | selector-expression | pseudo-class | pseudo-element)*) >
-<!ATTLIST style-rule-def %overwrite; >
-
-<!ELEMENT selector-expression EMPTY >
-<!ATTLIST selector-expression name (descendant | child | adjacent | universal | attribute) #REQUIRED %availability; >
-
-<!ELEMENT pseudo-class EMPTY >
-<!ATTLIST pseudo-class %name-reference; %availability; >
-
-<!ELEMENT pseudo-element EMPTY >
-<!ATTLIST pseudo-element %name-reference; %availability; >
-
-<!ELEMENT pseudo-class-def (description?, selector-value) >
-<!ATTLIST pseudo-class-def %name-definition; %overwrite; >
-<!ELEMENT selector-value (#PCDATA) >
-
-<!ELEMENT pseudo-element-def (description?, selector-value) >
-<!ATTLIST pseudo-element-def %name-definition; %overwrite; >
-
-<!ELEMENT keyword-def (description? , keyword-value) >
-<!ATTLIST keyword-def %name-definition; %overwrite; >
-<!ELEMENT keyword-value (#PCDATA) >
-<!ELEMENT description (#PCDATA) >
-
-<!ELEMENT function-def (description? , function-value) >
-<!ATTLIST function-def %name-definition; %overwrite; >
-<!ELEMENT function-value (#PCDATA) >
-
-<!ELEMENT number-def (description? , unit*) >
-<!ATTLIST number-def %name-definition; %overwrite; >
-<!ELEMENT unit EMPTY >
-<!ATTLIST unit %name-reference; %availability; >
-
-<!ELEMENT unit-def (description? , unit-value) >
-<!ATTLIST unit-def %name-definition; %overwrite; >
-<!ELEMENT unit-value (#PCDATA) >
-
-<!ELEMENT container-def (description? , (number | keyword | function | container)*) >
-<!ATTLIST container-def %name-definition; %overwrite; >
-
-<!ELEMENT category-def (description?, caption) >
-<!ATTLIST category-def %name-definition; %overwrite; >
-<!ELEMENT caption (#PCDATA) >
-
-<!ELEMENT property-def (description? , (number | keyword | function | container | string | separator | property)*) >
-<!ATTLIST property-def %name-definition; %overwrite;
-					   inherited (yes | no | na) "na"
-					   mediagroup CDATA #IMPLIED
-					   category CDATA #IMPLIED >
-<!ELEMENT descriptor-def (description?, (number | keyword | function | container | string | separator | property)*) >
-<!ATTLIST descriptor-def %name-definition; %overwrite; >
-
-<!ELEMENT number EMPTY >
-<!ATTLIST number %name-reference; %availability; > 
-<!ELEMENT keyword EMPTY >
-<!ATTLIST keyword %name-reference; %availability; > 
-<!ELEMENT function EMPTY >
-<!ATTLIST function %name-reference; %availability; >
-<!ELEMENT container EMPTY >
-<!ATTLIST container %name-reference; %availability; > 
-<!ELEMENT string EMPTY >
-<!ATTLIST string %name-reference; %availability; >
-<!ELEMENT separator EMPTY >
-<!ATTLIST separator name (comma | slash) #REQUIRED %availability; >
-<!ELEMENT property EMPTY >
-<!ATTLIST property %name-reference; %availability; > 
-<!ELEMENT descriptor EMPTY >
-<!ATTLIST descriptor %name-reference; %availability; >
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css1.xml b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css1.xml
deleted file mode 100644
index 6b0b175..0000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css1.xml
+++ /dev/null
@@ -1,826 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--<!DOCTYPE css-profile SYSTEM "css-profile.dtd" >-->
-<css-profile>
-	<stylesheet-def>
-		<description>%css1.stylesheet-def.description</description>
-		<import-rule/>
-		<style-rule/>
-	</stylesheet-def>
-
-	<import-rule-def>
-	</import-rule-def>
-
-	<style-rule-def>
-		<selector-expression name="descendant"/>
-		<pseudo-element name="first-line"/>
-		<pseudo-element name="first-letter"/>
-		<pseudo-class name="link"/>
-		<pseudo-class name="visited"/>
-		<pseudo-class name="active"/>
-		<property name="background"/>
-		<property name="background-attachment"/>
-		<property name="background-color"/>
-		<property name="background-image"/>
-		<property name="background-position"/>
-		<property name="background-repeat"/>
-		<property name="border"/>
-		<property name="border-bottom"/>
-		<property name="border-bottom-width"/>
-		<property name="border-color"/>
-		<property name="border-left"/>
-		<property name="border-left-width"/>
-		<property name="border-right"/>
-		<property name="border-right-width"/>
-		<property name="border-style"/>
-		<property name="border-top"/>
-		<property name="border-top-width"/>
-		<property name="border-width"/>
-		<property name="clear"/>
-		<property name="color"/>
-		<property name="display"/>
-		<property name="float"/>
-		<property name="font"/>
-		<property name="font-family"/>
-		<property name="font-size"/>
-		<property name="font-style"/>
-		<property name="font-variant"/>
-		<property name="font-weight"/>
-		<property name="height"/>
-		<property name="letter-spacing"/>
-		<property name="line-height"/>
-		<property name="list-style"/>
-		<property name="list-style-image"/>
-		<property name="list-style-position"/>
-		<property name="list-style-type"/>
-		<property name="margin"/>
-		<property name="margin-bottom"/>
-		<property name="margin-left"/>
-		<property name="margin-right"/>
-		<property name="margin-top"/>
-		<property name="padding"/>
-		<property name="padding-bottom"/>
-		<property name="padding-left"/>
-		<property name="padding-right"/>
-		<property name="padding-top"/>
-		<property name="text-align"/>
-		<property name="text-decoration"/>
-		<property name="text-indent"/>
-		<property name="text-transform"/>
-		<property name="vertical-align"/>
-		<property name="white-space"/>
-		<property name="width"/>
-		<property name="word-spacing"/>
-	</style-rule-def>
-
-	<pseudo-class-def name="link">
-		<selector-value>link</selector-value>
-	</pseudo-class-def>
-	<pseudo-class-def name="visited">
-		<selector-value>visited</selector-value>
-	</pseudo-class-def>
-	<pseudo-class-def name="active">
-		<selector-value>active</selector-value>
-	</pseudo-class-def>
-
-	<pseudo-element-def name="first-line">
-		<selector-value>first-line</selector-value>
-	</pseudo-element-def>
-	<pseudo-element-def name="first-letter">
-		<selector-value>first-letter</selector-value>
-	</pseudo-element-def>
-
-	<!-- property definition -->
-
-    <property-def name="background" inherited="no" category="colorandbackground">
-        <property name="background-color"/>
-        <property name="background-image"/>
-        <property name="background-repeat"/>
-        <property name="background-attachment"/>
-        <property name="background-position"/>
-    </property-def>
-    <property-def name="background-attachment" inherited="no" category="colorandbackground">
-        <keyword name="scroll"/>
-        <keyword name="fixed"/>
-    </property-def>
-    <property-def name="background-color" inherited="no" category="colorandbackground">
-        <container name="color"/>
-        <keyword name="transparent"/>
-    </property-def>
-    <property-def name="background-image" inherited="no" category="colorandbackground">
-        <function name="uri"/>
-        <keyword name="none"/>
-    </property-def>
-	<property-def name="background-position" inherited="no" category="colorandbackground">
-		<number name="percentage"/>
-		<number name="length"/>
-		<keyword name="top"/>
-		<keyword name="center"/>
-		<keyword name="bottom"/>
-		<keyword name="left"/>
-		<keyword name="right"/>
-	</property-def>
-	<property-def name="background-repeat" inherited="no" category="colorandbackground">
-		<keyword name="repeat"/>
-		<keyword name="repeat-x"/>
-		<keyword name="repeat-y"/>
-		<keyword name="no-repeat"/>
-	</property-def>
-	<property-def name="border" inherited="no" category="box">
-		<property name="border-width"/>
-		<property name="border-style"/>
-		<container name="color"/>
-	</property-def>
-	<property-def name="border-color" inherited="no" category="box">
-		<container name="color"/>
-	</property-def>
-	<property-def name="border-style" inherited="no" category="box">
-		<keyword name="none"/>
-		<keyword name="dotted"/>
-		<keyword name="dashed"/>
-		<keyword name="solid"/>
-		<keyword name="double"/>
-		<keyword name="groove"/>
-		<keyword name="ridge"/>
-		<keyword name="inset"/>
-		<keyword name="outset"/>
-	</property-def>
-	<property-def name="border-top" inherited="no" category="box">
-		<property name="border-top-width"/>
-		<property name="border-style"/>
-		<container name="color"/>
-	</property-def>
-	<property-def name="border-right" inherited="no" category="box">
-		<property name="border-right-width"/>
-		<property name="border-style"/>
-		<container name="color"/>
-	</property-def>
-	<property-def name="border-bottom" inherited="no" category="box">
-		<property name="border-bottom-width"/>
-		<property name="border-style"/>
-		<container name="color"/>
-	</property-def>
-	<property-def name="border-left" inherited="no" category="box">
-		<property name="border-left-width"/>
-		<property name="border-style"/>
-		<container name="color"/>
-	</property-def>
-	<property-def name="border-top-width" inherited="no" category="box">
-		<keyword name="thin"/>
-		<keyword name="medium"/>
-		<keyword name="thick"/>
-		<number name="length"/>
-	</property-def>
-	<property-def name="border-right-width" inherited="no" category="box">
-		<keyword name="thin"/>
-		<keyword name="medium"/>
-		<keyword name="thick"/>
-		<number name="length"/>
-	</property-def>
-	<property-def name="border-bottom-width" inherited="no" category="box">
-		<keyword name="thin"/>
-		<keyword name="medium"/>
-		<keyword name="thick"/>
-		<number name="length"/>
-	</property-def>
-	<property-def name="border-left-width" inherited="no" category="box">
-		<keyword name="thin"/>
-		<keyword name="medium"/>
-		<keyword name="thick"/>
-		<number name="length"/>
-	</property-def>
-	<property-def name="border-width" inherited="no" category="box">
-		<keyword name="thin"/>
-		<keyword name="medium"/>
-		<keyword name="thick"/>
-		<number name="length"/>
-	</property-def>
-	<property-def name="clear" inherited="no" category="box">
-		<keyword name="none"/>
-		<keyword name="left"/>
-		<keyword name="right"/>
-		<keyword name="both"/>
-	</property-def>
-	<property-def name="color" inherited="yes" category="colorandbackground">
-		<container name="color"/>
-	</property-def>
-	<property-def name="display" inherited="no" category="classification">
-		<keyword name="block"/>
-		<keyword name="inline"/>
-		<keyword name="list-item"/>
-		<keyword name="none"/>
-	</property-def>
-	<property-def name="float" inherited="no" category="box">
-		<keyword name="left"/>
-		<keyword name="right"/>
-		<keyword name="none"/>
-	</property-def>
-	<property-def name="font"
-		inherited="yes" category="font">
-		<property name="font-style"/>
-		<property name="font-variant"/>
-		<property name="font-weight"/>
-		<property name="font-size"/>
-		<property name="line-height"/>
-		<property name="font-family"/>
-		<separator name="slash"/>
-	</property-def>
-	<property-def name="font-family" inherited="yes" category="font">
-		<string name="family-name"/>
-		<container name="generic-family"/>
-		<separator name="comma"/>
-	</property-def>
-	<property-def name="font-size" inherited="yes" category="font">
-		<container name="absolute-size"/>
-		<container name="relative-size"/>
-		<number name="length"/>
-		<number name="percentage"/>
-	</property-def>
-	<property-def name="font-style" inherited="yes" category="font">
-		<keyword name="normal"/>
-		<keyword name="italic"/>
-		<keyword name="oblique"/>
-	</property-def>
-	<property-def name="font-variant" inherited="yes" category="font">
-		<keyword name="normal"/>
-		<keyword name="small-caps"/>
-	</property-def>
-	<property-def name="font-weight" inherited="yes" category="font">
-		<keyword name="normal"/>
-		<keyword name="bold"/>
-		<keyword name="bolder"/>
-		<keyword name="lighter"/>
-		<keyword name="100"/>
-		<keyword name="200"/>
-		<keyword name="300"/>
-		<keyword name="400"/>
-		<keyword name="500"/>
-		<keyword name="600"/>
-		<keyword name="700"/>
-		<keyword name="800"/>
-		<keyword name="900"/>
-	</property-def>
-	<property-def name="height" inherited="no" category="box">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-	</property-def>
-	<property-def name="letter-spacing" inherited="yes" category="text">
-		<keyword name="normal"/>
-		<number name="length"/>
-	</property-def>
-	<property-def name="line-height" inherited="yes" category="text">
-		<keyword name="normal"/>
-		<number name="number"/>
-		<number name="length"/>
-		<number name="percentage"/>
-	</property-def>
-	<property-def name="list-style" inherited="yes" category="classification">
-		<keyword name="disc"/>
-		<keyword name="circle"/>
-		<keyword name="square"/>
-		<keyword name="decimal"/>
-		<keyword name="lower-roman"/>
-		<keyword name="upper-roman"/>
-		<keyword name="lower-alpha"/>
-		<keyword name="upper-alpha"/>
-		<keyword name="none"/>
-		<keyword name="inside"/>
-		<keyword name="outside"/>
-		<function name="uri"/>
-		<keyword name="none"/>
-	</property-def>
-	<property-def name="list-style-image" inherited="yes" category="classification">
-		<function name="uri"/>
-		<keyword name="none"/>
-	</property-def>
-	<property-def name="list-style-position" inherited="yes" category="classification">
-		<keyword name="inside"/>
-		<keyword name="outside"/>
-	</property-def>
-	<property-def name="list-style-type" inherited="yes" category="classification">
-		<keyword name="disc"/>
-		<keyword name="circle"/>
-		<keyword name="square"/>
-		<keyword name="decimal"/>
-		<keyword name="lower-roman"/>
-		<keyword name="upper-roman"/>
-		<keyword name="lower-alpha"/>
-		<keyword name="upper-alpha"/>
-		<keyword name="none"/>
-	</property-def>
-	<property-def name="margin" inherited="no" category="box">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-	</property-def>
-	<property-def name="margin-top" inherited="no" category="box">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-	</property-def>
-	<property-def name="margin-right" inherited="no" category="box">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-	</property-def>
-	<property-def name="margin-bottom" inherited="no" category="box">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-	</property-def>
-	<property-def name="margin-left" inherited="no" category="box">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-	</property-def>
-	<property-def name="padding" inherited="no" category="box">
-		<number name="length"/>
-		<number name="percentage"/>
-	</property-def>
-	<property-def name="padding-top" inherited="no" category="box">
-		<number name="length"/>
-		<number name="percentage"/>
-	</property-def>
-	<property-def name="padding-right" inherited="no" category="box">
-		<number name="length"/>
-		<number name="percentage"/>
-	</property-def>
-	<property-def name="padding-bottom" inherited="no" category="box">
-		<number name="length"/>
-		<number name="percentage"/>
-	</property-def>
-	<property-def name="padding-left" inherited="no" category="box">
-		<number name="length"/>
-		<number name="percentage"/>
-	</property-def>
-	<property-def name="text-align" inherited="yes" category="text">
-		<keyword name="left"/>
-		<keyword name="right"/>
-		<keyword name="center"/>
-		<keyword name="justify"/>
-	</property-def>
-	<property-def name="text-decoration" inherited="no" category="text">
-		<keyword name="none"/>
-		<keyword name="underline"/>
-		<keyword name="overline"/>
-		<keyword name="line-through"/>
-		<keyword name="blink"/>
-	</property-def>
-	<property-def name="text-indent" inherited="yes" category="text">
-		<number name="length"/>
-		<number name="percentage"/>
-	</property-def>
-	<property-def name="text-transform" inherited="yes" category="text">
-		<keyword name="capitalize"/>
-		<keyword name="uppercase"/>
-		<keyword name="lowercase"/>
-		<keyword name="none"/>
-	</property-def>
-	<property-def name="vertical-align" inherited="no" category="text">
-		<keyword name="baseline"/>
-		<keyword name="sub"/>
-		<keyword name="super"/>
-		<keyword name="top"/>
-		<keyword name="text-top"/>
-		<keyword name="middle"/>
-		<keyword name="bottom"/>
-		<keyword name="text-bottom"/>
-		<number name="percentage"/>
-	</property-def>
-	<property-def name="white-space" inherited="yes" category="classification">
-		<keyword name="normal"/>
-		<keyword name="pre"/>
-		<keyword name="nowrap"/>
-	</property-def>
-	<property-def name="width" inherited="no" category="box">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-	</property-def>
-	<property-def name="word-spacing" inherited="yes" category="text">
-		<keyword name="normal"/>
-		<number name="length"/>
-	</property-def>
-
-	<!-- container definition : Container is the lump of values.
-	It can be used like macros. -->
-    <container-def name="absolute-size">
-        <keyword name="xx-small"/>
-        <keyword name="x-small"/>
-        <keyword name="small"/>
-        <keyword name="medium"/>
-        <keyword name="large"/>
-        <keyword name="x-large"/>
-        <keyword name="xx-large"/>
-    </container-def>
-	<container-def name="color">
-		<keyword name="aqua"/>
-		<keyword name="black"/>
-		<keyword name="blue"/>
-		<keyword name="fuchsia"/>
-		<keyword name="gray"/>
-		<keyword name="green"/>
-		<keyword name="lime"/>
-		<keyword name="maroon"/>
-		<keyword name="navy"/>
-		<keyword name="olive"/>
-		<keyword name="purple"/>
-		<keyword name="red"/>
-		<keyword name="silver"/>
-		<keyword name="teal"/>
-		<keyword name="white"/>
-		<keyword name="yellow"/>
-		<function name="rgb"/>
-		<number name="hash"/>
-	</container-def>
-	<container-def name="generic-family">
-		<keyword name="serif"/>
-		<keyword name="sans-serif"/>
-		<keyword name="cursive"/>
-		<keyword name="fantasy"/>
-		<keyword name="monospace"/>
-	</container-def>
-	<container-def name="relative-size">
-		<keyword name="smaller"/>
-		<keyword name="larger"/>
-	</container-def>
-
-	<!-- category definition : This is used to categorize properties
-	in Properties View. -->
-	<category-def name="box">
-		<caption>%css1.category-def.box.caption</caption>
-	</category-def>
-	<category-def name="colorandbackground">
-		<caption>%css1.category-def.colorandbackground.caption</caption>
-	</category-def>
-	<category-def name="classification">
-		<caption>%css1.category-def.classification.caption</caption>
-	</category-def>
-	<category-def name="font">
-		<caption>%css1.category-def.font.caption</caption>
-	</category-def>
-	<category-def name="text">
-		<caption>%css1.category-def.text.caption</caption>
-	</category-def>
-
-	<function-def name="rgb">
-		<function-value>rgb</function-value>
-	</function-def>
-	<function-def name="uri">
-		<function-value>url</function-value>
-	</function-def>
-	
-	<!-- number definition : What unit types be acceptable for each
-	number type? -->
-    <number-def name="hash">
-        <unit name="hash"/>
-    </number-def>
-    <number-def name="length">
-        <unit name="em"/>
-        <unit name="ex"/>
-        <unit name="px"/>
-        <unit name="in"/>
-        <unit name="cm"/>
-        <unit name="mm"/>
-        <unit name="pt"/>
-        <unit name="pc"/>
-    </number-def>
-	<number-def name="number">
-	</number-def>
-	<number-def name="percentage">
-		<unit name="percentage"/>
-	</number-def>
-
-	<unit-def name="cm">
-		<unit-value>cm</unit-value>
-	</unit-def>
-	<unit-def name="em">
-		<unit-value>em</unit-value>
-	</unit-def>
-	<unit-def name="ex">
-		<unit-value>ex</unit-value>
-	</unit-def>
-	<unit-def name="hash">
-		<unit-value>#</unit-value>
-	</unit-def>
-	<unit-def name="in">
-		<unit-value>in</unit-value>
-	</unit-def>
-	<unit-def name="mm">
-		<unit-value>mm</unit-value>
-	</unit-def>
-	<unit-def name="pc">
-		<unit-value>pc</unit-value>
-	</unit-def>
-	<unit-def name="percentage">
-		<unit-value>%</unit-value>
-	</unit-def>
-	<unit-def name="pt">
-		<unit-value>pt</unit-value>
-	</unit-def>
-	<unit-def name="px">
-		<unit-value>px</unit-value>
-	</unit-def>
-
-    <!-- keywords : string constants (this is last part..) -->
-    <keyword-def name="100">
-        <keyword-value>100</keyword-value>
-    </keyword-def>
-    <keyword-def name="200">
-        <keyword-value>200</keyword-value>
-    </keyword-def>
-    <keyword-def name="300">
-        <keyword-value>300</keyword-value>
-    </keyword-def>
-    <keyword-def name="400">
-        <keyword-value>400</keyword-value>
-    </keyword-def>
-    <keyword-def name="500">
-        <keyword-value>500</keyword-value>
-    </keyword-def>
-    <keyword-def name="600">
-        <keyword-value>600</keyword-value>
-    </keyword-def>
-    <keyword-def name="700">
-        <keyword-value>700</keyword-value>
-    </keyword-def>
-    <keyword-def name="800">
-        <keyword-value>800</keyword-value>
-    </keyword-def>
-    <keyword-def name="900">
-        <keyword-value>900</keyword-value>
-    </keyword-def>
-    <keyword-def name="aqua">
-        <keyword-value>aqua</keyword-value>
-    </keyword-def>
-    <keyword-def name="auto">
-        <keyword-value>auto</keyword-value>
-    </keyword-def>
-    <keyword-def name="baseline">
-        <keyword-value>baseline</keyword-value>
-    </keyword-def>
-    <keyword-def name="black">
-        <keyword-value>black</keyword-value>
-    </keyword-def>
-    <keyword-def name="blink">
-        <keyword-value>blink</keyword-value>
-    </keyword-def>
-    <keyword-def name="block">
-        <keyword-value>block</keyword-value>
-    </keyword-def>
-    <keyword-def name="blue">
-        <keyword-value>blue</keyword-value>
-    </keyword-def>
-    <keyword-def name="bold">
-        <keyword-value>bold</keyword-value>
-    </keyword-def>
-    <keyword-def name="bolder">
-        <keyword-value>bolder</keyword-value>
-    </keyword-def>
-    <keyword-def name="both">
-        <keyword-value>both</keyword-value>
-    </keyword-def>
-    <keyword-def name="bottom">
-        <keyword-value>bottom</keyword-value>
-    </keyword-def>
-    <keyword-def name="capitalize">
-        <keyword-value>capitalize</keyword-value>
-    </keyword-def>
-    <keyword-def name="center">
-        <keyword-value>center</keyword-value>
-    </keyword-def>
-    <keyword-def name="circle">
-        <keyword-value>circle</keyword-value>
-    </keyword-def>
-    <keyword-def name="cursive">
-        <keyword-value>cursive</keyword-value>
-    </keyword-def>
-    <keyword-def name="dashed">
-        <keyword-value>dashed</keyword-value>
-    </keyword-def>
-    <keyword-def name="decimal">
-        <keyword-value>decimal</keyword-value>
-    </keyword-def>
-    <keyword-def name="disc">
-        <keyword-value>disc</keyword-value>
-    </keyword-def>
-    <keyword-def name="dotted">
-        <keyword-value>dotted</keyword-value>
-    </keyword-def>
-    <keyword-def name="double">
-        <keyword-value>double</keyword-value>
-    </keyword-def>
-    <keyword-def name="fantasy">
-        <keyword-value>fantasy</keyword-value>
-    </keyword-def>
-    <keyword-def name="fixed">
-        <keyword-value>fixed</keyword-value>
-    </keyword-def>
-    <keyword-def name="fuchsia">
-        <keyword-value>fuchsia</keyword-value>
-    </keyword-def>
-    <keyword-def name="gray">
-        <keyword-value>gray</keyword-value>
-    </keyword-def>
-    <keyword-def name="green">
-        <keyword-value>green</keyword-value>
-    </keyword-def>
-    <keyword-def name="groove">
-        <keyword-value>groove</keyword-value>
-    </keyword-def>
-    <keyword-def name="inline">
-        <keyword-value>inline</keyword-value>
-    </keyword-def>
-    <keyword-def name="inset">
-        <keyword-value>inset</keyword-value>
-    </keyword-def>
-    <keyword-def name="inside">
-        <keyword-value>inside</keyword-value>
-    </keyword-def>
-    <keyword-def name="italic">
-        <keyword-value>italic</keyword-value>
-    </keyword-def>
-    <keyword-def name="justify">
-        <keyword-value>justify</keyword-value>
-    </keyword-def>
-    <keyword-def name="large">
-        <keyword-value>large</keyword-value>
-    </keyword-def>
-    <keyword-def name="larger">
-        <keyword-value>larger</keyword-value>
-    </keyword-def>
-    <keyword-def name="left">
-        <keyword-value>left</keyword-value>
-    </keyword-def>
-    <keyword-def name="lighter">
-        <keyword-value>lighter</keyword-value>
-    </keyword-def>
-    <keyword-def name="lime">
-        <keyword-value>lime</keyword-value>
-    </keyword-def>
-    <keyword-def name="line-through">
-        <keyword-value>line-through</keyword-value>
-    </keyword-def>
-    <keyword-def name="list-item">
-        <keyword-value>list-item</keyword-value>
-    </keyword-def>
-    <keyword-def name="lower-alpha">
-        <keyword-value>lower-alpha</keyword-value>
-    </keyword-def>
-    <keyword-def name="lower-roman">
-        <keyword-value>lower-roman</keyword-value>
-    </keyword-def>
-    <keyword-def name="lowercase">
-        <keyword-value>lowercase</keyword-value>
-    </keyword-def>
-    <keyword-def name="maroon">
-        <keyword-value>maroon</keyword-value>
-    </keyword-def>
-    <keyword-def name="medium">
-        <keyword-value>medium</keyword-value>
-    </keyword-def>
-    <keyword-def name="middle">
-        <keyword-value>middle</keyword-value>
-    </keyword-def>
-    <keyword-def name="monospace">
-        <keyword-value>monospace</keyword-value>
-    </keyword-def>
-    <keyword-def name="navy">
-        <keyword-value>navy</keyword-value>
-    </keyword-def>
-    <keyword-def name="no-repeat">
-        <keyword-value>no-repeat</keyword-value>
-    </keyword-def>
-    <keyword-def name="none">
-        <keyword-value>none</keyword-value>
-    </keyword-def>
-    <keyword-def name="normal">
-        <keyword-value>normal</keyword-value>
-    </keyword-def>
-    <keyword-def name="nowrap">
-        <keyword-value>nowrap</keyword-value>
-    </keyword-def>
-    <keyword-def name="oblique">
-        <keyword-value>oblique</keyword-value>
-    </keyword-def>
-    <keyword-def name="olive">
-        <keyword-value>olive</keyword-value>
-    </keyword-def>
-    <keyword-def name="outset">
-        <keyword-value>outset</keyword-value>
-    </keyword-def>
-    <keyword-def name="outside">
-        <keyword-value>outside</keyword-value>
-    </keyword-def>
-    <keyword-def name="overline">
-        <keyword-value>overline</keyword-value>
-    </keyword-def>
-    <keyword-def name="pre">
-        <keyword-value>pre</keyword-value>
-    </keyword-def>
-    <keyword-def name="purple">
-        <keyword-value>purple</keyword-value>
-    </keyword-def>
-    <keyword-def name="red">
-        <keyword-value>red</keyword-value>
-    </keyword-def>
-    <keyword-def name="repeat">
-        <keyword-value>repeat</keyword-value>
-    </keyword-def>
-    <keyword-def name="repeat-x">
-        <keyword-value>repeat-x</keyword-value>
-    </keyword-def>
-    <keyword-def name="repeat-y">
-        <keyword-value>repeat-y</keyword-value>
-    </keyword-def>
-    <keyword-def name="ridge">
-        <keyword-value>ridge</keyword-value>
-    </keyword-def>
-    <keyword-def name="right">
-        <keyword-value>right</keyword-value>
-    </keyword-def>
-    <keyword-def name="sans-serif">
-        <keyword-value>sans-serif</keyword-value>
-    </keyword-def>
-    <keyword-def name="scroll">
-        <keyword-value>scroll</keyword-value>
-    </keyword-def>
-    <keyword-def name="serif">
-        <keyword-value>serif</keyword-value>
-    </keyword-def>
-    <keyword-def name="silver">
-        <keyword-value>silver</keyword-value>
-    </keyword-def>
-    <keyword-def name="small">
-        <keyword-value>small</keyword-value>
-    </keyword-def>
-    <keyword-def name="small-caps">
-        <keyword-value>small-caps</keyword-value>
-    </keyword-def>
-    <keyword-def name="smaller">
-        <keyword-value>smaller</keyword-value>
-    </keyword-def>
-    <keyword-def name="solid">
-        <keyword-value>solid</keyword-value>
-    </keyword-def>
-    <keyword-def name="square">
-        <keyword-value>square</keyword-value>
-    </keyword-def>
-    <keyword-def name="sub">
-        <keyword-value>sub</keyword-value>
-    </keyword-def>
-    <keyword-def name="super">
-        <keyword-value>super</keyword-value>
-    </keyword-def>
-    <keyword-def name="teal">
-        <keyword-value>teal</keyword-value>
-    </keyword-def>
-    <keyword-def name="text-top">
-        <keyword-value>text-top</keyword-value>
-    </keyword-def>
-    <keyword-def name="text-bottom">
-        <keyword-value>text-bottom</keyword-value>
-    </keyword-def>
-    <keyword-def name="thick">
-        <keyword-value>thick</keyword-value>
-    </keyword-def>
-    <keyword-def name="thin">
-        <keyword-value>thin</keyword-value>
-    </keyword-def>
-    <keyword-def name="top">
-        <keyword-value>top</keyword-value>
-    </keyword-def>
-    <keyword-def name="transparent">
-        <keyword-value>transparent</keyword-value>
-    </keyword-def>
-    <keyword-def name="underline">
-        <keyword-value>underline</keyword-value>
-    </keyword-def>
-    <keyword-def name="upper-alpha">
-        <keyword-value>upper-alpha</keyword-value>
-    </keyword-def>
-    <keyword-def name="upper-roman">
-        <keyword-value>upper-roman</keyword-value>
-    </keyword-def>
-    <keyword-def name="uppercase">
-        <keyword-value>uppercase</keyword-value>
-    </keyword-def>
-    <keyword-def name="white">
-        <keyword-value>white</keyword-value>
-    </keyword-def>
-    <keyword-def name="x-large">
-        <keyword-value>x-large</keyword-value>
-    </keyword-def>
-    <keyword-def name="x-small">
-        <keyword-value>x-small</keyword-value>
-    </keyword-def>
-    <keyword-def name="xx-small">
-        <keyword-value>xx-small</keyword-value>
-    </keyword-def>
-    <keyword-def name="xx-large">
-        <keyword-value>xx-large</keyword-value>
-    </keyword-def>
-    <keyword-def name="yellow">
-        <keyword-value>yellow</keyword-value>
-    </keyword-def>
-</css-profile>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css2.xml b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css2.xml
deleted file mode 100644
index 4efc084..0000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css2.xml
+++ /dev/null
@@ -1,2258 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--<!DOCTYPE css-profile SYSTEM "css-profile.dtd" >-->
-<css-profile>
-	<stylesheet-def>
-		<description>%css2.stylesheet-def.description</description>
-		<charset-rule/>
-		<import-rule/>
-		<page-rule/>
-		<media-rule/>
-		<fontface-rule/>
-		<style-rule/>
-	</stylesheet-def>
-
-	<charset-rule-def>
-	</charset-rule-def>
-	<import-rule-def>
-	</import-rule-def>
-	<media-rule-def>
-	</media-rule-def>
-
-	<page-rule-def>
-		<pseudo-class name="left"/>
-		<pseudo-class name="right"/>
-		<pseudo-class name="first"/>
-		<property name="size"/>
-		<property name="marks"/>
-		<property name="page-break-after"/>
-		<property name="page-break-before"/>
-		<property name="page-break-inside"/>
-		<property name="orphans"/>
-		<property name="widows"/>
-	</page-rule-def>
-
-	<fontface-rule-def>
-		<descriptor name="ascent"/>
-		<descriptor name="baseline"/>
-		<descriptor name="bbox"/>
-		<descriptor name="cap-height"/>
-		<descriptor name="centerline"/>
-		<descriptor name="definition-src"/>
-		<descriptor name="descent"/>
-		<descriptor name="font-family"/>
-		<descriptor name="font-size"/>
-		<descriptor name="font-stretch"/>
-		<descriptor name="font-style"/>
-		<descriptor name="font-variant"/>
-		<descriptor name="font-weight"/>
-		<descriptor name="mathline"/>
-		<descriptor name="panose-1"/>
-		<descriptor name="slope"/>
-		<descriptor name="slope"/>
-		<descriptor name="src"/>
-		<descriptor name="stemh"/>
-		<descriptor name="stemv"/>
-		<descriptor name="topline"/>
-		<descriptor name="unicode-range"/>
-		<descriptor name="units-per-em"/>
-		<descriptor name="widths"/>
-		<descriptor name="x-height"/>
-	</fontface-rule-def>
-
-	<!-- Which properties can style rule include ? -->
-
-	<style-rule-def>
-		<selector-expression name="descendant"/>
-		<selector-expression name="child"/>
-		<selector-expression name="adjacent"/>
-		<selector-expression name="universal"/>
-		<selector-expression name="attribute"/>
-		<pseudo-element name="first-line"/>
-		<pseudo-element name="first-letter"/>
-		<pseudo-element name="before"/>
-		<pseudo-element name="after"/>
-		<pseudo-class name="first-child"/>
-		<pseudo-class name="link"/>
-		<pseudo-class name="visited"/>
-		<pseudo-class name="hover"/>
-		<pseudo-class name="active"/>
-		<pseudo-class name="focus"/>
-		<pseudo-class name="lang"/>
-		<property name="azimuth"/>
-		<property name="background"/>
-		<property name="background-attachment"/>
-		<property name="background-color"/>
-		<property name="background-image"/>
-		<property name="background-position"/>
-		<property name="background-repeat"/>
-		<property name="border"/>
-		<property name="border-collapse"/>
-		<property name="border-color"/>
-		<property name="border-spacing"/>
-		<property name="border-style"/>
-		<property name="border-top"/>
-		<property name="border-right"/>
-		<property name="border-bottom"/>
-		<property name="border-left"/>
-		<property name="border-top-color"/>
-		<property name="border-right-color"/>
-		<property name="border-bottom-color"/>
-		<property name="border-left-color"/>
-		<property name="border-top-style"/>
-		<property name="border-right-style"/>
-		<property name="border-bottom-style"/>
-		<property name="border-left-style"/>
-		<property name="border-top-width"/>
-		<property name="border-right-width"/>
-		<property name="border-bottom-width"/>
-		<property name="border-left-width"/>
-		<property name="border-width"/>
-		<property name="bottom"/>
-		<property name="caption-side"/>
-		<property name="clear"/>
-		<property name="clip"/>
-		<property name="color"/>
-		<property name="content"/>
-		<property name="counter-increment"/>
-		<property name="counter-reset"/>
-		<property name="cue"/>
-		<property name="cue-after"/>
-		<property name="cue-before"/>
-		<property name="cursor"/>
-		<property name="direction"/>
-		<property name="display"/>
-		<property name="elevation"/>
-		<property name="empty-cells"/>
-		<property name="float"/>
-		<property name="font"/>
-		<property name="font-family"/>
-		<property name="font-size"/>
-		<property name="font-size-adjust"/>
-		<property name="font-stretch"/>
-		<property name="font-style"/>
-		<property name="font-variant"/>
-		<property name="font-weight"/>
-		<property name="height"/>
-		<property name="left"/>
-		<property name="letter-spacing"/>
-		<property name="line-height"/>
-		<property name="list-style"/>
-		<property name="list-style-image"/>
-		<property name="list-style-position"/>
-		<property name="list-style-type"/>
-		<property name="margin"/>
-		<property name="margin-top"/>
-		<property name="margin-right"/>
-		<property name="margin-bottom"/>
-		<property name="margin-left"/>
-		<property name="marker-offset"/>
-		<property name="marks"/>
-		<property name="max-height"/>
-		<property name="max-width"/>
-		<property name="min-height"/>
-		<property name="min-width"/>
-		<property name="orphans"/>
-		<property name="outline"/>
-		<property name="outline-color"/>
-		<property name="outline-style"/>
-		<property name="outline-width"/>
-		<property name="overflow"/>
-		<property name="padding"/>
-		<property name="padding-top"/>
-		<property name="padding-right"/>
-		<property name="padding-bottom"/>
-		<property name="padding-left"/>
-		<property name="page"/>
-		<property name="page-break-after"/>
-		<property name="page-break-before"/>
-		<property name="page-break-inside"/>
-		<property name="pause"/>
-		<property name="pause-after"/>
-		<property name="pause-before"/>
-		<property name="pitch"/>
-		<property name="pitch-range"/>
-		<property name="play-during"/>
-		<property name="position"/>
-		<property name="quotes"/>
-		<property name="richness"/>
-		<property name="right"/>
-		<property name="size"/>
-		<property name="speak"/>
-		<property name="speak-header"/>
-		<property name="speak-numeral"/>
-		<property name="speak-punctuation"/>
-		<property name="speech-rate"/>
-		<property name="stress"/>
-		<property name="table-layout"/>
-		<property name="text-align"/>
-		<property name="text-decoration"/>
-		<property name="text-indent"/>
-		<property name="text-shadow"/>
-		<property name="text-transform"/>
-		<property name="top"/>
-		<property name="unicode-bidi"/>
-		<property name="vertical-align"/>
-		<property name="visibility"/>
-		<property name="voice-family"/>
-		<property name="volume"/>
-		<property name="white-space"/>
-		<property name="widows"/>
-		<property name="width"/>
-		<property name="word-spacing"/>
-		<property name="z-index"/>
-	</style-rule-def>
-
-	<pseudo-class-def name="first-child">
-		<selector-value>first-child</selector-value>
-	</pseudo-class-def>
-	<pseudo-class-def name="link">
-		<selector-value>link</selector-value>
-	</pseudo-class-def>
-	<pseudo-class-def name="visited">
-		<selector-value>visited</selector-value>
-	</pseudo-class-def>
-	<pseudo-class-def name="hover">
-		<selector-value>hover</selector-value>
-	</pseudo-class-def>
-	<pseudo-class-def name="active">
-		<selector-value>active</selector-value>
-	</pseudo-class-def>
-	<pseudo-class-def name="focus">
-		<selector-value>focus</selector-value>
-	</pseudo-class-def>
-	<pseudo-class-def name="lang">
-		<selector-value>lang</selector-value>
-	</pseudo-class-def>
-	<pseudo-class-def name="left">
-		<selector-value>left</selector-value>
-	</pseudo-class-def>
-	<pseudo-class-def name="right">
-		<selector-value>right</selector-value>
-	</pseudo-class-def>
-	<pseudo-class-def name="first">
-		<selector-value>first</selector-value>
-	</pseudo-class-def>
-
-	<pseudo-element-def name="first-line">
-		<selector-value>first-line</selector-value>
-	</pseudo-element-def>
-	<pseudo-element-def name="first-letter">
-		<selector-value>first-letter</selector-value>
-	</pseudo-element-def>
-	<pseudo-element-def name="before">
-		<selector-value>before</selector-value>
-	</pseudo-element-def>
-	<pseudo-element-def name="after">
-		<selector-value>after</selector-value>
-	</pseudo-element-def>
-
-	<!-- property definition -->
-
-	<property-def name="azimuth"
-		inherited="yes" mediagroup="aural" category="aural">
-        <description>This provides spatial audio property for aural
-        presentation</description>
-        <number name="angle"/>
-        <keyword name="left-side"/>
-        <keyword name="far-left"/>
-        <keyword name="left"/>
-        <keyword name="center-left"/>
-        <keyword name="center"/>
-        <keyword name="center-right"/>
-        <keyword name="right"/>
-        <keyword name="far-right"/>
-        <keyword name="right-side"/>
-        <keyword name="behind"/>
-        <keyword name="leftwards"/>
-        <keyword name="rightwards"/>
-        <keyword name="inherit"/>
-    </property-def>
-    <property-def name="background"
-		inherited="no" mediagroup="visual" category="colorandbackground">
-        <property name="background-color"/>
-        <property name="background-image"/>
-        <property name="background-repeat"/>
-        <property name="background-attachment"/>
-        <property name="background-position"/>
-        <keyword name="inherit"/>
-    </property-def>
-    <property-def name="background-attachment"
-		inherited="no" mediagroup="visual" category="colorandbackground">
-        <keyword name="scroll"/>
-        <keyword name="fixed"/>
-        <keyword name="inherit"/>
-    </property-def>
-    <property-def name="background-color"
-		inherited="no" mediagroup="visual" category="colorandbackground">
-        <container name="color"/>
-        <keyword name="transparent"/>
-        <keyword name="inherit"/>
-    </property-def>
-    <property-def name="background-image"
-		inherited="no" mediagroup="visual" category="colorandbackground">
-        <function name="uri"/>
-        <keyword name="none"/>
-        <keyword name="inherit"/>
-    </property-def>
-	<property-def name="background-position"
-		inherited="no" mediagroup="visual" category="colorandbackground">
-		<number name="percentage"/>
-		<number name="length"/>
-		<keyword name="top"/>
-		<keyword name="center"/>
-		<keyword name="bottom"/>
-		<keyword name="left"/>
-		<keyword name="right"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="background-repeat"
-		inherited="no" mediagroup="visual" category="colorandbackground">
-		<keyword name="repeat"/>
-		<keyword name="repeat-x"/>
-		<keyword name="repeat-y"/>
-		<keyword name="no-repeat"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border"
-		inherited="no" mediagroup="visual" category="box">
-		<property name="border-width"/>
-		<property name="border-style"/>
-		<container name="color"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-collapse"
-		inherited="yes" mediagroup="visual" category="tables">
-		<keyword name="collapse"/>
-		<keyword name="separate"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-color"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="color"/>
-		<keyword name="transparent"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-spacing"
-		inherited="yes" mediagroup="visual" category="tables">
-		<number name="length"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-style"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="border-style"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-top"
-		inherited="no" mediagroup="visual" category="box">
-		<property name="border-top-width"/>
-		<property name="border-style"/>
-		<container name="color"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-right"
-		inherited="no" mediagroup="visual" category="box">
-		<property name="border-right-width"/>
-		<property name="border-style"/>
-		<container name="color"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-bottom"
-		inherited="no" mediagroup="visual" category="box">
-		<property name="border-bottom-width"/>
-		<property name="border-style"/>
-		<container name="color"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-left"
-		inherited="no" mediagroup="visual" category="box">
-		<property name="border-left-width"/>
-		<property name="border-style"/>
-		<container name="color"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-top-color"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="color"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-right-color"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="color"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-bottom-color"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="color"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-left-color"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="color"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-top-style"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="border-style"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-right-style"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="border-style"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-bottom-style"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="border-style"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-left-style"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="border-style"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-top-width"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="border-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-right-width"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="border-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-bottom-width"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="border-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-left-width"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="border-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="border-width"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="border-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="bottom"
-		inherited="no" mediagroup="visual" category="visual">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="caption-side"
-		inherited="yes" mediagroup="visual" category="tables">
-		<keyword name="top"/>
-		<keyword name="bottom"/>
-		<keyword name="left"/>
-		<keyword name="right"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="clear"
-		inherited="no" mediagroup="visual" category="visual">
-		<keyword name="none"/>
-		<keyword name="left"/>
-		<keyword name="right"/>
-		<keyword name="both"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="clip"
-		inherited="no" mediagroup="visual" category="visual">
-		<container name="shape"/>
-		<keyword name="auto"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="color"
-		inherited="yes" mediagroup="visual" category="colorandbackground">
-		<container name="color"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="content"
-		inherited="no" mediagroup="all" category="content">
-		<string name="any"/>
-		<function name="uri"/>
-		<function name="counter"/>
-		<function name="attr"/>
-		<keyword name="open-quote"/>
-		<keyword name="close-quote"/>
-		<keyword name="no-open-quote"/>
-		<keyword name="no-close-quote"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="counter-increment"
-		inherited="no" mediagroup="all" category="content">
-		<string name="counter-identifier"/>
-		<number name="integer"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="counter-reset"
-		inherited="no" mediagroup="all" category="content">
-		<string name="counter-identifier"/>
-		<number name="integer"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="cue"
-		inherited="no" mediagroup="aural" category="aural">
-		<property name="cue-before"/>
-		<property name="cue-after"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="cue-after"
-		inherited="no" mediagroup="aural" category="aural">
-		<function name="uri"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="cue-before"
-		inherited="no" mediagroup="aural" category="aural">
-		<function name="uri"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="cursor"
-		inherited="yes" mediagroup="visual,interactive" category="ui">
-		<function name="uri"/>
-		<keyword name="auto"/>
-		<keyword name="crosshair"/>
-		<keyword name="default"/>
-		<keyword name="pointer"/>
-		<keyword name="move"/>
-		<keyword name="e-resize"/>
-		<keyword name="ne-resize"/>
-		<keyword name="nw-resize"/>
-		<keyword name="n-resize"/>
-		<keyword name="se-resize"/>
-		<keyword name="sw-resize"/>
-		<keyword name="s-resize"/>
-		<keyword name="w-resize"/>
-		<keyword name="text"/>
-		<keyword name="wait"/>
-		<keyword name="help"/>
-		<keyword name="inherit"/>
-		<separator name="comma"/>
-	</property-def>
-	<property-def name="direction"
-		inherited="yes" mediagroup="visual" category="visual">
-		<keyword name="ltr"/>
-		<keyword name="rtl"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="display"
-		inherited="no" mediagroup="all" category="visual">
-		<keyword name="inline"/>
-		<keyword name="block"/>
-		<keyword name="list-item"/>
-		<keyword name="run-in"/>
-		<keyword name="compact"/>
-		<keyword name="marker"/>
-		<keyword name="table"/>
-		<keyword name="inline-table"/>
-		<keyword name="table-row-group"/>
-		<keyword name="table-header-group"/>
-		<keyword name="table-footer-group"/>
-		<keyword name="table-row"/>
-		<keyword name="table-column-group"/>
-		<keyword name="table-column"/>
-		<keyword name="table-cell"/>
-		<keyword name="table-caption"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="elevation"
-		inherited="yes" mediagroup="aural" category="aural">
-		<number name="angle"/>
-		<keyword name="below"/>
-		<keyword name="level"/>
-		<keyword name="above"/>
-		<keyword name="higher"/>
-		<keyword name="lower"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="empty-cells"
-		inherited="yes" mediagroup="visual" category="tables">
-		<keyword name="show"/>
-		<keyword name="hide"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="float"
-		inherited="no" mediagroup="visual" category="visual">
-		<keyword name="left"/>
-		<keyword name="right"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="font"
-		inherited="yes" mediagroup="visual" category="font">
-		<property name="font-style"/>
-		<property name="font-variant"/>
-		<property name="font-weight"/>
-		<property name="font-size"/>
-		<property name="line-height"/>
-		<property name="font-family"/>
-		<keyword name="caption"/>
-		<keyword name="icon"/>
-		<keyword name="menu"/>
-		<keyword name="message-box"/>
-		<keyword name="small-caption"/>
-		<keyword name="status-bar"/>
-		<keyword name="inherit"/>
-		<separator name="slash"/>
-	</property-def>
-	<property-def name="font-family"
-		inherited="yes" mediagroup="visual" category="font">
-		<string name="family-name"/>
-		<container name="generic-family"/>
-		<keyword name="inherit"/>
-		<separator name="comma"/>
-	</property-def>
-	<property-def name="font-size"
-		inherited="yes" mediagroup="visual" category="font">
-		<container name="absolute-size"/>
-		<container name="relative-size"/>
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="font-size-adjust"
-		inherited="yes" mediagroup="visual" category="font">
-		<number name="number"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="font-stretch"
-		inherited="yes" mediagroup="visual" category="font">
-		<keyword name="normal"/>
-		<keyword name="wider"/>
-		<keyword name="narrower"/>
-		<keyword name="ultra-condensed"/>
-		<keyword name="extra-condensed"/>
-		<keyword name="condensed"/>
-		<keyword name="semi-condensed"/>
-		<keyword name="semi-expanded"/>
-		<keyword name="expanded"/>
-		<keyword name="extra-expanded"/>
-		<keyword name="ultra-expanded"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="font-style"
-		inherited="yes" mediagroup="visual" category="font">
-		<keyword name="normal"/>
-		<keyword name="italic"/>
-		<keyword name="oblique"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="font-variant"
-		inherited="yes" mediagroup="visual" category="font">
-		<keyword name="normal"/>
-		<keyword name="small-caps"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="font-weight"
-		inherited="yes" mediagroup="visual" category="font">
-		<keyword name="normal"/>
-		<keyword name="bold"/>
-		<keyword name="bolder"/>
-		<keyword name="lighter"/>
-		<keyword name="100"/>
-		<keyword name="200"/>
-		<keyword name="300"/>
-		<keyword name="400"/>
-		<keyword name="500"/>
-		<keyword name="600"/>
-		<keyword name="700"/>
-		<keyword name="800"/>
-		<keyword name="900"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="height"
-		inherited="no" mediagroup="visual" category="visual">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="left"
-		inherited="no" mediagroup="visual" category="visual">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="letter-spacing"
-		inherited="yes" mediagroup="visual" category="text">
-		<keyword name="normal"/>
-		<number name="length"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="line-height"
-		inherited="yes" mediagroup="visual" category="visual">
-		<keyword name="normal"/>
-		<number name="number"/>
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="list-style"
-		inherited="yes" mediagroup="visual" category="content">
-		<property name="list-style-type"/>
-		<property name="list-style-position"/>
-		<property name="list-style-image"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="list-style-image"
-		inherited="yes" mediagroup="visual" category="content">
-		<function name="uri"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="list-style-position"
-		inherited="yes" mediagroup="visual" category="content">
-		<keyword name="inside"/>
-		<keyword name="outside"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="list-style-type"
-		inherited="yes" mediagroup="visual" category="content">
-		<keyword name="disc"/>
-		<keyword name="circle"/>
-		<keyword name="square"/>
-		<keyword name="decimal"/>
-		<keyword name="decimal-leading-zero"/>
-		<keyword name="lower-roman"/>
-		<keyword name="upper-roman"/>
-		<keyword name="lower-greek"/>
-		<keyword name="lower-alpha"/>
-		<keyword name="lower-latin"/>
-		<keyword name="upper-alpha"/>
-		<keyword name="upper-latin"/>
-		<keyword name="hebrew"/>
-		<keyword name="armenian"/>
-		<keyword name="georgian"/>
-		<keyword name="cjk-ideographic"/>
-		<keyword name="hiragana"/>
-		<keyword name="katakana"/>
-		<keyword name="hiragana-iroha"/>
-		<keyword name="katakana-iroha"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="margin"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="margin-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="margin-top"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="margin-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="margin-right"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="margin-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="margin-bottom"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="margin-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="margin-left"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="margin-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="marker-offset"
-		inherited="no" mediagroup="visual" category="content">
-		<number name="length"/>
-		<keyword name="auto"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="marks"
-		inherited="na" mediagroup="visual,paged" category="page">
-		<keyword name="crop"/>
-		<keyword name="cross"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="max-height"
-		inherited="no" mediagroup="visual" category="visual">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="max-width"
-		inherited="no" mediagroup="visual" category="visual">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="min-height"
-		inherited="no" mediagroup="visual" category="visual">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="min-width"
-		inherited="no" mediagroup="visual" category="visual">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="orphans"
-		inherited="yes" mediagroup="visual,paged" category="page">
-		<number name="integer"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="outline"
-		inherited="no" mediagroup="visual,interactive" category="ui">
-		<property name="outline-color"/>
-		<property name="outline-style"/>
-		<property name="outline-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="outline-color"
-		inherited="no" mediagroup="visual,interactive" category="ui">
-		<container name="color"/>
-		<keyword name="invert"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="outline-style"
-		inherited="no" mediagroup="visual,interactive" category="ui">
-		<container name="border-style"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="outline-width"
-		inherited="no" mediagroup="visual,interactive" category="ui">
-		<container name="border-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="overflow"
-		inherited="no" mediagroup="visual" category="visual">
-		<keyword name="visible"/>
-		<keyword name="hidden"/>
-		<keyword name="scroll"/>
-		<keyword name="auto"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="padding"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="padding-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="padding-top"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="padding-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="padding-right"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="padding-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="padding-bottom"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="padding-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="padding-left"
-		inherited="no" mediagroup="visual" category="box">
-		<container name="padding-width"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="page"
-		inherited="yes" mediagroup="visual,paged" category="page">
-		<string name="page-identifier"/>
-		<keyword name="auto"/>
-	</property-def>
-	<property-def name="page-break-after"
-		inherited="no" mediagroup="visual,paged" category="page">
-		<keyword name="auto"/>
-		<keyword name="always"/>
-		<keyword name="avoid"/>
-		<keyword name="left"/>
-		<keyword name="right"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="page-break-before"
-		inherited="no" mediagroup="visual,paged" category="page">
-		<keyword name="auto"/>
-		<keyword name="always"/>
-		<keyword name="avoid"/>
-		<keyword name="left"/>
-		<keyword name="right"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="page-break-inside"
-		inherited="yes" mediagroup="visual,paged" category="page">
-		<keyword name="avoid"/>
-		<keyword name="auto"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="pause"
-		inherited="no" mediagroup="aural" category="aural">
-		<number name="time"/>
-		<number name="percentage"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="pause-after"
-		inherited="no" mediagroup="aural" category="aural">
-		<number name="time"/>
-		<number name="percentage"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="pause-before"
-		inherited="no" mediagroup="aural" category="aural">
-		<number name="time"/>
-		<number name="percentage"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="pitch"
-		inherited="yes" mediagroup="aural" category="aural">
-		<number name="frequency"/>
-		<keyword name="x-low"/>
-		<keyword name="low"/>
-		<keyword name="medium"/>
-		<keyword name="high"/>
-		<keyword name="x-high"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="pitch-range"
-		inherited="yes" mediagroup="aural" category="aural">
-		<number name="number"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="play-during"
-		inherited="no" mediagroup="aural" category="aural">
-		<function name="uri"/>
-		<keyword name="mix"/>
-		<keyword name="repeat"/>
-		<keyword name="auto"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="position"
-		inherited="no" mediagroup="visual" category="visual">
-		<keyword name="static"/>
-		<keyword name="relative"/>
-		<keyword name="absolute"/>
-		<keyword name="fixed"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="quotes"
-		inherited="yes" mediagroup="visual" category="content">
-		<string name="any"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="richness"
-		inherited="yes" mediagroup="aural" category="aural">
-		<number name="number"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="right"
-		inherited="no" mediagroup="visual" category="visual">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="size"
-		inherited="na" mediagroup="visual,paged" category="page">
-		<number name="length"/>
-		<keyword name="auto"/>
-		<keyword name="portrait"/>
-		<keyword name="landscape"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="speak"
-		inherited="yes" mediagroup="aural" category="aural">
-		<keyword name="normal"/>
-		<keyword name="none"/>
-		<keyword name="spell-out"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="speak-header"
-		inherited="yes" mediagroup="aural" category="tables">
-		<keyword name="once"/>
-		<keyword name="always"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="speak-numeral"
-		inherited="yes" mediagroup="aural" category="aural">
-		<keyword name="digits"/>
-		<keyword name="continuous"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="speak-punctuation"
-		inherited="yes" mediagroup="aural" category="aural">
-		<keyword name="code"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="speech-rate"
-		inherited="yes" mediagroup="aural" category="aural">
-		<number name="number"/>
-		<keyword name="x-slow"/>
-		<keyword name="slow"/>
-		<keyword name="medium"/>
-		<keyword name="fast"/>
-		<keyword name="x-fast"/>
-		<keyword name="faster"/>
-		<keyword name="slower"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="stress"
-		inherited="yes" mediagroup="aural" category="aural">
-		<number name="number"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="table-layout"
-		inherited="no" mediagroup="visual" category="tables">
-		<keyword name="auto"/>
-		<keyword name="fixed"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="text-align"
-		inherited="yes" mediagroup="visual" category="text">
-		<keyword name="left"/>
-		<keyword name="right"/>
-		<keyword name="center"/>
-		<keyword name="justify"/>
-		<string name="any"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="text-decoration"
-		inherited="no" mediagroup="visual" category="text">
-		<keyword name="none"/>
-		<keyword name="underline"/>
-		<keyword name="overline"/>
-		<keyword name="line-through"/>
-		<keyword name="blink"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="text-indent"
-		inherited="yes" mediagroup="visual" category="text">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="text-shadow"
-		inherited="no" mediagroup="visual" category="text">
-		<keyword name="none"/>
-		<container name="color"/>
-		<number name="length"/>
-		<keyword name="inherit"/>
-		<separator name="comma"/>
-	</property-def>
-	<property-def name="text-transform"
-		inherited="yes" mediagroup="visual" category="text">
-		<keyword name="capitalize"/>
-		<keyword name="uppercase"/>
-		<keyword name="lowercase"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="top"
-		inherited="no" mediagroup="visual" category="visual">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="unicode-bidi"
-		inherited="no" mediagroup="visual" category="visual">
-		<keyword name="normal"/>
-		<keyword name="embed"/>
-		<keyword name="bidi-override"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="vertical-align"
-		inherited="no" mediagroup="visual" category="visual">
-		<keyword name="baseline"/>
-		<keyword name="sub"/>
-		<keyword name="super"/>
-		<keyword name="top"/>
-		<keyword name="text-top"/>
-		<keyword name="middle"/>
-		<keyword name="bottom"/>
-		<keyword name="text-bottom"/>
-		<number name="percentage"/>
-		<number name="length"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="visibility"
-		inherited="no" mediagroup="visual" category="visual">
-		<keyword name="visible"/>
-		<keyword name="hidden"/>
-		<keyword name="collapse"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="voice-family"
-		inherited="yes" mediagroup="aural" category="aural">
-		<string name="specific-voice"/>
-		<container name="generic-voice"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="volume"
-		inherited="yes" mediagroup="aural" category="aural">
-		<number name="number"/>
-		<number name="percentage"/>
-		<keyword name="silent"/>
-		<keyword name="x-soft"/>
-		<keyword name="soft"/>
-		<keyword name="medium"/>
-		<keyword name="loud"/>
-		<keyword name="x-loud"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="white-space"
-		inherited="yes" mediagroup="visual" category="text">
-		<keyword name="normal"/>
-		<keyword name="pre"/>
-		<keyword name="nowrap"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="widows"
-		inherited="yes" mediagroup="visual,paged" category="page">
-		<number name="integer"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="width"
-		inherited="no" mediagroup="visual" category="visual">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="word-spacing"
-		inherited="yes" mediagroup="visual" category="text">
-		<keyword name="normal"/>
-		<number name="length"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="z-index"
-		inherited="no" mediagroup="visual" category="visual">
-		<keyword name="auto"/>
-		<number name="integer"/>
-		<keyword name="inherit"/>
-	</property-def>
-
-	<!-- descriptor definition : These are for @font-face -->
-
-	<descriptor-def name="ascent">
-		<number name="number"/>
-	</descriptor-def>
-	<descriptor-def name="baseline">
-		<number name="number"/>
-	</descriptor-def>
-	<descriptor-def name="bbox">
-		<number name="number"/>
-		<separator name="comma"/>
-	</descriptor-def>
-	<descriptor-def name="cap-height">
-		<number name="number"/>
-	</descriptor-def>
-	<descriptor-def name="centerline">
-		<number name="number"/>
-	</descriptor-def>
-	<descriptor-def name="definition-src">
-		<function name="uri"/>
-	</descriptor-def>
-	<descriptor-def name="descent">
-		<number name="number"/>
-	</descriptor-def>
-	<descriptor-def name="font-family">
-		<string name="family-name"/>
-		<container name="generic-family"/>
-		<separator name="comma"/>
-	</descriptor-def>
-	<descriptor-def name="font-size">
-		<keyword name="all"/>
-		<number name="length"/>
-		<separator name="comma"/>
-	</descriptor-def>
-	<descriptor-def name="font-stretch">
-		<keyword name="all"/>
-		<keyword name="normal"/>
-		<keyword name="ultra-condensed"/>
-		<keyword name="extra-condensed"/>
-		<keyword name="condensed"/>
-		<keyword name="semi-condensed"/>
-		<keyword name="semi-expanded"/>
-		<keyword name="expanded"/>
-		<keyword name="extra-expanded"/>
-		<keyword name="ultra-expanded"/>
-		<separator name="comma"/>
-	</descriptor-def>
-	<descriptor-def name="font-style">
-		<keyword name="all"/>
-		<keyword name="normal"/>
-		<keyword name="italic"/>
-		<keyword name="oblique"/>
-		<separator name="comma"/>
-	</descriptor-def>
-	<descriptor-def name="font-variant">
-		<keyword name="normal"/>
-		<keyword name="small-caps"/>
-		<separator name="comma"/>
-	</descriptor-def>
-	<descriptor-def name="font-weight">
-		<keyword name="all"/>
-		<keyword name="normal"/>
-		<keyword name="bold"/>
-		<keyword name="100"/>
-		<keyword name="200"/>
-		<keyword name="300"/>
-		<keyword name="400"/>
-		<keyword name="500"/>
-		<keyword name="600"/>
-		<keyword name="700"/>
-		<keyword name="800"/>
-		<keyword name="900"/>
-		<separator name="comma"/>
-	</descriptor-def>
-	<descriptor-def name="mathline">
-		<number name="number"/>
-	</descriptor-def>
-	<descriptor-def name="panose-1">
-		<number name="integer"/>
-	</descriptor-def>
-	<descriptor-def name="slope">
-		<number name="number"/>
-	</descriptor-def>
-	<descriptor-def name="src">
-		<function name="uri"/>
-		<function name="format"/>
-		<container name="font-face-name"/>
-	</descriptor-def>
-	<descriptor-def name="stemh">
-		<number name="number"/>
-	</descriptor-def>
-	<descriptor-def name="stemv">
-		<number name="number"/>
-	</descriptor-def>
-	<descriptor-def name="topline">
-		<number name="number"/>
-	</descriptor-def>
-	<descriptor-def name="unicode-range">
-		<string name="urange"/>
-	</descriptor-def>
-	<descriptor-def name="units-per-em">
-		<number name="number"/>
-	</descriptor-def>
-	<descriptor-def name="widths">
-		<string name="urange"/>
-		<number name="length"/>
-	</descriptor-def>
-	<descriptor-def name="x-height">
-		<number name="number"/>
-	</descriptor-def>
-
-	<!-- container definition : Container is the lump of values.
-	It can be used like macros. -->
-    <container-def name="absolute-size">
-        <keyword name="xx-small"/>
-        <keyword name="x-small"/>
-        <keyword name="small"/>
-        <keyword name="medium"/>
-        <keyword name="large"/>
-        <keyword name="x-large"/>
-        <keyword name="xx-large"/>
-    </container-def>
-    <container-def name="border-style">
-        <keyword name="none"/>
-        <keyword name="hidden"/>
-        <keyword name="dotted"/>
-        <keyword name="dashed"/>
-        <keyword name="solid"/>
-        <keyword name="double"/>
-        <keyword name="groove"/>
-        <keyword name="ridge"/>
-        <keyword name="inset"/>
-        <keyword name="outset"/>
-    </container-def>
-    <container-def name="border-width">
-        <keyword name="thin"/>
-        <keyword name="medium"/>
-        <keyword name="thick"/>
-        <number name="length"/>
-    </container-def>
-	<container-def name="color">
-		<keyword name="aqua"/>
-		<keyword name="black"/>
-		<keyword name="blue"/>
-		<keyword name="fuchsia"/>
-		<keyword name="gray"/>
-		<keyword name="green"/>
-		<keyword name="lime"/>
-		<keyword name="maroon"/>
-		<keyword name="navy"/>
-		<keyword name="olive"/>
-		<keyword name="purple"/>
-		<keyword name="red"/>
-		<keyword name="silver"/>
-		<keyword name="teal"/>
-		<keyword name="white"/>
-		<keyword name="yellow"/>
-		<container name="system-color"/>
-		<function name="rgb"/>
-		<number name="hash"/>
-	</container-def>
-	<container-def name="generic-family">
-		<keyword name="serif"/>
-		<keyword name="sans-serif"/>
-		<keyword name="cursive"/>
-		<keyword name="fantasy"/>
-		<keyword name="monospace"/>
-	</container-def>
-	<container-def name="font-face-name">
-		<function name="local"/>
-	</container-def>
-	<container-def name="generic-voice">
-		<keyword name="male"/>
-		<keyword name="female"/>
-		<keyword name="child"/>
-	</container-def>
-	<container-def name="margin-width">
-		<number name="length"/>
-		<number name="percentage"/>
-		<keyword name="auto"/>
-	</container-def>
-	<container-def name="padding-width">
-		<number name="length"/>
-		<number name="percentage"/>
-	</container-def>
-	<container-def name="relative-size">
-		<keyword name="smaller"/>
-		<keyword name="larger"/>
-	</container-def>
-	<container-def name="shape">
-		<function name="rect"/>
-	</container-def>
-	<container-def name="system-color">
-		<keyword name="ActiveBorder"/>
-		<keyword name="ActiveCaption"/>
-		<keyword name="AppWorkspace"/>
-		<keyword name="Background"/>
-		<keyword name="ButtonFace"/>
-		<keyword name="ButtonHighlight"/>
-		<keyword name="ButtonShadow"/>
-		<keyword name="ButtonText"/>
-		<keyword name="CaptionText"/>
-		<keyword name="GrayText"/>
-		<keyword name="Highlight"/>
-		<keyword name="HighlightText"/>
-		<keyword name="InactiveBorder"/>
-		<keyword name="InactiveCaption"/>
-		<keyword name="InactiveCaptionText"/>
-		<keyword name="InfoBackground"/>
-		<keyword name="InfoText"/>
-		<keyword name="Menu"/>
-		<keyword name="MenuText"/>
-		<keyword name="Scrollbar"/>
-		<keyword name="ThreeDDarkShadow"/>
-		<keyword name="ThreeDFace"/>
-		<keyword name="ThreeDHighlight"/>
-		<keyword name="ThreeDLightShadow"/>
-		<keyword name="ThreeDShadow"/>
-		<keyword name="Window"/>
-		<keyword name="WindowFrame"/>
-		<keyword name="WindowText"/>
-	</container-def>
-
-	<!-- category definition : This is used to categorize properties
-	in Properties View. -->
-	<category-def name="aural">
-		<caption>%css2.category-def.aural.caption</caption>
-	</category-def>
-	<category-def name="box">
-		<caption>%css2.category-def.box.caption</caption>
-	</category-def>
-	<category-def name="colorandbackground">
-		<caption>%css2.category-def.colorandbackground.caption</caption>
-	</category-def>
-	<category-def name="content">
-		<caption>%css2.category-def.content.caption</caption>
-	</category-def>
-	<category-def name="font">
-		<caption>%css2.category-def.font.caption</caption>
-	</category-def>
-	<category-def name="page">
-		<caption>%css2.category-def.page.caption</caption>
-	</category-def>
-	<category-def name="tables">
-		<caption>%css2.category-def.tables.caption</caption>
-	</category-def>
-	<category-def name="text">
-		<caption>%css2.category-def.text.caption</caption>
-	</category-def>
-	<category-def name="ui">
-		<caption>%css2.category-def.ui.caption</caption>
-	</category-def>
-	<category-def name="visual">
-<!--		<caption>%css2.category-def.visual.caption</caption>-->
-		<caption>%css2.category-def.visual.caption</caption>
-	</category-def>
-	
-	<!-- function definition -->
-	<function-def name="attr">
-		<function-value>attr</function-value>
-	</function-def>
-	<function-def name="counter">
-		<function-value>counter</function-value>
-	</function-def>
-	<function-def name="rect">
-		<function-value>rect</function-value>
-	</function-def>
-	<function-def name="rgb">
-		<function-value>rgb</function-value>
-	</function-def>
-	<function-def name="uri">
-		<function-value>url</function-value>
-	</function-def>
-	<function-def name="format">
-		<function-value>format</function-value>
-	</function-def>
-	<function-def name="local">
-		<function-value>local</function-value>
-	</function-def>
-
-	<!-- number definition : What unit types be acceptable for each
-	number type? -->
-    <number-def name="angle">
-        <unit name="deg"/>
-        <unit name="grad"/>
-        <unit name="rad"/>
-    </number-def>
-    <number-def name="frequency">
-        <unit name="hz"/>
-        <unit name="khz"/>
-    </number-def>
-    <number-def name="hash">
-        <unit name="hash"/>
-    </number-def>
-	<number-def name="integer">
-	</number-def>
-    <number-def name="length">
-        <unit name="em"/>
-        <unit name="ex"/>
-        <unit name="px"/>
-        <unit name="in"/>
-        <unit name="cm"/>
-        <unit name="mm"/>
-        <unit name="pt"/>
-        <unit name="pc"/>
-    </number-def>
-	<number-def name="number">
-	</number-def>
-	<number-def name="percentage">
-		<unit name="percentage"/>
-	</number-def>
-	<number-def name="time">
-		<unit name="ms"/>
-		<unit name="s"/>
-	</number-def>
-
-	<unit-def name="cm">
-		<unit-value>cm</unit-value>
-	</unit-def>
-	<unit-def name="deg">
-		<unit-value>deg</unit-value>
-	</unit-def>
-	<unit-def name="em">
-		<unit-value>em</unit-value>
-	</unit-def>
-	<unit-def name="ex">
-		<unit-value>ex</unit-value>
-	</unit-def>
-	<unit-def name="grad">
-		<unit-value>grad</unit-value>
-	</unit-def>
-	<unit-def name="hash">
-		<unit-value>#</unit-value>
-	</unit-def>
-	<unit-def name="hz">
-		<unit-value>Hz</unit-value>
-	</unit-def>
-	<unit-def name="in">
-		<unit-value>in</unit-value>
-	</unit-def>
-	<unit-def name="khz">
-		<unit-value>kHz</unit-value>
-	</unit-def>
-	<unit-def name="mm">
-		<unit-value>mm</unit-value>
-	</unit-def>
-	<unit-def name="ms">
-		<unit-value>ms</unit-value>
-	</unit-def>
-	<unit-def name="pc">
-		<unit-value>pc</unit-value>
-	</unit-def>
-	<unit-def name="percentage">
-		<unit-value>%</unit-value>
-	</unit-def>
-	<unit-def name="pt">
-		<unit-value>pt</unit-value>
-	</unit-def>
-	<unit-def name="px">
-		<unit-value>px</unit-value>
-	</unit-def>
-	<unit-def name="rad">
-		<unit-value>rad</unit-value>
-	</unit-def>
-	<unit-def name="s">
-		<unit-value>s</unit-value>
-	</unit-def>
-
-    <!-- keywords : string constants (this is last part..) -->
-    <keyword-def name="100">
-        <keyword-value>100</keyword-value>
-    </keyword-def>
-    <keyword-def name="200">
-        <keyword-value>200</keyword-value>
-    </keyword-def>
-    <keyword-def name="300">
-        <keyword-value>300</keyword-value>
-    </keyword-def>
-    <keyword-def name="400">
-        <keyword-value>400</keyword-value>
-    </keyword-def>
-    <keyword-def name="500">
-        <keyword-value>500</keyword-value>
-    </keyword-def>
-    <keyword-def name="600">
-        <keyword-value>600</keyword-value>
-    </keyword-def>
-    <keyword-def name="700">
-        <keyword-value>700</keyword-value>
-    </keyword-def>
-    <keyword-def name="800">
-        <keyword-value>800</keyword-value>
-    </keyword-def>
-    <keyword-def name="900">
-        <keyword-value>900</keyword-value>
-    </keyword-def>
-    <keyword-def name="above">
-        <keyword-value>above</keyword-value>
-    </keyword-def>
-    <keyword-def name="absolute">
-        <keyword-value>absolute</keyword-value>
-    </keyword-def>
-    <keyword-def name="ActiveBorder">
-        <keyword-value>ActiveBorder</keyword-value>
-    </keyword-def>
-    <keyword-def name="ActiveCaption">
-        <keyword-value>ActiveCaption</keyword-value>
-    </keyword-def>
-    <keyword-def name="all">
-        <keyword-value>all</keyword-value>
-    </keyword-def>
-    <keyword-def name="always">
-        <keyword-value>always</keyword-value>
-    </keyword-def>
-    <keyword-def name="AppWorkspace">
-        <keyword-value>AppWorkspace</keyword-value>
-    </keyword-def>
-    <keyword-def name="aqua">
-        <keyword-value>aqua</keyword-value>
-    </keyword-def>
-    <keyword-def name="armenian">
-        <keyword-value>armenian</keyword-value>
-    </keyword-def>
-    <keyword-def name="auto">
-        <keyword-value>auto</keyword-value>
-    </keyword-def>
-    <keyword-def name="avoid">
-        <keyword-value>avoid</keyword-value>
-    </keyword-def>
-    <keyword-def name="Background">
-        <keyword-value>Background</keyword-value>
-    </keyword-def>
-    <keyword-def name="baseline">
-        <keyword-value>baseline</keyword-value>
-    </keyword-def>
-    <keyword-def name="behind">
-        <keyword-value>behind</keyword-value>
-    </keyword-def>
-    <keyword-def name="below">
-        <keyword-value>below</keyword-value>
-    </keyword-def>
-    <keyword-def name="bidi-override">
-        <keyword-value>bidi-override</keyword-value>
-    </keyword-def>
-    <keyword-def name="black">
-        <keyword-value>black</keyword-value>
-    </keyword-def>
-    <keyword-def name="blink">
-        <keyword-value>blink</keyword-value>
-    </keyword-def>
-    <keyword-def name="block">
-        <keyword-value>block</keyword-value>
-    </keyword-def>
-    <keyword-def name="blue">
-        <keyword-value>blue</keyword-value>
-    </keyword-def>
-    <keyword-def name="bold">
-        <keyword-value>bold</keyword-value>
-    </keyword-def>
-    <keyword-def name="bolder">
-        <keyword-value>bolder</keyword-value>
-    </keyword-def>
-    <keyword-def name="both">
-        <keyword-value>both</keyword-value>
-    </keyword-def>
-    <keyword-def name="bottom">
-        <keyword-value>bottom</keyword-value>
-    </keyword-def>
-    <keyword-def name="ButtonFace">
-        <keyword-value>ButtonFace</keyword-value>
-    </keyword-def>
-    <keyword-def name="ButtonHighlight">
-        <keyword-value>ButtonHighlight</keyword-value>
-    </keyword-def>
-    <keyword-def name="ButtonShadow">
-        <keyword-value>ButtonShadow</keyword-value>
-    </keyword-def>
-    <keyword-def name="ButtonText">
-        <keyword-value>ButtonText</keyword-value>
-    </keyword-def>
-    <keyword-def name="capitalize">
-        <keyword-value>capitalize</keyword-value>
-    </keyword-def>
-    <keyword-def name="caption">
-        <keyword-value>caption</keyword-value>
-    </keyword-def>
-    <keyword-def name="CaptionText">
-        <keyword-value>CaptionText</keyword-value>
-    </keyword-def>
-    <keyword-def name="center">
-        <keyword-value>center</keyword-value>
-    </keyword-def>
-    <keyword-def name="center-left">
-        <keyword-value>center-left</keyword-value>
-    </keyword-def>
-    <keyword-def name="center-right">
-        <keyword-value>center-right</keyword-value>
-    </keyword-def>
-    <keyword-def name="child">
-        <keyword-value>child</keyword-value>
-    </keyword-def>
-    <keyword-def name="circle">
-        <keyword-value>circle</keyword-value>
-    </keyword-def>
-    <keyword-def name="cjk-ideographic">
-        <keyword-value>cjk-ideographic</keyword-value>
-    </keyword-def>
-    <keyword-def name="close-quote">
-        <keyword-value>close-quote</keyword-value>
-    </keyword-def>
-    <keyword-def name="code">
-        <keyword-value>code</keyword-value>
-    </keyword-def>
-    <keyword-def name="condensed">
-        <keyword-value>condensed</keyword-value>
-    </keyword-def>
-    <keyword-def name="collapse">
-        <keyword-value>collapse</keyword-value>
-    </keyword-def>
-    <keyword-def name="compact">
-        <keyword-value>compact</keyword-value>
-    </keyword-def>
-    <keyword-def name="continuous">
-        <keyword-value>continuous</keyword-value>
-    </keyword-def>
-    <keyword-def name="crop">
-        <keyword-value>crop</keyword-value>
-    </keyword-def>
-    <keyword-def name="cross">
-        <keyword-value>cross</keyword-value>
-    </keyword-def>
-    <keyword-def name="crosshair">
-        <keyword-value>crosshair</keyword-value>
-    </keyword-def>
-    <keyword-def name="cursive">
-        <keyword-value>cursive</keyword-value>
-    </keyword-def>
-    <keyword-def name="dashed">
-        <keyword-value>dashed</keyword-value>
-    </keyword-def>
-    <keyword-def name="decimal">
-        <keyword-value>decimal</keyword-value>
-    </keyword-def>
-    <keyword-def name="decimal-leading-zero">
-        <keyword-value>decimal-leading-zero</keyword-value>
-    </keyword-def>
-    <keyword-def name="default">
-        <keyword-value>default</keyword-value>
-    </keyword-def>
-    <keyword-def name="digits">
-        <keyword-value>digits</keyword-value>
-    </keyword-def>
-    <keyword-def name="disc">
-        <keyword-value>disc</keyword-value>
-    </keyword-def>
-    <keyword-def name="dotted">
-        <keyword-value>dotted</keyword-value>
-    </keyword-def>
-    <keyword-def name="double">
-        <keyword-value>double</keyword-value>
-    </keyword-def>
-    <keyword-def name="e-resize">
-        <keyword-value>e-resize</keyword-value>
-    </keyword-def>
-    <keyword-def name="embed">
-        <keyword-value>embed</keyword-value>
-    </keyword-def>
-    <keyword-def name="expanded">
-        <keyword-value>expanded</keyword-value>
-    </keyword-def>
-    <keyword-def name="extra-condensed">
-        <keyword-value>extra-condensed</keyword-value>
-    </keyword-def>
-    <keyword-def name="extra-expanded">
-        <keyword-value>extra-expanded</keyword-value>
-    </keyword-def>
-    <keyword-def name="fantasy">
-        <keyword-value>fantasy</keyword-value>
-    </keyword-def>
-    <keyword-def name="far-left">
-        <keyword-value>far-left</keyword-value>
-    </keyword-def>
-    <keyword-def name="far-right">
-        <keyword-value>far-right</keyword-value>
-    </keyword-def>
-    <keyword-def name="fast">
-        <keyword-value>fast</keyword-value>
-    </keyword-def>
-    <keyword-def name="faster">
-        <keyword-value>faster</keyword-value>
-    </keyword-def>
-    <keyword-def name="female">
-        <keyword-value>female</keyword-value>
-    </keyword-def>
-    <keyword-def name="fixed">
-        <keyword-value>fixed</keyword-value>
-    </keyword-def>
-    <keyword-def name="fuchsia">
-        <keyword-value>fuchsia</keyword-value>
-    </keyword-def>
-    <keyword-def name="georgian">
-        <keyword-value>georgian</keyword-value>
-    </keyword-def>
-    <keyword-def name="gray">
-        <keyword-value>gray</keyword-value>
-    </keyword-def>
-    <keyword-def name="GrayText">
-        <keyword-value>GrayText</keyword-value>
-    </keyword-def>
-    <keyword-def name="green">
-        <keyword-value>green</keyword-value>
-    </keyword-def>
-    <keyword-def name="groove">
-        <keyword-value>groove</keyword-value>
-    </keyword-def>
-    <keyword-def name="hebrew">
-        <keyword-value>hebrew</keyword-value>
-    </keyword-def>
-    <keyword-def name="help">
-        <keyword-value>help</keyword-value>
-    </keyword-def>
-    <keyword-def name="hidden">
-        <keyword-value>hidden</keyword-value>
-    </keyword-def>
-    <keyword-def name="hide">
-        <keyword-value>hide</keyword-value>
-    </keyword-def>
-    <keyword-def name="high">
-        <keyword-value>high</keyword-value>
-    </keyword-def>
-    <keyword-def name="Highlight">
-        <keyword-value>Highlight</keyword-value>
-    </keyword-def>
-    <keyword-def name="HighlightText">
-        <keyword-value>HighlightText</keyword-value>
-    </keyword-def>
-    <keyword-def name="higher">
-        <keyword-value>higher</keyword-value>
-    </keyword-def>
-    <keyword-def name="hiragana">
-        <keyword-value>hiragana</keyword-value>
-    </keyword-def>
-    <keyword-def name="hiragana-iroha">
-        <keyword-value>hiragana-iroha</keyword-value>
-    </keyword-def>
-    <keyword-def name="icon">
-        <keyword-value>icon</keyword-value>
-    </keyword-def>
-    <keyword-def name="InactiveBorder">
-        <keyword-value>InactiveBorder</keyword-value>
-    </keyword-def>
-    <keyword-def name="InactiveCaption">
-        <keyword-value>InactiveCaption</keyword-value>
-    </keyword-def>
-    <keyword-def name="InactiveCaptionText">
-        <keyword-value>InactiveCaptionText</keyword-value>
-    </keyword-def>
-    <keyword-def name="InfoBackground">
-        <keyword-value>InfoBackground</keyword-value>
-    </keyword-def>
-    <keyword-def name="InfoText">
-        <keyword-value>InfoText</keyword-value>
-    </keyword-def>
-    <keyword-def name="inherit">
-        <keyword-value>inherit</keyword-value>
-    </keyword-def>
-    <keyword-def name="inline">
-        <keyword-value>inline</keyword-value>
-    </keyword-def>
-    <keyword-def name="inline-table">
-        <keyword-value>inline-table</keyword-value>
-    </keyword-def>
-    <keyword-def name="inset">
-        <keyword-value>inset</keyword-value>
-    </keyword-def>
-    <keyword-def name="inside">
-        <keyword-value>inside</keyword-value>
-    </keyword-def>
-    <keyword-def name="invert">
-        <keyword-value>invert</keyword-value>
-    </keyword-def>
-    <keyword-def name="italic">
-        <keyword-value>italic</keyword-value>
-    </keyword-def>
-    <keyword-def name="justify">
-        <keyword-value>justify</keyword-value>
-    </keyword-def>
-    <keyword-def name="katakana">
-        <keyword-value>katakana</keyword-value>
-    </keyword-def>
-    <keyword-def name="katakana-iroha">
-        <keyword-value>katakana-iroha</keyword-value>
-    </keyword-def>
-    <keyword-def name="landscape">
-        <keyword-value>landscape</keyword-value>
-    </keyword-def>
-    <keyword-def name="large">
-        <keyword-value>large</keyword-value>
-    </keyword-def>
-    <keyword-def name="larger">
-        <keyword-value>larger</keyword-value>
-    </keyword-def>
-    <keyword-def name="left">
-        <keyword-value>left</keyword-value>
-    </keyword-def>
-    <keyword-def name="left-side">
-        <keyword-value>left-side</keyword-value>
-    </keyword-def>
-    <keyword-def name="leftwards">
-        <keyword-value>leftwards</keyword-value>
-    </keyword-def>
-    <keyword-def name="level">
-        <keyword-value>level</keyword-value>
-    </keyword-def>
-    <keyword-def name="lighter">
-        <keyword-value>lighter</keyword-value>
-    </keyword-def>
-    <keyword-def name="lime">
-        <keyword-value>lime</keyword-value>
-    </keyword-def>
-    <keyword-def name="line-through">
-        <keyword-value>line-through</keyword-value>
-    </keyword-def>
-    <keyword-def name="list-item">
-        <keyword-value>list-item</keyword-value>
-    </keyword-def>
-    <keyword-def name="loud">
-        <keyword-value>loud</keyword-value>
-    </keyword-def>
-    <keyword-def name="low">
-        <keyword-value>low</keyword-value>
-    </keyword-def>
-    <keyword-def name="lower">
-        <keyword-value>lower</keyword-value>
-    </keyword-def>
-    <keyword-def name="lower-alpha">
-        <keyword-value>lower-alpha</keyword-value>
-    </keyword-def>
-    <keyword-def name="lower-greek">
-        <keyword-value>lower-greek</keyword-value>
-    </keyword-def>
-    <keyword-def name="lower-latin">
-        <keyword-value>lower-latin</keyword-value>
-    </keyword-def>
-    <keyword-def name="lower-roman">
-        <keyword-value>lower-roman</keyword-value>
-    </keyword-def>
-    <keyword-def name="lowercase">
-        <keyword-value>lowercase</keyword-value>
-    </keyword-def>
-    <keyword-def name="ltr">
-        <keyword-value>ltr</keyword-value>
-    </keyword-def>
-    <keyword-def name="male">
-        <keyword-value>male</keyword-value>
-    </keyword-def>
-    <keyword-def name="marker">
-        <keyword-value>marker</keyword-value>
-    </keyword-def>
-    <keyword-def name="maroon">
-        <keyword-value>maroon</keyword-value>
-    </keyword-def>
-    <keyword-def name="medium">
-        <keyword-value>medium</keyword-value>
-    </keyword-def>
-    <keyword-def name="Menu">
-        <keyword-value>Menu</keyword-value>
-    </keyword-def>
-    <keyword-def name="MenuText">
-        <keyword-value>MenuText</keyword-value>
-    </keyword-def>
-    <keyword-def name="message-box">
-        <keyword-value>message-box</keyword-value>
-    </keyword-def>
-    <keyword-def name="middle">
-        <keyword-value>middle</keyword-value>
-    </keyword-def>
-    <keyword-def name="mix">
-        <keyword-value>mix</keyword-value>
-    </keyword-def>
-    <keyword-def name="monospace">
-        <keyword-value>monospace</keyword-value>
-    </keyword-def>
-    <keyword-def name="move">
-        <keyword-value>move</keyword-value>
-    </keyword-def>
-    <keyword-def name="n-resize">
-        <keyword-value>n-resize</keyword-value>
-    </keyword-def>
-    <keyword-def name="narrower">
-        <keyword-value>narrower</keyword-value>
-    </keyword-def>
-    <keyword-def name="navy">
-        <keyword-value>navy</keyword-value>
-    </keyword-def>
-    <keyword-def name="ne-resize">
-        <keyword-value>ne-resize</keyword-value>
-    </keyword-def>
-    <keyword-def name="no-close-quote">
-        <keyword-value>no-close-quote</keyword-value>
-    </keyword-def>
-    <keyword-def name="no-open-quote">
-        <keyword-value>no-open-quote</keyword-value>
-    </keyword-def>
-    <keyword-def name="no-repeat">
-        <keyword-value>no-repeat</keyword-value>
-    </keyword-def>
-    <keyword-def name="none">
-        <keyword-value>none</keyword-value>
-    </keyword-def>
-    <keyword-def name="normal">
-        <keyword-value>normal</keyword-value>
-    </keyword-def>
-    <keyword-def name="nowrap">
-        <keyword-value>nowrap</keyword-value>
-    </keyword-def>
-    <keyword-def name="nw-resize">
-        <keyword-value>nw-resize</keyword-value>
-    </keyword-def>
-    <keyword-def name="oblique">
-        <keyword-value>oblique</keyword-value>
-    </keyword-def>
-    <keyword-def name="olive">
-        <keyword-value>olive</keyword-value>
-    </keyword-def>
-    <keyword-def name="once">
-        <keyword-value>once</keyword-value>
-    </keyword-def>
-    <keyword-def name="open-quote">
-        <keyword-value>open-quote</keyword-value>
-    </keyword-def>
-    <keyword-def name="outset">
-        <keyword-value>outset</keyword-value>
-    </keyword-def>
-    <keyword-def name="outside">
-        <keyword-value>outside</keyword-value>
-    </keyword-def>
-    <keyword-def name="overline">
-        <keyword-value>overline</keyword-value>
-    </keyword-def>
-    <keyword-def name="pointer">
-        <keyword-value>pointer</keyword-value>
-    </keyword-def>
-    <keyword-def name="portrait">
-        <keyword-value>portrait</keyword-value>
-    </keyword-def>
-    <keyword-def name="pre">
-        <keyword-value>pre</keyword-value>
-    </keyword-def>
-    <keyword-def name="purple">
-        <keyword-value>purple</keyword-value>
-    </keyword-def>
-    <keyword-def name="red">
-        <keyword-value>red</keyword-value>
-    </keyword-def>
-    <keyword-def name="relative">
-        <keyword-value>relative</keyword-value>
-    </keyword-def>
-    <keyword-def name="repeat">
-        <keyword-value>repeat</keyword-value>
-    </keyword-def>
-    <keyword-def name="repeat-x">
-        <keyword-value>repeat-x</keyword-value>
-    </keyword-def>
-    <keyword-def name="repeat-y">
-        <keyword-value>repeat-y</keyword-value>
-    </keyword-def>
-    <keyword-def name="ridge">
-        <keyword-value>ridge</keyword-value>
-    </keyword-def>
-    <keyword-def name="right">
-        <keyword-value>right</keyword-value>
-    </keyword-def>
-    <keyword-def name="right-side">
-        <keyword-value>right-side</keyword-value>
-    </keyword-def>
-    <keyword-def name="rightwards">
-        <keyword-value>rightwards</keyword-value>
-    </keyword-def>
-    <keyword-def name="rtl">
-        <keyword-value>rtl</keyword-value>
-    </keyword-def>
-    <keyword-def name="run-in">
-        <keyword-value>run-in</keyword-value>
-    </keyword-def>
-    <keyword-def name="s-resize">
-        <keyword-value>s-resize</keyword-value>
-    </keyword-def>
-    <keyword-def name="sans-serif">
-        <keyword-value>sans-serif</keyword-value>
-    </keyword-def>
-    <keyword-def name="scroll">
-        <keyword-value>scroll</keyword-value>
-    </keyword-def>
-    <keyword-def name="Scrollbar">
-        <keyword-value>Scrollbar</keyword-value>
-    </keyword-def>
-    <keyword-def name="se-resize">
-        <keyword-value>se-resize</keyword-value>
-    </keyword-def>
-    <keyword-def name="semi-condensed">
-        <keyword-value>semi-condensed</keyword-value>
-    </keyword-def>
-    <keyword-def name="semi-expanded">
-        <keyword-value>semi-expanded</keyword-value>
-    </keyword-def>
-    <keyword-def name="separate">
-        <keyword-value>separate</keyword-value>
-    </keyword-def>
-    <keyword-def name="serif">
-        <keyword-value>serif</keyword-value>
-    </keyword-def>
-    <keyword-def name="show">
-        <keyword-value>show</keyword-value>
-    </keyword-def>
-    <keyword-def name="silent">
-        <keyword-value>silent</keyword-value>
-    </keyword-def>
-    <keyword-def name="silver">
-        <keyword-value>silver</keyword-value>
-    </keyword-def>
-    <keyword-def name="slow">
-        <keyword-value>slow</keyword-value>
-    </keyword-def>
-    <keyword-def name="slower">
-        <keyword-value>slower</keyword-value>
-    </keyword-def>
-    <keyword-def name="small">
-        <keyword-value>small</keyword-value>
-    </keyword-def>
-    <keyword-def name="small-caps">
-        <keyword-value>small-caps</keyword-value>
-    </keyword-def>
-    <keyword-def name="small-caption">
-        <keyword-value>small-caption</keyword-value>
-    </keyword-def>
-    <keyword-def name="smaller">
-        <keyword-value>smaller</keyword-value>
-    </keyword-def>
-    <keyword-def name="soft">
-        <keyword-value>soft</keyword-value>
-    </keyword-def>
-    <keyword-def name="solid">
-        <keyword-value>solid</keyword-value>
-    </keyword-def>
-    <keyword-def name="spell-out">
-        <keyword-value>spell-out</keyword-value>
-    </keyword-def>
-    <keyword-def name="square">
-        <keyword-value>square</keyword-value>
-    </keyword-def>
-    <keyword-def name="static">
-        <keyword-value>static</keyword-value>
-    </keyword-def>
-    <keyword-def name="status-bar">
-        <keyword-value>status-bar</keyword-value>
-    </keyword-def>
-    <keyword-def name="sub">
-        <keyword-value>sub</keyword-value>
-    </keyword-def>
-    <keyword-def name="super">
-        <keyword-value>super</keyword-value>
-    </keyword-def>
-    <keyword-def name="sw-resize">
-        <keyword-value>sw-resize</keyword-value>
-    </keyword-def>
-    <keyword-def name="table">
-        <keyword-value>table</keyword-value>
-    </keyword-def>
-    <keyword-def name="table-caption">
-        <keyword-value>table-caption</keyword-value>
-    </keyword-def>
-    <keyword-def name="table-cell">
-        <keyword-value>table-cell</keyword-value>
-    </keyword-def>
-    <keyword-def name="table-column">
-        <keyword-value>table-column</keyword-value>
-    </keyword-def>
-    <keyword-def name="table-column-group">
-        <keyword-value>table-column-group</keyword-value>
-    </keyword-def>
-    <keyword-def name="table-footer-group">
-        <keyword-value>table-footer-group</keyword-value>
-    </keyword-def>
-    <keyword-def name="table-header-group">
-        <keyword-value>table-header-group</keyword-value>
-    </keyword-def>
-    <keyword-def name="table-row">
-        <keyword-value>table-row</keyword-value>
-    </keyword-def>
-    <keyword-def name="table-row-group">
-        <keyword-value>table-row-group</keyword-value>
-    </keyword-def>
-    <keyword-def name="teal">
-        <keyword-value>teal</keyword-value>
-    </keyword-def>
-    <keyword-def name="text">
-        <keyword-value>text</keyword-value>
-    </keyword-def>
-    <keyword-def name="text-top">
-        <keyword-value>text-top</keyword-value>
-    </keyword-def>
-    <keyword-def name="text-bottom">
-        <keyword-value>text-bottom</keyword-value>
-    </keyword-def>
-    <keyword-def name="thick">
-        <keyword-value>thick</keyword-value>
-    </keyword-def>
-    <keyword-def name="thin">
-        <keyword-value>thin</keyword-value>
-    </keyword-def>
-    <keyword-def name="ThreeDDarkShadow">
-        <keyword-value>ThreeDDarkShadow</keyword-value>
-    </keyword-def>
-    <keyword-def name="ThreeDFace">
-        <keyword-value>ThreeDFace</keyword-value>
-    </keyword-def>
-    <keyword-def name="ThreeDHighlight">
-        <keyword-value>ThreeDHighlight</keyword-value>
-    </keyword-def>
-    <keyword-def name="ThreeDLightShadow">
-        <keyword-value>ThreeDLightShadow</keyword-value>
-    </keyword-def>
-    <keyword-def name="ThreeDShadow">
-        <keyword-value>ThreeDShadow</keyword-value>
-    </keyword-def>
-    <keyword-def name="top">
-        <keyword-value>top</keyword-value>
-    </keyword-def>
-    <keyword-def name="transparent">
-        <keyword-value>transparent</keyword-value>
-    </keyword-def>
-    <keyword-def name="ultra-condensed">
-        <keyword-value>ultra-condensed</keyword-value>
-    </keyword-def>
-    <keyword-def name="ultra-expanded">
-        <keyword-value>ultra-expanded</keyword-value>
-    </keyword-def>
-    <keyword-def name="underline">
-        <keyword-value>underline</keyword-value>
-    </keyword-def>
-    <keyword-def name="upper-alpha">
-        <keyword-value>upper-alpha</keyword-value>
-    </keyword-def>
-    <keyword-def name="upper-latin">
-        <keyword-value>upper-latin</keyword-value>
-    </keyword-def>
-    <keyword-def name="upper-roman">
-        <keyword-value>upper-roman</keyword-value>
-    </keyword-def>
-    <keyword-def name="uppercase">
-        <keyword-value>uppercase</keyword-value>
-    </keyword-def>
-    <keyword-def name="visible">
-        <keyword-value>visible</keyword-value>
-    </keyword-def>
-    <keyword-def name="w-resize">
-        <keyword-value>w-resize</keyword-value>
-    </keyword-def>
-    <keyword-def name="wait">
-        <keyword-value>wait</keyword-value>
-    </keyword-def>
-    <keyword-def name="white">
-        <keyword-value>white</keyword-value>
-    </keyword-def>
-    <keyword-def name="wider">
-        <keyword-value>wider</keyword-value>
-    </keyword-def>
-    <keyword-def name="Window">
-        <keyword-value>Window</keyword-value>
-    </keyword-def>
-    <keyword-def name="WindowFrame">
-        <keyword-value>WindowFrame</keyword-value>
-    </keyword-def>
-    <keyword-def name="WindowText">
-        <keyword-value>WindowText</keyword-value>
-    </keyword-def>
-    <keyword-def name="x-fast">
-        <keyword-value>x-fast</keyword-value>
-    </keyword-def>
-    <keyword-def name="x-high">
-        <keyword-value>x-high</keyword-value>
-    </keyword-def>
-    <keyword-def name="x-large">
-        <keyword-value>x-large</keyword-value>
-    </keyword-def>
-    <keyword-def name="x-loud">
-        <keyword-value>x-loud</keyword-value>
-    </keyword-def>
-    <keyword-def name="x-low">
-        <keyword-value>x-low</keyword-value>
-    </keyword-def>
-    <keyword-def name="x-slow">
-        <keyword-value>x-slow</keyword-value>
-    </keyword-def>
-    <keyword-def name="x-small">
-        <keyword-value>x-small</keyword-value>
-    </keyword-def>
-    <keyword-def name="x-soft">
-        <keyword-value>x-soft</keyword-value>
-    </keyword-def>
-    <keyword-def name="xx-small">
-        <keyword-value>xx-small</keyword-value>
-    </keyword-def>
-    <keyword-def name="xx-large">
-        <keyword-value>xx-large</keyword-value>
-    </keyword-def>
-    <keyword-def name="yellow">
-        <keyword-value>yellow</keyword-value>
-    </keyword-def>
-</css-profile>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-mobile1_0.xml b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-mobile1_0.xml
deleted file mode 100644
index 73b6c12..0000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-mobile1_0.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--<!DOCTYPE css-profile SYSTEM "css-profile.dtd" >-->
-<css-profile>
-	<profile-import name="cssprofile-css2.xml"/>
-	<stylesheet-def>
-		<description>%mobile1_0.stylesheet-def.description</description>
-		<charset-rule/>
-		<import-rule/>
-		<media-rule/>
-		<style-rule/>
-	</stylesheet-def>
-
-	<!-- Which properties can style rule include ? -->
-	<!-- using "overwrite" method: only disabled properties are written. -->
-
-	<style-rule-def overwrite="true">
-		<selector-expression name="child" enabled="false"/>
-		<selector-expression name="adjacent" enabled="false"/>
-		<selector-expression name="attribute" enabled="false"/>
-		<pseudo-class name="first-child" enabled="false"/>
-		<pseudo-class name="link" enabled="false"/>
-		<pseudo-class name="active" enabled="false"/>
-		<pseudo-class name="lang" enabled="false"/>
-		<property name="azimuth" enabled="false"/>
-		<property name="border-collapse" enabled="false"/>
-		<property name="border-spacing" enabled="false"/>
-		<property name="bottom" enabled="false"/>
-		<property name="caption-side" enabled="false"/>
-		<property name="clip" enabled="false"/>
-		<property name="content" enabled="false"/>
-		<property name="counter-increment" enabled="false"/>
-		<property name="counter-reset" enabled="false"/>
-		<property name="cue" enabled="false"/>
-		<property name="cue-after" enabled="false"/>
-		<property name="cue-before" enabled="false"/>
-		<property name="cursor" enabled="false"/>
-		<property name="direction" enabled="false"/>
-		<property name="elevation" enabled="false"/>
-		<property name="empty-cells" enabled="false"/>
-		<property name="font-size-adjust" enabled="false"/>
-		<property name="font-stretch" enabled="false"/>
-		<property name="left" enabled="false"/>
-		<property name="letter-spacing" enabled="false"/>
-		<property name="line-height" enabled="false"/>
-		<property name="marker-offset" enabled="false"/>
-		<property name="marks" enabled="false"/>
-		<property name="max-height" enabled="false"/>
-		<property name="max-width" enabled="false"/>
-		<property name="min-height" enabled="false"/>
-		<property name="min-width" enabled="false"/>
-		<property name="orphans" enabled="false"/>
-		<property name="outline" enabled="false"/>
-		<property name="outline-color" enabled="false"/>
-		<property name="outline-style" enabled="false"/>
-		<property name="outline-width" enabled="false"/>
-		<property name="overflow" enabled="false"/>
-		<property name="page" enabled="false"/>
-		<property name="page-break-after" enabled="false"/>
-		<property name="page-break-before" enabled="false"/>
-		<property name="page-break-inside" enabled="false"/>
-		<property name="pause" enabled="false"/>
-		<property name="pause-after" enabled="false"/>
-		<property name="pause-before" enabled="false"/>
-		<property name="pitch" enabled="false"/>
-		<property name="pitch-range" enabled="false"/>
-		<property name="play-during" enabled="false"/>
-		<property name="position" enabled="false"/>
-		<property name="quotes" enabled="false"/>
-		<property name="richness" enabled="false"/>
-		<property name="right" enabled="false"/>
-		<property name="size" enabled="false"/>
-		<property name="speak" enabled="false"/>
-		<property name="speak-header" enabled="false"/>
-		<property name="speak-numeral" enabled="false"/>
-		<property name="speak-punctuation" enabled="false"/>
-		<property name="speech-rate" enabled="false"/>
-		<property name="stress" enabled="false"/>
-		<property name="table-layout" enabled="false"/>
-		<property name="text-shadow" enabled="false"/>
-		<property name="top" enabled="false"/>
-		<property name="unicode-bidi" enabled="false"/>
-		<property name="voice-family" enabled="false"/>
-		<property name="volume" enabled="false"/>
-		<property name="widows" enabled="false"/>
-		<property name="word-spacing" enabled="false"/>
-		<property name="z-index" enabled="false"/>
-	</style-rule-def>
-
-	<!-- property definition -->
-	<!-- using "redifine" method: if "overwrite" attribute is set to
-	"false"	or not set, it means the node is cleanly redifined -->
-
-    <property-def name="background-attachment"
-		inherited="no" mediagroup="visual" category="colorandbackground">
-        <keyword name="scroll"/>
-        <keyword name="inherit"/>
-    </property-def>
-	<property-def name="display"
-		inherited="no" mediagroup="all" category="visual">
-		<keyword name="inline"/>
-		<keyword name="block"/>
-		<keyword name="list-item"/>
-		<keyword name="none"/>
-	</property-def>
-	<property-def name="list-style-type"
-		inherited="yes" mediagroup="visual" category="content">
-		<keyword name="disc"/>
-		<keyword name="circle"/>
-		<keyword name="square"/>
-		<keyword name="decimal"/>
-		<keyword name="lower-roman"/>
-		<keyword name="upper-roman"/>
-		<keyword name="lower-greek"/>
-		<keyword name="lower-alpha"/>
-		<keyword name="upper-alpha"/>
-		<keyword name="none"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="text-align"
-		inherited="yes" mediagroup="visual" category="text">
-		<keyword name="left"/>
-		<keyword name="right"/>
-		<keyword name="center"/>
-		<keyword name="justify"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="text-decoration"
-		inherited="no" mediagroup="visual" category="text">
-		<keyword name="none"/>
-		<keyword name="underline"/>
-		<keyword name="inherit"/>
-	</property-def>
-	<property-def name="vertical-align"
-		inherited="no" mediagroup="visual" category="visual">
-		<keyword name="baseline"/>
-		<keyword name="sub"/>
-		<keyword name="super"/>
-		<keyword name="inherit"/>
-	</property-def>
-
-	<!-- container definition : Container is the lump of values.
-	It can be used like macros. -->
-	<container-def name="color" overwrite="true">
-		<container name="system-color" enabled="false"/>
-	</container-def>
-</css-profile>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-wap.xml b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-wap.xml
deleted file mode 100644
index 241bca3..0000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-wap.xml
+++ /dev/null
@@ -1,618 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--<!DOCTYPE css-profile SYSTEM "css-profile.dtd" >-->
-<css-profile>
-        <profile-import name="cssprofile-css2.xml"/>
-        <stylesheet-def>
-                <description>%wap.stylesheet-def.description</description>
-                <charset-rule/>
-                <import-rule/>
-                <media-rule/>
-                <style-rule/>
-        </stylesheet-def>
-
-        <!-- Which properties can style rule include ? -->
-        <!-- using "overwrite" method: only disabled properties are written. -->
-
-        <style-rule-def overwrite="true">
-                <property name="azimuth" enabled="false"/>
-                <property name="border-collapse" enabled="false"/>
-                <property name="border-spacing" enabled="false"/>
-                <property name="bottom" enabled="false"/>
-                <property name="caption-side" enabled="false"/>
-                <property name="clip" enabled="false"/>
-                <property name="content" enabled="false"/>
-                <property name="cue" enabled="false"/>
-                <property name="cue-after" enabled="false"/>
-                <property name="cue-before" enabled="false"/>
-                <property name="cursor" enabled="false"/>
-                <property name="direction" enabled="false"/>
-                <property name="elevation" enabled="false"/>
-                <property name="empty-cells" enabled="false"/>
-                <property name="font-size-adjust" enabled="false"/>
-                <property name="font-stretch" enabled="false"/>
-                <property name="left" enabled="false"/>
-                <property name="letter-spacing" enabled="false"/>
-                <property name="line-height" enabled="false"/>
-                <property name="marker-offset" enabled="false"/>
-                <property name="marks" enabled="false"/>
-                <property name="max-height" enabled="false"/>
-                <property name="max-width" enabled="false"/>
-                <property name="min-height" enabled="false"/>
-                <property name="min-width" enabled="false"/>
-                <property name="orphans" enabled="false"/>
-                <property name="outline" enabled="false"/>
-                <property name="outline-color" enabled="false"/>
-                <property name="outline-style" enabled="false"/>
-                <property name="outline-width" enabled="false"/>
-                <property name="overflow" enabled="false"/>
-                <property name="page" enabled="false"/>
-                <property name="page-break-after" enabled="false"/>
-                <property name="page-break-before" enabled="false"/>
-                <property name="page-break-inside" enabled="false"/>
-                <property name="pause" enabled="false"/>
-                <property name="pause-after" enabled="false"/>
-                <property name="pause-before" enabled="false"/>
-                <property name="pitch" enabled="false"/>
-                <property name="pitch-range" enabled="false"/>
-                <property name="play-during" enabled="false"/>
-                <property name="position" enabled="false"/>
-                <property name="quotes" enabled="false"/>
-                <property name="richness" enabled="false"/>
-                <property name="right" enabled="false"/>
-                <property name="size" enabled="false"/>
-                <property name="speak" enabled="false"/>
-                <property name="speak-header" enabled="false"/>
-                <property name="speak-numeral" enabled="false"/>
-                <property name="speak-punctuation" enabled="false"/>
-                <property name="speech-rate" enabled="false"/>
-                <property name="stress" enabled="false"/>
-                <property name="table-layout" enabled="false"/>
-                <property name="text-shadow" enabled="false"/>
-                <property name="top" enabled="false"/>
-                <property name="unicode-bidi" enabled="false"/>
-                <property name="voice-family" enabled="false"/>
-                <property name="volume" enabled="false"/>
-                <property name="widows" enabled="false"/>
-                <property name="word-spacing" enabled="false"/>
-                <property name="z-index" enabled="false"/>
-                <property name="-wap-marquee-style"/>
-                <property name="-wap-marquee-loop"/>
-                <property name="-wap-marquee-dir"/>
-                <property name="-wap-marquee-speed"/>
-                <property name="-wap-accesskey"/>
-                <property name="-wap-input-format"/>
-                <property name="-wap-input-required"/>
-        </style-rule-def>
-
-        <!-- property definition -->
-        <!-- using "redifine" method: if "overwrite" attribute is set to
-        "false" or not set, it means the node is cleanly redifined -->
-
-        <property-def name="display"
-                inherited="no" mediagroup="all" category="visual">
-                <keyword name="inline"/>
-                <keyword name="block"/>
-                <keyword name="list-item"/>
-                <keyword name="-wap-marquee"/>
-                <keyword name="none"/>
-        </property-def>
-        <property-def name="list-style-type"
-                inherited="yes" mediagroup="visual" category="content">
-                <keyword name="disc"/>
-                <keyword name="circle"/>
-                <keyword name="square"/>
-                <keyword name="decimal"/>
-                <keyword name="lower-roman"/>
-                <keyword name="upper-roman"/>
-                <keyword name="lower-alpha"/>
-                <keyword name="upper-alpha"/>
-                <keyword name="none"/>
-                <keyword name="inherit"/>
-        </property-def>
-        <property-def name="text-align"
-                inherited="yes" mediagroup="visual" category="text">
-                <keyword name="left"/>
-                <keyword name="right"/>
-                <keyword name="center"/>
-                <keyword name="justify"/>
-                <keyword name="inherit"/>
-        </property-def>
-        <property-def name="text-decoration"
-                inherited="no" mediagroup="visual" category="text">
-                <keyword name="none"/>
-                <keyword name="underline"/>
-                <keyword name="blink"/>
-                <keyword name="inherit"/>
-        </property-def>
-        <property-def name="vertical-align"
-                inherited="no" mediagroup="visual" category="visual">
-                <keyword name="baseline"/>
-                <keyword name="sub"/>
-                <keyword name="super"/>
-                <keyword name="top"/>
-                <keyword name="middle"/>
-                <keyword name="bottom"/>
-                <keyword name="inherit"/>
-        </property-def>
-    <property-def name="-wap-marquee-style"
-                inherited="no" mediagroup="visual" category="wap">
-                <keyword name="scroll"/>
-                <keyword name="slide"/>
-                <keyword name="alternate"/>
-                <keyword name="inherit"/>
-        </property-def>
-    <property-def name="-wap-marquee-loop"
-                inherited="no" mediagroup="visual" category="wap">
-                <number name="integer"/>
-                <keyword name="infinite"/>
-                <keyword name="inherit"/>
-        </property-def>
-    <property-def name="-wap-marquee-dir"
-                inherited="no" mediagroup="visual" category="wap">
-                <keyword name="ltr"/>
-                <keyword name="rtl"/>
-                <keyword name="inherit"/>
-        </property-def>
-    <property-def name="-wap-marquee-speed"
-                inherited="no" mediagroup="visual" category="wap">
-                <keyword name="slow"/>
-                <keyword name="normal"/>
-                <keyword name="fast"/>
-                <keyword name="inherit"/>
-        </property-def>
-    <property-def name="-wap-accesskey"
-                inherited="no" mediagroup="interactive" category="wap">
-                <container name="keycombination"/>
-                <keyword name="inherit"/>
-        </property-def>
-    <property-def name="-wap-input-format"
-                inherited="no" mediagroup="interactive" category="wap">
-                <container name="format"/>
-                <keyword name="inherit"/>
-        </property-def>
-    <property-def name="-wap-input-required"
-                inherited="no" mediagroup="interactive" category="wap">
-                <keyword name="true"/>
-                <keyword name="false"/>
-                <keyword name="inherit"/>
-        </property-def>
-
-        <!-- container definition : Container is the lump of values.
-        It can be used like macros. -->
-        <container-def name="color" overwrite="true">
-                <container name="system-color" enabled="false"/>
-        </container-def>
-        <container-def name="format">
-                <string name="any"/>
-        </container-def>
-        <container-def name="keycombination">
-                <container name="key"/>
-                <keyword name="-"/>
-        </container-def>
-        <container-def name="key">
-                <keyword name="space"/>
-                <container name="specialkey"/>
-        </container-def>
-        <container-def name="specialkey">
-                <container name="modifierkey"/>
-                <container name="functionkey"/>
-                <container name="navigationkey"/>
-                <container name="editkey"/>
-                <container name="misckey"/>
-                <container name="volumecontrolkey"/>
-                <container name="applicationkey"/>
-                <container name="phonekey"/>
-                <container name="vendorkey"/>
-        </container-def>
-        <container-def name="modifierkey">
-                <keyword name="accesskey"/>
-                <container name="cmdkey"/>
-                <container name="optkey"/>
-                <container name="ctrlkey"/>
-                <container name="shiftkey"/>
-                <container name="altkey"/>
-                <container name="winkey"/>
-                <container name="metakey"/>
-                <keyword name="fn"/>
-                <keyword name="fcn"/>
-                <keyword name="caps"/>
-        </container-def>
-        <container-def name="cmdkey">
-                <keyword name="cmd"/>
-                <keyword name="rcmd"/>
-                <keyword name="lcmd"/>
-        </container-def>
-        <container-def name="optkey">
-                <keyword name="opt"/>
-                <keyword name="ropt"/>
-                <keyword name="lopt"/>
-        </container-def>
-        <container-def name="ctrlkey">
-                <keyword name="ctrl"/>
-                <keyword name="rctrl"/>
-                <keyword name="lctrl"/>
-        </container-def>
-        <container-def name="shiftkey">
-                <keyword name="shift"/>
-                <keyword name="rshift"/>
-                <keyword name="lshift"/>
-        </container-def>
-        <container-def name="altkey">
-                <keyword name="alt"/>
-                <keyword name="ralt"/>
-                <keyword name="lalt"/>
-        </container-def>
-        <container-def name="winkey">
-                <keyword name="win"/>
-                <keyword name="rwin"/>
-                <keyword name="lwin"/>
-        </container-def>
-        <container-def name="metakey">
-                <keyword name="meta"/>
-                <keyword name="rmeta"/>
-                <keyword name="lmeta"/>
-        </container-def>
-        <container-def name="functionkey">
-                <keyword name="f1"/>
-                <keyword name="f2"/>
-                <keyword name="f3"/>
-                <keyword name="f4"/>
-                <keyword name="f5"/>
-                <keyword name="f6"/>
-                <keyword name="f7"/>
-                <keyword name="f8"/>
-                <keyword name="f9"/>
-                <keyword name="f10"/>
-                <keyword name="f11"/>
-                <keyword name="f12"/>
-                <keyword name="f13"/>
-                <keyword name="f14"/>
-                <keyword name="f15"/>
-        </container-def>
-        <container-def name="navigationkey">
-                <keyword name="tab"/>
-                <keyword name="esc"/>
-                <keyword name="enter"/>
-                <keyword name="return"/>
-                <keyword name="menu"/>
-                <keyword name="help"/>
-                <keyword name="namemenu"/>
-                <keyword name="rcl"/>
-                <keyword name="snd"/>
-                <keyword name="arrowkey"/>
-                <keyword name="pagekey"/>
-        </container-def>
-        <container-def name="arrowkey">
-                <keyword name="up"/>
-                <keyword name="down"/>
-                <keyword name="left"/>
-                <keyword name="right"/>
-        </container-def>
-        <container-def name="pagekey">
-                <keyword name="home"/>
-                <keyword name="end"/>
-                <keyword name="pgup"/>
-                <keyword name="pgdn"/>
-        </container-def>
-        <container-def name="editkey">
-                <keyword name="bs"/>
-                <keyword name="del"/>
-                <keyword name="ins"/>
-                <keyword name="undo"/>
-                <keyword name="cut"/>
-                <keyword name="copy"/>
-                <keyword name="paste"/>
-                <keyword name="clr"/>
-                <keyword name="sto"/>
-        </container-def>
-        <container-def name="misckey">
-                <keyword name="prtsc"/>
-                <keyword name="sysrq"/>
-                <keyword name="scrlock"/>
-                <keyword name="pause"/>
-                <keyword name="brk"/>
-                <keyword name="numlock"/>
-                <keyword name="pwr"/>
-        </container-def>
-        <container-def name="volumecontrolkey">
-                <keyword name="volumeup"/>
-                <keyword name="volumedown"/>
-        </container-def>
-        <container-def name="applicationkey">
-                <keyword name="memo"/>
-                <keyword name="todo"/>
-                <keyword name="calendar"/>
-                <keyword name="mail"/>
-                <keyword name="address"/>
-        </container-def>
-        <container-def name="phonekey">
-                <keyword name="phone-send"/>
-                <keyword name="phone-end"/>
-                <keyword name="phone-accept"/>
-        </container-def>
-        <container-def name="vendorkey">
-                <keyword name="vnd."/>
-        </container-def>
-
-        <category-def name="wap">
-                <caption>%wap.category-def.wap.caption</caption>
-        </category-def>
-
-        <number-def name="length">
-        <unit name="em"/>
-        <unit name="ex"/>
-        <unit name="px"/>
-        </number-def>
-
-    <keyword-def name="-wap-marquee">
-        <keyword-value>-wap-marquee</keyword-value>
-    </keyword-def>
-        <keyword-def name="slide">
-                <keyword-value>slide</keyword-value>
-        </keyword-def>
-        <keyword-def name="alternate">
-                <keyword-value>alternate</keyword-value>
-        </keyword-def>
-        <keyword-def name="infinite">
-                <keyword-value>infinite</keyword-value>
-        </keyword-def>
-        <keyword-def name="-">
-                <keyword-value>-</keyword-value>
-        </keyword-def>
-        <keyword-def name="space">
-                <keyword-value>space</keyword-value>
-        </keyword-def>
-        <keyword-def name="accesskey">
-                <keyword-value>accesskey</keyword-value>
-        </keyword-def>
-        <keyword-def name="fn">
-                <keyword-value>fn</keyword-value>
-        </keyword-def>
-        <keyword-def name="fcn">
-                <keyword-value>fcn</keyword-value>
-        </keyword-def>
-        <keyword-def name="caps">
-                <keyword-value>caps</keyword-value>
-        </keyword-def>
-        <keyword-def name="cmd">
-                <keyword-value>cmd</keyword-value>
-        </keyword-def>
-        <keyword-def name="rcmd">
-                <keyword-value>rcmd</keyword-value>
-        </keyword-def>
-        <keyword-def name="lcmd">
-                <keyword-value>lcmd</keyword-value>
-        </keyword-def>
-        <keyword-def name="opt">
-                <keyword-value>opt</keyword-value>
-        </keyword-def>
-        <keyword-def name="ropt">
-                <keyword-value>ropt</keyword-value>
-        </keyword-def>
-        <keyword-def name="lopt">
-                <keyword-value>lopt</keyword-value>
-        </keyword-def>
-        <keyword-def name="ctrl">
-                <keyword-value>ctrl</keyword-value>
-        </keyword-def>
-        <keyword-def name="rctrl">
-                <keyword-value>rctrl</keyword-value>
-        </keyword-def>
-        <keyword-def name="lctrl">
-                <keyword-value>lctrl</keyword-value>
-        </keyword-def>
-        <keyword-def name="shift">
-                <keyword-value>shift</keyword-value>
-        </keyword-def>
-        <keyword-def name="rshift">
-                <keyword-value>rshift</keyword-value>
-        </keyword-def>
-        <keyword-def name="lshift">
-                <keyword-value>lshift</keyword-value>
-        </keyword-def>
-        <keyword-def name="alt">
-                <keyword-value>alt</keyword-value>
-        </keyword-def>
-        <keyword-def name="ralt">
-                <keyword-value>ralt</keyword-value>
-        </keyword-def>
-        <keyword-def name="lalt">
-                <keyword-value>lalt</keyword-value>
-        </keyword-def>
-        <keyword-def name="win">
-                <keyword-value>win</keyword-value>
-        </keyword-def>
-        <keyword-def name="rwin">
-                <keyword-value>rwin</keyword-value>
-        </keyword-def>
-        <keyword-def name="lwin">
-                <keyword-value>lwin</keyword-value>
-        </keyword-def>
-        <keyword-def name="meta">
-                <keyword-value>meta</keyword-value>
-        </keyword-def>
-        <keyword-def name="rmeta">
-                <keyword-value>rmeta</keyword-value>
-        </keyword-def>
-        <keyword-def name="lmeta">
-                <keyword-value>lmeta</keyword-value>
-        </keyword-def>
-        <keyword-def name="f1">
-                <keyword-value>f1</keyword-value>
-        </keyword-def>
-        <keyword-def name="f2">
-                <keyword-value>f2</keyword-value>
-        </keyword-def>
-        <keyword-def name="f3">
-                <keyword-value>f3</keyword-value>
-        </keyword-def>
-        <keyword-def name="f4">
-                <keyword-value>f4</keyword-value>
-        </keyword-def>
-        <keyword-def name="f5">
-                <keyword-value>f5</keyword-value>
-        </keyword-def>
-        <keyword-def name="f6">
-                <keyword-value>f6</keyword-value>
-        </keyword-def>
-        <keyword-def name="f7">
-                <keyword-value>f7</keyword-value>
-        </keyword-def>
-        <keyword-def name="f8">
-                <keyword-value>f8</keyword-value>
-        </keyword-def>
-        <keyword-def name="f9">
-                <keyword-value>f9</keyword-value>
-        </keyword-def>
-        <keyword-def name="f10">
-                <keyword-value>f10</keyword-value>
-        </keyword-def>
-        <keyword-def name="f11">
-                <keyword-value>f11</keyword-value>
-        </keyword-def>
-        <keyword-def name="f12">
-                <keyword-value>f12</keyword-value>
-        </keyword-def>
-        <keyword-def name="f13">
-                <keyword-value>f13</keyword-value>
-        </keyword-def>
-        <keyword-def name="f14">
-                <keyword-value>f14</keyword-value>
-        </keyword-def>
-        <keyword-def name="f15">
-                <keyword-value>f15</keyword-value>
-        </keyword-def>
-        <keyword-def name="tab">
-                <keyword-value>tab</keyword-value>
-        </keyword-def>
-        <keyword-def name="esc">
-                <keyword-value>esc</keyword-value>
-        </keyword-def>
-        <keyword-def name="enter">
-                <keyword-value>enter</keyword-value>
-        </keyword-def>
-        <keyword-def name="return">
-                <keyword-value>return</keyword-value>
-        </keyword-def>
-        <keyword-def name="namemenu">
-                <keyword-value>namemenu</keyword-value>
-        </keyword-def>
-        <keyword-def name="rcl">
-                <keyword-value>rcl</keyword-value>
-        </keyword-def>
-        <keyword-def name="snd">
-                <keyword-value>snd</keyword-value>
-        </keyword-def>
-        <keyword-def name="arrowkey">
-                <keyword-value>arrowkey</keyword-value>
-        </keyword-def>
-        <keyword-def name="pagekey">
-                <keyword-value>pagekey</keyword-value>
-        </keyword-def>
-        <keyword-def name="up">
-                <keyword-value>up</keyword-value>
-        </keyword-def>
-        <keyword-def name="down">
-                <keyword-value>down</keyword-value>
-        </keyword-def>
-        <keyword-def name="home">
-                <keyword-value>home</keyword-value>
-        </keyword-def>
-        <keyword-def name="end">
-                <keyword-value>end</keyword-value>
-        </keyword-def>
-        <keyword-def name="pgup">
-                <keyword-value>pgup</keyword-value>
-        </keyword-def>
-        <keyword-def name="pgdn">
-                <keyword-value>pgdn</keyword-value>
-        </keyword-def>
-        <keyword-def name="bs">
-                <keyword-value>bs</keyword-value>
-        </keyword-def>
-        <keyword-def name="del">
-                <keyword-value>del</keyword-value>
-        </keyword-def>
-        <keyword-def name="ins">
-                <keyword-value>ins</keyword-value>
-        </keyword-def>
-        <keyword-def name="undo">
-                <keyword-value>undo</keyword-value>
-        </keyword-def>
-        <keyword-def name="cut">
-                <keyword-value>cut</keyword-value>
-        </keyword-def>
-        <keyword-def name="copy">
-                <keyword-value>copy</keyword-value>
-        </keyword-def>
-        <keyword-def name="paste">
-                <keyword-value>paste</keyword-value>
-        </keyword-def>
-        <keyword-def name="clr">
-                <keyword-value>clr</keyword-value>
-        </keyword-def>
-        <keyword-def name="sto">
-                <keyword-value>sto</keyword-value>
-        </keyword-def>
-        <keyword-def name="prtsc">
-                <keyword-value>prtsc</keyword-value>
-        </keyword-def>
-        <keyword-def name="sysrq">
-                <keyword-value>sysrq</keyword-value>
-        </keyword-def>
-        <keyword-def name="scrlock">
-                <keyword-value>scrlock</keyword-value>
-        </keyword-def>
-        <keyword-def name="brk">
-                <keyword-value>brk</keyword-value>
-        </keyword-def>
-        <keyword-def name="numlock">
-                <keyword-value>numlock</keyword-value>
-        </keyword-def>
-        <keyword-def name="pwr">
-                <keyword-value>pwr</keyword-value>
-        </keyword-def>
-        <keyword-def name="volumeup">
-                <keyword-value>volumeup</keyword-value>
-        </keyword-def>
-        <keyword-def name="volumedown">
-                <keyword-value>volumedown</keyword-value>
-        </keyword-def>
-        <keyword-def name="memo">
-                <keyword-value>memo</keyword-value>
-        </keyword-def>
-        <keyword-def name="todo">
-                <keyword-value>todo</keyword-value>
-        </keyword-def>
-        <keyword-def name="calendar">
-                <keyword-value>calendar</keyword-value>
-        </keyword-def>
-        <keyword-def name="mail">
-                <keyword-value>mail</keyword-value>
-        </keyword-def>
-        <keyword-def name="address">
-                <keyword-value>address</keyword-value>
-        </keyword-def>
-        <keyword-def name="phone-send">
-                <keyword-value>phone-send</keyword-value>
-        </keyword-def>
-        <keyword-def name="phone-end">
-                <keyword-value>phone-end</keyword-value>
-        </keyword-def>
-        <keyword-def name="phone-accept">
-                <keyword-value>phone-accept</keyword-value>
-        </keyword-def>
-        <keyword-def name="vnd.">
-                <keyword-value>vnd.</keyword-value>
-        </keyword-def>
-        <keyword-def name="true">
-                <keyword-value>true</keyword-value>
-        </keyword-def>
-        <keyword-def name="false">
-                <keyword-value>false</keyword-value>
-        </keyword-def>
-        <keyword-def name="pause">
-                <keyword-value>pause</keyword-value>
-        </keyword-def>
-
-</css-profile>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile.properties b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile.properties
deleted file mode 100644
index dd7e399..0000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile.properties
+++ /dev/null
@@ -1,34 +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
-###############################################################################
-# cssprofile-css1.xml
-css1.stylesheet-def.description=Cascading Style Sheets, level 1
-css1.category-def.box.caption=Box model
-css1.category-def.colorandbackground.caption=Colors and Backgrounds
-css1.category-def.classification.caption=Classification
-css1.category-def.font.caption=Font
-css1.category-def.text.caption=Text
-# cssprofile-css2.xml
-css2.stylesheet-def.description=Cascading Style Sheets, level 2
-css2.category-def.aural.caption=Aural
-css2.category-def.box.caption=Box model
-css2.category-def.colorandbackground.caption=Colors and Backgrounds
-css2.category-def.content.caption=Generated content/List
-css2.category-def.font.caption=Fonts
-css2.category-def.page.caption=Paged media
-css2.category-def.tables.caption=Tables
-css2.category-def.text.caption=Text
-css2.category-def.visual.caption=Visual
-css2.category-def.ui.caption=User interface
-# cssprofile-mobile1_0.xml
-mobile1_0.stylesheet-def.description=CSS Mobile Profile 1.0
-# cssprofile-wap.xml
-wap.stylesheet-def.description=WCSS 1.0
-wap.category-def.wap.caption=WCSS Extensions
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/description.txt b/bundles/org.eclipse.wst.css.core/cssprofile/description.txt
deleted file mode 100644
index 3f31f19..0000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/description.txt
+++ /dev/null
@@ -1,15 +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
-
- * None of the files in this directory 
- * need to be translated 
- * except for cssprofile.properties
- *******************************************************************************/
- 
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/plugin.properties b/bundles/org.eclipse.wst.css.core/plugin.properties
deleted file mode 100644
index 97e65bf..0000000
--- a/bundles/org.eclipse.wst.css.core/plugin.properties
+++ /dev/null
@@ -1,19 +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
-###############################################################################
-providerName=Eclipse.org
-pluginName=Structured Source CSS Model
-nlFeatureName=Structured Source CSS Model NL Support
-cssprofile_css2.name=CSS2: Cascading Style Sheets, level 2
-cssprofile_css1.name=CSS1: Cascading Style Sheets, level 1
-cssprofile_mobile1_0.name=CSS Mobile Profile 1.0
-cssprofile_wap.name=WCSS 1.0
-Structured_CSS_Document_Factory_Extension.name=Structured CSS Document Factory Extension
-CSS_Content_Type_Extension_Element.name=CSS
diff --git a/bundles/org.eclipse.wst.css.core/plugin.xml b/bundles/org.eclipse.wst.css.core/plugin.xml
deleted file mode 100644
index 15e9920..0000000
--- a/bundles/org.eclipse.wst.css.core/plugin.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-	<extension point="org.eclipse.wst.sse.core.cssprofile">
-		<profile
-			name="%cssprofile_css2.name"
-			default="true"
-			uri="cssprofile/cssprofile-css2.xml"
-			id="org.eclipse.wst.css.core.cssprofile.css2">
-		</profile>
-		<profile
-			name="%cssprofile_css1.name"
-			uri="cssprofile/cssprofile-css1.xml"
-			id="org.eclipse.wst.css.core.cssprofile.css1">
-		</profile>
-		<profile
-			name="%cssprofile_mobile1_0.name"
-			uri="cssprofile/cssprofile-mobile1_0.xml"
-			id="org.eclipse.wst.css.core.cssprofile.mobile1_0">
-		</profile>
-		<profile
-			name="%cssprofile_wap.name"
-			uri="cssprofile/cssprofile-wap.xml"
-			id="org.eclipse.wst.css.core.cssprofile.wap">
-		</profile>
-	</extension>
-
-	<extension point="org.eclipse.wst.sse.core.modelHandler">
-		<modelHandler
-			class="org.eclipse.wst.css.core.internal.modelhandler.ModelHandlerForCSS"
-			associatedContentTypeId="org.eclipse.wst.css.core.csssource"
-			id="org.eclipse.wst.css.core.internal.modelhandler">
-		</modelHandler>
-	</extension>
-
-	<extension point="org.eclipse.wst.sse.core.taskscanner">
-		<scanner
-			id="org.eclipse.wst.css.core.internal.tasks.CSSFileTaskScanner"
-			class="org.eclipse.wst.css.core.internal.tasks.CSSFileTaskScanner"
-			contentTypeIds="org.eclipse.wst.css.core.csssource" />
-	</extension>
-
-	<extension
-		point="org.eclipse.core.filebuffers.documentCreation"
-		id="org.eclipse.wst.css.core.documentfactories"
-		name="%Structured_CSS_Document_Factory_Extension.name">
-		<factory
-			contentTypeId="org.eclipse.wst.css.core.csssource"
-			class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
-	</extension>
-
-	<extension point="org.eclipse.team.core.fileTypes">
-		<fileTypes
-			type="text"
-			extension="css">
-		</fileTypes>
-	</extension>
-
-	<extension point="org.eclipse.wst.sse.core.formatProcessors">
-		<processor
-			class="org.eclipse.wst.css.core.internal.format.FormatProcessorCSS"
-			contentTypeId="org.eclipse.wst.css.core.csssource">
-		</processor>
-	</extension>
-
-	<extension point="org.eclipse.core.runtime.contentTypes">
-		<content-type
-			file-extensions="css"
-			priority="high"
-			name="%CSS_Content_Type_Extension_Element.name"
-			id="csssource"
-			base-type="org.eclipse.core.runtime.text">
-			<describer
-				class="org.eclipse.wst.css.core.internal.contenttype.ContentDescriberForCSS" />
-		</content-type>
-	</extension>
-
-	<!-- initialize css core preferences -->
-	<extension point="org.eclipse.core.runtime.preferences">
-		<initializer
-			class="org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceInitializer" />
-	</extension>
-	
-</plugin>
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java
deleted file mode 100644
index 9593893..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java
+++ /dev/null
@@ -1,40 +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.css.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by CSS Core
- * 
- * @plannedfor 1.0
- */
-public class CSSCoreMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.css.core.internal.CSSCorePluginResources";//$NON-NLS-1$
-
-	public static String You_cannot_use_CSSStyleShe_UI_;
-	public static String _1concat_ERROR_;
-	public static String _2concat_ERROR_;
-	public static String _3concat_ERROR_;
-	public static String _4concat_ERROR_;
-	public static String _25concat_ERROR_;
-	public static String _26concat_ERROR_;
-	public static String _27concat_ERROR_;
-	public static String _28concat_ERROR_;
-	public static String _5concat_ERROR_;
-	public static String _6concat_ERROR_;
-	public static String _7concat_ERROR_;
-	public static String _8concat_ERROR_;
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, CSSCoreMessages.class);
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java
deleted file mode 100644
index 710b39a..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java
+++ /dev/null
@@ -1,45 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Plugin;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class CSSCorePlugin extends Plugin {
-	// The shared instance.
-	private static CSSCorePlugin plugin;
-
-	/**
-	 * The constructor.
-	 */
-	public CSSCorePlugin() {
-		super();
-		plugin = this;
-	}
-
-	/**
-	 * Returns the shared instance.
-	 */
-	public static CSSCorePlugin getDefault() {
-		return plugin;
-	}
-
-	/**
-	 * Returns the workspace instance.
-	 */
-	public static IWorkspace getWorkspace() {
-		return ResourcesPlugin.getWorkspace();
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties
deleted file mode 100644
index 6e42bd3..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties
+++ /dev/null
@@ -1,23 +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
-###############################################################################
-You_cannot_use_CSSStyleShe_UI_=You cannot use CSSStyleSheet.getOwnerRule() because of many referencers of this rule\nPlease use getOnwerRules()
-_1concat_ERROR_={0}first flat node is null.
-_2concat_ERROR_={0}first flat node is not in model.
-_3concat_ERROR_={0}last flat node is null.
-_4concat_ERROR_={0}last flat node is not in model.
-_25concat_ERROR_={0}first region is null.
-_26concat_ERROR_={0}first region is not in model.
-_27concat_ERROR_={0}last region is null.
-_28concat_ERROR_={0}last region is not in model.
-_5concat_ERROR_={0}first region is null.
-_6concat_ERROR_={0}first region is not in model.
-_7concat_ERROR_={0}last region is null.
-_8concat_ERROR_={0}last region is not in model.
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/Logger.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/Logger.java
deleted file mode 100644
index 78e2fed..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/Logger.java
+++ /dev/null
@@ -1,156 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal;
-
-
-
-import java.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.css.core"; //$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);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategy.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategy.java
deleted file mode 100644
index a248250..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategy.java
+++ /dev/null
@@ -1,98 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.cleanup;
-
-
-
-public interface CSSCleanupStrategy {
-
-	static final short ASIS = 0;
-	static final short LOWER = 1;
-	static final short UPPER = 2;
-
-	/**
-	 * 
-	 * @return short
-	 */
-	short getIdentCase();
-
-	/**
-	 * 
-	 * @return short
-	 */
-	short getPropNameCase();
-
-	/**
-	 * 
-	 * @return short
-	 */
-	short getPropValueCase();
-
-	/**
-	 * 
-	 * @return short
-	 */
-	short getSelectorTagCase();
-
-	/**
-	 * 
-	 * @return boolean
-	 */
-	boolean isFormatSource();
-
-	/**
-	 * 
-	 * @return boolean
-	 */
-	boolean isQuoteValues();
-
-	/**
-	 * 
-	 * @param formatSource
-	 *            boolean
-	 */
-	void setFormatSource(boolean formatSource);
-
-	/**
-	 * 
-	 * @param identCase
-	 *            short
-	 */
-	void setIdentCase(short identCase);
-
-	/**
-	 * 
-	 * @param propNameCase
-	 *            short
-	 */
-	void setPropNameCase(short propNameCase);
-
-	/**
-	 * 
-	 * @param propValueCase
-	 *            short
-	 */
-	void setPropValueCase(short propValueCase);
-
-	/**
-	 * 
-	 * @param quoteValues
-	 *            boolean
-	 */
-	void setQuoteValues(boolean quoteValues);
-
-	/**
-	 * 
-	 * @param selectorTagCase
-	 *            short
-	 */
-	void setSelectorTagCase(short selectorTagCase);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategyImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategyImpl.java
deleted file mode 100644
index 06e3e62..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategyImpl.java
+++ /dev/null
@@ -1,190 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-
-
-
-public class CSSCleanupStrategyImpl implements CSSCleanupStrategy {
-
-	static private CSSCleanupStrategy instance = null;
-	// initialize with defaults
-	protected short fIdentCase = ASIS;
-	protected short fPropNameCase = ASIS;
-	protected short fPropValueCase = ASIS;
-	protected short fSelectorTagCase = UPPER;
-	protected boolean fQuoteValues = true;
-	protected boolean fFormatSource = true;
-
-	/**
-	 * CSSCleanupStrategyImpl constructor comment.
-	 */
-	protected CSSCleanupStrategyImpl() {
-		super();
-		initialize();
-	}
-
-	/**
-	 * 
-	 * @return short
-	 */
-	public short getIdentCase() {
-		return fIdentCase;
-	}
-
-	/**
-	 * 
-	 * @return org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy
-	 */
-	public synchronized static CSSCleanupStrategy getInstance() {
-		if (instance == null)
-			instance = new CSSCleanupStrategyImpl();
-		return instance;
-	}
-
-	/**
-	 * 
-	 * @return short
-	 */
-	public short getPropNameCase() {
-		return fPropNameCase;
-	}
-
-	/**
-	 * 
-	 * @return short
-	 */
-	public short getPropValueCase() {
-		return fPropValueCase;
-	}
-
-	/**
-	 * 
-	 * @return short
-	 */
-	public short getSelectorTagCase() {
-		return fSelectorTagCase;
-	}
-
-	/**
-	 * 
-	 */
-	private void initialize() {
-		Preferences prefs = CSSCorePlugin.getDefault().getPluginPreferences();
-		fIdentCase = getCleanupCaseValue(prefs.getInt(CSSCorePreferenceNames.CLEANUP_CASE_IDENTIFIER));
-		fPropNameCase = getCleanupCaseValue(prefs.getInt(CSSCorePreferenceNames.CLEANUP_CASE_PROPERTY_NAME));
-		fPropValueCase = getCleanupCaseValue(prefs.getInt(CSSCorePreferenceNames.CLEANUP_CASE_PROPERTY_VALUE));
-		fSelectorTagCase = getCleanupCaseValue(prefs.getInt(CSSCorePreferenceNames.CLEANUP_CASE_SELECTOR));
-		fQuoteValues = prefs.getBoolean(CSSCorePreferenceNames.QUOTE_ATTR_VALUES);
-		fFormatSource = prefs.getBoolean(CSSCorePreferenceNames.FORMAT_SOURCE);
-	}
-
-	/**
-	 * Return the CSSCleanupStrategy equivalent case short value when given an
-	 * int
-	 * 
-	 * @param value
-	 * @return equivalent case short or ASIS if cannot be determined
-	 */
-	private short getCleanupCaseValue(int value) {
-		switch (value) {
-			case CSSCorePreferenceNames.LOWER :
-				return LOWER;
-			case CSSCorePreferenceNames.UPPER :
-				return UPPER;
-		}
-		return ASIS;
-	}
-
-	/**
-	 * 
-	 * @return boolean
-	 */
-	public boolean isFormatSource() {
-		return fFormatSource;
-	}
-
-	/**
-	 * 
-	 * @return boolean
-	 */
-	public boolean isQuoteValues() {
-		return fQuoteValues;
-	}
-
-	/**
-	 * 
-	 * @param formatSource
-	 *            boolean
-	 */
-	public void setFormatSource(boolean formatSource) {
-		fFormatSource = formatSource;
-	}
-
-	/**
-	 * 
-	 * @param identCase
-	 *            short
-	 */
-	public void setIdentCase(short identCase) {
-		fIdentCase = identCase;
-	}
-
-	/**
-	 * 
-	 * @param propNameCase
-	 *            short
-	 */
-	public void setPropNameCase(short propNameCase) {
-		fPropNameCase = propNameCase;
-	}
-
-	/**
-	 * 
-	 * @param propValueCase
-	 *            short
-	 */
-	public void setPropValueCase(short propValueCase) {
-		fPropValueCase = propValueCase;
-	}
-
-	/**
-	 * 
-	 * @param quoteValues
-	 *            boolean
-	 */
-	public void setQuoteValues(boolean quoteValues) {
-		fQuoteValues = quoteValues;
-	}
-
-	/**
-	 * 
-	 * @param selectorTagCase
-	 *            short
-	 */
-	public void setSelectorTagCase(short selectorTagCase) {
-		fSelectorTagCase = selectorTagCase;
-	}
-
-	// TODO: a saveOptions should be added to CSSCleanupStrategy interface
-	public void saveOptions() {
-		CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.CLEANUP_CASE_IDENTIFIER, fIdentCase);
-		CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.CLEANUP_CASE_PROPERTY_NAME, fPropNameCase);
-		CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.CLEANUP_CASE_PROPERTY_VALUE, fPropValueCase);
-		CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.CLEANUP_CASE_SELECTOR, fSelectorTagCase);
-		CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.QUOTE_ATTR_VALUES, fQuoteValues);
-		CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.FORMAT_SOURCE, fFormatSource);
-		CSSCorePlugin.getDefault().savePluginPreferences();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CleanupProcessorCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CleanupProcessorCSS.java
deleted file mode 100644
index 844807c..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CleanupProcessorCSS.java
+++ /dev/null
@@ -1,101 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.cleanup;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.css.core.internal.formatter.CSSFormatUtil;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-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.format.IStructuredFormatProcessor;
-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.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Node;
-
-
-public class CleanupProcessorCSS extends AbstractStructuredCleanupProcessor {
-
-	public void cleanupModel(IStructuredModel structuredModel, int start, int length) {
-		CSSFormatUtil formatUtil = CSSFormatUtil.getInstance();
-		if (structuredModel instanceof ICSSModel) {
-			ICSSDocument doc = ((ICSSModel) structuredModel).getDocument();
-			CSSSourceFormatter formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) doc);
-			StringBuffer buf = formatter.cleanup(doc);
-			if (buf != null) {
-				int startOffset = ((IndexedRegion) doc).getStartOffset();
-				int endOffset = ((IndexedRegion) doc).getEndOffset();
-				formatUtil.replaceSource(doc.getModel(), startOffset, endOffset - startOffset, buf.toString());
-			}
-		}
-		else if (structuredModel instanceof IDOMModel) {
-			List cssnodes = formatUtil.collectCSSNodes(structuredModel, start, length);
-			if (cssnodes != null && !cssnodes.isEmpty()) {
-				ICSSModel model = null;
-				for (int i = 0; i < cssnodes.size(); i++) {
-					ICSSNode node = (ICSSNode) cssnodes.get(i);
-					CSSSourceFormatter formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) node);
-					StringBuffer buf = formatter.cleanup(node);
-					if (buf != null) {
-						int startOffset = ((IndexedRegion) node).getStartOffset();
-						int endOffset = ((IndexedRegion) node).getEndOffset();
-						if (model == null) {
-							model = node.getOwnerDocument().getModel();
-						}
-						formatUtil.replaceSource(model, startOffset, endOffset - startOffset, buf.toString());
-					}
-				}
-			}
-		}
-	}
-
-	protected String getContentType() {
-		return ContentTypeIdForCSS.ContentTypeID_CSS;
-	}
-
-	public void cleanupModel(IStructuredModel structuredModel) {
-		int start = 0;
-		int length = structuredModel.getStructuredDocument().getLength();
-
-		cleanupModel(structuredModel, start, length);
-	}
-
-	public void cleanupDocument(IDocument document) throws IOException, CoreException {
-		// TODO should implement, or delete?
-
-	}
-
-	public void cleanupDocument(IDocument document, int start, int length) throws IOException, CoreException {
-		// TODO should implement, or delete?
-
-	}
-
-	protected IStructuredCleanupHandler getCleanupHandler(Node node) {
-		return null;
-	}
-
-	protected IStructuredFormatProcessor getFormatProcessor() {
-		return null;
-	}
-
-	protected void refreshCleanupPreferences() {
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IMediaGroupID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IMediaGroupID.java
deleted file mode 100644
index 8d02ac8..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IMediaGroupID.java
+++ /dev/null
@@ -1,34 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-/**
- * 
- */
-public interface IMediaGroupID {
-
-	public final static String M_CONTINUOUS = "continuous"; //$NON-NLS-1$
-	public final static String M_PAGED = "paged"; //$NON-NLS-1$
-
-	public final static String M_VISUAL = "visual"; //$NON-NLS-1$
-	public final static String M_AURAL = "aural"; //$NON-NLS-1$
-	public final static String M_TACTILE = "tactile"; //$NON-NLS-1$
-
-	public final static String M_GRID = "grid"; //$NON-NLS-1$
-	public final static String M_BITMAP = "bitmap"; //$NON-NLS-1$
-
-	public final static String M_INTERACTIVE = "interactive"; //$NON-NLS-1$
-	public final static String M_STATIC = "static"; //$NON-NLS-1$
-
-	public final static String M_ALL = "all"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IValID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IValID.java
deleted file mode 100644
index f49c1a1..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IValID.java
+++ /dev/null
@@ -1,266 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-/**
- * 
- */
-public interface IValID {
-
-	public final static String V_100 = "100"; //$NON-NLS-1$
-	public final static String V_200 = "200"; //$NON-NLS-1$
-	public final static String V_300 = "300"; //$NON-NLS-1$
-	public final static String V_400 = "400"; //$NON-NLS-1$
-	public final static String V_500 = "500"; //$NON-NLS-1$
-	public final static String V_600 = "600"; //$NON-NLS-1$
-	public final static String V_700 = "700"; //$NON-NLS-1$
-	public final static String V_800 = "800"; //$NON-NLS-1$
-	public final static String V_900 = "900"; //$NON-NLS-1$
-	public final static String V_ABOVE = "above"; //$NON-NLS-1$
-	public final static String V_ABSOLUTE = "absolute"; //$NON-NLS-1$
-	public final static String V_ACTIVEBORDER = "ActiveBorder"; //$NON-NLS-1$
-	public final static String V_ACTIVECAPTION = "ActiveCaption"; //$NON-NLS-1$
-	public final static String V_ALL = "all"; //$NON-NLS-1$
-	public final static String V_ALWAYS = "always"; //$NON-NLS-1$
-	public final static String V_APPWORKSPACE = "AppWorkspace"; //$NON-NLS-1$
-	public final static String V_AQUA = "aqua"; //$NON-NLS-1$
-	public final static String V_ARMENIAN = "armenian"; //$NON-NLS-1$
-	public final static String V_AUTO = "auto"; //$NON-NLS-1$
-	public final static String V_AVOID = "avoid"; //$NON-NLS-1$
-	public final static String V_BACKGROUND = "Background"; //$NON-NLS-1$
-	public final static String V_BASELINE = "baseline"; //$NON-NLS-1$
-	public final static String V_BEHIND = "behind"; //$NON-NLS-1$
-	public final static String V_BELOW = "below"; //$NON-NLS-1$
-	public final static String V_BIDI_OVERRIDE = "bidi-override"; //$NON-NLS-1$
-	public final static String V_BLACK = "black"; //$NON-NLS-1$
-	public final static String V_BLINK = "blink"; //$NON-NLS-1$
-	public final static String V_BLOCK = "block"; //$NON-NLS-1$
-	public final static String V_BLUE = "blue"; //$NON-NLS-1$
-	public final static String V_BOLD = "bold"; //$NON-NLS-1$
-	public final static String V_BOLDER = "bolder"; //$NON-NLS-1$
-	public final static String V_BOTH = "both"; //$NON-NLS-1$
-	public final static String V_BOTTOM = "bottom"; //$NON-NLS-1$
-	public final static String V_BUTTONFACE = "ButtonFace"; //$NON-NLS-1$
-	public final static String V_BUTTONHIGHLIGHT = "ButtonHighlight"; //$NON-NLS-1$
-	public final static String V_BUTTONSHADOW = "ButtonShadow"; //$NON-NLS-1$
-	public final static String V_BUTTONTEXT = "ButtonText"; //$NON-NLS-1$
-	public final static String V_CAPITALIZE = "capitalize"; //$NON-NLS-1$
-	public final static String V_CAPTION = "caption"; //$NON-NLS-1$
-	public final static String V_CAPTIONTEXT = "CaptionText"; //$NON-NLS-1$
-	public final static String V_CENTER = "center"; //$NON-NLS-1$
-	public final static String V_CENTER_LEFT = "center-left"; //$NON-NLS-1$
-	public final static String V_CENTER_RIGHT = "center-right"; //$NON-NLS-1$
-	public final static String V_CHILD = "child"; //$NON-NLS-1$
-	public final static String V_CIRCLE = "circle"; //$NON-NLS-1$
-	public final static String V_CJK_IDEOGRAPHIC = "cjk-ideographic"; //$NON-NLS-1$
-	public final static String V_CLOSE_QUOTE = "close-quote"; //$NON-NLS-1$
-	public final static String V_CODE = "code"; //$NON-NLS-1$
-	public final static String V_CONDENSED = "condensed"; //$NON-NLS-1$
-	public final static String V_COLLAPSE = "collapse"; //$NON-NLS-1$
-	public final static String V_COMPACT = "compact"; //$NON-NLS-1$
-	public final static String V_CONTINUOUS = "continuous"; //$NON-NLS-1$
-	public final static String V_CROP = "crop"; //$NON-NLS-1$
-	public final static String V_CROSS = "cross"; //$NON-NLS-1$
-	public final static String V_CROSSHAIR = "crosshair"; //$NON-NLS-1$
-	public final static String V_CURSIVE = "cursive"; //$NON-NLS-1$
-	public final static String V_DASHED = "dashed"; //$NON-NLS-1$
-	public final static String V_DECIMAL = "decimal"; //$NON-NLS-1$
-	public final static String V_DECIMAL_LEADING_ZERO = "decimal-leading-zero"; //$NON-NLS-1$
-	public final static String V_DEFAULT = "default"; //$NON-NLS-1$
-	public final static String V_DIGITS = "digits"; //$NON-NLS-1$
-	public final static String V_DISC = "disc"; //$NON-NLS-1$
-	public final static String V_DOTTED = "dotted"; //$NON-NLS-1$
-	public final static String V_DOUBLE = "double"; //$NON-NLS-1$
-	public final static String V_E_RESIZE = "e-resize"; //$NON-NLS-1$
-	public final static String V_EMBED = "embed"; //$NON-NLS-1$
-	public final static String V_EXPANDED = "expanded"; //$NON-NLS-1$
-	public final static String V_EXTRA_CONDENSED = "extra-condensed"; //$NON-NLS-1$
-	public final static String V_EXTRA_EXPANDED = "extra-expanded"; //$NON-NLS-1$
-	public final static String V_FANTASY = "fantasy"; //$NON-NLS-1$
-	public final static String V_FAR_LEFT = "far-left"; //$NON-NLS-1$
-	public final static String V_FAR_RIGHT = "far-right"; //$NON-NLS-1$
-	public final static String V_FAST = "fast"; //$NON-NLS-1$
-	public final static String V_FASTER = "faster"; //$NON-NLS-1$
-	public final static String V_FEMALE = "female"; //$NON-NLS-1$
-	public final static String V_FIXED = "fixed"; //$NON-NLS-1$
-	public final static String V_FUCHSIA = "fuchsia"; //$NON-NLS-1$
-	public final static String V_GEORGIAN = "georgian"; //$NON-NLS-1$
-	public final static String V_GRAY = "gray"; //$NON-NLS-1$
-	public final static String V_GRAYTEXT = "GrayText"; //$NON-NLS-1$
-	public final static String V_GREEN = "green"; //$NON-NLS-1$
-	public final static String V_GROOVE = "groove"; //$NON-NLS-1$
-	public final static String V_HEBREW = "hebrew"; //$NON-NLS-1$
-	public final static String V_HELP = "help"; //$NON-NLS-1$
-	public final static String V_HIDDEN = "hidden"; //$NON-NLS-1$
-	public final static String V_HIDE = "hide"; //$NON-NLS-1$
-	public final static String V_HIGH = "high"; //$NON-NLS-1$
-	public final static String V_HIGHLIGHT = "Highlight"; //$NON-NLS-1$
-	public final static String V_HIGHLIGHTTEXT = "HighlightText"; //$NON-NLS-1$
-	public final static String V_HIGHER = "higher"; //$NON-NLS-1$
-	public final static String V_HIRAGANA = "hiragana"; //$NON-NLS-1$
-	public final static String V_HIRAGANA_IROHA = "hiragana-iroha"; //$NON-NLS-1$
-	public final static String V_ICON = "icon"; //$NON-NLS-1$
-	public final static String V_INACTIVEBORDER = "InactiveBorder"; //$NON-NLS-1$
-	public final static String V_INACTIVECAPTION = "InactiveCaption"; //$NON-NLS-1$
-	public final static String V_INACTIVECAPTIONTEXT = "InactiveCaptionText"; //$NON-NLS-1$
-	public final static String V_INFOBACKGROUND = "InfoBackground"; //$NON-NLS-1$
-	public final static String V_INFOTEXT = "InfoText"; //$NON-NLS-1$
-	public final static String V_INLINE = "inline"; //$NON-NLS-1$
-	public final static String V_INLINE_TABLE = "inline-table"; //$NON-NLS-1$
-	public final static String V_INSET = "inset"; //$NON-NLS-1$
-	public final static String V_INSIDE = "inside"; //$NON-NLS-1$
-	public final static String V_INVERT = "invert"; //$NON-NLS-1$
-	public final static String V_ITALIC = "italic"; //$NON-NLS-1$
-	public final static String V_JUSTIFY = "justify"; //$NON-NLS-1$
-	public final static String V_KATAKANA = "katakana"; //$NON-NLS-1$
-	public final static String V_KATAKANA_IROHA = "katakana-iroha"; //$NON-NLS-1$
-	public final static String V_LANDSCAPE = "landscape"; //$NON-NLS-1$
-	public final static String V_LARGE = "large"; //$NON-NLS-1$
-	public final static String V_LARGER = "larger"; //$NON-NLS-1$
-	public final static String V_LEFT = "left"; //$NON-NLS-1$
-	public final static String V_LEFT_SIDE = "left-side"; //$NON-NLS-1$
-	public final static String V_LEFTWARDS = "leftwards"; //$NON-NLS-1$
-	public final static String V_LEVEL = "level"; //$NON-NLS-1$
-	public final static String V_LIGHTER = "lighter"; //$NON-NLS-1$
-	public final static String V_LIME = "lime"; //$NON-NLS-1$
-	public final static String V_LINE_THROUGH = "line-through"; //$NON-NLS-1$
-	public final static String V_LIST_ITEM = "list-item"; //$NON-NLS-1$
-	public final static String V_LOUD = "loud"; //$NON-NLS-1$
-	public final static String V_LOW = "low"; //$NON-NLS-1$
-	public final static String V_LOWER = "lower"; //$NON-NLS-1$
-	public final static String V_LOWER_ALPHA = "lower-alpha"; //$NON-NLS-1$
-	public final static String V_LOWER_GREEK = "lower-greek"; //$NON-NLS-1$
-	public final static String V_LOWER_LATIN = "lower-latin"; //$NON-NLS-1$
-	public final static String V_LOWER_ROMAN = "lower-roman"; //$NON-NLS-1$
-	public final static String V_LOWERCASE = "lowercase"; //$NON-NLS-1$
-	public final static String V_LTR = "ltr"; //$NON-NLS-1$
-	public final static String V_MALE = "male"; //$NON-NLS-1$
-	public final static String V_MARKER = "marker"; //$NON-NLS-1$
-	public final static String V_MAROON = "maroon"; //$NON-NLS-1$
-	public final static String V_MEDIUM = "medium"; //$NON-NLS-1$
-	public final static String V_MENU = "menu"; //$NON-NLS-1$
-	public final static String V_MENUTEXT = "MenuText"; //$NON-NLS-1$
-	public final static String V_MESSAGE_BOX = "message-box"; //$NON-NLS-1$
-	public final static String V_MIDDLE = "middle"; //$NON-NLS-1$
-	public final static String V_MIX = "mix"; //$NON-NLS-1$
-	public final static String V_MONOSPACE = "monospace"; //$NON-NLS-1$
-	public final static String V_MOVE = "move"; //$NON-NLS-1$
-	public final static String V_N_RESIZE = "n-resize"; //$NON-NLS-1$
-	public final static String V_NARROWER = "narrower"; //$NON-NLS-1$
-	public final static String V_NAVY = "navy"; //$NON-NLS-1$
-	public final static String V_NE_RESIZE = "ne-resize"; //$NON-NLS-1$
-	public final static String V_NO_CLOSE_QUOTE = "no-close-quote"; //$NON-NLS-1$
-	public final static String V_NO_OPEN_QUOTE = "no-open-quote"; //$NON-NLS-1$
-	public final static String V_NO_REPEAT = "no-repeat"; //$NON-NLS-1$
-	public final static String V_NONE = "none"; //$NON-NLS-1$
-	public final static String V_NORMAL = "normal"; //$NON-NLS-1$
-	public final static String V_NOWRAP = "nowrap"; //$NON-NLS-1$
-	public final static String V_NW_RESIZE = "nw-resize"; //$NON-NLS-1$
-	public final static String V_OBLIQUE = "oblique"; //$NON-NLS-1$
-	public final static String V_OLIVE = "olive"; //$NON-NLS-1$
-	public final static String V_ONCE = "once"; //$NON-NLS-1$
-	public final static String V_OPEN_QUOTE = "open-quote"; //$NON-NLS-1$
-	public final static String V_OUTSET = "outset"; //$NON-NLS-1$
-	public final static String V_OUTSIDE = "outside"; //$NON-NLS-1$
-	public final static String V_OVERLINE = "overline"; //$NON-NLS-1$
-	public final static String V_POINTER = "pointer"; //$NON-NLS-1$
-	public final static String V_PORTRAIT = "portrait"; //$NON-NLS-1$
-	public final static String V_PRE = "pre"; //$NON-NLS-1$
-	public final static String V_PURPLE = "purple"; //$NON-NLS-1$
-	public final static String V_RED = "red"; //$NON-NLS-1$
-	public final static String V_RELATIVE = "relative"; //$NON-NLS-1$
-	public final static String V_REPEAT = "repeat"; //$NON-NLS-1$
-	public final static String V_REPEAT_X = "repeat-x"; //$NON-NLS-1$
-	public final static String V_REPEAT_Y = "repeat-y"; //$NON-NLS-1$
-	public final static String V_RIDGE = "ridge"; //$NON-NLS-1$
-	public final static String V_RIGHT = "right"; //$NON-NLS-1$
-	public final static String V_RIGHT_SIDE = "right-side"; //$NON-NLS-1$
-	public final static String V_RIGHTWARDS = "rightwards"; //$NON-NLS-1$
-	public final static String V_RTL = "rtl"; //$NON-NLS-1$
-	public final static String V_RUN_IN = "run-in"; //$NON-NLS-1$
-	public final static String V_S_RESIZE = "s-resize"; //$NON-NLS-1$
-	public final static String V_SANS_SERIF = "sans-serif"; //$NON-NLS-1$
-	public final static String V_SCROLL = "scroll"; //$NON-NLS-1$
-	public final static String V_SCROLLBAR = "Scrollbar"; //$NON-NLS-1$
-	public final static String V_SE_RESIZE = "se-resize"; //$NON-NLS-1$
-	public final static String V_SEMI_CONDENSED = "semi-condensed"; //$NON-NLS-1$
-	public final static String V_SEMI_EXPANDED = "semi-expanded"; //$NON-NLS-1$
-	public final static String V_SEPARATE = "separate"; //$NON-NLS-1$
-	public final static String V_SERIF = "serif"; //$NON-NLS-1$
-	public final static String V_SHOW = "show"; //$NON-NLS-1$
-	public final static String V_SILENT = "silent"; //$NON-NLS-1$
-	public final static String V_SILVER = "silver"; //$NON-NLS-1$
-	public final static String V_SLOW = "slow"; //$NON-NLS-1$
-	public final static String V_SLOWER = "slower"; //$NON-NLS-1$
-	public final static String V_SMALL = "small"; //$NON-NLS-1$
-	public final static String V_SMALL_CAPS = "small-caps"; //$NON-NLS-1$
-	public final static String V_SMALL_CAPTION = "small-caption"; //$NON-NLS-1$
-	public final static String V_SMALLER = "smaller"; //$NON-NLS-1$
-	public final static String V_SOFT = "soft"; //$NON-NLS-1$
-	public final static String V_SOLID = "solid"; //$NON-NLS-1$
-	public final static String V_SPELL_OUT = "spell-out"; //$NON-NLS-1$
-	public final static String V_SQUARE = "square"; //$NON-NLS-1$
-	public final static String V_STATIC = "static"; //$NON-NLS-1$
-	public final static String V_STATUS_BAR = "status-bar"; //$NON-NLS-1$
-	public final static String V_SUB = "sub"; //$NON-NLS-1$
-	public final static String V_SUPER = "super"; //$NON-NLS-1$
-	public final static String V_SW_RESIZE = "sw-resize"; //$NON-NLS-1$
-	public final static String V_TABLE = "table"; //$NON-NLS-1$
-	public final static String V_TABLE_CAPTION = "table-caption"; //$NON-NLS-1$
-	public final static String V_TABLE_CELL = "table-cell"; //$NON-NLS-1$
-	public final static String V_TABLE_COLUMN = "table-column"; //$NON-NLS-1$
-	public final static String V_TABLE_COLUMN_GROUP = "table-column-group"; //$NON-NLS-1$
-	public final static String V_TABLE_FOOTER_GROUP = "table-footer-group"; //$NON-NLS-1$
-	public final static String V_TABLE_HEADER_GROUP = "table-header-group"; //$NON-NLS-1$
-	public final static String V_TABLE_ROW = "table-row"; //$NON-NLS-1$
-	public final static String V_TABLE_ROW_GROUP = "table-row-group"; //$NON-NLS-1$
-	public final static String V_TEAL = "teal"; //$NON-NLS-1$
-	public final static String V_TEXT = "text"; //$NON-NLS-1$
-	public final static String V_TEXT_TOP = "text-top"; //$NON-NLS-1$
-	public final static String V_TEXT_BOTTOM = "text-bottom"; //$NON-NLS-1$
-	public final static String V_THICK = "thick"; //$NON-NLS-1$
-	public final static String V_THIN = "thin"; //$NON-NLS-1$
-	public final static String V_THREEDDARKSHADOW = "ThreeDDarkShadow"; //$NON-NLS-1$
-	public final static String V_THREEDFACE = "ThreeDFace"; //$NON-NLS-1$
-	public final static String V_THREEDHIGHLIGHT = "ThreeDHighlight"; //$NON-NLS-1$
-	public final static String V_THREEDLIGHTSHADOW = "ThreeDLightShadow"; //$NON-NLS-1$
-	public final static String V_THREEDSHADOW = "ThreeDShadow"; //$NON-NLS-1$
-	public final static String V_TOP = "top"; //$NON-NLS-1$
-	public final static String V_TRANSPARENT = "transparent"; //$NON-NLS-1$
-	public final static String V_ULTRA_CONDENSED = "ultra-condensed"; //$NON-NLS-1$
-	public final static String V_ULTRA_EXPANDED = "ultra-expanded"; //$NON-NLS-1$
-	public final static String V_UNDERLINE = "underline"; //$NON-NLS-1$
-	public final static String V_UPPER_ALPHA = "upper-alpha"; //$NON-NLS-1$
-	public final static String V_UPPER_LATIN = "upper-latin"; //$NON-NLS-1$
-	public final static String V_UPPER_ROMAN = "upper-roman"; //$NON-NLS-1$
-	public final static String V_UPPERCASE = "uppercase"; //$NON-NLS-1$
-	public final static String V_VISIBLE = "visible"; //$NON-NLS-1$
-	public final static String V_W_RESIZE = "w-resize"; //$NON-NLS-1$
-	public final static String V_WAIT = "wait"; //$NON-NLS-1$
-	public final static String V_WHITE = "white"; //$NON-NLS-1$
-	public final static String V_WIDER = "wider"; //$NON-NLS-1$
-	public final static String V_WINDOW = "Window"; //$NON-NLS-1$
-	public final static String V_WINDOWFRAME = "WindowFrame"; //$NON-NLS-1$
-	public final static String V_WINDOWTEXT = "WindowText"; //$NON-NLS-1$
-	public final static String V_X_FAST = "x-fast"; //$NON-NLS-1$
-	public final static String V_X_HIGH = "x-high"; //$NON-NLS-1$
-	public final static String V_X_LARGE = "x-large"; //$NON-NLS-1$
-	public final static String V_X_LOUD = "x-loud"; //$NON-NLS-1$
-	public final static String V_X_LOW = "x-low"; //$NON-NLS-1$
-	public final static String V_X_SLOW = "x-slow"; //$NON-NLS-1$
-	public final static String V_X_SMALL = "x-small"; //$NON-NLS-1$
-	public final static String V_X_SOFT = "x-soft"; //$NON-NLS-1$
-	public final static String V_XX_SMALL = "xx-small"; //$NON-NLS-1$
-	public final static String V_XX_LARGE = "xx-large"; //$NON-NLS-1$
-	public final static String V_YELLOW = "yellow"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMContainer.java
deleted file mode 100644
index d013f7c..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMContainer.java
+++ /dev/null
@@ -1,164 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Set;
-import java.util.Vector;
-
-/**
- * 
- */
-public class PropCMContainer extends PropCMNode {
-
-	private java.util.Vector nodes = new Vector();
-	private static java.util.Hashtable instances = null;
-	public final static String VAL_ABSOLUTE_SIZE = "absolute-size";//$NON-NLS-1$
-	public final static String VAL_BORDER_STYLE = "border-style";//$NON-NLS-1$
-	public final static String VAL_BORDER_WIDTH = "border-width";//$NON-NLS-1$
-	public final static String VAL_COLOR = "color";//$NON-NLS-1$
-	public final static String VAL_SYSTEM_COLOR = "system-color";//$NON-NLS-1$
-	public final static String VAL_GENERIC_FAMILY = "generic-family";//$NON-NLS-1$
-	public final static String VAL_GENERIC_VOICE = "generic-voice";//$NON-NLS-1$
-	public final static String VAL_MARGIN_WIDTH = "margin-width";//$NON-NLS-1$
-	public final static String VAL_PADDING_WIDTH = "padding-width";//$NON-NLS-1$
-	public final static String VAL_RELATIVE_SIZE = "relative-size";//$NON-NLS-1$
-
-	/**
-	 * 
-	 */
-	protected PropCMContainer(String name) {
-		super(name);
-	}
-
-	/**
-	 * 
-	 */
-	Object appendChild(Object node) {
-		if (!nodes.contains(node))
-			nodes.add(node);
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	public boolean canHave(String identifier) {
-		int nChild = getNumChild();
-		for (int i = 0; i < nChild; i++) {
-			Object child = getChildAt(i);
-			if (child instanceof String && identifier.equalsIgnoreCase((String) child))
-				return true;
-			if (child instanceof PropCMContainer && ((PropCMContainer) child).canHave(identifier))
-				return true;
-		}
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	public Object getChildAt(int index) {
-		if (nodes == null || index < 0 || nodes.size() <= index)
-			return null;
-		return nodes.elementAt(index);
-	}
-
-	/**
-	 * 
-	 */
-	static PropCMContainer getContInstanceOf(String name) {
-		if (name == null)
-			return null;
-
-		// initialize
-		if (instances == null)
-			instances = new Hashtable(20);
-
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		// query
-		Object node = instances.get(name);
-		if (node != null)
-			return (PropCMContainer) node;
-
-		if (PropCMNode.isLoading()) {
-			// register
-			node = new PropCMContainer(name);
-			instances.put(name, node);
-		}
-
-		return (PropCMContainer) node;
-	}
-
-	/**
-	 * 
-	 */
-	void getIdentifiers(Set idents) {
-		if (idents == null)
-			return;
-		int nChildren = nodes.size();
-		for (int i = 0; i < nChildren; i++) {
-			Object node = nodes.elementAt(i);
-			if (node instanceof PropCMNode)
-				((PropCMNode) node).getIdentifiers(idents);
-			else if (node instanceof String)
-				idents.add(node);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public int getNumChild() {
-		if (nodes == null)
-			return 0;
-		return nodes.size();
-	}
-
-	/**
-	 * 
-	 */
-	public short getType() {
-		return VAL_CONTAINER;
-	}
-
-	/**
-	 * 
-	 */
-	void getValues(Collection values) {
-		if (values == null)
-			return;
-		int nChildren = nodes.size();
-		for (int i = 0; i < nChildren; i++) {
-			Object node = nodes.elementAt(i);
-			if (node instanceof PropCMNode)
-				((PropCMNode) node).getValues(values);
-			else if (node instanceof String) {
-				if (!values.contains(node))
-					values.add(node);
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	Object removeChild(Object node) {
-		nodes.remove(node);
-		return node;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFontProperty.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFontProperty.java
deleted file mode 100644
index a28e21d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFontProperty.java
+++ /dev/null
@@ -1,198 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-/**
- * 
- */
-public class PropCMFontProperty extends PropCMProperty {
-
-	// static fields
-	private static java.util.Hashtable instances = null;
-	private static java.util.Hashtable cachedIdMap = null;
-	// selecting properties
-	public final static String PF_FONT_FAMILY = "font-family";//$NON-NLS-1$
-	public final static String PF_FONT_STYLE = "font-style";//$NON-NLS-1$
-	public final static String PF_FONT_VARIANT = "font-variant";//$NON-NLS-1$
-	public final static String PF_FONT_WEIGHT = "font-weight";//$NON-NLS-1$
-	public final static String PF_FONT_STRETCH = "font-stretch";//$NON-NLS-1$
-	public final static String PF_FONT_SIZE = "font-size";//$NON-NLS-1$
-	// qualification properties
-	public final static String PF_UNICODE_RANGE = "unicode-range";//$NON-NLS-1$
-	// numeric properties
-	public final static String PF_UNITS_PER_EM = "units-per-em";//$NON-NLS-1$
-	// referencing properties
-	public final static String PF_SRC = "src";//$NON-NLS-1$
-	// matching properties
-	public final static String PF_PANOSE_1 = "panose-1";//$NON-NLS-1$
-	public final static String PF_STEMV = "stemv";//$NON-NLS-1$
-	public final static String PF_STEMH = "stemh";//$NON-NLS-1$
-	public final static String PF_SLOPE = "slope";//$NON-NLS-1$
-	public final static String PF_CAP_HEIGHT = "cap-height";//$NON-NLS-1$
-	public final static String PF_X_HEIGHT = "x-height";//$NON-NLS-1$
-	public final static String PF_ASCENT = "ascent";//$NON-NLS-1$
-	public final static String PF_DESCENT = "descent";//$NON-NLS-1$
-	// synthesis properties
-	public final static String PF_WIDTHS = "widths";//$NON-NLS-1$
-	public final static String PF_BBOX = "bbox";//$NON-NLS-1$
-	public final static String PF_DEFINITION_SRC = "definition-src";//$NON-NLS-1$
-	// alignment properties
-	public final static String PF_BASELINE = "baseline";//$NON-NLS-1$
-	public final static String PF_CENTERLINE = "centerline";//$NON-NLS-1$
-	public final static String PF_MATHLINE = "mathline";//$NON-NLS-1$
-	public final static String PF_TOPLINE = "topline";//$NON-NLS-1$
-
-	/**
-	 * 
-	 */
-	protected PropCMFontProperty(String name) {
-		super(name);
-	}
-
-	/**
-	 * 
-	 */
-	public static PropCMProperty getInstanceOf(String name) {
-		// initialize
-		if (instances == null)
-			instances = new Hashtable(10);
-
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		// query
-		Object node = instances.get(name);
-		if (node != null)
-			return (PropCMProperty) node;
-
-		// register
-		if (PropCMNode.isLoading()) {
-			node = new PropCMFontProperty(name);
-			instances.put(name, node);
-		}
-
-		return (PropCMProperty) node;
-	}
-
-	/**
-	 * 
-	 */
-	public static Enumeration getNameEnum() {
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		return instances.keys();
-	}
-
-	/**
-	 * 
-	 */
-	public static Enumeration getPropertyEnum() {
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		return instances.elements();
-	}
-
-	/**
-	 * 
-	 */
-	public short getType() {
-		return VAL_FONTPROPERTY;
-	}
-
-	/**
-	 * 
-	 */
-	public static Vector names() {
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		return new Vector(instances.keySet());
-	}
-
-	/**
-	 * 
-	 */
-	public static List names(Object mediaGroup) {
-		if (mediaGroup == null)
-			return names();
-
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		Vector properties = new Vector();
-
-		Iterator it = instances.values().iterator();
-		while (it.hasNext()) {
-			PropCMProperty prop = (PropCMProperty) it.next();
-			if (prop.getMediaGroups().contains(mediaGroup))
-				properties.add(prop.getName());
-		}
-
-		return properties;
-	}
-
-	/**
-	 * If itentifier is null, get all properties
-	 */
-	public static Vector propertiesFor(String identifier, boolean shorthands) {
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		// if identifier is null, get all properties
-		if (identifier == null)
-			return new Vector(instances.values());
-
-		if (cachedIdMap == null) {
-			// start cacheing
-			cachedIdMap = new Hashtable();
-		}
-		else {
-			// search cached
-			Object ret = cachedIdMap.get(identifier + String.valueOf(shorthands));
-			if (ret != null)
-				return new Vector((Collection) ret);
-		}
-
-		// create
-		Enumeration properties = getPropertyEnum();
-		HashSet set = new HashSet();
-		while (properties.hasMoreElements()) {
-			PropCMProperty prop = (PropCMProperty) properties.nextElement();
-			if (!shorthands && prop.isShorthand())
-				continue;
-			if (prop.canHave(identifier))
-				set.add(prop);
-		}
-
-		// cache
-		cachedIdMap.put(identifier + String.valueOf(shorthands), set);
-
-		return new Vector(set);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFunction.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFunction.java
deleted file mode 100644
index 03efc91..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFunction.java
+++ /dev/null
@@ -1,89 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Set;
-
-/**
- * 
- */
-public class PropCMFunction extends PropCMNode {
-
-	private static java.util.Hashtable instances = null;
-	public final static String VAL_ATTR = "attr";//$NON-NLS-1$
-	public final static String VAL_COUNTER = "counter";//$NON-NLS-1$
-	public final static String VAL_RGB = "rgb";//$NON-NLS-1$
-	public final static String VAL_SHAPE = "rect";//$NON-NLS-1$
-	public final static String VAL_URI = "url";//$NON-NLS-1$
-	public final static String VAL_FORMAT = "format";//$NON-NLS-1$
-	public final static String VAL_LOCAL = "local";//$NON-NLS-1$
-
-	/**
-	 * 
-	 */
-	protected PropCMFunction(String name) {
-		super(name);
-	}
-
-	/**
-	 * 
-	 */
-	void getIdentifiers(Set indents) {
-	}
-
-	/**
-	 * 
-	 */
-	static public PropCMFunction getInstanceOf(String name) {
-		if (name == null)
-			return null;
-
-		// initialize
-		if (instances == null)
-			instances = new Hashtable(10);
-
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		// query
-		Object node = instances.get(name);
-		if (node != null)
-			return (PropCMFunction) node;
-
-		// register
-		if (PropCMNode.isLoading()) {
-			node = new PropCMFunction(name);
-			instances.put(name, node);
-		}
-
-		return (PropCMFunction) node;
-	}
-
-	/**
-	 * 
-	 */
-	public short getType() {
-		return VAL_FUNC;
-	}
-
-	/**
-	 * 
-	 */
-	void getValues(Collection values) {
-		if (values != null && !values.contains(this))
-			values.add(this);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNode.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNode.java
deleted file mode 100644
index 52a84df..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNode.java
+++ /dev/null
@@ -1,1369 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Vector;
-
-/**
- * 
- */
-public abstract class PropCMNode {
-
-	public final static short VAL_IDENTIFIER = 0;
-	public final static short VAL_PROPERTY = 1;
-	public final static short VAL_NUMBER = 2;
-	public final static short VAL_STRING = 3;
-	public final static short VAL_FUNC = 4;
-	public final static short VAL_CONTAINER = 5;
-	public final static short VAL_SUBPROPERTY = 6;
-	public final static short VAL_FONTPROPERTY = 7;
-	public final static short VAL_UNICODE_RANGE = 8;
-	protected java.lang.String name = null;
-	private static short LOADING = 0; // 0 : not initialized, 1 : under
-										// initializing, 2 : initialize-done
-										// and fix DB
-
-	/**
-	 * 
-	 */
-	public PropCMNode(String name) {
-		super();
-		this.name = name;
-	}
-
-	/**
-	 * 
-	 */
-	public Set getIdentifiers() {
-		HashSet ids = new HashSet();
-		getIdentifiers(ids);
-		return ids;
-	}
-
-	/**
-	 * 
-	 */
-	abstract void getIdentifiers(Set indents);
-
-	/**
-	 * 
-	 */
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * 
-	 */
-	public abstract short getType();
-
-	/**
-	 * 
-	 */
-	public Collection getValues() {
-		Vector vals = new Vector();
-		getValues(vals);
-		return vals;
-	}
-
-	/**
-	 * 
-	 */
-	abstract void getValues(Collection values);
-
-	/**
-	 * 
-	 */
-	protected static void initPropertyCM() {
-		if (!isNeedInitialize())
-			return;
-		LOADING = 1;
-
-		PropCMNumber.initNumberCMDim();
-
-		// azimuth
-		PropCMProperty prop = PropCMProperty.getInstanceOf(PropCMProperty.P_AZIMUTH);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_ANGLE));
-		prop.appendChild(IValID.V_LEFT_SIDE);
-		prop.appendChild(IValID.V_FAR_LEFT);
-		prop.appendChild(IValID.V_LEFT);
-		prop.appendChild(IValID.V_CENTER_LEFT);
-		prop.appendChild(IValID.V_CENTER);
-		prop.appendChild(IValID.V_CENTER_RIGHT);
-		prop.appendChild(IValID.V_RIGHT);
-		prop.appendChild(IValID.V_FAR_RIGHT);
-		prop.appendChild(IValID.V_RIGHT_SIDE);
-		prop.appendChild(IValID.V_BEHIND);
-		prop.appendChild(IValID.V_LEFTWARDS);
-		prop.appendChild(IValID.V_RIGHTWARDS);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-		prop.setMaxValueCount(2);
-
-		// background
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG);
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.setMaxValueCount(6);
-
-		// background-attachment
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT);
-		prop.appendChild(IValID.V_SCROLL);
-		prop.appendChild(IValID.V_FIXED);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// background-color
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
-		prop.appendChild(IValID.V_TRANSPARENT);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// background-image
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE);
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
-		prop.appendChild(IValID.V_NONE);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// background-position ---- sub-properties horizontal
-		prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendChild(IValID.V_LEFT);
-		prop.appendChild(IValID.V_CENTER);
-		prop.appendChild(IValID.V_RIGHT);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// background-position ---- sub-properties vertical
-		prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendChild(IValID.V_TOP);
-		prop.appendChild(IValID.V_CENTER);
-		prop.appendChild(IValID.V_BOTTOM);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// background-position
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION);
-		prop.appendChild(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X));
-		prop.appendChild(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y));
-		prop.setMaxValueCount(2);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// background-repeat
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT);
-		prop.appendChild(IValID.V_REPEAT);
-		prop.appendChild(IValID.V_REPEAT_X);
-		prop.appendChild(IValID.V_REPEAT_Y);
-		prop.appendChild(IValID.V_NO_REPEAT);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER);
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE));
-		// prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR));
-		prop.setMaxValueCount(9);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-collapse
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLLAPSE);
-		prop.appendChild(IValID.V_COLLAPSE);
-		prop.appendChild(IValID.V_SEPARATE);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-color
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR);
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR));
-		// prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
-		prop.appendChild(IValID.V_TRANSPARENT);
-		prop.setMaxValueCount(4);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-spacing
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_SPACING);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.setMaxValueCount(2);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-style
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE);
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE));
-		// prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
-		prop.setMaxValueCount(4);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-top
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP);
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR));
-		prop.setMaxValueCount(3);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-right
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT);
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR));
-		prop.setMaxValueCount(3);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-bottom
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM);
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR));
-		prop.setMaxValueCount(3);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-left
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT);
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR));
-		prop.setMaxValueCount(3);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-top-color
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-top-style
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-top-width
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-right-color
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-right-style
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-right-width
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-bottom-color
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-bottom-style
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-bottom-width
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-left-color
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-left-style
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-left-width
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// border-width
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH);
-		// prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH));
-		prop.setMaxValueCount(4);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// bottom
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BOTTOM);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// caption-side
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CAPTION_SIDE);
-		prop.appendChild(IValID.V_TOP);
-		prop.appendChild(IValID.V_BOTTOM);
-		prop.appendChild(IValID.V_LEFT);
-		prop.appendChild(IValID.V_RIGHT);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// clear
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CLEAR);
-		prop.appendChild(IValID.V_LEFT);
-		prop.appendChild(IValID.V_RIGHT);
-		prop.appendChild(IValID.V_BOTH);
-		prop.appendChild(IValID.V_STATIC);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// clip ---- sub-properties top
-		prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_TOP);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(IValID.V_AUTO);
-		((PropCMSubProperty) prop).setContainer(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// clip ---- sub-properties right
-		prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_RIGHT);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(IValID.V_AUTO);
-		((PropCMSubProperty) prop).setContainer(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// clip ---- sub-properties bottom
-		prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_BOTTOM);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(IValID.V_AUTO);
-		((PropCMSubProperty) prop).setContainer(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// clip ---- sub-properties left
-		prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_LEFT);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(IValID.V_AUTO);
-		((PropCMSubProperty) prop).setContainer(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// clip
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP);
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_SHAPE));
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// color
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COLOR);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// content
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CONTENT);
-		prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_ANY));
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_COUNTER));
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_ATTR));
-		prop.appendChild(IValID.V_OPEN_QUOTE);
-		prop.appendChild(IValID.V_CLOSE_QUOTE);
-		prop.appendChild(IValID.V_NO_OPEN_QUOTE);
-		prop.appendChild(IValID.V_NO_CLOSE_QUOTE);
-		prop.setMaxValueCount(-1); // infinite
-		prop.appendMediaGroup(IMediaGroupID.M_ALL);
-
-		// counter-increment
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_INCREMENT);
-		prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_COUNTER_ID));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
-		prop.appendChild(IValID.V_NONE);
-		prop.setMaxValueCount(-1);
-		prop.appendMediaGroup(IMediaGroupID.M_ALL);
-
-		// counter-reset
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_RESET);
-		prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_COUNTER_ID));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
-		prop.appendChild(IValID.V_NONE);
-		prop.setMaxValueCount(-1);
-		prop.appendMediaGroup(IMediaGroupID.M_ALL);
-
-		// cue
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CUE);
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_BEFORE));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_AFTER));
-		prop.setMaxValueCount(2);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// cue-after
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_AFTER);
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
-		prop.appendChild(IValID.V_NONE);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// cue-before
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_BEFORE);
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
-		prop.appendChild(IValID.V_NONE);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// cursor
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CURSOR);
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendChild(IValID.V_CROSSHAIR);
-		prop.appendChild(IValID.V_DEFAULT);
-		prop.appendChild(IValID.V_POINTER);
-		prop.appendChild(IValID.V_MOVE);
-		prop.appendChild(IValID.V_E_RESIZE);
-		prop.appendChild(IValID.V_NE_RESIZE);
-		prop.appendChild(IValID.V_NW_RESIZE);
-		prop.appendChild(IValID.V_N_RESIZE);
-		prop.appendChild(IValID.V_SE_RESIZE);
-		prop.appendChild(IValID.V_SW_RESIZE);
-		prop.appendChild(IValID.V_S_RESIZE);
-		prop.appendChild(IValID.V_W_RESIZE);
-		prop.appendChild(IValID.V_TEXT);
-		prop.appendChild(IValID.V_WAIT);
-		prop.appendChild(IValID.V_HELP);
-		prop.setMaxValueCount(-1); // infinite
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
-		// direction
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_DIRECTION);
-		prop.appendChild(IValID.V_LTR);
-		prop.appendChild(IValID.V_RTL);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// display
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_DISPLAY);
-		prop.appendChild(IValID.V_INLINE);
-		prop.appendChild(IValID.V_BLOCK);
-		prop.appendChild(IValID.V_LIST_ITEM);
-		prop.appendChild(IValID.V_RUN_IN);
-		prop.appendChild(IValID.V_COMPACT);
-		prop.appendChild(IValID.V_MARKER);
-		prop.appendChild(IValID.V_TABLE);
-		prop.appendChild(IValID.V_INLINE_TABLE);
-		prop.appendChild(IValID.V_TABLE_ROW_GROUP);
-		prop.appendChild(IValID.V_TABLE_HEADER_GROUP);
-		prop.appendChild(IValID.V_TABLE_FOOTER_GROUP);
-		prop.appendChild(IValID.V_TABLE_ROW);
-		prop.appendChild(IValID.V_TABLE_COLUMN_GROUP);
-		prop.appendChild(IValID.V_TABLE_COLUMN);
-		prop.appendChild(IValID.V_TABLE_CELL);
-		prop.appendChild(IValID.V_TABLE_CAPTION);
-		prop.appendChild(IValID.V_NONE);
-		prop.appendMediaGroup(IMediaGroupID.M_ALL);
-
-		// elevation
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_ELEVATION);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_ANGLE));
-		prop.appendChild(IValID.V_BELOW);
-		prop.appendChild(IValID.V_LEVEL);
-		prop.appendChild(IValID.V_ABOVE);
-		prop.appendChild(IValID.V_HIGHER);
-		prop.appendChild(IValID.V_LOWER);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// empty-cells
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_EMPTY_CELLS);
-		prop.appendChild(IValID.V_SHOW);
-		prop.appendChild(IValID.V_HIDE);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// float
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FLOAT);
-		prop.appendChild(IValID.V_LEFT);
-		prop.appendChild(IValID.V_RIGHT);
-		prop.appendChild(IValID.V_NONE);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// font
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT);
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_LINE_HEIGHT));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_FAMILY));
-		prop.appendChild(IValID.V_CAPTION);
-		prop.appendChild(IValID.V_ICON);
-		prop.appendChild(IValID.V_MENU);
-		prop.appendChild(IValID.V_MESSAGE_BOX);
-		prop.appendChild(IValID.V_SMALL_CAPTION);
-		prop.appendChild(IValID.V_STATUS_BAR);
-		prop.setMaxValueCount(-1);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// font-family
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_FAMILY);
-		prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_FONT));
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_FAMILY));
-		prop.setMaxValueCount(-1);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// font-size
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_ABSOLUTE_SIZE));
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_RELATIVE_SIZE));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// font-size-adjust
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE_ADJUST);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-		prop.appendChild(IValID.V_NONE);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// font-stretch
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STRETCH);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.appendChild(IValID.V_WIDER);
-		prop.appendChild(IValID.V_NARROWER);
-		prop.appendChild(IValID.V_ULTRA_CONDENSED);
-		prop.appendChild(IValID.V_EXTRA_CONDENSED);
-		prop.appendChild(IValID.V_CONDENSED);
-		prop.appendChild(IValID.V_SEMI_CONDENSED);
-		prop.appendChild(IValID.V_SEMI_EXPANDED);
-		prop.appendChild(IValID.V_EXPANDED);
-		prop.appendChild(IValID.V_EXTRA_EXPANDED);
-		prop.appendChild(IValID.V_ULTRA_EXPANDED);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// font-style
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE);
-		prop.appendChild(IValID.V_ITALIC);
-		prop.appendChild(IValID.V_OBLIQUE);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// font-variant
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT);
-		prop.appendChild(IValID.V_SMALL_CAPS);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// font-weight
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT);
-		prop.appendChild(IValID.V_BOLD);
-		prop.appendChild(IValID.V_100);
-		prop.appendChild(IValID.V_200);
-		prop.appendChild(IValID.V_300);
-		prop.appendChild(IValID.V_400);
-		prop.appendChild(IValID.V_500);
-		prop.appendChild(IValID.V_600);
-		prop.appendChild(IValID.V_700);
-		prop.appendChild(IValID.V_800);
-		prop.appendChild(IValID.V_900);
-		prop.appendChild(IValID.V_LIGHTER);
-		prop.appendChild(IValID.V_BOLDER);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// height
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_HEIGHT);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// leftt
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LEFT);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// letter-spacing
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LETTER_SPACING);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// line-height
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LINE_HEIGHT);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// list-style
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE);
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE));
-		prop.setMaxValueCount(3);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// list-style-image
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE);
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
-		prop.appendChild(IValID.V_NONE);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// list-style-position
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION);
-		prop.appendChild(IValID.V_INSIDE);
-		prop.appendChild(IValID.V_OUTSIDE);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// list-style-type
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE);
-		prop.appendChild(IValID.V_DISC);
-		prop.appendChild(IValID.V_CIRCLE);
-		prop.appendChild(IValID.V_SQUARE);
-		prop.appendChild(IValID.V_DECIMAL);
-		prop.appendChild(IValID.V_DECIMAL_LEADING_ZERO);
-		prop.appendChild(IValID.V_LOWER_ROMAN);
-		prop.appendChild(IValID.V_UPPER_ROMAN);
-		prop.appendChild(IValID.V_LOWER_GREEK);
-		prop.appendChild(IValID.V_LOWER_ALPHA);
-		prop.appendChild(IValID.V_LOWER_LATIN);
-		prop.appendChild(IValID.V_UPPER_ALPHA);
-		prop.appendChild(IValID.V_UPPER_LATIN);
-		prop.appendChild(IValID.V_HEBREW);
-		prop.appendChild(IValID.V_ARMENIAN);
-		prop.appendChild(IValID.V_GEORGIAN);
-		prop.appendChild(IValID.V_CJK_IDEOGRAPHIC);
-		prop.appendChild(IValID.V_HIRAGANA);
-		prop.appendChild(IValID.V_KATAKANA);
-		prop.appendChild(IValID.V_HIRAGANA_IROHA);
-		prop.appendChild(IValID.V_KATAKANA_IROHA);
-		prop.appendChild(IValID.V_NONE);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// margin
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN);
-		// prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_TOP));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_RIGHT));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_BOTTOM));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_LEFT));
-		prop.setMaxValueCount(4);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// margin-top
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_TOP);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// margin-right
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_RIGHT);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// margin-bottom
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_BOTTOM);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// margin-left
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_LEFT);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// marker-offset
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARKER_OFFSET);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// marks
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARKS);
-		prop.appendChild(IValID.V_CROP);
-		prop.appendChild(IValID.V_CROSS);
-		prop.appendChild(IValID.V_NONE);
-		prop.setMaxValueCount(2);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
-		// max-height
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_HEIGHT);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendChild(IValID.V_NONE);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// max-width
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_WIDTH);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendChild(IValID.V_NONE);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// min-height
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_HEIGHT);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// min-width
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_WIDTH);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// orphans
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_ORPHANS);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
-		// outline
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE);
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_COLOR));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_STYLE));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_WIDTH));
-		prop.setMaxValueCount(3);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
-		// outline-color
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_COLOR);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
-		prop.appendChild(IValID.V_INVERT);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
-		// outline-style
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_STYLE);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
-		// outline-width
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_WIDTH);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
-		// overflow
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OVERFLOW);
-		prop.appendChild(IValID.V_VISIBLE);
-		prop.appendChild(IValID.V_HIDDEN);
-		prop.appendChild(IValID.V_SCROLL);
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// padding
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING);
-		// prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_TOP));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_RIGHT));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_BOTTOM));
-		prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_LEFT));
-		prop.setMaxValueCount(4);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// padding-top
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_TOP);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// padding-right
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_RIGHT);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// padding-bottom
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_BOTTOM);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// padding-left
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_LEFT);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// page
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE);
-		prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_PAGE_ID));
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
-		// page-break-after
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_AFTER);
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendChild(IValID.V_ALWAYS);
-		prop.appendChild(IValID.V_AVOID);
-		prop.appendChild(IValID.V_LEFT);
-		prop.appendChild(IValID.V_RIGHT);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
-		// page-break-before
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_BEFORE);
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendChild(IValID.V_ALWAYS);
-		prop.appendChild(IValID.V_AVOID);
-		prop.appendChild(IValID.V_LEFT);
-		prop.appendChild(IValID.V_RIGHT);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
-		// page-break-inside
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_INSIDE);
-		prop.appendChild(IValID.V_AVOID);
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
-		// pause
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_TIME));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.setMaxValueCount(2);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// pause-after
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_AFTER);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_TIME));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// pause-before
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_BEFORE);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_TIME));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// pitch
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_FREQUENCY));
-		prop.appendChild(IValID.V_X_LOW);
-		prop.appendChild(IValID.V_LOW);
-		prop.appendChild(IValID.V_MEDIUM);
-		prop.appendChild(IValID.V_HIGH);
-		prop.appendChild(IValID.V_X_HIGH);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// pitch-range
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH_RANGE);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// play-during
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PLAY_DURING);
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
-		prop.appendChild(IValID.V_MIX);
-		prop.appendChild(IValID.V_REPEAT);
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendChild(IValID.V_NONE);
-		prop.setMaxValueCount(3);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// position
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_POSITION);
-		prop.appendChild(IValID.V_ABSOLUTE);
-		prop.appendChild(IValID.V_RELATIVE);
-		prop.appendChild(IValID.V_FIXED);
-		prop.appendChild(IValID.V_STATIC);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// quotes
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_QUOTES);
-		prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_ANY));
-		prop.appendChild(IValID.V_NONE);
-		prop.setMaxValueCount(-1);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// richness
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_RICHNESS);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// right
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_RIGHT);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// size
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SIZE);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendChild(IValID.V_PORTRAIT);
-		prop.appendChild(IValID.V_LANDSCAPE);
-		prop.setMaxValueCount(2);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
-		// speak
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.appendChild(IValID.V_NONE);
-		prop.appendChild(IValID.V_SPELL_OUT);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// speak-header
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_HEADER);
-		prop.appendChild(IValID.V_ONCE);
-		prop.appendChild(IValID.V_ALWAYS);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// speak-numeral
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_NUMERAL);
-		prop.appendChild(IValID.V_DIGITS);
-		prop.appendChild(IValID.V_CONTINUOUS);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// speak-punctuation
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_PUNCTUATION);
-		prop.appendChild(IValID.V_CODE);
-		prop.appendChild(IValID.V_NONE);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// speech-rate
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEECH_RATE);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-		prop.appendChild(IValID.V_X_SLOW);
-		prop.appendChild(IValID.V_SLOW);
-		prop.appendChild(IValID.V_MEDIUM);
-		prop.appendChild(IValID.V_FAST);
-		prop.appendChild(IValID.V_X_FAST);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// stress
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_STRESS);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// table-layout
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TABLE_LAYOUT);
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendChild(IValID.V_FIXED);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// text-align
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_ALIGN);
-		prop.appendChild(IValID.V_LEFT);
-		prop.appendChild(IValID.V_CENTER);
-		prop.appendChild(IValID.V_RIGHT);
-		prop.appendChild(IValID.V_JUSTIFY);
-		prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_ANY));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// text-decoration
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_DECORATION);
-		prop.appendChild(IValID.V_UNDERLINE);
-		prop.appendChild(IValID.V_OVERLINE);
-		prop.appendChild(IValID.V_LINE_THROUGH);
-		prop.appendChild(IValID.V_BLINK);
-		prop.appendChild(IValID.V_NONE);
-		prop.setMaxValueCount(4);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// text-indent
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_INDENT);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// text-shadow
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_SHADOW);
-		prop.appendChild(IValID.V_NONE);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.setMaxValueCount(-1);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// text-transform
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_TRANSFORM);
-		prop.appendChild(IValID.V_CAPITALIZE);
-		prop.appendChild(IValID.V_UPPERCASE);
-		prop.appendChild(IValID.V_LOWERCASE);
-		prop.appendChild(IValID.V_NONE);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// top
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TOP);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// unicode-bidi
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_UNICODE_BIDI);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.appendChild(IValID.V_EMBED);
-		prop.appendChild(IValID.V_BIDI_OVERRIDE);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// vertical-align
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_VERTICAL_ALIGN);
-		prop.appendChild(IValID.V_BOTTOM);
-		prop.appendChild(IValID.V_TEXT_BOTTOM);
-		prop.appendChild(IValID.V_SUB);
-		prop.appendChild(IValID.V_BASELINE);
-		prop.appendChild(IValID.V_MIDDLE);
-		prop.appendChild(IValID.V_SUPER);
-		prop.appendChild(IValID.V_TEXT_TOP);
-		prop.appendChild(IValID.V_TOP);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// visibility
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_VISIBILITY);
-		prop.appendChild(IValID.V_VISIBLE);
-		prop.appendChild(IValID.V_HIDDEN);
-		prop.appendChild(IValID.V_COLLAPSE);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// voice-family
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_VOICE_FAMILY);
-		prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_VOICE));
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_VOICE));
-		prop.setMaxValueCount(-1);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// volume
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_VOLUME);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendChild(IValID.V_SILENT);
-		prop.appendChild(IValID.V_X_SOFT);
-		prop.appendChild(IValID.V_SOFT);
-		prop.appendChild(IValID.V_MEDIUM);
-		prop.appendChild(IValID.V_LOUD);
-		prop.appendChild(IValID.V_X_LOUD);
-		prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
-		// white-space
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_WHITE_SPACE);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.appendChild(IValID.V_PRE);
-		prop.appendChild(IValID.V_NOWRAP);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// widows
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_WIDOWS);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-		prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
-		// width
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_WIDTH);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// word-spacing
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_WORD_SPACING);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		// z-index
-		prop = PropCMProperty.getInstanceOf(PropCMProperty.P_Z_INDEX);
-		prop.appendChild(IValID.V_AUTO);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
-		prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
-		/** ******** font properties ********* */
-		// font-family
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_FAMILY);
-		prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_FONT));
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_FAMILY));
-		prop.setMaxValueCount(-1);
-
-		// font-style
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_STYLE);
-		prop.appendChild(IValID.V_ITALIC);
-		prop.appendChild(IValID.V_OBLIQUE);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.appendChild(IValID.V_ALL);
-		prop.setMaxValueCount(-1);
-
-		// font-variant
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_VARIANT);
-		prop.appendChild(IValID.V_SMALL_CAPS);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.setMaxValueCount(-1);
-
-		// font-weight
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_WEIGHT);
-		prop.appendChild(IValID.V_BOLD);
-		prop.appendChild(IValID.V_100);
-		prop.appendChild(IValID.V_200);
-		prop.appendChild(IValID.V_300);
-		prop.appendChild(IValID.V_400);
-		prop.appendChild(IValID.V_500);
-		prop.appendChild(IValID.V_600);
-		prop.appendChild(IValID.V_700);
-		prop.appendChild(IValID.V_800);
-		prop.appendChild(IValID.V_900);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.appendChild(IValID.V_ALL);
-		prop.setMaxValueCount(-1);
-
-		// font-stretch
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_STRETCH);
-		prop.appendChild(IValID.V_NORMAL);
-		prop.appendChild(IValID.V_ULTRA_CONDENSED);
-		prop.appendChild(IValID.V_EXTRA_CONDENSED);
-		prop.appendChild(IValID.V_CONDENSED);
-		prop.appendChild(IValID.V_SEMI_CONDENSED);
-		prop.appendChild(IValID.V_SEMI_EXPANDED);
-		prop.appendChild(IValID.V_EXPANDED);
-		prop.appendChild(IValID.V_EXTRA_EXPANDED);
-		prop.appendChild(IValID.V_ULTRA_EXPANDED);
-		prop.appendChild(IValID.V_ALL);
-		prop.setMaxValueCount(-1);
-
-		// font-size
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_SIZE);
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_ABSOLUTE_SIZE));
-		prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_RELATIVE_SIZE));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		prop.appendChild(IValID.V_ALL);
-		prop.setMaxValueCount(-1);
-
-		// unicode-range
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_UNICODE_RANGE);
-		prop.appendChild(PropCMURange.getInstanceOf(PropCMURange.VAL_URANGE));
-		prop.setMaxValueCount(-1);
-
-		// units-per-em
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_UNITS_PER_EM);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
-		// src
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_SRC);
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_FORMAT));
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_LOCAL));
-		prop.setMaxValueCount(-1);
-
-		// panose-1
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_PANOSE_1);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
-		prop.setMaxValueCount(10);
-
-		// stemv
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_STEMV);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
-		// stemh
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_STEMH);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
-		// slope
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_SLOPE);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
-		// cap-height
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_CAP_HEIGHT);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
-		// x-height
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_X_HEIGHT);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
-		// ascent
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_ASCENT);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
-		// descent
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_DESCENT);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
-		// widths
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_WIDTHS);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-		prop.appendChild(PropCMURange.getInstanceOf(PropCMURange.VAL_URANGE));
-		prop.setMaxValueCount(-1);
-
-		// bbox
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_BBOX);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-		prop.setMaxValueCount(4);
-		prop.setMaxValueCount(4);
-
-		// definition-src
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_DEFINITION_SRC);
-		prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
-
-		// baseline
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_BASELINE);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
-		// centerline
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_CENTERLINE);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
-		// mathline
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_MATHLINE);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
-		// topline
-		prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_TOPLINE);
-		prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
-		/** ******** containers ********* */
-
-		// absolute-size
-		PropCMContainer cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_ABSOLUTE_SIZE);
-		cont.appendChild(IValID.V_XX_SMALL);
-		cont.appendChild(IValID.V_X_SMALL);
-		cont.appendChild(IValID.V_SMALL);
-		cont.appendChild(IValID.V_MEDIUM);
-		cont.appendChild(IValID.V_LARGE);
-		cont.appendChild(IValID.V_X_LARGE);
-		cont.appendChild(IValID.V_XX_LARGE);
-
-		// border-style
-		cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE);
-		cont.appendChild(IValID.V_SOLID);
-		cont.appendChild(IValID.V_DASHED);
-		cont.appendChild(IValID.V_DOTTED);
-		cont.appendChild(IValID.V_DOUBLE);
-		cont.appendChild(IValID.V_GROOVE);
-		cont.appendChild(IValID.V_RIDGE);
-		cont.appendChild(IValID.V_INSET);
-		cont.appendChild(IValID.V_OUTSET);
-		cont.appendChild(IValID.V_HIDDEN);
-		cont.appendChild(IValID.V_NONE);
-
-		// border-width
-		cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH);
-		cont.appendChild(IValID.V_THIN);
-		cont.appendChild(IValID.V_MEDIUM);
-		cont.appendChild(IValID.V_THICK);
-		cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-
-		// color
-		cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR);
-		cont.appendChild(IValID.V_AQUA);
-		cont.appendChild(IValID.V_BLACK);
-		cont.appendChild(IValID.V_BLUE);
-		cont.appendChild(IValID.V_FUCHSIA);
-		cont.appendChild(IValID.V_GRAY);
-		cont.appendChild(IValID.V_GREEN);
-		cont.appendChild(IValID.V_LIME);
-		cont.appendChild(IValID.V_MAROON);
-		cont.appendChild(IValID.V_NAVY);
-		cont.appendChild(IValID.V_OLIVE);
-		cont.appendChild(IValID.V_PURPLE);
-		cont.appendChild(IValID.V_RED);
-		cont.appendChild(IValID.V_SILVER);
-		cont.appendChild(IValID.V_TEAL);
-		cont.appendChild(IValID.V_WHITE);
-		cont.appendChild(IValID.V_YELLOW);
-		cont.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_SYSTEM_COLOR));
-		cont.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_RGB));
-		cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_HASH));
-
-		// system color
-		cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_SYSTEM_COLOR);
-		cont.appendChild(IValID.V_ACTIVEBORDER);
-		cont.appendChild(IValID.V_ACTIVECAPTION);
-		cont.appendChild(IValID.V_APPWORKSPACE);
-		cont.appendChild(IValID.V_BACKGROUND);
-		cont.appendChild(IValID.V_BUTTONFACE);
-		cont.appendChild(IValID.V_BUTTONHIGHLIGHT);
-		cont.appendChild(IValID.V_BUTTONSHADOW);
-		cont.appendChild(IValID.V_BUTTONTEXT);
-		cont.appendChild(IValID.V_CAPTIONTEXT);
-		cont.appendChild(IValID.V_GRAYTEXT);
-		cont.appendChild(IValID.V_HIGHLIGHT);
-		cont.appendChild(IValID.V_HIGHLIGHTTEXT);
-		cont.appendChild(IValID.V_INACTIVEBORDER);
-		cont.appendChild(IValID.V_INACTIVECAPTION);
-		cont.appendChild(IValID.V_INACTIVECAPTIONTEXT);
-		cont.appendChild(IValID.V_INFOBACKGROUND);
-		cont.appendChild(IValID.V_INFOTEXT);
-		cont.appendChild(IValID.V_MENU);
-		cont.appendChild(IValID.V_MENUTEXT);
-		cont.appendChild(IValID.V_SCROLLBAR);
-		cont.appendChild(IValID.V_THREEDDARKSHADOW);
-		cont.appendChild(IValID.V_THREEDFACE);
-		cont.appendChild(IValID.V_THREEDHIGHLIGHT);
-		cont.appendChild(IValID.V_THREEDLIGHTSHADOW);
-		cont.appendChild(IValID.V_THREEDSHADOW);
-		cont.appendChild(IValID.V_WINDOW);
-		cont.appendChild(IValID.V_WINDOWFRAME);
-		cont.appendChild(IValID.V_WINDOWTEXT);
-
-		// generic-family
-		cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_FAMILY);
-		cont.appendChild(IValID.V_SERIF);
-		cont.appendChild(IValID.V_SANS_SERIF);
-		cont.appendChild(IValID.V_CURSIVE);
-		cont.appendChild(IValID.V_FANTASY);
-		cont.appendChild(IValID.V_MONOSPACE);
-
-		// generic-voice
-		cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_VOICE);
-		cont.appendChild(IValID.V_MALE);
-		cont.appendChild(IValID.V_FEMALE);
-		cont.appendChild(IValID.V_CHILD);
-
-		// margin-width
-		cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH);
-		cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-		cont.appendChild(IValID.V_AUTO);
-
-		// padding-width
-		cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH);
-		cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-		cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-
-		// relative-size
-		cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_RELATIVE_SIZE);
-		cont.appendChild(IValID.V_SMALLER);
-		cont.appendChild(IValID.V_LARGER);
-
-		LOADING = 2;
-	}
-
-	/**
-	 * 
-	 */
-	protected static boolean isLoading() {
-		return LOADING == 1;
-	}
-
-	/**
-	 * 
-	 */
-	protected static boolean isNeedInitialize() {
-		return LOADING == 0;
-	}
-
-	/**
-	 * 
-	 */
-	public String toString() {
-		return getName();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNumber.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNumber.java
deleted file mode 100644
index 2fcccb0..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNumber.java
+++ /dev/null
@@ -1,219 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-
-/**
- * 
- */
-public class PropCMNumber extends PropCMNode {
-
-	private static java.util.Hashtable instances = null;
-	public final static java.lang.String VAL_ANGLE = "angle";//$NON-NLS-1$
-	public final static java.lang.String VAL_FREQUENCY = "frequency";//$NON-NLS-1$
-	public final static java.lang.String VAL_INTEGER = "integer";//$NON-NLS-1$
-	public final static java.lang.String VAL_LENGTH = "length";//$NON-NLS-1$
-	public final static java.lang.String VAL_PERCENTAGE = "percentage";//$NON-NLS-1$
-	public final static java.lang.String VAL_TIME = "time";//$NON-NLS-1$
-	public final static java.lang.String VAL_HASH = "hash"; //$NON-NLS-1$
-	public final static java.lang.String VAL_NUM = "number";//$NON-NLS-1$
-	public final static String DIM_CM = "cm";//$NON-NLS-1$
-	public final static String DIM_DEG = "deg";//$NON-NLS-1$
-	public final static String DIM_EMS = "em";//$NON-NLS-1$
-	public final static String DIM_EXS = "ex";//$NON-NLS-1$
-	public final static String DIM_GRAD = "grad";//$NON-NLS-1$
-	public final static String DIM_HASH = "#";//$NON-NLS-1$
-	public final static String DIM_HZ = "Hz";//$NON-NLS-1$
-	public final static String DIM_IN = "in";//$NON-NLS-1$
-	public final static String DIM_INTEGER = "INTEGER";//$NON-NLS-1$
-	public final static String DIM_KHZ = "kHz";//$NON-NLS-1$
-	public final static String DIM_MM = "mm";//$NON-NLS-1$
-	public final static String DIM_MS = "ms";//$NON-NLS-1$
-	public final static String DIM_NUMBER = "NUMBER";//$NON-NLS-1$
-	public final static String DIM_PC = "pc";//$NON-NLS-1$
-	public final static String DIM_PERCENTAGE = "%";//$NON-NLS-1$
-	public final static String DIM_PT = "pt";//$NON-NLS-1$
-	public final static String DIM_PX = "px";//$NON-NLS-1$
-	public final static String DIM_RAD = "rad";//$NON-NLS-1$
-	public final static String DIM_S = "s";//$NON-NLS-1$
-	private java.util.Vector fDims = new Vector();
-
-	/**
-	 * 
-	 */
-	protected PropCMNumber(String name) {
-		super(name);
-	}
-
-	/**
-	 * 
-	 */
-	public static String getDimension(short primitiveType) {
-		switch (primitiveType) {
-			case CSSPrimitiveValue.CSS_CM :
-				return DIM_CM;
-			case CSSPrimitiveValue.CSS_DEG :
-				return DIM_DEG;
-			case CSSPrimitiveValue.CSS_EMS :
-				return DIM_EMS;
-			case CSSPrimitiveValue.CSS_EXS :
-				return DIM_EXS;
-			case CSSPrimitiveValue.CSS_GRAD :
-				return DIM_GRAD;
-			case ICSSPrimitiveValue.CSS_HASH :
-				return DIM_HASH; // prefix dimension ....
-			case CSSPrimitiveValue.CSS_HZ :
-				return DIM_HZ;
-			case CSSPrimitiveValue.CSS_IN :
-				return DIM_IN;
-			case ICSSPrimitiveValue.CSS_INTEGER :
-				return "";//$NON-NLS-1$
-			case CSSPrimitiveValue.CSS_KHZ :
-				return DIM_KHZ;
-			case CSSPrimitiveValue.CSS_MM :
-				return DIM_MM;
-			case CSSPrimitiveValue.CSS_MS :
-				return DIM_MS;
-			case CSSPrimitiveValue.CSS_NUMBER :
-				return "";//$NON-NLS-1$
-			case CSSPrimitiveValue.CSS_PC :
-				return DIM_PC;
-			case CSSPrimitiveValue.CSS_PERCENTAGE :
-				return DIM_PERCENTAGE;
-			case CSSPrimitiveValue.CSS_PT :
-				return DIM_PT;
-			case CSSPrimitiveValue.CSS_PX :
-				return DIM_PX;
-			case CSSPrimitiveValue.CSS_RAD :
-				return DIM_RAD;
-			case CSSPrimitiveValue.CSS_S :
-				return DIM_S;
-		}
-
-		return null;
-	}
-
-	/**
-	 * 
-	 */
-	public Set getDimensions() {
-		HashSet vals = new HashSet();
-		Iterator it = fDims.iterator();
-		while (it.hasNext()) {
-			vals.add(it.next());
-		}
-
-		return vals;
-	}
-
-	/**
-	 * 
-	 */
-	void getIdentifiers(Set indents) {
-	}
-
-	/**
-	 * 
-	 */
-	static public PropCMNumber getInstanceOf(String name) {
-		if (name == null)
-			return null;
-
-		// initialize
-		if (instances == null)
-			instances = new Hashtable(20);
-
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		// query
-		Object node = instances.get(name);
-		if (node != null)
-			return (PropCMNumber) node;
-
-		// register
-		if (PropCMNode.isLoading()) {
-			node = new PropCMNumber(name);
-			instances.put(name, node);
-		}
-
-		return (PropCMNumber) node;
-	}
-
-	/**
-	 * 
-	 */
-	public short getType() {
-		return VAL_NUMBER;
-	}
-
-	/**
-	 * 
-	 */
-	void getValues(Collection values) {
-		if (values != null && !values.contains(this))
-			values.add(this);
-	}
-
-	/**
-	 * 
-	 */
-	static void initNumberCMDim() {
-		PropCMNumber num = getInstanceOf(VAL_ANGLE);
-		num.fDims.add(DIM_DEG);
-		num.fDims.add(DIM_GRAD);
-		num.fDims.add(DIM_RAD);
-
-		num = getInstanceOf(VAL_FREQUENCY);
-		num.fDims.add(DIM_HZ);
-		num.fDims.add(DIM_KHZ);
-
-		num = getInstanceOf(VAL_HASH);
-		num.fDims.add(DIM_HASH);
-
-		// num = getInstanceOf(VAL_INTEGER);
-		// num.fDims.add(DIM_INTEGER);
-
-		num = getInstanceOf(VAL_LENGTH);
-		num.fDims.add(DIM_CM);
-		num.fDims.add(DIM_EMS);
-		num.fDims.add(DIM_EXS);
-		num.fDims.add(DIM_IN);
-		num.fDims.add(DIM_MM);
-		num.fDims.add(DIM_PC);
-		num.fDims.add(DIM_PT);
-		num.fDims.add(DIM_PX);
-
-		// num = getInstanceOf(VAL_NUMBER);
-		// num.fDims.add(DIM_NUMBER);
-
-		num = getInstanceOf(VAL_PERCENTAGE);
-		num.fDims.add(DIM_PERCENTAGE);
-
-		num = getInstanceOf(VAL_TIME);
-		num.fDims.add(DIM_MS);
-		num.fDims.add(DIM_S);
-
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMProperty.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMProperty.java
deleted file mode 100644
index bbab38f..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMProperty.java
+++ /dev/null
@@ -1,417 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-/**
- * 
- */
-public class PropCMProperty extends PropCMContainer {
-
-	// static fields
-	private static java.util.Hashtable instances = null;
-	private static java.util.Hashtable cachedIdMap = null;
-	public final static String P_AZIMUTH = "azimuth";//$NON-NLS-1$
-	public final static String P_BG = "background";//$NON-NLS-1$
-	public final static String P_BG_ATTACHMENT = "background-attachment";//$NON-NLS-1$
-	public final static String P_BG_COLOR = "background-color";//$NON-NLS-1$
-	public final static String P_BG_IMAGE = "background-image";//$NON-NLS-1$
-	public final static String P_BG_POSITION = "background-position";//$NON-NLS-1$
-	public final static String P_BG_REPEAT = "background-repeat";//$NON-NLS-1$
-	public final static String P_BORDER = "border";//$NON-NLS-1$
-	public final static String P_BORDER_COLLAPSE = "border-collapse";//$NON-NLS-1$
-	public final static String P_BORDER_COLOR = "border-color";//$NON-NLS-1$
-	public final static String P_BORDER_SPACING = "border-spacing";//$NON-NLS-1$
-	public final static String P_BORDER_STYLE = "border-style";//$NON-NLS-1$
-	public final static String P_BORDER_TOP = "border-top";//$NON-NLS-1$
-	public final static String P_BORDER_RIGHT = "border-right";//$NON-NLS-1$
-	public final static String P_BORDER_BOTTOM = "border-bottom";//$NON-NLS-1$
-	public final static String P_BORDER_LEFT = "border-left";//$NON-NLS-1$
-	public final static String P_BORDER_TOP_COLOR = "border-top-color";//$NON-NLS-1$
-	public final static String P_BORDER_RIGHT_COLOR = "border-right-color";//$NON-NLS-1$
-	public final static String P_BORDER_BOTTOM_COLOR = "border-bottom-color";//$NON-NLS-1$
-	public final static String P_BORDER_LEFT_COLOR = "border-left-color";//$NON-NLS-1$
-	public final static String P_BORDER_TOP_STYLE = "border-top-style";//$NON-NLS-1$
-	public final static String P_BORDER_RIGHT_STYLE = "border-right-style";//$NON-NLS-1$
-	public final static String P_BORDER_BOTTOM_STYLE = "border-bottom-style";//$NON-NLS-1$
-	public final static String P_BORDER_LEFT_STYLE = "border-left-style";//$NON-NLS-1$
-	public final static String P_BORDER_TOP_WIDTH = "border-top-width";//$NON-NLS-1$
-	public final static String P_BORDER_RIGHT_WIDTH = "border-right-width";//$NON-NLS-1$
-	public final static String P_BORDER_BOTTOM_WIDTH = "border-bottom-width";//$NON-NLS-1$
-	public final static String P_BORDER_LEFT_WIDTH = "border-left-width";//$NON-NLS-1$
-	public final static String P_BORDER_WIDTH = "border-width";//$NON-NLS-1$
-	public final static String P_BOTTOM = "bottom";//$NON-NLS-1$
-	public final static String P_CAPTION_SIDE = "caption-side";//$NON-NLS-1$
-	public final static String P_CLEAR = "clear";//$NON-NLS-1$
-	public final static String P_CLIP = "clip";//$NON-NLS-1$
-	public final static String P_COLOR = "color";//$NON-NLS-1$
-	public final static String P_CONTENT = "content";//$NON-NLS-1$
-	public final static String P_COUNTER_INCREMENT = "counter-increment";//$NON-NLS-1$
-	public final static String P_COUNTER_RESET = "counter-reset";//$NON-NLS-1$
-	public final static String P_CUE = "cue";//$NON-NLS-1$
-	public final static String P_CUE_AFTER = "cue-after";//$NON-NLS-1$
-	public final static String P_CUE_BEFORE = "cue-before";//$NON-NLS-1$
-	public final static String P_CURSOR = "cursor";//$NON-NLS-1$
-	public final static String P_DIRECTION = "direction";//$NON-NLS-1$
-	public final static String P_DISPLAY = "display";//$NON-NLS-1$
-	public final static String P_ELEVATION = "elevation";//$NON-NLS-1$
-	public final static String P_EMPTY_CELLS = "empty-cells";//$NON-NLS-1$
-	public final static String P_FLOAT = "float";//$NON-NLS-1$
-	public final static String P_FONT = "font";//$NON-NLS-1$
-	public final static String P_FONT_FAMILY = "font-family";//$NON-NLS-1$
-	public final static String P_FONT_SIZE = "font-size";//$NON-NLS-1$
-	public final static String P_FONT_SIZE_ADJUST = "font-size-adjust";//$NON-NLS-1$
-	public final static String P_FONT_STRETCH = "font-stretch";//$NON-NLS-1$
-	public final static String P_FONT_STYLE = "font-style";//$NON-NLS-1$
-	public final static String P_FONT_VARIANT = "font-variant";//$NON-NLS-1$
-	public final static String P_FONT_WEIGHT = "font-weight";//$NON-NLS-1$
-	public final static String P_HEIGHT = "height";//$NON-NLS-1$
-	public final static String P_LEFT = "left";//$NON-NLS-1$
-	public final static String P_LETTER_SPACING = "letter-spacing";//$NON-NLS-1$
-	public final static String P_LINE_HEIGHT = "line-height";//$NON-NLS-1$
-	public final static String P_LIST_STYLE = "list-style";//$NON-NLS-1$
-	public final static String P_LIST_STYLE_IMAGE = "list-style-image";//$NON-NLS-1$
-	public final static String P_LIST_STYLE_POSITION = "list-style-position";//$NON-NLS-1$
-	public final static String P_LIST_STYLE_TYPE = "list-style-type";//$NON-NLS-1$
-	public final static String P_MARGIN = "margin";//$NON-NLS-1$
-	public final static String P_MARGIN_TOP = "margin-top";//$NON-NLS-1$
-	public final static String P_MARGIN_RIGHT = "margin-right";//$NON-NLS-1$
-	public final static String P_MARGIN_BOTTOM = "margin-bottom";//$NON-NLS-1$
-	public final static String P_MARGIN_LEFT = "margin-left";//$NON-NLS-1$
-	public final static String P_MARKER_OFFSET = "marker-offset";//$NON-NLS-1$
-	public final static String P_MARKS = "marks";//$NON-NLS-1$
-	public final static String P_MAX_HEIGHT = "max-height";//$NON-NLS-1$
-	public final static String P_MAX_WIDTH = "max-width";//$NON-NLS-1$
-	public final static String P_MIN_HEIGHT = "min-height";//$NON-NLS-1$
-	public final static String P_MIN_WIDTH = "min-width";//$NON-NLS-1$
-	public final static String P_ORPHANS = "orphans";//$NON-NLS-1$
-	public final static String P_OUTLINE = "outline";//$NON-NLS-1$
-	public final static String P_OUTLINE_COLOR = "outline-color";//$NON-NLS-1$
-	public final static String P_OUTLINE_STYLE = "outline-style";//$NON-NLS-1$
-	public final static String P_OUTLINE_WIDTH = "outline-width";//$NON-NLS-1$
-	public final static String P_OVERFLOW = "overflow";//$NON-NLS-1$
-	public final static String P_PADDING = "padding";//$NON-NLS-1$
-	public final static String P_PADDING_TOP = "padding-top";//$NON-NLS-1$
-	public final static String P_PADDING_RIGHT = "padding-right";//$NON-NLS-1$
-	public final static String P_PADDING_BOTTOM = "padding-bottom";//$NON-NLS-1$
-	public final static String P_PADDING_LEFT = "padding-left";//$NON-NLS-1$
-	public final static String P_PAGE = "page";//$NON-NLS-1$
-	public final static String P_PAGE_BREAK_AFTER = "page-break-after";//$NON-NLS-1$
-	public final static String P_PAGE_BREAK_BEFORE = "page-break-before";//$NON-NLS-1$
-	public final static String P_PAGE_BREAK_INSIDE = "page-break-inside";//$NON-NLS-1$
-	public final static String P_PAUSE = "pause";//$NON-NLS-1$
-	public final static String P_PAUSE_AFTER = "pause-after";//$NON-NLS-1$
-	public final static String P_PAUSE_BEFORE = "pause-before";//$NON-NLS-1$
-	public final static String P_PITCH = "pitch";//$NON-NLS-1$
-	public final static String P_PITCH_RANGE = "pitch-range";//$NON-NLS-1$
-	public final static String P_PLAY_DURING = "play-during";//$NON-NLS-1$
-	public final static String P_POSITION = "position";//$NON-NLS-1$
-	public final static String P_QUOTES = "quotes";//$NON-NLS-1$
-	public final static String P_RICHNESS = "richness";//$NON-NLS-1$
-	public final static String P_RIGHT = "right";//$NON-NLS-1$
-	public final static String P_SIZE = "size";//$NON-NLS-1$
-	public final static String P_SPEAK = "speak";//$NON-NLS-1$
-	public final static String P_SPEAK_HEADER = "speak-header";//$NON-NLS-1$
-	public final static String P_SPEAK_NUMERAL = "speak-numeral";//$NON-NLS-1$
-	public final static String P_SPEAK_PUNCTUATION = "speak-punctuation";//$NON-NLS-1$
-	public final static String P_SPEECH_RATE = "speech-rate";//$NON-NLS-1$
-	public final static String P_STRESS = "stress";//$NON-NLS-1$
-	public final static String P_TABLE_LAYOUT = "table-layout";//$NON-NLS-1$
-	public final static String P_TEXT_ALIGN = "text-align";//$NON-NLS-1$
-	public final static String P_TEXT_DECORATION = "text-decoration";//$NON-NLS-1$
-	public final static String P_TEXT_INDENT = "text-indent";//$NON-NLS-1$
-	public final static String P_TEXT_SHADOW = "text-shadow";//$NON-NLS-1$
-	public final static String P_TEXT_TRANSFORM = "text-transform";//$NON-NLS-1$
-	public final static String P_TOP = "top";//$NON-NLS-1$
-	public final static String P_UNICODE_BIDI = "unicode-bidi";//$NON-NLS-1$
-	public final static String P_VERTICAL_ALIGN = "vertical-align";//$NON-NLS-1$
-	public final static String P_VISIBILITY = "visibility";//$NON-NLS-1$
-	public final static String P_VOICE_FAMILY = "voice-family";//$NON-NLS-1$
-	public final static String P_VOLUME = "volume";//$NON-NLS-1$
-	public final static String P_WHITE_SPACE = "white-space";//$NON-NLS-1$
-	public final static String P_WIDOWS = "widows";//$NON-NLS-1$
-	public final static String P_WIDTH = "width";//$NON-NLS-1$
-	public final static String P_WORD_SPACING = "word-spacing";//$NON-NLS-1$
-	public final static String P_Z_INDEX = "z-index";//$NON-NLS-1$
-	// instance fields
-	private int fMinValueCount = 1;
-	private int fMaxValueCount = 1;
-	private Object[] mediaGroups;
-	protected List containers;
-
-	/**
-	 * 
-	 */
-	protected PropCMProperty(String name) {
-		super(name);
-	}
-
-	/**
-	 * 
-	 */
-	Object appendChild(Object node) {
-		Object ret = super.appendChild(node);
-		if (node instanceof PropCMProperty) {
-			// register shorthand container
-			PropCMProperty cm = (PropCMProperty) node;
-			if (cm.containers == null)
-				cm.containers = new Vector();
-			if (!cm.containers.contains(this))
-				cm.containers.add(this);
-		}
-		return ret;
-	}
-
-	/**
-	 * 
-	 */
-	void appendMediaGroup(Object mg) {
-		if (mediaGroups == null)
-			mediaGroups = new Object[1];
-		else {
-			Object[] oldMediaGroups = mediaGroups;
-			mediaGroups = new Object[oldMediaGroups.length + 1];
-			System.arraycopy(oldMediaGroups, 0, mediaGroups, 0, oldMediaGroups.length);
-		}
-		mediaGroups[mediaGroups.length - 1] = mg;
-	}
-
-	/**
-	 * 
-	 */
-	public static PropCMProperty getInstanceOf(String name) {
-		// initialize
-		if (instances == null)
-			instances = new Hashtable(200);
-
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		// query
-		Object node = instances.get(name);
-		if (node != null)
-			return (PropCMProperty) node;
-
-		// register
-		if (PropCMNode.isLoading()) {
-			node = new PropCMProperty(name);
-			instances.put(name, node);
-		}
-
-		return (PropCMProperty) node;
-	}
-
-	/**
-	 * 
-	 */
-	public int getMaxValueCount() {
-		return fMaxValueCount;
-	}
-
-	/**
-	 * 
-	 */
-	public List getMediaGroups() {
-		if (mediaGroups != null)
-			return Arrays.asList(mediaGroups);
-		else
-			return new ArrayList();
-	}
-
-	/**
-	 * 
-	 */
-	public int getMinValueCount() {
-		return fMinValueCount;
-	}
-
-	/**
-	 * 
-	 */
-	public static Enumeration getNameEnum() {
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		return instances.keys();
-	}
-
-	/**
-	 * 
-	 */
-	public static Enumeration getPropertyEnum() {
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		return instances.elements();
-	}
-
-	/**
-	 * 
-	 */
-	public int getShorthandContainerCount() {
-		return (containers == null) ? 0 : containers.size();
-	}
-
-	/**
-	 * 
-	 */
-	public short getType() {
-		return VAL_PROPERTY;
-	}
-
-	/**
-	 * 
-	 */
-	public boolean isShorthand() {
-		int nChild = getNumChild();
-		for (int i = 0; i < nChild; i++) {
-			Object obj = getChildAt(i);
-			if (obj instanceof PropCMProperty && !(obj instanceof PropCMSubProperty))
-				return true;
-		}
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	public static Vector names() {
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		return new Vector(instances.keySet());
-	}
-
-	/**
-	 * 
-	 */
-	public static List names(Object mediaGroup) {
-		if (mediaGroup == null)
-			return names();
-
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		Vector properties = new Vector();
-
-		Iterator it = instances.values().iterator();
-		while (it.hasNext()) {
-			PropCMProperty prop = (PropCMProperty) it.next();
-			if (prop.getMediaGroups().contains(mediaGroup))
-				properties.add(prop.getName());
-		}
-
-		return properties;
-	}
-
-	/**
-	 * If identifier is null, get all properties
-	 */
-	public static Vector propertiesFor(String identifier, boolean shorthands) {
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		// if identifier is null, get all properties
-		if (identifier == null)
-			return new Vector(instances.values());
-
-		if (cachedIdMap == null) {
-			// start cacheing
-			cachedIdMap = new Hashtable();
-		}
-		else {
-			// search cached
-			Object ret = cachedIdMap.get(identifier + String.valueOf(shorthands));
-			if (ret != null)
-				return new Vector((Collection) ret);
-		}
-
-		// create
-		Enumeration propertyEnum = getPropertyEnum();
-		HashSet set = new HashSet();
-		while (propertyEnum.hasMoreElements()) {
-			PropCMProperty prop = (PropCMProperty) propertyEnum.nextElement();
-			if (!shorthands && prop.isShorthand())
-				continue;
-			if (prop.canHave(identifier))
-				set.add(prop);
-		}
-
-		// cache
-		cachedIdMap.put(identifier + String.valueOf(shorthands), set);
-
-		return new Vector(set);
-	}
-
-	/**
-	 * 
-	 */
-	protected void setMaxValueCount(int newMaxValueCount) {
-		fMaxValueCount = newMaxValueCount;
-	}
-
-	/**
-	 * 
-	 */
-	protected void setMinValueCount(int newMinValueCount) {
-		fMinValueCount = newMinValueCount;
-	}
-
-	/**
-	 * 
-	 */
-	public PropCMProperty shorthandContainerAt(int i) {
-		if (containers == null)
-			return null;
-		if (i < 0 || containers.size() <= i)
-			return null;
-		return (PropCMProperty) containers.get(i);
-	}
-
-	/**
-	 * 
-	 */
-	public Iterator shorthandContainerIterator() {
-		if (containers == null) {
-			return new Iterator() {
-				public boolean hasNext() {
-					return false;
-				}
-
-				public Object next() {
-					return null;
-				}
-
-				public void remove() {
-				}
-			};
-		}
-		else
-			return containers.iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMString.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMString.java
deleted file mode 100644
index 61b30c3..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMString.java
+++ /dev/null
@@ -1,85 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Set;
-
-/**
- * 
- */
-public class PropCMString extends PropCMNode {
-
-	private static java.util.Hashtable instances = null;
-	public final static java.lang.String VAL_FONT = "font";//$NON-NLS-1$
-	public final static java.lang.String VAL_COUNTER_ID = "counterId";//$NON-NLS-1$
-	public final static java.lang.String VAL_PAGE_ID = "pageId";//$NON-NLS-1$
-	public final static java.lang.String VAL_VOICE = "voice";//$NON-NLS-1$
-	public final static java.lang.String VAL_ANY = "any"; //$NON-NLS-1$
-
-	/**
-	 * 
-	 */
-	protected PropCMString(String name) {
-		super(name);
-	}
-
-	/**
-	 * 
-	 */
-	void getIdentifiers(Set indents) {
-	}
-
-	/**
-	 * 
-	 */
-	static public PropCMString getInstanceOf(String name) {
-		if (name == null)
-			return null;
-
-		// initialize
-		if (instances == null)
-			instances = new Hashtable(10);
-
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		// query
-		Object node = instances.get(name);
-		if (node != null)
-			return (PropCMString) node;
-
-		// register
-		node = new PropCMString(name);
-		instances.put(name, node);
-
-		return (PropCMString) node;
-	}
-
-	/**
-	 * 
-	 */
-	public short getType() {
-		return VAL_STRING;
-	}
-
-	/**
-	 * 
-	 */
-	void getValues(Collection values) {
-		if (values != null && !values.contains(this))
-			values.add(this);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMSubProperty.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMSubProperty.java
deleted file mode 100644
index 81ebb37..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMSubProperty.java
+++ /dev/null
@@ -1,122 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-/**
- * 
- */
-public class PropCMSubProperty extends PropCMProperty {
-
-	// static fields
-	private static java.util.Hashtable instances = null;
-	public final static String PSUB_BG_POSITION_X = "background-positionH";//$NON-NLS-1$
-	public final static String PSUB_BG_POSITION_Y = "background-positionV";//$NON-NLS-1$
-	public final static String PSUB_CLIP_TOP = "clipTop";//$NON-NLS-1$
-	public final static String PSUB_CLIP_RIGHT = "clipRight";//$NON-NLS-1$
-	public final static String PSUB_CLIP_BOTTOM = "clipBottom";//$NON-NLS-1$
-	public final static String PSUB_CLIP_LEFT = "clipLeft";//$NON-NLS-1$
-
-	/**
-	 * 
-	 */
-	protected PropCMSubProperty(String name) {
-		super(name);
-	}
-
-	/**
-	 * 
-	 */
-	public PropCMProperty getContainer() {
-		return shorthandContainerAt(0);
-	}
-
-	/**
-	 * 
-	 */
-	public static PropCMProperty getInstanceOf(String name) {
-		// initialize
-		if (instances == null)
-			instances = new Hashtable(10);
-
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		// query
-		Object node = instances.get(name);
-		if (node != null)
-			return (PropCMProperty) node;
-
-		// register
-		if (PropCMNode.isLoading()) {
-			node = new PropCMSubProperty(name);
-			instances.put(name, node);
-		}
-
-		return (PropCMProperty) node;
-	}
-
-	/**
-	 * 
-	 */
-	public static Enumeration getNameEnum() {
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		return instances.keys();
-	}
-
-	/**
-	 * 
-	 */
-	public static Enumeration getPropertyEnum() {
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		return instances.elements();
-	}
-
-	/**
-	 * 
-	 */
-	public short getType() {
-		return VAL_SUBPROPERTY;
-	}
-
-	/**
-	 * 
-	 */
-	public static Vector names() {
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		return new Vector(instances.keySet());
-	}
-
-	/**
-	 * 
-	 */
-	public void setContainer(PropCMProperty prop) {
-		if (containers == null)
-			containers = new Vector();
-		containers.clear();
-		containers.add(prop);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMURange.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMURange.java
deleted file mode 100644
index 3375715..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMURange.java
+++ /dev/null
@@ -1,81 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Set;
-
-/**
- * 
- */
-public class PropCMURange extends PropCMNode {
-
-	private static java.util.Hashtable instances = null;
-	public final static String VAL_URANGE = "urange";//$NON-NLS-1$
-
-	/**
-	 * 
-	 */
-	protected PropCMURange(String name) {
-		super(name);
-	}
-
-	/**
-	 * 
-	 */
-	void getIdentifiers(Set indents) {
-	}
-
-	/**
-	 * 
-	 */
-	public static PropCMURange getInstanceOf(String name) {
-		if (name == null)
-			return null;
-
-		// initialize
-		if (instances == null)
-			instances = new Hashtable(10);
-
-		// Initialize of DB
-		if (isNeedInitialize())
-			PropCMNode.initPropertyCM();
-
-		// query
-		Object node = instances.get(name);
-		if (node != null)
-			return (PropCMURange) node;
-
-		// register
-		node = new PropCMURange(name);
-		instances.put(name, node);
-
-		return (PropCMURange) node;
-	}
-
-	/**
-	 * 
-	 */
-	public short getType() {
-		return VAL_UNICODE_RANGE;
-	}
-
-	/**
-	 * 
-	 */
-	void getValues(Collection values) {
-		if (values != null && !values.contains(this))
-			values.add(this);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMUtil.java
deleted file mode 100644
index 816ba37..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMUtil.java
+++ /dev/null
@@ -1,48 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * 
- */
-public class PropCMUtil {
-
-	/**
-	 * 
-	 */
-	public static void minus(Collection src, Collection ref) {
-		Iterator it = ref.iterator();
-		while (it.hasNext()) {
-			Object obj = it.next();
-			if (src.contains(obj))
-				src.remove(obj);
-		}
-		return;
-	}
-
-	/**
-	 * 
-	 */
-	public static void plus(Collection src, Collection ref) {
-		Iterator it = ref.iterator();
-		while (it.hasNext()) {
-			Object obj = it.next();
-			if (!src.contains(obj))
-				src.add(obj);
-		}
-		return;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ByteReader.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ByteReader.java
deleted file mode 100644
index 506cc1f..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ByteReader.java
+++ /dev/null
@@ -1,109 +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.css.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) {
-		this.fInputStream = inputStream;
-		if (!inputStream.markSupported()) {
-			throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
-		}
-		this.fBuffer = new byte[size];
-
-	}
-
-	public void close() throws IOException {
-		this.fInputStream.close();
-	}
-
-	public void mark(int readAheadLimit) {
-		this.fInputStream.mark(readAheadLimit);
-	}
-
-	public boolean markSupported() {
-		return true;
-	}
-
-	public int read() throws IOException {
-		int b0 = this.fInputStream.read();
-		return (b0 & 0x00FF);
-	}
-
-	public int read(char ch[], int offset, int length) throws IOException {
-		if (length > this.fBuffer.length) {
-			length = this.fBuffer.length;
-		}
-
-		int count = this.fInputStream.read(this.fBuffer, 0, length);
-
-		for (int i = 0; i < count; i++) {
-			int b0 = this.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 this.fInputStream.available() > 0;
-	}
-
-	public void reset() throws IOException {
-		this.fInputStream.reset();
-	}
-
-	public long skip(long n) throws IOException {
-		return this.fInputStream.skip(n);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizer.java
deleted file mode 100644
index 02da8cf..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizer.java
+++ /dev/null
@@ -1,1355 +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
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 1/27/04 6:42 PM */
-
-/*nlsXXX*/
-package org.eclipse.wst.css.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.informatik.tu-muenchen.de/~kleing/jflex/">JFlex </a> 1.2.2
- * on 1/27/04 6:42 PM from the specification file
- * <tt>file:/D:/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jflex</tt>
- */
-public class CSSHeadTokenizer {
-
-	/** this character denotes the end of file */
-	final public static int YYEOF = -1;
-
-	/** lexical states */
-	final public static int YYINITIAL = 0;
-	final public static int UnDelimitedString = 12;
-	final public static int DQ_STRING = 8;
-	final public static int SQ_STRING = 10;
-	final public static int ST_XMLDecl = 2;
-	final public static int QuotedAttributeValue = 6;
-	final public static int CHARSET_RULE = 4;
-
-	/**
-	 * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
-	 * YY_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 final static int YY_LEXSTATE[] = {0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7};
-
-	/**
-	 * Translates characters to character classes
-	 */
-	final private static String yycmap_packed = "\11\0\1\6\1\11\2\0\1\10\22\0\1\6\1\0\1\36\2\0" + "\1\41\1\0\1\37\7\0\1\40\13\0\1\35\1\12\1\7\1\34" + "\1\13\1\17\1\22\1\0\1\20\1\31\1\25\1\0\1\33\1\21" + "\1\32\2\0\1\16\1\15\1\27\1\30\2\0\1\23\1\24\1\26" + "\3\0\1\14\10\0\1\22\1\0\1\20\1\31\1\25\1\0\1\33" + "\1\21\1\32\2\0\1\16\1\15\1\27\1\30\2\0\1\23\1\24" + "\1\26\3\0\1\14\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
-	 */
-	final private static char[] yycmap = yy_unpack_cmap(yycmap_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", "Internal error: unknown state", "Error: could not match input", "Error: pushback value was too large"};
-
-	/** 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;
-
-
-	/** the number of characters up to the start of the matched text */
-	private int yychar;
-
-
-	/**
-	 * 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 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 CSSHeadTokenizer() {
-		super();
-	}
-
-	public void reset(Reader in) {
-		/* 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;
-
-
-		/* the number of characters up to the start of the matched text */
-		yychar = 0;
-
-
-		/**
-		 * yy_atBOL == true <=>the scanner is currently at the beginning of a
-		 * line
-		 */
-		yy_atBOL = false;
-
-		/* 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;
-
-
-		fStateStack.clear();
-
-		hasMore = true;
-
-		// its a little wasteful to "throw away" first char array generated
-		// by class init (via auto generated code), but we really do want
-		// a small buffer for our head parsers.
-		if (yy_buffer.length != MAX_TO_SCAN) {
-			yy_buffer = new char[MAX_TO_SCAN];
-		}
-
-
-	}
-
-
-	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 CSSHeadTokenizer(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 CSSHeadTokenizer(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[] 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 < 158) {
-			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.
-	 * 
-	 * @param errorCode
-	 *            the code of the errormessage to display
-	 */
-	private void yy_ScanError(int errorCode) {
-		try {
-			System.out.println(YY_ERROR_MSG[errorCode]);
-		}
-		catch (ArrayIndexOutOfBoundsException e) {
-			System.out.println(YY_ERROR_MSG[YY_UNKNOWN_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()!
-	 */
-	private void yypushback(int number) {
-		if (number > yylength())
-			yy_ScanError(YY_PUSHBACK_2BIG);
-
-		yy_markedPos -= number;
-	}
-
-
-	/**
-	 * 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;
-			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 IOException
-	 *                if any I/O-Error occurs
-	 */
-	public String primGetNextToken() throws java.io.IOException {
-		int yy_input;
-		int yy_action;
-
-
-		while (true) {
-
-			yychar += yylength();
-
-			yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos - 1] == '\n';
-			if (!yy_atBOL && yy_buffer[yy_markedPos - 1] == '\r') {
-				yy_atBOL = yy_advance() != '\n';
-				if (!yy_atEOF)
-					yy_currentPos--;
-			}
-
-			yy_action = -1;
-
-			yy_currentPos = yy_startRead = yy_markedPos;
-
-			if (yy_atBOL)
-				yy_state = YY_LEXSTATE[yy_lexical_state + 1];
-			else
-				yy_state = YY_LEXSTATE[yy_lexical_state];
-
-
-			yy_forAction : {
-				while (true) {
-
-					yy_input = yy_advance();
-
-					if (yy_input == YYEOF)
-						break yy_forAction;
-
-					yy_input = yycmap[yy_input];
-
-					boolean yy_isFinal = false;
-					boolean yy_noLookAhead = false;
-
-					yy_forNext : {
-						switch (yy_state) {
-							case 0 :
-								switch (yy_input) {
-									case 1 :
-										yy_isFinal = true;
-										yy_state = 9;
-										break yy_forNext;
-									case 2 :
-										yy_isFinal = true;
-										yy_state = 10;
-										break yy_forNext;
-									case 3 :
-										yy_isFinal = true;
-										yy_state = 11;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
-
-							case 1 :
-								switch (yy_input) {
-									case 1 :
-										yy_isFinal = true;
-										yy_state = 9;
-										break yy_forNext;
-									case 2 :
-										yy_isFinal = true;
-										yy_state = 10;
-										break yy_forNext;
-									case 3 :
-										yy_isFinal = true;
-										yy_state = 11;
-										break yy_forNext;
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 12;
-										break yy_forNext;
-									case 10 :
-										yy_isFinal = true;
-										yy_state = 13;
-										break yy_forNext;
-									case 15 :
-										yy_isFinal = true;
-										yy_state = 14;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
-
-							case 2 :
-								switch (yy_input) {
-									case 11 :
-										yy_isFinal = true;
-										yy_state = 15;
-										break yy_forNext;
-									case 21 :
-										yy_isFinal = true;
-										yy_state = 16;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
-
-							case 3 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 17;
-										break yy_forNext;
-									case 29 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 18;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
-
-							case 4 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-										yy_isFinal = true;
-										yy_state = 20;
-										break yy_forNext;
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 21;
-										break yy_forNext;
-									case 30 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 22;
-										break yy_forNext;
-									case 31 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 23;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 19;
-										break yy_forNext;
-								}
-
-							case 5 :
-								switch (yy_input) {
-									case 8 :
-									case 9 :
-									case 10 :
-									case 28 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 25;
-										break yy_forNext;
-									case 11 :
-									case 32 :
-										yy_isFinal = true;
-										yy_state = 26;
-										break yy_forNext;
-									case 29 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 27;
-										break yy_forNext;
-									case 30 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 28;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 24;
-										break yy_forNext;
-								}
-
-							case 6 :
-								switch (yy_input) {
-									case 8 :
-									case 9 :
-									case 10 :
-									case 28 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 25;
-										break yy_forNext;
-									case 32 :
-										yy_isFinal = true;
-										yy_state = 26;
-										break yy_forNext;
-									case 29 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 27;
-										break yy_forNext;
-									case 31 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 28;
-										break yy_forNext;
-									case 33 :
-										yy_isFinal = true;
-										yy_state = 29;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 24;
-										break yy_forNext;
-								}
-
-							case 7 :
-								switch (yy_input) {
-									case 10 :
-									case 28 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 25;
-										break yy_forNext;
-									case 32 :
-										yy_isFinal = true;
-										yy_state = 26;
-										break yy_forNext;
-									case 11 :
-										yy_isFinal = true;
-										yy_state = 29;
-										break yy_forNext;
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 30;
-										break yy_forNext;
-									case 29 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 31;
-										break yy_forNext;
-									case 30 :
-									case 31 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 32;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 24;
-										break yy_forNext;
-								}
-
-							case 9 :
-								switch (yy_input) {
-									case 2 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 33;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 10 :
-								switch (yy_input) {
-									case 1 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 34;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 11 :
-								switch (yy_input) {
-									case 4 :
-										yy_state = 35;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 12 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_state = 36;
-										break yy_forNext;
-									case 10 :
-										yy_state = 37;
-										break yy_forNext;
-									case 15 :
-										yy_state = 38;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 13 :
-								switch (yy_input) {
-									case 11 :
-										yy_state = 39;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 14 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 40;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 15 :
-								switch (yy_input) {
-									case 28 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 41;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 16 :
-								switch (yy_input) {
-									case 23 :
-										yy_state = 42;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 17 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 17;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 20 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-										yy_isFinal = true;
-										yy_state = 20;
-										break yy_forNext;
-									case 9 :
-										yy_state = 43;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 19;
-										break yy_forNext;
-								}
-
-							case 21 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-										yy_isFinal = true;
-										yy_state = 20;
-										break yy_forNext;
-									case 9 :
-										yy_state = 43;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 19;
-										break yy_forNext;
-								}
-
-							case 26 :
-								switch (yy_input) {
-									case 28 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 44;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 29 :
-								switch (yy_input) {
-									case 28 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 45;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 35 :
-								switch (yy_input) {
-									case 5 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 46;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 36 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_state = 36;
-										break yy_forNext;
-									case 10 :
-										yy_state = 37;
-										break yy_forNext;
-									case 15 :
-										yy_state = 38;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 37 :
-								switch (yy_input) {
-									case 11 :
-										yy_state = 39;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 38 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 40;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 39 :
-								switch (yy_input) {
-									case 12 :
-										yy_state = 47;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 40 :
-								switch (yy_input) {
-									case 17 :
-										yy_state = 48;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 42 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 49;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 43 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-										yy_isFinal = true;
-										yy_state = 20;
-										break yy_forNext;
-									case 9 :
-										yy_state = 43;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 19;
-										break yy_forNext;
-								}
-
-							case 47 :
-								switch (yy_input) {
-									case 13 :
-										yy_state = 50;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 48 :
-								switch (yy_input) {
-									case 18 :
-										yy_state = 51;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 49 :
-								switch (yy_input) {
-									case 24 :
-										yy_state = 52;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 50 :
-								switch (yy_input) {
-									case 14 :
-										yy_state = 53;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 51 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 54;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 52 :
-								switch (yy_input) {
-									case 25 :
-										yy_state = 55;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 53 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 56;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 54 :
-								switch (yy_input) {
-									case 20 :
-										yy_state = 57;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 55 :
-								switch (yy_input) {
-									case 26 :
-										yy_state = 58;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 56 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 56;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 57 :
-								switch (yy_input) {
-									case 21 :
-										yy_state = 59;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 58 :
-								switch (yy_input) {
-									case 23 :
-										yy_state = 60;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 59 :
-								switch (yy_input) {
-									case 22 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 61;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 60 :
-								switch (yy_input) {
-									case 27 :
-										yy_state = 62;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 62 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_state = 62;
-										break yy_forNext;
-									case 7 :
-										yy_isFinal = true;
-										yy_state = 63;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 63 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 63;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							default :
-								yy_ScanError(YY_ILLEGAL_STATE);
-								break;
-						}
-					}
-
-					if (yy_isFinal) {
-						yy_action = yy_state;
-						yy_markedPos = yy_currentPos;
-						if (yy_noLookAhead)
-							break yy_forAction;
-					}
-
-				}
-			}
-
-
-			switch (yy_action) {
-
-				case 45 : {
-					yypushback(2);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.InvalidTerminatedStringValue;
-				}
-				case 65 :
-					break;
-				case 25 : {
-					yypushback(1);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.InvalidTerminatedStringValue;
-				}
-				case 66 :
-					break;
-				case 19 :
-				case 20 : {
-					yypushback(1);
-					yybegin(UnDelimitedString);
-					string.setLength(0);
-				}
-				case 67 :
-					break;
-				case 18 : {
-					yybegin(YYINITIAL);
-					hasMore = false;
-					return CSSHeadTokenizerConstants.RuleEnd;
-				}
-				case 68 :
-					break;
-				case 32 : {
-					yypushback(1);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;
-				}
-				case 69 :
-					break;
-				case 44 : {
-					yypushback(2);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.InvalidTerminatedStringValue;
-				}
-				case 70 :
-					break;
-				case 61 : {
-					if (yychar == 0) {
-						yybegin(CHARSET_RULE);
-						return CSSHeadTokenizerConstants.CHARSET_RULE;
-					}
-				}
-				case 71 :
-					break;
-				case 56 : {
-					if (yychar == 0) {
-						yybegin(ST_XMLDecl);
-						return XMLHeadTokenizerConstants.XMLDeclStart;
-					}
-				}
-				case 72 :
-					break;
-				case 8 :
-				case 9 :
-				case 10 :
-				case 11 :
-				case 12 :
-				case 13 :
-				case 14 :
-				case 15 :
-				case 16 :
-				case 21 : {
-					if (yychar > MAX_TO_SCAN) {
-						hasMore = false;
-						return EncodingParserConstants.MAX_CHARS_REACHED;
-					}
-				}
-				case 73 :
-					break;
-				case 41 : {
-					yybegin(YYINITIAL);
-					return XMLHeadTokenizerConstants.XMLDeclEnd;
-				}
-				case 74 :
-					break;
-				case 63 : {
-					pushCurrentState();
-					yybegin(QuotedAttributeValue);
-					return XMLHeadTokenizerConstants.XMLDelEncoding;
-				}
-				case 75 :
-					break;
-				case 3 :
-				case 17 : {
-					pushCurrentState();
-					yybegin(QuotedAttributeValue);
-				}
-				case 76 :
-					break;
-				case 46 : {
-					hasMore = false;
-					return EncodingParserConstants.UTF83ByteBOM;
-				}
-				case 77 :
-					break;
-				case 33 : {
-					hasMore = false;
-					return EncodingParserConstants.UTF16BE;
-				}
-				case 78 :
-					break;
-				case 34 : {
-					hasMore = false;
-					return EncodingParserConstants.UTF16LE;
-				}
-				case 79 :
-					break;
-				case 24 :
-				case 26 :
-				case 29 : {
-					string.append(yytext());
-				}
-				case 80 :
-					break;
-				case 23 : {
-					yybegin(SQ_STRING);
-					string.setLength(0);
-				}
-				case 81 :
-					break;
-				case 22 : {
-					yybegin(DQ_STRING);
-					string.setLength(0);
-				}
-				case 82 :
-					break;
-				case 27 : {
-					yypushback(1);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.InvalidTerminatedStringValue;
-				}
-				case 83 :
-					break;
-				case 28 : {
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.StringValue;
-				}
-				case 84 :
-					break;
-				case 30 : {
-					yypushback(1);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.UnDelimitedStringValue;
-				}
-				case 85 :
-					break;
-				case 31 : {
-					yypushback(1);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.UnDelimitedStringValue;
-				}
-				case 86 :
-					break;
-				default :
-					if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
-						yy_atEOF = true;
-						yy_do_eof();
-						{
-							hasMore = false;
-							return EncodingParserConstants.EOF;
-						}
-					}
-					else {
-						yy_ScanError(YY_NO_MATCH);
-					}
-			}
-		}
-	}
-
-	/**
-	 * Runs the scanner on input files.
-	 * 
-	 * This main method is the debugging routine for the scanner. It prints
-	 * each returned token to System.out until the end of file is reached, or
-	 * an error occured.
-	 * 
-	 * @param argv
-	 *            the command line, contains the filenames to run the scanner
-	 *            on.
-	 */
-	public static void main(String argv[]) {
-		for (int i = 0; i < argv.length; i++) {
-			CSSHeadTokenizer scanner = null;
-			try {
-				scanner = new CSSHeadTokenizer(new java.io.FileReader(argv[i]));
-			}
-			catch (java.io.FileNotFoundException e) {
-				System.out.println("File not found : \"" + argv[i] + "\"");
-				System.exit(1);
-			}
-			catch (ArrayIndexOutOfBoundsException e) {
-				System.out.println("Usage : java CSSHeadTokenizer <inputfile>");
-				System.exit(1);
-			}
-
-			try {
-				do {
-					System.out.println(scanner.primGetNextToken());
-				}
-				while (!scanner.yy_atEOF);
-
-			}
-			catch (java.io.IOException e) {
-				System.out.println("An I/O error occured while scanning :");
-				System.out.println(e);
-				System.exit(1);
-			}
-			catch (Exception e) {
-				e.printStackTrace();
-				System.exit(1);
-			}
-		}
-	}
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizerConstants.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizerConstants.java
deleted file mode 100644
index 75446c7..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizerConstants.java
+++ /dev/null
@@ -1,19 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contenttype;
-
-
-public interface CSSHeadTokenizerConstants {
-
-	String RuleEnd = "RuleEnd"; //$NON-NLS-1$
-	String CHARSET_RULE = "CHARSET_RULE"; //$NON-NLS-1$
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java
deleted file mode 100644
index b6b6e68..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java
+++ /dev/null
@@ -1,368 +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
- *******************************************************************************/
-package org.eclipse.wst.css.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;
-import org.eclipse.wst.sse.core.internal.encoding.NonContentBasedEncodingRules;
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-
-
-
-public class CSSResourceEncodingDetector implements IResourceCharsetDetector {
-	class NullMemento extends EncodingMemento {
-		/**
-		 * 
-		 */
-		public NullMemento() {
-			super();
-			String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null);
-			setJavaCharsetName(defaultCharset);
-			setAppropriateDefault(defaultCharset);
-			setDetectedCharsetName(null);
-		}
-	}
-
-
-	private CSSHeadTokenizer fTokenizer;
-	private EncodingMemento fEncodingMemento;
-	private boolean fHeaderParsed;
-	private Reader fReader;
-
-	/**
-	 * There is no spec defined encoding for CSS, so Null is returned.
-	 */
-	public String getSpecDefaultEncoding() {
-		// should match what's in plugin.xml (or look it up from there).
-		return null;
-	}
-
-	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) {
-			canHandleAsUnicodeStream = true;
-			String enc = "UTF-16BE"; //$NON-NLS-1$
-			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
-		}
-		else if (tokenType == EncodingParserConstants.UTF16LE) {
-			canHandleAsUnicodeStream = true;
-			String enc = "UTF-16"; //$NON-NLS-1$
-			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
-		}
-		return canHandleAsUnicodeStream;
-	}
-
-	/**
-	 * @return Returns the tokenizer.
-	 */
-	private CSSHeadTokenizer getTokenizer() {
-		if (fTokenizer == null) {
-			fTokenizer = new CSSHeadTokenizer();
-		}
-		return fTokenizer;
-	}
-
-	private boolean isLegalString(String valueTokenType) {
-		boolean result = false;
-		if (valueTokenType != null) {
-			result = valueTokenType.equals(EncodingParserConstants.StringValue) || valueTokenType.equals(EncodingParserConstants.UnDelimitedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTerminatedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue);
-		}
-		return result;
-	}
-
-	private void parseInput() throws IOException {
-		checkInContents();
-		if (fEncodingMemento == null) {
-			checkHeuristics();
-		}
-	}
-
-	private void checkInContents() throws IOException {
-		CSSHeadTokenizer tokenizer = getTokenizer();
-		tokenizer.reset(fReader);
-		HeadParserToken token = null;
-		String tokenType = null;
-		do {
-			token = tokenizer.getNextToken();
-			tokenType = token.getType();
-			if (canHandleAsUnicodeStream(tokenType)) {
-				// side effect of canHandle is to create appropriate memento
-			}
-			else if (tokenType == CSSHeadTokenizerConstants.CHARSET_RULE) {
-				if (tokenizer.hasMoreTokens()) {
-					HeadParserToken valueToken = tokenizer.getNextToken();
-					String valueTokenType = valueToken.getType();
-					if (isLegalString(valueTokenType)) {
-						createEncodingMemento(valueToken.getText(), EncodingMemento.FOUND_ENCODING_IN_CONTENT);
-
-					}
-				}
-			}
-
-		}
-		while (tokenizer.hasMoreTokens());
-	}
-
-	/**
-	 * 
-	 */
-	private void checkHeuristics() throws IOException {
-		boolean noHeuristic = false;
-		String heuristicEncoding = null;
-		try {
-			fReader.reset();
-			byte[] bytes = new byte[3];
-			int nRead = 0;
-			for (int i = 0; i < bytes.length; i++) {
-				if (fReader.ready()) {
-					int oneByte = fReader.read();
-					nRead++;
-					if (oneByte <= 0xFF) {
-						bytes[i] = (byte) oneByte;
-					}
-					else {
-						noHeuristic = true;
-					}
-				}
-				else {
-					noHeuristic = true;
-					break;
-				}
-			}
-			if (!noHeuristic && nRead == 3) {
-				heuristicEncoding = EncodingGuesser.guessEncoding(bytes, 3);
-			}
-		}
-		catch (IOException e) {
-			// if any IO exception, then not a heuristic case
-		}
-		finally {
-			fReader.reset();
-		}
-		if (heuristicEncoding != null) {
-			createEncodingMemento(heuristicEncoding, EncodingMemento.GUESSED_ENCODING_FROM_STREAM);
-		}
-
-	}
-
-	/**
-	 * 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
-	 */
-	private void createEncodingMemento(String detectedCharsetName, String reason) {
-		createEncodingMemento(detectedCharsetName);
-	}
-
-	/**
-	 * convience method all subclasses can use (but not override)
-	 */
-	private final 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();
-	}
-
-	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;
-	}
-
-	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);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private 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);
-		}
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ContentDescriberForCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ContentDescriberForCSS.java
deleted file mode 100644
index ea0655b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ContentDescriberForCSS.java
+++ /dev/null
@@ -1,200 +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
- *******************************************************************************/
-package org.eclipse.wst.css.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 ContentDescriberForCSS implements ITextContentDescriber {
-	final private static QualifiedName[] SUPPORTED_OPTIONS = {IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK, IContentDescriptionExtended.DETECTED_CHARSET, IContentDescriptionExtended.UNSUPPORTED_CHARSET, IContentDescriptionExtended.APPROPRIATE_DEFAULT};
-
-	public int describe(InputStream contents, IContentDescription description) throws IOException {
-		int result = IContentDescriber.INDETERMINATE;
-
-		if (description == null) {
-			result = computeValidity(contents);
-		}
-		else {
-			calculateSupportedOptions(contents, description);
-			result = computeValidity(contents);
-		}
-		return result;
-	}
-
-	public int describe(Reader contents, IContentDescription description) throws IOException {
-		int result = IContentDescriber.INDETERMINATE;
-
-		if (description == null) {
-			result = computeValidity(contents);
-		}
-		else {
-			calculateSupportedOptions(contents, description);
-			result = computeValidity(contents);
-		}
-		return result;
-	}
-
-	public QualifiedName[] getSupportedOptions() {
-
-		return SUPPORTED_OPTIONS;
-	}
-
-	private void calculateSupportedOptions(InputStream contents, IContentDescription description) throws IOException {
-		if (isRelevent(description)) {
-			IResourceCharsetDetector detector = getDetector();
-			detector.set(contents);
-			handleCalculations(description, detector);
-		}
-	}
-
-	/**
-	 * @param contents
-	 * @param description
-	 * @throws IOException
-	 */
-	private void calculateSupportedOptions(Reader contents, IContentDescription description) throws IOException {
-		if (isRelevent(description)) {
-			IResourceCharsetDetector detector = getDetector();
-			detector.set(contents);
-			handleCalculations(description, detector);
-		}
-	}
-
-	private int computeValidity(InputStream inputStream) {
-		// currently no specific check for validilty
-		// based on contents.
-		return IContentDescriber.INDETERMINATE;
-	}
-
-	private int computeValidity(Reader reader) {
-		// currently no specific check for validilty
-		// based on contents.
-		return IContentDescriber.INDETERMINATE;
-	}
-
-	private IResourceCharsetDetector getDetector() {
-		return new CSSResourceEncodingDetector();
-	}
-
-	/**
-	 * @param description
-	 * @param detector
-	 * @throws IOException
-	 */
-	private void handleCalculations(IContentDescription description, IResourceCharsetDetector detector) throws IOException {
-		// note: if we're asked for one, we set them all. I need to be sure if
-		// called
-		// mulitiple times (one for each, say) that we don't waste time
-		// processing same
-		// content again.
-		EncodingMemento encodingMemento = ((CSSResourceEncodingDetector) detector).getEncodingMemento();
-		// 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 default.the
-				Object defaultCharset = getDetector().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, I'm assuming
-					description.setProperty(IContentDescription.CHARSET, javaCharset);
-				}
-			}
-		}
-
-	}
-
-	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) {
-
-			// 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;
-		// else if
-		// (description.isRequested(IContentDescriptionExtended.ENCODING_MEMENTO))
-		// result = true;
-		return result;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/EncodingGuesser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/EncodingGuesser.java
deleted file mode 100644
index 82f6e5c..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/EncodingGuesser.java
+++ /dev/null
@@ -1,173 +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.css.core.internal.contenttype;
-
-/**
- * 
- * This is ported from PageDesigner's hpbcom/Kanji.cpp's
- * Kanji::guess_kanji_code(),
- *  
- */
-public class EncodingGuesser {
-	private static final int ASCII = 0; // ASCII
-	// ISO-2022-JP
-	private static final int ASCII_IN = 8; // This is after ISO2022's change
-	// Shift-JIS
-	private static final int EUC_HALFKANA = 6; // This is Half Kana in EUC-JP
-	private static final int EUC_JP = 3; // This is EUC-JP
-	private static final int ISO2022_JP = 4; // This is ISO-2022-JP
-	private static final int JIS_HALFKANA = 7; // THis is Half Kana in
-	private static final byte KT_EUC1 = 0x40;
-	private static final byte KT_EUC2 = (byte) 0x80;
-	// ASCII
-	private static final byte KT_JIN = 0x01;
-	private static final byte KT_JOUT = 0x02;
-	//	private static final byte KT_ESC = 0x04;
-	//	private static final byte KT_JIS = 0x08;
-	private static final byte KT_SFT1 = 0x10;
-	private static final byte KT_SFT2 = 0x20;
-	private static final byte ktype[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00 */
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 10 */
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x09, 0x08, 0x08, 0x08, /* !"#$%&' *//* " */
-	0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* ()*+,-./ */
-	0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 01234567 */
-	0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 89:; <=>? */
-	0x29, 0x28, 0x2b, 0x28, 0x28, 0x28, 0x28, 0x28, /* @ABCDEFG */
-	0x2a, 0x28, 0x2a, 0x28, 0x28, 0x28, 0x28, 0x28, /* HIJKLMNO */
-	0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* PQRSTUVW */
-	0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* XYZ[\]^_ */
-	0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* abcdefg */
-	0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* hijklmno */
-	0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* pqrstuvw */
-	0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, /* xyz{|}~ */
-	0x20, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, /* 80 */
-	0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, /* 90 */
-	0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* A0 */
-	(byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* B0 */
-	(byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* C0 */
-	(byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* D0 */
-	(byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, /* E0 */
-	(byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, /* F0 */
-	(byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xc0, (byte) 0xc0, 0x00,};
-	//	private static final int ISO8859_1 = 1; // ISO-1
-	private static final int SHIFT_JIS = 2; // This is Shift-JIS
-	private static final int SJIS_HALFKANA = 5; // This is Half Kana in
-
-	/**
-	 * Currently, only Japanese encodings are supported.
-	 */
-	private static final int UNKNOWN = -1; // Unknown
-
-	/**
-	 * @return java.lang.String
-	 * @param code
-	 *            int
-	 * 
-	 * Convert private int to IANA Encoding name.
-	 */
-	private static String convertToIANAEncodingName(int code) {
-		String encoding = null;
-
-		switch (code) {
-			case SHIFT_JIS :
-			case SJIS_HALFKANA :
-				encoding = "Shift_JIS";//$NON-NLS-1$
-				break;
-			case EUC_JP :
-			case EUC_HALFKANA :
-				encoding = "EUC-JP";//$NON-NLS-1$
-				break;
-			case ISO2022_JP :
-			case JIS_HALFKANA :
-				encoding = "ISO-2022-JP";//$NON-NLS-1$
-			default :
-				break;
-		}
-
-		return encoding;
-	}
-
-	/**
-	 * Return guessed Java Encoding name target: bytes to be inspected length:
-	 * length of target
-	 */
-	public static String guessEncoding(byte[] target, int length) {
-		int code = UNKNOWN;
-
-		// Currently, only Japanese is supported.
-		String system_ctype = java.util.Locale.getDefault().getLanguage();
-		String jp_ctype = java.util.Locale.JAPANESE.getLanguage();
-		if (system_ctype.compareTo(jp_ctype) == 0) {
-			// Ok, I'm under ja_JP.
-			code = ASCII;
-			int pos = 0;
-			while ((code == ASCII) && (length > 0)) {
-				int ch1 = target[pos];
-				ch1 = ch1 & 0x000000FF;
-				int ch2 = (length >= 2) ? target[pos + 1] : 0;
-				ch2 = ch2 & 0x000000FF;
-				int ch3 = (length >= 3) ? target[pos + 2] : 0;
-				ch3 = ch3 & 0x000000FF;
-				code = guessJapaneseKanjiCode(ch1, ch2, ch3, 0);
-				pos++;
-				length--;
-			}
-			switch (code) {
-				case ISO2022_JP :
-				case JIS_HALFKANA :
-					code = ISO2022_JP;
-					break;
-				case EUC_JP :
-					code = EUC_JP;
-					break;
-				default :
-					code = SHIFT_JIS;
-			}
-		}
-		return (convertToIANAEncodingName(code));
-	}
-
-	/**
-	 * Guess the encoding. halfkana_flag = 0x01 ( detect SJIS half kana )
-	 * halfkana_flag = 0x02 ( detect EUC half kana )
-	 */
-	private static int guessJapaneseKanjiCode(int ch1, int ch2, int ch3, int halfkana_flag) {
-		boolean sjis_hankaku_flag = ((halfkana_flag & 0x01) != 0) ? true : false;
-		boolean euc_hankaku_flag = ((halfkana_flag & 0x02) != 0) ? true : false;
-
-		if (ch1 == 0)
-			return UNKNOWN;
-		if (sjis_hankaku_flag && ch1 >= 0xa1 && ch1 <= 0xdf)
-			return SJIS_HALFKANA;
-		else if (euc_hankaku_flag && ch1 == 0x8e && ch2 >= 0xa1 && ch2 <= 0xdf)
-			return EUC_HALFKANA;
-		else if (((ktype[ch1] & KT_SFT1) != 0) && ((ktype[ch2] & KT_SFT2) != 0))
-			return SHIFT_JIS;
-		else if (((ktype[ch1] & KT_EUC1) != 0) && ((ktype[ch2] & KT_EUC2) != 0))
-			return EUC_JP;
-		else if (ch1 == 0x1b && ((ktype[ch2] & KT_JIN) != 0))
-			return ISO2022_JP;
-		else if (ch1 >= 0xa1 && ch1 <= 0xdf)
-			return SJIS_HALFKANA;
-		else if (ch1 == 0x1b && ch2 == 0x28/* '(' */&& ch3 == 0x49/* 'I' */)
-			return JIS_HALFKANA;
-		else if (ch1 == 0x1b && ch2 == 0x28/* '(' */&& ((ktype[ch3] & KT_JOUT) != 0))
-			return ASCII_IN;
-
-		return ASCII;
-	}
-
-	public EncodingGuesser() {
-		super();
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/HeadParserToken.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/HeadParserToken.java
deleted file mode 100644
index 8821407..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/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.css.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.css.core/src/org/eclipse/wst/css/core/internal/contenttype/IntStack.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/IntStack.java
deleted file mode 100644
index 117136d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/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.css.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.css.core/src/org/eclipse/wst/css/core/internal/document/AbstractCSSNodeList.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/AbstractCSSNodeList.java
deleted file mode 100644
index 10949cc..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/AbstractCSSNodeList.java
+++ /dev/null
@@ -1,63 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-
-
-/**
- * 
- */
-abstract class AbstractCSSNodeList {
-
-	protected Vector nodes = null;
-
-	ICSSNode appendNode(ICSSNode node) {
-		if (node == null)
-			return null;
-		if (this.nodes == null)
-			this.nodes = new Vector();
-		this.nodes.addElement(node);
-		return node;
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getLength() {
-		if (this.nodes == null)
-			return 0;
-		return this.nodes.size();
-	}
-
-
-	protected ICSSNode itemImpl(int index) {
-		if (this.nodes == null)
-			return null;
-		if (index < 0 || index >= this.nodes.size())
-			return null;
-		return (ICSSNode) this.nodes.elementAt(index);
-	}
-
-
-	ICSSNode removeNode(int index) {
-		if (this.nodes == null)
-			return null; // no node
-		if (index < 0 || index >= this.nodes.size())
-			return null; // invalid parameter
-
-		ICSSNode removed = (ICSSNode) this.nodes.elementAt(index);
-		this.nodes.removeElementAt(index);
-		return removed;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSAttrImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSAttrImpl.java
deleted file mode 100644
index 471b452..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSAttrImpl.java
+++ /dev/null
@@ -1,133 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNamedNodeMap;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-
-/**
- * 
- */
-class CSSAttrImpl extends CSSRegionContainer implements ICSSAttr {
-
-	private String fName = null;
-	private String fValue = null;
-	private CSSNodeImpl ownerCSSNode = null;
-
-	CSSAttrImpl(CSSAttrImpl that) {
-		super(that);
-		this.fName = that.fName;
-		this.setValue(that.fValue);
-	}
-
-	/**
-	 * CSSAttr constructor comment.
-	 */
-	CSSAttrImpl(String name) {
-		super();
-		this.fName = name;
-	}
-
-	public ICSSNode cloneNode(boolean deep) {
-		return new CSSAttrImpl(this);
-	}
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.interfaces.ICSSNamedNodeMap
-	 */
-	public ICSSNamedNodeMap getAttributes() {
-		return null;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public java.lang.String getName() {
-		return fName;
-	}
-
-	/**
-	 * @return short
-	 */
-	public short getNodeType() {
-		return ATTR_NODE;
-	}
-
-	public ICSSNode getOwnerCSSNode() {
-		return ownerCSSNode;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public java.lang.String getValue() {
-		return fValue;
-	}
-
-	/**
-	 * @return boolean
-	 * @param name
-	 *            java.lang.String
-	 */
-	protected boolean matchName(String name) {
-		if (name == null)
-			return /* (this.name == null) */false;
-		if (this.fName == null)
-			return false;
-		return this.fName.equals(name);
-	}
-
-	/**
-	 * 
-	 */
-	protected void notifyValueChanged(String oldValue) {
-		if (this.ownerCSSNode == null)
-			return;
-
-		// for model
-		ICSSDocument doc = ownerCSSNode.getContainerDocument();
-		if (doc == null)
-			return;
-		CSSModelImpl model = (CSSModelImpl) doc.getModel();
-		if (model == null)
-			return;
-		model.valueChanged(this, oldValue);
-
-		// for adapters
-		String value = getValue();
-		this.ownerCSSNode.notify(CHANGE, this, oldValue, value, this.ownerCSSNode.getStartOffset());
-	}
-
-	/**
-	 * @param newName
-	 *            java.lang.String
-	 */
-	protected void setName(java.lang.String newName) {
-		fName = newName;
-	}
-
-	protected void setOwnerCSSNode(CSSNodeImpl newOwnerCSSNode) {
-		ownerCSSNode = newOwnerCSSNode;
-	}
-
-	/**
-	 * @param newValue
-	 *            java.lang.String
-	 */
-	public void setValue(java.lang.String newValue) {
-		String oldValue = fValue;
-		fValue = newValue;
-
-		notifyValueChanged(oldValue);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSCharsetRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSCharsetRuleImpl.java
deleted file mode 100644
index aec5d5e..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSCharsetRuleImpl.java
+++ /dev/null
@@ -1,79 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-
-
-/**
- * 
- */
-class CSSCharsetRuleImpl extends CSSRuleImpl implements ICSSCharsetRule {
-
-	/**
-	 * 
-	 */
-	CSSCharsetRuleImpl() {
-		super();
-	}
-
-	CSSCharsetRuleImpl(CSSCharsetRuleImpl that) {
-		super(that);
-	}
-
-	public ICSSNode cloneNode(boolean deep) {
-		CSSCharsetRuleImpl cloned = new CSSCharsetRuleImpl(this);
-
-		return cloned;
-	}
-
-	/**
-	 * The encoding information used in this <code>@charset</code> rule.
-	 * @exception org.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the specified encoding value has a
-	 *                syntax error and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this encoding
-	 *                rule is readonly.
-	 */
-	public String getEncoding() {
-		return CSSUtil.extractStringContents(getAttribute(ENCODING));
-	}
-
-	/**
-	 * @return short
-	 */
-	public short getNodeType() {
-		return CHARSETRULE_NODE;
-	}
-
-	/**
-	 * The type of the rule, as defined above. The expectation is that
-	 * binding-specific casting methods can be used to cast down from an
-	 * instance of the <code>CSSRule</code> interface to the specific
-	 * derived interface implied by the <code>type</code>.
-	 */
-	public short getType() {
-		return CHARSET_RULE;
-	}
-
-	public void setEncoding(String encoding) throws org.w3c.dom.DOMException {
-		String quote = CSSCorePlugin.getDefault().getPluginPreferences().getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-		String enc = CSSUtil.extractStringContents(encoding);
-		quote = CSSUtil.detectQuote(enc, quote);
-		setAttribute(ENCODING, quote + enc + quote);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java
deleted file mode 100644
index b35b7d5..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java
+++ /dev/null
@@ -1,1077 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICounter;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-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.TextRegionListImpl;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-
-/**
- * 
- */
-class CSSDeclarationItemParser {
-	/**
-	 * 
-	 */
-	final class FloatInfo {
-		/**
-		 * 
-		 */
-		FloatInfo(String text) {
-			parse(text);
-		}
-
-		/**
-		 * 
-		 */
-		void parse(String text) {
-			StringBuffer bufValue = new StringBuffer();
-			StringBuffer bufIdent = new StringBuffer();
-			boolean bNum = true;
-			int len = text.length();
-			for (int i = 0; i < len; i++) {
-				char c = text.charAt(i);
-				if (bNum) {
-					if ('0' <= c && c <= '9' || c == '.' || c == '+' || c == '-') {
-						bufValue.append(c);
-					}
-					else {
-						bufIdent.append(c);
-						bNum = false;
-					}
-				}
-				else {
-					bufIdent.append(c);
-				}
-			}
-			String valueStr = bufValue.toString();
-			fValue = Float.valueOf(valueStr).floatValue();
-			fIdentifier = bufIdent.toString();
-			fType = getFloatValueType(valueStr, fIdentifier);
-		}
-
-		/**
-		 * 
-		 */
-		float getValue() {
-			return fValue;
-		}
-
-		/**
-		 * 
-		 */
-		String getIdentifier() {
-			return fIdentifier;
-		}
-
-		/**
-		 * 
-		 */
-		short getValueType() {
-			return fType;
-		}
-
-		private float fValue = 0.0f;
-		private String fIdentifier = null;
-		private short fType = CSSPrimitiveValue.CSS_UNKNOWN;
-	}
-
-	final static int S_NORMAL = 0;
-	final static int S_FUNCTION = 1;
-	final static int S_FONT_SLASH = 2;
-	final static int S_COMMA_SEPARATION = 3;
-	private ICSSDocument fDocument = null;
-	private IStructuredDocumentRegion fParentRegion = null;
-	private boolean fTempStructuredDocument = false;
-	private CSSModelUpdateContext fUpdateContext = null;
-
-	/**
-	 * CSSDeclarationItemParser constructor comment.
-	 */
-	CSSDeclarationItemParser(ICSSDocument doc) {
-		super();
-		fDocument = doc;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSPrimitiveValueImpl createAttrValue(ITextRegionList regions) {
-		String funcName = getFunctionName(regions);
-		if (funcName == null || !funcName.toLowerCase().equals("attr")) { //$NON-NLS-1$
-			return null;
-		}
-		String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT};
-		ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
-		if (valueRegions.size() != 1) {
-			return null;
-		}
-
-		CSSPrimitiveValueImpl value = getCSSPrimitiveValue(CSSPrimitiveValue.CSS_ATTR);
-		if (value == null) {
-			return null;
-		}
-
-		ITextRegion region = valueRegions.get(0);
-		value.setValue(getText(region));
-
-		return value;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSPrimitiveValueImpl createCountersValue(ITextRegionList regions) {
-		String funcName = getFunctionName(regions);
-		if (funcName == null || !funcName.toLowerCase().equals("counters")) { //$NON-NLS-1$
-			return null;
-		}
-
-		String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT, CSSRegionContexts.CSS_DECLARATION_VALUE_STRING};
-		ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
-		int size = valueRegions.size();
-		if (size != 2 && size != 3) {
-			return null;
-		}
-
-		CounterImpl value = getCounter();
-		if (value == null) {
-			return null;
-		}
-
-		for (int i = 0; i < size; i++) {
-			ITextRegion region = valueRegions.get(i);
-			String text = getText(region);
-			CSSAttrImpl attr = null;
-			switch (i) {
-				case 0 :
-					value.setIdentifier(text);
-					attr = value.getAttributeNode(ICounter.IDENTIFIER);
-					break;
-				case 1 :
-					value.setSeparator(text);
-					attr = value.getAttributeNode(ICounter.SEPARATOR);
-					break;
-				case 2 :
-					value.setListStyle(text);
-					attr = value.getAttributeNode(ICounter.LISTSTYLE);
-					break;
-				default :
-					break;
-			}
-			if (attr != null) {
-				attr.setRangeRegion(fParentRegion, region, region);
-			}
-		}
-
-		return value;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSPrimitiveValueImpl createCounterValue(ITextRegionList regions) {
-		String funcName = getFunctionName(regions);
-		if (funcName == null || !funcName.toLowerCase().equals("counter")) { //$NON-NLS-1$
-			return null;
-		}
-
-		String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT};
-		ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
-		int size = valueRegions.size();
-		if (size != 1 && size != 2) {
-			return null;
-		}
-
-		CounterImpl value = getCounter();
-		if (value == null) {
-			return null;
-		}
-
-		for (int i = 0; i < size; i++) {
-			ITextRegion region = valueRegions.get(i);
-			String text = getText(region);
-			CSSAttrImpl attr = null;
-			switch (i) {
-				case 0 :
-					value.setIdentifier(text);
-					attr = value.getAttributeNode(ICounter.IDENTIFIER);
-					break;
-				case 1 :
-					value.setListStyle(text);
-					attr = value.getAttributeNode(ICounter.LISTSTYLE);
-					break;
-				default :
-					break;
-			}
-			if (attr != null) {
-				attr.setRangeRegion(fParentRegion, region, region);
-			}
-		}
-
-		return value;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSStyleDeclItemImpl createDeclarationItem(ITextRegionList nodeRegions) {
-		CSSStyleDeclItemImpl item = null;
-		String name = getPropertyName(nodeRegions);
-		if (name != null) {
-			item = getCSSStyleDeclItem(name);
-		}
-		return item;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSPrimitiveValueImpl createFloatValue(String text, String type) {
-		FloatInfo info = new FloatInfo(text);
-		CSSPrimitiveValueImpl value = getCSSPrimitiveValue(info.getValueType());
-		if (value != null) {
-			value.setValue(info.getValue());
-		}
-		return value;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSPrimitiveValueImpl createFormatValue(ITextRegionList regions) {
-		String funcName = getFunctionName(regions);
-		if (funcName == null || !funcName.toLowerCase().equals("format")) { //$NON-NLS-1$
-			return null;
-		}
-		String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_STRING};
-		ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
-		// format can take variable args.
-		if (valueRegions.size() == 0) {
-			return null;
-		}
-
-		CSSPrimitiveValueImpl value = getCSSPrimitiveValue(ICSSPrimitiveValue.CSS_FORMAT);
-		if (value == null) {
-			return null;
-		}
-
-		ITextRegion region = valueRegions.get(0);
-		value.setValue(CSSUtil.extractStringContents(getText(region)));
-
-		return value;
-
-	}
-
-	/**
-	 * 
-	 */
-	private CSSPrimitiveValueImpl createLocalValue(ITextRegionList regions) {
-		String funcName = getFunctionName(regions);
-		if (funcName == null || !funcName.toLowerCase().equals("local")) { //$NON-NLS-1$
-			return null;
-		}
-		String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_STRING};
-		ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
-		if (valueRegions.size() != 1) {
-			return null;
-		}
-
-		CSSPrimitiveValueImpl value = getCSSPrimitiveValue(ICSSPrimitiveValue.CSS_LOCAL);
-		if (value == null) {
-			return null;
-		}
-
-		ITextRegion region = valueRegions.get(0);
-		value.setValue(CSSUtil.extractStringContents(getText(region)));
-
-		return value;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSPrimitiveValueImpl createPrimitiveValue(ITextRegion region) {
-		if (region == null) {
-			return null;
-		}
-		CSSPrimitiveValueImpl value = null;
-		String type = region.getType();
-		String text = getText(region);
-		if (isBlank(type)) {
-			value = null;
-		}
-		else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || type == CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION || type == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE) {
-			value = createFloatValue(text, type);
-		}
-		else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_STRING || type == CSSRegionContexts.CSS_DECLARATION_VALUE_URI || type == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT || type == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-			value = createStringValue(text, type);
-		}
-
-		if (value == null) {
-			value = createStringValue(text, type);
-		}
-
-		if (!fTempStructuredDocument && value != null) {
-			value.setRangeRegion(fParentRegion, region, region);
-		}
-
-		return value;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSPrimitiveValueImpl createPrimitiveValue(ITextRegionList regions) {
-		CSSPrimitiveValueImpl value = null;
-		CSSUtil.stripSurroundingSpace(regions);
-		if (regions.isEmpty()) {
-			return null;
-		}
-		ITextRegion region = regions.get(0);
-		if (region == null) {
-			return null;
-		}
-		String type = region.getType();
-		if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-			String text = getText(region).toLowerCase();
-			if (text.equals("rgb(")) { //$NON-NLS-1$
-				value = createRgbValue(regions);
-			}
-			else if (text.equals("counter(")) { //$NON-NLS-1$
-				value = createCounterValue(regions);
-			}
-			else if (text.equals("counters(")) { //$NON-NLS-1$
-				value = createCountersValue(regions);
-			}
-			else if (text.equals("attr(")) { //$NON-NLS-1$
-				value = createAttrValue(regions);
-			}
-			else if (text.equals("format(")) { //$NON-NLS-1$
-				value = createFormatValue(regions);
-			}
-			else if (text.equals("local(")) { //$NON-NLS-1$
-				value = createLocalValue(regions);
-			}
-			else if (text.equals("rect(")) { //$NON-NLS-1$
-				value = createRectValue(regions);
-			}
-			if (value == null) {
-				value = createStringValue(regions);
-			}
-		}
-		else {
-			value = createStringValue(regions);
-		}
-
-		if (!fTempStructuredDocument && value != null) {
-			value.setRangeRegion(fParentRegion, regions.get(0), regions.get(regions.size() - 1));
-		}
-
-		return value;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSPrimitiveValueImpl createRectValue(ITextRegionList regions) {
-		String funcName = getFunctionName(regions);
-		if (funcName == null || !funcName.toLowerCase().equals("rect")) { //$NON-NLS-1$
-			return null;
-		}
-		String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER, CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION, CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT}; // IDENT:
-																																												// for
-																																												// 'auto'
-		ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
-		if (valueRegions.size() != 4) {
-			return null;
-		}
-
-		RectImpl value = getRect();
-		if (value == null) {
-			return null;
-		}
-
-		for (int i = 0; i < 4; i++) {
-			ITextRegion region = valueRegions.get(i);
-			CSSPrimitiveValueImpl childValue = null;
-			switch (i) {
-				case 0 :
-					childValue = (CSSPrimitiveValueImpl) value.getTop();
-					break;
-				case 1 :
-					childValue = (CSSPrimitiveValueImpl) value.getRight();
-					break;
-				case 2 :
-					childValue = (CSSPrimitiveValueImpl) value.getBottom();
-					break;
-				case 3 :
-					childValue = (CSSPrimitiveValueImpl) value.getLeft();
-					break;
-				default :
-					break;
-			}
-			if (childValue == null) {
-				return null;
-			}
-			String text = getText(region);
-			String type = region.getType();
-			if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				setStringValue(childValue, text, type);
-			}
-			else {
-				setFloatValue(childValue, text, type);
-			}
-			if (!fTempStructuredDocument) {
-				childValue.setRangeRegion(fParentRegion, region, region);
-			}
-		}
-
-		return value;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSPrimitiveValueImpl createRgbValue(ITextRegionList regions) {
-		String funcName = getFunctionName(regions);
-		if (funcName == null || !funcName.toLowerCase().equals("rgb")) { //$NON-NLS-1$
-			return null;
-		}
-		String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER, CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE};
-		ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
-		if (valueRegions.size() != 3) {
-			return null;
-		}
-
-		RGBColorImpl value = getRGBColor();
-		if (value == null) {
-			return null;
-		}
-
-		for (int i = 0; i < 3; i++) {
-			ITextRegion region = valueRegions.get(i);
-			CSSPrimitiveValueImpl childValue = null;
-			switch (i) {
-				case 0 :
-					childValue = (CSSPrimitiveValueImpl) value.getRed();
-					break;
-				case 1 :
-					childValue = (CSSPrimitiveValueImpl) value.getGreen();
-					break;
-				case 2 :
-					childValue = (CSSPrimitiveValueImpl) value.getBlue();
-					break;
-				default :
-					break;
-			}
-			if (childValue == null) {
-				return null;
-			}
-			setFloatValue(childValue, getText(region), region.getType());
-			if (!fTempStructuredDocument) {
-				childValue.setRangeRegion(fParentRegion, region, region);
-			}
-		}
-
-		return value;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSPrimitiveValueImpl createStringValue(String text, String type) {
-		short valueType = getStringValueType(text, type);
-		CSSPrimitiveValueImpl value = getCSSPrimitiveValue(valueType);
-		if (value != null) {
-			if (valueType == CSSPrimitiveValue.CSS_URI) {
-				text = CSSUtil.extractUriContents(text);
-			}
-			else if (valueType == CSSPrimitiveValue.CSS_STRING) {
-				text = CSSUtil.extractStringContents(text);
-			}
-			value.setValue(text);
-		}
-		return value;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSPrimitiveValueImpl createStringValue(ITextRegionList regions) {
-		String type = CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT;
-		if (regions.size() == 1) {
-			ITextRegion region = regions.get(0);
-			type = region.getType();
-		}
-		return createStringValue(makeString(regions), type);
-	}
-
-	/**
-	 * 
-	 */
-	private CounterImpl getCounter() {
-		CounterImpl node;
-		if (fUpdateContext != null && fUpdateContext.isActive()) {
-			node = fUpdateContext.getCounter();
-		}
-		else {
-			node = (CounterImpl) fDocument.createCSSPrimitiveValue(CSSPrimitiveValue.CSS_COUNTER);
-		}
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSPrimitiveValueImpl getCSSPrimitiveValue(short type) {
-		CSSPrimitiveValueImpl node;
-		if (fUpdateContext != null && fUpdateContext.isActive()) {
-			node = fUpdateContext.getCSSPrimitiveValue(type);
-		}
-		else {
-			node = (CSSPrimitiveValueImpl) fDocument.createCSSPrimitiveValue(type);
-		}
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSStyleDeclItemImpl getCSSStyleDeclItem(String propertyName) {
-		CSSStyleDeclItemImpl node;
-		if (fUpdateContext != null && fUpdateContext.isActive()) {
-			node = fUpdateContext.getCSSStyleDeclItem(propertyName);
-		}
-		else {
-			node = (CSSStyleDeclItemImpl) fDocument.createCSSStyleDeclItem(propertyName);
-		}
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	static short getFloatValueType(String ident) {
-		ident = ident.toLowerCase();
-		short valueType;
-		if (ident.length() == 0) {
-			valueType = CSSPrimitiveValue.CSS_NUMBER;
-		}
-		else if (ident.equals("%")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_PERCENTAGE;
-		}
-		else if (ident.equalsIgnoreCase("em")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_EMS;
-		}
-		else if (ident.equalsIgnoreCase("ex")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_EXS;
-		}
-		else if (ident.equalsIgnoreCase("px")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_PX;
-		}
-		else if (ident.equalsIgnoreCase("cm")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_CM;
-		}
-		else if (ident.equalsIgnoreCase("mm")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_MM;
-		}
-		else if (ident.equalsIgnoreCase("in")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_IN;
-		}
-		else if (ident.equalsIgnoreCase("pt")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_PT;
-		}
-		else if (ident.equalsIgnoreCase("pc")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_PC;
-		}
-		else if (ident.equalsIgnoreCase("deg")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_DEG;
-		}
-		else if (ident.equalsIgnoreCase("rad")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_RAD;
-		}
-		else if (ident.equalsIgnoreCase("grad")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_GRAD;
-		}
-		else if (ident.equalsIgnoreCase("ms")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_MS;
-		}
-		else if (ident.equalsIgnoreCase("s")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_S;
-		}
-		else if (ident.equalsIgnoreCase("hz")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_HZ;
-		}
-		else if (ident.equalsIgnoreCase("khz")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_KHZ;
-		}
-		else {
-			valueType = CSSPrimitiveValue.CSS_DIMENSION;
-		}
-		return valueType;
-	}
-
-	/**
-	 * 
-	 */
-	static short getFloatValueType(String value, String ident) {
-		ident = ident.toLowerCase();
-		short valueType;
-		if (ident.length() == 0) {
-			if (0 <= value.indexOf('.')) {
-				valueType = CSSPrimitiveValue.CSS_NUMBER;
-			}
-			else {
-				valueType = ICSSPrimitiveValue.CSS_INTEGER;
-			}
-		}
-		else if (ident.equals("%")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_PERCENTAGE;
-		}
-		else if (ident.equalsIgnoreCase("em")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_EMS;
-		}
-		else if (ident.equalsIgnoreCase("ex")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_EXS;
-		}
-		else if (ident.equalsIgnoreCase("px")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_PX;
-		}
-		else if (ident.equalsIgnoreCase("cm")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_CM;
-		}
-		else if (ident.equalsIgnoreCase("mm")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_MM;
-		}
-		else if (ident.equalsIgnoreCase("in")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_IN;
-		}
-		else if (ident.equalsIgnoreCase("pt")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_PT;
-		}
-		else if (ident.equalsIgnoreCase("pc")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_PC;
-		}
-		else if (ident.equalsIgnoreCase("deg")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_DEG;
-		}
-		else if (ident.equalsIgnoreCase("rad")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_RAD;
-		}
-		else if (ident.equalsIgnoreCase("grad")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_GRAD;
-		}
-		else if (ident.equalsIgnoreCase("ms")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_MS;
-		}
-		else if (ident.equalsIgnoreCase("s")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_S;
-		}
-		else if (ident.equalsIgnoreCase("hz")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_HZ;
-		}
-		else if (ident.equalsIgnoreCase("khz")) { //$NON-NLS-1$
-			valueType = CSSPrimitiveValue.CSS_KHZ;
-		}
-		else {
-			valueType = CSSPrimitiveValue.CSS_DIMENSION;
-		}
-		return valueType;
-	}
-
-	/**
-	 * 
-	 */
-	private String getFunctionName(ITextRegionList regions) {
-		if (regions == null || regions.size() < 2) {
-			return null;
-		}
-		ITextRegion firstRegion = regions.get(0);
-		if (firstRegion.getType() != CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-			return null;
-		}
-		ITextRegion lastRegion = regions.get(regions.size() - 1);
-		if (lastRegion.getType() != CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
-			return null;
-		}
-		String text = getText(firstRegion);
-		return text.substring(0, text.length() - 1);
-	}
-
-	/**
-	 * this method has no validation check, then regions must be passed
-	 * getFunctionName()...
-	 */
-	private ITextRegionList getFunctionParameters(ITextRegionList regions, String[] accepts) {
-		ITextRegionList newRegions = new TextRegionListImpl();
-		int nAccepts = (accepts != null) ? accepts.length : 0;
-		Iterator i = regions.iterator();
-		i.next(); // skip FUNCTION
-		while (i.hasNext()) {
-			ITextRegion region = (ITextRegion) i.next();
-			if (region == null) {
-				continue;
-			}
-			String type = region.getType();
-			if (isBlank(type)) {
-				continue;
-			}
-			if (nAccepts == 0) {
-				newRegions.add(region);
-			}
-			else {
-				for (int iAccept = 0; iAccept < nAccepts; iAccept++) {
-					if (type == accepts[iAccept]) {
-						newRegions.add(region);
-						break;
-					}
-				}
-			}
-		}
-		return newRegions;
-	}
-
-	/**
-	 * 
-	 */
-	// private String getPropertyName(IStructuredDocumentRegion flatNode) {
-	// Vector nodeRegions = new Vector(flatNode.getRegions());
-	// return getPropertyName(nodeRegions);
-	// }
-	/**
-	 * 
-	 */
-	private String getPropertyName(ITextRegionList nodeRegions) {
-		ITextRegionList nameRegions = new TextRegionListImpl();
-		String name = null;
-		while (!nodeRegions.isEmpty()) {
-			ITextRegion region = nodeRegions.remove(0);
-			if (region == null) {
-				continue;
-			}
-			String type = region.getType();
-			if (type == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
-				CSSUtil.stripSurroundingSpace(nameRegions);
-				name = makeString(nameRegions);
-				break;
-			}
-			else {
-				nameRegions.add(region);
-			}
-		}
-		return name;
-	}
-
-	/**
-	 * 
-	 */
-	private RectImpl getRect() {
-		RectImpl node;
-		if (fUpdateContext != null && fUpdateContext.isActive()) {
-			node = fUpdateContext.getRect();
-		}
-		else {
-			node = (RectImpl) fDocument.createCSSPrimitiveValue(CSSPrimitiveValue.CSS_RECT);
-		}
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	private RGBColorImpl getRGBColor() {
-		RGBColorImpl node;
-		if (fUpdateContext != null && fUpdateContext.isActive()) {
-			node = fUpdateContext.getRGBColor();
-		}
-		else {
-			node = (RGBColorImpl) fDocument.createCSSPrimitiveValue(CSSPrimitiveValue.CSS_RGBCOLOR);
-		}
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	private short getStringValueType(String text, String type) {
-		short valueType;
-		if (text.toLowerCase().equals("inherit")) { //$NON-NLS-1$
-			valueType = ICSSPrimitiveValue.CSS_INHERIT_PRIMITIVE;
-		}
-		else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_URI) {
-			valueType = CSSPrimitiveValue.CSS_URI;
-		}
-		else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_STRING) {
-			valueType = CSSPrimitiveValue.CSS_STRING;
-		}
-		else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-			valueType = ICSSPrimitiveValue.CSS_HASH;
-		}
-		else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && text.equals(",")) { //$NON-NLS-1$
-			valueType = ICSSPrimitiveValue.CSS_COMMA;
-		}
-		else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && text.equals("/")) { //$NON-NLS-1$
-			valueType = ICSSPrimitiveValue.CSS_SLASH;
-		}
-		else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_UNICODE_RANGE) {
-			valueType = ICSSPrimitiveValue.CSS_URANGE;
-		}
-		else {
-			valueType = CSSPrimitiveValue.CSS_IDENT;
-		}
-		return valueType;
-	}
-
-	/**
-	 * 
-	 */
-	private String makeString(ITextRegionList regions) {
-		StringBuffer buf = new StringBuffer();
-		boolean bSpace = false;
-		for (Iterator i = regions.iterator(); i.hasNext();) {
-			ITextRegion region = (ITextRegion) i.next();
-			String type = region.getType();
-			if (!bSpace && isBlank(type)) {
-				buf.append(" "); //$NON-NLS-1$
-				bSpace = true;
-			}
-			else {
-				buf.append(getText(region));
-				bSpace = false;
-			}
-		}
-
-		return buf.toString();
-	}
-
-	/**
-	 * 
-	 */
-	void setStructuredDocumentTemporary(boolean bTemp) {
-		fTempStructuredDocument = bTemp;
-	}
-
-	/**
-	 * 
-	 */
-	private void setFloatValue(CSSPrimitiveValueImpl value, String text, String type) {
-		FloatInfo info = new FloatInfo(text);
-		value.setFloatValue(info.getValueType(), info.getValue());
-	}
-
-	/**
-	 * 
-	 */
-	private void setStringValue(CSSPrimitiveValueImpl value, String text, String type) {
-		short valueType = getStringValueType(text, type);
-		value.setStringValue(valueType, text);
-	}
-
-	/**
-	 * @param item
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSStyleDeclItem
-	 * @param nodeRegions
-	 *            java.util.Vector
-	 */
-	private void setupImportantAttribute(ICSSStyleDeclItem item, ITextRegionList nodeRegions) {
-		if (item == null || nodeRegions == null || nodeRegions.isEmpty()) {
-			return;
-		}
-		ITextRegion region = nodeRegions.get(nodeRegions.size() - 1);
-		if (region != null && region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT) {
-			item.setPriority(getText(region));
-			CSSAttrImpl attr = ((CSSStyleDeclItemImpl) item).getAttributeNode(ICSSStyleDeclItem.IMPORTANT);
-			attr.setRangeRegion(fParentRegion, region, region);
-			nodeRegions.remove(region);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	void setUpdateContext(CSSModelUpdateContext updateContext) {
-		fUpdateContext = updateContext;
-	}
-
-	/**
-	 * 
-	 */
-	public static boolean hasColonSeparator(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null) {
-			return false;
-		}
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null || regions.size() == 0) {
-			return false;
-		}
-
-		for (Iterator i = regions.iterator(); i.hasNext();) {
-			ITextRegion region = (ITextRegion) i.next();
-			if (region == null) {
-				continue;
-			}
-			if (region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
-				return true;
-			}
-		}
-
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	CSSStyleDeclItemImpl setupDeclarationItem(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null) {
-			return null;
-		}
-		if (!hasColonSeparator(flatNode)) {
-			return null;
-		}
-
-		fParentRegion = flatNode;
-
-		ITextRegionList nodeRegions = new TextRegionListImpl(flatNode.getRegions()); // make
-		// copy
-		CSSStyleDeclItemImpl newItem = createDeclarationItem(nodeRegions);
-		if (newItem == null) {
-			return null;
-		}
-		if (!fTempStructuredDocument && flatNode != null) {
-			newItem.setRangeStructuredDocumentRegion(flatNode, flatNode);
-		}
-
-		CSSUtil.stripSurroundingSpace(nodeRegions);
-		setupImportantAttribute(newItem, nodeRegions);
-		// Now, nodeRegions just has regions for value.
-		setupValues(newItem, nodeRegions);
-		return newItem;
-	}
-
-	void setupValues(ICSSStyleDeclItem item, IStructuredDocumentRegion parentRegion, ITextRegionList nodeRegions) {
-		fParentRegion = parentRegion;
-		setupValues(item, nodeRegions);
-	}
-
-	/**
-	 * nodeRegions must be broken. If you need after, make copy of them.
-	 */
-	private void setupValues(ICSSStyleDeclItem item, ITextRegionList nodeRegions) {
-		if (item == null) {
-			return;
-		}
-
-		ICSSPrimitiveValue value;
-		ITextRegionList regionBuf = new TextRegionListImpl();
-
-		String propertyName = item.getPropertyName().toLowerCase();
-		boolean bFont = (propertyName.equals(PropCMProperty.P_FONT));
-		// (short-hand) font
-		int status = (propertyName.equals(PropCMProperty.P_VOICE_FAMILY) || propertyName.equals(PropCMProperty.P_FONT_FAMILY)) ? S_COMMA_SEPARATION : S_NORMAL;
-		while (!nodeRegions.isEmpty()) {
-			value = null;
-			ITextRegion region = nodeRegions.remove(0);
-			if (region == null) {
-				continue;
-			}
-			String type = region.getType();
-			// if (type == CSSRegionContexts.CSS_DECLARATION_DELIMITER || type
-			// == CSSRegionContexts.CSS_RBRACE) {
-			// break;
-			// }
-			switch (status) {
-				case S_NORMAL :
-					if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-						regionBuf.add(region);
-						status = S_FUNCTION;
-					}
-					else if (bFont && type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && fParentRegion.getText(region).equals("/")) { //$NON-NLS-1$
-						value = createPrimitiveValue(region);
-						status = S_FONT_SLASH;
-					}
-					else if (!isBlank(type)) {
-						value = createPrimitiveValue(region);
-					}
-					break;
-				case S_FUNCTION :
-					if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
-						regionBuf.add(region);
-						value = createPrimitiveValue(regionBuf);
-						regionBuf.clear();
-						status = S_NORMAL;
-					}
-					else if (!isBlank(type)) {
-						regionBuf.add(region);
-					}
-					break;
-				case S_FONT_SLASH :
-					if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION) {
-						value = createPrimitiveValue(region);
-						status = S_COMMA_SEPARATION;
-					}
-					else if (!isBlank(type)) {
-						value = createPrimitiveValue(region);
-					}
-					break;
-				case S_COMMA_SEPARATION :
-					if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && fParentRegion.getText(region).equals(",")) { //$NON-NLS-1$
-						value = createPrimitiveValue(regionBuf);
-						regionBuf.clear();
-						if (value != null) {
-							if (fUpdateContext == null || !fUpdateContext.isActive()) {
-								item.appendValue(value);
-							}
-						}
-						value = createPrimitiveValue(region);
-					}
-					else {
-						regionBuf.add(region);
-					}
-					break;
-				default :
-					break;
-			}
-			if (value != null) {
-				if (fUpdateContext == null || !fUpdateContext.isActive()) {
-					item.appendValue(value);
-				}
-			}
-		}
-		if (!regionBuf.isEmpty()) {
-			value = createPrimitiveValue(regionBuf);
-			if (fUpdateContext == null || !fUpdateContext.isActive()) {
-				item.appendValue(value);
-			}
-		}
-	}
-
-	private String getText(ITextRegion region) {
-		return (fParentRegion != null) ? fParentRegion.getText(region) : ""; //$NON-NLS-1$ 
-	}
-
-	private static boolean isBlank(String type) {
-		return (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT || type == CSSRegionContexts.CSS_DECLARATION_VALUE_S);
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDocumentImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDocumentImpl.java
deleted file mode 100644
index c0a688e..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDocumentImpl.java
+++ /dev/null
@@ -1,163 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSUnknownRule;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- * 
- */
-abstract class CSSDocumentImpl extends CSSStructuredDocumentRegionContainer implements ICSSDocument {
-
-	private CSSModelImpl fModel = null;
-
-	/**
-	 * CSSDocumentImpl constructor comment.
-	 */
-	CSSDocumentImpl() {
-		super();
-	}
-
-
-	CSSDocumentImpl(CSSDocumentImpl that) {
-		super(that);
-	}
-
-	ICSSNode createCSSAttr(String name) {
-		CSSAttrImpl attr = new CSSAttrImpl(name);
-		attr.setOwnerDocument(this);
-
-		return attr;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSCharsetRule
-	 */
-	public ICSSCharsetRule createCSSCharsetRule() {
-		return null;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSFontFaceRule
-	 */
-	public CSSFontFaceRule createCSSFontFaceRule() {
-		return null;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSImportRule
-	 */
-	public ICSSImportRule createCSSImportRule() {
-		return null;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.ICSSMediaRule
-	 */
-	public ICSSMediaRule createCSSMediaRule() {
-		return null;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSPageRule
-	 */
-	public ICSSPageRule createCSSPageRule() {
-		return null;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSPrimitiveValue
-	 */
-	public ICSSPrimitiveValue createCSSPrimitiveValue(short primitiveType) {
-		CSSPrimitiveValueImpl value = null;
-		if (primitiveType == CSSPrimitiveValue.CSS_COUNTER)
-			value = new CounterImpl();
-		else if (primitiveType == CSSPrimitiveValue.CSS_RECT)
-			value = new RectImpl();
-		else if (primitiveType == CSSPrimitiveValue.CSS_RGBCOLOR)
-			value = new RGBColorImpl();
-		else
-			value = new CSSPrimitiveValueImpl(primitiveType);
-		value.setOwnerDocument(this);
-
-		return value;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param rule
-	 *            java.lang.String
-	 */
-	public CSSRule createCSSRule(String rule) {
-		return null;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSStyleDeclaration
-	 */
-	public ICSSStyleDeclaration createCSSStyleDeclaration() {
-		return null;
-	}
-
-	public ICSSStyleDeclItem createCSSStyleDeclItem(String propertyName) {
-		CSSStyleDeclItemImpl item = new CSSStyleDeclItemImpl(propertyName);
-		item.setOwnerDocument(this);
-
-		return item;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSStyleRule
-	 */
-	public ICSSStyleRule createCSSStyleRule() {
-		return null;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSUnknownRule
-	 */
-	public CSSUnknownRule createCSSUnknownRule() {
-		return null;
-	}
-
-	/**
-	 * @return org.w3c.dom.stylesheets.MediaList
-	 */
-	public MediaList createMediaList() {
-		return null;
-	}
-
-	public ICSSModel getModel() {
-		return fModel;
-	}
-
-	void setModel(CSSModelImpl model) {
-		this.fModel = model;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSFontFaceRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSFontFaceRuleImpl.java
deleted file mode 100644
index 5dcdc28..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSFontFaceRuleImpl.java
+++ /dev/null
@@ -1,67 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.css.CSSFontFaceRule;
-
-
-/**
- * 
- */
-class CSSFontFaceRuleImpl extends CSSRuleDeclContainer implements CSSFontFaceRule {
-
-	/**
-	 * 
-	 */
-	CSSFontFaceRuleImpl() {
-		super();
-	}
-
-	CSSFontFaceRuleImpl(CSSFontFaceRuleImpl that) {
-		super(that);
-	}
-
-	public ICSSNode cloneNode(boolean deep) {
-		CSSFontFaceRuleImpl cloned = new CSSFontFaceRuleImpl(this);
-
-		if (deep)
-			cloneChildNodes(cloned, deep);
-
-		return cloned;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	String extractPreString() {
-		return "@font-face";//$NON-NLS-1$
-	}
-
-	/**
-	 * @return short
-	 */
-	public short getNodeType() {
-		return FONTFACERULE_NODE;
-	}
-
-	/**
-	 * The type of the rule, as defined above. The expectation is that
-	 * binding-specific casting methods can be used to cast down from an
-	 * instance of the <code>CSSRule</code> interface to the specific
-	 * derived interface implied by the <code>type</code>.
-	 */
-	public short getType() {
-		return FONT_FACE_RULE;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSImportRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSImportRuleImpl.java
deleted file mode 100644
index db425d2..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSImportRuleImpl.java
+++ /dev/null
@@ -1,225 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IModelProvideAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-import org.eclipse.wst.css.core.internal.util.CSSLinkConverter;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.URLModelProviderCSS;
-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;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- * 
- */
-class CSSImportRuleImpl extends CSSRuleImpl implements ICSSImportRule {
-
-	private boolean fDirty = true;
-	private ICSSStyleSheet fStyleSheet;
-
-	/**
-	 * 
-	 */
-	CSSImportRuleImpl() {
-		super();
-	}
-
-	CSSImportRuleImpl(CSSImportRuleImpl that) {
-		super(that);
-	}
-
-	public ICSSNode cloneNode(boolean deep) {
-		CSSImportRuleImpl cloned = new CSSImportRuleImpl(this);
-
-		if (deep)
-			cloneChildNodes(cloned, deep);
-
-		return cloned;
-	}
-
-	/**
-	 * 
-	 */
-	void closeStyleSheet() {
-		if (fStyleSheet != null) {
-			ICSSStyleSheet sheet = fStyleSheet;
-			fStyleSheet = null; // to prevent loop, we must reset fStyleSheet
-								// before all closing action
-
-			sheet.getModel().removeStyleListener(getOwnerDocument().getModel());
-			// get ModelProvideAdapter
-			IModelProvideAdapter adapter = (IModelProvideAdapter) getAdapterFor(IModelProvideAdapter.class);
-			// if (getOwnerDocument().getModel().getStyleSheetType() ==
-			// ICSSModel.EMBEDDED) { // case STYLE tag
-			// adapter = (ModelProvideAdapter)
-			// ((INodeNotifier)getOwnerDocument().getModel().getOwnerDOMNode()).getAdapterFor(ModelProvideAdapter.class);
-			// }
-			if (adapter != null)
-				adapter.modelRemoved(sheet.getModel());
-
-			sheet.getModel().releaseFromRead();
-		}
-	}
-
-	/**
-	 * The location of the style sheet to be imported. The attribute will not
-	 * contain the <code>"url(...)"</code> specifier around the URI.
-	 */
-	public String getHref() {
-		return CSSUtil.extractUriContents(getAttribute(HREF));
-	}
-
-	/**
-	 * A list of media types for which this style sheet may be used.
-	 */
-	public org.w3c.dom.stylesheets.MediaList getMedia() {
-		ICSSNode media = getFirstChild();
-		if (media != null) {
-			if (media instanceof MediaList) {
-				return (MediaList) media;
-			}
-		}
-
-		// THIS CASE IS ERROR CASE
-		return null;
-	}
-
-	/**
-	 * @return short
-	 */
-	public short getNodeType() {
-		return IMPORTRULE_NODE;
-	}
-
-	/**
-	 * The style sheet referred to by this rule, if it has been loaded. The
-	 * value of this attribute is <code>null</code> if the style sheet has
-	 * not yet been loaded or if it will not be loaded (e.g. if the style
-	 * sheet is for a media type not supported by the user agent).
-	 */
-	public CSSStyleSheet getStyleSheet() {
-
-		if (fDirty) {
-			// NOTE: try/catch block is a TEMP fix to avoid compile errors:
-			try {
-				closeStyleSheet();
-
-				if (getHref() == null || getHref().length() <= 0) {
-					fDirty = false;
-					return null;
-				}
-
-				IStructuredModel baseModel = getOwnerDocument().getModel();
-				if (getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED) { // case
-																								// STYLE
-																								// tag
-					baseModel = ((IDOMNode) getOwnerDocument().getModel().getOwnerDOMNode()).getModel();
-				}
-				// get ModelProvideAdapter
-				IModelProvideAdapter adapter = (IModelProvideAdapter) getAdapterFor(IModelProvideAdapter.class);
-				// if (getOwnerDocument().getModel().getStyleSheetType() ==
-				// ICSSModel.EMBEDDED) { // case STYLE tag
-				// adapter = (ModelProvideAdapter)
-				// ((INodeNotifier)getOwnerDocument().getModel().getOwnerDOMNode()).getAdapterFor(ModelProvideAdapter.class);
-				// }
-
-				// load model from IModelManager
-				URLModelProviderCSS provider = new URLModelProviderCSS();
-				IStructuredModel newModel = provider.getModelForRead(baseModel, getHref());
-				fDirty = false;
-
-				if (newModel == null)
-					return null;
-				if (!(newModel instanceof ICSSModel)) {
-					newModel.releaseFromRead();
-					return null;
-				}
-
-				// notify adapter
-				if (adapter != null)
-					adapter.modelProvided(newModel);
-
-				fStyleSheet = (ICSSStyleSheet) ((ICSSModel) newModel).getDocument();
-				if (fStyleSheet != null)
-					fStyleSheet.getModel().addStyleListener(getOwnerDocument().getModel());
-			}
-			catch (java.io.IOException e) {
-				Logger.logException(e);
-			}
-		}
-		return fStyleSheet;
-	}
-
-	/**
-	 * The type of the rule, as defined above. The expectation is that
-	 * binding-specific casting methods can be used to cast down from an
-	 * instance of the <code>CSSRule</code> interface to the specific
-	 * derived interface implied by the <code>type</code>.
-	 */
-	public short getType() {
-		return IMPORT_RULE;
-	}
-
-	/**
-	 * 
-	 */
-	public void refreshStyleSheet() {
-		if (!fDirty) {
-			closeStyleSheet();
-			fDirty = true;
-			notify(INodeNotifier.CHANGE, getAttributeNode(HREF), null, null, getStartOffset());
-		}
-	}
-
-	/**
-	 */
-	void releaseRule() {
-		if (fStyleSheet != null) {
-			ICSSStyleSheet sheet = fStyleSheet;
-			fStyleSheet = null; // to prevent loop, we must reset fStyleSheet
-								// before all closing action
-
-			sheet.getModel().removeStyleListener(getOwnerDocument().getModel());
-			// get ModelProvideAdapter
-			IModelProvideAdapter adapter = (IModelProvideAdapter) getAdapterFor(IModelProvideAdapter.class);
-			// if (getOwnerDocument().getModel().getStyleSheetType() ==
-			// ICSSModel.EMBEDDED) { // case STYLE tag
-			// adapter = (ModelProvideAdapter)
-			// ((INodeNotifier)getOwnerDocument().getModel().getOwnerDOMNode()).getAdapterFor(ModelProvideAdapter.class);
-			// }
-			if (adapter != null)
-				adapter.modelReleased(sheet.getModel());
-
-			sheet.getModel().releaseFromRead();
-		}
-	}
-
-	/**
-	 * @param href
-	 *            java.lang.String
-	 */
-	public void setHref(String href) throws DOMException {
-		fDirty = true;
-		setAttribute(HREF, CSSLinkConverter.addFunc(href));
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSMediaRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSMediaRuleImpl.java
deleted file mode 100644
index 492c836..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSMediaRuleImpl.java
+++ /dev/null
@@ -1,230 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- * 
- */
-class CSSMediaRuleImpl extends CSSRuleImpl implements ICSSMediaRule {
-
-	/**
-	 * 
-	 */
-	CSSMediaRuleImpl() {
-		super();
-	}
-
-	CSSMediaRuleImpl(CSSMediaRuleImpl that) {
-		super(that);
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param rule
-	 *            org.w3c.dom.css.CSSRule
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public org.w3c.dom.css.CSSRule appendRule(org.w3c.dom.css.CSSRule rule) throws org.w3c.dom.DOMException {
-		if (rule == null)
-			return null;
-
-		CSSRule ret = (CSSRule) appendChild((CSSNodeImpl) rule);
-		return ret;
-	}
-
-	public ICSSNode cloneNode(boolean deep) {
-		CSSMediaRuleImpl cloned = new CSSMediaRuleImpl(this);
-
-		if (deep)
-			cloneChildNodes(cloned, deep);
-
-		return cloned;
-	}
-
-	/**
-	 * Used to delete a rule from the media block.
-	 * 
-	 * @param index
-	 *            The index within the media block's rule collection of the
-	 *            rule to remove.
-	 * @exception DOMException
-	 *                INDEX_SIZE_ERR: Raised if the specified index does not
-	 *                correspond to a rule in the media rule list. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule
-	 *                is readonly.
-	 */
-	public void deleteRule(int index) throws DOMException {
-		CSSNodeImpl node = getIndexedRule(index);
-		if (node != null)
-			removeChild(node);
-	}
-
-	/**
-	 * A list of all CSS rules contained within the media block.
-	 */
-	public CSSRuleList getCssRules() {
-		CSSRuleListImpl list = new CSSRuleListImpl();
-
-		for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
-			if (node instanceof CSSRule)
-				list.appendNode(node);
-		}
-
-		return list;
-	}
-
-	CSSRuleImpl getIndexedRule(int index) {
-		if (index < 0)
-			return null;
-
-		int i = 0;
-		for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
-			if (node instanceof CSSRule) {
-				if (i++ == index)
-					return (CSSRuleImpl) node;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * A list of media types for this rule.
-	 */
-	public MediaList getMedia() {
-		for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
-			if (node instanceof MediaListImpl)
-				return (MediaList) node;
-		}
-
-		return null;
-	}
-
-	/**
-	 * @return short
-	 */
-	public short getNodeType() {
-		return MEDIARULE_NODE;
-	}
-
-	/**
-	 * The type of the rule, as defined above. The expectation is that
-	 * binding-specific casting methods can be used to cast down from an
-	 * instance of the <code>CSSRule</code> interface to the specific
-	 * derived interface implied by the <code>type</code>.
-	 */
-	public short getType() {
-		return MEDIA_RULE;
-	}
-
-	/**
-	 * Used to insert a new rule into the media block.
-	 * 
-	 * @param rule
-	 *            The parsable text representing the rule. For rule sets this
-	 *            contains both the selector and the style declaration. For
-	 *            at-rules, this specifies both the at-identifier and the rule
-	 *            content.
-	 * @param index
-	 *            The index within the media block's rule collection of the
-	 *            rule before which to insert the specified rule. If the
-	 *            specified index is equal to the length of the media blocks's
-	 *            rule collection, the rule will be added to the end of the
-	 *            media block.
-	 * @return The index within the media block's rule collection of the newly
-	 *         inserted rule.
-	 * @exception DOMException
-	 *                HIERARCHY_REQUEST_ERR: Raised if the rule cannot be
-	 *                inserted at the specified index, e.g., if an
-	 *                <code>@import</code> rule is inserted after a standard rule set or other
-	 *         at-rule. <br>
-	 *         INDEX_SIZE_ERR: Raised if the specified index is not a valid
-	 *         insertion point. <br>
-	 *         NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule is
-	 *         readonly. <br>
-	 *         SYNTAX_ERR: Raised if the specified rule has a syntax error and
-	 *         is unparsable.
-	 */
-	public int insertRule(String rule, int index) throws DOMException {
-		int length = getCssRules().getLength();
-		if (index < 0 || length < index)
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, "");//$NON-NLS-1$
-
-		CSSRuleImpl refRule = (length != index) ? getIndexedRule(index) : null;
-
-		CSSRuleImpl newRule = (CSSRuleImpl) getOwnerDocument().createCSSRule(rule);
-
-		// prevent from nesting @media rule
-		if (newRule.getType() == CSSRule.MEDIA_RULE)
-			throw new DOMException(DOMException.SYNTAX_ERR, "");//$NON-NLS-1$
-
-		insertBefore(newRule, refRule);
-
-		return index;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param newRule
-	 *            org.w3c.dom.css.CSSRule
-	 * @param refRule
-	 *            org.w3c.dom.css.CSSRule
-	 */
-	public org.w3c.dom.css.CSSRule insertRuleBefore(org.w3c.dom.css.CSSRule newRule, org.w3c.dom.css.CSSRule refRule) throws org.w3c.dom.DOMException {
-		if (newRule == null && refRule == null)
-			return null;
-
-		CSSRule ret = (CSSRule) insertBefore((CSSNodeImpl) newRule, (CSSNodeImpl) refRule);
-		return ret;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param rule
-	 *            org.w3c.dom.css.CSSRule
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public org.w3c.dom.css.CSSRule removeRule(org.w3c.dom.css.CSSRule rule) throws org.w3c.dom.DOMException {
-		if (rule == null)
-			return null;
-
-		CSSRule ret = (CSSRule) removeChild((CSSNodeImpl) rule);
-		return ret;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param newChild
-	 *            org.w3c.dom.css.CSSRule
-	 * @param oldChild
-	 *            org.w3c.dom.css.CSSRule
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public org.w3c.dom.css.CSSRule replaceRule(org.w3c.dom.css.CSSRule newRule, org.w3c.dom.css.CSSRule oldRule) throws org.w3c.dom.DOMException {
-		if (newRule == null && oldRule == null)
-			return null;
-
-		CSSRule ret = (CSSRule) replaceChild((CSSNodeImpl) newRule, (CSSNodeImpl) oldRule);
-		return ret;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelCreationContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelCreationContext.java
deleted file mode 100644
index 313f28c..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelCreationContext.java
+++ /dev/null
@@ -1,155 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-
-/**
- * 
- */
-class CSSModelCreationContext {
-
-	private CSSNodeImpl fRootNode = null;
-	private CSSNodeImpl fTargetNode = null;
-	private CSSNodeImpl fNextNode = null;
-	private int fReparseStart = -1;
-	private int fReparseEnd = -1;
-
-	/**
-	 * CSSModelContext constructor comment.
-	 */
-	CSSModelCreationContext(CSSNodeImpl rootNode) {
-		super();
-
-		fRootNode = rootNode;
-	}
-
-	/**
-	 * 
-	 */
-	void clear() {
-		fNextNode = null;
-		fTargetNode = null;
-		resetReparseRange();
-	}
-
-	/**
-	 * 
-	 */
-	CSSNodeImpl getNextNode() {
-		return fNextNode;
-	}
-
-	/**
-	 * 
-	 */
-	int getReparseEnd() {
-		return fReparseEnd;
-	}
-
-	/**
-	 * 
-	 */
-	int getReparseStart() {
-		return fReparseStart;
-	}
-
-	/**
-	 * 
-	 */
-	CSSNodeImpl getRootNode() {
-		return fRootNode;
-	}
-
-	/**
-	 * 
-	 */
-	CSSNodeImpl getTargetNode() {
-		return fTargetNode;
-	}
-
-	/**
-	 * 
-	 */
-	boolean isToReparse() {
-		return (0 <= getReparseStart() && 0 <= getReparseEnd());
-	}
-
-	/**
-	 * 
-	 */
-	void resetReparseRange() {
-		fReparseStart = fReparseEnd = -1;
-	}
-
-	/**
-	 * 
-	 */
-	void setLast() {
-		fNextNode = null;
-
-		if (!(fRootNode instanceof CSSStructuredDocumentRegionContainer)) {
-			fTargetNode = fRootNode;
-		}
-		else {
-			IStructuredDocumentRegion lastStructuredDocumentRegion = ((CSSStructuredDocumentRegionContainer) fRootNode).getLastStructuredDocumentRegion();
-			CSSNodeImpl node = fRootNode;
-			while (node != null) {
-				ICSSNode lastChild = node.getLastChild();
-				if (lastChild instanceof CSSStructuredDocumentRegionContainer && ((CSSStructuredDocumentRegionContainer) lastChild).getLastStructuredDocumentRegion() == lastStructuredDocumentRegion) {
-					node = (CSSNodeImpl) lastChild;
-				}
-				else {
-					break;
-				}
-			}
-			fTargetNode = node;
-		}
-	}
-
-	/**
-	 * 
-	 */
-	void setNextNode(ICSSNode node) {
-		fNextNode = (CSSNodeImpl) node;
-		if (fNextNode != null) {
-			fTargetNode = (CSSNodeImpl) fNextNode.getParentNode();
-		}
-	}
-
-	/**
-	 * 
-	 */
-	void setReparseEnd(int end) {
-		fReparseEnd = end;
-	}
-
-	/**
-	 * 
-	 */
-	void setReparseStart(int start) {
-		fReparseStart = start;
-	}
-
-	/**
-	 * 
-	 */
-	void setTargetNode(ICSSNode node) {
-		fTargetNode = (CSSNodeImpl) node;
-		if (fNextNode != null && fNextNode.getParentNode() != fTargetNode) {
-			fNextNode = null;
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java
deleted file mode 100644
index c458e5c..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java
+++ /dev/null
@@ -1,268 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-
-
-/**
- * 
- */
-class CSSModelDeletionContext {
-
-	private int fOldStart = -1;
-	private int fOldLength = 0;
-	private int fNewStart = -1;
-	private int fNewLength = 0;
-	private int fLengthDifference = 0;
-	private IStructuredDocumentRegionList fOldStructuredDocumentRegions = null;
-	// private ICSSNode fRootNode = null;
-	private int fRemovedRangeBegin = -1;
-	private int fRemovedRangeEnd = -1;
-	private CSSNodeListImpl fNodesToBeRemoved = new CSSNodeListImpl();
-
-	/**
-	 * CSSModelDeletionContext constructor comment.
-	 */
-	CSSModelDeletionContext(ICSSNode rootNode) {
-		super();
-
-		// fRootNode = rootNode;
-	}
-
-	/**
-	 * 
-	 */
-	boolean addNodeToBeRemoved(ICSSNode node) {
-		int nNodes = fNodesToBeRemoved.getLength();
-		for (int i = 0; i < nNodes; i++) {
-			ICSSNode parent = fNodesToBeRemoved.item(i);
-			if (CSSModelUtil.isParentOf(parent, node)) {
-				return false;
-			}
-		}
-		fNodesToBeRemoved.appendNode(node);
-		return true;
-	}
-
-	/**
-	 * 
-	 */
-	void expandRemovedRangeBegin(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null) {
-			return;
-		}
-		int newBegin = flatNode.getStart(); // fOldStart == fNewStart, right??
-		if (fRemovedRangeBegin < 0 || newBegin < fRemovedRangeBegin) {
-			fRemovedRangeBegin = newBegin;
-		}
-	}
-
-	/**
-	 * 
-	 */
-	void expandRemovedRangeEnd(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null) {
-			return;
-		}
-		int newEnd = flatNode.getEnd() + ((isOldNode(flatNode)) ? fLengthDifference : 0);
-		if (fRemovedRangeEnd < 0 || fRemovedRangeEnd < newEnd) {
-			fRemovedRangeEnd = newEnd;
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private CSSStructuredDocumentRegionContainer findContainer(CSSNodeImpl parent, IStructuredDocumentRegion flatNode) {
-		if (parent instanceof CSSStructuredDocumentRegionContainer) {
-			// Am i a container of flatNode?
-			IStructuredDocumentRegion firstNode = ((CSSStructuredDocumentRegionContainer) parent).getFirstStructuredDocumentRegion();
-			IStructuredDocumentRegion lastNode = ((CSSStructuredDocumentRegionContainer) parent).getLastStructuredDocumentRegion();
-			int firstStart = getOriginalOffset(firstNode);
-			int lastStart = getOriginalOffset(lastNode);
-			int start = flatNode.getStart();
-
-			if (firstStart <= start && start <= lastStart) {
-				// I am a container, is my child a container ?
-				for (ICSSNode node = parent.getFirstChild(); node != null; node = node.getNextSibling()) {
-					if (node instanceof CSSNodeImpl) {
-						CSSStructuredDocumentRegionContainer container = findContainer((CSSNodeImpl) node, flatNode);
-						if (container != null) {
-							return container;
-						}
-					}
-				}
-				return (CSSStructuredDocumentRegionContainer) parent;
-			}
-		}
-
-		return null;
-	}
-
-	/**
-	 * 
-	 */
-	CSSStructuredDocumentRegionContainer findDeletionTarget(CSSNodeImpl parent, IStructuredDocumentRegion flatNode) {
-		CSSStructuredDocumentRegionContainer target = findContainer(parent, flatNode);
-		if (target == null) {
-			return null;
-		}
-
-		// System.out.print(flatNode.toString() + ": ");
-
-		// child a(=====)b(=====)c
-		// parent (================) a,c can remove parent, but b cannot.
-
-		ICSSNode child;
-
-		for (child = target.getFirstChild(); child != null && !(child instanceof CSSStructuredDocumentRegionContainer); child = child.getNextSibling()) {
-			// just advancing
-		}
-
-		if (child == null) {
-			// System.out.println("target has no children."); // TESTBYCOZY
-			return target; // has no child containers.
-		}
-		else {
-			IStructuredDocumentRegion firstNode = ((CSSStructuredDocumentRegionContainer) child).getFirstStructuredDocumentRegion();
-			if (flatNode.getStart() < getOriginalOffset(firstNode)) {
-				// System.out.println("flatNode is in front of first child");
-				// // TESTBYCOZY
-				return target; // a
-			}
-		}
-
-		for (child = target.getLastChild(); child != null && !(child instanceof CSSStructuredDocumentRegionContainer); child = child.getPreviousSibling()) {
-			// just advancing
-		}
-
-		if (child == null) {
-			// System.out.println("target has no children."); // TESTBYCOZY
-			return target; // has no child containers.
-		}
-		else {
-			IStructuredDocumentRegion firstNode = ((CSSStructuredDocumentRegionContainer) child).getFirstStructuredDocumentRegion();
-			if (getOriginalOffset(firstNode) < flatNode.getStart()) {
-				// System.out.println("flatNode is in after of last child");
-				// // TESTBYCOZY
-				return target; // c
-			}
-		}
-
-		// System.out.println("flatNode inner of children"); // TESTBYCOZY
-		return null; // b
-	}
-
-	/**
-	 * 
-	 */
-	Iterator getNodesToBeRemoved() {
-		Collection nodes = new ArrayList();
-		int nNodes = fNodesToBeRemoved.getLength();
-		for (int i = 0; i < nNodes; i++) {
-			nodes.add(fNodesToBeRemoved.item(i));
-		}
-		return nodes.iterator();
-	}
-
-	/**
-	 * 
-	 */
-	private int getOriginalOffset(IStructuredDocumentRegion flatNode) {
-		int offset = 0;
-		if (flatNode != null) {
-			offset = flatNode.getStart();
-			if (0 <= fLengthDifference) {
-				if (fNewStart + fNewLength < offset) {
-					offset -= fLengthDifference;
-				}
-			}
-			else {
-				if (fOldStart + fOldLength <= offset || (fNewStart < 0 && fOldStart <= offset && !isOldNode(flatNode)) || (0 <= fNewStart && fNewStart + fNewLength <= offset && !isOldNode(flatNode))) {
-					offset -= fLengthDifference;
-				}
-			}
-		}
-
-		return offset;
-	}
-
-	/**
-	 * 
-	 */
-	int getRemovedRangeBegin() {
-		return fRemovedRangeBegin;
-	}
-
-	/**
-	 * 
-	 */
-	int getRemovedRangeEnd() {
-		return fRemovedRangeEnd;
-	}
-
-	/**
-	 * 
-	 */
-	private boolean isOldNode(IStructuredDocumentRegion flatNode) {
-		if (fOldStructuredDocumentRegions != null) {
-			for (Enumeration e = fOldStructuredDocumentRegions.elements(); e.hasMoreElements();) {
-				if (e.nextElement() == flatNode) {
-					return true;
-				}
-			}
-		}
-
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	void setupContext(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
-		IStructuredDocumentRegion flatNode = null;
-		fOldLength = CSSUtil.getTextLength(oldStructuredDocumentRegions);
-		if (oldStructuredDocumentRegions != null && 0 < oldStructuredDocumentRegions.getLength() && (flatNode = oldStructuredDocumentRegions.item(0)) != null) {
-			fOldStart = flatNode.getStart();
-		}
-		else {
-			fOldStart = -1;
-		}
-		fNewLength = CSSUtil.getTextLength(newStructuredDocumentRegions);
-		if (newStructuredDocumentRegions != null && 0 < newStructuredDocumentRegions.getLength() && (flatNode = newStructuredDocumentRegions.item(0)) != null) {
-			fNewStart = flatNode.getStart();
-			fRemovedRangeBegin = fNewStart;
-			fRemovedRangeEnd = fNewStart + fNewLength;
-		}
-		else {
-			fNewStart = -1;
-			fRemovedRangeBegin = fRemovedRangeEnd = -1;
-		}
-		fLengthDifference = fNewLength - fOldLength;
-		fOldStructuredDocumentRegions = oldStructuredDocumentRegions;
-
-		// cleanup nodes
-		while (0 < fNodesToBeRemoved.getLength()) {
-			fNodesToBeRemoved.removeNode(0);
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java
deleted file mode 100644
index 46209d8..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java
+++ /dev/null
@@ -1,624 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.event.ICSSStyleListener;
-import org.eclipse.wst.css.core.internal.eventimpl.CSSEmbededStyleNotifyAdapter;
-import org.eclipse.wst.css.core.internal.eventimpl.CSSStyleNotifyAdapter;
-import org.eclipse.wst.css.core.internal.parser.CSSSourceParser;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.eclipse.wst.css.core.internal.util.ImportRuleCollector;
-import org.eclipse.wst.css.core.internal.util.ImportedCollector;
-import org.eclipse.wst.css.core.internal.util.SelectorsCollector;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel;
-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.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.exceptions.ResourceInUse;
-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.sse.core.internal.util.Assert;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-
-public class CSSModelImpl extends AbstractStructuredModel implements ICSSModel, IStructuredDocumentListener {
-
-	private CSSDocumentImpl document = null;
-	private org.w3c.dom.Node ownerNode = null;
-	private CSSStyleNotifyAdapter styleNotifier = null;
-	private CSSModelParser fParser = null;
-	private CSSModelUpdater fUpdater = null;
-	private boolean fStructuredDocumentUpdate = false;
-	private final static String ID_NON_EXTERNAL_CSS = "**_NON_EXTERNAL_CSS_***";//$NON-NLS-1$
-
-	/**
-	 * CSSModelImpl constructor comment.
-	 * 
-	 */
-	public CSSModelImpl() {
-		super();
-	}
-
-	/**
-	 * @param listener
-	 *            org.eclipse.wst.css.core.event.CSSStyleListener
-	 */
-	public void addStyleListener(ICSSStyleListener listener) {
-		getStyleNotifier().addStyleListener(listener);
-	}
-
-	void attrReplaced(CSSNodeImpl parentNode, CSSNodeImpl newAttr, CSSNodeImpl oldAttr) {
-		if (!fStructuredDocumentUpdate) {
-			CSSModelUpdater updater = getUpdater();
-			updater.attrReplaced(parentNode, newAttr, oldAttr);
-		}
-
-		ICSSSelector removed[] = null, added[] = null;
-		if (oldAttr != null && oldAttr.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) oldAttr).getName().equals(ICSSStyleRule.SELECTOR)) {
-			CSSAttrImpl attr = (CSSAttrImpl) oldAttr;
-			// collect changed selector
-			ICSSSelectorList list = new CSSSelectorListImpl(attr.getValue());
-			removed = new ICSSSelector[list.getLength()];
-			for (int i = 0; i < list.getLength(); i++)
-				removed[i] = list.getSelector(i);
-		}
-		if (newAttr != null && newAttr.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) newAttr).getName().equals(ICSSStyleRule.SELECTOR)) {
-			CSSAttrImpl attr = (CSSAttrImpl) newAttr;
-			// collect changed selector
-			ICSSSelectorList list = new CSSSelectorListImpl(attr.getValue());
-			added = new ICSSSelector[list.getLength()];
-			for (int i = 0; i < list.getLength(); i++)
-				added[i] = list.getSelector(i);
-		}
-		if (removed != null || added != null || getDocument().getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
-			getStyleNotifier().fire(removed, added, null);
-		}
-		// for href attribute
-		if (getStyleListeners() != null && getStyleListeners().size() > 0) {
-			boolean update = false;
-			if (oldAttr != null && oldAttr.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) oldAttr).getName().equals(ICSSImportRule.HREF)) {
-				update = true;
-			}
-			if (newAttr != null && newAttr.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) newAttr).getName().equals(ICSSImportRule.HREF)) {
-				update = true;
-			}
-			if (update)
-				((ICSSImportRule) parentNode).getStyleSheet();
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public void beginRecording(Object requester, String label, String description) {
-		getStyleNotifier().beginRecording();
-
-		Node node = getOwnerDOMNode();
-		if (node != null && node instanceof IDOMNode) {
-			IStructuredModel model = ((IDOMNode) node).getModel();
-			if (model != null) {
-				model.beginRecording(requester, label, description);
-				return;
-			}
-		}
-		super.beginRecording(requester, label, description);
-	}
-
-	void childReplaced(CSSNodeImpl parentNode, CSSNodeImpl newChild, CSSNodeImpl oldChild) {
-		if (!fStructuredDocumentUpdate) {
-			CSSModelUpdater updater = getUpdater();
-			updater.childReplaced(parentNode, newChild, oldChild);
-		}
-
-		// always check and send selector event
-		ICSSSelector removed[] = null, added[] = null;
-		if (parentNode.getNodeType() == ICSSNode.STYLESHEET_NODE || parentNode.getNodeType() == ICSSNode.MEDIARULE_NODE) {
-			// collect old selectors
-			SelectorsCollector selTrav = new SelectorsCollector();
-			selTrav.apply(oldChild);
-			int nSel = selTrav.getSelectors().size();
-			if (nSel > 0) {
-				removed = new ICSSSelector[nSel];
-				for (int i = 0; i < nSel; i++)
-					removed[i] = (ICSSSelector) selTrav.getSelectors().get(i);
-			}
-			// collect new selectors
-			selTrav = new SelectorsCollector();
-			selTrav.apply(newChild);
-			nSel = selTrav.getSelectors().size();
-			if (nSel > 0) {
-				added = new ICSSSelector[nSel];
-				for (int i = 0; i < nSel; i++)
-					added[i] = (ICSSSelector) selTrav.getSelectors().get(i);
-			}
-		}
-		else {
-			// modification
-			ICSSNode rule = parentNode;
-			while (rule != null) {
-				if (rule instanceof ICSSStyleRule)
-					break;
-				rule = rule.getParentNode();
-			}
-			if (rule != null) {
-				ICSSSelectorList list = ((ICSSStyleRule) rule).getSelectors();
-				added = new ICSSSelector[list.getLength()];
-				for (int i = 0; i < list.getLength(); i++)
-					added[i] = list.getSelector(i);
-			}
-		}
-		if (removed != null || added != null || getDocument().getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
-			// send selector changed event
-			getStyleNotifier().fire(removed, added, null);
-		}
-		// close removed import-rule's external style sheets
-		{
-			ImportRuleCollector trav = new ImportRuleCollector();
-			trav.apply(oldChild);
-			Iterator it = trav.getRules().iterator();
-			while (it.hasNext()) {
-				((CSSImportRuleImpl) it.next()).closeStyleSheet();
-			}
-		}
-		// send events to listener for new import-rules
-		if (getStyleListeners() != null && getStyleListeners().size() > 0) {
-			ImportedCollector trav = new ImportedCollector();
-			trav.apply(newChild);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private void closeImported() {
-		if (!isShared()) {
-			// release listeners
-			if (getStyleListeners() != null) {
-				Vector toRemove = new Vector(getStyleListeners());
-				Iterator it = toRemove.iterator();
-				while (it.hasNext()) {
-					removeStyleListener((ICSSStyleListener) it.next());
-				}
-			}
-			// close import rules
-			ImportRuleCollector trav = new ImportRuleCollector();
-			trav.apply(getDocument());
-			Iterator it2 = trav.getRules().iterator();
-			while (it2.hasNext()) {
-				((CSSImportRuleImpl) it2.next()).releaseRule();
-			}
-		}
-	}
-
-	private CSSDocumentImpl createDocument() {
-		CSSDocumentImpl doc = null;
-		int parserMode = CSSSourceParser.MODE_STYLESHEET;
-		if (ownerNode == null) {
-			// this case is external CSS file
-			doc = (CSSStyleSheetImpl) DOMCSSImpl.createCSSStyleSheet(null, null); // parameters
-			// are
-			// for
-			// STYLE-tag
-			parserMode = CSSSourceParser.MODE_STYLESHEET;
-		}
-		else if (ownerNode instanceof org.w3c.dom.Element && ((Element) ownerNode).getTagName().toUpperCase().equals("STYLE")) {//$NON-NLS-1$
-			// this case is STYLE-tag
-			Element style = (Element) ownerNode;
-			doc = (CSSStyleSheetImpl) DOMCSSImpl.createCSSStyleSheet(style.getAttribute("TITLE"), //$NON-NLS-1$
-						style.getAttribute("MEDIA"));//$NON-NLS-1$
-			parserMode = CSSSourceParser.MODE_STYLESHEET;
-		}
-		else if (ownerNode instanceof org.w3c.dom.Element || ownerNode instanceof org.w3c.dom.Attr) {
-			// Inline attributes
-			doc = (CSSStyleDeclarationImpl) DOMCSSImpl.createCSSStyleDeclaration();
-			parserMode = CSSSourceParser.MODE_DECLARATION;
-		}
-		RegionParser regionParser = getStructuredDocument().getParser();
-		if (regionParser instanceof CSSSourceParser) {
-			((CSSSourceParser) regionParser).setParserMode(parserMode);
-		}
-		return doc;
-	}
-
-	/**
-	 * 
-	 */
-	public void endRecording(Object requester) {
-		Node node = getOwnerDOMNode();
-		if (node != null && node instanceof IDOMNode) {
-			IStructuredModel model = ((IDOMNode) node).getModel();
-			if (model != null) {
-				model.endRecording(requester);
-				return;
-			}
-		}
-		super.endRecording(requester);
-
-		getStyleNotifier().endRecording();
-	}
-
-	public ICSSDocument getDocument() {
-		if (document == null) {
-			this.document = createDocument();
-			this.document.setModel(this);
-		}
-		return this.document;
-	}
-
-	public IStructuredDocument getStructuredDocument() {
-		IStructuredDocument structuredDocument = null;
-		structuredDocument = super.getStructuredDocument();
-		if (structuredDocument != null)
-			return structuredDocument;
-
-		// the first time
-		Assert.isNotNull(getModelHandler());
-		structuredDocument = (IStructuredDocument) getModelHandler().getDocumentLoader().createNewStructuredDocument();
-
-		setStructuredDocument(structuredDocument);
-		return structuredDocument;
-	}
-
-	/**
-	 * getNode method comment.
-	 */
-	public IndexedRegion getIndexedRegion(int offset) {
-		if (getDocument() == null)
-			return null;
-		return ((CSSStructuredDocumentRegionContainer) getDocument()).getContainerNode(offset);
-	}
-
-	/**
-	 * @return org.w3c.dom.Node
-	 */
-	public Node getOwnerDOMNode() {
-		return ownerNode;
-	}
-
-	/**
-	 * @param ownerNode
-	 *            org.w3c.dom.Node if the case of external CSS model, you
-	 *            should set null, else if internal css, you should set
-	 *            STYLE-tag node, else if inline css, you should set the
-	 *            element that is the owner of style-attribute.
-	 */
-	public void setOwnerDOMNode(Node node) {
-		// prohibit owner change
-		Assert.isTrue(ownerNode == null);
-		ownerNode = node;
-		if (ownerNode != null) { // for internal/inline CSS context
-			try {
-				setId(ID_NON_EXTERNAL_CSS);
-			}
-			catch (ResourceInUse e) {
-				// impossible
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private CSSModelParser getParser() {
-		if (fParser == null) {
-			if (getDocument() != null) {
-				fParser = new CSSModelParser(document);
-			}
-		}
-		return fParser;
-	}
-
-	/**
-	 * @return java.util.List
-	 */
-	public List getStyleListeners() {
-		return getStyleNotifier().getStyleListeners();
-	}
-
-	/**
-	 * 
-	 * @return java.lang.Object
-	 */
-	public java.lang.Object getStyleSheetType() {
-		if (getDocument() instanceof ICSSStyleDeclaration)
-			return INLINE;
-		if (getOwnerDOMNode() != null)
-			return EMBEDDED;
-		else
-			return EXTERNAL;
-	}
-
-	private CSSStyleNotifyAdapter getStyleNotifier() {
-		if (styleNotifier == null) {
-			styleNotifier = (ownerNode != null) ? new CSSEmbededStyleNotifyAdapter(this) : new CSSStyleNotifyAdapter(this);
-		}
-		return styleNotifier;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSModelUpdater getUpdater() {
-		if (fUpdater == null) {
-			fUpdater = new CSSModelUpdater(this);
-			fUpdater.setParser(getParser());
-		}
-		return fUpdater;
-	}
-
-	/**
-	 */
-	public boolean isRecording() {
-		return getStyleNotifier().isRecording();
-	}
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model.
-	 */
-	public boolean isShared() {
-		return (getStyleSheetType() == EXTERNAL) && super.isShared();
-	}
-
-	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 (structuredDocument != getStructuredDocument())
-			setStructuredDocument(structuredDocument);
-		IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
-		if (flatNodes == null)
-			return;
-		if (getDocument() == null)
-			return;
-
-		fStructuredDocumentUpdate = true;
-
-		((CSSStructuredDocumentRegionContainer) getDocument()).removeChildNodes();
-
-		CSSModelParser parser = getParser();
-		parser.setStructuredDocumentEvent(structuredDocumentEvent);
-		parser.replaceStructuredDocumentRegions(flatNodes, null);
-
-		fStructuredDocumentUpdate = false;
-	}
-
-	/**
-	 * noChange method comment.
-	 */
-	public void noChange(NoChangeEvent structuredDocumentEvent) {
-		// nop
-	}
-
-	public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
-		if (structuredDocumentEvent == null) {
-			return;
-		}
-		IStructuredDocumentRegionList oldStructuredDocumentRegions = structuredDocumentEvent.getOldStructuredDocumentRegions();
-		IStructuredDocumentRegionList newStructuredDocumentRegions = structuredDocumentEvent.getNewStructuredDocumentRegions();
-		if (oldStructuredDocumentRegions == null && newStructuredDocumentRegions == null) {
-			return;
-		}
-
-		fStructuredDocumentUpdate = true;
-
-		CSSModelParser parser = getParser();
-		parser.setStructuredDocumentEvent(structuredDocumentEvent);
-		parser.replaceStructuredDocumentRegions(newStructuredDocumentRegions, oldStructuredDocumentRegions);
-
-		fStructuredDocumentUpdate = false;
-	}
-
-	/**
-	 * cleanup -> rebuild CSS Nodes This is pre-beta fix for 178176.
-	 */
-	public void refreshNodes() {
-		// cleanup old nodes
-		fStructuredDocumentUpdate = true;
-		((CSSStructuredDocumentRegionContainer) getDocument()).removeChildNodes();
-		fStructuredDocumentUpdate = false;
-
-		getParser().cleanupUpdateContext();
-
-		IStructuredDocument structuredDocument = getStructuredDocument();
-		String source = structuredDocument.getText();
-
-		structuredDocument.replaceText(this, 0, source.length(), null);
-		structuredDocument.replaceText(this, 0, 0, source);
-	}
-
-	public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
-		if (structuredDocumentEvent == null) {
-			return;
-		}
-		IStructuredDocumentRegion flatNode = structuredDocumentEvent.getStructuredDocumentRegion();
-		if (flatNode == null) {
-			return;
-		}
-		ITextRegion region = structuredDocumentEvent.getRegion();
-		if (region == null) {
-			return;
-		}
-
-		fStructuredDocumentUpdate = true;
-
-		CSSModelParser parser = getParser();
-		parser.setStructuredDocumentEvent(structuredDocumentEvent);
-		parser.changeRegion(flatNode, region);
-
-		fStructuredDocumentUpdate = false;
-	}
-
-	public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
-		if (structuredDocumentEvent == null)
-			return;
-		IStructuredDocumentRegion flatNode = structuredDocumentEvent.getStructuredDocumentRegion();
-		if (flatNode == null)
-			return;
-		ITextRegionList oldRegions = structuredDocumentEvent.getOldRegions();
-		ITextRegionList newRegions = structuredDocumentEvent.getNewRegions();
-		if (oldRegions == null && newRegions == null)
-			return;
-
-		fStructuredDocumentUpdate = true;
-
-		CSSModelParser parser = getParser();
-		parser.setStructuredDocumentEvent(structuredDocumentEvent);
-		parser.replaceRegions(flatNode, newRegions, oldRegions);
-
-		fStructuredDocumentUpdate = false;
-
-	}
-
-	/**
-	 * 
-	 */
-	public void releaseFromEdit() {
-		closeImported();
-		if (getStyleSheetType() == EXTERNAL) {
-			super.releaseFromEdit();
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public void releaseFromRead() {
-		closeImported();
-		if (getStyleSheetType() == EXTERNAL) {
-			super.releaseFromRead();
-		}
-	}
-
-	/**
-	 * @param listener
-	 *            org.eclipse.wst.css.core.event.CSSStyleListener
-	 */
-	public void removeStyleListener(ICSSStyleListener listener) {
-		getStyleNotifier().removeStyleListener(listener);
-	}
-
-	public void setStructuredDocument(IStructuredDocument newStructuredDocument) {
-		IStructuredDocument oldStructuredDocument = super.getStructuredDocument();
-		if (newStructuredDocument == oldStructuredDocument)
-			return; // noting to do
-
-		if (oldStructuredDocument != null)
-			oldStructuredDocument.removeDocumentChangingListener(this);
-		super.setStructuredDocument(newStructuredDocument);
-
-		if (newStructuredDocument != null) {
-			if (newStructuredDocument.getLength() > 0) {
-				newModel(new NewDocumentEvent(newStructuredDocument, this));
-			}
-			newStructuredDocument.addDocumentChangingListener(this);
-		}
-	}
-
-	/**
-	 * @param srcModel
-	 *            com.imb.sed.css.mode.intefaces.ICSSModel
-	 * @param removed
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSSelector[]
-	 * @param added
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSSelector[]
-	 */
-	public void styleChanged(ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media) {
-		getStyleNotifier().styleChanged(srcModel, removed, added, media);
-	}
-
-	/**
-	 * @param srcModel
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSModel
-	 */
-	public void styleUpdate(ICSSModel srcModel) {
-		getStyleNotifier().styleUpdate(srcModel);
-	}
-
-	void valueChanged(CSSNodeImpl node, String oldValue) {
-		if (!fStructuredDocumentUpdate) {
-			CSSModelUpdater updater = getUpdater();
-			updater.valueChanged(node, oldValue);
-		}
-
-		ICSSSelector removed[] = null, added[] = null;
-		if (node != null) {
-			if (node.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) node).getName().equals(ICSSStyleRule.SELECTOR)) {
-				CSSAttrImpl attr = (CSSAttrImpl) node;
-				// collect changed selector
-				ICSSSelectorList list = new CSSSelectorListImpl(attr.getValue());
-				added = new ICSSSelector[list.getLength()];
-				for (int i = 0; i < list.getLength(); i++)
-					added[i] = list.getSelector(i);
-
-				// get old value
-				list = new CSSSelectorListImpl(oldValue);
-				removed = new ICSSSelector[list.getLength()];
-				for (int i = 0; i < list.getLength(); i++)
-					removed[i] = list.getSelector(i);
-			}
-			else if (node instanceof ICSSValue) {
-				ICSSNode rule = node;
-				while (rule != null) {
-					if (rule instanceof ICSSStyleRule)
-						break;
-					rule = rule.getParentNode();
-				}
-				if (rule != null) {
-					ICSSSelectorList list = ((ICSSStyleRule) rule).getSelectors();
-					added = new ICSSSelector[list.getLength()];
-					for (int i = 0; i < list.getLength(); i++)
-						added[i] = list.getSelector(i);
-				}
-			}
-		}
-		if (removed != null || added != null || getDocument().getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
-			// send selector changed event
-			getStyleNotifier().fire(removed, added, null);
-		}
-		// for href attribute
-		if (getStyleListeners() != null && getStyleListeners().size() > 0) {
-			if (node != null && node.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) node).getName().equals(ICSSImportRule.HREF)) {
-				((ICSSImportRule) ((ICSSAttr) node).getOwnerCSSNode()).getStyleSheet();
-			}
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelNodeFeeder.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelNodeFeeder.java
deleted file mode 100644
index 0f50a99..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelNodeFeeder.java
+++ /dev/null
@@ -1,122 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-/**
- * 
- */
-class CSSModelNodeFeeder {
-
-	CSSDocumentImpl fDocument = null;
-	CSSModelUpdateContext fUpdateContext = null;
-
-	/**
-	 * CSSModelNodeFeeder constructor comment.
-	 */
-	CSSModelNodeFeeder() {
-		super();
-	}
-
-	/**
-	 * CSSModelNodeFeeder constructor comment.
-	 */
-	CSSModelNodeFeeder(CSSDocumentImpl document, CSSModelUpdateContext updateContext) {
-		super();
-		fDocument = document;
-		fUpdateContext = updateContext;
-	}
-
-	/**
-	 * 
-	 */
-	CSSCharsetRuleImpl getCSSCharsetRule() {
-		CSSCharsetRuleImpl node;
-		if (fUpdateContext.isActive()) {
-			node = fUpdateContext.getCSSCharsetRule();
-		}
-		else {
-			node = (CSSCharsetRuleImpl) fDocument.createCSSCharsetRule();
-		}
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	CSSFontFaceRuleImpl getCSSFontFaceRule() {
-		CSSFontFaceRuleImpl node;
-		if (fUpdateContext.isActive()) {
-			node = fUpdateContext.getCSSFontFaceRule();
-		}
-		else {
-			node = (CSSFontFaceRuleImpl) fDocument.createCSSFontFaceRule();
-		}
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	CSSImportRuleImpl getCSSImportRule() {
-		CSSImportRuleImpl node;
-		if (fUpdateContext.isActive()) {
-			node = fUpdateContext.getCSSImportRule();
-		}
-		else {
-			node = (CSSImportRuleImpl) fDocument.createCSSImportRule();
-		}
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	CSSMediaRuleImpl getCSSMediaRule() {
-		CSSMediaRuleImpl node;
-		if (fUpdateContext.isActive()) {
-			node = fUpdateContext.getCSSMediaRule();
-		}
-		else {
-			node = (CSSMediaRuleImpl) fDocument.createCSSMediaRule();
-		}
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	CSSPageRuleImpl getCSSPageRule() {
-		CSSPageRuleImpl node;
-		if (fUpdateContext.isActive()) {
-			node = fUpdateContext.getCSSPageRule();
-		}
-		else {
-			node = (CSSPageRuleImpl) fDocument.createCSSPageRule();
-		}
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	CSSStyleRuleImpl getCSSStyleRule() {
-		CSSStyleRuleImpl node;
-		if (fUpdateContext.isActive()) {
-			node = fUpdateContext.getCSSStyleRule();
-		}
-		else {
-			node = (CSSStyleRuleImpl) fDocument.createCSSStyleRule();
-		}
-		return node;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java
deleted file mode 100644
index 99a4009..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java
+++ /dev/null
@@ -1,1275 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSRuleContainer;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.text.StructuredDocumentWalker;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-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.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.sse.core.internal.text.BasicStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.CoreNodeList;
-import org.eclipse.wst.sse.core.internal.text.TextRegionListImpl;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-
-/**
- * 
- */
-class CSSModelParser {
-
-	private CSSDocumentImpl fDocument = null;
-	private CSSModelCreationContext fCreationContext = null;
-	private CSSModelDeletionContext fDeletionContext = null;
-	private CSSModelUpdateContext fUpdateContext = null;
-	private CSSModelNodeFeeder fFeeder = null;
-	private StructuredDocumentWalker fStructuredDocumentWalker = null;
-	private boolean fParseFloating = false;
-
-	/**
-	 * CSSModelParser constructor comment.
-	 */
-	private CSSModelParser() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	CSSModelParser(CSSDocumentImpl doc) {
-		super();
-		fDocument = doc;
-		fCreationContext = new CSSModelCreationContext(doc);
-		fDeletionContext = new CSSModelDeletionContext(doc);
-		fUpdateContext = new CSSModelUpdateContext();
-		fFeeder = new CSSModelNodeFeeder(doc, fUpdateContext);
-	}
-
-	/**
-	 * 
-	 */
-	void changeStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		replaceStructuredDocumentRegions(new CoreNodeList(flatNode, flatNode), new CoreNodeList(flatNode, flatNode));
-	}
-
-	/**
-	 * 
-	 */
-	void changeRegion(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		if (flatNode == null || region == null) {
-			return;
-		}
-		if (fDocument == null) {
-			return;
-		}
-
-		changeStructuredDocumentRegion(flatNode);
-	}
-
-	/**
-	 * 
-	 */
-	private void checkNextNode(IStructuredDocumentRegion flatNode, String type) {
-		IStructuredDocumentRegion next = CSSUtil.findNextSignificantNode(flatNode);
-		if (CSSUtil.getStructuredDocumentRegionType(next) == type) {
-			fCreationContext.setReparseStart(flatNode.getEnd());
-			fCreationContext.setReparseEnd(next.getEnd());
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private void cleanupDeletionContext() {
-		// setupDeletionContext(null);
-	}
-
-	/**
-	 * 
-	 */
-	boolean cleanupFirstNode(IStructuredDocumentRegion firstNode, CSSStructuredDocumentRegionContainer target) {
-		if (firstNode == null || target == null) {
-			return false;
-		}
-
-		if (firstNode == target.getFirstStructuredDocumentRegion()) {
-			IStructuredDocumentRegion nextNode = fStructuredDocumentWalker.getNextNodeInCurrent(firstNode);
-			IStructuredDocumentRegion lastNode = target.getLastStructuredDocumentRegion();
-			if (lastNode == null || fStructuredDocumentWalker.isOldNode(lastNode) || nextNode == null || lastNode.getStartOffset() < nextNode.getStartOffset()) {
-				target.setRangeStructuredDocumentRegion(null, null);
-			}
-			else {
-				target.setFirstStructuredDocumentRegion(nextNode);
-			}
-			ICSSNode parent = target.getParentNode();
-			if (parent instanceof CSSStructuredDocumentRegionContainer) {
-				cleanupFirstNode(firstNode, (CSSStructuredDocumentRegionContainer) parent);
-				return true;
-			}
-		}
-
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	boolean cleanupLastNode(IStructuredDocumentRegion lastNode, CSSStructuredDocumentRegionContainer target) {
-		if (lastNode == null || target == null) {
-			return false;
-		}
-
-		if (lastNode == target.getLastStructuredDocumentRegion()) {
-			IStructuredDocumentRegion prevNode = fStructuredDocumentWalker.getPrevNodeInCurrent(lastNode);
-			IStructuredDocumentRegion firstNode = target.getFirstStructuredDocumentRegion();
-			if (firstNode == null || fStructuredDocumentWalker.isOldNode(firstNode) || prevNode == null || prevNode.getStartOffset() < firstNode.getStartOffset()) {
-				target.setRangeStructuredDocumentRegion(null, null);
-			}
-			else {
-				target.setLastStructuredDocumentRegion(prevNode);
-			}
-			ICSSNode parent = target.getParentNode();
-			if (parent instanceof CSSStructuredDocumentRegionContainer) {
-				cleanupLastNode(lastNode, (CSSStructuredDocumentRegionContainer) parent);
-				return true;
-			}
-		}
-
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	int cleanupUpdateContext() {
-		int remains = fUpdateContext.getNodeCount();
-		fUpdateContext.cleanupContext();
-		return remains;
-	}
-
-	/**
-	 * create floating CSS rule (owner document will be set) this is for
-	 * CSSStyleSheet.createCSSRule(String)
-	 * 
-	 * @return org.w3c.dom.css.CSSRule
-	 */
-	CSSRule createCSSRule(IStructuredDocumentRegionList flatNodes) {
-		if (flatNodes == null) {
-			return null;
-		}
-
-		fParseFloating = true;
-
-		// setup creation context
-		fCreationContext.clear();
-		fCreationContext.setTargetNode(null);
-		fCreationContext.setNextNode(null);
-		CSSRuleImpl parentRule = null;
-
-		for (Enumeration e = flatNodes.elements(); e.hasMoreElements();) {
-			IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
-			if (flatNode == null) {
-				continue;
-			}
-			CSSNodeImpl modified = insertStructuredDocumentRegion(flatNode);
-			if (parentRule == null && modified instanceof CSSRuleImpl) {
-				parentRule = (CSSRuleImpl) modified;
-			}
-		}
-
-		fParseFloating = false;
-
-		if (parentRule != null) {
-			CSSModelUtil.cleanupContainer(parentRule);
-		}
-
-		return parentRule;
-	}
-
-	/**
-	 * 
-	 */
-	private IStructuredDocumentRegion findBraceClose(int depth, IStructuredDocumentRegion start, boolean bBreakSibling) {
-		IStructuredDocumentRegion result = null;
-		int braceLevel = 0;
-		IStructuredDocumentRegion prevNode = null;
-		IStructuredDocumentRegion region = start.getNext();
-		for (; region != null; region = region.getNext()) {
-			int offset = region.getStart();
-			if (offset < 0) {
-				Assert.isTrue(false);
-				break;
-			}
-			CSSNodeImpl node = getNodeAt(offset);
-			int depthHit = (node != null) ? CSSModelUtil.getDepth(node) : -1;
-			if (depth <= depthHit) {
-				// sibling is found before "}"
-				if (bBreakSibling) {
-					CSSNodeImpl parent = (CSSNodeImpl) node.getParentNode();
-					while (depth <= CSSModelUtil.getDepth(parent)) {
-						node = parent;
-						parent = (CSSNodeImpl) parent.getParentNode();
-					}
-					if (parent != null && node != null) {
-						parent.removeChild(node);
-					}
-				}
-				else {
-					result = prevNode;
-					break;
-				}
-			}
-			String type = CSSUtil.getStructuredDocumentRegionType(region);
-			if (type == CSSRegionContexts.CSS_LBRACE) {
-				braceLevel++;
-			}
-			if (type == CSSRegionContexts.CSS_RBRACE) {
-				braceLevel--;
-				if (braceLevel < 0) {
-					result = region;
-					break;
-				}
-			}
-			prevNode = region;
-		}
-
-		if (result == null && region == null) {
-			// reach the end of document
-			result = prevNode;
-		}
-
-		return result;
-	}
-
-	/**
-	 * 
-	 */
-	private IStructuredDocumentRegionList getStructuredDocumentRegionList(int start, int end) {
-		IStructuredDocumentRegionList nodeList = null;
-		if (0 <= start && start <= end) {
-			ICSSModel model = fDocument.getModel();
-			if (model instanceof CSSModelImpl) {
-				IStructuredDocument structuredDocument = ((CSSModelImpl) model).getStructuredDocument();
-				if (structuredDocument != null) {
-					IStructuredDocumentRegion startNode = structuredDocument.getRegionAtCharacterOffset(start);
-					IStructuredDocumentRegion endNode = structuredDocument.getRegionAtCharacterOffset(end - 1);
-					if (startNode != null && endNode != null) {
-						nodeList = new CoreNodeList(startNode, endNode);
-					}
-				}
-			}
-		}
-
-		return nodeList;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSNodeImpl getNodeAt(int offset) {
-		CSSNodeImpl rootNode = fCreationContext.getRootNode();
-		ICSSNode target = rootNode.getNodeAt(offset);
-		if (target instanceof CSSNodeImpl) {
-			return (CSSNodeImpl) target;
-		}
-		else {
-			return null;
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private CSSNodeImpl insertBraceClose(IStructuredDocumentRegion region) {
-		ICSSNode target = CSSModelUtil.findBraceContainer(fCreationContext.getTargetNode());
-
-		if (!(target instanceof CSSStructuredDocumentRegionContainer)) {
-			return null;
-		}
-
-		CSSStructuredDocumentRegionContainer parent = (CSSStructuredDocumentRegionContainer) target;
-		if (CSSModelUtil.isInterruption(parent, region)) {
-			ICSSNode node = parent.getParentNode();
-			if (node instanceof CSSNodeImpl) {
-				fCreationContext.setReparseStart(parent.getStartOffset());
-				fCreationContext.setReparseEnd(parent.getEndOffset());
-				((CSSNodeImpl) node).removeChild(parent);
-			}
-			return null;
-		}
-
-		if (parent instanceof ICSSPageRule || parent instanceof ICSSMediaRule || parent instanceof CSSFontFaceRule || parent instanceof ICSSStyleRule) {
-			CSSModelUtil.expandStructuredDocumentRegionContainer(parent, region);
-			if (!CSSModelUtil.isBraceClosed(target)) {
-				fCreationContext.setTargetNode(parent.getParentNode());
-				fCreationContext.setNextNode(parent.getNextSibling());
-				return parent;
-			}
-		}
-
-		return null;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSNodeImpl insertBraceOpen(IStructuredDocumentRegion region) {
-		IStructuredDocumentRegion keyRegion = CSSUtil.findPreviousSignificantNode(region);
-		if (keyRegion == null) {
-			return null;
-		}
-		if (!fParseFloating) {
-			CSSNodeImpl node = getNodeAt(keyRegion.getStartOffset());
-			if (node != null && !(node instanceof ICSSRuleContainer)) {
-				return null;
-			}
-		}
-		String type = CSSUtil.getStructuredDocumentRegionType(keyRegion);
-
-		CSSNodeImpl inserted = null;
-		if (type == CSSRegionContexts.CSS_PAGE) {
-			inserted = insertPageRule(keyRegion, region);
-		}
-		else if (type == CSSRegionContexts.CSS_MEDIA) {
-			inserted = insertMediaRule(keyRegion, region);
-		}
-		else if (type == CSSRegionContexts.CSS_FONT_FACE) {
-			inserted = insertFontFaceRule(keyRegion, region);
-		}
-		else if (CSSUtil.isSelectorText(keyRegion)) {
-			inserted = insertStyleRule(keyRegion, region);
-		}
-
-		if (inserted instanceof CSSStructuredDocumentRegionContainer) {
-			// CSSModelUtil.expandStructuredDocumentRegionContainer((CSSStructuredDocumentRegionContainer)inserted,
-			// flatNode);
-			IStructuredDocumentRegion braceClose = findBraceClose(CSSModelUtil.getDepth(inserted), region, (type == CSSRegionContexts.CSS_MEDIA));
-			if (braceClose != null) {
-				fCreationContext.setReparseStart(region.getEnd());
-				fCreationContext.setReparseEnd(braceClose.getEnd());
-			}
-		}
-
-		return inserted;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSNodeImpl insertCharsetRule(IStructuredDocumentRegion beginDocRegion, IStructuredDocumentRegion endDocRegion) {
-		CSSNodeImpl parent = fCreationContext.getTargetNode();
-		if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
-			return null;
-		}
-
-		ITextRegionList regions = new TextRegionListImpl(beginDocRegion.getRegions());
-		regions.remove(0); // must be "@charset"
-		ITextRegion encodingRegion = null;
-		while (!regions.isEmpty()) {
-			ITextRegion textRegion = regions.remove(0);
-			if (textRegion == null) {
-				continue;
-			}
-			String type = textRegion.getType();
-			if (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT) {
-				continue;
-			}
-			if (type == CSSRegionContexts.CSS_STRING) {
-				encodingRegion = textRegion;
-				break;
-			}
-			else {
-				break;
-			}
-		}
-		if (encodingRegion == null) {
-			return null;
-		}
-
-		CSSCharsetRuleImpl rule = fFeeder.getCSSCharsetRule();
-		if (rule == null) {
-			return null;
-		}
-
-		if (!fUpdateContext.isActive()) {
-			rule.setAttribute(ICSSCharsetRule.ENCODING, beginDocRegion.getText(encodingRegion));
-		}
-
-		// setup flat container
-		rule.setRangeStructuredDocumentRegion(beginDocRegion, endDocRegion);
-		CSSAttrImpl attr = rule.getAttributeNode(ICSSCharsetRule.ENCODING);
-		if (attr != null) {
-			attr.setRangeRegion(beginDocRegion, encodingRegion, encodingRegion);
-		}
-
-		// insert to tree
-		if (!fUpdateContext.isActive() && parent != null) {
-			propagateRangePreInsert(parent, rule);
-			CSSNodeImpl next = fCreationContext.getNextNode();
-			if (next != null) {
-				parent.insertBefore(rule, next);
-			}
-			else {
-				parent.appendChild(rule);
-			}
-		}
-
-		return rule;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSNodeImpl insertStructuredDocumentRegion(IStructuredDocumentRegion region) {
-		if (fCreationContext == null || region == null) {
-			return null;
-		}
-
-		String type = ((BasicStructuredDocumentRegion) region).getType();
-		CSSNodeImpl modified = null;
-
-		ICSSNode target = fCreationContext.getTargetNode();
-
-		if ((fParseFloating && target == null) || target instanceof ICSSRuleContainer) {
-			if (type == CSSRegionContexts.CSS_DELIMITER) {
-				modified = insertSemiColonForRule(region);
-			}
-			else if (type == CSSRegionContexts.CSS_LBRACE) {
-				modified = insertBraceOpen(region);
-			}
-			else if (type == CSSRegionContexts.CSS_RBRACE) {
-				modified = insertBraceClose(region);
-			}
-			else if (type == CSSRegionContexts.CSS_MEDIA || type == CSSRegionContexts.CSS_PAGE || type == CSSRegionContexts.CSS_FONT_FACE || CSSUtil.isSelectorText(region)) {
-				checkNextNode(region, CSSRegionContexts.CSS_LBRACE);
-			}
-			else if (type == CSSRegionContexts.CSS_IMPORT || type == CSSRegionContexts.CSS_CHARSET) {
-				checkNextNode(region, CSSRegionContexts.CSS_DELIMITER);
-			}
-		}
-		else if ((target instanceof CSSRuleDeclContainer || target instanceof CSSStyleDeclaration) && type == CSSRegionContexts.CSS_DECLARATION_PROPERTY) {
-			modified = insertStyleDeclarationItem(region);
-		}
-		else if (target instanceof ICSSStyleDeclItem && type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-			modified = insertSemiColonForStyleDeclarationItem(region);
-		}
-		else if (type == CSSRegionContexts.CSS_RBRACE) {
-			modified = insertBraceClose(region);
-		}
-
-		// post process
-		if (modified != null) {
-			if (modified instanceof CSSStructuredDocumentRegionContainer) {
-				((CSSStructuredDocumentRegionContainer) modified).propagateRangeStructuredDocumentRegion();
-			}
-		}
-
-		return modified;
-	}
-
-	/**
-	 * 
-	 */
-	private void insertStructuredDocumentRegions(IStructuredDocumentRegionList regionList) {
-		for (Enumeration e = regionList.elements(); e.hasMoreElements();) {
-			IStructuredDocumentRegion region = (IStructuredDocumentRegion) e.nextElement();
-			if (region == null) {
-				continue;
-			}
-			insertStructuredDocumentRegion(region);
-			if (fCreationContext.isToReparse()) {
-				int origStart = region.getEnd();
-				int origEnd = regionList.item(regionList.getLength() - 1).getEnd();
-				int newStart = fCreationContext.getReparseStart();
-				int newEnd = fCreationContext.getReparseEnd();
-				if (newStart < origStart || origEnd < newEnd) {
-					IStructuredDocumentRegionList newNodeList = getStructuredDocumentRegionList(newStart, newEnd);
-					setupCreationContext(newNodeList.item(0));
-					insertStructuredDocumentRegions(newNodeList);
-					return;
-				}
-				else {
-					fCreationContext.resetReparseRange();
-				}
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private CSSNodeImpl insertFontFaceRule(IStructuredDocumentRegion region, IStructuredDocumentRegion braceNode) {
-		CSSNodeImpl parent = fCreationContext.getTargetNode();
-		if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
-			return null;
-		}
-
-		CSSFontFaceRuleImpl rule = fFeeder.getCSSFontFaceRule();
-		if (rule == null) {
-			return null;
-		}
-
-		// setup flat container
-		rule.setRangeStructuredDocumentRegion(region, braceNode);
-
-		// insert to tree
-		if (!fUpdateContext.isActive() && parent != null) {
-			propagateRangePreInsert(parent, rule);
-			CSSNodeImpl next = fCreationContext.getNextNode();
-			if (next != null) {
-				parent.insertBefore(rule, next);
-			}
-			else {
-				parent.appendChild(rule);
-			}
-		}
-
-		fCreationContext.setTargetNode(rule);
-		// TargetNext is set to null automatically
-
-		return rule;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSNodeImpl insertImportRule(IStructuredDocumentRegion beginDocRegion, IStructuredDocumentRegion endDocRegion) {
-		CSSNodeImpl parent = fCreationContext.getTargetNode();
-		if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
-			return null;
-		}
-
-		ITextRegionList regions = new TextRegionListImpl(beginDocRegion.getRegions());
-		regions.remove(0); // must be "@import"
-		ITextRegion hrefRegion = null;
-		while (!regions.isEmpty()) {
-			ITextRegion textRegion = regions.remove(0);
-			if (textRegion == null) {
-				continue;
-			}
-			String type = textRegion.getType();
-			if (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT) {
-				continue;
-			}
-			if (type == CSSRegionContexts.CSS_URI || type == CSSRegionContexts.CSS_STRING) {
-				hrefRegion = textRegion;
-				break;
-			}
-			else {
-				break;
-			}
-		}
-		if (hrefRegion == null) {
-			return null;
-		}
-
-		CSSImportRuleImpl rule = fFeeder.getCSSImportRule();
-		if (rule == null) {
-			return null;
-		}
-
-		CSSUtil.stripSurroundingSpace(regions);
-		MediaListImpl mediaList = (MediaListImpl) rule.getMedia();
-		setMediaList(mediaList, beginDocRegion, regions);
-
-		if (!fUpdateContext.isActive()) {
-			rule.setAttribute(ICSSImportRule.HREF, beginDocRegion.getText(hrefRegion));
-		}
-
-		// setup flat container
-		rule.setRangeStructuredDocumentRegion(beginDocRegion, endDocRegion);
-		CSSAttrImpl attr = rule.getAttributeNode(ICSSImportRule.HREF);
-		if (attr != null) {
-			attr.setRangeRegion(beginDocRegion, hrefRegion, hrefRegion);
-		}
-
-		// insert to tree
-		if (!fUpdateContext.isActive() && parent != null) {
-			propagateRangePreInsert(parent, rule);
-			CSSNodeImpl next = fCreationContext.getNextNode();
-			if (next != null) {
-				parent.insertBefore(rule, next);
-			}
-			else {
-				parent.appendChild(rule);
-			}
-		}
-
-		return rule;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSNodeImpl insertMediaRule(IStructuredDocumentRegion flatNode, IStructuredDocumentRegion braceNode) {
-		CSSNodeImpl parent = fCreationContext.getTargetNode();
-		if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
-			return null;
-		}
-
-		CSSMediaRuleImpl rule = fFeeder.getCSSMediaRule();
-		if (rule == null) {
-			return null;
-		}
-
-		ITextRegionList regions = new TextRegionListImpl(flatNode.getRegions());
-		regions.remove(0); // must be "@media"
-
-		CSSUtil.stripSurroundingSpace(regions);
-		MediaListImpl mediaList = (MediaListImpl) rule.getMedia();
-		setMediaList(mediaList, flatNode, regions);
-
-		// setup flat container
-		rule.setRangeStructuredDocumentRegion(flatNode, braceNode);
-
-		// insert to tree
-		if (!fUpdateContext.isActive() && parent != null) {
-			propagateRangePreInsert(parent, rule);
-			CSSNodeImpl next = fCreationContext.getNextNode();
-			if (next != null) {
-				parent.insertBefore(rule, next);
-			}
-			else {
-				parent.appendChild(rule);
-			}
-		}
-
-		fCreationContext.setTargetNode(rule);
-		// TargetNext is set to null automatically
-
-		return rule;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSNodeImpl insertPageRule(IStructuredDocumentRegion flatNode, IStructuredDocumentRegion braceNode) {
-		CSSNodeImpl parent = fCreationContext.getTargetNode();
-		if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
-			return null;
-		}
-
-		// get selector regions
-		ITextRegionList selectorRegions = new TextRegionListImpl(flatNode.getRegions());
-		selectorRegions.remove(0); // must be "@page"
-		CSSUtil.stripSurroundingSpace(selectorRegions);
-
-		CSSPageRuleImpl rule = fFeeder.getCSSPageRule();
-		if (rule == null) {
-			return null;
-		}
-
-		if (!fUpdateContext.isActive()) {
-			String selectorStr = CSSUtil.getRegionText(flatNode, selectorRegions);
-			if (0 < selectorStr.length()) {
-				rule.setSelectorText(selectorStr);
-			}
-		}
-
-		// setup flat container
-		rule.setRangeStructuredDocumentRegion(flatNode, braceNode);
-		CSSAttrImpl attr = rule.getAttributeNode(ICSSPageRule.SELECTOR);
-		if (attr != null && selectorRegions != null && !selectorRegions.isEmpty()) {
-			attr.setRangeRegion(flatNode, selectorRegions.get(0), selectorRegions.get(selectorRegions.size() - 1));
-		}
-
-		// insert to tree
-		if (!fUpdateContext.isActive() && parent != null) {
-			propagateRangePreInsert(parent, rule);
-			CSSNodeImpl next = fCreationContext.getNextNode();
-			if (next != null) {
-				parent.insertBefore(rule, next);
-			}
-			else {
-				parent.appendChild(rule);
-			}
-		}
-
-		fCreationContext.setTargetNode(rule);
-		// TargetNext is set to null automatically
-
-		return rule;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSNodeImpl insertSemiColonForRule(IStructuredDocumentRegion region) {
-		IStructuredDocumentRegion keyRegion = CSSUtil.findPreviousSignificantNode(region);
-		String type = CSSUtil.getStructuredDocumentRegionType(keyRegion);
-
-		CSSNodeImpl inserted = null;
-		if (type == CSSRegionContexts.CSS_IMPORT) {
-			inserted = insertImportRule(keyRegion, region);
-		}
-		else if (type == CSSRegionContexts.CSS_CHARSET) {
-			inserted = insertCharsetRule(keyRegion, region);
-		}
-
-		return inserted;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSNodeImpl insertSemiColonForStyleDeclarationItem(IStructuredDocumentRegion region) {
-		// only target/net node is changed. nothing to do.
-
-		CSSNodeImpl targetNode = fCreationContext.getTargetNode();
-		if (targetNode instanceof ICSSStyleDeclItem) {
-			int offset = targetNode.getStartOffset();
-			// widen document region range
-			// ((CSSStyleDeclItemImpl)targetNode).setLastStructuredDocumentRegion(region);
-			CSSModelUtil.expandStructuredDocumentRegionContainer((CSSStyleDeclItemImpl) targetNode, region);
-			// psStructuredDocumentRegion indicates CSSStyleDeclItem
-			ICSSNode parentNode = targetNode.getParentNode();
-			fCreationContext.setTargetNode(parentNode);
-			ICSSNode next = null;
-			if (parentNode.hasChildNodes()) {
-				for (ICSSNode child = targetNode.getFirstChild(); child != null; child = child.getNextSibling()) {
-					if (child instanceof CSSStructuredDocumentRegionContainer && offset < ((CSSStructuredDocumentRegionContainer) child).getStartOffset()) {
-						next = child;
-						break;
-					}
-				}
-			}
-			fCreationContext.setNextNode(next);
-
-			return targetNode;
-		}
-
-		return null;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSNodeImpl insertStyleDeclarationItem(IStructuredDocumentRegion docRegion) {
-		CSSStyleDeclarationImpl parent = null;
-		CSSNodeImpl node = fCreationContext.getTargetNode();
-		if (node instanceof CSSRuleDeclContainer) {
-			CSSRuleDeclContainer declContainer = (CSSRuleDeclContainer) node;
-			parent = (CSSStyleDeclarationImpl) declContainer.getStyle();
-		}
-		else if (node instanceof CSSStyleDeclarationImpl) {
-			parent = (CSSStyleDeclarationImpl) node;
-		}
-
-		CSSDeclarationItemParser itemParser = new CSSDeclarationItemParser(parent.getOwnerDocument());
-		itemParser.setStructuredDocumentTemporary(false);
-		itemParser.setUpdateContext(fUpdateContext);
-		CSSStyleDeclItemImpl declItem = itemParser.setupDeclarationItem(docRegion);
-		if (declItem == null) {
-			return null;
-		}
-
-		// setup flat container
-		declItem.setRangeStructuredDocumentRegion(docRegion, docRegion);
-
-		// insert to tree
-		if (!fUpdateContext.isActive()) {
-			propagateRangePreInsert(parent, declItem);
-			CSSNodeImpl next = fCreationContext.getNextNode();
-			if (next != null) {
-				parent.insertBefore(declItem, next);
-			}
-			else {
-				parent.appendChild(declItem);
-			}
-		}
-
-		fCreationContext.setTargetNode(declItem);
-		// TargetNext is set to null automatically
-
-		return declItem;
-	}
-
-	/**
-	 * 
-	 */
-	private CSSNodeImpl insertStyleRule(IStructuredDocumentRegion flatNode, IStructuredDocumentRegion braceNode) {
-		CSSNodeImpl parent = fCreationContext.getTargetNode();
-		if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
-			return null;
-		}
-
-		// get selector regions
-		ITextRegionList selectorRegions = new TextRegionListImpl(flatNode.getRegions());
-		CSSUtil.stripSurroundingSpace(selectorRegions);
-
-		CSSStyleRuleImpl rule = fFeeder.getCSSStyleRule();
-		if (rule == null) {
-			return null;
-		}
-
-		if (!fUpdateContext.isActive()) {
-			String selectorStr = CSSUtil.getRegionText(flatNode, selectorRegions);
-			if (selectorStr != null && 0 < selectorStr.length()) {
-				rule.setSelectorText(selectorStr);
-			}
-		}
-
-		// setup flat container
-		rule.setRangeStructuredDocumentRegion(flatNode, braceNode);
-		CSSAttrImpl attr = rule.getAttributeNode(ICSSPageRule.SELECTOR);
-		if (attr != null && selectorRegions != null && !selectorRegions.isEmpty()) {
-			attr.setRangeRegion(flatNode, selectorRegions.get(0), selectorRegions.get(selectorRegions.size() - 1));
-		}
-
-		// insert to tree
-		if (!fUpdateContext.isActive() && parent != null) {
-			propagateRangePreInsert(parent, rule);
-			CSSNodeImpl next = fCreationContext.getNextNode();
-			if (next != null) {
-				parent.insertBefore(rule, next);
-			}
-			else {
-				parent.appendChild(rule);
-			}
-		}
-
-		fCreationContext.setTargetNode(rule);
-		// TargetNext is set to null automatically
-
-		return rule;
-	}
-
-	/**
-	 * 
-	 */
-	private void pretendRemoveNode() {
-		CSSStructuredDocumentRegionContainer node = (CSSStructuredDocumentRegionContainer) fUpdateContext.getDeletionTarget();
-		if (node == null) {
-			return;
-		}
-
-		IStructuredDocumentRegion firstNode = node.getFirstStructuredDocumentRegion();
-		if (firstNode != null) {
-			fDeletionContext.expandRemovedRangeBegin(firstNode);
-		}
-		IStructuredDocumentRegion lastNode = node.getLastStructuredDocumentRegion();
-		if (lastNode != null) {
-			fDeletionContext.expandRemovedRangeEnd(lastNode);
-		}
-
-		shrinkContainer((CSSStructuredDocumentRegionContainer) fUpdateContext.getDeletionTargetParent(), node);
-	}
-
-	/**
-	 * @param parent
-	 *            org.eclipse.wst.css.core.model.CSSNodeImpl
-	 * @param child
-	 *            org.eclipse.wst.css.core.model.CSSNodeImpl
-	 */
-	private void propagateRangePreInsert(CSSNodeImpl parent, CSSNodeImpl child) {
-		if (!(child instanceof CSSStructuredDocumentRegionContainer) || !(parent instanceof CSSStructuredDocumentRegionContainer)) {
-			return;
-		}
-
-		CSSStructuredDocumentRegionContainer parentContainer = (CSSStructuredDocumentRegionContainer) parent;
-		CSSStructuredDocumentRegionContainer childContainer = (CSSStructuredDocumentRegionContainer) child;
-		IStructuredDocumentRegion firstNode = childContainer.getFirstStructuredDocumentRegion();
-		IStructuredDocumentRegion lastNode = childContainer.getLastStructuredDocumentRegion();
-		if (firstNode == null || lastNode == null) {
-			return;
-		}
-
-		boolean bModified = parentContainer.includeRangeStructuredDocumentRegion(firstNode, lastNode);
-		if (bModified) {
-			parentContainer.propagateRangeStructuredDocumentRegion();
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private void removeStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		String type = CSSUtil.getStructuredDocumentRegionType(flatNode);
-		if (type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-			do {
-				flatNode = fStructuredDocumentWalker.getPrevNode(flatNode);
-				type = (flatNode != null) ? CSSUtil.getStructuredDocumentRegionType(flatNode) : null;
-			}
-			while (type != null && (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT));
-		}
-		if (flatNode == null) {
-			return;
-		}
-
-		// if (fDeletionContext.isInRemovedRange(flatNode)) { // already
-		// removed
-		// return;
-		// }
-
-		CSSStructuredDocumentRegionContainer node = fDeletionContext.findDeletionTarget(fDocument, flatNode);
-		if (node == null || node == fDocument) {
-			return; // not attached with any treeNode
-		}
-
-		if (node instanceof CSSStyleDeclarationImpl) {
-			ICSSNode rule = node.getParentNode();
-			if (rule instanceof CSSStyleRuleImpl) {
-				node = (CSSStructuredDocumentRegionContainer) rule;
-			}
-			else {
-				return;
-			}
-		}
-
-		// ICSSNode p = node.getParentNode();
-		// if (p == null || ! (p instanceof
-		// CSSStructuredDocumentRegionContainer)) {
-		// return;
-		// }
-		// CSSStructuredDocumentRegionContainer parent =
-		// (CSSStructuredDocumentRegionContainer)p;
-
-		if (fDeletionContext.addNodeToBeRemoved(node)) {
-			IStructuredDocumentRegion firstNode = node.getFirstStructuredDocumentRegion();
-			if (firstNode != null) {
-				fDeletionContext.expandRemovedRangeBegin(firstNode);
-			}
-			IStructuredDocumentRegion lastNode = node.getLastStructuredDocumentRegion();
-			if (lastNode != null) {
-				fDeletionContext.expandRemovedRangeEnd(lastNode);
-			}
-		}
-
-		// shrinkContainer(node);
-		// parent.removeChild(node);
-	}
-
-	/**
-	 * 
-	 */
-	private void removeStructuredDocumentRegions(IStructuredDocumentRegionList flatNodes) {
-		for (Enumeration e = flatNodes.elements(); e.hasMoreElements();) {
-			IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
-			if (flatNode == null) {
-				continue;
-			}
-			removeStructuredDocumentRegion(flatNode);
-		}
-
-		Iterator i = fDeletionContext.getNodesToBeRemoved();
-		while (i.hasNext()) {
-			CSSNodeImpl node = (CSSNodeImpl) i.next();
-			if (!(node instanceof CSSStructuredDocumentRegionContainer)) {
-				continue;
-			}
-			CSSNodeImpl parent = (CSSNodeImpl) node.getParentNode();
-			if (!(parent instanceof CSSStructuredDocumentRegionContainer)) {
-				continue;
-			}
-			shrinkContainer((CSSStructuredDocumentRegionContainer) parent, (CSSStructuredDocumentRegionContainer) node);
-			parent.removeChild(node);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	void replaceStructuredDocumentRegions(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
-		if (fDocument == null || fCreationContext == null) {
-			return;
-		}
-
-		if (oldStructuredDocumentRegions != null && 0 < oldStructuredDocumentRegions.getLength()) {
-			setupDeletionContext(newStructuredDocumentRegions, oldStructuredDocumentRegions);
-			short updateMode = fUpdateContext.getUpdateMode();
-			if (updateMode == CSSModelUpdateContext.UPDATE_IDLE) {
-				removeStructuredDocumentRegions(oldStructuredDocumentRegions);
-			}
-			else {
-				pretendRemoveNode();
-			}
-			newStructuredDocumentRegions = getStructuredDocumentRegionList(fDeletionContext.getRemovedRangeBegin(), fDeletionContext.getRemovedRangeEnd());
-			cleanupDeletionContext();
-		}
-
-		if (newStructuredDocumentRegions != null && 0 < newStructuredDocumentRegions.getLength()) {
-			setupCreationContext(newStructuredDocumentRegions.item(0));
-			insertStructuredDocumentRegions(newStructuredDocumentRegions);
-		}
-
-		// make document hold whole structuredDocument
-		/*
-		 * boolean bUpdate = false; IStructuredDocumentRegion flatNode;
-		 * flatNode = fDocument.getFirstStructuredDocumentRegion(); bUpdate =
-		 * bUpdate || (flatNode == null ||
-		 * fStructuredDocumentWalker.isOldNode(flatNode) ||
-		 * flatNode.getPrevious() != null); flatNode =
-		 * fDocument.getLastStructuredDocumentRegion(); bUpdate = bUpdate ||
-		 * (flatNode == null || fStructuredDocumentWalker.isOldNode(flatNode) ||
-		 * flatNode.getNext() != null);
-		 */
-		IStructuredDocument structuredDocument = fStructuredDocumentWalker.getStructuredDocument();
-		fDocument.setRangeStructuredDocumentRegion(structuredDocument.getFirstStructuredDocumentRegion(), structuredDocument.getLastStructuredDocumentRegion());
-		/* } */
-
-		// remove in official release
-		// CSSModelUtil.diagnoseTree(fDocument,
-		// fStructuredDocumentWalker.getStructuredDocument());
-	}
-
-	/**
-	 * 
-	 */
-	void replaceRegions(IStructuredDocumentRegion flatNode, ITextRegionList newRegions, ITextRegionList oldRegions) {
-		if (flatNode == null) {
-			return;
-		}
-		if (newRegions == null || oldRegions == null) {
-			return;
-		}
-		if (fDocument == null) {
-			return;
-		}
-
-		changeStructuredDocumentRegion(flatNode);
-	}
-
-	/**
-	 */
-	private void resetCreationTarget(IStructuredDocumentRegion newStructuredDocumentRegion) {
-		if (newStructuredDocumentRegion == null || newStructuredDocumentRegion.getStartOffset() <= 0) {
-			// top of document
-			fCreationContext.setTargetNode(fDocument);
-			fCreationContext.setNextNode(fDocument.getFirstChild());
-			return;
-		}
-
-		int cursorPos = newStructuredDocumentRegion.getStartOffset();
-		CSSNodeImpl cursorNode = getNodeAt(cursorPos);
-		if (cursorNode == null) { // end of document
-			cursorNode = fDocument;
-		}
-
-		// find edge of tree node
-		CSSNodeImpl node = null;
-		// boolean bOverSemiColon = false;
-		boolean bOverOpenBrace = false;
-		IStructuredDocumentRegion flatNode;
-		for (flatNode = newStructuredDocumentRegion; flatNode != null; flatNode = flatNode.getPrevious()) {
-			node = getNodeAt(flatNode.getStartOffset());
-			if (node == null) {
-				node = fDocument;
-			}
-			if (node != cursorNode || node.getStartOffset() == flatNode.getStartOffset()) {
-				break;
-			}
-			if (flatNode != newStructuredDocumentRegion) {
-				String type = CSSUtil.getStructuredDocumentRegionType(flatNode);
-				// if (type == CSSRegionContexts.CSS_DELIMITER ||
-				// type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-				// bOverSemiColon = true;
-				// } else
-				if (type == CSSRegionContexts.CSS_LBRACE) {
-					bOverOpenBrace = true;
-				}
-			}
-		}
-
-		CSSNodeImpl targetNode = null;
-
-		// if (flatNode == null) {
-		// v<--|
-		// AAAAAA
-		// BBBBBBBBBB cursorNode:A , node:B -> target is A
-		// targetNode = (node == null) ? fDocument : node;
-		// } else
-		if (cursorNode == node) {
-			// v<--|
-			// AAAAAA
-			// BBBBBBBBBB cursorNode:A , node:B -> target is A
-			if (bOverOpenBrace && cursorNode instanceof CSSRuleDeclContainer) {
-				targetNode = (CSSNodeImpl) ((CSSRuleDeclContainer) cursorNode).getStyle();
-			}
-			else {
-				targetNode = cursorNode;
-			}
-		}
-		else {
-			// v<--|
-			// AAA
-			// BBBBBBBBBB cursorNode:B , node:A -> depend on A's node type
-			short nodeType = node.getNodeType();
-			if (nodeType == ICSSNode.STYLEDECLITEM_NODE || nodeType == ICSSNode.CHARSETRULE_NODE || nodeType == ICSSNode.IMPORTRULE_NODE) {
-				// targetNode = (CSSNodeImpl)((bOverSemiColon) ?
-				// node.getParentNode() : node); // NP
-				String regionType = CSSUtil.getStructuredDocumentRegionType(flatNode);
-				if (regionType == CSSRegionContexts.CSS_DELIMITER || regionType == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-					targetNode = (CSSNodeImpl) node.getParentNode();
-				}
-				else {
-					targetNode = node;
-				}
-			}
-			else if (CSSUtil.getStructuredDocumentRegionType(flatNode) == CSSRegionContexts.CSS_RBRACE) {
-				targetNode = (CSSNodeImpl) node.getParentNode();
-			}
-			else {
-				targetNode = node;
-			}
-		}
-
-		fCreationContext.setTargetNode(targetNode);
-		ICSSNode next = null;
-		if (targetNode.hasChildNodes()) {
-			for (ICSSNode child = targetNode.getFirstChild(); child != null; child = child.getNextSibling()) {
-				if (child instanceof CSSStructuredDocumentRegionContainer && cursorPos < ((CSSStructuredDocumentRegionContainer) child).getStartOffset()) {
-					next = child;
-					break;
-				}
-			}
-		}
-		fCreationContext.setNextNode(next);
-
-	}
-
-	/**
-	 */
-	private void resetReparseRange() {
-		fCreationContext.clear();
-	}
-
-	void setStructuredDocumentEvent(StructuredDocumentEvent event) {
-		if (fStructuredDocumentWalker == null) {
-			fStructuredDocumentWalker = new StructuredDocumentWalker();
-		}
-		fStructuredDocumentWalker.initialize(event);
-	}
-
-	/**
-	 * regions: surrounding spaces should be removed. Q. Why did you set
-	 * mediaTable ? A. MediaList may have two or more medium that have same
-	 * value, then searcing in MediaList is not perfect. Q.
-	 * fUpdateContext.isActive() is not care. Are you OK? A. OK.
-	 */
-	private void setMediaList(MediaListImpl mediaList, IStructuredDocumentRegion region, ITextRegionList textRegions) {
-		if (mediaList == null || textRegions == null) {
-			return;
-		}
-		Collection mediaTable = new HashSet();
-		CSSNodeListImpl attrs = mediaList.getMedia();
-		for (int i = 0; i != attrs.getLength(); i++) {
-			mediaTable.add(attrs.item(i));
-		}
-
-		ITextRegion start = null;
-		ITextRegion end = null;
-
-		Iterator i = textRegions.iterator();
-		ITextRegion textRegion = (ITextRegion) ((i.hasNext()) ? i.next() : null);
-		while (textRegion != null) {
-			if (textRegion.getType() == CSSRegionContexts.CSS_MEDIUM) {
-				String mediumStr = region.getText(textRegion);
-				if (0 < mediumStr.length()) {
-					CSSAttrImpl attr = null;
-					// is the medium already set ?
-					Iterator iTable = mediaTable.iterator();
-					while (iTable.hasNext()) {
-						CSSAttrImpl cai = (CSSAttrImpl) iTable.next();
-						if (mediumStr.equalsIgnoreCase(cai.getValue())) {
-							attr = cai;
-							mediaTable.remove(cai);
-							break;
-						}
-					}
-					if (attr == null) {
-						// is not set. create new attribute
-						String key = "mediumP" + mediaList.mediumCounter++; //$NON-NLS-1$
-						mediaList.setAttribute(key, mediumStr);
-						attr = mediaList.getAttributeNode(key);
-					}
-					attr.setRangeRegion(region, textRegion, textRegion);
-					if (start == null) {
-						start = textRegion;
-					}
-					end = textRegion;
-				}
-			}
-			textRegion = (ITextRegion) ((i.hasNext()) ? i.next() : null);
-		}
-
-		if (start != null && end != null) {
-			mediaList.setRangeRegion(region, start, end);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private void setupCreationContext(IStructuredDocumentRegion region) {
-		resetReparseRange();
-		resetCreationTarget(region);
-	}
-
-	/**
-	 * 
-	 */
-	private void setupDeletionContext(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
-		fDeletionContext.setupContext(newStructuredDocumentRegions, oldStructuredDocumentRegions);
-	}
-
-	/**
-	 * 
-	 */
-	void setupUpdateContext(short updateMode, ICSSNode parentNode, ICSSNode targetNode) {
-		fUpdateContext.setupContext(updateMode, parentNode, targetNode);
-	}
-
-	/**
-	 * 
-	 */
-	void shrinkContainer(CSSStructuredDocumentRegionContainer parent, CSSStructuredDocumentRegionContainer child) {
-		if (child == null) {
-			return;
-		}
-
-		boolean bModified = false;
-		bModified = bModified || cleanupLastNode(child.getLastStructuredDocumentRegion(), parent);
-		bModified = bModified || cleanupFirstNode(child.getFirstStructuredDocumentRegion(), parent);
-
-		if (bModified) {
-			if (parent != null) {
-				for (ICSSNode node = parent.getFirstChild(); node != null; node = node.getNextSibling()) {
-					if (child != node && node instanceof CSSStructuredDocumentRegionContainer) {
-						((CSSStructuredDocumentRegionContainer) node).propagateRangeStructuredDocumentRegion();
-					}
-				}
-			}
-		}
-
-		child.setRangeStructuredDocumentRegion(null, null);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdateContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdateContext.java
deleted file mode 100644
index 6344998..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdateContext.java
+++ /dev/null
@@ -1,416 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.LinkedList;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.util.AbstractCssTraverser;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-
-/**
- * 
- */
-class CSSModelUpdateContext {
-
-
-	class CSSNodeUpdateTraverser extends AbstractCssTraverser {
-		public CSSNodeUpdateTraverser() {
-			super();
-			setTraverseImported(false);
-			setTraverseImportFirst(false);
-		}
-
-		public LinkedList getNodeList() {
-			return fTravNodeList;
-		}
-
-		protected void begin(ICSSNode node) {
-			fTravNodeList = new LinkedList();
-		}
-
-		protected short preNode(ICSSNode node) {
-			if (node instanceof CSSStyleDeclarationImpl || node instanceof CSSAttrImpl || node instanceof MediaListImpl) {
-				// skip
-			}
-			else {
-				fTravNodeList.add(node);
-			}
-			if (node instanceof CSSPrimitiveContainer) {
-				return TRAV_PRUNE;
-			}
-			else {
-				return TRAV_CONT;
-			}
-		}
-
-		LinkedList fTravNodeList = null;
-	}
-
-	ICSSNode fLastNode = null;
-	ICSSNode fDeletionTargetParent = null;
-	ICSSNode fDeletionTarget = null;
-	LinkedList fNodeList = null;
-	private short fUpdateMode = UPDATE_IDLE;
-	static final short UPDATE_IDLE = 0;
-	static final short UPDATE_INSERT_FNCONTAINER = 1;
-	static final short UPDATE_INSERT_RCONTAINER = 2;
-	static final short UPDATE_REMOVE_FNCONTAINER = 3;
-	static final short UPDATE_REMOVE_RCONTAINER = 4;
-	static final short UPDATE_CHANGE_RCONTAINER = 5;
-
-	/**
-	 * CSSNodeUpdateQueue constructor comment.
-	 */
-	CSSModelUpdateContext() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	void cleanupContext() {
-		fNodeList = null;
-		fDeletionTarget = null;
-		fDeletionTargetParent = null;
-		fUpdateMode = UPDATE_IDLE;
-	}
-
-	/**
-	 * 
-	 */
-	CounterImpl getCounter() {
-		ICSSNode node = getNode();
-		if (node instanceof CounterImpl) {
-			return (CounterImpl) node;
-		}
-		else {
-			CSSUtil.debugOut("CounterImpl is expected, but " + //$NON-NLS-1$
-						CSSUtil.getClassString(node));
-			ungetNode();
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	CSSCharsetRuleImpl getCSSCharsetRule() {
-		ICSSNode node = getNode();
-		if (node instanceof CSSCharsetRuleImpl) {
-			return (CSSCharsetRuleImpl) node;
-		}
-		else {
-			CSSUtil.debugOut("CSSCharsetRuleImpl is expected, but " + //$NON-NLS-1$
-						CSSUtil.getClassString(node));
-			ungetNode();
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	CSSFontFaceRuleImpl getCSSFontFaceRule() {
-		ICSSNode node = getNode();
-		if (node instanceof CSSFontFaceRuleImpl) {
-			return (CSSFontFaceRuleImpl) node;
-		}
-		else {
-			CSSUtil.debugOut("CSSFontFaceRuleImpl is expected, but " + //$NON-NLS-1$
-						CSSUtil.getClassString(node));
-			ungetNode();
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	CSSImportRuleImpl getCSSImportRule() {
-		ICSSNode node = getNode();
-		if (node instanceof CSSImportRuleImpl) {
-			return (CSSImportRuleImpl) node;
-		}
-		else {
-			CSSUtil.debugOut("CSSImportRuleImpl is expected, but " + //$NON-NLS-1$
-						CSSUtil.getClassString(node));
-			ungetNode();
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	CSSMediaRuleImpl getCSSMediaRule() {
-		ICSSNode node = getNode();
-		if (node instanceof CSSMediaRuleImpl) {
-			return (CSSMediaRuleImpl) node;
-		}
-		else {
-			CSSUtil.debugOut("CSSMediaRuleImpl is expected, but " + //$NON-NLS-1$
-						CSSUtil.getClassString(node));
-			ungetNode();
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	CSSPageRuleImpl getCSSPageRule() {
-		ICSSNode node = getNode();
-		if (node instanceof CSSPageRuleImpl) {
-			return (CSSPageRuleImpl) node;
-		}
-		else {
-			CSSUtil.debugOut("CSSPageRuleImpl is expected, but " + //$NON-NLS-1$
-						CSSUtil.getClassString(node));
-			ungetNode();
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	CSSPrimitiveValueImpl getCSSPrimitiveValue(short type) {
-		ICSSNode node = getNode();
-		if (node instanceof CSSPrimitiveValueImpl) {
-			short nodeType = ((CSSPrimitiveValueImpl) node).getPrimitiveType();
-			if (nodeType == type || ((nodeType == CSSPrimitiveValue.CSS_NUMBER || nodeType == ICSSPrimitiveValue.CSS_INTEGER) && (type == CSSPrimitiveValue.CSS_NUMBER || type == ICSSPrimitiveValue.CSS_INTEGER))) {
-				return (CSSPrimitiveValueImpl) node;
-			}
-		}
-
-		if (node instanceof CSSPrimitiveValueImpl) {
-			CSSPrimitiveValueImpl value = (CSSPrimitiveValueImpl) node;
-			CSSUtil.debugOut("CSSPrimitiveValueImpl [" + type + //$NON-NLS-1$
-						"] is expected, but type is [" + //$NON-NLS-1$
-						value.getPrimitiveType() + "]: \"" + value.generateSource() + "\"");//$NON-NLS-2$//$NON-NLS-1$
-		}
-		else {
-			CSSUtil.debugOut("CSSPrimitiveValueImpl(" + type + //$NON-NLS-1$
-						") is expected, but " + //$NON-NLS-1$
-						CSSUtil.getClassString(node));
-		}
-
-		ungetNode();
-		throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 */
-	CSSPrimitiveValueImpl getCSSPrimitiveValueAny() {
-		ICSSNode node = getNode();
-		if (node instanceof CSSPrimitiveValueImpl) {
-			return (CSSPrimitiveValueImpl) node;
-		}
-		else {
-			CSSUtil.debugOut("CSSPrimitiveValueImpl is expected, but " + //$NON-NLS-1$
-						CSSUtil.getClassString(node));
-			ungetNode();
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	CSSStyleDeclItemImpl getCSSStyleDeclItem(String propertyName) {
-		ICSSNode node = getNode();
-		if (node instanceof CSSStyleDeclItemImpl && ((CSSStyleDeclItemImpl) node).getPropertyName().equalsIgnoreCase(propertyName)) {
-			return (CSSStyleDeclItemImpl) node;
-		}
-		else {
-			CSSUtil.debugOut("CSSStyleDeclItemImpl(" + propertyName + //$NON-NLS-1$
-						") is expected, but " + CSSUtil.getClassString(node));//$NON-NLS-1$
-			ungetNode();
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	CSSStyleRuleImpl getCSSStyleRule() {
-		ICSSNode node = getNode();
-		if (node instanceof CSSStyleRuleImpl) {
-			return (CSSStyleRuleImpl) node;
-		}
-		else {
-			CSSUtil.debugOut("CSSStyleRuleImpl is expected, but " + //$NON-NLS-1$
-						CSSUtil.getClassString(node));
-			ungetNode();
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 */
-	ICSSNode getDeletionTarget() {
-		return fDeletionTarget;
-	}
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 */
-	ICSSNode getDeletionTargetParent() {
-		return fDeletionTargetParent;
-	}
-
-	/**
-	 * 
-	 */
-	private ICSSNode getNode() {
-		ICSSNode node = null;
-		if (fNodeList != null && 0 < fNodeList.size()) {
-			node = (ICSSNode) fNodeList.removeFirst();
-		}
-		fLastNode = node;
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	int getNodeCount() {
-		if (fNodeList != null) {
-			return fNodeList.size();
-		}
-		else {
-			return -1;
-		}
-	}
-
-	/**
-	 * 
-	 */
-	// ICSSNode getParentNode() {
-	// return fParentNode;
-	// }
-	/**
-	 * 
-	 */
-	RectImpl getRect() {
-		ICSSNode node = getNode();
-		if (node instanceof RectImpl) {
-			return (RectImpl) node;
-		}
-		else {
-			CSSUtil.debugOut("RectImpl is expected, but " + //$NON-NLS-1$
-						CSSUtil.getClassString(node));
-			ungetNode();
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	RGBColorImpl getRGBColor() {
-		ICSSNode node = getNode();
-		if (node instanceof RGBColorImpl) {
-			return (RGBColorImpl) node;
-		}
-		else {
-			CSSUtil.debugOut("RGBColorImpl is expected, but " + //$NON-NLS-1$
-						CSSUtil.getClassString(node));
-			ungetNode();
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * @return short
-	 */
-	short getUpdateMode() {
-		return fUpdateMode;
-	}
-
-	/**
-	 * 
-	 */
-	boolean isActive() {
-		return (fNodeList != null);
-	}
-
-	/**
-	 * 
-	 */
-	void setupContext(short updateMode, ICSSNode parentNode, ICSSNode targetNode) {
-		fUpdateMode = updateMode;
-
-		ICSSNode traverseRoot;
-		if (updateMode == UPDATE_REMOVE_RCONTAINER || updateMode == UPDATE_INSERT_RCONTAINER || updateMode == UPDATE_CHANGE_RCONTAINER) {
-			traverseRoot = parentNode;
-			while (traverseRoot instanceof CSSRegionContainer) {
-				traverseRoot = traverseRoot.getParentNode();
-			}
-		}
-		else {
-			traverseRoot = targetNode;
-		}
-
-		if (updateMode == UPDATE_REMOVE_RCONTAINER || updateMode == UPDATE_INSERT_RCONTAINER || // region
-																								// insert
-																								// =>
-																								// replace
-																								// flat
-																								// node
-					updateMode == UPDATE_CHANGE_RCONTAINER || updateMode == UPDATE_REMOVE_FNCONTAINER) {
-			fDeletionTarget = traverseRoot;
-			if (fDeletionTarget == targetNode) {
-				fDeletionTargetParent = parentNode;
-			}
-			else {
-				fDeletionTargetParent = fDeletionTarget.getParentNode();
-			}
-		}
-		else {
-			fDeletionTarget = null;
-			fDeletionTargetParent = null;
-		}
-
-		if (updateMode == UPDATE_INSERT_RCONTAINER || updateMode == UPDATE_INSERT_FNCONTAINER || updateMode == UPDATE_REMOVE_RCONTAINER || // region
-																																			// remove
-																																			// =>
-																																			// re-insert
-																																			// flat
-																																			// node
-					updateMode == UPDATE_CHANGE_RCONTAINER) {
-			CSSNodeUpdateTraverser traverser = new CSSNodeUpdateTraverser();
-			traverser.apply(traverseRoot);
-			fNodeList = traverser.getNodeList();
-		}
-		else {
-			fNodeList = null;
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private void ungetNode() {
-		if (fNodeList != null && fLastNode != null) {
-			fNodeList.addFirst(fLastNode);
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdater.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdater.java
deleted file mode 100644
index cbd8058..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdater.java
+++ /dev/null
@@ -1,561 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.formatter.AttrChangeContext;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceGenerator;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
-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.text.BasicStructuredDocument;
-import org.w3c.dom.DOMException;
-
-
-/**
- * 
- */
-class CSSModelUpdater {
-
-	private CSSModelImpl fModel = null;
-	private CSSModelParser fParser = null;
-
-	/**
-	 * CSSModelUpdater constructor comment.
-	 */
-	CSSModelUpdater() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	CSSModelUpdater(CSSModelImpl model) {
-		super();
-		fModel = model;
-	}
-
-	/**
-	 * @param parentNode
-	 *            org.eclipse.wst.css.core.model.CSSNodeImpl
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.CSSNodeImpl
-	 */
-	private void attrInserted(CSSNodeImpl parentNode, CSSAttrImpl attr) {
-		CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(parentNode);
-
-		if (formatter == null) {
-			CSSUtil.debugOut("Cannot get format adapter : " + parentNode.getClass().toString());//$NON-NLS-1$
-			return;
-		}
-
-		short updateMode = CSSModelUpdateContext.UPDATE_INSERT_RCONTAINER;
-		fParser.setupUpdateContext(updateMode, parentNode, attr);
-
-		// get formatted info
-		AttrChangeContext region = new AttrChangeContext();
-		String text = new String(formatter.formatAttrChanged(parentNode, attr, true, region));
-
-		// set text
-		StructuredDocumentEvent result = insertText(region.start, region.end - region.start, text);
-
-		int nRemains = fParser.cleanupUpdateContext();
-
-		if (0 < nRemains && !(result instanceof NoChangeEvent)) {
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$		
-		}
-	}
-
-	/**
-	 * @param parentNode
-	 *            org.eclipse.wst.css.core.model.CSSNodeImpl
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.CSSNodeImpl
-	 */
-	private void attrRemoved(CSSNodeImpl parentNode, CSSAttrImpl attr) {
-		CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(parentNode);
-
-		if (formatter == null) {
-			CSSUtil.debugOut("Cannot get format adapter : " + parentNode.getClass().toString());//$NON-NLS-1$
-			return;
-		}
-
-		short updateMode = CSSModelUpdateContext.UPDATE_REMOVE_RCONTAINER;
-		fParser.setupUpdateContext(updateMode, parentNode, attr);
-
-		// get formatted info
-		AttrChangeContext region = new AttrChangeContext();
-		String text = new String(formatter.formatAttrChanged(parentNode, attr, false, region));
-
-		// set text
-		StructuredDocumentEvent result = insertText(region.start, region.end - region.start, text);
-
-		int nRemains = fParser.cleanupUpdateContext();
-
-		if (0 < nRemains && !(result instanceof NoChangeEvent)) {
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$		
-		}
-	}
-
-	/**
-	 * 
-	 */
-	void attrReplaced(CSSNodeImpl parentNode, CSSNodeImpl newAttr, CSSNodeImpl oldAttr) {
-		if (parentNode == null) {
-			return;
-		}
-
-		if (oldAttr != null) {
-			attrRemoved(parentNode, (CSSAttrImpl) oldAttr);
-		}
-
-		if (newAttr != null) {
-			attrInserted(parentNode, (CSSAttrImpl) newAttr);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private void childInserted(CSSNodeImpl parentNode, CSSNodeImpl node) {
-		short updateMode = CSSModelUpdateContext.UPDATE_IDLE;
-
-		if (node instanceof CSSStructuredDocumentRegionContainer) {
-			updateMode = CSSModelUpdateContext.UPDATE_INSERT_FNCONTAINER;
-		}
-		else if (node instanceof CSSRegionContainer) {
-			updateMode = CSSModelUpdateContext.UPDATE_INSERT_RCONTAINER;
-		}
-		else {
-			CSSUtil.debugOut("What's this node? : " + node.getClass().toString());//$NON-NLS-1$
-			return;
-		}
-
-		fParser.setupUpdateContext(updateMode, parentNode, node);
-
-		StructuredDocumentEvent result = defaultInserted(parentNode, node);
-
-		int nRemains = fParser.cleanupUpdateContext();
-
-		if (0 < nRemains && !(result instanceof NoChangeEvent)) {
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$		
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private void childRemoved(CSSNodeImpl parentNode, CSSNodeImpl node) {
-		short updateMode = CSSModelUpdateContext.UPDATE_IDLE;
-
-		if (node instanceof CSSStructuredDocumentRegionContainer) {
-			updateMode = CSSModelUpdateContext.UPDATE_REMOVE_FNCONTAINER;
-		}
-		else if (node instanceof CSSRegionContainer) {
-			updateMode = CSSModelUpdateContext.UPDATE_REMOVE_RCONTAINER;
-		}
-		else {
-			CSSUtil.debugOut("What's this node? : " + node.getClass().toString());//$NON-NLS-1$
-			return;
-		}
-
-		fParser.setupUpdateContext(updateMode, parentNode, node);
-
-		CSSNodeImpl prev = getOldPrevious(parentNode, node);
-		CSSNodeImpl next = getOldNext(parentNode, node);
-		int insertPos = -1, endPos = -1;
-		String source = "";//$NON-NLS-1$
-		if (prev != null) {
-			insertPos = prev.getEndOffset();
-		}
-		else {
-			insertPos = node.getStartOffset();
-			insertPos -= nearestSpaceLengthBefore(parentNode, insertPos);
-		}
-		if (next != null) {
-			endPos = next.getStartOffset();
-		}
-		else {
-			endPos = node.getEndOffset();
-			endPos += nearestSpaceLengthAfter(parentNode, endPos);
-		}
-		source = getSpaceBefore(parentNode, next, node);
-		StructuredDocumentEvent result;
-		if (source.length() > 0) {
-			result = insertText(insertPos, endPos - insertPos, source);
-		}
-		else {
-			result = removeText(insertPos, endPos - insertPos);
-		}
-
-		int nRemains = fParser.cleanupUpdateContext();
-
-		if (0 < nRemains && !(result instanceof NoChangeEvent)) {
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$		
-		}
-
-		/*
-		 * int removeStart = -1; int removeEnd = -1; if (node instanceof
-		 * CSSStructuredDocumentRegionContainer) {
-		 * CSSStructuredDocumentRegionContainer container =
-		 * (CSSStructuredDocumentRegionContainer)node;
-		 * IStructuredDocumentRegion firstNode =
-		 * container.getFirstStructuredDocumentRegion();
-		 * IStructuredDocumentRegion lastNode =
-		 * container.getLastStructuredDocumentRegion(); if (firstNode != null &&
-		 * lastNode != null) { removeStart = firstNode.getStart(); removeEnd =
-		 * lastNode.getEnd(); } } else if (node instanceof CSSRegionContainer) {
-		 * CSSRegionContainer container = (CSSRegionContainer)node;
-		 * ITextRegion firstRegion = container.getFirstRegion(); ITextRegion
-		 * lastRegion = container.getLastRegion(); if (firstRegion != null &&
-		 * lastRegion != null) { removeStart = firstRegion.getStartOffset();
-		 * removeEnd = lastRegion.getEndOffset(); } } if (0 <= removeStart &&
-		 * 0 <= removeEnd) { removeText(removeStart, removeEnd - removeStart +
-		 * 1); }
-		 */
-	}
-
-	/**
-	 * 
-	 */
-	void childReplaced(CSSNodeImpl parentNode, CSSNodeImpl newChild, CSSNodeImpl oldChild) {
-		if (parentNode == null) {
-			return;
-		}
-
-		if (oldChild != null) {
-			childRemoved(parentNode, oldChild);
-		}
-
-		if (newChild != null) {
-			childInserted(parentNode, newChild);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private StructuredDocumentEvent defaultInserted(CSSNodeImpl parentNode, CSSNodeImpl node) {
-		int insertPos = -1;
-		ICSSNode sibling;
-		String preSpace = "", postSpace = "";//$NON-NLS-2$//$NON-NLS-1$
-		int length = 0;
-
-		if (insertPos < 0) {
-			if ((sibling = node.getPreviousSibling()) != null) {
-				// after previous child
-				insertPos = getTextEnd(sibling);
-			}
-		}
-
-		if (insertPos < 0) {
-			if ((sibling = node.getNextSibling()) != null) {
-				// before next child
-				insertPos = getTextStart(sibling);
-			}
-		}
-
-		if (insertPos < 0) {
-			// position of parent
-			insertPos = getChildInsertPos(parentNode);
-		}
-
-		if (insertPos < 0) {
-			// firsttime
-			insertPos = 0;
-		}
-
-		// format previous spaces
-		length = nearestSpaceLengthBefore(parentNode, insertPos);
-		insertPos -= length;
-		preSpace = getSpaceBefore(parentNode, node, null);
-		// format post spaces
-		length += nearestSpaceLengthAfter(parentNode, insertPos + length);
-		postSpace = getSpaceBefore(parentNode, node.getNextSibling(), null);
-
-		// set text
-		String text = preSpace + node.generateSource().trim() + postSpace;
-		return insertText(insertPos, length, text);
-	}
-
-	/**
-	 * @return int
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.CSSNodeImpl
-	 */
-	private int getChildInsertPos(CSSNodeImpl node) {
-		CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(node);
-		if (formatter != null)
-			return formatter.getChildInsertPos(node);
-		else
-			return node.getEndOffset();
-	}
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.CSSNodeImpl
-	 * @param parentNode
-	 *            org.eclipse.wst.css.core.model.CSSNodeImpl
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.CSSNodeImpl
-	 */
-	private CSSNodeImpl getOldNext(CSSNodeImpl parentNode, CSSNodeImpl node) {
-		CSSNodeImpl child = (CSSNodeImpl) parentNode.getLastChild();
-		CSSNodeImpl ret = null;
-		while (child != null) {
-			if (node.getEndOffset() < child.getEndOffset())
-				ret = child;
-			else
-				break;
-			child = (CSSNodeImpl) child.getPreviousSibling();
-		}
-		return ret;
-	}
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.CSSNodeImpl
-	 * @param parentNode
-	 *            org.eclipse.wst.css.core.model.CSSNodeImpl
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.CSSNodeImpl
-	 */
-	private CSSNodeImpl getOldPrevious(CSSNodeImpl parentNode, CSSNodeImpl node) {
-		CSSNodeImpl child = (CSSNodeImpl) parentNode.getFirstChild();
-		CSSNodeImpl ret = null;
-		while (child != null) {
-			if (child.getStartOffset() < node.getStartOffset())
-				ret = child;
-			else
-				break;
-			child = (CSSNodeImpl) child.getNextSibling();
-		}
-		return ret;
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param parentNode
-	 *            org.eclipse.wst.css.core.model.CSSNodeImpl
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.CSSNodeImpl
-	 */
-	private String getSpaceBefore(ICSSNode parentNode, ICSSNode node, ICSSNode toRemove) {
-		CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) parentNode);
-
-		if (formatter != null) {
-			org.eclipse.jface.text.IRegion exceptFor = null;
-			if (toRemove != null) {
-				CSSNodeImpl remove = (CSSNodeImpl) toRemove;
-				exceptFor = new org.eclipse.jface.text.Region(remove.getStartOffset(), remove.getEndOffset() - remove.getStartOffset());
-			}
-			return formatter.formatBefore(parentNode, node, exceptFor).toString();
-		}
-		else
-			return "";//$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 */
-	private int getTextEnd(ICSSNode node) {
-		int end = -1;
-		if (node != null) {
-			if (node instanceof CSSStructuredDocumentRegionContainer) {
-				end = ((CSSStructuredDocumentRegionContainer) node).getEndOffset();
-			}
-			else if (node instanceof CSSRegionContainer) {
-				end = ((CSSRegionContainer) node).getEndOffset();
-			}
-		}
-		return end;
-	}
-
-	/**
-	 * 
-	 */
-	private int getTextStart(ICSSNode node) {
-		int start = -1;
-		if (node != null) {
-			if (node instanceof CSSStructuredDocumentRegionContainer) {
-				start = ((CSSStructuredDocumentRegionContainer) node).getStartOffset();
-			}
-			else if (node instanceof CSSRegionContainer) {
-				start = ((CSSRegionContainer) node).getStartOffset();
-			}
-		}
-		return start;
-	}
-
-	/**
-	 * 
-	 */
-	private StructuredDocumentEvent insertText(int start, int oldLength, String text) {
-		StructuredDocumentEvent result = null;
-		BasicStructuredDocument structuredDocument = (BasicStructuredDocument) fModel.getStructuredDocument();
-		if (structuredDocument != null) {
-			if (text != null && 0 < oldLength && start + oldLength <= structuredDocument.getLength()) {
-				// minimize text change
-				String delText = structuredDocument.get(start, oldLength);
-				int newLength = text.length();
-				int shorterLen = Math.min(oldLength, newLength);
-				int stMatchLen;
-				for (stMatchLen = 0; stMatchLen < shorterLen && text.charAt(stMatchLen) == delText.charAt(stMatchLen); stMatchLen++) {
-					// 
-				}
-				if (0 < stMatchLen && stMatchLen < shorterLen && text.charAt(stMatchLen - 1) == 0x000d && (text.charAt(stMatchLen) == 0x000a || delText.charAt(stMatchLen) == 0x000a)) {
-					// must not divide 0d->0a sequence
-					stMatchLen--;
-				}
-				if (stMatchLen == shorterLen) {
-					if (oldLength < newLength) { // just insert
-						oldLength = 0;
-						start += stMatchLen;
-						text = text.substring(stMatchLen);
-					}
-					else if (newLength < oldLength) { // just remove
-						oldLength -= stMatchLen;
-						start += stMatchLen;
-						text = null;
-					}
-					else { // nothing to do
-						oldLength = 0;
-						text = null;
-					}
-				}
-				else {
-					int edMatchLen;
-					for (edMatchLen = 0; stMatchLen + edMatchLen < shorterLen && text.charAt(newLength - edMatchLen - 1) == delText.charAt(oldLength - edMatchLen - 1); edMatchLen++) {
-						//
-					}
-					if (0 < edMatchLen && text.charAt(newLength - edMatchLen) == 0x000a && ((edMatchLen < newLength && text.charAt(newLength - edMatchLen - 1) == 0x000d) || (edMatchLen < oldLength && delText.charAt(oldLength - edMatchLen - 1) == 0x000d))) {
-						// must not divide 0d->0a sequence
-						edMatchLen--;
-					}
-					oldLength -= stMatchLen + edMatchLen;
-					start += stMatchLen;
-					if (stMatchLen + edMatchLen < newLength) {
-						text = text.substring(stMatchLen, newLength - edMatchLen);
-					}
-					else {
-						text = null;
-					}
-				}
-			}
-			if (0 < oldLength || text != null) {
-				// String delText = structuredDocument.get(start, oldLength);
-				result = structuredDocument.replaceText(fModel, start, oldLength, text);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * @return int
-	 * @param insertPos
-	 *            int
-	 */
-	private int nearestSpaceLengthAfter(CSSNodeImpl node, int insertPos) {
-		CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(node);
-		if (formatter != null) {
-			return formatter.getLengthToReformatAfter(node, insertPos);
-		}
-		else
-			return 0;
-	}
-
-	/**
-	 * @return int
-	 * @param insertPos
-	 *            int
-	 */
-	private int nearestSpaceLengthBefore(CSSNodeImpl node, int insertPos) {
-		CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(node);
-		if (formatter != null) {
-			return formatter.getLengthToReformatBefore(node, insertPos);
-		}
-		else
-			return 0;
-	}
-
-	/**
-	 * 
-	 */
-	private StructuredDocumentEvent removeText(int start, int length) {
-		StructuredDocumentEvent result = null;
-		IStructuredDocument structuredDocument = fModel.getStructuredDocument();
-		if (structuredDocument != null) {
-			result = structuredDocument.replaceText(fModel, start, length, new String(""));//$NON-NLS-1$
-		}
-		return result;
-	}
-
-	/**
-	 * 
-	 */
-	void setParser(CSSModelParser parser) {
-		fParser = parser;
-	}
-
-	/**
-	 * 
-	 */
-	void valueChanged(CSSNodeImpl node, String oldValue) {
-		if (!(node instanceof CSSRegionContainer)) {
-			CSSUtil.debugOut("Too Bad.." + //$NON-NLS-1$
-						((node == null) ? "null" : node.getClass().toString()));//$NON-NLS-1$
-			return;
-		}
-
-		int start = node.getStartOffset();
-
-		if (node.getNodeType() == ICSSNode.ATTR_NODE) {
-			ICSSAttr attr = (ICSSAttr) node;
-			CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) attr.getOwnerCSSNode());
-			if (formatter != null)
-				start = formatter.getAttrInsertPos(attr.getOwnerCSSNode(), attr.getName());
-		}
-
-		int oldLength = (oldValue == null) ? 0 : oldValue.length();
-		// flash old IStructuredDocumentRegion/ITextRegion
-		if (node instanceof CSSStructuredDocumentRegionContainer) {
-			((CSSStructuredDocumentRegionContainer) node).setFirstStructuredDocumentRegion(null);
-			((CSSStructuredDocumentRegionContainer) node).setLastStructuredDocumentRegion(null);
-		}
-		else if (node instanceof CSSRegionContainer) {
-			((CSSRegionContainer) node).setRangeRegion(null, null, null);
-		}
-		// generate new source
-		String newValue = node.generateSource();
-
-		ICSSNode parent;
-		if (node.getNodeType() == ICSSNode.ATTR_NODE) {
-			parent = ((ICSSAttr) node).getOwnerCSSNode();
-		}
-		else {
-			parent = node.getParentNode();
-		}
-
-		fParser.setupUpdateContext(CSSModelUpdateContext.UPDATE_CHANGE_RCONTAINER, parent, node);
-
-		StructuredDocumentEvent result = insertText(start, oldLength, newValue);
-
-		int nRemains = fParser.cleanupUpdateContext();
-
-		if (0 < nRemains && !(result instanceof NoChangeEvent)) {
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$		
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java
deleted file mode 100644
index 8d4e5d0..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java
+++ /dev/null
@@ -1,293 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.css.core.internal.CSSCoreMessages;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNodeList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSRuleContainer;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-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;
-
-/**
- * 
- */
-class CSSModelUtil {
-
-	/**
-	 * 
-	 */
-	static boolean canContainBrace(ICSSNode node) {
-		return (node != null && (node instanceof ICSSRuleContainer || node instanceof CSSRuleDeclContainer)) ? true : false;
-	}
-
-	/**
-	 * @param parent
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 */
-	static void cleanupContainer(ICSSNode parent) {
-		if (parent == null) {
-			return;
-		}
-		for (ICSSNode child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
-			cleanupContainer(child);
-		}
-		if (parent instanceof CSSStructuredDocumentRegionContainer) {
-			((CSSStructuredDocumentRegionContainer) parent).setRangeStructuredDocumentRegion(null, null);
-		}
-		else if (parent instanceof CSSRegionContainer) {
-			((CSSRegionContainer) parent).setRangeRegion(null, null, null);
-		}
-	}
-
-	static boolean diagnoseNode(ICSSNode parent, IStructuredDocument structuredDocument) {
-		// check this
-		Vector errors = new Vector();
-		if (parent instanceof CSSStructuredDocumentRegionContainer) {
-			CSSStructuredDocumentRegionContainer node = (CSSStructuredDocumentRegionContainer) parent;
-			String nodeText = CSSUtil.getClassString(node) + ": ";//$NON-NLS-1$
-			IStructuredDocumentRegion flatNode = node.getFirstStructuredDocumentRegion();
-			if (flatNode == null && (!(node instanceof CSSStyleDeclarationImpl || node instanceof CSSStyleSheetImpl) || node.getFirstChild() != null)) {
-				errors.add(NLS.bind(CSSCoreMessages._1concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first flat node is null."
-			}
-			else if (flatNode != null) {
-				IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(flatNode.getStart());
-				if (flatNode != modelNode) {
-					errors.add(NLS.bind(CSSCoreMessages._2concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first flat node is not in model."
-				}
-			}
-			flatNode = node.getLastStructuredDocumentRegion();
-			if (flatNode == null && (!(node instanceof CSSStyleDeclarationImpl || node instanceof CSSStyleSheetImpl) || node.getFirstChild() != null)) {
-				errors.add(NLS.bind(CSSCoreMessages._3concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last flat node is null."
-			}
-			else if (flatNode != null) {
-				IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(flatNode.getStart());
-				if (flatNode != modelNode) {
-					errors.add(NLS.bind(CSSCoreMessages._4concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last flat node is not in model."
-				}
-			}
-		}
-		else if (parent instanceof CSSRegionContainer) {
-			CSSRegionContainer node = (CSSRegionContainer) parent;
-			String nodeText = CSSUtil.getClassString(node) + ": ";//$NON-NLS-1$
-			ITextRegion region = node.getFirstRegion();
-			IStructuredDocumentRegion parentRegion = node.getDocumentRegion();
-			if (region == null && (!(node instanceof MediaListImpl) || node.getFirstChild() != null)) {
-				errors.add(NLS.bind(CSSCoreMessages._25concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is null."
-			}
-			else if (region != null) {
-				int offset = parentRegion.getStartOffset(region);
-				IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
-				ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
-				if (region != modelRegion) {
-					errors.add(NLS.bind(CSSCoreMessages._26concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is not in model."
-				}
-			}
-			region = node.getLastRegion();
-			if (region == null && (!(node instanceof MediaListImpl) || node.getFirstChild() != null)) {
-				errors.add(NLS.bind(CSSCoreMessages._27concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is null."
-			}
-			else if (region != null) {
-				int offset = parentRegion.getStartOffset(region);
-				IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
-				ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
-				if (region != modelRegion) {
-					errors.add(NLS.bind(CSSCoreMessages._28concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is not in model."
-				}
-			}
-		}
-
-		ICSSNodeList attrs = parent.getAttributes();
-		int nAttrs = attrs.getLength();
-		for (int i = 0; i < nAttrs; i++) {
-			ICSSAttr attr = (ICSSAttr) attrs.item(i);
-			CSSRegionContainer node = (CSSRegionContainer) attr;
-			String nodeText = CSSUtil.getClassString(node) + "(" + attr.getName() + "): ";//$NON-NLS-2$//$NON-NLS-1$
-			ITextRegion region = node.getFirstRegion();
-			IStructuredDocumentRegion parentRegion = node.getDocumentRegion();
-			if (region == null && 0 < attr.getValue().length()) {
-				errors.add(NLS.bind(CSSCoreMessages._5concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is null."
-			}
-			else if (region != null) {
-				int offset = parentRegion.getStartOffset(region);
-				IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
-				ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
-				if (region != modelRegion) {
-					errors.add(NLS.bind(CSSCoreMessages._6concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is not in model."
-				}
-			}
-			region = node.getLastRegion();
-			if (region == null && 0 < attr.getValue().length()) {
-				errors.add(NLS.bind(CSSCoreMessages._7concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is null."
-			}
-			else if (region != null) {
-				int offset = parentRegion.getStartOffset(region);
-				IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
-				ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
-				if (region != modelRegion) {
-					errors.add(NLS.bind(CSSCoreMessages._8concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is not in model."
-				}
-			}
-		}
-
-		if (!errors.isEmpty()) {
-			Iterator i = errors.iterator();
-			while (i.hasNext()) {
-				CSSUtil.debugOut((String) i.next());
-			}
-			return false;
-		}
-		else {
-			return true;
-		}
-	}
-
-	/**
-	 * @return boolean
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 */
-	static boolean diagnoseTree(ICSSNode parent, IStructuredDocument structuredDocument) {
-		if (parent == null) {
-			return false;
-		}
-		// check children
-		for (ICSSNode child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
-			diagnoseTree(child, structuredDocument);
-		}
-
-		diagnoseNode(parent, structuredDocument);
-
-		return true;
-	}
-
-	/**
-	 * If needed, modify last flat node
-	 */
-	static void expandStructuredDocumentRegionContainer(CSSStructuredDocumentRegionContainer target, IStructuredDocumentRegion flatNode) {
-		if (target == null || flatNode == null) {
-			return;
-		}
-
-		IStructuredDocumentRegion lastNode = target.getLastStructuredDocumentRegion();
-		if (lastNode == flatNode) {
-			return;
-		}
-		if (lastNode == null || lastNode.getStart() < flatNode.getStart()) {
-			target.setLastStructuredDocumentRegion(flatNode);
-		}
-	}
-
-	/*
-	 * 
-	 */
-	static ICSSNode findBraceContainer(ICSSNode node) {
-		for (ICSSNode i = node; i != null; i = i.getParentNode()) {
-			if (CSSModelUtil.canContainBrace(i)) {
-				return i;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * 
-	 */
-	static int getDepth(ICSSNode node) {
-		int depth = -1;
-		while (node != null) {
-			depth++;
-			node = node.getParentNode();
-		}
-		return depth;
-	}
-
-	/**
-	 * 
-	 */
-	static boolean isBraceClosed(ICSSNode node) {
-		boolean bClosed = true;
-		if (!(node instanceof CSSStructuredDocumentRegionContainer)) {
-			return bClosed;
-		}
-
-		IStructuredDocumentRegion first = ((CSSStructuredDocumentRegionContainer) node).getFirstStructuredDocumentRegion();
-		IStructuredDocumentRegion last = ((CSSStructuredDocumentRegionContainer) node).getLastStructuredDocumentRegion();
-		if (first == null || last == null) {
-			return bClosed;
-		}
-		if (last.getStart() < first.getStart()) {
-			return bClosed;
-		}
-
-		IStructuredDocumentRegion flatNode = first;
-		int nOpen = 0;
-		int nClose = 0;
-		do {
-			String type = CSSUtil.getStructuredDocumentRegionType(flatNode);
-			if (type == CSSRegionContexts.CSS_LBRACE) {
-				nOpen++;
-			}
-			else if (type == CSSRegionContexts.CSS_RBRACE) {
-				nClose++;
-			}
-			flatNode = flatNode.getNext();
-		}
-		while (flatNode != null && flatNode != last);
-
-		if ((nOpen == 0 && nClose == 0) || nClose < nOpen) {
-			bClosed = false;
-		}
-
-		return bClosed;
-	}
-
-	/**
-	 * only for insertion..
-	 */
-	static boolean isInterruption(CSSStructuredDocumentRegionContainer target, IStructuredDocumentRegion flatNode) {
-		if (target == null || flatNode == null) {
-			return false;
-		}
-		int start = flatNode.getStart();
-		IStructuredDocumentRegion firstNode = target.getFirstStructuredDocumentRegion();
-		IStructuredDocumentRegion lastNode = target.getLastStructuredDocumentRegion();
-		if (firstNode != null && firstNode.getStart() < start && lastNode != null && start < lastNode.getStart()) {
-			return true;
-		}
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	static boolean isParentOf(ICSSNode parent, ICSSNode child) {
-		if (parent == null || child == null) {
-			return false;
-		}
-
-		for (ICSSNode node = child; node != null; node = node.getParentNode()) {
-			if (parent == node) {
-				return true;
-			}
-		}
-
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNamedNodeMapImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNamedNodeMapImpl.java
deleted file mode 100644
index 8ad512a..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNamedNodeMapImpl.java
+++ /dev/null
@@ -1,48 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNamedNodeMap;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-
-
-/**
- * 
- */
-public class CSSNamedNodeMapImpl extends CSSNodeListImpl implements ICSSNamedNodeMap {
-
-	/**
-	 * CSSNamedNodeMapImpl constructor comment.
-	 */
-	CSSNamedNodeMapImpl() {
-		super();
-	}
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param name
-	 *            java.lang.String
-	 */
-	public ICSSNode getNamedItem(String name) {
-		Iterator it = nodes.iterator();
-		while (it.hasNext()) {
-			Object obj = it.next();
-			if (obj instanceof CSSAttrImpl && ((CSSAttrImpl) obj).getName().compareToIgnoreCase(name) == 0) {
-				return (ICSSNode) obj;
-			}
-		}
-		return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeImpl.java
deleted file mode 100644
index 8f6f9f7..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeImpl.java
+++ /dev/null
@@ -1,453 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceGenerator;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNamedNodeMap;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNodeList;
-import org.eclipse.wst.css.core.internal.util.ImportRuleCollector;
-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.IndexedRegion;
-import org.w3c.dom.DOMException;
-
-
-/**
- * 
- */
-abstract class CSSNodeImpl extends AbstractNotifier implements ICSSNode, IndexedRegion {
-
-	private CSSDocumentImpl fOwnerDocument = null;
-	private CSSNodeImpl fParentNode = null;
-	private CSSNodeImpl fNextSibling = null;
-	private CSSNodeImpl fPreviousSibling = null;
-	private CSSNodeImpl fFirstChild = null;
-	private CSSNodeImpl fLastChild = null;
-	protected CSSNamedNodeMapImpl fAttrs = null;
-
-	/**
-	 * CSSNodeImpl constructor comment.
-	 */
-	CSSNodeImpl() {
-		super();
-	}
-
-	CSSNodeImpl(CSSNodeImpl that) {
-		if (that != null) {
-			this.fOwnerDocument = that.fOwnerDocument;
-			if (that.fAttrs != null) {
-				int nAttrs = that.fAttrs.getLength();
-				for (int i = 0; i < nAttrs; i++) {
-					CSSAttrImpl attr = (CSSAttrImpl) that.fAttrs.item(i);
-					setAttribute(attr.getName(), attr.getValue());
-				}
-			}
-		}
-	}
-
-	protected CSSNodeImpl appendChild(CSSNodeImpl newChild) throws org.w3c.dom.DOMException {
-		return insertBefore(newChild, null);
-	}
-
-	void cloneChildNodes(ICSSNode newParent, boolean deep) {
-		if (newParent == null || newParent == this)
-			return;
-
-		CSSNodeImpl container = (CSSNodeImpl) newParent;
-		container.removeChildNodes();
-
-		for (ICSSNode child = getFirstChild(); child != null; child = child.getNextSibling()) {
-			CSSNodeImpl cloned = (CSSNodeImpl) child.cloneNode(deep);
-			if (cloned != null)
-				container.appendChild(cloned);
-		}
-	}
-
-	/**
-	 * @return boolean
-	 * @param offset
-	 *            int
-	 */
-	public boolean contains(int offset) {
-		return (getStartOffset() <= offset && offset < getEndOffset());
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	String generateSource() {
-		CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(this);
-		return formatter.format(this).toString();
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param name
-	 *            java.lang.String
-	 */
-	String getAttribute(String name) {
-		CSSAttrImpl attr = getAttributeNode(name);
-		if (attr != null)
-			return attr.getValue();
-		return null;
-	}
-
-	protected CSSAttrImpl getAttributeNode(String name) {
-		if (fAttrs == null)
-			return null;
-
-		int nAttrs = fAttrs.getLength();
-		for (int i = 0; i < nAttrs; i++) {
-			CSSAttrImpl attr = (CSSAttrImpl) fAttrs.item(i);
-			if (attr.matchName(name))
-				return attr;
-		}
-		return null;
-	}
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.interfaces.ICSSNamedNodeMap
-	 */
-	public ICSSNamedNodeMap getAttributes() {
-		if (fAttrs == null)
-			fAttrs = new CSSNamedNodeMapImpl();
-		return fAttrs;
-	}
-
-	public ICSSNodeList getChildNodes() {
-		CSSNodeListImpl list = new CSSNodeListImpl();
-		for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
-			list.appendNode(node);
-		}
-		return list;
-	}
-
-	ICSSNode getCommonAncestor(ICSSNode node) {
-		if (node == null)
-			return null;
-
-		for (ICSSNode na = node; na != null; na = na.getParentNode()) {
-			for (ICSSNode ta = this; ta != null; ta = ta.getParentNode()) {
-				if (ta == na)
-					return ta;
-			}
-		}
-
-		return null; // not found
-	}
-
-	CSSDocumentImpl getContainerDocument() {
-		for (ICSSNode node = this; node != null; node = node.getParentNode()) {
-			if (node instanceof CSSDocumentImpl) {
-				CSSDocumentImpl doc = (CSSDocumentImpl) node;
-				if (doc.isDocument())
-					return doc;
-			}
-		}
-		return null;
-	}
-
-	CSSNodeImpl getContainerNode(int offset) {
-		if (!contains(offset))
-			return null;
-
-		for (ICSSNode child = getFirstChild(); child != null; child = child.getNextSibling()) {
-			ICSSNode found = ((CSSNodeImpl) child).getContainerNode(offset);
-			if (found != null)
-				return (CSSNodeImpl) found;
-		}
-
-		return this;
-	}
-
-	/**
-	 */
-	public FactoryRegistry getFactoryRegistry() {
-		ICSSModel model = getOwnerDocument().getModel();
-		if (model != null) {
-			FactoryRegistry reg = model.getFactoryRegistry();
-			if (reg != null)
-				return reg;
-		}
-		return null;
-	}
-
-	public ICSSNode getFirstChild() {
-		return this.fFirstChild;
-	}
-
-	public ICSSNode getLastChild() {
-		return this.fLastChild;
-	}
-
-	public ICSSNode getNextSibling() {
-		return this.fNextSibling;
-	}
-
-	ICSSNode getNodeAt(int offset) {
-		// the same as getContainerNode()
-		return getContainerNode(offset);
-	}
-
-	public ICSSDocument getOwnerDocument() {
-		return this.fOwnerDocument;
-	}
-
-	public ICSSNode getParentNode() {
-		return this.fParentNode;
-	}
-
-	public ICSSNode getPreviousSibling() {
-		return this.fPreviousSibling;
-	}
-
-	ICSSNode getRootNode() {
-		CSSNodeImpl parent = (CSSNodeImpl) getParentNode();
-		if (parent == null)
-			return this;
-		return parent.getRootNode();
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public boolean hasChildNodes() {
-		return (this.fFirstChild != null);
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public boolean hasProperties() {
-		return false;
-	}
-
-	protected CSSNodeImpl insertBefore(CSSNodeImpl newChild, CSSNodeImpl refChild) throws org.w3c.dom.DOMException {
-		if (newChild == null)
-			return null;
-
-		CSSNodeImpl child = newChild;
-		CSSNodeImpl next = refChild;
-		CSSNodeImpl prev = null;
-		if (next == null) {
-			prev = this.fLastChild;
-			this.fLastChild = child;
-		}
-		else {
-			prev = (CSSNodeImpl) next.getPreviousSibling();
-			next.setPreviousSibling(child);
-		}
-
-		if (prev == null)
-			this.fFirstChild = child;
-		else
-			prev.setNextSibling(child);
-		child.setPreviousSibling(prev);
-		child.setNextSibling(next);
-		child.setParentNode(this);
-
-		notifyChildReplaced(child, null);
-
-		return newChild;
-	}
-
-	protected void notifyAttrReplaced(CSSNodeImpl newAttr, CSSNodeImpl oldAttr) {
-		// for model
-		ICSSDocument doc = getContainerDocument();
-		if (doc == null)
-			return;
-		CSSModelImpl model = (CSSModelImpl) doc.getModel();
-		if (model == null)
-			return;
-		model.attrReplaced(this, newAttr, oldAttr);
-
-		// for adapters
-		int type = CHANGE;
-		if (newAttr == null)
-			type = REMOVE;
-		else if (oldAttr == null)
-			type = ADD;
-		notify(type, oldAttr, oldAttr, newAttr, getStartOffset());
-	}
-
-	protected void notifyChildReplaced(CSSNodeImpl newChild, CSSNodeImpl oldChild) {
-		// for model
-		ICSSDocument doc = getContainerDocument();
-		if (doc == null)
-			return;
-		CSSModelImpl model = (CSSModelImpl) doc.getModel();
-		if (model == null)
-			return;
-		model.childReplaced(this, newChild, oldChild);
-
-		// for adapters
-		int type = CHANGE;
-		if (newChild == null)
-			type = REMOVE;
-		else if (oldChild == null)
-			type = ADD;
-		notify(type, oldChild, oldChild, newChild, getStartOffset());
-	}
-
-	void removeAttributeNode(CSSNodeImpl attr) {
-		// find
-		int nAttrs = fAttrs.getLength();
-		for (int i = 0; i < nAttrs; i++) {
-			if (fAttrs.item(i) == attr) {
-				fAttrs.removeNode(i);
-				notifyAttrReplaced(null, attr);
-				return;
-			}
-		}
-	}
-
-	protected CSSNodeImpl removeChild(CSSNodeImpl oldChild) throws org.w3c.dom.DOMException {
-		if (oldChild == null)
-			return null;
-		if (oldChild.getParentNode() != this)
-			return null;
-
-		// close import rules
-		ImportRuleCollector trav = new ImportRuleCollector();
-		trav.apply(oldChild);
-		Iterator it = trav.getRules().iterator();
-		while (it.hasNext()) {
-			((CSSImportRuleImpl) it.next()).closeStyleSheet();
-		}
-
-		CSSNodeImpl child = oldChild;
-		CSSNodeImpl prev = (CSSNodeImpl) child.getPreviousSibling();
-		CSSNodeImpl next = (CSSNodeImpl) child.getNextSibling();
-
-		if (prev == null)
-			this.fFirstChild = next;
-		else
-			prev.setNextSibling(next);
-
-		if (next == null)
-			this.fLastChild = prev;
-		else
-			next.setPreviousSibling(prev);
-
-		child.setPreviousSibling(null);
-		child.setNextSibling(null);
-		child.setParentNode(null);
-
-		notifyChildReplaced(null, child);
-
-		return child;
-	}
-
-	/**
-	 * 
-	 */
-	void removeChildNodes() {
-		ICSSNode nextChild = null;
-		for (ICSSNode child = getFirstChild(); child != null; child = nextChild) {
-			nextChild = child.getNextSibling();
-			removeChild((CSSNodeImpl) child);
-		}
-	}
-
-	protected CSSNodeImpl replaceChild(CSSNodeImpl newChild, CSSNodeImpl oldChild) throws org.w3c.dom.DOMException {
-		if (oldChild == null)
-			return newChild;
-		if (newChild != null)
-			insertBefore(newChild, oldChild);
-		return removeChild(oldChild);
-	}
-
-	/**
-	 * @param name
-	 *            java.lang.String
-	 * @param value
-	 *            java.lang.String
-	 */
-	void setAttribute(String name, String value) {
-		if (name == null)
-			return;
-
-		CSSAttrImpl attr = getAttributeNode(name);
-		if (attr != null) {
-			String oldValue = attr.getValue();
-			if (value != null && value.equals(oldValue))
-				return;
-			if (value == null) {
-				if (oldValue != null) {
-					removeAttributeNode(attr);
-				}
-				return;
-			}
-		}
-		else {
-			if (value == null)
-				return;
-			if (fAttrs == null)
-				fAttrs = new CSSNamedNodeMapImpl();
-			CSSDocumentImpl doc = (CSSDocumentImpl) getOwnerDocument();
-			if (doc == null)
-				return;
-			attr = (CSSAttrImpl) doc.createCSSAttr(name);
-			attr.setOwnerCSSNode(this);
-			fAttrs.appendNode(attr);
-			notifyAttrReplaced(attr, null);
-		}
-		attr.setValue(value);
-	}
-
-	/**
-	 * @param cssText
-	 *            java.lang.String
-	 */
-	public void setCssText(String cssText) {
-		// TODO : call flat model parser and replace myself with new three!!
-		throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-	}
-
-	private void setNextSibling(ICSSNode nextSibling) {
-		this.fNextSibling = (CSSNodeImpl) nextSibling;
-	}
-
-	void setOwnerDocument(ICSSDocument ownerDocument) {
-		this.fOwnerDocument = (CSSDocumentImpl) ownerDocument;
-	}
-
-	private void setParentNode(ICSSNode parentNode) {
-		this.fParentNode = (CSSNodeImpl) parentNode;
-	}
-
-	private void setPreviousSibling(ICSSNode previousSibling) {
-		this.fPreviousSibling = (CSSNodeImpl) previousSibling;
-	}
-
-	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;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeListImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeListImpl.java
deleted file mode 100644
index dd1c410..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeListImpl.java
+++ /dev/null
@@ -1,27 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNodeList;
-
-class CSSNodeListImpl extends AbstractCSSNodeList implements ICSSNodeList {
-
-	CSSNodeListImpl() {
-		super();
-	}
-
-	public ICSSNode item(int index) {
-		return itemImpl(index);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPageRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPageRuleImpl.java
deleted file mode 100644
index c23190c..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPageRuleImpl.java
+++ /dev/null
@@ -1,98 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-
-
-/**
- * 
- */
-class CSSPageRuleImpl extends CSSRuleDeclContainer implements ICSSPageRule {
-
-	ICSSSelectorList fSelectorList = new CSSSelectorListImpl(null);
-
-	/**
-	 * 
-	 */
-	CSSPageRuleImpl() {
-		super();
-	}
-
-	CSSPageRuleImpl(CSSPageRuleImpl that) {
-		super(that);
-	}
-
-	public ICSSNode cloneNode(boolean deep) {
-		CSSPageRuleImpl cloned = new CSSPageRuleImpl(this);
-
-		if (deep)
-			cloneChildNodes(cloned, deep);
-
-		return cloned;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	String extractPreString() {
-		StringBuffer preStr = new StringBuffer("@page ");//$NON-NLS-1$
-		preStr.append(getSelectorText());
-
-		return preStr.toString();
-	}
-
-	/**
-	 * @return short
-	 */
-	public short getNodeType() {
-		return PAGERULE_NODE;
-	}
-
-	public ICSSSelectorList getSelectors() {
-		return fSelectorList;
-	}
-
-	/**
-	 * The parsable textual representation of the page selector for the rule.
-	 * 
-	 * @exception org.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the specified CSS string value has
-	 *                a syntax error and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is
-	 *                readonly.
-	 */
-	public String getSelectorText() {
-		return getAttribute(SELECTOR);
-	}
-
-	/**
-	 * The type of the rule, as defined above. The expectation is that
-	 * binding-specific casting methods can be used to cast down from an
-	 * instance of the <code>CSSRule</code> interface to the specific
-	 * derived interface implied by the <code>type</code>.
-	 */
-	public short getType() {
-		return PAGE_RULE;
-	}
-
-	/**
-	 * 
-	 */
-	public void setSelectorText(String selectorText) throws org.w3c.dom.DOMException {
-		setAttribute(SELECTOR, selectorText);
-		fSelectorList = new CSSSelectorListImpl(selectorText);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveContainer.java
deleted file mode 100644
index af89f7f..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveContainer.java
+++ /dev/null
@@ -1,37 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-
-/**
- * 
- */
-abstract class CSSPrimitiveContainer extends CSSPrimitiveValueImpl {
-
-	CSSPrimitiveContainer(CSSPrimitiveContainer that) {
-		super(that);
-	}
-
-	CSSPrimitiveContainer(short primitiveType) {
-		super(primitiveType);
-	}
-
-	protected abstract void initPrimitives();
-
-	void setOwnerDocument(ICSSDocument ownerDocument) {
-		super.setOwnerDocument(ownerDocument);
-
-		initPrimitives();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveValueImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveValueImpl.java
deleted file mode 100644
index 1c2ca80..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveValueImpl.java
+++ /dev/null
@@ -1,362 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.Counter;
-import org.w3c.dom.css.RGBColor;
-import org.w3c.dom.css.Rect;
-
-
-/**
- * 
- */
-class CSSPrimitiveValueImpl extends CSSRegionContainer implements ICSSPrimitiveValue {
-
-	protected short fPrimitiveType = CSS_UNKNOWN;
-	private float fFloatValue = 0.0f;
-	private String fStringValue = null;
-
-	CSSPrimitiveValueImpl(CSSPrimitiveValueImpl that) {
-		super(that);
-
-		this.fPrimitiveType = that.fPrimitiveType;
-		this.fFloatValue = that.fFloatValue;
-		this.fStringValue = that.fStringValue;
-	}
-
-	CSSPrimitiveValueImpl(short primitiveType) {
-		super();
-		fPrimitiveType = primitiveType;
-	}
-
-	public ICSSNode cloneNode(boolean deep) {
-		CSSPrimitiveValueImpl cloned = new CSSPrimitiveValueImpl(this);
-
-		return cloned;
-	}
-
-	/**
-	 * This method is used to get the Counter value. If this CSS value doesn't
-	 * contain a counter value, a <code>DOMException</code> is raised.
-	 * Modification to the corresponding style property can be achieved using
-	 * the <code>Counter</code> interface.
-	 * 
-	 * @return The Counter value.
-	 * @exception DOMException
-	 *                INVALID_ACCESS_ERR: Raised if the CSS value doesn't
-	 *                contain a Counter value (e.g. this is not
-	 *                <code>CSS_COUNTER</code>).
-	 */
-	public Counter getCounterValue() throws DOMException {
-		throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public java.lang.String getCSSValueText() {
-		return getCssText();
-	}
-
-	/**
-	 * A code defining the type of the value as defined above.
-	 */
-	public short getCssValueType() {
-		if (getPrimitiveType() == CSS_INHERIT_PRIMITIVE) {
-			return CSS_INHERIT;
-		}
-		else {
-			return CSS_PRIMITIVE_VALUE;
-		}
-	}
-
-	/**
-	 * This method is used to get a float value in a specified unit. If this
-	 * CSS value doesn't contain a float value or can't be converted into the
-	 * specified unit, a <code>DOMException</code> is raised.
-	 * 
-	 * @param unitType
-	 *            A unit code to get the float value. The unit code can only
-	 *            be a float unit type (i.e. <code>CSS_NUMBER</code>,
-	 *            <code>CSS_PERCENTAGE</code>,<code>CSS_EMS</code>,
-	 *            <code>CSS_EXS</code>,<code>CSS_PX</code>,
-	 *            <code>CSS_CM</code>,<code>CSS_MM</code>,
-	 *            <code>CSS_IN</code>,<code>CSS_PT</code>,
-	 *            <code>CSS_PC</code>,<code>CSS_DEG</code>,
-	 *            <code>CSS_RAD</code>,<code>CSS_GRAD</code>,
-	 *            <code>CSS_MS</code>,<code>CSS_S</code>,
-	 *            <code>CSS_HZ</code>,<code>CSS_KHZ</code>,
-	 *            <code>CSS_DIMENSION</code>).
-	 * @return The float value in the specified unit.
-	 * @exception DOMException
-	 *                INVALID_ACCESS_ERR: Raised if the CSS value doesn't
-	 *                contain a float value or if the float value can't be
-	 *                converted into the specified unit.
-	 */
-	public float getFloatValue(short unitType) throws DOMException {
-		switch (fPrimitiveType) {
-			case CSS_NUMBER :
-			case CSS_PERCENTAGE :
-			case CSS_EMS :
-			case CSS_EXS :
-			case CSS_PX :
-			case CSS_CM :
-			case CSS_MM :
-			case CSS_IN :
-			case CSS_PT :
-			case CSS_PC :
-			case CSS_DEG :
-			case CSS_RAD :
-			case CSS_GRAD :
-			case CSS_MS :
-			case CSS_S :
-			case CSS_HZ :
-			case CSS_KHZ :
-			case CSS_DIMENSION :
-			case CSS_INTEGER :
-			case CSS_HASH :
-				return fFloatValue;
-			default :
-				throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Insert the method's description here. Creation date: (2001/01/17
-	 * 12:12:18)
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return PRIMITIVEVALUE_NODE;
-	}
-
-	/**
-	 * The type of the value as defined by the constants specified above.
-	 */
-	public short getPrimitiveType() {
-		return fPrimitiveType;
-	}
-
-	/**
-	 * This method is used to get the Rect value. If this CSS value doesn't
-	 * contain a rect value, a <code>DOMException</code> is raised.
-	 * Modification to the corresponding style property can be achieved using
-	 * the <code>Rect</code> interface.
-	 * 
-	 * @return The Rect value.
-	 * @exception DOMException
-	 *                INVALID_ACCESS_ERR: Raised if the CSS value doesn't
-	 *                contain a Rect value. (e.g. this is not
-	 *                <code>CSS_RECT</code>).
-	 */
-	public Rect getRectValue() throws DOMException {
-		throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
-	}
-
-	/**
-	 * This method is used to get the RGB color. If this CSS value doesn't
-	 * contain a RGB color value, a <code>DOMException</code> is raised.
-	 * Modification to the corresponding style property can be achieved using
-	 * the <code>RGBColor</code> interface.
-	 * 
-	 * @return the RGB color value.
-	 * @exception DOMException
-	 *                INVALID_ACCESS_ERR: Raised if the attached property
-	 *                can't return a RGB color value (e.g. this is not
-	 *                <code>CSS_RGBCOLOR</code>).
-	 */
-	public RGBColor getRGBColorValue() throws DOMException {
-		throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
-	}
-
-	/**
-	 * This method is used to get the string value. If the CSS value doesn't
-	 * contain a string value, a <code>DOMException</code> is raised. Some
-	 * properties (like 'font-family' or 'voice-family') convert a whitespace
-	 * separated list of idents to a string.
-	 * 
-	 * @return The string value in the current unit. The current
-	 *         <code>primitiveType</code> can only be a string unit type
-	 *         (i.e. <code>CSS_STRING</code>,<code>CSS_URI</code>,
-	 *         <code>CSS_IDENT</code> and <code>CSS_ATTR</code>).
-	 * @exception DOMException
-	 *                INVALID_ACCESS_ERR: Raised if the CSS value doesn't
-	 *                contain a string value.
-	 */
-	public String getStringValue() throws DOMException {
-		switch (fPrimitiveType) {
-			case CSS_STRING :
-			case CSS_URI :
-			case CSS_IDENT :
-			case CSS_ATTR :
-			case CSS_URANGE :
-			case CSS_FORMAT :
-			case CSS_LOCAL :
-			case CSS_HASH :
-			case CSS_COMMA :
-			case CSS_SLASH :
-			case CSS_INHERIT_PRIMITIVE :
-				return fStringValue;
-			default :
-				throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void notifyValueChanged(String oldValue) {
-		// for model
-		ICSSDocument doc = getContainerDocument();
-		if (doc == null)
-			return;
-		CSSModelImpl model = (CSSModelImpl) doc.getModel();
-		if (model == null)
-			return;
-		model.valueChanged(this, oldValue);
-
-		// for adapters
-		notify(CHANGE, new Short(fPrimitiveType), null, null, getStartOffset());
-	}
-
-	/**
-	 * A method to set the float value with a specified unit. If the property
-	 * attached with this value can not accept the specified unit or the float
-	 * value, the value will be unchanged and a <code>DOMException</code>
-	 * will be raised.
-	 * 
-	 * @param unitType
-	 *            A unit code as defined above. The unit code can only be a
-	 *            float unit type (i.e. <code>CSS_NUMBER</code>,
-	 *            <code>CSS_PERCENTAGE</code>,<code>CSS_EMS</code>,
-	 *            <code>CSS_EXS</code>,<code>CSS_PX</code>,
-	 *            <code>CSS_CM</code>,<code>CSS_MM</code>,
-	 *            <code>CSS_IN</code>,<code>CSS_PT</code>,
-	 *            <code>CSS_PC</code>,<code>CSS_DEG</code>,
-	 *            <code>CSS_RAD</code>,<code>CSS_GRAD</code>,
-	 *            <code>CSS_MS</code>,<code>CSS_S</code>,
-	 *            <code>CSS_HZ</code>,<code>CSS_KHZ</code>,
-	 *            <code>CSS_DIMENSION</code>).
-	 * @param floatValue
-	 *            The new float value.
-	 * @exception DOMException
-	 *                INVALID_ACCESS_ERR: Raised if the attached property
-	 *                doesn't support the float value or the unit type. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public void setFloatValue(short unitType, float floatValue) throws DOMException {
-		switch (unitType) {
-			case CSS_NUMBER :
-			case CSS_PERCENTAGE :
-			case CSS_EMS :
-			case CSS_EXS :
-			case CSS_PX :
-			case CSS_CM :
-			case CSS_MM :
-			case CSS_IN :
-			case CSS_PT :
-			case CSS_PC :
-			case CSS_DEG :
-			case CSS_RAD :
-			case CSS_GRAD :
-			case CSS_MS :
-			case CSS_S :
-			case CSS_HZ :
-			case CSS_KHZ :
-			case CSS_DIMENSION :
-			case CSS_INTEGER :
-				String oldValue = getCSSValueText();
-				fPrimitiveType = unitType;
-				fFloatValue = floatValue;
-				notifyValueChanged(oldValue);
-				break;
-			default :
-				throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * A method to set the string value with the specified unit. If the
-	 * property attached to this value can't accept the specified unit or the
-	 * string value, the value will be unchanged and a
-	 * <code>DOMException</code> will be raised.
-	 * 
-	 * @param stringType
-	 *            A string code as defined above. The string code can only be
-	 *            a string unit type (i.e. <code>CSS_STRING</code>,
-	 *            <code>CSS_URI</code>,<code>CSS_IDENT</code>, and
-	 *            <code>CSS_ATTR</code>).
-	 * @param stringValue
-	 *            The new string value.
-	 * @exception DOMException
-	 *                INVALID_ACCESS_ERR: Raised if the CSS value doesn't
-	 *                contain a string value or if the string value can't be
-	 *                converted into the specified unit. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public void setStringValue(short stringType, String stringValue) throws DOMException {
-		switch (stringType) {
-			case CSS_STRING :
-			case CSS_URI :
-			case CSS_IDENT :
-			case CSS_ATTR :
-			case CSS_URANGE :
-			case CSS_FORMAT :
-			case CSS_LOCAL :
-			case CSS_HASH :
-			case CSS_COMMA :
-			case CSS_SLASH :
-			case CSS_INHERIT_PRIMITIVE :
-				String oldValue = getCSSValueText();
-				fPrimitiveType = stringType;
-				fStringValue = stringValue;
-				notifyValueChanged(oldValue);
-				break;
-			default :
-				throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Insert the method's description here. Creation date: (2001/01/24
-	 * 15:06:25)
-	 * 
-	 * @param floatValue
-	 *            float
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public void setValue(float floatValue) throws org.w3c.dom.DOMException {
-		setFloatValue(getPrimitiveType(), floatValue);
-	}
-
-	/**
-	 * Insert the method's description here. Creation date: (2001/01/24
-	 * 15:06:25)
-	 * 
-	 * @param stringValue
-	 *            java.lang.String
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public void setValue(java.lang.String stringValue) throws org.w3c.dom.DOMException {
-		setStringValue(getPrimitiveType(), stringValue);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java
deleted file mode 100644
index 34256e7..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java
+++ /dev/null
@@ -1,203 +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
- *******************************************************************************/
-package org.eclipse.wst.css.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;
-
-/**
- * 
- */
-abstract class CSSRegionContainer extends CSSNodeImpl {
-
-	private ITextRegion fFirstRegion = null;
-	private ITextRegion fLastRegion = null;
-	private IStructuredDocumentRegion fParentRegion = null;
-
-	/**
-	 * CSSRegionContainer constructor comment.
-	 */
-	CSSRegionContainer() {
-		super();
-	}
-
-	CSSRegionContainer(CSSRegionContainer that) {
-		super(that);
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public String getCssText() {
-		if (fFirstRegion == null || fLastRegion == null)
-			return generateSource();
-
-		ITextRegionList regions = fParentRegion.getRegions();
-		StringBuffer source = new StringBuffer();
-		boolean bIn = false;
-		for (int i = 0; i < regions.size(); i++) {
-			ITextRegion current = regions.get(i);
-			if (bIn) {
-				source.append(fParentRegion.getText(current));
-				if (current == fLastRegion)
-					break;
-			}
-			else {
-				if (current == fFirstRegion) {
-					bIn = true;
-					source.append(fParentRegion.getText(current));
-					if (current == fLastRegion)
-						break;
-				}
-			}
-		}
-
-		return source.toString();
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getEndOffset() {
-		int result = -1;
-		ITextRegion region = getLastRegion();
-		if (!(region == null || fParentRegion == null)) {
-			result = fParentRegion.getEndOffset(region);
-		}
-		return result;
-	}
-
-	IStructuredDocumentRegion getDocumentRegion() {
-		return fParentRegion;
-	}
-
-	ITextRegion getFirstRegion() {
-		return fFirstRegion;
-	}
-
-	ITextRegion getLastRegion() {
-		return fLastRegion;
-	}
-
-	ITextRegion getRegion(int index) {
-		if (getFirstRegion() == null)
-			return null;
-		ITextRegionList regions = fParentRegion.getRegions();
-
-		for (int i = 0; i < regions.size(); i++) {
-			if (regions.get(i) == getFirstRegion()) {
-				if (i + index < regions.size()) {
-					ITextRegion target = regions.get(i + index);
-					if (target.getStart() <= getLastRegion().getStart())
-						return target;
-				}
-				return null;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * @return int
-	 */
-	int getRegionCount() {
-		validateRange();
-
-		if (getFirstRegion() == null)
-			return 0;
-		if (getFirstRegion() == getLastRegion())
-			return 1;
-		ITextRegionList regions = fParentRegion.getRegions();
-
-		int j = 0;
-		for (int i = 0; i < regions.size(); i++) {
-			ITextRegion current = regions.get(i);
-			if (j != 0 || current == getFirstRegion())
-				j++;
-			if (current == getLastRegion())
-				break;
-		}
-		return j;
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getStartOffset() {
-		int result = -1;
-		ITextRegion region = getFirstRegion();
-		if (!(region == null || fParentRegion == null)) {
-			result = fParentRegion.getStartOffset(region);
-		}
-		return result;
-	}
-
-
-
-	/**
-	 * @deprecated
-	 */
-	ITextRegion setFirstRegion(ITextRegion region) {
-		this.fFirstRegion = region;
-		return region;
-	}
-
-	/**
-	 * @deprecated
-	 */
-	ITextRegion setLastRegion(ITextRegion lastRegion) {
-		this.fLastRegion = lastRegion;
-		return lastRegion;
-	}
-
-	void setRangeRegion(IStructuredDocumentRegion parentRegion, ITextRegion firstRegion, ITextRegion lastRegion) {
-		this.fParentRegion = parentRegion;
-		this.fFirstRegion = firstRegion;
-		this.fLastRegion = lastRegion;
-
-		if (firstRegion == null && lastRegion == null) {
-			setFirstRegion(null);
-			setLastRegion(null);
-		}
-		else { // range validation
-			validateRange();
-		}
-	}
-
-	/**
-	 * @return boolean
-	 */
-	private boolean validateRange() {
-		boolean bModified = false;
-
-		if (this.fFirstRegion != null || this.fLastRegion != null) {
-			if (this.fFirstRegion == null) {
-				this.fFirstRegion = this.fLastRegion;
-				bModified = true;
-			}
-			else if (this.fLastRegion == null) {
-				this.fLastRegion = this.fFirstRegion;
-				bModified = true;
-			}
-			else if (this.fFirstRegion.getStart() > this.fLastRegion.getStart()) {
-				// need to swap first for last
-				ITextRegion reg = fFirstRegion;
-				fFirstRegion = fLastRegion;
-				fLastRegion = reg;
-				bModified = true;
-			}
-		}
-		return bModified;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleDeclContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleDeclContainer.java
deleted file mode 100644
index ab4914b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleDeclContainer.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-
-/**
- * 
- */
-abstract class CSSRuleDeclContainer extends CSSRuleImpl {
-
-	/**
-	 * CSSRuleDeclContainer constructor comment.
-	 */
-	CSSRuleDeclContainer() {
-		super();
-	}
-
-	/**
-	 * CSSRuleDeclContainer constructor comment.
-	 * 
-	 */
-	CSSRuleDeclContainer(CSSRuleDeclContainer that) {
-		super(that);
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	abstract String extractPreString();
-
-	/**
-	 * @return org.w3c.dom.css.CSSStyleDeclaration
-	 */
-	public CSSStyleDeclaration getStyle() {
-
-		for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
-			if (node instanceof CSSStyleDeclaration)
-				return (CSSStyleDeclaration) node;
-		}
-
-		return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleImpl.java
deleted file mode 100644
index fd7d337..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleImpl.java
+++ /dev/null
@@ -1,80 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleSheet;
-
-
-/**
- * 
- */
-abstract class CSSRuleImpl extends CSSStructuredDocumentRegionContainer implements CSSRule {
-
-	/**
-	 * 
-	 */
-	CSSRuleImpl() {
-		super();
-	}
-
-	CSSRuleImpl(CSSRuleImpl that) {
-		super(that);
-	}
-
-	/**
-	 * If this rule is contained inside another rule (e.g. a style rule inside
-	 * an
-	 * 
-	 * @media block), this is the containing rule. If this rule is not nested
-	 *        inside any other rules, this returns <code>null</code>.
-	 */
-	public CSSRule getParentRule() {
-		ICSSNode rule = getParentNode();
-
-		// parent rule is used only if parent is media rule
-		if (rule instanceof CSSMediaRuleImpl)
-			return (CSSRule) rule;
-
-		return null;
-	}
-
-	/**
-	 * The style sheet that contains this rule.
-	 */
-	public CSSStyleSheet getParentStyleSheet() {
-		ICSSNode parent = getParentNode();
-		while (parent != null) {
-			if (parent instanceof CSSStyleSheetImpl)
-				return (CSSStyleSheet) parent;
-			parent = parent.getParentNode();
-		}
-		return null;
-	}
-
-	/**
-	 * The type of the rule, as defined above. The expectation is that
-	 * binding-specific casting methods can be used to cast down from an
-	 * instance of the <code>CSSRule</code> interface to the specific
-	 * derived interface implied by the <code>type</code>.
-	 */
-	public abstract short getType();
-
-	/**
-	 * @return boolean
-	 */
-	public boolean hasProperties() {
-		return true;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleListImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleListImpl.java
deleted file mode 100644
index 51f15a4..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleListImpl.java
+++ /dev/null
@@ -1,45 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-
-/**
- * 
- */
-public class CSSRuleListImpl extends AbstractCSSNodeList implements CSSRuleList {
-
-	/**
-	 * 
-	 */
-	CSSRuleListImpl() {
-		super();
-	}
-
-	/**
-	 * Used to retrieve a CSS rule by ordinal index. The order in this
-	 * collection represents the order of the rules in the CSS style sheet. If
-	 * index is greater than or equal to the number of rules in the list, this
-	 * returns <code>null</code>.
-	 * 
-	 * @param indexIndex
-	 *            into the collection
-	 * @return The style rule at the <code>index</code> position in the
-	 *         <code>CSSRuleList</code>, or <code>null</code> if that is
-	 *         not a valid index.
-	 */
-	public CSSRule item(int index) {
-		return (CSSRule) itemImpl(index);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java
deleted file mode 100644
index 031a046..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java
+++ /dev/null
@@ -1,422 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSelectorAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorCombinator;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- * 
- */
-class CSSSelector implements ICSSSelector {
-
-	private int fSpecificity = -1;
-	private String fCachedString = null;
-	private List fTokens = null;
-	private List fItems = null;
-	private List fParseErrors = null;
-	private List fNameErrors = null;
-
-	CSSSelector(List tokens) {
-		fTokens = new ArrayList(tokens);
-	}
-
-	/**
-	 * @return boolean
-	 * @param obj
-	 *            java.lang.Object
-	 */
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-
-		if (obj == null || this.getClass() != obj.getClass())
-			return false;
-
-		CSSSelector foreign = (CSSSelector) obj;
-
-		// if (fSpecificity != foreign.fSpecificity) return false;
-
-		if (getLength() != foreign.getLength())
-			return false;
-
-		for (int i = 0; i < getLength(); i++) {
-			if (!getItem(i).equals(foreign.getItem(i)))
-				return false;
-		}
-
-		return true;
-	}
-
-	public ICSSSelectorItem getItem(int index) {
-		if (fItems == null) {
-			fItems = parseSelector(fTokens);
-		}
-		if (fItems != null && 0 <= index && index < fItems.size()) {
-			return (ICSSSelectorItem) fItems.get(index);
-		}
-		else {
-			return null;
-		}
-	}
-
-	/**
-	 * @return java.util.Iterator
-	 */
-	public Iterator getIterator() {
-		if (fItems == null) {
-			fItems = parseSelector(fTokens);
-		}
-		return (fItems != null) ? fItems.iterator() : null;
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getLength() {
-		if (fItems == null) {
-			fItems = parseSelector(fTokens);
-		}
-		return (fItems != null) ? fItems.size() : 0;
-	}
-
-	/**
-	 * @return org.w3c.dom.Element
-	 */
-	private Element getParentElement(Element element) {
-		try {
-			element = (Element) element.getParentNode();
-		}
-		catch (Exception ex) {
-			// cast error or null pointer ...
-			element = null;
-		}
-		return element;
-	}
-
-	/**
-	 * @return org.w3c.dom.Element
-	 */
-	private Element getPreviousElement(Element element) {
-		Element p = null;
-		for (Node node = element.getPreviousSibling(); node != null; node = node.getPreviousSibling()) {
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				p = (Element) node;
-				break;
-			}
-		}
-		return p;
-	}
-
-	/**
-	 * Calculate a selector's specificity a = the number of ID attributes in
-	 * the selector b = the number of other attributes and pseudo-classes in
-	 * the selector c = the number of element names in the selector (ignore
-	 * pseudo-elements) Concatenating the three numbers a-b-c (in a number
-	 * system with a large base) gives the specificity.
-	 * 
-	 * @return int
-	 */
-	public int getSpecificity() {
-		if (fSpecificity < 0) {
-			int nIDs = 0;
-			int nAttributes = 0;
-			int nElements = 0;
-			Iterator i = getIterator();
-			while (i.hasNext()) {
-				ICSSSelectorItem item = (ICSSSelectorItem) i.next();
-				if (item instanceof CSSSimpleSelector) {
-					CSSSimpleSelector selector = (CSSSimpleSelector) item;
-					nIDs += selector.getNumOfIDs();
-					nAttributes += selector.getNumOfAttributes();
-					nAttributes += selector.getNumOfClasses();
-					nAttributes += selector.getNumOfPseudoNames();
-					if (!selector.isUniversal()) {
-						nElements++;
-					}
-				}
-			}
-			fSpecificity = nIDs * 10000 + nAttributes * 100 + nElements;
-		}
-
-		return fSpecificity;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public String getString() {
-		if (fCachedString == null) {
-			StringBuffer buf = new StringBuffer();
-			Iterator i = getIterator();
-			while (i.hasNext()) {
-				ICSSSelectorItem item = (ICSSSelectorItem) i.next();
-				if (item instanceof CSSSelectorCombinator) {
-					// If item is DESCENDANT combinator, it is just single
-					// space.
-					// Then, you dont have to append string..
-					if (((CSSSelectorCombinator) item).getCombinatorType() != ICSSSelectorCombinator.DESCENDANT) {
-						buf.append(" ");//$NON-NLS-1$
-						buf.append(item.getString());
-					}
-					buf.append(" ");//$NON-NLS-1$
-				}
-				else {
-					buf.append(item.getString());
-				}
-			}
-			fCachedString = buf.toString();
-		}
-
-		return fCachedString;
-	}
-
-	/**
-	 * @return boolean
-	 * @param element
-	 *            org.w3c.dom.Element
-	 */
-	public boolean match(org.w3c.dom.Element element, java.lang.String pseudoName) {
-		Element target = element;
-		char combinatorType = ICSSSelectorCombinator.UNKNOWN;
-		Element chunkStartElement = null; // for CHILD and ADJACENT
-											// combinator
-		int chunkStartItem = -1; // for CHILD and ADJACENT combinator
-		int numItems = getLength();
-		for (int iItem = numItems - 1; iItem >= 0; iItem--) {
-			// Check Selector Items
-			ICSSSelectorItem item = getItem(iItem);
-			if (item instanceof ICSSSimpleSelector) {
-				// Simple Selector
-				if (target == null)
-					return false;
-				if (!matchExactly((ICSSSimpleSelector) item, target, pseudoName)) {
-					switch (combinatorType) {
-						case ICSSSelectorCombinator.DESCENDANT :
-							do {
-								target = getParentElement(target);
-								if (target == null)
-									return false;
-							}
-							while (!matchExactly((ICSSSimpleSelector) item, target, pseudoName));
-							break;
-						case ICSSSelectorCombinator.CHILD :
-						case ICSSSelectorCombinator.ADJACENT :
-							if (chunkStartElement != null && chunkStartElement != element) {
-								// previous conbinator must be DESCENDENT.
-								// goto parent
-								target = getParentElement(chunkStartElement);
-								iItem = chunkStartItem + 1;
-								chunkStartElement = null;
-								chunkStartItem = -1;
-								break;
-							}
-						default :
-							// other combinators are not supported yet.
-							return false;
-					}
-				}
-			}
-			else if (item instanceof ICSSSelectorCombinator) {
-				// Combinator ( "+", ">", " ", ...)
-				if (iItem == numItems - 1)
-					return false; // last item is combinator
-
-				ICSSSelectorCombinator sc = (ICSSSelectorCombinator) item;
-				combinatorType = sc.getCombinatorType();
-				switch (combinatorType) {
-					case ICSSSelectorCombinator.DESCENDANT :
-						target = getParentElement(target);
-						break;
-					case ICSSSelectorCombinator.CHILD :
-					case ICSSSelectorCombinator.ADJACENT :
-						if (chunkStartElement == null) {
-							chunkStartElement = target;
-							chunkStartItem = iItem + 1; // safe because this
-														// is not a last item.
-						}
-						if (combinatorType == ICSSSelectorCombinator.CHILD) {
-							target = getParentElement(target);
-						}
-						else {
-							target = getPreviousElement(target);
-						}
-						break;
-				}
-			}
-			else {
-				// what is this item ???
-				return false;
-			}
-		}
-		// OK this selector maches the element.
-		return true;
-
-	}
-
-	/**
-	 * @return boolean
-	 */
-	private boolean matchExactly(ICSSSimpleSelector selector, Element element, String pseudoName) {
-		IStyleSelectorAdapter adapter = (IStyleSelectorAdapter) ((INodeNotifier) element).getAdapterFor(IStyleSelectorAdapter.class);
-		if (adapter != null) {
-			return adapter.match(selector, element, pseudoName);
-		}
-
-		if (element == null)
-			return false;
-		int i;
-		String key;
-
-		// TODO: PseudoName
-
-		// check tag name
-		if (!selector.isUniversal() && !element.getNodeName().equals(selector.getName()))
-			return false;
-
-		// check id
-		i = selector.getNumOfIDs();
-		if (i > 0) {
-			if (i > 1)
-				return false;
-			key = element.getAttribute("id");//$NON-NLS-1$
-			if (key == null)
-				return false;
-			if (!selector.getID(0).equals(key))
-				return false;
-		}
-
-		// check class
-		i = selector.getNumOfClasses();
-		if (i > 0) {
-			key = element.getAttribute("class");//$NON-NLS-1$
-			if (key == null)
-				return false;
-			StringTokenizer tokenizer = new StringTokenizer(key);
-			for (i = i - 1; i >= 0; i--) {
-				boolean ok = false;
-				while (tokenizer.hasMoreTokens()) {
-					if (selector.getClass(i).equals(tokenizer.nextToken())) {
-						ok = true;
-						break;
-					}
-				}
-				if (!ok)
-					return false;
-			}
-		}
-
-		// check attributes
-		for (i = selector.getNumOfAttributes() - 1; i >= 0; i--) {
-			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)
-					return false;
-				if (countTokens > 1) {
-					String token = tokenizer.nextToken("= \t\r\n\f");//$NON-NLS-1$
-					StringTokenizer attrValueTokenizer = null;
-					if (token.equals("~")) {//$NON-NLS-1$
-						attrValueTokenizer = new StringTokenizer(attrValue);
-					}
-					else if (token.equals("|")) {//$NON-NLS-1$
-						attrValueTokenizer = new StringTokenizer(attrValue, "-");//$NON-NLS-1$
-					}
-					if (attrValueTokenizer != null) {
-						if (tokenizer.hasMoreTokens()) {
-							token = tokenizer.nextToken();
-							boolean ok = false;
-							while (attrValueTokenizer.hasMoreTokens()) {
-								if (token.equals(attrValueTokenizer.nextToken())) {
-									ok = true;
-									break;
-								}
-							}
-							if (!ok)
-								return false;
-						}
-					}
-					else {
-						if (!attrValue.equals(token))
-							return false;
-					}
-				}
-			}
-		}
-
-		return true;
-	}
-
-	private List parseSelector(List tokens) {
-		CSSSelectorParser parser = new CSSSelectorParser(tokens);
-		List selector = parser.getSelector();
-		Iterator i = parser.getErrors();
-		fParseErrors = new ArrayList();
-		while (i.hasNext()) {
-			fParseErrors.add(i.next());
-		}
-		return selector;
-	}
-
-	public Iterator getErrors() {
-		if (fNameErrors == null) {
-			fNameErrors = new ArrayList();
-			Iterator iItem = getIterator();
-			while (iItem.hasNext()) {
-				ICSSSelectorItem item = (ICSSSelectorItem) iItem.next();
-				if (item instanceof ICSSSimpleSelector) {
-					if (!((ICSSSimpleSelector) item).isUniversal()) {
-						String name = ((ICSSSimpleSelector) item).getName();
-						if (!NameValidator.isValid(name)) {
-							fNameErrors.add(item);
-						}
-					}
-				}
-			}
-		}
-		List errors = new ArrayList(fParseErrors);
-		errors.addAll(fNameErrors);
-		return errors.iterator();
-	}
-
-	public String toString() {
-		return getString();
-	}
-
-	/**
-	 * @see ICSSSelector#getErrorCount()
-	 */
-	public int getErrorCount() {
-		int nErrors = 0;
-		Iterator i = getErrors();
-		while (i.hasNext()) {
-			nErrors++;
-			i.next();
-		}
-		return nErrors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorCombinator.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorCombinator.java
deleted file mode 100644
index 5df2594..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorCombinator.java
+++ /dev/null
@@ -1,76 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorCombinator;
-
-/**
- * 
- */
-class CSSSelectorCombinator extends CSSSelectorItem implements ICSSSelectorCombinator {
-
-	char fType = ICSSSelectorCombinator.UNKNOWN;
-
-	/**
-	 * CSSSelectorCombinator constructor comment.
-	 */
-	public CSSSelectorCombinator(char type) {
-		super();
-		setCombinatorType(type);
-	}
-
-	/**
-	 * @return boolean
-	 * @param obj
-	 *            java.lang.Object
-	 */
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-
-		if (obj == null || this.getClass() != obj.getClass())
-			return false;
-
-		CSSSelectorCombinator foreign = (CSSSelectorCombinator) obj;
-
-		return (getCombinatorType() == foreign.getCombinatorType());
-
-	}
-
-	/**
-	 * @return int
-	 */
-	public char getCombinatorType() {
-		return fType;
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getItemType() {
-		return COMBINATOR;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public String getString() {
-		StringBuffer buf = new StringBuffer();
-		buf.append(fType);
-		return buf.toString();
-	}
-
-	void setCombinatorType(char type) {
-		fType = type;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorItem.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorItem.java
deleted file mode 100644
index 1134bcc..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorItem.java
+++ /dev/null
@@ -1,42 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem;
-
-/**
- * 
- */
-abstract class CSSSelectorItem implements ICSSSelectorItem {
-
-	/**
-	 * CSSSelectorItem constructor comment.
-	 */
-	public CSSSelectorItem() {
-		super();
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getItemType() {
-		return 0;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public String getString() {
-		return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorListImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorListImpl.java
deleted file mode 100644
index de4a0bc..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorListImpl.java
+++ /dev/null
@@ -1,207 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.w3c.dom.Element;
-
-
-/**
- * 
- */
-public class CSSSelectorListImpl implements ICSSSelectorList {
-
-	private String fText = null;
-	private String fCachedString = null; // normalized string
-	private List fSelectors = null;
-
-	public CSSSelectorListImpl(String cssText) {
-		super();
-		fText = cssText;
-		parseSelectorText();
-	}
-
-	/**
-	 * @return boolean
-	 * @param obj
-	 *            java.lang.Object
-	 */
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-
-		if (obj == null || this.getClass() != obj.getClass())
-			return false;
-
-		CSSSelectorListImpl foreign = (CSSSelectorListImpl) obj;
-
-		if (getLength() != foreign.getLength())
-			return false;
-
-		for (int i = 0; i < getLength(); i++) {
-			if (!getSelector(i).equals(foreign.getSelector(i)))
-				return false;
-		}
-
-		return true;
-	}
-
-	/**
-	 * @return java.util.Iterator
-	 */
-	public Iterator getIterator() {
-		return getSelectors().iterator();
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getLength() {
-		return getSelectors().size();
-	}
-
-	public ICSSSelector getSelector(int index) {
-		List selectors = getSelectors();
-		if (0 <= index && index < selectors.size()) {
-			return (ICSSSelector) selectors.get(index);
-		}
-		else {
-			return null;
-		}
-	}
-
-	private List getSelectors() {
-		if (fSelectors == null) {
-			parseSelectorText();
-		}
-		return fSelectors;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public String getString() {
-		if (fCachedString == null) {
-			StringBuffer buf = new StringBuffer();
-			boolean bFirst = true;
-			// groups is list of comma-separated selectors
-			Iterator i = getSelectors().iterator();
-			while (i.hasNext()) {
-				if (!bFirst) {
-					buf.append(", ");//$NON-NLS-1$
-				}
-				ICSSSelector item = (ICSSSelector) i.next();
-				buf.append(item.getString());
-				bFirst = false;
-			}
-			fCachedString = buf.toString();
-		}
-		return fCachedString;
-	}
-
-	/**
-	 * @return boolean
-	 * @param element
-	 *            org.w3c.dom.Element
-	 */
-	public boolean match(Element element, String pseudoName) {
-		int nSelectors = getLength();
-		selectorListLoop : for (int iSelector = 0; iSelector < nSelectors; iSelector++) {
-			// Check each Selector Lists
-			ICSSSelector selector = getSelector(iSelector);
-			if (selector.match(element, pseudoName))
-				return true;
-		}
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	private void parseSelectorText() {
-		fSelectors = new ArrayList();
-		if (fText == null) {
-			return;
-		}
-
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_STYLESHEET, fText);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return;
-		}
-
-		List tokenGroup = new ArrayList();
-		for (int i = 0; i < tokens.length; i++) {
-			CSSTextToken token = tokens[i];
-			if (token.kind == CSSRegionContexts.CSS_SELECTOR_SEPARATOR && 0 < tokenGroup.size()) {
-				ICSSSelector selector = new CSSSelector(tokenGroup);
-				if (selector != null) {
-					fSelectors.add(selector);
-				}
-				tokenGroup.clear();
-			}
-			else {
-				tokenGroup.add(tokens[i]);
-			}
-		}
-		if (0 < tokenGroup.size()) {
-			ICSSSelector selector = new CSSSelector(tokenGroup);
-			if (selector != null) {
-				fSelectors.add(selector);
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public String toString() {
-		return getString();
-	}
-
-	/**
-	 * 
-	 */
-	public Iterator getErrors() {
-		List errors = new ArrayList();
-		Iterator iSelector = getSelectors().iterator();
-		while (iSelector.hasNext()) {
-			Iterator iError = ((ICSSSelector) iSelector.next()).getErrors();
-			while (iError.hasNext()) {
-				errors.add(iError.next());
-			}
-		}
-		return errors.iterator();
-	}
-
-	/**
-	 * 
-	 */
-	public int getErrorCount() {
-		int nErrors = 0;
-		Iterator i = getErrors();
-		while (i.hasNext()) {
-			nErrors++;
-			i.next();
-		}
-		return nErrors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorParser.java
deleted file mode 100644
index 7f00342..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorParser.java
+++ /dev/null
@@ -1,335 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorCombinator;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem;
-
-
-/**
- * 
- */
-public class CSSSelectorParser {
-
-	private final static int IDLE = 0;
-	private final static int ATTRIBUTE = 1;
-	private final static int SIMPLE = 2;
-
-	private List fTokens = null;
-	private List fItems = null;
-	private List fErrors = null;
-
-	/**
-	 * 
-	 */
-	CSSSelectorParser(List tokens) {
-		super();
-		fTokens = new ArrayList(tokens);
-	}
-
-	/**
-	 * 
-	 */
-	List getSelector() {
-		if (fItems == null) {
-			parseSelector();
-		}
-		return fItems;
-	}
-
-	/**
-	 * 
-	 */
-	private void parseSelector() {
-		fItems = new ArrayList();
-
-		List attrBuf = null;
-		CSSSimpleSelector item = null;
-
-		int status = IDLE;
-		Iterator i = fTokens.iterator();
-		while (i.hasNext()) {
-			CSSTextToken token = (CSSTextToken) i.next();
-			if (token == null || token.kind == CSSRegionContexts.CSS_S || token.kind == CSSRegionContexts.CSS_COMMENT) {
-				continue;
-			}
-			switch (status) {
-				case IDLE :
-					if (isTag(token)) {
-						item = createSimple();
-						appendTag(item, token);
-						status = SIMPLE;
-					}
-					else if (isID(token)) {
-						item = createSimple();
-						appendID(item, token);
-						status = SIMPLE;
-					}
-					else if (isClass(token)) {
-						item = createSimple();
-						appendClass(item, token);
-						status = SIMPLE;
-					}
-					else if (isPseudo(token)) {
-						item = createSimple();
-						appendPseudo(item, token);
-						status = SIMPLE;
-					}
-					else if (isAttributeBegin(token)) {
-						item = createSimple();
-						status = ATTRIBUTE;
-					}
-					else {
-						addError(token);
-					}
-					break;
-				case SIMPLE :
-					if (isID(token)) {
-						appendID(item, token);
-					}
-					else if (isClass(token)) {
-						appendClass(item, token);
-					}
-					else if (isPseudo(token)) {
-						appendPseudo(item, token);
-					}
-					else if (isAttributeBegin(token)) {
-						status = ATTRIBUTE;
-					}
-					else if (isCombinator(token)) { // combinator
-						closeItem(item);
-						closeItem(createCombinator(token));
-						status = IDLE;
-					}
-					else {
-						addError(token);
-					}
-					break;
-				case ATTRIBUTE :
-					if (isAttributeEnd(token)) {
-						appendAttribute(item, attrBuf);
-						attrBuf = null;
-						status = SIMPLE;
-					}
-					else {
-						if (attrBuf == null) {
-							attrBuf = new ArrayList();
-						}
-						attrBuf.add(token);
-						if (!isAttributeContent(token)) {
-							addError(token);
-						}
-					}
-					break;
-				default :
-					break;
-			}
-		}
-
-		closeItem(item);
-	}
-
-	/**
-	 * @param token
-	 * @return
-	 */
-	private boolean isAttributeContent(CSSTextToken token) {
-		String type = token.kind;
-		return (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE);
-	}
-
-	/**
-	 * @param token
-	 * @return
-	 */
-	private boolean isAttributeEnd(CSSTextToken token) {
-		String type = token.kind;
-		return (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END);
-	}
-
-	/**
-	 * @param token
-	 * @return
-	 */
-	private boolean isAttributeBegin(CSSTextToken token) {
-		String type = token.kind;
-		return (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START);
-	}
-
-	/**
-	 * @param token
-	 * @return
-	 */
-	private boolean isCombinator(CSSTextToken token) {
-		String type = token.kind;
-		return (type == CSSRegionContexts.CSS_SELECTOR_COMBINATOR);
-	}
-
-	/**
-	 * @param token
-	 * @return
-	 */
-	private boolean isPseudo(CSSTextToken token) {
-		String type = token.kind;
-		return (type == CSSRegionContexts.CSS_SELECTOR_PSEUDO);
-	}
-
-	/**
-	 * @param token
-	 * @return
-	 */
-	private boolean isClass(CSSTextToken token) {
-		String type = token.kind;
-		return (type == CSSRegionContexts.CSS_SELECTOR_CLASS);
-	}
-
-	/**
-	 * @param token
-	 * @return
-	 */
-	private boolean isID(CSSTextToken token) {
-		String type = token.kind;
-		return (type == CSSRegionContexts.CSS_SELECTOR_ID);
-	}
-
-	/**
-	 * @param token
-	 * @return
-	 */
-	private boolean isTag(CSSTextToken token) {
-		String type = token.kind;
-		return (type == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || type == CSSRegionContexts.CSS_SELECTOR_UNIVERSAL || type == CSSRegionContexts.CSS_UNKNOWN);
-	}
-
-	private CSSSimpleSelector createSimple() {
-		return new CSSSimpleSelector();
-	}
-
-	/**
-	 * if " " or "+" or ">" appeared, close simpleselector and add new
-	 * combinator
-	 */
-	private CSSSelectorCombinator createCombinator(CSSTextToken token) {
-		char type = 0;
-
-		String str = token.image;
-		if (str.trim().length() == 0) { // space
-			type = ICSSSelectorCombinator.DESCENDANT;
-		}
-		else if (str.equals("+")) { //$NON-NLS-1$
-			type = ICSSSelectorCombinator.ADJACENT;
-		}
-		else if (str.equals(">")) { //$NON-NLS-1$
-			type = ICSSSelectorCombinator.CHILD;
-		}
-
-		if (0 < type) {
-			return new CSSSelectorCombinator(type);
-		}
-		else {
-			return null;
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private void closeItem(ICSSSelectorItem item) {
-		if (item != null) {
-			fItems.add(item);
-		}
-	}
-
-	private void appendTag(CSSSimpleSelector item, CSSTextToken token) {
-		item.setName(token.image);
-		if (token.kind == CSSRegionContexts.CSS_UNKNOWN) {
-			addError(token);
-		}
-	}
-
-	/**
-	 * if "#xxxx" appeared, add ID to current selector
-	 */
-	private void appendID(CSSSimpleSelector item, CSSTextToken token) {
-		String text = token.toString();
-		String idContent = text.substring(1, text.length());
-		item.addID(idContent);
-	}
-
-	/**
-	 * if ".xxxx" appeared, add Class to current selector
-	 */
-	private void appendClass(CSSSimpleSelector item, CSSTextToken token) {
-		String text = token.toString();
-		String classContent = text.substring(1, text.length());
-		item.addClass(classContent);
-		if (Character.isDigit(classContent.charAt(0))) {
-			addError(token);
-		}
-	}
-
-	/**
-	 * if ":xxxx" appeared, add Pseudo(element/class) to current selector
-	 */
-	private void appendPseudo(CSSSimpleSelector item, CSSTextToken token) {
-		String text = token.toString();
-		String pseudoContent = text.substring(1, text.length());
-		item.addPseudoName(pseudoContent);
-	}
-
-	/**
-	 * 
-	 */
-	private void appendAttribute(CSSSimpleSelector item, List tokens) {
-		StringBuffer buf = new StringBuffer();
-
-		CSSTextToken token;
-		Iterator i = tokens.iterator();
-		while (i.hasNext()) {
-			token = (CSSTextToken) i.next();
-			buf.append(token.image);
-		}
-
-		item.addAttribute(buf.toString());
-	}
-
-	/**
-	 * 
-	 */
-	List getSelectorTags() {
-		List tagList = new ArrayList();
-		return tagList;
-	}
-
-	/**
-	 * 
-	 */
-	private void addError(CSSTextToken token) {
-		if (fErrors == null) {
-			fErrors = new ArrayList();
-		}
-		fErrors.add(token);
-	}
-
-	/**
-	 * 
-	 */
-	Iterator getErrors() {
-		return (fErrors == null) ? Collections.EMPTY_LIST.iterator() : fErrors.iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSimpleSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSimpleSelector.java
deleted file mode 100644
index 9f76ea3..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSimpleSelector.java
+++ /dev/null
@@ -1,281 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
-
-
-/**
- * 
- */
-class CSSSimpleSelector extends CSSSelectorItem implements ICSSSimpleSelector {
-
-	private String fName = null;
-	private String fCachedString = null;
-	private StringBuffer fStringBuf = null;
-	private List fPseudoName = null;
-	private List fAttribute = null;
-	private List fClass = null;
-	private List fID = null;
-
-	/**
-	 * CSSSimpleSelector constructor comment.
-	 */
-	public CSSSimpleSelector() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	void addAttribute(String attribute) {
-		if (fAttribute == null) {
-			fAttribute = new ArrayList();
-		}
-		fAttribute.add(attribute);
-		addToBuf("[");//$NON-NLS-1$
-		addToBuf(attribute);
-		addToBuf("]");//$NON-NLS-1$
-		fCachedString = null;
-	}
-
-	/**
-	 * 
-	 */
-	void addClass(String cls) {
-		if (fClass == null) {
-			fClass = new ArrayList();
-		}
-		fClass.add(cls);
-		addToBuf(".");//$NON-NLS-1$
-		addToBuf(cls);
-		fCachedString = null;
-	}
-
-	/**
-	 * 
-	 */
-	void addID(String id) {
-		if (fID == null) {
-			fID = new ArrayList();
-		}
-		fID.add(id);
-		addToBuf("#");//$NON-NLS-1$
-		addToBuf(id);
-		fCachedString = null;
-	}
-
-	/**
-	 * 
-	 */
-	void addPseudoName(String cls) {
-		if (fPseudoName == null) {
-			fPseudoName = new ArrayList();
-		}
-		fPseudoName.add(cls);
-		addToBuf(":");//$NON-NLS-1$
-		addToBuf(cls);
-		fCachedString = null;
-	}
-
-	/**
-	 * 
-	 */
-	private void addToBuf(String str) {
-		if (fStringBuf == null) {
-			fStringBuf = new StringBuffer();
-		}
-		fStringBuf.append(str);
-	}
-
-	/**
-	 * @return boolean
-	 * @param obj
-	 *            java.lang.Object
-	 */
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-
-		if (obj == null || this.getClass() != obj.getClass())
-			return false;
-
-		CSSSimpleSelector foreign = (CSSSimpleSelector) obj;
-
-		if (getName().compareToIgnoreCase(foreign.getName()) != 0)
-			return false;
-
-		int i;
-
-		// compare pseudo-classes / pseudo-elements
-		if (getNumOfPseudoNames() != foreign.getNumOfPseudoNames())
-			return false;
-		for (i = 0; i < getNumOfPseudoNames(); i++) {
-			if (getPseudoName(i).compareToIgnoreCase(foreign.getPseudoName(i)) != 0)
-				return false;
-		}
-
-		// compare classes
-		if (getNumOfClasses() != foreign.getNumOfClasses())
-			return false;
-		for (i = 0; i < getNumOfClasses(); i++) {
-			if (getClass(i).compareToIgnoreCase(foreign.getClass(i)) != 0)
-				return false;
-		}
-
-		// compare IDs
-		if (getNumOfIDs() != foreign.getNumOfIDs())
-			return false;
-		for (i = 0; i < getNumOfIDs(); i++) {
-			if (getID(i).compareToIgnoreCase(foreign.getID(i)) != 0)
-				return false;
-		}
-
-		// compare Attributes
-		if (getNumOfAttributes() != foreign.getNumOfAttributes())
-			return false;
-		for (i = 0; i < getNumOfAttributes(); i++) {
-			if (getAttribute(i).compareToIgnoreCase(foreign.getAttribute(i)) != 0)
-				return false;
-		}
-		return true;
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param index
-	 *            int
-	 */
-	public String getAttribute(int index) {
-		if (fAttribute != null && 0 <= index && index < fAttribute.size()) {
-			return (String) fAttribute.get(index);
-		}
-		else {
-			return "";//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param index
-	 *            int
-	 */
-	public String getClass(int index) {
-		if (fClass != null && 0 <= index && index < fClass.size()) {
-			return (String) fClass.get(index);
-		}
-		else {
-			return "";//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param index
-	 *            int
-	 */
-	public String getID(int index) {
-		if (fID != null && 0 <= index && index < fID.size()) {
-			return (String) fID.get(index);
-		}
-		else {
-			return "";//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getItemType() {
-		return SIMPLE;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public String getName() {
-		return (fName != null) ? fName : "";//$NON-NLS-1$
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public int getNumOfAttributes() {
-		return (fAttribute != null) ? fAttribute.size() : 0;
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public int getNumOfClasses() {
-		return (fClass != null) ? fClass.size() : 0;
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public int getNumOfIDs() {
-		return (fID != null) ? fID.size() : 0;
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public int getNumOfPseudoNames() {
-		return (fPseudoName != null) ? fPseudoName.size() : 0;
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param index
-	 *            int
-	 */
-	public String getPseudoName(int index) {
-		if (fPseudoName != null && 0 <= index && index < fPseudoName.size()) {
-			return (String) fPseudoName.get(index);
-		}
-		else {
-			return "";//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public String getString() {
-		if (fCachedString == null) {
-			StringBuffer buf = new StringBuffer(getName());
-			if (fStringBuf != null) {
-				buf.append(fStringBuf.toString());
-			}
-			fCachedString = buf.toString();
-		}
-		return fCachedString;
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public boolean isUniversal() {
-		return (fName == null || fName.equals("*"));//$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 */
-	void setName(String name) {
-		fName = name;
-		fCachedString = null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStructuredDocumentRegionContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStructuredDocumentRegionContainer.java
deleted file mode 100644
index 2f16772..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStructuredDocumentRegionContainer.java
+++ /dev/null
@@ -1,226 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-/**
- * 
- */
-abstract class CSSStructuredDocumentRegionContainer extends CSSNodeImpl {
-
-	private IStructuredDocumentRegion firstStructuredDocumentRegion = null;
-	private IStructuredDocumentRegion lastStructuredDocumentRegion = null;
-
-	/**
-	 * CSSContainer constructor comment.
-	 */
-	CSSStructuredDocumentRegionContainer() {
-		super();
-	}
-
-	CSSStructuredDocumentRegionContainer(CSSStructuredDocumentRegionContainer that) {
-		super(that);
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public String getCssText() {
-		if (getFirstStructuredDocumentRegion() == null)
-			return generateSource();
-
-		StringBuffer str = new StringBuffer(getFirstStructuredDocumentRegion().getText());
-		IStructuredDocumentRegion node = getFirstStructuredDocumentRegion();
-
-		while (node != getLastStructuredDocumentRegion()) {
-			node = node.getNext();
-			str.append(node.getText());
-		}
-
-		return str.toString();
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getEndOffset() {
-		IStructuredDocumentRegion flatNode = getLastStructuredDocumentRegion();
-		if (flatNode != null)
-			return flatNode.getEnd();
-		return -1;
-	}
-
-	IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
-		return firstStructuredDocumentRegion;
-	}
-
-	IStructuredDocumentRegion getStructuredDocumentRegion(int index) {
-		IStructuredDocumentRegion node = firstStructuredDocumentRegion;
-		for (int i = index; i > 0; i--) {
-			if (node == null)
-				return null;
-			node = node.getNext();
-		}
-		return node;
-	}
-
-	/**
-	 * @return int
-	 */
-	int getStructuredDocumentRegionCount() {
-		if (firstStructuredDocumentRegion == null)
-			return 0;
-
-		IStructuredDocumentRegion node = firstStructuredDocumentRegion;
-		int i = 0;
-		for (; node != null; i++)
-			node = node.getNext();
-		return i;
-	}
-
-	IStructuredDocumentRegion getLastStructuredDocumentRegion() {
-		return lastStructuredDocumentRegion;
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getStartOffset() {
-		IStructuredDocumentRegion flatNode = getFirstStructuredDocumentRegion();
-		if (flatNode != null)
-			return flatNode.getStart();
-		return -1;
-	}
-
-	boolean includeRangeStructuredDocumentRegion(IStructuredDocumentRegion first, IStructuredDocumentRegion last) {
-		boolean bModified = false;
-
-		// validate range of parameters
-		if (first != null && last != null) {
-			if (first.getStart() > last.getStart()) {
-				IStructuredDocumentRegion node = first;
-				first = last;
-				last = node;
-			}
-		}
-
-		// validate mine
-		boolean b = validateRange();
-		bModified = b || bModified;
-
-		if (first != null) {
-			if (getFirstStructuredDocumentRegion() == null || getFirstStructuredDocumentRegion().getStart() > first.getStart()) {
-				setFirstStructuredDocumentRegion(first);
-				bModified = true;
-			}
-		}
-
-		if (last != null) {
-			if (getLastStructuredDocumentRegion() == null || getLastStructuredDocumentRegion().getStart() < last.getStart()) {
-				setLastStructuredDocumentRegion(last);
-				bModified = true;
-			}
-		}
-
-		// re-validate
-		if (bModified)
-			validateRange();
-
-		return bModified;
-	}
-
-	/**
-	 * 
-	 */
-	boolean propagateRangeStructuredDocumentRegion() {
-		boolean bModified = false;
-
-		CSSStructuredDocumentRegionContainer parent = (CSSStructuredDocumentRegionContainer) getParentNode();
-		if (parent == null)
-			return bModified;
-
-		boolean b = parent.includeRangeStructuredDocumentRegion(getFirstStructuredDocumentRegion(), getLastStructuredDocumentRegion());
-		bModified = b || bModified;
-
-		if (b)
-			parent.propagateRangeStructuredDocumentRegion();
-		// else need not update range of ancestors
-
-		return bModified;
-	}
-
-	/**
-	 * @param cssText
-	 *            java.lang.String
-	 */
-	public void setCssText(String cssText) {
-		if (firstStructuredDocumentRegion != null) {
-			getOwnerDocument().getModel().getStructuredDocument().replaceText(this, getStartOffset(), getEndOffset() - getStartOffset(), cssText);
-		}
-		else
-			super.setCssText(cssText);
-	}
-
-	IStructuredDocumentRegion setFirstStructuredDocumentRegion(IStructuredDocumentRegion node) {
-		firstStructuredDocumentRegion = node;
-		return node;
-	}
-
-	IStructuredDocumentRegion setLastStructuredDocumentRegion(IStructuredDocumentRegion node) {
-		lastStructuredDocumentRegion = node;
-		return node;
-	}
-
-	void setRangeStructuredDocumentRegion(IStructuredDocumentRegion firstNode, IStructuredDocumentRegion lastNode) {
-		if (firstNode != null)
-			setFirstStructuredDocumentRegion(firstNode);
-		if (lastNode != null)
-			setLastStructuredDocumentRegion(lastNode);
-
-		if (firstNode == null && lastNode == null) {
-			setFirstStructuredDocumentRegion(null);
-			setLastStructuredDocumentRegion(null);
-		}
-		else { // range validation
-			validateRange();
-		}
-	}
-
-	/**
-	 * @return boolean
-	 */
-	private boolean validateRange() {
-		boolean bModified = false;
-
-		if (firstStructuredDocumentRegion != null || lastStructuredDocumentRegion != null) {
-			if (this.firstStructuredDocumentRegion == null) {
-				this.firstStructuredDocumentRegion = this.lastStructuredDocumentRegion;
-				bModified = true;
-			}
-			else if (this.lastStructuredDocumentRegion == null) {
-				this.lastStructuredDocumentRegion = this.firstStructuredDocumentRegion;
-				bModified = true;
-			}
-			else if (this.firstStructuredDocumentRegion.getStart() > this.lastStructuredDocumentRegion.getStart()) {
-				// need to swap first for last
-				IStructuredDocumentRegion node = firstStructuredDocumentRegion;
-				firstStructuredDocumentRegion = lastStructuredDocumentRegion;
-				lastStructuredDocumentRegion = node;
-				bModified = true;
-			}
-		}
-
-		return bModified;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java
deleted file mode 100644
index 208b951..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java
+++ /dev/null
@@ -1,264 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.encoding.CSSDocumentLoader;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceGenerator;
-import org.eclipse.wst.css.core.internal.formatter.StyleDeclItemFormatter;
-import org.eclipse.wst.css.core.internal.parser.CSSSourceParser;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-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.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- * 
- */
-class CSSStyleDeclItemImpl extends CSSStructuredDocumentRegionContainer implements ICSSStyleDeclItem {
-
-	private java.lang.String fPropertyName;
-
-	/**
-	 * CSSStyleDeclItemImpl constructor comment.
-	 * 
-	 */
-	CSSStyleDeclItemImpl(CSSStyleDeclItemImpl that) {
-		super(that);
-		this.fPropertyName = that.fPropertyName;
-	}
-
-	/**
-	 * CSSStyleDeclItemImpl constructor comment.
-	 */
-	CSSStyleDeclItemImpl(String propertyName) {
-		super();
-		this.fPropertyName = propertyName;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSPrimitiveValue
-	 * @param value
-	 *            org.w3c.dom.css.CSSPrimitiveValue
-	 */
-	public ICSSPrimitiveValue appendValue(ICSSPrimitiveValue value) throws DOMException {
-		return insertValueBefore(value, null);
-	}
-
-	/**
-	 * @param deep
-	 *            boolean
-	 */
-	public ICSSNode cloneNode(boolean deep) {
-		CSSStyleDeclItemImpl cloned = new CSSStyleDeclItemImpl(this);
-
-		if (deep)
-			cloneChildNodes(cloned, deep);
-
-		return cloned;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	String generateValueSource() {
-		CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(this);
-		if (formatter != null && formatter instanceof StyleDeclItemFormatter)
-			return ((StyleDeclItemFormatter) formatter).formatValue(this).toString();
-		else
-			return "";//$NON-NLS-1$
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSValue
-	 */
-	public CSSValue getCSSValue() {
-		int nValue = getLength();
-		if (nValue <= 0)
-			return null;
-		else if (nValue == 1)
-			return item(0);
-		else
-			return this;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public java.lang.String getCSSValueText() {
-		if (getFirstChild() == null)
-			return "";//$NON-NLS-1$
-		// check whether children has flatnodes
-		ICSSNode child = getFirstChild();
-		while (child != null) {
-			if (((IndexedRegion) child).getEndOffset() <= 0)
-				return generateValueSource();
-			child = child.getNextSibling();
-		}
-
-		IStructuredDocumentRegion node = getFirstStructuredDocumentRegion();
-		int start = ((IndexedRegion) getFirstChild()).getStartOffset() - node.getStartOffset();
-		int end = ((IndexedRegion) getLastChild()).getEndOffset() - node.getStartOffset();
-		return node.getText().substring(start, end);
-	}
-
-	/**
-	 * @return short
-	 */
-	public short getCssValueType() {
-		return CSS_VALUE_LIST;
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getLength() {
-		int i = 0;
-		for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
-			if (node instanceof CSSPrimitiveValueImpl)
-				i++;
-		}
-		return i;
-	}
-
-	/**
-	 * @return short
-	 */
-	public short getNodeType() {
-		return STYLEDECLITEM_NODE;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public java.lang.String getPriority() {
-		return getAttribute(IMPORTANT);
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public String getPropertyName() {
-		return fPropertyName.trim().toLowerCase();
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSPrimitiveValue
-	 * @param newValue
-	 *            org.w3c.dom.css.CSSPrimitiveValue
-	 * @param refValue
-	 *            org.w3c.dom.css.CSSPrimitiveValue
-	 */
-	ICSSPrimitiveValue insertValueBefore(ICSSPrimitiveValue newValue, ICSSPrimitiveValue refValue) {
-		ICSSNode node = insertBefore((CSSNodeImpl) newValue, (CSSNodeImpl) refValue);
-		return (ICSSPrimitiveValue) node;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSValue
-	 * @param index
-	 *            int
-	 */
-	public CSSValue item(int index) {
-		int i = 0;
-		for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
-			if (node instanceof CSSPrimitiveValueImpl) {
-				if (i++ == index)
-					return (CSSValue) node;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSPrimitiveValue
-	 * @param value
-	 *            org.w3c.dom.css.CSSPrimitiveValue
-	 */
-	public ICSSPrimitiveValue removeValue(ICSSPrimitiveValue value) throws DOMException {
-		ICSSNode node = removeChild((CSSNodeImpl) value);
-		return (ICSSPrimitiveValue) node;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSPrimitiveValue
-	 * @param newValue
-	 *            org.w3c.dom.css.CSSPrimitiveValue
-	 * @param oldValue
-	 *            org.w3c.dom.css.CSSPrimitiveValue
-	 */
-	public ICSSPrimitiveValue replaceValue(ICSSPrimitiveValue newValue, ICSSPrimitiveValue oldValue) throws DOMException {
-		if (oldValue == null)
-			return newValue;
-		if (newValue != null)
-			insertValueBefore(newValue, oldValue);
-		return removeValue(oldValue);
-	}
-
-	/**
-	 * @param value
-	 *            java.lang.String
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public void setCssValueText(String value) throws DOMException {
-		ICSSNode child = getFirstChild();
-		while (child != null) {
-			ICSSNode next = child.getNextSibling();
-			if (child instanceof ICSSPrimitiveValue) {
-				removeChild((CSSNodeImpl) child);
-			}
-			child = next;
-		}
-		setCssValueTextCore(value);
-	}
-	private void setCssValueTextCore(String value) throws DOMException {
-		// use temporary document
-		synchronized(CSSStyleDeclarationImpl.class) {
-			if (sharedStructuredDocument == null) {
-				IDocumentLoader loader = new CSSDocumentLoader();
-				sharedStructuredDocument = (IStructuredDocument) loader.createNewStructuredDocument();
-				((CSSSourceParser) sharedStructuredDocument.getParser()).setParserMode(CSSSourceParser.MODE_DECLARATION_VALUE);
-				
-			}
-			sharedStructuredDocument.set(value);
-			IStructuredDocumentRegion node = sharedStructuredDocument.getFirstStructuredDocumentRegion();
-			
-			if (node == null) {
-				return;
-			}
-			if (node.getNext() != null) {
-				throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
-			}
-			
-			CSSDeclarationItemParser itemParser = new CSSDeclarationItemParser(getOwnerDocument());
-			itemParser.setStructuredDocumentTemporary(true);
-			itemParser.setupValues(this, node, node.getRegions());
-		}
-	}
-	private static IStructuredDocument sharedStructuredDocument; 
-
-	/**
-	 * @param newPriority
-	 *            java.lang.String
-	 */
-	public void setPriority(java.lang.String newPriority) throws DOMException {
-		setAttribute(IMPORTANT, newPriority);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationFactoryContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationFactoryContext.java
deleted file mode 100644
index 3d6142f..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationFactoryContext.java
+++ /dev/null
@@ -1,69 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-
-public abstract class CSSStyleDeclarationFactoryContext {
-
-	protected ICSSDocument fOwnerDocument = null;
-
-	/**
-	 * 
-	 */
-	protected void cloneChildNodes(ICSSNode src, ICSSNode dest) {
-		if (fOwnerDocument == null) {
-			return;
-		}
-		if (!(dest instanceof CSSNodeImpl)) {
-			return;
-		}
-
-		CSSNodeImpl container = (CSSNodeImpl) dest;
-		container.removeChildNodes();
-
-		for (ICSSNode child = src.getFirstChild(); child != null; child = child.getNextSibling()) {
-			if (child instanceof CSSStyleDeclItemImpl) {
-				// extract shorthand property ..
-				// --> Temp
-				ICSSNode cloned = child.cloneNode(false);
-				if (cloned instanceof CSSNodeImpl) {
-					((CSSNodeImpl) cloned).setOwnerDocument(fOwnerDocument);
-					container.appendChild((CSSNodeImpl) cloned);
-					cloneChildNodes(child, cloned);
-				}
-				// <-- Temp
-			}
-			else {
-				ICSSNode cloned = child.cloneNode(false);
-				if (cloned instanceof CSSNodeImpl) {
-					((CSSNodeImpl) cloned).setOwnerDocument(fOwnerDocument);
-					container.appendChild((CSSNodeImpl) cloned);
-					cloneChildNodes(child, cloned);
-				}
-			}
-		}
-	}
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.interfaces.ICSSStyleDeclaration
-	 */
-	public ICSSStyleDeclaration createStyleDeclaration() {
-		CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(true);
-		decl.setOwnerDocument(decl);
-		return decl;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationImpl.java
deleted file mode 100644
index 8ca7f10..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationImpl.java
+++ /dev/null
@@ -1,272 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- * 
- */
-class CSSStyleDeclarationImpl extends CSSDocumentImpl implements ICSSStyleDeclaration {
-
-	private boolean fIsDocument;
-
-	CSSStyleDeclarationImpl(CSSStyleDeclarationImpl that) {
-		super(that);
-		this.fIsDocument = that.fIsDocument;
-		if (fIsDocument) {
-			setOwnerDocument(this);
-		}
-	}
-
-	CSSStyleDeclarationImpl(boolean isDocument) {
-		super();
-		fIsDocument = isDocument;
-		if (fIsDocument) {
-			setOwnerDocument(this);
-		}
-	}
-
-	public ICSSNode cloneNode(boolean deep) {
-		CSSStyleDeclarationImpl cloned = new CSSStyleDeclarationImpl(this);
-
-		if (deep)
-			cloneChildNodes(cloned, deep);
-
-		return cloned;
-	}
-
-	public ICSSStyleDeclItem getDeclItemNode(String propertyName) {
-		ICSSNode node = getLastChild();
-		propertyName = propertyName.trim();
-		while (node != null) {
-			if (node instanceof CSSStyleDeclItemImpl) {
-				ICSSStyleDeclItem item = (ICSSStyleDeclItem) node;
-				if (propertyName.compareToIgnoreCase(item.getPropertyName().trim()) == 0)
-					return item;
-			}
-			node = node.getPreviousSibling();
-		}
-		return null;
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getLength() {
-		int i = 0;
-		ICSSNode node = getFirstChild();
-		while (node != null) {
-			if (node instanceof CSSStyleDeclItemImpl)
-				i++;
-			node = node.getNextSibling();
-		}
-		return i;
-	}
-
-	/**
-	 * @return short
-	 */
-	public short getNodeType() {
-		return STYLEDECLARATION_NODE;
-	}
-
-	/**
-	 * The CSS rule that contains this declaration block or <code>null</code>
-	 * if this <code>CSSStyleDeclaration</code> is not attached to a
-	 * <code>CSSRule</code>.
-	 */
-	public CSSRule getParentRule() {
-		ICSSNode parent = getParentNode();
-		if (parent instanceof CSSRule)
-			return (CSSRule) parent;
-		return null;
-	}
-
-	/**
-	 * Used to retrieve the object representation of the value of a CSS
-	 * property if it has been explicitly set within this declaration block.
-	 * This method returns <code>null</code> if the property is a shorthand
-	 * property. Shorthand property values can only be accessed and modified
-	 * as strings, using the <code>getPropertyValue</code> and
-	 * <code>setProperty</code> methods.
-	 * 
-	 * @param propertyName
-	 *            The name of the CSS property. See the CSS property index.
-	 * @return Returns the value of the property if it has been explicitly set
-	 *         for this declaration block. Returns <code>null</code> if the
-	 *         property has not been set.
-	 */
-	public CSSValue getPropertyCSSValue(String propertyName) {
-		ICSSStyleDeclItem item = getDeclItemNode(propertyName);
-		if (item != null)
-			return item.getCSSValue();
-		return null;
-	}
-
-	/**
-	 * Used to retrieve the priority of a CSS property (e.g. the
-	 * <code>"important"</code> qualifier) if the property has been
-	 * explicitly set in this declaration block.
-	 * 
-	 * @param propertyName
-	 *            The name of the CSS property. See the CSS property index.
-	 * @return A string representing the priority (e.g.
-	 *         <code>"important"</code>) if one exists. The empty string if
-	 *         none exists.
-	 */
-	public String getPropertyPriority(String propertyName) {
-		ICSSStyleDeclItem item = getDeclItemNode(propertyName);
-		if (item != null)
-			return item.getPriority();
-		return null;
-	}
-
-	/**
-	 * Used to retrieve the value of a CSS property if it has been explicitly
-	 * set within this declaration block.
-	 * 
-	 * @param propertyName
-	 *            The name of the CSS property. See the CSS property index.
-	 * @return Returns the value of the property if it has been explicitly set
-	 *         for this declaration block. Returns the empty string if the
-	 *         property has not been set.
-	 */
-	public String getPropertyValue(String propertyName) {
-		CSSValue value = getPropertyCSSValue(propertyName);
-		if (value != null)
-			return ((ICSSValue) value).getCSSValueText();
-		return null;
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public boolean isDocument() {
-		return fIsDocument;
-	}
-
-	/**
-	 * Used to retrieve the properties that have been explicitly set in this
-	 * declaration block. The order of the properties retrieved using this
-	 * method does not have to be the order in which they were set. This
-	 * method can be used to iterate over all properties in this declaration
-	 * block.
-	 * 
-	 * @param index
-	 *            Index of the property name to retrieve.
-	 * @return The name of the property at this ordinal position. The empty
-	 *         string if no property exists at this position.
-	 */
-	public String item(int index) {
-		if (index < 0)
-			return null;
-
-		int i = 0;
-		ICSSNode node = getFirstChild();
-		while (node != null) {
-			if (node instanceof CSSStyleDeclItemImpl) {
-				if (i != index)
-					i++;
-				else {
-					CSSStyleDeclItemImpl item = (CSSStyleDeclItemImpl) node;
-					return item.getPropertyName();
-				}
-			}
-			node = node.getNextSibling();
-		}
-		return null;
-	}
-
-	public ICSSStyleDeclItem removeDeclItemNode(ICSSStyleDeclItem oldDecl) throws DOMException {
-		return (ICSSStyleDeclItem) removeChild((CSSNodeImpl) oldDecl);
-	}
-
-	/**
-	 * Used to remove a CSS property if it has been explicitly set within this
-	 * declaration block.
-	 * 
-	 * @param propertyName
-	 *            The name of the CSS property. See the CSS property index.
-	 * @return Returns the value of the property if it has been explicitly set
-	 *         for this declaration block. Returns the empty string if the
-	 *         property has not been set or the property name does not
-	 *         correspond to a known CSS property.
-	 * @exception DOMException
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration
-	 *                is readonly or the property is readonly.
-	 */
-	public String removeProperty(String propertyName) throws DOMException {
-		ICSSStyleDeclItem item = getDeclItemNode(propertyName);
-		if (item != null) {
-			removeChild((CSSNodeImpl) item);
-			return item.getCssText();
-		}
-		return null;
-	}
-
-	public ICSSStyleDeclItem setDeclItemNode(ICSSStyleDeclItem newDecl) throws DOMException {
-		if (newDecl == null)
-			return null;
-
-		ICSSStyleDeclItem item = getDeclItemNode(newDecl.getPropertyName());
-		if (item != null)
-			return (ICSSStyleDeclItem) replaceChild((CSSNodeImpl) newDecl, (CSSNodeImpl) item);
-		else
-			return (ICSSStyleDeclItem) appendChild((CSSNodeImpl) newDecl);
-	}
-
-	/**
-	 * Used to set a property value and priority within this declaration
-	 * block.
-	 * 
-	 * @param propertyName
-	 *            The name of the CSS property. See the CSS property index.
-	 * @param value
-	 *            The new value of the property.
-	 * @param priority
-	 *            The new priority of the property (e.g.
-	 *            <code>"important"</code>).
-	 * @exception DOMException
-	 *                SYNTAX_ERR: Raised if the specified value has a syntax
-	 *                error and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration
-	 *                is readonly or the property is readonly.
-	 */
-	public void setProperty(String propertyName, String value, String priority) throws DOMException {
-		if (propertyName.equals("")) //$NON-NLS-1$
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); //$NON-NLS-1$
-
-		// You can use this only if CSSValue.setCssText() is implemented
-		CSSStyleDeclItemImpl item = (CSSStyleDeclItemImpl) getDeclItemNode(propertyName);
-		if (item == null) {
-			item = (CSSStyleDeclItemImpl) getOwnerDocument().createCSSStyleDeclItem(propertyName);
-			appendChild(item);
-		}
-
-		// ICSSNode next = item.getNextSibling();
-		// removeChild(item);
-
-		item.setCssValueText(value);
-		item.setPriority(priority);
-
-		// insertBefore(item, (CSSNodeImpl)next);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleRuleImpl.java
deleted file mode 100644
index 16add17..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleRuleImpl.java
+++ /dev/null
@@ -1,98 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.w3c.dom.DOMException;
-
-
-/**
- * 
- */
-class CSSStyleRuleImpl extends CSSRuleDeclContainer implements ICSSStyleRule {
-
-	ICSSSelectorList fSelectorList = new CSSSelectorListImpl(null);
-
-	/**
-	 * 
-	 */
-	CSSStyleRuleImpl() {
-		super();
-	}
-
-	CSSStyleRuleImpl(CSSStyleRuleImpl that) {
-		super(that);
-	}
-
-	public ICSSNode cloneNode(boolean deep) {
-		CSSStyleRuleImpl cloned = new CSSStyleRuleImpl(this);
-
-		if (deep)
-			cloneChildNodes(cloned, deep);
-
-		return cloned;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	String extractPreString() {
-		return getSelectorText();
-	}
-
-	/**
-	 * @return short
-	 */
-	public short getNodeType() {
-		return STYLERULE_NODE;
-	}
-
-	public ICSSSelectorList getSelectors() {
-		return fSelectorList;
-	}
-
-	/**
-	 * The textual representation of the selector for the rule set. The
-	 * implementation may have stripped out insignificant whitespace while
-	 * parsing the selector.
-	 * 
-	 * @exception DOMException
-	 *                SYNTAX_ERR: Raised if the specified CSS string value has
-	 *                a syntax error and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is
-	 *                readonly.
-	 */
-	public String getSelectorText() {
-		return getAttribute(SELECTOR);
-	}
-
-	/**
-	 * The type of the rule, as defined above. The expectation is that
-	 * binding-specific casting methods can be used to cast down from an
-	 * instance of the <code>CSSRule</code> interface to the specific
-	 * derived interface implied by the <code>type</code>.
-	 */
-	public short getType() {
-		return STYLE_RULE;
-	}
-
-	/**
-	 * 
-	 */
-	public void setSelectorText(String selectorText) throws DOMException {
-		setAttribute(SELECTOR, selectorText);
-		fSelectorList = new CSSSelectorListImpl(selectorText);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java
deleted file mode 100644
index 50a2520..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java
+++ /dev/null
@@ -1,611 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.CSSCoreMessages;
-import org.eclipse.wst.css.core.internal.encoding.CSSDocumentLoader;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-import org.eclipse.wst.css.core.internal.util.ImportRuleCollector;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSUnknownRule;
-import org.w3c.dom.stylesheets.MediaList;
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- * 
- */
-class CSSStyleSheetImpl extends CSSDocumentImpl implements ICSSStyleSheet {
-
-
-	class InternalNodeList implements NodeList {
-
-		Vector nodes = new Vector();
-
-		public int getLength() {
-			if (nodes == null)
-				return 0;
-			else
-				return nodes.size();
-		}
-
-		public Node item(int i) {
-			if (nodes == null)
-				return null;
-			if (i < 0 || nodes.size() <= i)
-				return null;
-			return (Node) nodes.get(i);
-		}
-	}
-
-	class InternalStyleSheetList extends AbstractCSSNodeList implements StyleSheetList {
-
-		public ICSSNode appendNode(ICSSNode node) {
-			if (nodes == null || !nodes.contains(node))
-				return super.appendNode(node);
-			else
-				return node;
-		}
-
-		public StyleSheet item(int i) {
-			return (StyleSheet) itemImpl(i);
-		}
-	}
-
-	private boolean fDisabled = false;
-
-	/**
-	 * 
-	 */
-	CSSStyleSheetImpl() {
-		super();
-		setOwnerDocument(this);
-	}
-
-	CSSStyleSheetImpl(CSSStyleSheetImpl that) {
-		super(that);
-		setOwnerDocument(this);
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param rule
-	 *            org.w3c.dom.css.CSSRule
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public org.w3c.dom.css.CSSRule appendRule(org.w3c.dom.css.CSSRule rule) throws org.w3c.dom.DOMException {
-		if (rule == null)
-			return null;
-
-		CSSRule ret = (CSSRule) appendChild((CSSNodeImpl) rule);
-		return ret;
-	}
-
-	public ICSSNode cloneNode(boolean deep) {
-		CSSStyleSheetImpl cloned = new CSSStyleSheetImpl(this);
-
-		if (deep)
-			cloneChildNodes(cloned, deep);
-
-		return cloned;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSCharsetRule
-	 */
-	public ICSSCharsetRule createCSSCharsetRule() {
-		CSSCharsetRuleImpl rule = new CSSCharsetRuleImpl();
-		rule.setOwnerDocument(this);
-		return rule;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSFontFaceRule
-	 */
-	public CSSFontFaceRule createCSSFontFaceRule() {
-		CSSFontFaceRuleImpl rule = new CSSFontFaceRuleImpl();
-		CSSStyleDeclarationImpl style = (CSSStyleDeclarationImpl) createCSSStyleDeclaration();
-
-		rule.appendChild(style);
-		rule.setOwnerDocument(this);
-
-		return rule;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSImportRule
-	 */
-	public ICSSImportRule createCSSImportRule() {
-		CSSImportRuleImpl rule = new CSSImportRuleImpl();
-		MediaListImpl media = (MediaListImpl) createMediaList();
-
-		rule.appendChild(media);
-		rule.setOwnerDocument(this);
-
-		return rule;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.ICSSMediaRule
-	 */
-	public ICSSMediaRule createCSSMediaRule() {
-		CSSMediaRuleImpl rule = new CSSMediaRuleImpl();
-		MediaListImpl media = (MediaListImpl) createMediaList();
-
-		rule.insertBefore(media, (CSSNodeImpl) rule.getFirstChild()); // media
-																		// must
-																		// be
-																		// the
-																		// top
-																		// of
-																		// children
-																		// list
-		rule.setOwnerDocument(this);
-
-		return rule;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSPageRule
-	 */
-	public ICSSPageRule createCSSPageRule() {
-		CSSPageRuleImpl rule = new CSSPageRuleImpl();
-		CSSStyleDeclarationImpl style = (CSSStyleDeclarationImpl) createCSSStyleDeclaration();
-
-		rule.appendChild(style);
-		rule.setOwnerDocument(this);
-
-		return rule;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param rule
-	 *            java.lang.String
-	 */
-	public CSSRule createCSSRule(String rule) {
-		CSSDocumentLoader loader = new CSSDocumentLoader();
-		IStructuredDocument structuredDocument = (IStructuredDocument) loader.createNewStructuredDocument();
-		structuredDocument.set(rule);
-
-		CSSModelParser modelParser = new CSSModelParser((CSSDocumentImpl) getOwnerDocument());
-		return modelParser.createCSSRule(structuredDocument.getRegionList());
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSStyleDeclaration
-	 */
-	public ICSSStyleDeclaration createCSSStyleDeclaration() {
-		CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(false);
-		decl.setOwnerDocument(this);
-
-		return decl;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSStyleRule
-	 */
-	public ICSSStyleRule createCSSStyleRule() {
-		CSSStyleRuleImpl rule = new CSSStyleRuleImpl();
-		CSSStyleDeclarationImpl style = (CSSStyleDeclarationImpl) createCSSStyleDeclaration();
-
-		rule.appendChild(style);
-		rule.setOwnerDocument(this);
-
-		return rule;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSUnknownRule
-	 */
-	public CSSUnknownRule createCSSUnknownRule() {
-		CSSUnknownRuleImpl rule = new CSSUnknownRuleImpl();
-		rule.setOwnerDocument(this);
-
-		return rule;
-	}
-
-	/**
-	 * @return org.w3c.dom.stylesheets.MediaList
-	 */
-	public MediaList createMediaList() {
-		MediaListImpl media = new MediaListImpl();
-		media.setOwnerDocument(this);
-
-		return media;
-	}
-
-	/**
-	 * Used to delete a rule from the style sheet.
-	 * 
-	 * @param index
-	 *            The index within the style sheet's rule list of the rule to
-	 *            remove.
-	 * @exception DOMException
-	 *                INDEX_SIZE_ERR: Raised if the specified index does not
-	 *                correspond to a rule in the style sheet's rule list.
-	 *                <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet
-	 *                is readonly.
-	 */
-	public void deleteRule(int index) throws DOMException {
-		CSSNodeImpl node = getIndexedRule(index);
-		if (node != null)
-			removeChild(node);
-	}
-
-	/**
-	 * The list of all CSS rules contained within the style sheet. This
-	 * includes both rule sets and at-rules.
-	 */
-	public CSSRuleList getCssRules() {
-		CSSRuleListImpl list = new CSSRuleListImpl();
-
-		for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
-			if (node instanceof CSSRule) {
-				list.appendNode(node);
-			}
-		}
-
-		return list;
-	}
-
-	/**
-	 * <code>false</code> if the style sheet is applied to the document.
-	 * <code>true</code> if it is not. Modifying this attribute may cause a
-	 * new resolution of style for the document. A stylesheet only applies if
-	 * both an appropriate medium definition is present and the disabled
-	 * attribute is false. So, if the media doesn't apply to the current user
-	 * agent, the <code>disabled</code> attribute is ignored.
-	 */
-	public boolean getDisabled() {
-		return fDisabled;
-	}
-
-	/**
-	 * If the style sheet is a linked style sheet, the value of its attribute
-	 * is its location. For inline style sheets, the value of this attribute
-	 * is <code>null</code>. See the href attribute definition for the
-	 * <code>LINK</code> element in HTML 4.0, and the href pseudo-attribute
-	 * for the XML style sheet processing instruction.
-	 */
-	public String getHref() {
-		ICSSModel model = getModel();
-		if (model != null && model.getStyleSheetType() == ICSSModel.EXTERNAL) {
-			return model.getBaseLocation();
-			/*
-			 * Object id = model.getId(); if (id != null) { if (id instanceof
-			 * IResource) { // TODO: need to check whether this is correct or
-			 * not, later. return ((IResource)id).getFullPath().toString(); }
-			 * return id.toString(); }
-			 */}
-		return null;
-	}
-
-	CSSRuleImpl getIndexedRule(int index) {
-		if (index < 0)
-			return null;
-
-		int i = 0;
-		for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
-			if (node instanceof CSSRule) {
-				if (i++ == index)
-					return (CSSRuleImpl) node;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * The intended destination media for style information. The media is
-	 * often specified in the <code>ownerNode</code>. If no media has been
-	 * specified, the <code>MediaList</code> will be empty. See the media
-	 * attribute definition for the <code>LINK</code> element in HTML 4.0,
-	 * and the media pseudo-attribute for the XML style sheet processing
-	 * instruction . Modifying the media list may cause a change to the
-	 * attribute <code>disabled</code>.
-	 */
-	public MediaList getMedia() {
-		return null;
-	}
-
-	/**
-	 * @return short
-	 */
-	public short getNodeType() {
-		return STYLESHEET_NODE;
-	}
-
-	/**
-	 * The node that associates this style sheet with the document. For HTML,
-	 * this may be the corresponding <code>LINK</code> or <code>STYLE</code>
-	 * element. For XML, it may be the linking processing instruction. For
-	 * style sheets that are included by other style sheets, the value of this
-	 * attribute is <code>null</code>.
-	 */
-	public Node getOwnerNode() {
-		// for <LINK> tag or <STYLE> tag
-		ICSSModel model = getModel();
-		if (model != null)
-			return model.getOwnerDOMNode();
-		return null;
-	}
-
-	/**
-	 * @return org.w3c.dom.NodeList
-	 */
-	public org.w3c.dom.NodeList getOwnerNodes() {
-		List list = (getModel().getStyleListeners() != null) ? new Vector(getModel().getStyleListeners()) : null;
-		if (list == null)
-			return null;
-		InternalNodeList nodes = new InternalNodeList();
-		Iterator it = list.iterator();
-		while (it.hasNext()) {
-			Object obj = it.next();
-			if (obj instanceof IStyleSheetAdapter) {
-				nodes.nodes.add(((IStyleSheetAdapter) obj).getElement());
-			}
-		}
-		if (nodes.getLength() > 0)
-			return nodes;
-		else
-			return null;
-	}
-
-	/**
-	 * @return org.w3c.dom.NodeList
-	 * @param doc
-	 *            org.w3c.dom.Document
-	 */
-	public NodeList getOwnerNodes(Document doc) {
-		List list = (getModel().getStyleListeners() != null) ? new Vector(getModel().getStyleListeners()) : null;
-		if (list == null)
-			return null;
-		InternalNodeList nodes = new InternalNodeList();
-		Iterator it = list.iterator();
-		while (it.hasNext()) {
-			Object obj = it.next();
-			if (obj instanceof IStyleSheetAdapter) {
-				Element ele = ((IStyleSheetAdapter) obj).getElement();
-				if (ele.getOwnerDocument() == doc)
-					nodes.nodes.add(ele);
-			}
-		}
-		if (nodes.getLength() > 0)
-			return nodes;
-		else
-			return null;
-	}
-
-	/**
-	 * If this style sheet comes from an <code>@import</code> rule, the <code>ownerRule</code> attribute will
-	 *         contain the <code>CSSImportRule</code>. In that case, the
-	 *         <code>ownerNode</code> attribute in the
-	 *         <code>StyleSheet</code> interface will be <code>null</code>.
-	 *         If the style sheet comes from an element or a processing
-	 *         instruction, the <code>ownerRule</code> attribute will be
-	 *         <code>null</code> and the <code>ownerNode</code> attribute
-	 *         will contain the <code>Node</code>.
-	 */
-	public CSSRule getOwnerRule() {
-		Assert.isTrue(false, CSSCoreMessages.You_cannot_use_CSSStyleShe_UI_); //$NON-NLS-1$ = "You cannot use CSSStyleSheet.getOwnerRule() because of many referencers of this rule\nPlease use getOnwerRules()"
-		// for @import
-		return null;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSRuleList
-	 */
-	public org.w3c.dom.css.CSSRuleList getOwnerRules() {
-		StyleSheetList list = getParentStyleSheets();
-		if (list == null)
-			return null;
-		CSSRuleListImpl ruleList = new CSSRuleListImpl();
-		for (int i = 0; i < list.getLength(); i++) {
-			ImportRuleCollector trav = new ImportRuleCollector(this);
-			trav.apply((ICSSStyleSheet) list.item(i));
-			ruleList.nodes.addAll(trav.getRules());
-		}
-		return ruleList;
-	}
-
-	/**
-	 * For style sheet languages that support the concept of style sheet
-	 * inclusion, this attribute represents the including style sheet, if one
-	 * exists. If the style sheet is a top-level style sheet, or the style
-	 * sheet language does not support inclusion, the value of this attribute
-	 * is <code>null</code>.
-	 */
-	public StyleSheet getParentStyleSheet() {
-		CSSRule owner = getOwnerRule();
-		if (owner != null)
-			return owner.getParentStyleSheet();
-		return null;
-	}
-
-	/**
-	 * @return org.w3c.dom.stylesheets.StyleSheetList
-	 */
-	public org.w3c.dom.stylesheets.StyleSheetList getParentStyleSheets() {
-		List list = (getModel().getStyleListeners() != null) ? new Vector(getModel().getStyleListeners()) : null;
-		if (list == null)
-			return null;
-		InternalStyleSheetList sheets = new InternalStyleSheetList();
-		Iterator it = list.iterator();
-		while (it.hasNext()) {
-			Object obj = it.next();
-			if (obj instanceof ICSSModel) {
-				sheets.appendNode(((ICSSModel) obj).getDocument());
-			}
-		}
-		if (sheets.getLength() > 0)
-			return sheets;
-		else
-			return null;
-	}
-
-	/**
-	 * The advisory title. The title is often specified in the
-	 * <code>ownerNode</code>. See the title attribute definition for the
-	 * <code>LINK</code> element in HTML 4.0, and the title pseudo-attribute
-	 * for the XML style sheet processing instruction.
-	 */
-	public String getTitle() {
-		Node node = getOwnerNode();
-		if (node instanceof Element) {
-			return ((Element) node).getAttribute("TITLE");//$NON-NLS-1$
-		}
-		return null;
-	}
-
-	/**
-	 * This specifies the style sheet language for this style sheet. The style
-	 * sheet language is specified as a content type (e.g. "text/css"). The
-	 * content type is often specified in the <code>ownerNode</code>. Also
-	 * see the type attribute definition for the <code>LINK</code> element
-	 * in HTML 4.0, and the type pseudo-attribute for the XML style sheet
-	 * processing instruction.
-	 */
-	public String getType() {
-		Node node = getOwnerNode();
-		if (node instanceof Element) {
-			return ((Element) node).getAttribute("TYPE");//$NON-NLS-1$
-		}
-		return null;
-	}
-
-	/**
-	 * Used to insert a new rule into the style sheet. The new rule now
-	 * becomes part of the cascade.
-	 * 
-	 * @param rule
-	 *            The parsable text representing the rule. For rule sets this
-	 *            contains both the selector and the style declaration. For
-	 *            at-rules, this specifies both the at-identifier and the rule
-	 *            content.
-	 * @param index
-	 *            The index within the style sheet's rule list of the rule
-	 *            before which to insert the specified rule. If the specified
-	 *            index is equal to the length of the style sheet's rule
-	 *            collection, the rule will be added to the end of the style
-	 *            sheet.
-	 * @return The index within the style sheet's rule collection of the newly
-	 *         inserted rule.
-	 * @exception DOMException
-	 *                HIERARCHY_REQUEST_ERR: Raised if the rule cannot be
-	 *                inserted at the specified index e.g. if an
-	 *                <code>@import</code> rule is inserted after a standard rule set or other
-	 *         at-rule. <br>
-	 *         INDEX_SIZE_ERR: Raised if the specified index is not a valid
-	 *         insertion point. <br>
-	 *         NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is
-	 *         readonly. <br>
-	 *         SYNTAX_ERR: Raised if the specified rule has a syntax error and
-	 *         is unparsable.
-	 */
-	public int insertRule(String rule, int index) throws DOMException {
-		int length = getCssRules().getLength();
-		if (index < 0 || length < index)
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, "");//$NON-NLS-1$
-
-		IStructuredDocument doc = getModel().getStructuredDocument();
-		CSSRuleImpl refRule = (length != index) ? getIndexedRule(index) : null;
-		int offset = (refRule != null) ? refRule.getStartOffset() : doc.getLength();
-		doc.replaceText(this, offset, 0, rule);
-
-		// insertBefore((CSSNodeImpl) createCSSRule(rule),refRule);
-		return index;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param newRule
-	 *            org.w3c.dom.css.CSSRule
-	 * @param refRule
-	 *            org.w3c.dom.css.CSSRule
-	 */
-	public org.w3c.dom.css.CSSRule insertRuleBefore(org.w3c.dom.css.CSSRule newRule, org.w3c.dom.css.CSSRule refRule) throws org.w3c.dom.DOMException {
-		if (newRule == null && refRule == null)
-			return null;
-
-		CSSRule ret = (CSSRule) insertBefore((CSSNodeImpl) newRule, (CSSNodeImpl) refRule);
-		return ret;
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public boolean isDocument() {
-		return true;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param rule
-	 *            org.w3c.dom.css.CSSRule
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public org.w3c.dom.css.CSSRule removeRule(org.w3c.dom.css.CSSRule rule) throws org.w3c.dom.DOMException {
-		if (rule == null)
-			return null;
-
-		CSSRule ret = (CSSRule) removeChild((CSSNodeImpl) rule);
-		return ret;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param newChild
-	 *            org.w3c.dom.css.CSSRule
-	 * @param oldChild
-	 *            org.w3c.dom.css.CSSRule
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public org.w3c.dom.css.CSSRule replaceRule(org.w3c.dom.css.CSSRule newRule, org.w3c.dom.css.CSSRule oldRule) throws org.w3c.dom.DOMException {
-		if (newRule == null && oldRule == null)
-			return null;
-
-		CSSRule ret = (CSSRule) replaceChild((CSSNodeImpl) newRule, (CSSNodeImpl) oldRule);
-		return ret;
-	}
-
-	/**
-	 * setDisabled method comment.
-	 */
-	public void setDisabled(boolean disabled) {
-		this.fDisabled = disabled;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSUnknownRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSUnknownRuleImpl.java
deleted file mode 100644
index b68da6b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSUnknownRuleImpl.java
+++ /dev/null
@@ -1,70 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.css.CSSUnknownRule;
-
-
-/**
- * 
- */
-class CSSUnknownRuleImpl extends CSSRuleImpl implements CSSUnknownRule {
-
-	// TODO: This field is never read
-	String fCssText = null;
-
-	/**
-	 * 
-	 */
-	CSSUnknownRuleImpl() {
-		super();
-	}
-
-	CSSUnknownRuleImpl(CSSUnknownRuleImpl that) {
-		super(that);
-	}
-
-	public ICSSNode cloneNode(boolean deep) {
-		CSSUnknownRuleImpl cloned = new CSSUnknownRuleImpl(this);
-
-		return cloned;
-	}
-
-	/**
-	 * @return short
-	 */
-	public short getNodeType() {
-		return UNKNOWNRULE_NODE;
-	}
-
-	/**
-	 * The type of the rule, as defined above. The expectation is that
-	 * binding-specific casting methods can be used to cast down from an
-	 * instance of the <code>CSSRule</code> interface to the specific
-	 * derived interface implied by the <code>type</code>.
-	 */
-	public short getType() {
-		return UNKNOWN_RULE;
-	}
-
-	/**
-	 * @param cssText
-	 *            java.lang.String
-	 */
-	public void setCssText(String cssText) {
-		this.fCssText = cssText;
-
-		super.setCssText(cssText);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CounterImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CounterImpl.java
deleted file mode 100644
index 106ae66..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CounterImpl.java
+++ /dev/null
@@ -1,124 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICounter;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.Counter;
-
-
-/**
- * 
- */
-class CounterImpl extends CSSPrimitiveContainer implements ICounter {
-
-	/**
-	 * 
-	 */
-	CounterImpl() {
-		super(CSS_COUNTER);
-	}
-
-	CounterImpl(CounterImpl that) {
-		super(that);
-	}
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param deep
-	 *            boolean
-	 */
-	public ICSSNode cloneNode(boolean deep) {
-		CounterImpl cloned = new CounterImpl(this);
-
-		if (deep)
-			cloneChildNodes(cloned, deep);
-
-		return cloned;
-	}
-
-	/**
-	 * This method is used to get the Counter value. If this CSS value doesn't
-	 * contain a counter value, a <code>DOMException</code> is raised.
-	 * Modification to the corresponding style property can be achieved using
-	 * the <code>Counter</code> interface.
-	 * 
-	 * @return The Counter value.
-	 * @exception DOMException
-	 *                INVALID_ACCESS_ERR: Raised if the CSS value doesn't
-	 *                contain a Counter value (e.g. this is not
-	 *                <code>CSS_COUNTER</code>).
-	 */
-	public Counter getCounterValue() throws DOMException {
-		return this;
-	}
-
-	/**
-	 * This attribute is used for the identifier of the counter.
-	 */
-	public String getIdentifier() {
-		return getAttribute(IDENTIFIER);
-	}
-
-	/**
-	 * This attribute is used for the style of the list.
-	 */
-	public String getListStyle() {
-		return getAttribute(LISTSTYLE);
-	}
-
-	/**
-	 * This attribute is used for the separator of the nested counters.
-	 */
-	public String getSeparator() {
-		return getAttribute(SEPARATOR);
-	}
-
-	/**
-	 * 
-	 */
-	protected void initPrimitives() {
-		return;
-	}
-
-	/**
-	 * @param identifier
-	 *            java.lang.String
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public void setIdentifier(String identifier) throws DOMException {
-		setAttribute(IDENTIFIER, identifier);
-	}
-
-	/**
-	 * @param listStyle
-	 *            java.lang.String
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public void setListStyle(String listStyle) throws DOMException {
-		setAttribute(LISTSTYLE, listStyle);
-	}
-
-	/**
-	 * @param Separator
-	 *            java.lang.String
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public void setSeparator(String Separator) throws org.w3c.dom.DOMException {
-		setAttribute(SEPARATOR, Separator);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/DOMCSSImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/DOMCSSImpl.java
deleted file mode 100644
index d428a5a..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/DOMCSSImpl.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleSheet;
-
-
-/**
- * 
- */
-public class DOMCSSImpl {
-
-	/**
-	 * DOMCSSImpl constructor comment.
-	 */
-	public DOMCSSImpl() {
-		super();
-	}
-
-	public static ICSSStyleDeclaration createCSSStyleDeclaration() throws org.w3c.dom.DOMException {
-		CSSStyleDeclarationImpl document = new CSSStyleDeclarationImpl(true);
-
-		return document;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.CSSStyleSheet
-	 * @param title
-	 *            java.lang.String
-	 * @param media
-	 *            java.lang.String
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public static CSSStyleSheet createCSSStyleSheet(String title, String media) throws org.w3c.dom.DOMException {
-		return new CSSStyleSheetImpl();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/MediaListImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/MediaListImpl.java
deleted file mode 100644
index d5ffb6b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/MediaListImpl.java
+++ /dev/null
@@ -1,155 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- * 
- */
-class MediaListImpl extends CSSRegionContainer implements MediaList {
-
-	int mediumCounter;
-
-	/**
-	 * MediaListImpl constructor comment.
-	 */
-	MediaListImpl() {
-		super();
-	}
-
-	/**
-	 * MediaListImpl constructor comment.
-	 */
-	MediaListImpl(MediaListImpl that) {
-		super(that);
-	}
-
-	/**
-	 * Adds the medium <code>newMedium</code> to the end of the list. If the
-	 * <code>newMedium</code> is already used, it is first removed.
-	 * 
-	 * @param newMediumThe
-	 *            new medium to add.
-	 * @exception DOMException
-	 *                INVALID_CHARACTER_ERR: If the medium contains characters
-	 *                that are invalid in the underlying style language. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this list is
-	 *                readonly.
-	 */
-	public void appendMedium(String newMedium) throws DOMException {
-		if (newMedium == null)
-			return;
-
-		CSSNodeListImpl m = getMedia();
-		for (int i = 0; i != m.getLength(); i++) {
-			if (newMedium.equals(item(i)))
-				return;
-		}
-
-		setAttribute("medium" + Integer.toString(mediumCounter++), newMedium);//$NON-NLS-1$
-	}
-
-	public ICSSNode cloneNode(boolean deep) {
-		MediaListImpl cloned = new MediaListImpl(this);
-		return cloned;
-	}
-
-	/**
-	 * Deletes the medium indicated by <code>oldMedium</code> from the list.
-	 * 
-	 * @param oldMediumThe
-	 *            medium to delete in the media list.
-	 * @exception DOMException
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this list is
-	 *                readonly. <br>
-	 *                NOT_FOUND_ERR: Raised if <code>oldMedium</code> is not
-	 *                in the list.
-	 */
-	public void deleteMedium(String oldMedium) throws DOMException {
-		for (int i = 0; i != getLength(); i++) {
-			if (oldMedium.equals(item(i))) {
-				removeAttributeNode((CSSAttrImpl) fAttrs.item(i));
-			}
-		}
-	}
-
-	/**
-	 * The number of media in the list. The range of valid media is
-	 * <code>0</code> to <code>length-1</code> inclusive.
-	 */
-	public int getLength() {
-		return getMedia().getLength();
-	}
-
-	/**
-	 * @return CSSNodeListImpl
-	 */
-	CSSNodeListImpl getMedia() {
-		if (fAttrs == null)
-			fAttrs = new CSSNamedNodeMapImpl();
-		return fAttrs;
-	}
-
-	/**
-	 * The parsable textual representation of the media list. This is a
-	 * comma-separated list of media.
-	 * 
-	 * @exception DOMException
-	 *                SYNTAX_ERR: Raised if the specified string value has a
-	 *                syntax error and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this media list
-	 *                is readonly.
-	 */
-	public String getMediaText() {
-		return getCssText();
-	}
-
-	/**
-	 * Insert the method's description here. Creation date: (2001/01/17
-	 * 18:50:29)
-	 * 
-	 * @return short
-	 */
-	public short getNodeType() {
-		return MEDIALIST_NODE;
-	}
-
-	/**
-	 * Returns the <code>index</code> th in the list. If <code>index</code>
-	 * is greater than or equal to the number of media in the list, this
-	 * returns <code>null</code>.
-	 * 
-	 * @param index
-	 *            Index into the collection.
-	 * @return The medium at the <code>index</code> th position in the
-	 *         <code>MediaList</code>, or <code>null</code> if that is
-	 *         not a valid index.
-	 */
-	public String item(int index) {
-		if (index < 0 || getLength() <= index)
-			return null;
-
-		return ((CSSAttrImpl) getMedia().item(index)).getValue();
-	}
-
-	/**
-	 * setMediaText method comment.
-	 */
-	public void setMediaText(String mediaText) throws DOMException {
-		setCssText(mediaText);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RGBColorImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RGBColorImpl.java
deleted file mode 100644
index 87d4b84..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RGBColorImpl.java
+++ /dev/null
@@ -1,104 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.RGBColor;
-
-
-/**
- * 
- */
-class RGBColorImpl extends CSSPrimitiveContainer implements RGBColor {
-
-	private CSSPrimitiveValueImpl fRed;
-	private CSSPrimitiveValueImpl fGreen;
-	private CSSPrimitiveValueImpl fBlue;
-
-	/**
-	 * 
-	 */
-	RGBColorImpl() {
-		super(CSS_RGBCOLOR);
-	}
-
-	RGBColorImpl(RGBColorImpl that) {
-		super(that);
-
-		fRed = new CSSPrimitiveValueImpl(that.fRed);
-		appendChild(fRed);
-
-		fGreen = new CSSPrimitiveValueImpl(that.fGreen);
-		appendChild(fGreen);
-
-		fBlue = new CSSPrimitiveValueImpl(that.fBlue);
-		appendChild(fBlue);
-	}
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param deep
-	 *            boolean
-	 */
-	public ICSSNode cloneNode(boolean deep) {
-		RGBColorImpl cloned = new RGBColorImpl(this);
-
-		return cloned;
-	}
-
-	/**
-	 * This attribute is used for the blue value of the RGB color.
-	 */
-	public CSSPrimitiveValue getBlue() {
-		return fBlue;
-	}
-
-	/**
-	 * This attribute is used for the green value of the RGB color.
-	 */
-	public CSSPrimitiveValue getGreen() {
-		return fGreen;
-	}
-
-	/**
-	 * This attribute is used for the red value of the RGB color.
-	 */
-	public CSSPrimitiveValue getRed() {
-		return fRed;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.RGBColor
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public RGBColor getRGBColorValue() throws org.w3c.dom.DOMException {
-		return this;
-	}
-
-	/**
-	 * 
-	 */
-	protected void initPrimitives() {
-
-		fRed = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
-		appendChild(fRed);
-
-		fGreen = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
-		appendChild(fGreen);
-
-		fBlue = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
-		appendChild(fBlue);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RectImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RectImpl.java
deleted file mode 100644
index afcc2d9..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RectImpl.java
+++ /dev/null
@@ -1,118 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.Rect;
-
-
-/**
- * 
- */
-class RectImpl extends CSSPrimitiveContainer implements Rect {
-
-	private CSSPrimitiveValueImpl fTop;
-	private CSSPrimitiveValueImpl fRight;
-	private CSSPrimitiveValueImpl fBottom;
-	private CSSPrimitiveValueImpl fLeft;
-
-	/**
-	 * 
-	 */
-	RectImpl() {
-		super(CSS_RECT);
-	}
-
-	RectImpl(RectImpl that) {
-		super(that);
-
-		fTop = new CSSPrimitiveValueImpl(that.fTop);
-		appendChild(fTop);
-
-		fRight = new CSSPrimitiveValueImpl(that.fRight);
-		appendChild(fRight);
-
-		fBottom = new CSSPrimitiveValueImpl(that.fBottom);
-		appendChild(fBottom);
-
-		fLeft = new CSSPrimitiveValueImpl(that.fLeft);
-		appendChild(fLeft);
-	}
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param deep
-	 *            boolean
-	 */
-	public ICSSNode cloneNode(boolean deep) {
-		RectImpl cloned = new RectImpl(this);
-
-		return cloned;
-	}
-
-	/**
-	 * This attribute is used for the bottom of the rect.
-	 */
-	public CSSPrimitiveValue getBottom() {
-		return fBottom;
-	}
-
-	/**
-	 * This attribute is used for the left of the rect.
-	 */
-	public CSSPrimitiveValue getLeft() {
-		return fLeft;
-	}
-
-	/**
-	 * @return org.w3c.dom.css.Rect
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	public Rect getRectValue() throws org.w3c.dom.DOMException {
-		return this;
-	}
-
-	/**
-	 * This attribute is used for the right of the rect.
-	 */
-	public CSSPrimitiveValue getRight() {
-		return fRight;
-	}
-
-	/**
-	 * This attribute is used for the top of the rect.
-	 */
-	public CSSPrimitiveValue getTop() {
-		return fTop;
-	}
-
-	/**
-	 * 
-	 */
-	protected void initPrimitives() {
-
-		fTop = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
-		appendChild(fTop);
-
-		fRight = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
-		appendChild(fRight);
-
-		fBottom = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
-		appendChild(fBottom);
-
-		fLeft = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
-		appendChild(fLeft);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/StyleSheetListImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/StyleSheetListImpl.java
deleted file mode 100644
index fea1bfc..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/StyleSheetListImpl.java
+++ /dev/null
@@ -1,44 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- * 
- */
-class StyleSheetListImpl extends AbstractCSSNodeList implements StyleSheetList {
-
-	/**
-	 * StyleSheetListImpl constructor comment.
-	 */
-	StyleSheetListImpl() {
-		super();
-	}
-
-	/**
-	 * Used to retrieve a style sheet by ordinal index. If index is greater
-	 * than or equal to the number of style sheets in the list, this returns
-	 * <code>null</code>.
-	 * 
-	 * @param indexIndex
-	 *            into the collection
-	 * @return The style sheet at the <code>index</code> position in the
-	 *         <code>StyleSheetList</code>, or <code>null</code> if that
-	 *         is not a valid index.
-	 */
-	public StyleSheet item(int index) {
-		return (StyleSheet) itemImpl(index);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentCharsetDetector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentCharsetDetector.java
deleted file mode 100644
index 62034c5..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentCharsetDetector.java
+++ /dev/null
@@ -1,126 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.encoding;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.css.core.internal.contenttype.CSSResourceEncodingDetector;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-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.sse.core.internal.util.StringUtils;
-
-
-public class CSSDocumentCharsetDetector extends CSSResourceEncodingDetector implements IDocumentCharsetDetector {
-
-	public String getEncodingName(IStructuredDocument structuredDocument) {
-		String result = null;
-		// if the document is empty, then there will be no nodes,
-		// so no need to continue.
-		IStructuredDocumentRegionList nodes = structuredDocument.getRegionList();
-		if (nodes.getLength() > 0) {
-			IStructuredDocumentRegion node = null;
-			// skip any initial whitespace
-			// Note that @charset "encodingname";
-			// must appear at very beginning of document,
-			// to be valid.
-			// May have to test with "damaged" files (e.g.
-			// beginning EOLs, etc., to verify this works
-			// as expected.
-			for (int i = 0; i < nodes.getLength(); i++) {
-				node = nodes.item(i);
-				if (getType(node) != CSSRegionContexts.CSS_S) {
-					break;
-				}
-			}
-			Iterator regions = node.getRegions().iterator();
-			ITextRegion region = getNextRegionOfType(CSSRegionContexts.CSS_CHARSET, regions);
-			if (region != null) {
-				ITextRegion valueRegion = getNextRegionOfType(CSSRegionContexts.CSS_STRING, regions);
-				if (valueRegion == null) {
-					// if didn't find the region, its probably due to ill
-					// formed input, such as
-					// @charset "ISO-8859-6;
-					// so we'll try again for "unknown" region.
-					// If that fails, we'll give up?
-					regions = node.getRegions().iterator();
-					region = getNextRegionOfType(CSSRegionContexts.CSS_CHARSET, regions);
-					if (region != null) {
-						valueRegion = getNextRegionOfType(CSSRegionContexts.CSS_UNKNOWN, regions);
-						if (valueRegion != null) {
-							result = node.getText(valueRegion);
-						}
-					}
-				}
-				else {
-					result = node.getText(valueRegion);
-				}
-				result = StringUtils.stripNonLetterDigits(result);
-			}
-		}
-		return result;
-	}
-
-	public String getEncodingName(IDocument document) {
-		String enc = null;
-		if (document instanceof IStructuredDocument) {
-			enc = getEncodingName((IStructuredDocument) document);
-		}
-		else {
-			// TODO Important: need to implement some "raw" parser for
-			// IDocument level
-		}
-		return enc;
-	}
-
-	private String getType(IStructuredDocumentRegion node) {
-		if (node == null)
-			return null;
-		ITextRegionList regions = node.getRegions();
-		if (regions == null || regions.size() == 0)
-			return null;
-		ITextRegion region = regions.get(0);
-		String result = region.getType();
-		return result;
-	}
-
-	private ITextRegion getNextRegionOfType(String type, Iterator regions) {
-		if (type == null)
-			return null;
-		if (regions == null)
-			return null;
-		ITextRegion result = null;
-		while (regions.hasNext()) {
-			ITextRegion region = (ITextRegion) regions.next();
-			if (region.getType() == type) {
-				result = region;
-				break;
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * 
-	 */
-
-	public void set(IDocument document) {
-		set(new DocumentReader(document, 0));
-
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentLoader.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentLoader.java
deleted file mode 100644
index 20c49e1..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentLoader.java
+++ /dev/null
@@ -1,87 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.encoding;
-
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.css.core.internal.contenttype.EncodingGuesser;
-import org.eclipse.wst.css.core.internal.parser.CSSSourceParser;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.core.internal.text.CSSStructuredDocumentReParser;
-import org.eclipse.wst.css.core.internal.text.StructuredTextPartitionerForCSS;
-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;
-
-
-public class CSSDocumentLoader extends AbstractDocumentLoader {
-	private final static String CSS_ID = ContentTypeIdForCSS.ContentTypeID_CSS;
-	private IDocumentCharsetDetector documentEncodingDetector;
-
-
-	public CSSDocumentLoader() {
-		super();
-	}
-
-	protected String getEncodingNameByGuess(byte[] string, int length) {
-		String ianaEnc = null;
-		ianaEnc = EncodingGuesser.guessEncoding(string, length);
-		return ianaEnc;
-	}
-
-	/**
-	 * Default encoding. For CSS there is no spec'd default.
-	 */
-	protected String getSpecDefaultEncoding() {
-		return null;
-	}
-
-	protected IEncodedDocument newEncodedDocument() {
-		// DMW: I copied this from CSSModelImple ...
-		// but am not sure its right
-		IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
-		CSSStructuredDocumentReParser reParser = new CSSStructuredDocumentReParser();
-		reParser.setStructuredDocument(structuredDocument);
-		((BasicStructuredDocument) structuredDocument).setReParser(reParser);
-		return structuredDocument;
-	}
-
-	public RegionParser getParser() {
-		// return new CSSRegionParser();
-		return new CSSSourceParser();
-	}
-
-	protected String getPreferredNewLineDelimiter() {
-		return ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(CSS_ID);
-	}
-
-	public IDocumentCharsetDetector getDocumentEncodingDetector() {
-		if (documentEncodingDetector == null) {
-			documentEncodingDetector = new CSSDocumentCharsetDetector();
-		}
-		return documentEncodingDetector;
-	}
-
-	public IDocumentPartitioner getDefaultDocumentPartitioner() {
-		return new StructuredTextPartitionerForCSS();
-	}
-
-	public IDocumentLoader newInstance() {
-		return new CSSDocumentLoader();
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleListener.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleListener.java
deleted file mode 100644
index d44e94b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleListener.java
+++ /dev/null
@@ -1,32 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.event;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-
-
-
-/**
- * 
- */
-public interface ICSSStyleListener {
-
-	/**
-	 * 
-	 */
-	void styleChanged(ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media);
-
-	/**
-	 * 
-	 */
-	void styleUpdate(ICSSModel srcModel);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleNotifier.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleNotifier.java
deleted file mode 100644
index 98655af..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleNotifier.java
+++ /dev/null
@@ -1,40 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.event;
-
-
-
-import java.util.List;
-
-/**
- * 
- */
-public interface ICSSStyleNotifier extends ICSSStyleListener {
-
-	/**
-	 * 
-	 */
-	void addStyleListener(ICSSStyleListener listener);
-
-	/**
-	 * 
-	 */
-	List getStyleListeners();
-
-	/**
-	 */
-	boolean isRecording();
-
-	/**
-	 * 
-	 */
-	void removeStyleListener(ICSSStyleListener listener);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSEmbededStyleNotifyAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSEmbededStyleNotifyAdapter.java
deleted file mode 100644
index 7bbc27b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSEmbededStyleNotifyAdapter.java
+++ /dev/null
@@ -1,60 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.eventimpl;
-
-
-
-import org.eclipse.wst.css.core.internal.event.ICSSStyleListener;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-
-public class CSSEmbededStyleNotifyAdapter extends CSSStyleNotifyAdapter {
-
-	/**
-	 * CSSEmbeddedStyleNotifyAdapter constructor comment.
-	 * 
-	 * @param model
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSModel
-	 */
-	public CSSEmbededStyleNotifyAdapter(ICSSModel model) {
-		super(model);
-	}
-
-	/**
-	 * 
-	 */
-	public void styleChanged(ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media) {
-		IDOMNode node = (IDOMNode) model.getOwnerDOMNode();
-		if (node != null)
-			return;
-		INodeAdapter adapter = node.getAdapterFor(IStyleSheetAdapter.class);
-		if (adapter instanceof ICSSStyleListener) {
-			((ICSSStyleListener) adapter).styleChanged(srcModel, removed, added, media);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public void styleUpdate(ICSSModel srcModel) {
-		IDOMNode node = (IDOMNode) model.getOwnerDOMNode();
-		if (node != null)
-			return;
-		INodeAdapter adapter = node.getAdapterFor(IStyleSheetAdapter.class);
-		if (adapter instanceof ICSSStyleListener) {
-			((ICSSStyleListener) adapter).styleUpdate(srcModel);
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleEventDeliverer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleEventDeliverer.java
deleted file mode 100644
index 432b9db..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleEventDeliverer.java
+++ /dev/null
@@ -1,155 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.eventimpl;
-
-
-
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.event.ICSSStyleListener;
-import org.eclipse.wst.css.core.internal.event.ICSSStyleNotifier;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-
-
-/**
- * 
- */
-public class CSSStyleEventDeliverer {
-
-	private Vector fVisited = new Vector();
-	private ICSSModel fSrcModel;
-	private ICSSSelector[] fRemoved;
-	private ICSSSelector[] fAdded;
-	private String fMedia;
-
-	/**
-	 * 
-	 */
-	public CSSStyleEventDeliverer() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public void fire(ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media) {
-		if (srcModel == null || srcModel.getStyleListeners() == null)
-			return;
-
-		this.fSrcModel = srcModel;
-		this.fRemoved = removed;
-		this.fAdded = added;
-		this.fMedia = media;
-
-		// prohibit delivering to srcModel
-		fVisited.clear();
-		fVisited.add(srcModel);
-		Object[] listeners = srcModel.getStyleListeners().toArray();
-		for (int i = 0; i < listeners.length; i++) {
-			visit((ICSSStyleListener) listeners[i]);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public void fireTo(ICSSStyleListener listener, ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media) {
-		this.fSrcModel = srcModel;
-		this.fRemoved = removed;
-		this.fAdded = added;
-		this.fMedia = media;
-
-		// prohibit delivering to srcModel
-		fVisited.clear();
-		// visited.add(srcModel); : because looping problem
-		visit(listener);
-	}
-
-	/**
-	 * 
-	 */
-	public void fireUpdate(ICSSModel srcModel) {
-		if (srcModel == null || srcModel.getStyleListeners() == null)
-			return;
-
-		this.fSrcModel = srcModel;
-
-		// prohibit delivering to srcModel
-		fVisited.clear();
-		fVisited.add(srcModel);
-		Object[] listeners = srcModel.getStyleListeners().toArray();
-		for (int i = 0; i < listeners.length; i++) {
-			visitUpdate((ICSSStyleListener) listeners[i]);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public void fireUpdateTo(ICSSStyleListener listener, ICSSModel srcModel) {
-		if (srcModel == null || srcModel.getStyleListeners() == null)
-			return;
-
-		this.fSrcModel = srcModel;
-
-		// prohibit delivering to srcModel
-		fVisited.clear();
-		// visited.add(srcModel);
-		visitUpdate(listener);
-	}
-
-	/**
-	 * 
-	 */
-	protected void visit(ICSSStyleListener listener) {
-		if (listener == null || fVisited.contains(listener))
-			return;
-
-		// fire event to listener
-		listener.styleChanged(fSrcModel, fRemoved, fAdded, fMedia);
-		fVisited.add(listener);
-
-		// traverse notifier
-		if (listener instanceof ICSSStyleNotifier) {
-			ICSSStyleNotifier notifier = (ICSSStyleNotifier) listener;
-			if (notifier.getStyleListeners() != null) {
-				Object[] listeners = notifier.getStyleListeners().toArray();
-				for (int i = 0; i < listeners.length; i++) {
-					visit((ICSSStyleListener) listeners[i]);
-				}
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void visitUpdate(ICSSStyleListener listener) {
-		if (listener == null || fVisited.contains(listener))
-			return;
-
-		// fire event to listener
-		listener.styleUpdate(fSrcModel);
-		fVisited.add(listener);
-
-		// traverse notifier
-		if (listener instanceof ICSSStyleNotifier) {
-			ICSSStyleNotifier notifier = (ICSSStyleNotifier) listener;
-			if (notifier.getStyleListeners() != null) {
-				Object[] listeners = notifier.getStyleListeners().toArray();
-				for (int i = 0; i < listeners.length; i++) {
-					visitUpdate((ICSSStyleListener) listeners[i]);
-				}
-			}
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleNotifyAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleNotifyAdapter.java
deleted file mode 100644
index 85c4e44..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleNotifyAdapter.java
+++ /dev/null
@@ -1,174 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.eventimpl;
-
-
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.event.ICSSStyleListener;
-import org.eclipse.wst.css.core.internal.event.ICSSStyleNotifier;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-import org.eclipse.wst.css.core.internal.util.ImportedCollector;
-import org.eclipse.wst.css.core.internal.util.SelectorsCollector;
-
-
-/**
- * 
- */
-public class CSSStyleNotifyAdapter implements ICSSStyleNotifier {
-
-	protected java.util.Vector listeners;
-	protected final org.eclipse.wst.css.core.internal.provisional.document.ICSSModel model;
-	protected boolean recording = false;
-
-	/**
-	 * 
-	 */
-	public CSSStyleNotifyAdapter(ICSSModel model) {
-		super();
-		this.model = model;
-	}
-
-	/**
-	 * 
-	 */
-	public void addStyleListener(ICSSStyleListener listener) {
-		if (listener == null)
-			return;
-
-		if (listeners == null)
-			listeners = new Vector();
-		if (!listeners.contains(listener)) {
-
-			// send new selectors event to listener
-			ImportedCollector trav = new ImportedCollector();
-			trav.apply(model.getDocument());
-			Iterator it = trav.getExternals().iterator();
-			while (it.hasNext()) {
-				ICSSStyleSheet sheet = (ICSSStyleSheet) it.next();
-				// collect selectors
-				SelectorsCollector selTrav = new SelectorsCollector();
-				selTrav.apply(sheet);
-				int nSel = selTrav.getSelectors().size();
-				ICSSSelector[] added = new ICSSSelector[nSel];
-				for (int i = 0; i < nSel; i++)
-					added[i] = (ICSSSelector) selTrav.getSelectors().get(i);
-
-				// fire event
-				CSSStyleEventDeliverer deliverer = new CSSStyleEventDeliverer();
-				deliverer.fireTo(listener, sheet.getModel(), null, added, null/*
-																				 * media
-																				 * will
-																				 * be
-																				 * implemented
-																				 * in
-																				 * the
-																				 * future
-																				 */);
-			}
-
-			// add listener
-			listeners.add(listener);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public void beginRecording() {
-		recording = true;
-	}
-
-	/**
-	 * 
-	 */
-	public void endRecording() {
-		recording = false;
-	}
-
-	/**
-	 * 
-	 */
-	public void fire(ICSSSelector[] removed, ICSSSelector[] added, String media) {
-		// send selector changed event
-		CSSStyleEventDeliverer deliv = new CSSStyleEventDeliverer();
-		deliv.fire(model, removed, added, null);
-
-	}
-
-	/**
-	 * 
-	 */
-	public java.util.List getStyleListeners() {
-		return listeners;
-	}
-
-	/**
-	 */
-	public boolean isRecording() {
-		return recording;
-	}
-
-	/**
-	 * 
-	 */
-	public void removeStyleListener(ICSSStyleListener listener) {
-		if (listener == null)
-			return;
-
-		if (listeners.contains(listener)) {
-			listeners.remove(listener);
-
-			// send old selectors event to listener
-			ImportedCollector trav = new ImportedCollector();
-			trav.apply(model.getDocument());
-			Iterator it = trav.getExternals().iterator();
-			while (it.hasNext()) {
-				ICSSStyleSheet sheet = (ICSSStyleSheet) it.next();
-				// collect selectors
-				SelectorsCollector selTrav = new SelectorsCollector();
-				selTrav.apply(sheet);
-				int nSel = selTrav.getSelectors().size();
-				ICSSSelector[] removed = new ICSSSelector[nSel];
-				for (int i = 0; i < nSel; i++)
-					removed[i] = (ICSSSelector) selTrav.getSelectors().get(i);
-
-				// fire event
-				CSSStyleEventDeliverer deliverer = new CSSStyleEventDeliverer();
-				deliverer.fireTo(listener, sheet.getModel(), removed, null, null/*
-																				 * media
-																				 * will
-																				 * be
-																				 * implemented
-																				 * in
-																				 * the
-																				 * future
-																				 */);
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public void styleChanged(org.eclipse.wst.css.core.internal.provisional.document.ICSSModel srcModel, org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector[] removed, org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector[] added, java.lang.String media) {
-	}
-
-	/**
-	 * 
-	 */
-	public void styleUpdate(org.eclipse.wst.css.core.internal.provisional.document.ICSSModel srcModel) {
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/format/CSSSourceFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/format/CSSSourceFormatter.java
deleted file mode 100644
index 37fe679..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/format/CSSSourceFormatter.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.format;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-
-
-/**
- * @deprecated
- */
-public interface CSSSourceFormatter extends INodeAdapter {
-
-	/**
-	 * 
-	 */
-	StringBuffer cleanup(ICSSNode node);
-
-	/**
-	 * 
-	 * @return java.lang.StringBuffer
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param region
-	 *            org.eclipse.jface.text.IRegion
-	 */
-	StringBuffer cleanup(ICSSNode node, IRegion region);
-
-	/**
-	 * 
-	 */
-	StringBuffer format(ICSSNode node);
-
-	/**
-	 * 
-	 */
-	StringBuffer format(ICSSNode node, IRegion region);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/format/FormatProcessorCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/format/FormatProcessorCSS.java
deleted file mode 100644
index cbba6da..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/format/FormatProcessorCSS.java
+++ /dev/null
@@ -1,88 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.format;
-
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.formatter.CSSFormatUtil;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-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.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.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Node;
-
-
-public class FormatProcessorCSS extends AbstractStructuredFormatProcessor {
-
-
-	protected String getFileExtension() {
-		return "css"; //$NON-NLS-1$
-	}
-
-	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) {
-		CSSFormatUtil formatUtil = CSSFormatUtil.getInstance();
-		if (structuredModel instanceof ICSSModel) {
-			ICSSDocument doc = ((ICSSModel) structuredModel).getDocument();
-			CSSSourceFormatter formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) doc);
-			StringBuffer buf = formatter.format(doc);
-			if (buf != null) {
-				int startOffset = ((IndexedRegion) doc).getStartOffset();
-				int endOffset = ((IndexedRegion) doc).getEndOffset();
-				formatUtil.replaceSource(doc.getModel(), startOffset, endOffset - startOffset, buf.toString());
-			}
-		}
-		else if (structuredModel instanceof IDOMModel) {
-			List cssnodes = formatUtil.collectCSSNodes(structuredModel, start, length);
-			if (cssnodes != null && !cssnodes.isEmpty()) {
-				ICSSModel model = null;
-				for (int i = 0; i < cssnodes.size(); i++) {
-					ICSSNode node = (ICSSNode) cssnodes.get(i);
-					CSSSourceFormatter formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) node);
-					StringBuffer buf = formatter.format(node);
-					if (buf != null) {
-						int startOffset = ((IndexedRegion) node).getStartOffset();
-						int endOffset = ((IndexedRegion) node).getEndOffset();
-						if (model == null) {
-							model = node.getOwnerDocument().getModel();
-						}
-						formatUtil.replaceSource(model, startOffset, endOffset - startOffset, buf.toString());
-					}
-				}
-			}
-		}
-	}
-
-	public IStructuredFormatPreferences getFormatPreferences() {
-		return null;
-	}
-
-	protected IStructuredFormatter getFormatter(Node node) {
-		return null;
-	}
-
-	protected void refreshFormatPreferences() {
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java
deleted file mode 100644
index f81e9dc..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java
+++ /dev/null
@@ -1,958 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.DefaultLineTracker;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategyImpl;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-import org.eclipse.wst.css.core.internal.util.CSSLinkConverter;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-
-/**
- * 
- */
-public abstract class AbstractCSSSourceFormatter implements CSSSourceGenerator {
-
-	protected final static short GENERATE = 0;
-	protected final static short FORMAT = 1;
-	protected final static short CLEANUP = 2;
-	protected static short strategy;
-
-	/**
-	 * 
-	 */
-	AbstractCSSSourceFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected void appendDelimBefore(ICSSNode node, CompoundRegion toAppend, StringBuffer source) {
-		if (node == null || source == null)
-			return;
-		if (isCleanup() && !getCleanupStrategy(node).isFormatSource())
-			return; // for not formatting case on cleanup action
-		String delim = getLineDelimiter(node);
-
-		boolean needIndent = !(node instanceof ICSSStyleSheet);
-		if (toAppend == null) {
-			source.append(delim);
-			source.append(getIndent(node));
-			if (needIndent)
-				source.append(getIndentString());
-		} else {
-			String type = toAppend.getType();
-			if (type == CSSRegionContexts.CSS_COMMENT) {
-				RegionIterator it = new RegionIterator(toAppend.getDocumentRegion(), toAppend.getTextRegion());
-				it.prev();
-				ITextRegion prev = it.prev();
-				if (prev == null || (prev.getType() == CSSRegionContexts.CSS_S && TextUtilities.indexOf(DefaultLineTracker.DELIMITERS, it.getStructuredDocumentRegion().getText(prev), 0)[0] >= 0)) {
-					source.append(delim);
-					source.append(getIndent(node));
-					if (needIndent)
-						source.append(getIndentString());
-				} else {
-					appendSpaceBefore(node, toAppend.getText(), source);
-				}
-			} else if (type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-				RegionIterator it = new RegionIterator(toAppend.getDocumentRegion(), toAppend.getTextRegion());
-				it.prev();
-				ITextRegion prev = it.prev();
-
-				Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
-				if (prev.getType() == CSSRegionContexts.CSS_S && TextUtilities.indexOf(DefaultLineTracker.DELIMITERS, it.getStructuredDocumentRegion().getText(prev), 0)[0] >= 0) {
-					source.append(delim);
-					source.append(getIndent(node));
-					if (needIndent)
-						source.append(getIndentString());
-				} else if (preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
-					int length = getLastLineLength(node, source);
-					int append = 1;
-					if (length + append > preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH)) {
-						source.append(getLineDelimiter(node));
-						source.append(getIndent(node));
-						if (needIndent)
-							source.append(getIndentString());
-					}
-				}
-			} else if (type == CSSRegionContexts.CSS_RBRACE || type == CSSRegionContexts.CSS_LBRACE) {
-				source.append(delim);
-				source.append(getIndent(node));
-			} else {
-				source.append(delim);
-				source.append(getIndent(node));
-				if (needIndent)
-					source.append(getIndentString());
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void appendSpaceBefore(ICSSNode node, CompoundRegion toAppend, StringBuffer source) {
-		if (node == null || toAppend == null || source == null)
-			return;
-		if (isCleanup() && !getCleanupStrategy(node).isFormatSource())
-			return; // for not formatting case on cleanup action
-		String type = toAppend.getType();
-
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
-		boolean needIndent = !(node instanceof ICSSStyleSheet);
-		if (type == CSSRegionContexts.CSS_COMMENT) {
-			// check whether previous region is 'S' and has CR-LF
-			String delim = getLineDelimiter(node);
-			RegionIterator it = new RegionIterator(toAppend.getDocumentRegion(), toAppend.getTextRegion());
-			it.prev();
-			ITextRegion prev = it.prev();
-			if (prev.getType() == CSSRegionContexts.CSS_S && TextUtilities.indexOf(DefaultLineTracker.DELIMITERS, it.getStructuredDocumentRegion().getText(prev), 0)[0] >= 0) {
-				source.append(delim);
-				source.append(getIndent(node));
-				if (needIndent)
-					source.append(getIndentString());
-			} else {
-				appendSpaceBefore(node, toAppend.getText(), source);
-			}
-		} else if (type == CSSRegionContexts.CSS_LBRACE && preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_NEWLINE_ON_OPEN_BRACE)) {
-			String delim = getLineDelimiter(node);
-			source.append(delim);
-			source.append(getIndent(node));
-			// } else if (type == CSSRegionContexts.CSS_CURLY_BRACE_CLOSE) {
-			// } else if (type == CSSRegionContexts.CSS_INCLUDES || type ==
-			// CSSRegionContexts.CSS_DASHMATCH) {
-		} else if (type == CSSRegionContexts.CSS_DECLARATION_SEPARATOR && node instanceof ICSSStyleDeclItem) {
-			int n = preferences.getInt(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM);
-			if (preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
-				int length = getLastLineLength(node, source);
-				int append = 1;
-				if (length + n + append > preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH)) {
-					source.append(getLineDelimiter(node));
-					source.append(getIndent(node));
-					if (needIndent)
-						source.append(getIndentString());
-					n = 0; // no space is necessary
-				}
-			}
-			// no delimiter case
-			while (n-- > 0)
-				source.append(" ");//$NON-NLS-1$
-		} else if (type == CSSRegionContexts.CSS_DECLARATION_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR || type == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
-			if (preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
-				int length = getLastLineLength(node, source);
-				int append = 1;
-				if (length + append > preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH)) {
-					source.append(getLineDelimiter(node));
-					source.append(getIndent(node));
-					if (needIndent)
-						source.append(getIndentString());
-				}
-			}
-		} else
-			appendSpaceBefore(node, toAppend.getText(), source);
-	}
-
-	/**
-	 * 
-	 */
-	protected void appendSpaceBefore(ICSSNode node, String toAppend, StringBuffer source) {
-		if (node == null || source == null)
-			return;
-		if (isCleanup() && !getCleanupStrategy(node).isFormatSource())
-			return; // for not formatting case on cleanup action
-
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		if (toAppend != null && toAppend.startsWith("{") && preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_NEWLINE_ON_OPEN_BRACE)) {//$NON-NLS-1$
-			source.append(getLineDelimiter(node));
-			source.append(getIndent(node));
-			return;
-		} else if (/* ! mgr.isOnePropertyPerLine() && */preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
-			int n = getLastLineLength(node, source);
-			int append = (toAppend != null) ? TextUtilities.indexOf(DefaultLineTracker.DELIMITERS, toAppend, 0)[0] : 0;
-			if (toAppend != null)
-				append = (append < 0) ? toAppend.length() : append;
-			if (n + append + 1 > preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH)) {
-				source.append(getLineDelimiter(node));
-				source.append(getIndent(node));
-				source.append(getIndentString());
-				return;
-			}
-		}
-		source.append(" ");//$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 */
-	public final StringBuffer cleanup(ICSSNode node) {
-		short oldStrategy = strategy;
-		strategy = CLEANUP;
-		StringBuffer source = formatProc(node);
-		strategy = oldStrategy;
-
-		return source;
-	}
-
-	/**
-	 * 
-	 */
-	public final StringBuffer cleanup(ICSSNode node, IRegion region) {
-		short oldStrategy = strategy;
-		strategy = CLEANUP;
-		StringBuffer source = formatProc(node, region);
-		strategy = oldStrategy;
-
-		return source;
-	}
-
-	/**
-	 * 
-	 */
-	protected String decoratedIdentRegion(CompoundRegion region, CSSCleanupStrategy stgy) {
-		if (isFormat())
-			return region.getText();
-
-		String text = region.getText();
-		if (region.getType() == CSSRegionContexts.CSS_STRING || region.getType() == CSSRegionContexts.CSS_URI)
-			return decoratedRegion(region, 0, stgy);
-
-		if (isCleanup()) {
-			if (stgy.getIdentCase() == CSSCleanupStrategy.ASIS || region.getType() == CSSRegionContexts.CSS_COMMENT)
-				return text;
-			else if (stgy.getIdentCase() == CSSCleanupStrategy.UPPER)
-				return text.toUpperCase();
-			else
-				return text.toLowerCase();
-		}
-
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		if (region.getType() == CSSRegionContexts.CSS_COMMENT)
-			return text;
-		else if (preferences.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
-			return text.toUpperCase();
-		else
-			return text.toLowerCase();
-	}
-
-	/**
-	 * 
-	 */
-	protected String decoratedPropNameRegion(CompoundRegion region, CSSCleanupStrategy stgy) {
-		if (isFormat())
-			return region.getText();
-
-		String text = region.getText();
-		if (region.getType() == CSSRegionContexts.CSS_STRING || region.getType() == CSSRegionContexts.CSS_URI)
-			return decoratedRegion(region, 1, stgy);
-		if (isCleanup()) {
-			if (stgy.getPropNameCase() == CSSCleanupStrategy.ASIS || region.getType() != CSSRegionContexts.CSS_DECLARATION_PROPERTY)
-				return text;
-			else if (stgy.getPropNameCase() == CSSCleanupStrategy.UPPER)
-				return text.toUpperCase();
-			else
-				return text.toLowerCase();
-		}
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
-		if (region.getType() != CSSRegionContexts.CSS_DECLARATION_PROPERTY)
-			return text;
-		else if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER)
-			return text.toUpperCase();
-		else
-			return text.toLowerCase();
-	}
-
-	/**
-	 * 
-	 */
-	protected String decoratedPropValueRegion(CompoundRegion region, CSSCleanupStrategy stgy) {
-		if (isFormat())
-			return region.getText();
-
-		String text = region.getText();
-		String type = region.getType();
-		if (type == CSSRegionContexts.CSS_STRING || type == CSSRegionContexts.CSS_URI)
-			return decoratedRegion(region, 2, stgy);
-		if (isCleanup()) {
-			if (stgy.getPropValueCase() != CSSCleanupStrategy.ASIS) {
-				if (type == CSSRegionContexts.CSS_COMMENT) {
-				} else {
-					if (stgy.getPropValueCase() == CSSCleanupStrategy.UPPER)
-						text = text.toUpperCase();
-					else
-						text = text.toLowerCase();
-				}
-			}
-		}
-		return text;
-	}
-
-	/**
-	 * 
-	 */
-	protected String decoratedRegion(CompoundRegion region, int type, CSSCleanupStrategy stgy) {
-		if (isFormat())
-			return region.getText();
-
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		String text = region.getText();
-		if (region.getType() == CSSRegionContexts.CSS_URI) {
-			String uri = CSSLinkConverter.stripFunc(text);
-
-			boolean prefIsUpper = preferences.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER;
-			boolean upper = (type == 0) ? prefIsUpper : ((type == 1) ? preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER : preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER);
-			String func = text.substring(0, 4);
-			if (isCleanup()) {
-				upper = ((type == 0) ? stgy.getIdentCase() : ((type == 1) ? stgy.getPropNameCase() : stgy.getPropValueCase())) == CSSCleanupStrategy.UPPER;
-				func = ((type == 0) ? stgy.getIdentCase() : ((type == 1) ? stgy.getPropNameCase() : stgy.getPropValueCase())) == CSSCleanupStrategy.ASIS ? text.substring(0, 4) : (upper ? "URL(" : "url(");//$NON-NLS-2$//$NON-NLS-1$
-			}
-			if ((!isCleanup() && preferences.getBoolean(CSSCorePreferenceNames.FORMAT_QUOTE_IN_URI)) || (isCleanup() && stgy.isQuoteValues())) {
-				String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-				quote = CSSUtil.detectQuote(uri, quote);
-				text = func + quote + uri + quote + ")";//$NON-NLS-1$
-			} else if (isCleanup() && !stgy.isQuoteValues()) {
-				text = func + CSSLinkConverter.removeFunc(text) + ")";//$NON-NLS-1$
-			} else {
-				text = func + uri + ")";//$NON-NLS-1$
-			}
-		} else if (region.getType() == CSSRegionContexts.CSS_STRING && (!isCleanup() || stgy.isQuoteValues())) {
-			String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-			// begginning
-			if (!text.startsWith(quote)) {
-				if (text.startsWith("\"") || text.startsWith("\'")) //$NON-NLS-1$ //$NON-NLS-2$
-					text = quote + text.substring(1);
-				else
-					text = quote + text;
-			}
-			// ending
-			if (!text.endsWith(quote)) {
-				if (text.endsWith("\"") || text.endsWith("\'")) //$NON-NLS-1$ //$NON-NLS-2$
-					text = text.substring(0, text.length() - 1) + quote;
-				else
-					text = text + quote;
-			}
-		}
-		return text;
-	}
-
-	/**
-	 * 
-	 */
-	public final StringBuffer format(ICSSNode node) {
-		short oldStrategy = strategy;
-		strategy = FORMAT;
-		StringBuffer source = formatProc(node);
-		strategy = oldStrategy;
-
-		return source;
-	}
-
-	/**
-	 * 
-	 */
-	public final StringBuffer format(ICSSNode node, IRegion region) {
-		short oldStrategy = strategy;
-		strategy = FORMAT;
-		StringBuffer source = formatProc(node, region);
-		strategy = oldStrategy;
-
-		return source;
-	}
-
-	/**
-	 * 
-	 */
-	public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
-		return new StringBuffer(insert && (attr != null) ? attr.getValue() : "");//$NON-NLS-1$
-	}
-
-	/**
-	 * Generate or format source between children('child' and its previous
-	 * sibling) and append to string buffer
-	 */
-	abstract protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor);
-
-	/**
-	 * Generate or format source between children('child' and its previous
-	 * sibling) and append to string buffer
-	 */
-	public final StringBuffer formatBefore(ICSSNode node, ICSSNode child, IRegion exceptFor) {
-		Assert.isTrue(child == null || child.getParentNode() == node);
-		StringBuffer buf = new StringBuffer();
-		formatBefore(node, child, /* (child != null) ? (child.getCssText()) : */"", buf, exceptFor);//$NON-NLS-1$
-		return buf;
-	}
-
-	/**
-	 * Generate or format source between children('child' and its previous
-	 * sibling) and append to string buffer
-	 */
-	protected abstract void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source);
-
-	/**
-	 * 
-	 */
-	protected final void formatChildren(ICSSNode node, StringBuffer source) {
-		ICSSNode child = node.getFirstChild();
-		boolean first = true;
-		while (child != null) {
-			// append child
-			CSSSourceFormatter formatter = (CSSSourceFormatter) ((INodeNotifier) child).getAdapterFor(CSSSourceFormatter.class);
-			if (formatter == null) {
-				formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) child);
-			}
-			StringBuffer childSource = ((AbstractCSSSourceFormatter) formatter).formatProc(child);
-			if (!first) {
-				formatBefore(node, child, new String(childSource), source, null);
-			}
-			source.append(childSource);
-			// append between children
-			child = child.getNextSibling();
-			first = false;
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected final void formatChildren(ICSSNode node, IRegion region, StringBuffer source) {
-		ICSSNode child = node.getFirstChild();
-		int start = region.getOffset();
-		int end = region.getOffset() + region.getLength();
-		boolean first = true;
-		while (child != null) {
-			int curEnd = ((IndexedRegion) child).getEndOffset();
-			StringBuffer childSource = null;
-			boolean toFinish = false;
-			if (start < curEnd) {
-				int curStart = ((IndexedRegion) child).getStartOffset();
-				if (curStart < end) {
-					// append child
-					CSSSourceFormatter formatter = (CSSSourceFormatter) ((INodeNotifier) child).getAdapterFor(CSSSourceFormatter.class);
-					if (formatter == null) {
-						formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) child);
-					}
-					if (includes(region, curStart, curEnd))
-						childSource = ((AbstractCSSSourceFormatter) formatter).formatProc(child);
-					else
-						childSource = ((AbstractCSSSourceFormatter) formatter).formatProc(child, overlappedRegion(region, curStart, curEnd));
-				} else
-					toFinish = true;
-			}
-			// append between children
-			if (!first) {
-				curEnd = ((IndexedRegion) child).getStartOffset(); // change
-				// only
-				// start
-				if (start < curEnd) {
-					int curStart = ((IndexedRegion) child.getPreviousSibling()).getEndOffset();
-					if (curStart < end) {
-						String toAppend = (childSource != null) ? new String(childSource) : "";//$NON-NLS-1$
-						if (includes(region, curStart, curEnd))
-							formatBefore(node, child, toAppend, source, null);
-						else
-							formatBefore(node, child, overlappedRegion(region, curStart, curEnd), toAppend, source);
-					}
-				}
-			}
-			if (childSource != null) {
-				source.append(childSource);
-			}
-			first = false;
-			if (toFinish)
-				break;
-			child = child.getNextSibling();
-		}
-	}
-
-	/**
-	 * Generate or format source after the last child and append to string
-	 * buffer
-	 */
-	protected abstract void formatPost(ICSSNode node, StringBuffer source);
-
-	/**
-	 * Generate or format source after the last child and append to string
-	 * buffer
-	 */
-	protected abstract void formatPost(ICSSNode node, IRegion region, StringBuffer source);
-
-	/**
-	 * Generate or format source before the first child and append to string
-	 * buffer
-	 */
-	protected abstract void formatPre(ICSSNode node, StringBuffer source);
-
-	/**
-	 * Generate or format source before the first child and append to string
-	 * buffer
-	 */
-	abstract protected void formatPre(ICSSNode node, IRegion region, StringBuffer source);
-
-	/**
-	 * 
-	 * @return java.lang.StringBuffer
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 */
-	protected final StringBuffer formatProc(ICSSNode node) {
-		StringBuffer source = new StringBuffer();
-		formatPre(node, source);
-		formatChildren(node, source);
-		formatPost(node, source);
-		return source;
-	}
-
-	/**
-	 * 
-	 * @return java.lang.StringBuffer
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param region
-	 *            org.eclipse.jface.text.IRegion
-	 */
-	protected final StringBuffer formatProc(ICSSNode node, IRegion region) {
-		StringBuffer source = new StringBuffer();
-		int curStart = ((IndexedRegion) node).getStartOffset();
-		int curEnd = ((IndexedRegion) node).getEndOffset();
-		if (node.getChildNodes().getLength() > 0) {
-			curEnd = ((IndexedRegion) node.getFirstChild()).getStartOffset();
-			if (overlaps(region, curStart, curEnd)) {
-				if (includes(region, curStart, curEnd))
-					formatPre(node, source);
-				else
-					formatPre(node, overlappedRegion(region, curStart, curEnd), source);
-			}
-			curStart = curEnd;
-			curEnd = ((IndexedRegion) node.getLastChild()).getEndOffset();
-			if (overlaps(region, curStart, curEnd)) {
-				if (includes(region, curStart, curEnd))
-					formatChildren(node, source);
-				else
-					formatChildren(node, overlappedRegion(region, curStart, curEnd), source);
-			}
-			curStart = curEnd;
-			curEnd = ((IndexedRegion) node).getEndOffset();
-			if (overlaps(region, curStart, curEnd)) {
-				if (includes(region, curStart, curEnd))
-					formatPost(node, source);
-				else
-					formatPost(node, overlappedRegion(region, curStart, curEnd), source);
-			}
-		} else {
-			curEnd = getChildInsertPos(node);
-			if (overlaps(region, curStart, curEnd)) {
-				if (includes(region, curStart, curEnd))
-					formatPre(node, source);
-				else
-					formatPre(node, overlappedRegion(region, curStart, curEnd), source);
-			}
-			curStart = curEnd;
-			curEnd = ((IndexedRegion) node).getEndOffset();
-			if (overlaps(region, curStart, curEnd)) {
-				if (includes(region, curStart, curEnd))
-					formatPost(node, source);
-				else
-					formatPost(node, overlappedRegion(region, curStart, curEnd), source);
-			}
-		}
-		return source;
-	}
-
-	/**
-	 * 
-	 */
-	public int getAttrInsertPos(ICSSNode node, String attrName) {
-		return -1;
-	}
-
-	/**
-	 * Insert the method's description here.
-	 * 
-	 * @return org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 */
-	protected CSSCleanupStrategy getCleanupStrategy(ICSSNode node) {
-		CSSCleanupStrategy currentStrategy = CSSCleanupStrategyImpl.getInstance();
-		ICSSDocument doc = node.getOwnerDocument();
-		if (doc == null)
-			return currentStrategy;
-		ICSSModel model = doc.getModel();
-		if (model == null)
-			return currentStrategy;
-		if (model.getStyleSheetType() != ICSSModel.EXTERNAL) {
-			// TODO - TRANSITION Nakamori-san, or Kit, how can we move to
-			// "HTML" plugin?
-			// can we subclass?
-			// currentStrategy = CSSInHTMLCleanupStrategyImpl.getInstance();
-		}
-		return currentStrategy;
-	}
-
-	/**
-	 * 
-	 */
-	protected String getIndent(ICSSNode node) {
-		if (node == null)
-			return "";//$NON-NLS-1$
-		ICSSNode parent = node.getParentNode();
-		if (node instanceof ICSSAttr)
-			parent = ((ICSSAttr) node).getOwnerCSSNode();
-		if (parent == null)
-			return "";//$NON-NLS-1$
-		if (node instanceof org.w3c.dom.css.CSSStyleDeclaration)
-			parent = parent.getParentNode();
-		if (parent == null)
-			return "";//$NON-NLS-1$
-
-		String parentIndent = getIndent(parent);
-		if (parent instanceof org.w3c.dom.css.CSSRule)
-			return parentIndent + getIndentString();
-		if (node.getParentNode() instanceof ICSSStyleDeclaration)
-			return parentIndent + getIndentString();
-		return parentIndent;
-	}
-
-	/**
-	 * 
-	 */
-	protected int getLastLineLength(ICSSNode node, StringBuffer source) {
-		if (node == null || source == null)
-			return 0;
-		String delim = getLineDelimiter(node);
-		String str = new String(source);
-		int n = str.lastIndexOf(delim);
-		if (n < 0)
-			return str.length();
-
-		return str.length() - n - delim.length();
-	}
-
-	/**
-	 * 
-	 * @return int
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param insertPos
-	 *            int
-	 */
-	public int getLengthToReformatAfter(ICSSNode node, int insertPos) {
-		if (node == null)
-			return 0;
-		IndexedRegion nnode = (IndexedRegion) node;
-		if (insertPos < 0 || !nnode.contains(insertPos))
-			return 0;
-
-		IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(insertPos);
-		if (flatNode == null)
-			return 0;
-		ITextRegion region = flatNode.getRegionAtCharacterOffset(insertPos);
-		if (region == null)
-			return 0;
-		RegionIterator it = new RegionIterator(flatNode, region);
-		boolean found = false;
-		while (it.hasNext()) {
-			region = it.next();
-			// if (region.getType() != CSSRegionContexts.CSS_S &&
-			// region.getType() != CSSRegionContexts.CSS_DELIMITER &&
-			// region.getType() !=
-			// CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-			if (region.getType() != CSSRegionContexts.CSS_S) {
-				found = true;
-				break;
-			}
-		}
-		int pos = (found ? it.getStructuredDocumentRegion().getStartOffset(region) : it.getStructuredDocumentRegion().getTextEndOffset(region)) - insertPos;
-		return (pos >= 0) ? pos : 0;
-	}
-
-	/**
-	 * 
-	 * @return int
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param insertPos
-	 *            int
-	 */
-	public int getLengthToReformatBefore(ICSSNode node, int insertPos) {
-		if (node == null)
-			return 0;
-		IndexedRegion nnode = (IndexedRegion) node;
-		if (insertPos <= 0 || !nnode.contains(insertPos - 1))
-			return 0;
-
-		IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(insertPos - 1);
-		if (flatNode == null)
-			return 0;
-		ITextRegion region = flatNode.getRegionAtCharacterOffset(insertPos - 1);
-		if (region == null)
-			return 0;
-		RegionIterator it = new RegionIterator(flatNode, region);
-		boolean found = false;
-		while (it.hasPrev()) {
-			region = it.prev();
-			// if (region.getType() != CSSRegionContexts.CSS_S &&
-			// region.getType() != CSSRegionContexts.CSS_DELIMITER &&
-			// region.getType() !=
-			// CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-			if (region.getType() != CSSRegionContexts.CSS_S) {
-				found = true;
-				break;
-			}
-		}
-		int pos = insertPos - (found ? it.getStructuredDocumentRegion().getTextEndOffset(region) : it.getStructuredDocumentRegion().getStartOffset(region));
-		// flatNode = it.getStructuredDocumentRegion();
-		// if (found) {
-		// if (region.getLength() != region.getTextLength()) {
-		// pos = insertPos - flatNode.getTextEndOffset(region);
-		// } else {
-		// pos = insertPos - flatNode.getEndOffset(region);
-		// }
-		// } else {
-		// pos = insertPos - flatNode.getStartOffset(region);
-		// }
-		return (pos >= 0) ? pos : 0;
-	}
-
-	/**
-	 * 
-	 */
-	String getLineDelimiter(ICSSNode node) {
-		ICSSModel model = (node != null) ? node.getOwnerDocument().getModel() : null;
-		return (model != null) ? model.getStructuredDocument().getLineDelimiter() : "\n"; //$NON-NLS-1$
-
-		// TODO : check whether to use model.getLineDelimiter() or
-		// model.getStructuredDocument().getLineDelimiter()
-	}
-
-	/**
-	 * 
-	 */
-	protected CompoundRegion[] getOutsideRegions(IStructuredDocument model, IRegion reg) {
-		CompoundRegion[] ret = new CompoundRegion[2];
-		RegionIterator it = new RegionIterator(model, reg.getOffset());
-		it.prev();
-		if (it.hasPrev()) {
-			ITextRegion textRegion = it.prev();
-			IStructuredDocumentRegion documentRegion = it.getStructuredDocumentRegion();
-			ret[0] = new CompoundRegion(documentRegion, textRegion);
-		} else {
-			ret[0] = null;
-		}
-		it.reset(model, reg.getOffset() + reg.getLength());
-		if (it.hasNext()) {
-			ITextRegion textRegion = it.next();
-			IStructuredDocumentRegion documentRegion = it.getStructuredDocumentRegion();
-			ret[1] = new CompoundRegion(documentRegion, textRegion);
-		} else {
-			ret[1] = null;
-		}
-		return ret;
-	}
-
-	/**
-	 */
-	protected CSSSourceGenerator getParentFormatter(ICSSNode node) {
-		ICSSNode parent = node.getParentNode();
-		if (parent != null) {
-			CSSSourceGenerator formatter = (CSSSourceGenerator) ((INodeNotifier) parent).getAdapterFor(CSSSourceFormatter.class);
-			if (formatter == null) {
-				formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) parent);
-			}
-			return formatter;
-		}
-		return null;
-	}
-
-	/**
-	 * 
-	 */
-	protected CompoundRegion[] getRegions(IStructuredDocument model, IRegion reg, IRegion exceptFor, String pickupType) {
-		int start = reg.getOffset();
-		int end = reg.getOffset() + reg.getLength();
-		int startE = (exceptFor != null) ? exceptFor.getOffset() : -1;
-		int endE = (exceptFor != null) ? exceptFor.getOffset() + exceptFor.getLength() : 0;
-
-		ArrayList list = new ArrayList();
-		IStructuredDocumentRegion flatNode = model.getRegionAtCharacterOffset(start);
-		boolean pickuped = false;
-		while (flatNode != null && flatNode.getStartOffset() < end) {
-			ITextRegionList regionList = flatNode.getRegions();
-			Iterator it = regionList.iterator();
-			while (it.hasNext()) {
-				ITextRegion region = (ITextRegion) it.next();
-				if (flatNode.getStartOffset(region) < start)
-					continue;
-				if (end <= flatNode.getStartOffset(region))
-					break;
-				if (startE >= 0 && startE <= flatNode.getStartOffset(region) && flatNode.getEndOffset(region) <= endE)
-					continue;
-				if (region.getType() == CSSRegionContexts.CSS_COMMENT || region.getType() == CSSRegionContexts.CSS_CDC || region.getType() == CSSRegionContexts.CSS_CDO)
-					list.add(new CompoundRegion(flatNode, region));
-				else if (!pickuped && region.getType() == pickupType) {
-					list.add(new CompoundRegion(flatNode, region));
-					pickuped = true;
-				}
-			}
-			flatNode = flatNode.getNext();
-		}
-		if (list.size() > 0) {
-			CompoundRegion[] regions = new CompoundRegion[list.size()];
-			list.toArray(regions);
-			return regions;
-		}
-		return new CompoundRegion[0];
-	}
-
-	/**
-	 * 
-	 */
-	protected CompoundRegion[] getRegionsWithoutWhiteSpaces(IStructuredDocument model, IRegion reg, CSSCleanupStrategy stgy) {
-		int start = reg.getOffset();
-		int end = reg.getOffset() + reg.getLength() - 1;
-		ArrayList list = new ArrayList();
-		IStructuredDocumentRegion flatNode = model.getRegionAtCharacterOffset(start);
-		while (flatNode != null && flatNode.getStartOffset() <= end) {
-			ITextRegionList regionList = flatNode.getRegions();
-			Iterator it = regionList.iterator();
-			while (it.hasNext()) {
-				ITextRegion region = (ITextRegion) it.next();
-				if (flatNode.getStartOffset(region) < start)
-					continue;
-				if (end < flatNode.getStartOffset(region))
-					break;
-				if (region.getType() != CSSRegionContexts.CSS_S || (isCleanup() && !stgy.isFormatSource())) // for
-					// not
-					// formatting
-					// case
-					// on
-					// cleanup
-					// action
-					list.add(new CompoundRegion(flatNode, region));
-			}
-			flatNode = flatNode.getNext();
-		}
-		if (list.size() > 0) {
-			CompoundRegion[] regions = new CompoundRegion[list.size()];
-			list.toArray(regions);
-			return regions;
-		}
-		return new CompoundRegion[0];
-	}
-
-	/**
-	 * 
-	 */
-	public static boolean includes(IRegion region, int start, int end) {
-		if (region == null)
-			return false;
-
-		return (region.getOffset() <= start) && (end <= region.getOffset() + region.getLength());
-	}
-
-	/**
-	 * 
-	 * @return boolean
-	 */
-	protected static boolean isCleanup() {
-		return strategy == CLEANUP;
-	}
-
-	/**
-	 * 
-	 * @return boolean
-	 */
-	protected static boolean isFormat() {
-		return strategy == FORMAT;
-	}
-
-	/**
-	 * 
-	 */
-	protected boolean isIncludesPreEnd(ICSSNode node, IRegion region) {
-		return (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getStartOffset() == (region.getOffset() + region.getLength()));
-	}
-
-	/**
-	 * 
-	 */
-	static protected boolean needS(CompoundRegion region) {
-		return (region != null && region.getType() != CSSRegionContexts.CSS_S);
-	}
-
-	/**
-	 * 
-	 */
-	public static IRegion overlappedRegion(IRegion region, int start, int end) {
-		if (overlaps(region, start, end)) {
-			int offset = (region.getOffset() <= start) ? start : region.getOffset();
-			int length = ((end <= region.getOffset() + region.getLength()) ? end : region.getOffset() + region.getLength()) - offset;
-			return new FormatRegion(offset, length);
-		}
-		return null;
-	}
-
-	/**
-	 * 
-	 */
-	public static boolean overlaps(IRegion region, int start, int end) {
-		if (region == null)
-			return false;
-
-		return (start < region.getOffset() + region.getLength()) && (region.getOffset() < end);
-	}
-
-	private String getIndentString() {
-		StringBuffer indent = new StringBuffer();
-
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		if (preferences != null) {
-			char indentChar = ' ';
-			String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
-			if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
-				indentChar = '\t';
-			}
-			int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
-
-			for (int i = 0; i < indentationWidth; i++) {
-				indent.append(indentChar);
-			}
-		}
-		return indent.toString();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrChangeContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrChangeContext.java
deleted file mode 100644
index 924a73e..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrChangeContext.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-/**
- * 
- */
-public class AttrChangeContext {
-
-	public int start, end;
-
-	/**
-	 * 
-	 */
-	public AttrChangeContext() {
-		super();
-		start = end = 0;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrFormatter.java
deleted file mode 100644
index 6401d41..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrFormatter.java
+++ /dev/null
@@ -1,168 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-/**
- * 
- */
-public class AttrFormatter extends DefaultCSSSourceFormatter {
-
-	private static AttrFormatter instance;
-
-	/**
-	 * 
-	 */
-	AttrFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, StringBuffer source) {
-		ICSSAttr attr = (ICSSAttr) node;
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		int end = ((IndexedRegion) node).getEndOffset();
-		if (end > 0) { // format source
-			int start = ((IndexedRegion) node).getStartOffset();
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-
-			if (attr.getName().equals(ICSSStyleRule.SELECTOR) || attr.getName().equals(ICSSPageRule.SELECTOR)) {
-				for (int i = 0; i < regions.length; i++) {
-					if (i != 0)
-						appendSpaceBetween(node, regions[i - 1], regions[i], source);
-					source.append(decoratedRegion(regions[i], 0, stgy));
-				}
-			}
-			else if (attr.getName().equals(ICSSImportRule.HREF)) {
-				for (int i = 0; i < regions.length; i++) {
-					if (i != 0)
-						appendSpaceBefore(node, regions[i], source);
-					source.append(decoratedPropValueRegion(regions[i], stgy));
-				}
-			}
-			else if (attr.getName().equals(ICSSCharsetRule.ENCODING)) {
-				for (int i = 0; i < regions.length; i++) {
-					if (i != 0)
-						appendSpaceBefore(node, regions[i], source);
-					source.append(decoratedIdentRegion(regions[i], stgy));
-				}
-			}
-			else if (attr.getName().equals(ICSSStyleDeclItem.IMPORTANT)) {
-				for (int i = 0; i < regions.length; i++) {
-					if (i != 0)
-						appendSpaceBefore(node, regions[i], source);
-					source.append(decoratedPropValueRegion(regions[i], stgy));
-				}
-			}
-			else if (attr.getName() == null || attr.getName().length() == 0) {
-				for (int i = 0; i < regions.length; i++) {
-					if (i != 0)
-						appendSpaceBefore(node, regions[i], source);
-					source.append(decoratedIdentRegion(regions[i], stgy));
-				}
-			}
-			else {
-				// counter attributes
-				for (int i = 0; i < regions.length; i++) {
-					if (i != 0)
-						appendSpaceBefore(node, regions[i], source);
-					source.append(decoratedPropValueRegion(regions[i], stgy));
-				}
-			}
-		}
-		else { // generate source
-			Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-			
-			String value = attr.getValue();
-			if (value == null)
-				value = "";//$NON-NLS-1$
-			if (attr.getName().equals(ICSSStyleRule.SELECTOR) || attr.getName().equals(ICSSPageRule.SELECTOR)) {
-			}
-			else if (attr.getName().equals(ICSSImportRule.HREF)) {
-				String uri = org.eclipse.wst.css.core.internal.util.CSSLinkConverter.stripFunc(value);
-				String func = preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER ? "URL(" : "url(";//$NON-NLS-2$//$NON-NLS-1$
-				if (preferences.getBoolean(CSSCorePreferenceNames.FORMAT_QUOTE_IN_URI)) {
-					String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-					quote = CSSUtil.detectQuote(uri, quote);
-					value = func + quote + uri + quote + ")";//$NON-NLS-1$
-				}
-				else {
-					value = func + uri + ")";//$NON-NLS-1$
-				}
-			}
-			else if (attr.getName().equals(ICSSCharsetRule.ENCODING)) {
-				String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-				if (!value.startsWith("\"") && !value.startsWith("\'"))//$NON-NLS-2$//$NON-NLS-1$
-					value = quote + value;
-				if (!value.endsWith("\"") && !value.endsWith("\'"))//$NON-NLS-2$//$NON-NLS-1$
-					value = value + quote;
-			}
-			else if (attr.getName().equals(ICSSStyleDeclItem.IMPORTANT)) {
-				if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
-					value = value.toUpperCase();
-				else
-					value = value.toLowerCase();
-			}
-			else if (attr.getName() == null || attr.getName().length() == 0) {
-				if (CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
-					value = value.toUpperCase();
-				else
-					value = value.toLowerCase();
-			}
-			else {
-				if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
-					value = value.toUpperCase();
-				else
-					value = value.toLowerCase();
-			}
-			source.append(value);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-		formatPre(node, source);
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static AttrFormatter getInstance() {
-		if (instance == null) {
-			instance = new AttrFormatter();
-		}
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSFormatUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSFormatUtil.java
deleted file mode 100644
index 4d2dc00..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSFormatUtil.java
+++ /dev/null
@@ -1,165 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.ICSSModelAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-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.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-public class CSSFormatUtil {
-	public List collectCSSNodes(IStructuredModel model, int start, int length) {
-		List nodes = new ArrayList();
-
-		IndexedRegion startNode = model.getIndexedRegion(start);
-		IndexedRegion endNode = model.getIndexedRegion(start + length - 1);
-
-		if (startNode == null || endNode == null) {
-			return nodes;
-		}
-
-		if (model instanceof ICSSModel && startNode instanceof ICSSNode && endNode instanceof ICSSNode) {
-			// CSS model
-			ICSSNode ca = getCommonAncestor((ICSSNode) startNode, (ICSSNode) endNode);
-			if (ca != null) {
-				for (ICSSNode node = ca.getFirstChild(); node != null && start + length < ((IndexedRegion) node).getStartOffset(); node = node.getNextSibling()) {
-					if (start < ((IndexedRegion) node).getEndOffset()) {
-						nodes.add(node);
-					}
-				}
-			}
-		}
-		else if (model instanceof IDOMModel && startNode instanceof IDOMNode && endNode instanceof IDOMNode) {
-			if (startNode instanceof Text) {
-				startNode = (IndexedRegion) ((Text) startNode).getParentNode();
-			}
-			if (endNode instanceof Text) {
-				endNode = (IndexedRegion) ((Text) endNode).getParentNode();
-			}
-			// HTML model, maybe
-			IDOMNode ca = (IDOMNode) getCommonAncestor((Node) startNode, (Node) endNode);
-			findCSS(nodes, ca);
-		}
-
-		return nodes;
-	}
-
-	/**
-	 * getCommonAncestor method
-	 * 
-	 * @return org.w3c.dom.Node
-	 * @param node
-	 *            org.w3c.dom.Node
-	 */
-	private Node getCommonAncestor(Node node1, Node node2) {
-		if (node1 == null || node2 == null)
-			return null;
-
-		for (Node na = node2; na != null; na = na.getParentNode()) {
-			for (Node ta = node1; ta != null; ta = ta.getParentNode()) {
-				if (ta == na)
-					return ta;
-			}
-		}
-		return null; // not found
-	}
-
-	private void findCSS(List cssNodes, IDOMNode node) {
-		ICSSModelAdapter adapter;
-		adapter = (ICSSModelAdapter) node.getAdapterFor(IStyleSheetAdapter.class);
-		if (adapter != null) {
-			ICSSModel model = adapter.getModel();
-			if (model != null && model.getStyleSheetType() == ICSSModel.EMBEDDED) {
-				cssNodes.add(model.getDocument());
-			}
-		}
-		else {
-			adapter = (ICSSModelAdapter) node.getAdapterFor(IStyleDeclarationAdapter.class);
-			if (adapter != null) {
-				ICSSModel model = adapter.getModel();
-				if (model != null && model.getStyleSheetType() == ICSSModel.INLINE) {
-					cssNodes.add(model.getDocument());
-				}
-			}
-		}
-
-		for (IDOMNode child = (IDOMNode) node.getFirstChild(); child != null; child = (IDOMNode) child.getNextSibling()) {
-			findCSS(cssNodes, child);
-		}
-	}
-
-	private ICSSNode getCommonAncestor(ICSSNode nodeA, ICSSNode nodeB) {
-		if (nodeA == null || nodeB == null) {
-			return null;
-		}
-
-		for (ICSSNode na = nodeA; na != null; na = na.getParentNode()) {
-			for (ICSSNode ta = nodeB; ta != null; ta = ta.getParentNode()) {
-				if (ta == na) {
-					return ta;
-				}
-			}
-		}
-
-		return null; // not found
-	}
-
-	/**
-	 */
-	public void replaceSource(IStructuredModel model, int offset, int length, String source) {
-		if (model == null)
-			return;
-		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
-			return;
-		if (offset >= 0 && length >= 0 && offset + length <= structuredDocument.getLength()) {
-			if (structuredDocument.containsReadOnly(offset, length))
-				return;
-			if (source == null)
-				source = new String();
-			// We use 'structuredDocument' as the requester object just so
-			// this and the other
-			// format-related 'repalceText' (in replaceSource) can use the
-			// same requester.
-			// Otherwise, if requester is not identical,
-			// the undo group gets "broken" into multiple pieces based
-			// on the requesters being different. Technically, any unique,
-			// common
-			// requester object would work.
-			structuredDocument.replaceText(structuredDocument, offset, length, source);
-		}
-	}
-
-	public synchronized static CSSFormatUtil getInstance() {
-		if (fInstance == null) {
-			fInstance = new CSSFormatUtil();
-		}
-		return fInstance;
-	}
-
-	private CSSFormatUtil() {
-		super();
-	}
-
-	private static CSSFormatUtil fInstance;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatter.java
deleted file mode 100644
index 4a9af06..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatter.java
+++ /dev/null
@@ -1,48 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-
-
-/**
- * 
- */
-public interface CSSSourceFormatter {
-
-	/**
-	 * 
-	 */
-	StringBuffer cleanup(ICSSNode node);
-
-	/**
-	 * 
-	 * @return java.lang.StringBuffer
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param region
-	 *            org.eclipse.jface.text.IRegion
-	 */
-	StringBuffer cleanup(ICSSNode node, IRegion region);
-
-	/**
-	 * 
-	 */
-	StringBuffer format(ICSSNode node);
-
-	/**
-	 * 
-	 */
-	StringBuffer format(ICSSNode node, IRegion region);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatterFactory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatterFactory.java
deleted file mode 100644
index e3bf596..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatterFactory.java
+++ /dev/null
@@ -1,81 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-
-/**
- * 
- */
-public class CSSSourceFormatterFactory {
-	/**
-	 * 
-	 */
-	private CSSSourceFormatterFactory() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public CSSSourceGenerator getSourceFormatter(INodeNotifier target) {
-		ICSSNode node = (ICSSNode) target;
-		short type = node.getNodeType();
-		switch (type) {
-			case ICSSNode.CHARSETRULE_NODE :
-				return CharsetRuleFormatter.getInstance();
-			case ICSSNode.FONTFACERULE_NODE :
-				return FontFaceRuleFormatter.getInstance();
-			case ICSSNode.IMPORTRULE_NODE :
-				return ImportRuleFormatter.getInstance();
-			case ICSSNode.MEDIALIST_NODE :
-				return MediaListFormatter.getInstance();
-			case ICSSNode.MEDIARULE_NODE :
-				return MediaRuleFormatter.getInstance();
-			case ICSSNode.PRIMITIVEVALUE_NODE :
-				ICSSPrimitiveValue value = (ICSSPrimitiveValue) node;
-				if (value.getPrimitiveType() == org.w3c.dom.css.CSSPrimitiveValue.CSS_COUNTER)
-					return CounterFormatter.getInstance();
-				else if (value.getPrimitiveType() == org.w3c.dom.css.CSSPrimitiveValue.CSS_RECT)
-					return RectFormatter.getInstance();
-				else if (value.getPrimitiveType() == org.w3c.dom.css.CSSPrimitiveValue.CSS_RGBCOLOR)
-					return RGBFormatter.getInstance();
-				else
-					return PrimitiveValueFormatter.getInstance();
-			case ICSSNode.PAGERULE_NODE :
-				return PageRuleFormatter.getInstance();
-			case ICSSNode.STYLEDECLARATION_NODE :
-				return StyleDeclarationFormatter.getInstance();
-			case ICSSNode.STYLEDECLITEM_NODE :
-				return StyleDeclItemFormatter.getInstance();
-			case ICSSNode.STYLERULE_NODE :
-				return StyleRuleFormatter.getInstance();
-			case ICSSNode.STYLESHEET_NODE :
-				return StyleSheetFormatter.getInstance();
-			case ICSSNode.ATTR_NODE :
-				return AttrFormatter.getInstance();
-			default :
-				return UnknownRuleFormatter.getInstance();
-		}
-	}
-
-	public synchronized static CSSSourceFormatterFactory getInstance() {
-		if (fInstance == null) {
-			fInstance = new CSSSourceFormatterFactory();
-		}
-		return fInstance;
-	}
-
-	private static CSSSourceFormatterFactory fInstance;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceGenerator.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceGenerator.java
deleted file mode 100644
index edfe8cb..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceGenerator.java
+++ /dev/null
@@ -1,61 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-
-
-public interface CSSSourceGenerator extends CSSSourceFormatter {
-
-	/**
-	 * 
-	 */
-	StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext region);
-
-	/**
-	 * 
-	 */
-	StringBuffer formatBefore(ICSSNode node, ICSSNode child, IRegion exceptFor);
-
-	/**
-	 * 
-	 */
-	int getAttrInsertPos(ICSSNode node, String attrName);
-
-	/**
-	 * 
-	 */
-	int getChildInsertPos(ICSSNode node);
-
-	/**
-	 * 
-	 * @return int
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param insertPos
-	 *            int
-	 */
-	int getLengthToReformatAfter(ICSSNode node, int insertPos);
-
-	/**
-	 * 
-	 * @return int
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param insertPos
-	 *            int
-	 */
-	int getLengthToReformatBefore(ICSSNode node, int insertPos);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CharsetRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CharsetRuleFormatter.java
deleted file mode 100644
index 7190fc9..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CharsetRuleFormatter.java
+++ /dev/null
@@ -1,184 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- * 
- */
-public class CharsetRuleFormatter extends DefaultCSSSourceFormatter {
-
-	public final static java.lang.String CHARSET = "@charset";//$NON-NLS-1$
-	private static CharsetRuleFormatter instance;
-
-	/**
-	 * 
-	 */
-	CharsetRuleFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
-		StringBuffer buf = new StringBuffer();
-		if (node == null || attr == null)
-			return buf;
-
-		if (!ICSSCharsetRule.ENCODING.equalsIgnoreCase(attr.getName()))
-			return buf;
-
-		// get region to replace
-		if (context != null && ((IndexedRegion) node).getEndOffset() > 0) {
-			if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0) {
-				IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
-				ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
-				RegionIterator it = new RegionIterator(flatNode, region);
-				it.prev();
-				if (it.hasPrev()) {
-					ITextRegion prev = it.prev();
-					if (prev.getType() == CSSRegionContexts.CSS_S)
-						context.start = it.getStructuredDocumentRegion().getStartOffset(prev);
-					else
-						context.start = it.getStructuredDocumentRegion().getStartOffset(region);
-				} else
-					context.start = it.getStructuredDocumentRegion().getStartOffset(region);
-				context.end = it.getStructuredDocumentRegion().getEndOffset(region);
-			} else {
-				IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
-				ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
-				if (region.getType() == CSSRegionContexts.CSS_S) {
-					context.start = flatNode.getStartOffset(region);
-					context.end = flatNode.getStartOffset(region);
-				} else {
-					context.start = flatNode.getEndOffset() + 1;
-					context.end = flatNode.getEndOffset();
-				}
-			}
-		}
-		// generate text
-		if (insert) {
-			appendSpaceBefore(node, attr.getValue(), buf);
-			buf.append(attr.getValue());
-		}
-		return buf;
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, StringBuffer source) {
-		int end = ((IndexedRegion) node).getEndOffset();
-		if (end > 0) { // format source
-			int start = ((IndexedRegion) node).getStartOffset();
-			formatPre(node, new FormatRegion(start, end - start), source);
-		} else { // generate source
-			Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
-			String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-			String str = CHARSET;
-			if (preferences.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
-				str = CHARSET.toUpperCase();
-			source.append(str);
-			String enc = ((ICSSCharsetRule) node).getEncoding();
-			quote = CSSUtil.detectQuote(enc, quote);
-			str = quote + ((enc != null) ? enc : "") + quote + ";";//$NON-NLS-1$ //$NON-NLS-2$
-			appendSpaceBefore(node, str, source);
-			source.append(str);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if ((i != 0 || needS(outside[0])) && !regions[i].getType().equals(CSSRegionContexts.CSS_DELIMITER))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedIdentRegion(regions[i], stgy));
-		}
-		if (needS(outside[1]) && !isIncludesPreEnd(node, region))
-			appendSpaceBefore(node, outside[1], source);
-	}
-
-	/**
-	 * 
-	 */
-	public int getAttrInsertPos(ICSSNode node, String attrName) {
-		if (node == null || attrName == null || attrName.length() == 0)
-			return -1;
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		if (!ICSSCharsetRule.ENCODING.equalsIgnoreCase(attrName))
-			return -1;
-
-		ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICSSCharsetRule.ENCODING);
-		if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
-			return ((IndexedRegion) attr).getStartOffset();
-		IndexedRegion iNode = (IndexedRegion) node;
-		if (iNode.getEndOffset() <= 0)
-			return -1;
-
-		CompoundRegion regions[] = getRegionsWithoutWhiteSpaces(node.getOwnerDocument().getModel().getStructuredDocument(), new FormatRegion(iNode.getStartOffset(), iNode.getEndOffset() - iNode.getStartOffset()), stgy);
-		for (int i = regions.length - 1; i >= 0; i--) {
-			if (regions[i].getType() != CSSRegionContexts.CSS_COMMENT)
-				return regions[i].getStartOffset();
-		}
-		return iNode.getEndOffset();
-	}
-
-	/**
-	 * 
-	 */
-	public int getChildInsertPos(ICSSNode node) {
-		int n = ((IndexedRegion) node).getEndOffset();
-		if (n > 0) {
-			IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
-			if (flatNode.getRegionAtCharacterOffset(n - 1).getType() == CSSRegionContexts.CSS_DELIMITER)
-				return n - 1;
-			return n;
-		}
-		return -1;
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static CharsetRuleFormatter getInstance() {
-		if (instance == null)
-			instance = new CharsetRuleFormatter();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CompoundRegion.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CompoundRegion.java
deleted file mode 100644
index 9b3c8ff..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CompoundRegion.java
+++ /dev/null
@@ -1,52 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-class CompoundRegion {
-
-	CompoundRegion(IStructuredDocumentRegion documentRegion, ITextRegion textRegion) {
-		super();
-		this.fDocumentRegion = documentRegion;
-		this.fTextRegion = textRegion;
-	}
-
-	IStructuredDocumentRegion getDocumentRegion() {
-		return fDocumentRegion;
-	}
-
-	ITextRegion getTextRegion() {
-		return fTextRegion;
-	}
-
-	String getType() {
-		return fTextRegion.getType();
-	}
-
-	String getText() {
-		return fDocumentRegion.getText(fTextRegion);
-	}
-
-	int getStartOffset() {
-		return fDocumentRegion.getStartOffset(fTextRegion);
-	}
-
-	int getEndOffset() {
-		return fDocumentRegion.getEndOffset(fTextRegion);
-	}
-
-
-	private IStructuredDocumentRegion fDocumentRegion;
-	private ITextRegion fTextRegion;
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CounterFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CounterFormatter.java
deleted file mode 100644
index 331dd1b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CounterFormatter.java
+++ /dev/null
@@ -1,319 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICounter;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- * 
- */
-public class CounterFormatter extends DefaultCSSSourceFormatter {
-
-	private static CounterFormatter instance;
-
-	/**
-	 * 
-	 */
-	CounterFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		
-		StringBuffer source = new StringBuffer();
-		if (node == null || attr == null)
-			return source;
-
-		if (!ICounter.IDENTIFIER.equalsIgnoreCase(attr.getName()) && !ICounter.LISTSTYLE.equalsIgnoreCase(attr.getName()) && !ICounter.SEPARATOR.equalsIgnoreCase(attr.getName()))
-			return source;
-
-		// get region to replace
-		IndexedRegion iNode = (IndexedRegion) node;
-		context.start = iNode.getStartOffset();
-		context.end = iNode.getEndOffset();
-
-		ICounter counter = (ICounter) node;
-		String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-		String sep = counter.getSeparator();
-		String ident = counter.getIdentifier();
-		String style = counter.getListStyle();
-
-		if (ICounter.IDENTIFIER.equalsIgnoreCase(attr.getName())) {
-			if (insert)
-				ident = attr.getValue();
-			else
-				ident = "";//$NON-NLS-1$
-		}
-		else if (ICounter.LISTSTYLE.equalsIgnoreCase(attr.getName())) {
-			if (insert)
-				style = attr.getValue();
-			else
-				style = null;
-		}
-		else if (ICounter.SEPARATOR.equalsIgnoreCase(attr.getName())) {
-			if (insert)
-				sep = attr.getValue();
-			else
-				sep = null;
-		}
-
-		quote = CSSUtil.detectQuote(sep, quote);
-		sep = (sep == null || sep.length() == 0) ? null : (quote + sep + quote);
-
-		String func = (sep == null || sep.length() == 0) ? "counter(" : "counters(";//$NON-NLS-2$//$NON-NLS-1$
-		if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER) {
-			ident = ident.toUpperCase();
-			style = style.toUpperCase();
-			func = func.toUpperCase();
-		}
-		else {
-			ident = ident.toLowerCase();
-			style = style.toLowerCase();
-		}
-		if (sep == null || sep.length() == 0) {
-			source.append(func);
-			appendSpaceBefore(node, ident, source);
-			source.append(ident);
-		}
-		else {
-			source.append(func);
-			appendSpaceBefore(node, ident, source);
-			source.append(ident);
-			source.append(",");//$NON-NLS-1$
-			appendSpaceBefore(node, sep, source);
-			source.append(sep);
-		}
-
-		if (style != null && style.length() != 0) {
-			source.append(",");//$NON-NLS-1$
-			appendSpaceBefore(node, style, source);
-		}
-		source.append(")");//$NON-NLS-1$
-
-		/*
-		 * IStructuredDocument structuredDocument =
-		 * node.getOwnerDocument().getModel().getStructuredDocument();
-		 * ITextRegion[] regions =
-		 * getRegionsWithoutWhiteSpaces(structuredDocument, new
-		 * FormatRegion(context.start, context.end - context.start + 1)); int
-		 * commas[2]; int numComma = 0; for(int j = 0; j <regions.length; j++) {
-		 * if (regions[j].getType() == CSSRegionContexts.COMMA) {
-		 * commas[numComma++] = j; if (numComma > 1) break; } }
-		 * 
-		 * if (ICounter.IDENTIFIER.equalsIgnoreCase(attr.getName())) { } else
-		 * if (ICounter.LISTSTYLE.equalsIgnoreCase(attr.getName())) { } else
-		 * if (ICounter.SEPARATOR.equalsIgnoreCase(attr.getName())) { boolean
-		 * skipSpace = false; String func = insert ? "counters(" : "counter(";
-		 * if (mgr.isPropValueUpperCase()) func = func.toUpperCase();
-		 * 
-		 * for(int i=0; i <regions.length; i++) { if (regions[i].getType() ==
-		 * CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
-		 * source.append(func); else { if (numComma == 2 && commas[1] < i) {
-		 *  } else if (numComma == 1 && commas[0] < i && insert) {
-		 *  } else if (numComma == 1 && commas[0] < i && ! insert) { } else if
-		 * (numComma == 0 && insert && regions[i].getType ==
-		 * CSSRegionContexts.PARENTHESIS_CLOSE) { source.append(",");
-		 * appendSpaceBefore(node,attr.getValue(),source);
-		 * source.append(attr.getValue()); }
-		 * 
-		 * if (i != 0 && !skipSpace)
-		 * appendSpaceBefore(node,regions[i],source);
-		 * source.append(decoratedPropValueRegion(regions[i])); } skipSpace =
-		 * false;
-		 * 
-		 * if (regions[i].getType() ==
-		 * CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) skipSpace = true; } }
-		 */
-		return source;
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, StringBuffer source) {
-		int start = ((IndexedRegion) node).getStartOffset();
-		int end = ((IndexedRegion) node).getEndOffset();
-
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		if (end > 0) { // format source
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			boolean skipSpace = false;
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0 && !skipSpace)
-					appendSpaceBefore(node, regions[i], source);
-				skipSpace = false;
-				source.append(decoratedPropValueRegion(regions[i], stgy));
-				if (regions[i].getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
-					skipSpace = true;
-			}
-		}
-		else { // generate source
-			ICounter counter = (ICounter) node;
-			String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-			String separator = counter.getSeparator();
-			quote = CSSUtil.detectQuote(separator, quote);
-			String sep = (separator == null || separator.length() == 0) ? null : (quote + separator + quote);
-			String ident = counter.getIdentifier();
-			String style = counter.getListStyle();
-			String func = (sep == null || sep.length() == 0) ? "counter(" : "counters(";//$NON-NLS-2$//$NON-NLS-1$
-			// normalize
-			if (ident == null)
-				ident = "";//$NON-NLS-1$
-			if (style == null)
-				style = "";//$NON-NLS-1$
-
-			if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER) {
-				ident = ident.toUpperCase();
-				style = style.toUpperCase();
-				func = func.toUpperCase();
-			}
-			else {
-				ident = ident.toLowerCase();
-				style = style.toLowerCase();
-			}
-			if (sep == null || sep.length() == 0) {
-				source.append(func);
-				appendSpaceBefore(node, ident, source);
-				source.append(ident);
-			}
-			else {
-				source.append(func);
-				appendSpaceBefore(node, ident, source);
-				source.append(ident);
-				source.append(",");//$NON-NLS-1$
-				appendSpaceBefore(node, sep, source);
-				source.append(sep);
-			}
-
-			if (style != null && style.length() != 0) {
-				source.append(",");//$NON-NLS-1$
-				appendSpaceBefore(node, style, source);
-			}
-			source.append(")");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedPropValueRegion(regions[i], stgy));
-		}
-		if (needS(outside[1]) && !isIncludesPreEnd(node, region))
-			appendSpaceBefore(node, outside[1], source);
-	}
-
-	/**
-	 * 
-	 */
-	public int getAttrInsertPos(ICSSNode node, String attrName) {
-		if (node == null || attrName == null || attrName.length() == 0)
-			return -1;
-
-		IndexedRegion iNode = (IndexedRegion) node;
-		if (ICounter.IDENTIFIER.equalsIgnoreCase(attrName)) {
-			ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICounter.IDENTIFIER);
-			if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
-				return ((IndexedRegion) attr).getStartOffset();
-			if (iNode.getEndOffset() <= 0)
-				return -1;
-
-			IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(iNode.getEndOffset() - 1);
-			RegionIterator it = new RegionIterator(flatNode, flatNode.getRegionAtCharacterOffset(iNode.getEndOffset() - 1));
-			while (it.hasPrev()) {
-				ITextRegion region = it.prev();
-				if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
-					return it.getStructuredDocumentRegion().getEndOffset(region);
-			}
-			return ((IndexedRegion) node).getEndOffset();
-		}
-		else if (ICounter.LISTSTYLE.equalsIgnoreCase(attrName)) {
-			ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICounter.LISTSTYLE);
-			if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
-				return ((IndexedRegion) attr).getStartOffset();
-
-			IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(iNode.getEndOffset() - 1);
-			RegionIterator it = new RegionIterator(flatNode, flatNode.getRegionAtCharacterOffset(iNode.getEndOffset() - 1));
-			while (it.hasPrev()) {
-				ITextRegion region = it.prev();
-				if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR)
-					return it.getStructuredDocumentRegion().getEndOffset(region);
-				else if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
-					return it.getStructuredDocumentRegion().getEndOffset(region);
-			}
-			return ((IndexedRegion) node).getEndOffset();
-		}
-		else if (ICounter.SEPARATOR.equalsIgnoreCase(attrName)) {
-			ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICounter.SEPARATOR);
-			if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
-				return ((IndexedRegion) attr).getStartOffset();
-
-			IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(iNode.getEndOffset() - 1);
-			RegionIterator it = new RegionIterator(flatNode, flatNode.getRegionAtCharacterOffset(iNode.getEndOffset() - 1));
-			boolean hasComma = false;
-			while (it.hasPrev()) {
-				ITextRegion region = it.prev();
-				if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR) {
-					if (!hasComma)
-						hasComma = true;
-					else
-						return it.getStructuredDocumentRegion().getEndOffset(region);
-				}
-				else if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
-					return it.getStructuredDocumentRegion().getEndOffset(region);
-			}
-			return ((IndexedRegion) node).getEndOffset();
-		}
-		else
-			return -1;
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static CounterFormatter getInstance() {
-		if (instance == null)
-			instance = new CounterFormatter();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DeclContainerFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DeclContainerFormatter.java
deleted file mode 100644
index 7fff44b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DeclContainerFormatter.java
+++ /dev/null
@@ -1,114 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-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;
-
-
-/**
- * 
- */
-public class DeclContainerFormatter extends DefaultCSSSourceFormatter {
-
-	/**
-	 * 
-	 */
-	DeclContainerFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 * @return java.lang.String
-	 */
-	protected String decoratedSelectorRegion(CompoundRegion region, CompoundRegion prevRegion, CSSCleanupStrategy stgy) {
-		String text = region.getText();
-		if (isFormat())
-			return text;
-
-		String type = region.getType();
-		if (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE || type == CSSRegionContexts.CSS_SELECTOR_CLASS || type == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || type == CSSRegionContexts.CSS_SELECTOR_ID || type == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
-			short selCase = stgy.getSelectorTagCase();
-			if (selCase == org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy.UPPER) {
-				return text.toUpperCase();
-			}
-			else if (selCase == org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy.LOWER) {
-				return text.toLowerCase();
-			}
-			return text;
-		}
-
-		return decoratedRegion(region, 0, stgy);
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(ICSSNode node, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		int end = ((IndexedRegion) node).getEndOffset();
-		int start = (node.getLastChild() != null && ((IndexedRegion) node.getLastChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getLastChild()).getEndOffset() : getChildInsertPos(node);
-		if (end > 0 && start < end) { // format source
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				appendDelimBefore(node, regions[i], source);
-				source.append(decoratedRegion(regions[i], 0, stgy));
-			}
-		}
-		else { // generate source
-			String delim = getLineDelimiter(node);
-			source.append(delim);
-			source.append(getIndent(node));
-			source.append("}");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendDelimBefore(node, regions[i], source);
-			source.append(decoratedRegion(regions[i], 0, stgy));
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public int getChildInsertPos(ICSSNode node) {
-		int n = ((IndexedRegion) node).getEndOffset();
-		if (n > 0) {
-			IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
-			if (flatNode.getRegionAtCharacterOffset(n - 1).getType() == CSSRegionContexts.CSS_RBRACE)
-				return n - 1;
-			else
-				return n;
-		}
-		return -1;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java
deleted file mode 100644
index c1aed20..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java
+++ /dev/null
@@ -1,126 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.parser.CSSRegionUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-
-
-/**
- * 
- */
-public class DefaultCSSSourceFormatter extends AbstractCSSSourceFormatter {
-
-	/**
-	 * 
-	 */
-	DefaultCSSSourceFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected void appendSpaceBetween(ICSSNode node, CompoundRegion prev, CompoundRegion next, StringBuffer source) {
-		if (isCleanup() && !getCleanupStrategy(node).isFormatSource())
-			return; // for not formatting case on cleanup action
-
-		// in selector
-		String prevType = prev.getType();
-		String nextType = next.getType();
-		if (CSSRegionUtil.isSelectorBegginingType(prevType) && CSSRegionUtil.isSelectorBegginingType(nextType)) {
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73990
-			// Formatting CSS file splits element.class into element . class
-			if ((prevType == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME && (nextType == CSSRegionContexts.CSS_SELECTOR_CLASS || nextType == CSSRegionContexts.CSS_SELECTOR_ID)) || ((prevType == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || prevType == CSSRegionContexts.CSS_SELECTOR_CLASS) && nextType == CSSRegionContexts.CSS_SELECTOR_PSEUDO)) {
-				// Individually, SELECTOR_ELEMENT_NAME, SELECTOR_CLASS, and SELECTOR_ID can all be beginning types.
-				// But, we should not insert a space in between when SELECTOR_ELEMENT_NAME is followed by SELECTOR_CLASS, or when
-				// SELECTOR_ELEMENT_NAME is followed by SELECTOR_ID.
-				// For example: H1.pastoral and H1#z98y
-				//
-				// Also, space is now not inserted in between when SELECTOR_ELEMENT_NAME is followed by SELECTOR_PSEUDO, or when
-				// SELECTOR_CLASS is followed by SELECTOR_PSEUDO.
-				// For example: P:first-letter and A.external:visited
-			}
-			else
-				appendSpaceBefore(node, next, source);
-			return;
-		}
-
-		if (prevType == CSSRegionContexts.CSS_PAGE || prevType == CSSRegionContexts.CSS_CHARSET || prevType == CSSRegionContexts.CSS_ATKEYWORD || prevType == CSSRegionContexts.CSS_FONT_FACE || prevType == CSSRegionContexts.CSS_IMPORT || prevType == CSSRegionContexts.CSS_MEDIA) {
-			appendSpaceBefore(node, next, source);
-			return;
-		}
-
-		if (prevType == CSSRegionContexts.CSS_UNKNOWN && nextType != CSSRegionContexts.CSS_COMMENT) {
-			if (prev.getEndOffset() != next.getStartOffset()) { // not
-																// sequential
-				appendSpaceBefore(node, next, source);
-			}
-			return;
-		}
-
-		if (prevType == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR || prevType == CSSRegionContexts.CSS_COMMENT || nextType == CSSRegionContexts.CSS_COMMENT || nextType == CSSRegionContexts.CSS_LBRACE || nextType == CSSRegionContexts.CSS_UNKNOWN) {
-			appendSpaceBefore(node, next, source);
-			return;
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(ICSSNode node, StringBuffer source) {
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, StringBuffer source) {
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-	}
-
-	/**
-	 * 
-	 */
-	public int getChildInsertPos(ICSSNode node) {
-		int n = ((IndexedRegion) node).getEndOffset();
-		if (n > 0)
-			return n;
-		return -1;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FontFaceRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FontFaceRuleFormatter.java
deleted file mode 100644
index 65a67d3..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FontFaceRuleFormatter.java
+++ /dev/null
@@ -1,97 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-/**
- * 
- */
-public class FontFaceRuleFormatter extends DeclContainerFormatter {
-
-	public final static java.lang.String FONT_FACE = "@font-face";//$NON-NLS-1$
-	private static FontFaceRuleFormatter instance;
-
-	/**
-	 * 
-	 */
-	FontFaceRuleFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(org.eclipse.wst.css.core.internal.provisional.document.ICSSNode node, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		int start = ((IndexedRegion) node).getStartOffset();
-		int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
-		if (end > 0) {
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0)
-					appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedIdentRegion(regions[i], stgy));
-			}
-		}
-		else {
-			String str = FONT_FACE;
-			if (CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
-				str = FONT_FACE.toUpperCase();
-			source.append(str);
-			appendSpaceBefore(node, "{", source);//$NON-NLS-1$
-			source.append("{");//$NON-NLS-1$
-		}
-		appendDelimBefore(node, null, source);
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedIdentRegion(regions[i], stgy));
-		}
-		if (needS(outside[1])) {
-			if (isIncludesPreEnd(node, region))
-				appendDelimBefore(node, null, source);
-			else
-				appendSpaceBefore(node, outside[1], source);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static FontFaceRuleFormatter getInstance() {
-		if (instance == null)
-			instance = new FontFaceRuleFormatter();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FormatRegion.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FormatRegion.java
deleted file mode 100644
index ff0c9d3..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FormatRegion.java
+++ /dev/null
@@ -1,71 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-
-/**
- * 
- */
-class FormatRegion implements IRegion {
-
-	private int fOffset, fLength;
-
-	/**
-	 * 
-	 */
-	FormatRegion(int offset, int length) {
-		super();
-		set(offset, length);
-	}
-
-	/**
-	 * Returns the length of the region.
-	 * 
-	 * @return the length of the region
-	 */
-	public int getLength() {
-		return fLength;
-	}
-
-	/**
-	 * Returns the offset of the region.
-	 * 
-	 * @return the offset of the region
-	 */
-	public int getOffset() {
-		return fOffset;
-	}
-
-	/**
-	 * 
-	 */
-	void set(int offset, int length) {
-		this.fOffset = offset;
-		this.fLength = length;
-	}
-
-	/**
-	 * 
-	 */
-	void setLength(int newLength) {
-		fLength = newLength;
-	}
-
-	/**
-	 * 
-	 */
-	void setOffset(int newOffset) {
-		fOffset = newOffset;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FunctionFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FunctionFormatter.java
deleted file mode 100644
index 29499ba..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FunctionFormatter.java
+++ /dev/null
@@ -1,184 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-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;
-
-
-/**
- * 
- */
-abstract public class FunctionFormatter extends AbstractCSSSourceFormatter {
-
-	/**
-	 * 
-	 */
-	FunctionFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
-		ICSSNode prev = (child != null) ? child.getPreviousSibling() : node.getLastChild();
-		int start = (prev != null) ? ((IndexedRegion) prev).getEndOffset() : 0;
-		int end = (child != null) ? ((IndexedRegion) child).getStartOffset() : 0;
-		if (start > 0 && start < end) { // format source
-			CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			// get meaning regions
-			CompoundRegion[] regions = null;
-			if (exceptFor == null)
-				regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			else {
-				String pickupType = CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR;
-				if (prev == null || child == null)
-					pickupType = null;
-				regions = getRegions(structuredDocument, new FormatRegion(start, end - start), exceptFor, pickupType);
-			}
-			// extract source
-			for (int i = 0; i < regions.length; i++) {
-				appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedRegion(regions[i], 2, stgy));
-			}
-		} else if (prev != null && child != null) { // generate source between
-			// parameters
-			source.append(",");//$NON-NLS-1$
-		}
-		appendSpaceBefore(node, toAppend, source);
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedRegion(regions[i], 2, stgy));
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(org.eclipse.wst.css.core.internal.provisional.document.ICSSNode node, java.lang.StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		int end = ((IndexedRegion) node).getEndOffset();
-		int start = (node.getLastChild() != null && ((IndexedRegion) node.getLastChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getLastChild()).getEndOffset() : getChildInsertPos(node);
-		if (end > 0 && start < end) { // format source
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedRegion(regions[i], 2, stgy));
-			}
-		} else { // generate source
-			source.append(")");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedRegion(regions[i], 2, stgy));
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, StringBuffer source) {
-		int start = ((IndexedRegion) node).getStartOffset();
-		int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
-
-		if (end > 0) { // format source
-			CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0)
-					appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedPropValueRegion(regions[i], stgy));
-			}
-		} else { // generate source
-			String func = getFunc();
-			if (CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
-				func = func.toUpperCase();
-			source.append(func);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedPropValueRegion(regions[i], stgy));
-		}
-		if (needS(outside[1]) && !isIncludesPreEnd(node, region))
-			appendSpaceBefore(node, outside[1], source);
-	}
-
-	/**
-	 * 
-	 */
-	public int getChildInsertPos(ICSSNode node) {
-		int n = ((IndexedRegion) node).getEndOffset();
-		if (n > 0) {
-			IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
-			if (flatNode.getRegionAtCharacterOffset(n - 1).getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-				return n - 1;
-			return n;
-		}
-		return -1;
-	}
-
-	/**
-	 * 
-	 */
-	protected abstract String getFunc();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/ImportRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/ImportRuleFormatter.java
deleted file mode 100644
index d5d3ef7..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/ImportRuleFormatter.java
+++ /dev/null
@@ -1,339 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- * 
- */
-public class ImportRuleFormatter extends AbstractCSSSourceFormatter {
-
-	public final static java.lang.String IMPORT = "@import";//$NON-NLS-1$
-	private static ImportRuleFormatter instance;
-
-	/**
-	 * 
-	 */
-	ImportRuleFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
-		StringBuffer buf = new StringBuffer();
-		if (node == null || attr == null)
-			return buf;
-
-		if (!ICSSImportRule.HREF.equalsIgnoreCase(attr.getName()))
-			return buf;
-
-		// get region to replace
-		if (context != null && ((IndexedRegion) node).getEndOffset() > 0) {
-			if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0) {
-				IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
-				ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
-				RegionIterator it = new RegionIterator(flatNode, region);
-				it.prev();
-				if (it.hasPrev()) {
-					ITextRegion prev = it.prev();
-					if (prev.getType() == CSSRegionContexts.CSS_S)
-						context.start = it.getStructuredDocumentRegion().getStartOffset(prev);
-					else
-						context.start = it.getStructuredDocumentRegion().getStartOffset(region);
-					it.next();
-				} else
-					context.start = it.getStructuredDocumentRegion().getStartOffset(region);
-				it.next();
-				it.next();
-				if (it.hasNext()) {
-					ITextRegion next = it.next();
-					if (next.getType() == CSSRegionContexts.CSS_S)
-						context.end = it.getStructuredDocumentRegion().getEndOffset(next);
-					else
-						context.end = it.getStructuredDocumentRegion().getEndOffset(region);
-				} else
-					context.end = it.getStructuredDocumentRegion().getEndOffset(region);
-			} else {
-				ICSSNode child = node.getFirstChild();
-				IStructuredDocumentRegion flatNode = null;
-				ITextRegion region = null;
-				if (child == null) {
-					flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
-					region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
-				} else {
-					flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) child).getStartOffset() - 1);
-					region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) child).getStartOffset() - 1);
-				}
-				if (region.getType() == CSSRegionContexts.CSS_S) {
-					context.start = flatNode.getStartOffset(region);
-					context.end = flatNode.getEndOffset(region);
-				} else {
-					context.start = flatNode.getEndOffset();
-					context.end = flatNode.getEndOffset();
-				}
-			}
-		}
-		// generate text
-		if (insert && attr.getValue() != null && attr.getValue().length() > 0) {
-			appendSpaceBefore(node, attr.getValue(), buf);
-			buf.append(attr.getValue());
-			appendSpaceBefore(node, "", buf);//$NON-NLS-1$
-		}
-		return buf;
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
-		// for media-type
-		ICSSNode prev = (child != null) ? child.getPreviousSibling() : node.getLastChild();
-		int start = (prev != null) ? ((IndexedRegion) prev).getEndOffset() : 0;
-		int end = (child != null) ? ((IndexedRegion) child).getStartOffset() : 0;
-		if (start > 0 && start < end) { // format source
-			CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			// get meaning regions
-			CompoundRegion[] regions = null;
-			if (exceptFor == null)
-				regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			else {
-				String pickupType = CSSRegionContexts.CSS_MEDIA_SEPARATOR;
-				if (prev == null || child == null)
-					pickupType = null;
-				regions = getRegions(structuredDocument, new FormatRegion(start, end - start), exceptFor, pickupType);
-			}
-			// extract source
-			for (int i = 0; i < regions.length; i++) {
-				appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedRegion(regions[i], 0, stgy)); // must
-				// be
-				// comments
-			}
-			appendSpaceBefore(node, toAppend, source);
-		} else if (prev != null && child != null) { // generate source : ????
-			source.append(",");//$NON-NLS-1$
-			appendSpaceBefore(node, toAppend, source);
-		} else if (child != null) { // generate source : between 'url()' and
-			// media types
-			appendSpaceBefore(node, toAppend, source);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedRegion(regions[i], 0, stgy)); // must be
-			// comments
-		}
-		if (needS(outside[1])) {
-			if (((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength())
-				appendSpaceBefore(node, toAppend, source);
-			else
-				appendSpaceBefore(node, outside[1], source);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(ICSSNode node, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		int end = ((IndexedRegion) node).getEndOffset();
-		int start = (node.getLastChild() != null && ((IndexedRegion) node.getLastChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getLastChild()).getEndOffset() : getChildInsertPos(node);
-		if (end > 0 && start < end) {
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				appendDelimBefore(node, regions[i], source);
-				source.append(decoratedRegion(regions[i], 0, stgy));
-			}
-		} else {
-			source.append(";"); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if ((i != 0 || needS(outside[0])) && !regions[i].getType().equals(CSSRegionContexts.CSS_DELIMITER))
-				appendDelimBefore(node, regions[i], source);
-			source.append(decoratedRegion(regions[i], 0, stgy));
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, StringBuffer source) {
-		int start = ((IndexedRegion) node).getStartOffset();
-		int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
-
-		if (end > 0) { // format source
-			CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				String str = regions[i].getText();
-				if (regions[i].getType() == CSSRegionContexts.CSS_IMPORT)
-					str = decoratedIdentRegion(regions[i], stgy);
-				else
-					str = decoratedPropValueRegion(regions[i], stgy);
-				if (i != 0)
-					appendSpaceBefore(node, regions[i], source);
-				source.append(str);
-			}
-		} else { // generate source
-			Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
-			String str = IMPORT;
-			if (preferences.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
-				str = IMPORT.toUpperCase();
-			String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-			source.append(str);
-			str = "url(";//$NON-NLS-1$
-			if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
-				str = str.toUpperCase();
-			String href = ((ICSSImportRule) node).getHref();
-			quote = CSSUtil.detectQuote(href, quote);
-			str = str + quote + href + quote + ")";//$NON-NLS-1$
-			appendSpaceBefore(node, str, source);
-			source.append(str);
-		}
-		ICSSNode child = node.getFirstChild();
-		if (child != null && (child instanceof org.w3c.dom.stylesheets.MediaList) && ((org.w3c.dom.stylesheets.MediaList) child).getLength() > 0) {
-			appendSpaceBefore(node, "", source);//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			String str = regions[i].getText();
-			if (regions[i].getType() == CSSRegionContexts.CSS_IMPORT)
-				str = decoratedIdentRegion(regions[i], stgy);
-			else
-				str = decoratedPropValueRegion(regions[i], stgy);
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(str);
-		}
-		if (needS(outside[1]) && !isIncludesPreEnd(node, region))
-			appendSpaceBefore(node, outside[1], source);
-	}
-
-	/**
-	 * 
-	 */
-	public int getAttrInsertPos(ICSSNode node, String attrName) {
-		if (node == null || attrName == null || attrName.length() == 0)
-			return -1;
-
-		if (!ICSSImportRule.HREF.equalsIgnoreCase(attrName))
-			return -1;
-
-		ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICSSImportRule.HREF);
-		if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
-			return ((IndexedRegion) attr).getStartOffset();
-		IndexedRegion iNode = (IndexedRegion) node;
-		if (iNode.getEndOffset() <= 0)
-			return -1;
-
-		FormatRegion formatRegion = null;
-		ICSSNode child = node.getFirstChild();
-		if (child != null && ((IndexedRegion) child).getEndOffset() > 0)
-			formatRegion = new FormatRegion(iNode.getStartOffset(), ((IndexedRegion) child).getStartOffset() - iNode.getStartOffset());
-		else
-			formatRegion = new FormatRegion(iNode.getStartOffset(), iNode.getEndOffset() - iNode.getStartOffset());
-		CompoundRegion regions[] = getRegionsWithoutWhiteSpaces(node.getOwnerDocument().getModel().getStructuredDocument(), formatRegion, getCleanupStrategy(node));
-
-		boolean atrule = false;
-		for (int i = 0; i < regions.length; i++) {
-			if (regions[i].getType() == CSSRegionContexts.CSS_IMPORT) {
-				atrule = true;
-				continue;
-			} else if (!atrule)
-				continue;
-			if (regions[i].getType() != CSSRegionContexts.CSS_COMMENT)
-				return regions[i].getStartOffset();
-		}
-		return (child != null && ((IndexedRegion) child).getEndOffset() > 0) ? ((IndexedRegion) child).getStartOffset() : iNode.getEndOffset();
-	}
-
-	/**
-	 * 
-	 */
-	public int getChildInsertPos(ICSSNode node) {
-		int n = ((IndexedRegion) node).getEndOffset();
-		if (n > 0) {
-			IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
-			if (flatNode.getRegionAtCharacterOffset(n - 1).getType() == CSSRegionContexts.CSS_DELIMITER)
-				return n - 1;
-			return n;
-		}
-		return -1;
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static ImportRuleFormatter getInstance() {
-		if (instance == null)
-			instance = new ImportRuleFormatter();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaListFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaListFormatter.java
deleted file mode 100644
index fa526f2..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaListFormatter.java
+++ /dev/null
@@ -1,211 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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.w3c.dom.stylesheets.MediaList;
-
-
-/**
- * 
- */
-public class MediaListFormatter extends DefaultCSSSourceFormatter {
-
-	private static MediaListFormatter instance;
-
-	/**
-	 * 
-	 */
-	MediaListFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
-		StringBuffer buf = new StringBuffer();
-		if (node == null || attr == null)
-			return buf;
-
-		boolean first = false, last = false;
-		// get region to replace
-		if (context != null && ((IndexedRegion) node).getEndOffset() > 0) {
-			if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0) {
-				IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
-				ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
-				RegionIterator it = new RegionIterator(flatNode, region);
-				it.prev();
-				context.start = it.getStructuredDocumentRegion().getStartOffset(region);
-				while (it.hasPrev()) {
-					ITextRegion prev = it.prev();
-					if (prev.getType() == CSSRegionContexts.CSS_S || prev.getType() == CSSRegionContexts.CSS_MEDIA_SEPARATOR || prev.getType() == CSSRegionContexts.CSS_COMMENT)
-						context.start = it.getStructuredDocumentRegion().getStartOffset(prev);
-					else
-						break;
-				}
-				if (context.start < ((IndexedRegion) node).getStartOffset()) {
-					context.start = ((IndexedRegion) node).getStartOffset();
-					first = true;
-
-				}
-				it.reset(flatNode, region);
-				context.end = it.getStructuredDocumentRegion().getEndOffset(region);
-				while (it.hasNext()) {
-					ITextRegion next = it.next();
-					if (next.getType() == CSSRegionContexts.CSS_S || next.getType() == CSSRegionContexts.CSS_MEDIA_SEPARATOR || next.getType() == CSSRegionContexts.CSS_COMMENT)
-						context.end = it.getStructuredDocumentRegion().getEndOffset(next);
-					else
-						break;
-				}
-				if (((IndexedRegion) node).getEndOffset() < context.end) {
-					context.end = ((IndexedRegion) node).getEndOffset();
-					last = true;
-				}
-			} else {
-				last = true;
-				IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
-				ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
-				RegionIterator it = new RegionIterator(flatNode, region);
-				context.start = it.getStructuredDocumentRegion().getEndOffset(region);
-				context.end = it.getStructuredDocumentRegion().getEndOffset(region);
-				while (it.hasPrev()) {
-					ITextRegion prev = it.prev();
-					if (prev.getType() == CSSRegionContexts.CSS_S || prev.getType() == CSSRegionContexts.CSS_MEDIA_SEPARATOR || prev.getType() == CSSRegionContexts.CSS_COMMENT)
-						context.start = it.getStructuredDocumentRegion().getStartOffset(prev);
-					else
-						break;
-				}
-				if (context.start < ((IndexedRegion) node).getStartOffset()) {
-					context.start = ((IndexedRegion) node).getStartOffset();
-					first = true;
-				}
-			}
-		}
-		// generate text
-		if (insert && attr.getValue() != null && attr.getValue().length() > 0) {
-			if (!first)
-				buf.append(","); //$NON-NLS-1$
-			appendSpaceBefore(node, attr.getValue(), buf);
-			buf.append(attr.getValue());
-			if (!last) {
-				buf.append(","); //$NON-NLS-1$
-				appendSpaceBefore(node, "", buf); //$NON-NLS-1$
-			}
-		} else if (!first && !last) {
-			buf.append(","); //$NON-NLS-1$
-			appendSpaceBefore(node, "", buf); //$NON-NLS-1$
-		}
-		return buf;
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		int start = ((IndexedRegion) node).getStartOffset();
-		int end = ((IndexedRegion) node).getEndOffset();
-
-		if (end > 0) { // format source
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0)
-					appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedIdentRegion(regions[i], stgy));
-			}
-		} else { // generate source
-			MediaList list = (MediaList) node;
-			int n = list.getLength();
-			for (int i = 0; i < n; i++) {
-				String medium = list.item(i);
-				if (CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
-					medium = medium.toUpperCase();
-				else
-					medium = medium.toLowerCase();
-
-				if (i != 0) {
-					source.append(","); //$NON-NLS-1$
-					appendSpaceBefore(node, medium, source);
-				}
-				source.append(medium);
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedIdentRegion(regions[i], stgy));
-		}
-		if (needS(outside[1]) && !isIncludesPreEnd(node, region))
-			appendSpaceBefore(node, outside[1], source);
-	}
-
-	/**
-	 * 
-	 */
-	public int getAttrInsertPos(ICSSNode node, String attrName) {
-		if (node == null || attrName == null || attrName.length() == 0)
-			return -1;
-
-		ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(attrName);
-
-		if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
-			return ((IndexedRegion) attr).getStartOffset();
-		IndexedRegion iNode = (IndexedRegion) node;
-		if (iNode.getEndOffset() <= 0)
-			return -1;
-
-		/*
-		 * ITextRegion regions[] =
-		 * getRegionsWithoutWhiteSpaces(node.getOwnerDocument().getModel().getStructuredDocument(),
-		 * new FormatRegion(iNode.getStartOffset(), iNode.getEndOffset() -
-		 * iNode.getStartOffset() + 1)); for(int i=regions.length - 1; i >= 0;
-		 * i--) { if (regions[i].getType() == CSSRegionContexts.IMPORTANT_SYM)
-		 * return regions[i].getStartOffset(); }
-		 */
-		return iNode.getEndOffset();
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static MediaListFormatter getInstance() {
-		if (instance == null)
-			instance = new MediaListFormatter();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaRuleFormatter.java
deleted file mode 100644
index b752532..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaRuleFormatter.java
+++ /dev/null
@@ -1,383 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- * 
- */
-public class MediaRuleFormatter extends AbstractCSSSourceFormatter {
-
-	public final static java.lang.String MEDIA = "@media";//$NON-NLS-1$
-	private static MediaRuleFormatter instance;
-
-	/**
-	 * 
-	 */
-	MediaRuleFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
-		ICSSNode prev = (child != null) ? child.getPreviousSibling() : node.getLastChild();
-		int start = (prev != null) ? ((IndexedRegion) prev).getEndOffset() : 0;
-		int end = (child != null) ? ((IndexedRegion) child).getStartOffset() : 0;
-		if (start > 0 && start < end) { // source formatting
-			CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			// get meaning regions
-			CompoundRegion[] regions = null;
-			if (exceptFor == null)
-				regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			else {
-				String pickupType = null;
-				if ((prev != null && prev.getNodeType() == ICSSNode.MEDIALIST_NODE) || (prev == null && (child == null || child.getNodeType() != ICSSNode.MEDIALIST_NODE))) {
-					pickupType = CSSRegionContexts.CSS_LBRACE;
-				}
-				regions = getRegions(structuredDocument, new FormatRegion(start, end - start), exceptFor, pickupType);
-			}
-			// extract source
-			if (child != null && child.getNodeType() == ICSSNode.MEDIALIST_NODE) { // between
-				// "@media"
-				// and
-				// mediatype
-				for (int i = 0; i < regions.length; i++) {
-					appendSpaceBefore(node, regions[i], source);
-					source.append(decoratedRegion(regions[i], 0, stgy)); // must
-					// be
-					// comments
-				}
-				appendSpaceBefore(node, toAppend, source);
-			} else if (child != null && (child.getPreviousSibling() == null || child.getPreviousSibling().getNodeType() == ICSSNode.MEDIALIST_NODE)) { // between
-				// mediatype
-				// and
-				// the
-				// first
-				// style
-				// rule
-				for (int i = 0; i < regions.length; i++) {
-					appendSpaceBefore(node, regions[i], source);
-					source.append(decoratedRegion(regions[i], 0, stgy)); // must
-					// be
-					// comments
-				}
-				appendDelimBefore(node, null, source);
-			} else { // between styles
-				for (int i = 0; i < regions.length; i++) {
-					appendDelimBefore(node, regions[i], source);
-					source.append(decoratedRegion(regions[i], 0, stgy)); // must
-					// be
-					// comments
-				}
-				appendDelimBefore(node, null, source);
-			}
-		} else { // source generation
-			if (child == null && prev != null && prev.getNodeType() != ICSSNode.MEDIALIST_NODE) { // after
-				// the
-				// last
-				// style
-				// rule
-				appendDelimBefore(node.getParentNode(), null, source);
-			} else if (child != null && child.getNodeType() == ICSSNode.MEDIALIST_NODE) { // between
-				// "@media"
-				// and
-				// mediatype
-				appendSpaceBefore(node, toAppend, source);
-			} else if (prev != null && prev.getNodeType() == ICSSNode.MEDIALIST_NODE) { // between
-				// mediatype
-				// and
-				// the
-				// first
-				// style
-				// rule
-				appendSpaceBefore(node, "{", source);//$NON-NLS-1$
-				source.append("{");//$NON-NLS-1$
-				if (child != null)
-					appendDelimBefore(node, null, source);
-				else
-					appendDelimBefore(node.getParentNode(), null, source);
-			} else { // normal case
-				appendDelimBefore(node, null, source);
-			}
-		}
-
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		if (child != null && child.getNodeType() == ICSSNode.MEDIALIST_NODE) { // between
-			// "@media"
-			// and
-			// mediatype
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0 || needS(outside[0]))
-					appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedRegion(regions[i], 0, stgy)); // must
-				// be
-				// comments
-			}
-			if (needS(outside[1]) && ((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength()) {
-				appendSpaceBefore(node, toAppend, source);
-			}
-		} else if (child != null && (child.getPreviousSibling() == null || child.getPreviousSibling().getNodeType() == ICSSNode.MEDIALIST_NODE)) { // between
-			// mediatype
-			// and
-			// the
-			// first
-			// style
-			// rule
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0 || needS(outside[0]))
-					appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedRegion(regions[i], 0, stgy)); // must
-				// be
-				// comments
-			}
-			if (needS(outside[1]) && ((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength()) {
-				appendDelimBefore(node, null, source);
-			}
-		} else { // between styles
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0 || needS(outside[0]))
-					appendDelimBefore(node, regions[i], source);
-				source.append(decoratedRegion(regions[i], 0, stgy)); // must
-				// be
-				// comments
-			}
-			if (needS(outside[1]) && ((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength()) {
-				appendDelimBefore(node, null, source);
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(ICSSNode node, StringBuffer source) {
-		int end = ((IndexedRegion) node).getEndOffset();
-		int start = (node.getLastChild() != null && ((IndexedRegion) node.getLastChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getLastChild()).getEndOffset() : getChildInsertPos(node);
-		if (end > 0 && start < end) { // source formatting
-			CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			if (node.getLastChild() == null || node.getLastChild().getNodeType() != ICSSNode.MEDIALIST_NODE) {
-				for (int i = 0; i < regions.length; i++) {
-					appendDelimBefore(node, regions[i], source);
-					source.append(decoratedRegion(regions[i], 0, stgy));
-				}
-			} else {
-				boolean bInCurlyBrace = false;
-				for (int i = 0; i < regions.length; i++) {
-					if (!bInCurlyBrace)
-						appendSpaceBefore(node, regions[i], source);
-					else
-						appendDelimBefore(node, regions[i], source);
-					source.append(decoratedRegion(regions[i], 0, stgy));
-					if (regions[i].getType() == CSSRegionContexts.CSS_LBRACE)
-						bInCurlyBrace = true;
-				}
-			}
-		} else { // source generation
-			String delim = getLineDelimiter(node);
-			if (node.getLastChild() != null && node.getLastChild().getNodeType() == ICSSNode.MEDIALIST_NODE) {
-				appendSpaceBefore(node, "{", source);//$NON-NLS-1$
-				source.append("{");//$NON-NLS-1$
-			}
-
-			source.append(delim);
-			source.append(getIndent(node));
-			source.append("}");//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendDelimBefore(node, regions[i], source);
-			source.append(decoratedRegion(regions[i], 0, stgy));
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, StringBuffer source) {
-		int start = ((IndexedRegion) node).getStartOffset();
-		int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
-
-		if (end > 0) { // source formatting
-			CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0)
-					appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedIdentRegion(regions[i], stgy));
-			}
-		} else { // source generation
-			String str = MEDIA;
-			if (CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
-				str = MEDIA.toUpperCase();
-			source.append(str);
-		}
-		ICSSNode child = node.getFirstChild();
-		if (child != null && (child instanceof org.w3c.dom.stylesheets.MediaList) && ((org.w3c.dom.stylesheets.MediaList) child).getLength() > 0) {
-			appendSpaceBefore(node, "", source);//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedIdentRegion(regions[i], stgy));
-		}
-		if (needS(outside[1]) && !isIncludesPreEnd(node, region))
-			appendSpaceBefore(node, outside[1], source);
-	}
-
-	/**
-	 * 
-	 */
-	public int getChildInsertPos(ICSSNode node) {
-		int n = ((IndexedRegion) node).getEndOffset();
-		if (n > 0) {
-			IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
-			if (flatNode.getRegionAtCharacterOffset(n - 1).getType() == CSSRegionContexts.CSS_LBRACE)
-				return n - 1;
-			return n;
-		}
-		return -1;
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static MediaRuleFormatter getInstance() {
-		if (instance == null)
-			instance = new MediaRuleFormatter();
-		return instance;
-	}
-
-	/**
-	 * 
-	 * @return int
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param insertPos
-	 *            int
-	 */
-	public int getLengthToReformatAfter(ICSSNode node, int insertPos) {
-		if (node == null)
-			return 0;
-		IndexedRegion nnode = (IndexedRegion) node;
-		if (insertPos <= 0 || !nnode.contains(insertPos - 1))
-			return 0;
-
-		if (node.getFirstChild().getNextSibling() == node.getLastChild()) { // inserted
-			// first
-			// style
-			// rule
-			IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(insertPos);
-			if (flatNode == null)
-				return 0;
-			ITextRegion region = flatNode.getRegionAtCharacterOffset(insertPos);
-			if (region == null)
-				return 0;
-			RegionIterator it = new RegionIterator(flatNode, region);
-			while (it.hasNext()) {
-				region = it.next();
-				if (region.getType() == CSSRegionContexts.CSS_LBRACE)
-					break;
-				if (nnode.getEndOffset() <= it.getStructuredDocumentRegion().getEndOffset(region))
-					break;
-			}
-			int pos = it.getStructuredDocumentRegion().getStartOffset(region) - insertPos;
-			return (pos >= 0) ? pos : 0;
-
-		}
-		return super.getLengthToReformatAfter(node, insertPos);
-	}
-
-	/**
-	 * 
-	 * @return int
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param insertPos
-	 *            int
-	 */
-	public int getLengthToReformatBefore(ICSSNode node, int insertPos) {
-		if (node == null)
-			return 0;
-		IndexedRegion nnode = (IndexedRegion) node;
-		if (insertPos <= 0 || !nnode.contains(insertPos - 1))
-			return 0;
-
-		if (node.getFirstChild().getNextSibling() == node.getLastChild()) { // inserted
-			// first
-			// style
-			// rule
-			int pos = ((IndexedRegion) node.getFirstChild()).getEndOffset();
-			if (pos <= 0)
-				pos = ((IndexedRegion) node).getStartOffset() + 6 /*
-																	 * length
-																	 * of
-																	 * "@media"
-																	 */;
-			return insertPos - pos;
-		}
-		return super.getLengthToReformatBefore(node, insertPos);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PageRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PageRuleFormatter.java
deleted file mode 100644
index 63de94e..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PageRuleFormatter.java
+++ /dev/null
@@ -1,194 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- * 
- */
-public class PageRuleFormatter extends DeclContainerFormatter {
-
-	public final static java.lang.String PAGE = "@page";//$NON-NLS-1$
-	private static PageRuleFormatter instance;
-
-	/**
-	 * 
-	 */
-	PageRuleFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
-		StringBuffer buf = new StringBuffer();
-		if (node == null || attr == null)
-			return buf;
-
-		if (!ICSSPageRule.SELECTOR.equalsIgnoreCase(attr.getName()))
-			return buf;
-
-		// get region to replace
-		if (context != null && ((IndexedRegion) node).getEndOffset() > 0) {
-			if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0) {
-				IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) attr).getEndOffset() - 1);
-				ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) attr).getEndOffset() - 1);
-				RegionIterator it = new RegionIterator(flatNode, region);
-				it.next();
-				if (it.hasNext()) {
-					ITextRegion next = it.next();
-					if (next.getType() == CSSRegionContexts.CSS_S)
-						context.end = it.getStructuredDocumentRegion().getEndOffset(next);
-					else
-						context.end = it.getStructuredDocumentRegion().getEndOffset(region);
-				}
-				else
-					context.end = it.getStructuredDocumentRegion().getEndOffset(region);
-				context.start = it.getStructuredDocumentRegion().getStartOffset(region);
-			}
-			else {
-				int pos = getAttrInsertPos(node, attr.getName());
-				context.start = pos;
-				context.end = pos;
-				/*
-				 * IStructuredDocumentRegion flatNode =
-				 * node.getOwnerDocument().getModel().getStructuredDocument().getNodeAtCharacterOffset(((IndexedRegion)node).getStartOffset());
-				 * ITextRegion region =
-				 * flatNode.getRegionAtCharacterOffset(((IndexedRegion)node).getStartOffset());
-				 * if (region.getType() == CSSRegionContexts.S) {
-				 * context.start = region.getStartOffset(); context.end =
-				 * region.getEndOffset(); } else { context.start =
-				 * flatNode.getEndOffset() + 1; context.end =
-				 * flatNode.getEndOffset(); }
-				 */}
-		}
-		// generate text
-		if (insert) {
-			String val = attr.getValue();
-			if (val != null && val.length() > 0) {
-				buf.append(val);
-				appendSpaceBefore(node, "", buf);//$NON-NLS-1$
-			}
-		}
-		return buf;
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		int start = ((IndexedRegion) node).getStartOffset();
-		int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
-
-		if (end > 0) { // format source
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0)
-					appendSpaceBetween(node, regions[i - 1], regions[i], source);
-				source.append(decoratedIdentRegion(regions[i], stgy));
-			}
-		}
-		else { // generate source
-			String str = PAGE;
-			if (CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
-				str = PAGE.toUpperCase();
-			source.append(str);
-			str = ((ICSSPageRule) node).getSelectorText();
-			if (str != null && str.length() > 0) {
-				appendSpaceBefore(node, str, source);
-				source.append(str);
-			}
-			appendSpaceBefore(node, "{", source);//$NON-NLS-1$
-			source.append("{");//$NON-NLS-1$
-		}
-		appendDelimBefore(node, null, source);
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBetween(node, (i == 0) ? outside[0] : regions[i - 1], regions[i], source);
-			source.append(decoratedIdentRegion(regions[i], stgy));
-		}
-		if (needS(outside[1])) {
-			if (isIncludesPreEnd(node, region))
-				appendDelimBefore(node, null, source);
-			else
-				appendSpaceBetween(node, regions[regions.length - 1], outside[1], source);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public int getAttrInsertPos(ICSSNode node, String attrName) {
-		if (node == null || attrName == null || attrName.length() == 0)
-			return -1;
-
-		if (!ICSSPageRule.SELECTOR.equalsIgnoreCase(attrName))
-			return -1;
-
-		ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICSSPageRule.SELECTOR);
-		if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
-			return ((IndexedRegion) attr).getStartOffset();
-		else if (((IndexedRegion) node).getEndOffset() > 0) {
-			IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) node).getStartOffset());
-			ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) node).getStartOffset());
-			RegionIterator it = new RegionIterator(flatNode, region);
-			while (it.hasNext()) {
-				region = it.next();
-				if (region.getType() == CSSRegionContexts.CSS_LBRACE) {
-					return it.getStructuredDocumentRegion().getStartOffset(region);
-				}
-				if (it.getStructuredDocumentRegion().getEndOffset(region) >= ((IndexedRegion) node).getEndOffset())
-					break;
-			}
-		}
-		return ((IndexedRegion) node).getStartOffset();
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static PageRuleFormatter getInstance() {
-		if (instance == null)
-			instance = new PageRuleFormatter();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PrimitiveValueFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PrimitiveValueFormatter.java
deleted file mode 100644
index 1855e9d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PrimitiveValueFormatter.java
+++ /dev/null
@@ -1,273 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-
-/**
- * 
- */
-public class PrimitiveValueFormatter extends DefaultCSSSourceFormatter {
-
-	private static PrimitiveValueFormatter instance;
-
-	/**
-	 * 
-	 */
-	PrimitiveValueFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, StringBuffer source) {
-		int start = ((IndexedRegion) node).getStartOffset();
-		int end = ((IndexedRegion) node).getEndOffset();
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		if (end > 0) { // format source
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			boolean appendQuote = regions.length > 1 && node.getParentNode() instanceof ICSSStyleDeclItem && isCleanup() && getCleanupStrategy(node).isQuoteValues() && (((ICSSStyleDeclItem) node.getParentNode()).getPropertyName().equals(PropCMProperty.P_FONT) || ((ICSSStyleDeclItem) node.getParentNode()).getPropertyName().equals(PropCMProperty.P_FONT_FAMILY) || ((ICSSStyleDeclItem) node.getParentNode()).getPropertyName().equals(PropCMProperty.P_VOICE_FAMILY));
-			String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-
-			StringBuffer strBuf = new StringBuffer();
-			boolean skipSpace = false;
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0 && !skipSpace)
-					appendSpaceBefore(node, regions[i], strBuf);
-				skipSpace = false;
-				strBuf.append(decoratedPropValueRegion(regions[i], stgy));
-				if (regions[i].getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
-					skipSpace = true;
-			}
-
-			if (appendQuote) {
-				source.append(quote);
-				String str = strBuf.toString();
-				str = str.replace('\'', ' ');
-				str = str.replace('\"', ' ');
-				str = str.trim();
-				source.append(str);
-				source.append(quote);
-			}
-			else {
-				source.append(strBuf);
-			}
-		}
-		else { // generate source
-			ICSSPrimitiveValue value = (ICSSPrimitiveValue) node;
-			short type = value.getPrimitiveType();
-			String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-
-			String str = null;
-			switch (type) {
-				case CSSPrimitiveValue.CSS_NUMBER :
-				case CSSPrimitiveValue.CSS_PERCENTAGE :
-				case CSSPrimitiveValue.CSS_EMS :
-				case CSSPrimitiveValue.CSS_EXS :
-				case CSSPrimitiveValue.CSS_PX :
-				case CSSPrimitiveValue.CSS_CM :
-				case CSSPrimitiveValue.CSS_MM :
-				case CSSPrimitiveValue.CSS_IN :
-				case CSSPrimitiveValue.CSS_PT :
-				case CSSPrimitiveValue.CSS_PC :
-				case CSSPrimitiveValue.CSS_DEG :
-				case CSSPrimitiveValue.CSS_RAD :
-				case CSSPrimitiveValue.CSS_GRAD :
-				case CSSPrimitiveValue.CSS_MS :
-				case CSSPrimitiveValue.CSS_S :
-				case CSSPrimitiveValue.CSS_HZ :
-				case CSSPrimitiveValue.CSS_KHZ :
-				case CSSPrimitiveValue.CSS_DIMENSION :
-				case ICSSPrimitiveValue.CSS_INTEGER :
-					if (value.getFloatValue(type) == ((int) value.getFloatValue(type))) {
-						str = Integer.toString((int) value.getFloatValue(type));
-					}
-					else {
-						str = Float.toString(value.getFloatValue(type));
-					}
-					break;
-				case CSSPrimitiveValue.CSS_IDENT :
-				case ICSSPrimitiveValue.CSS_HASH :
-				case ICSSPrimitiveValue.CSS_INHERIT_PRIMITIVE :
-					str = value.getStringValue();
-					if (str != null) {
-						if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
-							str = str.toUpperCase();
-						else
-							str.toLowerCase();
-					}
-					break;
-				case CSSPrimitiveValue.CSS_STRING :
-				case CSSPrimitiveValue.CSS_URI :
-				case CSSPrimitiveValue.CSS_ATTR :
-				case ICSSPrimitiveValue.CSS_URANGE :
-				case ICSSPrimitiveValue.CSS_FORMAT :
-				case ICSSPrimitiveValue.CSS_LOCAL :
-				case ICSSPrimitiveValue.CSS_COMMA :
-				case ICSSPrimitiveValue.CSS_SLASH :
-					str = value.getStringValue();
-			}
-
-			String preStr = null, postStr = null;
-			switch (type) {
-				case CSSPrimitiveValue.CSS_ATTR :
-					preStr = "attr(";//$NON-NLS-1$
-					postStr = ")";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_CM :
-					postStr = "cm";//$NON-NLS-1$
-					break;
-				// case ICSSPrimitiveValue.CSS_COUNTER:
-				case CSSPrimitiveValue.CSS_DEG :
-					postStr = "deg";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_EMS :
-					postStr = "em";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_EXS :
-					postStr = "ex";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_GRAD :
-					postStr = "grad";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_HZ :
-					postStr = "Hz";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_IN :
-					postStr = "in";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_KHZ :
-					postStr = "kHz";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_MM :
-					postStr = "mm";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_MS :
-					postStr = "ms";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_PC :
-					postStr = "pc";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_PERCENTAGE :
-					postStr = "%";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_PT :
-					postStr = "pt";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_PX :
-					postStr = "px";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_RAD :
-					postStr = "rad";//$NON-NLS-1$
-					break;
-				// case ICSSPrimitiveValue.CSS_RECT:
-				// case ICSSPrimitiveValue.CSS_RGBCOLOR:
-				case CSSPrimitiveValue.CSS_S :
-					postStr = "s";//$NON-NLS-1$
-					break;
-				case CSSPrimitiveValue.CSS_STRING :
-					quote = CSSUtil.detectQuote(str, quote);
-					preStr = quote;
-					postStr = quote;
-					break;
-				case CSSPrimitiveValue.CSS_URI :
-					quote = CSSUtil.detectQuote(str, quote);
-					preStr = "url(" + quote;//$NON-NLS-1$
-					postStr = quote + ")";//$NON-NLS-1$
-					break;
-				// the followings are original primitive values
-				case CSSPrimitiveValue.CSS_IDENT :
-				case CSSPrimitiveValue.CSS_UNKNOWN :
-				// use str
-				case ICSSPrimitiveValue.CSS_INTEGER :
-				case ICSSPrimitiveValue.CSS_HASH :
-				case ICSSPrimitiveValue.CSS_SLASH :
-				case ICSSPrimitiveValue.CSS_COMMA :
-				case CSSPrimitiveValue.CSS_DIMENSION :
-				case CSSPrimitiveValue.CSS_NUMBER :
-				case ICSSPrimitiveValue.CSS_INHERIT_PRIMITIVE :
-					break;
-				case ICSSPrimitiveValue.CSS_URANGE :
-					preStr = "U+";//$NON-NLS-1$
-					break;
-				case ICSSPrimitiveValue.CSS_FORMAT :
-					quote = CSSUtil.detectQuote(str, quote);
-					preStr = "format(" + quote;//$NON-NLS-1$
-					postStr = quote + ")";//$NON-NLS-1$
-					break;
-				case ICSSPrimitiveValue.CSS_LOCAL :
-					quote = CSSUtil.detectQuote(str, quote);
-					preStr = "local(" + quote;//$NON-NLS-1$
-					postStr = quote + ")";//$NON-NLS-1$
-					break;
-			}
-			if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER) {
-				if (preStr != null)
-					preStr = preStr.toUpperCase();
-				if (postStr != null)
-					postStr = postStr.toUpperCase();
-			}
-			if (preStr != null)
-				source.append(preStr);
-			if (str != null)
-				source.append(str);
-			if (postStr != null)
-				source.append(postStr);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedPropValueRegion(regions[i], stgy));
-		}
-		if (needS(outside[1]) && !isIncludesPreEnd(node, region))
-			appendSpaceBefore(node, outside[1], source);
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static PrimitiveValueFormatter getInstance() {
-		if (instance == null)
-			instance = new PrimitiveValueFormatter();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RGBFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RGBFormatter.java
deleted file mode 100644
index a6909db..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RGBFormatter.java
+++ /dev/null
@@ -1,44 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-/**
- * 
- */
-public class RGBFormatter extends FunctionFormatter {
-
-	private static RGBFormatter instance;
-
-	/**
-	 * 
-	 */
-	RGBFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected String getFunc() {
-		return "rgb(";//$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static RGBFormatter getInstance() {
-		if (instance == null)
-			instance = new RGBFormatter();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RectFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RectFormatter.java
deleted file mode 100644
index f3ec832..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RectFormatter.java
+++ /dev/null
@@ -1,44 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-/**
- * 
- */
-public class RectFormatter extends FunctionFormatter {
-
-	private static RectFormatter instance;
-
-	/**
-	 * 
-	 */
-	RectFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected String getFunc() {
-		return "rect(";//$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static RectFormatter getInstance() {
-		if (instance == null)
-			instance = new RectFormatter();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java
deleted file mode 100644
index 64f911e..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java
+++ /dev/null
@@ -1,399 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- * 
- */
-public class StyleDeclItemFormatter extends DefaultCSSSourceFormatter {
-
-	private static StyleDeclItemFormatter instance;
-
-	/**
-	 * 
-	 */
-	StyleDeclItemFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	private void appendAfterColonSpace(ICSSNode node, StringBuffer source) {
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		int n = preferences.getInt(CSSCorePreferenceNames.FORMAT_PROP_POST_DELIM);
-
-		if (preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
-			int length = getLastLineLength(node, source);
-			int append = getFirstChildRegionLength(node);
-			if (length + n + append > preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH)) {
-				source.append(getLineDelimiter(node));
-				source.append(getIndent(node));
-				source.append(getIndentString());
-				n = 0; // no space is necessary
-			}
-		}
-		// no delimiter case
-		while (n-- > 0)
-			source.append(" ");//$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 */
-	private int getFirstChildRegionLength(ICSSNode node) {
-		ICSSNode firstChild = node.getFirstChild();
-		if (firstChild == null)
-			return 1;
-		int start = ((IndexedRegion) firstChild).getStartOffset();
-		RegionIterator itr = new RegionIterator(node.getOwnerDocument().getModel().getStructuredDocument(), start);
-		while (itr.hasNext()) {
-			ITextRegion reg = itr.next();
-			if (reg != null && reg.getType() != CSSRegionContexts.CSS_S)
-				return reg.getTextLength();
-		}
-		return 1;
-	}
-
-	/**
-	 * 
-	 */
-	public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
-		StringBuffer buf = new StringBuffer();
-		if (node == null || attr == null)
-			return buf;
-
-		if (!ICSSStyleDeclItem.IMPORTANT.equalsIgnoreCase(attr.getName()))
-			return buf;
-
-		// get region to replace
-		if (context != null && ((IndexedRegion) node).getEndOffset() > 0) {
-			if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0) {
-				IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
-				ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
-				RegionIterator it = new RegionIterator(flatNode, region);
-				it.prev();
-				if (it.hasPrev()) {
-					ITextRegion prev = it.prev();
-					if (prev.getType() == CSSRegionContexts.CSS_S)
-						context.start = it.getStructuredDocumentRegion().getStartOffset(prev);
-					else
-						context.start = it.getStructuredDocumentRegion().getStartOffset(region);
-				} else
-					context.start = it.getStructuredDocumentRegion().getStartOffset(region);
-				context.end = it.getStructuredDocumentRegion().getEndOffset(region);
-			} else {
-				IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
-				ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
-				if (region.getType() == CSSRegionContexts.CSS_S) {
-					context.start = flatNode.getStartOffset(region);
-					context.end = flatNode.getEndOffset(region);
-				} else {
-					context.start = flatNode.getEndOffset();
-					context.end = flatNode.getEndOffset();
-				}
-			}
-		}
-		// generate text
-		if (insert && attr.getValue() != null && attr.getValue().length() > 0) {
-			appendSpaceBefore(node, attr.getValue(), buf);
-			buf.append(attr.getValue());
-		}
-		return buf;
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
-		ICSSNode prev = (child != null) ? child.getPreviousSibling() : node.getLastChild();
-		int start = (prev != null) ? ((IndexedRegion) prev).getEndOffset() : 0;
-		int end = (child != null) ? ((IndexedRegion) child).getStartOffset() : 0;
-		if (start > 0 && start < end) {
-			CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			// get meaning regions
-			CompoundRegion[] regions = null;
-			if (exceptFor == null)
-				regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			else {
-				regions = getRegions(structuredDocument, new FormatRegion(start, end - start), exceptFor, null);
-			}
-			// generate source
-			for (int i = 0; i < regions.length; i++) {
-				appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedRegion(regions[i], 2, stgy)); // must
-				// be
-				// comments
-			}
-		}
-		if (child != null && child instanceof ICSSPrimitiveValue) {
-			if (((ICSSPrimitiveValue) child).getPrimitiveType() == ICSSPrimitiveValue.CSS_COMMA)
-				toAppend = ",";//$NON-NLS-1$
-			else if (((ICSSPrimitiveValue) child).getPrimitiveType() == ICSSPrimitiveValue.CSS_SLASH)
-				toAppend = "/";//$NON-NLS-1$
-		}
-		if (child != null && toAppend != null && !toAppend.equals(",") && !toAppend.equals("/")) //$NON-NLS-1$ //$NON-NLS-2$
-			appendSpaceBefore(node, toAppend, source);
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedRegion(regions[i], 2, stgy)); // must be
-			// comments
-		}
-		if (needS(outside[1])) {
-			if (((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength()) {
-				if (toAppend != "," && toAppend != "/") //$NON-NLS-1$ //$NON-NLS-2$
-					appendSpaceBefore(node, toAppend, source);
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(ICSSNode node, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		int end = ((IndexedRegion) node).getEndOffset();
-		int start = (node.getLastChild() != null && ((IndexedRegion) node.getLastChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getLastChild()).getEndOffset() : getChildInsertPos(node);
-		if (end > 0 && start < end) { // format source
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedIdentRegion(regions[i], stgy));
-			}
-		} else { // generate source
-			// append "!important"
-			String priority = ((ICSSStyleDeclItem) node).getPriority();
-			if (priority != null && priority.length() > 0) {
-				appendSpaceBefore(node, priority, source);
-				source.append(priority);
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedIdentRegion(regions[i], stgy));
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, StringBuffer source) {
-		int start = ((IndexedRegion) node).getStartOffset();
-		int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		if (end > 0) { // format source
-			CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0)
-					appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedPropNameRegion(regions[i], stgy));
-			}
-		} else { // generatoe source
-			ICSSStyleDeclItem item = (ICSSStyleDeclItem) node;
-			if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER)
-				source.append(item.getPropertyName().toUpperCase());
-			else
-				source.append(item.getPropertyName());
-
-			int k = preferences.getInt(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM);
-			if (preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
-				int length = getLastLineLength(node, source);
-				int append = 1;
-				if (length + k + append > preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH)) {
-					source.append(getLineDelimiter(node));
-					source.append(getIndent(node));
-					source.append(getIndentString());
-					k = 0; // no space is necessary
-				}
-			}
-			// no delimiter case
-			while (k-- > 0)
-				source.append(" ");//$NON-NLS-1$
-			source.append(":");//$NON-NLS-1$
-		}
-		if (!isCleanup() || getCleanupStrategy(node).isFormatSource()) {
-			appendAfterColonSpace(node, source);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedPropNameRegion(regions[i], stgy));
-		}
-		if (needS(outside[1])) {
-			if (isIncludesPreEnd(node, region) && (!isCleanup() || getCleanupStrategy(node).isFormatSource())) {
-				appendAfterColonSpace(node, source);
-			} else
-				appendSpaceBefore(node, outside[1], source);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public StringBuffer formatValue(ICSSNode node) {
-		StringBuffer source = new StringBuffer();
-		formatChildren(node, source);
-
-		return source;
-	}
-
-	/**
-	 * 
-	 */
-	public int getAttrInsertPos(ICSSNode node, String attrName) {
-		if (node == null || attrName == null || attrName.length() == 0)
-			return -1;
-
-		if (!ICSSStyleDeclItem.IMPORTANT.equalsIgnoreCase(attrName))
-			return -1;
-
-		ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICSSStyleDeclItem.IMPORTANT);
-		if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
-			return ((IndexedRegion) attr).getStartOffset();
-		IndexedRegion iNode = (IndexedRegion) node;
-		if (iNode.getEndOffset() <= 0)
-			return -1;
-
-		CompoundRegion regions[] = getRegionsWithoutWhiteSpaces(node.getOwnerDocument().getModel().getStructuredDocument(), new FormatRegion(iNode.getStartOffset(), iNode.getEndOffset() - iNode.getStartOffset()), getCleanupStrategy(node));
-		for (int i = regions.length - 1; i >= 0; i--) {
-			if (regions[i].getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT)
-				return regions[i].getStartOffset();
-		}
-		return iNode.getEndOffset();
-	}
-
-	/**
-	 * 
-	 */
-	public int getChildInsertPos(ICSSNode node) {
-		int n = ((IndexedRegion) node).getEndOffset();
-		if (n < 0) {
-			return -1;
-		}
-		IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
-		if (flatNode != null && flatNode.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-			n -= flatNode.getLength();
-		}
-		if (n > 0) {
-			String important = ((ICSSStyleDeclItem) node).getPriority();
-			if (important != null && important.length() > 0) {
-				// find before "!important" position
-				flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
-				RegionIterator it = new RegionIterator(flatNode, flatNode.getRegionAtCharacterOffset(n - 1));
-				while (it.hasPrev()) {
-					ITextRegion region = it.prev();
-					if (it.getStructuredDocumentRegion() != flatNode)
-						break;
-					if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT)
-						return it.getStructuredDocumentRegion().getStartOffset(region);
-				}
-			}
-			// skip last space
-			flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
-			ITextRegion region = flatNode.getRegionAtCharacterOffset(n - 1);
-			if (region != null) {
-				n -= region.getLength() - region.getTextLength();
-			}
-
-			return n;
-		}
-		return -1;
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static StyleDeclItemFormatter getInstance() {
-		if (instance == null)
-			instance = new StyleDeclItemFormatter();
-		return instance;
-	}
-
-	private String getIndentString() {
-		StringBuffer indent = new StringBuffer();
-
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		if (preferences != null) {
-			char indentChar = ' ';
-			String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
-			if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
-				indentChar = '\t';
-			}
-			int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
-
-			for (int i = 0; i < indentationWidth; i++) {
-				indent.append(indentChar);
-			}
-		}
-		return indent.toString();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclarationFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclarationFormatter.java
deleted file mode 100644
index ad06635..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclarationFormatter.java
+++ /dev/null
@@ -1,249 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-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;
-
-
-/**
- * 
- */
-public class StyleDeclarationFormatter extends DefaultCSSSourceFormatter {
-
-	private static StyleDeclarationFormatter instance;
-
-	/**
-	 * 
-	 */
-	StyleDeclarationFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		ICSSNode prev = (child != null) ? child.getPreviousSibling() : node.getLastChild();
-		int start = (prev != null) ? ((IndexedRegion) prev).getEndOffset() : 0;
-		int end = (child != null) ? ((IndexedRegion) child).getStartOffset() : 0;
-
-		// check no child
-		if (child == null && prev == null)
-			return;
-
-		if (start > 0 && start < end) { // format source
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			// get meaning regions
-			CompoundRegion[] regions = null;
-			if (exceptFor == null)
-				regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			else {
-				String pickupType = CSSRegionContexts.CSS_DECLARATION_DELIMITER;
-				if (prev == null || child == null)
-					pickupType = null;
-				regions = getRegions(structuredDocument, new FormatRegion(start, end - start), exceptFor, pickupType);
-			}
-			// extract source
-			for (int i = 0; i < regions.length; i++) {
-				appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedRegion(regions[i], 0, stgy)); // must
-				// be
-				// comments
-			}
-		} else if (prev != null && child != null) { // generate source :
-			// between two
-			// declarations
-			source.append(";");//$NON-NLS-1$
-		} else if (prev == null) { // generate source : before the first
-			// declaration
-			org.eclipse.wst.css.core.internal.util.RegionIterator it = null;
-			if (end > 0) {
-				IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-				it = new org.eclipse.wst.css.core.internal.util.RegionIterator(structuredDocument, end - 1);
-			} else {
-				int pos = getChildInsertPos(node);
-				if (pos >= 0) {
-					IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-					it = new org.eclipse.wst.css.core.internal.util.RegionIterator(structuredDocument, pos - 1);
-				}
-			}
-			if (it != null) {
-				int limit = ((IndexedRegion) ((node.getParentNode() != null) ? node.getParentNode() : node)).getStartOffset();
-				while (it.hasPrev()) {
-					ITextRegion curReg = it.prev();
-					if (curReg.getType() == CSSRegionContexts.CSS_LBRACE || curReg.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER)
-						break;
-					if (curReg.getType() != CSSRegionContexts.CSS_S && curReg.getType() != CSSRegionContexts.CSS_COMMENT) {
-						source.append(";");//$NON-NLS-1$
-						break;
-					}
-					if (it.getStructuredDocumentRegion().getStartOffset(curReg) <= limit)
-						break;
-				}
-			}
-		} else if (child == null) { // generate source : after the last
-			// declaration
-			org.eclipse.wst.css.core.internal.util.RegionIterator it = null;
-			if (start > 0) {
-				IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-				it = new org.eclipse.wst.css.core.internal.util.RegionIterator(structuredDocument, start);
-			} else {
-				int pos = getChildInsertPos(node);
-				if (pos >= 0) {
-					IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-					it = new org.eclipse.wst.css.core.internal.util.RegionIterator(structuredDocument, pos);
-				}
-			}
-			if (it != null) {
-				int limit = ((IndexedRegion) ((node.getParentNode() != null) ? node.getParentNode() : node)).getEndOffset();
-				while (it.hasNext()) {
-					ITextRegion curReg = it.next();
-					if (curReg.getType() == CSSRegionContexts.CSS_RBRACE || curReg.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER)
-						break;
-					if (curReg.getType() != CSSRegionContexts.CSS_S && curReg.getType() != CSSRegionContexts.CSS_COMMENT) {
-						source.append(";");//$NON-NLS-1$
-						break;
-					}
-					if (limit <= it.getStructuredDocumentRegion().getEndOffset(curReg))
-						break;
-				}
-			}
-		}
-		if (child == null) {
-			if (((IndexedRegion) node).getEndOffset() <= 0) {
-				// get next region
-				int pos = getChildInsertPos(node);
-				CompoundRegion toAppendRegion = null;
-				if (pos >= 0) {
-					IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-					IStructuredDocumentRegion flatNode = structuredDocument.getRegionAtCharacterOffset(pos);
-					toAppendRegion = new CompoundRegion(flatNode, flatNode.getRegionAtCharacterOffset(pos));
-				}
-				appendDelimBefore(node.getParentNode(), toAppendRegion, source);
-			}
-		} else if ((prev != null || ((IndexedRegion) node).getEndOffset() <= 0)) {
-			Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
-			if (preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE) && (node.getOwnerDocument() != node || !preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR)))
-				appendDelimBefore(node, null, source);
-			else if (prev != null || node.getOwnerDocument() != node)
-				appendSpaceBefore(node, toAppend, source);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedRegion(regions[i], 0, stgy)); // must be
-			// comments
-		}
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		if (needS(outside[1])) {
-			if (((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength() && preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE) && (node.getOwnerDocument() != node || !preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR))) {
-				appendDelimBefore(node, null, source);
-			} else
-				appendSpaceBefore(node, toAppend, source);
-		}
-	}
-
-	/**
-	 * Insert the method's description here.
-	 */
-	public int getChildInsertPos(ICSSNode node) {
-		if (node == null)
-			return -1;
-		int pos = super.getChildInsertPos(node);
-		if (pos < 0) {
-			CSSSourceGenerator formatter = getParentFormatter(node);
-			return (formatter != null) ? formatter.getChildInsertPos(node.getParentNode()) : -1;
-		}
-		return pos;
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static StyleDeclarationFormatter getInstance() {
-		if (instance == null)
-			instance = new StyleDeclarationFormatter();
-		return instance;
-	}
-
-	/**
-	 * 
-	 * @return int
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param insertPos
-	 *            int
-	 */
-	public int getLengthToReformatAfter(ICSSNode node, int insertPos) {
-		if (node == null)
-			return 0;
-		IndexedRegion nnode = (IndexedRegion) node;
-		if (insertPos < 0 || !nnode.contains(insertPos)) {
-			if (node.getParentNode() != null && nnode.getEndOffset() <= 0) {
-				CSSSourceGenerator pntFormatter = getParentFormatter(node);
-				if (pntFormatter != null)
-					return pntFormatter.getLengthToReformatAfter(node.getParentNode(), insertPos);
-			}
-			return 0;
-		}
-		return super.getLengthToReformatAfter(node, insertPos);
-	}
-
-	/**
-	 * 
-	 * @return int
-	 * @param node
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param insertPos
-	 *            int
-	 */
-	public int getLengthToReformatBefore(ICSSNode node, int insertPos) {
-		if (node == null)
-			return 0;
-		IndexedRegion nnode = (IndexedRegion) node;
-		if (insertPos <= 0 || !nnode.contains(insertPos - 1)) {
-			if (node.getParentNode() != null && nnode.getEndOffset() <= 0) {
-				CSSSourceGenerator pntFormatter = getParentFormatter(node);
-				if (pntFormatter != null)
-					return pntFormatter.getLengthToReformatBefore(node.getParentNode(), insertPos);
-			}
-			return 0;
-		}
-		return super.getLengthToReformatBefore(node, insertPos);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleRuleFormatter.java
deleted file mode 100644
index ce9356d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleRuleFormatter.java
+++ /dev/null
@@ -1,166 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- * 
- */
-public class StyleRuleFormatter extends DeclContainerFormatter {
-
-	private static StyleRuleFormatter instance;
-
-	/**
-	 * 
-	 */
-	StyleRuleFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
-		StringBuffer buf = new StringBuffer();
-		if (node == null || attr == null)
-			return buf;
-
-		if (!ICSSStyleRule.SELECTOR.equalsIgnoreCase(attr.getName()))
-			return buf;
-
-		// get region to replace
-		if (context != null && ((IndexedRegion) node).getEndOffset() > 0) {
-			if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0) {
-				IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) attr).getEndOffset() - 1);
-				ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) attr).getEndOffset() - 1);
-				RegionIterator it = new RegionIterator(flatNode, region);
-				it.next();
-				if (it.hasNext()) {
-					ITextRegion next = it.next();
-					if (next.getType() == CSSRegionContexts.CSS_S)
-						context.end = it.getStructuredDocumentRegion().getEndOffset(next);
-					else
-						context.end = it.getStructuredDocumentRegion().getEndOffset(region);
-				}
-				else
-					context.end = it.getStructuredDocumentRegion().getEndOffset(region);
-				context.start = it.getStructuredDocumentRegion().getStartOffset(region);
-			}
-			else {
-				IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) node).getStartOffset());
-				ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) node).getStartOffset());
-				if (region.getType() == CSSRegionContexts.CSS_S) {
-					context.start = flatNode.getStartOffset(region);
-					context.end = flatNode.getEndOffset(region);
-				}
-				else {
-					context.start = flatNode.getEndOffset();
-					context.end = flatNode.getEndOffset();
-				}
-			}
-		}
-		// generate text
-		if (insert) {
-			buf.append(attr.getValue());
-			appendSpaceBefore(node, "", buf);//$NON-NLS-1$
-		}
-		return buf;
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		int start = ((IndexedRegion) node).getStartOffset();
-		int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
-		if (end > 0) { // format source
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0)
-					appendSpaceBetween(node, regions[i - 1], regions[i], source);
-				source.append(decoratedSelectorRegion(regions[i], (i != 0) ? regions[i - 1] : null, stgy));
-			}
-		}
-		else { // generate source
-			String str = ((ICSSStyleRule) node).getSelectorText();
-			// appendSpaceBefore(node,str,source);
-			source.append(str);
-			appendSpaceBefore(node, "{", source);//$NON-NLS-1$
-			source.append("{");//$NON-NLS-1$
-		}
-		appendDelimBefore(node, null, source);
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBetween(node, (i == 0) ? outside[0] : regions[i - 1], regions[i], source);
-			source.append(decoratedSelectorRegion(regions[i], (i != 0) ? regions[i - 1] : null, stgy));
-		}
-		if (needS(outside[1])) {
-			if (isIncludesPreEnd(node, region))
-				appendDelimBefore(node, null, source);
-			else
-				appendSpaceBetween(node, regions[regions.length - 1], outside[1], source);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public int getAttrInsertPos(ICSSNode node, String attrName) {
-		if (node == null || attrName == null || attrName.length() == 0)
-			return -1;
-
-		if (!ICSSStyleRule.SELECTOR.equalsIgnoreCase(attrName))
-			return -1;
-
-		ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICSSStyleRule.SELECTOR);
-		if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
-			return ((IndexedRegion) attr).getStartOffset();
-		else
-			return ((IndexedRegion) node).getStartOffset();
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static StyleRuleFormatter getInstance() {
-		if (instance == null)
-			instance = new StyleRuleFormatter();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleSheetFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleSheetFormatter.java
deleted file mode 100644
index 5bc1984..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleSheetFormatter.java
+++ /dev/null
@@ -1,260 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- * 
- */
-public class StyleSheetFormatter extends AbstractCSSSourceFormatter {
-
-	private static StyleSheetFormatter instance;
-
-	/**
-	 * 
-	 */
-	StyleSheetFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
-		String delim = getLineDelimiter(node);
-		ICSSNode prev = (child != null) ? child.getPreviousSibling() : node.getLastChild();
-		if (prev == null && child == null)
-			return;
-		int start = (prev != null) ? ((IndexedRegion) prev).getEndOffset() : 0;
-		int end = (child != null) ? ((IndexedRegion) child).getStartOffset() : 0;
-		if (start > 0 && start < end) {
-			CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			// get meaning regions
-			CompoundRegion[] regions = null;
-			if (exceptFor == null)
-				regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			else {
-				String pickupType = CSSRegionContexts.CSS_DELIMITER;
-				if (prev == null)
-					pickupType = null;
-				regions = getRegions(structuredDocument, new FormatRegion(start, end - start), exceptFor, pickupType);
-			}
-			// generate source
-			if (prev != null) {
-				appendDelimBefore(node, (regions.length > 0) ? regions[0] : null, source);
-			}
-			for (int i = 0; i < regions.length; i++) {
-				appendDelimBefore(node, regions[i], source);
-				source.append(decoratedRegion(regions[i], 0, stgy)); // must
-																		// be
-																		// comments
-																		// or
-																		// semi_colon
-				if (regions[i].getType() == CSSRegionContexts.CSS_DELIMITER) {
-					// append delim after
-					appendDelimBefore(node, null, source);
-				}
-			}
-			if (prev != null)
-				appendDelimBefore(node, null, source);
-		}
-		else if (prev != null && child != null) { // source generation :
-													// between two rules
-			source.append(delim);
-			source.append(delim);
-		}
-		else if (((IndexedRegion) node).getEndOffset() > 0) {
-			if (prev == null) { // source formatting : before the first rule
-				ICSSNode next = child.getNextSibling();
-				int pos = getChildInsertPos(node);
-				if (next != null && ((IndexedRegion) next).getEndOffset() > 0)
-					pos = ((IndexedRegion) next).getStartOffset();
-				if (pos != 0) {
-					IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-					CompoundRegion[] prevRegions = getRegions(structuredDocument, new FormatRegion(0, pos), null, null);
-					if (prevRegions != null && prevRegions.length > 0)
-						appendDelimBefore(node, null, source);
-				}
-			}
-			else if (child == null) { // source formatting : after the last
-										// rule
-				if (start > 0 && start <= ((IndexedRegion) node).getEndOffset()) {
-					appendDelimBefore(node, null, source);
-				}
-				else if (start <= 0) {
-					int pos = getChildInsertPos(node);
-					if (pos < ((IndexedRegion) node).getEndOffset()) {
-						appendDelimBefore(node, null, source);
-					}
-				}
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendDelimBefore(node, regions[i], source);
-			source.append(decoratedRegion(regions[i], 0, stgy)); // must be
-																	// comments
-		}
-		if (needS(outside[1])) {
-			if (((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength())
-				appendDelimBefore(node, null, source);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(ICSSNode node, StringBuffer source) {
-		int end = ((IndexedRegion) node).getEndOffset();
-		int start = (node.getLastChild() != null && ((IndexedRegion) node.getLastChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getLastChild()).getEndOffset() : getChildInsertPos(node);
-		if (end > 0 && start < end) {
-			CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				appendDelimBefore(node, regions[i], source);
-				source.append(decoratedRegion(regions[i], 0, stgy));
-			}
-			if ((regions != null && regions.length > 0 && regions[regions.length - 1].getType() == CSSRegionContexts.CSS_CDC) || node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED)
-				appendDelimBefore(node, null, source);
-		}
-		else { // source generation
-			if (node.getOwnerDocument().getModel() != null && node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED)
-				appendDelimBefore(node, null, source);
-			return; // nothing
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendDelimBefore(node, regions[i], source);
-			source.append(decoratedRegion(regions[i], 0, stgy));
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(org.eclipse.wst.css.core.internal.provisional.document.ICSSNode node, java.lang.StringBuffer source) {
-		int start = ((IndexedRegion) node).getStartOffset();
-		int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
-		if (end > 0) {
-			CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0 || regions[i].getType() == CSSRegionContexts.CSS_CDO || node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED)
-					appendDelimBefore(node, regions[i], source);
-				source.append(decoratedRegion(regions[i], 0, stgy));
-			}
-			if (node.getLastChild() != null && (source.length() > 0 || node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED)) {
-				appendDelimBefore(node, null, source);
-			}
-		}
-		else if (node.getOwnerDocument().getModel() != null && node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED) {
-			appendDelimBefore(node, null, source);
-			// source.append("<!--");
-			// appendDelimBefore(node,null, source);
-		}
-		else
-			return; // nothing
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, java.lang.StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]) || regions[i].getType() == CSSRegionContexts.CSS_CDO || node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED)
-				appendDelimBefore(node, regions[i], source);
-			source.append(decoratedRegion(regions[i], 0, stgy));
-		}
-		if (needS(outside[1])) {
-			if (isIncludesPreEnd(node, region)) {
-				if (source.length() > 0 || node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED) {
-					String delim = getLineDelimiter(node);
-					source.append(delim);
-				}
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public int getChildInsertPos(ICSSNode node) {
-		int n = ((IndexedRegion) node).getEndOffset();
-		if (n > 0) {
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			IStructuredDocumentRegion flatNode = structuredDocument.getRegionAtCharacterOffset(n - 1);
-			ITextRegion region = flatNode.getRegionAtCharacterOffset(n - 1);
-			RegionIterator it = new RegionIterator(flatNode, region);
-			while (it.hasPrev()) {
-				ITextRegion reg = it.prev();
-				if (reg.getType() == CSSRegionContexts.CSS_CDC)
-					return it.getStructuredDocumentRegion().getStartOffset(reg);
-			}
-			return n;
-		}
-		return -1;
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static StyleSheetFormatter getInstance() {
-		if (instance == null)
-			instance = new StyleSheetFormatter();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/UnknownRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/UnknownRuleFormatter.java
deleted file mode 100644
index 406a408..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/UnknownRuleFormatter.java
+++ /dev/null
@@ -1,86 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.w3c.dom.css.CSSUnknownRule;
-
-
-/**
- * 
- */
-public class UnknownRuleFormatter extends DefaultCSSSourceFormatter {
-
-	private static UnknownRuleFormatter instance;
-
-	/**
-	 * 
-	 */
-	UnknownRuleFormatter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		int start = ((IndexedRegion) node).getStartOffset();
-		int end = ((IndexedRegion) node).getEndOffset();
-		if (end > 0) { // format source
-			IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-			CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-			for (int i = 0; i < regions.length; i++) {
-				if (i != 0)
-					appendSpaceBefore(node, regions[i], source);
-				source.append(decoratedPropValueRegion(regions[i], stgy));
-			}
-		}
-		else { // generate source
-			CSSUnknownRule rule = (CSSUnknownRule) node;
-			source.append(rule.getCssText());
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
-		CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
-		IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
-		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
-		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-		for (int i = 0; i < regions.length; i++) {
-			if (i != 0 || needS(outside[0]))
-				appendSpaceBefore(node, regions[i], source);
-			source.append(decoratedPropValueRegion(regions[i], stgy));
-		}
-		if (needS(outside[1]) && !isIncludesPreEnd(node, region))
-			appendSpaceBefore(node, outside[1], source);
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static UnknownRuleFormatter getInstance() {
-		if (instance == null)
-			instance = new UnknownRuleFormatter();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCategory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCategory.java
deleted file mode 100644
index 6bcd400..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCategory.java
+++ /dev/null
@@ -1,16 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-public interface CSSMMCategory extends CSSMMNode {
-
-	String getCaption();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCharsetRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCharsetRule.java
deleted file mode 100644
index d97fcdc..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCharsetRule.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-public interface CSSMMCharsetRule extends CSSMMNode {
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMContainer.java
deleted file mode 100644
index 0b83713..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMContainer.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-public interface CSSMMContainer extends CSSMMNode {
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMDescriptor.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMDescriptor.java
deleted file mode 100644
index 14ba720..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMDescriptor.java
+++ /dev/null
@@ -1,20 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-import java.util.Iterator;
-
-public interface CSSMMDescriptor extends CSSMMNode {
-
-	Iterator getValues();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFontFaceRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFontFaceRule.java
deleted file mode 100644
index fe45dc2..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFontFaceRule.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-public interface CSSMMFontFaceRule extends CSSMMNode {
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFunction.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFunction.java
deleted file mode 100644
index 22df25d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFunction.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-public interface CSSMMFunction extends CSSMMNode {
-
-	String getFunctionString();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMImportRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMImportRule.java
deleted file mode 100644
index 77fd164..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMImportRule.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-public interface CSSMMImportRule extends CSSMMNode {
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMKeyword.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMKeyword.java
deleted file mode 100644
index 5b45b32..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMKeyword.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-public interface CSSMMKeyword extends CSSMMNode {
-
-	String getKeywordString();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMMediaRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMMediaRule.java
deleted file mode 100644
index b80aa21..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMMediaRule.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-public interface CSSMMMediaRule extends CSSMMNode {
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNode.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNode.java
deleted file mode 100644
index d9ae2ea..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNode.java
+++ /dev/null
@@ -1,51 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-import java.util.Iterator;
-
-public interface CSSMMNode {
-	String getType();
-
-	String getName();
-
-	String getDescription();
-
-	String getAttribute(String name);
-
-	Iterator getChildNodes();
-
-	Iterator getDescendants();
-
-
-	static final String _PREFIX = "CSSMM."; //$NON-NLS-1$
-	static final String TYPE_KEYWORD = _PREFIX + "Keyword"; //$NON-NLS-1$
-	static final String TYPE_UNIT = _PREFIX + "Unit"; //$NON-NLS-1$
-	static final String TYPE_FUNCTION = _PREFIX + "Function"; //$NON-NLS-1$
-	static final String TYPE_STRING = _PREFIX + "String"; //$NON-NLS-1$
-	static final String TYPE_STYLE_SHEET = _PREFIX + "StyleSheet"; //$NON-NLS-1$
-	static final String TYPE_PROPERTY = _PREFIX + "Property"; //$NON-NLS-1$
-	static final String TYPE_DESCRIPTOR = _PREFIX + "Descriptor"; //$NON-NLS-1$
-	static final String TYPE_CONTAINER = _PREFIX + "Container"; //$NON-NLS-1$
-	static final String TYPE_NUMBER = _PREFIX + "Number"; //$NON-NLS-1$
-	static final String TYPE_SEPARATOR = _PREFIX + "Separator"; //$NON-NLS-1$
-	static final String TYPE_CHARSET_RULE = _PREFIX + "CharsetRule"; //$NON-NLS-1$
-	static final String TYPE_IMPORT_RULE = _PREFIX + "ImportRule"; //$NON-NLS-1$
-	static final String TYPE_STYLE_RULE = _PREFIX + "StyleRule"; //$NON-NLS-1$
-	static final String TYPE_MEDIA_RULE = _PREFIX + "MediaRule"; //$NON-NLS-1$
-	static final String TYPE_PAGE_RULE = _PREFIX + "PageRule"; //$NON-NLS-1$
-	static final String TYPE_FONT_FACE_RULE = _PREFIX + "FontFaceRule"; //$NON-NLS-1$
-	static final String TYPE_CATEGORY = _PREFIX + "Category"; //$NON-NLS-1$
-	static final String TYPE_META_MODEL = _PREFIX + "MetaModel"; //$NON-NLS-1$
-	static final String TYPE_SELECTOR = _PREFIX + "Selector"; //$NON-NLS-1$	
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNumber.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNumber.java
deleted file mode 100644
index 2ea1b27..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNumber.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-public interface CSSMMNumber extends CSSMMNode {
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMPageRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMPageRule.java
deleted file mode 100644
index 04f99e9..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMPageRule.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-public interface CSSMMPageRule extends CSSMMNode {
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMProperty.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMProperty.java
deleted file mode 100644
index ec41462..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMProperty.java
+++ /dev/null
@@ -1,22 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-import java.util.Iterator;
-
-public interface CSSMMProperty extends CSSMMNode {
-
-	String getCategoryName();
-
-	Iterator getValues();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMSelector.java
deleted file mode 100644
index d17ac19..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMSelector.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-public interface CSSMMSelector extends CSSMMNode {
-	String getSelectorType();
-
-	String getSelectorString();
-
-
-	static final String TYPE_EXPRESSION = "Expression"; //$NON-NLS-1$
-	static final String TYPE_PSEUDO_CLASS = "PseudoClass"; //$NON-NLS-1$
-	static final String TYPE_PSEUDO_ELEMENT = "PseudoElement"; //$NON-NLS-1$
-
-	// embedded expression type
-	static final String EXPRESSION_DESCENDANT = "descendant"; //$NON-NLS-1$
-	static final String EXPRESSION_CHILD = "child"; //$NON-NLS-1$
-	static final String EXPRESSION_ADJACENT = "adjacent"; //$NON-NLS-1$
-	static final String EXPRESSION_UNIVERSAL = "universal"; //$NON-NLS-1$
-	static final String EXPRESSION_ATTRIBUTE = "attribute"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMString.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMString.java
deleted file mode 100644
index c9ddf8d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMString.java
+++ /dev/null
@@ -1,17 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-public interface CSSMMString extends CSSMMNode {
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleRule.java
deleted file mode 100644
index 80414fa..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleRule.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-public interface CSSMMStyleRule extends CSSMMNode {
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleSheet.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleSheet.java
deleted file mode 100644
index 40dc67b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleSheet.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-public interface CSSMMStyleSheet extends CSSMMNode {
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMUnit.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMUnit.java
deleted file mode 100644
index 52910c6..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMUnit.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-public interface CSSMMUnit extends CSSMMNode {
-
-	String getUnitString();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMetaModel.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMetaModel.java
deleted file mode 100644
index f80c260..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMetaModel.java
+++ /dev/null
@@ -1,37 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-import java.util.Iterator;
-
-public interface CSSMetaModel extends CSSMMNode {
-
-	// public interface CSSMetaModel {
-	CSSMMStyleSheet getStyleSheet();
-
-	/*
-	 * Shortcut to access property node
-	 */
-	// Iterator getProperties();
-	// Iterator getDescriptors();
-	// CSSMMProperty getProperty(String propertyName);
-	/*
-	 * access to category information
-	 */
-	Iterator getCategories();
-
-	/*
-	 * Utilities
-	 */
-	// Iterator collectNodesByType(String type);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfile.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfile.java
deleted file mode 100644
index 1d5fb89..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfile.java
+++ /dev/null
@@ -1,31 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-import java.net.URL;
-
-
-public interface CSSProfile {
-
-	String getProfileID();
-
-	String getProfileName();
-
-	URL getProfileURL();
-
-	CSSMetaModel getMetaModel();
-
-	boolean isDefault();
-
-	String getOwnerPluginID();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileRegistry.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileRegistry.java
deleted file mode 100644
index 122b4cb..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileRegistry.java
+++ /dev/null
@@ -1,69 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel;
-
-
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.wst.css.core.internal.metamodelimpl.RegistryReader;
-
-
-
-public class CSSProfileRegistry {
-	public synchronized static CSSProfileRegistry getInstance() {
-		if (fInstance == null) {
-			fInstance = new CSSProfileRegistry();
-		}
-		return fInstance;
-	}
-
-	public Iterator getProfiles() {
-		return Collections.unmodifiableCollection(fProfiles.values()).iterator();
-	}
-
-	public CSSProfile getProfile(String profileID) {
-		return (CSSProfile) fProfiles.get(profileID);
-	}
-
-	public CSSProfile getDefaultProfile() {
-		Iterator i = getProfiles();
-		while (i.hasNext()) {
-			CSSProfile profile = (CSSProfile) i.next();
-			if (profile.isDefault()) {
-				return profile;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Constructor for CSSProfileRegistry.
-	 */
-	private CSSProfileRegistry() {
-		super();
-		fProfiles = new HashMap();
-		Iterator i = new RegistryReader().enumProfiles();
-		while (i.hasNext()) {
-			Object profile = i.next();
-			if (profile instanceof CSSProfile) {
-				fProfiles.put(((CSSProfile) profile).getProfileID(), profile);
-			}
-		}
-	}
-
-
-	private static CSSProfileRegistry fInstance = null;
-	private Map fProfiles = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSFunctionID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSFunctionID.java
deleted file mode 100644
index 8fd67b3..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSFunctionID.java
+++ /dev/null
@@ -1,22 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel.util;
-
-public interface CSSFunctionID {
-
-	final static String F_ATTR = "attr"; //$NON-NLS-1$
-	final static String F_COUNTER = "counter"; //$NON-NLS-1$
-	final static String F_RGB = "rgb"; //$NON-NLS-1$
-	final static String F_RECT = "rect"; //$NON-NLS-1$
-	final static String F_URI = "uri"; //$NON-NLS-1$
-	final static String F_FORMAT = "format"; //$NON-NLS-1$
-	final static String F_LOCAL = "local"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSKeywordID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSKeywordID.java
deleted file mode 100644
index 856b36d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSKeywordID.java
+++ /dev/null
@@ -1,261 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel.util;
-
-public interface CSSKeywordID {
-
-	final static String K_100 = "100"; //$NON-NLS-1$
-	final static String K_200 = "200"; //$NON-NLS-1$
-	final static String K_300 = "300"; //$NON-NLS-1$
-	final static String K_400 = "400"; //$NON-NLS-1$
-	final static String K_500 = "500"; //$NON-NLS-1$
-	final static String K_600 = "600"; //$NON-NLS-1$
-	final static String K_700 = "700"; //$NON-NLS-1$
-	final static String K_800 = "800"; //$NON-NLS-1$
-	final static String K_900 = "900"; //$NON-NLS-1$
-	final static String K_ABOVE = "above"; //$NON-NLS-1$
-	final static String K_ABSOLUTE = "absolute"; //$NON-NLS-1$
-	final static String K_ACTIVEBORDER = "ActiveBorder"; //$NON-NLS-1$
-	final static String K_ACTIVECAPTION = "ActiveCaption"; //$NON-NLS-1$
-	final static String K_ALL = "all"; //$NON-NLS-1$
-	final static String K_ALWAYS = "always"; //$NON-NLS-1$
-	final static String K_APPWORKSPACE = "AppWorkspace"; //$NON-NLS-1$
-	final static String K_AQUA = "aqua"; //$NON-NLS-1$
-	final static String K_ARMENIAN = "armenian"; //$NON-NLS-1$
-	final static String K_AUTO = "auto"; //$NON-NLS-1$
-	final static String K_AVOID = "avoid"; //$NON-NLS-1$
-	final static String K_BACKGROUND = "Background"; //$NON-NLS-1$
-	final static String K_BASELINE = "baseline"; //$NON-NLS-1$
-	final static String K_BEHIND = "behind"; //$NON-NLS-1$
-	final static String K_BELOW = "below"; //$NON-NLS-1$
-	final static String K_BIDI_OVERRIDE = "bidi-override"; //$NON-NLS-1$
-	final static String K_BLACK = "black"; //$NON-NLS-1$
-	final static String K_BLINK = "blink"; //$NON-NLS-1$
-	final static String K_BLOCK = "block"; //$NON-NLS-1$
-	final static String K_BLUE = "blue"; //$NON-NLS-1$
-	final static String K_BOLD = "bold"; //$NON-NLS-1$
-	final static String K_BOLDER = "bolder"; //$NON-NLS-1$
-	final static String K_BOTH = "both"; //$NON-NLS-1$
-	final static String K_BOTTOM = "bottom"; //$NON-NLS-1$
-	final static String K_BUTTONFACE = "ButtonFace"; //$NON-NLS-1$
-	final static String K_BUTTONHIGHLIGHT = "ButtonHighlight"; //$NON-NLS-1$
-	final static String K_BUTTONSHADOW = "ButtonShadow"; //$NON-NLS-1$
-	final static String K_BUTTONTEXT = "ButtonText"; //$NON-NLS-1$
-	final static String K_CAPITALIZE = "capitalize"; //$NON-NLS-1$
-	final static String K_CAPTION = "caption"; //$NON-NLS-1$
-	final static String K_CAPTIONTEXT = "CaptionText"; //$NON-NLS-1$
-	final static String K_CENTER = "center"; //$NON-NLS-1$
-	final static String K_CENTER_LEFT = "center-left"; //$NON-NLS-1$
-	final static String K_CENTER_RIGHT = "center-right"; //$NON-NLS-1$
-	final static String K_CHILD = "child"; //$NON-NLS-1$
-	final static String K_CIRCLE = "circle"; //$NON-NLS-1$
-	final static String K_CJK_IDEOGRAPHIC = "cjk-ideographic"; //$NON-NLS-1$
-	final static String K_CLOSE_QUOTE = "close-quote"; //$NON-NLS-1$
-	final static String K_CODE = "code"; //$NON-NLS-1$
-	final static String K_CONDENSED = "condensed"; //$NON-NLS-1$
-	final static String K_COLLAPSE = "collapse"; //$NON-NLS-1$
-	final static String K_COMPACT = "compact"; //$NON-NLS-1$
-	final static String K_CONTINUOUS = "continuous"; //$NON-NLS-1$
-	final static String K_CROP = "crop"; //$NON-NLS-1$
-	final static String K_CROSS = "cross"; //$NON-NLS-1$
-	final static String K_CROSSHAIR = "crosshair"; //$NON-NLS-1$
-	final static String K_CURSIVE = "cursive"; //$NON-NLS-1$
-	final static String K_DASHED = "dashed"; //$NON-NLS-1$
-	final static String K_DECIMAL = "decimal"; //$NON-NLS-1$
-	final static String K_DECIMAL_LEADING_ZERO = "decimal-leading-zero"; //$NON-NLS-1$
-	final static String K_DEFAULT = "default"; //$NON-NLS-1$
-	final static String K_DIGITS = "digits"; //$NON-NLS-1$
-	final static String K_DISC = "disc"; //$NON-NLS-1$
-	final static String K_DOTTED = "dotted"; //$NON-NLS-1$
-	final static String K_DOUBLE = "double"; //$NON-NLS-1$
-	final static String K_E_RESIZE = "e-resize"; //$NON-NLS-1$
-	final static String K_EMBED = "embed"; //$NON-NLS-1$
-	final static String K_EXPANDED = "expanded"; //$NON-NLS-1$
-	final static String K_EXTRA_CONDENSED = "extra-condensed"; //$NON-NLS-1$
-	final static String K_EXTRA_EXPANDED = "extra-expanded"; //$NON-NLS-1$
-	final static String K_FANTASY = "fantasy"; //$NON-NLS-1$
-	final static String K_FAR_LEFT = "far-left"; //$NON-NLS-1$
-	final static String K_FAR_RIGHT = "far-right"; //$NON-NLS-1$
-	final static String K_FAST = "fast"; //$NON-NLS-1$
-	final static String K_FASTER = "faster"; //$NON-NLS-1$
-	final static String K_FEMALE = "female"; //$NON-NLS-1$
-	final static String K_FIXED = "fixed"; //$NON-NLS-1$
-	final static String K_FUCHSIA = "fuchsia"; //$NON-NLS-1$
-	final static String K_GEORGIAN = "georgian"; //$NON-NLS-1$
-	final static String K_GRAY = "gray"; //$NON-NLS-1$
-	final static String K_GRAYTEXT = "GrayText"; //$NON-NLS-1$
-	final static String K_GREEN = "green"; //$NON-NLS-1$
-	final static String K_GROOVE = "groove"; //$NON-NLS-1$
-	final static String K_HEBREW = "hebrew"; //$NON-NLS-1$
-	final static String K_HELP = "help"; //$NON-NLS-1$
-	final static String K_HIDDEN = "hidden"; //$NON-NLS-1$
-	final static String K_HIDE = "hide"; //$NON-NLS-1$
-	final static String K_HIGH = "high"; //$NON-NLS-1$
-	final static String K_HIGHLIGHT = "Highlight"; //$NON-NLS-1$
-	final static String K_HIGHLIGHTTEXT = "HighlightText"; //$NON-NLS-1$
-	final static String K_HIGHER = "higher"; //$NON-NLS-1$
-	final static String K_HIRAGANA = "hiragana"; //$NON-NLS-1$
-	final static String K_HIRAGANA_IROHA = "hiragana-iroha"; //$NON-NLS-1$
-	final static String K_ICON = "icon"; //$NON-NLS-1$
-	final static String K_INACTIVEBORDER = "InactiveBorder"; //$NON-NLS-1$
-	final static String K_INACTIVECAPTION = "InactiveCaption"; //$NON-NLS-1$
-	final static String K_INACTIVECAPTIONTEXT = "InactiveCaptionText"; //$NON-NLS-1$
-	final static String K_INFOBACKGROUND = "InfoBackground"; //$NON-NLS-1$
-	final static String K_INFOTEXT = "InfoText"; //$NON-NLS-1$
-	final static String K_INLINE = "inline"; //$NON-NLS-1$
-	final static String K_INLINE_TABLE = "inline-table"; //$NON-NLS-1$
-	final static String K_INSET = "inset"; //$NON-NLS-1$
-	final static String K_INSIDE = "inside"; //$NON-NLS-1$
-	final static String K_INVERT = "invert"; //$NON-NLS-1$
-	final static String K_ITALIC = "italic"; //$NON-NLS-1$
-	final static String K_JUSTIFY = "justify"; //$NON-NLS-1$
-	final static String K_KATAKANA = "katakana"; //$NON-NLS-1$
-	final static String K_KATAKANA_IROHA = "katakana-iroha"; //$NON-NLS-1$
-	final static String K_LANDSCAPE = "landscape"; //$NON-NLS-1$
-	final static String K_LARGE = "large"; //$NON-NLS-1$
-	final static String K_LARGER = "larger"; //$NON-NLS-1$
-	final static String K_LEFT = "left"; //$NON-NLS-1$
-	final static String K_LEFT_SIDE = "left-side"; //$NON-NLS-1$
-	final static String K_LEFTWARDS = "leftwards"; //$NON-NLS-1$
-	final static String K_LEVEL = "level"; //$NON-NLS-1$
-	final static String K_LIGHTER = "lighter"; //$NON-NLS-1$
-	final static String K_LIME = "lime"; //$NON-NLS-1$
-	final static String K_LINE_THROUGH = "line-through"; //$NON-NLS-1$
-	final static String K_LIST_ITEM = "list-item"; //$NON-NLS-1$
-	final static String K_LOUD = "loud"; //$NON-NLS-1$
-	final static String K_LOW = "low"; //$NON-NLS-1$
-	final static String K_LOWER = "lower"; //$NON-NLS-1$
-	final static String K_LOWER_ALPHA = "lower-alpha"; //$NON-NLS-1$
-	final static String K_LOWER_GREEK = "lower-greek"; //$NON-NLS-1$
-	final static String K_LOWER_LATIN = "lower-latin"; //$NON-NLS-1$
-	final static String K_LOWER_ROMAN = "lower-roman"; //$NON-NLS-1$
-	final static String K_LOWERCASE = "lowercase"; //$NON-NLS-1$
-	final static String K_LTR = "ltr"; //$NON-NLS-1$
-	final static String K_MALE = "male"; //$NON-NLS-1$
-	final static String K_MARKER = "marker"; //$NON-NLS-1$
-	final static String K_MAROON = "maroon"; //$NON-NLS-1$
-	final static String K_MEDIUM = "medium"; //$NON-NLS-1$
-	final static String K_MENU = "menu"; //$NON-NLS-1$
-	final static String K_MENUTEXT = "MenuText"; //$NON-NLS-1$
-	final static String K_MESSAGE_BOX = "message-box"; //$NON-NLS-1$
-	final static String K_MIDDLE = "middle"; //$NON-NLS-1$
-	final static String K_MIX = "mix"; //$NON-NLS-1$
-	final static String K_MONOSPACE = "monospace"; //$NON-NLS-1$
-	final static String K_MOVE = "move"; //$NON-NLS-1$
-	final static String K_N_RESIZE = "n-resize"; //$NON-NLS-1$
-	final static String K_NARROWER = "narrower"; //$NON-NLS-1$
-	final static String K_NAVY = "navy"; //$NON-NLS-1$
-	final static String K_NE_RESIZE = "ne-resize"; //$NON-NLS-1$
-	final static String K_NO_CLOSE_QUOTE = "no-close-quote"; //$NON-NLS-1$
-	final static String K_NO_OPEN_QUOTE = "no-open-quote"; //$NON-NLS-1$
-	final static String K_NO_REPEAT = "no-repeat"; //$NON-NLS-1$
-	final static String K_NONE = "none"; //$NON-NLS-1$
-	final static String K_NORMAL = "normal"; //$NON-NLS-1$
-	final static String K_NOWRAP = "nowrap"; //$NON-NLS-1$
-	final static String K_NW_RESIZE = "nw-resize"; //$NON-NLS-1$
-	final static String K_OBLIQUE = "oblique"; //$NON-NLS-1$
-	final static String K_OLIVE = "olive"; //$NON-NLS-1$
-	final static String K_ONCE = "once"; //$NON-NLS-1$
-	final static String K_OPEN_QUOTE = "open-quote"; //$NON-NLS-1$
-	final static String K_OUTSET = "outset"; //$NON-NLS-1$
-	final static String K_OUTSIDE = "outside"; //$NON-NLS-1$
-	final static String K_OVERLINE = "overline"; //$NON-NLS-1$
-	final static String K_POINTER = "pointer"; //$NON-NLS-1$
-	final static String K_PORTRAIT = "portrait"; //$NON-NLS-1$
-	final static String K_PRE = "pre"; //$NON-NLS-1$
-	final static String K_PURPLE = "purple"; //$NON-NLS-1$
-	final static String K_RED = "red"; //$NON-NLS-1$
-	final static String K_RELATIVE = "relative"; //$NON-NLS-1$
-	final static String K_REPEAT = "repeat"; //$NON-NLS-1$
-	final static String K_REPEAT_X = "repeat-x"; //$NON-NLS-1$
-	final static String K_REPEAT_Y = "repeat-y"; //$NON-NLS-1$
-	final static String K_RIDGE = "ridge"; //$NON-NLS-1$
-	final static String K_RIGHT = "right"; //$NON-NLS-1$
-	final static String K_RIGHT_SIDE = "right-side"; //$NON-NLS-1$
-	final static String K_RIGHTWARDS = "rightwards"; //$NON-NLS-1$
-	final static String K_RTL = "rtl"; //$NON-NLS-1$
-	final static String K_RUN_IN = "run-in"; //$NON-NLS-1$
-	final static String K_S_RESIZE = "s-resize"; //$NON-NLS-1$
-	final static String K_SANS_SERIF = "sans-serif"; //$NON-NLS-1$
-	final static String K_SCROLL = "scroll"; //$NON-NLS-1$
-	final static String K_SCROLLBAR = "Scrollbar"; //$NON-NLS-1$
-	final static String K_SE_RESIZE = "se-resize"; //$NON-NLS-1$
-	final static String K_SEMI_CONDENSED = "semi-condensed"; //$NON-NLS-1$
-	final static String K_SEMI_EXPANDED = "semi-expanded"; //$NON-NLS-1$
-	final static String K_SEPARATE = "separate"; //$NON-NLS-1$
-	final static String K_SERIF = "serif"; //$NON-NLS-1$
-	final static String K_SHOW = "show"; //$NON-NLS-1$
-	final static String K_SILENT = "silent"; //$NON-NLS-1$
-	final static String K_SILVER = "silver"; //$NON-NLS-1$
-	final static String K_SLOW = "slow"; //$NON-NLS-1$
-	final static String K_SLOWER = "slower"; //$NON-NLS-1$
-	final static String K_SMALL = "small"; //$NON-NLS-1$
-	final static String K_SMALL_CAPS = "small-caps"; //$NON-NLS-1$
-	final static String K_SMALL_CAPTION = "small-caption"; //$NON-NLS-1$
-	final static String K_SMALLER = "smaller"; //$NON-NLS-1$
-	final static String K_SOFT = "soft"; //$NON-NLS-1$
-	final static String K_SOLID = "solid"; //$NON-NLS-1$
-	final static String K_SPELL_OUT = "spell-out"; //$NON-NLS-1$
-	final static String K_SQUARE = "square"; //$NON-NLS-1$
-	final static String K_STATIC = "static"; //$NON-NLS-1$
-	final static String K_STATUS_BAR = "status-bar"; //$NON-NLS-1$
-	final static String K_SUB = "sub"; //$NON-NLS-1$
-	final static String K_SUPER = "super"; //$NON-NLS-1$
-	final static String K_SW_RESIZE = "sw-resize"; //$NON-NLS-1$
-	final static String K_TABLE = "table"; //$NON-NLS-1$
-	final static String K_TABLE_CAPTION = "table-caption"; //$NON-NLS-1$
-	final static String K_TABLE_CELL = "table-cell"; //$NON-NLS-1$
-	final static String K_TABLE_COLUMN = "table-column"; //$NON-NLS-1$
-	final static String K_TABLE_COLUMN_GROUP = "table-column-group"; //$NON-NLS-1$
-	final static String K_TABLE_FOOTER_GROUP = "table-footer-group"; //$NON-NLS-1$
-	final static String K_TABLE_HEADER_GROUP = "table-header-group"; //$NON-NLS-1$
-	final static String K_TABLE_ROW = "table-row"; //$NON-NLS-1$
-	final static String K_TABLE_ROW_GROUP = "table-row-group"; //$NON-NLS-1$
-	final static String K_TEAL = "teal"; //$NON-NLS-1$
-	final static String K_TEXT = "text"; //$NON-NLS-1$
-	final static String K_TEXT_TOP = "text-top"; //$NON-NLS-1$
-	final static String K_TEXT_BOTTOM = "text-bottom"; //$NON-NLS-1$
-	final static String K_THICK = "thick"; //$NON-NLS-1$
-	final static String K_THIN = "thin"; //$NON-NLS-1$
-	final static String K_THREEDDARKSHADOW = "ThreeDDarkShadow"; //$NON-NLS-1$
-	final static String K_THREEDFACE = "ThreeDFace"; //$NON-NLS-1$
-	final static String K_THREEDHIGHLIGHT = "ThreeDHighlight"; //$NON-NLS-1$
-	final static String K_THREEDLIGHTSHADOW = "ThreeDLightShadow"; //$NON-NLS-1$
-	final static String K_THREEDSHADOW = "ThreeDShadow"; //$NON-NLS-1$
-	final static String K_TOP = "top"; //$NON-NLS-1$
-	final static String K_TRANSPARENT = "transparent"; //$NON-NLS-1$
-	final static String K_ULTRA_CONDENSED = "ultra-condensed"; //$NON-NLS-1$
-	final static String K_ULTRA_EXPANDED = "ultra-expanded"; //$NON-NLS-1$
-	final static String K_UNDERLINE = "underline"; //$NON-NLS-1$
-	final static String K_UPPER_ALPHA = "upper-alpha"; //$NON-NLS-1$
-	final static String K_UPPER_LATIN = "upper-latin"; //$NON-NLS-1$
-	final static String K_UPPER_ROMAN = "upper-roman"; //$NON-NLS-1$
-	final static String K_UPPERCASE = "uppercase"; //$NON-NLS-1$
-	final static String K_VISIBLE = "visible"; //$NON-NLS-1$
-	final static String K_W_RESIZE = "w-resize"; //$NON-NLS-1$
-	final static String K_WAIT = "wait"; //$NON-NLS-1$
-	final static String K_WHITE = "white"; //$NON-NLS-1$
-	final static String K_WIDER = "wider"; //$NON-NLS-1$
-	final static String K_WINDOW = "Window"; //$NON-NLS-1$
-	final static String K_WINDOWFRAME = "WindowFrame"; //$NON-NLS-1$
-	final static String K_WINDOWTEXT = "WindowText"; //$NON-NLS-1$
-	final static String K_X_FAST = "x-fast"; //$NON-NLS-1$
-	final static String K_X_HIGH = "x-high"; //$NON-NLS-1$
-	final static String K_X_LARGE = "x-large"; //$NON-NLS-1$
-	final static String K_X_LOUD = "x-loud"; //$NON-NLS-1$
-	final static String K_X_LOW = "x-low"; //$NON-NLS-1$
-	final static String K_X_SLOW = "x-slow"; //$NON-NLS-1$
-	final static String K_X_SMALL = "x-small"; //$NON-NLS-1$
-	final static String K_X_SOFT = "x-soft"; //$NON-NLS-1$
-	final static String K_XX_SMALL = "xx-small"; //$NON-NLS-1$
-	final static String K_XX_LARGE = "xx-large"; //$NON-NLS-1$
-	final static String K_YELLOW = "yellow"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMMTypeCollector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMMTypeCollector.java
deleted file mode 100644
index c2baf78..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMMTypeCollector.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-
-public class CSSMMTypeCollector extends CSSMetaModelTraverser {
-
-	/**
-	 * Constructor for TypeCollector.
-	 */
-	public CSSMMTypeCollector() {
-		super();
-	}
-
-	public void apply(CSSMMNode node, String type) {
-		fType = type;
-		fNodes = new ArrayList();
-		apply(node);
-	}
-
-	public void collectNestedType(boolean nested) {
-		fNested = nested;
-	}
-
-	protected short preNode(CSSMMNode node) {
-		short rc = TRAV_CONT;
-		if (node != null) {
-			if (fType == node.getType()) {
-				if (!fNodes.contains(node)) {
-					fNodes.add(node);
-				}
-				if (!fNested) {
-					rc = TRAV_PRUNE;
-				}
-			}
-		}
-		return rc;
-	}
-
-	public Iterator getNodes() {
-		return fNodes.iterator();
-	}
-
-
-	private boolean fNested = false;
-	private String fType = null;
-	List fNodes = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMediaGroupID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMediaGroupID.java
deleted file mode 100644
index b7bda54..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMediaGroupID.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel.util;
-
-public interface CSSMediaGroupID {
-
-	final static String M_CONTINUOUS = "continuous"; //$NON-NLS-1$
-	final static String M_PAGED = "paged"; //$NON-NLS-1$
-
-	final static String M_VISUAL = "visual"; //$NON-NLS-1$
-	final static String M_AURAL = "aural"; //$NON-NLS-1$
-	final static String M_TACTILE = "tactile"; //$NON-NLS-1$
-
-	final static String M_GRID = "grid"; //$NON-NLS-1$
-	final static String M_BITMAP = "bitmap"; //$NON-NLS-1$
-
-	final static String M_INTERACTIVE = "interactive"; //$NON-NLS-1$
-	final static String M_STATIC = "static"; //$NON-NLS-1$
-
-	final static String M_ALL = "all"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelFinder.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelFinder.java
deleted file mode 100644
index f07d84a..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelFinder.java
+++ /dev/null
@@ -1,51 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel.util;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-
-public class CSSMetaModelFinder {
-	/**
-	 * Constructor for CSSMetaModelFinder.
-	 */
-	private CSSMetaModelFinder() {
-		super();
-	}
-
-	static synchronized public CSSMetaModelFinder getInstance() {
-		if (fInstance == null) {
-			fInstance = new CSSMetaModelFinder();
-		}
-		return fInstance;
-	}
-
-	public CSSMetaModel findMetaModelFor(ICSSNode node) {
-		return CSSProfileFinder.getInstance().findProfileFor(node).getMetaModel();
-	}
-
-	public CSSMetaModel findMetaModelFor(IStructuredModel model) {
-		return CSSProfileFinder.getInstance().findProfileFor(model).getMetaModel();
-
-	}
-
-	// findMetaModelFor(Node) is not used.
-	// Even if it is used, it can be replaced with
-	// findMetaModelFor(IStructuredModel) easily
-
-	public CSSMetaModel findMetaModelFor(String baseLocation) {
-		return CSSProfileFinder.getInstance().findProfileFor(baseLocation).getMetaModel();
-	}
-
-	static private CSSMetaModelFinder fInstance = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelTraverser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelTraverser.java
deleted file mode 100644
index 05a6f48..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelTraverser.java
+++ /dev/null
@@ -1,92 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel.util;
-
-import java.util.Iterator;
-import java.util.Stack;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-
-
-abstract public class CSSMetaModelTraverser {
-
-	/**
-	 * Constructor for Traverser.
-	 */
-	public CSSMetaModelTraverser() {
-		super();
-	}
-
-	public final void apply(CSSMMNode node) {
-		fTravStack = new Stack();
-
-		begin(node);
-		traverse(node);
-		end(node);
-	}
-
-	private final short traverse(CSSMMNode node) {
-		if (node == null) {
-			return TRAV_CONT;
-		}
-
-		fTravStack.push(node);
-
-		short rc;
-		rc = preNode(node);
-
-		if (rc == TRAV_CONT) {
-			Iterator i = node.getChildNodes();
-			while (i.hasNext()) {
-				CSSMMNode child = (CSSMMNode) i.next();
-				short rcChild = traverse(child);
-				if (rcChild == TRAV_STOP) {
-					fTravStack.pop();
-					return TRAV_STOP;
-				}
-			}
-		}
-		else if (rc == TRAV_STOP) {
-			fTravStack.pop();
-			return TRAV_STOP;
-		}
-
-		rc = postNode(node);
-
-		fTravStack.pop();
-		return (rc == TRAV_PRUNE) ? TRAV_CONT : rc;
-	}
-
-	protected void begin(CSSMMNode node) {
-
-	}
-
-	protected void end(CSSMMNode node) {
-
-	}
-
-	protected short preNode(CSSMMNode node) {
-		return TRAV_CONT;
-	}
-
-	protected short postNode(CSSMMNode node) {
-		return TRAV_CONT;
-	}
-
-
-	Stack fTravStack = null;
-
-	protected static final short TRAV_CONT = 0;
-	protected static final short TRAV_STOP = 1;
-	protected static final short TRAV_PRUNE = 2;
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelUtil.java
deleted file mode 100644
index aad0b1b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelUtil.java
+++ /dev/null
@@ -1,120 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel.util;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMDescriptor;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMProperty;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.w3c.dom.css.CSSFontFaceRule;
-
-
-public class CSSMetaModelUtil {
-	public CSSMetaModelUtil(CSSMetaModel metamodel) {
-		super();
-		fMetaModel = metamodel;
-	}
-
-	public Iterator getProperties() {
-		return collectNodesByType(CSSMMNode.TYPE_PROPERTY);
-	}
-
-	public Iterator getDescriptors() {
-		return collectNodesByType(CSSMMNode.TYPE_DESCRIPTOR);
-	}
-
-	public Iterator collectNodesByType(String type) {
-		CSSMMTypeCollector collector = new CSSMMTypeCollector();
-		collector.apply(fMetaModel, type);
-		return collector.getNodes();
-	}
-
-	public CSSMMProperty getProperty(String propertyName) {
-		Iterator iProperty = getProperties();
-		while (iProperty.hasNext()) {
-			CSSMMNode node = (CSSMMNode) iProperty.next();
-			if (node.getName().equalsIgnoreCase(propertyName)) {
-				return (CSSMMProperty) node;
-			}
-		}
-		return null;
-	}
-
-	public CSSMMDescriptor getDescriptor(String descriptorName) {
-		Iterator iDescriptor = getDescriptors();
-		while (iDescriptor.hasNext()) {
-			CSSMMNode node = (CSSMMNode) iDescriptor.next();
-			if (node.getName().equalsIgnoreCase(descriptorName)) {
-				return (CSSMMDescriptor) node;
-			}
-		}
-		return null;
-	}
-
-	public CSSMMNode getMetaModelNodeFor(ICSSNode node) {
-		if (node instanceof ICSSStyleDeclaration) {
-			node = node.getParentNode();
-		}
-		if (node instanceof ICSSStyleDeclItem) {
-			ICSSNode parent = node.getParentNode();
-			if (parent != null) {
-				parent = parent.getParentNode();
-			}
-			if (parent instanceof ICSSStyleRule) {
-				return getProperty(((ICSSStyleDeclItem) node).getPropertyName());
-			}
-			else if (parent instanceof CSSFontFaceRule) {
-				return getDescriptor(((ICSSStyleDeclItem) node).getPropertyName());
-			}
-		}
-		if (node == null) {
-			return null;
-		}
-
-		if (fTypeMap == null) {
-			fTypeMap = new HashMap();
-			fTypeMap.put(new Short(ICSSNode.STYLERULE_NODE), CSSMMNode.TYPE_STYLE_RULE);
-			fTypeMap.put(new Short(ICSSNode.FONTFACERULE_NODE), CSSMMNode.TYPE_FONT_FACE_RULE);
-			fTypeMap.put(new Short(ICSSNode.PAGERULE_NODE), CSSMMNode.TYPE_PAGE_RULE);
-		}
-
-		String nodeType = (String) fTypeMap.get(new Short(node.getNodeType()));
-		if (nodeType == null) {
-			return null;
-		}
-
-		Iterator iNodes = collectNodesByType(nodeType);
-		if (iNodes.hasNext()) {
-			CSSMMNode targetNode = (CSSMMNode) iNodes.next();
-			if (!iNodes.hasNext()) { // it's only one
-				return targetNode;
-			}
-		}
-
-		return null;
-	}
-
-	public CSSMetaModel getMetaModel() {
-		return fMetaModel;
-	}
-
-
-	private CSSMetaModel fMetaModel = null;
-	private Map fTypeMap = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSNumberID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSNumberID.java
deleted file mode 100644
index 4b367ab..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSNumberID.java
+++ /dev/null
@@ -1,23 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel.util;
-
-public interface CSSNumberID {
-
-	final static java.lang.String N_ANGLE = "angle";//$NON-NLS-1$
-	final static java.lang.String N_FREQUENCY = "frequency";//$NON-NLS-1$
-	final static java.lang.String N_INTEGER = "integer";//$NON-NLS-1$
-	final static java.lang.String N_LENGTH = "length";//$NON-NLS-1$
-	final static java.lang.String N_PERCENTAGE = "percentage";//$NON-NLS-1$
-	final static java.lang.String N_TIME = "time";//$NON-NLS-1$
-	final static java.lang.String N_HASH = "hash"; //$NON-NLS-1$
-	final static java.lang.String N_NUM = "number";//$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSProfileFinder.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSProfileFinder.java
deleted file mode 100644
index ed11f62..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSProfileFinder.java
+++ /dev/null
@@ -1,105 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel.util;
-
-import org.eclipse.core.resources.IProject;
-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.css.core.internal.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.internal.contentproperties.ContentSettingsCreator;
-import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
-
-
-public class CSSProfileFinder {
-
-	final static private String CSS_PROFILE = "css-profile"; //$NON-NLS-1$
-
-	/**
-	 * Constructor for CSSProfileFinder.
-	 */
-	private CSSProfileFinder() {
-		super();
-	}
-
-	static synchronized public CSSProfileFinder getInstance() {
-		if (fInstance == null) {
-			fInstance = new CSSProfileFinder();
-		}
-		return fInstance;
-	}
-
-	public CSSProfile findProfileFor(ICSSNode node) {
-		ICSSModel model = null;
-		if (node != null) {
-			ICSSDocument doc = node.getOwnerDocument();
-			if (doc != null) {
-				model = doc.getModel();
-			}
-		}
-		return findProfileFor(model);
-	}
-
-	public CSSProfile findProfileFor(IStructuredModel model) {
-		String baseLocation = null;
-		if (model instanceof ICSSModel) {
-			Object modelType = ((ICSSModel) model).getStyleSheetType();
-			if (modelType == ICSSModel.EXTERNAL) {
-				baseLocation = model.getBaseLocation();
-			}
-			else if (modelType == ICSSModel.EMBEDDED || modelType == ICSSModel.INLINE) {
-				baseLocation = model.getBaseLocation(); // may be null
-			}
-		}
-		else if (model != null) {
-			baseLocation = model.getBaseLocation();
-		}
-		return findProfileFor(baseLocation);
-	}
-
-	public CSSProfile findProfileFor(String baseLocation) {
-		CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
-		CSSProfile profile = null;
-
-		if (baseLocation != null) {
-			IContentSettings cs = ContentSettingsCreator.create();
-			IPath path = new Path(baseLocation);
-			IResource resource = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
-			if (resource == null && path.segmentCount() > 1)
-				resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-			if (resource != null) {
-				IProject project = resource.getProject();
-				// at first, initialized with project settings
-				if (project != null) {
-					String profileID = cs.getProperty(project, CSS_PROFILE);
-					if (profileID != null && 0 < profileID.length()) {
-						profile = reg.getProfile(profileID);
-					}
-				}
-				// if resource settings exist, overwrite with project settings
-				String profileID = cs.getProperty(resource, CSS_PROFILE);
-				if (profileID != null && 0 < profileID.length()) {
-					profile = reg.getProfile(profileID);
-				}
-			}
-		}
-
-		return (profile != null) ? profile : reg.getDefaultProfile();
-	}
-
-	static private CSSProfileFinder fInstance = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSPropertyID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSPropertyID.java
deleted file mode 100644
index 5f66cdb..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSPropertyID.java
+++ /dev/null
@@ -1,137 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel.util;
-
-public interface CSSPropertyID {
-
-	final static String P_AZIMUTH = "azimuth"; //$NON-NLS-1$
-	final static String P_BG = "background"; //$NON-NLS-1$
-	final static String P_BG_ATTACHMENT = "background-attachment"; //$NON-NLS-1$
-	final static String P_BG_COLOR = "background-color"; //$NON-NLS-1$
-	final static String P_BG_IMAGE = "background-image"; //$NON-NLS-1$
-	final static String P_BG_POSITION = "background-position"; //$NON-NLS-1$
-	final static String P_BG_REPEAT = "background-repeat"; //$NON-NLS-1$
-	final static String P_BORDER = "border"; //$NON-NLS-1$
-	final static String P_BORDER_COLLAPSE = "border-collapse"; //$NON-NLS-1$
-	final static String P_BORDER_COLOR = "border-color"; //$NON-NLS-1$
-	final static String P_BORDER_SPACING = "border-spacing"; //$NON-NLS-1$
-	final static String P_BORDER_STYLE = "border-style"; //$NON-NLS-1$
-	final static String P_BORDER_TOP = "border-top"; //$NON-NLS-1$
-	final static String P_BORDER_RIGHT = "border-right"; //$NON-NLS-1$
-	final static String P_BORDER_BOTTOM = "border-bottom"; //$NON-NLS-1$
-	final static String P_BORDER_LEFT = "border-left"; //$NON-NLS-1$
-	final static String P_BORDER_TOP_COLOR = "border-top-color"; //$NON-NLS-1$
-	final static String P_BORDER_RIGHT_COLOR = "border-right-color"; //$NON-NLS-1$
-	final static String P_BORDER_BOTTOM_COLOR = "border-bottom-color"; //$NON-NLS-1$
-	final static String P_BORDER_LEFT_COLOR = "border-left-color"; //$NON-NLS-1$
-	final static String P_BORDER_TOP_STYLE = "border-top-style"; //$NON-NLS-1$
-	final static String P_BORDER_RIGHT_STYLE = "border-right-style"; //$NON-NLS-1$
-	final static String P_BORDER_BOTTOM_STYLE = "border-bottom-style"; //$NON-NLS-1$
-	final static String P_BORDER_LEFT_STYLE = "border-left-style"; //$NON-NLS-1$
-	final static String P_BORDER_TOP_WIDTH = "border-top-width"; //$NON-NLS-1$
-	final static String P_BORDER_RIGHT_WIDTH = "border-right-width"; //$NON-NLS-1$
-	final static String P_BORDER_BOTTOM_WIDTH = "border-bottom-width"; //$NON-NLS-1$
-	final static String P_BORDER_LEFT_WIDTH = "border-left-width"; //$NON-NLS-1$
-	final static String P_BORDER_WIDTH = "border-width"; //$NON-NLS-1$
-	final static String P_BOTTOM = "bottom"; //$NON-NLS-1$
-	final static String P_CAPTION_SIDE = "caption-side"; //$NON-NLS-1$
-	final static String P_CLEAR = "clear"; //$NON-NLS-1$
-	final static String P_CLIP = "clip"; //$NON-NLS-1$
-	final static String P_COLOR = "color"; //$NON-NLS-1$
-	final static String P_CONTENT = "content"; //$NON-NLS-1$
-	final static String P_COUNTER_INCREMENT = "counter-increment"; //$NON-NLS-1$
-	final static String P_COUNTER_RESET = "counter-reset"; //$NON-NLS-1$
-	final static String P_CUE = "cue"; //$NON-NLS-1$
-	final static String P_CUE_AFTER = "cue-after"; //$NON-NLS-1$
-	final static String P_CUE_BEFORE = "cue-before"; //$NON-NLS-1$
-	final static String P_CURSOR = "cursor"; //$NON-NLS-1$
-	final static String P_DIRECTION = "direction"; //$NON-NLS-1$
-	final static String P_DISPLAY = "display"; //$NON-NLS-1$
-	final static String P_ELEVATION = "elevation"; //$NON-NLS-1$
-	final static String P_EMPTY_CELLS = "empty-cells"; //$NON-NLS-1$
-	final static String P_FLOAT = "float"; //$NON-NLS-1$
-	final static String P_FONT = "font"; //$NON-NLS-1$
-	final static String P_FONT_FAMILY = "font-family"; //$NON-NLS-1$
-	final static String P_FONT_SIZE = "font-size"; //$NON-NLS-1$
-	final static String P_FONT_SIZE_ADJUST = "font-size-adjust"; //$NON-NLS-1$
-	final static String P_FONT_STRETCH = "font-stretch"; //$NON-NLS-1$
-	final static String P_FONT_STYLE = "font-style"; //$NON-NLS-1$
-	final static String P_FONT_VARIANT = "font-variant"; //$NON-NLS-1$
-	final static String P_FONT_WEIGHT = "font-weight"; //$NON-NLS-1$
-	final static String P_HEIGHT = "height"; //$NON-NLS-1$
-	final static String P_LEFT = "left"; //$NON-NLS-1$
-	final static String P_LETTER_SPACING = "letter-spacing"; //$NON-NLS-1$
-	final static String P_LINE_HEIGHT = "line-height"; //$NON-NLS-1$
-	final static String P_LIST_STYLE = "list-style"; //$NON-NLS-1$
-	final static String P_LIST_STYLE_IMAGE = "list-style-image"; //$NON-NLS-1$
-	final static String P_LIST_STYLE_POSITION = "list-style-position"; //$NON-NLS-1$
-	final static String P_LIST_STYLE_TYPE = "list-style-type"; //$NON-NLS-1$
-	final static String P_MARGIN = "margin"; //$NON-NLS-1$
-	final static String P_MARGIN_TOP = "margin-top"; //$NON-NLS-1$
-	final static String P_MARGIN_RIGHT = "margin-right"; //$NON-NLS-1$
-	final static String P_MARGIN_BOTTOM = "margin-bottom"; //$NON-NLS-1$
-	final static String P_MARGIN_LEFT = "margin-left"; //$NON-NLS-1$
-	final static String P_MARKER_OFFSET = "marker-offset"; //$NON-NLS-1$
-	final static String P_MARKS = "marks"; //$NON-NLS-1$
-	final static String P_MAX_HEIGHT = "max-height"; //$NON-NLS-1$
-	final static String P_MAX_WIDTH = "max-width"; //$NON-NLS-1$
-	final static String P_MIN_HEIGHT = "min-height"; //$NON-NLS-1$
-	final static String P_MIN_WIDTH = "min-width"; //$NON-NLS-1$
-	final static String P_ORPHANS = "orphans"; //$NON-NLS-1$
-	final static String P_OUTLINE = "outline"; //$NON-NLS-1$
-	final static String P_OUTLINE_COLOR = "outline-color"; //$NON-NLS-1$
-	final static String P_OUTLINE_STYLE = "outline-style"; //$NON-NLS-1$
-	final static String P_OUTLINE_WIDTH = "outline-width"; //$NON-NLS-1$
-	final static String P_OVERFLOW = "overflow"; //$NON-NLS-1$
-	final static String P_PADDING = "padding"; //$NON-NLS-1$
-	final static String P_PADDING_TOP = "padding-top"; //$NON-NLS-1$
-	final static String P_PADDING_RIGHT = "padding-right"; //$NON-NLS-1$
-	final static String P_PADDING_BOTTOM = "padding-bottom"; //$NON-NLS-1$
-	final static String P_PADDING_LEFT = "padding-left"; //$NON-NLS-1$
-	final static String P_PAGE = "page"; //$NON-NLS-1$
-	final static String P_PAGE_BREAK_AFTER = "page-break-after"; //$NON-NLS-1$
-	final static String P_PAGE_BREAK_BEFORE = "page-break-before"; //$NON-NLS-1$
-	final static String P_PAGE_BREAK_INSIDE = "page-break-inside"; //$NON-NLS-1$
-	final static String P_PAUSE = "pause"; //$NON-NLS-1$
-	final static String P_PAUSE_AFTER = "pause-after"; //$NON-NLS-1$
-	final static String P_PAUSE_BEFORE = "pause-before"; //$NON-NLS-1$
-	final static String P_PITCH = "pitch"; //$NON-NLS-1$
-	final static String P_PITCH_RANGE = "pitch-range"; //$NON-NLS-1$
-	final static String P_PLAY_DURING = "play-during"; //$NON-NLS-1$
-	final static String P_POSITION = "position"; //$NON-NLS-1$
-	final static String P_QUOTES = "quotes"; //$NON-NLS-1$
-	final static String P_RICHNESS = "richness"; //$NON-NLS-1$
-	final static String P_RIGHT = "right"; //$NON-NLS-1$
-	final static String P_SIZE = "size"; //$NON-NLS-1$
-	final static String P_SPEAK = "speak"; //$NON-NLS-1$
-	final static String P_SPEAK_HEADER = "speak-header"; //$NON-NLS-1$
-	final static String P_SPEAK_NUMERAL = "speak-numeral"; //$NON-NLS-1$
-	final static String P_SPEAK_PUNCTUATION = "speak-punctuation"; //$NON-NLS-1$
-	final static String P_SPEECH_RATE = "speech-rate"; //$NON-NLS-1$
-	final static String P_STRESS = "stress"; //$NON-NLS-1$
-	final static String P_TABLE_LAYOUT = "table-layout"; //$NON-NLS-1$
-	final static String P_TEXT_ALIGN = "text-align"; //$NON-NLS-1$
-	final static String P_TEXT_DECORATION = "text-decoration"; //$NON-NLS-1$
-	final static String P_TEXT_INDENT = "text-indent"; //$NON-NLS-1$
-	final static String P_TEXT_SHADOW = "text-shadow"; //$NON-NLS-1$
-	final static String P_TEXT_TRANSFORM = "text-transform"; //$NON-NLS-1$
-	final static String P_TOP = "top"; //$NON-NLS-1$
-	final static String P_UNICODE_BIDI = "unicode-bidi"; //$NON-NLS-1$
-	final static String P_VERTICAL_ALIGN = "vertical-align"; //$NON-NLS-1$
-	final static String P_VISIBILITY = "visibility"; //$NON-NLS-1$
-	final static String P_VOICE_FAMILY = "voice-family"; //$NON-NLS-1$
-	final static String P_VOLUME = "volume"; //$NON-NLS-1$
-	final static String P_WHITE_SPACE = "white-space"; //$NON-NLS-1$
-	final static String P_WIDOWS = "widows"; //$NON-NLS-1$
-	final static String P_WIDTH = "width"; //$NON-NLS-1$
-	final static String P_WORD_SPACING = "word-spacing"; //$NON-NLS-1$
-	final static String P_Z_INDEX = "z-index"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSStringID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSStringID.java
deleted file mode 100644
index c625191..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSStringID.java
+++ /dev/null
@@ -1,22 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel.util;
-
-public interface CSSStringID {
-
-	final static String S_ANY = "any"; //$NON-NLS-1$
-	final static String S_COUNTER_IDENTIFIER = "counter-identifier"; //$NON-NLS-1$
-	final static String S_FAMILY_NAME = "family-name"; //$NON-NLS-1$
-	final static String S_FONT_FACE_NAME = "font-face-name"; //$NON-NLS-1$
-	final static String S_PAGE_IDENTIFIER = "page-identifier"; //$NON-NLS-1$
-	final static String S_SPECIFIC_VOICE = "specific-voice"; //$NON-NLS-1$
-	final static String S_URANGE = "urange"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSUnitID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSUnitID.java
deleted file mode 100644
index ce2b5f1..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSUnitID.java
+++ /dev/null
@@ -1,34 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodel.util;
-
-public interface CSSUnitID {
-
-	final static String U_CM = "cm";//$NON-NLS-1$
-	final static String U_DEG = "deg";//$NON-NLS-1$
-	final static String U_EMS = "em";//$NON-NLS-1$
-	final static String U_EXS = "ex";//$NON-NLS-1$
-	final static String U_GRAD = "grad";//$NON-NLS-1$
-	final static String U_HASH = "#";//$NON-NLS-1$
-	final static String U_HZ = "Hz";//$NON-NLS-1$
-	final static String U_IN = "in";//$NON-NLS-1$
-	// final static String U_INTEGER = "INTEGER";//$NON-NLS-1$
-	final static String U_KHZ = "kHz";//$NON-NLS-1$
-	final static String U_MM = "mm";//$NON-NLS-1$
-	final static String U_MS = "ms";//$NON-NLS-1$
-	// final static String U_NUMBER = "NUMBER";//$NON-NLS-1$
-	final static String U_PC = "pc";//$NON-NLS-1$
-	final static String U_PERCENTAGE = "%";//$NON-NLS-1$
-	final static String U_PT = "pt";//$NON-NLS-1$
-	final static String U_PX = "px";//$NON-NLS-1$
-	final static String U_RAD = "rad";//$NON-NLS-1$
-	final static String U_S = "s";//$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCategoryImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCategoryImpl.java
deleted file mode 100644
index c841a62..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCategoryImpl.java
+++ /dev/null
@@ -1,75 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMCategory;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMCategoryImpl extends CSSMMNodeImpl implements CSSMMCategory {
-
-	public CSSMMCategoryImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_CATEGORY;
-	}
-
-	public String getName() {
-		String name = getAttribute(ATTR_NAME);
-		if (name != null) {
-			return name.toLowerCase();
-		}
-		else {
-			return null;
-		}
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		return false;
-	}
-
-	public String getCaption() {
-		return fCaption;
-	}
-
-	void setCaption(String caption) {
-		fCaption = caption;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#getError()
-	 */
-	short getError() {
-		if (getName() == null) {
-			return MetaModelErrors.ERROR_NOT_DEFINED;
-		}
-		else if (getCaption() == null) {
-			return MetaModelErrors.ERROR_NO_CHILD;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-
-	/*
-	 * @see Object#toString()
-	 */
-	public String toString() {
-		return getCaption();
-	}
-
-
-	private String fCaption = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCharsetRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCharsetRuleImpl.java
deleted file mode 100644
index 007deb6..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCharsetRuleImpl.java
+++ /dev/null
@@ -1,45 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMCharsetRule;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMCharsetRuleImpl extends CSSMMNodeImpl implements CSSMMCharsetRule {
-
-
-	public CSSMMCharsetRuleImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_CHARSET_RULE;
-	}
-
-	public String getName() {
-		return NAME_NOT_AVAILABLE;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		return false;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#getError()
-	 */
-	short getError() {
-		return MetaModelErrors.NO_ERROR;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMContainerImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMContainerImpl.java
deleted file mode 100644
index 5e4c581..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMContainerImpl.java
+++ /dev/null
@@ -1,63 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMContainer;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMContainerImpl extends CSSMMNodeImpl implements CSSMMContainer {
-
-
-	public CSSMMContainerImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_CONTAINER;
-	}
-
-	public String getName() {
-		String name = getAttribute(ATTR_NAME);
-		if (name != null) {
-			return name.toLowerCase();
-		}
-		else {
-			return null;
-		}
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		if (child == null) {
-			return false;
-		}
-		String type = child.getType();
-		return (type == TYPE_NUMBER || type == TYPE_KEYWORD || type == TYPE_FUNCTION || type == TYPE_CONTAINER);
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#getError()
-	 */
-	short getError() {
-		if (getName() == null) {
-			return MetaModelErrors.ERROR_NOT_DEFINED;
-		}
-		else if (getChildCount() == 0) {
-			return MetaModelErrors.ERROR_NO_CHILD;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMDescriptorImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMDescriptorImpl.java
deleted file mode 100644
index 7026c24..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMDescriptorImpl.java
+++ /dev/null
@@ -1,75 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMDescriptor;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-
-class CSSMMDescriptorImpl extends CSSMMNodeImpl implements CSSMMDescriptor {
-
-
-	public CSSMMDescriptorImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_DESCRIPTOR;
-	}
-
-	public String getName() {
-		String name = getAttribute(ATTR_NAME);
-		if (name != null) {
-			return name.toLowerCase();
-		}
-		else {
-			return null;
-		}
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		if (child == null) {
-			return false;
-		}
-		String type = child.getType();
-		return (type == TYPE_NUMBER || type == TYPE_KEYWORD || type == TYPE_FUNCTION || type == TYPE_CONTAINER || type == TYPE_STRING || type == TYPE_SEPARATOR);
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#getError()
-	 */
-	short getError() {
-		if (getName() == null) {
-			return MetaModelErrors.ERROR_NOT_DEFINED;
-		}
-		else if (getChildCount() == 0) {
-			return MetaModelErrors.ERROR_NO_CHILD;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-
-	/*
-	 * @see CSSMMDescriptor#getValues()
-	 */
-	public Iterator getValues() {
-		ValueCollector collector = new ValueCollector();
-		collector.apply(this);
-		return collector.getNodes();
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFontFaceRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFontFaceRuleImpl.java
deleted file mode 100644
index c8d561e..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFontFaceRuleImpl.java
+++ /dev/null
@@ -1,45 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMFontFaceRule;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMFontFaceRuleImpl extends CSSMMNodeImpl implements CSSMMFontFaceRule {
-
-
-	public CSSMMFontFaceRuleImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_FONT_FACE_RULE;
-	}
-
-	public String getName() {
-		return NAME_NOT_AVAILABLE;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		return (child != null && child.getType() == TYPE_DESCRIPTOR);
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#getError()
-	 */
-	short getError() {
-		return MetaModelErrors.NO_ERROR;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFunctionImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFunctionImpl.java
deleted file mode 100644
index a26b099..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFunctionImpl.java
+++ /dev/null
@@ -1,96 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMFunction;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMFunctionImpl extends CSSMMNodeImpl implements CSSMMFunction {
-
-	public CSSMMFunctionImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_FUNCTION;
-	}
-
-	public String getName() {
-		String name = getAttribute(ATTR_NAME);
-		if (name != null) {
-			return name.toLowerCase();
-		}
-		else {
-			return null;
-		}
-	}
-
-	public String getFunctionString() {
-		return fValue;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		return false;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#postSetAttribute()
-	 */
-	// void postSetAttribute() throws BadInitializationException {
-	// super.postSetAttribute();
-	// String name = getName();
-	// if (name == null) { throw new BadInitializationException(); }
-	//
-	// List list = new ArrayList();
-	// list.add(CSSFunctionID.F_ATTR);
-	// list.add(CSSFunctionID.F_COUNTER);
-	// list.add(CSSFunctionID.F_RGB);
-	// list.add(CSSFunctionID.F_RECT);
-	// list.add(CSSFunctionID.F_URI);
-	// list.add(CSSFunctionID.F_FORMAT);
-	// list.add(CSSFunctionID.F_LOCAL);
-	//
-	// if (! list.contains(name.toLowerCase())) {
-	// throw new BadInitializationException();
-	// }
-	// }
-	/*
-	 * @see Object#toString()
-	 */
-	public String toString() {
-		return getFunctionString();
-	}
-
-	void setFunctionString(String value) {
-		fValue = value;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#getError()
-	 */
-	short getError() {
-		if (getName() == null) {
-			return MetaModelErrors.ERROR_NOT_DEFINED;
-		}
-		else if (getFunctionString() == null) {
-			return MetaModelErrors.ERROR_NO_CHILD;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-
-
-	private String fValue = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMImportRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMImportRuleImpl.java
deleted file mode 100644
index 582ea8b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMImportRuleImpl.java
+++ /dev/null
@@ -1,44 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMImportRule;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMImportRuleImpl extends CSSMMNodeImpl implements CSSMMImportRule {
-
-
-	public CSSMMImportRuleImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_IMPORT_RULE;
-	}
-
-	public String getName() {
-		return NAME_NOT_AVAILABLE;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		return false;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#getError()
-	 */
-	short getError() {
-		return MetaModelErrors.NO_ERROR;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMKeywordImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMKeywordImpl.java
deleted file mode 100644
index b46042e..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMKeywordImpl.java
+++ /dev/null
@@ -1,75 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMKeyword;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMKeywordImpl extends CSSMMNodeImpl implements CSSMMKeyword {
-
-	public CSSMMKeywordImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_KEYWORD;
-	}
-
-	public String getName() {
-		String name = getAttribute(ATTR_NAME);
-		if (name != null) {
-			return name.toLowerCase();
-		}
-		else {
-			return null;
-		}
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		return false;
-	}
-
-	/*
-	 * @see CSSMMKeyword#getKeywordString()
-	 */
-	public String getKeywordString() {
-		return fValue;
-	}
-
-	/*
-	 * @see Object#toString()
-	 */
-	public String toString() {
-		return getKeywordString();
-	}
-
-	void setKeywordString(String value) {
-		fValue = value;
-	}
-
-	short getError() {
-		if (getName() == null) {
-			return MetaModelErrors.ERROR_NOT_DEFINED;
-		}
-		else if (getKeywordString() == null) {
-			return MetaModelErrors.ERROR_NO_CHILD;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-
-
-	private String fValue = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMMediaRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMMediaRuleImpl.java
deleted file mode 100644
index 92dec7d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMMediaRuleImpl.java
+++ /dev/null
@@ -1,41 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMMediaRule;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMMediaRuleImpl extends CSSMMNodeImpl implements CSSMMMediaRule {
-
-
-	public CSSMMMediaRuleImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_MEDIA_RULE;
-	}
-
-	public String getName() {
-		return NAME_NOT_AVAILABLE;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		return false;
-	}
-
-	short getError() {
-		return MetaModelErrors.NO_ERROR;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNodeImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNodeImpl.java
deleted file mode 100644
index fb144d3..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNodeImpl.java
+++ /dev/null
@@ -1,148 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-
-abstract class CSSMMNodeImpl implements CSSMMNode {
-
-	public CSSMMNodeImpl() {
-		super();
-	}
-
-	public abstract String getType();
-
-	public String getDescription() {
-		return fDescription;
-	}
-
-	public String getAttribute(String name) {
-		if (fAttributes == null) {
-			return null;
-		}
-		return (String) fAttributes.get(name);
-	}
-
-	public Iterator getChildNodes() {
-		if (fChildNodes == null) {
-			return Collections.EMPTY_LIST.iterator();
-		}
-		else {
-			return Collections.unmodifiableCollection(fChildNodes).iterator();
-		}
-	}
-
-	public Iterator getDescendants() {
-		List descendants = new ArrayList();
-		Iterator iChild = getChildNodes();
-		while (iChild.hasNext()) {
-			CSSMMNode child = (CSSMMNode) iChild.next();
-			Iterator iDescendant = child.getDescendants();
-			if (iDescendant.hasNext()) {
-				while (iDescendant.hasNext()) {
-					CSSMMNode descendant = (CSSMMNode) iDescendant.next();
-					if (!descendants.contains(descendant)) {
-						descendants.add(descendant);
-					}
-				}
-			}
-			else {
-				if (!descendants.contains(child)) {
-					descendants.add(child);
-				}
-			}
-		}
-		return Collections.unmodifiableCollection(descendants).iterator();
-	}
-
-	void appendChild(CSSMMNode child) {
-		if (child == null) {
-			return;
-		}
-		if (fChildNodes == null) {
-			fChildNodes = new ArrayList();
-		}
-		if (!fChildNodes.contains(child)) {
-			fChildNodes.add(child);
-			((CSSMMNodeImpl) child).fRefCount++;
-		}
-	}
-
-	void removeChild(CSSMMNode child) {
-		if (child == null || fChildNodes == null) {
-			return;
-		}
-		Iterator i = fChildNodes.iterator();
-		while (i.hasNext()) {
-			if (i.next() == child) {
-				i.remove();
-				((CSSMMNodeImpl) child).fRefCount--;
-				return;
-			}
-		}
-	}
-
-	void removeAllChildNodes() {
-		if (fChildNodes == null) {
-			return;
-		}
-		Iterator i = fChildNodes.iterator();
-		while (i.hasNext()) {
-			((CSSMMNodeImpl) i.next()).fRefCount--;
-		}
-		fChildNodes.clear();
-	}
-
-	abstract boolean canContain(CSSMMNode child);
-
-	void initializeAttribute(Map attributes) throws IllegalArgumentException {
-		if (fAttributes == null) {
-			fAttributes = new HashMap();
-		}
-		fAttributes.putAll(attributes);
-		postSetAttribute();
-	}
-
-	void setDescription(String description) {
-		fDescription = description;
-	}
-
-	void postSetAttribute() throws IllegalArgumentException {
-		// default : nop
-	}
-
-	abstract short getError();
-
-	int getChildCount() {
-		return (fChildNodes != null) ? fChildNodes.size() : 0;
-	}
-
-	int getReferenceCount() {
-		return fRefCount;
-	}
-
-
-	private List fChildNodes = null;
-	private String fDescription = null;
-	private Map fAttributes = null;
-	private int fRefCount = 0; // for error check
-
-	static final String ATTR_NAME = "name"; //$NON-NLS-1$
-	static final String NAME_NOT_AVAILABLE = ""; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNumberImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNumberImpl.java
deleted file mode 100644
index 0f2a9d8..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNumberImpl.java
+++ /dev/null
@@ -1,52 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNumber;
-
-class CSSMMNumberImpl extends CSSMMNodeImpl implements CSSMMNumber {
-
-
-	public CSSMMNumberImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_NUMBER;
-	}
-
-	public String getName() {
-		String name = getAttribute(ATTR_NAME);
-		if (name != null) {
-			return name.toLowerCase();
-		}
-		else {
-			return null;
-		}
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		return (child != null && child.getType() == TYPE_UNIT);
-	}
-
-	short getError() {
-		if (getName() == null) {
-			return MetaModelErrors.ERROR_NOT_DEFINED;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPageRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPageRuleImpl.java
deleted file mode 100644
index d793562..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPageRuleImpl.java
+++ /dev/null
@@ -1,50 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMPageRule;
-
-class CSSMMPageRuleImpl extends CSSMMNodeImpl implements CSSMMPageRule {
-
-
-	public CSSMMPageRuleImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_PAGE_RULE;
-	}
-
-	public String getName() {
-		return NAME_NOT_AVAILABLE;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		if (child == null) {
-			return false;
-		}
-		String type = child.getType();
-		return (type == TYPE_PROPERTY || type == TYPE_SELECTOR);
-	}
-
-	short getError() {
-		if (getChildCount() == 0) {
-			return MetaModelErrors.ERROR_NO_CHILD;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPropertyImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPropertyImpl.java
deleted file mode 100644
index 739098b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPropertyImpl.java
+++ /dev/null
@@ -1,76 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMProperty;
-
-
-class CSSMMPropertyImpl extends CSSMMNodeImpl implements CSSMMProperty {
-	public CSSMMPropertyImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_PROPERTY;
-	}
-
-	public String getName() {
-		String name = getAttribute(ATTR_NAME);
-		if (name != null) {
-			return name.toLowerCase();
-		}
-		else {
-			return null;
-		}
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		if (child == null) {
-			return false;
-		}
-		String type = child.getType();
-		return (type == TYPE_NUMBER || type == TYPE_KEYWORD || type == TYPE_FUNCTION || type == TYPE_CONTAINER || type == TYPE_STRING || type == TYPE_SEPARATOR || type == TYPE_PROPERTY);
-	}
-
-	/*
-	 * @see CSSMMProperty#getCategoryName()
-	 */
-	public String getCategoryName() {
-		return getAttribute(ATTR_CATEGORY);
-	}
-
-	public Iterator getValues() {
-		ValueCollector collector = new ValueCollector();
-		collector.apply(this);
-		return collector.getNodes();
-	}
-
-	short getError() {
-		if (getName() == null) {
-			return MetaModelErrors.ERROR_NOT_DEFINED;
-		}
-		else if (getChildCount() == 0) {
-			return MetaModelErrors.ERROR_NO_CHILD;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-
-
-	static final String ATTR_CATEGORY = "category"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoClassImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoClassImpl.java
deleted file mode 100644
index b0cab9a..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoClassImpl.java
+++ /dev/null
@@ -1,33 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-class CSSMMPseudoClassImpl extends CSSMMSelectorImpl {
-
-
-	/**
-	 * Constructor for CSSMMPseudoClassImpl.
-	 */
-	public CSSMMPseudoClassImpl() {
-		super();
-	}
-
-	/*
-	 * @see CSSMMSelector#getSelectorType()
-	 */
-	public String getSelectorType() {
-		return TYPE_PSEUDO_CLASS;
-	}
-
-	void setSelectorString(String value) {
-		fValue = ":" + value; //$NON-NLS-1$		
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoElementImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoElementImpl.java
deleted file mode 100644
index 71e9065..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoElementImpl.java
+++ /dev/null
@@ -1,33 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-public class CSSMMPseudoElementImpl extends CSSMMSelectorImpl {
-
-
-	/**
-	 * Constructor for CSSMMPseudoElementImpl.
-	 */
-	public CSSMMPseudoElementImpl() {
-		super();
-	}
-
-	/*
-	 * @see CSSMMSelector#getSelectorType()
-	 */
-	public String getSelectorType() {
-		return TYPE_PSEUDO_ELEMENT;
-	}
-
-	void setSelectorString(String value) {
-		fValue = ":" + value; //$NON-NLS-1$
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorExpressionImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorExpressionImpl.java
deleted file mode 100644
index e58be60..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorExpressionImpl.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-class CSSMMSelectorExpressionImpl extends CSSMMSelectorImpl {
-
-	public CSSMMSelectorExpressionImpl() {
-		super();
-	}
-
-	/*
-	 * @see CSSMMSelector#getSelectorType()
-	 */
-	public String getSelectorType() {
-		return TYPE_EXPRESSION;
-	}
-
-	void postSetAttribute() throws IllegalArgumentException {
-		super.postSetAttribute();
-		String name = getName();
-		if (name == null) {
-			throw new IllegalArgumentException();
-		}
-
-		Map map = new HashMap();
-		map.put(EXPRESSION_ADJACENT.toLowerCase(), "+"); //$NON-NLS-1$
-		map.put(EXPRESSION_ATTRIBUTE.toLowerCase(), "[]"); //$NON-NLS-1$
-		map.put(EXPRESSION_CHILD.toLowerCase(), ">"); //$NON-NLS-1$
-		map.put(EXPRESSION_DESCENDANT.toLowerCase(), "' '"); //$NON-NLS-1$
-		map.put(EXPRESSION_UNIVERSAL.toLowerCase(), "*"); //$NON-NLS-1$
-
-		fValue = (String) map.get(name.toLowerCase());
-		if (fValue == null) {
-			throw new IllegalArgumentException();
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorImpl.java
deleted file mode 100644
index c7a82cf..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorImpl.java
+++ /dev/null
@@ -1,81 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMSelector;
-
-
-abstract class CSSMMSelectorImpl extends CSSMMNodeImpl implements CSSMMSelector {
-
-	/**
-	 * Constructor for CSSMMSelectorImpl.
-	 */
-	public CSSMMSelectorImpl() {
-		super();
-	}
-
-	/*
-	 * @see CSSMMNode#getName()
-	 */
-	public String getName() {
-		String name = getAttribute(ATTR_NAME);
-		if (name != null) {
-			return name.toLowerCase();
-		}
-		else {
-			return null;
-		}
-	}
-
-	/*
-	 * @see CSSMMNode#getType()
-	 */
-	public String getType() {
-		return TYPE_SELECTOR;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		return false;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#getError()
-	 */
-	short getError() {
-		if (getName() == null) {
-			return MetaModelErrors.ERROR_NOT_DEFINED;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-
-	/*
-	 * @see CSSMMSelector#getSelectorString()
-	 */
-	public String getSelectorString() {
-		return fValue;
-	}
-
-	/*
-	 * @see Object#toString()
-	 */
-	public String toString() {
-		return getSelectorString();
-	}
-
-
-	protected String fValue = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStringImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStringImpl.java
deleted file mode 100644
index 143759a..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStringImpl.java
+++ /dev/null
@@ -1,86 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMString;
-
-class CSSMMStringImpl extends CSSMMNodeImpl implements CSSMMString {
-
-
-	public CSSMMStringImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_STRING;
-	}
-
-	public String getName() {
-		String name = getAttribute(ATTR_NAME);
-		if (name != null) {
-			return name.toLowerCase();
-		}
-		else {
-			return null;
-		}
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		return false;
-	}
-
-	short getError() {
-		if (getName() == null) {
-			return MetaModelErrors.ERROR_NOT_DEFINED;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-	/*
-	 * @see CSSMMNodeImpl#postSetAttribute()
-	 */
-	// void postSetAttribute() throws BadInitializationException {
-	// super.postSetAttribute();
-	// String name = getName();
-	// if (name == null) { throw new BadInitializationException(); }
-	//
-	// Map map = new HashMap();
-	// map.put(CSSStringID.S_ANY.toLowerCase(), "<any>"); //$NON-NLS-1$
-	// map.put(CSSStringID.S_COUNTER_IDENTIFIER.toLowerCase(), "<counter>");
-	// //$NON-NLS-1$
-	// map.put(CSSStringID.S_FAMILY_NAME.toLowerCase(), "<family-name>");
-	// //$NON-NLS-1$
-	// map.put(CSSStringID.S_FONT_FACE_NAME.toLowerCase(),
-	// "<font-face-name>"); //$NON-NLS-1$
-	// map.put(CSSStringID.S_PAGE_IDENTIFIER.toLowerCase(),
-	// "<page-identifier>"); //$NON-NLS-1$
-	// map.put(CSSStringID.S_SPECIFIC_VOICE.toLowerCase(),
-	// "<specific-voice>"); //$NON-NLS-1$
-	// map.put(CSSStringID.S_URANGE.toLowerCase(), "<urange>"); //$NON-NLS-1$
-	//
-	// fValue = (String)map.get(name.toLowerCase());
-	// if (fValue == null) { throw new BadInitializationException(); }
-	// }
-	//
-	// /*
-	// * @see Object#toString()
-	// */
-	// public String toString() {
-	// return fValue;
-	// }
-	//
-	// private String fValue = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleRuleImpl.java
deleted file mode 100644
index 706cff6..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleRuleImpl.java
+++ /dev/null
@@ -1,50 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMStyleRule;
-
-class CSSMMStyleRuleImpl extends CSSMMNodeImpl implements CSSMMStyleRule {
-
-
-	public CSSMMStyleRuleImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_STYLE_RULE;
-	}
-
-	public String getName() {
-		return NAME_NOT_AVAILABLE;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		if (child == null) {
-			return false;
-		}
-		String type = child.getType();
-		return (type == TYPE_PROPERTY || type == TYPE_SELECTOR);
-	}
-
-	short getError() {
-		if (getChildCount() == 0) {
-			return MetaModelErrors.ERROR_NO_CHILD;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleSheetImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleSheetImpl.java
deleted file mode 100644
index a9de98a..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleSheetImpl.java
+++ /dev/null
@@ -1,50 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMStyleSheet;
-
-class CSSMMStyleSheetImpl extends CSSMMNodeImpl implements CSSMMStyleSheet {
-
-
-	public CSSMMStyleSheetImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_STYLE_SHEET;
-	}
-
-	public String getName() {
-		return NAME_NOT_AVAILABLE;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		if (child == null) {
-			return false;
-		}
-		String type = child.getType();
-		return (type == TYPE_CHARSET_RULE || type == TYPE_IMPORT_RULE || type == TYPE_PAGE_RULE || type == TYPE_MEDIA_RULE || type == TYPE_FONT_FACE_RULE || type == TYPE_STYLE_RULE);
-	}
-
-	short getError() {
-		if (getChildCount() == 0) {
-			return MetaModelErrors.ERROR_NO_CHILD;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMUnitImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMUnitImpl.java
deleted file mode 100644
index 74f3f3e..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMUnitImpl.java
+++ /dev/null
@@ -1,108 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMUnit;
-
-/**
- * CSSMMUnit : embedded type
- */
-class CSSMMUnitImpl extends CSSMMNodeImpl implements CSSMMUnit {
-
-	public CSSMMUnitImpl() {
-		super();
-	}
-
-	public String getType() {
-		return TYPE_UNIT;
-	}
-
-	public String getName() {
-		String name = getAttribute(ATTR_NAME);
-		if (name != null) {
-			return name.toLowerCase();
-		}
-		else {
-			return null;
-		}
-	}
-
-	/*
-	 * @see CSSMMUnit#getUnitString()
-	 */
-	public String getUnitString() {
-		return fValue;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		return false;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#postSetAttribute()
-	 */
-	// void postSetAttribute() throws BadInitializationException {
-	// super.postSetAttribute();
-	// String name = getName();
-	// if (name == null) { throw new BadInitializationException(); }
-	// Map map = new HashMap();
-	// map.put(CSSUnitID.U_CM.toLowerCase(), "cm");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_DEG.toLowerCase(), "deg");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_EMS.toLowerCase(), "em");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_EXS.toLowerCase(), "ex");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_GRAD.toLowerCase(), "grad");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_HASH.toLowerCase(), "#");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_HZ.toLowerCase(), "Hz");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_IN.toLowerCase(), "in");//$NON-NLS-1$
-	// // map.put(CSSUnitID.U_INTEGER.toLowerCase(),
-	// "(integer)");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_KHZ.toLowerCase(), "kHz");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_MM.toLowerCase(), "mm");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_MS.toLowerCase(), "ms");//$NON-NLS-1$
-	// // map.put(CSSUnitID.U_NUMBER.toLowerCase(), "(number)");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_PC.toLowerCase(), "pc");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_PERCENTAGE.toLowerCase(), "%");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_PT.toLowerCase(), "pt");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_PX.toLowerCase(), "px");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_RAD.toLowerCase(), "rad");//$NON-NLS-1$
-	// map.put(CSSUnitID.U_S.toLowerCase(), "s");//$NON-NLS-1$
-	// fValue = (String)map.get(name.toLowerCase());
-	// if (fValue == null) { throw new BadInitializationException(); }
-	// }
-	/*
-	 * @see Object#toString()
-	 */
-	public String toString() {
-		return getUnitString();
-	}
-
-	void setUnitString(String value) {
-		fValue = value;
-	}
-
-	short getError() {
-		if (getName() == null) {
-			return MetaModelErrors.ERROR_NOT_DEFINED;
-		}
-		else if (getUnitString() == null) {
-			return MetaModelErrors.ERROR_NO_CHILD;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-
-	private String fValue = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMetaModelImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMetaModelImpl.java
deleted file mode 100644
index 85725d4..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMetaModelImpl.java
+++ /dev/null
@@ -1,95 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMStyleSheet;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-
-
-class CSSMetaModelImpl extends CSSMMNodeImpl implements CSSMetaModel {
-	// class CSSMetaModelImpl implements CSSMetaModel {
-	public CSSMetaModelImpl() {
-		super();
-		fNodePool = new NodePool();
-	}
-
-	public String getType() {
-		return TYPE_META_MODEL;
-	}
-
-	public String getName() {
-		return NAME_NOT_AVAILABLE;
-	}
-
-	/*
-	 * @see CSSMMNodeImpl#canContain(CSSMMNode)
-	 */
-	boolean canContain(CSSMMNode child) {
-		if (child == null) {
-			return false;
-		}
-		String type = child.getType();
-		return (type == TYPE_STYLE_SHEET || type == TYPE_CATEGORY);
-	}
-
-	public CSSMMStyleSheet getStyleSheet() {
-		Iterator i = getChildNodes();
-		while (i.hasNext()) {
-			CSSMMNode node = (CSSMMNode) i.next();
-			if (node.getType() == TYPE_STYLE_SHEET) {
-				return (CSSMMStyleSheet) node;
-			}
-		}
-		return null;
-		// return fStyleSheet;
-	}
-
-	public Iterator getCategories() {
-		List categories = new ArrayList();
-		Iterator i = getChildNodes();
-		while (i.hasNext()) {
-			CSSMMNode node = (CSSMMNode) i.next();
-			if (node.getType() == TYPE_CATEGORY) {
-				categories.add(node);
-			}
-		}
-		return categories.iterator();
-	}
-
-	void loadCompleted() {
-		fNodePool = null;
-	}
-
-	// List fCategories = null;
-	/*
-	 * @see CSSMMNodeImpl#isValid()
-	 */
-	short getError() {
-		if (getStyleSheet() != null) {
-			return MetaModelErrors.ERROR_NO_CHILD;
-		}
-		else {
-			return MetaModelErrors.NO_ERROR;
-		}
-	}
-
-	NodePool getNodePool() {
-		return fNodePool;
-	}
-
-
-	private NodePool fNodePool = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileImpl.java
deleted file mode 100644
index ab81cd7..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileImpl.java
+++ /dev/null
@@ -1,158 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.osgi.framework.Bundle;
-
-
-
-class CSSProfileImpl implements CSSProfile {
-
-	/**
-	 * Constructor for CSSMetaModelProfileInfoImpl.
-	 */
-	private CSSProfileImpl() {
-		super();
-	}
-
-	/**
-	 * Constructor for CSSMetaModelProfileInfoImpl.
-	 */
-	public CSSProfileImpl(String id, URL url) {
-		super();
-		fID = id;
-		fURL = url;
-	}
-
-	/*
-	 * @see CSSMetaModelProfileInfo#getProfileID()
-	 */
-	public String getProfileID() {
-		return fID;
-	}
-
-	/*
-	 * @see CSSMetaModelProfileInfo#getProfileName()
-	 */
-	public String getProfileName() {
-		return (fName == null) ? fID : fName;
-	}
-
-	public CSSMetaModel getMetaModel() {
-		if (fMetaModel == null) {
-			try {
-				InputStream input = getProfileURL().openStream();
-				ProfileLoader loader = new ProfileLoader(getResourceBundle(), getLogging());
-				fMetaModel = loader.loadProfile(input);
-			}
-			catch (IOException e) {
-				Logger.logException("Cannot open stream for profile", e); //$NON-NLS-1$
-			}
-		}
-		return fMetaModel;
-	}
-
-	private ResourceBundle getResourceBundle() {
-		ClassLoader targetLoader = null;
-		String pluginID = getOwnerPluginID();
-		if (pluginID != null) {
-			Bundle bundle = Platform.getBundle(pluginID);
-			if (bundle != null) {
-				targetLoader = bundle.getClass().getClassLoader();
-			}
-		}
-		if (targetLoader == null) {
-			targetLoader = this.getClass().getClassLoader();
-		}
-
-		String profileURLString = getProfileURL().toString();
-		int lastSlashPos = profileURLString.lastIndexOf('/');
-		if (1 < lastSlashPos) {
-			String profileURLBase = profileURLString.substring(0, lastSlashPos + 1);
-			try {
-				URL[] urls = new URL[]{new URL(profileURLBase)};
-				targetLoader = URLClassLoader.newInstance(urls, targetLoader);
-			}
-			catch (MalformedURLException e) {
-			}
-		}
-
-		try {
-			return ResourceBundle.getBundle("cssprofile", //$NON-NLS-1$
-						Locale.getDefault(), targetLoader);
-		}
-		catch (MissingResourceException e) {
-			return null;
-		}
-	}
-
-	/*
-	 * @see CSSMetaModelProfileInfo#getProfileURL()
-	 */
-	public URL getProfileURL() {
-		return fURL;
-	}
-
-	void setProfileName(String name) {
-		fName = name;
-	}
-
-	public boolean isDefault() {
-		return fDefault;
-	}
-
-	void setDefault(boolean isDefault) {
-		fDefault = isDefault;
-	}
-
-	public String getOwnerPluginID() {
-		return fOwnerPluginID;
-	}
-
-	void setOwnerPluginID(String pluginID) {
-		fOwnerPluginID = pluginID;
-	}
-
-	/**
-	 * hidden option : logging
-	 */
-	void setLogging(boolean logging) {
-		fLogging = logging;
-	}
-
-	boolean getLogging() {
-		return fLogging;
-	}
-
-
-	String fID = null;
-	String fName = null;
-	URL fURL = null;
-	CSSMetaModel fMetaModel = null;
-	String fOwnerPluginID = null;
-	boolean fDefault = false;
-	boolean fLogging = false;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileTest.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileTest.java
deleted file mode 100644
index 6711596..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileTest.java
+++ /dev/null
@@ -1,73 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-
-
-class CSSProfileTest {
-
-
-	/**
-	 * Test use only
-	 */
-	public static void main(String[] args) {
-		if (args.length == 0)
-			return;
-		CSSMetaModel metamodel = null;
-		try {
-			CSSProfile profile = new CSSProfileImpl("test", new URL(args[0])); //$NON-NLS-1$
-			metamodel = profile.getMetaModel();
-		}
-		catch (MalformedURLException e) {
-			Logger.logException(e);
-		}
-		if (metamodel == null) {
-			return;
-		}
-		/*
-		 * CSSMMTypeCollector collector = new CSSMMTypeCollector();
-		 * collector.apply(metamodel, CSSMMNode.TYPE_PROPERTY); Iterator
-		 * iProperty = collector.getNodes(); while (iProperty.hasNext()) {
-		 * CSSMMNode node = (CSSMMNode)iProperty.next();
-		 * System.out.println("Property " + node.getName() + " can contain:");
-		 * //$NON-NLS-2$ //$NON-NLS-1$ Iterator iValue =
-		 * node.getDescendants(); while (iValue.hasNext()) {
-		 * debugOut((CSSMMNode)iValue.next(), 0, false); } }
-		 */
-		debugOut(metamodel, 0, true);
-	}
-
-	static void debugOut(CSSMMNode node, int depth, boolean recursive) {
-		String type = node.getType();
-		for (int i = 0; i < depth; i++) {
-			System.out.print("\t"); //$NON-NLS-1$
-		}
-		System.out.print("[ " + node.getName() + "(" + type + ") ]"); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
-		if (type == CSSMMNode.TYPE_UNIT || type == CSSMMNode.TYPE_KEYWORD || type == CSSMMNode.TYPE_FUNCTION || type == CSSMMNode.TYPE_SELECTOR) {
-			System.out.print(" -> " + node.toString()); //$NON-NLS-1$
-		}
-		System.out.println();
-
-		if (recursive) {
-			java.util.Iterator iNode = node.getChildNodes();
-			while (iNode.hasNext()) {
-				debugOut((CSSMMNode) iNode.next(), depth + 1, true);
-			}
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/MetaModelErrors.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/MetaModelErrors.java
deleted file mode 100644
index 968c58e..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/MetaModelErrors.java
+++ /dev/null
@@ -1,30 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-interface MetaModelErrors {
-
-	static final short NO_ERROR = 0;
-
-	// MASK
-	static final short MASK_WARNING = 0x1000;
-	static final short MASK_ERROR = 0x2000;
-
-	// ERROR
-	static final short ERROR_NOT_DEFINED = MASK_ERROR + 0x01;
-	static final short ERROR_INVALID_NAME = MASK_ERROR + 0x04;
-	static final short ERROR_INVAILD_CHILD = MASK_ERROR + 0x02;
-	static final short ERROR_NO_CHILD = MASK_ERROR + 0x08;
-	// static final short ERROR_NO_ESSENTIAL_CHILD = MASK_ERROR + 0x10
-
-	// WARNING
-	static final short WARNING_HAS_NO_CHILD = MASK_WARNING + 0x01;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/NodePool.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/NodePool.java
deleted file mode 100644
index 7d5dd2f..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/NodePool.java
+++ /dev/null
@@ -1,171 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.css.core.internal.Logger;
-
-
-
-class NodePool {
-
-	NodePool() {
-		super();
-		initializeClassNameTable();
-	}
-
-	CSSMMNodeImpl getNode(String tagName, String nodeName) {
-		if (nodeName != null) {
-			nodeName = nodeName.toLowerCase();
-		}
-		String className = (String) classNames.get(tagName);
-		if (className == null) {
-			return null;
-		}
-		Map nodes = (Map) nodeRegistry.get(className);
-		if (nodes == null) {
-			nodes = new HashMap();
-			nodeRegistry.put(className, nodes);
-		}
-		CSSMMNodeImpl node = (CSSMMNodeImpl) nodes.get(nodeName);
-		if (node == null) {
-			node = createNewNode(className);
-			nodes.put(nodeName, node);
-		}
-		return node;
-	}
-
-	private CSSMMNodeImpl createNewNode(String className) {
-		CSSMMNodeImpl node = null;
-		if (className != null) {
-			className = getPackageName() + "." + className; //$NON-NLS-1$
-			try {
-				node = (CSSMMNodeImpl) Class.forName(className).newInstance();
-			}
-			catch (IllegalAccessException e) {
-				Logger.logException(e);
-			}
-			catch (InstantiationException e) {
-				Logger.logException(e);
-			}
-			catch (ClassNotFoundException e) {
-				Logger.logException(e);
-			}
-		}
-		// System.out.println(className + " is Created");
-		return node;
-	}
-
-	/**
-	 * Error check function: find nodes that are not referred by any node
-	 */
-	Iterator getStrayNodes() {
-		List strayNodes = new ArrayList();
-		Iterator iMap = nodeRegistry.values().iterator();
-		while (iMap.hasNext()) {
-			Map nodes = (Map) iMap.next();
-			Iterator iNode = nodes.values().iterator();
-			while (iNode.hasNext()) {
-				CSSMMNodeImpl node = (CSSMMNodeImpl) iNode.next();
-				if (node.getReferenceCount() == 0) {
-					strayNodes.add(node);
-				}
-			}
-		}
-		return strayNodes.iterator();
-	}
-
-	// This class must not be inner class :)
-	private String getPackageName() {
-		if (fPackageName == null) {
-			String className = getClass().getName();
-			int pos = className.lastIndexOf('.');
-			if (0 < pos) {
-				fPackageName = className.substring(0, pos);
-			}
-			else {
-				fPackageName = ""; //$NON-NLS-1$
-			}
-		}
-		return fPackageName;
-	}
-
-	void initializeClassNameTable() {
-		classNames.put(ProfileKeywords.STYLESHEET_DEF, CLASS_STYLE_SHEET);
-		classNames.put(ProfileKeywords.CHARSET_RULE_DEF, CLASS_CHARSET_RULE);
-		classNames.put(ProfileKeywords.CHARSET_RULE, CLASS_CHARSET_RULE);
-		classNames.put(ProfileKeywords.FONTFACE_RULE_DEF, CLASS_FONT_FACE_RULE);
-		classNames.put(ProfileKeywords.FONTFACE_RULE, CLASS_FONT_FACE_RULE);
-		classNames.put(ProfileKeywords.IMPORT_RULE_DEF, CLASS_IMPORT_RULE);
-		classNames.put(ProfileKeywords.IMPORT_RULE, CLASS_IMPORT_RULE);
-		classNames.put(ProfileKeywords.MEDIA_RULE_DEF, CLASS_MEDIA_RULE);
-		classNames.put(ProfileKeywords.MEDIA_RULE, CLASS_MEDIA_RULE);
-		classNames.put(ProfileKeywords.PAGE_RULE_DEF, CLASS_PAGE_RULE);
-		classNames.put(ProfileKeywords.PAGE_RULE, CLASS_PAGE_RULE);
-		classNames.put(ProfileKeywords.STYLE_RULE_DEF, CLASS_STYLE_RULE);
-		classNames.put(ProfileKeywords.STYLE_RULE, CLASS_STYLE_RULE);
-		classNames.put(ProfileKeywords.PROPERTY_DEF, CLASS_PROPERTY);
-		classNames.put(ProfileKeywords.PROPERTY, CLASS_PROPERTY);
-		classNames.put(ProfileKeywords.DESCRIPTOR_DEF, CLASS_DESCRIPTOR);
-		classNames.put(ProfileKeywords.DESCRIPTOR, CLASS_DESCRIPTOR);
-		classNames.put(ProfileKeywords.CONTAINER_DEF, CLASS_CONTAINER);
-		classNames.put(ProfileKeywords.CONTAINER, CLASS_CONTAINER);
-		classNames.put(ProfileKeywords.NUMBER_DEF, CLASS_NUMBER);
-		classNames.put(ProfileKeywords.NUMBER, CLASS_NUMBER);
-		classNames.put(ProfileKeywords.KEYWORD_DEF, CLASS_KEYWORD);
-		classNames.put(ProfileKeywords.KEYWORD, CLASS_KEYWORD);
-		classNames.put(ProfileKeywords.UNIT, CLASS_UNIT);
-		classNames.put(ProfileKeywords.UNIT_DEF, CLASS_UNIT);
-		classNames.put(ProfileKeywords.FUNCTION, CLASS_FUNCTION);
-		classNames.put(ProfileKeywords.FUNCTION_DEF, CLASS_FUNCTION);
-		classNames.put(ProfileKeywords.SELECTOR_EXPRESSION, CLASS_SELECTOR_EXPRESSION);
-		classNames.put(ProfileKeywords.PSEUDO_ELEMENT, CLASS_PSEUDO_ELEMENT);
-		classNames.put(ProfileKeywords.PSEUDO_ELEMENT_DEF, CLASS_PSEUDO_ELEMENT);
-		classNames.put(ProfileKeywords.PSEUDO_CLASS, CLASS_PSEUDO_CLASS);
-		classNames.put(ProfileKeywords.PSEUDO_CLASS_DEF, CLASS_PSEUDO_CLASS);
-		classNames.put(ProfileKeywords.STRING, CLASS_STRING);
-		classNames.put(ProfileKeywords.CATEGORY_DEF, CLASS_CATEGORY);
-	}
-
-
-	private String fPackageName;
-	/*
-	 * Conversion Tables nodeRegistry : class name -> hash of node instances
-	 * classNames : Profile Tag name -> java class name
-	 */
-	private Map nodeRegistry = new HashMap();
-	private Map classNames = new HashMap();
-
-	private final static String CLASS_STYLE_SHEET = "CSSMMStyleSheetImpl"; //$NON-NLS-1$
-	private final static String CLASS_CHARSET_RULE = "CSSMMCharsetRuleImpl"; //$NON-NLS-1$
-	private final static String CLASS_FONT_FACE_RULE = "CSSMMFontFaceRuleImpl"; //$NON-NLS-1$
-	private final static String CLASS_IMPORT_RULE = "CSSMMImportRuleImpl"; //$NON-NLS-1$
-	private final static String CLASS_MEDIA_RULE = "CSSMMMediaRuleImpl"; //$NON-NLS-1$
-	private final static String CLASS_PAGE_RULE = "CSSMMPageRuleImpl"; //$NON-NLS-1$
-	private final static String CLASS_STYLE_RULE = "CSSMMStyleRuleImpl"; //$NON-NLS-1$
-	private final static String CLASS_PROPERTY = "CSSMMPropertyImpl"; //$NON-NLS-1$
-	private final static String CLASS_DESCRIPTOR = "CSSMMDescriptorImpl"; //$NON-NLS-1$
-	private final static String CLASS_CONTAINER = "CSSMMContainerImpl"; //$NON-NLS-1$
-	private final static String CLASS_NUMBER = "CSSMMNumberImpl"; //$NON-NLS-1$
-	private final static String CLASS_KEYWORD = "CSSMMKeywordImpl"; //$NON-NLS-1$
-	private final static String CLASS_UNIT = "CSSMMUnitImpl"; //$NON-NLS-1$
-	private final static String CLASS_FUNCTION = "CSSMMFunctionImpl"; //$NON-NLS-1$
-	private final static String CLASS_STRING = "CSSMMStringImpl"; //$NON-NLS-1$
-	private final static String CLASS_CATEGORY = "CSSMMCategoryImpl"; //$NON-NLS-1$
-	private final static String CLASS_SELECTOR_EXPRESSION = "CSSMMSelectorExpressionImpl"; //$NON-NLS-1$
-	private final static String CLASS_PSEUDO_CLASS = "CSSMMPseudoClassImpl"; //$NON-NLS-1$
-	private final static String CLASS_PSEUDO_ELEMENT = "CSSMMPseudoElementImpl"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileHandler.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileHandler.java
deleted file mode 100644
index c2b90bd..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileHandler.java
+++ /dev/null
@@ -1,293 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.ResourceBundle;
-import java.util.Stack;
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMSelector;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-
-class ProfileHandler extends DefaultHandler {
-
-	public ProfileHandler(CSSMetaModelImpl metamodel, ResourceBundle resourceBundle, boolean logging) {
-		super();
-		fMetaModel = metamodel;
-		fNodePool = metamodel.getNodePool();
-		fResourceBundle = resourceBundle;
-		fLogging = logging;
-	}
-
-	public ProfileHandler(CSSMetaModelImpl metamodel, ResourceBundle resourceBundle) {
-		super();
-		fMetaModel = metamodel;
-		fNodePool = metamodel.getNodePool();
-		fResourceBundle = resourceBundle;
-		fLogging = false;
-	}
-
-	private String getResourceString(String key) {
-		if (key.equals("%")) { //$NON-NLS-1$
-			return key;
-		}
-		if (!key.startsWith("%")) { //$NON-NLS-1$
-			return key;
-		}
-		if (key.startsWith("%%")) { //$NON-NLS-1$
-			return key.substring(1);
-		}
-
-		if (fResourceBundle != null) {
-			return fResourceBundle.getString(key.substring(1));
-		}
-		else {
-			return key;
-		}
-	}
-
-	public void startDocument() throws SAXException {
-		// System.out.println("startDocument");
-		// fNodeStack.push(metamodel);
-		// fCurrentNode = null;
-	}
-
-	public void endDocument() throws SAXException {
-		new ErrorCorrector().doCorrect(fMetaModel);
-		if (fLogging) {
-			Iterator i = fNodePool.getStrayNodes();
-			while (i.hasNext()) {
-				CSSMMNode node = (CSSMMNode) i.next();
-				String str = "[CSSProfile Warning] " + node.getName(); //$NON-NLS-1$
-				str += "(" + node.getType() + ") is not referred by any node."; //$NON-NLS-1$ //$NON-NLS-2$
-				Logger.log(Logger.WARNING, str);
-				// System.out.println(str);
-			}
-		}
-	}
-
-	public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
-		TagNode tagNode = null;
-		CSSMMNodeImpl parentNode = null;
-		if (0 < fNodeStack.size()) {
-			tagNode = (TagNode) fNodeStack.peek();
-			parentNode = tagNode.node;
-		}
-
-		CSSMMNodeImpl node = null;
-		if (qName.equals(ProfileKeywords.PROFILE_IMPORT)) { // import
-			String profileName = attributes.getValue(ATTR_NAME_REFERENCE);
-			importProfile(profileName);
-		}
-		else if (isDefinition(qName)) { // node creation
-			String nodeName = attributes.getValue(ATTR_NAME_DEFINITION);
-			node = fNodePool.getNode(qName, nodeName);
-			if (node != null) {
-				String overwrite = attributes.getValue(ATTR_OVERWRITE);
-				if (overwrite == null || overwrite.equals(ATTR_VALUE_OVERWRITE_FALSE)) {
-					node.removeAllChildNodes();
-				}
-				Map attrMap = new HashMap();
-				for (int i = 0; i < attributes.getLength(); i++) {
-					attrMap.put(attributes.getQName(i), attributes.getValue(i));
-				}
-				try {
-					node.initializeAttribute(attrMap);
-				}
-				catch (IllegalArgumentException e) {
-					Logger.logException(e);
-				}
-			}
-		}
-		else if (node == null) { // node reference
-			String nodeName = attributes.getValue(ATTR_NAME_REFERENCE);
-			node = fNodePool.getNode(qName, nodeName);
-		}
-
-		if (node != null) {
-			if (parentNode != null && parentNode.canContain(node)) {
-				String enabled = attributes.getValue(ATTR_ENABLED);
-				if (enabled != null && enabled.equals(ATTR_VALUE_ENABLED_FALSE)) {
-					parentNode.removeChild(node);
-				}
-				else {
-					parentNode.appendChild(node);
-				}
-			}
-			else if (node.getType() == CSSMMNode.TYPE_STYLE_SHEET || node.getType() == CSSMMNode.TYPE_CATEGORY) {
-				fMetaModel.appendChild(node);
-			}
-			else {
-				if (fLogging && parentNode != null) {
-					Logger.log(Logger.ERROR, parentNode.getType() + " cannot contain " + //$NON-NLS-1$
-								node.getType() + " (" + qName + ")"); //$NON-NLS-2$//$NON-NLS-1$
-				}
-			}
-		}
-
-		fNodeStack.push(new TagNode(qName, (node != null) ? node : parentNode));
-	}
-
-	public void endElement(String uri, String localName, String qName) throws SAXException {
-		fNodeStack.pop();
-	}
-
-	public void characters(char[] ch, int start, int length) throws SAXException {
-		TagNode tagNode = (TagNode) fNodeStack.peek();
-		String tagName = tagNode.tag;
-		if (tagName.equals(ProfileKeywords.KEYWORD_VALUE) || tagName.equals(ProfileKeywords.UNIT_VALUE) || tagName.equals(ProfileKeywords.FUNCTION_VALUE) || tagName.equals(ProfileKeywords.SELECTOR_VALUE) || tagName.equals(ProfileKeywords.DESCRIPTION) || tagName.equals(ProfileKeywords.CAPTION)) {
-			StringBuffer buf = new StringBuffer(length);
-			for (int i = 0; i < length; i++) {
-				buf.append(ch[start + i]);
-			}
-			String value = getResourceString(buf.toString().trim());
-			CSSMMNodeImpl node = tagNode.node;
-			if (node != null) {
-				if (node.getType() == CSSMMNode.TYPE_KEYWORD && tagName.equals(ProfileKeywords.KEYWORD_VALUE)) {
-					((CSSMMKeywordImpl) node).setKeywordString(value);
-				}
-				else if (node.getType() == CSSMMNode.TYPE_UNIT && tagName.equals(ProfileKeywords.UNIT_VALUE)) {
-					((CSSMMUnitImpl) node).setUnitString(value);
-				}
-				else if (node.getType() == CSSMMNode.TYPE_FUNCTION && tagName.equals(ProfileKeywords.FUNCTION_VALUE)) {
-					((CSSMMFunctionImpl) node).setFunctionString(value);
-				}
-				else if (node.getType() == CSSMMNode.TYPE_SELECTOR && ((CSSMMSelector) node).getSelectorType() == CSSMMSelector.TYPE_PSEUDO_ELEMENT) {
-					((CSSMMPseudoElementImpl) node).setSelectorString(value);
-				}
-				else if (node.getType() == CSSMMNode.TYPE_SELECTOR && ((CSSMMSelector) node).getSelectorType() == CSSMMSelector.TYPE_PSEUDO_CLASS) {
-					((CSSMMPseudoClassImpl) node).setSelectorString(value);
-				}
-				else if (node.getType() == CSSMMNode.TYPE_CATEGORY && tagName.equals(ProfileKeywords.CAPTION)) {
-					((CSSMMCategoryImpl) node).setCaption(value);
-				}
-				else if (tagName.equals(ProfileKeywords.DESCRIPTION)) {
-					node.setDescription(value);
-				}
-			}
-		}
-	}
-
-	private boolean isDefinition(String tagName) {
-		return (tagName.equals(ProfileKeywords.STYLESHEET_DEF) || tagName.equals(ProfileKeywords.CHARSET_RULE_DEF) || tagName.equals(ProfileKeywords.IMPORT_RULE_DEF) || tagName.equals(ProfileKeywords.PAGE_RULE_DEF) || tagName.equals(ProfileKeywords.MEDIA_RULE_DEF) || tagName.equals(ProfileKeywords.FONTFACE_RULE_DEF) || tagName.equals(ProfileKeywords.STYLE_RULE_DEF) || tagName.equals(ProfileKeywords.KEYWORD_DEF) || tagName.equals(ProfileKeywords.NUMBER_DEF) || tagName.equals(ProfileKeywords.PROPERTY_DEF) || tagName.equals(ProfileKeywords.DESCRIPTOR_DEF) || tagName.equals(ProfileKeywords.CONTAINER_DEF) || tagName.equals(ProfileKeywords.UNIT_DEF) || tagName.equals(ProfileKeywords.FUNCTION_DEF) || tagName.equals(ProfileKeywords.STRING) || tagName.equals(ProfileKeywords.CATEGORY_DEF) || tagName.equals(ProfileKeywords.PSEUDO_CLASS_DEF) || tagName.equals(ProfileKeywords.PSEUDO_ELEMENT_DEF) || tagName.equals(ProfileKeywords.SELECTOR_EXPRESSION) || tagName.equals(ProfileKeywords.SEPARATOR));
-	}
-
-	private void importProfile(String profileName) {
-		URL profileURL = null;
-		CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
-		CSSProfile profile = reg.getProfile(profileName);
-		if (profile != null) {
-			// first: find URL by ID
-			profileURL = profile.getProfileURL();
-		}
-		else {
-			// second: find URL by filename of profile URL
-			Iterator i = reg.getProfiles();
-			while (i.hasNext()) {
-				profile = (CSSProfile) i.next();
-				URL url = profile.getProfileURL();
-				if (url.getFile().endsWith(profileName)) {
-					profileURL = url;
-					break;
-				}
-			}
-		}
-		if (profileURL == null) {
-			// final: it may be url itself
-			try {
-				profileURL = new URL(profileName);
-			}
-			catch (MalformedURLException e) {
-				Logger.logException(e);
-			}
-		}
-		if (profileURL != null) {
-			try {
-				ProfileLoader.loadProfile(fMetaModel, profileURL.openStream(), fResourceBundle, fLogging);
-			}
-			catch (IOException e) {
-				Logger.logException("Cannot open stream for profile", //$NON-NLS-1$
-							e);
-			}
-		}
-	}
-
-	class TagNode {
-
-		String tag = null;
-		CSSMMNodeImpl node = null;
-
-		TagNode(String tag, CSSMMNodeImpl node) {
-			this.tag = tag;
-			this.node = node;
-		}
-	}
-
-	class ErrorCorrector {
-
-		void doCorrect(CSSMMNodeImpl node) {
-			Iterator i = node.getChildNodes();
-			ArrayList errorNodes = new ArrayList();
-			while (i.hasNext()) {
-				CSSMMNodeImpl child = (CSSMMNodeImpl) i.next();
-				doCorrect(child);
-				short error = child.getError();
-				if (error != MetaModelErrors.NO_ERROR) {
-					// node.removeChild(child);
-					errorNodes.add(child);
-
-					String str = "[CSSProfile Error] " + node.getName(); //$NON-NLS-1$
-					str += "(" + node.getType() + ") contains error node: "; //$NON-NLS-1$ //$NON-NLS-2$
-					str += child.getName() + "(" + child.getType() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-					str += " - error code = " + error; //$NON-NLS-1$
-					if (fLogging) {
-						Logger.log(Logger.ERROR, str);
-						// System.out.println(str);
-					}
-				}
-			}
-			int errorSize = errorNodes.size();
-			if (errorSize > 0) {
-				for (int j = 0; j < errorSize; j++) {
-					CSSMMNodeImpl errorNode = (CSSMMNodeImpl) errorNodes.get(j);
-					node.removeChild(errorNode);
-				}
-			}
-		}
-	}
-
-
-	private CSSMetaModelImpl fMetaModel = null;
-	private NodePool fNodePool = null;
-	private Stack fNodeStack = new Stack();
-	boolean fLogging = false;
-	private ResourceBundle fResourceBundle = null;
-
-	private final static String ATTR_NAME_DEFINITION = "name"; //$NON-NLS-1$
-	private final static String ATTR_NAME_REFERENCE = "name"; //$NON-NLS-1$
-	private final static String ATTR_OVERWRITE = "overwrite"; //$NON-NLS-1$
-	private final static String ATTR_ENABLED = "enabled"; //$NON-NLS-1$
-	private final static String ATTR_VALUE_OVERWRITE_FALSE = "false"; //$NON-NLS-1$
-	private final static String ATTR_VALUE_ENABLED_FALSE = "false"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileKeywords.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileKeywords.java
deleted file mode 100644
index 468315b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileKeywords.java
+++ /dev/null
@@ -1,58 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-interface ProfileKeywords {
-
-	final static String CSS_PROFILE = "css-profile"; //$NON-NLS-1$
-	final static String PROFILE_IMPORT = "profile-import"; //$NON-NLS-1$
-	final static String STYLESHEET_DEF = "stylesheet-def"; //$NON-NLS-1$
-	final static String CHARSET_RULE = "charset-rule"; //$NON-NLS-1$
-	final static String IMPORT_RULE = "import-rule"; //$NON-NLS-1$
-	final static String PAGE_RULE = "page-rule"; //$NON-NLS-1$
-	final static String MEDIA_RULE = "media-rule"; //$NON-NLS-1$
-	final static String FONTFACE_RULE = "fontface-rule"; //$NON-NLS-1$
-	final static String STYLE_RULE = "style-rule"; //$NON-NLS-1$
-	final static String CHARSET_RULE_DEF = "charset-rule-def"; //$NON-NLS-1$
-	final static String IMPORT_RULE_DEF = "import-rule-def"; //$NON-NLS-1$
-	final static String PAGE_RULE_DEF = "page-rule-def"; //$NON-NLS-1$
-	final static String MEDIA_RULE_DEF = "media-rule-def"; //$NON-NLS-1$
-	final static String FONTFACE_RULE_DEF = "fontface-rule-def"; //$NON-NLS-1$
-	final static String STYLE_RULE_DEF = "style-rule-def"; //$NON-NLS-1$
-	final static String FUNCTION_DEF = "function-def"; //$NON-NLS-1$
-	final static String FUNCTION_VALUE = "function-value"; //$NON-NLS-1$
-	final static String KEYWORD_DEF = "keyword-def"; //$NON-NLS-1$
-	final static String KEYWORD_VALUE = "keyword-value"; //$NON-NLS-1$
-	final static String DESCRIPTION = "description"; //$NON-NLS-1$
-	final static String NUMBER_DEF = "number-def"; //$NON-NLS-1$
-	final static String UNIT = "unit"; //$NON-NLS-1$
-	final static String UNIT_DEF = "unit-def"; //$NON-NLS-1$
-	final static String UNIT_VALUE = "unit-value"; //$NON-NLS-1$
-	final static String CONTAINER_DEF = "container-def"; //$NON-NLS-1$
-	final static String CATEGORY_DEF = "category-def"; //$NON-NLS-1$
-	final static String CAPTION = "caption"; //$NON-NLS-1$
-	final static String PROPERTY_DEF = "property-def"; //$NON-NLS-1$
-	final static String DESCRIPTOR_DEF = "descriptor-def"; //$NON-NLS-1$
-	final static String SELECTOR_EXPRESSION = "selector-expression"; //$NON-NLS-1$
-	final static String PSEUDO_CLASS = "pseudo-class"; //$NON-NLS-1$
-	final static String PSEUDO_ELEMENT = "pseudo-element"; //$NON-NLS-1$
-	final static String PSEUDO_CLASS_DEF = "pseudo-class-def"; //$NON-NLS-1$
-	final static String PSEUDO_ELEMENT_DEF = "pseudo-element-def"; //$NON-NLS-1$
-	final static String SELECTOR_VALUE = "selector-value"; //$NON-NLS-1$
-	final static String NUMBER = "number"; //$NON-NLS-1$
-	final static String KEYWORD = "keyword"; //$NON-NLS-1$
-	final static String FUNCTION = "function"; //$NON-NLS-1$
-	final static String CONTAINER = "container"; //$NON-NLS-1$
-	final static String STRING = "string"; //$NON-NLS-1$
-	final static String SEPARATOR = "separator"; //$NON-NLS-1$
-	final static String PROPERTY = "property"; //$NON-NLS-1$
-	final static String DESCRIPTOR = "descriptor"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileLoader.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileLoader.java
deleted file mode 100644
index 18262e1..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileLoader.java
+++ /dev/null
@@ -1,72 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ResourceBundle;
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-
-
-
-class ProfileLoader {
-
-
-	/**
-	 * Constructor for ProfileLoader.
-	 */
-	private ProfileLoader() {
-		super();
-	}
-
-	ProfileLoader(ResourceBundle resourceBundle, boolean logging) {
-		super();
-		fResourceBundle = resourceBundle;
-		fLogging = logging;
-	}
-
-	static void loadProfile(CSSMetaModelImpl metamodel, InputStream input, ResourceBundle resourceBundle, boolean logging) {
-		try {
-			XMLReader xmlReader = XMLReaderUtil.createXMLReader(PARSER_NAME);
-			// XMLReaderFactory.createXMLReader(PARSER_NAME);
-			xmlReader.setContentHandler(new ProfileHandler(metamodel, resourceBundle, logging));
-			xmlReader.parse(new InputSource(input));
-		}
-		catch (IOException e) {
-			Logger.logException(e);
-		}
-		catch (SAXException e) {
-			Logger.logException(e);
-		}
-	}
-
-	CSSMetaModel loadProfile(InputStream input) {
-		if (fMetaModel == null) {
-			fMetaModel = new CSSMetaModelImpl();
-		}
-		loadProfile(fMetaModel, input, fResourceBundle, fLogging);
-		fMetaModel.loadCompleted();
-		return fMetaModel;
-	}
-
-
-	CSSMetaModelImpl fMetaModel = null;
-	private final static String PARSER_NAME = "org.apache.xerces.parsers.SAXParser"; //$NON-NLS-1$
-	private ResourceBundle fResourceBundle = null;
-	private boolean fLogging = false;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/RegistryReader.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/RegistryReader.java
deleted file mode 100644
index c328e2c..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/RegistryReader.java
+++ /dev/null
@@ -1,112 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-
-
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.osgi.framework.Bundle;
-
-
-
-public class RegistryReader {
-
-	//
-	private String PLUGIN_ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
-	private String EXTENSION_POINT_ID = "cssprofile"; //$NON-NLS-1$
-	private String TAG_NAME = "profile"; //$NON-NLS-1$
-	private String ATT_ID = "id"; //$NON-NLS-1$
-	private String ATT_NAME = "name"; //$NON-NLS-1$
-	private String ATT_URI = "uri"; //$NON-NLS-1$
-	private String ATT_DEFAULT = "default"; //$NON-NLS-1$
-	private String ATT_LOGGING = "logging"; // Hidden Option //$NON-NLS-1$
-
-	/**
-	 * Constructor for CSSMetaModelRegistryReader.
-	 */
-	public RegistryReader() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected CSSProfile readElement(IConfigurationElement element) {
-		CSSProfileImpl info = null;
-		if (element.getName().equals(TAG_NAME)) {
-			String strID = element.getAttribute(ATT_ID);
-			String strNAME = element.getAttribute(ATT_NAME);
-			String strURI = element.getAttribute(ATT_URI);
-
-			if (strID != null || strURI != null) {
-				Bundle bundle = null;
-				String pluginId = element.getDeclaringExtension().getNamespace();
-				bundle = Platform.getBundle(pluginId);
-				if (bundle != null) {
-					Path path = new Path(strURI);
-					URL url = Platform.find(bundle, path);
-					if (url != null) {
-						try {
-							url = Platform.asLocalURL(url);
-							info = new CSSProfileImpl(strID, url);
-							info.setProfileName(strNAME);
-							info.setDefault((element.getAttribute(ATT_DEFAULT) != null));
-							info.setLogging((element.getAttribute(ATT_LOGGING) != null));
-							info.setOwnerPluginID(pluginId);
-						}
-						catch (java.io.IOException e) {
-							// through
-						}
-					}
-				}
-			}
-
-			if (info == null) {
-				Logger.log(Logger.ERROR, "Error reading CSS Profile: " + strID); //$NON-NLS-1$
-			}
-		}
-		return info;
-	}
-
-	/**
-	 * We simply require an 'add' method, of what ever it is we are to read
-	 * into
-	 */
-	public Iterator enumProfiles() {
-		Set set = new HashSet();
-		IExtensionRegistry registry = Platform.getExtensionRegistry();
-		IExtensionPoint point = registry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
-		if (point != null) {
-			IConfigurationElement[] elements = point.getConfigurationElements();
-			for (int i = 0; i < elements.length; i++) {
-				CSSProfile info = readElement(elements[i]);
-				// null can be returned if there's an error reading the
-				// element
-				if (info != null) {
-					set.add(info);
-				}
-			}
-		}
-		return set.iterator();
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ValueCollector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ValueCollector.java
deleted file mode 100644
index b42dead..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ValueCollector.java
+++ /dev/null
@@ -1,50 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelTraverser;
-
-
-
-class ValueCollector extends CSSMetaModelTraverser {
-	public void begin(CSSMMNode node) {
-		fNodes = new ArrayList();
-	}
-
-	protected short preNode(CSSMMNode node) {
-		short rc = TRAV_CONT;
-		if (node != null) {
-			String type = node.getType();
-			if (type == CSSMMNode.TYPE_PROPERTY || type == CSSMMNode.TYPE_DESCRIPTOR || type == CSSMMNode.TYPE_CONTAINER) {
-				rc = TRAV_CONT;
-			}
-			else {
-				if (!fNodes.contains(node)) {
-					fNodes.add(node);
-					rc = TRAV_PRUNE;
-				}
-			}
-		}
-		return rc;
-	}
-
-	public Iterator getNodes() {
-		return fNodes.iterator();
-	}
-
-
-	private List fNodes = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/XMLReaderUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/XMLReaderUtil.java
deleted file mode 100644
index 2e894cd..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/XMLReaderUtil.java
+++ /dev/null
@@ -1,38 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.metamodelimpl;
-
-
-
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-
-
-class XMLReaderUtil {
-
-	static public XMLReader createXMLReader(String className) throws SAXException {
-		try {
-			return SAXParserFactory.newInstance().newSAXParser().getXMLReader();
-		}
-		catch (ParserConfigurationException e) {
-			Logger.logException(e);
-		}
-		catch (FactoryConfigurationError e) {
-			Logger.logException(e);
-		}
-		return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/CSSModelLoader.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/CSSModelLoader.java
deleted file mode 100644
index 644e7d7..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/CSSModelLoader.java
+++ /dev/null
@@ -1,54 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.modelhandler;
-
-
-import org.eclipse.wst.css.core.internal.document.CSSModelImpl;
-import org.eclipse.wst.css.core.internal.encoding.CSSDocumentLoader;
-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.IStructuredModel;
-
-
-/**
- * 
- */
-public class CSSModelLoader extends AbstractModelLoader {
-	/**
-	 * CSSLoader constructor comment.
-	 */
-	public CSSModelLoader() {
-		super();
-	}
-
-	/*
-	 * @see IModelLoader#newModel()
-	 */
-	public IStructuredModel newModel() {
-		IStructuredModel model = new CSSModelImpl();
-		// now done in create
-		// model.setStructuredDocument(createNewStructuredDocument());
-		// model.setFactoryRegistry(defaultFactoryRegistry());
-		return model;
-	}
-
-	public IModelLoader newInstance() {
-		return new CSSModelLoader();
-	}
-
-	public IDocumentLoader getDocumentLoader() {
-		if (documentLoaderInstance == null) {
-			documentLoaderInstance = new CSSDocumentLoader();
-		}
-		return documentLoaderInstance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/ModelHandlerForCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/ModelHandlerForCSS.java
deleted file mode 100644
index 222d816..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/ModelHandlerForCSS.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.modelhandler;
-
-import org.eclipse.wst.css.core.internal.encoding.CSSDocumentCharsetDetector;
-import org.eclipse.wst.css.core.internal.encoding.CSSDocumentLoader;
-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;
-
-
-public class ModelHandlerForCSS 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.wst.css.core.csssource"; //$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.css.core.modelhandler"; //$NON-NLS-1$
-
-	public ModelHandlerForCSS() {
-		super();
-		setId(ModelHandlerID);
-		setAssociatedContentTypeId(AssociatedContentTypeID);
-	}
-
-	public IDocumentCharsetDetector getEncodingDetector() {
-		return new CSSDocumentCharsetDetector();
-	}
-
-	public IDocumentLoader getDocumentLoader() {
-		return new CSSDocumentLoader();
-	}
-
-	/*
-	 * @see ContentTypeDescription#getModelLoader()
-	 */
-	public IModelLoader getModelLoader() {
-		return new CSSModelLoader();
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSRegionUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSRegionUtil.java
deleted file mode 100644
index f9ca54f..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSRegionUtil.java
+++ /dev/null
@@ -1,51 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.parser;
-
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-
-
-public class CSSRegionUtil {
-
-	/**
-	 */
-	public static boolean isDeclarationValueType(String type) {
-		return (type == CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION || type == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION || type == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH || type == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT || type == CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT || type == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR || type == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE || type == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE || type == CSSRegionContexts.CSS_DECLARATION_VALUE_S || type == CSSRegionContexts.CSS_DECLARATION_VALUE_STRING || type == CSSRegionContexts.CSS_DECLARATION_VALUE_UNICODE_RANGE || type == CSSRegionContexts.CSS_DECLARATION_VALUE_URI);
-	}
-
-	/**
-	 * these type can be beggining of selector
-	 */
-	public static boolean isSelectorBegginingType(String type) {
-		return (type == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || type == CSSRegionContexts.CSS_SELECTOR_UNIVERSAL || type == CSSRegionContexts.CSS_SELECTOR_PSEUDO || type == CSSRegionContexts.CSS_SELECTOR_CLASS || type == CSSRegionContexts.CSS_SELECTOR_ID || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START);
-	}
-
-
-	/**
-	 * 
-	 * @param type
-	 * @return
-	 */
-	public static boolean isDeclarationType(String type) {
-		return (type == CSSRegionContexts.CSS_DECLARATION_PROPERTY || type == CSSRegionContexts.CSS_DECLARATION_SEPARATOR || isDeclarationValueType(type) || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER);
-	}
-
-	/**
-	 * These types consist selector region
-	 * 
-	 * @param type
-	 * @return
-	 */
-	public static boolean isSelectorType(String type) {
-		return (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE || type == CSSRegionContexts.CSS_SELECTOR_CLASS || type == CSSRegionContexts.CSS_SELECTOR_COMBINATOR || type == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || type == CSSRegionContexts.CSS_SELECTOR_ID || type == CSSRegionContexts.CSS_SELECTOR_PSEUDO || type == CSSRegionContexts.CSS_SELECTOR_SEPARATOR || type == CSSRegionContexts.CSS_SELECTOR_UNIVERSAL);
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSSourceParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSSourceParser.java
deleted file mode 100644
index c4dfa05..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSSourceParser.java
+++ /dev/null
@@ -1,249 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.parser;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-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.util.Debug;
-
-
-public class CSSSourceParser implements RegionParser {
-	public static final int MODE_STYLESHEET = 0;
-	public static final int MODE_DECLARATION = 1;
-	public static final int MODE_DECLARATION_VALUE = 2;
-
-	private long fStartTime;
-	private long fStopTime;
-	private CSSTokenizer fTokenizer;
-
-	public void setParserMode(int mode) {
-		int initialState;
-		int bufsize;
-		switch (mode) {
-			case MODE_STYLESHEET :
-				initialState = CSSTokenizer.YYINITIAL;
-				bufsize = CSSTokenizer.BUFFER_SIZE_NORMAL;
-				break;
-			case MODE_DECLARATION :
-				initialState = CSSTokenizer.ST_DECLARATION;
-				bufsize = CSSTokenizer.BUFFER_SIZE_NORMAL;
-				break;
-			case MODE_DECLARATION_VALUE :
-				initialState = CSSTokenizer.ST_DECLARATION_PRE_VALUE;
-				bufsize = CSSTokenizer.BUFFER_SIZE_SMALL;
-				break;
-			default :
-				return;
-		}
-		if (0 < initialState) {
-			CSSTokenizer tokenizer = getTokenizer();
-			tokenizer.setInitialState(initialState);
-			tokenizer.setInitialBufferSize(bufsize);
-		}
-	}
-
-	public IStructuredDocumentRegion getDocumentRegions() {
-		IStructuredDocumentRegion headnode = null;
-		if (headnode == null) {
-			if (Debug.perfTest) {
-				fStartTime = System.currentTimeMillis();
-			}
-			headnode = parseNodes();
-			if (Debug.perfTest) {
-				fStopTime = System.currentTimeMillis();
-				System.out.println(" -- creating nodes of IStructuredDocument -- "); //$NON-NLS-1$
-				System.out.println(" Time parse and init all regions: " + (fStopTime - fStartTime) + " (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;
-	}
-
-	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;
-	}
-
-	public void reset(Reader reader) {
-		primReset();
-		getTokenizer().reset(reader, 0);
-	}
-
-	public void reset(Reader reader, int offset) {
-		reset(reader);
-	}
-
-	public void reset(String input) {
-		reset(new StringReader(input));
-	}
-
-	public void reset(String input, int offset) {
-		reset(input);
-	}
-
-	public RegionParser newInstance() {
-		return new CSSSourceParser();
-	}
-
-	private 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;
-		String currentRegionType = null;
-
-		while ((region = getNextRegion()) != null) {
-			type = region.getType();
-			if (mustBeStart(type, currentRegionType) && currentNode != null) {
-				currentNode.setEnded(true);
-			}
-
-			if ((currentNode != null && currentNode.isEnded()) || currentNode == null) {
-				if (currentNode != null && !currentNode.isEnded()) {
-					currentNode.setEnded(true);
-				}
-				lastNode = currentNode;
-				currentNode = createStructuredDocumentRegion(type);
-				currentRegionType = 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());
-
-			if (mustBeEnd(type)) {
-				currentNode.setEnded(true);
-			}
-
-			if (headNode == null && currentNode != null) {
-				headNode = currentNode;
-			}
-		}
-
-		if (currentNode != null && !currentNode.isEnded()) {
-			currentNode.setEnded(true);
-		}
-
-		primReset();
-		return headNode;
-	}
-
-	private IStructuredDocumentRegion createStructuredDocumentRegion(String type) {
-		return CSSStructuredDocumentRegionFactory.createRegion(type);
-	}
-
-	private boolean mustBeStart(String type, String docRegionType) {
-		return ((type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_LBRACE || type == CSSRegionContexts.CSS_RBRACE || type == CSSRegionContexts.CSS_IMPORT || type == CSSRegionContexts.CSS_PAGE || type == CSSRegionContexts.CSS_MEDIA || type == CSSRegionContexts.CSS_FONT_FACE || type == CSSRegionContexts.CSS_CHARSET || type == CSSRegionContexts.CSS_ATKEYWORD || type == CSSRegionContexts.CSS_DECLARATION_PROPERTY || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) || (docRegionType == CSSRegionContexts.CSS_DECLARATION_PROPERTY && type == CSSRegionContexts.CSS_S) || (!CSSRegionUtil.isSelectorBegginingType(docRegionType) && (type == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || type == CSSRegionContexts.CSS_SELECTOR_UNIVERSAL || type == CSSRegionContexts.CSS_SELECTOR_PSEUDO || type == CSSRegionContexts.CSS_SELECTOR_CLASS || type == CSSRegionContexts.CSS_SELECTOR_ID || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START)));
-	}
-
-	private boolean mustBeEnd(String type) {
-		return (type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_LBRACE || type == CSSRegionContexts.CSS_RBRACE || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER);
-	}
-
-	private 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;
-	}
-
-	private void primReset() {
-
-		getTokenizer().reset(new char[0]);
-	}
-
-	private CSSTokenizer getTokenizer() {
-		if (fTokenizer == null) {
-			fTokenizer = new CSSTokenizer();
-		}
-		return fTokenizer;
-	}
-
-
-	/**
-	 * This is a simple utility to count nodes. Used only for debug
-	 * statements.
-	 */
-	private int _countNodes(IStructuredDocumentRegion nodes) {
-		int result = 0;
-		IStructuredDocumentRegion countNode = nodes;
-		while (countNode != null) {
-			result++;
-			countNode = countNode.getNext();
-		}
-		return result;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSStructuredDocumentRegionFactory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSStructuredDocumentRegionFactory.java
deleted file mode 100644
index 7e7a240..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSStructuredDocumentRegionFactory.java
+++ /dev/null
@@ -1,27 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocumentRegion;
-
-public class CSSStructuredDocumentRegionFactory {
-	public static IStructuredDocumentRegion createRegion(String type) {
-		IStructuredDocumentRegion instance = null;
-		if (type != null) {
-			instance = new BasicStructuredDocumentRegion();
-		}
-		else {
-
-		}
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSTokenizer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSTokenizer.java
deleted file mode 100644
index 8929283..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSTokenizer.java
+++ /dev/null
@@ -1,1221 +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
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 04/10/01 22:53 */
-
-/*nlsXXX*/
-package org.eclipse.wst.css.core.internal.parser;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.parser.regions.CSSTextRegionFactory;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-
-/**
- * This class is a scanner generated by <a
- * href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex </a> 1.2.2
- */
-public class CSSTokenizer implements CSSRegionContexts {
-
-	/** this character denotes the end of file */
-	final public static int YYEOF = -1;
-
-	/** lexical states */
-	final public static int ST_SELECTOR_ATTRIBUTE_NAME = 11;
-	final public static int ST_IMPORT_DELIMITER = 5;
-	final public static int ST_DECLARATION_PRE_VALUE = 17;
-	final public static int ST_SELECTOR = 0;
-	final public static int ST_CHARSET_DELIMITER = 2;
-	final public static int ST_DECLARATION_VALUE = 18;
-	final public static int ST_PAGE_PSEUDO_PAGE = 8;
-	final public static int ST_IMPORT_URI = 3;
-	final public static int ST_SELECTOR_ATTRIBUTE_END = 14;
-	final public static int ST_SELECTOR_ATTRIBUTE_OPERATOR = 12;
-	final public static int ST_DECLARATION = 15;
-	final public static int ST_PAGE_DELIMITER = 9;
-	final public static int ST_SELECTOR_ATTRIBUTE_VALUE = 13;
-	final public static int ST_MEDIA_MEDIUM = 6;
-	final public static int ST_CHARSET_NAME = 1;
-	final public static int ST_IMPORT_MEDIUM = 4;
-	final public static int ST_DECLARATION_SEPARATOR = 16;
-	final public static int ST_FONT_FACE_DELIMITER = 9;
-	final public static int ST_MEDIA_DELIMITER = 7;
-	final public static int ST_SELECTOR_MODIFIER = 10;
-	final public static int YYINITIAL = 0;
-
-	/**
-	 * Translates characters to character classes
-	 */
-	final private static String yycmap_packed = "\11\0\1\11\1\17\1\0\1\4\1\20\22\0\1\6\1\31\1\10" + "\1\22\1\16\1\72\1\16\1\5\1\26\1\12\1\35\1\14\1\55" + "\1\13\1\15\1\34\12\1\1\62\1\50\1\30\1\67\1\32\1\21" + "\1\36\1\43\1\27\1\40\1\57\1\46\1\64\1\61\1\41\1\51" + "\2\2\1\25\1\52\1\65\1\54\1\53\1\2\1\24\1\44\1\47" + "\1\23\5\2\1\66\1\3\1\71\1\16\1\2\1\16\1\42\1\7" + "\1\37\1\56\1\45\1\63\1\61\1\41\1\51\2\2\1\25\1\52" + "\1\65\1\54\1\53\1\2\1\24\1\44\1\47\1\23\5\2\1\60" + "\1\70\1\33\1\70\1\0\uff80\2";
-
-	/**
-	 * 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, 59, 118, 177, 236, 295, 354, 413, 472, 531, 590, 649, 708, 767, 826, 885, 944, 1003, 1062, 1121, 1180, 1239, 1298, 1357, 1416, 1475, 1534, 1121, 1593, 1121, 1652, 1711, 1121, 1770, 1829, 1888, 1121, 1947, 2006, 2065, 2124, 2183, 2242, 1121, 2301, 2360, 2419, 1121, 1121, 2478, 2537, 2596, 1121, 2655, 2714, 1121, 1121, 2773, 2832, 2891, 1121, 2950, 1121, 3009, 3068, 3127, 3186, 3245, 3304, 3363, 3422, 1121, 1121, 3481, 3540, 3599, 3658, 3717, 1121, 3776, 3835, 3894, 3953, 4012, 4071, 1593, 1121, 4130, 1239, 4189, 4248, 1416, 4307, 1475, 4366, 4425, 4484, 4543, 4602, 4661, 4720, 4779, 4838, 4897, 1770, 4956, 1121, 1829, 5015, 5074, 1947, 5133, 1121, 2006, 5192, 5251, 2183, 5310, 5369, 2360, 5428, 5487, 2537, 5546, 5605, 1121, 2714, 2832, 5664, 5723, 3068, 5782, 3127, 5841, 1121, 3186, 5900, 5959, 3363, 6018, 6077, 6136, 6195, 3894, 1121, 3599, 1121, 6254, 3658, 6313, 1121, 3717, 6372, 6431, 6490, 6549, 3953, 6608, 6667, 6726, 4071, 6785,
-				1121, 4130, 6844, 1121, 6903, 6962, 7021, 7080, 7139, 7198, 7257, 7316, 7375, 7434, 7493, 7552, 1770, 7611, 7670, 1829, 7729, 7788, 1947, 7847, 7906, 2006, 7965, 8024, 8083, 8142, 8201, 8260, 8319, 8378, 3127, 8437, 8496, 3186, 8555, 8614, 8673, 8732, 8791, 3658, 8850, 8909, 3717, 8968, 9027, 9086, 9145, 9204, 9263, 9322, 9381, 1121, 1121, 9440, 9499, 9558, 9617, 9676, 9735, 9794, 9853, 9912, 9971, 10030, 10089, 10148, 10207, 10266, 10325, 10384, 10443, 10502, 10561, 10620, 10679, 10738, 10797, 10856, 10915, 10974, 11033, 11092, 11151, 11210, 11269, 11328, 11387, 11446, 11505, 1121, 11564, 11623, 1121, 11682, 11741, 11800, 11859, 11918, 11977, 12036, 12095, 12154, 12213, 1121, 12272, 12331, 12390, 12449, 12508, 12567, 12626, 12685, 12744, 12803, 12862, 12921, 12980, 13039, 13098, 13157, 13216, 11092, 13275, 13334, 1121, 13393, 13452, 13511, 13570, 13629, 13688, 1121, 13747, 13806, 13865, 13924, 13983, 14042, 14101, 14160, 14219, 12036, 14278, 14337, 14396, 14455,
-				14514, 14573, 14632, 14691, 14750, 14809, 14868, 14927, 14986, 15045, 15104, 15163, 15222, 15281, 15340, 13157, 15399, 15458, 15517, 15576, 15635, 15694, 15753, 1121, 15812, 15871, 15930, 15989, 16048, 16107, 16166, 16225, 16284, 16343, 16402, 16461, 16520, 16579, 16638, 16697, 16756, 16815, 16874, 16933, 16992, 17051, 17110, 17169, 17228, 17287, 17346, 17405, 17464, 17523, 17582, 17641, 17700, 17759, 17818, 17877, 17936, 17995, 18054, 1121, 18113, 18172, 18231, 18290, 18349, 18408, 18467, 18526, 18585, 12154, 18644, 12213, 18703, 18762, 18821, 18880, 18939, 18998, 19057, 19116, 19175, 19234, 13275, 19293, 13334, 19352, 19411, 19470, 19529, 19588, 19647, 19706, 19765, 19824, 19883, 19942, 1121, 20001, 20060, 20119, 20178, 1121, 20237, 20296, 20355, 1121, 20414, 20473, 20532, 20591, 20650, 20709, 20768, 20827, 20886, 20945};
-
-	/**
-	 * The packed transition table of the DFA
-	 */
-	final private static String yy_packed = "\2\24\1\25\1\26\1\27\1\24\1\27\1\25\1\24" + "\1\27\1\24\1\30\1\24\1\31\1\24\2\27\1\24" + "\1\32\3\25\1\24\1\25\1\33\2\24\1\34\1\35" + "\1\36\1\37\11\25\1\24\4\25\1\24\2\25\1\24" + "\1\25\1\40\3\25\1\41\10\24\1\27\1\42\1\27" + "\1\24\1\43\1\27\1\24\1\44\3\24\2\27\7\24" + "\1\33\2\24\1\34\1\35\1\24\1\37\40\24\1\27" + "\1\24\1\27\2\24\1\27\1\24\1\44\3\24\2\27" + "\7\24\1\33\2\24\1\34\1\35\1\24\1\37\11\24" + "\1\45\26\24\1\27\1\46\1\27\1\24\1\47\1\27" + "\1\24\1\44\3\24\2\27\2\24\1\50\4\24\1\33" + "\2\24\1\34\1\35\1\24\1\37\11\24\1\45\24\24" + "\1\51\1\52\1\27\1\24\1\27\1\51\1\24\1\27" + "\1\24\1\53\3\24\2\27\2\24\3\51\1\24\1\51" + "\1\33\2\24\1\34\1\35\1\24\1\37\11\51\1\45" + "\4\51\1\24\2\51\1\24\1\51\1\24\3\51\11\24" + "\1\27\1\24\1\27\2\24\1\27\1\24\1\44\3\24" + "\2\27\7\24\1\33\2\24\1\34\1\35\1\24\1\37" + "\11\24\1\45\4\24\1\54\17\24\1\55\1\56\1\27" + "\1\24\1\27\1\55\1\24\1\27\1\24\1\57\3\24" + "\2\27\2\24\3\55\1\24\1\55\1\33\2\24\1\34"
-				+ "\1\35\1\24\1\37\11\55\1\24\4\55\1\24\2\55" + "\1\24\1\55\1\24\3\55\11\24\1\27\1\24\1\27" + "\2\24\1\27\1\24\1\44\3\24\2\27\7\24\1\33" + "\2\24\1\34\1\35\1\24\1\37\16\24\1\60\2\24" + "\1\61\14\24\1\62\1\63\1\27\1\24\1\27\1\62" + "\1\24\1\27\1\24\1\64\3\24\2\27\2\24\3\62" + "\1\24\1\62\1\33\2\24\1\34\1\35\1\24\1\37" + "\11\62\1\24\4\62\1\24\2\62\1\65\1\62\1\66" + "\3\62\11\24\1\27\1\24\1\27\2\24\1\27\1\24" + "\1\44\3\24\2\27\7\24\1\33\2\24\1\34\1\35" + "\1\24\1\37\21\24\1\65\16\24\1\67\1\24\1\67" + "\2\24\1\67\1\24\1\44\1\70\1\31\1\24\2\67" + "\1\24\1\32\5\24\1\33\1\24\1\70\1\34\1\35" + "\1\36\1\37\16\24\1\71\2\24\1\65\1\24\1\40" + "\3\24\1\41\6\24\1\72\1\73\1\27\1\24\1\27" + "\1\72\1\24\1\27\1\24\1\74\3\24\2\27\2\24" + "\3\72\1\24\1\72\1\33\2\24\1\34\1\35\1\24" + "\1\37\11\72\1\24\4\72\1\24\2\72\1\24\1\72" + "\1\24\3\72\11\24\1\27\1\24\1\27\2\24\1\27" + "\1\24\1\44\3\24\2\27\7\24\1\33\2\24\1\34" + "\1\35\1\24\1\37\30\24\1\75\1\76\1\77\3\24"
-				+ "\1\100\1\101\1\27\1\102\1\27\1\100\1\103\1\27" + "\1\24\1\104\3\24\2\27\2\24\3\100\1\24\1\100" + "\1\33\2\24\1\34\1\35\1\24\1\37\11\100\1\24" + "\4\100\1\24\2\100\1\24\1\100\1\24\3\100\11\24" + "\1\27\1\24\1\27\2\24\1\27\1\24\1\44\3\24" + "\2\27\7\24\1\33\2\24\1\34\1\35\1\24\1\37" + "\32\24\1\77\3\24\1\105\1\106\1\27\1\24\1\27" + "\1\105\1\24\1\27\1\24\1\107\3\24\2\27\2\24" + "\3\105\1\24\1\105\1\33\2\24\1\34\1\35\1\24" + "\1\37\11\105\1\110\4\105\1\24\2\105\1\24\1\105" + "\1\24\3\105\11\24\1\27\1\24\1\27\2\24\1\27" + "\1\24\1\44\3\24\2\27\7\24\1\33\2\24\1\34" + "\1\35\1\24\1\37\11\24\1\110\11\24\1\111\11\24" + "\1\112\1\113\1\114\1\27\1\115\1\27\1\113\1\116" + "\1\27\1\117\1\120\1\121\1\122\1\24\2\27\1\24" + "\1\123\1\124\2\113\1\24\1\113\1\33\1\125\1\24" + "\1\34\1\126\1\24\1\37\11\113\1\110\4\113\1\127" + "\2\113\1\24\1\113\1\24\3\113\6\24\1\112\1\113" + "\1\114\1\130\1\115\1\130\1\113\1\116\1\130\1\117" + "\1\120\1\121\1\122\1\24\2\130\1\24\1\123\1\124"
-				+ "\2\113\1\24\1\113\1\33\1\125\1\24\1\34\1\126" + "\1\24\1\37\11\113\1\110\4\113\1\127\2\113\1\24" + "\1\113\1\24\3\113\5\24\74\0\2\25\1\131\3\0" + "\1\25\3\0\1\25\7\0\3\25\1\0\1\25\7\0" + "\11\25\1\0\4\25\1\0\2\25\1\0\1\25\1\0" + "\3\25\6\0\1\132\2\25\1\0\2\25\1\132\1\25" + "\1\0\5\25\2\0\16\25\1\132\2\25\1\132\2\25" + "\1\132\10\25\1\132\4\25\1\132\7\25\4\0\1\27" + "\1\0\1\27\2\0\1\27\5\0\2\27\53\0\2\25" + "\1\131\3\0\1\25\3\0\1\133\7\0\3\25\1\0" + "\1\25\7\0\11\25\1\0\4\25\1\0\2\25\1\0" + "\1\25\1\0\3\25\6\0\2\134\1\135\3\0\1\134" + "\3\0\1\134\7\0\3\134\1\0\1\134\7\0\11\134" + "\1\0\4\134\1\0\2\134\1\0\1\134\1\0\3\134" + "\6\0\2\136\1\137\3\0\1\136\3\0\1\136\7\0" + "\3\136\1\0\1\136\7\0\11\136\1\0\4\136\1\0" + "\2\136\1\0\1\136\1\0\3\136\36\0\1\140\76\0" + "\1\141\74\0\2\142\10\0\1\143\1\144\1\145\7\0" + "\2\146\10\0\1\147\1\150\3\0\1\147\3\0\1\147" + "\7\0\3\147\1\0\1\147\7\0\11\147\1\0\4\147" + "\1\0\2\147\1\0\1\147\1\0\3\147\6\0\2\151"
-				+ "\1\152\1\0\1\153\11\151\2\0\52\151\1\0\2\154" + "\1\155\1\0\3\154\1\153\6\154\2\0\52\154\13\0" + "\1\156\60\0\2\157\1\160\1\0\1\161\11\157\2\0" + "\52\157\1\0\2\162\1\163\1\0\3\162\1\161\6\162" + "\2\0\52\162\24\0\1\164\47\0\2\51\1\165\3\0" + "\1\51\3\0\1\51\7\0\3\51\1\0\1\51\7\0" + "\11\51\1\0\4\51\1\0\2\51\1\0\1\51\1\0" + "\3\51\6\0\1\166\2\51\1\0\2\51\1\166\1\51" + "\1\0\5\51\2\0\16\51\1\166\2\51\1\166\2\51" + "\1\166\10\51\1\166\4\51\1\166\7\51\1\0\2\51" + "\1\165\3\0\1\51\3\0\1\167\7\0\3\51\1\0" + "\1\51\7\0\11\51\1\0\4\51\1\0\2\51\1\0" + "\1\51\1\0\3\51\6\0\2\55\1\170\3\0\1\55" + "\3\0\1\55\7\0\3\55\1\0\1\55\7\0\11\55" + "\1\0\4\55\1\0\2\55\1\0\1\55\1\0\3\55" + "\6\0\1\171\2\55\1\0\2\55\1\171\1\55\1\0" + "\5\55\2\0\16\55\1\171\2\55\1\171\2\55\1\171" + "\10\55\1\171\4\55\1\171\7\55\1\0\2\55\1\170" + "\3\0\1\55\3\0\1\172\7\0\3\55\1\0\1\55" + "\7\0\11\55\1\0\4\55\1\0\2\55\1\0\1\55" + "\1\0\3\55\6\0\2\62\1\173\3\0\1\62\3\0"
-				+ "\1\62\7\0\3\62\1\0\1\62\7\0\11\62\1\0" + "\4\62\1\0\2\62\1\0\1\62\1\0\3\62\6\0" + "\1\174\2\62\1\0\2\62\1\174\1\62\1\0\5\62" + "\2\0\16\62\1\174\2\62\1\174\2\62\1\174\10\62" + "\1\174\4\62\1\174\7\62\1\0\2\62\1\173\3\0" + "\1\62\3\0\1\175\7\0\3\62\1\0\1\62\7\0" + "\11\62\1\0\4\62\1\0\2\62\1\0\1\62\1\0" + "\3\62\7\0\1\62\1\173\3\0\1\62\3\0\1\62" + "\7\0\3\62\1\0\1\62\7\0\11\62\1\0\4\62" + "\1\0\2\62\1\0\1\62\1\0\3\62\5\0\4\176" + "\1\177\1\176\1\177\2\176\1\177\2\176\1\0\2\176" + "\2\177\11\176\1\0\25\176\1\0\12\176\1\0\2\72" + "\1\200\3\0\1\72\3\0\1\72\7\0\3\72\1\0" + "\1\72\7\0\11\72\1\0\4\72\1\0\2\72\1\0" + "\1\72\1\0\3\72\6\0\1\201\2\72\1\0\2\72" + "\1\201\1\72\1\0\5\72\2\0\16\72\1\201\2\72" + "\1\201\2\72\1\201\10\72\1\201\4\72\1\201\7\72" + "\1\0\2\72\1\200\3\0\1\72\3\0\1\202\7\0" + "\3\72\1\0\1\72\7\0\11\72\1\0\4\72\1\0" + "\2\72\1\0\1\72\1\0\3\72\74\0\1\75\4\0" + "\2\100\1\203\3\0\1\100\3\0\1\100\7\0\3\100" + "\1\0\1\100\7\0\11\100\1\0\4\100\1\0\2\100"
-				+ "\1\0\1\100\1\0\3\100\6\0\1\204\2\100\1\0" + "\2\100\1\204\1\100\1\0\5\100\2\0\16\100\1\204" + "\2\100\1\204\2\100\1\204\10\100\1\204\4\100\1\204" + "\7\100\1\0\2\205\1\206\1\0\1\207\11\205\2\0" + "\52\205\1\0\2\210\1\211\1\0\3\210\1\207\6\210" + "\2\0\52\210\1\0\2\100\1\203\3\0\1\100\3\0" + "\1\212\7\0\3\100\1\0\1\100\7\0\11\100\1\0" + "\4\100\1\0\2\100\1\0\1\100\1\0\3\100\6\0" + "\2\105\1\213\3\0\1\105\3\0\1\105\7\0\3\105" + "\1\0\1\105\7\0\11\105\1\0\4\105\1\0\2\105" + "\1\0\1\105\1\0\3\105\6\0\1\214\2\105\1\0" + "\2\105\1\214\1\105\1\0\5\105\2\0\16\105\1\214" + "\2\105\1\214\2\105\1\214\10\105\1\214\4\105\1\214" + "\7\105\1\0\2\105\1\213\3\0\1\105\3\0\1\215" + "\7\0\3\105\1\0\1\105\7\0\11\105\1\0\4\105" + "\1\0\2\105\1\0\1\105\1\0\3\105\6\0\1\112" + "\1\216\1\217\3\0\1\216\3\0\1\216\1\0\1\220" + "\5\0\3\216\1\0\1\216\7\0\11\216\1\0\4\216" + "\1\0\2\216\1\0\1\216\1\0\3\216\4\0\1\221" + "\1\0\2\113\1\222\3\0\1\113\3\0\1\113\7\0"
-				+ "\3\113\1\223\1\113\7\0\11\113\1\0\4\113\1\0" + "\2\113\1\0\1\113\1\0\3\113\6\0\1\224\2\113" + "\1\0\2\113\1\224\1\113\1\0\5\113\2\0\16\113" + "\1\224\2\113\1\224\2\113\1\224\10\113\1\224\4\113" + "\1\224\7\113\1\0\2\225\1\226\1\0\1\227\11\225" + "\2\0\52\225\1\0\2\230\1\231\1\0\3\230\1\227" + "\6\230\2\0\52\230\1\0\1\232\1\113\1\222\3\0" + "\1\113\3\0\1\233\1\0\1\220\5\0\3\113\1\223" + "\1\113\7\0\11\113\1\0\4\113\1\0\2\113\1\0" + "\1\113\1\0\3\113\6\0\1\112\13\0\1\220\56\0" + "\1\234\72\0\2\235\1\236\3\0\1\235\3\0\1\235" + "\7\0\3\235\1\0\1\235\7\0\11\235\1\0\4\235" + "\1\0\2\235\1\0\1\235\1\0\3\235\6\0\2\113" + "\1\222\3\0\1\113\3\0\1\113\1\237\6\0\1\113" + "\1\240\1\113\1\223\1\113\7\0\11\113\1\0\4\113" + "\1\0\2\113\1\0\1\113\1\0\3\113\11\0\1\241" + "\1\0\1\241\2\0\1\241\5\0\2\241\30\0\1\242" + "\21\0\4\243\1\244\1\243\1\244\2\243\1\244\5\243" + "\2\244\12\243\1\0\14\243\1\0\22\243\1\0\1\245" + "\1\25\1\131\1\25\1\0\1\25\1\245\1\0\1\25"
-				+ "\1\0\1\25\3\0\2\25\2\0\3\25\1\0\1\25" + "\7\0\1\245\2\25\1\245\2\25\1\245\2\25\1\0" + "\4\25\1\0\1\245\1\25\1\0\1\25\1\0\1\245" + "\2\25\6\0\2\25\1\131\3\0\1\25\3\0\1\25" + "\7\0\3\25\1\0\1\25\2\0\1\246\4\0\11\25" + "\1\0\4\25\1\0\2\25\1\0\1\25\1\0\3\25" + "\6\0\1\247\2\134\1\0\2\134\1\247\1\134\1\0" + "\5\134\2\0\16\134\1\247\2\134\1\247\2\134\1\247" + "\10\134\1\247\4\134\1\247\7\134\1\0\1\250\2\136" + "\1\0\2\136\1\250\1\136\1\0\5\136\2\0\16\136" + "\1\250\2\136\1\250\2\136\1\250\10\136\1\250\4\136" + "\1\250\7\136\13\0\1\251\57\0\35\141\1\252\35\141" + "\41\0\1\253\103\0\1\254\65\0\2\255\66\0\2\256" + "\103\0\1\257\17\0\2\147\1\150\3\0\1\147\3\0" + "\1\147\7\0\3\147\1\260\1\147\7\0\11\147\1\0" + "\4\147\1\0\2\147\1\0\1\147\1\0\3\147\6\0" + "\1\261\2\147\1\0\2\147\1\261\1\147\1\0\5\147" + "\2\0\16\147\1\261\2\147\1\261\2\147\1\261\10\147" + "\1\261\4\147\1\261\7\147\1\0\1\262\1\151\1\152" + "\1\151\1\263\1\151\1\262\10\151\1\264\16\151\1\262"
-				+ "\2\151\1\262\2\151\1\262\10\151\1\262\4\151\1\262" + "\7\151\1\0\1\265\1\154\1\155\3\154\1\265\1\266" + "\7\154\1\267\16\154\1\265\2\154\1\265\2\154\1\265" + "\10\154\1\265\4\154\1\265\7\154\32\0\1\246\41\0" + "\1\270\1\157\1\160\1\157\1\271\1\157\1\270\10\157" + "\1\272\16\157\1\270\2\157\1\270\2\157\1\270\10\157" + "\1\270\4\157\1\270\7\157\1\0\1\273\1\162\1\163" + "\3\162\1\273\1\274\7\162\1\275\16\162\1\273\2\162" + "\1\273\2\162\1\273\10\162\1\273\4\162\1\273\7\162" + "\25\0\1\276\46\0\1\277\1\51\1\165\1\51\1\0" + "\1\51\1\277\1\0\1\51\1\0\1\51\3\0\2\51" + "\2\0\3\51\1\0\1\51\7\0\1\277\2\51\1\277" + "\2\51\1\277\2\51\1\0\4\51\1\0\1\277\1\51" + "\1\0\1\51\1\0\1\277\2\51\6\0\2\51\1\165" + "\3\0\1\51\3\0\1\51\7\0\3\51\1\0\1\51" + "\2\0\1\246\4\0\11\51\1\0\4\51\1\0\2\51" + "\1\0\1\51\1\0\3\51\6\0\1\300\1\55\1\170" + "\1\55\1\0\1\55\1\300\1\0\1\55\1\0\1\55" + "\3\0\2\55\2\0\3\55\1\0\1\55\7\0\1\300" + "\2\55\1\300\2\55\1\300\2\55\1\0\4\55\1\0"
-				+ "\1\300\1\55\1\0\1\55\1\0\1\300\2\55\6\0" + "\2\55\1\170\3\0\1\55\3\0\1\55\7\0\3\55" + "\1\0\1\55\2\0\1\246\4\0\11\55\1\0\4\55" + "\1\0\2\55\1\0\1\55\1\0\3\55\6\0\1\301" + "\1\62\1\173\1\62\1\0\1\62\1\301\1\0\1\62" + "\1\0\1\62\3\0\2\62\2\0\3\62\1\0\1\62" + "\7\0\1\301\2\62\1\301\2\62\1\301\2\62\1\0" + "\4\62\1\0\1\301\1\62\1\0\1\62\1\0\1\301" + "\2\62\6\0\2\62\1\173\3\0\1\62\3\0\1\62" + "\7\0\3\62\1\0\1\62\2\0\1\246\4\0\11\62" + "\1\0\4\62\1\0\2\62\1\0\1\62\1\0\3\62" + "\6\0\1\302\1\72\1\200\1\72\1\0\1\72\1\302" + "\1\0\1\72\1\0\1\72\3\0\2\72\2\0\3\72" + "\1\0\1\72\7\0\1\302\2\72\1\302\2\72\1\302" + "\2\72\1\0\4\72\1\0\1\302\1\72\1\0\1\72" + "\1\0\1\302\2\72\6\0\2\72\1\200\3\0\1\72" + "\3\0\1\72\7\0\3\72\1\0\1\72\2\0\1\246" + "\4\0\11\72\1\0\4\72\1\0\2\72\1\0\1\72" + "\1\0\3\72\6\0\1\303\1\100\1\203\1\100\1\0" + "\1\100\1\303\1\0\1\100\1\0\1\100\3\0\2\100" + "\2\0\3\100\1\0\1\100\7\0\1\303\2\100\1\303" + "\2\100\1\303\2\100\1\0\4\100\1\0\1\303\1\100"
-				+ "\1\0\1\100\1\0\1\303\2\100\6\0\1\304\1\205" + "\1\206\1\205\1\305\1\205\1\304\10\205\1\306\16\205" + "\1\304\2\205\1\304\2\205\1\304\10\205\1\304\4\205" + "\1\304\7\205\1\0\1\307\1\210\1\211\3\210\1\307" + "\1\310\7\210\1\311\16\210\1\307\2\210\1\307\2\210" + "\1\307\10\210\1\307\4\210\1\307\7\210\1\0\2\100" + "\1\203\3\0\1\100\3\0\1\100\7\0\3\100\1\0" + "\1\100\2\0\1\246\4\0\11\100\1\0\4\100\1\0" + "\2\100\1\0\1\100\1\0\3\100\6\0\1\312\1\105" + "\1\213\1\105\1\0\1\105\1\312\1\0\1\105\1\0" + "\1\105\3\0\2\105\2\0\3\105\1\0\1\105\7\0" + "\1\312\2\105\1\312\2\105\1\312\2\105\1\0\4\105" + "\1\0\1\312\1\105\1\0\1\105\1\0\1\312\2\105" + "\6\0\2\105\1\213\3\0\1\105\3\0\1\105\7\0" + "\3\105\1\0\1\105\2\0\1\246\4\0\11\105\1\0" + "\4\105\1\0\2\105\1\0\1\105\1\0\3\105\6\0" + "\2\216\1\217\3\0\1\216\3\0\1\216\7\0\3\216" + "\1\0\1\216\7\0\11\216\1\0\4\216\1\0\2\216" + "\1\0\1\216\1\0\3\216\6\0\1\313\2\216\1\0" + "\2\216\1\313\1\216\1\0\5\216\2\0\16\216\1\313"
-				+ "\2\216\1\313\2\216\1\313\10\216\1\313\4\216\1\313" + "\7\216\1\0\1\314\1\113\1\222\1\113\1\0\1\113" + "\1\314\1\0\1\113\1\0\1\113\3\0\2\113\2\0" + "\3\113\1\223\1\113\7\0\1\314\2\113\1\314\2\113" + "\1\314\2\113\1\0\4\113\1\0\1\314\1\113\1\0" + "\1\113\1\0\1\314\2\113\6\0\1\315\1\225\1\226" + "\1\225\1\316\1\225\1\315\10\225\1\317\16\225\1\315" + "\2\225\1\315\2\225\1\315\10\225\1\315\4\225\1\315" + "\7\225\1\0\1\320\1\230\1\231\3\230\1\320\1\321" + "\7\230\1\322\16\230\1\320\2\230\1\320\2\230\1\320" + "\10\230\1\320\4\230\1\320\7\230\1\0\1\232\1\113" + "\1\222\3\0\1\113\3\0\1\113\1\0\1\220\5\0" + "\3\113\1\223\1\113\7\0\11\113\1\0\4\113\1\0" + "\2\113\1\0\1\113\1\0\3\113\4\0\1\221\1\0" + "\2\113\1\222\3\0\1\113\3\0\1\113\7\0\3\113" + "\1\223\1\113\2\0\1\246\4\0\11\113\1\0\4\113" + "\1\0\2\113\1\0\1\113\1\0\3\113\6\0\1\234" + "\1\216\1\217\3\0\1\216\3\0\1\216\7\0\3\216" + "\1\0\1\216\7\0\11\216\1\0\4\216\1\0\2\216" + "\1\0\1\216\1\0\3\216\4\0\1\221\1\0\1\323"
-				+ "\2\235\1\0\2\235\1\323\1\235\1\0\5\235\2\0" + "\16\235\1\323\2\235\1\323\2\235\1\323\10\235\1\323" + "\4\235\1\323\7\235\1\0\1\324\5\0\1\324\11\0" + "\1\324\5\0\1\324\7\0\2\324\1\0\2\324\1\0" + "\2\324\7\0\2\324\3\0\2\324\7\0\2\113\1\222" + "\3\0\1\113\3\0\1\113\7\0\2\113\1\325\1\223" + "\1\113\7\0\11\113\1\0\4\113\1\0\2\113\1\0" + "\1\113\1\0\3\113\57\0\1\326\21\0\1\327\1\25" + "\1\131\1\25\1\0\1\25\1\327\1\0\1\25\1\0" + "\1\25\3\0\2\25\2\0\3\25\1\0\1\25\7\0" + "\1\327\2\25\1\327\2\25\1\327\2\25\1\0\4\25" + "\1\0\1\327\1\25\1\0\1\25\1\0\1\327\2\25" + "\6\0\1\330\1\134\1\135\1\134\1\0\1\134\1\330" + "\1\0\1\134\1\0\1\134\3\0\2\134\2\0\3\134" + "\1\0\1\134\7\0\1\330\2\134\1\330\2\134\1\330" + "\2\134\1\0\4\134\1\0\1\330\1\134\1\0\1\134" + "\1\0\1\330\2\134\6\0\1\331\1\136\1\137\1\136" + "\1\0\1\136\1\331\1\0\1\136\1\0\1\136\3\0" + "\2\136\2\0\3\136\1\0\1\136\7\0\1\331\2\136" + "\1\331\2\136\1\331\2\136\1\0\4\136\1\0\1\331"
-				+ "\1\136\1\0\1\136\1\0\1\331\2\136\20\0\1\332" + "\57\0\34\141\1\333\1\252\35\141\42\0\2\334\102\0" + "\1\335\75\0\2\336\74\0\1\337\76\0\1\340\7\0" + "\1\341\1\342\1\260\1\0\1\260\1\341\1\0\1\260" + "\1\0\1\341\3\0\2\260\2\0\3\341\1\0\1\341" + "\7\0\11\341\1\0\4\341\1\0\2\341\1\0\1\341" + "\1\0\3\341\6\0\1\343\1\147\1\150\1\147\1\0" + "\1\147\1\343\1\0\1\147\1\0\1\147\3\0\2\147" + "\2\0\3\147\1\260\1\147\7\0\1\343\2\147\1\343" + "\2\147\1\343\2\147\1\0\4\147\1\0\1\343\1\147" + "\1\0\1\147\1\0\1\343\2\147\6\0\1\344\1\151" + "\1\152\1\151\1\153\1\151\1\344\27\151\1\344\2\151" + "\1\344\2\151\1\344\10\151\1\344\4\151\1\344\7\151" + "\1\0\2\151\1\152\1\0\1\153\12\151\1\0\52\151" + "\1\0\1\345\1\154\1\155\3\154\1\345\1\153\26\154" + "\1\345\2\154\1\345\2\154\1\345\10\154\1\345\4\154" + "\1\345\7\154\1\0\2\154\1\155\1\0\3\154\1\153" + "\7\154\1\0\52\154\1\0\1\346\1\157\1\160\1\157" + "\1\161\1\157\1\346\27\157\1\346\2\157\1\346\2\157"
-				+ "\1\346\10\157\1\346\4\157\1\346\7\157\1\0\2\157" + "\1\160\1\0\1\161\12\157\1\0\52\157\1\0\1\347" + "\1\162\1\163\3\162\1\347\1\161\26\162\1\347\2\162" + "\1\347\2\162\1\347\10\162\1\347\4\162\1\347\7\162" + "\1\0\2\162\1\163\1\0\3\162\1\161\7\162\1\0" + "\52\162\26\0\1\350\45\0\1\351\1\51\1\165\1\51" + "\1\0\1\51\1\351\1\0\1\51\1\0\1\51\3\0" + "\2\51\2\0\3\51\1\0\1\51\7\0\1\351\2\51" + "\1\351\2\51\1\351\2\51\1\0\4\51\1\0\1\351" + "\1\51\1\0\1\51\1\0\1\351\2\51\6\0\1\352" + "\1\55\1\170\1\55\1\0\1\55\1\352\1\0\1\55" + "\1\0\1\55\3\0\2\55\2\0\3\55\1\0\1\55" + "\7\0\1\352\2\55\1\352\2\55\1\352\2\55\1\0" + "\4\55\1\0\1\352\1\55\1\0\1\55\1\0\1\352" + "\2\55\6\0\1\353\1\62\1\173\1\62\1\0\1\62" + "\1\353\1\0\1\62\1\0\1\62\3\0\2\62\2\0" + "\3\62\1\0\1\62\7\0\1\353\2\62\1\353\2\62" + "\1\353\2\62\1\0\4\62\1\0\1\353\1\62\1\0" + "\1\62\1\0\1\353\2\62\6\0\1\354\1\72\1\200" + "\1\72\1\0\1\72\1\354\1\0\1\72\1\0\1\72" + "\3\0\2\72\2\0\3\72\1\0\1\72\7\0\1\354"
-				+ "\2\72\1\354\2\72\1\354\2\72\1\0\4\72\1\0" + "\1\354\1\72\1\0\1\72\1\0\1\354\2\72\6\0" + "\1\355\1\100\1\203\1\100\1\0\1\100\1\355\1\0" + "\1\100\1\0\1\100\3\0\2\100\2\0\3\100\1\0" + "\1\100\7\0\1\355\2\100\1\355\2\100\1\355\2\100" + "\1\0\4\100\1\0\1\355\1\100\1\0\1\100\1\0" + "\1\355\2\100\6\0\1\356\1\205\1\206\1\205\1\207" + "\1\205\1\356\27\205\1\356\2\205\1\356\2\205\1\356" + "\10\205\1\356\4\205\1\356\7\205\1\0\2\205\1\206" + "\1\0\1\207\12\205\1\0\52\205\1\0\1\357\1\210" + "\1\211\3\210\1\357\1\207\26\210\1\357\2\210\1\357" + "\2\210\1\357\10\210\1\357\4\210\1\357\7\210\1\0" + "\2\210\1\211\1\0\3\210\1\207\7\210\1\0\52\210" + "\1\0\1\360\1\105\1\213\1\105\1\0\1\105\1\360" + "\1\0\1\105\1\0\1\105\3\0\2\105\2\0\3\105" + "\1\0\1\105\7\0\1\360\2\105\1\360\2\105\1\360" + "\2\105\1\0\4\105\1\0\1\360\1\105\1\0\1\105" + "\1\0\1\360\2\105\6\0\1\361\1\216\1\217\1\216" + "\1\0\1\216\1\361\1\0\1\216\1\0\1\216\3\0" + "\2\216\2\0\3\216\1\0\1\216\7\0\1\361\2\216"
-				+ "\1\361\2\216\1\361\2\216\1\0\4\216\1\0\1\361" + "\1\216\1\0\1\216\1\0\1\361\2\216\6\0\1\362" + "\1\113\1\222\1\113\1\0\1\113\1\362\1\0\1\113" + "\1\0\1\113\3\0\2\113\2\0\3\113\1\223\1\113" + "\7\0\1\362\2\113\1\362\2\113\1\362\2\113\1\0" + "\4\113\1\0\1\362\1\113\1\0\1\113\1\0\1\362" + "\2\113\6\0\1\363\1\225\1\226\1\225\1\227\1\225" + "\1\363\27\225\1\363\2\225\1\363\2\225\1\363\10\225" + "\1\363\4\225\1\363\7\225\1\0\2\225\1\226\1\0" + "\1\227\12\225\1\0\52\225\1\0\1\364\1\230\1\231" + "\3\230\1\364\1\227\26\230\1\364\2\230\1\364\2\230" + "\1\364\10\230\1\364\4\230\1\364\7\230\1\0\2\230" + "\1\231\1\0\3\230\1\227\7\230\1\0\52\230\1\0" + "\1\365\1\235\1\236\1\235\1\0\1\235\1\365\1\0" + "\1\235\1\0\1\235\3\0\2\235\2\0\3\235\1\0" + "\1\235\7\0\1\365\2\235\1\365\2\235\1\365\2\235" + "\1\0\4\235\1\0\1\365\1\235\1\0\1\235\1\0" + "\1\365\2\235\6\0\1\366\5\0\1\366\3\0\1\367" + "\5\0\1\366\5\0\1\366\7\0\2\366\1\0\2\366" + "\1\0\2\366\7\0\2\366\3\0\2\366\7\0\2\113"
-				+ "\1\222\3\0\1\113\3\0\1\113\7\0\3\113\1\370" + "\1\113\7\0\11\113\1\0\4\113\1\0\2\113\1\0" + "\1\113\1\0\3\113\60\0\1\371\20\0\1\372\1\25" + "\1\131\1\25\1\0\1\25\1\372\1\0\1\25\1\0" + "\1\25\3\0\2\25\2\0\3\25\1\0\1\25\7\0" + "\1\372\2\25\1\372\2\25\1\372\2\25\1\0\4\25" + "\1\0\1\372\1\25\1\0\1\25\1\0\1\372\2\25" + "\6\0\1\373\1\134\1\135\1\134\1\0\1\134\1\373" + "\1\0\1\134\1\0\1\134\3\0\2\134\2\0\3\134" + "\1\0\1\134\7\0\1\373\2\134\1\373\2\134\1\373" + "\2\134\1\0\4\134\1\0\1\373\1\134\1\0\1\134" + "\1\0\1\373\2\134\6\0\1\374\1\136\1\137\1\136" + "\1\0\1\136\1\374\1\0\1\136\1\0\1\136\3\0" + "\2\136\2\0\3\136\1\0\1\136\7\0\1\374\2\136" + "\1\374\2\136\1\374\2\136\1\0\4\136\1\0\1\374" + "\1\136\1\0\1\136\1\0\1\374\2\136\31\0\1\375" + "\122\0\1\376\67\0\1\377\66\0\2\u0100\73\0\1\u0101" + "\24\0\2\341\1\342\1\u0102\1\0\1\u0102\1\341\1\0" + "\1\u0102\1\u0103\1\341\3\0\2\u0102\2\0\3\341\1\0" + "\1\341\7\0\11\341\1\0\4\341\1\0\2\341\1\0"
-				+ "\1\341\1\0\3\341\6\0\1\u0104\2\341\1\0\2\341" + "\1\u0104\1\341\1\0\5\341\2\0\16\341\1\u0104\2\341" + "\1\u0104\2\341\1\u0104\10\341\1\u0104\4\341\1\u0104\7\341" + "\1\0\1\u0105\1\147\1\150\1\147\1\0\1\147\1\u0105" + "\1\0\1\147\1\0\1\147\3\0\2\147\2\0\3\147" + "\1\260\1\147\7\0\1\u0105\2\147\1\u0105\2\147\1\u0105" + "\2\147\1\0\4\147\1\0\1\u0105\1\147\1\0\1\147" + "\1\0\1\u0105\2\147\6\0\1\u0106\1\151\1\152\1\151" + "\1\153\1\151\1\u0106\27\151\1\u0106\2\151\1\u0106\2\151" + "\1\u0106\10\151\1\u0106\4\151\1\u0106\7\151\1\0\1\u0107" + "\1\154\1\155\3\154\1\u0107\1\153\26\154\1\u0107\2\154" + "\1\u0107\2\154\1\u0107\10\154\1\u0107\4\154\1\u0107\7\154" + "\1\0\1\u0108\1\157\1\160\1\157\1\161\1\157\1\u0108" + "\27\157\1\u0108\2\157\1\u0108\2\157\1\u0108\10\157\1\u0108" + "\4\157\1\u0108\7\157\1\0\1\u0109\1\162\1\163\3\162" + "\1\u0109\1\161\26\162\1\u0109\2\162\1\u0109\2\162\1\u0109" + "\10\162\1\u0109\4\162\1\u0109\7\162\1\0\2\u010a\1\u010b"
-				+ "\1\350\1\u010c\1\350\1\u010a\1\u010d\1\350\1\u010e\4\u010a" + "\2\350\5\u010a\1\0\44\u010a\1\0\1\u010f\1\51\1\165" + "\1\51\1\0\1\51\1\u010f\1\0\1\51\1\0\1\51" + "\3\0\2\51\2\0\3\51\1\0\1\51\7\0\1\u010f" + "\2\51\1\u010f\2\51\1\u010f\2\51\1\0\4\51\1\0" + "\1\u010f\1\51\1\0\1\51\1\0\1\u010f\2\51\6\0" + "\1\u0110\1\55\1\170\1\55\1\0\1\55\1\u0110\1\0" + "\1\55\1\0\1\55\3\0\2\55\2\0\3\55\1\0" + "\1\55\7\0\1\u0110\2\55\1\u0110\2\55\1\u0110\2\55" + "\1\0\4\55\1\0\1\u0110\1\55\1\0\1\55\1\0" + "\1\u0110\2\55\6\0\1\u0111\1\62\1\173\1\62\1\0" + "\1\62\1\u0111\1\0\1\62\1\0\1\62\3\0\2\62" + "\2\0\3\62\1\0\1\62\7\0\1\u0111\2\62\1\u0111" + "\2\62\1\u0111\2\62\1\0\4\62\1\0\1\u0111\1\62" + "\1\0\1\62\1\0\1\u0111\2\62\6\0\1\u0112\1\72" + "\1\200\1\72\1\0\1\72\1\u0112\1\0\1\72\1\0" + "\1\72\3\0\2\72\2\0\3\72\1\0\1\72\7\0" + "\1\u0112\2\72\1\u0112\2\72\1\u0112\2\72\1\0\4\72" + "\1\0\1\u0112\1\72\1\0\1\72\1\0\1\u0112\2\72" + "\6\0\1\u0113\1\100\1\203\1\100\1\0\1\100\1\u0113"
-				+ "\1\0\1\100\1\0\1\100\3\0\2\100\2\0\3\100" + "\1\0\1\100\7\0\1\u0113\2\100\1\u0113\2\100\1\u0113" + "\2\100\1\0\4\100\1\0\1\u0113\1\100\1\0\1\100" + "\1\0\1\u0113\2\100\6\0\1\u0114\1\205\1\206\1\205" + "\1\207\1\205\1\u0114\27\205\1\u0114\2\205\1\u0114\2\205" + "\1\u0114\10\205\1\u0114\4\205\1\u0114\7\205\1\0\1\u0115" + "\1\210\1\211\3\210\1\u0115\1\207\26\210\1\u0115\2\210" + "\1\u0115\2\210\1\u0115\10\210\1\u0115\4\210\1\u0115\7\210" + "\1\0\1\u0116\1\105\1\213\1\105\1\0\1\105\1\u0116" + "\1\0\1\105\1\0\1\105\3\0\2\105\2\0\3\105" + "\1\0\1\105\7\0\1\u0116\2\105\1\u0116\2\105\1\u0116" + "\2\105\1\0\4\105\1\0\1\u0116\1\105\1\0\1\105" + "\1\0\1\u0116\2\105\6\0\1\u0117\1\216\1\217\1\216" + "\1\0\1\216\1\u0117\1\0\1\216\1\0\1\216\3\0" + "\2\216\2\0\3\216\1\0\1\216\7\0\1\u0117\2\216" + "\1\u0117\2\216\1\u0117\2\216\1\0\4\216\1\0\1\u0117" + "\1\216\1\0\1\216\1\0\1\u0117\2\216\6\0\1\u0118" + "\1\113\1\222\1\113\1\0\1\113\1\u0118\1\0\1\113"
-				+ "\1\0\1\113\3\0\2\113\2\0\3\113\1\223\1\113" + "\7\0\1\u0118\2\113\1\u0118\2\113\1\u0118\2\113\1\0" + "\4\113\1\0\1\u0118\1\113\1\0\1\113\1\0\1\u0118" + "\2\113\6\0\1\u0119\1\225\1\226\1\225\1\227\1\225" + "\1\u0119\27\225\1\u0119\2\225\1\u0119\2\225\1\u0119\10\225" + "\1\u0119\4\225\1\u0119\7\225\1\0\1\u011a\1\230\1\231" + "\3\230\1\u011a\1\227\26\230\1\u011a\2\230\1\u011a\2\230" + "\1\u011a\10\230\1\u011a\4\230\1\u011a\7\230\1\0\1\u011b" + "\1\235\1\236\1\235\1\0\1\235\1\u011b\1\0\1\235" + "\1\0\1\235\3\0\2\235\2\0\3\235\1\0\1\235" + "\7\0\1\u011b\2\235\1\u011b\2\235\1\u011b\2\235\1\0" + "\4\235\1\0\1\u011b\1\235\1\0\1\235\1\0\1\u011b" + "\2\235\6\0\1\u011c\5\0\1\u011c\3\0\1\367\5\0" + "\1\u011c\5\0\1\u011c\7\0\2\u011c\1\0\2\u011c\1\0" + "\2\u011c\7\0\2\u011c\3\0\2\u011c\7\0\1\u011d\5\0" + "\1\u011d\11\0\1\u011d\5\0\1\u011d\7\0\2\u011d\1\0" + "\2\u011d\1\0\2\u011d\7\0\2\u011d\3\0\2\u011d\7\0" + "\2\u011e\1\u011f\1\u0120\1\u0121\1\u0120\1\u011e\1\u0122\1\u0120"
-				+ "\1\u0123\4\u011e\2\u0120\5\u011e\1\0\44\u011e\54\0\1\u0124" + "\17\0\1\u0125\1\25\1\131\1\25\1\0\1\25\1\u0125" + "\1\0\1\25\1\0\1\25\3\0\2\25\2\0\3\25" + "\1\0\1\25\7\0\1\u0125\2\25\1\u0125\2\25\1\u0125" + "\2\25\1\0\4\25\1\0\1\u0125\1\25\1\0\1\25" + "\1\0\1\u0125\2\25\6\0\1\u0126\1\134\1\135\1\134" + "\1\0\1\134\1\u0126\1\0\1\134\1\0\1\134\3\0" + "\2\134\2\0\3\134\1\0\1\134\7\0\1\u0126\2\134" + "\1\u0126\2\134\1\u0126\2\134\1\0\4\134\1\0\1\u0126" + "\1\134\1\0\1\134\1\0\1\u0126\2\134\6\0\1\u0127" + "\1\136\1\137\1\136\1\0\1\136\1\u0127\1\0\1\136" + "\1\0\1\136\3\0\2\136\2\0\3\136\1\0\1\136" + "\7\0\1\u0127\2\136\1\u0127\2\136\1\u0127\2\136\1\0" + "\4\136\1\0\1\u0127\1\136\1\0\1\136\1\0\1\u0127" + "\2\136\51\0\1\u0128\52\0\1\u0129\110\0\2\u012a\42\0" + "\1\u012b\63\0\1\u0102\1\0\1\u0102\2\0\1\u0102\1\u0103" + "\4\0\2\u0102\53\0\1\u012c\1\341\1\342\1\341\1\0" + "\1\341\1\u012c\1\0\1\341\1\u0103\1\341\3\0\2\341" + "\2\0\3\341\1\0\1\341\7\0\1\u012c\2\341\1\u012c"
-				+ "\2\341\1\u012c\2\341\1\0\4\341\1\0\1\u012c\1\341" + "\1\0\1\341\1\0\1\u012c\2\341\6\0\1\u012d\1\147" + "\1\150\1\147\1\0\1\147\1\u012d\1\0\1\147\1\0" + "\1\147\3\0\2\147\2\0\3\147\1\260\1\147\7\0" + "\1\u012d\2\147\1\u012d\2\147\1\u012d\2\147\1\0\4\147" + "\1\0\1\u012d\1\147\1\0\1\147\1\0\1\u012d\2\147" + "\6\0\1\u012e\1\151\1\152\1\151\1\153\1\151\1\u012e" + "\27\151\1\u012e\2\151\1\u012e\2\151\1\u012e\10\151\1\u012e" + "\4\151\1\u012e\7\151\1\0\1\u012f\1\154\1\155\3\154" + "\1\u012f\1\153\26\154\1\u012f\2\154\1\u012f\2\154\1\u012f" + "\10\154\1\u012f\4\154\1\u012f\7\154\1\0\1\u0130\1\157" + "\1\160\1\157\1\161\1\157\1\u0130\27\157\1\u0130\2\157" + "\1\u0130\2\157\1\u0130\10\157\1\u0130\4\157\1\u0130\7\157" + "\1\0\1\u0131\1\162\1\163\3\162\1\u0131\1\161\26\162" + "\1\u0131\2\162\1\u0131\2\162\1\u0131\10\162\1\u0131\4\162" + "\1\u0131\7\162\1\0\2\u010a\1\u010b\1\u0132\1\0\2\u010a" + "\1\0\1\u0132\1\u010e\4\u010a\2\u0132\5\u010a\1\0\44\u010a"
-				+ "\1\0\1\u0133\1\u010a\1\u010b\1\u0132\2\u010a\1\u0133\1\u010a" + "\1\u0132\1\u0134\4\u010a\2\u0132\16\u010a\1\u0133\2\u010a\1\u0133" + "\2\u010a\1\u0133\10\u010a\1\u0133\4\u010a\1\u0133\7\u010a\1\0" + "\2\u010c\1\u0135\1\0\1\u0132\11\u010c\2\0\52\u010c\1\0" + "\2\u010d\1\u0136\1\0\3\u010d\1\u0132\6\u010d\2\0\52\u010d" + "\1\0\1\u0137\1\51\1\165\1\51\1\0\1\51\1\u0137" + "\1\0\1\51\1\0\1\51\3\0\2\51\2\0\3\51" + "\1\0\1\51\7\0\1\u0137\2\51\1\u0137\2\51\1\u0137" + "\2\51\1\0\4\51\1\0\1\u0137\1\51\1\0\1\51" + "\1\0\1\u0137\2\51\6\0\1\u0138\1\55\1\170\1\55" + "\1\0\1\55\1\u0138\1\0\1\55\1\0\1\55\3\0" + "\2\55\2\0\3\55\1\0\1\55\7\0\1\u0138\2\55" + "\1\u0138\2\55\1\u0138\2\55\1\0\4\55\1\0\1\u0138" + "\1\55\1\0\1\55\1\0\1\u0138\2\55\6\0\1\u0139" + "\1\62\1\173\1\62\1\0\1\62\1\u0139\1\0\1\62" + "\1\0\1\62\3\0\2\62\2\0\3\62\1\0\1\62" + "\7\0\1\u0139\2\62\1\u0139\2\62\1\u0139\2\62\1\0" + "\4\62\1\0\1\u0139\1\62\1\0\1\62\1\0\1\u0139"
-				+ "\2\62\6\0\1\u013a\1\72\1\200\1\72\1\0\1\72" + "\1\u013a\1\0\1\72\1\0\1\72\3\0\2\72\2\0" + "\3\72\1\0\1\72\7\0\1\u013a\2\72\1\u013a\2\72" + "\1\u013a\2\72\1\0\4\72\1\0\1\u013a\1\72\1\0" + "\1\72\1\0\1\u013a\2\72\6\0\1\u013b\1\100\1\203" + "\1\100\1\0\1\100\1\u013b\1\0\1\100\1\0\1\100" + "\3\0\2\100\2\0\3\100\1\0\1\100\7\0\1\u013b" + "\2\100\1\u013b\2\100\1\u013b\2\100\1\0\4\100\1\0" + "\1\u013b\1\100\1\0\1\100\1\0\1\u013b\2\100\6\0" + "\1\u013c\1\205\1\206\1\205\1\207\1\205\1\u013c\27\205" + "\1\u013c\2\205\1\u013c\2\205\1\u013c\10\205\1\u013c\4\205" + "\1\u013c\7\205\1\0\1\u013d\1\210\1\211\3\210\1\u013d" + "\1\207\26\210\1\u013d\2\210\1\u013d\2\210\1\u013d\10\210" + "\1\u013d\4\210\1\u013d\7\210\1\0\1\u013e\1\105\1\213" + "\1\105\1\0\1\105\1\u013e\1\0\1\105\1\0\1\105" + "\3\0\2\105\2\0\3\105\1\0\1\105\7\0\1\u013e" + "\2\105\1\u013e\2\105\1\u013e\2\105\1\0\4\105\1\0" + "\1\u013e\1\105\1\0\1\105\1\0\1\u013e\2\105\6\0"
-				+ "\1\u013f\1\216\1\217\1\216\1\0\1\216\1\u013f\1\0" + "\1\216\1\0\1\216\3\0\2\216\2\0\3\216\1\0" + "\1\216\7\0\1\u013f\2\216\1\u013f\2\216\1\u013f\2\216" + "\1\0\4\216\1\0\1\u013f\1\216\1\0\1\216\1\0" + "\1\u013f\2\216\6\0\1\u0140\1\113\1\222\1\113\1\0" + "\1\113\1\u0140\1\0\1\113\1\0\1\113\3\0\2\113" + "\2\0\3\113\1\223\1\113\7\0\1\u0140\2\113\1\u0140" + "\2\113\1\u0140\2\113\1\0\4\113\1\0\1\u0140\1\113" + "\1\0\1\113\1\0\1\u0140\2\113\6\0\1\u0141\1\225" + "\1\226\1\225\1\227\1\225\1\u0141\27\225\1\u0141\2\225" + "\1\u0141\2\225\1\u0141\10\225\1\u0141\4\225\1\u0141\7\225" + "\1\0\1\u0142\1\230\1\231\3\230\1\u0142\1\227\26\230" + "\1\u0142\2\230\1\u0142\2\230\1\u0142\10\230\1\u0142\4\230" + "\1\u0142\7\230\1\0\1\u0143\1\235\1\236\1\235\1\0" + "\1\235\1\u0143\1\0\1\235\1\0\1\235\3\0\2\235" + "\2\0\3\235\1\0\1\235\7\0\1\u0143\2\235\1\u0143" + "\2\235\1\u0143\2\235\1\0\4\235\1\0\1\u0143\1\235" + "\1\0\1\235\1\0\1\u0143\2\235\6\0\1\u0144\5\0"
-				+ "\1\u0144\3\0\1\367\5\0\1\u0144\5\0\1\u0144\7\0" + "\2\u0144\1\0\2\u0144\1\0\2\u0144\7\0\2\u0144\3\0" + "\2\u0144\7\0\1\u0145\5\0\1\u0145\11\0\1\u0145\5\0" + "\1\u0145\7\0\2\u0145\1\0\2\u0145\1\0\2\u0145\7\0" + "\2\u0145\3\0\2\u0145\7\0\2\u011e\1\u011f\1\u0146\1\0" + "\2\u011e\1\0\1\u0146\1\u0123\4\u011e\2\u0146\5\u011e\1\0" + "\44\u011e\1\0\1\u0147\1\u011e\1\u011f\1\u0146\2\u011e\1\u0147" + "\1\u011e\1\u0146\1\u0148\4\u011e\2\u0146\16\u011e\1\u0147\2\u011e" + "\1\u0147\2\u011e\1\u0147\10\u011e\1\u0147\4\u011e\1\u0147\7\u011e" + "\1\0\2\u0121\1\u0149\1\0\1\u0146\11\u0121\2\0\52\u0121" + "\1\0\2\u0122\1\u014a\1\0\3\u0122\1\u0146\6\u0122\2\0" + "\52\u0122\24\0\1\u014b\47\0\1\u014c\1\25\1\131\1\25" + "\1\0\1\25\1\u014c\1\0\1\25\1\0\1\25\3\0" + "\2\25\2\0\3\25\1\0\1\25\7\0\1\u014c\2\25" + "\1\u014c\2\25\1\u014c\2\25\1\0\4\25\1\0\1\u014c" + "\1\25\1\0\1\25\1\0\1\u014c\2\25\6\0\1\u014d" + "\1\134\1\135\1\134\1\0\1\134\1\u014d\1\0\1\134"
-				+ "\1\0\1\134\3\0\2\134\2\0\3\134\1\0\1\134" + "\7\0\1\u014d\2\134\1\u014d\2\134\1\u014d\2\134\1\0" + "\4\134\1\0\1\u014d\1\134\1\0\1\134\1\0\1\u014d" + "\2\134\6\0\1\u014e\1\136\1\137\1\136\1\0\1\136" + "\1\u014e\1\0\1\136\1\0\1\136\3\0\2\136\2\0" + "\3\136\1\0\1\136\7\0\1\u014e\2\136\1\u014e\2\136" + "\1\u014e\2\136\1\0\4\136\1\0\1\u014e\1\136\1\0" + "\1\136\1\0\1\u014e\2\136\52\0\2\u014f\73\0\1\u0150" + "\106\0\2\u0151\7\0\1\u0152\1\341\1\342\1\341\1\0" + "\1\341\1\u0152\1\0\1\341\1\u0103\1\341\3\0\2\341" + "\2\0\3\341\1\0\1\341\7\0\1\u0152\2\341\1\u0152" + "\2\341\1\u0152\2\341\1\0\4\341\1\0\1\u0152\1\341" + "\1\0\1\341\1\0\1\u0152\2\341\6\0\1\u0153\1\147" + "\1\150\1\147\1\0\1\147\1\u0153\1\0\1\147\1\0" + "\1\147\3\0\2\147\2\0\3\147\1\260\1\147\7\0" + "\1\u0153\2\147\1\u0153\2\147\1\u0153\2\147\1\0\4\147" + "\1\0\1\u0153\1\147\1\0\1\147\1\0\1\u0153\2\147" + "\6\0\1\u0154\1\151\1\152\1\151\1\153\1\151\1\u0154"
-				+ "\27\151\1\u0154\2\151\1\u0154\2\151\1\u0154\10\151\1\u0154" + "\4\151\1\u0154\7\151\1\0\1\u0155\1\154\1\155\3\154" + "\1\u0155\1\153\26\154\1\u0155\2\154\1\u0155\2\154\1\u0155" + "\10\154\1\u0155\4\154\1\u0155\7\154\1\0\1\u0156\1\157" + "\1\160\1\157\1\161\1\157\1\u0156\27\157\1\u0156\2\157" + "\1\u0156\2\157\1\u0156\10\157\1\u0156\4\157\1\u0156\7\157" + "\1\0\1\u0157\1\162\1\163\3\162\1\u0157\1\161\26\162" + "\1\u0157\2\162\1\u0157\2\162\1\u0157\10\162\1\u0157\4\162" + "\1\u0157\7\162\4\0\1\u0132\1\0\1\u0132\2\0\1\u0132" + "\1\u010e\4\0\2\u0132\53\0\1\u0158\1\u010a\1\u010b\1\u010a" + "\1\0\1\u010a\1\u0158\1\0\1\u010a\1\u010e\13\u010a\1\0" + "\10\u010a\1\u0158\2\u010a\1\u0158\2\u010a\1\u0158\10\u010a\1\u0158" + "\4\u010a\1\u0158\7\u010a\1\0\1\u0159\1\u010c\1\u0135\1\u010c" + "\1\u015a\1\u010c\1\u0159\10\u010c\1\u015b\16\u010c\1\u0159\2\u010c" + "\1\u0159\2\u010c\1\u0159\10\u010c\1\u0159\4\u010c\1\u0159\7\u010c"
-				+ "\1\0\1\u015c\1\u010d\1\u0136\3\u010d\1\u015c\1\u015d\7\u010d" + "\1\u015e\16\u010d\1\u015c\2\u010d\1\u015c\2\u010d\1\u015c\10\u010d" + "\1\u015c\4\u010d\1\u015c\7\u010d\1\0\1\u015f\1\51\1\165" + "\1\51\1\0\1\51\1\u015f\1\0\1\51\1\0\1\51" + "\3\0\2\51\2\0\3\51\1\0\1\51\7\0\1\u015f" + "\2\51\1\u015f\2\51\1\u015f\2\51\1\0\4\51\1\0" + "\1\u015f\1\51\1\0\1\51\1\0\1\u015f\2\51\6\0" + "\1\u0160\1\55\1\170\1\55\1\0\1\55\1\u0160\1\0" + "\1\55\1\0\1\55\3\0\2\55\2\0\3\55\1\0" + "\1\55\7\0\1\u0160\2\55\1\u0160\2\55\1\u0160\2\55" + "\1\0\4\55\1\0\1\u0160\1\55\1\0\1\55\1\0" + "\1\u0160\2\55\6\0\1\u0161\1\62\1\173\1\62\1\0" + "\1\62\1\u0161\1\0\1\62\1\0\1\62\3\0\2\62" + "\2\0\3\62\1\0\1\62\7\0\1\u0161\2\62\1\u0161" + "\2\62\1\u0161\2\62\1\0\4\62\1\0\1\u0161\1\62" + "\1\0\1\62\1\0\1\u0161\2\62\6\0\1\u0162\1\72" + "\1\200\1\72\1\0\1\72\1\u0162\1\0\1\72\1\0" + "\1\72\3\0\2\72\2\0\3\72\1\0\1\72\7\0" + "\1\u0162\2\72\1\u0162\2\72\1\u0162\2\72\1\0\4\72"
-				+ "\1\0\1\u0162\1\72\1\0\1\72\1\0\1\u0162\2\72" + "\6\0\1\u0163\1\100\1\203\1\100\1\0\1\100\1\u0163" + "\1\0\1\100\1\0\1\100\3\0\2\100\2\0\3\100" + "\1\0\1\100\7\0\1\u0163\2\100\1\u0163\2\100\1\u0163" + "\2\100\1\0\4\100\1\0\1\u0163\1\100\1\0\1\100" + "\1\0\1\u0163\2\100\6\0\1\u0164\1\205\1\206\1\205" + "\1\207\1\205\1\u0164\27\205\1\u0164\2\205\1\u0164\2\205" + "\1\u0164\10\205\1\u0164\4\205\1\u0164\7\205\1\0\1\u0165" + "\1\210\1\211\3\210\1\u0165\1\207\26\210\1\u0165\2\210" + "\1\u0165\2\210\1\u0165\10\210\1\u0165\4\210\1\u0165\7\210" + "\1\0\1\u0166\1\105\1\213\1\105\1\0\1\105\1\u0166" + "\1\0\1\105\1\0\1\105\3\0\2\105\2\0\3\105" + "\1\0\1\105\7\0\1\u0166\2\105\1\u0166\2\105\1\u0166" + "\2\105\1\0\4\105\1\0\1\u0166\1\105\1\0\1\105" + "\1\0\1\u0166\2\105\6\0\1\u0167\1\216\1\217\1\216" + "\1\0\1\216\1\u0167\1\0\1\216\1\0\1\216\3\0" + "\2\216\2\0\3\216\1\0\1\216\7\0\1\u0167\2\216" + "\1\u0167\2\216\1\u0167\2\216\1\0\4\216\1\0\1\u0167"
-				+ "\1\216\1\0\1\216\1\0\1\u0167\2\216\6\0\1\u0168" + "\1\113\1\222\1\113\1\0\1\113\1\u0168\1\0\1\113" + "\1\0\1\113\3\0\2\113\2\0\3\113\1\223\1\113" + "\7\0\1\u0168\2\113\1\u0168\2\113\1\u0168\2\113\1\0" + "\4\113\1\0\1\u0168\1\113\1\0\1\113\1\0\1\u0168" + "\2\113\6\0\1\u0169\1\225\1\226\1\225\1\227\1\225" + "\1\u0169\27\225\1\u0169\2\225\1\u0169\2\225\1\u0169\10\225" + "\1\u0169\4\225\1\u0169\7\225\1\0\1\u016a\1\230\1\231" + "\3\230\1\u016a\1\227\26\230\1\u016a\2\230\1\u016a\2\230" + "\1\u016a\10\230\1\u016a\4\230\1\u016a\7\230\1\0\1\u016b" + "\1\235\1\236\1\235\1\0\1\235\1\u016b\1\0\1\235" + "\1\0\1\235\3\0\2\235\2\0\3\235\1\0\1\235" + "\7\0\1\u016b\2\235\1\u016b\2\235\1\u016b\2\235\1\0" + "\4\235\1\0\1\u016b\1\235\1\0\1\235\1\0\1\u016b" + "\2\235\6\0\1\u016c\5\0\1\u016c\3\0\1\367\5\0" + "\1\u016c\5\0\1\u016c\7\0\2\u016c\1\0\2\u016c\1\0" + "\2\u016c\7\0\2\u016c\3\0\2\u016c\7\0\1\u016d\5\0" + "\1\u016d\11\0\1\u016d\5\0\1\u016d\7\0\2\u016d\1\0"
-				+ "\2\u016d\1\0\2\u016d\7\0\2\u016d\3\0\2\u016d\12\0" + "\1\u0146\1\0\1\u0146\2\0\1\u0146\1\u0123\4\0\2\u0146" + "\53\0\1\u016e\1\u011e\1\u011f\1\u011e\1\0\1\u011e\1\u016e" + "\1\0\1\u011e\1\u0123\13\u011e\1\0\10\u011e\1\u016e\2\u011e" + "\1\u016e\2\u011e\1\u016e\10\u011e\1\u016e\4\u011e\1\u016e\7\u011e" + "\1\0\1\u016f\1\u0121\1\u0149\1\u0121\1\u0170\1\u0121\1\u016f" + "\10\u0121\1\u0171\16\u0121\1\u016f\2\u0121\1\u016f\2\u0121\1\u016f" + "\10\u0121\1\u016f\4\u0121\1\u016f\7\u0121\1\0\1\u0172\1\u0122" + "\1\u014a\3\u0122\1\u0172\1\u0173\7\u0122\1\u0174\16\u0122\1\u0172" + "\2\u0122\1\u0172\2\u0122\1\u0172\10\u0122\1\u0172\4\u0122\1\u0172" + "\7\u0122\47\0\1\u0175\24\0\2\25\1\131\1\25\1\0" + "\2\25\1\0\1\25\1\0\1\25\3\0\2\25\2\0" + "\3\25\1\0\1\25\7\0\11\25\1\0\4\25\1\0" + "\2\25\1\0\1\25\1\0\3\25\6\0\1\u0176\1\134" + "\1\135\1\134\1\0\1\134\1\u0176\1\0\1\134\1\0" + "\1\134\3\0\2\134\2\0\3\134\1\0\1\134\7\0" + "\1\u0176\2\134\1\u0176\2\134\1\u0176\2\134\1\0\4\134"
-				+ "\1\0\1\u0176\1\134\1\0\1\134\1\0\1\u0176\2\134" + "\6\0\1\u0177\1\136\1\137\1\136\1\0\1\136\1\u0177" + "\1\0\1\136\1\0\1\136\3\0\2\136\2\0\3\136" + "\1\0\1\136\7\0\1\u0177\2\136\1\u0177\2\136\1\u0177" + "\2\136\1\0\4\136\1\0\1\u0177\1\136\1\0\1\136" + "\1\0\1\u0177\2\136\54\0\1\u0178\65\0\2\u0179\30\0" + "\1\u017a\1\341\1\342\1\341\1\0\1\341\1\u017a\1\0" + "\1\341\1\u0103\1\341\3\0\2\341\2\0\3\341\1\0" + "\1\341\7\0\1\u017a\2\341\1\u017a\2\341\1\u017a\2\341" + "\1\0\4\341\1\0\1\u017a\1\341\1\0\1\341\1\0" + "\1\u017a\2\341\6\0\1\u017b\1\147\1\150\1\147\1\0" + "\1\147\1\u017b\1\0\1\147\1\0\1\147\3\0\2\147" + "\2\0\3\147\1\260\1\147\7\0\1\u017b\2\147\1\u017b" + "\2\147\1\u017b\2\147\1\0\4\147\1\0\1\u017b\1\147" + "\1\0\1\147\1\0\1\u017b\2\147\6\0\1\u017c\1\151" + "\1\152\1\151\1\153\1\151\1\u017c\27\151\1\u017c\2\151" + "\1\u017c\2\151\1\u017c\10\151\1\u017c\4\151\1\u017c\7\151" + "\1\0\1\u017d\1\154\1\155\3\154\1\u017d\1\153\26\154"
-				+ "\1\u017d\2\154\1\u017d\2\154\1\u017d\10\154\1\u017d\4\154" + "\1\u017d\7\154\1\0\1\u017e\1\157\1\160\1\157\1\161" + "\1\157\1\u017e\27\157\1\u017e\2\157\1\u017e\2\157\1\u017e" + "\10\157\1\u017e\4\157\1\u017e\7\157\1\0\1\u017f\1\162" + "\1\163\3\162\1\u017f\1\161\26\162\1\u017f\2\162\1\u017f" + "\2\162\1\u017f\10\162\1\u017f\4\162\1\u017f\7\162\1\0" + "\1\u0180\1\u010a\1\u010b\1\u010a\1\0\1\u010a\1\u0180\1\0" + "\1\u010a\1\u010e\13\u010a\1\0\10\u010a\1\u0180\2\u010a\1\u0180" + "\2\u010a\1\u0180\10\u010a\1\u0180\4\u010a\1\u0180\7\u010a\1\0" + "\1\u0181\1\u010c\1\u0135\1\u010c\1\u0132\1\u010c\1\u0181\27\u010c" + "\1\u0181\2\u010c\1\u0181\2\u010c\1\u0181\10\u010c\1\u0181\4\u010c" + "\1\u0181\7\u010c\1\0\2\u010c\1\u0135\2\u0132\1\u015a\2\u010c" + "\1\u015a\1\u0182\4\u010c\2\u0132\52\u010c\1\0\2\u010c\1\u0135" + "\1\0\1\u0132\12\u010c\1\0\52\u010c\1\0\1\u0183\1\u010d" + "\1\u0136\3\u010d\1\u0183\1\u0132\26\u010d\1\u0183\2\u010d\1\u0183"
-				+ "\2\u010d\1\u0183\10\u010d\1\u0183\4\u010d\1\u0183\7\u010d\1\0" + "\2\u010d\1\u0136\1\u0132\1\u010d\1\u015d\1\u010d\1\u0132\1\u015d" + "\1\u0184\4\u010d\2\u0132\52\u010d\1\0\2\u010d\1\u0136\1\0" + "\3\u010d\1\u0132\7\u010d\1\0\52\u010d\1\0\2\51\1\165" + "\1\51\1\0\2\51\1\0\1\51\1\0\1\51\3\0" + "\2\51\2\0\3\51\1\0\1\51\7\0\11\51\1\0" + "\4\51\1\0\2\51\1\0\1\51\1\0\3\51\6\0" + "\2\55\1\170\1\55\1\0\2\55\1\0\1\55\1\0" + "\1\55\3\0\2\55\2\0\3\55\1\0\1\55\7\0" + "\11\55\1\0\4\55\1\0\2\55\1\0\1\55\1\0" + "\3\55\6\0\2\62\1\173\1\62\1\0\2\62\1\0" + "\1\62\1\0\1\62\3\0\2\62\2\0\3\62\1\0" + "\1\62\7\0\11\62\1\0\4\62\1\0\2\62\1\0" + "\1\62\1\0\3\62\6\0\2\72\1\200\1\72\1\0" + "\2\72\1\0\1\72\1\0\1\72\3\0\2\72\2\0" + "\3\72\1\0\1\72\7\0\11\72\1\0\4\72\1\0" + "\2\72\1\0\1\72\1\0\3\72\6\0\2\100\1\203" + "\1\100\1\0\2\100\1\0\1\100\1\0\1\100\3\0" + "\2\100\2\0\3\100\1\0\1\100\7\0\11\100\1\0" + "\4\100\1\0\2\100\1\0\1\100\1\0\3\100\6\0"
-				+ "\1\u0185\1\205\1\206\1\205\1\207\1\205\1\u0185\27\205" + "\1\u0185\2\205\1\u0185\2\205\1\u0185\10\205\1\u0185\4\205" + "\1\u0185\7\205\1\0\1\u0186\1\210\1\211\3\210\1\u0186" + "\1\207\26\210\1\u0186\2\210\1\u0186\2\210\1\u0186\10\210" + "\1\u0186\4\210\1\u0186\7\210\1\0\2\105\1\213\1\105" + "\1\0\2\105\1\0\1\105\1\0\1\105\3\0\2\105" + "\2\0\3\105\1\0\1\105\7\0\11\105\1\0\4\105" + "\1\0\2\105\1\0\1\105\1\0\3\105\6\0\1\u0187" + "\1\216\1\217\1\216\1\0\1\216\1\u0187\1\0\1\216" + "\1\0\1\216\3\0\2\216\2\0\3\216\1\0\1\216" + "\7\0\1\u0187\2\216\1\u0187\2\216\1\u0187\2\216\1\0" + "\4\216\1\0\1\u0187\1\216\1\0\1\216\1\0\1\u0187" + "\2\216\6\0\2\113\1\222\1\113\1\0\2\113\1\0" + "\1\113\1\0\1\113\3\0\2\113\2\0\3\113\1\223" + "\1\113\7\0\11\113\1\0\4\113\1\0\2\113\1\0" + "\1\113\1\0\3\113\6\0\1\u0188\1\225\1\226\1\225" + "\1\227\1\225\1\u0188\27\225\1\u0188\2\225\1\u0188\2\225" + "\1\u0188\10\225\1\u0188\4\225\1\u0188\7\225\1\0\1\u0189"
-				+ "\1\230\1\231\3\230\1\u0189\1\227\26\230\1\u0189\2\230" + "\1\u0189\2\230\1\u0189\10\230\1\u0189\4\230\1\u0189\7\230" + "\1\0\1\u018a\1\235\1\236\1\235\1\0\1\235\1\u018a" + "\1\0\1\235\1\0\1\235\3\0\2\235\2\0\3\235" + "\1\0\1\235\7\0\1\u018a\2\235\1\u018a\2\235\1\u018a" + "\2\235\1\0\4\235\1\0\1\u018a\1\235\1\0\1\235" + "\1\0\1\u018a\2\235\6\0\1\u018b\5\0\1\u018b\3\0" + "\1\367\5\0\1\u018b\5\0\1\u018b\7\0\2\u018b\1\0" + "\2\u018b\1\0\2\u018b\7\0\2\u018b\3\0\2\u018b\7\0" + "\1\u018c\5\0\1\u018c\11\0\1\u018c\5\0\1\u018c\7\0" + "\2\u018c\1\0\2\u018c\1\0\2\u018c\7\0\2\u018c\3\0" + "\2\u018c\7\0\1\u018d\1\u011e\1\u011f\1\u011e\1\0\1\u011e" + "\1\u018d\1\0\1\u011e\1\u0123\13\u011e\1\0\10\u011e\1\u018d" + "\2\u011e\1\u018d\2\u011e\1\u018d\10\u011e\1\u018d\4\u011e\1\u018d" + "\7\u011e\1\0\1\u018e\1\u0121\1\u0149\1\u0121\1\u0146\1\u0121" + "\1\u018e\27\u0121\1\u018e\2\u0121\1\u018e\2\u0121\1\u018e\10\u0121" + "\1\u018e\4\u0121\1\u018e\7\u0121\1\0\2\u0121\1\u0149\2\u0146"
-				+ "\1\u0170\2\u0121\1\u0170\1\u018f\4\u0121\2\u0146\52\u0121\1\0" + "\2\u0121\1\u0149\1\0\1\u0146\12\u0121\1\0\52\u0121\1\0" + "\1\u0190\1\u0122\1\u014a\3\u0122\1\u0190\1\u0146\26\u0122\1\u0190" + "\2\u0122\1\u0190\2\u0122\1\u0190\10\u0122\1\u0190\4\u0122\1\u0190" + "\7\u0122\1\0\2\u0122\1\u014a\1\u0146\1\u0122\1\u0173\1\u0122" + "\1\u0146\1\u0173\1\u0191\4\u0122\2\u0146\52\u0122\1\0\2\u0122" + "\1\u014a\1\0\3\u0122\1\u0146\7\u0122\1\0\52\u0122\42\0" + "\2\u0192\30\0\2\134\1\135\1\134\1\0\2\134\1\0" + "\1\134\1\0\1\134\3\0\2\134\2\0\3\134\1\0" + "\1\134\7\0\11\134\1\0\4\134\1\0\2\134\1\0" + "\1\134\1\0\3\134\6\0\2\136\1\137\1\136\1\0" + "\2\136\1\0\1\136\1\0\1\136\3\0\2\136\2\0" + "\3\136\1\0\1\136\7\0\11\136\1\0\4\136\1\0" + "\2\136\1\0\1\136\1\0\3\136\44\0\2\u0193\33\0" + "\1\u0194\1\341\1\342\1\341\1\0\1\341\1\u0194\1\0" + "\1\341\1\u0103\1\341\3\0\2\341\2\0\3\341\1\0" + "\1\341\7\0\1\u0194\2\341\1\u0194\2\341\1\u0194\2\341"
-				+ "\1\0\4\341\1\0\1\u0194\1\341\1\0\1\341\1\0" + "\1\u0194\2\341\6\0\2\147\1\150\1\147\1\0\2\147" + "\1\0\1\147\1\0\1\147\3\0\2\147\2\0\3\147" + "\1\260\1\147\7\0\11\147\1\0\4\147\1\0\2\147" + "\1\0\1\147\1\0\3\147\6\0\2\151\1\152\1\151" + "\1\153\65\151\1\0\2\154\1\155\4\154\1\153\62\154" + "\1\0\2\157\1\160\1\157\1\161\65\157\1\0\2\162" + "\1\163\4\162\1\161\62\162\1\0\1\u0195\1\u010a\1\u010b" + "\1\u010a\1\0\1\u010a\1\u0195\1\0\1\u010a\1\u010e\13\u010a" + "\1\0\10\u010a\1\u0195\2\u010a\1\u0195\2\u010a\1\u0195\10\u010a" + "\1\u0195\4\u010a\1\u0195\7\u010a\1\0\1\u0196\1\u010c\1\u0135" + "\1\u010c\1\u0132\1\u010c\1\u0196\27\u010c\1\u0196\2\u010c\1\u0196" + "\2\u010c\1\u0196\10\u010c\1\u0196\4\u010c\1\u0196\7\u010c\1\0" + "\1\u0197\1\u010d\1\u0136\3\u010d\1\u0197\1\u0132\26\u010d\1\u0197" + "\2\u010d\1\u0197\2\u010d\1\u0197\10\u010d\1\u0197\4\u010d\1\u0197" + "\7\u010d\1\0\2\205\1\206\1\205\1\207\65\205\1\0" + "\2\210\1\211\4\210\1\207\62\210\1\0\2\216\1\217"
-				+ "\1\216\1\0\2\216\1\0\1\216\1\0\1\216\3\0" + "\2\216\2\0\3\216\1\0\1\216\7\0\11\216\1\0" + "\4\216\1\0\2\216\1\0\1\216\1\0\3\216\6\0" + "\2\225\1\226\1\225\1\227\65\225\1\0\2\230\1\231" + "\4\230\1\227\62\230\1\0\2\235\1\236\1\235\1\0" + "\2\235\1\0\1\235\1\0\1\235\3\0\2\235\2\0" + "\3\235\1\0\1\235\7\0\11\235\1\0\4\235\1\0" + "\2\235\1\0\1\235\1\0\3\235\20\0\1\367\60\0" + "\1\u0198\5\0\1\u0198\11\0\1\u0198\5\0\1\u0198\7\0" + "\2\u0198\1\0\2\u0198\1\0\2\u0198\7\0\2\u0198\3\0" + "\2\u0198\7\0\1\u0199\1\u011e\1\u011f\1\u011e\1\0\1\u011e" + "\1\u0199\1\0\1\u011e\1\u0123\13\u011e\1\0\10\u011e\1\u0199" + "\2\u011e\1\u0199\2\u011e\1\u0199\10\u011e\1\u0199\4\u011e\1\u0199" + "\7\u011e\1\0\1\u019a\1\u0121\1\u0149\1\u0121\1\u0146\1\u0121" + "\1\u019a\27\u0121\1\u019a\2\u0121\1\u019a\2\u0121\1\u019a\10\u0121" + "\1\u019a\4\u0121\1\u019a\7\u0121\1\0\1\u019b\1\u0122\1\u014a" + "\3\u0122\1\u019b\1\u0146\26\u0122\1\u019b\2\u0122\1\u019b\2\u0122"
-				+ "\1\u019b\10\u0122\1\u019b\4\u0122\1\u019b\7\u0122\65\0\1\u019c" + "\52\0\2\u019d\25\0\1\u019e\1\341\1\342\1\341\1\0" + "\1\341\1\u019e\1\0\1\341\1\u0103\1\341\3\0\2\341" + "\2\0\3\341\1\0\1\341\7\0\1\u019e\2\341\1\u019e" + "\2\341\1\u019e\2\341\1\0\4\341\1\0\1\u019e\1\341" + "\1\0\1\341\1\0\1\u019e\2\341\6\0\1\u019f\1\u010a" + "\1\u010b\1\u010a\1\0\1\u010a\1\u019f\1\0\1\u010a\1\u010e" + "\13\u010a\1\0\10\u010a\1\u019f\2\u010a\1\u019f\2\u010a\1\u019f" + "\10\u010a\1\u019f\4\u010a\1\u019f\7\u010a\1\0\1\u01a0\1\u010c" + "\1\u0135\1\u010c\1\u0132\1\u010c\1\u01a0\27\u010c\1\u01a0\2\u010c" + "\1\u01a0\2\u010c\1\u01a0\10\u010c\1\u01a0\4\u010c\1\u01a0\7\u010c" + "\1\0\1\u01a1\1\u010d\1\u0136\3\u010d\1\u01a1\1\u0132\26\u010d" + "\1\u01a1\2\u010d\1\u01a1\2\u010d\1\u01a1\10\u010d\1\u01a1\4\u010d" + "\1\u01a1\7\u010d\1\0\1\u01a2\5\0\1\u01a2\11\0\1\u01a2" + "\5\0\1\u01a2\7\0\2\u01a2\1\0\2\u01a2\1\0\2\u01a2" + "\7\0\2\u01a2\3\0\2\u01a2\7\0\1\u01a3\1\u011e\1\u011f"
-				+ "\1\u011e\1\0\1\u011e\1\u01a3\1\0\1\u011e\1\u0123\13\u011e" + "\1\0\10\u011e\1\u01a3\2\u011e\1\u01a3\2\u011e\1\u01a3\10\u011e" + "\1\u01a3\4\u011e\1\u01a3\7\u011e\1\0\1\u01a4\1\u0121\1\u0149" + "\1\u0121\1\u0146\1\u0121\1\u01a4\27\u0121\1\u01a4\2\u0121\1\u01a4" + "\2\u0121\1\u01a4\10\u0121\1\u01a4\4\u0121\1\u01a4\7\u0121\1\0" + "\1\u01a5\1\u0122\1\u014a\3\u0122\1\u01a5\1\u0146\26\u0122\1\u01a5" + "\2\u0122\1\u01a5\2\u0122\1\u01a5\10\u0122\1\u01a5\4\u0122\1\u01a5" + "\7\u0122\47\0\1\u01a6\24\0\2\341\1\342\1\341\1\0" + "\2\341\1\0\1\341\1\u0103\1\341\3\0\2\341\2\0" + "\3\341\1\0\1\341\7\0\11\341\1\0\4\341\1\0" + "\2\341\1\0\1\341\1\0\3\341\6\0\1\u01a7\1\u010a" + "\1\u010b\1\u010a\1\0\1\u010a\1\u01a7\1\0\1\u010a\1\u010e" + "\13\u010a\1\0\10\u010a\1\u01a7\2\u010a\1\u01a7\2\u010a\1\u01a7" + "\10\u010a\1\u01a7\4\u010a\1\u01a7\7\u010a\1\0\1\u01a8\1\u010c" + "\1\u0135\1\u010c\1\u0132\1\u010c\1\u01a8\27\u010c\1\u01a8\2\u010c"
-				+ "\1\u01a8\2\u010c\1\u01a8\10\u010c\1\u01a8\4\u010c\1\u01a8\7\u010c" + "\1\0\1\u01a9\1\u010d\1\u0136\3\u010d\1\u01a9\1\u0132\26\u010d" + "\1\u01a9\2\u010d\1\u01a9\2\u010d\1\u01a9\10\u010d\1\u01a9\4\u010d" + "\1\u01a9\7\u010d\1\0\1\u01aa\1\u011e\1\u011f\1\u011e\1\0" + "\1\u011e\1\u01aa\1\0\1\u011e\1\u0123\13\u011e\1\0\10\u011e" + "\1\u01aa\2\u011e\1\u01aa\2\u011e\1\u01aa\10\u011e\1\u01aa\4\u011e" + "\1\u01aa\7\u011e\1\0\1\u01ab\1\u0121\1\u0149\1\u0121\1\u0146" + "\1\u0121\1\u01ab\27\u0121\1\u01ab\2\u0121\1\u01ab\2\u0121\1\u01ab" + "\10\u0121\1\u01ab\4\u0121\1\u01ab\7\u0121\1\0\1\u01ac\1\u0122" + "\1\u014a\3\u0122\1\u01ac\1\u0146\26\u0122\1\u01ac\2\u0122\1\u01ac" + "\2\u0122\1\u01ac\10\u0122\1\u01ac\4\u0122\1\u01ac\7\u0122\1\0" + "\2\u010a\1\u010b\1\u010a\1\0\2\u010a\1\0\1\u010a\1\u010e" + "\13\u010a\1\0\44\u010a\1\0\1\u01ad\1\u010c\1\u0135\1\u010c" + "\1\u0132\1\u010c\1\u01ad\27\u010c\1\u01ad\2\u010c\1\u01ad\2\u010c"
-				+ "\1\u01ad\10\u010c\1\u01ad\4\u010c\1\u01ad\7\u010c\1\0\1\u01ae" + "\1\u010d\1\u0136\3\u010d\1\u01ae\1\u0132\26\u010d\1\u01ae\2\u010d" + "\1\u01ae\2\u010d\1\u01ae\10\u010d\1\u01ae\4\u010d\1\u01ae\7\u010d" + "\1\0\2\u011e\1\u011f\1\u011e\1\0\2\u011e\1\0\1\u011e" + "\1\u0123\13\u011e\1\0\44\u011e\1\0\1\u01af\1\u0121\1\u0149" + "\1\u0121\1\u0146\1\u0121\1\u01af\27\u0121\1\u01af\2\u0121\1\u01af" + "\2\u0121\1\u01af\10\u0121\1\u01af\4\u0121\1\u01af\7\u0121\1\0" + "\1\u01b0\1\u0122\1\u014a\3\u0122\1\u01b0\1\u0146\26\u0122\1\u01b0" + "\2\u0122\1\u01b0\2\u0122\1\u01b0\10\u0122\1\u01b0\4\u0122\1\u01b0" + "\7\u0122\1\0\2\u010c\1\u0135\1\u010c\1\u0132\65\u010c\1\0" + "\2\u010d\1\u0136\4\u010d\1\u0132\62\u010d\1\0\2\u0121\1\u0149" + "\1\u0121\1\u0146\65\u0121\1\0\2\u0122\1\u014a\4\u0122\1\u0146" + "\62\u0122";
-
-	/**
-	 * 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;
-//trivial hand edit to remove "not used" warning	final private static int YY_ILLEGAL_STATE = 1;
-	final private static int YY_NO_MATCH = 2;
-//	trivial hand edit to remove "not used" warning	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"};
-
-	/**
-	 * YY_ATTRIBUTE[aState] contains the attributes of state
-	 * <code>aState</code>
-	 */
-	private final static byte YY_ATTRIBUTE[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 1, 1, 1, 1, 1, 1, 9, 1, 9, 1, 1, 9, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 9, 9, 1, 1, 1, 9, 1, 3, 9, 9, 1, 1, 1, 9, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 9, 3, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 9, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 13, 7, 0, 1, 1, 0, 1, 0, 0, 9, 0, 0, 1, 0, 1, 1, 1, 0, 0, 9, 0, 9, 1, 0, 0, 9, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 13, 7, 1, 9, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 9, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 9, 0, 0, 9, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 9, 0, 1, 1, 1, 0, 0, 9, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0,
-				0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 9, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 9, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 9, 0, 0, 0, 0, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-
-	/** 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
-	 */
-//	trivial hand edit to remove "not used" warning	private int yycolumn;
-
-	/**
-	 * yy_atBOL == true <=>the scanner is currently at the beginning of a
-	 * line
-	 */
-//	trivial hand edit to remove "not used" warning	private boolean yy_atBOL;
-
-	/** yy_atEOF == true <=>the scanner has returned a value for EOF */
-	private boolean yy_atEOF;
-
-	/* user code: */
-	private final static String UNDEFINED = "undefined";
-	private String fBufferedContext = null;
-	private int fBufferedStart;
-	// private int fBufferedTextLength;
-	private int fBufferedLength;
-	// private StringBuffer fBufferedText = null;
-	private CSSTextRegionFactory fRegionFactory = CSSTextRegionFactory.getInstance();
-	private int fInitialState = YYINITIAL;
-	public final static int BUFFER_SIZE_NORMAL = 16384;
-	public final static int BUFFER_SIZE_SMALL = 256;
-	private int fInitialBufferSize = BUFFER_SIZE_NORMAL;
-
-	public void setInitialState(int state) {
-		fInitialState = state;
-	}
-
-	public void setInitialBufferSize(int size) {
-		fInitialBufferSize = size;
-	}
-
-	/* user method */
-	public final ITextRegion getNextToken() throws IOException {
-		String context;
-		String nextTokenType;
-		boolean spaceFollows;
-		// StringBuffer text;
-		int start;
-		int textLength;
-		int length;
-		if (fBufferedContext != null) {
-			context = fBufferedContext;
-			// text = fBufferedText;
-			start = fBufferedStart;
-			textLength = length = fBufferedLength;
-
-			fBufferedContext = null;
-		}
-		else {
-			context = primGetNextToken();
-			// text = new StringBuffer(yytext());
-			start = yychar;
-			textLength = length = yylength();
-		}
-
-		if (context != null) {
-			if (context == UNDEFINED) {
-				// undef -> concatenate undef's
-				nextTokenType = primGetNextToken();
-				while (nextTokenType == UNDEFINED) {
-					// text.append(yytext());
-					textLength += yylength();
-					length = textLength;
-					nextTokenType = primGetNextToken();
-				}
-				fBufferedContext = nextTokenType;
-				// fBufferedText = new StringBuffer(yytext());
-				fBufferedStart = yychar;
-				fBufferedLength = yylength();
-			}
-			else {
-				nextTokenType = null;
-				spaceFollows = false;
-				if (CSSRegionUtil.isDeclarationValueType(context)) { // declaration
-																		// value
-																		// can
-																		// contain
-																		// VALUE_S
-					nextTokenType = primGetNextToken();
-					spaceFollows = (nextTokenType == CSS_DECLARATION_VALUE_S);
-				}
-				else if (canContainSpace(context)) {
-					nextTokenType = primGetNextToken();
-					spaceFollows = (nextTokenType == CSS_S);
-				}
-				if (nextTokenType != null) { // nextToken is retrieved
-					if (spaceFollows) {
-						// next is space -> append
-						// text.append(yytext());
-						length += yylength();
-					}
-					else {
-						// next is NOT space -> push this for next time,
-						// return itself
-						fBufferedContext = nextTokenType;
-						// fBufferedText = new StringBuffer(yytext());
-						fBufferedStart = yychar;
-						fBufferedLength = yylength();
-					}
-				}
-			}
-		}
-
-		if (context != null) {
-			if (context == UNDEFINED) {
-				context = CSS_UNKNOWN;
-			}
-			return fRegionFactory.createRegion(context, start, textLength, length);
-		}
-		else {
-			return null;
-		}
-	}
-
-	/* user method */
-	/* for standalone use */
-	public final List parseText() throws IOException {
-		List tokens = new ArrayList();
-
-		CSSTextToken token;
-		for (String kind = primGetNextToken(); kind != null; kind = primGetNextToken()) {
-			token = new CSSTextToken();
-			token.kind = kind;
-			token.start = yychar;
-			token.length = yylength();
-			token.image = yytext();
-			tokens.add(token);
-		}
-
-		return tokens;
-	}
-
-	/* user method */
-	private boolean canContainSpace(String type) {
-		if (type == CSS_DELIMITER || type == CSS_RBRACE || type == CSS_DECLARATION_DELIMITER) {
-			return false;
-		}
-		else {
-			return true;
-		}
-	}
-
-	/* user method */
-	public final int getOffset() {
-		return yychar;
-	}
-
-	/* user method */
-	public final boolean isEOF() {
-		return yy_atEOF;
-	}
-
-	/* user method */
-	public void reset(char[] charArray) {
-		reset(new CharArrayReader(charArray), 0);
-	}
-
-	/* user method */
-	public final void reset(java.io.Reader in, int newOffset) {
-		/** the input device */
-		yy_reader = in;
-
-		/** the current state of the DFA */
-		yy_state = 0;
-
-		/** the current lexical state */
-		yy_lexical_state = fInitialState; // YYINITIAL;
-
-		/**
-		 * this buffer contains the current text to be matched and is the
-		 * source of the yytext() string
-		 */
-		if (yy_buffer.length != fInitialBufferSize) {
-			yy_buffer = new char[fInitialBufferSize];
-		}
-		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;
-
-		/**
-		 * the number of characters from the last newline up to the start of
-		 * the matched text
-		 */
-//		trivial hand edit to remove "not used" warning		yycolumn = 0;
-
-		/**
-		 * yy_atBOL == true <=>the scanner is currently at the beginning of a
-		 * line
-		 */
-//		trivial hand edit to remove "not used" warning		yy_atBOL = false;
-
-		/** yy_atEOF == true <=>the scanner has returned a value for EOF */
-		yy_atEOF = false;
-
-		/* user variables */
-		// fUndefined.delete(0, fUndefined.length());
-	}
-
-	/* user method */
-	public CSSTokenizer() {
-		super();
-	}
-
-
-
-	/**
-	 * 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 CSSTokenizer(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 CSSTokenizer(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[21004];
-		int i = 0; /* index in packed string */
-		int j = 0; /* index in unpacked array */
-		while (i < 13906) {
-			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 < 170) {
-			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.
-	 * 
-	 * @param errorCode
-	 *            the code of the errormessage to display
-	 */
-	private void yy_ScanError(int errorCode) {
-		try {
-			System.out.println(YY_ERROR_MSG[errorCode]);
-		}
-		catch (ArrayIndexOutOfBoundsException e) {
-			System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
-			e.printStackTrace();
-
-		}
-
-		// 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()!
-	 */
-//	trivial hand edit to remove "not used" warning
-//	private void yypushback(int number) {
-//		if (number > yylength())
-//			yy_ScanError(YY_PUSHBACK_2BIG);
-//
-//		yy_markedPos -= 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 IOException
-	 *                if any I/O-Error occurs
-	 */
-	public String primGetNextToken() throws java.io.IOException {
-		int yy_input;
-		int yy_action;
-
-		yy_pushbackPos = -1;
-		boolean yy_was_pushback;
-
-		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_was_pushback = false;
-
-			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 & 2) > 0)
-						yy_pushbackPos = yy_currentPos;
-
-					if ((yy_attributes & 1) > 0) {
-						yy_was_pushback = (yy_attributes & 4) > 0;
-						yy_action = yy_state;
-						yy_markedPos = yy_currentPos;
-						if ((yy_attributes & 8) > 0)
-							break yy_forAction;
-					}
-
-				}
-			}
-
-			if (yy_was_pushback)
-				yy_markedPos = yy_pushbackPos;
-
-			switch (yy_action) {
-
-				case 421 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_IMPORTANT;
-				}
-				case 433 :
-					break;
-				case 412 : {
-					yybegin(ST_FONT_FACE_DELIMITER);
-					return CSS_FONT_FACE;
-				}
-				case 434 :
-					break;
-				case 375 : {
-					yybegin(ST_CHARSET_NAME);
-					return CSS_CHARSET;
-				}
-				case 435 :
-					break;
-				case 335 : {
-					yybegin(ST_IMPORT_URI);
-					return CSS_IMPORT;
-				}
-				case 436 :
-					break;
-				case 297 : {
-					yybegin(ST_MEDIA_MEDIUM);
-					return CSS_MEDIA;
-				}
-				case 437 :
-					break;
-				case 290 :
-				case 327 :
-				case 398 :
-				case 400 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_URI;
-				}
-				case 438 :
-					break;
-				case 269 :
-				case 307 :
-				case 385 :
-				case 387 : {
-					yybegin(ST_IMPORT_MEDIUM);
-					return CSS_URI;
-				}
-				case 439 :
-					break;
-				case 255 : {
-					yybegin(ST_PAGE_PSEUDO_PAGE);
-					return CSS_PAGE;
-				}
-				case 440 :
-					break;
-				case 218 : {
-					return CSS_COMMENT;
-				}
-				case 441 :
-					break;
-				case 217 : {
-					return CSS_CDO;
-				}
-				case 442 :
-					break;
-				case 211 :
-				case 245 :
-				case 283 :
-				case 284 :
-				case 323 :
-				case 324 :
-				case 363 :
-				case 364 :
-				case 394 :
-				case 395 :
-				case 407 :
-				case 417 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_UNICODE_RANGE;
-				}
-				case 443 :
-					break;
-				case 165 : {
-					return CSS_CDC;
-				}
-				case 444 :
-					break;
-				case 162 : {
-					return CSS_DECLARATION_VALUE_S;
-				}
-				case 445 :
-					break;
-				case 156 :
-				case 210 :
-				case 244 :
-				case 282 :
-				case 322 :
-				case 362 :
-				case 393 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_HASH;
-				}
-				case 446 :
-					break;
-				case 150 :
-				case 205 :
-				case 208 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_STRING;
-				}
-				case 447 :
-					break;
-				case 57 :
-				case 59 :
-				case 128 :
-				case 129 :
-				case 193 :
-				case 235 :
-				case 273 :
-				case 313 :
-				case 353 : {
-					yybegin(ST_SELECTOR_ATTRIBUTE_OPERATOR);
-					return CSS_SELECTOR_ATTRIBUTE_NAME;
-				}
-				case 448 :
-					break;
-				case 56 : {
-					yybegin(ST_SELECTOR);
-					return CSS_SELECTOR_SEPARATOR;
-				}
-				case 449 :
-					break;
-				case 55 :
-				case 125 : {
-					yybegin(ST_SELECTOR);
-					return CSS_SELECTOR_COMBINATOR;
-				}
-				case 450 :
-					break;
-				case 52 : {
-					yybegin(ST_DECLARATION);
-					return CSS_LBRACE;
-				}
-				case 451 :
-					break;
-				case 49 :
-				case 51 :
-				case 123 :
-				case 124 :
-				case 192 :
-				case 234 :
-				case 272 :
-				case 312 :
-				case 352 : {
-					yybegin(ST_PAGE_DELIMITER);
-					return CSS_PAGE_SELECTOR;
-				}
-				case 452 :
-					break;
-				case 48 : {
-					yybegin(YYINITIAL);
-					return CSS_LBRACE;
-				}
-				case 453 :
-					break;
-				case 47 : {
-					yybegin(ST_MEDIA_MEDIUM);
-					return CSS_MEDIA_SEPARATOR;
-				}
-				case 454 :
-					break;
-				case 44 :
-				case 46 :
-				case 120 :
-				case 121 :
-				case 191 :
-				case 233 :
-				case 271 :
-				case 311 :
-				case 351 : {
-					yybegin(ST_MEDIA_DELIMITER);
-					return CSS_MEDIUM;
-				}
-				case 455 :
-					break;
-				case 43 : {
-					yybegin(ST_IMPORT_MEDIUM);
-					return CSS_MEDIA_SEPARATOR;
-				}
-				case 456 :
-					break;
-				case 20 :
-				case 23 :
-				case 89 :
-				case 90 :
-				case 164 :
-				case 214 :
-				case 249 :
-				case 292 :
-				case 331 : {
-					yybegin(ST_SELECTOR_MODIFIER);
-					return CSS_SELECTOR_ELEMENT_NAME;
-				}
-				case 457 :
-					break;
-				case 22 :
-				case 54 :
-				case 87 :
-				case 126 :
-				case 163 : {
-					return CSS_S;
-				}
-				case 458 :
-					break;
-				case 27 : {
-					yybegin(YYINITIAL);
-					return CSS_RBRACE;
-				}
-				case 459 :
-					break;
-				case 29 : {
-					yybegin(ST_SELECTOR_MODIFIER);
-					return CSS_SELECTOR_UNIVERSAL;
-				}
-				case 460 :
-					break;
-				case 32 : {
-					yybegin(ST_SELECTOR_ATTRIBUTE_NAME);
-					return CSS_SELECTOR_ATTRIBUTE_START;
-				}
-				case 461 :
-					break;
-				case 36 : {
-					yybegin(YYINITIAL);
-					return CSS_DELIMITER;
-				}
-				case 462 :
-					break;
-				case 40 :
-				case 42 :
-				case 117 :
-				case 118 :
-				case 190 :
-				case 232 :
-				case 270 :
-				case 310 :
-				case 350 : {
-					yybegin(ST_IMPORT_DELIMITER);
-					return CSS_MEDIUM;
-				}
-				case 463 :
-					break;
-				case 60 : {
-					yybegin(ST_SELECTOR_ATTRIBUTE_VALUE);
-					return CSS_SELECTOR_ATTRIBUTE_OPERATOR;
-				}
-				case 464 :
-					break;
-				case 62 : {
-					yybegin(ST_SELECTOR_MODIFIER);
-					return CSS_SELECTOR_ATTRIBUTE_END;
-				}
-				case 465 :
-					break;
-				case 63 :
-				case 67 :
-				case 131 :
-				case 134 :
-				case 137 :
-				case 194 :
-				case 196 :
-				case 199 :
-				case 236 :
-				case 274 :
-				case 314 :
-				case 354 : {
-					yybegin(ST_SELECTOR_ATTRIBUTE_END);
-					return CSS_SELECTOR_ATTRIBUTE_VALUE;
-				}
-				case 466 :
-					break;
-				case 68 :
-				case 70 :
-				case 139 :
-				case 140 :
-				case 201 :
-				case 239 :
-				case 277 :
-				case 317 :
-				case 357 : {
-					yybegin(ST_DECLARATION_SEPARATOR);
-					return CSS_DECLARATION_PROPERTY;
-				}
-				case 467 :
-					break;
-				case 71 : {
-					yybegin(ST_DECLARATION);
-					return CSS_DECLARATION_DELIMITER;
-				}
-				case 468 :
-					break;
-				case 72 : {
-					yybegin(ST_DECLARATION_PRE_VALUE);
-					return CSS_DECLARATION_SEPARATOR;
-				}
-				case 469 :
-					break;
-				case 73 :
-				case 155 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_NUMBER;
-				}
-				case 470 :
-					break;
-				case 74 :
-				case 79 :
-				case 83 :
-				case 147 :
-				case 153 :
-				case 154 :
-				case 159 :
-				case 203 :
-				case 212 :
-				case 241 :
-				case 279 :
-				case 319 :
-				case 359 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_IDENT;
-				}
-				case 471 :
-					break;
-				case 78 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE;
-				}
-				case 472 :
-					break;
-				case 85 :
-				case 86 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_OPERATOR;
-				}
-				case 473 :
-					break;
-				case 91 :
-				case 166 :
-				case 215 :
-				case 250 :
-				case 293 :
-				case 332 :
-				case 373 : {
-					yybegin(ST_SELECTOR_MODIFIER);
-					return CSS_SELECTOR_CLASS;
-				}
-				case 474 :
-					break;
-				case 93 :
-				case 167 :
-				case 216 :
-				case 251 :
-				case 294 :
-				case 333 :
-				case 374 : {
-					yybegin(ST_SELECTOR_MODIFIER);
-					return CSS_SELECTOR_ID;
-				}
-				case 475 :
-					break;
-				case 102 :
-				case 176 :
-				case 226 :
-				case 258 :
-				case 260 :
-				case 300 :
-				case 338 :
-				case 378 : {
-					yybegin(ST_SELECTOR_MODIFIER);
-					return CSS_SELECTOR_PSEUDO;
-				}
-				case 476 :
-					break;
-				case 106 :
-				case 178 :
-				case 181 : {
-					yybegin(ST_CHARSET_DELIMITER);
-					return CSS_STRING;
-				}
-				case 477 :
-					break;
-				case 112 :
-				case 184 :
-				case 187 : {
-					yybegin(ST_IMPORT_MEDIUM);
-					return CSS_STRING;
-				}
-				case 478 :
-					break;
-				case 141 :
-				case 202 :
-				case 240 :
-				case 278 :
-				case 318 :
-				case 358 :
-				case 390 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_DIMENSION;
-				}
-				case 479 :
-					break;
-				case 144 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_PERCENTAGE;
-				}
-				case 480 :
-					break;
-				case 146 :
-				case 247 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_FUNCTION;
-				}
-				case 481 :
-					break;
-				case 19 :
-				case 21 :
-				case 24 :
-				case 25 :
-				case 26 :
-				case 28 :
-				case 30 :
-				case 31 :
-				case 33 :
-				case 34 :
-				case 35 :
-				case 37 :
-				case 38 :
-				case 39 :
-				case 41 :
-				case 45 :
-				case 50 :
-				case 53 :
-				case 58 :
-				case 61 :
-				case 64 :
-				case 65 :
-				case 66 :
-				case 69 :
-				case 75 :
-				case 76 :
-				case 77 :
-				case 80 :
-				case 81 :
-				case 82 :
-				case 84 : {
-					return UNDEFINED;
-				}
-				case 482 :
-					break;
-				default :
-					if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
-						yy_atEOF = true;
-						return null;
-					}
-					else {
-						yy_ScanError(YY_NO_MATCH);
-					}
-			}
-		}
-	}
-
-	/**
-	 * Runs the scanner on input files.
-	 * 
-	 * This main method is the debugging routine for the scanner. It prints
-	 * each returned token to System.out until the end of file is reached, or
-	 * an error occured.
-	 * 
-	 * @param argv
-	 *            the command line, contains the filenames to run the scanner
-	 *            on.
-	 */
-	public static void main(String argv[]) {
-		for (int i = 0; i < argv.length; i++) {
-			CSSTokenizer scanner = null;
-			try {
-				scanner = new CSSTokenizer(new java.io.FileReader(argv[i]));
-			}
-			catch (java.io.FileNotFoundException e) {
-				System.out.println("File not found : \"" + argv[i] + "\"");
-				System.exit(1);
-			}
-			catch (ArrayIndexOutOfBoundsException e) {
-				System.out.println("Usage : java CSSTokenizer <inputfile>");
-				System.exit(1);
-			}
-
-			try {
-				do {
-					System.out.println(scanner.primGetNextToken());
-				}
-				while (!scanner.yy_atEOF);
-
-			}
-			catch (java.io.IOException e) {
-				System.out.println("An I/O error occured while scanning :");
-				System.out.println(e);
-				System.exit(1);
-			}
-			catch (Exception e) {
-				e.printStackTrace();
-				System.exit(1);
-			}
-		}
-	}
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/regions/CSSTextRegionFactory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/regions/CSSTextRegionFactory.java
deleted file mode 100644
index e6dcdde..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/regions/CSSTextRegionFactory.java
+++ /dev/null
@@ -1,35 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.parser.ContextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-public class CSSTextRegionFactory {
-	public synchronized static CSSTextRegionFactory getInstance() {
-		if (fInstance == null) {
-			fInstance = new CSSTextRegionFactory();
-		}
-		return fInstance;
-	}
-
-	public ITextRegion createRegion(String context, int start, int textLength, int length) {
-		ITextRegion region = null;
-		region = new ContextRegion(context, start, textLength, length);
-		return region;
-	}
-
-	private CSSTextRegionFactory() {
-		super();
-	}
-
-	private static CSSTextRegionFactory fInstance = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSRegionContexts.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSRegionContexts.java
deleted file mode 100644
index cd3bd13..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSRegionContexts.java
+++ /dev/null
@@ -1,76 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.parserz;
-
-/**
- */
-public interface CSSRegionContexts {
-	public static final String CSS_COMMENT = "COMMENT"; //$NON-NLS-1$
-	public static final String CSS_CDO = "CDO"; //$NON-NLS-1$
-	public static final String CSS_CDC = "CDC"; //$NON-NLS-1$
-	public static final String CSS_S = "S"; //$NON-NLS-1$
-
-	public static final String CSS_DELIMITER = "DELIMITER"; //$NON-NLS-1$
-	public static final String CSS_LBRACE = "LBRACE"; //$NON-NLS-1$
-	public static final String CSS_RBRACE = "RBRACE"; //$NON-NLS-1$
-
-	public static final String CSS_IMPORT = "IMPORT"; //$NON-NLS-1$
-	public static final String CSS_PAGE = "PAGE"; //$NON-NLS-1$
-	public static final String CSS_MEDIA = "MEDIA"; //$NON-NLS-1$
-	public static final String CSS_FONT_FACE = "FONT_FACE"; //$NON-NLS-1$
-	public static final String CSS_CHARSET = "CHARSET"; //$NON-NLS-1$
-	public static final String CSS_ATKEYWORD = "ATKEYWORD"; //$NON-NLS-1$
-
-	public static final String CSS_STRING = "STRING"; //$NON-NLS-1$
-	public static final String CSS_URI = "URI"; //$NON-NLS-1$
-	public static final String CSS_MEDIUM = "MEDIUM"; //$NON-NLS-1$
-	public static final String CSS_MEDIA_SEPARATOR = "MEDIA_SEPARATOR"; //$NON-NLS-1$
-
-	public static final String CSS_CHARSET_NAME = "CHARSET_NAME"; //$NON-NLS-1$
-
-	public static final String CSS_PAGE_SELECTOR = "CSS_PAGE_SELECTOR"; //$NON-NLS-1$
-
-	public static final String CSS_SELECTOR_ELEMENT_NAME = "SELECTOR_ELEMENT_NAME"; //$NON-NLS-1$
-	public static final String CSS_SELECTOR_UNIVERSAL = "SELECTOR_UNIVERSAL"; //$NON-NLS-1$
-	public static final String CSS_SELECTOR_PSEUDO = "SELECTOR_PSEUDO"; //$NON-NLS-1$
-	public static final String CSS_SELECTOR_CLASS = "SELECTOR_CLASS"; //$NON-NLS-1$
-	public static final String CSS_SELECTOR_ID = "SELECTOR_ID"; //$NON-NLS-1$
-	public static final String CSS_SELECTOR_COMBINATOR = "SELECTOR_COMBINATOR"; //$NON-NLS-1$
-	public static final String CSS_SELECTOR_SEPARATOR = "SELECTOR_SEPARATOR"; //$NON-NLS-1$
-
-	public static final String CSS_SELECTOR_ATTRIBUTE_START = "SELECTOR_ATTRIBUTE_START"; //$NON-NLS-1$
-	public static final String CSS_SELECTOR_ATTRIBUTE_END = "SELECTOR_ATTRIBUTE_END"; //$NON-NLS-1$
-	public static final String CSS_SELECTOR_ATTRIBUTE_NAME = "SELECTOR_ATTRIBUTE_NAME"; //$NON-NLS-1$
-	public static final String CSS_SELECTOR_ATTRIBUTE_VALUE = "SELECTOR_ATTRIBUTE_VALUE"; //$NON-NLS-1$
-	public static final String CSS_SELECTOR_ATTRIBUTE_OPERATOR = "SELECTOR_ATTRIBUTE_OPERATOR"; //$NON-NLS-1$
-
-	public static final String CSS_DECLARATION_PROPERTY = "DECLARATION_PROPERTY"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_SEPARATOR = "DECLARATION_SEPARATOR"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_DELIMITER = "DECLARATION_DELIMITER"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_VALUE_IDENT = "DECLARATION_VALUE_IDENT"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_VALUE_DIMENSION = "DECLARATION_VALUE_DIMENSION"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_VALUE_PERCENTAGE = "DECLARATION_VALUE_PERCENTAGE"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_VALUE_NUMBER = "DECLARATION_VALUE_NUMBER"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_VALUE_FUNCTION = "DECLARATION_VALUE_FUNCTION"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE = "DECLARATION_VALUE_PARENTHESIS_CLOSE"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_VALUE_STRING = "DECLARATION_VALUE_STRING"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_VALUE_URI = "DECLARATION_VALUE_URI"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_VALUE_HASH = "DECLARATION_VALUE_HASH"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_VALUE_UNICODE_RANGE = "DECLARATION_VALUE_UNICODE_RANGE"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_VALUE_IMPORTANT = "CSS_DECLARATION_VALUE_IMPORTANT"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_VALUE_OPERATOR = "DECLARATION_VALUE_OPERATOR"; //$NON-NLS-1$
-	public static final String CSS_DECLARATION_VALUE_S = "DECLARATION_VALUE_S"; //$NON-NLS-1$
-
-	public static final String CSS_UNKNOWN = "UNKNOWN"; //$NON-NLS-1$
-
-	// For null object : CSSTokenizer never set this value
-	public static final String CSS_UNDEFINED = "UNDEFINED"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextParser.java
deleted file mode 100644
index 922c3f1..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextParser.java
+++ /dev/null
@@ -1,101 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.parserz;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.parser.CSSTokenizer;
-
-
-
-public class CSSTextParser {
-	public static final int MODE_STYLESHEET = 0;
-	public static final int MODE_DECLARATION = 1;
-	public static final int MODE_DECLARATION_VALUE = 2;
-
-	public CSSTextParser(int parserMode) {
-		initializeParserMode(parserMode);
-	}
-
-	public CSSTextParser(int parserMode, Reader reader) {
-		initializeParserMode(parserMode);
-		reset(reader);
-	}
-
-	public CSSTextParser(int parserMode, String input) {
-		initializeParserMode(parserMode);
-		reset(input);
-	}
-
-	public void reset(Reader reader) {
-		getTokenizer().reset(reader, 0);
-	}
-
-	public void reset(String input) {
-		getTokenizer().reset(new StringReader(input), 0);
-	}
-
-	public CSSTextToken[] getTokens() {
-		List tokenList = getTokenList();
-		CSSTextToken[] tokens = new CSSTextToken[tokenList.size()];
-		return (CSSTextToken[]) tokenList.toArray(tokens);
-	}
-
-	public List getTokenList() {
-		List tokens;
-		try {
-			tokens = getTokenizer().parseText();
-		}
-		catch (IOException e) {
-			tokens = Collections.EMPTY_LIST;
-		}
-		return tokens;
-	}
-
-	private void initializeParserMode(int parserMode) {
-		int initialState;
-		int bufsize;
-		switch (parserMode) {
-			case MODE_STYLESHEET :
-				initialState = CSSTokenizer.YYINITIAL;
-				bufsize = CSSTokenizer.BUFFER_SIZE_NORMAL;
-				break;
-			case MODE_DECLARATION :
-				initialState = CSSTokenizer.ST_DECLARATION;
-				bufsize = CSSTokenizer.BUFFER_SIZE_NORMAL;
-				break;
-			case MODE_DECLARATION_VALUE :
-				initialState = CSSTokenizer.ST_DECLARATION_PRE_VALUE;
-				bufsize = CSSTokenizer.BUFFER_SIZE_SMALL;
-				break;
-			default :
-				return;
-		}
-		if (0 < initialState) {
-			CSSTokenizer tokenizer = getTokenizer();
-			tokenizer.setInitialState(initialState);
-			tokenizer.setInitialBufferSize(bufsize);
-		}
-	}
-
-	private CSSTokenizer getTokenizer() {
-		if (fTokenizer == null) {
-			fTokenizer = new CSSTokenizer();
-		}
-		return fTokenizer;
-	}
-
-	private CSSTokenizer fTokenizer = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextToken.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextToken.java
deleted file mode 100644
index adcf01f..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextToken.java
+++ /dev/null
@@ -1,23 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.parserz;
-
-
-public class CSSTextToken {
-	public String kind;
-	public String image;
-	public int start;
-	public int length;
-
-	public String toString() {
-		return (image != null) ? image : ""; //$NON-NLS-1$
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java
deleted file mode 100644
index fc3997d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java
+++ /dev/null
@@ -1,68 +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.css.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.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-/**
- * Sets default values for CSS Core preferences
- */
-public class CSSCorePreferenceInitializer extends AbstractPreferenceInitializer {
-
-	public void initializeDefaultPreferences() {
-		IEclipsePreferences node = new DefaultScope().getNode(CSSCorePlugin.getDefault().getBundle().getSymbolicName());
-
-		// formatting preferences
-		node.putInt(CSSCorePreferenceNames.LINE_WIDTH, 72);
-		node.putBoolean(CSSCorePreferenceNames.CLEAR_ALL_BLANK_LINES, false);
-		node.put(CSSCorePreferenceNames.INDENTATION_CHAR, CSSCorePreferenceNames.TAB);
-		node.putInt(CSSCorePreferenceNames.INDENTATION_SIZE, 1);
-
-		// cleanup preferences
-		node.putBoolean(CSSCorePreferenceNames.QUOTE_ATTR_VALUES, true);
-		node.putBoolean(CSSCorePreferenceNames.FORMAT_SOURCE, true);
-
-		// code generation preferences
-		node.put(CommonEncodingPreferenceNames.INPUT_CODESET, ""); //$NON-NLS-1$
-		String defaultEnc = "UTF-8";//$NON-NLS-1$
-		String systemEnc = System.getProperty("file.encoding"); //$NON-NLS-1$
-		if (systemEnc != null) {
-			defaultEnc = CommonCharsetNames.getPreferredDefaultIanaName(systemEnc, "UTF-8");//$NON-NLS-1$
-		}
-		node.put(CommonEncodingPreferenceNames.OUTPUT_CODESET, defaultEnc);
-		node.put(CommonEncodingPreferenceNames.END_OF_LINE_CODE, ""); //$NON-NLS-1$
-		
-		// additional css core preferences
-		node.putInt(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM, 0);
-		node.putInt(CSSCorePreferenceNames.FORMAT_PROP_POST_DELIM, 1);
-		node.put(CSSCorePreferenceNames.FORMAT_QUOTE, "\"");//$NON-NLS-1$
-		node.put(CSSCorePreferenceNames.FORMAT_BETWEEN_VALUE, " ");//$NON-NLS-1$
-		node.putBoolean(CSSCorePreferenceNames.FORMAT_QUOTE_IN_URI, true);
-		node.putBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE, true);
-		node.putBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR, true);
-		node.putBoolean(CSSCorePreferenceNames.WRAPPING_NEWLINE_ON_OPEN_BRACE, false);
-		node.putInt(CSSCorePreferenceNames.CASE_IDENTIFIER, CSSCorePreferenceNames.UPPER);
-		node.putInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME, CSSCorePreferenceNames.LOWER);
-		node.putInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE, CSSCorePreferenceNames.LOWER);
-
-		// CSS cleanup preferences
-		node.putInt(CSSCorePreferenceNames.CLEANUP_CASE_IDENTIFIER, CSSCorePreferenceNames.ASIS);
-		node.putInt(CSSCorePreferenceNames.CLEANUP_CASE_PROPERTY_NAME, CSSCorePreferenceNames.ASIS);
-		node.putInt(CSSCorePreferenceNames.CLEANUP_CASE_PROPERTY_VALUE, CSSCorePreferenceNames.ASIS);
-		node.putInt(CSSCorePreferenceNames.CLEANUP_CASE_SELECTOR, CSSCorePreferenceNames.ASIS);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java
deleted file mode 100644
index 130389a..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java
+++ /dev/null
@@ -1,134 +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.css.core.internal.preferences;
-
-/**
- * CSS core preference keys.
- * 
- * @plannedfor 1.0
- */
-public class CSSCorePreferenceNames {
-	private CSSCorePreferenceNames() {
-		// empty private constructor so users cannot instantiate class
-	}
-
-	public static final String CASE_IDENTIFIER = "identifierCase"; //$NON-NLS-1$
-	public static final String CASE_PROPERTY_NAME = "propNameCase"; //$NON-NLS-1$
-	public static final String CASE_PROPERTY_VALUE = "propValueCase"; //$NON-NLS-1$
-	public static final String FORMAT_BETWEEN_VALUE = "betweenValue"; //$NON-NLS-1$
-	public static final String FORMAT_PROP_POST_DELIM = "postDelim"; //$NON-NLS-1$
-	public static final String FORMAT_PROP_PRE_DELIM = "preDelim"; //$NON-NLS-1$
-	public static final String FORMAT_QUOTE = "quote"; //$NON-NLS-1$
-	public static final String FORMAT_QUOTE_IN_URI = "quoteInURI"; //$NON-NLS-1$
-	public static final String WRAPPING_NEWLINE_ON_OPEN_BRACE = "newLineOnOpenBrace"; //$NON-NLS-1$
-	public static final String WRAPPING_ONE_PER_LINE = "onePropertyPerLine"; //$NON-NLS-1$
-	public static final String WRAPPING_PROHIBIT_WRAP_ON_ATTR = "prohibitWrapOnAttr"; //$NON-NLS-1$
-
-	// CSS cleanup preference names
-	public static final String CLEANUP_CASE_IDENTIFIER = "cleanupIdentifierCase"; //$NON-NLS-1$
-	public static final String CLEANUP_CASE_PROPERTY_NAME = "cleanupPropNameCase"; //$NON-NLS-1$
-	public static final String CLEANUP_CASE_PROPERTY_VALUE = "cleanupPropValueCase"; //$NON-NLS-1$
-	public static final String CLEANUP_CASE_SELECTOR = "cleanupSelectorCase"; //$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 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 cleanup processor should format source.
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public static final String FORMAT_SOURCE = "formatSource";//$NON-NLS-1$
-
-	/**
-	 * Possible value for the case preferences Indicates to leave case as is.
-	 * 
-	 * @see #LOWER
-	 * @see #UPPER
-	 */
-	public static final int ASIS = 0;
-
-	/**
-	 * Possible value for the case preferences Indicates to make name
-	 * lowercase.
-	 * 
-	 * @see #ASIS
-	 * @see #UPPER
-	 */
-	public static final int LOWER = 1;
-
-	/**
-	 * Possible value for the case preferences Indicates to make name
-	 * uppercase.
-	 * 
-	 * @see #LOWER
-	 * @see #ASIS
-	 */
-	public static final int UPPER = 2;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/ICSSModelAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/ICSSModelAdapter.java
deleted file mode 100644
index b28ae0d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/ICSSModelAdapter.java
+++ /dev/null
@@ -1,24 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.adapters;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-
-
-/**
- */
-public interface ICSSModelAdapter extends INodeAdapter {
-
-	ICSSModel getModel();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IModelProvideAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IModelProvideAdapter.java
deleted file mode 100644
index d22ac37..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IModelProvideAdapter.java
+++ /dev/null
@@ -1,35 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.adapters;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-/**
- * 
- */
-public interface IModelProvideAdapter extends INodeAdapter {
-
-	/**
-	 * 
-	 */
-	void modelProvided(IStructuredModel newModel);
-
-	/**
-	 */
-	void modelReleased(IStructuredModel newModel);
-
-	/**
-	 */
-	void modelRemoved(IStructuredModel newModel);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleDeclarationAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleDeclarationAdapter.java
deleted file mode 100644
index 897f1b7..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleDeclarationAdapter.java
+++ /dev/null
@@ -1,25 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.adapters;
-
-
-
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-
-/**
- */
-public interface IStyleDeclarationAdapter extends ICSSModelAdapter {
-
-	/**
-	 */
-	public CSSStyleDeclaration getStyle();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSelectorAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSelectorAdapter.java
deleted file mode 100644
index e678359..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSelectorAdapter.java
+++ /dev/null
@@ -1,33 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.adapters;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.w3c.dom.Element;
-
-
-/**
- * 
- */
-public interface IStyleSelectorAdapter extends INodeAdapter {
-
-	/**
-	 * @return boolean
-	 * @param element
-	 *            org.w3c.dom.Element
-	 * @param pseudoName
-	 *            java.lang.String
-	 */
-	boolean match(ICSSSimpleSelector selector, Element element, String pseudoName);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetAdapter.java
deleted file mode 100644
index a4e8251..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetAdapter.java
+++ /dev/null
@@ -1,41 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.adapters;
-
-
-
-import org.w3c.dom.Element;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-/**
- */
-public interface IStyleSheetAdapter extends ICSSModelAdapter {
-
-	/**
-	 * Returns HTML/XML element that is the owner of this adapter
-	 */
-	Element getElement();
-
-	/**
-	 * Returns CSS document that is related to this element
-	 */
-	public StyleSheet getSheet();
-
-	/**
-	 * This is called at the time of releasing HTML/XML model
-	 */
-	public void released();
-
-	/**
-	 * This is called at the time of removing this Element from the document
-	 */
-	public void removed();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetListAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetListAdapter.java
deleted file mode 100644
index 8027744..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetListAdapter.java
+++ /dev/null
@@ -1,41 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.adapters;
-
-
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- */
-public interface IStyleSheetListAdapter extends INodeAdapter {
-
-	/**
-	 */
-	Enumeration getClasses();
-
-	/**
-	 */
-	public CSSStyleDeclaration getOverrideStyle(Element element, String pseudoName);
-
-	/**
-	 */
-	public StyleSheetList getStyleSheets();
-
-	/**
-	 */
-	public void releaseStyleSheets();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/contenttype/ContentTypeIdForCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/contenttype/ContentTypeIdForCSS.java
deleted file mode 100644
index 79622cf..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/contenttype/ContentTypeIdForCSS.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.eclipse.wst.css.core.internal.provisional.contenttype;
-
-
-/**
- * This class, with its one 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.
- */
-
-public class ContentTypeIdForCSS {
-	/**
-	 * 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_CSS = getConstantString();
-
-	/**
-	 * Don't allow instantiation.
-	 */
-	private ContentTypeIdForCSS() {
-		super();
-	}
-	
-	static String getConstantString() {
-		return "org.eclipse.wst.css.core.csssource"; //$NON-NLS-1$
-	}
-	
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAccess.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAccess.java
deleted file mode 100644
index 6d84c33..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAccess.java
+++ /dev/null
@@ -1,26 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import java.util.Vector;
-
-/**
- * 
- */
-public interface ICSSAccess {
-
-	/**
-	 * @return java.util.Vector
-	 */
-	Vector getClassNames();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAttr.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAttr.java
deleted file mode 100644
index 611e4c1..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAttr.java
+++ /dev/null
@@ -1,40 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-/**
- * 
- */
-public interface ICSSAttr extends ICSSNode {
-
-	/**
-	 * @return java.lang.String
-	 */
-	String getName();
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 */
-	ICSSNode getOwnerCSSNode();
-
-	/**
-	 * @return java.lang.String
-	 */
-	String getValue();
-
-	/**
-	 * @param newValue
-	 *            java.lang.String
-	 */
-	void setValue(String newValue);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSCharsetRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSCharsetRule.java
deleted file mode 100644
index 8687ebf..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSCharsetRule.java
+++ /dev/null
@@ -1,23 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSCharsetRule;
-
-/**
- * 
- */
-public interface ICSSCharsetRule extends ICSSNode, CSSCharsetRule {
-
-	java.lang.String ENCODING = "encoding"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSDocument.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSDocument.java
deleted file mode 100644
index 74562b2..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSDocument.java
+++ /dev/null
@@ -1,94 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSUnknownRule;
-import org.w3c.dom.stylesheets.MediaList;
-
-/**
- * 
- */
-public interface ICSSDocument extends ICSSNode {
-
-	/**
-	 * @return org.w3c.dom.css.CSSCharsetRule
-	 */
-	ICSSCharsetRule createCSSCharsetRule();
-
-	/**
-	 * @return org.w3c.dom.css.CSSFontFaceRule
-	 */
-	CSSFontFaceRule createCSSFontFaceRule();
-
-	/**
-	 * @return org.w3c.dom.css.CSSImportRule
-	 */
-	ICSSImportRule createCSSImportRule();
-
-	/**
-	 * @return org.w3c.dom.css.ICSSMediaRule
-	 */
-	ICSSMediaRule createCSSMediaRule();
-
-	/**
-	 * @return org.w3c.dom.css.CSSPageRule
-	 */
-	ICSSPageRule createCSSPageRule();
-
-	/**
-	 * @return org.w3c.dom.css.CSSPrimitiveValue
-	 */
-	ICSSPrimitiveValue createCSSPrimitiveValue(short primitiveType);
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param rule
-	 *            java.lang.String
-	 */
-	CSSRule createCSSRule(String rule);
-
-	/**
-	 * @return org.w3c.dom.css.CSSStyleDeclaration
-	 */
-	ICSSStyleDeclaration createCSSStyleDeclaration();
-
-	/**
-	 * @param propertyName
-	 *            java.lang.String
-	 */
-	ICSSStyleDeclItem createCSSStyleDeclItem(String propertyName);
-
-	/**
-	 * @return org.w3c.dom.css.CSSStyleRule
-	 */
-	ICSSStyleRule createCSSStyleRule();
-
-	/**
-	 * @return org.w3c.dom.css.CSSUnknownRule
-	 */
-	CSSUnknownRule createCSSUnknownRule();
-
-	/**
-	 * @return org.w3c.dom.stylesheets.MediaList
-	 */
-	MediaList createMediaList();
-
-	ICSSModel getModel();
-
-	/**
-	 * @return boolean
-	 */
-	boolean isDocument();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSImportRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSImportRule.java
deleted file mode 100644
index a514aa6..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSImportRule.java
+++ /dev/null
@@ -1,34 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSImportRule;
-
-/**
- * 
- */
-public interface ICSSImportRule extends ICSSNode, CSSImportRule {
-
-	java.lang.String HREF = "href"; //$NON-NLS-1$
-
-	/**
-	 * 
-	 */
-	void refreshStyleSheet();
-
-	/**
-	 * @param href
-	 *            java.lang.String
-	 */
-	void setHref(String href);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSMediaRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSMediaRule.java
deleted file mode 100644
index aef95a1..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSMediaRule.java
+++ /dev/null
@@ -1,22 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSMediaRule;
-
-/**
- * 
- */
-public interface ICSSMediaRule extends ICSSNode, ICSSRuleContainer, CSSMediaRule {
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSModel.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSModel.java
deleted file mode 100644
index dd57cfb..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSModel.java
+++ /dev/null
@@ -1,46 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.eclipse.wst.css.core.internal.event.ICSSStyleNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.w3c.dom.Node;
-
-
-/**
- * 
- */
-public interface ICSSModel extends ICSSStyleNotifier, IStructuredModel {
-
-	public static final String EXTERNAL = "externalCSS"; //$NON-NLS-1$
-	public static final String EMBEDDED = "embeddedCSS"; //$NON-NLS-1$
-	public static final String INLINE = "inlineCSS"; //$NON-NLS-1$
-
-	ICSSDocument getDocument();
-
-	/**
-	 * @return org.w3c.dom.Node
-	 */
-	Node getOwnerDOMNode();
-
-	/**
-	 * 
-	 * @return java.lang.Object
-	 */
-	Object getStyleSheetType();
-
-	/**
-	 * cleanup -> rebuild CSS Nodes This is pre-beta fix for 178176.
-	 */
-	void refreshNodes();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNamedNodeMap.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNamedNodeMap.java
deleted file mode 100644
index 86c136a..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNamedNodeMap.java
+++ /dev/null
@@ -1,26 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-/**
- * 
- */
-public interface ICSSNamedNodeMap extends ICSSNodeList {
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
-	 * @param name
-	 *            java.lang.String
-	 */
-	ICSSNode getNamedItem(String name);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNode.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNode.java
deleted file mode 100644
index d2691bd..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNode.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-/**
- * 
- */
-public interface ICSSNode {
-
-	short ATTR_NODE = -1;
-	short UNKNOWNRULE_NODE = 0;
-	short STYLERULE_NODE = 1;
-	short CHARSETRULE_NODE = 2;
-	short IMPORTRULE_NODE = 3;
-	short MEDIARULE_NODE = 4;
-	short FONTFACERULE_NODE = 5;
-	short PAGERULE_NODE = 6;
-	short STYLESHEET_NODE = 7;
-	short STYLEDECLARATION_NODE = 8;
-	short STYLEDECLITEM_NODE = 9;
-	short VALUELIST_NODE = 10;
-	short PRIMITIVEVALUE_NODE = 11;
-	short MEDIALIST_NODE = 12;
-	short DOCUMENTCSSSTYLE_NODE = 13;
-	short LINKSTYLE_NODE = 14;
-	short ELEMENTCSSINLINESTYLE_NODE = 15;
-
-	ICSSNode cloneNode(boolean deep);
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.interfaces.ICSSNamedNodeMap
-	 */
-	ICSSNamedNodeMap getAttributes();
-
-	ICSSNodeList getChildNodes();
-
-	ICSSNode getFirstChild();
-
-	ICSSNode getLastChild();
-
-	ICSSNode getNextSibling();
-
-	/**
-	 * @return short
-	 */
-	short getNodeType();
-
-	ICSSDocument getOwnerDocument();
-
-	ICSSNode getParentNode();
-
-	ICSSNode getPreviousSibling();
-
-	/**
-	 * @return boolean
-	 */
-	boolean hasChildNodes();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNodeList.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNodeList.java
deleted file mode 100644
index 8c4323d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNodeList.java
+++ /dev/null
@@ -1,26 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-/**
- * 
- */
-public interface ICSSNodeList {
-
-	/**
-	 * @return int
-	 */
-	int getLength();
-
-	ICSSNode item(int index);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPageRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPageRule.java
deleted file mode 100644
index cd26879..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPageRule.java
+++ /dev/null
@@ -1,22 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSPageRule;
-
-public interface ICSSPageRule extends ICSSNode, CSSPageRule {
-
-	java.lang.String SELECTOR = "selector"; //$NON-NLS-1$
-
-	ICSSSelectorList getSelectors();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPrimitiveValue.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPrimitiveValue.java
deleted file mode 100644
index f6a0eba..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPrimitiveValue.java
+++ /dev/null
@@ -1,46 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-/**
- * 
- */
-public interface ICSSPrimitiveValue extends ICSSNode, ICSSValue, CSSPrimitiveValue {
-
-	short CSS_INTEGER = 26;
-	short CSS_HASH = 27;
-	short CSS_URANGE = 28;
-	short CSS_FORMAT = 29;
-	short CSS_LOCAL = 30;
-	short CSS_SLASH = 31;
-	short CSS_COMMA = 32;
-	short CSS_INHERIT_PRIMITIVE = 33;
-
-	/**
-	 * @param floatValue
-	 *            float
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	void setValue(float floatValue) throws org.w3c.dom.DOMException;
-
-	/**
-	 * @param stringValue
-	 *            java.lang.String
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	void setValue(String stringValue) throws org.w3c.dom.DOMException;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSRuleContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSRuleContainer.java
deleted file mode 100644
index ddbe1db..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSRuleContainer.java
+++ /dev/null
@@ -1,60 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSRule;
-
-/**
- * 
- */
-public interface ICSSRuleContainer {
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param rule
-	 *            org.w3c.dom.css.CSSRule
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	CSSRule appendRule(CSSRule rule) throws org.w3c.dom.DOMException;
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param newRule
-	 *            org.w3c.dom.css.CSSRule
-	 * @param refRule
-	 *            org.w3c.dom.css.CSSRule
-	 */
-	CSSRule insertRuleBefore(CSSRule newRule, CSSRule refRule) throws DOMException;
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param rule
-	 *            org.w3c.dom.css.CSSRule
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	CSSRule removeRule(CSSRule rule) throws org.w3c.dom.DOMException;
-
-	/**
-	 * @return org.w3c.dom.css.CSSRule
-	 * @param newChild
-	 *            org.w3c.dom.css.CSSRule
-	 * @param oldChild
-	 *            org.w3c.dom.css.CSSRule
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	CSSRule replaceRule(CSSRule newRule, CSSRule oldRule) throws org.w3c.dom.DOMException;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelector.java
deleted file mode 100644
index 84e7bea..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelector.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import java.util.Iterator;
-
-import org.w3c.dom.Element;
-
-/**
- * 
- */
-public interface ICSSSelector {
-
-	ICSSSelectorItem getItem(int index);
-
-	/**
-	 * @return java.util.Iterator
-	 */
-	Iterator getIterator();
-
-	/**
-	 * @return int
-	 */
-	int getLength();
-
-	/**
-	 * @return int
-	 */
-	int getSpecificity();
-
-	/**
-	 * @return java.lang.String
-	 */
-	String getString();
-
-	/**
-	 * @return boolean
-	 * @param element
-	 *            org.w3c.dom.Element
-	 */
-	boolean match(Element element, String pseudoName);
-
-	/**
-	 * 
-	 */
-	Iterator getErrors();
-
-	/**
-	 * 
-	 */
-	int getErrorCount();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorCombinator.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorCombinator.java
deleted file mode 100644
index f0e25a5..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorCombinator.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-/**
- * 
- */
-public interface ICSSSelectorCombinator extends ICSSSelectorItem {
-
-	public static final char DESCENDANT = ' ';
-	public static final char CHILD = '>';
-	public static final char ADJACENT = '+';
-	public static final char UNKNOWN = '?'; // error case
-
-	/**
-	 * @return int
-	 */
-	char getCombinatorType();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorItem.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorItem.java
deleted file mode 100644
index 2e3585b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorItem.java
+++ /dev/null
@@ -1,32 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-/**
- * 
- */
-public interface ICSSSelectorItem {
-
-	public static final int SIMPLE = 1;
-	public static final int COMBINATOR = 2;
-
-	/**
-	 * @return int
-	 */
-	int getItemType();
-
-	/**
-	 * @return java.lang.String
-	 */
-	String getString();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorList.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorList.java
deleted file mode 100644
index 1514ce8..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorList.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import java.util.Iterator;
-
-import org.w3c.dom.Element;
-
-/**
- * 
- */
-public interface ICSSSelectorList {
-
-	/**
-	 * @return java.util.Iterator
-	 */
-	Iterator getIterator();
-
-	/**
-	 * @return int
-	 */
-	int getLength();
-
-	/**
-	 * @return java.util.Vector
-	 * @param index
-	 *            int
-	 */
-	ICSSSelector getSelector(int index);
-
-	/**
-	 * @return java.lang.String
-	 */
-	String getString();
-
-	/**
-	 * 
-	 */
-	int getErrorCount();
-
-	/**
-	 * 
-	 */
-	Iterator getErrors();
-
-	/**
-	 * @return boolean
-	 * @param element
-	 *            org.w3c.dom.Element
-	 */
-	boolean match(Element element, String pseudoName);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSimpleSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSimpleSelector.java
deleted file mode 100644
index 74e779d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSimpleSelector.java
+++ /dev/null
@@ -1,77 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-/**
- * 
- */
-public interface ICSSSimpleSelector extends ICSSSelectorItem {
-
-	/**
-	 * @return java.lang.String
-	 * @param index
-	 *            int
-	 */
-	String getAttribute(int index);
-
-	/**
-	 * @return java.lang.String
-	 * @param index
-	 *            int
-	 */
-	String getClass(int index);
-
-	/**
-	 * @return java.lang.String
-	 * @param index
-	 *            int
-	 */
-	String getID(int index);
-
-	/**
-	 * @return java.lang.String
-	 */
-	String getName();
-
-	/**
-	 * @return boolean
-	 */
-	int getNumOfAttributes();
-
-	/**
-	 * @return boolean
-	 */
-	int getNumOfClasses();
-
-	/**
-	 * @return boolean
-	 */
-	int getNumOfIDs();
-
-	/**
-	 * @return boolean
-	 */
-	int getNumOfPseudoNames();
-
-	/**
-	 * @return java.lang.String
-	 * @param index
-	 *            int
-	 */
-	String getPseudoName(int index);
-
-	/**
-	 * @return boolean
-	 */
-	boolean isUniversal();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclItem.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclItem.java
deleted file mode 100644
index 5b170c4..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclItem.java
+++ /dev/null
@@ -1,73 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSValue;
-
-/**
- * 
- */
-public interface ICSSStyleDeclItem extends ICSSNode, ICSSValueList {
-
-	java.lang.String IMPORTANT = "important"; //$NON-NLS-1$
-
-	/**
-	 * @return org.w3c.dom.css.CSSPrimitiveValue
-	 * @param value
-	 *            org.w3c.dom.css.CSSPrimitiveValue
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	ICSSPrimitiveValue appendValue(ICSSPrimitiveValue value) throws org.w3c.dom.DOMException;
-
-	/**
-	 * @return org.w3c.dom.css.CSSValue
-	 */
-	CSSValue getCSSValue();
-
-	/**
-	 * @return java.lang.String
-	 */
-	String getPriority();
-
-	/**
-	 * @return java.lang.String
-	 */
-	String getPropertyName();
-
-	/**
-	 * @return org.w3c.dom.css.CSSPrimitiveValue
-	 * @param value
-	 *            org.w3c.dom.css.CSSPrimitiveValue
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	ICSSPrimitiveValue removeValue(ICSSPrimitiveValue value) throws org.w3c.dom.DOMException;
-
-	/**
-	 * @return org.w3c.dom.css.CSSPrimitiveValue
-	 * @param newValue
-	 *            org.w3c.dom.css.CSSPrimitiveValue
-	 * @param oldValue
-	 *            org.w3c.dom.css.CSSPrimitiveValue
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	ICSSPrimitiveValue replaceValue(ICSSPrimitiveValue newValue, ICSSPrimitiveValue oldValue) throws org.w3c.dom.DOMException;
-
-	/**
-	 * @param priority
-	 *            java.lang.String
-	 */
-	void setPriority(String priority);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclaration.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclaration.java
deleted file mode 100644
index f0987f3..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclaration.java
+++ /dev/null
@@ -1,24 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-public interface ICSSStyleDeclaration extends ICSSDocument, CSSStyleDeclaration {
-
-	ICSSStyleDeclItem getDeclItemNode(String propertyName);
-
-	ICSSStyleDeclItem removeDeclItemNode(ICSSStyleDeclItem oldDecl) throws org.w3c.dom.DOMException;
-
-	ICSSStyleDeclItem setDeclItemNode(ICSSStyleDeclItem newDecl) throws org.w3c.dom.DOMException;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleRule.java
deleted file mode 100644
index 8d44167..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleRule.java
+++ /dev/null
@@ -1,22 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSStyleRule;
-
-public interface ICSSStyleRule extends ICSSNode, CSSStyleRule {
-
-	java.lang.String SELECTOR = "selector"; //$NON-NLS-1$
-
-	ICSSSelectorList getSelectors();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleSheet.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleSheet.java
deleted file mode 100644
index 3686d8b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleSheet.java
+++ /dev/null
@@ -1,47 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- * 
- */
-public interface ICSSStyleSheet extends ICSSDocument, ICSSRuleContainer, CSSStyleSheet {
-
-	/**
-	 * @return org.w3c.dom.NodeList
-	 */
-	NodeList getOwnerNodes();
-
-	/**
-	 * @return org.w3c.dom.NodeList
-	 * @param doc
-	 *            org.w3c.dom.Document
-	 */
-	NodeList getOwnerNodes(Document doc);
-
-	/**
-	 * @return org.w3c.dom.css.CSSRuleList
-	 */
-	CSSRuleList getOwnerRules();
-
-	/**
-	 * @return org.w3c.dom.stylesheets.StyleSheetList
-	 */
-	StyleSheetList getParentStyleSheets();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValue.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValue.java
deleted file mode 100644
index f73231d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValue.java
+++ /dev/null
@@ -1,26 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSValue;
-
-/**
- * 
- */
-public interface ICSSValue extends CSSValue {
-
-	/**
-	 * @return java.lang.String
-	 */
-	String getCSSValueText();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValueList.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValueList.java
deleted file mode 100644
index 546e452..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValueList.java
+++ /dev/null
@@ -1,35 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSValueList;
-
-/**
- * 
- */
-public interface ICSSValueList extends ICSSValue, CSSValueList {
-
-	/**
-	 * @return org.w3c.dom.css.CSSPrimitiveValue
-	 * @param value
-	 *            org.w3c.dom.css.CSSPrimitiveValue
-	 */
-	ICSSPrimitiveValue appendValue(ICSSPrimitiveValue value);
-
-	/**
-	 * @return org.w3c.dom.css.CSSPrimitiveValue
-	 * @param value
-	 *            org.w3c.dom.css.CSSPrimitiveValue
-	 */
-	ICSSPrimitiveValue removeValue(ICSSPrimitiveValue value);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICounter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICounter.java
deleted file mode 100644
index 4eea179..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICounter.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.Counter;
-
-/**
- * 
- */
-public interface ICounter extends ICSSNode, Counter {
-
-	java.lang.String IDENTIFIER = "identifier"; //$NON-NLS-1$
-	java.lang.String LISTSTYLE = "liststyle"; //$NON-NLS-1$
-	java.lang.String SEPARATOR = "separator"; //$NON-NLS-1$
-
-	/**
-	 * @param identifier
-	 *            java.lang.String
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	void setIdentifier(String identifier) throws org.w3c.dom.DOMException;
-
-	/**
-	 * @param listStyle
-	 *            java.lang.String
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	void setListStyle(String listStyle) throws org.w3c.dom.DOMException;
-
-	/**
-	 * @param Separator
-	 *            java.lang.String
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	void setSeparator(String separator) throws org.w3c.dom.DOMException;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDOMImplementationCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDOMImplementationCSS.java
deleted file mode 100644
index 828891f..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDOMImplementationCSS.java
+++ /dev/null
@@ -1,23 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.DOMImplementationCSS;
-
-/**
- * 
- */
-public interface IDOMImplementationCSS extends DOMImplementationCSS {
-
-	ICSSStyleDeclaration createCSSStyleDeclaration() throws org.w3c.dom.DOMException;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDocumentStyle.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDocumentStyle.java
deleted file mode 100644
index 03dbeda..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDocumentStyle.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.stylesheets.DocumentStyle;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-/**
- * 
- */
-public interface IDocumentStyle extends DocumentStyle {
-
-	/**
-	 * @return org.w3c.dom.stylesheets.StyleSheet
-	 * @param newSheet
-	 *            org.w3c.dom.stylesheets.StyleSheet
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	StyleSheet appendSheet(StyleSheet newSheet) throws org.w3c.dom.DOMException;
-
-	/**
-	 * @return org.w3c.dom.stylesheets.StyleSheet
-	 * @param newSheet
-	 *            org.w3c.dom.stylesheets.StyleSheet
-	 * @param refSheet
-	 *            org.w3c.dom.stylesheets.StyleSheet
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	StyleSheet insertSheetBefore(StyleSheet newSheet, StyleSheet refSheet) throws org.w3c.dom.DOMException;
-
-	/**
-	 * @return org.w3c.dom.stylesheets.StyleSheet
-	 * @param oldSheet
-	 *            org.w3c.dom.stylesheets.StyleSheet
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	StyleSheet removeSheet(StyleSheet oldSheet) throws org.w3c.dom.DOMException;
-
-	/**
-	 * @return org.w3c.dom.stylesheets.StyleSheet
-	 * @param newSheet
-	 *            org.w3c.dom.stylesheets.StyleSheet
-	 * @param oldSheet
-	 *            org.w3c.dom.stylesheets.StyleSheet
-	 * @exception org.w3c.dom.DOMException
-	 *                The exception description.
-	 */
-	StyleSheet replaceSheet(StyleSheet newSheet, StyleSheet oldSheet) throws org.w3c.dom.DOMException;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/preferences/CSSPreferenceHelper.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/preferences/CSSPreferenceHelper.java
deleted file mode 100644
index cd9006c..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/preferences/CSSPreferenceHelper.java
+++ /dev/null
@@ -1,229 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.provisional.preferences;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-
-/**
- * @deprecated just access preferences directly
- */
-public class CSSPreferenceHelper {
-
-	/**
-	 * 
-	 */
-	public synchronized static CSSPreferenceHelper getInstance() {
-		if (fInstance == null) {
-			fInstance = new CSSPreferenceHelper();
-		}
-		return fInstance;
-	}
-
-	/**
-	 * 
-	 */
-	public String getBetweenValueString() {
-		return getPreferences().getString(CSSCorePreferenceNames.FORMAT_BETWEEN_VALUE);
-	}
-
-	/**
-	 * 
-	 */
-	public String getIndentString() {
-		StringBuffer indent = new StringBuffer();
-		
-		Preferences preferences = getPreferences();
-		if (preferences != null) {
-			char indentChar = ' ';
-			String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
-			if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
-				indentChar = '\t';
-			}
-			int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
-	
-			for (int i = 0; i < indentationWidth; i++) {
-				indent.append(indentChar);
-			}
-		}
-		return indent.toString();
-	}
-
-	/**
-	 * 
-	 */
-	public int getMaxLineWidth() {
-		Preferences prefs = getPreferences();
-		return prefs.getInt(CSSCorePreferenceNames.LINE_WIDTH);
-	}
-
-	/**
-	 * 
-	 */
-	public String getQuoteString(ICSSModel model) {
-		// nakamori_TODO css pref transition
-		return getPreferences().getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-	}
-
-	/**
-	 * 
-	 */
-	public int getSpacesPostDelimiter() {
-		return getPreferences().getInt(CSSCorePreferenceNames.FORMAT_PROP_POST_DELIM);
-	}
-
-	/**
-	 * 
-	 */
-	public int getSpacesPreDelimiter() {
-		return getPreferences().getInt(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM);
-	}
-
-	/**
-	 * 
-	 */
-	public boolean isIdentUpperCase() {
-		if (getPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
-			return true;
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	public boolean isNewLineOnOpenBrace() {
-		return getPreferences().getBoolean(CSSCorePreferenceNames.WRAPPING_NEWLINE_ON_OPEN_BRACE);
-	}
-
-	/**
-	 * 
-	 */
-	public boolean isOnePropertyPerLine() {
-		return getPreferences().getBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE);
-	}
-
-	/**
-	 * 
-	 */
-	public boolean isProhibitWrapOnAttr() {
-		return getPreferences().getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR);
-	}
-
-	/**
-	 * 
-	 */
-	public boolean isPropNameUpperCase() {
-		if (getPreferences().getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER)
-			return true;
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	public boolean isPropValueUpperCase() {
-		if (getPreferences().getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
-			return true;
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	public boolean isQuoteInURI() {
-		return getPreferences().getBoolean(CSSCorePreferenceNames.FORMAT_QUOTE_IN_URI);
-	}
-
-	/**
-	 * 
-	 */
-	protected void setBetweenValueString(String newBetweenValueString) {
-		getPreferences().setValue(CSSCorePreferenceNames.FORMAT_BETWEEN_VALUE, newBetweenValueString);
-	}
-
-	/**
-	 * 
-	 */
-	protected void setIdentUpperCase(boolean newIdentUpperCase) {
-		int theCase = CSSCorePreferenceNames.LOWER;
-		if (newIdentUpperCase)
-			theCase = CSSCorePreferenceNames.UPPER;
-		getPreferences().setValue(CSSCorePreferenceNames.CASE_IDENTIFIER, theCase);
-	}
-
-	/**
-	 * 
-	 */
-	protected void setOnePropertyPerLine(boolean newOnePropertyPerLine) {
-		getPreferences().setValue(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE, newOnePropertyPerLine);
-	}
-
-	/**
-	 * 
-	 */
-	protected void setProhibitWrapOnAttr(boolean newProhibitWrapOnAttr) {
-		getPreferences().setValue(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR, newProhibitWrapOnAttr);
-	}
-
-	/**
-	 * 
-	 */
-	protected void setPropNameUpperCase(boolean newPropNameUpperCase) {
-		int theCase = CSSCorePreferenceNames.LOWER;
-		if (newPropNameUpperCase)
-			theCase = CSSCorePreferenceNames.UPPER;
-		getPreferences().setValue(CSSCorePreferenceNames.CASE_PROPERTY_NAME, theCase);
-	}
-
-	/**
-	 * 
-	 */
-	protected void setPropValueUpperCase(boolean newPropValueUpperCase) {
-		int theCase = CSSCorePreferenceNames.LOWER;
-		if (newPropValueUpperCase)
-			theCase = CSSCorePreferenceNames.UPPER;
-		getPreferences().setValue(CSSCorePreferenceNames.CASE_PROPERTY_VALUE, theCase);
-	}
-
-	/**
-	 * 
-	 */
-	public void setQuoteString(String quote) {
-		getPreferences().setValue(CSSCorePreferenceNames.FORMAT_QUOTE, quote);
-	}
-
-	/**
-	 * 
-	 */
-	public void setSpacesPostDelimiter(int num) {
-		getPreferences().setValue(CSSCorePreferenceNames.FORMAT_PROP_POST_DELIM, num);
-	}
-
-	/**
-	 * 
-	 */
-	public void setSpacesPreDelimiter(int num) {
-		getPreferences().setValue(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM, num);
-	}
-
-	private Preferences getPreferences() {
-		CSSCorePlugin cssModelPlugin = CSSCorePlugin.getDefault();
-		return cssModelPlugin.getPluginPreferences();
-	}
-
-	private CSSPreferenceHelper() {
-		super();
-	}
-
-	private static CSSPreferenceHelper fInstance = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/text/ICSSPartitionTypes.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/text/ICSSPartitionTypes.java
deleted file mode 100644
index 3b8a4fa..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/text/ICSSPartitionTypes.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.eclipse.wst.css.core.internal.provisional.text;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
-
-/**
- * This interface is not intended to be implemented. It defines the
- * partitioning for CSS and all its partitions. Clients should reference the
- * partition type Strings defined here directly.
- * 
- * @plannedfor 1.0
- */
-public interface ICSSPartitionTypes extends IStructuredPartitionTypes {
-
-	String STYLE = "org.eclipse.wst.css.STYLE"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/tasks/CSSFileTaskScanner.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/tasks/CSSFileTaskScanner.java
deleted file mode 100644
index c515ff0..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/tasks/CSSFileTaskScanner.java
+++ /dev/null
@@ -1,36 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.tasks;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-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;
-
-public class CSSFileTaskScanner extends StructuredFileTaskScanner {
-	public CSSFileTaskScanner() {
-		super();
-	}
-
-	protected String getCommentedText(IDocument document, int begin, int length) throws BadLocationException {
-		String text = super.getCommentedText(document, begin, length);
-		if (text != null && text.endsWith("*/")) { //$NON-NLS-1$
-			text = text.substring(0, text.length() - 2);
-		}
-		return text;
-	}
-
-	protected boolean isCommentRegion(IStructuredDocumentRegion region, ITextRegion textRegion) {
-		return textRegion.getType().equals(CSSRegionContexts.CSS_COMMENT);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentReParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentReParser.java
deleted file mode 100644
index 1558f82..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentReParser.java
+++ /dev/null
@@ -1,360 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.text;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.parser.CSSRegionUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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.IStructuredTextReParser;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser;
-
-
-/**
- * This class provides a centralized place to put "reparsing" logic. This is
- * the logic that reparses the text incrementally, as a user types in new
- * characters, or DOM nodes are inserted or deleted. Note: it is not a thread
- * safe class.
- */
-public class CSSStructuredDocumentReParser extends StructuredDocumentReParser {
-
-	class ReparseRange {
-		ReparseRange() {
-			reset();
-		}
-
-		ReparseRange(int start, int end) {
-			fRangeStart = start;
-			fRangeEnd = end;
-		}
-
-		void setStart(int start) {
-			fRangeStart = start;
-		}
-
-		void setEnd(int end) {
-			fRangeEnd = end;
-		}
-
-		int getStart() {
-			return fRangeStart;
-		}
-
-		int getEnd() {
-			return fRangeEnd;
-		}
-
-		boolean isValid() {
-			return (0 < fRangeEnd - fRangeStart) ? true : false;
-		}
-
-		void reset() {
-			fRangeStart = Integer.MAX_VALUE;
-			fRangeEnd = 0;
-		}
-
-		void expand(ReparseRange range) {
-			if (range == null || !range.isValid()) {
-				return;
-			}
-			int start = range.getStart();
-			if (start < fRangeStart) {
-				fRangeStart = start;
-			}
-			int end = range.getEnd();
-			if (fRangeEnd < end) {
-				fRangeEnd = end;
-			}
-		}
-
-		private int fRangeStart;
-		private int fRangeEnd;
-	}
-
-	/**
-	 * 
-	 */
-	public CSSStructuredDocumentReParser() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	// public StructuredDocumentEvent
-	// checkForCrossStructuredDocumentRegionBoundryCases2() {
-	// StructuredDocumentEvent result = specialPositionUpdate(fStart, fStart +
-	// fLengthToReplace - 1);
-	// if (result == null) {
-	// result = checkInsideBrace();
-	// }
-	// return result;
-	// }
-	protected StructuredDocumentEvent checkForCrossStructuredDocumentRegionSyntax() {
-		int checkStart = fStart;
-		int checkEnd = fStart + fLengthToReplace - 1;
-		IStructuredDocumentRegion endRegion = fStructuredDocument.getRegionAtCharacterOffset(checkEnd);
-		if (endRegion != null) {
-			checkEnd = endRegion.getEndOffset();
-		}
-
-		ReparseRange range = new ReparseRange(checkStart, checkEnd);
-
-		range.expand(getUpdateRangeForDelimiter(range.getStart(), range.getEnd()));
-		range.expand(getUpdateRangeForUnknownRegion(range.getStart(), range.getEnd()));
-
-		range.expand(getUpdateRangeForQuotes(range.getStart(), range.getEnd()));
-		range.expand(getUpdateRangeForComments(range.getStart(), range.getEnd()));
-		range.expand(getUpdateRangeForBraces(range.getStart(), range.getEnd()));
-
-		StructuredDocumentEvent result;
-
-		result = checkInsideBrace(range.getStart(), range.getEnd());
-
-		if (result == null) {
-			result = reparse(range.getStart(), range.getEnd());
-		}
-
-		return result;
-	}
-
-	private ReparseRange getUpdateRangeForUnknownRegion(int start, int end) {
-		int newStart = start;
-		RegionIterator iterator = new RegionIterator(fStructuredDocument, start - 1);
-		if (iterator.hasPrev()) {
-			iterator.prev(); // skip myself
-		}
-		while (iterator.hasPrev()) {
-			ITextRegion region = iterator.prev();
-			if (region != null && region.getType() == CSSRegionContexts.CSS_UNKNOWN) {
-				newStart = iterator.getStructuredDocumentRegion().getStartOffset(region);
-			}
-			else {
-				break;
-			}
-		}
-
-		if (start != newStart) {
-			return new ReparseRange(newStart, end);
-		}
-
-		return null;
-	}
-
-	private ReparseRange getUpdateRangeForDelimiter(int start, int end) {
-		if (dirtyStart != null && dirtyStart.getStart() < start) {
-			start = dirtyStart.getStart();
-		}
-		IStructuredDocumentRegion docRegion = fStructuredDocument.getRegionAtCharacterOffset(start);
-		if (docRegion == null) {
-			return null;
-		}
-		if (docRegion.getType() == CSSRegionContexts.CSS_DELIMITER) {
-			IStructuredDocumentRegion prevRegion = docRegion.getPrevious();
-			if (prevRegion != null) {
-				return new ReparseRange(prevRegion.getStart(), end);
-			}
-		}
-
-		return null;
-	}
-
-	private ReparseRange getUpdateRangeForQuotes(int start, int end) {
-		ReparseRange range = new ReparseRange();
-
-		range.expand(getUpdateRangeForPair(start, end, "\"", "\"")); //$NON-NLS-2$//$NON-NLS-1$
-		range.expand(getUpdateRangeForPair(start, end, "\'", "\'")); //$NON-NLS-2$//$NON-NLS-1$
-
-		return (range.isValid()) ? range : null;
-	}
-
-	private ReparseRange getUpdateRangeForComments(int start, int end) {
-		ReparseRange range = new ReparseRange();
-
-		range.expand(getUpdateRangeForPair(start, end, "/*", "*/")); //$NON-NLS-2$//$NON-NLS-1$
-		range.expand(getUpdateRangeForPair(start, end, "<%", "%>")); //$NON-NLS-2$//$NON-NLS-1$
-
-		return (range.isValid()) ? range : null;
-	}
-
-	private ReparseRange getUpdateRangeForBraces(int start, int end) {
-		ReparseRange range = new ReparseRange();
-
-		range.expand(getUpdateRangeForPair(start, end, "[", "]")); //$NON-NLS-2$//$NON-NLS-1$
-		range.expand(getUpdateRangeForPair(start, end, "(", ")")); //$NON-NLS-2$//$NON-NLS-1$
-		range.expand(getUpdateRangeForPair(start, end, "{", "}")); //$NON-NLS-2$//$NON-NLS-1$
-
-		return (range.isValid()) ? range : null;
-	}
-
-	private StructuredDocumentEvent checkInsideBrace(int start, int end) {
-		StructuredDocumentEvent result = null;
-		IStructuredDocumentRegion region = fStructuredDocument.getRegionAtCharacterOffset(start);
-		if (region == null) {
-			return null;
-		}
-		boolean bDeclaration = false;
-		String type = region.getType();
-		if (CSSRegionUtil.isDeclarationType(type) || type == CSSRegionContexts.CSS_LBRACE || type == CSSRegionContexts.CSS_RBRACE) {
-			bDeclaration = true;
-		}
-		if (!bDeclaration) {
-			IStructuredDocumentRegion prevRegion = CSSUtil.findPreviousSignificantNode(region);
-			if (prevRegion != null) {
-				type = prevRegion.getType();
-				if (CSSRegionUtil.isDeclarationType(type) || type == CSSRegionContexts.CSS_LBRACE) {
-					bDeclaration = true;
-				}
-			}
-		}
-		if (!bDeclaration) {
-			IStructuredDocumentRegion nextRegion = CSSUtil.findNextSignificantNode(region);
-			if (nextRegion != null) {
-				type = nextRegion.getType();
-				if (CSSRegionUtil.isDeclarationType(type) || type == CSSRegionContexts.CSS_RBRACE) {
-					bDeclaration = true;
-				}
-			}
-		}
-
-		if (bDeclaration) {
-			IStructuredDocumentRegion startRegion = findRuleStart(region);
-			if (startRegion != null) {
-				IStructuredDocumentRegion endRegion = fStructuredDocument.getRegionAtCharacterOffset(end);
-				if (endRegion != null) {
-					result = reparse(startRegion, endRegion);
-				}
-			}
-		}
-		return result;
-	}
-
-	private IStructuredDocumentRegion findRuleStart(IStructuredDocumentRegion startRegion) {
-		IStructuredDocumentRegion region = startRegion;
-		// find '{'
-		while (region != null && region.getType() != CSSRegionContexts.CSS_LBRACE) {
-			region = region.getPrevious();
-		}
-		// if (region == startRegion) {
-		// return null;
-		// }
-		// else
-		if (region != null) { // '{' is found
-			region = region.getPrevious();
-			if (isLeadingDeclarationType(region.getType())) {
-				return region;
-			}
-		}
-		return null;
-	}
-
-	private boolean isLeadingDeclarationType(String type) {
-		return (type == CSSRegionContexts.CSS_PAGE || type == CSSRegionContexts.CSS_FONT_FACE || CSSRegionUtil.isSelectorType(type));
-	}
-
-	// public StructuredDocumentEvent
-	// checkForCrossStructuredDocumentRegionBoundryCases() {
-	// return specialPositionUpdate(fStart, fStart + fLengthToReplace - 1);
-	// }
-	/**
-	 * 
-	 */
-	private ReparseRange getUpdateRangeForPair(int start, int end, String opener, String closer) {
-		StringBuffer deletionBuf = new StringBuffer();
-		StringBuffer insertionBuf = new StringBuffer();
-		int quoteLen = Math.max(opener.length(), closer.length());
-		if (1 < quoteLen) {
-			/**
-			 * ex) opener = "ABC", closer = "XYZ" model: ABCDEF.......UVWXYZ
-			 * deletion: CDEF.......UVWX pre/post: AB / YZ
-			 */
-			int addStart = start - (quoteLen - 1);
-			if (0 <= addStart) {
-				String addStr = fStructuredDocument.get(addStart, quoteLen - 1);
-				deletionBuf.append(addStr);
-				insertionBuf.append(addStr);
-			}
-			deletionBuf.append(fDeletedText);
-			insertionBuf.append(fChanges);
-			if (end + (quoteLen - 1) < fStructuredDocument.getLength()) {
-				String addStr = fStructuredDocument.get(end + 1, quoteLen - 1);
-				deletionBuf.append(addStr);
-				insertionBuf.append(addStr);
-			}
-		}
-		else {
-			deletionBuf.append(fDeletedText);
-			insertionBuf.append(fChanges);
-		}
-		String deletion = deletionBuf.toString();
-		String insertion = insertionBuf.toString();
-
-		int rangeStart = start;
-		int rangeEnd = end;
-
-		if (0 <= deletion.indexOf(opener) || 0 <= deletion.indexOf(closer) || 0 <= insertion.indexOf(opener) || 0 <= insertion.indexOf(closer)) {
-			int s, e;
-			try {
-				if (start <= fStructuredDocument.getLength()) {
-					IRegion startRegion = getFindReplaceDocumentAdapter().find(start - 1, opener, false, false, false, false);
-					if (startRegion != null) {
-						s = startRegion.getOffset();
-					}
-					else {
-						s = -1;
-					}
-				}
-				else {
-					s = -1;
-				}
-				if (end < fStructuredDocument.getLength() - 1) {
-					IRegion endRegion = getFindReplaceDocumentAdapter().find(end + 1, closer, true, false, false, false);
-					if (endRegion != null) {
-						e = endRegion.getOffset();
-					}
-					else {
-						e = -1;
-					}
-				}
-				else {
-					e = -1;
-				}
-			}
-			catch (BadLocationException ex) {
-				Logger.logException(ex);
-				return null;
-			}
-			if (0 <= s) {
-				rangeStart = Math.min(rangeStart, s);
-			}
-			if (0 <= e) {
-				rangeEnd = Math.max(rangeEnd, e);
-			}
-		}
-
-		if (rangeStart < start || end < rangeEnd) {
-			return new ReparseRange(rangeStart, rangeEnd);
-		}
-		else {
-			return null;
-		}
-	}
-
-	public IStructuredTextReParser newInstance() {
-		return new CSSStructuredDocumentReParser();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentRegionFactory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentRegionFactory.java
deleted file mode 100644
index d574ba4..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentRegionFactory.java
+++ /dev/null
@@ -1,39 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.text;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocumentRegion;
-
-/**
- * 
- */
-public class CSSStructuredDocumentRegionFactory {
-
-	public static final int CSS_GENERIC = 101109;
-
-	/**
-	 * 
-	 */
-	public static IStructuredDocumentRegion createStructuredDocumentRegion(int type) {
-		IStructuredDocumentRegion instance = null;
-		switch (type) {
-			case CSS_GENERIC :
-				instance = new BasicStructuredDocumentRegion();
-				break;
-			default :
-				break;
-		}
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredDocumentWalker.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredDocumentWalker.java
deleted file mode 100644
index 476f73d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredDocumentWalker.java
+++ /dev/null
@@ -1,169 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.text;
-
-
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-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.util.Utilities;
-
-public class StructuredDocumentWalker {
-
-	IStructuredDocumentRegionList fOldStructuredDocumentRegionList = null;
-	IStructuredDocument fStructuredDocument = null;
-	String fOriginalChanges = null;
-	int fOriginalOffset = 0;
-	int fOriginalLengthToReplace = 0;
-	int fLengthDifference = 0;
-
-	/**
-	 * 
-	 */
-	public StructuredDocumentWalker() {
-	}
-
-	/**
-	 * 
-	 */
-	public StructuredDocumentWalker(StructuredDocumentEvent event) {
-		initialize(event);
-	}
-
-	/**
-	 * 
-	 */
-	public IStructuredDocument getStructuredDocument() {
-		return fStructuredDocument;
-	}
-
-	/**
-	 * Old Nodes: --[O1]--[O2]--[O3]--- : / \ Current Nodes:
-	 * ---[C1]-----[C2]-----[C3]-----[C4]---
-	 * 
-	 * Input: O1 -> Output: O2 Input: O2 -> Output: O3 Input: O3 -> Output: C4
-	 * Input: Cn -> Output: Cn+1
-	 */
-	public IStructuredDocumentRegion getNextNode(IStructuredDocumentRegion node) {
-		IStructuredDocumentRegion nextNode = null;
-		if (node != null) {
-			nextNode = node.getNext();
-			if (nextNode == null) {
-				if (isOldNode(node)) {
-					// this may be the end of old flatnodes
-					int newStart = node.getEnd() - fLengthDifference;
-					nextNode = fStructuredDocument.getRegionAtCharacterOffset(newStart);
-				}
-			}
-		}
-		return nextNode;
-	}
-
-	/**
-	 * Old Nodes: --[O1]--[O2]--[O3]--- : / \ Current Nodes:
-	 * ---[C1]-----[C2]-----[C3]-----[C4]---
-	 * 
-	 * Input: O* -> Output: C4 Input: Cn -> Output: Cn+1
-	 */
-	public IStructuredDocumentRegion getNextNodeInCurrent(IStructuredDocumentRegion node) {
-		IStructuredDocumentRegion nextNode = null;
-		if (isOldNode(node)) {
-			IStructuredDocumentRegion oldEndNode = fOldStructuredDocumentRegionList.item(fOldStructuredDocumentRegionList.getLength() - 1);
-			int newStart = oldEndNode.getEnd() - fLengthDifference;
-			nextNode = fStructuredDocument.getRegionAtCharacterOffset(newStart);
-		}
-		else if (node != null) {
-			nextNode = node.getNext();
-		}
-		return nextNode;
-	}
-
-	/**
-	 * Old Nodes: --[O1]--[O2]--[O3]--- : / \ Current Nodes:
-	 * ---[C1]-----[C2]-----[C3]-----[C4]---
-	 * 
-	 * Input: O1 -> Output: C1 Input: O2 -> Output: O1 Input: O3 -> Output: O2
-	 * Input: Cn -> Output: Cn-1
-	 */
-	public IStructuredDocumentRegion getPrevNode(IStructuredDocumentRegion node) {
-		IStructuredDocumentRegion prevNode = null;
-		if (node != null) {
-			prevNode = node.getPrevious();
-			if (prevNode == null) {
-				if (isOldNode(node)) {
-					// this may be the start of old flatnodes
-					int newEnd = node.getStart() - 1;
-					prevNode = fStructuredDocument.getRegionAtCharacterOffset(newEnd);
-				}
-			}
-		}
-		return prevNode;
-	}
-
-	/**
-	 * Old Nodes: --[O1]--[O2]--[O3]--- : / \ Current Nodes:
-	 * ---[C1]-----[C2]-----[C3]-----[C4]---
-	 * 
-	 * Input: O* -> Output: C1 Input: Cn -> Output: Cn-1
-	 */
-	public IStructuredDocumentRegion getPrevNodeInCurrent(IStructuredDocumentRegion node) {
-		IStructuredDocumentRegion prevNode = null;
-		if (isOldNode(node)) {
-			IStructuredDocumentRegion oldStartNode = fOldStructuredDocumentRegionList.item(0);
-			int newEnd = oldStartNode.getStart() - 1;
-			prevNode = fStructuredDocument.getRegionAtCharacterOffset(newEnd);
-		}
-		else if (node != null) {
-			prevNode = node.getPrevious();
-		}
-		return prevNode;
-	}
-
-	/**
-	 * 
-	 */
-	public void initialize(StructuredDocumentEvent event) {
-		fStructuredDocument = event.getStructuredDocument();
-		fOriginalChanges = event.getText();
-		fOriginalOffset = event.getOffset();
-		fOriginalLengthToReplace = event.getLength();
-		fLengthDifference = Utilities.calculateLengthDifference(fOriginalChanges, fOriginalLengthToReplace);
-
-		if (event instanceof StructuredDocumentRegionsReplacedEvent) {
-			fOldStructuredDocumentRegionList = ((StructuredDocumentRegionsReplacedEvent) event).getOldStructuredDocumentRegions();
-		}
-		else {
-			fOldStructuredDocumentRegionList = null;
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public boolean isOldNode(IStructuredDocumentRegion node) {
-		boolean bOld = false;
-		if (fOldStructuredDocumentRegionList != null) {
-			Enumeration e = fOldStructuredDocumentRegionList.elements();
-			while (e.hasMoreElements()) {
-				if (e.nextElement() == node) {
-					bOld = true;
-					break;
-				}
-			}
-		}
-		return bOld;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java
deleted file mode 100644
index 47361db..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java
+++ /dev/null
@@ -1,37 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.text;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.css.core.internal.provisional.text.ICSSPartitionTypes;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
-import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-
-public class StructuredTextPartitionerForCSS extends StructuredTextPartitioner {
-	
-	public final static String[] legalTypes = new String[]{ICSSPartitionTypes.STYLE, IStructuredPartitionTypes.DEFAULT_PARTITION};
-
-	public StructuredTextPartitionerForCSS() {
-		super();
-	}
-
-	public String getDefaultPartitionType() {
-		return ICSSPartitionTypes.STYLE;
-	}
-
-	public String[] getLegalContentTypes() {
-		return legalTypes;
-	}
-
-	public IDocumentPartitioner newInstance() {
-		return new StructuredTextPartitionerForCSS();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/AbstractCssTraverser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/AbstractCssTraverser.java
deleted file mode 100644
index 1e9f9c6..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/AbstractCssTraverser.java
+++ /dev/null
@@ -1,181 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-import java.util.ArrayList;
-import java.util.Stack;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-
-
-
-/**
- * 
- */
-public abstract class AbstractCssTraverser {
-
-	public static short TRAV_CONT = 0;
-	public static short TRAV_PRUNE = 1;
-	public static short TRAV_STOP = 2;
-	protected java.util.Stack travStack;
-	private boolean fTraverseImported = false;
-	private boolean fTraverseImportFirst = false;
-	private java.util.Vector traversedSheets;
-
-	/**
-	 * CssPropCMNode constructor comment.
-	 */
-	public AbstractCssTraverser() {
-		super();
-	}
-
-	/**
-	 * @param model
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSModel
-	 */
-	public final void apply(ICSSModel model) {
-		apply(model.getDocument());
-	}
-
-	public final void apply(ICSSNode root) {
-		travStack = new Stack();
-		if (fTraverseImported) {
-			traversedSheets = new Vector();
-			if (root != null && root.getOwnerDocument() != null && root.getOwnerDocument().getNodeType() == ICSSNode.STYLESHEET_NODE) {
-				traversedSheets.add(root.getOwnerDocument());
-			}
-		}
-
-		// first call begin()
-		begin(root);
-
-		// traverse
-		traverse(root);
-
-		// last call end()
-		end(root);
-	}
-
-
-	protected void begin(ICSSNode node) {
-	}
-
-
-	protected void end(ICSSNode node) {
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public final boolean isTraverseImported() {
-		return fTraverseImported;
-	}
-
-
-	protected short postNode(ICSSNode node) {
-		return (short) 0;
-	}
-
-
-	protected short preNode(ICSSNode node) {
-		return (short) 0;
-	}
-
-	/**
-	 * @param newTraverseImported
-	 *            boolean
-	 */
-	public final void setTraverseImported(boolean newTraverseImported) {
-		fTraverseImported = newTraverseImported;
-	}
-
-	/**
-	 * @param newTraverseImportFirst
-	 *            boolean
-	 */
-	public final void setTraverseImportFirst(boolean newTraverseImportFirst) {
-		fTraverseImportFirst = newTraverseImportFirst;
-	}
-
-
-	private final short traverse(ICSSNode node) {
-		if (node == null)
-			return TRAV_CONT;
-
-		travStack.push(node);
-
-		// pre-action
-		short ret = preNode(node);
-
-		if (ret == TRAV_CONT) {
-			if (fTraverseImported && (node.getNodeType() == ICSSNode.IMPORTRULE_NODE)) {
-				ICSSImportRule rule = (ICSSImportRule) node;
-				// traverse external style-sheet
-				ICSSStyleSheet sheet = (ICSSStyleSheet) rule.getStyleSheet();
-				if (sheet != null && !traversedSheets.contains(sheet)) { // prevent
-																			// loop
-					traversedSheets.add(sheet);
-					short retExt = traverse(sheet);
-					if (retExt == TRAV_STOP) {
-						travStack.pop();
-						return retExt;
-					}
-				}
-			}
-
-			// collect children
-			ArrayList children = new ArrayList();
-			ICSSNode child = node.getFirstChild();
-			if (fTraverseImportFirst) {
-				ArrayList others = new ArrayList();
-
-				while (child != null) {
-					if (child.getNodeType() == ICSSNode.IMPORTRULE_NODE)
-						children.add(child);
-					else
-						others.add(child);
-					child = child.getNextSibling();
-				}
-				children.addAll(others);
-			}
-			else {
-				while (child != null) {
-					children.add(child);
-					child = child.getNextSibling();
-				}
-			}
-
-			// traverse children
-			for (int i = 0; i < children.size(); i++) {
-				child = (ICSSNode) children.get(i);
-				short retChild = traverse(child);
-				if (retChild == TRAV_STOP) {
-					travStack.pop();
-					return retChild;
-				}
-			}
-		}
-		else if (ret == TRAV_STOP) {
-			travStack.pop();
-			return ret;
-		}
-
-		// post-action
-		ret = postNode(node);
-
-		travStack.pop();
-		return (ret == TRAV_PRUNE) ? TRAV_CONT : ret;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSClassTraverser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSClassTraverser.java
deleted file mode 100644
index e7574d6..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSClassTraverser.java
+++ /dev/null
@@ -1,114 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-
-
-/**
- * 
- */
-public class CSSClassTraverser extends AbstractCssTraverser {
-
-	ArrayList fClassNames;
-
-	/**
-	 * 
-	 */
-	public CSSClassTraverser() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	private void addClassNames(ICSSStyleRule rule) {
-		ICSSSelectorList selectorList = rule.getSelectors();
-		Iterator iSelector = selectorList.getIterator();
-		while (iSelector.hasNext()) {
-			ICSSSelector selector = (ICSSSelector) iSelector.next();
-			Iterator iItem = selector.getIterator();
-			while (iItem.hasNext()) {
-				ICSSSelectorItem item = (ICSSSelectorItem) iItem.next();
-				if (item.getItemType() == ICSSSelectorItem.SIMPLE) {
-					ICSSSimpleSelector sel = (ICSSSimpleSelector) item;
-					int nClasses = sel.getNumOfClasses();
-					for (int iClass = 0; iClass < nClasses; iClass++) {
-						String className = sel.getClass(iClass);
-						if (!fClassNames.contains(className))
-							fClassNames.add(className);
-					}
-				}
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void begin(ICSSNode node) {
-		if (fClassNames == null)
-			fClassNames = new ArrayList();
-	}
-
-	/**
-	 * 
-	 */
-	protected void end(ICSSNode node) {
-	}
-
-	/**
-	 * 
-	 */
-	public Collection getClassNames() {
-		return (fClassNames != null) ? fClassNames : Collections.EMPTY_LIST;
-	}
-
-	/**
-	 * 
-	 */
-	protected short postNode(ICSSNode node) {
-		return TRAV_CONT;
-	}
-
-	/**
-	 * 
-	 */
-	protected short preNode(ICSSNode node) {
-		short ret;
-		if (node instanceof ICSSStyleRule) {
-			addClassNames((ICSSStyleRule) node);
-			ret = TRAV_PRUNE;
-		}
-		else if (node instanceof ICSSStyleSheet || node instanceof ICSSMediaRule || node instanceof ICSSImportRule) {
-			ret = TRAV_CONT;
-		}
-		else {
-			ret = TRAV_PRUNE;
-		}
-		return ret;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSLinkConverter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSLinkConverter.java
deleted file mode 100644
index e5d3690..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSLinkConverter.java
+++ /dev/null
@@ -1,188 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- * 
- */
-public class CSSLinkConverter extends org.eclipse.wst.css.core.internal.util.AbstractCssTraverser {
-	private static final String URL_BEGIN = "url("; //$NON-NLS-1$
-	private static final String URL_END = ")"; //$NON-NLS-1$
-	private static final String EMPTY = ""; //$NON-NLS-1$
-	private static final String D_QUOTE = "\""; //$NON-NLS-1$
-	private static final String S_QUOTE = "\'"; //$NON-NLS-1$
-
-	IStructuredModel baseModel;
-
-	/**
-	 * 
-	 */
-	public CSSLinkConverter(IStructuredModel model) {
-		super();
-		baseModel = model;
-		if (model instanceof ICSSModel && ((ICSSModel) model).getStyleSheetType() != ICSSModel.EXTERNAL) {
-			IDOMNode node = (IDOMNode) ((ICSSModel) model).getOwnerDOMNode();
-			baseModel = node.getModel();
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public static String addFunc(String value) {
-		if (!value.trim().toLowerCase().startsWith(URL_BEGIN)) {
-			// pa_TODO css pref
-			Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
-			String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-			value = CSSUtil.stripQuotes(value);
-			quote = CSSUtil.detectQuote(value, quote);
-			String str = URL_BEGIN;
-			if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
-				str = str.toUpperCase();
-			StringBuffer buf = new StringBuffer(str);
-			buf.append(quote);
-			buf.append(value);
-			buf.append(quote);
-			buf.append(URL_END);
-			return buf.toString();
-		}
-		return value;
-	}
-
-
-
-	/**
-	 * 
-	 */
-	protected void begin(ICSSNode node) {
-		if (baseModel == null) {
-			baseModel = node.getOwnerDocument().getModel();
-			if (baseModel instanceof ICSSModel && ((ICSSModel) baseModel).getStyleSheetType() != ICSSModel.EXTERNAL) {
-				IDOMNode xmlNode = (IDOMNode) ((ICSSModel) baseModel).getOwnerDOMNode();
-				baseModel = xmlNode.getModel();
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private static boolean isUrl(String source) {
-		if (source == null)
-			return false;
-		source = source.trim().toLowerCase();
-		return source.startsWith(URL_BEGIN);
-	}
-
-	/**
-	 * 
-	 */
-	protected short preNode(ICSSNode node) {
-		if (node.getNodeType() == ICSSNode.PRIMITIVEVALUE_NODE) {
-			toAbsolute((CSSValue) node);
-		} else if (node.getNodeType() == ICSSNode.IMPORTRULE_NODE) {
-			ICSSImportRule iRule = (ICSSImportRule) node;
-			iRule.setHref(toAbsolute(addFunc(iRule.getHref())));
-		}
-		return TRAV_CONT;
-	}
-
-	/**
-	 * 
-	 * @return java.lang.String
-	 * @param value
-	 *            java.lang.String
-	 */
-	public static String removeFunc(String value) {
-		if (value == null)
-			return EMPTY;
-		String field = value.trim();
-		// first : tear "url(....)"
-		if (field.toLowerCase().startsWith(URL_BEGIN)) {
-			int url = field.toLowerCase().indexOf(URL_BEGIN);
-			int endParenthesis = field.lastIndexOf(URL_END);
-			if (endParenthesis > url) {
-				field = field.substring(url + 4, endParenthesis);
-			} else
-				field = field.substring(url + 4);
-		}
-		return field.trim();
-	}
-
-	/**
-	 * 
-	 */
-	public static String stripFunc(String value) {
-		if (value == null)
-			return EMPTY;
-		// first : tear "url(....)"
-		String field = removeFunc(value);
-		// second : tear quotations
-		if (field.toLowerCase().startsWith(D_QUOTE)) {
-			int quote = field.indexOf(D_QUOTE);
-			int end = field.lastIndexOf(D_QUOTE);
-			if (end > quote) {
-				field = field.substring(quote + 1, end);
-			} else
-				field = field.substring(quote + 1);
-		} else if (field.toLowerCase().startsWith(S_QUOTE)) {
-			int quote = field.indexOf(S_QUOTE);
-			int end = field.lastIndexOf(S_QUOTE);
-			if (end > quote) {
-				field = field.substring(quote + 1, end);
-			} else
-				field = field.substring(quote + 1);
-		}
-
-		return field.trim();
-	}
-
-	/**
-	 * 
-	 */
-	public String toAbsolute(String source) {
-		if (isUrl(source)) {
-			String url = CSSPathService.getAbsoluteURL(baseModel, stripFunc(source));
-			return (url != null) ? addFunc(url) : (URL_BEGIN + URL_END);
-		}
-		return source;
-	}
-
-	/**
-	 * 
-	 */
-	public boolean toAbsolute(CSSValue node) {
-		if (node instanceof ICSSPrimitiveValue) {
-			ICSSPrimitiveValue value = (ICSSPrimitiveValue) node;
-			if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_URI) {
-				value.setValue(stripFunc(toAbsolute(URL_BEGIN + value.getStringValue() + URL_END)));
-				return true;
-			}
-		}
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSPathService.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSPathService.java
deleted file mode 100644
index 9fa8433..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSPathService.java
+++ /dev/null
@@ -1,77 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-
-
-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.wst.sse.core.internal.provisional.IStructuredModel;
-
-/**
- * 
- */
-public class CSSPathService {
-
-	// Constants
-	private static final String FILEURLSCHEME = "file";//$NON-NLS-1$
-	private static final String URLCOLON = ":"; //$NON-NLS-1$
-	private static final String FILEURLPREFIX = FILEURLSCHEME + URLCOLON + "//";//$NON-NLS-1$
-	private static final String URLSEPARATOR = "/"; //$NON-NLS-1$
-
-	/**
-	 * @return java.lang.String
-	 */
-	public static String getAbsoluteURL(IStructuredModel baseModel, String ref) {
-		String absLink = URLModelProviderCSS.resolveURI(baseModel, ref, true);
-		String url = absLink;
-		if (absLink != null) { // if it has not scheme, we must add "file"
-								// scheme
-			try {
-				new java.net.URL(absLink);
-			}
-			catch (java.net.MalformedURLException e) {
-				IPath path = new Path(absLink);
-				if (path != null)
-					url = toURL(path);
-			}
-		}
-		return url;
-	}
-
-	/**
-	 * 
-	 * @return org.eclipse.core.resources.IFile
-	 * @param location
-	 *            java.lang.String
-	 */
-	public static IFile location2File(String location) {
-		Path path = new Path(location);
-		IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
-		if (file == null && path.segmentCount() > 1)
-			file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-		return file;
-	}
-
-	/**
-	 * Gets a file URL for the path.
-	 */
-	private static String toURL(IPath path) {
-		path = new Path(path.toFile().getAbsolutePath());
-		if (path.isUNC() == true) {
-			// it's UNC. return file://host/foo/bar/baz.html
-			return FILEURLSCHEME + URLCOLON + path.toString();
-		}
-		return FILEURLPREFIX + URLSEPARATOR + path.toString();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSSelectorListFactory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSSelectorListFactory.java
deleted file mode 100644
index 04b97e8..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSSelectorListFactory.java
+++ /dev/null
@@ -1,35 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-import org.eclipse.wst.css.core.internal.document.CSSSelectorListImpl;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-
-
-public class CSSSelectorListFactory {
-	static synchronized public CSSSelectorListFactory getInstance() {
-		if (fInstance == null) {
-			fInstance = new CSSSelectorListFactory();
-		}
-		return fInstance;
-	}
-
-	public ICSSSelectorList createSelectorList(String selectorString) {
-		return new CSSSelectorListImpl(selectorString);
-	}
-
-
-	private CSSSelectorListFactory() {
-		super();
-	}
-
-	private static CSSSelectorListFactory fInstance;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSStyleDeclarationFactory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSStyleDeclarationFactory.java
deleted file mode 100644
index 285ace3..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSStyleDeclarationFactory.java
+++ /dev/null
@@ -1,61 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-
-
-import org.eclipse.wst.css.core.internal.document.CSSStyleDeclarationFactoryContext;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-
-
-/**
- * 
- */
-public class CSSStyleDeclarationFactory extends CSSStyleDeclarationFactoryContext {
-
-	private static CSSStyleDeclarationFactory fInstance = null;
-
-	/**
-	 * CSSStyleDeclarationFactory constructor comment.
-	 */
-	private CSSStyleDeclarationFactory() {
-		super();
-	}
-
-	/**
-	 * @return org.eclipse.wst.css.core.model.interfaces.ICSSStyleDeclaration
-	 * @param decl
-	 *            org.eclipse.wst.css.core.model.interfaces.ICSSStyleDeclaration
-	 */
-	public ICSSStyleDeclaration createStyleDeclaration(ICSSStyleDeclaration decl) {
-		if (decl == null) {
-			return null;
-		}
-		ICSSStyleDeclaration newNode = createStyleDeclaration();
-
-		if (newNode == null) {
-			return null;
-		}
-		fOwnerDocument = newNode;
-		cloneChildNodes(decl, newNode);
-		return newNode;
-	}
-
-	/**
-	 * 
-	 */
-	public synchronized static CSSStyleDeclarationFactory getInstance() {
-		if (fInstance == null) {
-			fInstance = new CSSStyleDeclarationFactory();
-		}
-		return fInstance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSUtil.java
deleted file mode 100644
index 3583859..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSUtil.java
+++ /dev/null
@@ -1,335 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-
-
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.parser.CSSRegionUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-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;
-
-
-public class CSSUtil {
-
-	/**
-	 * 
-	 */
-	public static void debugOut(String str) {
-		Logger.log(Logger.WARNING, "css warning: " + str); //$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 */
-	// public static Vector extractMediaContents(Vector regions) {
-	// Vector media = new Vector();
-	// if (regions == null) { return media; }
-	//
-	// boolean bReady = true;
-	// for (Iterator i = regions.iterator(); i.hasNext(); ) {
-	// ITextRegion region = (ITextRegion)i.next();
-	// if (region == null) { continue; }
-	// String type = region.getType();
-	// if (bReady) {
-	// if (type == IDENT) {
-	// media.addElement(region.getText());
-	// bReady = false;
-	// }
-	// } else {
-	// if (type == COMMA) {
-	// bReady = true;
-	// }
-	// }
-	// }
-	//
-	// return media;
-	// }
-	/**
-	 * 
-	 */
-	public static String extractStringContents(String text) {
-		return stripQuotes(text);
-	}
-
-	/**
-	 * 
-	 */
-	public static String extractUriContents(String text) {
-		String contents = text.trim();
-		if (contents.toLowerCase().startsWith("url(") && //$NON-NLS-1$
-					contents.toLowerCase().endsWith(")")) {//$NON-NLS-1$
-			// strip "url(", ")"
-			contents = contents.substring(4, contents.length() - 1);
-		}
-		contents = stripQuotes(contents);
-
-		return contents;
-	}
-
-	/**
-	 * 
-	 */
-	public static IStructuredDocumentRegion findNextSignificantNode(IStructuredDocumentRegion startNode) {
-		if (startNode == null) {
-			return null;
-		}
-		IStructuredDocumentRegion node = startNode.getNext();
-		while (node != null) {
-			String type = getStructuredDocumentRegionType(node);
-			if (type != CSSRegionContexts.CSS_S && type != CSSRegionContexts.CSS_COMMENT && type != CSSRegionContexts.CSS_CDO && type != CSSRegionContexts.CSS_CDC) {
-				return node;
-			}
-			node = node.getNext();
-		}
-		return null;
-	}
-
-	/**
-	 * 
-	 */
-	public static IStructuredDocumentRegion findNodeBackward(IStructuredDocumentRegion startNode, IStructuredDocumentRegion endNode, String type) {
-		IStructuredDocumentRegion node;
-		for (node = startNode; node != null; node = node.getPrevious()) {
-			if (node.getStartOffset() < endNode.getStartOffset()) {
-				node = null;
-				break;
-			}
-			else if (getStructuredDocumentRegionType(node) == type) {
-				break;
-			}
-		}
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	public static IStructuredDocumentRegion findNodeForward(IStructuredDocumentRegion startNode, IStructuredDocumentRegion endNode, String type) {
-		IStructuredDocumentRegion node;
-		for (node = startNode; node != null; node = node.getNext()) {
-			if (endNode.getStartOffset() < node.getStartOffset()) {
-				node = null;
-				break;
-			}
-			else if (getStructuredDocumentRegionType(node) == type) {
-				break;
-			}
-		}
-		return node;
-	}
-
-	/**
-	 * 
-	 */
-	public static IStructuredDocumentRegion findPreviousSignificantNode(IStructuredDocumentRegion startNode) {
-		if (startNode == null) {
-			return null;
-		}
-		IStructuredDocumentRegion node = startNode.getPrevious();
-		while (node != null) {
-			String type = getStructuredDocumentRegionType(node);
-			if (type != CSSRegionContexts.CSS_S && type != CSSRegionContexts.CSS_COMMENT && type != CSSRegionContexts.CSS_CDO && type != CSSRegionContexts.CSS_CDC) {
-				return node;
-			}
-			node = node.getPrevious();
-		}
-		return null;
-	}
-
-	/**
-	 * 
-	 */
-	public static String getClassString(Object object) {
-		if (object == null) {
-			return "null"; //$NON-NLS-1$
-		}
-		else {
-			String name = object.getClass().toString();
-			int lastPeriod = name.lastIndexOf('.');
-			return name.substring(lastPeriod + 1);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public static String getStructuredDocumentRegionType(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null) {
-			return CSSRegionContexts.CSS_UNDEFINED;
-		}
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null || regions.size() == 0) {
-			return CSSRegionContexts.CSS_UNDEFINED;
-		}
-		ITextRegion region = regions.get(0);
-		return region.getType();
-	}
-
-	/**
-	 * 
-	 */
-	public static int getLengthDifference(IStructuredDocumentRegionList newNodes, IStructuredDocumentRegionList oldNodes) {
-		int newLen = getTextLength(newNodes);
-		int oldLen = getTextLength(oldNodes);
-		return newLen - oldLen;
-	}
-
-	/**
-	 * 
-	 */
-	public static String getRegionText(IStructuredDocumentRegion flatNode, ITextRegionList regions) {
-		StringBuffer buf = new StringBuffer();
-		if (regions != null) {
-			for (Iterator i = regions.iterator(); i.hasNext();) {
-				ITextRegion region = (ITextRegion) i.next();
-				if (region == null) {
-					continue;
-				}
-				buf.append(flatNode.getText(region));
-			}
-		}
-
-		return buf.toString();
-	}
-
-	/**
-	 * 
-	 */
-	public static int getTextLength(IStructuredDocumentRegionList nodes) {
-		int length = 0;
-
-		if (nodes != null) {
-			for (Enumeration e = nodes.elements(); e.hasMoreElements();) {
-				IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
-				if (flatNode != null) {
-					length += flatNode.getText().length();
-				}
-			}
-		}
-
-		return length;
-	}
-
-	/**
-	 * 
-	 * @param token
-	 * @return
-	 */
-	public static boolean isLength(CSSTextToken token) {
-		if (token == null)
-			return false;
-		if (token.kind == CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION)
-			return true;
-		if (token.kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
-			double number = Double.parseDouble(token.image);
-			if (number == 0.0)
-				return true;
-		}
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	public static boolean isSelectorText(IStructuredDocumentRegion region) {
-		String type = getStructuredDocumentRegionType(region);
-		if (CSSRegionUtil.isSelectorBegginingType(type)) {
-			return true;
-		}
-		else if (type == CSSRegionContexts.CSS_UNKNOWN) {
-			// String text = flatNode.getText();
-			// if (text != null && text.indexOf('.') == 0) {
-			return true;
-			// }
-		}
-
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	public static String stripQuotes(String text) {
-		if (text == null)
-			return null;
-		String contents = text.trim();
-		if (2 <= contents.length()) {
-			char first = contents.charAt(0);
-			char last = contents.charAt(contents.length() - 1);
-			if ((first == '\"' && last == '\"') || (first == '\'' && last == '\'')) {
-				contents = contents.substring(1, contents.length() - 1);
-			}
-		}
-		return contents;
-	}
-
-	public static String detectQuote(String source, String defaultQuote) {
-		if (source == null)
-			return defaultQuote;
-		final String D_QUOTE = "\""; //$NON-NLS-1$
-		final String S_QUOTE = "\'"; //$NON-NLS-1$
-
-		int dIndex = source.indexOf(D_QUOTE);
-		int sIndex = source.indexOf(S_QUOTE);
-		if (dIndex < 0 && sIndex < 0) {
-			return defaultQuote;
-		}
-		else if (dIndex < 0) {
-			return D_QUOTE;
-		}
-		else if (sIndex < 0) {
-			return S_QUOTE;
-		}
-		else if (dIndex < sIndex) {
-			return S_QUOTE;
-		}
-		else {
-			return D_QUOTE;
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public static void stripSurroundingSpace(ITextRegionList regions) {
-		if (regions == null) {
-			return;
-		}
-		while (!regions.isEmpty()) {
-			ITextRegion region = regions.get(0);
-			String type = region.getType();
-			if (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT) {
-				regions.remove(0);
-			}
-			else {
-				break;
-			}
-		}
-		while (!regions.isEmpty()) {
-			ITextRegion region = regions.get(regions.size() - 1);
-			String type = region.getType();
-			if (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT) {
-				regions.remove(region);
-			}
-			else {
-				break;
-			}
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportRuleCollector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportRuleCollector.java
deleted file mode 100644
index 6ec4ec0..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportRuleCollector.java
+++ /dev/null
@@ -1,71 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-
-
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-
-
-/**
- * 
- */
-public class ImportRuleCollector extends org.eclipse.wst.css.core.internal.util.AbstractCssTraverser {
-
-	protected java.util.Vector rules = new Vector();
-	protected ICSSStyleSheet target = null;
-
-	/**
-	 * 
-	 */
-	public ImportRuleCollector() {
-		super();
-		setTraverseImported(false);
-	}
-
-	/**
-	 * 
-	 */
-	public ImportRuleCollector(ICSSStyleSheet sheet) {
-		super();
-		target = sheet;
-	}
-
-	/**
-	 * 
-	 */
-	public java.util.Vector getRules() {
-		return rules;
-	}
-
-	/**
-	 * 
-	 */
-	protected short preNode(ICSSNode node) {
-		if (node.getNodeType() == ICSSNode.MEDIARULE_NODE || node.getNodeType() == ICSSNode.STYLESHEET_NODE) {
-			return TRAV_CONT;
-		}
-		if (node.getNodeType() == ICSSNode.IMPORTRULE_NODE) {
-			if (target != null) {
-				ICSSImportRule imp = (ICSSImportRule) node;
-				if (imp.getStyleSheet() != target)
-					return TRAV_PRUNE;
-			}
-			if (!rules.contains(node))
-				rules.add(node);
-		}
-		return TRAV_PRUNE;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportedCollector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportedCollector.java
deleted file mode 100644
index 2c4751e..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportedCollector.java
+++ /dev/null
@@ -1,61 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-
-
-/**
- * 
- */
-public class ImportedCollector extends org.eclipse.wst.css.core.internal.util.AbstractCssTraverser {
-
-	protected java.util.Vector externals = new Vector();
-
-	/**
-	 * 
-	 */
-	public ImportedCollector() {
-		super();
-		setTraverseImported(true);
-	}
-
-	/**
-	 * 
-	 */
-	public List getExternals() {
-		return externals;
-	}
-
-	/**
-	 * 
-	 */
-	protected short preNode(ICSSNode node) {
-		if (node.getNodeType() == ICSSNode.MEDIARULE_NODE) {
-			return TRAV_CONT;
-		}
-		if (node.getNodeType() == ICSSNode.STYLESHEET_NODE) {
-			if (!externals.contains(node)) {
-				externals.add(node);
-			}
-			return TRAV_CONT;
-		}
-		if (node.getNodeType() == ICSSNode.IMPORTRULE_NODE) {
-			return TRAV_CONT;
-		}
-		return TRAV_PRUNE;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/RegionIterator.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/RegionIterator.java
deleted file mode 100644
index 5f2626d..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/RegionIterator.java
+++ /dev/null
@@ -1,140 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-
-
-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;
-
-/**
- * 
- */
-public class RegionIterator {
-
-	private IStructuredDocumentRegion documentRegion = null;
-	private IStructuredDocumentRegion curDocumentRegion = null;
-	private int current = -1;
-
-	/**
-	 * 
-	 */
-	public RegionIterator(IStructuredDocument structuredDocument, int index) {
-		super();
-
-		reset(structuredDocument, index);
-	}
-
-	/**
-	 * 
-	 */
-	public RegionIterator(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		super();
-		reset(flatNode, region);
-	}
-
-	/**
-	 * 
-	 */
-	public IStructuredDocumentRegion getStructuredDocumentRegion() {
-		return curDocumentRegion;
-	}
-
-	/**
-	 * 
-	 */
-	public boolean hasNext() {
-		if (documentRegion == null)
-			return false;
-		if (current < 0)
-			return false;
-		if (current < documentRegion.getRegions().size())
-			return true;
-		return false;
-	}
-
-	/**
-	 * 
-	 */
-	public boolean hasPrev() {
-		// the same as hasNext()
-		return hasNext();
-	}
-
-	/**
-	 * 
-	 */
-	public ITextRegion next() {
-		if (documentRegion == null)
-			return null;
-		if (current < 0 || documentRegion.getRegions() == null || documentRegion.getRegions().size() <= current)
-			return null;
-
-		ITextRegion region = documentRegion.getRegions().get(current);
-		curDocumentRegion = documentRegion;
-
-		if (current >= documentRegion.getRegions().size() - 1) {
-			documentRegion = documentRegion.getNext();
-			current = -1;
-		}
-		current++;
-
-		return region;
-	}
-
-	/**
-	 * 
-	 */
-	public ITextRegion prev() {
-		if (documentRegion == null)
-			return null;
-		if (current < 0 || documentRegion.getRegions() == null || documentRegion.getRegions().size() <= current)
-			return null;
-
-		ITextRegion region = documentRegion.getRegions().get(current);
-		curDocumentRegion = documentRegion;
-
-		if (current == 0) {
-			documentRegion = documentRegion.getPrevious();
-			if (documentRegion != null)
-				current = documentRegion.getRegions().size();
-			else
-				current = 0;
-		}
-		current--;
-
-		return region;
-	}
-
-	/**
-	 * 
-	 */
-	public void reset(IStructuredDocument structuredDocument, int index) {
-		documentRegion = structuredDocument.getRegionAtCharacterOffset(index);
-		curDocumentRegion = documentRegion;
-		if (documentRegion != null) {
-			ITextRegion region = documentRegion.getRegionAtCharacterOffset(index);
-			current = documentRegion.getRegions().indexOf(region);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public void reset(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		if (region != null && flatNode != null) {
-			this.documentRegion = flatNode;
-			curDocumentRegion = flatNode;
-			current = flatNode.getRegions().indexOf(region);
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectionCollector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectionCollector.java
deleted file mode 100644
index b523932..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectionCollector.java
+++ /dev/null
@@ -1,76 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-
-
-/**
- */
-public class SelectionCollector extends org.eclipse.wst.css.core.internal.util.AbstractCssTraverser {
-
-	int start, end;
-	List selectedNodes;
-
-	/**
-	 * SelectionCollector constructor comment.
-	 */
-	public SelectionCollector() {
-		super();
-	}
-
-	/**
-	 */
-	protected void begin(ICSSNode node) {
-		selectedNodes = new ArrayList();
-	}
-
-	/**
-	 */
-	public List getSelectedNodes() {
-		if (selectedNodes == null)
-			return new ArrayList();
-		else
-			return new ArrayList(selectedNodes);
-	}
-
-	/**
-	 */
-	protected short preNode(ICSSNode node) {
-		IndexedRegion iNode = (IndexedRegion) node;
-		if (iNode.getStartOffset() <= end && start < iNode.getEndOffset()) {
-			if (node.getNodeType() != ICSSNode.STYLESHEET_NODE) {
-				IndexedRegion iFirstChild = (IndexedRegion) node.getFirstChild();
-				IndexedRegion iLastChild = (IndexedRegion) node.getLastChild();
-				if (iFirstChild == null || start < iFirstChild.getStartOffset() || iLastChild.getEndOffset() <= end)
-					selectedNodes.add(node);
-			}
-			return TRAV_CONT;
-		}
-		if (iNode.getStartOffset() > end)
-			return TRAV_STOP;
-		else
-			return TRAV_PRUNE;
-	}
-
-	/**
-	 */
-	public void setRegion(int newStart, int newEnd) {
-		start = newStart;
-		end = newEnd;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorValidator.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorValidator.java
deleted file mode 100644
index 0a92aaf..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorValidator.java
+++ /dev/null
@@ -1,97 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-
-
-import org.eclipse.wst.css.core.internal.document.CSSSelectorListImpl;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
-
-
-public class SelectorValidator {
-
-	/**
-	 * Constructor for SelectorValidator.
-	 */
-	public SelectorValidator(String text) {
-		super();
-		fText = text;
-	}
-
-	/**
-	 * Returns true if the text consists of one CLASS selector. syntax check
-	 * is a little loose (.123 is passed)
-	 * 
-	 * ".class" -> true ".123" -> true ".class , .class2" -> false
-	 * ".class.class2" -> false ".123{}" -> false
-	 */
-	public boolean isClass() {
-		ICSSSimpleSelector selector = getOnlyOneSimpleSelector();
-		if (selector != null) {
-			return (selector.getName().length() == 0 && selector.getNumOfAttributes() == 0 && selector.getNumOfClasses() == 1 && selector.getNumOfIDs() == 0 && selector.getNumOfPseudoNames() == 0);
-		}
-		return false;
-	}
-
-	/**
-	 * Returns true if the text consists of one ID selector.
-	 * 
-	 * "#ID" -> true "H1#myID" -> false "#abc{}" -> false
-	 */
-	public boolean isID() {
-		ICSSSimpleSelector selector = getOnlyOneSimpleSelector();
-		if (selector != null) {
-			return (selector.getName().length() == 0 && selector.getNumOfAttributes() == 0 && selector.getNumOfClasses() == 0 && selector.getNumOfIDs() == 1 && selector.getNumOfPseudoNames() == 0);
-		}
-		return false;
-	}
-
-	/**
-	 * overall check
-	 * 
-	 * "P#hoge98 + *:hover > A:link, A.external:visited" -> true "H1 H2 {}" ->
-	 * false
-	 */
-	public boolean isValid() {
-		parse();
-		return (fSelectorList != null && fSelectorList.getErrorCount() == 0);
-	}
-
-	private ICSSSimpleSelector getOnlyOneSimpleSelector() {
-		parse();
-		if (fSelectorList != null && fSelectorList.getLength() == 1) {
-			ICSSSelector selector = fSelectorList.getSelector(0);
-			int nItem = selector.getLength();
-			if (nItem == 1) {
-				ICSSSelectorItem item = selector.getItem(0);
-				if (item instanceof ICSSSimpleSelector) {
-					return (ICSSSimpleSelector) item;
-				}
-			}
-		}
-		return null;
-	}
-
-	private void parse() {
-		if (fSelectorList == null) {
-			if (fText != null) {
-				fSelectorList = new CSSSelectorListImpl(fText);
-			}
-		}
-	}
-
-
-	private String fText = null;
-	private ICSSSelectorList fSelectorList = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorsCollector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorsCollector.java
deleted file mode 100644
index fcaa32e..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorsCollector.java
+++ /dev/null
@@ -1,101 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-
-
-/**
- * 
- */
-public class SelectorsCollector extends AbstractCssTraverser {
-
-	protected Vector selectors = new Vector();
-	protected Vector selectorsToAvoid = null;
-
-	/**
-	 * 
-	 */
-	public SelectorsCollector() {
-		super();
-		setTraverseImported(false);
-	}
-
-	/**
-	 * 
-	 */
-	public void addSelectorToAvoid(ICSSSelector selToAvoid) {
-		if (selToAvoid == null)
-			return;
-		if (selectorsToAvoid == null)
-			selectorsToAvoid = new Vector();
-
-		if (!selectorsToAvoid.contains(selToAvoid))
-			selectorsToAvoid.add(selToAvoid);
-	}
-
-	/**
-	 * 
-	 */
-	public void addSelectorToAvoid(ICSSStyleRule rule) {
-		ICSSSelectorList list = rule.getSelectors();
-		Iterator it = list.getIterator();
-		while (it.hasNext()) {
-			ICSSSelector sel = (ICSSSelector) it.next();
-			addSelectorToAvoid(sel);
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public java.util.List getSelectors() {
-		return selectors;
-	}
-
-	/**
-	 * 
-	 */
-	protected short preNode(ICSSNode node) {
-		if (node.getNodeType() == ICSSNode.STYLERULE_NODE) {
-			ICSSStyleRule rule = (ICSSStyleRule) node;
-			ICSSSelectorList list = rule.getSelectors();
-			Iterator it = list.getIterator();
-			while (it.hasNext()) {
-				Object obj = it.next();
-				if (selectorsToAvoid != null && selectorsToAvoid.contains(obj))
-					continue;
-				if (!selectors.contains(obj))
-					selectors.add(obj);
-			}
-			return TRAV_PRUNE;
-		}
-		else if (node.getNodeType() == ICSSNode.STYLESHEET_NODE) {
-			return TRAV_CONT;
-		}
-		return TRAV_PRUNE;
-	}
-
-	/**
-	 * 
-	 */
-	public void setSelectorsToAvoid(java.util.Vector newSelectorsToAvoid) {
-		selectorsToAvoid = newSelectorsToAvoid;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLHelper.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLHelper.java
deleted file mode 100644
index f51460e..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLHelper.java
+++ /dev/null
@@ -1,210 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.wst.sse.core.internal.util.PathHelper;
-
-/**
- * Hyperlink manager. Proved useful services like link conversion An utility
- * class to help other parsre modules to convert links
- */
-public class URLHelper {
-
-	private static final String FILE_PROTOCOL_SEARCH_SIG = "file:/";//$NON-NLS-1$
-	private static final String FILE_PROTOCOL_SIG = "file:///";//$NON-NLS-1$
-	private static String RELATIVE_PATH_SIG = "..";//$NON-NLS-1$	
-	private static final String FORWARD_SLASH = "/";//$NON-NLS-1$	
-	private URL fBaseUrl = null; // base url. assumed to a absulute url
-	private String fBaseUrlString = null;
-	private URL fDocRoot = null;
-	private String fDocRootString = null;
-
-	public URLHelper(String baseUrl) {
-		initialize(baseUrl, null);
-	}
-
-	public URLHelper(String baseUrl, String docRoot) {
-		initialize(baseUrl, docRoot);
-	}
-
-	/**
-	 * Special adujust for file url
-	 */
-	public String adjustFileProtocolUrl(String url) {
-		if (url.startsWith(FILE_PROTOCOL_SEARCH_SIG)) {
-			url = FILE_PROTOCOL_SIG + url.substring(FILE_PROTOCOL_SEARCH_SIG.length());
-		}
-		return url;
-	}
-
-	private String convert(String url, URL baseUrl, String urlString) {
-		String absUrl = url;
-		if (baseUrl != null) {
-			try {
-				// do special thing file protocol
-				if (baseUrl.getProtocol().equalsIgnoreCase("file")) {//$NON-NLS-1$
-					// remove the fist
-					if (url.startsWith("/"))//$NON-NLS-1$
-						url = url.substring(1);
-					// empty string causes malformed exception
-					String tempUrl = url;
-					if ("".equals(url))//$NON-NLS-1$
-						tempUrl = " ";//$NON-NLS-1$
-					URL newUrl = new URL(baseUrl, tempUrl);
-					// do extra math for file protocol to support ie based
-					absUrl = adjustFileProtocolUrl(newUrl.toString());
-				}
-				else {
-					URL newUrl = new URL(fBaseUrl, url);
-					absUrl = newUrl.toString();
-				}
-			}
-			catch (MalformedURLException me) {
-			}
-			// convert everything to forward slash
-			absUrl = PathHelper.switchToForwardSlashes(absUrl);
-		}
-		else {
-			// the given may be based on file
-			if (urlString != null) {
-				// swich the url to proper direction
-				url = PathHelper.removeLeadingSeparator(url);
-				File fle = new File(urlString, url);
-				absUrl = fle.getPath();
-
-			}
-			// convert everything to forward slash
-			absUrl = PathHelper.switchToForwardSlashes(absUrl);
-
-			// if the path ends with ".." we need to add a terminating slash
-			// or
-			// else the link will not be resolved correctly. (it will look
-			// like
-			// /url/path/to/somewhere/.. instead of /url/path/to/
-			if (absUrl.endsWith(FORWARD_SLASH + RELATIVE_PATH_SIG)) {
-				absUrl += FORWARD_SLASH;
-			}
-		}
-
-		// resolve relative path to absolute
-		absUrl = PathHelper.adjustPath(absUrl);
-		return absUrl;
-	}
-
-	private void initialize(String baseUrl, String docRoot) {
-		//
-		// Find out whether baes url is a url or file name
-		//
-		try {
-			String temp = PathHelper.appendTrailingURLSlash(baseUrl);
-			fBaseUrl = new URL(temp);
-		}
-		catch (MalformedURLException mue) {
-		}
-		if (fBaseUrl == null) {
-			// it is a file based url
-			fBaseUrlString = baseUrl;
-		}
-
-		// do the same for doc root
-		if (docRoot != null) {
-			try {
-				String temp = PathHelper.appendTrailingURLSlash(docRoot);
-				fDocRoot = new URL(temp);
-
-			}
-			catch (MalformedURLException mue) {
-			}
-			if (fDocRoot == null) {
-				// it is a file based url
-				fDocRootString = docRoot;
-			}
-		}
-	}
-
-	/**
-	 * Convert the given url to a abolute url using the base url Input url can
-	 * be of any othe following format Absolute urls -------------- .
-	 * http://www.foo.com/ . http://www.foo.com . http://www.foo.com/folder .
-	 * http://www.foo.com/folder/ . http://www.foo.com/index.html .
-	 * http://www.foo.com/folder/index.html .
-	 * http://www.foo.com/folder/../index.html Url relative on document root
-	 * ------------------------- . / . /folder . /index.html .
-	 * /folder/index.html . /folder/../index.html
-	 * 
-	 * Self relative ------------------------- . index.html . ./index.html .
-	 * ../index.html . folder/index.html . folder/../index.html
-	 * 
-	 * file based url adds another dimension since it doesn't have a document
-	 * root So uses fDocRoot if provided
-	 */
-	public String toAbsolute(String url) {
-		String absUrl = url;
-
-		URL newUrl = null;
-		// try to see it is a absolute url
-		try {
-			newUrl = new URL(url);
-		}
-		catch (MalformedURLException me) {
-		}
-		// if document root is provided
-		// do special case
-		if (newUrl == null) {
-			if (fDocRoot == null && fDocRootString == null) {
-				// try to check relative url
-				absUrl = convert(url, fBaseUrl, fBaseUrlString);
-			}
-			else {
-				// doc root is provided
-				// if the url is a doc root based use doc root
-
-				if (url.startsWith("/"))//$NON-NLS-1$
-					absUrl = convert(url, fDocRoot, fDocRootString);
-				else
-					absUrl = convert(url, fBaseUrl, fBaseUrlString);
-
-			}
-		}
-		return absUrl;
-	}
-
-	/**
-	 * Convert from an absolute url to relative url based on the given url
-	 * Both are assumed to be ablsute url
-	 */
-	public String toRelative(String url, String documentUrl) {
-		String output = url;
-		// assuming both urls are absolute
-		try {
-			URL inputUrl = new URL(url);
-			URL docUrl = new URL(documentUrl);
-			// filter out if the urls are not fro the same domain
-			if (!inputUrl.getProtocol().equals(docUrl.getProtocol()) || !inputUrl.getHost().equals(docUrl.getHost()) || inputUrl.getPort() != docUrl.getPort())
-				return output;
-			// both url are coming form the same place
-			// strip off the domain parts
-			String inputName = inputUrl.getFile();
-			String docName = docUrl.getFile();
-			output = PathHelper.convertToRelative(inputName, docName);
-		}
-		catch (MalformedURLException me) {
-			output = null;
-		}
-		return output;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLModelProviderCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLModelProviderCSS.java
deleted file mode 100644
index c25e9a2..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLModelProviderCSS.java
+++ /dev/null
@@ -1,387 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util;
-
-
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.nio.charset.UnsupportedCharsetException;
-
-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.IWorkspaceRoot;
-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.encoding.EncodingRule;
-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.StructuredModelManager;
-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.util.PathHelper;
-import org.eclipse.wst.sse.core.internal.util.ProjectResolver;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-
-/**
- */
-public class URLModelProviderCSS {
-
-	private static final int GET_MODEL_FOR_READ = 1;
-	// private static final int GET_NEW_MODEL_FOR_READ = 2;
-	private static final int GET_MODEL_FOR_EDIT = 3;
-	// private static final int GET_NEW_MODEL_FOR_EDIT = 4;
-	// private static final int READ_BUFFER_SIZE = 4096;
-	// IModelManager
-	private IModelManager modelManager = null;
-
-	/**
-	 */
-	public URLModelProviderCSS() {
-		super();
-
-		// obtain model manager
-		modelManager = StructuredModelManager.getModelManager();
-	}
-
-	/**
-	 * Calculate ID from a filename. This must be same as
-	 * FileModelProvider.calculateId(IFile)
-	 */
-	private static String calculateId(IPath fullIPath) {
-		return fullIPath.toString();
-	}
-
-	/**
-	 * <code>baseModel</code>: the model containing the link
-	 * <code>ref</code>: the link URL string
-	 */
-	private IStructuredModel getCommonModelFor(final IStructuredModel baseModel, final String ref, final int which) throws IOException {
-		// first, create absolute url
-		String absURL = resolveURI(baseModel, ref, true);
-		if ((absURL == null) || (absURL.length() == 0)) {
-			return null;
-		}
-
-		// need to remove file:// scheme if necessary
-		try {
-			final URL aURL = new URL(absURL);
-			// An actual URL was given, only file:/// is supported
-			// resolve it by finding the file it points to
-			if (!aURL.getProtocol().equals("platform")) { //$NON-NLS-1$
-				if (aURL.getProtocol().equals("file") && (aURL.getHost().equals("localhost") || aURL.getHost().length() == 0)) { //$NON-NLS-2$//$NON-NLS-1$
-					absURL = aURL.getFile();
-					final IPath ipath = new Path(absURL);
-					// if path has a device, and if it begins with
-					// IPath.SEPARATOR, remove it
-					final String device = ipath.getDevice();
-					if ((device != null) && (device.length() > 0)) {
-						if (device.charAt(0) == IPath.SEPARATOR) {
-							final String newDevice = device.substring(1);
-							absURL = ipath.setDevice(newDevice).toString();
-						}
-					}
-
-				}
-			}
-		}
-		catch (MalformedURLException mfuExc) {
-		}
-
-		// next, decide project
-		IProject project = null;
-		final IPath fullIPath = new Path(absURL);
-		IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
-		IContainer container = workspace.getContainerForLocation(fullIPath);
-		if (container != null) {
-			// fullIPath doesn't exist in workspace
-			project = container.getProject();
-		}
-
-		// If HTML document has a link to an extern CSS which is not in
-		// IProject
-		// workspace.getContainerForLoation() may return null. We need to take
-		// care
-		// of this case
-
-		// now, get absURL's IFile
-		if ((project != null) && (project.getLocation().isPrefixOf(fullIPath) == false)) {
-			// it's at outside of Project
-			return null;
-		}
-
-		IStructuredModel model = null;
-		if (project != null) {
-			IPath filePath = fullIPath.removeFirstSegments(project.getLocation().segmentCount());
-			IFile file = (filePath != null && !filePath.isEmpty()) ? project.getFile(filePath) : null;
-			if (file == null) {
-				return null;
-			}
-
-			// obtain model
-			if (which == GET_MODEL_FOR_EDIT) {
-				model = getModelForEdit(file);
-			}
-			else if (which == GET_MODEL_FOR_READ) {
-				model = getModelForRead(file);
-			}
-
-			// setting synchronization stamp is IModelManager's client's
-			// responsibility
-			if (model != null && model.getSynchronizationStamp() == IResource.NULL_STAMP)
-				model.resetSynchronizationStamp(file);
-		}
-		else {
-			String id = null;
-			InputStream inStream = null;
-			// obtain resolver
-			URIResolver resolver = (project != null) ? (URIResolver) project.getAdapter(URIResolver.class) : null;
-			if (resolver == null) {
-				// ProjectResolver can take care of the case if project is
-				// null.
-				resolver = new ProjectResolver(project);
-			}
-			if (resolver == null) {
-				return null;
-			}
-
-			// there is no project. we can't expect IProject help to create
-			// id/inputStream
-			File file = fullIPath.toFile();
-
-			// obatin id
-			id = calculateId(fullIPath);
-
-			// obtain InputStream
-			try {
-				inStream = new FileInputStream(file);
-			}
-			catch (FileNotFoundException fnfe) {
-				// the file does not exist, or we don't have read permission
-				return null;
-			}
-
-			// obtain model
-			try {
-				if (which == GET_MODEL_FOR_EDIT) {
-					model = getModelManager().getModelForEdit(id, inStream, resolver);
-				}
-				else if (which == GET_MODEL_FOR_READ) {
-					model = getModelManager().getModelForRead(id, inStream, resolver);
-				}
-			}
-			catch (UnsupportedEncodingException ue) {
-			}
-			catch (IOException ioe) {
-			}
-			finally {
-				// close now !
-				if (inStream != null) {
-					inStream.close();
-				}
-			}
-		}
-
-		// set locationid
-		if (model != null && model.getBaseLocation() == null) {
-			model.setBaseLocation(fullIPath.toString());
-		}
-
-		return model;
-	}
-
-	/**
-	 * <code>baseModel</code>: the model containing the link
-	 * <code>ref</code>: the link URL string
-	 */
-	public IStructuredModel getModelForEdit(IStructuredModel baseModel, String ref) throws IOException {
-		return getCommonModelFor(baseModel, ref, GET_MODEL_FOR_EDIT);
-	}
-
-	/**
-	 */
-	private IStructuredModel getModelForEdit(IFile file) throws IOException {
-		if (file == null)
-			return null;
-		IModelManager manager = getModelManager();
-
-		// create a fake InputStream
-		IStructuredModel model = null;
-		try {
-			model = manager.getModelForEdit(file);
-		}
-		catch (UnsupportedCharsetException ex) {
-			try {
-				model = manager.getModelForEdit(file, EncodingRule.FORCE_DEFAULT);
-			}
-			catch (IOException ioe) {
-			}
-			catch (CoreException ce) {
-			}
-		}
-		catch (CoreException ce) {
-		}
-		return model;
-	}
-
-	/**
-	 * <code>baseModel</code>: the model containing the link
-	 * <code>ref</code>: the link URL string
-	 */
-	public IStructuredModel getModelForRead(IStructuredModel baseModel, String ref) throws UnsupportedEncodingException, IOException {
-		return getCommonModelFor(baseModel, ref, GET_MODEL_FOR_READ);
-	}
-
-	/**
-	 */
-	private IStructuredModel getModelForRead(IFile file) throws IOException {
-		if (file == null)
-			return null;
-		IModelManager manager = getModelManager();
-
-		// create a fake InputStream
-		IStructuredModel model = null;
-		try {
-			model = manager.getModelForRead(file);
-		}
-		catch (UnsupportedCharsetException ex) {
-			try {
-				model = manager.getModelForRead(file, EncodingRule.FORCE_DEFAULT);
-			}
-			catch (IOException ioe) {
-			}
-			catch (CoreException ce) {
-			}
-		}
-		catch (CoreException ce) {
-		}
-		return model;
-	}
-
-	/**
-	 */
-	private IModelManager getModelManager() {
-		return modelManager;
-	}
-
-	public IStructuredModel getNewModelForEdit(IFile iFile) {
-		if (iFile == null)
-			return null;
-		IModelManager manager = getModelManager();
-		if (manager == null)
-			return null;
-
-		IStructuredModel model = null;
-		try {
-			model = manager.getNewModelForEdit(iFile, false);
-		}
-		catch (IOException ex) {
-		}
-		catch (ResourceInUse riu) {
-		}
-		catch (ResourceAlreadyExists rae) {
-		}
-		catch (CoreException ce) {
-		}
-		return model;
-	}
-
-	public IStructuredModel getNewModelForRead(IFile iFile) {
-		if (iFile == null)
-			return null;
-		IModelManager manager = getModelManager();
-		if (manager == null)
-			return null;
-
-		IStructuredModel model = null;
-		try {
-			model = manager.getNewModelForEdit(iFile, false);
-		}
-		catch (IOException ex) {
-		}
-		catch (ResourceInUse riu) {
-		}
-		catch (ResourceAlreadyExists rae) {
-		}
-		catch (CoreException ce) {
-		}
-		return model;
-	}
-
-	/**
-	 * <code>baseModel</code>: the model containing the link
-	 * <code>ref</code>: the link URL string
-	 * <code>resolveCrossProjectLinks</code>: If resolveCrossProjectLinks
-	 * is set to true, then this method will properly resolve the URI if it is
-	 * a valid URI pointing to another (appropriate) project.
-	 */
-	public static String resolveURI(IStructuredModel baseModel, String ref, boolean resolveCrossProjectLinks) {
-		if (baseModel == null)
-			return null;
-
-		// get resolver in Model
-		final URIResolver resolver = baseModel.getResolver();
-
-		// resolve to absolute url
-		final String absurl = (resolver != null) ? resolver.getLocationByURI(ref, resolveCrossProjectLinks) : null;
-		if ((resolver != null) && (absurl == null) && (ref != null) && (ref.trim().length() > 0) && (ref.trim().charAt(0) == '/')) {
-			// to reach here means :
-			// ref is a Docroot relative
-			// resolver can't resolve ref
-			// so that href is a broken and should not create model
-			return null;
-		}
-		if ((absurl != null) && (absurl.length() > 0)) {
-			return absurl;
-		}
-
-		// maybe ref is at outside of the Project
-		// obtain docroot;
-		final IContainer container = (resolver != null) ? resolver.getRootLocation() : null;
-		String docroot = null;
-		if (container != null) {
-			docroot = container.getLocation().toString();
-		}
-		if (docroot == null) {
-			docroot = baseModel.getBaseLocation();
-		}
-		if (docroot == null) {
-			// should not be
-			return null;
-		}
-
-		// obtain document url
-		String modelBaseLocation = baseModel.getBaseLocation();
-		if ((modelBaseLocation == null) || (modelBaseLocation.length() == 0)) {
-			// fallback...
-			modelBaseLocation = baseModel.getId();
-		}
-		if ((modelBaseLocation == null) || (modelBaseLocation.length() == 0)) {
-			// i can't resolve uri !
-			return null;
-		}
-
-		// resolve url
-		URLHelper helper = new URLHelper(PathHelper.getContainingFolderPath(modelBaseLocation), PathHelper.getContainingFolderPath(PathHelper.appendTrailingURLSlash(docroot)));
-		return helper.toAbsolute(ref);
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionXSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionXSubStyleAdapter.java
deleted file mode 100644
index 29ab93c..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionXSubStyleAdapter.java
+++ /dev/null
@@ -1,142 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.contentmodel.IValID;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMSubProperty;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValueList;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- * for horizontal value of 'background-position'
- */
-public class BackgroundPositionXSubStyleAdapter implements ISubPropertyAdapter {
-
-	/**
-	 * 
-	 */
-	public BackgroundPositionXSubStyleAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected CSSTextToken[] correctMeaningToken(CSSTextToken[] src) {
-		java.util.ArrayList list = new java.util.ArrayList();
-		for (int i = 0; i < src.length; i++) {
-			if (src[i].kind != CSSRegionContexts.CSS_S && src[i].kind != CSSRegionContexts.CSS_DECLARATION_VALUE_S && src[i].kind != CSSRegionContexts.CSS_COMMENT)
-				list.add(src[i]);
-		}
-		CSSTextToken[] ret = new CSSTextToken[list.size()];
-		list.toArray(ret);
-		return ret;
-	}
-
-	/**
-	 * 
-	 */
-	public String get(ICSS2Properties properties) {
-		String str = null;
-		Object obj = properties.get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION));
-		if (obj != null) {
-			PropCMProperty propX = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X);
-			PropCMProperty propY = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y);
-			if (obj instanceof ICSSValueList) {
-				ICSSValueList list = (ICSSValueList) obj;
-				ICSSValue value = (ICSSValue) list.item(0);
-				if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
-					ICSSPrimitiveValue prim = (ICSSPrimitiveValue) value;
-					if (prim.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
-						// check not top or bottom
-						if (!propX.canHave(prim.getStringValue()) && propY.canHave(prim.getStringValue())) {
-							// case order is vertical -> horizontal
-							value = (ICSSValue) list.item(1);
-						}
-					}
-				}
-				str = value.getCSSValueText();
-			}
-			else if (obj instanceof ICSSValue) {
-				str = ((ICSSValue) obj).getCSSValueText();
-				if (str.equalsIgnoreCase(IValID.V_BOTTOM) || str.equalsIgnoreCase(IValID.V_TOP))
-					str = "";//$NON-NLS-1$
-			}
-			else {
-				str = obj.toString();
-				CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, str);
-				CSSTextToken[] tokens = parser.getTokens();
-
-				tokens = correctMeaningToken(tokens);
-				if (tokens.length == 0)
-					str = "";//$NON-NLS-1$
-				else if (tokens.length == 1 && (tokens[0].image.equalsIgnoreCase(IValID.V_BOTTOM) || tokens[0].image.equalsIgnoreCase(IValID.V_TOP)))
-					str = "";//$NON-NLS-1$
-				else
-					str = tokens[0].image;
-			}
-		}
-		return (str != null) ? str : "";//$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 */
-	public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
-		String newValue = null;
-		String valH = value;
-		String valV = properties.getBackgroundPositionY();
-		if (valV == null || valV.length() == 0)
-			newValue = valH;
-		else if (valH == null || valH.length() == 0) {
-			Collection valX = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X).getValues();
-			Collection valY = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y).getValues();
-			PropCMUtil.minus(valY, valX);
-			Iterator it = valY.iterator();
-			while (it.hasNext()) {
-				Object obj = it.next();
-				if (obj.toString().equals(valV.toLowerCase())) {
-					// need not compensate for ...
-					newValue = valV;
-					break;
-				}
-			}
-			// compensate for Horizontal value
-			if (newValue == null) {
-				// check valV is length or not
-				CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, valV.trim());
-				CSSTextToken[] tokens = parser.getTokens();
-				if (tokens != null && tokens.length > 0 && tokens[0].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-					newValue = IValID.V_LEFT + " " + valV;//$NON-NLS-1$
-				}
-				else
-					newValue = "0% " + valV;//$NON-NLS-1$
-			}
-		}
-		else
-			newValue = valH + " " + valV;//$NON-NLS-1$
-		properties.setBackgroundPosition(newValue);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionYSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionYSubStyleAdapter.java
deleted file mode 100644
index bb9e9a7..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionYSubStyleAdapter.java
+++ /dev/null
@@ -1,150 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.contentmodel.IValID;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMSubProperty;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValueList;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- * for vertical value of 'background-position'
- */
-public class BackgroundPositionYSubStyleAdapter implements ISubPropertyAdapter {
-
-	/**
-	 * 
-	 */
-	public BackgroundPositionYSubStyleAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	protected CSSTextToken[] correctMeaningToken(CSSTextToken[] src) {
-		java.util.ArrayList list = new java.util.ArrayList();
-		for (int i = 0; i < src.length; i++) {
-			if (src[i].kind != CSSRegionContexts.CSS_S && src[i].kind != CSSRegionContexts.CSS_DECLARATION_VALUE_S && src[i].kind != CSSRegionContexts.CSS_COMMENT)
-				list.add(src[i]);
-		}
-		CSSTextToken[] ret = new CSSTextToken[list.size()];
-		list.toArray(ret);
-		return ret;
-	}
-
-	/**
-	 * 
-	 */
-	public String get(ICSS2Properties properties) {
-		String str = null;
-		Object obj = properties.get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION));
-		if (obj != null) {
-			PropCMProperty propX = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X);
-			PropCMProperty propY = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y);
-			if (obj instanceof ICSSValueList) {
-				ICSSValueList list = (ICSSValueList) obj;
-				int index = 1;
-				ICSSValue value = (ICSSValue) list.item(0);
-				if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
-					ICSSPrimitiveValue prim = (ICSSPrimitiveValue) value;
-					if (prim.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
-						// check not top or bottom
-						if (!propX.canHave(prim.getStringValue()) && propY.canHave(prim.getStringValue())) {
-							// case order is vertical -> horizontal
-							index = 0;
-						}
-					}
-				}
-				str = ((ICSSValue) list.item(index)).getCSSValueText();
-			}
-			else if (obj instanceof ICSSValue) {
-				str = ((ICSSValue) obj).getCSSValueText();
-				if (!str.equalsIgnoreCase(IValID.V_BOTTOM) && !str.equalsIgnoreCase(IValID.V_TOP))
-					str = "";//$NON-NLS-1$
-			}
-			else {
-				str = obj.toString();
-				CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, str);
-				CSSTextToken[] tokens = parser.getTokens();
-
-				tokens = correctMeaningToken(tokens);
-				if (tokens.length == 1 && (tokens[0].image.equalsIgnoreCase(IValID.V_BOTTOM) || tokens[0].image.equalsIgnoreCase(IValID.V_TOP)))
-					str = tokens[0].image;
-				else if (tokens.length > 1)
-					str = tokens[1].image;
-				else
-					str = "";//$NON-NLS-1$
-			}
-		}
-		return (str != null) ? str : "";//$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 */
-	public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
-		String newValue = null;
-		String valH = properties.getBackgroundPositionX();
-		String valV = value;
-		if (valH != null && (valH.trim().equals("0%") /* default value */|| //$NON-NLS-1$
-					valH.trim().equalsIgnoreCase(IValID.V_LEFT) /*
-																 * another
-																 * default
-																 * value
-																 */))
-			valH = null;
-		if (valV == null || valV.length() == 0)
-			newValue = valH;
-		else if (valH == null || valH.length() == 0) {
-			Collection valX = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X).getValues();
-			Collection valY = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y).getValues();
-			PropCMUtil.minus(valY, valX);
-			Iterator it = valY.iterator();
-			while (it.hasNext()) {
-				Object obj = it.next();
-				if (obj.toString().equals(valV.toLowerCase())) {
-					// need not compensate for ...
-					newValue = valV;
-					break;
-				}
-			}
-			// compensate for Horizontal value
-			if (newValue == null) {
-				// check valV is length or not
-				CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, valV.trim());
-				CSSTextToken[] tokens = parser.getTokens();
-				if (tokens != null && tokens.length > 0 && tokens[0].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-					newValue = IValID.V_LEFT + " " + valV;//$NON-NLS-1$
-				}
-				else
-					newValue = "0% " + valV;//$NON-NLS-1$
-			}
-		}
-		else
-			newValue = valH + " " + valV;//$NON-NLS-1$
-		properties.setBackgroundPosition(newValue);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundShorthandAdapter.java
deleted file mode 100644
index d9b5fe6..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundShorthandAdapter.java
+++ /dev/null
@@ -1,179 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'background' property 'background' will be expanded to
- * 'background-attachment', 'background-color', 'background-image',
- * 'background-position', 'background-repeat',
- */
-public class BackgroundShorthandAdapter implements IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	public BackgroundShorthandAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public boolean expand(String source, CSSPropertyContext dest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return false;
-		}
-		String color = "", image = "", repeat = "", attach = "", pos = "";//$NON-NLS-5$//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-		PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR);
-		PropCMProperty propImage = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE);
-		PropCMProperty propRepeat = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT);
-		PropCMProperty propAttach = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT);
-		PropCMProperty propPos = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propColor.canHave(tokens[i].image))
-					color = tokens[i].image;
-				else if (propImage.canHave(tokens[i].image))
-					image = tokens[i].image;
-				else if (propRepeat.canHave(tokens[i].image))
-					repeat = tokens[i].image;
-				else if (propAttach.canHave(tokens[i].image))
-					attach = tokens[i].image;
-				else if (propPos.canHave(tokens[i].image)) {
-					if (pos == null || pos.length() <= 0)
-						pos = tokens[i].image;
-					else
-						pos = pos + " " + tokens[i].image;//$NON-NLS-1$
-				}
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE) {
-				if (pos == null || pos.length() <= 0)
-					pos = tokens[i].image;
-				else
-					pos = pos + " " + tokens[i].image;//$NON-NLS-1$
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_URI) {
-				image = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-				color = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				color = buf.toString();
-			}
-		}
-
-		dest.set(propColor.getName(), color);
-		dest.set(propImage.getName(), image);
-		dest.set(propRepeat.getName(), repeat);
-		dest.set(propAttach.getName(), attach);
-		dest.set(propPos.getName(), pos);
-
-		return true;
-	}
-
-	/**
-	 * 
-	 */
-	public String extract(String source, PropCMProperty propDest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return null;
-		}
-		String color = null, image = null, repeat = null, attach = null, pos = null;
-		PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR);
-		PropCMProperty propImage = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE);
-		PropCMProperty propRepeat = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT);
-		PropCMProperty propAttach = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT);
-		PropCMProperty propPos = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propColor.canHave(tokens[i].image))
-					color = tokens[i].image;
-				else if (propImage.canHave(tokens[i].image))
-					image = tokens[i].image;
-				else if (propRepeat.canHave(tokens[i].image))
-					repeat = tokens[i].image;
-				else if (propAttach.canHave(tokens[i].image))
-					attach = tokens[i].image;
-				else if (propPos.canHave(tokens[i].image)) {
-					if (pos == null)
-						pos = tokens[i].image;
-					else
-						pos = pos + " " + tokens[i].image;//$NON-NLS-1$
-				}
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE) {
-				if (pos == null)
-					pos = tokens[i].image;
-				else
-					pos = pos + " " + tokens[i].image;//$NON-NLS-1$
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_URI) {
-				image = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-				color = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				color = buf.toString();
-			}
-		}
-
-		if (propColor == propDest)
-			return color;
-		else if (propImage == propDest)
-			return image;
-		else if (propRepeat == propDest)
-			return repeat;
-		else if (propAttach == propDest)
-			return attach;
-		else if (propPos == propDest)
-			return pos;
-		else
-			return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderBottomShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderBottomShorthandAdapter.java
deleted file mode 100644
index 09b505e..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderBottomShorthandAdapter.java
+++ /dev/null
@@ -1,140 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border-bottom' property 'border-bottom' will be expanded to
- * 'border-bottom-color', 'border-bottom-style', 'border-bottom-width',
- */
-public class BorderBottomShorthandAdapter implements IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	public BorderBottomShorthandAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public boolean expand(String source, CSSPropertyContext dest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return false;
-		}
-		String color = "", style = "", width = "";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-		PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR);
-		PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE);
-		PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propStyle.canHave(tokens[i].image))
-					style = tokens[i].image;
-				else if (propWidth.canHave(tokens[i].image))
-					width = tokens[i].image;
-				else if (propColor.canHave(tokens[i].image))
-					color = tokens[i].image;
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
-				width = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-				color = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				color = buf.toString();
-			}
-		}
-
-		dest.set(propColor.getName(), color);
-		dest.set(propStyle.getName(), style);
-		dest.set(propWidth.getName(), width);
-
-		return true;
-	}
-
-	/**
-	 * 
-	 */
-	public String extract(String source, PropCMProperty propDest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return null;
-		}
-		String color = null, style = null, width = null;
-		PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR);
-		PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE);
-		PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propStyle.canHave(tokens[i].image))
-					style = tokens[i].image;
-				else if (propWidth.canHave(tokens[i].image))
-					width = tokens[i].image;
-				else if (propColor.canHave(tokens[i].image))
-					color = tokens[i].image;
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
-				width = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-				color = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				color = buf.toString();
-			}
-		}
-
-		if (propColor == propDest)
-			return color;
-		else if (propStyle == propDest)
-			return style;
-		else if (propWidth == propDest)
-			return width;
-		else
-			return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderColorShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderColorShorthandAdapter.java
deleted file mode 100644
index e314007..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderColorShorthandAdapter.java
+++ /dev/null
@@ -1,158 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border-color' property 'border-color' will be expanded to
- * 'border-top-color', 'border-right-color', 'border-bottom-color',
- * 'border-left-color',
- */
-public class BorderColorShorthandAdapter implements IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	public BorderColorShorthandAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public boolean expand(String source, CSSPropertyContext dest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return false;
-		}
-		String[] idents = new String[4];
-		int j = 0;
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH)
-				idents[j++] = tokens[i].image;
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				idents[j++] = buf.toString();
-			}
-			if (j == 4)
-				break;
-		}
-
-		String[] dests = new String[4];
-		if (j == 0)
-			return true;
-		else if (j == 1) {
-			dests[0] = dests[1] = dests[2] = dests[3] = idents[0];
-		}
-		else if (j == 2) {
-			dests[0] = dests[2] = idents[0];
-			dests[1] = dests[3] = idents[1];
-		}
-		else if (j == 3) {
-			dests[0] = idents[0];
-			dests[1] = dests[3] = idents[1];
-			dests[2] = idents[2];
-		}
-		else {
-			for (int k = 0; k < 4; k++)
-				dests[k] = idents[k];
-		}
-		dest.set(PropCMProperty.P_BORDER_TOP_COLOR, dests[0]);
-		dest.set(PropCMProperty.P_BORDER_RIGHT_COLOR, dests[1]);
-		dest.set(PropCMProperty.P_BORDER_BOTTOM_COLOR, dests[2]);
-		dest.set(PropCMProperty.P_BORDER_LEFT_COLOR, dests[3]);
-
-		return true;
-	}
-
-	/**
-	 * 
-	 */
-	public String extract(String source, PropCMProperty propDest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return null;
-		}
-		String[] idents = new String[4];
-		int j = 0;
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH)
-				idents[j++] = tokens[i].image;
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				idents[j++] = buf.toString();
-			}
-			if (j == 4)
-				break;
-		}
-
-		if (j == 0)
-			return null;
-		else if (j == 1)
-			return idents[0];
-		else if (j == 2) {
-			if (propDest.getName() == PropCMProperty.P_BORDER_TOP_COLOR || propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_COLOR)
-				return idents[0];
-			else
-				return idents[1];
-		}
-		else if (j == 3) {
-			if (propDest.getName() == PropCMProperty.P_BORDER_TOP_COLOR)
-				return idents[0];
-			else if (propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_COLOR)
-				return idents[2];
-			else
-				return idents[1];
-		}
-		else {
-			if (propDest.getName() == PropCMProperty.P_BORDER_TOP_COLOR)
-				return idents[0];
-			else if (propDest.getName() == PropCMProperty.P_BORDER_RIGHT_COLOR)
-				return idents[1];
-			else if (propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_COLOR)
-				return idents[2];
-			else if (propDest.getName() == PropCMProperty.P_BORDER_LEFT_COLOR)
-				return idents[3];
-			else
-				return null;
-		}
-
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderLeftShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderLeftShorthandAdapter.java
deleted file mode 100644
index cbc7930..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderLeftShorthandAdapter.java
+++ /dev/null
@@ -1,140 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border-left' property 'border-left' will be expanded to
- * 'border-left-color', 'border-left-style', 'border-left-width',
- */
-public class BorderLeftShorthandAdapter implements IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	public BorderLeftShorthandAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public boolean expand(String source, CSSPropertyContext dest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return false;
-		}
-		String color = "", style = "", width = "";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-		PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR);
-		PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE);
-		PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propStyle.canHave(tokens[i].image))
-					style = tokens[i].image;
-				else if (propWidth.canHave(tokens[i].image))
-					width = tokens[i].image;
-				else if (propColor.canHave(tokens[i].image))
-					color = tokens[i].image;
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
-				width = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-				color = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				color = buf.toString();
-			}
-		}
-
-		dest.set(propColor.getName(), color);
-		dest.set(propStyle.getName(), style);
-		dest.set(propWidth.getName(), width);
-
-		return true;
-	}
-
-	/**
-	 * 
-	 */
-	public String extract(String source, PropCMProperty propDest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return null;
-		}
-		String color = null, style = null, width = null;
-		PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR);
-		PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE);
-		PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propStyle.canHave(tokens[i].image))
-					style = tokens[i].image;
-				else if (propWidth.canHave(tokens[i].image))
-					width = tokens[i].image;
-				else if (propColor.canHave(tokens[i].image))
-					color = tokens[i].image;
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
-				width = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-				color = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				color = buf.toString();
-			}
-		}
-
-		if (propColor == propDest)
-			return color;
-		else if (propStyle == propDest)
-			return style;
-		else if (propWidth == propDest)
-			return width;
-		else
-			return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderRightShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderRightShorthandAdapter.java
deleted file mode 100644
index d74e440..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderRightShorthandAdapter.java
+++ /dev/null
@@ -1,140 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border-right' property 'border-right' will be expanded to
- * 'border-right-color', 'border-right-style', 'border-right-width',
- */
-public class BorderRightShorthandAdapter implements IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	public BorderRightShorthandAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public boolean expand(String source, CSSPropertyContext dest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return false;
-		}
-		String color = "", style = "", width = "";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-		PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR);
-		PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE);
-		PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propStyle.canHave(tokens[i].image))
-					style = tokens[i].image;
-				else if (propWidth.canHave(tokens[i].image))
-					width = tokens[i].image;
-				else if (propColor.canHave(tokens[i].image))
-					color = tokens[i].image;
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
-				width = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-				color = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				color = buf.toString();
-			}
-		}
-
-		dest.set(propColor.getName(), color);
-		dest.set(propStyle.getName(), style);
-		dest.set(propWidth.getName(), width);
-
-		return true;
-	}
-
-	/**
-	 * 
-	 */
-	public String extract(String source, PropCMProperty propDest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return null;
-		}
-		String color = null, style = null, width = null;
-		PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR);
-		PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE);
-		PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propStyle.canHave(tokens[i].image))
-					style = tokens[i].image;
-				else if (propWidth.canHave(tokens[i].image))
-					width = tokens[i].image;
-				else if (propColor.canHave(tokens[i].image))
-					color = tokens[i].image;
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
-				width = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-				color = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				color = buf.toString();
-			}
-		}
-
-		if (propColor == propDest)
-			return color;
-		else if (propStyle == propDest)
-			return style;
-		else if (propWidth == propDest)
-			return width;
-		else
-			return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderShorthandAdapter.java
deleted file mode 100644
index 6da3333..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderShorthandAdapter.java
+++ /dev/null
@@ -1,140 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border' property 'border' will be expanded to 'border-color',
- * 'border-style', 'border-width',
- */
-public class BorderShorthandAdapter implements IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	public BorderShorthandAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public boolean expand(String source, CSSPropertyContext dest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return false;
-		}
-		String color = "", style = "", width = "";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-		PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR);
-		PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE);
-		PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propStyle.canHave(tokens[i].image))
-					style = tokens[i].image;
-				else if (propWidth.canHave(tokens[i].image))
-					width = tokens[i].image;
-				else if (propColor.canHave(tokens[i].image))
-					color = tokens[i].image;
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
-				width = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-				color = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				color = buf.toString();
-			}
-		}
-
-		dest.set(propColor.getName(), color);
-		dest.set(propStyle.getName(), style);
-		dest.set(propWidth.getName(), width);
-
-		return true;
-	}
-
-	/**
-	 * 
-	 */
-	public String extract(String source, PropCMProperty propDest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return null;
-		}
-		String color = null, style = null, width = null;
-		PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR);
-		PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE);
-		PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propStyle.canHave(tokens[i].image))
-					style = tokens[i].image;
-				else if (propWidth.canHave(tokens[i].image))
-					width = tokens[i].image;
-				else if (propColor.canHave(tokens[i].image))
-					color = tokens[i].image;
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
-				width = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-				color = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				color = buf.toString();
-			}
-		}
-
-		if (propColor == propDest)
-			return color;
-		else if (propStyle == propDest)
-			return style;
-		else if (propWidth == propDest)
-			return width;
-		else
-			return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderStyleShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderStyleShorthandAdapter.java
deleted file mode 100644
index b5fb962..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderStyleShorthandAdapter.java
+++ /dev/null
@@ -1,130 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border-style' property 'border-style' will be expanded to
- * 'border-top-style', 'border-right-style', 'border-bottom-style',
- * 'border-left-style',
- */
-public class BorderStyleShorthandAdapter implements IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	public BorderStyleShorthandAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public boolean expand(String source, CSSPropertyContext dest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return false;
-		}
-		String[] idents = new String[4];
-		int j = 0;
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT)
-				idents[j++] = tokens[i].image;
-			if (j == 4)
-				break;
-		}
-
-		String[] dests = new String[4];
-		if (j == 0)
-			return true;
-		else if (j == 1) {
-			dests[0] = dests[1] = dests[2] = dests[3] = idents[0];
-		}
-		else if (j == 2) {
-			dests[0] = dests[2] = idents[0];
-			dests[1] = dests[3] = idents[1];
-		}
-		else if (j == 3) {
-			dests[0] = idents[0];
-			dests[1] = dests[3] = idents[1];
-			dests[2] = idents[2];
-		}
-		else {
-			for (int k = 0; k < 4; k++)
-				dests[k] = idents[k];
-		}
-		dest.set(PropCMProperty.P_BORDER_TOP_STYLE, dests[0]);
-		dest.set(PropCMProperty.P_BORDER_RIGHT_STYLE, dests[1]);
-		dest.set(PropCMProperty.P_BORDER_BOTTOM_STYLE, dests[2]);
-		dest.set(PropCMProperty.P_BORDER_LEFT_STYLE, dests[3]);
-
-		return true;
-	}
-
-	/**
-	 * 
-	 */
-	public String extract(String source, PropCMProperty propDest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return null;
-		}
-		String[] idents = new String[4];
-		int j = 0;
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT)
-				idents[j++] = tokens[i].image;
-			if (j == 4)
-				break;
-		}
-
-		if (j == 0)
-			return null;
-		else if (j == 1)
-			return idents[0];
-		else if (j == 2) {
-			if (propDest.getName() == PropCMProperty.P_BORDER_TOP_STYLE || propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_STYLE)
-				return idents[0];
-			else
-				return idents[1];
-		}
-		else if (j == 3) {
-			if (propDest.getName() == PropCMProperty.P_BORDER_TOP_STYLE)
-				return idents[0];
-			else if (propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_STYLE)
-				return idents[2];
-			else
-				return idents[1];
-		}
-		else {
-			if (propDest.getName() == PropCMProperty.P_BORDER_TOP_STYLE)
-				return idents[0];
-			else if (propDest.getName() == PropCMProperty.P_BORDER_RIGHT_STYLE)
-				return idents[1];
-			else if (propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_STYLE)
-				return idents[2];
-			else if (propDest.getName() == PropCMProperty.P_BORDER_LEFT_STYLE)
-				return idents[3];
-			else
-				return null;
-		}
-
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderTopShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderTopShorthandAdapter.java
deleted file mode 100644
index a728399..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderTopShorthandAdapter.java
+++ /dev/null
@@ -1,140 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border-top' property 'border-top' will be expanded to
- * 'border-top-color', 'border-top-style', 'border-top-width',
- */
-public class BorderTopShorthandAdapter implements IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	public BorderTopShorthandAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public boolean expand(String source, CSSPropertyContext dest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return false;
-		}
-		String color = "", style = "", width = "";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-		PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR);
-		PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE);
-		PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propStyle.canHave(tokens[i].image))
-					style = tokens[i].image;
-				else if (propWidth.canHave(tokens[i].image))
-					width = tokens[i].image;
-				else if (propColor.canHave(tokens[i].image))
-					color = tokens[i].image;
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
-				width = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-				color = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				color = buf.toString();
-			}
-		}
-
-		dest.set(propColor.getName(), color);
-		dest.set(propStyle.getName(), style);
-		dest.set(propWidth.getName(), width);
-
-		return true;
-	}
-
-	/**
-	 * 
-	 */
-	public String extract(String source, PropCMProperty propDest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return null;
-		}
-		String color = null, style = null, width = null;
-		PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR);
-		PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE);
-		PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propStyle.canHave(tokens[i].image))
-					style = tokens[i].image;
-				else if (propWidth.canHave(tokens[i].image))
-					width = tokens[i].image;
-				else if (propColor.canHave(tokens[i].image))
-					color = tokens[i].image;
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
-				width = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
-				color = tokens[i].image;
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				StringBuffer buf = new StringBuffer();
-				while (i < tokens.length) {
-					if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
-						i++;
-						continue;
-					}
-					buf.append(tokens[i].image);
-					if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-						break;
-				}
-				i--;
-				color = buf.toString();
-			}
-		}
-
-		if (propColor == propDest)
-			return color;
-		else if (propStyle == propDest)
-			return style;
-		else if (propWidth == propDest)
-			return width;
-		else
-			return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderWidthShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderWidthShorthandAdapter.java
deleted file mode 100644
index cda09e6..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderWidthShorthandAdapter.java
+++ /dev/null
@@ -1,130 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border-width' property 'border-width' will be expanded to
- * 'border-top-width', 'border-right-width', 'border-bottom-width',
- * 'border-left-width',
- */
-public class BorderWidthShorthandAdapter implements IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	public BorderWidthShorthandAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public boolean expand(String source, CSSPropertyContext dest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return false;
-		}
-		String[] idents = new String[4];
-		int j = 0;
-		for (int i = 0; i < tokens.length; i++) {
-			if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT)
-				idents[j++] = tokens[i].image;
-			if (j == 4)
-				break;
-		}
-
-		String[] dests = new String[4];
-		if (j == 0)
-			return true;
-		else if (j == 1) {
-			dests[0] = dests[1] = dests[2] = dests[3] = idents[0];
-		}
-		else if (j == 2) {
-			dests[0] = dests[2] = idents[0];
-			dests[1] = dests[3] = idents[1];
-		}
-		else if (j == 3) {
-			dests[0] = idents[0];
-			dests[1] = dests[3] = idents[1];
-			dests[2] = idents[2];
-		}
-		else {
-			for (int k = 0; k < 4; k++)
-				dests[k] = idents[k];
-		}
-		dest.set(PropCMProperty.P_BORDER_TOP_WIDTH, dests[0]);
-		dest.set(PropCMProperty.P_BORDER_RIGHT_WIDTH, dests[1]);
-		dest.set(PropCMProperty.P_BORDER_BOTTOM_WIDTH, dests[2]);
-		dest.set(PropCMProperty.P_BORDER_LEFT_WIDTH, dests[3]);
-
-		return true;
-	}
-
-	/**
-	 * 
-	 */
-	public String extract(String source, PropCMProperty propDest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return null;
-		}
-		String[] idents = new String[4];
-		int j = 0;
-		for (int i = 0; i < tokens.length; i++) {
-			if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT)
-				idents[j++] = tokens[i].image;
-			if (j == 4)
-				break;
-		}
-
-		if (j == 0)
-			return null;
-		else if (j == 1)
-			return idents[0];
-		else if (j == 2) {
-			if (propDest.getName() == PropCMProperty.P_BORDER_TOP_WIDTH || propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_WIDTH)
-				return idents[0];
-			else
-				return idents[1];
-		}
-		else if (j == 3) {
-			if (propDest.getName() == PropCMProperty.P_BORDER_TOP_WIDTH)
-				return idents[0];
-			else if (propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_WIDTH)
-				return idents[2];
-			else
-				return idents[1];
-		}
-		else {
-			if (propDest.getName() == PropCMProperty.P_BORDER_TOP_WIDTH)
-				return idents[0];
-			else if (propDest.getName() == PropCMProperty.P_BORDER_RIGHT_WIDTH)
-				return idents[1];
-			else if (propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_WIDTH)
-				return idents[2];
-			else if (propDest.getName() == PropCMProperty.P_BORDER_LEFT_WIDTH)
-				return idents[3];
-			else
-				return null;
-		}
-
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/CSSPropertyContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/CSSPropertyContext.java
deleted file mode 100644
index 1b40706..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/CSSPropertyContext.java
+++ /dev/null
@@ -1,2997 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMSubProperty;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- * 
- */
-public class CSSPropertyContext implements ICSS2Properties {
-
-	protected Hashtable fProperties = new Hashtable();
-	HashSet fModified = null;
-	private static java.util.Hashtable subPropertyAdapters;
-	private static java.util.Hashtable shorthandAdapters;
-
-	/**
-	 * 
-	 */
-	public CSSPropertyContext() {
-		super();
-		initShorthandAdapters();
-		initSubPropertyAdapters();
-	}
-
-	/**
-	 * 
-	 */
-	public CSSPropertyContext(ICSSStyleDeclaration decl) {
-		super();
-		initShorthandAdapters();
-		initSubPropertyAdapters();
-		initialize(decl);
-	}
-
-	/**
-	 * This function exports all property/value pairs to 'decl' declaration
-	 */
-	public void applyFull(ICSSStyleDeclaration decl) {
-		if (decl == null)
-			return;
-		Enumeration keys = fProperties.keys();
-		while (keys.hasMoreElements()) {
-			Object key = keys.nextElement();
-			Object val = fProperties.get(key);
-			String value = (val instanceof ICSSValue) ? ((ICSSValue) val).getCSSValueText() : val.toString();
-
-			if (value == null || value.length() <= 0)
-				decl.removeProperty(key.toString());
-			else
-				decl.setProperty(key.toString(), value.trim(), (val instanceof ValueData && ((ValueData) val).important) ? "!important" : "");//$NON-NLS-2$//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * This function exports modified property/value pairs to 'decl'
-	 * declaration
-	 */
-	public void applyModified(ICSSStyleDeclaration decl) {
-		if (decl == null || fModified == null)
-			return;
-		Iterator it = fModified.iterator();
-		while (it.hasNext()) {
-			Object key = it.next();
-			Object val = fProperties.get(key);
-			String value = (val instanceof ICSSValue) ? ((ICSSValue) val).getCSSValueText() : ((val != null) ? val.toString() : null);
-
-			if (value == null || value.length() <= 0)
-				decl.removeProperty(key.toString());
-			else
-				decl.setProperty(key.toString(), value.trim(), (val instanceof ValueData && ((ValueData) val).important) ? "!important" : "");//$NON-NLS-2$//$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * create clone of this context
-	 */
-	public Object clone() {
-		CSSPropertyContext clone = new CSSPropertyContext();
-		if (this.fModified != null)
-			clone.fModified = (HashSet) this.fModified.clone();
-		else
-			clone.fModified = null;
-		clone.fProperties = (Hashtable) this.fProperties.clone();
-		return clone;
-	}
-
-	/**
-	 * This function expands a short-hand property's value to each leaf
-	 * property's value and set them to 'foreign'
-	 * 
-	 * For example, given [prop=border-top, value="solid 1px yellow"] will be
-	 * expanded to [border-top-color=yellow, border-top-style=solid,
-	 * border-top-width=1px] and they are stored to 'foreign' context.
-	 * 
-	 * Note that recursively shorthanded property like 'border' will be
-	 * expanded to all descendant leaf properties like
-	 * 'border-[top/right/bottom/left]-[color/style/width]'
-	 * 
-	 * @param prop
-	 *            org.eclipse.wst.css.core.contentmodel.PropCMProperty
-	 * @param value
-	 *            java.lang.String
-	 * @param foreign
-	 *            org.eclipse.wst.css.core.util.declaration.CSSPropertyContext
-	 */
-	protected static void expandToLeaf(PropCMProperty prop, String value, CSSPropertyContext foreign) {
-		// expand shorthand property
-		if (value != null && value.trim().length() > 0) {
-			IShorthandAdapter adapter = (IShorthandAdapter) shorthandAdapters.get(prop);
-			if (adapter != null) {
-				adapter.expand(value, foreign);
-				foreign.set(prop.getName(), "");//$NON-NLS-1$
-				for (int i = 0; i < prop.getNumChild(); i++) {
-					Object obj = prop.getChildAt(i);
-					if (obj instanceof PropCMProperty && !(obj instanceof PropCMSubProperty)) {
-						PropCMProperty expandedProp = (PropCMProperty) obj;
-						value = foreign.get(expandedProp.getName());
-						expandToLeaf(expandedProp, value, foreign);
-					}
-				}
-			}
-			else if (!value.equals(foreign.get(prop.getName()))) {
-				foreign.set(prop.getName(), value);
-			}
-		}
-	}
-
-	/**
-	 * This function returns value of 'prop'. Querying value mechanism checks
-	 * short-hand properties.
-	 * 
-	 * For example, given "background=fixed white" is set in this insatnce and
-	 * param "prop=background-color", the return value will be "white".
-	 * 
-	 */
-	public java.lang.String get(org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty prop) {
-		if (prop instanceof PropCMSubProperty) {
-			ISubPropertyAdapter adapter = (ISubPropertyAdapter) subPropertyAdapters.get(prop.getName());
-			if (adapter != null)
-				return adapter.get(this);
-		}
-		String str = get(prop.getName());
-		if ((str == null || str.length() == 0) && prop.getShorthandContainerCount() > 0) {
-			// get expanded property
-			for (int i = 0; i < prop.getShorthandContainerCount(); i++) {
-				PropCMProperty propParent = prop.shorthandContainerAt(i);
-				String strParent = get(propParent);
-				if (strParent != null && strParent.trim().length() > 0) {
-					IShorthandAdapter adapter = (IShorthandAdapter) shorthandAdapters.get(propParent);
-					if (adapter != null) {
-						String extractedValue = adapter.extract(strParent, prop);
-						return (extractedValue != null) ? extractedValue : "";//$NON-NLS-1$
-					}
-				}
-			}
-		}
-		return str;
-	}
-
-	/**
-	 * This function returns value of 'prop'. Querying value mechanism does
-	 * not care shorthand properties.
-	 */
-	protected String get(String propName) {
-		String str = null;
-		Object obj = fProperties.get(propName);
-		if (obj != null) {
-			if (obj instanceof ICSSValue)
-				str = ((ICSSValue) obj).getCSSValueText();
-			else
-				str = obj.toString();
-		}
-		return (str != null) ? str : "";//$NON-NLS-1$
-	}
-
-	/**
-	 * See the azimuth property definition in CSS2.
-	 * 
-	 * @exception org.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getAzimuth() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_AZIMUTH));
-	}
-
-	/**
-	 * See the background property definition in CSS2.
-	 * 
-	 * @exception org.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBackground() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG));
-	}
-
-	/**
-	 * See the background-attachment property definition in CSS2.
-	 * 
-	 * @exception org.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBackgroundAttachment() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT));
-	}
-
-	/**
-	 * See the background-color property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBackgroundColor() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR));
-	}
-
-	/**
-	 * See the background-image property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBackgroundImage() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE));
-	}
-
-	/**
-	 * See the background-position property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBackgroundPosition() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION));
-	}
-
-	/**
-	 * 
-	 */
-	public java.lang.String getBackgroundPositionX() {
-		return get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X));
-		/*
-		 * String str = null; Object obj =
-		 * fProperties.get(PropCMProperty.P_BG_POSITION); if (obj != null) {
-		 * PropCMProperty propX =
-		 * PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X);
-		 * PropCMProperty propY =
-		 * PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y);
-		 * if (obj instanceof ICSSValueList) { ICSSValueList list =
-		 * (ICSSValueList) obj; ICSSValue value = (ICSSValue) list.item(0); if
-		 * (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
-		 * ICSSPrimitiveValue prim = (ICSSPrimitiveValue) value; if
-		 * (prim.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) { // check
-		 * not top or bottom if (!propX.canHave(prim.getStringValue()) &&
-		 * propY.canHave(prim.getStringValue())) { // case order is vertical ->
-		 * horizontal value = (ICSSValue) list.item(1); } } } str =
-		 * value.getCSSValueText(); } else if (obj instanceof ICSSValue) { str =
-		 * ((ICSSValue)obj).getCSSValueText(); } else str = obj.toString(); }
-		 * return (str != null) ? str : "";
-		 */
-	}
-
-	/**
-	 * 
-	 */
-	public java.lang.String getBackgroundPositionY() {
-		return get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y));
-		/*
-		 * String str = null; Object obj =
-		 * fProperties.get(PropCMProperty.P_BG_POSITION); if (obj != null) {
-		 * PropCMProperty propX =
-		 * PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X);
-		 * PropCMProperty propY =
-		 * PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y);
-		 * if (obj instanceof ICSSValueList) { ICSSValueList list =
-		 * (ICSSValueList) obj; int index = 1; ICSSValue value = (ICSSValue)
-		 * list.item(0); if (value.getCssValueType() ==
-		 * CSSValue.CSS_PRIMITIVE_VALUE) { ICSSPrimitiveValue prim =
-		 * (ICSSPrimitiveValue) value; if (prim.getPrimitiveType() ==
-		 * CSSPrimitiveValue.CSS_IDENT) { // check not top or bottom if
-		 * (!propX.canHave(prim.getStringValue()) &&
-		 * propY.canHave(prim.getStringValue())) { // case order is vertical ->
-		 * horizontal index = 0; } } } str =
-		 * ((ICSSValue)list.item(index)).getCSSValueText(); } else if (obj
-		 * instanceof ICSSValue) { // do nothing --- value is null } else str =
-		 * obj.toString(); } return (str != null) ? str : "";
-		 */
-	}
-
-	/**
-	 * See the background-repeat property definition in CSS2.
-	 * 
-	 * @exception org.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBackgroundRepeat() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT));
-	}
-
-	/**
-	 * See the border property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorder() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER));
-	}
-
-	/**
-	 * See the border-bottom property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderBottom() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM));
-	}
-
-	/**
-	 * See the border-bottom-color property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderBottomColor() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR));
-	}
-
-	/**
-	 * See the border-bottom-style property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderBottomStyle() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE));
-	}
-
-	/**
-	 * See the border-bottom-width property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderBottomWidth() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH));
-	}
-
-	/**
-	 * See the border-collapse property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderCollapse() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLLAPSE));
-	}
-
-	/**
-	 * See the border-color property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderColor() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR));
-	}
-
-	/**
-	 * See the border-left property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderLeft() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT));
-	}
-
-	/**
-	 * See the border-left-color property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderLeftColor() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR));
-	}
-
-	/**
-	 * See the border-left-style property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderLeftStyle() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE));
-	}
-
-	/**
-	 * See the border-left-width property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderLeftWidth() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH));
-	}
-
-	/**
-	 * See the border-right property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderRight() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT));
-	}
-
-	/**
-	 * See the border-right-color property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderRightColor() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR));
-	}
-
-	/**
-	 * See the border-right-style property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderRightStyle() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE));
-	}
-
-	/**
-	 * See the border-right-width property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderRightWidth() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH));
-	}
-
-	/**
-	 * See the border-spacing property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderSpacing() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_SPACING));
-	}
-
-	/**
-	 * See the border-style property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderStyle() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE));
-	}
-
-	/**
-	 * See the border-top property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderTop() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP));
-	}
-
-	/**
-	 * See the border-top-color property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderTopColor() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR));
-	}
-
-	/**
-	 * See the border-top-style property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderTopStyle() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE));
-	}
-
-	/**
-	 * See the border-top-width property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderTopWidth() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH));
-	}
-
-	/**
-	 * See the border-width property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBorderWidth() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH));
-	}
-
-	/**
-	 * See the bottom property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getBottom() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_BOTTOM));
-	}
-
-	/**
-	 * See the caption-side property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getCaptionSide() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CAPTION_SIDE));
-	}
-
-	/**
-	 * See the clear property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getClear() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CLEAR));
-	}
-
-	/**
-	 * See the clip property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getClip() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
-	}
-
-	/**
-	 * 
-	 */
-	public String getClipBottom() {
-		return get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_BOTTOM));
-	}
-
-	/**
-	 * 
-	 */
-	public String getClipLeft() {
-		return get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_LEFT));
-	}
-
-	/**
-	 * 
-	 */
-	public String getClipRight() {
-		return get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_RIGHT));
-	}
-
-	/**
-	 * 
-	 */
-	public String getClipTop() {
-		return get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_TOP));
-	}
-
-	/**
-	 * See the color property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getColor() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_COLOR));
-	}
-
-	/**
-	 * See the content property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getContent() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CONTENT));
-	}
-
-	/**
-	 * See the counter-increment property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getCounterIncrement() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_INCREMENT));
-	}
-
-	/**
-	 * See the counter-reset property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getCounterReset() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_RESET));
-	}
-
-	/**
-	 * See the float property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getCssFloat() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FLOAT));
-	}
-
-	/**
-	 * See the cue property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getCue() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE));
-	}
-
-	/**
-	 * See the cue-after property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getCueAfter() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_AFTER));
-	}
-
-	/**
-	 * See the cue-before property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getCueBefore() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_BEFORE));
-	}
-
-	/**
-	 * See the cursor property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getCursor() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_CURSOR));
-	}
-
-	/**
-	 * See the direction property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getDirection() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_DIRECTION));
-	}
-
-	/**
-	 * See the display property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getDisplay() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_DISPLAY));
-	}
-
-	/**
-	 * See the elevation property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getElevation() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_ELEVATION));
-	}
-
-	/**
-	 * See the empty-cells property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getEmptyCells() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_EMPTY_CELLS));
-	}
-
-	/**
-	 * See the font property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getFont() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT));
-	}
-
-	/**
-	 * See the font-family property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getFontFamily() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_FAMILY));
-	}
-
-	/**
-	 * See the font-size property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getFontSize() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE));
-	}
-
-	/**
-	 * See the font-size-adjust property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getFontSizeAdjust() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE_ADJUST));
-	}
-
-	/**
-	 * See the font-stretch property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getFontStretch() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STRETCH));
-	}
-
-	/**
-	 * See the font-style property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getFontStyle() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE));
-	}
-
-	/**
-	 * See the font-variant property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getFontVariant() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT));
-	}
-
-	/**
-	 * See the font-weight property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getFontWeight() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT));
-	}
-
-	/**
-	 * See the height property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getHeight() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_HEIGHT));
-	}
-
-	/**
-	 * See the left property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getLeft() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LEFT));
-	}
-
-	/**
-	 * See the letter-spacing property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getLetterSpacing() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LETTER_SPACING));
-	}
-
-	/**
-	 * See the line-height property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getLineHeight() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LINE_HEIGHT));
-	}
-
-	/**
-	 * See the list-style property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getListStyle() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE));
-	}
-
-	/**
-	 * See the list-style-image property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getListStyleImage() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE));
-	}
-
-	/**
-	 * See the list-style-position property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getListStylePosition() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION));
-	}
-
-	/**
-	 * See the list-style-type property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getListStyleType() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE));
-	}
-
-	/**
-	 * See the margin property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getMargin() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN));
-	}
-
-	/**
-	 * See the margin-bottom property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getMarginBottom() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_BOTTOM));
-	}
-
-	/**
-	 * See the margin-left property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getMarginLeft() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_LEFT));
-	}
-
-	/**
-	 * See the margin-right property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getMarginRight() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_RIGHT));
-	}
-
-	/**
-	 * See the margin-top property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getMarginTop() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_TOP));
-	}
-
-	/**
-	 * See the marker-offset property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getMarkerOffset() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARKER_OFFSET));
-	}
-
-	/**
-	 * See the marks property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getMarks() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MARKS));
-	}
-
-	/**
-	 * See the max-height property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getMaxHeight() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_HEIGHT));
-	}
-
-	/**
-	 * See the max-width property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getMaxWidth() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_WIDTH));
-	}
-
-	/**
-	 * See the min-height property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getMinHeight() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_HEIGHT));
-	}
-
-	/**
-	 * See the min-width property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getMinWidth() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_WIDTH));
-	}
-
-	/**
-	 * See the orphans property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getOrphans() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_ORPHANS));
-	}
-
-	/**
-	 * See the outline property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getOutline() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE));
-	}
-
-	/**
-	 * See the outline-color property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getOutlineColor() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_COLOR));
-	}
-
-	/**
-	 * See the outline-style property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getOutlineStyle() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_STYLE));
-	}
-
-	/**
-	 * See the outline-width property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getOutlineWidth() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_WIDTH));
-	}
-
-	/**
-	 * See the overflow property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getOverflow() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_OVERFLOW));
-	}
-
-	/**
-	 * See the padding property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPadding() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING));
-	}
-
-	/**
-	 * See the padding-bottom property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPaddingBottom() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_BOTTOM));
-	}
-
-	/**
-	 * See the padding-left property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPaddingLeft() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_LEFT));
-	}
-
-	/**
-	 * See the padding-right property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPaddingRight() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_RIGHT));
-	}
-
-	/**
-	 * See the padding-top property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPaddingTop() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_TOP));
-	}
-
-	/**
-	 * See the page property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPage() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE));
-	}
-
-	/**
-	 * See the page-break-after property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPageBreakAfter() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_AFTER));
-	}
-
-	/**
-	 * See the page-break-before property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPageBreakBefore() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_BEFORE));
-	}
-
-	/**
-	 * See the page-break-inside property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPageBreakInside() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_INSIDE));
-	}
-
-	/**
-	 * See the pause property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPause() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE));
-	}
-
-	/**
-	 * See the pause-after property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPauseAfter() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_AFTER));
-	}
-
-	/**
-	 * See the pause-before property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPauseBefore() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_BEFORE));
-	}
-
-	/**
-	 * See the pitch property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPitch() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH));
-	}
-
-	/**
-	 * See the pitch-range property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPitchRange() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH_RANGE));
-	}
-
-	/**
-	 * See the play-during property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPlayDuring() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_PLAY_DURING));
-	}
-
-	/**
-	 * See the position property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getPosition() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_POSITION));
-	}
-
-	/**
-	 * See the quotes property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getQuotes() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_QUOTES));
-	}
-
-	/**
-	 * See the richness property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getRichness() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_RICHNESS));
-	}
-
-	/**
-	 * See the right property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getRight() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_RIGHT));
-	}
-
-	/**
-	 * @return org.eclipse.wst.css.core.util.declaration.IShorthandAdapter
-	 * @param org.eclipse.wst.css.core.contentmodel.PropCMProperty
-	 */
-	public static IShorthandAdapter getShorthandAdapter(PropCMProperty prop) {
-		return (IShorthandAdapter) shorthandAdapters.get(prop);
-	}
-
-	/**
-	 * See the size property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getSize() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_SIZE));
-	}
-
-	/**
-	 * See the speak property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getSpeak() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK));
-	}
-
-	/**
-	 * See the speak-header property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getSpeakHeader() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_HEADER));
-	}
-
-	/**
-	 * See the speak-numeral property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getSpeakNumeral() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_NUMERAL));
-	}
-
-	/**
-	 * See the speak-punctuation property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getSpeakPunctuation() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_PUNCTUATION));
-	}
-
-	/**
-	 * See the speech-rate property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getSpeechRate() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEECH_RATE));
-	}
-
-	/**
-	 * See the stress property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getStress() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_STRESS));
-	}
-
-	/**
-	 * See the table-layout property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getTableLayout() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TABLE_LAYOUT));
-	}
-
-	/**
-	 * See the text-align property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getTextAlign() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_ALIGN));
-	}
-
-	/**
-	 * See the text-decoration property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getTextDecoration() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_DECORATION));
-	}
-
-	/**
-	 * See the text-indent property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getTextIndent() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_INDENT));
-	}
-
-	/**
-	 * See the text-shadow property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getTextShadow() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_SHADOW));
-	}
-
-	/**
-	 * See the text-transform property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getTextTransform() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_TRANSFORM));
-	}
-
-	/**
-	 * See the top property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getTop() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_TOP));
-	}
-
-	/**
-	 * See the unicode-bidi property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getUnicodeBidi() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_UNICODE_BIDI));
-	}
-
-	/**
-	 * See the vertical-align property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getVerticalAlign() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_VERTICAL_ALIGN));
-	}
-
-	/**
-	 * See the visibility property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getVisibility() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_VISIBILITY));
-	}
-
-	/**
-	 * See the voice-family property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getVoiceFamily() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_VOICE_FAMILY));
-	}
-
-	/**
-	 * See the volume property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getVolume() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_VOLUME));
-	}
-
-	/**
-	 * See the white-space property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getWhiteSpace() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_WHITE_SPACE));
-	}
-
-	/**
-	 * See the widows property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getWidows() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_WIDOWS));
-	}
-
-	/**
-	 * See the width property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getWidth() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_WIDTH));
-	}
-
-	/**
-	 * See the word-spacing property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getWordSpacing() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_WORD_SPACING));
-	}
-
-	/**
-	 * See the z-index property definition in CSS2.
-	 * 
-	 * @exceptionorg.w3c.dom.DOMException
-	 *                SYNTAX_ERR: Raised if the new value has a syntax error
-	 *                and is unparsable. <br>
-	 *                NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
-	 *                readonly.
-	 */
-	public String getZIndex() {
-		return get(PropCMProperty.getInstanceOf(PropCMProperty.P_Z_INDEX));
-	}
-
-	/**
-	 * 
-	 */
-	public void initialize(ICSSStyleDeclaration decl) {
-		fProperties.clear();
-		if (fModified != null)
-			fModified.clear();
-		if (decl == null)
-			return;
-
-		int nProperties = decl.getLength();
-		for (int i = 0; i < nProperties; i++) {
-			String propName = decl.item(i);
-			if (propName != null) {
-				String propN = propName.trim().toLowerCase();
-				if (propN.length() != 0) {
-					CSSValue val = decl.getPropertyCSSValue(propName);
-					if (val != null)
-						fProperties.put(propN, val);
-				}
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	static void initShorthandAdapters() {
-		if (shorthandAdapters == null) {
-			shorthandAdapters = new Hashtable();
-			// register
-			shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BG), new BackgroundShorthandAdapter());
-			shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER), new BorderShorthandAdapter());
-			shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR), new BorderColorShorthandAdapter());
-			shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE), new BorderStyleShorthandAdapter());
-			shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH), new BorderWidthShorthandAdapter());
-			shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP), new BorderTopShorthandAdapter());
-			shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT), new BorderRightShorthandAdapter());
-			shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM), new BorderBottomShorthandAdapter());
-			shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT), new BorderLeftShorthandAdapter());
-			shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT), new FontShorthandAdapter());
-			shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE), new ListStyleShorthandAdapter());
-			shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN), new MarginShorthandAdapter());
-			shorthandAdapters.put(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING), new PaddingShorthandAdapter());
-
-		}
-	}
-
-	/**
-	 * 
-	 */
-	static void initSubPropertyAdapters() {
-		if (subPropertyAdapters == null) {
-			subPropertyAdapters = new Hashtable();
-
-			// register
-			subPropertyAdapters.put(PropCMSubProperty.PSUB_BG_POSITION_X, new BackgroundPositionXSubStyleAdapter());
-			subPropertyAdapters.put(PropCMSubProperty.PSUB_BG_POSITION_Y, new BackgroundPositionYSubStyleAdapter());
-			subPropertyAdapters.put(PropCMSubProperty.PSUB_CLIP_TOP, new ClipTopSubStyleAdapter());
-			subPropertyAdapters.put(PropCMSubProperty.PSUB_CLIP_RIGHT, new ClipRightSubStyleAdapter());
-			subPropertyAdapters.put(PropCMSubProperty.PSUB_CLIP_BOTTOM, new ClipBottomSubStyleAdapter());
-			subPropertyAdapters.put(PropCMSubProperty.PSUB_CLIP_LEFT, new ClipLeftSubStyleAdapter());
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public boolean isModified() {
-		return (fModified != null && fModified.size() != 0);
-	}
-
-	/**
-	 * 
-	 */
-	public Enumeration properties() {
-		return fProperties.keys();
-	}
-
-	/**
-	 * 
-	 */
-	public Iterator propertiesModified() {
-		if (fModified != null) {
-			return ((Collection) fModified.clone()).iterator();
-		}
-		else
-			return new Iterator() {
-				public boolean hasNext() {
-					return false;
-				}
-
-				public Object next() {
-					return null;
-				}
-
-				public void remove() {
-				}
-			};
-	}
-
-	/**
-	 * This function expands the value of shorthand 'prop' to 'foreign'
-	 * context. Note that if this has parent shorthand properties of 'prop',
-	 * they are all expanded to 'foreign' context.
-	 */
-	protected void recursiveExtract(PropCMProperty prop, CSSPropertyContext foreign) {
-		// expand shorthand property
-		for (int i = 0; i < prop.getShorthandContainerCount(); i++) {
-			recursiveExtract(prop.shorthandContainerAt(i), foreign);
-		}
-		String str = get(prop.getName());
-		if (str == null || str.trim().length() == 0)
-			str = foreign.get(prop.getName());
-		if (str != null && str.trim().length() > 0) {
-			IShorthandAdapter adapter = (IShorthandAdapter) shorthandAdapters.get(prop);
-			if (adapter != null) {
-				adapter.expand(str, foreign);
-				foreign.set(prop.getName(), "");//$NON-NLS-1$
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	protected void removeDescendants(PropCMProperty prop) {
-		if (prop.isShorthand()) {
-			// remove properties
-			int n = prop.getNumChild();
-			for (int i = 0; i < n; i++) {
-				Object obj = prop.getChildAt(i);
-				if (obj instanceof PropCMProperty) {
-					removeDescendants((PropCMProperty) obj);
-
-					String str = get(obj.toString());
-					if (str != null && str.length() > 0)
-						set(obj.toString(), "");//$NON-NLS-1$
-				}
-			}
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public void resetModified() {
-		if (fModified != null)
-			fModified.clear();
-	}
-
-	/**
-	 * This function sets the pair of 'prop'/'value'. If shorthand properties
-	 * related to 'prop' are already defined, they will be expanded to avoid
-	 * property confliction. If descendant properties of 'prop' are already
-	 * defined, they will be removed to avoid property confliction.
-	 * 
-	 */
-	public void set(org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty prop, java.lang.String value) throws org.w3c.dom.DOMException {
-		if (prop instanceof PropCMSubProperty) {
-			ISubPropertyAdapter adapter = (ISubPropertyAdapter) subPropertyAdapters.get(prop.getName());
-			if (adapter != null) {
-				adapter.set(this, value);
-				return;
-			}
-		}
-		if (prop.getShorthandContainerCount() > 0) {
-			// expand shorthand property
-			CSSPropertyContext context = new CSSPropertyContext();
-			for (int i = 0; i < prop.getShorthandContainerCount(); i++) {
-				recursiveExtract(prop.shorthandContainerAt(i), context);
-			}
-			Enumeration properties = context.properties();
-			while (properties.hasMoreElements()) {
-				String propForeign = properties.nextElement().toString();
-				set(propForeign, context.get(propForeign));
-			}
-		}
-
-		removeDescendants(prop);
-
-		set(prop.getName(), value);
-	}
-
-	/**
-	 * This function sets the pair of 'propName'/'value' regardless of its
-	 * shorthand properties.
-	 */
-	protected void set(String propName, String value) throws org.w3c.dom.DOMException {
-		String key = propName;
-		if (value == null)
-			fProperties.remove(key);
-		else
-			fProperties.put(key, value);
-		if (fModified == null)
-			fModified = new HashSet();
-		fModified.add(key);
-	}
-
-	/**
-	 * 
-	 */
-	public void setAzimuth(String azimuth) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_AZIMUTH), azimuth);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBackground(String background) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BG), background);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBackgroundAttachment(String backgroundAttachment) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT), backgroundAttachment);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBackgroundColor(String backgroundColor) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR), backgroundColor);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBackgroundImage(String backgroundImage) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE), backgroundImage);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBackgroundPosition(String backgroundPosition) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION), backgroundPosition);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBackgroundPositionX(java.lang.String backgroundPositionX) throws org.w3c.dom.DOMException {
-		set(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X), backgroundPositionX);
-		/*
-		 * String newValue = null; String valH = backgroundPositionX; String
-		 * valV = getBackgroundPositionY(); if (valV == null ||
-		 * valV.length()== 0) newValue = valH; else if (valH == null ||
-		 * valH.length() == 0) { Collection valX =
-		 * PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X).getValues();
-		 * Collection valY =
-		 * PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y).getValues();
-		 * PropCMUtil.minus(valY,valX); Iterator it = valY.iterator();
-		 * while(it.hasNext()) { Object obj = it.next(); if
-		 * (obj.toString().equals(valV.toLowerCase())) { // need not
-		 * compensate for ... newValue = valV; break; } } // compensate for
-		 * Horizontal value if (newValue == null) newValue = "0% " + valV; }
-		 * else newValue = valH + " " + valV; setBackgroundPosition(newValue);
-		 */
-	}
-
-	/**
-	 * 
-	 */
-	public void setBackgroundPositionY(java.lang.String backgroundPositionY) throws org.w3c.dom.DOMException {
-		set(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y), backgroundPositionY);
-		/*
-		 * String newValue = null; String valH = getBackgroundPositionX();
-		 * String valV = backgroundPositionY; if (valV == null ||
-		 * valV.length()== 0) newValue = valH; else if (valH == null ||
-		 * valH.length() == 0) { Collection valX =
-		 * PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X).getValues();
-		 * Collection valY =
-		 * PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y).getValues();
-		 * PropCMUtil.minus(valY,valX); Iterator it = valY.iterator();
-		 * while(it.hasNext()) { Object obj = it.next(); if
-		 * (obj.toString().equals(valV.toLowerCase())) { // need not
-		 * compensate for ... newValue = valV; break; } } // compensate for
-		 * Horizontal value if (newValue == null) newValue = "0% " + valV; }
-		 * else newValue = valH + " " + valV; setBackgroundPosition(newValue);
-		 */
-	}
-
-	/**
-	 * 
-	 */
-	public void setBackgroundRepeat(String backgroundRepeat) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT), backgroundRepeat);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorder(String border) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER), border);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderBottom(String borderBottom) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM), borderBottom);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderBottomColor(String borderBottomColor) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR), borderBottomColor);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderBottomStyle(String borderBottomStyle) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE), borderBottomStyle);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderBottomWidth(String borderBottomWidth) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH), borderBottomWidth);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderCollapse(String borderCollapse) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLLAPSE), borderCollapse);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderColor(String borderColor) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR), borderColor);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderLeft(String borderLeft) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT), borderLeft);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderLeftColor(String borderLeftColor) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR), borderLeftColor);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderLeftStyle(String borderLeftStyle) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE), borderLeftStyle);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderLeftWidth(String borderLeftWidth) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH), borderLeftWidth);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderRight(String borderRight) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT), borderRight);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderRightColor(String borderRightColor) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR), borderRightColor);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderRightStyle(String borderRightStyle) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE), borderRightStyle);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderRightWidth(String borderRightWidth) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH), borderRightWidth);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderSpacing(String borderSpacing) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_SPACING), borderSpacing);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderStyle(String borderStyle) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE), borderStyle);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderTop(String borderTop) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP), borderTop);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderTopColor(String borderTopColor) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR), borderTopColor);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderTopStyle(String borderTopStyle) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE), borderTopStyle);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderTopWidth(String borderTopWidth) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH), borderTopWidth);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBorderWidth(String borderWidth) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH), borderWidth);
-	}
-
-	/**
-	 * 
-	 */
-	public void setBottom(String bottom) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_BOTTOM), bottom);
-	}
-
-	/**
-	 * 
-	 */
-	public void setCaptionSide(String captionSide) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_CAPTION_SIDE), captionSide);
-	}
-
-	/**
-	 * 
-	 */
-	public void setClear(String clear) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_CLEAR), clear);
-	}
-
-	/**
-	 * 
-	 */
-	public void setClip(String clip) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP), clip);
-	}
-
-	/**
-	 * 
-	 */
-	public void setClipBottom(java.lang.String clip) throws org.w3c.dom.DOMException {
-		set(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_BOTTOM), clip);
-	}
-
-	/**
-	 * 
-	 */
-	public void setClipLeft(java.lang.String clip) throws org.w3c.dom.DOMException {
-		set(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_LEFT), clip);
-	}
-
-	/**
-	 * 
-	 */
-	public void setClipRight(java.lang.String clip) throws org.w3c.dom.DOMException {
-		set(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_RIGHT), clip);
-	}
-
-	/**
-	 * 
-	 */
-	public void setClipTop(java.lang.String clip) throws org.w3c.dom.DOMException {
-		set(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_TOP), clip);
-	}
-
-	/**
-	 * 
-	 */
-	public void setColor(String color) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_COLOR), color);
-	}
-
-	/**
-	 * 
-	 */
-	public void setContent(String content) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_CONTENT), content);
-	}
-
-	/**
-	 * 
-	 */
-	public void setCounterIncrement(String counterIncrement) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_INCREMENT), counterIncrement);
-	}
-
-	/**
-	 * 
-	 */
-	public void setCounterReset(String counterReset) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_RESET), counterReset);
-	}
-
-	/**
-	 * 
-	 */
-	public void setCssFloat(String cssFloat) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_FLOAT), cssFloat);
-	}
-
-	/**
-	 * 
-	 */
-	public void setCue(String cue) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE), cue);
-	}
-
-	/**
-	 * 
-	 */
-	public void setCueAfter(String cueAfter) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_AFTER), cueAfter);
-	}
-
-	/**
-	 * 
-	 */
-	public void setCueBefore(String cueBefore) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_BEFORE), cueBefore);
-	}
-
-	/**
-	 * 
-	 */
-	public void setCursor(String cursor) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_CURSOR), cursor);
-	}
-
-	/**
-	 * 
-	 */
-	public void setDirection(String direction) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_DIRECTION), direction);
-	}
-
-	/**
-	 * 
-	 */
-	public void setDisplay(String display) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_DISPLAY), display);
-	}
-
-	/**
-	 * 
-	 */
-	public void setElevation(String elevation) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_ELEVATION), elevation);
-	}
-
-	/**
-	 * 
-	 */
-	public void setEmptyCells(String emptyCells) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_EMPTY_CELLS), emptyCells);
-	}
-
-	/**
-	 * 
-	 */
-	public void setFont(String font) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT), font);
-	}
-
-	/**
-	 * 
-	 */
-	public void setFontFamily(String fontFamily) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_FAMILY), fontFamily);
-	}
-
-	/**
-	 * 
-	 */
-	public void setFontSize(String fontSize) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE), fontSize);
-	}
-
-	/**
-	 * 
-	 */
-	public void setFontSizeAdjust(String fontSizeAdjust) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE_ADJUST), fontSizeAdjust);
-	}
-
-	/**
-	 * 
-	 */
-	public void setFontStretch(String fontStretch) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STRETCH), fontStretch);
-	}
-
-	/**
-	 * 
-	 */
-	public void setFontStyle(String fontStyle) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE), fontStyle);
-	}
-
-	/**
-	 * 
-	 */
-	public void setFontVariant(String fontVariant) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT), fontVariant);
-	}
-
-	/**
-	 * 
-	 */
-	public void setFontWeight(String fontWeight) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT), fontWeight);
-	}
-
-	/**
-	 * 
-	 */
-	public void setHeight(String height) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_HEIGHT), height);
-	}
-
-	/**
-	 * 
-	 */
-	public void setLeft(String left) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_LEFT), left);
-	}
-
-	/**
-	 * 
-	 */
-	public void setLetterSpacing(String letterSpacing) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_LETTER_SPACING), letterSpacing);
-	}
-
-	/**
-	 * 
-	 */
-	public void setLineHeight(String lineHeight) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_LINE_HEIGHT), lineHeight);
-	}
-
-	/**
-	 * 
-	 */
-	public void setListStyle(String listStyle) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE), listStyle);
-	}
-
-	/**
-	 * 
-	 */
-	public void setListStyleImage(String listStyleImage) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE), listStyleImage);
-	}
-
-	/**
-	 * 
-	 */
-	public void setListStylePosition(String listStylePosition) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION), listStylePosition);
-	}
-
-	/**
-	 * 
-	 */
-	public void setListStyleType(String listStyleType) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE), listStyleType);
-	}
-
-	/**
-	 * 
-	 */
-	public void setMargin(String margin) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN), margin);
-	}
-
-	/**
-	 * 
-	 */
-	public void setMarginBottom(String marginBottom) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_BOTTOM), marginBottom);
-	}
-
-	/**
-	 * 
-	 */
-	public void setMarginLeft(String marginLeft) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_LEFT), marginLeft);
-	}
-
-	/**
-	 * 
-	 */
-	public void setMarginRight(String marginRight) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_RIGHT), marginRight);
-	}
-
-	/**
-	 * 
-	 */
-	public void setMarginTop(String marginTop) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_TOP), marginTop);
-	}
-
-	/**
-	 * 
-	 */
-	public void setMarkerOffset(String markerOffset) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARKER_OFFSET), markerOffset);
-	}
-
-	/**
-	 * 
-	 */
-	public void setMarks(String marks) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_MARKS), marks);
-	}
-
-	/**
-	 * 
-	 */
-	public void setMaxHeight(String maxHeight) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_HEIGHT), maxHeight);
-	}
-
-	/**
-	 * 
-	 */
-	public void setMaxWidth(String maxWidth) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_WIDTH), maxWidth);
-	}
-
-	/**
-	 * 
-	 */
-	public void setMinHeight(String minHeight) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_HEIGHT), minHeight);
-	}
-
-	/**
-	 * 
-	 */
-	public void setMinWidth(String minWidth) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_WIDTH), minWidth);
-	}
-
-	/**
-	 * 
-	 */
-	public void setOrphans(String orphans) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_ORPHANS), orphans);
-	}
-
-	/**
-	 * 
-	 */
-	public void setOutline(String outline) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE), outline);
-	}
-
-	/**
-	 * 
-	 */
-	public void setOutlineColor(String outlineColor) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_COLOR), outlineColor);
-	}
-
-	/**
-	 * 
-	 */
-	public void setOutlineStyle(String outlineStyle) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_STYLE), outlineStyle);
-	}
-
-	/**
-	 * 
-	 */
-	public void setOutlineWidth(String outlineWidth) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_WIDTH), outlineWidth);
-	}
-
-	/**
-	 * 
-	 */
-	public void setOverflow(String overflow) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_OVERFLOW), overflow);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPadding(String padding) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING), padding);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPaddingBottom(String paddingBottom) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_BOTTOM), paddingBottom);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPaddingLeft(String paddingLeft) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_LEFT), paddingLeft);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPaddingRight(String paddingRight) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_RIGHT), paddingRight);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPaddingTop(String paddingTop) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_TOP), paddingTop);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPage(String page) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE), page);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPageBreakAfter(String pageBreakAfter) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_AFTER), pageBreakAfter);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPageBreakBefore(String pageBreakBefore) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_BEFORE), pageBreakBefore);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPageBreakInside(String pageBreakInside) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_INSIDE), pageBreakInside);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPause(String pause) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE), pause);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPauseAfter(String pauseAfter) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_AFTER), pauseAfter);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPauseBefore(String pauseBefore) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_BEFORE), pauseBefore);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPitch(String pitch) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH), pitch);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPitchRange(String pitchRange) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH_RANGE), pitchRange);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPlayDuring(String playDuring) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_PLAY_DURING), playDuring);
-	}
-
-	/**
-	 * 
-	 */
-	public void setPosition(String position) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_POSITION), position);
-	}
-
-	/**
-	 * 
-	 */
-	public void setQuotes(String quotes) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_QUOTES), quotes);
-	}
-
-	/**
-	 * 
-	 */
-	public void setRichness(String richness) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_RICHNESS), richness);
-	}
-
-	/**
-	 * 
-	 */
-	public void setRight(String right) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_RIGHT), right);
-	}
-
-	/**
-	 * 
-	 */
-	public void setSize(String size) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_SIZE), size);
-	}
-
-	/**
-	 * 
-	 */
-	public void setSpeak(String speak) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK), speak);
-	}
-
-	/**
-	 * 
-	 */
-	public void setSpeakHeader(String speakHeader) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_HEADER), speakHeader);
-	}
-
-	/**
-	 * 
-	 */
-	public void setSpeakNumeral(String speakNumeral) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_NUMERAL), speakNumeral);
-	}
-
-	/**
-	 * 
-	 */
-	public void setSpeakPunctuation(String speakPunctuation) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_PUNCTUATION), speakPunctuation);
-	}
-
-	/**
-	 * 
-	 */
-	public void setSpeechRate(String speechRate) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_SPEECH_RATE), speechRate);
-	}
-
-	/**
-	 * 
-	 */
-	public void setStress(String stress) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_STRESS), stress);
-	}
-
-	/**
-	 * 
-	 */
-	public void setTableLayout(String tableLayout) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_TABLE_LAYOUT), tableLayout);
-	}
-
-	/**
-	 * 
-	 */
-	public void setTextAlign(String textAlign) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_ALIGN), textAlign);
-	}
-
-	/**
-	 * 
-	 */
-	public void setTextDecoration(String textDecoration) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_DECORATION), textDecoration);
-	}
-
-	/**
-	 * 
-	 */
-	public void setTextIndent(String textIndent) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_INDENT), textIndent);
-	}
-
-	/**
-	 * 
-	 */
-	public void setTextShadow(String textShadow) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_SHADOW), textShadow);
-	}
-
-	/**
-	 * 
-	 */
-	public void setTextTransform(String textTransform) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_TRANSFORM), textTransform);
-	}
-
-	/**
-	 * 
-	 */
-	public void setTop(String top) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_TOP), top);
-	}
-
-	/**
-	 * 
-	 */
-	public void setUnicodeBidi(String unicodeBidi) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_UNICODE_BIDI), unicodeBidi);
-	}
-
-	/**
-	 * 
-	 */
-	public void setVerticalAlign(String verticalAlign) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_VERTICAL_ALIGN), verticalAlign);
-	}
-
-	/**
-	 * 
-	 */
-	public void setVisibility(String visibility) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_VISIBILITY), visibility);
-	}
-
-	/**
-	 * 
-	 */
-	public void setVoiceFamily(String voiceFamily) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_VOICE_FAMILY), voiceFamily);
-	}
-
-	/**
-	 * 
-	 */
-	public void setVolume(String volume) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_VOLUME), volume);
-	}
-
-	/**
-	 * 
-	 */
-	public void setWhiteSpace(String whiteSpace) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_WHITE_SPACE), whiteSpace);
-	}
-
-	/**
-	 * 
-	 */
-	public void setWidows(String widows) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_WIDOWS), widows);
-	}
-
-	/**
-	 * 
-	 */
-	public void setWidth(String width) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_WIDTH), width);
-	}
-
-	/**
-	 * 
-	 */
-	public void setWordSpacing(String wordSpacing) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_WORD_SPACING), wordSpacing);
-	}
-
-	/**
-	 * 
-	 */
-	public void setZIndex(String zIndex) throws org.w3c.dom.DOMException {
-		set(PropCMProperty.getInstanceOf(PropCMProperty.P_Z_INDEX), zIndex);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipBottomSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipBottomSubStyleAdapter.java
deleted file mode 100644
index 28f06fc..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipBottomSubStyleAdapter.java
+++ /dev/null
@@ -1,53 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMSubProperty;
-
-/**
- * For bottom value of 'clip' property's rect() function
- */
-public class ClipBottomSubStyleAdapter extends ClipSubStyleAdapter {
-
-	/**
-	 * 
-	 */
-	public ClipBottomSubStyleAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	String get(org.w3c.dom.css.Rect rect) {
-		return rect.getBottom().getCssText();
-	}
-
-	/**
-	 * 
-	 */
-	int index() {
-		return 2;
-	}
-
-	/**
-	 * 
-	 */
-	public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
-		String top = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_TOP));
-		String right = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_RIGHT));
-		String left = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_LEFT));
-
-		set(properties, top, right, value, left, value == null || value.length() == 0);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipLeftSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipLeftSubStyleAdapter.java
deleted file mode 100644
index 58ba873..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipLeftSubStyleAdapter.java
+++ /dev/null
@@ -1,53 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMSubProperty;
-
-/**
- * For left value of 'clip' property's rect() function
- */
-public class ClipLeftSubStyleAdapter extends ClipSubStyleAdapter {
-
-	/**
-	 * 
-	 */
-	public ClipLeftSubStyleAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	String get(org.w3c.dom.css.Rect rect) {
-		return rect.getLeft().getCssText();
-	}
-
-	/**
-	 * 
-	 */
-	int index() {
-		return 3;
-	}
-
-	/**
-	 * 
-	 */
-	public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
-		String top = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_TOP));
-		String right = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_RIGHT));
-		String bottom = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_BOTTOM));
-
-		set(properties, top, right, bottom, value, value == null || value.length() == 0);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipRightSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipRightSubStyleAdapter.java
deleted file mode 100644
index 1560afc..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipRightSubStyleAdapter.java
+++ /dev/null
@@ -1,53 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMSubProperty;
-
-/**
- * For right value of 'clip' property's rect() function
- */
-public class ClipRightSubStyleAdapter extends ClipSubStyleAdapter {
-
-	/**
-	 * 
-	 */
-	public ClipRightSubStyleAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	String get(org.w3c.dom.css.Rect rect) {
-		return rect.getRight().getCssText();
-	}
-
-	/**
-	 * 
-	 */
-	int index() {
-		return 1;
-	}
-
-	/**
-	 * 
-	 */
-	public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
-		String top = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_TOP));
-		String bottom = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_BOTTOM));
-		String left = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_LEFT));
-
-		set(properties, top, value, bottom, left, value == null || value.length() == 0);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipSubStyleAdapter.java
deleted file mode 100644
index e019a34..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipSubStyleAdapter.java
+++ /dev/null
@@ -1,132 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.IValID;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.w3c.dom.css.Rect;
-
-
-/**
- * Abstract class for clip sub-properties
- */
-abstract public class ClipSubStyleAdapter implements ISubPropertyAdapter {
-
-	/**
-	 * 
-	 */
-	public ClipSubStyleAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public String get(ICSS2Properties properties) {
-		String str = null;
-		Object obj = properties.get(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
-		if (obj != null) {
-			if (obj instanceof org.w3c.dom.css.Rect) {
-				str = get((org.w3c.dom.css.Rect) obj);
-			}
-			else {
-				if (obj instanceof ICSSValue) {
-					str = ((ICSSValue) obj).getCSSValueText();
-				}
-				else {
-					str = obj.toString();
-				}
-				str = str.trim().toLowerCase();
-				int pos = str.indexOf("rect(");//$NON-NLS-1$
-				if (pos >= 0) {
-					String subStr = null;
-					pos += 5;
-					int i = 0;
-					do {
-						int posEnd = str.indexOf(",", pos);//$NON-NLS-1$
-						if (posEnd < 0)
-							posEnd = str.indexOf(")", pos);//$NON-NLS-1$
-						if (posEnd < 0 && pos < str.length())
-							posEnd = str.length();
-						if (posEnd >= pos) {
-							subStr = str.substring(pos, posEnd);
-							pos = posEnd + 1;
-						}
-						else
-							pos = -1;
-					}
-					while (i++ < index() && pos > 0);
-
-					if (pos > 0)
-						str = subStr.trim();
-					else
-						str = null;
-				}
-				else
-					str = null;
-			}
-		}
-		return (str != null) ? str : "";//$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 */
-	abstract String get(Rect rect);
-
-	/**
-	 * 
-	 */
-	abstract int index();
-
-	/**
-	 * 
-	 */
-	public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
-	}
-
-	/**
-	 * Insert the method's description here. Creation date: (2001/10/04
-	 * 19:25:46)
-	 * 
-	 * @param properties
-	 *            org.eclipse.wst.css.core.util.declaration.ICSS2Properties
-	 * @param top
-	 *            java.lang.String
-	 * @param right
-	 *            java.lang.String
-	 * @param bottom
-	 *            java.lang.String
-	 * @param left
-	 *            java.lang.String
-	 * @param removeCheck
-	 *            boolean
-	 */
-	void set(ICSS2Properties properties, String top, String right, String bottom, String left, boolean removeCheck) {
-		if (top == null || top.length() == 0)
-			top = IValID.V_AUTO;
-		if (right == null || right.length() == 0)
-			right = IValID.V_AUTO;
-		if (bottom == null || bottom.length() == 0)
-			bottom = IValID.V_AUTO;
-		if (left == null || left.length() == 0)
-			left = IValID.V_AUTO;
-
-		if (removeCheck && top.trim().equalsIgnoreCase(IValID.V_AUTO) && right.trim().equalsIgnoreCase(IValID.V_AUTO) && bottom.trim().equalsIgnoreCase(IValID.V_AUTO) && left.trim().equalsIgnoreCase(IValID.V_AUTO)) {
-			properties.set(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP), null);
-		}
-		else
-			properties.set(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP), "rect(" + top + ", " + right + ", " + bottom + ", " + left + ")");//$NON-NLS-5$//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipTopSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipTopSubStyleAdapter.java
deleted file mode 100644
index 71b5d53..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipTopSubStyleAdapter.java
+++ /dev/null
@@ -1,53 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMSubProperty;
-
-/**
- * For top value of 'clip' property's rect() function
- */
-public class ClipTopSubStyleAdapter extends ClipSubStyleAdapter {
-
-	/**
-	 * 
-	 */
-	public ClipTopSubStyleAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	String get(org.w3c.dom.css.Rect rect) {
-		return rect.getTop().getCssText();
-	}
-
-	/**
-	 * 
-	 */
-	int index() {
-		return 0;
-	}
-
-	/**
-	 * 
-	 */
-	public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
-		String right = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_RIGHT));
-		String bottom = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_BOTTOM));
-		String left = properties.get(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_LEFT));
-
-		set(properties, value, right, bottom, left, value == null || value.length() == 0);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/FontShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/FontShorthandAdapter.java
deleted file mode 100644
index 41d49cc..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/FontShorthandAdapter.java
+++ /dev/null
@@ -1,240 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.IValID;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'font' property 'font' will be expanded to 'font-family', 'font-size',
- * 'font-style', 'font-variant', 'font-weight', 'line-height',
- */
-public class FontShorthandAdapter implements IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	public FontShorthandAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public boolean expand(String source, CSSPropertyContext dest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return false;
-		}
-		String style = null, variant = null, weight = null, size = null, height = null, family = null;
-		PropCMProperty propFont = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT);
-		PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE);
-		PropCMProperty propVariant = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT);
-		PropCMProperty propWeight = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT);
-		PropCMProperty propSize = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE);
-		boolean bNormalSpecified = false;
-
-		int i = 0;
-		for (; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				// first of all, check font idents
-				if (i == 0) {
-					for (int j = 0; j < propFont.getNumChild(); j++) {
-						Object obj = propFont.getChildAt(i);
-						if (obj instanceof String && tokens[i].image.compareToIgnoreCase(obj.toString()) == 0)
-							return false;
-					}
-				}
-				// value "normal" is shared !!
-				if (tokens[i].image.equalsIgnoreCase(IValID.V_NORMAL)) {
-					bNormalSpecified = true;
-				}
-				else {
-					if (propStyle.canHave(tokens[i].image))
-						style = tokens[i].image;
-					else if (propVariant.canHave(tokens[i].image))
-						variant = tokens[i].image;
-					else if (propWeight.canHave(tokens[i].image))
-						weight = tokens[i].image;
-					else if (propSize.canHave(tokens[i].image)) {
-						size = tokens[i].image;
-						break; // if size found, break loop
-					}
-				}
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER && weight == null && propWeight.canHave(tokens[i].image)) {
-				weight = tokens[i].image;
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE) {
-				size = tokens[i].image;
-				break; // if size found, break loop
-			}
-		}
-
-		if (bNormalSpecified) {
-			if (style == null)
-				style = IValID.V_NORMAL;
-			if (variant == null)
-				variant = IValID.V_NORMAL;
-			if (weight == null)
-				weight = IValID.V_NORMAL;
-		}
-
-		// skip whitespace
-		for (i++; i < tokens.length; i++) {
-			if (tokens[i].kind != CSSRegionContexts.CSS_S || tokens[i].kind != CSSRegionContexts.CSS_DECLARATION_VALUE_S)
-				break;
-		}
-
-		// line-height ?
-		if (i < tokens.length && tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && tokens[i].image.equals("/")) { //$NON-NLS-1$
-			for (i++; i < tokens.length; i++) {
-				if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-					height = tokens[i++].image;
-					break;
-				}
-			}
-		}
-
-		// font-family
-		StringBuffer buf = new StringBuffer();
-		for (; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT)
-				buf.append(" ");//$NON-NLS-1$
-			else
-				buf.append(tokens[i].image);
-		}
-		family = buf.toString().trim();
-
-		dest.set(PropCMProperty.P_FONT_STYLE, style);
-		dest.set(PropCMProperty.P_FONT_VARIANT, variant);
-		dest.set(PropCMProperty.P_FONT_WEIGHT, weight);
-		dest.set(PropCMProperty.P_FONT_SIZE, size);
-		dest.set(PropCMProperty.P_LINE_HEIGHT, height);
-		dest.set(PropCMProperty.P_FONT_FAMILY, family);
-
-		return true;
-	}
-
-	/**
-	 * 
-	 */
-	public String extract(String source, PropCMProperty propDest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return null;
-		}
-		String style = null, variant = null, weight = null, size = null, height = null, family = null;
-		PropCMProperty propFont = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT);
-		PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE);
-		PropCMProperty propVariant = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT);
-		PropCMProperty propWeight = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT);
-		PropCMProperty propSize = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE);
-		PropCMProperty propHeight = PropCMProperty.getInstanceOf(PropCMProperty.P_LINE_HEIGHT);
-		PropCMProperty propFamily = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_FAMILY);
-		boolean bNormalSpecified = false;
-
-		int i = 0;
-		for (; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				// first of all, check font idents
-				if (i == 0) {
-					for (int j = 0; j < propFont.getNumChild(); j++) {
-						Object obj = propFont.getChildAt(i);
-						if (obj instanceof String && tokens[i].image.compareToIgnoreCase(obj.toString()) == 0)
-							return null;
-					}
-				}
-				// value "normal" is shared !!
-				if (tokens[i].image.equalsIgnoreCase(IValID.V_NORMAL)) {
-					bNormalSpecified = true;
-				}
-				else {
-					if (propStyle.canHave(tokens[i].image))
-						style = tokens[i].image;
-					else if (propVariant.canHave(tokens[i].image))
-						variant = tokens[i].image;
-					else if (propWeight.canHave(tokens[i].image))
-						weight = tokens[i].image;
-					else if (propSize.canHave(tokens[i].image)) {
-						size = tokens[i].image;
-						break; // if size found, break loop
-					}
-				}
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER && weight == null && propWeight.canHave(tokens[i].image)) {
-				weight = tokens[i].image;
-			}
-			else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE) {
-				size = tokens[i].image;
-				break; // if size found, break loop
-			}
-		}
-
-		if (bNormalSpecified) {
-			if (style == null)
-				style = IValID.V_NORMAL;
-			if (variant == null)
-				variant = IValID.V_NORMAL;
-			if (weight == null)
-				weight = IValID.V_NORMAL;
-		}
-
-		// skip whitespace
-		for (i++; i < tokens.length; i++) {
-			if (tokens[i].kind != CSSRegionContexts.CSS_S || tokens[i].kind != CSSRegionContexts.CSS_DECLARATION_VALUE_S)
-				break;
-		}
-
-		// line-height ?
-		if (i < tokens.length && tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && tokens[i].image.equals("/")) { //$NON-NLS-1$
-			for (i++; i < tokens.length; i++) {
-				if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-					height = tokens[i++].image;
-					break;
-				}
-			}
-		}
-
-		// font-family
-		StringBuffer buf = new StringBuffer();
-		for (; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT)
-				buf.append(" ");//$NON-NLS-1$
-			else
-				buf.append(tokens[i].image);
-		}
-		family = buf.toString().trim();
-
-		if (propStyle == propDest)
-			return style;
-		else if (propVariant == propDest)
-			return variant;
-		else if (propWeight == propDest)
-			return weight;
-		else if (propSize == propDest)
-			return size;
-		else if (propHeight == propDest)
-			return height;
-		else if (propFamily == propDest)
-			return family;
-		else
-			return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ICSS2Properties.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ICSS2Properties.java
deleted file mode 100644
index 02d518c..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ICSS2Properties.java
+++ /dev/null
@@ -1,127 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.w3c.dom.css.CSS2Properties;
-
-
-/**
- * 
- */
-public interface ICSS2Properties extends CSS2Properties {
-
-	/**
-	 * 
-	 */
-	void applyFull(ICSSStyleDeclaration decl);
-
-	/**
-	 * 
-	 */
-	void applyModified(ICSSStyleDeclaration decl);
-
-	/**
-	 * 
-	 */
-	String get(PropCMProperty prop);
-
-	/**
-	 * 
-	 */
-	String getBackgroundPositionX();
-
-	/**
-	 * 
-	 */
-	String getBackgroundPositionY();
-
-	/**
-	 * 
-	 */
-	String getClipBottom();
-
-	/**
-	 * 
-	 */
-	String getClipLeft();
-
-	/**
-	 * 
-	 */
-	String getClipRight();
-
-	/**
-	 * 
-	 */
-	String getClipTop();
-
-	/**
-	 * 
-	 */
-	boolean isModified();
-
-	/**
-	 * 
-	 */
-	Enumeration properties();
-
-	/**
-	 * 
-	 */
-	Iterator propertiesModified();
-
-	/**
-	 * 
-	 */
-	void resetModified();
-
-	/**
-	 * 
-	 */
-	void set(PropCMProperty prop, String value) throws org.w3c.dom.DOMException;
-
-	/**
-	 * 
-	 */
-	void setBackgroundPositionX(String backgroundPosition) throws org.w3c.dom.DOMException;
-
-	/**
-	 * 
-	 */
-	void setBackgroundPositionY(String backgroundPosition) throws org.w3c.dom.DOMException;
-
-	/**
-	 * 
-	 */
-	void setClipBottom(String backgroundPosition) throws org.w3c.dom.DOMException;
-
-	/**
-	 * 
-	 */
-	void setClipLeft(String backgroundPosition) throws org.w3c.dom.DOMException;
-
-	/**
-	 * 
-	 */
-	void setClipRight(String backgroundPosition) throws org.w3c.dom.DOMException;
-
-	/**
-	 * 
-	 */
-	void setClipTop(String backgroundPosition) throws org.w3c.dom.DOMException;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/IShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/IShorthandAdapter.java
deleted file mode 100644
index 5a91f0a..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/IShorthandAdapter.java
+++ /dev/null
@@ -1,31 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-
-/**
- * 
- */
-public interface IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	boolean expand(String source, CSSPropertyContext dest);
-
-	/**
-	 * 
-	 */
-	String extract(String source, PropCMProperty propDest);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ISubPropertyAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ISubPropertyAdapter.java
deleted file mode 100644
index 7d87b6b..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ISubPropertyAdapter.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-/**
- * 
- */
-public interface ISubPropertyAdapter {
-
-	/**
-	 * 
-	 */
-	String get(ICSS2Properties properties);
-
-	/**
-	 * 
-	 */
-	void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ListStyleShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ListStyleShorthandAdapter.java
deleted file mode 100644
index f602033..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ListStyleShorthandAdapter.java
+++ /dev/null
@@ -1,110 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'list-style' property 'list-style' will be expanded to
- * 'list-style-image', 'list-style-position', 'list-style-type',
- */
-public class ListStyleShorthandAdapter implements IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	public ListStyleShorthandAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public boolean expand(String source, CSSPropertyContext dest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return false;
-		}
-		String image = "", pos = "", type = "";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-		PropCMProperty propPos = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION);
-		PropCMProperty propType = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE);
-		PropCMProperty propImage = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propPos.canHave(tokens[i].image))
-					pos = tokens[i].image;
-				else { // value="none" is shared !!
-					if (propType.canHave(tokens[i].image))
-						type = tokens[i].image;
-					if (propImage.canHave(tokens[i].image))
-						image = tokens[i].image;
-				}
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_URI) {
-				image = tokens[i].image;
-			}
-		}
-
-		dest.set(propPos.getName(), pos);
-		dest.set(propType.getName(), type);
-		dest.set(propImage.getName(), image);
-
-		return true;
-	}
-
-	/**
-	 * 
-	 */
-	public String extract(String source, PropCMProperty propDest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return null;
-		}
-		String image = null, pos = null, type = null;
-		PropCMProperty propPos = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION);
-		PropCMProperty propType = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE);
-		PropCMProperty propImage = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE);
-
-		for (int i = 0; i < tokens.length; i++) {
-			if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
-				if (propPos.canHave(tokens[i].image))
-					pos = tokens[i].image;
-				else { // value="none" is shared !!
-					if (propType.canHave(tokens[i].image))
-						type = tokens[i].image;
-					if (propImage.canHave(tokens[i].image))
-						image = tokens[i].image;
-				}
-			}
-			else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_URI) {
-				image = tokens[i].image;
-			}
-		}
-
-		if (propPos == propDest)
-			return pos;
-		else if (propType == propDest)
-			return type;
-		else if (propImage == propDest)
-			return image;
-		else
-			return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/MarginShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/MarginShorthandAdapter.java
deleted file mode 100644
index b53afc6..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/MarginShorthandAdapter.java
+++ /dev/null
@@ -1,129 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'margin' property 'margin' will be expanded to 'margin-top',
- * 'margin-right', 'margin-bottom', 'margin-left',
- */
-public class MarginShorthandAdapter implements IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	public MarginShorthandAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public boolean expand(String source, CSSPropertyContext dest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return false;
-		}
-		String[] idents = new String[4];
-		int j = 0;
-		for (int i = 0; i < tokens.length; i++) {
-			if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE)
-				idents[j++] = tokens[i].image;
-			if (j == 4)
-				break;
-		}
-
-		String[] dests = new String[4];
-		if (j == 0)
-			return true;
-		else if (j == 1) {
-			dests[0] = dests[1] = dests[2] = dests[3] = idents[0];
-		}
-		else if (j == 2) {
-			dests[0] = dests[2] = idents[0];
-			dests[1] = dests[3] = idents[1];
-		}
-		else if (j == 3) {
-			dests[0] = idents[0];
-			dests[1] = dests[3] = idents[1];
-			dests[2] = idents[2];
-		}
-		else {
-			for (int k = 0; k < 4; k++)
-				dests[k] = idents[k];
-		}
-		dest.set(PropCMProperty.P_MARGIN_TOP, dests[0]);
-		dest.set(PropCMProperty.P_MARGIN_RIGHT, dests[1]);
-		dest.set(PropCMProperty.P_MARGIN_BOTTOM, dests[2]);
-		dest.set(PropCMProperty.P_MARGIN_LEFT, dests[3]);
-
-		return true;
-
-	}
-
-	/**
-	 * 
-	 */
-	public String extract(String source, PropCMProperty propDest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return null;
-		}
-		String[] idents = new String[4];
-		int j = 0;
-		for (int i = 0; i < tokens.length; i++) {
-			if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE)
-				idents[j++] = tokens[i].image;
-			if (j == 4)
-				break;
-		}
-
-		if (j == 0)
-			return null;
-		else if (j == 1)
-			return idents[0];
-		else if (j == 2) {
-			if (propDest.getName() == PropCMProperty.P_MARGIN_TOP || propDest.getName() == PropCMProperty.P_MARGIN_BOTTOM)
-				return idents[0];
-			else
-				return idents[1];
-		}
-		else if (j == 3) {
-			if (propDest.getName() == PropCMProperty.P_MARGIN_TOP)
-				return idents[0];
-			else if (propDest.getName() == PropCMProperty.P_MARGIN_BOTTOM)
-				return idents[2];
-			else
-				return idents[1];
-		}
-		else {
-			if (propDest.getName() == PropCMProperty.P_MARGIN_TOP)
-				return idents[0];
-			else if (propDest.getName() == PropCMProperty.P_MARGIN_RIGHT)
-				return idents[1];
-			else if (propDest.getName() == PropCMProperty.P_MARGIN_BOTTOM)
-				return idents[2];
-			else if (propDest.getName() == PropCMProperty.P_MARGIN_LEFT)
-				return idents[3];
-			else
-				return null;
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/PaddingShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/PaddingShorthandAdapter.java
deleted file mode 100644
index 5cde483..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/PaddingShorthandAdapter.java
+++ /dev/null
@@ -1,129 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'padding' property 'padding' will be expanded to 'padding-top',
- * 'padding-right', 'padding-bottom', 'padding-left',
- */
-public class PaddingShorthandAdapter implements IShorthandAdapter {
-
-	/**
-	 * 
-	 */
-	public PaddingShorthandAdapter() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public boolean expand(String source, CSSPropertyContext dest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return false;
-		}
-		String[] idents = new String[4];
-		int j = 0;
-		for (int i = 0; i < tokens.length; i++) {
-			if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE)
-				idents[j++] = tokens[i].image;
-			if (j == 4)
-				break;
-		}
-
-		String[] dests = new String[4];
-		if (j == 0)
-			return true;
-		else if (j == 1) {
-			dests[0] = dests[1] = dests[2] = dests[3] = idents[0];
-		}
-		else if (j == 2) {
-			dests[0] = dests[2] = idents[0];
-			dests[1] = dests[3] = idents[1];
-		}
-		else if (j == 3) {
-			dests[0] = idents[0];
-			dests[1] = dests[3] = idents[1];
-			dests[2] = idents[2];
-		}
-		else {
-			for (int k = 0; k < 4; k++)
-				dests[k] = idents[k];
-		}
-		dest.set(PropCMProperty.P_PADDING_TOP, dests[0]);
-		dest.set(PropCMProperty.P_PADDING_RIGHT, dests[1]);
-		dest.set(PropCMProperty.P_PADDING_BOTTOM, dests[2]);
-		dest.set(PropCMProperty.P_PADDING_LEFT, dests[3]);
-
-		return true;
-	}
-
-	/**
-	 * 
-	 */
-	public String extract(String source, PropCMProperty propDest) {
-		CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
-		CSSTextToken[] tokens = parser.getTokens();
-		if (tokens.length <= 0) {
-			return null;
-		}
-		String[] idents = new String[4];
-		int j = 0;
-		for (int i = 0; i < tokens.length; i++) {
-			if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE)
-				idents[j++] = tokens[i].image;
-			if (j == 4)
-				break;
-		}
-
-		if (j == 0)
-			return null;
-		else if (j == 1)
-			return idents[0];
-		else if (j == 2) {
-			if (propDest.getName() == PropCMProperty.P_PADDING_TOP || propDest.getName() == PropCMProperty.P_PADDING_BOTTOM)
-				return idents[0];
-			else
-				return idents[1];
-		}
-		else if (j == 3) {
-			if (propDest.getName() == PropCMProperty.P_PADDING_TOP)
-				return idents[0];
-			else if (propDest.getName() == PropCMProperty.P_PADDING_BOTTOM)
-				return idents[2];
-			else
-				return idents[1];
-		}
-		else {
-			if (propDest.getName() == PropCMProperty.P_PADDING_TOP)
-				return idents[0];
-			else if (propDest.getName() == PropCMProperty.P_PADDING_RIGHT)
-				return idents[1];
-			else if (propDest.getName() == PropCMProperty.P_PADDING_BOTTOM)
-				return idents[2];
-			else if (propDest.getName() == PropCMProperty.P_PADDING_LEFT)
-				return idents[3];
-			else
-				return null;
-		}
-
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ValueData.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ValueData.java
deleted file mode 100644
index a64f3b1..0000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ValueData.java
+++ /dev/null
@@ -1,45 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.util.declaration;
-
-
-
-/**
- * 
- */
-public class ValueData {
-
-	public String value;
-	public boolean important = false;
-
-	/**
-	 * 
-	 */
-	public ValueData() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	public ValueData(String val, boolean imp) {
-		super();
-		value = val;
-		important = imp;
-	}
-
-	/**
-	 * 
-	 */
-	public String toString() {
-		return value;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/.classpath b/bundles/org.eclipse.wst.css.ui/.classpath
deleted file mode 100644
index cb01053..0000000
--- a/bundles/org.eclipse.wst.css.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src/"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.css.ui/.cvsignore b/bundles/org.eclipse.wst.css.ui/.cvsignore
deleted file mode 100644
index 3a822cd..0000000
--- a/bundles/org.eclipse.wst.css.ui/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-csseditor.jar
-temp.folder
-build.xml
-dev.properties
-bin
-@dot
-src.zip
diff --git a/bundles/org.eclipse.wst.css.ui/.options b/bundles/org.eclipse.wst.css.ui/.options
deleted file mode 100644
index 1af0b58..0000000
--- a/bundles/org.eclipse.wst.css.ui/.options
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.wst.css.ui/projectionperf=false
diff --git a/bundles/org.eclipse.wst.css.ui/.project b/bundles/org.eclipse.wst.css.ui/.project
deleted file mode 100644
index d42035f..0000000
--- a/bundles/org.eclipse.wst.css.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.css.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.css.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d87e83f..0000000
--- a/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,48 +0,0 @@
-#Mon May 30 17:56:50 EDT 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-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.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-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.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-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=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-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.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.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 42fb716..0000000
--- a/bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Fri May 27 23:56:32 EDT 2005
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-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.css.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 06bc72a..0000000
--- a/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,46 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.css.ui; singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.wst.css.ui.internal.CSSUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.css.ui,
- org.eclipse.wst.css.ui.internal,
- org.eclipse.wst.css.ui.internal.autoedit,
- org.eclipse.wst.css.ui.internal.contentassist,
- org.eclipse.wst.css.ui.internal.contentoutline,
- org.eclipse.wst.css.ui.internal.contentproperties,
- org.eclipse.wst.css.ui.internal.contentproperties.ui,
- org.eclipse.wst.css.ui.internal.edit.ui,
- org.eclipse.wst.css.ui.internal.editor,
- org.eclipse.wst.css.ui.internal.image,
- org.eclipse.wst.css.ui.internal.preferences,
- org.eclipse.wst.css.ui.internal.preferences.ui,
- org.eclipse.wst.css.ui.internal.projection,
- org.eclipse.wst.css.ui.internal.properties,
- org.eclipse.wst.css.ui.internal.registry,
- org.eclipse.wst.css.ui.internal.selection,
- org.eclipse.wst.css.ui.internal.style,
- org.eclipse.wst.css.ui.internal.templates,
- org.eclipse.wst.css.ui.internal.text,
- org.eclipse.wst.css.ui.internal.wizard,
- org.eclipse.wst.css.ui.views.contentoutline,
- org.eclipse.wst.css.ui.views.properties
-Require-Bundle: org.eclipse.ui.ide,
- org.eclipse.ui.views,
- org.eclipse.jface.text,
- org.eclipse.ui.workbench.texteditor,
- org.eclipse.ui.editors,
- org.eclipse.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.sse.ui,
- org.eclipse.wst.css.core,
- org.eclipse.wst.sse.core,
- org.eclipse.wst.html.core,
- org.eclipse.wst.xml.core,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.ui.ide
-Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.css.ui/about.html b/bundles/org.eclipse.wst.css.ui/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/bundles/org.eclipse.wst.css.ui/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>February 24, 2005</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.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/build.properties b/bundles/org.eclipse.wst.css.ui/build.properties
deleted file mode 100644
index dc35786..0000000
--- a/bundles/org.eclipse.wst.css.ui/build.properties
+++ /dev/null
@@ -1,23 +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
-###############################################################################
-bin.includes = plugin.xml,\
-               icons/,\
-               plugin.properties,\
-               META-INF/,\
-               .,\
-               .options,\
-               templates/,\
-               about.html
-bin.excludes = bin/**,\
-               @dot/**,\
-               temp.folder/**
-src.includes = build.properties
-source.. = src/
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/dtool16/newcss_wiz.gif b/bundles/org.eclipse.wst.css.ui/icons/full/dtool16/newcss_wiz.gif
deleted file mode 100644
index d94f752..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/dtool16/newcss_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/etool16/newcss_wiz.gif b/bundles/org.eclipse.wst.css.ui/icons/full/etool16/newcss_wiz.gif
deleted file mode 100644
index ab287a5..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/etool16/newcss_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/aural_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/aural_props.gif
deleted file mode 100644
index df1704e..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/aural_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/boxmodel_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/boxmodel_props.gif
deleted file mode 100644
index 7c050f5..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/boxmodel_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/charset_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/charset_rule.gif
deleted file mode 100644
index 0e93844..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/charset_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/class_selector.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/class_selector.gif
deleted file mode 100644
index f924d7a..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/class_selector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/colback_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/colback_props.gif
deleted file mode 100644
index 5ca230b..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/colback_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/content_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/content_props.gif
deleted file mode 100644
index 2133ded..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/content_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyname.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyname.gif
deleted file mode 100644
index ede58ab..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyname.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_function.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_function.gif
deleted file mode 100644
index 6cd12da..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_function.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_identifier.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_identifier.gif
deleted file mode 100644
index 2adbdd8..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_identifier.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_unit.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_unit.gif
deleted file mode 100644
index 308a3ae..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_unit.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/font_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/font_props.gif
deleted file mode 100644
index aca5f89..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/font_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/fontface_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/fontface_rule.gif
deleted file mode 100644
index 71f59e8..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/fontface_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/id_selector.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/id_selector.gif
deleted file mode 100644
index f0857d2..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/id_selector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_rule.gif
deleted file mode 100644
index 94d89cd..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_selector.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_selector.gif
deleted file mode 100644
index d85b78f..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_selector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/media_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/media_rule.gif
deleted file mode 100644
index 3391f19..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/media_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/other_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/other_props.gif
deleted file mode 100644
index 920c228..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/other_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/page_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/page_rule.gif
deleted file mode 100644
index 525f64b..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/page_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pagedmedia_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pagedmedia_props.gif
deleted file mode 100644
index 6b635b0..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pagedmedia_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pseudo.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pseudo.gif
deleted file mode 100644
index 1b6a6dc..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pseudo.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sort.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sort.gif
deleted file mode 100644
index 23c5d0b..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sort.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sourceEditor.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sourceEditor.gif
deleted file mode 100644
index 75ebdb8..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/style_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/style_rule.gif
deleted file mode 100644
index 3176ff8..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/style_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/stylesheet.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/stylesheet.gif
deleted file mode 100644
index d8fde00..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/stylesheet.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/table_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/table_props.gif
deleted file mode 100644
index bcc76cd..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/table_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag-template.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag-template.gif
deleted file mode 100644
index 5d1f81b..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag-template.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag_selector.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag_selector.gif
deleted file mode 100644
index 69850fa..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag_selector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/text_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/text_props.gif
deleted file mode 100644
index abf63f8..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/text_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/ui_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/ui_props.gif
deleted file mode 100644
index 99a8b96..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/ui_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/unknown_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/unknown_rule.gif
deleted file mode 100644
index 857e4e5..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/unknown_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/visual_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/visual_props.gif
deleted file mode 100644
index c1a8b34..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/visual_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/wizban/newcssfile_wiz.gif b/bundles/org.eclipse.wst.css.ui/icons/full/wizban/newcssfile_wiz.gif
deleted file mode 100644
index 8dcf032..0000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/wizban/newcssfile_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/plugin.properties b/bundles/org.eclipse.wst.css.ui/plugin.properties
deleted file mode 100644
index 265ddec..0000000
--- a/bundles/org.eclipse.wst.css.ui/plugin.properties
+++ /dev/null
@@ -1,47 +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
-###############################################################################
-providerName=Eclipse.org
-pluginName=SSE CSS Source Editor
-nlFeatureName=SSE CSS Source Editor NL Support
-CSS_Source_Page_Editor.name=CSS Editor
-CSS_Files.name=CSS Files
-CSS_Source.name=CSS Source
-CSS_Styles.name=CSS Styles
-CSS_Templates.name=CSS Templates
-WebContentSettings.name=Web Content Settings
-###############################################################################
-# The following property keys maybe unused. Commented out on 12/7/2004. Uncomment if needed.
-#CSS_Annotations.name=CSS Annotations
-
-
-#org.eclipse.ui.newWizards extension point
-_UI_WIZARD_NAME = CSS
-_UI_WIZARD_CREATE_NEW_FILE = Create a new Cascading Style Sheet.
-##
-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
-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
-##
-All_CSS_context_type_Extension_Element.name=All CSS
-CSS_New_context_type_Extension_Element.name=New CSS
diff --git a/bundles/org.eclipse.wst.css.ui/plugin.xml b/bundles/org.eclipse.wst.css.ui/plugin.xml
deleted file mode 100644
index 21c0be8..0000000
--- a/bundles/org.eclipse.wst.css.ui/plugin.xml
+++ /dev/null
@@ -1,229 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-	<extension point="org.eclipse.ui.editors">
-		<editor
-			name="%CSS_Source_Page_Editor.name"
-			icon="icons/full/obj16/sourceEditor.gif"
-			contributorClass="org.eclipse.wst.css.ui.internal.ActionContributorCSS"
-			class="org.eclipse.wst.sse.ui.StructuredTextEditor"
-			symbolicFontName="org.eclipse.wst.sse.ui.textfont"
-			id="org.eclipse.wst.css.core.csssource.source">
-			<contentTypeBinding
-				contentTypeId="org.eclipse.wst.css.core.csssource" />
-		</editor>
-	</extension>
-
-	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
-		<contentOutlineConfiguration
-			class="org.eclipse.wst.css.ui.views.contentoutline.CSSContentOutlineConfiguration"
-			target="org.eclipse.wst.css.core.csssource" />
-		<sourceViewerConfiguration
-			class="org.eclipse.wst.css.ui.StructuredTextViewerConfigurationCSS"
-			target="org.eclipse.wst.css.core.csssource" />
-		<propertySheetConfiguration
-			class="org.eclipse.wst.css.ui.views.properties.CSSPropertySheetConfiguration"
-			target="org.eclipse.wst.css.core.csssource" />
-		<provisionalConfiguration
-			type="characterpairmatcher"
-			class="org.eclipse.wst.css.ui.internal.text.CSSDocumentRegionEdgeMatcher"
-			target="org.eclipse.wst.css.core.csssource" />
-		<provisionalConfiguration
-			type="structuredtextfoldingprovider"
-			class="org.eclipse.wst.css.ui.internal.projection.StructuredTextFoldingProviderCSS"
-			target="org.eclipse.wst.css.core.csssource" />
-		<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.wst.css.core.csssource" />
-	</extension>
-
-	<extension
-		point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
-		<adapterFactoryDescription
-			class="org.eclipse.wst.css.ui.internal.registry.AdapterFactoryProviderCSS">
-			<contentType id="org.eclipse.wst.css.core.csssource" />
-		</adapterFactoryDescription>
-	</extension>
-
-	<extension
-		point="org.eclipse.core.filebuffers.annotationModelCreation">
-		<factory
-			contentTypeId="org.eclipse.wst.css.core.csssource"
-			class="org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModelFactory" />
-	</extension>
-
-	<extension point="org.eclipse.ui.preferencePages">
-		<page
-			name="%CSS_Files.name"
-			category="org.eclipse.wst.sse.ui.internal.provisional.preferences"
-			class="org.eclipse.wst.css.ui.internal.preferences.ui.CSSFilesPreferencePage"
-			id="org.eclipse.wst.sse.ui.preferences.css">
-		</page>
-		<page
-			name="%CSS_Source.name"
-			category="org.eclipse.wst.sse.ui.preferences.css"
-			class="org.eclipse.wst.css.ui.internal.preferences.ui.CSSSourcePreferencePage"
-			id="org.eclipse.wst.sse.ui.preferences.css.source">
-		</page>
-		<page
-			name="%CSS_Templates.name"
-			category="org.eclipse.wst.sse.ui.preferences.css"
-			class="org.eclipse.wst.css.ui.internal.preferences.ui.CSSTemplatePreferencePage"
-			id="org.eclipse.wst.css.ui.preferences.templates">
-		</page>
-		<page
-			name="%CSS_Styles.name"
-			category="org.eclipse.wst.sse.ui.preferences.css"
-			class="org.eclipse.wst.css.ui.internal.preferences.ui.CSSColorPage"
-			id="org.eclipse.wst.sse.ui.preferences.css.styles">
-		</page>
-	</extension>
-
-	<extension point="org.eclipse.ui.propertyPages">
-		<page
-			objectClass="org.eclipse.core.resources.IFile"
-			adaptable="true"
-			name="%WebContentSettings.name"
-			nameFilter="*.css"
-			class="org.eclipse.wst.css.ui.internal.contentproperties.ui.CSSContentSettingsPropertyPage"
-			id="org.eclipse.wst.css.ui.csspropertypage">
-		</page>
-	</extension>
-
-	<!-- Editor actionsets -->
-	<extension point="org.eclipse.ui.actionSetPartAssociations">
-		<actionSetPartAssociation
-			targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
-			<part id="org.eclipse.wst.css.core.csssource.source"></part>
-		</actionSetPartAssociation>
-		<actionSetPartAssociation
-			targetID="org.eclipse.ui.NavigateActionSet">
-			<part id="org.eclipse.wst.css.core.csssource.source"></part>
-		</actionSetPartAssociation>
-	</extension>
-
-	<!-- initialize css ui preferences -->
-	<extension point="org.eclipse.core.runtime.preferences">
-		<initializer
-			class="org.eclipse.wst.css.ui.internal.preferences.CSSUIPreferenceInitializer" />
-	</extension>
-
-	<!-- New CSS wizard -->
-	<extension point="org.eclipse.ui.newWizards">
-		<wizard
-			id="org.eclipse.wst.css.ui.internal.wizard.NewCSSWizard"
-			name="%_UI_WIZARD_NAME"
-			class="org.eclipse.wst.css.ui.internal.wizard.NewCSSWizard"
-			category="org.eclipse.wst.web.ui"
-			icon="icons/full/etool16/newcss_wiz.gif">
-			<description>%_UI_WIZARD_CREATE_NEW_FILE</description>
-			<selection class="org.eclipse.core.resources.IResource" />
-		</wizard>
-	</extension>
-
-	<extension point="org.eclipse.ui.popupMenus">
-		<viewerContribution
-			targetID="org.eclipse.wst.css.core.csssource.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>
-
-	<!-- Templates -->
-	<extension point="org.eclipse.ui.editors.templates">
-		<contextType
-			name="%All_CSS_context_type_Extension_Element.name"
-			class="org.eclipse.wst.css.ui.internal.templates.TemplateContextTypeCSS"
-			id="css_all">
-		</contextType>
-		<contextType
-			name="%CSS_New_context_type_Extension_Element.name"
-			class="org.eclipse.wst.css.ui.internal.templates.TemplateContextTypeCSS"
-			id="css_new">
-		</contextType>
-		<include
-			file="templates/cssdefault-templates.xml"
-			translations="$nl$/templates/cssdefault-templates.properties">
-		</include>
-	</extension>
-
-	<!-- CSS editor actions -->
-	<extension point="org.eclipse.ui.editorActions">
-		<editorContribution
-			id="org.eclipse.wst.css.core.csssource.source.editorActions"
-			targetID="org.eclipse.wst.css.core.csssource.source">
-			<action
-				id="CleanupDocument"
-				label="%CleanupDocument_label"
-				definitionId="org.eclipse.wst.sse.ui.cleanup.document"
-				tooltip="%CleanupDocument_tooltip"
-				class="org.eclipse.wst.css.ui.internal.edit.ui.CleanupActionCSSDelegate"
-				actionID="CleanupDocument">
-			</action>
-			<action
-				id="StructureSelectEnclosing"
-				label="%StructureSelectEnclosing_label"
-				definitionId="org.eclipse.wst.sse.ui.structure.select.enclosing"
-				tooltip="%StructureSelectEnclosing_tooltip"
-				class="org.eclipse.wst.css.ui.internal.selection.StructuredSelectEnclosingCSSActionDelegate"
-				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.css.ui.internal.selection.StructuredSelectNextCSSActionDelegate"
-				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.css.ui.internal.selection.StructuredSelectPreviousCSSActionDelegate"
-				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.css.core.csssource.source"
-            id="org.eclipse.wst.css.core.csssource.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>
-</plugin>
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java
deleted file mode 100644
index c41fe5c..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java
+++ /dev/null
@@ -1,161 +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.css.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IAutoEditStrategy;
-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.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.format.FormatProcessorCSS;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.text.ICSSPartitionTypes;
-import org.eclipse.wst.css.ui.internal.autoedit.StructuredAutoEditStrategyCSS;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.css.ui.internal.style.LineStyleProviderForCSS;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
-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;
-
-/**
- * Configuration for a source viewer which shows CSS.
- * <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 StructuredTextViewerConfigurationCSS 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 fLineStyleProviderForCSS;
-
-	/**
-	 * Create new instance of StructuredTextViewerConfigurationCSS
-	 */
-	public StructuredTextViewerConfigurationCSS() {
-		// 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]);
-		}
-
-		if (contentType == ICSSPartitionTypes.STYLE) {
-			allStrategies.add(new StructuredAutoEditStrategyCSS());
-		}
-
-		return (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[0]);
-	}
-
-	public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
-		if (fConfiguredContentTypes == null) {
-			fConfiguredContentTypes = new String[]{ICSSPartitionTypes.STYLE, IStructuredPartitionTypes.DEFAULT_PARTITION, IStructuredPartitionTypes.UNKNOWN_PARTITION};
-		}
-		return fConfiguredContentTypes;
-	}
-
-	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
-		IContentAssistProcessor[] processors = null;
-
-		if ((partitionType == ICSSPartitionTypes.STYLE) || (partitionType == IStructuredPartitionTypes.UNKNOWN_PARTITION)) {
-			processors = new IContentAssistProcessor[]{new CSSContentAssistProcessor()};
-		}
-
-		return processors;
-	}
-
-	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
-		final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), ICSSPartitionTypes.STYLE);
-
-		formatter.setMasterStrategy(new StructuredFormattingStrategy(new FormatProcessorCSS()));
-
-		return formatter;
-	}
-
-	public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
-		Vector vector = new Vector();
-
-		// prefix[0] is either '\t' or ' ' x tabWidth, depending on preference
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
-		String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
-		boolean useSpaces = CSSCorePreferenceNames.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;
-
-		if (partitionType == ICSSPartitionTypes.STYLE) {
-			providers = new LineStyleProvider[]{getLineStyleProviderForCSS()};
-		}
-
-		return providers;
-	}
-
-	private LineStyleProvider getLineStyleProviderForCSS() {
-		if (fLineStyleProviderForCSS == null) {
-			fLineStyleProviderForCSS = new LineStyleProviderForCSS();
-		}
-		return fLineStyleProviderForCSS;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/ActionContributorCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/ActionContributorCSS.java
deleted file mode 100644
index d758cf6..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/ActionContributorCSS.java
+++ /dev/null
@@ -1,118 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal;
-
-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.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-import org.eclipse.wst.sse.ui.internal.actions.ActionContributor;
-import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds;
-import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
-
-/**
- * ActionContributorCSS
- * 
- * 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 ActionContributorCSS extends ActionContributor {
-	private static final String[] EDITOR_IDS = {"org.eclipse.wst.css.core.csssource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
-
-	protected RetargetTextEditorAction fContentAssist = null;
-	protected RetargetTextEditorAction fCleanupDocument = null;
-	protected MenuManager fFormatMenu = null;
-	protected RetargetTextEditorAction fFormatDocument = null;
-	protected RetargetTextEditorAction fFormatActiveElements = null;
-
-	public ActionContributorCSS() {
-		super();
-
-		ResourceBundle resourceBundle = CSSUIMessages.getResourceBundle();
-
-		// edit commands
-		fContentAssist = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
-		fContentAssist.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
-
-		// source commands
-		fCleanupDocument = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
-		fCleanupDocument.setActionDefinitionId(ActionDefinitionIds.CLEANUP_DOCUMENT);
-
-		fFormatDocument = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
-		fFormatDocument.setActionDefinitionId(ActionDefinitionIds.FORMAT_DOCUMENT);
-
-		fFormatActiveElements = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
-		fFormatActiveElements.setActionDefinitionId(ActionDefinitionIds.FORMAT_ACTIVE_ELEMENTS);
-
-		fFormatMenu = new MenuManager(CSSUIMessages.FormatMenu_label);
-		fFormatMenu.add(fFormatDocument);
-		fFormatMenu.add(fFormatActiveElements);
-	}
-
-	protected String[] getExtensionIDs() {
-		return EDITOR_IDS;
-	}
-
-	protected void addToMenu(IMenuManager menu) {
-		// edit commands
-		IMenuManager editMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
-		if (editMenu != null) {
-			editMenu.add(fCommandsSeparator);
-			editMenu.add(fToggleInsertModeAction);
-			editMenu.add(fCommandsSeparator);
-			editMenu.add(fExpandSelectionToMenu);
-			editMenu.add(fCommandsSeparator);
-			editMenu.add(fContentAssist);
-			editMenu.add(fMenuAdditionsGroupMarker);
-		}
-
-		// source commands
-		String sourceMenuLabel = CSSUIMessages.SourceMenu_label;
-		String sourceMenuId = "sourceMenuId"; //$NON-NLS-1$
-		IMenuManager sourceMenu = new MenuManager(sourceMenuLabel, sourceMenuId);
-		menu.insertAfter(IWorkbenchActionConstants.M_EDIT, sourceMenu);
-		if (sourceMenu != null) {
-			sourceMenu.add(fCommandsSeparator);
-			sourceMenu.add(fShiftRight);
-			sourceMenu.add(fShiftLeft);
-			sourceMenu.add(fCleanupDocument);
-			sourceMenu.add(fFormatMenu);
-			sourceMenu.add(fCommandsSeparator);
-		}
-	}
-
-	public void setActiveEditor(IEditorPart activeEditor) {
-		super.setActiveEditor(activeEditor);
-
-		ITextEditor textEditor = getTextEditor(activeEditor);
-
-		fContentAssist.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS));
-
-		fCleanupDocument.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT));
-		fFormatDocument.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT));
-		fFormatActiveElements.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS));
-		fCleanupDocument.setEnabled(textEditor != null && textEditor.isEditable());
-		fFormatDocument.setEnabled(textEditor != null && textEditor.isEditable());
-		fFormatActiveElements.setEnabled(textEditor != null && textEditor.isEditable());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java
deleted file mode 100644
index 001bcc9..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java
+++ /dev/null
@@ -1,114 +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.css.ui.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-public class CSSUIMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.css.ui.internal.CSSUIPluginResources";//$NON-NLS-1$
-	private static ResourceBundle fResourceBundle;
-
-	public static String INFO_Not_Categorized_1;
-	public static String PrefsLabel_WrappingWithoutAttr;
-	public static String PrefsLabel_WrappingInsertLineBreak;
-	public static String PrefsLabel_CaseGroup;
-	public static String PrefsLabel_CaseIdent;
-	public static String PrefsLabel_CasePropName;
-	public static String PrefsLabel_CasePropValue;
-	public static String PrefsLabel_CaseIdentUpper;
-	public static String PrefsLabel_CaseIdentLower;
-	public static String PrefsLabel_SelectorTagName;
-	public static String PrefsLabel_CasePropNameUpper;
-	public static String PrefsLabel_CasePropNameLower;
-	public static String PrefsLabel_CasePropValueUpper;
-	public static String PrefsLabel_CasePropValueLower;
-	public static String PrefsLabel_SelectorTagNameUpper;
-	public static String PrefsLabel_SelectorTagNameLower;
-	public static String PrefsLabel_ColorSample;
-	public static String PrefsLabel_ColorNormal;
-	public static String PrefsLabel_ColorAtmarkRule;
-	public static String PrefsLabel_ColorSelector;
-	public static String PrefsLabel_ColorMedia;
-	public static String PrefsLabel_ColorComment;
-	public static String PrefsLabel_ColorPropertyName;
-	public static String PrefsLabel_ColorPropertyValue;
-	public static String PrefsLabel_ColorUri;
-	public static String PrefsLabel_ColorString;
-	public static String PrefsLabel_ColorColon;
-	public static String PrefsLabel_ColorSemiColon;
-	public static String PrefsLabel_ColorCurlyBrace;
-	public static String PrefsLabel_ColorError;
-	public static String SortAction_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_CSS;
-	public static String Title_InvalidValue;
-	public static String Message_InvalidValue;
-	public static String FormatMenu_label;
-	public static String CleanupDocument_label; // resource bundle
-	public static String CleanupDocument_tooltip; // resource bundle
-	public static String CleanupDocument_description; // resource bundle
-	public static String UI_none;
-	public static String Cleanup_UI_;
-	public static String CSS_Cleanup_UI_;
-	public static String Identifier_case__UI_;
-	public static String Property_name_case__UI_;
-	public static String Property_value_case__UI_;
-	public static String Selector_tag_name_case__UI_;
-	public static String Quote_values_UI_;
-	public static String Format_source_UI_;
-	public static String As_is_UI_;
-	public static String Lower_UI_;
-	public static String Upper_UI_;
-	public static String SourceMenu_label;
-	public static String Formatting_UI_;
-	public static String Line_width__UI_;
-	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 StructureSelectEnclosing_label;
-	public static String StructureSelectEnclosing_tooltip;
-	public static String StructureSelectEnclosing_description;
-	public static String StructureSelectNext_label;
-	public static String StructureSelectNext_tooltip;
-	public static String StructureSelectNext_description;
-	public static String StructureSelectPrevious_label;
-	public static String StructureSelectPrevious_tooltip;
-	public static String StructureSelectPrevious_description;
-	public static String Creating_files_encoding;
-	public static String NewCSSTemplatesWizardPage_0;
-	public static String NewCSSTemplatesWizardPage_1;
-	public static String NewCSSTemplatesWizardPage_2;
-	public static String NewCSSTemplatesWizardPage_3;
-	public static String NewCSSTemplatesWizardPage_4;
-	public static String NewCSSTemplatesWizardPage_5;
-	public static String NewCSSTemplatesWizardPage_6;
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, CSSUIMessages.class);
-	}
-
-	public static ResourceBundle getResourceBundle() {
-		try {
-			if (fResourceBundle == null)
-				fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
-		}
-		catch (MissingResourceException x) {
-			fResourceBundle = null;
-		}
-		return fResourceBundle;
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPlugin.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPlugin.java
deleted file mode 100644
index 28688ef..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPlugin.java
+++ /dev/null
@@ -1,99 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-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.css.ui.internal.preferences.CSSUIPreferenceNames;
-import org.eclipse.wst.css.ui.internal.templates.TemplateContextTypeIdsCSS;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class CSSUIPlugin extends AbstractUIPlugin {
-	public final static String ID = "org.eclipse.wst.css.ui"; //$NON-NLS-1$
-	//The shared instance.
-	private static CSSUIPlugin plugin;	
-	
-	/**
-	 * The template store for the css ui.
-	 */
-	private TemplateStore fTemplateStore;
-
-	/**
-	 * The template context type registry for css ui.
-	 */
-	private ContextTypeRegistry fContextTypeRegistry;
-
-	/**
-	 * The constructor.
-	 */
-	public CSSUIPlugin() {
-		super();
-		plugin = this;
-	}
-
-	/**
-	 * Returns the shared instance.
-	 */
-	public static CSSUIPlugin getDefault() {
-		return plugin;
-	}
-
-	/**
-	 * Returns the workspace instance.
-	 */
-	public static IWorkspace getWorkspace() {
-		return ResourcesPlugin.getWorkspace();
-	}
-	
-	/**
-	 * Returns the template store for the css editor templates.
-	 * 
-	 * @return the template store for the css editor templates
-	 */
-	public TemplateStore getTemplateStore() {
-		if (fTemplateStore == null) {
-			fTemplateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), CSSUIPreferenceNames.TEMPLATES_KEY);
-
-			try {
-				fTemplateStore.load();
-			} catch (IOException e) {
-				Logger.logException(e);
-			}
-		}
-		return fTemplateStore;
-	}
-
-	/**
-	 * Returns the template context type registry for the css plugin.
-	 * 
-	 * @return the template context type registry for the css plugin
-	 */
-	public ContextTypeRegistry getTemplateContextRegistry() {
-		if (fContextTypeRegistry == null) {
-			ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
-			registry.addContextType(TemplateContextTypeIdsCSS.ALL);
-			registry.addContextType(TemplateContextTypeIdsCSS.NEW);
-
-			fContextTypeRegistry = registry;
-		}
-
-		return fContextTypeRegistry;
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties
deleted file mode 100644
index dfa88c5..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties
+++ /dev/null
@@ -1,103 +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
-###############################################################################
-
-INFO_Not_Categorized_1=Not Categorized
-
-## CSS Preferences -- source ##
-PrefsLabel_WrappingWithoutAttr=Disable wrapping in style &attribute of HTML
-PrefsLabel_WrappingInsertLineBreak=Insert &line break between properties
-
-PrefsLabel_CaseGroup=Capitalization style
-PrefsLabel_CaseIdent=Identifier:
-PrefsLabel_CasePropName=Property name:
-PrefsLabel_CasePropValue=Property value:
-PrefsLabel_SelectorTagName=Selector tag name:
-
-PrefsLabel_CaseIdentUpper=&Uppercase
-PrefsLabel_CaseIdentLower=L&owercase
-PrefsLabel_CasePropNameUpper=U&ppercase
-PrefsLabel_CasePropNameLower=Lo&wercase
-PrefsLabel_CasePropValueUpper=Upp&ercase
-PrefsLabel_CasePropValueLower=Lowe&rcase
-PrefsLabel_SelectorTagNameUpper=Upper&case
-PrefsLabel_SelectorTagNameLower=Lowerca&se
-
-## CSS Preferences -- color ##
-
-## The following line is a sample CSS document.  Please translate only the following parts:
-## Sample Styles
-PrefsLabel_ColorSample=@import url("../sample2.css");\n\n/* Sample Styles */\n\nBODY {\n\tcolor : black;\n\tbackground-color : rgb(181, 253, 211);\n\ttext-align : center;\n\tfont-family : "Heisei Mincho W3", serif\n}\n\n@page :left { margin-left : 4cm }\n\n@media aural {\n\tP.heidi {\n\t\tazimuth : center-left;\n\t\televation : 12.3deg;\n\t\tpause : 30ms 1.6s\n\t}\n}\n
-
-PrefsLabel_ColorNormal=Default
-PrefsLabel_ColorAtmarkRule=At-Rule
-PrefsLabel_ColorSelector=Selector
-PrefsLabel_ColorMedia=Media Name
-PrefsLabel_ColorComment=Comment
-PrefsLabel_ColorPropertyName=Property Name
-PrefsLabel_ColorPropertyValue=Property Value
-PrefsLabel_ColorUri=URI
-PrefsLabel_ColorString=Quoted String
-PrefsLabel_ColorColon=Property Delimiter
-PrefsLabel_ColorSemiColon=SemiColon
-PrefsLabel_ColorCurlyBrace=Curly Brace
-PrefsLabel_ColorError=Error
-#
-SortAction_0=Sort
-#
-_UI_WIZARD_NEW_TITLE = New Cascading Style Sheet
-_UI_WIZARD_NEW_HEADING = Cascading Style Sheet
-_UI_WIZARD_NEW_DESCRIPTION = Create a new CSS file.
-_ERROR_FILENAME_MUST_END_CSS = The file name must end in .css
-#
-Title_InvalidValue=Invalid Value
-Message_InvalidValue=Invalid property value.
-# Copied from sse.ui
-FormatMenu_label=F&ormat
-CleanupDocument_label=C&leanup Document...
-CleanupDocument_tooltip=Cleanup Document
-CleanupDocument_description=Cleanup Document
-UI_none=none
-Cleanup_UI_=Cleanup
-CSS_Cleanup_UI_=CSS Cleanup
-Identifier_case__UI_=Identifier case:
-Property_name_case__UI_=Property name case:
-Property_value_case__UI_=Property value case:
-Selector_tag_name_case__UI_=Selector tag name case:
-Quote_values_UI_=Quote values
-Format_source_UI_=&Format source
-As_is_UI_=As-is
-Lower_UI_=Lower
-Upper_UI_=Upper
-SourceMenu_label=&Source
-Formatting_UI_=Formatting
-Line_width__UI_=Line &width:
-Indent_using_tabs_=&Indent using tabs
-Indent_using_spaces=I&ndent using spaces
-Indentation_size=In&dentation size:
-Indentation_size_tip=Indentation size
-StructureSelectEnclosing_label=&Enclosing Element
-StructureSelectEnclosing_tooltip=Expand selection to include enclosing element
-StructureSelectEnclosing_description=Expand selection to include enclosing element
-StructureSelectNext_label=&Next Element
-StructureSelectNext_tooltip=Expand selection to include next sibling
-StructureSelectNext_description=Expand selection to include next sibling
-StructureSelectPrevious_label=&Previous Element
-StructureSelectPrevious_tooltip=Expand selection to include previous sibling
-StructureSelectPrevious_description=Expand selection to include previous sibling
-##
-Creating_files_encoding=Creating files encoding preference
-NewCSSTemplatesWizardPage_0=Select CSS Template
-NewCSSTemplatesWizardPage_1=Select a template as initial content in the CSS page.
-NewCSSTemplatesWizardPage_2=Name
-NewCSSTemplatesWizardPage_3=Description
-NewCSSTemplatesWizardPage_4=Use CSS Template
-NewCSSTemplatesWizardPage_5=Preview:
-NewCSSTemplatesWizardPage_6=Templates are 'New CSS' templates found in the <a>CSS Templates</a> preference page.
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/Logger.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/Logger.java
deleted file mode 100644
index 5f3336b..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/Logger.java
+++ /dev/null
@@ -1,156 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal;
-
-
-
-import java.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.css.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);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java
deleted file mode 100644
index 1ad324a..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java
+++ /dev/null
@@ -1,593 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.autoedit;
-
-import org.eclipse.core.runtime.Preferences;
-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.jface.text.IRegion;
-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.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-import org.eclipse.wst.css.ui.internal.Logger;
-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;
-
-public class StructuredAutoEditStrategyCSS implements IAutoEditStrategy {
-	protected IStructuredDocument structuredDocument = null;
-
-	class CompoundRegion {
-
-		CompoundRegion(IStructuredDocumentRegion documentRegion, ITextRegion textRegion) {
-			super();
-			this.documentRegion = documentRegion;
-			this.textRegion = textRegion;
-		}
-
-		IStructuredDocumentRegion getDocumentRegion() {
-			return documentRegion;
-		}
-
-		ITextRegion getTextRegion() {
-			return textRegion;
-		}
-
-		int getStart() {
-			return textRegion.getStart();
-		}
-
-		int getEnd() {
-			return textRegion.getEnd();
-		}
-
-		String getType() {
-			return textRegion.getType();
-		}
-
-		String getText() {
-			return documentRegion.getText(textRegion);
-		}
-
-		int getStartOffset() {
-			return documentRegion.getStartOffset(textRegion);
-		}
-
-		int getEndOffset() {
-			return documentRegion.getEndOffset(textRegion);
-		}
-
-		private IStructuredDocumentRegion documentRegion;
-		private ITextRegion textRegion;
-
-	}
-
-	/**
-	 */
-	protected void autoIndentAfterClose(DocumentCommand command, String regionType) {
-		if (!setRangeForClose(command))
-			return;
-
-		int position = command.offset + command.length;
-
-		if (position == -1 || structuredDocument.getLength() == 0) {
-			return;
-		}
-
-		// get open brace region
-		CompoundRegion region = prevCorrespondence(position, regionType);
-
-		// get indentation
-		String str = getIndentFor(region, false);
-
-		// append to input
-		if (str != null)
-			command.text = str + command.text;
-	}
-
-	/**
-	 * Copies the indentation of the previous line.
-	 */
-	protected void autoIndentAfterNewLine(DocumentCommand command) {
-		// select nearest white spaces to replace with new-line
-		setRangeForNewLine(command);
-
-		// get position
-		int position = command.offset;
-
-		if (position == -1 || structuredDocument.getLength() == 0) {
-			return;
-		}
-
-		// get current region
-		CompoundRegion currentRegion = getRegion(command.offset + command.length);
-
-		// get key region
-		CompoundRegion keyRegion = getPrevKeyRegion(position, currentRegion);
-
-		// get indent string
-		String str = getIndentFor(keyRegion, true);
-
-		// check another indentation
-		int shift = needShift(keyRegion, command.offset + command.length);
-
-		// create text to replace
-		StringBuffer buf = new StringBuffer(command.text);
-		if (str != null)
-			buf.append(str);
-		while (shift-- != 0)
-			buf.append(getIndentString());
-		command.text = buf.toString();
-
-	}
-
-	/**
-	 */
-	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
-		Object textEditor = getActiveTextEditor();
-		if (!(textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT))
-			return;
-
-		// return;
-		// /*
-		structuredDocument = (IStructuredDocument) document;
-
-		if (command.length == 0 && command.text != null) {
-			if (endsWith(document.getLegalLineDelimiters(), command.text) != -1) {
-				autoIndentAfterNewLine(command);
-			} else if (command.text.equals("}")) {//$NON-NLS-1$
-				autoIndentAfterClose(command, CSSRegionContexts.CSS_RBRACE);
-			} else if (command.text.equals("]")) {//$NON-NLS-1$
-				autoIndentAfterClose(command, CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END);
-			} else if (command.text.equals(")")) {//$NON-NLS-1$
-				autoIndentAfterClose(command, CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE);
-			}
-		}
-		// */
-		
-		// spaces for tab character
-		if (command.text != null && command.text.length() > 0 && command.text.charAt(0) == '\t')
-			smartInsertForTab(command, document);
-	}
-
-	/**
-	 */
-	protected String getIndentFor(CompoundRegion region, boolean indentForNextRegion) {
-		if (region == null)
-			return null;
-		IStructuredDocumentRegion flatNode = region.getDocumentRegion();
-		if (flatNode == null)
-			return null;
-
-		try {
-			if (region.getType() == CSSRegionContexts.CSS_LBRACE || region.getType() == CSSRegionContexts.CSS_DELIMITER || region.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-				// get meanful flat node
-				RegionIterator it = new RegionIterator(flatNode, region.getTextRegion());
-				it.prev();
-				while (it.hasPrev()) {
-					ITextRegion r = it.prev();
-					region = new CompoundRegion(it.getStructuredDocumentRegion(), r);
-					if (region.getType() != CSSRegionContexts.CSS_S)
-						break;
-				}
-				flatNode = region.getDocumentRegion();
-				// get indent string
-				int position = flatNode.getStart();
-				int line = structuredDocument.getLineOfOffset(position);
-				int start = structuredDocument.getLineOffset(line);
-				int end = findEndOfWhiteSpace(structuredDocument, start, position);
-				return structuredDocument.get(start, end - start);
-			} else if (region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START ||
-			// region.getType() == CSSRegionContexts.CSS_PARENTHESIS_OPEN ||
-						region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION || region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
-				int position = flatNode.getStart() + region.getStart();
-				int line = structuredDocument.getLineOfOffset(position);
-				int start = structuredDocument.getLineOffset(line);
-				int end = findEndOfWhiteSpace(structuredDocument, start, position);
-				StringBuffer buf = new StringBuffer(structuredDocument.get(start, end - start));
-				position += region.getText().length();
-				if (indentForNextRegion) {
-					int tokenStart = findEndOfWhiteSpace(structuredDocument, position, structuredDocument.getLineOffset(line) + structuredDocument.getLineLength(line) - 1);
-					if (tokenStart < structuredDocument.getLineOffset(line) + structuredDocument.getLineLength(line) - 1) {
-						position = tokenStart;
-					}
-				}
-				while (position - end > 0) {
-					buf.append(" ");//$NON-NLS-1$
-					end++;
-				}
-				return buf.toString();
-			} else
-				return "";//$NON-NLS-1$
-		} catch (BadLocationException excp) {
-			Logger.logException(excp);
-		}
-		return null;
-	}
-
-	/**
-	 */
-	protected CompoundRegion getPrevKeyRegion(int position, CompoundRegion currentRegion) {
-		if (currentRegion == null) {
-			if (structuredDocument.getLastStructuredDocumentRegion() == null)
-				return null;
-		}
-
-		if (currentRegion != null && (currentRegion.getType() == CSSRegionContexts.CSS_RBRACE || currentRegion.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END || currentRegion.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)) {
-			return prevCorrespondence(currentRegion);
-		}
-
-		RegionIterator it = new RegionIterator(structuredDocument, position - 1);
-		while (it.hasPrev()) {
-			ITextRegion r = it.prev();
-			CompoundRegion region = new CompoundRegion(it.getStructuredDocumentRegion(), r);
-			if (region.getType() == CSSRegionContexts.CSS_LBRACE ||
-			// region.getType() == CSSRegionContexts.CSS_RBRACE ||
-						region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START ||
-						// region.getType() ==
-						// CSSRegionContexts.CSS_BRACKET_CLOSE ||
-						// // region.getType() ==
-						// CSSRegionContexts.CSS_PARENTHESIS_OPEN ||
-						// region.getType() ==
-						// CSSRegionContexts.CSS_PARENTHESIS_CLOSE ||
-						region.getType() == CSSRegionContexts.CSS_DELIMITER || region.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER ||
-						// region.getType() == CSSRegionContexts.CSS_COLON ||
-						// region.getType() == CSSRegionContexts.CSS_COMMENT
-						// ||
-						region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
-				return region;
-			} else if (region.getType() == CSSRegionContexts.CSS_RBRACE || region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END || region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
-				// skip to LBRACE
-				CompoundRegion pc = prevCorrespondence(region);
-				// guard for NPE
-				//https://bugs.eclipse.org/bugs/show_bug.cgi?id=111318
-				if (pc == null) break;
-				it.reset(pc.getDocumentRegion(), pc.getTextRegion());
-				it.prev();
-			} else if (region.getType() == CSSRegionContexts.CSS_STRING) {
-				RegionIterator itTmp = new RegionIterator(structuredDocument, position);
-				if (region == itTmp.prev())
-					return region; // position is inside of string
-			} else if (region.getType() == CSSRegionContexts.CSS_COMMENT) {
-				RegionIterator itTmp = new RegionIterator(structuredDocument, position);
-				if (region == itTmp.prev())
-					return region; // position is inside of comment
-			} else if (region.getType() == CSSRegionContexts.CSS_UNKNOWN) {
-				String str = region.getText();
-				if (str.charAt(str.length() - 1) == '\\')
-					return region;
-			} else if (region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
-				RegionIterator itPrev = new RegionIterator(region.getDocumentRegion(), region.getTextRegion());
-				while (itPrev.hasPrev()) {
-					ITextRegion regionPrev = itPrev.prev();
-					if (regionPrev.getType() == CSSRegionContexts.CSS_RBRACE) {
-						break;
-					} else if (regionPrev.getType() == CSSRegionContexts.CSS_DELIMITER || regionPrev.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-						return region;
-					} else if (regionPrev.getType() == CSSRegionContexts.CSS_LBRACE) {
-						while (itPrev.hasPrev()) {
-							regionPrev = itPrev.prev();
-							if (regionPrev.getType() == CSSRegionContexts.CSS_MEDIA)
-								break;
-							if (regionPrev.getType() == CSSRegionContexts.CSS_LBRACE || regionPrev.getType() == CSSRegionContexts.CSS_RBRACE || regionPrev.getType() == CSSRegionContexts.CSS_DELIMITER || regionPrev.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER)
-								return region;
-						}
-						if (regionPrev.getType() == CSSRegionContexts.CSS_MEDIA)
-							break;
-						else
-							return region;
-					}
-				}
-			}
-		}
-		return null;
-	}
-
-	/**
-	 */
-	protected CompoundRegion getRegion(int position) {
-		IStructuredDocumentRegion flatNode = structuredDocument.getRegionAtCharacterOffset(position);
-		if (flatNode != null)
-			return new CompoundRegion(flatNode, flatNode.getRegionAtCharacterOffset(position));
-		return null;
-	}
-
-	/**
-	 */
-	protected int needShift(CompoundRegion region, int position) {
-		int shift = 0;
-		if (region == null || region.getType() == CSSRegionContexts.CSS_DELIMITER || region.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER || region.getType() == CSSRegionContexts.CSS_LBRACE) {
-			// get non space region
-			CompoundRegion cr = getRegion(position - 1);
-			RegionIterator it = new RegionIterator(cr.getDocumentRegion(), cr.getTextRegion());
-			ITextRegion nearestRegion = null;
-			while (it.hasPrev()) {
-				nearestRegion = it.prev();
-				if (nearestRegion.getType() != CSSRegionContexts.CSS_S && nearestRegion.getType() != CSSRegionContexts.CSS_COMMENT)
-					break;
-			}
-			if (nearestRegion != null && (nearestRegion.getType() == CSSRegionContexts.CSS_LBRACE || nearestRegion.getType() == CSSRegionContexts.CSS_RBRACE || nearestRegion.getType() == CSSRegionContexts.CSS_DELIMITER || nearestRegion.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER))
-				shift--;
-			else if (region == null)
-				shift--;
-			shift++;
-		}
-		if (region != null && region.getType() == CSSRegionContexts.CSS_LBRACE) {
-			RegionIterator it = new RegionIterator(structuredDocument, position);
-			if (!it.hasPrev() || it.prev().getType() != CSSRegionContexts.CSS_RBRACE)
-				shift++;
-			else
-				shift = 0;
-		}
-		return shift;
-	}
-
-	/**
-	 */
-	protected CompoundRegion prevCorrespondence(int position, String regionType) {
-		RegionIterator it = new RegionIterator(structuredDocument, position - 1);
-		ITextRegion region = null;
-		int nest = 1;
-		if (regionType == CSSRegionContexts.CSS_RBRACE) {
-			// skip to LBRACE
-			while (it.hasPrev()) {
-				region = it.prev();
-				if (region.getType() == CSSRegionContexts.CSS_LBRACE)
-					nest--;
-				else if (region.getType() == CSSRegionContexts.CSS_RBRACE)
-					nest++;
-				if (nest <= 0)
-					break;
-			}
-			if (nest == 0)
-				return new CompoundRegion(it.getStructuredDocumentRegion(), region);
-		}
-		if (regionType == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END) {
-			// skip to BRACKET_OPEN
-			while (it.hasPrev()) {
-				region = it.prev();
-				if (region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START)
-					nest--;
-				else if (region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END)
-					nest++;
-				if (nest <= 0)
-					break;
-			}
-			if (nest == 0)
-				return new CompoundRegion(it.getStructuredDocumentRegion(), region);
-		}
-		if (regionType == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
-			// skip to PARENTHESIS_OPEN
-			while (it.hasPrev()) {
-				region = it.prev();
-				if (// region.getType() ==
-				// CSSRegionContexts.CSS_PARENTHESIS_OPEN ||
-				region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
-					nest--;
-				else if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
-					nest++;
-				if (nest <= 0)
-					break;
-			}
-			if (nest == 0)
-				return new CompoundRegion(it.getStructuredDocumentRegion(), region);
-		}
-		return null;
-	}
-
-	/**
-	 */
-	protected CompoundRegion prevCorrespondence(CompoundRegion region) {
-		if (region == null)
-			return null;
-
-		IStructuredDocumentRegion flatNode = region.getDocumentRegion();
-		int position = flatNode.getStart() + region.getStart();
-		return prevCorrespondence(position, region.getType());
-	}
-
-	/**
-	 * Insert the method's description here.
-	 * 
-	 * @return boolean
-	 * @param command
-	 *            org.eclipse.jface.text.DocumentCommand
-	 */
-	protected boolean setRangeForClose(DocumentCommand command) {
-		int position = command.offset;
-
-		if (position == -1 || structuredDocument.getLength() == 0) {
-			return false;
-		}
-
-		try {
-			// find start of line
-			int p = (position == structuredDocument.getLength() ? position - 1 : position);
-
-			int line = structuredDocument.getLineOfOffset(p);
-			int start = structuredDocument.getLineOffset(line);
-			RegionIterator it = new RegionIterator(structuredDocument, start);
-			boolean allWhiteSpace = false;
-			// check whether the text from lStart to position is white space
-			// or not
-			while (it.hasNext()) {
-				ITextRegion region = it.next();
-				if (region.getType() != CSSRegionContexts.CSS_S)
-					break;
-				if (it.getStructuredDocumentRegion().getEndOffset(region) > p) {
-					allWhiteSpace = true;
-					break;
-				}
-			}
-			if (allWhiteSpace) {
-				command.length = command.length - (start - command.offset);
-				command.offset = start;
-				return true;
-			}
-		} catch (BadLocationException excp) {
-			Logger.logException(excp);
-		}
-		return false;
-	}
-
-	/**
-	 */
-	protected void setRangeForNewLine(DocumentCommand command) {
-		int position = command.offset;
-
-		if (position == -1 || structuredDocument.getLength() == 0) {
-			return;
-		}
-
-		try {
-			// add pre-nearest white spaces to replace target
-			if (position > 0) {
-				IStructuredDocumentRegion flatNode = structuredDocument.getRegionAtCharacterOffset(position - 1);
-				if (flatNode != null) {
-					ITextRegion region = flatNode.getRegionAtCharacterOffset(position - 1);
-					if (region.getType() == CSSRegionContexts.CSS_S) {
-						int end = command.offset + command.length;
-						int nLine = structuredDocument.getLineOfOffset(position);
-						int nStartPos = structuredDocument.getLineOffset(nLine);
-						if (nStartPos < flatNode.getStartOffset(region))
-							nStartPos = flatNode.getStartOffset(region);
-						command.offset = nStartPos;
-						command.length = end - command.offset;
-					}
-				}
-			}
-
-			// add post-nearest white spaces to replace target
-			if (position < structuredDocument.getLength()) {
-				IStructuredDocumentRegion flatNode = structuredDocument.getRegionAtCharacterOffset(position);
-				if (flatNode != null) {
-					ITextRegion region = flatNode.getRegionAtCharacterOffset(position);
-					if (region.getType() == CSSRegionContexts.CSS_S) {
-						int nLine = structuredDocument.getLineOfOffset(position);
-						String currentLineDelim = structuredDocument.getLineDelimiter(nLine);
-						int nEndPos = structuredDocument.getLineOffset(nLine) + structuredDocument.getLineLength(nLine) - ((currentLineDelim != null) ? currentLineDelim.length() : 0);
-						if (nEndPos > flatNode.getEndOffset(region))
-							nEndPos = flatNode.getEndOffset(region);
-						command.length = nEndPos - command.offset;
-					}
-				}
-			}
-		} catch (BadLocationException e) {
-			// do not customize command
-		}
-
-	}
-
-	private static int endsWith(String[] searchStrings, String text) {
-		for (int i = 0; i < searchStrings.length; i++) {
-			if (text.endsWith(searchStrings[i]))
-				return i;
-		}
-		return -1;
-	}
-
-	private static int findEndOfWhiteSpace(IDocument document, int offset, int end) throws BadLocationException {
-		while (offset < end) {
-			char c = document.getChar(offset);
-			if (c != ' ' && c != '\t') {
-				return offset;
-			}
-			offset++;
-		}
-		return end;
-	}
-
-
-	private String getIndentString() {
-		StringBuffer indent = new StringBuffer();
-
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		if (preferences != null) {
-			char indentChar = ' ';
-			String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
-			if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
-				indentChar = '\t';
-			}
-			int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
-
-			for (int i = 0; i < indentationWidth; i++) {
-				indent.append(indentChar);
-			}
-		}
-		return indent.toString();
-	}
-	
-	/**
-	 * 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;
-	}
-	
-	/**
-	 * 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
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		if (CSSCorePreferenceNames.SPACE.equals(preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR))) {
-			int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
-
-			StringBuffer indent = new StringBuffer();
-			if (indentationWidth != 0) {
-				int indentSize = indentationWidth;
-				try {
-					IRegion firstLine = document.getLineInformationOfOffset(command.offset);
-					int offsetInLine = command.offset - firstLine.getOffset();
-					int remainder = offsetInLine % indentationWidth;
-
-					indentSize = indentationWidth - remainder;
-				} catch (BadLocationException e) {
-					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-				}
-
-				for (int i = 0; i < indentSize; i++)
-					indent.append(' ');
-			}
-
-			// replace \t characters with spaces
-			command.text = indent.toString();
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCACandidate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCACandidate.java
deleted file mode 100644
index 0de55ee..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCACandidate.java
+++ /dev/null
@@ -1,102 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentassist;
-
-
-
-import org.eclipse.wst.css.ui.internal.image.CSSImageType;
-
-class CSSCACandidate {
-
-	private String fReplacementString = null;
-	private int fCursorPosition = 0;
-	private String fDisplayString = null;
-	private CSSImageType fImageType = null;
-
-	/**
-	 * CSSCACandidate constructor comment.
-	 */
-	CSSCACandidate() {
-		super();
-	}
-
-	/**
-	 *  
-	 */
-	int getCursorPosition() {
-		return fCursorPosition;
-	}
-
-	/**
-	 *  
-	 */
-	String getDisplayString() {
-		return fDisplayString;
-	}
-
-	/**
-	 *  
-	 */
-	CSSImageType getImageType() {
-		return fImageType;
-	}
-
-	/**
-	 *  
-	 */
-	String getReplacementString() {
-		return fReplacementString;
-	}
-
-	/**
-	 *  
-	 */
-	void setCursorPosition(int cursorPosition) {
-		fCursorPosition = cursorPosition;
-	}
-
-	/**
-	 *  
-	 */
-	void setDisplayString(String displayString) {
-		fDisplayString = displayString;
-	}
-
-	/**
-	 *  
-	 */
-	void setImageType(CSSImageType imageType) {
-		fImageType = imageType;
-	}
-
-	/**
-	 *  
-	 */
-	void setReplacementString(String replacementString) {
-		fReplacementString = replacementString;
-	}
-
-	/**
-	 * Returns a String that represents the value of this object.
-	 * 
-	 * @return a string representation of the receiver
-	 */
-	public String toString() {
-		StringBuffer buf = new StringBuffer();
-		buf.append(getReplacementString());
-		buf.append("\"");//$NON-NLS-1$
-		buf.append(getDisplayString());
-		buf.append("\"");//$NON-NLS-1$
-		buf.append("(");//$NON-NLS-1$
-		buf.append(getCursorPosition());
-		buf.append(")");//$NON-NLS-1$
-
-		return buf.toString();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistContext.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistContext.java
deleted file mode 100644
index afdb65e..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistContext.java
+++ /dev/null
@@ -1,402 +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
- ****************************************************************************/
-
-
-package org.eclipse.wst.css.ui.internal.contentassist;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelFinder;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-class CSSContentAssistContext {
-
-	private int fReplaceBegin = -1;
-	private String fTextToReplace = null;
-	private String fTextToCompare = null;
-	private int fTargetPos = -1;
-	private ICSSNode fTargetNode = null;
-	private int fCursorPos = -1;
-	private IStructuredDocument fStructuredDocument = null;
-	private int fDocumentOffset = 0;
-	private char fQuote = 0;
-	private ICSSModel fModel = null;
-
-	/**
-	 *  
-	 */
-	private CSSContentAssistContext() {
-		super();
-	}
-
-	/**
-	 *  
-	 */
-	CSSContentAssistContext(int documentPosition, ICSSNode node, int documentOffset, char quote) {
-		super();
-		fCursorPos = documentPosition;
-		fDocumentOffset = documentOffset;
-		fQuote = quote;
-		initialize(node.getOwnerDocument());
-	}
-
-	/**
-	 * @return int
-	 */
-	int getCursorPos() {
-		return fCursorPos;
-	}
-
-	/**
-	 * @return int
-	 */
-	int getDocumentOffset() {
-		return fDocumentOffset;
-	}
-
-	IStructuredDocument getStructuredDocument() {
-		return fStructuredDocument;
-	}
-
-	ICSSModel getModel() {
-		return fModel;
-	}
-
-	private ICSSNode getNodeAt(int offset) {
-		return (ICSSNode) ((fModel != null) ? fModel.getIndexedRegion(offset) : null);
-	}
-
-	/**
-	 * 
-	 * @return char
-	 */
-	char getQuoteOfStyleAttribute() {
-		return fQuote;
-	}
-
-	ITextRegion getRegionByOffset(int offset) {
-		ITextRegion region = null;
-		if (fStructuredDocument != null) {
-			IStructuredDocumentRegion flatNode = fStructuredDocument.getRegionAtCharacterOffset(offset);
-			if (flatNode != null) {
-				region = flatNode.getRegionAtCharacterOffset(offset);
-			}
-		}
-		return region;
-	}
-
-	/**
-	 *  
-	 */
-	//	String getRegionText() {
-	//		ITextRegion targetRegion = getTargetRegion();
-	//		if (targetRegion != null) {
-	//			return targetRegion.getText();
-	//		} else {
-	//			return ""; //$NON-NLS-1$
-	//		}
-	//	}
-	/**
-	 *  
-	 */
-	int getReplaceBegin() {
-		return fReplaceBegin;
-	}
-
-	ICSSNode getTargetNode() {
-		return fTargetNode;
-	}
-
-	private int getTargetPos() {
-		return fTargetPos;
-	}
-
-	ITextRegion getTargetRegion() {
-		return getRegionByOffset(getTargetPos());
-	}
-
-	private IStructuredDocumentRegion getTargetDocumentRegion() {
-		return getDocumentRegionByOffset(getTargetPos());
-	}
-
-	private IStructuredDocumentRegion getDocumentRegionByOffset(int offset) {
-		return (fStructuredDocument != null) ? fStructuredDocument.getRegionAtCharacterOffset(offset) : null;
-	}
-
-	ITextRegion getTargetRegionPrevious() {
-		ITextRegion previousRegion = null;
-		ITextRegion targetRegion = getTargetRegion();
-		RegionIterator iterator = null;
-		if (targetRegion == null) {
-			if (0 < fCursorPos) {
-				iterator = new RegionIterator(fStructuredDocument, fCursorPos - 1);
-			}
-		} else {
-			iterator = getRegionIterator();
-			if (iterator.hasPrev()) {
-				iterator.prev();
-			} else {
-				iterator = null;
-			}
-		}
-		if (iterator != null) {
-			while (iterator.hasPrev()) {
-				ITextRegion region = iterator.prev();
-				String type = region.getType();
-				if (type != CSSRegionContexts.CSS_S && type != CSSRegionContexts.CSS_COMMENT && type != CSSRegionContexts.CSS_CDO && type != CSSRegionContexts.CSS_CDC) {
-					previousRegion = region;
-					break;
-				}
-			}
-		}
-
-		return previousRegion;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	String getTextToCompare() {
-		return fTextToCompare;
-	}
-
-	/**
-	 *  
-	 */
-	String getTextToReplace() {
-		return fTextToReplace;
-	}
-
-	/**
-	 *  
-	 */
-	private void initialize(ICSSDocument doc) {
-		if (doc == null) {
-			return;
-		}
-		ICSSModel model = doc.getModel();
-		fModel = model;
-		fStructuredDocument = model.getStructuredDocument();
-
-		initializeTargetPos();
-		initializeTargetText();
-		initializeTargetNode();
-	}
-
-	/**
-	 *  
-	 */
-	private void initializeTargetNode() {
-		if (fCursorPos == 0) {
-			fTargetNode = fModel.getDocument();
-			return;
-		}
-
-		// find edge of tree node
-		ICSSNode cursorNode = getNodeAt(fCursorPos);
-		if (cursorNode == null) { // end of document
-			cursorNode = fModel.getDocument();
-		}
-		ICSSNode node = null;
-		IStructuredDocumentRegion flatNode = fStructuredDocument.getRegionAtCharacterOffset(fCursorPos - 1);
-		while (flatNode != null && (node = getNodeAt(flatNode.getStartOffset())) == cursorNode && ((IndexedRegion) node).getStartOffset() != flatNode.getStartOffset()) {
-			flatNode = flatNode.getPrevious();
-		}
-		if (flatNode == null) { // top of document
-			fTargetNode = (node == null) ? fModel.getDocument() : node;
-			return;
-		}
-		//   v<--|
-		//   AAAAAA
-		// BBBBBBBBBB cursorNode:A , node:B -> target is A
-		if (cursorNode != null) {
-			for (ICSSNode parent = cursorNode.getParentNode(); parent != null; parent = parent.getParentNode()) {
-				if (parent == cursorNode) {
-					fTargetNode = cursorNode;
-					return;
-				}
-			}
-		}
-		//     v<--|
-		//   AAA
-		// BBBBBBBBBB cursorNode:B , node:A -> depend on A's node type
-		short nodeType = node.getNodeType();
-		if (nodeType == ICSSNode.STYLEDECLITEM_NODE || nodeType == ICSSNode.CHARSETRULE_NODE || nodeType == ICSSNode.IMPORTRULE_NODE) {
-			String type = CSSUtil.getStructuredDocumentRegionType(flatNode);
-			if (type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-				fTargetNode = node.getParentNode();
-			} else {
-				fTargetNode = node;
-			}
-			//			fTargetNode = (bOverSemiColon) ? node.getParentNode() : node;
-		} else if (CSSUtil.getStructuredDocumentRegionType(flatNode) == CSSRegionContexts.CSS_RBRACE) {
-			fTargetNode = node.getParentNode();
-		} else {
-			fTargetNode = node;
-		}
-
-		return;
-	}
-
-	/**
-	 *  
-	 */
-	private void initializeTargetPos() {
-		if (fCursorPos == 0 || isSpecialDelimiterRegion(fCursorPos - 1)) {
-			fTargetPos = fCursorPos;
-		} else {
-			fTargetPos = fCursorPos - 1;
-		}
-	}
-
-	/**
-	 *  
-	 */
-	private void initializeTargetText() {
-		ITextRegion targetRegion = getTargetRegion();
-		IStructuredDocumentRegion documentRegion = getTargetDocumentRegion();
-		if (targetRegion == null) {
-			fReplaceBegin = fCursorPos;
-			fTextToReplace = ""; //$NON-NLS-1$
-			fTextToCompare = ""; //$NON-NLS-1$
-		} else {
-			String regionText = documentRegion.getText(targetRegion);
-			int regionStart = documentRegion.getStartOffset(targetRegion);
-			if (regionStart == fCursorPos || regionText.trim().length() == 0 || regionStart + regionText.length() - 1 < fTargetPos) {
-				// to insertion
-				fReplaceBegin = fCursorPos;
-				fTextToReplace = ""; //$NON-NLS-1$
-				fTextToCompare = ""; //$NON-NLS-1$
-			} else {
-				// to replace
-				fReplaceBegin = regionStart;
-				fTextToReplace = regionText;
-				fTextToCompare = regionText.substring(0, fCursorPos - fReplaceBegin);
-			}
-		}
-	}
-
-	/**
-	 *  
-	 */
-	private boolean isSpecialDelimiterRegion(int pos) {
-		ITextRegion region = getRegionByOffset(pos);
-		String type = region.getType();
-		return (type == CSSRegionContexts.CSS_LBRACE || type == CSSRegionContexts.CSS_RBRACE || type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_SEPARATOR || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR);
-	}
-
-	/**
-	 *  
-	 */
-	boolean isTargetPosAfterOf(String regionType) {
-		int start = ((IndexedRegion) fTargetNode).getStartOffset();
-		if (start < 0 || ((IndexedRegion) fTargetNode).getEndOffset() <= 0) {
-			return false;
-		}
-
-		RegionIterator iRegion = new RegionIterator(fStructuredDocument, start);
-		while (iRegion.hasNext()) {
-			ITextRegion region = iRegion.next();
-			if (fTargetPos < iRegion.getStructuredDocumentRegion().getTextEndOffset(region)) {
-				break;
-			}
-			if (region.getType() == regionType) {
-				return true;
-			}
-		}
-
-		return false;
-	}
-
-	/**
-	 *  
-	 */
-	boolean isTargetPosBeforeOf(String regionType) {
-		return !isTargetPosAfterOf(regionType);
-	}
-
-	/**
-	 * @return boolean
-	 * @param regionType
-	 *            java.lang.String
-	 */
-	boolean targetFollows(String regionType) {
-		RegionIterator iRegion;
-		ITextRegion region = null;
-		if (fStructuredDocument.getLength() <= fTargetPos) {
-			iRegion = new RegionIterator(fStructuredDocument, fStructuredDocument.getLength() - 1);
-		} else {
-			iRegion = new RegionIterator(fStructuredDocument, fTargetPos);
-			try {
-				if (!Character.isWhitespace(fStructuredDocument.getChar(fTargetPos)) && iRegion.hasPrev()) {
-					region = iRegion.prev();
-				}
-			} catch (BadLocationException e) {
-				iRegion = new RegionIterator(fStructuredDocument, fStructuredDocument.getLength() - 1);
-			}
-		}
-		while (iRegion.hasPrev()) {
-			region = iRegion.prev();
-			String type = region.getType();
-			if (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT) {
-				continue;
-			} else {
-				break;
-			}
-		}
-		if (region != null && region.getType() == regionType) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-
-	/**
-	 *  
-	 */
-	boolean targetHas(String regionType) {
-		int start = ((IndexedRegion) fTargetNode).getStartOffset();
-		int end = ((IndexedRegion) fTargetNode).getEndOffset();
-		if (start < 0 || end <= 0) {
-			return false;
-		}
-		RegionIterator iRegion = new RegionIterator(fStructuredDocument, start);
-		while (iRegion.hasNext()) {
-			ITextRegion region = iRegion.next();
-			if (end <= iRegion.getStructuredDocumentRegion().getStartOffset(region)) {
-				break;
-			}
-			if (region.getType() == regionType) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	RegionIterator getRegionIterator() {
-		return new RegionIterator(getStructuredDocument(), getTargetPos());
-	}
-
-	/**
-	 *  
-	 */
-	CSSMetaModel getMetaModel() {
-		CSSMetaModelFinder finder = CSSMetaModelFinder.getInstance();
-		return finder.findMetaModelFor(getModel());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java
deleted file mode 100644
index 2d30ad6..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java
+++ /dev/null
@@ -1,330 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentassist;
-
-
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.css.core.internal.provisional.adapters.ICSSModelAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.ui.internal.templates.TemplateContextTypeIdsCSS;
-import org.eclipse.wst.html.core.internal.htmlcss.StyleAdapterFactory;
-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.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistUtilities;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-
-public class CSSContentAssistProcessor implements IContentAssistProcessor {
-
-	private int fDocumentOffset = 0;
-	private char fQuote = 0;
-	private CSSTemplateCompletionProcessor fTemplateProcessor = null;
-
-	/**
-	 * 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 indexedNode = ContentAssistUtils.getNodeAt((StructuredTextViewer) viewer, documentPosition + fDocumentOffset);
-		IDOMNode xNode = null;
-		IDOMNode parent = null;
-		CSSProposalArranger arranger = null;
-		boolean isEmptyDocument = false;
-
-		// bail if we couldn't get an indexed node
-		// if(indexedNode == null) return new ICompletionProposal[0];
-		if (indexedNode instanceof IDOMNode) {
-			xNode = (IDOMNode) indexedNode;
-			parent = (IDOMNode) xNode.getParentNode();
-		}
-		// need to get in here if there in the no 0 region <style>|</style>
-		// case
-		if (xNode != null && xNode.getNodeName().equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
-			// now we know the cursor is in a <style> tag w/out region
-			IStructuredModel cssModel = getCSSModel(xNode);
-			if (cssModel != null) {
-				// adjust offsets for embedded style
-				int offset = documentPosition;
-				int pos = 0;
-				IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(pos);
-				if (keyIndexedNode == null) {
-					keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
-				}
-				arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, (char) 0);
-			}
-		} else if (parent != null && parent.getNodeName().equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
-			// now we know the cursor is in a <style> tag with a region
-			// use the parent because that will be the <style> tag
-			IStructuredModel cssModel = getCSSModel(parent);
-			if (cssModel != null) {
-				// adjust offsets for embedded style
-				int offset = indexedNode.getStartOffset();
-				int pos = documentPosition - offset;
-				IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(pos);
-				if (keyIndexedNode == null) {
-					keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
-				}
-				arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, (char) 0);
-			}
-		} else if (indexedNode instanceof IDOMNode) {
-			// get model for node w/ style attribute
-			IStructuredModel cssModel = getCSSModel((IDOMNode) indexedNode);
-			if (cssModel != null) {
-				IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(documentPosition - fDocumentOffset);
-				if (keyIndexedNode == null) {
-					keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
-				}
-				if (keyIndexedNode instanceof ICSSNode) {
-					// inline style for a tag, not embedded
-					arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, fDocumentOffset, fQuote);
-				}
-			}
-		} else if (indexedNode instanceof ICSSNode) {
-			// when editing external CSS using CSS Designer, ICSSNode is
-			// passed.
-			ICSSDocument cssdoc = ((ICSSNode) indexedNode).getOwnerDocument();
-			if (cssdoc != null) {
-				IStructuredModel cssModel = cssdoc.getModel();
-				if (cssModel != null) {
-					IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(documentPosition - fDocumentOffset);
-					if (keyIndexedNode == null) {
-						keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
-					}
-					if (keyIndexedNode instanceof ICSSNode) {
-						// inline style for a tag, not embedded
-						arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, fDocumentOffset, fQuote);
-					}
-				}
-			}
-		} else if (indexedNode == null && isViewerEmpty(viewer)) {
-			isEmptyDocument = true;
-			// the top of empty CSS Document
-			IStructuredModel cssModel = null;
-			try {
-				cssModel = StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
-				if (cssModel instanceof ICSSModel) {
-					IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(documentPosition - fDocumentOffset);
-					if (keyIndexedNode == null) {
-						keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
-					}
-					if (keyIndexedNode instanceof ICSSNode) {
-						// inline style for a tag, not embedded
-						arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, fDocumentOffset, fQuote);
-					}
-				}
-			} finally {
-				if (cssModel != null)
-					cssModel.releaseFromRead();
-			}
-		}
-
-		ICompletionProposal[] proposals = new ICompletionProposal[0];
-		if (arranger != null) {
-			fDocumentOffset = 0;
-			proposals = arranger.getProposals();
-
-			ICompletionProposal[] newfileproposals = new ICompletionProposal[0];
-			ICompletionProposal[] anyproposals = new ICompletionProposal[0];
-			// add template proposals
-			if (getTemplateCompletionProcessor() != null) {
-				if (isEmptyDocument) {
-					getTemplateCompletionProcessor().setContextType(TemplateContextTypeIdsCSS.NEW);
-					newfileproposals = getTemplateCompletionProcessor().computeCompletionProposals(viewer, documentPosition);
-				}
-				getTemplateCompletionProcessor().setContextType(TemplateContextTypeIdsCSS.ALL);
-				anyproposals = getTemplateCompletionProcessor().computeCompletionProposals(viewer, documentPosition);
-			}
-
-			// add end tag if parent is not closed
-			ICompletionProposal endTag = XMLContentAssistUtilities.computeXMLEndTagProposal(viewer, documentPosition, indexedNode, HTML40Namespace.ElementName.STYLE, SharedXMLEditorPluginImageHelper.IMG_OBJ_TAG_GENERIC); //$NON-NLS-1$
-
-			// add the additional proposals
-			int additionalLength = newfileproposals.length + anyproposals.length;
-			additionalLength = (endTag != null) ? ++additionalLength : additionalLength;
-			if (additionalLength > 0) {
-				ICompletionProposal[] plusOnes = new ICompletionProposal[proposals.length + additionalLength];
-				int appendPos = proposals.length;
-				// add end tag proposal
-				if (endTag != null) {
-					System.arraycopy(proposals, 0, plusOnes, 1, proposals.length);
-					plusOnes[0] = endTag;
-					++appendPos;
-				} else {
-					System.arraycopy(proposals, 0, plusOnes, 0, proposals.length);
-				}
-				// add items in newfileproposals
-				for (int i = 0; i < newfileproposals.length; ++i) {
-					plusOnes[appendPos + i] = newfileproposals[i];
-				}
-				// add items in anyproposals
-				appendPos = appendPos + newfileproposals.length;
-				for (int i = 0; i < anyproposals.length; ++i) {
-					plusOnes[appendPos + i] = anyproposals[i];
-				}
-				proposals = plusOnes;
-			}
-		}
-		return proposals;
-	}
-
-	/**
-	 * 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;
-	}
-
-	/**
-	 * Get CSSModel for an indexed node
-	 * 
-	 * @param indexedNode
-	 * @return IStructuredModel
-	 */
-	// private IStructuredModel getCSSModel(IndexedRegion indexedNode) {
-	// if (indexedNode == null) return null;
-	// Node node = (Node)indexedNode;
-	// INodeNotifier notifier = (INodeNotifier)node.getParentNode();
-	// if (notifier == null) return null;
-	// INodeAdapter adapter =
-	// StyleAdapterFactory.getInstance().adapt(notifier);
-	// if (adapter == null || !(adapter instanceof CSSModelAdapter)) return
-	// null;
-	// CSSModelAdapter modelAdapter = (CSSModelAdapter)adapter;
-	// return modelAdapter.getModel();
-	// }
-	/**
-	 * Returns the CSSmodel for a given XML node.
-	 * 
-	 * @param element
-	 * @return IStructuredModel
-	 */
-	private IStructuredModel getCSSModel(IDOMNode element) {
-		if (element == null)
-			return null;
-		INodeAdapter adapter = StyleAdapterFactory.getInstance().adapt(element);
-		if (adapter == null || !(adapter instanceof ICSSModelAdapter))
-			return null;
-		ICSSModelAdapter modelAdapter = (ICSSModelAdapter) adapter;
-		return modelAdapter.getModel();
-	}
-
-	/**
-	 * 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 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;
-	}
-
-	/**
-	 * 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 null;
-	}
-
-	/**
-	 * Insert the method's description here. Creation date: (2001/05/22
-	 * 10:37:05)
-	 * 
-	 * @param offset
-	 *            int
-	 */
-	public void setDocumentOffset(int offset) {
-		fDocumentOffset = offset;
-	}
-
-	/**
-	 * 
-	 * @param quote
-	 *            char
-	 */
-	public void setQuoteCharOfStyleAttribute(char quote) {
-		fQuote = quote;
-	}
-
-	private CSSTemplateCompletionProcessor getTemplateCompletionProcessor() {
-		if (fTemplateProcessor == null) {
-			fTemplateProcessor = new CSSTemplateCompletionProcessor();
-		}
-		return fTemplateProcessor;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalArranger.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalArranger.java
deleted file mode 100644
index d29fa64..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalArranger.java
+++ /dev/null
@@ -1,169 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-import org.w3c.dom.css.CSSFontFaceRule;
-
-class CSSProposalArranger {
-
-	private List fProposals = new ArrayList();
-	private CSSContentAssistContext fContext = null;
-
-	/**
-	 * CSSProposalArranger constructor comment.
-	 */
-	private CSSProposalArranger() {
-		super();
-	}
-
-	/**
-	 * CSSProposalArranger constructor comment.
-	 */
-	CSSProposalArranger(int documentPosition, ICSSNode node, int documentOffset, char quote) {
-		super();
-		fContext = new CSSContentAssistContext(documentPosition, node, documentOffset, quote);
-	}
-
-	/**
-	 *  
-	 */
-	void buildProposals() {
-		fProposals.clear();
-
-		/*
-		 * String text; ICompletionProposal item; text = "---- Test
-		 * Information ----"; item = new CompletionProposal("",
-		 * fContext.getReplaceBegin(), 0, 0, null, text, null, null);
-		 * fProposals.add(item);
-		 * 
-		 * text = "Target: \"" + fContext.getRegionText() + "\"";
-		 * 
-		 * item = new CompletionProposal("", fContext.getReplaceBegin(), 0, 0,
-		 * null, text, null, null); fProposals.add(item);
-		 * 
-		 * text = fContext.getTargetNode().getClass().toString(); int
-		 * lastPeriodPos = text.lastIndexOf('.'); text = "Node: " +
-		 * text.substring(lastPeriodPos + 1); item = new
-		 * CompletionProposal("", fContext.getReplaceBegin(), 0, 0, null,
-		 * text, null, null); fProposals.add(item);
-		 */
-
-		ICSSNode targetNode = fContext.getTargetNode();
-		//int targetPos = fContext.getTargetPos();
-		if (targetNode instanceof ICSSStyleSheet) {
-			buildProposalsForAnyRule();
-		} else if ((targetNode instanceof ICSSMediaRule && fContext.isTargetPosAfterOf(CSSRegionContexts.CSS_LBRACE)) || (targetNode instanceof ICSSStyleRule && fContext.isTargetPosBeforeOf(CSSRegionContexts.CSS_LBRACE))) {
-			buildProposalsForAnyRule();
-			//		buildProposalsForStyleRule();
-		} else if ((targetNode instanceof ICSSPageRule && fContext.isTargetPosBeforeOf(CSSRegionContexts.CSS_LBRACE))) {
-			buildProposalsForPageRulePseudoClass();
-		} else if ((targetNode instanceof ICSSStyleRule || targetNode instanceof CSSFontFaceRule || targetNode instanceof ICSSPageRule || targetNode instanceof ICSSStyleDeclaration) && (targetNode.getOwnerDocument() instanceof ICSSStyleDeclaration || fContext.targetFollows(CSSRegionContexts.CSS_DECLARATION_DELIMITER) || fContext.targetFollows(CSSRegionContexts.CSS_LBRACE))) {
-			buildProposalsForDeclarationName();
-		} else if (targetNode instanceof ICSSStyleDeclItem) {
-			if (fContext.isTargetPosAfterOf(CSSRegionContexts.CSS_DECLARATION_SEPARATOR)) {
-				buildProposalsForDeclarationValue();
-			} else {
-				buildProposalsForDeclarationName();
-			}
-		} else if (targetNode instanceof ICSSPrimitiveValue) {
-			buildProposalsForDeclarationValue();
-		}
-		/*
-		 * else if (targetNode instanceof ICSSPrimitiveValue || ((targetNode
-		 * instanceof ICSSStyleRule || targetNode instanceof CSSFontFaceRule ||
-		 * targetNode instanceof ICSSStyleDeclaration || targetNode instanceof
-		 * ICSSStyleDeclItem) &&
-		 * fContext.isTargetPosAfterOf(CSSRegionContexts.COLON))) {
-		 * buildProposalsForDeclarationValue(); }
-		 */
-
-		// for Test
-	}
-
-	/**
-	 *  
-	 */
-	void buildProposalsForAnyRule() {
-		CSSProposalGenerator generator;
-		generator = new CSSProposalGeneratorForAtmarkRule(fContext);
-		fProposals.addAll(generator.getProposals());
-		generator = new CSSProposalGeneratorForHTMLTag(fContext);
-		fProposals.addAll(generator.getProposals());
-		generator = new CSSProposalGeneratorForPseudoSelector(fContext);
-		fProposals.addAll(generator.getProposals());
-	}
-
-	/**
-	 *  
-	 */
-	void buildProposalsForDeclarationName() {
-		CSSProposalGenerator generator;
-		generator = new CSSProposalGeneratorForDeclarationName(fContext);
-		fProposals.addAll(generator.getProposals());
-	}
-
-	/**
-	 *  
-	 */
-	void buildProposalsForDeclarationValue() {
-		CSSProposalGenerator generator;
-		generator = new CSSProposalGeneratorForDeclarationValue(fContext);
-		fProposals.addAll(generator.getProposals());
-	}
-
-	/**
-	 *  
-	 */
-	void buildProposalsForPageRulePseudoClass() {
-		CSSProposalGenerator generator;
-		generator = new CSSProposalGeneratorForPseudoSelector(fContext);
-		fProposals.addAll(generator.getProposals());
-	}
-
-	/**
-	 *  
-	 */
-	void buildProposalsForStyleRule() {
-		CSSProposalGenerator generator;
-		generator = new CSSProposalGeneratorForHTMLTag(fContext);
-		fProposals.addAll(generator.getProposals());
-		generator = new CSSProposalGeneratorForPseudoSelector(fContext);
-		fProposals.addAll(generator.getProposals());
-	}
-
-	/**
-	 *  
-	 */
-	ICompletionProposal[] getProposals() {
-		buildProposals();
-		ICompletionProposal[] proposalArray = new CompletionProposal[fProposals.size()];
-		Iterator iItem = fProposals.iterator();
-		for (int i = 0; iItem.hasNext(); i++) {
-			proposalArray[i] = (ICompletionProposal) iItem.next();
-		}
-		return proposalArray;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGenerator.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGenerator.java
deleted file mode 100644
index a04b569..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGenerator.java
+++ /dev/null
@@ -1,232 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-import org.eclipse.wst.css.ui.internal.image.CSSImageHelper;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-abstract class CSSProposalGenerator {
-
-
-	protected class StringAndOffset {
-		StringAndOffset(String string, int offset) {
-			this.fString = string;
-			this.fOffset = offset;
-		}
-
-		String fString;
-		int fOffset;
-	}
-
-	protected CSSContentAssistContext fContext = null;
-
-	/**
-	 * CSSProposalGenerator constructor comment.
-	 */
-	private CSSProposalGenerator() {
-		super();
-	}
-
-	CSSProposalGenerator(CSSContentAssistContext context) {
-		super();
-		fContext = context;
-	}
-
-	/**
-	 *  
-	 */
-	protected boolean checkLeadingColon() {
-		boolean hasLeadingColon = false;
-		ITextRegion targetRegion = fContext.getTargetRegion();
-		if (targetRegion == null && 0 < fContext.getCursorPos()) {
-			targetRegion = fContext.getRegionByOffset(fContext.getCursorPos() - 1);
-			if (targetRegion != null && targetRegion.getType() == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
-				hasLeadingColon = true;
-			}
-		} else if (targetRegion != null) {
-			RegionIterator iterator = fContext.getRegionIterator();
-			if (iterator.hasPrev()) {
-				iterator.prev();
-				if (iterator.hasPrev() && iterator.prev().getType() == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
-					hasLeadingColon = true;
-				}
-			}
-		}
-		return hasLeadingColon;
-	}
-
-	/**
-	 *  
-	 */
-	protected StringAndOffset generateBraces() {
-		StringBuffer buf = new StringBuffer();
-		String lineDelimiter = fContext.getStructuredDocument().getLineDelimiter();
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		String indentStr = getIndentString();
-		if (preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_NEWLINE_ON_OPEN_BRACE)) {
-			buf.append(lineDelimiter);
-		}
-		buf.append("{");//$NON-NLS-1$
-		if (preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE)) {
-			buf.append(lineDelimiter);
-			buf.append(indentStr);
-		} else {
-			buf.append(" ");//$NON-NLS-1$
-		}
-		int offset = buf.length();
-		if (preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE)) {
-			buf.append(lineDelimiter);
-		} else {
-			buf.append(" ");//$NON-NLS-1$
-		}
-		buf.append("}");//$NON-NLS-1$
-		return new StringAndOffset(buf.toString(), offset);
-	}
-
-	/**
-	 *  
-	 */
-	protected StringAndOffset generateParenthesis() {
-		StringBuffer buf = new StringBuffer();
-		int offset;
-		buf.append("(");//$NON-NLS-1$
-		offset = 1;
-		buf.append(")");//$NON-NLS-1$
-		return new StringAndOffset(buf.toString(), offset);
-	}
-
-	/**
-	 *  
-	 */
-	protected StringAndOffset generateQuotes() {
-		StringBuffer buf = new StringBuffer();
-		char quoteChar = getQuoteChar();
-		buf.append(quoteChar);
-		buf.append(quoteChar);
-		return new StringAndOffset(buf.toString(), 1);
-	}
-
-	/**
-	 *  
-	 */
-	protected StringAndOffset generateSemicolon() {
-		StringBuffer buf = new StringBuffer();
-		int offset;
-		buf.append(";");//$NON-NLS-1$
-		offset = 0;
-		return new StringAndOffset(buf.toString(), offset);
-	}
-
-	/**
-	 *  
-	 */
-	protected StringAndOffset generateURI() {
-		StringBuffer buf = new StringBuffer();
-		
-		boolean isQuoteInURI = CSSCorePlugin.getDefault().getPluginPreferences().getBoolean(CSSCorePreferenceNames.FORMAT_QUOTE_IN_URI);
-		char quoteChar = getQuoteChar();
-		buf.append("url(");//$NON-NLS-1$
-		if (isQuoteInURI) {
-			buf.append(quoteChar);
-		}
-		int offset = buf.length();
-		if (isQuoteInURI) {
-			buf.append(quoteChar);
-		}
-		buf.append(")");//$NON-NLS-1$
-		return new StringAndOffset(buf.toString(), offset);
-	}
-
-	abstract protected Iterator getCandidates();
-
-	List getProposals() {
-		List proposals = new ArrayList();
-
-		CSSImageHelper imageHelper = CSSImageHelper.getInstance();
-		Iterator i = getCandidates();
-		while (i.hasNext()) {
-			CSSCACandidate candidate = (CSSCACandidate) i.next();
-			Image image = imageHelper.getImage(candidate.getImageType());
-			ICompletionProposal item = new CompletionProposal(candidate.getReplacementString(), fContext.getReplaceBegin() + fContext.getDocumentOffset(), fContext.getTextToReplace().length(), candidate.getCursorPosition(), image, candidate.getDisplayString(), null, null);
-			proposals.add(item);
-		}
-
-		return proposals;
-	}
-
-	/**
-	 * 
-	 * @return char
-	 */
-	private char getQuoteChar() {
-
-		String quoteStr = CSSCorePlugin.getDefault().getPluginPreferences().getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-		char quoteChar = (quoteStr != null && 0 < quoteStr.length()) ? quoteStr.charAt(0) : '"';
-		char attrQuote = fContext.getQuoteOfStyleAttribute();
-		if (attrQuote != 0) {
-			if (attrQuote == '"' && quoteChar == '"') {
-				quoteChar = '\'';
-			} else if (attrQuote == '\'' && quoteChar == '\'') {
-				quoteChar = '"';
-			}
-		}
-		return quoteChar;
-	}
-
-	/**
-	 *  
-	 */
-	protected boolean isMatch(String text) {
-		String textToCompare = fContext.getTextToCompare();
-		if (textToCompare.length() == 0) {
-			return true;
-		} else {
-			return (text.toUpperCase().indexOf(textToCompare.toUpperCase()) == 0);
-		}
-		/*
-		 * String textToReplace = fContext.getTextToReplace(); if
-		 * (textToReplace.length() == 0) { return true; } else { return
-		 * (text.toUpperCase().indexOf(textToReplace.toUpperCase()) == 0); }
-		 */
-	}
-	
-
-	private String getIndentString() {
-		StringBuffer indent = new StringBuffer();
-
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		if (preferences != null) {
-			char indentChar = ' ';
-			String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
-			if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
-				indentChar = '\t';
-			}
-			int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
-
-			for (int i = 0; i < indentationWidth; i++) {
-				indent.append(indentChar);
-			}
-		}
-		return indent.toString();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForAtmarkRule.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForAtmarkRule.java
deleted file mode 100644
index 056c890..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForAtmarkRule.java
+++ /dev/null
@@ -1,292 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.SelectionCollector;
-import org.eclipse.wst.css.ui.internal.image.CSSImageType;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-class CSSProposalGeneratorForAtmarkRule extends CSSProposalGenerator {
-
-	private boolean fUseUpperCase = false;
-	private static final String CHARSET = "@charset";//$NON-NLS-1$
-	private static final String FONT_FACE = "@font-face";//$NON-NLS-1$
-	private static final String IMPORT = "@import";//$NON-NLS-1$
-	private static final String MEDIA = "@media";//$NON-NLS-1$
-	private static final String PAGE = "@page";//$NON-NLS-1$
-
-	/**
-	 * CSSAtmarkRuleProposalGenerator constructor comment.
-	 * 
-	 */
-	CSSProposalGeneratorForAtmarkRule(CSSContentAssistContext context) {
-		super(context);
-		fUseUpperCase = CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER;
-	}
-
-	/**
-	 *  
-	 */
-	private CSSCACandidate getCandidateCharsetRule() {
-		// check content model
-		CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
-		if (!util.collectNodesByType(CSSMMNode.TYPE_CHARSET_RULE).hasNext()) {
-			return null;
-		}
-
-		// check if embedded or not
-		if (fContext.getModel().getStyleSheetType() == ICSSModel.EMBEDDED) {
-			return null;
-		}
-
-		// check if caret precede all other rules.
-		int offset = fContext.getCursorPos();
-		if (0 < offset) {
-			SelectionCollector trav = new SelectionCollector();
-			trav.setRegion(0, offset - 1);
-			trav.apply(fContext.getModel().getDocument());
-			Iterator i = trav.getSelectedNodes().iterator();
-			while (i.hasNext()) {
-				Object obj = i.next();
-				if (obj instanceof ICSSNode && !(obj instanceof ICSSDocument)) {
-					return null;
-				}
-			}
-		}
-
-		int cursorPos = 0;
-		String ident = (fUseUpperCase) ? CHARSET.toUpperCase() : CHARSET.toLowerCase();
-		StringBuffer buf = new StringBuffer();
-		buf.append(ident);
-		buf.append(" ");//$NON-NLS-1$
-		cursorPos = buf.length();
-		StringAndOffset sao;
-		sao = generateQuotes();
-		buf.append(sao.fString);
-		cursorPos += sao.fOffset;
-		sao = generateSemicolon();
-		buf.append(sao.fString);
-
-		String text = buf.toString();
-
-		if (isMatch(text)) {
-			CSSCACandidate item = new CSSCACandidate();
-			item.setReplacementString(text);
-			item.setCursorPosition(cursorPos);
-			item.setDisplayString(ident);
-			item.setImageType(CSSImageType.RULE_CHARSET);
-			return item;
-		} else {
-			return null;
-		}
-	}
-
-	/**
-	 *  
-	 */
-	private CSSCACandidate getCandidateFontFaceRule() {
-		CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
-		if (!util.collectNodesByType(CSSMMNode.TYPE_FONT_FACE_RULE).hasNext()) {
-			return null;
-		}
-
-		int cursorPos = 0;
-		String ident = (fUseUpperCase) ? FONT_FACE.toUpperCase() : FONT_FACE.toLowerCase();
-		StringBuffer buf = new StringBuffer();
-		buf.append(ident);
-		buf.append(" ");//$NON-NLS-1$
-		cursorPos = buf.length();
-		StringAndOffset sao;
-		sao = generateBraces();
-		buf.append(sao.fString);
-		cursorPos += sao.fOffset;
-
-		String text = buf.toString();
-
-		if (isMatch(text)) {
-			CSSCACandidate item = new CSSCACandidate();
-			item.setReplacementString(buf.toString());
-			item.setCursorPosition(cursorPos);
-			item.setDisplayString(ident);
-			item.setImageType(CSSImageType.RULE_FONTFACE);
-			return item;
-		} else {
-			return null;
-		}
-	}
-
-	/**
-	 *  
-	 */
-	private CSSCACandidate getCandidateImportRule() {
-		// check content model
-		CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
-		if (!util.collectNodesByType(CSSMMNode.TYPE_IMPORT_RULE).hasNext()) {
-			return null;
-		}
-
-		// charset and import can precede import rule.
-		int offset = fContext.getCursorPos();
-		if (0 < offset) {
-			SelectionCollector trav = new SelectionCollector();
-			trav.setRegion(0, offset - 1);
-			trav.apply(fContext.getModel().getDocument());
-			Iterator i = trav.getSelectedNodes().iterator();
-			while (i.hasNext()) {
-				Object obj = i.next();
-				if (obj instanceof ICSSNode && !(obj instanceof ICSSDocument || obj instanceof ICSSCharsetRule || obj instanceof ICSSImportRule)) {
-					return null;
-				}
-			}
-		}
-
-		int cursorPos = 0;
-		String ident = (fUseUpperCase) ? IMPORT.toUpperCase() : IMPORT.toLowerCase();
-		StringBuffer buf = new StringBuffer();
-		buf.append(ident);
-		buf.append(" ");//$NON-NLS-1$
-		cursorPos = buf.length();
-		StringAndOffset sao;
-		sao = generateURI();
-		buf.append(sao.fString);
-		cursorPos += sao.fOffset;
-		sao = generateSemicolon();
-		buf.append(sao.fString);
-
-		String text = buf.toString();
-
-		if (isMatch(text)) {
-			CSSCACandidate item = new CSSCACandidate();
-			item.setReplacementString(buf.toString());
-			item.setCursorPosition(cursorPos);
-			item.setDisplayString(ident);
-			item.setImageType(CSSImageType.RULE_IMPORT);
-			return item;
-		} else {
-			return null;
-		}
-	}
-
-	/**
-	 *  
-	 */
-	private CSSCACandidate getCandidateMediaRule() {
-		CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
-		if (!util.collectNodesByType(CSSMMNode.TYPE_MEDIA_RULE).hasNext()) {
-			return null;
-		}
-
-		int cursorPos = 0;
-		String ident = (fUseUpperCase) ? MEDIA.toUpperCase() : MEDIA.toLowerCase();
-		StringBuffer buf = new StringBuffer();
-		buf.append(ident);
-		buf.append("  ");//$NON-NLS-1$
-		cursorPos = buf.length() - 1;
-		StringAndOffset sao;
-		sao = generateBraces();
-		buf.append(sao.fString);
-
-		String text = buf.toString();
-
-		if (isMatch(text)) {
-			CSSCACandidate item = new CSSCACandidate();
-			item.setReplacementString(buf.toString());
-			item.setCursorPosition(cursorPos);
-			item.setDisplayString(ident);
-			item.setImageType(CSSImageType.RULE_MEDIA);
-			return item;
-		} else {
-			return null;
-		}
-	}
-
-	/**
-	 *  
-	 */
-	private CSSCACandidate getCandidatePageRule() {
-		CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
-		if (!util.collectNodesByType(CSSMMNode.TYPE_PAGE_RULE).hasNext()) {
-			return null;
-		}
-
-		int cursorPos = 0;
-		String ident = (fUseUpperCase) ? PAGE.toUpperCase() : PAGE.toLowerCase();
-		StringBuffer buf = new StringBuffer();
-		buf.append(ident);
-		buf.append(" ");//$NON-NLS-1$
-		cursorPos = buf.length();
-		StringAndOffset sao;
-		sao = generateBraces();
-		buf.append(sao.fString);
-		cursorPos += sao.fOffset;
-
-		String text = buf.toString();
-
-		if (isMatch(text)) {
-			CSSCACandidate item = new CSSCACandidate();
-			item.setReplacementString(buf.toString());
-			item.setCursorPosition(cursorPos);
-			item.setDisplayString(ident);
-			item.setImageType(CSSImageType.RULE_PAGE);
-			return item;
-		} else {
-			return null;
-		}
-	}
-
-	/**
-	 * getCandidates method comment.
-	 */
-	protected Iterator getCandidates() {
-		List candidates = new ArrayList();
-
-		ITextRegion region = fContext.getTargetRegionPrevious();
-		//	ITextRegion region = fContext.getSignificantTargetRegion();
-		if (region != null) {
-			String type = region.getType();
-			if (type != CSSRegionContexts.CSS_RBRACE && type != CSSRegionContexts.CSS_DELIMITER) {
-				return candidates.iterator();
-			}
-		}
-
-		CSSCACandidate item;
-		if ((item = getCandidateImportRule()) != null) {
-			candidates.add(item);
-		}
-		if ((item = getCandidateCharsetRule()) != null) {
-			candidates.add(item);
-		}
-		if ((item = getCandidateMediaRule()) != null) {
-			candidates.add(item);
-		}
-		if ((item = getCandidatePageRule()) != null) {
-			candidates.add(item);
-		}
-		if ((item = getCandidateFontFaceRule()) != null) {
-			candidates.add(item);
-		}
-		return candidates.iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationName.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationName.java
deleted file mode 100644
index 02f40b0..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationName.java
+++ /dev/null
@@ -1,164 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.ui.internal.image.CSSImageType;
-
-class CSSProposalGeneratorForDeclarationName extends CSSProposalGenerator {
-
-	/**
-	 * CSSProposalGeneratorForDeclaration constructor comment.
-	 * 
-	 */
-	CSSProposalGeneratorForDeclarationName(CSSContentAssistContext context) {
-		super(context);
-	}
-
-	/**
-	 * getCandidates method comment.
-	 */
-	protected Iterator getCandidates() {
-		List candidates = new ArrayList();
-		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-		String preDelim = "";//$NON-NLS-1$
-		for (int i = 0; i < preferences.getInt(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM); i++) {
-			preDelim += ' ';//$NON-NLS-1$
-		}
-		String postDelim = "";//$NON-NLS-1$
-		for (int i = 0; i < preferences.getInt(CSSCorePreferenceNames.FORMAT_PROP_POST_DELIM); i++) {
-			postDelim += ' ';//$NON-NLS-1$
-		}
-
-		ICSSNode targetNode = fContext.getTargetNode();
-		boolean bFontRule = false;
-		for (ICSSNode node = targetNode; node != null; node = node.getParentNode()) {
-			if (node instanceof org.w3c.dom.css.CSSFontFaceRule) {
-				bFontRule = true;
-				break;
-			}
-		}
-
-		List names = new ArrayList();
-		CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
-		Iterator iNames = util.collectNodesByType((bFontRule) ? CSSMMNode.TYPE_DESCRIPTOR : CSSMMNode.TYPE_PROPERTY);
-		while (iNames.hasNext()) {
-			CSSMMNode node = (CSSMMNode) iNames.next();
-			names.add(node);
-		}
-		sortNames(names);
-		// Collections.sort(names);
-
-		boolean bAddColon = true;
-		if (targetNode instanceof ICSSStyleDeclItem && fContext.targetHas(CSSRegionContexts.CSS_DECLARATION_SEPARATOR)) {
-			bAddColon = false;
-		}
-
-		Iterator i = names.iterator();
-		while (i.hasNext()) {
-			CSSMMNode node = (CSSMMNode) i.next();
-			String text = node.getName();
-			text = (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER) ? text.toUpperCase() : text.toLowerCase();
-			if (!isMatch(text)) {
-				continue;
-			}
-
-			int cursorPos = 0;
-			StringBuffer buf = new StringBuffer();
-			buf.append(text);
-			buf.append(preDelim);
-			cursorPos = buf.length();
-			if (bAddColon) {
-				buf.append(':');//$NON-NLS-1$
-				buf.append(postDelim);
-				cursorPos += 1 + postDelim.length();
-			}
-			// if (! (targetNode instanceof ICSSStyleDeclItem)) {
-			// buf.append(';');//$NON-NLS-1$
-			// }
-
-			CSSCACandidate item = new CSSCACandidate();
-			item.setReplacementString(buf.toString());
-			item.setCursorPosition(cursorPos);
-			item.setDisplayString(text);
-			item.setImageType(getCategoryImageType(node));
-			candidates.add(item);
-		}
-
-		return candidates.iterator();
-	}
-
-	void sortNames(List names) {
-		Collections.sort(names, new Comparator() {
-			public int compare(Object o1, Object o2) {
-				CSSMMNode node1 = (CSSMMNode) o1;
-				CSSMMNode node2 = (CSSMMNode) o2;
-				if (node1 == null) {
-					return 1;
-				} else if (node2 == null) {
-					return -1;
-				}
-				int diff = 0;
-				String category1 = node1.getAttribute("category"); //$NON-NLS-1$
-				String category2 = node2.getAttribute("category"); //$NON-NLS-1$
-				if (category1 == null) {
-					if (category2 == null) {
-						diff = 0;
-					} else {
-						return 1;
-					}
-				} else if (category2 == null) {
-					return -1;
-				} else {
-					diff = category1.compareTo(category2);
-				}
-				if (diff == 0) {
-					String name = node1.getName();
-					if (name == null) {
-						return 1;
-					} else {
-						return name.compareTo(node2.getName());
-					}
-				} else {
-					return diff;
-				}
-			}
-		});
-	}
-
-	/*
-	 * retrieve default category icon name TODO: if node has "icon"(?), use
-	 * it.
-	 */
-	CSSImageType getCategoryImageType(CSSMMNode node) {
-		CSSImageType imageType = null;
-		if (node != null) {
-			String category = node.getAttribute("category"); //$NON-NLS-1$
-			if (category != null) {
-				imageType = CSSImageType.getImageType(category);
-			}
-		}
-		return (imageType == null) ? CSSImageType.CATEGORY_DEFAULT : imageType;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationValue.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationValue.java
deleted file mode 100644
index 62f0270..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationValue.java
+++ /dev/null
@@ -1,369 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMDescriptor;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMFunction;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNumber;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMProperty;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMUnit;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSFunctionID;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-import org.eclipse.wst.css.ui.internal.image.CSSImageType;
-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.w3c.dom.css.CSSFontFaceRule;
-
-class CSSProposalGeneratorForDeclarationValue extends CSSProposalGenerator {
-
-	private static final String IMPORTANT = "!important"; //$NON-NLS-1$
-	private boolean fUseUpperCase;
-	private boolean fAppendSemiColon;
-
-	/**
-	 * CSSProposalGeneratorForDeclarationValue constructor comment.
-	 * 
-	 */
-	CSSProposalGeneratorForDeclarationValue(CSSContentAssistContext context) {
-		super(context);
-		fUseUpperCase = CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER;
-	}
-
-	/**
-	 *  
-	 */
-	private void addFunction(List candidates, CSSMMFunction prop) {
-		String text = prop.toString();
-		if (!isMatch(text)) {
-			return;
-		}
-
-		int cursorPos = 0;
-		StringBuffer buf = new StringBuffer();
-		if (prop.getName().equals(CSSFunctionID.F_URI)) {
-			StringAndOffset sao = generateURI();
-			buf.append(sao.fString);
-			cursorPos = sao.fOffset;
-		} else {
-			buf.append(prop.toString());
-			cursorPos = buf.length();
-			StringAndOffset sao = generateParenthesis();
-			buf.append(sao.fString);
-			cursorPos += sao.fOffset;
-		}
-
-		text = buf.toString();
-		text = (fUseUpperCase) ? text.toUpperCase() : text.toLowerCase();
-
-		CSSCACandidate item = new CSSCACandidate();
-		item.setReplacementString(text);
-		item.setCursorPosition(cursorPos);
-		item.setDisplayString(text);
-		item.setImageType(CSSImageType.VALUE_FUNCTION);
-		appendSemiColon(item);
-		candidates.add(item);
-	}
-
-	/**
-	 *  
-	 */
-	private void addNumber(List candidates, CSSMMNumber prop) {
-		String fullText = fContext.getTextToReplace();
-		// skip number
-		int unitIndex = -1;
-		for (int i = 0; i < fullText.length(); i++) {
-			if (Character.isDigit(fullText.charAt(i))) {
-				unitIndex = i + 1;
-			} else {
-				break;
-			}
-		}
-
-		String unitSubText = ""; //$NON-NLS-1$
-		String numSubText = ""; //$NON-NLS-1$
-		if (0 <= unitIndex) {
-			numSubText = fullText.substring(0, unitIndex);
-			if (unitIndex < fullText.length()) {
-				unitSubText = fullText.substring(unitIndex);
-			}
-		} else {
-			unitSubText = fullText;
-		}
-
-		Iterator i = prop.getDescendants();
-		while (i.hasNext()) {
-			CSSMMUnit unit = (CSSMMUnit) i.next();
-			String unitString = unit.getUnitString();
-			if ((0 < unitSubText.length() && unitString.indexOf(unitSubText) != 0) || (0 < numSubText.length() && unitString.equals("#"))) { //$NON-NLS-1$
-				continue;
-			}
-
-			String text = numSubText + unitString;
-			text = (fUseUpperCase) ? text.toUpperCase() : text.toLowerCase();
-			CSSCACandidate item = new CSSCACandidate();
-			item.setReplacementString(text);
-			if (0 < numSubText.length() || text.equals("#")) { //$NON-NLS-1$
-				item.setCursorPosition(text.length());
-			} else {
-				item.setCursorPosition(0);
-			}
-			item.setDisplayString(text);
-			item.setImageType(CSSImageType.VALUE_NUMBER);
-			appendSemiColon(item);
-			candidates.add(item);
-		}
-	}
-
-	/**
-	 *  
-	 */
-	private void checkSemiColon() {
-		fAppendSemiColon = false;
-
-		ITextRegion targetRegion = fContext.getTargetRegion();
-		if (targetRegion != null && targetRegion.getType() != CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-			// find trailing ":" or ";"
-			// if ":" before ";" is found, add ";"
-			RegionIterator iterator = fContext.getRegionIterator();
-			IStructuredDocumentRegion container = iterator.getStructuredDocumentRegion();
-			while (iterator.hasNext()) {
-				ITextRegion region = iterator.next();
-				if (iterator.getStructuredDocumentRegion() != container) {
-					break;
-				}
-				if (region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
-					fAppendSemiColon = true;
-					break;
-				}
-			}
-			if (!fAppendSemiColon) {
-				// second chance:
-				// leading IStructuredDocumentRegion is not ";"
-				IStructuredDocumentRegion nextStructuredDocumentRegion = CSSUtil.findNextSignificantNode(container);
-				if (CSSUtil.getStructuredDocumentRegionType(nextStructuredDocumentRegion) != CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-					fAppendSemiColon = true;
-				}
-			}
-		}
-	}
-
-	/**
-	 *  
-	 */
-	private void appendSemiColon(CSSCACandidate item) {
-		if (fAppendSemiColon) {
-			String replacementString = item.getReplacementString();
-			item.setReplacementString(replacementString + ";"); //$NON-NLS-1$
-			int cursorPosition = item.getCursorPosition();
-			if (replacementString.length() <= cursorPosition) {
-				// cursorpos is tail of string
-				cursorPosition++;
-				item.setCursorPosition(cursorPosition);
-			}
-		}
-	}
-
-	/**
-	 *  
-	 */
-	private void addSemiColon(List candidates) {
-		ICSSNode targetNode = fContext.getTargetNode();
-		if (targetNode instanceof ICSSStyleDeclItem) {
-			ICSSNode firstChild = targetNode.getFirstChild();
-			if (firstChild == null) {
-				return;
-			}
-			if (firstChild instanceof IndexedRegion) {
-				int startOffset = ((IndexedRegion) firstChild).getStartOffset();
-				if (fContext.getCursorPos() <= startOffset) {
-					return;
-				}
-			}
-		}
-
-		boolean bAddCloser = false;
-
-		ITextRegion targetRegion = fContext.getTargetRegion();
-		if (targetRegion != null && targetRegion.getType() != CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-			// find trailing ":" or ";"
-			// if ":" before ";" is found, add ";"
-			RegionIterator iterator = fContext.getRegionIterator();
-			IStructuredDocumentRegion container = iterator.getStructuredDocumentRegion();
-			while (iterator.hasNext()) {
-				ITextRegion region = iterator.next();
-				if (iterator.getStructuredDocumentRegion() != container) {
-					break;
-				}
-				if (region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
-					bAddCloser = true;
-					break;
-				}
-			}
-			if (!bAddCloser) {
-				// second chance:
-				// leading IStructuredDocumentRegion is not ";"
-				IStructuredDocumentRegion nextStructuredDocumentRegion = CSSUtil.findNextSignificantNode(container);
-				if (CSSUtil.getStructuredDocumentRegionType(nextStructuredDocumentRegion) != CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
-					bAddCloser = true;
-				}
-			}
-		}
-
-		if (bAddCloser) {
-			CSSCACandidate item = new CSSCACandidate();
-			String text = fContext.getTextToReplace() + ";";//$NON-NLS-1$
-			item.setReplacementString(text);
-			item.setCursorPosition(text.length());
-			item.setDisplayString(";");//$NON-NLS-1$
-			item.setImageType(null);
-			candidates.add(item);
-		}
-	}
-
-	/**
-	 *  
-	 */
-	private void addString(List candidates, String text) {
-		if (!isMatch(text)) {
-			return;
-		}
-
-		text = (fUseUpperCase) ? text.toUpperCase() : text.toLowerCase();
-
-		CSSCACandidate item = new CSSCACandidate();
-		item.setReplacementString(text);
-		item.setCursorPosition(text.length());
-		item.setDisplayString(text);
-		item.setImageType(CSSImageType.VALUE_STRING);
-		appendSemiColon(item);
-		candidates.add(item);
-	}
-
-	private void addImportant(List candidates) {
-		ICSSNode targetNode = fContext.getTargetNode();
-		while (targetNode instanceof ICSSPrimitiveValue) {
-			targetNode = targetNode.getParentNode();
-		}
-		if (!(targetNode instanceof ICSSStyleDeclItem)) {
-			return;
-		}
-		// 1. has no priority region
-		// 2. cursor position is after of last child
-		// 3. normal isMatch method
-		String priority = ((ICSSStyleDeclItem) targetNode).getPriority();
-		if (priority == null || priority.length() == 0) {
-			ICSSNode lastChild = targetNode.getLastChild();
-			if (lastChild instanceof IndexedRegion) {
-				int startOffset = ((IndexedRegion) lastChild).getStartOffset();
-				//	int endOffset = ((IndexedRegion)lastChild).getEndOffset();
-				if (startOffset < fContext.getCursorPos() && isMatch(IMPORTANT)) {
-					CSSCACandidate item = new CSSCACandidate();
-					item.setReplacementString(IMPORTANT);
-					item.setCursorPosition(IMPORTANT.length());
-					item.setDisplayString(IMPORTANT);
-					item.setImageType(CSSImageType.VALUE_STRING);
-					appendSemiColon(item);
-					candidates.add(item);
-				}
-			}
-		}
-	}
-
-	/**
-	 * getCandidates method comment.
-	 */
-	protected Iterator getCandidates() {
-		List candidates = new ArrayList();
-
-		checkSemiColon(); // check should add semi-colon or not
-
-		String name = getPropertyName();
-		if (name != null) {
-			CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
-			Iterator i = Collections.EMPTY_LIST.iterator();
-			if (isFontFaceRule()) {
-				CSSMMDescriptor desc = util.getDescriptor(name);
-				if (desc != null) {
-					i = desc.getValues();
-				}
-			} else {
-				CSSMMProperty prop = util.getProperty(name);
-				if (prop != null) {
-					i = prop.getValues();
-				}
-			}
-			while (i.hasNext()) {
-				CSSMMNode val = (CSSMMNode) i.next();
-				String valueType = val.getType();
-				if (valueType == CSSMMNode.TYPE_KEYWORD) {
-					addString(candidates, val.toString());
-				} else if (valueType == CSSMMNode.TYPE_NUMBER) {
-					addNumber(candidates, (CSSMMNumber) val);
-				} else if (valueType == CSSMMNode.TYPE_FUNCTION) {
-					addFunction(candidates, (CSSMMFunction) val);
-				}
-			}
-		}
-
-		addImportant(candidates);
-		addSemiColon(candidates);
-
-		return candidates.iterator();
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	private String getPropertyName() {
-		ICSSNode targetNode = fContext.getTargetNode();
-		while (targetNode instanceof ICSSPrimitiveValue) {
-			targetNode = targetNode.getParentNode();
-		}
-		if (targetNode instanceof ICSSStyleDeclItem) {
-			return ((ICSSStyleDeclItem) targetNode).getPropertyName();
-		} else {
-			return null;
-		}
-	}
-
-	/**
-	 *  
-	 */
-	private boolean isFontFaceRule() {
-		ICSSNode targetNode = fContext.getTargetNode();
-		while (targetNode instanceof ICSSPrimitiveValue) {
-			targetNode = targetNode.getParentNode();
-		}
-		if (targetNode instanceof ICSSStyleDeclItem) {
-			targetNode = targetNode.getParentNode(); // get Declaration
-			if (targetNode != null) {
-				// inline style has no rule node
-				targetNode = targetNode.getParentNode(); // get rule
-			}
-		}
-		return (targetNode instanceof CSSFontFaceRule);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForHTMLTag.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForHTMLTag.java
deleted file mode 100644
index 4068f52..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForHTMLTag.java
+++ /dev/null
@@ -1,155 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.ui.internal.image.CSSImageType;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-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.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-class CSSProposalGeneratorForHTMLTag extends CSSProposalGenerator {
-
-	/**
-	 * CSSStyleRuleProposalGenerator constructor comment.
-	 * 
-	 */
-	CSSProposalGeneratorForHTMLTag(CSSContentAssistContext context) {
-		super(context);
-
-		if (fHTMLTags == null) {
-			fHTMLTags = setupHTMLTags();
-		}
-	}
-
-	/**
-	 * getCandidates method comment.
-	 */
-	protected Iterator getCandidates() {
-		List candidates = new ArrayList();
-
-		if (checkLeadingColon()) {
-			return candidates.iterator();
-		}
-
-		// XHTML requires lower case
-		boolean bLowerCase = false;
-		if (fContext.getModel().getStyleSheetType() == ICSSModel.EMBEDDED) {
-			Node domNode = fContext.getModel().getOwnerDOMNode();
-			if (domNode != null && !(domNode instanceof Document)) {
-				domNode = domNode.getOwnerDocument();
-				if (domNode instanceof IDOMDocument) {
-					DocumentTypeAdapter adapter = (DocumentTypeAdapter) ((IDOMDocument) domNode).getAdapterFor(DocumentTypeAdapter.class);
-					if (adapter != null)
-						bLowerCase = (adapter.getTagNameCase() == DocumentTypeAdapter.LOWER_CASE);
-				}
-			}
-		}
-
-
-		int length = fHTMLTags.length;
-		for (int i = 0; i < length; i++) {
-			String tagText = fHTMLTags[i];
-			if (bLowerCase) {
-				tagText = tagText.toLowerCase();
-			}
-			if (!isMatch(tagText)) {
-				continue;
-			}
-
-			int cursorPos = 0;
-			StringBuffer buf = new StringBuffer();
-			buf.append(tagText);
-			cursorPos += tagText.length();
-			boolean inRule = (fContext.getTargetNode() instanceof ICSSStyleRule);
-			if (!inRule || fContext.getTextToReplace().length() == 0) {
-				buf.append(" ");//$NON-NLS-1$
-				cursorPos += 1;
-			}
-			if (!inRule) {
-				StringAndOffset sao = generateBraces();
-				buf.append(sao.fString);
-				cursorPos += sao.fOffset;
-			}
-
-			CSSCACandidate item = new CSSCACandidate();
-			item.setReplacementString(buf.toString());
-			item.setCursorPosition(cursorPos);
-			item.setDisplayString(tagText);
-			item.setImageType(CSSImageType.SELECTOR_TAG);
-			candidates.add(item);
-		}
-
-		return candidates.iterator();
-	}
-
-	/**
-	 *  
-	 */
-	private static String[] setupHTMLTags() {
-		CMDocument cmdoc = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
-		CMNamedNodeMap elements = cmdoc.getElements();
-		Vector names = new Vector();
-		int nElements = elements.getLength();
-		for (int i = 0; i < nElements; i++) {
-			CMElementDeclaration edec = (CMElementDeclaration) elements.item(i);
-			if (isAttrDefined(edec, HTML40Namespace.ATTR_NAME_STYLE)) {
-				names.add(edec.getElementName());
-			}
-		}
-		Collections.sort(names);
-		String[] tags = new String[names.size()];
-		Iterator iNames = names.iterator();
-		for (int i = 0; iNames.hasNext(); i++) {
-			tags[i] = (String) iNames.next();
-		}
-		return tags;
-	}
-
-	/**
-	 *  
-	 */
-	private static boolean isAttrDefined(CMElementDeclaration edec, String attrName) {
-		if (edec == null) {
-			return false;
-		}
-		CMNamedNodeMap attrs = edec.getAttributes();
-		if (attrs == null) {
-			return false;
-		}
-		for (int i = 0; i < attrs.getLength(); i++) {
-			CMAttributeDeclaration attr = (CMAttributeDeclaration) attrs.item(i);
-			if (attr == null) {
-				continue;
-			}
-			if (attr.getAttrName().equalsIgnoreCase(attrName)) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	private static String[] fHTMLTags = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForPseudoSelector.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForPseudoSelector.java
deleted file mode 100644
index de0c45b..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForPseudoSelector.java
+++ /dev/null
@@ -1,156 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMSelector;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMMTypeCollector;
-import org.eclipse.wst.css.core.internal.parser.CSSRegionUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.ui.internal.image.CSSImageType;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-/**
- *  
- */
-class CSSProposalGeneratorForPseudoSelector extends CSSProposalGenerator {
-
-	/**
-	 * CSSProposalGeneratorForPseudoSelector constructor comment.
-	 * 
-	 */
-	CSSProposalGeneratorForPseudoSelector(CSSContentAssistContext context) {
-		super(context);
-	}
-
-	/**
-	 * getCandidates method comment.
-	 */
-	protected Iterator getCandidates() {
-		List candidates = new ArrayList();
-
-		boolean hasLeadingColon = checkLeadingColon();
-		String textToReplace = fContext.getTextToReplace();
-		if (!hasLeadingColon && 0 < textToReplace.length() && !textToReplace.equals(fContext.getTextToCompare())) {
-			// cursor placed midpoint of the region
-			return candidates.iterator();
-		}
-		ITextRegion region = fContext.getTargetRegion();
-		if (region != null) {
-			String type = region.getType();
-			if (type != CSSRegionContexts.CSS_S && !CSSRegionUtil.isSelectorBegginingType(type)) {
-				return candidates.iterator();
-			}
-		}
-
-		boolean useUpperCase = CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER;
-
-		List tags = getSelectorTags();
-		Collections.sort(tags);
-		Iterator i = tags.iterator();
-		while (i.hasNext()) {
-			String text = (String) i.next();
-			if (hasLeadingColon && !isMatch(text)) {
-				continue;
-			}
-			text = (useUpperCase) ? text.toUpperCase() : text.toLowerCase();
-
-			int cursorPos = 0;
-			StringBuffer buf = new StringBuffer();
-			if (hasLeadingColon) {
-				buf.append(text.substring(1));
-			} else {
-				buf.append(textToReplace);
-				buf.append(text);
-			}
-			cursorPos += buf.length();
-
-			if (0 < buf.length()) {
-				boolean inRule = (fContext.getTargetNode() instanceof ICSSStyleRule || fContext.getTargetNode() instanceof ICSSPageRule);
-				if (!inRule || (textToReplace.length() == 0 && !hasLeadingColon)) {
-					buf.append(" ");//$NON-NLS-1$
-					cursorPos += 1;
-				}
-				if (!inRule) {
-					StringAndOffset sao = generateBraces();
-					buf.append(sao.fString);
-					cursorPos += sao.fOffset;
-				}
-				CSSCACandidate item = new CSSCACandidate();
-				item.setReplacementString(buf.toString());
-				item.setCursorPosition(cursorPos);
-				item.setDisplayString(text);
-				item.setImageType(CSSImageType.SELECTOR_PSEUDO);
-				candidates.add(item);
-			}
-		}
-
-		return candidates.iterator();
-	}
-
-	/**
-	 *  
-	 */
-	List getSelectorTags() {
-		List tagList = new ArrayList();
-		ICSSNode targetNode = fContext.getTargetNode();
-		String rootType = (targetNode instanceof ICSSPageRule) ? CSSMMNode.TYPE_PAGE_RULE : CSSMMNode.TYPE_STYLE_RULE;
-
-		CSSMMTypeCollector collector = new CSSMMTypeCollector();
-		collector.collectNestedType(false);
-		collector.apply(fContext.getMetaModel(), rootType);
-		Iterator i;
-		i = collector.getNodes();
-		if (!i.hasNext()) {
-			return tagList;
-		}
-		CSSMMNode node = (CSSMMNode) i.next();
-		i = node.getChildNodes();
-		while (i.hasNext()) {
-			CSSMMNode child = (CSSMMNode) i.next();
-			if (child.getType() == CSSMMNode.TYPE_SELECTOR) {
-				String selType = ((CSSMMSelector) child).getSelectorType();
-				if (selType == CSSMMSelector.TYPE_PSEUDO_CLASS || selType == CSSMMSelector.TYPE_PSEUDO_ELEMENT) {
-					tagList.add(((CSSMMSelector) child).getSelectorString());
-				}
-			}
-		}
-		return tagList;
-	}
-
-	/**
-	 *  
-	 */
-	protected boolean isMatch(String text) {
-		if (!super.isMatch(text)) {
-			ITextRegion region = fContext.getTargetRegion();
-			if (region != null && region.getType() == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
-				return true;
-			} else {
-				return false;
-			}
-		} else {
-			return true;
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSTemplateCompletionProcessor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSTemplateCompletionProcessor.java
deleted file mode 100644
index 8b80584..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSTemplateCompletionProcessor.java
+++ /dev/null
@@ -1,72 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentassist;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-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.TemplateContextType;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.CSSEditorPluginImages;
-import org.eclipse.wst.css.ui.internal.image.CSSImageHelper;
-
-
-/**
- * Completion processor for CSS Templates. Most of the work is already done
- * by the CSS Content Assist processor, so by the time the
- * CSSTemplateCompletionProcessor is asked for content assist proposals, the
- * CSS content assist processor has already set the context type for
- * templates.
- */
-class CSSTemplateCompletionProcessor extends TemplateCompletionProcessor {
-	private String fContextTypeId = null;
-
-	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 CSSImageHelper.getInstance().getImage(CSSEditorPluginImages.IMG_OBJ_TEMPLATE);
-	}
-
-	private ContextTypeRegistry getTemplateContextRegistry() {
-		return CSSUIPlugin.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 CSSUIPlugin.getDefault().getTemplateStore();
-	}
-
-	void setContextType(String contextTypeId) {
-		fContextTypeId = contextTypeId;
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/HTML40Namespace.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/HTML40Namespace.java
deleted file mode 100644
index 2e09418..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/HTML40Namespace.java
+++ /dev/null
@@ -1,890 +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.css.ui.internal.contentassist;
-
-
-
-/**
- * Provide all names defined in the HTML 4.0? specification.
- */
-public interface HTML40Namespace {
-
-	// Element names
-	public static interface ElementName {
-		public static final String A = "A"; //$NON-NLS-1$
-		public static final String ABBR = "ABBR"; //$NON-NLS-1$
-		public static final String ACRONYM = "ACRONYM"; //$NON-NLS-1$
-		public static final String ADDRESS = "ADDRESS"; //$NON-NLS-1$
-		public static final String APPLET = "APPLET"; //$NON-NLS-1$
-		public static final String AREA = "AREA"; //$NON-NLS-1$
-		public static final String B = "B"; //$NON-NLS-1$
-		public static final String BASE = "BASE"; //$NON-NLS-1$
-		public static final String BASEFONT = "BASEFONT"; //$NON-NLS-1$
-		public static final String BDO = "BDO"; //$NON-NLS-1$
-		public static final String BGSOUND = "BGSOUND"; // D205513
-														// //$NON-NLS-1$
-		public static final String BIG = "BIG"; //$NON-NLS-1$
-		public static final String BLINK = "BLINK"; //$NON-NLS-1$
-		public static final String BLOCKQUOTE = "BLOCKQUOTE"; //$NON-NLS-1$
-		public static final String BODY = "BODY"; //$NON-NLS-1$
-		public static final String BR = "BR"; //$NON-NLS-1$
-		public static final String BUTTON = "BUTTON"; //$NON-NLS-1$
-		public static final String CAPTION = "CAPTION"; //$NON-NLS-1$
-		public static final String CENTER = "CENTER"; //$NON-NLS-1$
-		public static final String CITE = "CITE"; //$NON-NLS-1$
-		public static final String CODE = "CODE"; //$NON-NLS-1$
-		public static final String COL = "COL"; //$NON-NLS-1$
-		public static final String COLGROUP = "COLGROUP"; //$NON-NLS-1$
-		public static final String DD = "DD"; //$NON-NLS-1$
-		public static final String DEL = "DEL"; //$NON-NLS-1$
-		public static final String DFN = "DFN"; //$NON-NLS-1$
-		public static final String DIR = "DIR"; //$NON-NLS-1$
-		public static final String DIV = "DIV"; //$NON-NLS-1$
-		public static final String DL = "DL"; //$NON-NLS-1$
-		public static final String DT = "DT"; //$NON-NLS-1$
-		public static final String EM = "EM"; //$NON-NLS-1$
-		public static final String EMBED = "EMBED"; //$NON-NLS-1$
-		public static final String FIELDSET = "FIELDSET"; //$NON-NLS-1$
-		public static final String FONT = "FONT"; //$NON-NLS-1$
-		public static final String FORM = "FORM"; //$NON-NLS-1$
-		public static final String FRAME = "FRAME"; //$NON-NLS-1$
-		public static final String FRAMESET = "FRAMESET"; //$NON-NLS-1$
-		public static final String H1 = "H1"; //$NON-NLS-1$
-		public static final String H2 = "H2"; //$NON-NLS-1$
-		public static final String H3 = "H3"; //$NON-NLS-1$
-		public static final String H4 = "H4"; //$NON-NLS-1$
-		public static final String H5 = "H5"; //$NON-NLS-1$
-		public static final String H6 = "H6"; //$NON-NLS-1$
-		public static final String HEAD = "HEAD"; //$NON-NLS-1$
-		public static final String HR = "HR"; //$NON-NLS-1$
-		public static final String HTML = "HTML"; //$NON-NLS-1$
-		public static final String I = "I"; //$NON-NLS-1$
-		public static final String IFRAME = "IFRAME"; //$NON-NLS-1$
-		public static final String IMG = "IMG"; //$NON-NLS-1$
-		public static final String INPUT = "INPUT"; //$NON-NLS-1$
-		public static final String INS = "INS"; //$NON-NLS-1$
-		public static final String ISINDEX = "ISINDEX"; //$NON-NLS-1$
-		public static final String KBD = "KBD"; //$NON-NLS-1$
-		public static final String LABEL = "LABEL"; //$NON-NLS-1$
-		public static final String LEGEND = "LEGEND"; //$NON-NLS-1$
-		public static final String LI = "LI"; //$NON-NLS-1$
-		public static final String LINK = "LINK"; //$NON-NLS-1$
-		public static final String MAP = "MAP"; //$NON-NLS-1$
-		public static final String MENU = "MENU"; //$NON-NLS-1$
-		public static final String META = "META"; //$NON-NLS-1$
-		public static final String NOBR = "NOBR"; // D205513 //$NON-NLS-1$
-		public static final String NOEMBED = "NOEMBED"; //$NON-NLS-1$
-		public static final String NOFRAMES = "NOFRAMES"; //$NON-NLS-1$
-		public static final String NOSCRIPT = "NOSCRIPT"; //$NON-NLS-1$
-		public static final String OBJECT = "OBJECT"; //$NON-NLS-1$
-		public static final String OL = "OL"; //$NON-NLS-1$
-		public static final String OPTGROUP = "OPTGROUP"; //$NON-NLS-1$
-		public static final String OPTION = "OPTION"; //$NON-NLS-1$
-		public static final String P = "P"; //$NON-NLS-1$
-		public static final String PARAM = "PARAM"; //$NON-NLS-1$
-		public static final String PRE = "PRE"; //$NON-NLS-1$
-		public static final String Q = "Q"; //$NON-NLS-1$
-		public static final String S = "S"; //$NON-NLS-1$
-		public static final String SAMP = "SAMP"; //$NON-NLS-1$
-		public static final String SCRIPT = "SCRIPT"; //$NON-NLS-1$
-		public static final String SELECT = "SELECT"; //$NON-NLS-1$
-		public static final String SMALL = "SMALL"; //$NON-NLS-1$
-		public static final String SPAN = "SPAN"; //$NON-NLS-1$
-		public static final String STRIKE = "STRIKE"; //$NON-NLS-1$
-		public static final String STRONG = "STRONG"; //$NON-NLS-1$
-		public static final String STYLE = "STYLE"; //$NON-NLS-1$
-		public static final String SUB = "SUB"; //$NON-NLS-1$
-		public static final String SUP = "SUP"; //$NON-NLS-1$
-		public static final String TABLE = "TABLE"; //$NON-NLS-1$
-		public static final String TBODY = "TBODY"; //$NON-NLS-1$
-		public static final String TD = "TD"; //$NON-NLS-1$
-		public static final String TEXTAREA = "TEXTAREA"; //$NON-NLS-1$
-		public static final String TFOOT = "TFOOT"; //$NON-NLS-1$
-		public static final String TH = "TH"; //$NON-NLS-1$
-		public static final String THEAD = "THEAD"; //$NON-NLS-1$
-		public static final String TITLE = "TITLE"; //$NON-NLS-1$
-		public static final String TR = "TR"; //$NON-NLS-1$
-		public static final String TT = "TT"; //$NON-NLS-1$
-		public static final String U = "U"; //$NON-NLS-1$
-		public static final String UL = "UL"; //$NON-NLS-1$
-		public static final String VAR = "VAR"; //$NON-NLS-1$
-		public static final String WBR = "WBR"; // D205513 //$NON-NLS-1$
-		public static final String MARQUEE = "MARQUEE"; //$NON-NLS-1$
-		public static final String SSI_CONFIG = "SSI:CONFIG"; // D210393
-															  // //$NON-NLS-1$
-		public static final String SSI_ECHO = "SSI:ECHO"; //$NON-NLS-1$
-		public static final String SSI_EXEC = "SSI:EXEC"; //$NON-NLS-1$
-		public static final String SSI_FSIZE = "SSI:FSIZE"; //$NON-NLS-1$
-		public static final String SSI_FLASTMOD = "SSI:FLASTMOD"; //$NON-NLS-1$
-		public static final String SSI_INCLUDE = "SSI:INCLUDE"; //$NON-NLS-1$
-		public static final String SSI_PRINTENV = "SSI:PRINTENV"; //$NON-NLS-1$
-		public static final String SSI_SET = "SSI:SET"; //$NON-NLS-1$
-		public static final String WML_WML = "wml"; //$NON-NLS-1$
-		public static final String WML_CARD = "card"; //$NON-NLS-1$
-		public static final String WML_TEMPLATE = "template"; //$NON-NLS-1$
-		public static final String WML_ACCESS = "access"; //$NON-NLS-1$
-		public static final String WML_DO = "do"; //$NON-NLS-1$
-		public static final String WML_ONEVENT = "onevent"; //$NON-NLS-1$
-		public static final String WML_TIMER = "timer"; //$NON-NLS-1$
-		public static final String WML_ANCHOR = "anchor"; //$NON-NLS-1$
-		public static final String WML_PREV = "prev"; //$NON-NLS-1$
-		public static final String WML_REFRESH = "refresh"; //$NON-NLS-1$
-		public static final String WML_GO = "go"; //$NON-NLS-1$
-		public static final String WML_NOOP = "noop"; //$NON-NLS-1$
-		public static final String WML_SETVAR = "setvar"; //$NON-NLS-1$
-		public static final String WML_POSTFIELD = "postfield"; //$NON-NLS-1$
-	}
-
-	// Character Entities
-	public static interface EntityName {
-		public static final String AACUTE_U = "Aacute"; //$NON-NLS-1$
-		public static final String AACUTE_L = "aacute"; //$NON-NLS-1$
-		public static final String ACIRC_U = "Acirc"; //$NON-NLS-1$
-		public static final String ACIRC_L = "acirc"; //$NON-NLS-1$
-		public static final String ACUTE = "acute"; //$NON-NLS-1$
-		public static final String AELIG_U = "AElig"; //$NON-NLS-1$
-		public static final String AELIG_L = "aelig"; //$NON-NLS-1$
-		public static final String AGRAVE_U = "Agrave"; //$NON-NLS-1$
-		public static final String AGRAVE_L = "agrave"; //$NON-NLS-1$
-		public static final String ALEFSYM = "alefsym"; //$NON-NLS-1$
-		public static final String ALPHA_U = "Alpha"; //$NON-NLS-1$
-		public static final String ALPHA_L = "alpha"; //$NON-NLS-1$
-		public static final String AMP = "amp"; //$NON-NLS-1$
-		public static final String AND = "and"; //$NON-NLS-1$
-		public static final String ANG = "ang"; //$NON-NLS-1$
-		public static final String ARING_U = "Aring"; //$NON-NLS-1$
-		public static final String ARING_L = "aring"; //$NON-NLS-1$
-		public static final String ASYMP = "asymp"; //$NON-NLS-1$
-		public static final String ATILDE_U = "Atilde"; //$NON-NLS-1$
-		public static final String ATILDE_L = "atilde"; //$NON-NLS-1$
-		public static final String AUML_U = "Auml"; //$NON-NLS-1$
-		public static final String AUML_L = "auml"; //$NON-NLS-1$
-		public static final String BDQUO = "bdquo"; //$NON-NLS-1$
-		public static final String BETA_U = "Beta"; //$NON-NLS-1$
-		public static final String BETA_L = "beta"; //$NON-NLS-1$
-		public static final String BRVBAR = "brvbar"; //$NON-NLS-1$
-		public static final String BULL = "bull"; //$NON-NLS-1$
-		public static final String CAP = "cap"; //$NON-NLS-1$
-		public static final String CCEDIL_U = "Ccedil"; //$NON-NLS-1$
-		public static final String CCEDIL_L = "ccedil"; //$NON-NLS-1$
-		public static final String CEDIL = "cedil"; //$NON-NLS-1$
-		public static final String CENT = "cent"; //$NON-NLS-1$
-		public static final String CHI_U = "Chi"; //$NON-NLS-1$
-		public static final String CHI_L = "chi"; //$NON-NLS-1$
-		public static final String CIRC = "circ"; //$NON-NLS-1$
-		public static final String CLUBS = "clubs"; //$NON-NLS-1$
-		public static final String CONG = "cong"; //$NON-NLS-1$
-		public static final String COPY = "copy"; //$NON-NLS-1$
-		public static final String CRARR = "crarr"; //$NON-NLS-1$
-		public static final String CUP = "cup"; //$NON-NLS-1$
-		public static final String CURREN = "curren"; //$NON-NLS-1$
-		public static final String DAGGER_U = "Dagger"; //$NON-NLS-1$
-		public static final String DAGGER_L = "dagger"; //$NON-NLS-1$
-		public static final String DARR_U = "dArr"; //$NON-NLS-1$
-		public static final String DARR_L = "darr"; //$NON-NLS-1$
-		public static final String DEG = "deg"; //$NON-NLS-1$
-		public static final String DELTA_U = "Delta"; //$NON-NLS-1$
-		public static final String DELTA_L = "delta"; //$NON-NLS-1$
-		public static final String DIAMS = "diams"; //$NON-NLS-1$
-		public static final String DIVIDE = "divide"; //$NON-NLS-1$
-		public static final String EACUTE_U = "Eacute"; //$NON-NLS-1$
-		public static final String EACUTE_L = "eacute"; //$NON-NLS-1$
-		public static final String ECIRC_U = "Ecirc"; //$NON-NLS-1$
-		public static final String ECIRC_L = "ecirc"; //$NON-NLS-1$
-		public static final String EGRAVE_U = "Egrave"; //$NON-NLS-1$
-		public static final String EGRAVE_L = "egrave"; //$NON-NLS-1$
-		public static final String EMPTY = "empty"; //$NON-NLS-1$
-		public static final String EMSP = "emsp"; //$NON-NLS-1$
-		public static final String ENSP = "ensp"; //$NON-NLS-1$
-		public static final String EPSILON_U = "Epsilon"; //$NON-NLS-1$
-		public static final String EPSILON_L = "epsilon"; //$NON-NLS-1$
-		public static final String EQUIV = "equiv"; //$NON-NLS-1$
-		public static final String ETA_U = "Eta"; //$NON-NLS-1$
-		public static final String ETA_L = "eta"; //$NON-NLS-1$
-		public static final String ETH_U = "ETH"; //$NON-NLS-1$
-		public static final String ETH_L = "eth"; //$NON-NLS-1$
-		public static final String EUML_U = "Euml"; //$NON-NLS-1$
-		public static final String EUML_L = "euml"; //$NON-NLS-1$
-		public static final String EURO = "euro"; //$NON-NLS-1$
-		public static final String EXIST = "exist"; //$NON-NLS-1$
-		public static final String FNOF = "fnof"; //$NON-NLS-1$
-		public static final String FORALL = "forall"; //$NON-NLS-1$
-		public static final String FRAC12 = "frac12"; //$NON-NLS-1$
-		public static final String FRAC14 = "frac14"; //$NON-NLS-1$
-		public static final String FRAC34 = "frac34"; //$NON-NLS-1$
-		public static final String FRASL = "frasl"; //$NON-NLS-1$
-		public static final String GAMMA_U = "Gamma"; //$NON-NLS-1$
-		public static final String GAMMA_L = "gamma"; //$NON-NLS-1$
-		public static final String GE = "ge"; //$NON-NLS-1$
-		public static final String GT = "gt"; //$NON-NLS-1$
-		public static final String HARR_U = "hArr"; //$NON-NLS-1$
-		public static final String HARR_L = "harr"; //$NON-NLS-1$
-		public static final String HEARTS = "hearts"; //$NON-NLS-1$
-		public static final String HELLIP = "hellip"; //$NON-NLS-1$
-		public static final String IACUTE_U = "Iacute"; //$NON-NLS-1$
-		public static final String IACUTE_L = "iacute"; //$NON-NLS-1$
-		public static final String ICIRC_U = "Icirc"; //$NON-NLS-1$
-		public static final String ICIRC_L = "icirc"; //$NON-NLS-1$
-		public static final String IEXCL = "iexcl"; //$NON-NLS-1$
-		public static final String IGRAVE_U = "Igrave"; //$NON-NLS-1$
-		public static final String IGRAVE_L = "igrave"; //$NON-NLS-1$
-		public static final String IMAGE = "image"; //$NON-NLS-1$
-		public static final String INFIN = "infin"; //$NON-NLS-1$
-		public static final String INT = "int"; //$NON-NLS-1$
-		public static final String IOTA_U = "Iota"; //$NON-NLS-1$
-		public static final String IOTA_L = "iota"; //$NON-NLS-1$
-		public static final String IQUEST = "iquest"; //$NON-NLS-1$
-		public static final String ISIN = "isin"; //$NON-NLS-1$
-		public static final String IUML_U = "Iuml"; //$NON-NLS-1$
-		public static final String IUML_L = "iuml"; //$NON-NLS-1$
-		public static final String KAPPA_U = "Kappa"; //$NON-NLS-1$
-		public static final String KAPPA_L = "kappa"; //$NON-NLS-1$
-		public static final String LAMBDA_U = "Lambda"; //$NON-NLS-1$
-		public static final String LAMBDA_L = "lambda"; //$NON-NLS-1$
-		public static final String LANG = "lang"; //$NON-NLS-1$
-		public static final String LAQUO = "laquo"; //$NON-NLS-1$
-		public static final String LARR_U = "lArr"; //$NON-NLS-1$
-		public static final String LARR_L = "larr"; //$NON-NLS-1$
-		public static final String LCEIL = "lceil"; //$NON-NLS-1$
-		public static final String LDQUO = "ldquo"; //$NON-NLS-1$
-		public static final String LE = "le"; //$NON-NLS-1$
-		public static final String LFLOOR = "lfloor"; //$NON-NLS-1$
-		public static final String LOWAST = "lowast"; //$NON-NLS-1$
-		public static final String LOZ = "loz"; //$NON-NLS-1$
-		public static final String LRM = "lrm"; //$NON-NLS-1$
-		public static final String LSAQUO = "lsaquo"; //$NON-NLS-1$
-		public static final String LSQUO = "lsquo"; //$NON-NLS-1$
-		public static final String LT = "lt"; //$NON-NLS-1$
-		public static final String MACR = "macr"; //$NON-NLS-1$
-		public static final String MDASH = "mdash"; //$NON-NLS-1$
-		public static final String MICRO = "micro"; //$NON-NLS-1$
-		public static final String MIDDOT = "middot"; //$NON-NLS-1$
-		public static final String MINUS = "minus"; //$NON-NLS-1$
-		public static final String MU_U = "Mu"; //$NON-NLS-1$
-		public static final String MU_L = "mu"; //$NON-NLS-1$
-		public static final String NABLA = "nabla"; //$NON-NLS-1$
-		public static final String NBSP = "nbsp"; //$NON-NLS-1$
-		public static final String NDASH = "ndash"; //$NON-NLS-1$
-		public static final String NE = "ne"; //$NON-NLS-1$
-		public static final String NI = "ni"; //$NON-NLS-1$
-		public static final String NOT = "not"; //$NON-NLS-1$
-		public static final String NOTIN = "notin"; //$NON-NLS-1$
-		public static final String NSUB = "nsub"; //$NON-NLS-1$
-		public static final String NTILDE_U = "Ntilde"; //$NON-NLS-1$
-		public static final String NTILDE_L = "ntilde"; //$NON-NLS-1$
-		public static final String NU_U = "Nu"; //$NON-NLS-1$
-		public static final String NU_L = "nu"; //$NON-NLS-1$
-		public static final String OACUTE_U = "Oacute"; //$NON-NLS-1$
-		public static final String OACUTE_L = "oacute"; //$NON-NLS-1$
-		public static final String OCIRC_U = "Ocirc"; //$NON-NLS-1$
-		public static final String OCIRC_L = "ocirc"; //$NON-NLS-1$
-		public static final String OELIG_U = "OElig"; //$NON-NLS-1$
-		public static final String OELIG_L = "oelig"; //$NON-NLS-1$
-		public static final String OGRAVE_U = "Ograve"; //$NON-NLS-1$
-		public static final String OGRAVE_L = "ograve"; //$NON-NLS-1$
-		public static final String OLINE = "oline"; //$NON-NLS-1$
-		public static final String OMEGA_U = "Omega"; //$NON-NLS-1$
-		public static final String OMEGA_L = "omega"; //$NON-NLS-1$
-		public static final String OMICRON_U = "Omicron"; //$NON-NLS-1$
-		public static final String OMICRON_L = "omicron"; //$NON-NLS-1$
-		public static final String OPLUS = "oplus"; //$NON-NLS-1$
-		public static final String OR = "or"; //$NON-NLS-1$
-		public static final String ORDF = "ordf"; //$NON-NLS-1$
-		public static final String ORDM = "ordm"; //$NON-NLS-1$
-		public static final String OSLASH_U = "Oslash"; //$NON-NLS-1$
-		public static final String OSLASH_L = "oslash"; //$NON-NLS-1$
-		public static final String OTILDE_U = "Otilde"; //$NON-NLS-1$
-		public static final String OTILDE_L = "otilde"; //$NON-NLS-1$
-		public static final String OTIMES = "otimes"; //$NON-NLS-1$
-		public static final String OUML_U = "Ouml"; //$NON-NLS-1$
-		public static final String OUML_L = "ouml"; //$NON-NLS-1$
-		public static final String PARA = "para"; //$NON-NLS-1$
-		public static final String PART = "part"; //$NON-NLS-1$
-		public static final String PERMIL = "permil"; //$NON-NLS-1$
-		public static final String PERP = "perp"; //$NON-NLS-1$
-		public static final String PHI_U = "Phi"; //$NON-NLS-1$
-		public static final String PHI_L = "phi"; //$NON-NLS-1$
-		public static final String PI_U = "Pi"; //$NON-NLS-1$
-		public static final String PI_L = "pi"; //$NON-NLS-1$
-		public static final String PIV = "piv"; //$NON-NLS-1$
-		public static final String PLUSMN = "plusmn"; //$NON-NLS-1$
-		public static final String POUND = "pound"; //$NON-NLS-1$
-		public static final String PRIME_U = "Prime"; //$NON-NLS-1$
-		public static final String PRIME_L = "prime"; //$NON-NLS-1$
-		public static final String PROD = "prod"; //$NON-NLS-1$
-		public static final String PROP = "prop"; //$NON-NLS-1$
-		public static final String PSI_U = "Psi"; //$NON-NLS-1$
-		public static final String PSI_L = "psi"; //$NON-NLS-1$
-		public static final String QUOT = "quot"; //$NON-NLS-1$
-		public static final String RADIC = "radic"; //$NON-NLS-1$
-		public static final String RANG = "rang"; //$NON-NLS-1$
-		public static final String RAQUO = "raquo"; //$NON-NLS-1$
-		public static final String RARR_U = "rArr"; //$NON-NLS-1$
-		public static final String RARR_L = "rarr"; //$NON-NLS-1$
-		public static final String RCEIL = "rceil"; //$NON-NLS-1$
-		public static final String RDQUO = "rdquo"; //$NON-NLS-1$
-		public static final String REAL = "real"; //$NON-NLS-1$
-		public static final String REG = "reg"; //$NON-NLS-1$
-		public static final String RFLOOR = "rfloor"; //$NON-NLS-1$
-		public static final String RHO_U = "Rho"; //$NON-NLS-1$
-		public static final String RHO_L = "rho"; //$NON-NLS-1$
-		public static final String RLM = "rlm"; //$NON-NLS-1$
-		public static final String RSAQUO = "rsaquo"; //$NON-NLS-1$
-		public static final String RSQUO = "rsquo"; //$NON-NLS-1$
-		public static final String SBQUO = "sbquo"; //$NON-NLS-1$
-		public static final String SCARON_U = "Scaron"; //$NON-NLS-1$
-		public static final String SCARON_L = "scaron"; //$NON-NLS-1$
-		public static final String SDOT = "sdot"; //$NON-NLS-1$
-		public static final String SECT = "sect"; //$NON-NLS-1$
-		public static final String SHY = "shy"; //$NON-NLS-1$
-		public static final String SIGMA_U = "Sigma"; //$NON-NLS-1$
-		public static final String SIGMA_L = "sigma"; //$NON-NLS-1$
-		public static final String SIGMAF = "sigmaf"; //$NON-NLS-1$
-		public static final String SIM = "sim"; //$NON-NLS-1$
-		public static final String SPADES = "spades"; //$NON-NLS-1$
-		public static final String SUB = "sub"; //$NON-NLS-1$
-		public static final String SUBE = "sube"; //$NON-NLS-1$
-		public static final String SUM = "sum"; //$NON-NLS-1$
-		public static final String SUP = "sup"; //$NON-NLS-1$
-		public static final String SUP1 = "sup1"; //$NON-NLS-1$
-		public static final String SUP2 = "sup2"; //$NON-NLS-1$
-		public static final String SUP3 = "sup3"; //$NON-NLS-1$
-		public static final String SUPE = "supe"; //$NON-NLS-1$
-		public static final String SZLIG = "szlig"; //$NON-NLS-1$
-		public static final String TAU_U = "Tau"; //$NON-NLS-1$
-		public static final String TAU_L = "tau"; //$NON-NLS-1$
-		public static final String THERE4 = "there4"; //$NON-NLS-1$
-		public static final String THETA_U = "Theta"; //$NON-NLS-1$
-		public static final String THETA_L = "theta"; //$NON-NLS-1$
-		public static final String THETASYM = "thetasym"; //$NON-NLS-1$
-		public static final String THINSP = "thinsp"; //$NON-NLS-1$
-		public static final String THORN_U = "THORN"; //$NON-NLS-1$
-		public static final String THORN_L = "thorn"; //$NON-NLS-1$
-		public static final String TILDE = "tilde"; //$NON-NLS-1$
-		public static final String TIMES = "times"; //$NON-NLS-1$
-		public static final String TRADE = "trade"; //$NON-NLS-1$
-		public static final String UACUTE_U = "Uacute"; //$NON-NLS-1$
-		public static final String UACUTE_L = "uacute"; //$NON-NLS-1$
-		public static final String UARR_U = "uArr"; //$NON-NLS-1$
-		public static final String UARR_L = "uarr"; //$NON-NLS-1$
-		public static final String UCIRC_U = "Ucirc"; //$NON-NLS-1$
-		public static final String UCIRC_L = "ucirc"; //$NON-NLS-1$
-		public static final String UGRAVE_U = "Ugrave"; //$NON-NLS-1$
-		public static final String UGRAVE_L = "ugrave"; //$NON-NLS-1$
-		public static final String UML = "uml"; //$NON-NLS-1$
-		public static final String UPSIH = "upsih"; //$NON-NLS-1$
-		public static final String UPSILON_U = "Upsilon"; //$NON-NLS-1$
-		public static final String UPSILON_L = "upsilon"; //$NON-NLS-1$
-		public static final String UUML_U = "Uuml"; //$NON-NLS-1$
-		public static final String UUML_L = "uuml"; //$NON-NLS-1$
-		public static final String WEIERP = "weierp"; //$NON-NLS-1$
-		public static final String XI_U = "Xi"; //$NON-NLS-1$
-		public static final String XI_L = "xi"; //$NON-NLS-1$
-		public static final String YACUTE_U = "Yacute"; //$NON-NLS-1$
-		public static final String YACUTE_L = "yacute"; //$NON-NLS-1$
-		public static final String YEN = "yen"; //$NON-NLS-1$
-		public static final String YUML_U = "Yuml"; //$NON-NLS-1$
-		public static final String YUML_L = "yuml"; //$NON-NLS-1$
-		public static final String ZETA_U = "Zeta"; //$NON-NLS-1$
-		public static final String ZETA_L = "zeta"; //$NON-NLS-1$
-		public static final String ZWJ = "zwj"; //$NON-NLS-1$
-		public static final String ZWNJ = "zwnj"; //$NON-NLS-1$
-	}
-
-	public static final String HTML40_URI = "http://www.w3.org/TR/REC-html40/frameset.dtd"; //$NON-NLS-1$
-	public static final String HTML40_TAG_PREFIX = ""; //$NON-NLS-1$
-	// global attribute names
-	public static final String ATTR_NAME_ID = "id"; // %coreattrs;
-													// //$NON-NLS-1$
-	public static final String ATTR_NAME_CLASS = "class"; // %coreattrs;
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_STYLE = "style"; // %coreattrs;
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_TITLE = "title"; // %coreattrs;
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_LANG = "lang"; // %i18n;
-														// //$NON-NLS-1$
-	public static final String ATTR_NAME_DIR = "dir"; // %i18n; //$NON-NLS-1$
-	public static final String ATTR_NAME_ONCLICK = "onclick"; // %events;
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ONDBLCLICK = "ondblclick"; // %events;
-																	// //$NON-NLS-1$
-	public static final String ATTR_NAME_ONMOUSEDOWN = "onmousedown"; // %events;
-																	  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ONMOUSEUP = "onmouseup"; // %events;
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ONMOUSEOVER = "onmouseover"; // %events;
-																	  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ONMOUSEMOVE = "onmousemove"; // %events;
-																	  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ONMOUSEOUT = "onmouseout"; // %events;
-																	// //$NON-NLS-1$
-	public static final String ATTR_NAME_ONKEYPRESS = "onkeypress"; // %events;
-																	// //$NON-NLS-1$
-	public static final String ATTR_NAME_ONKEYDOWN = "onkeydown"; // %events;
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ONKEYUP = "onkeyup"; // %events;
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ONHELP = "onhelp"; // %events;
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_BGCOLOR = "bgcolor"; // %bodycolor;,
-															  // TABLE
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_TEXT = "text"; // %bodycolor;
-														// //$NON-NLS-1$
-	public static final String ATTR_NAME_LINK = "link"; // %bodycolor;
-														// //$NON-NLS-1$
-	public static final String ATTR_NAME_VLINK = "vlink"; // %bodycolor;
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ALINK = "alink"; // %bodycolor;
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_VERSION = "version"; // HTML
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_PROFILE = "profile"; // HEAD
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ONLOAD = "onload"; // BODY
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_ONUNLOAD = "onunload"; // BODY
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_BACKGROUND = "background"; // BODY,
-																	// TABLE
-																	// //$NON-NLS-1$
-	public static final String ATTR_NAME_SRC = "src"; // IMG //$NON-NLS-1$
-	public static final String ATTR_NAME_ALT = "alt"; // IMG,AREA
-													  // //$NON-NLS-1$
-	public static final String ATTR_NAME_LONGDESC = "longdesc"; // IMG
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_NAME = "name"; // IMG //$NON-NLS-1$
-	public static final String ATTR_NAME_HEIGHT = "height"; // IMG, TABLE
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_WIDTH = "width"; // IMG, TABLE,HR
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_USEMAP = "usemap"; // IMG
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_ISMAP = "ismap"; // IMG //$NON-NLS-1$
-	public static final String ATTR_NAME_ALIGN = "align"; // IMG, TABLE,HR
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_BORDER = "border"; // IMG, TABLE
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_HSPACE = "hspace"; // IMG
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_VSPACE = "vspace"; // IMG
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_MAPFILE = "mapfile"; // IMG
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_SUMMARY = "summary"; // TABLE
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_FRAME = "frame"; // TABLE
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_RULES = "rules"; // TABLE
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_CELLSPACING = "cellspacing"; // TABLE
-																	  // //$NON-NLS-1$
-	public static final String ATTR_NAME_CELLPADDING = "cellpadding"; // TABLE
-																	  // //$NON-NLS-1$
-	public static final String ATTR_NAME_DATAPAGESIZE = "datapagesize"; // TABLE,HR
-																		// //$NON-NLS-1$
-	public static final String ATTR_NAME_COLOR = "color"; // BASEFONT,FONT
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_FACE = "face"; // BASEFONT,FONT
-														// //$NON-NLS-1$
-	public static final String ATTR_NAME_SIZE = "size"; // BASEFONT,FONT
-														// //$NON-NLS-1$
-	public static final String ATTR_NAME_CLEAR = "clear"; // BR //$NON-NLS-1$
-	public static final String ATTR_NAME_SHAPE = "shape"; // AREA
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_COORDS = "coords"; // AREA
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_HREF = "href"; // AREA //$NON-NLS-1$
-	public static final String ATTR_NAME_TARGET = "target"; // AREA
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_NOHREF = "nohref"; // AREA
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_TABINDEX = "tabindex"; // AREA
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_ACCESSKEY = "accesskey"; // AREA
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ONFOCUS = "onfocus"; // AREA
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ONBLUR = "onblur"; // AREA
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_CHARSET = "charset"; // LINK
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_HREFLANG = "hreflang"; // LINK
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_TYPE = "type"; // LINK //$NON-NLS-1$
-	public static final String ATTR_NAME_REL = "rel"; // LINK //$NON-NLS-1$
-	public static final String ATTR_NAME_REV = "rev"; // LINK //$NON-NLS-1$
-	public static final String ATTR_NAME_MEDIA = "media"; // LINK
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_VALUE = "value"; // PARAM
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_VALUETYPE = "valuetype"; // PARAM
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_NOSHADE = "noshade"; // HR
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_CHECKED = "checked"; // INPUT
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_DISABLED = "disabled"; // INPUT
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_READONLY = "readonly"; // INPUT
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_MAXLENGTH = "maxlength"; // INPUT
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ONSELECT = "onselect"; // INPUT
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_ONCHANGE = "onchange"; // INPUT
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_ACCEPT = "accept"; // INPUT
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_ISTYLE = "istyle"; // INPUT
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_CHAR = "char"; // COL //$NON-NLS-1$
-	public static final String ATTR_NAME_CHAROFF = "charoff"; // COL
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_VALIGN = "valign"; // COL
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_SPAN = "span"; // COL //$NON-NLS-1$
-	public static final String ATTR_NAME_FRAMEBORDER = "frameborder"; // FRAME
-																	  // //$NON-NLS-1$
-	public static final String ATTR_NAME_MARGINWIDTH = "marginwidth"; // FRAME
-																	  // //$NON-NLS-1$
-	public static final String ATTR_NAME_MARGINHEIGHT = "marginheight"; // FRAME
-																		// //$NON-NLS-1$
-	public static final String ATTR_NAME_NORESIZE = "noresize"; // FRAME
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_SCROLLING = "scrolling"; // FRAME
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_PROMPT = "prompt"; // ISINDEX
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_HTTP_EQUIV = "http-equiv"; // META
-																	// //$NON-NLS-1$
-	public static final String ATTR_NAME_CONTENT = "content"; // META
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_SCHEME = "scheme"; // META
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_ERRMSG = "errmsg"; // ssi:config
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_SIZEFMT = "sizefmt"; // ssi:config
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_TIMEFMT = "timefmt"; // ssi:config
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_VAR = "var"; // ssi:echo
-													  // //$NON-NLS-1$
-	public static final String ATTR_NAME_CGI = "cgi"; // ssi:exec
-													  // //$NON-NLS-1$
-	public static final String ATTR_NAME_CMD = "cmd"; // ssi:exec
-													  // //$NON-NLS-1$
-	public static final String ATTR_NAME_FILE = "file"; // ssi:fsize
-														// //$NON-NLS-1$
-	public static final String ATTR_NAME_VIRTUAL = "virtual"; // ssi:fsize
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_SELECTED = "selected"; // OPTION
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_LABEL = "label"; // OPTION
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ROWS = "rows"; // TEXTAREA
-														// //$NON-NLS-1$
-	public static final String ATTR_NAME_COLS = "cols"; // TEXTAREA
-														// //$NON-NLS-1$
-	public static final String ATTR_NAME_LANGUAGE = "language"; // SCRIPT
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_DEFER = "defer"; // SCRIPT
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_EVENT = "event"; // SCRIPT
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_FOR = "for"; // SCRIPT //$NON-NLS-1$
-	public static final String ATTR_NAME_COMPACT = "compact"; // OL/UL
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_START = "start"; // OL/UL
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_DIRECTKEY = "directkey"; // A
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_CODEBASE = "codebase"; // APPLET
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_ARCHIVE = "archive"; // APPLET
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_CODE = "code"; // APPLET
-														// //$NON-NLS-1$
-	public static final String ATTR_NAME_OBJECT = "object"; // APPLET
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_MAYSCRIPT = "mayscript"; // APPLET
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_CITE = "cite"; // BLOCKQUOTE
-														// //$NON-NLS-1$
-	public static final String ATTR_NAME_MACRO = "macro"; // D2W //$NON-NLS-1$
-	public static final String ATTR_NAME_DATETIME = "datetime"; // INS/DEL
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_LOOP = "loop"; // EMBED //$NON-NLS-1$
-	public static final String ATTR_NAME_HIDDEN = "hidden"; // EMBED
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_VOLUME = "volume"; // EMBED
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_AUTOSTART = "autostart"; // EMBED
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_AUTOPLAY = "autoplay"; // EMBED
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_AUTOSIZE = "autosize"; // EMBED
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_CONTROLLER = "controller";// EMBED
-																   // //$NON-NLS-1$
-	public static final String ATTR_NAME_SCALE = "scale"; // EMBED
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_SHOWCONTROLS = "showcontrols";// EMBED
-																	   // //$NON-NLS-1$
-	public static final String ATTR_NAME_PLAYCOUNT = "playcount"; // EMBED
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_REPEAT = "repeat"; // EMBED
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_PANEL = "panel"; // EMBED
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_PALETTE = "palette"; // EMBED
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_TEXTFOCUS = "textfocus"; // EMBED
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ACTION = "action"; // FORM
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_METHOD = "method"; // FORM
-															// //$NON-NLS-1$
-	public static final String ATTR_NAME_ENCTYPE = "enctype"; // FORM
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ONSUBMIT = "onsubmit"; // FORM
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_ONRESET = "onreset"; // FORM
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ACCEPT_CHARSET = "accept-charset";// FORM
-																		   // //$NON-NLS-1$
-	public static final String ATTR_NAME_BEHAVIOR = "behavior"; // MARQUEE
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_DIRECTION = "direction"; // MARQUEE
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_SCROLLAMOUNT = "scrollamount";// MARQUEE
-																	   // //$NON-NLS-1$
-	public static final String ATTR_NAME_SCROLLDELAY = "scrolldelay";// MARQUEE
-																	 // //$NON-NLS-1$
-	public static final String ATTR_NAME_TRUESPEED = "truespeed"; // MARQUEE
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_DECLARE = "declare"; // OBJECT
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_CLASSID = "classid"; // OBJECT
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_DATA = "data"; // OBJECT
-														// //$NON-NLS-1$
-	public static final String ATTR_NAME_CODETYPE = "codetype"; // OBJECT
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_STANDBY = "standby"; // OBJECT
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_MULTIPLE = "multiple"; // SELECT
-																// //$NON-NLS-1$
-	public static final String ATTR_NAME_ABBR = "abbr"; // TH/TD //$NON-NLS-1$
-	public static final String ATTR_NAME_AXIS = "axis"; // TH/TD //$NON-NLS-1$
-	public static final String ATTR_NAME_HEADERS = "headers"; // TH/TD
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_SCOPE = "scope"; // TH/TD
-														  // //$NON-NLS-1$
-	public static final String ATTR_NAME_ROWSPAN = "rowspan"; // TH/TD
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_COLSPAN = "colspan"; // TH/TD
-															  // //$NON-NLS-1$
-	public static final String ATTR_NAME_NOWRAP = "nowrap"; // TH/TD
-															// //$NON-NLS-1$
-	// <<D205514
-	public static final String ATTR_NAME_TOPMARGIN = "topmargin"; // BODY
-																  // //$NON-NLS-1$
-	public static final String ATTR_NAME_BOTTOMMARGIN = "bottommargin"; // BODY
-																		// //$NON-NLS-1$
-	public static final String ATTR_NAME_LEFTMARGIN = "leftmargin"; // BODY
-																	// //$NON-NLS-1$
-	public static final String ATTR_NAME_RIGHTMARGIN = "rightmargin"; // BODY
-																	  // //$NON-NLS-1$
-	public static final String ATTR_NAME_BORDERCOLOR = "bordercolor"; // TABLE/TR/TH/TD/FRAMESET/FRAME
-																	  // //$NON-NLS-1$
-	// for WML
-	public static final String WML_ATTR_NAME_TITLE = "title"; // card
-															  // //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_DOMAIN = "domain"; // access
-																// //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_PATH = "path"; // access
-															// //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_ONENTERFORWARD = "onenterforward"; // template,card
-																				// //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_ONENTERBACKWARD = "onenterbackward"; // template,card
-																				  // //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_ONPICK = "onpick"; // option
-																// //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_ONTIMER = "ontimer"; // template,card
-																  // //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_NEWCONTEXT = "newcontext"; // card
-																		// //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_ORDERED = "ordered"; // card
-																  // //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_OPTIONAL = "optional"; // do
-																	// //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_CACHE_CONTROL = "cache-control"; // go
-																			  // //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_SENDREFERER = "sendreferer"; // go
-																		  // //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_METHOD = "method"; // go
-																// //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_ENCTYPE = "enctype"; // go
-																  // //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_ACCEPT_CHARSET = "accept-charset"; // go
-																				// //$NON-NLS-1$
-	public static final String WML_ATTR_NAME_COLUMNS = "columns"; // table
-																  // //$NON-NLS-1$
-	// D205514
-	//<<D215684
-	public static final String ATTR_NAME_FRAMESPACING = "framespacing"; // FRAMESET
-																		// //$NON-NLS-1$
-	//D215684
-	// global attribute values; mainly used in enumeration.
-	public static final String ATTR_VALUE_VERSION_TRANSITIONAL = "-//W3C//DTD HTML 4.01 Transitional//EN"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_VERSION_FRAMESET = "-//W3C//DTD HTML 4.01 Frameset//EN"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_LTR = "ltr"; // dir //$NON-NLS-1$
-	public static final String ATTR_VALUE_RTL = "rtl"; // dir //$NON-NLS-1$
-	//   for align (top|middle|bottom|left|right)
-	public static final String ATTR_VALUE_TOP = "top"; // align //$NON-NLS-1$
-	public static final String ATTR_VALUE_MIDDLE = "middle"; // align
-															 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_BOTTOM = "bottom"; // align
-															 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_LEFT = "left"; // align
-														 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_CENTER = "center"; // align
-															 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_RIGHT = "right"; // align
-														   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_JUSTIFY = "justify"; // align
-															   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_CHAR = "char"; // align
-														 // //$NON-NLS-1$
-	//   for valign (baseline)
-	public static final String ATTR_VALUE_BASELINE = "baseline"; // valign
-																 // //$NON-NLS-1$
-	//   for clear (left|all|right|none): left and right are already defined
-	// above.
-	public static final String ATTR_VALUE_ALL = "all"; // clear //$NON-NLS-1$
-	public static final String ATTR_VALUE_NONE = "none"; // clear
-														 // //$NON-NLS-1$
-	//   for shape (rect|circle|poly|default)
-	public static final String ATTR_VALUE_RECT = "rect"; // shape
-														 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_CIRCLE = "circle"; // shape
-															 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_POLY = "poly"; // shape
-														 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_DEFAULT = "default"; // shape
-															   // //$NON-NLS-1$
-	//   for valuetype (data|ref|object)
-	public static final String ATTR_VALUE_DATA = "data"; // valuetype
-														 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_REF = "ref"; // valuetype
-													   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_OBJECT = "object"; // valuetype
-															 // //$NON-NLS-1$
-	//   for type of INPUT
-	//       (text | password | checkbox | radio | submit | reset |
-	//        file | hidden | image | button)
-	public static final String ATTR_VALUE_TEXT = "text"; // INPUT:type
-														 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_PASSWORD = "password"; // INPUT:type
-																 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_CHECKBOX = "checkbox"; // INPUT:type
-																 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_RADIO = "radio"; // INPUT:type
-														   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_SUBMIT = "submit"; // INPUT:type
-															 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_RESET = "reset"; // INPUT:type
-														   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_FILE = "file"; // INPUT:type
-														 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_HIDDEN = "hidden"; // INPUT:type
-															 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_IMAGE = "image"; // INPUT:type
-														   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_BUTTON = "button"; // INPUT:type
-															 // //$NON-NLS-1$
-	//   for span, colspan, rowspan
-	public static final String ATTR_VALUE_1 = "1"; // span //$NON-NLS-1$
-	//   for frameborder
-	public static final String ATTR_VALUE_0 = "0"; // FRAME //$NON-NLS-1$
-	//   for scrolling
-	public static final String ATTR_VALUE_YES = "yes"; // FRAME //$NON-NLS-1$
-	public static final String ATTR_VALUE_NO = "no"; // FRAME //$NON-NLS-1$
-	public static final String ATTR_VALUE_AUTO = "auto"; // FRAME
-														 // //$NON-NLS-1$
-	//   for UL
-	public static final String ATTR_VALUE_DISC = "disc"; // UL:type
-														 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_SQUARE = "square"; // UL:type
-															 // //$NON-NLS-1$
-	//   for frame of TABLE
-	public static final String ATTR_VALUE_VOID = "void"; // TABLE:frame
-														 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_ABOVE = "above"; // TABLE:frame
-														   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_BELOW = "below"; // TABLE:frame
-														   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_HSIDES = "hsides"; // TABLE:frame
-															 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_LHS = "lhs"; // TABLE:frame
-													   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_RHS = "rhs"; // TABLE:frame
-													   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_VSIDES = "vsides"; // TABLE:frame
-															 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_BOX = "box"; // TABLE:frame
-													   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_BORDER = "border"; // TABLE:frame
-															 // //$NON-NLS-1$
-	//   for rules of TABLE
-	public static final String ATTR_VALUE_GROUPS = "groups"; // TABLE:rules
-															 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_ROWS = "rows"; // TEXTAREA
-														 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_COLS = "cols"; // TEXTAREA
-														 // //$NON-NLS-1$
-	//   for method of FORM
-	public static final String ATTR_VALUE_GET = "get"; // FORM //$NON-NLS-1$
-	public static final String ATTR_VALUE_POST = "post"; // FORM //$NON-NLS-1$
-	public static final String ATTR_VALUE_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded"; //$NON-NLS-1$
-	//   for scope of (TH | TD)
-	public static final String ATTR_VALUE_ROW = "row"; // (TH|TD):scope
-													   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_COL = "col"; // (TH|TD):scope
-													   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_ROWGROUP = "rowgroup";// (TH|TD):scope
-																// //$NON-NLS-1$
-	public static final String ATTR_VALUE_COLGROUP = "colgroup";// (TH|TD):scope
-																// //$NON-NLS-1$
-	//   for auto?? of EMBED
-	public static final String ATTR_VALUE_TRUE = "true"; // EMBED
-														 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_FALSE = "false"; // EMBED
-														   // //$NON-NLS-1$
-	//   for behaviro of MARQUEE
-	public static final String ATTR_VALUE_SCROLL = "scroll"; // MARQUEE
-															 // //$NON-NLS-1$
-	public static final String ATTR_VALUE_SLIDE = "slide"; // MARQUEE
-														   // //$NON-NLS-1$
-	public static final String ATTR_VALUE_ALTERNATE = "alternate"; // MARQUEE
-																   // //$NON-NLS-1$
-	//   for direction of MARQUEE
-	public static final String ATTR_VALUE_UP = "up"; // MARQUEE //$NON-NLS-1$
-	public static final String ATTR_VALUE_DOWN = "down"; // MARQUEE
-														 // //$NON-NLS-1$
-	//   for type of LI (D19924)
-	public static final String ATTR_VALUE_NUMBER = "1"; // LI //$NON-NLS-1$
-	public static final String ATTR_VALUE_LOWER_ALPHA = "a"; // LI
-															 // //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/CSSNodeAdapter.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/CSSNodeAdapter.java
deleted file mode 100644
index 7668861..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/CSSNodeAdapter.java
+++ /dev/null
@@ -1,318 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-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.sse.ui.internal.contentoutline.IJFaceNodeAdapterFactory;
-
-/**
- * Adapts the CSS DOM node to a JFace viewer.
- */
-class CSSNodeAdapter implements INodeAdapter, Runnable {
-	class NotifyContext {
-		NotifyContext(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-			this.notifier = notifier;
-			this.eventType = eventType;
-			this.changedFeature = changedFeature;
-			this.oldValue = oldValue;
-			this.newValue = newValue;
-			this.pos = pos;
-		}
-
-		void fire() {
-			internalNotifyChanged(notifier, eventType, changedFeature, oldValue, newValue, pos);
-		}
-
-		INodeNotifier notifier;
-		int eventType;
-		Object changedFeature;
-		Object oldValue;
-		Object newValue;
-		int pos;
-	}
-
-	class StyleViewUpdater implements Runnable {
-		public void run() {
-			if (lastUpdater == this) {
-				internalActionPerformed();
-				lastUpdater = null;
-			}
-		}
-	}
-
-	protected INodeAdapterFactory adapterFactory;
-	private Vector notifyQueue;
-	StyleViewUpdater lastUpdater;
-	protected int delayMSecs = 500;
-	final static Class ADAPTER_KEY = IJFaceNodeAdapter.class;
-
-	public CSSNodeAdapter(INodeAdapterFactory adapterFactory) {
-		super();
-		this.adapterFactory = adapterFactory;
-	}
-
-	/**
-	 * Insert the method's description here.
-	 */
-	protected void internalActionPerformed() {
-		if (notifyQueue == null) {
-			return;
-		}
-		boolean refresh_all = false;
-		boolean refresh_rule = false;
-		int pos_all = 0;
-		List targets = new ArrayList();
-		for (int i = 0; i < notifyQueue.size(); i++) {
-			NotifyContext context = (NotifyContext) notifyQueue.get(i);
-			if (context.notifier instanceof ICSSStyleSheet) {
-				refresh_all = true;
-				pos_all = i;
-			}
-			if (context.notifier instanceof ICSSStyleDeclaration) {
-				refresh_rule = true;
-				targets.add(context);
-				//			pos_rule = i;
-			}
-			//		((NotifyContext) notifyQueue.get(i)).fire();
-		}
-		if (refresh_all) {
-			((NotifyContext) notifyQueue.get(pos_all)).fire();
-		} else if (refresh_rule) {
-			Iterator i = targets.iterator();
-			while (i.hasNext()) {
-				((NotifyContext) i.next()).fire();
-			}
-			//	else if (refresh_rule) internalRefreshAll();
-		} else {
-			for (int i = 0; i < notifyQueue.size(); i++) {
-				((NotifyContext) notifyQueue.get(i)).fire();
-			}
-		}
-		notifyQueue.clear();
-	}
-
-	/**
-	 * Called by the object being adapter (the notifier) when something has
-	 * changed.
-	 */
-	public void internalNotifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		Iterator iterator = ((IJFaceNodeAdapterFactory) adapterFactory).getListeners().iterator();
-		while (iterator.hasNext()) {
-			Object listener = iterator.next();
-			if (listener instanceof StructuredViewer) {
-				notifyChangedForStructuredViewer((StructuredViewer) listener, notifier, eventType, changedFeature, oldValue, newValue, pos);
-			} else if (listener instanceof PropertySheetPage) {
-				notifyChangedForPropertySheetPage((PropertySheetPage) listener, notifier, eventType, changedFeature, oldValue, newValue, pos);
-			}
-		}
-	}
-
-	private void notifyChangedForPropertySheetPage(PropertySheetPage page, INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		if (page.getControl() == null || page.getControl().isDisposed()) {
-			return;
-		}
-		if (eventType == INodeNotifier.CHANGE || eventType == INodeNotifier.ADD || eventType == INodeNotifier.REMOVE) {
-			page.refresh();
-		}
-	}
-
-	private void notifyChangedForStructuredViewer(StructuredViewer viewer, INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		if (viewer.getControl() == null || viewer.getControl().isDisposed()) {
-			return;
-		}
-		if (eventType == INodeNotifier.CHANGE) {
-			if (notifier instanceof ICSSStyleSheet) {
-				ICSSNode temp = (changedFeature != null) ? (ICSSNode) changedFeature : (ICSSNode) newValue;
-				if (temp instanceof ICSSStyleRule) {
-					viewer.refresh();
-				} else {
-					for (;;) {
-						if (temp instanceof ICSSStyleRule) {
-							break;
-						}
-						temp = temp.getParentNode();
-						if (temp == null) {
-							break;
-						}
-					}
-					if (temp == null || temp instanceof ICSSStyleSheet) {
-						viewer.refresh();
-					} else {
-						viewer.refresh(temp);
-					}
-				}
-			} else {
-				ICSSNode temp = (ICSSNode) notifier;
-				if (temp != null) {
-					temp = temp.getParentNode();
-				}
-				if (temp == null || temp instanceof ICSSStyleSheet) {
-					viewer.refresh();
-				} else {
-					viewer.refresh(temp);
-				}
-			}
-		}
-		if (eventType == INodeNotifier.ADD) {
-			if (notifier instanceof ICSSStyleSheet) {
-				ICSSNode temp = (changedFeature != null) ? (ICSSNode) changedFeature : (ICSSNode) newValue;
-				if (temp instanceof ICSSStyleRule) {
-					viewer.refresh();
-				} else {
-					for (;;) {
-						if (temp instanceof ICSSStyleRule) {
-							break;
-						}
-						temp = temp.getParentNode();
-						if (temp == null) {
-							break;
-						}
-					}
-				}
-				if (temp == null || (temp instanceof ICSSStyleSheet)) {
-					viewer.refresh();
-				} else {
-					viewer.refresh(temp);
-				}
-			} else {
-				if (newValue != null && (newValue instanceof ICSSStyleDeclItem)) {
-					viewer.refresh(((ICSSNode) newValue).getParentNode());
-				} else {
-					ICSSNode temp = (ICSSNode) notifier;
-					if (temp != null) {
-						temp = temp.getParentNode();
-					}
-					if (temp == null || (temp instanceof ICSSStyleSheet)) {
-						viewer.refresh();
-					} else {
-						viewer.refresh(temp);
-					}
-				}
-			}
-		} else if (eventType == INodeNotifier.REMOVE) {
-			if (notifier instanceof ICSSStyleSheet) {
-				ICSSNode temp = (changedFeature != null) ? (ICSSNode) changedFeature : (ICSSNode) newValue;
-				if (temp instanceof ICSSStyleRule) {
-					viewer.refresh();
-				} else {
-					for (;;) {
-						if (temp instanceof ICSSStyleRule) {
-							break;
-						}
-						temp = temp.getParentNode();
-						if (temp == null) {
-							break;
-						}
-					}
-					if (temp == null || (temp instanceof ICSSStyleSheet)) {
-						viewer.refresh();
-					} else {
-						viewer.refresh(temp);
-					}
-				}
-			} else {
-				//							viewer.refresh(notifier);
-				ICSSNode temp = (ICSSNode) notifier;
-				if (temp != null) {
-					temp = temp.getParentNode();
-				}
-				if (temp == null || (temp instanceof ICSSStyleSheet)) {
-					viewer.refresh();
-				} else {
-					viewer.refresh(temp);
-				}
-			}
-		}
-		//				}
-	}
-
-	/**
-	 *  
-	 */
-	public void internalRefreshAll() {
-		Collection listeners = ((JFaceNodeAdapterFactoryCSS) adapterFactory).getListeners();
-		Iterator iterator = listeners.iterator();
-		while (iterator.hasNext()) {
-			Object listener = iterator.next();
-			if (listener instanceof StructuredViewer) {
-				StructuredViewer viewer = (StructuredViewer) listener;
-				if (viewer.getControl() != null && !viewer.getControl().isDisposed()) {
-					viewer.refresh();
-				}
-			} else if (listener instanceof PropertySheetPage) {
-				PropertySheetPage page = (PropertySheetPage) listener;
-				if (page.getControl() != null && !page.getControl().isDisposed()) {
-					page.refresh();
-				}
-			}
-		}
-	}
-
-	/**
-	 * 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(ADAPTER_KEY);
-	}
-
-	/**
-	 * Called by the object being adapter (the notifier) when something has
-	 * changed.
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		if (notifyQueue == null)
-			notifyQueue = new Vector();
-		notifyQueue.add(new NotifyContext(notifier, eventType, changedFeature, oldValue, newValue, pos));
-		// TODO-future: there's probably a better way than relying on async
-		// exec
-		if (Thread.currentThread() == getDisplay().getThread())
-			getDisplay().timerExec(delayMSecs, this);
-		else
-			getDisplay().asyncExec(new Runnable() {
-				public void run() {
-					if (getDisplay() != null) {
-						getDisplay().timerExec(delayMSecs, this);
-					}
-				}
-			});
-	}
-
-	Display getDisplay() {
-		return PlatformUI.getWorkbench().getDisplay();
-	}
-
-	/**
-	 * this method is intended only for timerExec()
-	 */
-	public void run() {
-		lastUpdater = new StyleViewUpdater();
-		getDisplay().asyncExec(lastUpdater);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/JFaceNodeAdapterFactoryCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/JFaceNodeAdapterFactoryCSS.java
deleted file mode 100644
index b6bcc4a..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/JFaceNodeAdapterFactoryCSS.java
+++ /dev/null
@@ -1,35 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentoutline;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-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;
-
-public class JFaceNodeAdapterFactoryCSS extends JFaceNodeAdapterFactory {
-	public JFaceNodeAdapterFactoryCSS() {
-		this(IJFaceNodeAdapter.class, true);
-	}
-
-	public JFaceNodeAdapterFactoryCSS(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-
-	protected INodeAdapter createAdapter(INodeNotifier node) {
-		if (singletonAdapter == null) {
-			// create the JFaceNodeAdapter
-			singletonAdapter = new CSSNodeAdapter(this);
-		}
-		return singletonAdapter;
-	}
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ContentSettingsRegistry.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ContentSettingsRegistry.java
deleted file mode 100644
index c0445fe..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ContentSettingsRegistry.java
+++ /dev/null
@@ -1,34 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentproperties;
-
-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.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboList;
-
-public final class ContentSettingsRegistry {
-	private static final String NONE = CSSUIMessages.UI_none;
-
-	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);
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java
deleted file mode 100644
index e83da28..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,101 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.contentproperties.ui;
-
-
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.css.ui.internal.Logger;
-import org.eclipse.wst.css.ui.internal.contentproperties.ContentSettingsRegistry;
-import org.eclipse.wst.css.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;
-
-public final class CSSContentSettingsPropertyPage extends ContentSettingsPropertyPage {
-
-	private final int N_CSS_PROFILE = 0;
-
-
-
-	public CSSContentSettingsPropertyPage() {
-		super();
-		numberOfCombo = 1;
-		numCols = 2;
-		numRows = 1;
-		combo = new ComboListOnPropertyPage[super.numberOfCombo];
-
-	}
-
-	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 createSettingsPageGUI() {
-
-		int type = ((IResource) getElement()).getType();
-		switch (type) {
-			case IResource.FILE :
-				//composite = createComposite(propertyPage,numCols,numRows);
-				createCSSComboBox();
-				PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.CSS_CONTENT_SETTINGS_HELPID);
-				break;
-
-			default :
-				Logger.log(Logger.WARNING, "CSSContentSettingsPropertyPage is instantiated by resource except FILE");//$NON-NLS-1$
-				break;
-		}
-
-	}
-
-
-	protected void putSelectedPropertyInto(Map properties, String valueInCombo, int index) {
-
-		switch (index) {
-			case N_CSS_PROFILE :
-				// css
-				properties.put(IContentSettings.CSS_PROFILE, valueInCombo);
-				break;
-			default :
-				Logger.log(Logger.ERROR, "Index is out of range in putSelectedPropertyInto() in class CSSContentSettingsPropertyPage");//$NON-NLS-1$
-				break;
-		}
-
-	}
-
-	protected void deleteNoneProperty(int index) {
-		switch (index) {
-			case N_CSS_PROFILE :
-				// css
-				contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
-				break;
-
-			default :
-				Logger.log(Logger.ERROR, "Index is out of range in deleteNoneProperty() in class CSSContentSettingsPropertyPage");//$NON-NLS-1$
-				break;
-		}
-	}
-
-}
-
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupActionCSSDelegate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupActionCSSDelegate.java
deleted file mode 100644
index 859efbc..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupActionCSSDelegate.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package org.eclipse.wst.css.ui.internal.edit.ui;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.Dialog;
-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.css.core.internal.cleanup.CleanupProcessorCSS;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-/**
- * Cleanup action delegate for CSS editor
- */
-public class CleanupActionCSSDelegate 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(CSSUIMessages.CleanupDocument_label);
-			action.setToolTipText(CSSUIMessages.CleanupDocument_tooltip);
-			action.setDescription(CSSUIMessages.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;
-			Dialog cleanupDialog = new CleanupDialogCSS(editor.getSite().getShell());
-			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 CleanupProcessorCSS();
-
-		return fCleanupProcessor;
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupDialogCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupDialogCSS.java
deleted file mode 100644
index c31c26c..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupDialogCSS.java
+++ /dev/null
@@ -1,290 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.edit.ui;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-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.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategyImpl;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-
-public class CleanupDialogCSS extends Dialog {
-
-	private boolean embeddedCSS;
-	protected Button fRadioButtonIdentCaseAsis;
-	protected Button fRadioButtonIdentCaseLower;
-	protected Button fRadioButtonIdentCaseUpper;
-	protected Button fRadioButtonPropNameCaseAsis;
-	protected Button fRadioButtonPropNameCaseLower;
-	protected Button fRadioButtonPropNameCaseUpper;
-	protected Button fRadioButtonPropValueCaseAsis;
-	protected Button fRadioButtonPropValueCaseLower;
-	protected Button fRadioButtonPropValueCaseUpper;
-	protected Button fRadioButtonSelectorTagCaseAsis;
-	protected Button fRadioButtonSelectorTagCaseLower;
-	protected Button fRadioButtonSelectorTagCaseUpper;
-	protected Button fCheckBoxQuoteValues;
-	protected Button fCheckBoxFormatSource;
-
-	/**
-	 * CSSCleanupDialog constructor comment.
-	 * 
-	 * @param parentShell
-	 *            org.eclipse.swt.widgets.Shell
-	 */
-	public CleanupDialogCSS(Shell parentShell) {
-		super(parentShell);
-	}
-
-	/**
-	 * 
-	 * @return org.eclipse.swt.widgets.Control
-	 * @param parent
-	 *            org.eclipse.swt.widgets.Composite
-	 */
-	public Control createDialogArea(Composite parent) {
-		if (isEmbeddedCSS())
-			getShell().setText(CSSUIMessages.CSS_Cleanup_UI_);
-		else
-			getShell().setText(CSSUIMessages.Cleanup_UI_);
-
-		Composite panel = new Composite(parent, SWT.NULL);
-		GridLayout layout = new GridLayout();
-		layout.numColumns = 1;
-		layout.makeColumnsEqualWidth = true;
-		panel.setLayout(layout);
-
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(panel, IHelpContextIds.CSS_CLEANUP_HELPID);
-
-		// Convert ident case
-		// ACC: Group radio buttons together so associated label is read
-		//		Label identCaseLabel = new Label(panel, SWT.NULL);
-		//		identCaseLabel.setText(ResourceHandler.getString("Identifier_case__UI_"));
-		// //$NON-NLS-1$ = "Identifier case:"
-		//		Canvas identCase = new Canvas(panel, SWT.NULL);
-		Group identCase = new Group(panel, SWT.NULL);
-		identCase.setText(CSSUIMessages.Identifier_case__UI_);
-		GridLayout hLayout = new GridLayout();
-		hLayout.numColumns = 3;
-		identCase.setLayout(hLayout);
-		fRadioButtonIdentCaseAsis = new Button(identCase, SWT.RADIO);
-		fRadioButtonIdentCaseAsis.setText(CSSUIMessages.As_is_UI_);
-		fRadioButtonIdentCaseLower = new Button(identCase, SWT.RADIO);
-		fRadioButtonIdentCaseLower.setText(CSSUIMessages.Lower_UI_);
-		fRadioButtonIdentCaseUpper = new Button(identCase, SWT.RADIO);
-		fRadioButtonIdentCaseUpper.setText(CSSUIMessages.Upper_UI_);
-
-		// Convert property name case
-		// ACC: Group radio buttons together so associated label is read
-		//		Label propNameCaseLabel = new Label(panel, SWT.NULL);
-		//		propNameCaseLabel.setText(ResourceHandler.getString("Property_name_case__UI_"));
-		// //$NON-NLS-1$ = "Property name case:"
-		//		Canvas propNameCase = new Canvas(panel, SWT.NULL);
-		Group propNameCase = new Group(panel, SWT.NULL);
-		propNameCase.setText(CSSUIMessages.Property_name_case__UI_);
-		hLayout = new GridLayout();
-		hLayout.numColumns = 3;
-		propNameCase.setLayout(hLayout);
-		fRadioButtonPropNameCaseAsis = new Button(propNameCase, SWT.RADIO);
-		fRadioButtonPropNameCaseAsis.setText(CSSUIMessages.As_is_UI_);
-		fRadioButtonPropNameCaseLower = new Button(propNameCase, SWT.RADIO);
-		fRadioButtonPropNameCaseLower.setText(CSSUIMessages.Lower_UI_);
-		fRadioButtonPropNameCaseUpper = new Button(propNameCase, SWT.RADIO);
-		fRadioButtonPropNameCaseUpper.setText(CSSUIMessages.Upper_UI_);
-
-		// Convert property Value case
-		// ACC: Group radio buttons together so associated label is read
-		//		Label propValueCaseLabel = new Label(panel, SWT.NULL);
-		//		propValueCaseLabel.setText(ResourceHandler.getString("Property_value_case__UI_"));
-		// //$NON-NLS-1$ = "Property value case:"
-		//		Canvas propValueCase = new Canvas(panel, SWT.NULL);
-		Group propValueCase = new Group(panel, SWT.NULL);
-		propValueCase.setText(CSSUIMessages.Property_value_case__UI_);
-		hLayout = new GridLayout();
-		hLayout.numColumns = 3;
-		propValueCase.setLayout(hLayout);
-		fRadioButtonPropValueCaseAsis = new Button(propValueCase, SWT.RADIO);
-		fRadioButtonPropValueCaseAsis.setText(CSSUIMessages.As_is_UI_);
-		fRadioButtonPropValueCaseLower = new Button(propValueCase, SWT.RADIO);
-		fRadioButtonPropValueCaseLower.setText(CSSUIMessages.Lower_UI_);
-		fRadioButtonPropValueCaseUpper = new Button(propValueCase, SWT.RADIO);
-		fRadioButtonPropValueCaseUpper.setText(CSSUIMessages.Upper_UI_);
-
-		if (!isEmbeddedCSS()) {
-			// Convert selector tag case
-			// ACC: Group radio buttons together so associated label is read
-			//			Label selectorTagCaseLabel = new Label(panel, SWT.NULL);
-			//			selectorTagCaseLabel.setText(ResourceHandler.getString("Selector_tag_name_case__UI_"));
-			// //$NON-NLS-1$ = "Selector tag name case:"
-			//			Canvas selectorTagCase = new Canvas(panel, SWT.NULL);
-			Group selectorTagCase = new Group(panel, SWT.NULL);
-			selectorTagCase.setText(CSSUIMessages.Selector_tag_name_case__UI_);
-			hLayout = new GridLayout();
-			hLayout.numColumns = 3;
-			selectorTagCase.setLayout(hLayout);
-			fRadioButtonSelectorTagCaseAsis = new Button(selectorTagCase, SWT.RADIO);
-			fRadioButtonSelectorTagCaseAsis.setText(CSSUIMessages.As_is_UI_);
-			fRadioButtonSelectorTagCaseLower = new Button(selectorTagCase, SWT.RADIO);
-			fRadioButtonSelectorTagCaseLower.setText(CSSUIMessages.Lower_UI_);
-			fRadioButtonSelectorTagCaseUpper = new Button(selectorTagCase, SWT.RADIO);
-			fRadioButtonSelectorTagCaseUpper.setText(CSSUIMessages.Upper_UI_);
-		}
-
-		// Quote attribute values
-		fCheckBoxQuoteValues = new Button(panel, SWT.CHECK);
-		fCheckBoxQuoteValues.setText(CSSUIMessages.Quote_values_UI_);
-
-		if (!isEmbeddedCSS()) {
-			// Format source
-			fCheckBoxFormatSource = new Button(panel, SWT.CHECK);
-			fCheckBoxFormatSource.setText(CSSUIMessages.Format_source_UI_);
-		}
-
-		setCleanupOptions();
-
-		return panel;
-	}
-
-	/**
-	 * Insert the method's description here.
-	 * 
-	 * @return boolean
-	 */
-	public boolean isEmbeddedCSS() {
-		return embeddedCSS;
-	}
-
-	/**
-	 *  
-	 */
-	protected void okPressed() {
-		updateCleanupOptions();
-		super.okPressed();
-	}
-
-	/**
-	 *  
-	 */
-	protected void setCleanupOptions() {
-		CSSCleanupStrategy stgy = CSSCleanupStrategyImpl.getInstance();
-
-		if (fRadioButtonIdentCaseAsis != null) {
-			if (stgy.getIdentCase() == CSSCleanupStrategy.UPPER)
-				fRadioButtonIdentCaseUpper.setSelection(true);
-			else if (stgy.getIdentCase() == CSSCleanupStrategy.LOWER)
-				fRadioButtonIdentCaseLower.setSelection(true);
-			else
-				fRadioButtonIdentCaseAsis.setSelection(true);
-		}
-
-		if (fRadioButtonPropNameCaseAsis != null) {
-			if (stgy.getPropNameCase() == CSSCleanupStrategy.UPPER)
-				fRadioButtonPropNameCaseUpper.setSelection(true);
-			else if (stgy.getPropNameCase() == CSSCleanupStrategy.LOWER)
-				fRadioButtonPropNameCaseLower.setSelection(true);
-			else
-				fRadioButtonPropNameCaseAsis.setSelection(true);
-		}
-
-		if (fRadioButtonPropValueCaseAsis != null) {
-			if (stgy.getPropValueCase() == CSSCleanupStrategy.UPPER)
-				fRadioButtonPropValueCaseUpper.setSelection(true);
-			else if (stgy.getPropValueCase() == CSSCleanupStrategy.LOWER)
-				fRadioButtonPropValueCaseLower.setSelection(true);
-			else
-				fRadioButtonPropValueCaseAsis.setSelection(true);
-		}
-
-		if (fRadioButtonSelectorTagCaseAsis != null) {
-			if (stgy.getSelectorTagCase() == CSSCleanupStrategy.UPPER)
-				fRadioButtonSelectorTagCaseUpper.setSelection(true);
-			else if (stgy.getSelectorTagCase() == CSSCleanupStrategy.LOWER)
-				fRadioButtonSelectorTagCaseLower.setSelection(true);
-			else
-				fRadioButtonSelectorTagCaseAsis.setSelection(true);
-		}
-
-		if (fCheckBoxQuoteValues != null)
-			fCheckBoxQuoteValues.setSelection(stgy.isQuoteValues());
-
-		if (fCheckBoxFormatSource != null)
-			fCheckBoxFormatSource.setSelection(stgy.isFormatSource());
-
-	}
-
-	/**
-	 * Insert the method's description here.
-	 * 
-	 * @param newEmbeddedCSS
-	 *            boolean
-	 */
-	public void setEmbeddedCSS(boolean newEmbeddedCSS) {
-		embeddedCSS = newEmbeddedCSS;
-	}
-
-	/**
-	 *  
-	 */
-	protected void updateCleanupOptions() {
-		CSSCleanupStrategy stgy = CSSCleanupStrategyImpl.getInstance();
-
-		if (fRadioButtonIdentCaseAsis != null) {
-			if (fRadioButtonIdentCaseUpper.getSelection())
-				stgy.setIdentCase(CSSCleanupStrategy.UPPER);
-			else if (fRadioButtonIdentCaseLower.getSelection())
-				stgy.setIdentCase(CSSCleanupStrategy.LOWER);
-			else
-				stgy.setIdentCase(CSSCleanupStrategy.ASIS);
-		}
-
-		if (fRadioButtonPropNameCaseAsis != null) {
-			if (fRadioButtonPropNameCaseUpper.getSelection())
-				stgy.setPropNameCase(CSSCleanupStrategy.UPPER);
-			else if (fRadioButtonPropNameCaseLower.getSelection())
-				stgy.setPropNameCase(CSSCleanupStrategy.LOWER);
-			else
-				stgy.setPropNameCase(CSSCleanupStrategy.ASIS);
-		}
-
-		if (fRadioButtonPropValueCaseAsis != null) {
-			if (fRadioButtonPropValueCaseUpper.getSelection())
-				stgy.setPropValueCase(CSSCleanupStrategy.UPPER);
-			else if (fRadioButtonPropValueCaseLower.getSelection())
-				stgy.setPropValueCase(CSSCleanupStrategy.LOWER);
-			else
-				stgy.setPropValueCase(CSSCleanupStrategy.ASIS);
-		}
-
-		if (fRadioButtonSelectorTagCaseAsis != null) {
-			if (fRadioButtonSelectorTagCaseUpper.getSelection())
-				stgy.setSelectorTagCase(CSSCleanupStrategy.UPPER);
-			else if (fRadioButtonSelectorTagCaseLower.getSelection())
-				stgy.setSelectorTagCase(CSSCleanupStrategy.LOWER);
-			else
-				stgy.setSelectorTagCase(CSSCleanupStrategy.ASIS);
-		}
-
-		if (fCheckBoxQuoteValues != null)
-			stgy.setQuoteValues(fCheckBoxQuoteValues.getSelection());
-
-		if (fCheckBoxFormatSource != null)
-			stgy.setFormatSource(fCheckBoxFormatSource.getSelection());
-
-		// save these values to preferences
-		((CSSCleanupStrategyImpl) stgy).saveOptions();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSEditorPluginImages.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSEditorPluginImages.java
deleted file mode 100644
index 7f23666..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSEditorPluginImages.java
+++ /dev/null
@@ -1,54 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.editor;
-
-
-/**
- * Bundle of most images used by the CSS Source Editor plug-in.
- */
-public class CSSEditorPluginImages {
-	public static final String IMG_OBJ_SORT = "icons/full/obj16/sort.gif"; //$NON-NLS-1$
-
-	public static final String IMG_OBJ_STYLESHEET = "icons/full/obj16/stylesheet.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_RULE_CHARSET = "icons/full/obj16/charset_rule.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_RULE_FONTFACE = "icons/full/obj16/fontface_rule.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_RULE_IMPORT = "icons/full/obj16/link_rule.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_RULE_MEDIA = "icons/full/obj16/media_rule.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_RULE_PAGE = "icons/full/obj16/page_rule.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_RULE_STYLE = "icons/full/obj16/style_rule.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_RULE_UNKNOWN = "icons/full/obj16/unknown_rule.gif"; //$NON-NLS-1$
-
-	public static final String IMG_OBJ_SELECTOR_CLASS = "icons/full/obj16/class_selector.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_SELECTOR_ID = "icons/full/obj16/id_selector.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_SELECTOR_PSEUDO = "icons/full/obj16/pseudo.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_SELECTOR_TAG = "icons/full/obj16/tag_selector.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_SELECTOR_LINK = "icons/full/obj16/link_selector.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_SELECTOR_DEFAULT = "icons/full/obj16/tag_selector.gif"; //$NON-NLS-1$
-
-	public static final String IMG_OBJ_VALUE_FUNCTION = "icons/full/obj16/css_propertyvalue_function.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_VALUE_NUMBER = "icons/full/obj16/css_propertyvalue_unit.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_VALUE_STRING = "icons/full/obj16/css_propertyvalue_identifier.gif"; //$NON-NLS-1$
-
-	public static final String IMG_OBJ_CATEGORY_AURAL = "icons/full/obj16/aural_props.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_CATEGORY_BOX = "icons/full/obj16/boxmodel_props.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_CATEGORY_COLORANDBACKGROUND = "icons/full/obj16/colback_props.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_CATEGORY_CONTENT = "icons/full/obj16/content_props.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_CATEGORY_FONT = "icons/full/obj16/font_props.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_CATEGORY_PAGE = "icons/full/obj16/pagedmedia_props.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_CATEGORY_TABLES = "icons/full/obj16/table_props.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_CATEGORY_TEXT = "icons/full/obj16/text_props.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_CATEGORY_UI = "icons/full/obj16/ui_props.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_CATEGORY_VISUAL = "icons/full/obj16/visual_props.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_CATEGORY_DEFAULT = "icons/full/obj16/other_props.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_TEMPLATE = "icons/full/obj16/tag-template.gif"; //$NON-NLS-1$
-	
-	public static final String IMG_WIZBAN_NEWCSSFILE = "icons/full/wizban/newcssfile_wiz.gif"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index 350c4fd..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.editor;
-
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-
-/**
- * Help context ids for the CSS Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- * 
- */
-public interface IHelpContextIds {
-	// org.eclipse.wst.css.ui.
-	public static final String PREFIX = CSSUIPlugin.ID + "."; //$NON-NLS-1$
-
-	// // figured out on the fly
-	// // CSS Source page editor
-	// public static final String CSS_SOURCEVIEW_HELPID =
-	// ContentTypeIdForCSS.ContentTypeID_CSS +"_source_HelpId"; //$NON-NLS-1$
-
-	// CSS Files Preference page
-	public static final String CSS_PREFWEBX_FILES_HELPID = PREFIX + "webx0010"; //$NON-NLS-1$
-	// CSS Source Preference page
-	public static final String CSS_PREFWEBX_SOURCE_HELPID = PREFIX + "webx0011"; //$NON-NLS-1$
-	// CSS Styles Preference page
-	public static final String CSS_PREFWEBX_STYLES_HELPID = PREFIX + "webx0012"; //$NON-NLS-1$
-	// CSS Template Preference page
-	public static final String CSS_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0013"; //$NON-NLS-1$
-
-	// CSS Cleanup dialog
-	public static final String CSS_CLEANUP_HELPID = PREFIX + "xmlm1300"; //$NON-NLS-1$
-
-	// CSS Content Settings
-	public static final String CSS_CONTENT_SETTINGS_HELPID = PREFIX + "misc0180"; //$NON-NLS-1$
-	
-	// CSS New File Wizard - Template Page
-	public static final String CSS_NEWWIZARD_TEMPLATE_HELPID = PREFIX + "cssw0010"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageHelper.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageHelper.java
deleted file mode 100644
index 58b4d31..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageHelper.java
+++ /dev/null
@@ -1,181 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.image;
-
-
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.CSSEditorPluginImages;
-
-
-public class CSSImageHelper {
-	private static CSSImageHelper fInstance = null;
-
-	/**
-	 * singleton
-	 */
-	public synchronized static CSSImageHelper getInstance() {
-		if (fInstance == null) {
-			fInstance = new CSSImageHelper();
-		}
-		return fInstance;
-	}
-
-	private HashMap fImageDescRegistry = null;	// save a descriptor for each image
-	private Map fTypeMap = null;
-
-	/**
-	 * 
-	 */
-	private CSSImageHelper() {
-		super();
-	}
-
-	/**
-	 * 
-	 */
-	private Image createImage(String resource) {
-		ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(CSSUIPlugin.ID, resource);
-		Image image = null;
-
-		if (desc == null) {
-			desc = ImageDescriptor.getMissingImageDescriptor();
-			image = desc.createImage();
-		} else {
-			image = desc.createImage();
-			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(CSSUIPlugin.ID, imageFilePath);
-		if (imageDescriptor != null) {
-			getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
-		} else {
-			imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
-		}
-
-		return imageDescriptor;
-	}
-
-	/**
-	 * by type
-	 */
-	public Image getImage(CSSImageType type) {
-		if (fTypeMap == null) {
-			fTypeMap = new HashMap();
-			fTypeMap.put(CSSImageType.STYLESHEET, CSSEditorPluginImages.IMG_OBJ_STYLESHEET);
-
-			fTypeMap.put(CSSImageType.RULE_CHARSET, CSSEditorPluginImages.IMG_OBJ_RULE_CHARSET);
-			fTypeMap.put(CSSImageType.RULE_FONTFACE, CSSEditorPluginImages.IMG_OBJ_RULE_FONTFACE);
-			fTypeMap.put(CSSImageType.RULE_IMPORT, CSSEditorPluginImages.IMG_OBJ_RULE_IMPORT);
-			fTypeMap.put(CSSImageType.RULE_MEDIA, CSSEditorPluginImages.IMG_OBJ_RULE_MEDIA);
-			fTypeMap.put(CSSImageType.RULE_PAGE, CSSEditorPluginImages.IMG_OBJ_RULE_PAGE);
-			fTypeMap.put(CSSImageType.RULE_STYLE, CSSEditorPluginImages.IMG_OBJ_RULE_STYLE);
-			fTypeMap.put(CSSImageType.RULE_UNKNOWN, CSSEditorPluginImages.IMG_OBJ_RULE_UNKNOWN);
-
-			fTypeMap.put(CSSImageType.SELECTOR_CLASS, CSSEditorPluginImages.IMG_OBJ_SELECTOR_CLASS);
-			fTypeMap.put(CSSImageType.SELECTOR_ID, CSSEditorPluginImages.IMG_OBJ_SELECTOR_ID);
-			fTypeMap.put(CSSImageType.SELECTOR_PSEUDO, CSSEditorPluginImages.IMG_OBJ_SELECTOR_PSEUDO);
-			fTypeMap.put(CSSImageType.SELECTOR_TAG, CSSEditorPluginImages.IMG_OBJ_SELECTOR_TAG);
-			fTypeMap.put(CSSImageType.SELECTOR_LINK, CSSEditorPluginImages.IMG_OBJ_SELECTOR_LINK);
-			fTypeMap.put(CSSImageType.SELECTOR_DEFAULT, CSSEditorPluginImages.IMG_OBJ_SELECTOR_DEFAULT);
-
-			fTypeMap.put(CSSImageType.VALUE_FUNCTION, CSSEditorPluginImages.IMG_OBJ_VALUE_FUNCTION);
-			fTypeMap.put(CSSImageType.VALUE_NUMBER, CSSEditorPluginImages.IMG_OBJ_VALUE_NUMBER);
-			fTypeMap.put(CSSImageType.VALUE_STRING, CSSEditorPluginImages.IMG_OBJ_VALUE_STRING);
-
-			fTypeMap.put(CSSImageType.CATEGORY_AURAL, CSSEditorPluginImages.IMG_OBJ_CATEGORY_AURAL);
-			fTypeMap.put(CSSImageType.CATEGORY_BOX, CSSEditorPluginImages.IMG_OBJ_CATEGORY_BOX);
-			fTypeMap.put(CSSImageType.CATEGORY_COLORANDBACKGROUND, CSSEditorPluginImages.IMG_OBJ_CATEGORY_COLORANDBACKGROUND);
-			fTypeMap.put(CSSImageType.CATEGORY_CONTENT, CSSEditorPluginImages.IMG_OBJ_CATEGORY_CONTENT);
-			fTypeMap.put(CSSImageType.CATEGORY_FONT, CSSEditorPluginImages.IMG_OBJ_CATEGORY_FONT);
-			fTypeMap.put(CSSImageType.CATEGORY_PAGE, CSSEditorPluginImages.IMG_OBJ_CATEGORY_PAGE);
-			fTypeMap.put(CSSImageType.CATEGORY_TABLES, CSSEditorPluginImages.IMG_OBJ_CATEGORY_TABLES);
-			fTypeMap.put(CSSImageType.CATEGORY_TEXT, CSSEditorPluginImages.IMG_OBJ_CATEGORY_TEXT);
-			fTypeMap.put(CSSImageType.CATEGORY_UI, CSSEditorPluginImages.IMG_OBJ_CATEGORY_UI);
-			fTypeMap.put(CSSImageType.CATEGORY_VISUAL, CSSEditorPluginImages.IMG_OBJ_CATEGORY_VISUAL);
-			fTypeMap.put(CSSImageType.CATEGORY_DEFAULT, CSSEditorPluginImages.IMG_OBJ_CATEGORY_DEFAULT);
-		}
-		return getImage((String) fTypeMap.get(type));
-	}
-
-	/**
-	 * by relative path(from here)
-	 */
-	public Image getImage(String resource) {
-		if (resource == null) {
-			return null;
-		}
-		Image image = getImageRegistry().get(resource);
-		if (image == null) {
-			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;
-	}
-
-	private ImageRegistry getImageRegistry() {
-		return JFaceResources.getImageRegistry();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageType.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageType.java
deleted file mode 100644
index 8f835cf..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageType.java
+++ /dev/null
@@ -1,235 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.image;
-
-
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMProperty;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelFinder;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelUtil;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.w3c.dom.css.CSSCharsetRule;
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSImportRule;
-import org.w3c.dom.css.CSSMediaRule;
-import org.w3c.dom.css.CSSPageRule;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleRule;
-import org.w3c.dom.css.CSSValue;
-
-/**
- */
-public class CSSImageType {
-
-	private final String fName;
-
-	private CSSImageType(String name) {
-		this.fName = name;
-	}
-
-	public String toString() {
-		return fName;
-	}
-
-	public static final CSSImageType STYLESHEET = new CSSImageType("STYLESHEET"); //$NON-NLS-1$
-
-	public static final CSSImageType RULE_CHARSET = new CSSImageType("RULE_CHARSET"); //$NON-NLS-1$
-	public static final CSSImageType RULE_FONTFACE = new CSSImageType("RULE_FONTFACE"); //$NON-NLS-1$
-	public static final CSSImageType RULE_IMPORT = new CSSImageType("RULE_IMPORT"); //$NON-NLS-1$
-	public static final CSSImageType RULE_MEDIA = new CSSImageType("RULE_MEDIA"); //$NON-NLS-1$
-	public static final CSSImageType RULE_PAGE = new CSSImageType("RULE_PAGE"); //$NON-NLS-1$
-	public static final CSSImageType RULE_STYLE = new CSSImageType("RULE_STYLE"); //$NON-NLS-1$
-	public static final CSSImageType RULE_UNKNOWN = new CSSImageType("RULE_UNKNOWN"); //$NON-NLS-1$
-
-	public static final CSSImageType SELECTOR_CLASS = new CSSImageType("SELECTOR_CLASS"); //$NON-NLS-1$
-	public static final CSSImageType SELECTOR_ID = new CSSImageType("SELECTOR_ID"); //$NON-NLS-1$
-	public static final CSSImageType SELECTOR_DEFAULT = new CSSImageType("SELECTOR_DEFAULT"); //$NON-NLS-1$
-	public static final CSSImageType SELECTOR_PSEUDO = new CSSImageType("SELECTOR_PSEUDO"); //$NON-NLS-1$
-	public static final CSSImageType SELECTOR_TAG = new CSSImageType("SELECTOR_TAG"); //$NON-NLS-1$
-	public static final CSSImageType SELECTOR_LINK = new CSSImageType("SELECTOR_LINK"); //$NON-NLS-1$
-
-	public static final CSSImageType VALUE_FUNCTION = new CSSImageType("VALUE_FUNCTION"); //$NON-NLS-1$
-	public static final CSSImageType VALUE_NUMBER = new CSSImageType("VALUE_NUMBER"); //$NON-NLS-1$
-	public static final CSSImageType VALUE_STRING = new CSSImageType("VALUE_STRING"); //$NON-NLS-1$
-
-	public static final CSSImageType CATEGORY_AURAL = new CSSImageType("CATEGORY_AURAL"); //$NON-NLS-1$
-	public static final CSSImageType CATEGORY_BOX = new CSSImageType("CATEGORY_BOX"); //$NON-NLS-1$
-	public static final CSSImageType CATEGORY_COLORANDBACKGROUND = new CSSImageType("CATEGORY_COLORANDBACKGROUND"); //$NON-NLS-1$
-	public static final CSSImageType CATEGORY_CONTENT = new CSSImageType("CATEGORY_CONTENT"); //$NON-NLS-1$
-	public static final CSSImageType CATEGORY_FONT = new CSSImageType("CATEGORY_FONT"); //$NON-NLS-1$
-	public static final CSSImageType CATEGORY_PAGE = new CSSImageType("CATEGORY_PAGE"); //$NON-NLS-1$
-	public static final CSSImageType CATEGORY_TABLES = new CSSImageType("CATEGORY_TABLES"); //$NON-NLS-1$
-	public static final CSSImageType CATEGORY_TEXT = new CSSImageType("CATEGORY_TEXT"); //$NON-NLS-1$
-	public static final CSSImageType CATEGORY_UI = new CSSImageType("CATEGORY_UI"); //$NON-NLS-1$
-	public static final CSSImageType CATEGORY_VISUAL = new CSSImageType("CATEGORY_VISUAL"); //$NON-NLS-1$
-	public static final CSSImageType CATEGORY_DEFAULT = new CSSImageType("CATEGORY_DEFAULT"); //$NON-NLS-1$
-
-	/**
-	 * by node
-	 */
-	public static CSSImageType getImageType(ICSSNode node) {
-		CSSImageType imageType = null;
-		if (node instanceof CSSCharsetRule) {
-			imageType = RULE_CHARSET;
-		} else if (node instanceof CSSFontFaceRule) {
-			imageType = RULE_FONTFACE;
-		} else if (node instanceof CSSImportRule) {
-			imageType = RULE_IMPORT;
-		} else if (node instanceof CSSMediaRule) {
-			imageType = RULE_MEDIA;
-		} else if (node instanceof CSSPageRule) {
-			imageType = RULE_PAGE;
-		} else if (node instanceof CSSStyleRule) {
-			imageType = getImageType(((ICSSStyleRule) node).getSelectors());
-		} else if (node instanceof CSSStyleDeclaration) {
-			ICSSNode parent = node.getParentNode();
-			if (parent != null) {
-				return getImageType(parent);
-			}
-		} else if (node instanceof ICSSStyleDeclItem) {
-			String name = ((ICSSStyleDeclItem) node).getPropertyName();
-			ICSSDocument doc = node.getOwnerDocument();
-			ICSSModel model = (doc != null) ? doc.getModel() : null;
-			CSSMetaModelFinder finder = CSSMetaModelFinder.getInstance();
-			CSSMetaModel metaModel = finder.findMetaModelFor(model);
-			// is font-face rule ?
-			ICSSNode parent = node.getParentNode();
-			if (parent != null) {
-				parent = parent.getParentNode();
-				if (parent instanceof CSSFontFaceRule) {
-					imageType = CSSImageType.CATEGORY_FONT;
-				}
-			}
-			if (imageType == null) {
-				CSSMMProperty prop = new CSSMetaModelUtil(metaModel).getProperty(name);
-				if (prop != null) {
-					String category = prop.getAttribute("category"); //$NON-NLS-1$
-					imageType = getImageType(category);
-				}
-				if (imageType == null) {
-					imageType = CSSImageType.CATEGORY_DEFAULT;
-				}
-			}
-		} else if (node instanceof CSSValue) {
-			switch (((CSSValue) node).getCssValueType()) {
-				case CSSPrimitiveValue.CSS_NUMBER :
-				case CSSPrimitiveValue.CSS_PERCENTAGE :
-				case CSSPrimitiveValue.CSS_EMS :
-				case CSSPrimitiveValue.CSS_EXS :
-				case CSSPrimitiveValue.CSS_PX :
-				case CSSPrimitiveValue.CSS_CM :
-				case CSSPrimitiveValue.CSS_MM :
-				case CSSPrimitiveValue.CSS_IN :
-				case CSSPrimitiveValue.CSS_PT :
-				case CSSPrimitiveValue.CSS_PC :
-				case CSSPrimitiveValue.CSS_DEG :
-				case CSSPrimitiveValue.CSS_RAD :
-				case CSSPrimitiveValue.CSS_GRAD :
-				case CSSPrimitiveValue.CSS_MS :
-				case CSSPrimitiveValue.CSS_S :
-				case CSSPrimitiveValue.CSS_HZ :
-				case CSSPrimitiveValue.CSS_KHZ :
-				case CSSPrimitiveValue.CSS_DIMENSION :
-				case ICSSPrimitiveValue.CSS_INTEGER :
-				case ICSSPrimitiveValue.CSS_HASH :
-					imageType = VALUE_NUMBER;
-					break;
-				case CSSPrimitiveValue.CSS_ATTR :
-				case CSSPrimitiveValue.CSS_COUNTER :
-				case CSSPrimitiveValue.CSS_RECT :
-				case CSSPrimitiveValue.CSS_RGBCOLOR :
-				case CSSPrimitiveValue.CSS_URI :
-				case ICSSPrimitiveValue.CSS_FORMAT :
-				case ICSSPrimitiveValue.CSS_LOCAL :
-					imageType = VALUE_FUNCTION;
-					break;
-				default :
-					imageType = VALUE_STRING;
-					break;
-			}
-		}
-		return imageType;
-	}
-
-	public static CSSImageType getImageType(ICSSSelectorList selectorList) {
-		if (selectorList == null || selectorList.getLength() == 0) {
-			return SELECTOR_DEFAULT;
-		}
-		CSSImageType imageType = null;
-		int nSelectors = selectorList.getLength();
-		for (int i = 0; i < nSelectors; i++) {
-			CSSImageType candidate = getImageType(selectorList.getSelector(i));
-			if (imageType == null) {
-				imageType = candidate;
-			} else if (imageType != candidate) {
-				imageType = null;
-				break;
-			}
-		}
-
-		return (imageType == null) ? SELECTOR_DEFAULT : imageType;
-	}
-
-	public static CSSImageType getImageType(ICSSSelector selector) {
-		CSSImageType imageType = SELECTOR_DEFAULT;
-		if (selector == null || selector.getLength() == 0) {
-			return imageType;
-		}
-		ICSSSelectorItem item = selector.getItem(selector.getLength() - 1);
-		if (item.getItemType() == ICSSSelectorItem.SIMPLE) {
-			ICSSSimpleSelector ss = (ICSSSimpleSelector) item;
-			if (0 < ss.getNumOfIDs()) {
-				imageType = SELECTOR_ID;
-			} else if (0 < ss.getNumOfClasses()) {
-				imageType = SELECTOR_CLASS;
-			} else if (0 < ss.getNumOfPseudoNames()) {
-				imageType = SELECTOR_PSEUDO;
-			} else {
-				imageType = SELECTOR_TAG;
-			}
-		}
-		return imageType;
-	}
-
-	public static CSSImageType getImageType(String category) {
-		if (fCategoryMap == null) {
-			fCategoryMap = new HashMap();
-			fCategoryMap.put("aural", CATEGORY_AURAL); //$NON-NLS-1$
-			fCategoryMap.put("box", CATEGORY_BOX); //$NON-NLS-1$
-			fCategoryMap.put("colorandbackground", CATEGORY_COLORANDBACKGROUND); //$NON-NLS-1$
-			fCategoryMap.put("content", CATEGORY_CONTENT); //$NON-NLS-1$
-			fCategoryMap.put("font", CATEGORY_FONT); //$NON-NLS-1$
-			fCategoryMap.put("page", CATEGORY_PAGE); //$NON-NLS-1$
-			fCategoryMap.put("tables", CATEGORY_TABLES); //$NON-NLS-1$
-			fCategoryMap.put("text", CATEGORY_TEXT); //$NON-NLS-1$
-			fCategoryMap.put("ui", CATEGORY_UI); //$NON-NLS-1$
-			fCategoryMap.put("visual", CATEGORY_VISUAL); //$NON-NLS-1$
-		}
-		CSSImageType imageType = (CSSImageType) fCategoryMap.get(category);
-		return (imageType == null) ? CATEGORY_DEFAULT : imageType;
-	}
-
-	private static Map fCategoryMap = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceInitializer.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceInitializer.java
deleted file mode 100644
index 3eb4712..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceInitializer.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.eclipse.wst.css.ui.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.style.IStyleConstantsCSS;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-
-/**
- * Sets default values for CSS UI preferences
- */
-public class CSSUIPreferenceInitializer extends AbstractPreferenceInitializer {
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
-	 */
-	public void initializeDefaultPreferences() {
-		IPreferenceStore store = CSSUIPlugin.getDefault().getPreferenceStore();
-		// CSS Style Preferences
-		String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
-		String styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
-		store.setDefault(IStyleConstantsCSS.NORMAL, styleValue);
-
-		styleValue = ColorHelper.getColorString(63, 127, 127) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsCSS.ATMARK_RULE, styleValue);
-		store.setDefault(IStyleConstantsCSS.SELECTOR, styleValue);
-
-		styleValue = ColorHelper.getColorString(42, 0, 225) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsCSS.MEDIA, styleValue);
-
-		styleValue = ColorHelper.getColorString(63, 95, 191) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsCSS.COMMENT, styleValue);
-
-		styleValue = ColorHelper.getColorString(127, 0, 127) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsCSS.PROPERTY_NAME, styleValue);
-
-		styleValue = ColorHelper.getColorString(42, 0, 225) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsCSS.PROPERTY_VALUE, styleValue);
-		store.setDefault(IStyleConstantsCSS.URI, styleValue);
-		store.setDefault(IStyleConstantsCSS.STRING, styleValue);
-
-		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
-		store.setDefault(IStyleConstantsCSS.COLON, styleValue);
-		store.setDefault(IStyleConstantsCSS.SEMI_COLON, styleValue);
-		store.setDefault(IStyleConstantsCSS.CURLY_BRACE, styleValue);
-
-		styleValue = ColorHelper.getColorString(191, 63, 63) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsCSS.ERROR, styleValue);
-		
-		// set default new css file template to use in new file wizard
-		/*
-		 * Need to find template name that goes with default template id (name
-		 * may change for differnt language)
-		 */
-		String templateName = ""; //$NON-NLS-1$
-		Template template = CSSUIPlugin.getDefault().getTemplateStore().findTemplateById("org.eclipse.wst.css.ui.internal.templates.newcss"); //$NON-NLS-1$
-		if (template != null)
-			templateName = template.getName();
-		store.setDefault(CSSUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceNames.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceNames.java
deleted file mode 100644
index 48ab781..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceNames.java
+++ /dev/null
@@ -1,37 +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.css.ui.internal.preferences;
-
-/**
- * Preference keys for CSS UI
- */
-public class CSSUIPreferenceNames {
-	private CSSUIPreferenceNames() {
-		// cannot create instance
-	}
-	/**
-	 * The key to store customized templates.
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 */
-	public static final String TEMPLATES_KEY = "org.eclipse.wst.sse.ui.custom_templates"; //$NON-NLS-1$
-	
-	/**
-	 * The key to store the last template name used in new CSS 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$
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSColorPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSColorPage.java
deleted file mode 100644
index d3df1ab..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSColorPage.java
+++ /dev/null
@@ -1,218 +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
- ****************************************************************************/
-package org.eclipse.wst.css.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.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.css.ui.internal.style.IStyleConstantsCSS;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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.AbstractColorPage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;
-
-public class CSSColorPage extends AbstractColorPage {
-
-	/**
-	 * 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;
-	}
-
-	protected Control createContents(Composite parent) {
-		Composite pageComponent = createComposite(parent, 1);
-		((GridData) pageComponent.getLayoutData()).horizontalAlignment = GridData.HORIZONTAL_ALIGN_FILL;
-
-		super.createContents(pageComponent);
-
-		// assigning one help for whole group
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.CSS_PREFWEBX_STYLES_HELPID);
-
-		return pageComponent;
-	}
-
-	protected Composite createColoringComposite(Composite parent) {
-		Composite coloringComposite = super.createColoringComposite(parent);
-
-		// assigning one help for whole group
-		return coloringComposite;
-	}
-
-	/**
-	 * getSampleText method comment.
-	 */
-	public String getSampleText() {
-		return CSSUIMessages.PrefsLabel_ColorSample; //$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 * @param contextStyleMap
-	 *            java.util.Dictionary
-	 */
-	protected void initContextStyleMap(Dictionary contextStyleMap) {
-		contextStyleMap.put(CSSRegionContexts.CSS_COMMENT, IStyleConstantsCSS.COMMENT);
-		contextStyleMap.put(CSSRegionContexts.CSS_CDO, IStyleConstantsCSS.COMMENT);
-		contextStyleMap.put(CSSRegionContexts.CSS_CDC, IStyleConstantsCSS.COMMENT);
-		contextStyleMap.put(CSSRegionContexts.CSS_S, IStyleConstantsCSS.NORMAL);
-
-		contextStyleMap.put(CSSRegionContexts.CSS_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
-		contextStyleMap.put(CSSRegionContexts.CSS_LBRACE, IStyleConstantsCSS.CURLY_BRACE);
-		contextStyleMap.put(CSSRegionContexts.CSS_RBRACE, IStyleConstantsCSS.CURLY_BRACE);
-
-		contextStyleMap.put(CSSRegionContexts.CSS_IMPORT, IStyleConstantsCSS.ATMARK_RULE);
-		contextStyleMap.put(CSSRegionContexts.CSS_PAGE, IStyleConstantsCSS.ATMARK_RULE);
-		contextStyleMap.put(CSSRegionContexts.CSS_MEDIA, IStyleConstantsCSS.ATMARK_RULE);
-		contextStyleMap.put(CSSRegionContexts.CSS_FONT_FACE, IStyleConstantsCSS.ATMARK_RULE);
-		contextStyleMap.put(CSSRegionContexts.CSS_CHARSET, IStyleConstantsCSS.ATMARK_RULE);
-		contextStyleMap.put(CSSRegionContexts.CSS_ATKEYWORD, IStyleConstantsCSS.ATMARK_RULE);
-
-		contextStyleMap.put(CSSRegionContexts.CSS_STRING, IStyleConstantsCSS.STRING);
-		contextStyleMap.put(CSSRegionContexts.CSS_URI, IStyleConstantsCSS.URI);
-		contextStyleMap.put(CSSRegionContexts.CSS_MEDIUM, IStyleConstantsCSS.MEDIA);
-		contextStyleMap.put(CSSRegionContexts.CSS_MEDIA_SEPARATOR, IStyleConstantsCSS.MEDIA);
-
-		contextStyleMap.put(CSSRegionContexts.CSS_CHARSET_NAME, IStyleConstantsCSS.STRING);
-
-		contextStyleMap.put(CSSRegionContexts.CSS_PAGE_SELECTOR, IStyleConstantsCSS.MEDIA);
-
-		contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME, IStyleConstantsCSS.SELECTOR);
-		contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_UNIVERSAL, IStyleConstantsCSS.SELECTOR);
-		contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_PSEUDO, IStyleConstantsCSS.SELECTOR);
-		contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_CLASS, IStyleConstantsCSS.SELECTOR);
-		contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ID, IStyleConstantsCSS.SELECTOR);
-
-		contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_COMBINATOR, IStyleConstantsCSS.SELECTOR);
-		contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_SEPARATOR, IStyleConstantsCSS.SELECTOR);
-		contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START, IStyleConstantsCSS.SELECTOR);
-		contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END, IStyleConstantsCSS.SELECTOR);
-		contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME, IStyleConstantsCSS.SELECTOR);
-		contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE, IStyleConstantsCSS.SELECTOR);
-		contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR, IStyleConstantsCSS.SELECTOR);
-
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_PROPERTY, IStyleConstantsCSS.PROPERTY_NAME);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT, IStyleConstantsCSS.PROPERTY_VALUE);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION, IStyleConstantsCSS.PROPERTY_VALUE);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE, IStyleConstantsCSS.PROPERTY_VALUE);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER, IStyleConstantsCSS.PROPERTY_VALUE);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION, IStyleConstantsCSS.PROPERTY_VALUE);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE, IStyleConstantsCSS.PROPERTY_VALUE);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_STRING, IStyleConstantsCSS.PROPERTY_VALUE);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_URI, IStyleConstantsCSS.PROPERTY_VALUE);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_HASH, IStyleConstantsCSS.PROPERTY_VALUE);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_UNICODE_RANGE, IStyleConstantsCSS.PROPERTY_VALUE);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT, IStyleConstantsCSS.PROPERTY_VALUE);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR, IStyleConstantsCSS.PROPERTY_VALUE);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_S, IStyleConstantsCSS.PROPERTY_VALUE);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_SEPARATOR, IStyleConstantsCSS.COLON);
-		contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
-
-		contextStyleMap.put(CSSRegionContexts.CSS_UNKNOWN, IStyleConstantsCSS.ERROR);
-	}
-
-	/**
-	 * 
-	 * @param descriptions
-	 *            java.util.Dictionary
-	 */
-	protected void initDescriptions(Dictionary descriptions) {
-		// create descriptions for hilighting types
-		descriptions.put(IStyleConstantsCSS.NORMAL, CSSUIMessages.PrefsLabel_ColorNormal);//$NON-NLS-1$
-		descriptions.put(IStyleConstantsCSS.ATMARK_RULE, CSSUIMessages.PrefsLabel_ColorAtmarkRule);//$NON-NLS-1$
-		descriptions.put(IStyleConstantsCSS.SELECTOR, CSSUIMessages.PrefsLabel_ColorSelector);//$NON-NLS-1$
-		descriptions.put(IStyleConstantsCSS.MEDIA, CSSUIMessages.PrefsLabel_ColorMedia);//$NON-NLS-1$
-		descriptions.put(IStyleConstantsCSS.COMMENT, CSSUIMessages.PrefsLabel_ColorComment);//$NON-NLS-1$
-		descriptions.put(IStyleConstantsCSS.PROPERTY_NAME, CSSUIMessages.PrefsLabel_ColorPropertyName);//$NON-NLS-1$
-		descriptions.put(IStyleConstantsCSS.PROPERTY_VALUE, CSSUIMessages.PrefsLabel_ColorPropertyValue);//$NON-NLS-1$
-		descriptions.put(IStyleConstantsCSS.URI, CSSUIMessages.PrefsLabel_ColorUri);//$NON-NLS-1$
-		descriptions.put(IStyleConstantsCSS.STRING, CSSUIMessages.PrefsLabel_ColorString);//$NON-NLS-1$
-		descriptions.put(IStyleConstantsCSS.COLON, CSSUIMessages.PrefsLabel_ColorColon);//$NON-NLS-1$
-		descriptions.put(IStyleConstantsCSS.SEMI_COLON, CSSUIMessages.PrefsLabel_ColorSemiColon);//$NON-NLS-1$
-		descriptions.put(IStyleConstantsCSS.CURLY_BRACE, CSSUIMessages.PrefsLabel_ColorCurlyBrace);//$NON-NLS-1$
-		descriptions.put(IStyleConstantsCSS.ERROR, CSSUIMessages.PrefsLabel_ColorError);//$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 * @param list
-	 *            java.util.ArrayList
-	 */
-	protected void initStyleList(ArrayList list) {
-		list.add(IStyleConstantsCSS.NORMAL);
-		list.add(IStyleConstantsCSS.ATMARK_RULE);
-		list.add(IStyleConstantsCSS.SELECTOR);
-		list.add(IStyleConstantsCSS.MEDIA);
-		list.add(IStyleConstantsCSS.COMMENT);
-		list.add(IStyleConstantsCSS.PROPERTY_NAME);
-		list.add(IStyleConstantsCSS.PROPERTY_VALUE);
-		list.add(IStyleConstantsCSS.URI);
-		list.add(IStyleConstantsCSS.STRING);
-		list.add(IStyleConstantsCSS.COLON);
-		list.add(IStyleConstantsCSS.SEMI_COLON);
-		list.add(IStyleConstantsCSS.CURLY_BRACE);
-		list.add(IStyleConstantsCSS.ERROR);
-	}
-
-	/**
-	 * setupPicker method comment.
-	 */
-	protected void setupPicker(StyledTextColorPicker picker) {
-		IModelManager mmanager = StructuredModelManager.getModelManager();
-		picker.setParser(mmanager.createStructuredDocumentFor(ContentTypeIdForCSS.ContentTypeID_CSS).getParser());
-
-		Dictionary descriptions = new Hashtable();
-		initDescriptions(descriptions);
-
-		Dictionary contextStyleMap = new Hashtable();
-		initContextStyleMap(contextStyleMap);
-
-		ArrayList styleList = new ArrayList();
-		initStyleList(styleList);
-
-		picker.setContextStyleMap(contextStyleMap);
-		picker.setDescriptions(descriptions);
-		picker.setStyleList(styleList);
-	}
-
-	protected IPreferenceStore doGetPreferenceStore() {
-		return CSSUIPlugin.getDefault().getPreferenceStore();
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractColorPage#savePreferences()
-	 */
-	protected void savePreferences() {
-		CSSUIPlugin.getDefault().savePluginPreferences();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSFilesPreferencePage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSFilesPreferencePage.java
deleted file mode 100644
index 36f3e38..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSFilesPreferencePage.java
+++ /dev/null
@@ -1,39 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Preferences;
-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.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage;
-
-public class CSSFilesPreferencePage extends XMLFilesPreferencePage {
-	protected IPreferenceStore doGetPreferenceStore() {
-		return CSSUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	protected void doSavePreferenceStore() {
-		CSSCorePlugin.getDefault().savePluginPreferences(); // model
-	}
-
-	protected Preferences getModelPreferences() {
-		return CSSCorePlugin.getDefault().getPluginPreferences();
-	}
-
-	protected Control createContents(Composite parent) {
-		Control c = super.createContents(parent);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.CSS_PREFWEBX_FILES_HELPID);
-		return c;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSourcePreferencePage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSourcePreferencePage.java
deleted file mode 100644
index 8cab22b..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSourcePreferencePage.java
+++ /dev/null
@@ -1,266 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
-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.Spinner;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-
-/**
- */
-public class CSSSourcePreferencePage extends AbstractPreferencePage {
-	// Content Assist
-	protected Button fAutoPropose;
-	protected Label fAutoProposeLabel;
-
-	protected Text fAutoProposeText;
-	protected Button fClearAllBlankLines;
-	protected Button fIdentLower;
-	// case of output character
-	// case of identifier
-	protected Button fIdentUpper;
-	private Spinner fIndentationSize;
-	private Button fIndentUsingSpaces;
-	
-	private Button fIndentUsingTabs;
-	// Formatting
-	protected Label fLineWidthLabel;
-	
-	protected Text fLineWidthText;
-	// prohibit wrapping if style attribute
-	protected Button fNowrapAttr;
-	// one property per one line
-	protected Button fPropertyPerLine;
-	protected Button fPropNameLower;
-
-	// case of property name
-	protected Button fPropNameUpper;
-	protected Button fPropValueLower;
-	// case of property value
-	protected Button fPropValueUpper;
-	protected Button fSplitMultiAttrs;
-	private final int MAX_INDENTATION_SIZE = 16;
-	private final int MIN_INDENTATION_SIZE = 0;
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
-	 */
-	protected Control createContents(Composite parent) {
-		Composite composite = (Composite) super.createContents(parent);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.CSS_PREFWEBX_SOURCE_HELPID);
-
-		createContentsForFormattingGroup(composite);
-		createContentsForContentAssistGroup(composite);
-		setSize(composite);
-		loadPreferences();
-
-		return composite;
-	}
-
-	private void createContentsForContentAssistGroup(Composite parent) {
-		// not content assist, but preferred case
-		Group caseGroup = createGroup(parent, 3);
-		caseGroup.setText(CSSUIMessages.PrefsLabel_CaseGroup);
-
-		// use group for radio buttons so that associated label is read
-		Group identGroup = createGroup(caseGroup, 1);
-		identGroup.setText(CSSUIMessages.PrefsLabel_CaseIdent);
-		fIdentUpper = createRadioButton(identGroup, CSSUIMessages.PrefsLabel_CaseIdentUpper);
-		fIdentLower = createRadioButton(identGroup, CSSUIMessages.PrefsLabel_CaseIdentLower);
-
-		// use group for radio buttons so that associated label is read
-		Group propNameGroup = createGroup(caseGroup, 1);
-		propNameGroup.setText(CSSUIMessages.PrefsLabel_CasePropName);
-		fPropNameUpper = createRadioButton(propNameGroup, CSSUIMessages.PrefsLabel_CasePropNameUpper);
-		fPropNameLower = createRadioButton(propNameGroup, CSSUIMessages.PrefsLabel_CasePropNameLower);
-
-		// use group for radio buttons so that associated label is read
-		Group propValueGroup = createGroup(caseGroup, 1);
-		propValueGroup.setText(CSSUIMessages.PrefsLabel_CasePropValue);
-		fPropValueUpper = createRadioButton(propValueGroup, CSSUIMessages.PrefsLabel_CasePropValueUpper);
-		fPropValueLower = createRadioButton(propValueGroup, CSSUIMessages.PrefsLabel_CasePropValueLower);
-	}
-
-	private void createContentsForFormattingGroup(Composite parent) {
-		Group formattingGroup = createGroup(parent, 2);
-		formattingGroup.setText(CSSUIMessages.Formatting_UI_);
-
-		fLineWidthLabel = createLabel(formattingGroup, CSSUIMessages.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);
-
-		fPropertyPerLine = createCheckBox(formattingGroup, CSSUIMessages.PrefsLabel_WrappingInsertLineBreak);
-		((GridData) fPropertyPerLine.getLayoutData()).horizontalSpan = 2;
-
-		fNowrapAttr = createCheckBox(formattingGroup, CSSUIMessages.PrefsLabel_WrappingWithoutAttr);
-		((GridData) fNowrapAttr.getLayoutData()).horizontalSpan = 2;
-		
-		fIndentUsingTabs = createRadioButton(formattingGroup, CSSUIMessages.Indent_using_tabs_);
-		((GridData) fIndentUsingTabs.getLayoutData()).horizontalSpan = 2;
-		fIndentUsingSpaces = createRadioButton(formattingGroup, CSSUIMessages.Indent_using_spaces);
-		((GridData) fIndentUsingSpaces.getLayoutData()).horizontalSpan = 2;
-		
-		createLabel(formattingGroup, CSSUIMessages.Indentation_size);
-		fIndentationSize = new Spinner(formattingGroup, SWT.READ_ONLY | SWT.BORDER);
-		GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
-		fIndentationSize.setLayoutData(gd);
-		fIndentationSize.setToolTipText(CSSUIMessages.Indentation_size_tip);
-		fIndentationSize.setMinimum(MIN_INDENTATION_SIZE);
-		fIndentationSize.setMaximum(MAX_INDENTATION_SIZE);
-		fIndentationSize.setIncrement(1);
-		fIndentationSize.setPageIncrement(4);
-		fIndentationSize.addModifyListener(this);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
-	 */
-	protected IPreferenceStore doGetPreferenceStore() {
-		return CSSUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	private void doSavePreferenceStore() {
-		CSSUIPlugin.getDefault().savePluginPreferences();
-		CSSCorePlugin.getDefault().savePluginPreferences(); // model
-	}
-	
-	protected Preferences getModelPreferences() {
-		return CSSCorePlugin.getDefault().getPluginPreferences();
-	}
-
-	protected void initializeValues() {
-		initializeValuesForFormattingGroup();
-		initializeValuesForContentAssistGroup();
-	}
-	
-	private void initializeValuesForContentAssistGroup() {
-		// not content assist, but preferred case
-		Preferences prefs = getModelPreferences();
-		fIdentUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER);
-		fIdentLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.LOWER);
-		fPropNameUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER);
-		fPropNameLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.LOWER);
-		fPropValueUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER);
-		fPropValueLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.LOWER);
-	}
-
-	private void initializeValuesForFormattingGroup() {
-		// Formatting
-		Preferences prefs = getModelPreferences();
-		fLineWidthText.setText(prefs.getString(CSSCorePreferenceNames.LINE_WIDTH));
-		fPropertyPerLine.setSelection(prefs.getBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE));
-		fNowrapAttr.setSelection(prefs.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR));
-		
-		if (CSSCorePreferenceNames.TAB.equals(getModelPreferences().getString(CSSCorePreferenceNames.INDENTATION_CHAR))) {
-			fIndentUsingTabs.setSelection(true);
-			fIndentUsingSpaces.setSelection(false);
-		} else {
-			fIndentUsingSpaces.setSelection(true);
-			fIndentUsingTabs.setSelection(false);
-		}
-			
-		fIndentationSize.setSelection(getModelPreferences().getInt(CSSCorePreferenceNames.INDENTATION_SIZE));
-	}
-	
-	protected void performDefaults() {
-		performDefaultsForFormattingGroup();
-		performDefaultsForContentAssistGroup();
-
-		validateValues();
-		enableValues();
-
-		super.performDefaults();
-	}
-	
-	private void performDefaultsForContentAssistGroup() {
-		// not content assist, but preferred case
-		Preferences prefs = getModelPreferences();
-		fIdentUpper.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER);
-		fIdentLower.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.LOWER);
-		fPropNameUpper.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER);
-		fPropNameLower.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.LOWER);
-		fPropValueUpper.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER);
-		fPropValueLower.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.LOWER);
-	}
-
-	private void performDefaultsForFormattingGroup() {
-		// Formatting
-		Preferences prefs = getModelPreferences();
-		fLineWidthText.setText(prefs.getDefaultString(CSSCorePreferenceNames.LINE_WIDTH));
-		fPropertyPerLine.setSelection(prefs.getDefaultBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE));
-		fNowrapAttr.setSelection(prefs.getDefaultBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR));
-		
-		if (CSSCorePreferenceNames.TAB.equals(getModelPreferences().getDefaultString(CSSCorePreferenceNames.INDENTATION_CHAR))) {
-			fIndentUsingTabs.setSelection(true);
-			fIndentUsingSpaces.setSelection(false);
-		} else {
-			fIndentUsingSpaces.setSelection(true);
-			fIndentUsingTabs.setSelection(false);
-		}		
-		fIndentationSize.setSelection(getModelPreferences().getDefaultInt(CSSCorePreferenceNames.INDENTATION_SIZE));
-	}
-
-	public boolean performOk() {
-		boolean result = super.performOk();
-
-		doSavePreferenceStore();
-
-		return result;
-	}
-
-	protected void storeValues() {
-		storeValuesForFormattingGroup();
-		storeValuesForContentAssistGroup();
-	}
-
-	private void storeValuesForContentAssistGroup() {
-		// not content assist, but preferred case
-		Preferences prefs = getModelPreferences();
-		prefs.setValue(CSSCorePreferenceNames.CASE_IDENTIFIER, (fIdentUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
-		prefs.setValue(CSSCorePreferenceNames.CASE_PROPERTY_NAME, (fPropNameUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
-		prefs.setValue(CSSCorePreferenceNames.CASE_PROPERTY_VALUE, (fPropValueUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
-	}
-	private void storeValuesForFormattingGroup() {
-		// Formatting
-		Preferences prefs = getModelPreferences();
-		prefs.setValue(CSSCorePreferenceNames.LINE_WIDTH, fLineWidthText.getText());
-		prefs.setValue(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE, fPropertyPerLine.getSelection());
-		prefs.setValue(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR, fNowrapAttr.getSelection());
-		
-		if (fIndentUsingTabs.getSelection()) {
-			getModelPreferences().setValue(CSSCorePreferenceNames.INDENTATION_CHAR, CSSCorePreferenceNames.TAB);
-		} else {
-			getModelPreferences().setValue(CSSCorePreferenceNames.INDENTATION_CHAR, CSSCorePreferenceNames.SPACE);
-		}
-		getModelPreferences().setValue(CSSCorePreferenceNames.INDENTATION_SIZE, fIndentationSize.getSelection());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSTemplatePreferencePage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSTemplatePreferencePage.java
deleted file mode 100644
index 138e203..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSTemplatePreferencePage.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.preferences.ui;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-
-/**
- * Preference page for CSS templates
- */
-public class CSSTemplatePreferencePage extends TemplatePreferencePage {
-	
-	public CSSTemplatePreferencePage() {
-		CSSUIPlugin cssUIPlugin = CSSUIPlugin.getDefault();
-		
-		setPreferenceStore(cssUIPlugin.getPreferenceStore());
-		setTemplateStore(cssUIPlugin.getTemplateStore());
-		setContextTypeRegistry(cssUIPlugin.getTemplateContextRegistry());
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.preference.IPreferencePage#performOk()
-	 */
-	public boolean performOk() {
-  	  boolean ok = super.performOk();
-  	  CSSUIPlugin.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.CSS_PREFWEBX_TEMPLATES_HELPID);
-		return c;
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterCSS.java
deleted file mode 100644
index 19566d9..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterCSS.java
+++ /dev/null
@@ -1,278 +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.css.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.ui.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.IndexedRegion;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterCSS implements INodeAdapter {
-
-	private class TagProjectionAnnotation extends ProjectionAnnotation {
-		private boolean fIsVisible = false; /* workaround for BUG85874 */
-		private ICSSNode fNode;
-
-		public TagProjectionAnnotation(ICSSNode node, boolean isCollapsed) {
-			super(isCollapsed);
-			fNode = node;
-		}
-
-		public ICSSNode getNode() {
-			return fNode;
-		}
-
-		public void setNode(ICSSNode node) {
-			fNode = node;
-		}
-		/**
-		 * Does not paint hidden annotations. Annotations are hidden when they
-		 * only span one line.
-		 * 
-		 * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC,
-		 *      org.eclipse.swt.widgets.Canvas,
-		 *      org.eclipse.swt.graphics.Rectangle)
-		 */
-		public void paint(GC gc, Canvas canvas, Rectangle rectangle) {
-			/* workaround for BUG85874 */
-			/*
-			 * only need to check annotations that are expanded because hidden
-			 * annotations should never have been given the chance to
-			 * collapse.
-			 */
-			if (!isCollapsed()) {
-				// working with rectangle, so need the styledtext line height
-				int lineHeight = fAdapterFactory.getProjectionViewer().getTextWidget().getLineHeight();
-
-				// do not draw annotations that only span one line and mark
-				// them as not visible
-				if ((rectangle.height / lineHeight) <= 1) {
-					fIsVisible = false;
-					return;
-				}
-			}
-			fIsVisible = true;
-			super.paint(gc, canvas, rectangle);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.text.source.projection.ProjectionAnnotation#markCollapsed()
-		 */
-		public void markCollapsed() {
-			/* workaround for BUG85874 */
-			// do not mark collapsed if annotation is not visible
-			if (fIsVisible)
-				super.markCollapsed();
-		}
-	}
-
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.css.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$\
-
-	ProjectionModelNodeAdapterFactoryCSS fAdapterFactory;
-	private Map fTagAnnotations = new HashMap();
-
-	public ProjectionModelNodeAdapterCSS(ProjectionModelNodeAdapterFactoryCSS factory) {
-		fAdapterFactory = factory;
-	}
-
-	/**
-	 * Create a projection position from the given node. Able to get
-	 * projection position if node isNodeProjectable.
-	 * 
-	 * @param node
-	 * @return null if no projection position possible, a Position otherwise
-	 */
-	private Position createProjectionPosition(ICSSNode node) {
-		Position pos = null;
-		if (isNodeProjectable(node) && node instanceof IndexedRegion) {
-			IDocument document = fAdapterFactory.getProjectionViewer().getDocument();
-			if (document != null) {
-				IndexedRegion inode = (IndexedRegion) node;
-				int start = inode.getStartOffset();
-				int end = inode.getEndOffset();
-				if (start >= 0 && start < end) {
-					try {
-//						// region-based
-//						// extra line when collapsed, but no region increase when add newline
-//						pos = new Position(start, end - start);
-						
-//						// line-based
-//						// extra line when collapsed, but no region increase when add newline
-//						IRegion startLineRegion = document.getLineInformationOfOffset(start);
-//						IRegion endLineRegion = document.getLineInformationOfOffset(end);
-//						int startOffset = startLineRegion.getOffset();
-//						int endOffset = endLineRegion.getOffset() + endLineRegion.getLength();
-//						if (endOffset > startOffset) {
-//							pos = new Position(startOffset, endOffset - startOffset);
-//						}
-						
-						// line-based
-						// no extra line when collapsed, but region increase when add newline
-						int startLine = document.getLineOfOffset(start);
-						int endLine = document.getLineOfOffset(end);
-						if (endLine + 1 < document.getNumberOfLines()) {
-							int offset = document.getLineOffset(startLine);
-							int endOffset = document.getLineOffset(endLine + 1);
-							pos = new Position(offset, endOffset - offset);
-						}
-					} catch (BadLocationException x) {
-						Logger.log(Logger.WARNING_DEBUG, null, x);
-					}
-				}
-			}
-		}
-		return pos;
-	}
-
-	/**
-	 * Find TagProjectionAnnotation for node in the current list of projection
-	 * annotations for this adapter
-	 * 
-	 * @param node
-	 * @return TagProjectionAnnotation
-	 */
-	private TagProjectionAnnotation getExistingAnnotation(ICSSNode node) {
-		TagProjectionAnnotation anno = null;
-
-		if ((node != null) && (!fTagAnnotations.isEmpty())) {
-			Iterator it = fTagAnnotations.keySet().iterator();
-			while (it.hasNext() && anno == null) {
-				TagProjectionAnnotation a = (TagProjectionAnnotation) it.next();
-				ICSSNode n = a.getNode();
-				if (node.equals(n)) {
-					anno = a;
-				}
-			}
-		}
-		return anno;
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return type == ProjectionModelNodeAdapterCSS.class;
-	}
-
-	/**
-	 * Returns true if node is a node type able to fold
-	 * 
-	 * @param node
-	 * @return boolean true if node is projectable, false otherwise
-	 */
-	private boolean isNodeProjectable(ICSSNode node) {
-		if (node != null) {
-			short type = node.getNodeType();
-			if (type == ICSSNode.STYLERULE_NODE || type == ICSSNode.PAGERULE_NODE || type == ICSSNode.MEDIARULE_NODE || type == ICSSNode.IMPORTRULE_NODE || type == ICSSNode.FONTFACERULE_NODE || type == ICSSNode.CHARSETRULE_NODE)
-				return true;
-		}
-		return false;
-	}
-
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		// check if folding is even enabled, if not, just ignore notifyChanged
-		// events
-		if (fAdapterFactory.getProjectionViewer() == null) {
-			return;
-		}
-
-		// workaround for Bug85342 - STRUCTRE_CHANGED is never fired so need
-		// to listen for every ADD, REMOVE
-		// if ((eventType == INodeNotifier.STRUCTURE_CHANGED) && (notifier
-		// instanceof ICSSNode)) {
-		if ((eventType == INodeNotifier.ADD || eventType == INodeNotifier.REMOVE) && (notifier instanceof ICSSNode)) {
-			updateAdapter((ICSSNode) notifier);
-		}
-	}
-
-	/**
-	 * Update the projection annotation of all the nodes that are children of
-	 * node
-	 * 
-	 * @param node
-	 */
-	void updateAdapter(ICSSNode node) {
-		long start = System.currentTimeMillis();
-
-		Map additions = new HashMap();
-		Map projectionAnnotations = new HashMap();
-
-		// go through immediate child nodes and figure out projection
-		// model annotations
-		if (node != null) {
-			ICSSNode childNode = node.getFirstChild();
-			while (childNode != null) {
-				Position newPos = createProjectionPosition(childNode);
-				if (newPos != null) {
-					TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(childNode, false);
-					TagProjectionAnnotation existing = getExistingAnnotation(childNode);
-					if (existing == null) {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(newAnnotation, newPos);
-						// add to map containing annotations to add
-						additions.put(newAnnotation, newPos);
-					} else {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(existing, newPos);
-						// remove from map containing annotations to delete
-						fTagAnnotations.remove(existing);
-					}
-				}
-				childNode = childNode.getNextSibling();
-			}
-
-			// in the end, want to delete anything leftover in old list, add
-			// everything in additions, and update everything in
-			// projectionAnnotations
-			ProjectionAnnotation[] oldList = null;
-			if (!fTagAnnotations.isEmpty()) {
-				oldList = (ProjectionAnnotation[]) fTagAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-			ProjectionAnnotation[] modifyList = null;
-			if (!projectionAnnotations.isEmpty()) {
-				modifyList = (ProjectionAnnotation[]) projectionAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-			ProjectionViewer viewer = fAdapterFactory.getProjectionViewer();
-			ProjectionAnnotationModel annotationModel = viewer.getProjectionAnnotationModel();
-			annotationModel.modifyAnnotations(oldList, additions, modifyList);
-		}
-
-		// save new list of annotations
-		fTagAnnotations = additions;
-
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf) {
-			String nodeName = node != null ? node.toString() : "null"; //$NON-NLS-1$
-			System.out.println("ProjectionModelNodeAdapterCSS.updateAdapter (" + nodeName + "):" + (end - start)); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterFactoryCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterFactoryCSS.java
deleted file mode 100644
index e872402..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterFactoryCSS.java
+++ /dev/null
@@ -1,69 +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.css.ui.internal.projection;
-
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-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.INodeNotifier;
-
-public class ProjectionModelNodeAdapterFactoryCSS extends AbstractAdapterFactory {
-	private ProjectionViewer fProjectionViewer;
-
-	public ProjectionModelNodeAdapterFactoryCSS() {
-		this(ProjectionModelNodeAdapterCSS.class);
-	}
-
-	public ProjectionModelNodeAdapterFactoryCSS(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-	public ProjectionModelNodeAdapterFactoryCSS(Object adapterKey) {
-		super(adapterKey);
-	}
-
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		ProjectionModelNodeAdapterCSS adapter = null;
-
-		if ((fProjectionViewer != null) && (target instanceof ICSSNode)) {
-			ICSSNode node = (ICSSNode) target;
-			short type = node.getNodeType();
-			// only add for top stylesheet node
-			if (type == ICSSNode.STYLESHEET_NODE) {
-				adapter = new ProjectionModelNodeAdapterCSS(this);
-				adapter.updateAdapter(node);
-			}
-		}
-
-		return adapter;
-	}
-
-	ProjectionViewer getProjectionViewer() {
-		return fProjectionViewer;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.AbstractAdapterFactory#release()
-	 */
-	public void release() {
-		fProjectionViewer = null;
-
-		super.release();
-	}
-
-	void setProjectionViewer(ProjectionViewer viewer) {
-		fProjectionViewer = viewer;
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/StructuredTextFoldingProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/StructuredTextFoldingProviderCSS.java
deleted file mode 100644
index 22e5551..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/StructuredTextFoldingProviderCSS.java
+++ /dev/null
@@ -1,167 +0,0 @@
-package org.eclipse.wst.css.ui.internal.projection;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-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.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-
-/**
- * Updates the projection model of a structured model for CSS.
- */
-public class StructuredTextFoldingProviderCSS implements IStructuredTextFoldingProvider, IProjectionListener {
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.css.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$\
-
-	private IDocument fDocument;
-	private ProjectionViewer fViewer;
-
-	/**
-	 * Just add adapter to top stylesheet node. This adapter will track
-	 * children addition/deletion.
-	 */
-	private void addAllAdapters() {
-		long start = System.currentTimeMillis();
-
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-			if (sModel instanceof ICSSModel) {
-				ICSSModel cssModel = (ICSSModel) sModel;
-				ICSSDocument cssDoc = cssModel.getDocument();
-				if (cssDoc instanceof INodeNotifier) {
-					INodeNotifier notifier = (INodeNotifier) cssDoc;
-					ProjectionModelNodeAdapterCSS adapter = (ProjectionModelNodeAdapterCSS) notifier.getExistingAdapter(ProjectionModelNodeAdapterCSS.class);
-					if (adapter != null) {
-						adapter.updateAdapter(cssDoc);
-					}
-					else {
-						// just call getadapter so the adapter is created and
-						// automatically initialized
-						notifier.getAdapterFor(ProjectionModelNodeAdapterCSS.class);
-					}
-				}
-			}
-		}
-		finally {
-			if (sModel != null) {
-				sModel.releaseFromRead();
-			}
-		}
-
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf)
-			System.out.println("StructuredTextFoldingProviderCSS.addAllAdapters: " + (end - start)); //$NON-NLS-1$
-	}
-
-	/**
-	 * Get the ProjectionModelNodeAdapterFactoryCSS to use with this provider.
-	 * 
-	 * @return ProjectionModelNodeAdapterFactoryCSS
-	 */
-	private ProjectionModelNodeAdapterFactoryCSS getAdapterFactory(boolean createIfNeeded) {
-		ProjectionModelNodeAdapterFactoryCSS factory = null;
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-			if (sModel != null) {
-				FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
-				// getting the projectionmodelnodeadapter for the first time
-				// so do some initializing
-				if (!factoryRegistry.contains(ProjectionModelNodeAdapterCSS.class) && createIfNeeded) {
-					ProjectionModelNodeAdapterFactoryCSS newFactory = new ProjectionModelNodeAdapterFactoryCSS();
-
-					// add factory to factory registry
-					factoryRegistry.addFactory(newFactory);
-				}
-
-				// try and get the factory
-				factory = (ProjectionModelNodeAdapterFactoryCSS) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterCSS.class);
-			}
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-		return factory;
-	}
-
-	/**
-	 * Initialize this provider with the correct document. Assumes projection
-	 * is enabled. (otherwise, only install would have been called)
-	 */
-	public void initialize() {
-		if (!isInstalled())
-			return;
-
-		// set projection viewer to null on old document's adapter factory
-		ProjectionModelNodeAdapterFactoryCSS factory = getAdapterFactory(false);
-		if (factory != null) {
-			factory.setProjectionViewer(null);
-		}
-
-		// clear out all annotations
-		if (fViewer.getProjectionAnnotationModel() != null)
-			fViewer.getProjectionAnnotationModel().removeAllAnnotations();
-		fDocument = fViewer.getDocument();
-
-		if (fDocument != null) {
-			// set projection viewer on new document's adapter factory
-			factory = getAdapterFactory(true);
-			if (factory != null) {
-				factory.setProjectionViewer(fViewer);
-			}
-
-			addAllAdapters();
-		}
-	}
-
-	/**
-	 * Associate a ProjectionViewer with this IStructuredTextFoldingProvider
-	 * 
-	 * @param viewer
-	 */
-	public void install(ProjectionViewer viewer) {
-		// uninstall before trying to install new viewer
-		if (isInstalled()) {
-			uninstall();
-		}
-		fViewer = viewer;
-		fViewer.addProjectionListener(this);
-	}
-
-	private boolean isInstalled() {
-		return fViewer != null;
-	}
-
-	public void projectionDisabled() {
-		ProjectionModelNodeAdapterFactoryCSS factory = getAdapterFactory(false);
-		if (factory != null) {
-			factory.setProjectionViewer(null);
-		}
-
-		fDocument = null;
-	}
-
-	public void projectionEnabled() {
-		initialize();
-	}
-
-	/**
-	 * Disconnect this IStructuredTextFoldingProvider from projection viewer
-	 */
-	public void uninstall() {
-		if (isInstalled()) {
-			projectionDisabled();
-
-			fViewer.removeProjectionListener(this);
-			fViewer = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSPropertySource.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSPropertySource.java
deleted file mode 100644
index 55fe3c2..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSPropertySource.java
+++ /dev/null
@@ -1,338 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMCategory;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelFinder;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelUtil;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNodeList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- * A IPropertySource implementation for a JFace viewer used to display
- * properties of CSS nodes.
- */
-public class CSSPropertySource implements IPropertySource {
-	protected ICSSNode fNode = null;
-	// for performance...
-	final static Class ADAPTER_KEY = IPropertySource.class;
-	final boolean PERF_GETDESCRIPTORS = false;
-	private long time0;
-
-	public CSSPropertySource(ICSSNode target) {
-		super();
-		fNode =  target;
-	}
-
-	protected IPropertyDescriptor createDefaultPropertyDescriptor(String attributeName) {
-		// the displayName MUST be set
-		IPropertyDescriptor descriptor = new CSSTextPropertyDescriptor(attributeName, attributeName, fNode);
-		// IPropertyDescriptor descriptor = new
-		// TextPropertyDescriptor(attributeName, attributeName);
-		return descriptor;
-	}
-
-	protected IPropertyDescriptor createPropertyDescriptor(CSSMMNode node, String category) {
-		return createPropertyDescriptor(node.getName(), category);
-	}
-
-	protected IPropertyDescriptor createPropertyDescriptor(String name, String category) {
-		IPropertyDescriptor descriptor = null;
-		if (name != null && 0 < name.length()) {
-			name = name.toLowerCase();
-			if (category == null) {
-				category = CSSUIMessages.INFO_Not_Categorized_1; //$NON-NLS-1$
-			}
-			descriptor = new CSSTextPropertyDescriptor(name, name, fNode, category);
-			// if (category == null) {
-			// descriptor = new CSSTextPropertyDescriptor(name, name, fNode);
-			// } else {
-			// descriptor = new CSSTextPropertyDescriptor(name, name, fNode,
-			// category);
-			// }
-		}
-		return descriptor;
-	}
-
-	/**
-	 * Returns a value for this object that can be editted in a property
-	 * sheet.
-	 * 
-	 * @return a value that can be editted
-	 */
-	public Object getEditableValue() {
-		return null;
-	}
-
-	/**
-	 * Returns the current collection of property descriptors.
-	 * 
-	 * @return a vector containing all descriptors.
-	 */
-	public IPropertyDescriptor[] getPropertyDescriptors() {
-		time0 = System.currentTimeMillis();
-
-		CSSMetaModel metamodel = CSSMetaModelFinder.getInstance().findMetaModelFor(fNode);
-		Iterator iProperties = Collections.EMPTY_LIST.iterator();
-		switch (fNode.getNodeType()) {
-			case ICSSNode.STYLERULE_NODE :
-			case ICSSNode.FONTFACERULE_NODE :
-			case ICSSNode.PAGERULE_NODE :
-			case ICSSNode.STYLEDECLARATION_NODE :
-				CSSMMNode mmParent = new CSSMetaModelUtil(metamodel).getMetaModelNodeFor(fNode);
-				if (mmParent != null) {
-					iProperties = mmParent.getChildNodes();
-				}
-				break;
-			case ICSSNode.STYLEDECLITEM_NODE :
-				CSSMMNode mmNode = new CSSMetaModelUtil(metamodel).getMetaModelNodeFor(fNode);
-				if (mmNode != null) {
-					iProperties = Collections.singletonList(mmNode).iterator();
-				}
-				break;
-			default :
-				break;
-		}
-
-		// setup categories
-		Map categories = new HashMap();
-		Iterator iCategories = metamodel.getCategories();
-		while (iCategories.hasNext()) {
-			CSSMMCategory category = (CSSMMCategory) iCategories.next();
-			categories.put(category.getName(), category.getCaption());
-		}
-
-		// collect property names
-		Set declaredProperties = new HashSet();
-		if (iProperties.hasNext()) {
-			CSSStyleDeclaration declaration = getDeclarationNode();
-			if (declaration != null) {
-				ICSSNodeList nodeList = ((ICSSNode) declaration).getChildNodes();
-				int nProps = (nodeList != null) ? nodeList.getLength() : 0;
-				for (int i = 0; i < nProps; i++) {
-					ICSSNode node = nodeList.item(i);
-					if (node instanceof ICSSStyleDeclItem) {
-						String name = ((ICSSStyleDeclItem) node).getPropertyName();
-						if (name != null && 0 < name.length()) {
-							declaredProperties.add(name.toLowerCase());
-						}
-					}
-				}
-			}
-		}
-
-		List descriptors = new ArrayList();
-
-		// first: properties from content model
-		while (iProperties.hasNext()) {
-			CSSMMNode node = (CSSMMNode) iProperties.next();
-			if (node.getType() == CSSMMNode.TYPE_PROPERTY || node.getType() == CSSMMNode.TYPE_DESCRIPTOR) {
-				String category = (String) categories.get(node.getAttribute("category")); //$NON-NLS-1$
-				String name = node.getName().toLowerCase();
-				if (declaredProperties.contains(name)) {
-					declaredProperties.remove(name);
-				}
-				IPropertyDescriptor descriptor = createPropertyDescriptor(name, category);
-				if (descriptor != null) {
-					descriptors.add(descriptor);
-				}
-			}
-		}
-
-		// second: existing properties but not in content model
-		Iterator iRemains = declaredProperties.iterator();
-		while (iRemains.hasNext()) {
-			IPropertyDescriptor descriptor = createPropertyDescriptor((String) iRemains.next(), null);
-			if (descriptor != null) {
-				descriptors.add(descriptor);
-			}
-		}
-
-		IPropertyDescriptor[] resultArray = new IPropertyDescriptor[descriptors.size()];
-		if (PERF_GETDESCRIPTORS) {
-			System.out.println(getClass().getName() + ".getPropertyDescriptors: " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		return (IPropertyDescriptor[]) descriptors.toArray(resultArray);
-	}
-
-	/**
-	 * Returns the current value for the named property.
-	 * 
-	 * @param name
-	 *            the name of the property as named by its property descriptor
-	 * @return the current value of the property
-	 */
-	public Object getPropertyValue(Object name) {
-		if (name == null) {
-			return ""; //$NON-NLS-1$
-		}
-
-		String valueString = null;
-		String nameString = name.toString();
-
-		CSSStyleDeclaration declaration = null;
-
-		switch (fNode.getNodeType()) {
-			case ICSSNode.STYLEDECLITEM_NODE :
-				valueString = ((ICSSStyleDeclItem) fNode).getCSSValueText();
-				break;
-			case ICSSNode.STYLERULE_NODE :
-			case ICSSNode.FONTFACERULE_NODE :
-			case ICSSNode.PAGERULE_NODE :
-				declaration = (CSSStyleDeclaration) fNode.getFirstChild();
-				if (declaration != null) {
-					valueString = declaration.getPropertyValue(nameString);
-				}
-				break;
-			case ICSSNode.STYLEDECLARATION_NODE :
-				valueString = ((CSSStyleDeclaration) fNode).getPropertyValue(nameString);
-				break;
-			case ICSSNode.PRIMITIVEVALUE_NODE :
-				ICSSNode parent = fNode;
-				while (parent != null && !(parent instanceof ICSSStyleDeclItem)) {
-					parent = parent.getParentNode();
-				}
-				if (parent != null) {
-					valueString = ((ICSSStyleDeclItem) parent).getCSSValueText();
-				}
-				break;
-			default :
-				break;
-		}
-
-		if (valueString == null) {
-			valueString = ""; //$NON-NLS-1$
-		}
-
-		return valueString;
-	}
-
-	/**
-	 * Returns whether the property value has changed from the default.
-	 * 
-	 * @return <code>true</code> if the value of the specified property has
-	 *         changed from its original default value; <code>false</code>
-	 *         otherwise.
-	 */
-	public boolean isPropertySet(Object property) {
-		if (property == null) {
-			return false;
-		}
-		CSSStyleDeclaration declaration = getDeclarationNode();
-		if (declaration != null) {
-			String value = declaration.getPropertyValue(property.toString());
-			if (value != null && 0 < value.length()) {
-				return true;
-			}
-		}
-
-		return false;
-	}
-
-	/**
-	 * Resets the specified property's value to its default value.
-	 * 
-	 * @param property
-	 *            the property to reset
-	 */
-	public void resetPropertyValue(Object str) {
-		if (str == null) {
-			return;
-		}
-		CSSStyleDeclaration declaration = getDeclarationNode();
-		if (declaration != null) {
-			declaration.removeProperty(str.toString());
-		}
-	}
-
-	/**
-	 * Sets the named property to the given value.
-	 * 
-	 * @param name
-	 *            the name of the property being set
-	 * @param value
-	 *            the new value for the property
-	 */
-	public void setPropertyValue(Object name, Object value) {
-		if (name == null) {
-			return;
-		}
-		String valueString = (value != null) ? value.toString() : null;
-		String nameString = name.toString();
-		CSSStyleDeclaration declaration = getDeclarationNode();
-		if (declaration != null) {
-			try {
-				if (valueString == null || valueString.length() <= 0) {
-					declaration.removeProperty(nameString);
-				}
-				else {
-					declaration.setProperty(nameString, valueString, ""); //$NON-NLS-1$
-				}
-			}
-			catch (Exception e) {
-				IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-				String title = CSSUIMessages.Title_InvalidValue; //$NON-NLS-1$
-				String message = CSSUIMessages.Message_InvalidValue; //$NON-NLS-1$
-				MessageDialog.openWarning(window.getShell(), title, message);
-			}
-		}
-	}
-
-	private CSSStyleDeclaration getDeclarationNode() {
-		CSSStyleDeclaration declaration = null;
-
-		switch (fNode.getNodeType()) {
-			case ICSSNode.STYLEDECLITEM_NODE :
-				declaration = (CSSStyleDeclaration) fNode.getParentNode();
-				break;
-			case ICSSNode.STYLERULE_NODE :
-			case ICSSNode.FONTFACERULE_NODE :
-			case ICSSNode.PAGERULE_NODE :
-				declaration = (CSSStyleDeclaration) fNode.getFirstChild();
-				break;
-			case ICSSNode.STYLEDECLARATION_NODE :
-				declaration = (CSSStyleDeclaration) fNode;
-				break;
-			case ICSSNode.PRIMITIVEVALUE_NODE :
-				ICSSNode parent = fNode;
-				while (parent != null && !(parent instanceof CSSStyleDeclaration)) {
-					parent = parent.getParentNode();
-				}
-				if (parent != null) {
-					declaration = (CSSStyleDeclaration) parent;
-				}
-				break;
-			default :
-				break;
-		}
-
-		return declaration;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSTextPropertyDescriptor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSTextPropertyDescriptor.java
deleted file mode 100644
index a0deb92..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSTextPropertyDescriptor.java
+++ /dev/null
@@ -1,112 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.properties;
-
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSPathService;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- */
-public class CSSTextPropertyDescriptor extends TextPropertyDescriptor {
-	private final ICSSNode fNode;
-
-	/**
-	 * CSSTextPropertyDescriptor constructor comment.
-	 * 
-	 * @param id
-	 *            java.lang.String
-	 * @param displayName
-	 *            java.lang.String
-	 */
-	public CSSTextPropertyDescriptor(String id, String displayName, ICSSNode node) {
-		super(id, displayName);
-		this.fNode = node;
-	}
-
-	public CSSTextPropertyDescriptor(String id, String displayName, ICSSNode node, String category) {
-		super(id, displayName);
-		this.fNode = node;
-		setCategory(category);
-	}
-
-	/**
-	 * @return org.eclipse.jface.viewers.CellEditor
-	 * @param parent
-	 *            org.eclipse.swt.widgets.Composite
-	 */
-	public CellEditor createPropertyEditor(Composite parent) {
-		ICSSModel model = fNode.getOwnerDocument().getModel();
-		if (model == null)
-			return null;
-		if (model.getStyleSheetType() == ICSSModel.EXTERNAL && findEditor(model) == null)
-			return null;
-		// check whether IFile is readonly to prohibit editing before
-		// validateEdit()
-		IStructuredModel structuredModel = model;
-		if (model.getStyleSheetType() != ICSSModel.EXTERNAL) {
-			structuredModel = ((IDOMNode) model.getOwnerDOMNode()).getModel();
-			if (structuredModel == null)
-				return null;
-		}
-		IFile file = CSSPathService.location2File(structuredModel.getBaseLocation());
-		if (file == null || file.isReadOnly())
-			return null;
-
-		return super.createPropertyEditor(parent);
-	}
-
-	private static IEditorPart findEditor(ICSSModel model) {
-		IWorkbench workbench = PlatformUI.getWorkbench();
-		IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
-		for (int i = 0; i < windows.length; i++) {
-			IWorkbenchPage[] pages = windows[i].getPages();
-			for (int j = 0; j < pages.length; j++) {
-				IEditorReference[] editors = pages[j].getEditorReferences();
-				for (int k = 0; k < editors.length; k++) {
-					IEditorPart editPart = editors[k].getEditor(false);
-					if (editPart != null) {
-						IEditorInput editorInput = editPart.getEditorInput();
-						if (editorInput instanceof IFileEditorInput) {
-							IFile file = ((IFileEditorInput) editorInput).getFile();
-							if (file != null) {
-								//TODO Urgent needs to be fixed
-								// I think we need 'equals' (or 'equivalent'
-								// on model) for cases like this
-								if (StructuredModelManager.getModelManager().calculateId(file).equals(model.getId())) {
-									return editPart;
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-		return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/registry/AdapterFactoryProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/registry/AdapterFactoryProviderCSS.java
deleted file mode 100644
index 2d108bf..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/registry/AdapterFactoryProviderCSS.java
+++ /dev/null
@@ -1,47 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.registry;
-
-import org.eclipse.wst.css.core.internal.modelhandler.ModelHandlerForCSS;
-import org.eclipse.wst.css.ui.internal.contentoutline.JFaceNodeAdapterFactoryCSS;
-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;
-
-public class AdapterFactoryProviderCSS implements AdapterFactoryProvider {
-	public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
-		return (contentTypeDescription instanceof ModelHandlerForCSS);
-	}
-
-	public void addAdapterFactories(IStructuredModel structuredModel) {
-		// add the normal content based factories to model's registry
-		addContentBasedFactories(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 JFaceNodeAdapterFactoryCSS(IJFaceNodeAdapter.class, true);
-			factoryRegistry.addFactory(factory);
-		}
-	}
-
-	public void reinitializeFactories(IStructuredModel structuredModel) {
-
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectEnclosingCSSActionDelegate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectEnclosingCSSActionDelegate.java
deleted file mode 100644
index fa1a720..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectEnclosingCSSActionDelegate.java
+++ /dev/null
@@ -1,64 +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.css.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.selection.StructuredSelectActionDelegate;
-
-/**
- * Selects enclosing CSS element
- */
-public class StructuredSelectEnclosingCSSActionDelegate extends StructuredSelectActionDelegate {
-	public void init(IAction action) {
-		if (action != null) {
-			action.setText(CSSUIMessages.StructureSelectEnclosing_label);
-			action.setToolTipText(CSSUIMessages.StructureSelectEnclosing_tooltip);
-			action.setDescription(CSSUIMessages.StructureSelectEnclosing_description);
-		}
-	}
-
-	protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
-		IndexedRegion indexedRegion = null;
-
-		indexedRegion = getIndexedRegion(document, textSelection.getOffset());
-
-		return indexedRegion;
-	}
-
-	protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
-		Region newRegion = null;
-		if (indexedRegion instanceof ICSSNode) {
-			ICSSNode cursorNode = (ICSSNode) indexedRegion;
-			Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
-			int currentOffset = textSelection.getOffset();
-			int currentEndOffset = currentOffset + textSelection.getLength();
-			if (cursorNodeRegion.getOffset() >= currentOffset && cursorNodeRegion.getOffset() <= currentEndOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset) {
-				ICSSNode newNode = cursorNode.getParentNode();
-
-				if (newNode instanceof IndexedRegion) {
-					IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
-					newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
-				}
-			}
-			else
-				newRegion = cursorNodeRegion;
-		}
-		return newRegion;
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectNextCSSActionDelegate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectNextCSSActionDelegate.java
deleted file mode 100644
index de122ab..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectNextCSSActionDelegate.java
+++ /dev/null
@@ -1,81 +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.css.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.selection.StructuredSelectActionDelegate;
-
-/**
- * Selects next CSS element
- */
-public class StructuredSelectNextCSSActionDelegate extends StructuredSelectActionDelegate {
-
-	protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
-		int offset = textSelection.getOffset() + textSelection.getLength() - 1;
-		if (offset < 0)
-			offset = 0;
-
-		IndexedRegion indexedRegion = null;
-
-		indexedRegion = getIndexedRegion(document, offset);
-
-		return indexedRegion;
-	}
-
-	protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
-		Region newRegion = null;
-
-		if (indexedRegion instanceof ICSSNode) {
-			ICSSNode cursorNode = (ICSSNode) indexedRegion;
-
-			Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
-			int currentOffset = textSelection.getOffset();
-			int currentEndOffset = currentOffset + textSelection.getLength();
-			if (cursorNodeRegion.getOffset() >= currentOffset && cursorNodeRegion.getOffset() <= currentEndOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset) {
-				ICSSNode newNode = cursorNode.getNextSibling();
-				if (newNode == null) {
-					newNode = cursorNode.getParentNode();
-
-					if (newNode instanceof IndexedRegion) {
-						IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
-						newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
-					}
-				}
-				else {
-					if (newNode instanceof IndexedRegion) {
-						IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
-						newRegion = new Region(currentOffset, newIndexedRegion.getEndOffset() - currentOffset);
-					}
-				}
-			}
-			else
-				newRegion = cursorNodeRegion;
-		}
-		return newRegion;
-	}
-
-	public void init(IAction action) {
-		if (action != null) {
-			action.setText(CSSUIMessages.StructureSelectNext_label);
-			action.setToolTipText(CSSUIMessages.StructureSelectNext_tooltip);
-			action.setDescription(CSSUIMessages.StructureSelectNext_description);
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectPreviousCSSActionDelegate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectPreviousCSSActionDelegate.java
deleted file mode 100644
index 78289a2..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectPreviousCSSActionDelegate.java
+++ /dev/null
@@ -1,76 +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.css.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.selection.StructuredSelectActionDelegate;
-
-/**
- * Selects previous CSS element
- */
-public class StructuredSelectPreviousCSSActionDelegate extends StructuredSelectActionDelegate {
-
-	protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
-		IndexedRegion indexedRegion = null;
-
-		indexedRegion = getIndexedRegion(document, textSelection.getOffset());
-
-		return indexedRegion;
-	}
-
-	protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
-		Region newRegion = null;
-		if (indexedRegion instanceof ICSSNode) {
-			ICSSNode cursorNode = (ICSSNode) indexedRegion;
-
-			Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
-			int currentOffset = textSelection.getOffset();
-			int currentEndOffset = currentOffset + textSelection.getLength();
-			if (cursorNodeRegion.getOffset() >= currentOffset && cursorNodeRegion.getOffset() <= currentEndOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset) {
-				ICSSNode newNode = cursorNode.getPreviousSibling();
-				if (newNode == null) {
-					newNode = cursorNode.getParentNode();
-
-					if (newNode instanceof IndexedRegion) {
-						IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
-						newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
-					}
-				}
-				else {
-					if (newNode instanceof IndexedRegion) {
-						IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
-						newRegion = new Region(newIndexedRegion.getStartOffset(), currentEndOffset - newIndexedRegion.getStartOffset());
-					}
-				}
-			}
-			else
-				newRegion = cursorNodeRegion;
-		}
-		return newRegion;
-	}
-
-	public void init(IAction action) {
-		if (action != null) {
-			action.setText(CSSUIMessages.StructureSelectPrevious_label);
-			action.setToolTipText(CSSUIMessages.StructureSelectPrevious_tooltip);
-			action.setDescription(CSSUIMessages.StructureSelectPrevious_description);
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/IStyleConstantsCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/IStyleConstantsCSS.java
deleted file mode 100644
index 75280d3..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/IStyleConstantsCSS.java
+++ /dev/null
@@ -1,31 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.style;
-
-/**
- * Contains the symbolic name of styles used by LineStyleProvider,
- * ColorManager, and any others who may be interested
- */
-public interface IStyleConstantsCSS {
-	public static final String NORMAL = "NORMAL"; //$NON-NLS-1$
-	public static final String ATMARK_RULE = "ATMARK_RULE"; //$NON-NLS-1$
-	public static final String SELECTOR = "SELECTOR"; //$NON-NLS-1$
-	public static final String MEDIA = "MEDIA"; //$NON-NLS-1$
-	public static final String COMMENT = "COMMENT"; //$NON-NLS-1$
-	public static final String PROPERTY_NAME = "PROPERTY_NAME"; //$NON-NLS-1$
-	public static final String PROPERTY_VALUE = "PROPERTY_VALUE"; //$NON-NLS-1$
-	public static final String URI = "URI"; //$NON-NLS-1$
-	public static final String STRING = "STRING"; //$NON-NLS-1$
-	public static final String COLON = "COLON"; //$NON-NLS-1$
-	public static final String SEMI_COLON = "SEMI_COLON"; //$NON-NLS-1$
-	public static final String CURLY_BRACE = "CURLY_BRACE"; //$NON-NLS-1$
-	public static final String ERROR = "ERROR"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForCSS.java
deleted file mode 100644
index 7b3b182..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForCSS.java
+++ /dev/null
@@ -1,198 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.style;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-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;
-
-/**
- */
-public class LineStyleProviderForCSS extends AbstractLineStyleProvider implements LineStyleProvider {
-	/** Contains region to style mapping */
-	private Map fColorTypes;
-
-	/**
-	 * LineStyleProviderForEmbeddedCSS constructor comment.
-	 */
-	public LineStyleProviderForCSS() {
-		super();
-	}
-
-	protected TextAttribute getAttributeFor(ITextRegion region) {
-		if (region != null) {
-			String type = region.getType();
-			if (type != null) {
-				return getAttributeFor(type);
-			}
-		}
-		return (TextAttribute) getTextAttributes().get(IStyleConstantsCSS.NORMAL);
-	}
-
-	/**
-	 * Look up the TextAttribute for the given region context. Might return
-	 * null for unusual text.
-	 * 
-	 * @param type
-	 * @return
-	 */
-	protected TextAttribute getAttributeFor(String type) {
-		return (TextAttribute) getTextAttributes().get(fColorTypes.get(type));
-	}
-
-	private void initAttributes() {
-		if (fColorTypes == null) {
-			fColorTypes = new HashMap();
-		}
-		fColorTypes.put(CSSRegionContexts.CSS_COMMENT, IStyleConstantsCSS.COMMENT);
-		fColorTypes.put(CSSRegionContexts.CSS_CDO, IStyleConstantsCSS.COMMENT);
-		fColorTypes.put(CSSRegionContexts.CSS_CDC, IStyleConstantsCSS.COMMENT);
-		fColorTypes.put(CSSRegionContexts.CSS_S, IStyleConstantsCSS.NORMAL);
-
-		fColorTypes.put(CSSRegionContexts.CSS_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
-		fColorTypes.put(CSSRegionContexts.CSS_LBRACE, IStyleConstantsCSS.CURLY_BRACE);
-		fColorTypes.put(CSSRegionContexts.CSS_RBRACE, IStyleConstantsCSS.CURLY_BRACE);
-
-		fColorTypes.put(CSSRegionContexts.CSS_IMPORT, IStyleConstantsCSS.ATMARK_RULE);
-		fColorTypes.put(CSSRegionContexts.CSS_PAGE, IStyleConstantsCSS.ATMARK_RULE);
-		fColorTypes.put(CSSRegionContexts.CSS_MEDIA, IStyleConstantsCSS.ATMARK_RULE);
-		fColorTypes.put(CSSRegionContexts.CSS_FONT_FACE, IStyleConstantsCSS.ATMARK_RULE);
-		fColorTypes.put(CSSRegionContexts.CSS_CHARSET, IStyleConstantsCSS.ATMARK_RULE);
-		fColorTypes.put(CSSRegionContexts.CSS_ATKEYWORD, IStyleConstantsCSS.ATMARK_RULE);
-
-		fColorTypes.put(CSSRegionContexts.CSS_STRING, IStyleConstantsCSS.STRING);
-		fColorTypes.put(CSSRegionContexts.CSS_URI, IStyleConstantsCSS.URI);
-		fColorTypes.put(CSSRegionContexts.CSS_MEDIUM, IStyleConstantsCSS.MEDIA);
-		fColorTypes.put(CSSRegionContexts.CSS_MEDIA_SEPARATOR, IStyleConstantsCSS.MEDIA);
-
-		fColorTypes.put(CSSRegionContexts.CSS_CHARSET_NAME, IStyleConstantsCSS.STRING);
-
-		fColorTypes.put(CSSRegionContexts.CSS_PAGE_SELECTOR, IStyleConstantsCSS.MEDIA);
-
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_UNIVERSAL, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_PSEUDO, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_CLASS, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ID, IStyleConstantsCSS.SELECTOR);
-
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_COMBINATOR, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_SEPARATOR, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR, IStyleConstantsCSS.SELECTOR);
-
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_PROPERTY, IStyleConstantsCSS.PROPERTY_NAME);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT, IStyleConstantsCSS.PROPERTY_VALUE);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION, IStyleConstantsCSS.PROPERTY_VALUE);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE, IStyleConstantsCSS.PROPERTY_VALUE);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER, IStyleConstantsCSS.PROPERTY_VALUE);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION, IStyleConstantsCSS.PROPERTY_VALUE);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE, IStyleConstantsCSS.PROPERTY_VALUE);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_STRING, IStyleConstantsCSS.PROPERTY_VALUE);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_URI, IStyleConstantsCSS.PROPERTY_VALUE);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_HASH, IStyleConstantsCSS.PROPERTY_VALUE);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_UNICODE_RANGE, IStyleConstantsCSS.PROPERTY_VALUE);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT, IStyleConstantsCSS.PROPERTY_VALUE);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR, IStyleConstantsCSS.PROPERTY_VALUE);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_S, IStyleConstantsCSS.PROPERTY_VALUE);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_SEPARATOR, IStyleConstantsCSS.COLON);
-		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
-
-		fColorTypes.put(CSSRegionContexts.CSS_UNKNOWN, IStyleConstantsCSS.NORMAL);
-	}
-
-	protected void handlePropertyChange(PropertyChangeEvent event) {
-		String styleKey = null;
-
-		if (event != null) {
-			String prefKey = event.getProperty();
-			// check if preference changed is a style preference
-			if (IStyleConstantsCSS.ATMARK_RULE.equals(prefKey)) {
-				styleKey = IStyleConstantsCSS.ATMARK_RULE;
-			} else if (IStyleConstantsCSS.COLON.equals(prefKey)) {
-				styleKey = IStyleConstantsCSS.COLON;
-			} else if (IStyleConstantsCSS.COMMENT.equals(prefKey)) {
-				styleKey = IStyleConstantsCSS.COMMENT;
-			} else if (IStyleConstantsCSS.CURLY_BRACE.equals(prefKey)) {
-				styleKey = IStyleConstantsCSS.CURLY_BRACE;
-			} else if (IStyleConstantsCSS.ERROR.equals(prefKey)) {
-				styleKey = IStyleConstantsCSS.ERROR;
-			} else if (IStyleConstantsCSS.MEDIA.equals(prefKey)) {
-				styleKey = IStyleConstantsCSS.MEDIA;
-			} else if (IStyleConstantsCSS.NORMAL.equals(prefKey)) {
-				styleKey = IStyleConstantsCSS.NORMAL;
-			} else if (IStyleConstantsCSS.PROPERTY_NAME.equals(prefKey)) {
-				styleKey = IStyleConstantsCSS.PROPERTY_NAME;
-			} else if (IStyleConstantsCSS.PROPERTY_VALUE.equals(prefKey)) {
-				styleKey = IStyleConstantsCSS.PROPERTY_VALUE;
-			} else if (IStyleConstantsCSS.SELECTOR.equals(prefKey)) {
-				styleKey = IStyleConstantsCSS.SELECTOR;
-			} else if (IStyleConstantsCSS.SEMI_COLON.equals(prefKey)) {
-				styleKey = IStyleConstantsCSS.SEMI_COLON;
-			} else if (IStyleConstantsCSS.STRING.equals(prefKey)) {
-				styleKey = IStyleConstantsCSS.STRING;
-			} else if (IStyleConstantsCSS.URI.equals(prefKey)) {
-				styleKey = IStyleConstantsCSS.URI;
-			}
-		} else {
-			// this is around for old deprecated preferencesChanged() method
-			// TODO remove when preferencesChanged() is removed
-			loadColors();
-			super.handlePropertyChange(event);
-		}
-
-		if (styleKey != null) {
-			// overwrite style preference with new value
-			addTextAttribute(styleKey);
-			super.handlePropertyChange(event);
-		}
-	}
-
-	public void release() {
-		if (fColorTypes != null) {
-			fColorTypes.clear();
-			fColorTypes = null;
-		}
-		super.release();
-	}
-
-	public void loadColors() {
-		initAttributes();
-		
-		addTextAttribute(IStyleConstantsCSS.ATMARK_RULE);
-		addTextAttribute(IStyleConstantsCSS.COLON);
-		addTextAttribute(IStyleConstantsCSS.COMMENT);
-		addTextAttribute(IStyleConstantsCSS.CURLY_BRACE);
-		addTextAttribute(IStyleConstantsCSS.ERROR);
-		addTextAttribute(IStyleConstantsCSS.MEDIA);
-		addTextAttribute(IStyleConstantsCSS.NORMAL);
-		addTextAttribute(IStyleConstantsCSS.PROPERTY_NAME);
-		addTextAttribute(IStyleConstantsCSS.PROPERTY_VALUE);
-		addTextAttribute(IStyleConstantsCSS.SELECTOR);
-		addTextAttribute(IStyleConstantsCSS.SEMI_COLON);
-		addTextAttribute(IStyleConstantsCSS.STRING);
-		addTextAttribute(IStyleConstantsCSS.URI);
-	}
-
-	protected IPreferenceStore getColorPreferences() {
-		return CSSUIPlugin.getDefault().getPreferenceStore();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java
deleted file mode 100644
index 0e52ab1..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java
+++ /dev/null
@@ -1,109 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.style;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-public class LineStyleProviderForEmbeddedCSS extends LineStyleProviderForCSS {
-
-	public boolean prepareRegions(ITypedRegion typedRegion, int lineRequestStart, int lineRequestLength, Collection holdResults) {
-		int regionStart = typedRegion.getOffset();
-		int regionEnd = regionStart + typedRegion.getLength();
-		IStructuredDocumentRegion wholeRegion = getDocument().getRegionAtCharacterOffset(regionStart);
-
-		List tokens;
-		int offset;
-
-		ParserCache cache = getCachedParsingResult(wholeRegion);
-		if (cache == null) {
-			offset = wholeRegion.getStartOffset();
-			String content;
-			content = wholeRegion.getText();
-
-			CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_STYLESHEET, content);
-			tokens = parser.getTokenList();
-			cacheParsingResult(wholeRegion, new ParserCache(offset, tokens));
-		} else {
-			tokens = cache.tokens;
-			offset = cache.offset;
-		}
-
-		boolean result = false;
-
-		if (0 < tokens.size()) {
-			int start = offset;
-			Iterator i = tokens.iterator();
-			while (i.hasNext()) {
-				CSSTextToken token = (CSSTextToken) i.next();
-				if (regionStart <= start && start < regionEnd) {
-					TextAttribute attribute = getAttributeFor(token.kind);
-					if (attribute != null) {
-						holdResults.add(new StyleRange(start, token.length, attribute.getForeground(), attribute.getBackground()));
-					}
-					else {
-						holdResults.add(new StyleRange(start, token.length, null, null));
-					}
-				}
-				start += token.length;
-			}
-			result = true;
-		}
-
-		return result;
-	}
-
-	protected TextAttribute getAttributeFor(ITextRegion region) {
-		return null;
-	}
-
-	private void cleanupCache() {
-		fCacheKey = -1;
-		fCacheResult = null;
-	}
-
-	private ParserCache getCachedParsingResult(IStructuredDocumentRegion region) {
-		if (fCacheKey == region.getText().hashCode()) {
-			return fCacheResult;
-		}
-		return null;
-	}
-
-	private void cacheParsingResult(IStructuredDocumentRegion region, ParserCache result) {
-		fCacheKey = region.getText().hashCode();
-		fCacheResult = result;
-	}
-
-	public void release() {
-		super.release();
-		cleanupCache();
-	}
-
-	private class ParserCache {
-		ParserCache(int newOffset, List newTokens) {
-			offset = newOffset;
-			tokens = newTokens;
-		}
-
-		int offset;
-		List tokens;
-	}
-
-	int fCacheKey = -1;
-	ParserCache fCacheResult = null;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/EncodingTemplateVariableResolverCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/EncodingTemplateVariableResolverCSS.java
deleted file mode 100644
index 757da6c..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/EncodingTemplateVariableResolverCSS.java
+++ /dev/null
@@ -1,38 +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.css.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.SimpleTemplateVariableResolver;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-
-public class EncodingTemplateVariableResolverCSS extends SimpleTemplateVariableResolver {
-	private static final String ENCODING_TYPE = getEncodingType();
-
-	private static String getEncodingType() {
-		return "encoding"; //$NON-NLS-1$
-	}
-
-	/**
-	 * Creates a new encoding variable
-	 */
-	public EncodingTemplateVariableResolverCSS() {
-		super(ENCODING_TYPE, CSSUIMessages.Creating_files_encoding);
-	}
-
-	protected String resolve(TemplateContext context) {
-		return CSSCorePlugin.getDefault().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeCSS.java
deleted file mode 100644
index 7e981c8..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeCSS.java
+++ /dev/null
@@ -1,34 +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.css.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContextType;
-
-/**
- * Base class for CSS template context types. Templates of this context type
- * apply to any place within CSS content type.
- */
-public class TemplateContextTypeCSS extends TemplateContextType {
-
-	public TemplateContextTypeCSS() {
-		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 EncodingTemplateVariableResolverCSS());
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeIdsCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeIdsCSS.java
deleted file mode 100644
index d0a134f..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeIdsCSS.java
+++ /dev/null
@@ -1,20 +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.css.ui.internal.templates;
-
-
-public class TemplateContextTypeIdsCSS {
-
-	public static final String ALL = "css_all"; //$NON-NLS-1$
-
-	public static final String NEW = "css_new"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSDocumentRegionEdgeMatcher.java
deleted file mode 100644
index 56d0574..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSDocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,81 +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
- ****************************************************************************/
-package org.eclipse.wst.css.ui.internal.text;
-
-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;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-public class CSSDocumentRegionEdgeMatcher implements ICharacterPairMatcher {
-
-	private int fAnchor = ICharacterPairMatcher.LEFT;
-
-	/**
-	 * @param validContexts
-	 * @param nextMatcher
-	 */
-	public CSSDocumentRegionEdgeMatcher() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#clear()
-	 */
-	public void clear() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#dispose()
-	 */
-	public void dispose() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#getAnchor()
-	 */
-	public int getAnchor() {
-		return fAnchor;
-	}
-
-	public IRegion match(IDocument document, int offset) {
-		if (document instanceof IStructuredDocument) {
-			IStructuredDocumentRegion r = ((IStructuredDocument) document).getRegionAtCharacterOffset(offset);
-			if (r != null) {
-				if (r.getPrevious() != null && r.getStartOffset() == offset && r.getPrevious().getType().equals(CSSRegionContexts.CSS_RBRACE)) {
-					r = r.getPrevious();
-				}
-				if (r.getType().equals(CSSRegionContexts.CSS_RBRACE)) {
-					while (r != null && !r.getType().equals(CSSRegionContexts.CSS_LBRACE)) {
-						r = r.getPrevious();
-					}
-					if (r != null) {
-						return new Region(r.getStartOffset(), 1);
-					}
-				} else if (r.getType().equals(CSSRegionContexts.CSS_LBRACE)) {
-					while (r != null && !r.getType().equals(CSSRegionContexts.CSS_RBRACE)) {
-						r = r.getNext();
-					}
-					if (r != null) {
-						return new Region(r.getEndOffset() - 1, 1);
-					}
-				}
-			}
-		}
-		return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSTemplatesWizardPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSTemplatesWizardPage.java
deleted file mode 100644
index d3ef5de..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSTemplatesWizardPage.java
+++ /dev/null
@@ -1,474 +0,0 @@
-package org.eclipse.wst.css.ui.internal.wizard;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-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.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.Logger;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.css.ui.internal.preferences.CSSUIPreferenceNames;
-import org.eclipse.wst.css.ui.internal.templates.TemplateContextTypeIdsCSS;
-
-/**
- * Templates page in new file wizard. Allows users to select a new file
- * template to be applied in new file.
- * 
- */
-public class NewCSSTemplatesWizardPage 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(TemplateContextTypeIdsCSS.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 NewCSSTemplatesWizardPage() {
-		super("NewCSSTemplatesWizardPage", CSSUIMessages.NewCSSTemplatesWizardPage_0, null); //$NON-NLS-1$
-		setDescription(CSSUIMessages.NewCSSTemplatesWizardPage_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 CSS Template
-		fUseTemplateButton = new Button(parent, SWT.CHECK);
-		fUseTemplateButton.setText(CSSUIMessages.NewCSSTemplatesWizardPage_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);
-
-		// Create linked text to just to templates preference page
-		Link link = new Link(innerParent, SWT.NONE);
-		link.setText(CSSUIMessages.NewCSSTemplatesWizardPage_6);
-		data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
-		link.setLayoutData(data);
-		link.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				linkClicked();
-			}
-		});
-
-		// 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(CSSUIMessages.NewCSSTemplatesWizardPage_2);
-
-		TableColumn column2 = new TableColumn(table, SWT.NONE);
-		column2.setText(CSSUIMessages.NewCSSTemplatesWizardPage_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 = CSSUIPlugin.getDefault().getTemplateStore();
-		fTableViewer.setInput(fTemplateStore);
-
-		configureTableResizing(innerParent, table, column1, column2);
-		loadLastSavedPreferences();
-
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.CSS_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) {
-		SourceViewer viewer = new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		SourceViewerConfiguration configuration = new SourceViewerConfiguration();
-		viewer.configure(configuration);
-		IDocument document = new Document();
-		viewer.setDocument(document);
-		return viewer;
-	}
-
-	private SourceViewer doCreateViewer(Composite parent) {
-		Label label = new Label(parent, SWT.NONE);
-		label.setText(CSSUIMessages.NewCSSTemplatesWizardPage_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);
-		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.css.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 = CSSUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsCSS.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 css", 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 CSS File wizard.
-	 */
-	private void loadLastSavedPreferences() {
-		String templateName = CSSUIPlugin.getDefault().getPreferenceStore().getString(CSSUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
-		if (templateName == null || templateName.length() == 0) {
-			fLastSelectedTemplateName = ""; //$NON-NLS-1$
-			fUseTemplateButton.setSelection(false);
-		}
-		else {
-			fLastSelectedTemplateName = templateName;
-			fUseTemplateButton.setSelection(true);
-		}
-		enableTemplates();
-	}
-
-	/**
-	 * Save template name used for next call to New CSS File wizard.
-	 */
-	void saveLastSavedPreferences() {
-		String templateName = ""; //$NON-NLS-1$
-
-		Template template = getSelectedTemplate();
-		if (template != null) {
-			templateName = template.getName();
-		}
-
-		CSSUIPlugin.getDefault().getPreferenceStore().setValue(CSSUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
-		CSSUIPlugin.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, TemplateContextTypeIdsCSS.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.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSWizard.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSWizard.java
deleted file mode 100644
index dad0429..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSWizard.java
+++ /dev/null
@@ -1,138 +0,0 @@
-package org.eclipse.wst.css.ui.internal.wizard;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStreamWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-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.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.Logger;
-import org.eclipse.wst.css.ui.internal.editor.CSSEditorPluginImages;
-import org.eclipse.wst.css.ui.internal.image.CSSImageHelper;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-public class NewCSSWizard extends Wizard implements INewWizard {
-	private WizardNewFileCreationPage fNewFilePage;
-	private NewCSSTemplatesWizardPage fNewFileTemplatesPage;
-	private IStructuredSelection fSelection;
-	private List fValidExtensions = null;
-
-	/**
-	 * Get list of valid extensions for CSS Content type
-	 * 
-	 * @return
-	 */
-	List getValidExtensions() {
-		if (fValidExtensions == null) {
-			IContentType type = Platform.getContentTypeManager().getContentType(ContentTypeIdForCSS.ContentTypeID_CSS);
-			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
-		}
-		return fValidExtensions;
-	}
-	
-	public void addPages() {
-		fNewFilePage = new WizardNewFileCreationPage("CSSWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))) { //$NON-NLS-1$
-			protected boolean validatePage() {
-				IPath handlePath = new Path(getFileName());
-				String extension = handlePath.getFileExtension();
-				if (extension == null || !extension.equalsIgnoreCase("css")) { //$NON-NLS-1$
-					setErrorMessage(CSSUIMessages._ERROR_FILENAME_MUST_END_CSS); //$NON-NLS-1$
-					return false;
-				}
-				setErrorMessage(null);
-				return super.validatePage();
-			}
-		};
-		fNewFilePage.setTitle(CSSUIMessages._UI_WIZARD_NEW_HEADING); //$NON-NLS-1$
-		fNewFilePage.setDescription(CSSUIMessages._UI_WIZARD_NEW_DESCRIPTION); //$NON-NLS-1$
-
-		addPage(fNewFilePage);
-		
-		fNewFileTemplatesPage = new NewCSSTemplatesWizardPage();
-		addPage(fNewFileTemplatesPage);
-	}
-
-	public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
-		fSelection = aSelection;
-		setWindowTitle(CSSUIMessages._UI_WIZARD_NEW_TITLE); //$NON-NLS-1$
-		ImageDescriptor descriptor = CSSImageHelper.getInstance().getImageDescriptor(CSSEditorPluginImages.IMG_WIZBAN_NEWCSSFILE);
-		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() {
-		// save user options for next use
-		fNewFileTemplatesPage.saveLastSavedPreferences();
-		
-		IFile file = fNewFilePage.createNewFile();
-		
-		// put template contents into file
-		String templateString = fNewFileTemplatesPage.getTemplateString();
-		if (templateString != null) {
-			// determine the encoding for the new file
-			Preferences preference = CSSCorePlugin.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 CSS file", e); //$NON-NLS-1$
-			}
-		}
-
-		// open the file in editor
-		openEditor(file);
-		return true;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentOutlineConfiguration.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentOutlineConfiguration.java
deleted file mode 100644
index fbc9d85..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentOutlineConfiguration.java
+++ /dev/null
@@ -1,121 +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.css.ui.views.contentoutline;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateActionContributionItem;
-import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
-
-/**
- * Configuration for outline view page which shows CSS content.
- * 
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
- * @since 1.0
- */
-public class CSSContentOutlineConfiguration extends ContentOutlineConfiguration {
-	private IContentProvider fContentProvider = null;
-	private ILabelProvider fLabelProvider = null;
-	private final String OUTLINE_SORT_PREF = "outline-sort"; //$NON-NLS-1$
-
-	/**
-	 * Create new instance of CSSContentOutlineConfiguration
-	 */
-	public CSSContentOutlineConfiguration() {
-		// Must have empty constructor to createExecutableExtension
-		super();
-	}
-
-	public IContributionItem[] createToolbarContributions(TreeViewer viewer) {
-		IContributionItem[] items = super.createToolbarContributions(viewer);
-
-		SortAction sortAction = new SortAction(viewer, CSSUIPlugin.getDefault().getPreferenceStore(), OUTLINE_SORT_PREF);
-		IContributionItem sortItem = new PropertyChangeUpdateActionContributionItem(sortAction);
-
-		if (items == null) {
-			items = new IContributionItem[1];
-			items[0] = sortItem;
-		}
-		else {
-			IContributionItem[] combinedItems = new IContributionItem[items.length + 1];
-			combinedItems[0] = sortItem;
-			System.arraycopy(items, 0, combinedItems, 1, items.length);
-			items = combinedItems;
-		}
-		return items;
-	}
-
-	public IContentProvider getContentProvider(TreeViewer viewer) {
-		if (fContentProvider == null)
-			fContentProvider = new JFaceNodeContentProviderCSS();
-		return fContentProvider;
-	}
-
-	private Object getFilteredNode(Object o) {
-		ICSSNode node = null;
-		if (o instanceof ICSSNode) {
-			node = (ICSSNode) o;
-			short nodeType = node.getNodeType();
-			if (node instanceof ICSSValue) {
-				while (node != null && !(node instanceof ICSSStyleDeclItem)) {
-					node = node.getParentNode();
-				}
-			}
-			else if (nodeType == ICSSNode.STYLEDECLARATION_NODE) {
-				node = node.getParentNode();
-			}
-			else if (nodeType == ICSSNode.MEDIALIST_NODE) {
-				node = node.getParentNode();
-			}
-		}
-		return node;
-	}
-
-	private Object[] getFilteredNodes(Object[] objects) {
-		Object[] filtered = new Object[objects.length];
-		for (int i = 0; i < filtered.length; i++) {
-			filtered[i] = getFilteredNode(objects[i]);
-		}
-		return filtered;
-	}
-
-	public ILabelProvider getLabelProvider(TreeViewer viewer) {
-		if (fLabelProvider == null)
-			fLabelProvider = new JFaceNodeLabelProviderCSS();
-		return fLabelProvider;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.StructuredContentOutlineConfiguration#getPreferenceStore()
-	 */
-	protected IPreferenceStore getPreferenceStore() {
-		return CSSUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	public ISelection getSelection(TreeViewer viewer, ISelection selection) {
-		ISelection filteredSelection = selection;
-		if (selection instanceof IStructuredSelection) {
-			Object[] filteredNodes = getFilteredNodes(((IStructuredSelection) selection).toArray());
-			filteredSelection = new StructuredSelection(filteredNodes);
-		}
-		return filteredSelection;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java
deleted file mode 100644
index 9b51b4e..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java
+++ /dev/null
@@ -1,197 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.views.contentoutline;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.stylesheets.MediaList;
-
-/**
- * A Content provider for a JFace viewer used to display CSS nodes. This
- * content provider does not use adapters.
- */
-class JFaceNodeContentProviderCSS implements ITreeContentProvider {
-
-	public JFaceNodeContentProviderCSS() {
-		super();
-	}
-
-	/**
-	 */
-	protected void addElements(Object element, ArrayList v) {
-
-		ICSSNode node;
-
-		if (element instanceof ICSSModel) {
-			ICSSModel model = (ICSSModel) element;
-			ICSSDocument doc = model.getDocument();
-			node = doc.getFirstChild();
-		}
-		else if (element instanceof ICSSNode) {
-			node = ((ICSSNode) element).getFirstChild();
-		}
-		else
-			return;
-
-		while (node != null) {
-			if (node instanceof CSSRule) {
-				v.add(node);
-			}
-
-			node = node.getNextSibling();
-		}
-
-	}
-
-	/**
-	 * The visual part that is using this content provider is about to be
-	 * disposed. Deallocate all allocated SWT resources.
-	 */
-	public void dispose() {
-	}
-
-	/**
-	 * Returns an enumeration containing all child nodes of the given element,
-	 * which represents a node in a tree. The difference to
-	 * <code>IStructuredContentProvider.getElements(Object)</code> is as
-	 * follows: <code>getElements</code> is called to obtain the tree
-	 * viewer's root elements. Method <code>getChildren</code> is used to
-	 * obtain the children of a given node in the tree, which can can be a
-	 * root node, too.
-	 */
-	public Object[] getChildren(Object object) {
-		if (object instanceof ICSSNode) {
-			ICSSNode node = (ICSSNode) object;
-			short nodeType = node.getNodeType();
-			if (nodeType == ICSSNode.STYLERULE_NODE || nodeType == ICSSNode.PAGERULE_NODE || nodeType == ICSSNode.FONTFACERULE_NODE) {
-				for (node = node.getFirstChild(); node != null && !(node instanceof ICSSStyleDeclaration); node.getNextSibling()) {
-					// nop
-				}
-			}
-			List children = new ArrayList();
-			ICSSNode child = (node != null) ? node.getFirstChild() : null;
-			while (child != null) {
-				if (!(child instanceof ICSSPrimitiveValue) && !(child instanceof MediaList)) {
-					children.add(child);
-				}
-				child = child.getNextSibling();
-			}
-			return children.toArray();
-		}
-		return new Object[0];
-	}
-
-	/**
-	 * Returns an enumeration with the elements belonging to the passed
-	 * element. These elements can be presented as rows in a table, items in a
-	 * list etc.
-	 */
-	public Object[] getElements(Object object) {
-		// The root is usually an instance of an XMLStructuredModel in
-		// which case we want to extract the document.
-
-		if (object instanceof ICSSModel) {
-			ArrayList v = new ArrayList();
-			// internalGetElements(object, v);
-			addElements(object, v);
-			return v.toArray();
-		}
-		return new Object[0];
-
-	}
-
-	/**
-	 * Returns the parent for the given element. This method can return
-	 * <code>null</code> indicating that the parent can't be computed. In
-	 * this case the tree viewer can't expand a given node correctly if
-	 * requested.
-	 */
-	public Object getParent(Object object) {
-		// IJFaceNodeAdapter adapter = getAdapter(object);
-		/*
-		 * ICSSNodeAdapter adapter = (ICSSNodeAdapter)getAdapter(object); if
-		 * (adapter != null) return adapter.getParent((ICSSNode) object); else
-		 * return null;
-		 */
-		if (object instanceof ICSSNode) {
-			ICSSNode node = ((ICSSNode) object).getParentNode();
-			if (node != null && node.getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
-				node = node.getParentNode();
-			}
-			return node;
-		}
-		return null;
-	}
-
-	/**
-	 * Returns <code>true</code> if the given element has children.
-	 * Otherwise <code>false</code> is returned.
-	 */
-	public boolean hasChildren(Object object) {
-		// return getAdapter(object).hasChildren((ICSSNode) object);
-		if (object instanceof ICSSNode) {
-			if (object instanceof ICSSStyleDeclItem)
-				return false;
-			else
-				return ((ICSSNode) object).hasChildNodes();
-		}
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
-	 *      java.lang.Object, java.lang.Object)
-	 */
-	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-	}
-
-	/**
-	 */
-	/*
-	 * protected void internalGetElements(Object element, ArrayList v) {
-	 * 
-	 * ICSSNode node;
-	 * 
-	 * if (element instanceof ICSSModel) { ICSSModel model =
-	 * (ICSSModel)element; ICSSDocument doc = model.getDocument();
-	 * adapterFactory.adapt((INodeNotifier)doc); node = doc.getFirstChild(); }
-	 * else if (element instanceof ICSSNode) { node =
-	 * ((ICSSNode)element).getFirstChild(); } else { return; }
-	 * 
-	 * while (node != null) { switch (node.getNodeType()) { case
-	 * ICSSNode.STYLEDECLARATION_NODE: adapterFactory.adapt((INodeNotifier)
-	 * node); break; case ICSSNode.STYLERULE_NODE: case
-	 * ICSSNode.FONTFACERULE_NODE: case ICSSNode.PAGERULE_NODE: case
-	 * ICSSNode.IMPORTRULE_NODE: case ICSSNode.MEDIARULE_NODE: v.add(node);
-	 * adapterFactory.adapt((INodeNotifier) node); break; default:
-	 * adapterFactory.adapt((INodeNotifier) node); break; }
-	 * 
-	 * node = node.getNextSibling(); } }
-	 */
-	/**
-	 * Checks whether the given element is deleted or not.
-	 */
-	public boolean isDeleted(Object element) {
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java
deleted file mode 100644
index f7a45fd..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java
+++ /dev/null
@@ -1,169 +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
- *******************************************************************************/
-package org.eclipse.wst.css.ui.views.contentoutline;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.ui.internal.image.CSSImageHelper;
-import org.eclipse.wst.css.ui.internal.image.CSSImageType;
-import org.w3c.dom.css.CSSImportRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.stylesheets.MediaList;
-
-class JFaceNodeLabelProviderCSS extends LabelProvider {
-
-	/**
-	 * JFaceNodeLabelProvider constructor comment.
-	 */
-	public JFaceNodeLabelProviderCSS() {
-		super();
-	}
-
-	/**
-	 * Returns the image for the label of the given element, for use in the
-	 * given viewer.
-	 * 
-	 * @param viewer
-	 *            The viewer that displays the element.
-	 * @param element
-	 *            The element for which to provide the label image. Element
-	 *            can be <code>null</code> indicating no input object is set
-	 *            to the viewer.
-	 */
-	public Image getImage(Object element) {
-
-
-		if (element instanceof ICSSNode) {
-			CSSImageHelper helper = CSSImageHelper.getInstance();
-			return helper.getImage(CSSImageType.getImageType((ICSSNode) element));
-			// Image image = getCSSNodeImage(element);
-			// return image;
-			// return getAdapter(element).getLabelImage((ICSSNode) element);
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the text for the label of the given element, for use in the
-	 * given viewer.
-	 * 
-	 * @param viewer
-	 *            The viewer that displays the element.
-	 * @param element
-	 *            The element for which to provide the label text. Element can
-	 *            be <code>null</code> indicating no input object is set to
-	 *            the viewer.
-	 */
-	public String getText(Object element) {
-		// This was returning null, on occasion ... probably should not be,
-		// but
-		// took the quick and easy way out for now. (dmw 3/8/01)
-
-		String result = "";//$NON-NLS-1$
-		String mediaText;
-		if (element instanceof ICSSNode) {
-			switch (((ICSSNode) element).getNodeType()) {
-				case ICSSNode.STYLERULE_NODE :
-					result = ((ICSSStyleRule) element).getSelectors().getString();
-					break;
-				case ICSSNode.FONTFACERULE_NODE :
-					result = "@font-face";//$NON-NLS-1$
-					break;
-				case ICSSNode.IMPORTRULE_NODE :
-					result = ((CSSImportRule) element).getHref();
-					mediaText = getMediaText((CSSImportRule) element);
-					if (mediaText != null && 0 < mediaText.length()) {
-						result += " (" + mediaText + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-					}
-					break;
-				case ICSSNode.PAGERULE_NODE :
-					result = ((ICSSPageRule) element).getSelectors().getString();
-					break;
-				case ICSSNode.STYLEDECLARATION_NODE :
-					result = "properties";//$NON-NLS-1$
-					break;
-				case ICSSNode.STYLEDECLITEM_NODE :
-					result = ((ICSSStyleDeclItem) element).getPropertyName();
-					break;
-				case ICSSNode.PRIMITIVEVALUE_NODE :
-					result = ((ICSSPrimitiveValue) element).getStringValue();
-					break;
-				case ICSSNode.MEDIARULE_NODE :
-					result = "@media";//$NON-NLS-1$
-					mediaText = getMediaText((ICSSMediaRule) element);
-					if (mediaText != null && 0 < mediaText.length()) {
-						result += " (" + mediaText + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-					}
-					break;
-				case ICSSNode.CHARSETRULE_NODE :
-					result = "@charset";//$NON-NLS-1$
-					break;
-				case ICSSNode.MEDIALIST_NODE :
-					result = ((MediaList) element).getMediaText();
-					break;
-				default :
-					break;
-			}
-		}
-
-		// if (element instanceof ICSSNode) {
-		// ICSSNode node = ((ICSSNode)element);
-		// result = getAdapter(element).getLabelText((ICSSNode) element);
-		// }
-		return result;
-	}
-
-	private String getMediaText(CSSRule rule) {
-		String result = ""; //$NON-NLS-1$
-		ICSSNode child = (rule != null) ? ((ICSSNode) rule).getFirstChild() : null;
-		while (child != null) {
-			if (child.getNodeType() == ICSSNode.MEDIALIST_NODE) {
-				result = ((MediaList) child).getMediaText();
-				break;
-			}
-			child = child.getNextSibling();
-		}
-		return result;
-	}
-
-	/**
-	 * Checks whether this label provider is affected by the given domain
-	 * event.
-	 */
-	public boolean isAffected(Object dummy) {// DomainEvent event) {
-		// return event.isModifier(DomainEvent.NON_STRUCTURE_CHANGE);
-		return true;
-
-	}
-
-	/**
-	 * Returns whether the label would be affected by a change to the given
-	 * property of the given element. This can be used to optimize a
-	 * non-structural viewer update. If the property mentioned in the update
-	 * does not affect the label, then the viewer need not update the label.
-	 * 
-	 * @param element
-	 *            the element
-	 * @param property
-	 *            the property
-	 * @return <code>true</code> if the label would be affected, and
-	 *         <code>false</code> if it would be unaffected
-	 */
-	public boolean isLabelProperty(Object element, String property) {
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/SortAction.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/SortAction.java
deleted file mode 100644
index eb2daf4..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/SortAction.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-
-package org.eclipse.wst.css.ui.views.contentoutline;
-
-import java.text.Collator;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.css.ui.internal.CSSUIMessages;
-import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
-import org.eclipse.wst.css.ui.internal.editor.CSSEditorPluginImages;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
-
-/*
- * Based on DTDContentOutlinePage#SortAction
- */
-class SortAction extends PropertyChangeUpdateAction {
-	private TreeViewer treeViewer;
-
-	public SortAction(TreeViewer viewer, IPreferenceStore store, String preferenceKey) {
-		super(CSSUIMessages.SortAction_0, store, preferenceKey, false); //$NON-NLS-1$
-		ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(CSSUIPlugin.ID, CSSEditorPluginImages.IMG_OBJ_SORT);
-		setImageDescriptor(desc);
-		setToolTipText(getText());
-		treeViewer = viewer;
-		if (isChecked()) {
-			treeViewer.setSorter(new ViewerSorter(Collator.getInstance()));
-		}
-	}
-
-	public void update() {
-		super.update();
-		treeViewer.getControl().setVisible(false);
-		Object[] expandedElements = treeViewer.getExpandedElements();
-		if (isChecked()) {
-			treeViewer.setSorter(new ViewerSorter(Collator.getInstance()));
-		} else {
-			treeViewer.setSorter(null);
-		}
-		treeViewer.setInput(treeViewer.getInput());
-		treeViewer.setExpandedElements(expandedElements);
-		treeViewer.getControl().setVisible(true);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySheetConfiguration.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySheetConfiguration.java
deleted file mode 100644
index b8c1fa4..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySheetConfiguration.java
+++ /dev/null
@@ -1,193 +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.css.ui.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.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.css.ui.internal.properties.CSSPropertySource;
-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;
-
-/**
- * Configuration for property sheet page which shows CSS content.
- * 
- * @see org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration
- * @since 1.0
- */
-public class CSSPropertySheetConfiguration 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 CSSPropertySource(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 CSSPropertySheetConfiguration() {
-		// 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;
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.properties b/bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.properties
deleted file mode 100644
index bf282ec..0000000
--- a/bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-Templates.newcss.name=New CSS File
-Templates.newcss.desc=new css file
diff --git a/bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.xml b/bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.xml
deleted file mode 100644
index 002720a..0000000
--- a/bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<templates>
-<template name="%Templates.newcss.name" description="%Templates.newcss.desc" id="org.eclipse.wst.css.ui.internal.templates.newcss" context="css_new" enabled="true">@CHARSET "${encoding}";</template>
-</templates>
diff --git a/bundles/org.eclipse.wst.dtd.core/.classpath b/bundles/org.eclipse.wst.dtd.core/.classpath
deleted file mode 100644
index fe6106c..0000000
--- a/bundles/org.eclipse.wst.dtd.core/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src/"/>
-	<classpathentry kind="src" path="contentmodel/"/>
-	<classpathentry kind="src" path="emfmodel/"/>
-	<classpathentry kind="src" path="saxparser/"/>
-	<classpathentry kind="src" path="src-validation"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.dtd.core/.cvsignore b/bundles/org.eclipse.wst.dtd.core/.cvsignore
deleted file mode 100644
index 5879783..0000000
--- a/bundles/org.eclipse.wst.dtd.core/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-bin
-runtime
-dtdcore.jar
-*.zip
-build.xml
-temp.folder
-@dot
diff --git a/bundles/org.eclipse.wst.dtd.core/.project b/bundles/org.eclipse.wst.dtd.core/.project
deleted file mode 100644
index 76249e5..0000000
--- a/bundles/org.eclipse.wst.dtd.core/.project
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.dtd.core</name>
-	<comment></comment>
-	<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.dtd.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 50369da..0000000
--- a/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,69 +0,0 @@
-#Sat Oct 01 09:01:07 EDT 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-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=500
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-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.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=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-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.missingSerialVersion=warning
-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=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-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.unsafeTypeOperation=warning
-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.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.dtd.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index c9a18d3..0000000
--- a/bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Fri May 27 23:56:32 EDT 2005
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-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.dtd.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.dtd.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 3984f31..0000000
--- a/bundles/org.eclipse.wst.dtd.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,39 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.dtd.core; singleton:=true
-Bundle-Version: 1.0.1.qualifier
-Bundle-Activator: org.eclipse.wst.dtd.core.internal.DTDCorePlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.dtd.core.internal,
- org.eclipse.wst.dtd.core.internal.content,
- org.eclipse.wst.dtd.core.internal.contentmodel,
- org.eclipse.wst.dtd.core.internal.document,
- org.eclipse.wst.dtd.core.internal.emf,
- org.eclipse.wst.dtd.core.internal.emf.impl,
- org.eclipse.wst.dtd.core.internal.emf.util,
- org.eclipse.wst.dtd.core.internal.encoding,
- org.eclipse.wst.dtd.core.internal.event,
- org.eclipse.wst.dtd.core.internal.modelhandler,
- org.eclipse.wst.dtd.core.internal.parser,
- org.eclipse.wst.dtd.core.internal.provisional.contenttype,
- org.eclipse.wst.dtd.core.internal.provisional.document,
- org.eclipse.wst.dtd.core.internal.provisional.text,
- org.eclipse.wst.dtd.core.internal.saxparser,
- org.eclipse.wst.dtd.core.internal.tasks,
- org.eclipse.wst.dtd.core.internal.text,
- org.eclipse.wst.dtd.core.internal.tokenizer,
- org.eclipse.wst.dtd.core.internal.util,
- org.eclipse.wst.dtd.core.internal.validation,
- rose
-Require-Bundle: org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.emf.ecore,
- org.eclipse.jface.text,
- org.eclipse.ui,
- org.eclipse.wst.common.uriresolver,
- org.eclipse.wst.sse.core,
- org.eclipse.wst.xml.core,
- org.eclipse.wst.validation
-Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.dtd.core/about.html b/bundles/org.eclipse.wst.dtd.core/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/bundles/org.eclipse.wst.dtd.core/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>February 24, 2005</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.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.core/build.properties b/bundles/org.eclipse.wst.dtd.core/build.properties
deleted file mode 100644
index 633343e..0000000
--- a/bundles/org.eclipse.wst.dtd.core/build.properties
+++ /dev/null
@@ -1,27 +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
-#     
-###############################################################################
-bin.includes = plugin.xml,\
-               plugin.properties,\
-               icons/,\
-               META-INF/,\
-               .,\
-               about.html
-bin.excludes = bin/**,\
-               @dot/**,\
-               temp.folder/**
-src.includes = component.xml
-source.. = src/,\
-           contentmodel/,\
-           emfmodel/,\
-           saxparser/,\
-           src-validation/
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.core/component.xml b/bundles/org.eclipse.wst.dtd.core/component.xml
deleted file mode 100644
index e4dc12c..0000000
--- a/bundles/org.eclipse.wst.dtd.core/component.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.wst.dtd">
-	<component-depends unrestricted="true" />
-	<plugin id="org.eclipse.wst.dtdeditor.doc.user" fragment="false" />
-	<plugin id="org.eclipse.wst.dtd.core" fragment="false" />
-	<plugin id="org.eclipse.wst.dtd.ui" fragment="false" />
-	<description url="http://eclipse.org/webtools/wst/components/dtd/overview.html" />
-	<package name="org.eclipse.wst.dtd.ui" api="false">
-		<type name="StructuredTextViewerConfigurationDTD" subclass="true" instantiate="true" />
-	</package>
-	<package name="org.eclipse.wst.dtd.ui.views.contentoutline" api="false">
-		<type name="DTDContentOutlineConfiguration" subclass="true" instantiate="true" />
-	</package>
-	<plugin id="org.eclipse.wst.dtd.ui.infopop" fragment="false" />
-</component>
diff --git a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMDocumentFactoryDTD.java b/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMDocumentFactoryDTD.java
deleted file mode 100644
index 34f5f10..0000000
--- a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMDocumentFactoryDTD.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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.contentmodel;
-
-import org.eclipse.wst.dtd.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.factory.CMDocumentFactory;
-
-/**
- * This builder handles building .dtd grammar files
- */
-public class CMDocumentFactoryDTD implements CMDocumentFactory {
-	public CMDocumentFactoryDTD() {
-	}
-
-
-	public CMDocument createCMDocument(String uri) {
-		// work around a bug in our parsers
-		// todo... revisit this
-		//
-//		https://bugs.eclipse.org/bugs/show_bug.cgi?id=100481
-//		String fileProtocol = "file:"; //$NON-NLS-1$
-//		if (uri.startsWith(fileProtocol)) {
-//			uri = uri.substring(fileProtocol.length());
-//		}
-
-		CMDocument result = null;
-		try {
-			result = DTDImpl.buildCMDocument(uri);
-		}
-		catch (Exception e) {
-			Logger.logException("could not create content model for URI: " + uri, e); //$NON-NLS-1$
-		}
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMNodeImpl.java b/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMNodeImpl.java
deleted file mode 100644
index df5d218..0000000
--- a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMNodeImpl.java
+++ /dev/null
@@ -1,36 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.contentmodel;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public abstract class CMNodeImpl extends AdapterImpl implements CMNode {
-	protected static final String PROPERTY_DOCUMENTATION = "documentation"; //$NON-NLS-1$
-	protected static final String PROPERTY_DOCUMENTATION_SOURCE = "documentationSource"; //$NON-NLS-1$
-	protected static final String PROPERTY_DOCUMENTATION_LANGUAGE = "documentationLanguage"; //$NON-NLS-1$
-	protected static final String PROPERTY_MOF_NOTIFIER = "key"; //$NON-NLS-1$
-	protected static final String PROPERTY_DEFINITION_INFO = "http://org.eclipse.wst/cm/properties/definitionInfo"; //$NON-NLS-1$
-	protected static final String PROPERTY_DEFINITION = "http://org.eclipse.wst/cm/properties/definition"; //$NON-NLS-1$
-
-	public abstract Object getKey();
-
-	public boolean supports(String propertyName) {
-		return propertyName.equals(PROPERTY_MOF_NOTIFIER);
-	}
-
-	public Object getProperty(String propertyName) {
-		return null;
-	}
-
-	public void setProperty(String propertyName, Object object) {
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/DTDImpl.java b/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/DTDImpl.java
deleted file mode 100644
index e53f468..0000000
--- a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/DTDImpl.java
+++ /dev/null
@@ -1,775 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.contentmodel;
-
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDType;
-import org.eclipse.wst.dtd.core.internal.emf.impl.DTDBasicTypeImpl;
-import org.eclipse.wst.dtd.core.internal.emf.impl.DTDPackageImpl;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDMetrics;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDUtil;
-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.CMDocumentation;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMEntityDeclaration;
-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.CMNamespace;
-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.annotation.AnnotationMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMDataTypeImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMEntityDeclarationImpl;
-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;
-
-
-public class DTDImpl {
-	static {
-		// Call init on the DTD package to avoid strange initialization bugs
-		//
-		DTDPackageImpl.init();
-	}
-
-	protected static DTDAdapterFactoryImpl dtdAdapterFactoryImpl = new DTDAdapterFactoryImpl();
-	protected static CMDataTypeInfoTable cmDataTypeInfoTable = new CMDataTypeInfoTable();
-
-	public static CMDocument buildCMDocument(String uri) {
-		DTDFile dtdFile = buildDTDModel(uri);
-		CMDocument cmDocument = (CMDocument) getAdapter(dtdFile);
-		
-		return cmDocument;
-	}
-
-	public static DTDFile buildDTDModel(String uri) {
-		DTDUtil dtdUtil = new DTDUtil();
-		dtdUtil.setexpandEntityReferences(true);
-		dtdUtil.parse(new ResourceSetImpl(), uri);
-		return dtdUtil.getDTDFile();
-	}
-
-	public static CMDocument buildCMDocument(DTDFile dtdFile) {
-		return (CMDocument) getAdapter(dtdFile);
-	}
-
-	public static CMNode getAdapter(Notifier o) {
-		return (CMNode) dtdAdapterFactoryImpl.adapt(o);
-	}
-
-	public static int getMinOccurHelper(DTDRepeatableContent content) {
-		int occurence = content.getOccurrence().getValue();
-		boolean isOptional = (occurence == DTDOccurrenceType.OPTIONAL || occurence == DTDOccurrenceType.ZERO_OR_MORE);
-		return isOptional ? 0 : 1;
-	}
-
-	public static int getMaxOccurHelper(DTDRepeatableContent content) {
-		int occurence = content.getOccurrence().getValue();
-		boolean isMulti = (occurence == DTDOccurrenceType.ONE_OR_MORE || occurence == DTDOccurrenceType.ZERO_OR_MORE);
-		return isMulti ? -1 : 1;
-	}
-
-	public static class DTDAdapterFactoryImpl extends AdapterFactoryImpl {
-		public Adapter createAdapter(Notifier target) {
-			Adapter result = null;
-			if (target != null) {
-				if (target instanceof DTDAttribute) {
-					result = new DTDAttributeAdapter((DTDAttribute) target);
-				}
-				else if (target instanceof DTDElement) {
-					result = new DTDElementAdapter((DTDElement) target);
-				}
-				else if (target instanceof DTDElementReferenceContent) {
-					result = new DTDElementReferenceContentAdapter((DTDElementReferenceContent) target);
-				}
-				else if (target instanceof DTDFile) {
-					result = new DTDFileAdapter((DTDFile) target);
-				}
-				else if (target instanceof DTDGroupContent) {
-					result = new DTDGroupContentAdapter((DTDGroupContent) target);
-				}
-				else if (target instanceof DTDEntity) {
-					result = new DTDEntityAdapter((DTDEntity) target);
-				}
-			}
-			return result;
-		}
-
-		public Adapter adapt(Notifier target) {
-			return adapt(target, this);
-		}
-	}
-
-	/**
-	 * DTDBaseAdapter
-	 */
-	public static abstract class DTDBaseAdapter extends CMNodeImpl {
-		public String getNodeName() {
-			return ""; //$NON-NLS-1$
-		}
-
-		public boolean isAdapterForType(Object type) {
-			return type == dtdAdapterFactoryImpl;
-		}
-
-		public Object getProperty(String propertyName) {
-			Object result = null;
-			if (propertyName.equals("CMDocument")) { //$NON-NLS-1$
-				result = getCMDocument();
-			}
-			else if (propertyName.equals(PROPERTY_DOCUMENTATION)) {
-				result = getDocumentation();
-			}
-			else if (propertyName.equals(PROPERTY_DEFINITION_INFO)) {
-				result = getDefinitionInfo();
-			}
-			else if (propertyName.equals(PROPERTY_DEFINITION)) {
-				result = getDefinition();
-			}
-			else if (propertyName.equals(PROPERTY_MOF_NOTIFIER)) {
-				result = getKey();
-			}
-			else if (propertyName.equals("spec")) { //$NON-NLS-1$
-				result = getSpec();
-			}
-			else {
-				result = super.getProperty(propertyName);
-				if (result == null) {
-					CMDocument cmDocument = getCMDocument();
-					if (cmDocument instanceof DTDFileAdapter) {
-						AnnotationMap map = ((DTDFileAdapter) cmDocument).annotationMap;
-						if (map != null) {
-							String spec = getSpec();
-							if (spec != null) {
-								result = map.getProperty(getSpec(), propertyName);
-							}
-						}
-						if (result == null) {
-							Map globalPropertyMap = ((DTDFileAdapter) cmDocument).globalPropertyMap;
-							result = globalPropertyMap.get(propertyName);
-						}
-					}
-				}
-			}
-			return result;
-		}
-
-		public CMDocument getCMDocument() {
-			return null;
-		}
-
-		protected CMNodeList getDocumentation() {
-			return new CMNodeListImpl();
-		}
-
-		public String getDefinitionInfo() {
-			return null;
-		}
-
-		public CMNode getDefinition() {
-			return null;
-		}
-
-		public String getSpec() {
-			return getNodeName();
-		}
-	}
-
-	/**
-	 * DTDAttributeAdapter
-	 */
-	public static class DTDAttributeAdapter extends DTDBaseAdapter implements CMAttributeDeclaration {
-		protected DTDAttribute attribute;
-		protected CMDataType dataType;
-
-		public DTDAttributeAdapter(DTDAttribute attribute) {
-			this.attribute = attribute;
-			dataType = new DataTypeImpl();
-		}
-
-		public Object getKey() {
-			return attribute;
-		}
-
-		public String getSpec() {
-			return attribute.getDTDElement().getName() + "/@" + attribute.getName(); //$NON-NLS-1$
-		}
-
-		public int getNodeType() {
-			return ATTRIBUTE_DECLARATION;
-		}
-
-		public String getNodeName() {
-			return attribute.getName();
-		}
-
-		public String getAttrName() {
-			return attribute.getName();
-		}
-
-		public CMDataType getAttrType() {
-			return dataType;
-		}
-
-		public String getDefaultValue() {
-			return attribute.getDefaultValueString();
-		}
-
-		public Enumeration getEnumAttr() {
-			return Collections.enumeration(attribute.getEnumeratedValues());
-		}
-
-		public int getUsage() {
-			int usage = OPTIONAL;
-			switch (attribute.getDefaultKind().getValue()) {
-				case DTDDefaultKind.REQUIRED : {
-					usage = REQUIRED;
-					break;
-				}
-				case DTDDefaultKind.FIXED : {
-					usage = FIXED;
-					break;
-				}
-			}
-			return usage;
-		}
-
-		public CMDocument getCMDocument() {
-			DTDFile dtdFile = attribute.getDTDElement().getDTDFile();
-			return dtdFile != null ? (CMDocument) getAdapter(dtdFile) : null;
-		}
-
-		public class DataTypeImpl implements CMDataType {
-			public int getNodeType() {
-				return CMNode.DATA_TYPE;
-			}
-
-			public String getNodeName() {
-				return getDataTypeName();
-			}
-
-			public boolean supports(String propertyName) {
-				return false;
-			}
-
-			public Object getProperty(String propertyName) {
-				Object result = null;
-				if (propertyName.equals("isValidEmptyValue")) { //$NON-NLS-1$
-					String dataTypeName = getDataTypeName();
-					result = (dataTypeName == null || dataTypeName.equals(CMDataType.CDATA)) ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$
-				}
-				return result;
-			}
-
-			public String getDataTypeName() {
-				return cmDataTypeInfoTable.getDataTypeName(attribute.getDTDType());
-			}
-
-			public String generateInstanceValue() {
-				return cmDataTypeInfoTable.getInstanceValue(attribute.getDTDType());
-			}
-
-			public int getImpliedValueKind() {
-				int result = IMPLIED_VALUE_NONE;
-				int defaultValueKind = attribute.getDefaultKind().getValue();
-				if (defaultValueKind == DTDDefaultKind.NOFIXED) {
-					result = IMPLIED_VALUE_DEFAULT;
-				}
-				else if (defaultValueKind == DTDDefaultKind.FIXED) {
-					result = IMPLIED_VALUE_FIXED;
-				}
-				return result;
-			}
-
-			public String getImpliedValue() {
-				return attribute.getDefaultValueString();
-			}
-
-			public String[] getEnumeratedValues() {
-				Object[] objectList = attribute.getEnumeratedValues().toArray();
-				String[] result = new String[objectList.length];
-				for (int i = 0; i < objectList.length; i++) {
-					result[i] = objectList[i].toString();
-				}
-				return result;
-			}
-		}
-	}
-
-
-	/**
-	 * DTDElementBaseAdapter
-	 */
-	public static abstract class DTDElementBaseAdapter extends DTDBaseAdapter implements CMElementDeclaration {
-		protected CMDataType dataType;
-
-		protected abstract DTDElement getDTDElement();
-
-		protected CMDocumentation documentation = null;
-
-		public int getNodeType() {
-			return ELEMENT_DECLARATION;
-		}
-
-		public String getNodeName() {
-			return getDTDElement().getName();
-		}
-
-		public CMNamedNodeMap getAttributes() {
-			CMNamedNodeMapImpl result = new CMNamedNodeMapImpl();
-			List attributeList = getDTDElement().getDTDAttribute();
-			for (Iterator i = attributeList.iterator(); i.hasNext();) {
-				DTDAttribute attribute = (DTDAttribute) i.next();
-				result.getHashtable().put(attribute.getName(), getAdapter(attribute));
-			}
-			return result;
-		}
-
-		public CMContent getContent() {
-			return (CMContent) getAdapter(getDTDElement().getContent());
-		}
-
-		public int getContentType() {
-			// todo
-			int result = ELEMENT;
-			DTDElementContent dtdElementContent = getDTDElement().getContent();
-			if (dtdElementContent instanceof DTDPCDataContent) {
-				result = PCDATA;
-			}
-			else if (dtdElementContent instanceof DTDGroupContent) {
-				DTDGroupContent groupContent = (DTDGroupContent) dtdElementContent;
-				int groupKind = groupContent.getGroupKind().getValue();
-				if (groupKind == DTDGroupKind.CHOICE) {
-					List list = groupContent.getContent();
-					if (list.size() > 0 && list.get(0) instanceof DTDPCDataContent) {
-						result = MIXED;
-					}
-				}
-			}
-			else if (dtdElementContent instanceof DTDAnyContent) {
-				result = ANY;
-			}
-			else if (dtdElementContent instanceof DTDEmptyContent) {
-				result = EMPTY;
-			}
-
-			return result;
-		}
-
-		public String getElementName() {
-			return getDTDElement().getName();
-		}
-
-		public CMDataType getDataType() {
-			int contentType = getContentType();
-			boolean hasDataType = contentType == PCDATA || contentType == MIXED;
-			return hasDataType ? dataType : null;
-		}
-
-		public CMNamedNodeMap getLocalElements() {
-			return CMNamedNodeMapImpl.EMPTY_NAMED_NODE_MAP;
-		}
-
-		public CMDocument getCMDocument() {
-			DTDFile dtdFile = getDTDElement().getDTDFile();
-			return dtdFile != null ? (CMDocument) getAdapter(dtdFile) : null;
-		}
-
-		protected CMNodeList getDocumentation() {
-			CMNodeListImpl nodeList = new CMNodeListImpl();
-			if (documentation == null) {
-				String comment = getDTDElement().getComment();
-				if (comment != null) {
-					String value = ""; //$NON-NLS-1$
-					StringTokenizer st = new StringTokenizer(comment, "\n"); //$NON-NLS-1$
-					while (st.hasMoreTokens()) {
-						value += st.nextToken().trim() + "\n"; //$NON-NLS-1$
-					}
-					documentation = new CMDocumentationImpl(value);
-				}
-			}
-			if (documentation != null) {
-				nodeList.getList().add(documentation);
-			}
-			return nodeList;
-		}
-	}
-
-
-	public static class CMDocumentationImpl implements CMDocumentation {
-		protected String value;
-
-		public CMDocumentationImpl(String value) {
-			this.value = value;
-		}
-
-		public String getNodeName() {
-			return ""; //$NON-NLS-1$
-		}
-
-		public int getNodeType() {
-			return DOCUMENTATION;
-		}
-
-		public boolean supports(String propertyName) {
-			return false;
-		}
-
-		public Object getProperty(String propertyName) {
-			return null;
-		}
-
-		public String getValue() {
-			return value;
-		}
-
-		public String getLanguage() {
-			return null;
-		}
-
-		public String getSource() {
-			return null;
-		}
-	}
-
-
-	/**
-	 * DTDElementAdapter
-	 */
-	public static class DTDElementAdapter extends DTDElementBaseAdapter {
-		protected DTDElement element;
-
-		public DTDElementAdapter(DTDElement element) {
-			this.element = element;
-			dataType = new CMDataTypeImpl("#PCDATA", getDTDElement().getName()); //$NON-NLS-1$
-		}
-
-		public Object getKey() {
-			return element;
-		}
-
-		protected DTDElement getDTDElement() {
-			return element;
-		}
-
-		public int getMinOccur() {
-			return 1;
-		}
-
-		public int getMaxOccur() {
-			return 1;
-		}
-
-		public String getDefinitionInfo() {
-			return "global"; //$NON-NLS-1$
-		}
-
-		public CMNode getDefinition() {
-			return this;
-		}
-	}
-
-
-	/**
-	 * DTDElementReferenceContentAdapter
-	 */
-	public static class DTDElementReferenceContentAdapter extends DTDElementBaseAdapter {
-		protected DTDElementReferenceContent content;
-
-		public DTDElementReferenceContentAdapter(DTDElementReferenceContent content) {
-			this.content = content;
-			dataType = new CMDataTypeImpl("#PCDATA", getDTDElement().getName()); //$NON-NLS-1$
-		}
-
-		public Object getKey() {
-			return content;
-		}
-
-		protected DTDElement getDTDElement() {
-			return content.getReferencedElement();
-		}
-
-		public int getMinOccur() {
-			return getMinOccurHelper(content);
-		}
-
-		public int getMaxOccur() {
-			return getMaxOccurHelper(content);
-		}
-
-
-		public CMNode getDefinition() {
-			return getAdapter(getDTDElement());
-		}
-	}
-
-
-	/**
-	 * DTDEntityAdapter
-	 */
-	public static class DTDEntityAdapter extends DTDBaseAdapter implements CMEntityDeclaration {
-		protected DTDEntity dtdEntity;
-
-		public DTDEntityAdapter(DTDEntity dtdEntity) {
-			this.dtdEntity = dtdEntity;
-		}
-
-		public int getNodeType() {
-			return ENTITY_DECLARATION;
-		}
-
-		public Object getKey() {
-			return dtdEntity;
-		}
-
-		public String getName() {
-			return dtdEntity.getName();
-		}
-
-		public String getValue() {
-			String value = ""; //$NON-NLS-1$
-			if (dtdEntity.getContent() instanceof DTDInternalEntity) {
-				DTDInternalEntity content = (DTDInternalEntity) dtdEntity.getContent();
-				value = content.getValue();
-			}
-			return value;
-		}
-	}
-
-
-	/**
-	 * DTDGroupContentAdapter
-	 */
-	public static class DTDGroupContentAdapter extends DTDBaseAdapter implements CMGroup {
-		protected DTDGroupContent content;
-
-		public DTDGroupContentAdapter(DTDGroupContent content) {
-			this.content = content;
-		}
-
-		public Object getKey() {
-			return content;
-		}
-
-		public int getNodeType() {
-			return GROUP;
-		}
-
-		public String getNodeName() {
-			CMDescriptionBuilder descriptionBuilder = new CMDescriptionBuilder();
-			return descriptionBuilder.buildDescription(this);
-		}
-
-		public CMNodeList getChildNodes() {
-			List list = content.getContent();
-			CMNodeListImpl result = new CMNodeListImpl();
-			for (Iterator i = list.iterator(); i.hasNext();) {
-				CMNode node = getAdapter((Notifier) i.next());
-				if (node != null) {
-					result.getList().add(node);
-				}
-			}
-			return result;
-		}
-
-
-		public int getMaxOccur() {
-			return getMaxOccurHelper(content);
-		}
-
-		public int getMinOccur() {
-			return getMinOccurHelper(content);
-		}
-
-		public int getOperator() {
-			// todo... handle ALONE case by checkig if child count == 1
-			int groupKind = content.getGroupKind().getValue();
-			return (groupKind == DTDGroupKind.CHOICE) ? CHOICE : SEQUENCE;
-		}
-	}
-
-	/**
-	 * DTDFileAdapter
-	 */
-	public static class DTDFileAdapter extends DTDBaseAdapter implements CMDocument {
-		protected final String DEFAULT_ROOT_NAME = "http://org.eclipse.wst/cm/properties/defaultRootName"; //$NON-NLS-1$
-
-		protected DTDFile dtdFile;
-		protected CMNamedNodeMapImpl namedNodeMap;
-		protected CMNamedNodeMapImpl entityNodeMap;
-
-		protected AnnotationMap annotationMap = new AnnotationMap();
-		protected Map globalPropertyMap = new HashMap();
-
-		public DTDFileAdapter(DTDFile dtdFile) {
-			this.dtdFile = dtdFile;
-		}
-
-		public Object getKey() {
-			return dtdFile;
-		}
-
-		public AnnotationMap getAnnotationMap() {
-			return annotationMap;
-		}
-
-		public CMNamedNodeMap getElements() {
-			if (namedNodeMap == null) {
-				namedNodeMap = new CMNamedNodeMapImpl();
-				for (Iterator iterator = dtdFile.listDTDElement().iterator(); iterator.hasNext();) {
-					DTDElement dtdElement = (DTDElement) iterator.next();
-					namedNodeMap.getHashtable().put(dtdElement.getName(), getAdapter(dtdElement));
-				}
-			}
-			return namedNodeMap;
-		}
-
-		public CMNamedNodeMap getEntities() {
-			if (entityNodeMap == null) {
-				entityNodeMap = new CMNamedNodeMapImpl();
-
-				// add the built in entity declarations
-				//
-				entityNodeMap.getHashtable().put("amp", new CMEntityDeclarationImpl("amp", "&")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-				entityNodeMap.getHashtable().put("lt", new CMEntityDeclarationImpl("lt", "<")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-				entityNodeMap.getHashtable().put("gt", new CMEntityDeclarationImpl("gt", ">")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-				entityNodeMap.getHashtable().put("quot", new CMEntityDeclarationImpl("quot", "\"")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-				entityNodeMap.getHashtable().put("apos", new CMEntityDeclarationImpl("apos", "'")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-				for (Iterator i = dtdFile.listDTDEntity().iterator(); i.hasNext();) {
-					DTDEntity dtdEntity = (DTDEntity) i.next();
-					if (!dtdEntity.isParameterEntity() && dtdEntity.getName() != null) {
-						// for now... just handle DTDInternalEntity
-						//
-						if (dtdEntity.getContent() instanceof DTDInternalEntity) {
-							entityNodeMap.getHashtable().put(dtdEntity.getName(), getAdapter(dtdEntity));
-						}
-					}
-				}
-			}
-			return entityNodeMap;
-		}
-
-		public CMNamespace getNamespace() {
-			return null;
-		}
-
-		public int getNodeType() {
-			return DOCUMENT;
-		}
-
-		public String getNodeName() {
-			return dtdFile.getName() + ".dtd"; //$NON-NLS-1$
-		}
-
-		public Object getProperty(String propertyName) {
-			Object result = null;
-			if (propertyName.equals(DEFAULT_ROOT_NAME)) {
-				DTDMetrics metrics = new DTDMetrics(dtdFile);
-				DTDElement dtdElement = metrics.getLeastReferencedElement();
-				if (dtdElement != null) {
-					result = dtdElement.getName();
-				}
-			}
-			else if (propertyName.equals("annotationMap")) { //$NON-NLS-1$
-				result = annotationMap;
-			}
-			else if (propertyName.equals("globalPropertyMap")) { //$NON-NLS-1$
-				result = globalPropertyMap;
-			}
-			else {
-				result = super.getProperty(propertyName);
-			}
-			return result;
-		}
-	}
-
-
-	public static class CMDataTypeInfoTable {
-		protected String[] instanceValueTable;
-		protected String[] dataTypeNameTable;
-
-		public CMDataTypeInfoTable() {
-			// hashtable.put(DTDType.CDATA, null));
-			instanceValueTable = new String[DTDBasicTypeImpl.basicTypeKinds.length];
-			instanceValueTable[DTDBasicTypeKind.ENTITY] = "entity"; //$NON-NLS-1$
-			instanceValueTable[DTDBasicTypeKind.ENTITIES] = "entities"; //$NON-NLS-1$
-			instanceValueTable[DTDBasicTypeKind.NMTOKEN] = "nmtoken"; //$NON-NLS-1$
-			instanceValueTable[DTDBasicTypeKind.NMTOKENS] = "nmtokens"; //$NON-NLS-1$
-
-			dataTypeNameTable = new String[DTDBasicTypeImpl.basicTypeKinds.length];
-			dataTypeNameTable[DTDBasicTypeKind.CDATA] = CMDataType.CDATA;
-			dataTypeNameTable[DTDBasicTypeKind.ID] = CMDataType.ID;
-			dataTypeNameTable[DTDBasicTypeKind.IDREF] = CMDataType.IDREF;
-			dataTypeNameTable[DTDBasicTypeKind.ENTITY] = CMDataType.ENTITY;
-			dataTypeNameTable[DTDBasicTypeKind.ENTITIES] = CMDataType.ENTITIES;
-			dataTypeNameTable[DTDBasicTypeKind.NMTOKEN] = CMDataType.NMTOKEN;
-			dataTypeNameTable[DTDBasicTypeKind.NMTOKENS] = CMDataType.NMTOKENS;
-		}
-
-		public String getInstanceValue(DTDType dtdType) {
-			String result = null;
-			if (dtdType instanceof DTDBasicType) {
-				int kind = ((DTDBasicType) dtdType).getKind().getValue();
-				if (kind >= 0 && kind < DTDBasicTypeImpl.basicTypeDescriptions.length) {
-					result = instanceValueTable[kind];
-				}
-			}
-			return result;
-		}
-
-		public String getDataTypeName(DTDType dtdType) {
-			String result = null;
-			if (dtdType instanceof DTDBasicType) {
-				int kind = ((DTDBasicType) dtdType).getKind().getValue();
-				if (kind >= 0 && kind < DTDBasicTypeImpl.basicTypeDescriptions.length) {
-					result = dataTypeNameTable[kind];
-				}
-			}
-			else if (dtdType instanceof DTDEnumerationType) {
-				result = CMDataType.ENUM;
-			}
-			return result;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAnyContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAnyContent.java
deleted file mode 100644
index 3065392..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAnyContent.java
+++ /dev/null
@@ -1,26 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Any Content</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAnyContent()
- * @model
- * @generated
- */
-public interface DTDAnyContent extends DTDElementContent {
-} // DTDAnyContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAttribute.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAttribute.java
deleted file mode 100644
index 89c5ae1..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAttribute.java
+++ /dev/null
@@ -1,240 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import java.util.Collection;
-
-import org.eclipse.emf.ecore.EAttribute;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Attribute</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultKind <em>Default Kind</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultValueString <em>Default Value String</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeNameReferencedEntity <em>Attribute Name Referenced Entity</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeTypeReferencedEntity <em>Attribute Type Referenced Entity</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDTDElement <em>DTD Element</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute()
- * @model
- * @generated
- */
-public interface DTDAttribute extends EAttribute, DTDObject, DTDSourceOffset {
-	// NON-GEN interfaces DTDObject, DTDSourceOffset
-
-	public DTDType getDTDType();
-
-	public void setDTDType(DTDType type);
-
-	public void setDTDBasicType(int value);
-
-	public DTDEnumerationType createDTDEnumeration(String[] enumValues, int enumKind);
-
-	public Collection getEnumeratedValues();
-
-	public String unparse();
-
-	/**
-	 * Returns the value of the '<em><b>Comment</b></em>' attribute. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Comment</em>' attribute isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Comment</em>' attribute.
-	 * @see #setComment(String)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute_Comment()
-	 * @model
-	 * @generated
-	 */
-	String getComment();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getComment <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Comment</em>' attribute.
-	 * @see #getComment()
-	 * @generated
-	 */
-	void setComment(String value);
-
-	/**
-	 * Returns the value of the '<em><b>Default Kind</b></em>' attribute.
-	 * The literals are from the enumeration
-	 * {@link org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind}. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Default Kind</em>' attribute isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Default Kind</em>' attribute.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind
-	 * @see #setDefaultKind(DTDDefaultKind)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute_DefaultKind()
-	 * @model
-	 * @generated
-	 */
-	DTDDefaultKind getDefaultKind();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultKind <em>Default Kind</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Default Kind</em>' attribute.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind
-	 * @see #getDefaultKind()
-	 * @generated
-	 */
-	void setDefaultKind(DTDDefaultKind value);
-
-	/**
-	 * Returns the value of the '<em><b>Default Value String</b></em>'
-	 * attribute. <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Default Value String</em>' attribute
-	 * isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Default Value String</em>' attribute.
-	 * @see #setDefaultValueString(String)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute_DefaultValueString()
-	 * @model
-	 * @generated
-	 */
-	String getDefaultValueString();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultValueString <em>Default Value String</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Default Value String</em>'
-	 *            attribute.
-	 * @see #getDefaultValueString()
-	 * @generated
-	 */
-	void setDefaultValueString(String value);
-
-	/**
-	 * Returns the value of the '<em><b>Attribute Name Referenced Entity</b></em>'
-	 * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeNameReference <em>Attribute Name Reference</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Attribute Name Referenced Entity</em>'
-	 * reference isn't clear, there really should be more of a description
-	 * here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Attribute Name Referenced Entity</em>'
-	 *         reference.
-	 * @see #setAttributeNameReferencedEntity(DTDEntity)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute_AttributeNameReferencedEntity()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeNameReference
-	 * @model opposite="attributeNameReference"
-	 * @generated
-	 */
-	DTDEntity getAttributeNameReferencedEntity();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeNameReferencedEntity <em>Attribute Name Referenced Entity</em>}'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Attribute Name Referenced Entity</em>'
-	 *            reference.
-	 * @see #getAttributeNameReferencedEntity()
-	 * @generated
-	 */
-	void setAttributeNameReferencedEntity(DTDEntity value);
-
-	/**
-	 * Returns the value of the '<em><b>Attribute Type Referenced Entity</b></em>'
-	 * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeTypeReference <em>Attribute Type Reference</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Attribute Type Referenced Entity</em>'
-	 * reference isn't clear, there really should be more of a description
-	 * here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Attribute Type Referenced Entity</em>'
-	 *         reference.
-	 * @see #setAttributeTypeReferencedEntity(DTDEntity)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute_AttributeTypeReferencedEntity()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeTypeReference
-	 * @model opposite="attributeTypeReference"
-	 * @generated
-	 */
-	DTDEntity getAttributeTypeReferencedEntity();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeTypeReferencedEntity <em>Attribute Type Referenced Entity</em>}'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Attribute Type Referenced Entity</em>'
-	 *            reference.
-	 * @see #getAttributeTypeReferencedEntity()
-	 * @generated
-	 */
-	void setAttributeTypeReferencedEntity(DTDEntity value);
-
-	/**
-	 * Returns the value of the '<em><b>DTD Element</b></em>' container
-	 * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getDTDAttribute <em>DTD Attribute</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>DTD Element</em>' container reference
-	 * isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>DTD Element</em>' container
-	 *         reference.
-	 * @see #setDTDElement(DTDElement)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDAttribute_DTDElement()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDElement#getDTDAttribute
-	 * @model opposite="DTDAttribute"
-	 * @generated
-	 */
-	DTDElement getDTDElement();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDTDElement <em>DTD Element</em>}'
-	 * container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>DTD Element</em>' container
-	 *            reference.
-	 * @see #getDTDElement()
-	 * @generated
-	 */
-	void setDTDElement(DTDElement value);
-
-} // DTDAttribute
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicType.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicType.java
deleted file mode 100644
index 6d9985f..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicType.java
+++ /dev/null
@@ -1,66 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Basic Type</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicType#getKind <em>Kind</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDBasicType()
- * @model
- * @generated
- */
-public interface DTDBasicType extends EClass, DTDType {
-	// NON-GEN interfaces DTDType
-
-	public String getTypeDescription();
-
-	/**
-	 * Returns the value of the '<em><b>Kind</b></em>' attribute. The
-	 * literals are from the enumeration
-	 * {@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind}. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Kind</em>' attribute isn't clear, there
-	 * really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Kind</em>' attribute.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind
-	 * @see #setKind(DTDBasicTypeKind)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDBasicType_Kind()
-	 * @model
-	 * @generated
-	 */
-	DTDBasicTypeKind getKind();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicType#getKind <em>Kind</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Kind</em>' attribute.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind
-	 * @see #getKind()
-	 * @generated
-	 */
-	void setKind(DTDBasicTypeKind value);
-} // DTDBasicType
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicTypeKind.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicTypeKind.java
deleted file mode 100644
index 1e82140..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicTypeKind.java
+++ /dev/null
@@ -1,332 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.AbstractEnumerator;
-
-/**
- * <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>Basic Type Kind</b></em>',
- * and utility methods for working with them. <!-- end-user-doc -->
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDBasicTypeKind()
- * @model
- * @generated
- */
-public final class DTDBasicTypeKind extends AbstractEnumerator {
-	/**
-	 * The '<em><b>NONE</b></em>' literal value. <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #NONE_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int NONE = 0;
-
-	/**
-	 * The '<em><b>CDATA</b></em>' literal value. <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #CDATA_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int CDATA = 1;
-
-	/**
-	 * The '<em><b>ID</b></em>' literal value. <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #ID_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int ID = 2;
-
-	/**
-	 * The '<em><b>IDREF</b></em>' literal value. <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #IDREF_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int IDREF = 3;
-
-	/**
-	 * The '<em><b>IDREFS</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #IDREFS_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int IDREFS = 4;
-
-	/**
-	 * The '<em><b>ENTITY</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #ENTITY_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int ENTITY = 5;
-
-	/**
-	 * The '<em><b>ENTITIES</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #ENTITIES_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int ENTITIES = 6;
-
-	/**
-	 * The '<em><b>NMTOKEN</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #NMTOKEN_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int NMTOKEN = 7;
-
-	/**
-	 * The '<em><b>NMTOKENS</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #NMTOKENS_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int NMTOKENS = 8;
-
-	/**
-	 * The '<em><b>NONE</b></em>' literal object. <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>NONE</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #NONE
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDBasicTypeKind NONE_LITERAL = new DTDBasicTypeKind(NONE, "NONE"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>CDATA</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>CDATA</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #CDATA
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDBasicTypeKind CDATA_LITERAL = new DTDBasicTypeKind(CDATA, "CDATA"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>ID</b></em>' literal object. <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>ID</b></em>' literal object isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #ID
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDBasicTypeKind ID_LITERAL = new DTDBasicTypeKind(ID, "ID"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>IDREF</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>IDREF</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #IDREF
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDBasicTypeKind IDREF_LITERAL = new DTDBasicTypeKind(IDREF, "IDREF"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>IDREFS</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>IDREFS</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #IDREFS
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDBasicTypeKind IDREFS_LITERAL = new DTDBasicTypeKind(IDREFS, "IDREFS"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>ENTITY</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>ENTITY</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #ENTITY
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDBasicTypeKind ENTITY_LITERAL = new DTDBasicTypeKind(ENTITY, "ENTITY"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>ENTITIES</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>ENTITIES</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #ENTITIES
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDBasicTypeKind ENTITIES_LITERAL = new DTDBasicTypeKind(ENTITIES, "ENTITIES"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>NMTOKEN</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>NMTOKEN</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #NMTOKEN
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDBasicTypeKind NMTOKEN_LITERAL = new DTDBasicTypeKind(NMTOKEN, "NMTOKEN"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>NMTOKENS</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>NMTOKENS</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #NMTOKENS
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDBasicTypeKind NMTOKENS_LITERAL = new DTDBasicTypeKind(NMTOKENS, "NMTOKENS"); //$NON-NLS-1$
-
-	/**
-	 * An array of all the '<em><b>Basic Type Kind</b></em>' enumerators.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private static final DTDBasicTypeKind[] VALUES_ARRAY = new DTDBasicTypeKind[]{NONE_LITERAL, CDATA_LITERAL, ID_LITERAL, IDREF_LITERAL, IDREFS_LITERAL, ENTITY_LITERAL, ENTITIES_LITERAL, NMTOKEN_LITERAL, NMTOKENS_LITERAL,};
-
-	/**
-	 * A public read-only list of all the '<em><b>Basic Type Kind</b></em>'
-	 * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
-	/**
-	 * Returns the '<em><b>Basic Type Kind</b></em>' literal with the
-	 * specified name. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static DTDBasicTypeKind get(String name) {
-		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
-			DTDBasicTypeKind result = VALUES_ARRAY[i];
-			if (result.toString().equals(name)) {
-				return result;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the '<em><b>Basic Type Kind</b></em>' literal with the
-	 * specified value. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static DTDBasicTypeKind get(int value) {
-		switch (value) {
-			case NONE :
-				return NONE_LITERAL;
-			case CDATA :
-				return CDATA_LITERAL;
-			case ID :
-				return ID_LITERAL;
-			case IDREF :
-				return IDREF_LITERAL;
-			case IDREFS :
-				return IDREFS_LITERAL;
-			case ENTITY :
-				return ENTITY_LITERAL;
-			case ENTITIES :
-				return ENTITIES_LITERAL;
-			case NMTOKEN :
-				return NMTOKEN_LITERAL;
-			case NMTOKENS :
-				return NMTOKENS_LITERAL;
-		}
-		return null;
-	}
-
-	/**
-	 * Only this class can construct instances. <!-- begin-user-doc --> <!--
-	 * end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private DTDBasicTypeKind(int value, String name) {
-		super(value, name);
-	}
-
-} // DTDBasicTypeKind
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDConstants.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDConstants.java
deleted file mode 100644
index 5a1a9a2..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDConstants.java
+++ /dev/null
@@ -1,21 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-public class DTDConstants {
-	public static String DTD_ERROR_LINE_PREFIX = "<!--ERROR "; //$NON-NLS-1$
-	public static String DTD_ERROR_LINE_SUFFIX = " -->"; //$NON-NLS-1$
-	public static final String DTD_EXTENSION = "dtd"; //$NON-NLS-1$
-	public static final String XML_EXTENSION = "xml"; //$NON-NLS-1$
-	public static final String XMI_EXTENSION = "xmi"; //$NON-NLS-1$
-	public static final String DTD_XMI_EXTENSION = "dtd.xmi"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDContent.java
deleted file mode 100644
index a773bcc..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDContent.java
+++ /dev/null
@@ -1,63 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Content</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDContent#getDTDFile <em>DTD File</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDContent()
- * @model abstract="true"
- * @generated
- */
-public interface DTDContent extends EObject {
-	/**
-	 * Returns the value of the '<em><b>DTD File</b></em>' container
-	 * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDContent <em>DTD Content</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>DTD File</em>' container reference isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>DTD File</em>' container reference.
-	 * @see #setDTDFile(DTDFile)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDContent_DTDFile()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDContent
-	 * @model opposite="DTDContent"
-	 * @generated
-	 */
-	DTDFile getDTDFile();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDContent#getDTDFile <em>DTD File</em>}'
-	 * container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>DTD File</em>' container
-	 *            reference.
-	 * @see #getDTDFile()
-	 * @generated
-	 */
-	void setDTDFile(DTDFile value);
-
-} // DTDContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDDefaultKind.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDDefaultKind.java
deleted file mode 100644
index 0f6378c..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDDefaultKind.java
+++ /dev/null
@@ -1,194 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.AbstractEnumerator;
-
-/**
- * <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>Default Kind</b></em>',
- * and utility methods for working with them. <!-- end-user-doc -->
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDDefaultKind()
- * @model
- * @generated
- */
-public final class DTDDefaultKind extends AbstractEnumerator {
-	/**
-	 * The '<em><b>IMPLIED</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #IMPLIED_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int IMPLIED = 1;
-
-	/**
-	 * The '<em><b>REQUIRED</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #REQUIRED_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int REQUIRED = 2;
-
-	/**
-	 * The '<em><b>FIXED</b></em>' literal value. <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #FIXED_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int FIXED = 3;
-
-	/**
-	 * The '<em><b>NOFIXED</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #NOFIXED_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int NOFIXED = 4;
-
-	/**
-	 * The '<em><b>IMPLIED</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>IMPLIED</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #IMPLIED
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDDefaultKind IMPLIED_LITERAL = new DTDDefaultKind(IMPLIED, "IMPLIED"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>REQUIRED</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>REQUIRED</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #REQUIRED
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDDefaultKind REQUIRED_LITERAL = new DTDDefaultKind(REQUIRED, "REQUIRED"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>FIXED</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>FIXED</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #FIXED
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDDefaultKind FIXED_LITERAL = new DTDDefaultKind(FIXED, "FIXED"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>NOFIXED</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>NOFIXED</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #NOFIXED
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDDefaultKind NOFIXED_LITERAL = new DTDDefaultKind(NOFIXED, "NOFIXED"); //$NON-NLS-1$
-
-	/**
-	 * An array of all the '<em><b>Default Kind</b></em>' enumerators.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private static final DTDDefaultKind[] VALUES_ARRAY = new DTDDefaultKind[]{IMPLIED_LITERAL, REQUIRED_LITERAL, FIXED_LITERAL, NOFIXED_LITERAL,};
-
-	/**
-	 * A public read-only list of all the '<em><b>Default Kind</b></em>'
-	 * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
-	/**
-	 * Returns the '<em><b>Default Kind</b></em>' literal with the
-	 * specified name. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static DTDDefaultKind get(String name) {
-		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
-			DTDDefaultKind result = VALUES_ARRAY[i];
-			if (result.toString().equals(name)) {
-				return result;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the '<em><b>Default Kind</b></em>' literal with the
-	 * specified value. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static DTDDefaultKind get(int value) {
-		switch (value) {
-			case IMPLIED :
-				return IMPLIED_LITERAL;
-			case REQUIRED :
-				return REQUIRED_LITERAL;
-			case FIXED :
-				return FIXED_LITERAL;
-			case NOFIXED :
-				return NOFIXED_LITERAL;
-		}
-		return null;
-	}
-
-	/**
-	 * Only this class can construct instances. <!-- begin-user-doc --> <!--
-	 * end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private DTDDefaultKind(int value, String name) {
-		super(value, name);
-	}
-
-} // DTDDefaultKind
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElement.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElement.java
deleted file mode 100644
index 4222ef5..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElement.java
+++ /dev/null
@@ -1,126 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Element</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getContent <em>Content</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getDTDAttribute <em>DTD Attribute</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElement()
- * @model
- * @generated
- */
-public interface DTDElement extends EClass, DTDContent, DTDObject, DTDSourceOffset {
-
-	public void addDTDAttribute(DTDAttribute attribute);
-
-	// returns all references in the same DTDFile that reference this element
-	public Collection getReferences();
-
-	// return a brief string listing the attributes
-	public String getAttributeDetail();
-
-	/**
-	 * Returns the value of the '<em><b>Comment</b></em>' attribute. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Comment</em>' attribute isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Comment</em>' attribute.
-	 * @see #setComment(String)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElement_Comment()
-	 * @model
-	 * @generated
-	 */
-	String getComment();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getComment <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Comment</em>' attribute.
-	 * @see #getComment()
-	 * @generated
-	 */
-	void setComment(String value);
-
-	/**
-	 * Returns the value of the '<em><b>Content</b></em>' containment
-	 * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getElement <em>Element</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Content</em>' containment reference
-	 * isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Content</em>' containment reference.
-	 * @see #setContent(DTDElementContent)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElement_Content()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getElement
-	 * @model opposite="element" containment="true" required="true"
-	 * @generated
-	 */
-	DTDElementContent getContent();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getContent <em>Content</em>}'
-	 * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Content</em>' containment
-	 *            reference.
-	 * @see #getContent()
-	 * @generated
-	 */
-	void setContent(DTDElementContent value);
-
-	/**
-	 * Returns the value of the '<em><b>DTD Attribute</b></em>'
-	 * containment reference list. The list contents are of type
-	 * {@link DTDAttribute}. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDTDElement <em>DTD Element</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>DTD Attribute</em>' containment
-	 * reference list isn't clear, there really should be more of a
-	 * description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>DTD Attribute</em>' containment
-	 *         reference list.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElement_DTDAttribute()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDTDElement
-	 * @model type="DTDAttribute" opposite="DTDElement" containment="true"
-	 * @generated
-	 */
-	EList getDTDAttribute();
-
-} // DTDElement
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementContent.java
deleted file mode 100644
index 10ce4fc..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementContent.java
+++ /dev/null
@@ -1,112 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Element Content</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getGroup <em>Group</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getElement <em>Element</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElementContent()
- * @model abstract="true"
- * @generated
- */
-public interface DTDElementContent extends EObject, DTDObject, DTDSourceOffset {
-
-	// for showing names to be used in the tree
-	public String getContentName();
-
-	// for showing items in the table
-	public String getContentDetail();
-
-	public DTDElement getDTDElement();
-
-	// get the most outer DTDGroupContent
-	public DTDGroupContent getDTDGroupContent();
-
-	// returns true if this element content is the first
-	// in the element
-	// eg <!ELEMENT blah firstElement>
-	// <!ELEMENT blah ((firstElement, secondElement) | lastElement)
-	public boolean isFirstElementContent();
-
-	/**
-	 * Returns the value of the '<em><b>Group</b></em>' container
-	 * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getContent <em>Content</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Group</em>' container reference isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Group</em>' container reference.
-	 * @see #setGroup(DTDGroupContent)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElementContent_Group()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getContent
-	 * @model opposite="content"
-	 * @generated
-	 */
-	DTDGroupContent getGroup();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getGroup <em>Group</em>}'
-	 * container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Group</em>' container
-	 *            reference.
-	 * @see #getGroup()
-	 * @generated
-	 */
-	void setGroup(DTDGroupContent value);
-
-	/**
-	 * Returns the value of the '<em><b>Element</b></em>' container
-	 * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getContent <em>Content</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Element</em>' container reference isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Element</em>' container reference.
-	 * @see #setElement(DTDElement)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElementContent_Element()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDElement#getContent
-	 * @model opposite="content"
-	 * @generated
-	 */
-	DTDElement getElement();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getElement <em>Element</em>}'
-	 * container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Element</em>' container
-	 *            reference.
-	 * @see #getElement()
-	 * @generated
-	 */
-	void setElement(DTDElement value);
-
-} // DTDElementContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementReferenceContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementReferenceContent.java
deleted file mode 100644
index daeb25c..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementReferenceContent.java
+++ /dev/null
@@ -1,59 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Element Reference Content</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent#getReferencedElement <em>Referenced Element</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElementReferenceContent()
- * @model
- * @generated
- */
-public interface DTDElementReferenceContent extends DTDRepeatableContent {
-	/**
-	 * Returns the value of the '<em><b>Referenced Element</b></em>'
-	 * reference. <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Referenced Element</em>' reference isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Referenced Element</em>' reference.
-	 * @see #setReferencedElement(DTDElement)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDElementReferenceContent_ReferencedElement()
-	 * @model required="true"
-	 * @generated
-	 */
-	DTDElement getReferencedElement();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent#getReferencedElement <em>Referenced Element</em>}'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Referenced Element</em>'
-	 *            reference.
-	 * @see #getReferencedElement()
-	 * @generated
-	 */
-	void setReferencedElement(DTDElement value);
-
-} // DTDElementReferenceContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEmptyContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEmptyContent.java
deleted file mode 100644
index 4f0d5c7..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEmptyContent.java
+++ /dev/null
@@ -1,26 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Empty Content</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEmptyContent()
- * @model
- * @generated
- */
-public interface DTDEmptyContent extends DTDElementContent {
-} // DTDEmptyContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntity.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntity.java
deleted file mode 100644
index bcfc742..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntity.java
+++ /dev/null
@@ -1,220 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.ENamedElement;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Entity</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#isParameterEntity <em>Parameter Entity</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getContent <em>Content</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getParmEntityRef <em>Parm Entity Ref</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getEntityReference <em>Entity Reference</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeNameReference <em>Attribute Name Reference</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeTypeReference <em>Attribute Type Reference</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity()
- * @model
- * @generated
- */
-public interface DTDEntity extends ENamedElement, DTDContent, DTDObject, DTDSourceOffset {
-	/**
-	 * Returns the value of the '<em><b>Comment</b></em>' attribute. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Comment</em>' attribute isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Comment</em>' attribute.
-	 * @see #setComment(String)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_Comment()
-	 * @model
-	 * @generated
-	 */
-	String getComment();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getComment <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Comment</em>' attribute.
-	 * @see #getComment()
-	 * @generated
-	 */
-	void setComment(String value);
-
-	/**
-	 * Returns the value of the '<em><b>Parameter Entity</b></em>'
-	 * attribute. <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Parameter Entity</em>' attribute isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Parameter Entity</em>' attribute.
-	 * @see #setParameterEntity(boolean)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_ParameterEntity()
-	 * @model
-	 * @generated
-	 */
-	boolean isParameterEntity();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#isParameterEntity <em>Parameter Entity</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Parameter Entity</em>'
-	 *            attribute.
-	 * @see #isParameterEntity()
-	 * @generated
-	 */
-	void setParameterEntity(boolean value);
-
-	/**
-	 * Returns the value of the '<em><b>Content</b></em>' containment
-	 * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent#getDTDEntity <em>DTD Entity</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Content</em>' containment reference
-	 * isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Content</em>' containment reference.
-	 * @see #setContent(DTDEntityContent)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_Content()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent#getDTDEntity
-	 * @model opposite="DTDEntity" containment="true" required="true"
-	 * @generated
-	 */
-	DTDEntityContent getContent();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getContent <em>Content</em>}'
-	 * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Content</em>' containment
-	 *            reference.
-	 * @see #getContent()
-	 * @generated
-	 */
-	void setContent(DTDEntityContent value);
-
-	/**
-	 * Returns the value of the '<em><b>Parm Entity Ref</b></em>'
-	 * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference#getEntity <em>Entity</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Parm Entity Ref</em>' reference isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Parm Entity Ref</em>' reference.
-	 * @see #setParmEntityRef(DTDParameterEntityReference)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_ParmEntityRef()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference#getEntity
-	 * @model opposite="entity" required="true"
-	 * @generated
-	 */
-	DTDParameterEntityReference getParmEntityRef();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getParmEntityRef <em>Parm Entity Ref</em>}'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Parm Entity Ref</em>'
-	 *            reference.
-	 * @see #getParmEntityRef()
-	 * @generated
-	 */
-	void setParmEntityRef(DTDParameterEntityReference value);
-
-	/**
-	 * Returns the value of the '<em><b>Entity Reference</b></em>'
-	 * reference list. The list contents are of type
-	 * {@link DTDEntityReferenceContent}. It is bidirectional and its
-	 * opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent#getElementReferencedEntity <em>Element Referenced Entity</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Entity Reference</em>' reference list
-	 * isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Entity Reference</em>' reference
-	 *         list.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_EntityReference()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent#getElementReferencedEntity
-	 * @model type="DTDEntityReferenceContent"
-	 *        opposite="elementReferencedEntity"
-	 * @generated
-	 */
-	EList getEntityReference();
-
-	/**
-	 * Returns the value of the '<em><b>Attribute Name Reference</b></em>'
-	 * reference list. The list contents are of type {@link DTDAttribute}. It
-	 * is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeNameReferencedEntity <em>Attribute Name Referenced Entity</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Attribute Name Reference</em>' reference
-	 * list isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Attribute Name Reference</em>'
-	 *         reference list.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_AttributeNameReference()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeNameReferencedEntity
-	 * @model type="DTDAttribute" opposite="attributeNameReferencedEntity"
-	 * @generated
-	 */
-	EList getAttributeNameReference();
-
-	/**
-	 * Returns the value of the '<em><b>Attribute Type Reference</b></em>'
-	 * reference list. The list contents are of type {@link DTDAttribute}. It
-	 * is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeTypeReferencedEntity <em>Attribute Type Referenced Entity</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Attribute Type Reference</em>' reference
-	 * list isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Attribute Type Reference</em>'
-	 *         reference list.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntity_AttributeTypeReference()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeTypeReferencedEntity
-	 * @model type="DTDAttribute" opposite="attributeTypeReferencedEntity"
-	 * @generated
-	 */
-	EList getAttributeTypeReference();
-
-} // DTDEntity
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityContent.java
deleted file mode 100644
index de4c2b1..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityContent.java
+++ /dev/null
@@ -1,65 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Entity Content</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent#getDTDEntity <em>DTD Entity</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntityContent()
- * @model abstract="true"
- * @generated
- */
-public interface DTDEntityContent extends EObject, DTDObject {
-
-	public String unparse();
-
-	/**
-	 * Returns the value of the '<em><b>DTD Entity</b></em>' container
-	 * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getContent <em>Content</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>DTD Entity</em>' container reference
-	 * isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>DTD Entity</em>' container reference.
-	 * @see #setDTDEntity(DTDEntity)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntityContent_DTDEntity()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getContent
-	 * @model opposite="content"
-	 * @generated
-	 */
-	DTDEntity getDTDEntity();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent#getDTDEntity <em>DTD Entity</em>}'
-	 * container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>DTD Entity</em>' container
-	 *            reference.
-	 * @see #getDTDEntity()
-	 * @generated
-	 */
-	void setDTDEntity(DTDEntity value);
-
-} // DTDEntityContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityReferenceContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityReferenceContent.java
deleted file mode 100644
index 8d4ab91..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityReferenceContent.java
+++ /dev/null
@@ -1,64 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Entity Reference Content</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent#getElementReferencedEntity <em>Element Referenced Entity</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntityReferenceContent()
- * @model
- * @generated
- */
-public interface DTDEntityReferenceContent extends DTDRepeatableContent {
-
-	/**
-	 * Returns the value of the '<em><b>Element Referenced Entity</b></em>'
-	 * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getEntityReference <em>Entity Reference</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Element Referenced Entity</em>'
-	 * reference isn't clear, there really should be more of a description
-	 * here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Element Referenced Entity</em>'
-	 *         reference.
-	 * @see #setElementReferencedEntity(DTDEntity)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEntityReferenceContent_ElementReferencedEntity()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getEntityReference
-	 * @model opposite="entityReference" required="true"
-	 * @generated
-	 */
-	DTDEntity getElementReferencedEntity();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent#getElementReferencedEntity <em>Element Referenced Entity</em>}'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Element Referenced Entity</em>'
-	 *            reference.
-	 * @see #getElementReferencedEntity()
-	 * @generated
-	 */
-	void setElementReferencedEntity(DTDEntity value);
-
-} // DTDEntityReferenceContent
-
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumGroupKind.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumGroupKind.java
deleted file mode 100644
index 7e0b8ed..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumGroupKind.java
+++ /dev/null
@@ -1,139 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.AbstractEnumerator;
-
-/**
- * <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>Enum Group Kind</b></em>',
- * and utility methods for working with them. <!-- end-user-doc -->
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEnumGroupKind()
- * @model
- * @generated
- */
-public final class DTDEnumGroupKind extends AbstractEnumerator {
-	/**
-	 * The '<em><b>NAME TOKEN GROUP</b></em>' literal value. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #NAME_TOKEN_GROUP_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int NAME_TOKEN_GROUP = 1;
-
-	/**
-	 * The '<em><b>NOTATION GROUP</b></em>' literal value. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #NOTATION_GROUP_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int NOTATION_GROUP = 2;
-
-	/**
-	 * The '<em><b>NAME TOKEN GROUP</b></em>' literal object. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>NAME TOKEN GROUP</b></em>' literal
-	 * object isn't clear, there really should be more of a description
-	 * here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #NAME_TOKEN_GROUP
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDEnumGroupKind NAME_TOKEN_GROUP_LITERAL = new DTDEnumGroupKind(NAME_TOKEN_GROUP, "NAME_TOKEN_GROUP"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>NOTATION GROUP</b></em>' literal object. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>NOTATION GROUP</b></em>' literal object
-	 * isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #NOTATION_GROUP
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDEnumGroupKind NOTATION_GROUP_LITERAL = new DTDEnumGroupKind(NOTATION_GROUP, "NOTATION_GROUP"); //$NON-NLS-1$
-
-	/**
-	 * An array of all the '<em><b>Enum Group Kind</b></em>' enumerators.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private static final DTDEnumGroupKind[] VALUES_ARRAY = new DTDEnumGroupKind[]{NAME_TOKEN_GROUP_LITERAL, NOTATION_GROUP_LITERAL,};
-
-	/**
-	 * A public read-only list of all the '<em><b>Enum Group Kind</b></em>'
-	 * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
-	/**
-	 * Returns the '<em><b>Enum Group Kind</b></em>' literal with the
-	 * specified name. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static DTDEnumGroupKind get(String name) {
-		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
-			DTDEnumGroupKind result = VALUES_ARRAY[i];
-			if (result.toString().equals(name)) {
-				return result;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the '<em><b>Enum Group Kind</b></em>' literal with the
-	 * specified value. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static DTDEnumGroupKind get(int value) {
-		switch (value) {
-			case NAME_TOKEN_GROUP :
-				return NAME_TOKEN_GROUP_LITERAL;
-			case NOTATION_GROUP :
-				return NOTATION_GROUP_LITERAL;
-		}
-		return null;
-	}
-
-	/**
-	 * Only this class can construct instances. <!-- begin-user-doc --> <!--
-	 * end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private DTDEnumGroupKind(int value, String name) {
-		super(value, name);
-	}
-
-} // DTDEnumGroupKind
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumerationType.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumerationType.java
deleted file mode 100644
index fd0ef4d..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumerationType.java
+++ /dev/null
@@ -1,101 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EEnum;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Enumeration Type</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getKind <em>Kind</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getDTDFile <em>DTD File</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEnumerationType()
- * @model
- * @generated
- */
-public interface DTDEnumerationType extends EEnum, DTDType {
-
-	public EList getEnumLiterals();
-
-	public String getEnumerationTypeDescription();
-
-	/**
-	 * Returns the value of the '<em><b>Kind</b></em>' attribute. The
-	 * literals are from the enumeration
-	 * {@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind}. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Kind</em>' attribute isn't clear, there
-	 * really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Kind</em>' attribute.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind
-	 * @see #setKind(DTDEnumGroupKind)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEnumerationType_Kind()
-	 * @model
-	 * @generated
-	 */
-	DTDEnumGroupKind getKind();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getKind <em>Kind</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Kind</em>' attribute.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind
-	 * @see #getKind()
-	 * @generated
-	 */
-	void setKind(DTDEnumGroupKind value);
-
-	/**
-	 * Returns the value of the '<em><b>DTD File</b></em>' container
-	 * reference. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDEnumerationType <em>DTD Enumeration Type</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>DTD File</em>' container reference isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>DTD File</em>' container reference.
-	 * @see #setDTDFile(DTDFile)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDEnumerationType_DTDFile()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDEnumerationType
-	 * @model opposite="DTDEnumerationType"
-	 * @generated
-	 */
-	DTDFile getDTDFile();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getDTDFile <em>DTD File</em>}'
-	 * container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>DTD File</em>' container
-	 *            reference.
-	 * @see #getDTDFile()
-	 * @generated
-	 */
-	void setDTDFile(DTDFile value);
-
-} // DTDEnumerationType
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDErrorMessage.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDErrorMessage.java
deleted file mode 100644
index a815056..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDErrorMessage.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-public class DTDErrorMessage {
-	public String errorKey;
-	public String errorMessage;
-	public String lineNo;
-	public String charOffSet;
-	public String declarationType;
-	public String declarationName;
-	public String sourceLine;
-
-
-	public DTDErrorMessage(String declarationType, String declarationName, String lineNo, String charOffSet, String errorKey, String errorMessage) {
-		this(declarationType, declarationName, lineNo, charOffSet, errorKey, errorMessage, null);
-	}
-
-	public DTDErrorMessage(String declarationType, String declarationName, String lineNo, String charOffSet, String errorKey, String errorMessage, String srcLine) {
-		this.declarationType = declarationType;
-		this.declarationName = declarationName;
-		this.lineNo = lineNo;
-		this.charOffSet = charOffSet;
-		this.errorKey = errorKey;
-		this.errorMessage = errorMessage;
-		this.sourceLine = srcLine;
-	}
-
-	public String toString() {
-		return "(" + declarationType + ":" + declarationName + ") " + lineNo + ":" + charOffSet + " " + errorMessage; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-	}
-
-	/**
-	 * @generated
-	 */
-	protected String toStringGen() {
-
-		return "(" + declarationType + ":" + declarationName + ") " + lineNo + ":" + charOffSet + " " + errorMessage; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExtender.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExtender.java
deleted file mode 100644
index 40f406b..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExtender.java
+++ /dev/null
@@ -1,19 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-/**
- * This interface can be implemented by an IDomainModel to augment
- * getElementProperty for any DTD object.
- */
-public interface DTDExtender {
-	public Object getElementProperty(DTDObject dtdObject, Object object);
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExternalEntity.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExternalEntity.java
deleted file mode 100644
index 3b5ca24..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExternalEntity.java
+++ /dev/null
@@ -1,151 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>External Entity</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getSystemID <em>System ID</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getPublicID <em>Public ID</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getNotation <em>Notation</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getEntityReferencedFromAnotherFile <em>Entity Referenced From Another File</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDExternalEntity()
- * @model
- * @generated
- */
-public interface DTDExternalEntity extends DTDEntityContent {
-
-	/**
-	 * Returns the value of the '<em><b>System ID</b></em>' attribute.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>System ID</em>' attribute isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>System ID</em>' attribute.
-	 * @see #setSystemID(String)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDExternalEntity_SystemID()
-	 * @model
-	 * @generated
-	 */
-	String getSystemID();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getSystemID <em>System ID</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>System ID</em>' attribute.
-	 * @see #getSystemID()
-	 * @generated
-	 */
-	void setSystemID(String value);
-
-	/**
-	 * Returns the value of the '<em><b>Public ID</b></em>' attribute.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Public ID</em>' attribute isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Public ID</em>' attribute.
-	 * @see #setPublicID(String)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDExternalEntity_PublicID()
-	 * @model
-	 * @generated
-	 */
-	String getPublicID();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getPublicID <em>Public ID</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Public ID</em>' attribute.
-	 * @see #getPublicID()
-	 * @generated
-	 */
-	void setPublicID(String value);
-
-	/**
-	 * Returns the value of the '<em><b>Notation</b></em>' reference. It
-	 * is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getEntity <em>Entity</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Notation</em>' reference isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Notation</em>' reference.
-	 * @see #setNotation(DTDNotation)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDExternalEntity_Notation()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getEntity
-	 * @model opposite="entity"
-	 * @generated
-	 */
-	DTDNotation getNotation();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getNotation <em>Notation</em>}'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Notation</em>' reference.
-	 * @see #getNotation()
-	 * @generated
-	 */
-	void setNotation(DTDNotation value);
-
-	/**
-	 * Returns the value of the '<em><b>Entity Referenced From Another File</b></em>'
-	 * reference. <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Entity Referenced From Another File</em>'
-	 * reference isn't clear, there really should be more of a description
-	 * here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Entity Referenced From Another File</em>'
-	 *         reference.
-	 * @see #setEntityReferencedFromAnotherFile(DTDFile)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDExternalEntity_EntityReferencedFromAnotherFile()
-	 * @model
-	 * @generated
-	 */
-	DTDFile getEntityReferencedFromAnotherFile();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getEntityReferencedFromAnotherFile <em>Entity Referenced From Another File</em>}'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Entity Referenced From Another File</em>'
-	 *            reference.
-	 * @see #getEntityReferencedFromAnotherFile()
-	 * @generated
-	 */
-	void setEntityReferencedFromAnotherFile(DTDFile value);
-
-} // DTDExternalEntity
-
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFactory.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFactory.java
deleted file mode 100644
index 383d26e..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFactory.java
+++ /dev/null
@@ -1,186 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc --> The <b>Factory</b> for the model. It provides a
- * create method for each non-abstract class of the model. <!-- end-user-doc
- * -->
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage
- * @generated
- */
-public interface DTDFactory extends EFactory {
-
-	/**
-	 * The singleton instance of the factory. <!-- begin-user-doc --> <!--
-	 * end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	DTDFactory eINSTANCE = new org.eclipse.wst.dtd.core.internal.emf.impl.DTDFactoryImpl();
-
-	/**
-	 * Returns a new object of class '<em>Group Content</em>'. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>Group Content</em>'.
-	 * @generated
-	 */
-	DTDGroupContent createDTDGroupContent();
-
-	/**
-	 * Returns a new object of class '<em>Attribute</em>'. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>Attribute</em>'.
-	 * @generated
-	 */
-	DTDAttribute createDTDAttribute();
-
-	/**
-	 * Returns a new object of class '<em>Element</em>'. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>Element</em>'.
-	 * @generated
-	 */
-	DTDElement createDTDElement();
-
-	/**
-	 * Returns a new object of class '<em>Empty Content</em>'. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>Empty Content</em>'.
-	 * @generated
-	 */
-	DTDEmptyContent createDTDEmptyContent();
-
-	/**
-	 * Returns a new object of class '<em>Any Content</em>'. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>Any Content</em>'.
-	 * @generated
-	 */
-	DTDAnyContent createDTDAnyContent();
-
-	/**
-	 * Returns a new object of class '<em>PC Data Content</em>'. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>PC Data Content</em>'.
-	 * @generated
-	 */
-	DTDPCDataContent createDTDPCDataContent();
-
-	/**
-	 * Returns a new object of class '<em>Element Reference Content</em>'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>Element Reference Content</em>'.
-	 * @generated
-	 */
-	DTDElementReferenceContent createDTDElementReferenceContent();
-
-	/**
-	 * Returns a new object of class '<em>File</em>'. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>File</em>'.
-	 * @generated
-	 */
-	DTDFile createDTDFile();
-
-	/**
-	 * Returns a new object of class '<em>Basic Type</em>'. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>Basic Type</em>'.
-	 * @generated
-	 */
-	DTDBasicType createDTDBasicType();
-
-	/**
-	 * Returns a new object of class '<em>Enumeration Type</em>'. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>Enumeration Type</em>'.
-	 * @generated
-	 */
-	DTDEnumerationType createDTDEnumerationType();
-
-	/**
-	 * Returns a new object of class '<em>Notation</em>'. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>Notation</em>'.
-	 * @generated
-	 */
-	DTDNotation createDTDNotation();
-
-	/**
-	 * Returns a new object of class '<em>Entity</em>'. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>Entity</em>'.
-	 * @generated
-	 */
-	DTDEntity createDTDEntity();
-
-	/**
-	 * Returns a new object of class '<em>External Entity</em>'. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>External Entity</em>'.
-	 * @generated
-	 */
-	DTDExternalEntity createDTDExternalEntity();
-
-	/**
-	 * Returns a new object of class '<em>Internal Entity</em>'. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>Internal Entity</em>'.
-	 * @generated
-	 */
-	DTDInternalEntity createDTDInternalEntity();
-
-	/**
-	 * Returns a new object of class '<em>Parameter Entity Reference</em>'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>Parameter Entity Reference</em>'.
-	 * @generated
-	 */
-	DTDParameterEntityReference createDTDParameterEntityReference();
-
-	/**
-	 * Returns a new object of class '<em>Entity Reference Content</em>'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return a new object of class '<em>Entity Reference Content</em>'.
-	 * @generated
-	 */
-	DTDEntityReferenceContent createDTDEntityReferenceContent();
-
-	/**
-	 * Returns the package supported by this factory. <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the package supported by this factory.
-	 * @generated
-	 */
-	DTDPackage getDTDPackage();
-
-} // DTDFactory
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFile.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFile.java
deleted file mode 100644
index 923c372..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFile.java
+++ /dev/null
@@ -1,157 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import java.util.List;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.ENamedElement;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>File</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#isParseError <em>Parse Error</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDContent <em>DTD Content</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDEnumerationType <em>DTD Enumeration Type</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDFile()
- * @model
- * @generated
- */
-public interface DTDFile extends ENamedElement, DTDObject {
-
-	public EList getDTDObject();
-
-	public List listDTDElement();
-
-	public List listDTDNotation();
-
-	public List listDTDEntity();
-
-	public List listDTDParameterEntityReference();
-
-	public List listDTDElementAndDTDParameterEntityReference();
-
-	public DTDElement findElement(String name);
-
-	public DTDEntity findEntity(String name);
-
-	public DTDNotation findNotation(String name);
-
-	public DTDParameterEntityReference findParameterEntityReference(String name);
-
-	public String unparse(boolean includeError);
-
-	/**
-	 * Returns the value of the '<em><b>Comment</b></em>' attribute. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Comment</em>' attribute isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Comment</em>' attribute.
-	 * @see #setComment(String)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDFile_Comment()
-	 * @model
-	 * @generated
-	 */
-	String getComment();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getComment <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Comment</em>' attribute.
-	 * @see #getComment()
-	 * @generated
-	 */
-	void setComment(String value);
-
-	/**
-	 * Returns the value of the '<em><b>Parse Error</b></em>' attribute.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Parse Error</em>' attribute isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Parse Error</em>' attribute.
-	 * @see #setParseError(boolean)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDFile_ParseError()
-	 * @model
-	 * @generated
-	 */
-	boolean isParseError();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#isParseError <em>Parse Error</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Parse Error</em>' attribute.
-	 * @see #isParseError()
-	 * @generated
-	 */
-	void setParseError(boolean value);
-
-	/**
-	 * Returns the value of the '<em><b>DTD Content</b></em>' containment
-	 * reference list. The list contents are of type {@link DTDContent}. It
-	 * is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDContent#getDTDFile <em>DTD File</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>DTD Content</em>' containment reference
-	 * list isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>DTD Content</em>' containment
-	 *         reference list.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDFile_DTDContent()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDContent#getDTDFile
-	 * @model type="DTDContent" opposite="DTDFile" containment="true"
-	 * @generated
-	 */
-	EList getDTDContent();
-
-	/**
-	 * Returns the value of the '<em><b>DTD Enumeration Type</b></em>'
-	 * containment reference list. The list contents are of type
-	 * {@link DTDEnumerationType}. It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getDTDFile <em>DTD File</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>DTD Enumeration Type</em>' containment
-	 * reference list isn't clear, there really should be more of a
-	 * description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>DTD Enumeration Type</em>'
-	 *         containment reference list.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDFile_DTDEnumerationType()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getDTDFile
-	 * @model type="DTDEnumerationType" opposite="DTDFile" containment="true"
-	 * @generated
-	 */
-	EList getDTDEnumerationType();
-
-} // DTDFile
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupContent.java
deleted file mode 100644
index 06247d3..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupContent.java
+++ /dev/null
@@ -1,88 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Group Content</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getGroupKind <em>Group Kind</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getContent <em>Content</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDGroupContent()
- * @model
- * @generated
- */
-public interface DTDGroupContent extends DTDRepeatableContent {
-
-	public int getContentPosition(DTDElementContent content);
-
-	/**
-	 * Returns the value of the '<em><b>Group Kind</b></em>' attribute.
-	 * The literals are from the enumeration
-	 * {@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind}. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of the '<em>Group Kind</em>' attribute isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Group Kind</em>' attribute.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind
-	 * @see #setGroupKind(DTDGroupKind)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDGroupContent_GroupKind()
-	 * @model
-	 * @generated
-	 */
-	DTDGroupKind getGroupKind();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getGroupKind <em>Group Kind</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Group Kind</em>' attribute.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind
-	 * @see #getGroupKind()
-	 * @generated
-	 */
-	void setGroupKind(DTDGroupKind value);
-
-	/**
-	 * Returns the value of the '<em><b>Content</b></em>' containment
-	 * reference list. The list contents are of type {@link DTDElementContent}.
-	 * It is bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getGroup <em>Group</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Content</em>' containment reference list
-	 * isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Content</em>' containment reference
-	 *         list.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDGroupContent_Content()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getGroup
-	 * @model type="DTDElementContent" opposite="group" containment="true"
-	 *        required="true"
-	 * @generated
-	 */
-	EList getContent();
-
-} // DTDGroupContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupKind.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupKind.java
deleted file mode 100644
index fb10de0..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupKind.java
+++ /dev/null
@@ -1,139 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.AbstractEnumerator;
-
-/**
- * <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>Group Kind</b></em>',
- * and utility methods for working with them. <!-- end-user-doc -->
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDGroupKind()
- * @model
- * @generated
- */
-public final class DTDGroupKind extends AbstractEnumerator {
-	/**
-	 * The '<em><b>SEQUENCE</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #SEQUENCE_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int SEQUENCE = 1;
-
-	/**
-	 * The '<em><b>CHOICE</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #CHOICE_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int CHOICE = 2;
-
-	/**
-	 * The '<em><b>SEQUENCE</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>SEQUENCE</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #SEQUENCE
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDGroupKind SEQUENCE_LITERAL = new DTDGroupKind(SEQUENCE, "SEQUENCE"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>CHOICE</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>CHOICE</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #CHOICE
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDGroupKind CHOICE_LITERAL = new DTDGroupKind(CHOICE, "CHOICE"); //$NON-NLS-1$
-
-	/**
-	 * An array of all the '<em><b>Group Kind</b></em>' enumerators. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private static final DTDGroupKind[] VALUES_ARRAY = new DTDGroupKind[]{SEQUENCE_LITERAL, CHOICE_LITERAL,};
-
-	/**
-	 * A public read-only list of all the '<em><b>Group Kind</b></em>'
-	 * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
-	/**
-	 * Returns the '<em><b>Group Kind</b></em>' literal with the
-	 * specified name. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static DTDGroupKind get(String name) {
-		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
-			DTDGroupKind result = VALUES_ARRAY[i];
-			if (result.toString().equals(name)) {
-				return result;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the '<em><b>Group Kind</b></em>' literal with the
-	 * specified value. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static DTDGroupKind get(int value) {
-		switch (value) {
-			case SEQUENCE :
-				return SEQUENCE_LITERAL;
-			case CHOICE :
-				return CHOICE_LITERAL;
-		}
-		return null;
-	}
-
-	/**
-	 * Only this class can construct instances. <!-- begin-user-doc --> <!--
-	 * end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private DTDGroupKind(int value, String name) {
-		super(value, name);
-	}
-
-} // DTDGroupKind
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDInternalEntity.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDInternalEntity.java
deleted file mode 100644
index a184a13..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDInternalEntity.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Internal Entity</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity#getValue <em>Value</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDInternalEntity()
- * @model
- * @generated
- */
-public interface DTDInternalEntity extends DTDEntityContent {
-	/**
-	 * Returns the value of the '<em><b>Value</b></em>' attribute. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Value</em>' attribute isn't clear, there
-	 * really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Value</em>' attribute.
-	 * @see #setValue(String)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDInternalEntity_Value()
-	 * @model
-	 * @generated
-	 */
-	String getValue();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity#getValue <em>Value</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Value</em>' attribute.
-	 * @see #getValue()
-	 * @generated
-	 */
-	void setValue(String value);
-
-} // DTDInternalEntity
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDLexicalInfo.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDLexicalInfo.java
deleted file mode 100644
index 392d23c..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDLexicalInfo.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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-public class DTDLexicalInfo implements DTDSourceOffset {
-	// Begin User Defined Methods
-	int startOffset;
-	int endOffset;
-
-	/**
-	 * Get the value of startOffset.
-	 * 
-	 * @return value of startOffset.
-	 */
-	public int getStartOffset() {
-		return startOffset;
-	}
-
-	/**
-	 * Set the value of startOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to startOffset.
-	 */
-	public void setStartOffset(int v) {
-		this.startOffset = v;
-	}
-
-	/**
-	 * Get the value of endOffset.
-	 * 
-	 * @return value of endOffset.
-	 */
-	public int getEndOffset() {
-		return endOffset;
-	}
-
-	/**
-	 * Set the value of endOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to endOffset.
-	 */
-	public void setEndOffset(int v) {
-
-		this.endOffset = v;
-	}
-
-	/**
-	 * Get the value of startOffset.
-	 * 
-	 * @return value of startOffset.
-	 */
-	protected int getStartOffsetGen() {
-
-		return startOffset;
-	}
-
-	/**
-	 * Set the value of startOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to startOffset.
-	 */
-	protected void setStartOffsetGen(int v) {
-
-		this.startOffset = v;
-	}
-
-	/**
-	 * Get the value of endOffset.
-	 * 
-	 * @return value of endOffset.
-	 */
-	protected int getEndOffsetGen() {
-
-		return endOffset;
-	}
-
-	/**
-	 * Set the value of endOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to endOffset.
-	 */
-	protected void setEndOffsetGen(int v) {
-
-
-		this.endOffset = v;
-	}
-}// DTDSourceOffset
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDNotation.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDNotation.java
deleted file mode 100644
index 8d23e2f..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDNotation.java
+++ /dev/null
@@ -1,140 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.ENamedElement;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Notation</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getSystemID <em>System ID</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getPublicID <em>Public ID</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getEntity <em>Entity</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDNotation()
- * @model
- * @generated
- */
-public interface DTDNotation extends ENamedElement, DTDContent, DTDObject, DTDSourceOffset {
-
-	/**
-	 * Returns the value of the '<em><b>Comment</b></em>' attribute. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Comment</em>' attribute isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Comment</em>' attribute.
-	 * @see #setComment(String)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDNotation_Comment()
-	 * @model
-	 * @generated
-	 */
-	String getComment();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getComment <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Comment</em>' attribute.
-	 * @see #getComment()
-	 * @generated
-	 */
-	void setComment(String value);
-
-	/**
-	 * Returns the value of the '<em><b>System ID</b></em>' attribute.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>System ID</em>' attribute isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>System ID</em>' attribute.
-	 * @see #setSystemID(String)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDNotation_SystemID()
-	 * @model
-	 * @generated
-	 */
-	String getSystemID();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getSystemID <em>System ID</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>System ID</em>' attribute.
-	 * @see #getSystemID()
-	 * @generated
-	 */
-	void setSystemID(String value);
-
-	/**
-	 * Returns the value of the '<em><b>Public ID</b></em>' attribute.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Public ID</em>' attribute isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Public ID</em>' attribute.
-	 * @see #setPublicID(String)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDNotation_PublicID()
-	 * @model
-	 * @generated
-	 */
-	String getPublicID();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getPublicID <em>Public ID</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Public ID</em>' attribute.
-	 * @see #getPublicID()
-	 * @generated
-	 */
-	void setPublicID(String value);
-
-	/**
-	 * Returns the value of the '<em><b>Entity</b></em>' reference list.
-	 * The list contents are of type {@link DTDExternalEntity}. It is
-	 * bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getNotation <em>Notation</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Entity</em>' reference list isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Entity</em>' reference list.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDNotation_Entity()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getNotation
-	 * @model type="DTDExternalEntity" opposite="notation"
-	 * @generated
-	 */
-	EList getEntity();
-
-} // DTDNotation
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDObject.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDObject.java
deleted file mode 100644
index 68384ba..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDObject.java
+++ /dev/null
@@ -1,21 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-// Ref package
-import org.eclipse.emf.ecore.EObject;
-
-public interface DTDObject extends EObject {
-	public String getPathname();
-
-	public DTDObject findObject(String relativePath);
-
-} // DTDObject
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDOccurrenceType.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDOccurrenceType.java
deleted file mode 100644
index 4439aa105..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDOccurrenceType.java
+++ /dev/null
@@ -1,193 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.AbstractEnumerator;
-
-/**
- * <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>Occurrence Type</b></em>',
- * and utility methods for working with them. <!-- end-user-doc -->
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDOccurrenceType()
- * @model
- * @generated
- */
-public final class DTDOccurrenceType extends AbstractEnumerator {
-	/**
-	 * The '<em><b>ONE</b></em>' literal value. <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #ONE_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int ONE = 49;
-
-	/**
-	 * The '<em><b>OPTIONAL</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #OPTIONAL_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int OPTIONAL = 63;
-
-	/**
-	 * The '<em><b>ONE OR MORE</b></em>' literal value. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #ONE_OR_MORE_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int ONE_OR_MORE = 43;
-
-	/**
-	 * The '<em><b>ZERO OR MORE</b></em>' literal value. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #ZERO_OR_MORE_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int ZERO_OR_MORE = 42;
-
-	/**
-	 * The '<em><b>ONE</b></em>' literal object. <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>ONE</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #ONE
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDOccurrenceType ONE_LITERAL = new DTDOccurrenceType(ONE, "ONE"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>OPTIONAL</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>OPTIONAL</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #OPTIONAL
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDOccurrenceType OPTIONAL_LITERAL = new DTDOccurrenceType(OPTIONAL, "OPTIONAL"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>ONE OR MORE</b></em>' literal object. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>ONE OR MORE</b></em>' literal object
-	 * isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #ONE_OR_MORE
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDOccurrenceType ONE_OR_MORE_LITERAL = new DTDOccurrenceType(ONE_OR_MORE, "ONE_OR_MORE"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>ZERO OR MORE</b></em>' literal object. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>ZERO OR MORE</b></em>' literal object
-	 * isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #ZERO_OR_MORE
-	 * @generated
-	 * @ordered
-	 */
-	public static final DTDOccurrenceType ZERO_OR_MORE_LITERAL = new DTDOccurrenceType(ZERO_OR_MORE, "ZERO_OR_MORE"); //$NON-NLS-1$
-
-	/**
-	 * An array of all the '<em><b>Occurrence Type</b></em>' enumerators.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private static final DTDOccurrenceType[] VALUES_ARRAY = new DTDOccurrenceType[]{ONE_LITERAL, OPTIONAL_LITERAL, ONE_OR_MORE_LITERAL, ZERO_OR_MORE_LITERAL,};
-
-	/**
-	 * A public read-only list of all the '<em><b>Occurrence Type</b></em>'
-	 * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
-	/**
-	 * Returns the '<em><b>Occurrence Type</b></em>' literal with the
-	 * specified name. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static DTDOccurrenceType get(String name) {
-		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
-			DTDOccurrenceType result = VALUES_ARRAY[i];
-			if (result.toString().equals(name)) {
-				return result;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the '<em><b>Occurrence Type</b></em>' literal with the
-	 * specified value. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static DTDOccurrenceType get(int value) {
-		switch (value) {
-			case ONE :
-				return ONE_LITERAL;
-			case OPTIONAL :
-				return OPTIONAL_LITERAL;
-			case ONE_OR_MORE :
-				return ONE_OR_MORE_LITERAL;
-			case ZERO_OR_MORE :
-				return ZERO_OR_MORE_LITERAL;
-		}
-		return null;
-	}
-
-	/**
-	 * Only this class can construct instances. <!-- begin-user-doc --> <!--
-	 * end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private DTDOccurrenceType(int value, String name) {
-		super(value, name);
-	}
-
-} // DTDOccurrenceType
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPCDataContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPCDataContent.java
deleted file mode 100644
index 043e554..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPCDataContent.java
+++ /dev/null
@@ -1,25 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>PC Data Content</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDPCDataContent()
- * @model
- * @generated
- */
-public interface DTDPCDataContent extends DTDElementContent {
-} // DTDPCDataContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPackage.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPackage.java
deleted file mode 100644
index e336a58..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPackage.java
+++ /dev/null
@@ -1,2392 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EcorePackage;
-
-/**
- * <!-- begin-user-doc --> The <b>Package</b> for the model. It contains
- * accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDFactory
- * @generated
- */
-public interface DTDPackage extends EPackage {
-
-	/**
-	 * The package name. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	String eNAME = "dtd"; //$NON-NLS-1$
-
-	/**
-	 * The package namespace URI. <!-- begin-user-doc --> <!-- end-user-doc
-	 * -->
-	 * 
-	 * @generated
-	 */
-	String eNS_URI = "http:///com/ibm/etools/dtd.ecore"; //$NON-NLS-1$
-
-	/**
-	 * The package namespace name. <!-- begin-user-doc --> <!-- end-user-doc
-	 * -->
-	 * 
-	 * @generated
-	 */
-	String eNS_PREFIX = "org.eclipse.wst.dtd.core.internal.emf"; //$NON-NLS-1$
-
-	/**
-	 * The singleton instance of the package. <!-- begin-user-doc --> <!--
-	 * end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	DTDPackage eINSTANCE = org.eclipse.wst.dtd.core.internal.emf.impl.DTDPackageImpl.init();
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementContentImpl <em>Element Content</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementContentImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDElementContent()
-	 * @generated
-	 */
-	int DTD_ELEMENT_CONTENT = 0;
-
-	/**
-	 * The feature id for the '<em><b>Group</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT_CONTENT__GROUP = 0;
-
-	/**
-	 * The feature id for the '<em><b>Element</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT_CONTENT__ELEMENT = 1;
-
-	/**
-	 * The number of structural features of the the '<em>Element Content</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT_CONTENT_FEATURE_COUNT = 2;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDRepeatableContentImpl <em>Repeatable Content</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDRepeatableContentImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDRepeatableContent()
-	 * @generated
-	 */
-	int DTD_REPEATABLE_CONTENT = 8;
-
-	/**
-	 * The feature id for the '<em><b>Group</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_REPEATABLE_CONTENT__GROUP = DTD_ELEMENT_CONTENT__GROUP;
-
-	/**
-	 * The feature id for the '<em><b>Element</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_REPEATABLE_CONTENT__ELEMENT = DTD_ELEMENT_CONTENT__ELEMENT;
-
-	/**
-	 * The feature id for the '<em><b>Occurrence</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_REPEATABLE_CONTENT__OCCURRENCE = DTD_ELEMENT_CONTENT_FEATURE_COUNT + 0;
-
-	/**
-	 * The number of structural features of the the '<em>Repeatable Content</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_REPEATABLE_CONTENT_FEATURE_COUNT = DTD_ELEMENT_CONTENT_FEATURE_COUNT + 1;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDGroupContentImpl <em>Group Content</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDGroupContentImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDGroupContent()
-	 * @generated
-	 */
-	int DTD_GROUP_CONTENT = 1;
-
-	/**
-	 * The feature id for the '<em><b>Group</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_GROUP_CONTENT__GROUP = DTD_REPEATABLE_CONTENT__GROUP;
-
-	/**
-	 * The feature id for the '<em><b>Element</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_GROUP_CONTENT__ELEMENT = DTD_REPEATABLE_CONTENT__ELEMENT;
-
-	/**
-	 * The feature id for the '<em><b>Occurrence</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_GROUP_CONTENT__OCCURRENCE = DTD_REPEATABLE_CONTENT__OCCURRENCE;
-
-	/**
-	 * The feature id for the '<em><b>Group Kind</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_GROUP_CONTENT__GROUP_KIND = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 0;
-
-	/**
-	 * The feature id for the '<em><b>Content</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_GROUP_CONTENT__CONTENT = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 1;
-
-	/**
-	 * The number of structural features of the the '<em>Group Content</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_GROUP_CONTENT_FEATURE_COUNT = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 2;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl <em>Attribute</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDAttribute()
-	 * @generated
-	 */
-	int DTD_ATTRIBUTE = 2;
-
-	/**
-	 * The feature id for the '<em><b>EAnnotations</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__EANNOTATIONS = EcorePackage.EATTRIBUTE__EANNOTATIONS;
-
-	/**
-	 * The feature id for the '<em><b>Name</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__NAME = EcorePackage.EATTRIBUTE__NAME;
-
-	/**
-	 * The feature id for the '<em><b>EType</b></em>' reference. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__ETYPE = EcorePackage.EATTRIBUTE__ETYPE;
-
-	/**
-	 * The feature id for the '<em><b>Changeable</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__CHANGEABLE = EcorePackage.EATTRIBUTE__CHANGEABLE;
-
-	/**
-	 * The feature id for the '<em><b>Volatile</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__VOLATILE = EcorePackage.EATTRIBUTE__VOLATILE;
-
-	/**
-	 * The feature id for the '<em><b>Transient</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__TRANSIENT = EcorePackage.EATTRIBUTE__TRANSIENT;
-
-	/**
-	 * The feature id for the '<em><b>Unique</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__UNIQUE = EcorePackage.EATTRIBUTE__UNIQUE;
-
-	/**
-	 * The feature id for the '<em><b>Default Value Literal</b></em>'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__DEFAULT_VALUE_LITERAL = EcorePackage.EATTRIBUTE__DEFAULT_VALUE_LITERAL;
-
-	/**
-	 * The feature id for the '<em><b>Default Value</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__DEFAULT_VALUE = EcorePackage.EATTRIBUTE__DEFAULT_VALUE;
-
-	/**
-	 * The feature id for the '<em><b>Lower Bound</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__LOWER_BOUND = EcorePackage.EATTRIBUTE__LOWER_BOUND;
-
-	/**
-	 * The feature id for the '<em><b>Upper Bound</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__UPPER_BOUND = EcorePackage.EATTRIBUTE__UPPER_BOUND;
-
-	/**
-	 * The feature id for the '<em><b>Many</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__MANY = EcorePackage.EATTRIBUTE__MANY;
-
-	/**
-	 * The feature id for the '<em><b>Required</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__REQUIRED = EcorePackage.EATTRIBUTE__REQUIRED;
-
-	/**
-	 * The feature id for the '<em><b>EContaining Class</b></em>'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__ECONTAINING_CLASS = EcorePackage.EATTRIBUTE__ECONTAINING_CLASS;
-
-	/**
-	 * The feature id for the '<em><b>Unsettable</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__UNSETTABLE = EcorePackage.EATTRIBUTE__UNSETTABLE;
-
-	/**
-	 * The feature id for the '<em><b>ID</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__ID = EcorePackage.EATTRIBUTE__ID;
-
-	/**
-	 * The feature id for the '<em><b>EAttribute Type</b></em>'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__EATTRIBUTE_TYPE = EcorePackage.EATTRIBUTE__EATTRIBUTE_TYPE;
-
-	/**
-	 * The feature id for the '<em><b>Comment</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__COMMENT = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 0;
-
-	/**
-	 * The feature id for the '<em><b>Default Kind</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__DEFAULT_KIND = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 1;
-
-	/**
-	 * The feature id for the '<em><b>Default Value String</b></em>'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__DEFAULT_VALUE_STRING = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 2;
-
-	/**
-	 * The feature id for the '<em><b>Attribute Name Referenced Entity</b></em>'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 3;
-
-	/**
-	 * The feature id for the '<em><b>Attribute Type Referenced Entity</b></em>'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 4;
-
-	/**
-	 * The feature id for the '<em><b>DTD Element</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE__DTD_ELEMENT = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 5;
-
-	/**
-	 * The number of structural features of the the '<em>Attribute</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ATTRIBUTE_FEATURE_COUNT = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 6;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementImpl <em>Element</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDElement()
-	 * @generated
-	 */
-	int DTD_ELEMENT = 3;
-
-	/**
-	 * The feature id for the '<em><b>EAnnotations</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__EANNOTATIONS = EcorePackage.ECLASS__EANNOTATIONS;
-
-	/**
-	 * The feature id for the '<em><b>Name</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__NAME = EcorePackage.ECLASS__NAME;
-
-	/**
-	 * The feature id for the '<em><b>Instance Class Name</b></em>'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__INSTANCE_CLASS_NAME = EcorePackage.ECLASS__INSTANCE_CLASS_NAME;
-
-	/**
-	 * The feature id for the '<em><b>Instance Class</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__INSTANCE_CLASS = EcorePackage.ECLASS__INSTANCE_CLASS;
-
-	/**
-	 * The feature id for the '<em><b>Default Value</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__DEFAULT_VALUE = EcorePackage.ECLASS__DEFAULT_VALUE;
-
-	/**
-	 * The feature id for the '<em><b>EPackage</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__EPACKAGE = EcorePackage.ECLASS__EPACKAGE;
-
-	/**
-	 * The feature id for the '<em><b>Abstract</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__ABSTRACT = EcorePackage.ECLASS__ABSTRACT;
-
-	/**
-	 * The feature id for the '<em><b>Interface</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__INTERFACE = EcorePackage.ECLASS__INTERFACE;
-
-	/**
-	 * The feature id for the '<em><b>ESuper Types</b></em>' reference
-	 * list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__ESUPER_TYPES = EcorePackage.ECLASS__ESUPER_TYPES;
-
-	/**
-	 * The feature id for the '<em><b>EOperations</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__EOPERATIONS = EcorePackage.ECLASS__EOPERATIONS;
-
-	/**
-	 * The feature id for the '<em><b>EAll Attributes</b></em>' reference
-	 * list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__EALL_ATTRIBUTES = EcorePackage.ECLASS__EALL_ATTRIBUTES;
-
-	/**
-	 * The feature id for the '<em><b>EAll References</b></em>' reference
-	 * list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__EALL_REFERENCES = EcorePackage.ECLASS__EALL_REFERENCES;
-
-	/**
-	 * The feature id for the '<em><b>EReferences</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__EREFERENCES = EcorePackage.ECLASS__EREFERENCES;
-
-	/**
-	 * The feature id for the '<em><b>EAttributes</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__EATTRIBUTES = EcorePackage.ECLASS__EATTRIBUTES;
-
-	/**
-	 * The feature id for the '<em><b>EAll Containments</b></em>'
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__EALL_CONTAINMENTS = EcorePackage.ECLASS__EALL_CONTAINMENTS;
-
-	/**
-	 * The feature id for the '<em><b>EAll Operations</b></em>' reference
-	 * list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__EALL_OPERATIONS = EcorePackage.ECLASS__EALL_OPERATIONS;
-
-	/**
-	 * The feature id for the '<em><b>EAll Structural Features</b></em>'
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__EALL_STRUCTURAL_FEATURES = EcorePackage.ECLASS__EALL_STRUCTURAL_FEATURES;
-
-	/**
-	 * The feature id for the '<em><b>EAll Super Types</b></em>'
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__EALL_SUPER_TYPES = EcorePackage.ECLASS__EALL_SUPER_TYPES;
-
-	/**
-	 * The feature id for the '<em><b>EID Attribute</b></em>' reference.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__EID_ATTRIBUTE = EcorePackage.ECLASS__EID_ATTRIBUTE;
-
-	/**
-	 * The feature id for the '<em><b>DTD File</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__DTD_FILE = EcorePackage.ECLASS_FEATURE_COUNT + 0;
-
-	/**
-	 * The feature id for the '<em><b>Comment</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__COMMENT = EcorePackage.ECLASS_FEATURE_COUNT + 1;
-
-	/**
-	 * The feature id for the '<em><b>Content</b></em>' containment
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__CONTENT = EcorePackage.ECLASS_FEATURE_COUNT + 2;
-
-	/**
-	 * The feature id for the '<em><b>DTD Attribute</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT__DTD_ATTRIBUTE = EcorePackage.ECLASS_FEATURE_COUNT + 3;
-
-	/**
-	 * The number of structural features of the the '<em>Element</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT_FEATURE_COUNT = EcorePackage.ECLASS_FEATURE_COUNT + 4;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEmptyContentImpl <em>Empty Content</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEmptyContentImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDEmptyContent()
-	 * @generated
-	 */
-	int DTD_EMPTY_CONTENT = 4;
-
-	/**
-	 * The feature id for the '<em><b>Group</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_EMPTY_CONTENT__GROUP = DTD_ELEMENT_CONTENT__GROUP;
-
-	/**
-	 * The feature id for the '<em><b>Element</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_EMPTY_CONTENT__ELEMENT = DTD_ELEMENT_CONTENT__ELEMENT;
-
-	/**
-	 * The number of structural features of the the '<em>Empty Content</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_EMPTY_CONTENT_FEATURE_COUNT = DTD_ELEMENT_CONTENT_FEATURE_COUNT + 0;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAnyContentImpl <em>Any Content</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAnyContentImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDAnyContent()
-	 * @generated
-	 */
-	int DTD_ANY_CONTENT = 5;
-
-	/**
-	 * The feature id for the '<em><b>Group</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ANY_CONTENT__GROUP = DTD_ELEMENT_CONTENT__GROUP;
-
-	/**
-	 * The feature id for the '<em><b>Element</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ANY_CONTENT__ELEMENT = DTD_ELEMENT_CONTENT__ELEMENT;
-
-	/**
-	 * The number of structural features of the the '<em>Any Content</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ANY_CONTENT_FEATURE_COUNT = DTD_ELEMENT_CONTENT_FEATURE_COUNT + 0;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPCDataContentImpl <em>PC Data Content</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPCDataContentImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDPCDataContent()
-	 * @generated
-	 */
-	int DTD_PC_DATA_CONTENT = 6;
-
-	/**
-	 * The feature id for the '<em><b>Group</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_PC_DATA_CONTENT__GROUP = DTD_ELEMENT_CONTENT__GROUP;
-
-	/**
-	 * The feature id for the '<em><b>Element</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_PC_DATA_CONTENT__ELEMENT = DTD_ELEMENT_CONTENT__ELEMENT;
-
-	/**
-	 * The number of structural features of the the '<em>PC Data Content</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_PC_DATA_CONTENT_FEATURE_COUNT = DTD_ELEMENT_CONTENT_FEATURE_COUNT + 0;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementReferenceContentImpl <em>Element Reference Content</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementReferenceContentImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDElementReferenceContent()
-	 * @generated
-	 */
-	int DTD_ELEMENT_REFERENCE_CONTENT = 7;
-
-	/**
-	 * The feature id for the '<em><b>Group</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT_REFERENCE_CONTENT__GROUP = DTD_REPEATABLE_CONTENT__GROUP;
-
-	/**
-	 * The feature id for the '<em><b>Element</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT = DTD_REPEATABLE_CONTENT__ELEMENT;
-
-	/**
-	 * The feature id for the '<em><b>Occurrence</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT_REFERENCE_CONTENT__OCCURRENCE = DTD_REPEATABLE_CONTENT__OCCURRENCE;
-
-	/**
-	 * The feature id for the '<em><b>Referenced Element</b></em>'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 0;
-
-	/**
-	 * The number of structural features of the the '<em>Element Reference Content</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ELEMENT_REFERENCE_CONTENT_FEATURE_COUNT = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 1;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDFileImpl <em>File</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDFileImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDFile()
-	 * @generated
-	 */
-	int DTD_FILE = 9;
-
-	/**
-	 * The feature id for the '<em><b>Comment</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_FILE__COMMENT = 0;
-
-	/**
-	 * The feature id for the '<em><b>Parse Error</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_FILE__PARSE_ERROR = 1;
-
-	/**
-	 * The feature id for the '<em><b>DTD Content</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_FILE__DTD_CONTENT = 2;
-
-	/**
-	 * The feature id for the '<em><b>DTD Enumeration Type</b></em>'
-	 * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc
-	 * -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_FILE__DTD_ENUMERATION_TYPE = 3;
-
-	/**
-	 * The number of structural features of the the '<em>File</em>' class.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_FILE_FEATURE_COUNT = 4;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDBasicTypeImpl <em>Basic Type</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDBasicTypeImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDBasicType()
-	 * @generated
-	 */
-	int DTD_BASIC_TYPE = 10;
-
-	/**
-	 * The feature id for the '<em><b>EAnnotations</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__EANNOTATIONS = EcorePackage.ECLASS__EANNOTATIONS;
-
-	/**
-	 * The feature id for the '<em><b>Name</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__NAME = EcorePackage.ECLASS__NAME;
-
-	/**
-	 * The feature id for the '<em><b>Instance Class Name</b></em>'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__INSTANCE_CLASS_NAME = EcorePackage.ECLASS__INSTANCE_CLASS_NAME;
-
-	/**
-	 * The feature id for the '<em><b>Instance Class</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__INSTANCE_CLASS = EcorePackage.ECLASS__INSTANCE_CLASS;
-
-	/**
-	 * The feature id for the '<em><b>Default Value</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__DEFAULT_VALUE = EcorePackage.ECLASS__DEFAULT_VALUE;
-
-	/**
-	 * The feature id for the '<em><b>EPackage</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__EPACKAGE = EcorePackage.ECLASS__EPACKAGE;
-
-	/**
-	 * The feature id for the '<em><b>Abstract</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__ABSTRACT = EcorePackage.ECLASS__ABSTRACT;
-
-	/**
-	 * The feature id for the '<em><b>Interface</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__INTERFACE = EcorePackage.ECLASS__INTERFACE;
-
-	/**
-	 * The feature id for the '<em><b>ESuper Types</b></em>' reference
-	 * list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__ESUPER_TYPES = EcorePackage.ECLASS__ESUPER_TYPES;
-
-	/**
-	 * The feature id for the '<em><b>EOperations</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__EOPERATIONS = EcorePackage.ECLASS__EOPERATIONS;
-
-	/**
-	 * The feature id for the '<em><b>EAll Attributes</b></em>' reference
-	 * list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__EALL_ATTRIBUTES = EcorePackage.ECLASS__EALL_ATTRIBUTES;
-
-	/**
-	 * The feature id for the '<em><b>EAll References</b></em>' reference
-	 * list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__EALL_REFERENCES = EcorePackage.ECLASS__EALL_REFERENCES;
-
-	/**
-	 * The feature id for the '<em><b>EReferences</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__EREFERENCES = EcorePackage.ECLASS__EREFERENCES;
-
-	/**
-	 * The feature id for the '<em><b>EAttributes</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__EATTRIBUTES = EcorePackage.ECLASS__EATTRIBUTES;
-
-	/**
-	 * The feature id for the '<em><b>EAll Containments</b></em>'
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__EALL_CONTAINMENTS = EcorePackage.ECLASS__EALL_CONTAINMENTS;
-
-	/**
-	 * The feature id for the '<em><b>EAll Operations</b></em>' reference
-	 * list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__EALL_OPERATIONS = EcorePackage.ECLASS__EALL_OPERATIONS;
-
-	/**
-	 * The feature id for the '<em><b>EAll Structural Features</b></em>'
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__EALL_STRUCTURAL_FEATURES = EcorePackage.ECLASS__EALL_STRUCTURAL_FEATURES;
-
-	/**
-	 * The feature id for the '<em><b>EAll Super Types</b></em>'
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__EALL_SUPER_TYPES = EcorePackage.ECLASS__EALL_SUPER_TYPES;
-
-	/**
-	 * The feature id for the '<em><b>EID Attribute</b></em>' reference.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__EID_ATTRIBUTE = EcorePackage.ECLASS__EID_ATTRIBUTE;
-
-	/**
-	 * The feature id for the '<em><b>Kind</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE__KIND = EcorePackage.ECLASS_FEATURE_COUNT + 0;
-
-	/**
-	 * The number of structural features of the the '<em>Basic Type</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_BASIC_TYPE_FEATURE_COUNT = EcorePackage.ECLASS_FEATURE_COUNT + 1;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEnumerationTypeImpl <em>Enumeration Type</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEnumerationTypeImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDEnumerationType()
-	 * @generated
-	 */
-	int DTD_ENUMERATION_TYPE = 11;
-
-	/**
-	 * The feature id for the '<em><b>EAnnotations</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENUMERATION_TYPE__EANNOTATIONS = EcorePackage.EENUM__EANNOTATIONS;
-
-	/**
-	 * The feature id for the '<em><b>Name</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENUMERATION_TYPE__NAME = EcorePackage.EENUM__NAME;
-
-	/**
-	 * The feature id for the '<em><b>Instance Class Name</b></em>'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENUMERATION_TYPE__INSTANCE_CLASS_NAME = EcorePackage.EENUM__INSTANCE_CLASS_NAME;
-
-	/**
-	 * The feature id for the '<em><b>Instance Class</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENUMERATION_TYPE__INSTANCE_CLASS = EcorePackage.EENUM__INSTANCE_CLASS;
-
-	/**
-	 * The feature id for the '<em><b>Default Value</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENUMERATION_TYPE__DEFAULT_VALUE = EcorePackage.EENUM__DEFAULT_VALUE;
-
-	/**
-	 * The feature id for the '<em><b>EPackage</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENUMERATION_TYPE__EPACKAGE = EcorePackage.EENUM__EPACKAGE;
-
-	/**
-	 * The feature id for the '<em><b>Serializable</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENUMERATION_TYPE__SERIALIZABLE = EcorePackage.EENUM__SERIALIZABLE;
-
-	/**
-	 * The feature id for the '<em><b>ELiterals</b></em>' containment
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENUMERATION_TYPE__ELITERALS = EcorePackage.EENUM__ELITERALS;
-
-	/**
-	 * The feature id for the '<em><b>Kind</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENUMERATION_TYPE__KIND = EcorePackage.EENUM_FEATURE_COUNT + 0;
-
-	/**
-	 * The feature id for the '<em><b>DTD File</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENUMERATION_TYPE__DTD_FILE = EcorePackage.EENUM_FEATURE_COUNT + 1;
-
-	/**
-	 * The number of structural features of the the '<em>Enumeration Type</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENUMERATION_TYPE_FEATURE_COUNT = EcorePackage.EENUM_FEATURE_COUNT + 2;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDContentImpl <em>Content</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDContentImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDContent()
-	 * @generated
-	 */
-	int DTD_CONTENT = 19;
-
-	/**
-	 * The feature id for the '<em><b>DTD File</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_CONTENT__DTD_FILE = 0;
-
-	/**
-	 * The number of structural features of the the '<em>Content</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_CONTENT_FEATURE_COUNT = 1;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDNotationImpl <em>Notation</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDNotationImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDNotation()
-	 * @generated
-	 */
-	int DTD_NOTATION = 12;
-
-	/**
-	 * The feature id for the '<em><b>DTD File</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_NOTATION__DTD_FILE = DTD_CONTENT__DTD_FILE;
-
-	/**
-	 * The feature id for the '<em><b>Comment</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_NOTATION__COMMENT = DTD_CONTENT_FEATURE_COUNT + 0;
-
-	/**
-	 * The feature id for the '<em><b>System ID</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_NOTATION__SYSTEM_ID = DTD_CONTENT_FEATURE_COUNT + 1;
-
-	/**
-	 * The feature id for the '<em><b>Public ID</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_NOTATION__PUBLIC_ID = DTD_CONTENT_FEATURE_COUNT + 2;
-
-	/**
-	 * The feature id for the '<em><b>Entity</b></em>' reference list.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_NOTATION__ENTITY = DTD_CONTENT_FEATURE_COUNT + 3;
-
-	/**
-	 * The number of structural features of the the '<em>Notation</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_NOTATION_FEATURE_COUNT = DTD_CONTENT_FEATURE_COUNT + 4;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl <em>Entity</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDEntity()
-	 * @generated
-	 */
-	int DTD_ENTITY = 13;
-
-	/**
-	 * The feature id for the '<em><b>DTD File</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY__DTD_FILE = DTD_CONTENT__DTD_FILE;
-
-	/**
-	 * The feature id for the '<em><b>Comment</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY__COMMENT = DTD_CONTENT_FEATURE_COUNT + 0;
-
-	/**
-	 * The feature id for the '<em><b>Parameter Entity</b></em>'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY__PARAMETER_ENTITY = DTD_CONTENT_FEATURE_COUNT + 1;
-
-	/**
-	 * The feature id for the '<em><b>Content</b></em>' containment
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY__CONTENT = DTD_CONTENT_FEATURE_COUNT + 2;
-
-	/**
-	 * The feature id for the '<em><b>Parm Entity Ref</b></em>'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY__PARM_ENTITY_REF = DTD_CONTENT_FEATURE_COUNT + 3;
-
-	/**
-	 * The feature id for the '<em><b>Entity Reference</b></em>'
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY__ENTITY_REFERENCE = DTD_CONTENT_FEATURE_COUNT + 4;
-
-	/**
-	 * The feature id for the '<em><b>Attribute Name Reference</b></em>'
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE = DTD_CONTENT_FEATURE_COUNT + 5;
-
-	/**
-	 * The feature id for the '<em><b>Attribute Type Reference</b></em>'
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE = DTD_CONTENT_FEATURE_COUNT + 6;
-
-	/**
-	 * The number of structural features of the the '<em>Entity</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY_FEATURE_COUNT = DTD_CONTENT_FEATURE_COUNT + 7;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityContentImpl <em>Entity Content</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityContentImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDEntityContent()
-	 * @generated
-	 */
-	int DTD_ENTITY_CONTENT = 14;
-
-	/**
-	 * The feature id for the '<em><b>DTD Entity</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY_CONTENT__DTD_ENTITY = 0;
-
-	/**
-	 * The number of structural features of the the '<em>Entity Content</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY_CONTENT_FEATURE_COUNT = 1;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDExternalEntityImpl <em>External Entity</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDExternalEntityImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDExternalEntity()
-	 * @generated
-	 */
-	int DTD_EXTERNAL_ENTITY = 15;
-
-	/**
-	 * The feature id for the '<em><b>DTD Entity</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_EXTERNAL_ENTITY__DTD_ENTITY = DTD_ENTITY_CONTENT__DTD_ENTITY;
-
-	/**
-	 * The feature id for the '<em><b>System ID</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_EXTERNAL_ENTITY__SYSTEM_ID = DTD_ENTITY_CONTENT_FEATURE_COUNT + 0;
-
-	/**
-	 * The feature id for the '<em><b>Public ID</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_EXTERNAL_ENTITY__PUBLIC_ID = DTD_ENTITY_CONTENT_FEATURE_COUNT + 1;
-
-	/**
-	 * The feature id for the '<em><b>Notation</b></em>' reference. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_EXTERNAL_ENTITY__NOTATION = DTD_ENTITY_CONTENT_FEATURE_COUNT + 2;
-
-	/**
-	 * The feature id for the '<em><b>Entity Referenced From Another File</b></em>'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE = DTD_ENTITY_CONTENT_FEATURE_COUNT + 3;
-
-	/**
-	 * The number of structural features of the the '<em>External Entity</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_EXTERNAL_ENTITY_FEATURE_COUNT = DTD_ENTITY_CONTENT_FEATURE_COUNT + 4;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDInternalEntityImpl <em>Internal Entity</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDInternalEntityImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDInternalEntity()
-	 * @generated
-	 */
-	int DTD_INTERNAL_ENTITY = 16;
-
-	/**
-	 * The feature id for the '<em><b>DTD Entity</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_INTERNAL_ENTITY__DTD_ENTITY = DTD_ENTITY_CONTENT__DTD_ENTITY;
-
-	/**
-	 * The feature id for the '<em><b>Value</b></em>' attribute. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_INTERNAL_ENTITY__VALUE = DTD_ENTITY_CONTENT_FEATURE_COUNT + 0;
-
-	/**
-	 * The number of structural features of the the '<em>Internal Entity</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_INTERNAL_ENTITY_FEATURE_COUNT = DTD_ENTITY_CONTENT_FEATURE_COUNT + 1;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDParameterEntityReferenceImpl <em>Parameter Entity Reference</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDParameterEntityReferenceImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDParameterEntityReference()
-	 * @generated
-	 */
-	int DTD_PARAMETER_ENTITY_REFERENCE = 17;
-
-	/**
-	 * The feature id for the '<em><b>DTD File</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE = DTD_CONTENT__DTD_FILE;
-
-	/**
-	 * The feature id for the '<em><b>Entity</b></em>' reference. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_PARAMETER_ENTITY_REFERENCE__ENTITY = DTD_CONTENT_FEATURE_COUNT + 0;
-
-	/**
-	 * The number of structural features of the the '<em>Parameter Entity Reference</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_PARAMETER_ENTITY_REFERENCE_FEATURE_COUNT = DTD_CONTENT_FEATURE_COUNT + 1;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityReferenceContentImpl <em>Entity Reference Content</em>}'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityReferenceContentImpl
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDEntityReferenceContent()
-	 * @generated
-	 */
-	int DTD_ENTITY_REFERENCE_CONTENT = 18;
-
-	/**
-	 * The feature id for the '<em><b>Group</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY_REFERENCE_CONTENT__GROUP = DTD_REPEATABLE_CONTENT__GROUP;
-
-	/**
-	 * The feature id for the '<em><b>Element</b></em>' container
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY_REFERENCE_CONTENT__ELEMENT = DTD_REPEATABLE_CONTENT__ELEMENT;
-
-	/**
-	 * The feature id for the '<em><b>Occurrence</b></em>' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY_REFERENCE_CONTENT__OCCURRENCE = DTD_REPEATABLE_CONTENT__OCCURRENCE;
-
-	/**
-	 * The feature id for the '<em><b>Element Referenced Entity</b></em>'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 0;
-
-	/**
-	 * The number of structural features of the the '<em>Entity Reference Content</em>'
-	 * class. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 * @ordered
-	 */
-	int DTD_ENTITY_REFERENCE_CONTENT_FEATURE_COUNT = DTD_REPEATABLE_CONTENT_FEATURE_COUNT + 1;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType <em>Occurrence Type</em>}'
-	 * enum. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDOccurrenceType()
-	 * @generated
-	 */
-	int DTD_OCCURRENCE_TYPE = 20;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind <em>Default Kind</em>}'
-	 * enum. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDDefaultKind()
-	 * @generated
-	 */
-	int DTD_DEFAULT_KIND = 21;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind <em>Basic Type Kind</em>}'
-	 * enum. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDBasicTypeKind()
-	 * @generated
-	 */
-	int DTD_BASIC_TYPE_KIND = 22;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind <em>Enum Group Kind</em>}'
-	 * enum. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDEnumGroupKind()
-	 * @generated
-	 */
-	int DTD_ENUM_GROUP_KIND = 23;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind <em>Group Kind</em>}'
-	 * enum. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getDTDGroupKind()
-	 * @generated
-	 */
-	int DTD_GROUP_KIND = 24;
-
-	/**
-	 * The meta object id for the '{@link org.eclipse.wst.dtd.core.internal.emf.XMLSchemaDefinedType <em>XML Schema Defined Type</em>}'
-	 * enum. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.wst.dtd.core.internal.emf.XMLSchemaDefinedType
-	 * @see org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDPackageImpl#getXMLSchemaDefinedType()
-	 * @generated
-	 */
-	int XML_SCHEMA_DEFINED_TYPE = 25;
-
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent <em>Element Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Element Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementContent
-	 * @generated
-	 */
-	EClass getDTDElementContent();
-
-	/**
-	 * Returns the meta object for the container reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getGroup <em>Group</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the container reference '<em>Group</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getGroup()
-	 * @see #getDTDElementContent()
-	 * @generated
-	 */
-	EReference getDTDElementContent_Group();
-
-	/**
-	 * Returns the meta object for the container reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getElement <em>Element</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the container reference '<em>Element</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementContent#getElement()
-	 * @see #getDTDElementContent()
-	 * @generated
-	 */
-	EReference getDTDElementContent_Element();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent <em>Group Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Group Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent
-	 * @generated
-	 */
-	EClass getDTDGroupContent();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getGroupKind <em>Group Kind</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Group Kind</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getGroupKind()
-	 * @see #getDTDGroupContent()
-	 * @generated
-	 */
-	EAttribute getDTDGroupContent_GroupKind();
-
-	/**
-	 * Returns the meta object for the containment reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getContent <em>Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the containment reference list '<em>Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent#getContent()
-	 * @see #getDTDGroupContent()
-	 * @generated
-	 */
-	EReference getDTDGroupContent_Content();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute <em>Attribute</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Attribute</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute
-	 * @generated
-	 */
-	EClass getDTDAttribute();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getComment <em>Comment</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Comment</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getComment()
-	 * @see #getDTDAttribute()
-	 * @generated
-	 */
-	EAttribute getDTDAttribute_Comment();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultKind <em>Default Kind</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Default Kind</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultKind()
-	 * @see #getDTDAttribute()
-	 * @generated
-	 */
-	EAttribute getDTDAttribute_DefaultKind();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultValueString <em>Default Value String</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Default Value String</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDefaultValueString()
-	 * @see #getDTDAttribute()
-	 * @generated
-	 */
-	EAttribute getDTDAttribute_DefaultValueString();
-
-	/**
-	 * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeNameReferencedEntity <em>Attribute Name Referenced Entity</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the reference '<em>Attribute Name Referenced Entity</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeNameReferencedEntity()
-	 * @see #getDTDAttribute()
-	 * @generated
-	 */
-	EReference getDTDAttribute_AttributeNameReferencedEntity();
-
-	/**
-	 * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeTypeReferencedEntity <em>Attribute Type Referenced Entity</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the reference '<em>Attribute Type Referenced Entity</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getAttributeTypeReferencedEntity()
-	 * @see #getDTDAttribute()
-	 * @generated
-	 */
-	EReference getDTDAttribute_AttributeTypeReferencedEntity();
-
-	/**
-	 * Returns the meta object for the container reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDTDElement <em>DTD Element</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the container reference '<em>DTD Element</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDAttribute#getDTDElement()
-	 * @see #getDTDAttribute()
-	 * @generated
-	 */
-	EReference getDTDAttribute_DTDElement();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement <em>Element</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Element</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDElement
-	 * @generated
-	 */
-	EClass getDTDElement();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getComment <em>Comment</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Comment</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDElement#getComment()
-	 * @see #getDTDElement()
-	 * @generated
-	 */
-	EAttribute getDTDElement_Comment();
-
-	/**
-	 * Returns the meta object for the containment reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getContent <em>Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the containment reference '<em>Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDElement#getContent()
-	 * @see #getDTDElement()
-	 * @generated
-	 */
-	EReference getDTDElement_Content();
-
-	/**
-	 * Returns the meta object for the containment reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElement#getDTDAttribute <em>DTD Attribute</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the containment reference list '<em>DTD Attribute</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDElement#getDTDAttribute()
-	 * @see #getDTDElement()
-	 * @generated
-	 */
-	EReference getDTDElement_DTDAttribute();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent <em>Empty Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Empty Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent
-	 * @generated
-	 */
-	EClass getDTDEmptyContent();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent <em>Any Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Any Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent
-	 * @generated
-	 */
-	EClass getDTDAnyContent();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent <em>PC Data Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>PC Data Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent
-	 * @generated
-	 */
-	EClass getDTDPCDataContent();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent <em>Element Reference Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Element Reference Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent
-	 * @generated
-	 */
-	EClass getDTDElementReferenceContent();
-
-	/**
-	 * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent#getReferencedElement <em>Referenced Element</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the reference '<em>Referenced Element</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent#getReferencedElement()
-	 * @see #getDTDElementReferenceContent()
-	 * @generated
-	 */
-	EReference getDTDElementReferenceContent_ReferencedElement();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent <em>Repeatable Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Repeatable Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent
-	 * @generated
-	 */
-	EClass getDTDRepeatableContent();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent#getOccurrence <em>Occurrence</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Occurrence</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent#getOccurrence()
-	 * @see #getDTDRepeatableContent()
-	 * @generated
-	 */
-	EAttribute getDTDRepeatableContent_Occurrence();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile <em>File</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>File</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile
-	 * @generated
-	 */
-	EClass getDTDFile();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getComment <em>Comment</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Comment</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile#getComment()
-	 * @see #getDTDFile()
-	 * @generated
-	 */
-	EAttribute getDTDFile_Comment();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#isParseError <em>Parse Error</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Parse Error</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile#isParseError()
-	 * @see #getDTDFile()
-	 * @generated
-	 */
-	EAttribute getDTDFile_ParseError();
-
-	/**
-	 * Returns the meta object for the containment reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDContent <em>DTD Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the containment reference list '<em>DTD Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDContent()
-	 * @see #getDTDFile()
-	 * @generated
-	 */
-	EReference getDTDFile_DTDContent();
-
-	/**
-	 * Returns the meta object for the containment reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDEnumerationType <em>DTD Enumeration Type</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the containment reference list '<em>DTD Enumeration Type</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDFile#getDTDEnumerationType()
-	 * @see #getDTDFile()
-	 * @generated
-	 */
-	EReference getDTDFile_DTDEnumerationType();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicType <em>Basic Type</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Basic Type</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDBasicType
-	 * @generated
-	 */
-	EClass getDTDBasicType();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicType#getKind <em>Kind</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Kind</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDBasicType#getKind()
-	 * @see #getDTDBasicType()
-	 * @generated
-	 */
-	EAttribute getDTDBasicType_Kind();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType <em>Enumeration Type</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Enumeration Type</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType
-	 * @generated
-	 */
-	EClass getDTDEnumerationType();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getKind <em>Kind</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Kind</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getKind()
-	 * @see #getDTDEnumerationType()
-	 * @generated
-	 */
-	EAttribute getDTDEnumerationType_Kind();
-
-	/**
-	 * Returns the meta object for the container reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getDTDFile <em>DTD File</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the container reference '<em>DTD File</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType#getDTDFile()
-	 * @see #getDTDEnumerationType()
-	 * @generated
-	 */
-	EReference getDTDEnumerationType_DTDFile();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation <em>Notation</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Notation</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDNotation
-	 * @generated
-	 */
-	EClass getDTDNotation();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getComment <em>Comment</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Comment</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getComment()
-	 * @see #getDTDNotation()
-	 * @generated
-	 */
-	EAttribute getDTDNotation_Comment();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getSystemID <em>System ID</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>System ID</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getSystemID()
-	 * @see #getDTDNotation()
-	 * @generated
-	 */
-	EAttribute getDTDNotation_SystemID();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getPublicID <em>Public ID</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Public ID</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getPublicID()
-	 * @see #getDTDNotation()
-	 * @generated
-	 */
-	EAttribute getDTDNotation_PublicID();
-
-	/**
-	 * Returns the meta object for the reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getEntity <em>Entity</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the reference list '<em>Entity</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDNotation#getEntity()
-	 * @see #getDTDNotation()
-	 * @generated
-	 */
-	EReference getDTDNotation_Entity();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity <em>Entity</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Entity</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity
-	 * @generated
-	 */
-	EClass getDTDEntity();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getComment <em>Comment</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Comment</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getComment()
-	 * @see #getDTDEntity()
-	 * @generated
-	 */
-	EAttribute getDTDEntity_Comment();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#isParameterEntity <em>Parameter Entity</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Parameter Entity</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#isParameterEntity()
-	 * @see #getDTDEntity()
-	 * @generated
-	 */
-	EAttribute getDTDEntity_ParameterEntity();
-
-	/**
-	 * Returns the meta object for the containment reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getContent <em>Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the containment reference '<em>Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getContent()
-	 * @see #getDTDEntity()
-	 * @generated
-	 */
-	EReference getDTDEntity_Content();
-
-	/**
-	 * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getParmEntityRef <em>Parm Entity Ref</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the reference '<em>Parm Entity Ref</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getParmEntityRef()
-	 * @see #getDTDEntity()
-	 * @generated
-	 */
-	EReference getDTDEntity_ParmEntityRef();
-
-	/**
-	 * Returns the meta object for the reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getEntityReference <em>Entity Reference</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the reference list '<em>Entity Reference</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getEntityReference()
-	 * @see #getDTDEntity()
-	 * @generated
-	 */
-	EReference getDTDEntity_EntityReference();
-
-	/**
-	 * Returns the meta object for the reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeNameReference <em>Attribute Name Reference</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the reference list '<em>Attribute Name Reference</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeNameReference()
-	 * @see #getDTDEntity()
-	 * @generated
-	 */
-	EReference getDTDEntity_AttributeNameReference();
-
-	/**
-	 * Returns the meta object for the reference list '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeTypeReference <em>Attribute Type Reference</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the reference list '<em>Attribute Type Reference</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getAttributeTypeReference()
-	 * @see #getDTDEntity()
-	 * @generated
-	 */
-	EReference getDTDEntity_AttributeTypeReference();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent <em>Entity Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Entity Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent
-	 * @generated
-	 */
-	EClass getDTDEntityContent();
-
-	/**
-	 * Returns the meta object for the container reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent#getDTDEntity <em>DTD Entity</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the container reference '<em>DTD Entity</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent#getDTDEntity()
-	 * @see #getDTDEntityContent()
-	 * @generated
-	 */
-	EReference getDTDEntityContent_DTDEntity();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity <em>External Entity</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>External Entity</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity
-	 * @generated
-	 */
-	EClass getDTDExternalEntity();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getSystemID <em>System ID</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>System ID</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getSystemID()
-	 * @see #getDTDExternalEntity()
-	 * @generated
-	 */
-	EAttribute getDTDExternalEntity_SystemID();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getPublicID <em>Public ID</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Public ID</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getPublicID()
-	 * @see #getDTDExternalEntity()
-	 * @generated
-	 */
-	EAttribute getDTDExternalEntity_PublicID();
-
-	/**
-	 * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getNotation <em>Notation</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the reference '<em>Notation</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getNotation()
-	 * @see #getDTDExternalEntity()
-	 * @generated
-	 */
-	EReference getDTDExternalEntity_Notation();
-
-	/**
-	 * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getEntityReferencedFromAnotherFile <em>Entity Referenced From Another File</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the reference '<em>Entity Referenced From Another File</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity#getEntityReferencedFromAnotherFile()
-	 * @see #getDTDExternalEntity()
-	 * @generated
-	 */
-	EReference getDTDExternalEntity_EntityReferencedFromAnotherFile();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity <em>Internal Entity</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Internal Entity</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity
-	 * @generated
-	 */
-	EClass getDTDInternalEntity();
-
-	/**
-	 * Returns the meta object for the attribute '{@link org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity#getValue <em>Value</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the attribute '<em>Value</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity#getValue()
-	 * @see #getDTDInternalEntity()
-	 * @generated
-	 */
-	EAttribute getDTDInternalEntity_Value();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference <em>Parameter Entity Reference</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Parameter Entity Reference</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference
-	 * @generated
-	 */
-	EClass getDTDParameterEntityReference();
-
-	/**
-	 * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference#getEntity <em>Entity</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the reference '<em>Entity</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference#getEntity()
-	 * @see #getDTDParameterEntityReference()
-	 * @generated
-	 */
-	EReference getDTDParameterEntityReference_Entity();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent <em>Entity Reference Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Entity Reference Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent
-	 * @generated
-	 */
-	EClass getDTDEntityReferenceContent();
-
-	/**
-	 * Returns the meta object for the reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent#getElementReferencedEntity <em>Element Referenced Entity</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the reference '<em>Element Referenced Entity</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent#getElementReferencedEntity()
-	 * @see #getDTDEntityReferenceContent()
-	 * @generated
-	 */
-	EReference getDTDEntityReferenceContent_ElementReferencedEntity();
-
-	/**
-	 * Returns the meta object for class '{@link org.eclipse.wst.dtd.core.internal.emf.DTDContent <em>Content</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for class '<em>Content</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDContent
-	 * @generated
-	 */
-	EClass getDTDContent();
-
-	/**
-	 * Returns the meta object for the container reference '{@link org.eclipse.wst.dtd.core.internal.emf.DTDContent#getDTDFile <em>DTD File</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for the container reference '<em>DTD File</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDContent#getDTDFile()
-	 * @see #getDTDContent()
-	 * @generated
-	 */
-	EReference getDTDContent_DTDFile();
-
-	/**
-	 * Returns the meta object for enum '{@link org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType <em>Occurrence Type</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for enum '<em>Occurrence Type</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType
-	 * @generated
-	 */
-	EEnum getDTDOccurrenceType();
-
-	/**
-	 * Returns the meta object for enum '{@link org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind <em>Default Kind</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for enum '<em>Default Kind</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind
-	 * @generated
-	 */
-	EEnum getDTDDefaultKind();
-
-	/**
-	 * Returns the meta object for enum '{@link org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind <em>Basic Type Kind</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for enum '<em>Basic Type Kind</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind
-	 * @generated
-	 */
-	EEnum getDTDBasicTypeKind();
-
-	/**
-	 * Returns the meta object for enum '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind <em>Enum Group Kind</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for enum '<em>Enum Group Kind</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind
-	 * @generated
-	 */
-	EEnum getDTDEnumGroupKind();
-
-	/**
-	 * Returns the meta object for enum '{@link org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind <em>Group Kind</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for enum '<em>Group Kind</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind
-	 * @generated
-	 */
-	EEnum getDTDGroupKind();
-
-	/**
-	 * Returns the meta object for enum '{@link org.eclipse.wst.dtd.core.internal.emf.XMLSchemaDefinedType <em>XML Schema Defined Type</em>}'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the meta object for enum '<em>XML Schema Defined Type</em>'.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.XMLSchemaDefinedType
-	 * @generated
-	 */
-	EEnum getXMLSchemaDefinedType();
-
-	/**
-	 * Returns the factory that creates the instances of the model. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @return the factory that creates the instances of the model.
-	 * @generated
-	 */
-	DTDFactory getDTDFactory();
-
-} // DTDPackage
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDParameterEntityReference.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDParameterEntityReference.java
deleted file mode 100644
index f26862b..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDParameterEntityReference.java
+++ /dev/null
@@ -1,61 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import org.eclipse.emf.ecore.ENamedElement;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Parameter Entity Reference</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference#getEntity <em>Entity</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDParameterEntityReference()
- * @model
- * @generated
- */
-public interface DTDParameterEntityReference extends ENamedElement, DTDContent, DTDObject, DTDSourceOffset {
-	/**
-	 * Returns the value of the '<em><b>Entity</b></em>' reference. It is
-	 * bidirectional and its opposite is '{@link org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getParmEntityRef <em>Parm Entity Ref</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Entity</em>' reference isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Entity</em>' reference.
-	 * @see #setEntity(DTDEntity)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDParameterEntityReference_Entity()
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDEntity#getParmEntityRef
-	 * @model opposite="parmEntityRef" required="true"
-	 * @generated
-	 */
-	DTDEntity getEntity();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference#getEntity <em>Entity</em>}'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Entity</em>' reference.
-	 * @see #getEntity()
-	 * @generated
-	 */
-	void setEntity(DTDEntity value);
-
-} // DTDParameterEntityReference
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDRepeatableContent.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDRepeatableContent.java
deleted file mode 100644
index 779cd40..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDRepeatableContent.java
+++ /dev/null
@@ -1,65 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Repeatable Content</b></em>'.
- * <!-- end-user-doc -->
- * 
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent#getOccurrence <em>Occurrence</em>}</li>
- * </ul>
- * </p>
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDRepeatableContent()
- * @model abstract="true"
- * @generated
- */
-public interface DTDRepeatableContent extends DTDElementContent {
-
-	public abstract String unparseRepeatableContent();
-
-	/**
-	 * Returns the value of the '<em><b>Occurrence</b></em>' attribute.
-	 * The literals are from the enumeration
-	 * {@link org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType}. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Occurrence</em>' attribute isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @return the value of the '<em>Occurrence</em>' attribute.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType
-	 * @see #setOccurrence(DTDOccurrenceType)
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getDTDRepeatableContent_Occurrence()
-	 * @model
-	 * @generated
-	 */
-	DTDOccurrenceType getOccurrence();
-
-	/**
-	 * Sets the value of the '{@link org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent#getOccurrence <em>Occurrence</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @param value
-	 *            the new value of the '<em>Occurrence</em>' attribute.
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType
-	 * @see #getOccurrence()
-	 * @generated
-	 */
-	void setOccurrence(DTDOccurrenceType value);
-
-} // DTDRepeatableContent
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDResource.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDResource.java
deleted file mode 100644
index 5b2799e..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDResource.java
+++ /dev/null
@@ -1,45 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-
-public interface DTDResource {
-	// Enumeration Constants
-	public static final String ANYICON = "icons/any.gif"; //$NON-NLS-1$
-	public static final String ELEMENTICON = "icons/element.gif"; //$NON-NLS-1$
-	public static final String ENTITYICON = "icons/entity.gif"; //$NON-NLS-1$
-	public static final String ATTRIBUTEICON = "icons/attribute.gif"; //$NON-NLS-1$
-	public static final String NOTATIONICON = "icons/notation.gif"; //$NON-NLS-1$
-	public static final String EMPTYICON = "icons/emptycontent.gif"; //$NON-NLS-1$
-	public static final String PCDATAICON = "icons/one.gif"; //$NON-NLS-1$
-	public static final String ENTITYREFERENCEICON = "icons/entity_reference.gif"; //$NON-NLS-1$
-
-	public static final String ONEICON = "icons/one.gif"; //$NON-NLS-1$
-	public static final String OPTIONALICON = "icons/optional.gif"; //$NON-NLS-1$
-	public static final String ONEORMOREICON = "icons/oneormore.gif"; //$NON-NLS-1$
-	public static final String ZEROORMOREICON = "icons/zeroormore.gif"; //$NON-NLS-1$
-
-	public static final String ONESEQUENCEICON = "icons/onesequence.gif"; //$NON-NLS-1$
-	public static final String OPTIONALSEQUENCEICON = "icons/optionalsequence.gif"; //$NON-NLS-1$
-	public static final String ONEORMORESEQUENCEICON = "icons/oneormoresequence.gif"; //$NON-NLS-1$
-	public static final String ZEROORMORESEQUENCEICON = "icons/zeroormoresequence.gif"; //$NON-NLS-1$
-
-	public static final String ONECHOICEICON = "icons/onechoice.gif"; //$NON-NLS-1$
-	public static final String OPTIONALCHOICEICON = "icons/optionalchoice.gif"; //$NON-NLS-1$
-	public static final String ONEORMORECHOICEICON = "icons/oneormorechoice.gif"; //$NON-NLS-1$
-	public static final String ZEROORMORECHOICEICON = "icons/zeroormorechoice.gif"; //$NON-NLS-1$
-
-	public static final String DTDFILEICON = "icons/DTDFile.gif"; //$NON-NLS-1$
-
-	public static final String NEWDTD = "icons/newdtd_wiz.gif"; //$NON-NLS-1$
-	public static final String NEWHTMLFORM = "icons/genhtmform_wiz.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDSourceOffset.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDSourceOffset.java
deleted file mode 100644
index ff32b1b..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDSourceOffset.java
+++ /dev/null
@@ -1,45 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-public interface DTDSourceOffset {
-	/**
-	 * Get the value of startOffset.
-	 * 
-	 * @return value of startOffset.
-	 */
-	public int getStartOffset();
-
-	/**
-	 * Set the value of startOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to startOffset.
-	 */
-	public void setStartOffset(int v);
-
-	/**
-	 * Get the value of endOffset.
-	 * 
-	 * @return value of endOffset.
-	 */
-	public int getEndOffset();
-
-	/**
-	 * Set the value of endOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to endOffset.
-	 */
-	public void setEndOffset(int v);
-
-}// DTDSourceOffset
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDType.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDType.java
deleted file mode 100644
index e48fdc9..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDType.java
+++ /dev/null
@@ -1,31 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf;
-
-public interface DTDType extends DTDObject {
-	// constant strings for dtd attribute types
-	public static final String NONE = "None"; //$NON-NLS-1$
-
-	public static final String CDATA = "Character Data (CDATA)"; //$NON-NLS-1$
-	public static final String ID = "Identifier (ID)"; //$NON-NLS-1$
-	public static final String IDREF = "ID Reference (IDREF)"; //$NON-NLS-1$
-	public static final String IDREFS = "ID References (IDREFS)"; //$NON-NLS-1$
-	public static final String ENTITY = "Entity Name (ENTITY)"; //$NON-NLS-1$
-	public static final String ENTITIES = "Entity Names (ENTITIES)"; //$NON-NLS-1$
-	public static final String NMTOKEN = "Name Token (NMTOKEN)"; //$NON-NLS-1$
-	public static final String NMTOKENS = "Name Tokens (NMTOKENS)"; //$NON-NLS-1$
-	public static final String ENUM_NAME_TOKEN_GROUP = "Enumerated Name Tokens"; //$NON-NLS-1$
-	public static final String ENUM_NOTATION_GROUP = "Enumerated NOTATION"; //$NON-NLS-1$
-
-	public String toString();
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/XMLSchemaDefinedType.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/XMLSchemaDefinedType.java
deleted file mode 100644
index fd138f4..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/XMLSchemaDefinedType.java
+++ /dev/null
@@ -1,471 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.AbstractEnumerator;
-
-/**
- * <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>XML Schema Defined Type</b></em>',
- * and utility methods for working with them. <!-- end-user-doc -->
- * 
- * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#getXMLSchemaDefinedType()
- * @model
- * @generated
- */
-public final class XMLSchemaDefinedType extends AbstractEnumerator {
-	/**
-	 * The '<em><b>NONE</b></em>' literal value. <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #NONE_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int NONE = -1;
-
-	/**
-	 * The '<em><b>STRING</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #STRING_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int STRING = 1;
-
-	/**
-	 * The '<em><b>BOOLEAN</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #BOOLEAN_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int BOOLEAN = 2;
-
-	/**
-	 * The '<em><b>FLOAT</b></em>' literal value. <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #FLOAT_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int FLOAT = 3;
-
-	/**
-	 * The '<em><b>DOUBLE</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #DOUBLE_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int DOUBLE = 4;
-
-	/**
-	 * The '<em><b>DECIMAL</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #DECIMAL_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int DECIMAL = 5;
-
-	/**
-	 * The '<em><b>TIMEINSTANT</b></em>' literal value. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #TIMEINSTANT_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int TIMEINSTANT = 6;
-
-	/**
-	 * The '<em><b>TIMEDURATION</b></em>' literal value. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #TIMEDURATION_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int TIMEDURATION = 7;
-
-	/**
-	 * The '<em><b>RECURRINGINSTANT</b></em>' literal value. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #RECURRINGINSTANT_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int RECURRINGINSTANT = 8;
-
-	/**
-	 * The '<em><b>BINARY</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #BINARY_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int BINARY = 9;
-
-	/**
-	 * The '<em><b>URI</b></em>' literal value. <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #URI_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int URI = 10;
-
-	/**
-	 * The '<em><b>INTEGER</b></em>' literal value. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @see #INTEGER_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int INTEGER = 11;
-
-	/**
-	 * The '<em><b>DATE</b></em>' literal value. <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #DATE_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int DATE = 12;
-
-	/**
-	 * The '<em><b>TIME</b></em>' literal value. <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #TIME_LITERAL
-	 * @model
-	 * @generated
-	 * @ordered
-	 */
-	public static final int TIME = 13;
-
-	/**
-	 * The '<em><b>NONE</b></em>' literal object. <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>NONE</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #NONE
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType NONE_LITERAL = new XMLSchemaDefinedType(NONE, "NONE"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>STRING</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>STRING</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #STRING
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType STRING_LITERAL = new XMLSchemaDefinedType(STRING, "STRING"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>BOOLEAN</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>BOOLEAN</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #BOOLEAN
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType BOOLEAN_LITERAL = new XMLSchemaDefinedType(BOOLEAN, "BOOLEAN"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>FLOAT</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>FLOAT</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #FLOAT
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType FLOAT_LITERAL = new XMLSchemaDefinedType(FLOAT, "FLOAT"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>DOUBLE</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>DOUBLE</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #DOUBLE
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType DOUBLE_LITERAL = new XMLSchemaDefinedType(DOUBLE, "DOUBLE"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>DECIMAL</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>DECIMAL</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #DECIMAL
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType DECIMAL_LITERAL = new XMLSchemaDefinedType(DECIMAL, "DECIMAL"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>TIMEINSTANT</b></em>' literal object. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>TIMEINSTANT</b></em>' literal object
-	 * isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #TIMEINSTANT
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType TIMEINSTANT_LITERAL = new XMLSchemaDefinedType(TIMEINSTANT, "TIMEINSTANT"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>TIMEDURATION</b></em>' literal object. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>TIMEDURATION</b></em>' literal object
-	 * isn't clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #TIMEDURATION
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType TIMEDURATION_LITERAL = new XMLSchemaDefinedType(TIMEDURATION, "TIMEDURATION"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>RECURRINGINSTANT</b></em>' literal object. <!--
-	 * begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>RECURRINGINSTANT</b></em>' literal
-	 * object isn't clear, there really should be more of a description
-	 * here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #RECURRINGINSTANT
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType RECURRINGINSTANT_LITERAL = new XMLSchemaDefinedType(RECURRINGINSTANT, "RECURRINGINSTANT"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>BINARY</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>BINARY</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #BINARY
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType BINARY_LITERAL = new XMLSchemaDefinedType(BINARY, "BINARY"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>URI</b></em>' literal object. <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>URI</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #URI
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType URI_LITERAL = new XMLSchemaDefinedType(URI, "URI"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>INTEGER</b></em>' literal object. <!-- begin-user-doc
-	 * -->
-	 * <p>
-	 * If the meaning of '<em><b>INTEGER</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #INTEGER
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType INTEGER_LITERAL = new XMLSchemaDefinedType(INTEGER, "INTEGER"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>DATE</b></em>' literal object. <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>DATE</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #DATE
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType DATE_LITERAL = new XMLSchemaDefinedType(DATE, "DATE"); //$NON-NLS-1$
-
-	/**
-	 * The '<em><b>TIME</b></em>' literal object. <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of '<em><b>TIME</b></em>' literal object isn't
-	 * clear, there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * 
-	 * @see #TIME
-	 * @generated
-	 * @ordered
-	 */
-	public static final XMLSchemaDefinedType TIME_LITERAL = new XMLSchemaDefinedType(TIME, "TIME"); //$NON-NLS-1$
-
-	/**
-	 * An array of all the '<em><b>XML Schema Defined Type</b></em>'
-	 * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private static final XMLSchemaDefinedType[] VALUES_ARRAY = new XMLSchemaDefinedType[]{NONE_LITERAL, STRING_LITERAL, BOOLEAN_LITERAL, FLOAT_LITERAL, DOUBLE_LITERAL, DECIMAL_LITERAL, TIMEINSTANT_LITERAL, TIMEDURATION_LITERAL, RECURRINGINSTANT_LITERAL, BINARY_LITERAL, URI_LITERAL, INTEGER_LITERAL, DATE_LITERAL, TIME_LITERAL,};
-
-	/**
-	 * A public read-only list of all the '<em><b>XML Schema Defined Type</b></em>'
-	 * enumerators. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
-	/**
-	 * Returns the '<em><b>XML Schema Defined Type</b></em>' literal with
-	 * the specified name. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static XMLSchemaDefinedType get(String name) {
-		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
-			XMLSchemaDefinedType result = VALUES_ARRAY[i];
-			if (result.toString().equals(name)) {
-				return result;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the '<em><b>XML Schema Defined Type</b></em>' literal with
-	 * the specified value. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static XMLSchemaDefinedType get(int value) {
-		switch (value) {
-			case NONE :
-				return NONE_LITERAL;
-			case STRING :
-				return STRING_LITERAL;
-			case BOOLEAN :
-				return BOOLEAN_LITERAL;
-			case FLOAT :
-				return FLOAT_LITERAL;
-			case DOUBLE :
-				return DOUBLE_LITERAL;
-			case DECIMAL :
-				return DECIMAL_LITERAL;
-			case TIMEINSTANT :
-				return TIMEINSTANT_LITERAL;
-			case TIMEDURATION :
-				return TIMEDURATION_LITERAL;
-			case RECURRINGINSTANT :
-				return RECURRINGINSTANT_LITERAL;
-			case BINARY :
-				return BINARY_LITERAL;
-			case URI :
-				return URI_LITERAL;
-			case INTEGER :
-				return INTEGER_LITERAL;
-			case DATE :
-				return DATE_LITERAL;
-			case TIME :
-				return TIME_LITERAL;
-		}
-		return null;
-	}
-
-	/**
-	 * Only this class can construct instances. <!-- begin-user-doc --> <!--
-	 * end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private XMLSchemaDefinedType(int value, String name) {
-		super(value, name);
-	}
-
-} // XMLSchemaDefinedType
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAnyContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAnyContentImpl.java
deleted file mode 100644
index 66be313..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAnyContentImpl.java
+++ /dev/null
@@ -1,181 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Any Content</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * </p>
- * 
- * @generated
- */
-public class DTDAnyContentImpl extends DTDElementContentImpl implements DTDAnyContent {
-	public String getContentName() {
-		return "ANY"; //$NON-NLS-1$
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected DTDAnyContentImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDAnyContent();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ANY_CONTENT__GROUP :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ANY_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ANY_CONTENT__ELEMENT, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ANY_CONTENT__GROUP :
-					return eBasicSetContainer(null, DTDPackage.DTD_ANY_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
-					return eBasicSetContainer(null, DTDPackage.DTD_ANY_CONTENT__ELEMENT, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_ANY_CONTENT__GROUP :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
-				case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ANY_CONTENT__GROUP :
-				return getGroup();
-			case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
-				return getElement();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ANY_CONTENT__GROUP :
-				setGroup((DTDGroupContent) newValue);
-				return;
-			case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
-				setElement((DTDElement) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ANY_CONTENT__GROUP :
-				setGroup((DTDGroupContent) null);
-				return;
-			case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
-				setElement((DTDElement) null);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ANY_CONTENT__GROUP :
-				return getGroup() != null;
-			case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
-				return getElement() != null;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAttributeImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAttributeImpl.java
deleted file mode 100644
index 14f80f7..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAttributeImpl.java
+++ /dev/null
@@ -1,980 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.notify.impl.NotificationChainImpl;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcoreFactory;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EAttributeImpl;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDType;
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Attribute</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl#getDefaultKind <em>Default Kind</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl#getDefaultValueString <em>Default Value String</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl#getAttributeNameReferencedEntity <em>Attribute Name Referenced Entity</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl#getAttributeTypeReferencedEntity <em>Attribute Type Referenced Entity</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDAttributeImpl#getDTDElement <em>DTD Element</em>}</li>
- * </ul>
- * </p>
- * 
- * @generated
- */
-public class DTDAttributeImpl extends EAttributeImpl implements DTDAttribute {
-
-	public DTDAttributeImpl() {
-		super();
-	}
-
-	public DTDType getDTDType() {
-		return (DTDType) getEType();
-	}
-
-
-	public void setDTDType(DTDType type) {
-		setEType((EClassifier) type);
-	}
-
-	public void setDTDBasicType(int value) {
-		DTDFactoryImpl factory = (DTDFactoryImpl) DTDFactoryImpl.instance();
-		// set attribute type
-		switch (value) {
-			case 0 :
-				setDTDType(factory.getDTDBasicType_NONE());
-				break;
-			case 1 :
-				setDTDType(factory.getDTDBasicType_CDATA());
-				break;
-			case 2 :
-				setDTDType(factory.getDTDBasicType_ID());
-				break;
-			case 3 :
-				setDTDType(factory.getDTDBasicType_IDREF());
-				break;
-			case 4 :
-				setDTDType(factory.getDTDBasicType_IDREFS());
-				break;
-			case 5 :
-				setDTDType(factory.getDTDBasicType_ENTITY());
-				break;
-			case 6 :
-				setDTDType(factory.getDTDBasicType_ENTITIES());
-				break;
-			case 7 :
-				setDTDType(factory.getDTDBasicType_NMTOKEN());
-				break;
-			case 8 :
-				setDTDType(factory.getDTDBasicType_NMTOKENS());
-				break;
-		}
-	}
-
-	public String unparse() {
-		StringBuffer result = new StringBuffer(128);
-
-
-		result.append(getName());
-
-
-		StringBuffer value = new StringBuffer();
-		switch (getDefaultKind().getValue()) {
-			case DTDDefaultKind.IMPLIED :
-				value.append("#IMPLIED"); //$NON-NLS-1$
-				break;
-			case DTDDefaultKind.REQUIRED :
-				value.append("#REQUIRED"); //$NON-NLS-1$
-				break;
-			case DTDDefaultKind.FIXED :
-				String type = getDTDType().toString();
-				if (!(type.equals(DTDType.ID) || type.equals(DTDType.IDREF) || type.equals(DTDType.ENUM_NAME_TOKEN_GROUP) || type.equals(DTDType.IDREFS))) {
-					value.append("#FIXED \"").append(getDefaultValueString()).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-				break;
-			case DTDDefaultKind.NOFIXED :
-				String defaultValue = getDefaultValueString();
-				if (defaultValue != null)
-					value.append("\"").append(defaultValue).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-		}
-
-
-		// Get the attribute type
-		DTDEntity typeEnt = getAttributeTypeReferencedEntity();
-		if (typeEnt != null) {
-			result.append(" %" + typeEnt.getName() + "; ").append(value); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		else {
-			DTDType dtdType = getDTDType();
-			if (dtdType instanceof DTDBasicType) {
-				switch (((DTDBasicType) dtdType).getKind().getValue()) {
-					case DTDBasicTypeKind.CDATA :
-						result.append(" CDATA ").append(value); //$NON-NLS-1$
-						break;
-					case DTDBasicTypeKind.ID :
-						result.append(" ID ").append(value); //$NON-NLS-1$
-						break;
-					case DTDBasicTypeKind.IDREF :
-						result.append(" IDREF ").append(value); //$NON-NLS-1$
-						break;
-					case DTDBasicTypeKind.IDREFS :
-						result.append(" IDREFS ").append(value); //$NON-NLS-1$
-						break;
-					case DTDBasicTypeKind.ENTITY :
-						result.append(" ENTITY ").append(value); //$NON-NLS-1$
-						break;
-					case DTDBasicTypeKind.ENTITIES :
-						result.append(" ENTITIES ").append(value); //$NON-NLS-1$
-						break;
-					case DTDBasicTypeKind.NMTOKEN :
-						result.append(" NMTOKEN ").append(value); //$NON-NLS-1$
-						break;
-					case DTDBasicTypeKind.NMTOKENS :
-						result.append(" NMTOKENS ").append(value); //$NON-NLS-1$
-						break;
-				}
-			}
-			else if (dtdType instanceof DTDEnumerationType) {
-				result.append(" ").append(buildEnumString((DTDEnumerationType) dtdType)).append(value); //$NON-NLS-1$
-			}
-		}
-
-
-		return result.toString();
-	}
-
-
-	private String buildEnumString(DTDEnumerationType enumType) {
-		String result = ""; //$NON-NLS-1$
-
-
-		if (enumType.getKind().getValue() == DTDEnumGroupKind.NOTATION_GROUP)
-			result += "NOTATION "; //$NON-NLS-1$
-
-
-		Iterator i = enumType.getEnumLiterals().iterator();
-		if (i.hasNext()) {
-			result += "(" + ((EEnumLiteral) i.next()).toString(); //$NON-NLS-1$
-			while (i.hasNext()) {
-				result += " | " + ((EEnumLiteral) i.next()).toString(); //$NON-NLS-1$
-			}
-			result += ") "; //$NON-NLS-1$
-		}
-
-
-		return result;
-	}
-
-	public DTDEnumerationType createDTDEnumeration(String[] enumValues, int enumKind) {
-		DTDEnumerationType enumeration = DTDFactoryImpl.instance().createDTDEnumerationType();
-		// enum.setID("Enum_" + ((DTDElement)getMOFDomain()).getName() + "_" +
-		// getName());
-		DTDEnumGroupKind groupKind = DTDEnumGroupKind.get(enumKind);
-		enumeration.setKind(groupKind);
-		// Enumeration values
-		if (enumValues != null) {
-			for (int i = 0; i < enumValues.length; i++) {
-				EcorePackage ePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
-				EEnumLiteral enumLiteral = ((EcoreFactory) ePackage.getEFactoryInstance()).createEEnumLiteral();
-				// MOF2EMF Port
-				// enumLiteral.refSetLiteral(enumValues[i]);
-				enumLiteral.setName(enumValues[i]);
-				// MOF2EMF Port
-				// enumLiteral.refSetLiteral(i);
-				enumLiteral.setValue(i);
-
-				enumeration.getEnumLiterals().add(enumLiteral);
-			}
-		}
-		getDTDElement().getDTDFile().getDTDEnumerationType().add(enumeration);
-		return enumeration;
-	}
-
-	public String getPathname() {
-		return null;
-		// TODO: finish port
-		// return DTDPathnameUtil.makePath(getDTDElement().getPathname(),
-		// "Attr", getName(), -1);
-	}
-
-
-	public DTDObject findObject(String relativePath) {
-		return null;
-		// TODO: finish port
-		/*
-		 * Object[] result = DTDPathnameUtil.parsePathComponent(relativePath);
-		 * 
-		 * 
-		 * String type = (String)result[0];
-		 * 
-		 * 
-		 * if (type == null) return null;
-		 * 
-		 * 
-		 * DTDObject obj = null; if (type.equals("Type")) { obj =
-		 * getDataType(); } else { return null; }
-		 * 
-		 * 
-		 * String restPath = (String)result[3];
-		 * 
-		 * if ((restPath == null) || (obj == null)) { return obj; } else {
-		 * return obj.findObject(restPath); }
-		 */
-	}
-
-	public Collection getEnumeratedValues() {
-		Collection result = new ArrayList();
-
-
-		DTDType type = getDTDType();
-		if (type instanceof DTDEnumerationType) {
-			DTDEnumerationType enumType = (DTDEnumerationType) type;
-			Iterator i = enumType.getEnumLiterals().iterator();
-			while (i.hasNext()) {
-				result.add(((EEnumLiteral) i.next()).toString());
-			}
-		}
-		return result;
-	}
-
-
-	// ugly hack for now since we don't have multiple inheritance.
-	// Would rather have all this stuff in a base class but these
-	// classes are inheriting from sometimes different mof classes
-	DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-
-	/**
-	 * Get the value of startOffset.
-	 * 
-	 * @return value of startOffset.
-	 */
-	public int getStartOffset() {
-		return lexInfo.getStartOffset();
-	}
-
-
-	/**
-	 * Set the value of startOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to startOffset.
-	 */
-	public void setStartOffset(int v) {
-		lexInfo.setStartOffset(v);
-	}
-
-
-	/**
-	 * Get the value of endOffset.
-	 * 
-	 * @return value of endOffset.
-	 */
-	public int getEndOffset() {
-		return lexInfo.getEndOffset();
-	}
-
-
-	/**
-	 * Set the value of endOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to endOffset.
-	 */
-	public void setEndOffset(int v) {
-		lexInfo.setEndOffset(v);
-	}
-
-
-	/**
-	 * The default value of the '{@link #getComment() <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getComment()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final String COMMENT_EDEFAULT = null;
-
-	/**
-	 * The cached value of the '{@link #getComment() <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getComment()
-	 * @generated
-	 * @ordered
-	 */
-	protected String comment = COMMENT_EDEFAULT;
-
-	/**
-	 * The default value of the '{@link #getDefaultKind() <em>Default Kind</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getDefaultKind()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final DTDDefaultKind DEFAULT_KIND_EDEFAULT = DTDDefaultKind.IMPLIED_LITERAL;
-
-	/**
-	 * The cached value of the '{@link #getDefaultKind() <em>Default Kind</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getDefaultKind()
-	 * @generated
-	 * @ordered
-	 */
-	protected DTDDefaultKind defaultKind = DEFAULT_KIND_EDEFAULT;
-
-	/**
-	 * The default value of the '{@link #getDefaultValueString() <em>Default Value String</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getDefaultValueString()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final String DEFAULT_VALUE_STRING_EDEFAULT = null;
-
-	/**
-	 * The cached value of the '{@link #getDefaultValueString() <em>Default Value String</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getDefaultValueString()
-	 * @generated
-	 * @ordered
-	 */
-	protected String defaultValueString = DEFAULT_VALUE_STRING_EDEFAULT;
-
-	/**
-	 * The cached value of the '{@link #getAttributeNameReferencedEntity() <em>Attribute Name Referenced Entity</em>}'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getAttributeNameReferencedEntity()
-	 * @generated
-	 * @ordered
-	 */
-	protected DTDEntity attributeNameReferencedEntity = null;
-
-	/**
-	 * The cached value of the '{@link #getAttributeTypeReferencedEntity() <em>Attribute Type Referenced Entity</em>}'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getAttributeTypeReferencedEntity()
-	 * @generated
-	 * @ordered
-	 */
-	protected DTDEntity attributeTypeReferencedEntity = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDAttribute();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String getComment() {
-		return comment;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setComment(String newComment) {
-		String oldComment = comment;
-		comment = newComment;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__COMMENT, oldComment, comment));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDDefaultKind getDefaultKind() {
-		return defaultKind;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setDefaultKind(DTDDefaultKind newDefaultKind) {
-		DTDDefaultKind oldDefaultKind = defaultKind;
-		defaultKind = newDefaultKind == null ? DEFAULT_KIND_EDEFAULT : newDefaultKind;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__DEFAULT_KIND, oldDefaultKind, defaultKind));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String getDefaultValueString() {
-		return defaultValueString;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setDefaultValueString(String newDefaultValueString) {
-		String oldDefaultValueString = defaultValueString;
-		defaultValueString = newDefaultValueString;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_STRING, oldDefaultValueString, defaultValueString));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDEntity getAttributeNameReferencedEntity() {
-		if (attributeNameReferencedEntity != null && attributeNameReferencedEntity.eIsProxy()) {
-			DTDEntity oldAttributeNameReferencedEntity = attributeNameReferencedEntity;
-			attributeNameReferencedEntity = (DTDEntity) EcoreUtil.resolve(attributeNameReferencedEntity, this);
-			if (attributeNameReferencedEntity != oldAttributeNameReferencedEntity) {
-				if (eNotificationRequired())
-					eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY, oldAttributeNameReferencedEntity, attributeNameReferencedEntity));
-			}
-		}
-		return attributeNameReferencedEntity;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDEntity basicGetAttributeNameReferencedEntity() {
-		return attributeNameReferencedEntity;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain basicSetAttributeNameReferencedEntity(DTDEntity newAttributeNameReferencedEntity, NotificationChain msgs) {
-		DTDEntity oldAttributeNameReferencedEntity = attributeNameReferencedEntity;
-		attributeNameReferencedEntity = newAttributeNameReferencedEntity;
-		if (eNotificationRequired()) {
-			if (msgs == null)
-				msgs = new NotificationChainImpl(4);
-			msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY, oldAttributeNameReferencedEntity, newAttributeNameReferencedEntity));
-		}
-		return msgs;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setAttributeNameReferencedEntity(DTDEntity newAttributeNameReferencedEntity) {
-		if (newAttributeNameReferencedEntity != attributeNameReferencedEntity) {
-			NotificationChain msgs = null;
-			if (attributeNameReferencedEntity != null)
-				msgs = ((InternalEObject) attributeNameReferencedEntity).eInverseRemove(this, DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE, DTDEntity.class, msgs);
-			if (newAttributeNameReferencedEntity != null)
-				msgs = ((InternalEObject) newAttributeNameReferencedEntity).eInverseAdd(this, DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE, DTDEntity.class, msgs);
-			msgs = basicSetAttributeNameReferencedEntity(newAttributeNameReferencedEntity, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY, newAttributeNameReferencedEntity, newAttributeNameReferencedEntity));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDEntity getAttributeTypeReferencedEntity() {
-		if (attributeTypeReferencedEntity != null && attributeTypeReferencedEntity.eIsProxy()) {
-			DTDEntity oldAttributeTypeReferencedEntity = attributeTypeReferencedEntity;
-			attributeTypeReferencedEntity = (DTDEntity) EcoreUtil.resolve(attributeTypeReferencedEntity, this);
-			if (attributeTypeReferencedEntity != oldAttributeTypeReferencedEntity) {
-				if (eNotificationRequired())
-					eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY, oldAttributeTypeReferencedEntity, attributeTypeReferencedEntity));
-			}
-		}
-		return attributeTypeReferencedEntity;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDEntity basicGetAttributeTypeReferencedEntity() {
-		return attributeTypeReferencedEntity;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain basicSetAttributeTypeReferencedEntity(DTDEntity newAttributeTypeReferencedEntity, NotificationChain msgs) {
-		DTDEntity oldAttributeTypeReferencedEntity = attributeTypeReferencedEntity;
-		attributeTypeReferencedEntity = newAttributeTypeReferencedEntity;
-		if (eNotificationRequired()) {
-			if (msgs == null)
-				msgs = new NotificationChainImpl(4);
-			msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY, oldAttributeTypeReferencedEntity, newAttributeTypeReferencedEntity));
-		}
-		return msgs;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setAttributeTypeReferencedEntity(DTDEntity newAttributeTypeReferencedEntity) {
-		if (newAttributeTypeReferencedEntity != attributeTypeReferencedEntity) {
-			NotificationChain msgs = null;
-			if (attributeTypeReferencedEntity != null)
-				msgs = ((InternalEObject) attributeTypeReferencedEntity).eInverseRemove(this, DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE, DTDEntity.class, msgs);
-			if (newAttributeTypeReferencedEntity != null)
-				msgs = ((InternalEObject) newAttributeTypeReferencedEntity).eInverseAdd(this, DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE, DTDEntity.class, msgs);
-			msgs = basicSetAttributeTypeReferencedEntity(newAttributeTypeReferencedEntity, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY, newAttributeTypeReferencedEntity, newAttributeTypeReferencedEntity));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDElement getDTDElement() {
-		if (eContainerFeatureID != DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT)
-			return null;
-		return (DTDElement) eContainer;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setDTDElement(DTDElement newDTDElement) {
-		if (newDTDElement != eContainer || (eContainerFeatureID != DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT && newDTDElement != null)) {
-			if (EcoreUtil.isAncestor(this, newDTDElement))
-				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
-			NotificationChain msgs = null;
-			if (eContainer != null)
-				msgs = eBasicRemoveFromContainer(msgs);
-			if (newDTDElement != null)
-				msgs = ((InternalEObject) newDTDElement).eInverseAdd(this, DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE, DTDElement.class, msgs);
-			msgs = eBasicSetContainer((InternalEObject) newDTDElement, DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT, newDTDElement, newDTDElement));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ATTRIBUTE__EANNOTATIONS :
-					return ((InternalEList) getEAnnotations()).basicAdd(otherEnd, msgs);
-				case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY :
-					if (attributeNameReferencedEntity != null)
-						msgs = ((InternalEObject) attributeNameReferencedEntity).eInverseRemove(this, DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE, DTDEntity.class, msgs);
-					return basicSetAttributeNameReferencedEntity((DTDEntity) otherEnd, msgs);
-				case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY :
-					if (attributeTypeReferencedEntity != null)
-						msgs = ((InternalEObject) attributeTypeReferencedEntity).eInverseRemove(this, DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE, DTDEntity.class, msgs);
-					return basicSetAttributeTypeReferencedEntity((DTDEntity) otherEnd, msgs);
-				case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ATTRIBUTE__EANNOTATIONS :
-					return ((InternalEList) getEAnnotations()).basicRemove(otherEnd, msgs);
-				case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY :
-					return basicSetAttributeNameReferencedEntity(null, msgs);
-				case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY :
-					return basicSetAttributeTypeReferencedEntity(null, msgs);
-				case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
-					return eBasicSetContainer(null, DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE, DTDElement.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ATTRIBUTE__EANNOTATIONS :
-				return getEAnnotations();
-			case DTDPackage.DTD_ATTRIBUTE__NAME :
-				return getName();
-			case DTDPackage.DTD_ATTRIBUTE__ETYPE :
-				if (resolve)
-					return getEType();
-				return basicGetEType();
-			case DTDPackage.DTD_ATTRIBUTE__CHANGEABLE :
-				return isChangeable() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_ATTRIBUTE__VOLATILE :
-				return isVolatile() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_ATTRIBUTE__TRANSIENT :
-				return isTransient() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_ATTRIBUTE__UNIQUE :
-				return isUnique() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_LITERAL :
-				return getDefaultValueLiteral();
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE :
-				return getDefaultValue();
-			case DTDPackage.DTD_ATTRIBUTE__LOWER_BOUND :
-				return new Integer(getLowerBound());
-			case DTDPackage.DTD_ATTRIBUTE__UPPER_BOUND :
-				return new Integer(getUpperBound());
-			case DTDPackage.DTD_ATTRIBUTE__MANY :
-				return isMany() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_ATTRIBUTE__REQUIRED :
-				return isRequired() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_ATTRIBUTE__ECONTAINING_CLASS :
-				return getEContainingClass();
-			case DTDPackage.DTD_ATTRIBUTE__UNSETTABLE :
-				return isUnsettable() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_ATTRIBUTE__ID :
-				return isID() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_ATTRIBUTE__EATTRIBUTE_TYPE :
-				if (resolve)
-					return getEAttributeType();
-				return basicGetEAttributeType();
-			case DTDPackage.DTD_ATTRIBUTE__COMMENT :
-				return getComment();
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_KIND :
-				return getDefaultKind();
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_STRING :
-				return getDefaultValueString();
-			case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY :
-				if (resolve)
-					return getAttributeNameReferencedEntity();
-				return basicGetAttributeNameReferencedEntity();
-			case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY :
-				if (resolve)
-					return getAttributeTypeReferencedEntity();
-				return basicGetAttributeTypeReferencedEntity();
-			case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
-				return getDTDElement();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ATTRIBUTE__EANNOTATIONS :
-				getEAnnotations().clear();
-				getEAnnotations().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__NAME :
-				setName((String) newValue);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__ETYPE :
-				setEType((EClassifier) newValue);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__CHANGEABLE :
-				setChangeable(((Boolean) newValue).booleanValue());
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__VOLATILE :
-				setVolatile(((Boolean) newValue).booleanValue());
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__TRANSIENT :
-				setTransient(((Boolean) newValue).booleanValue());
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__UNIQUE :
-				setUnique(((Boolean) newValue).booleanValue());
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_LITERAL :
-				setDefaultValueLiteral((String) newValue);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__LOWER_BOUND :
-				setLowerBound(((Integer) newValue).intValue());
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__UPPER_BOUND :
-				setUpperBound(((Integer) newValue).intValue());
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__UNSETTABLE :
-				setUnsettable(((Boolean) newValue).booleanValue());
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__ID :
-				setID(((Boolean) newValue).booleanValue());
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__COMMENT :
-				setComment((String) newValue);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_KIND :
-				setDefaultKind((DTDDefaultKind) newValue);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_STRING :
-				setDefaultValueString((String) newValue);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY :
-				setAttributeNameReferencedEntity((DTDEntity) newValue);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY :
-				setAttributeTypeReferencedEntity((DTDEntity) newValue);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
-				setDTDElement((DTDElement) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ATTRIBUTE__EANNOTATIONS :
-				getEAnnotations().clear();
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__NAME :
-				setName(NAME_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__ETYPE :
-				setEType((EClassifier) null);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__CHANGEABLE :
-				setChangeable(CHANGEABLE_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__VOLATILE :
-				setVolatile(VOLATILE_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__TRANSIENT :
-				setTransient(TRANSIENT_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__UNIQUE :
-				setUnique(UNIQUE_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_LITERAL :
-				setDefaultValueLiteral(DEFAULT_VALUE_LITERAL_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__LOWER_BOUND :
-				setLowerBound(LOWER_BOUND_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__UPPER_BOUND :
-				setUpperBound(UPPER_BOUND_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__UNSETTABLE :
-				setUnsettable(UNSETTABLE_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__ID :
-				setID(ID_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__COMMENT :
-				setComment(COMMENT_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_KIND :
-				setDefaultKind(DEFAULT_KIND_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_STRING :
-				setDefaultValueString(DEFAULT_VALUE_STRING_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY :
-				setAttributeNameReferencedEntity((DTDEntity) null);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY :
-				setAttributeTypeReferencedEntity((DTDEntity) null);
-				return;
-			case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
-				setDTDElement((DTDElement) null);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ATTRIBUTE__EANNOTATIONS :
-				return eAnnotations != null && !getEAnnotations().isEmpty();
-			case DTDPackage.DTD_ATTRIBUTE__NAME :
-				return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
-			case DTDPackage.DTD_ATTRIBUTE__ETYPE :
-				return eType != null;
-			case DTDPackage.DTD_ATTRIBUTE__CHANGEABLE :
-				return ((eFlags & CHANGEABLE_EFLAG) != 0) != CHANGEABLE_EDEFAULT;
-			case DTDPackage.DTD_ATTRIBUTE__VOLATILE :
-				return ((eFlags & VOLATILE_EFLAG) != 0) != VOLATILE_EDEFAULT;
-			case DTDPackage.DTD_ATTRIBUTE__TRANSIENT :
-				return ((eFlags & TRANSIENT_EFLAG) != 0) != TRANSIENT_EDEFAULT;
-			case DTDPackage.DTD_ATTRIBUTE__UNIQUE :
-				return ((eFlags & UNIQUE_EFLAG) != 0) != UNIQUE_EDEFAULT;
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_LITERAL :
-				return DEFAULT_VALUE_LITERAL_EDEFAULT == null ? defaultValueLiteral != null : !DEFAULT_VALUE_LITERAL_EDEFAULT.equals(defaultValueLiteral);
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE :
-				return getDefaultValue() != null;
-			case DTDPackage.DTD_ATTRIBUTE__LOWER_BOUND :
-				return lowerBound != LOWER_BOUND_EDEFAULT;
-			case DTDPackage.DTD_ATTRIBUTE__UPPER_BOUND :
-				return upperBound != UPPER_BOUND_EDEFAULT;
-			case DTDPackage.DTD_ATTRIBUTE__MANY :
-				return isMany() != false;
-			case DTDPackage.DTD_ATTRIBUTE__REQUIRED :
-				return isRequired() != false;
-			case DTDPackage.DTD_ATTRIBUTE__ECONTAINING_CLASS :
-				return getEContainingClass() != null;
-			case DTDPackage.DTD_ATTRIBUTE__UNSETTABLE :
-				return ((eFlags & UNSETTABLE_EFLAG) != 0) != UNSETTABLE_EDEFAULT;
-			case DTDPackage.DTD_ATTRIBUTE__ID :
-				return ((eFlags & ID_EFLAG) != 0) != ID_EDEFAULT;
-			case DTDPackage.DTD_ATTRIBUTE__EATTRIBUTE_TYPE :
-				return basicGetEAttributeType() != null;
-			case DTDPackage.DTD_ATTRIBUTE__COMMENT :
-				return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_KIND :
-				return defaultKind != DEFAULT_KIND_EDEFAULT;
-			case DTDPackage.DTD_ATTRIBUTE__DEFAULT_VALUE_STRING :
-				return DEFAULT_VALUE_STRING_EDEFAULT == null ? defaultValueString != null : !DEFAULT_VALUE_STRING_EDEFAULT.equals(defaultValueString);
-			case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY :
-				return attributeNameReferencedEntity != null;
-			case DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY :
-				return attributeTypeReferencedEntity != null;
-			case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
-				return getDTDElement() != null;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String toString() {
-		if (eIsProxy())
-			return super.toString();
-
-		StringBuffer result = new StringBuffer(super.toString());
-		result.append(" (comment: "); //$NON-NLS-1$
-		result.append(comment);
-		result.append(", defaultKind: "); //$NON-NLS-1$
-		result.append(defaultKind);
-		result.append(", defaultValueString: "); //$NON-NLS-1$
-		result.append(defaultValueString);
-		result.append(')');
-		return result.toString();
-	}
-
-} // DTDAttributeImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDBasicTypeImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDBasicTypeImpl.java
deleted file mode 100644
index c0918c7..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDBasicTypeImpl.java
+++ /dev/null
@@ -1,427 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EClassImpl;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.DTDCoreMessages;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDType;
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Basic Type</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDBasicTypeImpl#getKind <em>Kind</em>}</li>
- * </ul>
- * </p>
- * 
- * @generated
- */
-public class DTDBasicTypeImpl extends EClassImpl implements DTDBasicType, EClass {
-
-	public final static String basicTypeStrings[] = {DTDType.NONE, DTDType.CDATA, DTDType.ID, DTDType.IDREF, DTDType.IDREFS, DTDType.ENTITY, DTDType.ENTITIES, DTDType.NMTOKEN, DTDType.NMTOKENS};
-
-	public final static String basicTypeDescriptions[] = {DTDCoreMessages._UI_NONE_DESC, DTDCoreMessages._UI_CHARACTER_DATA_DESC, DTDCoreMessages._UI_IDENTIFIER_DESC, DTDCoreMessages._UI_ID_REFERENCE_DESC, DTDCoreMessages._UI_ID_REFERENCES_DESC, DTDCoreMessages._UI_ENTITY_NAME_DESC, DTDCoreMessages._UI_ENTITY_NAMES_DESC, DTDCoreMessages._UI_NAME_TOKEN_DESC, DTDCoreMessages._UI_NAME_TOKENS_DESC}; //$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 final static int basicTypeKinds[] = {DTDBasicTypeKind.NONE, DTDBasicTypeKind.CDATA, DTDBasicTypeKind.ID, DTDBasicTypeKind.IDREF, DTDBasicTypeKind.IDREFS, DTDBasicTypeKind.ENTITY, DTDBasicTypeKind.ENTITIES, DTDBasicTypeKind.NMTOKEN, DTDBasicTypeKind.NMTOKENS};
-
-	public String unparse() {
-		return getTypeString();
-	}
-
-	public String getTypeString() {
-		int kind = getKind().getValue();
-		if (kind >= 0 && kind < basicTypeStrings.length) {
-			return basicTypeStrings[kind];
-		} // end of if ()
-
-		return null;
-	}
-
-
-	public String getTypeDescription() {
-		return getTypeDescription(getKind().getValue());
-	}
-
-
-	public static String getTypeDescription(int typeKind) {
-		if (typeKind >= 0 && typeKind < basicTypeDescriptions.length) {
-			return basicTypeDescriptions[typeKind];
-		}
-		return null;
-	}
-
-	public String getPathname() {
-		// TBD
-		return ""; //$NON-NLS-1$
-	}
-
-	public DTDObject findObject(String relativePath) {
-		return null;
-	}
-
-
-
-	/**
-	 * The default value of the '{@link #getKind() <em>Kind</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getKind()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final DTDBasicTypeKind KIND_EDEFAULT = DTDBasicTypeKind.NONE_LITERAL;
-
-	/**
-	 * The cached value of the '{@link #getKind() <em>Kind</em>}' attribute.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getKind()
-	 * @generated
-	 * @ordered
-	 */
-	protected DTDBasicTypeKind kind = KIND_EDEFAULT;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected DTDBasicTypeImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDBasicType();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDBasicTypeKind getKind() {
-		return kind;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setKind(DTDBasicTypeKind newKind) {
-		DTDBasicTypeKind oldKind = kind;
-		kind = newKind == null ? KIND_EDEFAULT : newKind;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_BASIC_TYPE__KIND, oldKind, kind));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_BASIC_TYPE__EANNOTATIONS :
-					return ((InternalEList) getEAnnotations()).basicAdd(otherEnd, msgs);
-				case DTDPackage.DTD_BASIC_TYPE__EPACKAGE :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_BASIC_TYPE__EPACKAGE, msgs);
-				case DTDPackage.DTD_BASIC_TYPE__EOPERATIONS :
-					return ((InternalEList) getEOperations()).basicAdd(otherEnd, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_BASIC_TYPE__EANNOTATIONS :
-					return ((InternalEList) getEAnnotations()).basicRemove(otherEnd, msgs);
-				case DTDPackage.DTD_BASIC_TYPE__EPACKAGE :
-					return eBasicSetContainer(null, DTDPackage.DTD_BASIC_TYPE__EPACKAGE, msgs);
-				case DTDPackage.DTD_BASIC_TYPE__EOPERATIONS :
-					return ((InternalEList) getEOperations()).basicRemove(otherEnd, msgs);
-				case DTDPackage.DTD_BASIC_TYPE__EREFERENCES :
-					return ((InternalEList) getEReferences()).basicRemove(otherEnd, msgs);
-				case DTDPackage.DTD_BASIC_TYPE__EATTRIBUTES :
-					return ((InternalEList) getEAttributes()).basicRemove(otherEnd, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_BASIC_TYPE__EPACKAGE :
-					return eContainer.eInverseRemove(this, EcorePackage.EPACKAGE__ECLASSIFIERS, EPackage.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_BASIC_TYPE__EANNOTATIONS :
-				return getEAnnotations();
-			case DTDPackage.DTD_BASIC_TYPE__NAME :
-				return getName();
-			case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS_NAME :
-				return getInstanceClassName();
-			case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS :
-				return getInstanceClass();
-			case DTDPackage.DTD_BASIC_TYPE__DEFAULT_VALUE :
-				return getDefaultValue();
-			case DTDPackage.DTD_BASIC_TYPE__EPACKAGE :
-				return getEPackage();
-			case DTDPackage.DTD_BASIC_TYPE__ABSTRACT :
-				return isAbstract() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_BASIC_TYPE__INTERFACE :
-				return isInterface() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_BASIC_TYPE__ESUPER_TYPES :
-				return getESuperTypes();
-			case DTDPackage.DTD_BASIC_TYPE__EOPERATIONS :
-				return getEOperations();
-			case DTDPackage.DTD_BASIC_TYPE__EALL_ATTRIBUTES :
-				return getEAllAttributes();
-			case DTDPackage.DTD_BASIC_TYPE__EALL_REFERENCES :
-				return getEAllReferences();
-			case DTDPackage.DTD_BASIC_TYPE__EREFERENCES :
-				return getEReferences();
-			case DTDPackage.DTD_BASIC_TYPE__EATTRIBUTES :
-				return getEAttributes();
-			case DTDPackage.DTD_BASIC_TYPE__EALL_CONTAINMENTS :
-				return getEAllContainments();
-			case DTDPackage.DTD_BASIC_TYPE__EALL_OPERATIONS :
-				return getEAllOperations();
-			case DTDPackage.DTD_BASIC_TYPE__EALL_STRUCTURAL_FEATURES :
-				return getEAllStructuralFeatures();
-			case DTDPackage.DTD_BASIC_TYPE__EALL_SUPER_TYPES :
-				return getEAllSuperTypes();
-			case DTDPackage.DTD_BASIC_TYPE__EID_ATTRIBUTE :
-				return getEIDAttribute();
-			case DTDPackage.DTD_BASIC_TYPE__KIND :
-				return getKind();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_BASIC_TYPE__EANNOTATIONS :
-				getEAnnotations().clear();
-				getEAnnotations().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__NAME :
-				setName((String) newValue);
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS_NAME :
-				setInstanceClassName((String) newValue);
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS :
-				setInstanceClass((Class) newValue);
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__ABSTRACT :
-				setAbstract(((Boolean) newValue).booleanValue());
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__INTERFACE :
-				setInterface(((Boolean) newValue).booleanValue());
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__ESUPER_TYPES :
-				getESuperTypes().clear();
-				getESuperTypes().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__EOPERATIONS :
-				getEOperations().clear();
-				getEOperations().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__EREFERENCES :
-				getEReferences().clear();
-				getEReferences().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__EATTRIBUTES :
-				getEAttributes().clear();
-				getEAttributes().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__KIND :
-				setKind((DTDBasicTypeKind) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_BASIC_TYPE__EANNOTATIONS :
-				getEAnnotations().clear();
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__NAME :
-				setName(NAME_EDEFAULT);
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS_NAME :
-				setInstanceClassName(INSTANCE_CLASS_NAME_EDEFAULT);
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS :
-				setInstanceClass(INSTANCE_CLASS_EDEFAULT);
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__ABSTRACT :
-				setAbstract(ABSTRACT_EDEFAULT);
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__INTERFACE :
-				setInterface(INTERFACE_EDEFAULT);
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__ESUPER_TYPES :
-				getESuperTypes().clear();
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__EOPERATIONS :
-				getEOperations().clear();
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__EREFERENCES :
-				getEReferences().clear();
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__EATTRIBUTES :
-				getEAttributes().clear();
-				return;
-			case DTDPackage.DTD_BASIC_TYPE__KIND :
-				setKind(KIND_EDEFAULT);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_BASIC_TYPE__EANNOTATIONS :
-				return eAnnotations != null && !getEAnnotations().isEmpty();
-			case DTDPackage.DTD_BASIC_TYPE__NAME :
-				return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
-			case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS_NAME :
-				return INSTANCE_CLASS_NAME_EDEFAULT == null ? instanceClassName != null : !INSTANCE_CLASS_NAME_EDEFAULT.equals(instanceClassName);
-			case DTDPackage.DTD_BASIC_TYPE__INSTANCE_CLASS :
-				return INSTANCE_CLASS_EDEFAULT == null ? instanceClass != null : !INSTANCE_CLASS_EDEFAULT.equals(instanceClass);
-			case DTDPackage.DTD_BASIC_TYPE__DEFAULT_VALUE :
-				return getDefaultValue() != null;
-			case DTDPackage.DTD_BASIC_TYPE__EPACKAGE :
-				return getEPackage() != null;
-			case DTDPackage.DTD_BASIC_TYPE__ABSTRACT :
-				return ((eFlags & ABSTRACT_EFLAG) != 0) != ABSTRACT_EDEFAULT;
-			case DTDPackage.DTD_BASIC_TYPE__INTERFACE :
-				return ((eFlags & INTERFACE_EFLAG) != 0) != INTERFACE_EDEFAULT;
-			case DTDPackage.DTD_BASIC_TYPE__ESUPER_TYPES :
-				return eSuperTypes != null && !getESuperTypes().isEmpty();
-			case DTDPackage.DTD_BASIC_TYPE__EOPERATIONS :
-				return eOperations != null && !getEOperations().isEmpty();
-			case DTDPackage.DTD_BASIC_TYPE__EALL_ATTRIBUTES :
-				return !getEAllAttributes().isEmpty();
-			case DTDPackage.DTD_BASIC_TYPE__EALL_REFERENCES :
-				return !getEAllReferences().isEmpty();
-			case DTDPackage.DTD_BASIC_TYPE__EREFERENCES :
-				return eReferences != null && !getEReferences().isEmpty();
-			case DTDPackage.DTD_BASIC_TYPE__EATTRIBUTES :
-				return eAttributes != null && !getEAttributes().isEmpty();
-			case DTDPackage.DTD_BASIC_TYPE__EALL_CONTAINMENTS :
-				return !getEAllContainments().isEmpty();
-			case DTDPackage.DTD_BASIC_TYPE__EALL_OPERATIONS :
-				return !getEAllOperations().isEmpty();
-			case DTDPackage.DTD_BASIC_TYPE__EALL_STRUCTURAL_FEATURES :
-				return !getEAllStructuralFeatures().isEmpty();
-			case DTDPackage.DTD_BASIC_TYPE__EALL_SUPER_TYPES :
-				return !getEAllSuperTypes().isEmpty();
-			case DTDPackage.DTD_BASIC_TYPE__EID_ATTRIBUTE :
-				return getEIDAttribute() != null;
-			case DTDPackage.DTD_BASIC_TYPE__KIND :
-				return kind != KIND_EDEFAULT;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String toString() {
-		if (eIsProxy())
-			return super.toString();
-
-		StringBuffer result = new StringBuffer(super.toString());
-		result.append(" (kind: "); //$NON-NLS-1$
-		result.append(kind);
-		result.append(')');
-		return result.toString();
-	}
-
-} // DTDBasicTypeImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDContentImpl.java
deleted file mode 100644
index 7f39b9d..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDContentImpl.java
+++ /dev/null
@@ -1,189 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENamedElementImpl;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-public class DTDContentImpl extends ENamedElementImpl implements DTDContent, EObject {
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected DTDContentImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDContent();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDFile getDTDFile() {
-		if (eContainerFeatureID != DTDPackage.DTD_CONTENT__DTD_FILE)
-			return null;
-		return (DTDFile) eContainer;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setDTDFile(DTDFile newDTDFile) {
-		if (newDTDFile != eContainer || (eContainerFeatureID != DTDPackage.DTD_CONTENT__DTD_FILE && newDTDFile != null)) {
-			if (EcoreUtil.isAncestor(this, newDTDFile))
-				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
-			NotificationChain msgs = null;
-			if (eContainer != null)
-				msgs = eBasicRemoveFromContainer(msgs);
-			if (newDTDFile != null)
-				msgs = ((InternalEObject) newDTDFile).eInverseAdd(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
-			msgs = eBasicSetContainer((InternalEObject) newDTDFile, DTDPackage.DTD_CONTENT__DTD_FILE, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_CONTENT__DTD_FILE, newDTDFile, newDTDFile));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_CONTENT__DTD_FILE :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_CONTENT__DTD_FILE, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_CONTENT__DTD_FILE :
-					return eBasicSetContainer(null, DTDPackage.DTD_CONTENT__DTD_FILE, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_CONTENT__DTD_FILE :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_CONTENT__DTD_FILE :
-				return getDTDFile();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_CONTENT__DTD_FILE :
-				setDTDFile((DTDFile) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_CONTENT__DTD_FILE :
-				setDTDFile((DTDFile) null);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_CONTENT__DTD_FILE :
-				return getDTDFile() != null;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-} // DTDContentImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementContentImpl.java
deleted file mode 100644
index be81da8..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementContentImpl.java
+++ /dev/null
@@ -1,377 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Element Content</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementContentImpl#getGroup <em>Group</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDElementContentImpl#getElement <em>Element</em>}</li>
- * </ul>
- * </p>
- * 
- * @generated
- */
-public abstract class DTDElementContentImpl extends EObjectImpl implements DTDElementContent {
-
-	public DTDElementContentImpl() {
-		super();
-	}
-
-	public DTDElement getDTDElement() {
-		DTDElementContent c = getDTDGroupContent();
-		if (c != null)
-			return c.getElement();
-		else
-			return getElement();
-	}
-
-	// get the most outer DTDGroupContent
-	public DTDGroupContent getDTDGroupContent() {
-		DTDElementContent c = this;
-		while (c.getGroup() != null) {
-			c = c.getGroup();
-		}
-		return ((c instanceof DTDGroupContent) ? (DTDGroupContent) c : null);
-	}
-
-	public String getPathname() {
-		int cnt = 0;
-		DTDObject parent = getGroup();
-		if (parent == null) {
-			parent = getElement();
-		}
-		else {
-			DTDGroupContent group = (DTDGroupContent) parent;
-			Iterator i = group.getContent().iterator();
-			while (i.hasNext()) {
-				DTDElementContent content = (DTDElementContent) i.next();
-				if (content == this) {
-					break;
-				}
-				if ((content instanceof DTDElementReferenceContent) || (content instanceof DTDEntityReferenceContent)) {
-					continue;
-				}
-				cnt++;
-			}
-		}
-		return DTDPathnameUtil.makePath(((parent == null) ? "NULL_PARENT" : parent.getPathname()), "Content", null, cnt); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	public DTDObject findObject(String relativePath) {
-		return null;
-	}
-
-	public boolean isFirstElementContent() {
-		DTDElement element = getElement();
-
-		if (element != null) {
-			// This means this is the only element content in the element
-			return true;
-		} // end of if ()
-
-		DTDGroupContent group = getGroup();
-		int pos = group.getContentPosition(this);
-		if (pos == 0) {
-			// now recurse and ensure this group is the first group
-			return group.isFirstElementContent();
-		} // end of if ()
-		else {
-			return false;
-		}
-	}
-
-	public String getContentDetail() {
-		// most times, content name is fine. However for groups,
-		// we didn't want a long name to show up in the tree,
-		// so we created a get contentdetail to get to the long
-		// name (getContentName will get the short one.
-		return getContentName();
-	}
-
-	// ugly hack for now since we don't have multiple inheritance.
-	// Would rather have all this stuff in a base class but these
-	// classes are inheriting from sometimes different mof classes
-	DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-
-	/**
-	 * Get the value of startOffset.
-	 * 
-	 * @return value of startOffset.
-	 */
-	public int getStartOffset() {
-		return lexInfo.getStartOffset();
-	}
-
-	/**
-	 * Set the value of startOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to startOffset.
-	 */
-	public void setStartOffset(int v) {
-		lexInfo.setStartOffset(v);
-	}
-
-	/**
-	 * Get the value of endOffset.
-	 * 
-	 * @return value of endOffset.
-	 */
-	public int getEndOffset() {
-		return lexInfo.getEndOffset();
-	}
-
-	/**
-	 * Set the value of endOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to endOffset.
-	 */
-	public void setEndOffset(int v) {
-		lexInfo.setEndOffset(v);
-	}
-
-	/*
-	 * @see DTDElementContent#getContentName()
-	 */
-	public String getContentName() {
-		return null;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDElementContent();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDGroupContent getGroup() {
-		if (eContainerFeatureID != DTDPackage.DTD_ELEMENT_CONTENT__GROUP)
-			return null;
-		return (DTDGroupContent) eContainer;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setGroup(DTDGroupContent newGroup) {
-		if (newGroup != eContainer || (eContainerFeatureID != DTDPackage.DTD_ELEMENT_CONTENT__GROUP && newGroup != null)) {
-			if (EcoreUtil.isAncestor(this, newGroup))
-				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
-			NotificationChain msgs = null;
-			if (eContainer != null)
-				msgs = eBasicRemoveFromContainer(msgs);
-			if (newGroup != null)
-				msgs = ((InternalEObject) newGroup).eInverseAdd(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
-			msgs = eBasicSetContainer((InternalEObject) newGroup, DTDPackage.DTD_ELEMENT_CONTENT__GROUP, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT_CONTENT__GROUP, newGroup, newGroup));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDElement getElement() {
-		if (eContainerFeatureID != DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT)
-			return null;
-		return (DTDElement) eContainer;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setElement(DTDElement newElement) {
-		if (newElement != eContainer || (eContainerFeatureID != DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT && newElement != null)) {
-			if (EcoreUtil.isAncestor(this, newElement))
-				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
-			NotificationChain msgs = null;
-			if (eContainer != null)
-				msgs = eBasicRemoveFromContainer(msgs);
-			if (newElement != null)
-				msgs = ((InternalEObject) newElement).eInverseAdd(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
-			msgs = eBasicSetContainer((InternalEObject) newElement, DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT, newElement, newElement));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ELEMENT_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
-					return eBasicSetContainer(null, DTDPackage.DTD_ELEMENT_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
-					return eBasicSetContainer(null, DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
-				case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
-				return getGroup();
-			case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
-				return getElement();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
-				setGroup((DTDGroupContent) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
-				setElement((DTDElement) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
-				setGroup((DTDGroupContent) null);
-				return;
-			case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
-				setElement((DTDElement) null);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
-				return getGroup() != null;
-			case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
-				return getElement() != null;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-} // DTDElementContentImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementImpl.java
deleted file mode 100644
index 64d13f3..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementImpl.java
+++ /dev/null
@@ -1,654 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.notify.impl.NotificationChainImpl;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EClassImpl;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDVisitor;
-
-
-/**
- * @generated
- */
-public class DTDElementImpl extends EClassImpl implements DTDElement {
-	/**
-	 * The default value of the '{@link #getComment() <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getComment()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final String COMMENT_EDEFAULT = null;
-
-	public DTDElementImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDElement();
-	}
-
-	public void addDTDAttribute(DTDAttribute attribute) {
-		getDTDAttribute().add(attribute);
-	}
-
-	public String getPathname() {
-		return DTDPathnameUtil.makePath(null, "Elem", getName(), -1); //$NON-NLS-1$
-	}
-
-	public DTDObject findObject(String relativePath) {
-		Object[] result = DTDPathnameUtil.parsePathComponent(relativePath);
-
-		String type = (String) result[0];
-
-		if (type == null)
-			return null;
-
-		DTDObject obj = null;
-		if (type.equals("Attr")) { //$NON-NLS-1$
-			// TODO: fix port
-			// obj = findAttribute(name);
-		}
-		else if ((type.equals("Content")) || (type.equals("ElemRef")) || (type.equals("EntRef"))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			obj = getContent();
-		}
-		else {
-			return null;
-		}
-
-		String restPath = (String) result[3];
-
-		if ((restPath == null) || (obj == null)) {
-			return obj;
-		}
-		else {
-			return obj.findObject(restPath);
-		}
-	}
-
-	// returns all references in the same DTDFile that reference this element
-	public Collection getReferences() {
-		DTDFile file = getDTDFile();
-		final Collection result = new ArrayList();
-
-		DTDVisitor visitRefs = new DTDVisitor() {
-			public void visitDTDElementReferenceContent(DTDElementReferenceContent elementReferenceContent) {
-				if (elementReferenceContent.getReferencedElement() == DTDElementImpl.this) {
-					result.add(elementReferenceContent);
-				} // end of if ()
-			}
-		};
-		visitRefs.visitDTDFile(file);
-		return result;
-	}
-
-	public String getAttributeDetail() {
-		String attributeString = ""; //$NON-NLS-1$
-		Collection attributes = getDTDAttribute();
-		if (attributes != null) {
-			boolean seenOne = false;
-			for (java.util.Iterator i = attributes.iterator(); i.hasNext();) {
-				if (seenOne) {
-					attributeString = attributeString + ", "; //$NON-NLS-1$
-				}
-				else {
-					seenOne = true;
-				} // end of else
-
-				attributeString = attributeString + ((DTDAttribute) i.next()).getName();
-			}
-		} // end of if ()
-		return attributeString;
-	}
-
-
-	// ugly hack for now since we don't have multiple inheritance.
-	// Would rather have all this stuff in a base class but these
-	// classes are inheriting from sometimes different mof classes
-	DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected String comment = COMMENT_EDEFAULT;
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected DTDElementContent content = null;
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected EList dtdAttribute = null;
-
-	/**
-	 * Get the value of startOffset.
-	 * 
-	 * @return value of startOffset.
-	 */
-	public int getStartOffset() {
-		return lexInfo.getStartOffset();
-	}
-
-	/**
-	 * Set the value of startOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to startOffset.
-	 */
-	public void setStartOffset(int v) {
-		lexInfo.setStartOffset(v);
-	}
-
-	/**
-	 * Get the value of endOffset.
-	 * 
-	 * @return value of endOffset.
-	 */
-	public int getEndOffset() {
-		return lexInfo.getEndOffset();
-	}
-
-	/**
-	 * Set the value of endOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to endOffset.
-	 */
-	public void setEndOffset(int v) {
-		lexInfo.setEndOffset(v);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public String getComment() {
-		return comment;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void setComment(String newComment) {
-		String oldComment = comment;
-		comment = newComment;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT__COMMENT, oldComment, comment));
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public DTDElementContent getContent() {
-		return content;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain basicSetContent(DTDElementContent newContent, NotificationChain msgs) {
-		DTDElementContent oldContent = content;
-		content = newContent;
-		if (eNotificationRequired()) {
-			if (msgs == null)
-				msgs = new NotificationChainImpl(4);
-			msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT__CONTENT, oldContent, newContent));
-		}
-		return msgs;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void setContent(DTDElementContent newContent) {
-		if (newContent != content) {
-			NotificationChain msgs = null;
-			if (content != null)
-				msgs = ((InternalEObject) content).eInverseRemove(this, DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT, DTDElementContent.class, msgs);
-			if (newContent != null)
-				msgs = ((InternalEObject) newContent).eInverseAdd(this, DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT, DTDElementContent.class, msgs);
-			msgs = basicSetContent(newContent, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT__CONTENT, newContent, newContent));
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public EList getDTDAttribute() {
-		if (dtdAttribute == null) {
-			dtdAttribute = new EObjectContainmentWithInverseEList(DTDAttribute.class, this, DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE, DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT);
-		}
-		return dtdAttribute;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ELEMENT__EANNOTATIONS :
-					return ((InternalEList) getEAnnotations()).basicAdd(otherEnd, msgs);
-				case DTDPackage.DTD_ELEMENT__EPACKAGE :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ELEMENT__EPACKAGE, msgs);
-				case DTDPackage.DTD_ELEMENT__EOPERATIONS :
-					return ((InternalEList) getEOperations()).basicAdd(otherEnd, msgs);
-				case DTDPackage.DTD_ELEMENT__DTD_FILE :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ELEMENT__DTD_FILE, msgs);
-				case DTDPackage.DTD_ELEMENT__CONTENT :
-					if (content != null)
-						msgs = ((InternalEObject) content).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DTDPackage.DTD_ELEMENT__CONTENT, null, msgs);
-					return basicSetContent((DTDElementContent) otherEnd, msgs);
-				case DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE :
-					return ((InternalEList) getDTDAttribute()).basicAdd(otherEnd, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ELEMENT__EANNOTATIONS :
-					return ((InternalEList) getEAnnotations()).basicRemove(otherEnd, msgs);
-				case DTDPackage.DTD_ELEMENT__EPACKAGE :
-					return eBasicSetContainer(null, DTDPackage.DTD_ELEMENT__EPACKAGE, msgs);
-				case DTDPackage.DTD_ELEMENT__EOPERATIONS :
-					return ((InternalEList) getEOperations()).basicRemove(otherEnd, msgs);
-				case DTDPackage.DTD_ELEMENT__EREFERENCES :
-					return ((InternalEList) getEReferences()).basicRemove(otherEnd, msgs);
-				case DTDPackage.DTD_ELEMENT__EATTRIBUTES :
-					return ((InternalEList) getEAttributes()).basicRemove(otherEnd, msgs);
-				case DTDPackage.DTD_ELEMENT__DTD_FILE :
-					return eBasicSetContainer(null, DTDPackage.DTD_ELEMENT__DTD_FILE, msgs);
-				case DTDPackage.DTD_ELEMENT__CONTENT :
-					return basicSetContent(null, msgs);
-				case DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE :
-					return ((InternalEList) getDTDAttribute()).basicRemove(otherEnd, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_ELEMENT__EPACKAGE :
-					return eContainer.eInverseRemove(this, EcorePackage.EPACKAGE__ECLASSIFIERS, EPackage.class, msgs);
-				case DTDPackage.DTD_ELEMENT__DTD_FILE :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ELEMENT__EANNOTATIONS :
-				return getEAnnotations();
-			case DTDPackage.DTD_ELEMENT__NAME :
-				return getName();
-			case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS_NAME :
-				return getInstanceClassName();
-			case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS :
-				return getInstanceClass();
-			case DTDPackage.DTD_ELEMENT__DEFAULT_VALUE :
-				return getDefaultValue();
-			case DTDPackage.DTD_ELEMENT__EPACKAGE :
-				return getEPackage();
-			case DTDPackage.DTD_ELEMENT__ABSTRACT :
-				return isAbstract() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_ELEMENT__INTERFACE :
-				return isInterface() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_ELEMENT__ESUPER_TYPES :
-				return getESuperTypes();
-			case DTDPackage.DTD_ELEMENT__EOPERATIONS :
-				return getEOperations();
-			case DTDPackage.DTD_ELEMENT__EALL_ATTRIBUTES :
-				return getEAllAttributes();
-			case DTDPackage.DTD_ELEMENT__EALL_REFERENCES :
-				return getEAllReferences();
-			case DTDPackage.DTD_ELEMENT__EREFERENCES :
-				return getEReferences();
-			case DTDPackage.DTD_ELEMENT__EATTRIBUTES :
-				return getEAttributes();
-			case DTDPackage.DTD_ELEMENT__EALL_CONTAINMENTS :
-				return getEAllContainments();
-			case DTDPackage.DTD_ELEMENT__EALL_OPERATIONS :
-				return getEAllOperations();
-			case DTDPackage.DTD_ELEMENT__EALL_STRUCTURAL_FEATURES :
-				return getEAllStructuralFeatures();
-			case DTDPackage.DTD_ELEMENT__EALL_SUPER_TYPES :
-				return getEAllSuperTypes();
-			case DTDPackage.DTD_ELEMENT__EID_ATTRIBUTE :
-				return getEIDAttribute();
-			case DTDPackage.DTD_ELEMENT__DTD_FILE :
-				return getDTDFile();
-			case DTDPackage.DTD_ELEMENT__COMMENT :
-				return getComment();
-			case DTDPackage.DTD_ELEMENT__CONTENT :
-				return getContent();
-			case DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE :
-				return getDTDAttribute();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ELEMENT__EANNOTATIONS :
-				return eAnnotations != null && !getEAnnotations().isEmpty();
-			case DTDPackage.DTD_ELEMENT__NAME :
-				return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
-			case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS_NAME :
-				return INSTANCE_CLASS_NAME_EDEFAULT == null ? instanceClassName != null : !INSTANCE_CLASS_NAME_EDEFAULT.equals(instanceClassName);
-			case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS :
-				return INSTANCE_CLASS_EDEFAULT == null ? instanceClass != null : !INSTANCE_CLASS_EDEFAULT.equals(instanceClass);
-			case DTDPackage.DTD_ELEMENT__DEFAULT_VALUE :
-				return getDefaultValue() != null;
-			case DTDPackage.DTD_ELEMENT__EPACKAGE :
-				return getEPackage() != null;
-			case DTDPackage.DTD_ELEMENT__ABSTRACT :
-				return ((eFlags & ABSTRACT_EFLAG) != 0) != ABSTRACT_EDEFAULT;
-			case DTDPackage.DTD_ELEMENT__INTERFACE :
-				return ((eFlags & INTERFACE_EFLAG) != 0) != INTERFACE_EDEFAULT;
-			case DTDPackage.DTD_ELEMENT__ESUPER_TYPES :
-				return eSuperTypes != null && !getESuperTypes().isEmpty();
-			case DTDPackage.DTD_ELEMENT__EOPERATIONS :
-				return eOperations != null && !getEOperations().isEmpty();
-			case DTDPackage.DTD_ELEMENT__EALL_ATTRIBUTES :
-				return !getEAllAttributes().isEmpty();
-			case DTDPackage.DTD_ELEMENT__EALL_REFERENCES :
-				return !getEAllReferences().isEmpty();
-			case DTDPackage.DTD_ELEMENT__EREFERENCES :
-				return eReferences != null && !getEReferences().isEmpty();
-			case DTDPackage.DTD_ELEMENT__EATTRIBUTES :
-				return eAttributes != null && !getEAttributes().isEmpty();
-			case DTDPackage.DTD_ELEMENT__EALL_CONTAINMENTS :
-				return !getEAllContainments().isEmpty();
-			case DTDPackage.DTD_ELEMENT__EALL_OPERATIONS :
-				return !getEAllOperations().isEmpty();
-			case DTDPackage.DTD_ELEMENT__EALL_STRUCTURAL_FEATURES :
-				return !getEAllStructuralFeatures().isEmpty();
-			case DTDPackage.DTD_ELEMENT__EALL_SUPER_TYPES :
-				return !getEAllSuperTypes().isEmpty();
-			case DTDPackage.DTD_ELEMENT__EID_ATTRIBUTE :
-				return getEIDAttribute() != null;
-			case DTDPackage.DTD_ELEMENT__DTD_FILE :
-				return getDTDFile() != null;
-			case DTDPackage.DTD_ELEMENT__COMMENT :
-				return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
-			case DTDPackage.DTD_ELEMENT__CONTENT :
-				return content != null;
-			case DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE :
-				return dtdAttribute != null && !getDTDAttribute().isEmpty();
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) {
-		if (baseClass == DTDContent.class) {
-			switch (derivedFeatureID) {
-				case DTDPackage.DTD_ELEMENT__DTD_FILE :
-					return DTDPackage.DTD_CONTENT__DTD_FILE;
-				default :
-					return -1;
-			}
-		}
-		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) {
-		if (baseClass == DTDContent.class) {
-			switch (baseFeatureID) {
-				case DTDPackage.DTD_CONTENT__DTD_FILE :
-					return DTDPackage.DTD_ELEMENT__DTD_FILE;
-				default :
-					return -1;
-			}
-		}
-		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String toString() {
-		if (eIsProxy())
-			return super.toString();
-
-		StringBuffer result = new StringBuffer(super.toString());
-		result.append(" (comment: "); //$NON-NLS-1$
-		result.append(comment);
-		result.append(')');
-		return result.toString();
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ELEMENT__EANNOTATIONS :
-				getEAnnotations().clear();
-				getEAnnotations().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT__NAME :
-				setName((String) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS_NAME :
-				setInstanceClassName((String) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS :
-				setInstanceClass((Class) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT__ABSTRACT :
-				setAbstract(((Boolean) newValue).booleanValue());
-				return;
-			case DTDPackage.DTD_ELEMENT__INTERFACE :
-				setInterface(((Boolean) newValue).booleanValue());
-				return;
-			case DTDPackage.DTD_ELEMENT__ESUPER_TYPES :
-				getESuperTypes().clear();
-				getESuperTypes().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT__EOPERATIONS :
-				getEOperations().clear();
-				getEOperations().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT__EREFERENCES :
-				getEReferences().clear();
-				getEReferences().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT__EATTRIBUTES :
-				getEAttributes().clear();
-				getEAttributes().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT__DTD_FILE :
-				setDTDFile((DTDFile) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT__COMMENT :
-				setComment((String) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT__CONTENT :
-				setContent((DTDElementContent) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE :
-				getDTDAttribute().clear();
-				getDTDAttribute().addAll((Collection) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ELEMENT__EANNOTATIONS :
-				getEAnnotations().clear();
-				return;
-			case DTDPackage.DTD_ELEMENT__NAME :
-				setName(NAME_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS_NAME :
-				setInstanceClassName(INSTANCE_CLASS_NAME_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ELEMENT__INSTANCE_CLASS :
-				setInstanceClass(INSTANCE_CLASS_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ELEMENT__ABSTRACT :
-				setAbstract(ABSTRACT_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ELEMENT__INTERFACE :
-				setInterface(INTERFACE_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ELEMENT__ESUPER_TYPES :
-				getESuperTypes().clear();
-				return;
-			case DTDPackage.DTD_ELEMENT__EOPERATIONS :
-				getEOperations().clear();
-				return;
-			case DTDPackage.DTD_ELEMENT__EREFERENCES :
-				getEReferences().clear();
-				return;
-			case DTDPackage.DTD_ELEMENT__EATTRIBUTES :
-				getEAttributes().clear();
-				return;
-			case DTDPackage.DTD_ELEMENT__DTD_FILE :
-				setDTDFile((DTDFile) null);
-				return;
-			case DTDPackage.DTD_ELEMENT__COMMENT :
-				setComment(COMMENT_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ELEMENT__CONTENT :
-				setContent((DTDElementContent) null);
-				return;
-			case DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE :
-				getDTDAttribute().clear();
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public DTDFile getDTDFile() {
-		if (eContainerFeatureID != DTDPackage.DTD_ELEMENT__DTD_FILE)
-			return null;
-		return (DTDFile) eContainer;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void setDTDFile(DTDFile newDTDFile) {
-		if (newDTDFile != eContainer || (eContainerFeatureID != DTDPackage.DTD_ELEMENT__DTD_FILE && newDTDFile != null)) {
-			if (EcoreUtil.isAncestor(this, newDTDFile))
-				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
-			NotificationChain msgs = null;
-			if (eContainer != null)
-				msgs = eBasicRemoveFromContainer(msgs);
-			if (newDTDFile != null)
-				msgs = ((InternalEObject) newDTDFile).eInverseAdd(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
-			msgs = eBasicSetContainer((InternalEObject) newDTDFile, DTDPackage.DTD_ELEMENT__DTD_FILE, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT__DTD_FILE, newDTDFile, newDTDFile));
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementReferenceContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementReferenceContentImpl.java
deleted file mode 100644
index fa2b885..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementReferenceContentImpl.java
+++ /dev/null
@@ -1,242 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-/**
- * @generated
- */
-public class DTDElementReferenceContentImpl extends DTDRepeatableContentImpl implements DTDElementReferenceContent {
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected DTDElement referencedElement = null;
-
-	public DTDElementReferenceContentImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDElementReferenceContent();
-	}
-
-	public String unparseRepeatableContent() {
-		return getContentName();
-	}
-
-	public String getContentName() {
-		DTDElement e = getReferencedElement();
-		if (e == null)
-			return ""; //$NON-NLS-1$
-		return e.getName();
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public DTDElement getReferencedElement() {
-		if (referencedElement != null && referencedElement.eIsProxy()) {
-			DTDElement oldReferencedElement = referencedElement;
-			referencedElement = (DTDElement) EcoreUtil.resolve(referencedElement, this);
-			if (referencedElement != oldReferencedElement) {
-				if (eNotificationRequired())
-					eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT, oldReferencedElement, referencedElement));
-			}
-		}
-		return referencedElement;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDElement basicGetReferencedElement() {
-		return referencedElement;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void setReferencedElement(DTDElement newReferencedElement) {
-		DTDElement oldReferencedElement = referencedElement;
-		referencedElement = newReferencedElement;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT, oldReferencedElement, referencedElement));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
-					return eBasicSetContainer(null, DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
-					return eBasicSetContainer(null, DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
-				case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
-				return getGroup();
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
-				return getElement();
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__OCCURRENCE :
-				return getOccurrence();
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT :
-				if (resolve)
-					return getReferencedElement();
-				return basicGetReferencedElement();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
-				return getGroup() != null;
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
-				return getElement() != null;
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__OCCURRENCE :
-				return occurrence != OCCURRENCE_EDEFAULT;
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT :
-				return referencedElement != null;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
-				setGroup((DTDGroupContent) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
-				setElement((DTDElement) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__OCCURRENCE :
-				setOccurrence((DTDOccurrenceType) newValue);
-				return;
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT :
-				setReferencedElement((DTDElement) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
-				setGroup((DTDGroupContent) null);
-				return;
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
-				setElement((DTDElement) null);
-				return;
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__OCCURRENCE :
-				setOccurrence(OCCURRENCE_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT :
-				setReferencedElement((DTDElement) null);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEmptyContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEmptyContentImpl.java
deleted file mode 100644
index 2077db2..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEmptyContentImpl.java
+++ /dev/null
@@ -1,172 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-/**
- * @generated
- */
-public class DTDEmptyContentImpl extends DTDElementContentImpl implements DTDEmptyContent {
-
-	public DTDEmptyContentImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDEmptyContent();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_EMPTY_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_EMPTY_CONTENT__ELEMENT, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
-					return eBasicSetContainer(null, DTDPackage.DTD_EMPTY_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
-					return eBasicSetContainer(null, DTDPackage.DTD_EMPTY_CONTENT__ELEMENT, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
-				case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
-				return getGroup();
-			case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
-				return getElement();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
-				setGroup((DTDGroupContent) newValue);
-				return;
-			case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
-				setElement((DTDElement) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
-				setGroup((DTDGroupContent) null);
-				return;
-			case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
-				setElement((DTDElement) null);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
-				return getGroup() != null;
-			case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
-				return getElement() != null;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	public String getContentName() {
-		return "EMPTY"; //$NON-NLS-1$
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityContentImpl.java
deleted file mode 100644
index 48cade3..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityContentImpl.java
+++ /dev/null
@@ -1,193 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-
-/**
- * @generated
- */
-public abstract class DTDEntityContentImpl extends EObjectImpl implements DTDEntityContent {
-
-	public DTDEntityContentImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDEntityContent();
-	}
-
-	public String getPathname() {
-		return DTDPathnameUtil.makePath(getDTDEntity().getPathname(), "Content", null, -1); //$NON-NLS-1$
-	}
-
-	public DTDObject findObject(String relativePath) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public DTDEntity getDTDEntity() {
-		if (eContainerFeatureID != DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY)
-			return null;
-		return (DTDEntity) eContainer;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void setDTDEntity(DTDEntity newDTDEntity) {
-		if (newDTDEntity != eContainer || (eContainerFeatureID != DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY && newDTDEntity != null)) {
-			if (EcoreUtil.isAncestor(this, newDTDEntity))
-				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
-			NotificationChain msgs = null;
-			if (eContainer != null)
-				msgs = eBasicRemoveFromContainer(msgs);
-			if (newDTDEntity != null)
-				msgs = ((InternalEObject) newDTDEntity).eInverseAdd(this, DTDPackage.DTD_ENTITY__CONTENT, DTDEntity.class, msgs);
-			msgs = eBasicSetContainer((InternalEObject) newDTDEntity, DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY, newDTDEntity, newDTDEntity));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
-					return eBasicSetContainer(null, DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_ENTITY__CONTENT, DTDEntity.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
-				return getDTDEntity();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
-				return getDTDEntity() != null;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
-				setDTDEntity((DTDEntity) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
-				setDTDEntity((DTDEntity) null);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/*
-	 * @see DTDEntityContent#unparse()
-	 */
-	public String unparse() {
-		return null;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityImpl.java
deleted file mode 100644
index eeeb09d..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityImpl.java
+++ /dev/null
@@ -1,1198 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.notify.impl.NotificationChainImpl;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Entity</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#isParameterEntity <em>Parameter Entity</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#getContent <em>Content</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#getParmEntityRef <em>Parm Entity Ref</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#getEntityReference <em>Entity Reference</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#getAttributeNameReference <em>Attribute Name Reference</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDEntityImpl#getAttributeTypeReference <em>Attribute Type Reference</em>}</li>
- * </ul>
- * </p>
- * 
- * @generated
- */
-public class DTDEntityImpl extends DTDContentImpl implements DTDEntity, ENamedElement, DTDContent {
-
-	public String getPathname() {
-		return DTDPathnameUtil.makePath(null, "Ent", getName(), -1); //$NON-NLS-1$
-	}
-
-
-	public DTDObject findObject(String relativePath) {
-		Object[] result = DTDPathnameUtil.parsePathComponent(relativePath);
-
-
-		String type = (String) result[0];
-
-
-		if (type == null)
-			return null;
-
-
-		DTDObject obj = null;
-		if (type.equals("Content")) { //$NON-NLS-1$
-			obj = getContent();
-		}
-		else {
-			return null;
-		}
-
-
-		String restPath = (String) result[3];
-
-		if ((restPath == null) || (obj == null)) {
-			return obj;
-		}
-		else {
-			return obj.findObject(restPath);
-		}
-	}
-
-
-	// ugly hack for now since we don't have multiple inheritance.
-	// Would rather have all this stuff in a base class but these
-	// classes are inheriting from sometimes different mof classes
-	DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-
-	/**
-	 * Get the value of startOffset.
-	 * 
-	 * @return value of startOffset.
-	 */
-	public int getStartOffset() {
-		return lexInfo.getStartOffset();
-	}
-
-	/**
-	 * Set the value of startOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to startOffset.
-	 */
-	public void setStartOffset(int v) {
-		lexInfo.setStartOffset(v);
-	}
-
-	/**
-	 * Get the value of endOffset.
-	 * 
-	 * @return value of endOffset.
-	 */
-	public int getEndOffset() {
-		return lexInfo.getEndOffset();
-	}
-
-	/**
-	 * Set the value of endOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to endOffset.
-	 */
-	public void setEndOffset(int v) {
-		lexInfo.setEndOffset(v);
-	}
-
-
-
-	/**
-	 * The default value of the '{@link #getComment() <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getComment()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final String COMMENT_EDEFAULT = null;
-
-	/**
-	 * The cached value of the '{@link #getComment() <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getComment()
-	 * @generated
-	 * @ordered
-	 */
-	protected String comment = COMMENT_EDEFAULT;
-
-	/**
-	 * The default value of the '{@link #isParameterEntity() <em>Parameter Entity</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #isParameterEntity()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final boolean PARAMETER_ENTITY_EDEFAULT = false;
-
-	/**
-	 * The cached value of the '{@link #isParameterEntity() <em>Parameter Entity</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #isParameterEntity()
-	 * @generated
-	 * @ordered
-	 */
-	protected boolean parameterEntity = PARAMETER_ENTITY_EDEFAULT;
-
-	/**
-	 * The cached value of the '{@link #getContent() <em>Content</em>}'
-	 * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getContent()
-	 * @generated
-	 * @ordered
-	 */
-	protected DTDEntityContent content = null;
-
-	/**
-	 * The cached value of the '{@link #getParmEntityRef() <em>Parm Entity Ref</em>}'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getParmEntityRef()
-	 * @generated
-	 * @ordered
-	 */
-	protected DTDParameterEntityReference parmEntityRef = null;
-
-	/**
-	 * The cached value of the '{@link #getEntityReference() <em>Entity Reference</em>}'
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getEntityReference()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList entityReference = null;
-
-	/**
-	 * The cached value of the '{@link #getAttributeNameReference() <em>Attribute Name Reference</em>}'
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getAttributeNameReference()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList attributeNameReference = null;
-
-	/**
-	 * The cached value of the '{@link #getAttributeTypeReference() <em>Attribute Type Reference</em>}'
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getAttributeTypeReference()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList attributeTypeReference = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected DTDEntityImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDEntity();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String getComment() {
-		return comment;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setComment(String newComment) {
-		String oldComment = comment;
-		comment = newComment;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY__COMMENT, oldComment, comment));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public boolean isParameterEntity() {
-		return parameterEntity;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setParameterEntity(boolean newParameterEntity) {
-		boolean oldParameterEntity = parameterEntity;
-		parameterEntity = newParameterEntity;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY__PARAMETER_ENTITY, oldParameterEntity, parameterEntity));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDEntityContent getContent() {
-		return content;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain basicSetContent(DTDEntityContent newContent, NotificationChain msgs) {
-		DTDEntityContent oldContent = content;
-		content = newContent;
-		if (eNotificationRequired()) {
-			if (msgs == null)
-				msgs = new NotificationChainImpl(4);
-			msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY__CONTENT, oldContent, newContent));
-		}
-		return msgs;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setContent(DTDEntityContent newContent) {
-		if (newContent != content) {
-			NotificationChain msgs = null;
-			if (content != null)
-				msgs = ((InternalEObject) content).eInverseRemove(this, DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY, DTDEntityContent.class, msgs);
-			if (newContent != null)
-				msgs = ((InternalEObject) newContent).eInverseAdd(this, DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY, DTDEntityContent.class, msgs);
-			msgs = basicSetContent(newContent, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY__CONTENT, newContent, newContent));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDParameterEntityReference getParmEntityRef() {
-		if (parmEntityRef != null && parmEntityRef.eIsProxy()) {
-			DTDParameterEntityReference oldParmEntityRef = parmEntityRef;
-			parmEntityRef = (DTDParameterEntityReference) EcoreUtil.resolve(parmEntityRef, this);
-			if (parmEntityRef != oldParmEntityRef) {
-				if (eNotificationRequired())
-					eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_ENTITY__PARM_ENTITY_REF, oldParmEntityRef, parmEntityRef));
-			}
-		}
-		return parmEntityRef;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDParameterEntityReference basicGetParmEntityRef() {
-		return parmEntityRef;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain basicSetParmEntityRef(DTDParameterEntityReference newParmEntityRef, NotificationChain msgs) {
-		DTDParameterEntityReference oldParmEntityRef = parmEntityRef;
-		parmEntityRef = newParmEntityRef;
-		if (eNotificationRequired()) {
-			if (msgs == null)
-				msgs = new NotificationChainImpl(4);
-			msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY__PARM_ENTITY_REF, oldParmEntityRef, newParmEntityRef));
-		}
-		return msgs;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setParmEntityRef(DTDParameterEntityReference newParmEntityRef) {
-		if (newParmEntityRef != parmEntityRef) {
-			NotificationChain msgs = null;
-			if (parmEntityRef != null)
-				msgs = ((InternalEObject) parmEntityRef).eInverseRemove(this, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY, DTDParameterEntityReference.class, msgs);
-			if (newParmEntityRef != null)
-				msgs = ((InternalEObject) newParmEntityRef).eInverseAdd(this, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY, DTDParameterEntityReference.class, msgs);
-			msgs = basicSetParmEntityRef(newParmEntityRef, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY__PARM_ENTITY_REF, newParmEntityRef, newParmEntityRef));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EList getEntityReference() {
-		if (entityReference == null) {
-			entityReference = new EObjectWithInverseResolvingEList(DTDEntityReferenceContent.class, this, DTDPackage.DTD_ENTITY__ENTITY_REFERENCE, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY);
-		}
-		return entityReference;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EList getAttributeNameReference() {
-		if (attributeNameReference == null) {
-			attributeNameReference = new EObjectWithInverseResolvingEList(DTDAttribute.class, this, DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY);
-		}
-		return attributeNameReference;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EList getAttributeTypeReference() {
-		if (attributeTypeReference == null) {
-			attributeTypeReference = new EObjectWithInverseResolvingEList(DTDAttribute.class, this, DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY);
-		}
-		return attributeTypeReference;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ENTITY__DTD_FILE :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ENTITY__DTD_FILE, msgs);
-				case DTDPackage.DTD_ENTITY__CONTENT :
-					if (content != null)
-						msgs = ((InternalEObject) content).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DTDPackage.DTD_ENTITY__CONTENT, null, msgs);
-					return basicSetContent((DTDEntityContent) otherEnd, msgs);
-				case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF :
-					if (parmEntityRef != null)
-						msgs = ((InternalEObject) parmEntityRef).eInverseRemove(this, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY, DTDParameterEntityReference.class, msgs);
-					return basicSetParmEntityRef((DTDParameterEntityReference) otherEnd, msgs);
-				case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE :
-					return ((InternalEList) getEntityReference()).basicAdd(otherEnd, msgs);
-				case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE :
-					return ((InternalEList) getAttributeNameReference()).basicAdd(otherEnd, msgs);
-				case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE :
-					return ((InternalEList) getAttributeTypeReference()).basicAdd(otherEnd, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ENTITY__DTD_FILE :
-					return eBasicSetContainer(null, DTDPackage.DTD_ENTITY__DTD_FILE, msgs);
-				case DTDPackage.DTD_ENTITY__CONTENT :
-					return basicSetContent(null, msgs);
-				case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF :
-					return basicSetParmEntityRef(null, msgs);
-				case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE :
-					return ((InternalEList) getEntityReference()).basicRemove(otherEnd, msgs);
-				case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE :
-					return ((InternalEList) getAttributeNameReference()).basicRemove(otherEnd, msgs);
-				case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE :
-					return ((InternalEList) getAttributeTypeReference()).basicRemove(otherEnd, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_ENTITY__DTD_FILE :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENTITY__DTD_FILE :
-				return getDTDFile();
-			case DTDPackage.DTD_ENTITY__COMMENT :
-				return getComment();
-			case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY :
-				return isParameterEntity() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_ENTITY__CONTENT :
-				return getContent();
-			case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF :
-				if (resolve)
-					return getParmEntityRef();
-				return basicGetParmEntityRef();
-			case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE :
-				return getEntityReference();
-			case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE :
-				return getAttributeNameReference();
-			case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE :
-				return getAttributeTypeReference();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENTITY__DTD_FILE :
-				setDTDFile((DTDFile) newValue);
-				return;
-			case DTDPackage.DTD_ENTITY__COMMENT :
-				setComment((String) newValue);
-				return;
-			case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY :
-				setParameterEntity(((Boolean) newValue).booleanValue());
-				return;
-			case DTDPackage.DTD_ENTITY__CONTENT :
-				setContent((DTDEntityContent) newValue);
-				return;
-			case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF :
-				setParmEntityRef((DTDParameterEntityReference) newValue);
-				return;
-			case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE :
-				getEntityReference().clear();
-				getEntityReference().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE :
-				getAttributeNameReference().clear();
-				getAttributeNameReference().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE :
-				getAttributeTypeReference().clear();
-				getAttributeTypeReference().addAll((Collection) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENTITY__DTD_FILE :
-				setDTDFile((DTDFile) null);
-				return;
-			case DTDPackage.DTD_ENTITY__COMMENT :
-				setComment(COMMENT_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY :
-				setParameterEntity(PARAMETER_ENTITY_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ENTITY__CONTENT :
-				setContent((DTDEntityContent) null);
-				return;
-			case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF :
-				setParmEntityRef((DTDParameterEntityReference) null);
-				return;
-			case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE :
-				getEntityReference().clear();
-				return;
-			case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE :
-				getAttributeNameReference().clear();
-				return;
-			case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE :
-				getAttributeTypeReference().clear();
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENTITY__DTD_FILE :
-				return getDTDFile() != null;
-			case DTDPackage.DTD_ENTITY__COMMENT :
-				return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
-			case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY :
-				return parameterEntity != PARAMETER_ENTITY_EDEFAULT;
-			case DTDPackage.DTD_ENTITY__CONTENT :
-				return content != null;
-			case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF :
-				return parmEntityRef != null;
-			case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE :
-				return entityReference != null && !getEntityReference().isEmpty();
-			case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE :
-				return attributeNameReference != null && !getAttributeNameReference().isEmpty();
-			case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE :
-				return attributeTypeReference != null && !getAttributeTypeReference().isEmpty();
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String toString() {
-		if (eIsProxy())
-			return super.toString();
-
-		StringBuffer result = new StringBuffer(super.toString());
-		result.append(" (comment: "); //$NON-NLS-1$
-		result.append(comment);
-		result.append(", parameterEntity: "); //$NON-NLS-1$
-		result.append(parameterEntity);
-		result.append(')');
-		return result.toString();
-	}
-
-} // DTDEntityImpl
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-//
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-// //public class DTDEntityImpl extends ENamespaceImpl implements DTDEntity,
-// ENamespace, DTDContent{
-// -------------------GENERICRULES.JSED-------------------
-
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected String comment = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected Boolean parameterEntity = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected DTDEntityContent content = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected DTDParameterEntityReference parmEntityRef = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected EList entityReference = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected EList attributeNameReference = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected EList attributeTypeReference = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setComment = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setParameterEntity = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setContent = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setParmEntityRef = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// private DTDContentImpl dtdContentDelegate = null;
-
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EObject initInstance() {
-// setEMetaObj(eClassDTDEntity());
-// initInstanceDelegates();
-// return this;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected void initInstanceDelegates() {
-// super.initInstanceDelegates();
-//
-// getDtdContentDelegate().refSetDelegateOwner(this);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDPackage ePackageDTD() {
-// return
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDEntity() {
-// return
-// ((DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI)).getDTDEntity();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public String getComment() {
-// if (this.setComment) return this.comment;
-// else return
-// (String)DTDPackage.eINSTANCE.getDTDEntity_Comment().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setComment(String value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDEntity_Comment(),this.comment,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetComment() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDEntity_Comment()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetComment() {
-// return setComment;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public Boolean getParameterEntity() {
-// if (this.setParameterEntity) return this.parameterEntity;
-// else return
-// (Boolean)DTDPackage.eINSTANCE.getDTDEntity_ParameterEntity().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public boolean isParameterEntity() {
-// Boolean result = getParameterEntity();
-// return result != null ? result.booleanValue() : false;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setParameterEntity(Boolean value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDEntity_ParameterEntity(),this.parameterEntity,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setParameterEntity(boolean value) {
-// setParameterEntity(value?Boolean.TRUE:Boolean.FALSE);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetParameterEntity() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDEntity_ParameterEntity()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetParameterEntity() {
-// return setParameterEntity;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public DTDEntityContent getContent() {
-// try {
-// if (this.content == null) return null;
-// this.content = (DTDEntityContent)
-// ((InternalEObject)this.content).resolve(this);
-// if (this.content==null) this.setContent = false;
-// return this.content;
-// } catch (Exception e) {
-// return null;
-// }
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setContent(DTDEntityContent l) {
-// refSetValueForRefObjectSF(DTDPackage.eINSTANCE.getDTDEntity_Content(),this.content,l);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetContent() {
-// refUnsetValueForRefObjectSF(DTDPackage.eINSTANCE.getDTDEntity_Content(),this.content);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetContent() {
-// return setContent;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public DTDParameterEntityReference getParmEntityRef() {
-// try {
-// if (this.parmEntityRef == null) return null;
-// this.parmEntityRef = (DTDParameterEntityReference)
-// ((InternalEObject)this.parmEntityRef).resolve(this,
-// DTDPackage.eINSTANCE.getDTDEntity_ParmEntityRef());
-// if (this.parmEntityRef==null) this.setParmEntityRef = false;
-// return this.parmEntityRef;
-// } catch (Exception e) {
-// return null;
-// }
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setParmEntityRef(DTDParameterEntityReference l) {
-// refSetValueForSVReference(DTDPackage.eINSTANCE.getDTDEntity_ParmEntityRef(),this.parmEntityRef,l);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetParmEntityRef() {
-// refUnsetValueForSVReference(DTDPackage.eINSTANCE.getDTDEntity_ParmEntityRef(),this.parmEntityRef);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetParmEntityRef() {
-// return setParmEntityRef;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public EList getEntityReference() {
-// if (this.entityReference==null) {
-// this.entityReference=newCollection(this,DTDPackage.eINSTANCE.getDTDEntity_EntityReference(),
-// true);
-// }
-// return this.entityReference;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public EList getAttributeNameReference() {
-// if (this.attributeNameReference==null) {
-// this.attributeNameReference=newCollection(this,DTDPackage.eINSTANCE.getDTDEntity_AttributeNameReference(),
-// true);
-// }
-// return this.attributeNameReference;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public EList getAttributeTypeReference() {
-// if (this.attributeTypeReference==null) {
-// this.attributeTypeReference=newCollection(this,DTDPackage.eINSTANCE.getDTDEntity_AttributeTypeReference(),
-// true);
-// }
-// return this.attributeTypeReference;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object eGet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eGet(feature);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT: return getComment();
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY: return getParameterEntity();
-// case DTDPackage.DTD_ENTITY__CONTENT: return getContent();
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF: return getParmEntityRef();
-// case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE: return getEntityReference();
-// case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE: return
-// getAttributeNameReference();
-// case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE: return
-// getAttributeTypeReference();
-// case DTDPackage.DTD_ENTITY__DTD_FILE: return getDTDFile();
-//
-// }
-// return super.eGet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object refBasicValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicValue(feature);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT:
-// return this.setComment? this.comment : null;
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY:
-// return this.setParameterEntity? this.parameterEntity : null;
-// case DTDPackage.DTD_ENTITY__CONTENT:
-// if (!this.setContent||this.content==null) return null;
-// if (((InternalEObject)this.content).refIsDeleted()) {this.content=null;
-// this.setContent=false;}
-// return this.content;
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF:
-// if (!this.setParmEntityRef||this.parmEntityRef==null) return null;
-// if (((InternalEObject)this.parmEntityRef).refIsDeleted())
-// {this.parmEntityRef=null; this.setParmEntityRef=false;}
-// return this.parmEntityRef;
-// case DTDPackage.DTD_ENTITY__ENTITY_REFERENCE:
-// return this.entityReference;
-// case DTDPackage.DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE:
-// return this.attributeNameReference;
-// case DTDPackage.DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE:
-// return this.attributeTypeReference;
-// case DTDPackage.DTD_ENTITY__DTD_FILE: return
-// ((InternalEObject)getDtdContentDelegate()).refBasicValue(feature);
-//
-// }
-// return super.refBasicValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean eIsSet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eIsSet(feature);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT: return isSetComment();
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY: return
-// isSetParameterEntity();
-// case DTDPackage.DTD_ENTITY__CONTENT: return isSetContent();
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF: return isSetParmEntityRef();
-// case DTDPackage.DTD_ENTITY__DTD_FILE: return isSetDTDFile();
-//
-// }
-// return super.eIsSet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eSet(EStructuralFeature feature, Object newValue) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eSet(feature, newValue);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT: {
-// setComment((String)newValue);
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY: {
-// setParameterEntity((newValue instanceof
-// String)?Boolean.valueOf((String)newValue):(Boolean)newValue);
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__CONTENT: {
-// setContent((DTDEntityContent)newValue);
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF: {
-// setParmEntityRef((DTDParameterEntityReference)newValue);
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__DTD_FILE: {
-// setDTDFile((DTDFile)newValue);
-// return;
-// }
-//
-// }
-// super.eSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification eBasicSet(EStructuralFeature feature, Object newValue)
-// {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eBasicSet(feature, newValue);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT: {
-// Object oldValue = this.comment;
-// this.comment = (String)newValue;
-// this.setComment = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_Comment(),oldValue,newValue);
-// }
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY: {
-// Object oldValue = this.parameterEntity;
-// this.parameterEntity = (Boolean)newValue;
-// this.setParameterEntity = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_ParameterEntity(),oldValue,newValue);
-// }
-// case DTDPackage.DTD_ENTITY__CONTENT: {
-// Object oldValue = this.content;
-// this.content = (DTDEntityContent)newValue;
-// this.setContent = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_Content(),oldValue,newValue);
-// }
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF: {
-// Object oldValue = this.parmEntityRef;
-// this.parmEntityRef = (DTDParameterEntityReference)newValue;
-// this.setParmEntityRef = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_ParmEntityRef(),oldValue,newValue);
-// }
-//
-// }
-// return super.eBasicSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eUnset(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eUnset(feature);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT: {
-// unsetComment();
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY: {
-// unsetParameterEntity();
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__CONTENT: {
-// unsetContent();
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF: {
-// unsetParmEntityRef();
-// return;
-// }
-// case DTDPackage.DTD_ENTITY__DTD_FILE: {
-// unsetDTDFile();
-// return;
-// }
-//
-// }
-// super.eUnset(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification refBasicUnsetValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicUnsetValue(feature);
-// }
-// switch (eClassDTDEntity().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_ENTITY__COMMENT: {
-// Object oldValue = this.comment;
-// this.comment = null;
-// this.setComment = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_Comment(),oldValue,getComment());
-// }
-// case DTDPackage.DTD_ENTITY__PARAMETER_ENTITY: {
-// Object oldValue = this.parameterEntity;
-// this.parameterEntity = null;
-// this.setParameterEntity = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_ParameterEntity(),oldValue,getParameterEntity());
-// }
-// case DTDPackage.DTD_ENTITY__CONTENT: {
-// Object oldValue = this.content;
-// this.content = null;
-// this.setContent = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_Content(),oldValue,null);
-// }
-// case DTDPackage.DTD_ENTITY__PARM_ENTITY_REF: {
-// Object oldValue = this.parmEntityRef;
-// this.parmEntityRef = null;
-// this.setParmEntityRef = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDEntity_ParmEntityRef(),oldValue,null);
-// }
-//
-// }
-// return super.refBasicUnsetValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected DTDContentImpl getDtdContentDelegate() {
-// if (dtdContentDelegate == null) {
-// DTDPackage pkg =
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// dtdContentDelegate=(DTDContentImpl)pkg.eCreateInstance(pkg.DTD_CONTENT);
-// dtdContentDelegate.initInstance();
-// }
-// return dtdContentDelegate;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDContent() {
-// return getDtdContentDelegate().eClass();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDFile getDTDFile() {
-// return getDtdContentDelegate().getDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setDTDFile(DTDFile value) {
-// getDtdContentDelegate().setDTDFile(value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetDTDFile() {
-// getDtdContentDelegate().unsetDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetDTDFile() {
-// return getDtdContentDelegate().isSetDTDFile();
-// }
-// }
-// -------------------GENERICRULES.JSED-------------------
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityReferenceContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityReferenceContentImpl.java
deleted file mode 100644
index 7d26a5a..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityReferenceContentImpl.java
+++ /dev/null
@@ -1,323 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.notify.impl.NotificationChainImpl;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-/**
- * @generated
- */
-public class DTDEntityReferenceContentImpl extends DTDRepeatableContentImpl implements DTDEntityReferenceContent {
-
-	public DTDEntityReferenceContentImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDEntityReferenceContent();
-	}
-
-	public String getContentName() {
-		DTDEntity e = getElementReferencedEntity();
-		if (e == null)
-			return ""; //$NON-NLS-1$
-		return e.getName();
-	}
-
-	public String unparseRepeatableContent() {
-		DTDEntity entityRef = getElementReferencedEntity();
-		if (entityRef.isParameterEntity()) {
-			return "%" + getContentName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		else {
-			return "&" + getContentName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-
-	// ugly hack for now since we don't have multiple inheritance.
-	// Would rather have all this stuff in a base class but these
-	// classes are inheriting from sometimes different mof classes
-	DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected DTDEntity elementReferencedEntity = null;
-
-	/**
-	 * Get the value of startOffset.
-	 * 
-	 * @return value of startOffset.
-	 */
-	public int getStartOffset() {
-		return lexInfo.getStartOffset();
-	}
-
-	/**
-	 * Set the value of startOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to startOffset.
-	 */
-	public void setStartOffset(int v) {
-		lexInfo.setStartOffset(v);
-	}
-
-	/**
-	 * Get the value of endOffset.
-	 * 
-	 * @return value of endOffset.
-	 */
-	public int getEndOffset() {
-		return lexInfo.getEndOffset();
-	}
-
-	/**
-	 * Set the value of endOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to endOffset.
-	 */
-	public void setEndOffset(int v) {
-		lexInfo.setEndOffset(v);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public DTDEntity getElementReferencedEntity() {
-		if (elementReferencedEntity != null && elementReferencedEntity.eIsProxy()) {
-			DTDEntity oldElementReferencedEntity = elementReferencedEntity;
-			elementReferencedEntity = (DTDEntity) EcoreUtil.resolve(elementReferencedEntity, this);
-			if (elementReferencedEntity != oldElementReferencedEntity) {
-				if (eNotificationRequired())
-					eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY, oldElementReferencedEntity, elementReferencedEntity));
-			}
-		}
-		return elementReferencedEntity;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDEntity basicGetElementReferencedEntity() {
-		return elementReferencedEntity;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain basicSetElementReferencedEntity(DTDEntity newElementReferencedEntity, NotificationChain msgs) {
-		DTDEntity oldElementReferencedEntity = elementReferencedEntity;
-		elementReferencedEntity = newElementReferencedEntity;
-		if (eNotificationRequired()) {
-			if (msgs == null)
-				msgs = new NotificationChainImpl(4);
-			msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY, oldElementReferencedEntity, newElementReferencedEntity));
-		}
-		return msgs;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void setElementReferencedEntity(DTDEntity newElementReferencedEntity) {
-		if (newElementReferencedEntity != elementReferencedEntity) {
-			NotificationChain msgs = null;
-			if (elementReferencedEntity != null)
-				msgs = ((InternalEObject) elementReferencedEntity).eInverseRemove(this, DTDPackage.DTD_ENTITY__ENTITY_REFERENCE, DTDEntity.class, msgs);
-			if (newElementReferencedEntity != null)
-				msgs = ((InternalEObject) newElementReferencedEntity).eInverseAdd(this, DTDPackage.DTD_ENTITY__ENTITY_REFERENCE, DTDEntity.class, msgs);
-			msgs = basicSetElementReferencedEntity(newElementReferencedEntity, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY, newElementReferencedEntity, newElementReferencedEntity));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT, msgs);
-				case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY :
-					if (elementReferencedEntity != null)
-						msgs = ((InternalEObject) elementReferencedEntity).eInverseRemove(this, DTDPackage.DTD_ENTITY__ENTITY_REFERENCE, DTDEntity.class, msgs);
-					return basicSetElementReferencedEntity((DTDEntity) otherEnd, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
-					return eBasicSetContainer(null, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
-					return eBasicSetContainer(null, DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT, msgs);
-				case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY :
-					return basicSetElementReferencedEntity(null, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
-				case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
-				return getGroup();
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
-				return getElement();
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__OCCURRENCE :
-				return getOccurrence();
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY :
-				if (resolve)
-					return getElementReferencedEntity();
-				return basicGetElementReferencedEntity();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
-				return getGroup() != null;
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
-				return getElement() != null;
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__OCCURRENCE :
-				return occurrence != OCCURRENCE_EDEFAULT;
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY :
-				return elementReferencedEntity != null;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
-				setGroup((DTDGroupContent) newValue);
-				return;
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
-				setElement((DTDElement) newValue);
-				return;
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__OCCURRENCE :
-				setOccurrence((DTDOccurrenceType) newValue);
-				return;
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY :
-				setElementReferencedEntity((DTDEntity) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
-				setGroup((DTDGroupContent) null);
-				return;
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
-				setElement((DTDElement) null);
-				return;
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__OCCURRENCE :
-				setOccurrence(OCCURRENCE_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY :
-				setElementReferencedEntity((DTDEntity) null);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEnumerationTypeImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEnumerationTypeImpl.java
deleted file mode 100644
index 60a6d25..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEnumerationTypeImpl.java
+++ /dev/null
@@ -1,362 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EEnumImpl;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.DTDCoreMessages;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-/**
- * @generated
- */
-public class DTDEnumerationTypeImpl extends EEnumImpl implements DTDEnumerationType {
-	/**
-	 * The default value of the '{@link #getKind() <em>Kind</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getKind()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final DTDEnumGroupKind KIND_EDEFAULT = DTDEnumGroupKind.NAME_TOKEN_GROUP_LITERAL;
-
-	public final static String enumerationTypeDescriptions[] = {DTDCoreMessages._UI_ENUM_NAME_TOKENS_DESC, DTDCoreMessages._UI_ENUM_NOTATION_DESC}; //$NON-NLS-1$ //$NON-NLS-2$
-
-	public final static int enumerationTypeKinds[] = {DTDEnumGroupKind.NAME_TOKEN_GROUP, DTDEnumGroupKind.NOTATION_GROUP};
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected DTDEnumGroupKind kind = KIND_EDEFAULT;
-
-	public DTDEnumerationTypeImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDEnumerationType();
-	}
-
-	public EList getEnumLiterals() {
-		return getELiterals();
-	}
-
-	public String getEnumerationTypeDescription() {
-		return getEnumerationTypeDescription(getKind().getValue());
-	}
-
-	public static String getEnumerationTypeDescription(int kind) {
-		// it can only be 1 or 2, but maybe later...
-		if (kind >= 1 && kind <= 2) {
-			// we subtract 1 since the kind is 1 - based not zero based
-			return enumerationTypeDescriptions[kind - 1];
-		}
-		return null;
-	}
-
-	public String getPathname() {
-		// TBD
-		return ""; //$NON-NLS-1$
-	}
-
-	public DTDObject findObject(String relativePath) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public DTDEnumGroupKind getKind() {
-		return kind;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setKind(DTDEnumGroupKind newKind) {
-		DTDEnumGroupKind oldKind = kind;
-		kind = newKind == null ? KIND_EDEFAULT : newKind;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENUMERATION_TYPE__KIND, oldKind, kind));
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public DTDFile getDTDFile() {
-		if (eContainerFeatureID != DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE)
-			return null;
-		return (DTDFile) eContainer;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void setDTDFile(DTDFile newDTDFile) {
-		if (newDTDFile != eContainer || (eContainerFeatureID != DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE && newDTDFile != null)) {
-			if (EcoreUtil.isAncestor(this, newDTDFile))
-				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
-			NotificationChain msgs = null;
-			if (eContainer != null)
-				msgs = eBasicRemoveFromContainer(msgs);
-			if (newDTDFile != null)
-				msgs = ((InternalEObject) newDTDFile).eInverseAdd(this, DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE, DTDFile.class, msgs);
-			msgs = eBasicSetContainer((InternalEObject) newDTDFile, DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE, newDTDFile, newDTDFile));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ENUMERATION_TYPE__EANNOTATIONS :
-					return ((InternalEList) getEAnnotations()).basicAdd(otherEnd, msgs);
-				case DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE, msgs);
-				case DTDPackage.DTD_ENUMERATION_TYPE__ELITERALS :
-					return ((InternalEList) getELiterals()).basicAdd(otherEnd, msgs);
-				case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_ENUMERATION_TYPE__EANNOTATIONS :
-					return ((InternalEList) getEAnnotations()).basicRemove(otherEnd, msgs);
-				case DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE :
-					return eBasicSetContainer(null, DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE, msgs);
-				case DTDPackage.DTD_ENUMERATION_TYPE__ELITERALS :
-					return ((InternalEList) getELiterals()).basicRemove(otherEnd, msgs);
-				case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
-					return eBasicSetContainer(null, DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE :
-					return eContainer.eInverseRemove(this, EcorePackage.EPACKAGE__ECLASSIFIERS, EPackage.class, msgs);
-				case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE, DTDFile.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENUMERATION_TYPE__EANNOTATIONS :
-				return getEAnnotations();
-			case DTDPackage.DTD_ENUMERATION_TYPE__NAME :
-				return getName();
-			case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS_NAME :
-				return getInstanceClassName();
-			case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS :
-				return getInstanceClass();
-			case DTDPackage.DTD_ENUMERATION_TYPE__DEFAULT_VALUE :
-				return getDefaultValue();
-			case DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE :
-				return getEPackage();
-			case DTDPackage.DTD_ENUMERATION_TYPE__SERIALIZABLE :
-				return isSerializable() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_ENUMERATION_TYPE__ELITERALS :
-				return getELiterals();
-			case DTDPackage.DTD_ENUMERATION_TYPE__KIND :
-				return getKind();
-			case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
-				return getDTDFile();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENUMERATION_TYPE__EANNOTATIONS :
-				return eAnnotations != null && !getEAnnotations().isEmpty();
-			case DTDPackage.DTD_ENUMERATION_TYPE__NAME :
-				return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
-			case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS_NAME :
-				return INSTANCE_CLASS_NAME_EDEFAULT == null ? instanceClassName != null : !INSTANCE_CLASS_NAME_EDEFAULT.equals(instanceClassName);
-			case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS :
-				return INSTANCE_CLASS_EDEFAULT == null ? instanceClass != null : !INSTANCE_CLASS_EDEFAULT.equals(instanceClass);
-			case DTDPackage.DTD_ENUMERATION_TYPE__DEFAULT_VALUE :
-				return getDefaultValue() != null;
-			case DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE :
-				return getEPackage() != null;
-			case DTDPackage.DTD_ENUMERATION_TYPE__SERIALIZABLE :
-				return ((eFlags & SERIALIZABLE_EFLAG) != 0) != SERIALIZABLE_EDEFAULT;
-			case DTDPackage.DTD_ENUMERATION_TYPE__ELITERALS :
-				return eLiterals != null && !getELiterals().isEmpty();
-			case DTDPackage.DTD_ENUMERATION_TYPE__KIND :
-				return kind != KIND_EDEFAULT;
-			case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
-				return getDTDFile() != null;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENUMERATION_TYPE__EANNOTATIONS :
-				getEAnnotations().clear();
-				getEAnnotations().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__NAME :
-				setName((String) newValue);
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS_NAME :
-				setInstanceClassName((String) newValue);
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS :
-				setInstanceClass((Class) newValue);
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__SERIALIZABLE :
-				setSerializable(((Boolean) newValue).booleanValue());
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__ELITERALS :
-				getELiterals().clear();
-				getELiterals().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__KIND :
-				setKind((DTDEnumGroupKind) newValue);
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
-				setDTDFile((DTDFile) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_ENUMERATION_TYPE__EANNOTATIONS :
-				getEAnnotations().clear();
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__NAME :
-				setName(NAME_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS_NAME :
-				setInstanceClassName(INSTANCE_CLASS_NAME_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__INSTANCE_CLASS :
-				setInstanceClass(INSTANCE_CLASS_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__SERIALIZABLE :
-				setSerializable(SERIALIZABLE_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__ELITERALS :
-				getELiterals().clear();
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__KIND :
-				setKind(KIND_EDEFAULT);
-				return;
-			case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
-				setDTDFile((DTDFile) null);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public String toString() {
-		if (eIsProxy())
-			return super.toString();
-
-		StringBuffer result = new StringBuffer(super.toString());
-		result.append(" (kind: "); //$NON-NLS-1$
-		result.append(kind);
-		result.append(')');
-		return result.toString();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDExternalEntityImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDExternalEntityImpl.java
deleted file mode 100644
index 5925a39..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDExternalEntityImpl.java
+++ /dev/null
@@ -1,400 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.notify.impl.NotificationChainImpl;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-/**
- * @generated
- */
-public class DTDExternalEntityImpl extends DTDEntityContentImpl implements DTDExternalEntity {
-	/**
-	 * The default value of the '{@link #getSystemID() <em>System ID</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getSystemID()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final String SYSTEM_ID_EDEFAULT = null;
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected String systemID = SYSTEM_ID_EDEFAULT;
-	/**
-	 * The default value of the '{@link #getPublicID() <em>Public ID</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getPublicID()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final String PUBLIC_ID_EDEFAULT = null;
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected String publicID = PUBLIC_ID_EDEFAULT;
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected DTDNotation notation = null;
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected DTDFile entityReferencedFromAnotherFile = null;
-
-	public DTDExternalEntityImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDExternalEntity();
-	}
-
-	public String unparse() {
-		StringBuffer text = new StringBuffer(100);
-		if (getPublicID() == null || getPublicID().equals("")) { //$NON-NLS-1$
-			text.append("SYSTEM "); //$NON-NLS-1$
-		}
-		else {
-			text.append("PUBLIC \"").append(getPublicID()).append("\" "); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		String systemId = getSystemID();
-
-		text.append("\"").append(systemId).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
-
-		DTDNotation notation = getNotation();
-		if (notation != null)
-			text.append(" NDATA ").append(notation.getName()); //$NON-NLS-1$
-
-		return text.toString();
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public String getSystemID() {
-		return systemID;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void setSystemID(String newSystemID) {
-		String oldSystemID = systemID;
-		systemID = newSystemID;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_EXTERNAL_ENTITY__SYSTEM_ID, oldSystemID, systemID));
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public String getPublicID() {
-		return publicID;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void setPublicID(String newPublicID) {
-		String oldPublicID = publicID;
-		publicID = newPublicID;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_EXTERNAL_ENTITY__PUBLIC_ID, oldPublicID, publicID));
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public DTDNotation getNotation() {
-		if (notation != null && notation.eIsProxy()) {
-			DTDNotation oldNotation = notation;
-			notation = (DTDNotation) EcoreUtil.resolve(notation, this);
-			if (notation != oldNotation) {
-				if (eNotificationRequired())
-					eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION, oldNotation, notation));
-			}
-		}
-		return notation;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDNotation basicGetNotation() {
-		return notation;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain basicSetNotation(DTDNotation newNotation, NotificationChain msgs) {
-		DTDNotation oldNotation = notation;
-		notation = newNotation;
-		if (eNotificationRequired()) {
-			if (msgs == null)
-				msgs = new NotificationChainImpl(4);
-			msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION, oldNotation, newNotation));
-		}
-		return msgs;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void setNotation(DTDNotation newNotation) {
-		if (newNotation != notation) {
-			NotificationChain msgs = null;
-			if (notation != null)
-				msgs = ((InternalEObject) notation).eInverseRemove(this, DTDPackage.DTD_NOTATION__ENTITY, DTDNotation.class, msgs);
-			if (newNotation != null)
-				msgs = ((InternalEObject) newNotation).eInverseAdd(this, DTDPackage.DTD_NOTATION__ENTITY, DTDNotation.class, msgs);
-			msgs = basicSetNotation(newNotation, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION, newNotation, newNotation));
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public DTDFile getEntityReferencedFromAnotherFile() {
-		if (entityReferencedFromAnotherFile != null && entityReferencedFromAnotherFile.eIsProxy()) {
-			DTDFile oldEntityReferencedFromAnotherFile = entityReferencedFromAnotherFile;
-			entityReferencedFromAnotherFile = (DTDFile) EcoreUtil.resolve(entityReferencedFromAnotherFile, this);
-			if (entityReferencedFromAnotherFile != oldEntityReferencedFromAnotherFile) {
-				if (eNotificationRequired())
-					eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE, oldEntityReferencedFromAnotherFile, entityReferencedFromAnotherFile));
-			}
-		}
-		return entityReferencedFromAnotherFile;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDFile basicGetEntityReferencedFromAnotherFile() {
-		return entityReferencedFromAnotherFile;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void setEntityReferencedFromAnotherFile(DTDFile newEntityReferencedFromAnotherFile) {
-		DTDFile oldEntityReferencedFromAnotherFile = entityReferencedFromAnotherFile;
-		entityReferencedFromAnotherFile = newEntityReferencedFromAnotherFile;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE, oldEntityReferencedFromAnotherFile, entityReferencedFromAnotherFile));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY, msgs);
-				case DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION :
-					if (notation != null)
-						msgs = ((InternalEObject) notation).eInverseRemove(this, DTDPackage.DTD_NOTATION__ENTITY, DTDNotation.class, msgs);
-					return basicSetNotation((DTDNotation) otherEnd, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
-					return eBasicSetContainer(null, DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY, msgs);
-				case DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION :
-					return basicSetNotation(null, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_ENTITY__CONTENT, DTDEntity.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
-				return getDTDEntity();
-			case DTDPackage.DTD_EXTERNAL_ENTITY__SYSTEM_ID :
-				return getSystemID();
-			case DTDPackage.DTD_EXTERNAL_ENTITY__PUBLIC_ID :
-				return getPublicID();
-			case DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION :
-				if (resolve)
-					return getNotation();
-				return basicGetNotation();
-			case DTDPackage.DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE :
-				if (resolve)
-					return getEntityReferencedFromAnotherFile();
-				return basicGetEntityReferencedFromAnotherFile();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
-				return getDTDEntity() != null;
-			case DTDPackage.DTD_EXTERNAL_ENTITY__SYSTEM_ID :
-				return SYSTEM_ID_EDEFAULT == null ? systemID != null : !SYSTEM_ID_EDEFAULT.equals(systemID);
-			case DTDPackage.DTD_EXTERNAL_ENTITY__PUBLIC_ID :
-				return PUBLIC_ID_EDEFAULT == null ? publicID != null : !PUBLIC_ID_EDEFAULT.equals(publicID);
-			case DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION :
-				return notation != null;
-			case DTDPackage.DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE :
-				return entityReferencedFromAnotherFile != null;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
-				setDTDEntity((DTDEntity) newValue);
-				return;
-			case DTDPackage.DTD_EXTERNAL_ENTITY__SYSTEM_ID :
-				setSystemID((String) newValue);
-				return;
-			case DTDPackage.DTD_EXTERNAL_ENTITY__PUBLIC_ID :
-				setPublicID((String) newValue);
-				return;
-			case DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION :
-				setNotation((DTDNotation) newValue);
-				return;
-			case DTDPackage.DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE :
-				setEntityReferencedFromAnotherFile((DTDFile) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
-				setDTDEntity((DTDEntity) null);
-				return;
-			case DTDPackage.DTD_EXTERNAL_ENTITY__SYSTEM_ID :
-				setSystemID(SYSTEM_ID_EDEFAULT);
-				return;
-			case DTDPackage.DTD_EXTERNAL_ENTITY__PUBLIC_ID :
-				setPublicID(PUBLIC_ID_EDEFAULT);
-				return;
-			case DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION :
-				setNotation((DTDNotation) null);
-				return;
-			case DTDPackage.DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE :
-				setEntityReferencedFromAnotherFile((DTDFile) null);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public String toString() {
-		if (eIsProxy())
-			return super.toString();
-
-		StringBuffer result = new StringBuffer(super.toString());
-		result.append(" (systemID: "); //$NON-NLS-1$
-		result.append(systemID);
-		result.append(", publicID: "); //$NON-NLS-1$
-		result.append(publicID);
-		result.append(')');
-		return result.toString();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFactoryImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFactoryImpl.java
deleted file mode 100644
index 8e02c6a..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFactoryImpl.java
+++ /dev/null
@@ -1,448 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFactory;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDType;
-import org.eclipse.wst.dtd.core.internal.emf.XMLSchemaDefinedType;
-
-/**
- * @generated
- */
-public class DTDFactoryImpl extends EFactoryImpl implements DTDFactory {
-	protected DTDBasicType dtdBasicType_NONE;
-	protected DTDBasicType dtdBasicType_CDATA;
-	protected DTDBasicType dtdBasicType_ID;
-	protected DTDBasicType dtdBasicType_IDREF;
-	protected DTDBasicType dtdBasicType_IDREFS;
-	protected DTDBasicType dtdBasicType_ENTITY;
-	protected DTDBasicType dtdBasicType_ENTITIES;
-	protected DTDBasicType dtdBasicType_NMTOKEN;
-	protected DTDBasicType dtdBasicType_NMTOKENS;
-
-
-
-	public static DTDFactory instance() {
-		return (DTDFactory) getPackage().getEFactoryInstance();
-	}
-
-	/**
-	 * Gets the dtdBasicType_NONE.
-	 * 
-	 * @return Returns a DTDType
-	 */
-	public DTDType getDTDBasicType_NONE() {
-		if (dtdBasicType_NONE == null) {
-			(dtdBasicType_NONE = createDTDBasicType()).setKind(DTDBasicTypeKind.CDATA_LITERAL);
-		}
-		return dtdBasicType_NONE;
-	}
-
-	/**
-	 * Gets the dtdBasicType_CDATA.
-	 * 
-	 * @return Returns a DTDType
-	 */
-	public DTDType getDTDBasicType_CDATA() {
-		if (dtdBasicType_CDATA == null) {
-			(dtdBasicType_CDATA = createDTDBasicType()).setKind(DTDBasicTypeKind.CDATA_LITERAL);
-		}
-		return dtdBasicType_CDATA;
-	}
-
-	/**
-	 * Gets the dtdBasicType_ID.
-	 * 
-	 * @return Returns a DTDType
-	 */
-	public DTDType getDTDBasicType_ID() {
-		if (dtdBasicType_ID == null) {
-			(dtdBasicType_ID = createDTDBasicType()).setKind(DTDBasicTypeKind.ID_LITERAL);
-		}
-		return dtdBasicType_ID;
-	}
-
-	/**
-	 * Gets the dtdBasicType_IDREF.
-	 * 
-	 * @return Returns a DTDType
-	 */
-	public DTDType getDTDBasicType_IDREF() {
-		if (dtdBasicType_IDREF == null) {
-			(dtdBasicType_IDREF = createDTDBasicType()).setKind(DTDBasicTypeKind.IDREF_LITERAL);
-		}
-		return dtdBasicType_IDREF;
-	}
-
-	/**
-	 * Gets the dtdBasicType_IDREFS.
-	 * 
-	 * @return Returns a DTDType
-	 */
-	public DTDType getDTDBasicType_IDREFS() {
-		if (dtdBasicType_IDREFS == null) {
-			(dtdBasicType_IDREFS = createDTDBasicType()).setKind(DTDBasicTypeKind.IDREFS_LITERAL);
-		}
-		return dtdBasicType_IDREFS;
-	}
-
-	/**
-	 * Gets the dtdBasicType_ENTITY.
-	 * 
-	 * @return Returns a DTDType
-	 */
-	public DTDType getDTDBasicType_ENTITY() {
-		if (dtdBasicType_ENTITY == null) {
-			(dtdBasicType_ENTITY = createDTDBasicType()).setKind(DTDBasicTypeKind.ENTITY_LITERAL);
-		}
-		return dtdBasicType_ENTITY;
-	}
-
-	/**
-	 * Gets the dtdBasicType_ENTITIES.
-	 * 
-	 * @return Returns a DTDType
-	 */
-	public DTDType getDTDBasicType_ENTITIES() {
-		if (dtdBasicType_ENTITIES == null) {
-			(dtdBasicType_ENTITIES = createDTDBasicType()).setKind(DTDBasicTypeKind.ENTITIES_LITERAL);
-		}
-		return dtdBasicType_ENTITIES;
-	}
-
-	/**
-	 * Gets the dtdBasicType_NMTOKEN.
-	 * 
-	 * @return Returns a DTDType
-	 */
-	public DTDType getDTDBasicType_NMTOKEN() {
-		if (dtdBasicType_NMTOKEN == null) {
-			(dtdBasicType_NMTOKEN = createDTDBasicType()).setKind(DTDBasicTypeKind.NMTOKEN_LITERAL);
-		}
-		return dtdBasicType_NMTOKEN;
-	}
-
-	/**
-	 * Gets the dtdBasicType_NMTOKENS.
-	 * 
-	 * @return Returns a DTDType
-	 */
-	public DTDType getDTDBasicType_NMTOKENS() {
-		if (dtdBasicType_NMTOKENS == null) {
-			(dtdBasicType_NMTOKENS = createDTDBasicType()).setKind(DTDBasicTypeKind.NMTOKENS_LITERAL);
-		}
-		return dtdBasicType_NMTOKENS;
-	}
-
-	/**
-	 * Creates and instance of the factory. <!-- begin-user-doc --> <!--
-	 * end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDFactoryImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EObject create(EClass eClass) {
-		switch (eClass.getClassifierID()) {
-			case DTDPackage.DTD_GROUP_CONTENT :
-				return createDTDGroupContent();
-			case DTDPackage.DTD_ATTRIBUTE :
-				return createDTDAttribute();
-			case DTDPackage.DTD_ELEMENT :
-				return createDTDElement();
-			case DTDPackage.DTD_EMPTY_CONTENT :
-				return createDTDEmptyContent();
-			case DTDPackage.DTD_ANY_CONTENT :
-				return createDTDAnyContent();
-			case DTDPackage.DTD_PC_DATA_CONTENT :
-				return createDTDPCDataContent();
-			case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT :
-				return createDTDElementReferenceContent();
-			case DTDPackage.DTD_FILE :
-				return createDTDFile();
-			case DTDPackage.DTD_BASIC_TYPE :
-				return createDTDBasicType();
-			case DTDPackage.DTD_ENUMERATION_TYPE :
-				return createDTDEnumerationType();
-			case DTDPackage.DTD_NOTATION :
-				return createDTDNotation();
-			case DTDPackage.DTD_ENTITY :
-				return createDTDEntity();
-			case DTDPackage.DTD_EXTERNAL_ENTITY :
-				return createDTDExternalEntity();
-			case DTDPackage.DTD_INTERNAL_ENTITY :
-				return createDTDInternalEntity();
-			case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE :
-				return createDTDParameterEntityReference();
-			case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT :
-				return createDTDEntityReferenceContent();
-		}
-		return null;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object createFromString(EDataType eDataType, String initialValue) {
-		switch (eDataType.getClassifierID()) {
-			case DTDPackage.DTD_OCCURRENCE_TYPE :
-				return DTDOccurrenceType.get(initialValue);
-			case DTDPackage.DTD_DEFAULT_KIND :
-				return DTDDefaultKind.get(initialValue);
-			case DTDPackage.DTD_BASIC_TYPE_KIND :
-				return DTDBasicTypeKind.get(initialValue);
-			case DTDPackage.DTD_ENUM_GROUP_KIND :
-				return DTDEnumGroupKind.get(initialValue);
-			case DTDPackage.DTD_GROUP_KIND :
-				return DTDGroupKind.get(initialValue);
-			case DTDPackage.XML_SCHEMA_DEFINED_TYPE :
-				return XMLSchemaDefinedType.get(initialValue);
-		}
-		return null;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String convertToString(EDataType eDataType, Object instanceValue) {
-		switch (eDataType.getClassifierID()) {
-			case DTDPackage.DTD_OCCURRENCE_TYPE :
-				return instanceValue == null ? null : instanceValue.toString();
-			case DTDPackage.DTD_DEFAULT_KIND :
-				return instanceValue == null ? null : instanceValue.toString();
-			case DTDPackage.DTD_BASIC_TYPE_KIND :
-				return instanceValue == null ? null : instanceValue.toString();
-			case DTDPackage.DTD_ENUM_GROUP_KIND :
-				return instanceValue == null ? null : instanceValue.toString();
-			case DTDPackage.DTD_GROUP_KIND :
-				return instanceValue == null ? null : instanceValue.toString();
-			case DTDPackage.XML_SCHEMA_DEFINED_TYPE :
-				return instanceValue == null ? null : instanceValue.toString();
-		}
-		return null;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDGroupContent createDTDGroupContent() {
-		DTDGroupContentImpl dtdGroupContent = new DTDGroupContentImpl();
-		return dtdGroupContent;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDAttribute createDTDAttribute() {
-		DTDAttributeImpl dtdAttribute = new DTDAttributeImpl();
-		return dtdAttribute;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDElement createDTDElement() {
-		DTDElementImpl dtdElement = new DTDElementImpl();
-		return dtdElement;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDEmptyContent createDTDEmptyContent() {
-		DTDEmptyContentImpl dtdEmptyContent = new DTDEmptyContentImpl();
-		return dtdEmptyContent;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDAnyContent createDTDAnyContent() {
-		DTDAnyContentImpl dtdAnyContent = new DTDAnyContentImpl();
-		return dtdAnyContent;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDPCDataContent createDTDPCDataContent() {
-		DTDPCDataContentImpl dtdpcDataContent = new DTDPCDataContentImpl();
-		return dtdpcDataContent;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDElementReferenceContent createDTDElementReferenceContent() {
-		DTDElementReferenceContentImpl dtdElementReferenceContent = new DTDElementReferenceContentImpl();
-		return dtdElementReferenceContent;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDFile createDTDFile() {
-		DTDFileImpl dtdFile = new DTDFileImpl();
-		return dtdFile;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDBasicType createDTDBasicType() {
-		DTDBasicTypeImpl dtdBasicType = new DTDBasicTypeImpl();
-		return dtdBasicType;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDEnumerationType createDTDEnumerationType() {
-		DTDEnumerationTypeImpl dtdEnumerationType = new DTDEnumerationTypeImpl();
-		return dtdEnumerationType;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDNotation createDTDNotation() {
-		DTDNotationImpl dtdNotation = new DTDNotationImpl();
-		return dtdNotation;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDEntity createDTDEntity() {
-		DTDEntityImpl dtdEntity = new DTDEntityImpl();
-		return dtdEntity;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDExternalEntity createDTDExternalEntity() {
-		DTDExternalEntityImpl dtdExternalEntity = new DTDExternalEntityImpl();
-		return dtdExternalEntity;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDInternalEntity createDTDInternalEntity() {
-		DTDInternalEntityImpl dtdInternalEntity = new DTDInternalEntityImpl();
-		return dtdInternalEntity;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDParameterEntityReference createDTDParameterEntityReference() {
-		DTDParameterEntityReferenceImpl dtdParameterEntityReference = new DTDParameterEntityReferenceImpl();
-		return dtdParameterEntityReference;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDEntityReferenceContent createDTDEntityReferenceContent() {
-		DTDEntityReferenceContentImpl dtdEntityReferenceContent = new DTDEntityReferenceContentImpl();
-		return dtdEntityReferenceContent;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDPackage getDTDPackage() {
-		return (DTDPackage) getEPackage();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public static DTDPackage getPackage() {
-		return DTDPackage.eINSTANCE;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFileImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFileImpl.java
deleted file mode 100644
index 7446e88..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFileImpl.java
+++ /dev/null
@@ -1,821 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENamedElementImpl;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPrinter;
-
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>File</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDFileImpl#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDFileImpl#isParseError <em>Parse Error</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDFileImpl#getDTDContent <em>DTD Content</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDFileImpl#getDTDEnumerationType <em>DTD Enumeration Type</em>}</li>
- * </ul>
- * </p>
- * 
- * @generated
- */
-public class DTDFileImpl extends ENamedElementImpl implements DTDFile, ENamedElement {
-
-	public EList getDTDObject() {
-		return getDTDContent();
-	}
-
-
-	public List listDTDElement() {
-		return getContentListOf(DTDElement.class, null);
-	}
-
-
-	public List listDTDNotation() {
-		return getContentListOf(DTDNotation.class, null);
-	}
-
-	public List listDTDEntity() {
-		return getContentListOf(DTDEntity.class, null);
-	}
-
-	public List listDTDParameterEntityReference() {
-		return getContentListOf(DTDParameterEntityReference.class, null);
-	}
-
-	public List listDTDElementAndDTDParameterEntityReference() {
-		return getContentListOf(DTDElement.class, DTDParameterEntityReference.class);
-	}
-
-	private List getContentListOf(Class class1, Class class2) {
-		List v = new ArrayList();
-		Iterator i = getDTDContent().iterator();
-		while (i.hasNext()) {
-			Object obj = i.next();
-			if (class1.isInstance(obj)) {
-				v.add(obj);
-			}
-			else if ((class2 != null) && (class2.isInstance(obj))) {
-				v.add(obj);
-			}
-		}
-		return v;
-	}
-
-	public DTDElement findElement(String name) {
-		for (Iterator i = listDTDElement().iterator(); i.hasNext();) {
-			DTDElement e = (DTDElement) i.next();
-			if (e.getName().equals(name)) {
-				return e;
-			}
-		}
-		return null;
-	}
-
-	public DTDEntity findEntity(String name) {
-		for (Iterator i = listDTDEntity().iterator(); i.hasNext();) {
-			DTDEntity e = (DTDEntity) i.next();
-			if (e.getName().equals(name)) {
-				return e;
-			}
-		}
-		return null;
-	}
-
-	public DTDNotation findNotation(String name) {
-		for (Iterator i = listDTDNotation().iterator(); i.hasNext();) {
-			DTDNotation e = (DTDNotation) i.next();
-			if (e.getName().equals(name)) {
-				return e;
-			}
-		}
-		return null;
-	}
-
-	public DTDParameterEntityReference findParameterEntityReference(String name) {
-		for (Iterator i = listDTDParameterEntityReference().iterator(); i.hasNext();) {
-			DTDParameterEntityReference e = (DTDParameterEntityReference) i.next();
-			if (e.getName().equals(name)) {
-				return e;
-			}
-		}
-		return null;
-	}
-
-	public String unparse(boolean include) {
-		DTDPrinter printer = new DTDPrinter(true);
-		printer.visitDTDFile(this);
-		return printer.getBuffer().toString();
-	}
-
-
-	public String getPathname() {
-		return ""; //$NON-NLS-1$
-	}
-
-
-	public DTDObject findObject(String relativePath) {
-		Object[] result = DTDPathnameUtil.parsePathComponent(relativePath);
-
-
-		String type = (String) result[0];
-
-
-		if (type == null)
-			return null;
-
-
-		String name = (String) result[1];
-
-		DTDObject obj = null;
-		if (type.equals("Elem")) { //$NON-NLS-1$
-			obj = findElement(name);
-		}
-		else if (type.equals("Ent")) { //$NON-NLS-1$
-			obj = findEntity(name);
-		}
-		else if (type.equals("PEnt")) { //$NON-NLS-1$
-			obj = findParameterEntityReference(name);
-		}
-		else if (type.equals("Nota")) { //$NON-NLS-1$
-			obj = findNotation(name);
-		}
-		else {
-			return null;
-		}
-
-
-		String restPath = (String) result[3];
-
-		if ((restPath == null) || (obj == null)) {
-			return obj;
-		}
-		else {
-			return obj.findObject(restPath);
-		}
-	}
-
-
-
-	/**
-	 * The default value of the '{@link #getComment() <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getComment()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final String COMMENT_EDEFAULT = null;
-
-	/**
-	 * The cached value of the '{@link #getComment() <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getComment()
-	 * @generated
-	 * @ordered
-	 */
-	protected String comment = COMMENT_EDEFAULT;
-
-	/**
-	 * The default value of the '{@link #isParseError() <em>Parse Error</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #isParseError()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final boolean PARSE_ERROR_EDEFAULT = false;
-
-	/**
-	 * The cached value of the '{@link #isParseError() <em>Parse Error</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #isParseError()
-	 * @generated
-	 * @ordered
-	 */
-	protected boolean parseError = PARSE_ERROR_EDEFAULT;
-
-	/**
-	 * The cached value of the '{@link #getDTDContent() <em>DTD Content</em>}'
-	 * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc
-	 * -->
-	 * 
-	 * @see #getDTDContent()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList dtdContent = null;
-
-	/**
-	 * The cached value of the '{@link #getDTDEnumerationType() <em>DTD Enumeration Type</em>}'
-	 * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc
-	 * -->
-	 * 
-	 * @see #getDTDEnumerationType()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList dtdEnumerationType = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected DTDFileImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDFile();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String getComment() {
-		return comment;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setComment(String newComment) {
-		String oldComment = comment;
-		comment = newComment;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_FILE__COMMENT, oldComment, comment));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public boolean isParseError() {
-		return parseError;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setParseError(boolean newParseError) {
-		boolean oldParseError = parseError;
-		parseError = newParseError;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_FILE__PARSE_ERROR, oldParseError, parseError));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EList getDTDContent() {
-		if (dtdContent == null) {
-			dtdContent = new EObjectContainmentWithInverseEList(DTDContent.class, this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDPackage.DTD_CONTENT__DTD_FILE);
-		}
-		return dtdContent;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EList getDTDEnumerationType() {
-		if (dtdEnumerationType == null) {
-			dtdEnumerationType = new EObjectContainmentWithInverseEList(DTDEnumerationType.class, this, DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE, DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE);
-		}
-		return dtdEnumerationType;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_FILE__DTD_CONTENT :
-					return ((InternalEList) getDTDContent()).basicAdd(otherEnd, msgs);
-				case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE :
-					return ((InternalEList) getDTDEnumerationType()).basicAdd(otherEnd, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_FILE__DTD_CONTENT :
-					return ((InternalEList) getDTDContent()).basicRemove(otherEnd, msgs);
-				case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE :
-					return ((InternalEList) getDTDEnumerationType()).basicRemove(otherEnd, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_FILE__COMMENT :
-				return getComment();
-			case DTDPackage.DTD_FILE__PARSE_ERROR :
-				return isParseError() ? Boolean.TRUE : Boolean.FALSE;
-			case DTDPackage.DTD_FILE__DTD_CONTENT :
-				return getDTDContent();
-			case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE :
-				return getDTDEnumerationType();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_FILE__COMMENT :
-				setComment((String) newValue);
-				return;
-			case DTDPackage.DTD_FILE__PARSE_ERROR :
-				setParseError(((Boolean) newValue).booleanValue());
-				return;
-			case DTDPackage.DTD_FILE__DTD_CONTENT :
-				getDTDContent().clear();
-				getDTDContent().addAll((Collection) newValue);
-				return;
-			case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE :
-				getDTDEnumerationType().clear();
-				getDTDEnumerationType().addAll((Collection) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_FILE__COMMENT :
-				setComment(COMMENT_EDEFAULT);
-				return;
-			case DTDPackage.DTD_FILE__PARSE_ERROR :
-				setParseError(PARSE_ERROR_EDEFAULT);
-				return;
-			case DTDPackage.DTD_FILE__DTD_CONTENT :
-				getDTDContent().clear();
-				return;
-			case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE :
-				getDTDEnumerationType().clear();
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_FILE__COMMENT :
-				return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
-			case DTDPackage.DTD_FILE__PARSE_ERROR :
-				return parseError != PARSE_ERROR_EDEFAULT;
-			case DTDPackage.DTD_FILE__DTD_CONTENT :
-				return dtdContent != null && !getDTDContent().isEmpty();
-			case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE :
-				return dtdEnumerationType != null && !getDTDEnumerationType().isEmpty();
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String toString() {
-		if (eIsProxy())
-			return super.toString();
-
-		StringBuffer result = new StringBuffer(super.toString());
-		result.append(" (comment: "); //$NON-NLS-1$
-		result.append(comment);
-		result.append(", parseError: "); //$NON-NLS-1$
-		result.append(parseError);
-		result.append(')');
-		return result.toString();
-	}
-
-} // DTDFileImpl
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-//
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-// //public class DTDFileImpl extends ENamespaceImpl implements DTDFile,
-// ENamespace{
-// -------------------GENERICRULES.JSED-------------------
-
-// public static final String copyright = "(c) Copyright IBM Corporation
-// 2002.";
-//
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected String comment = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected Boolean parseError = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected EList dtdContent = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected EList dtdEnumerationType = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setComment = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setParseError = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EObject initInstance() {
-// setEMetaObj(eClassDTDFile());
-// initInstanceDelegates();
-// return this;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDPackage ePackageDTD() {
-// return
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDFile() {
-// return
-// ((DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI)).getDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public String getComment() {
-// if (this.setComment) return this.comment;
-// else return
-// (String)DTDPackage.eINSTANCE.getDTDFile_Comment().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setComment(String value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDFile_Comment(),this.comment,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetComment() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDFile_Comment()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetComment() {
-// return setComment;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public Boolean getParseError() {
-// if (this.setParseError) return this.parseError;
-// else return
-// (Boolean)DTDPackage.eINSTANCE.getDTDFile_ParseError().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public boolean isParseError() {
-// Boolean result = getParseError();
-// return result != null ? result.booleanValue() : false;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setParseError(Boolean value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDFile_ParseError(),this.parseError,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setParseError(boolean value) {
-// setParseError(value?Boolean.TRUE:Boolean.FALSE);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetParseError() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDFile_ParseError()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetParseError() {
-// return setParseError;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public EList getDTDContent() {
-// if (this.dtdContent==null) {
-// this.dtdContent=newCollection(this,DTDPackage.eINSTANCE.getDTDFile_DTDContent(),
-// true);
-// }
-// return this.dtdContent;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public EList getDTDEnumerationType() {
-// if (this.dtdEnumerationType==null) {
-// this.dtdEnumerationType=newCollection(this,DTDPackage.eINSTANCE.getDTDFile_DTDEnumerationType(),
-// true);
-// }
-// return this.dtdEnumerationType;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object eGet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eGet(feature);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT: return getComment();
-// case DTDPackage.DTD_FILE__PARSE_ERROR: return getParseError();
-// case DTDPackage.DTD_FILE__DTD_CONTENT: return getDTDContent();
-// case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE: return
-// getDTDEnumerationType();
-//
-// }
-// return super.eGet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object refBasicValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicValue(feature);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT:
-// return this.setComment? this.comment : null;
-// case DTDPackage.DTD_FILE__PARSE_ERROR:
-// return this.setParseError? this.parseError : null;
-// case DTDPackage.DTD_FILE__DTD_CONTENT:
-// return this.dtdContent;
-// case DTDPackage.DTD_FILE__DTD_ENUMERATION_TYPE:
-// return this.dtdEnumerationType;
-//
-// }
-// return super.refBasicValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean eIsSet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eIsSet(feature);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT: return isSetComment();
-// case DTDPackage.DTD_FILE__PARSE_ERROR: return isSetParseError();
-//
-// }
-// return super.eIsSet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eSet(EStructuralFeature feature, Object newValue) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eSet(feature, newValue);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT: {
-// setComment((String)newValue);
-// return;
-// }
-// case DTDPackage.DTD_FILE__PARSE_ERROR: {
-// setParseError((newValue instanceof
-// String)?Boolean.valueOf((String)newValue):(Boolean)newValue);
-// return;
-// }
-//
-// }
-// super.eSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification eBasicSet(EStructuralFeature feature, Object newValue)
-// {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eBasicSet(feature, newValue);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT: {
-// Object oldValue = this.comment;
-// this.comment = (String)newValue;
-// this.setComment = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDFile_Comment(),oldValue,newValue);
-// }
-// case DTDPackage.DTD_FILE__PARSE_ERROR: {
-// Object oldValue = this.parseError;
-// this.parseError = (Boolean)newValue;
-// this.setParseError = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDFile_ParseError(),oldValue,newValue);
-// }
-//
-// }
-// return super.eBasicSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eUnset(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eUnset(feature);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT: {
-// unsetComment();
-// return;
-// }
-// case DTDPackage.DTD_FILE__PARSE_ERROR: {
-// unsetParseError();
-// return;
-// }
-//
-// }
-// super.eUnset(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification refBasicUnsetValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicUnsetValue(feature);
-// }
-// switch (eClassDTDFile().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_FILE__COMMENT: {
-// Object oldValue = this.comment;
-// this.comment = null;
-// this.setComment = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDFile_Comment(),oldValue,getComment());
-// }
-// case DTDPackage.DTD_FILE__PARSE_ERROR: {
-// Object oldValue = this.parseError;
-// this.parseError = null;
-// this.setParseError = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDFile_ParseError(),oldValue,getParseError());
-// }
-//
-// }
-// return super.refBasicUnsetValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public String toString() {
-// String out="("; //$NON-NLS-2$//$NON-NLS-1$
-// boolean first=true;
-// boolean emptyList=true;
-// if(isSetComment()) {
-// if(!emptyList) out+=", "; //$NON-NLS-2$//$NON-NLS-1$
-// out+="comment: "+this.comment; //$NON-NLS-2$//$NON-NLS-1$
-// first=false;
-// emptyList=false;
-// }
-// if(isSetParseError()) {
-// if(!emptyList) out+=", "; //$NON-NLS-2$//$NON-NLS-1$
-// out+="parseError: "+this.parseError; //$NON-NLS-2$//$NON-NLS-1$
-// first=false;
-// emptyList=false;
-// }
-// out+=")";
-// if (!first) return super.toString() + " " +out; //$NON-NLS-2$//$NON-NLS-1$
-// return super.toString();
-// }
-// }
-// -------------------GENERICRULES.JSED-------------------
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDGroupContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDGroupContentImpl.java
deleted file mode 100644
index 65011e6..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDGroupContentImpl.java
+++ /dev/null
@@ -1,292 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPrinter;
-
-
-/**
- * @generated
- */
-public class DTDGroupContentImpl extends DTDRepeatableContentImpl implements DTDGroupContent {
-	/**
-	 * The default value of the '{@link #getGroupKind() <em>Group Kind</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getGroupKind()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final DTDGroupKind GROUP_KIND_EDEFAULT = DTDGroupKind.SEQUENCE_LITERAL;
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected DTDGroupKind groupKind = GROUP_KIND_EDEFAULT;
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected EList content = null;
-
-	public DTDGroupContentImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDGroupContent();
-	}
-
-	public int getContentPosition(DTDElementContent content) {
-		EList list = getContent();
-		return list.indexOf(content);
-	}
-
-	public String getContentName() {
-		return ""; //$NON-NLS-1$
-	}
-
-	public String getContentDetail() {
-		DTDPrinter printer = new DTDPrinter(false);
-		printer.visitDTDGroupContent(this);
-
-		return printer.getBuffer().toString();
-	}
-
-	public String unparseRepeatableContent() {
-		return ""; //$NON-NLS-1$
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public DTDGroupKind getGroupKind() {
-		return groupKind;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setGroupKind(DTDGroupKind newGroupKind) {
-		DTDGroupKind oldGroupKind = groupKind;
-		groupKind = newGroupKind == null ? GROUP_KIND_EDEFAULT : newGroupKind;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_GROUP_CONTENT__GROUP_KIND, oldGroupKind, groupKind));
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public EList getContent() {
-		if (content == null) {
-			content = new EObjectContainmentWithInverseEList(DTDElementContent.class, this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDPackage.DTD_ELEMENT_CONTENT__GROUP);
-		}
-		return content;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_GROUP_CONTENT__GROUP :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_GROUP_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_GROUP_CONTENT__ELEMENT, msgs);
-				case DTDPackage.DTD_GROUP_CONTENT__CONTENT :
-					return ((InternalEList) getContent()).basicAdd(otherEnd, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_GROUP_CONTENT__GROUP :
-					return eBasicSetContainer(null, DTDPackage.DTD_GROUP_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
-					return eBasicSetContainer(null, DTDPackage.DTD_GROUP_CONTENT__ELEMENT, msgs);
-				case DTDPackage.DTD_GROUP_CONTENT__CONTENT :
-					return ((InternalEList) getContent()).basicRemove(otherEnd, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_GROUP_CONTENT__GROUP :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
-				case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_GROUP_CONTENT__GROUP :
-				return getGroup();
-			case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
-				return getElement();
-			case DTDPackage.DTD_GROUP_CONTENT__OCCURRENCE :
-				return getOccurrence();
-			case DTDPackage.DTD_GROUP_CONTENT__GROUP_KIND :
-				return getGroupKind();
-			case DTDPackage.DTD_GROUP_CONTENT__CONTENT :
-				return getContent();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_GROUP_CONTENT__GROUP :
-				return getGroup() != null;
-			case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
-				return getElement() != null;
-			case DTDPackage.DTD_GROUP_CONTENT__OCCURRENCE :
-				return occurrence != OCCURRENCE_EDEFAULT;
-			case DTDPackage.DTD_GROUP_CONTENT__GROUP_KIND :
-				return groupKind != GROUP_KIND_EDEFAULT;
-			case DTDPackage.DTD_GROUP_CONTENT__CONTENT :
-				return content != null && !getContent().isEmpty();
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_GROUP_CONTENT__GROUP :
-				setGroup((DTDGroupContent) newValue);
-				return;
-			case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
-				setElement((DTDElement) newValue);
-				return;
-			case DTDPackage.DTD_GROUP_CONTENT__OCCURRENCE :
-				setOccurrence((DTDOccurrenceType) newValue);
-				return;
-			case DTDPackage.DTD_GROUP_CONTENT__GROUP_KIND :
-				setGroupKind((DTDGroupKind) newValue);
-				return;
-			case DTDPackage.DTD_GROUP_CONTENT__CONTENT :
-				getContent().clear();
-				getContent().addAll((Collection) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_GROUP_CONTENT__GROUP :
-				setGroup((DTDGroupContent) null);
-				return;
-			case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
-				setElement((DTDElement) null);
-				return;
-			case DTDPackage.DTD_GROUP_CONTENT__OCCURRENCE :
-				setOccurrence(OCCURRENCE_EDEFAULT);
-				return;
-			case DTDPackage.DTD_GROUP_CONTENT__GROUP_KIND :
-				setGroupKind(GROUP_KIND_EDEFAULT);
-				return;
-			case DTDPackage.DTD_GROUP_CONTENT__CONTENT :
-				getContent().clear();
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public String toString() {
-		if (eIsProxy())
-			return super.toString();
-
-		StringBuffer result = new StringBuffer(super.toString());
-		result.append(" (groupKind: "); //$NON-NLS-1$
-		result.append(groupKind);
-		result.append(')');
-		return result.toString();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDIdHelper.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDIdHelper.java
deleted file mode 100644
index 0007039..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDIdHelper.java
+++ /dev/null
@@ -1,88 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-
-public class DTDIdHelper {
-	public DTDIdHelper() {
-	}
-
-	public String computeContentId(DTDElementContent content) {
-		String id = ""; //$NON-NLS-1$
-		if (content instanceof DTDEmptyContent) {
-			id = "#EMPTY"; //$NON-NLS-1$
-		}
-		else if (content instanceof DTDPCDataContent) {
-			id = "#PCDATA"; //$NON-NLS-1$
-		}
-		else if (content instanceof DTDEmptyContent) {
-			id = "#EMPTY"; //$NON-NLS-1$
-		}
-		else if (content instanceof DTDElementReferenceContent) {
-			id = "#" + ((DTDElementReferenceContent) content).getReferencedElement().getName(); //$NON-NLS-1$
-		}
-		else if (content instanceof DTDEntityReferenceContent) {
-			id = "#" + ((DTDEntityReferenceContent) content).getElementReferencedEntity().getName(); //$NON-NLS-1$
-		}
-		else if (content instanceof DTDGroupContent) {
-			id = computeGroupId((DTDGroupContent) content);
-		}
-		return id;
-	}
-
-	public String computeGroupId(DTDGroupContent grp) {
-		String groupId = "_"; //$NON-NLS-1$
-		return groupId;
-	}
-
-	/**
-	 * @generated
-	 */
-	protected String computeContentIdGen(DTDElementContent content) {
-
-		String id = ""; //$NON-NLS-1$
-		if (content instanceof DTDEmptyContent) {
-			id = "#EMPTY"; //$NON-NLS-1$
-		}
-		else if (content instanceof DTDPCDataContent) {
-			id = "#PCDATA"; //$NON-NLS-1$
-		}
-		else if (content instanceof DTDEmptyContent) {
-			id = "#EMPTY"; //$NON-NLS-1$
-		}
-		else if (content instanceof DTDElementReferenceContent) {
-			id = "#" + ((DTDElementReferenceContent) content).getReferencedElement().getName(); //$NON-NLS-1$
-		}
-		else if (content instanceof DTDEntityReferenceContent) {
-			id = "#" + ((DTDEntityReferenceContent) content).getElementReferencedEntity().getName(); //$NON-NLS-1$
-		}
-		else if (content instanceof DTDGroupContent) {
-			id = computeGroupId((DTDGroupContent) content);
-		}
-		return id;
-	}
-
-	/**
-	 * @generated
-	 */
-	protected String computeGroupIdGen(DTDGroupContent grp) {
-
-		String groupId = "_"; //$NON-NLS-1$
-		return groupId;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java
deleted file mode 100644
index a825514..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java
+++ /dev/null
@@ -1,239 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import java.text.CharacterIterator;
-import java.text.StringCharacterIterator;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-
-/**
- * @generated
- */
-public class DTDInternalEntityImpl extends DTDEntityContentImpl implements DTDInternalEntity {
-	/**
-	 * The default value of the '{@link #getValue() <em>Value</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getValue()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final String VALUE_EDEFAULT = null;
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected String value = VALUE_EDEFAULT;
-
-	public DTDInternalEntityImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDInternalEntity();
-	}
-
-	public String unparse() {
-		StringBuffer sb = new StringBuffer(64);
-		if (getValue() == null)
-			sb.append("\"\""); //$NON-NLS-1$
-		else {
-			sb.append("\"").append(replaceDoubleQuotes(getValue())).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		return sb.toString();
-	}
-
-	// this method replaces any occurrence of ' " ' with the equivalent value
-	// of &#34;
-	private String replaceDoubleQuotes(String input) {
-		StringBuffer newValue = new StringBuffer();
-
-		StringCharacterIterator characters = new StringCharacterIterator(input);
-
-		while (characters.current() != CharacterIterator.DONE) {
-			char current = characters.current();
-
-			if (current == '"') {
-				newValue.append("&#34;"); //$NON-NLS-1$
-			}
-			else {
-				newValue.append(current);
-			}
-			characters.next();
-		}
-
-		return newValue.toString();
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 */
-	public String getValue() {
-		return value;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void setValue(String newValue) {
-		String oldValue = value;
-		value = newValue;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_INTERNAL_ENTITY__VALUE, oldValue, value));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
-					return eBasicSetContainer(null, DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_ENTITY__CONTENT, DTDEntity.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
-				return getDTDEntity();
-			case DTDPackage.DTD_INTERNAL_ENTITY__VALUE :
-				return getValue();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
-				return getDTDEntity() != null;
-			case DTDPackage.DTD_INTERNAL_ENTITY__VALUE :
-				return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
-				setDTDEntity((DTDEntity) newValue);
-				return;
-			case DTDPackage.DTD_INTERNAL_ENTITY__VALUE :
-				setValue((String) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
-				setDTDEntity((DTDEntity) null);
-				return;
-			case DTDPackage.DTD_INTERNAL_ENTITY__VALUE :
-				setValue(VALUE_EDEFAULT);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public String toString() {
-		if (eIsProxy())
-			return super.toString();
-
-		StringBuffer result = new StringBuffer(super.toString());
-		result.append(" (value: "); //$NON-NLS-1$
-		result.append(value);
-		result.append(')');
-		return result.toString();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDNotationImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDNotationImpl.java
deleted file mode 100644
index 30e3237..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDNotationImpl.java
+++ /dev/null
@@ -1,904 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Notation</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDNotationImpl#getComment <em>Comment</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDNotationImpl#getSystemID <em>System ID</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDNotationImpl#getPublicID <em>Public ID</em>}</li>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDNotationImpl#getEntity <em>Entity</em>}</li>
- * </ul>
- * </p>
- * 
- * @generated
- */
-public class DTDNotationImpl extends DTDContentImpl implements DTDNotation, DTDContent {
-
-	public String getPathname() {
-		return DTDPathnameUtil.makePath(null, "Nota", getName(), -1); //$NON-NLS-1$
-	}
-
-
-	public DTDObject findObject(String relativePath) {
-		return null;
-	}
-
-
-	// ugly hack for now since we don't have multiple inheritance.
-	// Would rather have all this stuff in a base class but these
-	// classes are inheriting from sometimes different mof classes
-	DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-
-	/**
-	 * Get the value of startOffset.
-	 * 
-	 * @return value of startOffset.
-	 */
-	public int getStartOffset() {
-		return lexInfo.getStartOffset();
-	}
-
-	/**
-	 * Set the value of startOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to startOffset.
-	 */
-	public void setStartOffset(int v) {
-		lexInfo.setStartOffset(v);
-	}
-
-	/**
-	 * Get the value of endOffset.
-	 * 
-	 * @return value of endOffset.
-	 */
-	public int getEndOffset() {
-		return lexInfo.getEndOffset();
-	}
-
-	/**
-	 * Set the value of endOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to endOffset.
-	 */
-	public void setEndOffset(int v) {
-		lexInfo.setEndOffset(v);
-	}
-
-	/**
-	 * The default value of the '{@link #getComment() <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getComment()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final String COMMENT_EDEFAULT = null;
-
-	/**
-	 * The cached value of the '{@link #getComment() <em>Comment</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getComment()
-	 * @generated
-	 * @ordered
-	 */
-	protected String comment = COMMENT_EDEFAULT;
-
-	/**
-	 * The default value of the '{@link #getSystemID() <em>System ID</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getSystemID()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final String SYSTEM_ID_EDEFAULT = null;
-
-	/**
-	 * The cached value of the '{@link #getSystemID() <em>System ID</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getSystemID()
-	 * @generated
-	 * @ordered
-	 */
-	protected String systemID = SYSTEM_ID_EDEFAULT;
-
-	/**
-	 * The default value of the '{@link #getPublicID() <em>Public ID</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getPublicID()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final String PUBLIC_ID_EDEFAULT = null;
-
-	/**
-	 * The cached value of the '{@link #getPublicID() <em>Public ID</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getPublicID()
-	 * @generated
-	 * @ordered
-	 */
-	protected String publicID = PUBLIC_ID_EDEFAULT;
-
-	/**
-	 * The cached value of the '{@link #getEntity() <em>Entity</em>}'
-	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getEntity()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList entity = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected DTDNotationImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDNotation();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String getComment() {
-		return comment;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setComment(String newComment) {
-		String oldComment = comment;
-		comment = newComment;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_NOTATION__COMMENT, oldComment, comment));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String getSystemID() {
-		return systemID;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setSystemID(String newSystemID) {
-		String oldSystemID = systemID;
-		systemID = newSystemID;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_NOTATION__SYSTEM_ID, oldSystemID, systemID));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String getPublicID() {
-		return publicID;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setPublicID(String newPublicID) {
-		String oldPublicID = publicID;
-		publicID = newPublicID;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_NOTATION__PUBLIC_ID, oldPublicID, publicID));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EList getEntity() {
-		if (entity == null) {
-			entity = new EObjectWithInverseResolvingEList(DTDExternalEntity.class, this, DTDPackage.DTD_NOTATION__ENTITY, DTDPackage.DTD_EXTERNAL_ENTITY__NOTATION);
-		}
-		return entity;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_NOTATION__DTD_FILE :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_NOTATION__DTD_FILE, msgs);
-				case DTDPackage.DTD_NOTATION__ENTITY :
-					return ((InternalEList) getEntity()).basicAdd(otherEnd, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_NOTATION__DTD_FILE :
-					return eBasicSetContainer(null, DTDPackage.DTD_NOTATION__DTD_FILE, msgs);
-				case DTDPackage.DTD_NOTATION__ENTITY :
-					return ((InternalEList) getEntity()).basicRemove(otherEnd, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_NOTATION__DTD_FILE :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_NOTATION__DTD_FILE :
-				return getDTDFile();
-			case DTDPackage.DTD_NOTATION__COMMENT :
-				return getComment();
-			case DTDPackage.DTD_NOTATION__SYSTEM_ID :
-				return getSystemID();
-			case DTDPackage.DTD_NOTATION__PUBLIC_ID :
-				return getPublicID();
-			case DTDPackage.DTD_NOTATION__ENTITY :
-				return getEntity();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_NOTATION__DTD_FILE :
-				setDTDFile((DTDFile) newValue);
-				return;
-			case DTDPackage.DTD_NOTATION__COMMENT :
-				setComment((String) newValue);
-				return;
-			case DTDPackage.DTD_NOTATION__SYSTEM_ID :
-				setSystemID((String) newValue);
-				return;
-			case DTDPackage.DTD_NOTATION__PUBLIC_ID :
-				setPublicID((String) newValue);
-				return;
-			case DTDPackage.DTD_NOTATION__ENTITY :
-				getEntity().clear();
-				getEntity().addAll((Collection) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_NOTATION__DTD_FILE :
-				setDTDFile((DTDFile) null);
-				return;
-			case DTDPackage.DTD_NOTATION__COMMENT :
-				setComment(COMMENT_EDEFAULT);
-				return;
-			case DTDPackage.DTD_NOTATION__SYSTEM_ID :
-				setSystemID(SYSTEM_ID_EDEFAULT);
-				return;
-			case DTDPackage.DTD_NOTATION__PUBLIC_ID :
-				setPublicID(PUBLIC_ID_EDEFAULT);
-				return;
-			case DTDPackage.DTD_NOTATION__ENTITY :
-				getEntity().clear();
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_NOTATION__DTD_FILE :
-				return getDTDFile() != null;
-			case DTDPackage.DTD_NOTATION__COMMENT :
-				return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
-			case DTDPackage.DTD_NOTATION__SYSTEM_ID :
-				return SYSTEM_ID_EDEFAULT == null ? systemID != null : !SYSTEM_ID_EDEFAULT.equals(systemID);
-			case DTDPackage.DTD_NOTATION__PUBLIC_ID :
-				return PUBLIC_ID_EDEFAULT == null ? publicID != null : !PUBLIC_ID_EDEFAULT.equals(publicID);
-			case DTDPackage.DTD_NOTATION__ENTITY :
-				return entity != null && !getEntity().isEmpty();
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public String toString() {
-		if (eIsProxy())
-			return super.toString();
-
-		StringBuffer result = new StringBuffer(super.toString());
-		result.append(" (comment: "); //$NON-NLS-1$
-		result.append(comment);
-		result.append(", systemID: "); //$NON-NLS-1$
-		result.append(systemID);
-		result.append(", publicID: "); //$NON-NLS-1$
-		result.append(publicID);
-		result.append(')');
-		return result.toString();
-	}
-
-} // DTDNotationImpl
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-//
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-// //public class DTDNotationImpl extends ENamespaceImpl implements
-// DTDNotation, ENamespace, DTDContent{
-// -------------------GENERICRULES.JSED-------------------
-
-// public static final String copyright = "(c) Copyright IBM Corporation
-// 2002.";
-//
-// public DTDNotationImpl()
-// {
-// super();
-// }
-// public String getPathname()
-// {
-// return DTDPathnameUtil.makePath(null, "Nota", getName(), -1);
-// }
-//
-// public DTDObject findObject(String relativePath)
-// {
-// return null;
-// }
-//
-// // ugly hack for now since we don't have multiple inheritance.
-// // Would rather have all this stuff in a base class but these
-// // classes are inheriting from sometimes different mof classes
-// DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected String comment = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected String systemID = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected String publicID = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected EList entity = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setComment = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setSystemID = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setPublicID = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// private DTDContentImpl dtdContentDelegate = null;
-// /**
-// * Get the value of startOffset.
-// * @return value of startOffset.
-// */
-// public int getStartOffset()
-// {
-// return lexInfo.getStartOffset();
-// }
-//  
-// /**
-// * Set the value of startOffset.
-// * @param v Value to assign to startOffset.
-// */
-// public void setStartOffset(int v)
-// {
-// lexInfo.setStartOffset(v);
-// }
-//  
-// /**
-// * Get the value of endOffset.
-// * @return value of endOffset.
-// */
-// public int getEndOffset()
-// {
-// return lexInfo.getEndOffset();
-// }
-//  
-// /**
-// * Set the value of endOffset.
-// * @param v Value to assign to endOffset.
-// */
-// public void setEndOffset(int v)
-// {
-// lexInfo.setEndOffset(v);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EObject initInstance() {
-// setEMetaObj(eClassDTDNotation());
-// initInstanceDelegates();
-// return this;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected void initInstanceDelegates() {
-// super.initInstanceDelegates();
-//
-// getDtdContentDelegate().refSetDelegateOwner(this);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDPackage ePackageDTD() {
-// return
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDNotation() {
-// return
-// ((DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI)).getDTDNotation();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public String getComment() {
-// if (this.setComment) return this.comment;
-// else return
-// (String)DTDPackage.eINSTANCE.getDTDNotation_Comment().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setComment(String value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDNotation_Comment(),this.comment,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetComment() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDNotation_Comment()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetComment() {
-// return setComment;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public String getSystemID() {
-// if (this.setSystemID) return this.systemID;
-// else return
-// (String)DTDPackage.eINSTANCE.getDTDNotation_SystemID().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setSystemID(String value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDNotation_SystemID(),this.systemID,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetSystemID() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDNotation_SystemID()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetSystemID() {
-// return setSystemID;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public String getPublicID() {
-// if (this.setPublicID) return this.publicID;
-// else return
-// (String)DTDPackage.eINSTANCE.getDTDNotation_PublicID().getDefaultValue();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setPublicID(String value) {
-// refSetValueForSimpleSF(DTDPackage.eINSTANCE.getDTDNotation_PublicID(),this.publicID,value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetPublicID() {
-// eNotify(refBasicUnsetValue(DTDPackage.eINSTANCE.getDTDNotation_PublicID()));
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetPublicID() {
-// return setPublicID;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public EList getEntity() {
-// if (this.entity==null) {
-// this.entity=newCollection(this,DTDPackage.eINSTANCE.getDTDNotation_Entity(),
-// true);
-// }
-// return this.entity;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object eGet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eGet(feature);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT: return getComment();
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID: return getSystemID();
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID: return getPublicID();
-// case DTDPackage.DTD_NOTATION__ENTITY: return getEntity();
-// case DTDPackage.DTD_NOTATION__DTD_FILE: return getDTDFile();
-//
-// }
-// return super.eGet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object refBasicValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicValue(feature);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT:
-// return this.setComment? this.comment : null;
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID:
-// return this.setSystemID? this.systemID : null;
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID:
-// return this.setPublicID? this.publicID : null;
-// case DTDPackage.DTD_NOTATION__ENTITY:
-// return this.entity;
-// case DTDPackage.DTD_NOTATION__DTD_FILE: return
-// ((InternalEObject)getDtdContentDelegate()).refBasicValue(feature);
-//
-// }
-// return super.refBasicValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean eIsSet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eIsSet(feature);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT: return isSetComment();
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID: return isSetSystemID();
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID: return isSetPublicID();
-// case DTDPackage.DTD_NOTATION__DTD_FILE: return isSetDTDFile();
-//
-// }
-// return super.eIsSet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eSet(EStructuralFeature feature, Object newValue) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eSet(feature, newValue);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT: {
-// setComment((String)newValue);
-// return;
-// }
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID: {
-// setSystemID((String)newValue);
-// return;
-// }
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID: {
-// setPublicID((String)newValue);
-// return;
-// }
-// case DTDPackage.DTD_NOTATION__DTD_FILE: {
-// setDTDFile((DTDFile)newValue);
-// return;
-// }
-//
-// }
-// super.eSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification eBasicSet(EStructuralFeature feature, Object newValue)
-// {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eBasicSet(feature, newValue);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT: {
-// Object oldValue = this.comment;
-// this.comment = (String)newValue;
-// this.setComment = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDNotation_Comment(),oldValue,newValue);
-// }
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID: {
-// Object oldValue = this.systemID;
-// this.systemID = (String)newValue;
-// this.setSystemID = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDNotation_SystemID(),oldValue,newValue);
-// }
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID: {
-// Object oldValue = this.publicID;
-// this.publicID = (String)newValue;
-// this.setPublicID = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDNotation_PublicID(),oldValue,newValue);
-// }
-//
-// }
-// return super.eBasicSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eUnset(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eUnset(feature);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT: {
-// unsetComment();
-// return;
-// }
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID: {
-// unsetSystemID();
-// return;
-// }
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID: {
-// unsetPublicID();
-// return;
-// }
-// case DTDPackage.DTD_NOTATION__DTD_FILE: {
-// unsetDTDFile();
-// return;
-// }
-//
-// }
-// super.eUnset(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification refBasicUnsetValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicUnsetValue(feature);
-// }
-// switch (eClassDTDNotation().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_NOTATION__COMMENT: {
-// Object oldValue = this.comment;
-// this.comment = null;
-// this.setComment = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDNotation_Comment(),oldValue,getComment());
-// }
-// case DTDPackage.DTD_NOTATION__SYSTEM_ID: {
-// Object oldValue = this.systemID;
-// this.systemID = null;
-// this.setSystemID = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDNotation_SystemID(),oldValue,getSystemID());
-// }
-// case DTDPackage.DTD_NOTATION__PUBLIC_ID: {
-// Object oldValue = this.publicID;
-// this.publicID = null;
-// this.setPublicID = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDNotation_PublicID(),oldValue,getPublicID());
-// }
-//
-// }
-// return super.refBasicUnsetValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected DTDContentImpl getDtdContentDelegate() {
-// if (dtdContentDelegate == null) {
-// DTDPackage pkg =
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// dtdContentDelegate=(DTDContentImpl)pkg.eCreateInstance(pkg.DTD_CONTENT);
-// dtdContentDelegate.initInstance();
-// }
-// return dtdContentDelegate;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDContent() {
-// return getDtdContentDelegate().eClass();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDFile getDTDFile() {
-// return getDtdContentDelegate().getDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setDTDFile(DTDFile value) {
-// getDtdContentDelegate().setDTDFile(value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetDTDFile() {
-// getDtdContentDelegate().unsetDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetDTDFile() {
-// return getDtdContentDelegate().isSetDTDFile();
-// }
-// }
-// -------------------GENERICRULES.JSED-------------------
-
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPCDataContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPCDataContentImpl.java
deleted file mode 100644
index 7340f57..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPCDataContentImpl.java
+++ /dev/null
@@ -1,171 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-
-/**
- * @generated
- */
-public class DTDPCDataContentImpl extends DTDElementContentImpl implements DTDPCDataContent {
-
-	public DTDPCDataContentImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDPCDataContent();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_PC_DATA_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
-					return eBasicSetContainer(null, DTDPackage.DTD_PC_DATA_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
-					return eBasicSetContainer(null, DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
-				case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
-				return getGroup();
-			case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
-				return getElement();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
-				setGroup((DTDGroupContent) newValue);
-				return;
-			case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
-				setElement((DTDElement) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
-				setGroup((DTDGroupContent) null);
-				return;
-			case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
-				setElement((DTDElement) null);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
-				return getGroup() != null;
-			case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
-				return getElement() != null;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	public String getContentName() {
-		return "#PCDATA"; //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPackageImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPackageImpl.java
deleted file mode 100644
index c6c18a9..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPackageImpl.java
+++ /dev/null
@@ -1,1215 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.impl.EcorePackageImpl;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFactory;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-import org.eclipse.wst.dtd.core.internal.emf.XMLSchemaDefinedType;
-
-
-/**
- * @lastgen class DTDPackageImpl extends EPackageImpl implements DTDPackage,
- *          EPackage {}
- */
-public class DTDPackageImpl extends EPackageImpl implements DTDPackage {
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdElementContentEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdGroupContentEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdAttributeEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdElementEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdEmptyContentEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdAnyContentEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdpcDataContentEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdElementReferenceContentEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdRepeatableContentEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdFileEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdBasicTypeEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdEnumerationTypeEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdNotationEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdEntityEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdEntityContentEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdExternalEntityEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdInternalEntityEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdParameterEntityReferenceEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdEntityReferenceContentEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EClass dtdContentEClass = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EEnum dtdOccurrenceTypeEEnum = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EEnum dtdDefaultKindEEnum = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EEnum dtdBasicTypeKindEEnum = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EEnum dtdEnumGroupKindEEnum = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EEnum dtdGroupKindEEnum = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private EEnum xmlSchemaDefinedTypeEEnum = null;
-
-	/**
-	 * Creates an instance of the model <b>Package</b>, registered with
-	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by
-	 * the package package URI value.
-	 * <p>
-	 * Note: the correct way to create the package is via the static factory
-	 * method {@link #init init()}, which also performs initialization of the
-	 * package, or returns the registered package, if one already exists. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see org.eclipse.emf.ecore.EPackage.Registry
-	 * @see org.eclipse.wst.dtd.core.internal.emf.DTDPackage#eNS_URI
-	 * @see #init()
-	 * @generated
-	 */
-	private DTDPackageImpl() {
-		super(eNS_URI, DTDFactory.eINSTANCE);
-	}
-
-	// public DTDPackageImpl()
-	// {
-	// super(eNS_URI);
-	// initializePackage(null);
-	// }
-
-
-	/**
-	 * Creates, registers, and initializes the <b>Package</b> for this model,
-	 * and for any others upon which it depends. Simple dependencies are
-	 * satisfied by calling this method on all dependent packages before doing
-	 * anything else. This method drives initialization for interdependent
-	 * packages directly, in parallel with this package, itself.
-	 * <p>
-	 * Of this package and its interdependencies, all packages which have not
-	 * yet been registered by their URI values are first created and
-	 * registered. The packages are then initialized in two steps: meta-model
-	 * objects for all of the packages are created before any are initialized,
-	 * since one package's meta-model objects may refer to those of another.
-	 * <p>
-	 * Invocation of this method will not affect any packages that have
-	 * already been initialized. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #eNS_URI
-	 * @see #createPackageContents()
-	 * @see #initializePackageContents()
-	 * @generated
-	 */
-	public static DTDPackage init() {
-		// Obtain or create and register package and interdependencies
-		DTDPackageImpl theDTDPackage = (DTDPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EPackage ? EPackage.Registry.INSTANCE.get(eNS_URI) : new DTDPackageImpl());
-		EcorePackageImpl theEcorePackage = (EcorePackageImpl) (EPackage.Registry.INSTANCE.get(EcorePackage.eNS_URI) instanceof EPackage ? EPackage.Registry.INSTANCE.get(EcorePackage.eNS_URI) : EcorePackage.eINSTANCE);
-
-		// Step 1: create meta-model objects
-		theDTDPackage.createPackageContents();
-		theEcorePackage.createPackageContents();
-
-		// Step 2: complete initialization
-		theDTDPackage.initializePackageContents();
-		theEcorePackage.initializePackageContents();
-
-		return theDTDPackage;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDElementContent() {
-		return dtdElementContentEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDElementContent_Group() {
-		return (EReference) dtdElementContentEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDElementContent_Element() {
-		return (EReference) dtdElementContentEClass.getEReferences().get(1);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDGroupContent() {
-		return dtdGroupContentEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDGroupContent_GroupKind() {
-		return (EAttribute) dtdGroupContentEClass.getEAttributes().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDGroupContent_Content() {
-		return (EReference) dtdGroupContentEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDAttribute() {
-		return dtdAttributeEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDAttribute_Comment() {
-		return (EAttribute) dtdAttributeEClass.getEAttributes().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDAttribute_DefaultKind() {
-		return (EAttribute) dtdAttributeEClass.getEAttributes().get(1);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDAttribute_DefaultValueString() {
-		return (EAttribute) dtdAttributeEClass.getEAttributes().get(2);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDAttribute_AttributeNameReferencedEntity() {
-		return (EReference) dtdAttributeEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDAttribute_AttributeTypeReferencedEntity() {
-		return (EReference) dtdAttributeEClass.getEReferences().get(1);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDAttribute_DTDElement() {
-		return (EReference) dtdAttributeEClass.getEReferences().get(2);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDElement() {
-		return dtdElementEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDElement_Comment() {
-		return (EAttribute) dtdElementEClass.getEAttributes().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDElement_Content() {
-		return (EReference) dtdElementEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDElement_DTDAttribute() {
-		return (EReference) dtdElementEClass.getEReferences().get(1);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDEmptyContent() {
-		return dtdEmptyContentEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDAnyContent() {
-		return dtdAnyContentEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDPCDataContent() {
-		return dtdpcDataContentEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDElementReferenceContent() {
-		return dtdElementReferenceContentEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDElementReferenceContent_ReferencedElement() {
-		return (EReference) dtdElementReferenceContentEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDRepeatableContent() {
-		return dtdRepeatableContentEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDRepeatableContent_Occurrence() {
-		return (EAttribute) dtdRepeatableContentEClass.getEAttributes().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDFile() {
-		return dtdFileEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDFile_Comment() {
-		return (EAttribute) dtdFileEClass.getEAttributes().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDFile_ParseError() {
-		return (EAttribute) dtdFileEClass.getEAttributes().get(1);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDFile_DTDContent() {
-		return (EReference) dtdFileEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDFile_DTDEnumerationType() {
-		return (EReference) dtdFileEClass.getEReferences().get(1);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDBasicType() {
-		return dtdBasicTypeEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDBasicType_Kind() {
-		return (EAttribute) dtdBasicTypeEClass.getEAttributes().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDEnumerationType() {
-		return dtdEnumerationTypeEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDEnumerationType_Kind() {
-		return (EAttribute) dtdEnumerationTypeEClass.getEAttributes().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDEnumerationType_DTDFile() {
-		return (EReference) dtdEnumerationTypeEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDNotation() {
-		return dtdNotationEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDNotation_Comment() {
-		return (EAttribute) dtdNotationEClass.getEAttributes().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDNotation_SystemID() {
-		return (EAttribute) dtdNotationEClass.getEAttributes().get(1);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDNotation_PublicID() {
-		return (EAttribute) dtdNotationEClass.getEAttributes().get(2);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDNotation_Entity() {
-		return (EReference) dtdNotationEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDEntity() {
-		return dtdEntityEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDEntity_Comment() {
-		return (EAttribute) dtdEntityEClass.getEAttributes().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDEntity_ParameterEntity() {
-		return (EAttribute) dtdEntityEClass.getEAttributes().get(1);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDEntity_Content() {
-		return (EReference) dtdEntityEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDEntity_ParmEntityRef() {
-		return (EReference) dtdEntityEClass.getEReferences().get(1);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDEntity_EntityReference() {
-		return (EReference) dtdEntityEClass.getEReferences().get(2);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDEntity_AttributeNameReference() {
-		return (EReference) dtdEntityEClass.getEReferences().get(3);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDEntity_AttributeTypeReference() {
-		return (EReference) dtdEntityEClass.getEReferences().get(4);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDEntityContent() {
-		return dtdEntityContentEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDEntityContent_DTDEntity() {
-		return (EReference) dtdEntityContentEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDExternalEntity() {
-		return dtdExternalEntityEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDExternalEntity_SystemID() {
-		return (EAttribute) dtdExternalEntityEClass.getEAttributes().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDExternalEntity_PublicID() {
-		return (EAttribute) dtdExternalEntityEClass.getEAttributes().get(1);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDExternalEntity_Notation() {
-		return (EReference) dtdExternalEntityEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDExternalEntity_EntityReferencedFromAnotherFile() {
-		return (EReference) dtdExternalEntityEClass.getEReferences().get(1);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDInternalEntity() {
-		return dtdInternalEntityEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EAttribute getDTDInternalEntity_Value() {
-		return (EAttribute) dtdInternalEntityEClass.getEAttributes().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDParameterEntityReference() {
-		return dtdParameterEntityReferenceEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDParameterEntityReference_Entity() {
-		return (EReference) dtdParameterEntityReferenceEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDEntityReferenceContent() {
-		return dtdEntityReferenceContentEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDEntityReferenceContent_ElementReferencedEntity() {
-		return (EReference) dtdEntityReferenceContentEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EClass getDTDContent() {
-		return dtdContentEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EReference getDTDContent_DTDFile() {
-		return (EReference) dtdContentEClass.getEReferences().get(0);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EEnum getDTDOccurrenceType() {
-		return dtdOccurrenceTypeEEnum;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EEnum getDTDDefaultKind() {
-		return dtdDefaultKindEEnum;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EEnum getDTDBasicTypeKind() {
-		return dtdBasicTypeKindEEnum;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EEnum getDTDEnumGroupKind() {
-		return dtdEnumGroupKindEEnum;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EEnum getDTDGroupKind() {
-		return dtdGroupKindEEnum;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public EEnum getXMLSchemaDefinedType() {
-		return xmlSchemaDefinedTypeEEnum;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDFactory getDTDFactory() {
-		return (DTDFactory) getEFactoryInstance();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private boolean isCreated = false;
-
-	/**
-	 * Creates the meta-model objects for the package. This method is guarded
-	 * to have no affect on any invocation but its first. <!-- begin-user-doc
-	 * --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void createPackageContents() {
-		if (isCreated)
-			return;
-		isCreated = true;
-
-		// Create classes and their features
-		dtdElementContentEClass = createEClass(DTD_ELEMENT_CONTENT);
-		createEReference(dtdElementContentEClass, DTD_ELEMENT_CONTENT__GROUP);
-		createEReference(dtdElementContentEClass, DTD_ELEMENT_CONTENT__ELEMENT);
-
-		dtdGroupContentEClass = createEClass(DTD_GROUP_CONTENT);
-		createEAttribute(dtdGroupContentEClass, DTD_GROUP_CONTENT__GROUP_KIND);
-		createEReference(dtdGroupContentEClass, DTD_GROUP_CONTENT__CONTENT);
-
-		dtdAttributeEClass = createEClass(DTD_ATTRIBUTE);
-		createEAttribute(dtdAttributeEClass, DTD_ATTRIBUTE__COMMENT);
-		createEAttribute(dtdAttributeEClass, DTD_ATTRIBUTE__DEFAULT_KIND);
-		createEAttribute(dtdAttributeEClass, DTD_ATTRIBUTE__DEFAULT_VALUE_STRING);
-		createEReference(dtdAttributeEClass, DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY);
-		createEReference(dtdAttributeEClass, DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY);
-		createEReference(dtdAttributeEClass, DTD_ATTRIBUTE__DTD_ELEMENT);
-
-		dtdElementEClass = createEClass(DTD_ELEMENT);
-		createEAttribute(dtdElementEClass, DTD_ELEMENT__COMMENT);
-		createEReference(dtdElementEClass, DTD_ELEMENT__CONTENT);
-		createEReference(dtdElementEClass, DTD_ELEMENT__DTD_ATTRIBUTE);
-
-		dtdEmptyContentEClass = createEClass(DTD_EMPTY_CONTENT);
-
-		dtdAnyContentEClass = createEClass(DTD_ANY_CONTENT);
-
-		dtdpcDataContentEClass = createEClass(DTD_PC_DATA_CONTENT);
-
-		dtdElementReferenceContentEClass = createEClass(DTD_ELEMENT_REFERENCE_CONTENT);
-		createEReference(dtdElementReferenceContentEClass, DTD_ELEMENT_REFERENCE_CONTENT__REFERENCED_ELEMENT);
-
-		dtdRepeatableContentEClass = createEClass(DTD_REPEATABLE_CONTENT);
-		createEAttribute(dtdRepeatableContentEClass, DTD_REPEATABLE_CONTENT__OCCURRENCE);
-
-		dtdFileEClass = createEClass(DTD_FILE);
-		createEAttribute(dtdFileEClass, DTD_FILE__COMMENT);
-		createEAttribute(dtdFileEClass, DTD_FILE__PARSE_ERROR);
-		createEReference(dtdFileEClass, DTD_FILE__DTD_CONTENT);
-		createEReference(dtdFileEClass, DTD_FILE__DTD_ENUMERATION_TYPE);
-
-		dtdBasicTypeEClass = createEClass(DTD_BASIC_TYPE);
-		createEAttribute(dtdBasicTypeEClass, DTD_BASIC_TYPE__KIND);
-
-		dtdEnumerationTypeEClass = createEClass(DTD_ENUMERATION_TYPE);
-		createEAttribute(dtdEnumerationTypeEClass, DTD_ENUMERATION_TYPE__KIND);
-		createEReference(dtdEnumerationTypeEClass, DTD_ENUMERATION_TYPE__DTD_FILE);
-
-		dtdNotationEClass = createEClass(DTD_NOTATION);
-		createEAttribute(dtdNotationEClass, DTD_NOTATION__COMMENT);
-		createEAttribute(dtdNotationEClass, DTD_NOTATION__SYSTEM_ID);
-		createEAttribute(dtdNotationEClass, DTD_NOTATION__PUBLIC_ID);
-		createEReference(dtdNotationEClass, DTD_NOTATION__ENTITY);
-
-		dtdEntityEClass = createEClass(DTD_ENTITY);
-		createEAttribute(dtdEntityEClass, DTD_ENTITY__COMMENT);
-		createEAttribute(dtdEntityEClass, DTD_ENTITY__PARAMETER_ENTITY);
-		createEReference(dtdEntityEClass, DTD_ENTITY__CONTENT);
-		createEReference(dtdEntityEClass, DTD_ENTITY__PARM_ENTITY_REF);
-		createEReference(dtdEntityEClass, DTD_ENTITY__ENTITY_REFERENCE);
-		createEReference(dtdEntityEClass, DTD_ENTITY__ATTRIBUTE_NAME_REFERENCE);
-		createEReference(dtdEntityEClass, DTD_ENTITY__ATTRIBUTE_TYPE_REFERENCE);
-
-		dtdEntityContentEClass = createEClass(DTD_ENTITY_CONTENT);
-		createEReference(dtdEntityContentEClass, DTD_ENTITY_CONTENT__DTD_ENTITY);
-
-		dtdExternalEntityEClass = createEClass(DTD_EXTERNAL_ENTITY);
-		createEAttribute(dtdExternalEntityEClass, DTD_EXTERNAL_ENTITY__SYSTEM_ID);
-		createEAttribute(dtdExternalEntityEClass, DTD_EXTERNAL_ENTITY__PUBLIC_ID);
-		createEReference(dtdExternalEntityEClass, DTD_EXTERNAL_ENTITY__NOTATION);
-		createEReference(dtdExternalEntityEClass, DTD_EXTERNAL_ENTITY__ENTITY_REFERENCED_FROM_ANOTHER_FILE);
-
-		dtdInternalEntityEClass = createEClass(DTD_INTERNAL_ENTITY);
-		createEAttribute(dtdInternalEntityEClass, DTD_INTERNAL_ENTITY__VALUE);
-
-		dtdParameterEntityReferenceEClass = createEClass(DTD_PARAMETER_ENTITY_REFERENCE);
-		createEReference(dtdParameterEntityReferenceEClass, DTD_PARAMETER_ENTITY_REFERENCE__ENTITY);
-
-		dtdEntityReferenceContentEClass = createEClass(DTD_ENTITY_REFERENCE_CONTENT);
-		createEReference(dtdEntityReferenceContentEClass, DTD_ENTITY_REFERENCE_CONTENT__ELEMENT_REFERENCED_ENTITY);
-
-		dtdContentEClass = createEClass(DTD_CONTENT);
-		createEReference(dtdContentEClass, DTD_CONTENT__DTD_FILE);
-
-		// Create enums
-		dtdOccurrenceTypeEEnum = createEEnum(DTD_OCCURRENCE_TYPE);
-		dtdDefaultKindEEnum = createEEnum(DTD_DEFAULT_KIND);
-		dtdBasicTypeKindEEnum = createEEnum(DTD_BASIC_TYPE_KIND);
-		dtdEnumGroupKindEEnum = createEEnum(DTD_ENUM_GROUP_KIND);
-		dtdGroupKindEEnum = createEEnum(DTD_GROUP_KIND);
-		xmlSchemaDefinedTypeEEnum = createEEnum(XML_SCHEMA_DEFINED_TYPE);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	private boolean isInitialized = false;
-
-	/**
-	 * Complete the initialization of the package and its meta-model. This
-	 * method is guarded to have no affect on any invocation but its first.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void initializePackageContents() {
-		if (isInitialized)
-			return;
-		isInitialized = true;
-
-		// Initialize package
-		setName(eNAME);
-		setNsPrefix(eNS_PREFIX);
-		setNsURI(eNS_URI);
-
-		// Obtain other dependent packages
-		EcorePackageImpl theEcorePackage = (EcorePackageImpl) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
-
-		// Add supertypes to classes
-		dtdGroupContentEClass.getESuperTypes().add(this.getDTDRepeatableContent());
-		dtdAttributeEClass.getESuperTypes().add(theEcorePackage.getEAttribute());
-		dtdElementEClass.getESuperTypes().add(theEcorePackage.getEClass());
-		dtdElementEClass.getESuperTypes().add(this.getDTDContent());
-		dtdEmptyContentEClass.getESuperTypes().add(this.getDTDElementContent());
-		dtdAnyContentEClass.getESuperTypes().add(this.getDTDElementContent());
-		dtdpcDataContentEClass.getESuperTypes().add(this.getDTDElementContent());
-		dtdElementReferenceContentEClass.getESuperTypes().add(this.getDTDRepeatableContent());
-		dtdRepeatableContentEClass.getESuperTypes().add(this.getDTDElementContent());
-		dtdBasicTypeEClass.getESuperTypes().add(theEcorePackage.getEClass());
-		dtdEnumerationTypeEClass.getESuperTypes().add(theEcorePackage.getEEnum());
-		dtdNotationEClass.getESuperTypes().add(this.getDTDContent());
-		dtdEntityEClass.getESuperTypes().add(this.getDTDContent());
-		dtdExternalEntityEClass.getESuperTypes().add(this.getDTDEntityContent());
-		dtdInternalEntityEClass.getESuperTypes().add(this.getDTDEntityContent());
-		dtdParameterEntityReferenceEClass.getESuperTypes().add(this.getDTDContent());
-		dtdEntityReferenceContentEClass.getESuperTypes().add(this.getDTDRepeatableContent());
-
-		// Initialize classes and features; add operations and parameters
-		initEClass(dtdElementContentEClass, DTDElementContent.class, "DTDElementContent", IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEReference(getDTDElementContent_Group(), this.getDTDGroupContent(), this.getDTDGroupContent_Content(), "group", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-		initEReference(getDTDElementContent_Element(), this.getDTDElement(), this.getDTDElement_Content(), "element", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		initEClass(dtdGroupContentEClass, DTDGroupContent.class, "DTDGroupContent", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEAttribute(getDTDGroupContent_GroupKind(), this.getDTDGroupKind(), "groupKind", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEReference(getDTDGroupContent_Content(), this.getDTDElementContent(), this.getDTDElementContent_Group(), "content", null, 1, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		initEClass(dtdAttributeEClass, DTDAttribute.class, "DTDAttribute", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEAttribute(getDTDAttribute_Comment(), ecorePackage.getEString(), "comment", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEAttribute(getDTDAttribute_DefaultKind(), this.getDTDDefaultKind(), "defaultKind", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEAttribute(getDTDAttribute_DefaultValueString(), ecorePackage.getEString(), "defaultValueString", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEReference(getDTDAttribute_AttributeNameReferencedEntity(), this.getDTDEntity(), this.getDTDEntity_AttributeNameReference(), "attributeNameReferencedEntity", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-		initEReference(getDTDAttribute_AttributeTypeReferencedEntity(), this.getDTDEntity(), this.getDTDEntity_AttributeTypeReference(), "attributeTypeReferencedEntity", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-		initEReference(getDTDAttribute_DTDElement(), this.getDTDElement(), this.getDTDElement_DTDAttribute(), "DTDElement", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		initEClass(dtdElementEClass, DTDElement.class, "DTDElement", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEAttribute(getDTDElement_Comment(), ecorePackage.getEString(), "comment", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEReference(getDTDElement_Content(), this.getDTDElementContent(), this.getDTDElementContent_Element(), "content", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-		initEReference(getDTDElement_DTDAttribute(), this.getDTDAttribute(), this.getDTDAttribute_DTDElement(), "DTDAttribute", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		initEClass(dtdEmptyContentEClass, DTDEmptyContent.class, "DTDEmptyContent", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-
-		initEClass(dtdAnyContentEClass, DTDAnyContent.class, "DTDAnyContent", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-
-		initEClass(dtdpcDataContentEClass, DTDPCDataContent.class, "DTDPCDataContent", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-
-		initEClass(dtdElementReferenceContentEClass, DTDElementReferenceContent.class, "DTDElementReferenceContent", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEReference(getDTDElementReferenceContent_ReferencedElement(), this.getDTDElement(), null, "referencedElement", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		initEClass(dtdRepeatableContentEClass, DTDRepeatableContent.class, "DTDRepeatableContent", IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEAttribute(getDTDRepeatableContent_Occurrence(), this.getDTDOccurrenceType(), "occurrence", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-
-		initEClass(dtdFileEClass, DTDFile.class, "DTDFile", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEAttribute(getDTDFile_Comment(), ecorePackage.getEString(), "comment", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEAttribute(getDTDFile_ParseError(), ecorePackage.getEBoolean(), "parseError", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEReference(getDTDFile_DTDContent(), this.getDTDContent(), this.getDTDContent_DTDFile(), "DTDContent", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-		initEReference(getDTDFile_DTDEnumerationType(), this.getDTDEnumerationType(), this.getDTDEnumerationType_DTDFile(), "DTDEnumerationType", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		initEClass(dtdBasicTypeEClass, DTDBasicType.class, "DTDBasicType", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEAttribute(getDTDBasicType_Kind(), this.getDTDBasicTypeKind(), "kind", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-
-		initEClass(dtdEnumerationTypeEClass, DTDEnumerationType.class, "DTDEnumerationType", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEAttribute(getDTDEnumerationType_Kind(), this.getDTDEnumGroupKind(), "kind", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEReference(getDTDEnumerationType_DTDFile(), this.getDTDFile(), this.getDTDFile_DTDEnumerationType(), "DTDFile", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		initEClass(dtdNotationEClass, DTDNotation.class, "DTDNotation", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEAttribute(getDTDNotation_Comment(), ecorePackage.getEString(), "comment", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEAttribute(getDTDNotation_SystemID(), ecorePackage.getEString(), "systemID", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEAttribute(getDTDNotation_PublicID(), ecorePackage.getEString(), "publicID", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEReference(getDTDNotation_Entity(), this.getDTDExternalEntity(), this.getDTDExternalEntity_Notation(), "entity", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		initEClass(dtdEntityEClass, DTDEntity.class, "DTDEntity", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEAttribute(getDTDEntity_Comment(), ecorePackage.getEString(), "comment", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEAttribute(getDTDEntity_ParameterEntity(), ecorePackage.getEBoolean(), "parameterEntity", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEReference(getDTDEntity_Content(), this.getDTDEntityContent(), this.getDTDEntityContent_DTDEntity(), "content", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-		initEReference(getDTDEntity_ParmEntityRef(), this.getDTDParameterEntityReference(), this.getDTDParameterEntityReference_Entity(), "parmEntityRef", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-		initEReference(getDTDEntity_EntityReference(), this.getDTDEntityReferenceContent(), this.getDTDEntityReferenceContent_ElementReferencedEntity(), "entityReference", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-		initEReference(getDTDEntity_AttributeNameReference(), this.getDTDAttribute(), this.getDTDAttribute_AttributeNameReferencedEntity(), "attributeNameReference", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-		initEReference(getDTDEntity_AttributeTypeReference(), this.getDTDAttribute(), this.getDTDAttribute_AttributeTypeReferencedEntity(), "attributeTypeReference", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		initEClass(dtdEntityContentEClass, DTDEntityContent.class, "DTDEntityContent", IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEReference(getDTDEntityContent_DTDEntity(), this.getDTDEntity(), this.getDTDEntity_Content(), "DTDEntity", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		initEClass(dtdExternalEntityEClass, DTDExternalEntity.class, "DTDExternalEntity", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEAttribute(getDTDExternalEntity_SystemID(), ecorePackage.getEString(), "systemID", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEAttribute(getDTDExternalEntity_PublicID(), ecorePackage.getEString(), "publicID", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-		initEReference(getDTDExternalEntity_Notation(), this.getDTDNotation(), this.getDTDNotation_Entity(), "notation", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-		initEReference(getDTDExternalEntity_EntityReferencedFromAnotherFile(), this.getDTDFile(), null, "entityReferencedFromAnotherFile", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		initEClass(dtdInternalEntityEClass, DTDInternalEntity.class, "DTDInternalEntity", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEAttribute(getDTDInternalEntity_Value(), ecorePackage.getEString(), "value", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID); //$NON-NLS-1$
-
-		initEClass(dtdParameterEntityReferenceEClass, DTDParameterEntityReference.class, "DTDParameterEntityReference", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEReference(getDTDParameterEntityReference_Entity(), this.getDTDEntity(), this.getDTDEntity_ParmEntityRef(), "entity", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		initEClass(dtdEntityReferenceContentEClass, DTDEntityReferenceContent.class, "DTDEntityReferenceContent", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEReference(getDTDEntityReferenceContent_ElementReferencedEntity(), this.getDTDEntity(), this.getDTDEntity_EntityReference(), "elementReferencedEntity", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		initEClass(dtdContentEClass, DTDContent.class, "DTDContent", IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$
-		initEReference(getDTDContent_DTDFile(), this.getDTDFile(), this.getDTDFile_DTDContent(), "DTDFile", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES); //$NON-NLS-1$
-
-		// Initialize enums and add enum literals
-		initEEnum(dtdOccurrenceTypeEEnum, DTDOccurrenceType.class, "DTDOccurrenceType"); //$NON-NLS-1$
-		addEEnumLiteral(dtdOccurrenceTypeEEnum, DTDOccurrenceType.ONE_LITERAL);
-		addEEnumLiteral(dtdOccurrenceTypeEEnum, DTDOccurrenceType.OPTIONAL_LITERAL);
-		addEEnumLiteral(dtdOccurrenceTypeEEnum, DTDOccurrenceType.ONE_OR_MORE_LITERAL);
-		addEEnumLiteral(dtdOccurrenceTypeEEnum, DTDOccurrenceType.ZERO_OR_MORE_LITERAL);
-
-		initEEnum(dtdDefaultKindEEnum, DTDDefaultKind.class, "DTDDefaultKind"); //$NON-NLS-1$
-		addEEnumLiteral(dtdDefaultKindEEnum, DTDDefaultKind.IMPLIED_LITERAL);
-		addEEnumLiteral(dtdDefaultKindEEnum, DTDDefaultKind.REQUIRED_LITERAL);
-		addEEnumLiteral(dtdDefaultKindEEnum, DTDDefaultKind.FIXED_LITERAL);
-		addEEnumLiteral(dtdDefaultKindEEnum, DTDDefaultKind.NOFIXED_LITERAL);
-
-		initEEnum(dtdBasicTypeKindEEnum, DTDBasicTypeKind.class, "DTDBasicTypeKind"); //$NON-NLS-1$
-		addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.NONE_LITERAL);
-		addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.CDATA_LITERAL);
-		addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.ID_LITERAL);
-		addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.IDREF_LITERAL);
-		addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.IDREFS_LITERAL);
-		addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.ENTITY_LITERAL);
-		addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.ENTITIES_LITERAL);
-		addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.NMTOKEN_LITERAL);
-		addEEnumLiteral(dtdBasicTypeKindEEnum, DTDBasicTypeKind.NMTOKENS_LITERAL);
-
-		initEEnum(dtdEnumGroupKindEEnum, DTDEnumGroupKind.class, "DTDEnumGroupKind"); //$NON-NLS-1$
-		addEEnumLiteral(dtdEnumGroupKindEEnum, DTDEnumGroupKind.NAME_TOKEN_GROUP_LITERAL);
-		addEEnumLiteral(dtdEnumGroupKindEEnum, DTDEnumGroupKind.NOTATION_GROUP_LITERAL);
-
-		initEEnum(dtdGroupKindEEnum, DTDGroupKind.class, "DTDGroupKind"); //$NON-NLS-1$
-		addEEnumLiteral(dtdGroupKindEEnum, DTDGroupKind.SEQUENCE_LITERAL);
-		addEEnumLiteral(dtdGroupKindEEnum, DTDGroupKind.CHOICE_LITERAL);
-
-		initEEnum(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.class, "XMLSchemaDefinedType"); //$NON-NLS-1$
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.NONE_LITERAL);
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.STRING_LITERAL);
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.BOOLEAN_LITERAL);
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.FLOAT_LITERAL);
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.DOUBLE_LITERAL);
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.DECIMAL_LITERAL);
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.TIMEINSTANT_LITERAL);
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.TIMEDURATION_LITERAL);
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.RECURRINGINSTANT_LITERAL);
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.BINARY_LITERAL);
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.URI_LITERAL);
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.INTEGER_LITERAL);
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.DATE_LITERAL);
-		addEEnumLiteral(xmlSchemaDefinedTypeEEnum, XMLSchemaDefinedType.TIME_LITERAL);
-
-		// Create resource
-		createResource(eNS_URI);
-	}
-
-
-} // DTDPackageImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDParameterEntityReferenceImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDParameterEntityReferenceImpl.java
deleted file mode 100644
index 7097166..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDParameterEntityReferenceImpl.java
+++ /dev/null
@@ -1,610 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.notify.impl.NotificationChainImpl;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDLexicalInfo;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.util.DTDPathnameUtil;
-
-
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Parameter Entity Reference</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.wst.dtd.core.internal.emf.internal.impl.DTDParameterEntityReferenceImpl#getEntity <em>Entity</em>}</li>
- * </ul>
- * </p>
- * 
- * @generated
- */
-public class DTDParameterEntityReferenceImpl extends DTDContentImpl implements DTDParameterEntityReference, ENamedElement, DTDContent {
-
-	public String getName() {
-		DTDEntity entity = getEntity();
-		if (entity != null) {
-			return getEntity().getName();
-		} // end of if ()
-		return ""; //$NON-NLS-1$
-	}
-
-	public String getPathname() {
-		return DTDPathnameUtil.makePath(null, "PEnt", getName(), -1); //$NON-NLS-1$
-	}
-
-	public DTDObject findObject(String relativePath) {
-		return null;
-	}
-
-	// ugly hack for now since we don't have multiple inheritance.
-	// Would rather have all this stuff in a base class but these
-	// classes are inheriting from sometimes different mof classes
-	DTDLexicalInfo lexInfo = new DTDLexicalInfo();
-
-	/**
-	 * Get the value of startOffset.
-	 * 
-	 * @return value of startOffset.
-	 */
-	public int getStartOffset() {
-		return lexInfo.getStartOffset();
-	}
-
-	/**
-	 * Set the value of startOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to startOffset.
-	 */
-	public void setStartOffset(int v) {
-		lexInfo.setStartOffset(v);
-	}
-
-	/**
-	 * Get the value of endOffset.
-	 * 
-	 * @return value of endOffset.
-	 */
-	public int getEndOffset() {
-		return lexInfo.getEndOffset();
-	}
-
-	/**
-	 * Set the value of endOffset.
-	 * 
-	 * @param v
-	 *            Value to assign to endOffset.
-	 */
-	public void setEndOffset(int v) {
-		lexInfo.setEndOffset(v);
-	}
-
-
-	/**
-	 * The cached value of the '{@link #getEntity() <em>Entity</em>}'
-	 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getEntity()
-	 * @generated
-	 * @ordered
-	 */
-	protected DTDEntity entity = null;
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected DTDParameterEntityReferenceImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDParameterEntityReference();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDEntity getEntity() {
-		if (entity != null && entity.eIsProxy()) {
-			DTDEntity oldEntity = entity;
-			entity = (DTDEntity) EcoreUtil.resolve(entity, this);
-			if (entity != oldEntity) {
-				if (eNotificationRequired())
-					eNotify(new ENotificationImpl(this, Notification.RESOLVE, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY, oldEntity, entity));
-			}
-		}
-		return entity;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public DTDEntity basicGetEntity() {
-		return entity;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain basicSetEntity(DTDEntity newEntity, NotificationChain msgs) {
-		DTDEntity oldEntity = entity;
-		entity = newEntity;
-		if (eNotificationRequired()) {
-			if (msgs == null)
-				msgs = new NotificationChainImpl(4);
-			msgs.add(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY, oldEntity, newEntity));
-		}
-		return msgs;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setEntity(DTDEntity newEntity) {
-		if (newEntity != entity) {
-			NotificationChain msgs = null;
-			if (entity != null)
-				msgs = ((InternalEObject) entity).eInverseRemove(this, DTDPackage.DTD_ENTITY__PARM_ENTITY_REF, DTDEntity.class, msgs);
-			if (newEntity != null)
-				msgs = ((InternalEObject) newEntity).eInverseAdd(this, DTDPackage.DTD_ENTITY__PARM_ENTITY_REF, DTDEntity.class, msgs);
-			msgs = basicSetEntity(newEntity, msgs);
-			if (msgs != null)
-				msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY, newEntity, newEntity));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE, msgs);
-				case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY :
-					if (entity != null)
-						msgs = ((InternalEObject) entity).eInverseRemove(this, DTDPackage.DTD_ENTITY__PARM_ENTITY_REF, DTDEntity.class, msgs);
-					return basicSetEntity((DTDEntity) otherEnd, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
-					return eBasicSetContainer(null, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE, msgs);
-				case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY :
-					return basicSetEntity(null, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
-				return getDTDFile();
-			case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY :
-				if (resolve)
-					return getEntity();
-				return basicGetEntity();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
-				setDTDFile((DTDFile) newValue);
-				return;
-			case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY :
-				setEntity((DTDEntity) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
-				setDTDFile((DTDFile) null);
-				return;
-			case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY :
-				setEntity((DTDEntity) null);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
-				return getDTDFile() != null;
-			case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY :
-				return entity != null;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-} // DTDParameterEntityReferenceImpl
-
-// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-// //public class DTDParameterEntityReferenceImpl extends ENamespaceImpl
-// implements DTDParameterEntityReference, ENamespace, DTDContent{
-// -------------------GENERICRULES.JSED-------------------
-
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected DTDEntity entity = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected boolean setEntity = false;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// private DTDContentImpl dtdContentDelegate = null;
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EObject initInstance() {
-// setEMetaObj(eClassDTDParameterEntityReference());
-// initInstanceDelegates();
-// return this;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected void initInstanceDelegates() {
-// super.initInstanceDelegates();
-//
-
-// getDtdContentDelegate().refSetDelegateOwner(this);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDPackage ePackageDTD() {
-// return
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDParameterEntityReference() {
-// return
-// ((DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI)).getDTDParameterEntityReference();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation
-// */
-// public DTDEntity getEntity() {
-// try {
-// if (this.entity == null) return null;
-// this.entity = (DTDEntity) ((InternalEObject)this.entity).resolve(this,
-// DTDPackage.eINSTANCE.getDTDParameterEntityReference_Entity());
-// if (this.entity==null) this.setEntity = false;
-// return this.entity;
-// } catch (Exception e) {
-// return null;
-// }
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setEntity(DTDEntity l) {
-// refSetValueForSVReference(DTDPackage.eINSTANCE.getDTDParameterEntityReference_Entity(),this.entity,l);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetEntity() {
-// refUnsetValueForSVReference(DTDPackage.eINSTANCE.getDTDParameterEntityReference_Entity(),this.entity);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetEntity() {
-// return setEntity;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object eGet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eGet(feature);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY: return getEntity();
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE: return
-// getDTDFile();
-//
-
-// }
-// return super.eGet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Object refBasicValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicValue(feature);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY:
-// if (!this.setEntity||this.entity==null) return null;
-// if (((InternalEObject)this.entity).refIsDeleted()) {this.entity=null;
-// this.setEntity=false;}
-// return this.entity;
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE: return
-// ((InternalEObject)getDtdContentDelegate()).refBasicValue(feature);
-//
-
-// }
-// return super.refBasicValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean eIsSet(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eIsSet(feature);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY: return
-// isSetEntity();
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE: return
-// isSetDTDFile();
-//
-
-// }
-// return super.eIsSet(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eSet(EStructuralFeature feature, Object newValue) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eSet(feature, newValue);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY: {
-// setEntity((DTDEntity)newValue);
-// return;
-// }
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE: {
-// setDTDFile((DTDFile)newValue);
-// return;
-// }
-//
-
-// }
-// super.eSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification eBasicSet(EStructuralFeature feature, Object newValue)
-// {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.eBasicSet(feature, newValue);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY: {
-// Object oldValue = this.entity;
-// this.entity = (DTDEntity)newValue;
-// this.setEntity = true;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.SET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDParameterEntityReference_Entity(),oldValue,newValue);
-// }
-//
-
-// }
-// return super.eBasicSet(feature, newValue);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void eUnset(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// super.eUnset(feature);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY: {
-// unsetEntity();
-// return;
-// }
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE: {
-// unsetDTDFile();
-// return;
-// }
-//
-
-// }
-// super.eUnset(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public Notification refBasicUnsetValue(EStructuralFeature feature) {
-// EStructuralFeature eFeature=null;
-// try {
-// eFeature=(EStructuralFeature)feature;
-// } catch (ClassCastException e) {
-// return super.refBasicUnsetValue(feature);
-// }
-// switch (eClassDTDParameterEntityReference().getEFeatureId(eFeature)) {
-// case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY: {
-// Object oldValue = this.entity;
-// this.entity = null;
-// this.setEntity = false;
-// return new
-// ENotificationImpl((InternalEObject)this,Notification.UNSET,(EStructuralFeature)DTDPackage.eINSTANCE.getDTDParameterEntityReference_Entity(),oldValue,null);
-// }
-//
-
-// }
-// return super.refBasicUnsetValue(feature);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// protected DTDContentImpl getDtdContentDelegate() {
-// if (dtdContentDelegate == null) {
-// DTDPackage pkg =
-// (DTDPackage)EPackage.Registry.INSTANCE.getEPackage(DTDPackage.eNS_URI);
-// dtdContentDelegate=(DTDContentImpl)pkg.eCreateInstance(pkg.DTD_CONTENT);
-// dtdContentDelegate.initInstance();
-// }
-// return dtdContentDelegate;
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public EClass eClassDTDContent() {
-// return getDtdContentDelegate().eClass();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public DTDFile getDTDFile() {
-// return getDtdContentDelegate().getDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void setDTDFile(DTDFile value) {
-// getDtdContentDelegate().setDTDFile(value);
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public void unsetDTDFile() {
-// getDtdContentDelegate().unsetDTDFile();
-// }
-// /**
-// * @generated This field/method will be replaced during code generation.
-// */
-// public boolean isSetDTDFile() {
-// return getDtdContentDelegate().isSetDTDFile();
-// }
-// }
-// -------------------GENERICRULES.JSED-------------------
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDRepeatableContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDRepeatableContentImpl.java
deleted file mode 100644
index 5c470e9..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDRepeatableContentImpl.java
+++ /dev/null
@@ -1,265 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-
-/**
- * @generated
- */
-public abstract class DTDRepeatableContentImpl extends DTDElementContentImpl implements DTDRepeatableContent {
-	/**
-	 * The default value of the '{@link #getOccurrence() <em>Occurrence</em>}'
-	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @see #getOccurrence()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final DTDOccurrenceType OCCURRENCE_EDEFAULT = DTDOccurrenceType.ONE_LITERAL;
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected DTDOccurrenceType occurrence = OCCURRENCE_EDEFAULT;
-
-	public DTDRepeatableContentImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected EClass eStaticClass() {
-		return DTDPackage.eINSTANCE.getDTDRepeatableContent();
-	}
-
-	public String unparse() {
-		StringBuffer sb = new StringBuffer(128);
-		if (getOccurrence().getValue() != DTDOccurrenceType.ONE) {
-			if (this instanceof DTDEntityReferenceContent) {
-				sb.append("(").append(unparseRepeatableContent()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			else {
-				sb.append(unparseRepeatableContent());
-			}
-
-			// MOF2EMF Port
-			// EEnumLiteral lit = getOccurrence();
-			DTDOccurrenceType lit = getOccurrence();
-			if (lit != null) {
-				sb.append((char) lit.getValue());
-			}
-		}
-		else {
-			sb.append(unparseRepeatableContent());
-		}
-
-		return sb.toString();
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation
-	 *            JUST_ONE= -1 ONE_OR_MORE=43 OPTIONAL=63 ZERO_OR_MORE=42
-	 */
-	public DTDOccurrenceType getOccurrence() {
-		return occurrence;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public void setOccurrence(DTDOccurrenceType newOccurrence) {
-		DTDOccurrenceType oldOccurrence = occurrence;
-		occurrence = newOccurrence == null ? OCCURRENCE_EDEFAULT : newOccurrence;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_REPEATABLE_CONTENT__OCCURRENCE, oldOccurrence, occurrence));
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_REPEATABLE_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
-					if (eContainer != null)
-						msgs = eBasicRemoveFromContainer(msgs);
-					return eBasicSetContainer(otherEnd, DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT, msgs);
-				default :
-					return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		if (eContainer != null)
-			msgs = eBasicRemoveFromContainer(msgs);
-		return eBasicSetContainer(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
-		if (featureID >= 0) {
-			switch (baseClass == null ? featureID : eDerivedStructuralFeatureID(featureID, baseClass)) {
-				case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
-					return eBasicSetContainer(null, DTDPackage.DTD_REPEATABLE_CONTENT__GROUP, msgs);
-				case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
-					return eBasicSetContainer(null, DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT, msgs);
-				default :
-					return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
-			}
-		}
-		return eBasicSetContainer(null, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
-				case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
-				case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
-					return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__CONTENT, DTDElement.class, msgs);
-				default :
-					return eDynamicBasicRemoveFromContainer(msgs);
-			}
-		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	public Object eGet(EStructuralFeature eFeature, boolean resolve) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
-				return getGroup();
-			case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
-				return getElement();
-			case DTDPackage.DTD_REPEATABLE_CONTENT__OCCURRENCE :
-				return getOccurrence();
-		}
-		return eDynamicGet(eFeature, resolve);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public boolean eIsSet(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
-				return getGroup() != null;
-			case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
-				return getElement() != null;
-			case DTDPackage.DTD_REPEATABLE_CONTENT__OCCURRENCE :
-				return occurrence != OCCURRENCE_EDEFAULT;
-		}
-		return eDynamicIsSet(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eSet(EStructuralFeature eFeature, Object newValue) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
-				setGroup((DTDGroupContent) newValue);
-				return;
-			case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
-				setElement((DTDElement) newValue);
-				return;
-			case DTDPackage.DTD_REPEATABLE_CONTENT__OCCURRENCE :
-				setOccurrence((DTDOccurrenceType) newValue);
-				return;
-		}
-		eDynamicSet(eFeature, newValue);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public void eUnset(EStructuralFeature eFeature) {
-		switch (eDerivedStructuralFeatureID(eFeature.getFeatureID(), eFeature.getContainerClass())) {
-			case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
-				setGroup((DTDGroupContent) null);
-				return;
-			case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
-				setElement((DTDElement) null);
-				return;
-			case DTDPackage.DTD_REPEATABLE_CONTENT__OCCURRENCE :
-				setOccurrence(OCCURRENCE_EDEFAULT);
-				return;
-		}
-		eDynamicUnset(eFeature);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public String toString() {
-		if (eIsProxy())
-			return super.toString();
-
-		StringBuffer result = new StringBuffer(super.toString());
-		result.append(" (occurrence: "); //$NON-NLS-1$
-		result.append(occurrence);
-		result.append(')');
-		return result.toString();
-	}
-
-	/*
-	 * @see DTDRepeatableContent#unparseRepeatableContent()
-	 */
-	public String unparseRepeatableContent() {
-		return null;
-	}
-
-	/*
-	 * @see DTDElementContent#getContentName()
-	 */
-	public String getContentName() {
-		return null;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDAdapterFactory.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDAdapterFactory.java
deleted file mode 100644
index fa06cdf..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDAdapterFactory.java
+++ /dev/null
@@ -1,440 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-
-
-
-public class DTDAdapterFactory extends AdapterFactoryImpl {
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	protected static DTDPackage modelPackage;
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public DTDAdapterFactory() {
-		if (modelPackage == null) {
-			modelPackage = DTDPackage.eINSTANCE;
-		}
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public boolean isFactoryForType(Object object) {
-		if (object == modelPackage) {
-			return true;
-		}
-		if (object instanceof EObject) {
-			return ((EObject) object).eClass().getEPackage() == modelPackage;
-		}
-		return false;
-	}
-
-	/**
-	 * The switch the delegates to the <code>createXXX</code> methods. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected DTDSwitch modelSwitch = new DTDSwitch() {
-		public Object caseDTDElementContent(DTDElementContent object) {
-			return createDTDElementContentAdapter();
-		}
-
-		public Object caseDTDGroupContent(DTDGroupContent object) {
-			return createDTDGroupContentAdapter();
-		}
-
-		public Object caseDTDAttribute(DTDAttribute object) {
-			return createDTDAttributeAdapter();
-		}
-
-		public Object caseDTDElement(DTDElement object) {
-			return createDTDElementAdapter();
-		}
-
-		public Object caseDTDEmptyContent(DTDEmptyContent object) {
-			return createDTDEmptyContentAdapter();
-		}
-
-		public Object caseDTDAnyContent(DTDAnyContent object) {
-			return createDTDAnyContentAdapter();
-		}
-
-		public Object caseDTDPCDataContent(DTDPCDataContent object) {
-			return createDTDPCDataContentAdapter();
-		}
-
-		public Object caseDTDElementReferenceContent(DTDElementReferenceContent object) {
-			return createDTDElementReferenceContentAdapter();
-		}
-
-		public Object caseDTDRepeatableContent(DTDRepeatableContent object) {
-			return createDTDRepeatableContentAdapter();
-		}
-
-		public Object caseDTDFile(DTDFile object) {
-			return createDTDFileAdapter();
-		}
-
-		public Object caseDTDBasicType(DTDBasicType object) {
-			return createDTDBasicTypeAdapter();
-		}
-
-		public Object caseDTDEnumerationType(DTDEnumerationType object) {
-			return createDTDEnumerationTypeAdapter();
-		}
-
-		public Object caseDTDNotation(DTDNotation object) {
-			return createDTDNotationAdapter();
-		}
-
-		public Object caseDTDEntity(DTDEntity object) {
-			return createDTDEntityAdapter();
-		}
-
-		public Object caseDTDEntityContent(DTDEntityContent object) {
-			return createDTDEntityContentAdapter();
-		}
-
-		public Object caseDTDExternalEntity(DTDExternalEntity object) {
-			return createDTDExternalEntityAdapter();
-		}
-
-		public Object caseDTDInternalEntity(DTDInternalEntity object) {
-			return createDTDInternalEntityAdapter();
-		}
-
-		public Object caseDTDParameterEntityReference(DTDParameterEntityReference object) {
-			return createDTDParameterEntityReferenceAdapter();
-		}
-
-		public Object caseDTDEntityReferenceContent(DTDEntityReferenceContent object) {
-			return createDTDEntityReferenceContentAdapter();
-		}
-
-		public Object caseDTDContent(DTDContent object) {
-			return createDTDContentAdapter();
-		}
-
-		public Object caseEModelElement(EModelElement object) {
-			return createEModelElementAdapter();
-		}
-
-		public Object caseENamedElement(ENamedElement object) {
-			return createENamedElementAdapter();
-		}
-
-		public Object caseETypedElement(ETypedElement object) {
-			return createETypedElementAdapter();
-		}
-
-		public Object caseEStructuralFeature(EStructuralFeature object) {
-			return createEStructuralFeatureAdapter();
-		}
-
-		public Object caseEAttribute(EAttribute object) {
-			return createEAttributeAdapter();
-		}
-
-		public Object caseEClassifier(EClassifier object) {
-			return createEClassifierAdapter();
-		}
-
-		public Object caseEClass(EClass object) {
-			return createEClassAdapter();
-		}
-
-		public Object caseEDataType(EDataType object) {
-			return createEDataTypeAdapter();
-		}
-
-		public Object caseEEnum(EEnum object) {
-			return createEEnumAdapter();
-		}
-
-		public Object defaultCase(EObject object) {
-			return createEObjectAdapter();
-		}
-	};
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createAdapter(Notifier target) {
-		return (Adapter) modelSwitch.doSwitch((EObject) target);
-	}
-
-
-	/**
-	 * By default create methods return null so that we can easily ignore
-	 * cases. It's useful to ignore a case when inheritance will catch all the
-	 * cases anyway.
-	 */
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDFileAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDNotationAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDContentAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDEntityAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDEntityContentAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDExternalEntityAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDInternalEntityAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDParameterEntityReferenceAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDEntityReferenceContentAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDRepeatableContentAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDElementReferenceContentAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDElementAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDElementContentAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDEmptyContentAdapter() {
-		return null;
-	}
-
-	/**
-	 * By default create methods return null so that we can easily ignore
-	 * cases. It's useful to ignore a case when inheritance will catch all the
-	 * cases anyway.
-	 */
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDAnyContentAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDPCDataContentAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDGroupContentAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDAttributeAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDEnumerationTypeAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createDTDBasicTypeAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createEClassAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createEAttributeAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createEEnumAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createEModelElementAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createENamedElementAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createEStructuralFeatureAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createEDataTypeAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createEObjectAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createETypedElementAdapter() {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Adapter createEClassifierAdapter() {
-		return null;
-	}
-
-} // DTDAdapterFactory
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDMetrics.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDMetrics.java
deleted file mode 100644
index 32c06e3..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDMetrics.java
+++ /dev/null
@@ -1,125 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-
-
-public class DTDMetrics {
-	protected DTDFile dtdFile;
-	protected Hashtable elementReferenceMap;
-
-	public DTDMetrics(DTDFile dtdFile) {
-		this.dtdFile = dtdFile;
-	}
-
-	public Hashtable getElementReferences() {
-		if (elementReferenceMap == null) {
-			elementReferenceMap = new Hashtable();
-			new DTDVisitor() {
-
-				public void visitDTDElementReferenceContent(DTDElementReferenceContent elementReferenceContent) {
-					DTDElement dtdElement = elementReferenceContent.getReferencedElement();
-					Object visitation = elementReferenceMap.get(dtdElement);
-					if (visitation == null) {
-						elementReferenceMap.put(dtdElement, visitation = new Vector());
-					}
-					((Vector) visitation).addElement(elementReferenceContent);
-				}
-			}.visitDTDFile(dtdFile);
-		}
-
-		return elementReferenceMap;
-	}
-
-	public int getElementReferenceCount(DTDElement dtdElement) {
-		Object elementReferences = getElementReferences().get(dtdElement);
-		return elementReferences == null ? 0 : ((Vector) elementReferences).size();
-	}
-
-	public DTDElement getLeastReferencedElement() {
-		DTDElement result = null;
-		int lowestReferenceCount = Integer.MAX_VALUE;
-
-		Collection elements = dtdFile.listDTDElement();
-		for (Iterator i = elements.iterator(); i.hasNext();) {
-			DTDElement element = (DTDElement) i.next();
-			int count = getElementReferenceCount(element);
-			if (count < lowestReferenceCount) {
-				result = element;
-				lowestReferenceCount = count;
-			}
-		}
-
-		return result;
-	}
-
-	/**
-	 * @generated
-	 */
-	protected Hashtable getElementReferencesGen() {
-
-		if (elementReferenceMap == null) {
-			elementReferenceMap = new Hashtable();
-			new DTDVisitor() {
-
-				public void visitDTDElementReferenceContent(DTDElementReferenceContent elementReferenceContent) {
-					DTDElement dtdElement = elementReferenceContent.getReferencedElement();
-					Object visitation = elementReferenceMap.get(dtdElement);
-					if (visitation == null) {
-						elementReferenceMap.put(dtdElement, visitation = new Vector());
-					}
-					((Vector) visitation).addElement(elementReferenceContent);
-				}
-			}.visitDTDFile(dtdFile);
-		}
-
-		return elementReferenceMap;
-	}
-
-	/**
-	 * @generated
-	 */
-	protected int getElementReferenceCountGen(DTDElement dtdElement) {
-
-		Object elementReferences = getElementReferences().get(dtdElement);
-		return elementReferences == null ? 0 : ((Vector) elementReferences).size();
-	}
-
-	/**
-	 * @generated
-	 */
-	protected DTDElement getLeastReferencedElementGen() {
-
-		DTDElement result = null;
-		int lowestReferenceCount = Integer.MAX_VALUE;
-
-		Collection elements = dtdFile.listDTDElement();
-		for (Iterator i = elements.iterator(); i.hasNext();) {
-			DTDElement element = (DTDElement) i.next();
-			int count = getElementReferenceCount(element);
-			if (count < lowestReferenceCount) {
-				result = element;
-				lowestReferenceCount = count;
-			}
-		}
-
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDModelBuilder.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDModelBuilder.java
deleted file mode 100644
index d3dc76a..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDModelBuilder.java
+++ /dev/null
@@ -1,1844 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.dtd.core.internal.DTDCoreMessages;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicTypeKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDDefaultKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFactory;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDType;
-import org.eclipse.wst.dtd.core.internal.emf.impl.DTDFactoryImpl;
-import org.eclipse.wst.dtd.core.internal.saxparser.AttNode;
-import org.eclipse.wst.dtd.core.internal.saxparser.Attlist;
-import org.eclipse.wst.dtd.core.internal.saxparser.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.saxparser.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.saxparser.CMNode;
-import org.eclipse.wst.dtd.core.internal.saxparser.CMNodeType;
-import org.eclipse.wst.dtd.core.internal.saxparser.CMReferenceNode;
-import org.eclipse.wst.dtd.core.internal.saxparser.CMRepeatableNode;
-import org.eclipse.wst.dtd.core.internal.saxparser.DTD;
-import org.eclipse.wst.dtd.core.internal.saxparser.DTDSaxArtifactVisitor;
-import org.eclipse.wst.dtd.core.internal.saxparser.ElementDecl;
-import org.eclipse.wst.dtd.core.internal.saxparser.EntityDecl;
-import org.eclipse.wst.dtd.core.internal.saxparser.ErrorMessage;
-import org.eclipse.wst.dtd.core.internal.saxparser.NotationDecl;
-
-public class DTDModelBuilder extends DTDSaxArtifactVisitor {
-	DTD dtd;
-	DTDUtil dtdUtil;
-	DTDFile dtdFile;
-	ResourceSet resources;
-
-	public DTDModelBuilder(ResourceSet resources, DTDUtil dtdUtil, DTD dtd, DTDFile dtdFile) {
-		this.resources = resources;
-		this.dtdUtil = dtdUtil;
-		this.dtd = dtd;
-		this.dtdFile = dtdFile;
-	}
-
-	public DTDFactoryImpl getFactory() {
-		return (DTDFactoryImpl) dtdUtil.getFactory();
-	}
-
-	public DTDFile getDTDFile() {
-		return dtdFile;
-	}
-
-	public void visitDTD(DTD dtd) {
-		super.visitDTD(dtd);
-
-		// - 2nd pass -
-		// do final processing for Attlists and adding contentModel
-		addAttlistAndContentModel(dtd, dtdFile);
-	}
-
-	public void visitElementDecl(ElementDecl element) {
-		// Element might have been added earlier because it is referenced
-		String declName = element.getNodeName();
-		// System.out.println("process ElementDecl:" + declName );
-		DTDElement dtdelement = (DTDElement) dtdUtil.getElementPool().get(declName);
-		if (dtdelement == null) {
-			// System.out.println("process ElementDecl - not found - create"
-			// );
-			dtdelement = getFactory().createDTDElement();
-			dtdelement.setName(declName);
-			dtdFile.getDTDObject().add(dtdelement);
-			dtdUtil.getElementPool().put(declName, dtdelement);
-		}
-
-		super.visitElementDecl(element);
-	}
-
-	public void visitNotationDecl(NotationDecl notation) {
-		// Notation might have been added earlier because it is referenced
-		// by an entity
-		DTDNotation dtdnot = dtdFile.findNotation(notation.getNodeName());
-		if (dtdnot == null) {
-			dtdnot = getFactory().createDTDNotation();
-			dtdFile.getDTDObject().add(dtdnot);
-		}
-		dtdnot.setName(notation.getNodeName());
-
-		if (notation.getSystemId() != null)
-			dtdnot.setSystemID(notation.getSystemId());
-		if (notation.getPublicId() != null)
-			dtdnot.setPublicID(notation.getPublicId());
-
-		if (notation.getComment() != null)
-			dtdnot.setComment(notation.getComment());
-		if (notation.getErrorMessage() != null) {
-			addErrorMessage(notation.getErrorMessage(), dtdnot);
-		}
-
-		super.visitNotationDecl(notation);
-	}
-
-	public void visitParameterEntityReferenceDecl(EntityDecl entity) {
-		// This is a parameter entity reference.
-		// Add the link to the real entity that it references
-		DTDParameterEntityReference parmEntRef = getFactory().createDTDParameterEntityReference();
-		dtdFile.getDTDObject().add(parmEntRef);
-
-		String entityName = entity.getNodeName();
-
-		// Add the reference to the DTDEntity
-		DTDEntity dtdentity = getDTDFile().findEntity(entityName);
-		if (dtdentity != null) {
-			parmEntRef.setEntity(dtdentity);
-		}
-		if (entity.getErrorMessage() != null) {
-			addErrorMessage(entity.getErrorMessage(), dtdentity);
-		}
-		// System.out.println("adding PE reference: " + declName);
-
-		super.visitParameterEntityReferenceDecl(entity);
-	}
-
-	public void visitExternalEntityDecl(EntityDecl entity) {
-		DTDEntity dtdEntity = createDTDEntity(entity);
-		// System.out.println("adding entity: " + declName);
-		DTDExternalEntity extEntity = getFactory().createDTDExternalEntity();
-		dtdEntity.setContent(extEntity);
-
-		finishExternalEntity(extEntity, entity);
-		// System.out.println(" ext entity toMof: " );
-		if (dtdEntity.isParameterEntity()) {
-
-			dtdUtil.getPEPool().put("%" + entity.getNodeName() + ";", dtdEntity); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		super.visitExternalEntityDecl(entity);
-	}
-
-	public void visitInternalEntityDecl(EntityDecl entity) {
-		DTDEntity dtdEntity = createDTDEntity(entity);
-
-		DTDInternalEntity intEntity = getFactory().createDTDInternalEntity();
-		dtdEntity.setContent(intEntity);
-		intEntity.setValue(entity.getValue());
-		// System.out.println(" int entity toMof: " );
-		if (dtdEntity.isParameterEntity()) {
-			dtdUtil.getPEPool().put("%" + entity.getNodeName() + ";", dtdEntity); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		super.visitInternalEntityDecl(entity);
-	}
-
-	private void addAttlistAndContentModel(DTD dtd, DTDFile dFile) {
-		// System.out.println("addAttListAndCotentModel - dtd:" +
-		// dtd.getName());
-		Enumeration en = dtd.externalElements();
-		while (en.hasMoreElements()) {
-			Object e = en.nextElement();
-			if (e instanceof ElementDecl) {
-				DTDElement dtdelement = (DTDElement) dtdUtil.getElementPool().get(((ElementDecl) e).getNodeName());
-				if (dtdelement == null) {
-					dtdelement = getFactory().createDTDElement();
-					dtdFile.getDTDObject().add(dtdelement);
-				}
-				finishElementDecl(dtdelement, (ElementDecl) e);
-			}
-			else if (e instanceof Attlist) {
-				processAttList((Attlist) e);
-			}
-		}
-	}
-
-
-	private void processAttList(Attlist attList) {
-		DTDElement e = (DTDElement) dtdUtil.getElementPool().get(attList.getNodeName());
-		if (e != null) {
-			// Element has been added. Add the attributes
-			// System.out.println(" processAttlist - adding Attlist:" +
-			// attList.getNodeName());
-			createAttributes(e, attList);
-		}
-		else {
-			// System.out.println("!!!!!!!!! element is null ");
-		}
-	}
-
-	// /////////////////////////////////////////////////////////////
-	//
-	// Methods for finishing the import of a DTDExternalEntity
-	//
-	// /////////////////////////////////////////////////////////////
-	void finishExternalEntity(DTDExternalEntity extEntity, EntityDecl entityDecl) {
-		updateSystemID(extEntity, entityDecl);
-		extEntity.setPublicID(entityDecl.getPublicId());
-
-		String notationName = entityDecl.getNotationName();
-		if (notationName != null) {
-			DTDNotation dtdNotation = createOrFindNotation(extEntity, notationName, true);
-			extEntity.setNotation(dtdNotation);
-		}
-	}
-
-	public DTDNotation createOrFindNotation(DTDExternalEntity extEntity, String name, boolean create) {
-		DTDNotation aNotation = extEntity.getDTDEntity().getDTDFile().findNotation(name);
-		if (aNotation != null) {
-			return aNotation;
-		}
-
-		//
-		// Create a notation for the reference
-		//
-		if (create) {
-			aNotation = getFactory().createDTDNotation();
-			dtdFile.getDTDObject().add(aNotation);
-			aNotation.setName(name);
-		}
-		return aNotation;
-	}
-
-	/**
-	 * The SystemID attribute is set to whatever the user enters e.g.
-	 * com/ibm/b2b/xmimodels/xxx.dtd.xmi
-	 * 
-	 * In the unparse() method, parse out the DTD file name from the classpath
-	 * name. e.g. returns xxx.dtd
-	 */
-	private void updateSystemID(DTDExternalEntity extEntity, EntityDecl entityDecl) {
-		String systemId = entityDecl.getSystemId();
-		String publicId = entityDecl.getPublicId();
-		if (systemId != null) {
-			URIResolver idResolver = URIResolverPlugin.createResolver();
-			String uri = idResolver.resolve(dtd.getName(), publicId, systemId);
-			ExternalDTDModel ed = dtdUtil.getExternalDTDModel(resources, uri);
-			if (ed != null) {
-				DTDFile referenceDtdFile = ed.getExternalDTDFile();
-				extEntity.setEntityReferencedFromAnotherFile(referenceDtdFile);
-				extEntity.setSystemID(systemId);
-			}
-			else {
-				if (entityDecl.getErrorMessage() == null) {
-					ErrorMessage dtdError = new ErrorMessage();
-					dtdError.setErrorMessage(DTDCoreMessages._ERROR_INCL_FILE_LOAD_FAILURE + " '" + systemId + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					addErrorMessage(dtdError, extEntity.getDTDEntity());
-				}
-
-				if (systemId != null) {
-					extEntity.setSystemID(systemId);
-				}
-				else {
-					extEntity.setSystemID(""); //$NON-NLS-1$
-				}
-			}
-		} // end of if ()
-		else {
-			// set the system id to be ""
-			extEntity.setSystemID(""); //$NON-NLS-1$
-		}
-	}
-
-	public DTDEntity createDTDEntity(EntityDecl entity) {
-		// create and do what we can to fill in some basic things
-		DTDEntity dtdEntity = getFactory().createDTDEntity();
-		dtdFile.getDTDObject().add(dtdEntity);
-
-		dtdEntity.setName(entity.getNodeName());
-		dtdEntity.setParameterEntity(entity.isParameter());
-		if (entity.getComment() != null) {
-			dtdEntity.setComment(entity.getComment());
-		}
-		if (entity.getErrorMessage() != null) {
-			addErrorMessage(entity.getErrorMessage(), dtdEntity);
-		}
-
-		return dtdEntity;
-	}
-
-
-	// /////////////////////////////////////////////////////////////
-	//
-	// Methods for finishing the import of a DTDElement
-	//
-	// /////////////////////////////////////////////////////////////
-	public void finishElementDecl(DTDElement dtdElement, ElementDecl ed) {
-		dtdElement.setName(ed.getNodeName());
-
-		CMNode cmNode = ed.getContentModelNode();
-
-		if (ed.getComment() != null) {
-			dtdElement.setComment(ed.getComment());
-		}
-		if (ed.getErrorMessage() != null) {
-			addErrorMessage(ed.getErrorMessage(), dtdElement);
-		}
-
-		if (cmNode instanceof CMBasicNode) {
-			CMBasicNode bn = (CMBasicNode) cmNode;
-			switch (bn.getType()) {
-				case CMNodeType.EMPTY :
-					DTDEmptyContent emptyContent = getFactory().createDTDEmptyContent();
-					dtdElement.setContent(emptyContent);
-					break;
-
-				case CMNodeType.ANY :
-					DTDAnyContent anyContent = getFactory().createDTDAnyContent();
-					dtdElement.setContent(anyContent);
-					break;
-
-				case CMNodeType.PCDATA :
-					DTDPCDataContent pcData = getFactory().createDTDPCDataContent();
-					dtdElement.setContent(pcData);
-			}
-
-		}
-		else if (cmNode instanceof CMReferenceNode) {
-			CMReferenceNode rn = (CMReferenceNode) cmNode;
-			if (rn.getType() == CMNodeType.ENTITY_REFERENCE) {
-				String entityName = rn.getName().trim();
-
-				DTDEntity anEntity = (DTDEntity) dtdUtil.getPEPool().get(entityName);
-				if (anEntity != null) {
-					//
-					// Create an DTDEntityReference and set its referenced
-					// element
-					//
-					DTDEntityReferenceContent enRef = getFactory().createDTDEntityReferenceContent();
-					enRef.setElementReferencedEntity(anEntity);
-
-					DTDOccurrenceType occurrenceType = DTDOccurrenceType.get(computeMofOccurrence(rn));
-					enRef.setOccurrence(occurrenceType);
-
-					dtdElement.setContent(enRef);
-				}
-				else { // create default content
-					DTDEmptyContent emptyContent = getFactory().createDTDEmptyContent();
-					dtdElement.setContent(emptyContent);
-				}
-			}
-			else {
-				//
-				// Find the real element for this element references
-				// If the real element does not yet exist, create it
-				//
-				DTDElement anElement = createOrFindElement(rn.getName(), dtdElement);
-
-				//
-				// Create an DTDElementReference and set its referenced
-				// element
-				//
-				DTDElementReferenceContent elemRef = getFactory().createDTDElementReferenceContent();
-				elemRef.setReferencedElement(anElement);
-
-				DTDOccurrenceType occurrenceType = DTDOccurrenceType.get(computeMofOccurrence(rn));
-				elemRef.setOccurrence(occurrenceType);
-
-				// setContent to DTDElementReference
-				dtdElement.setContent(elemRef);
-
-			}
-		}
-		else if (cmNode instanceof CMGroupNode) {
-			CMGroupNode grpNode = (CMGroupNode) cmNode;
-			DTDGroupContent groupContent = getFactory().createDTDGroupContent();
-			DTDGroupKind groupKind = DTDGroupKind.get(computeMofGroupKind(grpNode.getGroupKind()));
-			groupContent.setGroupKind(groupKind);
-			DTDOccurrenceType occurrenceType = DTDOccurrenceType.get(computeMofOccurrence(grpNode));
-			groupContent.setOccurrence(occurrenceType);
-
-			// just use the locator for the element as the closest guess
-			processGroupContent(groupContent, grpNode);
-			dtdElement.setContent(groupContent);
-		}
-		else if (cmNode == null) {
-			// bad thing happened here, just create a pcdata
-			DTDEmptyContent emptyContent = getFactory().createDTDEmptyContent();
-			dtdElement.setContent(emptyContent);
-		}
-
-
-	}
-
-
-	/**
-	 * Add a new group to the current group
-	 * 
-	 * @param parent -
-	 *            the parent node for this group element
-	 * @param op1Node -
-	 *            the group e.g. (a,b)
-	 * @param op2Node -
-	 *            set only if called by processCM1op e.g. (a,b)+
-	 */
-	void processGroupContent(DTDGroupContent parent, CMGroupNode grpNode) {
-		Enumeration children = grpNode.getChildren().elements();
-		DTDFactory factory = getFactory();
-		while (children.hasMoreElements()) {
-			CMNode cnode = (CMNode) children.nextElement();
-
-			if (cnode instanceof CMGroupNode) {
-				CMGroupNode gNode = (CMGroupNode) cnode;
-				DTDGroupContent groupContent = factory.createDTDGroupContent();
-				DTDGroupKind groupKind = DTDGroupKind.get(computeMofGroupKind(gNode.getGroupKind()));
-				groupContent.setGroupKind(groupKind);
-				DTDOccurrenceType occurrenceType = DTDOccurrenceType.get(computeMofOccurrence(gNode));
-				groupContent.setOccurrence(occurrenceType);
-
-				parent.getContent().add(groupContent);
-				processGroupContent(groupContent, gNode);
-			}
-			else if (cnode instanceof CMBasicNode) {
-				CMBasicNode n = (CMBasicNode) cnode;
-				if (n.getType() == CMNodeType.PCDATA) {
-					// Create a DTDPCDataContent for a leaf PCData node
-					//
-					DTDPCDataContent pcData = factory.createDTDPCDataContent();
-					// Add #PCDATA to the Group, i.e Mixed content model
-					parent.getContent().add(pcData);
-				}
-			}
-			else if (cnode instanceof CMReferenceNode) {
-				CMReferenceNode rn = (CMReferenceNode) cnode;
-				if (rn.getType() == CMNodeType.ELEMENT_REFERENCE) {
-					// System.out.println("CM Element Ref name: " +
-					// rn.getName());
-					//
-					// Create an DTDElementReference and set its referenced
-					// element
-					//
-					DTDElementReferenceContent elemRef = factory.createDTDElementReferenceContent();
-
-					//
-					// Find the real element for this element references
-					// If the real element does not yet exist, create it
-					//
-					DTDElement anElement = createOrFindElement(rn.getName(), elemRef);
-
-					elemRef.setReferencedElement(anElement);
-
-					DTDOccurrenceType occurrenceType = DTDOccurrenceType.get(computeMofOccurrence(rn));
-					elemRef.setOccurrence(occurrenceType);
-
-					// Add DTDElementReference to the Group
-					parent.getContent().add(elemRef);
-				}
-				else // PE Reference
-				{
-					String entityName = rn.getName().trim();
-
-					// System.out.println("CM PE Ref name: " + entityName);
-					DTDEntity anEntity = (DTDEntity) dtdUtil.getPEPool().get(entityName);
-					if (anEntity != null) {
-						//
-						// Create an DTDEntityReference and set its referenced
-						// element
-						//
-						DTDEntityReferenceContent enRef = factory.createDTDEntityReferenceContent();
-						enRef.setElementReferencedEntity(anEntity);
-
-						DTDOccurrenceType occurrenceType = DTDOccurrenceType.get(computeMofOccurrence(rn));
-						enRef.setOccurrence(occurrenceType);
-
-						// Add DTDEntityReference to the Group
-						parent.getContent().add(enRef);
-
-					}
-				}
-			}
-		}
-	}
-
-	/**
-	 * Find the real element that is referenced by the current element
-	 */
-	private DTDElement createOrFindElement(String name, Object obj) {
-		// DTDElement aElement = getDTDFile().findElement(name);
-
-		DTDElement aElement = (DTDElement) dtdUtil.getElementPool().get(name);
-
-		if (aElement != null) {
-			return aElement;
-		}
-
-		String errorMsg = DTDCoreMessages._ERROR_UNDECLARED_ELEMENT_1; //$NON-NLS-1$
-		errorMsg += "\"" + name + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-		errorMsg += DTDCoreMessages._UI_ERRORPART_UNDECLARED_ELEMENT_2; //$NON-NLS-1$
-
-		ErrorMessage dtdError = new ErrorMessage();
-
-		dtdError.setErrorMessage(errorMsg);
-		addErrorMessage(dtdError, obj);
-		// System.out.println(errorMsg);
-		// setDTDErrorMessage(errorMsg);
-		getDTDFile().setParseError(true);
-
-		//
-		// Create an empty element for the reference to make it valid
-		//
-
-		DTDFactory factory = getFactory();
-		DTDElement dtdelement = factory.createDTDElement();
-		dtdelement.setName(name);
-
-		DTDEmptyContent emptyContent = factory.createDTDEmptyContent();
-		dtdelement.setContent(emptyContent);
-
-		getDTDFile().getDTDObject().add(dtdelement);
-		dtdUtil.getElementPool().put(name, dtdelement);
-		return dtdelement;
-	}
-
-
-	/**
-	 * Compute the MOF occurrence from the xml4j occurrence
-	 */
-	private int computeMofOccurrence(CMRepeatableNode rnode) {
-		int occurrence = rnode.getOccurrence();
-		int mofoccur = DTDOccurrenceType.ONE;
-
-		if (occurrence == CMNodeType.ZERO_OR_MORE) {
-			mofoccur = DTDOccurrenceType.ZERO_OR_MORE;
-		}
-		else if (occurrence == CMNodeType.ONE_OR_MORE) {
-			mofoccur = DTDOccurrenceType.ONE_OR_MORE;
-		}
-		else if (occurrence == CMNodeType.OPTIONAL) {
-			mofoccur = DTDOccurrenceType.OPTIONAL;
-		}
-		return mofoccur;
-	}
-
-	/**
-	 * Compute the MOF model group from the xml4j model group
-	 */
-	private int computeMofGroupKind(int type) {
-		if (type == CMNodeType.GROUP_CHOICE) {
-			return DTDGroupKind.CHOICE;
-		}
-		else {
-			return DTDGroupKind.SEQUENCE;
-		}
-	}
-
-
-	// /////////////////////////////////////////////////////////////
-	//
-	// Methods for creating the attributes of a DTDElement
-	//
-	// /////////////////////////////////////////////////////////////
-	public void createAttributes(DTDElement element, Attlist attList) {
-		if (attList.getErrorMessage() != null) {
-			addErrorMessage(attList.getErrorMessage(), element);
-		}
-
-		for (int i = 0; i < attList.size(); i++) {
-			AttNode ad = attList.elementAt(i);
-			// DTDAttributeElement dtdAtt=
-			// getDTDAttributeElement(a.getName());
-
-			// only add the AttDef if it is not added yet
-			// ignore the dup AttDef as documented in the XML 1.0 specs
-			// if( dtdAtt==null)
-			addAttribute(element, ad);
-		}
-
-	}
-
-	/**
-	 * Create a DTDAttribute from the xml4j attribute
-	 */
-	public void addAttribute(DTDElement dtdelement, AttNode ad) {
-		DTDAttribute dtdattr = getFactory().createDTDAttribute();
-		dtdelement.getDTDAttribute().add(dtdattr);
-		finishAttribute(dtdattr, ad);
-	}
-
-	// Stuff for populating attribute
-	public void finishAttribute(DTDAttribute dtdattr, AttNode attdef) {
-		boolean parseError = false;
-
-		if (attdef.name.startsWith("%")) { //$NON-NLS-1$
-			String peName = attdef.name.trim();
-			DTDEntity en = (DTDEntity) dtdUtil.getPEPool().get(peName);
-			if (en != null) {
-				dtdattr.setAttributeNameReferencedEntity(en);
-			}
-		}
-
-		dtdattr.setName(attdef.name);
-
-		int attrType = attdef.getDeclaredType();
-
-		if (attrType == AttNode.PEREFERENCE && attdef.type != null) {
-			String peName = attdef.type.trim();
-			DTDEntity en = (DTDEntity) dtdUtil.getPEPool().get(peName);
-			if (en != null) {
-				dtdattr.setAttributeTypeReferencedEntity(en);
-				setAttrDTDType(dtdattr, getFactory().getDTDBasicType_CDATA()); // hack,
-																				// so
-																				// we
-																				// can
-																				// get
-																				// back
-																				// the
-																				// default
-																				// value
-			}
-			else
-				// set default type
-				setAttrDTDType(dtdattr, getFactory().getDTDBasicType_CDATA());
-
-		}
-		else {
-			switch (attrType) {
-				case AttNode.CDATA :
-					setAttrDTDType(dtdattr, getFactory().getDTDBasicType_CDATA());
-					break;
-
-				case AttNode.ENTITIES :
-					setAttrDTDType(dtdattr, getFactory().getDTDBasicType_ENTITIES());
-					break;
-
-				case AttNode.ENTITY :
-					setAttrDTDType(dtdattr, getFactory().getDTDBasicType_ENTITY());
-					break;
-
-				case AttNode.ID :
-					// check for duplicate ID attribute
-					if (hasIDAttribute(dtdattr)) {
-						String errMsg = DTDCoreMessages._ERROR_DUP_ID_ATTRIBUTE_1; //$NON-NLS-1$
-						errMsg += attdef.name + DTDCoreMessages._UI_ERRORPART_DUP_ID_ATTRIBUTE_2; //$NON-NLS-1$
-						// dtdattr.getDTDElement().getIElement().setDTDErrorMessage(errMsg);
-						// dtdattr.getDTDElement().getDTDFile().setParseError(true);
-						parseError = true;
-					}
-					setAttrDTDType(dtdattr, getFactory().getDTDBasicType_ID());
-					break;
-
-				case AttNode.IDREF :
-					setAttrDTDType(dtdattr, getFactory().getDTDBasicType_IDREF());
-					break;
-
-				case AttNode.IDREFS :
-					setAttrDTDType(dtdattr, getFactory().getDTDBasicType_IDREFS());
-					break;
-
-				case AttNode.ENUMERATION :
-					setAttrDTDType(dtdattr, createDTDEnumeration(dtdattr, attdef, DTDEnumGroupKind.NAME_TOKEN_GROUP));
-					break;
-
-				case AttNode.NOTATION :
-					setAttrDTDType(dtdattr, createDTDEnumeration(dtdattr, attdef, DTDEnumGroupKind.NOTATION_GROUP));
-					break;
-
-				case AttNode.NMTOKEN :
-					setAttrDTDType(dtdattr, getFactory().getDTDBasicType_NMTOKEN());
-					break;
-
-				case AttNode.NMTOKENS :
-					setAttrDTDType(dtdattr, getFactory().getDTDBasicType_NMTOKENS());
-					break;
-
-				default :
-			// System.out.println("DTDATTR '" +attdef.name + "'Unknown
-			// type..." + attrType);
-			}
-		}
-
-		int attrDefault = attdef.getDefaultType();
-		int defaultKind = DTDDefaultKind.IMPLIED;
-		switch (attrDefault) {
-			case AttNode.FIXED :
-				defaultKind = DTDDefaultKind.FIXED;
-				break;
-
-			case AttNode.IMPLIED :
-				defaultKind = DTDDefaultKind.IMPLIED;
-				break;
-
-			case AttNode.REQUIRED :
-				defaultKind = DTDDefaultKind.REQUIRED;
-				break;
-
-			case AttNode.NOFIXED :
-				defaultKind = DTDDefaultKind.NOFIXED;
-				break;
-
-			default :
-		// System.out.println("DTDATTR '" +attdef.name + "' Unknown default
-		// type... " + attrDefault);
-		}
-
-		DTDDefaultKind defaultKindObj = DTDDefaultKind.get(defaultKind);
-		dtdattr.setDefaultKind(defaultKindObj);
-
-		if (parseError) {
-			return;
-		}
-
-		String defaultValue = attdef.defaultValue;
-		if (defaultValue != null) {
-			if (attrType == AttNode.ENUMERATION || attrType == AttNode.NOTATION) {
-				if (!isDefaultEnumValueValid(attdef, defaultValue)) {
-					String typeString = (attrType == AttNode.ENUMERATION ? "enumeration" : "notation"); //$NON-NLS-1$ //$NON-NLS-2$
-					String errMsg = DTDCoreMessages._ERROR_INVALID_DEFAULT_ATTR_VALUE_1; //$NON-NLS-1$
-					errMsg += typeString + DTDCoreMessages._UI_ERRORPART_INVALID_DEFAULT_ATTR_VALUE_2; //$NON-NLS-1$
-					errMsg += attdef.name + "'"; //$NON-NLS-1$
-
-					// dtdattr.getDTDElement().getIElement().setDTDErrorMessage(errMsg);
-					// dtdattr.getDTDElement().getDTDFile().setParseError(true);
-					return;
-				}
-			}
-			dtdattr.setDefaultValueString(defaultValue);
-		}
-		// System.out.println("DTDAttr - toMof getDefaultValueString " +
-		// getDefaultValueString());
-		// System.out.println("DTDAttr - toMof getDefaultValue: " +
-		// getDefaultValue());
-	}
-
-	public boolean hasIDAttribute(DTDAttribute dtdattr) {
-		boolean hasID = false;
-
-		DTDElement element = dtdattr.getDTDElement();
-		EList attrs = element.getDTDAttribute();
-
-		Iterator i = attrs.iterator();
-		while (i.hasNext()) {
-			DTDAttribute attr = (DTDAttribute) i.next();
-			DTDType dType = attr.getDTDType();
-			if (dType instanceof DTDBasicType) {
-				if (((DTDBasicType) dType).getKind().getValue() == DTDBasicTypeKind.ID) {
-					hasID = true;
-					break;
-				}
-			}
-		}
-		return hasID;
-	}
-
-	public DTDEnumerationType createDTDEnumeration(DTDAttribute dtdattr, String[] enumValues, int enumKind) {
-		DTDEnumerationType enumeration = getFactory().createDTDEnumerationType();
-		DTDEnumGroupKind groupKind = DTDEnumGroupKind.get(enumKind);
-		enumeration.setKind(groupKind);
-		// Enumeration values
-		if (enumValues != null) {
-			for (int i = 0; i < enumValues.length; i++) {
-				EEnumLiteral enumLiteral = createEEnumLiteral();
-				// enumVal.setXMIDocument(dtdattr.getXMIDocument());
-				// MOF2EMF Port
-				// enumLiteral.refSetLiteral(enumValues[i]);
-				enumLiteral.setName(enumValues[i]);
-
-				// enumLiteral.setNumber(i);
-				enumeration.getEnumLiterals().add(enumLiteral);
-			}
-		}
-		dtdattr.getDTDElement().getDTDFile().getDTDEnumerationType().add(enumeration);
-		return enumeration;
-	}
-
-	private EEnumLiteral createEEnumLiteral() {
-		EcorePackage ePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
-		// MOF2EMF Port
-		// return ((EcoreFactory)ePackage.getFactory()).createEEnumLiteral();
-		return ePackage.getEcoreFactory().createEEnumLiteral();
-	}
-
-	private DTDEnumerationType createDTDEnumeration(DTDAttribute dtdattr, AttNode attdef, int enumKind) {
-		DTDEnumerationType enumeration = getFactory().createDTDEnumerationType();
-		DTDEnumGroupKind groupKind = DTDEnumGroupKind.get(enumKind);
-		enumeration.setKind(groupKind);
-		dtdattr.getDTDElement().getDTDFile().getDTDEnumerationType().add(enumeration);
-
-		// Enumeration values
-		Enumeration tokenIter = attdef.elements();
-		if (tokenIter != null) {
-			while (tokenIter.hasMoreElements()) {
-				String val = (String) tokenIter.nextElement();
-				EEnumLiteral enumLiteral = createEEnumLiteral();
-				// enumLiteral.setXMIDocument(dtdattr.getXMIDocument());
-				// MOF2EMF Port
-				// enumLiteral.refSetLiteral(val);
-				enumLiteral.setName(val);
-
-
-				// enumLiteral.setNumber(i++);
-				enumeration.getEnumLiterals().add(enumLiteral);
-			}
-		}
-
-		return enumeration;
-	}
-
-	private boolean isDefaultEnumValueValid(AttNode attdef, String defaultValue) {
-		boolean valid = false;
-		boolean containsPercent = false;
-
-		// Enumeration values
-		Enumeration enumValues = attdef.elements();
-		while (enumValues.hasMoreElements()) {
-			String val = (String) enumValues.nextElement();
-			if (val.equals(defaultValue)) {
-				valid = true;
-				break;
-			}
-			if (val.indexOf('%') >= 0) {
-				containsPercent = true;
-			}
-		}
-		return valid || containsPercent;
-	}
-
-	public void setAttrDTDType(DTDAttribute dtdattr, DTDType type) {
-		dtdattr.setDTDType(type);
-	}
-
-	protected void addErrorMessage(ErrorMessage errMsg, Object obj) {
-		errMsg.setObject(obj);
-		dtdUtil.addErrorMessage(errMsg);
-	}
-
-	// /**
-	// * @generated
-	// */
-	// protected DTDFactoryImpl getFactoryGen() {
-	//
-	// return (DTDFactoryImpl)dtdUtil.getFactory();
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected DTDFile getDTDFileGen() {
-	//
-	// return dtdFile;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void visitDTDGen(DTD dtd) {
-	//
-	// super.visitDTD(dtd);
-	//
-	//
-	// // - 2nd pass -
-	// // do final processing for Attlists and adding contentModel
-	// addAttlistAndContentModel(dtd,dtdFile);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void visitElementDeclGen(ElementDecl element) {
-	//
-	// // Element might have been added earlier because it is referenced
-	// String declName = element.getNodeName() ;
-	// // System.out.println("process ElementDecl:" + declName );
-	// DTDElement dtdelement = (DTDElement)
-	// dtdUtil.getElementPool().get(declName);
-	// if (dtdelement == null)
-	// {
-	// // System.out.println("process ElementDecl - not found - create" );
-	// dtdelement = getFactory().createDTDElement();
-	// dtdelement.setName(declName);
-	// dtdFile.getDTDObject().add(dtdelement);
-	// dtdUtil.getElementPool().put(declName,dtdelement);
-	// }
-	//
-	//
-	// super.visitElementDecl(element);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void visitNotationDeclGen(NotationDecl notation) {
-	//
-	// // Notation might have been added earlier because it is referenced
-	// // by an entity
-	// DTDNotation dtdnot = dtdFile.findNotation( notation.getNodeName() );
-	// if (dtdnot == null)
-	// {
-	// dtdnot = getFactory().createDTDNotation();
-	// dtdFile.getDTDObject().add(dtdnot);
-	// }
-	// dtdnot.setName(notation.getNodeName());
-	//
-	//
-	// if (notation.getSystemId()!= null )
-	// dtdnot.setSystemID(notation.getSystemId());
-	// if (notation.getPublicId()!= null )
-	// dtdnot.setPublicID(notation.getPublicId());
-	//
-	//
-	// if (notation.getComment()!=null)
-	// dtdnot.setComment(notation.getComment());
-	// if (notation.getErrorMessage()!=null)
-	// {
-	// addErrorMessage(notation.getErrorMessage(), dtdnot);
-	// }
-	//
-	//
-	// super.visitNotationDecl(notation);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void visitParameterEntityReferenceDeclGen(EntityDecl entity)
-	// {
-	//
-	// // This is a parameter entity reference.
-	// // Add the link to the real entity that it references
-	// DTDParameterEntityReference parmEntRef =
-	// getFactory().createDTDParameterEntityReference();
-	// dtdFile.getDTDObject().add(parmEntRef);
-	//
-	//
-	// String entityName = entity.getNodeName();
-	//
-	//
-	// // Add the reference to the DTDEntity
-	// DTDEntity dtdentity = getDTDFile().findEntity(entityName);
-	// if (dtdentity != null)
-	// {
-	// parmEntRef.setEntity(dtdentity);
-	// }
-	// if (entity.getErrorMessage()!=null)
-	// {
-	// addErrorMessage(entity.getErrorMessage(), dtdentity);
-	// }
-	// // System.out.println("adding PE reference: " + declName);
-	//
-	//
-	// super.visitParameterEntityReferenceDecl(entity);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void visitExternalEntityDeclGen(EntityDecl entity) {
-	//
-	// DTDEntity dtdEntity = createDTDEntity(entity);
-	// // System.out.println("adding entity: " + declName);
-	// DTDExternalEntity extEntity = getFactory().createDTDExternalEntity();
-	// dtdEntity.setContent(extEntity);
-	//
-	//
-	// finishExternalEntity(extEntity, entity);
-	// // System.out.println(" ext entity toMof: " );
-	// if (dtdEntity.isParameterEntity())
-	// {
-	//
-	//
-	// dtdUtil.getPEPool().put("%"+entity.getNodeName()+";", dtdEntity);
-	// }
-	//
-	//
-	// super.visitExternalEntityDecl(entity);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void visitInternalEntityDeclGen(EntityDecl entity) {
-	//
-	// DTDEntity dtdEntity = createDTDEntity(entity);
-	//
-	//
-	// DTDInternalEntity intEntity = getFactory().createDTDInternalEntity();
-	// dtdEntity.setContent(intEntity);
-	// intEntity.setValue(entity.getValue());
-	// // System.out.println(" int entity toMof: " );
-	// if (dtdEntity.isParameterEntity())
-	// {
-	// dtdUtil.getPEPool().put("%"+entity.getNodeName()+";", dtdEntity);
-	// }
-	//
-	//
-	// super.visitInternalEntityDecl(entity);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void addAttlistAndContentModelGen(DTD dtd, DTDFile dFile) {
-	//
-	// //System.out.println("addAttListAndCotentModel - dtd:" +
-	// dtd.getName());
-	// Enumeration en = dtd.externalElements();
-	// while (en.hasMoreElements())
-	// {
-	// Object e = en.nextElement();
-	// if ( e instanceof ElementDecl )
-	// {
-	// DTDElement dtdelement = (DTDElement) dtdUtil.getElementPool().get(
-	// ((ElementDecl)e).getNodeName() );
-	// if (dtdelement == null)
-	// {
-	// dtdelement = getFactory().createDTDElement();
-	// dtdFile.getDTDObject().add(dtdelement);
-	// }
-	// finishElementDecl(dtdelement, (ElementDecl) e);
-	// }
-	// else if ( e instanceof Attlist )
-	// {
-	// processAttList((Attlist) e);
-	// }
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void processAttListGen(Attlist attList) {
-	//
-	// DTDElement e = (DTDElement)
-	// dtdUtil.getElementPool().get(attList.getNodeName());
-	// if ( e != null )
-	// {
-	// // Element has been added. Add the attributes
-	// //System.out.println(" processAttlist - adding Attlist:" +
-	// attList.getNodeName());
-	// createAttributes(e, attList);
-	// }
-	// else
-	// {
-	// //System.out.println("!!!!!!!!! element is null ");
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void finishExternalEntityGen(DTDExternalEntity extEntity,
-	// EntityDecl entityDecl) {
-	//
-	// updateSystemID(extEntity, entityDecl);
-	// extEntity.setPublicID(entityDecl.getPublicId());
-	//
-	//
-	// String notationName = entityDecl.getNotationName();
-	// if (notationName != null)
-	// {
-	// DTDNotation dtdNotation = createOrFindNotation(extEntity,
-	// notationName,true);
-	// extEntity.setNotation(dtdNotation);
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected DTDNotation createOrFindNotationGen(DTDExternalEntity
-	// extEntity, String name, boolean create) {
-	//
-	// DTDNotation aNotation =
-	// extEntity.getDTDEntity().getDTDFile().findNotation(name);
-	// if (aNotation != null)
-	// {
-	// return aNotation;
-	// }
-	//
-	//
-	// //
-	// // Create a notation for the reference
-	// //
-	// if (create)
-	// {
-	// aNotation = getFactory().createDTDNotation();
-	// dtdFile.getDTDObject().add(aNotation);
-	// aNotation.setName(name);
-	// }
-	// return aNotation;
-	// }
-	// /**
-	// * The SystemID attribute is set to whatever the user enters
-	// * e.g. com/ibm/b2b/xmimodels/xxx.dtd.xmi
-	// *
-	// * In the unparse() method, parse out the DTD file name from
-	// * the classpath name.
-	// * e.g. returns xxx.dtd
-	// */
-	// protected void updateSystemIDGen(DTDExternalEntity extEntity,
-	// EntityDecl entityDecl) {
-	//
-	// String systemId = entityDecl.getSystemId();
-	// String publicId = entityDecl.getPublicId();
-	// if (systemId != null)
-	// {
-	// IdResolver idResolver = new IdResolverImpl(dtd.getName());
-	// String uri = idResolver.resolveId(publicId, systemId);
-	// ExternalDTDModel ed = dtdUtil.getExternalDTDModel(resources, uri);
-	// if (ed != null)
-	// {
-	// DTDFile referenceDtdFile = ed.getExternalDTDFile();
-	// extEntity.setEntityReferencedFromAnotherFile(referenceDtdFile);
-	// extEntity.setSystemID(systemId);
-	// }
-	// else
-	// {
-	// if (entityDecl.getErrorMessage() == null)
-	// {
-	// ErrorMessage dtdError = new ErrorMessage();
-	// dtdError.setErrorMessage(DTDCoreMessages.getString("_ERROR_INCL_FILE_LOAD_FAILURE")
-	// + " '" + systemId + "'");
-	// addErrorMessage(dtdError, extEntity.getDTDEntity());
-	// }
-	//        
-	// if (systemId != null)
-	// {
-	// extEntity.setSystemID(systemId);
-	// }
-	// else
-	// {
-	// extEntity.setSystemID("");
-	// }
-	// }
-	// } // end of if ()
-	// else
-	// {
-	// // set the system id to be ""
-	// extEntity.setSystemID("");
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected DTDEntity createDTDEntityGen(EntityDecl entity) {
-	//
-	// // create and do what we can to fill in some basic things
-	// DTDEntity dtdEntity = getFactory().createDTDEntity();
-	// dtdFile.getDTDObject().add(dtdEntity);
-	//
-	//
-	// dtdEntity.setName(entity.getNodeName());
-	// dtdEntity.setParameterEntity(entity.isParameter());
-	// if (entity.getComment()!=null)
-	// {
-	// dtdEntity.setComment(entity.getComment());
-	// }
-	// if (entity.getErrorMessage()!=null)
-	// {
-	// addErrorMessage(entity.getErrorMessage(), dtdEntity);
-	// }
-	//
-	//
-	// return dtdEntity;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void finishElementDeclGen(DTDElement dtdElement, ElementDecl
-	// ed) {
-	//
-	// dtdElement.setName(ed.getNodeName());
-	//
-	//
-	// CMNode cmNode = ed.getContentModelNode();
-	//
-	//
-	// if (ed.getComment()!=null)
-	// {
-	// dtdElement.setComment(ed.getComment());
-	// }
-	// if (ed.getErrorMessage()!=null)
-	// {
-	// addErrorMessage(ed.getErrorMessage(), dtdElement);
-	// }
-	//
-	//
-	// if (cmNode instanceof CMBasicNode)
-	// {
-	// CMBasicNode bn = (CMBasicNode)cmNode;
-	// switch (bn.getType())
-	// {
-	// case CMNodeType.EMPTY :
-	// DTDEmptyContent emptyContent = getFactory().createDTDEmptyContent();
-	// dtdElement.setContent(emptyContent);
-	// break;
-	//
-	//
-	// case CMNodeType.ANY :
-	// DTDAnyContent anyContent = getFactory().createDTDAnyContent();
-	// dtdElement.setContent(anyContent);
-	// break;
-	//
-	//
-	// case CMNodeType.PCDATA:
-	// DTDPCDataContent pcData = getFactory().createDTDPCDataContent();
-	// dtdElement.setContent(pcData);
-	// }
-	//
-	//
-	// }
-	// else if (cmNode instanceof CMReferenceNode)
-	// {
-	// CMReferenceNode rn = (CMReferenceNode) cmNode;
-	// if (rn.getType() == CMNodeType.ENTITY_REFERENCE)
-	// {
-	// String entityName = rn.getName().trim();
-	//
-	//
-	// DTDEntity anEntity = (DTDEntity) dtdUtil.getPEPool().get(entityName);
-	// if (anEntity!=null)
-	// {
-	// //
-	// // Create an DTDEntityReference and set its referenced element
-	// //
-	// DTDEntityReferenceContent enRef =
-	// getFactory().createDTDEntityReferenceContent();
-	// enRef.setElementReferencedEntity(anEntity);
-	//
-	// DTDOccurrenceType occurrenceType =
-	// DTDOccurrenceType.get(computeMofOccurrence(rn));
-	// enRef.setOccurrence(occurrenceType);
-	//
-	// dtdElement.setContent(enRef);
-	// }
-	// else
-	// { // create default content
-	// DTDEmptyContent emptyContent = getFactory().createDTDEmptyContent();
-	// dtdElement.setContent(emptyContent);
-	// }
-	// }
-	// else
-	// {
-	// //
-	// // Find the real element for this element references
-	// // If the real element does not yet exist, create it
-	// //
-	// DTDElement anElement = createOrFindElement(rn.getName(), dtdElement);
-	//
-	//
-	// //
-	// // Create an DTDElementReference and set its referenced element
-	// //
-	// DTDElementReferenceContent elemRef =
-	// getFactory().createDTDElementReferenceContent();
-	// elemRef.setReferencedElement(anElement);
-	//
-	// DTDOccurrenceType occurrenceType =
-	// DTDOccurrenceType.get(computeMofOccurrence(rn));
-	// elemRef.setOccurrence(occurrenceType);
-	//
-	// // setContent to DTDElementReference
-	// dtdElement.setContent(elemRef);
-	//
-	//
-	// }
-	// }
-	// else if (cmNode instanceof CMGroupNode)
-	// {
-	// CMGroupNode grpNode = (CMGroupNode)cmNode;
-	// DTDGroupContent groupContent = getFactory().createDTDGroupContent();
-	// DTDGroupKind groupKind =
-	// DTDGroupKind.get(computeMofGroupKind(grpNode.getGroupKind()));
-	// groupContent.setGroupKind(groupKind);
-	// DTDOccurrenceType occurrenceType =
-	// DTDOccurrenceType.get(computeMofOccurrence(grpNode));
-	// groupContent.setOccurrence(occurrenceType);
-	//
-	// // just use the locator for the element as the closest guess
-	// processGroupContent(groupContent, grpNode);
-	// dtdElement.setContent(groupContent);
-	// }
-	// else if (cmNode == null)
-	// {
-	// // bad thing happened here, just create a pcdata
-	// DTDEmptyContent emptyContent = getFactory().createDTDEmptyContent();
-	// dtdElement.setContent(emptyContent);
-	// }
-	// }
-	// /**
-	// * Add a new group to the current group
-	// * @param parent - the parent node for this group element
-	// * @param op1Node - the group
-	// * e.g. (a,b)
-	// * @param op2Node - set only if called by processCM1op
-	// * e.g. (a,b)+
-	// */
-	// protected void processGroupContentGen(DTDGroupContent parent,
-	// CMGroupNode grpNode) {
-	//
-	// Enumeration children = grpNode.getChildren().elements();
-	// DTDFactory factory = getFactory();
-	// while (children.hasMoreElements())
-	// {
-	// CMNode cnode = (CMNode) children.nextElement();
-	//
-	//
-	// if (cnode instanceof CMGroupNode)
-	// {
-	// CMGroupNode gNode = (CMGroupNode)cnode;
-	// DTDGroupContent groupContent = factory.createDTDGroupContent();
-	// DTDGroupKind groupKind =
-	// DTDGroupKind.get(computeMofGroupKind(gNode.getGroupKind()));
-	// groupContent.setGroupKind(groupKind);
-	// DTDOccurrenceType occurrenceType =
-	// DTDOccurrenceType.get(computeMofOccurrence(gNode));
-	// groupContent.setOccurrence(occurrenceType);
-	//
-	// parent.getContent().add(groupContent);
-	// processGroupContent(groupContent,gNode);
-	// }
-	// else if (cnode instanceof CMBasicNode)
-	// {
-	// CMBasicNode n = (CMBasicNode)cnode;
-	// if (n.getType() == CMNodeType.PCDATA)
-	// {
-	// // Create a DTDPCDataContent for a leaf PCData node
-	// //
-	// DTDPCDataContent pcData = factory.createDTDPCDataContent();
-	// // Add #PCDATA to the Group, i.e Mixed content model
-	// parent.getContent().add(pcData);
-	// }
-	// }
-	// else if (cnode instanceof CMReferenceNode)
-	// {
-	// CMReferenceNode rn = (CMReferenceNode)cnode;
-	// if (rn.getType()==CMNodeType.ELEMENT_REFERENCE)
-	// {
-	// // System.out.println("CM Element Ref name: " + rn.getName());
-	// //
-	// // Create an DTDElementReference and set its referenced element
-	// //
-	// DTDElementReferenceContent elemRef =
-	// factory.createDTDElementReferenceContent();
-	//
-	//
-	// //
-	// // Find the real element for this element references
-	// // If the real element does not yet exist, create it
-	// //
-	// DTDElement anElement = createOrFindElement(rn.getName(), elemRef);
-	//
-	//
-	// elemRef.setReferencedElement(anElement);
-	// DTDOccurrenceType occurrenceType =
-	// DTDOccurrenceType.get(computeMofOccurrence(rn));
-	// elemRef.setOccurrence(occurrenceType);
-	//
-	// // Add DTDElementReference to the Group
-	// parent.getContent().add(elemRef);
-	// }
-	// else // PE Reference
-	// {
-	// String entityName = rn.getName().trim();
-	//
-	//
-	// // System.out.println("CM PE Ref name: " + entityName);
-	// DTDEntity anEntity = (DTDEntity) dtdUtil.getPEPool().get(entityName);
-	// if (anEntity!=null)
-	// {
-	// //
-	// // Create an DTDEntityReference and set its referenced element
-	// //
-	// DTDEntityReferenceContent enRef =
-	// factory.createDTDEntityReferenceContent();
-	// enRef.setElementReferencedEntity(anEntity);
-	//             
-	// DTDOccurrenceType occurrenceType =
-	// DTDOccurrenceType.get(computeMofOccurrence(rn));
-	// enRef.setOccurrence(occurrenceType);
-	//
-	//
-	// // Add DTDEntityReference to the Group
-	// parent.getContent().add(enRef);
-	//
-	//
-	// }
-	// }
-	// }
-	// }
-	// }
-	// /**
-	// * Find the real element that is referenced by the current element
-	// */
-	// protected DTDElement createOrFindElementGen(String name, Object obj) {
-	//
-	// // DTDElement aElement = getDTDFile().findElement(name);
-	//
-	//
-	// DTDElement aElement = (DTDElement) dtdUtil.getElementPool().get(name);
-	//
-	//
-	// if (aElement != null)
-	// {
-	// return aElement;
-	// }
-	//
-	//
-	// String errorMsg =
-	// DTDCoreMessages.getString("_ERROR_UNDECLARED_ELEMENT_1");
-	// errorMsg += "\"" + name + "\"";
-	// errorMsg +=
-	// DTDCoreMessages.getString("_UI_ERRORPART_UNDECLARED_ELEMENT_2");
-	//
-	//
-	// ErrorMessage dtdError = new ErrorMessage();
-	//     
-	// dtdError.setErrorMessage(errorMsg);
-	// addErrorMessage(dtdError, obj);
-	// // System.out.println(errorMsg);
-	// // setDTDErrorMessage(errorMsg);
-	// getDTDFile().setParseError(true);
-	//
-	//
-	// //
-	// // Create an empty element for the reference to make it valid
-	// //
-	//
-	//
-	// DTDFactory factory = getFactory();
-	// DTDElement dtdelement = factory.createDTDElement();
-	// dtdelement.setName(name);
-	//
-	//
-	// DTDEmptyContent emptyContent = factory.createDTDEmptyContent();
-	// dtdelement.setContent(emptyContent);
-	//
-	//
-	// getDTDFile().getDTDObject().add(dtdelement);
-	// dtdUtil.getElementPool().put(name,dtdelement);
-	// return dtdelement;
-	// }
-	// /**
-	// * Compute the MOF occurrence from the xml4j occurrence
-	// */
-	// protected int computeMofOccurrenceGen(CMRepeatableNode rnode) {
-	//
-	// int occurrence = rnode.getOccurrence();
-	// int mofoccur = DTDOccurrenceType.ONE;
-	//
-	//
-	// if (occurrence == CMNodeType.ZERO_OR_MORE)
-	// {
-	// mofoccur = DTDOccurrenceType.ZERO_OR_MORE;
-	// }
-	// else if (occurrence == CMNodeType.ONE_OR_MORE)
-	// {
-	// mofoccur = DTDOccurrenceType.ONE_OR_MORE;
-	// }
-	// else if (occurrence == CMNodeType.OPTIONAL)
-	// {
-	// mofoccur = DTDOccurrenceType.OPTIONAL;
-	// }
-	// return mofoccur;
-	// }
-	// /**
-	// * Compute the MOF model group from the xml4j model group
-	// */
-	// protected int computeMofGroupKindGen(int type) {
-	//
-	// if (type == CMNodeType.GROUP_CHOICE)
-	// {
-	// return DTDGroupKind.CHOICE;
-	// }
-	// else
-	// {
-	// return DTDGroupKind.SEQUENCE;
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void createAttributesGen(DTDElement element, Attlist attList)
-	// {
-	//
-	// if (attList.getErrorMessage()!=null)
-	// {
-	// addErrorMessage(attList.getErrorMessage(), element);
-	// }
-	//
-	//
-	// for (int i=0;i<attList.size();i++)
-	// {
-	// AttNode ad = (AttNode) attList.elementAt(i);
-	// // DTDAttributeElement dtdAtt= getDTDAttributeElement(a.getName());
-	//
-	//
-	// // only add the AttDef if it is not added yet
-	// // ignore the dup AttDef as documented in the XML 1.0 specs
-	// //if( dtdAtt==null)
-	// addAttribute(element, ad);
-	// }
-	// }
-	// /**
-	// * Create a DTDAttribute from the xml4j attribute
-	// */
-	// protected void addAttributeGen(DTDElement dtdelement, AttNode ad) {
-	//
-	// DTDAttribute dtdattr = getFactory().createDTDAttribute();
-	// dtdelement.getDTDAttribute().add(dtdattr);
-	// finishAttribute(dtdattr, ad);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void finishAttributeGen(DTDAttribute dtdattr, AttNode attdef)
-	// {
-	//
-	// boolean parseError = false;
-	//
-	//
-	// if (attdef.name.startsWith("%"))
-	// {
-	// String peName = attdef.name.trim();
-	// DTDEntity en = (DTDEntity) dtdUtil.getPEPool().get(peName);
-	// if (en!=null)
-	// {
-	// dtdattr.setAttributeNameReferencedEntity(en);
-	// }
-	// }
-	//
-	//
-	// dtdattr.setName(attdef.name);
-	//
-	//
-	// int attrType = attdef.getDeclaredType();
-	//
-	//
-	// if (attrType==AttNode.PEREFERENCE && attdef.type!=null)
-	// {
-	// String peName = attdef.type.trim();
-	// DTDEntity en = (DTDEntity) dtdUtil.getPEPool().get(peName);
-	// if (en!=null)
-	// {
-	// dtdattr.setAttributeTypeReferencedEntity(en);
-	// setAttrDTDType(dtdattr, getFactory().getDTDBasicType_CDATA()); // hack,
-	// so we can get back the default value
-	// }
-	// else //set default type
-	// setAttrDTDType(dtdattr, getFactory().getDTDBasicType_CDATA());
-	//
-	//
-	// }
-	// else
-	// {
-	// switch (attrType)
-	// {
-	// case AttNode.CDATA:
-	// setAttrDTDType(dtdattr, getFactory().getDTDBasicType_CDATA());
-	// break;
-	//
-	//
-	// case AttNode.ENTITIES:
-	// setAttrDTDType(dtdattr, getFactory().getDTDBasicType_ENTITIES());
-	// break;
-	//
-	//
-	// case AttNode.ENTITY:
-	// setAttrDTDType(dtdattr, getFactory().getDTDBasicType_ENTITY());
-	// break;
-	//
-	//
-	// case AttNode.ID:
-	// // check for duplicate ID attribute
-	// if (hasIDAttribute(dtdattr))
-	// {
-	// String errMsg = DTDCoreMessages.getString("_ERROR_DUP_ID_ATTRIBUTE_1");
-	// errMsg += attdef.name +
-	// DTDCoreMessages.getString("_UI_ERRORPART_DUP_ID_ATTRIBUTE_2");
-	// // dtdattr.getDTDElement().getIElement().setDTDErrorMessage(errMsg);
-	// // dtdattr.getDTDElement().getDTDFile().setParseError(true);
-	// parseError = true;
-	// }
-	// setAttrDTDType(dtdattr, getFactory().getDTDBasicType_ID());
-	// break;
-	//
-	//
-	// case AttNode.IDREF:
-	// setAttrDTDType(dtdattr, getFactory().getDTDBasicType_IDREF());
-	// break;
-	//
-	//
-	// case AttNode.IDREFS:
-	// setAttrDTDType(dtdattr, getFactory().getDTDBasicType_IDREFS());
-	// break;
-	//
-	//
-	// case AttNode.ENUMERATION:
-	// setAttrDTDType(dtdattr, createDTDEnumeration(dtdattr, attdef,
-	// DTDEnumGroupKind.NAME_TOKEN_GROUP));
-	// break;
-	//
-	//
-	// case AttNode.NOTATION:
-	// setAttrDTDType(dtdattr, createDTDEnumeration(dtdattr, attdef,
-	// DTDEnumGroupKind.NOTATION_GROUP));
-	// break;
-	//
-	//
-	// case AttNode.NMTOKEN:
-	// setAttrDTDType(dtdattr, getFactory().getDTDBasicType_NMTOKEN());
-	// break;
-	//
-	//
-	// case AttNode.NMTOKENS:
-	// setAttrDTDType(dtdattr, getFactory().getDTDBasicType_NMTOKENS());
-	// break;
-	//
-	//
-	// default:
-	// // System.out.println("DTDATTR '" +attdef.name + "'Unknown type..." +
-	// attrType);
-	// }
-	// }
-	//
-	//
-	// int attrDefault = attdef.getDefaultType();
-	// int defaultKind = DTDDefaultKind.IMPLIED;
-	// switch (attrDefault)
-	// {
-	// case AttNode.FIXED:
-	// defaultKind = DTDDefaultKind.FIXED;
-	// break;
-	//
-	//
-	// case AttNode.IMPLIED:
-	// defaultKind = DTDDefaultKind.IMPLIED;
-	// break;
-	//
-	//
-	// case AttNode.REQUIRED:
-	// defaultKind = DTDDefaultKind.REQUIRED;
-	// break;
-	//
-	//
-	// case AttNode.NOFIXED:
-	// defaultKind = DTDDefaultKind.NOFIXED;
-	// break;
-	//
-	//
-	// default:
-	// // System.out.println("DTDATTR '" +attdef.name + "' Unknown default
-	// type... " + attrDefault);
-	// }
-	//
-	// DTDDefaultKind defaultKindObj = DTDDefaultKind.get(defaultKind);
-	// dtdattr.setDefaultKind(defaultKindObj);
-	//
-	// if (parseError)
-	// {
-	// return;
-	// }
-	//
-	//
-	// String defaultValue = attdef.defaultValue;
-	// if (defaultValue != null)
-	// {
-	// if (attrType == AttNode.ENUMERATION || attrType == AttNode.NOTATION)
-	// {
-	// if (! isDefaultEnumValueValid(attdef,defaultValue))
-	// {
-	// String typeString =
-	// (attrType==AttNode.ENUMERATION?"enumeration":"notation");
-	// String errMsg =
-	// DTDCoreMessages.getString("_ERROR_INVALID_DEFAULT_ATTR_VALUE_1");
-	// errMsg += typeString +
-	// DTDCoreMessages.getString("_UI_ERRORPART_INVALID_DEFAULT_ATTR_VALUE_2");
-	// errMsg += attdef.name + "'";
-	//
-	//
-	// // dtdattr.getDTDElement().getIElement().setDTDErrorMessage(errMsg);
-	// // dtdattr.getDTDElement().getDTDFile().setParseError(true);
-	// return;
-	// }
-	// }
-	// dtdattr.setDefaultValueString(defaultValue);
-	// }
-	// // System.out.println("DTDAttr - toMof getDefaultValueString " +
-	// getDefaultValueString());
-	// // System.out.println("DTDAttr - toMof getDefaultValue: " +
-	// getDefaultValue());
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected boolean hasIDAttributeGen(DTDAttribute dtdattr) {
-	//
-	// boolean hasID = false;
-	//
-	//
-	// DTDElement element = dtdattr.getDTDElement();
-	// EList attrs = element.getDTDAttribute();
-	//
-	//
-	// Iterator i = attrs.iterator();
-	// while (i.hasNext())
-	// {
-	// DTDAttribute attr = (DTDAttribute) i.next();
-	// DTDType dType = attr.getDTDType();
-	// if (dType instanceof DTDBasicType)
-	// {
-	// if ( ((DTDBasicType)dType).getKind().getValue() == DTDBasicTypeKind.ID)
-	// {
-	// hasID = true;
-	// break;
-	// }
-	// }
-	// }
-	// return hasID;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected DTDEnumerationType createDTDEnumerationGen(DTDAttribute
-	// dtdattr, String[] enumValues, int enumKind) {
-	//
-	// DTDEnumerationType enum = getFactory().createDTDEnumerationType();
-	// // This is gross, but this is what was done before.
-	// DTDAttributeImpl dtdattrimpl = (DTDAttributeImpl) dtdattr;
-	// // enum.setID("Enum_" +
-	// ((DTDElement)dtdattrimpl.getMOFDomain()).getName() + "_" +
-	// dtdattr.getName());
-	// DTDEnumGroupKind groupKind = DTDEnumGroupKind.get(enumKind);
-	// enum.setKind(groupKind);
-	// // Enumeration values
-	// if (enumValues!=null)
-	// {
-	// for(int i=0;i<enumValues.length;i++)
-	// {
-	// EEnumLiteral enumLiteral = createEEnumLiteral();
-	// // enumVal.setXMIDocument(dtdattr.getXMIDocument());
-	// enumLiteral.refSetLiteral(enumValues[i]);
-	// // enumLiteral.setNumber(i);
-	// enum.getEnumLiterals().add(enumLiteral);
-	// }
-	// }
-	// dtdattr.getDTDElement().getDTDFile().getDTDEnumerationType().add(enum);
-	// return enum;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected EEnumLiteral createEEnumLiteralGen() {
-	//
-	// EcorePackage ePackage =
-	// (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
-	// return ((EcoreFactory)ePackage.getFactory()).createEEnumLiteral();
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected DTDEnumerationType createDTDEnumerationGen(DTDAttribute
-	// dtdattr, AttNode attdef, int enumKind) {
-	//
-	// DTDEnumerationType enum = getFactory().createDTDEnumerationType();
-	// // This is gross, but this is what was done before.
-	// DTDAttributeImpl dtdattrimpl = (DTDAttributeImpl) dtdattr;
-	// // enum.setID("Enum_" +
-	// ((DTDElement)dtdattrimpl.getMOFDomain()).getName() + "_" +
-	// dtdattr.getName());
-	// DTDEnumGroupKind groupKind = DTDEnumGroupKind.get(enumKind);
-	// enum.setKind(groupKind);
-	// dtdattr.getDTDElement().getDTDFile().getDTDEnumerationType().add(enum);
-	//
-	//
-	// // Enumeration values
-	// Enumeration tokenIter = attdef.elements();
-	// if (tokenIter != null) {
-	// int i=0;
-	// while (tokenIter.hasMoreElements())
-	// {
-	// String val = (String)tokenIter.nextElement();
-	// EEnumLiteral enumLiteral = createEEnumLiteral();
-	// // enumLiteral.setXMIDocument(dtdattr.getXMIDocument());
-	//        
-	//
-	// enumLiteral.refSetLiteral(val);
-	// // enumLiteral.setNumber(i++);
-	// enum.getEnumLiterals().add(enumLiteral);
-	// }
-	// }
-	//
-	//
-	// return enum;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected boolean isDefaultEnumValueValidGen(AttNode attdef, String
-	// defaultValue) {
-	//
-	// boolean valid = false;
-	// boolean containsPercent = false;
-	//
-	//
-	// // Enumeration values
-	// Enumeration enumValues = attdef.elements();
-	// while (enumValues.hasMoreElements())
-	// {
-	// String val = (String)enumValues.nextElement();
-	// if (val.equals(defaultValue))
-	// {
-	// valid = true;
-	// break;
-	// }
-	// if (val.indexOf('%') >= 0)
-	// {
-	// containsPercent = true;
-	// }
-	// }
-	// return valid || containsPercent;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void setAttrDTDTypeGen(DTDAttribute dtdattr, DTDType type) {
-	//
-	// dtdattr.setDTDType(type);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void addErrorMessageGen(ErrorMessage errMsg, Object obj) {
-	//
-	// errMsg.setObject(obj);
-	// dtdUtil.addErrorMessage(errMsg);
-	// }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDObjectFinder.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDObjectFinder.java
deleted file mode 100644
index f7b36b8..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDObjectFinder.java
+++ /dev/null
@@ -1,173 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDSourceOffset;
-
-public class DTDObjectFinder extends DTDVisitor {
-	public class SourceOffset {
-		// Convenience class to find containment of object
-		private int start, end;
-
-		public SourceOffset(int start, int end) {
-			this.start = start;
-			this.end = end;
-		}
-
-		public boolean contains(SourceOffset other) {
-			if (this.start <= other.start && other.start <= this.end) {
-				return true;
-			} // end of if ()
-			return false;
-		}
-
-	}
-
-	SourceOffset searchLocation;
-
-	private SourceOffset offsetObjectFor(DTDSourceOffset s) {
-		return new SourceOffset(s.getStartOffset(), s.getEndOffset());
-	}
-
-	private void checkContainment(DTDObject o) {
-		if (offsetObjectFor((DTDSourceOffset) o).contains(searchLocation)) {
-			closestObject = o;
-		} // end of if ()
-	}
-
-	public DTDObjectFinder(int startOffset, int endOffset) {
-		searchLocation = new SourceOffset(startOffset, endOffset);
-	}
-
-	public void visitDTDNotation(DTDNotation notation) {
-		checkContainment(notation);
-		super.visitDTDNotation(notation);
-	}
-
-	public void visitDTDEntity(DTDEntity entity) {
-		checkContainment(entity);
-		super.visitDTDEntity(entity);
-	}
-
-	public void visitDTDElement(DTDElement element) {
-		checkContainment(element);
-		super.visitDTDElement(element);
-	}
-
-	public void visitDTDAttribute(DTDAttribute attribute) {
-		checkContainment(attribute);
-		super.visitDTDAttribute(attribute);
-	}
-
-	public void visitDTDParameterEntityReference(DTDParameterEntityReference parmEntity) {
-		checkContainment(parmEntity);
-		super.visitDTDParameterEntityReference(parmEntity);
-	}
-
-	public void visitDTDElementContent(DTDElementContent content) {
-		checkContainment(content);
-		super.visitDTDElementContent(content);
-	}
-
-	private DTDObject closestObject = null;
-
-	public DTDObject getClosestObject() {
-		return closestObject;
-	}
-
-	/**
-	 * @generated
-	 */
-	protected SourceOffset offsetObjectForGen(DTDSourceOffset s) {
-
-		return new SourceOffset(s.getStartOffset(), s.getEndOffset());
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void checkContainmentGen(DTDObject o) {
-
-		if (offsetObjectFor((DTDSourceOffset) o).contains(searchLocation)) {
-			closestObject = o;
-		} // end of if ()
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDNotationGen(DTDNotation notation) {
-
-		checkContainment(notation);
-		super.visitDTDNotation(notation);
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDEntityGen(DTDEntity entity) {
-
-		checkContainment(entity);
-		super.visitDTDEntity(entity);
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDElementGen(DTDElement element) {
-
-		checkContainment(element);
-		super.visitDTDElement(element);
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDAttributeGen(DTDAttribute attribute) {
-
-		checkContainment(attribute);
-		super.visitDTDAttribute(attribute);
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDParameterEntityReferenceGen(DTDParameterEntityReference parmEntity) {
-
-		checkContainment(parmEntity);
-		super.visitDTDParameterEntityReference(parmEntity);
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDElementContentGen(DTDElementContent content) {
-
-		checkContainment(content);
-		super.visitDTDElementContent(content);
-	}
-
-	/**
-	 * @generated
-	 */
-	protected DTDObject getClosestObjectGen() {
-
-		return closestObject;
-	}
-}// DTDObjectFinder
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPathnameUtil.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPathnameUtil.java
deleted file mode 100644
index 05abd2d..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPathnameUtil.java
+++ /dev/null
@@ -1,352 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-
-
-public class DTDPathnameUtil {
-	static public String makePath(String parentPath, String type, String name, int cnt) {
-		String pn = null;
-		name = encode(name);
-		if ((name == null) && (cnt <= 0)) {
-			pn = type;
-		}
-		else if (cnt <= 0) {
-			pn = type + ":" + ((name == null) ? "" : name); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		else {
-			pn = type + ":" + ((name == null) ? "" : name) + ":" + cnt; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		}
-
-		if (parentPath != null) {
-			return parentPath + "." + pn; //$NON-NLS-1$
-		}
-		else {
-			return pn;
-		}
-	}
-
-	static public Object[] parsePathComponent(String path) {
-		/*
-		 * This routine parse the first component of the path and returns the
-		 * result in an arrray of Strings. result[0] = type (String) result[1] =
-		 * name (String) result[2] = count (Integer) result[3] = the rest of
-		 * the path (String)
-		 * 
-		 * E.g. PathComponent result[0] result[1] result[2] result[3]
-		 * ------------------------------------------------------------- type
-		 * type <null> <null> <null> type.rest type <null> <null> rest
-		 * type:name type name <null> <null> type:name.rest type name <null>
-		 * rest type::n type <null> n <null> type::n.rest type <null> n rest
-		 * type:name:n type name n <null> type:name:n.rest type name n rest
-		 */
-
-		Object[] result = new Object[4];
-		if (path == null)
-			return result;
-
-		int i = path.indexOf('.');
-		int length = path.length();
-
-		if (i < 0) {
-			i = length;
-		}
-
-		String type = null;
-		String name = null;
-		Integer n = null;
-		String rest = null;
-
-		// get the type
-		int j = path.indexOf(':');
-		if (j > i)
-			j = -1;
-		if (j < 0) {
-			type = path.substring(0, i);
-		}
-		else {
-			type = path.substring(0, j);
-
-			// get the name
-			int k = path.indexOf(':', j + 1);
-			if (k > i)
-				k = -1;
-			if (k < 0) {
-				name = path.substring(j + 1, i);
-			}
-			else {
-				name = path.substring(j + 1, k);
-
-				// get the count
-				try {
-					n = new Integer(path.substring(k + 1, i));
-				}
-				catch (Exception exc) {
-				}
-				if ((n != null) && (n.intValue() < 0)) {
-					n = null;
-				}
-			}
-		}
-
-		if ((name != null) && (name.length() == 0)) {
-			name = null;
-		}
-
-		if (i < length) {
-			rest = path.substring(i + 1);
-		}
-
-		result[0] = type;
-		result[1] = decode(name);
-		result[2] = n;
-		result[3] = rest;
-		return result;
-	}
-
-	static private String encode(String s) {
-		if (s == null)
-			return null;
-		StringBuffer o = new StringBuffer(s.length());
-		int len = s.length();
-		for (int i = 0; i < len; i++) {
-			char c = s.charAt(i);
-			if (Character.isLetterOrDigit(c) || (c == '-')) {
-				o.append(c);
-			}
-			else { // if ((c == '.') || (c == ':') || (c == '_') || ...)
-				// convert the character to a 4 digit hex code prefixed by "_"
-				String hex = Integer.toHexString(c);
-				int l = hex.length();
-				if (l == 1) {
-					o.append("_000"); //$NON-NLS-1$
-					o.append(hex);
-				}
-				else if (l == 2) {
-					o.append("_00"); //$NON-NLS-1$
-					o.append(hex);
-				}
-				else if (l == 3) {
-					o.append("_0"); //$NON-NLS-1$
-					o.append(hex);
-				}
-				else {
-					o.append('_');
-					o.append(hex);
-				}
-			}
-		} // for
-		return o.toString();
-	}
-
-	static private String decode(String s) {
-		if (s == null)
-			return null;
-		StringBuffer o = new StringBuffer(s.length());
-		int len = s.length();
-		for (int i = 0; i < len; i++) {
-			char c = s.charAt(i);
-			if (c != '_') {
-				o.append(c);
-			}
-			else { // next 4 characters are the hex code
-				String hex;
-				if (len > i + 4) {
-					hex = s.substring(i + 1, i + 5);
-					i += 4;
-				}
-				else {
-					hex = s.substring(i + 1);
-					i = len - 1;
-				}
-				o.append((char) Integer.parseInt(hex, 16));
-			}
-		} // for
-		return o.toString();
-	}
-
-	/**
-	 * @generated
-	 */
-	protected static String makePathGen(String parentPath, String type, String name, int cnt) {
-
-		String pn = null;
-		name = encode(name);
-		if ((name == null) && (cnt <= 0)) {
-			pn = type;
-		}
-		else if (cnt <= 0) {
-			pn = type + ":" + ((name == null) ? "" : name); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		else {
-			pn = type + ":" + ((name == null) ? "" : name) + ":" + cnt; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		}
-
-		if (parentPath != null) {
-			return parentPath + "." + pn; //$NON-NLS-1$
-		}
-		else {
-			return pn;
-		}
-	}
-
-	/**
-	 * @generated
-	 */
-	protected static Object[] parsePathComponentGen(String path) {
-
-		/*
-		 * This routine parse the first component of the path and returns the
-		 * result in an arrray of Strings. result[0] = type (String) result[1] =
-		 * name (String) result[2] = count (Integer) result[3] = the rest of
-		 * the path (String)
-		 * 
-		 * E.g. PathComponent result[0] result[1] result[2] result[3]
-		 * ------------------------------------------------------------- type
-		 * type <null> <null> <null> type.rest type <null> <null> rest
-		 * type:name type name <null> <null> type:name.rest type name <null>
-		 * rest type::n type <null> n <null> type::n.rest type <null> n rest
-		 * type:name:n type name n <null> type:name:n.rest type name n rest
-		 */
-
-		Object[] result = new Object[4];
-		if (path == null)
-			return result;
-
-		int i = path.indexOf('.');
-		int length = path.length();
-
-		if (i < 0) {
-			i = length;
-		}
-
-		String type = null;
-		String name = null;
-		Integer n = null;
-		String rest = null;
-
-		// get the type
-		int j = path.indexOf(':');
-		if (j > i)
-			j = -1;
-		if (j < 0) {
-			type = path.substring(0, i);
-		}
-		else {
-			type = path.substring(0, j);
-
-			// get the name
-			int k = path.indexOf(':', j + 1);
-			if (k > i)
-				k = -1;
-			if (k < 0) {
-				name = path.substring(j + 1, i);
-			}
-			else {
-				name = path.substring(j + 1, k);
-
-				// get the count
-				try {
-					n = new Integer(path.substring(k + 1, i));
-				}
-				catch (Exception exc) {
-				}
-				if ((n != null) && (n.intValue() < 0)) {
-					n = null;
-				}
-			}
-		}
-
-		if ((name != null) && (name.length() == 0)) {
-			name = null;
-		}
-
-		if (i < length) {
-			rest = path.substring(i + 1);
-		}
-
-		result[0] = type;
-		result[1] = decode(name);
-		result[2] = n;
-		result[3] = rest;
-		return result;
-	}
-
-	/**
-	 * @generated
-	 */
-	protected static String encodeGen(String s) {
-
-		if (s == null)
-			return null;
-		StringBuffer o = new StringBuffer(s.length());
-		int len = s.length();
-		for (int i = 0; i < len; i++) {
-			char c = s.charAt(i);
-			if (Character.isLetterOrDigit(c) || (c == '-')) {
-				o.append(c);
-			}
-			else { // if ((c == '.') || (c == ':') || (c == '_') || ...)
-				// convert the character to a 4 digit hex code prefixed by "_"
-				String hex = Integer.toHexString(c);
-				int l = hex.length();
-				if (l == 1) {
-					o.append("_000"); //$NON-NLS-1$
-					o.append(hex);
-				}
-				else if (l == 2) {
-					o.append("_00"); //$NON-NLS-1$
-					o.append(hex);
-				}
-				else if (l == 3) {
-					o.append("_0"); //$NON-NLS-1$
-					o.append(hex);
-				}
-				else {
-					o.append('_');
-					o.append(hex);
-				}
-			}
-		} // for
-		return o.toString();
-	}
-
-	/**
-	 * @generated
-	 */
-	protected static String decodeGen(String s) {
-
-		if (s == null)
-			return null;
-		StringBuffer o = new StringBuffer(s.length());
-		int len = s.length();
-		for (int i = 0; i < len; i++) {
-			char c = s.charAt(i);
-			if (c != '_') {
-				o.append(c);
-			}
-			else { // next 4 characters are the hex code
-				String hex;
-				if (len > i + 4) {
-					hex = s.substring(i + 1, i + 5);
-					i += 4;
-				}
-				else {
-					hex = s.substring(i + 1);
-					i = len - 1;
-				}
-				o.append((char) Integer.parseInt(hex, 16));
-			}
-		} // for
-		return o.toString();
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPrinter.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPrinter.java
deleted file mode 100644
index 16f4fa6..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPrinter.java
+++ /dev/null
@@ -1,525 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDSourceOffset;
-
-
-public class DTDPrinter extends DTDVisitor {
-	StringBuffer sb = new StringBuffer();
-	boolean updateOffset = true;
-
-	public DTDPrinter(boolean updateOffset) {
-		this.updateOffset = updateOffset;
-	}
-
-	public StringBuffer getBuffer() {
-		return sb;
-	}
-
-	public void visitDTDFile(DTDFile file) {
-		super.visitDTDFile(file);
-	}
-
-	public void visitDTDNotation(DTDNotation notation) {
-		generateComment(notation);
-		updateStartOffset(notation, sb.length());
-		sb.append("<!NOTATION "); //$NON-NLS-1$
-		sb.append(notation.getName()).append(" "); //$NON-NLS-1$
-
-		String publicID = notation.getPublicID();
-		String systemID = notation.getSystemID();
-		if (publicID == null || publicID.equals("")) { //$NON-NLS-1$
-			sb.append("SYSTEM "); //$NON-NLS-1$
-		}
-		else {
-			sb.append("PUBLIC \"").append(publicID).append("\" "); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		if (systemID == null) {
-			sb.append("\"\""); //$NON-NLS-1$
-		}
-		else {
-			sb.append("\"").append(systemID).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		endTag();
-		updateEndOffset(notation, sb.length() - 1); // -1 for the newline char
-		super.visitDTDNotation(notation);
-	}
-
-	public void visitDTDEntity(DTDEntity entity) {
-		generateComment(entity);
-		updateStartOffset(entity, sb.length());
-		sb.append("<!ENTITY "); //$NON-NLS-1$
-
-		if (entity.isParameterEntity())
-			sb.append("% "); //$NON-NLS-1$
-
-		sb.append(entity.getName()).append(" "); //$NON-NLS-1$
-		sb.append(entity.getContent().unparse());
-
-		endTag();
-		updateEndOffset(entity, sb.length() - 1); // -1 for the newline char
-		super.visitDTDEntity(entity);
-	}
-
-	public void visitDTDElement(DTDElement element) {
-		generateComment(element);
-		updateStartOffset(element, sb.length());
-		sb.append("<!ELEMENT " + element.getName()); //$NON-NLS-1$
-		DTDElementContent content = element.getContent();
-		if (content instanceof DTDPCDataContent || content instanceof DTDElementReferenceContent) {
-			sb.append(" ("); //$NON-NLS-1$
-			super.visitDTDElement(element);
-			sb.append(")"); //$NON-NLS-1$
-		} // end of if ()
-		else {
-			sb.append(" "); //$NON-NLS-1$
-			super.visitDTDElement(element);
-		} // end of else
-		endTag();
-		updateEndOffset(element, sb.length() - 1); // -1 for the newline char
-		visitAttributes(element);
-	}
-
-	public void visitDTDParameterEntityReference(DTDParameterEntityReference parmEntity) {
-		generateComment(parmEntity);
-		updateStartOffset(parmEntity, sb.length());
-		sb.append("%" + parmEntity.getName() + ";\n"); //$NON-NLS-1$ //$NON-NLS-2$
-		updateEndOffset(parmEntity, sb.length() - 1); // -1 for the newline
-														// char
-	}
-
-	public void visitDTDElementContent(DTDElementContent content) {
-		updateStartOffset(content, sb.length());
-		String trailingChars = ""; //$NON-NLS-1$
-		if (content instanceof DTDRepeatableContent) {
-			DTDRepeatableContent repeatContent = (DTDRepeatableContent) content;
-			DTDOccurrenceType occurrenceType = repeatContent.getOccurrence();
-			// Integer occurrence = repeatContent.getOccurrence();
-			if (occurrenceType != null) {
-				int occurType = occurrenceType.getValue();
-				if (occurType != DTDOccurrenceType.ONE) {
-					if (repeatContent instanceof DTDEntityReferenceContent) {
-						sb.append("("); //$NON-NLS-1$
-						trailingChars = ")"; //$NON-NLS-1$
-					}
-					trailingChars += (char) occurType;
-				}
-			} // end of if ()
-		} // end of if ()
-
-		if (content instanceof DTDGroupContent) {
-			super.visitDTDElementContent(content);
-		} // end of if ()
-		else if (content instanceof DTDElementReferenceContent || content instanceof DTDEntityReferenceContent) {
-			sb.append(((DTDRepeatableContent) content).unparseRepeatableContent());
-		} // end of if ()
-		else {
-			// handle DTDPCDataContent, DTDAnyContent and DTDEmptyContent here
-			sb.append(content.getContentName());
-		} // end of else
-		sb.append(trailingChars);
-		updateEndOffset(content, sb.length());
-	}
-
-	public void visitDTDGroupContent(DTDGroupContent group) {
-		sb.append("("); //$NON-NLS-1$
-		DTDGroupKind kind = group.getGroupKind();
-		// MOF2EMF Port
-		// Integer groupKind = group.getGroupKind();
-		if (kind == null) {
-			group.setGroupKind(DTDGroupKind.get(DTDGroupKind.SEQUENCE));
-		} // end of if ()
-
-		String con = group.getGroupKind().getValue() == DTDGroupKind.CHOICE ? " | " : ", "; //$NON-NLS-1$ //$NON-NLS-2$
-
-		// Loop thru the children of the current group
-		Collection content = group.getContent();
-		if (content != null) {
-			boolean firstContent = true;
-			for (Iterator i = content.iterator(); i.hasNext();) {
-				if (!firstContent) {
-					sb.append(con);
-				} // end of if ()
-				else {
-					firstContent = false;
-				} // end of else
-				visitDTDElementContent((DTDElementContent) i.next());
-			}
-		}
-
-		sb.append(")"); //$NON-NLS-1$
-	}
-
-	private void visitAttributes(DTDElement elem) {
-		Collection attrs = elem.getDTDAttribute();
-		Iterator i = attrs.iterator();
-		if (attrs != null && i.hasNext()) {
-			DTDAttribute attrib = (DTDAttribute) i.next();
-			String comment = attrib.getComment();
-			if (comment != null && comment.length() > 0)
-				sb.append("<!--\n ").append(comment).append("\n-->\n"); //$NON-NLS-1$ //$NON-NLS-2$
-			sb.append("<!ATTLIST " + elem.getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-			sb.append(" "); //$NON-NLS-1$
-			updateStartOffset(attrib, sb.length());
-			sb.append(attrib.unparse());
-			updateEndOffset(attrib, sb.length());
-			sb.append("\n"); //$NON-NLS-1$
-			for (; i.hasNext();) {
-				attrib = (DTDAttribute) i.next();
-				comment = attrib.getComment();
-				if (comment != null && comment.length() > 0) {
-					sb.append(">\n"); //$NON-NLS-1$
-					if (comment != null && comment.length() > 0)
-						sb.append("<!--\n ").append(comment).append("\n-->\n"); //$NON-NLS-1$ //$NON-NLS-2$
-					sb.append("<!ATTLIST " + elem.getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-				sb.append(" "); //$NON-NLS-1$
-				updateStartOffset(attrib, sb.length());
-				sb.append(attrib.unparse());
-				updateEndOffset(attrib, sb.length());
-				sb.append("\n"); //$NON-NLS-1$
-			}
-			sb.append(">\n"); //$NON-NLS-1$
-		}
-	}
-
-	private void endTag() {
-		sb.append(">\n"); //$NON-NLS-1$
-	}
-
-	private void updateStartOffset(DTDSourceOffset o, int offset) {
-		if (updateOffset) {
-			o.setStartOffset(offset);
-		} // end of if ()
-	}
-
-	private void updateEndOffset(DTDSourceOffset o, int offset) {
-		if (updateOffset) {
-			o.setEndOffset(offset);
-		} // end of if ()
-	}
-
-	private void generateComment(DTDObject dtdObject) {
-		String commentString = null;
-
-		if (dtdObject instanceof DTDElement)
-			commentString = ((DTDElement) dtdObject).getComment();
-		else if (dtdObject instanceof DTDEntity)
-			commentString = ((DTDEntity) dtdObject).getComment();
-		else if (dtdObject instanceof DTDNotation)
-			commentString = ((DTDNotation) dtdObject).getComment();
-
-		if (commentString != null && commentString.length() > 0) {
-			sb.append("<!--").append(commentString).append("-->\n"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-
-
-	// /**
-	// * @generated
-	// */
-	// protected StringBuffer getBufferGen() {
-	//
-	// return sb;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void visitDTDFileGen(DTDFile file) {
-	//
-	// super.visitDTDFile(file);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void visitDTDNotationGen(DTDNotation notation) {
-	//
-	// generateComment(notation);
-	// updateStartOffset(notation, sb.length());
-	// sb.append("<!NOTATION ");
-	// sb.append(notation.getName()).append(" ");
-	//
-	//
-	// String publicID = notation.getPublicID();
-	// String systemID = notation.getSystemID();
-	// if (publicID == null || publicID.equals(""))
-	// {
-	// sb.append("SYSTEM ");
-	// }
-	// else
-	// {
-	// sb.append("PUBLIC \"").append(publicID).append("\" ");
-	// }
-	//
-	//
-	// if (systemID==null)
-	// {
-	// sb.append("\"\"");
-	// }
-	// else
-	// {
-	// sb.append("\"").append(systemID).append("\"");
-	// }
-	// endTag();
-	// updateEndOffset(notation, sb.length() - 1); // -1 for the newline char
-	// super.visitDTDNotation(notation);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void visitDTDEntityGen(DTDEntity entity) {
-	//
-	// generateComment(entity);
-	// updateStartOffset(entity, sb.length());
-	// sb.append("<!ENTITY ");
-	//
-	//
-	// if (entity.isParameterEntity())
-	// sb.append("% ");
-	//
-	//
-	// sb.append(entity.getName()).append(" ");
-	// sb.append(entity.getContent().unparse());
-	//
-	//
-	// endTag();
-	// updateEndOffset(entity, sb.length() - 1); // -1 for the newline char
-	// super.visitDTDEntity(entity);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void visitDTDElementGen(DTDElement element) {
-	//
-	// generateComment(element);
-	// updateStartOffset(element, sb.length());
-	// sb.append("<!ELEMENT " + element.getName());
-	// DTDElementContent content = element.getContent();
-	// if (content instanceof DTDPCDataContent ||
-	// content instanceof DTDElementReferenceContent)
-	// {
-	// sb.append(" (");
-	// super.visitDTDElement(element);
-	// sb.append(")");
-	// } // end of if ()
-	// else
-	// {
-	// sb.append(" ");
-	// super.visitDTDElement(element);
-	// } // end of else
-	// endTag();
-	// updateEndOffset(element, sb.length() - 1); // -1 for the newline char
-	// visitAttributes(element);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void
-	// visitDTDParameterEntityReferenceGen(DTDParameterEntityReference
-	// parmEntity) {
-	//
-	// generateComment(parmEntity);
-	// updateStartOffset(parmEntity, sb.length());
-	// sb.append("%" + parmEntity.getName() + ";\n");
-	// updateEndOffset(parmEntity, sb.length() - 1); // -1 for the newline
-	// char
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void visitDTDElementContentGen(DTDElementContent content) {
-	//
-	// updateStartOffset(content, sb.length());
-	// String trailingChars = "";
-	// if (content instanceof DTDRepeatableContent )
-	// {
-	// DTDRepeatableContent repeatContent = (DTDRepeatableContent) content;
-	// Integer occurrence = repeatContent.getOccurrence();
-	// if (occurrence != null)
-	// {
-	// int occurType = occurrence.intValue();
-	// if (occurType != DTDOccurrenceType.ONE)
-	// {
-	// if (repeatContent instanceof DTDEntityReferenceContent)
-	// {
-	// sb.append("(");
-	// trailingChars = ")";
-	// }
-	// trailingChars += (char) occurType;
-	// }
-	// } // end of if ()
-	// } // end of if ()
-	//    
-	// if (content instanceof DTDGroupContent)
-	// {
-	// super.visitDTDElementContent(content);
-	// } // end of if ()
-	// else if (content instanceof DTDElementReferenceContent ||
-	// content instanceof DTDEntityReferenceContent)
-	// {
-	// sb.append(((DTDRepeatableContent)content).unparseRepeatableContent());
-	// } // end of if ()
-	// else
-	// {
-	// // handle DTDPCDataContent, DTDAnyContent and DTDEmptyContent here
-	// sb.append(content.getContentName());
-	// } // end of else
-	// sb.append(trailingChars);
-	// updateEndOffset(content, sb.length());
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void visitDTDGroupContentGen(DTDGroupContent group) {
-	//
-	// sb.append("(");
-	//    
-	// Integer groupKind = group.getGroupKind();
-	// if (groupKind == null)
-	// {
-	// group.setGroupKind(DTDGroupKind.SEQUENCE);
-	// } // end of if ()
-	//    
-	// String con = group.getGroupKind().intValue() == DTDGroupKind.CHOICE ? "
-	// | " : ", ";
-	//
-	//
-	// // Loop thru the children of the current group
-	// Collection content = group.getContent();
-	// if (content != null)
-	// {
-	// boolean firstContent = true;
-	// for (Iterator i = content.iterator(); i.hasNext(); )
-	// {
-	// if (!firstContent)
-	// {
-	// sb.append(con);
-	// } // end of if ()
-	// else
-	// {
-	// firstContent = false;
-	// } // end of else
-	// visitDTDElementContent((DTDElementContent) i.next());
-	// }
-	// }
-	//
-	//
-	// sb.append(")");
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void visitAttributesGen(DTDElement elem) {
-	//
-	// Collection attrs = elem.getDTDAttribute();
-	// Iterator i = attrs.iterator();
-	// if (attrs != null && i.hasNext())
-	// {
-	// DTDAttribute attrib = (DTDAttribute) i.next();
-	// String comment = attrib.getComment();
-	// if (comment!=null && comment.length()>0)
-	// sb.append("<!--\n ").append(comment).append("\n-->\n");
-	// sb.append("<!ATTLIST " + elem.getName() + "\n");
-	// sb.append(" ");
-	// updateStartOffset(attrib, sb.length());
-	// sb.append(attrib.unparse());
-	// updateEndOffset(attrib, sb.length());
-	// sb.append("\n");
-	// for (; i.hasNext(); )
-	// {
-	// attrib = (DTDAttribute) i.next();
-	// comment = attrib.getComment();
-	// if (comment!=null && comment.length()>0)
-	// {
-	// sb.append(">\n");
-	// if (comment!=null && comment.length()>0)
-	// sb.append("<!--\n ").append(comment).append("\n-->\n");
-	// sb.append("<!ATTLIST " + elem.getName() + "\n");
-	// }
-	// sb.append(" ");
-	// updateStartOffset(attrib, sb.length());
-	// sb.append(attrib.unparse());
-	// updateEndOffset(attrib, sb.length());
-	// sb.append("\n");
-	// }
-	// sb.append(">\n");
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void endTagGen() {
-	//
-	// sb.append(">\n");
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void updateStartOffsetGen(DTDSourceOffset o, int offset) {
-	//
-	// if (updateOffset)
-	// {
-	// o.setStartOffset(offset);
-	// } // end of if ()
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void updateEndOffsetGen(DTDSourceOffset o, int offset) {
-	//
-	// if (updateOffset)
-	// {
-	// o.setEndOffset(offset);
-	// } // end of if ()
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void generateCommentGen(DTDObject dtdObject) {
-	//
-	// String commentString = null;
-	//
-	//
-	// if (dtdObject instanceof DTDElement)
-	// commentString = ((DTDElement)dtdObject).getComment();
-	// else if (dtdObject instanceof DTDEntity)
-	// commentString = ((DTDEntity)dtdObject).getComment();
-	// else if (dtdObject instanceof DTDNotation)
-	// commentString = ((DTDNotation)dtdObject).getComment();
-	//
-	//
-	// if ( commentString!=null && commentString.length()>0)
-	// {
-	// sb.append("<!--").append(commentString).append("-->\n");
-	// }
-	// }
-}// DTDPrinter
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceFactoryImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceFactoryImpl.java
deleted file mode 100644
index 21e2aa7..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceFactoryImpl.java
+++ /dev/null
@@ -1,79 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
-
-
-public class DTDResourceFactoryImpl extends ResourceFactoryImpl {
-	public DTDResourceFactoryImpl() {
-		super();
-	}
-
-	public Resource createResource(String filename) {
-		return new DTDResourceImpl(filename);
-	}
-
-	public Resource createResource(URI uri) {
-		return new DTDResourceImpl(uri);
-	}
-
-	public Resource createResource(ResourceSet resources, URI uri) {
-		Resource resource = new DTDResourceImpl(uri);
-		resources.getResources().add(resource);
-		return resource;
-	}
-
-	public Resource createResource(ResourceSet resources, String uri) {
-		Resource resource = new DTDResourceImpl(uri);
-		resources.getResources().add(resource);
-		return resource;
-	}
-
-	public Resource load(String uri) throws Exception {
-		Resource resource = createResource(uri);
-		resource.load(new HashMap());
-		return resource;
-	}
-
-	public Resource load(URI uri) throws Exception {
-		Resource resource = createResource(uri);
-		resource.load(new HashMap());
-		return resource;
-	}
-
-	public Resource load(ResourceSet resources, String uri) throws Exception {
-		return load(resources, uri, new HashMap());
-	}
-
-	public Resource load(ResourceSet resources, URI uri) throws Exception {
-		return load(resources, uri, new HashMap());
-	}
-
-	public Resource load(ResourceSet resources, String uri, Map options) throws Exception {
-		Resource resource = createResource(resources, uri);
-		resource.load(options);
-		return resource;
-	}
-
-	public Resource load(ResourceSet resources, URI uri, Map options) throws Exception {
-		Resource resource = createResource(resources, uri);
-		resource.load(options);
-		return resource;
-	}
-} // DTDResourceFactoryImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceImpl.java
deleted file mode 100644
index 879da44..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceImpl.java
+++ /dev/null
@@ -1,166 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-import java.io.OutputStream;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.zip.ZipOutputStream;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
-import org.eclipse.wst.dtd.core.internal.DTDCoreMessages;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-
-
-public class DTDResourceImpl extends ResourceImpl {
-
-	public DTDResourceImpl() {
-		super();
-	}
-
-	public DTDResourceImpl(String filename) {
-		super(URI.createURI(filename));
-		// System.out.println(">>>> DTDResourceImpl ctor 1");
-	}
-
-	public DTDResourceImpl(URI uri) {
-		super(uri);
-		// System.out.println(">>>> DTDResourceImpl ctor 2");
-	}
-
-	/**
-	 * Returns the resolved object for the given URI
-	 * {@link URI#fragment fragment}.
-	 * <p>
-	 * The fragment encoding will typically be that produced by
-	 * {@link #getURIFragment getURIFragment}.
-	 * </p>
-	 * 
-	 * @param uriFragment
-	 *            the fragment to resolve.
-	 * @return the resolved object for the given fragment.
-	 * @see #getURIFragment(EObject)
-	 * @see org.eclipse.emf.ecore.resource.ResourceSet#getEObject(URI, boolean)
-	 * @see org.eclipse.emf.ecore.util.EcoreUtil#resolve(EObject, org.eclipse.emf.ecore.resource.ResourceSet)
-	 * @see org.eclipse.emf.ecore.InternalEObject#eObjectForURIFragmentSegment(String)
-	 * @throws org.eclipse.emf.common.util.WrappedException
-	 *             if a problem occurs navigating the fragment.
-	 */
-	public EObject getEObject(java.lang.String uriFragment) {
-		EList contents = getContents();
-		if (contents != null) {
-			Iterator i = contents.iterator();
-			while (i.hasNext()) {
-				Object obj = i.next();
-				if (obj instanceof DTDFile) {
-					// there should only be one DTDFile in a DTD extent
-					EObject result = ((DTDFile) obj).findObject(uriFragment);
-					return result;
-				}
-			}
-		}
-		System.out.println(">>> DTDKey Error: cannot find object " + uriFragment); //$NON-NLS-1$
-		return super.getEObject(uriFragment);
-	}
-
-	/**
-	 * Returns the URI {@link URI#fragment fragment} that, when passed to
-	 * {@link #getEObject getEObject} will return the given object.
-	 * <p>
-	 * In other words, the following is <code>true</code> for any object
-	 * contained by a resource:
-	 * 
-	 * <pre>
-	 * 
-	 *    Resource resource = eObject.eResource();
-	 *    eObject == resource.getEObject(resource.getURIFragment(eObject))
-	 * 
-	 * </pre>
-	 * 
-	 * An implementation may choose to use IDs or to use structured URI
-	 * fragments, as supported by
-	 * {@link org.eclipse.emf.ecore.InternalEObject#eURIFragmentSegment eURIFragmentSegment}.
-	 * </p>
-	 * 
-	 * @param eObject
-	 *            the object to identify.
-	 * @return the URI {@link URI#fragment fragment} for the object.
-	 * @see #getEObject(String)
-	 * @see org.eclipse.emf.ecore.InternalEObject#eURIFragmentSegment(org.eclipse.emf.core.EStructuralFeature,
-	 *      EObject)
-	 */
-	public java.lang.String getURIFragment(EObject eObject) {
-		if (eObject instanceof DTDObject) {
-			return ((DTDObject) eObject).getPathname();
-		}
-		return super.getURIFragment(eObject);
-	}
-
-	private DTDUtil dtdUtil;
-
-	public DTDUtil getDTDUtil() {
-		return dtdUtil;
-	}
-
-	public void setDTDUtil(DTDUtil dtdUtil) {
-		this.dtdUtil = dtdUtil;
-	}
-
-	public void load(Map options) {
-
-		String uriString = getURI().toString();
-		try {
-			DTDUtil dtdUtil = new DTDUtil();
-			dtdUtil.parse(getResourceSet(), uriString);
-			dtdUtil.setResource(this);
-			setDTDUtil(dtdUtil);
-			getContents().add(dtdUtil.getDTDFile());
-
-			// Reset the dirty flag after the resource is loaded
-			setModified(false);
-		}
-		catch (Exception exc) {
-			exc.printStackTrace();
-		}
-	}
-
-	public void save(OutputStream os, Object options) throws Exception {
-		if (contents != null) {
-			Iterator i = contents.iterator();
-			while (i.hasNext()) {
-				Object obj = i.next();
-				if (obj instanceof DTDFile) {
-					try {
-						DTDPrinter printer = new DTDPrinter(true);
-						printer.visitDTDFile((DTDFile) obj);
-
-						String s = printer.getBuffer().toString();
-						os.write(s.getBytes());
-						// Reset the dirty flag after the resource is saved
-						setModified(false);
-					}
-					catch (Exception e) {
-					}
-					break;
-				}
-			}
-		}
-	}
-
-	public void save(ZipOutputStream zos, String entry, String metaModelName) throws Exception {
-		throw new Exception(DTDCoreMessages._EXC_OPERATION_NOT_SUPPORTED); //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDSwitch.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDSwitch.java
deleted file mode 100644
index e77b125..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDSwitch.java
+++ /dev/null
@@ -1,489 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDBasicType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEnumerationType;
-import org.eclipse.wst.dtd.core.internal.emf.DTDExternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDInternalEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPackage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-
-
-
-public class DTDSwitch {
-	/**
-	 * The cached model package <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated
-	 */
-	protected static DTDPackage modelPackage;
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public DTDSwitch() {
-		if (modelPackage == null) {
-			modelPackage = DTDPackage.eINSTANCE;
-		}
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object doSwitch(EObject theEObject) {
-		EClass theEClass = theEObject.eClass();
-		if (theEClass.eContainer() == modelPackage) {
-			switch (theEClass.getClassifierID()) {
-				case DTDPackage.DTD_GROUP_CONTENT : {
-					DTDGroupContent dtdGroupContent = (DTDGroupContent) theEObject;
-					Object result = caseDTDGroupContent(dtdGroupContent);
-					if (result == null)
-						result = caseDTDRepeatableContent(dtdGroupContent);
-					if (result == null)
-						result = caseDTDElementContent(dtdGroupContent);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_ATTRIBUTE : {
-					DTDAttribute dtdAttribute = (DTDAttribute) theEObject;
-					Object result = caseDTDAttribute(dtdAttribute);
-					if (result == null)
-						result = caseEAttribute(dtdAttribute);
-					if (result == null)
-						result = caseEStructuralFeature(dtdAttribute);
-					if (result == null)
-						result = caseETypedElement(dtdAttribute);
-					if (result == null)
-						result = caseENamedElement(dtdAttribute);
-					if (result == null)
-						result = caseEModelElement(dtdAttribute);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_ELEMENT : {
-					DTDElement dtdElement = (DTDElement) theEObject;
-					Object result = caseDTDElement(dtdElement);
-					if (result == null)
-						result = caseEClass(dtdElement);
-					if (result == null)
-						result = caseDTDContent(dtdElement);
-					if (result == null)
-						result = caseEClassifier(dtdElement);
-					if (result == null)
-						result = caseENamedElement(dtdElement);
-					if (result == null)
-						result = caseEModelElement(dtdElement);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_EMPTY_CONTENT : {
-					DTDEmptyContent dtdEmptyContent = (DTDEmptyContent) theEObject;
-					Object result = caseDTDEmptyContent(dtdEmptyContent);
-					if (result == null)
-						result = caseDTDElementContent(dtdEmptyContent);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_ANY_CONTENT : {
-					DTDAnyContent dtdAnyContent = (DTDAnyContent) theEObject;
-					Object result = caseDTDAnyContent(dtdAnyContent);
-					if (result == null)
-						result = caseDTDElementContent(dtdAnyContent);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_PC_DATA_CONTENT : {
-					DTDPCDataContent dtdpcDataContent = (DTDPCDataContent) theEObject;
-					Object result = caseDTDPCDataContent(dtdpcDataContent);
-					if (result == null)
-						result = caseDTDElementContent(dtdpcDataContent);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT : {
-					DTDElementReferenceContent dtdElementReferenceContent = (DTDElementReferenceContent) theEObject;
-					Object result = caseDTDElementReferenceContent(dtdElementReferenceContent);
-					if (result == null)
-						result = caseDTDRepeatableContent(dtdElementReferenceContent);
-					if (result == null)
-						result = caseDTDElementContent(dtdElementReferenceContent);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_FILE : {
-					DTDFile dtdFile = (DTDFile) theEObject;
-					Object result = caseDTDFile(dtdFile);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_BASIC_TYPE : {
-					DTDBasicType dtdBasicType = (DTDBasicType) theEObject;
-					Object result = caseDTDBasicType(dtdBasicType);
-					if (result == null)
-						result = caseEClass(dtdBasicType);
-					if (result == null)
-						result = caseEClassifier(dtdBasicType);
-					if (result == null)
-						result = caseENamedElement(dtdBasicType);
-					if (result == null)
-						result = caseEModelElement(dtdBasicType);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_ENUMERATION_TYPE : {
-					DTDEnumerationType dtdEnumerationType = (DTDEnumerationType) theEObject;
-					Object result = caseDTDEnumerationType(dtdEnumerationType);
-					if (result == null)
-						result = caseEEnum(dtdEnumerationType);
-					if (result == null)
-						result = caseEDataType(dtdEnumerationType);
-					if (result == null)
-						result = caseEClassifier(dtdEnumerationType);
-					if (result == null)
-						result = caseENamedElement(dtdEnumerationType);
-					if (result == null)
-						result = caseEModelElement(dtdEnumerationType);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_NOTATION : {
-					DTDNotation dtdNotation = (DTDNotation) theEObject;
-					Object result = caseDTDNotation(dtdNotation);
-					if (result == null)
-						result = caseDTDContent(dtdNotation);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_ENTITY : {
-					DTDEntity dtdEntity = (DTDEntity) theEObject;
-					Object result = caseDTDEntity(dtdEntity);
-					if (result == null)
-						result = caseDTDContent(dtdEntity);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_EXTERNAL_ENTITY : {
-					DTDExternalEntity dtdExternalEntity = (DTDExternalEntity) theEObject;
-					Object result = caseDTDExternalEntity(dtdExternalEntity);
-					if (result == null)
-						result = caseDTDEntityContent(dtdExternalEntity);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_INTERNAL_ENTITY : {
-					DTDInternalEntity dtdInternalEntity = (DTDInternalEntity) theEObject;
-					Object result = caseDTDInternalEntity(dtdInternalEntity);
-					if (result == null)
-						result = caseDTDEntityContent(dtdInternalEntity);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE : {
-					DTDParameterEntityReference dtdParameterEntityReference = (DTDParameterEntityReference) theEObject;
-					Object result = caseDTDParameterEntityReference(dtdParameterEntityReference);
-					if (result == null)
-						result = caseDTDContent(dtdParameterEntityReference);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT : {
-					DTDEntityReferenceContent dtdEntityReferenceContent = (DTDEntityReferenceContent) theEObject;
-					Object result = caseDTDEntityReferenceContent(dtdEntityReferenceContent);
-					if (result == null)
-						result = caseDTDRepeatableContent(dtdEntityReferenceContent);
-					if (result == null)
-						result = caseDTDElementContent(dtdEntityReferenceContent);
-					if (result == null)
-						result = defaultCase(theEObject);
-					return result;
-				}
-				default :
-					return defaultCase(theEObject);
-			}
-		}
-		return defaultCase(theEObject);
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDFile(DTDFile object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDNotation(DTDNotation object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDContent(DTDContent object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDEntity(DTDEntity object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDEntityContent(DTDEntityContent object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDExternalEntity(DTDExternalEntity object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDInternalEntity(DTDInternalEntity object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDParameterEntityReference(DTDParameterEntityReference object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDEntityReferenceContent(DTDEntityReferenceContent object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDRepeatableContent(DTDRepeatableContent object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDElementReferenceContent(DTDElementReferenceContent object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDElement(DTDElement object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDElementContent(DTDElementContent object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDEmptyContent(DTDEmptyContent object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDAnyContent(DTDAnyContent object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDPCDataContent(DTDPCDataContent object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDGroupContent(DTDGroupContent object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDAttribute(DTDAttribute object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDEnumerationType(DTDEnumerationType object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseDTDBasicType(DTDBasicType object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-	//
-	// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-	// // public Object caseENamespace(ENamespace object) {
-	// -------------------GENERICRULES.JSED-------------------
-	// return null;
-	// }
-	// -------------------GENERICRULES.JSED-------------------
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseEClass(EClass object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseEAttribute(EAttribute object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseEEnum(EEnum object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseEModelElement(EModelElement object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseENamedElement(ENamedElement object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseEStructuralFeature(EStructuralFeature object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseEDataType(EDataType object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseETypedElement(ETypedElement object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object caseEClassifier(EClassifier object) {
-		return null;
-	}
-
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-	//
-	// +++++++++++++++++++GENERICRULES.JSED+++++++++++++++++++
-	// // public Object caseInternalEClassifier(InternalEClassifier object) {
-	// -------------------GENERICRULES.JSED-------------------
-	// return null;
-	// }
-	// -------------------GENERICRULES.JSED-------------------
-	/**
-	 * @generated This field/method will be replaced during code generation.
-	 */
-	public Object defaultCase(EObject object) {
-		return null;
-	}
-
-} // DTDSwitch
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUniqueNameHelper.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUniqueNameHelper.java
deleted file mode 100644
index e12f6b3..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUniqueNameHelper.java
+++ /dev/null
@@ -1,174 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-
-
-
-public class DTDUniqueNameHelper {
-	public DTDUniqueNameHelper() {
-
-	}
-
-	static public String getUniqueElementName(DTDFile dtdFile) {
-		List elements = dtdFile.listDTDElement();
-		return getUniqueName(elements, "NewElement"); //$NON-NLS-1$
-	}
-
-	static public String getUniqueEntityName(DTDFile dtdFile) {
-		List entities = dtdFile.listDTDEntity();
-		return getUniqueName(entities, "NewEntity"); //$NON-NLS-1$
-	}
-
-	static public String getUniqueNotationName(DTDFile dtdFile) {
-		List notations = dtdFile.listDTDNotation();
-		return getUniqueName(notations, "NewNotation"); //$NON-NLS-1$
-	}
-
-	static public String getUniqueAttributeName(DTDElement element) {
-		List attrs = element.getDTDAttribute();
-		return getUniqueName(attrs, "NewAttribute"); //$NON-NLS-1$
-	}
-
-	static public String getUniqueName(List objs, String token) {
-		int counter = 1;
-
-		boolean uniqueName = false;
-		while (!uniqueName) {
-			String newName = token + new Integer(counter++);
-			uniqueName = true;
-			Iterator iter = objs.iterator();
-			while (iter.hasNext()) {
-				Object obj = iter.next();
-				String objName = getName(obj);
-				if (objName.equals(newName)) {
-					uniqueName = false;
-					break;
-				}
-			}
-			if (uniqueName) {
-				return newName;
-			}
-		}
-		// we shouldn't get here
-		return "No Name found"; //$NON-NLS-1$
-	}
-
-	static public String getName(Object obj) {
-		if (obj instanceof DTDElement) {
-			return ((DTDElement) obj).getName();
-		}
-		else if (obj instanceof DTDEntity) {
-			return ((DTDEntity) obj).getName();
-		}
-		else if (obj instanceof DTDNotation) {
-			return ((DTDNotation) obj).getName();
-		}
-		else if (obj instanceof DTDAttribute) {
-			return ((DTDAttribute) obj).getName();
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-
-	/**
-	 * @generated
-	 */
-	protected static String getUniqueElementNameGen(DTDFile dtdFile) {
-
-		List elements = dtdFile.listDTDElement();
-		return getUniqueName(elements, "NewElement"); //$NON-NLS-1$
-	}
-
-	/**
-	 * @generated
-	 */
-	protected static String getUniqueEntityNameGen(DTDFile dtdFile) {
-
-		List entities = dtdFile.listDTDEntity();
-		return getUniqueName(entities, "NewEntity"); //$NON-NLS-1$
-	}
-
-	/**
-	 * @generated
-	 */
-	protected static String getUniqueNotationNameGen(DTDFile dtdFile) {
-
-		List notations = dtdFile.listDTDNotation();
-		return getUniqueName(notations, "NewNotation"); //$NON-NLS-1$
-	}
-
-	/**
-	 * @generated
-	 */
-	protected static String getUniqueAttributeNameGen(DTDElement element) {
-
-		List attrs = element.getDTDAttribute();
-		return getUniqueName(attrs, "NewAttribute"); //$NON-NLS-1$
-	}
-
-	/**
-	 * @generated
-	 */
-	protected static String getUniqueNameGen(List objs, String token) {
-
-		int counter = 1;
-
-		boolean uniqueName = false;
-		while (!uniqueName) {
-			String newName = token + new Integer(counter++);
-			uniqueName = true;
-			Iterator iter = objs.iterator();
-			while (iter.hasNext()) {
-				Object obj = iter.next();
-				String objName = getName(obj);
-				if (objName.equals(newName)) {
-					uniqueName = false;
-					break;
-				}
-			}
-			if (uniqueName) {
-				return newName;
-			}
-		}
-		// we shouldn't get here
-		return "No Name found"; //$NON-NLS-1$
-	}
-
-	/**
-	 * @generated
-	 */
-	protected static String getNameGen(Object obj) {
-
-		if (obj instanceof DTDElement) {
-			return ((DTDElement) obj).getName();
-		}
-		else if (obj instanceof DTDEntity) {
-			return ((DTDEntity) obj).getName();
-		}
-		else if (obj instanceof DTDNotation) {
-			return ((DTDNotation) obj).getName();
-		}
-		else if (obj instanceof DTDAttribute) {
-			return ((DTDAttribute) obj).getName();
-		}
-		return ""; //$NON-NLS-1$
-	}
-}// DTDUniqueNameHelper
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUtil.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUtil.java
deleted file mode 100644
index cc0ab38..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUtil.java
+++ /dev/null
@@ -1,1217 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.wst.dtd.core.internal.emf.DTDConstants;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFactory;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.impl.DTDFactoryImpl;
-import org.eclipse.wst.dtd.core.internal.saxparser.DTD;
-import org.eclipse.wst.dtd.core.internal.saxparser.DTDParser;
-import org.eclipse.wst.dtd.core.internal.saxparser.ErrorMessage;
-
-/**
- * Create MOF objects from the parsed DTD If no DTD file is specifed, create
- * the root MOF object
- */
-public class DTDUtil {
-	DTDFactory factory;
-	EList extent;
-	Resource resource;
-	DTDFile dtdFile;
-	String dtdModelFile;
-	boolean expandEntityReferences;
-
-	private Hashtable externalDTDModels = new Hashtable();
-	private Hashtable pePool = new Hashtable();
-	private Hashtable elementPool = new Hashtable();
-
-	private DTDParser parser;
-
-	private Vector errorMsgs = new Vector();
-
-	private static Hashtable utilCache = new Hashtable();
-
-	static public DTDUtil getDTDUtilFor(String filename) {
-		DTDUtil util = (DTDUtil) utilCache.get(filename);
-		if (util == null) {
-			util = new DTDUtil();
-			utilCache.put(filename, util);
-		}
-
-		return util;
-	}
-
-
-	public void parse(String uri) {
-		parse(new ResourceSetImpl(), uri);
-	}
-
-	/**
-	 * Invoke parse to parse a .dtd file into a MOF object model This is
-	 * invoked by the RegisteredDTDParser that registers this parser for MOF
-	 * to use against the .dtd type
-	 * 
-	 * @param filename -
-	 *            the fully qualifed name of a .dtd file
-	 */
-	public void parse(ResourceSet resources, String filename) {
-		// Get the dtd name from the file name
-		Path path = new Path(filename);
-		IPath iPath = path.removeFileExtension();
-		String dtdName = iPath.toFile().getName();
-
-		try {
-			parser = new DTDParser(false);
-			if (expandEntityReferences) {
-				parser.setExpandEntityReferences(expandEntityReferences);
-			}
-			parser.parse(filename);
-		}
-		catch (IOException ex) {
-			ex.printStackTrace(System.err);
-		}
-
-		dtdModelFile = filename;
-
-		factory = DTDFactoryImpl.instance();
-
-		extent = new BasicEList();
-
-		dtdFile = factory.createDTDFile();
-		extent.add(dtdFile);
-
-		dtdFile.setName(dtdName);
-
-		populateDTD(resources, expandEntityReferences);
-	}
-
-	public DTDFactory getFactory() {
-		return factory;
-	}
-
-	public DTDFile getDTDFile() {
-		return dtdFile;
-	}
-
-	public Hashtable getPEPool() {
-		return pePool;
-	}
-
-	public Hashtable getElementPool() {
-		return elementPool;
-	}
-
-	public EList getContents() {
-		return extent;
-	}
-
-	public void setResource(Resource resource) {
-		this.resource = resource;
-	}
-
-	public Resource getResource(Resource resource) {
-		return resource;
-	}
-
-	public void setexpandEntityReferences(boolean expandEntityReferences) {
-		this.expandEntityReferences = expandEntityReferences;
-	}
-
-	public boolean getExpandEntityReferences() {
-		return expandEntityReferences;
-	}
-
-	/**
-	 * Return true if the model has been modified
-	 */
-	public boolean isModelDirty() {
-		if (resource != null) {
-			return resource.isModified();
-		}
-		return false;
-	}
-
-	/**
-	 * Save the .dtd file
-	 */
-	public boolean save() {
-		try {
-			Map options = new HashMap();
-			resource.save(options);
-			return true;
-		}
-		catch (Exception ex) {
-			System.out.println("Save model exception " + ex); //$NON-NLS-1$
-			ex.printStackTrace();
-			return false;
-		}
-	}
-
-	public boolean saveAs(String newFilename) {
-		resource.setURI(URI.createURI(newFilename));
-		boolean ok = save();
-
-		if (ok) {
-			Path path = new Path(newFilename);
-			IPath iPath = path.removeFileExtension();
-			String dtdName = iPath.toFile().getName();
-
-			dtdFile.setName(dtdName);
-		}
-		return ok;
-	}
-
-	public boolean saveDTDFile(String filename) {
-		boolean result = true;
-		try {
-			PrintWriter pw = new PrintWriter(new FileWriter(filename), true);
-			DTDPrinter printer = new DTDPrinter(true);
-			printer.visitDTDFile(dtdFile);
-
-			String s = printer.getBuffer().toString();
-			pw.println(s);
-			pw.close();
-		}
-
-		catch (Exception e) {
-			result = false;
-		}
-		return result;
-	}
-
-	public String getDTDSource(boolean includeError) {
-		return dtdFile.unparse(includeError); // true = include error lines
-	}
-
-	/**
-	 * Create MOF objects from DTD
-	 */
-	private void populateDTD(ResourceSet resources, boolean expandEntityReferences) {
-		Vector dtdList = parser.getDTDList();
-
-		// create XMIModel for the included DTDs
-		if (dtdList.size() > 0) {
-			if (!expandEntityReferences) {
-				for (int i = dtdList.size() - 1; i > 0; i--) {
-					DTD dtd = (DTD) dtdList.elementAt(i);
-					loadIncludedDTD(resources, dtd);
-				}
-
-				DTD dtd = (DTD) dtdList.elementAt(0);
-				populateDTD(resources, dtd, dtdFile); // populate the main
-														// DTD
-				// validateWithModel(dtd);
-			}
-			else {
-				for (int i = dtdList.size() - 1; i >= 0; i--) {
-					DTD dtd = (DTD) dtdList.elementAt(i);
-					populateDTD(resources, dtd, dtdFile);
-					// validateWithModel(dtd);
-				}
-			}
-		}
-	}
-
-	// return the instance unique to this DTDUtil file that represents an
-	// externally loaded dtd (will create if one doesn't exist yet)
-	public ExternalDTDModel getExternalDTDModel(ResourceSet resources, String uri) {
-		if (expandEntityReferences) {
-			return null;
-		}
-
-		// DefaultMsgLogger.write("External DTD name: " + uri);
-
-		if (externalDTDModels.containsKey(uri)) {
-			return (ExternalDTDModel) externalDTDModels.get(uri);
-		}
-		else {
-			ExternalDTDModel extModel = new ExternalDTDModel();
-			if (extModel.loadModel(resources, uri)) {
-				externalDTDModels.put(uri, extModel);
-				return extModel;
-			}
-		}
-		return null;
-	}
-
-	// load xmiModels for included DTDs
-	private void loadIncludedDTD(ResourceSet resources, DTD dtd) {
-		ExternalDTDModel extModel = getExternalDTDModel(resources, dtd.getName());
-		if (extModel != null) {
-			// now fill our hash tables for elements and parameter entities
-			// so that we know what can be referenced by our main dtd
-			DTDFile file = extModel.getExternalDTDFile();
-			Collection elementList = file.listDTDElement();
-			Collection entityList = file.listDTDEntity();
-
-			Iterator i = elementList.iterator();
-			while (i.hasNext()) {
-				DTDObject object = (DTDObject) i.next();
-				elementPool.put(getBaseName(object), object);
-			}
-
-			i = entityList.iterator();
-			while (i.hasNext()) {
-				DTDEntity entity = (DTDEntity) i.next();
-				if (entity.isParameterEntity()) {
-					pePool.put(getBaseName(entity), entity);
-				}
-			}
-		}
-	}
-
-	/**
-	 * Create MOF objects from DTD
-	 * 
-	 * 1) will create the corresponding DTD Mof object for EntityDecl,
-	 * NotationDecl and ElementDecl declarations during the 1st pass 2) During
-	 * the 2nd pass, it will add the contentModel and Attlist to all
-	 * ElementDecl.
-	 * 
-	 */
-	private void populateDTD(ResourceSet resources, DTD dtd, DTDFile dFile) {
-		DTDModelBuilder modelBuilder = new DTDModelBuilder(resources, this, dtd, dFile);
-
-		modelBuilder.visitDTD(dtd);
-	}
-
-
-	public void emptyErrorMessages() {
-		errorMsgs.removeAllElements();
-	}
-
-	public void addErrorMessage(ErrorMessage error) {
-		int vectorSize = errorMsgs.size();
-		boolean add = true;
-
-		if (vectorSize != 0) {
-			int index = 0;
-
-			while (add == true && index < vectorSize) {
-				if (((ErrorMessage) errorMsgs.elementAt(index)).equals(error)) {
-					add = false;
-				}
-				else {
-					index++;
-				}
-			}
-		}
-
-		if (add) {
-			errorMsgs.addElement(error);
-		}
-	}
-
-	public Vector getErrors() {
-		return errorMsgs;
-	}
-
-	// This gets the name without any pseudo namespace prefix
-	public static String getBaseName(DTDObject obj) {
-		return getName(obj, null);
-	}
-
-	// This gets the name with pseudo namespace prefixes if dtdFile is not
-	// null
-	public static String getName(DTDObject obj, DTDFile dtdFile) {
-		String name = ""; //$NON-NLS-1$
-		if (obj instanceof DTDEntity) {
-			DTDEntity entity = (DTDEntity) obj;
-			if (dtdFile != null && !entity.getDTDFile().equals(dtdFile)) {
-				name = new Path(entity.getDTDFile().getName()).lastSegment() + ": "; //$NON-NLS-1$
-			}
-			name += "%" + ((DTDEntity) obj).getName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		else if (obj instanceof DTDElement) {
-			DTDElement element = (DTDElement) obj;
-			if (dtdFile != null && !element.getDTDFile().equals(dtdFile)) {
-				name = new Path(element.getDTDFile().getName()).lastSegment() + ": "; //$NON-NLS-1$
-			}
-			name += ((DTDElement) obj).getName();
-		}
-		else if (obj instanceof DTDElementContent) {
-			return ((DTDElementContent) obj).getContentName();
-		}
-		return name;
-	}
-
-	public static String getGroupType(int groupKind, int occurrence) {
-		String type = null;
-
-		switch (groupKind) {
-			case DTDGroupKind.SEQUENCE :
-				type = "DTDSequence"; //$NON-NLS-1$
-				break;
-			case DTDGroupKind.CHOICE :
-				type = "DTDChoice"; //$NON-NLS-1$
-				break;
-		}
-
-		type += getRepeatableTypeSuffix(occurrence);
-		return type;
-	}
-
-	public static String getReferenceType(int occurrence) {
-		String type = "DTDReference"; //$NON-NLS-1$
-		type += getRepeatableTypeSuffix(occurrence);
-		return type;
-	}
-
-	private static String getRepeatableTypeSuffix(int occurrence) {
-		return "(" + (char) occurrence + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	public static void main(String args[]) {
-		System.out.println("\nStarting ..."); //$NON-NLS-1$
-
-		if (args.length != 1)
-			System.out.println("usage: DtdUtil inputfile.dtd"); //$NON-NLS-1$
-
-		java.io.File inputFile = new File(args[0]);
-
-		String dtdFileName = ""; //$NON-NLS-1$
-		try {
-			dtdFileName = inputFile.getCanonicalPath();
-		}
-		catch (IOException ex) {
-		}
-
-		String dtdModelName = dtdFileName;
-
-		if (DTDConstants.DTD_EXTENSION.equals(new Path(dtdFileName).getFileExtension())) {
-			dtdModelName = new Path(dtdFileName).removeFileExtension().lastSegment();
-		}
-		DTDUtil d2m = new DTDUtil();
-		// TODO: fix port
-		// d2m.parse(dtdFileName);
-		try {
-			d2m.saveAs(dtdModelName + "." + DTDConstants.DTD_XMI_EXTENSION); //$NON-NLS-1$
-		}
-		catch (Exception e) {
-			System.out.println("Exception thrown during model save: " + e); //$NON-NLS-1$
-		}
-		System.out.println("Done."); //$NON-NLS-1$
-	}
-
-	public org.eclipse.core.runtime.IPath getPath() {
-		Path currentDTDPath = new Path(dtdModelFile);
-		if (currentDTDPath.segmentCount() > 1) {
-			return currentDTDPath.removeLastSegments(1).addTrailingSeparator();
-		}
-
-		return new Path(""); //$NON-NLS-1$
-	}
-
-	// /**
-	// * @generated
-	// */
-	// protected static DTDUtil getDTDUtilForGen(String filename) {
-	//
-	// DTDUtil util = (DTDUtil) utilCache.get(filename);
-	// if (util == null)
-	// {
-	// util = new DTDUtil();
-	// utilCache.put(filename, util);
-	// }
-	//    
-	// return util;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void parseGen(String uri) {
-	//                           
-	// parse(new ResourceSetImpl(), uri);
-	// }
-	// /**
-	// * Invoke parse to parse a .dtd file into a MOF object model
-	// * This is invoked by the RegisteredDTDParser that registers this parser
-	// for MOF to use
-	// * against the .dtd type
-	// * @param filename - the fully qualifed name of a .dtd file
-	// */
-	// protected void parseGen(ResourceSet resources, String filename) {
-	//
-	// // Get the dtd name from the file name
-	// Path path = new Path(filename);
-	// IPath iPath = path.removeFileExtension();
-	// String dtdName = iPath.toFile().getName();
-	//
-	//
-	// try
-	// {
-	// parser = new DTDParser(false);
-	// if (expandEntityReferences)
-	// {
-	// parser.setExpandEntityReferences(expandEntityReferences);
-	// }
-	// parser.parse(filename);
-	// }
-	// catch(IOException ex)
-	// {
-	// ex.printStackTrace(System.err);
-	// }
-	//
-	//
-	// dtdModelFile = filename;
-	//
-	//
-	// factory = DTDFactoryImpl.instance();
-	//
-	//
-	// extent = new BasicEList();
-	//
-	//
-	// dtdFile = factory.createDTDFile();
-	// extent.add(dtdFile);
-	//
-	//
-	// dtdFile.setName(dtdName);
-	//
-	//
-	// populateDTD(resources, expandEntityReferences);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected DTDFactory getFactoryGen() {
-	//
-	// return factory;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected DTDFile getDTDFileGen() {
-	//
-	// return dtdFile;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected Hashtable getPEPoolGen() {
-	//
-	// return pePool;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected Hashtable getElementPoolGen() {
-	//
-	// return elementPool;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected EList getExtentGen() {
-	//
-	// return extent;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void setResourceGen(Resource resource) {
-	//
-	// this.resource = resource;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected Resource getResourceGen(Resource resource) {
-	//
-	// return resource;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void setexpandEntityReferencesGen(boolean
-	// expandEntityReferences) {
-	//
-	// this.expandEntityReferences = expandEntityReferences;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected boolean getExpandEntityReferencesGen() {
-	//
-	// return expandEntityReferences;
-	// }
-	// /**
-	// * Return true if the model has been modified
-	// */
-	// protected boolean isModelDirtyGen() {
-	//
-	// if (resource != null)
-	// {
-	// return resource.isModified();
-	// }
-	// return false;
-	// }
-	// /**
-	// * Save the .dtd file
-	// */
-	// protected boolean saveGen() {
-	//
-	// try
-	// {
-	// resource.save();
-	// return true;
-	// }
-	// catch (Exception ex)
-	// {
-	// System.out.println("Save model exception " + ex);
-	// ex.printStackTrace();
-	// return false;
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected boolean saveAsGen(String newFilename) {
-	//
-	// resource.setURI(newFilename);
-	// boolean ok = save();
-	//
-	//
-	// if (ok)
-	// {
-	// Path path = new Path(newFilename);
-	// IPath iPath = path.removeFileExtension();
-	// String dtdName = iPath.toFile().getName();
-	//
-	//
-	// dtdFile.setName(dtdName);
-	// }
-	// return ok;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected boolean saveDTDFileGen(String filename) {
-	//
-	// boolean result=true;
-	// try
-	// {
-	// PrintWriter pw = new PrintWriter(new FileWriter(filename),true);
-	// DTDPrinter printer = new DTDPrinter(true);
-	// printer.visitDTDFile(dtdFile);
-	//
-	//
-	// String s = printer.getBuffer().getName().toString();
-	// pw.println(s);
-	// pw.close();
-	// }
-	//
-	//
-	// catch (Exception e)
-	// {
-	// result = false;
-	// }
-	// return result;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected String getDTDSourceGen(boolean includeError) {
-	//
-	// return dtdFile.unparse(includeError); // true = include error lines
-	// }
-	// /**
-	// * Create MOF objects from DTD
-	// */
-	// protected void populateDTDGen(ResourceSet resources, boolean
-	// expandEntityReferences) {
-	//
-	// Vector dtdList = parser.getDTDList();
-	//
-	//
-	// // create XMIModel for the included DTDs
-	// if ( dtdList.size() > 0)
-	// {
-	// if (!expandEntityReferences)
-	// {
-	// for (int i=dtdList.size() - 1; i > 0; i--)
-	// {
-	// DTD dtd = (DTD) dtdList.elementAt(i);
-	// loadIncludedDTD(resources, dtd);
-	// }
-	//
-	//
-	// DTD dtd = (DTD) dtdList.elementAt(0);
-	// populateDTD(resources, dtd, dtdFile); // populate the main DTD
-	// // validateWithModel(dtd);
-	// }
-	// else
-	// {
-	// for (int i = dtdList.size() - 1; i >= 0; i--)
-	// {
-	// DTD dtd = (DTD) dtdList.elementAt(i);
-	// populateDTD(resources, dtd, dtdFile);
-	// // validateWithModel(dtd);
-	// }
-	// }
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected ExternalDTDModel getExternalDTDModelGen(ResourceSet
-	// resources, String uri) {
-	//
-	// if (expandEntityReferences)
-	// {
-	// return null;
-	// }
-	//       
-	// DefaultMsgLogger.write("External DTD name: " + uri);
-	//
-	//
-	// if (externalDTDModels.containsKey(uri))
-	// {
-	// return (ExternalDTDModel) externalDTDModels.get(uri);
-	// }
-	// else
-	// {
-	// ExternalDTDModel extModel = new ExternalDTDModel();
-	// if (extModel.loadModel(resources, uri))
-	// {
-	// externalDTDModels.put(uri, extModel);
-	// return extModel;
-	// }
-	// }
-	// return null;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void loadIncludedDTDGen(ResourceSet resources, DTD dtd) {
-	//
-	// ExternalDTDModel extModel = getExternalDTDModel(resources,
-	// dtd.getName());
-	// if (extModel != null)
-	// {
-	// // now fill our hash tables for elements and parameter entities
-	// // so that we know what can be referenced by our main dtd
-	// DTDFile file = extModel.getExternalDTDFile();
-	// Collection elementList = file.listDTDElement();
-	// Collection entityList = file.listDTDEntity();
-	//
-	//
-	// Iterator i = elementList.iterator();
-	// while (i.hasNext())
-	// {
-	// DTDObject object = (DTDObject) i.next();
-	// elementPool.put(getBaseName(object), object);
-	// }
-	//      
-	// i = entityList.iterator();
-	// while (i.hasNext())
-	// {
-	// DTDEntity entity = (DTDEntity) i.next();
-	// if (entity.isParameterEntity())
-	// {
-	// pePool.put(getBaseName(entity), entity);
-	// }
-	// }
-	// }
-	// }
-	// /**
-	// * Create MOF objects from DTD
-	// *
-	// * 1) will create the corresponding DTD Mof object for EntityDecl,
-	// NotationDecl
-	// * and ElementDecl declarations during the 1st pass
-	// * 2) During the 2nd pass, it will add the contentModel and Attlist to
-	// all
-	// * ElementDecl.
-	// *
-	// */
-	// protected void populateDTDGen(ResourceSet resources, DTD dtd, DTDFile
-	// dFile) {
-	//
-	// DTDModelBuilder modelBuilder = new DTDModelBuilder(resources, this,
-	// dtd, dFile);
-	//
-	//
-	// modelBuilder.visitDTD(dtd);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void emptyErrorMessagesGen() {
-	//
-	// errorMsgs.removeAllElements();
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void addErrorMessageGen(ErrorMessage error) {
-	//
-	// int vectorSize = errorMsgs.size();
-	// boolean add = true;
-	//
-	//
-	// if (vectorSize != 0)
-	// {
-	// int index = 0;
-	//
-	//
-	// while (add == true && index < vectorSize)
-	// {
-	// if (((ErrorMessage) errorMsgs.elementAt(index)).equals(error))
-	// {
-	// add =false;
-	// }
-	// else
-	// {
-	// index++;
-	// }
-	// }
-	// }
-	//
-	//
-	// if (add)
-	// {
-	// errorMsgs.addElement(error);
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected Vector getErrorsGen() {
-	//
-	// return errorMsgs;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected boolean validateDTDGen() {
-	//
-	// String tempDTDFile=getPath().toOSString()+"tempValidatingFileName.dtd";
-	// try
-	// {
-	// saveDTDFile(tempDTDFile);
-	//
-	//
-	// parser = new DTDParser(false);
-	// if (FileUtility.fileExists(tempDTDFile))
-	// {
-	// parser.parse(tempDTDFile);
-	// }
-	// Vector dtdList = parser.getDTDList();
-	// if ( dtdList.size() > 0)
-	// {
-	// // reset the errors and update what we have in the element pool
-	// emptyErrorMessages();
-	// updateElementHashtable();
-	//
-	//
-	// // TODO: do we just validate the current one?
-	// validateWithModel((DTD)dtdList.elementAt(0));
-	// }
-	// }
-	// catch(IOException ex)
-	// {
-	// ex.printStackTrace(System.err);
-	// FileUtility.delete(tempDTDFile);
-	// }
-	// FileUtility.delete(tempDTDFile);
-	//
-	//
-	// return dtdFile.isParseError();
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void validateWithModelGen(DTD dtd) {
-	//
-	// Enumeration en = dtd.externalElements();
-	// while (en.hasMoreElements())
-	// {
-	// Object e = en.nextElement();
-	//
-	//
-	// if ( e instanceof EntityDecl )
-	// {
-	// EntityDecl entity = (EntityDecl) e;
-	// ErrorMessage errMsg = entity.getErrorMessage();
-	// if ( errMsg!= null)
-	// {
-	// addErrorMessage(errMsg);
-	// // dtdFile.setParseError(true);
-	// }
-	// }
-	// else if ( e instanceof ElementDecl )
-	// {
-	// ElementDecl elem = (ElementDecl) e;
-	// ErrorMessage errMsg = elem.getErrorMessage();
-	// DTDElement dtdelement = (DTDElement)
-	// getElementPool().get(elem.getNodeName());
-	//
-	//
-	// if ( errMsg!= null)
-	// {
-	// addErrorMessage(errMsg);
-	// }
-	// checkForMissingElementReferences(dtdelement);
-	// }
-	// else if ( e instanceof NotationDecl )
-	// {
-	// NotationDecl notation = (NotationDecl) e;
-	// ErrorMessage errMsg = notation.getErrorMessage();
-	// if ( errMsg!= null)
-	// {
-	// addErrorMessage(errMsg);
-	// }
-	// }
-	// else if ( e instanceof Attlist )
-	// {
-	// Attlist attList = (Attlist) e;
-	// ErrorMessage errMsg = attList.getErrorMessage();
-	// if ( errMsg!= null)
-	// {
-	// addErrorMessage(errMsg);
-	// }
-	// }
-	// }
-	//
-	//
-	// checkForDuplicateIDAttribute();
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void updateElementHashtableGen() {
-	//
-	// elementPool.clear();
-	// CreateListItems itemsHelper = new CreateListItems(dtdFile);
-	//
-	//
-	// Vector allElements = itemsHelper.getElements();
-	// // go through all the dtdFiles and list the elements
-	// int numElements = allElements.size();
-	//
-	//
-	// for (int i = 0; i < numElements; i++)
-	// {
-	// DTDElement element = (DTDElement) allElements.elementAt(i);
-	// elementPool.put(getBaseName(element), element);
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void updateEntityHashtableGen() {
-	//
-	// updateHashTable(pePool, dtdFile.listDTDEntity());
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void updateHashTableGen(Hashtable h, Collection dtdObjects) {
-	//
-	// h.clear();
-	// Iterator i = dtdObjects.iterator();
-	// while (i.hasNext())
-	// {
-	// String name = "";
-	// DTDObject o = (DTDObject) i.next();
-	// name = getBaseName(o);
-	// h.put(name,o);
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected static String getBaseNameGen(DTDObject obj) {
-	//
-	// return getName(obj, null);
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected static String getNameGen(DTDObject obj, DTDFile dtdFile) {
-	//
-	// String name = "";
-	// if (obj instanceof DTDEntity)
-	// {
-	// DTDEntity entity = (DTDEntity) obj;
-	// if (dtdFile != null &&
-	// !entity.getDTDFile().equals(dtdFile))
-	// {
-	// name = new Path(entity.getDTDFile().getName()).lastSegment() + ": ";
-	// }
-	// name += "%" + ((DTDEntity)obj).getName() + ";";
-	// }
-	// else if (obj instanceof DTDElement)
-	// {
-	// DTDElement element = (DTDElement) obj;
-	// if (dtdFile != null &&
-	// !element.getDTDFile().equals(dtdFile))
-	// {
-	// name = new Path(element.getDTDFile().getName()).lastSegment() + ": ";
-	// }
-	// name += ((DTDElement)obj).getName();
-	// }
-	// else if (obj instanceof DTDElementContent)
-	// {
-	// return ((DTDElementContent) obj).getContentName();
-	// }
-	// return name;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void checkForMissingElementReferencesGen(DTDElement element)
-	// {
-	//
-	// String dtdString = null;
-	// if ( element == null )
-	// return;
-	//
-	//
-	// Vector elementRefs = new Vector();
-	// findElementReferences(element.getContent(),elementRefs);
-	//
-	//
-	// Enumeration en = elementRefs.elements();
-	// while (en.hasMoreElements())
-	// {
-	// String elementRefName = "";
-	// DTDObject dtdObject = (DTDObject) en.nextElement();
-	//
-	//
-	// if ( dtdObject instanceof DTDElement)
-	// {
-	// elementRefName = ((DTDElement)dtdObject).getName();
-	// if ( getElementPool().get(elementRefName) == null)
-	// {
-	// if (dtdString == null)
-	// {
-	// dtdString = getDTDSource(false);
-	// }
-	// String errorMsg = "Element \"" + element.getName() + "\", refers to
-	// undeclared element "
-	// + "\"" + elementRefName + "\", in content model.\n";
-	// ErrorMessage dtdError = new ErrorMessage();
-	// dtdError.setErrorMessage(errorMsg);
-	// SourceLocationHelper.LineColumn lineColumn =
-	// SourceLocationHelper.offsetToLineColumn(dtdString,
-	// element.getStartOffset());
-	// dtdError.setErrorLine(lineColumn.getLine());
-	// dtdError.setErrorColumn(lineColumn.getColumn());
-	// addErrorMessage(dtdError);
-	// }
-	// }
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void findElementReferencesGen(DTDElementContent content,
-	// Vector result) {
-	//
-	//
-	// if (content instanceof DTDElementReferenceContent)
-	// {
-	// result.addElement(((DTDElementReferenceContent)content).getReferencedElement());
-	// }
-	// else if (content instanceof DTDEntityReferenceContent)
-	// {
-	// result.addElement(((DTDEntityReferenceContent)content).getElementReferencedEntity());
-	// }
-	// else if (content instanceof DTDGroupContent)
-	// {
-	// DTDGroupContent group = (DTDGroupContent)content;
-	// EList contents = group.getContent();
-	// Iterator i = contents.iterator();
-	// while (i.hasNext())
-	// {
-	// findElementReferences((DTDElementContent) i.next(), result);
-	// }
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected void checkForDuplicateIDAttributeGen() {
-	//
-	// String dtdString = null;
-	// Collection elements = dtdFile.listDTDElement();
-	// Iterator i = elements.iterator();
-	// while (i.hasNext())
-	// {
-	// DTDElement element = (DTDElement) i.next();
-	// Iterator k = element.getDTDAttribute().iterator();
-	// boolean saw1stID = false;
-	// while (k.hasNext())
-	// {
-	// DTDAttribute attr = (DTDAttribute) k.next();
-	// DTDType dType = attr.getDTDType();
-	// if (dType instanceof DTDBasicType)
-	// {
-	// if ( ((DTDBasicType)dType).getKind().intValue() == DTDBasicTypeKind.ID)
-	// {
-	// if (saw1stID)
-	// {
-	// if (dtdString == null)
-	// {
-	// dtdString = getDTDSource(false);
-	// }
-	// String errMsg = DTDPlugin.getDTDString("_ERROR_DUP_ID_ATTRIBUTE_1");
-	// errMsg += attr.getName() +
-	// DTDPlugin.getDTDString("_UI_ERRORPART_DUP_ID_ATTRIBUTE_2");
-	//              
-	// ErrorMessage dtdError = new ErrorMessage();
-	// dtdError.setErrorMessage(errMsg);
-	// SourceLocationHelper.LineColumn lineColumn =
-	// SourceLocationHelper.offsetToLineColumn(dtdString,
-	// attr.getStartOffset());
-	// dtdError.setErrorLine(lineColumn.getLine());
-	// dtdError.setErrorColumn(lineColumn.getColumn());
-	// dtdError.setObject(attr);
-	// addErrorMessage(dtdError);
-	// // dtdFile.setParseError(true);
-	// break;
-	// }
-	// else
-	// {
-	// saw1stID = true;
-	// }
-	// }
-	// }
-	// }
-	// }
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected static String getGroupTypeGen(int groupKind, int occurrence)
-	// {
-	//
-	// String type = null;
-	//
-	//
-	// switch (groupKind)
-	// {
-	// case DTDGroupKind.SEQUENCE:
-	// type = "DTDSequence";
-	// break;
-	// case DTDGroupKind.CHOICE:
-	// type = "DTDChoice";
-	// break;
-	// }
-	//
-	//
-	// type += getRepeatableTypeSuffix(occurrence);
-	// return type;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected static String getReferenceTypeGen(int occurrence) {
-	//
-	// String type = "DTDReference";
-	// type += getRepeatableTypeSuffix(occurrence);
-	// return type;
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected static String getRepeatableTypeSuffixGen(int occurrence) {
-	//
-	// return "(" + (char)occurrence + ")";
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected static void mainGen(String[] args) {
-	//
-	// System.out.println("\nStarting ...");
-	//
-	//
-	// if (args.length != 1)
-	// System.out.println("usage: DtdUtil inputfile.dtd");
-	//
-	//
-	// java.io.File inputFile = new File(args[0]);
-	//
-	//
-	// String dtdFileName = "";
-	// try
-	// {
-	// dtdFileName = inputFile.getCanonicalPath();
-	// }
-	// catch(IOException ex)
-	// {}
-	//
-	//
-	// String dtdModelName = dtdFileName;
-	//
-	//
-	// if (DTDConstants.DTD_EXTENSION.equals(new
-	// Path(dtdFileName).getFileExtension()))
-	// {
-	// dtdModelName= new
-	// Path(dtdFileName).removeFileExtension().lastSegment();
-	// }
-	// DTDUtil d2m = new DTDUtil();
-	// // TODO: fix port
-	// // d2m.parse(dtdFileName);
-	// try
-	// {
-	// d2m.saveAs(dtdModelName + "." + DTDConstants.DTD_XMI_EXTENSION);
-	// }
-	// catch (Exception e)
-	// {
-	// System.out.println("Exception thrown during model save: " + e);
-	// }
-	// System.out.println("Done.");
-	// }
-	// /**
-	// * @generated
-	// */
-	// protected org.eclipse.core.runtime.IPath getPathGen() {
-	//
-	// Path currentDTDPath = new Path(dtdModelFile);
-	// if (currentDTDPath.segmentCount() > 1)
-	// {
-	// return currentDTDPath.removeLastSegments(1).addTrailingSeparator();
-	// }
-	//    
-	// return new Path("");
-	// }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDVisitor.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDVisitor.java
deleted file mode 100644
index f65a422..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDVisitor.java
+++ /dev/null
@@ -1,315 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDAttribute;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElement;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEmptyContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntity;
-import org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind;
-import org.eclipse.wst.dtd.core.internal.emf.DTDNotation;
-import org.eclipse.wst.dtd.core.internal.emf.DTDObject;
-import org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent;
-import org.eclipse.wst.dtd.core.internal.emf.DTDParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent;
-
-
-
-public class DTDVisitor {
-
-	public DTDVisitor() {
-	}
-
-	public void visitDTDFile(DTDFile file) {
-		Collection notations = file.listDTDNotation();
-		for (Iterator i = notations.iterator(); i.hasNext();) {
-			visitDTDNotation((DTDNotation) i.next());
-		}
-
-		Collection entities = file.listDTDEntity();
-		for (Iterator i = entities.iterator(); i.hasNext();) {
-			visitDTDEntity((DTDEntity) i.next());
-		}
-
-		Collection objects = file.listDTDElementAndDTDParameterEntityReference();
-		for (Iterator i = objects.iterator(); i.hasNext();) {
-			DTDObject object = (DTDObject) i.next();
-			if (object instanceof DTDElement) {
-				visitDTDElement((DTDElement) object);
-			} // end of if ()
-			else {
-				visitDTDParameterEntityReference((DTDParameterEntityReference) object);
-			} // end of if ()
-		}
-
-	}
-
-	public void visitDTDNotation(DTDNotation notation) {
-	}
-
-	public void visitDTDEntity(DTDEntity entity) {
-	}
-
-	public void visitDTDElement(DTDElement element) {
-		visitDTDElementContent(element.getContent());
-		visitDTDAttributeList(element.getDTDAttribute());
-	}
-
-	public void visitDTDParameterEntityReference(DTDParameterEntityReference parmEntity) {
-
-	}
-
-	public void visitDTDElementContent(DTDElementContent content) {
-		// System.out.println("visitDTDElementContent : " + content);
-		if (content instanceof DTDEmptyContent) {
-			visitDTDEmptyContent((DTDEmptyContent) content);
-		}
-		else if (content instanceof DTDAnyContent) {
-			visitDTDAnyContent((DTDAnyContent) content);
-		}
-		else if (content instanceof DTDPCDataContent) {
-			visitDTDPCDataContent((DTDPCDataContent) content);
-		}
-		if (content instanceof DTDRepeatableContent) {
-			if (content instanceof DTDGroupContent) {
-				visitDTDGroupContent((DTDGroupContent) content);
-			}
-			else if (content instanceof DTDElementReferenceContent) {
-				visitDTDElementReferenceContent((DTDElementReferenceContent) content);
-			}
-			else {
-				visitDTDEntityReferenceContent((DTDEntityReferenceContent) content);
-			} // end of else
-
-			// System.out.println("occurrence: " +
-			// (char)((DTDRepeatableContent)content).getOccurrence());
-		}
-	}
-
-	public void visitDTDEmptyContent(DTDEmptyContent dtdEmptyContent) {
-		// System.out.println("content: EMPTY");
-	}
-
-	public void visitDTDAnyContent(DTDAnyContent dtdAnyContent) {
-		// System.out.println("content: ANY");
-	}
-
-	public void visitDTDPCDataContent(DTDPCDataContent pcDataContent) {
-		// System.out.println("content: PCDATA");
-	}
-
-	public void visitDTDGroupContent(DTDGroupContent groupContent) {
-		if (groupContent.getGroupKind().getValue() == DTDGroupKind.SEQUENCE) {
-			// System.out.println("content: Sequence");
-		}
-		else // if (contentgetGroupKind() == DTDGroupKind.CHOICE)
-		{
-			// System.out.println("content: Choice");
-		}
-
-		Collection groupContents = groupContent.getContent();
-		for (Iterator i = groupContents.iterator(); i.hasNext();) {
-			visitDTDElementContent((DTDElementContent) i.next());
-		}
-	}
-
-	public void visitDTDElementReferenceContent(DTDElementReferenceContent elementReferenceContent) {
-	}
-
-	public void visitDTDEntityReferenceContent(DTDEntityReferenceContent entityReferenceContent) {
-	}
-
-	public void visitDTDAttributeList(List attrs) {
-		Iterator iter = attrs.iterator();
-
-		while (iter.hasNext()) {
-			visitDTDAttribute((DTDAttribute) iter.next());
-		} // end of while ()
-	}
-
-	public void visitDTDAttribute(DTDAttribute attribute) {
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDFileGen(DTDFile file) {
-
-		Collection notations = file.listDTDNotation();
-		for (Iterator i = notations.iterator(); i.hasNext();) {
-			visitDTDNotation((DTDNotation) i.next());
-		}
-
-		Collection entities = file.listDTDEntity();
-		for (Iterator i = entities.iterator(); i.hasNext();) {
-			visitDTDEntity((DTDEntity) i.next());
-		}
-
-		Collection objects = file.listDTDElementAndDTDParameterEntityReference();
-		for (Iterator i = objects.iterator(); i.hasNext();) {
-			DTDObject object = (DTDObject) i.next();
-			if (object instanceof DTDElement) {
-				visitDTDElement((DTDElement) object);
-			} // end of if ()
-			else {
-				visitDTDParameterEntityReference((DTDParameterEntityReference) object);
-			} // end of if ()
-		}
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDNotationGen(DTDNotation notation) {
-
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDEntityGen(DTDEntity entity) {
-
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDElementGen(DTDElement element) {
-
-		visitDTDElementContent(element.getContent());
-		visitDTDAttributeList(element.getDTDAttribute());
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDParameterEntityReferenceGen(DTDParameterEntityReference parmEntity) {
-
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDElementContentGen(DTDElementContent content) {
-
-		// System.out.println("visitDTDElementContent : " + content);
-		if (content instanceof DTDEmptyContent) {
-			visitDTDEmptyContent((DTDEmptyContent) content);
-		}
-		else if (content instanceof DTDAnyContent) {
-			visitDTDAnyContent((DTDAnyContent) content);
-		}
-		else if (content instanceof DTDPCDataContent) {
-			visitDTDPCDataContent((DTDPCDataContent) content);
-		}
-		if (content instanceof DTDRepeatableContent) {
-			if (content instanceof DTDGroupContent) {
-				visitDTDGroupContent((DTDGroupContent) content);
-			}
-			else if (content instanceof DTDElementReferenceContent) {
-				visitDTDElementReferenceContent((DTDElementReferenceContent) content);
-			}
-			else {
-				visitDTDEntityReferenceContent((DTDEntityReferenceContent) content);
-			} // end of else
-
-			// System.out.println("occurrence: " +
-			// (char)((DTDRepeatableContent)content).getOccurrence());
-		}
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDEmptyContentGen(DTDEmptyContent dtdEmptyContent) {
-
-		// System.out.println("content: EMPTY");
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDAnyContentGen(DTDAnyContent dtdAnyContent) {
-
-		// System.out.println("content: ANY");
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDPCDataContentGen(DTDPCDataContent pcDataContent) {
-
-		// System.out.println("content: PCDATA");
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDGroupContentGen(DTDGroupContent groupContent) {
-
-		if (groupContent.getGroupKind().getValue() == DTDGroupKind.SEQUENCE) {
-			// System.out.println("content: Sequence");
-		}
-		else // if (contentgetGroupKind() == DTDGroupKind.CHOICE)
-		{
-			// System.out.println("content: Choice");
-		}
-
-		Collection groupContents = groupContent.getContent();
-		for (Iterator i = groupContents.iterator(); i.hasNext();) {
-			visitDTDElementContent((DTDElementContent) i.next());
-		}
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDElementReferenceContentGen(DTDElementReferenceContent elementReferenceContent) {
-
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDEntityReferenceContentGen(DTDEntityReferenceContent entityReferenceContent) {
-
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDAttributeListGen(List attrs) {
-
-		Iterator iter = attrs.iterator();
-
-		while (iter.hasNext()) {
-			visitDTDAttribute((DTDAttribute) iter.next());
-		} // end of while ()
-	}
-
-	/**
-	 * @generated
-	 */
-	protected void visitDTDAttributeGen(DTDAttribute attribute) {
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/ExternalDTDModel.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/ExternalDTDModel.java
deleted file mode 100644
index 2476535..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/ExternalDTDModel.java
+++ /dev/null
@@ -1,85 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.emf.util;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.wst.dtd.core.internal.emf.DTDFile;
-
-
-/**
- * Load another DTD model - use when there is external entity references from
- * another model
- */
-public class ExternalDTDModel {
-	DTDFile dtdFile = null;
-
-	public ExternalDTDModel() {
-	}
-
-	public DTDFile getExternalDTDFile() {
-		return dtdFile;
-	}
-
-	/**
-	 * Load the DTD model specified by the uri e.g.
-	 * file:C:/eclipse/examples/purchaseorder.dtd
-	 */
-	public boolean loadModel(ResourceSet resources, String uri) {
-		boolean rc = true;
-
-		if (uri == null || uri.equals("")) { //$NON-NLS-1$
-			return false;
-		}
-
-		try {
-			// todo... Investigate why we can not create a new DTDUtil to load
-			// the external
-			// without breaking the bvt test bucket on the oagis cases.
-			// Are depending on mof's built in caching via
-			// resources.load(uri)?
-			//
-			URI uriObj = URI.createURI(uri);
-			Resource r = resources.createResource(uriObj);
-			Map options = new HashMap();
-			r.load(options);
-
-			for (Iterator i = resources.getResources().iterator(); i.hasNext();) {
-				DTDFile currentFile = (DTDFile) ((Resource) i.next()).getContents().get(0);
-				String currentURI = currentFile.eResource().getURI().toString();
-				// note : mof stores a slightly different uri than the one we
-				// passed in to resources.load(uri)
-				// In the 'file:' protocol case, the call
-				// resource.load("file:D:\x.dtd") will store a resource with
-				// uri "D:\x.dtd".
-				// This is why we use 'endswith()' instead of 'equals()' to
-				// compare.
-				if (uri.endsWith(currentURI)) {
-					dtdFile = currentFile;
-					break;
-				}
-			}
-			if (dtdFile == null) {
-				rc = false;
-			}
-		}
-		catch (Exception ex) {
-			rc = false;
-		}
-		return rc;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/rose/DTD.cat b/bundles/org.eclipse.wst.dtd.core/emfmodel/rose/DTD.cat
deleted file mode 100644
index 4097274..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/rose/DTD.cat
+++ /dev/null
@@ -1,3812 +0,0 @@
-
-(object Petal
-    version    	45
-    _written   	"Rose 7.5.0103.1920"
-    charSet    	0)
-
-(object Class_Category "dtd"
-    is_unit    	TRUE
-    is_loaded  	TRUE
-    attributes 	(list Attribute_Set
-	(object Attribute
-	    tool       	"IDL"
-	    name       	"uuid"
-	    value      	(value Text "DCE:935d5730-850b-11e1-0000-005cf4691c4c:1"))
-	(object Attribute
-	    tool       	"Ecore"
-	    name       	"packageName"
-	    value      	(value Text "dtd"))
-	(object Attribute
-	    tool       	"Ecore"
-	    name       	"basePackage"
-	    value      	(value Text "org.eclipse.wst.dtd"))
-	(object Attribute
-	    tool       	"Ecore"
-	    name       	"prefix"
-	    value      	(value Text "DTD")))
-    quid       	"3857B1C00293"
-    exportControl 	"Public"
-    logical_models 	(list unit_reference_list
-	(object Class "DTDElementContent"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:935d5730-850b-11e1-0001-005cf4691c4c:1")))
-	    quid       	"37CBEACF0213"
-	    abstract   	TRUE)
-	(object Class "DTDGroupContent"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:935eddd0-850b-11e1-0000-005cf4691c4c:1")))
-	    quid       	"37CBEAEF0232"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-0001-005cf4691c4c:1")))
-		    quid       	"37D9AD920363"
-		    supplier   	"Logical View::dtd::DTDRepeatableContent"
-		    quidu      	"37D9AD4C01D1"))
-	    class_attributes 	(list class_attribute_list
-		(object ClassAttribute "groupKind"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-0002-005cf4691c4c:1")))
-		    quid       	"37EFC9EC0189"
-		    type       	"DTDGroupKind"
-		    quidu      	"37EFCA550216"
-		    exportControl 	"Public")))
-	(object Class "DTDAttribute"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:935eddd0-850b-11e1-0003-005cf4691c4c:1")))
-	    quid       	"37CC187900EA"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-0004-005cf4691c4c:1")))
-		    quid       	"39B7F15901DA"
-		    supplier   	"Logical View::ecore::EAttribute"
-		    quidu      	"39238472039D"))
-	    class_attributes 	(list class_attribute_list
-		(object ClassAttribute "comment"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-0005-005cf4691c4c:1")))
-		    quid       	"3839DC9A013B"
-		    type       	"String"
-		    exportControl 	"Public")
-		(object ClassAttribute "defaultKind"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-0006-005cf4691c4c:1")))
-		    quid       	"37E144BF0261"
-		    type       	"DTDDefaultKind"
-		    quidu      	"37E144DC03AD"
-		    exportControl 	"Public")
-		(object ClassAttribute "defaultValueString"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-0007-005cf4691c4c:1")))
-		    quid       	"396B9BBF006B"
-		    type       	"String"
-		    exportControl 	"Public")))
-	(object Class "DTDOccurrenceType"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:935eddd0-850b-11e1-0008-005cf4691c4c:1")))
-	    quid       	"37CC19AF007D"
-	    documentation 	
-|ONE=49 
-|OPTIONAL=63 ONE_OR_MORE=43 ZERO_OR_MORE=42
-	    
-	    stereotype 	"enumeration")
-	(object Class "DTDElement"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:935eddd0-850b-11e1-0009-005cf4691c4c:1")))
-	    quid       	"37D9AAF70071"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-000a-005cf4691c4c:1")))
-		    quid       	"39B7F0AF02A8"
-		    supplier   	"Logical View::ecore::EClass"
-		    quidu      	"3903D5BF000A")
-		(object Inheritance_Relationship
-		    quid       	"39FE2B83029B"
-		    supplier   	"Logical View::dtd::DTDContent"
-		    quidu      	"39FE2B5E02DE"))
-	    class_attributes 	(list class_attribute_list
-		(object ClassAttribute "comment"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-000b-005cf4691c4c:1")))
-		    quid       	"3839DC810062"
-		    type       	"String"
-		    exportControl 	"Public")))
-	(object Class "DTDEmptyContent"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:935eddd0-850b-11e1-000c-005cf4691c4c:1")))
-	    quid       	"37D9AB47037A"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-000d-005cf4691c4c:1")))
-		    quid       	"37D9ABF30327"
-		    supplier   	"Logical View::dtd::DTDElementContent"
-		    quidu      	"37CBEACF0213")))
-	(object Class "DTDAnyContent"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:935eddd0-850b-11e1-000e-005cf4691c4c:1")))
-	    quid       	"37D9AB500304"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-000f-005cf4691c4c:1")))
-		    quid       	"37D9ABEE0207"
-		    supplier   	"Logical View::dtd::DTDElementContent"
-		    quidu      	"37CBEACF0213")))
-	(object Class "DTDPCDataContent"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:935eddd0-850b-11e1-0010-005cf4691c4c:1")))
-	    quid       	"37D9AB5C0135"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-0011-005cf4691c4c:1")))
-		    quid       	"37D9ABE90278"
-		    supplier   	"Logical View::dtd::DTDElementContent"
-		    quidu      	"37CBEACF0213")))
-	(object Class "DTDElementReferenceContent"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:935eddd0-850b-11e1-0012-005cf4691c4c:1")))
-	    quid       	"37D9AB7D0010"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-0013-005cf4691c4c:1")))
-		    quid       	"37D9AD8C03AA"
-		    supplier   	"Logical View::dtd::DTDRepeatableContent"
-		    quidu      	"37D9AD4C01D1")))
-	(object Class "DTDRepeatableContent"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:935eddd0-850b-11e1-0014-005cf4691c4c:1")))
-	    quid       	"37D9AD4C01D1"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-0015-005cf4691c4c:1")))
-		    quid       	"37D9ADB703C0"
-		    supplier   	"Logical View::dtd::DTDElementContent"
-		    quidu      	"37CBEACF0213"))
-	    class_attributes 	(list class_attribute_list
-		(object ClassAttribute "occurrence"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-0016-005cf4691c4c:1")))
-		    quid       	"37CC18A90148"
-		    documentation 	"JUST_ONE= -1  ONE_OR_MORE=43 OPTIONAL=63 ZERO_OR_MORE=42"
-		    type       	"DTDOccurrenceType"
-		    quidu      	"37CC19AF007D"
-		    exportControl 	"Public"))
-	    abstract   	TRUE)
-	(object Class "DTDFile"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:935eddd0-850b-11e1-0017-005cf4691c4c:1")))
-	    quid       	"37D9B08E018F"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-0018-005cf4691c4c:1")))
-		    quid       	"39B7F07F0118"
-		    supplier   	"Logical View::ecore::eNamedElement"
-		    quidu      	"3903D4EE0014"))
-	    class_attributes 	(list class_attribute_list
-		(object ClassAttribute "comment"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-0019-005cf4691c4c:1")))
-		    quid       	"3839DBEF012B"
-		    type       	"String"
-		    exportControl 	"Public")
-		(object ClassAttribute "parseError"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:935eddd0-850b-11e1-001a-005cf4691c4c:1")))
-		    quid       	"388C995F025B"
-		    type       	"boolean"
-		    exportControl 	"Public")))
-	(object Class "DTDDefaultKind"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:9361eb10-850b-11e1-0000-005cf4691c4c:1")))
-	    quid       	"37E144DC03AD"
-	    documentation 	"IMPLIED=1 REQUIRED=2 FIXED=3 NOFIXED=4"
-	    stereotype 	"enumeration")
-	(object Class "DTDBasicType"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:9361eb10-850b-11e1-0001-005cf4691c4c:1")))
-	    quid       	"37E1464F00DA"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:9361eb10-850b-11e1-0002-005cf4691c4c:1")))
-		    quid       	"39B7F2800315"
-		    supplier   	"Logical View::ecore::EClass"
-		    quidu      	"3903D5BF000A"))
-	    class_attributes 	(list class_attribute_list
-		(object ClassAttribute "kind"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:9361eb10-850b-11e1-0003-005cf4691c4c:1")))
-		    quid       	"37E1468A0016"
-		    type       	"DTDBasicTypeKind"
-		    quidu      	"37E14905022C"
-		    exportControl 	"Public")))
-	(object Class "DTDEnumerationType"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:9361eb10-850b-11e1-0004-005cf4691c4c:1")))
-	    quid       	"37E146680306"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:9361eb10-850b-11e1-0005-005cf4691c4c:1")))
-		    quid       	"39B7F2810302"
-		    supplier   	"Logical View::ecore::EEnum"
-		    quidu      	"39A473E901D4"))
-	    class_attributes 	(list class_attribute_list
-		(object ClassAttribute "kind"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:9361eb10-850b-11e1-0006-005cf4691c4c:1")))
-		    quid       	"37E146AC03B8"
-		    type       	"DTDEnumGroupKind"
-		    quidu      	"37E149B201AD"
-		    exportControl 	"Public")))
-	(object Class "DTDBasicTypeKind"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:9361eb10-850b-11e1-0007-005cf4691c4c:1")))
-	    quid       	"37E14905022C"
-	    documentation 	"NONE=0 CDATA=1 ID=2 IDREF=3 IDREFS=4 ENTITY=5 ENTITIES=6 NMTOKEN=7 NMTOKENS=8"
-	    stereotype 	"enumeration")
-	(object Class "DTDEnumGroupKind"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:9361eb10-850b-11e1-0008-005cf4691c4c:1")))
-	    quid       	"37E149B201AD"
-	    documentation 	"NAME_TOKEN_GROUP=1 NOTATION_GROUP=2"
-	    stereotype 	"enumeration")
-	(object Class "DTDGroupKind"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:9361eb10-850b-11e1-0009-005cf4691c4c:1")))
-	    quid       	"37EFCA550216"
-	    documentation 	"SEQUENCE=1 CHOICE=2"
-	    stereotype 	"enumeration")
-	(object Class "DTDNotation"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:9361eb10-850b-11e1-000a-005cf4691c4c:1")))
-	    quid       	"37EFD0EF00C9"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:9361eb10-850b-11e1-000b-005cf4691c4c:1")))
-		    quid       	"39B7F0E30234"
-		    supplier   	"Logical View::ecore::eNamedElement"
-		    quidu      	"3903D4EE0014")
-		(object Inheritance_Relationship
-		    quid       	"39FE2B850118"
-		    supplier   	"Logical View::dtd::DTDContent"
-		    quidu      	"39FE2B5E02DE"))
-	    class_attributes 	(list class_attribute_list
-		(object ClassAttribute "comment"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:9361eb10-850b-11e1-000c-005cf4691c4c:1")))
-		    quid       	"3839DC0A024C"
-		    type       	"String"
-		    exportControl 	"Public")
-		(object ClassAttribute "systemID"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:9361eb10-850b-11e1-000d-005cf4691c4c:1")))
-		    quid       	"37EFD1020397"
-		    type       	"string"
-		    exportControl 	"Public")
-		(object ClassAttribute "publicID"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:9361eb10-850b-11e1-000e-005cf4691c4c:1")))
-		    quid       	"37EFD10E018C"
-		    type       	"string"
-		    exportControl 	"Public")))
-	(object Class "DTDEntity"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:9361eb10-850b-11e1-000f-005cf4691c4c:1")))
-	    quid       	"37EFD12B03C8"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:9361eb10-850b-11e1-0010-005cf4691c4c:1")))
-		    quid       	"39B7F0E701EA"
-		    supplier   	"Logical View::ecore::eNamedElement"
-		    quidu      	"3903D4EE0014")
-		(object Inheritance_Relationship
-		    quid       	"39FE2B860304"
-		    supplier   	"Logical View::dtd::DTDContent"
-		    quidu      	"39FE2B5E02DE"))
-	    class_attributes 	(list class_attribute_list
-		(object ClassAttribute "comment"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:9361eb10-850b-11e1-0011-005cf4691c4c:1")))
-		    quid       	"3839DC37008E"
-		    type       	"String"
-		    exportControl 	"Public")
-		(object ClassAttribute "parameterEntity"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:9361eb10-850b-11e1-0012-005cf4691c4c:1")))
-		    quid       	"37EFD13C017E"
-		    type       	"boolean"
-		    exportControl 	"Public")))
-	(object Class "DTDEntityContent"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:9361eb10-850b-11e1-0013-005cf4691c4c:1")))
-	    quid       	"37EFD19D0083"
-	    abstract   	TRUE)
-	(object Class "DTDExternalEntity"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:9361eb10-850b-11e1-0014-005cf4691c4c:1")))
-	    quid       	"37EFD1F803E1"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:9361eb10-850b-11e1-0015-005cf4691c4c:1")))
-		    quid       	"37EFD32400F3"
-		    supplier   	"Logical View::dtd::DTDEntityContent"
-		    quidu      	"37EFD19D0083"))
-	    class_attributes 	(list class_attribute_list
-		(object ClassAttribute "systemID"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0000-005cf4691c4c:1")))
-		    quid       	"37EFD2E50161"
-		    type       	"string"
-		    exportControl 	"Public")
-		(object ClassAttribute "publicID"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0001-005cf4691c4c:1")))
-		    quid       	"37EFD2EC01F7"
-		    type       	"string"
-		    exportControl 	"Public")))
-	(object Class "DTDInternalEntity"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-0002-005cf4691c4c:1")))
-	    quid       	"37EFD2BA026E"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0003-005cf4691c4c:1")))
-		    quid       	"37EFD32B032E"
-		    supplier   	"Logical View::dtd::DTDEntityContent"
-		    quidu      	"37EFD19D0083"))
-	    class_attributes 	(list class_attribute_list
-		(object ClassAttribute "value"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0004-005cf4691c4c:1")))
-		    quid       	"37EFD2CB0268"
-		    type       	"string"
-		    exportControl 	"Public")))
-	(object Class "DTDParameterEntityReference"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-0005-005cf4691c4c:1")))
-	    quid       	"385287CA0163"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0006-005cf4691c4c:1")))
-		    quid       	"39B7F0D10076"
-		    supplier   	"Logical View::ecore::eNamedElement"
-		    quidu      	"3903D4EE0014")
-		(object Inheritance_Relationship
-		    quid       	"39FE2B8A0287"
-		    supplier   	"Logical View::dtd::DTDContent"
-		    quidu      	"39FE2B5E02DE")))
-	(object Class "DTDEntityReferenceContent"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-0007-005cf4691c4c:1")))
-	    quid       	"3852900E0127"
-	    superclasses 	(list inheritance_relationship_list
-		(object Inheritance_Relationship
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0008-005cf4691c4c:1")))
-		    quid       	"38529044011B"
-		    supplier   	"Logical View::dtd::DTDRepeatableContent"
-		    quidu      	"37D9AD4C01D1")))
-	(object Class "XMLSchemaDefinedType"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-0009-005cf4691c4c:1")))
-	    quid       	"389F0C6D010E"
-	    documentation 	
-|NONE=-1
-|STRING=1
-|BOOLEAN=2
-|FLOAT=3
-|DOUBLE=4
-|DECIMAL=5
-|TIMEINSTANT=6
-|TIMEDURATION=7
-|RECURRINGINSTANT=8
-|BINARY=9
-|URI=10
-|INTEGER=11
-|DATE=12
-|TIME=13
-	    
-	    stereotype 	"enumeration")
-	(object Class "DTDContent"
-	    quid       	"39FE2B5E02DE"
-	    abstract   	TRUE)
-	(object Association "$UNNAMED$0"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-000a-005cf4691c4c:1")))
-	    quid       	"37CBEB6F005D"
-	    roles      	(list role_list
-		(object Role "content"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-000b-005cf4691c4c:1")))
-		    quid       	"37CBEB70006D"
-		    label      	"content"
-		    supplier   	"Logical View::dtd::DTDElementContent"
-		    quidu      	"37CBEACF0213"
-		    client_cardinality 	(value cardinality "1..n")
-		    Constraints 	"ordered"
-		    Containment 	"By Value"
-		    is_navigable 	TRUE)
-		(object Role "group"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-000c-005cf4691c4c:1")))
-		    quid       	"37CBEB7000AB"
-		    label      	"group"
-		    supplier   	"Logical View::dtd::DTDGroupContent"
-		    quidu      	"37CBEAEF0232"
-		    client_cardinality 	(value cardinality "0..1")
-		    is_navigable 	TRUE
-		    is_aggregate 	TRUE)))
-	(object Association "$UNNAMED$1"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-000d-005cf4691c4c:1")))
-	    quid       	"37D9AC0E00CD"
-	    roles      	(list role_list
-		(object Role "element"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-000e-005cf4691c4c:1")))
-		    quid       	"37D9AC0F039F"
-		    label      	"element"
-		    supplier   	"Logical View::dtd::DTDElement"
-		    quidu      	"37D9AAF70071"
-		    client_cardinality 	(value cardinality "0..1")
-		    is_navigable 	TRUE
-		    is_aggregate 	TRUE)
-		(object Role "content"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-000f-005cf4691c4c:1")))
-		    quid       	"37D9AC0F03A9"
-		    label      	"content"
-		    supplier   	"Logical View::dtd::DTDElementContent"
-		    quidu      	"37CBEACF0213"
-		    client_cardinality 	(value cardinality "1")
-		    Containment 	"By Value"
-		    is_navigable 	TRUE)))
-	(object Association "$UNNAMED$2"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-0010-005cf4691c4c:1")))
-	    quid       	"37D9AF11001A"
-	    roles      	(list role_list
-		(object Role "elementReference"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0011-005cf4691c4c:1")))
-		    quid       	"37D9AF1B0209"
-		    label      	"elementReference"
-		    supplier   	"Logical View::dtd::DTDElementReferenceContent"
-		    quidu      	"37D9AB7D0010"
-		    client_cardinality 	(value cardinality "0..n"))
-		(object Role "referencedElement"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0012-005cf4691c4c:1")))
-		    quid       	"37D9AF1B020A"
-		    label      	"referencedElement"
-		    supplier   	"Logical View::dtd::DTDElement"
-		    quidu      	"37D9AAF70071"
-		    client_cardinality 	(value cardinality "1")
-		    is_navigable 	TRUE)))
-	(object Association "$UNNAMED$3"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-0013-005cf4691c4c:1")))
-	    quid       	"37EFD1C902DF"
-	    roles      	(list role_list
-		(object Role "$UNNAMED$4"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0014-005cf4691c4c:1")))
-		    quid       	"37EFD1CA031D"
-		    supplier   	"Logical View::dtd::DTDEntity"
-		    quidu      	"37EFD12B03C8"
-		    is_navigable 	TRUE
-		    is_aggregate 	TRUE)
-		(object Role "content"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0015-005cf4691c4c:1")))
-		    quid       	"37EFD1CA0327"
-		    label      	"content"
-		    supplier   	"Logical View::dtd::DTDEntityContent"
-		    quidu      	"37EFD19D0083"
-		    client_cardinality 	(value cardinality "1")
-		    Containment 	"By Value"
-		    is_navigable 	TRUE)))
-	(object Association "$UNNAMED$5"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-0016-005cf4691c4c:1")))
-	    quid       	"37EFD34400E5"
-	    roles      	(list role_list
-		(object Role "notation"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0017-005cf4691c4c:1"))
-			(object Attribute
-			    tool       	"eCore"
-			    name       	"isTransient"
-			    value      	TRUE)
-			(object Attribute
-			    tool       	"Ecore"
-			    name       	"isTransient"
-			    value      	TRUE))
-		    quid       	"37EFD3450209"
-		    label      	"notation"
-		    supplier   	"Logical View::dtd::DTDNotation"
-		    quidu      	"37EFD0EF00C9"
-		    client_cardinality 	(value cardinality "0..1")
-		    is_navigable 	TRUE)
-		(object Role "entity"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0018-005cf4691c4c:1")))
-		    quid       	"37EFD3450213"
-		    label      	"entity"
-		    supplier   	"Logical View::dtd::DTDExternalEntity"
-		    quidu      	"37EFD1F803E1"
-		    client_cardinality 	(value cardinality "0..n")
-		    is_navigable 	TRUE)))
-	(object Association "$UNNAMED$6"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-0019-005cf4691c4c:1")))
-	    quid       	"38528979005F"
-	    roles      	(list role_list
-		(object Role "parmEntityRef"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-001a-005cf4691c4c:1")))
-		    quid       	"3852897C0352"
-		    label      	"parmEntityRef"
-		    supplier   	"Logical View::dtd::DTDParameterEntityReference"
-		    quidu      	"385287CA0163"
-		    client_cardinality 	(value cardinality "1")
-		    is_navigable 	TRUE)
-		(object Role "entity"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-001b-005cf4691c4c:1")))
-		    quid       	"3852897C0353"
-		    label      	"entity"
-		    supplier   	"Logical View::dtd::DTDEntity"
-		    quidu      	"37EFD12B03C8"
-		    client_cardinality 	(value cardinality "1")
-		    is_navigable 	TRUE)))
-	(object Association "$UNNAMED$7"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-001c-005cf4691c4c:1")))
-	    quid       	"385294EB0243"
-	    roles      	(list role_list
-		(object Role "entityReference"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-001d-005cf4691c4c:1"))
-			(object Attribute
-			    tool       	"eCore"
-			    name       	"isTransient"
-			    value      	TRUE))
-		    quid       	"385294EF03BB"
-		    label      	"entityReference"
-		    supplier   	"Logical View::dtd::DTDEntityReferenceContent"
-		    quidu      	"3852900E0127"
-		    client_cardinality 	(value cardinality "0..n")
-		    is_navigable 	TRUE)
-		(object Role "elementReferencedEntity"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-001e-005cf4691c4c:1")))
-		    quid       	"385294EF03BC"
-		    label      	"elementReferencedEntity"
-		    supplier   	"Logical View::dtd::DTDEntity"
-		    quidu      	"37EFD12B03C8"
-		    client_cardinality 	(value cardinality "1")
-		    is_navigable 	TRUE)))
-	(object Association "$UNNAMED$8"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-001f-005cf4691c4c:1")))
-	    quid       	"3852972D02CB"
-	    roles      	(list role_list
-		(object Role "attributeNameReference"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0020-005cf4691c4c:1"))
-			(object Attribute
-			    tool       	"eCore"
-			    name       	"isTransient"
-			    value      	TRUE))
-		    quid       	"385297360291"
-		    label      	"attributeNameReference"
-		    supplier   	"Logical View::dtd::DTDAttribute"
-		    quidu      	"37CC187900EA"
-		    client_cardinality 	(value cardinality "0..n")
-		    is_navigable 	TRUE)
-		(object Role "attributeNameReferencedEntity"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0021-005cf4691c4c:1")))
-		    quid       	"38529736029B"
-		    label      	"attributeNameReferencedEntity"
-		    supplier   	"Logical View::dtd::DTDEntity"
-		    quidu      	"37EFD12B03C8"
-		    client_cardinality 	(value cardinality "0..1")
-		    is_navigable 	TRUE)))
-	(object Association "$UNNAMED$9"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-0022-005cf4691c4c:1")))
-	    quid       	"38B68A7302B8"
-	    roles      	(list role_list
-		(object Role "$UNNAMED$10"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0023-005cf4691c4c:1")))
-		    quid       	"38B68A780084"
-		    supplier   	"Logical View::dtd::DTDExternalEntity"
-		    quidu      	"37EFD1F803E1")
-		(object Role "entityReferencedFromAnotherFile"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0024-005cf4691c4c:1")))
-		    quid       	"38B68A78008E"
-		    label      	"entityReferencedFromAnotherFile"
-		    supplier   	"Logical View::dtd::DTDFile"
-		    quidu      	"37D9B08E018F"
-		    client_cardinality 	(value cardinality "0..1")
-		    is_navigable 	TRUE)))
-	(object Association "$UNNAMED$11"
-	    attributes 	(list Attribute_Set
-		(object Attribute
-		    tool       	"IDL"
-		    name       	"uuid"
-		    value      	(value Text "DCE:936371b0-850b-11e1-0025-005cf4691c4c:1")))
-	    quid       	"38BD4908013D"
-	    roles      	(list role_list
-		(object Role "attributeTypeReference"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0026-005cf4691c4c:1"))
-			(object Attribute
-			    tool       	"eCore"
-			    name       	"isTransient"
-			    value      	TRUE))
-		    quid       	"38BD49140130"
-		    label      	"attributeTypeReference"
-		    supplier   	"Logical View::dtd::DTDAttribute"
-		    quidu      	"37CC187900EA"
-		    client_cardinality 	(value cardinality "0..n")
-		    is_navigable 	TRUE)
-		(object Role "attributeTypeReferencedEntity"
-		    attributes 	(list Attribute_Set
-			(object Attribute
-			    tool       	"IDL"
-			    name       	"uuid"
-			    value      	(value Text "DCE:936371b0-850b-11e1-0027-005cf4691c4c:1")))
-		    quid       	"38BD4914014E"
-		    label      	"attributeTypeReferencedEntity"
-		    supplier   	"Logical View::dtd::DTDEntity"
-		    quidu      	"37EFD12B03C8"
-		    client_cardinality 	(value cardinality "0..1")
-		    is_navigable 	TRUE)))
-	(object Association "$UNNAMED$12"
-	    quid       	"39FE2A9500CC"
-	    roles      	(list role_list
-		(object Role "$UNNAMED$13"
-		    quid       	"39FE2A950311"
-		    supplier   	"Logical View::dtd::DTDElement"
-		    quidu      	"37D9AAF70071"
-		    is_navigable 	TRUE
-		    is_aggregate 	TRUE)
-		(object Role "$UNNAMED$14"
-		    quid       	"39FE2A95031B"
-		    supplier   	"Logical View::dtd::DTDAttribute"
-		    quidu      	"37CC187900EA"
-		    client_cardinality 	(value cardinality "0..n")
-		    Containment 	"By Value"
-		    is_navigable 	TRUE)))
-	(object Association "$UNNAMED$15"
-	    quid       	"39FE2BBE02DC"
-	    roles      	(list role_list
-		(object Role "$UNNAMED$16"
-		    quid       	"39FE2BBF01B1"
-		    supplier   	"Logical View::dtd::DTDFile"
-		    quidu      	"37D9B08E018F"
-		    is_navigable 	TRUE
-		    is_aggregate 	TRUE)
-		(object Role "$UNNAMED$17"
-		    quid       	"39FE2BBF01BB"
-		    supplier   	"Logical View::dtd::DTDContent"
-		    quidu      	"39FE2B5E02DE"
-		    client_cardinality 	(value cardinality "0..n")
-		    Containment 	"By Value"
-		    is_navigable 	TRUE)))
-	(object Association "$UNNAMED$18"
-	    quid       	"39FE30D8033E"
-	    roles      	(list role_list
-		(object Role "$UNNAMED$19"
-		    quid       	"39FE30D90105"
-		    supplier   	"Logical View::dtd::DTDFile"
-		    quidu      	"37D9B08E018F"
-		    is_navigable 	TRUE
-		    is_aggregate 	TRUE)
-		(object Role "$UNNAMED$20"
-		    quid       	"39FE30D90137"
-		    supplier   	"Logical View::dtd::DTDEnumerationType"
-		    quidu      	"37E146680306"
-		    client_cardinality 	(value cardinality "0..n")
-		    Containment 	"By Value"
-		    is_navigable 	TRUE))))
-    logical_presentations 	(list unit_reference_list
-	(object ClassDiagram "Main"
-	    quid       	"37CAB0E60177"
-	    title      	"Main"
-	    zoom       	98
-	    max_height 	28350
-	    max_width  	21600
-	    origin_x   	0
-	    origin_y   	0
-	    items      	(list diagram_item_list
-		(object NoteView @1
-		    location   	(3264, 240)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@1
-			location   	(2910, 65)
-			fill_color 	13434879
-			nlines     	7
-			max_width  	673
-			label      	
-|DTDElement's, 
-|DTDParameterEntityReference's, DTDEntity's, and DTDNotation's are added to DTDFile's using the
-|ownedElement relationship
-|between MOFNamespace
-|and MOFObject
-			)
-		    line_color 	3342489
-		    fill_color 	13434879
-		    width      	733
-		    height     	363)
-		(object ClassView "Class" "Logical View::dtd::DTDInternalEntity" @2
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(1824, 1872)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@2
-			location   	(1647, 1817)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	354
-			justify    	0
-			label      	"DTDInternalEntity")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37EFD2BA026E"
-		    width      	372
-		    height     	134
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object ClassView "Class" "Logical View::dtd::DTDElement" @3
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(592, 1200)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@3
-			location   	(417, 1145)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	350
-			justify    	0
-			label      	"DTDElement")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37D9AAF70071"
-		    compartment 	(object Compartment
-			Parent_View 	@3
-			location   	(417, 1204)
-			font       	(object Font
-			    size       	10
-			    face       	"Arial"
-			    bold       	FALSE
-			    italics    	FALSE
-			    underline  	FALSE
-			    strike     	FALSE
-			    color      	0
-			    default_color 	TRUE)
-			icon_style 	"Icon"
-			fill_color 	16777215
-			anchor     	2
-			nlines     	1
-			max_width  	371)
-		    width      	368
-		    height     	134
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object ClassView "Class" "Logical View::dtd::DTDEntityContent" @4
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(1520, 1488)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	TRUE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@4
-			location   	(1341, 1438)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	358
-			justify    	0
-			label      	"DTDEntityContent")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37EFD19D0083"
-		    width      	376
-		    height     	124
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object InheritTreeView "" @5
-		    location   	(1520, 1640)
-		    line_color 	3342489
-		    fill_color 	13434879
-		    supplier   	@4
-		    vertices   	(list Points
-			(1520, 1640)
-			(1520, 1550)))
-		(object ClassView "Class" "Logical View::dtd::DTDParameterEntityReference" @6
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(2480, 1216)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@6
-			location   	(2186, 1166)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	588
-			justify    	0
-			label      	"DTDParameterEntityReference")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"385287CA0163"
-		    width      	606
-		    height     	124
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object ClassView "Class" "Logical View::dtd::DTDEntity" @7
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(1520, 1216)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@7
-			location   	(1270, 1137)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	500
-			justify    	0
-			label      	"DTDEntity")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37EFD12B03C8"
-		    compartment 	(object Compartment
-			Parent_View 	@7
-			location   	(1270, 1196)
-			font       	(object Font
-			    size       	10
-			    face       	"Arial"
-			    bold       	FALSE
-			    italics    	FALSE
-			    underline  	FALSE
-			    strike     	FALSE
-			    color      	0
-			    default_color 	TRUE)
-			icon_style 	"Icon"
-			fill_color 	16777215
-			anchor     	2
-			nlines     	2
-			max_width  	525)
-		    width      	518
-		    height     	182
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object AssociationViewNew "$UNNAMED$3" @8
-		    location   	(1546, 1366)
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"37EFD1C902DF"
-		    roleview_list 	(list RoleViews
-			(object RoleView "$UNNAMED$4" @9
-			    Parent_View 	@8
-			    location   	(-54, 246)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"37EFD1CA031D"
-			    client     	@8
-			    supplier   	@7
-			    line_style 	3
-			    origin_attachment 	(1546, 1366)
-			    terminal_attachment 	(1546, 1307))
-			(object RoleView "content" @10
-			    Parent_View 	@8
-			    location   	(-54, 246)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @11
-				Parent_View 	@10
-				location   	(1443, 1407)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	191
-				justify    	0
-				label      	"+content"
-				pctDist    	0.699248
-				height     	104
-				orientation 	1)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"37EFD1CA0327"
-			    client     	@8
-			    supplier   	@4
-			    line_style 	3
-			    origin_attachment 	(1546, 1366)
-			    terminal_attachment 	(1546, 1426)
-			    label      	(object SegLabel @12
-				Parent_View 	@10
-				location   	(1568, 1408)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"1"
-				pctDist    	0.721804
-				height     	22
-				orientation 	0))))
-		(object AssociationViewNew "$UNNAMED$6" @13
-		    location   	(1978, 1256)
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"38528979005F"
-		    roleview_list 	(list RoleViews
-			(object RoleView "parmEntityRef" @14
-			    Parent_View 	@13
-			    location   	(602, 488)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @15
-				Parent_View 	@14
-				location   	(2038, 1299)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	328
-				justify    	0
-				label      	"+parmEntityRef"
-				pctDist    	0.305419
-				height     	43
-				orientation 	1)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"3852897C0352"
-			    client     	@13
-			    supplier   	@6
-			    line_style 	3
-			    origin_attachment 	(1978, 1256)
-			    terminal_attachment 	(2177, 1256)
-			    label      	(object SegLabel @16
-				Parent_View 	@14
-				location   	(2141, 1228)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"1"
-				pctDist    	0.826484
-				height     	29
-				orientation 	0))
-			(object RoleView "entity" @17
-			    Parent_View 	@13
-			    location   	(602, 488)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @18
-				Parent_View 	@17
-				location   	(1862, 1217)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	150
-				justify    	0
-				label      	"+entity"
-				pctDist    	0.589109
-				height     	40
-				orientation 	1)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"3852897C0353"
-			    client     	@13
-			    supplier   	@7
-			    line_style 	3
-			    origin_attachment 	(1978, 1256)
-			    terminal_attachment 	(1779, 1256)
-			    label      	(object SegLabel @19
-				Parent_View 	@17
-				location   	(1823, 1309)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"1"
-				pctDist    	0.776923
-				height     	53
-				orientation 	0))))
-		(object ClassView "Class" "Logical View::ecore::eNamedElement" @20
-		    ShowCompartmentStereotypes 	TRUE
-		    location   	(1488, 176)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	TRUE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@20
-			location   	(1352, 131)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	272
-			justify    	0
-			label      	"eNamedElement")
-		    icon_style 	"Icon"
-		    line_color 	12615680
-		    fill_color 	16777175
-		    quidu      	"3903D4EE0014"
-		    width      	290
-		    height     	115
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object ClassView "Class" "Logical View::ecore::EClass" @21
-		    ShowCompartmentStereotypes 	TRUE
-		    location   	(576, 960)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@21
-			location   	(492, 863)
-			fill_color 	13434879
-			nlines     	2
-			max_width  	168
-			justify    	0
-			label      	"EClass")
-		    icon_style 	"Icon"
-		    line_color 	12615680
-		    fill_color 	16777175
-		    quidu      	"3903D5BF000A"
-		    width      	186
-		    height     	218
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object InheritView "" @22
-		    stereotype 	TRUE
-		    line_color 	12615680
-		    quidu      	"39B7F0AF02A8"
-		    client     	@3
-		    supplier   	@21
-		    line_style 	3
-		    origin_attachment 	(571, 1132)
-		    terminal_attachment 	(571, 1069))
-		(object ClassView "Class" "Logical View::ecore::eNamedElement" @23
-		    ShowCompartmentStereotypes 	TRUE
-		    location   	(2560, 864)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	TRUE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@23
-			location   	(2424, 819)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	272
-			justify    	0
-			label      	"eNamedElement")
-		    icon_style 	"Icon"
-		    line_color 	12615680
-		    fill_color 	16777175
-		    quidu      	"3903D4EE0014"
-		    width      	290
-		    height     	115
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object InheritTreeView "" @24
-		    location   	(2560, 1036)
-		    line_color 	12615680
-		    fill_color 	13434879
-		    supplier   	@23
-		    vertices   	(list Points
-			(2560, 1036)
-			(2560, 921)))
-		(object InheritView "" @25
-		    stereotype 	TRUE
-		    line_color 	12615680
-		    quidu      	"39B7F0E701EA"
-		    client     	@7
-		    supplier   	@23
-		    line_style 	3
-		    origin_attachment 	(1669, 1125)
-		    terminal_attachment 	(1669, 1036)
-		    drawSupplier 	@24)
-		(object InheritView "" @26
-		    stereotype 	TRUE
-		    line_color 	12615680
-		    quidu      	"39B7F0D10076"
-		    client     	@6
-		    supplier   	@23
-		    line_style 	3
-		    origin_attachment 	(2618, 1153)
-		    terminal_attachment 	(2618, 1036)
-		    drawSupplier 	@24)
-		(object ClassView "Class" "Logical View::dtd::DTDNotation" @27
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(992, 1232)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@27
-			location   	(817, 1129)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	350
-			justify    	0
-			label      	"DTDNotation")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37EFD0EF00C9"
-		    compartment 	(object Compartment
-			Parent_View 	@27
-			location   	(817, 1188)
-			font       	(object Font
-			    size       	10
-			    face       	"Arial"
-			    bold       	FALSE
-			    italics    	FALSE
-			    underline  	FALSE
-			    strike     	FALSE
-			    color      	0
-			    default_color 	TRUE)
-			icon_style 	"Icon"
-			fill_color 	16777215
-			anchor     	2
-			nlines     	3
-			max_width  	371)
-		    width      	368
-		    height     	230
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object ClassView "Class" "Logical View::dtd::DTDExternalEntity" @28
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(1344, 1872)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@28
-			location   	(1158, 1793)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	372
-			justify    	0
-			label      	"DTDExternalEntity")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37EFD1F803E1"
-		    width      	390
-		    height     	182
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object AssociationViewNew "$UNNAMED$5" @29
-		    location   	(969, 1677)
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"37EFD34400E5"
-		    roleview_list 	(list RoleViews
-			(object RoleView "notation" @30
-			    Parent_View 	@29
-			    location   	(-247, 205)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @31
-				Parent_View 	@30
-				location   	(834, 1390)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	203
-				justify    	0
-				label      	"+notation"
-				pctDist    	0.870734
-				height     	136
-				orientation 	0)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"37EFD3450209"
-			    client     	@29
-			    supplier   	@27
-			    line_style 	3
-			    origin_attachment 	(969, 1677)
-			    terminal_attachment 	(969, 1347)
-			    label      	(object SegLabel @32
-				Parent_View 	@30
-				location   	(1040, 1388)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	72
-				justify    	0
-				label      	"0..1"
-				pctDist    	0.877934
-				height     	71
-				orientation 	1))
-			(object RoleView "entity" @33
-			    Parent_View 	@29
-			    location   	(-247, 205)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @34
-				Parent_View 	@33
-				location   	(1082, 1786)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	150
-				justify    	0
-				label      	"+entity"
-				pctDist    	0.800000
-				height     	42
-				orientation 	0)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"37EFD3450213"
-			    client     	@29
-			    supplier   	@28
-			    vertices   	(list Points
-				(969, 1677)
-				(969, 1827)
-				(1149, 1827))
-			    line_style 	3
-			    origin_attachment 	(969, 1677)
-			    terminal_attachment 	(1149, 1827)
-			    label      	(object SegLabel @35
-				Parent_View 	@33
-				location   	(1104, 1853)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"0..n"
-				pctDist    	0.863501
-				height     	26
-				orientation 	1))))
-		(object InheritView "" @36
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"37EFD32400F3"
-		    client     	@28
-		    supplier   	@4
-		    line_style 	3
-		    origin_attachment 	(1274, 1781)
-		    terminal_attachment 	(1274, 1640)
-		    drawSupplier 	@5)
-		(object ClassView "Class" "Logical View::dtd::DTDContent" @37
-		    ShowCompartmentStereotypes 	TRUE
-		    location   	(1472, 800)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	TRUE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@37
-			location   	(1344, 750)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	256
-			justify    	0
-			label      	"DTDContent")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"39FE2B5E02DE"
-		    width      	274
-		    height     	124
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object InheritTreeView "" @38
-		    location   	(1472, 990)
-		    line_color 	3342489
-		    fill_color 	13434879
-		    supplier   	@37
-		    vertices   	(list Points
-			(1472, 990)
-			(1472, 862)))
-		(object InheritView "" @39
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"39FE2B83029B"
-		    client     	@3
-		    supplier   	@37
-		    line_style 	3
-		    origin_attachment 	(719, 1132)
-		    terminal_attachment 	(719, 990)
-		    drawSupplier 	@38)
-		(object InheritView "" @40
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"39FE2B860304"
-		    client     	@7
-		    supplier   	@37
-		    line_style 	3
-		    origin_attachment 	(1452, 1124)
-		    terminal_attachment 	(1452, 990)
-		    drawSupplier 	@38)
-		(object InheritView "" @41
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"39FE2B8A0287"
-		    client     	@6
-		    supplier   	@37
-		    line_style 	3
-		    origin_attachment 	(2347, 1154)
-		    terminal_attachment 	(2347, 990)
-		    drawSupplier 	@38)
-		(object ClassView "Class" "Logical View::dtd::DTDFile" @42
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(1488, 448)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@42
-			location   	(1281, 369)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	414
-			justify    	0
-			label      	"DTDFile")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37D9B08E018F"
-		    compartment 	(object Compartment
-			Parent_View 	@42
-			location   	(1281, 428)
-			font       	(object Font
-			    size       	10
-			    face       	"Arial"
-			    bold       	FALSE
-			    italics    	FALSE
-			    underline  	FALSE
-			    strike     	FALSE
-			    color      	0
-			    default_color 	TRUE)
-			icon_style 	"Icon"
-			fill_color 	16777215
-			anchor     	2
-			nlines     	2
-			max_width  	425)
-		    width      	432
-		    height     	182
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object AssociationViewNew "$UNNAMED$9" @43
-		    location   	(354, 1049)
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"38B68A7302B8"
-		    roleview_list 	(list RoleViews
-			(object RoleView "$UNNAMED$10" @44
-			    Parent_View 	@43
-			    location   	(-109, 207)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"38B68A780084"
-			    client     	@43
-			    supplier   	@28
-			    vertices   	(list Points
-				(354, 1049)
-				(354, 1781)
-				(1149, 1781))
-			    line_style 	3
-			    origin_attachment 	(354, 1049)
-			    terminal_attachment 	(1149, 1781))
-			(object RoleView "entityReferencedFromAnotherFile" @45
-			    Parent_View 	@43
-			    location   	(-109, 207)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @46
-				Parent_View 	@45
-				location   	(296, 4537)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	732
-				justify    	0
-				label      	"+entityReferencedFromAnotherFile"
-				pctDist    	-2.283333
-				height     	59
-				orientation 	0)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"38B68A78008E"
-			    client     	@43
-			    supplier   	@42
-			    vertices   	(list Points
-				(354, 1049)
-				(354, 439)
-				(1272, 439))
-			    line_style 	3
-			    origin_attachment 	(354, 1049)
-			    terminal_attachment 	(1272, 439)
-			    label      	(object SegLabel @47
-				Parent_View 	@45
-				location   	(1206, 500)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"0..1"
-				pctDist    	0.957129
-				height     	61
-				orientation 	1))))
-		(object InheritView "" @48
-		    stereotype 	TRUE
-		    line_color 	12615680
-		    quidu      	"39B7F07F0118"
-		    client     	@42
-		    supplier   	@20
-		    line_style 	3
-		    origin_attachment 	(1488, 357)
-		    terminal_attachment 	(1488, 233))
-		(object AssociationViewNew "$UNNAMED$15" @49
-		    location   	(1472, 638)
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"39FE2BBE02DC"
-		    roleview_list 	(list RoleViews
-			(object RoleView "$UNNAMED$16" @50
-			    Parent_View 	@49
-			    location   	(0, -162)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"39FE2BBF01B1"
-			    client     	@49
-			    supplier   	@42
-			    line_style 	3
-			    origin_attachment 	(1472, 638)
-			    terminal_attachment 	(1472, 539))
-			(object RoleView "$UNNAMED$17" @51
-			    Parent_View 	@49
-			    location   	(0, -162)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"39FE2BBF01BB"
-			    client     	@49
-			    supplier   	@37
-			    line_style 	3
-			    origin_attachment 	(1472, 638)
-			    terminal_attachment 	(1472, 738)
-			    label      	(object SegLabel @52
-				Parent_View 	@51
-				location   	(1526, 712)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"0..n"
-				pctDist    	0.736248
-				height     	54
-				orientation 	0))))
-		(object ClassView "Class" "Logical View::dtd::DTDEnumerationType" @53
-		    ShowCompartmentStereotypes 	TRUE
-		    IncludeAttribute 	TRUE
-		    location   	(2448, 464)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@53
-			location   	(2184, 385)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	528
-			justify    	0
-			label      	"DTDEnumerationType")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37E146680306"
-		    compartment 	(object Compartment
-			Parent_View 	@53
-			location   	(2184, 444)
-			font       	(object Font
-			    size       	10
-			    face       	"Arial"
-			    bold       	FALSE
-			    italics    	FALSE
-			    underline  	FALSE
-			    strike     	FALSE
-			    color      	0
-			    default_color 	TRUE)
-			icon_style 	"Icon"
-			fill_color 	16777215
-			anchor     	2
-			nlines     	2
-			max_width  	546)
-		    width      	546
-		    height     	182
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object AssociationViewNew "$UNNAMED$18" @54
-		    location   	(1939, 449)
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"39FE30D8033E"
-		    roleview_list 	(list RoleViews
-			(object RoleView "$UNNAMED$19" @55
-			    Parent_View 	@54
-			    location   	(-461, -31)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"39FE30D90105"
-			    client     	@54
-			    supplier   	@42
-			    line_style 	3
-			    origin_attachment 	(1939, 449)
-			    terminal_attachment 	(1704, 449))
-			(object RoleView "$UNNAMED$20" @56
-			    Parent_View 	@54
-			    location   	(-461, -31)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"39FE30D90137"
-			    client     	@54
-			    supplier   	@53
-			    line_style 	3
-			    origin_attachment 	(1939, 449)
-			    terminal_attachment 	(2175, 449)
-			    label      	(object SegLabel @57
-				Parent_View 	@56
-				location   	(2120, 486)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"0..n"
-				pctDist    	0.767837
-				height     	37
-				orientation 	1))))
-		(object InheritView "" @58
-		    stereotype 	TRUE
-		    line_color 	12615680
-		    quidu      	"39B7F0E30234"
-		    client     	@27
-		    supplier   	@23
-		    line_style 	3
-		    origin_attachment 	(1064, 1116)
-		    terminal_attachment 	(1064, 1036)
-		    drawSupplier 	@24)
-		(object InheritView "" @59
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"39FE2B850118"
-		    client     	@27
-		    supplier   	@37
-		    line_style 	3
-		    origin_attachment 	(941, 1117)
-		    terminal_attachment 	(941, 990)
-		    drawSupplier 	@38)
-		(object InheritView "" @60
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"37EFD32B032E"
-		    client     	@2
-		    supplier   	@4
-		    line_style 	3
-		    origin_attachment 	(1782, 1805)
-		    terminal_attachment 	(1782, 1640)
-		    drawSupplier 	@5)))
-	(object ClassDiagram "ElementDefinition"
-	    quid       	"37E14330032F"
-	    title      	"ElementDefinition"
-	    zoom       	100
-	    max_height 	28350
-	    max_width  	21600
-	    origin_x   	0
-	    origin_y   	426
-	    items      	(list diagram_item_list
-		(object ClassView "Class" "Logical View::dtd::DTDEmptyContent" @61
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(467, 1448)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@61
-			location   	(281, 1403)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	372
-			justify    	0
-			label      	"DTDEmptyContent")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37D9AB47037A"
-		    width      	390
-		    height     	114
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object ClassView "Class" "Logical View::dtd::DTDAnyContent" @62
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(886, 1445)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@62
-			location   	(728, 1400)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	316
-			justify    	0
-			label      	"DTDAnyContent")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37D9AB500304"
-		    width      	334
-		    height     	114
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object ClassView "Class" "Logical View::dtd::DTDPCDataContent" @63
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(1298, 1451)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@63
-			location   	(1099, 1406)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	398
-			justify    	0
-			label      	"DTDPCDataContent")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37D9AB5C0135"
-		    width      	416
-		    height     	114
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object ClassView "Class" "Logical View::dtd::DTDRepeatableContent" @64
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(1888, 1456)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	TRUE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@64
-			location   	(1572, 1404)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	632
-			justify    	0
-			label      	"DTDRepeatableContent")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37D9AD4C01D1"
-		    width      	650
-		    height     	128
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object InheritTreeView "" @65
-		    location   	(1878, 1618)
-		    line_color 	3342489
-		    fill_color 	13434879
-		    supplier   	@64
-		    vertices   	(list Points
-			(1878, 1618)
-			(1878, 1520)))
-		(object ClassView "Class" "Logical View::ecore::EAttribute" @66
-		    ShowCompartmentStereotypes 	TRUE
-		    location   	(1936, 400)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@66
-			location   	(1855, 325)
-			fill_color 	13434879
-			nlines     	2
-			max_width  	162
-			justify    	0
-			label      	"EAttribute")
-		    icon_style 	"Icon"
-		    line_color 	12615680
-		    fill_color 	16777175
-		    quidu      	"39238472039D"
-		    height     	174
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object ClassView "Class" "Logical View::ecore::EClass" @67
-		    ShowCompartmentStereotypes 	TRUE
-		    location   	(928, 384)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@67
-			location   	(847, 309)
-			fill_color 	13434879
-			nlines     	2
-			max_width  	162
-			justify    	0
-			label      	"EClass")
-		    icon_style 	"Icon"
-		    line_color 	12615680
-		    fill_color 	16777175
-		    quidu      	"3903D5BF000A"
-		    height     	174
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object ClassView "Class" "Logical View::dtd::DTDGroupContent" @68
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(2192, 1776)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@68
-			location   	(1931, 1727)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	522
-			justify    	0
-			label      	"DTDGroupContent")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37CBEAEF0232"
-		    width      	540
-		    height     	122
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object InheritView "" @69
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"37D9AD920363"
-		    client     	@68
-		    supplier   	@64
-		    line_style 	3
-		    origin_attachment 	(2221, 1714)
-		    terminal_attachment 	(2221, 1618)
-		    drawSupplier 	@65)
-		(object ClassView "Class" "Logical View::dtd::DTDEntityReferenceContent" @70
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(1488, 1760)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@70
-			location   	(1223, 1715)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	530
-			justify    	0
-			label      	"DTDEntityReferenceContent")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"3852900E0127"
-		    width      	548
-		    height     	114
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object InheritView "" @71
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"38529044011B"
-		    client     	@70
-		    supplier   	@64
-		    line_style 	3
-		    origin_attachment 	(1474, 1702)
-		    terminal_attachment 	(1474, 1618)
-		    drawSupplier 	@65)
-		(object ClassView "Class" "Logical View::dtd::DTDElementContent" @72
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(912, 1056)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	TRUE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@72
-			location   	(704, 1008)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	416
-			justify    	0
-			label      	"DTDElementContent")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37CBEACF0213"
-		    width      	434
-		    height     	120
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object AssociationViewNew "$UNNAMED$0" @73
-		    location   	(2289, 1048)
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"37CBEB6F005D"
-		    roleview_list 	(list RoleViews
-			(object RoleView "content" @74
-			    Parent_View 	@73
-			    location   	(1025, 8)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @75
-				Parent_View 	@74
-				location   	(1223, 1001)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	168
-				justify    	0
-				label      	"+content"
-				pctDist    	0.919424
-				height     	48
-				orientation 	1)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"37CBEB70006D"
-			    client     	@73
-			    supplier   	@72
-			    line_style 	3
-			    origin_attachment 	(2289, 1048)
-			    terminal_attachment 	(1129, 1048)
-			    label      	(object SegLabel @76
-				Parent_View 	@74
-				location   	(1186, 1083)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	72
-				justify    	0
-				label      	"1..*"
-				pctDist    	0.951381
-				height     	35
-				orientation 	0)
-			    label      	(object SegLabel @77
-				Parent_View 	@74
-				location   	(1246, 941)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	3
-				anchor_loc 	1
-				nlines     	1
-				max_width  	159
-				justify    	0
-				label      	"{ordered}"
-				pctDist    	0.900000
-				height     	108
-				orientation 	1))
-			(object RoleView "group" @78
-			    Parent_View 	@73
-			    location   	(1025, 8)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @79
-				Parent_View 	@78
-				location   	(2535, 1745)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	144
-				justify    	0
-				label      	"+group"
-				pctDist    	0.937744
-				height     	41
-				orientation 	1)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"37CBEB7000AB"
-			    client     	@73
-			    supplier   	@68
-			    vertices   	(list Points
-				(2289, 1048)
-				(2587, 1048)
-				(2587, 1785)
-				(2462, 1785))
-			    line_style 	3
-			    origin_attachment 	(2289, 1048)
-			    terminal_attachment 	(2462, 1785)
-			    label      	(object SegLabel @80
-				Parent_View 	@78
-				location   	(2526, 1827)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"0..1"
-				pctDist    	0.945085
-				height     	42
-				orientation 	0))))
-		(object InheritTreeView "" @81
-		    location   	(910, 1291)
-		    line_color 	3342489
-		    fill_color 	13434879
-		    supplier   	@72
-		    vertices   	(list Points
-			(910, 1291)
-			(910, 1116)))
-		(object InheritView "" @82
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"37D9ABE90278"
-		    client     	@63
-		    supplier   	@72
-		    line_style 	3
-		    origin_attachment 	(1297, 1394)
-		    terminal_attachment 	(1297, 1291)
-		    drawSupplier 	@81)
-		(object InheritView "" @83
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"37D9ABF30327"
-		    client     	@61
-		    supplier   	@72
-		    line_style 	3
-		    origin_attachment 	(466, 1391)
-		    terminal_attachment 	(466, 1291)
-		    drawSupplier 	@81)
-		(object InheritView "" @84
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"37D9ABEE0207"
-		    client     	@62
-		    supplier   	@72
-		    line_style 	3
-		    origin_attachment 	(881, 1388)
-		    terminal_attachment 	(881, 1291)
-		    drawSupplier 	@81)
-		(object InheritView "" @85
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"37D9ADB703C0"
-		    client     	@64
-		    supplier   	@72
-		    line_style 	3
-		    origin_attachment 	(1903, 1392)
-		    terminal_attachment 	(1903, 1291)
-		    drawSupplier 	@81)
-		(object ClassView "Class" "Logical View::dtd::DTDElementReferenceContent" @86
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(784, 1760)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@86
-			location   	(492, 1715)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	584
-			justify    	0
-			label      	"DTDElementReferenceContent")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37D9AB7D0010"
-		    width      	602
-		    height     	114
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object InheritView "" @87
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"37D9AD8C03AA"
-		    client     	@86
-		    supplier   	@64
-		    line_style 	3
-		    origin_attachment 	(650, 1703)
-		    terminal_attachment 	(650, 1618)
-		    drawSupplier 	@65)
-		(object ClassView "Class" "Logical View::dtd::DTDEntity" @88
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(1488, 2064)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@88
-			location   	(1244, 1992)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	488
-			justify    	0
-			label      	"DTDEntity")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37EFD12B03C8"
-		    width      	506
-		    height     	168
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object AssociationViewNew "$UNNAMED$7" @89
-		    location   	(1480, 1898)
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"385294EB0243"
-		    roleview_list 	(list RoleViews
-			(object RoleView "entityReference" @90
-			    Parent_View 	@89
-			    location   	(312, -70)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @91
-				Parent_View 	@90
-				location   	(1280, 1842)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	312
-				justify    	0
-				label      	"+entityReference"
-				pctDist    	0.693750
-				height     	201
-				orientation 	0)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"385294EF03BB"
-			    client     	@89
-			    supplier   	@70
-			    line_style 	3
-			    origin_attachment 	(1480, 1898)
-			    terminal_attachment 	(1480, 1817)
-			    label      	(object SegLabel @92
-				Parent_View 	@90
-				location   	(1534, 1842)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"0..*"
-				pctDist    	0.693750
-				height     	54
-				orientation 	1))
-			(object RoleView "elementReferencedEntity" @93
-			    Parent_View 	@89
-			    location   	(312, -70)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @94
-				Parent_View 	@93
-				location   	(1220, 1954)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	480
-				justify    	0
-				label      	"+elementReferencedEntity"
-				pctDist    	0.685315
-				height     	261
-				orientation 	1)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"385294EF03BC"
-			    client     	@89
-			    supplier   	@88
-			    line_style 	3
-			    origin_attachment 	(1480, 1898)
-			    terminal_attachment 	(1480, 1980)
-			    label      	(object SegLabel @95
-				Parent_View 	@93
-				location   	(1524, 1958)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"1"
-				pctDist    	0.734234
-				height     	44
-				orientation 	0))))
-		(object ClassView "Class" "Logical View::dtd::DTDElement" @96
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(912, 752)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@96
-			location   	(744, 702)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	336
-			justify    	0
-			label      	"DTDElement")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37D9AAF70071"
-		    width      	354
-		    height     	124
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object AssociationViewNew "$UNNAMED$1" @97
-		    location   	(912, 904)
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"37D9AC0E00CD"
-		    roleview_list 	(list RoleViews
-			(object RoleView "element" @98
-			    Parent_View 	@97
-			    location   	(-25, 96)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @99
-				Parent_View 	@98
-				location   	(1014, 865)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	168
-				justify    	0
-				label      	"+element"
-				pctDist    	0.428571
-				height     	102
-				orientation 	1)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"37D9AC0F039F"
-			    client     	@97
-			    supplier   	@96
-			    line_style 	0
-			    label      	(object SegLabel @100
-				Parent_View 	@98
-				location   	(857, 850)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"0..1"
-				pctDist    	0.598214
-				height     	56
-				orientation 	0))
-			(object RoleView "content" @101
-			    Parent_View 	@97
-			    location   	(-25, 96)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @102
-				Parent_View 	@101
-				location   	(1014, 964)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	168
-				justify    	0
-				label      	"+content"
-				pctDist    	0.664063
-				height     	102
-				orientation 	0)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"37D9AC0F03A9"
-			    client     	@97
-			    supplier   	@72
-			    line_style 	0
-			    label      	(object SegLabel @103
-				Parent_View 	@101
-				location   	(871, 962)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"1"
-				pctDist    	0.640625
-				height     	42
-				orientation 	1))))
-		(object AssociationViewNew "$UNNAMED$2" @104
-		    location   	(123, 1122)
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"37D9AF11001A"
-		    roleview_list 	(list RoleViews
-			(object RoleView "elementReference" @105
-			    Parent_View 	@104
-			    location   	(-981, 642)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @106
-				Parent_View 	@105
-				location   	(321, 1825)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	348
-				justify    	0
-				label      	"+elementReference"
-				pctDist    	0.840035
-				height     	56
-				orientation 	1)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"37D9AF1B0209"
-			    client     	@104
-			    supplier   	@86
-			    vertices   	(list Points
-				(123, 1122)
-				(123, 1769)
-				(483, 1769))
-			    line_style 	3
-			    origin_attachment 	(123, 1122)
-			    terminal_attachment 	(483, 1769)
-			    label      	(object SegLabel @107
-				Parent_View 	@105
-				location   	(422, 1726)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"0..*"
-				pctDist    	0.940559
-				height     	44
-				orientation 	0))
-			(object RoleView "referencedElement" @108
-			    Parent_View 	@104
-			    location   	(-981, 642)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @109
-				Parent_View 	@108
-				location   	(532, 686)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	360
-				justify    	0
-				label      	"+referencedElement"
-				pctDist    	0.799650
-				height     	43
-				orientation 	0)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"37D9AF1B020A"
-			    client     	@104
-			    supplier   	@96
-			    vertices   	(list Points
-				(123, 1122)
-				(123, 728)
-				(735, 728))
-			    line_style 	3
-			    origin_attachment 	(123, 1122)
-			    terminal_attachment 	(735, 728)
-			    label      	(object SegLabel @110
-				Parent_View 	@108
-				location   	(701, 773)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"1"
-				pctDist    	0.966965
-				height     	45
-				orientation 	1))))
-		(object InheritView "" @111
-		    stereotype 	TRUE
-		    line_color 	12615680
-		    quidu      	"39B7F0AF02A8"
-		    client     	@96
-		    supplier   	@67
-		    line_style 	3
-		    origin_attachment 	(923, 690)
-		    terminal_attachment 	(923, 470))
-		(object ClassView "Class" "Logical View::dtd::DTDAttribute" @112
-		    ShowCompartmentStereotypes 	TRUE
-		    SuppressOperation 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(1888, 752)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@112
-			location   	(1612, 657)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	552
-			justify    	0
-			label      	"DTDAttribute")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37CC187900EA"
-		    width      	570
-		    height     	214
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object AssociationViewNew "$UNNAMED$8" @113
-		    location   	(2775, 1628)
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"3852972D02CB"
-		    roleview_list 	(list RoleViews
-			(object RoleView "attributeNameReference" @114
-			    Parent_View 	@113
-			    location   	(1591, -564)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @115
-				Parent_View 	@114
-				location   	(2422, 808)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	468
-				justify    	0
-				label      	"+attributeNameReference"
-				pctDist    	0.829630
-				height     	39
-				orientation 	0)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"385297360291"
-			    client     	@113
-			    supplier   	@112
-			    vertices   	(list Points
-				(2775, 1628)
-				(2775, 768)
-				(2173, 768))
-			    line_style 	3
-			    origin_attachment 	(2775, 1628)
-			    terminal_attachment 	(2173, 768)
-			    label      	(object SegLabel @116
-				Parent_View 	@114
-				location   	(2222, 871)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"0..*"
-				pctDist    	0.966649
-				height     	102
-				orientation 	0))
-			(object RoleView "attributeNameReferencedEntity" @117
-			    Parent_View 	@113
-			    location   	(1591, -564)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @118
-				Parent_View 	@117
-				location   	(2076, 2090)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	588
-				justify    	0
-				label      	"+attributeNameReferencedEntity"
-				pctDist    	0.771469
-				height     	35
-				orientation 	0)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"38529736029B"
-			    client     	@113
-			    supplier   	@88
-			    vertices   	(list Points
-				(2775, 1628)
-				(2775, 2055)
-				(1741, 2055))
-			    line_style 	3
-			    origin_attachment 	(2775, 1628)
-			    terminal_attachment 	(1741, 2055)
-			    label      	(object SegLabel @119
-				Parent_View 	@117
-				location   	(1813, 2018)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"0..1"
-				pctDist    	0.951442
-				height     	38
-				orientation 	1))))
-		(object AssociationViewNew "$UNNAMED$11" @120
-		    location   	(2945, 1891)
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"38BD4908013D"
-		    roleview_list 	(list RoleViews
-			(object RoleView "attributeTypeReference" @121
-			    Parent_View 	@120
-			    location   	(1489, -676)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @122
-				Parent_View 	@121
-				location   	(2435, 656)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	444
-				justify    	0
-				label      	"+attributeTypeReference"
-				pctDist    	0.866026
-				height     	54
-				orientation 	1)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"38BD49140130"
-			    client     	@120
-			    supplier   	@112
-			    vertices   	(list Points
-				(2945, 1891)
-				(2945, 708)
-				(2173, 708))
-			    line_style 	3
-			    origin_attachment 	(2945, 1891)
-			    terminal_attachment 	(2173, 708)
-			    label      	(object SegLabel @123
-				Parent_View 	@121
-				location   	(2345, 603)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"0..*"
-				pctDist    	0.912538
-				height     	107
-				orientation 	1))
-			(object RoleView "attributeTypeReferencedEntity" @124
-			    Parent_View 	@120
-			    location   	(1489, -676)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    label      	(object SegLabel @125
-				Parent_View 	@124
-				location   	(1679, 2299)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	1
-				anchor_loc 	1
-				nlines     	1
-				max_width  	576
-				justify    	0
-				label      	"+attributeTypeReferencedEntity"
-				pctDist    	0.828601
-				height     	56
-				orientation 	0)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"38BD4914014E"
-			    client     	@120
-			    supplier   	@88
-			    vertices   	(list Points
-				(2945, 1891)
-				(2945, 2243)
-				(1438, 2243)
-				(1438, 2148))
-			    line_style 	3
-			    origin_attachment 	(2945, 1891)
-			    terminal_attachment 	(1438, 2148)
-			    label      	(object SegLabel @126
-				Parent_View 	@124
-				location   	(1365, 2178)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"0..1"
-				pctDist    	0.984774
-				height     	74
-				orientation 	0))))
-		(object InheritView "" @127
-		    stereotype 	TRUE
-		    line_color 	12615680
-		    quidu      	"39B7F15901DA"
-		    client     	@112
-		    supplier   	@66
-		    line_style 	3
-		    origin_attachment 	(1950, 645)
-		    terminal_attachment 	(1950, 486))
-		(object AssociationViewNew "$UNNAMED$12" @128
-		    location   	(1346, 752)
-		    stereotype 	TRUE
-		    line_color 	3342489
-		    quidu      	"39FE2A9500CC"
-		    roleview_list 	(list RoleViews
-			(object RoleView "$UNNAMED$13" @129
-			    Parent_View 	@128
-			    location   	(-542, -16)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"39FE2A950311"
-			    client     	@128
-			    supplier   	@96
-			    line_style 	3
-			    origin_attachment 	(1346, 752)
-			    terminal_attachment 	(1089, 752))
-			(object RoleView "$UNNAMED$14" @130
-			    Parent_View 	@128
-			    location   	(-542, -16)
-			    font       	(object Font
-				size       	10
-				face       	"Arial"
-				bold       	FALSE
-				italics    	FALSE
-				underline  	FALSE
-				strike     	FALSE
-				color      	0
-				default_color 	TRUE)
-			    stereotype 	TRUE
-			    line_color 	3342489
-			    quidu      	"39FE2A95031B"
-			    client     	@128
-			    supplier   	@112
-			    line_style 	3
-			    origin_attachment 	(1346, 752)
-			    terminal_attachment 	(1603, 752)
-			    label      	(object SegLabel @131
-				Parent_View 	@130
-				location   	(1544, 791)
-				font       	(object Font
-				    size       	10
-				    face       	"Arial"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				anchor     	2
-				anchor_loc 	1
-				nlines     	1
-				max_width  	15
-				justify    	0
-				label      	"0..*"
-				pctDist    	0.773390
-				height     	39
-				orientation 	1))))))
-	(object ClassDiagram "AttributeDefinition"
-	    quid       	"37E144570257"
-	    title      	"AttributeDefinition"
-	    zoom       	100
-	    max_height 	28350
-	    max_width  	21600
-	    origin_x   	0
-	    origin_y   	0
-	    items      	(list diagram_item_list
-		(object ClassView "Class" "Logical View::dtd::DTDAttribute" @132
-		    ShowCompartmentStereotypes 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(512, 656)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@132
-			location   	(236, 539)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	552
-			justify    	0
-			label      	"DTDAttribute")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37CC187900EA"
-		    width      	570
-		    height     	258
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object ClassView "Class" "Logical View::dtd::DTDBasicType" @133
-		    ShowCompartmentStereotypes 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(1264, 656)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@133
-			location   	(1017, 584)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	494
-			justify    	0
-			label      	"DTDBasicType")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37E1464F00DA"
-		    width      	512
-		    height     	168
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object ClassView "Class" "Logical View::dtd::DTDEnumerationType" @134
-		    ShowCompartmentStereotypes 	TRUE
-		    IncludeAttribute 	TRUE
-		    IncludeOperation 	TRUE
-		    location   	(1904, 656)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@134
-			location   	(1646, 584)
-			fill_color 	13434879
-			nlines     	1
-			max_width  	516
-			justify    	0
-			label      	"DTDEnumerationType")
-		    icon_style 	"Icon"
-		    line_color 	3342489
-		    fill_color 	13434879
-		    quidu      	"37E146680306"
-		    width      	534
-		    height     	168
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object NoteView @135
-		    location   	(912, 1120)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@135
-			location   	(492, 926)
-			nlines     	9
-			max_width  	805
-			label      	
-|A DTD attribute's type and initial
-|value are represented using the eType and default value stored in eAttribute. The eType will always be either DTDBasicType (subclass of eClass) or DTDEnumerationType (subclass of eEnum).
-			)
-		    fill_color 	16777215
-		    width      	865
-		    height     	400)
-		(object AttachView "" @136
-		    stereotype 	TRUE
-		    client     	@132
-		    supplier   	@135
-		    line_style 	0)
-		(object ClassView "Class" "Logical View::ecore::EClass" @137
-		    ShowCompartmentStereotypes 	TRUE
-		    location   	(1264, 272)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@137
-			location   	(1183, 197)
-			fill_color 	13434879
-			nlines     	2
-			max_width  	162
-			justify    	0
-			label      	"EClass")
-		    icon_style 	"Icon"
-		    line_color 	12615680
-		    fill_color 	16777175
-		    quidu      	"3903D5BF000A"
-		    height     	174
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object ClassView "Class" "Logical View::ecore::EEnum" @138
-		    ShowCompartmentStereotypes 	TRUE
-		    location   	(1904, 272)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@138
-			location   	(1823, 197)
-			fill_color 	13434879
-			nlines     	2
-			max_width  	162
-			justify    	0
-			label      	"EEnum")
-		    icon_style 	"Icon"
-		    line_color 	12615680
-		    fill_color 	16777175
-		    quidu      	"39A473E901D4"
-		    height     	174
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object InheritView "" @139
-		    stereotype 	TRUE
-		    line_color 	12615680
-		    quidu      	"39B7F2800315"
-		    client     	@133
-		    supplier   	@137
-		    line_style 	3
-		    origin_attachment 	(1260, 572)
-		    terminal_attachment 	(1260, 359))
-		(object InheritView "" @140
-		    stereotype 	TRUE
-		    line_color 	12615680
-		    quidu      	"39B7F2810302"
-		    client     	@134
-		    supplier   	@138
-		    line_style 	3
-		    origin_attachment 	(1903, 572)
-		    terminal_attachment 	(1903, 359))
-		(object ClassView "Class" "Logical View::ecore::EAttribute" @141
-		    ShowCompartmentStereotypes 	TRUE
-		    location   	(528, 272)
-		    font       	(object Font
-			size       	10
-			face       	"Arial"
-			bold       	FALSE
-			italics    	FALSE
-			underline  	FALSE
-			strike     	FALSE
-			color      	0
-			default_color 	TRUE)
-		    label      	(object ItemLabel
-			Parent_View 	@141
-			location   	(447, 197)
-			fill_color 	13434879
-			nlines     	2
-			max_width  	162
-			justify    	0
-			label      	"EAttribute")
-		    icon_style 	"Icon"
-		    line_color 	12615680
-		    fill_color 	16777175
-		    quidu      	"39238472039D"
-		    height     	174
-		    annotation 	8
-		    autoResize 	TRUE)
-		(object InheritView "" @142
-		    stereotype 	TRUE
-		    line_color 	12615680
-		    quidu      	"39B7F15901DA"
-		    client     	@132
-		    supplier   	@141
-		    line_style 	3
-		    origin_attachment 	(520, 527)
-		    terminal_attachment 	(520, 359))))))
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/rose/dtdmodel.mdl b/bundles/org.eclipse.wst.dtd.core/emfmodel/rose/dtdmodel.mdl
deleted file mode 100644
index ce5627a..0000000
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/rose/dtdmodel.mdl
+++ /dev/null
@@ -1,7526 +0,0 @@
-
-(object Petal
-    version    	45
-    _written   	"Rose 7.5.0103.1920"
-    charSet    	0)
-
-(object Design "Logical View"
-    is_unit    	TRUE
-    is_loaded  	TRUE
-    attributes 	(list Attribute_Set
-	(object Attribute
-	    tool       	"Java"
-	    name       	"IDE"
-	    value      	"Internal Editor"))
-    quid       	"3E36BEB60133"
-    defaults   	(object defaults
-	rightMargin 	0.250000
-	leftMargin 	0.250000
-	topMargin  	0.250000
-	bottomMargin 	0.500000
-	pageOverlap 	0.250000
-	clipIconLabels 	TRUE
-	autoResize 	TRUE
-	snapToGrid 	TRUE
-	gridX      	16
-	gridY      	16
-	defaultFont 	(object Font
-	    size       	10
-	    face       	"Arial"
-	    bold       	FALSE
-	    italics    	FALSE
-	    underline  	FALSE
-	    strike     	FALSE
-	    color      	0
-	    default_color 	TRUE)
-	showMessageNum 	1
-	showClassOfObject 	TRUE
-	notation   	"Unified")
-    root_usecase_package 	(object Class_Category "Use Case View"
-	quid       	"3A0C75F401F7"
-	exportControl 	"Public"
-	global     	TRUE
-	logical_models 	(list unit_reference_list)
-	logical_presentations 	(list unit_reference_list
-	    (object UseCaseDiagram "Main"
-		quid       	"3A0C75F4020B"
-		title      	"Main"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    root_category 	(object Class_Category "Logical View"
-	quid       	"3A0C75F401F6"
-	exportControl 	"Public"
-	global     	TRUE
-	subsystem  	"Component View"
-	quidu      	"3A0C75F401F8"
-	logical_models 	(list unit_reference_list
-	    (object Class_Category "ecore"
-		is_unit    	TRUE
-		is_loaded  	FALSE
-		file_name  	"$VABASE_PLUGINS_PATH\\org.eclipse.emf.ecore\\src\\model\\org.eclipse.emf.ECore.cat"
-		quid       	"39A5ED04004E")
-	    (object Class_Category "dtd"
-		is_unit    	TRUE
-		is_loaded  	FALSE
-		file_name  	"$VABASE_PLUGINS_PATH\\org.eclipse.wst.dtd\\src\\rose\\DTD.cat"
-		quid       	"3857B1C00293"))
-	logical_presentations 	(list unit_reference_list
-	    (object ClassDiagram "Main"
-		quid       	"3A0C75F401FF"
-		title      	"Main"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list
-		    (object CategoryView "Logical View::ecore" @1
-			location   	(960, 304)
-			font       	(object Font
-			    size       	10
-			    face       	"Arial"
-			    bold       	FALSE
-			    italics    	FALSE
-			    underline  	FALSE
-			    strike     	FALSE
-			    color      	0
-			    default_color 	TRUE)
-			label      	(object ItemLabel
-			    Parent_View 	@1
-			    location   	(816, 220)
-			    fill_color 	13434879
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"ecore")
-			icon_style 	"Icon"
-			line_color 	3342489
-			fill_color 	13434879
-			quidu      	"39A5ED04004E"
-			width      	300
-			height     	180)
-		    (object CategoryView "Logical View::dtd" @2
-			location   	(368, 256)
-			font       	(object Font
-			    size       	10
-			    face       	"Arial"
-			    bold       	FALSE
-			    italics    	FALSE
-			    underline  	FALSE
-			    strike     	FALSE
-			    color      	0
-			    default_color 	TRUE)
-			label      	(object ItemLabel
-			    Parent_View 	@2
-			    location   	(224, 172)
-			    fill_color 	13434879
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"dtd")
-			icon_style 	"Icon"
-			line_color 	3342489
-			fill_color 	13434879
-			quidu      	"3857B1C00293"
-			width      	300
-			height     	180)))))
-    root_subsystem 	(object SubSystem "Component View"
-	quid       	"3A0C75F401F8"
-	physical_models 	(list unit_reference_list)
-	physical_presentations 	(list unit_reference_list
-	    (object Module_Diagram "Main"
-		quid       	"3A0C75F4020A"
-		title      	"Main"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    process_structure 	(object Processes
-	quid       	"3A0C75F401F9"
-	ProcsNDevs 	(list
-	    (object Process_Diagram "Deployment View"
-		quid       	"3A0C75F401FB"
-		title      	"Deployment View"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    properties 	(object Properties
-	attributes 	(list Attribute_Set
-	    (object Attribute
-		tool       	"DDL"
-		name       	"propertyId"
-		value      	"809135966")
-	    (object Attribute
-		tool       	"DDL"
-		name       	"default__Project"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"DDL"
-			name       	"Directory"
-			value      	"AUTO GENERATE")
-		    (object Attribute
-			tool       	"DDL"
-			name       	"DataBase"
-			value      	("DataBaseSet" 800))
-		    (object Attribute
-			tool       	"DDL"
-			name       	"DataBaseSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"DDL"
-				name       	"ANSI"
-				value      	800)
-			    (object Attribute
-				tool       	"DDL"
-				name       	"Oracle"
-				value      	801)
-			    (object Attribute
-				tool       	"DDL"
-				name       	"SQLServer"
-				value      	802)
-			    (object Attribute
-				tool       	"DDL"
-				name       	"Sybase"
-				value      	803)
-			    (object Attribute
-				tool       	"DDL"
-				name       	"Watcom"
-				value      	804)))
-		    (object Attribute
-			tool       	"DDL"
-			name       	"PrimaryKeyColumnName"
-			value      	"Id")
-		    (object Attribute
-			tool       	"DDL"
-			name       	"PrimaryKeyColumnType"
-			value      	"NUMBER(5)")
-		    (object Attribute
-			tool       	"DDL"
-			name       	"ViewName"
-			value      	"V_")
-		    (object Attribute
-			tool       	"DDL"
-			name       	"TableName"
-			value      	"T_")
-		    (object Attribute
-			tool       	"DDL"
-			name       	"InheritSuffix"
-			value      	"_V")
-		    (object Attribute
-			tool       	"DDL"
-			name       	"DropClause"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"DDL"
-			name       	"BaseViews"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"DDL"
-			name       	"DDLScriptFilename"
-			value      	"DDL1.SQL")))
-	    (object Attribute
-		tool       	"DDL"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"DDL"
-			name       	"ColumnType"
-			value      	"VARCHAR")
-		    (object Attribute
-			tool       	"DDL"
-			name       	"Length"
-			value      	"")
-		    (object Attribute
-			tool       	"DDL"
-			name       	"NullsOK"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"DDL"
-			name       	"PrimaryKey"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"DDL"
-			name       	"Unique"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"DDL"
-			name       	"CompositeUnique"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"DDL"
-			name       	"CheckConstraint"
-			value      	"")))
-	    (object Attribute
-		tool       	"DDL"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"IDL"
-		name       	"propertyId"
-		value      	"809135966")
-	    (object Attribute
-		tool       	"IDL"
-		name       	"default__Project"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"IDL"
-			name       	"CreateMissingDirectories"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"StopOnError"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"Directory"
-			value      	"AUTO GENERATE")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"GeneratePreserveRegions"
-			value      	TRUE)))
-	    (object Attribute
-		tool       	"IDL"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"IDL"
-			name       	"ImplementationType"
-			value      	"")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"ConstValue"
-			value      	"")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"GenerateDefaultSpecifier"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"DefaultSpecifier"
-			value      	"")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"IDLElement"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"IDLSpecificationType"
-			value      	("IDLSpecSet" 22))
-		    (object Attribute
-			tool       	"IDL"
-			name       	"IDLSpecSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"IDL"
-				name       	"Interface"
-				value      	22)
-			    (object Attribute
-				tool       	"IDL"
-				name       	"Typedef"
-				value      	54)
-			    (object Attribute
-				tool       	"IDL"
-				name       	"Enumeration"
-				value      	8)
-			    (object Attribute
-				tool       	"IDL"
-				name       	"Const"
-				value      	71)
-			    (object Attribute
-				tool       	"IDL"
-				name       	"Exception"
-				value      	61)
-			    (object Attribute
-				tool       	"IDL"
-				name       	"Struct"
-				value      	51)
-			    (object Attribute
-				tool       	"IDL"
-				name       	"Union"
-				value      	81)))))
-	    (object Attribute
-		tool       	"IDL"
-		name       	"default__Module-Spec"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"IDL"
-			name       	"Generate"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"CmIdentification"
-			value      	(value Text "  %X%  @(#) plugins/org.eclipse.wst.dtd/src/rose/dtdmodel.mdl, org.eclipse.wst.dtd, wtpM1, 20041122"))
-		    (object Attribute
-			tool       	"IDL"
-			name       	"CopyrightNotice"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"IDL"
-			name       	"FileName"
-			value      	"AUTO GENERATE")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"GenerateIDLModule"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"InclusionProtectionSymbol"
-			value      	"AUTO GENERATE")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"AdditionalIncludes"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"IDL"
-			name       	"IncludeBySimpleName"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"IDL"
-		name       	"default__Module-Body"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"IDL"
-			name       	"CmIdentification"
-			value      	(value Text "  %X%  @(#) plugins/org.eclipse.wst.dtd/src/rose/dtdmodel.mdl, org.eclipse.wst.dtd, wtpM1, 20041122"))
-		    (object Attribute
-			tool       	"IDL"
-			name       	"CopyrightNotice"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"IDL"
-			name       	"FileName"
-			value      	"AUTO GENERATE")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"AdditionalIncludes"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"IDL"
-			name       	"IncludeBySimpleName"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"IDL"
-		name       	"default__Operation"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"IDL"
-			name       	"OperationIsOneWay"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"Context"
-			value      	"")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"Raises"
-			value      	"")))
-	    (object Attribute
-		tool       	"IDL"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"IDL"
-			name       	"CaseSpecifier"
-			value      	"")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"GenerateDataMember"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"DataMemberName"
-			value      	"$relationship")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"IsReadOnly"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"IsConst"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"ConstValue"
-			value      	"")))
-	    (object Attribute
-		tool       	"IDL"
-		name       	"default__Has"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"IDL"
-			name       	"NameIfUnlabeled"
-			value      	"the_$supplier")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"GenerateDataMember"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"DataMemberName"
-			value      	"$relationship")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"GenerateForwardReference"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"IsReadOnly"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"BoundedHasRelType"
-			value      	("HasRelTypeSet" 47))
-		    (object Attribute
-			tool       	"IDL"
-			name       	"HasRelTypeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"IDL"
-				name       	"Array"
-				value      	24)
-			    (object Attribute
-				tool       	"IDL"
-				name       	"Sequence"
-				value      	47)))))
-	    (object Attribute
-		tool       	"IDL"
-		name       	"default__Role"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"IDL"
-			name       	"NameIfUnlabeled"
-			value      	"the_$supplier")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"GenerateDataMember"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"DataMemberName"
-			value      	"$relationship")
-		    (object Attribute
-			tool       	"IDL"
-			name       	"GenerateForwardReference"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"IsReadOnly"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"IDL"
-			name       	"BoundedRoleType"
-			value      	("AssocTypeSet" 47))
-		    (object Attribute
-			tool       	"IDL"
-			name       	"AssocTypeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"IDL"
-				name       	"Array"
-				value      	24)
-			    (object Attribute
-				tool       	"IDL"
-				name       	"Sequence"
-				value      	47)))))
-	    (object Attribute
-		tool       	"IDL"
-		name       	"default__Uses"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"IDL"
-			name       	"GenerateForwardReference"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"IDL"
-		name       	"default__Subsystem"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"IDL"
-			name       	"Directory"
-			value      	"AUTO GENERATE")))
-	    (object Attribute
-		tool       	"IDL"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"SCC"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"eCore"
-		name       	"propertyId"
-		value      	"809135966")
-	    (object Attribute
-		tool       	"eCore"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"eCore"
-			name       	"Codegen Name"
-			value      	"")))
-	    (object Attribute
-		tool       	"eCore"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"eCore"
-			name       	"isTransient"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"eCore"
-			name       	"isVolatile"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"eCore"
-			name       	"isChangeable"
-			value      	TRUE)))
-	    (object Attribute
-		tool       	"eCore"
-		name       	"default__Role"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"eCore"
-			name       	"isTransient"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"eCore"
-			name       	"isVolatile"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"eCore"
-			name       	"isChangeable"
-			value      	TRUE)))
-	    (object Attribute
-		tool       	"Cplusplus"
-		name       	"propertyId"
-		value      	"809135966")
-	    (object Attribute
-		tool       	"Cplusplus"
-		name       	"default__Role"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"Synchronize"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"Const"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"InitialValue"
-			value      	"")))
-	    (object Attribute
-		tool       	"Cplusplus"
-		name       	"default__Inherit"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"Synchronize"
-			value      	TRUE)))
-	    (object Attribute
-		tool       	"Cplusplus"
-		name       	"default__Module-Spec"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"Synchronize"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"Copyright"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"RootPackage"
-			value      	"C++ Reverse Engineered")
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"InitialHeaderIncludes"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"InitialBodyIncludes"
-			value      	(value Text ""))))
-	    (object Attribute
-		tool       	"Cplusplus"
-		name       	"default__Param"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"CodeName"
-			value      	"")))
-	    (object Attribute
-		tool       	"Cplusplus"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"Synchronize"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"CodeName"
-			value      	"")))
-	    (object Attribute
-		tool       	"Cplusplus"
-		name       	"default__Operation"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"Synchronize"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"InitialCodeBody"
-			value      	"")
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"Inline"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Cplusplus"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"Synchronize"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"ImplementationType"
-			value      	"")
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"HeaderSourceFile"
-			value      	"")
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"BodySourceFile"
-			value      	"")))
-	    (object Attribute
-		tool       	"Cplusplus"
-		name       	"default__Category"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Cplusplus"
-			name       	"IsNamespace"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Cplusplus"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"ANSI C++ Event Watcher"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"ANSIConvert"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"Ada83"
-		name       	"propertyId"
-		value      	"838326200")
-	    (object Attribute
-		tool       	"Ada83"
-		name       	"default__Project"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"SpecFileExtension"
-			value      	"1.ada")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"SpecFileBackupExtension"
-			value      	"1.ad~")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"SpecFileTemporaryExtension"
-			value      	"1.ad#")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"BodyFileExtension"
-			value      	"2.ada")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"BodyFileBackupExtension"
-			value      	"2.ad~")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"BodyFileTemporaryExtension"
-			value      	"2.ad#")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"CreateMissingDirectories"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"GenerateBodies"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"GenerateAccessorOperations"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"GenerateStandardOperations"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"DefaultCodeBody"
-			value      	"[statement]")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ImplicitParameter"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"CommentWidth"
-			value      	60)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"StopOnError"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ErrorLimit"
-			value      	30)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"UseFileName"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"Directory"
-			value      	"$ROSEADA83_SOURCE")))
-	    (object Attribute
-		tool       	"Ada83"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ClassName"
-			value      	"Object")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ClassAccess"
-			value      	("ImplementationSet" 43))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ImplementationType"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"IsSubtype"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"PolymorphicUnit"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"HandleName"
-			value      	"Handle")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"HandleAccess"
-			value      	("ImplementationSet" 45))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"Discriminant"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"Variant"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"EnumerationLiteralPrefix"
-			value      	"A_")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"RecordFieldPrefix"
-			value      	"The_")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"GenerateAccessorOperations"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"GenerateStandardOperations"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ImplicitParameter"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ClassParameterName"
-			value      	"This")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"DefaultConstructorKind"
-			value      	("ConstructorKindSet" 199))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"DefaultConstructorName"
-			value      	"Create")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineDefaultConstructor"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"CopyConstructorKind"
-			value      	("ConstructorKindSet" 199))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"CopyConstructorName"
-			value      	"Copy")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineCopyConstructor"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"DestructorName"
-			value      	"Free")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineDestructor"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ClassEqualityOperation"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"HandleEqualityOperation"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineEquality"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"IsTask"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"Representation"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ImplementationSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"Public"
-				value      	45)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"Private"
-				value      	43)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"LimitedPrivate"
-				value      	200)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"DoNotCreate"
-				value      	201)))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ConstructorKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"Procedure"
-				value      	202)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"Function"
-				value      	199)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"DoNotCreate"
-				value      	201)))))
-	    (object Attribute
-		tool       	"Ada83"
-		name       	"default__Module-Spec"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"Generate"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"CopyrightNotice"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"FileName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ReturnType"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"GenericFormalParameters"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"AdditionalWiths"
-			value      	(value Text ""))))
-	    (object Attribute
-		tool       	"Ada83"
-		name       	"default__Module-Body"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"Generate"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"CopyrightNotice"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"FileName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ReturnType"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"AdditionalWiths"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"IsSubunit"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Ada83"
-		name       	"default__Operation"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"SubprogramImplementation"
-			value      	("SubprogramImplementationSet" 2))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"Renames"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ClassParameterMode"
-			value      	("ParameterModeSet" 203))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"Inline"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"EntryCode"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ExitCode"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InitialCodeBody"
-			value      	"${default}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"Representation"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"SubprogramImplementationSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"Spec"
-				value      	224)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"Body"
-				value      	2)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"Renaming"
-				value      	222)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"Separate"
-				value      	223)))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ParameterModeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"In"
-				value      	204)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"Out"
-				value      	205)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"InOut"
-				value      	203)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"FunctionReturn"
-				value      	206)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"DoNotCreate"
-				value      	201)))))
-	    (object Attribute
-		tool       	"Ada83"
-		name       	"default__Has"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"NameIfUnlabeled"
-			value      	"The_${supplier}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"DataMemberName"
-			value      	"${relationship}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"GetName"
-			value      	"Get_${relationship}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineGet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"SetName"
-			value      	"Set_${relationship}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineSet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"IsConstant"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InitialValue"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"Variant"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ContainerGeneric"
-			value      	"List")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ContainerType"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ContainerDeclarations"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"SelectorName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"SelectorType"
-			value      	"")))
-	    (object Attribute
-		tool       	"Ada83"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"DataMemberName"
-			value      	"${attribute}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"GetName"
-			value      	"Get_${attribute}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineGet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"SetName"
-			value      	"Set_${attribute}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineSet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"IsConstant"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InitialValue"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"Variant"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"Representation"
-			value      	(value Text ""))))
-	    (object Attribute
-		tool       	"Ada83"
-		name       	"default__Association"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"NameIfUnlabeled"
-			value      	"The_${targetClass}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"GetName"
-			value      	"Get_${association}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineGet"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"SetName"
-			value      	"Set_${association}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineSet"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"GenerateAssociate"
-			value      	("ProcedureKindSet" 202))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"AssociateName"
-			value      	"Associate")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineAssociate"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"GenerateDissociate"
-			value      	("ProcedureKindSet" 202))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"DissociateName"
-			value      	"Dissociate")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineDissociate"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ProcedureKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"Procedure"
-				value      	202)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"DoNotCreate"
-				value      	201)))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"FunctionKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"Function"
-				value      	199)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"DoNotCreate"
-				value      	201)))))
-	    (object Attribute
-		tool       	"Ada83"
-		name       	"default__Role"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"NameIfUnlabeled"
-			value      	"The_${targetClass}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"DataMemberName"
-			value      	"${target}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"GetName"
-			value      	"Get_${target}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineGet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"SetName"
-			value      	"Set_${target}")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InlineSet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"IsConstant"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"InitialValue"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ContainerGeneric"
-			value      	"List")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ContainerType"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ContainerDeclarations"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"SelectorName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"SelectorType"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"ProcedureKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"Procedure"
-				value      	202)
-			    (object Attribute
-				tool       	"Ada83"
-				name       	"DoNotCreate"
-				value      	201)))))
-	    (object Attribute
-		tool       	"Ada83"
-		name       	"default__Subsystem"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada83"
-			name       	"Directory"
-			value      	"AUTO GENERATE")))
-	    (object Attribute
-		tool       	"Ada83"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"Ada95"
-		name       	"propertyId"
-		value      	"838326200")
-	    (object Attribute
-		tool       	"Ada95"
-		name       	"default__Project"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SpecFileExtension"
-			value      	"1.ada")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SpecFileBackupExtension"
-			value      	"1.ad~")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SpecFileTemporaryExtension"
-			value      	"1.ad#")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"BodyFileExtension"
-			value      	"2.ada")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"BodyFileBackupExtension"
-			value      	"2.ad~")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"BodyFileTemporaryExtension"
-			value      	"2.ad#")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"CreateMissingDirectories"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"UseColonNotation"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateBodies"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateAccessorOperations"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateStandardOperations"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"DefaultCodeBody"
-			value      	"[statement]")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ImplicitParameter"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"CommentWidth"
-			value      	60)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"StopOnError"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ErrorLimit"
-			value      	30)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"UseFileName"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"Directory"
-			value      	"$ROSEADA95_SOURCE")))
-	    (object Attribute
-		tool       	"Ada95"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"TypeName"
-			value      	"Object")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"TypeVisibility"
-			value      	("TypeVisibilitySet" 43))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"TypeImplementation"
-			value      	("TypeImplementationSet" 208))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"TypeControl"
-			value      	("TypeControlSet" 225))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"TypeControlName"
-			value      	"Controlled_${type}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"TypeDefinition"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"RecordImplementation"
-			value      	("RecordImplementationSet" 209))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"RecordKindPackageName"
-			value      	"${class}_Record_Kinds")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"IsLimited"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"IsSubtype"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateAccessType"
-			value      	("GenerateAccessTypeSet" 230))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"AccessTypeName"
-			value      	"Handle")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"AccessTypeVisibility"
-			value      	("TypeVisibilitySet" 45))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"AccessTypeDefinition"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"AccessClassWide"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"MaybeAliased"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ParameterizedImplementation"
-			value      	("ParameterizedImplementationSet" 11))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ParentClassName"
-			value      	"Superclass")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"EnumerationLiteralPrefix"
-			value      	"A_")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"RecordFieldPrefix"
-			value      	"The_")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ArrayOfTypeName"
-			value      	"Array_Of_${type}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"AccessArrayOfTypeName"
-			value      	"Access_Array_Of_${type}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ArrayOfAccessTypeName"
-			value      	"Array_Of_${access_type}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"AccessArrayOfAccessTypeName"
-			value      	"Access_Array_Of_${access_type}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ArrayIndexDefinition"
-			value      	"Positive range <>")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateAccessorOperations"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateStandardOperations"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ImplicitParameter"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ImplicitParameterName"
-			value      	"This")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateDefaultConstructor"
-			value      	("SubprogramKindSet" 199))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"DefaultConstructorName"
-			value      	"Create")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineDefaultConstructor"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateCopyConstructor"
-			value      	("SubprogramKindSet" 199))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"CopyConstructorName"
-			value      	"Copy")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineCopyConstructor"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateDestructor"
-			value      	("ProcedureKindSet" 202))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"DestructorName"
-			value      	"Free")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineDestructor"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateTypeEquality"
-			value      	("FunctionKindSet" 201))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"TypeEqualityName"
-			value      	"${quote}=${quote}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineEquality"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"Representation"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"TypeImplementationSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Tagged"
-				value      	208)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Record"
-				value      	210)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Mixin"
-				value      	211)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Protected"
-				value      	44)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Task"
-				value      	212)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"RecordImplementationSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"SingleType"
-				value      	209)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"MultipleTypes"
-				value      	213)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ParameterizedImplementationSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Generic"
-				value      	11)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Unconstrained"
-				value      	214)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"TypeVisibilitySet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Public"
-				value      	45)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Private"
-				value      	43)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SubprogramKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Procedure"
-				value      	202)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Function"
-				value      	199)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"DoNotCreate"
-				value      	201)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ProcedureKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Procedure"
-				value      	202)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"DoNotCreate"
-				value      	201)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"FunctionKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Function"
-				value      	199)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"DoNotCreate"
-				value      	201)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"TypeControlSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"None"
-				value      	225)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"InitializationOnly"
-				value      	226)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"AssignmentFinalizationOnly"
-				value      	227)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"All"
-				value      	228)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateAccessTypeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Always"
-				value      	229)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Auto"
-				value      	230)))))
-	    (object Attribute
-		tool       	"Ada95"
-		name       	"default__Module-Spec"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"Generate"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"CopyrightNotice"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"FileName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ReturnType"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenericFormalParameters"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"AdditionalWiths"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"IsPrivate"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Ada95"
-		name       	"default__Module-Body"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"Generate"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"CopyrightNotice"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"FileName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ReturnType"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"AdditionalWiths"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"IsSubunit"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Ada95"
-		name       	"default__Operation"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SubprogramImplementation"
-			value      	("SubprogramImplementationSet" 2))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"Renames"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateOverriding"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ImplicitParameterMode"
-			value      	("ParameterModeSet" 203))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ImplicitParameterClassWide"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateAccessOperation"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"Inline"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"EntryCode"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ExitCode"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InitialCodeBody"
-			value      	"${default}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"EntryBarrierCondition"
-			value      	"True")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"Representation"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SubprogramImplementationSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Spec"
-				value      	224)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Body"
-				value      	2)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Abstract"
-				value      	221)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Renaming"
-				value      	222)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"RenamingAsBody"
-				value      	231)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Separate"
-				value      	223)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ParameterModeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"In"
-				value      	204)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Out"
-				value      	205)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"InOut"
-				value      	203)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Access"
-				value      	220)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"DoNotCreate"
-				value      	201)))))
-	    (object Attribute
-		tool       	"Ada95"
-		name       	"default__Has"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"NameIfUnlabeled"
-			value      	"The_${supplier}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"RecordFieldImplementation"
-			value      	("RecordFieldImplementationSet" 216))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"RecordFieldName"
-			value      	"${relationship}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateGet"
-			value      	("FunctionKindSet" 199))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateAccessGet"
-			value      	("FunctionKindSet" 201))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GetName"
-			value      	"Get_${relationship}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineGet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateSet"
-			value      	("ProcedureKindSet" 202))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateAccessSet"
-			value      	("ProcedureKindSet" 201))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SetName"
-			value      	"Set_${relationship}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineSet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"IsAliased"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"IsConstant"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InitialValue"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ContainerImplementation"
-			value      	("ContainerImplementationSet" 217))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ContainerGeneric"
-			value      	"List")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ContainerType"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ContainerDeclarations"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SelectorName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SelectorType"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"RecordFieldImplementationSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Component"
-				value      	216)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Discriminant"
-				value      	218)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"AccessDiscriminant"
-				value      	219)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ContainerImplementationSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Array"
-				value      	217)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Generic"
-				value      	11)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ProcedureKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Procedure"
-				value      	202)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"DoNotCreate"
-				value      	201)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"FunctionKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Function"
-				value      	199)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"DoNotCreate"
-				value      	201)))))
-	    (object Attribute
-		tool       	"Ada95"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"RecordFieldImplementation"
-			value      	("RecordFieldImplementationSet" 216))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"RecordFieldName"
-			value      	"${attribute}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateGet"
-			value      	("FunctionKindSet" 199))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateAccessGet"
-			value      	("FunctionKindSet" 201))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GetName"
-			value      	"Get_${attribute}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineGet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateSet"
-			value      	("ProcedureKindSet" 202))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateAccessSet"
-			value      	("ProcedureKindSet" 201))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SetName"
-			value      	"Set_${attribute}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineSet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"IsAliased"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"IsConstant"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InitialValue"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"Representation"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"RecordFieldImplementationSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Component"
-				value      	216)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Discriminant"
-				value      	218)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"AccessDiscriminant"
-				value      	219)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ProcedureKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Procedure"
-				value      	202)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"DoNotCreate"
-				value      	201)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"FunctionKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Function"
-				value      	199)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"DoNotCreate"
-				value      	201)))))
-	    (object Attribute
-		tool       	"Ada95"
-		name       	"default__Association"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"NameIfUnlabeled"
-			value      	"The_${targetClass}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateGet"
-			value      	("FunctionKindSet" 199))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GetName"
-			value      	"Get_${association}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineGet"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateSet"
-			value      	("ProcedureKindSet" 202))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SetName"
-			value      	"Set_${association}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineSet"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateAssociate"
-			value      	("ProcedureKindSet" 202))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"AssociateName"
-			value      	"Associate")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineAssociate"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateDissociate"
-			value      	("ProcedureKindSet" 202))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"DissociateName"
-			value      	"Dissociate")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineDissociate"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ProcedureKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Procedure"
-				value      	202)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"DoNotCreate"
-				value      	201)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"FunctionKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Function"
-				value      	199)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"DoNotCreate"
-				value      	201)))))
-	    (object Attribute
-		tool       	"Ada95"
-		name       	"default__Role"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"NameIfUnlabeled"
-			value      	"The_${targetClass}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"RecordFieldImplementation"
-			value      	("RecordFieldImplementationSet" 216))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"RecordFieldName"
-			value      	"${target}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateGet"
-			value      	("FunctionKindSet" 199))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateAccessGet"
-			value      	("FunctionKindSet" 201))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GetName"
-			value      	"Get_${target}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineGet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateSet"
-			value      	("ProcedureKindSet" 202))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"GenerateAccessSet"
-			value      	("ProcedureKindSet" 201))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SetName"
-			value      	"Set_${target}")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InlineSet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"IsAliased"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"IsConstant"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"InitialValue"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ContainerImplementation"
-			value      	("ContainerImplementationSet" 217))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ContainerGeneric"
-			value      	"List")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ContainerType"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ContainerDeclarations"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SelectorName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"SelectorType"
-			value      	"")
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ProcedureKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Procedure"
-				value      	202)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"DoNotCreate"
-				value      	201)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"RecordFieldImplementationSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Component"
-				value      	216)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Discriminant"
-				value      	218)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"AccessDiscriminant"
-				value      	219)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"ContainerImplementationSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Array"
-				value      	217)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Generic"
-				value      	11)))
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"FunctionKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"Function"
-				value      	199)
-			    (object Attribute
-				tool       	"Ada95"
-				name       	"DoNotCreate"
-				value      	201)))))
-	    (object Attribute
-		tool       	"Ada95"
-		name       	"default__Subsystem"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ada95"
-			name       	"Directory"
-			value      	"AUTO GENERATE")))
-	    (object Attribute
-		tool       	"Ada95"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"CORBA"
-		name       	"propertyId"
-		value      	"809135966")
-	    (object Attribute
-		tool       	"CORBA"
-		name       	"default__Project"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"CreateMissingDirectories"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"Editor"
-			value      	("EditorType" 100))
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"IncludePath"
-			value      	"")
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"StopOnError"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"EditorType"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"CORBA"
-				name       	"BuiltIn"
-				value      	100)
-			    (object Attribute
-				tool       	"CORBA"
-				name       	"WindowsShell"
-				value      	101)))
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"PathSeparator"
-			value      	"")))
-	    (object Attribute
-		tool       	"CORBA"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"ArrayDimensions"
-			value      	"")
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"ConstValue"
-			value      	"")
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"ImplementationType"
-			value      	"")))
-	    (object Attribute
-		tool       	"CORBA"
-		name       	"default__Module-Spec"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"AdditionalIncludes"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"CmIdentification"
-			value      	(value Text "  %X%  @(#) plugins/org.eclipse.wst.dtd/src/rose/dtdmodel.mdl, org.eclipse.wst.dtd, wtpM1, 20041122"))
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"CopyrightNotice"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"InclusionProtectionSymbol"
-			value      	"AUTO GENERATE")))
-	    (object Attribute
-		tool       	"CORBA"
-		name       	"default__Module-Body"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"AdditionalIncludes"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"CmIdentification"
-			value      	(value Text "  %X%  @(#) plugins/org.eclipse.wst.dtd/src/rose/dtdmodel.mdl, org.eclipse.wst.dtd, wtpM1, 20041122"))
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"CopyrightNotice"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"InclusionProtectionSymbol"
-			value      	"AUTO GENERATE")))
-	    (object Attribute
-		tool       	"CORBA"
-		name       	"default__Operation"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"Context"
-			value      	"")
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"OperationIsOneWay"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"CORBA"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"ArrayDimensions"
-			value      	"")
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"CaseSpecifier"
-			value      	"")
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"IsReadOnly"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"Order"
-			value      	"")))
-	    (object Attribute
-		tool       	"CORBA"
-		name       	"default__Role"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"ArrayDimensions"
-			value      	"")
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"CaseSpecifier"
-			value      	"")
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"GenerateForwardReference"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"IsReadOnly"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"Order"
-			value      	"")
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"BoundedRoleType"
-			value      	("AssocTypeSet" 47))
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"AssocTypeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"CORBA"
-				name       	"Array"
-				value      	24)
-			    (object Attribute
-				tool       	"CORBA"
-				name       	"Sequence"
-				value      	47)))))
-	    (object Attribute
-		tool       	"CORBA"
-		name       	"default__Uses"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"CORBA"
-			name       	"GenerateForwardReference"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"CORBA"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"Data Modeler"
-		name       	"propertyId"
-		value      	"809135966")
-	    (object Attribute
-		tool       	"Data Modeler"
-		name       	"default__Project"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"project"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"TableCounter"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ViewCounter"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DomainCounter"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"SPPackageCounter"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"TriggerCounter"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IndexCounter"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ConstraintCounter"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"StoreProcedureCounter"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"PrimaryKeyCounter"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ForeignKeyCounter"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"JoinCounter"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"TableSpaceCounter"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"cONTAINERCounter"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"TablePrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ViewPrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DomainPrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"TriggerPrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IndexPrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ConstraintPrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"StoreProcedurePrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"PrimaryKeyPrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ForeignKeyPrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"TableSpacePrefix"
-			value      	"")))
-	    (object Attribute
-		tool       	"Data Modeler"
-		name       	"default__Module-Spec"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"dmItem"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DMName"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsDatabase"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"TargetDatabase"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"Location"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsTableSpace"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"TableSpaceType"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsDeault"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"BufferPool"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ExtentSize"
-			value      	1)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"PrefetchSize"
-			value      	1)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"PageSize"
-			value      	4)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ManagedBy"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ContainerList"
-			value      	"")))
-	    (object Attribute
-		tool       	"Data Modeler"
-		name       	"default__Category"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"dmItem"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DMName"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"dmSchema"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"dmDomainPackage"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsSchema"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsDomainPackage"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsRootSchema"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsRootDomainPackage"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsSchemaPackage"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DatabaseID"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DBMS"
-			value      	"")))
-	    (object Attribute
-		tool       	"Data Modeler"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"dmItem"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DMName"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsTable"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsView"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsDomain"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsSPPackage"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"Synonymns"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"TableSpaceID"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"SourceId"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"SourceType"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"CorrelationName"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"SelectClause"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsUpdateable"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"CheckOption"
-			value      	"None")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsSnapShot"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsDistinct"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"PersistToServer"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsPackage"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Data Modeler"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"dmItem"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DMName"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"Ordinal"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsIdentity"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsUnique"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"NullsAllowed"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"Length"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"Scale"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ColumnType"
-			value      	"Native")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ForBitData"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DefaultValueType"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DefaultValue"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"SourceId"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"SourceType"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"OID"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Data Modeler"
-		name       	"default__Association"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"dmItem"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DMName"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsRelationship"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"SourceId"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"SourceType"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"RIMethod"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ParentUpdateRule"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ParentUpdateRuleName"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ParentDeleteRule"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ParentDeleteRuleName"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ChildInsertRestrict"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ChildInsertRestrictName"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ChildMultiplicity"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ChildMultiplicityName"
-			value      	"")))
-	    (object Attribute
-		tool       	"Data Modeler"
-		name       	"default__Role"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"dmItem"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DMName"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ConstraintName"
-			value      	"")))
-	    (object Attribute
-		tool       	"Data Modeler"
-		name       	"default__Operation"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"dmItem"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DMName"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsConstraint"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ConstraintType"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsIndex"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsTrigger"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsStoredProcedure"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsCluster"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"TableSpace"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"FillFactor"
-			value      	0)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"KeyList"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"CheckPredicate"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsUnique"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DeferalMode"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"InitialCheckTime"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"TriggerType"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsInsertEvent"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsUpdateEvent"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsDeleteEvent"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"RefOldTable"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"RefNewTable"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"RefOldRow"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"RefNewRow"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsRow"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"WhenClause"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"Language"
-			value      	"SQL")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ProcType"
-			value      	"Procedure")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsDeterministic"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ParameterStyle"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ReturnedNull"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ExternalName"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"Length"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"Scale"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ForBitData"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DefaultValue"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DefaultValueType"
-			value      	"")))
-	    (object Attribute
-		tool       	"Data Modeler"
-		name       	"default__Parameter"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"dmItem"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DMName"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsInParameter"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"IsOutParameter"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"Ordinal"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"Length"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"Scale"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"ForBitData"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DefaultValueType"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"DefaultValue"
-			value      	"")
-		    (object Attribute
-			tool       	"Data Modeler"
-			name       	"OperationID"
-			value      	"")))
-	    (object Attribute
-		tool       	"Data Modeler"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"Data Modeler Communicator"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"framework"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"Java"
-		name       	"propertyId"
-		value      	"809135966")
-	    (object Attribute
-		tool       	"Java"
-		name       	"default__Project"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Java"
-			name       	"RootDir"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"CreateMissingDirectories"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"StopOnError"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"UsePrefixes"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"AutoSync"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"NotShowRoseIDDlg"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"ShowCodegenDlg"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"GenerateRoseID"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"GenerateDefaultReturnLine"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"JavadocDefaultAuthor"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"JavadocDefaultVersion"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"JavadocDefaultSince"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"UserDefineTagName1"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"UserDefineTagApply1"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"UserDefineTagText1"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"UserDefineTagName2"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"UserDefineTagApply2"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"UserDefineTagText2"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"UserDefineTagName3"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"UserDefineTagApply3"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"UserDefineTagText3"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"JavadocNumAsterisks"
-			value      	0)
-		    (object Attribute
-			tool       	"Java"
-			name       	"MaxNumChars"
-			value      	80)
-		    (object Attribute
-			tool       	"Java"
-			name       	"Editor"
-			value      	("EditorType" 100))
-		    (object Attribute
-			tool       	"Java"
-			name       	"VM"
-			value      	("VMType" 200))
-		    (object Attribute
-			tool       	"Java"
-			name       	"ClassPath"
-			value      	".;C:\\IBM\\SQLLIB\\java\\db2java.zip;C:\\IBM\\SQLLIB\\java\\db2jcc.jar;C:\\IBM\\SQLLIB\\java\\sqlj.zip;C:\\IBM\\SQLLIB\\bin;C:\\IBM\\SQLLIB\\java\\common.jar")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ReferenceClasspath"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"EditorType"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Java"
-				name       	"BuiltIn"
-				value      	100)
-			    (object Attribute
-				tool       	"Java"
-				name       	"WindowsShell"
-				value      	101)))
-		    (object Attribute
-			tool       	"Java"
-			name       	"VMType"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Java"
-				name       	"Sun"
-				value      	200)))
-		    (object Attribute
-			tool       	"Java"
-			name       	"VAJavaWorkingFolder"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"InstanceVariablePrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ClassVariablePrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"DefaultAttributeDataType"
-			value      	"int")
-		    (object Attribute
-			tool       	"Java"
-			name       	"DefaultOperationReturnType"
-			value      	"void")
-		    (object Attribute
-			tool       	"Java"
-			name       	"NoClassCustomDlg"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"GlobalImports"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Java"
-			name       	"OpenBraceClassStyle"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"OpenBraceMethodStyle"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"UseTabs"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"UseSpaces"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"SpacingItems"
-			value      	3)
-		    (object Attribute
-			tool       	"Java"
-			name       	"RoseDefaultCommentStyle"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"AsteriskCommentStyle"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"JavaCommentStyle"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"JavadocAuthor"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"JavadocSince"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"JavadocVersion"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"BeanPrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"BeanSuffix"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"RemotePrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"RemoteSuffix"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"HomePrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"HomeSuffix"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"PrimaryKeyPrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"PrimaryKeySuffix"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBDTDLocation"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletDTDLocation"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"DefaultEJBVersion"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"DefaultServletVersion"
-			value      	"")))
-	    (object Attribute
-		tool       	"Java"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Java"
-			name       	"Final"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"Static"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"GenerateDefaultConstructor"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"ConstructorIs"
-			value      	("Ctor_Set" 62))
-		    (object Attribute
-			tool       	"Java"
-			name       	"Ctor_Set"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Java"
-				name       	"public"
-				value      	62)
-			    (object Attribute
-				tool       	"Java"
-				name       	"protected"
-				value      	63)
-			    (object Attribute
-				tool       	"Java"
-				name       	"private"
-				value      	64)
-			    (object Attribute
-				tool       	"Java"
-				name       	"package"
-				value      	65)))
-		    (object Attribute
-			tool       	"Java"
-			name       	"GenerateFinalizer"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"GenerateStaticInitializer"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"GenerateInstanceInitializer"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"GenerateCode"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"DisableAutoSync"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"ReadOnly"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Java"
-		name       	"Default_Servlet__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletName"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletContextRef"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"IsSingleThread"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletInitParameter"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletInitParameterNames"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletIsSecure"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletRequestDispatcher"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletRequestDispatcherPath"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"DispatcherInclude"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"DispatcherForward"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletSecurityRoles"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletgetInfo"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletXMLFilePath"
-			value      	"")))
-	    (object Attribute
-		tool       	"Java"
-		name       	"Http_Servlet__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletRequestAttribute"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletRequestAttributesNames"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"MethodForRequestAttributes"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletRequestParameter"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletRequestParameterNames"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"MethodForRequestParameters"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletHeader"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletHeaderNames"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"MethodForHeaders"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletIntHeader"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletDateHeader"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletCookie"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"MethodForCookie"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"ServletContentType"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"GenerateHTML"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Java"
-		name       	"Default_EJB__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Java"
-			name       	"Generate_XML_DD"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBCmpField"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBEnvironmentProperties"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBCnxFactory"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBReferences"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBSecurityRoles"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBNameInJAR"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBSessionType"
-			value      	("EJBSessionType_Set" 200))
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBSessionType_Set"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Java"
-				name       	""
-				value      	200)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Stateless"
-				value      	201)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Stateful"
-				value      	202)))
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBTransactionType"
-			value      	("EJBTransactionType_Set" 211))
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBTransactionType_Set"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Java"
-				name       	"Container"
-				value      	211)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Bean"
-				value      	212)))
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBPersistenceType"
-			value      	("EJBPersistenceType_Set" 220))
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBPersistenceType_Set"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Java"
-				name       	""
-				value      	220)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Bean"
-				value      	221)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Container"
-				value      	222)))
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBReentrant"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBSessionSync"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBVersion"
-			value      	("EJBVersion_Set" 230))
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBVersion_Set"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Java"
-				name       	"2.0"
-				value      	230)
-			    (object Attribute
-				tool       	"Java"
-				name       	"1.x"
-				value      	231)))
-		    (object Attribute
-			tool       	"Java"
-			name       	"EJBXMLFilePath"
-			value      	"")))
-	    (object Attribute
-		tool       	"Java"
-		name       	"default__Module-Spec"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Java"
-			name       	"CmIdentification"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Java"
-			name       	"CopyrightNotice"
-			value      	(value Text ""))))
-	    (object Attribute
-		tool       	"Java"
-		name       	"default__Module-Body"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Java"
-			name       	"CmIdentification"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"Java"
-			name       	"CopyrightNotice"
-			value      	(value Text ""))))
-	    (object Attribute
-		tool       	"Java"
-		name       	"default__Operation"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Java"
-			name       	"Abstract"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"Static"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"Final"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"Native"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"Synchronized"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"GenerateFullyQualifiedReturn"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"ReplaceExistingCode"
-			value      	TRUE)))
-	    (object Attribute
-		tool       	"Java"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Java"
-			name       	"Final"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"Transient"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"Volatile"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"PropertyType"
-			value      	("BeanProperty_Set" 71))
-		    (object Attribute
-			tool       	"Java"
-			name       	"BeanProperty_Set"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Java"
-				name       	"Not A Property"
-				value      	71)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Simple"
-				value      	72)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Bound"
-				value      	73)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Constrained"
-				value      	74)))
-		    (object Attribute
-			tool       	"Java"
-			name       	"IndividualChangeMgt"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"Read/Write"
-			value      	("Read/Write_Set" 81))
-		    (object Attribute
-			tool       	"Java"
-			name       	"Read/Write_Set"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Java"
-				name       	"Read & Write"
-				value      	81)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Read Only"
-				value      	82)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Write Only"
-				value      	83)))
-		    (object Attribute
-			tool       	"Java"
-			name       	"GenerateFullyQualifiedTypes"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Java"
-		name       	"default__Role"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Java"
-			name       	"ContainerClass"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"InitialValue"
-			value      	"")
-		    (object Attribute
-			tool       	"Java"
-			name       	"Final"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"Transient"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"Volatile"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"PropertyType"
-			value      	("BeanProperty_Set" 71))
-		    (object Attribute
-			tool       	"Java"
-			name       	"BeanProperty_Set"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Java"
-				name       	"Not A Property"
-				value      	71)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Simple"
-				value      	72)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Bound"
-				value      	73)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Constrained"
-				value      	74)))
-		    (object Attribute
-			tool       	"Java"
-			name       	"IndividualChangeMgt"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"Read/Write"
-			value      	("Read/Write_Set" 81))
-		    (object Attribute
-			tool       	"Java"
-			name       	"Read/Write_Set"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Java"
-				name       	"Read & Write"
-				value      	81)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Read Only"
-				value      	82)
-			    (object Attribute
-				tool       	"Java"
-				name       	"Write Only"
-				value      	83)))
-		    (object Attribute
-			tool       	"Java"
-			name       	"GenerateFullyQualifiedTypes"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Java"
-			name       	"IsNavigable"
-			value      	TRUE)))
-	    (object Attribute
-		tool       	"Java"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"Oracle8"
-		name       	"propertyId"
-		value      	"360000002")
-	    (object Attribute
-		tool       	"Oracle8"
-		name       	"default__Project"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"DDLScriptFilename"
-			value      	"DDL1.SQL")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"DropClause"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"PrimaryKeyColumnName"
-			value      	"_ID")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"PrimaryKeyColumnType"
-			value      	"NUMBER(5,0)")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"SchemaNamePrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"SchemaNameSuffix"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"TableNamePrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"TableNameSuffix"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"TypeNamePrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"TypeNameSuffix"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"ViewNamePrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"ViewNameSuffix"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"VarrayNamePrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"VarrayNameSuffix"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"NestedTableNamePrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"NestedTableNameSuffix"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"ObjectTableNamePrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"ObjectTableNameSuffix"
-			value      	"")))
-	    (object Attribute
-		tool       	"Oracle8"
-		name       	"default__Module-Spec"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"IsSchema"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Oracle8"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"OID"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"WhereClause"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"CheckConstraint"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"CollectionTypeLength"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"CollectionTypePrecision"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"CollectionTypeScale"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"CollectionOfREFS"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Oracle8"
-		name       	"default__Operation"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"MethodKind"
-			value      	("MethodKindSet" 1903))
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"OverloadID"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"OrderNumber"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"IsReadNoDataState"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"IsReadNoProcessState"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"IsWriteNoDataState"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"IsWriteNoProcessState"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"IsSelfish"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"TriggerType"
-			value      	("TriggerTypeSet" 1801))
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"TriggerEvent"
-			value      	("TriggerEventSet" 1601))
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"TriggerText"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"TriggerReferencingNames"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"TriggerForEach"
-			value      	("TriggerForEachSet" 1701))
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"TriggerWhenClause"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"MethodKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"MapMethod"
-				value      	1901)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"OrderMethod"
-				value      	1902)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"Function"
-				value      	1903)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"Procedure"
-				value      	1904)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"Operator"
-				value      	1905)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"Constructor"
-				value      	1906)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"Destructor"
-				value      	1907)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"Trigger"
-				value      	1908)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"Calculated"
-				value      	1909)))
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"TriggerTypeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"AFTER"
-				value      	1801)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"BEFORE"
-				value      	1802)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"INSTEAD OF"
-				value      	1803)))
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"TriggerForEachSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"ROW"
-				value      	1701)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"STATEMENT"
-				value      	1702)))
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"TriggerEventSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"INSERT"
-				value      	1601)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"UPDATE"
-				value      	1602)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"DELETE"
-				value      	1603)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"INSERT OR UPDATE"
-				value      	1604)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"INSERT OR DELETE"
-				value      	1605)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"UPDATE OR DELETE"
-				value      	1606)
-			    (object Attribute
-				tool       	"Oracle8"
-				name       	"INSERT OR UPDATE OR DELETE"
-				value      	1607)))))
-	    (object Attribute
-		tool       	"Oracle8"
-		name       	"default__Role"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"OrderNumber"
-			value      	"")))
-	    (object Attribute
-		tool       	"Oracle8"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"OrderNumber"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"IsUnique"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"NullsAllowed"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"Length"
-			value      	"")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"Precision"
-			value      	"2")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"Scale"
-			value      	"6")
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"IsIndex"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"IsPrimaryKey"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"CompositeUnique"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Oracle8"
-			name       	"CheckConstraint"
-			value      	"")))
-	    (object Attribute
-		tool       	"Oracle8"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"ComponentTest"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"cg"
-		name       	"propertyId"
-		value      	"809135966")
-	    (object Attribute
-		tool       	"cg"
-		name       	"default__Project"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowGenerateOverNewerAnnotations"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowGenerateOverNewerVersion"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"UseMSVC"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"HeaderFileExtension"
-			value      	"h")
-		    (object Attribute
-			tool       	"cg"
-			name       	"HeaderFileBackupExtension"
-			value      	"h~")
-		    (object Attribute
-			tool       	"cg"
-			name       	"HeaderFileTemporaryExtension"
-			value      	"h#")
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeFileExtension"
-			value      	"cpp")
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeFileBackupExtension"
-			value      	"cp~")
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeFileTemporaryExtension"
-			value      	"cp#")
-		    (object Attribute
-			tool       	"cg"
-			name       	"CreateMissingDirectories"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"StopOnError"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"ErrorLimit"
-			value      	30)
-		    (object Attribute
-			tool       	"cg"
-			name       	"Directory"
-			value      	"$ROSECPP_SOURCE")
-		    (object Attribute
-			tool       	"cg"
-			name       	"PathSeparator"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"FileNameFormat"
-			value      	"128vx_b")
-		    (object Attribute
-			tool       	"cg"
-			name       	"BooleanType"
-			value      	"int")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowTemplates"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowExplicitInstantiations"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowProtectedInheritance"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"CommentWidth"
-			value      	60)
-		    (object Attribute
-			tool       	"cg"
-			name       	"OneByValueContainer"
-			value      	"$targetClass")
-		    (object Attribute
-			tool       	"cg"
-			name       	"OneByReferenceContainer"
-			value      	"$targetClass *")
-		    (object Attribute
-			tool       	"cg"
-			name       	"OptionalByValueContainer"
-			value      	"OptionalByValue<$targetClass>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"OptionalByReferenceContainer"
-			value      	"$targetClass *")
-		    (object Attribute
-			tool       	"cg"
-			name       	"FixedByValueContainer"
-			value      	"$targetClass[$limit]")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedFixedByValueContainer"
-			value      	"$targetClass[$limit]")
-		    (object Attribute
-			tool       	"cg"
-			name       	"FixedByReferenceContainer"
-			value      	"$targetClass *[$limit]")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedFixedByReferenceContainer"
-			value      	"$targetClass *[$limit]")
-		    (object Attribute
-			tool       	"cg"
-			name       	"BoundedByValueContainer"
-			value      	"BoundedListByValue<$targetClass,$limit>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedBoundedByValueContainer"
-			value      	"BoundedSetByValue<$targetClass,$limit>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"BoundedByReferenceContainer"
-			value      	"BoundedListByReference<$targetClass,$limit>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedBoundedByReferenceContainer"
-			value      	"BoundedSetByReference<$targetClass,$limit>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnboundedByValueContainer"
-			value      	"UnboundedListByValue<$targetClass>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedUnboundedByValueContainer"
-			value      	"UnboundedSetByValue<$targetClass>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnboundedByReferenceContainer"
-			value      	"UnboundedListByReference<$targetClass>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedUnboundedByReferenceContainer"
-			value      	"UnboundedSetByReference<$targetClass>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedByValueContainer"
-			value      	"AssociationByValue<$qualtype, $qualcont>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedQualifiedByValueContainer"
-			value      	"DictionaryByValue<$qualtype, $qualcont>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedByReferenceContainer"
-			value      	"AssociationByReference<$qualtype, $qualcont>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedQualifiedByReferenceContainer"
-			value      	"DictionaryByReference<$qualtype, $qualcont>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AlwaysKeepOrphanedCode"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"cg"
-		name       	"compiler2.1__Project"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowGenerateOverNewerAnnotations"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowGenerateOverNewerVersion"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"HeaderFileExtension"
-			value      	"h")
-		    (object Attribute
-			tool       	"cg"
-			name       	"HeaderFileBackupExtension"
-			value      	"h~")
-		    (object Attribute
-			tool       	"cg"
-			name       	"HeaderFileTemporaryExtension"
-			value      	"h#")
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeFileExtension"
-			value      	"cpp")
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeFileBackupExtension"
-			value      	"cp~")
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeFileTemporaryExtension"
-			value      	"cp#")
-		    (object Attribute
-			tool       	"cg"
-			name       	"CreateMissingDirectories"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"StopOnError"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"ErrorLimit"
-			value      	30)
-		    (object Attribute
-			tool       	"cg"
-			name       	"Directory"
-			value      	"$ROSECPP_SOURCE")
-		    (object Attribute
-			tool       	"cg"
-			name       	"BooleanType"
-			value      	"int")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowTemplates"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowExplicitInstantiations"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowProtectedInheritance"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"OneByValueContainer"
-			value      	"$targetClass")
-		    (object Attribute
-			tool       	"cg"
-			name       	"OneByReferenceContainer"
-			value      	"$targetClass *")
-		    (object Attribute
-			tool       	"cg"
-			name       	"OptionalByValueContainer"
-			value      	"OptionalByValue(sizeof($targetClass))")
-		    (object Attribute
-			tool       	"cg"
-			name       	"OptionalByReferenceContainer"
-			value      	"$targetClass *")
-		    (object Attribute
-			tool       	"cg"
-			name       	"FixedByValueContainer"
-			value      	"$targetClass[$limit]")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedFixedByValueContainer"
-			value      	"$targetClass[$limit]")
-		    (object Attribute
-			tool       	"cg"
-			name       	"FixedByReferenceContainer"
-			value      	"$targetClass *[$limit]")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedFixedByReferenceContainer"
-			value      	"$targetClass *[$limit]")
-		    (object Attribute
-			tool       	"cg"
-			name       	"BoundedByValueContainer"
-			value      	"BoundedListByValue(sizeof($targetClass),$limit)")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedBoundedByValueContainer"
-			value      	"BoundedSetByValue(sizeof($targetClass),$limit)")
-		    (object Attribute
-			tool       	"cg"
-			name       	"BoundedByReferenceContainer"
-			value      	"BoundedListByReference($limit)")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedBoundedByReferenceContainer"
-			value      	"BoundedSetByReference($limit)")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnboundedByValueContainer"
-			value      	"UnboundedListByValue(sizeof($targetClass))")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedUnboundedByValueContainer"
-			value      	"UnboundedSetByValue(sizeof($targetClass))")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnboundedByReferenceContainer"
-			value      	"UnboundedListByReference")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedUnboundedByReferenceContainer"
-			value      	"UnboundedSetByReference")
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedByValueContainer"
-			value      	"AssociationByValue(sizeof($qualtype), sizeof($qualcont))")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedQualifiedByValueContainer"
-			value      	"DictionaryByValue(sizeof($qualtype), sizeof($qualcont))")
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedByReferenceContainer"
-			value      	"AssociationByReference(sizeof($qualtype), sizeof($qualcont))")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedQualifiedByReferenceContainer"
-			value      	"DictionaryByReference(sizeof($qualtype), sizeof($qualcont))")
-		    (object Attribute
-			tool       	"cg"
-			name       	"PathSeparator"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"FileNameFormat"
-			value      	"128vx_b")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AlwaysKeepOrphanedCode"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"cg"
-		name       	"compiler3.0__Project"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowGenerateOverNewerAnnotations"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowGenerateOverNewerVersion"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"HeaderFileExtension"
-			value      	"h")
-		    (object Attribute
-			tool       	"cg"
-			name       	"HeaderFileBackupExtension"
-			value      	"h~")
-		    (object Attribute
-			tool       	"cg"
-			name       	"HeaderFileTemporaryExtension"
-			value      	"h#")
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeFileExtension"
-			value      	"cpp")
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeFileBackupExtension"
-			value      	"cp~")
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeFileTemporaryExtension"
-			value      	"cp#")
-		    (object Attribute
-			tool       	"cg"
-			name       	"CreateMissingDirectories"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"StopOnError"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"ErrorLimit"
-			value      	30)
-		    (object Attribute
-			tool       	"cg"
-			name       	"Directory"
-			value      	"$ROSECPP_SOURCE")
-		    (object Attribute
-			tool       	"cg"
-			name       	"BooleanType"
-			value      	"int")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowTemplates"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowExplicitInstantiations"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowProtectedInheritance"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"OneByValueContainer"
-			value      	"$targetClass")
-		    (object Attribute
-			tool       	"cg"
-			name       	"OneByReferenceContainer"
-			value      	"$targetClass *")
-		    (object Attribute
-			tool       	"cg"
-			name       	"OptionalByValueContainer"
-			value      	"OptionalByValue<$targetClass>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"OptionalByReferenceContainer"
-			value      	"$targetClass *")
-		    (object Attribute
-			tool       	"cg"
-			name       	"FixedByValueContainer"
-			value      	"$targetClass[$limit]")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedFixedByValueContainer"
-			value      	"$targetClass[$limit]")
-		    (object Attribute
-			tool       	"cg"
-			name       	"FixedByReferenceContainer"
-			value      	"$targetClass *[$limit]")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedFixedByReferenceContainer"
-			value      	"$targetClass *[$limit]")
-		    (object Attribute
-			tool       	"cg"
-			name       	"BoundedByValueContainer"
-			value      	"BoundedListByValue<$targetClass,$limit>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedBoundedByValueContainer"
-			value      	"BoundedSetByValue<$targetClass,$limit>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"BoundedByReferenceContainer"
-			value      	"BoundedListByReference<$targetClass,$limit>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedBoundedByReferenceContainer"
-			value      	"BoundedSetByReference<$targetClass,$limit>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnboundedByValueContainer"
-			value      	"UnboundedListByValue<$targetClass>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedUnboundedByValueContainer"
-			value      	"UnboundedSetByValue<$targetClass>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnboundedByReferenceContainer"
-			value      	"UnboundedListByReference<$targetClass>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedUnboundedByReferenceContainer"
-			value      	"UnboundedSetByReference<$targetClass>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedByValueContainer"
-			value      	"AssociationByValue<$qualtype, $qualcont>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedQualifiedByValueContainer"
-			value      	"DictionaryByValue<$qualtype, $qualcont>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedByReferenceContainer"
-			value      	"AssociationByReference<$qualtype, $qualcont>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"UnorderedQualifiedByReferenceContainer"
-			value      	"DictionaryByReference<$qualtype, $qualcont>")
-		    (object Attribute
-			tool       	"cg"
-			name       	"PathSeparator"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"FileNameFormat"
-			value      	"128vx_b")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AlwaysKeepOrphanedCode"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"cg"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"ImplementationType"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"ClassKey"
-			value      	"class")
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateEmptyRegions"
-			value      	("GenerateEmptyRegionSet" 3))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateEmptyRegionSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"None"
-				value      	0)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Preserved"
-				value      	1)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Unpreserved"
-				value      	2)
-			    (object Attribute
-				tool       	"cg"
-				name       	"All"
-				value      	3)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"PutBodiesInSpec"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateDefaultConstructor"
-			value      	("GenerateSet" 199))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DefaultConstructorVisibility"
-			value      	("VisibilitySet" 45))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineDefaultConstructor"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"ExplicitDefaultConstructor"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateCopyConstructor"
-			value      	("GenerateSet" 199))
-		    (object Attribute
-			tool       	"cg"
-			name       	"CopyConstructorVisibility"
-			value      	("VisibilitySet" 45))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineCopyConstructor"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"ExplicitCopyConstructor"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateDestructor"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"DestructorVisibility"
-			value      	("VisibilitySet" 45))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DestructorKind"
-			value      	("ThreeKindSet" 200))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineDestructor"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateAssignmentOperation"
-			value      	("GenerateSet" 199))
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssignmentVisibility"
-			value      	("VisibilitySet" 45))
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssignmentKind"
-			value      	("ThreeKindSet" 200))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineAssignmentOperation"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateEqualityOperations"
-			value      	("GenerateSet" 199))
-		    (object Attribute
-			tool       	"cg"
-			name       	"EqualityVisibility"
-			value      	("VisibilitySet" 45))
-		    (object Attribute
-			tool       	"cg"
-			name       	"EqualityKind"
-			value      	("FriendKindSet" 200))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineEqualityOperations"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateRelationalOperations"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"RelationalVisibility"
-			value      	("VisibilitySet" 45))
-		    (object Attribute
-			tool       	"cg"
-			name       	"RelationalKind"
-			value      	("FriendKindSet" 200))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineRelationalOperations"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateStorageMgmtOperations"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"StorageMgmtVisibility"
-			value      	("VisibilitySet" 45))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineStorageMgmtOperations"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateSubscriptOperation"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"SubscriptVisibility"
-			value      	("VisibilitySet" 45))
-		    (object Attribute
-			tool       	"cg"
-			name       	"SubscriptKind"
-			value      	("ThreeKindSet" 200))
-		    (object Attribute
-			tool       	"cg"
-			name       	"SubscriptResultType"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineSubscriptOperation"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateDereferenceOperation"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"DereferenceVisibility"
-			value      	("VisibilitySet" 45))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DereferenceKind"
-			value      	("ThreeKindSet" 200))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DereferenceResultType"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineDereferenceOperation"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateIndirectionOperation"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"IndirectionVisibility"
-			value      	("VisibilitySet" 45))
-		    (object Attribute
-			tool       	"cg"
-			name       	"IndirectionKind"
-			value      	("ThreeKindSet" 200))
-		    (object Attribute
-			tool       	"cg"
-			name       	"IndirectionResultType"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineIndirectionOperation"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateStreamOperations"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"StreamVisibility"
-			value      	("VisibilitySet" 45))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineStreamOperations"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"ThreeKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Common"
-				value      	200)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Virtual"
-				value      	201)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Abstract"
-				value      	202)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"KindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Common"
-				value      	200)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Virtual"
-				value      	201)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Abstract"
-				value      	202)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Static"
-				value      	203)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"FriendKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Common"
-				value      	200)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Virtual"
-				value      	201)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Abstract"
-				value      	202)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Friend"
-				value      	204)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"DeclareAndDefine"
-				value      	199)
-			    (object Attribute
-				tool       	"cg"
-				name       	"DeclareOnly"
-				value      	205)
-			    (object Attribute
-				tool       	"cg"
-				name       	"DoNotDeclare"
-				value      	206)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"VisibilitySet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Public"
-				value      	45)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Protected"
-				value      	44)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Private"
-				value      	43)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Implementation"
-				value      	14)))))
-	    (object Attribute
-		tool       	"cg"
-		name       	"default__Module-Spec"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"Generate"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateEmptyRegions"
-			value      	("GenerateEmptyRegionSet" 3))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateEmptyRegionSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"None"
-				value      	0)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Preserved"
-				value      	1)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Unpreserved"
-				value      	2)
-			    (object Attribute
-				tool       	"cg"
-				name       	"All"
-				value      	3)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"CmIdentification"
-			value      	(value Text "  %X%  @(#) plugins/org.eclipse.wst.dtd/src/rose/dtdmodel.mdl, org.eclipse.wst.dtd, wtpM1, 20041122"))
-		    (object Attribute
-			tool       	"cg"
-			name       	"CopyrightNotice"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"cg"
-			name       	"FileName"
-			value      	"AUTO GENERATE")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowExtensionlessFileName"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"InclusionProtectionSymbol"
-			value      	"AUTO GENERATE")
-		    (object Attribute
-			tool       	"cg"
-			name       	"IncludeFormat"
-			value      	(value Text 
-|// $package
-|#include "$file"
-|
-			))
-		    (object Attribute
-			tool       	"cg"
-			name       	"IncludeBySimpleName"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"IncludePrecompiledHeader"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"IncludeOrder"
-			value      	"AMIR")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AdditionalIncludes"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InliningStyle"
-			value      	("InliningStyleSet" 207))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InliningStyleSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"InClassDeclaration"
-				value      	208)
-			    (object Attribute
-				tool       	"cg"
-				name       	"FollowingClassDeclaration"
-				value      	207)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"TypesDefined"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"cg"
-			name       	"IncludeClosure"
-			value      	(value Text ""))))
-	    (object Attribute
-		tool       	"cg"
-		name       	"default__Module-Body"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"Generate"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateEmptyRegions"
-			value      	("GenerateEmptyRegionSet" 3))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateEmptyRegionSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"None"
-				value      	0)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Preserved"
-				value      	1)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Unpreserved"
-				value      	2)
-			    (object Attribute
-				tool       	"cg"
-				name       	"All"
-				value      	3)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"CmIdentification"
-			value      	(value Text "  %X%  @(#) plugins/org.eclipse.wst.dtd/src/rose/dtdmodel.mdl, org.eclipse.wst.dtd, wtpM1, 20041122"))
-		    (object Attribute
-			tool       	"cg"
-			name       	"CopyrightNotice"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"cg"
-			name       	"FileName"
-			value      	"AUTO GENERATE")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AllowExtensionlessFileName"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"IncludeFormat"
-			value      	(value Text 
-|// $package
-|#include "$file"
-|
-			))
-		    (object Attribute
-			tool       	"cg"
-			name       	"IncludeBySimpleName"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"IncludePrecompiledHeader"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"IncludeOrder"
-			value      	"AMIR")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AdditionalIncludes"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InliningStyle"
-			value      	("InliningStyleSet" 207))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InliningStyleSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"InClassDeclaration"
-				value      	208)
-			    (object Attribute
-				tool       	"cg"
-				name       	"FollowingClassDeclaration"
-				value      	207)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"TypesDefined"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"cg"
-			name       	"IncludeClosure"
-			value      	(value Text ""))))
-	    (object Attribute
-		tool       	"cg"
-		name       	"default__Operation"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"OperationKind"
-			value      	("OperationKindSet" 200))
-		    (object Attribute
-			tool       	"cg"
-			name       	"OperationKindSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Common"
-				value      	200)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Virtual"
-				value      	201)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Abstract"
-				value      	202)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Static"
-				value      	203)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Friend"
-				value      	204)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateAbstractBody"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateFriendBody"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateFriendDecl"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"SpecialDeclReturnType"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"OperationIsConst"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"OperationIsExplicit"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"Inline"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"EntryCode"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"cg"
-			name       	"ExitCode"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"cg"
-			name       	"CCRegion"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateEmptyRegions"
-			value      	("GenerateEmptyRegionSet" 3))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateEmptyRegionSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"None"
-				value      	0)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Preserved"
-				value      	1)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Unpreserved"
-				value      	2)
-			    (object Attribute
-				tool       	"cg"
-				name       	"All"
-				value      	3)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"BodyAnnotations"
-			value      	"")))
-	    (object Attribute
-		tool       	"cg"
-		name       	"default__Has"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"Ordered"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"NameIfUnlabeled"
-			value      	"the_$supplier")
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateDataMember"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberName"
-			value      	"$relationship")
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberVisibility"
-			value      	("DataMemberVisibilitySet" 14))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberVisibilitySet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Public"
-				value      	45)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Protected"
-				value      	44)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Private"
-				value      	43)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Implementation"
-				value      	14)
-			    (object Attribute
-				tool       	"cg"
-				name       	"AtRelationshipVisibility"
-				value      	210)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberMutability"
-			value      	("DataMemberMutabilitySet" 0))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberMutabilitySet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Unrestricted"
-				value      	0)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Mutable"
-				value      	1)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Const"
-				value      	2)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberIsVolatile"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberFieldSize"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"InitialValue"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateGetOperation"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateSetOperation"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetName"
-			value      	"get_$relationship")
-		    (object Attribute
-			tool       	"cg"
-			name       	"SetName"
-			value      	"set_$relationship")
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetSetKinds"
-			value      	("GetSetKindsSet" 200))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetSetKindsSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Common"
-				value      	200)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Virtual"
-				value      	201)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Abstract"
-				value      	202)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Static"
-				value      	203)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Friend"
-				value      	204)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"ContainerClass"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"SelectorName"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"SelectorType"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetIsConst"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetResultIsConst"
-			value      	("GetResultIsConstSet" 2))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetResultIsConstSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"False"
-				value      	0)
-			    (object Attribute
-				tool       	"cg"
-				name       	"True"
-				value      	1)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Same_As_Function"
-				value      	2)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetSetByReference"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineGet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"SetReturnsValue"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineSet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"ForwardReferenceOnly"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"HasRelTypeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Array"
-				value      	24)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Sequence"
-				value      	47)))))
-	    (object Attribute
-		tool       	"cg"
-		name       	"default__Association"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"NameIfUnlabeled"
-			value      	"the_$targetClass")))
-	    (object Attribute
-		tool       	"cg"
-		name       	"default__Inherit"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"InstanceArguments"
-			value      	"")))
-	    (object Attribute
-		tool       	"cg"
-		name       	"default__Role"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"ForwardReferenceOnly"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"NameIfUnlabeled"
-			value      	"the_$targetClass")
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateDataMember"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberName"
-			value      	"$target")
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberVisibility"
-			value      	("DataMemberVisibilitySet" 14))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberVisibilitySet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Public"
-				value      	45)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Protected"
-				value      	44)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Private"
-				value      	43)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Implementation"
-				value      	14)
-			    (object Attribute
-				tool       	"cg"
-				name       	"AtRelationshipVisibility"
-				value      	210)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberMutability"
-			value      	("DataMemberMutabilitySet" 0))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberMutabilitySet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Unrestricted"
-				value      	0)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Mutable"
-				value      	1)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Const"
-				value      	2)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberIsVolatile"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberFieldSize"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"InitialValue"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"cg"
-			name       	"ContainerClass"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"ContainerGet"
-			value      	"$data.get($keys)")
-		    (object Attribute
-			tool       	"cg"
-			name       	"ContainerSet"
-			value      	"$data.set($keys,$value)")
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedContainer"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocClassContainer"
-			value      	"$supplier *")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocClassInitialValue"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetSetKinds"
-			value      	("GetSetKindsSet" 200))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetSetKindsSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Common"
-				value      	200)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Virtual"
-				value      	201)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Abstract"
-				value      	202)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Static"
-				value      	203)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Friend"
-				value      	204)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetSetByReference"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateGetOperation"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetName"
-			value      	"get_$target")
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetIsConst"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetResultIsConst"
-			value      	("GetResultIsConstSet" 2))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetResultIsConstSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"False"
-				value      	0)
-			    (object Attribute
-				tool       	"cg"
-				name       	"True"
-				value      	1)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Same_As_Function"
-				value      	2)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineGet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateSetOperation"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"SetName"
-			value      	"set_$target")
-		    (object Attribute
-			tool       	"cg"
-			name       	"SetReturnsValue"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineSet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedGetSetByReference"
-			value      	("QualifiedGetSetByReferenceSet" 2))
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedGetSetByReferenceSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"False"
-				value      	0)
-			    (object Attribute
-				tool       	"cg"
-				name       	"True"
-				value      	1)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Same_As_GetSetByReference"
-				value      	2)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateQualifiedGetOperation"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedGetName"
-			value      	"get_$target")
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedGetIsConst"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedGetResultIsConst"
-			value      	("GetResultIsConstSet" 2))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineQualifiedGet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateQualifiedSetOperation"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedSetName"
-			value      	"set_$target")
-		    (object Attribute
-			tool       	"cg"
-			name       	"QualifiedSetReturnsValue"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineQualifiedSet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateAssocClassDataMember"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocClassDataMemberName"
-			value      	"$target")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocClassDataMemberVisibility"
-			value      	("DataMemberVisibilitySet" 14))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberVisibilitySet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Public"
-				value      	45)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Protected"
-				value      	44)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Private"
-				value      	43)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Implementation"
-				value      	14)
-			    (object Attribute
-				tool       	"cg"
-				name       	"AtRelationshipVisibility"
-				value      	210)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocClassDataMemberMutability"
-			value      	("DataMemberMutabilitySet" 0))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberMutabilitySet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Unrestricted"
-				value      	0)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Mutable"
-				value      	1)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Const"
-				value      	2)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocClassDataMemberIsVolatile"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocClassGetSetKinds"
-			value      	("GetSetKindsSet" 200))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateAssocClassGetOperation"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocClassGetName"
-			value      	"get_$target")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocClassGetIsConst"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocClassGetResultIsConst"
-			value      	("GetResultIsConstSet" 2))
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineAssocClassGet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateAssocClassSetOperation"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocClassSetName"
-			value      	"set_$target")
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocClassSetReturnsValue"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineAssocClassSet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocClassForwardReferenceOnly"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"AssocTypeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Array"
-				value      	24)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Sequence"
-				value      	47)))))
-	    (object Attribute
-		tool       	"cg"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateDataMember"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberName"
-			value      	"$attribute")
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberVisibility"
-			value      	("DataMemberVisibilitySet" 14))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberVisibilitySet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Public"
-				value      	45)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Protected"
-				value      	44)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Private"
-				value      	43)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Implementation"
-				value      	14)
-			    (object Attribute
-				tool       	"cg"
-				name       	"AtAttributeVisibility"
-				value      	211)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberMutability"
-			value      	("DataMemberMutabilitySet" 0))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberMutabilitySet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Unrestricted"
-				value      	0)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Mutable"
-				value      	1)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Const"
-				value      	2)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberIsVolatile"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"DataMemberFieldSize"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateGetOperation"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateSetOperation"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetName"
-			value      	"get_$attribute")
-		    (object Attribute
-			tool       	"cg"
-			name       	"SetName"
-			value      	"set_$attribute")
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetSetKinds"
-			value      	("GetSetKindsSet" 200))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetSetKindsSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"Common"
-				value      	200)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Virtual"
-				value      	201)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Abstract"
-				value      	202)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Static"
-				value      	203)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Friend"
-				value      	204)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetIsConst"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetResultIsConst"
-			value      	("GetResultIsConstSet" 2))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetResultIsConstSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"False"
-				value      	0)
-			    (object Attribute
-				tool       	"cg"
-				name       	"True"
-				value      	1)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Same_As_Function"
-				value      	2)))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GetSetByReference"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineGet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"SetReturnsValue"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"InlineSet"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"CCRegion"
-			value      	"")))
-	    (object Attribute
-		tool       	"cg"
-		name       	"default__Uses"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"ForwardReferenceOnly"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"BodyReferenceOnly"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"cg"
-		name       	"default__Subsystem"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"Directory"
-			value      	"AUTO GENERATE")
-		    (object Attribute
-			tool       	"cg"
-			name       	"DirectoryIsOnSearchList"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"PrecompiledHeader"
-			value      	"")))
-	    (object Attribute
-		tool       	"cg"
-		name       	"default__Category"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"cg"
-			name       	"IsNamespace"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"cg"
-			name       	"Indent"
-			value      	2)
-		    (object Attribute
-			tool       	"cg"
-			name       	"CodeName"
-			value      	"")
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateEmptyRegions"
-			value      	("GenerateEmptyRegionSet" 3))
-		    (object Attribute
-			tool       	"cg"
-			name       	"GenerateEmptyRegionSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"cg"
-				name       	"None"
-				value      	0)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Preserved"
-				value      	1)
-			    (object Attribute
-				tool       	"cg"
-				name       	"Unpreserved"
-				value      	2)
-			    (object Attribute
-				tool       	"cg"
-				name       	"All"
-				value      	3)))))
-	    (object Attribute
-		tool       	"MSVC"
-		name       	"propertyId"
-		value      	"809135966")
-	    (object Attribute
-		tool       	"MSVC"
-		name       	"default__Project"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"Version"
-			value      	"5.0")))
-	    (object Attribute
-		tool       	"MSVC"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"Type"
-			value      	("MSVCClassTypeSet" 0))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"MSVCClassTypeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Normal"
-				value      	0)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Interface_Part"
-				value      	1)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Connection_Part"
-				value      	2)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Class_Factory"
-				value      	3)))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"CObjectFunctionality"
-			value      	("CObjectFunctionalitySet" 0))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"CObjectFunctionalitySet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"None"
-				value      	0)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Dynamic"
-				value      	1)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Dyncreate"
-				value      	2)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Serial"
-				value      	3)))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateOverrideGroup"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateDataGroup"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_DATA_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateFieldGroup"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_FIELD_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateMessageGroup"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateMessageMap"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_MSG_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"MESSAGE_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"OLEFactory"
-			value      	("OLEFactorySet" 0))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"OLEFactorySet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"None"
-				value      	0)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Built_in"
-				value      	1)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Simple"
-				value      	2)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Licensed"
-				value      	3)))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"OLEName"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"OLEClassID"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateOLECtlType"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"OLECtlType"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateOLETypeLib"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"OLETypeLibID"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"OLETypeLibMajor"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"OLETypeLibMinor"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GeneratePropPageIDs"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"OLEPropPageIDs"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateDispatchMap"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_DISPATCH_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_DISPATCH_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"DISPATCH_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"StockProperties"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"StockFunctions"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"DispatchDefValue"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateDispIdEnum"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_DISP_ID_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateInterfaceMap"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"INTERFACE_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"InitInterface"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateEventMap"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_EVENT_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_EVENT_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"EVENT_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"StockEvents"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateEventSinkMap"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_EVENTSINK_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_EVENTSINK_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"EVENTSINK_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"PropNotifySinks"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateConnectionMap"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"CONNECTION_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"ConnectionPointIID"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"InheritanceType"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"DeclSpec"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"OLECommands"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"MFCDeclares"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"MFCImplements"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"ATL_Declares"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateCOMMap"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"COM_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateConnectionPointMap"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"CONNECTION_POINT_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateMsgMap"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"MSG_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GeneratePropertyMap"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"PROPERTY_MAP_Entries"
-			value      	(value Text ""))))
-	    (object Attribute
-		tool       	"MSVC"
-		name       	"default__Operation"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"Type"
-			value      	("MSVCOperationTypeSet" 0))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"MSVCOperationTypeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Normal"
-				value      	0)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Virtual_Override"
-				value      	1)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Message_Handler"
-				value      	2)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Dispatch_Handler"
-				value      	3)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Event_Firing_Function"
-				value      	4)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Event_Sink_Handler"
-				value      	5)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Std_OLE_Method"
-				value      	6)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Command_Parser"
-				value      	7)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Property_Get_Function"
-				value      	8)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Property_Set_Function"
-				value      	9)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Property_Notify_Function"
-				value      	10)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Macro_Generated_Function"
-				value      	11)))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_MSG_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"MESSAGE_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_DISPATCH_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"DISPATCH_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_EVENT_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"EVENT_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_EVENTSINK_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"EVENTSINK_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"CallType"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"DeclSpec"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"BodyImage"
-			value      	(value Text ""))))
-	    (object Attribute
-		tool       	"MSVC"
-		name       	"default__Role"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"Type"
-			value      	("MSVCAttributeTypeSet" 0))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"MSVCAttributeTypeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Normal"
-				value      	0)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Member_Property"
-				value      	1)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Get_Set_Property"
-				value      	2)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Dialog_Data"
-				value      	3)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Field_Data"
-				value      	4)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Stock_Property"
-				value      	5)))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_DISPATCH_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"DISPATCH_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"DeclSpec"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"PointerBase"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"CallType"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"StockPropertyImplementation"
-			value      	"")))
-	    (object Attribute
-		tool       	"MSVC"
-		name       	"default__Has"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"Type"
-			value      	("MSVCAttributeTypeSet" 0))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"MSVCAttributeTypeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Normal"
-				value      	0)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Member_Property"
-				value      	1)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Get_Set_Property"
-				value      	2)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Dialog_Data"
-				value      	3)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Field_Data"
-				value      	4)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Stock_Property"
-				value      	5)))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_DISPATCH_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"DISPATCH_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"DeclSpec"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"PointerBase"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"CallType"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"StockPropertyImplementation"
-			value      	"")))
-	    (object Attribute
-		tool       	"MSVC"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"Type"
-			value      	("MSVCAttributeTypeSet" 0))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"MSVCAttributeTypeSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Normal"
-				value      	0)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Member_Property"
-				value      	1)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Get_Set_Property"
-				value      	2)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Dialog_Data"
-				value      	3)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Field_Data"
-				value      	4)
-			    (object Attribute
-				tool       	"MSVC"
-				name       	"Stock_Property"
-				value      	5)))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_DISPATCH_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"DISPATCH_MAP_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"DeclSpec"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"PointerBase"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"CallType"
-			value      	"")
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"StockPropertyImplementation"
-			value      	"")))
-	    (object Attribute
-		tool       	"MSVC"
-		name       	"default__Module-Spec"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateIncludesGroup"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_INCLUDES_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateInsertLocation"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"MSVC"
-		name       	"default__Module-Body"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateIncludesGroup"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"AFX_INCLUDES_Entries"
-			value      	(value Text ""))
-		    (object Attribute
-			tool       	"MSVC"
-			name       	"GenerateInsertLocation"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"cg"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"Rose Model Integrator"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"Rose Web Publisher"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"TopLink"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"COM"
-		name       	"propertyId"
-		value      	"783606378")
-	    (object Attribute
-		tool       	"COM"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"COM"
-			name       	"TypeKinds"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"COM"
-				name       	"enum"
-				value      	100)
-			    (object Attribute
-				tool       	"COM"
-				name       	"record"
-				value      	101)
-			    (object Attribute
-				tool       	"COM"
-				name       	"module"
-				value      	102)
-			    (object Attribute
-				tool       	"COM"
-				name       	"interface"
-				value      	103)
-			    (object Attribute
-				tool       	"COM"
-				name       	"dispinterface"
-				value      	104)
-			    (object Attribute
-				tool       	"COM"
-				name       	"coclass"
-				value      	105)
-			    (object Attribute
-				tool       	"COM"
-				name       	"alias"
-				value      	106)
-			    (object Attribute
-				tool       	"COM"
-				name       	"union"
-				value      	107)
-			    (object Attribute
-				tool       	"COM"
-				name       	"max"
-				value      	108)
-			    (object Attribute
-				tool       	"COM"
-				name       	"(none)"
-				value      	109)))
-		    (object Attribute
-			tool       	"COM"
-			name       	"Generate"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"COM"
-			name       	"kind"
-			value      	("TypeKinds" 109))
-		    (object Attribute
-			tool       	"COM"
-			name       	"uuid"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"version"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"helpstring"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"helpcontext"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"attributes"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"dllname"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"alias"
-			value      	"")))
-	    (object Attribute
-		tool       	"COM"
-		name       	"default__Operation"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"COM"
-			name       	"Generate"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"COM"
-			name       	"id"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"helpstring"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"attributes"
-			value      	"")))
-	    (object Attribute
-		tool       	"COM"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"COM"
-			name       	"Generate"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"COM"
-			name       	"id"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"helpstring"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"attributes"
-			value      	"")))
-	    (object Attribute
-		tool       	"COM"
-		name       	"default__Module-Spec"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"COM"
-			name       	"Generate"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"COM"
-			name       	"filename"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"library"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"uuid"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"version"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"helpstring"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"helpfile"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"helpcontext"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"lcid"
-			value      	"")
-		    (object Attribute
-			tool       	"COM"
-			name       	"attributes"
-			value      	"")))
-	    (object Attribute
-		tool       	"COM"
-		name       	"default__Param"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"COM"
-			name       	"attributes"
-			value      	"")))
-	    (object Attribute
-		tool       	"COM"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"Version Control"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"Visual Basic"
-		name       	"propertyId"
-		value      	"783606378")
-	    (object Attribute
-		tool       	"Visual Basic"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"UpdateCode"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"UpdateModel"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"InstancingSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Visual Basic"
-				name       	"Private"
-				value      	221)
-			    (object Attribute
-				tool       	"Visual Basic"
-				name       	"PublicNotCreatable"
-				value      	213)
-			    (object Attribute
-				tool       	"Visual Basic"
-				name       	"SingleUse"
-				value      	214)
-			    (object Attribute
-				tool       	"Visual Basic"
-				name       	"GlobalSingleUse"
-				value      	215)
-			    (object Attribute
-				tool       	"Visual Basic"
-				name       	"MultiUse"
-				value      	219)
-			    (object Attribute
-				tool       	"Visual Basic"
-				name       	"GlobalMultiUse"
-				value      	220)))
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"BaseSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Visual Basic"
-				name       	"(none)"
-				value      	222)
-			    (object Attribute
-				tool       	"Visual Basic"
-				name       	"0"
-				value      	223)
-			    (object Attribute
-				tool       	"Visual Basic"
-				name       	"1"
-				value      	224)))
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"OptionBase"
-			value      	("BaseSet" 222))
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"OptionExplicit"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"OptionCompare"
-			value      	("CompareSet" 202))
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"Instancing"
-			value      	("InstancingSet" 219))
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"CompareSet"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"Visual Basic"
-				name       	"(none)"
-				value      	202)
-			    (object Attribute
-				tool       	"Visual Basic"
-				name       	"Binary"
-				value      	203)
-			    (object Attribute
-				tool       	"Visual Basic"
-				name       	"Text"
-				value      	204)))))
-	    (object Attribute
-		tool       	"Visual Basic"
-		name       	"default__Operation"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"LibraryName"
-			value      	"")
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"AliasName"
-			value      	"")
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"IsStatic"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"ProcedureID"
-			value      	"")
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"ReplaceExistingBody"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"DefaultBody"
-			value      	(value Text ""))))
-	    (object Attribute
-		tool       	"Visual Basic"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"New"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"WithEvents"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"ProcedureID"
-			value      	"")
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"PropertyName"
-			value      	"")
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"Subscript"
-			value      	"")))
-	    (object Attribute
-		tool       	"Visual Basic"
-		name       	"default__Role"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"UpdateCode"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"New"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"WithEvents"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"FullName"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"ProcedureID"
-			value      	"")
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"PropertyName"
-			value      	"")
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"Subscript"
-			value      	"")))
-	    (object Attribute
-		tool       	"Visual Basic"
-		name       	"default__Inherit"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"ImplementsDelegation"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"FullName"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Visual Basic"
-		name       	"default__Param"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"ByVal"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"ByRef"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"Optional"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"ParamArray"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Visual Basic"
-		name       	"default__Module-Spec"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"ProjectFile"
-			value      	"")
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"UpdateCode"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"UpdateModel"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"ImportReferences"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"QuickImport"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Visual Basic"
-			name       	"ImportBinary"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Visual Basic"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"VisualStudio"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"Web Modeler"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"XML_DTD"
-		name       	"propertyId"
-		value      	"809135966")
-	    (object Attribute
-		tool       	"XML_DTD"
-		name       	"default__Project"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"CreateMissingDirectories"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"Editor"
-			value      	("EditorType" 100))
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"StopOnError"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"EditorType"
-			value      	(list Attribute_Set
-			    (object Attribute
-				tool       	"XML_DTD"
-				name       	"BuiltIn"
-				value      	100)
-			    (object Attribute
-				tool       	"XML_DTD"
-				name       	"WindowsShell"
-				value      	101)))))
-	    (object Attribute
-		tool       	"XML_DTD"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"Entity_SystemID"
-			value      	"")
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"Entity_PublicID"
-			value      	"")
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"NotationValue"
-			value      	"")
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"InternalValue"
-			value      	"")
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"ParameterEntity"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"ExternalEntity"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"Notation_SystemID"
-			value      	"")
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"Notation_PublicID"
-			value      	"")))
-	    (object Attribute
-		tool       	"XML_DTD"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"DefaultDeclType"
-			value      	"")))
-	    (object Attribute
-		tool       	"XML_DTD"
-		name       	"default__Module-Spec"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"Assign All"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"XML_DTD"
-			name       	"ComponentPath"
-			value      	"")))
-	    (object Attribute
-		tool       	"XML_DTD"
-		name       	"HiddenTool"
-		value      	FALSE)
-	    (object Attribute
-		tool       	"Ecore"
-		name       	"default__Category"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"packageName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"nsPrefix"
-			value      	"")
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"nsURI"
-			value      	"")
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"basePackage"
-			value      	"")
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"prefix"
-			value      	"")))
-	    (object Attribute
-		tool       	"Ecore"
-		name       	"default__Class"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"classifierName"
-			value      	"")))
-	    (object Attribute
-		tool       	"Ecore"
-		name       	"default__Operation"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"operationName"
-			value      	"")))
-	    (object Attribute
-		tool       	"Ecore"
-		name       	"default__Attribute"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"attributeName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"isTransient"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"isVolatile"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"isChangeable"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"isUnsettable"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"isUnique"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"isID"
-			value      	FALSE)))
-	    (object Attribute
-		tool       	"Ecore"
-		name       	"default__Role"
-		value      	(list Attribute_Set
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"referenceName"
-			value      	"")
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"isTransient"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"isVolatile"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"isChangeable"
-			value      	TRUE)
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"isUnsettable"
-			value      	FALSE)
-		    (object Attribute
-			tool       	"Ecore"
-			name       	"isResolveProxies"
-			value      	TRUE))))
-	quid       	"3A0C75F401FA"))
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/DTDFile.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/DTDFile.gif
deleted file mode 100644
index 64ee536..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/DTDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/any.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/any.gif
deleted file mode 100644
index 7017d91..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/any.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute.gif
deleted file mode 100644
index 00bb7b4..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute_list.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute_list.gif
deleted file mode 100644
index 795eb5e..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute_list.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/comment.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/comment.gif
deleted file mode 100644
index 28c2ccb..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/comment.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element.gif
deleted file mode 100644
index 01f4889..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element_ref.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element_ref.gif
deleted file mode 100644
index 749acfc..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element_ref.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/emptycontent.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/emptycontent.gif
deleted file mode 100644
index bc8e66c..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/emptycontent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity.gif
deleted file mode 100644
index 6a91888..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity_reference.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity_reference.gif
deleted file mode 100644
index d30b26b..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity_reference.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_el.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_el.gif
deleted file mode 100644
index 801c133..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_el.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_ent.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_ent.gif
deleted file mode 100644
index 2fb2ca7..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_ent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_not.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_not.gif
deleted file mode 100644
index 5909668..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_not.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_unrec.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_unrec.gif
deleted file mode 100644
index 6fd82e6..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_unrec.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_attlist_obj.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_attlist_obj.gif
deleted file mode 100644
index f849c75..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_attlist_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_comments_obj.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_comments_obj.gif
deleted file mode 100644
index c9f0945..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_comments_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/genhtmform_wiz.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/genhtmform_wiz.gif
deleted file mode 100644
index 5f54702..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/genhtmform_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/notation.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/notation.gif
deleted file mode 100644
index ce9df98..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/notation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/one.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/one.gif
deleted file mode 100644
index 694c26f..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/one.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onechoice.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onechoice.gif
deleted file mode 100644
index d13ba2e..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onechoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormore.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormore.gif
deleted file mode 100644
index 8b2b357..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormore.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormorechoice.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormorechoice.gif
deleted file mode 100644
index 96398c0..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormorechoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormoresequence.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormoresequence.gif
deleted file mode 100644
index 041db27..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormoresequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onesequence.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onesequence.gif
deleted file mode 100644
index 5f9658e..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onesequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optional.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optional.gif
deleted file mode 100644
index e7422d7..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optional.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalchoice.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalchoice.gif
deleted file mode 100644
index fb4f9bd..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalchoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalsequence.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalsequence.gif
deleted file mode 100644
index f8d5289..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalsequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/txtext.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/txtext.gif
deleted file mode 100644
index efa7a38..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/txtext.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/unrecognized_content.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/unrecognized_content.gif
deleted file mode 100644
index 358997d..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/unrecognized_content.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormore.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormore.gif
deleted file mode 100644
index daf514d..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormore.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormorechoice.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormorechoice.gif
deleted file mode 100644
index a1ac131..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormorechoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormoresequence.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormoresequence.gif
deleted file mode 100644
index 8ed4cb7..0000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormoresequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/plugin.properties b/bundles/org.eclipse.wst.dtd.core/plugin.properties
deleted file mode 100644
index 50405a6..0000000
--- a/bundles/org.eclipse.wst.dtd.core/plugin.properties
+++ /dev/null
@@ -1,19 +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
-#     
-###############################################################################
-
-providerName=Eclipse.org
-pluginName=Structured Source DTD Core
-nlFeatureName=Structured Source DTD Core NL Support
-#
-Structured_DTD_Document_Factory_Extension.name=Structured DTD Document Factory Extension
-DTD_Content_Type_Extension_Element.name=DTD
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.core/plugin.xml b/bundles/org.eclipse.wst.dtd.core/plugin.xml
deleted file mode 100644
index cc6c541..0000000
--- a/bundles/org.eclipse.wst.dtd.core/plugin.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-	<extension point="org.eclipse.wst.sse.core.modelHandler">
-		<modelHandler
-			class="org.eclipse.wst.dtd.core.internal.modelhandler.ModelHandlerForDTD"
-			associatedContentTypeId="org.eclipse.wst.dtd.core.dtdsource"
-			id="org.eclipse.wst.dtd.core.internal.modelhandler">
-		</modelHandler>
-	</extension>
-
-	<extension point="org.eclipse.wst.sse.core.taskscanner">
-		<scanner
-			id="org.eclipse.wst.dtd.core.internal.tasks.DTDFileTaskScanner"
-			class="org.eclipse.wst.dtd.core.internal.tasks.DTDFileTaskScanner"
-			contentTypeIds="org.eclipse.wst.dtd.core.dtdsource" />
-	</extension>
-
-	<extension
-		point="org.eclipse.core.filebuffers.documentCreation"
-		id="org.eclipse.wst.dtd.core.documentfactories"
-		name="%Structured_DTD_Document_Factory_Extension.name">
-		<factory
-			contentTypeId="org.eclipse.wst.dtd.core.dtdsource"
-			class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
-	</extension>
-
-	<extension point="org.eclipse.team.core.fileTypes">
-		<fileTypes
-			type="text"
-			extension="dtd" />
-		<fileTypes
-			type="text"
-			extension="mod" />
-		<fileTypes
-			type="text"
-			extension="ent" />
-	</extension>
-
-	<extension point="org.eclipse.core.runtime.contentTypes">
-		<content-type
-			file-extensions="dtd,mod,ent"
-			priority="normal"
-			name="%DTD_Content_Type_Extension_Element.name"
-			id="dtdsource"
-			base-type="org.eclipse.core.runtime.text"
-			default-charset="UTF-8">
-			<describer
-				class="org.eclipse.wst.dtd.core.internal.content.ContentDescriberForDTD" />
-		</content-type>
-	</extension>
-
-	<extension point="org.eclipse.emf.ecore.extension_parser">
-		<parser
-			type="dtd"
-			class="org.eclipse.wst.dtd.core.internal.emf.util.DTDResourceFactoryImpl">
-		</parser>
-	</extension>
-
-	<extension point="org.eclipse.emf.ecore.extension_parser">
-		<parser
-			type="ent"
-			class="org.eclipse.wst.dtd.core.internal.emf.util.DTDResourceFactoryImpl">
-		</parser>
-	</extension>
-
-	<extension point="org.eclipse.emf.ecore.generated_package">
-		<package
-			uri="DTD.xmi"
-			class="org.eclipse.wst.dtd.core.internal.emf.impl.DTDPackageImpl">
-		</package>
-	</extension>
-
-	<extension point="org.eclipse.wst.xml.core.documentFactories">
-		<factory
-			type="dtd, ent, mod, xml"
-			class="org.eclipse.wst.dtd.core.internal.contentmodel.CMDocumentFactoryDTD">
-		</factory>
-	</extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/AttNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/AttNode.java
deleted file mode 100644
index a86ddfb..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/AttNode.java
+++ /dev/null
@@ -1,95 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-public final class AttNode {
-	//
-	// attType
-	//
-	public static final int CDATA = 0, ID = 1, IDREF = 2, IDREFS = 3, ENTITY = 4, ENTITIES = 5, NMTOKEN = 6, NMTOKENS = 7, NOTATION = 8, ENUMERATION = 9, PEREFERENCE = 10;
-
-	//
-	// Keep this array in-sync with the ATTTYPE definitions
-	//
-	private static final String[] fgAttTypeString = {"CDATA", // 0 //$NON-NLS-1$
-				"ID", // 1 //$NON-NLS-1$
-				"IDREF", // 2 //$NON-NLS-1$
-				"IDREFS", // 3 //$NON-NLS-1$
-				"ENTITY", // 4 //$NON-NLS-1$
-				"ENTITIES", // 5 //$NON-NLS-1$
-				"NMTOKEN", // 6 //$NON-NLS-1$
-				"NMTOKENS", // 7 //$NON-NLS-1$
-				"NOTATION", // 8 //$NON-NLS-1$
-				"ENUMERATION", // 9 (replaced with "NMTOKEN" by SAX //$NON-NLS-1$
-								// AttributeList handler)
-				"%ENTITYREFERENCE;"}; //$NON-NLS-1$
-
-	//
-	// attDefaultType
-	//
-	public static final int NOFIXED = 1, // AttValue
-				REQUIRED = 2, // #REQUIRED
-				IMPLIED = 3, // #IMPLIED
-				FIXED = 4; // #FIXED AttValue
-
-	public String name = null;
-	public String type = null;
-	public String defaultType = null;
-	public String defaultValue = null;
-	public Vector enumList = null; // list of Notations or Enum values
-
-	public int getDeclaredType() {
-		int t = -1;
-		if (type == null)
-			return t;
-
-		if (type.startsWith("%") && type.endsWith(";")) //$NON-NLS-1$ //$NON-NLS-2$
-			return PEREFERENCE;
-
-		for (int i = 0; i < fgAttTypeString.length; i++) {
-			if (type.equals(fgAttTypeString[i])) {
-				t = i;
-				break;
-			}
-		}
-		return t;
-	}
-
-	public Enumeration elements() {
-		if (enumList == null)
-			enumList = new Vector();
-		return enumList.elements();
-	}
-
-	public int getDefaultType() {
-		if (defaultType == null)
-			return -1;
-
-		if (defaultType.startsWith("%") && defaultType.endsWith(";")) //$NON-NLS-1$ //$NON-NLS-2$
-			return PEREFERENCE;
-		else if (defaultType.equals("#REQUIRED")) //$NON-NLS-1$
-			return REQUIRED;
-		else if (defaultType.equals("#IMPLIED")) //$NON-NLS-1$
-			return IMPLIED;
-		else if (defaultType.equals("#FIXED")) //$NON-NLS-1$
-			return FIXED;
-		else
-			return NOFIXED;
-	}
-
-	public String toString() {
-		return "Att Name: " + name + " Type: " + type + " defaultType: " + defaultType + " defaultValue: " + defaultValue; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/Attlist.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/Attlist.java
deleted file mode 100644
index e42e421..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/Attlist.java
+++ /dev/null
@@ -1,146 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-public class Attlist extends BaseNode {
-	Vector attDefs = new Vector();
-
-	/**
-	 * Constructor.
-	 * 
-	 * @param name
-	 *            This attribute list's name; this value is also known as the
-	 *            Element type.
-	 */
-	public Attlist(String name, String ownerDTD) {
-		this(name, ownerDTD, null, null);
-	}
-
-	public Attlist(String name, String ownerDTD, String comment, ErrorMessage errorMessage) {
-		super(name, ownerDTD, comment, errorMessage);
-	}
-
-
-	/**
-	 * Adds the specified attribute definition to the end of this attribute
-	 * list .
-	 * 
-	 * @param attDef
-	 *            Attribute definition to add to this atribute list.
-	 * @return =true if the attribute definition does not already exist in
-	 *         this attribute list; otherwise, =false.
-	 * @see #elementAt
-	 * @see #getAttDef
-	 * @see #contains
-	 * @see #size
-	 */
-	public boolean addElement(AttNode attDef) {
-		if (contains(attDef.name))
-			return false;
-		this.attDefs.addElement(attDef);
-		return true;
-	}
-
-	/**
-	 * Returns the attribute definition at the specified <var>index</var> in
-	 * this attribute list
-	 * 
-	 * @param index
-	 *            Index into this list of attribute definitions.
-	 * @return Attribute definition at the specified index, or <var>null</var>
-	 *         if an invalid index.
-	 * @see #addElement
-	 * @see #getAttDef
-	 * @see #contains
-	 * @see #size
-	 */
-	public AttNode elementAt(int index) {
-		return (AttNode) this.attDefs.elementAt(index);
-	}
-
-	/**
-	 * Returns the attribute definition that matches the specified attribute
-	 * definition name in this attribute list.
-	 * 
-	 * @param attDefName
-	 *            Attribute definition name to match in this attribute list.
-	 * @return The matching attribute definition, or <var>null</var> if the
-	 *         attribute is not currently defined.
-	 * @see #addElement
-	 * @see #elementAt
-	 * @see #contains
-	 * @see #size
-	 * @see #elements
-	 */
-	public AttNode getAttDef(String attDefName) {
-		for (int i = 0; i < size(); i++) {
-			AttNode ad = elementAt(i);
-			if (attDefName.equals(ad.name))
-				return ad;
-		}
-		return null;
-	}
-
-	/**
-	 * Returns whether the specified attribute definition name is currently
-	 * defined in this attribute list.
-	 * 
-	 * @param attDefName
-	 *            Attribute definition name to match in this attribute list.
-	 * @return =true if <var>attDefName</var> is defined; otherwise, =false.
-	 * @see #addElement
-	 * @see #elementAt
-	 * @see #getAttDef
-	 * @see #size
-	 * @see #elements
-	 */
-	public boolean contains(String attDefName) {
-		return null != getAttDef(attDefName);
-	}
-
-	/**
-	 * Returns the number of attribute definitions in this attribute list.
-	 * 
-	 * @return Number of attribute list definitions, or <var>null</var> if no
-	 *         definitions defined.
-	 * @see #addElement
-	 * @see #elementAt
-	 * @see #getAttDef
-	 * @see #contains
-	 */
-	public int size() {
-		return this.attDefs.size();
-	}
-
-	/**
-	 * Returns an enumeration of all attribute definitions in this attribute
-	 * list.
-	 * 
-	 * @return An enumeration of all attribute definitions, or <var>null</var>
-	 *         if none specified.
-	 * @see #addElement
-	 * @see #elementAt
-	 * @see #getAttDef
-	 * @see #contains
-	 * @see #size
-	 */
-	public Enumeration elements() {
-		return this.attDefs.elements();
-	}
-
-	void setAttDefs(Vector attrs) {
-		attDefs = attrs;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/BaseNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/BaseNode.java
deleted file mode 100644
index e944b30..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/BaseNode.java
+++ /dev/null
@@ -1,66 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-
-public abstract class BaseNode {
-	protected String name = null;
-	protected ErrorMessage errorMessage = null;
-	// protected String errorMessage = null;
-	protected String comment = null;
-	protected String ownerDTD = null;
-
-	/** Default constructor. */
-	public BaseNode(String name, String ownerDTD) {
-		this(name, ownerDTD, null, null);
-	}
-
-	public BaseNode(String name, String ownerDTD, String comment, ErrorMessage errorMessage) {
-		this.name = name;
-		this.ownerDTD = ownerDTD;
-		this.comment = comment;
-		this.errorMessage = errorMessage;
-	}
-
-	public String getNodeName() {
-		return name;
-	}
-
-	public void setNodeName(String name) {
-		this.name = name;
-	}
-
-	public String getOwnerDTD() {
-		return ownerDTD;
-	}
-
-	public void setOwnerDTD(String owner) {
-		ownerDTD = owner;
-	}
-
-	public String getComment() {
-		return comment;
-	}
-
-	public void setComment(String comment) {
-		this.comment = comment;
-	}
-
-	public ErrorMessage getErrorMessage() {
-		return errorMessage;
-	}
-
-	public void setErrorMessage(ErrorMessage message) {
-		errorMessage = message;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMBasicNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMBasicNode.java
deleted file mode 100644
index d470ffb..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMBasicNode.java
+++ /dev/null
@@ -1,42 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-public class CMBasicNode extends CMNode {
-	private int type = CMNodeType.EMPTY; // possible types :
-
-	// CMNodeType.EMPTY
-	// CMNodeType.ANY
-	// CMNodeType.PCDATA
-
-	/** Default constructor. */
-	public CMBasicNode(String refName) {
-		super(refName);
-	}
-
-	public CMBasicNode(String refName, int type) {
-		super(refName);
-		this.type = type;
-	}
-
-	public int getType() {
-		return type;
-	}
-
-	public void setType(int type) {
-		this.type = type;
-	}
-
-	public String toString() {
-		return " BasicNodeName: " + getName() + " Type: " + getType() + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMGroupNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMGroupNode.java
deleted file mode 100644
index 823b2cf..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMGroupNode.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-public class CMGroupNode extends CMRepeatableNode {
-	private int type = CMNodeType.GROUP;
-	private int groupKind = CMNodeType.GROUP_SEQUENCE;
-	private Vector children = new Vector();
-
-	public CMGroupNode() {
-		super("GROUP"); //$NON-NLS-1$
-	}
-
-	public int getType() {
-		return type;
-	}
-
-	// implement super class
-	public void setType(int type) {
-		// can't change - only one type allows
-	}
-
-	public int getGroupKind() {
-		return groupKind;
-	}
-
-	public void setGroupKind(int kind) {
-		groupKind = kind;
-	}
-
-	public Vector getChildren() {
-		return children;
-	}
-
-	public void addChild(CMNode child) {
-		children.addElement(child);
-	}
-
-	public String toString() {
-		String result = "Group ( - kind: " + getGroupKind() + " OccType: " + getOccurrence() + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-		Enumeration en = children.elements();
-		while (en.hasMoreElements()) {
-			result += " " + en.nextElement(); //$NON-NLS-1$
-		}
-
-		result += "Group )"; //$NON-NLS-1$
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNode.java
deleted file mode 100644
index 1682a27b..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNode.java
+++ /dev/null
@@ -1,30 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-public abstract class CMNode {
-	private String refName;
-
-	/** Default constructor. */
-	public CMNode(String refName) {
-		this.refName = refName;
-	}
-
-	public String getName() {
-		return refName;
-	}
-
-	public abstract int getType();
-
-	public abstract void setType(int type);
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNodeType.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNodeType.java
deleted file mode 100644
index 4e85db9..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNodeType.java
+++ /dev/null
@@ -1,30 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-public interface CMNodeType {
-	static public int EMPTY = 1;
-	static public int ANY = 2;
-	static public int PCDATA = 3;
-	static public int ELEMENT_REFERENCE = 4;
-	static public int ENTITY_REFERENCE = 5;
-	static public int GROUP = 6;
-
-	static public int ONE = 7;
-	static public int OPTIONAL = 8;
-	static public int ONE_OR_MORE = 9;
-	static public int ZERO_OR_MORE = 10;
-
-	static public int GROUP_CHOICE = 11;
-	static public int GROUP_SEQUENCE = 12;
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMReferenceNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMReferenceNode.java
deleted file mode 100644
index ab59b4c..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMReferenceNode.java
+++ /dev/null
@@ -1,38 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-public class CMReferenceNode extends CMRepeatableNode {
-	private int type = CMNodeType.ELEMENT_REFERENCE;
-
-	public CMReferenceNode(String refName) {
-		this(refName, CMNodeType.ELEMENT_REFERENCE);
-	}
-
-	public CMReferenceNode(String refName, int type) {
-		super(refName);
-		this.type = type;
-	}
-
-
-	public int getType() {
-		return type;
-	}
-
-	public void setType(int type) {
-		this.type = type;
-	}
-
-	public String toString() {
-		return " RefName: " + getName() + " Type: " + getType() + " OccType: " + getOccurrence() + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMRepeatableNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMRepeatableNode.java
deleted file mode 100644
index cf6e112..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMRepeatableNode.java
+++ /dev/null
@@ -1,34 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-public abstract class CMRepeatableNode extends CMNode {
-	private int occType = CMNodeType.ONE;
-
-	public CMRepeatableNode(String refName) {
-		super(refName);
-	}
-
-	public CMRepeatableNode(String refName, int occType) {
-		super(refName);
-		this.occType = occType;
-	}
-
-	public int getOccurrence() {
-		return occType;
-	}
-
-	public void setOccurrence(int occType) {
-		this.occType = occType;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTD.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTD.java
deleted file mode 100644
index d86f9b1..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTD.java
+++ /dev/null
@@ -1,89 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-public class DTD {
-	//
-	// Constants
-	//
-
-	Vector externalElements = new Vector();
-	String name = null;
-
-	boolean isExceptionDuringParse = false;
-
-	//
-	// Constructors
-	//
-
-	/**
-	 * Constructor.
-	 */
-
-	/**
-	 * Constructor.
-	 * 
-	 * @param name
-	 *            The file name of this DTD.
-	 * @see #getName
-	 * @see #setName
-	 */
-	public DTD(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * Returns this DTD's file name.
-	 * 
-	 * @return This DTD's file name, or <var>null</var> if no name.
-	 */
-	public String getName() {
-		return this.name;
-	}
-
-	/**
-	 * Sets this DTD's file name.
-	 * 
-	 * @param name
-	 *            This DTD's name.
-	 * @see #getName
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * Returns an Enumeration instance of all external subset children of this
-	 * DTD.
-	 * 
-	 * @return An enumeration of all external subset children of this DTD.
-	 */
-	public Enumeration externalElements() {
-		return externalElements.elements();
-	}
-
-	public void addDecl(BaseNode decl) {
-		externalElements.addElement(decl);
-	}
-
-	public void setIsExceptionDuringParse(boolean on) {
-		isExceptionDuringParse = on;
-	}
-
-	public boolean getIsExceptionDuringParse() {
-		return isExceptionDuringParse;
-	}
-
-} // class DTD
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDParser.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDParser.java
deleted file mode 100644
index eae2d7b..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDParser.java
+++ /dev/null
@@ -1,768 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Stack;
-import java.util.Vector;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-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.eclipse.wst.xml.core.internal.validation.core.LazyURLInputStream;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-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.ext.LexicalHandler;
-import org.xml.sax.helpers.DefaultHandler;
-
-public class DTDParser extends DefaultHandler implements ContentHandler, DTDHandler, ErrorHandler, DeclHandler, LexicalHandler {
-	private String contentString = ""; //$NON-NLS-1$
-	private String declString = ""; //$NON-NLS-1$
-
-	/* Canonical output. */
-	protected boolean canonical;
-
-	protected XMLReader reader;
-	int entityDepth;
-
-	// dmw 11/15 private field never read locally
-	// private Vector declElements;
-	private String comment = null;
-	private ErrorMessage errorMessage = null;
-	private List errorMessages = new ArrayList();
-	private DeclNode previousDeclNode = null;
-	private DeclNode currentDeclNode = null;
-	private BaseNode lastBaseNode = null;
-
-	private boolean entityEnd = false;
-	private int lineNumber;
-
-	private DTD currentDTD = null;
-	private Vector dtdList = new Vector();
-
-	private Stack dtdStack = new Stack();
-	private Stack peRefStack = new Stack();
-	private Stack parsingPERefStack = new Stack();
-
-	private EntityPool entityPool = new EntityPool();
-	private String expandedEntityValue = null;
-	private Hashtable elementPool = new Hashtable();
-
-	boolean parsingExternalPEReference = false;
-	protected boolean expandEntityReferences = true;
-
-	private Locator locator = null;
-
-	private Locator getLocator() {
-		return locator;
-	}
-
-	public void setDocumentLocator(Locator locator) {
-		this.locator = locator;
-	}
-
-	public DTDParser(boolean canonical) throws UnsupportedEncodingException {
-		this(null, canonical);
-	}
-
-	protected DTDParser(String encoding, boolean canonical) throws UnsupportedEncodingException {
-
-		if (encoding == null)
-			encoding = "UTF-8"; //$NON-NLS-1$
-
-		this.canonical = canonical;
-		try {
-			SAXParser sparser = SAXParserFactory.newInstance().newSAXParser();
-			reader = sparser.getXMLReader();
-			reader.setProperty("http://xml.org/sax/properties/declaration-handler", this); //$NON-NLS-1$
-			reader.setProperty("http://xml.org/sax/properties/lexical-handler", this); //$NON-NLS-1$
-			reader.setContentHandler(this);
-			reader.setDTDHandler(this);
-			reader.setErrorHandler(this);
-			reader.setEntityResolver(this);
-		}
-		catch (Exception e) {
-			e.printStackTrace();
-		}
-
-	}
-
-	/* Prints the output from the SAX callbacks. */
-	public void parse(String logicalURI) {
-		try {			
-			// CS ensure that the physical URI is considered where streams are required
-			// and the logicalURI is used as the DTD's baseLocation
-			String physicalURI = URIResolverPlugin.createResolver().resolvePhysicalLocation("", "", logicalURI);
-			boolean isReadable = URIHelper.isReadableURI(physicalURI, true);
-			if (!isReadable) {
-				throw new Exception("DTD parse error. Can not read the specified URI : " + logicalURI); //$NON-NLS-1$
-			}			
-			String document = "<!DOCTYPE root SYSTEM \"" + logicalURI + "\"><root/>"; //$NON-NLS-1$ //$NON-NLS-2$
-			entityDepth = 0;
-			currentDTD = new DTD(logicalURI);
-			InputSource inputSource = new InputSource(new StringReader(document));
-			inputSource.setSystemId(logicalURI + ".xml"); //$NON-NLS-1$
-			reader.parse(inputSource);
-		}
-		catch (SAXParseException se) {
-			if (currentDTD != null)
-				currentDTD.setIsExceptionDuringParse(true);
-		}
-		catch (Exception e) {
-			if (currentDTD != null)
-				currentDTD.setIsExceptionDuringParse(true);
-		}
-
-	}
-
-	/*
-	 * @deprecated Entity references are always expanded.
-	 */
-	public void setExpandEntityReferences(boolean expandEntityReferences) {
-		this.expandEntityReferences = true;
-	}
-
-	/*
-	 * @deprecated Entity references are always expanded.
-	 */
-	public boolean getExpandEntityReferences() {
-		return expandEntityReferences;
-	}
-
-	public Vector getDTDList() {
-		return dtdList;
-	}
-
-	public Hashtable getElementPool() {
-		return elementPool;
-	}
-
-	public EntityPool getEntityPool() {
-		return entityPool;
-	}
-
-	public List getErrorMessages() {
-		return errorMessages;
-	}
-
-	//
-	// DocumentHandler methods
-	//
-
-	public void startDocument() {
-	}
-
-	public void endDocument() {
-	}
-
-	public void processingInstruction(String target, String data) {
-	}
-
-	//
-	// DTDHandler methods
-	//
-
-	public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException {
-	}
-
-	public void notationDecl(String name, String publicId, String systemId) throws SAXException {
-		startDeclaration(DeclNode.NOTATION);
-		declString = "<!NOTATION"; //$NON-NLS-1$
-		if (entityDepth == 1 || parsingExternalPEReference) {
-			String xs = " "; //$NON-NLS-1$
-			xs += name;
-			if (publicId == null)
-				xs += " SYSTEM " + "\"" + systemId + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			else
-				xs += " PUBLIC " + "\"" + publicId + "\" " + "\"" + systemId + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-			contentString += xs;
-			parseCurrentDeclaration();
-		}
-	}
-
-	//
-	// DeclHandler methods
-	//
-
-	public void elementDecl(String name, String model) throws SAXException {
-		startDeclaration(DeclNode.ELEMENT);
-		declString = "<!ELEMENT"; //$NON-NLS-1$
-
-		// KB: With early versions of Xerces 2.x, startEntity("[dtd]") used to
-		// be called before this method
-		// so entityDepth was 1. Using JAXP changed that and startEntity() is
-		// not called back anymore.
-		// Because of this, we need to handle the case where entityDepth == 0
-		// as well.
-		if (entityDepth == 0 || entityDepth == 1 || parsingExternalPEReference)
-			parseCurrentDeclarationHelper(name + " " + model); //$NON-NLS-1$
-	}
-
-	protected String attributeString = ""; //$NON-NLS-1$
-
-	public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException {
-		startDeclaration(DeclNode.ATTLIST);
-		declString = "<!ATTLIST"; //$NON-NLS-1$
-
-		attributeString += " " + aName; //$NON-NLS-1$
-		if (type != null)
-			attributeString += " " + type; //$NON-NLS-1$
-		if (valueDefault != null)
-			attributeString += " " + valueDefault; //$NON-NLS-1$
-		if (value != null)
-			attributeString += " '" + value + "'"; //$NON-NLS-1$ //$NON-NLS-2$
-
-		attributeString = eName + " " + attributeString + ">"; //$NON-NLS-1$ //$NON-NLS-2$
-		parseCurrentDeclarationHelper(attributeString);
-		attributeString = ""; //$NON-NLS-1$
-	}
-
-	public void internalEntityDecl(String name, String value) throws SAXException {
-		startDeclaration(DeclNode.INTERNAL_ENTITY);
-		declString = "<!ENTITY"; //$NON-NLS-1$
-
-		if (entityDepth == 1 || parsingExternalPEReference) {
-			// build up a string: e.g. " % STRDOM "(#PCDATA)">"
-			String xs = " "; //$NON-NLS-1$
-			if (name.startsWith("%")) { //$NON-NLS-1$
-				xs += "% "; //$NON-NLS-1$
-				xs += name.substring(1);
-			}
-			else
-				xs += name;
-
-			xs += " \"" + value + "\">"; //$NON-NLS-1$ //$NON-NLS-2$
-
-			contentString += xs;
-			// save expanded entity value
-			expandedEntityValue = value;
-			parseCurrentDeclaration();
-
-		}
-	}
-
-	public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException {
-		startDeclaration(DeclNode.EXTERNAL_ENTITY);
-		declString = "<!ENTITY"; //$NON-NLS-1$
-
-		if (entityDepth == 1 || parsingExternalPEReference) {
-			// build up a string:
-			// ex1) " % FIELD SYSTEM "oagis_fields.dtd">"
-			// ex2) " % FIELD PUBLIC "FOO">"
-			String xs = " "; //$NON-NLS-1$
-			if (name.startsWith("%")) { //$NON-NLS-1$
-				xs += "% "; //$NON-NLS-1$
-				xs += name.substring(1);
-			}
-			else
-				xs += name;
-
-			if (systemId != null)
-				xs += " SYSTEM \"" + systemId + "\">"; //$NON-NLS-1$ //$NON-NLS-2$
-			else if (publicId != null)
-				xs += " PUBLIC \"" + publicId + "\">"; //$NON-NLS-1$ //$NON-NLS-2$
-
-			contentString += xs;
-			parseCurrentDeclaration();
-		}
-	}
-
-	//
-	// LexicalHandler methods
-	//
-
-	public void startCDATA() throws SAXException {
-	}
-
-	public void endCDATA() throws SAXException {
-	}
-
-	public void startDTD(String name, String publicId, String systemId) throws SAXException {
-		dtdList.removeAllElements();
-		dtdList.addElement(currentDTD);
-	}
-
-	/**
-	 * Report the end of DTD declarations.
-	 * 
-	 * @exception SAXException
-	 *                The application may raise an exception.
-	 * @see #startDTD
-	 */
-	public void endDTD() throws SAXException {
-		startDeclaration(DeclNode.END_DTD);
-	}
-
-	/**
-	 * Report the beginning of an entity.
-	 * 
-	 * The start and end of the document entity are not reported. The start
-	 * and end of the external DTD subset are reported using the pseudo-name
-	 * "[dtd]". All other events must be properly nested within start/end
-	 * entity events.
-	 * 
-	 * @param name
-	 *            The name of the entity. If it is a parameter entity, the
-	 *            name will begin with '%'.
-	 * @exception SAXException
-	 *                The application may raise an exception.
-	 * @see #endEntity
-	 */
-
-	public void startEntity(String name) throws SAXException {
-		if (name.equals("[dtd]")) { //$NON-NLS-1$
-			startDeclaration(DeclNode.START_ENTITY_DTD);
-		}
-		else if (currentDeclNode == null) {
-			// PE reference in markupdecl section
-			if (name.startsWith("%")) { //$NON-NLS-1$
-				String peName = name.substring(1);
-				EntityDecl en = entityPool.referPara(peName);
-
-				peRefStack.push(name);
-				parsingPERefStack.push(new Boolean(parsingExternalPEReference));
-
-				String systemId = en.getSystemId();
-				String publicId = en.getPublicId();
-				if (systemId == null) {
-					parsingExternalPEReference = false;
-				}
-				else {
-					URIResolver idResolver = URIResolverPlugin.createResolver();
-					String uri = idResolver.resolve(currentDTD.getName(), publicId, systemId);
-					if (!isDTDLoaded(uri)) {
-						// not loaded
-						// out.println(" DTD not loaded .. create new DTD: "
-						// );
-						dtdStack.push(currentDTD);
-						DTD newDTD = new DTD(uri);
-						dtdList.addElement(newDTD);
-						currentDTD = newDTD;
-						parsingExternalPEReference = true;
-					}
-					else {
-						// out.println(" DTD already loaded .. " );
-						parsingExternalPEReference = false;
-					}
-				}
-			}
-		}
-		else if (entityDepth == 1 || parsingExternalPEReference) {
-			String xs = (String) reader.getProperty("http://xml.org/sax/properties/xml-string"); //$NON-NLS-1$
-			contentString += xs;
-		}
-		entityDepth++;
-	}
-
-	/**
-	 * Report the end of an entity.
-	 * 
-	 * @param name
-	 *            The name of the entity that is ending.
-	 * @exception SAXException
-	 *                The application may raise an exception.
-	 * @see #startEntity
-	 */
-	public void endEntity(String name) throws SAXException {
-		if (name.equals("[dtd]")) { //$NON-NLS-1$
-			startDeclaration(DeclNode.END_ENTITY_DTD);
-		}
-		else if (!peRefStack.empty()) {
-			parseExternalPEReference(name);
-		}
-		else if (entityDepth == 1 || parsingExternalPEReference) {
-			if (!contentString.endsWith(name + ";")) { //$NON-NLS-1$
-				String xs = (String) reader.getProperty("http://xml.org/sax/properties/xml-string"); //$NON-NLS-1$
-				contentString += xs;
-			}
-		}
-		entityDepth--;
-		entityEnd = true;
-	}
-
-	protected boolean parseExternalPEReference(String name) {
-		if (!peRefStack.empty()) {
-			if (((String) peRefStack.peek()).equals(name)) {
-				peRefStack.pop();
-				if (parsingExternalPEReference) {
-					currentDTD = (DTD) dtdStack.pop();
-					addPEReferenceNode(name);
-				}
-				parsingExternalPEReference = ((Boolean) parsingPERefStack.pop()).booleanValue();
-				return true;
-			}
-		}
-		return false;
-	}
-
-	/**
-	 * Report an XML comment anywhere in the document.
-	 * 
-	 * This callback will be used for comments inside or outside the document
-	 * element, including comments in the external DTD subset (if read).
-	 * 
-	 * @param ch
-	 *            An array holding the characters in the comment.
-	 * @param start
-	 *            The starting position in the array.
-	 * @param length
-	 *            The number of characters to use from the array.
-	 * @exception SAXException
-	 *                The application may raise an exception.
-	 */
-	public void comment(char ch[], int start, int length) throws SAXException {
-		startDeclaration(DeclNode.COMMENT);
-
-		if (comment == null)
-			comment = new String(ch, start, length);
-		else
-			comment += "\n" + new String(ch); // append all comments. //$NON-NLS-1$
-		// The comment will get reset after
-		// it has been attached to the following
-		// declaration.
-	}
-
-	//
-	// ErrorHandler methods
-	//
-
-	/* Warning. */
-	public void warning(SAXParseException ex) {
-		String error = "[Source Line] " + declString + contentString + "\n";  //$NON-NLS-1$//$NON-NLS-2$
-		error += "[Warning    ] " + getLocationString(ex) + ": " + ex.getMessage();  //$NON-NLS-1$//$NON-NLS-2$
-		setErrorInformation(ex, "warning"); //$NON-NLS-1$
-
-		parseCurrentDeclaration();
-	}
-
-	/* Error. */
-	public void error(SAXParseException ex) {
-		String error = "[Source Line] " + declString + contentString + "\n";  //$NON-NLS-1$//$NON-NLS-2$
-		error += "[Error   ] " + getLocationString(ex) + ": " + ex.getMessage();  //$NON-NLS-1$//$NON-NLS-2$
-		setErrorInformation(ex, "error"); //$NON-NLS-1$
-
-		parseCurrentDeclaration();
-	}
-
-	/* Fatal error. */
-	public void fatalError(SAXParseException ex) throws SAXException {
-		String error = "[Source Line] " + declString + contentString + "\n";  //$NON-NLS-1$//$NON-NLS-2$
-		error += "[Fatal Error] " + getLocationString(ex) + ": " + ex.getMessage();  //$NON-NLS-1$//$NON-NLS-2$
-		setErrorInformation(ex, "fatal"); //$NON-NLS-1$
-
-		parseCurrentDeclaration();
-	}
-
-	/* Returns a string of the location. */
-	private String getLocationString(SAXParseException ex) {
-		StringBuffer str = new StringBuffer();
-
-		String systemId = ex.getSystemId();
-		if (systemId != null) {
-			int index = systemId.lastIndexOf('/');
-			if (index != -1)
-				systemId = systemId.substring(index + 1);
-			str.append(systemId);
-		}
-		str.append(':');
-		str.append(ex.getLineNumber());
-		str.append(':');
-		str.append(ex.getColumnNumber());
-
-		return str.toString();
-
-	}
-
-	private void startDeclaration(int type) {
-		if (type == DeclNode.END_DTD || type == DeclNode.END_ENTITY_DTD || type == DeclNode.COMMENT || type == DeclNode.ERROR) {
-			previousDeclNode = currentDeclNode;
-			currentDeclNode = null;
-		}
-		else {
-			currentDeclNode = new DeclNode(type);
-			contentString = ""; //$NON-NLS-1$
-			declString = ""; //$NON-NLS-1$
-			expandedEntityValue = null;
-		}
-	}
-
-	private void parseCurrentDeclaration() {
-		parseCurrentDeclarationHelper(contentString);
-		contentString = ""; //$NON-NLS-1$
-	}
-
-	private void parseCurrentDeclarationHelper(String declarationString) {
-		DTDScanner scanner;
-		String name;
-
-		if (currentDeclNode == null && previousDeclNode != null && entityEnd) {
-			currentDeclNode = previousDeclNode;
-		}
-
-		// save the previous declNode
-		if (currentDeclNode != null) {
-			BaseNode baseNode = null;
-			// strip out the ending markup symbol ">"
-			if (declarationString.endsWith(">")) //$NON-NLS-1$
-				declarationString = declarationString.substring(0, declarationString.length() - 1);
-
-			int sIndex;
-			String cString;
-			int type = currentDeclNode.getType();
-			switch (type) {
-				case DeclNode.ELEMENT : {
-					name = TString.word(declarationString, 1);
-
-					// strip out the name
-					sIndex = declarationString.indexOf(name) + name.length();
-					cString = declarationString.substring(sIndex);
-
-					baseNode = new ElementDecl(name, currentDTD.getName());
-					scanner = new DTDScanner(currentDTD.getName(), cString);
-					CMNode contentModel = scanner.scanContentModel();
-					if (contentModel == null && errorMessage == null) {
-						createErrorMessage("Expecting '(' in content model", "error"); //$NON-NLS-1$ //$NON-NLS-2$
-					}
-
-					((ElementDecl) baseNode).setContentModelNode(contentModel);
-					elementPool.put(name, baseNode);
-					break;
-				}
-				case DeclNode.INTERNAL_ENTITY :
-				case DeclNode.EXTERNAL_ENTITY : {
-					if (!parseExternalPEReference(declarationString)) {
-						scanner = new DTDScanner(currentDTD.getName(), declarationString);
-						baseNode = scanner.scanEntityDecl();
-						// System.out.println("----baseNode (" +
-						// declarationString + ")" + baseNode);
-						if (type == DeclNode.INTERNAL_ENTITY && expandedEntityValue != null) {
-							((EntityDecl) baseNode).expandedValue = expandedEntityValue;
-						}
-						if (baseNode != null) {
-							entityPool.add((EntityDecl) baseNode);
-						}
-					}
-
-					break;
-				}
-				case DeclNode.NOTATION : {
-					scanner = new DTDScanner(currentDTD.getName(), declarationString);
-					baseNode = scanner.scanNotationDecl();
-					break;
-				}
-				case DeclNode.ATTLIST : {
-					name = TString.word(declarationString, 1);
-
-					// strip out the name
-					sIndex = declarationString.indexOf(name) + name.length();
-					cString = declarationString.substring(sIndex);
-
-					baseNode = new Attlist(name, currentDTD.getName());
-					scanner = new DTDScanner(currentDTD.getName(), cString.trim());
-					Vector attrs = scanner.scanAttlistDecl(entityPool);
-					String errorString = scanner.getErrorString();
-
-					if (attrs.size() > 0) {
-						((Attlist) baseNode).setAttDefs(attrs);
-					}
-					if (errorString != null) {
-						createErrorMessage(errorString, "error"); //$NON-NLS-1$
-					}
-					break;
-				}
-				default : {
-					currentDeclNode = null;
-				}
-			}
-
-			if (baseNode != null) {
-				if (comment != null) {
-					baseNode.setComment(comment);
-					comment = null;
-				}
-
-				if (errorMessage != null) {
-					baseNode.setErrorMessage(errorMessage);
-					errorMessage = null;
-				}
-
-				if (currentDeclNode != null) {
-					currentDTD.addDecl(baseNode);
-				}
-				lastBaseNode = baseNode;
-			}
-
-			currentDeclNode = null;
-		}
-		else {
-			if (lastBaseNode != null && errorMessage != null && lastBaseNode.getErrorMessage() == null) {
-				lastBaseNode.setErrorMessage(errorMessage);
-				errorMessage = null;
-			}
-		}
-	}
-
-	private void addPEReferenceNode(String name) {
-		if (name.startsWith("%")) { //$NON-NLS-1$
-			name = name.substring(1); // strip out the % from entity name
-		}
-		EntityDecl e = new EntityDecl(name, currentDTD.getName(), null, true);
-		e.setEntityReferenced(true);
-		e.setErrorMessage(errorMessage);
-		errorMessage = null;
-		currentDTD.addDecl(e);
-	}
-
-	private boolean isDTDLoaded(String uri) {
-		boolean loaded = false;
-		String list = ""; //$NON-NLS-1$
-		if (dtdList != null) {
-			Enumeration en = dtdList.elements();
-			while (en.hasMoreElements()) {
-				DTD dtd = (DTD) en.nextElement();
-				list += dtd.getName();
-				list += ","; //$NON-NLS-1$
-				if (dtd.getName().equals(uri)) {
-					loaded = true;
-					break;
-				}
-			}
-		}
-		return loaded;
-	}
-
-	public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
-		InputSource result = null;
-		URIResolver idResolver = URIResolverPlugin.createResolver();
-		String logicalURI = idResolver.resolve(currentDTD.getName(), publicId, systemId);
-        // bug 113537, ensure physical resolution gets done here
-		// right before we attempt to open a stream
-		String physicalURI = idResolver.resolvePhysicalLocation(currentDTD.getName(), publicId, logicalURI);
-		result = new InputSource(logicalURI);
-		if(!(physicalURI == null || physicalURI.equals("") || URIHelper.hasProtocol(physicalURI)))
-		{
-		  physicalURI = "file:///" + physicalURI;
-		}
-		result.setByteStream(new LazyURLInputStream(physicalURI));
-		return result;
-	}
-
-	//
-	// Main
-	//
-
-	/** Main program entry point. */
-	public static void main(String argv[]) {
-
-		// is there anything to do?
-		if (argv.length == 0) {
-			printUsage();
-			System.exit(1);
-		}
-
-		// vars
-		boolean canonical = false;
-		boolean expandEntityReferences = false;
-		DTDParser parser;
-
-		// check parameters
-		for (int i = 0; i < argv.length; i++) {
-			String arg = argv[i];
-
-			// options
-			if (arg.startsWith("-")) { //$NON-NLS-1$
-
-				if (arg.equals("-c")) { //$NON-NLS-1$
-					canonical = true;
-					continue;
-				}
-
-				if (arg.equals("-x")) { //$NON-NLS-1$
-					expandEntityReferences = true;
-					continue;
-				}
-
-				if (arg.equals("-h")) { //$NON-NLS-1$
-					printUsage();
-					System.exit(1);
-				}
-			}
-			try {
-				parser = new DTDParser(canonical);
-				parser.setExpandEntityReferences(expandEntityReferences);
-				parser.parse(arg);
-			}
-			catch (Exception e) {
-				e.printStackTrace();
-			}
-		}
-
-	} // main(String[])
-
-	/** Prints the usage. */
-	private static void printUsage() {
-
-		System.err.println("usage: java sax.DTDParser (options) uri ..."); //$NON-NLS-1$
-		System.err.println();
-		System.err.println("options:"); //$NON-NLS-1$
-		System.err.println("  -c       Canonical XML output."); //$NON-NLS-1$
-		System.err.println("  -x       Expand entity references."); //$NON-NLS-1$
-		System.err.println("  -h       This help screen."); //$NON-NLS-1$
-
-	} // printUsage()
-
-	private void setErrorInformation(SAXParseException ex, String severity) {
-		errorMessage = new ErrorMessage();
-
-		if (ex.getLineNumber() == -1) {
-			errorMessage.setErrorLine(lineNumber);
-		}
-		else {
-			errorMessage.setErrorLine(ex.getLineNumber());
-		}
-
-
-		errorMessage.setErrorMessage(ex.getMessage());
-		errorMessage.setErrorColumn(ex.getColumnNumber());
-		errorMessage.setSeverity(severity);
-		errorMessages.add(errorMessage);
-	}
-
-	private void createErrorMessage(String message, String severity) {
-		errorMessage = new ErrorMessage();
-
-		Locator locator = getLocator();
-
-		errorMessage.setErrorLine(locator.getLineNumber());
-		errorMessage.setErrorColumn(locator.getColumnNumber());
-
-		errorMessage.setErrorMessage(message);
-		errorMessage.setSeverity(severity);
-
-		errorMessages.add(errorMessage);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDSaxArtifactVisitor.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDSaxArtifactVisitor.java
deleted file mode 100644
index ed96bb1..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDSaxArtifactVisitor.java
+++ /dev/null
@@ -1,64 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-import java.util.Enumeration;
-
-
-
-public class DTDSaxArtifactVisitor {
-	public void visitDTD(DTD dtd) {
-		Enumeration en = dtd.externalElements();
-
-		while (en.hasMoreElements()) {
-			Object e = en.nextElement();
-			if (e instanceof EntityDecl) {
-				visitEntityDecl((EntityDecl) e);
-			}
-			else if (e instanceof ElementDecl) {
-				visitElementDecl((ElementDecl) e);
-			}
-			else if (e instanceof NotationDecl) {
-				visitNotationDecl((NotationDecl) e);
-			}
-		}
-	}
-
-	public void visitNotationDecl(NotationDecl notation) {
-	}
-
-	public void visitElementDecl(ElementDecl element) {
-	}
-
-	public void visitEntityDecl(EntityDecl entity) {
-		if (entity.isEntityReferenced()) {
-			visitParameterEntityReferenceDecl(entity);
-		}
-		else {
-			if (entity.isExternal()) {
-				visitExternalEntityDecl(entity);
-			}
-			else {
-				visitInternalEntityDecl(entity);
-			}
-		}
-	}
-
-	public void visitParameterEntityReferenceDecl(EntityDecl entity) {
-	}
-
-	public void visitExternalEntityDecl(EntityDecl entity) {
-	}
-
-	public void visitInternalEntityDecl(EntityDecl entity) {
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDScanner.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDScanner.java
deleted file mode 100644
index 7027058..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDScanner.java
+++ /dev/null
@@ -1,1126 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-import java.util.Vector;
-
-/**
- * Scanning / parsing the content string from the Decl statement
- * 
- * @version
- */
-public class DTDScanner {
-	// element content model strings
-	private static final char[] empty_string = {'E', 'M', 'P', 'T', 'Y'};
-	private static final char[] any_string = {'A', 'N', 'Y'};
-	private static final char[] pcdata_string = {'#', 'P', 'C', 'D', 'A', 'T', 'A'};
-
-	// attribute type and default type strings
-	private static final char[] cdata_string = {'C', 'D', 'A', 'T', 'A'};
-	private static final char[] id_string = {'I', 'D'};
-	private static final char[] ref_string = {'R', 'E', 'F'};
-	private static final char[] entit_string = {'E', 'N', 'T', 'I', 'T'};
-	private static final char[] ies_string = {'I', 'E', 'S'};
-	private static final char[] nmtoken_string = {'N', 'M', 'T', 'O', 'K', 'E', 'N'};
-	private static final char[] notation_string = {'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N'};
-	private static final char[] required_string = {'#', 'R', 'E', 'Q', 'U', 'I', 'R', 'E', 'D'};
-	private static final char[] implied_string = {'#', 'I', 'M', 'P', 'L', 'I', 'E', 'D'};
-	private static final char[] fixed_string = {'#', 'F', 'I', 'X', 'E', 'D'};
-
-	private static final char[] system_string = {'S', 'Y', 'S', 'T', 'E', 'M'};
-	private static final char[] public_string = {'P', 'U', 'B', 'L', 'I', 'C'};
-	private static final char[] ndata_string = {'N', 'D', 'A', 'T', 'A'};
-
-	private int[] fOpStack = null;
-	private CMGroupNode[] fGrpStack = null;
-
-	private EntityPool entityPool;
-
-	/* Attribute Def scanner state */
-	static final int Att_Scanner_State_Name = 1, Att_Scanner_State_Type = 2, Att_Scanner_State_DefaultType = 3, Att_Scanner_State_DefaultValue = 4;
-
-	private StringParser contentString;
-	private String cData;
-	private int prevNodeOffset = 0;
-	private int nodeOffset = 1;
-	private String ownerDTD;
-
-	private String errorString;
-
-	public DTDScanner(String ownerDTD, String cm) {
-		// System.out.println("Cm: " + cm);
-		contentString = new StringParser(cm);
-		cData = cm;
-		this.ownerDTD = ownerDTD;
-	}
-
-	//
-	// [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
-	//
-	// Specific to VisualDTD : also allows %PEReference;
-	//
-	public CMNode scanContentModel() {
-		CMNode cmNode = null;
-		contentString.skipPastSpaces();
-		if (contentString.skippedString(empty_string)) {
-			cmNode = new CMBasicNode("EMPTY", CMNodeType.EMPTY); //$NON-NLS-1$
-		}
-		else if (contentString.skippedString(any_string)) {
-			cmNode = new CMBasicNode("ANY", CMNodeType.ANY); //$NON-NLS-1$
-		}
-		else if (contentString.lookingAtChar('%', true)) {
-			cmNode = new CMReferenceNode(contentString.getData(), CMNodeType.ENTITY_REFERENCE);
-		}
-		else if (!contentString.lookingAtChar('(', true)) {
-			// This means that the contentmodel string is bad...
-			// System.out.println("!!! exception - no (");
-			return cmNode;
-		}
-		else {
-			// System.out.println("Remaining String = " +
-			// contentString.getRemainingString());
-
-			contentString.skipPastSpaces();
-			boolean skippedPCDATA = contentString.skippedString(pcdata_string);
-			if (skippedPCDATA) {
-				cmNode = scanMixed();
-			}
-			else {
-				cmNode = scanChildren();
-			}
-
-		}
-		return cmNode;
-	}
-
-	//
-	// [51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' | '(' S?
-	// '#PCDATA' S? ')'
-	//
-	// Called after scanning past '(' S? '#PCDATA'
-	//
-	private CMNode scanMixed() {
-		// System.out.println("ScanMixed...");
-		CMGroupNode cmNode = new CMGroupNode();
-		cmNode.setGroupKind(CMNodeType.GROUP_CHOICE);
-		cmNode.addChild(new CMBasicNode("#PCDATA", CMNodeType.PCDATA)); //$NON-NLS-1$
-
-		// int prevNodeIndex = -1;
-		boolean starRequired = false;
-
-
-		while (true) {
-			if (contentString.lookingAtSpace(true)) {
-				contentString.skipPastSpaces();
-			}
-			prevNodeOffset = contentString.getCurrentOffset();
-
-			if (!contentString.lookingAtChar('|', true)) {
-				if (!contentString.lookingAtChar(')', true)) {
-					break;
-				}
-				if (contentString.lookingAtChar('*', true)) {
-					cmNode.setOccurrence(CMNodeType.ZERO_OR_MORE);
-				}
-				else if (starRequired) {
-					// System.out.println(" * is required ... ");
-				}
-				break;
-			}
-
-			if (contentString.lookingAtSpace(true)) {
-				contentString.skipPastSpaces();
-			}
-
-			nodeOffset = contentString.getCurrentOffset();
-			if (nodeOffset != -1) {
-				// skip pass "|"
-				prevNodeOffset = nodeOffset;
-			}
-
-			starRequired = true;
-			contentString.skipPastNameAndPEReference(')');
-			nodeOffset = contentString.getCurrentOffset();
-
-			if (nodeOffset == -1)
-				break;
-
-			// add leave node
-			int len = nodeOffset - prevNodeOffset;
-			String refName = contentString.getString(prevNodeOffset, len);
-			prevNodeOffset = nodeOffset;
-			if (refName.startsWith("%")) //$NON-NLS-1$
-				cmNode.addChild(new CMReferenceNode(refName, CMNodeType.ENTITY_REFERENCE));
-			else
-				cmNode.addChild(new CMReferenceNode(refName, CMNodeType.ELEMENT_REFERENCE));
-
-		} // end while
-
-
-		if (cmNode.getChildren().size() == 1) {
-			// simplify the contentModel if the CMGroupNode only has one child
-			// node.
-			return (CMBasicNode) cmNode.getChildren().elementAt(0);
-		}
-
-		return cmNode;
-	}
-
-	//
-	// [47] children ::= (choice | seq) ('?' | '*' | '+')?
-	// [49] choice ::= '(' S? cp ( S? '|' S? cp )* S? ')'
-	// [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
-	// [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
-	//
-	// Called after scanning past '('
-
-	private CMNode scanChildren() {
-
-		// System.out.println("scanChildren...");
-
-		if (contentString.lookingAtSpace(true)) {
-			contentString.skipPastSpaces();
-		}
-
-		prevNodeOffset = contentString.getCurrentOffset();
-		nodeOffset = contentString.getCurrentOffset();
-		int depth = 1;
-		initializeContentModelStack(depth);
-		int len;
-
-		String nodeName;
-		CMGroupNode cmNode = new CMGroupNode();
-		fGrpStack[depth] = cmNode;
-
-		while (true) {
-
-			// System.out.println(" Begin outter while loop ..." );
-			if (contentString.lookingAtChar('(', true)) {
-				if (contentString.lookingAtSpace(true)) {
-					// skip past any white spaces after the '('
-					contentString.skipPastSpaces();
-				}
-
-				depth++;
-				initializeContentModelStack(depth);
-				fGrpStack[depth] = new CMGroupNode();
-				fGrpStack[depth - 1].addChild(fGrpStack[depth]);
-				continue;
-			}
-
-			prevNodeOffset = contentString.getCurrentOffset();
-			contentString.skipPastNameAndPEReference(')');
-			nodeOffset = contentString.getCurrentOffset();
-
-			/*
-			 * System.out.println(" prevNodeOFfset " + prevNodeOffset);
-			 * System.out.println(" currentNodeOFfset " + nodeOffset);
-			 */
-
-			len = nodeOffset - prevNodeOffset;
-
-			if (nodeOffset == -1 || len < 1) {
-				break;
-			}
-
-			nodeName = contentString.getString(prevNodeOffset, len);
-
-			CMRepeatableNode rn;
-			if (nodeName.startsWith("%")) { //$NON-NLS-1$
-				rn = new CMReferenceNode(nodeName, CMNodeType.ENTITY_REFERENCE);
-			}
-			else {
-				rn = new CMReferenceNode(nodeName, CMNodeType.ELEMENT_REFERENCE);
-			}
-
-			fGrpStack[depth].addChild(rn);
-
-			prevNodeOffset = nodeOffset;
-
-			if (contentString.lookingAtChar('?', true)) {
-				rn.setOccurrence(CMNodeType.OPTIONAL);
-			}
-			else if (contentString.lookingAtChar('*', true)) {
-				rn.setOccurrence(CMNodeType.ZERO_OR_MORE);
-			}
-			else if (contentString.lookingAtChar('+', true)) {
-				rn.setOccurrence(CMNodeType.ONE_OR_MORE);
-			}
-
-			if (contentString.lookingAtSpace(true)) {
-				contentString.skipPastSpaces();
-			}
-
-			prevNodeOffset = contentString.getCurrentOffset();
-
-			while (true) {
-				// System.out.println(" Begin inner while loop ... depth " +
-				// depth );
-				if (fOpStack[depth] != CMNodeType.GROUP_SEQUENCE && contentString.lookingAtChar('|', true)) {
-					fOpStack[depth] = CMNodeType.GROUP_CHOICE;
-					fGrpStack[depth].setGroupKind(CMNodeType.GROUP_CHOICE);
-					if (contentString.lookingAtSpace(true))
-						contentString.skipPastSpaces();
-					break;
-				}
-				else if (fOpStack[depth] != CMNodeType.GROUP_CHOICE && contentString.lookingAtChar(',', true)) {
-					fOpStack[depth] = CMNodeType.GROUP_SEQUENCE;
-					fGrpStack[depth].setGroupKind(CMNodeType.GROUP_SEQUENCE);
-					if (contentString.lookingAtSpace(true))
-						contentString.skipPastSpaces();
-					break;
-				}
-				else {
-					if (contentString.lookingAtSpace(true)) {
-						contentString.skipPastSpaces();
-					}
-					if (!contentString.lookingAtChar(')', true)) {
-						// System.out.println(" error ) not found");
-					}
-					// end of the curent group node
-					if (contentString.lookingAtChar('?', true)) {
-						fGrpStack[depth].setOccurrence(CMNodeType.OPTIONAL);
-					}
-					else if (contentString.lookingAtChar('*', true)) {
-						fGrpStack[depth].setOccurrence(CMNodeType.ZERO_OR_MORE);
-					}
-					else if (contentString.lookingAtChar('+', true)) {
-						fGrpStack[depth].setOccurrence(CMNodeType.ONE_OR_MORE);
-					}
-					depth--;
-					if (depth == 0) {
-						break;
-					}
-					if (contentString.lookingAtSpace(true))
-						contentString.skipPastSpaces();
-
-					// System.out.println(" End end inner while loop ... depth
-					// " + depth );
-
-				}
-			} // inner while
-
-			if (depth == 0) {
-				break;
-			}
-		} // outer while
-
-		if (cmNode.getChildren().size() == 1) {
-			// simplify the contentModel if the CMGroupNode only has one child
-			// node and that node is an element ref.
-			CMRepeatableNode rn = (CMRepeatableNode) cmNode.getChildren().elementAt(0);
-			if (rn instanceof CMReferenceNode) {
-				CMReferenceNode ref = (CMReferenceNode) rn;
-				if (ref.getType() == CMNodeType.ELEMENT_REFERENCE) {
-					if (ref.getOccurrence() == CMNodeType.ONE) {
-						ref.setOccurrence(cmNode.getOccurrence());
-						return ref;
-					}
-					else if (cmNode.getOccurrence() == CMNodeType.ONE) {
-						return ref;
-					}
-				} // end of if ()
-			}
-		}
-
-		return cmNode;
-	}
-
-	//
-	// [52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'
-	// [53] AttDef ::= S Name S AttType S DefaultDecl
-	// [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)?
-	// AttValue)
-	//
-
-	public Vector scanAttlistDecl(EntityPool entityPool) {
-		Vector attList = new Vector();
-		this.entityPool = entityPool;
-
-		int scannerState = Att_Scanner_State_Name;
-		
-		AttNode attNode;
-
-		while (true) {
-			attNode = new AttNode();
-
-			// System.out.println(" scanner state: " + scannerState);
-
-			// scanning att name
-			if (scannerState == Att_Scanner_State_Name) {
-				// System.out.println("scan att Name...");
-				scannerState = checkForAttributeWithPEReference(attNode, scannerState);
-				if (scannerState == -1) {
-					return attList;
-				}
-			}
-
-			// scanning att type
-			if (scannerState == Att_Scanner_State_Type) {
-				// System.out.println("scan att type...");
-
-				if (contentString.skippedString(cdata_string)) {
-					attNode.type = new String(cdata_string);
-					scannerState = Att_Scanner_State_DefaultType;
-				}
-				else if (contentString.skippedString(id_string)) {
-					if (!contentString.skippedString(ref_string)) {
-						attNode.type = new String(id_string);
-					}
-					else if (!contentString.lookingAtChar('S', true)) {
-						attNode.type = "IDREF"; //$NON-NLS-1$
-					}
-					else {
-						attNode.type = "IDREFS"; //$NON-NLS-1$
-					}
-					scannerState = Att_Scanner_State_DefaultType;
-				}
-				else if (contentString.skippedString(entit_string)) {
-					if (contentString.lookingAtChar('Y', true)) {
-						attNode.type = "ENTITY"; //$NON-NLS-1$
-					}
-					else if (contentString.skippedString(ies_string)) {
-						attNode.type = "ENTITIES"; //$NON-NLS-1$
-					}
-					scannerState = Att_Scanner_State_DefaultType;
-				}
-				else if (contentString.skippedString(nmtoken_string)) {
-					if (contentString.lookingAtChar('S', true)) {
-						attNode.type = "NMTOKENS"; //$NON-NLS-1$
-					}
-					else {
-						attNode.type = "NMTOKEN"; //$NON-NLS-1$
-					}
-					scannerState = Att_Scanner_State_DefaultType;
-				}
-				else if (contentString.skippedString(notation_string)) {
-					if (contentString.lookingAtSpace(true)) {
-						contentString.skipPastSpaces();
-					}
-					if (!contentString.lookingAtChar('(', true)) {
-						System.out.println(" missing ( in notation "); //$NON-NLS-1$
-					}
-					attNode.type = "NOTATION"; //$NON-NLS-1$
-					attNode.enumList = scanEnumeration(contentString, true);
-					scannerState = Att_Scanner_State_DefaultType;
-				}
-				else if (contentString.lookingAtChar('(', true)) {
-					attNode.type = "ENUMERATION"; //$NON-NLS-1$
-					attNode.enumList = scanEnumeration(contentString, false);
-					scannerState = Att_Scanner_State_DefaultType;
-				}
-				else {
-					scannerState = checkForAttributeWithPEReference(attNode, scannerState);
-					if (scannerState == Att_Scanner_State_Type) {
-						setErrorString("Failed to find type for attribute '" + attNode.name + "'.  Please refer to the original DTD file."); //$NON-NLS-1$ //$NON-NLS-2$
-						// we failed to find a type for this attribute
-						return attList;
-					}
-				}
-			}
-
-			if (scannerState == Att_Scanner_State_DefaultType) {
-				contentString.skipPastSpaces();
-				// System.out.println("scan default type...");
-				if (contentString.skippedString(required_string)) {
-					attNode.defaultType = new String(required_string);
-				}
-				else if (contentString.skippedString(implied_string)) {
-					attNode.defaultType = new String(implied_string);
-				}
-				else {
-					if (contentString.skippedString(fixed_string)) {
-						contentString.skipPastSpaces();
-						attNode.defaultType = new String(fixed_string);
-					}
-					else
-						// "default"
-						attNode.defaultType = "NOFIXED"; //$NON-NLS-1$
-
-					if (contentString.lookingAtSpace(true))
-						contentString.skipPastSpaces();
-					attNode.defaultValue = scanDefaultAttValue(contentString);
-				}
-				scannerState = Att_Scanner_State_Name; // next
-			}
-
-
-			attList.addElement(attNode);
-			if (contentString.lookingAtSpace(true))
-				contentString.skipPastSpaces();
-			nodeOffset = contentString.getCurrentOffset();
-
-			if (nodeOffset >= cData.length())
-				return attList;
-
-			prevNodeOffset = contentString.getCurrentOffset();
-
-		}// end while loop
-	}
-
-	//
-	// content model stack
-	//
-	private void initializeContentModelStack(int depth) {
-		if (fOpStack == null) {
-			fOpStack = new int[8];
-			fGrpStack = new CMGroupNode[8];
-		}
-		else if (depth == fOpStack.length) {
-			int[] newStack = new int[depth * 2];
-			System.arraycopy(fOpStack, 0, newStack, 0, depth);
-			fOpStack = newStack;
-
-			CMGroupNode[] newGrpStack = new CMGroupNode[depth * 2];
-			System.arraycopy(fGrpStack, 0, newGrpStack, 0, depth);
-			fGrpStack = newGrpStack;
-		}
-		fOpStack[depth] = -1;
-		fGrpStack[depth] = null;
-	}
-
-	//
-	private int checkForAttributeWithPEReference(AttNode attNode, int scannerState) {
-		int state = -1;
-		int len;
-		String rawText;
-		EntityDecl pEntity;
-
-		// System.out.println(" checkforATTPERReference- start scannerState: "
-		// + scannerState);
-		if (scannerState == Att_Scanner_State_Name) {
-			contentString.skipPastNameAndPEReference(' ');
-			nodeOffset = contentString.getCurrentOffset();
-			len = nodeOffset - prevNodeOffset;
-
-			rawText = contentString.getString(prevNodeOffset, len);
-			attNode.name = rawText;
-
-			// System.out.println("State_name : " + rawText);
-
-			if (rawText.startsWith("%") && rawText.endsWith(";")) { //$NON-NLS-1$ //$NON-NLS-2$
-				String pe = rawText.substring(1, rawText.length() - 1);
-
-				pEntity = entityPool.referPara(pe);
-				if (pEntity != null) {
-					// System.out.println(" name :" + rawText +" expandTo:" +
-					// pEntity.expandedValue);
-					state = whatIsTheNextAttributeScanningState(pEntity.expandedValue, scannerState);
-					// System.out.println("checkForAttrwithPER - nextstate: "
-					// + state);
-				}
-				else
-					state = Att_Scanner_State_Type;
-			}
-			else
-				state = Att_Scanner_State_Type;
-
-		}
-		else if (scannerState == Att_Scanner_State_Type) {
-			if (contentString.lookingAtChar('%', true)) {
-				rawText = getPEName();
-				attNode.type = "%" + rawText; //$NON-NLS-1$
-				String peName = rawText.substring(0, rawText.length() - 1);
-				// System.out.println("State_type : pe- " + peName);
-				pEntity = entityPool.referPara(peName);
-				if (pEntity != null) {
-					state = whatIsTheNextAttributeScanningState(pEntity.expandedValue, scannerState);
-				}
-				else
-					state = Att_Scanner_State_DefaultType;
-			}
-			else
-				state = Att_Scanner_State_Type;
-		}
-		else if (scannerState == Att_Scanner_State_DefaultType) {
-			if (contentString.lookingAtChar('%', true)) {
-				rawText = getPEName();
-				attNode.defaultType = rawText;
-				// System.out.println("State_defaultType : " + rawText);
-				pEntity = entityPool.referPara(rawText.substring(1, rawText.length() - 1));
-				if (pEntity != null) {
-					state = whatIsTheNextAttributeScanningState(pEntity.expandedValue, scannerState);
-				}
-				else
-					state = Att_Scanner_State_DefaultValue;
-			}
-			else
-				state = Att_Scanner_State_DefaultType;
-		}
-		else if (scannerState == Att_Scanner_State_DefaultValue) {
-			if (contentString.lookingAtChar('%', true)) {
-				rawText = getPEName();
-				attNode.defaultValue = rawText;
-				// System.out.println("State_defaultValue : " + rawText);
-
-				pEntity = entityPool.referPara(rawText.substring(1, rawText.length() - 1));
-				if (pEntity != null) {
-					state = whatIsTheNextAttributeScanningState(pEntity.expandedValue, scannerState);
-				}
-				else
-					state = Att_Scanner_State_DefaultValue;
-			}
-			else
-				state = Att_Scanner_State_DefaultValue;
-		}
-
-		if (contentString.lookingAtSpace(true))
-			contentString.skipPastSpaces();
-		prevNodeOffset = contentString.getCurrentOffset();
-		return state;
-	}
-
-	private String getPEName() {
-		prevNodeOffset = contentString.getCurrentOffset();
-		contentString.skipToChar(';', true);
-		nodeOffset = contentString.getCurrentOffset();
-		int len = nodeOffset - prevNodeOffset;
-		return contentString.getString(prevNodeOffset, len);
-	}
-
-	private int whatIsTheNextAttributeScanningState(String attrContentString, int currentState) {
-		StringParser sp = new StringParser(attrContentString.trim());
-
-
-		int nextState = currentState;
-		int nOffset = 0;
-
-		/*
-		 * System.out.println("WhatistheNext AttContentStringt : " +
-		 * attrContentString); System.out.println("WhatistheNext
-		 * AttContentStringL : " + attrContentString.length());
-		 * System.out.println("WhatistheNext currentstate : " + currentState);
-		 */
-
-		while (true) {
-			// System.out.println("WhatistheNext inside whil nextstate : " +
-			// nextState);
-			if (nextState == Att_Scanner_State_Name) { // the current
-														// scanning state is
-														// Attr Name, is the
-														// next part Attr Type
-														// ?
-				if (isAttrName(sp)) {
-					nextState = Att_Scanner_State_Type;
-				}
-			}
-			else if (nextState == Att_Scanner_State_Type) { // the current
-															// scanning state
-															// is Attr Type,
-															// is the next
-															// part Default
-															// Attr Type ?
-
-				if (isAttrType(sp)) {
-					nextState = Att_Scanner_State_DefaultType;
-				}
-				else
-					System.out.println("WhatistheNext Attr Part - is not an Attr Type"); //$NON-NLS-1$
-
-			}
-
-			if (nextState == Att_Scanner_State_DefaultType) {
-
-				int dType = isAttrDefaultType(sp);
-				// System.out.println("WhatistheNext inside dType : " +
-				// dType);
-				if (dType == 1) // #REQUIRED or #IMPLIED
-				{
-					nextState = Att_Scanner_State_Name;
-				}
-				else {
-					if (dType == 2) // #FIXED
-					{
-						// need to look at this again
-						nextState = Att_Scanner_State_DefaultType;
-					}
-
-					if (scanDefaultAttValue(sp) != null) {
-						nextState = Att_Scanner_State_Name;
-
-					}
-				}
-			}
-
-			sp.skipPastSpaces();
-
-			if (nOffset == sp.getCurrentOffset())
-				break;
-
-			nOffset = sp.getCurrentOffset();
-
-			if (nOffset >= attrContentString.length() || nOffset == -1)
-				break;
-
-		} // end while
-
-		return nextState;
-	}
-
-
-	private boolean isAttrName(StringParser sp) {
-		// System.out.println("isAttrName - sp:" + sp.fData);
-		// System.out.println("isAttrName - currentOffset:" +
-		// sp.getCurrentOffset());
-		boolean isAttrName = false;
-		int prev = sp.getCurrentOffset();
-		sp.skipPastName(' ');
-		if ((sp.getCurrentOffset() - prev) > 0)
-			isAttrName = true;
-		return isAttrName;
-
-	}
-
-	private boolean isAttrType(StringParser sp) {
-		// System.out.println("isAttrType - sp:" + sp.fData);
-		// System.out.println("isAttrType - currentOffset:" +
-		// sp.getCurrentOffset());
-		boolean isAttrType = false;
-		if (sp.skippedString(cdata_string)) {
-			isAttrType = true;
-		}
-		else if (sp.skippedString(id_string)) {
-			if (!sp.skippedString(ref_string)) {
-				isAttrType = true; // ID
-			}
-			else if (!sp.lookingAtChar('S', true)) {
-				isAttrType = true; // IDREFS
-			}
-			else {
-				isAttrType = true; // IDREF
-			}
-		}
-		else if (sp.skippedString(entit_string)) {
-			if (sp.lookingAtChar('Y', true)) {
-				isAttrType = true; // ENTITY
-			}
-			else if (sp.skippedString(ies_string)) {
-				isAttrType = true; // ENTITITES
-			}
-		}
-		else if (sp.skippedString(nmtoken_string)) {
-			if (sp.lookingAtChar('S', true)) {
-				isAttrType = true; // NMTOKENS
-			}
-			else {
-				isAttrType = true; // NMTOKEN
-			}
-		}
-		else if (sp.skippedString(notation_string)) {
-			if (!sp.lookingAtChar('(', true)) {
-				// System.out.println(" missing ( in notation ");
-			}
-			Vector enumList = scanEnumeration(sp, true);
-			if (enumList == null || enumList.size() == 0)
-				isAttrType = false;
-			else
-				isAttrType = true;
-		}
-		else if (sp.lookingAtChar('(', true)) {
-			// "ENUMERATION";
-			Vector enumList = scanEnumeration(sp, false);
-			if (enumList == null || enumList.size() == 0)
-				isAttrType = false;
-			else
-				isAttrType = true;
-		}
-
-		return isAttrType;
-
-	}
-
-	/*
-	 * return 0 - not default type 1 - #REQUIRED or #IMPLIED 2 - #FIXED
-	 */
-
-	private int isAttrDefaultType(StringParser sp) {
-		// System.out.println("isAttrDefaultType - sp:" + sp.fData);
-		int result = 0;
-		if (sp.skippedString(required_string)) {
-			result = 1;
-		}
-		else if (sp.skippedString(implied_string)) {
-			result = 1;
-		}
-		else if (sp.skippedString(fixed_string)) {
-			result = 2;
-		}
-		return result;
-	}
-
-	//
-	// [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
-	// [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
-	//
-	// Called after scanning '('
-	//
-	private Vector scanEnumeration(StringParser sp, boolean isNotationType) {
-		// System.out.println(" scanEnum ...");
-		Vector enumList = null;
-		int len;
-
-		if (sp.lookingAtSpace(true))
-			sp.skipPastSpaces();
-
-		int prevNodeOffset = sp.getCurrentOffset();
-		int nodeOffset;
-
-		String nodeName;
-
-		while (true) {
-
-			if (isNotationType)
-				sp.skipPastNameAndPEReference(')');
-			else
-				sp.skipPastNmtokenAndPEReference(')');
-
-			nodeOffset = sp.getCurrentOffset();
-
-			if (nodeOffset == -1) {
-				return enumList;
-			}
-
-			len = nodeOffset - prevNodeOffset;
-			nodeName = sp.getString(prevNodeOffset, len);
-
-			if (enumList == null)
-				enumList = new Vector();
-
-			enumList.addElement(nodeName);
-
-			if (sp.lookingAtSpace(true))
-				sp.skipPastSpaces();
-
-			if (!sp.lookingAtChar('|', true)) {
-				if (!sp.lookingAtChar(')', true)) {
-					System.out.println("scanning enum values - error missing ')'"); //$NON-NLS-1$
-					break;
-				}
-				break;
-			}
-
-			if (sp.lookingAtSpace(true))
-				sp.skipPastSpaces();
-
-			prevNodeOffset = sp.getCurrentOffset();
-		}
-		return enumList;
-	}
-
-	//
-	// [10] AttValue ::= '"' ([^<&"] | Reference)* '"'
-	// | "'" ([^<&'] | Reference)* "'"
-	//
-	/**
-	 * Scan the default value in an attribute declaration
-	 * 
-	 * @param elementType
-	 *            handle to the element that owns the attribute
-	 * @param attrName
-	 *            handle in the string pool for the attribute name
-	 * @return handle in the string pool for the default attribute value
-	 * @exception java.lang.Exception
-	 */
-	public String scanDefaultAttValue(StringParser sp) {
-		String value = null;
-		// System.out.println("scan default ATT Value... sp:" + sp.fData);
-
-		sp.skipPastSpaces();
-
-		boolean single;
-		if (!(single = sp.lookingAtChar('\'', true)) && !sp.lookingAtChar('\"', true)) {
-			return value;
-		}
-
-		char qchar = single ? '\'' : '\"';
-		int sOffset = sp.getCurrentOffset();
-		sp.skipToChar(qchar, true);
-		int len = sp.getCurrentOffset() - sOffset - 1;
-		if (len == 0)
-			value = ""; //$NON-NLS-1$
-		else
-			value = sp.getString(sOffset, len);
-
-		return value;
-	}
-
-	//
-	// [70] EntityDecl ::= GEDecl | PEDecl
-	// [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'
-	// [72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
-	// [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
-	// [74] PEDef ::= EntityValue | ExternalID
-	// [75] ExternalID ::= 'SYSTEM' S SystemLiteral
-	// | 'PUBLIC' S PubidLiteral S SystemLiteral
-	// [76] NDataDecl ::= S 'NDATA' S Name
-	// [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"'
-	// | "'" ([^%&'] | PEReference | Reference)* "'"
-	//
-	// Called after scanning 'ENTITY'
-	//
-	public EntityDecl scanEntityDecl() {
-		prevNodeOffset = 1;
-		nodeOffset = 1;
-		int len;
-		boolean isPEDecl = false;
-		EntityDecl entityDecl = null;
-
-		String name = null;
-		String ndata = null;
-
-		if (contentString.lookingAtSpace(true)) {
-			contentString.skipPastSpaces();
-			if (!contentString.lookingAtChar('%', true)) {
-				isPEDecl = false; // <!ENTITY x "x">
-			}
-			else if (contentString.lookingAtSpace(true)) {
-				isPEDecl = true; // <!ENTITY % x "x">
-			}
-			prevNodeOffset = contentString.getCurrentOffset();
-			contentString.skipPastName(' ');
-			nodeOffset = contentString.getCurrentOffset();
-			len = nodeOffset - prevNodeOffset;
-			if (len > 0) {
-				name = contentString.getString(prevNodeOffset, len);
-				prevNodeOffset = nodeOffset;
-			}
-		}
-
-		if (name == null)
-			return null;
-
-		contentString.skipPastSpaces();
-		prevNodeOffset = contentString.getCurrentOffset();
-
-		boolean single;
-		if ((single = contentString.lookingAtChar('\'', true)) || contentString.lookingAtChar('\"', true)) {
-			String value = scanEntityValue(single);
-			entityDecl = new EntityDecl(name, ownerDTD, value, isPEDecl);
-		}
-		else {
-			// external entity
-			ExternalID xID = scanExternalID();
-			if (xID != null) {
-				if (!isPEDecl) // general entity
-				{
-					boolean unparsed = false;
-					contentString.skipPastSpaces();
-					unparsed = contentString.skippedString(ndata_string);
-					if (unparsed) {
-						contentString.skipPastSpaces();
-						prevNodeOffset = contentString.getCurrentOffset();
-						contentString.skipPastName(' ');
-						nodeOffset = contentString.getCurrentOffset();
-						len = nodeOffset - prevNodeOffset;
-						ndata = contentString.getString(prevNodeOffset, len);
-					}
-				}
-				entityDecl = new EntityDecl(name, ownerDTD, xID, isPEDecl, ndata);
-			}
-		}
-		return entityDecl;
-	}
-
-
-	//
-	// [82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S?
-	// '>'
-	// [75] ExternalID ::= 'SYSTEM' S SystemLiteral
-	// | 'PUBLIC' S PubidLiteral S SystemLiteral
-	// [83] PublicID ::= 'PUBLIC' S PubidLiteral
-	//
-	// Called after scanning 'NOTATION'
-	//
-	public NotationDecl scanNotationDecl() {
-		prevNodeOffset = 1;
-		nodeOffset = 1;
-		int len;
-		NotationDecl notationDecl = null;
-
-		String name = null;
-
-		if (contentString.lookingAtSpace(true)) {
-			contentString.skipPastSpaces();
-			prevNodeOffset = contentString.getCurrentOffset();
-			contentString.skipPastName(' ');
-			nodeOffset = contentString.getCurrentOffset();
-			len = nodeOffset - prevNodeOffset;
-			if (len > 0) {
-				name = contentString.getString(prevNodeOffset, len);
-				prevNodeOffset = nodeOffset;
-			}
-		}
-
-		if (name == null)
-			return null;
-
-		contentString.skipPastSpaces();
-		prevNodeOffset = contentString.getCurrentOffset();
-
-		notationDecl = new NotationDecl(name, ownerDTD);
-
-		ExternalID xID = scanExternalID();
-		if (xID != null) {
-			if (xID.getSystemLiteral() != null) {
-				notationDecl.setSystemId(xID.getSystemLiteral());
-			}
-			if (xID.getPubIdLiteral() != null) {
-				notationDecl.setPublicId(xID.getPubIdLiteral());
-			}
-		}
-
-		return notationDecl;
-	}
-
-
-	private String scanEntityValue(boolean single) {
-		char qchar = single ? '\'' : '\"';
-		prevNodeOffset = contentString.getCurrentOffset();
-		contentString.skipToChar(qchar, false);
-		int len = contentString.getCurrentOffset() - prevNodeOffset;
-		String value = contentString.getString(prevNodeOffset, len);
-		return value;
-	}
-
-	//
-	// [75] ExternalID ::= 'SYSTEM' S SystemLiteral
-	// | 'PUBLIC' S PubidLiteral S SystemLiteral
-	private ExternalID scanExternalID() {
-		ExternalID xID = null;
-		char qchar = '\"';
-		if (contentString.skippedString(system_string)) {
-			if (!contentString.lookingAtSpace(true)) {
-				return null;
-			}
-			contentString.skipPastSpaces();
-
-			if (contentString.lookingAtChar('\'', true))
-				qchar = '\'';
-			else if (contentString.lookingAtChar('\"', true))
-				qchar = '\"';
-
-			prevNodeOffset = contentString.getCurrentOffset();
-			contentString.skipToChar(qchar, true);
-			int len = contentString.getCurrentOffset() - prevNodeOffset - 1;
-			String systemId = contentString.getString(prevNodeOffset, len);
-			// System.out.println("systemid..." + systemId);
-			xID = new ExternalID(systemId);
-		}
-		else if (contentString.skippedString(public_string)) {
-			if (!contentString.lookingAtSpace(true)) {
-				return null;
-			}
-
-			contentString.skipPastSpaces();
-			if (contentString.lookingAtChar('\'', true))
-				qchar = '\'';
-			else if (contentString.lookingAtChar('\"', true))
-				qchar = '\"';
-
-			// publicLiteral
-			prevNodeOffset = contentString.getCurrentOffset();
-			contentString.skipToChar(qchar, true);
-			int len = contentString.getCurrentOffset() - prevNodeOffset - 1;
-			String publicId = contentString.getString(prevNodeOffset, len);
-
-			// systemLiteral
-			contentString.skipPastSpaces();
-			if (contentString.lookingAtChar('\'', true))
-				qchar = '\'';
-			else if (contentString.lookingAtChar('\"', true))
-				qchar = '\"';
-			prevNodeOffset = contentString.getCurrentOffset();
-			contentString.skipToChar(qchar, true);
-			len = contentString.getCurrentOffset() - prevNodeOffset - 1;
-
-			if (len > 0) {
-				String systemId = contentString.getString(prevNodeOffset, len);
-				xID = new ExternalID(publicId, systemId);
-			}
-			else {
-				xID = new ExternalID(publicId, null);
-			}
-		}
-		return xID;
-	}
-
-	//
-	// [83] PublicID ::= 'PUBLIC' S PubidLiteral
-	//
-
-	// dmw 11/15 private method never read locally
-	// TODO: change to private if used, otherwise should be removed
-	String scanPublicID() {
-		String pID = null;
-		if (contentString.skippedString(public_string)) {
-			if (!contentString.lookingAtSpace(true)) {
-				return pID;
-			}
-			contentString.skipPastSpaces();
-			prevNodeOffset = contentString.getCurrentOffset();
-
-			contentString.skipToChar(' ', true);
-			int len = contentString.getCurrentOffset() - prevNodeOffset;
-			pID = contentString.getString(prevNodeOffset, len);
-		}
-
-		return pID;
-	}
-
-	//
-	// Main
-	//
-
-	/** Main program entry point. */
-	public static void main(String argv[]) {
-
-		// is there anything to do?
-		if (argv.length == 0) {
-			System.exit(1);
-		}
-
-		// DTDScanner sc = new DTDScanner(argv[0]);
-		DTDScanner sc = new DTDScanner("hello.dtd", " gif SYSTEM \"GIF File\" "); //$NON-NLS-1$ //$NON-NLS-2$
-
-		NotationDecl n = sc.scanNotationDecl();
-		System.out.println("Noation Name: " + n.getNodeName()); //$NON-NLS-1$
-		System.out.println("SystemId: " + n.getSystemId()); //$NON-NLS-1$
-
-
-		// Attributes
-		// Vector lists = sc.scanAttlistDecl();
-		// sc.printAttList(lists);
-
-		// System.out.println("CM: " + sc.scanContentModel());
-
-	} // main(String[])
-
-	/**
-	 * Gets the errorString
-	 * 
-	 * @return Returns a String
-	 */
-	public String getErrorString() {
-		return errorString;
-	}
-
-	/**
-	 * Sets the errorString
-	 * 
-	 * @param errorString
-	 *            The errorString to set
-	 */
-	public void setErrorString(String errorString) {
-		this.errorString = errorString;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DeclNode.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DeclNode.java
deleted file mode 100644
index 25720b4..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DeclNode.java
+++ /dev/null
@@ -1,103 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-public class DeclNode {
-	static public final int INVALID = -1;
-	static public final int ELEMENT = 1;
-	static public final int ATTLIST = 2;
-	static public final int ENTITY = 3;
-	static public final int INTERNAL_ENTITY = 4;
-	static public final int EXTERNAL_ENTITY = 5;
-	static public final int INTERNAL_GENERAL_ENTITY = 6;
-	static public final int INTERNAL_PARAMETER_ENTITY = 7;
-	static public final int EXTERNAL_GENERAL_ENTITY = 8;
-	static public final int EXTERNAL_PARAMETER_ENTITY = 9;
-	static public final int PARAMETER_ENTITY_REFERENCE = 10;
-	static public final int NOTATION = 11;
-	static public final int COMMENT = 12;
-
-	static public final int START_DTD = 21;
-	static public final int END_DTD = 22;
-	static public final int START_ENTITY_DTD = 23;
-	static public final int END_ENTITY_DTD = 24;
-	static public final int ERROR = 25;
-
-	public int type = INVALID;
-	private String declName = null;
-	private String contentString = null;
-	private String errorMessage = null;
-	private String comment = null;
-
-	//
-	// Constants
-	//
-
-	/** Default constructor. */
-	public DeclNode(int type) {
-		this(null, type, null);
-	}
-
-	public DeclNode(String name, int type, String contentString) {
-		this.declName = name;
-		this.type = type;
-		this.contentString = contentString;
-	}
-
-	public String getDeclName() {
-		return declName;
-	}
-
-	public void setDeclName(String name) {
-		declName = name;
-	}
-
-	public int getType() {
-		return type;
-	}
-
-	public void setType(int type) {
-		this.type = type;
-	}
-
-	public String getErrorMessage() {
-		return errorMessage;
-	}
-
-	public void setErrorMessage(String message) {
-		errorMessage = message;
-	}
-
-	public String getContentString() {
-		return contentString;
-	}
-
-	public void setContentString(String content) {
-		this.contentString = content;
-	}
-
-	public String getComment() {
-		return comment;
-	}
-
-	public void setComment(String comment) {
-		this.comment = comment;
-	}
-
-	public String toString()
-
-	{
-		return "Node Name: " + declName + " Type: " + type + " ContentString: " + contentString; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ElementDecl.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ElementDecl.java
deleted file mode 100644
index 3e87167..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ElementDecl.java
+++ /dev/null
@@ -1,33 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-public class ElementDecl extends BaseNode {
-	CMNode contentModelNode = null;
-
-	public ElementDecl(String name, String ownerDTD) {
-		this(name, ownerDTD, null, null);
-	}
-
-	public ElementDecl(String name, String ownerDTD, String comment, ErrorMessage errorMessage) {
-		super(name, ownerDTD, comment, errorMessage);
-	}
-
-	public CMNode getContentModelNode() {
-		return contentModelNode;
-	}
-
-	public void setContentModelNode(CMNode cmnode) {
-		contentModelNode = cmnode;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityDecl.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityDecl.java
deleted file mode 100644
index 673c99f..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityDecl.java
+++ /dev/null
@@ -1,242 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-public class EntityDecl extends BaseNode {
-	boolean isParameter = false;
-	String expandedValue = null; // Always <var>null</var> for external
-									// Entities
-	String value = null; // Always <var>null</var> for external Entities
-	ExternalID externalID = null; // Always <var>null</var> for internal
-									// Entities
-	String ndata = null; // Always <var>null</var> for internal Entities
-
-	boolean parsed = false;
-	DTDParser dtd = null; // Always null, except when it has been parsed.
-
-	boolean entityReferenced = false;
-
-	/**
-	 * Constructor for internal Entities.
-	 * 
-	 * @param name
-	 *            Name of this Entity.
-	 * @param value
-	 *            The XML-encoded value that was directly assigned to the
-	 *            Entity.
-	 * @param isParameter
-	 *            =true if a parameter Entity; otherwise =false.
-	 */
-	public EntityDecl(String name, String ownerDTD, String value, boolean isParameter) {
-		super(name, ownerDTD, null, null);
-		this.value = value;
-		this.isParameter = isParameter;
-	}
-
-	/**
-	 * Constructor for external Entities.
-	 * 
-	 * @param name
-	 *            Name of the Entity.
-	 * @param externalID
-	 *            The reference(s) to the external entity to retrieve.
-	 * @param isParameter
-	 *            =true if a parameter Entity; otherwise =false.
-	 * @param ndata
-	 *            The notation associated with the binary Entity, or <var>null</var>
-	 *            if the Entity is a text Entity.
-	 * @see sax.ExternalID
-	 */
-	public EntityDecl(String name, String ownerDTD, ExternalID externalID, boolean isParameter, String ndata) {
-		super(name, ownerDTD, null, null);
-		this.externalID = externalID;
-		this.isParameter = isParameter;
-		this.ndata = ndata;
-	}
-
-	/**
-	 * Returns whether this Entity is a parameter Entity.
-	 * 
-	 * @return =true if an internal parameter Entity; otherwise =false.
-	 */
-	public boolean isParameter() {
-		return this.isParameter;
-	}
-
-	/**
-	 * Returns the value of this Entity.
-	 * 
-	 * @return The XML-encoded value that was directly assigned to the
-	 *         internal Entity; otherwise, <var>null</var>.
-	 */
-	public String getValue() {
-		return this.value;
-	}
-
-	public boolean isEntityReferenced() {
-		return entityReferenced;
-	}
-
-	public void setEntityReferenced(boolean reference) {
-		entityReferenced = reference;
-	}
-
-
-	/**
-	 * Returns the system identifier of the Notation. A system identifier is a
-	 * URI, which may be used to retrieve an external entity's content.
-	 * <p>
-	 * This method is defined by DOM.
-	 * 
-	 * @return The system identifier, or <var>null</var> if the identifier is
-	 *         not defined.
-	 * @see org.eclipcse.wst.dtd.parser.ExternalID#getSystemLiteral
-	 */
-	public String getSystemId() {
-		if (externalID == null)
-			return null;
-		else
-			return this.externalID.getSystemLiteral();
-	}
-
-	/**
-	 * Sets the system identifier of the Notation. A system identifier is a
-	 * URI, which may be used to retrieve an external entity's content.
-	 * <p>
-	 * This method is defined by DOM.
-	 * 
-	 * @param systemIdentifier
-	 *            The system identifier.
-	 * @see org.eclipcse.wst.dtd.parser.ExternalID
-	 */
-	public void setSystemId(String systemIdentifier) {
-		// System.out.println("setSYstemId - externalId: " + externalID);
-		this.externalID = new ExternalID(this.externalID.getPubIdLiteral(), systemIdentifier);
-	}
-
-	/**
-	 * Returns the public identifier of the Notation. This value is only valid
-	 * if the identifier is defined as <var>public</var> (as opposed to
-	 * <var>system</var>). Public identifiers may be used to try to generate
-	 * an alternative URI in order to retrieve the an external entities
-	 * content. If retrieval fails using the public identifier, an attempt
-	 * must be made to retrieve content using the system identifier.
-	 * <p>
-	 * This method is defined by DOM.
-	 * 
-	 * @return The public identifier, or <var>null</var> if the identifier is
-	 *         not defined.
-	 * @see org.eclipcse.wst.dtd.parser.ExternalID
-	 */
-	public String getPublicId() {
-		if (externalID == null)
-			return null;
-		else
-			return this.externalID.getPubIdLiteral();
-	}
-
-	/**
-	 * Sets the public identifier of the Notation. This value is only valid if
-	 * the identifier is defined as <var>public</var> (as opposed to
-	 * <var>system</var>). Public identifiers may be used to try to generate
-	 * an alternative URI in order to retrieve the an external entities
-	 * content. If retrieval fails using the public identifier, an attempt
-	 * must be made to retrieve content using the system identifier.
-	 * <p>
-	 * This method is defined by DOM.
-	 * 
-	 * @param publicIdentifier
-	 *            The public identifier.
-	 * @see #getPublicId
-	 * @see org.eclipcse.wst.dtd.parser.ExternalID
-	 */
-	public void setPublicId(String publicIdentifier) {
-		this.externalID = new ExternalID(publicIdentifier, this.externalID.getSystemLiteral());
-	}
-
-	/**
-	 * Returns the external ID of this Entity.
-	 * 
-	 * @return The reference(s) to the external entity to retrieve; otherwise,
-	 *         <var>null</var>.
-	 * @see org.eclipcse.wst.dtd.parser.ExternalID
-	 */
-	public ExternalID getExternalID() {
-		return this.externalID;
-	}
-
-	/**
-	 * Returns whether this entity value is external.
-	 * 
-	 * @return =true if entity is external; otherwise, =false.
-	 * @see org.eclipcse.wst.dtd.parser.ExternalID
-	 */
-	public boolean isExternal() {
-		return this.externalID != null;
-	}
-
-	/**
-	 * Returns the notation associated with this Entity.
-	 * 
-	 * @return The notation associated with the external binary Entity,
-	 *         otherwise, <var>null</var>.
-	 */
-	public String getNotation() {
-		return this.ndata;
-	}
-
-	public void setNotation(String ndata) {
-		this.ndata = ndata;
-	}
-
-	/**
-	 * Returns the notation associated with this Entity.
-	 * <p>
-	 * This method is defined by DOM.
-	 * 
-	 * @return The notation associated with the external binary Entity,
-	 *         otherwise, <var>null</var>.
-	 */
-	public String getNotationName() {
-		return this.ndata;
-	}
-
-	/**
-	 * <p>
-	 * This method is defined by DOM.
-	 * 
-	 * public void setNotationName(String arg) { this.ndata = arg; }
-	 */
-
-	/**
-	 * Returns whether there is a notation associated with this entity value.
-	 * 
-	 * @return =true if the external binary entity contains a notation;
-	 *         otherwise, =false.
-	 */
-	public boolean isNotation() {
-		return this.ndata != null;
-	}
-
-	public void setValue(String s) {
-		this.value = s;
-	}
-
-	public void setParsed(boolean p) {
-		this.parsed = p;
-	}
-
-	public boolean getParsed() {
-		return this.parsed;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityPool.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityPool.java
deleted file mode 100644
index c43e414..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityPool.java
+++ /dev/null
@@ -1,72 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-public class EntityPool {
-	private Hashtable m_entity = new Hashtable();
-	private Hashtable m_para = new Hashtable(); // parameter references
-
-	public EntityPool() {
-	}
-
-	public boolean add(EntityDecl entity) {
-		String name = entity.getNodeName();
-		if (entity.isParameter()) {
-			if (m_para.containsKey(name))
-				return false;
-			m_para.put(name, entity);
-		}
-		else {
-			if (m_entity.containsKey(name))
-				return false;
-			m_entity.put(name, entity);
-		}
-		return true;
-	}
-
-	public EntityDecl refer(String name) {
-		return (EntityDecl) m_entity.get(name);
-	}
-
-	public EntityDecl referPara(String name) {
-		return (EntityDecl) m_para.get(name);
-	}
-
-	/**
-	 * Return an <CODE>Enumeration</CODE> of <CODE>EntityDecl</CODE>.
-	 * 
-	 * @see org.eclipcse.wst.dtd.parser.EntityDecl
-	 */
-	public Enumeration elements() {
-		return m_entity.elements();
-	}
-
-	/**
-	 * Return an <CODE>Enumeration</CODE> of <CODE>EntityDecl</CODE> for
-	 * parameter entities.
-	 * 
-	 * @see org.eclipcse.wst.dtd.parser.EntityDecl
-	 */
-	public Enumeration parameterEntityElements() {
-		return m_para.elements();
-	}
-
-	/**
-	 * For DTD#getEntities();
-	 */
-	Hashtable getEntityHash() {
-		return this.m_entity;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ErrorMessage.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ErrorMessage.java
deleted file mode 100644
index 6995e8a..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ErrorMessage.java
+++ /dev/null
@@ -1,114 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-
-
-public class ErrorMessage {
-	private int errorLine, errorColumn, severity;
-	private String errorString;
-
-
-	public ErrorMessage() {
-	}
-
-	public void setErrorMessage(String error) {
-		errorString = error;
-	}
-
-	public void setSeverity(int severity) {
-		this.severity = severity;
-	}
-
-	public void setSeverity(String severity) {
-		if (severity == "warning") { //$NON-NLS-1$
-			this.severity = 0;
-		}
-		else if (severity == "error") { //$NON-NLS-1$
-			this.severity = 1;
-		}
-		else if (severity == "fatal") { //$NON-NLS-1$
-			this.severity = 2;
-		}
-	}
-
-	public void setErrorLine(int line) {
-		errorLine = line;
-	}
-
-	public void setErrorColumn(int column) {
-		errorColumn = column;
-	}
-
-	public String getErrorMessage() {
-		return errorString;
-	}
-
-	public int getSeverity() {
-		return severity;
-	}
-
-	public int getErrorLine() {
-		return errorLine;
-	}
-
-	public int getErrorColumn() {
-		return errorColumn;
-	}
-
-	private int startOffset = -1;
-
-	public void setErrorStartOffset(int start) {
-		startOffset = start;
-	}
-
-	public int getErrorStartOffset() {
-		return startOffset;
-	}
-
-	private int endOffset = -1;
-
-	public void setErrorEndOffset(int end) {
-		endOffset = end;
-	}
-
-	public int getErrorEndOffset() {
-		return endOffset;
-	}
-
-
-	Object object;
-
-	/**
-	 * Get the value of the closest object to the error.
-	 * 
-	 * @return value of object.
-	 */
-	public Object getObject() {
-		return object;
-	}
-
-	/**
-	 * Set the value of closest object to the error.
-	 * 
-	 * @param v
-	 *            Value to assign to object.
-	 */
-	public void setObject(Object v) {
-		this.object = v;
-	}
-
-
-	public void addNewErrorMessageLine(String newLine) {
-		errorString += "\n" + newLine; //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ExternalID.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ExternalID.java
deleted file mode 100644
index 11b0988..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ExternalID.java
+++ /dev/null
@@ -1,154 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-public class ExternalID {
-	private static final int T_SYSTEM = 0;
-	private static final int T_PUBLIC = 1;
-
-	int type = T_PUBLIC;
-	String publicID = null;
-	String systemID = null;
-
-	/**
-	 * Constructor for system IDs.
-	 * 
-	 * @param systemID
-	 *            URI, which may be used to retrieve an external entity's
-	 *            content.
-	 */
-	public ExternalID(String systemID) {
-		this.type = T_SYSTEM;
-		this.publicID = null;
-		this.systemID = systemID;
-	}
-
-	/**
-	 * Constructor for public and system IDs.
-	 * 
-	 * @param publicID
-	 *            Identifier to be used to try to generate an alternative URI
-	 *            in order to retrieve the external entity's content, or
-	 *            <var>null</var> if a system identitier is to be
-	 *            constructed.
-	 * @param systemID
-	 *            URI, which may be used to retrieve an external entity's
-	 *            content.
-	 */
-	public ExternalID(String publicID, String systemID) {
-		this.type = T_PUBLIC;
-		this.publicID = publicID;
-		this.systemID = systemID;
-		if (null == this.publicID)
-			this.type = T_SYSTEM;
-	}
-
-	/**
-	 * Returns if this external ID is a system ID (or public ID).
-	 * 
-	 * @return System ID=true, Public ID=false.
-	 * @see #isPublic
-	 */
-	public boolean isSystem() {
-		return this.type == T_SYSTEM;
-	}
-
-	/**
-	 * Returns if this external ID is a public ID (or system ID).
-	 * 
-	 * @return Public ID=true, System ID=false.
-	 * @see #isSystem
-	 */
-	public boolean isPublic() {
-		return this.type == T_PUBLIC;
-	}
-
-	/**
-	 * Returns the system identifier of this external ID. A system identifier
-	 * is a URI, which may be used to retrieve an external entity's content.
-	 * 
-	 * @return The system identifier, or <var>null</var> if the identifier is
-	 *         not defined.
-	 * @see #getPubidLiteral
-	 */
-	public String getSystemLiteral() {
-		return this.systemID;
-	}
-
-	/**
-	 * Returns the public identifier of this external ID. This value is only
-	 * valid if the identifier is defined as <var>public</var> (as opposed to
-	 * <var>system</var>). Public identifiers may be used to try to generate
-	 * an alternative URI in order to retrieve an external entity's content.
-	 * If retrieval fails using the public identifier, an attempt must be made
-	 * to retrieve content using the system identifier.
-	 * 
-	 * @return The public identifier, or <var>null</var> if the identifier is
-	 *         not defined.
-	 * @see #getSystemLiteral
-	 */
-	public String getPubIdLiteral() {
-		return this.publicID;
-	}
-
-	/**
-	 * Returns this external ID in the format it was declared: <CODE>SYSTEM
-	 * &quot;<VAR>systemID</VAR>&quot;</CODE> or <CODE>PUBLIC &quot;<VAR>publicID</VAR>&quot;
-	 * &quot;<VAR>systemID</VAR>&quot;</CODE>.
-	 * 
-	 * @return XML string representing the content of the external ID (never
-	 *         <var>null</var>).
-	 */
-	public String toString() {
-		String ret;
-		if (isSystem()) {
-			ret = "SYSTEM \"" + getSystemLiteral() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		else if (null != getSystemLiteral()) {
-			ret = "PUBLIC \"" + getPubIdLiteral() + "\" \"" + getSystemLiteral() + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		}
-		else {
-			ret = "PUBLIC \"" + getPubIdLiteral() + "\""; // for NOTATION //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		return ret;
-	}
-
-	/**
-	 * 
-	 */
-	public boolean equals(Object obj) {
-		if (obj == null)
-			return false;
-		if (!(obj instanceof ExternalID))
-			return false;
-		ExternalID eid = (ExternalID) obj;
-		if (!((eid.publicID == null && this.publicID == null) || eid.publicID != null && eid.publicID.equals(this.publicID)))
-			return false;
-		if (!((eid.systemID == null && this.systemID == null) || eid.systemID != null && eid.systemID.equals(this.systemID)))
-			return false;
-		return true;
-	}
-
-
-	/**
-	 * 
-	 */
-	public int hashCode() {
-		int retval = 0;
-		if (publicID != null)
-			retval = publicID.hashCode();
-		if (systemID != null)
-			retval += systemID.hashCode();
-		return retval;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/NotationDecl.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/NotationDecl.java
deleted file mode 100644
index 57d4e2f..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/NotationDecl.java
+++ /dev/null
@@ -1,77 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-/**
- * Notations are how the Document Type Description (DTD) records hints about
- * the format of an XML "unparsed entity" -- in other words, non-XML data
- * bound to this document type, which some applications may wish to consult
- * when manipulating the document. A Notation represents a name-value pair,
- * with its nodeName being set to the declared name of the notation.
- */
-public class NotationDecl extends BaseNode {
-	/** Public identifier. */
-	protected String publicId = null;
-
-	/** System identifier. */
-	protected String systemId = null;
-
-	//
-	// Constructors
-	//
-
-	/** Factory constructor. */
-	public NotationDecl(String name, String ownerDTD) {
-		super(name, ownerDTD);
-	}
-
-	//
-	// Notation methods
-	//
-
-	/**
-	 * The Public Identifier for this Notation. If no public identifier was
-	 * specified, this will be null.
-	 */
-	public String getPublicId() {
-		return publicId;
-	} // getPublicId():String
-
-	/**
-	 * The System Identifier for this Notation. If no system identifier was
-	 * specified, this will be null.
-	 */
-	public String getSystemId() {
-		return systemId;
-	} // getSystemId():String
-
-	//
-	// Public methods
-	//
-
-	/**
-	 * NON-DOM: The Public Identifier for this Notation. If no public
-	 * identifier was specified, this will be null.
-	 */
-	public void setPublicId(String id) {
-		publicId = id;
-	} // setPublicId(String)
-
-	/**
-	 * NON-DOM: The System Identifier for this Notation. If no system
-	 * identifier was specified, this will be null.
-	 */
-	public void setSystemId(String id) {
-		systemId = id;
-	} // setSystemId(String)
-
-} // class NotationImpl
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/StringParser.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/StringParser.java
deleted file mode 100644
index 6a51cdc..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/StringParser.java
+++ /dev/null
@@ -1,449 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-/**
- * Reader for processing/parsing xml string
- * 
- * @version
- */
-public class StringParser {
-	String fData = null;
-	int fEndOffset;
-	int fMostRecentChar;
-	int fCurrentOffset;
-	boolean fCalledCharPropInit = false;
-
-	public StringParser(String data) {
-		fData = data;
-		fCurrentOffset = 0;
-		fEndOffset = fData.length();
-		fMostRecentChar = fEndOffset == 0 ? -1 : fData.charAt(0);
-	}
-
-	public String getString(int offset, int length) {
-		if (length == 0)
-			return ""; //$NON-NLS-1$
-		return fData.substring(offset, offset + length);
-	}
-
-	public String getData() {
-		return fData;
-	}
-
-	public String getRemainingString() {
-		return fData.substring(getCurrentOffset());
-	}
-
-	public int getCurrentOffset() {
-		return fCurrentOffset;
-	}
-
-	//
-	//
-	public int loadNextChar() {
-		if (++fCurrentOffset >= fEndOffset) {
-			fMostRecentChar = -1;
-		}
-		else {
-			fMostRecentChar = fData.charAt(fCurrentOffset);
-		}
-		return fMostRecentChar;
-	}
-
-	//
-	//
-	public boolean lookingAtChar(char chr, boolean skipPastChar) {
-		int ch = fMostRecentChar;
-		if (ch != chr) {
-			return false;
-		}
-		if (skipPastChar) {
-			if (++fCurrentOffset >= fEndOffset) {
-				fMostRecentChar = -1;
-			}
-			else {
-				fMostRecentChar = fData.charAt(fCurrentOffset);
-			}
-		}
-		return true;
-	}
-
-	//
-	//
-	//
-	public boolean lookingAtValidChar(boolean skipPastChar) {
-		int ch = fMostRecentChar;
-		if (ch < 0xD800) {
-			if (ch < 0x20 && ch != 0x09 && ch != 0x0A && ch != 0x0D) {
-				return false;
-			}
-			if (skipPastChar) {
-				if (++fCurrentOffset >= fEndOffset) {
-					fMostRecentChar = -1;
-				}
-				else {
-					fMostRecentChar = fData.charAt(fCurrentOffset);
-				}
-			}
-			return true;
-		}
-		if (ch > 0xFFFD) {
-			return false;
-		}
-		if (ch < 0xDC00) {
-			if (fCurrentOffset + 1 >= fEndOffset) {
-				return false;
-			}
-			ch = fData.charAt(fCurrentOffset + 1);
-			if (ch < 0xDC00 || ch >= 0xE000) {
-				return false;
-			}
-			else if (!skipPastChar) {
-				return true;
-			}
-			else {
-				fCurrentOffset++;
-			}
-		}
-		else if (ch < 0xE000) {
-			return false;
-		}
-		if (skipPastChar) {
-			if (++fCurrentOffset >= fEndOffset) {
-				fMostRecentChar = -1;
-			}
-			else {
-				fMostRecentChar = fData.charAt(fCurrentOffset);
-			}
-		}
-		return true;
-	}
-
-	//
-	//
-	//
-	public boolean lookingAtSpace(boolean skipPastChar) {
-		int ch = fMostRecentChar;
-		if (ch > 0x20)
-			return false;
-		if (ch == 0x20 || ch == 0x0A || ch == 0x0D || ch == 0x09) {
-			if (skipPastChar) {
-				loadNextChar();
-			}
-			return true;
-		}
-		return false;
-	}
-
-	//
-	//
-	//
-	public void skipToChar(char chr, boolean skipPastChar) {
-		//
-		// REVISIT - this will skip invalid characters without reporting them.
-		//
-		int ch = fMostRecentChar;
-		while (true) {
-			if (ch == chr) {
-				if (skipPastChar) {
-					loadNextChar();
-				}
-				return;
-			}
-			if (ch == -1) {
-				return;
-			}
-			ch = loadNextChar();
-		}
-	}
-
-	//
-	//
-	//
-	public void skipPastSpaces() {
-		int ch = fMostRecentChar;
-		if (ch == -1) {
-			// changeReaders().skipPastSpaces();
-			return;
-		}
-		while (true) {
-			if (ch > 0x20 || (ch != 0x20 && ch != 0x0A && ch != 0x09 && ch != 0x0D)) {
-				fMostRecentChar = ch;
-				return;
-			}
-			if (++fCurrentOffset >= fEndOffset) {
-				return;
-			}
-			ch = fData.charAt(fCurrentOffset);
-		}
-	}
-
-	//
-	//
-	//
-
-	public void skipPastNameAndPEReference(char fastcheck) {
-		int ch = fMostRecentChar;
-
-		if (ch != '%') {
-			if (ch < 0x80) {
-				if (ch == -1 || XMLCharacterProperties.fgAsciiInitialNameChar[ch] == 0)
-					return;
-			}
-			else {
-				if (!fCalledCharPropInit) {
-					XMLCharacterProperties.initCharFlags();
-					fCalledCharPropInit = true;
-				}
-				if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_InitialNameCharFlag) == 0)
-					return;
-			}
-		}
-		while (true) {
-			ch = loadNextChar();
-			if (fastcheck == ch)
-				return;
-			if (ch == '%' || ch == ';') {
-				continue;
-			}
-
-			if (ch < 0x80) {
-				if (ch == -1 || XMLCharacterProperties.fgAsciiNameChar[ch] == 0)
-					return;
-			}
-			else {
-				if (!fCalledCharPropInit) {
-					XMLCharacterProperties.initCharFlags();
-					fCalledCharPropInit = true;
-				}
-				if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_NameCharFlag) == 0)
-					return;
-			}
-		}
-	}
-
-	public void skipPastName(char fastcheck) {
-		int ch = fMostRecentChar;
-		// System.out.println("skippastName ch: " +ch);
-
-		if (ch < 0x80) {
-			if (ch == -1 || XMLCharacterProperties.fgAsciiInitialNameChar[ch] == 0)
-				return;
-		}
-		else {
-			if (!fCalledCharPropInit) {
-				XMLCharacterProperties.initCharFlags();
-				fCalledCharPropInit = true;
-			}
-			if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_InitialNameCharFlag) == 0)
-				return;
-		}
-
-		while (true) {
-			ch = loadNextChar();
-			if (fastcheck == ch)
-				return;
-			if (ch < 0x80) {
-				if (ch == -1 || XMLCharacterProperties.fgAsciiNameChar[ch] == 0)
-					return;
-			}
-			else {
-				if (!fCalledCharPropInit) {
-					XMLCharacterProperties.initCharFlags();
-					fCalledCharPropInit = true;
-				}
-				if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_NameCharFlag) == 0)
-					return;
-			}
-		}
-	}
-
-	//
-	//
-	//
-
-	public void skipPastNmtoken(char fastcheck) {
-		int ch = fMostRecentChar;
-		while (true) {
-			if (fastcheck == ch)
-				return;
-			if (ch < 0x80) {
-				if (ch == -1 || XMLCharacterProperties.fgAsciiNameChar[ch] == 0)
-					return;
-			}
-			else {
-				if (!fCalledCharPropInit) {
-					XMLCharacterProperties.initCharFlags();
-					fCalledCharPropInit = true;
-				}
-				if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_NameCharFlag) == 0)
-					return;
-			}
-			ch = loadNextChar();
-		}
-	}
-
-	public void skipPastNmtokenAndPEReference(char fastcheck) {
-		int ch = fMostRecentChar;
-		while (true) {
-			if (fastcheck == ch)
-				return;
-			if (ch == '%' || ch == ';') {
-				ch = loadNextChar();
-				continue;
-			}
-			if (ch < 0x80) {
-				if (ch == -1 || XMLCharacterProperties.fgAsciiNameChar[ch] == 0)
-					return;
-			}
-			else {
-				if (!fCalledCharPropInit) {
-					XMLCharacterProperties.initCharFlags();
-					fCalledCharPropInit = true;
-				}
-				if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_NameCharFlag) == 0)
-					return;
-			}
-			ch = loadNextChar();
-		}
-	}
-
-	//
-	//
-	//
-	public boolean skippedString(char[] s) {
-		int ch = fMostRecentChar;
-		if (ch != s[0]) {
-			return false;
-		}
-		if (fCurrentOffset + s.length > fEndOffset)
-			return false;
-		for (int i = 1; i < s.length; i++) {
-			if (fData.charAt(fCurrentOffset + i) != s[i])
-				return false;
-		}
-		fCurrentOffset += (s.length - 1);
-		loadNextChar();
-		return true;
-	}
-
-	//
-	//
-	//
-	public int scanInvalidChar() throws Exception {
-		int ch = fMostRecentChar;
-		loadNextChar();
-		return ch;
-	}
-
-	//
-	//
-	//
-	/*
-	 * public int scanCharRef(boolean hex) throws Exception { int ch =
-	 * fMostRecentChar; if (ch == -1) // return
-	 * changeReaders().scanCharRef(hex); return ch; int num = 0; if (hex) { if
-	 * (ch > 'f' || XMLCharacterProperties.fgAsciiXDigitChar[ch] == 0) return
-	 * XMLEntityHandler.CHARREF_RESULT_INVALID_CHAR; num = ch - (ch < 'A' ?
-	 * '0' : (ch < 'a' ? 'A' : 'a') - 10); } else { if (ch < '0' || ch > '9')
-	 * return XMLEntityHandler.CHARREF_RESULT_INVALID_CHAR; num = ch - '0'; }
-	 * boolean toobig = false; while (true) { ch = loadNextChar(); if (ch ==
-	 * -1) return XMLEntityHandler.CHARREF_RESULT_SEMICOLON_REQUIRED; if (hex) {
-	 * if (ch > 'f' || XMLCharacterProperties.fgAsciiXDigitChar[ch] == 0)
-	 * break; } else { if (ch < '0' || ch > '9') break; } if (hex) { int dig =
-	 * ch - (ch < 'A' ? '0' : (ch < 'a' ? 'A' : 'a') - 10); num = (num << 4) +
-	 * dig; } else { int dig = ch - '0'; num = (num * 10) + dig; } if (num >
-	 * 0x10FFFF) { toobig = true; num = 0; } } if (ch != ';') return
-	 * XMLEntityHandler.CHARREF_RESULT_SEMICOLON_REQUIRED; loadNextChar(); if
-	 * (toobig) return XMLEntityHandler.CHARREF_RESULT_OUT_OF_RANGE; return
-	 * num; }
-	 */
-	//
-	//
-	//
-	/*
-	 * public int scanStringLiteral() throws Exception { boolean single; if
-	 * (!(single = lookingAtChar('\'', true)) && !lookingAtChar('\"', true)) {
-	 * return XMLEntityHandler.STRINGLIT_RESULT_QUOTE_REQUIRED; } int offset =
-	 * fCurrentOffset; char qchar = single ? '\'' : '\"'; while
-	 * (!lookingAtChar(qchar, false)) { if (!lookingAtValidChar(true)) {
-	 * return XMLEntityHandler.STRINGLIT_RESULT_INVALID_CHAR; } } // int
-	 * stringIndex = addString(offset, fCurrentOffset - offset); int
-	 * stringIndex = addString(offset, fCurrentOffset - offset);
-	 * lookingAtChar(qchar, true); // move past qchar return stringIndex; }
-	 */
-
-	//
-	//
-	public boolean scanAttValue(char qchar) {
-		boolean result = true;
-		while (true) {
-			if (lookingAtChar(qchar, false)) {
-				break;
-			}
-			if (lookingAtChar(' ', true)) {
-				continue;
-			}
-			if (!lookingAtValidChar(true)) {
-				result = false;
-			}
-		}
-		lookingAtChar(qchar, true);
-		return result;
-	}
-
-	//
-	// [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"'
-	// | "'" ([^%&'] | PEReference | Reference)* "'"
-	//
-	// The values in the following table are defined as:
-	//
-	// 0 - not special
-	// 1 - quote character
-	// 2 - reference
-	// 3 - peref
-	// 4 - invalid
-	//
-	public static final byte fgAsciiEntityValueChar[] = {4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 4, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 1, 0, 0, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, // '\"',
-																																																			// '%',
-																																																			// '&',
-																																																			// '\''
-				0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-
-	/*
-	 * public int scanEntityValue(int qchar, boolean createString) throws
-	 * Exception { int offset = fCurrentOffset; int ch = fMostRecentChar;
-	 * while (true) { if (ch == -1) { changeReaders(); // do not call next
-	 * reader, our caller may need to change the parameters return
-	 * XMLEntityHandler.ENTITYVALUE_RESULT_END_OF_INPUT; } if (ch < 0x80) {
-	 * switch (fgAsciiEntityValueChar[ch]) { case 1: // quote char if (ch ==
-	 * qchar) { if (!createString) return
-	 * XMLEntityHandler.ENTITYVALUE_RESULT_FINISHED; int length =
-	 * fCurrentOffset - offset; int result = length == 0 ?
-	 * StringPool.EMPTY_STRING : addString(offset, length); loadNextChar();
-	 * return result; } // the other quote character is not special // fall
-	 * through case 0: // non-special char if (++fCurrentOffset >= fEndOffset) {
-	 * if (oweTrailingSpace) { oweTrailingSpace = false; ch = fMostRecentChar = ' '; }
-	 * else { ch = fMostRecentChar = -1; } } else { ch = fMostRecentChar =
-	 * fData.charAt(fCurrentOffset); } continue; case 2: // reference return
-	 * XMLEntityHandler.ENTITYVALUE_RESULT_REFERENCE; case 3: // peref return
-	 * XMLEntityHandler.ENTITYVALUE_RESULT_PEREF; case 4: // invalid return
-	 * XMLEntityHandler.ENTITYVALUE_RESULT_INVALID_CHAR; } } else if (ch <
-	 * 0xD800) { ch = loadNextChar(); } else if (ch >= 0xE000 && (ch <= 0xFFFD ||
-	 * (ch >= 0x10000 && ch <= 0x10FFFF))) { // // REVISIT - needs more code
-	 * to check surrogates. // ch = loadNextChar(); } else { return
-	 * XMLEntityHandler.ENTITYVALUE_RESULT_INVALID_CHAR; } } }
-	 */
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/TString.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/TString.java
deleted file mode 100644
index fae6f7a..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/TString.java
+++ /dev/null
@@ -1,350 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-import java.util.StringTokenizer;
-
-/**
- * This class provides static methods for some of the very used IString
- * operations
- */
-
-public class TString {
-	private static final String ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; //$NON-NLS-1$
-	private static final String ALPHANUMERIC = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; //$NON-NLS-1$
-	private static final String NUMERIC = "0123456789"; //$NON-NLS-1$
-
-	// change all occurrences of oldPat to newPat
-	public static String change(String in, String oldPat, String newPat) {
-		if (oldPat.length() == 0)
-			return in;
-		if (oldPat.length() == 1 && newPat.length() == 1)
-			return in.replace(oldPat.charAt(0), newPat.charAt(0));
-
-		int lastIndex = 0;
-		int newIndex = 0;
-		StringBuffer newString = new StringBuffer();
-		for (;;) {
-			newIndex = in.indexOf(oldPat, lastIndex);
-			if (newIndex != -1) {
-				newString.append(in.substring(lastIndex, newIndex) + newPat);
-				lastIndex = newIndex + oldPat.length();
-			}
-			else {
-				newString.append(in.substring(lastIndex));
-				break;
-			}
-		}
-		return newString.toString();
-	}
-
-	// change the occurrences of oldPat to newPat starting at startPosition
-	// for number of numChanges
-	// Note: the 1st char in the string has position of 0
-
-	public static String change(String in, String oldPat, String newPat, int startPos, int numChanges) {
-		if (oldPat.length() == 0)
-			return in;
-		if (oldPat.length() == 1 && newPat.length() == 1)
-			return in.replace(oldPat.charAt(0), newPat.charAt(0));
-
-		int inLen = in.length();
-
-		if (startPos >= inLen)
-			return in;
-
-		int lastIndex = startPos;
-		int newIndex = 0;
-		int countChanges = 0;
-
-
-		StringBuffer newString = new StringBuffer();
-
-		for (;;) {
-			newIndex = in.indexOf(oldPat, lastIndex);
-			if (newIndex != -1) {
-				newString.append(in.substring(lastIndex, newIndex) + newPat);
-				lastIndex = newIndex + oldPat.length();
-				countChanges++;
-			}
-			else {
-				newString.append(in.substring(lastIndex));
-				break;
-			}
-
-			if (countChanges == numChanges) {
-				newString.append(in.substring(lastIndex));
-				break;
-			}
-		}
-
-		return newString.toString();
-	}
-
-	public static String word(String in, int i) {
-		StringTokenizer st = new StringTokenizer(in);
-		if (i <= 0 || i > st.countTokens())
-			return ""; //$NON-NLS-1$
-		else {
-			String ret = new String();
-			while (st.hasMoreTokens()) {
-				ret = st.nextToken();
-				if (--i == 0)
-					return ret;
-			}
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	public static String words(String in, int i) {
-		StringTokenizer st = new StringTokenizer(in);
-		if (i <= 0 || i > st.countTokens())
-			return ""; //$NON-NLS-1$
-		else {
-			while (st.hasMoreTokens()) {
-				if (--i == 0)
-					break;
-				st.nextToken();
-			}
-			if (st.hasMoreTokens())
-				return st.nextToken(""); //$NON-NLS-1$
-			else
-				return ""; //$NON-NLS-1$
-		}
-	}
-
-	public static String appendSpaces(String in, int len) {
-		if (len < 1)
-			return in;
-
-		StringBuffer sb = new StringBuffer(in);
-		for (int i = 0; i < len; i++) {
-			sb.append(" "); //$NON-NLS-1$
-		}
-		return sb.toString();
-	}
-
-	public static int numWords(String in) {
-		StringTokenizer st = new StringTokenizer(in);
-		return st.countTokens();
-	}
-
-	// return the first index within srcString that is not in the validString
-	// example:
-	// srcString = "abcdefg"
-	// validString = "bcfg"
-	// return = 0 (i.e. char a is not in "bcfg") - 1st index = 0
-
-	public static int indexOfAnyBut(String srcString, String validString) {
-		int result = -1;
-		int srcLen = srcString.length();
-
-		// walk backward to find if a char within srcString is in validString
-		for (int i = 0; i < srcLen; i++) {
-			// not found, stop it
-			if (validString.indexOf(srcString.charAt(i)) == -1) {
-				result = i;
-				break;
-			}
-
-		}
-
-		return result;
-	}
-
-	// return the last index within srcString that is not in the validString
-	// example:
-	// srcString = "abcdefg"
-	// validString = "bcfg"
-	// return = 4 (i.e. char e is not in "bcfg") - 1st index = 0
-
-	public static int lastIndexOfAnyBut(String srcString, String validString) {
-		int result = -1;
-		int srcLen = srcString.length();
-
-		// walk backward to find if a char within srcString is in validString
-		for (int i = srcLen - 1; i >= 0; i--) {
-			// not found, stop it
-			if (validString.indexOf(srcString.charAt(i)) == -1) {
-				result = i;
-				break;
-			}
-
-		}
-
-		return result;
-	}
-
-	// return number of occurrences of searchChar within srcString
-	// example:
-	// srcString = "::f::f::g"
-	// seachrChar = ':'
-	// return = 6
-
-	public static int occurrenceOf(String srcString, char searchChar) {
-		int result = 0;
-		// walk backward to find if a char within srcString is in validString
-		if (srcString.length() > 0) {
-
-			for (int i = 0; i < srcString.length(); i++) {
-				// found, increment the count
-				if (searchChar == srcString.charAt(i))
-					result++;
-			}
-		}
-
-		return result;
-	}
-
-	// strip the leading pString in the srcString
-	// example:
-	// srcString = "::f::f::g"
-	// pString "::"
-	// return = "f::f::g"
-
-	public static String stripLeading(String srcString, String pString) {
-		String result;
-
-		if (srcString.startsWith(pString)) // leading patString found
-			result = srcString.substring(pString.length(), srcString.length());
-		else
-			// not found
-			result = srcString;
-
-		return result;
-	}
-
-	// strip the trailing pString in the srcString
-	// example:
-	// srcString = "f::f::g::"
-	// pString "::"
-	// return = "f::f::g"
-
-	public static String stripTrailing(String srcString, String pString) {
-		String result;
-
-		if (srcString.endsWith(pString)) // leading patString found
-			result = srcString.substring(0, srcString.lastIndexOf(pString));
-		else
-			// not found
-			result = srcString;
-
-		return result;
-	}
-
-	/**
-	 * strip the trailing blanks in the src
-	 */
-	public static String stripTrailingBlanks(String src) {
-
-		if (src != null) {
-			while (src.length() > 0) {
-				if (src.endsWith(" ")) //$NON-NLS-1$
-					src = src.substring(0, src.length() - 1);
-				else
-					break;
-			}
-		}
-
-		return src;
-	}
-
-
-
-	// return a string that contains number of copies of srcString
-	// example:
-	// srcString = "abc"
-	// numberOfCopies = 2
-	// return string = "abcabc"
-
-	public static String copy(String srcString, int numberOfCopies) {
-		StringBuffer result = new StringBuffer();
-
-		if (numberOfCopies > 0) {
-			for (int i = 1; i <= numberOfCopies; i++)
-				result.append(srcString);
-		}
-		else
-			result = new StringBuffer(srcString);
-
-		return result.toString();
-	}
-
-	//
-	// return true if all chars in srcString are in {a...z} or {A...Z}
-
-	public static boolean isAlphabetic(String srcString) {
-		return (lastIndexOfAnyBut(srcString, ALPHABET) == -1);
-	}
-
-	//
-	// return true if all chars in srcString are in {a...z,} or {A...Z}
-	// {0...9}
-
-	public static boolean isAlphanumeric(String srcString) {
-		return (lastIndexOfAnyBut(srcString, ALPHANUMERIC) == -1);
-	}
-
-
-	//
-	// return true if all chars are in '0' - '9'
-
-	public static boolean isDigits(String srcString) {
-		return (lastIndexOfAnyBut(srcString, NUMERIC) == -1);
-	}
-
-
-	public static boolean isEmptyOrNull(String string) {
-		return string == null || string.length() == 0;
-	}
-
-
-	//
-	// return the string after the matching token is removed
-	public static String match(String in, String token) throws Exception {
-		if (in == null)
-			return null;
-
-		in = in.trim();
-		if (in.startsWith(token))
-			return in.substring(token.length(), in.length());
-		else
-			throw new Exception("Expected: " + token + " but got:" + word(in, 1)); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	public static long getLong(String str) {
-		try {
-			return Long.parseLong(str);
-		}
-		catch (Exception m) {
-			return 0;
-		}
-	}
-
-	// return true if the " " appears within srcString
-	// example:
-	// srcString = "a m"
-	// return = true
-
-	public static boolean containsDoubleBlanks(String srcString) {
-		String bb = "  "; //$NON-NLS-1$
-		char b = bb.charAt(0);
-
-		if (srcString.length() > 0) {
-			for (int i = 0; i < (srcString.length() - 1); i++) {
-				if ((b == srcString.charAt(i)) & (b == srcString.charAt(i + 1)))
-					return true;
-			}
-		}
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/XMLCharacterProperties.java b/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/XMLCharacterProperties.java
deleted file mode 100644
index c7d2f32..0000000
--- a/bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/XMLCharacterProperties.java
+++ /dev/null
@@ -1,448 +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
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.saxparser;
-
-/**
- * A class representing properties of characters according to various W3C
- * recommendations
- * 
- * XMLCharacterProperties provides convenience methods for commonly used
- * character tests.
- * 
- * For performance reasons, the tables used by the convenience methods are
- * also public, and are directly accessed by performance critical routines.
- * 
- */
-
-public final class XMLCharacterProperties {
-	/*
-	 * [26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')+
-	 * 
-	 * Note: This is the same as the ascii portion of the NameChar definition.
-	 */
-	/**
-	 * Check to see if a string is a valid version string according to [26] in
-	 * the XML 1.0 Recommendation
-	 * 
-	 * @param version
-	 *            string to check
-	 * @return true if version is a valid version string
-	 */
-	public static boolean validVersionNum(String version) {
-		if (version.length() == 0)
-			return false;
-		for (int i = 0; i < version.length(); i++) {
-			char ch = version.charAt(i);
-			if (ch > 'z' || fgAsciiNameChar[ch] == 0)
-				return false;
-		}
-		return true;
-	}
-
-	/*
-	 * [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
-	 */
-	/**
-	 * Check to see if a string is a valid encoding name according to [81] in
-	 * the XML 1.0 Recommendation
-	 * 
-	 * @param encoding
-	 *            string to check
-	 * @return true if encoding is a valid encoding name
-	 */
-	public static boolean validEncName(String encoding) {
-		if (encoding.length() == 0)
-			return false;
-		char ch = encoding.charAt(0);
-		if (ch > 'z' || fgAsciiAlphaChar[ch] == 0)
-			return false;
-		for (int i = 1; i < encoding.length(); i++) {
-			ch = encoding.charAt(i);
-			if (ch > 'z' || fgAsciiEncNameChar[ch] == 0)
-				return false;
-		}
-		return true;
-	}
-
-	/*
-	 * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] |
-	 * [-'()+,./:=?;!*#@$_%]
-	 */
-	/**
-	 * Check to see if a string is a valid public identifier according to [13]
-	 * in the XML 1.0 Recommendation
-	 * 
-	 * @param publicId
-	 *            string to check
-	 * @return true if publicId is a valid public identifier
-	 */
-	public static int validPublicId(String publicId) {
-		if (publicId.length() == 0)
-			return -1;
-		for (int i = 0; i < publicId.length(); i++) {
-			char ch = publicId.charAt(i);
-			if (ch > 'z' || fgAsciiPubidChar[ch] == 0)
-				return i;
-		}
-		return -1;
-	}
-
-	/*
-	 * [5] Name ::= (Letter | '_' | ':') (NameChar)*
-	 */
-	/**
-	 * Check to see if a string is a valid Name according to [5] in the XML
-	 * 1.0 Recommendation
-	 * 
-	 * @param name
-	 *            string to check
-	 * @return true if name is a valid Name
-	 */
-	public static boolean validName(String name) {
-		XMLCharacterProperties.initCharFlags();
-		if (name.length() == 0)
-			return false;
-		char ch = name.charAt(0);
-		if (ch > 'z') {
-			if ((fgCharFlags[ch] & E_InitialNameCharFlag) == 0)
-				return false;
-		}
-		else if (fgAsciiInitialNameChar[ch] == 0)
-			return false;
-		for (int i = 1; i < name.length(); i++) {
-			ch = name.charAt(i);
-			if (ch > 'z') {
-				if ((fgCharFlags[ch] & E_NameCharFlag) == 0)
-					return false;
-			}
-			else if (fgAsciiNameChar[ch] == 0)
-				return false;
-		}
-		return true;
-	}
-
-	/*
-	 * from the namespace rec [5] NCName ::= (Letter | '_' | ':')
-	 * (NameNCChar)*
-	 */
-	/**
-	 * Check to see if a string is a valid NCName according to [5] from the
-	 * XML Namespaces 1.0 Recommendation
-	 * 
-	 * @param name
-	 *            string to check
-	 * @return true if name is a valid NCName
-	 */
-	public static boolean validNCName(String name) {
-		XMLCharacterProperties.initCharFlags();
-		if (name.length() == 0)
-			return false;
-		char ch = name.charAt(0);
-		if (ch > 'z') {
-			if ((fgCharFlags[ch] & E_InitialNameCharFlag) == 0)
-				return false;
-		}
-		else if (fgAsciiInitialNCNameChar[ch] == 0)
-			return false;
-		for (int i = 1; i < name.length(); i++) {
-			ch = name.charAt(i);
-			if (ch > 'z') {
-				if ((fgCharFlags[ch] & E_NameCharFlag) == 0)
-					return false;
-			}
-			else if (fgAsciiNCNameChar[ch] == 0)
-				return false;
-		}
-		return true;
-	}
-
-
-	/*
-	 * [7] Nmtoken ::= (NameChar)+
-	 */
-	/**
-	 * Check to see if a string is a valid Nmtoken according to [7] in the XML
-	 * 1.0 Recommendation
-	 * 
-	 * @param nmtoken
-	 *            string to checj
-	 * @return true if nmtoken is a valid Nmtoken
-	 */
-	public static boolean validNmtoken(String nmtoken) {
-		XMLCharacterProperties.initCharFlags();
-		if (nmtoken.length() == 0)
-			return false;
-		for (int i = 0; i < nmtoken.length(); i++) {
-			char ch = nmtoken.charAt(i);
-			if (ch > 'z') {
-				if ((fgCharFlags[ch] & E_NameCharFlag) == 0)
-					return false;
-			}
-			else if (fgAsciiNameChar[ch] == 0) {
-				return false;
-			}
-		}
-		return true;
-	}
-
-	/*
-	 * Here are tables used to build character properties.
-	 */
-	public static final byte fgAsciiXDigitChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // '0'
-																																																													// -
-																																																													// '9'
-				0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 'A' - 'F'
-				0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 'a'
-																												// -
-																												// 'f'
-				0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-	public static final byte fgAsciiAlphaChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'A'
-																																																																									// -
-																																																																									// 'O'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, // 'P' - 'Z'
-				0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
-	};
-	public static final byte fgAsciiEncNameChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, // '-'
-																																																		// is
-																																																		// 0x2D
-																																																		// and
-																																																		// '.'
-																																																		// is
-																																																		// 0x2E
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // '0' - '9'
-				0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'A' - 'O'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 'P' - 'Z'
-																// and '_' is
-																// 0x5F
-				0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
-	};
-	public static final byte fgAsciiPubidChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // ' ',
-																																																	// '!',
-																																																	// '#',
-																																																	// '$',
-																																																	// '%',
-				// '\'', '(', ')', '*', '+', ',', '-', '.', '/'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, // '0' - '9',
-																// ':', ';',
-																// '=', '?'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // '@', 'A' -
-																// 'O'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 'P' - 'Z'
-																// and '_' is
-																// 0x5F
-				0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
-	};
-	public static final byte fgAsciiInitialNameChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, // ':'
-																																																															// is
-																																																															// 0x3A
-				0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'A' - 'O'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 'P' - 'Z'
-																// and '_' is
-																// 0x5F
-				0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
-	};
-	public static final byte fgAsciiNameChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, // '-'
-																																																	// is
-																																																	// 0x2D
-																																																	// and
-																																																	// '.'
-																																																	// is
-																																																	// 0x2E
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, // '0' - '9'
-																// and ':' is
-																// 0x3A
-				0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'A' - 'O'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 'P' - 'Z'
-																// and '_' is
-																// 0x5F
-				0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
-	};
-	public static final byte fgAsciiInitialNCNameChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ':'
-																																																															// is
-																																																															// 0x3A
-				0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'A' - 'O'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 'P' - 'Z'
-																// and '_' is
-																// 0x5F
-				0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
-	};
-	public static final byte fgAsciiNCNameChar[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, // '-'
-																																																	// is
-																																																	// 0x2D
-																																																	// and
-																																																	// '.'
-																																																	// is
-																																																	// 0x2E
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // '0' - '9'
-																// and ':' is
-																// 0x3A
-				0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'A' - 'O'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 'P' - 'Z'
-																// and '_' is
-																// 0x5F
-				0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 'a' - 'o'
-				1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 'p' - 'z'
-	};
-	public static final byte fgAsciiCharData[] = {4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 4, // tab
-																									// is
-																									// 0x09
-				4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, // '&'
-																												// is
-																												// 0x26
-				0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, // '<' is 0x3C
-				0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, // ']'
-																												// is
-																												// 0x5D
-				0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-	public static final byte fgAsciiWSCharData[] = {4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 5, 4, 4, // tab
-																									// is
-																									// 0x09,
-																									// LF
-																									// is
-																									// 0x0A,
-																									// CR
-																									// is
-																									// 0x0D
-				4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ' '
-																												// is
-																												// 0x20,
-																												// '&'
-																												// is
-																												// 0x26
-				0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, // '<' is 0x3C
-				0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, // ']'
-																												// is
-																												// 0x5D
-				0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-	public static final byte E_CharDataFlag = 1 << 0;
-	public static final byte E_InitialNameCharFlag = 1 << 1;
-	public static final byte E_NameCharFlag = 1 << 2;
-	public static byte[] fgCharFlags = null;
-
-	public static synchronized void initCharFlags() {
-		if (fgCharFlags == null) {
-			fgCharFlags = new byte[0x10000];
-			setFlagForRange(fgCharDataRanges, E_CharDataFlag);
-			setFlagForRange(fgInitialNameCharRanges, (byte) (E_InitialNameCharFlag | E_NameCharFlag));
-			setFlagForRange(fgNameCharRanges, E_NameCharFlag);
-		}
-	}
-
-	private static void setFlagForRange(char[] ranges, byte flag) {
-		int i;
-		int ch;
-		for (i = 0; (ch = ranges[i]) != 0; i += 2) {
-			int endch = ranges[i + 1];
-			while (ch <= endch)
-				fgCharFlags[ch++] |= flag;
-		}
-		for (i++; (ch = ranges[i]) != 0; i++)
-			fgCharFlags[ch] |= flag;
-	}
-
-	/*
-	 * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] // any Unicode character,
-	 * excluding the | [#xE000-#xFFFD] | [#x10000-#x10FFFF] // surrogate
-	 * blocks, FFFE, and FFFF. [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
-	 * 
-	 * We will use Char - ( [^<&] | ']' | #xA | #xD ) and handle the special
-	 * cases inline.
-	 */
-	private static final char fgCharDataRanges[] = {0x0020, 0x0025, // '&' is
-																	// 0x0026
-				0x0027, 0x003B, // '<' is 0x003C
-				0x003D, 0x005C, // ']' is 0x005D
-				0x005E, 0xD7FF, 0xE000, 0xFFFD, 0x0000, 0x0009, // tab
-				0x0000};
-	/*
-	 * [5] Name ::= (Letter | '_' | ':') (NameChar)* [4] NameChar ::= Letter |
-	 * Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [84] Letter
-	 * ::= BaseChar | Ideographic [85] BaseChar ::= <see standard> [86]
-	 * Ideographic ::= <see standard> [87] CombiningChar ::= <see standard>
-	 * [88] Digit ::= <see standard> [89] Extender ::= <see standard>
-	 */
-	private static final char fgInitialNameCharRanges[] = {
-	//
-				// Ranges:
-				//
-				// BaseChar ranges
-				//
-				0x0041, 0x005A, 0x0061, 0x007A, 0x00C0, 0x00D6, 0x00D8, 0x00F6, 0x00F8, 0x0131, 0x0134, 0x013E, 0x0141, 0x0148, 0x014A, 0x017E, 0x0180, 0x01C3, 0x01CD, 0x01F0, 0x01F4, 0x01F5, 0x01FA, 0x0217, 0x0250, 0x02A8, 0x02BB, 0x02C1, 0x0388, 0x038A, 0x038E, 0x03A1, 0x03A3, 0x03CE, 0x03D0, 0x03D6, 0x03E2, 0x03F3, 0x0401, 0x040C, 0x040E, 0x044F, 0x0451, 0x045C, 0x045E, 0x0481, 0x0490, 0x04C4, 0x04C7, 0x04C8, 0x04CB, 0x04CC, 0x04D0, 0x04EB, 0x04EE, 0x04F5, 0x04F8, 0x04F9, 0x0531, 0x0556, 0x0561, 0x0586, 0x05D0, 0x05EA, 0x05F0, 0x05F2, 0x0621, 0x063A, 0x0641, 0x064A, 0x0671, 0x06B7, 0x06BA, 0x06BE, 0x06C0, 0x06CE, 0x06D0, 0x06D3, 0x06E5, 0x06E6, 0x0905, 0x0939, 0x0958, 0x0961, 0x0985, 0x098C, 0x098F, 0x0990, 0x0993, 0x09A8, 0x09AA, 0x09B0, 0x09B6, 0x09B9, 0x09DC, 0x09DD, 0x09DF, 0x09E1, 0x09F0, 0x09F1, 0x0A05, 0x0A0A, 0x0A0F, 0x0A10, 0x0A13, 0x0A28, 0x0A2A, 0x0A30, 0x0A32, 0x0A33, 0x0A35, 0x0A36, 0x0A38, 0x0A39, 0x0A59, 0x0A5C, 0x0A72, 0x0A74, 0x0A85, 0x0A8B, 0x0A8F, 0x0A91,
-				0x0A93, 0x0AA8, 0x0AAA, 0x0AB0, 0x0AB2, 0x0AB3, 0x0AB5, 0x0AB9, 0x0B05, 0x0B0C, 0x0B0F, 0x0B10, 0x0B13, 0x0B28, 0x0B2A, 0x0B30, 0x0B32, 0x0B33, 0x0B36, 0x0B39, 0x0B5C, 0x0B5D, 0x0B5F, 0x0B61, 0x0B85, 0x0B8A, 0x0B8E, 0x0B90, 0x0B92, 0x0B95, 0x0B99, 0x0B9A, 0x0B9E, 0x0B9F, 0x0BA3, 0x0BA4, 0x0BA8, 0x0BAA, 0x0BAE, 0x0BB5, 0x0BB7, 0x0BB9, 0x0C05, 0x0C0C, 0x0C0E, 0x0C10, 0x0C12, 0x0C28, 0x0C2A, 0x0C33, 0x0C35, 0x0C39, 0x0C60, 0x0C61, 0x0C85, 0x0C8C, 0x0C8E, 0x0C90, 0x0C92, 0x0CA8, 0x0CAA, 0x0CB3, 0x0CB5, 0x0CB9, 0x0CE0, 0x0CE1, 0x0D05, 0x0D0C, 0x0D0E, 0x0D10, 0x0D12, 0x0D28, 0x0D2A, 0x0D39, 0x0D60, 0x0D61, 0x0E01, 0x0E2E, 0x0E32, 0x0E33, 0x0E40, 0x0E45, 0x0E81, 0x0E82, 0x0E87, 0x0E88, 0x0E94, 0x0E97, 0x0E99, 0x0E9F, 0x0EA1, 0x0EA3, 0x0EAA, 0x0EAB, 0x0EAD, 0x0EAE, 0x0EB2, 0x0EB3, 0x0EC0, 0x0EC4, 0x0F40, 0x0F47, 0x0F49, 0x0F69, 0x10A0, 0x10C5, 0x10D0, 0x10F6, 0x1102, 0x1103, 0x1105, 0x1107, 0x110B, 0x110C, 0x110E, 0x1112, 0x1154, 0x1155, 0x115F, 0x1161, 0x116D, 0x116E,
-				0x1172, 0x1173, 0x11AE, 0x11AF, 0x11B7, 0x11B8, 0x11BC, 0x11C2, 0x1E00, 0x1E9B, 0x1EA0, 0x1EF9, 0x1F00, 0x1F15, 0x1F18, 0x1F1D, 0x1F20, 0x1F45, 0x1F48, 0x1F4D, 0x1F50, 0x1F57, 0x1F5F, 0x1F7D, 0x1F80, 0x1FB4, 0x1FB6, 0x1FBC, 0x1FC2, 0x1FC4, 0x1FC6, 0x1FCC, 0x1FD0, 0x1FD3, 0x1FD6, 0x1FDB, 0x1FE0, 0x1FEC, 0x1FF2, 0x1FF4, 0x1FF6, 0x1FFC, 0x212A, 0x212B, 0x2180, 0x2182, 0x3041, 0x3094, 0x30A1, 0x30FA, 0x3105, 0x312C, 0xAC00, 0xD7A3,
-				//
-				// Ideographic ranges
-				//
-				0x3021, 0x3029, 0x4E00, 0x9FA5,
-				//
-				// Ranges end marker
-				//
-				0x0000,
-				//
-				// Single char values
-				//
-				0x003A, // ':'
-				0x005F, // '_'
-				//
-				// BaseChar singles
-				//
-				0x0386, 0x038C, 0x03DA, 0x03DC, 0x03DE, 0x03E0, 0x0559, 0x06D5, 0x093D, 0x09B2, 0x0A5E, 0x0A8D, 0x0ABD, 0x0AE0, 0x0B3D, 0x0B9C, 0x0CDE, 0x0E30, 0x0E84, 0x0E8A, 0x0E8D, 0x0EA5, 0x0EA7, 0x0EB0, 0x0EBD, 0x1100, 0x1109, 0x113C, 0x113E, 0x1140, 0x114C, 0x114E, 0x1150, 0x1159, 0x1163, 0x1165, 0x1167, 0x1169, 0x1175, 0x119E, 0x11A8, 0x11AB, 0x11BA, 0x11EB, 0x11F0, 0x11F9, 0x1F59, 0x1F5B, 0x1F5D, 0x1FBE, 0x2126, 0x212E,
-				//
-				// Ideographic singles
-				//
-				0x3007,
-				//
-				// Singles end marker
-				//
-				0x0000};
-	private static final char fgNameCharRanges[] = {
-	//
-				// Ranges:
-				//
-				0x002D, 0x002E, // '-' and '.'
-				//
-				// CombiningChar ranges
-				//
-				0x0300, 0x0345, 0x0360, 0x0361, 0x0483, 0x0486, 0x0591, 0x05A1, 0x05A3, 0x05B9, 0x05BB, 0x05BD, 0x05C1, 0x05C2, 0x064B, 0x0652, 0x06D6, 0x06DC, 0x06DD, 0x06DF, 0x06E0, 0x06E4, 0x06E7, 0x06E8, 0x06EA, 0x06ED, 0x0901, 0x0903, 0x093E, 0x094C, 0x0951, 0x0954, 0x0962, 0x0963, 0x0981, 0x0983, 0x09C0, 0x09C4, 0x09C7, 0x09C8, 0x09CB, 0x09CD, 0x09E2, 0x09E3, 0x0A40, 0x0A42, 0x0A47, 0x0A48, 0x0A4B, 0x0A4D, 0x0A70, 0x0A71, 0x0A81, 0x0A83, 0x0ABE, 0x0AC5, 0x0AC7, 0x0AC9, 0x0ACB, 0x0ACD, 0x0B01, 0x0B03, 0x0B3E, 0x0B43, 0x0B47, 0x0B48, 0x0B4B, 0x0B4D, 0x0B56, 0x0B57, 0x0B82, 0x0B83, 0x0BBE, 0x0BC2, 0x0BC6, 0x0BC8, 0x0BCA, 0x0BCD, 0x0C01, 0x0C03, 0x0C3E, 0x0C44, 0x0C46, 0x0C48, 0x0C4A, 0x0C4D, 0x0C55, 0x0C56, 0x0C82, 0x0C83, 0x0CBE, 0x0CC4, 0x0CC6, 0x0CC8, 0x0CCA, 0x0CCD, 0x0CD5, 0x0CD6, 0x0D02, 0x0D03, 0x0D3E, 0x0D43, 0x0D46, 0x0D48, 0x0D4A, 0x0D4D, 0x0E34, 0x0E3A, 0x0E47, 0x0E4E, 0x0EB4, 0x0EB9, 0x0EBB, 0x0EBC, 0x0EC8, 0x0ECD, 0x0F18, 0x0F19, 0x0F71, 0x0F84, 0x0F86, 0x0F8B,
-				0x0F90, 0x0F95, 0x0F99, 0x0FAD, 0x0FB1, 0x0FB7, 0x20D0, 0x20DC, 0x302A, 0x302F,
-				//
-				// Digit ranges
-				//
-				0x0030, 0x0039, 0x0660, 0x0669, 0x06F0, 0x06F9, 0x0966, 0x096F, 0x09E6, 0x09EF, 0x0A66, 0x0A6F, 0x0AE6, 0x0AEF, 0x0B66, 0x0B6F, 0x0BE7, 0x0BEF, 0x0C66, 0x0C6F, 0x0CE6, 0x0CEF, 0x0D66, 0x0D6F, 0x0E50, 0x0E59, 0x0ED0, 0x0ED9, 0x0F20, 0x0F29,
-				//
-				// Extender ranges
-				//
-				0x3031, 0x3035, 0x309D, 0x309E, 0x30FC, 0x30FE,
-				//
-				// Ranges end marker
-				//
-				0x0000,
-				//
-				// Single char values
-				//
-				// CombiningChar singles
-				//
-				0x05BF, 0x05C4, 0x0670, 0x093C, 0x094D, 0x09BC, 0x09BE, 0x09BF, 0x09D7, 0x0A02, 0x0A3C, 0x0A3E, 0x0A3F, 0x0ABC, 0x0B3C, 0x0BD7, 0x0D57, 0x0E31, 0x0EB1, 0x0F35, 0x0F37, 0x0F39, 0x0F3E, 0x0F3F, 0x0F97, 0x0FB9, 0x20E1, 0x3099, 0x309A,
-				//
-				// Extender singles
-				//
-				0x00B7, 0x02D0, 0x02D1, 0x0387, 0x0640, 0x0E46, 0x0EC6, 0x3005,
-				//
-				// Singles end marker
-				//
-				0x0000};
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationMessages.java b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationMessages.java
deleted file mode 100644
index a143120..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationMessages.java
+++ /dev/null
@@ -1,36 +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.dtd.core.internal.validation;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by DTD Validation
- * 
- * @plannedfor 1.0
- */
-public class DTDValidationMessages extends NLS {
-	public static String _ERROR_REF_ELEMENT_UNDEFINED;
-
-	public static String _UI_DIALOG_DTD_INVALID_TEXT;
-	public static String _UI_DIALOG_DTD_INVALID_TITLE;
-	public static String _UI_DIALOG_DTD_VALID_TEXT;
-	public static String _UI_DIALOG_DTD_VALID_TITLE;
-	private static final String BUNDLE_NAME = "org.eclipse.wst.dtd.core.internal.validation.DTDValidationResources";//$NON-NLS-1$
-	public static String Missing_required_files_1;
-	public static String Missing_required_files_2;
-	public static String Missing_required_files_3;
-	public static String Missing_required_files_4;
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, DTDValidationMessages.class);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationResources.properties b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationResources.properties
deleted file mode 100644
index 1986a3c..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationResources.properties
+++ /dev/null
@@ -1,27 +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
-###############################################################################
-
-!
-! Validate DTD
-!
-_UI_DIALOG_DTD_INVALID_TITLE  = Validation Failed
-_UI_DIALOG_DTD_VALID_TITLE    = Validation Succeeded
-_UI_DIALOG_DTD_VALID_TEXT     = The DTD file is valid.
-_UI_DIALOG_DTD_INVALID_TEXT   = The DTD file is not valid. See the Problems view for error messages.
-
-!
-! Referenced Element Validation
-!
-_ERROR_REF_ELEMENT_UNDEFINED = The element {0} has not been declared.
-Missing_required_files_1=Required files xercesImpl.jar and xmlParserAPIs.jar cannot be found.\n\n
-Missing_required_files_2=Download Xerces 2.6.2 and place xercesImpl.jar and xmlParserAPIs.jar in a folder entitled jars in the org.eclipse.wst.xml.validation plugin.\n\n
-Missing_required_files_3=For more information see www.eclipse.org/webtools/wst/components/xml/xercesInfo.xml.
-Missing_required_files_4=Missing Xerces
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/ElementRefLocation.java b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/ElementRefLocation.java
deleted file mode 100644
index d998da1..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/ElementRefLocation.java
+++ /dev/null
@@ -1,86 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.validation;
-
-/**
- * An element references location holds the location of an element reference.
- * An element reference is declared in a DTD element declaration such as
- * <!ELEMENT myelem (elementref)> An element reference may be part of a linked
- * list and can contain a reference to the next element reference in the list.
- * 
- * @author Lawrence Mandel, IBM
- */
-class ElementRefLocation {
-	private int column = -1;
-
-	private int line = -1;
-
-	private ElementRefLocation next = null;
-
-	private String uri;
-
-	/**
-	 * Constructor.
-	 * 
-	 * @param line
-	 *            The line location of the element reference.
-	 * @param column
-	 *            The column location of the element reference.
-	 * @param uri
-	 *            The URI of the file containing the element reference.
-	 * @param next
-	 *            The next element reference in the list.
-	 */
-	public ElementRefLocation(int line, int column, String uri, ElementRefLocation next) {
-		this.line = line;
-		this.column = column;
-		this.uri = uri;
-		this.next = next;
-	}
-
-	/**
-	 * Get the column location of the element reference.
-	 * 
-	 * @return The column location of the element reference.
-	 */
-	public int getColumn() {
-		return column;
-	}
-
-	/**
-	 * Get the line location of the element reference.
-	 * 
-	 * @return The line location of the element reference.
-	 */
-	public int getLine() {
-		return line;
-	}
-
-	/**
-	 * Get the next element reference in the linked list.
-	 * 
-	 * @return The next element reference in the linked list.
-	 */
-	public ElementRefLocation getNext() {
-		return next;
-	}
-
-	/**
-	 * Get the URI of the file that contains the element reference.
-	 * 
-	 * @return The URI of the file that contains the element reference.
-	 */
-	public String getURI() {
-		return uri;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/Validator.java b/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/Validator.java
deleted file mode 100644
index 289b46c..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/Validator.java
+++ /dev/null
@@ -1,460 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.validation;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.osgi.util.NLS;
-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.validation.core.LazyURLInputStream;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-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.ext.LexicalHandler;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * DTD validation.
- * 
- * @author Lawrence Mandel, IBM
- */
-public class Validator {
-	/**
-	 * An entity resolver that wraps a URI resolver.
-	 * 
-	 * @author Lawrence Mandel, IBM
-	 */
-	class DTDEntityResolver implements EntityResolver {
-		private String fBaseLocation = null;
-		private URIResolver fURIResolver = null;
-
-		/**
-		 * Constructor.
-		 * 
-		 * @param idresolver
-		 *            The idresolver this entity resolver wraps.
-		 * @param baselocation
-		 *            The base location to resolve with.
-		 */
-		public DTDEntityResolver(URIResolver uriresolver, String baselocation) {
-			this.fURIResolver = uriresolver;
-            
-            // TODO cs: we never seem to set a URIResolver
-            // I create one here up front just incase
-            //
-            if (fURIResolver == null)
-            {
-              fURIResolver = URIResolverPlugin.createResolver();              
-            }  
-			this.fBaseLocation = baselocation;
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String,
-		 *      java.lang.String)
-		 */
-		public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
-			String location = null;
-            
-            
-			if (fBaseLocation.equals(systemId)) {
-				location = systemId;
-			}
-			else {
-				location = fURIResolver.resolve(fBaseLocation, publicId, systemId);
-			}
-			InputSource is = null;
-			if (location != null && !location.equals("")) //$NON-NLS-1$
-			{
-			  // CS : while working on bug 113537 I noticed we're not using the LazyURLInputStream
-		      // so fixed this to avoid leaking file handles
-			  //
-              String physical = fURIResolver.resolvePhysicalLocation(fBaseLocation, publicId, location); 
-			  is = new InputSource(location);
-			  is.setByteStream(new LazyURLInputStream(physical));
-			}
-			return is;
-		}
-	}
-
-	/**
-	 * An error handler for DTD validation.
-	 * 
-	 * @author Lawrence Mandel, IBM
-	 */
-	class DTDErrorHandler implements ErrorHandler {
-
-		private final int ERROR = 0;
-		private final ValidationInfo fValidationInfo;
-
-		private final int WARNING = 1;
-
-		/**
-		 * Constructor.
-		 * 
-		 * @param valinfo
-		 *            The validation info object to use to register validation
-		 *            messages.
-		 */
-		public DTDErrorHandler(ValidationInfo valinfo) {
-			this.fValidationInfo = valinfo;
-		}
-
-		/**
-		 * Add a validation message with the given severity.
-		 * 
-		 * @param exception
-		 *            The exception that contains the information about the
-		 *            message.
-		 * @param severity
-		 *            The severity of the validation message.
-		 */
-		protected void addValidationMessage(SAXParseException exception, int severity) {
-			if (exception.getSystemId() != null) {
-				if (severity == WARNING) {
-					fValidationInfo.addWarning(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), exception.getSystemId());
-				}
-				else {
-					fValidationInfo.addError(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), exception.getSystemId());
-				}
-			}
-		}
-
-		/*
-		 * (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);
-		}
-	}
-
-	class MultiHandler extends DefaultHandler implements org.xml.sax.DTDHandler, ContentHandler, LexicalHandler, DeclHandler {
-		private static final String ELEMENT_MODIFIERS = "*+?"; //$NON-NLS-1$
-
-		private static final String MODEL_DELIMITERS = ",()| "; //$NON-NLS-1$
-
-		private List fElemDecls = new ArrayList();
-
-		private Hashtable fElemRefs = new Hashtable();
-
-		private List fIgnoreElemModel = new ArrayList();
-
-		private List fIgnoreElemRefs = new ArrayList();
-
-		private Locator fLocator = null;
-
-		public MultiHandler() {
-			fIgnoreElemRefs.add("#PCDATA"); //$NON-NLS-1$
-			fIgnoreElemModel.add("ANY"); //$NON-NLS-1$
-			fIgnoreElemModel.add("EMPTY"); //$NON-NLS-1$
-		}
-
-		/*
-		 * (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) throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
-		 */
-		public void comment(char[] arg0, int arg1, int arg2) throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.DeclHandler#elementDecl(java.lang.String,
-		 *      java.lang.String)
-		 */
-		public void elementDecl(String name, String model) throws SAXException {
-			// Add this element to the list of declared elements.
-			fElemDecls.add(name);
-
-			// Return if the element model should be ignored. The model should
-			// be
-			// ignored in such cases as when it is equal to EMPTY or ANY.
-			if (fIgnoreElemModel.contains(model)) {
-				return;
-			}
-			// Add each referenced element to the list of referenced elements
-			int line = fLocator.getLineNumber();
-			int column = fLocator.getColumnNumber();
-			String uri = fLocator.getSystemId();
-
-			StringTokenizer strtok = new StringTokenizer(model, MODEL_DELIMITERS);
-			while (strtok.hasMoreTokens()) {
-				String token = strtok.nextToken();
-				int tokenlength = token.length();
-				if (ELEMENT_MODIFIERS.indexOf(token.charAt(tokenlength - 1)) != -1) {
-					token = token.substring(0, tokenlength - 1);
-					// If the token is now empty (it was only ?,* or +) then
-					// continue.
-					if (token.length() == 0) {
-						continue;
-					}
-				}
-				if (fIgnoreElemRefs.contains(token)) {
-					continue;
-				}
-				ElementRefLocation elemLoc = (ElementRefLocation) fElemRefs.get(token);
-				ElementRefLocation tokenLoc = new ElementRefLocation(line, column, uri, elemLoc);
-				fElemRefs.put(token, tokenLoc);
-			}
-
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#endCDATA()
-		 */
-		public void endCDATA() throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#endDTD()
-		 */
-		public void endDTD() throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#endEntity(java.lang.String)
-		 */
-		public void endEntity(String arg0) throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (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) throws SAXException {
-			// No method impl.
-		}
-
-		/**
-		 * Get the list of element declarations.
-		 * 
-		 * @return The list of element declarations.
-		 */
-		public List getElementDeclarations() {
-			return fElemDecls;
-		}
-
-		/**
-		 * Get the element references hashtable.
-		 * 
-		 * @return The element references hashtable.
-		 */
-		public Hashtable getElementReferences() {
-			return fElemRefs;
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.DeclHandler#internalEntityDecl(java.lang.String,
-		 *      java.lang.String)
-		 */
-		public void internalEntityDecl(String name, String value) throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator)
-		 */
-		public void setDocumentLocator(Locator locator) {
-			super.setDocumentLocator(locator);
-			this.fLocator = locator;
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#startCDATA()
-		 */
-		public void startCDATA() throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#startDTD(java.lang.String,
-		 *      java.lang.String, java.lang.String)
-		 */
-		public void startDTD(String name, String publicId, String systemId) throws SAXException {
-			// No method impl.
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.xml.sax.ext.LexicalHandler#startEntity(java.lang.String)
-		 */
-		public void startEntity(String name) throws SAXException {
-			// No method impl.
-		}
-	}
-
-	private static Validator _instance = null;
-
-	public static Validator getInstance() {
-		if (_instance == null) {
-			_instance = new Validator();
-		}
-		return _instance;
-	}
-
-	private URIResolver fResolver = null;
-
-	private Validator() {
-		super();
-	}
-
-	/**
-	 * Set the URI resolver to use with XSD validation.
-	 * 
-	 * @param uriresolver
-	 *            The URI resolver to use.
-	 */
-	public void setURIResolver(URIResolver uriresolver) {
-		this.fResolver = uriresolver;
-	}
-
-	/**
-	 * Validate the DTD file located at the URI.
-	 * 
-	 * @param uri
-	 *            The URI of the file to validate.
-	 * @return A validation report for the validation.
-	 */
-	public ValidationReport validate(String uri) {
-		ValidationInfo valinfo = new ValidationInfo(uri);
-		try {
-			SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
-			XMLReader reader = parser.getXMLReader();
-			MultiHandler dtdHandler = new MultiHandler();
-			reader.setProperty("http://xml.org/sax/properties/declaration-handler", dtdHandler); //$NON-NLS-1$
-			reader.setProperty("http://xml.org/sax/properties/lexical-handler", dtdHandler); //$NON-NLS-1$
-			reader.setContentHandler(dtdHandler);
-			reader.setDTDHandler(dtdHandler);
-			reader.setErrorHandler(new DTDErrorHandler(valinfo));
-			reader.setEntityResolver(new DTDEntityResolver(fResolver, uri));
-			String document = "<!DOCTYPE root SYSTEM \"" + uri + "\"><root/>"; //$NON-NLS-1$ //$NON-NLS-2$
-
-			reader.parse(new InputSource(new StringReader(document)));
-
-			List elemDecls = dtdHandler.getElementDeclarations();
-			Hashtable elemRefs = dtdHandler.getElementReferences();
-			validateElementReferences(elemDecls, elemRefs, valinfo);
-		}
-		catch (ParserConfigurationException e) {
-
-		}
-		catch (IOException e) {
-
-		}
-		catch (SAXException e) {
-
-		}
-		return valinfo;
-	}
-
-	/**
-	 * Validate the element references in the DTD. An element reference is
-	 * <!ELEMENT elem (elementReference)>
-	 * 
-	 * @param elemDecls
-	 *            A list of valid element declarations.
-	 * @param elemRefs
-	 *            A hashtable containing element references as keys and
-	 *            locations in the document as values.
-	 * @param valinfo
-	 *            The validation info object to store validation information.
-	 */
-	private void validateElementReferences(List elemDecls, Hashtable elemRefs, ValidationInfo valinfo) {
-		Enumeration keys = elemRefs.keys();
-		while (keys.hasMoreElements()) {
-			String elemRef = (String) keys.nextElement();
-			// If the element hasn't been declared create an error.
-			if (!elemDecls.contains(elemRef)) {
-				ElementRefLocation elemLoc = (ElementRefLocation) elemRefs.get(elemRef);
-				do {
-					valinfo.addError(NLS.bind(DTDValidationMessages._ERROR_REF_ELEMENT_UNDEFINED, "'" + elemRef + "'"), elemLoc.getLine(), elemLoc.getColumn(), elemLoc.getURI()); //$NON-NLS-1$ //$NON-NLS-2$
-					elemLoc = elemLoc.getNext();
-				}
-				while (elemLoc != null);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Attribute.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Attribute.java
deleted file mode 100644
index 5dd9fe5..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Attribute.java
+++ /dev/null
@@ -1,376 +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.dtd.core.internal;
-
-import java.util.Hashtable;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-// base class for an Element's contentmodel
-public class Attribute extends DTDNode {
-
-	public static final String CDATA = DTDCoreMessages._UI_CHARACTER_DATA_DESC; //$NON-NLS-1$
-	public static final String ENTITIES = DTDCoreMessages._UI_ENTITY_NAMES_DESC; //$NON-NLS-1$
-	public static final String ENTITY = DTDCoreMessages._UI_ENTITY_NAME_DESC; //$NON-NLS-1$
-	public static final String ENUMERATED_NAME = DTDCoreMessages._UI_ENUM_NAME_TOKENS_DESC; //$NON-NLS-1$
-	public static final String ENUMERATED_NOTATION = DTDCoreMessages._UI_ENUM_NOTATION_DESC; //$NON-NLS-1$
-	public static final String FIXED = "#FIXED"; //$NON-NLS-1$
-	public static final String ID = DTDCoreMessages._UI_IDENTIFIER_DESC; //$NON-NLS-1$
-	public static final String IDREF = DTDCoreMessages._UI_ID_REFERENCE_DESC; //$NON-NLS-1$
-	public static final String IDREFS = DTDCoreMessages._UI_ID_REFERENCES_DESC; //$NON-NLS-1$
-
-	public static final String IMPLIED = "#IMPLIED"; //$NON-NLS-1$
-	public static final String NMTOKEN = DTDCoreMessages._UI_NAME_TOKEN_DESC; //$NON-NLS-1$
-	public static final String NMTOKENS = DTDCoreMessages._UI_NAME_TOKENS_DESC; //$NON-NLS-1$
-	public static final String REQUIRED = "#REQUIRED"; //$NON-NLS-1$
-
-	protected static Hashtable typeHash = new Hashtable();
-
-	public static final String[] types = {CDATA, ID, IDREF, IDREFS, ENTITY, ENTITIES, NMTOKEN, NMTOKENS, ENUMERATED_NAME, ENUMERATED_NOTATION};
-
-	{
-		typeHash.put(DTDRegionTypes.CDATA_KEYWORD, CDATA);
-		typeHash.put(DTDRegionTypes.ID_KEYWORD, ID);
-		typeHash.put(DTDRegionTypes.IDREF_KEYWORD, IDREF);
-		typeHash.put(DTDRegionTypes.IDREFS_KEYWORD, IDREFS);
-		typeHash.put(DTDRegionTypes.ENTITY_KEYWORD, ENTITY);
-		typeHash.put(DTDRegionTypes.ENTITIES_KEYWORD, ENTITIES);
-		typeHash.put(DTDRegionTypes.NMTOKEN_KEYWORD, NMTOKEN);
-		typeHash.put(DTDRegionTypes.NMTOKENS_KEYWORD, NMTOKENS);
-		typeHash.put(DTDRegionTypes.NOTATION_KEYWORD, ENUMERATED_NOTATION);
-		// this one's a special case since there is no keyword for
-		// enumerated name tokens
-		typeHash.put("()", ENUMERATED_NAME); //$NON-NLS-1$
-
-		// now put the reverse in place. This gives us a 2 way lookup
-		// for when we want to retrieve the value and when we want to set it
-		typeHash.put(CDATA, "CDATA"); //$NON-NLS-1$
-		typeHash.put(ID, "ID"); //$NON-NLS-1$
-		typeHash.put(IDREF, "IDREF"); //$NON-NLS-1$
-		typeHash.put(IDREFS, "IDREFS"); //$NON-NLS-1$
-		typeHash.put(ENTITY, "ENTITY"); //$NON-NLS-1$
-		typeHash.put(ENTITIES, "ENTITIES"); //$NON-NLS-1$
-		typeHash.put(NMTOKEN, "NMTOKEN"); //$NON-NLS-1$
-		typeHash.put(NMTOKENS, "NMTOKENS"); //$NON-NLS-1$
-		typeHash.put(ENUMERATED_NAME, ""); //$NON-NLS-1$
-		typeHash.put(ENUMERATED_NOTATION, "NOTATION"); //$NON-NLS-1$
-	}
-
-	private AttributeEnumList enumList = null;
-
-	// public static final String IMPLIED = "IMPLIED";
-
-	public Attribute(DTDFile file, IStructuredDocumentRegion flatNode) {
-		super(file, flatNode);
-	}
-
-	public String getDefaultKind() {
-		ITextRegion defaultKindRegion = getDefaultKindRegion();
-		if (defaultKindRegion != null) {
-			return getStructuredDTDDocumentRegion().getText(defaultKindRegion);
-		}
-
-		return ""; //$NON-NLS-1$
-	}
-
-	public ITextRegion getDefaultKindRegion() {
-		RegionIterator iter = iterator();
-		while (iter.hasNext()) {
-			ITextRegion region = iter.next();
-			if (region.getType() == DTDRegionTypes.IMPLIED_KEYWORD || region.getType() == DTDRegionTypes.REQUIRED_KEYWORD || region.getType() == DTDRegionTypes.FIXED_KEYWORD) {
-				return region;
-			}
-		}
-		return null;
-	}
-
-	public String getDefaultValue() {
-		ITextRegion defaultValue = getNextQuotedLiteral(iterator());
-		if (defaultValue != null) {
-			return getValueFromQuotedRegion(defaultValue);
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	public AttributeEnumList getEnumList() {
-		return enumList;
-	}
-
-	public Image getImage() {
-		return DTDCorePlugin.getInstance().getImage(DTDResource.ATTRIBUTEICON);
-	}
-
-	public ITextRegion getNameRegion() {
-		return getNextRegion(iterator(), DTDRegionTypes.ATTRIBUTE_NAME);
-	}
-
-	public ITextRegion getNextQuotedLiteral(RegionIterator iter) {
-		while (iter.hasNext()) {
-			ITextRegion region = iter.next();
-			if (region.getType().equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || region.getType().equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
-				return region;
-			}
-		}
-		return null;
-	}
-
-	protected int getOffsetAfterType() {
-		ITextRegion typeRegion = getTypeRegion();
-
-		String type = getType();
-		boolean isEnumeration = type.equals(ENUMERATED_NAME) || type.equals(ENUMERATED_NOTATION);
-		if (isEnumeration) {
-			// now check if maybe this is an enumeration
-			if (getEnumList() != null) {
-				return getEnumList().getEndOffset();
-			}
-		}
-		if (typeRegion != null) {
-			return getStructuredDTDDocumentRegion().getEndOffset(typeRegion);
-		}
-		else {
-			ITextRegion nameRegion = getNameRegion();
-			return getStructuredDTDDocumentRegion().getEndOffset(nameRegion);
-			// // create one
-			// typeRegion =
-			// findOrCreateTypeRegion((String)typeHash.get(CDATA));
-		}
-	}
-
-	public String getType() {
-		ITextRegion region = getTypeRegion();
-		if (region != null) {
-			String type = (String) typeHash.get(region.getType());
-			if (type == null) {
-				// just return the text of the type region since this may be
-				// an entity representing the type;
-				return getStructuredDTDDocumentRegion().getText(region);
-			}
-			return type;
-		}
-		else if (getEnumList() != null) {
-			// enumerated name tokens don't have a type keyword. just
-			// the existence of the left paren is enough
-			return (String) typeHash.get("()"); //$NON-NLS-1$
-		}
-
-		return ""; //$NON-NLS-1$
-	}
-
-	public ITextRegion getTypeRegion() {
-		RegionIterator iter = iterator();
-
-		while (iter.hasNext()) {
-			ITextRegion region = iter.next();
-			if (region.getType() == DTDRegionTypes.CDATA_KEYWORD || region.getType() == DTDRegionTypes.ID_KEYWORD || region.getType() == DTDRegionTypes.IDREF_KEYWORD || region.getType() == DTDRegionTypes.IDREFS_KEYWORD || region.getType() == DTDRegionTypes.ENTITY_KEYWORD || region.getType() == DTDRegionTypes.ENTITIES_KEYWORD || region.getType() == DTDRegionTypes.NMTOKEN_KEYWORD || region.getType() == DTDRegionTypes.NMTOKENS_KEYWORD || region.getType() == DTDRegionTypes.NOTATION_KEYWORD || region.getType() == DTDRegionTypes.PARM_ENTITY_TYPE) {
-				return region;
-			}
-		}
-		return null;
-	}
-
-	public String getValueFromQuotedRegion(ITextRegion region) {
-		String type = region.getType();
-		if (type.equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || type.equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
-			String text = getStructuredDTDDocumentRegion().getText(region);
-			return text.substring(1, text.length() - 1);
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	public void resolveRegions() {
-		removeChildNodes();
-		RegionIterator iter = iterator();
-
-		while (iter.hasNext()) {
-			ITextRegion currentRegion = iter.next();
-			if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
-				enumList = new AttributeEnumList(getDTDFile(), getStructuredDTDDocumentRegion());
-			}
-			if (enumList != null) {
-				enumList.addRegion(currentRegion);
-				if (currentRegion.getType() == DTDRegionTypes.RIGHT_PAREN) {
-					return;
-				}
-			}
-		}
-
-	}
-
-	public void setDefaultKind(Object requestor, String kind) {
-
-		ITextRegion defaultKindRegion = getDefaultKindRegion();
-		String oldDefaultKind = defaultKindRegion == null ? "" : getStructuredDTDDocumentRegion().getText(defaultKindRegion); //$NON-NLS-1$
-		if (!kind.equals(oldDefaultKind)) {
-			String newText = kind;
-			int startOffset = 0;
-			int length = 0;
-			if (defaultKindRegion != null) {
-				startOffset = getStructuredDTDDocumentRegion().getStartOffset(defaultKindRegion);
-				length = getStructuredDTDDocumentRegion().getEndOffset(defaultKindRegion) - startOffset;
-			}
-			else {
-				startOffset = getOffsetAfterType();
-				newText = " " + newText; //$NON-NLS-1$
-			}
-
-			ITextRegion defaultValue = getNextQuotedLiteral(iterator());
-
-			if (kind.equals(Attribute.FIXED) || kind.equals("")) { //$NON-NLS-1$
-				if (defaultValue == null) {
-					// we are changing to fixed and wehave no quoted region.
-					// put in an empty value
-					newText += " \"\""; //$NON-NLS-1$
-				}
-			}
-			else {
-				if (defaultValue != null) {
-					length = getStructuredDTDDocumentRegion().getEndOffset(defaultValue) - startOffset;
-				}
-			}
-			replaceText(requestor, startOffset, length, newText);
-			// do something if there is no "kind" region
-		}
-	}
-
-	public void setDefaultKind(String kind) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_ATTR_DEFAULT_KIND); //$NON-NLS-1$
-		setDefaultKind(this, kind);
-		endRecording(this);
-	}
-
-	public void setDefaultValue(Object requestor, String value, boolean fixed) {
-		ITextRegion defaultValue = getNextQuotedLiteral(iterator());
-		String quoteChar = value.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		int startOffset = 0;
-		int endOffset = 0;
-		String newText = ""; //$NON-NLS-1$
-
-		String oldValue = getDefaultValue();
-		boolean oldKindIsFixed = getDefaultKind().equals(Attribute.FIXED);
-		if (oldValue.equals(value) && fixed == oldKindIsFixed) {
-			// nothing to do
-			return;
-		}
-
-		if (defaultValue != null) {
-			startOffset = getStructuredDTDDocumentRegion().getStartOffset(defaultValue);
-			endOffset = getStructuredDTDDocumentRegion().getEndOffset(defaultValue);
-		}
-
-		ITextRegion defaultKindRegion = getDefaultKindRegion();
-		if (defaultKindRegion != null) {
-			startOffset = getStructuredDTDDocumentRegion().getStartOffset(defaultKindRegion);
-			endOffset = endOffset == 0 ? getStructuredDTDDocumentRegion().getEndOffset(defaultKindRegion) : endOffset;
-		}
-		else {
-			if (startOffset == 0) {
-				endOffset = startOffset = getOffsetAfterType();
-				newText += " "; //$NON-NLS-1$
-			}
-			ITextRegion typeRegion = getTypeRegion();
-			if (typeRegion == null && getEnumList() == null) {
-				// tack on a default type
-				// newText += "CDATA ";
-			}
-		}
-		if (fixed) {
-			newText += "#FIXED "; //$NON-NLS-1$
-		}
-		else {
-			if (getDefaultKind().equals("") && value.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$
-				// if not fixed and value is "" then reset the default kind to
-				// implied
-				newText += "#IMPLIED"; //$NON-NLS-1$
-			}
-		}
-
-		if (!getType().equals("") && !value.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$
-			newText += quoteChar + value + quoteChar;
-		}
-		replaceText(requestor, startOffset, endOffset - startOffset, newText);
-	}
-
-	public void setDefaultValue(String value, boolean fixed) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_ATTR_DEFAULT_VAL); //$NON-NLS-1$
-		setDefaultValue(this, value, fixed);
-		endRecording(this);
-	}
-
-	public void setType(Object requestor, String type) {
-		String oldType = getType();
-		if (!type.equals(oldType)) {
-			boolean wasEnumeration = oldType.equals(ENUMERATED_NAME) || oldType.equals(ENUMERATED_NOTATION);
-			boolean isEnumeration = type.equals(ENUMERATED_NAME) || type.equals(ENUMERATED_NOTATION);
-			String newText = ""; //$NON-NLS-1$
-			int startOffset = 0;
-			int endOffset = 0;
-
-			if (wasEnumeration && !isEnumeration) {
-				// get rid of the old enumlist
-				AttributeEnumList enumList = getEnumList();
-				if (enumList != null) {
-					startOffset = enumList.getStartOffset();
-					endOffset = enumList.getEndOffset();
-				}
-			}
-
-			ITextRegion region = getTypeRegion();
-			if (region != null) {
-				startOffset = getStructuredDTDDocumentRegion().getStartOffset(region);
-				if (endOffset == 0) {
-					endOffset = getStructuredDTDDocumentRegion().getEndOffset(region);
-				}
-			}
-			else if (startOffset == 0) {
-				ITextRegion nameRegion = getNameRegion();
-				newText += " "; //$NON-NLS-1$
-				endOffset = startOffset = getStructuredDTDDocumentRegion().getEndOffset(nameRegion);
-			}
-
-			String newTypeWord = (String) typeHash.get(type);
-			if (newTypeWord == null) {
-				// then this must be a parm entity being used in the type
-				// use the type text directly
-				newTypeWord = type;
-			}
-
-			newText += newTypeWord;
-
-			if (isEnumeration && !wasEnumeration) {
-				// put in a new numlist
-				boolean isSpaceNeeded = !type.equals(ENUMERATED_NAME);
-				newText += isSpaceNeeded ? " " : ""; //$NON-NLS-1$ //$NON-NLS-2$
-				newText += "()"; //$NON-NLS-1$
-			}
-			replaceText(requestor, startOffset, endOffset - startOffset, newText);
-			if (newTypeWord.equals("") && !type.equals(ENUMERATED_NAME)) { //$NON-NLS-1$
-				// the set the defaultkind to ""
-				// setDefaultKind(requestor, "");
-				setDefaultValue(requestor, "", false); //$NON-NLS-1$
-			}
-
-		}
-	}
-
-	public void setType(String type) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_ATTR_TYPE); //$NON-NLS-1$
-		setType(this, type);
-		endRecording(this);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeEnumList.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeEnumList.java
deleted file mode 100644
index a50e12e..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeEnumList.java
+++ /dev/null
@@ -1,72 +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.dtd.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public class AttributeEnumList extends DTDNode {
-
-	private ArrayList list = new ArrayList();
-
-	public AttributeEnumList(DTDFile file, IStructuredDocumentRegion flatNode) {
-		super(file, flatNode);
-	}
-
-	public Image getImage() {
-		// never exposed in tree
-		return null;
-	}
-
-	// return the items that are in this enumerated list
-	public List getItems() {
-		list.clear();
-		RegionIterator iter = iterator();
-		while (iter.hasNext()) {
-			ITextRegion name = getNextRegion(iter, DTDRegionTypes.NAME);
-			if (name != null) {
-				list.add(getStructuredDTDDocumentRegion().getText(name));
-			}
-		}
-		return list;
-	}
-
-	public void setItems(Object requestor, String[] items) {
-		if (items != null) {
-			String text = "("; //$NON-NLS-1$
-			for (int i = 0; i < items.length; i++) {
-				if (i > 0) {
-					text += " | " + items[i]; //$NON-NLS-1$
-				}
-				else {
-					text += items[i];
-				}
-			}
-			text += ")"; //$NON-NLS-1$
-			replaceText(requestor, getStartOffset(), getNodeLength(), text);
-		}
-	}
-
-	public void setItems(String[] items) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_ATTR_ENUM_ITEMS); //$NON-NLS-1$
-		setItems(this, items);
-		endRecording(this);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeList.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeList.java
deleted file mode 100644
index ae22b6a..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeList.java
+++ /dev/null
@@ -1,118 +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.dtd.core.internal;
-
-import java.util.ArrayList;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public class AttributeList extends NamedTopLevelNode {
-	public AttributeList(DTDFile file, IStructuredDocumentRegion flatNode) {
-		super(file, flatNode, DTDRegionTypes.ATTLIST_TAG);
-	}
-
-	public void addAttribute(String name) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_ATTR_LIST_ADD); //$NON-NLS-1$
-
-		DTDNode lastAttribute = (DTDNode) getLastChild();
-		if (lastAttribute != null) {
-			replaceText(this, lastAttribute.getEndOffset(), 0, "\n\t" + name + " CDATA #IMPLIED"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		else {
-			ITextRegion nameRegion = getNameRegion();
-			if (nameRegion != null) {
-				replaceText(this, getStructuredDTDDocumentRegion().getEndOffset(nameRegion), 0, "\n\t" + name + " CDATA #IMPLIED"); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-
-		}
-
-		endRecording(this);
-	}
-
-	public Image getImage() {
-		return DTDCorePlugin.getInstance().getImage(DTDResource.ATTRIBUTELISTICON);
-	}
-
-	public void insertIntoModel(Object requestor, Attribute reference, Attribute node, boolean isAfter) {
-		int offset = 0;
-		String newText = ""; //$NON-NLS-1$
-		String nodeText = node.getFullNodeText();
-		if (!isAfter) {
-			offset = reference.getStartOffset();
-		}
-		else {
-			// try and get next child
-			Attribute attr = (Attribute) reference.getNextSibling();
-			if (attr != null) {
-				offset = attr.getStartOffset();
-			}
-			else {
-				// just use the end offset
-				offset = reference.getWhitespaceEndOffset();
-			}
-		}
-		newText += nodeText;// + (isLastChild ? "\n" : "\n\t");
-		if (!node.hasTrailingWhitespace()) {
-			newText += "\n\t"; //$NON-NLS-1$
-		}
-		replaceText(requestor, offset, 0, newText);
-	}
-
-	public void resolveRegions() {
-		removeChildNodes();
-		RegionIterator iter = iterator();
-
-		if (getNameRegion() != null) {
-			// we skip past the name token is our name
-			skipPastName(iter);
-		}
-
-		ArrayList children = new ArrayList();
-		Attribute attribute = null;
-		boolean trailingWhitespace = false;
-		while (iter.hasNext()) {
-			ITextRegion currentRegion = iter.next();
-			if (currentRegion.getType().equals(DTDRegionTypes.ATTRIBUTE_NAME)) {
-				attribute = new Attribute(getDTDFile(), getStructuredDTDDocumentRegion());
-				children.add(attribute);
-				appendChild(attribute);
-				trailingWhitespace = false;
-			}
-			if (attribute != null && currentRegion.getType() != DTDRegionTypes.END_TAG) {
-				if (!trailingWhitespace) {
-					attribute.addRegion(currentRegion);
-				}
-				else {
-					if (currentRegion.getType() == DTDRegionTypes.WHITESPACE) {
-						attribute.addWhitespaceRegion(currentRegion);
-					}
-				}
-
-				// the following prevents extra whitespace from being picked
-				// up by the attribute
-				if (currentRegion.getType() == DTDRegionTypes.REQUIRED_KEYWORD || currentRegion.getType() == DTDRegionTypes.IMPLIED_KEYWORD || currentRegion.getType() == DTDRegionTypes.SINGLEQUOTED_LITERAL || currentRegion.getType() == DTDRegionTypes.DOUBLEQUOTED_LITERAL) {
-					trailingWhitespace = true;
-				}
-			}
-		}
-		int numKids = children.size();
-		for (int i = 0; i < numKids; i++) {
-			((Attribute) children.get(i)).resolveRegions();
-		} // end of for ()
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMBasicNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMBasicNode.java
deleted file mode 100644
index 5b27f02..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMBasicNode.java
+++ /dev/null
@@ -1,165 +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.dtd.core.internal;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-/*
- * CMBasicNode combines all the different content types into one. The idea
- * behind this is to allow arbitrary name changes to not require a tree
- * update.
- */
-public class CMBasicNode extends CMRepeatableNode {
-
-	// static final int EMPTY = 0;
-	// static final int ANY = 1;
-	// static final int PCDATA = 2;
-
-	public CMBasicNode(DTDFile file, IStructuredDocumentRegion flatNode) {
-		super(file, flatNode);
-	}
-
-	public Image getImage() {
-		final String name = getName();
-		ITextRegion pcdata = getNextRegion(iterator(), DTDRegionTypes.CONTENT_PCDATA);
-		if (pcdata != null) {
-			return DTDCorePlugin.getInstance().getImage(DTDResource.PCDATAICON);
-		}
-
-		if (isRootElementContent()) {
-			if (name.equals(EMPTY)) {
-				return DTDCorePlugin.getInstance().getImage(DTDResource.EMPTYICON);
-			}
-			else if (name.equals(ANY)) {
-				return DTDCorePlugin.getInstance().getImage(DTDResource.ANYICON);
-			}
-		}
-
-		// Otherwise this is just an element reference node. Just return
-		// what CMRepeatableNode would give us
-		return super.getImage();
-	}
-
-	public ITextRegion getNameRegion() {
-		RegionIterator iter = iterator();
-		while (iter.hasNext()) {
-			ITextRegion region = iter.next();
-			if (region.getType() == DTDRegionTypes.NAME || region.getType() == DTDRegionTypes.CONTENT_PCDATA) {
-				return region;
-			}
-		}
-		return null;
-	}
-
-	// returns the occurrencetoken, or the token where the occurrence token
-	// should appear after
-	public ITextRegion getOccurrenceRegion() {
-		RegionIterator iter = iterator();
-		skipPastName(iter);
-		if (iter.hasNext()) {
-			ITextRegion region = iter.next();
-			if (region.getType() == DTDRegionTypes.OCCUR_TYPE) {
-				return region;
-			}
-		}
-		return getNameRegion();
-	}
-
-	public String getType() {
-		ITextRegion pcdata = getNextRegion(iterator(), DTDRegionTypes.CONTENT_PCDATA);
-		if (pcdata != null) {
-			return PCDATA;
-		}
-
-		if (isRootElementContent()) {
-			final String name = getName();
-			if (isRootElementContent()) {
-				if (name.equals(EMPTY)) {
-					return EMPTY;
-				}
-				else if (name.equals(ANY)) {
-					return ANY;
-				}
-				else {
-					// otherwise just return it's name as the type
-					return name;
-				}
-
-			}
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	public boolean isEmptyAnyOrPCData() {
-		if (isPCData()) {
-			return true;
-		}
-
-
-		final String name = getName();
-		if (isRootElementContent()) {
-			if (name.equals(EMPTY) || name.equals(ANY)) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	public boolean isPCData() {
-		ITextRegion pcdata = getNextRegion(iterator(), DTDRegionTypes.CONTENT_PCDATA);
-		if (pcdata != null) {
-			return true;
-		}
-		return false;
-	}
-
-	// public Node insertRegion(Region token)
-	// {
-	// if (!tokenStream.containsToken(token) && token.getType() ==
-	// Token.OCCUR_TYPE)
-	// {
-	// // then add it so that our range contains it
-	// insertIntoTokenStream(token);
-	// }
-	// return this;
-	// }
-
-	public boolean isReference() {
-		return !isEmptyAnyOrPCData();
-	}
-
-	public void setName(Object requestor, String name) {
-		// beginRecording(requestor, "Name Change");
-
-		super.setName(requestor, name);
-		if (!isReference()) {
-			// if it is no longer a reference node, remove the occurrence
-			// token
-			setOccurrence(requestor, CMRepeatableNode.ONCE);
-		}
-
-		// endRecording(requestor);
-	}
-
-	/*
-	 * public static String getName(int type) { switch (type) { case EMPTY:
-	 * return emptyString; case ANY: return anyString; case PCDATA: return
-	 * pcdataString; default: break; } // end of switch () return ""; }
-	 */
-
-}// CMBasicNode
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMGroupNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMGroupNode.java
deleted file mode 100644
index 1951fd7..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMGroupNode.java
+++ /dev/null
@@ -1,430 +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.dtd.core.internal;
-
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.internal.util.DTDUniqueNameHelper;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public class CMGroupNode extends CMRepeatableNode {
-
-	public static final char CHOICE = '|';
-	public static final char SEQUENCE = ',';
-
-	protected char connector = SEQUENCE;
-
-	// protected ArrayList children = new ArrayList();
-
-	public CMGroupNode(DTDFile file, IStructuredDocumentRegion flatNode) {
-		super(file, flatNode);
-	}
-
-	public void addChild() {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_CM_GRP_NODE_ADD_CHILD); //$NON-NLS-1$
-		DTDNode lastNode = (DTDNode) getLastChild();
-		String elementName = DTDUniqueNameHelper.getUniqueName(getChildrenList(), "ChildNode"); //$NON-NLS-1$
-		if (lastNode != null) {
-			replaceText(this, lastNode.getEndOffset(), 0, String.valueOf(getConnector()) + elementName); //$NON-NLS-1$
-		}
-		else {
-			replaceText(this, getStartOffset() + 1, 0, elementName); //$NON-NLS-1$
-		}
-
-		endRecording(this);
-	}
-
-	public void addGroup() {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_CM_GRP_NODE_ADD_GRP); //$NON-NLS-1$
-		DTDNode lastNode = (DTDNode) getLastChild();
-		if (lastNode != null) {
-			replaceText(this, lastNode.getEndOffset(), 0, String.valueOf(getConnector()) + " ()"); //$NON-NLS-1$
-		}
-		else {
-			replaceText(this, getStartOffset() + 1, 0, "()"); //$NON-NLS-1$
-		}
-
-		endRecording(this);
-	}
-
-	public void delete(Object requestor, DTDNode child) {
-		Object[] children = getChildren();
-
-		if (children.length == 1 && getFirstChild() == child) {
-			replaceText(requestor, child.getStartOffset(), child.getNodeLength(), null);
-			return;
-		}
-
-		for (int i = 0; i < children.length - 1; i++) {
-			DTDNode childA = (DTDNode) children[i];
-			DTDNode childB = (DTDNode) children[i + 1];
-
-			boolean childADeleted = childA == child;
-			boolean childBDeleted = childB == child;
-			if (childADeleted || childBDeleted) {
-				// we found the child
-				int startOffset = childADeleted ? childA.getStartOffset() : childA.getEndOffset();
-				int endOffset = childADeleted ? childB.getStartOffset() : childB.getEndOffset();
-				replaceText(requestor, startOffset, endOffset - startOffset, ""); //$NON-NLS-1$
-				removeChild(child);
-				break;
-			}
-		}
-	}
-
-	/**
-	 * Get the value of connector.
-	 * 
-	 * @return value of connector.
-	 */
-	public char getConnector() {
-		Object[] children = getChildren();
-		for (int i = 0; i < children.length - 1; i++) {
-			DTDNode childA = (DTDNode) children[i];
-			DTDNode childB = (DTDNode) children[i + 1];
-
-			// create a stream between the two siblings and walk it
-			// note that this stream includes the last region of the first
-			// sibling and the first region of the next sibling.
-			// both these should be ignored
-			RegionIterator iter = new RegionIterator(getStructuredDTDDocumentRegion(), childA.getEndOffset(), childB.getStartOffset());
-			// stream.setFirstRegion(childA.getLastRegion());
-			// stream.setLastRegion(childB.getFirstRegion());
-			// Iterator iter = stream.iterator();
-			// skip the first region which is the last region of childA
-			// do we need this now ?
-			// iter.next();
-			ITextRegion currentRegion = null;
-			while (iter.hasNext() && currentRegion != childB.getStartRegion()) {
-				currentRegion = iter.next();
-				if (currentRegion.getType() == DTDRegionTypes.CONNECTOR) {
-					connector = getStructuredDTDDocumentRegion().getText(currentRegion).charAt(0);
-					return connector;
-				}
-			}
-		}
-		return connector;
-	}
-
-	public Image getImage() {
-		DTDCorePlugin resourcePlugin = DTDCorePlugin.getInstance();
-		switch (getConnector()) {
-			case SEQUENCE :
-				return resourcePlugin.getImage(DTDResource.ONESEQUENCEICON);
-			/*
-			 * switch (getOccurrence()) { case ONCE : return
-			 * resourcePlugin.getImage(DTDResource.ONESEQUENCEICON); case
-			 * OPTIONAL : return
-			 * resourcePlugin.getImage(DTDResource.OPTIONALSEQUENCEICON); case
-			 * ONE_OR_MORE : return
-			 * resourcePlugin.getImage(DTDResource.ONEORMORESEQUENCEICON);
-			 * case ZERO_OR_MORE : return
-			 * resourcePlugin.getImage(DTDResource.ZEROORMORESEQUENCEICON); }
-			 */
-			case CHOICE :
-				return resourcePlugin.getImage(DTDResource.ONECHOICEICON);
-		/*
-		 * switch (getOccurrence()) { case ONCE : return
-		 * resourcePlugin.getImage(DTDResource.ONECHOICEICON); case OPTIONAL :
-		 * return resourcePlugin.getImage(DTDResource.OPTIONALCHOICEICON);
-		 * case ONE_OR_MORE : return
-		 * resourcePlugin.getImage(DTDResource.ONEORMORECHOICEICON); case
-		 * ZERO_OR_MORE : return
-		 * resourcePlugin.getImage(DTDResource.ZEROORMORECHOICEICON); }
-		 */
-		}
-		return null;
-	}
-
-	public String getName() {
-		return ""; //$NON-NLS-1$
-	}
-
-	// returns the occurrenceregion, or the last region where the occurrence
-	// region should appear after
-	public ITextRegion getOccurrenceRegion() {
-		int nesting = 0;
-
-		// we skip past the first left paren we see since that is the
-		// beginning of our own node
-		RegionIterator iter = iterator();
-		// we assume the first region is the '('
-		iter.next();
-		ITextRegion currentRegion = null;
-		while (iter.hasNext() && nesting >= 0) {
-			currentRegion = iter.next();
-			if (currentRegion.getType() == DTDRegionTypes.LEFT_PAREN) {
-				nesting++;
-			}
-			if (currentRegion.getType() == DTDRegionTypes.RIGHT_PAREN) {
-				nesting--;
-			}
-		}
-		if (nesting < 0) {
-			// This means we have passed over the right paren that marks the
-			// end of our grouping.
-			// Look for an occurrence region
-			while (iter.hasNext()) {
-				currentRegion = iter.next();
-				if (currentRegion.getType() == DTDRegionTypes.OCCUR_TYPE) {
-					return currentRegion;
-				}
-			}
-		}
-		// if we're here, this means that there is no occur region. return the
-		// last region
-		return iter.previous();
-	}
-
-	public String getType() {
-		if (isRootElementContent()) {
-			if (getFirstChild() != null) {
-				CMNode node = (CMNode) getFirstChild();
-				if (node.getType().equals(PCDATA)) {
-					return MIXED;
-				}
-				else {
-					return CHILDREN;
-				}
-			}
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	public void insertChildNode(Object requestor, String nodeText, int position) {
-		Object[] children = getChildren();
-
-		int startOffset = 0;
-		String newText = ""; //$NON-NLS-1$
-		if (position < children.length) {
-			DTDNode reference = (DTDNode) children[position];
-			startOffset = reference.getStartOffset();
-			newText = nodeText + " " + String.valueOf(getConnector()) + " "; //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		else if (position == children.length) {
-			// add to end
-			DTDNode reference = (DTDNode) children[position - 1];
-			startOffset = reference.getEndOffset();
-			newText = " " + String.valueOf(getConnector()) + " " + nodeText; //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		replaceText(requestor, startOffset, 0, newText);
-	}
-
-	public void insertChildNode(String nodeText, int position) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_CM_GRP_NODE_INSERT_ELEMENT); //$NON-NLS-1$
-		insertChildNode(this, nodeText, position);
-		endRecording(this);
-	}
-
-	public void insertIntoModel(Object requestor, CMNode reference, CMNode node, boolean isAfter) {
-		String nodeText = node.getNodeText();
-		List children = getChildrenList();
-
-		int index = children.indexOf(reference);
-		if (index == -1) {
-			// no reference node, add it to the end??
-			index = children.size();
-		}
-		else {
-			// got an index. if we want to add after, increase by 1
-			index = isAfter ? index + 1 : index;
-		}
-		insertChildNode(requestor, nodeText, index);
-	}
-
-	public void resolveRegions() {
-		int nesting = 0;
-		// children.clear();
-		removeChildNodes();
-		DTDNode currentGroupNode = null;
-		CMBasicNode currentReferenceNode = null;
-		RegionIterator iter = iterator();
-		// we assume the first region is the '('
-		iter.next();
-		while (iter.hasNext() && nesting >= 0) {
-			ITextRegion currentRegion = iter.next();
-			if (nesting == 0) {
-				if (currentRegion.getType().equals(DTDRegionTypes.CONTENT_PCDATA)) {
-					currentGroupNode = currentReferenceNode = null;
-					DTDNode pcData = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
-					pcData.addRegion(currentRegion);
-					appendChild(pcData);
-					// children.add(pcData);
-				}
-				else if (currentRegion.getType().equals(DTDRegionTypes.NAME)) {
-					// we have hit a new reference node. Make sure we reset
-					// the groupnode var so it doesn't collect more regions
-					currentGroupNode = null;
-					currentReferenceNode = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
-					currentReferenceNode.addRegion(currentRegion);
-					appendChild(currentReferenceNode);
-					// children.add(currentReferenceNode);
-				}
-				else if (currentRegion.getType().equals(DTDRegionTypes.OCCUR_TYPE)) {
-					// we could potentially flag an error here if we hit an
-					// occurrence type and currentRefNode and currentGroupNode
-					// are null
-					if (currentReferenceNode != null) {
-						// currentReferenceNode.setOccurrence(currentRegion.getText().toCharArray()[0]);
-						currentReferenceNode.addRegion(currentRegion);
-						currentReferenceNode = null;
-					}
-				}
-				else if (currentRegion.getType().equals(DTDRegionTypes.CONNECTOR)) {
-					// note that if connector is already set and it is
-					// different from the current connector region, then we
-					// have an error!
-					// setConnector(currentRegion.getText().toCharArray()[0]);
-				}
-				else if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
-					if (currentGroupNode == null) {
-						// we have hit a new group. Make sure we reset the
-						// referencenode var so it doesn't collect any more
-						// regions
-						currentReferenceNode = null;
-						currentGroupNode = new CMGroupNode(getDTDFile(), getStructuredDTDDocumentRegion());
-						appendChild(currentGroupNode);
-						// children.add(currentGroupNode);
-					}
-				}
-			}
-
-			if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
-				nesting++;
-			}
-			if (currentRegion.getType().equals(DTDRegionTypes.RIGHT_PAREN)) {
-				nesting--;
-				if (nesting == 0 && currentGroupNode != null) {
-					currentGroupNode.addRegion(currentRegion);
-					// peek at next region to see if it is an occur region. if
-					// so, add it to the groupnode
-					if (iter.hasNext()) {
-						ITextRegion nextRegion = iter.next();
-						if (nextRegion.getType().equals(DTDRegionTypes.OCCUR_TYPE)) {
-							currentGroupNode.addRegion(nextRegion);
-						}
-						else {
-							// Otherwise, push it back as the next item to be
-							// retrieved by a future next() call
-							iter.previous();
-						}
-					}
-					currentGroupNode = null;
-				}
-			}
-			if (currentGroupNode != null) {
-				currentGroupNode.addRegion(currentRegion);
-			}
-		}
-
-		if (nesting < 0) {
-			// This means we have passed over the right paren that marks the
-			// end of our grouping.
-			// Look for an occurrence region
-			while (iter.hasNext()) {
-				ITextRegion currentRegion = iter.next();
-				if (currentRegion.getType().equals(DTDRegionTypes.OCCUR_TYPE)) {
-					// setOccurrence(currentRegion.getText().toCharArray()[0]);
-				}
-			} // end of while ()
-		}
-
-		// for (org.w3c.dom.Node child = getFirstChild(); child != null; child
-		// = child.getNextSibling())
-		// {
-		// System.out.println("child found = " + child);
-		// }
-
-		Object[] children = getChildren();
-		// System.out.println("children legnth = " + children.length);
-
-		for (int i = 0; i < children.length; i++) {
-			DTDNode currentNode = (DTDNode) children[i];
-			currentNode.resolveRegions();
-		} // end of while ()
-
-	}
-
-	/**
-	 * Set the value of connector.
-	 * 
-	 * @param v
-	 *            Value to assign to connector.
-	 */
-	public void setConnector(char v) {
-		if (connector != v) {
-			connector = v;
-			// walk through our kids and see if there is a connector between
-			// each sibling. if not, create one and set the connector. if
-			// there is
-			// then just change the text of the connector
-			Object[] children = getChildren();
-			if (children.length <= 1) {
-				// there won't be any connector existing between the children
-				// just notify a change in the node and return;
-				getDTDFile().notifyNodeChanged(this);
-				return;
-			}
-			beginRecording(this, DTDCoreMessages._UI_LABEL_CM_GRP_NODE_CONNECTOR); //$NON-NLS-1$
-			for (int i = 0; i < children.length - 1; i++) {
-				DTDNode childA = (DTDNode) children[i];
-				DTDNode childB = (DTDNode) children[i + 1];
-
-				// create a stream between the two siblings and walk it
-				// note that this stream includes the last region of the first
-				// sibling and the first region of the next sibling.
-				// both these should be ignored
-				RegionIterator iter = new RegionIterator(getStructuredDTDDocumentRegion(), childA.getEndOffset(), childB.getStartOffset());
-				// skip the first region which is the last region of childA
-
-				// do we still need this
-				// iter.next();
-				ITextRegion currentRegion = null;
-				boolean foundConnector = false;
-				while (iter.hasNext() && currentRegion != childB.getStartRegion()) {
-					currentRegion = iter.next();
-					if (currentRegion.getType() == DTDRegionTypes.CONNECTOR) {
-						foundConnector = true;
-						// Region oldRegion = currentRegion.createCopy();
-						// found a connector! on to the next sibling pair
-						// currentRegion.updateText(String.valueOf(v));
-						replaceText(this, getStructuredDTDDocumentRegion().getStartOffset(currentRegion), 1, String.valueOf(connector));
-						// changeStructuredDocument(oldRegion, currentRegion);
-						break;
-					}
-				}
-
-				if (!foundConnector) {
-					// if we're here, that means we need to insert a new
-					// connector region after childA
-					replaceText(this, childA.getEndOffset(), 0, String.valueOf(connector));
-					// DTDRegion connectorRegion = new
-					// DTDRegion(DTDRegionTypes.CONNECTOR,
-					// childA.getEndOffset(), 1);
-					// insertIntoStructuredDocument(connectorRegion);
-				}
-			}
-			endRecording(this);
-		}
-	}
-
-	// public Object[] getChildren()
-	// {
-	// return children.toArray();
-	// }
-}// CMGroupNode
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMNode.java
deleted file mode 100644
index 6c93c5d..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMNode.java
+++ /dev/null
@@ -1,135 +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.dtd.core.internal;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-// base class for an Element's contentmodel
-public abstract class CMNode extends DTDNode {
-	public static final String ANY = DTDCoreMessages._UI_LABEL_CM_NODE_ANY; //$NON-NLS-1$
-	public static final String CHILDREN = DTDCoreMessages._UI_LABEL_CM_NODE_CHILD_CONTENT; //$NON-NLS-1$
-
-	public static final String EMPTY = DTDCoreMessages._UI_LABEL_CM_NODE_EMPTY; //$NON-NLS-1$
-	public static final String MIXED = DTDCoreMessages._UI_LABEL_CM_NODE_MIX_CONTENT; //$NON-NLS-1$
-	public static final String PCDATA = DTDCoreMessages._UI_LABEL_CM_NODE_PCDATA; //$NON-NLS-1$
-
-
-	boolean rootElementContent;
-
-	public CMNode(DTDFile file, IStructuredDocumentRegion flatNode) {
-		super(file, flatNode);
-	}
-
-	// this is only valid to ask if the content is a root element content
-	abstract public String getType();
-
-	/**
-	 * Get the value of rootElementContent. This tells us whether this element
-	 * content's parent is a direct decendent of the containing element
-	 * 
-	 * @return value of rootElementContent.
-	 */
-	public boolean isRootElementContent() {
-		return rootElementContent;
-	}
-
-	// if this is a root element, change the content to children
-	// ie . (child1)
-	public void setChildrenContent(String newChild) {
-		if (isRootElementContent()) {
-			if (!newChild.equals("")) { //$NON-NLS-1$
-				beginRecording(this, DTDCoreMessages._UI_LABEL_CM_NODE_SET_CHILD_CONTENT); //$NON-NLS-1$
-				replaceText(this, getStartOffset(), getNodeLength(), "(" + newChild + ")"); //$NON-NLS-1$ //$NON-NLS-2$
-				endRecording(this);
-				return;
-			}
-
-			if (!getType().equals(CHILDREN)) {
-				beginRecording(this, DTDCoreMessages._UI_LABEL_CM_NODE_SET_CHILD_CONTENT); //$NON-NLS-1$
-				if (this instanceof CMBasicNode) {
-					replaceText(this, getStartOffset(), getNodeLength(), "(newChild)"); //$NON-NLS-1$
-				}
-				else {
-					// now must convert from mixed content to this one. must
-					// preserve the remaining children
-					CMGroupNode group = (CMGroupNode) this;
-					CMNode firstChild = (CMNode) group.getFirstChild();
-					if (firstChild.getType().equals(PCDATA)) {
-						group.delete(firstChild);
-					}
-				}
-
-				endRecording(this);
-			}
-		}
-	}
-
-	public void setContent(String content) {
-		if (isRootElementContent()) {
-			beginRecording(this, DTDCoreMessages._UI_LABEL_CM_NODE_SET + " " + content + " " + DTDCoreMessages._UI_LABEL_CM_NODE_CONTENT); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			replaceText(this, getStartOffset(), getNodeLength(), content);
-			endRecording(this);
-		}
-	}
-
-	// if this is a root element, change the content to mixed
-	// ie . (#PCDATA, child1)
-	public void setMixedContent() {
-		if (isRootElementContent()) {
-			if (!getType().equals(MIXED)) {
-				beginRecording(this, DTDCoreMessages._UI_LABEL_CM_NODE_SET_MIX_CONTENT); //$NON-NLS-1$
-				if (this instanceof CMBasicNode) {
-					replaceText(this, getStartOffset(), getNodeLength(), "(#PCDATA | newChild)*"); //$NON-NLS-1$
-				}
-				else {
-					// now must convert from children content to this one.
-					// must
-					// preserve the children
-					CMGroupNode group = (CMGroupNode) this;
-					group.setConnector(CMGroupNode.CHOICE);
-					group.setOccurrence(CMRepeatableNode.ZERO_OR_MORE);
-					CMNode firstChild = (CMNode) group.getFirstChild();
-					if (!firstChild.getType().equals(PCDATA)) {
-						group.insertChildNode("#PCDATA", 0); //$NON-NLS-1$
-					}
-				}
-				endRecording(this);
-			}
-		}
-	}
-
-	/**
-	 * Set the value of rootElementContent.
-	 * 
-	 * @param v
-	 *            Value to assign to rootElementContent.
-	 */
-	public void setRootElementContent(boolean v) {
-		this.rootElementContent = v;
-	}
-
-	// public void delete()
-	// {
-	// if (isRootElementContent())
-	// {
-	// // then the superclasses delete will be fine
-	// super.delete();
-	// return;
-	// }
-
-	// CMGroupNode parent = (CMGroupNode) getParentNode();
-	// parent.removeChildNode(this);
-	// }
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMRepeatableNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMRepeatableNode.java
deleted file mode 100644
index 69ce110..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMRepeatableNode.java
+++ /dev/null
@@ -1,81 +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.dtd.core.internal;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public abstract class CMRepeatableNode extends CMNode {
-
-	public static final char ONCE = '1';
-	public static final char ONE_OR_MORE = '+';
-	public static final char OPTIONAL = '?';
-	public static final char ZERO_OR_MORE = '*';
-
-
-	public CMRepeatableNode(DTDFile file, IStructuredDocumentRegion flatNode) {
-		super(file, flatNode);
-	}
-
-	public Image getImage() {
-		DTDCorePlugin resourcePlugin = DTDCorePlugin.getInstance();
-		return resourcePlugin.getImage(DTDResource.ELEMENTREFICON);
-	}
-
-	public char getOccurrence() {
-		ITextRegion occurRegion = getOccurrenceRegion();
-		if (occurRegion != null && occurRegion.getType() == DTDRegionTypes.OCCUR_TYPE) {
-			return getStructuredDTDDocumentRegion().getText(occurRegion).charAt(0);
-		}
-		return CMRepeatableNode.ONCE;
-	}
-
-	// returns the occurrenceregion, or the last region where the occurrence
-	// region should appear after
-	abstract public ITextRegion getOccurrenceRegion();
-
-	public void setOccurrence(char occurrence) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_CM_REP_NODE_CHG_OCCUR); //$NON-NLS-1$
-		setOccurrence(this, occurrence);
-		endRecording(this);
-	}
-
-	public void setOccurrence(Object requestor, char occurrence) {
-		if (getOccurrence() != occurrence) {
-			ITextRegion region = getOccurrenceRegion();
-			if (region != null) {
-				if (region.getType().equals(DTDRegionTypes.OCCUR_TYPE)) {
-					if (occurrence == CMRepeatableNode.ONCE) {
-						// we need to remove the occur region from the flat
-						// model;
-						getDTDFile().getStructuredDocument().replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(region), 1, ""); //$NON-NLS-1$
-					}
-					else {
-						// Region oldOccur = region.createCopy();
-						getDTDFile().getStructuredDocument().replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(region), 1, String.valueOf(occurrence));
-						// changeStructuredDocument(oldOccur, region);
-					}
-				}
-				else if (occurrence != CMRepeatableNode.ONCE) {
-					// System.out.println(getString());
-					// we need to create an occurrenceRegion
-					replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(region), 0, String.valueOf(occurrence));
-				}
-			}
-		}
-	}
-
-}// CMRepeatableNode
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Comment.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Comment.java
deleted file mode 100644
index 935ff52..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Comment.java
+++ /dev/null
@@ -1,75 +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.dtd.core.internal;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public class Comment extends NamedTopLevelNode {
-
-	public class StartEndPair {
-		public int startOffset, endOffset;
-	}
-
-	public Comment(DTDFile file, IStructuredDocumentRegion flatNode) {
-		super(file, flatNode, DTDRegionTypes.COMMENT_START);
-	}
-
-	public Image getImage() {
-		return DTDCorePlugin.getInstance().getImage(DTDResource.COMMENTICON);
-	}
-
-	public String getName() {
-		String text = getText();
-		if (text.length() <= 30) {
-			return text;
-		}
-		else {
-			return text.substring(0, 29) + "..."; //$NON-NLS-1$
-		}
-	}
-
-	private void getStartAndEndOffsetForText(StartEndPair pair) {
-		RegionIterator iter = iterator();
-		ITextRegion commentStartTag = getStartTag(iter);
-		ITextRegion endCommentTag = getNextRegion(iter, DTDRegionTypes.COMMENT_END);
-		pair.endOffset = getStructuredDTDDocumentRegion().getEndOffset();
-		if (commentStartTag != null) {
-			pair.startOffset = getStructuredDTDDocumentRegion().getEndOffset(commentStartTag);
-		}
-		if (endCommentTag != null) {
-			pair.endOffset = getStructuredDTDDocumentRegion().getStartOffset(endCommentTag);
-		}
-	}
-
-	public String getText() {
-		String text = getStructuredDTDDocumentRegion().getText();
-		int flatNodeStart = getStructuredDTDDocumentRegion().getStartOffset();
-		StartEndPair pair = new StartEndPair();
-		getStartAndEndOffsetForText(pair);
-		return text.substring(pair.startOffset - flatNodeStart, pair.endOffset - flatNodeStart);
-	}
-
-	public void setText(String newText) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_COMMENT_CHG); //$NON-NLS-1$
-		StartEndPair pair = new StartEndPair();
-		getStartAndEndOffsetForText(pair);
-		replaceText(this, pair.startOffset, pair.endOffset - pair.startOffset, newText);
-		endRecording(this);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCoreMessages.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCoreMessages.java
deleted file mode 100644
index 0e12f8e..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCoreMessages.java
+++ /dev/null
@@ -1,95 +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.dtd.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by DTD Core
- * 
- * @plannedfor 1.0
- */
-public class DTDCoreMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.dtd.core.internal.DTDCorePluginResources";//$NON-NLS-1$
-
-	public static String _UI_NONE_DESC;
-	public static String _UI_CHARACTER_DATA_DESC;
-	public static String _UI_IDENTIFIER_DESC;
-	public static String _UI_ID_REFERENCE_DESC;
-	public static String _UI_ID_REFERENCES_DESC;
-	public static String _UI_ENTITY_NAME_DESC;
-	public static String _UI_ENTITY_NAMES_DESC;
-	public static String _UI_NAME_TOKEN_DESC;
-	public static String _UI_NAME_TOKENS_DESC;
-	public static String _UI_ENUM_NAME_TOKENS_DESC;
-	public static String _UI_ENUM_NOTATION_DESC;
-	public static String _UI_LABEL_ATTR_DEFAULT_VAL;
-	public static String _UI_LABEL_ATTR_DEFAULT_KIND;
-	public static String _UI_LABEL_ATTR_TYPE;
-	public static String _UI_LABEL_ATTR_ENUM_ITEMS;
-	public static String _UI_LABEL_ATTR_LIST_ADD;
-	public static String _UI_LABEL_CM_GRP_NODE_CONNECTOR;
-	public static String _UI_LABEL_CM_GRP_NODE_INSERT_ELEMENT;
-	public static String _UI_LABEL_CM_GRP_NODE_ADD_GRP;
-	public static String _UI_LABEL_CM_GRP_NODE_ADD_CHILD;
-	public static String _UI_LABEL_CM_NODE_MIX_CONTENT;
-	public static String _UI_LABEL_CM_NODE_CHILD_CONTENT;
-	public static String _UI_LABEL_CM_NODE_SET_MIX_CONTENT;
-	public static String _UI_LABEL_CM_NODE_SET_CHILD_CONTENT;
-	public static String _UI_LABEL_CM_NODE_SET;
-	public static String _UI_LABEL_CM_NODE_CONTENT;
-	public static String _UI_LABEL_CM_NODE_PCDATA;
-	public static String _UI_LABEL_CM_NODE_ANY;
-	public static String _UI_LABEL_CM_NODE_EMPTY;
-	public static String _UI_LABEL_CM_REP_NODE_CHG_OCCUR;
-	public static String _UI_LABEL_COMMENT_CHG;
-	public static String _UI_LABEL_DTD_FILE_ADD_ELEMENT;
-	public static String _UI_LABEL_DTD_FILE_ADD_ENTITY;
-	public static String _UI_LABEL_DTD_FILE_ADD_COMMENT;
-	public static String _UI_LABEL_DTD_FILE_ADD_PARM_ENTITY_REF;
-	public static String _UI_LABEL_DTD_FILE_ADD_NOTATION;
-	public static String _UI_LABEL_DTD_FILE_ADD_ATTR_LIST;
-	public static String _UI_LABEL_DTD_FILE_DELETE;
-	public static String _UI_LABEL_DTD_NODE_NAME_CHG;
-	public static String _UI_LABEL_DTD_NODE_DELETE;
-	public static String _UI_LABEL_ELEMENT_ADD_ATTR;
-	public static String _UI_LABEL_ELEMENT_ADD_GRP;
-	public static String _UI_LABEL_ELEMENT_ADD_CHILD;
-	public static String _UI_LABEL_ENTITY_SET_PARM_ENTITY;
-	public static String _UI_LABEL_ENTITY_SET_GENERAL_ENTITY;
-	public static String _UI_LABEL_ENTITY_SET_EXT_ENTITY;
-	public static String _UI_LABEL_ENTITY_SET_INT_ENTITY;
-	public static String _UI_LABEL_ENTITY_VALUE_CHG;
-	public static String _UI_LABEL_ENTITY_NDATA_CHANGE;
-	public static String _UI_LABEL_EXT_NODE_PUBLIC_ID_CHG;
-	public static String _UI_LABEL_EXT_NODE_SYSTEM_ID_CHG;
-	public static String _UI_LABEL_NODE_LIST_ELEMENTS;
-	public static String _UI_LABEL_NODE_LIST_ENTITIES;
-	public static String _UI_LABEL_NODE_LIST_NOTATIONS;
-	public static String _UI_LABEL_NODE_LIST_COMMENTS;
-	public static String _UI_LABEL_NODE_LIST_OTHER;
-	public static String _UI_LABEL_NODE_LIST_ATTRIBUTES;
-	public static String _UI_LABEL_PARM_ENTITY_REF_CHG_ENTITY_REF;
-	public static String _UI_LABEL_PARM_ENTITY_REF_COMMENT_CHG;
-	public static String _UI_LABEL_TOP_LEVEL_NODE_DELETE;
-	public static String _ERROR_INCL_FILE_LOAD_FAILURE;
-	public static String _ERROR_UNDECLARED_ELEMENT_1;
-	public static String _UI_ERRORPART_UNDECLARED_ELEMENT_2;
-	public static String _ERROR_DUP_ID_ATTRIBUTE_1;
-	public static String _UI_ERRORPART_DUP_ID_ATTRIBUTE_2;
-	public static String _ERROR_INVALID_DEFAULT_ATTR_VALUE_1;
-	public static String _UI_ERRORPART_INVALID_DEFAULT_ATTR_VALUE_2;
-	public static String _EXC_OPERATION_NOT_SUPPORTED;
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, DTDCoreMessages.class);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePlugin.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePlugin.java
deleted file mode 100644
index 5cb55c5..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePlugin.java
+++ /dev/null
@@ -1,57 +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.dtd.core.internal;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-public class DTDCorePlugin extends AbstractUIPlugin {
-	private static DTDCorePlugin instance;
-
-	public static Image getDTDImage(String iconName) {
-		return getInstance().getImage(iconName);
-	}
-
-	public static ImageDescriptor getDTDImageDescriptor(String iconName) {
-		String thisID = getInstance().getBundle().getSymbolicName();
-		return AbstractUIPlugin.imageDescriptorFromPlugin(thisID, iconName);
-	}
-
-	public synchronized static DTDCorePlugin getInstance() {
-		return instance;
-	}
-
-	public static DTDCorePlugin getPlugin() {
-		return instance;
-	}
-
-	public DTDCorePlugin() {
-		super();
-		instance = this;
-	}
-
-	public Image getImage(String iconName) {
-		ImageRegistry imageRegistry = getImageRegistry();
-		Image image = imageRegistry.get(iconName);
-
-		if (image == null) {
-			String thisID = getInstance().getBundle().getSymbolicName();
-			imageRegistry.put(iconName, imageDescriptorFromPlugin(thisID, iconName));
-			image = imageRegistry.get(iconName);
-		}
-
-		return image;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePluginResources.properties b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePluginResources.properties
deleted file mode 100644
index a7ac3db..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePluginResources.properties
+++ /dev/null
@@ -1,127 +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
-###############################################################################
-! Strings for DTDBasicTypeImpl type descriptions
-_UI_NONE_DESC=None
-
-!! NOTE TO TRANSLATOR: Do not translate following text in parentheses on following 10 lines i.e.(CDATA)
-_UI_CHARACTER_DATA_DESC=Character Data (CDATA)
-_UI_IDENTIFIER_DESC=Identifier (ID)
-_UI_ID_REFERENCE_DESC=ID Reference (IDREF)
-_UI_ID_REFERENCES_DESC=ID References (IDREFS)
-_UI_ENTITY_NAME_DESC=Entity Name (ENTITY)
-_UI_ENTITY_NAMES_DESC=Entity Names (ENTITIES)
-_UI_NAME_TOKEN_DESC=Name Token (NMTOKEN)
-_UI_NAME_TOKENS_DESC=Name Tokens (NMTOKENS)
-_UI_ENUM_NAME_TOKENS_DESC=Enumerated Name Tokens
-_UI_ENUM_NOTATION_DESC=Enumerated NOTATION
-
-! Strings from sed/model
-
-! Attribute.java
-_UI_LABEL_ATTR_DEFAULT_VAL=Attribute Default Change Value
-_UI_LABEL_ATTR_DEFAULT_KIND=Change Attribute Default Value
-_UI_LABEL_ATTR_TYPE=Change Attribute Type
-
-! AttributeEnumList
-_UI_LABEL_ATTR_ENUM_ITEMS=Change Attribute Enumeration Value
-
-! AttributeList
-_UI_LABEL_ATTR_LIST_ADD=Add Attribute
-
-! CMGroupNode
-_UI_LABEL_CM_GRP_NODE_CONNECTOR=Change Connector
-_UI_LABEL_CM_GRP_NODE_INSERT_ELEMENT=Insert Element
-_UI_LABEL_CM_GRP_NODE_ADD_GRP=Add Group
-_UI_LABEL_CM_GRP_NODE_ADD_CHILD=Add Child Element
-
-! CMNode
-_UI_LABEL_CM_NODE_MIX_CONTENT=Mixed Content
-_UI_LABEL_CM_NODE_CHILD_CONTENT=Children Content
-_UI_LABEL_CM_NODE_SET_MIX_CONTENT=Set Mixed Content
-_UI_LABEL_CM_NODE_SET_CHILD_CONTENT=Set Children Content
-
-!! NOTE TO TRANSLATOR - USAGE: "Set <variable content> Content"
-_UI_LABEL_CM_NODE_SET=Set
-_UI_LABEL_CM_NODE_CONTENT=Content
-
-!! NOTE TO TRANSLATOR - DO NOT TRANSLATE FOLLOWING 3 LINES
-_UI_LABEL_CM_NODE_PCDATA=(#PCDATA)
-_UI_LABEL_CM_NODE_ANY=ANY
-_UI_LABEL_CM_NODE_EMPTY=EMPTY
-
-! CMRepeatableNode
-_UI_LABEL_CM_REP_NODE_CHG_OCCUR=Change Occurrence
-
-! Comment
-_UI_LABEL_COMMENT_CHG=Comment Change
-
-! DTDFile
-_UI_LABEL_DTD_FILE_ADD_ELEMENT=Add Element
-_UI_LABEL_DTD_FILE_ADD_ENTITY=Add Entity
-_UI_LABEL_DTD_FILE_ADD_COMMENT=Add Comment
-_UI_LABEL_DTD_FILE_ADD_PARM_ENTITY_REF=Add Parameter Entity Reference
-_UI_LABEL_DTD_FILE_ADD_NOTATION=Add Notation
-_UI_LABEL_DTD_FILE_ADD_ATTR_LIST=Add Attribute List
-_UI_LABEL_DTD_FILE_DELETE=Delete
-
-! DTDNode
-_UI_LABEL_DTD_NODE_NAME_CHG=Name Change
-_UI_LABEL_DTD_NODE_DELETE=Delete
-
-! Element
-_UI_LABEL_ELEMENT_ADD_ATTR=Add Attribute
-_UI_LABEL_ELEMENT_ADD_GRP=Add Group
-_UI_LABEL_ELEMENT_ADD_CHILD=Add Child Element
-
-! Entity
-_UI_LABEL_ENTITY_SET_PARM_ENTITY=Set Parameter Entity
-_UI_LABEL_ENTITY_SET_GENERAL_ENTITY=Set General Entity
-_UI_LABEL_ENTITY_SET_EXT_ENTITY=Set External Entity
-_UI_LABEL_ENTITY_SET_INT_ENTITY=Set Internal Entity
-_UI_LABEL_ENTITY_VALUE_CHG=Entity Value Change
-
-!! NOTE TO TRANSLATOR - USAGE: "NDATA Change"
-_UI_LABEL_ENTITY_NDATA_CHANGE=Change
-
-! ExternalNode
-_UI_LABEL_EXT_NODE_PUBLIC_ID_CHG=Public ID Change
-_UI_LABEL_EXT_NODE_SYSTEM_ID_CHG=System ID Change
-
-! NodeList
-_UI_LABEL_NODE_LIST_ELEMENTS=Elements
-_UI_LABEL_NODE_LIST_ENTITIES=Entities
-_UI_LABEL_NODE_LIST_NOTATIONS=Notations
-_UI_LABEL_NODE_LIST_COMMENTS=Comments
-_UI_LABEL_NODE_LIST_OTHER=Other
-_UI_LABEL_NODE_LIST_ATTRIBUTES=Attributes
-
-! ParameterEntityReference
-_UI_LABEL_PARM_ENTITY_REF_CHG_ENTITY_REF=Change Entity Reference
-_UI_LABEL_PARM_ENTITY_REF_COMMENT_CHG=Comment Change
-
-! TopLevelNode
-_UI_LABEL_TOP_LEVEL_NODE_DELETE=Delete
-
-_ERROR_INCL_FILE_LOAD_FAILURE       = Failed to load included file
-
-! usage: _ERROR_UNDECLARED_ELEMENT_1  + <elementName> + _PARTERROR_UNDECLARED_ELEMENT_2
-_ERROR_UNDECLARED_ELEMENT_1         = Reference to undeclared element '
-_UI_ERRORPART_UNDECLARED_ELEMENT_2  =' in content model.
-
-! usage: _ERROR_DUP_ID_ATTRIBUTE_1  + <attributeName> + _PARTERROR_DUP_ID_ATTRIBUTE_2
-_ERROR_DUP_ID_ATTRIBUTE_1         = Duplicate ID attribute '
-_UI_ERRORPART_DUP_ID_ATTRIBUTE_2  = '. Only one ID attribute can be specified per ELEMENT type.
-
-! usage:_ERROR_INVALID_DEFAULT_ATTR_VALUE_1 + <typeString> + _PARTERROR_INVALID_DEFAULT_ATTR_VALUE_2 + <attributeName>
-_ERROR_INVALID_DEFAULT_ATTR_VALUE_1         = Invalid default
-_UI_ERRORPART_INVALID_DEFAULT_ATTR_VALUE_2  =  value for attribute '
-
-_EXC_OPERATION_NOT_SUPPORTED  = Operation not supported
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDFile.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDFile.java
deleted file mode 100644
index 7c5a8e1..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDFile.java
+++ /dev/null
@@ -1,674 +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.dtd.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.event.IDTDFileListener;
-import org.eclipse.wst.dtd.core.internal.event.NodesEvent;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.util.DTDExternalReferenceRemover;
-import org.eclipse.wst.dtd.core.internal.util.DTDModelUpdater;
-import org.eclipse.wst.dtd.core.internal.util.DTDNotationReferenceRemover;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
-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;
-
-public class DTDFile implements IndexedRegion {
-	 private NodeList attlistList = new NodeList(this, DTDRegionTypes.ATTLIST_TAG);
-	private NodeList commentList = new NodeList(this, DTDRegionTypes.COMMENT_START);
-
-	boolean creatingNewModel = false;
-	private DTDModelImpl fDTDModel;
-
-	private NodeList elementList = new NodeList(this, DTDRegionTypes.ELEMENT_TAG);
-	private NodeList entityList = new NodeList(this, DTDRegionTypes.ENTITY_TAG);
-
-	private List folderList = null;
-
-	private boolean isMovingNode = false;
-
-	private List modelListeners = new ArrayList();
-
-	private List nodeList = new ArrayList();
-	private NodeList notationList = new NodeList(this, DTDRegionTypes.NOTATION_TAG);
-	private NodeList unrecognizedList = new NodeList(this, DTDRegionTypes.UNKNOWN_CONTENT);
-
-	public DTDFile(DTDModelImpl dtdModel) {
-		this.fDTDModel = dtdModel;
-	}
-
-	public void addDTDFileListener(IDTDFileListener listener) {
-		modelListeners.add(listener);
-	}
-
-	protected void addNode(DTDNode node) {
-		addNode(nodeList.size(), node);
-	}
-
-	protected void addNode(int index, DTDNode node) {
-		nodeList.add(index, node);
-		/*
-		 * if (index < nodeList.size()) { insertBefore(node, (DTDNode)
-		 * nodeList.get(index)); } else { appendChild(node); }
-		 */
-	}
-
-	public DTDNode buildNode(IStructuredDocumentRegion flatNode) {
-		// ITextRegionList regions = flatNode.getRegions();
-		DTDNode node = null;
-		if (isElement(flatNode)) {
-			// then this is an element
-			node = new Element(this, flatNode);
-		}
-		else if (isEntity(flatNode)) {
-			node = new Entity(this, flatNode);
-		}
-		else if (isNotation(flatNode)) {
-			node = new Notation(this, flatNode);
-		}
-		else if (isAttributeList(flatNode)) {
-			node = new AttributeList(this, flatNode);
-		}
-		else if (isComment(flatNode)) {
-			node = new Comment(this, flatNode);
-		}
-		else if (isParameterEntityReference(flatNode)) {
-			node = new ParameterEntityReference(this, flatNode);
-		}
-		else if (!flatNode.getText().trim().equals("")) { //$NON-NLS-1$
-			node = new Unrecognized(this, flatNode);
-		}
-		if (node != null) {
-			insertNode(node);
-			node.resolveRegions();
-		}
-		return node;
-	}
-
-	public void buildNodes(IStructuredDocumentRegionList list) {
-		NodesEvent addedDTDNodes = new NodesEvent();
-
-		TopLevelNode previousNode = null;
-		for (int i = 0; i < list.getLength(); i++) {
-			IStructuredDocumentRegion flatNode = list.item(i);
-			TopLevelNode node = (TopLevelNode) buildNode(flatNode);
-			// if we don't create a node, then we assume that the flat
-			// node was whitespace. Tack it on to a previous toplevel
-			// node
-			if (node != null) {
-				previousNode = node;
-				addedDTDNodes.add(node);
-			}
-			else {
-				if (previousNode != null) {
-					previousNode.addWhitespaceStructuredDocumentRegion(flatNode);
-				}
-			}
-		}
-
-		if (addedDTDNodes.getNodes().size() > 0)// &&
-		// creatingNewModel == false)
-		{
-			// now tell people about the additions
-			notifyNodesAdded(addedDTDNodes);
-		}
-	}
-
-	// Implements IndexedRegion
-
-	public boolean contains(int testPosition) {
-		return getStartOffset() <= testPosition && testPosition <= getEndOffset();
-	}
-
-	public void createAttributeList(DTDNode node, String name, boolean isAfter) {
-		getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_ADD_ATTR_LIST); //$NON-NLS-1$
-		String newStream = "<!ATTLIST " + name + ">\n"; //$NON-NLS-1$ //$NON-NLS-2$
-		int offset = getInsertOffset(node, isAfter);
-		getStructuredDocument().replaceText(this, offset, 0, newStream);
-		getDTDModel().endRecording(this);
-	}
-
-	public void createComment(DTDNode node, String name, boolean isAfter) {
-		getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_ADD_COMMENT); //$NON-NLS-1$
-		String newStream = "<!-- " + name + " -->\n"; //$NON-NLS-1$ //$NON-NLS-2$
-		int offset = getInsertOffset(node, isAfter);
-		getStructuredDocument().replaceText(this, offset, 0, newStream);
-		getDTDModel().endRecording(this);
-	}
-
-	public void createElement(DTDNode node, String name, boolean isAfter) {
-		getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_ADD_ELEMENT); //$NON-NLS-1$
-		String newStream = "<!ELEMENT " + name + " EMPTY>\n"; //$NON-NLS-1$ //$NON-NLS-2$
-		int offset = getInsertOffset(node, isAfter);
-		getStructuredDocument().replaceText(this, offset, 0, newStream);
-		getDTDModel().endRecording(this);
-	}
-
-	public void createEntity(DTDNode node, String name, boolean isAfter) {
-		getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_ADD_ENTITY); //$NON-NLS-1$
-		String newStream = "<!ENTITY " + name + " \"\">\n"; //$NON-NLS-1$//$NON-NLS-2$
-		int offset = getInsertOffset(node, isAfter);
-		getStructuredDocument().replaceText(this, offset, 0, newStream);
-		getDTDModel().endRecording(this);
-	}
-
-	public void createNotation(DTDNode node, String name, boolean isAfter) {
-		getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_ADD_NOTATION); //$NON-NLS-1$
-		String newStream = "<!NOTATION " + name + " SYSTEM \"\">\n"; //$NON-NLS-1$ //$NON-NLS-2$
-		int offset = getInsertOffset(node, isAfter);
-		getStructuredDocument().replaceText(this, offset, 0, newStream);
-		getDTDModel().endRecording(this);
-	}
-
-	public void createParameterEntityReference(DTDNode node, String name, boolean isAfter) {
-		getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_ADD_PARM_ENTITY_REF); //$NON-NLS-1$
-		String newStream = name + "\n"; //$NON-NLS-1$
-		int offset = getInsertOffset(node, isAfter);
-		getStructuredDocument().replaceText(this, offset, 0, newStream);
-		getDTDModel().endRecording(this);
-	}
-
-	public void deleteNode(DTDNode node) {
-		getDTDModel().beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_FILE_DELETE); //$NON-NLS-1$
-		deleteNode(this, node);
-		getDTDModel().endRecording(this);
-	}
-
-	public void deleteNode(Object requestor, DTDNode node) {
-		DTDNode parent = (DTDNode) node.getParentNode();
-		if (parent != null) {
-			parent.delete(requestor, node);
-		}
-		else {
-			if (!isMovingNode) {
-				DTDModelUpdater updater = new DTDModelUpdater();
-				updater.objectAboutToBeDeleted(requestor, node);
-				if (node instanceof ParameterEntityReference) {
-					Entity referencedEntity = ((ParameterEntityReference) node).getEntityObject();
-					if (referencedEntity != null) {
-						// remove references to all elements and parm entities
-						// contained in our current model
-						DTDExternalReferenceRemover remover = new DTDExternalReferenceRemover();
-						remover.externalReferenceAboutToChange(requestor, referencedEntity);
-					}
-				}
-				else if (node instanceof Notation) {
-					Notation notation = ((Notation) node);
-					DTDNotationReferenceRemover remover = new DTDNotationReferenceRemover();
-					remover.notationAboutToBeDeleted(requestor, notation);
-				}
-			}
-
-			// no parent? then delete up until the start of the next node
-			// if it is a top level node
-			int startOffset = node.getStartOffset();
-			int endOffset = node.getWhitespaceEndOffset();
-			if (node instanceof TopLevelNode) {
-				endOffset = getInsertOffset(node, true);
-			}
-			getStructuredDocument().replaceText(requestor, startOffset, endOffset - startOffset, ""); //$NON-NLS-1$
-		}
-	}
-
-	public NodeList getComments() {
-		return commentList;
-	}
-
-	public DTDModelImpl getDTDModel() {
-		return fDTDModel;
-	}
-
-	public NodeList getElementsAndParameterEntityReferences() {
-		return elementList;
-	}
-
-	public int getEndOffset() {
-		int result = -1;
-		IStructuredDocumentRegion region = getStructuredDocument().getLastStructuredDocumentRegion();
-		if (region != null) {
-			result = region.getEndOffset();
-		}
-		return result;
-	}
-
-	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;
-	}
-
-	public NodeList getEntities() {
-		return entityList;
-	}
-
-	public Image getImage() {
-		return DTDCorePlugin.getInstance().getImage(DTDResource.DTDFILEICON);
-	}
-
-
-
-	public int getInsertOffset(DTDNode node, boolean isAfter) {
-		int offset = 0;
-		if (node != null) {
-			if (isAfter) {
-				// then get the next node and use it's start offset
-				int index = getNodes().indexOf(getNode(node.getStructuredDTDDocumentRegion()));
-
-				DTDNode afterNode = null;
-				if (index + 1 < getNodes().size()) {
-					afterNode = (DTDNode) getNodes().get(index + 1);
-				}
-				if (afterNode != null) {
-					offset = afterNode.getStructuredDTDDocumentRegion().getStartOffset();
-				}
-				else {
-					// add to end
-					if (getStructuredDocument().getLastStructuredDocumentRegion() != null) {
-						offset = getStructuredDocument().getLastStructuredDocumentRegion().getEndOffset();
-					}
-				}
-			}
-			else {
-				offset = node.getStructuredDTDDocumentRegion().getStartOffset();
-			}
-		}
-		else {
-			// add to end
-			if (getStructuredDocument().getLastStructuredDocumentRegion() != null) {
-				offset = getStructuredDocument().getLastStructuredDocumentRegion().getEndOffset();
-			}
-		}
-		return offset;
-	}
-
-	public String getName() {
-		org.eclipse.core.runtime.Path path = new org.eclipse.core.runtime.Path(getDTDModel().getId().toString());
-		return path.lastSegment();
-	}
-
-	public DTDNode getNode(IStructuredDocumentRegion flatNode) {
-		for (int i = 0; i < nodeList.size(); i++) {
-			DTDNode node = (DTDNode) nodeList.get(i);
-			if (node.getStructuredDTDDocumentRegion() == flatNode) {
-				return node;
-			}
-		}
-		return null;
-	}
-
-	public IndexedRegion getNodeAt(int offset) {
-		DTDNode node = getTopLevelNodeAt(offset);
-		if (node != null) {
-			return node.getDeepestNode(offset);
-		}
-		return null;
-	}
-
-	public IndexedRegion getNodeAt(int startOffset, int endOffset) {
-		DTDNode node = getTopLevelNodeAt(startOffset);
-		if (node != null) {
-			return node.getDeepestNode(startOffset, endOffset);
-		}
-		return null;
-	}
-
-	public List getNodeLists() {
-		if (folderList == null) {
-			folderList = new ArrayList();
-			folderList.add(notationList);
-			folderList.add(entityList);
-			folderList.add(elementList);
-			folderList.add(attlistList);
-			folderList.add(commentList);
-			folderList.add(unrecognizedList);
-		}
-		return folderList;
-	}
-
-	public List getNodes() {
-		return nodeList;
-	}
-
-	public NodeList getNotations() {
-		return notationList;
-	}
-
-	public int getStartOffset() {
-		int result = -1;
-		IStructuredDocumentRegion region = getStructuredDocument().getFirstStructuredDocumentRegion();
-		if (region != null) {
-			result = region.getStartOffset();
-		}
-		return result;
-	}
-
-	public IStructuredDocument getStructuredDocument() {
-		return fDTDModel.getStructuredDocument();
-	}
-
-	public DTDNode getTopLevelNodeAt(int offset) {
-		for (int i = 0; i < nodeList.size(); i++) {
-			DTDNode node = (DTDNode) nodeList.get(i);
-			if (node.contains(offset)) {
-				return node;
-			}
-		}
-		return null;
-	}
-
-	public NodeList getUnrecognized() {
-		return unrecognizedList;
-	}
-
-	public void insertIntoModel(Object requestor, DTDNode reference, DTDNode node, boolean isAfter) {
-		String nodeText = ""; //$NON-NLS-1$
-		if (node instanceof TopLevelNode) {
-			nodeText = ((TopLevelNode) node).getFullText();
-		}
-		else {
-			nodeText = node.getNodeText();
-		}
-		int offset = getInsertOffset(reference, isAfter);
-		getStructuredDocument().replaceText(requestor, offset, 0, nodeText);
-	}
-
-
-	public void insertNode(DTDNode node) {
-		int startOffset = node.getStartOffset();
-		int insertIndex = -1;
-		// System.out.println("startoffset = " + startOffset);
-		for (int i = 0; i < getNodes().size(); i++) {
-			DTDNode currentNode = (DTDNode) getNodes().get(i);
-			// System.out.println("currentNode endOffset = "
-			// +currentNode.getEndOffset());
-
-			if (currentNode.getEndOffset() > startOffset) {
-				// System.out.println("endoffset " +
-				// currentNode.getEndOffset() + " > " + startOffset);
-				insertIndex = i;
-				break;
-			}
-		}
-		if (insertIndex == -1) {
-			insertIndex = getNodes().size();
-		}
-
-
-		// System.out.println("insert index = " + insertIndex);
-
-		addNode(insertIndex, node);
-	}
-
-	// it is assumed that flatnode contains at least 3 regions
-	public boolean isAttributeList(IStructuredDocumentRegion flatNode) {
-		if (flatNode.getRegions().size() >= 3) {
-			ITextRegion second = flatNode.getRegions().get(1);
-			ITextRegion third = flatNode.getRegions().get(2);
-			if (second.getType().equals(DTDRegionTypes.EXCLAMATION) && third.getType().equals(DTDRegionTypes.ATTLIST_TAG)) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	// it is assumed that flatnode contains at least 3 regions
-	public boolean isComment(IStructuredDocumentRegion flatNode) {
-		if (flatNode.getRegions().size() >= 2) {
-			ITextRegion region = flatNode.getRegions().get(1);
-			if (region.getType().equals(DTDRegionTypes.COMMENT_START)) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	// it is assumed that flatnode contains at least 3 regions
-	public boolean isElement(IStructuredDocumentRegion flatNode) {
-		if (flatNode.getRegions().size() >= 3) {
-			ITextRegion second = flatNode.getRegions().get(1);
-			ITextRegion third = flatNode.getRegions().get(2);
-			if (second.getType().equals(DTDRegionTypes.EXCLAMATION) && third.getType().equals(DTDRegionTypes.ELEMENT_TAG)) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	// it is assumed that flatnode contains at least 3 regions
-	public boolean isEntity(IStructuredDocumentRegion flatNode) {
-		if (flatNode.getRegions().size() >= 3) {
-			ITextRegion second = flatNode.getRegions().get(1);
-			ITextRegion third = flatNode.getRegions().get(2);
-			if (second.getType().equals(DTDRegionTypes.EXCLAMATION) && third.getType().equals(DTDRegionTypes.ENTITY_TAG)) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	// it is assumed that flatnode contains at least 3 regions
-	public boolean isNotation(IStructuredDocumentRegion flatNode) {
-		if (flatNode.getRegions().size() >= 3) {
-			ITextRegion second = flatNode.getRegions().get(1);
-			ITextRegion third = flatNode.getRegions().get(2);
-			if (second.getType().equals(DTDRegionTypes.EXCLAMATION) && third.getType().equals(DTDRegionTypes.NOTATION_TAG)) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	// it is assumed that flatnode contains at least 3 regions
-	public boolean isParameterEntityReference(IStructuredDocumentRegion flatNode) {
-		if (flatNode.getRegions().size() == 1) {
-			ITextRegion region = flatNode.getRegions().get(0);
-			if (region.getType().equals(DTDRegionTypes.ENTITY_PARM)) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	boolean isSameTopLevelType(DTDNode affectedNode) {
-		IStructuredDocumentRegion flatNode = affectedNode.getStructuredDTDDocumentRegion();
-		// return true if the flatnode still matches what the affectedNode
-		// is representing
-		if (affectedNode instanceof Element && isElement(flatNode)) {
-			return true;
-		}
-		if (affectedNode instanceof Entity && isEntity(flatNode)) {
-			return true;
-		}
-		if (affectedNode instanceof Comment && isComment(flatNode)) {
-			return true;
-		}
-		if (affectedNode instanceof AttributeList && isAttributeList(flatNode)) {
-			return true;
-		}
-		if (affectedNode instanceof Notation && isNotation(flatNode)) {
-			return true;
-		}
-		if (affectedNode instanceof Unrecognized && isUnrecognized(flatNode)) {
-			return true;
-		}
-		return false;
-	}
-
-	public boolean isUnrecognized(IStructuredDocumentRegion flatNode) {
-		return !isElement(flatNode) && !isEntity(flatNode) && !isNotation(flatNode) && !isParameterEntityReference(flatNode) && !isAttributeList(flatNode) && !isComment(flatNode);
-	}
-
-	public void moveNode(Object requestor, DTDNode referenceNode, DTDNode nodeToMove, boolean isAfter) {
-		isMovingNode = true;
-
-		deleteNode(requestor, nodeToMove);
-		insertIntoModel(requestor, referenceNode, nodeToMove, isAfter);
-		isMovingNode = false;
-	}
-
-	public void newModel(NewDocumentEvent event) {
-		creatingNewModel = true;
-		nodeList.clear();
-		NodesEvent removeEvent = new NodesEvent();
-		removeEvent.getNodes().addAll(nodeList);
-		notifyNodesRemoved(removeEvent);
-		/* removeChildNodes(); */
-
-		if (event.getStructuredDocument() != null && event.getStructuredDocument().getRegionList() != null) {
-			buildNodes(event.getStructuredDocument().getRegionList());
-		}
-		creatingNewModel = false;
-	}
-
-	public void nodesReplaced(StructuredDocumentRegionsReplacedEvent event) {
-		IStructuredDocumentRegionList oldNodes = event.getOldStructuredDocumentRegions();
-		NodesEvent removedDTDNodes = new NodesEvent();
-		for (int i = 0; i < oldNodes.getLength(); i++) {
-			IStructuredDocumentRegion flatNode = oldNodes.item(i);
-
-			for (Iterator iter = getNodes().iterator(); iter.hasNext();) {
-				DTDNode node = (DTDNode) iter.next();
-				if (node.getStructuredDTDDocumentRegion() == flatNode) {
-					removedDTDNodes.add(node);
-				}
-			}
-		}
-
-		buildNodes(event.getNewStructuredDocumentRegions());
-
-		if (removedDTDNodes.getNodes().size() > 0) {
-			notifyNodesRemoved(removedDTDNodes);
-			removeNodes(removedDTDNodes.getNodes());
-		}
-	}
-
-	public void notifyNodeChanged(DTDNode node) {
-		Iterator iter = modelListeners.iterator();
-		while (iter.hasNext()) {
-			IDTDFileListener listener = (IDTDFileListener) iter.next();
-			listener.nodeChanged(node);
-		}
-	}
-
-	public void notifyNodesAdded(NodesEvent addedNodes) {
-		Iterator iter = modelListeners.iterator();
-		while (iter.hasNext()) {
-			IDTDFileListener listener = (IDTDFileListener) iter.next();
-			listener.nodesAdded(addedNodes);
-		}
-	}
-
-	protected void notifyNodesRemoved(NodesEvent event) {
-		Iterator iter = modelListeners.iterator();
-		while (iter.hasNext()) {
-			IDTDFileListener listener = (IDTDFileListener) iter.next();
-			listener.nodesRemoved(event);
-		}
-	}
-
-	public void rebuildNodes(List nodes) {
-		// remove the old nodes
-		removeNodes(nodes);
-
-		// now rebuild them
-		NodesEvent addedDTDNodes = new NodesEvent();
-		Iterator dtdNodes = nodes.iterator();
-		while (dtdNodes.hasNext()) {
-			DTDNode dtdNode = (DTDNode) dtdNodes.next();
-			// System.out.println("rebuilding " +
-			// dtdNode.getStructuredDocumentRegion().getText());
-
-			DTDNode node = buildNode(dtdNode.getStructuredDTDDocumentRegion());
-			if (node != null) {
-				addedDTDNodes.add(node);
-			}
-		}
-		if (addedDTDNodes.getNodes().size() > 0) {
-			// now tell people about the additions
-			notifyNodesAdded(addedDTDNodes);
-		}
-	}
-
-	public void regionChanged(RegionChangedEvent event) {
-		ITextRegion changedRegion = event.getRegion();
-		IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
-		DTDNode affectedNode = (DTDNode) getNodeAt(flatNode.getStartOffset(changedRegion), flatNode.getEndOffset(changedRegion));
-		if (affectedNode != null) {
-			// no need to resolve regions as it is just a change
-			// affectedNode.resolveRegions();
-			notifyNodeChanged(affectedNode);
-		}
-	}
-
-	public void regionsReplaced(RegionsReplacedEvent event) {
-		List nodesToRebuild = new ArrayList();
-		IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
-		DTDNode affectedNode = getNode(flatNode);
-
-		if (!isSameTopLevelType(affectedNode)) {
-			nodesToRebuild.add(affectedNode);
-			rebuildNodes(nodesToRebuild);
-		}
-		else {
-			affectedNode.resolveRegions();
-			notifyNodeChanged(affectedNode);
-			// now try and determine which ones were added
-			NodesEvent addedDTDNodes = new NodesEvent();
-			ITextRegionList newRegions = event.getNewRegions();
-			int size = newRegions.size();
-			for (int i = 0; i < size; i++) {
-				ITextRegion region = newRegions.get(i);
-				DTDNode deepestNode = affectedNode.getDeepestNode(flatNode.getStartOffset(region), flatNode.getEndOffset(region));
-				if (!addedDTDNodes.getNodes().contains(deepestNode)) {
-					addedDTDNodes.add(deepestNode);
-				}
-			}
-			if (addedDTDNodes.getNodes().size() > 0) {
-				notifyNodesAdded(addedDTDNodes);
-			}
-		}
-	}
-
-	public void removeDTDFileListener(IDTDFileListener listener) {
-		modelListeners.remove(listener);
-	}
-
-	protected void removeNodes(List nodes) {
-		getNodes().removeAll(nodes);
-		/*
-		 * for (int i = 0; i < nodes.size(); i++) {
-		 * removeChild((DTDNode)nodes.get(i)); } // end of for ()
-		 */
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDNode.java
deleted file mode 100644
index b15037c..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDNode.java
+++ /dev/null
@@ -1,330 +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.dtd.core.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-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.text.TextRegionListImpl;
-import org.eclipse.wst.xml.core.internal.document.NodeContainer;
-import org.w3c.dom.Node;
-
-
-public abstract class DTDNode extends NodeContainer implements IndexedRegion {
-
-	// these are characteroffsets
-	protected DTDFile dtdFile;
-
-	// flat node that contains this node
-	protected IStructuredDocumentRegion flatNode;
-
-	protected TextRegionListImpl regions = new TextRegionListImpl();
-
-	protected TextRegionListImpl whitespace = new TextRegionListImpl();
-
-	public DTDNode(DTDFile dtdFile, IStructuredDocumentRegion flatNode) {
-		this.dtdFile = dtdFile;
-		this.flatNode = flatNode;
-	}
-
-	public void addRegion(ITextRegion region) {
-		/*
-		 * if (startRegion == null) { startRegion = region; } endRegion =
-		 * region;
-		 */
-		regions.add(region);
-	}
-
-	public void addWhitespaceRegion(ITextRegion region) {
-		whitespace.add(region);
-	}
-
-	public void beginRecording(Object requestor, String label) {
-		getDTDFile().getDTDModel().beginRecording(requestor, label);
-	}
-
-	public Node cloneNode(boolean deepest) {
-		return null;
-	}
-
-	public boolean contains(int testPosition) {
-		return containsRange(testPosition, testPosition);
-	}
-
-	public boolean containsRange(int start, int end) {
-		return getStartOffset() <= start && end <= getEndOffset();
-	}
-
-	public void delete(DTDNode child) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_NODE_DELETE); //$NON-NLS-1$
-		delete(this, child);
-		endRecording(this);
-	}
-
-	public void delete(Object requestor, DTDNode child) {
-		replaceText(requestor, child.getStartOffset(), child.getFullNodeLength(), ""); //$NON-NLS-1$
-	}
-
-	public void endRecording(Object requestor) {
-		getDTDFile().getDTDModel().endRecording(requestor);
-	}
-
-	public Object[] getChildren() {
-		return getChildrenList().toArray();
-	}
-
-	public List getChildrenList() {
-		Node child = getFirstChild();
-		if (child != null) {
-			List children = new ArrayList();
-			for (; child != null; child = child.getNextSibling()) {
-				children.add(child);
-			}
-			return children;
-		}
-		else {
-			return Collections.EMPTY_LIST;
-		}
-	}
-
-	public DTDNode getDeepestNode(int offset) {
-		if (contains(offset)) {
-			// now see if a child contains this offset
-			Object[] children = getChildren();
-			for (int i = 0; i < children.length; i++) {
-				DTDNode child = (DTDNode) children[i];
-				DTDNode deepest = child.getDeepestNode(offset);
-				if (deepest != null) {
-					return deepest;
-				}
-			} // end of for ()
-			return this;
-		}
-		return null;
-	}
-
-	public DTDNode getDeepestNode(int start, int end) {
-		if (containsRange(start, end)) {
-			// now see if a child contains this offset
-			Object[] children = getChildren();
-			for (int i = 0; i < children.length; i++) {
-				DTDNode child = (DTDNode) children[i];
-				DTDNode deepest = child.getDeepestNode(start, end);
-				if (deepest != null) {
-					return deepest;
-				}
-			} // end of for ()
-			return this;
-		}
-		return null;
-	}
-
-	public DTDFile getDTDFile() {
-		return dtdFile;
-	}
-
-	public int getEndOffset() {
-		return getStructuredDTDDocumentRegion().getEndOffset(getEndRegion());
-	}
-
-	public ITextRegion getEndRegion() {
-		return regions.get(regions.size() - 1);// endRegion;
-	}
-
-	/**
-	 */
-	public FactoryRegistry getFactoryRegistry() {
-		DTDModelImpl model = dtdFile.getDTDModel();
-		if (model != null) {
-			FactoryRegistry reg = model.getFactoryRegistry();
-			if (reg != null)
-				return reg;
-		}
-		return null;
-	}
-
-	public int getFullNodeLength() {
-		return getWhitespaceEndOffset() - getStartOffset();
-	}
-
-	public String getFullNodeText() {
-		String text = getNodeText();
-		if (whitespace.size() > 0) {
-			RegionIterator iter = new RegionIterator(whitespace);
-			while (iter.hasNext()) {
-				ITextRegion region = iter.next();
-				text += getStructuredDTDDocumentRegion().getText(region);
-			}
-		}
-		return text;
-	}
-
-	abstract public Image getImage();
-
-	public String getName() {
-		ITextRegion region = getNameRegion();
-		if (region != null) {
-			return getStructuredDTDDocumentRegion().getText(region);
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	public ITextRegion getNameRegion() {
-		RegionIterator iter = iterator();
-		while (iter.hasNext()) {
-			ITextRegion region = iter.next();
-			if (region.getType() == DTDRegionTypes.NAME) {
-				return region;
-			}
-		}
-		return null;
-	}
-
-	// return the first token containing the specified token type
-	public ITextRegion getNextRegion(RegionIterator iter, String type) {
-		while (iter.hasNext()) {
-			ITextRegion region = iter.next();
-			if (region.getType().equals(type)) {
-				return region;
-			}
-		}
-		return null;
-	}
-
-	public int getNodeLength() {
-		return getEndOffset() - getStartOffset();
-	}
-
-	public String getNodeName() {
-		return getName();
-	}
-
-	public String getNodeText() {
-		StringBuffer sb = new StringBuffer();
-
-		RegionIterator iter = iterator();
-		while (iter.hasNext()) {
-			ITextRegion region = iter.next();
-			sb.append(getStructuredDTDDocumentRegion().getText(region));
-		}
-		return sb.toString();
-	}
-
-	public short getNodeType() {
-		return -1;
-	}
-
-	public int getStartOffset() {
-		return getStructuredDTDDocumentRegion().getStartOffset(getStartRegion());
-	}
-
-	// private Region startRegion,endRegion;
-	public ITextRegion getStartRegion() {
-		return regions.get(0);
-		// return startRegion;
-	}
-
-	/**
-	 * Get the value of flatNode.
-	 * 
-	 * @return value of flatNode.
-	 * 
-	 * ISSUE:named changed not to be confused with default access protected
-	 * super class method, but should re-think if this is correct technique.
-	 * Perhaps getFirstRegion?
-	 */
-	public IStructuredDocumentRegion getStructuredDTDDocumentRegion() {
-		return flatNode;
-	}
-
-	// return end offset including whitespace
-	// or just the end offset if there is no whitespace
-	public int getWhitespaceEndOffset() {
-		if (whitespace.size() > 0) {
-			ITextRegion region = whitespace.get(whitespace.size() - 1);
-			return getStructuredDTDDocumentRegion().getEndOffset(region);
-		}
-
-		return getEndOffset();
-	}
-
-	public boolean hasTrailingWhitespace() {
-		return whitespace.size() > 0;
-	}
-
-	public RegionIterator iterator() {
-		// System.out.println("create region iter " + this.getClass() + " with
-		// start , end = " + getStartOffset() + ", " +getEndOffset());
-		return new RegionIterator(regions);
-	}
-
-	public void replaceText(Object requestor, int start, int length, String newText) {
-		getDTDFile().getStructuredDocument().replaceText(requestor, start, length, newText);
-	}
-
-	public void resolveRegions() {
-	}
-
-	public void setName(Object requestor, String name) {
-		if (!getName().equals(name)) {
-			ITextRegion nameRegion = getNameRegion();
-			if (nameRegion != null) {
-				// nameToken.updateText(name);
-				getDTDFile().getDTDModel().getReferenceUpdater().nameAboutToChange(requestor, this, name);
-				replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(nameRegion), nameRegion.getLength(), name);
-			}
-		}
-	}
-
-	public void setName(String name) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_DTD_NODE_NAME_CHG); //$NON-NLS-1$
-		setName(this, name);
-		endRecording(this);
-	}
-
-	/**
-	 * Set the value of flatNode.
-	 * 
-	 * @param v
-	 *            Value to assign to flatNode. ISSUE:named changed not to be
-	 *            confused with default access protected super class method,
-	 *            but should re-think if this is correct technique
-	 */
-	void setStructuredDTDDocumentRegion(IStructuredDocumentRegion v) {
-		this.flatNode = v;
-	}
-
-	// skips past next name token in the iterator
-	protected void skipPastName(RegionIterator iter) {
-		while (iter.hasNext()) {
-			ITextRegion currentRegion = iter.next();
-			if (currentRegion.getType() == DTDRegionTypes.NAME) {
-				break;
-			}
-		}
-	}
-
-	public boolean supports(java.lang.String feature, java.lang.String version) {
-		return false;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDResource.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDResource.java
deleted file mode 100644
index c7d2440..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDResource.java
+++ /dev/null
@@ -1,56 +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.dtd.core.internal;
-
-
-public interface DTDResource {
-	// Enumeration Constants
-	public static final String ANYICON = "icons/full/obj16/any.gif"; //$NON-NLS-1$
-	public static final String ATTRIBUTEICON = "icons/full/obj16/attribute.gif"; //$NON-NLS-1$
-	public static final String ATTRIBUTELISTICON = "icons/full/obj16/attribute_list.gif"; //$NON-NLS-1$
-	public static final String COMMENTICON = "icons/full/obj16/comment.gif"; //$NON-NLS-1$
-
-	public static final String DTDFILEICON = "icons/full/obj16/DTDFile.gif"; //$NON-NLS-1$
-	public static final String ELEMENTICON = "icons/full/obj16/element.gif"; //$NON-NLS-1$
-	public static final String ELEMENTREFICON = "icons/full/obj16/element_ref.gif"; //$NON-NLS-1$
-	public static final String EMPTYICON = "icons/full/obj16/emptycontent.gif"; //$NON-NLS-1$
-	public static final String ENTITYICON = "icons/full/obj16/entity.gif"; //$NON-NLS-1$
-	public static final String ENTITYREFERENCEICON = "icons/full/obj16/entity_reference.gif"; //$NON-NLS-1$
-	public static final String FLDR_ATTLIST = "icons/full/obj16/folder_attlist_obj.gif"; //$NON-NLS-1$
-	public static final String FLDR_COMM = "icons/full/obj16/folder_comments_obj.gif"; //$NON-NLS-1$
-
-	public static final String FLDR_EL = "icons/full/obj16/fldr_el.gif"; //$NON-NLS-1$
-	public static final String FLDR_ENT = "icons/full/obj16/fldr_ent.gif"; //$NON-NLS-1$
-	public static final String FLDR_NOT = "icons/full/obj16/fldr_not.gif"; //$NON-NLS-1$
-	public static final String FLDR_UNREC = "icons/full/obj16/fldr_unrec.gif"; //$NON-NLS-1$
-
-	public static final String NEWHTMLFORM = "icons/full/obj16/genhtmform_wiz.gif"; //$NON-NLS-1$
-	public static final String NOTATIONICON = "icons/full/obj16/notation.gif"; //$NON-NLS-1$
-
-	public static final String ONECHOICEICON = "icons/full/obj16/onechoice.gif"; //$NON-NLS-1$
-
-	public static final String ONEICON = "icons/full/obj16/one.gif"; //$NON-NLS-1$
-	public static final String ONEORMORECHOICEICON = "icons/full/obj16/oneormorechoice.gif"; //$NON-NLS-1$
-	public static final String ONEORMOREICON = "icons/full/obj16/oneormore.gif"; //$NON-NLS-1$
-	public static final String ONEORMORESEQUENCEICON = "icons/full/obj16/oneormoresequence.gif"; //$NON-NLS-1$
-
-	public static final String ONESEQUENCEICON = "icons/full/obj16/onesequence.gif"; //$NON-NLS-1$
-	public static final String OPTIONALCHOICEICON = "icons/full/obj16/optionalchoice.gif"; //$NON-NLS-1$
-	public static final String OPTIONALICON = "icons/full/obj16/optional.gif"; //$NON-NLS-1$
-	public static final String OPTIONALSEQUENCEICON = "icons/full/obj16/optionalsequence.gif"; //$NON-NLS-1$
-	public static final String PCDATAICON = "icons/full/obj16/txtext.gif"; //$NON-NLS-1$
-	public static final String UNRECOGNIZEDICON = "icons/full/obj16/unrecognized_content.gif"; //$NON-NLS-1$
-	public static final String ZEROORMORECHOICEICON = "icons/full/obj16/zeroormorechoice.gif"; //$NON-NLS-1$
-	public static final String ZEROORMOREICON = "icons/full/obj16/zeroormore.gif"; //$NON-NLS-1$
-	public static final String ZEROORMORESEQUENCEICON = "icons/full/obj16/zeroormoresequence.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Element.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Element.java
deleted file mode 100644
index 04904e5..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Element.java
+++ /dev/null
@@ -1,205 +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.dtd.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.w3c.dom.Node;
-
-
-public class Element extends NamedTopLevelNode {
-
-	List attListList = new ArrayList();
-
-	List attributes = new ArrayList();
-
-	protected CMNode fContentModel;
-
-	public Element(DTDFile dtdFile, IStructuredDocumentRegion flatNode) {
-		super(dtdFile, flatNode, DTDRegionTypes.ELEMENT_TAG);
-	}
-
-	public void addAttribute(String name) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_ELEMENT_ADD_ATTR); //$NON-NLS-1$
-		List attLists = getAttributeLists();
-		if (attLists.size() == 0) {
-			getDTDFile().createAttributeList(this, getName(), true);
-			attLists = getAttributeLists();
-		}
-		if (attLists.size() > 0) {
-			AttributeList attList = (AttributeList) attLists.get(attLists.size() - 1);
-			attList.addAttribute(name);
-		}
-		endRecording(this);
-	}
-
-	public void addChild() {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_ELEMENT_ADD_CHILD); //$NON-NLS-1$
-		addContent(this, " EMPTY"); //$NON-NLS-1$
-		endRecording(this);
-	}
-
-	protected void addContent(Object requestor, String content) {
-		ITextRegion whitespace = getWhitespaceAfterName();
-		int startOffset = 0;
-		int length = 0;
-		if (whitespace != null) {
-			startOffset = getStructuredDTDDocumentRegion().getStartOffset(whitespace);
-			length = whitespace.getLength() >= 2 ? 1 : 0;
-		}
-		else {
-			ITextRegion nameRegion = getNameRegion();
-			if (nameRegion != null) {
-				startOffset = getStructuredDTDDocumentRegion().getEndOffset(nameRegion);
-			}
-			else {
-				ITextRegion elementTag = getNextRegion(iterator(), DTDRegionTypes.ELEMENT_TAG);
-				startOffset = getStructuredDTDDocumentRegion().getEndOffset(elementTag);
-			}
-		}
-		replaceText(requestor, startOffset, length, content);
-	}
-
-	public void addGroup() {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_ELEMENT_ADD_GRP); //$NON-NLS-1$
-		addContent(this, " ()"); //$NON-NLS-1$
-		endRecording(this);
-	}
-
-	public Node cloneNode(boolean deep) {
-		return new Element(dtdFile, flatNode);
-	}
-
-	public List getAttributeLists() {
-		attListList.clear();
-		String elementName = getName();
-		Iterator iter = dtdFile.getNodes().iterator();
-		while (iter.hasNext()) {
-			DTDNode node = (DTDNode) iter.next();
-			if (node instanceof AttributeList && node.getName().equals(elementName)) {
-				attListList.add(node);
-			}
-		}
-		return attListList;
-	}
-
-
-
-	public CMNode getContentModel() {
-		// Object[] children = getChildren()
-		return (CMNode) getFirstChild();// contentModel;
-	}
-
-	public List getElementAttributes() {
-		attributes.clear();
-		Iterator attLists = getAttributeLists().iterator();
-		while (attLists.hasNext()) {
-			AttributeList attList = (AttributeList) attLists.next();
-
-			Object[] children = attList.getChildren();
-			for (int i = 0; i < children.length; i++) {
-				attributes.add(children[i]);
-			}
-		}
-		return attributes;
-	}
-
-	public Image getImage() {
-		return DTDCorePlugin.getInstance().getImage(DTDResource.ELEMENTICON);
-	}
-
-	public short getNodeType() {
-		return Node.ELEMENT_NODE;
-	}
-
-	public void replaceContentModel(Object requestor, CMNode node) {
-		replaceContentModel(requestor, node.getNodeText());
-	}
-
-	public void replaceContentModel(Object requestor, String nodeText) {
-		int offset = 0;
-		int length = 0;
-		CMNode contentModel = getContentModel();
-		if (contentModel != null) {
-			offset = contentModel.getStartOffset();
-			length = contentModel.getWhitespaceEndOffset() - offset;
-			replaceText(requestor, offset, length, nodeText);
-		}
-		else {
-			addContent(requestor, nodeText);
-		}
-	}
-
-	public void resolveRegions() {
-		// System.out.println("element node stream = " +
-		// tokenStream.getString());
-		fContentModel = null;
-		removeChildNodes();
-		RegionIterator iter = iterator();
-
-		if (getNameRegion() != null) {
-			// we skip past the name token is our name
-			skipPastName(iter);
-		}
-
-		while (iter.hasNext()) {
-			ITextRegion currentRegion = iter.next();
-
-			if (fContentModel == null) {
-				if (currentRegion.getType().equals(DTDRegionTypes.NAME)) {
-					fContentModel = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
-				}
-				else if (currentRegion.getType().equals(DTDRegionTypes.CONTENT_PCDATA)) {
-					fContentModel = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
-				}
-				else if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
-					fContentModel = new CMGroupNode(getDTDFile(), getStructuredDTDDocumentRegion());
-				}
-			}
-
-			if (fContentModel != null) {
-				if (!currentRegion.getType().equals(DTDRegionTypes.END_TAG)) {
-					// content model gets all regions except for the '>'
-					fContentModel.addRegion(currentRegion);
-				}
-				else {
-					// if it is equal to the end tag, then don't add anymore
-					// regions
-					// for the content model
-					break;
-				}
-
-			}
-
-		}
-		if (fContentModel != null) {
-			appendChild(fContentModel);
-			// this is the root element content so set it true
-			fContentModel.setRootElementContent(true);
-			// now tell the content model to resolve it's regions
-			fContentModel.resolveRegions();
-
-		}
-	}
-
-	public void setContentModel(CMNode contentModel) {
-		this.fContentModel = contentModel;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Entity.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Entity.java
deleted file mode 100644
index 2ed2f42..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Entity.java
+++ /dev/null
@@ -1,333 +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.dtd.core.internal;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-// external node contains code to help set and get public ids
-public class Entity extends ExternalNode {
-
-	private static String setExternalEntity = DTDCoreMessages._UI_LABEL_ENTITY_SET_EXT_ENTITY; //$NON-NLS-1$
-	private static String setGeneralEntity = DTDCoreMessages._UI_LABEL_ENTITY_SET_GENERAL_ENTITY; //$NON-NLS-1$
-	private static String setInternalEntity = DTDCoreMessages._UI_LABEL_ENTITY_SET_INT_ENTITY; //$NON-NLS-1$
-
-	private static String setParameterEntity = DTDCoreMessages._UI_LABEL_ENTITY_SET_PARM_ENTITY; //$NON-NLS-1$
-
-	public Entity(DTDFile file, IStructuredDocumentRegion flatNode) {
-		super(file, flatNode, DTDRegionTypes.ENTITY_TAG);
-	}
-
-	public Image getImage() {
-		return DTDCorePlugin.getInstance().getImage(DTDResource.ENTITYICON);
-	}
-
-
-	/**
-	 * Get the value of notationName.
-	 * 
-	 * @return value of notationName.
-	 */
-	public String getNotationName() {
-		ITextRegion ndataRegion = getNextRegion(iterator(), DTDRegionTypes.NDATA_VALUE);
-		if (ndataRegion != null) {
-			return getStructuredDTDDocumentRegion().getText(ndataRegion);
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	public ITextRegion getPercentRegion() {
-		return getNextRegion(iterator(), DTDRegionTypes.PERCENT);
-	}
-
-	/**
-	 * Get the value of value.
-	 * 
-	 * @return value of value.
-	 */
-	public String getValue() {
-		if (!isExternalEntity()) {
-			ITextRegion valueRegion = getNextQuotedLiteral(iterator());
-			if (valueRegion != null) {
-				return getValueFromQuotedRegion(valueRegion);
-			}
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	/**
-	 * Get the value of externalEntity.
-	 * 
-	 * @return value of externalEntity.
-	 */
-	public boolean isExternalEntity() {
-		return getPublicKeywordRegion(iterator()) != null || getSystemKeywordRegion(iterator()) != null;
-	}
-
-	/**
-	 * Get the value of isParameterEntity.
-	 * 
-	 * @return value of isParameterEntity.
-	 */
-	public boolean isParameterEntity() {
-		return getPercentRegion() != null;
-	}
-
-	private void removeNData(Object requestor) {
-		ITextRegion ndataRegion = null;
-
-		// see if we have an NDATA keyword
-		ndataRegion = getNextRegion(iterator(), DTDRegionTypes.NDATA_KEYWORD);
-		int startOffset = 0, endOffset = 0;
-		if (ndataRegion != null) {
-			startOffset = getStructuredDTDDocumentRegion().getStartOffset(ndataRegion);
-			endOffset = getStructuredDTDDocumentRegion().getEndOffset(ndataRegion);
-		}
-		ITextRegion value = getNextRegion(iterator(), DTDRegionTypes.NDATA_VALUE);
-		if (value != null) {
-			if (startOffset == 0) {
-				startOffset = getStructuredDTDDocumentRegion().getStartOffset(value);
-			}
-			endOffset = getStructuredDTDDocumentRegion().getEndOffset(value);
-		}
-		replaceText(requestor, startOffset, endOffset - startOffset, ""); //$NON-NLS-1$
-	}
-
-	/**
-	 * Set the value of externalEntity.
-	 * 
-	 * @param v
-	 *            Value to assign to externalEntity.
-	 */
-	public void setExternalEntity(boolean isExternalEntity) {
-		if (isExternalEntity() != isExternalEntity) {
-			// externalEntity = v;
-			beginRecording(this, isExternalEntity ? setExternalEntity : setInternalEntity);
-			if (isExternalEntity) {
-				// we need to get rid of the value literal
-				ITextRegion quote = getNextRegion(iterator(), DTDRegionTypes.SINGLEQUOTED_LITERAL);
-				if (quote == null) {
-					quote = getNextRegion(iterator(), DTDRegionTypes.DOUBLEQUOTED_LITERAL);
-				}
-				if (quote != null) {
-					replaceText(this, getStructuredDTDDocumentRegion().getStartOffset(quote), quote.getLength(), ""); //$NON-NLS-1$
-				}
-				setSystemID(""); //$NON-NLS-1$
-			}
-			else {
-				// we need to get rid of text between end of name region and
-				// the last double quoted literal
-				RegionIterator iter = iterator();
-				ITextRegion keyword = getSystemKeywordRegion(iter);
-				int startOffset = 0;
-				int length = 0;
-				if (keyword == null) {
-					// reset the iterator
-					iter = iterator();
-					keyword = getPublicKeywordRegion(iter);
-				}
-				if (keyword != null) {
-					startOffset = getStructuredDTDDocumentRegion().getStartOffset(keyword);
-					// start with a length just equal to the keyword for now
-					length = keyword.getLength();
-				}
-				else {
-					// reset the iterator since we didn't find the keyword
-					iter = iterator();
-					// just go from after the name
-					startOffset = getStructuredDTDDocumentRegion().getEndOffset(getNameRegion());
-				}
-
-				// now that we have the start, look for the end
-				ITextRegion lastRegion = null;
-
-				if (lastRegion == null) {
-					// then look for last quoted literal
-					while (iter.hasNext()) {
-						ITextRegion literal = getNextQuotedLiteral(iter);
-						if (literal != null) {
-							lastRegion = literal;
-						}
-					}
-				}
-
-				if (lastRegion != null) {
-					length = getStructuredDTDDocumentRegion().getEndOffset(lastRegion) - startOffset;
-				}
-				replaceText(this, startOffset, length, "\"\""); //$NON-NLS-1$
-				removeNData(this);
-			}
-			endRecording(this);
-		}
-	}
-
-	public void setNotationName(Object requestor, String newNotation) {
-		if (!getNotationName().equals(newNotation)) {
-			if (!newNotation.equals("")) { //$NON-NLS-1$
-				// 
-				ITextRegion ndataRegion = getNextRegion(iterator(), DTDRegionTypes.NDATA_VALUE);
-				if (ndataRegion != null) {
-					replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(ndataRegion), ndataRegion.getLength(), newNotation);
-				}
-				else {
-					// time to create one
-					int startOffset = 0;
-					String string = ""; //$NON-NLS-1$
-					RegionIterator iter = iterator();
-					ITextRegion ndataKeyword = getNextRegion(iter, DTDRegionTypes.NDATA_KEYWORD);
-					if (ndataKeyword == null) {
-						// we'll need to create one after the last quoted
-						// literal
-						// Reset iterator
-						string += " NDATA "; //$NON-NLS-1$
-						iter = iterator();
-						ITextRegion lastQuotedLiteral = null;
-						while (iter.hasNext()) {
-							ITextRegion literal = getNextQuotedLiteral(iter);
-							if (literal != null) {
-								lastQuotedLiteral = literal;
-							}
-						}
-						if (lastQuotedLiteral != null) {
-							startOffset = getStructuredDTDDocumentRegion().getEndOffset(lastQuotedLiteral);
-						}
-						else {
-							// created after the system or public keyword
-							ITextRegion keyword = getPublicKeywordRegion(iterator());
-							if (keyword == null) {
-								keyword = getSystemKeywordRegion(iterator());
-							}
-							// we shouldn't be null here since we check if we
-							// were external already
-							startOffset = getStructuredDTDDocumentRegion().getEndOffset(keyword);
-						}
-
-					}
-					else {
-						startOffset = getStructuredDTDDocumentRegion().getEndOffset(ndataKeyword);
-					}
-					replaceText(requestor, startOffset, 0, string + newNotation);
-				}
-			}
-			else {
-				// need to remove the ndata stuff
-				removeNData(requestor);
-			}
-		}
-	}
-
-	/**
-	 * Set the value of notationName.
-	 * 
-	 * @param newNotation
-	 *            Value to assign to notationName.
-	 */
-	public void setNotationName(String newNotation) {
-		beginRecording(this, "NDATA " + DTDCoreMessages._UI_LABEL_ENTITY_NDATA_CHANGE); //$NON-NLS-1$ //$NON-NLS-2$
-		setNotationName(this, newNotation);
-		endRecording(this);
-	}
-
-	/**
-	 * Set the value of isParameterEntity.
-	 * 
-	 * @param v
-	 *            Value to assign to isParameterEntity.
-	 */
-	public void setParameterEntity(boolean v) {
-		if (isParameterEntity() != v) {
-			beginRecording(this, v ? setParameterEntity : setGeneralEntity);
-			if (v) {
-				RegionIterator iter = iterator();
-				ITextRegion startTag = getNextRegion(iter, DTDRegionTypes.ENTITY_TAG);
-				int startOffset = 0, length = 0;
-
-				if (iter.hasNext()) {
-					ITextRegion region = iter.next();
-					startOffset = getStructuredDTDDocumentRegion().getStartOffset(region);
-					if (region.getType() == DTDRegionTypes.WHITESPACE && region.getLength() > 1) {
-						length = 1;
-					}
-				}
-				else {
-					startOffset = getStructuredDTDDocumentRegion().getEndOffset(startTag);
-				}
-				replaceText(this, startOffset, length, " %"); //$NON-NLS-1$
-				// now get rid of any NData since it is only allowed if the
-				// entity is a general entity and not a parameter entity
-				removeNData(this);
-			}
-			else {
-				// get rid of percent region
-				ITextRegion percentRegion = getPercentRegion();
-				replaceText(this, getStructuredDTDDocumentRegion().getStartOffset(percentRegion), percentRegion.getLength(), ""); //$NON-NLS-1$
-			}
-
-			endRecording(this);
-		}
-	}
-
-	/**
-	 * Set the value of value.
-	 * 
-	 * @param v
-	 *            Value to assign to value.
-	 */
-	public void setValue(Object requestor, String v) {
-		if (!isExternalEntity()) {
-			if (!getValue().equals(v)) {
-				// then it makes sense to change the value
-				ITextRegion valueRegion = getNextQuotedLiteral(iterator());
-				String quoteChar = v.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-				if (valueRegion != null) {
-					replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(valueRegion), valueRegion.getLength(), quoteChar + v + quoteChar);
-				}
-				else {
-					int startOffset = 0;
-					RegionIterator iter = iterator();
-					ITextRegion region = getNextRegion(iter, DTDRegionTypes.NAME);
-					if (region == null) {
-						// create it after the percent if there is one
-						region = getPercentRegion();
-					}
-					if (region == null) {
-						// if still null, then create it after the element tag
-						region = getStartTag(iterator());
-					}
-
-					if (region != null) {
-						startOffset = getStructuredDTDDocumentRegion().getEndOffset(region);
-						replaceText(requestor, startOffset, 0, quoteChar + v + quoteChar);
-					}
-				}
-			}
-		}
-	}
-
-	/**
-	 * Set the value of value.
-	 * 
-	 * @param v
-	 *            Value to assign to value.
-	 */
-	public void setValue(String v) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_ENTITY_VALUE_CHG); //$NON-NLS-1$
-		setValue(this, v);
-		endRecording(this);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ExternalNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ExternalNode.java
deleted file mode 100644
index bcf709d..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ExternalNode.java
+++ /dev/null
@@ -1,250 +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.dtd.core.internal;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-// base class for nodes that can contain external content
-public abstract class ExternalNode extends NamedTopLevelNode {
-
-	String publicID;
-
-	String systemID;
-
-	public ExternalNode(DTDFile file, IStructuredDocumentRegion flatNode, String tagType) {
-		super(file, flatNode, tagType);
-	}
-
-	public ITextRegion getNextQuotedLiteral(RegionIterator iter) {
-		while (iter.hasNext()) {
-			ITextRegion region = iter.next();
-			if (region.getType().equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || region.getType().equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
-				return region;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Get the value of publicID.
-	 * 
-	 * @return value of publicID.
-	 */
-	public String getPublicID() {
-		ITextRegion publicValue = getPublicValueRegion();
-		if (publicValue != null) {
-			return getValueFromQuotedRegion(publicValue);
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	public ITextRegion getPublicKeywordRegion(RegionIterator iter) {
-		return getNextRegion(iter, DTDRegionTypes.PUBLIC_KEYWORD);
-	}
-
-	public ITextRegion getPublicValueRegion() {
-		RegionIterator iter = iterator();
-
-		ITextRegion publicKeyword = getPublicKeywordRegion(iter);
-
-		if (publicKeyword != null && iter.hasNext()) {
-			ITextRegion quotedLiteral = getNextQuotedLiteral(iter);
-			if (quotedLiteral != null) {
-				return quotedLiteral;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Get the value of systemID.
-	 * 
-	 * @return value of systemID.
-	 */
-	public String getSystemID() {
-		ITextRegion systemValue = getSystemValueRegion();
-		if (systemValue != null) {
-			return getValueFromQuotedRegion(systemValue);
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	public ITextRegion getSystemKeywordRegion(RegionIterator iter) {
-		return getNextRegion(iter, DTDRegionTypes.SYSTEM_KEYWORD);
-	}
-
-	public ITextRegion getSystemValueRegion() {
-		RegionIterator iter = iterator();
-
-		ITextRegion systemKeyword = getSystemKeywordRegion(iter);
-		if (systemKeyword != null && iter.hasNext()) {
-			ITextRegion quotedLiteral = getNextQuotedLiteral(iter);
-			if (quotedLiteral != null) {
-				return quotedLiteral;
-			}
-		}
-		else {
-			// try and see if there is a second quoted literal after a public
-			// keyword
-			iter = iterator();
-			ITextRegion publicKeyword = getPublicKeywordRegion(iter);
-
-			if (publicKeyword != null && iter.hasNext()) {
-				ITextRegion quotedLiteral = getNextQuotedLiteral(iter);
-				if (quotedLiteral != null && iter.hasNext()) {
-					// now get the second quoted literal
-					quotedLiteral = getNextQuotedLiteral(iter);
-					if (quotedLiteral != null) {
-						// got it!
-						return quotedLiteral;
-					}
-				}
-			}
-		}
-		return null;
-	}
-
-	public String getValueFromQuotedRegion(ITextRegion region) {
-		String type = region.getType();
-		if (type.equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || type.equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
-			String text = getStructuredDTDDocumentRegion().getText(region);
-			return text.substring(1, text.length() - 1);
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	/**
-	 * Set the value of publicID.
-	 * 
-	 * @param v
-	 *            Value to assign to publicID.
-	 */
-	public void setPublicID(Object requestor, String v) {
-		if (!v.equals(publicID)) {
-			publicID = v;
-			ITextRegion publicValue = getPublicValueRegion();
-			ITextRegion publicKeyword = getPublicKeywordRegion(iterator());
-			ITextRegion systemKeyword = getSystemKeywordRegion(iterator());
-			ITextRegion systemValue = getSystemValueRegion();
-
-			if (v.equals("")) { //$NON-NLS-1$
-				if (publicKeyword != null) {
-					// time to get rid of the public keyword and value
-					// and replace it with the system one
-					int startOffset = getStructuredDTDDocumentRegion().getStartOffset(publicKeyword);
-					String newString = "SYSTEM"; //$NON-NLS-1$
-					if (systemValue == null) {
-						newString += " \"\""; //$NON-NLS-1$
-					}
-					replaceText(requestor, startOffset, getStructuredDTDDocumentRegion().getEndOffset(publicValue) - startOffset, newString);
-				}
-			}
-			else {
-				// here were setting a non empty value
-				String quoteChar = v.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-				if (publicValue != null) {
-					replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(publicValue), publicValue.getLength(), quoteChar + publicID + quoteChar);
-				}
-				else {
-					// time to create stuff
-					if (publicKeyword != null) {
-						// then just put our new value after the keyword
-						replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(publicKeyword), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
-					}
-					else {
-						// we need the public keyword as well
-						if (systemKeyword != null) {
-							replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(systemKeyword), systemKeyword.getLength(), "PUBLIC " + quoteChar + v + quoteChar); //$NON-NLS-1$
-						}
-						else {
-							ITextRegion nameRegion = getNameRegion();
-							replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(nameRegion), 0, " PUBLIC " + quoteChar + v + quoteChar); //$NON-NLS-1$
-						}
-					}
-				}
-			}
-		}
-	}
-
-
-	/**
-	 * Set the value of publicID.
-	 * 
-	 * @param v
-	 *            Value to assign to publicID.
-	 */
-	public void setPublicID(String v) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_EXT_NODE_PUBLIC_ID_CHG); //$NON-NLS-1$
-		setPublicID(this, v);
-		endRecording(this);
-	}
-
-	/**
-	 * Set the value of systemID.
-	 * 
-	 * @param v
-	 *            Value to assign to systemID.
-	 */
-	public void setSystemID(Object requestor, String v) {
-		if (!v.equals(systemID) || (getPublicKeywordRegion(iterator()) == null && getSystemKeywordRegion(iterator()) == null)) {
-			systemID = v;
-			String quoteChar = v.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			ITextRegion systemValue = getSystemValueRegion();
-			if (systemValue != null) {
-				replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(systemValue), systemValue.getLength(), quoteChar + systemID + quoteChar);
-			}
-			else {
-				ITextRegion systemKeyword = getSystemKeywordRegion(iterator());
-
-				// time to create stuff
-				if (systemKeyword != null) {
-					// then just put our new value after the keyword
-					replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(systemKeyword), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
-				}
-				else {
-					// see if we have a public keyword
-					ITextRegion publicKeyword = getPublicKeywordRegion(iterator());
-					if (publicKeyword == null) {
-						ITextRegion nameRegion = getNameRegion();
-
-						replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(nameRegion), 0, " SYSTEM " + quoteChar + v + quoteChar); //$NON-NLS-1$
-					}
-					else {
-						// put it after the public value region
-						ITextRegion publicValueRegion = getPublicValueRegion();
-						replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(publicValueRegion), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
-					}
-
-				}
-			}
-
-		}
-	}
-
-
-	/**
-	 * Set the value of systemID.
-	 * 
-	 * @param v
-	 *            Value to assign to systemID.
-	 */
-	public void setSystemID(String v) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_EXT_NODE_SYSTEM_ID_CHG); //$NON-NLS-1$
-		setSystemID(this, v);
-		endRecording(this);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Logger.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Logger.java
deleted file mode 100644
index 39c11cb..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Logger.java
+++ /dev/null
@@ -1,143 +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.dtd.core.internal;
-
-import java.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.dtd.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;
-		}
-		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 (!isDebugging())
-			return;
-
-		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)) {
-					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;
-				}
-			}
-		}
-	}
-
-	/**
-	 * @return true if the platform is debugging
-	 */
-	public static boolean isDebugging() {
-		return Platform.inDebugMode();
-	}
-
-	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.dtd.core/src/org/eclipse/wst/dtd/core/internal/NamedTopLevelNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/NamedTopLevelNode.java
deleted file mode 100644
index a230cd2..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/NamedTopLevelNode.java
+++ /dev/null
@@ -1,135 +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.dtd.core.internal;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-// interface for nodes that can exist at the top level in a dtdfile
-// eg. entity, notation, element, comment, attlist, or unrecognized stuff (ie
-// <junk dkfjdl>
-public abstract class NamedTopLevelNode extends TopLevelNode {
-
-	private String tagStartType;
-
-	public NamedTopLevelNode(DTDFile dtdFile, IStructuredDocumentRegion flatNode, String type) {
-		super(dtdFile, flatNode);
-		tagStartType = type;
-	}
-
-	public ITextRegion getNameRegion() {
-		// name region is located after the whitespace (which is after
-		// the elementtag
-		RegionIterator iter = iterator();
-		getNextRegion(iter, tagStartType);
-
-		if (!iter.hasNext()) {
-			return null;
-		}
-
-		ITextRegion region = iter.next();
-		if (!region.getType().equals(DTDRegionTypes.WHITESPACE)) {
-			return null;
-		}
-
-		if (!iter.hasNext()) {
-			return null;
-		}
-
-		region = iter.next();
-		if (region.getType().equals(DTDRegionTypes.NAME)) {
-			return region;
-		}
-
-		// we normally stop here, but for entities, we have to see if we are
-		// at a '%'. if so, we skip that and find the name after the
-		// whitespace again
-		if (tagStartType == DTDRegionTypes.ENTITY_TAG && region.getType().equals(DTDRegionTypes.PERCENT) && iter.hasNext()) {
-			region = iter.next();
-
-			if (!region.getType().equals(DTDRegionTypes.WHITESPACE)) {
-				return null;
-			}
-
-			if (!iter.hasNext()) {
-				return null;
-			}
-
-			region = iter.next();
-			if (region.getType().equals(DTDRegionTypes.NAME)) {
-				return region;
-			}
-		}
-
-		return null;
-	}
-
-	public ITextRegion getStartTag(RegionIterator iter) {
-		return getNextRegion(iter, tagStartType);
-	}
-
-	public ITextRegion getWhitespaceAfterName() {
-		ITextRegion nameRegion = getNameRegion();
-		RegionIterator iter = iterator();
-		// skip past the element tag region
-		getNextRegion(iter, tagStartType);
-		boolean foundName = false;
-		while (iter.hasNext()) {
-			ITextRegion region = iter.next();
-			if (!foundName && nameRegion != null && region == nameRegion) {
-				foundName = true;
-			}
-
-			if (region.getType().equals(DTDRegionTypes.WHITESPACE)) {
-				// there is no name region or we have already passed it
-				if (nameRegion == null || foundName) {
-					return region;
-				}
-			}
-		}
-		return null;
-	}
-
-	public void setName(Object requestor, String name) {
-		ITextRegion nameRegion = getNameRegion();
-		if (nameRegion != null) {
-			super.setName(requestor, name);
-		}
-		else {
-			RegionIterator iter = iterator();
-			ITextRegion elementTagRegion = getNextRegion(iter, tagStartType);
-			int replaceLength = 0;
-			if (iter.hasNext()) {
-				ITextRegion region = iter.next();
-				if (region.getType().equals(DTDRegionTypes.WHITESPACE)) {
-					if (region.getLength() >= 2) {
-						// there are 2 spaces between 'ELEMENT' and the
-						// content
-						// Change replace length to 1 so that the new name and
-						// the content are separated by a single space
-						replaceLength = 1;
-					}
-				}
-			}
-
-			// beginRecording(requestor, "Name Change");
-			String newText = " " + name; //$NON-NLS-1$
-			replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(elementTagRegion), replaceLength, newText);
-			// endRecording(requestor);
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/NodeList.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/NodeList.java
deleted file mode 100644
index ba84128..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/NodeList.java
+++ /dev/null
@@ -1,109 +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.dtd.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-
-
-public class NodeList {
-	protected DTDFile dtdFile;
-
-	ArrayList listNodes = new ArrayList();
-
-	protected String listType;
-
-	public NodeList(DTDFile dtdFile, String tokenType) {
-		listType = tokenType;
-		this.dtdFile = dtdFile;
-	}
-
-	public Image getImage() {
-		if (listType == DTDRegionTypes.ELEMENT_TAG) {
-			return DTDCorePlugin.getInstance().getImage(DTDResource.FLDR_EL);
-		}
-		else if (listType == DTDRegionTypes.ENTITY_TAG) {
-			return DTDCorePlugin.getInstance().getImage(DTDResource.FLDR_ENT);
-		}
-		else if (listType == DTDRegionTypes.NOTATION_TAG) {
-			return DTDCorePlugin.getInstance().getImage(DTDResource.FLDR_NOT);
-		}
-		else if (listType == DTDRegionTypes.COMMENT_START) {
-			return DTDCorePlugin.getInstance().getImage(DTDResource.FLDR_COMM);
-		}
-		else if (listType == DTDRegionTypes.ATTLIST_TAG) {
-			return DTDCorePlugin.getInstance().getImage(DTDResource.FLDR_ATTLIST);
-		}
-		else if (listType == DTDRegionTypes.UNKNOWN_CONTENT) {
-			return DTDCorePlugin.getInstance().getImage(DTDResource.FLDR_UNREC);
-		}
-		else
-			return null;
-	}
-
-	public String getListType() {
-		return listType;
-	}
-
-	public String getName() {
-		if (listType == DTDRegionTypes.ELEMENT_TAG) {
-			return DTDCoreMessages._UI_LABEL_NODE_LIST_ELEMENTS; //$NON-NLS-1$
-		}
-		else if (listType == DTDRegionTypes.ENTITY_TAG) {
-			return DTDCoreMessages._UI_LABEL_NODE_LIST_ENTITIES; //$NON-NLS-1$
-		}
-		else if (listType == DTDRegionTypes.NOTATION_TAG) {
-			return DTDCoreMessages._UI_LABEL_NODE_LIST_NOTATIONS; //$NON-NLS-1$
-		}
-		else if (listType == DTDRegionTypes.COMMENT_START) {
-			return DTDCoreMessages._UI_LABEL_NODE_LIST_COMMENTS; //$NON-NLS-1$
-		}
-		else if (listType == DTDRegionTypes.ATTLIST_TAG) {
-			return DTDCoreMessages._UI_LABEL_NODE_LIST_ATTRIBUTES; //$NON-NLS-1$
-		}
-		else if (listType == DTDRegionTypes.UNKNOWN_CONTENT) {
-			return DTDCoreMessages._UI_LABEL_NODE_LIST_OTHER; //$NON-NLS-1$
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	public ArrayList getNodes() {
-		listNodes.clear();
-		Iterator iter = dtdFile.getNodes().iterator();
-		while (iter.hasNext()) {
-			DTDNode node = (DTDNode) iter.next();
-			if (listType == DTDRegionTypes.ELEMENT_TAG && (node instanceof Element || node instanceof ParameterEntityReference)) {
-				listNodes.add(node);
-			}
-			else if (listType == DTDRegionTypes.ATTLIST_TAG && node instanceof AttributeList) {
-				listNodes.add(node);
-			}
-			else if (listType == DTDRegionTypes.ENTITY_TAG && node instanceof Entity) {
-				listNodes.add(node);
-			}
-			else if (listType == DTDRegionTypes.NOTATION_TAG && node instanceof Notation) {
-				listNodes.add(node);
-			}
-			else if (listType == DTDRegionTypes.COMMENT_START && node instanceof Comment) {
-				listNodes.add(node);
-			}
-			else if (listType == DTDRegionTypes.UNKNOWN_CONTENT && node instanceof Unrecognized) {
-				listNodes.add(node);
-			}
-		}
-		return listNodes;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Notation.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Notation.java
deleted file mode 100644
index e9a1ac5..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Notation.java
+++ /dev/null
@@ -1,29 +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.dtd.core.internal;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-
-public class Notation extends ExternalNode {
-
-	public Notation(DTDFile file, IStructuredDocumentRegion flatNode) {
-		super(file, flatNode, DTDRegionTypes.NOTATION_TAG);
-	}
-
-	public Image getImage() {
-		return DTDCorePlugin.getInstance().getImage(DTDResource.NOTATIONICON);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ParameterEntityReference.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ParameterEntityReference.java
deleted file mode 100644
index cd51a05..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ParameterEntityReference.java
+++ /dev/null
@@ -1,112 +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.dtd.core.internal;
-
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public class ParameterEntityReference extends NamedTopLevelNode {
-
-
-
-	public class StartEndPair {
-		public int startOffset, endOffset;
-	}
-
-	private Entity cachedEntity = null;
-
-	public ParameterEntityReference(DTDFile file, IStructuredDocumentRegion flatNode) {
-		super(file, flatNode, DTDRegionTypes.COMMENT_START);
-	}
-
-	public Entity getEntityObject() {
-		if (cachedEntity != null && !cachedEntity.getName().equals(getReferencedEntity())) {
-			// if we have a cached entity, but the name doesnt match,
-			// null it now, so we perform a lookup
-			cachedEntity = null;
-		}
-
-		if (cachedEntity == null) {
-			List nodes = getDTDFile().getNodes();
-			for (int i = 0; i < nodes.size(); i++) {
-				DTDNode node = (DTDNode) nodes.get(i);
-				if (node instanceof Entity) {
-					Entity entity = (Entity) node;
-					if (entity.isParameterEntity() && entity.getName().equals(getReferencedEntity())) {
-						cachedEntity = entity;
-					}
-				}
-			}
-		}
-		return cachedEntity;
-	}
-
-	public Image getImage() {
-		return DTDCorePlugin.getInstance().getImage(DTDResource.ENTITYREFERENCEICON);
-	}
-
-	public String getName() {
-		return getStructuredDTDDocumentRegion().getText();
-	}
-
-	public String getReferencedEntity() {
-		String text = getName();
-		return getName().substring(1, text.length() - 1);
-	}
-
-	private void getStartAndEndOffsetForText(StartEndPair pair) {
-		RegionIterator iter = iterator();
-		ITextRegion commentStartTag = getStartTag(iter);
-		ITextRegion endCommentTag = getNextRegion(iter, DTDRegionTypes.COMMENT_END);
-		pair.endOffset = getStructuredDTDDocumentRegion().getEndOffset();
-		if (commentStartTag != null) {
-			pair.startOffset = getStructuredDTDDocumentRegion().getEndOffset(commentStartTag);
-		}
-		if (endCommentTag != null) {
-			pair.endOffset = getStructuredDTDDocumentRegion().getEndOffset(endCommentTag);
-		}
-	}
-
-	public String getText() {
-		String text = getStructuredDTDDocumentRegion().getText();
-		int flatNodeStart = getStructuredDTDDocumentRegion().getStartOffset();
-		StartEndPair pair = new StartEndPair();
-		getStartAndEndOffsetForText(pair);
-		return text.substring(pair.startOffset - flatNodeStart, pair.endOffset - flatNodeStart);
-	}
-
-	public void setReferencedEntity(Object requestor, String name) {
-		replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(), getStructuredDTDDocumentRegion().getLength(), "%" + name + ";"); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	public void setReferencedEntity(String name) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_PARM_ENTITY_REF_CHG_ENTITY_REF); //$NON-NLS-1$
-		setReferencedEntity(this, name);
-		endRecording(this);
-	}
-
-	public void setText(String newText) {
-		beginRecording(this, DTDCoreMessages._UI_LABEL_PARM_ENTITY_REF_COMMENT_CHG); //$NON-NLS-1$
-		StartEndPair pair = new StartEndPair();
-		getStartAndEndOffsetForText(pair);
-		replaceText(this, pair.startOffset, pair.endOffset - pair.startOffset, newText);
-		endRecording(this);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/TopLevelNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/TopLevelNode.java
deleted file mode 100644
index 9ff2c8b..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/TopLevelNode.java
+++ /dev/null
@@ -1,84 +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.dtd.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-// interface for nodes that can exist at the top level in a dtdfile
-// eg. entity, notation, element, comment, attlist, or unrecognized stuff (ie
-// <junk dkfjdl>
-public abstract class TopLevelNode extends DTDNode {
-
-	private ArrayList flatNodes = new ArrayList();
-
-	public TopLevelNode(DTDFile dtdFile, IStructuredDocumentRegion flatNode) {
-		super(dtdFile, flatNode);
-		flatNodes.add(flatNode);
-	}
-
-	public void addWhitespaceStructuredDocumentRegion(IStructuredDocumentRegion node) {
-		flatNodes.add(node);
-	}
-
-	// specialize this so we delete the objects flat node range
-	// AND any whitespace
-	public void delete() {
-		beginRecording(getDTDFile(), DTDCoreMessages._UI_LABEL_TOP_LEVEL_NODE_DELETE); //$NON-NLS-1$
-		IStructuredDocumentRegion first = (IStructuredDocumentRegion) flatNodes.get(0);
-		IStructuredDocumentRegion last = (IStructuredDocumentRegion) flatNodes.get(flatNodes.size() - 1);
-		int startOffset = first.getStartOffset();
-		int endOffset = last.getEndOffset();
-
-		replaceText(getDTDFile(), startOffset, endOffset - startOffset, ""); //$NON-NLS-1$
-		endRecording(getDTDFile());
-	}
-
-	public ITextRegion getEndRegion() {
-		int size = flatNode.getRegions().size();
-		if (size > 0) {
-			return flatNode.getRegions().get(size - 1);
-		}
-		return null;
-	}
-
-	// includes what gettext gives us plus any whitespace
-	// trailing it
-	public String getFullText() {
-		StringBuffer sb = new StringBuffer();
-		Iterator iter = flatNodes.iterator();
-		while (iter.hasNext()) {
-			IStructuredDocumentRegion fNode = (IStructuredDocumentRegion) iter.next();
-			sb.append(fNode.getText());
-		}
-		return sb.toString();
-	}
-
-	public ITextRegion getStartRegion() {
-		if (flatNode.getRegions().size() > 0) {
-			return flatNode.getRegions().get(0);
-		}
-		return null;
-	}
-
-	public RegionIterator iterator() {
-		// System.out.println("create region iter " + this.getClass() + " with
-		// start , end = " + getStartOffset() + ", " +getEndOffset());
-		return new RegionIterator(flatNode, getStartOffset(), getEndOffset());
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Unrecognized.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Unrecognized.java
deleted file mode 100644
index b144b4f..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Unrecognized.java
+++ /dev/null
@@ -1,39 +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.dtd.core.internal;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-
-public class Unrecognized extends TopLevelNode {
-
-	public Unrecognized(DTDFile file, IStructuredDocumentRegion flatNode) {
-		super(file, flatNode);
-	}
-
-	public Image getImage() {
-		return DTDCorePlugin.getInstance().getImage(DTDResource.UNRECOGNIZEDICON);
-	}
-
-	public String getName() {
-		String text = getStructuredDTDDocumentRegion().getText();
-		if (text.length() <= 30) {
-			return text;
-		}
-		else {
-			return text.substring(0, 29) + "..."; //$NON-NLS-1$
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/content/ContentDescriberForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/content/ContentDescriberForDTD.java
deleted file mode 100644
index 0fad934..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/content/ContentDescriberForDTD.java
+++ /dev/null
@@ -1,211 +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.dtd.core.internal.content;
-
-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;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLResourceEncodingDetector;
-
-
-
-public final class ContentDescriberForDTD implements ITextContentDescriber {
-	final private static QualifiedName[] SUPPORTED_OPTIONS = {IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK, IContentDescriptionExtended.DETECTED_CHARSET, IContentDescriptionExtended.UNSUPPORTED_CHARSET, IContentDescriptionExtended.APPROPRIATE_DEFAULT};
-	private IResourceCharsetDetector resourceCharsetDetector;
-
-	public int describe(InputStream contents, IContentDescription description) throws IOException {
-		int result = IContentDescriber.INDETERMINATE;
-
-		if (description == null) {
-			result = computeValidity(contents);
-		}
-		else {
-			calculateSupportedOptions(contents, description);
-			result = computeValidity(contents);
-		}
-		return result;
-	}
-
-	public int describe(Reader contents, IContentDescription description) throws IOException {
-		int result = IContentDescriber.INDETERMINATE;
-
-		if (description == null) {
-			result = computeValidity(contents);
-		}
-		else {
-			calculateSupportedOptions(contents, description);
-			result = computeValidity(contents);
-		}
-		return result;
-	}
-
-	public QualifiedName[] getSupportedOptions() {
-
-		return SUPPORTED_OPTIONS;
-	}
-
-	private void calculateSupportedOptions(InputStream contents, IContentDescription description) throws IOException {
-		if (isRelevent(description)) {
-			IResourceCharsetDetector detector = getDetector();
-			detector.set(contents);
-			handleCalculations(description, detector);
-		}
-	}
-
-	/**
-	 * @param contents
-	 * @param description
-	 * @throws IOException
-	 */
-	private void calculateSupportedOptions(Reader contents, IContentDescription description) throws IOException {
-		if (isRelevent(description)) {
-			IResourceCharsetDetector detector = getDetector();
-			detector.set(contents);
-			handleCalculations(description, detector);
-		}
-	}
-
-	private int computeValidity(InputStream inputStream) {
-		// currently no specific check for validilty
-		// based on contents.
-		return IContentDescriber.INDETERMINATE;
-	}
-
-	private int computeValidity(Reader reader) {
-		// currently no specific check for validilty
-		// based on contents.
-		return IContentDescriber.INDETERMINATE;
-	}
-
-	// same rules as for XML
-	private IResourceCharsetDetector getDetector() {
-		if (resourceCharsetDetector == null) {
-			resourceCharsetDetector = new XMLResourceEncodingDetector();
-		}
-		return resourceCharsetDetector;
-	}
-
-	/**
-	 * @param description
-	 * @param detector
-	 * @throws IOException
-	 */
-	private void handleCalculations(IContentDescription description, IResourceCharsetDetector detector) throws IOException {
-		// note: if we're asked for one, we set them all. I need to be sure if
-		// called
-		// mulitiple times (one for each, say) that we don't waste time
-		// processing same
-		// content again.
-		EncodingMemento encodingMemento = ((XMLResourceEncodingDetector) detector).getEncodingMemento();
-		// 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 default.the
-				Object defaultCharset = getDetector().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, I'm assuming
-					description.setProperty(IContentDescription.CHARSET, javaCharset);
-				}
-			}
-		}
-
-	}
-
-	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;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/document/DTDModelImpl.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/document/DTDModelImpl.java
deleted file mode 100644
index 799eb70..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/document/DTDModelImpl.java
+++ /dev/null
@@ -1,273 +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.dtd.core.internal.document;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.NodeList;
-import org.eclipse.wst.dtd.core.internal.event.IDTDFileListener;
-import org.eclipse.wst.dtd.core.internal.event.NodesEvent;
-import org.eclipse.wst.dtd.core.internal.provisional.document.DTDModel;
-import org.eclipse.wst.dtd.core.internal.util.DTDReferenceUpdater;
-import org.eclipse.wst.dtd.core.internal.util.LabelValuePair;
-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.StructuredDocumentEvent;
-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;
-
-
-public final class DTDModelImpl extends AbstractStructuredModel implements IStructuredDocumentListener, DTDModel {
-
-	public static boolean deleteFile(String fileName) {
-		boolean result = false;
-
-		// create the temp File object
-		File file = new File(fileName);
-		if (file.exists())
-			result = file.delete();
-		return result;
-	}
-
-	private DTDFile document;
-
-	// private List errorMessages = new ArrayList();
-
-	// entity reference names found in the conditional IGNORE sections
-	private Vector ignoredEntityRefs;
-
-	private boolean refreshRequired = false;
-
-	protected DTDReferenceUpdater refUpdater = new DTDReferenceUpdater();
-
-	public DTDModelImpl() {
-		super();
-		document = new DTDFile(this);
-		document.addDTDFileListener(new IDTDFileListener() {
-
-			public void nodeChanged(DTDNode node) {
-				if (node instanceof Entity) {
-					Entity entity = (Entity) node;
-					if (entity.isParameterEntity() && entity.isExternalEntity()) {
-						// just say they have changed for now
-						setReferencedModelsChanged();
-					}
-				}
-			}
-
-			public void nodesAdded(NodesEvent event) {
-				checkIfExternalReferencesChanged(event);
-			}
-
-			public void nodesRemoved(NodesEvent event) {
-				checkIfExternalReferencesChanged(event);
-			}
-		});
-	}
-
-	public void beginRecording(Object requester, String label) {
-		super.beginRecording(requester, label);
-		// clear reference updater cache
-		getReferenceUpdater().clearCache();
-	}
-
-	void checkIfExternalReferencesChanged(NodesEvent event) {
-		Iterator iter = event.getNodes().iterator();
-		while (iter.hasNext()) {
-			DTDNode node = (DTDNode) iter.next();
-			if (node instanceof Entity) {
-				Entity entity = (Entity) node;
-				if (entity.isParameterEntity() && entity.isExternalEntity()) {
-					// just say they have changed for now
-					setReferencedModelsChanged();
-				}
-			}
-		}
-	}
-
-	//
-	// The following function helps determine the list of things that
-	// can be used in a parameter entity reference content
-	// Optional parameter is to allow the currently used DTDEntity to
-	// be included in the combobox.
-	//
-	public LabelValuePair[] createParmEntityContentItems(Entity entity) {
-		NodeList entities = getDTDFile().getEntities();
-
-		Vector items = new Vector();
-
-		if (entity != null) {
-			String name = "%" + entity.getName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
-			items.addElement(new LabelValuePair(name, name));
-		}
-
-		for (Iterator i = entities.getNodes().iterator(); i.hasNext();) {
-			Entity entityAt = (Entity) i.next();
-			if (entityAt.isParameterEntity() && entityAt.isExternalEntity()) {
-				String name = "%" + entityAt.getName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
-				items.addElement(new LabelValuePair(name, name));
-			}
-		}
-		LabelValuePair[] comboArray = new LabelValuePair[items.size()];
-		items.copyInto(comboArray);
-		return comboArray;
-	}
-
-	public void endRecording(Object requester) {
-		super.endRecording(requester);
-		// clear reference updater cache
-		getReferenceUpdater().clearCache();
-	}
-
-
-	public DTDFile getDTDFile() {
-		return document;
-	}
-
-	// Returns entity reference names that are in
-	// the conditional IGNORE sections.
-	public Vector getIgnoredEntityRefs() {
-		if (ignoredEntityRefs == null)
-			ignoredEntityRefs = new Vector();
-		return ignoredEntityRefs;
-	}
-
-	public IndexedRegion getIndexedRegion(int offset) {
-		if (this.document == null)
-			return null;
-		// System.out.println("getNode at " + offset + " returning = " +
-		// this.document.getNodeAt(offset));
-
-		return this.document.getNodeAt(offset);
-	}
-
-	public DTDReferenceUpdater getReferenceUpdater() {
-		return refUpdater;
-	}
-
-	public boolean isReferencedModelsChanged() {
-		return refreshRequired;
-	}
-
-	public boolean isRefreshRequired() {
-		return refreshRequired;
-	}
-
-	public void newModel(NewDocumentEvent flatModelEvent) {
-		document.newModel(flatModelEvent);
-		// System.out.println("\nnewmodel");
-		outputStructuredDocument(flatModelEvent);
-	}
-
-	public void noChange(NoChangeEvent flatModelEvent) {
-		// System.out.println("\nnochange");
-		outputStructuredDocument(flatModelEvent);
-
-	}
-
-	public void nodesReplaced(StructuredDocumentRegionsReplacedEvent flatModelEvent) {
-		// System.out.println("\nnodesreplaced");
-		document.nodesReplaced(flatModelEvent);
-		outputStructuredDocument(flatModelEvent);
-
-	}
-
-	public void outputStructuredDocument(StructuredDocumentEvent flatModelEvent) {
-		// System.out.println("structuredDocument source = '" +
-		// flatModelEvent.getStructuredDocument().getText() + "'");
-		// System.out.println("new String = '" +
-		// flatModelEvent.getOriginalChanges() +"'");
-		// System.out.println("deleted String = '" +
-		// flatModelEvent.getDeletedText() +"'");
-		// Enumeration e =
-		// flatModelEvent.getStructuredDocument().getNodes().elements();
-		// int i = 0;
-		// for (; e.hasMoreElements(); i++)
-		// {
-		// BasicStructuredDocumentRegion node =
-		// (BasicStructuredDocumentRegion) e.nextElement();
-		// outputStructuredDocumentRegion(node);
-		// System.out.println(" " + i +". " + node.hashCode() + " '"
-		// +node.getText() + "'");
-		// }
-	}
-
-	public void outputStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		// int size = flatNode.getNumberOfRegions();
-		// for (int i = 0; i < size; i++)
-		// {
-		// Region region = (Region) flatNode.getRegions().get(i);
-		// System.out.println(i + ". " + region.getType());
-
-		// } // end of for ()
-
-	}
-
-	public void regionChanged(RegionChangedEvent flatModelEvent) {
-		// System.out.println("\nregion changed");
-		document.regionChanged(flatModelEvent);
-		// System.out.println("= " +
-		// flatModelEvent.getStructuredDocumentRegion().getText());
-		// System.out.println("region changed " +
-		// flatModelEvent.getRegion().hashCode() + " = " +
-		// flatModelEvent.getRegion());
-
-		outputStructuredDocument(flatModelEvent);
-	}
-
-	public void regionsReplaced(RegionsReplacedEvent flatModelEvent) {
-		// System.out.println("\nregion replaced");
-		document.regionsReplaced(flatModelEvent);
-		outputStructuredDocument(flatModelEvent);
-	}
-
-	public void setReferencedModelsChanged() {
-		refreshRequired = true;
-	}
-
-	public void setRefreshRequired(boolean value) {
-		refreshRequired = value;
-	}
-
-
-	/**
-	 * @param newStructuredDocument
-	 *            org.eclipse.wst.sse.core.text.IStructuredDocument
-	 */
-	public void setStructuredDocument(IStructuredDocument newStructuredDocument) {
-		IStructuredDocument oldStructuredDocument = super.getStructuredDocument();
-		if (newStructuredDocument == oldStructuredDocument)
-			return; // noting to do
-
-		if (oldStructuredDocument != null)
-			oldStructuredDocument.removeDocumentChangingListener(this);
-		super.setStructuredDocument(newStructuredDocument);
-		if (newStructuredDocument != null) {
-			if (newStructuredDocument.getLength() > 0) {
-				newModel(new NewDocumentEvent(newStructuredDocument, this));
-			}
-			newStructuredDocument.addDocumentChangingListener(this);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/AbstractResourceEncodingDetector.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/AbstractResourceEncodingDetector.java
deleted file mode 100644
index 07937e3..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/AbstractResourceEncodingDetector.java
+++ /dev/null
@@ -1,261 +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.dtd.core.internal.encoding;
-
-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;
-
-	/**
-	 * 
-	 */
-	private 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.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/ByteReader.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/ByteReader.java
deleted file mode 100644
index 1550a62..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/ByteReader.java
+++ /dev/null
@@ -1,109 +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.dtd.core.internal.encoding;
-
-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) {
-		this.fInputStream = inputStream;
-		if (!inputStream.markSupported()) {
-			throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
-		}
-		this.fBuffer = new byte[size];
-
-	}
-
-	public void close() throws IOException {
-		this.fInputStream.close();
-	}
-
-	public void mark(int readAheadLimit) {
-		this.fInputStream.mark(readAheadLimit);
-	}
-
-	public boolean markSupported() {
-		return true;
-	}
-
-	public int read() throws IOException {
-		int b0 = this.fInputStream.read();
-		return (b0 & 0x00FF);
-	}
-
-	public int read(char ch[], int offset, int length) throws IOException {
-		if (length > this.fBuffer.length) {
-			length = this.fBuffer.length;
-		}
-
-		int count = this.fInputStream.read(this.fBuffer, 0, length);
-
-		for (int i = 0; i < count; i++) {
-			int b0 = this.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 this.fInputStream.available() > 0;
-	}
-
-	public void reset() throws IOException {
-		this.fInputStream.reset();
-	}
-
-	public long skip(long n) throws IOException {
-		return this.fInputStream.skip(n);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentCharsetDetector.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentCharsetDetector.java
deleted file mode 100644
index 11ae9f8..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentCharsetDetector.java
+++ /dev/null
@@ -1,61 +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
- *     
- *******************************************************************************/
-/*
- * Created on 28-Aug-03
- * 
- * 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.dtd.core.internal.encoding;
-
-import java.io.IOException;
-
-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;
-import org.eclipse.wst.xml.core.internal.encoding.XMLDocumentCharsetDetector;
-
-
-/**
- * @author kboo
- * 
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-public final class DTDDocumentCharsetDetector extends AbstractResourceEncodingDetector implements IDocumentCharsetDetector {
-
-	public String getSpecDefaultEncoding() {
-		// by default, UTF-8 as per XML spec
-		final String enc = "UTF-8"; //$NON-NLS-1$
-		return enc;
-	}
-
-	/**
-	 * 
-	 */
-
-	protected void parseInput() throws IOException {
-		IDocumentCharsetDetector documentEncodingDetector = new XMLDocumentCharsetDetector();
-		documentEncodingDetector.set(fReader);
-		fEncodingMemento = ((XMLResourceEncodingDetector)documentEncodingDetector).getEncodingMemento();
-
-	}
-
-	public void set(IDocument document) {
-		set(new DocumentReader(document, 0));
-
-
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentLoader.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentLoader.java
deleted file mode 100644
index 9ab8cc2..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentLoader.java
+++ /dev/null
@@ -1,64 +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.dtd.core.internal.encoding;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionParser;
-import org.eclipse.wst.dtd.core.internal.text.DTDStructuredDocumentReParser;
-import org.eclipse.wst.dtd.core.internal.text.StructuredTextPartitionerForDTD;
-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.StructuredDocumentFactory;
-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;
-
-
-public final class DTDDocumentLoader extends AbstractDocumentLoader {
-
-	public DTDDocumentLoader() {
-		super();
-	}
-
-	public IDocumentPartitioner getDefaultDocumentPartitioner() {
-		return new StructuredTextPartitionerForDTD();
-	}
-
-	public IDocumentCharsetDetector getDocumentEncodingDetector() {
-		if (fDocumentEncodingDetector == null) {
-			fDocumentEncodingDetector = new DTDDocumentCharsetDetector();
-		}
-		return fDocumentEncodingDetector;
-	}
-
-	public RegionParser getParser() {
-		return new DTDRegionParser();
-	}
-
-	protected String getSpecDefaultEncoding() {
-		String enc = "UTF-8"; //$NON-NLS-1$
-		return enc;
-	}
-
-	protected IEncodedDocument newEncodedDocument() {
-		IStructuredDocument document = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
-		DTDStructuredDocumentReParser reParser = new DTDStructuredDocumentReParser();
-		reParser.setStructuredDocument(document);
-		if (document instanceof BasicStructuredDocument) {
-			((BasicStructuredDocument) document).setReParser(reParser);
-		}
-		return document;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/NullMemento.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/NullMemento.java
deleted file mode 100644
index 0cd01fc..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/NullMemento.java
+++ /dev/null
@@ -1,36 +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.dtd.core.internal.encoding;
-
-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.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/IDTDFileListener.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/IDTDFileListener.java
deleted file mode 100644
index fe29fb5..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/IDTDFileListener.java
+++ /dev/null
@@ -1,24 +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.dtd.core.internal.event;
-
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-
-public interface IDTDFileListener {
-
-	public void nodeChanged(DTDNode node);
-
-	public void nodesAdded(NodesEvent event);
-
-	public void nodesRemoved(NodesEvent event);
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/NodesEvent.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/NodesEvent.java
deleted file mode 100644
index 89974e8..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/NodesEvent.java
+++ /dev/null
@@ -1,32 +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.dtd.core.internal.event;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-
-
-public final class NodesEvent {
-	private ArrayList changedNodes = new ArrayList();
-
-	public void add(DTDNode changedNode) {
-		changedNodes.add(changedNode);
-	}
-
-	public List getNodes() {
-		return changedNodes;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/DTDModelLoader.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/DTDModelLoader.java
deleted file mode 100644
index 8db31f0..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/DTDModelLoader.java
+++ /dev/null
@@ -1,47 +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.dtd.core.internal.modelhandler;
-
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.encoding.DTDDocumentLoader;
-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.IStructuredModel;
-
-
-
-public final class DTDModelLoader extends AbstractModelLoader {
-	public DTDModelLoader() {
-		super();
-	}
-
-	public IDocumentLoader getDocumentLoader() {
-		if (documentLoaderInstance == null) {
-			documentLoaderInstance = new DTDDocumentLoader();
-		}
-		return documentLoaderInstance;
-	}
-
-	public IModelLoader newInstance() {
-		return new DTDModelLoader();
-	}
-
-	public IStructuredModel newModel() {
-		IStructuredModel model = new DTDModelImpl();
-		// now done in create
-		// model.setStructuredDocument(createNewStructuredDocument());
-		// model.setFactoryRegistry(defaultFactoryRegistry());
-		return model;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/ModelHandlerForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/ModelHandlerForDTD.java
deleted file mode 100644
index b17a55a..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/ModelHandlerForDTD.java
+++ /dev/null
@@ -1,46 +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.dtd.core.internal.modelhandler;
-
-import org.eclipse.wst.dtd.core.internal.encoding.DTDDocumentCharsetDetector;
-import org.eclipse.wst.dtd.core.internal.encoding.DTDDocumentLoader;
-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;
-
-
-public final class ModelHandlerForDTD extends AbstractModelHandler implements IModelHandler {
-	private static String AssociatedContentTypeId = "org.eclipse.wst.dtd.core.dtdsource"; //$NON-NLS-1$
-	private static String ModelHandlerID = "org.eclipse.wst.dtd.core.internal.modelhandler"; //$NON-NLS-1$
-
-	public ModelHandlerForDTD() {
-		super();
-		setId(ModelHandlerID);
-		setAssociatedContentTypeId(AssociatedContentTypeId);
-	}
-
-	public IDocumentLoader getDocumentLoader() {
-		return new DTDDocumentLoader();
-	}
-
-	public IDocumentCharsetDetector getEncodingDetector() {
-		return new DTDDocumentCharsetDetector();
-	}
-
-	public IModelLoader getModelLoader() {
-		return new DTDModelLoader();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionFactory.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionFactory.java
deleted file mode 100644
index 2b018b1..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionFactory.java
+++ /dev/null
@@ -1,28 +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.dtd.core.internal.parser;
-
-import org.eclipse.wst.sse.core.internal.parser.ContextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-public class DTDRegionFactory {
-	public static ITextRegion createRegion(String tokenKind, int start, int length) {
-		ITextRegion region = null;
-		if (tokenKind != null) {
-			// ISSUE: DTD regions don't distinguish text from white space
-			region = new ContextRegion(tokenKind, start, length, length);
-		}
-		return region;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionParser.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionParser.java
deleted file mode 100644
index 553ea59..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionParser.java
+++ /dev/null
@@ -1,271 +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.dtd.core.internal.parser;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.wst.dtd.core.internal.text.DTDStructuredDocumentRegionFactory;
-import org.eclipse.wst.dtd.core.internal.tokenizer.DTDTokenizer;
-import org.eclipse.wst.dtd.core.internal.tokenizer.Token;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public class DTDRegionParser implements RegionParser {
-	private Vector cachedRegions = null;
-	private DTDTokenizer tokenizer = null;
-	private IStructuredDocumentRegion cachedNode = null; // top of node
-															// chain
-
-	public RegionParser newInstance() {
-		return new DTDRegionParser();
-	}
-
-	private IStructuredDocumentRegion addNewNodes(IStructuredDocumentRegion lastNode, Vector regions) {
-		IStructuredDocumentRegion leadingSpaceNode = null;
-		IStructuredDocumentRegion contentNode = null;
-		IStructuredDocumentRegion trailingSpaceNode = null;
-		LinkedList nodeSeeds = new LinkedList();
-		int nRegions = regions.size();
-		int leadingSpaceEnd = -1;
-		int trailingSpaceBegin = nRegions;
-
-		// find leading space
-		nodeSeeds.clear();
-		for (int i = 0; i < nRegions; i++) {
-			ITextRegion region = (ITextRegion) regions.get(i);
-			String type = region.getType();
-			if (isBlankRegion(type)) {
-				leadingSpaceEnd = i;
-				nodeSeeds.addLast(region);
-			}
-			else {
-				break;
-			}
-		}
-		if (!nodeSeeds.isEmpty()) {
-			leadingSpaceNode = createNode(nodeSeeds);
-			if (lastNode != null) {
-				lastNode.setNext(leadingSpaceNode);
-				leadingSpaceNode.setPrevious(lastNode);
-			}
-			lastNode = leadingSpaceNode;
-		}
-
-		// find trailing space
-		if (leadingSpaceEnd < nRegions - 1) {
-			nodeSeeds.clear();
-			for (int i = nRegions - 1; 0 <= i; i--) {
-				ITextRegion region = (ITextRegion) regions.get(i);
-				String type = ((ITextRegion) regions.get(i)).getType();
-				if (isBlankRegion(type)) {
-					trailingSpaceBegin = i;
-					nodeSeeds.addFirst(region);
-				}
-				else {
-					break;
-				}
-			}
-			if (!nodeSeeds.isEmpty()) {
-				trailingSpaceNode = createNode(nodeSeeds);
-			}
-
-			nodeSeeds.clear();
-			for (int i = leadingSpaceEnd + 1; i < trailingSpaceBegin; i++) {
-				nodeSeeds.addLast(regions.get(i));
-			}
-			if (!nodeSeeds.isEmpty()) {
-				contentNode = createNode(nodeSeeds);
-				if (lastNode != null) {
-					lastNode.setNext(contentNode);
-					contentNode.setPrevious(lastNode);
-				}
-				lastNode = contentNode;
-			}
-			if (trailingSpaceNode != null) {
-				lastNode.setNext(trailingSpaceNode);
-				trailingSpaceNode.setPrevious(lastNode);
-				lastNode = trailingSpaceNode;
-			}
-		}
-
-		return lastNode;
-	}
-
-	private IStructuredDocumentRegion createNode(LinkedList regions) {
-		if (regions.size() == 0) {
-			return null;
-		}
-
-		IStructuredDocumentRegion node = DTDStructuredDocumentRegionFactory.createStructuredDocumentRegion(DTDStructuredDocumentRegionFactory.DTD_GENERIC);
-		int start = ((ITextRegion) regions.getFirst()).getStart();
-		int length = ((ITextRegion) regions.getLast()).getEnd() - start;
-		node.setStart(start);
-		node.setLength(length);
-		for (ListIterator i = regions.listIterator(0); i.hasNext();) {
-			ITextRegion region = (ITextRegion) i.next();
-			node.addRegion(region);
-			region.adjustStart(-start);
-		}
-		node.setEnded(true);
-
-		return node;
-	}
-
-	private IStructuredDocumentRegion createNodeChain(List regions) {
-		IStructuredDocumentRegion headNode = null;
-		IStructuredDocumentRegion lastNode = null;
-		Vector nodeSeeds = new Vector();
-
-		for (Iterator e = regions.iterator(); e.hasNext();) {
-			ITextRegion region = (ITextRegion) e.next();
-			String type = region.getType();
-			// If the following regions appear,
-			// a previous node is closed in front of it.
-			if (!nodeSeeds.isEmpty() && isBeginningRegion(type)) {
-				lastNode = addNewNodes(lastNode, nodeSeeds);
-				nodeSeeds.clear();
-			}
-			nodeSeeds.addElement(region);
-
-			// The following regions close the current node.
-			if (!nodeSeeds.isEmpty() && isEndingRegion(type)) {
-				lastNode = addNewNodes(lastNode, nodeSeeds);
-				nodeSeeds.clear();
-			}
-
-			if (headNode == null && lastNode != null) {
-				headNode = findFirstNode(lastNode);
-			}
-		}
-
-		// close current node forcibly.
-		if (!nodeSeeds.isEmpty()) {
-			lastNode = addNewNodes(lastNode, nodeSeeds);
-			if (headNode == null && lastNode != null) {
-				headNode = findFirstNode(lastNode);
-			}
-		}
-		return headNode;
-	}
-
-	private IStructuredDocumentRegion findFirstNode(IStructuredDocumentRegion node) {
-		IStructuredDocumentRegion firstNode = node;
-		IStructuredDocumentRegion prevNode = null;
-		while ((prevNode = firstNode.getPrevious()) != null) {
-			firstNode = prevNode;
-		}
-		return firstNode;
-	}
-
-	public IStructuredDocumentRegion getDocumentRegions() {
-		if (cachedNode != null) {
-			return cachedNode;
-		}
-
-		List regions = getRegions();
-		IStructuredDocumentRegion headNode = createNodeChain(regions);
-		cachedNode = headNode;
-
-		return headNode;
-	}
-
-	public List getRegions() {
-		if (cachedRegions != null) {
-			return cachedRegions;
-		}
-
-		Vector regions = new Vector();
-		Token currentToken = null;
-		do {
-			try {
-				currentToken = (Token) tokenizer.yylex();
-				if (currentToken != null) {
-					ITextRegion region = DTDRegionFactory.createRegion(currentToken.getType(), currentToken.getStartOffset(), currentToken.getLength());
-					regions.add(region);
-				}
-			}
-			catch (java.io.FileNotFoundException e) {
-				System.out.println("File not found"); //$NON-NLS-1$
-			}
-			catch (java.io.IOException e) {
-				System.out.println("Error opening file"); //$NON-NLS-1$
-			}
-		}
-		while (currentToken != null);
-
-		cachedRegions = regions;
-		return regions;
-	}
-
-	public void reset(Reader reader) {
-		if (tokenizer == null) {
-			try {
-				tokenizer = new DTDTokenizer(reader);
-			}
-			catch (ArrayIndexOutOfBoundsException e) {
-				System.out.println("Usage : java DTDTokenizer <inputfile>"); //$NON-NLS-1$
-			}
-		}
-		else {
-			try {
-				tokenizer.yyreset(reader);
-			}
-			catch (java.io.IOException e) {
-				System.out.println("Error opening file"); //$NON-NLS-1$
-			}
-		}
-
-		cachedNode = null;
-		cachedRegions = null;
-	}
-
-	/**
-	 * An additional offset for use with any position-dependant parsing rules
-	 */
-	public void reset(Reader reader, int offset) {
-		reset(reader);
-	}
-
-	public void reset(String input) {
-		reset(new StringReader(input));
-	}
-
-	public void reset(String input, int offset) {
-		reset(input);
-	}
-
-	// never used
-	DTDTokenizer getTokenizer() {
-		return tokenizer;
-	}
-
-	private boolean isBeginningRegion(String type) {
-		return (type == DTDRegionTypes.START_TAG) || (type == DTDRegionTypes.ENTITY_PARM);
-	}
-
-	private boolean isBlankRegion(String type) {
-		return (type == DTDRegionTypes.WHITESPACE);
-	}
-
-	private boolean isEndingRegion(String type) {
-		return (type == DTDRegionTypes.END_TAG) || (type == DTDRegionTypes.ENTITY_PARM) || (type == DTDRegionTypes.COMMENT_END);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionTypes.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionTypes.java
deleted file mode 100644
index 50ecd6b..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionTypes.java
+++ /dev/null
@@ -1,76 +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.dtd.core.internal.parser;
-
-public interface DTDRegionTypes {
-	public static final String regionPrefix = "org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes."; //$NON-NLS-1$
-
-	public static final String NAME = regionPrefix + "NAME"; //$NON-NLS-1$
-	public static final String START_TAG = regionPrefix + "START_TAG"; //$NON-NLS-1$
-	public static final String END_TAG = regionPrefix + "END_TAG"; //$NON-NLS-1$
-	public static final String LEFT_PAREN = regionPrefix + "LEFT_PAREN"; //$NON-NLS-1$
-	public static final String RIGHT_PAREN = regionPrefix + "RIGHT_PAREN"; //$NON-NLS-1$
-	public static final String WHITESPACE = regionPrefix + "WHITESPACE"; //$NON-NLS-1$
-	public static final String CONNECTOR = regionPrefix + "CONNECTOR"; //$NON-NLS-1$
-
-	public static final String OCCUR_TYPE = regionPrefix + "OCCUR_TYPE"; //$NON-NLS-1$
-	public static final String EXCLAMATION = regionPrefix + "EXCLAMATION"; //$NON-NLS-1$
-	public static final String PERCENT = regionPrefix + "PERCENT"; //$NON-NLS-1$
-	public static final String SEMICOLON = regionPrefix + "SEMICOLON"; //$NON-NLS-1$
-	public static final String COMMENT_START = regionPrefix + "COMMENT"; //$NON-NLS-1$
-	public static final String COMMENT_CONTENT = regionPrefix + "COMMENT_CONTENT"; //$NON-NLS-1$
-	public static final String COMMENT_END = regionPrefix + "COMMENT_END"; //$NON-NLS-1$
-
-	public static final String NOTATION_TAG = regionPrefix + "NOTATION_TAG"; //$NON-NLS-1$
-	public static final String NOTATION_CONTENT = regionPrefix + "NOTATION_CONTENT"; //$NON-NLS-1$
-
-	public static final String ENTITY_TAG = regionPrefix + "ENTITY_TAG"; //$NON-NLS-1$
-	public static final String ENTITY_PARM = regionPrefix + "ENTITY_PARM"; //$NON-NLS-1$
-	public static final String ENTITY_CONTENT = regionPrefix + "ENTITY_CONTENT"; //$NON-NLS-1$
-	public static final String NDATA_VALUE = regionPrefix + "NDATA_VALUE"; //$NON-NLS-1$
-
-	public static final String ELEMENT_TAG = regionPrefix + "ELEMENT_TAG"; //$NON-NLS-1$
-	public static final String ELEMENT_CONTENT = regionPrefix + "ELEMENT_CONTENT"; //$NON-NLS-1$
-	public static final String CONTENT_EMPTY = regionPrefix + "CONTENT_EMPTY"; //$NON-NLS-1$
-	public static final String CONTENT_ANY = regionPrefix + "CONTENT_ANY"; //$NON-NLS-1$
-	public static final String CONTENT_PCDATA = regionPrefix + "CONTENT_PCDATA"; //$NON-NLS-1$
-
-	public static final String ATTLIST_TAG = regionPrefix + "ATTLIST_TAG"; //$NON-NLS-1$
-
-	public static final String SYSTEM_KEYWORD = regionPrefix + "SYSTEM_KEYWORD"; //$NON-NLS-1$
-	public static final String PUBLIC_KEYWORD = regionPrefix + "PUBLIC_KEYWORD"; //$NON-NLS-1$
-	public static final String NDATA_KEYWORD = regionPrefix + "NDATA_KEYWORD"; //$NON-NLS-1$
-	public static final String SINGLEQUOTED_LITERAL = regionPrefix + "SINGLEQUOTED_LITERAL"; //$NON-NLS-1$
-	public static final String DOUBLEQUOTED_LITERAL = regionPrefix + "DOUBLEQUOTED_LITERAL"; //$NON-NLS-1$
-	public static final String UNKNOWN_CONTENT = regionPrefix + "UNKNOWN_CONTENT"; //$NON-NLS-1$
-
-	public static final String ATTRIBUTE_NAME = regionPrefix + "ATTRIBUTE_NAME"; //$NON-NLS-1$
-
-	// attribute type keywords
-	public static final String CDATA_KEYWORD = regionPrefix + "CDATA_KEYWORD"; //$NON-NLS-1$
-	public static final String ID_KEYWORD = regionPrefix + "ID_KEYWORD"; //$NON-NLS-1$
-	public static final String IDREF_KEYWORD = regionPrefix + "IDREF_KEYWORD"; //$NON-NLS-1$
-	public static final String IDREFS_KEYWORD = regionPrefix + "IDREFS_KEYWORD"; //$NON-NLS-1$
-	public static final String ENTITY_KEYWORD = regionPrefix + "ENTITY_KEYWORD"; //$NON-NLS-1$
-	public static final String ENTITIES_KEYWORD = regionPrefix + "ENTITIES_KEYWORD"; //$NON-NLS-1$
-	public static final String NMTOKEN_KEYWORD = regionPrefix + "NMTOKEN_KEYWORD"; //$NON-NLS-1$
-	public static final String NMTOKENS_KEYWORD = regionPrefix + "NMTOKENS_KEYWORD"; //$NON-NLS-1$
-	public static final String NOTATION_KEYWORD = regionPrefix + "NOTATION_KEYWORD"; //$NON-NLS-1$
-	public static final String ENUM_CHOICE = regionPrefix + "ENUM_CHOICE"; //$NON-NLS-1$
-	public static final String PARM_ENTITY_TYPE = regionPrefix + "PARM_ENTITY_TYPE"; //$NON-NLS-1$
-
-	// attribute defaults keywords
-	public static final String REQUIRED_KEYWORD = regionPrefix + "REQUIRED_KEYWORD"; //$NON-NLS-1$
-	public static final String IMPLIED_KEYWORD = regionPrefix + "IMPLIED_KEYWORD"; //$NON-NLS-1$
-	public static final String FIXED_KEYWORD = regionPrefix + "FIXED_KEYWORD"; //$NON-NLS-1$
-}// DTDRegionTypes
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/contenttype/ContentTypeIdForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/contenttype/ContentTypeIdForDTD.java
deleted file mode 100644
index 9795522..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/contenttype/ContentTypeIdForDTD.java
+++ /dev/null
@@ -1,47 +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
- *     
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.core.internal.provisional.contenttype;
-
-/**
- * <p>
- * This class, with its one field, is a convenience to provide compile-time
- * safety when referring to the DTD contentType ID.
- * </p>
- * 
- * <p>
- * This class is not meant to be instantiated or subclassed.
- * </p>
- */
-
-public final class ContentTypeIdForDTD {
-	/**
-	 * The value of the ContentTypeID_DTD id field will match what is
-	 * specified in org.eclipse.wst.dtd.core/plugin.xml for the DTD content
-	 * type.
-	 * 
-	 * This value is intentionally set through a default protected method so
-	 * that it will not be inlined.
-	 */
-	public final static String ContentTypeID_DTD = getConstantString();
-
-	private ContentTypeIdForDTD() {
-		super();
-	}
-
-	/**
-	 * @return the DTD Content Type Identifier ID as a String
-	 */
-	static String getConstantString() {
-		return "org.eclipse.wst.dtd.core.dtdsource"; //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/document/DTDModel.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/document/DTDModel.java
deleted file mode 100644
index 623ca49..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/document/DTDModel.java
+++ /dev/null
@@ -1,27 +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.dtd.core.internal.provisional.document;
-
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-/**
- * <p>
- * An interface implemented by the SSE-based DTD model.
- * </p>
- * 
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface DTDModel extends IStructuredModel{
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/text/IDTDPartitionTypes.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/text/IDTDPartitionTypes.java
deleted file mode 100644
index 1de8119..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/text/IDTDPartitionTypes.java
+++ /dev/null
@@ -1,24 +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.dtd.core.internal.provisional.text;
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partition types DTD.
- * Clients should reference the partition type Strings defined here directly.
- * 
- * @plannedfor 1.0
- */
-public interface IDTDPartitionTypes {
-	
-	String DTD_DEFAULT = "org.eclipse.wst.dtd.DEFAULT"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tasks/DTDFileTaskScanner.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tasks/DTDFileTaskScanner.java
deleted file mode 100644
index 7b3269e..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tasks/DTDFileTaskScanner.java
+++ /dev/null
@@ -1,28 +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.dtd.core.internal.tasks;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-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;
-
-public class DTDFileTaskScanner extends StructuredFileTaskScanner {
-	public DTDFileTaskScanner() {
-		super();
-	}
-
-	protected boolean isCommentRegion(IStructuredDocumentRegion region, ITextRegion textRegion) {
-		return textRegion.getType().equals(DTDRegionTypes.COMMENT_CONTENT);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentReParser.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentReParser.java
deleted file mode 100644
index 741b5b6..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentReParser.java
+++ /dev/null
@@ -1,41 +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.dtd.core.internal.text;
-
-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.IStructuredTextReParser;
-import org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser;
-
-
-public class DTDStructuredDocumentReParser extends StructuredDocumentReParser {
-
-	public StructuredDocumentEvent checkForCrossStructuredDocumentRegionBoundryCases() {
-		IStructuredDocumentRegion startNode = fStructuredDocument.getRegionAtCharacterOffset(fStart);
-		IStructuredDocumentRegion endNode = fStructuredDocument.getRegionAtCharacterOffset(fStart + fLengthToReplace - 1);
-		return reparse(startNode.getStart(), endNode.getEnd());
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser#newInstance()
-	 */
-	public IStructuredTextReParser newInstance() {
-		return new DTDStructuredDocumentReParser();
-	}
-
-	protected StructuredDocumentEvent reparse(IStructuredDocumentRegion dirtyStart, IStructuredDocumentRegion dirtyEnd) {
-		return super.reparse(dirtyStart, dirtyEnd);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentRegionFactory.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentRegionFactory.java
deleted file mode 100644
index e15b0e6..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentRegionFactory.java
+++ /dev/null
@@ -1,33 +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.dtd.core.internal.text;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocumentRegion;
-
-
-public class DTDStructuredDocumentRegionFactory {
-	public static final int DTD_GENERIC = 5;
-
-	public static IStructuredDocumentRegion createStructuredDocumentRegion(int type) {
-		IStructuredDocumentRegion instance = null;
-		switch (type) {
-			case DTD_GENERIC :
-				instance = new BasicStructuredDocumentRegion();
-				break;
-			default :
-				break;
-		}
-		return instance;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/RegionIterator.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/RegionIterator.java
deleted file mode 100644
index 7f7dcf7..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/RegionIterator.java
+++ /dev/null
@@ -1,84 +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.dtd.core.internal.text;
-
-import java.util.NoSuchElementException;
-
-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;
-
-
-public class RegionIterator {
-
-	private int currentIndex;
-
-	// private IStructuredDocumentRegion flatNode;
-	private ITextRegionList regions;
-	// private int startOffset, endOffset;
-	private ITextRegion startRegion, endRegion;
-
-	public RegionIterator(IStructuredDocumentRegion node) {
-		this(node, node.getStart(), node.getEnd());
-	}
-
-	public RegionIterator(IStructuredDocumentRegion node, int startOffset, int endOffset) {
-		regions = node.getRegions();
-		startRegion = node.getRegionAtCharacterOffset(startOffset);
-		endRegion = node.getRegionAtCharacterOffset(endOffset - 1);
-
-		for (int i = 0; i < regions.size(); i++) {
-			ITextRegion region = regions.get(i);
-			if (startRegion == region) {
-				currentIndex = i;
-				break;
-			}
-		}
-	}
-
-	public RegionIterator(ITextRegionList regions) {
-		this.regions = regions;
-		startRegion = regions.get(0);
-		endRegion = regions.get(regions.size() - 1);
-		currentIndex = 0;
-		// this(node, node.getStart(), node.getEnd());
-	}
-
-	public boolean hasNext() {
-		if (currentIndex < regions.size()) {
-			return currentIndex <= regions.indexOf(endRegion);
-		}
-		return false;
-	}
-
-	public boolean hasPrevious() {
-		if (currentIndex >= 0) {
-			return currentIndex >= regions.indexOf(startRegion);
-		}
-		return false;
-	}
-
-	public ITextRegion next() {
-		if (hasNext()) {
-			return regions.get(currentIndex++);
-		}
-		throw new NoSuchElementException();
-	}
-
-	public ITextRegion previous() {
-		if (hasPrevious()) {
-			return regions.get(--currentIndex);
-		}
-		throw new NoSuchElementException();
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java
deleted file mode 100644
index 0dadbc9..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java
+++ /dev/null
@@ -1,42 +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.dtd.core.internal.text;
-
-import org.eclipse.wst.dtd.core.internal.provisional.text.IDTDPartitionTypes;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
-import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-
-public class StructuredTextPartitionerForDTD extends StructuredTextPartitioner {
-
-	public StructuredTextPartitionerForDTD() {
-		super();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner#getDefault()
-	 */
-	public String getDefaultPartitionType() {
-		return IDTDPartitionTypes.DTD_DEFAULT;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner#initLegalContentTypes()
-	 */
-	protected void initLegalContentTypes() {
-		fSupportedTypes = new String[]{IDTDPartitionTypes.DTD_DEFAULT, IStructuredPartitionTypes.UNKNOWN_PARTITION};
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/DTDTokenizer.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/DTDTokenizer.java
deleted file mode 100644
index c2206b3..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/DTDTokenizer.java
+++ /dev/null
@@ -1,1091 +0,0 @@
-/* The following code was generated by JFlex 1.3.5 on 3/14/05 9:37 PM */
-
-/*******************************************************************************
- * 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
- *     
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.dtd.core.internal.tokenizer;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-
-/** 
- * Generate with "dtdskeleton".
- *
- * It removes some unused fields and avoids some compiler warnings 
- */
-
-
-/**
- * This class is a scanner generated by 
- * <a href="http://www.jflex.de/">JFlex</a> 1.3.5
- * on 3/14/05 9:37 PM from the specification file
- * <tt>file:/D:/eclipse.wtp/workspace/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtd.flex</tt>
- */
-public class DTDTokenizer {
-
-  /** This character denotes the end of file */
-  final public static int YYEOF = -1;
-
-  /** initial size of the lookahead buffer */
-  final private static int YY_BUFFERSIZE = 16384;
-
-  /** lexical states */
-  final public static int ATTRIBUTE_ENUMERATION = 13;
-  final public static int NOTATION_NAME = 6;
-  final public static int ELEMENT_CHILD = 1;
-  final public static int ENTITY_CONTENT = 4;
-  final public static int COMMENT_CONTENT = 8;
-  final public static int ATTLIST_NAME = 9;
-  final public static int EXTERNALID_CONTENT = 7;
-  final public static int ELEMENT_CONTENT = 1;
-  final public static int ELEMENT_MIXED = 1;
-  final public static int ELEMENT_MIXED_OR_CHILD = 1;
-  final public static int ATTRIBUTE_CONTENT = 11;
-  final public static int ENTITY_NAME = 3;
-  final public static int ATTRIBUTE_DEFAULT = 12;
-  final public static int ELEMENT_NAME = 2;
-  final public static int YYINITIAL = 0;
-  final public static int NDATA_CONTENT = 5;
-  final public static int ATTLIST_CONTENT = 10;
-  final public static int NODE = 1;
-
-  /** 
-   * Translates characters to character classes
-   */
-  final private static String yycmap_packed = 
-    "\10\0\1\0\1\5\1\3\1\0\1\0\1\2\22\0\1\5\1\6"+
-    "\1\1\1\37\1\0\1\23\1\0\1\46\1\42\1\43\1\4\1\7"+
-    "\1\45\1\12\1\0\1\0\12\0\1\0\1\10\1\11\1\0\1\13"+
-    "\1\4\1\0\1\25\1\31\1\32\1\33\1\14\1\35\2\0\1\21"+
-    "\1\0\1\36\1\15\1\16\1\17\1\24\1\27\1\40\1\34\1\26"+
-    "\1\20\1\30\2\0\1\41\1\22\1\0\1\0\1\0\2\0\1\0"+
-    "\1\0\32\0\1\0\1\44\uff83\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,    39,    78,   117,   156,   195,   234,   273,   312,   351, 
-      390,   429,   468,   507,   546,   585,   624,    39,    39,    39, 
-      663,   702,   741,   780,   819,    39,    39,   858,   897,    39, 
-       39,   936,   936,   975,  1014,  1053,  1092,  1131,  1170,  1209, 
-     1248,  1287,  1326,  1365,  1404,  1443,    39,  1482,  1521,  1560, 
-     1599,  1638,    39,  1677,  1716,  1755,  1794,  1833,  1872,    39, 
-       39,  1911,  1950,  1989,  2028,  2067,  2106,    39,    39,    39, 
-     2145,  2184,  2223,  2262,  2301,  2340,  2379,   897,  2418,   975, 
-     2457,  2496,  2535,  2574,   975,  2613,  2652,  2691,  2730,  1560, 
-     2769,  2808,  2847,  2886,  2925,  2964,  3003,  3042,  3081,  3120, 
-     1950,  3159,  3198,  3237,  3276,  3315,  1950,    39,  3354,  3393, 
-     3432,    39,  3471,  3510,  3549,    39,  3588,  3627,    39,  3666, 
-     3705,  3744,    39,    39,  3783,  3822,  3861,  3900,  3939,  3978, 
-     4017,  4056,    39,  4095,  4134,  4173,    39,  4212,  4251,  4290, 
-     4329,  4368,  4407,  4446,  4485,  4524,  4563,  4602,  4641,  4680, 
-     4719,  4758,  4797,  4836,  4875,  4914,  4953,  4992,  5031,  5070, 
-     5109,  5148,  5187,  5226,  5265,  5304,  5343,   975,  5382,  5421, 
-     5460,  5499,  5538,  5577,  1560,  5616,  5655,  5694,  5733,  5772, 
-     5811,  5850,   546,  5889,  5928,  5967,  6006,   975,   975,   975, 
-     6045,  1560,  6084,  6123,  1560,  6162,  6201,  6240,  1950,   546, 
-     6279,   546,   819,  6318,  6357,  6396,  6435,  6474,  6513,   546, 
-     6552,  1560,  1560,  1560,  1950,  6591,    39,  1950
-  };
-
-  /** 
-   * The packed transition table of the DFA (part 0)
-   */
-  final private static String yy_packed0 = 
-    "\2\17\2\20\1\17\1\20\1\21\1\17\1\22\1\23"+
-    "\1\17\1\24\1\25\2\17\1\26\3\17\1\27\1\17"+
-    "\1\30\21\17\47\0\2\31\2\20\1\32\1\20\1\0"+
-    "\1\32\1\31\1\33\1\31\1\33\23\31\1\34\2\31"+
-    "\1\35\1\36\2\37\1\31\2\40\2\20\1\0\1\20"+
-    "\3\40\1\33\1\40\1\33\7\40\1\41\16\40\4\0"+
-    "\1\40\1\42\1\43\2\20\1\42\1\20\3\42\1\33"+
-    "\1\42\1\33\12\42\1\44\1\45\16\42\1\46\2\47"+
-    "\2\20\1\47\1\20\3\47\1\33\1\47\1\33\33\47"+
-    "\2\50\2\20\1\0\1\20\2\0\1\50\1\33\1\50"+
-    "\1\33\26\50\4\0\1\50\1\42\1\43\2\20\1\42"+
-    "\1\20\3\42\1\33\1\42\1\33\3\42\1\51\6\42"+
-    "\1\52\1\53\16\42\1\46\2\54\2\55\1\54\1\55"+
-    "\4\54\1\56\1\57\33\54\2\60\2\20\1\42\1\20"+
-    "\2\42\1\60\1\33\1\60\1\33\26\60\4\42\1\60"+
-    "\2\61\2\20\1\42\1\20\2\42\1\61\1\33\1\61"+
-    "\1\33\26\61\4\42\1\61\1\62\1\63\1\64\1\65"+
-    "\1\62\1\66\3\62\1\33\1\62\1\33\1\67\2\62"+
-    "\1\70\1\62\1\71\10\62\1\72\4\62\1\73\2\62"+
-    "\1\74\2\75\1\62\1\76\1\77\1\100\2\20\1\77"+
-    "\1\20\3\77\1\33\1\77\1\33\23\77\1\101\6\77"+
-    "\1\102\2\103\2\20\1\103\1\20\3\103\1\33\1\103"+
-    "\1\33\26\103\1\104\1\105\1\106\2\103\2\17\2\0"+
-    "\1\17\2\0\1\17\2\0\1\17\1\0\7\17\1\0"+
-    "\23\17\2\0\2\20\1\0\1\20\53\0\1\107\34\0"+
-    "\2\17\2\0\1\17\2\0\1\17\2\0\1\17\1\0"+
-    "\1\17\1\110\1\17\1\111\3\17\1\0\25\17\2\0"+
-    "\1\17\2\0\1\17\2\0\1\17\1\0\7\17\1\0"+
-    "\1\112\22\17\2\113\2\0\1\113\2\0\1\113\2\0"+
-    "\1\113\1\0\7\113\1\0\23\113\2\17\2\0\1\17"+
-    "\2\0\1\17\2\0\1\17\1\0\4\17\1\114\2\17"+
-    "\1\0\23\17\2\31\6\0\1\31\1\0\1\31\1\0"+
-    "\26\31\4\0\3\31\6\0\1\31\1\0\1\31\1\0"+
-    "\13\31\1\115\12\31\4\0\1\31\2\0\2\116\1\0"+
-    "\1\116\31\0\1\117\7\0\2\40\4\0\3\40\1\0"+
-    "\1\40\1\0\26\40\4\0\1\40\2\42\2\0\1\42"+
-    "\1\0\3\42\1\0\1\42\1\0\33\42\1\43\1\120"+
-    "\2\121\1\43\1\121\3\43\1\121\1\43\1\121\33\43"+
-    "\2\42\2\0\1\42\1\0\3\42\1\0\1\42\1\0"+
-    "\6\42\1\122\26\42\2\0\1\42\1\0\3\42\1\0"+
-    "\1\42\1\0\14\42\1\123\16\42\2\46\2\124\1\46"+
-    "\1\124\3\46\1\124\1\46\1\124\32\46\1\125\2\47"+
-    "\2\0\1\47\1\0\3\47\1\0\1\47\1\0\33\47"+
-    "\2\50\6\0\1\50\1\0\1\50\1\0\26\50\4\0"+
-    "\1\50\2\42\2\0\1\42\1\0\3\42\1\0\1\42"+
-    "\1\0\17\42\1\126\15\42\2\0\1\42\1\0\3\42"+
-    "\1\0\1\42\1\0\6\42\1\127\26\42\2\0\1\42"+
-    "\1\0\3\42\1\0\1\42\1\0\14\42\1\130\16\42"+
-    "\12\54\2\0\35\54\2\55\1\54\1\55\4\54\2\0"+
-    "\33\54\12\0\1\131\34\0\2\60\2\0\1\42\1\0"+
-    "\2\42\1\60\1\0\1\60\1\0\26\60\4\42\1\60"+
-    "\2\61\2\0\1\42\1\0\2\42\1\61\1\0\1\61"+
-    "\1\0\26\61\4\42\1\61\2\62\2\0\1\62\1\0"+
-    "\3\62\1\0\1\62\1\0\26\62\3\0\2\62\1\63"+
-    "\1\132\2\133\1\63\1\133\3\63\1\133\1\63\1\133"+
-    "\26\63\3\133\2\63\3\0\1\65\50\0\1\66\41\0"+
-    "\2\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0"+
-    "\3\62\1\134\22\62\3\0\4\62\2\0\1\62\1\0"+
-    "\3\62\1\0\1\62\1\0\2\62\1\135\5\62\1\136"+
-    "\15\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0"+
-    "\1\62\1\0\17\62\1\137\6\62\3\0\4\62\2\0"+
-    "\1\62\1\0\3\62\1\0\1\62\1\0\17\62\1\140"+
-    "\6\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0"+
-    "\1\62\1\0\5\62\1\141\12\62\1\142\1\143\4\62"+
-    "\3\0\2\62\2\76\2\144\1\76\1\144\3\76\1\144"+
-    "\1\76\1\144\26\76\3\144\1\76\1\132\2\77\2\0"+
-    "\1\77\1\0\3\77\1\0\1\77\1\0\33\77\1\100"+
-    "\1\145\2\146\1\100\1\146\3\100\1\146\1\100\1\146"+
-    "\33\100\2\77\2\0\1\77\1\0\3\77\1\0\1\77"+
-    "\1\0\5\77\1\147\12\77\1\150\1\151\11\77\2\102"+
-    "\2\152\1\102\1\152\3\102\1\152\1\102\1\152\32\102"+
-    "\1\153\2\103\2\0\1\103\1\0\3\103\1\0\1\103"+
-    "\1\0\26\103\3\0\2\103\12\0\1\154\34\0\2\17"+
-    "\2\0\1\17\2\0\1\17\2\0\1\17\1\0\1\155"+
-    "\6\17\1\0\25\17\2\0\1\17\2\0\1\17\2\0"+
-    "\1\17\1\0\4\17\1\156\2\17\1\0\25\17\2\0"+
-    "\1\17\2\0\1\17\2\0\1\17\1\0\4\17\1\157"+
-    "\2\17\1\0\23\17\2\113\2\0\1\113\2\0\1\113"+
-    "\1\160\1\0\1\113\1\0\7\113\1\0\23\113\2\17"+
-    "\2\0\1\17\2\0\1\17\2\0\1\17\1\0\4\17"+
-    "\1\161\2\17\1\0\23\17\2\31\6\0\1\31\1\0"+
-    "\1\31\1\0\16\31\1\162\7\31\4\0\1\31\27\0"+
-    "\1\163\17\0\1\121\1\164\45\121\2\42\2\0\1\42"+
-    "\1\0\3\42\1\0\1\42\1\0\12\42\1\165\22\42"+
-    "\2\0\1\42\1\0\3\42\1\0\1\42\1\0\15\42"+
-    "\1\166\15\42\46\124\1\167\2\42\2\0\1\42\1\0"+
-    "\3\42\1\0\1\42\1\0\11\42\1\170\23\42\2\0"+
-    "\1\42\1\0\3\42\1\0\1\42\1\0\12\42\1\171"+
-    "\22\42\2\0\1\42\1\0\3\42\1\0\1\42\1\0"+
-    "\15\42\1\172\15\42\13\0\1\173\33\0\1\133\1\174"+
-    "\45\133\2\62\2\0\1\62\1\0\3\62\1\0\1\62"+
-    "\1\0\4\62\1\175\21\62\3\0\4\62\2\0\1\62"+
-    "\1\0\3\62\1\0\1\62\1\0\4\62\1\176\21\62"+
-    "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
-    "\1\0\4\62\1\177\21\62\3\0\4\62\2\0\1\62"+
-    "\1\0\3\62\1\0\1\62\1\0\20\62\1\200\5\62"+
-    "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
-    "\1\0\11\62\1\201\14\62\3\0\4\62\2\0\1\62"+
-    "\1\0\3\62\1\0\1\62\1\0\2\62\1\202\23\62"+
-    "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
-    "\1\0\1\203\25\62\3\0\4\62\2\0\1\62\1\0"+
-    "\3\62\1\0\1\62\1\0\5\62\1\204\20\62\3\0"+
-    "\2\62\46\144\1\174\1\146\1\205\45\146\2\77\2\0"+
-    "\1\77\1\0\3\77\1\0\1\77\1\0\2\77\1\206"+
-    "\32\77\2\0\1\77\1\0\3\77\1\0\1\77\1\0"+
-    "\1\207\34\77\2\0\1\77\1\0\3\77\1\0\1\77"+
-    "\1\0\5\77\1\210\25\77\46\152\1\211\2\17\2\0"+
-    "\1\17\2\0\1\17\2\0\1\17\1\0\2\17\1\212"+
-    "\4\17\1\0\25\17\2\0\1\17\2\0\1\17\2\0"+
-    "\1\17\1\0\5\17\1\213\1\17\1\0\25\17\2\0"+
-    "\1\17\2\0\1\17\2\0\1\17\1\0\7\17\1\0"+
-    "\1\17\1\214\23\17\2\0\1\17\2\0\1\17\2\0"+
-    "\1\17\1\0\1\17\1\215\5\17\1\0\23\17\2\31"+
-    "\6\0\1\31\1\0\1\31\1\0\17\31\1\216\6\31"+
-    "\4\0\1\31\32\0\1\217\14\0\2\42\2\0\1\42"+
-    "\1\0\3\42\1\0\1\42\1\0\4\42\1\220\30\42"+
-    "\2\0\1\42\1\0\3\42\1\0\1\42\1\0\1\42"+
-    "\1\221\33\42\2\0\1\42\1\0\3\42\1\0\1\42"+
-    "\1\0\4\42\1\222\30\42\2\0\1\42\1\0\3\42"+
-    "\1\0\1\42\1\0\4\42\1\223\30\42\2\0\1\42"+
-    "\1\0\3\42\1\0\1\42\1\0\1\42\1\224\31\42"+
-    "\2\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0"+
-    "\5\62\1\225\20\62\3\0\4\62\2\0\1\62\1\0"+
-    "\3\62\1\0\1\62\1\0\10\62\1\226\15\62\3\0"+
-    "\4\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0"+
-    "\11\62\1\227\14\62\3\0\4\62\2\0\1\62\1\0"+
-    "\3\62\1\0\1\62\1\0\1\230\25\62\3\0\4\62"+
-    "\2\0\1\62\1\0\3\62\1\0\1\62\1\0\4\62"+
-    "\1\231\21\62\3\0\4\62\2\0\1\62\1\0\3\62"+
-    "\1\0\1\62\1\0\13\62\1\232\12\62\3\0\4\62"+
-    "\2\0\1\62\1\0\3\62\1\0\1\62\1\0\24\62"+
-    "\1\233\1\62\3\0\4\62\2\0\1\62\1\0\3\62"+
-    "\1\0\1\62\1\0\25\62\1\234\3\0\2\62\2\77"+
-    "\2\0\1\77\1\0\3\77\1\0\1\77\1\0\13\77"+
-    "\1\235\21\77\2\0\1\77\1\0\3\77\1\0\1\77"+
-    "\1\0\24\77\1\236\10\77\2\0\1\77\1\0\3\77"+
-    "\1\0\1\77\1\0\25\77\1\237\5\77\2\17\2\0"+
-    "\1\17\2\0\1\17\2\0\1\17\1\0\1\240\6\17"+
-    "\1\0\25\17\2\0\1\17\2\0\1\17\2\0\1\17"+
-    "\1\0\4\17\1\241\2\17\1\0\25\17\2\0\1\17"+
-    "\2\0\1\17\2\0\1\17\1\0\4\17\1\242\2\17"+
-    "\1\0\25\17\2\0\1\17\2\0\1\17\2\0\1\17"+
-    "\1\0\5\17\1\243\1\17\1\0\23\17\2\31\6\0"+
-    "\1\31\1\0\1\31\1\0\11\31\1\244\14\31\4\0"+
-    "\1\31\33\0\1\245\13\0\2\42\2\0\1\42\1\0"+
-    "\3\42\1\0\1\42\1\0\1\246\34\42\2\0\1\42"+
-    "\1\0\3\42\1\0\1\42\1\0\5\42\1\247\27\42"+
-    "\2\0\1\42\1\0\3\42\1\0\1\42\1\0\11\42"+
-    "\1\250\23\42\2\0\1\42\1\0\3\42\1\0\1\42"+
-    "\1\0\1\251\34\42\2\0\1\42\1\0\3\42\1\0"+
-    "\1\42\1\0\5\42\1\252\25\42\2\62\2\0\1\62"+
-    "\1\0\3\62\1\0\1\62\1\0\4\62\1\253\21\62"+
-    "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
-    "\1\0\22\62\1\254\3\62\3\0\4\62\2\0\1\62"+
-    "\1\0\3\62\1\0\1\62\1\0\4\62\1\255\21\62"+
-    "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
-    "\1\0\21\62\1\256\4\62\3\0\4\62\2\0\1\62"+
-    "\1\0\3\62\1\0\1\62\1\0\11\62\1\257\14\62"+
-    "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
-    "\1\0\1\62\1\260\24\62\3\0\4\62\2\0\1\62"+
-    "\1\0\3\62\1\0\1\62\1\0\14\62\1\261\11\62"+
-    "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62"+
-    "\1\0\1\262\25\62\3\0\2\62\2\77\2\0\1\77"+
-    "\1\0\3\77\1\0\1\77\1\0\1\77\1\263\33\77"+
-    "\2\0\1\77\1\0\3\77\1\0\1\77\1\0\14\77"+
-    "\1\264\20\77\2\0\1\77\1\0\3\77\1\0\1\77"+
-    "\1\0\1\265\32\77\2\17\2\0\1\17\2\0\1\17"+
-    "\2\0\1\17\1\0\3\17\1\266\3\17\1\0\25\17"+
-    "\2\0\1\17\2\0\1\17\2\0\1\17\1\0\6\17"+
-    "\1\267\1\0\25\17\2\0\1\17\2\0\1\17\2\0"+
-    "\1\17\1\0\5\17\1\270\1\17\1\0\25\17\2\0"+
-    "\1\17\2\0\1\17\2\0\1\17\1\0\7\17\1\0"+
-    "\2\17\1\271\20\17\2\31\6\0\1\31\1\0\1\31"+
-    "\1\0\4\31\1\272\21\31\4\0\1\31\25\0\1\273"+
-    "\21\0\2\42\2\0\1\42\1\0\3\42\1\0\1\42"+
-    "\1\0\2\42\1\274\32\42\2\0\1\42\1\0\3\42"+
-    "\1\0\1\42\1\0\16\42\1\274\16\42\2\0\1\42"+
-    "\1\0\3\42\1\0\1\42\1\0\2\42\1\275\32\42"+
-    "\2\0\1\42\1\0\3\42\1\0\1\42\1\0\16\42"+
-    "\1\276\14\42\2\62\2\0\1\62\1\0\3\62\1\0"+
-    "\1\62\1\0\5\62\1\277\1\300\17\62\3\0\4\62"+
-    "\2\0\1\62\1\0\3\62\1\0\1\62\1\0\1\301"+
-    "\25\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0"+
-    "\1\62\1\0\5\62\1\302\20\62\3\0\4\62\2\0"+
-    "\1\62\1\0\3\62\1\0\1\62\1\0\12\62\1\303"+
-    "\13\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0"+
-    "\1\62\1\0\5\62\1\234\20\62\3\0\4\62\2\0"+
-    "\1\62\1\0\3\62\1\0\1\62\1\0\5\62\1\304"+
-    "\20\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0"+
-    "\1\62\1\0\17\62\1\132\6\62\3\0\2\62\2\77"+
-    "\2\0\1\77\1\0\3\77\1\0\1\77\1\0\5\77"+
-    "\1\305\27\77\2\0\1\77\1\0\3\77\1\0\1\77"+
-    "\1\0\5\77\1\306\27\77\2\0\1\77\1\0\3\77"+
-    "\1\0\1\77\1\0\17\77\1\307\13\77\2\17\2\0"+
-    "\1\17\2\0\1\17\2\0\1\17\1\0\4\17\1\310"+
-    "\2\17\1\0\25\17\2\0\1\17\2\0\1\17\2\0"+
-    "\1\17\1\0\7\17\1\0\1\311\24\17\2\0\1\17"+
-    "\2\0\1\17\2\0\1\17\1\0\4\17\1\312\2\17"+
-    "\1\0\23\17\2\31\6\0\1\31\1\0\1\31\1\0"+
-    "\11\31\1\313\14\31\4\0\1\31\20\0\1\314\26\0"+
-    "\2\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0"+
-    "\1\315\25\62\3\0\4\62\2\0\1\62\1\0\3\62"+
-    "\1\0\1\62\1\0\3\62\1\316\22\62\3\0\4\62"+
-    "\2\0\1\62\1\0\3\62\1\0\1\62\1\0\10\62"+
-    "\1\317\15\62\3\0\4\62\2\0\1\62\1\0\3\62"+
-    "\1\0\1\62\1\0\20\62\1\234\5\62\3\0\2\62"+
-    "\2\77\2\0\1\77\1\0\3\77\1\0\1\77\1\0"+
-    "\1\320\34\77\2\0\1\77\1\0\3\77\1\0\1\77"+
-    "\1\0\20\77\1\321\12\77\2\17\2\0\1\17\2\0"+
-    "\1\17\2\0\1\17\1\0\3\17\1\322\3\17\1\0"+
-    "\23\17\25\0\1\323\21\0\2\62\2\0\1\62\1\0"+
-    "\3\62\1\0\1\62\1\0\12\62\1\324\13\62\3\0"+
-    "\4\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0"+
-    "\12\62\1\325\13\62\3\0\4\62\2\0\1\62\1\0"+
-    "\3\62\1\0\1\62\1\0\3\62\1\326\22\62\3\0"+
-    "\2\62\2\77\2\0\1\77\1\0\3\77\1\0\1\77"+
-    "\1\0\17\77\1\327\15\77\2\0\1\77\1\0\3\77"+
-    "\1\0\1\77\1\0\1\330\32\77\2\0\2\323\1\0"+
-    "\1\323\35\0\1\331\3\0\2\77\2\0\1\77\1\0"+
-    "\3\77\1\0\1\77\1\0\17\77\1\332\13\77";
-
-  /** 
-   * The transition table of the DFA
-   */
-  final private static int yytrans [] = yy_unpack();
-
-
-  /* error codes */
-  final private static int YY_UNKNOWN_ERROR = 0;
-  final 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"
-  };
-
-  /**
-   * YY_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
-   */
-  private final static byte YY_ATTRIBUTE[] = {
-     0,  8,  0,  0,  1,  1,  0,  1,  0,  1,  1,  1,  1,  1,  1,  1, 
-     1,  9,  9,  9,  1,  1,  1,  1,  1,  9,  9,  1,  1,  9,  9,  1, 
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  9,  1, 
-     1,  1,  1,  1,  9,  1,  1,  1,  1,  1,  1,  9,  9,  1,  1,  1, 
-     1,  1,  1,  9,  9,  9,  0,  1,  1,  1,  0,  1,  1,  0,  0,  1, 
-     0,  1,  1,  0,  1,  1,  1,  1,  0,  1,  0,  1,  1,  1,  1,  1, 
-     1,  1,  1,  0,  1,  0,  1,  1,  1,  0,  1,  9,  1,  1,  1,  9, 
-     1,  1,  0,  9,  1,  1,  9,  1,  1,  1,  9,  9,  1,  1,  1,  1, 
-     1,  1,  1,  1,  9,  1,  1,  1,  9,  1,  1,  1,  1,  1,  0,  1, 
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
-     1,  1,  1,  1,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  1,  1,  1,  1,  1, 
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  1,  1,  1,  1, 
-     1,  1,  0,  1,  1,  1,  1,  1,  9,  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[YY_BUFFERSIZE];
-
-  /** 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
-   */
-  int yycolumn; 
-
-  /** yy_atEOF == true <=> the scanner is at the EOF */
-  private boolean yy_atEOF;
-
-  /* user code: */
-	int node_count = 0;
-	String currentString;
-
-	private Token createToken(String type) {
-		return new Token(type, yytext(), yyline, yychar + startOffset, yylength());
-	}
-
-	private int startOffset = 0;
-	public void setStartOffset(int offset) {
-		this.startOffset = offset;
-	}
-
-	public void setLine(int line) {
-		this.yyline = line;
-	}
-
-
-  /**
-   * 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 DTDTokenizer(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 DTDTokenizer(java.io.InputStream in) {
-    this(new java.io.InputStreamReader(in));
-  }
-
-  /** 
-   * Unpacks the split, compressed DFA transition table.
-   *
-   * @return the unpacked transition table
-   */
-  private static int [] yy_unpack() {
-    int [] trans = new int[6630];
-    int offset = 0;
-    offset = yy_unpack(yy_packed0, offset, trans);
-    return trans;
-  }
-
-  /** 
-   * Unpacks the compressed DFA transition table.
-   *
-   * @param packed   the packed transition table
-   * @return         the index of the last entry
-   */
-  private static int yy_unpack(String packed, int offset, int [] trans) {
-    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++);
-      value--;
-      do trans[j++] = value; while (--count > 0);
-    }
-    return j;
-  }
-
-  /** 
-   * 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 < 130) {
-      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 yy_refill() throws java.io.IOException {
-
-    /* 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 < 0) {
-      return true;
-    }
-    else {
-      yy_endRead+= numRead;  
-      return false;
-    }
-  }
-
-    
-  /**
-   * 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    */
-
-    if (yy_reader != null)
-      yy_reader.close();
-  }
-
-
-  /**
-   * Closes the current stream, and resets the
-   * scanner to read from a new input stream.
-   *
-   * 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>YY_INITIAL</tt>.
-   *
-   * @param reader   the new input stream 
-   */
-  final public void yyreset(java.io.Reader reader) throws java.io.IOException {
-    yyclose();
-    yy_reader = reader;
-    yy_atEOF  = false;
-    yy_endRead = yy_startRead = 0;
-    yy_currentPos = yy_markedPos = yy_pushbackPos = 0;
-    yyline = yychar = yycolumn = 0;
-    yy_lexical_state = YYINITIAL;
-  }
-
-
-  /**
-   * 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 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
-   */
-  final public char yycharat(int pos) {
-    return yy_buffer[yy_startRead+pos];
-  }
-
-
-  /**
-   * Returns the length of the matched text region.
-   */
-  final public int yylength() {
-    return yy_markedPos-yy_startRead;
-  }
-
-
-  /**
-   * 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 yy_ScanError(int errorCode) {
-    String message;
-    try {
-      message = YY_ERROR_MSG[errorCode];
-    }
-    catch (ArrayIndexOutOfBoundsException e) {
-      message = YY_ERROR_MSG[YY_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() )
-      yy_ScanError(YY_PUSHBACK_2BIG);
-
-    yy_markedPos -= 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
-   */
-  public Yytoken yylex() throws java.io.IOException {
-    int yy_input;
-    int yy_action;
-
-    // cached fields:
-    int yy_currentPos_l;
-    int yy_markedPos_l;
-    int yy_endRead_l = yy_endRead;
-    char [] yy_buffer_l = yy_buffer;
-    char [] yycmap_l = yycmap;
-
-    int [] yytrans_l = yytrans;
-    int [] yy_rowMap_l = yy_rowMap;
-    byte [] yy_attr_l = YY_ATTRIBUTE;
-
-    while (true) {
-      yy_markedPos_l = yy_markedPos;
-
-      yychar+= yy_markedPos_l-yy_startRead;
-
-      yy_action = -1;
-
-      yy_currentPos_l = yy_currentPos = 
-                       yy_startRead = yy_markedPos_l;
-  
-      yy_state = yy_lexical_state;
-
-
-      yy_forAction: {
-        while (true) {
-    
-          if (yy_currentPos_l < yy_endRead_l)
-            yy_input = yy_buffer_l[yy_currentPos_l++];
-          else if (yy_atEOF) {
-            yy_input = YYEOF;
-            break yy_forAction;
-          }
-          else {
-            // store back cached positions
-            yy_currentPos  = yy_currentPos_l;
-            yy_markedPos   = yy_markedPos_l;
-            boolean eof = yy_refill();
-            // get translated positions and possibly new buffer
-            yy_currentPos_l  = yy_currentPos;
-            yy_markedPos_l   = yy_markedPos;
-            yy_buffer_l      = yy_buffer;
-            yy_endRead_l     = yy_endRead;
-            if (eof) {
-              yy_input = YYEOF;
-              break yy_forAction;
-            }
-            else {
-              yy_input = yy_buffer_l[yy_currentPos_l++];
-            }
-          }
-          int yy_next = yytrans_l[ yy_rowMap_l[yy_state] + yycmap_l[yy_input] ];
-          if (yy_next == -1) break yy_forAction;
-          yy_state = yy_next;
-
-          int yy_attributes = yy_attr_l[yy_state];
-          if ( (yy_attributes & 1) == 1 ) {
-            yy_action = yy_state; 
-            yy_markedPos_l = yy_currentPos_l; 
-            if ( (yy_attributes & 8) == 8 ) break yy_forAction;
-          }
-
-        }
-      }
-
-      // store back cached position
-      yy_markedPos = yy_markedPos_l;
-
-      switch (yy_action) {
-
-        case 26: 
-          {  yypushback(yylength()); yybegin(YYINITIAL);  }
-        case 219: break;
-        case 89: 
-        case 123: 
-          {  yypushback(yylength()); yybegin(ATTRIBUTE_DEFAULT);  }
-        case 220: break;
-        case 12: 
-        case 62: 
-        case 63: 
-        case 64: 
-        case 65: 
-        case 102: 
-        case 103: 
-        case 104: 
-        case 133: 
-        case 134: 
-        case 135: 
-        case 156: 
-        case 157: 
-        case 158: 
-        case 178: 
-        case 179: 
-        case 180: 
-        case 196: 
-        case 197: 
-        case 207: 
-        case 208: 
-        case 215: 
-          {  yypushback(yylength()); yybegin(ATTLIST_CONTENT);  }
-        case 221: break;
-        case 51: 
-        case 52: 
-          {  yypushback(yylength()); yybegin(ATTLIST_CONTENT);  }
-        case 222: break;
-        case 205: 
-          {  yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.NMTOKEN_KEYWORD);  }
-        case 223: break;
-        case 194: 
-          {  yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.IDREFS_KEYWORD);  }
-        case 224: break;
-        case 191: 
-          {  yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ENTITY_KEYWORD);  }
-        case 225: break;
-        case 107: 
-          {  yybegin(COMMENT_CONTENT); return createToken(DTDRegionTypes.COMMENT_START);  }
-        case 226: break;
-        case 48: 
-          {  yybegin(ATTRIBUTE_CONTENT); return createToken(DTDRegionTypes.ATTRIBUTE_NAME);  }
-        case 227: break;
-        case 39: 
-          {  yybegin(EXTERNALID_CONTENT); return createToken(DTDRegionTypes.NAME);  }
-        case 228: break;
-        case 106: 
-        case 136: 
-          {  yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL);  }
-        case 229: break;
-        case 100: 
-        case 132: 
-          {  yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL);  }
-        case 230: break;
-        case 202: 
-        case 216: 
-          {  return createToken(DTDRegionTypes.CONTENT_PCDATA);  }
-        case 231: break;
-        case 189: 
-          {  return createToken(DTDRegionTypes.PUBLIC_KEYWORD);  }
-        case 232: break;
-        case 188: 
-          {  return createToken(DTDRegionTypes.SYSTEM_KEYWORD);  }
-        case 233: break;
-        case 14: 
-        case 20: 
-        case 21: 
-        case 23: 
-        case 71: 
-        case 72: 
-        case 73: 
-        case 75: 
-        case 108: 
-        case 109: 
-        case 110: 
-        case 112: 
-        case 137: 
-        case 138: 
-        case 139: 
-        case 140: 
-        case 159: 
-        case 160: 
-        case 161: 
-        case 162: 
-        case 181: 
-        case 183: 
-        case 184: 
-        case 200: 
-          {  return createToken(DTDRegionTypes.UNKNOWN_CONTENT);  }
-        case 234: break;
-        case 4: 
-        case 33: 
-        case 34: 
-        case 35: 
-        case 36: 
-        case 37: 
-        case 81: 
-        case 82: 
-        case 116: 
-        case 117: 
-        case 143: 
-        case 144: 
-        case 165: 
-        case 166: 
-          {  return createToken(DTDRegionTypes.UNKNOWN_CONTENT);  }
-        case 235: break;
-        case 7: 
-        case 40: 
-        case 41: 
-        case 42: 
-        case 85: 
-        case 86: 
-        case 87: 
-        case 119: 
-        case 120: 
-        case 121: 
-        case 145: 
-        case 146: 
-        case 147: 
-        case 168: 
-        case 169: 
-          {  return createToken(DTDRegionTypes.UNKNOWN_CONTENT);  }
-        case 236: break;
-        case 9: 
-          {  return createToken(DTDRegionTypes.UNKNOWN_CONTENT);  }
-        case 237: break;
-        case 10: 
-          {  return createToken(DTDRegionTypes.UNKNOWN_CONTENT);  }
-        case 238: break;
-        case 43: 
-        case 45: 
-        case 46: 
-          {  return createToken(DTDRegionTypes.COMMENT_CONTENT);  }
-        case 239: break;
-        case 60: 
-          {  return createToken(DTDRegionTypes.UNKNOWN_CONTENT);  }
-        case 240: break;
-        case 198: 
-          {  return createToken(DTDRegionTypes.FIXED_KEYWORD);  }
-        case 241: break;
-        case 214: 
-          {  yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.IMPLIED_KEYWORD);  }
-        case 242: break;
-        case 212: 
-          {  yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.NMTOKENS_KEYWORD);  }
-        case 243: break;
-        case 211: 
-          {  yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ENTITIES_KEYWORD);  }
-        case 244: break;
-        case 209: 
-          {  yybegin(NOTATION_NAME); return createToken(DTDRegionTypes.NOTATION_TAG);  }
-        case 245: break;
-        case 201: 
-          {  yybegin(ATTLIST_NAME); return createToken(DTDRegionTypes.ATTLIST_TAG);  }
-        case 246: break;
-        case 199: 
-          {  yybegin(ELEMENT_NAME); return createToken(DTDRegionTypes.ELEMENT_TAG);  }
-        case 247: break;
-        case 182: 
-          {  yybegin(ENTITY_NAME); return createToken(DTDRegionTypes.ENTITY_TAG);  }
-        case 248: break;
-        case 167: 
-          {  yybegin(NDATA_CONTENT); return createToken(DTDRegionTypes.NDATA_KEYWORD);  }
-        case 249: break;
-        case 111: 
-          {  return createToken(DTDRegionTypes.ENTITY_PARM);  }
-        case 250: break;
-        case 94: 
-          {  yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ID_KEYWORD);  }
-        case 251: break;
-        case 25: 
-          {  return createToken(DTDRegionTypes.OCCUR_TYPE);  }
-        case 252: break;
-        case 16: 
-          {  return createToken(DTDRegionTypes.EXCLAMATION);  }
-        case 253: break;
-        case 15: 
-          {  return createToken(DTDRegionTypes.WHITESPACE);  }
-        case 254: break;
-        case 11: 
-        case 49: 
-        case 50: 
-        case 54: 
-        case 55: 
-        case 56: 
-        case 57: 
-        case 58: 
-        case 61: 
-        case 91: 
-        case 92: 
-        case 93: 
-        case 95: 
-        case 96: 
-        case 97: 
-        case 98: 
-        case 124: 
-        case 125: 
-        case 126: 
-        case 127: 
-        case 128: 
-        case 129: 
-        case 130: 
-        case 131: 
-        case 148: 
-        case 149: 
-        case 150: 
-        case 151: 
-        case 152: 
-        case 153: 
-        case 154: 
-        case 155: 
-        case 170: 
-        case 171: 
-        case 172: 
-        case 175: 
-        case 176: 
-        case 177: 
-        case 190: 
-        case 192: 
-        case 193: 
-        case 195: 
-        case 204: 
-        case 206: 
-          {  yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.PARM_ENTITY_TYPE);  }
-        case 255: break;
-        case 28: 
-          {  return createToken(DTDRegionTypes.LEFT_PAREN);  }
-        case 256: break;
-        case 29: 
-          {  return createToken(DTDRegionTypes.RIGHT_PAREN);  }
-        case 257: break;
-        case 44: 
-          {  return createToken(DTDRegionTypes.WHITESPACE);  }
-        case 258: break;
-        case 53: 
-          {  return createToken(DTDRegionTypes.WHITESPACE);  }
-        case 259: break;
-        case 59: 
-          {  yypushback(yylength()); yybegin(ATTRIBUTE_ENUMERATION);  }
-        case 260: break;
-        case 67: 
-          {  return createToken(DTDRegionTypes.LEFT_PAREN);  }
-        case 261: break;
-        case 68: 
-          {  yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.RIGHT_PAREN);  }
-        case 262: break;
-        case 69: 
-          {  return createToken(DTDRegionTypes.ENUM_CHOICE);  }
-        case 263: break;
-        case 31: 
-          {  yybegin(ENTITY_CONTENT); return createToken(DTDRegionTypes.NAME);  }
-        case 264: break;
-        case 47: 
-          {  yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.NAME);  }
-        case 265: break;
-        case 187: 
-          {  yypushback(yylength()); yybegin(EXTERNALID_CONTENT);  }
-        case 266: break;
-        case 213: 
-          {  yybegin(ATTRIBUTE_ENUMERATION); return createToken(DTDRegionTypes.NOTATION_KEYWORD);  }
-        case 267: break;
-        case 174: 
-          {  yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.CDATA_KEYWORD);  }
-        case 268: break;
-        case 173: 
-          {  yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.IDREF_KEYWORD);  }
-        case 269: break;
-        case 217: 
-          {  yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.REQUIRED_KEYWORD);  }
-        case 270: break;
-        case 122: 
-          {  yybegin(YYINITIAL); return createToken(DTDRegionTypes.COMMENT_END);  }
-        case 271: break;
-        case 84: 
-        case 118: 
-          {  return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL);  }
-        case 272: break;
-        case 79: 
-        case 115: 
-          {  return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL);  }
-        case 273: break;
-        case 24: 
-        case 27: 
-        case 76: 
-        case 113: 
-        case 141: 
-        case 163: 
-        case 185: 
-          {  return createToken(DTDRegionTypes.NAME);  }
-        case 274: break;
-        case 5: 
-        case 38: 
-          {  yybegin(YYINITIAL); return createToken(DTDRegionTypes.NDATA_VALUE);  }
-        case 275: break;
-        case 13: 
-        case 66: 
-          {  return createToken(DTDRegionTypes.NAME);  }
-        case 276: break;
-        case 18: 
-          {  return createToken(DTDRegionTypes.START_TAG);  }
-        case 277: break;
-        case 17: 
-          {  return createToken(DTDRegionTypes.SEMICOLON);  }
-        case 278: break;
-        case 30: 
-          {  return createToken(DTDRegionTypes.CONNECTOR);  }
-        case 279: break;
-        case 22: 
-          {  return createToken(DTDRegionTypes.PERCENT);  }
-        case 280: break;
-        case 19: 
-          {  return createToken(DTDRegionTypes.END_TAG);  }
-        case 281: break;
-        case 32: 
-          {  return createToken(DTDRegionTypes.PERCENT);  }
-        case 282: break;
-        default: 
-          if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
-            yy_atEOF = true;
-            return null;
-          } 
-          else {
-            yy_ScanError(YY_NO_MATCH);
-          }
-      }
-    }
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Token.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Token.java
deleted file mode 100644
index f8dbaba..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Token.java
+++ /dev/null
@@ -1,61 +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.dtd.core.internal.tokenizer;
-
-public class Token extends Yytoken {
-	public static final int COMMENT_START = 9;
-	public static final int CONNECTOR = 6;
-	public static final int CONTENT_ANY = 43;
-	public static final int CONTENT_EMPTY = 42;
-	public static final int CONTENT_PCDATA = 44;
-	public static final int ELEMENT_CONTENT = 41;
-
-	public static final int ELEMENT_TAG = 40;
-	public static final int END_TAG = 2;
-	public static final int ENTITY_CONTENT = 32;
-	public static final int ENTITY_PARM = 31;
-
-	public static final int ENTITY_TAG = 30;
-	public static final int EXCLAMATION = 8;
-	public static final int LEFT_PAREN = 3;
-	public static final int NAME = 0;
-	public static final int NOTATION_CONTENT = 21;
-
-
-	public static final int NOTATION_TAG = 20;
-
-	// public static final int CONNECT_CHOICE = 5;
-	// public static final int CONNECT_SEQUENCE = 6;
-	// public static final int OCCUR_OPTIONAL = 7;
-	// public static final int OCCUR_ONE_OR_MORE = 8;
-	// public static final int OCCUR_ZERO_OR_MORE = 9;
-	public static final int OCCUR_TYPE = 7;
-	public static final int RIGHT_PAREN = 4;
-	public static final int START_TAG = 1;
-	public static final int WHITESPACE = 5;
-
-
-	public Token(String type) {
-		super(type);
-	}
-
-	public Token(String type, String text, int line, int charBegin, int length) {
-		super(type, text, line, charBegin, length);
-	}
-
-	public Token createCopy() {
-		Token copy = new Token(getType(), getText(), getStartLine(), getStartOffset(), getLength());
-		return copy;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Yytoken.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Yytoken.java
deleted file mode 100644
index 120da07..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Yytoken.java
+++ /dev/null
@@ -1,89 +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.dtd.core.internal.tokenizer;
-
-class Yytoken {
-	public int m_charBegin;
-	public int m_length;
-	public int m_line;
-	public String m_text;
-	public String m_type;
-
-	Yytoken(String type) {
-		m_type = type;
-	}
-
-	Yytoken(String type, String text, int line, int charBegin, int length) {
-		m_type = type;
-		m_text = new String(text);
-		m_line = line;
-		m_charBegin = charBegin;
-		m_length = length;
-	}
-
-	public void delete(int start, int length) {
-		int stringStart = start - m_charBegin;
-		String oldString = m_text;
-		m_text = oldString.substring(0, stringStart);
-		m_text += oldString.substring(stringStart + length);
-
-		m_length = m_text.length();
-		System.out.println("new string = " + m_text); //$NON-NLS-1$
-
-	}
-
-	public boolean equals(Yytoken other) {
-		return m_type == other.getType() && m_text.equals(other.getText()) && m_line == other.getStartLine() && m_charBegin == other.getStartOffset() && m_length == other.getLength();
-	}
-
-	public int getEndOffset() {
-		return m_charBegin + m_length;
-	}
-
-	public int getLength() {
-		return m_length;
-	}
-
-	public int getStartLine() {
-		return m_line;
-	}
-
-	public int getStartOffset() {
-		return m_charBegin;
-	}
-
-	public String getText() {
-		return m_text;
-	}
-
-	public String getType() {
-		return m_type;
-	}
-
-	public void setStartOffset(int startOffset) {
-		m_charBegin = startOffset;
-	}
-
-	public String toString() {
-		return "Text   : " + m_text + "\ntype : " + m_type + "\nline  : " + m_line + "\ncBeg. : " + m_charBegin + "\ncEnd. : " + getEndOffset() + "\ncLength. : " + m_length; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
-	}
-
-	public void updateOffset(int delta) {
-		m_charBegin += delta;
-	}
-
-	public void updateText(String newText) {
-		m_text = newText;
-		m_length = newText.length();
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtd.flex b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtd.flex
deleted file mode 100644
index e3a14aa..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtd.flex
+++ /dev/null
@@ -1,327 +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.dtd.core.internal.tokenizer;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-
-/** 
- * Generate with "dtdskeleton".
- *
- * It removes some unused fields and avoids some compiler warnings 
- */
-
-%%
-
-%{
-	int node_count = 0;
-	String currentString;
-
-	private Token createToken(String type) {
-		return new Token(type, yytext(), yyline, yychar + startOffset, yylength());
-	}
-
-	private int startOffset = 0;
-	public void setStartOffset(int offset) {
-		this.startOffset = offset;
-	}
-
-	public void setLine(int line) {
-		this.yyline = line;
-	}
-%}
-
-%class DTDTokenizer
-%public
-%unicode
-%char
-
-%state NODE
-%state ELEMENT_NAME
-%state ELEMENT_CONTENT
-%state ELEMENT_MIXED_OR_CHILD
-%state ELEMENT_MIXED
-%state ELEMENT_CHILD
-%state ENTITY_NAME
-%state ENTITY_CONTENT
-%state NDATA_CONTENT
-
-%state NOTATION_NAME
-%state EXTERNALID_CONTENT
-
-%state COMMENT_CONTENT
-%state ATTLIST_NAME
-%state ATTLIST_CONTENT
-%state ATTRIBUTE_CONTENT
-%state ATTRIBUTE_DEFAULT
-%state ATTRIBUTE_ENUMERATION
-
-
-ALPHA=[A-Za-z]
-DIGIT=[0-9]
-NONNEWLINE_WHITE_SPACE_CHAR=[\ \t\b\012]
-STRING_TEXT=(\\\"|[^\n\r\"]|\\{WHITE_SPACE_CHAR}+\\)*
-COMMENT_TEXT=([^*/\n]|[^*\n]"/"[^*\n]|[^/\n]"*"[^/\n]|"*"[^/\n]|"/"[^*\n])*
-Ident = {ALPHA}({ALPHA}|{DIGIT}|_)*
-InputCharacter = [^\r\n]
-
-LineTerminator = \r|\n|\r\n
-
-/* 3 - White Space */
-S              =    (\x20 | \x09 | \x0D | \x0A)+
-NonLineTerminatorWhitespace = (\x20 | \x09)+
-
-WhiteSpace     = {LineTerminator} | [ \t\f]
-
-/* 84 */
-/*Letter         =    {BaseChar} | {Ideographic}
-
-/* 85 */
-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]  
-
-/* 86 */
-Ideographic    =    [\u4E00-\u9FA5] | \u3007 | [\u3021-\u3029]  
-
-/* 4 */  /* is '.' to be escaped?? */
-NameChar       =    {Letter} | {Digit} | . | - | _ | : | {CombiningChar} | {Extender}
-
-/* 5 */
-Name           = ({Letter} | _ | :) {NameChar}* 
-
-/* 87 */
-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  
-
-/* 88 */
-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]  
-
-/* 89 */
-Extender       =    \u00B7 | \u02D0 | \u02D1 | \u0387 | \u0640 | \u0E46 | \u0EC6 | \u3005 | [\u3031-\u3035] | [\u309D-\u309E] | [\u30FC-\u30FE]  
-*/
-
-Letter         = [a-zA-Z]
-NameChar       = {Letter} | [0-9]
-//Name           = ({Letter} | _ | :) {NameChar}* 
-//Name           = [^\x20\x09\x0D\x0A]+
-Name           = [^\x20\x09\x0D\x0A\|,\!\?\+\*\(\)<>]+
-ElementRefName = [^\x20\x09\x0D\x0A\|,\?\+\*\(\)<>]+
-EntityName     = [^\x20\x09\x0D\x0A\|,\?\*\(\)<>]+
-ParmEntityName = [^\x20\x09\x0D\x0A\!%;<>]+
-
-CommentStart   = \!--
-CommentContent = [^->]+
-CommentEnd     = -->
-ElementStart   = ELEMENT
-ElementContent = [^<>]*
-
-EntityStart    = ENTITY
-Entity_Parm    = %{S}
-EntityContent  = {S}[^<>]*
-
-NotationStart  = NOTATION
-NotationContent = {S}[^<>]*
-AttList        = ATTLIST
-ExternalParmEntityRef = %{ParmEntityName};
-EndTag         = >
-StartTag       = <
-System         = SYSTEM
-Public         = PUBLIC
-NData          = NDATA
-
-// these are attribute type keywords
-//   we reuse NOTATION from NotationStart
-//   we reuse ENTITY from EntityStart
-CData          = CDATA
-ID             = ID
-IDRef          = IDREF
-IDRefs         = IDREFS
-Entities       = ENTITIES
-NMToken        = NMTOKEN
-NMTokens       = NMTOKENS
-
-// these are attribute defaults keywords
-Required       = #REQUIRED
-Implied        = #IMPLIED
-Fixed          = #FIXED
-
-
-Empty          = EMPTY
-Any            = ANY
-PcData         = #PCDATA
-LeftParen      = \(
-RightParen     = \)
-
-Percent        = %
-Semicolon      = ;
-Plus           = \+
-Choice  = \|
-Sequence = ,
-Connector      = {Choice}|{Sequence}
-OccurOptional  = \?
-OccurOneOrMore = \+
-OccurZeroOrMore = \*
-OccurType      = {OccurOptional}|{OccurOneOrMore}|{OccurZeroOrMore}
-Exclamation   = \!
-SingleQuotedLiteral = '[^']*'
-DoubleQuotedLiteral = \"[^\"]*\"
-NonTagContent = [^\x20\x09\x0D\x0A<>]*
-NonEnumContent = [^\x20\x09\x0D\x0A<>\(\)\|]*
-
-%%
-
-<YYINITIAL> {
-  {StartTag}       { return createToken(DTDRegionTypes.START_TAG); }
-  {EndTag}         { return createToken(DTDRegionTypes.END_TAG); }
-  {Exclamation}    { return createToken(DTDRegionTypes.EXCLAMATION); }
-  {Percent}        { return createToken(DTDRegionTypes.PERCENT); }
-  {Semicolon}      { return createToken(DTDRegionTypes.SEMICOLON); }
-
-  {ElementStart}   { yybegin(ELEMENT_NAME); return createToken(DTDRegionTypes.ELEMENT_TAG); }
-  {CommentStart}   { yybegin(COMMENT_CONTENT); return createToken(DTDRegionTypes.COMMENT_START); }
-  {EntityStart}    { yybegin(ENTITY_NAME); return createToken(DTDRegionTypes.ENTITY_TAG); }
-  {NotationStart}  { yybegin(NOTATION_NAME); return createToken(DTDRegionTypes.NOTATION_TAG); }
-  {AttList}        { yybegin(ATTLIST_NAME); return createToken(DTDRegionTypes.ATTLIST_TAG); }
-
-  {ExternalParmEntityRef}   { return createToken(DTDRegionTypes.ENTITY_PARM); }
-// just a parmentityname by itself is no good.  we use this
-// to capture garbage content at the top level
-  {ParmEntityName}          { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
-
-  {S}              { return createToken(DTDRegionTypes.WHITESPACE); }
-}
-
-<ELEMENT_NAME> {
-  {S}              { return createToken(DTDRegionTypes.WHITESPACE); }
-  {PcData}|\({S}*{PcData}{S}*\) { return createToken(DTDRegionTypes.CONTENT_PCDATA); }
-  {Name}           { return createToken(DTDRegionTypes.NAME); }
-
-  {LeftParen}      { return createToken(DTDRegionTypes.LEFT_PAREN); }
-  {Connector}      { return createToken(DTDRegionTypes.CONNECTOR); }    
-  {OccurType}      { return createToken(DTDRegionTypes.OCCUR_TYPE); }
-  {RightParen}     { return createToken(DTDRegionTypes.RIGHT_PAREN); }
-
-  {StartTag}       { yypushback(yylength()); yybegin(YYINITIAL); }
-  {EndTag}         { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-// ******** <!ATTLIST...>
-<ATTLIST_NAME> {
-  {S}              { return createToken(DTDRegionTypes.WHITESPACE); }
-  {Name}           { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.NAME); }
-  {NonTagContent}  { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
-  {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ATTLIST_CONTENT> {
-  {S}              { return createToken(DTDRegionTypes.WHITESPACE); }
-  {Name}           { yybegin(ATTRIBUTE_CONTENT); return createToken(DTDRegionTypes.ATTRIBUTE_NAME); }
-  {NonTagContent}  { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
-  {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ATTRIBUTE_CONTENT> {
-  {LineTerminator} { yypushback(yylength()); yybegin(ATTLIST_CONTENT); }
-  {NonLineTerminatorWhitespace}
-                   { return createToken(DTDRegionTypes.WHITESPACE); }
-  {CData}          { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.CDATA_KEYWORD); }  
-
-  {ID}             { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ID_KEYWORD); }       
-  {IDRef}          { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.IDREF_KEYWORD); }  
-  {IDRefs}         { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.IDREFS_KEYWORD); }  
-  {EntityStart}    { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ENTITY_KEYWORD); }  
-  {Entities}       { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ENTITIES_KEYWORD); }  
-  {NMToken}        { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.NMTOKEN_KEYWORD); }  
-  {NMTokens}       { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.NMTOKENS_KEYWORD); }  
-  {NotationStart}  { yybegin(ATTRIBUTE_ENUMERATION); return createToken(DTDRegionTypes.NOTATION_KEYWORD); }  
-
-  {Required} | {Implied} | {Fixed} | {SingleQuotedLiteral} | { DoubleQuotedLiteral}
-                   { yypushback(yylength()); yybegin(ATTRIBUTE_DEFAULT); }
-
-  {LeftParen}      { yypushback(yylength()); yybegin(ATTRIBUTE_ENUMERATION); }  
-  {NonEnumContent} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.PARM_ENTITY_TYPE); }
-  {NonEnumContent}|{RightParen}|{Choice}  { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
-  {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ATTRIBUTE_DEFAULT> {
-  {S}              { return createToken(DTDRegionTypes.WHITESPACE); }
-  {Required}       { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.REQUIRED_KEYWORD); }
-  {Implied}        { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.IMPLIED_KEYWORD); }
-  {Fixed}          { return createToken(DTDRegionTypes.FIXED_KEYWORD); }
-  {SingleQuotedLiteral}  { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL); }
-  {DoubleQuotedLiteral}  { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL); }
-  {NonTagContent}   { yypushback(yylength()); yybegin(ATTLIST_CONTENT); } //return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
-  {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ATTRIBUTE_ENUMERATION> {
-  {S}              { return createToken(DTDRegionTypes.WHITESPACE); }
-  {LeftParen}      { return createToken(DTDRegionTypes.LEFT_PAREN); }
-  {Choice}         { return createToken(DTDRegionTypes.ENUM_CHOICE); }
-  {RightParen}     { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.RIGHT_PAREN); }
-  {NonEnumContent}   { return createToken(DTDRegionTypes.NAME); }
-  {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-
-// ******** <!ENTITY...>
-<ENTITY_NAME> {
-  {S}              { return createToken(DTDRegionTypes.WHITESPACE); }
-  {Percent}        { return createToken(DTDRegionTypes.PERCENT); }
-  {EntityName}     { yybegin(ENTITY_CONTENT); return createToken(DTDRegionTypes.NAME); }
-  {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ENTITY_CONTENT> {
-//  {EntityContent} { yybegin(YYINITIAL); return createToken(DTDRegionTypes.ENTITY_CONTENT); }
-  {S}              { return createToken(DTDRegionTypes.WHITESPACE); }
-  {System} | {Public} { yypushback(yylength()); yybegin(EXTERNALID_CONTENT); }
-  {SingleQuotedLiteral}  { return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL); }
-  {DoubleQuotedLiteral}  { return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL); }
-  {NonTagContent}   { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
-  {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-
-// ******** <!NOTATION...>
-<NOTATION_NAME> {
-  {S}              { return createToken(DTDRegionTypes.WHITESPACE); }
-  {Name}           { yybegin(EXTERNALID_CONTENT); return createToken(DTDRegionTypes.NAME); }
-  {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<EXTERNALID_CONTENT> {
-  {S}              { return createToken(DTDRegionTypes.WHITESPACE); }
-  {System}         { return createToken(DTDRegionTypes.SYSTEM_KEYWORD); }  
-  {Public}         { return createToken(DTDRegionTypes.PUBLIC_KEYWORD); }  
-  {SingleQuotedLiteral}  { return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL); }
-  {DoubleQuotedLiteral}  { return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL); }
-  {NData}          { yybegin(NDATA_CONTENT); return createToken(DTDRegionTypes.NDATA_KEYWORD); }
-  {NonTagContent}   { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
-  {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<NDATA_CONTENT> {
-  {S}              { return createToken(DTDRegionTypes.WHITESPACE); }
-  {NonTagContent}  { yybegin(YYINITIAL); return createToken(DTDRegionTypes.NDATA_VALUE); }
-  {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-  
-
-// ******** <!-- ...>
-<COMMENT_CONTENT> {
-  {CommentEnd}  { yybegin(YYINITIAL); return createToken(DTDRegionTypes.COMMENT_END); }
-  {S}              { return createToken(DTDRegionTypes.WHITESPACE); }
-  {CommentContent} | "-" | ">"  { return createToken(DTDRegionTypes.COMMENT_CONTENT); }
-}
-
-
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtdskeleton b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtdskeleton
deleted file mode 100644
index 3dbe086..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtdskeleton
+++ /dev/null
@@ -1,317 +0,0 @@
-
-  /** This character denotes the end of file */
-  final public static int YYEOF = -1;
-
-  /** initial size of the lookahead buffer */
---- final private static int YY_BUFFERSIZE = ...;
-
-  /** lexical states */
----  lexical states, charmap
-
-  /* error codes */
-  final private static int YY_UNKNOWN_ERROR = 0;
-  final 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[YY_BUFFERSIZE];
-
-  /** 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
-   */
-  int yycolumn; 
-
-  /** yy_atEOF == true <=> the scanner is at the 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
-
-
-  /**
-   * 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 yy_refill() throws java.io.IOException {
-
-    /* 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 < 0) {
-      return true;
-    }
-    else {
-      yy_endRead+= numRead;  
-      return false;
-    }
-  }
-
-    
-  /**
-   * 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    */
-
-    if (yy_reader != null)
-      yy_reader.close();
-  }
-
-
-  /**
-   * Closes the current stream, and resets the
-   * scanner to read from a new input stream.
-   *
-   * 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>YY_INITIAL</tt>.
-   *
-   * @param reader   the new input stream 
-   */
-  final public void yyreset(java.io.Reader reader) throws java.io.IOException {
-    yyclose();
-    yy_reader = reader;
-    yy_atEOF  = false;
-    yy_endRead = yy_startRead = 0;
-    yy_currentPos = yy_markedPos = yy_pushbackPos = 0;
-    yyline = yychar = yycolumn = 0;
-    yy_lexical_state = YYINITIAL;
-  }
-
-
-  /**
-   * 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 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
-   */
-  final public char yycharat(int pos) {
-    return yy_buffer[yy_startRead+pos];
-  }
-
-
-  /**
-   * Returns the length of the matched text region.
-   */
-  final public int yylength() {
-    return yy_markedPos-yy_startRead;
-  }
-
-
-  /**
-   * 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
-   */
---- yy_ScanError declaration  
-    String message;
-    try {
-      message = YY_ERROR_MSG[errorCode];
-    }
-    catch (ArrayIndexOutOfBoundsException e) {
-      message = YY_ERROR_MSG[YY_UNKNOWN_ERROR];
-    }
-
---- throws clause
-  } 
-
-
-  /**
-   * 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()!
-   */
---- yypushback decl (contains yy_ScanError exception)
-    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   java.io.IOException  if any I/O-Error occurs
-   */
---- yylex declaration
-    int yy_input;
-    int yy_action;
-
-    // cached fields:
-    int yy_currentPos_l;
-    int yy_markedPos_l;
-    int yy_endRead_l = yy_endRead;
-    char [] yy_buffer_l = yy_buffer;
-    char [] yycmap_l = yycmap;
-
---- local declarations
-
-    while (true) {
-      yy_markedPos_l = yy_markedPos;
-
---- start admin (line, char, col count)
-      yy_action = -1;
-
-      yy_currentPos_l = yy_currentPos = 
-                       yy_startRead = yy_markedPos_l;
-  
---- start admin (lexstate etc)
-
-      yy_forAction: {
-        while (true) {
-    
---- next input, line, col, char count, next transition, isFinal action
-            yy_action = yy_state; 
-            yy_markedPos_l = yy_currentPos_l; 
---- line count update
-          }
-
-        }
-      }
-
-      // store back cached position
-      yy_markedPos = yy_markedPos_l;
---- 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.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDBatchNodeDelete.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDBatchNodeDelete.java
deleted file mode 100644
index e56e98c..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDBatchNodeDelete.java
+++ /dev/null
@@ -1,57 +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.dtd.core.internal.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-
-
-public class DTDBatchNodeDelete {
-	protected DTDFile dtdFile;
-
-	protected List nodes = new ArrayList();
-
-	public DTDBatchNodeDelete(DTDFile dtdFile) {
-		this.dtdFile = dtdFile;
-	}
-
-	public void addNode(DTDNode node) {
-		// first check if the node is contained by anyone
-		for (int i = 0; i < nodes.size(); i++) {
-			DTDNode currentNode = (DTDNode) nodes.get(i);
-
-			if (currentNode.containsRange(node.getStartOffset(), node.getEndOffset())) {
-				// then no need to add the node to the list to be deleted
-				return;
-			}
-
-			if (node.getStartOffset() < currentNode.getStartOffset() && node.getEndOffset() <= currentNode.getStartOffset()) {
-				nodes.add(i, node);
-				return;
-			}
-		}
-		// if we get here, then add it to the end
-		nodes.add(node);
-	}
-
-	public void deleteNodes(Object requestor) {
-		for (int i = nodes.size() - 1; i >= 0; i--) {
-			DTDNode node = (DTDNode) nodes.get(i);
-			dtdFile.deleteNode(requestor, node);
-		}
-		nodes.clear();
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDExternalReferenceRemover.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDExternalReferenceRemover.java
deleted file mode 100644
index 7c1aba3..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDExternalReferenceRemover.java
+++ /dev/null
@@ -1,134 +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.dtd.core.internal.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-
-
-/*
- * This class is responsible for updating the model when items are deleted or
- * so that items referenced by it are cleaned up note that top level nodes are
- * queued up for deletion so that iteration over the list of nodes from the
- * dtdfile is not messed up. Note that when an external parmeter entity
- * changes, the client of the model (e.g. editor) must be a DTDFileListener
- * implementing the listener's interface to keep the model's referential
- * integrity (See DTDModelImpl for example).
- */
-
-public class DTDExternalReferenceRemover extends DTDVisitor {
-
-	protected DTDBatchNodeDelete batchDelete;
-	protected List externalElementsAndParmEntities = new ArrayList();
-
-	protected boolean isParmEntity = false;
-
-	protected boolean isUpdating = false;
-	protected DTDNode nodeToDelete;
-	protected String oldRefName = ""; //$NON-NLS-1$
-	protected Object requestor;
-
-	public DTDExternalReferenceRemover() {
-
-	}
-
-	public synchronized void externalReferenceAboutToChange(Object requestor, Entity entity) {
-		if (isUpdating) {
-			return;
-		}
-		if (!entity.isParameterEntity() || !entity.isExternalEntity()) {
-			// if it is not an external parameter entity, ignore as well
-			return;
-		}
-
-		isUpdating = true;
-		this.requestor = requestor;
-
-		DTDFile dtdFile = entity.getDTDFile();
-		if (batchDelete == null) {
-			batchDelete = new DTDBatchNodeDelete(dtdFile);
-		}
-
-		// See the comment at the head of this file regarding
-		// external parameter entities.
-		// externalElementsAndParmEntities =
-		// dtdFile.getDTDModel().getExternalModels().getElementContentNames(entity.getPublicID(),
-		// dtdFile.getDTDModel().resolveID(entity.getPublicID(),
-		// entity.getSystemID()));
-
-		visit(dtdFile);
-
-		batchDelete.deleteNodes(requestor);
-
-		isUpdating = false;
-	}
-
-	public boolean isMatchingName(String name) {
-		return externalElementsAndParmEntities.contains(name);
-	}
-
-	public void visitAttribute(Attribute attr) {
-		super.visitAttribute(attr);
-		String attrName = attr.getName();
-		String attrType = attr.getType();
-
-		if (isParameterEntityRef(attrName)) {
-			if (isMatchingName(attrName)) {
-				attr.setName(requestor, "TempName"); //$NON-NLS-1$
-			}
-		}
-		if (isParameterEntityRef(attrType)) {
-			if (isMatchingName(attrType)) {
-				attr.setType(requestor, Attribute.CDATA);
-			}
-		}
-	}
-
-	public void visitAttributeList(AttributeList attList) {
-		super.visitAttributeList(attList);
-		String attListName = attList.getName();
-		if (isParameterEntityRef(attListName)) {
-			if (isMatchingName(attListName)) {
-				attList.setName(requestor, "TempName"); //$NON-NLS-1$
-			}
-		}
-	}
-
-	public void visitElement(Element element) {
-		String elementName = element.getName();
-		if (isParameterEntityRef(elementName)) {
-			if (isMatchingName(elementName)) {
-				element.setName(requestor, "TempName"); //$NON-NLS-1$
-			}
-		}
-		super.visitElement(element);
-	}
-
-	public void visitReference(CMBasicNode node) {
-		super.visitReference(node);
-		String refName = node.getName();
-		if (isMatchingName(refName)) {
-			batchDelete.addNode(node);
-		}
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDModelUpdater.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDModelUpdater.java
deleted file mode 100644
index 21bf476..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDModelUpdater.java
+++ /dev/null
@@ -1,135 +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.dtd.core.internal.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.ParameterEntityReference;
-
-
-// this class is responsible for updating the model when items
-// are deleted or a external parm entity changes so that
-// items referenced by it are cleaned up
-// note that top level nodes are queued up for deletion so that
-// iteration over the list of nodes from the dtdfile is not messed up
-public class DTDModelUpdater extends DTDVisitor {
-
-	protected boolean isParmEntity = false;
-
-	protected boolean isUpdating = false;
-
-	protected List nodesToDelete = new ArrayList();
-	protected DTDNode nodeToDelete;
-	protected String oldRefName = ""; //$NON-NLS-1$
-	protected Object requestor;
-
-	public DTDModelUpdater() {
-
-	}
-
-	public synchronized void objectAboutToBeDeleted(Object requestor, DTDNode node) {
-		if (isUpdating) {
-			return;
-		}
-		if (!(node instanceof Entity || node instanceof Element)) {
-			// just ignore if it is not one of these
-			return;
-		}
-		if (node instanceof Entity && !((Entity) node).isParameterEntity()) {
-			// if it is not a parameter entity, ignore as well
-			return;
-		}
-
-
-		isUpdating = true;
-		this.requestor = requestor;
-		this.nodeToDelete = node;
-		oldRefName = node.getName();
-		isParmEntity = false;
-		nodesToDelete.clear();
-
-		if (node instanceof Entity) {
-			isParmEntity = true;
-			oldRefName = "%" + oldRefName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		DTDFile dtdFile = node.getDTDFile();
-		visit(dtdFile);
-
-		for (int i = 0; i < nodesToDelete.size(); i++) {
-			dtdFile.deleteNode(requestor, (DTDNode) nodesToDelete.get(i));
-		}
-
-		isUpdating = false;
-	}
-
-	public void visitAttribute(Attribute attr) {
-		super.visitAttribute(attr);
-		if (isParmEntity) {
-			if (attr.getName().equals(oldRefName)) {
-				attr.setName(requestor, "TempName"); //$NON-NLS-1$
-			}
-			if (attr.getType().equals(oldRefName)) {
-				attr.setType(requestor, Attribute.CDATA);
-			}
-		}
-		// check the attr name and the attr type to see if it
-		// needs updating
-	}
-
-	public void visitAttributeList(AttributeList attList) {
-		super.visitAttributeList(attList);
-		if (attList.getName().equals(oldRefName)) {
-			if (isParmEntity) {
-				attList.setName(requestor, "TempName"); //$NON-NLS-1$
-			}
-			else {
-				// save up for later deletion
-				nodesToDelete.add(attList);
-			}
-		}
-	}
-
-	public void visitElement(Element element) {
-		if (isParmEntity) {
-			if (element.getName().equals(oldRefName)) {
-				element.setName(requestor, "TempName"); //$NON-NLS-1$
-			}
-		}
-		super.visitElement(element);
-	}
-
-	public void visitExternalParameterEntityReference(ParameterEntityReference parmEntityRef) {
-		super.visitExternalParameterEntityReference(parmEntityRef);
-		if (isParmEntity && parmEntityRef.getName().equals(oldRefName)) {
-			nodesToDelete.add(parmEntityRef);
-		}
-	}
-
-	public void visitReference(CMBasicNode node) {
-		super.visitReference(node);
-
-		if (node.getName().equals(oldRefName)) {
-			DTDNode parent = (DTDNode) node.getParentNode();
-			parent.delete(requestor, node);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDNotationReferenceRemover.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDNotationReferenceRemover.java
deleted file mode 100644
index 35cbf84..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDNotationReferenceRemover.java
+++ /dev/null
@@ -1,93 +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.dtd.core.internal.util;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeEnumList;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.Notation;
-
-
-public class DTDNotationReferenceRemover {
-	protected Notation notation;
-	protected String notationName;
-
-	protected Object requestor;
-
-	public DTDNotationReferenceRemover() {
-
-	}
-
-	public void notationAboutToBeDeleted(Object requestor, Notation notation) {
-		this.requestor = requestor;
-		this.notation = notation;
-		notationName = notation.getName();
-
-		visit(notation.getDTDFile());
-	}
-
-	public void visit(DTDFile file) {
-		List nodes = file.getNodes();
-		for (int i = 0; i < nodes.size(); i++) {
-			DTDNode currentNode = (DTDNode) nodes.get(i);
-			if (currentNode instanceof Entity) {
-				visitEntity((Entity) currentNode);
-			}
-			else if (currentNode instanceof AttributeList) {
-				visitAttributeList((AttributeList) currentNode);
-			}
-		}
-	}
-
-	public void visitAttribute(Attribute attr) {
-		if (attr.getType().equals(Attribute.ENUMERATED_NOTATION)) {
-			AttributeEnumList enumList = attr.getEnumList();
-			List notationNames = enumList.getItems();
-			Iterator iter = notationNames.iterator();
-			boolean updateRequired = false;
-			while (iter.hasNext()) {
-				String notation = (String) iter.next();
-				if (notation.equals(notationName)) {
-					updateRequired = true;
-					iter.remove();
-				}
-			}
-			if (updateRequired) {
-				String[] newItems = new String[notationNames.size()];
-				notationNames.toArray(newItems);
-				enumList.setItems(requestor, newItems);
-			}
-		}
-	}
-
-	public void visitAttributeList(AttributeList attList) {
-		Attribute attr = (Attribute) attList.getFirstChild();
-		while (attr != null) {
-			visitAttribute(attr);
-			attr = (Attribute) attr.getNextSibling();
-		}
-	}
-
-	public void visitEntity(Entity entity) {
-		if (entity.getNotationName().equals(notationName)) {
-			entity.setNotationName(requestor, ""); //$NON-NLS-1$
-		}
-	}
-
-}// DTDNotationRemover
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDReferenceUpdater.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDReferenceUpdater.java
deleted file mode 100644
index 26931d8..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDReferenceUpdater.java
+++ /dev/null
@@ -1,196 +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.dtd.core.internal.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeEnumList;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.Notation;
-import org.eclipse.wst.dtd.core.internal.ParameterEntityReference;
-
-
-// this class is responsible for updating any dtd node in
-// response to a change in the node that they reference
-public class DTDReferenceUpdater extends DTDVisitor {
-	protected boolean isNotation = false;
-
-	protected boolean isParmEntity = false;
-
-	protected boolean isUpdating = false;
-	protected String newName = ""; //$NON-NLS-1$
-	protected String oldRefName = "", newRefName = ""; //$NON-NLS-1$ //$NON-NLS-2$
-	protected DTDNode referencedNode = null;
-
-	// the references List is a cache of the DTDNodes that are changed
-	// as a result of a call to nameAboutToChange(). The idea is that
-	// if a subsequent call comes in that changes the name of the same
-	// object for which this cache exists for, then we optimize the
-	// path by just walking the cache
-	private List references = new ArrayList();
-	protected Object requestor;
-
-	public DTDReferenceUpdater() {
-
-	}
-
-	public void clearCache() {
-		referencedNode = null;
-		references.clear();
-	}
-
-	public synchronized void nameAboutToChange(Object requestor, DTDNode referencedNode, String newName) {
-		if (isUpdating) {
-			return;
-		}
-		if (!(referencedNode instanceof Entity || referencedNode instanceof Element || referencedNode instanceof Notation)) {
-			// just ignore if it is not one of these
-			return;
-		}
-		if (referencedNode instanceof Entity && !((Entity) referencedNode).isParameterEntity()) {
-			// if it is not a parameter entity, ignore as well
-			return;
-		}
-
-		isUpdating = true;
-		this.requestor = requestor;
-		oldRefName = referencedNode.getName();
-		this.newName = newRefName = newName;
-		isParmEntity = false;
-		isNotation = referencedNode instanceof Notation;
-
-		if (referencedNode instanceof Entity) {
-			isParmEntity = true;
-			oldRefName = "%" + oldRefName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
-			newRefName = "%" + newRefName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		if (this.referencedNode != null) {
-			// check if the previous referenced node that was changed
-			// is the same as the one that is coming in. if so, just
-			// change the previous regions
-			if (this.referencedNode == referencedNode) {
-				quickUpdate();
-				isUpdating = false;
-				return;
-			}
-		}
-
-		// clear the cache if we get here
-		this.referencedNode = referencedNode;
-		references.clear();
-		DTDFile dtdFile = referencedNode.getDTDFile();
-		visit(dtdFile);
-		isUpdating = false;
-	}
-
-	protected void quickUpdate() {
-		for (int i = 0; i < references.size(); i++) {
-			DTDNode node = (DTDNode) references.get(i);
-			if (node instanceof Element) {
-				visitElement((Element) node);
-			}
-			else if (node instanceof AttributeList) {
-				visitAttributeList((AttributeList) node);
-			}
-			else if (node instanceof Attribute) {
-				visitAttribute((Attribute) node);
-			}
-			else if (node instanceof CMBasicNode) {
-				visitReference((CMBasicNode) node);
-			}
-			else if (node instanceof ParameterEntityReference) {
-				visitExternalParameterEntityReference((ParameterEntityReference) node);
-			}
-		}
-	}
-
-	public void visitAttribute(Attribute attr) {
-		super.visitAttribute(attr);
-		if (isParmEntity) {
-			// check the attr name and the attr type to see if it
-			// needs updating
-			if (attr.getName().equals(oldRefName)) {
-				attr.setName(requestor, newRefName);
-				references.add(attr);
-			}
-			if (attr.getType().equals(oldRefName)) {
-				attr.setType(requestor, newRefName);
-				references.add(attr);
-			}
-		}
-		else if (isNotation && attr.getType().equals(Attribute.ENUMERATED_NOTATION)) {
-			AttributeEnumList enumList = attr.getEnumList();
-			List items = enumList.getItems();
-			boolean updateNeeded = false;
-			for (int i = 0; i < items.size(); i++) {
-				String notationName = (String) items.get(i);
-				if (notationName.equals(oldRefName)) {
-					updateNeeded = true;
-					items.set(i, newName);
-				}
-			}
-			if (updateNeeded) {
-				String[] newItems = new String[items.size()];
-
-				enumList.setItems((String[]) items.toArray(newItems));
-			}
-		}
-
-	}
-
-	public void visitAttributeList(AttributeList attList) {
-		if (!isNotation && attList.getName().equals(oldRefName)) {
-			attList.setName(requestor, newRefName);
-			references.add(attList);
-		}
-		super.visitAttributeList(attList);
-	}
-
-	public void visitElement(Element element) {
-		if (isParmEntity) {
-			if (element.getName().equals(oldRefName)) {
-				element.setName(requestor, newRefName);
-				references.add(element);
-			}
-		}
-		super.visitElement(element);
-	}
-
-	public void visitExternalParameterEntityReference(ParameterEntityReference parmEntityRef) {
-		super.visitExternalParameterEntityReference(parmEntityRef);
-		if (parmEntityRef.getName().equals(oldRefName)) {
-			parmEntityRef.setReferencedEntity(requestor, newName);
-			references.add(parmEntityRef);
-		}
-	}
-
-	public void visitReference(CMBasicNode node) {
-		super.visitReference(node);
-		if (isParameterEntityRef(oldRefName) && !isParmEntity) {
-			return;
-		}
-
-		if (node.getName().equals(oldRefName)) {
-			node.setName(requestor, newRefName);
-			references.add(node);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDUniqueNameHelper.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDUniqueNameHelper.java
deleted file mode 100644
index 9c339d8..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDUniqueNameHelper.java
+++ /dev/null
@@ -1,95 +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.dtd.core.internal.util;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.Notation;
-
-
-public class DTDUniqueNameHelper {
-
-	static public String getName(Object obj) {
-		if (obj instanceof Element) {
-			return ((Element) obj).getName();
-		}
-		else if (obj instanceof Entity) {
-			return ((Entity) obj).getName();
-		}
-		else if (obj instanceof Notation) {
-			return ((Notation) obj).getName();
-		}
-		else if (obj instanceof Attribute) {
-			return ((Attribute) obj).getName();
-		}
-		else if (obj instanceof CMBasicNode) // Model Group Content
-		{
-			return ((CMBasicNode) obj).getName();
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	static public String getUniqueAttributeName(Element element) {
-		List attrs = element.getElementAttributes();
-		return getUniqueName(attrs, "NewAttribute"); //$NON-NLS-1$
-	}
-
-	static public String getUniqueElementName(DTDFile dtdFile) {
-		List elements = dtdFile.getElementsAndParameterEntityReferences().getNodes();
-		return getUniqueName(elements, "NewElement"); //$NON-NLS-1$
-	}
-
-	static public String getUniqueEntityName(DTDFile dtdFile) {
-		List entities = dtdFile.getEntities().getNodes();
-		return getUniqueName(entities, "NewEntity"); //$NON-NLS-1$
-	}
-
-	static public String getUniqueName(List objs, String token) {
-		int counter = 1;
-
-		boolean uniqueName = false;
-		while (!uniqueName) {
-			String newName = token + new Integer(counter++);
-			uniqueName = true;
-			Iterator iter = objs.iterator();
-			while (iter.hasNext()) {
-				Object obj = iter.next();
-				String objName = getName(obj);
-				if (objName.equals(newName)) {
-					uniqueName = false;
-					break;
-				}
-			}
-			if (uniqueName) {
-				return newName;
-			}
-		}
-		// we shouldn't get here
-		return "No Name found"; //$NON-NLS-1$
-	}
-
-	static public String getUniqueNotationName(DTDFile dtdFile) {
-		List notations = dtdFile.getNotations().getNodes();
-		return getUniqueName(notations, "NewNotation"); //$NON-NLS-1$
-	}
-
-	public DTDUniqueNameHelper() {
-	}
-
-} // DTDUniqueNameHelper
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDVisitor.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDVisitor.java
deleted file mode 100644
index d3e6d01..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDVisitor.java
+++ /dev/null
@@ -1,108 +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.dtd.core.internal.util;
-
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.ParameterEntityReference;
-
-
-public class DTDVisitor {
-
-	public DTDVisitor() {
-
-	}
-
-	// utility method
-	public boolean isParameterEntityRef(String reference) {
-		if (reference.length() > 0) {
-			return reference.charAt(0) == '%' && reference.charAt(reference.length() - 1) == ';';
-		}
-		return false;
-	}
-
-	public void visit(DTDFile file) {
-		List nodes = file.getNodes();
-		for (int i = 0; i < nodes.size(); i++) {
-			DTDNode currentNode = (DTDNode) nodes.get(i);
-			if (currentNode instanceof Element) {
-				visitElement((Element) currentNode);
-			}
-			else if (currentNode instanceof AttributeList) {
-				visitAttributeList((AttributeList) currentNode);
-			}
-			else if (currentNode instanceof ParameterEntityReference) {
-				visitExternalParameterEntityReference((ParameterEntityReference) currentNode);
-			}
-		}
-	}
-
-	public void visitAttribute(Attribute attr) {
-	}
-
-	public void visitAttributeList(AttributeList attList) {
-		// note that we don't visit attributes here because we
-		// want the element to visit them with it's consolidated list
-		// that it creates by gathering all attribute lists together
-	}
-
-	public void visitAttributes(List attributes) {
-		int size = attributes.size();
-		for (int i = 0; i < size; i++) {
-			Attribute attr = (Attribute) attributes.get(i);
-			visitAttribute(attr);
-		}
-	}
-
-	public void visitContentNode(CMNode content) {
-		if (content instanceof CMBasicNode) {
-			CMBasicNode basicNode = (CMBasicNode) content;
-			if (basicNode.isReference()) {
-				visitReference(basicNode);
-			}
-		}
-		else if (content instanceof CMGroupNode) {
-			visitGroupNode((CMGroupNode) content);
-		}
-	}
-
-	public void visitElement(Element element) {
-		CMNode content = element.getContentModel();
-		visitContentNode(content);
-		visitAttributes(element.getElementAttributes());
-	}
-
-	public void visitExternalParameterEntityReference(ParameterEntityReference parmEntityRef) {
-	}
-
-	public void visitGroupNode(CMGroupNode group) {
-		List children = group.getChildrenList();
-		int size = children.size();
-		for (int i = 0; i < size; i++) {
-			visitContentNode((CMNode) children.get(i));
-		}
-	}
-
-	public void visitReference(CMBasicNode node) {
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/LabelValuePair.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/LabelValuePair.java
deleted file mode 100644
index f51d872..0000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/LabelValuePair.java
+++ /dev/null
@@ -1,30 +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.dtd.core.internal.util;
-
-import org.eclipse.jface.util.Assert;
-
-public class LabelValuePair {
-
-	public String fLabel;
-	public Object fValue;
-
-	/**
-	 * Creates a new name/value item
-	 */
-	public LabelValuePair(String label, Object value) {
-		Assert.isTrue(label != null);
-		fLabel = label;
-		fValue = value;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/.classpath b/bundles/org.eclipse.wst.dtd.ui/.classpath
deleted file mode 100644
index ed58bc2..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="src-validation"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.dtd.ui/.cvsignore b/bundles/org.eclipse.wst.dtd.ui/.cvsignore
deleted file mode 100644
index a47a3e3..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-bin
-runtime
-dtdui.jar
-*.zip
-build.xml
-temp.folder
-@dot
diff --git a/bundles/org.eclipse.wst.dtd.ui/.options b/bundles/org.eclipse.wst.dtd.ui/.options
deleted file mode 100644
index 35173eb..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/.options
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.wst.dtd.ui/projectionperf=false
diff --git a/bundles/org.eclipse.wst.dtd.ui/.project b/bundles/org.eclipse.wst.dtd.ui/.project
deleted file mode 100644
index 16b209c..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/.project
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.dtd.ui</name>
-	<comment></comment>
-	<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.dtd.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 416293a..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,69 +0,0 @@
-#Sat Oct 01 04:04:48 EDT 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-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=500
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-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.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=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-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.missingSerialVersion=warning
-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=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-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.unsafeTypeOperation=warning
-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.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.dtd.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 42fb716..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Fri May 27 23:56:32 EDT 2005
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-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.dtd.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.dtd.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 3dc3da7..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,40 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.dtd.ui; singleton:=true
-Bundle-Version: 1.0.1.qualifier
-Bundle-Activator: org.eclipse.wst.dtd.ui.internal.DTDUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.dtd.ui,
- org.eclipse.wst.dtd.ui.internal,
- org.eclipse.wst.dtd.ui.internal.dnd,
- org.eclipse.wst.dtd.ui.internal.editor,
- org.eclipse.wst.dtd.ui.internal.preferences,
- org.eclipse.wst.dtd.ui.internal.projection,
- org.eclipse.wst.dtd.ui.internal.registry,
- org.eclipse.wst.dtd.ui.internal.style,
- org.eclipse.wst.dtd.ui.internal.templates,
- org.eclipse.wst.dtd.ui.internal.text,
- org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions,
- org.eclipse.wst.dtd.ui.internal.views.properties,
- org.eclipse.wst.dtd.ui.internal.wizard,
- org.eclipse.wst.dtd.ui.internal.validation,
- org.eclipse.wst.dtd.ui.views.contentoutline
-Require-Bundle: org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.jface.text,
- org.eclipse.ui,
- org.eclipse.ui.editors,
- org.eclipse.ui.ide,
- org.eclipse.ui.views,
- org.eclipse.ui.workbench,
- org.eclipse.ui.workbench.texteditor,
- org.eclipse.wst.common.ui,
- org.eclipse.wst.dtd.core,
- org.eclipse.wst.sse.core,
- org.eclipse.wst.sse.ui,
- org.eclipse.wst.xml.core,
- org.eclipse.wst.validation,
- org.eclipse.wst.xml.ui
-Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.dtd.ui/about.html b/bundles/org.eclipse.wst.dtd.ui/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>February 24, 2005</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.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/build.properties b/bundles/org.eclipse.wst.dtd.ui/build.properties
deleted file mode 100644
index 387f23d..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/build.properties
+++ /dev/null
@@ -1,25 +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
-#     
-###############################################################################
-bin.includes = plugin.xml,\
-               icons/,\
-               plugin.properties,\
-               META-INF/,\
-               .options,\
-               .,\
-               about.html
-bin.excludes = bin/**,\
-               @dot/**,\
-               temp.folder/**
-source.. = src/,\
-           src-validation/
-src.includes = build.properties
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Attribute.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Attribute.gif
deleted file mode 100644
index 00bb7b4..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Attribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Element.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Element.gif
deleted file mode 100644
index 01f4889..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Element.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_ElementToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_ElementToConModel.gif
deleted file mode 100644
index 1a8236b..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_ElementToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_GroupToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_GroupToConModel.gif
deleted file mode 100644
index 8168fb3..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_GroupToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Attribute.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Attribute.gif
deleted file mode 100644
index a7fb780..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Attribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Element.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Element.gif
deleted file mode 100644
index 3755e5e..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Element.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_ElementToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_ElementToConModel.gif
deleted file mode 100644
index 1a58e11..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_ElementToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_GroupToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_GroupToConModel.gif
deleted file mode 100644
index d525a21..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_GroupToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/newdtd_wiz.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/newdtd_wiz.gif
deleted file mode 100644
index 33f634f..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/newdtd_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Attribute.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Attribute.gif
deleted file mode 100644
index 00bb7b4..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Attribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Element.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Element.gif
deleted file mode 100644
index 01f4889..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Element.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_ElementToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_ElementToConModel.gif
deleted file mode 100644
index 1a8236b..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_ElementToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_GroupToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_GroupToConModel.gif
deleted file mode 100644
index 8168fb3..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_GroupToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/newdtd_wiz.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/newdtd_wiz.gif
deleted file mode 100644
index 10b1a77..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/newdtd_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Comment.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Comment.gif
deleted file mode 100644
index 39611d6..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Comment.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity.gif
deleted file mode 100644
index cb41506..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity_Reference.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity_Reference.gif
deleted file mode 100644
index 5efa9b9..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity_Reference.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Notation.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Notation.gif
deleted file mode 100644
index 57ad089..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Notation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/DTDFile.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/DTDFile.gif
deleted file mode 100644
index 211c437..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/DTDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/newdtd_wiz.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/newdtd_wiz.gif
deleted file mode 100644
index 2c115ff..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/newdtd_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/organize_dtd_logically.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/organize_dtd_logically.gif
deleted file mode 100644
index 093c6ba..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/organize_dtd_logically.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sort.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sort.gif
deleted file mode 100644
index 23c5d0b..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sort.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sourceEditor.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sourceEditor.gif
deleted file mode 100644
index 75ebdb8..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/validate.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/validate.gif
deleted file mode 100644
index 86196e9..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/validate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/wizban/newdtdfile_wiz.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/wizban/newdtdfile_wiz.gif
deleted file mode 100644
index 1cc7977..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/wizban/newdtdfile_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/plugin.properties b/bundles/org.eclipse.wst.dtd.ui/plugin.properties
deleted file mode 100644
index afc1c30..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/plugin.properties
+++ /dev/null
@@ -1,36 +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
-#     
-###############################################################################
-! Properties file for component: XMDTD - XML Tools DTD Editor
-! Packaged for translation in:  xml.zip
-
-providerName=Eclipse.org
-pluginName=SSE DTD Source Editor
-nlFeatureName=SSE DTD Source Editor NL Support
-
-DTD_Source_Page_Editor.name=DTD Editor
-_UI_LABEL_DTD_FILES=DTD Files
-DTD_Templates.name=DTD Templates
-_UI_LABEL_DTD_STYLES=DTD Styles
-_UI_WIZARD_NEW_DTD=DTD File
-_UI_CREATE_NEW_DTD_FILE=Create a new DTD file
-##
-AddTask.label=Add &Task...
-AddTask.tooltip=Add Task...
-AddBookmark.label=Add Boo&kmark...
-AddBookmark.tooltip=Add Bookmark...
-SelectRuler.label=Select Ruler
-
-_UI_MENU_VALIDATE_DTD               = &Validate DTD File
-_UI_XML_DTD_VALIDATOR                = DTD Validator
-
-DTD_New_context_type_Extension_Element.name=New DTD
diff --git a/bundles/org.eclipse.wst.dtd.ui/plugin.xml b/bundles/org.eclipse.wst.dtd.ui/plugin.xml
deleted file mode 100644
index e1ff99f..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/plugin.xml
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-	<extension point="org.eclipse.ui.editors">
-		<editor
-			name="%DTD_Source_Page_Editor.name"
-			icon="icons/full/obj16/DTDFile.gif"
-			contributorClass="org.eclipse.wst.dtd.ui.internal.editor.ActionContributorDTD"
-			class="org.eclipse.wst.sse.ui.StructuredTextEditor"
-			symbolicFontName="org.eclipse.wst.sse.ui.textfont"
-			id="org.eclipse.wst.dtd.core.dtdsource.source">
-			<contentTypeBinding
-				contentTypeId="org.eclipse.wst.dtd.core.dtdsource" />
-		</editor>
-	</extension>
-
-	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
-		<contentOutlineConfiguration
-			class="org.eclipse.wst.dtd.ui.views.contentoutline.DTDContentOutlineConfiguration"
-			target="org.eclipse.wst.dtd.core.dtdsource" />
-		<sourceViewerConfiguration
-			class="org.eclipse.wst.dtd.ui.StructuredTextViewerConfigurationDTD"
-			target="org.eclipse.wst.dtd.core.dtdsource" />
-		<provisionalConfiguration
-			type="characterpairmatcher"
-			class="org.eclipse.wst.dtd.ui.internal.text.DTDDocumentRegionEdgeMatcher"
-			target="org.eclipse.wst.dtd.core.dtdsource" />
-		<provisionalConfiguration
-			type="structuredtextfoldingprovider"
-			class="org.eclipse.wst.dtd.ui.internal.projection.StructuredTextFoldingProviderDTD"
-			target="org.eclipse.wst.dtd.core.dtdsource" />
-		<provisionalDefinition
-			type="preferencepages"
-			value="org.eclipse.wst.sse.ui.preferences.dtd, org.eclipse.wst.sse.ui.preferences.dtd.templates, org.eclipse.wst.sse.ui.preferences.dtd.styles"
-			target="org.eclipse.wst.dtd.core.dtdsource" />
-		<!-- provide syntax highlighting for DTD subset within XML -->
-		<provisionalConfiguration
-			type="linestyleprovider"
-			class="org.eclipse.wst.dtd.ui.internal.style.LineStyleProviderForDTDSubSet"
-			target="org.eclipse.wst.xml.dtd.internal_subset" />
-	</extension>
-
-	<extension point="org.eclipse.ui.editorActions">
-        <editorContribution
-            targetID="org.eclipse.wst.dtd.core.dtdsource.source"
-            id="org.eclipse.wst.dtd.core.dtdsource.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>
-
-	<!-- use a specific annotation model with FileBuffers -->
-	<extension
-		point="org.eclipse.core.filebuffers.annotationModelCreation">
-		<factory
-			contentTypeId="org.eclipse.wst.dtd.core.dtdsource"
-			class="org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModelFactory" />
-	</extension>
-
-	<!-- Register the UI adapter factory provider -->
-	<extension
-		point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
-		<adapterFactoryDescription
-			class="org.eclipse.wst.dtd.ui.internal.registry.AdapterFactoryProviderForDTD">
-			<contentType id="org.eclipse.wst.dtd.core.dtdsource" />
-		</adapterFactoryDescription>
-	</extension>
-
-	<!-- Editor actionsets -->
-	<extension point="org.eclipse.ui.actionSetPartAssociations">
-		<actionSetPartAssociation
-			targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
-			<part id="org.eclipse.wst.dtd.core.dtdsource.source" />
-		</actionSetPartAssociation>
-		<actionSetPartAssociation
-			targetID="org.eclipse.ui.NavigateActionSet">
-			<part id="org.eclipse.wst.dtd.core.dtdsource.source" />
-		</actionSetPartAssociation>
-	</extension>
-
-	<extension point="org.eclipse.ui.preferencePages">
-		<page
-			name="%_UI_LABEL_DTD_FILES"
-			category="org.eclipse.wst.sse.ui.internal.provisional.preferences"
-			class="org.eclipse.wst.dtd.ui.internal.preferences.DTDFilesPreferencePage"
-			id="org.eclipse.wst.sse.ui.preferences.dtd">
-		</page>
-		<page
-			name="%DTD_Templates.name"
-			category="org.eclipse.wst.sse.ui.preferences.dtd"
-			class="org.eclipse.wst.dtd.ui.internal.preferences.DTDTemplatePreferencePage"
-			id="org.eclipse.wst.sse.ui.preferences.dtd.templates">
-		</page>
-		<page
-			name="%_UI_LABEL_DTD_STYLES"
-			category="org.eclipse.wst.sse.ui.preferences.dtd"
-			class="org.eclipse.wst.dtd.ui.internal.preferences.DTDColorPage"
-			id="org.eclipse.wst.sse.ui.preferences.dtd.styles">
-		</page>
-	</extension>
-
-	<!-- New DTD wizard -->
-	<extension point="org.eclipse.ui.newWizards">
-		<wizard
-			id="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard"
-			name="%_UI_WIZARD_NEW_DTD"
-			class="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard"
-			category="org.eclipse.wst.XMLCategory"
-			icon="icons/full/etool16/newdtd_wiz.gif">
-			<description>%_UI_CREATE_NEW_DTD_FILE</description>
-			<selection class="org.eclipse.core.resources.IResource" />
-		</wizard>
-	</extension>
-
-	<!-- initialize DTD ui preferences -->
-	<extension point="org.eclipse.core.runtime.preferences">
-		<initializer
-			class="org.eclipse.wst.dtd.ui.internal.preferences.DTDUIPreferenceInitializer" />
-	</extension>
-
-	<extension point="org.eclipse.ui.popupMenus">
-		<viewerContribution
-			targetID="org.eclipse.wst.dtd.core.dtdsource.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>
-
-	<!-- ====================================================== -->
-	<!-- Define Assign Validate action on .dtd file             -->
-	<!-- ====================================================== -->
-	<extension point="org.eclipse.ui.popupMenus">
-		<objectContribution
-			objectClass="org.eclipse.core.resources.IFile"
-			nameFilter="*.dtd"
-			id="org.eclipse.wst.dtd.validation.dtdaction">
-			<action
-				label="%_UI_MENU_VALIDATE_DTD"
-				class="org.eclipse.wst.dtd.ui.internal.validation.ValidateDTDActionDelegate"
-				enablesFor="1"
-				id="org.eclipse.wst.dtd.ui.internal.validation.ValidateDTDActionDelegate">
-			</action>
-		</objectContribution>
-	</extension>
-
-	<!-- ====================================================== -->
-	<!-- Register the DTD validator with the validation 		-->
-	<!-- framework. 										    -->
-	<!-- ====================================================== -->
-	<extension
-		id="dtdDTDValidator"
-		name="%_UI_XML_DTD_VALIDATOR"
-		point="org.eclipse.wst.validation.validator">
-		<validator>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				caseSensitive="false"
-				nameFilter="*.dtd">
-			</filter>
-			<helper
-				class="org.eclipse.wst.xml.core.internal.validation.core.Helper">
-			</helper>
-			<run
-				class="org.eclipse.wst.dtd.ui.internal.validation.DTDValidator">
-			</run>
-		</validator>
-	</extension>
-
-	<!-- ====================================================== -->
-	<!-- DTD as you type validation								-->
-	<!-- ====================================================== -->
-	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
-		<validator
-			scope="total"
-			class="org.eclipse.wst.dtd.ui.internal.validation.DTDValidator"
-			id="org.eclipse.wst.dtd.dtdsourcevalidator">
-			<contentTypeIdentifier
-				id="org.eclipse.wst.dtd.core.dtdsource">
-				<partitionType id="org.eclipse.wst.dtd.DEFAULT">
-				</partitionType>
-			</contentTypeIdentifier>
-		</validator>
-	</extension>
-
-	<!-- Templates -->
-	<extension point="org.eclipse.ui.editors.templates">
-		<contextType
-			name="%DTD_New_context_type_Extension_Element.name"
-			class="org.eclipse.wst.dtd.ui.internal.templates.TemplateContextTypeDTD"
-			id="dtd_new">
-		</contextType>
-	</extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/DTDValidator.java b/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/DTDValidator.java
deleted file mode 100644
index b06f8a5..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/DTDValidator.java
+++ /dev/null
@@ -1,171 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.ui.internal.validation;
-
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Locale;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.IRuleGroup;
-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;
-
-
-public class DTDValidator implements IValidator {
-	private final String GET_FILE = "getFile"; //$NON-NLS-1$
-	public final String GET_PROJECT_FILES = "getAllFiles"; //$NON-NLS-1$
-
-	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;
-	}
-	
-	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();
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wtp.validation.core.IValidator#cleanup(org.eclipse.wtp.validation.core.IReporter)
-	 */
-	public void cleanup(IReporter reporter) {
-	}
-
-	public void validate(IFile file) {
-		ValidateDTDAction validateAction = new ValidateDTDAction(file, false);
-		validateAction.setValidator(this);
-		validateAction.run();
-	}
-
-	public void validate(IFile file, IReporter reporter, int ruleGroup) {
-		ValidateDTDAction validateAction = new ValidateDTDAction(file, false);
-		validateAction.setValidator(this);
-		validateAction.run();
-	}
-
-	/**
-	 * This is the method which performs the validation on the MOF model. <br>
-	 * <br>
-	 * <code>context</code> and <code>reporter</code> may not be null.
-	 * <code>changedFiles</code> may be null, if a full build is desired.
-	 * <br>
-	 * <br>
-	 * <code>helper</code> returns the ifile for the given information in
-	 * the IFileDelta array <br>
-	 * <br>
-	 * <code>reporter</code> is an instance of an IReporter interface, which
-	 * is used for interaction with the user. <br>
-	 * <br>
-	 * <code>changedFiles</code> is an array of file names which have
-	 * changed since the last validation. If <code>changedFiles</code> is
-	 * null, or if it is an empty array, then a full build is performed.
-	 * Otherwise, validation on just the files listed in the Vector is
-	 * performed.
-	 */
-	public void validate(IValidationContext context, IReporter reporter) throws ValidationException {
-		String[] changedFiles = context.getURIs();
-		if (changedFiles != null && changedFiles.length > 0) {
-			for (int i = 0; i < changedFiles.length; i++) {
-				String changedFileName = changedFiles[i];
-				if (changedFileName != null) {
-					Object[] parms = {changedFileName};
-
-					IFile file = (IFile) context.loadModel(GET_FILE, parms);
-					if (file != null && shouldValidate(file)) {
-						validateIfNeeded(file, context, reporter);
-					}
-				}
-			}
-		}
-		else {
-			Object[] parms = {this.getClass().getName()};
-			Collection files = (Collection) context.loadModel(GET_PROJECT_FILES, parms);
-			Iterator iter = files.iterator();
-			while (iter.hasNext()) {
-				IFile file = (IFile) iter.next();
-				if(shouldValidate(file)) {
-					validateIfNeeded(file, context, reporter);
-				}
-			}
-		}
-	}
-
-
-	protected void validateIfNeeded(IFile file, IValidationContext context, IReporter reporter) {
-	    Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(DTDUIMessages.MESSAGE_DTD_VALIDATION_MESSAGE_UI_, new String[]{file.getFullPath().toString()}));
-	    reporter.displaySubtask(this, message);
-
-		Integer ruleGroupInt = (Integer) context.loadModel(IRuleGroup.PASS_LEVEL, null);
-		/*
-		 * pass in a "null" so that loadModel doesn't attempt to cast the
-		 * result into a RefObject
-		 */
-		int ruleGroup = (ruleGroupInt == null) ? IRuleGroup.PASS_FULL : ruleGroupInt.intValue();
-
-		validate(file, reporter, ruleGroup);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/ValidateDTDAction.java b/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/ValidateDTDAction.java
deleted file mode 100644
index 00e4873..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/ValidateDTDAction.java
+++ /dev/null
@@ -1,82 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.ui.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.dtd.core.internal.validation.DTDValidationMessages;
-import org.eclipse.wst.dtd.core.internal.validation.Validator;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-import org.eclipse.wst.xml.ui.internal.validation.core.ValidateAction;
-
-
-/**
- * This class managers the 'UI' related details of validation Here's a quick
- * overview of the details : - manages Marker creation based on the results of
- * the validation - (optionally) displays dialog to summarize the results of
- * validation - temporarily copies XML to a temp file to workaround a xerces
- * bug (InputSource from InputStream bug)
- */
-public class ValidateDTDAction extends ValidateAction {
-	/**
-	 * Constructor.
-	 * 
-	 * @param file
-	 *            The file to validate.
-	 * @param showDialog
-	 *            Whether or not to show dialogs during validation.
-	 */
-	public ValidateDTDAction(IFile file, boolean showDialog) {
-		super(file, showDialog);
-	}
-
-	protected void validate(final IFile fileToValidate) {
-		final ValidationOutcome validationOutcome = new ValidationOutcome();
-		IPath path = fileToValidate.getLocation();
-		final String uri = createURIForFilePath(path.toString());
-		Validator dtdValidator = Validator.getInstance();
-
-		clearMarkers(fileToValidate);
-
-		ValidationReport valreport = dtdValidator.validate(uri);
-		validationOutcome.isValid = valreport.isValid();
-		if (valreport.getValidationMessages().length == 0) {
-			validationOutcome.hasMessages = false;
-		}
-		else {
-			validationOutcome.hasMessages = true;
-		}
-		createMarkers(fileToValidate, valreport.getValidationMessages());
-
-		try {
-			fileToValidate.setSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME, valreport.getNestedMessages());
-		}
-		catch (CoreException e) {
-		}
-
-
-		if (showDialog) {
-			if (!validationOutcome.isValid) {
-				String title = DTDValidationMessages._UI_DIALOG_DTD_INVALID_TITLE;
-				String message = DTDValidationMessages._UI_DIALOG_DTD_INVALID_TEXT;
-				openErrorDialog(title, message);
-			}
-			else {
-				String title = DTDValidationMessages._UI_DIALOG_DTD_VALID_TITLE;
-				String message = DTDValidationMessages._UI_DIALOG_DTD_VALID_TEXT;
-				openValidDialog(title, message);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/ValidateDTDActionDelegate.java b/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/ValidateDTDActionDelegate.java
deleted file mode 100644
index e1a7ebb..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-validation/org/eclipse/wst/dtd/ui/internal/validation/ValidateDTDActionDelegate.java
+++ /dev/null
@@ -1,70 +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
- *******************************************************************************/
-
-package org.eclipse.wst.dtd.ui.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.wst.dtd.core.internal.validation.DTDValidationMessages;
-
-/**
- * Validate schema - from popup
- */
-public class ValidateDTDActionDelegate implements IActionDelegate {
-	protected ISelection selection;
-
-	public void run(IAction action) {
-		try {
-			// CS.. for now the following line tests to ensure the user has
-			// xerces jars installed
-			// so that we can perform some 'fail fast' behaviour
-			//
-			Class theClass = Class.forName("org.apache.xerces.xni.parser.XMLParserConfiguration", true, this.getClass().getClassLoader()); //$NON-NLS-1$
-			if (theClass == null) {
-				throw (new Exception("Missing Xerces jars in plugin's 'jars' folder")); //$NON-NLS-1$
-			}
-
-			IFile fileResource = null;
-			if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
-				IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-				Object element = structuredSelection.getFirstElement();
-
-				if (element instanceof IFile) {
-					fileResource = (IFile) element;
-				}
-				else {
-					return;
-				}
-			}
-			ValidateDTDAction validateaction = new ValidateDTDAction(fileResource, true);
-			validateaction.setValidator(new DTDValidator());
-			validateaction.run();
-		}
-		catch (Exception e) {
-			// CS..here's where we need to pop up a dialog to tell the user
-			// that xerces is not available
-			//
-			String xercesLine1 = DTDValidationMessages.Missing_required_files_1;
-			String xercesLine2 = DTDValidationMessages.Missing_required_files_2;
-			String xercesLine3 = DTDValidationMessages.Missing_required_files_3;
-			MessageDialog.openError(Display.getDefault().getActiveShell(), DTDValidationMessages.Missing_required_files_4, xercesLine1 + xercesLine2 + xercesLine3);
-		}
-	}
-
-	public void selectionChanged(IAction action, ISelection selection) {
-		this.selection = selection;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java
deleted file mode 100644
index ca4e7a4..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java
+++ /dev/null
@@ -1,90 +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.dtd.ui;
-
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.dtd.core.internal.provisional.text.IDTDPartitionTypes;
-import org.eclipse.wst.dtd.ui.internal.style.LineStyleProviderForDTD;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProviderForNoOp;
-
-
-/**
- * Configuration for a source viewer which shows DTD 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 StructuredTextViewerConfigurationDTD 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 fLineStyleProviderForDTD;
-	/*
-	 * One instance per configuration
-	 */
-	private LineStyleProvider fLineStyleProviderForNoop;
-
-	/**
-	 * Create new instance of StructuredTextViewerConfigurationDTD
-	 */
-	public StructuredTextViewerConfigurationDTD() {
-		// Must have empty constructor to createExecutableExtension
-		super();
-	}
-
-	public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
-		if (fConfiguredContentTypes == null) {
-			fConfiguredContentTypes = new String[]{IDTDPartitionTypes.DTD_DEFAULT, IStructuredPartitionTypes.DEFAULT_PARTITION, IStructuredPartitionTypes.UNKNOWN_PARTITION};
-		}
-		return fConfiguredContentTypes;
-	}
-
-	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
-		LineStyleProvider[] providers = null;
-
-		if (partitionType == IDTDPartitionTypes.DTD_DEFAULT || partitionType == IStructuredPartitionTypes.DEFAULT_PARTITION) {
-			providers = new LineStyleProvider[]{getLineStyleProviderForCSS()};
-		}
-		else if (partitionType == IStructuredPartitionTypes.UNKNOWN_PARTITION) {
-			providers = new LineStyleProvider[]{getLineStyleProviderForNoop()};
-		}
-
-		return providers;
-	}
-
-	private LineStyleProvider getLineStyleProviderForCSS() {
-		if (fLineStyleProviderForDTD == null) {
-			fLineStyleProviderForDTD = new LineStyleProviderForDTD();
-		}
-		return fLineStyleProviderForDTD;
-	}
-
-	private LineStyleProvider getLineStyleProviderForNoop() {
-		if (fLineStyleProviderForNoop == null) {
-			fLineStyleProviderForNoop = new LineStyleProviderForNoOp();
-		}
-		return fLineStyleProviderForNoop;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java
deleted file mode 100644
index 80eee08..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java
+++ /dev/null
@@ -1,70 +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.dtd.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by DTD UI
- * 
- * @plannedfor 1.0
- */
-public class DTDUIMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.dtd.ui.internal.DTDUIPluginResources";//$NON-NLS-1$
-
-	public static String _UI_ACTION_ADD_ATTRIBUTELIST;
-	public static String _UI_ACTION_ADD_DTD_NOTATION;
-	public static String _UI_ACTION_ADD_DTD_ENTITY;
-	public static String _UI_ACTION_ADD_DTD_ELEMENT;
-	public static String _UI_ACTION_ADD_DTD_COMMENT;
-	public static String _UI_ACTION_DTD_DELETE;
-	public static String _UI_ACTION_ADD_ATTRIBUTE;
-	public static String _UI_ACTION_GROUP_ADD_GROUP;
-	public static String _UI_ACTION_ADD_ELEMENT;
-	public static String _UI_BUTTON_GROUP_ITEMS_LOGICALLY;
-	public static String _UI_BUTTON_SORT_ITEMS;
-	public static String _UI_ACTION_ADD_PARAM_ENTITY_REF;
-	public static String _UI_MOVE_ATTRIBUTE;
-	public static String _UI_MOVE_CONTENT;
-	public static String _UI_MOVE_NODE;
-	public static String _UI_MOVE_NODES;
-	public static String _ERROR_FILENAME_MUST_END_DTD;
-	public static String DTDColorPage_0;
-	public static String DTDColorPage_1;
-	public static String DTDColorPage_2;
-	public static String DTDColorPage_3;
-	public static String DTDColorPage_4;
-	public static String DTDColorPage_5;
-	public static String DTDColorPage_6;
-	public static String DTDColorPage_7;
-	public static String DTDColorPage_8;
-	public static String DTDPropertySourceAdapter_0;
-	public static String DTDPropertySourceAdapter_1;
-	public static String DTDPropertySourceAdapter_2;
-	public static String SourceMenu_label;
-	public static String _UI_CREATE_NEW_DTD_FILE;
-	public static String _UI_WIZARD_NEW_DTD_TITLE;
-	public static String _UI_WIZARD_NEW_DTD_EXPL;
-	public static String _UI_LABEL_DTD_FILE_DELETE;
-	public static String NewDTDTemplatesWizardPage_0;
-	public static String NewDTDTemplatesWizardPage_1;
-	public static String NewDTDTemplatesWizardPage_2;
-	public static String NewDTDTemplatesWizardPage_3;
-	public static String NewDTDTemplatesWizardPage_4;
-	public static String NewDTDTemplatesWizardPage_5;
-	public static String NewDTDTemplatesWizardPage_6;
-
-	public static String MESSAGE_DTD_VALIDATION_MESSAGE_UI_;
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, DTDUIMessages.class);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPlugin.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPlugin.java
deleted file mode 100644
index cc7ab2f..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPlugin.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.dtd.ui.internal;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-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.dtd.ui.internal.preferences.DTDUIPreferenceNames;
-import org.eclipse.wst.dtd.ui.internal.templates.TemplateContextTypeIdsDTD;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class DTDUIPlugin extends AbstractUIPlugin {
-	// The shared instance.
-	private static DTDUIPlugin plugin;
-	
-	/**
-	 * The template store for the dtd ui.
-	 */
-	private TemplateStore fTemplateStore;
-
-	/**
-	 * The template context type registry for dtd ui.
-	 */
-	private ContextTypeRegistry fContextTypeRegistry;
-
-	/**
-	 * Returns the shared instance.
-	 */
-	public static DTDUIPlugin getDefault() {
-		return plugin;
-	}
-
-	/**
-	 * Returns the workspace instance.
-	 */
-	public static IWorkspace getWorkspace() {
-		return ResourcesPlugin.getWorkspace();
-	}
-
-	/**
-	 * The constructor.
-	 */
-	public DTDUIPlugin() {
-		super();
-		plugin = this;
-	}
-	
-	/**
-	 * Returns the template store for the dtd editor templates.
-	 * 
-	 * @return the template store for the dtd editor templates
-	 */
-	public TemplateStore getTemplateStore() {
-		if (fTemplateStore == null) {
-			fTemplateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), DTDUIPreferenceNames.TEMPLATES_KEY);
-
-			try {
-				fTemplateStore.load();
-			} catch (IOException e) {
-				Logger.logException(e);
-			}
-		}
-		return fTemplateStore;
-	}
-
-	/**
-	 * Returns the template context type registry for the dtd plugin.
-	 * 
-	 * @return the template context type registry for the dtd plugin
-	 */
-	public ContextTypeRegistry getTemplateContextRegistry() {
-		if (fContextTypeRegistry == null) {
-			ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
-			registry.addContextType(TemplateContextTypeIdsDTD.NEW);
-
-			fContextTypeRegistry = registry;
-		}
-
-		return fContextTypeRegistry;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties
deleted file mode 100644
index b74fd8a..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties
+++ /dev/null
@@ -1,75 +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
-###############################################################################
-
-_UI_ACTION_ADD_ATTRIBUTELIST=Add Attribute &List
-
-!DTDOutliner
-_UI_ACTION_ADD_DTD_NOTATION=Add &Notation
-_UI_ACTION_ADD_DTD_ENTITY=Add &Entity
-_UI_ACTION_ADD_DTD_ELEMENT=Add Ele&ment
-_UI_ACTION_ADD_DTD_COMMENT=Add &Comment
-_UI_ACTION_DTD_DELETE=&Delete
-_UI_ACTION_ADD_ATTRIBUTE=Add &Attribute
-_UI_ACTION_GROUP_ADD_GROUP=Add Group to Con&tent Model
-_UI_ACTION_ADD_ELEMENT=Add Element to C&ontent Model
-
-!DTDContentOutlinePage
-_UI_BUTTON_GROUP_ITEMS_LOGICALLY=Group items logically.
-_UI_BUTTON_SORT_ITEMS=Sort items alphabetically.
-
-!DTDContextContributer
-_UI_ACTION_ADD_PARAM_ENTITY_REF=Add &Parameter Entity Reference
-
-!DragAttributeCommand
-_UI_MOVE_ATTRIBUTE=Move Attribute
-
-!DragContentModelCommand
-_UI_MOVE_CONTENT=Move Content
-
-!DragTopLevelNodesCommand
-_UI_MOVE_NODE=Move Node
-_UI_MOVE_NODES=Move Nodes
-
-_ERROR_FILENAME_MUST_END_DTD=The file name must end in .dtd
-
-#DTD Style page
-DTDColorPage_0=<!ELEMENT Main (One,Two+)>\r\n<!ELEMENT One (Three,Four)>\r\n<!ATTLIST One\r\n oneone CDATA #REQUIRED\r\n>\r\n<!-- You need this -->\r\n<!ELEMENT Two (moremore*)>\r\n<!ATTLIST Two\r\n twotwo CDATA #REQUIRED\r\n twothree (aaa | bbb) "aaa"\r\n>\r\n
-DTDColorPage_1=Comments
-DTDColorPage_2=Data
-DTDColorPage_3=Default
-DTDColorPage_4=Keywords
-DTDColorPage_5=Strings
-DTDColorPage_6=Symbols
-DTDColorPage_7=Tag Delimiters
-DTDColorPage_8=Tag Names
-DTDPropertySourceAdapter_0=Name
-DTDPropertySourceAdapter_1=Contents
-DTDPropertySourceAdapter_2=Attributes
-
-! NewDTDWizard.java
-_UI_CREATE_NEW_DTD_FILE      = Create a new DTD file.
-_UI_WIZARD_NEW_DTD_TITLE     = Create DTD
-_UI_WIZARD_NEW_DTD_EXPL      = Create a new DTD file. Specify the folder and name for the file.
-
-# copied from dtd core
-_UI_LABEL_DTD_FILE_DELETE=Delete
-##
-NewDTDTemplatesWizardPage_0=Select DTD Template
-NewDTDTemplatesWizardPage_1=Select a template as initial content in the DTD page.
-NewDTDTemplatesWizardPage_2=Name
-NewDTDTemplatesWizardPage_3=Description
-NewDTDTemplatesWizardPage_4=Use DTD Template
-NewDTDTemplatesWizardPage_5=Preview:
-NewDTDTemplatesWizardPage_6=Templates are 'New DTD' templates found in the <a>DTD Templates</a> preference page.
-
-SourceMenu_label=Source
-
-MESSAGE_DTD_VALIDATION_MESSAGE_UI_=DTD Validator validating {0}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/Logger.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/Logger.java
deleted file mode 100644
index f12e5fa..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/Logger.java
+++ /dev/null
@@ -1,143 +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.dtd.ui.internal;
-
-import java.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.dtd.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;
-		}
-		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 (!isDebugging())
-			return;
-
-		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)) {
-					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;
-				}
-			}
-		}
-	}
-
-	/**
-	 * @return true if the platform is debugging
-	 */
-	public static boolean isDebugging() {
-		return Platform.inDebugMode();
-	}
-
-	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.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DTDDragAndDropManager.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DTDDragAndDropManager.java
deleted file mode 100644
index 66e6f82..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DTDDragAndDropManager.java
+++ /dev/null
@@ -1,46 +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.dtd.ui.internal.dnd;
-
-import java.util.Collection;
-
-import org.eclipse.wst.common.ui.internal.dnd.DragAndDropCommand;
-import org.eclipse.wst.common.ui.internal.dnd.DragAndDropManager;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.TopLevelNode;
-
-public class DTDDragAndDropManager implements DragAndDropManager {
-
-	public DragAndDropCommand createCommand(Object target, float location, int operations, int operation, Collection source) {
-		if (target instanceof DTDNode) {
-			DTDNode node = (DTDNode) target;
-
-			if (node instanceof TopLevelNode) {
-				return new DragTopLevelNodesCommand(target, location, operations, operation, source);
-			}
-			if (node instanceof Attribute) {
-				return new DragAttributeCommand(target, location, operations, operation, source);
-			}
-			if (node instanceof CMNode) {
-				return new DragContentModelCommand(target, location, operations, operation, source);
-			}
-
-		}
-		return null;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragAttributeCommand.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragAttributeCommand.java
deleted file mode 100644
index cd60edd..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragAttributeCommand.java
+++ /dev/null
@@ -1,61 +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.dtd.ui.internal.dnd;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-
-
-
-public class DragAttributeCommand extends DefaultDragAndDropCommand {
-
-	public DragAttributeCommand(Object target, float location, int operations, int operation, Collection sources) {
-		super(target, location, operations, operation, sources);
-	}
-
-	public boolean canExecute() {
-		Iterator iter = sources.iterator();
-		while (iter.hasNext()) {
-			Object source = iter.next();
-			if (!(source instanceof Attribute)) {
-				return false;
-			}
-		}
-		return true;
-	}
-
-	public void execute() {
-		DTDNode referenceNode = (DTDNode) target;
-		DTDFile dtdFile = referenceNode.getDTDFile();
-		if (referenceNode instanceof Attribute) {
-			dtdFile.getDTDModel().beginRecording(this, DTDUIMessages._UI_MOVE_ATTRIBUTE); //$NON-NLS-1$
-			AttributeList attList = (AttributeList) referenceNode.getParentNode();
-			Iterator iter = sources.iterator();
-			while (iter.hasNext()) {
-				DTDNode node = (DTDNode) iter.next();
-				if (node instanceof Attribute) {
-					attList.insertIntoModel(this, (Attribute) referenceNode, (Attribute) node, isAfter());
-					dtdFile.deleteNode(this, node);
-				}
-			}
-			dtdFile.getDTDModel().endRecording(this);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragContentModelCommand.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragContentModelCommand.java
deleted file mode 100644
index 60b0571..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragContentModelCommand.java
+++ /dev/null
@@ -1,113 +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.dtd.ui.internal.dnd;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-
-
-public class DragContentModelCommand extends DefaultDragAndDropCommand {
-
-	public DragContentModelCommand(Object target, float location, int operations, int operation, Collection sources) {
-		super(target, location, operations, operation, sources);
-	}
-
-	public boolean canExecute() {
-		if (!(target instanceof CMNode)) {
-			return false;
-		}
-
-		Iterator iter = sources.iterator();
-		while (iter.hasNext()) {
-			Object source = iter.next();
-			if (!(source instanceof CMNode)) {
-				return false;
-			}
-		}
-		return true;
-	}
-
-	public void execute() {
-		DTDNode referenceNode = (DTDNode) target;
-
-		if (referenceNode instanceof CMNode) {
-			DTDFile dtdFile = referenceNode.getDTDFile();
-
-			DTDNode parent = (DTDNode) referenceNode.getParentNode();
-			dtdFile.getDTDModel().beginRecording(this, DTDUIMessages._UI_MOVE_CONTENT); //$NON-NLS-1$
-			boolean parentIsElement = false;
-			Element element = null;
-			CMGroupNode group = null;
-			if (parent instanceof Element) {
-				parentIsElement = true;
-				element = (Element) parent;
-			}
-			else {
-				group = (CMGroupNode) parent;
-			}
-
-			if (element == null && group == null) {
-				// no parent to add to
-				return;
-			}
-
-			Iterator iter = sources.iterator();
-			while (iter.hasNext()) {
-				DTDNode node = (DTDNode) iter.next();
-				if (node instanceof CMNode) {
-					if (parentIsElement) {
-						if (element.getContentModel() == node) {
-							continue;
-						}
-						element.replaceContentModel(this, (CMNode) node);
-					}
-					else {
-						if (referenceNode == node || (isAfter() && referenceNode.getNextSibling() == node) || (!isAfter() && node.getNextSibling() == referenceNode)) {
-							continue;
-						}
-
-						group.insertIntoModel(this, (CMNode) referenceNode, (CMNode) node, isAfter());
-
-					}
-					DTDNode nodeParent = (DTDNode) node.getParentNode();
-					nodeParent.delete(this, node);
-				}
-			}
-			dtdFile.getDTDModel().endRecording(this);
-		}
-	}
-
-	public int getFeedback() {
-		DTDNode referenceNode = (DTDNode) target;
-		if (referenceNode instanceof CMNode) {
-			CMNode cmNode = (CMNode) referenceNode;
-			if (cmNode.isRootElementContent() && cmNode instanceof CMBasicNode) {
-				return DND.FEEDBACK_SELECT;
-			}
-		}
-
-		return super.getFeedback();
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragTopLevelNodesCommand.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragTopLevelNodesCommand.java
deleted file mode 100644
index 4f76360..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/dnd/DragTopLevelNodesCommand.java
+++ /dev/null
@@ -1,64 +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.dtd.ui.internal.dnd;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.TopLevelNode;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-
-public class DragTopLevelNodesCommand extends DefaultDragAndDropCommand {
-
-	static private final String moveNode = DTDUIMessages._UI_MOVE_NODE; //$NON-NLS-1$
-	static private final String moveNodes = DTDUIMessages._UI_MOVE_NODES; //$NON-NLS-1$
-
-	public DragTopLevelNodesCommand(Object target, float location, int operations, int operation, Collection sources) {
-		super(target, location, operations, operation, sources);
-	}
-
-	public boolean canExecute() {
-		if (!(target instanceof TopLevelNode)) {
-			return false;
-		}
-
-		Iterator iter = sources.iterator();
-		while (iter.hasNext()) {
-			Object source = iter.next();
-			if (!(source instanceof TopLevelNode)) {
-				return false;
-			}
-		}
-		return true;
-	}
-
-	public void execute() {
-		DTDNode referenceNode = (DTDNode) target;
-
-		DTDFile dtdFile = referenceNode.getDTDFile();
-		dtdFile.getDTDModel().beginRecording(this, sources.size() > 1 ? moveNodes : moveNode);
-		Iterator iter = sources.iterator();
-		while (iter.hasNext()) {
-			DTDNode node = (DTDNode) iter.next();
-			if (node instanceof TopLevelNode) {
-				dtdFile.moveNode(this, referenceNode, node, isAfter());
-			}
-		}
-		dtdFile.getDTDModel().endRecording(this);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/ActionContributorDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/ActionContributorDTD.java
deleted file mode 100644
index 2cc20df..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/ActionContributorDTD.java
+++ /dev/null
@@ -1,70 +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.dtd.ui.internal.editor;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.sse.ui.internal.actions.ActionContributor;
-
-/**
- * XMLEditorActionContributor
- * 
- * 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 ActionContributorDTD extends ActionContributor {
-	protected static final String[] EDITOR_IDS = {"org.eclipse.wst.dtd.core.dtdsource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.edit.util.ActionContributor#getExtensionIDs()
-	 */
-	protected String[] getExtensionIDs() {
-		return EDITOR_IDS;
-	}
-
-	protected void addToMenu(IMenuManager menu) {
-		// edit commands
-		IMenuManager editMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
-		if (editMenu != null) {
-			editMenu.add(fCommandsSeparator);
-			editMenu.add(fToggleInsertModeAction);
-			editMenu.add(fCommandsSeparator);
-			editMenu.add(fExpandSelectionToMenu);
-			editMenu.add(fCommandsSeparator);
-			editMenu.add(fMenuAdditionsGroupMarker);
-		}
-
-		// source commands
-		String sourceMenuLabel = DTDUIMessages.SourceMenu_label;
-		String sourceMenuId = "sourceMenuId"; //$NON-NLS-1$
-		IMenuManager sourceMenu = new MenuManager(sourceMenuLabel, sourceMenuId);
-		menu.insertAfter(IWorkbenchActionConstants.M_EDIT, sourceMenu);
-		if (sourceMenu != null) {
-			sourceMenu.add(fCommandsSeparator);
-			sourceMenu.add(fShiftRight);
-			sourceMenu.add(fShiftLeft);
-			sourceMenu.add(fCommandsSeparator);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImageHelper.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImageHelper.java
deleted file mode 100644
index b157fbe..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImageHelper.java
+++ /dev/null
@@ -1,157 +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.dtd.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.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-
-
-/**
- * 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 DTDEditorPluginImageHelper {
-	private static DTDEditorPluginImageHelper instance = null;
-
-	/**
-	 * Gets the instance.
-	 * 
-	 * @return Returns a DTDEditorPluginImageHelper
-	 */
-	public synchronized static DTDEditorPluginImageHelper getInstance() {
-		if (instance == null)
-			instance = new DTDEditorPluginImageHelper();
-		return instance;
-	}
-
-	// save a descriptor for each image
-	private HashMap fImageDescRegistry = null;
-	private final String PLUGINID = DTDUIPlugin.getDefault().getBundle().getSymbolicName();
-
-	/**
-	 * 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;
-	}
-
-	/**
-	 * 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 JFaceResources.getImageRegistry();
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImages.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImages.java
deleted file mode 100644
index d331157..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImages.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.dtd.ui.internal.editor;
-
-/**
- * Bundle of most images used by the DTD Source Editor plug-in.
- */
-public class DTDEditorPluginImages {
-	public static final String IMG_CTOOL_ADD_ATTRIBUTE = "icons/full/ctool16/ADD_Attribute.gif"; //$NON-NLS-1$
-
-	public static final String IMG_CTOOL_ADD_ELEMENT = "icons/full/ctool16/ADD_Element.gif"; //$NON-NLS-1$
-
-	public static final String IMG_CTOOL_ADD_ELEMENTTOCONMODEL = "icons/full/ctool16/ADD_ElementToConModel.gif"; //$NON-NLS-1$
-
-	public static final String IMG_CTOOL_ADD_GROUPTOCONMODEL = "icons/full/ctool16/ADD_GroupToConModel.gif"; //$NON-NLS-1$
-	public static final String IMG_DTOOL_ADD_ATTRIBUTE = "icons/full/dtool16/ADD_Attribute.gif"; //$NON-NLS-1$
-	public static final String IMG_DTOOL_ADD_ELEMENT = "icons/full/dtool16/ADD_Element.gif"; //$NON-NLS-1$
-	public static final String IMG_DTOOL_ADD_ELEMENTTOCONMODEL = "icons/full/dtool16/ADD_ElementToConModel.gif"; //$NON-NLS-1$
-	public static final String IMG_DTOOL_ADD_GROUPTOCONMODEL = "icons/full/dtool16/ADD_GroupToConModel.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL_ADD_ATTRIBUTE = "icons/full/etool16/ADD_Attribute.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL_ADD_ELEMENT = "icons/full/etool16/ADD_Element.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL_ADD_ELEMENTTOCONMODEL = "icons/full/etool16/ADD_ElementToConModel.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL_ADD_GROUPTOCONMODEL = "icons/full/etool16/ADD_GroupToConModel.gif"; //$NON-NLS-1$
-
-	public static final String IMG_OBJ_ADD_COMMENT = "icons/full/obj16/ADD_Comment.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_ADD_ENTITY = "icons/full/obj16/ADD_Entity.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_ADD_ENTITY_REFERENCE = "icons/full/obj16/ADD_Entity_Reference.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_ADD_NOTATION = "icons/full/obj16/ADD_Notation.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_ORGANIZE_DTD_LOGICALLY = "icons/full/obj16/organize_dtd_logically.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_SORT = "icons/full/obj16/sort.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_VALIDATE = "icons/full/obj16/validate.gif"; //$NON-NLS-1$
-	
-	public static final String IMG_WIZBAN_NEWDTDFILE = "icons/full/wizban/newdtdfile_wiz.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index 288dd99..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,43 +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.dtd.ui.internal.editor;
-
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-
-/**
- * Help context ids for the DTD Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- * 
- */
-public interface IHelpContextIds {
-
-	// org.eclipse.wst.dtd.ui.
-	public static final String PREFIX = DTDUIPlugin.getDefault().getBundle().getSymbolicName() + "."; //$NON-NLS-1$
-	// DTD Files Preference page
-	public static final String DTD_PREFWEBX_FILES_HELPID = PREFIX + "webx0020"; //$NON-NLS-1$
-	// DTD Styles Preference page
-	public static final String DTD_PREFWEBX_STYLES_HELPID = PREFIX + "webx0021"; //$NON-NLS-1$
-	// DTD Template Preference page (no id for this yet)
-	public static final String DTD_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0022"; //$NON-NLS-1$
-
-	// // figured out on the fly
-	// // DTD Source page editor
-	// public static final String DTD_SOURCEVIEW_HELPID =
-	// ContentTypeIdForDTD.ContentTypeID_DTD + "_source_HelpId"; //$NON-NLS-1$
-
-	// DTD New File Wizard - Template Page
-	public static final String DTD_NEWWIZARD_TEMPLATE_HELPID = PREFIX + "dtdw0010"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDColorPage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDColorPage.java
deleted file mode 100644
index 5bd028b..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDColorPage.java
+++ /dev/null
@@ -1,168 +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.dtd.ui.internal.preferences;
-
-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.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.dtd.ui.internal.style.IStyleConstantsDTD;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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.AbstractColorPage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;
-
-public class DTDColorPage extends AbstractColorPage {
-
-	protected Control createContents(Composite parent) {
-		Composite pageComponent = createComposite(parent, 1);
-		((GridData) pageComponent.getLayoutData()).horizontalAlignment = GridData.HORIZONTAL_ALIGN_FILL;
-
-		super.createContents(pageComponent);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.DTD_PREFWEBX_STYLES_HELPID);
-
-		return pageComponent;
-	}
-
-	/**
-	 * 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;
-	}
-
-	protected IPreferenceStore doGetPreferenceStore() {
-		return DTDUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	public String getSampleText() {
-		return DTDUIMessages.DTDColorPage_0; //$NON-NLS-1$
-	}
-
-	protected void initContextStyleMap(Dictionary contextStyleMap) {
-		contextStyleMap.put(DTDRegionTypes.CONTENT_EMPTY, IStyleConstantsDTD.DTD_DATA);
-		contextStyleMap.put(DTDRegionTypes.CONTENT_ANY, IStyleConstantsDTD.DTD_DATA);
-		contextStyleMap.put(DTDRegionTypes.CONTENT_PCDATA, IStyleConstantsDTD.DTD_DATA);
-		contextStyleMap.put(DTDRegionTypes.NDATA_VALUE, IStyleConstantsDTD.DTD_DATA);
-		contextStyleMap.put(DTDRegionTypes.NAME, IStyleConstantsDTD.DTD_DATA);
-		contextStyleMap.put(DTDRegionTypes.ENTITY_PARM, IStyleConstantsDTD.DTD_DATA);
-
-		contextStyleMap.put(DTDRegionTypes.ELEMENT_TAG, IStyleConstantsDTD.DTD_TAGNAME);
-		contextStyleMap.put(DTDRegionTypes.ENTITY_TAG, IStyleConstantsDTD.DTD_TAGNAME);
-		contextStyleMap.put(DTDRegionTypes.ATTLIST_TAG, IStyleConstantsDTD.DTD_TAGNAME);
-		contextStyleMap.put(DTDRegionTypes.NOTATION_TAG, IStyleConstantsDTD.DTD_TAGNAME);
-
-		contextStyleMap.put(DTDRegionTypes.CONNECTOR, IStyleConstantsDTD.DTD_SYMBOL);
-		contextStyleMap.put(DTDRegionTypes.OCCUR_TYPE, IStyleConstantsDTD.DTD_SYMBOL);
-
-		contextStyleMap.put(DTDRegionTypes.START_TAG, IStyleConstantsDTD.DTD_TAG);
-		contextStyleMap.put(DTDRegionTypes.END_TAG, IStyleConstantsDTD.DTD_TAG);
-		contextStyleMap.put(DTDRegionTypes.EXCLAMATION, IStyleConstantsDTD.DTD_TAG);
-
-		contextStyleMap.put(DTDRegionTypes.COMMENT_START, IStyleConstantsDTD.DTD_COMMENT);
-		contextStyleMap.put(DTDRegionTypes.COMMENT_CONTENT, IStyleConstantsDTD.DTD_COMMENT);
-		contextStyleMap.put(DTDRegionTypes.COMMENT_END, IStyleConstantsDTD.DTD_COMMENT);
-
-		contextStyleMap.put(DTDRegionTypes.SINGLEQUOTED_LITERAL, IStyleConstantsDTD.DTD_STRING);
-		contextStyleMap.put(DTDRegionTypes.DOUBLEQUOTED_LITERAL, IStyleConstantsDTD.DTD_STRING);
-
-		contextStyleMap.put(DTDRegionTypes.SYSTEM_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.PUBLIC_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.NDATA_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.CDATA_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.ID_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.IDREF_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.IDREFS_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.ENTITY_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.ENTITIES_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.NMTOKEN_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.NMTOKENS_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.NOTATION_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.REQUIRED_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.IMPLIED_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-		contextStyleMap.put(DTDRegionTypes.FIXED_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
-	}
-
-	protected void initDescriptions(Dictionary descriptions) {
-		descriptions.put(IStyleConstantsDTD.DTD_COMMENT, DTDUIMessages.DTDColorPage_1); //$NON-NLS-1$
-		descriptions.put(IStyleConstantsDTD.DTD_DATA, DTDUIMessages.DTDColorPage_2); //$NON-NLS-1$
-		descriptions.put(IStyleConstantsDTD.DTD_DEFAULT, DTDUIMessages.DTDColorPage_3); //$NON-NLS-1$
-		descriptions.put(IStyleConstantsDTD.DTD_KEYWORD, DTDUIMessages.DTDColorPage_4); //$NON-NLS-1$
-		descriptions.put(IStyleConstantsDTD.DTD_STRING, DTDUIMessages.DTDColorPage_5); //$NON-NLS-1$
-		descriptions.put(IStyleConstantsDTD.DTD_SYMBOL, DTDUIMessages.DTDColorPage_6); //$NON-NLS-1$
-		descriptions.put(IStyleConstantsDTD.DTD_TAG, DTDUIMessages.DTDColorPage_7); //$NON-NLS-1$
-		descriptions.put(IStyleConstantsDTD.DTD_TAGNAME, DTDUIMessages.DTDColorPage_8); //$NON-NLS-1$
-	}
-
-	protected void initStyleList(ArrayList list) {
-		list.add(IStyleConstantsDTD.DTD_COMMENT);
-		list.add(IStyleConstantsDTD.DTD_DATA);
-		list.add(IStyleConstantsDTD.DTD_DEFAULT);
-		list.add(IStyleConstantsDTD.DTD_KEYWORD);
-		list.add(IStyleConstantsDTD.DTD_STRING);
-		list.add(IStyleConstantsDTD.DTD_SYMBOL);
-		list.add(IStyleConstantsDTD.DTD_TAG);
-		list.add(IStyleConstantsDTD.DTD_TAGNAME);
-	}
-
-	protected void setupPicker(StyledTextColorPicker picker) {
-		IModelManager mmanager = StructuredModelManager.getModelManager();
-		picker.setParser(mmanager.createStructuredDocumentFor(ContentTypeIdForDTD.ContentTypeID_DTD).getParser());
-
-		Dictionary descriptions = new Hashtable();
-		initDescriptions(descriptions);
-
-		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.wst.sse.ui.preferences.ui.AbstractColorPage#savePreferences()
-	 */
-	protected void savePreferences() {
-		DTDUIPlugin.getDefault().savePluginPreferences();
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java
deleted file mode 100644
index e8df96f..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDFilesPreferencePage.java
+++ /dev/null
@@ -1,64 +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.dtd.ui.internal.preferences;
-
-import org.eclipse.core.runtime.Preferences;
-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.dtd.core.internal.DTDCorePlugin;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-
-
-public class DTDFilesPreferencePage extends AbstractPreferencePage {
-
-	protected Control createContents(Composite parent) {
-		noDefaultAndApplyButton();
-		
-		Composite composite = (Composite) super.createContents(parent);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.DTD_PREFWEBX_FILES_HELPID);
-
-		setSize(composite);
-		loadPreferences();
-
-		return composite;
-	}
-
-	protected IPreferenceStore doGetPreferenceStore() {
-		return DTDUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	protected void doSavePreferenceStore() {
-		DTDCorePlugin.getInstance().savePluginPreferences(); // model
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractPreferencePage#getModelPreferences()
-	 */
-	protected Preferences getModelPreferences() {
-		return DTDCorePlugin.getInstance().getPluginPreferences();
-	}
-
-	public boolean performOk() {
-		boolean result = super.performOk();
-
-		doSavePreferenceStore();
-
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDTemplatePreferencePage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDTemplatePreferencePage.java
deleted file mode 100644
index ddd0fb2..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDTemplatePreferencePage.java
+++ /dev/null
@@ -1,58 +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.dtd.ui.internal.preferences;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
-
-/**
- * Preference page for DTD templates
- */
-public class DTDTemplatePreferencePage extends TemplatePreferencePage {
-	
-	public DTDTemplatePreferencePage() {
-		DTDUIPlugin dtdUIPlugin = DTDUIPlugin.getDefault();
-		
-		setPreferenceStore(dtdUIPlugin.getPreferenceStore());
-		setTemplateStore(dtdUIPlugin.getTemplateStore());
-		setContextTypeRegistry(dtdUIPlugin.getTemplateContextRegistry());
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.preference.IPreferencePage#performOk()
-	 */
-	public boolean performOk() {
-  	  boolean ok = super.performOk();
-  	  DTDUIPlugin.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.DTD_PREFWEBX_TEMPLATES_HELPID);
-		return c;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java
deleted file mode 100644
index 59ba958..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java
+++ /dev/null
@@ -1,60 +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.dtd.ui.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.style.IStyleConstantsDTD;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-
-/**
- * Sets default values for DTD UI preferences
- */
-public class DTDUIPreferenceInitializer extends AbstractPreferenceInitializer {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
-	 */
-	public void initializeDefaultPreferences() {
-		IPreferenceStore store = DTDUIPlugin.getDefault().getPreferenceStore();
-
-		// DTD Style Preferences
-		String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
-		String styleValue = ColorHelper.getColorString(0, 0, 0) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsDTD.DTD_DEFAULT, styleValue); // black
-
-		styleValue = ColorHelper.getColorString(63, 63, 191) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsDTD.DTD_TAG, styleValue); // blue
-		store.setDefault(IStyleConstantsDTD.DTD_TAGNAME, styleValue); // blue
-
-		styleValue = ColorHelper.getColorString(127, 127, 127) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsDTD.DTD_COMMENT, styleValue); // grey
-
-		styleValue = ColorHelper.getColorString(128, 0, 0) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsDTD.DTD_KEYWORD, styleValue); // dark
-		// red
-
-		styleValue = ColorHelper.getColorString(63, 159, 95) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsDTD.DTD_STRING, styleValue); // green
-
-		styleValue = ColorHelper.getColorString(191, 95, 95) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsDTD.DTD_DATA, styleValue); // light
-		// red
-
-		styleValue = ColorHelper.getColorString(128, 0, 0) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsDTD.DTD_SYMBOL, styleValue); // dark
-		// red
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceNames.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceNames.java
deleted file mode 100644
index 73f2f71..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceNames.java
+++ /dev/null
@@ -1,37 +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.dtd.ui.internal.preferences;
-
-/**
- * Preference keys for DTD UI
- */
-public class DTDUIPreferenceNames {
-	private DTDUIPreferenceNames() {
-		// cannot create instance
-	}
-	/**
-	 * The key to store customized templates.
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 */
-	public static final String TEMPLATES_KEY = "org.eclipse.wst.sse.ui.custom_templates"; //$NON-NLS-1$
-	
-	/**
-	 * The key to store the last template name used in new DTD 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$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/StructuredTextFoldingProviderDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/StructuredTextFoldingProviderDTD.java
deleted file mode 100644
index 2bdf4f6..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/StructuredTextFoldingProviderDTD.java
+++ /dev/null
@@ -1,330 +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.dtd.ui.internal.projection;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.TopLevelNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.event.IDTDFileListener;
-import org.eclipse.wst.dtd.core.internal.event.NodesEvent;
-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.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.w3c.dom.Node;
-
-/**
- * Updates the projection model of a structured model for DTD.
- */
-public class StructuredTextFoldingProviderDTD implements IStructuredTextFoldingProvider, IProjectionListener, IDTDFileListener {
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.dtd.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private class TagProjectionAnnotation extends ProjectionAnnotation {
-		private Node fNode;
-
-		public TagProjectionAnnotation(Node node, boolean isCollapsed) {
-			super(isCollapsed);
-			fNode = node;
-		}
-
-		public Node getNode() {
-			return fNode;
-		}
-
-		public void setNode(Node node) {
-			fNode = node;
-		}
-	}
-
-	private IDocument fDocument;
-	private ProjectionViewer fViewer;
-
-
-	/**
-	 * Goes through every node creates projection annotation if needed
-	 * 
-	 * @param DTDFile
-	 *            assumes file is not null
-	 */
-	private void addAllAnnotations(DTDFile file) {
-		long start = System.currentTimeMillis();
-
-		List nodes = file.getNodes();
-		Iterator it = nodes.iterator();
-		while (it.hasNext()) {
-			DTDNode node = (DTDNode) it.next();
-			Position newPos = createProjectionPosition(node);
-			if (newPos != null) {
-				TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(node, false);
-				// add to map containing annotations to add
-				fViewer.getProjectionAnnotationModel().addAnnotation(newAnnotation, newPos);
-			}
-		}
-
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf)
-			System.out.println("StructuredTextFoldingProviderDTD.addAllAnnotations: " + (end - start)); //$NON-NLS-1$
-	}
-
-	/**
-	 * Create a projection position from the given node. Able to get
-	 * projection position if node isNodeProjectable.
-	 * 
-	 * @param node
-	 * @return null if no projection position possible, a Position otherwise
-	 */
-	private Position createProjectionPosition(Node node) {
-		Position pos = null;
-		if (isNodeProjectable(node) && node instanceof IndexedRegion) {
-			IDocument document = fViewer.getDocument();
-			if (document != null) {
-				IndexedRegion inode = (IndexedRegion) node;
-				int start = inode.getStartOffset();
-				int end = inode.getEndOffset();
-				if (start >= 0 && start < end) {
-					try {
-						int startLine = fDocument.getLineOfOffset(start);
-						int endLine = fDocument.getLineOfOffset(end);
-						// checks if projection start/end region is on the
-						// same line
-						if ((startLine < endLine) && (endLine + 1 < fDocument.getNumberOfLines())) {
-							int offset = fDocument.getLineOffset(startLine);
-							int endOffset = fDocument.getLineOffset(endLine + 1);
-							pos = new Position(offset, endOffset - offset);
-						}
-					}
-					catch (BadLocationException x) {
-						// Logger.log(Logger.WARNING_DEBUG, null, x);
-					}
-				}
-			}
-		}
-		return pos;
-	}
-
-	/**
-	 * Searches through projection annotation model and retrieves
-	 * TagProjectionAnnotation for node
-	 * 
-	 * @param node
-	 * @return TagProjectionAnnotation for node or null if could not be found
-	 */
-	private TagProjectionAnnotation findExistingAnnotation(Node node) {
-		TagProjectionAnnotation anno = null;
-
-		if (node != null) {
-			Iterator it = fViewer.getProjectionAnnotationModel().getAnnotationIterator();
-			while (it.hasNext() && anno == null) {
-				TagProjectionAnnotation a = (TagProjectionAnnotation) it.next();
-				if (node.equals(a.getNode()))
-					anno = a;
-			}
-		}
-		return anno;
-	}
-
-	/**
-	 * Get the dtd file for the fDocument
-	 * 
-	 * @param document
-	 * @return
-	 */
-	private DTDFile getDTDFile() {
-		DTDFile dtdFile = null;
-
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-			if (sModel instanceof DTDModelImpl) {
-				dtdFile = ((DTDModelImpl) sModel).getDTDFile();
-			}
-		}
-		finally {
-			if (sModel != null) {
-				sModel.releaseFromRead();
-			}
-		}
-		return dtdFile;
-	}
-
-	/**
-	 * Initialize this provider with the correct document. Assumes projection
-	 * is enabled. (otherwise, only install would have been called)
-	 */
-	public void initialize() {
-		if (!isInstalled())
-			return;
-
-		// remove dtd file listener from old dtd file
-		DTDFile file = getDTDFile();
-		if (file != null) {
-			file.removeDTDFileListener(this);
-		}
-
-		// clear out all annotations
-		if (fViewer.getProjectionAnnotationModel() != null)
-			fViewer.getProjectionAnnotationModel().removeAllAnnotations();
-
-		fDocument = fViewer.getDocument();
-		file = getDTDFile();
-		if (file != null) {
-			// add dtd file listener to new dtd file
-			file.addDTDFileListener(this);
-
-			addAllAnnotations(file);
-		}
-	}
-
-	/**
-	 * Associate a ProjectionViewer with this IStructuredTextFoldingProvider
-	 * 
-	 * @param viewer
-	 */
-	public void install(ProjectionViewer viewer) {
-		// uninstall before trying to install new viewer
-		if (isInstalled()) {
-			uninstall();
-		}
-		fViewer = viewer;
-		fViewer.addProjectionListener(this);
-	}
-
-	private boolean isInstalled() {
-		return fViewer != null;
-	}
-
-	/**
-	 * Returns true if node is a node type able to fold
-	 * 
-	 * @param node
-	 * @return boolean true if node is projectable, false otherwise
-	 */
-	private boolean isNodeProjectable(Node node) {
-		if (node != null) {
-			if (node instanceof TopLevelNode)
-				return true;
-		}
-		return false;
-	}
-
-	public void nodeChanged(DTDNode node) {
-		long start = System.currentTimeMillis();
-
-		// recalculate projection annotations for node
-		// check if this was even a projectable node to start with
-		if (isNodeProjectable(node)) {
-			// find the existing annotation
-			TagProjectionAnnotation anno = findExistingAnnotation(node);
-			// if able to project node see if projection annotation was
-			// already created and create new if needed
-			Position newPos = createProjectionPosition(node);
-			if (newPos != null && anno == null) {
-				TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(node, false);
-				// add to map containing annotations to add
-				fViewer.getProjectionAnnotationModel().addAnnotation(newAnnotation, newPos);
-			}
-			// if not able to project node see if projection annotation was
-			// already created and remove it
-			if (newPos == null && anno != null) {
-				fViewer.getProjectionAnnotationModel().removeAnnotation(anno);
-			}
-		}
-
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf) {
-			String nodeName = node != null ? node.getNodeName() : "null"; //$NON-NLS-1$
-			System.out.println("StructuredTextFoldingProviderDTD.nodeChanged (" + nodeName + "):" + (end - start)); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-
-	public void nodesAdded(NodesEvent event) {
-		long start = System.currentTimeMillis();
-
-		// add projection annotations for all nodes in event.getNodes()
-		List nodes = event.getNodes();
-		Iterator it = nodes.iterator();
-		while (it.hasNext()) {
-			DTDNode node = (DTDNode) it.next();
-			if (isNodeProjectable(node)) {
-				// add
-				Position newPos = createProjectionPosition(node);
-				if (newPos != null) {
-					TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(node, false);
-					// add to map containing annotations to add
-					fViewer.getProjectionAnnotationModel().addAnnotation(newAnnotation, newPos);
-				}
-			}
-		}
-
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf)
-			System.out.println("StructuredTextFoldingProviderDTD.nodesAdded: " + (end - start)); //$NON-NLS-1$
-	}
-
-	public void nodesRemoved(NodesEvent event) {
-		long start = System.currentTimeMillis();
-
-		// remove projection annotations for all nodes in event.getNodes()
-		List nodes = event.getNodes();
-		Iterator it = nodes.iterator();
-		while (it.hasNext()) {
-			DTDNode node = (DTDNode) it.next();
-			// check if removed node was projectable in the first place
-			if (isNodeProjectable(node)) {
-				// remove
-				TagProjectionAnnotation anno = findExistingAnnotation(node);
-				if (anno != null)
-					fViewer.getProjectionAnnotationModel().removeAnnotation(anno);
-			}
-		}
-
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf)
-			System.out.println("StructuredTextFoldingProviderDTD.nodesRemoved: " + (end - start)); //$NON-NLS-1$
-	}
-
-	public void projectionDisabled() {
-		DTDFile file = getDTDFile();
-		if (file != null) {
-			file.removeDTDFileListener(this);
-		}
-
-		fDocument = null;
-	}
-
-	public void projectionEnabled() {
-		initialize();
-	}
-
-	/**
-	 * Disconnect this IStructuredTextFoldingProvider from projection viewer
-	 */
-	public void uninstall() {
-		if (isInstalled()) {
-			projectionDisabled();
-
-			fViewer.removeProjectionListener(this);
-			fViewer = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/registry/AdapterFactoryProviderForDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/registry/AdapterFactoryProviderForDTD.java
deleted file mode 100644
index a72b579..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/registry/AdapterFactoryProviderForDTD.java
+++ /dev/null
@@ -1,53 +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.dtd.ui.internal.registry;
-
-import org.eclipse.wst.dtd.core.internal.modelhandler.ModelHandlerForDTD;
-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.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-
-
-/**
- * @author nitin
- * 
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-public class AdapterFactoryProviderForDTD implements AdapterFactoryProvider {
-
-	/**
-	 * 
-	 */
-	public AdapterFactoryProviderForDTD() {
-		super();
-	}
-
-	/*
-	 * @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
-	 */
-	public void addAdapterFactories(IStructuredModel structuredModel) {
-		FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
-		Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
-	}
-
-	public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
-		return (contentTypeDescription instanceof ModelHandlerForDTD);
-	}
-
-	public void reinitializeFactories(IStructuredModel structuredModel) {
-		// nothing to do, since no embedded type
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/IStyleConstantsDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/IStyleConstantsDTD.java
deleted file mode 100644
index 1bcadef..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/IStyleConstantsDTD.java
+++ /dev/null
@@ -1,41 +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.dtd.ui.internal.style;
-
-/**
- * Contains the symbolic name of styles used by LineStyleProvider,
- * ColorManager, and any others who may be interested
- */
-public interface IStyleConstantsDTD {
-
-	public static final String DTD_COMMENT = "dtdComment"; //$NON-NLS-1$
-
-	// Data are variables
-	public static final String DTD_DATA = "dtdData"; //$NON-NLS-1$
-	public static final String DTD_DEFAULT = "dtdDefault"; //$NON-NLS-1$
-
-	// keywords are constants like IMPLIED or PCDATA
-	public static final String DTD_KEYWORD = "dtdKeyword"; //$NON-NLS-1$
-
-	// strings are anything in quotes
-	public static final String DTD_STRING = "dtdString"; //$NON-NLS-1$
-
-	// All the remaining symbols
-	public static final String DTD_SYMBOL = "dtdSymbol"; //$NON-NLS-1$
-
-	// tags are '<', '!', or '>'
-	public static final String DTD_TAG = "dtdTag"; //$NON-NLS-1$
-
-	// tagnames are like ELEMENT, ATTLIST, etc.
-	public static final String DTD_TAGNAME = "dtdTagName"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTD.java
deleted file mode 100644
index 418d718..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTD.java
+++ /dev/null
@@ -1,133 +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.dtd.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.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-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;
-
-public class LineStyleProviderForDTD extends AbstractLineStyleProvider implements LineStyleProvider {
-	public LineStyleProviderForDTD() {
-		super();
-	}
-
-	protected TextAttribute getAttributeFor(ITextRegion region) {
-		/**
-		 * a method to centralize all the "format rules" for regions
-		 * specifically associated for how to "open" the region.
-		 */
-		// not sure why this is coming through null, but just to catch it
-		if (region == null) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_DEFAULT);
-		}
-		String type = region.getType();
-		if (type == DTDRegionTypes.CONTENT_EMPTY || type == DTDRegionTypes.CONTENT_ANY || type == DTDRegionTypes.CONTENT_PCDATA) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_DATA);
-		}
-		else if (type == DTDRegionTypes.ELEMENT_TAG || type == DTDRegionTypes.ENTITY_TAG || type == DTDRegionTypes.ATTLIST_TAG || type == DTDRegionTypes.NOTATION_TAG) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_TAGNAME);
-		}
-		else if (type == DTDRegionTypes.CONNECTOR || type == DTDRegionTypes.OCCUR_TYPE) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_SYMBOL);
-		}
-		else if (type == DTDRegionTypes.NDATA_VALUE) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_DATA);
-		}
-		else if (type == DTDRegionTypes.START_TAG || type == DTDRegionTypes.END_TAG || type == DTDRegionTypes.EXCLAMATION) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_TAG);
-		}
-		else if (type == DTDRegionTypes.COMMENT_START || type == DTDRegionTypes.COMMENT_CONTENT || type == DTDRegionTypes.COMMENT_END) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_COMMENT);
-		}
-		else if (type == DTDRegionTypes.SINGLEQUOTED_LITERAL || type == DTDRegionTypes.DOUBLEQUOTED_LITERAL) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_STRING);
-		}
-		else if (type == DTDRegionTypes.SYSTEM_KEYWORD || type == DTDRegionTypes.PUBLIC_KEYWORD || type == DTDRegionTypes.NDATA_KEYWORD || type == DTDRegionTypes.CDATA_KEYWORD || type == DTDRegionTypes.ID_KEYWORD || type == DTDRegionTypes.IDREF_KEYWORD || type == DTDRegionTypes.IDREFS_KEYWORD || type == DTDRegionTypes.ENTITY_KEYWORD || type == DTDRegionTypes.ENTITIES_KEYWORD || type == DTDRegionTypes.NMTOKEN_KEYWORD || type == DTDRegionTypes.NMTOKENS_KEYWORD || type == DTDRegionTypes.NOTATION_KEYWORD || type == DTDRegionTypes.REQUIRED_KEYWORD || type == DTDRegionTypes.IMPLIED_KEYWORD || type == DTDRegionTypes.FIXED_KEYWORD) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_KEYWORD);
-		}
-		else if (type == DTDRegionTypes.NAME || type == DTDRegionTypes.ENTITY_PARM) {
-			// if (region instanceof DTDRegion) {
-			// DTDRegion dtdRegion = (DTDRegion) region;
-			// IStructuredDocumentRegion flatNode = dtdRegion.getParent();
-			// String regionText = flatNode.getText(dtdRegion);
-			// if (regionText.equals("ANY") || regionText.equals("EMPTY")) {
-			// return new TextAttribute(DTDColors.DTD_KEYWORD);
-			// }
-			// }
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_DATA);
-		}
-
-		// default, return null to signal "not handled"
-		// in which case, other factories should be tried
-		return null;
-	}
-
-	protected IPreferenceStore getColorPreferences() {
-		return DTDUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	protected void handlePropertyChange(PropertyChangeEvent event) {
-		String styleKey = null;
-
-		if (event != null) {
-			String prefKey = event.getProperty();
-			// check if preference changed is a style preference
-			if (IStyleConstantsDTD.DTD_DEFAULT.equals(prefKey)) {
-				styleKey = IStyleConstantsDTD.DTD_DEFAULT;
-			}
-			else if (IStyleConstantsDTD.DTD_TAG.equals(prefKey)) {
-				styleKey = IStyleConstantsDTD.DTD_TAG;
-			}
-			else if (IStyleConstantsDTD.DTD_TAGNAME.equals(prefKey)) {
-				styleKey = IStyleConstantsDTD.DTD_TAGNAME;
-			}
-			else if (IStyleConstantsDTD.DTD_COMMENT.equals(prefKey)) {
-				styleKey = IStyleConstantsDTD.DTD_COMMENT;
-			}
-			else if (IStyleConstantsDTD.DTD_KEYWORD.equals(prefKey)) {
-				styleKey = IStyleConstantsDTD.DTD_KEYWORD;
-			}
-			else if (IStyleConstantsDTD.DTD_STRING.equals(prefKey)) {
-				styleKey = IStyleConstantsDTD.DTD_STRING;
-			}
-			else if (IStyleConstantsDTD.DTD_DATA.equals(prefKey)) {
-				styleKey = IStyleConstantsDTD.DTD_DATA;
-			}
-			else if (IStyleConstantsDTD.DTD_SYMBOL.equals(prefKey)) {
-				styleKey = IStyleConstantsDTD.DTD_SYMBOL;
-			}
-		}
-
-		if (styleKey != null) {
-			// overwrite style preference with new value
-			addTextAttribute(styleKey);
-			super.handlePropertyChange(event);
-		}
-	}
-
-	protected void loadColors() {
-		addTextAttribute(IStyleConstantsDTD.DTD_DEFAULT);
-		addTextAttribute(IStyleConstantsDTD.DTD_TAG);
-		addTextAttribute(IStyleConstantsDTD.DTD_TAGNAME);
-		addTextAttribute(IStyleConstantsDTD.DTD_COMMENT);
-		addTextAttribute(IStyleConstantsDTD.DTD_KEYWORD);
-		addTextAttribute(IStyleConstantsDTD.DTD_STRING);
-		addTextAttribute(IStyleConstantsDTD.DTD_DATA);
-		addTextAttribute(IStyleConstantsDTD.DTD_SYMBOL);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java
deleted file mode 100644
index 05aa06b..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java
+++ /dev/null
@@ -1,166 +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.dtd.ui.internal.style;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
-import org.eclipse.wst.dtd.core.internal.provisional.text.IDTDPartitionTypes;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.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.IStructuredPartitioning;
-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.Highlighter;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-public class LineStyleProviderForDTDSubSet implements LineStyleProvider {
-	private IStructuredDocument fDocument = null;
-	private Highlighter fHighlighter = null;
-	private IStructuredModel fInternalModel = null;
-	private LineStyleProviderForDTD fInternalProvider = null;
-	private StyleRange[] fInternalRanges;
-	private String fPartitioning = null;
-
-	public LineStyleProviderForDTDSubSet() {
-		super();
-		fInternalProvider = new LineStyleProviderForDTD();
-		fInternalRanges = new StyleRange[0];
-		fPartitioning = IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING;
-	}
-
-
-	/**
-	 * @param lineRequestStart
-	 * @param lineRequestLength
-	 * @param holdResults
-	 */
-	private void addStyleRanges(int lineRequestStart, int lineRequestLength, Collection holdResults, int adjustment) {
-		int lineRequestEnd = lineRequestStart + lineRequestLength;
-		for (int i = 0; i < fInternalRanges.length; i++) {
-			int adjustedStyleRangeStart = adjustment + fInternalRanges[i].start;
-			int adjustedStyleRangeEnd = adjustedStyleRangeStart + fInternalRanges[i].length;
-			if (adjustedStyleRangeEnd < lineRequestStart || lineRequestEnd < adjustedStyleRangeStart)
-				continue;
-			int end = Math.min(adjustedStyleRangeEnd, lineRequestEnd);
-			StyleRange range = new StyleRange();
-			range.start = Math.max(adjustedStyleRangeStart, lineRequestStart);
-			range.length = end - range.start;
-			range.fontStyle = fInternalRanges[i].fontStyle;
-			range.foreground = fInternalRanges[i].foreground;
-			range.background = fInternalRanges[i].background;
-			holdResults.add(range);
-		}
-	}
-
-	private TextAttribute createTextAttribute(RGB foreground, RGB background, boolean bold) {
-		return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, bold ? SWT.BOLD : SWT.NORMAL);
-	}
-	
-	protected TextAttribute getAttributeFor(ITextRegion region) {
-		TextAttribute ta = null;
-
-		String prefString = getColorPreferences().getString(IStyleConstantsDTD.DTD_DEFAULT);
-		String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
-		if (stylePrefs != null) {
-			RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
-			RGB background = ColorHelper.toRGB(stylePrefs[1]);
-			boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
-			ta = createTextAttribute(foreground, background, bold);
-		}
-		return ta;
-	}
-
-	protected IPreferenceStore getColorPreferences() {
-		return DTDUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	/**
-	 * @return
-	 */
-	private IStructuredDocument getInternalDocument() {
-		if (fInternalModel == null) {
-			fInternalModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForDTD.ContentTypeID_DTD);
-		}
-		return fInternalModel.getStructuredDocument();
-	}
-
-	public void init(IStructuredDocument document, Highlighter highlighter) {
-		fDocument = document;
-		fHighlighter = highlighter;
-	}
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.structured.style.AbstractLineStyleProvider#prepareRegions(org.eclipse.jface.text.ITypedRegion,
-	 *      int, int, java.util.Collection)
-	 */
-	public boolean prepareRegions(ITypedRegion typedRegion, int lineRequestStart, int lineRequestLength, Collection holdResults) {
-		if (!IDTDPartitionTypes.DTD_DEFAULT.equals(typedRegion.getType())) {
-			// compute an internal DTD model and return linestyles for it
-			ITextRegion dtdContentRegion = null;
-			IStructuredDocumentRegion doctype = fDocument.getRegionAtCharacterOffset(typedRegion.getOffset());
-			if (doctype != null)
-				dtdContentRegion = doctype.getRegionAtCharacterOffset(typedRegion.getOffset());
-			String contents = dtdContentRegion != null ? doctype.getFullText(dtdContentRegion) : null;
-			IStructuredDocument document = getInternalDocument();
-			if (document == null)
-				return false;
-
-			updateStyleRanges(document, contents);
-
-			addStyleRanges(lineRequestStart, lineRequestLength, holdResults, doctype.getStartOffset(dtdContentRegion));
-			return true;
-		}
-		return false;
-	}
-
-	public void release() {
-		if (fInternalProvider != null) {
-			fInternalProvider.release();
-		}
-	}
-
-	private void updateStyleRanges(IStructuredDocument document, String contents) {
-		if (!document.get().equals(contents)) {
-			document.set(contents);
-			try {
-				ITypedRegion regions[] = TextUtilities.computePartitioning(getInternalDocument(), fPartitioning, 0, document.getLength(), false);
-				List ranges = new ArrayList();
-				fInternalProvider.init(getInternalDocument(), fHighlighter);
-				for (int i = 0; i < regions.length; i++) {
-					fInternalProvider.prepareRegions(regions[i], regions[i].getOffset(), regions[i].getLength(), ranges);
-				}
-				fInternalRanges = (StyleRange[]) ranges.toArray(new StyleRange[0]);
-			}
-			catch (BadLocationException e) {
-				fInternalRanges = new StyleRange[0];
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeDTD.java
deleted file mode 100644
index 403c3ad..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeDTD.java
+++ /dev/null
@@ -1,33 +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.dtd.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContextType;
-
-/**
- * Base class for DTD template context types. Templates of this context type
- * apply to any place within DTD content type.
- */
-public class TemplateContextTypeDTD extends TemplateContextType {
-
-	public TemplateContextTypeDTD() {
-		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());
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeIdsDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeIdsDTD.java
deleted file mode 100644
index 0aa4ee0..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/templates/TemplateContextTypeIdsDTD.java
+++ /dev/null
@@ -1,17 +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.dtd.ui.internal.templates;
-
-
-public class TemplateContextTypeIdsDTD {
-	public static final String NEW = "dtd_new"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/text/DTDDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/text/DTDDocumentRegionEdgeMatcher.java
deleted file mode 100644
index 4bebd89..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/text/DTDDocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,28 +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.dtd.ui.internal.text;
-
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
-
-
-public class DTDDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
-
-	/**
-	 * @param validContexts
-	 * @param nextMatcher
-	 */
-	public DTDDocumentRegionEdgeMatcher() {
-		super(new String[]{DTDRegionTypes.START_TAG, DTDRegionTypes.COMMENT_START}, null);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeAction.java
deleted file mode 100644
index db4936f..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeAction.java
+++ /dev/null
@@ -1,56 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddAttributeAction extends BaseAction {
-
-	public AddAttributeAction(DTDModelImpl model, String label) {
-		super(model, label);
-	}
-
-	public void run() {
-		DTDNode selectedNode = getFirstNodeSelected();
-		String newName = "NewAttribute"; //$NON-NLS-1$
-		if (selectedNode instanceof AttributeList) {
-			((AttributeList) selectedNode).addAttribute(newName);
-		}
-		else if (selectedNode instanceof Element) {
-			((Element) selectedNode).addAttribute(newName);
-		}
-	}
-
-	protected boolean updateSelection(IStructuredSelection selection) {
-		boolean rc = super.updateSelection(selection);
-		DTDNode node = getFirstNodeSelected(selection);
-		if (node instanceof Element) {
-			// System.out.println("attribute set to true");
-			setEnabled(true);
-		}
-		else {
-			// System.out.println("attribute set to false");
-			setEnabled(false);
-		}
-
-		return rc;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeListAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeListAction.java
deleted file mode 100644
index 784251a..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddAttributeListAction.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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddAttributeListAction extends BaseAction {
-
-	public AddAttributeListAction(DTDModelImpl model, String label) {
-		super(model, label);
-	}
-
-	public void run() {
-		DTDNode selectedNode = getFirstNodeSelected();
-		DTDFile dtdFile = getModel().getDTDFile();
-		String attListName = "NewAttList"; //$NON-NLS-1$
-		if (selectedNode != null) {
-			DTDNode topLevelNode = dtdFile.getTopLevelNodeAt(selectedNode.getStartOffset());
-			if (topLevelNode instanceof Element) {
-				attListName = ((Element) topLevelNode).getName();
-			}
-		}
-
-		getModel().getDTDFile().createAttributeList(selectedNode, attListName, true);
-		// newElement.setName(DTDUniqueNameHelper.getUniqueElementName(dtdFile));
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddCommentAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddCommentAction.java
deleted file mode 100644
index e6c6976..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddCommentAction.java
+++ /dev/null
@@ -1,32 +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.dtd.ui.internal.views.contentoutline.actions;
-
-
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddCommentAction extends BaseAction {
-
-	public AddCommentAction(DTDModelImpl model, String label) {
-		super(model, label);
-	}
-
-	public void run() {
-		DTDNode selectedNode = getFirstNodeSelected();
-		getModel().getDTDFile().createComment(selectedNode, "NewComment", true); //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementAction.java
deleted file mode 100644
index 108a36a..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementAction.java
+++ /dev/null
@@ -1,33 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.util.DTDUniqueNameHelper;
-
-
-public class AddElementAction extends BaseAction {
-
-	public AddElementAction(DTDModelImpl model, String label) {
-		super(model, label);
-	}
-
-	public void run() {
-		DTDNode selectedNode = getFirstNodeSelected();
-		DTDFile dtdFile = getModel().getDTDFile();
-		String elementName = DTDUniqueNameHelper.getUniqueElementName(dtdFile);
-		dtdFile.createElement(selectedNode, elementName, true); //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementToContentModelAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementToContentModelAction.java
deleted file mode 100644
index 403026b..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddElementToContentModelAction.java
+++ /dev/null
@@ -1,52 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddElementToContentModelAction extends BaseAction {
-
-	public AddElementToContentModelAction(DTDModelImpl model, String label) {
-		super(model, label);
-	}
-
-	public void run() {
-		DTDNode node = getFirstNodeSelected();
-
-		if (node instanceof CMGroupNode) {
-			((CMGroupNode) node).addChild();
-		}
-		else if (node instanceof Element) {
-			((Element) node).addChild();
-		}
-	}
-
-	protected boolean updateSelection(IStructuredSelection selection) {
-		boolean rc = super.updateSelection(selection);
-		DTDNode node = getFirstNodeSelected(selection);
-		if (node instanceof CMGroupNode) {
-			setEnabled(true);
-		}
-		else {
-			setEnabled(false);
-		}
-		return rc;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddEntityAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddEntityAction.java
deleted file mode 100644
index 4b14bfc..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddEntityAction.java
+++ /dev/null
@@ -1,35 +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.dtd.ui.internal.views.contentoutline.actions;
-
-
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddEntityAction extends BaseAction {
-
-	public AddEntityAction(DTDModelImpl model, String label) {
-		super(model, label);
-	}
-
-	public void run() {
-		DTDNode selectedNode = getFirstNodeSelected();
-
-		getModel().getDTDFile().createEntity(selectedNode, "NewEntity", true); //$NON-NLS-1$
-		// newElement.setName(DTDUniqueNameHelper.getUniqueElementName(dtdFile));
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddGroupToContentModelAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddGroupToContentModelAction.java
deleted file mode 100644
index 72e6e8e..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddGroupToContentModelAction.java
+++ /dev/null
@@ -1,39 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddGroupToContentModelAction extends BaseAction {
-
-	public AddGroupToContentModelAction(DTDModelImpl model, String label) {
-		super(model, label);
-	}
-
-	public void run() {
-		DTDNode node = getFirstNodeSelected();
-
-		if (node instanceof CMGroupNode) {
-			((CMGroupNode) node).addGroup();
-		}
-		else if (node instanceof Element) {
-			((Element) node).addGroup();
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddNotationAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddNotationAction.java
deleted file mode 100644
index fb1f071..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddNotationAction.java
+++ /dev/null
@@ -1,34 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-
-public class AddNotationAction extends BaseAction {
-
-	public AddNotationAction(DTDModelImpl model, String label) {
-		super(model, label);
-	}
-
-	public void run() {
-		DTDNode selectedNode = getFirstNodeSelected();
-
-		getModel().getDTDFile().createNotation(selectedNode, "NewNotation", true); //$NON-NLS-1$
-
-		// newNotation.setName(DTDUniqueNameHelper.getUniqueNotationName(dtdFile));
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddParameterEntityReferenceAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddParameterEntityReferenceAction.java
deleted file mode 100644
index 4c38894..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/AddParameterEntityReferenceAction.java
+++ /dev/null
@@ -1,49 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.util.LabelValuePair;
-
-
-public class AddParameterEntityReferenceAction extends BaseAction {
-	public AddParameterEntityReferenceAction(DTDModelImpl model, String label) {
-		super(model, label);
-	}
-
-	public String getFirstExternalParameterEntity(DTDFile dtdFile) {
-		LabelValuePair[] freeExternalEntities = dtdFile.getDTDModel().createParmEntityContentItems(null);
-
-		if (freeExternalEntities.length > 0) {
-			return (String) freeExternalEntities[0].fValue;
-			// return (Entity) freeExternalEntities[0].fValue;
-		}
-		return null;
-	}
-
-	public void run() {
-		DTDFile dtdFile = getModel().getDTDFile();
-		String extEntity = getFirstExternalParameterEntity(dtdFile);
-		DTDNode selectedNode = getFirstNodeSelected();
-		if (extEntity != null) {
-			dtdFile.createParameterEntityReference(selectedNode, extEntity, true);
-		}
-		else {
-			dtdFile.createParameterEntityReference(selectedNode, "%NewEntityReference;", true); //$NON-NLS-1$
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/BaseAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/BaseAction.java
deleted file mode 100644
index 158737c..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/BaseAction.java
+++ /dev/null
@@ -1,67 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-
-abstract public class BaseAction extends SelectionListenerAction {
-
-	protected IEditorActionBarContributor contextContributor;
-	private IStructuredModel fModel;
-
-	public BaseAction(IStructuredModel model, String text) {
-		this(model, text, null);
-	}
-
-	public BaseAction(IStructuredModel model, String text, ImageDescriptor imageDesc) {
-		super(text);
-		fModel = model;
-		setImageDescriptor(imageDesc);
-	}
-
-	protected DTDNode getFirstNodeSelected() {
-		return getFirstNodeSelected(getStructuredSelection());
-	}
-
-	protected DTDNode getFirstNodeSelected(IStructuredSelection selection) {
-		Iterator iter = selection.iterator();
-		// DTDNode referencePoint = null;
-		while (iter.hasNext()) {
-			Object element = iter.next();
-			if (element instanceof DTDNode) {
-				return (DTDNode) element;
-			}
-		}
-		return null;
-	}
-
-	protected DTDModelImpl getModel() {
-		return (DTDModelImpl) fModel;
-	}
-
-	public void setContextContributor(IEditorActionBarContributor contributor) {
-		contextContributor = contributor;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/DeleteAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/DeleteAction.java
deleted file mode 100644
index af094b2..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/DeleteAction.java
+++ /dev/null
@@ -1,70 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.util.DTDBatchNodeDelete;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-
-
-public class DeleteAction extends SelectionListenerAction {
-
-	public DeleteAction(String label) {
-		super(label);
-	}
-
-	public void run() {
-		IStructuredSelection selection = getStructuredSelection();
-
-		Iterator iter = selection.iterator();
-		DTDBatchNodeDelete batchDelete = null;
-		DTDFile dtdFile = null;
-		while (iter.hasNext()) {
-			Object element = iter.next();
-			if (element instanceof DTDNode) {
-				DTDNode node = (DTDNode) element;
-				dtdFile = node.getDTDFile();
-				if (batchDelete == null) {
-					batchDelete = new DTDBatchNodeDelete(dtdFile);
-				}
-				batchDelete.addNode((DTDNode) element);
-			}
-		}
-		dtdFile.getDTDModel().beginRecording(this, DTDUIMessages._UI_LABEL_DTD_FILE_DELETE); //$NON-NLS-1$
-		batchDelete.deleteNodes(this);
-		dtdFile.getDTDModel().endRecording(this);
-	}
-
-	public boolean updateSelection(IStructuredSelection sel) {
-		if (!super.updateSelection(sel))
-			return false;
-
-		Object selectedObject = sel.getFirstElement();
-		if (selectedObject instanceof DTDNode && !(selectedObject instanceof CMNode && ((CMNode) selectedObject).isRootElementContent())) {
-			setEnabled(true);
-			return true; // enable delete menu item
-		}
-		else {
-			setEnabled(false);
-			return false; // disable it - grey out
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/ReplaceEmptyContentModelWithGroupAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/ReplaceEmptyContentModelWithGroupAction.java
deleted file mode 100644
index 5523965..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/contentoutline/actions/ReplaceEmptyContentModelWithGroupAction.java
+++ /dev/null
@@ -1,44 +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.dtd.ui.internal.views.contentoutline.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-
-public class ReplaceEmptyContentModelWithGroupAction extends BaseAction {
-
-	public ReplaceEmptyContentModelWithGroupAction(DTDModelImpl model, String label) {
-		super(model, label);
-	}
-
-	public void run() {
-		DTDNode node = getFirstNodeSelected();
-		if (node instanceof Element) {
-			CMNode contentModel = ((Element) node).getContentModel();
-			if (CMNode.EMPTY.equals(contentModel.getType())) {
-				getModel().beginRecording(this, getText());
-				((Element) node).replaceContentModel(this, "()"); //$NON-NLS-1$
-				getModel().endRecording(this);
-			}
-		}
-	}
-
-	protected boolean updateSelection(IStructuredSelection selection) {
-		boolean rc = super.updateSelection(selection);
-		DTDNode node = getFirstNodeSelected(selection);
-		setEnabled(node instanceof Element);
-		return rc;
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapter.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapter.java
deleted file mode 100644
index 8f9008f..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapter.java
+++ /dev/null
@@ -1,130 +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.dtd.ui.internal.views.properties;
-
-import java.util.Stack;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.properties.CustomPropertyDescriptor;
-
-
-/**
- * An IPropertySource implementation for a JFace viewer used to display
- * properties of DOM nodes. Requires an adapter factory to create JFace
- * adapters for the nodes in the tree.
- */
-public class DTDPropertySourceAdapter implements INodeAdapter, IPropertySource {
-	protected final static String CATEGORY_ATTRIBUTES = "Attributes"; //$NON-NLS-1$
-
-	private static final String ID_NAME = DTDUIMessages.DTDPropertySourceAdapter_0; //$NON-NLS-1$
-	private static final String ID_TEXT = DTDUIMessages.DTDPropertySourceAdapter_1; //$NON-NLS-1$
-
-	protected IPropertyDescriptor[] fDescriptors = null;
-	protected INodeNotifier fNode = null;
-
-	protected Stack fValuesBeingSet = new Stack();
-
-	public DTDPropertySourceAdapter(INodeNotifier target) {
-		super();
-		fNode = target;
-	}
-
-	/**
-	 * @return
-	 */
-	private IPropertyDescriptor[] createPropertyDescriptors() {
-		CustomPropertyDescriptor nameDescriptor = new CustomPropertyDescriptor(ID_NAME, ID_NAME, null);
-		nameDescriptor.setCategory(DTDUIMessages.DTDPropertySourceAdapter_2); //$NON-NLS-1$
-		// CustomPropertyDescriptor contentDescriptor = new
-		// CustomPropertyDescriptor(ID_TEXT, ID_TEXT, null);
-		// contentDescriptor.setCategory("Attributes");
-		return new IPropertyDescriptor[]{nameDescriptor};
-	}
-
-	/**
-	 * Returns a value for this Node that can be editted in a property sheet.
-	 * 
-	 * @return a value that can be editted
-	 */
-	public Object getEditableValue() {
-		return null;
-	}
-
-	/**
-	 * Returns the current collection of property descriptors.
-	 * 
-	 * @return all valid descriptors.
-	 */
-	public IPropertyDescriptor[] getPropertyDescriptors() {
-		if (fDescriptors == null || fDescriptors.length == 0) {
-			fDescriptors = createPropertyDescriptors();
-		}
-		else {
-			updatePropertyDescriptors();
-		}
-		return fDescriptors;
-	}
-
-	/**
-	 * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-	 */
-	public Object getPropertyValue(Object id) {
-		Object value = null;
-		if (id.equals(ID_NAME) && fNode instanceof DTDNode) {
-			value = ((DTDNode) fNode).getName();
-		}
-		if (id.equals(ID_TEXT) && fNode instanceof DTDNode) {
-			value = ((DTDNode) fNode).getFullNodeText();
-		}
-		return value;
-	}
-
-	/**
-	 * 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 == IPropertySource.class;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-	 */
-	public boolean isPropertySet(Object id) {
-		return false;
-	}
-
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-	 */
-	public void resetPropertyValue(Object id) {
-	}
-
-	public void setPropertyValue(Object nameObject, Object value) {
-	}
-
-	protected void updatePropertyDescriptors() {
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapterFactory.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapterFactory.java
deleted file mode 100644
index 59606bb..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/views/properties/DTDPropertySourceAdapterFactory.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.dtd.ui.internal.views.properties;
-
-
-
-import org.eclipse.ui.views.properties.IPropertySource;
-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 DTDPropertySourceAdapterFactory extends AbstractAdapterFactory {
-
-	public DTDPropertySourceAdapterFactory() {
-		super(IPropertySource.class, true);
-	}
-
-	public DTDPropertySourceAdapterFactory(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-	public INodeAdapterFactory copy() {
-		return new DTDPropertySourceAdapterFactory(getAdapterKey(), isShouldRegisterAdapter());
-	}
-
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		// at the moment, only one implementation exists
-		return new DTDPropertySourceAdapter(target);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDTemplatesWizardPage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDTemplatesWizardPage.java
deleted file mode 100644
index 6f85d07..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDTemplatesWizardPage.java
+++ /dev/null
@@ -1,485 +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.dtd.ui.internal.wizard;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-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.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.Logger;
-import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.dtd.ui.internal.preferences.DTDUIPreferenceNames;
-import org.eclipse.wst.dtd.ui.internal.templates.TemplateContextTypeIdsDTD;
-
-/**
- * Templates page in new file wizard. Allows users to select a new file
- * template to be applied in new file.
- * 
- */
-public class NewDTDTemplatesWizardPage 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(TemplateContextTypeIdsDTD.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 NewDTDTemplatesWizardPage() {
-		super("NewDTDTemplatesWizardPage", DTDUIMessages.NewDTDTemplatesWizardPage_0, null); //$NON-NLS-1$
-		setDescription(DTDUIMessages.NewDTDTemplatesWizardPage_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 DTD Template
-		fUseTemplateButton = new Button(parent, SWT.CHECK);
-		fUseTemplateButton.setText(DTDUIMessages.NewDTDTemplatesWizardPage_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);
-
-		// Create linked text to just to templates preference page
-		Link link = new Link(innerParent, SWT.NONE);
-		link.setText(DTDUIMessages.NewDTDTemplatesWizardPage_6);
-		data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
-		link.setLayoutData(data);
-		link.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				linkClicked();
-			}
-		});
-
-		// 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(DTDUIMessages.NewDTDTemplatesWizardPage_2);
-
-		TableColumn column2 = new TableColumn(table, SWT.NONE);
-		column2.setText(DTDUIMessages.NewDTDTemplatesWizardPage_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 = DTDUIPlugin.getDefault().getTemplateStore();
-		fTableViewer.setInput(fTemplateStore);
-
-		configureTableResizing(innerParent, table, column1, column2);
-		loadLastSavedPreferences();
-
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.DTD_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) {
-		SourceViewer viewer = new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		SourceViewerConfiguration configuration = new SourceViewerConfiguration();
-		viewer.configure(configuration);
-		IDocument document = new Document();
-		viewer.setDocument(document);
-		return viewer;
-	}
-
-	private SourceViewer doCreateViewer(Composite parent) {
-		Label label = new Label(parent, SWT.NONE);
-		label.setText(DTDUIMessages.NewDTDTemplatesWizardPage_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);
-		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.dtd.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 = DTDUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsDTD.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 dtd", 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 DTD File wizard.
-	 */
-	private void loadLastSavedPreferences() {
-		String templateName = DTDUIPlugin.getDefault().getPreferenceStore().getString(DTDUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
-		if (templateName == null || templateName.length() == 0) {
-			fLastSelectedTemplateName = ""; //$NON-NLS-1$
-			fUseTemplateButton.setSelection(false);
-		}
-		else {
-			fLastSelectedTemplateName = templateName;
-			fUseTemplateButton.setSelection(true);
-		}
-		enableTemplates();
-	}
-
-	/**
-	 * Save template name used for next call to New DTD File wizard.
-	 */
-	void saveLastSavedPreferences() {
-		String templateName = ""; //$NON-NLS-1$
-
-		Template template = getSelectedTemplate();
-		if (template != null) {
-			templateName = template.getName();
-		}
-
-		DTDUIPlugin.getDefault().getPreferenceStore().setValue(DTDUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
-		DTDUIPlugin.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, TemplateContextTypeIdsDTD.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.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java
deleted file mode 100644
index 0cec6ef..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java
+++ /dev/null
@@ -1,150 +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.dtd.ui.internal.wizard;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStreamWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-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.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.dtd.core.internal.DTDCorePlugin;
-import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.Logger;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImageHelper;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-public class NewDTDWizard extends Wizard implements INewWizard {
-	private WizardNewFileCreationPage fNewFilePage;
-	private NewDTDTemplatesWizardPage fNewFileTemplatesPage;
-	private IStructuredSelection fSelection;
-	private List fValidExtensions = null;
-
-	/**
-	 * Get list of valid extensions for DTD Content type
-	 * 
-	 * @return
-	 */
-	List getValidExtensions() {
-		if (fValidExtensions == null) {
-			IContentType type = Platform.getContentTypeManager().getContentType(ContentTypeIdForDTD.ContentTypeID_DTD);
-			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
-		}
-		return fValidExtensions;
-	}
-	
-	public void addPages() {
-		fNewFilePage = new WizardNewFileCreationPage("DTDWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))) { //$NON-NLS-1$
-			protected boolean validatePage() {
-				IPath handlePath = new Path(getFileName());
-				String extension = handlePath.getFileExtension();
-				if (extension == null || !extension.equalsIgnoreCase("dtd")) { //$NON-NLS-1$
-					setErrorMessage(DTDUIMessages._ERROR_FILENAME_MUST_END_DTD); //$NON-NLS-1$
-					return false;
-				}
-				setErrorMessage(null);
-				return super.validatePage();
-			}
-		};
-		fNewFilePage.setTitle(DTDUIMessages._UI_CREATE_NEW_DTD_FILE); 
-		fNewFilePage.setDescription(DTDUIMessages._UI_WIZARD_NEW_DTD_EXPL); 
-
-		addPage(fNewFilePage);
-		
-		fNewFileTemplatesPage = new NewDTDTemplatesWizardPage();
-		addPage(fNewFileTemplatesPage);
-	}
-
-	public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
-		fSelection = aSelection;
-		setWindowTitle(DTDUIMessages._UI_WIZARD_NEW_DTD_TITLE); //$NON-NLS-1$
-		
-		ImageDescriptor descriptor = DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_WIZBAN_NEWDTDFILE);
-		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() {
-		// save user options for next use
-		fNewFileTemplatesPage.saveLastSavedPreferences();
-		
-		IFile file = fNewFilePage.createNewFile();
-		
-		// put template contents into file
-		String templateString = fNewFileTemplatesPage.getTemplateString();
-		if (templateString != null) {
-			// determine the encoding for the new file
-			Preferences preference = DTDCorePlugin.getInstance().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 DTD file", e); //$NON-NLS-1$
-			}
-		}
-
-		// open the file in editor
-		openEditor(file);
-		return true;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineConfiguration.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineConfiguration.java
deleted file mode 100644
index ce87173..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineConfiguration.java
+++ /dev/null
@@ -1,236 +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.dtd.ui.views.contentoutline;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.TransferDragSourceListener;
-import org.eclipse.jface.util.TransferDropTargetListener;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.wst.common.ui.internal.dnd.ObjectTransfer;
-import org.eclipse.wst.common.ui.internal.dnd.ViewerDragAdapter;
-import org.eclipse.wst.common.ui.internal.dnd.ViewerDropAdapter;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-import org.eclipse.wst.dtd.ui.internal.dnd.DTDDragAndDropManager;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateActionContributionItem;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
-
-/**
- * Configuration for outline view page which shows DTD content.
- * 
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
- * @since 1.0
- */
-public class DTDContentOutlineConfiguration extends ContentOutlineConfiguration {
-	private IContentProvider fContentProvider = null;
-	private ILabelProvider fLabelProvider = null;
-
-	private DTDContextMenuHelper fMenuHelper;
-	private TransferDragSourceListener[] fTransferDragSourceListeners;
-	private TransferDropTargetListener[] fTransferDropTargetListeners;
-	private Map fViewerContributions;
-	private final String OUTLINE_ORDER_PREF = "outline-order"; //$NON-NLS-1$
-	private final String OUTLINE_SORT_PREF = "outline-sort"; //$NON-NLS-1$
-
-	/**
-	 * Default constructor for DTDContentOutlineConfiguration.
-	 */
-	public DTDContentOutlineConfiguration() {
-		// Must have empty constructor to createExecutableExtension
-		super();
-		fViewerContributions = new HashMap(2);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#createToolbarContributions(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public IContributionItem[] createToolbarContributions(TreeViewer viewer) {
-		Assert.isTrue(getContentProvider(viewer) instanceof DTDTreeContentProvider, "invalid content provider on viewer"); //$NON-NLS-1$
-		IContributionItem[] items = super.createToolbarContributions(viewer);
-
-		SortAction sortAction = new SortAction(viewer, DTDUIPlugin.getDefault().getPreferenceStore(), OUTLINE_SORT_PREF);
-		OrderAction orderAction = new OrderAction(viewer, (DTDTreeContentProvider) getContentProvider(viewer), DTDUIPlugin.getDefault().getPreferenceStore(), OUTLINE_ORDER_PREF);
-		IContributionItem sortItem = new PropertyChangeUpdateActionContributionItem(sortAction);
-		IContributionItem orderItem = new PropertyChangeUpdateActionContributionItem(orderAction);
-
-		if (items == null) {
-			items = new IContributionItem[2];
-			items[0] = sortItem;
-			items[1] = orderItem;
-		}
-		else {
-			IContributionItem[] combinedItems = new IContributionItem[items.length + 2];
-			combinedItems[0] = sortItem;
-			combinedItems[1] = orderItem;
-			System.arraycopy(items, 0, combinedItems, 2, items.length);
-			items = combinedItems;
-		}
-		return items;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getContentProvider(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public IContentProvider getContentProvider(TreeViewer viewer) {
-		if (fContentProvider == null) {
-			fContentProvider = new DTDTreeContentProvider();
-		}
-		// return super.getContentProvider(viewer);
-		return fContentProvider;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getLabelProvider(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public ILabelProvider getLabelProvider(TreeViewer viewer) {
-		if (fLabelProvider == null) {
-			fLabelProvider = new DTDLabelProvider();
-		}
-		// return super.getLabelProvider(viewer);
-		return fLabelProvider;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getMenuListener(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public IMenuListener getMenuListener(TreeViewer viewer) {
-		IMenuListener listener = null;
-		if (fMenuHelper == null && viewer.getInput() instanceof DTDModelImpl) {
-			fMenuHelper = new DTDContextMenuHelper((DTDModelImpl) viewer.getInput());
-			fMenuHelper.createMenuListenersFor(viewer);
-		}
-		if (fMenuHelper != null) {
-			listener = fMenuHelper.getMenuListener();
-		}
-		return listener;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getPreferenceStore()
-	 */
-	protected IPreferenceStore getPreferenceStore() {
-		return DTDUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDragSourceListeners(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public TransferDragSourceListener[] getTransferDragSourceListeners(TreeViewer treeViewer) {
-		if (fTransferDragSourceListeners == null) {
-			// emulate the XMLDragAndDropManager
-			final ViewerDragAdapter dragAdapter = new ViewerDragAdapter(treeViewer);
-			fTransferDragSourceListeners = new TransferDragSourceListener[]{new TransferDragSourceListener() {
-				public void dragFinished(DragSourceEvent event) {
-					dragAdapter.dragFinished(event);
-				}
-
-				public void dragSetData(DragSourceEvent event) {
-					dragAdapter.dragSetData(event);
-				}
-
-				public void dragStart(DragSourceEvent event) {
-					dragAdapter.dragStart(event);
-				}
-
-				public Transfer getTransfer() {
-					return ObjectTransfer.getInstance();
-				}
-			}};
-		}
-
-		return fTransferDragSourceListeners;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDropTargetListeners(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public TransferDropTargetListener[] getTransferDropTargetListeners(TreeViewer treeViewer) {
-		if (fTransferDropTargetListeners == null) {
-			// emulate the XMLDragAnDropManager
-			final ViewerDropAdapter dropAdapter = new ViewerDropAdapter(treeViewer, new DTDDragAndDropManager());
-			fTransferDropTargetListeners = new TransferDropTargetListener[]{new TransferDropTargetListener() {
-				public void dragEnter(DropTargetEvent event) {
-					dropAdapter.dragEnter(event);
-				}
-
-				public void dragLeave(DropTargetEvent event) {
-					dropAdapter.dragLeave(event);
-				}
-
-				public void dragOperationChanged(DropTargetEvent event) {
-					dropAdapter.dragOperationChanged(event);
-				}
-
-				public void dragOver(DropTargetEvent event) {
-					dropAdapter.dragOver(event);
-				}
-
-				public void drop(DropTargetEvent event) {
-					dropAdapter.drop(event);
-				}
-
-				public void dropAccept(DropTargetEvent event) {
-					dropAdapter.dropAccept(event);
-				}
-
-				public Transfer getTransfer() {
-					return ObjectTransfer.getInstance();
-				}
-
-				public boolean isEnabled(DropTargetEvent event) {
-					return getTransfer().isSupportedType(event.currentDataType);
-				}
-			}};
-		}
-		return fTransferDropTargetListeners;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#unconfigure(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public void unconfigure(TreeViewer viewer) {
-		super.unconfigure(viewer);
-		fViewerContributions.remove(viewer);
-		if (fMenuHelper != null) {
-			fMenuHelper.removeMenuListenersFor(viewer);
-			fMenuHelper = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java
deleted file mode 100644
index 5dfc6ba..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java
+++ /dev/null
@@ -1,284 +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.dtd.ui.views.contentoutline;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.CMNode;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.NodeList;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.internal.util.LabelValuePair;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImageHelper;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddAttributeAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddAttributeListAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddCommentAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddElementAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddElementToContentModelAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddEntityAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddGroupToContentModelAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddNotationAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.AddParameterEntityReferenceAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.DeleteAction;
-import org.eclipse.wst.dtd.ui.internal.views.contentoutline.actions.ReplaceEmptyContentModelWithGroupAction;
-
-/**
- * Menu helper for Content Outline page. This should not be used elsewhere.
- */
-class DTDContextMenuHelper {
-	class DTDMenuListener implements IMenuListener {
-		public void menuAboutToShow(IMenuManager manager) {
-			// update the action selection now
-			addNotationAction.selectionChanged(fViewerSelection);
-			addEntityAction.selectionChanged(fViewerSelection);
-			addElementAction.selectionChanged(fViewerSelection);
-			addCommentAction.selectionChanged(fViewerSelection);
-			addParameterEntityReferenceAction.selectionChanged(fViewerSelection);
-			deleteAction.selectionChanged(fViewerSelection);
-			addAttributeAction.selectionChanged(fViewerSelection);
-			addAttributeListAction.selectionChanged(fViewerSelection);
-			addGroupToContentModelAction.selectionChanged(fViewerSelection);
-			addElementToContentModelAction.selectionChanged(fViewerSelection);
-			replaceEmptyContentModelWithGroupAction.selectionChanged(fViewerSelection);
-
-
-			if (!fViewerSelection.isEmpty()) {
-				addActionItemsForSelection(fViewerSelection.getFirstElement(), manager);
-			}
-		}
-	}
-
-	class ViewerSelectionChangeListener implements ISelectionChangedListener {
-		public void selectionChanged(SelectionChangedEvent event) {
-			_selectionChanged(event);
-		}
-	}
-
-	AddAttributeAction addAttributeAction;
-
-	AddAttributeListAction addAttributeListAction;
-	AddCommentAction addCommentAction;
-	AddElementAction addElementAction;
-	AddElementToContentModelAction addElementToContentModelAction;
-	AddEntityAction addEntityAction;
-	AddGroupToContentModelAction addGroupToContentModelAction;
-	AddNotationAction addNotationAction;
-	AddParameterEntityReferenceAction addParameterEntityReferenceAction;
-	DeleteAction deleteAction;
-	private ISelectionChangedListener fInternalSelectionChangedListener = new ViewerSelectionChangeListener();
-
-	private IMenuListener fMenuListener;
-	private DTDModelImpl fModel;
-	private List fViewerList;
-
-	IStructuredSelection fViewerSelection = StructuredSelection.EMPTY;
-
-	ReplaceEmptyContentModelWithGroupAction replaceEmptyContentModelWithGroupAction;
-
-	public DTDContextMenuHelper(DTDModelImpl model) {
-		fModel = model;
-		fViewerList = new ArrayList(1);
-		fMenuListener = new DTDMenuListener();
-
-		addNotationAction = new AddNotationAction(model, DTDUIMessages._UI_ACTION_ADD_DTD_NOTATION); //$NON-NLS-1$
-		addEntityAction = new AddEntityAction(model, DTDUIMessages._UI_ACTION_ADD_DTD_ENTITY); //$NON-NLS-1$
-		addElementAction = new AddElementAction(model, DTDUIMessages._UI_ACTION_ADD_DTD_ELEMENT); //$NON-NLS-1$
-		addCommentAction = new AddCommentAction(model, DTDUIMessages._UI_ACTION_ADD_DTD_COMMENT); //$NON-NLS-1$
-
-		addParameterEntityReferenceAction = new AddParameterEntityReferenceAction(model, DTDUIMessages._UI_ACTION_ADD_PARAM_ENTITY_REF); //$NON-NLS-1$
-		deleteAction = new DeleteAction(DTDUIMessages._UI_ACTION_DTD_DELETE); //$NON-NLS-1$
-		addAttributeAction = new AddAttributeAction(model, DTDUIMessages._UI_ACTION_ADD_ATTRIBUTE); //$NON-NLS-1$
-		addAttributeListAction = new AddAttributeListAction(model, DTDUIMessages._UI_ACTION_ADD_ATTRIBUTELIST); //$NON-NLS-1$
-
-		addGroupToContentModelAction = new AddGroupToContentModelAction(model, DTDUIMessages._UI_ACTION_GROUP_ADD_GROUP); //$NON-NLS-1$
-		addElementToContentModelAction = new AddElementToContentModelAction(model, DTDUIMessages._UI_ACTION_ADD_ELEMENT); //$NON-NLS-1$
-
-		replaceEmptyContentModelWithGroupAction = new ReplaceEmptyContentModelWithGroupAction(model, DTDUIMessages._UI_ACTION_GROUP_ADD_GROUP); //$NON-NLS-1$
-
-		addNotationAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ADD_NOTATION));
-		addEntityAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ADD_ENTITY));
-		addCommentAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ADD_COMMENT));
-		addParameterEntityReferenceAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ADD_ENTITY_REFERENCE));
-
-		// Tri-state images
-		addElementAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_ELEMENT));
-		addElementAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_ELEMENT));
-		addElementAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_ELEMENT));
-
-		addAttributeAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_ATTRIBUTE));
-		addAttributeAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_ATTRIBUTE));
-		addAttributeAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_ATTRIBUTE));
-
-		addAttributeListAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_ATTRIBUTE));
-		addAttributeListAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_ATTRIBUTE));
-		addAttributeListAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_ATTRIBUTE));
-
-		addGroupToContentModelAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_GROUPTOCONMODEL));
-		addGroupToContentModelAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_GROUPTOCONMODEL));
-		addGroupToContentModelAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_GROUPTOCONMODEL));
-
-		addElementToContentModelAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_ELEMENTTOCONMODEL));
-		addElementToContentModelAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_ELEMENTTOCONMODEL));
-		addElementToContentModelAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_ELEMENTTOCONMODEL));
-
-		// use the same images as addGroupToContentModelAction
-		replaceEmptyContentModelWithGroupAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_GROUPTOCONMODEL));
-		replaceEmptyContentModelWithGroupAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_GROUPTOCONMODEL));
-		replaceEmptyContentModelWithGroupAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_GROUPTOCONMODEL));
-	}
-
-	void _selectionChanged(SelectionChangedEvent event) {
-		/*
-		 * Save the selection so we only notify the actions when the menu is
-		 * shown
-		 */
-		ISelection selection = event.getSelection();
-		if (selection instanceof IStructuredSelection) {
-			fViewerSelection = (IStructuredSelection) selection;
-		}
-		else {
-			fViewerSelection = StructuredSelection.EMPTY;
-		}
-	}
-
-	void addActionItemsForSelection(Object selectedObject, IMenuManager menu) {
-		if (selectedObject instanceof NodeList) {
-			// add appropriate menu to logical view
-			NodeList folder = (NodeList) selectedObject;
-			if (folder.getListType().equals(DTDRegionTypes.NOTATION_TAG)) {
-				menu.add(addNotationAction);
-			}
-			else if (folder.getListType().equals(DTDRegionTypes.ENTITY_TAG)) {
-				menu.add(addEntityAction);
-			}
-			else if (folder.getListType().equals(DTDRegionTypes.ELEMENT_TAG)) {
-				LabelValuePair[] availableEntities = fModel.createParmEntityContentItems(null);
-				addParameterEntityReferenceAction.setEnabled(availableEntities.length > 0);
-
-				menu.add(addElementAction);
-				menu.add(addParameterEntityReferenceAction);
-			}
-			else if (folder.getListType().equals(DTDRegionTypes.ATTLIST_TAG)) {
-				menu.add(addAttributeAction);
-			}
-		}
-		if (selectedObject instanceof DTDFile || selectedObject == null) {
-			LabelValuePair[] availableEntities = fModel.createParmEntityContentItems(null);
-			addParameterEntityReferenceAction.setEnabled(availableEntities.length > 0);
-
-			menu.add(addElementAction);
-			menu.add(addEntityAction);
-			menu.add(addNotationAction);
-			menu.add(addParameterEntityReferenceAction);
-			menu.add(addCommentAction);
-			menu.add(addAttributeListAction);
-			menu.add(new Separator());
-		}
-
-		if (selectedObject instanceof Element) {
-			Element dtdElement = (Element) selectedObject;
-
-			CMNode contentModel = dtdElement.getContentModel();
-			if (contentModel == null) {
-				menu.add(addGroupToContentModelAction);
-				menu.add(addElementToContentModelAction);
-			}
-			else if (contentModel != null && CMNode.EMPTY.equals(contentModel.getType())) {
-				menu.add(replaceEmptyContentModelWithGroupAction);
-			}
-			// if (!(((Element)selectedObject).getContentModel() instanceof
-			// CMGroupNode))
-			// {
-			// menu.add(addGroupToContentModelAction);
-			// }
-			// addAttributeAction.setElement(selectedObject);
-			menu.add(addAttributeAction);
-		}
-		else if (selectedObject instanceof CMGroupNode) {
-			// addElementToContentModelAction.setElement(selectedObject);
-			// addGroupToContentModelAction.setElement(selectedObject);
-			menu.add(addElementToContentModelAction);
-			menu.add(addGroupToContentModelAction);
-		}
-		else if (selectedObject instanceof AttributeList) {
-			menu.add(addAttributeAction);
-		}
-
-		menu.add(new Separator());
-		addEditActions(menu);
-		menu.add(new Separator());
-
-		if (selectedObject instanceof DTDNode && !(selectedObject instanceof CMNode && ((CMNode) selectedObject).isRootElementContent())) {
-			menu.add(deleteAction);
-			deleteAction.setEnabled(true);
-			// if (selectedObject instanceof DTDElementContent)
-			// {
-			// DTDElementContent content = (DTDElementContent) selectedObject;
-			// if (content.getElement() != null && (content instanceof
-			// DTDPCDataContent || content instanceof DTDEmptyContent))
-			// {
-			// deleteAction.setEnabled(false);
-			// } // end of if ()
-			// } // end of if ()
-		}
-	}
-
-	void addEditActions(IMenuManager menu) {
-		// menu.add(undoAction);
-		// menu.add(redoAction);
-		// menu.add(new Separator());
-		// menu.add(cutAction);
-		// menu.add(copyAction);
-		// menu.add(pasteAction);
-	}
-
-	public void createMenuListenersFor(Viewer viewer) {
-		viewer.addSelectionChangedListener(fInternalSelectionChangedListener);
-		ISelection selection = viewer.getSelection();
-		if (selection instanceof IStructuredSelection) {
-			fViewerSelection = (IStructuredSelection) selection;
-		}
-		else {
-			fViewerSelection = StructuredSelection.EMPTY;
-		}
-
-		fViewerList.add(viewer);
-	}
-
-	public IMenuListener getMenuListener() {
-		return fMenuListener;
-	}
-
-	public void removeMenuListenersFor(Viewer viewer) {
-		viewer.removeSelectionChangedListener(fInternalSelectionChangedListener);
-		fViewerList.remove(viewer);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDLabelProvider.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDLabelProvider.java
deleted file mode 100644
index c30d87d..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDLabelProvider.java
+++ /dev/null
@@ -1,94 +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.dtd.ui.views.contentoutline;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.NodeList;
-
-class DTDLabelProvider extends LabelProvider {
-
-	public DTDLabelProvider() {
-		super();
-	}
-
-	/**
-	 * Returns the image for the label of the given element.
-	 * 
-	 * @param element
-	 *            the element for which to provide the label image
-	 * @return the image used to label the element, or <code>null</code> if
-	 *         these is no image for the given object
-	 */
-	public Image getImage(Object element) {
-		Image image = null;
-		if (element instanceof DTDNode) {
-			image = ((DTDNode) element).getImage();
-		}
-		else if (element instanceof NodeList) {
-			image = ((NodeList) element).getImage();
-		}
-		else if (element instanceof DTDFile) {
-			image = ((DTDFile) element).getImage();
-		}
-		else {
-			image = super.getImage(element);
-		}
-		return image;
-	}
-
-	/**
-	 * Returns the text for the label of the given element.
-	 * 
-	 * @param element
-	 *            the element for which to provide the label text
-	 * @return the text string used to label the element, or <code>null</code>
-	 *         if these is no text label for the given object
-	 */
-	public String getText(Object element) {
-		if (element instanceof DTDNode) {
-			String name = ((DTDNode) element).getName();
-
-			// strip leading whitespace (useful for multi-line comments)
-			int firstSignificantCharacter = 0;
-			int lastVisibleCharacter = name.length() - 1;
-			for (firstSignificantCharacter = 0; firstSignificantCharacter < name.length(); firstSignificantCharacter++) {
-				if (!Character.isWhitespace(name.charAt(firstSignificantCharacter)))
-					break;
-			}
-			// keep only the first line of text in a multi-line name
-			if (firstSignificantCharacter < lastVisibleCharacter) {
-				for (lastVisibleCharacter = firstSignificantCharacter + 1; lastVisibleCharacter < name.length(); lastVisibleCharacter++) {
-					char character = name.charAt(lastVisibleCharacter);
-					if (character == '\r' || character == '\n')
-						break;
-				}
-			}
-			if (firstSignificantCharacter > 0 && firstSignificantCharacter < name.length() - 1) {
-				name = name.substring(firstSignificantCharacter, lastVisibleCharacter);
-			}
-
-			return name;
-		}
-		else if (element instanceof NodeList) {
-			// return ((NodeList) element).getListType();
-			return ((NodeList) element).getName();
-		}
-		else if (element instanceof DTDFile) {
-			return ((DTDFile) element).getName();
-		}
-		return super.getText(element);
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java
deleted file mode 100644
index 5c605d4..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java
+++ /dev/null
@@ -1,325 +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.dtd.ui.views.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.Comment;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.NodeList;
-import org.eclipse.wst.dtd.core.internal.Notation;
-import org.eclipse.wst.dtd.core.internal.ParameterEntityReference;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.event.IDTDFileListener;
-import org.eclipse.wst.dtd.core.internal.event.NodesEvent;
-
-class DTDTreeContentProvider implements ITreeContentProvider, IDTDFileListener {
-
-	private Object fInputObject;
-	protected Viewer fViewer;
-
-	// A cached set of IndexedNodeLists, required for getParent to return the
-	// correct instances mapping to TreeItems
-	protected Object[] logicalNodeLists = null;
-
-	private boolean showLogicalOrder = false;
-
-	public DTDTreeContentProvider() {
-		super();
-	}
-
-	public void dispose() {
-		fViewer = null;
-	}
-
-	private void expandToNode(DTDNode node) {
-		DTDFile dtdFile = node.getDTDFile();
-		// first expand the root
-		AbstractTreeViewer viewer = (AbstractTreeViewer) fViewer;
-		viewer.expandToLevel(dtdFile, 1);
-		NodeList listToExpand = null;
-		if (node instanceof Element || node instanceof ParameterEntityReference) {
-			listToExpand = dtdFile.getElementsAndParameterEntityReferences();
-		}
-		else if (node instanceof Notation) {
-			listToExpand = dtdFile.getNotations();
-		}
-		else if (node instanceof Entity) {
-			listToExpand = dtdFile.getEntities();
-		}
-		else if (node instanceof Comment) {
-			listToExpand = dtdFile.getComments();
-		}
-		if (listToExpand != null) {
-			viewer.expandToLevel(listToExpand, 1);
-		}
-		viewer.expandToLevel(node, 0);
-	}
-
-	public Object[] getChildren(Object parentElement) {
-		// return the lists of nodes when in logical order mode, all the Nodes
-		// otherwise
-		if (parentElement instanceof DTDFile) {
-			if (isShowLogicalOrder()) {
-				// return the visible node lists
-				if (logicalNodeLists == null) {
-					Iterator nodeLists = ((DTDFile) parentElement).getNodeLists().iterator();
-					List visibleLists = new ArrayList(7);
-					while (nodeLists.hasNext()) {
-						NodeList list = (NodeList) nodeLists.next();
-						if (isVisibleNodeList(list)) {
-							visibleLists.add(list);
-						}
-					}
-					logicalNodeLists = visibleLists.toArray();
-				}
-				return logicalNodeLists;
-			}
-			else {
-				// return the visible nodes
-				List allNodes = ((DTDFile) parentElement).getNodes();
-				List visibleNodes = new ArrayList(allNodes.size());
-				for (int i = 0; i < allNodes.size(); i++) {
-					Object o = allNodes.get(i);
-					if (isVisibleNode(o)) {
-						visibleNodes.add(o);
-					}
-				}
-				return visibleNodes.toArray();
-			}
-		}
-		else if (parentElement instanceof NodeList) {
-			return ((NodeList) parentElement).getNodes().toArray();
-		}
-		else if (parentElement instanceof Element) {
-			// always group the attributes directly under the element
-			Object[] children = ((DTDNode) parentElement).getChildren();
-			List attributes = ((Element) parentElement).getElementAttributes();
-			Object[] logicalChildren = new Object[children.length + attributes.size()];
-			int index = 0;
-			for (index = 0; index < children.length; index++) {
-				logicalChildren[index] = children[index];
-			}
-			for (Iterator iter = attributes.iterator(); iter.hasNext();) {
-				logicalChildren[index++] = iter.next();
-			}
-			return logicalChildren;
-		}
-		else if (parentElement instanceof DTDNode) {
-			return ((DTDNode) parentElement).getChildren();
-		}
-		return Collections.EMPTY_LIST.toArray();
-	}
-
-	public Object[] getElements(java.lang.Object inputElement) {
-		Object[] elements = null;
-		// Always show the DTDFile "node"
-		if (inputElement instanceof DTDModelImpl) {
-			elements = new Object[]{((DTDModelImpl) inputElement).getDTDFile()};
-		}
-		if (elements == null) {
-			elements = new Object[0];
-		}
-		return elements;
-	}
-
-	public Object getParent(Object element) {
-		Object parent = null;
-		if (element instanceof DTDNode) {
-			DTDNode node = (DTDNode) element;
-			if (element instanceof Attribute) {
-				// then we must say that the element with the same name
-				// as our attribute's parent attributelist is our parent
-				parent = node.getParentNode();
-				if (parent != null && parent instanceof AttributeList) {
-					return getParent(parent);
-				}
-			}
-			if (element instanceof AttributeList) {
-				// then we must say that the element with the same name
-				// as our attributelist is our parent
-				String attListName = ((AttributeList) element).getName();
-				Iterator iter = node.getDTDFile().getElementsAndParameterEntityReferences().getNodes().iterator();
-				while (iter.hasNext() && parent == null) {
-					DTDNode currentNode = (DTDNode) iter.next();
-					if (currentNode instanceof Element && currentNode.getName().equals(attListName)) {
-						parent = currentNode;
-					}
-				}
-			}
-
-			if (parent == null) {
-				parent = ((DTDNode) element).getParentNode();
-			}
-
-			// if showing in the logical order, return the IndexedNodeList
-			// acting as the parent in the tree
-			if (parent == null) {
-				if (isShowLogicalOrder()) {
-					Object[] indexedNodeLists = getChildren(((DTDModelImpl) fInputObject).getDTDFile());
-					for (int i = 0; i < indexedNodeLists.length && parent == null; i++) {
-						if (indexedNodeLists[i] instanceof NodeList) {
-							if (((NodeList) indexedNodeLists[i]).getNodes().contains(element))
-								parent = indexedNodeLists[i];
-						}
-					}
-				}
-				else {
-					parent = ((DTDModelImpl) fInputObject).getDTDFile();
-				}
-			}
-		}
-		else if (element instanceof NodeList && fInputObject instanceof DTDModelImpl) {
-			parent = ((DTDModelImpl) fInputObject).getDTDFile();
-		}
-		return parent;
-	}
-
-	public boolean hasChildren(Object element) {
-		Object[] children = getChildren(element);
-		return children.length > 0;
-	}
-
-	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-		fViewer = viewer;
-
-		if (fInputObject instanceof DTDModelImpl) {
-			((DTDModelImpl) fInputObject).getDTDFile().removeDTDFileListener(this);
-		}
-		fInputObject = newInput;
-		if (fInputObject instanceof DTDModelImpl) {
-			((DTDModelImpl) fInputObject).getDTDFile().addDTDFileListener(this);
-		}
-	}
-
-	/**
-	 * Get the value of showLogicalOrder.
-	 * 
-	 * @return value of showLogicalOrder.
-	 */
-	public boolean isShowLogicalOrder() {
-		return showLogicalOrder;
-	}
-
-	private boolean isVisibleNode(Object o) {
-		if (o instanceof AttributeList) {
-			return false;
-		}
-		return true;
-	}
-
-	private boolean isVisibleNodeList(NodeList nodeList) {
-		/*
-		 * All NodesLists should be visible because you can momentarily have
-		 * an ATTLIST (for example) without a corresponding ELEMENT
-		 * declaration
-		 */
-		return true;// !nodeList.getListType().equals(DTDRegionTypes.ATTLIST_TAG);
-	}
-
-	public void nodeChanged(DTDNode node) {
-		if (fViewer instanceof StructuredViewer) {
-			// System.out.println("node changed notified");
-			// System.out.println("selection before = " +
-			// ((StructuredViewer)view).getSelection());
-			if (node instanceof AttributeList && isShowLogicalOrder()) {
-				// in this case, we are showing attributes under the element.
-				// refresh the element object instead
-				Iterator iter = node.getDTDFile().getNodes().iterator();
-				while (iter.hasNext()) {
-					DTDNode currentNode = (DTDNode) iter.next();
-					if (currentNode.getName().equals(node.getName()) && currentNode instanceof Element) {
-						((StructuredViewer) fViewer).refresh(currentNode);
-					}
-				} // end of while ()
-			}
-			else {
-				// do standard stuff
-				((StructuredViewer) fViewer).refresh(node);
-			}
-			// System.out.println("selection after = " +
-			// ((StructuredViewer)view).getSelection());
-		}
-	}
-
-	public void nodesAdded(NodesEvent event) {
-		if (fViewer instanceof AbstractTreeViewer) {
-			StructuredViewer viewer = (StructuredViewer) fViewer;
-			ISelection selection = viewer.getSelection();
-
-			Object firstObj = (!selection.isEmpty() && selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
-			DTDNode oldSelectedNode = null;
-			if (firstObj instanceof DTDNode) {
-				oldSelectedNode = (DTDNode) firstObj;
-			}
-
-			// for now just refresh the whole view
-			AbstractTreeViewer abstractTreeViewer = (AbstractTreeViewer) fViewer;
-			abstractTreeViewer.refresh();
-
-			Iterator iter = event.getNodes().iterator();
-			List newSelection = new ArrayList();
-			while (iter.hasNext()) {
-				DTDNode node = (DTDNode) iter.next();
-				if (oldSelectedNode == null || node.getStructuredDTDDocumentRegion() != oldSelectedNode.getStructuredDTDDocumentRegion() || node.getStartOffset() != oldSelectedNode.getStartOffset() || node.getEndOffset() != oldSelectedNode.getEndOffset()) {
-					// add to selection
-					newSelection.add(node);
-					expandToNode(node);
-				}
-			}
-			if (newSelection.size() > 0) {
-				viewer.setSelection(new StructuredSelection(newSelection));
-			}
-
-		}
-	}
-
-	public void nodesRemoved(NodesEvent event) {
-		if (fViewer instanceof AbstractTreeViewer) {
-			AbstractTreeViewer abstractTreeViewer = (AbstractTreeViewer) fViewer;
-			for (Iterator iter = event.getNodes().iterator(); iter.hasNext();) {
-				abstractTreeViewer.remove(iter.next());
-			}
-		}
-
-	}
-
-	/**
-	 * Set the value of showLogicalOrder.
-	 * 
-	 * @param value
-	 *            Value to assign to showLogicalOrder.
-	 */
-	public void setShowLogicalOrder(boolean value) {
-		this.showLogicalOrder = value;
-		if (!value) {
-			// if not using logical order, lose the cached lists
-			logicalNodeLists = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/OrderAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/OrderAction.java
deleted file mode 100644
index f8120f4..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/OrderAction.java
+++ /dev/null
@@ -1,60 +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
- *     
- *******************************************************************************/
-/*
- * Created on Jan 22, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.dtd.ui.views.contentoutline;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImageHelper;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
-
-class OrderAction extends PropertyChangeUpdateAction {
-	private DTDTreeContentProvider contentProvider;
-	private TreeViewer treeViewer;
-
-	public OrderAction(TreeViewer viewer, DTDTreeContentProvider provider, IPreferenceStore store, String preferenceKey) {
-		super(DTDUIMessages._UI_BUTTON_GROUP_ITEMS_LOGICALLY, store, preferenceKey, false); //$NON-NLS-1$
-		setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ORGANIZE_DTD_LOGICALLY));
-		treeViewer = viewer;
-		contentProvider = provider;
-		setToolTipText(getText());
-		contentProvider.setShowLogicalOrder(isChecked());
-	}
-
-	public void update() {
-		super.update();
-		setChecked(getPreferenceStore().getBoolean(getPreferenceKey()));
-		// treeViewer.getControl().setVisible(false);
-		// treeViewer.getControl().setRedraw(false);
-		Object[] expandedElements = treeViewer.getExpandedElements();
-		ISelection selection = treeViewer.getSelection();
-		contentProvider.setShowLogicalOrder(isChecked());
-
-		// treeViewer.setInput(treeViewer.getInput());
-		treeViewer.refresh(treeViewer.getInput());
-
-		treeViewer.setExpandedElements(expandedElements);
-		treeViewer.setSelection(selection);
-		// treeViewer.getControl().setVisible(true);
-		// treeViewer.getControl().setRedraw(true);
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java
deleted file mode 100644
index b101966..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java
+++ /dev/null
@@ -1,59 +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.dtd.ui.views.contentoutline;
-
-import java.text.Collator;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImageHelper;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
-
-class SortAction extends PropertyChangeUpdateAction {
-	private TreeViewer treeViewer;
-
-	public SortAction(TreeViewer viewer, IPreferenceStore store, String preferenceKey) {
-		super(DTDUIMessages._UI_BUTTON_SORT_ITEMS, store, preferenceKey, false); //$NON-NLS-1$
-		setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_SORT));
-		setToolTipText(getText());
-		treeViewer = viewer;
-		if (isChecked()) {
-			treeViewer.setSorter(new ViewerSorter(Collator.getInstance()));
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IUpdate#update()
-	 */
-	public void update() {
-		super.update();
-		// treeViewer.getControl().setVisible(false);
-		treeViewer.getControl().setRedraw(false);
-		Object[] expandedElements = treeViewer.getExpandedElements();
-		if (isChecked()) {
-			treeViewer.setSorter(new ViewerSorter(Collator.getInstance()));
-		}
-		else {
-			treeViewer.setSorter(null);
-		}
-		treeViewer.setInput(treeViewer.getInput());
-		treeViewer.setExpandedElements(expandedElements);
-		// treeViewer.getControl().setVisible(true);
-		treeViewer.getControl().setRedraw(true);
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.core/.classpath b/bundles/org.eclipse.wst.html.core/.classpath
deleted file mode 100644
index cb01053..0000000
--- a/bundles/org.eclipse.wst.html.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src/"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.html.core/.cvsignore b/bundles/org.eclipse.wst.html.core/.cvsignore
deleted file mode 100644
index d57e585..0000000
--- a/bundles/org.eclipse.wst.html.core/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-bin
-htmlmodel.jar
-temp.folder
-dev.properties
-build.xml
-@dot
-src.zip
diff --git a/bundles/org.eclipse.wst.html.core/.options b/bundles/org.eclipse.wst.html.core/.options
deleted file mode 100644
index e66a59f..0000000
--- a/bundles/org.eclipse.wst.html.core/.options
+++ /dev/null
@@ -1,2 +0,0 @@
-org.eclipse.wst.html.core/debug=true
-org.eclipse.wst.html.core/debug/tracefilter=
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/.project b/bundles/org.eclipse.wst.html.core/.project
deleted file mode 100644
index 13a9fac..0000000
--- a/bundles/org.eclipse.wst.html.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.html.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.html.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index a0c83a3..0000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,48 +0,0 @@
-#Sat Jan 28 00:54:50 EST 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-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.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.emptyStatement=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-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.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-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.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.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index c9a18d3..0000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Fri May 27 23:56:32 EDT 2005
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-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.core/HTMLDocumentTypeAdapterFactory.java b/bundles/org.eclipse.wst.html.core/HTMLDocumentTypeAdapterFactory.java
deleted file mode 100644
index e69de29..0000000
--- a/bundles/org.eclipse.wst.html.core/HTMLDocumentTypeAdapterFactory.java
+++ /dev/null
diff --git a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
deleted file mode 100644
index e6b6b31..0000000
--- a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,34 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.html.core; singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.wst.html.core.internal.HTMLCorePlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.html.core.internal,
- org.eclipse.wst.html.core.internal.cleanup,
- org.eclipse.wst.html.core.internal.commentelement.handlers,
- org.eclipse.wst.html.core.internal.contentmodel,
- org.eclipse.wst.html.core.internal.contentmodel.chtml,
- org.eclipse.wst.html.core.internal.contentmodel.ssi,
- org.eclipse.wst.html.core.internal.contenttype,
- org.eclipse.wst.html.core.internal.document,
- org.eclipse.wst.html.core.internal.encoding,
- org.eclipse.wst.html.core.internal.format,
- org.eclipse.wst.html.core.internal.htmlcss,
- org.eclipse.wst.html.core.internal.modelhandler,
- org.eclipse.wst.html.core.internal.modelquery,
- org.eclipse.wst.html.core.internal.preferences,
- org.eclipse.wst.html.core.internal.provisional,
- org.eclipse.wst.html.core.internal.provisional.contenttype,
- org.eclipse.wst.html.core.internal.provisional.text,
- org.eclipse.wst.html.core.internal.text,
- org.eclipse.wst.html.core.internal.validate
-Require-Bundle: org.eclipse.wst.css.core,
- org.eclipse.wst.sse.core,
- org.eclipse.wst.xml.core,
- org.eclipse.wst.common.uriresolver,
- org.eclipse.core.resources,
- org.eclipse.core.runtime
-Eclipse-AutoStart: true; exceptions="org.eclipse.wst.html.core.internal.contenttype"
diff --git a/bundles/org.eclipse.wst.html.core/about.html b/bundles/org.eclipse.wst.html.core/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/bundles/org.eclipse.wst.html.core/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>February 24, 2005</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.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/build.properties b/bundles/org.eclipse.wst.html.core/build.properties
deleted file mode 100644
index 82622b7..0000000
--- a/bundles/org.eclipse.wst.html.core/build.properties
+++ /dev/null
@@ -1,23 +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
-###############################################################################
-bin.includes = plugin.xml,\
-               .options,\
-               data/,\
-               plugin.properties,\
-               META-INF/,\
-               .,\
-               about.html
-bin.excludes = bin/**,\
-               @dot/**,\
-               temp.folder/**
-src.includes = component.xml,\
-               build.properties
-source.. = src/
diff --git a/bundles/org.eclipse.wst.html.core/component.xml b/bundles/org.eclipse.wst.html.core/component.xml
deleted file mode 100644
index 8565aec..0000000
--- a/bundles/org.eclipse.wst.html.core/component.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.wst.html">
-	<component-depends unrestricted="true"></component-depends>
-	<plugin id="org.eclipse.wst.html.core" fragment="false" />
-	<plugin id="org.eclipse.wst.html.standard.dtds" fragment="false" />
-	<plugin id="org.eclipse.wst.html.ui" fragment="false" />
-	<description url="http://eclipse.org/webtools/wst/components/html/overview.html" />
-	<package name="org.eclipse.wst.html.ui" api="false">
-		<type name="StructuredTextViewerConfigurationHTML" subclass="true" instantiate="true" />
-	</package>
-	<package name="org.eclipse.wst.html.ui.views.contentoutline" api="false">
-		<type name="HTMLContentOutlineConfiguration" subclass="true" instantiate="true" />
-	</package>
-	<plugin id="org.eclipse.wst.html.ui.infopop" fragment="false" />
-</component>
diff --git a/bundles/org.eclipse.wst.html.core/data/htmref.properties b/bundles/org.eclipse.wst.html.core/data/htmref.properties
deleted file mode 100644
index 9cd460d..0000000
--- a/bundles/org.eclipse.wst.html.core/data/htmref.properties
+++ /dev/null
@@ -1,108 +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
-###############################################################################
-
-ATagInfo=A link if the href attribute is present, and the target for a link if the name attribute is present
-ABBRTagInfo=An abbreviation (for example, WWW, HTTP)
-ACRONYMTagInfo=An acronym (for example, SCUBA)
-ADDRESSTagInfo=Address information for the author of the page
-APPLETTagInfo=A Java applet
-AREATagInfo=Defines a client-side image map area
-BTagInfo=Displays contained text as bold
-BASETagInfo=The base URI for the page, to be used when calculating relative paths
-BASEFONTTagInfo=The base font size for the page
-BDOTagInfo=Overrides default bidirectional display. For use with bidirectional languages.
-BIGTagInfo=Displays contained text as large
-BGSOUNDTagInfo=Defines a sound file for the page. Not supported by W3C HTML 4.01.
-BLINKTagInfo=Displays text as blinking. Not supported by W3C HTML 4.01.
-BLOCKQUOTETagInfo=A long quotation
-BODYTagInfo=The document body. Contains all the content for the page.
-BRTagInfo=Forces a line break
-BUTTONTagInfo=Defines a push button
-CAPTIONTagInfo=Defines a table caption
-CENTERTagInfo=Displays contained text centered. Equivalent to DIV with align=center.
-CITETagInfo=A citation
-CODETagInfo=A computer code fragment
-COLTagInfo=A table column
-COLGROUPTagInfo=A group of table columns
-DDTagInfo=A definition or description in a definition or description list
-DELTagInfo=Displays text as deleted
-DFNTagInfo=A definition
-DIRTagInfo=A directory listing
-DIVTagInfo=A generic container, which can be used for defining language or style for the contents
-DLTagInfo=A definition or description list
-DTTagInfo=A term or subject in a definition or description list
-EMTagInfo=Displays text emphasized (generally italicized)
-EMBEDTagInfo=Defines an embedded plug-in. Not supported by W3C HTML 4.01.
-FIELDSETTagInfo=Defines a form control group
-FONTTagInfo=Displays text in the given font
-FORMTagInfo=Defines an interactive form
-FRAMETagInfo=Defines a frame within the current window
-FRAMESETTagInfo=Defines a frameset that divides the window into frames
-H1TagInfo=A top-level heading
-H2TagInfo=A second-level heading
-H3TagInfo=A third-level heading
-H4TagInfo=A fourth-level heading
-H5TagInfo=A fifth-level heading
-H6TagInfo=A sixth-level heading
-HEADTagInfo=Contains metadata and window title information for the document
-HRTagInfo=A horizontal rule
-HTMLTagInfo=The root element for the document.
-ITagInfo=Displays text as italic
-IFRAMETagInfo=Defines an inline subwindow
-IMGTagInfo=Displays the referenced image as embedded content
-INPUTTagInfo=Defines a form control for user input
-INSTagInfo=Defines inserted text
-ISINDEXTagInfo=Defines a single line prompt
-KBDTagInfo=Defines text to be entered by the user
-LABELTagInfo=Defines the label for a form field
-LEGENDTagInfo=Defines the label for a set of form fields
-LITagInfo=Defines a list item within a list
-LINKTagInfo=A media-independent link
-MAPTagInfo=Defines a client-side image map
-MARQUEETagInfo=Displays text as scrolling. Not supported by W3C HTML 4.01.
-MENUTagInfo=Defines a menu list
-METATagInfo=Defines metadata information for the document
-NOBRTagInfo=Overrides and prevents line breaks. Not supported by W3C HTML 4.01.
-NOFRAMESTagInfo=Provides information to display if the current browser does not support frames
-NOSCRIPTTagInfo=Provides information to display if the current browser does not support scripting
-OBJECTTagInfo=Defines a generic embedded object
-OLTagInfo=An ordered list
-OPTGROUPTagInfo=An option group
-OPTIONTagInfo=A selectable choice
-PTagInfo=A paragraph
-PARAMTagInfo=A named property value
-PRETagInfo=Preformatted text
-QTagInfo=A short inline quotation
-STagInfo=Display text in strike-through style
-SAMPTagInfo=Sample program output, scripts, etc. Displays in monospace font.
-SCRIPTTagInfo=Script statements
-SELECTTagInfo=An option selector
-SMALLTagInfo=Displays text as small
-SPANTagInfo=A generic container, which can be used for defining language or style for the contents
-STRIKETagInfo=Display text in strike-through style
-STRONGTagInfo=Displays text as strongly emphasized (generally bold)
-STYLETagInfo=Defines a style for the contained information
-SUBTagInfo=Display as subscript
-SUPTagInfo=Display as superscript
-TABLETagInfo=Defines a table
-TBODYTagInfo=The body of the table
-TDTagInfo=A cell within a table
-TEXTAREATagInfo=A multi-line text field
-TFOOTTagInfo=A table footer
-THTagInfo=A table header cell
-THEADTagInfo=A table header
-TITLETagInfo=The document title, displayed in the browser's title bar
-TRTagInfo=A table row
-TTTagInfo=Displays text in teletype or monospaced text style
-UTagInfo=Displays text as underlined
-ULTagInfo=An unordered list
-VARTagInfo=An instance of a variable or program argument
-WBRTagInfo=Allows a line break within <B>&lt;NOBR&gt;</B> tag. Not supported by W3C HTML 4.01.
diff --git a/bundles/org.eclipse.wst.html.core/data/htmref.xml b/bundles/org.eclipse.wst.html.core/data/htmref.xml
deleted file mode 100644
index 9a5b74c..0000000
--- a/bundles/org.eclipse.wst.html.core/data/htmref.xml
+++ /dev/null
@@ -1,294 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<abstractGrammarAnnotations propertiesLocation="htmref" caseSensitive="false">
-    <annotation spec="A">
-        <property name="tagInfo">%ATagInfo</property>
-    </annotation>
-    <annotation spec="ABBR">
-        <property name="tagInfo">%ABBRTagInfo</property>
-    </annotation>
-    <annotation spec="ACRONYM">
-        <property name="tagInfo">%ACRONYMTagInfo</property>
-    </annotation>
-    <annotation spec="ADDRESS">
-        <property name="tagInfo">%ADDRESSTagInfo</property>
-    </annotation>
-    <annotation spec="APPLET">
-        <property name="tagInfo">%APPLETTagInfo</property>
-    </annotation>
-    <annotation spec="AREA">
-        <property name="tagInfo">%AREATagInfo</property>
-    </annotation>
-    <annotation spec="B">
-        <property name="tagInfo">%BTagInfo</property>
-    </annotation>
-    <annotation spec="BASE">
-        <property name="tagInfo">%BASETagInfo</property>
-    </annotation>
-    <annotation spec="BASEFONT">
-        <property name="tagInfo">%BASEFONTTagInfo</property>
-    </annotation>
-    <annotation spec="BDO">
-        <property name="tagInfo">%BDOTagInfo</property>
-    </annotation>
-    <annotation spec="BGSOUND">
-        <property name="tagInfo">%BGSOUNDTagInfo</property>
-    </annotation>
-    <annotation spec="BIG">
-        <property name="tagInfo">%BIGTagInfo</property>
-    </annotation>
-    <annotation spec="BLINK">
-        <property name="tagInfo">%BLINKTagInfo</property>
-    </annotation>
-    <annotation spec="BLOCKQUOTE">
-        <property name="tagInfo">%BLOCKQUOTETagInfo</property>
-    </annotation>
-    <annotation spec="BODY">
-        <property name="tagInfo">%BODYTagInfo</property>
-    </annotation>
-    <annotation spec="BR">
-        <property name="tagInfo">%BRTagInfo</property>
-    </annotation>
-    <annotation spec="BUTTON">
-        <property name="tagInfo">%BUTTONTagInfo</property>
-    </annotation>
-    <annotation spec="CAPTION">
-        <property name="tagInfo">%CAPTIONTagInfo</property>
-    </annotation>
-    <annotation spec="CENTER">
-        <property name="tagInfo">%CENTERTagInfo</property>
-    </annotation>
-    <annotation spec="CITE">
-        <property name="tagInfo">%CITETagInfo</property>
-    </annotation>
-    <annotation spec="CODE">
-        <property name="tagInfo">%CODETagInfo</property>
-    </annotation>
-    <annotation spec="COL">
-        <property name="tagInfo">%COLTagInfo</property>
-    </annotation>
-    <annotation spec="COLGROUP">
-        <property name="tagInfo">%COLGROUPTagInfo</property>
-    </annotation>
-    <annotation spec="DD">
-        <property name="tagInfo">%DDTagInfo</property>
-    </annotation>
-    <annotation spec="DEL">
-        <property name="tagInfo">%DELTagInfo</property>
-    </annotation>
-    <annotation spec="DFN">
-        <property name="tagInfo">%DFNTagInfo</property>
-    </annotation>
-    <annotation spec="DIR">
-        <property name="tagInfo">%DIRTagInfo</property>
-    </annotation>
-    <annotation spec="DIV">
-        <property name="tagInfo">%DIVTagInfo</property>
-    </annotation>
-    <annotation spec="DL">
-        <property name="tagInfo">%DLTagInfo</property>
-    </annotation>
-    <annotation spec="DT">
-        <property name="tagInfo">%DTTagInfo</property>
-    </annotation>
-    <annotation spec="EM">
-        <property name="tagInfo">%EMTagInfo</property>
-    </annotation>
-    <annotation spec="EMBED">
-        <property name="tagInfo">%EMBEDTagInfo</property>
-    </annotation>
-    <annotation spec="FIELDSET">
-        <property name="tagInfo">%FIELDSETTagInfo</property>
-    </annotation>
-    <annotation spec="FONT">
-        <property name="tagInfo">%FONTTagInfo</property>
-    </annotation>
-    <annotation spec="FORM">
-        <property name="tagInfo">%FORMTagInfo</property>
-    </annotation>
-    <annotation spec="FRAME">
-        <property name="tagInfo">%FRAMETagInfo</property>
-    </annotation>
-    <annotation spec="FRAMESET">
-        <property name="tagInfo">%FRAMESETTagInfo</property>
-    </annotation>
-    <annotation spec="H1">
-        <property name="tagInfo">%H1TagInfo</property>
-    </annotation>
-    <annotation spec="H2">
-        <property name="tagInfo">%H2TagInfo</property>
-    </annotation>
-    <annotation spec="H3">
-        <property name="tagInfo">%H3TagInfo</property>
-    </annotation>
-    <annotation spec="H4">
-        <property name="tagInfo">%H4TagInfo</property>
-    </annotation>
-    <annotation spec="H5">
-        <property name="tagInfo">%H5TagInfo</property>
-    </annotation>
-    <annotation spec="H6">
-        <property name="tagInfo">%H6TagInfo</property>
-    </annotation>
-    <annotation spec="HEAD">
-        <property name="tagInfo">%HEADTagInfo</property>
-    </annotation>
-    <annotation spec="HR">
-        <property name="tagInfo">%HRTagInfo</property>
-    </annotation>
-    <annotation spec="HTML">
-        <property name="tagInfo">%HTMLTagInfo</property>
-    </annotation>
-    <annotation spec="I">
-        <property name="tagInfo">%ITagInfo</property>
-    </annotation>
-    <annotation spec="IFRAME">
-        <property name="tagInfo">%IFRAMETagInfo</property>
-    </annotation>
-    <annotation spec="IMG">
-        <property name="tagInfo">%IMGTagInfo</property>
-    </annotation>
-    <annotation spec="INPUT">
-        <property name="tagInfo">%INPUTTagInfo</property>
-    </annotation>
-    <annotation spec="INS">
-        <property name="tagInfo">%INSTagInfo</property>
-    </annotation>
-    <annotation spec="ISINDEX">
-        <property name="tagInfo">%ISINDEXTagInfo</property>
-    </annotation>
-    <annotation spec="KBD">
-        <property name="tagInfo">%KBDTagInfo</property>
-    </annotation>
-    <annotation spec="LABEL">
-        <property name="tagInfo">%LABELTagInfo</property>
-    </annotation>
-    <annotation spec="LEGEND">
-        <property name="tagInfo">%LEGENDTagInfo</property>
-    </annotation>
-    <annotation spec="LI">
-        <property name="tagInfo">%LITagInfo</property>
-    </annotation>
-    <annotation spec="LINK">
-        <property name="tagInfo">%LINKTagInfo</property>
-    </annotation>
-    <annotation spec="MAP">
-        <property name="tagInfo">%MAPTagInfo</property>
-    </annotation>
-    <annotation spec="MARQUEE">
-        <property name="tagInfo">%MARQUEETagInfo</property>
-    </annotation>
-    <annotation spec="MENU">
-        <property name="tagInfo">%MENUTagInfo</property>
-    </annotation>
-    <annotation spec="META">
-        <property name="tagInfo">%METATagInfo</property>
-    </annotation>
-    <annotation spec="NOBR">
-        <property name="tagInfo">%NOBRTagInfo</property>
-    </annotation>
-    <annotation spec="NOFRAMES">
-        <property name="tagInfo">%NOFRAMESTagInfo</property>
-    </annotation>
-    <annotation spec="NOSCRIPT">
-        <property name="tagInfo">%NOSCRIPTTagInfo</property>
-    </annotation>
-    <annotation spec="OBJECT">
-        <property name="tagInfo">%OBJECTTagInfo</property>
-    </annotation>
-    <annotation spec="OL">
-        <property name="tagInfo">%OLTagInfo</property>
-    </annotation>
-    <annotation spec="OPTGROUP">
-        <property name="tagInfo">%OPTGROUPTagInfo</property>
-    </annotation>
-    <annotation spec="OPTION">
-        <property name="tagInfo">%OPTIONTagInfo</property>
-    </annotation>
-    <annotation spec="P">
-        <property name="tagInfo">%PTagInfo</property>
-    </annotation>
-    <annotation spec="PARAM">
-        <property name="tagInfo">%PARAMTagInfo</property>
-    </annotation>
-    <annotation spec="PRE">
-        <property name="tagInfo">%PRETagInfo</property>
-    </annotation>
-    <annotation spec="Q">
-        <property name="tagInfo">%QTagInfo</property>
-    </annotation>
-    <annotation spec="S">
-        <property name="tagInfo">%STagInfo</property>
-    </annotation>
-    <annotation spec="SAMP">
-        <property name="tagInfo">%SAMPTagInfo</property>
-    </annotation>
-    <annotation spec="SCRIPT">
-        <property name="tagInfo">%SCRIPTTagInfo</property>
-    </annotation>
-    <annotation spec="SELECT">
-        <property name="tagInfo">%SELECTTagInfo</property>
-    </annotation>
-    <annotation spec="SMALL">
-        <property name="tagInfo">%SMALLTagInfo</property>
-    </annotation>
-    <annotation spec="SPAN">
-        <property name="tagInfo">%SPANTagInfo</property>
-    </annotation>
-    <annotation spec="STRIKE">
-        <property name="tagInfo">%STRIKETagInfo</property>
-    </annotation>
-    <annotation spec="STRONG">
-        <property name="tagInfo">%STRONGTagInfo</property>
-    </annotation>
-    <annotation spec="STYLE">
-        <property name="tagInfo">%STYLETagInfo</property>
-    </annotation>
-    <annotation spec="SUB">
-        <property name="tagInfo">%SUBTagInfo</property>
-    </annotation>
-    <annotation spec="SUP">
-        <property name="tagInfo">%SUPTagInfo</property>
-    </annotation>
-    <annotation spec="TABLE">
-        <property name="tagInfo">%TABLETagInfo</property>
-    </annotation>
-    <annotation spec="TBODY">
-        <property name="tagInfo">%TBODYTagInfo</property>
-    </annotation>
-    <annotation spec="TD">
-        <property name="tagInfo">%TDTagInfo</property>
-    </annotation>
-    <annotation spec="TEXTAREA">
-        <property name="tagInfo">%TEXTAREATagInfo</property>
-    </annotation>
-    <annotation spec="TFOOT">
-        <property name="tagInfo">%TFOOTTagInfo</property>
-    </annotation>
-    <annotation spec="TH">
-        <property name="tagInfo">%THTagInfo</property>
-    </annotation>
-    <annotation spec="THEAD">
-        <property name="tagInfo">%THEADTagInfo</property>
-    </annotation>
-    <annotation spec="TITLE">
-        <property name="tagInfo">%TITLETagInfo</property>
-    </annotation>
-    <annotation spec="TR">
-        <property name="tagInfo">%TRTagInfo</property>
-    </annotation>
-    <annotation spec="TT">
-        <property name="tagInfo">%TTTagInfo</property>
-    </annotation>
-    <annotation spec="U">
-        <property name="tagInfo">%UTagInfo</property>
-    </annotation>
-    <annotation spec="UL">
-        <property name="tagInfo">%ULTagInfo</property>
-    </annotation>
-    <annotation spec="VAR">
-        <property name="tagInfo">%VARTagInfo</property>
-    </annotation>
-    <annotation spec="WBR">
-        <property name="tagInfo">%WBRTagInfo</property>
-    </annotation>
-</abstractGrammarAnnotations>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/plugin.properties b/bundles/org.eclipse.wst.html.core/plugin.properties
deleted file mode 100644
index 3711dbf..0000000
--- a/bundles/org.eclipse.wst.html.core/plugin.properties
+++ /dev/null
@@ -1,15 +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
-###############################################################################
-providerName=Eclipse.org
-pluginName=Structured Source HTML Model
-nlFeatureName=Structured Source HTML Model NL Support
-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
deleted file mode 100644
index 9d6fc2c..0000000
--- a/bundles/org.eclipse.wst.html.core/plugin.xml
+++ /dev/null
@@ -1,199 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-	<extension point="org.eclipse.wst.sse.core.modelHandler">
-		<modelHandler
-			default="no"
-			class="org.eclipse.wst.html.core.internal.modelhandler.ModelHandlerForHTML"
-			associatedContentTypeId="org.eclipse.wst.html.core.htmlsource"
-			id="org.eclipse.wst.html.core.internal.modelhandler">
-		</modelHandler>
-	</extension>
-
-	<extension point="org.eclipse.wst.sse.core.embeddedTypeHandler">
-		<embeddedTypeHandler
-			class="org.eclipse.wst.html.core.internal.modelhandler.EmbeddedHTML">
-		</embeddedTypeHandler>
-	</extension>
-
-	<extension point="org.eclipse.wst.sse.core.taskscanner">
-		<scanner
-			id="org.eclipse.wst.html.core.internal.tasks.HTMLFileTaskScanner"
-			class="org.eclipse.wst.xml.core.internal.tasks.XMLFileTaskScanner"
-			contentTypeIds="org.eclipse.wst.html.core.htmlsource" />
-	</extension>
-
-	<extension
-		point="org.eclipse.core.filebuffers.documentCreation"
-		id="org.eclipse.wst.html.core.documentfactories"
-		name="%Structured_HTML_Document_Factory_Extension.name">
-		<factory
-			contentTypeId="org.eclipse.wst.html.core.htmlsource"
-			class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
-	</extension>
-
-	<extension point="org.eclipse.wst.sse.core.commentElementHandler">
-		<handler-custom
-			commenttype="xml"
-			class="org.eclipse.wst.html.core.internal.commentelement.handlers.CommentElementHandlerForSSI">
-			<startwith prefix="#"></startwith>
-		</handler-custom>
-	</extension>
-
-	<extension point="org.eclipse.team.core.fileTypes">
-		<fileTypes
-			type="text"
-			extension="html">
-		</fileTypes>
-		<fileTypes
-			type="text"
-			extension="htm">
-		</fileTypes>
-		<fileTypes
-			type="text"
-			extension="xhtml">
-		</fileTypes>
-		<fileTypes
-			type="text"
-			extension="htpl">
-		</fileTypes>
-		<fileTypes
-			type="text"
-			extension="wml">
-		</fileTypes>
-		<fileTypes
-			type="text"
-			extension="shtml">
-		</fileTypes>
-		<fileTypes
-			type="text"
-			extension="shtm">
-		</fileTypes>
-	</extension>
-
-	<extension point="org.eclipse.wst.sse.core.formatProcessors">
-		<processor
-			class="org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl"
-			contentTypeId="org.eclipse.wst.html.core.htmlsource">
-		</processor>
-	</extension>
-
-	<!-- Extension point for taghelp documentation -->
-	<extension point="org.eclipse.wst.xml.core.annotationFiles">
-		<annotationFile
-			location="data/htmref.xml"
-			publicId="-//W3C//DTD XHTML 1.0 Strict//EN">
-		</annotationFile>
-		<annotationFile
-			location="data/htmref.xml"
-			publicId="-//W3C//DTD XHTML 1.0 Transitional//EN">
-		</annotationFile>
-		<annotationFile
-			location="data/htmref.xml"
-			publicId="-//W3C//DTD XHTML 1.0 Frameset//EN">
-		</annotationFile>
-		<annotationFile
-			location="data/htmref.xml"
-			publicId="-//W3C//DTD XHTML Basic 1.0//EN">
-		</annotationFile>
-		<annotationFile
-			location="data/htmref.xml"
-			publicId="-//W3C//DTD XHTML 1.1//EN">
-		</annotationFile>
-		<annotationFile
-			location="data/htmref.xml"
-			publicId="-//WAPFORUM//DTD XHTML Mobile 1.0//EN">
-		</annotationFile>
-	</extension>
-
-	<extension point="org.eclipse.core.runtime.contentTypes">
-		<content-type
-			file-extensions="html,htm,xhtml,htpl,wml,shtml,shtm"
-			priority="high"
-			name="%HTML_Content_Type_Extension_Element.name"
-			id="htmlsource"
-			base-type="org.eclipse.core.runtime.text">
-			<!-- note: no default-charset for HTML, should use 'platform' -->
-			<describer
-				class="org.eclipse.wst.html.core.internal.contenttype.ContentDescriberForHTML" />
-		</content-type>
-	</extension>
-
-<!-- moved to where the dtd's are contributed
-
-	<extension point="org.eclipse.wst.sse.core.documentTypes">
-		<documentType
-			elementName="html"
-			displayName="XHTML 1.0 Strict"
-			namespaceURI="http://www.w3.org/1999/xhtml"
-			isXHTML="true"
-			hasFrameset="false"
-			publicID="-//W3C//DTD XHTML 1.0 Strict//EN"
-			systemID="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-		</documentType>
-		<documentType
-			elementName="html"
-			displayName="XHTML 1.0 Transitional"
-			namespaceURI="http://www.w3.org/1999/xhtml"
-			isXHTML="true"
-			hasFrameset="false"
-			publicID="-//W3C//DTD XHTML 1.0 Transitional//EN"
-			defaultXHTML="true"
-			systemID="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-		</documentType>
-		<documentType
-			elementName="html"
-			displayName="XHTML 1.0 Frameset"
-			namespaceURI="http://www.w3.org/1999/xhtml"
-			isXHTML="true"
-			hasFrameset="true"
-			publicID="-//W3C//DTD XHTML 1.0 Frameset//EN"
-			systemID="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-		</documentType>
-		<documentType
-			elementName="html"
-			displayName="XHTML Basic 1.0"
-			namespaceURI="http://www.w3.org/1999/xhtml"
-			isXHTML="true"
-			hasFrameset="false"
-			publicID="-//W3C//DTD XHTML Basic 1.0//EN"
-			systemID="http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
-		</documentType>
-		<documentType
-			elementName="html"
-			displayName="XHTML 1.1"
-			namespaceURI="http://www.w3.org/1999/xhtml"
-			isXHTML="true"
-			hasFrameset="false"
-			publicID="-//W3C//DTD XHTML 1.1//EN"
-			systemID="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-		</documentType>
-		<documentType
-			elementName="html"
-			displayName="XHTML MP 1.0"
-			namespaceURI="http://www.w3.org/1999/xhtml"
-			isXHTML="true"
-			hasFrameset="false"
-			publicID="-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
-			systemID="http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
-		</documentType>
-		<documentType
-			elementName="wml"
-			displayName="WML 1.3"
-			namespaceURI=""
-			isWML="true"
-			hasFrameset="false"
-			publicID="-//WAPFORUM//DTD WML 1.3//EN"
-			defaultWML="true"
-			systemID="http://www.wapforum.org/DTD/wml13.dtd">
-		</documentType>
-	</extension>
--->
-	<!-- initialize html core preferences -->
-	<extension point="org.eclipse.core.runtime.preferences">
-		<initializer
-			class="org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceInitializer" />
-	</extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLContentBuilder.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLContentBuilder.java
deleted file mode 100644
index 7f612fb..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLContentBuilder.java
+++ /dev/null
@@ -1,71 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-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.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilderImpl;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public class HTMLContentBuilder extends DOMContentBuilderImpl {
-
-	private int fTagCase;
-	private int fAttrCase;
-
-	/**
-	 * DOMContentBuilder constructor comment.
-	 * @param document org.w3c.dom.Document
-	 */
-	public HTMLContentBuilder(Document document) {
-		super(document);
-		Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences();
-		fTagCase = prefs.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
-		fAttrCase = prefs.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
-		//	Element caseSettings = HTMLPreferenceManager.getHTMLInstance().getElement(PreferenceNames.PREFERRED_CASE);
-		//	fTagCase = caseSettings.getAttribute(PreferenceNames.TAGNAME);
-		//	fAttrCase = caseSettings.getAttribute(PreferenceNames.ATTRIBUTENAME);
-	}
-
-	public String computeName(CMNode cmnode, Node parent) {
-		String name = super.computeName(cmnode, parent);
-		// don't change the case unless we're certain it is meaningless
-		//	if (cmnode instanceof HTMLCMNode && ((HTMLCMNode) cmnode).shouldIgnoreCase()) {
-		if (shouldIgnoreCase(cmnode)) {
-			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
-			}
-		}
-		return name;
-
-	}
-
-	private boolean shouldIgnoreCase(CMNode cmnode) {
-		if (!cmnode.supports(HTMLCMProperties.SHOULD_IGNORE_CASE))
-			return false;
-		return ((Boolean) cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 550c2f9..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
+++ /dev/null
@@ -1,59 +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.html.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by HTML Core
- * 
- * @plannedfor 1.0
- */
-public class HTMLCoreMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.html.core.internal.HTMLCorePluginResources";//$NON-NLS-1$
-
-	public static String No_error__UI_;
-	public static String Undefined_attribute_name___ERROR_;
-	public static String Undefined_attribute_value__ERROR_;
-	public static String Multiple_values_specified__ERROR_;
-	public static String Attribute_name___0___uses__ERROR_;
-	public static String Invalid_attribute_name___0_ERROR_;
-	public static String Invalid_attribute___0____ERROR_;
-	public static String Invalid_location_of_tag____ERROR_;
-	public static String Duplicate_tag___0____ERROR_;
-	public static String No_start_tag____0_____ERROR_;
-	public static String No_end_tag_____0_____ERROR_;
-	public static String End_tag_____0____not_neede_ERROR_;
-	public static String Unknown_tag___0____ERROR_;
-	public static String Tag_name___0___uses_wrong__ERROR_;
-	public static String Invalid_tag_name___0____ERROR_;
-	public static String Invalid_JSP_directive___0__ERROR_;
-	public static String Invalid_text_string___0____ERROR_;
-	public static String Invalid_character_used_in__ERROR_;
-	public static String Unknown_error__ERROR_;
-	public static String Start_tag____0____not_clos_ERROR_;
-	public static String End_tag_____0____not_close_ERROR_;
-	public static String Attribute_value___0___uses_ERROR_;
-	public static String Comment_not_closed__ERROR_;
-	public static String DOCTYPE_declaration_not_cl_ERROR_;
-	public static String Processing_instruction_not_ERROR_;
-	public static String CDATA_section_not_closed__ERROR_;
-	public static String _ERROR_Tag___0___should_be_an_empty_element_tag_1;
-	public static String _ERROR_Attribute_value___0___not_closed__1;
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, HTMLCoreMessages.class);
-	}
-	
-	private HTMLCoreMessages() {
-		// cannot create new instance
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java
deleted file mode 100644
index fc73123..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java
+++ /dev/null
@@ -1,45 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Plugin;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class HTMLCorePlugin extends Plugin {
-	//The shared instance.
-	private static HTMLCorePlugin plugin;	
-
-	/**
-	 * The constructor.
-	 */
-	public HTMLCorePlugin() {
-		super();
-		plugin = this;
-	}
-
-	/**
-	 * Returns the shared instance.
-	 */
-	public static HTMLCorePlugin getDefault() {
-		return plugin;
-	}
-
-	/**
-	 * Returns the workspace instance.
-	 */
-	public static IWorkspace getWorkspace() {
-		return ResourcesPlugin.getWorkspace();
-	}
-}
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
deleted file mode 100644
index 584ad91..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
+++ /dev/null
@@ -1,39 +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
-###############################################################################
-No_error__UI_=No error.
-Undefined_attribute_name___ERROR_=Undefined attribute name ({0}).
-Undefined_attribute_value__ERROR_=Undefined attribute value ({0}).
-Multiple_values_specified__ERROR_=Multiple values specified for an attribute ({0}).
-Attribute_name___0___uses__ERROR_=Attribute name ({0}) uses wrong case character.
-Invalid_attribute_name___0_ERROR_=Invalid attribute name ({0}).
-Invalid_attribute___0____ERROR_=Invalid attribute ({0}).
-Invalid_location_of_tag____ERROR_=Invalid location of tag ({0}).
-Duplicate_tag___0____ERROR_=Duplicate tag ({0}).
-No_start_tag____0_____ERROR_=No start tag (<{0}>).
-No_end_tag_____0_____ERROR_=No end tag (</{0}>).
-End_tag_____0____not_neede_ERROR_=End tag (</{0}>) not needed.
-Unknown_tag___0____ERROR_=Unknown tag ({0}).
-Tag_name___0___uses_wrong__ERROR_=Tag name ({0}) uses wrong case character.
-Invalid_tag_name___0____ERROR_=Invalid tag name ({0}).
-Invalid_JSP_directive___0__ERROR_=Invalid JSP directive ({0}).
-Invalid_text_string___0____ERROR_=Invalid text string ({0}).
-Invalid_character_used_in__ERROR_=Invalid character used in text string ({0}).
-Unknown_error__ERROR_=Unknown error.
-Start_tag____0____not_clos_ERROR_=Start tag (<{0}>) not closed.
-End_tag_____0____not_close_ERROR_=End tag (</{0}>) not closed.
-Attribute_value___0___uses_ERROR_=Attribute value ({0}) uses wrong case character.
-Comment_not_closed__ERROR_=Comment not closed.
-DOCTYPE_declaration_not_cl_ERROR_=DOCTYPE declaration not closed.
-Processing_instruction_not_ERROR_=Processing instruction not closed.
-CDATA_section_not_closed__ERROR_=CDATA section not closed.
-# From here, the new messages are added for V5
-_ERROR_Tag___0___should_be_an_empty_element_tag_1=Tag ({0}) should be an empty-element tag.
-_ERROR_Attribute_value___0___not_closed__1=Attribute value ({0}) not closed.
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/Logger.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/Logger.java
deleted file mode 100644
index fc6d82c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/Logger.java
+++ /dev/null
@@ -1,144 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal;
-
-import java.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.core"; //$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);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/AbstractNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/AbstractNodeCleanupHandler.java
deleted file mode 100644
index 37ff30a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/AbstractNodeCleanupHandler.java
+++ /dev/null
@@ -1,83 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.cleanup;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-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.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-abstract class AbstractNodeCleanupHandler implements IStructuredCleanupHandler {
-
-	protected IStructuredCleanupPreferences fCleanupPreferences = null;
-	protected IProgressMonitor fProgressMonitor = null;
-
-	public void setCleanupPreferences(IStructuredCleanupPreferences cleanupPreferences) {
-
-		fCleanupPreferences = cleanupPreferences;
-	}
-
-
-	public IStructuredCleanupPreferences getCleanupPreferences() {
-		if (fCleanupPreferences == null) {
-			fCleanupPreferences = new StructuredCleanupPreferences();
-	
-			Preferences preferences = getModelPreferences();
-			if (preferences != null) {
-				fCleanupPreferences.setTagNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE));
-				fCleanupPreferences.setAttrNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE));
-				fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
-				fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
-				fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS));
-				fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES));
-				fCleanupPreferences.setFormatSource(preferences.getBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE));
-				fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES));
-				fCleanupPreferences.setEOLCode(preferences.getString(HTMLCorePreferenceNames.CLEANUP_EOL_CODE));
-			}
-		}
-
-		return fCleanupPreferences;
-	}
-
-
-	public void setProgressMonitor(IProgressMonitor progressMonitor) {
-
-		fProgressMonitor = progressMonitor;
-	}
-
-	static protected StructuredDocumentEvent replaceSource(IDOMModel model, Object requester, int offset, int length, String source) {
-
-		StructuredDocumentEvent result = null;
-		if (model == null)
-			return result;
-		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
-			return result;
-		if (source == null)
-			source = new String();
-		if (structuredDocument.containsReadOnly(offset, length))
-			return result;
-		if (requester == null) {
-			requester = structuredDocument;
-		}
-		return structuredDocument.replaceText(requester, offset, length, source);
-	}
-
-	protected Preferences getModelPreferences() {
-		return HTMLCorePlugin.getDefault().getPluginPreferences();
-	}
-}
\ 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
deleted file mode 100644
index ff8006c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java
+++ /dev/null
@@ -1,86 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.cleanup;
-
-
-
-import org.eclipse.wst.css.core.internal.format.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-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.core.internal.provisional.text.IStructuredDocument;
-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;
-
-// nakamori_TODO: check and remove
-
-public class CSSTextNodeCleanupHandler extends AbstractNodeCleanupHandler {
-
-	public Node cleanup(Node node) {
-		if (node == null)
-			return node;
-		IDOMModel model = ((IDOMNode) node).getModel();
-		if (model == null)
-			return node;
-		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
-			return node;
-
-		String content = getCSSContent(node);
-		if (content == null)
-			return node;
-
-		int offset = ((IDOMNode) node).getStartOffset();
-		int length = ((IDOMNode) node).getEndOffset() - offset;
-		replaceSource(model, this, offset, length, content);
-		return (IDOMNode) model.getIndexedRegion(offset);
-	}
-
-	/**
-	 */
-	private String getCSSContent(Node text) {
-		ICSSModel model = getCSSModel(text);
-		if (model == null)
-			return null;
-		ICSSNode document = model.getDocument();
-		if (document == null)
-			return null;
-		INodeNotifier notifier = (INodeNotifier) document;
-		INodeAdapter adapter = notifier.getAdapterFor(CSSSourceFormatter.class);
-		if (adapter == null)
-			return null;
-		CSSSourceFormatter formatter = (CSSSourceFormatter) adapter;
-		StringBuffer buffer = formatter.cleanup(document);
-		if (buffer == null)
-			return null;
-		return buffer.toString();
-	}
-
-	/**
-	 */
-	private ICSSModel getCSSModel(Node text) {
-		if (text == null)
-			return null;
-		INodeNotifier notifier = (INodeNotifier) text.getParentNode();
-		if (notifier == null)
-			return null;
-		INodeAdapter adapter = notifier.getAdapterFor(IStyleSheetAdapter.class);
-		if (adapter == null)
-			return null;
-		if (!(adapter instanceof IStyleSheetAdapter))
-			return null;
-		IStyleSheetAdapter styleAdapter = (IStyleSheetAdapter) adapter;
-		return styleAdapter.getModel();
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index bd5b56f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
+++ /dev/null
@@ -1,693 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.cleanup;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.wst.css.core.internal.format.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-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.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.util.StringUtils;
-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.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-// nakamori_TODO: check and remove CSS formatting
-
-public class ElementNodeCleanupHandler extends AbstractNodeCleanupHandler {
-
-	/** Non-NLS strings */
-	protected static final String START_TAG_OPEN = "<"; //$NON-NLS-1$
-	protected static final String END_TAG_OPEN = "</"; //$NON-NLS-1$
-	protected static final String TAG_CLOSE = ">"; //$NON-NLS-1$
-	protected static final String EMPTY_TAG_CLOSE = "/>"; //$NON-NLS-1$
-	protected static final String SINGLE_QUOTES = "''"; //$NON-NLS-1$
-	protected static final String DOUBLE_QUOTES = "\"\""; //$NON-NLS-1$
-	protected static final char SINGLE_QUOTE = '\''; //$NON-NLS-1$
-	protected static final char DOUBLE_QUOTE = '\"'; //$NON-NLS-1$
-
-	public Node cleanup(Node node) {
-		IDOMNode renamedNode = (IDOMNode) cleanupChildren(node);
-
-		// 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 (!((IDOMElement) renamedNode).isCommentTag() && (renamedNode.getStartStructuredDocumentRegion() != null)) {
-			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
-		// 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 = insertRequiredAttrs(renamedNode);
-		renamedNode = applyTagNameCase(renamedNode);
-		applyAttrNameCase(renamedNode);
-		cleanupCSSAttrValue(renamedNode);
-
-		return renamedNode;
-	}
-
-	/**
-	 * Checks if cleanup should modify case. Returns true case should be
-	 * preserved, false otherwise.
-	 * 
-	 * @param element
-	 * @return true if element is case sensitive, false otherwise
-	 */
-	private boolean shouldPreserveCase(IDOMElement element) {
-		// case option can be applied to no namespace tags
-		return !element.isGlobalTag();
-		/*
-		 * ModelQueryAdapter mqadapter = (ModelQueryAdapter)
-		 * element.getAdapterFor(ModelQueryAdapter.class); ModelQuery mq =
-		 * null; CMNode nodedecl = null; if (mqadapter != null) mq =
-		 * mqadapter.getModelQuery(); if (mq != null) nodedecl =
-		 * mq.getCMNode(node); // if a Node isn't recognized as HTML or is and
-		 * cares about case, do not alter it // if (nodedecl == null ||
-		 * (nodedecl instanceof HTMLCMNode && ((HTMLCMNode)
-		 * nodedecl).shouldIgnoreCase())) if (!
-		 * nodedecl.supports(HTMLCMProperties.SHOULD_IGNORE_CASE)) return
-		 * false; return
-		 * ((Boolean)cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
-		 */
-	}
-
-	/**
-	 * Checks if cleanup should force modifying element name to all lowercase.
-	 * 
-	 * @param element
-	 * @return true if cleanup should lowercase element name, false otherwise
-	 */
-	private boolean isXMLTag(IDOMElement element) {
-		return element.isXMLTag();
-	}
-
-	protected void applyAttrNameCase(IDOMNode node) {
-		IDOMElement element = (IDOMElement) node;
-		if (element.isCommentTag())
-			return; // do nothing
-
-		int attrNameCase = HTMLCorePreferenceNames.ASIS;
-		if (!shouldPreserveCase(element)) {
-			if (isXMLTag(element))
-				attrNameCase = HTMLCorePreferenceNames.LOWER;
-			else
-				attrNameCase = getCleanupPreferences().getAttrNameCase();
-		}
-
-		NamedNodeMap attributes = node.getAttributes();
-		int attributesLength = attributes.getLength();
-
-		for (int i = 0; i < attributesLength; i++) {
-			IDOMNode eachAttr = (IDOMNode) attributes.item(i);
-			String oldAttrName = eachAttr.getNodeName();
-			String newAttrName = oldAttrName;
-			// 254961 - all HTML tag names and attribute names should be in
-			// English
-			// even for HTML files in other languages like Japanese or
-			// Turkish.
-			// English locale should be used to convert between uppercase and
-			// lowercase
-			// (otherwise "link" would be converted to "L�NK" in Turkish,
-			// where '?' in "L�NK"
-			// is the "I Overdot Capital" in Turkish).
-			if (attrNameCase == HTMLCorePreferenceNames.LOWER)
-				newAttrName = oldAttrName.toLowerCase(Locale.US);
-			else if (attrNameCase == HTMLCorePreferenceNames.UPPER)
-				newAttrName = oldAttrName.toUpperCase(Locale.US);
-
-			if (newAttrName.compareTo(oldAttrName) != 0) {
-				int attrNameStartOffset = eachAttr.getStartOffset();
-				int attrNameLength = oldAttrName.length();
-
-				IDOMModel structuredModel = node.getModel();
-				IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-				replaceSource(structuredModel, structuredDocument, attrNameStartOffset, attrNameLength, newAttrName);
-			}
-		}
-	}
-
-	protected IDOMNode applyTagNameCase(IDOMNode node) {
-		IDOMElement element = (IDOMElement) node;
-		if (element.isCommentTag())
-			return node; // do nothing
-
-		int tagNameCase = HTMLCorePreferenceNames.ASIS;
-
-		if (!shouldPreserveCase(element)) {
-			if (isXMLTag(element))
-				tagNameCase = HTMLCorePreferenceNames.LOWER;
-			else
-				tagNameCase = getCleanupPreferences().getTagNameCase();
-		}
-
-		String oldTagName = node.getNodeName();
-		String newTagName = oldTagName;
-		IDOMNode newNode = node;
-
-		// 254961 - all HTML tag names and attribute names should be in
-		// English
-		// even for HTML files in other languages like Japanese or Turkish.
-		// English locale should be used to convert between uppercase and
-		// lowercase
-		// (otherwise "link" would be converted to "L�NK" in Turkish, where
-		// '?' in "L�NK"
-		// is the "I Overdot Capital" in Turkish).
-		if (tagNameCase == HTMLCorePreferenceNames.LOWER)
-			newTagName = oldTagName.toLowerCase(Locale.US);
-		else if (tagNameCase == HTMLCorePreferenceNames.UPPER)
-			newTagName = oldTagName.toUpperCase(Locale.US);
-
-		IDOMModel structuredModel = node.getModel();
-		IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
-		IStructuredDocumentRegion startTagStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
-		if (startTagStructuredDocumentRegion != null) {
-			ITextRegionList regions = startTagStructuredDocumentRegion.getRegions();
-			if (regions != null && regions.size() > 0) {
-				ITextRegion startTagNameRegion = regions.get(1);
-				int startTagNameStartOffset = startTagStructuredDocumentRegion.getStartOffset(startTagNameRegion);
-				int startTagNameLength = startTagStructuredDocumentRegion.getTextEndOffset(startTagNameRegion) - startTagNameStartOffset;
-
-				replaceSource(structuredModel, structuredDocument, startTagNameStartOffset, startTagNameLength, newTagName);
-				newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagNameStartOffset); // save
-				// new
-				// node
-			}
-		}
-
-		IStructuredDocumentRegion endTagStructuredDocumentRegion = node.getEndStructuredDocumentRegion();
-		if (endTagStructuredDocumentRegion != null) {
-			ITextRegionList regions = endTagStructuredDocumentRegion.getRegions();
-			if (regions != null && regions.size() > 0) {
-				ITextRegion endTagNameRegion = regions.get(1);
-				int endTagNameStartOffset = endTagStructuredDocumentRegion.getStartOffset(endTagNameRegion);
-				int endTagNameLength = endTagStructuredDocumentRegion.getTextEndOffset(endTagNameRegion) - endTagNameStartOffset;
-
-				if (startTagStructuredDocumentRegion != endTagStructuredDocumentRegion)
-					replaceSource(structuredModel, structuredDocument, endTagNameStartOffset, endTagNameLength, newTagName);
-			}
-		}
-
-		return newNode;
-	}
-
-	protected Node cleanupChildren(Node node) {
-		Node parentNode = node;
-
-		if (node != null) {
-			Node childNode = node.getFirstChild();
-			HTMLCleanupHandlerFactory factory = HTMLCleanupHandlerFactory.getInstance();
-			while (childNode != null) {
-				// cleanup this child node
-				IStructuredCleanupHandler cleanupHandler = factory.createHandler(childNode, getCleanupPreferences());
-				childNode = cleanupHandler.cleanup(childNode);
-
-				// get new parent node
-				parentNode = childNode.getParentNode();
-
-				// get next child node
-				childNode = childNode.getNextSibling();
-			}
-		}
-
-		return parentNode;
-	}
-
-	/**
-	 */
-	protected void cleanupCSSAttrValue(IDOMNode node) {
-		if (node == null || node.getNodeType() != Node.ELEMENT_NODE)
-			return;
-		IDOMElement element = (IDOMElement) node;
-		if (!element.isGlobalTag())
-			return;
-
-		Attr attr = element.getAttributeNode("style"); //$NON-NLS-1$
-		if (attr == null)
-			return;
-		String value = getCSSValue(attr);
-		if (value == null)
-			return;
-		String oldValue = ((IDOMNode) attr).getValueSource();
-		if (oldValue != null && value.equals(oldValue))
-			return;
-		attr.setValue(value);
-	}
-
-	/**
-	 */
-	private ICSSModel getCSSModel(Attr attr) {
-		if (attr == null)
-			return null;
-		INodeNotifier notifier = (INodeNotifier) attr.getOwnerElement();
-		if (notifier == null)
-			return null;
-		INodeAdapter adapter = notifier.getAdapterFor(IStyleDeclarationAdapter.class);
-		if (adapter == null)
-			return null;
-		if (!(adapter instanceof IStyleDeclarationAdapter))
-			return null;
-		IStyleDeclarationAdapter styleAdapter = (IStyleDeclarationAdapter) adapter;
-		return styleAdapter.getModel();
-	}
-
-	/**
-	 */
-	private String getCSSValue(Attr attr) {
-		ICSSModel model = getCSSModel(attr);
-		if (model == null)
-			return null;
-		ICSSNode document = model.getDocument();
-		if (document == null)
-			return null;
-		INodeNotifier notifier = (INodeNotifier) document;
-		INodeAdapter adapter = notifier.getAdapterFor(CSSSourceFormatter.class);
-		if (adapter == null)
-			return null;
-		CSSSourceFormatter formatter = (CSSSourceFormatter) adapter;
-		StringBuffer buffer = formatter.cleanup(document);
-		if (buffer == null)
-			return null;
-		return buffer.toString();
-	}
-
-	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);
-	}
-
-	protected IDOMNode insertEndTag(IDOMNode node) {
-		IDOMElement element = (IDOMElement) node;
-
-		int startTagStartOffset = node.getStartOffset();
-		IDOMModel structuredModel = node.getModel();
-		IDOMNode newNode = null;
-
-		if (element.isCommentTag()) {
-			// do nothing
-		}
-		else if (isEmptyElement(element)) {
-			IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-			IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
-			ITextRegionList regions = startStructuredDocumentRegion.getRegions();
-			ITextRegion lastRegion = regions.get(regions.size() - 1);
-			replaceSource(structuredModel, 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())
-					replaceSource(structuredModel, 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();
-			replaceSource(structuredModel, structuredDocument, endTagStartOffset, 0, endTag);
-		}
-
-		newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
-		// new
-		// node
-
-		return newNode;
-	}
-
-	protected 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 regionList = startTagStructuredDocumentRegion.getRegions();
-			if (startTagStructuredDocumentRegion != null && regionList != null && regionList.get(regionList.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;
-	}
-
-	protected IDOMNode insertStartTag(IDOMNode node) {
-		IDOMElement element = (IDOMElement) node;
-		if (element.isCommentTag())
-			return node; // do nothing
-
-		IDOMNode newNode = null;
-
-		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();
-		replaceSource(structuredModel, structuredDocument, startTagStartOffset, 0, startTag);
-		newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
-		// new
-		// node
-
-		return newNode;
-	}
-
-	protected void insertTagClose(IDOMModel structuredModel, IStructuredDocumentRegion flatNode) {
-		if ((flatNode != null) && (flatNode.getRegions() != null)) {
-			ITextRegionList regionList = flatNode.getRegions();
-			ITextRegion lastRegion = regionList.get(regionList.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
-					replaceSource(structuredModel, structuredDocument, flatNode.getTextEndOffset(lastRegion), 0, ">"); //$NON-NLS-1$
-				}
-			}
-		}
-	}
-
-	protected boolean isEndTagRequired(IDOMNode node) {
-		if (node == null)
-			return false;
-		return node.isContainer();
-	}
-
-	/**
-	 * 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.
-	 */
-	protected boolean isStartTagRequired(IDOMNode node) {
-		if (node == null)
-			return false;
-		return node.isContainer();
-	}
-
-	protected boolean isXMLType(IDOMModel structuredModel) {
-		boolean result = false;
-
-		if (structuredModel != null && structuredModel != null) {
-			IDOMDocument document = structuredModel.getDocument();
-
-			if (document != null)
-				result = document.isXMLType();
-		}
-
-		return result;
-	}
-
-	protected IDOMNode quoteAttrValue(IDOMNode node) {
-		IDOMElement element = (IDOMElement) node;
-		if (element.isCommentTag())
-			return node; // do nothing
-
-		boolean quoteAttrValues = getCleanupPreferences().getQuoteAttrValues();
-		IDOMNode newNode = node;
-
-		if (quoteAttrValues) {
-			NamedNodeMap attributes = newNode.getAttributes();
-			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)) {
-						// TODO: Kit, please check. Is there any way to not
-						// rely on getting regions from attributes?
-						String newAttrValue = "=\"" + eachAttr.getNameRegionText() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-
-						IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-						replaceSource(structuredModel, structuredDocument, eachAttr.getNameRegionEndOffset(), 0, newAttrValue);
-						newNode = (IDOMNode) structuredModel.getIndexedRegion(node.getStartOffset()); // save
-						// new
-						// node
-					}
-				}
-				else {
-
-					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();
-							replaceSource(structuredModel, structuredDocument, attrValueStartOffset, attrValueLength, newAttrValue);
-							newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
-							// new
-							// node
-						}
-					}
-				}
-			}
-		}
-
-		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 or now, unless we find reason not to
-						Logger.log(Logger.INFO, e.getMessage());
-					}
-				}
-			}
-		}
-
-		return newNode;
-	}
-
-
-	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;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java
deleted file mode 100644
index 21ea68f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java
+++ /dev/null
@@ -1,147 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.cleanup;
-
-
-
-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.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Node;
-
-// nakamori_TODO: check and remove CSS formatting
-
-class HTMLCleanupHandlerFactory {
-
-
-
-	private static HTMLCleanupHandlerFactory fInstance = null;
-
-	static synchronized HTMLCleanupHandlerFactory getInstance() {
-		if (fInstance == null) {
-			fInstance = new HTMLCleanupHandlerFactory();
-		}
-		return fInstance;
-	}
-
-	private HTMLCleanupHandlerFactory() {
-		super();
-	}
-
-	IStructuredCleanupHandler createHandler(Node node, IStructuredCleanupPreferences cleanupPreferences) {
-		short nodeType = node.getNodeType();
-		IStructuredCleanupHandler handler = null;
-		switch (nodeType) {
-			case Node.ELEMENT_NODE : {
-				if (isJSPTag(node))
-					handler = new JSPElementNodeCleanupHandler();
-				else
-					handler = new ElementNodeCleanupHandler();
-				break;
-			}
-			case Node.TEXT_NODE : {
-				if (isParentStyleTag(node))
-					handler = new CSSTextNodeCleanupHandler();
-				else
-					handler = new NodeCleanupHandler();
-				break;
-			}
-			default : {
-				handler = new NodeCleanupHandler();
-			}
-		}
-
-		handler.setCleanupPreferences(cleanupPreferences);
-
-		return handler;
-	}
-
-	/**
-	 * 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;
-	}
-
-	private boolean isParentStyleTag(Node node) {
-		if (node == null)
-			return false;
-		if (node.getNodeType() != Node.TEXT_NODE)
-			return false;
-		if (!(node instanceof IDOMNode))
-			return false;
-		IStructuredDocumentRegion flatNode = ((IDOMNode) node).getFirstStructuredDocumentRegion();
-		if (flatNode == null)
-			return false;
-		if (flatNode.getType() != DOMRegionContext.BLOCK_TEXT)
-			return false;
-
-		// check if the parent is STYLE element
-		Node parent = node.getParentNode();
-		if (parent == null)
-			return false;
-		if (parent.getNodeType() != Node.ELEMENT_NODE)
-			return false;
-		String name = parent.getNodeName();
-		if (name == null)
-			return false;
-		if (!name.equalsIgnoreCase("STYLE"))//$NON-NLS-1$
-			return false;
-		return true;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupProcessorImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupProcessorImpl.java
deleted file mode 100644
index 5b765c4..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupProcessorImpl.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-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.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.w3c.dom.Node;
-
-public class HTMLCleanupProcessorImpl extends AbstractStructuredCleanupProcessor {
-	private IStructuredCleanupPreferences fCleanupPreferences = null;
-	
-	protected String getContentType() {
-		return ContentTypeIdForHTML.ContentTypeID_HTML;
-	}
-
-	protected IStructuredCleanupHandler getCleanupHandler(Node node) {
-		return HTMLCleanupHandlerFactory.getInstance().createHandler(node, getCleanupPreferences());
-	}
-
-	public IStructuredCleanupPreferences getCleanupPreferences() {
-		if (fCleanupPreferences == null) {
-			fCleanupPreferences = new StructuredCleanupPreferences();
-
-			Preferences preferences = getModelPreferences();
-			if (preferences != null) {
-				fCleanupPreferences.setTagNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE));
-				fCleanupPreferences.setAttrNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE));
-				fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
-				fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
-				fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS));
-				fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES));
-				fCleanupPreferences.setFormatSource(preferences.getBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE));
-				fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES));
-				fCleanupPreferences.setEOLCode(preferences.getString(HTMLCorePreferenceNames.CLEANUP_EOL_CODE));
-			}
-		}
-
-		return fCleanupPreferences;
-	}
-	
-	protected IStructuredFormatProcessor getFormatProcessor() {
-		return new HTMLFormatProcessorImpl();
-	}
-
-	protected Preferences getModelPreferences() {
-		return HTMLCorePlugin.getDefault().getPluginPreferences();
-	}
-	
-	protected void refreshCleanupPreferences() {
-		fCleanupPreferences = null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.java
deleted file mode 100644
index 4b0a783..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.java
+++ /dev/null
@@ -1,22 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.cleanup;
-
-
-
-import org.w3c.dom.Node;
-
-public class JSPElementNodeCleanupHandler extends AbstractNodeCleanupHandler {
-
-	public Node cleanup(Node node) {
-		return node;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/NodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/NodeCleanupHandler.java
deleted file mode 100644
index 9bb6109..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/NodeCleanupHandler.java
+++ /dev/null
@@ -1,22 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.cleanup;
-
-
-
-import org.w3c.dom.Node;
-
-public class NodeCleanupHandler extends AbstractNodeCleanupHandler {
-
-	public Node cleanup(Node node) {
-		return node;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/commentelement/handlers/CommentElementHandlerForSSI.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/commentelement/handlers/CommentElementHandlerForSSI.java
deleted file mode 100644
index ac88325..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/commentelement/handlers/CommentElementHandlerForSSI.java
+++ /dev/null
@@ -1,150 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.commentelement.handlers;
-
-
-
-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.contentmodel.CMDocument;
-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.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;
-
-public class CommentElementHandlerForSSI implements CommentElementHandler {
-
-	public Element createElement(Document document, String data, boolean isJSPTag) {
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
-		if (modelQuery == null) {
-			return null;
-		}
-		CMDocument cm = modelQuery.getCorrespondingCMDocument(document);
-		if (cm == null) {
-			return null;
-		}
-		CMNamedNodeMap map = cm.getElements();
-		if (map == null) {
-			return null;
-		}
-
-		TagScanner scanner = new TagScanner(data, 1);
-		String name = scanner.nextName();
-		if (name == null) {
-			return null;
-		}
-		StringBuffer buffer = new StringBuffer(name.length() + 4);
-		buffer.append(SSI_PREFIX);
-		buffer.append(':');
-		buffer.append(name);
-		String tagName = buffer.toString();
-		// check if valid (defined) SSI tag or not
-		if (map.getNamedItem(tagName) == null) {
-			return null;
-		}
-
-		CommentElementFactory factory = new CommentElementFactory(document, isJSPTag, this);
-		Element element = factory.create(tagName, 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)
-					attr.setValue(attrValue);
-				element.setAttributeNode(attr);
-			}
-			attrName = scanner.nextName();
-		}
-		return element;
-	}
-
-	public String generateStartTagContent(IDOMElement element) {
-		ISourceGenerator generator = element.getModel().getGenerator();
-		StringBuffer buffer = new StringBuffer();
-
-		buffer.append('#');
-		buffer.append(element.getLocalName());
-
-		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);
-			}
-		}
-
-		return buffer.toString();
-	}
-
-	public String generateEndTagContent(IDOMElement element) {
-		return null; // always empty
-	}
-
-	public boolean isEmpty() {
-		return true;
-	}
-
-	public boolean isCommentElement(IDOMElement element) {
-		if (element == null) {
-			return false;
-		}
-		Document document = element.getOwnerDocument();
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
-		if (modelQuery == null) {
-			return false;
-		}
-		CMDocument cm = modelQuery.getCorrespondingCMDocument(document);
-		if (cm == null) {
-			return false;
-		}
-		CMNamedNodeMap map = cm.getElements();
-		if (map == null) {
-			return false;
-		}
-		String prefix = element.getPrefix();
-		if (prefix == null || !prefix.equals(SSI_PREFIX)) {
-			return false;
-		}
-		String tagName = element.getTagName();
-		if (tagName.length() <= 4) {
-			return false;
-		}
-		if (map.getNamedItem(tagName) == null) {
-			return false;
-		}
-		else {
-			return true;
-		}
-	}
-
-	private static final String SSI_PREFIX = "ssi";//$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/contentmodel/AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
deleted file mode 100644
index 53d29b9..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
+++ /dev/null
@@ -1,1283 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for attribute declarations.
- */
-final 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};
-	/** coreattrs. */
-	private static final String[] CORE = {ATTR_NAME_ID, ATTR_NAME_CLASS, ATTR_NAME_STYLE, ATTR_NAME_TITLE};
-	/** events. */
-	private static final String[] EVENTS = {ATTR_NAME_ONCLICK, ATTR_NAME_ONDBLCLICK, ATTR_NAME_ONMOUSEDOWN, ATTR_NAME_ONMOUSEUP, ATTR_NAME_ONMOUSEOVER, ATTR_NAME_ONMOUSEMOVE, ATTR_NAME_ONMOUSEOUT, ATTR_NAME_ONKEYPRESS, ATTR_NAME_ONKEYDOWN, ATTR_NAME_ONKEYUP, ATTR_NAME_ONHELP};
-	/** i18n. lang, dir */
-	private static final String[] I18N = {ATTR_NAME_LANG, ATTR_NAME_DIR};
-	/** cellhaligh. */
-	private static final String[] CELLHALIGN = {ATTR_NAME_CHAR, ATTR_NAME_CHAROFF};
-
-	/**
-	 * constructor.
-	 */
-	public AttributeCollection() {
-		super();
-	}
-
-	/**
-	 * Create an attribute declaration.
-
-	 * @param attrName java.lang.String
-	 */
-	private HTMLAttrDeclImpl create(String attrName) {
-		HTMLAttrDeclImpl attr = null;
-		HTMLCMDataTypeImpl atype = null;
-
-		if (attrName.equalsIgnoreCase(ATTR_NAME_ABBR)) {
-			// (abbr %Text; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ABBR, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ACCEPT)) {
-			// (accept %ContentTypes; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ACCEPT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ACCEPT_CHARSET)) {
-			// (accept-charset %Charsets;; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARSETS);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ACCEPT_CHARSET, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ACTION)) {
-			// (action %URI #REQUIRED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ACTION, atype, CMAttributeDeclaration.REQUIRED);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ARCHIVE)) {
-			// (archive CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ARCHIVE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ACCESSKEY)) {
-			// (accesskey %Character; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARACTER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ACCESSKEY, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ALINK)) {
-			// (alink %Color; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ALINK, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ALT)) {
-			// (alt %Text; #REQUIRED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ALT, atype, CMAttributeDeclaration.REQUIRED);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_AUTOSTART)) {
-			// (autostart (true|false) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOSTART, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_AUTOPLAY)) {
-			// (autoplay (true|false) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOPLAY, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_AUTOSIZE)) {
-			// (autosize (true|false) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOSIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_AXIS)) {
-			// (axis CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_AXIS, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_BACKGROUND)) {
-			// (background %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_BACKGROUND, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_BEHAVIOR)) {
-			// (behavior (scroll|slide|alternate) scroll)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_SCROLL, ATTR_VALUE_SLIDE, ATTR_VALUE_ALTERNATE};
-			atype.setEnumValues(values);
-			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_SCROLL);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_BEHAVIOR, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_BGCOLOR)) {
-			// (bgcolor %Color; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_BGCOLOR, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_BORDER)) {
-			// (border %Pixels; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDER, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CELLSPACING)) {
-			// (cellspacing %Length; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CELLSPACING, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CELLPADDING)) {
-			// (cellpadding %Length; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CELLPADDING, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CGI)) {
-			// (cgi %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CGI, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CHAR)) {
-			// (char %Character; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARACTER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CHAR, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CHAROFF)) {
-			// (charoff %Length; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CHAROFF, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CHARSET)) {
-			// (charset %Charset; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARSET);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CHARSET, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CITE)) {
-			// (cite %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CITE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CLASS)) {
-			// (class CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CLASS, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CLASSID)) {
-			// (classid %URI #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CLASSID, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CMD)) {
-			// (cmd CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CMD, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CHECKED)) {
-			// (checked (checked) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_CHECKED};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CHECKED, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CLEAR)) {
-			// (clear (left | all | right | none) none)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_ALL, ATTR_VALUE_RIGHT, ATTR_VALUE_NONE};
-			atype.setEnumValues(values);
-			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_NONE);
-
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CLEAR, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CODE)) {
-			// (code CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CODE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CODEBASE)) {
-			// (codebase %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CODEBASE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CODETYPE)) {
-			// (codetype %CotentType; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CODETYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_COLOR)) {
-			// (color %Color; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_COLOR, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_COMPACT)) {
-			// (compact (compact) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_COMPACT};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_COMPACT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_COLS)) {
-			// (cols NUMBER #REQUIRED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_COLS, atype, CMAttributeDeclaration.REQUIRED);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_COLSPAN)) {
-			// (colspan NUMBER 1)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_COLSPAN, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CONTENT)) {
-			// (content CDATA #REQUIRED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTENT, atype, CMAttributeDeclaration.REQUIRED);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CONTROLLER)) {
-			// (controller (true|false) true)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
-			atype.setEnumValues(values);
-			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTROLLER, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_COORDS)) {
-			// (coords %Coords; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COORDS);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_COORDS, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_DATA)) {
-			// (data %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_DATA, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_DATETIME)) {
-			// (datetime %Datetime; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.DATETIME);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_DATETIME, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_DATAPAGESIZE)) {
-			// (datapagesize CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_DATAPAGESIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_DECLARE)) {
-			// (declare (declare) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_DECLARE};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_DECLARE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_DEFER)) {
-			// (defer (defer) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_DEFER};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_DEFER, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_DIR)) {
-			// (dir (ltr|rtl) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_LTR, ATTR_VALUE_RTL};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_DIR, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_DIRECTION)) {
-			// (direction (left|right|up|down) left)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT, ATTR_VALUE_UP, ATTR_VALUE_DOWN};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_DIRECTION, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_DIRECTKEY)) {
-			// (directkey %Character; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARACTER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_DIRECTKEY, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_DISABLED)) {
-			// (disabled (disabled) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			// boolean attribute must have the same value as its name.
-			String[] values = {ATTR_NAME_DISABLED};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_DISABLED, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ENCTYPE)) {
-			// (enctype %ContentType; "application/x-www-form-urlencoded")
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
-			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_WWW_FORM_URLENCODED);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ENCTYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ERRMSG)) {
-			// (errmsg CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ERRMSG, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_EVENT)) {
-			// (event CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_EVENT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_FACE)) {
-			// (face CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_FACE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_FILE)) {
-			// (file %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_FILE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_FOR)) {
-			// (for %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_FOR, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_FRAME)) {
-			// (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);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_FRAMEBORDER)) {
-			// (frameborder (1|0) 1)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_1, ATTR_VALUE_0};
-			atype.setEnumValues(values);
-			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAMEBORDER, atype, CMAttributeDeclaration.OPTIONAL);
-
-			//<<D215684
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_FRAMESPACING)) {
-			// (framespacing CDATA; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAMESPACING, atype, CMAttributeDeclaration.OPTIONAL);
-			//D215684
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_HEADERS)) {
-			// (HEADERS IDREFS; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.IDREFS);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_HEADERS, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_HEIGHT)) {
-			// (height %Length; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_HEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_HIDDEN)) {
-			// (hidden CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_HIDDEN, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_HREF)) {
-			// (href %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_HREF, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_HREFLANG)) {
-			// (hreflang %LanguageCode; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LANGUAGE_CODE);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_HREFLANG, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_HSPACE)) {
-			// (hspace %Pixels; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_HSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_HTTP_EQUIV)) {
-			// (http-equiv NAME #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_HTTP_EQUIV, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ID)) {
-			// (id ID #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ID);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ID, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ISMAP)) {
-			// (ismap (ismap) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_ISMAP};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ISMAP, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ISTYLE)) {
-			// (istyle CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ISTYLE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_LABEL)) {
-			// (label %Text; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_LABEL, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_LANG)) {
-			// (lang %LanguageCode; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LANGUAGE_CODE);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_LANG, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_LANGUAGE)) {
-			// (language %CDATA; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_LANGUAGE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_LINK)) {
-			// (link %Color; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_LINK, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_LONGDESC)) {
-			// (longdesc %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_LONGDESC, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_LOOP)) {
-			// (loop CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_LOOP, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_MACRO)) {
-			// (macro CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_MACRO, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_MAPFILE)) {
-			// (mapfile %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_MAPFILE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_MARGINWIDTH)) {
-			// (marginwidth %Pixels; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_MARGINWIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_MARGINHEIGHT)) {
-			// (marginheight %Pixels; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_MARGINHEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_MAXLENGTH)) {
-			// (maxlength NUMBER #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_MAXLENGTH, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_MAYSCRIPT)) {
-			// (mayscript (mayscript) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_MAYSCRIPT};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_MAYSCRIPT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_MEDIA)) {
-			// (media %MediaDesc; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MEDIA_DESC);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_MEDIA, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_METHOD)) {
-			// (method (GET|POST) GET)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_GET, ATTR_VALUE_POST};
-			atype.setEnumValues(values);
-			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_GET);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_METHOD, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_MULTIPLE)) {
-			// (multiple (multiple) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_MULTIPLE};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_MULTIPLE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_NAME)) {
-			// (name CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_NOHREF)) {
-			// (nohref (nohref) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_NOHREF};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_NOHREF, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_NORESIZE)) {
-			// (noresize (noresize) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_NORESIZE};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_NORESIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_NOSHADE)) {
-			// (noshade (noshade) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_NOSHADE};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_NOSHADE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_NOWRAP)) {
-			// (nowrap (nowrap) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_NOWRAP};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_NOWRAP, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_OBJECT)) {
-			// (object CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_OBJECT};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_OBJECT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONBLUR)) {
-			// (onblur %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONBLUR, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCLICK)) {
-			// (onclick %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCLICK, 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_ONDBLCLICK)) {
-			// (ondblclick %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDBLCLICK, 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_ONHELP)) {
-			// (onhelp %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONHELP, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONKEYPRESS)) {
-			// (onkeypress %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONKEYPRESS, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONKEYDOWN)) {
-			// (onkeydown %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONKEYDOWN, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONKEYUP)) {
-			// (onkyeup %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONKEYUP, 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_ONMOUSEDOWN)) {
-			// (onmousedown %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEDOWN, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEUP)) {
-			// (onmouseup %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEUP, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEOVER)) {
-			// (onmouseover %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEOVER, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEMOVE)) {
-			// (onmousemove %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEMOVE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEOUT)) {
-			// (onmouseout %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEOUT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONRESET)) {
-			// (onreset %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONRESET, 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_ONSUBMIT)) {
-			// (onsubmit %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSUBMIT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONUNLOAD)) {
-			// (onunload %Script; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONUNLOAD, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_PALETTE)) {
-			// (palette CDATA; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_PALETTE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_PANEL)) {
-			// (panel CDATA; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_PANEL, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_PLAYCOUNT)) {
-			// (playcount NUMBER; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_PLAYCOUNT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_PROFILE)) {
-			// (profile %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_PROFILE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_PROMPT)) {
-			// (prompt %Text; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_PROMPT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_READONLY)) {
-			// (readonly (readonly) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_READONLY};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_READONLY, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_REPEAT)) {
-			// (repeat CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_REPEAT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_REL)) {
-			// (rel %LinkTypes; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LINK_TYPES);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_REL, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_REV)) {
-			// (rev %LinkTypes; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LINK_TYPES);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_REV, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ROWS)) {
-			// (rows NUMBER #REQUIRED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ROWS, atype, CMAttributeDeclaration.REQUIRED);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ROWSPAN)) {
-			// (rowspan NUMBER 1)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ROWSPAN, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_RULES)) {
-			// (rules %TRules; #IMPLIED)
-			// %TRules; is (none | groups | rows | cols | all).
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_NONE, ATTR_VALUE_GROUPS, ATTR_VALUE_ROWS, ATTR_VALUE_COLS, ATTR_VALUE_ALL};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_RULES, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SCALE)) {
-			// (scale CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SCALE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SCHEME)) {
-			// (scheme CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SCHEME, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SELECTED)) {
-			// (selected (selected) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_SELECTED};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SELECTED, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SCOPE)) {
-			// (SCOPE %Scope; #IMPLIED)
-			// %Scope; is (row|col|rowgroup|colgroup)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_ROW, ATTR_VALUE_COL, ATTR_VALUE_ROWGROUP, ATTR_VALUE_COLGROUP};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SCOPE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SCROLLAMOUNT)) {
-			// (scrollamount NUMBER #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SCROLLAMOUNT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SCROLLDELAY)) {
-			// (scrolldelay NUMBER #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SCROLLDELAY, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SCROLLING)) {
-			// (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);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SHAPE)) {
-			// (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);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SHOWCONTROLS)) {
-			// (showcontrols (true|false) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SHOWCONTROLS, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SIZE)) {
-			// (size %Pixels; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SIZEFMT)) {
-			// (sizefmt CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZEFMT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SPAN)) {
-			// (span NUMBER 1)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SPAN, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SRC)) {
-			// (src %URI; #IMPLIED)
-			// NOTE: "src" attributes are defined in several elements.
-			//		 The definition of IMG is different from others.
-			//		 So, it should be locally defined.
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SRC, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_START)) {
-			// (start NUMBER #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_START, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_STANDBY)) {
-			// (standby %Text; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_STANDBY, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_STYLE)) {
-			// (style %StyleSheet; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.STYLE_SHEET);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_STYLE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SUMMARY)) {
-			// (summary %Text; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SUMMARY, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_TABINDEX)) {
-			// (tabindex NUMBER #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_TABINDEX, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_TARGET)) {
-			// (target %FrameTarget; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.FRAME_TARGET);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_TARGET, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_TEXT)) {
-			// (text CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_TEXT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_TEXTFOCUS)) {
-			// (textfocus CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_TEXTFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_TITLE)) {
-			// (title %Text; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_TITLE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_TIMEFMT)) {
-			// (timefmt CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_TIMEFMT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_TRUESPEED)) {
-			// (truespeed (truespeed) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_TRUESPEED};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_TRUESPEED, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_TYPE)) {
-			// (type %CotentType; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_USEMAP)) {
-			// (usemap %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_USEMAP, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_VALIGN)) {
-			// (valign (top|middle|bottom|baseline) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_BASELINE};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_VALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_VALUE)) {
-			// (value CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_VALUETYPE)) {
-			// (valuetype (DATA|REF|OBJECT) DATA)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_DATA, ATTR_VALUE_REF, ATTR_VALUE_OBJECT};
-			atype.setEnumValues(values);
-			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_DATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUETYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_VAR)) {
-			// (var CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_VAR, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_VERSION)) {
-			// (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);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_VIRTUAL)) {
-			// (virtual %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_VIRTUAL, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_VLINK)) {
-			// (vlink %Color; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_VLINK, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_VOLUME)) {
-			// (volume CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_VOLUME, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_WIDTH)) {
-			// (width %Length; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_VSPACE)) {
-			// (vspace %Pixels; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_VSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-
-			// <<D205514
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_TOPMARGIN)) {
-			// (topmargin, CDATA, #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_TOPMARGIN, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_BOTTOMMARGIN)) {
-			// (bottommargin, CDATA, #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_BOTTOMMARGIN, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_LEFTMARGIN)) {
-			// (leftmargin, CDATA, #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_LEFTMARGIN, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_RIGHTMARGIN)) {
-			// (rightmargin, CDATA, #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_RIGHTMARGIN, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_BORDERCOLOR)) {
-			// (bordercolor, %Color; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDERCOLOR, atype, CMAttributeDeclaration.OPTIONAL);
-			// D205514
-
-		}
-		else {
-			// unknown attribute; maybe error.
-			// should warn.
-			attr = null;
-		}
-
-		return attr;
-	}
-
-	/**
-	 * Get align attribute which has %CAlign; as values..
-	 * At this time (4/19/2001), it is identical to %LAlign;.
-	 *
-	 */
-	public static final HTMLAttrDeclImpl createAlignForCaption() {
-		// align (local)
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		// set enum values
-		String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
-		atype.setEnumValues(values);
-
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-		return attr;
-	}
-
-	/**
-	 * Get align attribute which has %IAlign; as values..
-	 */
-	public static final HTMLAttrDeclImpl createAlignForImage() {
-		// align (local)
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		// set enum values
-		String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
-		atype.setEnumValues(values);
-
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-		return attr;
-	}
-
-	/**
-	 * Get align attribute which has %LAlign; as values..
-	 */
-	public static final HTMLAttrDeclImpl createAlignForLegend() {
-		// align (local)
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		// set enum values
-		String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
-		atype.setEnumValues(values);
-
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-		return attr;
-	}
-
-	/**
-	 * Create an attribute declaration for <code>align</code>
-	 * in several elements, like <code>P</code>, <code>DIV</code>.
-	 * The values are different from attributes those have the same name
-	 * in other elements (<code>IMG</code> and <code>TABLE</code>).
-	 * So, it can't treat as global attributes.
-	 * <strong>NOTE: These attribute declaration has
-	 * no owner CMDocument instance.</strong>
-	 */
-	public static final HTMLAttrDeclImpl createAlignForParagraph() {
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		// set enum values: left|center|right|justify
-		String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT, ATTR_VALUE_JUSTIFY};
-		atype.setEnumValues(values);
-
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-		return attr;
-	}
-
-	/**
-	 * Get %attrs; declarations.
-	 * %attrs; consists of %coreattrs;, %i18n, and %events;.
-	 */
-	public void getAttrs(CMNamedNodeMapImpl declarations) {
-		// %coreattrs;
-		Iterator names = Arrays.asList(CORE).iterator();
-		getDeclarations(declarations, names);
-		// %i18n;
-		names = Arrays.asList(I18N).iterator();
-		getDeclarations(declarations, names);
-		// %events;
-		names = Arrays.asList(EVENTS).iterator();
-		getDeclarations(declarations, names);
-	}
-
-	/**
-	 * Get %bodycolors; declarations.
-	 */
-	public void getBodycolors(CMNamedNodeMapImpl declarations) {
-		Iterator names = Arrays.asList(BODYCOLORS).iterator();
-		getDeclarations(declarations, names);
-	}
-
-	/**
-	 * Get %cellhalign; declarations.
-	 * %cellhaligh; consists of:
-	 *  - (align (left|center|right|justify|char) #IMPLIED)
-	 *  - (char %Character; #IMPLIED)
-	 *  - (charoff %Length; #IMPLIED)
-	 */
-	public void getCellhalign(CMNamedNodeMapImpl declarations) {
-		// (align (left|center|right|justify|char) #IMPLIED) should be defined
-		// locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		// set enum values
-		String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT, ATTR_VALUE_JUSTIFY, ATTR_VALUE_CHAR};
-		atype.setEnumValues(values);
-
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-		declarations.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-
-		// the rest.
-		Iterator names = Arrays.asList(CELLHALIGN).iterator();
-		getDeclarations(declarations, names);
-	}
-
-	/**
-	 * Get %cellvalign; declarations.
-	 * %cellhaligh; is:
-	 *  - (valign (top|middle|bottom|baseline) #IMPLIED)
-	 */
-	public void getCellvalign(CMNamedNodeMapImpl declarations) {
-		HTMLAttributeDeclaration dec = getDeclaration(HTML40Namespace.ATTR_NAME_VALIGN);
-		if (dec != null)
-			declarations.putNamedItem(HTML40Namespace.ATTR_NAME_VALIGN, dec);
-	}
-
-	/**
-	 * Get %coreattrs; declarations.
-	 */
-	public void getCore(CMNamedNodeMapImpl declarations) {
-		Iterator names = Arrays.asList(CORE).iterator();
-		getDeclarations(declarations, names);
-	}
-
-	/**
-	 * Get a global attribute declaration.
-	 * @param attrName java.lang.String
-	 */
-	public HTMLAttributeDeclaration getDeclaration(String attrName) {
-		CMNode cmnode = getNamedItem(attrName);
-		if (cmnode != null)
-			return (HTMLAttributeDeclaration) cmnode; // already exists.
-
-		HTMLAttrDeclImpl dec = create(attrName);
-		if (dec != null)
-			putNamedItem(attrName, dec);
-
-		return dec;
-	}
-
-	/**
-	 * Get declarations which are specified by names.
-	 * @param names java.util.Iterator
-	 */
-	public void getDeclarations(CMNamedNodeMapImpl declarations, Iterator names) {
-		while (names.hasNext()) {
-			String attrName = (String) names.next();
-			HTMLAttributeDeclaration dec = getDeclaration(attrName);
-			if (dec != null)
-				declarations.putNamedItem(attrName, dec);
-		}
-	}
-
-	/**
-	 * Get %events; declarations.
-	 */
-	public void getEvents(CMNamedNodeMapImpl declarations) {
-		Iterator names = Arrays.asList(EVENTS).iterator();
-		getDeclarations(declarations, names);
-	}
-
-	/**
-	 * Get %i18n; declarations.
-	 */
-	public void getI18n(CMNamedNodeMapImpl declarations) {
-		Iterator names = Arrays.asList(I18N).iterator();
-		getDeclarations(declarations, names);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMContentImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMContentImpl.java
deleted file mode 100644
index dac7c81..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMContentImpl.java
+++ /dev/null
@@ -1,58 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-
-
-
-/**
- * Implementation of CMContent for HTML CM.
- */
-abstract class CMContentImpl extends CMNodeImpl implements CMContent {
-
-	public static final int UNBOUNDED = -1;
-	/**  -1: it's UNBOUNDED. */
-	private int maxOccur = UNBOUNDED;
-	/**  0: it's OPTIONAL, 1, it's REQUIRED. */
-	private int minOccur = 0;
-
-	/**
-	 * The primary consturctor.
-	 * Use this one for usual cases.<br>
-	 */
-	public CMContentImpl(String name, int min, int max) {
-		super(name);
-		minOccur = min;
-		maxOccur = max;
-	}
-
-	/**
-	 * getMaxOccur method
-	 * @return int
-	 *
-	 * If -1, it's UNBOUNDED.
-	 */
-	public int getMaxOccur() {
-		return maxOccur;
-	}
-
-	/**
-	 * getMinOccur method
-	 * @return int
-	 *
-	 * If 0, it's OPTIONAL.
-	 * If 1, it's REQUIRED.
-	 */
-	public int getMinOccur() {
-		return minOccur;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMGroupImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMGroupImpl.java
deleted file mode 100644
index a8ab34c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMGroupImpl.java
+++ /dev/null
@@ -1,83 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-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;
-
-/**
- */
-class CMGroupImpl extends CMContentImpl implements CMGroup {
-
-	private int operator = CMGroup.SEQUENCE;
-	private CMNodeListImpl children = null;
-
-	/**
-	 * CMGroupImpl constructor comment.
-	 */
-	public CMGroupImpl(int op, int minOccur, int maxOccur) {
-		super(null, minOccur, maxOccur);
-		switch (op) {
-			case CMGroup.ALL :
-			case CMGroup.CHOICE :
-			case CMGroup.SEQUENCE :
-				operator = op;
-				break;
-			default :
-				// should warn.
-				break;
-		}
-	}
-
-	/**
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 * @param org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 */
-	protected CMNode appendChild(CMNode child) {
-		if (child == null)
-			return null;
-		if (children == null)
-			children = new CMNodeListImpl();
-		return children.appendNode(child);
-	}
-
-	/**
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList
-	 */
-	public CMNodeList getChildNodes() {
-		return children;
-	}
-
-	/**
-	 * getNodeType method
-	 * @return int
-	 *
-	 * Returns one of :
-	 * ELEMENT_DECLARATION, ATTRIBUTE_DECLARATION, GROUP, ENTITY_DECLARATION.
-	 */
-	public int getNodeType() {
-		return CMNode.GROUP;
-	}
-
-	/**
-	 * getOperation method
-	 * @return int
-	 *
-	 * Returns one of :
-	 * ALONE (a), SEQUENCE (a,b), CHOICE (a|b), ALL (a&b).
-	 */
-	public int getOperator() {
-		return operator;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.java
deleted file mode 100644
index 21ce1b2..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.java
+++ /dev/null
@@ -1,99 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-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;
-
-/**
- * An implementation of the CMNamedNodeMap interface.
- * This class is intented to be used as a container of attribute declarations.
- * If someone wants to use this class for other purpose, he must pay attention
- * to the fact that this class is tolerant of the key name case.  That is, this
- * class does not distinguish "name", "NAME", and "Name" as a key name.
- */
-class CMNamedNodeMapImpl implements CMNamedNodeMap {
-
-	private Hashtable items = null;
-
-	/**
-	 */
-	public CMNamedNodeMapImpl() {
-		super();
-		items = new Hashtable();
-	}
-
-	/**
-	 * getLength method
-	 * @return int
-	 */
-	public int getLength() {
-		return items.size();
-	}
-
-	/**
-	 * getNamedItem method
-	 * @return CMNode <code>null</code> for unknown keys.
-	 * @param name java.lang.String
-	 */
-	public CMNode getNamedItem(String name) {
-		String cookedName = makeCanonicalForm(name);
-		if (!items.containsKey(cookedName))
-			return null;
-		return (CMNode) items.get(cookedName);
-	}
-
-	/**
-	 * item method
-	 * @return CMNode
-	 * @param index int
-	 */
-	public CMNode item(int index) {
-		Iterator iter = iterator();
-		while (iter.hasNext()) {
-			CMNode node = (CMNode) iter.next();
-			if (--index < 0)
-				return node;
-		}
-		return null;
-	}
-
-	/**
-	 * @return java.util.Iterator
-	 */
-	public Iterator iterator() {
-		return items.values().iterator();
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param rawForm java.lang.String
-	 */
-	private String makeCanonicalForm(String rawForm) {
-		return rawForm.toUpperCase();
-	}
-
-	/**
-	 * @param key java.lang.String
-	 * @param item java.lang.String
-	 */
-	void putNamedItem(String name, CMNode item) {
-		String cookedName = makeCanonicalForm(name);
-		if (items.containsKey(cookedName))
-			return; // already registered.
-		items.put(cookedName, item);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamespaceImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamespaceImpl.java
deleted file mode 100644
index 20f4c28..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamespaceImpl.java
+++ /dev/null
@@ -1,59 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * CMNamespace implementation.
- */
-class CMNamespaceImpl extends CMNodeImpl implements CMNamespace {
-
-	private java.lang.String prefix = null;
-
-	/**
-	 * CMNamespaceImpl constructor comment.
-	 */
-	public CMNamespaceImpl(String uri, String pfx) {
-		super(uri);
-		prefix = pfx;
-	}
-
-	/**
-	 * getNodeType method
-	 * @return int
-	 *
-	 * Returns one of :
-	 *
-	 */
-	public int getNodeType() {
-		return CMNode.NAME_SPACE;
-	}
-
-	/**
-	 * getPrefix method
-	 * @return java.lang.String
-	 */
-	public String getPrefix() {
-		return prefix;
-	}
-
-	/**
-	 * getURI method
-	 * @return java.lang.String
-	 */
-	public String getURI() {
-		return getNodeName();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeImpl.java
deleted file mode 100644
index 263d75a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeImpl.java
+++ /dev/null
@@ -1,65 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-abstract class CMNodeImpl implements CMNode {
-
-	private java.lang.String name = null;
-
-	/**
-	 * CMNodeImpl constructor comment.
-	 */
-	public CMNodeImpl(String nm) {
-		super();
-		name = nm;
-	}
-
-	/**
-	 * getNodeName method
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		return name;
-	}
-
-	/**
-	 * getProperty method
-	 * @return java.lang.Object
-	 *
-	 * Returns the object property desciped by the propertyName
-	 *
-	 */
-	public Object getProperty(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.IS_XHTML))
-			return new Boolean(false);
-		return null;
-	}
-
-	/**
-	 * supports method
-	 * @return boolean
-	 *
-	 * Returns true if the CMNode supports a specified property
-	 *
-	 */
-	public boolean supports(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.IS_XHTML))
-			return true;
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeListImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeListImpl.java
deleted file mode 100644
index ddcdb1c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeListImpl.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-/**
- * Analog of dom.NodeList for CM.
- * So, the implementation is very similar to
- * NodeListImpl<br>
- */
-class CMNodeListImpl implements CMNodeList {
-
-	private java.util.Vector nodes = null;
-
-	/**
-	 * CMNodeListImpl constructor comment.
-	 */
-	public CMNodeListImpl() {
-		super();
-		nodes = new java.util.Vector();
-	}
-
-	/**
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 * @param node org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 */
-	protected CMNode appendNode(CMNode node) {
-		nodes.addElement(node);
-		return node;
-	}
-
-	/**
-	 * getLength method
-	 * @return int
-	 */
-	public int getLength() {
-		return nodes.size();
-	}
-
-	/**
-	 * item method
-	 * @return CMNode
-	 * @param index int
-	 */
-	public CMNode item(int index) {
-		if (index < 0 || index >= nodes.size())
-			return null;
-		return (CMNode) nodes.elementAt(index);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinition.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinition.java
deleted file mode 100644
index 0ab6652..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinition.java
+++ /dev/null
@@ -1,75 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * This class is intended to represent a complex type definition
- * in XML Schema.<br>
- */
-abstract class ComplexTypeDefinition {
-
-	protected CMGroupImpl content = null;
-	protected ElementCollection collection = null;
-	protected String primaryCandidateName = null;
-
-	/**
-	 * ComplexTypeDefinition constructor comment.
-	 */
-	public ComplexTypeDefinition(ElementCollection elementCollection) {
-		super();
-		collection = elementCollection;
-		createContent();
-	}
-
-	/**
-	 * Create an actual content model.
-	 * This method should be called once and only once in the constructor.<br>
-	 */
-	protected abstract void createContent();
-
-	/**
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMGroup
-	 */
-	public CMGroup getContent() {
-		return content;
-	}
-
-	/**
-	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
-	 * those are defined in CMElementDeclaration.
-	 */
-	/* NOTE: Do we need LOGICAL type?
-	 * -- 3/7/2001
-	 */
-	public abstract int getContentType();
-
-	/**
-	 * Get content hint.
-	 */
-	public HTMLElementDeclaration getPrimaryCandidate() {
-		if (primaryCandidateName == null)
-			return null;
-		return (HTMLElementDeclaration) collection.getNamedItem(primaryCandidateName);
-	}
-
-	/**
-	 * Name of complex type definition.
-	 * Each singleton must know its own name.
-	 * All names should be defined in
-	 * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
-	 * @return java.lang.String
-	 */
-	public abstract String getTypeName();
-}
\ No newline at end of file
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
deleted file mode 100644
index 60fdef1..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java
+++ /dev/null
@@ -1,183 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * Factory of ComplexTypeDefinition.
- */
-final class ComplexTypeDefinitionFactory {
-
-	private static ComplexTypeDefinitionFactory instance = null;
-	private java.util.Hashtable definitions = null;
-	// constants for complex type name
-	/** for ADDRESS. */
-	public final static String CTYPE_ADDRESS = "CTYPE_ADDRESS";//$NON-NLS-1$
-	/** CDATA content. No ComplexTypeDefinition instance shuld be created. */
-	public final static String CTYPE_CDATA = "CTYPE_CDATA";//$NON-NLS-1$
-	/** col group content. COL* */
-	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 EMBED. */
-	public final static String CTYPE_EMBED = "CTYPE_EMBED";//$NON-NLS-1$
-	/** empty content. No ComplexTypeDefinition instance should be created. */
-	public final static String CTYPE_EMPTY = "CTYPE_EMPTY";//$NON-NLS-1$
-	/** for FIELDSET. */
-	public final static String CTYPE_FIELDSET = "CTYPE_FIELDSET";//$NON-NLS-1$
-	/** for FRAMESET. */
-	public final static String CTYPE_FRAMESET = "CTYPE_FRAMESET";//$NON-NLS-1$
-	/** flow content. (%flow;)* */
-	public final static String CTYPE_FLOW_CONTAINER = "CTYPE_FLOW_CONTAINER";//$NON-NLS-1$
-	/** html content. HEAD, (FRAMESET|BODY) */
-	public final static String CTYPE_HTML = "CTYPE_HTML";//$NON-NLS-1$
-	/** head content. TITLE & ISINDEX? & BASE? */
-	public final static String CTYPE_HEAD = "CTYPE_HEAD";//$NON-NLS-1$
-	/** inline content. (%inline;)* */
-	public final static String CTYPE_INLINE_CONTAINER = "CTYPE_INLINE_CONTAINER";//$NON-NLS-1$
-	/** list item container. (LI)+ */
-	public final static String CTYPE_LI_CONTAINER = "CTYPE_LI_CONTAINER";//$NON-NLS-1$
-	/** for MAP. */
-	public final static String CTYPE_MAP = "CTYPE_MAP";//$NON-NLS-1$
-	/** noframes content. */
-	public final static String CTYPE_NOFRAMES_CONTENT = "CTYPE_NOFRAMES_CONTENT";//$NON-NLS-1$
-	/** for OPTGROUP. */
-	public final static String CTYPE_OPTION_CONTAINER = "CTYPE_OPTION_CONTAINER";//$NON-NLS-1$
-	/** param container. For OBJECT/APPLET. */
-	public final static String CTYPE_PARAM_CONTAINER = "CTYPE_PARAM_CONTAINER";//$NON-NLS-1$
-	/** PCDATA content. No ComplexTypeDefinition instance shuld be created. */
-	public final static String CTYPE_PCDATA = "CTYPE_PCDATA";//$NON-NLS-1$
-	/** for SELECT. */
-	public final static String CTYPE_SELECT = "CTYPE_SELECT";//$NON-NLS-1$
-	/** table content. CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+ */
-	public final static String CTYPE_TABLE = "CTYPE_TABLE";//$NON-NLS-1$
-	/** table cell contaier. (TH|TD)+ */
-	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$
-
-	/**
-	 * ComplexTypeDefinitionFactory constructor comment.
-	 */
-	private ComplexTypeDefinitionFactory() {
-		super();
-		definitions = new java.util.Hashtable();
-	}
-
-	/**
-	 * Factory method for ComplexTypeDefinition.
-	 * Each instance created in this method must be registered into
-	 * the map with its name.
-	 * @param definitionName java.lang.String
-	 * @param elementCollection ElementCollection
-	 */
-	public ComplexTypeDefinition createTypeDefinition(String definitionName, ElementCollection elementCollection) {
-		if (definitions.containsKey(definitionName)) {
-			return (ComplexTypeDefinition) definitions.get(definitionName);
-		}
-
-		ComplexTypeDefinition def = null;
-		if (definitionName == CTYPE_ADDRESS) {
-			def = new CtdAddress(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_COLUMN_GROUP) {
-			def = new CtdColumnGroup(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_DEFINITION_LIST) {
-			def = new CtdDl(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_EMBED) {
-			def = new CtdEmbed(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_FIELDSET) {
-			def = new CtdFieldset(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_FLOW_CONTAINER) {
-			def = new CtdFlowContainer(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_FRAMESET) {
-			def = new CtdFrameset(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_HEAD) {
-			def = new CtdHead(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_HTML) {
-			def = new CtdHtml(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_INLINE_CONTAINER) {
-			def = new CtdInlineContainer(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_LI_CONTAINER) {
-			def = new CtdLiContainer(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_MAP) {
-			def = new CtdMap(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_NOFRAMES_CONTENT) {
-			def = new CtdNoframesContent(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_OPTION_CONTAINER) {
-			def = new CtdOptionContainer(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_PARAM_CONTAINER) {
-			def = new CtdParamContainer(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_SELECT) {
-			def = new CtdSelect(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_TABLE) {
-			def = new CtdTable(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_TCELL_CONTAINER) {
-			def = new CtdTableCellContainer(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_TR_CONTAINER) {
-			def = new CtdTrContainer(elementCollection);
-
-		}
-		else {
-			def = null;
-		}
-		if (def == null)
-			return null; // fail to create.
-		definitions.put(definitionName, def);
-		return def;
-	}
-
-	/**
-	 * For singleton.
-	 */
-	public synchronized static ComplexTypeDefinitionFactory getInstance() {
-		if (instance != null)
-			return instance;
-		instance = new ComplexTypeDefinitionFactory();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdAddress.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdAddress.java
deleted file mode 100644
index f6e8ddd..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdAddress.java
+++ /dev/null
@@ -1,71 +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
- *******************************************************************************/
-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 ADDRESS.
- */
-final class CtdAddress extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdAddress(ElementCollection elementCollection) {
-		super(elementCollection);
-	}
-
-	/**
-	 * ((%inline) | P)*.
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( | )*
-		content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
-		// (%inline)
-		CMGroupImpl inlines = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		if (inlines == null)
-			return;
-		collection.getInline(inlines);
-		content.appendChild(inlines);
-		// P
-		CMNode p = collection.getNamedItem(HTML40Namespace.ElementName.P);
-		if (p != null)
-			content.appendChild(p);
-	}
-
-	/**
-	 * ((%inline) | P)*.
-	 * Because %inline; contains #PCDATA, the type is MIXED.
-	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
-	 * those are defined in CMElementDeclaration.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.MIXED;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_ADDRESS;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdColumnGroup.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdColumnGroup.java
deleted file mode 100644
index d617708..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdColumnGroup.java
+++ /dev/null
@@ -1,69 +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
- *******************************************************************************/
-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;
-
-/**
- * COL group.
- * (COL)*
- */
-final class CtdColumnGroup extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdColumnGroup(ElementCollection elementCollection) {
-		super(elementCollection);
-	}
-
-	/**
-	 * (COL)*
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( )*
-		content = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
-		// COL
-		CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.COL);
-		if (dec != null)
-			content.appendChild(dec);
-	}
-
-	/**
-	 * (COL)*
-	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
-	 * those are defined in CMElementDeclaration.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.ELEMENT;
-	}
-
-	/**
-	 * Name of complex type definition.
-	 * Each singleton must know its own name.
-	 * All names should be defined in
-	 * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_COLUMN_GROUP;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDl.java
deleted file mode 100644
index 9e4a3e6..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDl.java
+++ /dev/null
@@ -1,69 +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
- *******************************************************************************/
-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 DL.
- */
-final class CtdDl extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdDl(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = HTML40Namespace.ElementName.DT;
-	}
-
-	/**
-	 * (DT | DD)+
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( | )+
-		content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
-		// DT
-		CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.DT);
-		if (dec != null)
-			content.appendChild(dec);
-		// DD
-		dec = collection.getNamedItem(HTML40Namespace.ElementName.DD);
-		if (dec != null)
-			content.appendChild(dec);
-	}
-
-	/**
-	 * (DT | DD)+.
-	 * @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_DEFINITION_LIST;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdEmbed.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdEmbed.java
deleted file mode 100644
index 86e9186..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdEmbed.java
+++ /dev/null
@@ -1,65 +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
- *******************************************************************************/
-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 EMBED.
- */
-final class CtdEmbed extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdEmbed(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = HTML40Namespace.ElementName.NOEMBED;
-	}
-
-	/**
-	 * (NOEMBED).
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( )
-		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-		// NOEMBED
-		CMNode noembed = collection.getNamedItem(HTML40Namespace.ElementName.NOEMBED);
-		if (noembed != null)
-			content.appendChild(noembed);
-	}
-
-	/**
-	 * (NOEMBED).
-	 * @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_EMBED;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFieldset.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFieldset.java
deleted file mode 100644
index bc9ed04..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFieldset.java
+++ /dev/null
@@ -1,74 +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
- *******************************************************************************/
-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 FIELDSET.
- */
-final class CtdFieldset extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdFieldset(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = HTML40Namespace.ElementName.LEGEND;
-	}
-
-	/**
-	 * (#PCDATA, LEGEND, (%flow;)*)
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( , , )
-		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-		// #PCDATA
-		// ...??
-
-		// LEGEND
-		CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.LEGEND);
-		if (dec != null)
-			content.appendChild(dec);
-		// (%flow;)*
-		CMGroupImpl flows = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
-		if (flows == null)
-			return;
-		collection.getFlow(flows);
-		content.appendChild(flows);
-	}
-
-	/**
-	 * (#PCDATA, LEGEND, (%flow;)*)
-	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
-	 * those are defined in CMElementDeclaration.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.MIXED;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_FIELDSET;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFlowContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFlowContainer.java
deleted file mode 100644
index b131398..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFlowContainer.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-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;
-
-/**
- * Complex type definition for containers of <code>%flow;</code>.
- */
-final class CtdFlowContainer extends ComplexTypeDefinition {
-
-	/**
-	 */
-	public CtdFlowContainer(ElementCollection elementCollection) {
-		super(elementCollection);
-	}
-
-	/**
-	 * (%flow;)*
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
-		collection.getFlow(content);
-	}
-
-	public int getContentType() {
-		return CMElementDeclaration.MIXED;
-	}
-
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_FLOW_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFrameset.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFrameset.java
deleted file mode 100644
index 7bd1076..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFrameset.java
+++ /dev/null
@@ -1,93 +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
- *******************************************************************************/
-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 FRAMESET.
- * ((FRAMESET | FRAME)+ & NOFRAMES?)
- */
-final class CtdFrameset extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdFrameset(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = HTML40Namespace.ElementName.FRAME;
-	}
-
-	/**
-	 * ((FRAMESET | FRAME)+ & NOFRAMES?).
-	 * --> ((FRAMESET | FRAME)+ & (NOFRAMES)?)
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( & )
-		content = new CMGroupImpl(CMGroup.ALL, 1, 1);
-
-		// ( | )+
-		CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
-		if (group == null)
-			return;
-		content.appendChild(group);
-
-		// FRAMESET
-		CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.FRAMESET);
-		if (dec != null)
-			group.appendChild(dec);
-		// FRAME
-		dec = collection.getNamedItem(HTML40Namespace.ElementName.FRAME);
-		if (dec != null)
-			group.appendChild(dec);
-
-		// ( )?
-		group = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
-		if (group == null)
-			return;
-		content.appendChild(group);
-
-		// NOFRAMES
-		dec = collection.getNamedItem(HTML40Namespace.ElementName.NOFRAMES);
-		if (dec != null)
-			group.appendChild(dec);
-	}
-
-	/**
-	 * ((FRAMESET | FRAME)+ & NOFRAMES?)
-	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
-	 * those are defined in CMElementDeclaration.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.ELEMENT;
-	}
-
-	/**
-	 * Name of complex type definition.
-	 * Each singleton must know its own name.
-	 * All names should be defined in
-	 * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_FRAMESET;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHead.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHead.java
deleted file mode 100644
index 8a68177..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHead.java
+++ /dev/null
@@ -1,175 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Complex type definition for the head content.
- * Content Model: (TITLE & ISINDEX? & BASE?)
- */
-final class CtdHead extends ComplexTypeDefinition {
-
-	/**
-	 */
-	public CtdHead(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = HTML40Namespace.ElementName.TITLE;
-	}
-
-	/**
-	 * for HEAD.
-	 * To avoid using inclusion, the content model comes from the XHTML 1.0.
-	 *
-	 * (%head.misc;, ((title, %head.misc;, (base, %head.misc;)?) | (base, %head.misc;, (title, %head.misc;))))
-	 * And %head.misc; is:
-	 * (script|style|meta|link|object|isindex)*
-	 *
-	 * 0: (%head.misc, A)
-	 * A: (B | C)
-	 * B: (title, %head.misc;, D)
-	 * C: (base, %head.misc;, E)
-	 * D: (base, %head.misc;)?
-	 * E: (title, %head.misc;)
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// At 1st, create %head.misc; content.
-		// %head.misc;
-		//   ( | )*
-		CMGroupImpl misc = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
-		if (misc == null)
-			return;
-		String[] names = {HTML40Namespace.ElementName.SCRIPT, HTML40Namespace.ElementName.STYLE, HTML40Namespace.ElementName.META, HTML40Namespace.ElementName.LINK, HTML40Namespace.ElementName.OBJECT, HTML40Namespace.ElementName.ISINDEX};
-		collection.getDeclarations(misc, Arrays.asList(names).iterator());
-		// 2nd, get a title
-		CMNode title = collection.getNamedItem(HTML40Namespace.ElementName.TITLE);
-		// 3rd, get a base
-		CMNode base = collection.getNamedItem(HTML40Namespace.ElementName.BASE);
-		if (title == null || base == null)
-			return;
-
-		// Top level content is a sequence of %head.misc; and A.
-		// 0: (%head.misc;, A)
-		//   create a sequence
-		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-		if (content == null)
-			return;
-		//   append %head.misc;
-		content.appendChild(misc);
-		//   create A and append it to the top level.
-		{
-			// A is a choice of B and C.
-			// A: (B | C)
-			//   create a choice
-			CMGroupImpl gA = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-			if (gA == null)
-				return;
-			//   append A to the top level.
-			content.appendChild(gA);
-
-			// create B and append it to A
-			{
-				// B is a sequence of title, %head.misc;, and D.
-				// B: (title, %head.misc;, D)
-				//   create a sequence
-				CMGroupImpl gB = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-				if (gB == null)
-					return;
-				//   append B to A.
-				gA.appendChild(gB);
-
-				//   append title to B
-				gB.appendChild(title);
-				//   append %head.misc; to B
-				gB.appendChild(misc);
-				//   create D and append it to B.
-				{
-					// D is a sequence of base, %head.misc;.
-					// D: (base, %head.misc;)?
-					//   create a sequence
-					CMGroupImpl gD = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
-					if (gD == null)
-						return;
-					//   append D to B.
-					gB.appendChild(gD);
-
-					//   append base to D
-					gD.appendChild(base);
-					//   append %head.misc; to D.
-					gD.appendChild(misc);
-				}
-			}
-			// create C and append it to A
-			{
-				// C is a sequence of base, %head.misc;, and E
-				// C: (base, %head.misc;, E)
-				//   create a sequence
-				CMGroupImpl gC = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-				if (gC == null)
-					return;
-				//   append C to A.
-				gA.appendChild(gC);
-
-				//   append base to C
-				gC.appendChild(base);
-				//   append %head.misc; to C
-				gC.appendChild(misc);
-
-				//   create E and append it to C.
-				{
-					// E is a sequence of title and %head.misc;.
-					// E: (title, %head.misc;)
-					//   create a sequence
-					CMGroupImpl gE = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-					if (gE == null)
-						return;
-					//   append E to C.
-					gC.appendChild(gE);
-
-					//   append title to E
-					gE.appendChild(title);
-					//   append %head.misc; to E.
-					gE.appendChild(misc);
-				}
-			}
-		}
-	}
-
-	/**
-	 * Element content.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.ELEMENT;
-	}
-
-	/**
-	 * Name of complex type definition.
-	 * Each singleton must know its own name.
-	 * All names should be defined in
-	 * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_HEAD;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 2cceaad..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java
+++ /dev/null
@@ -1,334 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Complex type definition for <code>HTML</code>.<br>
- * Content Model:
- * HEAD, (FRAMESET|BODY)<br>
- */
-final class CtdHtml extends ComplexTypeDefinition {
-
-	/**
-	 */
-	public CtdHtml(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = HTML40Namespace.ElementName.HEAD;
-	}
-
-	/**
-	 * (%html.content;).
-	 * %html.content; is HEAD, (FRAMESET | BODY).
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( )
-		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-		if (content == null)
-			return;
-
-		// HEAD
-		CMNode edec = collection.getNamedItem(HTML40Namespace.ElementName.HEAD);
-		if (edec != null)
-			content.appendChild(edec);
-
-		// ( | )
-		CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		content.appendChild(group);
-
-		// FRAMESET, BODY
-		String[] names = {HTML40Namespace.ElementName.FRAMESET, HTML40Namespace.ElementName.BODY};
-		collection.getDeclarations(group, Arrays.asList(names).iterator());
-
-		// since BODY start and end are omissable
-		// adding valid children of BODY here under HTML
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=97342
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.MAP);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.PRE);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.BDO);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.INPUT);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.P);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.NOSCRIPT);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.I);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.BUTTON);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.LABEL);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.U);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.H6);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.CENTER);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.BASEFONT);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.S);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.BLOCKQUOTE);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.H3);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.UL);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.B);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.SELECT);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.Q);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.STRIKE);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.SCRIPT);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.ABBR);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.BIG);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.H1);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.IMG);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.ACRONYM);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.DEL);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.NOFRAMES);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.TEXTAREA);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.H2);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.FONT);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.OBJECT);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.KBD);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.IFRAME);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.HR);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.H4);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.DIR);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.SAMP);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.INS);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.H5);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.SUP);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.A);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.DFN);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.ISINDEX);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.DL);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.VAR);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.FIELDSET);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.TABLE);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.BR);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.TT);
-		if (edec != null)
-			content.appendChild(edec);
-
-		edec = collection.getNamedItem(HTML40Namespace.ElementName.APPLET);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.OL);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.SMALL);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.CITE);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.FORM);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.DIV);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.CODE);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.SPAN);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.SUB);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.EM);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.MENU);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.ADDRESS);
-		if (edec != null)
-			content.appendChild(edec);
-
-	    edec = collection.getNamedItem(HTML40Namespace.ElementName.STRONG);
-		if (edec != null)
-			content.appendChild(edec);
-	}
-
-	/**
-	 * Element content.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.ELEMENT;
-	}
-
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_HTML;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdInlineContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdInlineContainer.java
deleted file mode 100644
index ad52c8b..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdInlineContainer.java
+++ /dev/null
@@ -1,50 +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
- *******************************************************************************/
-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;
-
-/**
- * Complex type definition for (%inline;)*.
- */
-final class CtdInlineContainer extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdInlineContainer(ElementCollection elementCollection) {
-		super(elementCollection);
-	}
-
-	/**
-	 * (%inline)*.
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
-		collection.getInline(content);
-	}
-
-	public int getContentType() {
-		return CMElementDeclaration.MIXED;
-	}
-
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_INLINE_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdLiContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdLiContainer.java
deleted file mode 100644
index aae68af..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdLiContainer.java
+++ /dev/null
@@ -1,69 +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
- *******************************************************************************/
-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;
-
-/**
- * List item container.
- * (LI)+
- */
-final class CtdLiContainer extends ComplexTypeDefinition {
-
-	/**
-	 * @param elemenCollection ElementCollection
-	 */
-	public CtdLiContainer(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = HTML40Namespace.ElementName.LI;
-	}
-
-	/**
-	 * (LI)+.
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// (LI)+
-		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
-		CMNode li = collection.getNamedItem(HTML40Namespace.ElementName.LI);
-		if (li != null)
-			content.appendChild(li);
-	}
-
-	/**
-	 * ELEMENT content.<br>
-	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
-	 * those are defined in CMElementDeclaration.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.ELEMENT;
-	}
-
-	/**
-	 * Name of complex type definition.
-	 * Each singleton must know its own name.
-	 * All names should be defined in
-	 * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_LI_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMap.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMap.java
deleted file mode 100644
index 83f9b72..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMap.java
+++ /dev/null
@@ -1,72 +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
- *******************************************************************************/
-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 MAP.
- */
-final class CtdMap extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdMap(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = HTML40Namespace.ElementName.AREA;
-	}
-
-	/**
-	 * ((%block;) | AREA)+.
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( | )+
-		content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
-		// (%block;)
-		CMGroupImpl blocks = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		if (blocks == null)
-			return;
-		collection.getBlock(blocks);
-		content.appendChild(blocks);
-		// AREA
-		CMNode area = collection.getNamedItem(HTML40Namespace.ElementName.AREA);
-		if (area != null)
-			content.appendChild(area);
-	}
-
-	/**
-	 * ((%block;) | AREA)+.
-	 * Because %block; consists of elements only, the type is ELEMENT.
-	 * @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_MAP;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdNoframesContent.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdNoframesContent.java
deleted file mode 100644
index f7ac09b..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdNoframesContent.java
+++ /dev/null
@@ -1,65 +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
- *******************************************************************************/
-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 NOFRAMES.
- */
-final class CtdNoframesContent extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdNoframesContent(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = HTML40Namespace.ElementName.BODY;
-	}
-
-	/**
-	 * (BODY).
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( )
-		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-		// BODY
-		CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.BODY);
-		if (dec != null)
-			content.appendChild(dec);
-	}
-
-	/**
-	 * (BODY)
-	 * @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_NOFRAMES_CONTENT;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdOptionContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdOptionContainer.java
deleted file mode 100644
index a772f17..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdOptionContainer.java
+++ /dev/null
@@ -1,70 +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
- *******************************************************************************/
-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;
-
-/**
- * OPTION container.
- * (OPTION)+
- */
-final class CtdOptionContainer extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdOptionContainer(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.SEQUENCE, 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;
-	}
-
-	/**
-	 * Name of complex type definition.
-	 * Each singleton must know its own name.
-	 * All names should be defined in
-	 * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_OPTION_CONTAINER;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index a82afb8..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java
+++ /dev/null
@@ -1,71 +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
- *******************************************************************************/
-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;
-
-/**
- * PARAM container.  For OBJECT and APPLET.
- */
-final class CtdParamContainer extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdParamContainer(ElementCollection elementCollection) {
-		super(elementCollection);
-	}
-
-	/**
-	 * (PARAM | %flow;)*.
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( | )*
-		content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
-		// PARAM
-		CMNode param = collection.getNamedItem(HTML40Namespace.ElementName.PARAM);
-		if (param != null)
-			content.appendChild(param);
-		// %flow;
-		CMGroupImpl flows = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		if (flows == null)
-			return;
-		collection.getInline(flows);
-		content.appendChild(flows);
-	}
-
-	/**
-	 * (PARAM | %flow;)*.
-	 * Because %flow; contains #PCDATA, the type is MIXED.
-	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
-	 * those are defined in CMElementDeclaration.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.MIXED;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_PARAM_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdSelect.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdSelect.java
deleted file mode 100644
index b7f6c09..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdSelect.java
+++ /dev/null
@@ -1,69 +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
- *******************************************************************************/
-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 SELECT.
- */
-final class CtdSelect extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdSelect(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = HTML40Namespace.ElementName.OPTION;
-	}
-
-	/**
-	 * (OPTGROUP | OPTION)+.
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( | )+
-		content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
-		// OPTGROUP
-		CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.OPTGROUP);
-		if (dec != null)
-			content.appendChild(dec);
-		// OPTION
-		dec = collection.getNamedItem(HTML40Namespace.ElementName.OPTION);
-		if (dec != null)
-			content.appendChild(dec);
-	}
-
-	/**
-	 * (OPTGROUP | 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_SELECT;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTable.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTable.java
deleted file mode 100644
index d056c8e..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTable.java
+++ /dev/null
@@ -1,140 +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
- *******************************************************************************/
-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 TABLE.
- * (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+, TR+)
- */
-final class CtdTable extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdTable(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = HTML40Namespace.ElementName.TBODY;
-	}
-
-	/**
-	 * (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)
-	 * --> ((CAPTION)?, ((COL)* | (COLGROUP)*), (THEAD)?, (TFOOT)?, (TBODY)+, (TR)+)
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( , , , ,)
-		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-
-		// (CAPTION)?
-		//     ( )?
-		CMGroupImpl wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
-		if (wrap == null)
-			return;
-		content.appendChild(wrap);
-		//     CAPTION
-		CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.CAPTION);
-		if (dec != null)
-			wrap.appendChild(dec);
-
-		// ((COL)* | (COLGROUP)*)
-		//     ( | )
-		CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		if (group == null)
-			return;
-		content.appendChild(group);
-		//         (COL)*
-		wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
-		if (wrap == null)
-			return;
-		group.appendChild(wrap);
-		dec = collection.getNamedItem(HTML40Namespace.ElementName.COL);
-		if (dec != null)
-			wrap.appendChild(dec);
-		//         (COLGROUP)*
-		wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
-		if (wrap == null)
-			return;
-		group.appendChild(wrap);
-		dec = collection.getNamedItem(HTML40Namespace.ElementName.COLGROUP);
-		if (dec != null)
-			wrap.appendChild(dec);
-
-		// (THEAD)?
-		wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
-		if (wrap == null)
-			return;
-		content.appendChild(wrap);
-		dec = collection.getNamedItem(HTML40Namespace.ElementName.THEAD);
-		if (dec != null)
-			wrap.appendChild(dec);
-
-		// (TFOOT)?
-		wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
-		if (wrap == null)
-			return;
-		content.appendChild(wrap);
-		dec = collection.getNamedItem(HTML40Namespace.ElementName.TFOOT);
-		if (dec != null)
-			wrap.appendChild(dec);
-
-		// (TBODY)+
-		// TBODY has optional start and end tags
-		wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
-		if (wrap == null)
-			return;
-		content.appendChild(wrap);
-		dec = collection.getNamedItem(HTML40Namespace.ElementName.TBODY);
-		if (dec != null)
-			wrap.appendChild(dec);
-
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=96101
-		// TBODY start and end tag are optional, so TR should be allowed here
-		// (TR)+
-		wrap = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
-		if (wrap == null)
-			return;
-		content.appendChild(wrap);
-		dec = collection.getNamedItem(HTML40Namespace.ElementName.TR);
-		if (dec != null)
-			wrap.appendChild(dec);
-	}
-
-	/**
-	 * ((FRAMESET | FRAME)+ & NOFRAMES?)
-	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
-	 * those are defined in CMElementDeclaration.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.ELEMENT;
-	}
-
-	/**
-	 * Name of complex type definition.
-	 * Each singleton must know its own name.
-	 * All names should be defined in
-	 * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_TABLE;
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTableCellContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTableCellContainer.java
deleted file mode 100644
index 40ddbc5..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTableCellContainer.java
+++ /dev/null
@@ -1,74 +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
- *******************************************************************************/
-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;
-
-/**
- * Table cell container.
- * (TH | TD)+
- */
-final class CtdTableCellContainer extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdTableCellContainer(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = HTML40Namespace.ElementName.TD;
-	}
-
-	/**
-	 * (TH | TD)+.
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( )+
-		content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
-		// TH
-		CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.TH);
-		if (dec != null)
-			content.appendChild(dec);
-		// TD
-		dec = collection.getNamedItem(HTML40Namespace.ElementName.TD);
-		if (dec != null)
-			content.appendChild(dec);
-	}
-
-	/**
-	 * (TH | TD)+
-	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
-	 * those are defined in CMElementDeclaration.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.ELEMENT;
-	}
-
-	/**
-	 * Name of complex type definition.
-	 * Each singleton must know its own name.
-	 * All names should be defined in
-	 * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_TCELL_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTrContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTrContainer.java
deleted file mode 100644
index 53adfc6..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTrContainer.java
+++ /dev/null
@@ -1,69 +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
- *******************************************************************************/
-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;
-
-/**
- * Table record container.
- * (TR)+
- */
-final class CtdTrContainer extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdTrContainer(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = HTML40Namespace.ElementName.TR;
-	}
-
-	/**
-	 * (TR)+.
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// (TR)+
-		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
-		CMNode tr = collection.getNamedItem(HTML40Namespace.ElementName.TR);
-		if (tr != null)
-			content.appendChild(tr);
-	}
-
-	/**
-	 * ELEMENT content.<br>
-	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
-	 * those are defined in CMElementDeclaration.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.ELEMENT;
-	}
-
-	/**
-	 * Name of complex type definition.
-	 * Each singleton must know its own name.
-	 * All names should be defined in
-	 * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_TR_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/DeclCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/DeclCollection.java
deleted file mode 100644
index e7ddee7..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/DeclCollection.java
+++ /dev/null
@@ -1,237 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- */
-abstract class DeclCollection implements CMNamedNodeMap {
-
-
-	protected class DualMap {
-		public DualMap() {
-			super();
-		}
-
-		public DualMap(Object[] objects) {
-			super();
-			initialize(objects);
-		}
-
-		public int size() {
-			return table.length;
-		}
-
-		public Object getValue(int key) {
-			if (!isValidIndex(key))
-				return null;
-			return table[key];
-		}
-
-		public int getKey(Object value) {
-			Integer keyObj = (Integer) map.get(value);
-			if (keyObj == null)
-				return ID_UNKNOWN;
-			return keyObj.intValue();
-		}
-
-		protected void initialize(Object[] objects) {
-			if (objects == null)
-				return;
-			table = objects;
-			map = new HashMap();
-			for (int key = 0; key < objects.length; key++) {
-				Object value = table[key];
-				map.put(value, new Integer(key));
-			}
-		}
-
-		private Object[] table = null;
-		private HashMap map = null;
-
-		private boolean isValidIndex(int index) {
-			return index >= 0 && index < table.length;
-		}
-	}
-
-	protected class TolerantStringDualMap extends DualMap {
-		public TolerantStringDualMap(String[] names) {
-			super();
-			Object[] objects = new Object[names.length];
-			for (int i = 0; i < names.length; i++) {
-				objects[i] = makeCanonicalForm(names[i]);
-			}
-			initialize(objects);
-		}
-
-		public int getKey(Object value) {
-			try {
-				String name = (String) value;
-				return super.getKey(makeCanonicalForm(name));
-			}
-			catch (ClassCastException e) {
-				return ID_UNKNOWN;
-			}
-		}
-
-		private String makeCanonicalForm(String raw) {
-			return raw.toUpperCase();
-		}
-	}
-
-	private class DeclIterator implements Iterator {
-		public DeclIterator() {
-			maxid = fDecls.length - 1;
-		}
-
-		public boolean hasNext() {
-			return id < maxid;
-		}
-
-		public Object next() {
-			if (!hasNext())
-				return null;
-			return item(++id);
-		}
-
-		public void remove() { /* nothing should be done. */
-		}
-
-		private int id = -1;
-		private int maxid = -1;
-	}
-
-	CMNode[] fDecls = null;
-	protected final static boolean STRICT_CASE = false;
-	protected final static boolean TOLERANT_CASE = true;
-	protected final static int ID_UNKNOWN = -1;
-	private DualMap fMap = null;
-
-	/**
-	 */
-	public DeclCollection(String[] names, boolean tolerant) {
-		super();
-		fDecls = new CMNode[names.length];
-		if (tolerant) {
-			fMap = new TolerantStringDualMap(names);
-		}
-		else {
-			fMap = new DualMap(names);
-		}
-	}
-
-	/**
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 * @param id int
-	 */
-	protected abstract CMNode create(String name);
-
-	/**
-	 */
-	public CMNamedNodeMap getDeclarations(String[] names) {
-		CMNamedNodeMapImpl map = new CMNamedNodeMapImpl();
-		for (int i = 0; i < names.length; i++) {
-			String name = names[i];
-			CMNode node = getNamedItem(name);
-			if (node == null)
-				continue;
-			map.putNamedItem(name, node);
-		}
-		return map;
-	}
-
-	/**
-	 * @param names java.util.Iterator
-	 */
-	public void getDeclarations(CMGroupImpl group, Iterator names) {
-		while (names.hasNext()) {
-			String entityName = (String) names.next();
-			CMNode dec = getNamedItem(entityName);
-			if (dec != null)
-				group.appendChild(dec);
-		}
-	}
-
-	/**
-	 * Map name to id.
-	 * @return int
-	 * @param name java.lang.String
-	 */
-	protected int getID(String name) {
-		return fMap.getKey(name);
-	}
-
-	/**
-	 * getLength method
-	 * @return int
-	 */
-	public int getLength() {
-		return fDecls.length;
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param id int
-	 */
-	protected String getName(int id) {
-		return (String) fMap.getValue(id);
-	}
-
-	/**
-	 * getNamedItem method
-	 * @return CMNode
-	 * @param name java.lang.String
-	 */
-	public CMNode getNamedItem(String name) {
-		int id = getID(name);
-		if (!isValidID(id))
-			return null;
-		return item(id);
-	}
-
-	/**
-	 * @return boolean
-	 * @param id int
-	 */
-	private boolean isValidID(int id) {
-		return id >= 0 && id < fDecls.length;
-	}
-
-	/**
-	 * item method
-	 * @return CMNode
-	 * @param index int
-	 */
-	public CMNode item(int index) {
-		if (!isValidID(index))
-			return null;
-		CMNode decl = fDecls[index];
-		if (decl != null)
-			return decl; // already exist.
-
-		decl = create(getName(index));
-		fDecls[index] = decl;
-		return decl;
-	}
-
-	/**
-	 */
-	public Iterator iterator() {
-		return new DeclIterator();
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 680bd39..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java
+++ /dev/null
@@ -1,881 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for element declarations.
- */
-final class ElementCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ElementName {
-
-
-	// Element IDs
-	private static class Ids {
-		public static final int ID_A = 0;
-		public static final int ID_ABBR = 1;
-		public static final int ID_ACRONYM = 2;
-		public static final int ID_ADDRESS = 3;
-		public static final int ID_APPLET = 4;
-		public static final int ID_AREA = 5;
-		public static final int ID_B = 6;
-		public static final int ID_BASE = 7;
-		public static final int ID_BASEFONT = 8;
-		public static final int ID_BDO = 9;
-		public static final int ID_BIG = 10;
-		public static final int ID_BLINK = 11;
-		public static final int ID_BLOCKQUOTE = 12;
-		public static final int ID_BODY = 13;
-		public static final int ID_BR = 14;
-		public static final int ID_BUTTON = 15;
-		public static final int ID_CAPTION = 16;
-		public static final int ID_CENTER = 17;
-		public static final int ID_CITE = 18;
-		public static final int ID_CODE = 19;
-		public static final int ID_COL = 20;
-		public static final int ID_COLGROUP = 21;
-		public static final int ID_DD = 22;
-		public static final int ID_DEL = 23;
-		public static final int ID_DFN = 24;
-		public static final int ID_DIR = 25;
-		public static final int ID_DIV = 26;
-		public static final int ID_DL = 27;
-		public static final int ID_DT = 28;
-		public static final int ID_EM = 29;
-		public static final int ID_EMBED = 30;
-		public static final int ID_FIELDSET = 31;
-		public static final int ID_FONT = 32;
-		public static final int ID_FORM = 33;
-		public static final int ID_FRAME = 34;
-		public static final int ID_FRAMESET = 35;
-		public static final int ID_H1 = 36;
-		public static final int ID_H2 = 37;
-		public static final int ID_H3 = 38;
-		public static final int ID_H4 = 39;
-		public static final int ID_H5 = 40;
-		public static final int ID_H6 = 41;
-		public static final int ID_HEAD = 42;
-		public static final int ID_HR = 43;
-		public static final int ID_HTML = 44;
-		public static final int ID_I = 45;
-		public static final int ID_IFRAME = 46;
-		public static final int ID_IMG = 47;
-		public static final int ID_INPUT = 48;
-		public static final int ID_INS = 49;
-		public static final int ID_ISINDEX = 50;
-		public static final int ID_KBD = 51;
-		public static final int ID_LABEL = 52;
-		public static final int ID_LEGEND = 53;
-		public static final int ID_LI = 54;
-		public static final int ID_LINK = 55;
-		public static final int ID_MAP = 56;
-		public static final int ID_MENU = 57;
-		public static final int ID_META = 58;
-		public static final int ID_NOEMBED = 59;
-		public static final int ID_NOFRAMES = 60;
-		public static final int ID_NOSCRIPT = 61;
-		public static final int ID_OBJECT = 62;
-		public static final int ID_OL = 63;
-		public static final int ID_OPTGROUP = 64;
-		public static final int ID_OPTION = 65;
-		public static final int ID_P = 66;
-		public static final int ID_PARAM = 67;
-		public static final int ID_PRE = 68;
-		public static final int ID_Q = 69;
-		public static final int ID_S = 70;
-		public static final int ID_SAMP = 71;
-		public static final int ID_SCRIPT = 72;
-		public static final int ID_SELECT = 73;
-		public static final int ID_SMALL = 74;
-		public static final int ID_SPAN = 75;
-		public static final int ID_STRIKE = 76;
-		public static final int ID_STRONG = 77;
-		public static final int ID_STYLE = 78;
-		public static final int ID_SUB = 79;
-		public static final int ID_SUP = 80;
-		public static final int ID_TABLE = 81;
-		public static final int ID_TBODY = 82;
-		public static final int ID_TD = 83;
-		public static final int ID_TEXTAREA = 84;
-		public static final int ID_TFOOT = 85;
-		public static final int ID_TH = 86;
-		public static final int ID_THEAD = 87;
-		public static final int ID_TITLE = 88;
-		public static final int ID_TR = 89;
-		public static final int ID_TT = 90;
-		public static final int ID_U = 91;
-		public static final int ID_UL = 92;
-		public static final int ID_VAR = 93;
-		public static final int ID_MARQUEE = 94;
-		public static final int ID_SSI_CONFIG = 95;
-		public static final int ID_SSI_ECHO = 96;
-		public static final int ID_SSI_EXEC = 97;
-		public static final int ID_SSI_FSIZE = 98;
-		public static final int ID_SSI_FLASTMOD = 99;
-		public static final int ID_SSI_INCLUDE = 100;
-		public static final int ID_SSI_PRINTENV = 101;
-		public static final int ID_SSI_SET = 102;
-		// <<D205513
-		public static final int ID_BGSOUND = 103;
-		public static final int ID_NOBR = 104;
-		public static final int ID_WBR = 105;
-
-		// 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 = Ids.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};
-	/** %phrase;.
-	 * EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE | ABBR | ACRONYM
-	 */
-	private static final String[] PHRASE = {EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, ACRONYM};
-	/** %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
-	};
-	/** %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};
-	private 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);
-		attributeCollection = collection;
-	}
-
-	/**
-	 * Actually creates HTMLElementDeclaration instance.
-	 * @return HTMLElementDeclaration
-	 */
-	protected CMNode create(String elementName) {
-		HTMLElemDeclImpl edec = null;
-
-		if (elementName.equalsIgnoreCase(A)) {
-			edec = new HedA(this);
-		}
-		else if (elementName.equalsIgnoreCase(ABBR)) {
-			edec = new HedPhrase(ABBR, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(ACRONYM)) {
-			edec = new HedPhrase(ACRONYM, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(ADDRESS)) {
-			edec = new HedADDRESS(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(APPLET)) {
-			edec = new HedAPPLET(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(AREA)) {
-			edec = new HedAREA(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(B)) {
-			edec = new HedFontStyle(B, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BASE)) {
-			edec = new HedBASE(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BASEFONT)) {
-			edec = new HedBASEFONT(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BDO)) {
-			edec = new HedBDO(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BIG)) {
-			edec = new HedFontStyle(BIG, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BLINK)) {
-			edec = new HedFontStyle(BLINK, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BLOCKQUOTE)) {
-			edec = new HedBLOCKQUOTE(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BODY)) {
-			edec = new HedBODY(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BR)) {
-			edec = new HedBR(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BUTTON)) {
-			edec = new HedBUTTON(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(CAPTION)) {
-			edec = new HedCAPTION(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(CENTER)) {
-			edec = new HedCENTER(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(CITE)) {
-			edec = new HedPhrase(CITE, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(CODE)) {
-			edec = new HedPhrase(CODE, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(COL)) {
-			edec = new HedCOL(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(COLGROUP)) {
-			edec = new HedCOLGROUP(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(DD)) {
-			edec = new HedDD(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(DEL)) {
-			edec = new HedMarkChanges(DEL, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(DFN)) {
-			edec = new HedPhrase(DFN, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(DIR)) {
-			edec = new HedMENU(DIR, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(DIV)) {
-			edec = new HedDIV(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(DL)) {
-			edec = new HedDL(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(DT)) {
-			edec = new HedDT(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(EM)) {
-			edec = new HedPhrase(EM, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(EMBED)) {
-			edec = new HedEMBED(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(FIELDSET)) {
-			edec = new HedFIELDSET(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(FONT)) {
-			edec = new HedFONT(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(FORM)) {
-			edec = new HedFORM(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(FRAME)) {
-			edec = new HedFRAME(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(FRAMESET)) {
-			edec = new HedFRAMESET(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(H1)) {
-			edec = new HedHeading(H1, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(H2)) {
-			edec = new HedHeading(H2, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(H3)) {
-			edec = new HedHeading(H3, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(H4)) {
-			edec = new HedHeading(H4, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(H5)) {
-			edec = new HedHeading(H5, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(H6)) {
-			edec = new HedHeading(H6, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(HEAD)) {
-			edec = new HedHEAD(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(HR)) {
-			edec = new HedHR(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(HTML)) {
-			edec = new HedHTML(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(I)) {
-			edec = new HedFontStyle(I, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(IFRAME)) {
-			edec = new HedIFRAME(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(IMG)) {
-			edec = new HedIMG(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(INPUT)) {
-			edec = new HedINPUT(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(INS)) {
-			edec = new HedMarkChanges(INS, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(ISINDEX)) {
-			edec = new HedISINDEX(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(KBD)) {
-			edec = new HedPhrase(KBD, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(LABEL)) {
-			edec = new HedLABEL(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(LEGEND)) {
-			edec = new HedLEGEND(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(LI)) {
-			edec = new HedLI(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(LINK)) {
-			edec = new HedLINK(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(MAP)) {
-			edec = new HedMAP(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(MARQUEE)) {
-			edec = new HedMARQUEE(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(MENU)) {
-			edec = new HedMENU(MENU, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(META)) {
-			edec = new HedMETA(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(NOEMBED)) {
-			edec = new HedNOEMBED(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(NOFRAMES)) {
-			edec = new HedNOFRAMES(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(NOSCRIPT)) {
-			edec = new HedNOSCRIPT(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(OBJECT)) {
-			edec = new HedOBJECT(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(OL)) {
-			edec = new HedOL(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(OPTGROUP)) {
-			edec = new HedOPTGROUP(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(OPTION)) {
-			edec = new HedOPTION(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(P)) {
-			edec = new HedP(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(PARAM)) {
-			edec = new HedPARAM(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(PRE)) {
-			edec = new HedPRE(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(Q)) {
-			edec = new HedQ(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(S)) {
-			edec = new HedFontStyle(S, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SAMP)) {
-			edec = new HedPhrase(SAMP, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SCRIPT)) {
-			edec = new HedSCRIPT(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SELECT)) {
-			edec = new HedSELECT(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SMALL)) {
-			edec = new HedFontStyle(SMALL, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SPAN)) {
-			edec = new HedSPAN(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(STRIKE)) {
-			edec = new HedFontStyle(STRIKE, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(STRONG)) {
-			edec = new HedPhrase(STRONG, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(STYLE)) {
-			edec = new HedSTYLE(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SUB)) {
-			edec = new HedScripts(SUB, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SUP)) {
-			edec = new HedScripts(SUP, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(TABLE)) {
-			edec = new HedTABLE(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(TBODY)) {
-			edec = new HedTableBody(TBODY, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(TD)) {
-			edec = new HedTableCell(TD, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(TEXTAREA)) {
-			edec = new HedTEXTAREA(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(TFOOT)) {
-			edec = new HedTableBody(TFOOT, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(TH)) {
-			edec = new HedTableCell(TH, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(THEAD)) {
-			edec = new HedTableBody(THEAD, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(TITLE)) {
-			edec = new HedTITLE(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(TR)) {
-			edec = new HedTR(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(TT)) {
-			edec = new HedFontStyle(TT, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(U)) {
-			edec = new HedFontStyle(U, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(UL)) {
-			edec = new HedUL(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(VAR)) {
-			edec = new HedPhrase(VAR, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_CONFIG)) {
-			edec = new HedSSIConfig(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_ECHO)) {
-			edec = new HedSSIEcho(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_EXEC)) {
-			edec = new HedSSIExec(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_FSIZE)) {
-			edec = new HedSSIFsize(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_FLASTMOD)) {
-			edec = new HedSSIFlastmod(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_INCLUDE)) {
-			edec = new HedSSIInclude(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_PRINTENV)) {
-			edec = new HedSSIPrintenv(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_SET)) {
-			edec = new HedSSISet(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BGSOUND)) {
-			edec = new HedBGSOUND(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(NOBR)) {
-			edec = new HedNOBR(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(WBR)) {
-			edec = new HedWBR(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 = null;
-		}
-		return edec;
-	}
-
-	public AttributeCollection getAttributeCollection() {
-		return attributeCollection;
-	}
-
-	public final 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};
-		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;
-	}
-
-	/**
-	 * %block;.
-	 * %block; is:
-	 * P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
-	 * NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
-	 * TABLE | FIELDSET | ADDRESS.<br>
-	 * @param group CMGroupImpl Return values.
-	 */
-	public final void getBlock(CMGroupImpl group) {
-		if (group == null)
-			return;
-		getDeclarations(group, getNamesOfBlock().iterator());
-	}
-
-	/**
-	 * Create element declarations and store them
-	 * into a <code>CMGroupImpl</code> instance.
-	 * @param group CMGroupImpl Return values.
-	 */
-	public final void getFlow(CMGroupImpl group) {
-		if (group == null)
-			return;
-		getBlock(group);
-		getInline(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());
-	}
-
-	/**
-	 * Create element declarations and store them
-	 * into a <code>CMGroupImpl</code> instance.
-	 * @param group CMGroupImpl Return values.
-	 */
-	public final void getInline(CMGroupImpl group) {
-		if (group == null)
-			return;
-		getFontstyle(group);
-		getPhrase(group);
-		getSpecial(group);
-		getFormctrl(group);
-	}
-
-	/**
-	 * %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());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/EntityCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/EntityCollection.java
deleted file mode 100644
index 350594f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/EntityCollection.java
+++ /dev/null
@@ -1,837 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.lang.reflect.Field;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for entity declarations.
- */
-final class EntityCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.EntityName {
-
-
-	private static class Ids {
-		public static final int ID_AACUTE_L = 0;
-		public static final int ID_AACUTE_U = 1;
-		public static final int ID_ACIRC_L = 2;
-		public static final int ID_ACIRC_U = 3;
-		public static final int ID_ACUTE = 4;
-		public static final int ID_AELIG_L = 5;
-		public static final int ID_AELIG_U = 6;
-		public static final int ID_AGRAVE_L = 7;
-		public static final int ID_AGRAVE_U = 8;
-		public static final int ID_ALEFSYM = 9;
-		public static final int ID_ALPHA_L = 10;
-		public static final int ID_ALPHA_U = 11;
-		public static final int ID_AMP = 12;
-		public static final int ID_AND = 13;
-		public static final int ID_ANG = 14;
-		public static final int ID_ARING_L = 15;
-		public static final int ID_ARING_U = 16;
-		public static final int ID_ASYMP = 17;
-		public static final int ID_ATILDE_L = 18;
-		public static final int ID_ATILDE_U = 19;
-		public static final int ID_AUML_L = 20;
-		public static final int ID_AUML_U = 21;
-		public static final int ID_BDQUO = 22;
-		public static final int ID_BETA_L = 23;
-		public static final int ID_BETA_U = 24;
-		public static final int ID_BRVBAR = 25;
-		public static final int ID_BULL = 26;
-		public static final int ID_CAP = 27;
-		public static final int ID_CCEDIL_L = 28;
-		public static final int ID_CCEDIL_U = 29;
-		public static final int ID_CEDIL = 30;
-		public static final int ID_CENT = 31;
-		public static final int ID_CHI_L = 32;
-		public static final int ID_CHI_U = 33;
-		public static final int ID_CIRC = 34;
-		public static final int ID_CLUBS = 35;
-		public static final int ID_CONG = 36;
-		public static final int ID_COPY = 37;
-		public static final int ID_CRARR = 38;
-		public static final int ID_CUP = 39;
-		public static final int ID_CURREN = 40;
-		public static final int ID_DAGGER_L = 41;
-		public static final int ID_DAGGER_U = 42;
-		public static final int ID_DARR_L = 43;
-		public static final int ID_DARR_U = 44;
-		public static final int ID_DEG = 45;
-		public static final int ID_DELTA_L = 46;
-		public static final int ID_DELTA_U = 47;
-		public static final int ID_DIAMS = 48;
-		public static final int ID_DIVIDE = 49;
-		public static final int ID_EACUTE_L = 50;
-		public static final int ID_EACUTE_U = 51;
-		public static final int ID_ECIRC_L = 52;
-		public static final int ID_ECIRC_U = 53;
-		public static final int ID_EGRAVE_L = 54;
-		public static final int ID_EGRAVE_U = 55;
-		public static final int ID_EMPTY = 56;
-		public static final int ID_EMSP = 57;
-		public static final int ID_ENSP = 58;
-		public static final int ID_EPSILON_L = 59;
-		public static final int ID_EPSILON_U = 60;
-		public static final int ID_EQUIV = 61;
-		public static final int ID_ETA_L = 62;
-		public static final int ID_ETA_U = 63;
-		public static final int ID_ETH_L = 64;
-		public static final int ID_ETH_U = 65;
-		public static final int ID_EUML_L = 66;
-		public static final int ID_EUML_U = 67;
-		public static final int ID_EURO = 68;
-		public static final int ID_EXIST = 69;
-		public static final int ID_FNOF = 70;
-		public static final int ID_FORALL = 71;
-		public static final int ID_FRAC12 = 72;
-		public static final int ID_FRAC14 = 73;
-		public static final int ID_FRAC34 = 74;
-		public static final int ID_FRASL = 75;
-		public static final int ID_GAMMA_L = 76;
-		public static final int ID_GAMMA_U = 77;
-		public static final int ID_GE = 78;
-		public static final int ID_GT = 79;
-		public static final int ID_HARR_L = 80;
-		public static final int ID_HARR_U = 81;
-		public static final int ID_HEARTS = 82;
-		public static final int ID_HELLIP = 83;
-		public static final int ID_IACUTE_L = 84;
-		public static final int ID_IACUTE_U = 85;
-		public static final int ID_ICIRC_L = 86;
-		public static final int ID_ICIRC_U = 87;
-		public static final int ID_IEXCL = 88;
-		public static final int ID_IGRAVE_L = 89;
-		public static final int ID_IGRAVE_U = 90;
-		public static final int ID_IMAGE = 91;
-		public static final int ID_INFIN = 92;
-		public static final int ID_INT = 93;
-		public static final int ID_IOTA_L = 94;
-		public static final int ID_IOTA_U = 95;
-		public static final int ID_IQUEST = 96;
-		public static final int ID_ISIN = 97;
-		public static final int ID_IUML_L = 98;
-		public static final int ID_IUML_U = 99;
-		public static final int ID_KAPPA_L = 100;
-		public static final int ID_KAPPA_U = 101;
-		public static final int ID_LAMBDA_L = 102;
-		public static final int ID_LAMBDA_U = 103;
-		public static final int ID_LANG = 104;
-		public static final int ID_LAQUO = 105;
-		public static final int ID_LARR_L = 106;
-		public static final int ID_LARR_U = 107;
-		public static final int ID_LCEIL = 108;
-		public static final int ID_LDQUO = 109;
-		public static final int ID_LE = 110;
-		public static final int ID_LFLOOR = 111;
-		public static final int ID_LOWAST = 112;
-		public static final int ID_LOZ = 113;
-		public static final int ID_LRM = 114;
-		public static final int ID_LSAQUO = 115;
-		public static final int ID_LSQUO = 116;
-		public static final int ID_LT = 117;
-		public static final int ID_MACR = 118;
-		public static final int ID_MDASH = 119;
-		public static final int ID_MICRO = 120;
-		public static final int ID_MIDDOT = 121;
-		public static final int ID_MINUS = 122;
-		public static final int ID_MU_L = 123;
-		public static final int ID_MU_U = 124;
-		public static final int ID_NABLA = 125;
-		public static final int ID_NBSP = 126;
-		public static final int ID_NDASH = 127;
-		public static final int ID_NE = 128;
-		public static final int ID_NI = 129;
-		public static final int ID_NOT = 130;
-		public static final int ID_NOTIN = 131;
-		public static final int ID_NSUB = 132;
-		public static final int ID_NTILDE_L = 133;
-		public static final int ID_NTILDE_U = 134;
-		public static final int ID_NU_L = 135;
-		public static final int ID_NU_U = 136;
-		public static final int ID_OACUTE_L = 137;
-		public static final int ID_OACUTE_U = 138;
-		public static final int ID_OCIRC_L = 139;
-		public static final int ID_OCIRC_U = 140;
-		public static final int ID_OELIG_L = 141;
-		public static final int ID_OELIG_U = 142;
-		public static final int ID_OGRAVE_L = 143;
-		public static final int ID_OGRAVE_U = 144;
-		public static final int ID_OLINE = 145;
-		public static final int ID_OMEGA_L = 146;
-		public static final int ID_OMEGA_U = 147;
-		public static final int ID_OMICRON_L = 148;
-		public static final int ID_OMICRON_U = 149;
-		public static final int ID_OPLUS = 150;
-		public static final int ID_OR = 151;
-		public static final int ID_ORDF = 152;
-		public static final int ID_ORDM = 153;
-		public static final int ID_OSLASH_L = 154;
-		public static final int ID_OSLASH_U = 155;
-		public static final int ID_OTILDE_L = 156;
-		public static final int ID_OTILDE_U = 157;
-		public static final int ID_OTIMES = 158;
-		public static final int ID_OUML_L = 159;
-		public static final int ID_OUML_U = 160;
-		public static final int ID_PARA = 161;
-		public static final int ID_PART = 162;
-		public static final int ID_PERMIL = 163;
-		public static final int ID_PERP = 164;
-		public static final int ID_PHI_L = 165;
-		public static final int ID_PHI_U = 166;
-		public static final int ID_PIV = 167;
-		public static final int ID_PI_L = 168;
-		public static final int ID_PI_U = 169;
-		public static final int ID_PLUSMN = 170;
-		public static final int ID_POUND = 171;
-		public static final int ID_PRIME_L = 172;
-		public static final int ID_PRIME_U = 173;
-		public static final int ID_PROD = 174;
-		public static final int ID_PROP = 175;
-		public static final int ID_PSI_L = 176;
-		public static final int ID_PSI_U = 177;
-		public static final int ID_QUOT = 178;
-		public static final int ID_RADIC = 179;
-		public static final int ID_RANG = 180;
-		public static final int ID_RAQUO = 181;
-		public static final int ID_RARR_L = 182;
-		public static final int ID_RARR_U = 183;
-		public static final int ID_RCEIL = 184;
-		public static final int ID_RDQUO = 185;
-		public static final int ID_REAL = 186;
-		public static final int ID_REG = 187;
-		public static final int ID_RFLOOR = 188;
-		public static final int ID_RHO_L = 189;
-		public static final int ID_RHO_U = 190;
-		public static final int ID_RLM = 191;
-		public static final int ID_RSAQUO = 192;
-		public static final int ID_RSQUO = 193;
-		public static final int ID_SBQUO = 194;
-		public static final int ID_SCARON_L = 195;
-		public static final int ID_SCARON_U = 196;
-		public static final int ID_SDOT = 197;
-		public static final int ID_SECT = 198;
-		public static final int ID_SHY = 199;
-		public static final int ID_SIGMAF = 200;
-		public static final int ID_SIGMA_L = 201;
-		public static final int ID_SIGMA_U = 202;
-		public static final int ID_SIM = 203;
-		public static final int ID_SPADES = 204;
-		public static final int ID_SUB = 205;
-		public static final int ID_SUBE = 206;
-		public static final int ID_SUM = 207;
-		public static final int ID_SUP = 208;
-		public static final int ID_SUP1 = 209;
-		public static final int ID_SUP2 = 210;
-		public static final int ID_SUP3 = 211;
-		public static final int ID_SUPE = 212;
-		public static final int ID_SZLIG = 213;
-		public static final int ID_TAU_L = 214;
-		public static final int ID_TAU_U = 215;
-		public static final int ID_THERE4 = 216;
-		public static final int ID_THETASYM = 217;
-		public static final int ID_THETA_L = 218;
-		public static final int ID_THETA_U = 219;
-		public static final int ID_THINSP = 220;
-		public static final int ID_THORN_L = 221;
-		public static final int ID_THORN_U = 222;
-		public static final int ID_TILDE = 223;
-		public static final int ID_TIMES = 224;
-		public static final int ID_TRADE = 225;
-		public static final int ID_UACUTE_L = 226;
-		public static final int ID_UACUTE_U = 227;
-		public static final int ID_UARR_L = 228;
-		public static final int ID_UARR_U = 229;
-		public static final int ID_UCIRC_L = 230;
-		public static final int ID_UCIRC_U = 231;
-		public static final int ID_UGRAVE_L = 232;
-		public static final int ID_UGRAVE_U = 233;
-		public static final int ID_UML = 234;
-		public static final int ID_UPSIH = 235;
-		public static final int ID_UPSILON_L = 236;
-		public static final int ID_UPSILON_U = 237;
-		public static final int ID_UUML_L = 238;
-		public static final int ID_UUML_U = 239;
-		public static final int ID_WEIERP = 240;
-		public static final int ID_XI_L = 241;
-		public static final int ID_XI_U = 242;
-		public static final int ID_YACUTE_L = 243;
-		public static final int ID_YACUTE_U = 244;
-		public static final int ID_YEN = 245;
-		public static final int ID_YUML_L = 246;
-		public static final int ID_YUML_U = 247;
-		public static final int ID_ZETA_L = 248;
-		public static final int ID_ZETA_U = 249;
-		public static final int ID_ZWJ = 250;
-		public static final int ID_ZWNJ = 251;
-
-		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 252.
-			// -- 5/24/2001
-			Class clazz = Ids.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;
-	}
-
-	private static String[] names = null;
-
-	static {
-		names = new String[Ids.getNumOfIds()];
-		names[Ids.ID_AACUTE_L] = AACUTE_L;
-		names[Ids.ID_AACUTE_U] = AACUTE_U;
-		names[Ids.ID_ACIRC_L] = ACIRC_L;
-		names[Ids.ID_ACIRC_U] = ACIRC_U;
-		names[Ids.ID_ACUTE] = ACUTE;
-		names[Ids.ID_AELIG_L] = AELIG_L;
-		names[Ids.ID_AELIG_U] = AELIG_U;
-		names[Ids.ID_AGRAVE_L] = AGRAVE_L;
-		names[Ids.ID_AGRAVE_U] = AGRAVE_U;
-		names[Ids.ID_ALEFSYM] = ALEFSYM;
-		names[Ids.ID_ALPHA_L] = ALPHA_L;
-		names[Ids.ID_ALPHA_U] = ALPHA_U;
-		names[Ids.ID_AMP] = AMP;
-		names[Ids.ID_AND] = AND;
-		names[Ids.ID_ANG] = ANG;
-		names[Ids.ID_ARING_L] = ARING_L;
-		names[Ids.ID_ARING_U] = ARING_U;
-		names[Ids.ID_ASYMP] = ASYMP;
-		names[Ids.ID_ATILDE_L] = ATILDE_L;
-		names[Ids.ID_ATILDE_U] = ATILDE_U;
-		names[Ids.ID_AUML_L] = AUML_L;
-		names[Ids.ID_AUML_U] = AUML_U;
-		names[Ids.ID_BDQUO] = BDQUO;
-		names[Ids.ID_BETA_L] = BETA_L;
-		names[Ids.ID_BETA_U] = BETA_U;
-		names[Ids.ID_BRVBAR] = BRVBAR;
-		names[Ids.ID_BULL] = BULL;
-		names[Ids.ID_CAP] = CAP;
-		names[Ids.ID_CCEDIL_L] = CCEDIL_L;
-		names[Ids.ID_CCEDIL_U] = CCEDIL_U;
-		names[Ids.ID_CEDIL] = CEDIL;
-		names[Ids.ID_CENT] = CENT;
-		names[Ids.ID_CHI_L] = CHI_L;
-		names[Ids.ID_CHI_U] = CHI_U;
-		names[Ids.ID_CIRC] = CIRC;
-		names[Ids.ID_CLUBS] = CLUBS;
-		names[Ids.ID_CONG] = CONG;
-		names[Ids.ID_COPY] = COPY;
-		names[Ids.ID_CRARR] = CRARR;
-		names[Ids.ID_CUP] = CUP;
-		names[Ids.ID_CURREN] = CURREN;
-		names[Ids.ID_DAGGER_L] = DAGGER_L;
-		names[Ids.ID_DAGGER_U] = DAGGER_U;
-		names[Ids.ID_DARR_L] = DARR_L;
-		names[Ids.ID_DARR_U] = DARR_U;
-		names[Ids.ID_DEG] = DEG;
-		names[Ids.ID_DELTA_L] = DELTA_L;
-		names[Ids.ID_DELTA_U] = DELTA_U;
-		names[Ids.ID_DIAMS] = DIAMS;
-		names[Ids.ID_DIVIDE] = DIVIDE;
-		names[Ids.ID_EACUTE_L] = EACUTE_L;
-		names[Ids.ID_EACUTE_U] = EACUTE_U;
-		names[Ids.ID_ECIRC_L] = ECIRC_L;
-		names[Ids.ID_ECIRC_U] = ECIRC_U;
-		names[Ids.ID_EGRAVE_L] = EGRAVE_L;
-		names[Ids.ID_EGRAVE_U] = EGRAVE_U;
-		names[Ids.ID_EMPTY] = EMPTY;
-		names[Ids.ID_EMSP] = EMSP;
-		names[Ids.ID_ENSP] = ENSP;
-		names[Ids.ID_EPSILON_L] = EPSILON_L;
-		names[Ids.ID_EPSILON_U] = EPSILON_U;
-		names[Ids.ID_EQUIV] = EQUIV;
-		names[Ids.ID_ETA_L] = ETA_L;
-		names[Ids.ID_ETA_U] = ETA_U;
-		names[Ids.ID_ETH_L] = ETH_L;
-		names[Ids.ID_ETH_U] = ETH_U;
-		names[Ids.ID_EUML_L] = EUML_L;
-		names[Ids.ID_EUML_U] = EUML_U;
-		names[Ids.ID_EURO] = EURO;
-		names[Ids.ID_EXIST] = EXIST;
-		names[Ids.ID_FNOF] = FNOF;
-		names[Ids.ID_FORALL] = FORALL;
-		names[Ids.ID_FRAC12] = FRAC12;
-		names[Ids.ID_FRAC14] = FRAC14;
-		names[Ids.ID_FRAC34] = FRAC34;
-		names[Ids.ID_FRASL] = FRASL;
-		names[Ids.ID_GAMMA_L] = GAMMA_L;
-		names[Ids.ID_GAMMA_U] = GAMMA_U;
-		names[Ids.ID_GE] = GE;
-		names[Ids.ID_GT] = GT;
-		names[Ids.ID_HARR_L] = HARR_L;
-		names[Ids.ID_HARR_U] = HARR_U;
-		names[Ids.ID_HEARTS] = HEARTS;
-		names[Ids.ID_HELLIP] = HELLIP;
-		names[Ids.ID_IACUTE_L] = IACUTE_L;
-		names[Ids.ID_IACUTE_U] = IACUTE_U;
-		names[Ids.ID_ICIRC_L] = ICIRC_L;
-		names[Ids.ID_ICIRC_U] = ICIRC_U;
-		names[Ids.ID_IEXCL] = IEXCL;
-		names[Ids.ID_IGRAVE_L] = IGRAVE_L;
-		names[Ids.ID_IGRAVE_U] = IGRAVE_U;
-		names[Ids.ID_IMAGE] = IMAGE;
-		names[Ids.ID_INFIN] = INFIN;
-		names[Ids.ID_INT] = INT;
-		names[Ids.ID_IOTA_L] = IOTA_L;
-		names[Ids.ID_IOTA_U] = IOTA_U;
-		names[Ids.ID_IQUEST] = IQUEST;
-		names[Ids.ID_ISIN] = ISIN;
-		names[Ids.ID_IUML_L] = IUML_L;
-		names[Ids.ID_IUML_U] = IUML_U;
-		names[Ids.ID_KAPPA_L] = KAPPA_L;
-		names[Ids.ID_KAPPA_U] = KAPPA_U;
-		names[Ids.ID_LAMBDA_L] = LAMBDA_L;
-		names[Ids.ID_LAMBDA_U] = LAMBDA_U;
-		names[Ids.ID_LANG] = LANG;
-		names[Ids.ID_LAQUO] = LAQUO;
-		names[Ids.ID_LARR_L] = LARR_L;
-		names[Ids.ID_LARR_U] = LARR_U;
-		names[Ids.ID_LCEIL] = LCEIL;
-		names[Ids.ID_LDQUO] = LDQUO;
-		names[Ids.ID_LE] = LE;
-		names[Ids.ID_LFLOOR] = LFLOOR;
-		names[Ids.ID_LOWAST] = LOWAST;
-		names[Ids.ID_LOZ] = LOZ;
-		names[Ids.ID_LRM] = LRM;
-		names[Ids.ID_LSAQUO] = LSAQUO;
-		names[Ids.ID_LSQUO] = LSQUO;
-		names[Ids.ID_LT] = LT;
-		names[Ids.ID_MACR] = MACR;
-		names[Ids.ID_MDASH] = MDASH;
-		names[Ids.ID_MICRO] = MICRO;
-		names[Ids.ID_MIDDOT] = MIDDOT;
-		names[Ids.ID_MINUS] = MINUS;
-		names[Ids.ID_MU_L] = MU_L;
-		names[Ids.ID_MU_U] = MU_U;
-		names[Ids.ID_NABLA] = NABLA;
-		names[Ids.ID_NBSP] = NBSP;
-		names[Ids.ID_NDASH] = NDASH;
-		names[Ids.ID_NE] = NE;
-		names[Ids.ID_NI] = NI;
-		names[Ids.ID_NOT] = NOT;
-		names[Ids.ID_NOTIN] = NOTIN;
-		names[Ids.ID_NSUB] = NSUB;
-		names[Ids.ID_NTILDE_L] = NTILDE_L;
-		names[Ids.ID_NTILDE_U] = NTILDE_U;
-		names[Ids.ID_NU_L] = NU_L;
-		names[Ids.ID_NU_U] = NU_U;
-		names[Ids.ID_OACUTE_L] = OACUTE_L;
-		names[Ids.ID_OACUTE_U] = OACUTE_U;
-		names[Ids.ID_OCIRC_L] = OCIRC_L;
-		names[Ids.ID_OCIRC_U] = OCIRC_U;
-		names[Ids.ID_OELIG_L] = OELIG_L;
-		names[Ids.ID_OELIG_U] = OELIG_U;
-		names[Ids.ID_OGRAVE_L] = OGRAVE_L;
-		names[Ids.ID_OGRAVE_U] = OGRAVE_U;
-		names[Ids.ID_OLINE] = OLINE;
-		names[Ids.ID_OMEGA_L] = OMEGA_L;
-		names[Ids.ID_OMEGA_U] = OMEGA_U;
-		names[Ids.ID_OMICRON_L] = OMICRON_L;
-		names[Ids.ID_OMICRON_U] = OMICRON_U;
-		names[Ids.ID_OPLUS] = OPLUS;
-		names[Ids.ID_OR] = OR;
-		names[Ids.ID_ORDF] = ORDF;
-		names[Ids.ID_ORDM] = ORDM;
-		names[Ids.ID_OSLASH_L] = OSLASH_L;
-		names[Ids.ID_OSLASH_U] = OSLASH_U;
-		names[Ids.ID_OTILDE_L] = OTILDE_L;
-		names[Ids.ID_OTILDE_U] = OTILDE_U;
-		names[Ids.ID_OTIMES] = OTIMES;
-		names[Ids.ID_OUML_L] = OUML_L;
-		names[Ids.ID_OUML_U] = OUML_U;
-		names[Ids.ID_PARA] = PARA;
-		names[Ids.ID_PART] = PART;
-		names[Ids.ID_PERMIL] = PERMIL;
-		names[Ids.ID_PERP] = PERP;
-		names[Ids.ID_PHI_L] = PHI_L;
-		names[Ids.ID_PHI_U] = PHI_U;
-		names[Ids.ID_PIV] = PIV;
-		names[Ids.ID_PI_L] = PI_L;
-		names[Ids.ID_PI_U] = PI_U;
-		names[Ids.ID_PLUSMN] = PLUSMN;
-		names[Ids.ID_POUND] = POUND;
-		names[Ids.ID_PRIME_L] = PRIME_L;
-		names[Ids.ID_PRIME_U] = PRIME_U;
-		names[Ids.ID_PROD] = PROD;
-		names[Ids.ID_PROP] = PROP;
-		names[Ids.ID_PSI_L] = PSI_L;
-		names[Ids.ID_PSI_U] = PSI_U;
-		names[Ids.ID_QUOT] = QUOT;
-		names[Ids.ID_RADIC] = RADIC;
-		names[Ids.ID_RANG] = RANG;
-		names[Ids.ID_RAQUO] = RAQUO;
-		names[Ids.ID_RARR_L] = RARR_L;
-		names[Ids.ID_RARR_U] = RARR_U;
-		names[Ids.ID_RCEIL] = RCEIL;
-		names[Ids.ID_RDQUO] = RDQUO;
-		names[Ids.ID_REAL] = REAL;
-		names[Ids.ID_REG] = REG;
-		names[Ids.ID_RFLOOR] = RFLOOR;
-		names[Ids.ID_RHO_L] = RHO_L;
-		names[Ids.ID_RHO_U] = RHO_U;
-		names[Ids.ID_RLM] = RLM;
-		names[Ids.ID_RSAQUO] = RSAQUO;
-		names[Ids.ID_RSQUO] = RSQUO;
-		names[Ids.ID_SBQUO] = SBQUO;
-		names[Ids.ID_SCARON_L] = SCARON_L;
-		names[Ids.ID_SCARON_U] = SCARON_U;
-		names[Ids.ID_SDOT] = SDOT;
-		names[Ids.ID_SECT] = SECT;
-		names[Ids.ID_SHY] = SHY;
-		names[Ids.ID_SIGMAF] = SIGMAF;
-		names[Ids.ID_SIGMA_L] = SIGMA_L;
-		names[Ids.ID_SIGMA_U] = SIGMA_U;
-		names[Ids.ID_SIM] = SIM;
-		names[Ids.ID_SPADES] = SPADES;
-		names[Ids.ID_SUB] = SUB;
-		names[Ids.ID_SUBE] = SUBE;
-		names[Ids.ID_SUM] = SUM;
-		names[Ids.ID_SUP] = SUP;
-		names[Ids.ID_SUP1] = SUP1;
-		names[Ids.ID_SUP2] = SUP2;
-		names[Ids.ID_SUP3] = SUP3;
-		names[Ids.ID_SUPE] = SUPE;
-		names[Ids.ID_SZLIG] = SZLIG;
-		names[Ids.ID_TAU_L] = TAU_L;
-		names[Ids.ID_TAU_U] = TAU_U;
-		names[Ids.ID_THERE4] = THERE4;
-		names[Ids.ID_THETASYM] = THETASYM;
-		names[Ids.ID_THETA_L] = THETA_L;
-		names[Ids.ID_THETA_U] = THETA_U;
-		names[Ids.ID_THINSP] = THINSP;
-		names[Ids.ID_THORN_L] = THORN_L;
-		names[Ids.ID_THORN_U] = THORN_U;
-		names[Ids.ID_TILDE] = TILDE;
-		names[Ids.ID_TIMES] = TIMES;
-		names[Ids.ID_TRADE] = TRADE;
-		names[Ids.ID_UACUTE_L] = UACUTE_L;
-		names[Ids.ID_UACUTE_U] = UACUTE_U;
-		names[Ids.ID_UARR_L] = UARR_L;
-		names[Ids.ID_UARR_U] = UARR_U;
-		names[Ids.ID_UCIRC_L] = UCIRC_L;
-		names[Ids.ID_UCIRC_U] = UCIRC_U;
-		names[Ids.ID_UGRAVE_L] = UGRAVE_L;
-		names[Ids.ID_UGRAVE_U] = UGRAVE_U;
-		names[Ids.ID_UML] = UML;
-		names[Ids.ID_UPSIH] = UPSIH;
-		names[Ids.ID_UPSILON_L] = UPSILON_L;
-		names[Ids.ID_UPSILON_U] = UPSILON_U;
-		names[Ids.ID_UUML_L] = UUML_L;
-		names[Ids.ID_UUML_U] = UUML_U;
-		names[Ids.ID_WEIERP] = WEIERP;
-		names[Ids.ID_XI_L] = XI_L;
-		names[Ids.ID_XI_U] = XI_U;
-		names[Ids.ID_YACUTE_L] = YACUTE_L;
-		names[Ids.ID_YACUTE_U] = YACUTE_U;
-		names[Ids.ID_YEN] = YEN;
-		names[Ids.ID_YUML_L] = YUML_L;
-		names[Ids.ID_YUML_U] = YUML_U;
-		names[Ids.ID_ZETA_L] = ZETA_L;
-		names[Ids.ID_ZETA_U] = ZETA_U;
-		names[Ids.ID_ZWJ] = ZWJ;
-		names[Ids.ID_ZWNJ] = ZWNJ;
-	}
-	private static char[] values = null;
-
-	static {
-		values = new char[Ids.getNumOfIds()];
-		values[Ids.ID_AACUTE_L] = 225;
-		values[Ids.ID_AACUTE_U] = 193;
-		values[Ids.ID_ACIRC_L] = 226;
-		values[Ids.ID_ACIRC_U] = 194;
-		values[Ids.ID_ACUTE] = 180;
-		values[Ids.ID_AELIG_L] = 230;
-		values[Ids.ID_AELIG_U] = 198;
-		values[Ids.ID_AGRAVE_L] = 224;
-		values[Ids.ID_AGRAVE_U] = 192;
-		values[Ids.ID_ALEFSYM] = 8501;
-		values[Ids.ID_ALPHA_L] = 945;
-		values[Ids.ID_ALPHA_U] = 913;
-		values[Ids.ID_AMP] = 38;
-		values[Ids.ID_AND] = 8743;
-		values[Ids.ID_ANG] = 8736;
-		values[Ids.ID_ARING_L] = 229;
-		values[Ids.ID_ARING_U] = 197;
-		values[Ids.ID_ASYMP] = 8776;
-		values[Ids.ID_ATILDE_L] = 227;
-		values[Ids.ID_ATILDE_U] = 195;
-		values[Ids.ID_AUML_L] = 228;
-		values[Ids.ID_AUML_U] = 196;
-		values[Ids.ID_BDQUO] = 8222;
-		values[Ids.ID_BETA_L] = 946;
-		values[Ids.ID_BETA_U] = 914;
-		values[Ids.ID_BRVBAR] = 166;
-		values[Ids.ID_BULL] = 8226;
-		values[Ids.ID_CAP] = 8745;
-		values[Ids.ID_CCEDIL_L] = 231;
-		values[Ids.ID_CCEDIL_U] = 199;
-		values[Ids.ID_CEDIL] = 184;
-		values[Ids.ID_CENT] = 162;
-		values[Ids.ID_CHI_L] = 967;
-		values[Ids.ID_CHI_U] = 935;
-		values[Ids.ID_CIRC] = 710;
-		values[Ids.ID_CLUBS] = 9827;
-		values[Ids.ID_CONG] = 8773;
-		values[Ids.ID_COPY] = 169;
-		values[Ids.ID_CRARR] = 8629;
-		values[Ids.ID_CUP] = 8746;
-		values[Ids.ID_CURREN] = 164;
-		values[Ids.ID_DAGGER_L] = 8224;
-		values[Ids.ID_DAGGER_U] = 8225;
-		values[Ids.ID_DARR_L] = 8595;
-		values[Ids.ID_DARR_U] = 8659;
-		values[Ids.ID_DEG] = 176;
-		values[Ids.ID_DELTA_L] = 948;
-		values[Ids.ID_DELTA_U] = 916;
-		values[Ids.ID_DIAMS] = 9830;
-		values[Ids.ID_DIVIDE] = 247;
-		values[Ids.ID_EACUTE_L] = 233;
-		values[Ids.ID_EACUTE_U] = 201;
-		values[Ids.ID_ECIRC_L] = 234;
-		values[Ids.ID_ECIRC_U] = 202;
-		values[Ids.ID_EGRAVE_L] = 232;
-		values[Ids.ID_EGRAVE_U] = 200;
-		values[Ids.ID_EMPTY] = 8709;
-		values[Ids.ID_EMSP] = 8195;
-		values[Ids.ID_ENSP] = 8194;
-		values[Ids.ID_EPSILON_L] = 949;
-		values[Ids.ID_EPSILON_U] = 917;
-		values[Ids.ID_EQUIV] = 8801;
-		values[Ids.ID_ETA_L] = 951;
-		values[Ids.ID_ETA_U] = 919;
-		values[Ids.ID_ETH_L] = 240;
-		values[Ids.ID_ETH_U] = 208;
-		values[Ids.ID_EUML_L] = 235;
-		values[Ids.ID_EUML_U] = 203;
-		values[Ids.ID_EURO] = 8364;
-		values[Ids.ID_EXIST] = 8707;
-		values[Ids.ID_FNOF] = 402;
-		values[Ids.ID_FORALL] = 8704;
-		values[Ids.ID_FRAC12] = 189;
-		values[Ids.ID_FRAC14] = 188;
-		values[Ids.ID_FRAC34] = 190;
-		values[Ids.ID_FRASL] = 8260;
-		values[Ids.ID_GAMMA_L] = 947;
-		values[Ids.ID_GAMMA_U] = 915;
-		values[Ids.ID_GE] = 8805;
-		values[Ids.ID_GT] = 62;
-		values[Ids.ID_HARR_L] = 8596;
-		values[Ids.ID_HARR_U] = 8660;
-		values[Ids.ID_HEARTS] = 9829;
-		values[Ids.ID_HELLIP] = 8230;
-		values[Ids.ID_IACUTE_L] = 237;
-		values[Ids.ID_IACUTE_U] = 205;
-		values[Ids.ID_ICIRC_L] = 238;
-		values[Ids.ID_ICIRC_U] = 206;
-		values[Ids.ID_IEXCL] = 161;
-		values[Ids.ID_IGRAVE_L] = 236;
-		values[Ids.ID_IGRAVE_U] = 204;
-		values[Ids.ID_IMAGE] = 8465;
-		values[Ids.ID_INFIN] = 8734;
-		values[Ids.ID_INT] = 8747;
-		values[Ids.ID_IOTA_L] = 953;
-		values[Ids.ID_IOTA_U] = 921;
-		values[Ids.ID_IQUEST] = 191;
-		values[Ids.ID_ISIN] = 8712;
-		values[Ids.ID_IUML_L] = 239;
-		values[Ids.ID_IUML_U] = 207;
-		values[Ids.ID_KAPPA_L] = 954;
-		values[Ids.ID_KAPPA_U] = 922;
-		values[Ids.ID_LAMBDA_L] = 955;
-		values[Ids.ID_LAMBDA_U] = 923;
-		values[Ids.ID_LANG] = 9001;
-		values[Ids.ID_LAQUO] = 171;
-		values[Ids.ID_LARR_L] = 8592;
-		values[Ids.ID_LARR_U] = 8656;
-		values[Ids.ID_LCEIL] = 8968;
-		values[Ids.ID_LDQUO] = 8220;
-		values[Ids.ID_LE] = 8804;
-		values[Ids.ID_LFLOOR] = 8970;
-		values[Ids.ID_LOWAST] = 8727;
-		values[Ids.ID_LOZ] = 9674;
-		values[Ids.ID_LRM] = 8206;
-		values[Ids.ID_LSAQUO] = 8249;
-		values[Ids.ID_LSQUO] = 8216;
-		values[Ids.ID_LT] = 60;
-		values[Ids.ID_MACR] = 175;
-		values[Ids.ID_MDASH] = 8212;
-		values[Ids.ID_MICRO] = 181;
-		values[Ids.ID_MIDDOT] = 183;
-		values[Ids.ID_MINUS] = 8722;
-		values[Ids.ID_MU_L] = 956;
-		values[Ids.ID_MU_U] = 924;
-		values[Ids.ID_NABLA] = 8711;
-		values[Ids.ID_NBSP] = 160;
-		values[Ids.ID_NDASH] = 8211;
-		values[Ids.ID_NE] = 8800;
-		values[Ids.ID_NI] = 8715;
-		values[Ids.ID_NOT] = 172;
-		values[Ids.ID_NOTIN] = 8713;
-		values[Ids.ID_NSUB] = 8836;
-		values[Ids.ID_NTILDE_L] = 241;
-		values[Ids.ID_NTILDE_U] = 209;
-		values[Ids.ID_NU_L] = 957;
-		values[Ids.ID_NU_U] = 925;
-		values[Ids.ID_OACUTE_L] = 243;
-		values[Ids.ID_OACUTE_U] = 211;
-		values[Ids.ID_OCIRC_L] = 244;
-		values[Ids.ID_OCIRC_U] = 212;
-		values[Ids.ID_OELIG_L] = 339;
-		values[Ids.ID_OELIG_U] = 338;
-		values[Ids.ID_OGRAVE_L] = 242;
-		values[Ids.ID_OGRAVE_U] = 210;
-		values[Ids.ID_OLINE] = 8254;
-		values[Ids.ID_OMEGA_L] = 969;
-		values[Ids.ID_OMEGA_U] = 937;
-		values[Ids.ID_OMICRON_L] = 959;
-		values[Ids.ID_OMICRON_U] = 927;
-		values[Ids.ID_OPLUS] = 8853;
-		values[Ids.ID_OR] = 8744;
-		values[Ids.ID_ORDF] = 170;
-		values[Ids.ID_ORDM] = 186;
-		values[Ids.ID_OSLASH_L] = 248;
-		values[Ids.ID_OSLASH_U] = 216;
-		values[Ids.ID_OTILDE_L] = 245;
-		values[Ids.ID_OTILDE_U] = 213;
-		values[Ids.ID_OTIMES] = 8855;
-		values[Ids.ID_OUML_L] = 246;
-		values[Ids.ID_OUML_U] = 214;
-		values[Ids.ID_PARA] = 182;
-		values[Ids.ID_PART] = 8706;
-		values[Ids.ID_PERMIL] = 8240;
-		values[Ids.ID_PERP] = 8869;
-		values[Ids.ID_PHI_L] = 966;
-		values[Ids.ID_PHI_U] = 934;
-		values[Ids.ID_PIV] = 982;
-		values[Ids.ID_PI_L] = 960;
-		values[Ids.ID_PI_U] = 928;
-		values[Ids.ID_PLUSMN] = 177;
-		values[Ids.ID_POUND] = 163;
-		values[Ids.ID_PRIME_L] = 8242;
-		values[Ids.ID_PRIME_U] = 8243;
-		values[Ids.ID_PROD] = 8719;
-		values[Ids.ID_PROP] = 8733;
-		values[Ids.ID_PSI_L] = 968;
-		values[Ids.ID_PSI_U] = 936;
-		values[Ids.ID_QUOT] = 34;
-		values[Ids.ID_RADIC] = 8730;
-		values[Ids.ID_RANG] = 9002;
-		values[Ids.ID_RAQUO] = 187;
-		values[Ids.ID_RARR_L] = 8594;
-		values[Ids.ID_RARR_U] = 8658;
-		values[Ids.ID_RCEIL] = 8969;
-		values[Ids.ID_RDQUO] = 8221;
-		values[Ids.ID_REAL] = 8476;
-		values[Ids.ID_REG] = 174;
-		values[Ids.ID_RFLOOR] = 8971;
-		values[Ids.ID_RHO_L] = 961;
-		values[Ids.ID_RHO_U] = 929;
-		values[Ids.ID_RLM] = 8207;
-		values[Ids.ID_RSAQUO] = 8250;
-		values[Ids.ID_RSQUO] = 8217;
-		values[Ids.ID_SBQUO] = 8218;
-		values[Ids.ID_SCARON_L] = 353;
-		values[Ids.ID_SCARON_U] = 352;
-		values[Ids.ID_SDOT] = 8901;
-		values[Ids.ID_SECT] = 167;
-		values[Ids.ID_SHY] = 173;
-		values[Ids.ID_SIGMAF] = 962;
-		values[Ids.ID_SIGMA_L] = 963;
-		values[Ids.ID_SIGMA_U] = 931;
-		values[Ids.ID_SIM] = 8764;
-		values[Ids.ID_SPADES] = 9824;
-		values[Ids.ID_SUB] = 8834;
-		values[Ids.ID_SUBE] = 8838;
-		values[Ids.ID_SUM] = 8721;
-		values[Ids.ID_SUP] = 8835;
-		values[Ids.ID_SUP1] = 185;
-		values[Ids.ID_SUP2] = 178;
-		values[Ids.ID_SUP3] = 179;
-		values[Ids.ID_SUPE] = 8839;
-		values[Ids.ID_SZLIG] = 223;
-		values[Ids.ID_TAU_L] = 964;
-		values[Ids.ID_TAU_U] = 932;
-		values[Ids.ID_THERE4] = 8756;
-		values[Ids.ID_THETASYM] = 977;
-		values[Ids.ID_THETA_L] = 952;
-		values[Ids.ID_THETA_U] = 920;
-		values[Ids.ID_THINSP] = 8201;
-		values[Ids.ID_THORN_L] = 254;
-		values[Ids.ID_THORN_U] = 222;
-		values[Ids.ID_TILDE] = 732;
-		values[Ids.ID_TIMES] = 215;
-		values[Ids.ID_TRADE] = 8482;
-		values[Ids.ID_UACUTE_L] = 250;
-		values[Ids.ID_UACUTE_U] = 218;
-		values[Ids.ID_UARR_L] = 8593;
-		values[Ids.ID_UARR_U] = 8657;
-		values[Ids.ID_UCIRC_L] = 251;
-		values[Ids.ID_UCIRC_U] = 219;
-		values[Ids.ID_UGRAVE_L] = 249;
-		values[Ids.ID_UGRAVE_U] = 217;
-		values[Ids.ID_UML] = 168;
-		values[Ids.ID_UPSIH] = 978;
-		values[Ids.ID_UPSILON_L] = 965;
-		values[Ids.ID_UPSILON_U] = 933;
-		values[Ids.ID_UUML_L] = 252;
-		values[Ids.ID_UUML_U] = 220;
-		values[Ids.ID_WEIERP] = 8472;
-		values[Ids.ID_XI_L] = 958;
-		values[Ids.ID_XI_U] = 926;
-		values[Ids.ID_YACUTE_L] = 253;
-		values[Ids.ID_YACUTE_U] = 221;
-		values[Ids.ID_YEN] = 165;
-		values[Ids.ID_YUML_L] = 255;
-		values[Ids.ID_YUML_U] = 376;
-		values[Ids.ID_ZETA_L] = 950;
-		values[Ids.ID_ZETA_U] = 918;
-		values[Ids.ID_ZWJ] = 8205;
-		values[Ids.ID_ZWNJ] = 8204;
-	}
-
-	/**
-	 */
-	public EntityCollection() {
-		super(names, STRICT_CASE);
-	}
-
-	/**
-	 * Create an entity declaration.
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 * @param attrName java.lang.String
-	 */
-	protected CMNode create(String entityName) {
-		int id = getID(entityName);
-		if (id == ID_UNKNOWN)
-			return null;
-
-		String value = String.valueOf(values[id]);
-		HTMLEntityDeclImpl dec = new HTMLEntityDeclImpl(entityName, value);
-
-		return dec;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HCMDocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HCMDocImpl.java
deleted file mode 100644
index daef5ce..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HCMDocImpl.java
+++ /dev/null
@@ -1,83 +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
- *******************************************************************************/
-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 HCMDocImpl extends CMNodeImpl implements HTMLCMDocument {
-
-	/** Namespace for all names of elements, entities and attributes. */
-	private CMNamespaceImpl namespace = null;
-	private ElementCollection elements = null;
-	private EntityCollection entities = null;
-	private AttributeCollection attributes = null;
-
-	/**
-	 */
-	public HCMDocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
-		super(docTypeName);
-		namespace = targetNamespace;
-		attributes = new AttributeCollection();
-		elements = new ElementCollection(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;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index c03b2ec..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java
+++ /dev/null
@@ -1,122 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Implementation class of {@link <code>HTMLAttributeDeclaration</code>} interface.<br>
- */
-class HTMLAttrDeclImpl extends CMNodeImpl implements HTMLAttributeDeclaration {
-
-	private HTMLCMDataTypeImpl type = null;
-	private int usage = 0;
-
-	/**
-	 */
-	public HTMLAttrDeclImpl(String attrName, HTMLCMDataTypeImpl valueType, int valueUsage) {
-		super(attrName);
-		this.type = valueType;
-
-		switch (valueUsage) {
-			case OPTIONAL :
-			case REQUIRED :
-			case FIXED :
-			case PROHIBITED :
-				this.usage = valueUsage;
-				break;
-			default :
-				// should warn...
-				this.usage = OPTIONAL; // fall back
-				break;
-		}
-	}
-
-	/**
-	 * getAttrName method
-	 * @return java.lang.String
-	 */
-	public String getAttrName() {
-		return getNodeName();
-	}
-
-	/**
-	 * getAttrType method
-	 * @return CMDataType
-	 */
-	public CMDataType getAttrType() {
-		return type;
-	}
-
-	/**
-	 * @deprecated by superinterface
-	 */
-	public String getDefaultValue() {
-		if (type.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_DEFAULT)
-			return null;
-		return type.getImpliedValue();
-	}
-
-	/**
-	 * @deprecated by superinterface
-	 */
-	public Enumeration getEnumAttr() {
-		Vector v = new Vector(Arrays.asList(type.getEnumeratedValues()));
-		return v.elements();
-	}
-
-	/**
-	 * getNodeType method
-	 * @return int
-	 *
-	 * Returns one of :
-	 * ELEMENT_DECLARATION, ATTRIBUTE_DECLARATION, GROUP, ENTITY_DECLARATION.
-	 */
-	public int getNodeType() {
-		return CMNode.ATTRIBUTE_DECLARATION;
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getUsage() {
-		return usage;
-	}
-
-	/**
-	 */
-	public boolean supports(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
-			return true;
-		else if (propertyName.equals(HTMLCMProperties.IS_SCRIPTABLE))
-			return true;
-		return super.supports(propertyName);
-	}
-
-	/**
-	 */
-	public Object getProperty(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
-			return new Boolean(true);
-		else if (propertyName.equals(HTMLCMProperties.IS_SCRIPTABLE)) {
-			return getAttrType().getDataTypeName() == HTMLCMDataType.SCRIPT ? new Boolean(true) : new Boolean(false);
-		}
-		return super.getProperty(propertyName);
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 1bff6f6..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java
+++ /dev/null
@@ -1,24 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-
-
-/**
- * This interface is intended to be a public interface which has
- * interfaces defined in both of {@link <code>CMAttributeDeclaration</code>}
- * and {@link <code>HTMLCMNode</code>}.<br>
- */
-public interface HTMLAttributeDeclaration extends CMAttributeDeclaration {
-
-}
\ No newline at end of file
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
deleted file mode 100644
index 34361dd..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java
+++ /dev/null
@@ -1,66 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * HTML extension for data types.
- */
-public interface HTMLCMDataType extends CMDataType {
-
-	/** Boolean; it should be defined in CMDataType. */
-	public static final String BOOLEAN = "BOOLEAN"; //$NON-NLS-1$
-	public static final String COLOR = "COLOR"; //$NON-NLS-1$
-	public static final String EVENT = "EVENT"; //$NON-NLS-1$
-	public static final String IDREFS = "IDREFS"; //$NON-NLS-1$
-	/** Name; it should be defined in CMDataType. */
-	public static final String NAME = "NAME"; //$NON-NLS-1$
-	// Following types are just aliases.
-	/** %Character; == CDATA */
-	public static final String CHARACTER = CMDataType.CDATA;
-	/** %Charset; == CDATA */
-	public static final String CHARSET = CMDataType.CDATA;
-	/** %Charsets; == CDATA */
-	public static final String CHARSETS = CMDataType.CDATA;
-	/** %ContentType; == CDATA */
-	public static final String CONTENT_TYPE = CMDataType.CDATA;
-	/** %Coords; == CDATA */
-	public static final String COORDS = CMDataType.CDATA;
-	/** %Datetime; == CDATA */
-	public static final String DATETIME = CMDataType.CDATA;
-	/** %FrameTarget; == CDATA */
-	public static final String FRAME_TARGET = CMDataType.CDATA;
-	/** %LanguageCode; == NAME */
-	public static final String LANGUAGE_CODE = NAME;
-	/** %Length; == CDATA */
-	public static final String LENGTH = CMDataType.CDATA;
-	/** %LinkTypes; == CDATA */
-	public static final String LINK_TYPES = CMDataType.CDATA;
-	/** %LIStyle; == CDATA */
-	public static final String LI_STYLE = CMDataType.CDATA;
-	/** %MediaDesc; == CDATA */
-	public static final String MEDIA_DESC = CMDataType.CDATA;
-	/** %MultiLength; == CDATA */
-	public static final String MULTI_LENGTH = CMDataType.CDATA;
-	/** %OLStyle; == CDATA */
-	public static final String OL_STYLE = CMDataType.CDATA;
-	/** %Pixles; == CDATA */
-	public static final String PIXELS = CMDataType.CDATA;
-	/** %Script; == EVENT */
-	public static final String SCRIPT = EVENT;
-	/** %StyleSheet; == EVENT */
-	public static final String STYLE_SHEET = CMDataType.CDATA;
-	/** %Text; == CDATA */
-	public static final String TEXT = CMDataType.CDATA;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataTypeImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataTypeImpl.java
deleted file mode 100644
index fe6e688..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataTypeImpl.java
+++ /dev/null
@@ -1,125 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-class HTMLCMDataTypeImpl extends CMNodeImpl implements HTMLCMDataType {
-
-	private int impliedValueKind = IMPLIED_VALUE_NONE;
-	private String impliedValue = null;
-	private final static String[] emptyArray = new String[0];
-	private String[] enumValues = emptyArray;
-	private String instanceValue = null;
-
-	/**
-	 * HTMLCMDataTypeImpl constructor comment.
-	 * @param nm java.lang.String
-	 */
-	public HTMLCMDataTypeImpl(String typeName) {
-		super(typeName);
-	}
-
-	/**
-	 * HTMLCMDataTypeImpl constructor comment.
-	 * @param nm java.lang.String
-	 */
-	public HTMLCMDataTypeImpl(String typeName, String instanceValue) {
-		super(typeName);
-		this.instanceValue = instanceValue;
-	}
-
-	/**
-	 * 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.
-	 */
-	public String generateInstanceValue() {
-		return instanceValue;
-	}
-
-	/**
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDataType
-	 */
-	public String getDataTypeName() {
-		return getNodeName();
-	}
-
-	/**
-	 * getTypeName method
-	 * @return java.lang.String[]
-	 *
-	 */
-	public String[] getEnumeratedValues() {
-		return enumValues;
-	}
-
-	/**
-	 * getTypeName method
-	 * @return java.lang.String  
-	 *
-	 * Returns the implied value or null if none exists.
-	 */
-	public String getImpliedValue() {
-		return impliedValue;
-	}
-
-	/**
-	 * getImpliedValueKind method
-	 * @return int
-	 *
-	 * Returns one of :
-	 * IMPLIED_VALUE_NONE, IMPLIED_VALUE_FIXED, IMPLIED_VALUE_DEFAULT.
-	 */
-	public int getImpliedValueKind() {
-		return impliedValueKind;
-	}
-
-	/**
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 */
-	public int getNodeType() {
-		return CMNode.DATA_TYPE;
-	}
-
-	/**
-	 */
-	void setEnumValues(String[] values) {
-		enumValues = new String[values.length];
-		for (int i = 0; i < values.length; i++) {
-			enumValues[i] = values[i];
-		}
-	}
-
-	/**
-	 * package scope.
-	 */
-	void setImpliedValue(int kind, String value) {
-		switch (kind) {
-			case IMPLIED_VALUE_FIXED :
-			case IMPLIED_VALUE_DEFAULT :
-				impliedValueKind = kind;
-				impliedValue = value;
-				break;
-			case IMPLIED_VALUE_NONE :
-			default :
-				impliedValueKind = IMPLIED_VALUE_NONE;
-				impliedValue = null; // maybe a null string?
-				break;
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocument.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocument.java
deleted file mode 100644
index 1af5fa2..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocument.java
+++ /dev/null
@@ -1,35 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-
-
-/**
- * HTML extension for CMDocument.
- * This interface provides some short hand methods to get declarations
- * by a name.
- */
-public interface HTMLCMDocument extends CMDocument {
-
-	/**
-	 * A short hand method to get a element declaration for a HTML element.<br>
-	 * @param elementName java.lang.String
-	 */
-	HTMLElementDeclaration getElementDeclaration(String elementName);
-
-	/**
-	 * A short hand method to get a entity declaration of HTML documents.<br>
-	 * @param entityName java.lang.String
-	 */
-	HTMLEntityDeclaration getEntityDeclaration(String entityName);
-}
\ No newline at end of file
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
deleted file mode 100644
index 18e901e..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java
+++ /dev/null
@@ -1,60 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.html.core.internal.contentmodel.chtml.CHCMDocImpl;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- * INodeAdapter factory for HTML and JSP documents.
- */
-public final class HTMLCMDocumentFactory {
-
-	private static Hashtable cmdocs = new Hashtable();
-
-	static {
-		CMNamespaceImpl h40ns = new CMNamespaceImpl(HTML40Namespace.HTML40_URI, HTML40Namespace.HTML40_TAG_PREFIX);
-		CMNamespaceImpl j11ns = new CMNamespaceImpl(JSP11Namespace.JSP11_URI, JSP11Namespace.JSP_TAG_PREFIX);
-
-		HCMDocImpl html40doc = new HCMDocImpl(CMDocType.HTML_DOC_TYPE, h40ns);
-		CHCMDocImpl chtmldoc = new CHCMDocImpl(CMDocType.CHTML_DOC_TYPE, h40ns);
-		JCMDocImpl jsp11doc = new JCMDocImpl(CMDocType.JSP11_DOC_TYPE, j11ns);
-
-		cmdocs.put(CMDocType.HTML_DOC_TYPE, html40doc);
-		cmdocs.put(CMDocType.CHTML_DOC_TYPE, chtmldoc);
-		cmdocs.put(CMDocType.JSP11_DOC_TYPE, jsp11doc);
-	}
-
-	/**
-	 * HTMLCMAdapterFactory constructor.
-	 */
-	private HTMLCMDocumentFactory() {
-		super();
-	}
-
-	/**
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
-	 * @param cmtype java.lang.String
-	 */
-	public static CMDocument getCMDocument(String cmtype) {
-		Object obj = cmdocs.get(cmtype);
-		if (obj == null)
-			return null;
-
-		return (CMDocument) obj;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMNode.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMNode.java
deleted file mode 100644
index 8538731..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMNode.java
+++ /dev/null
@@ -1,32 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-/**
- * In HTML Documents, name and value of an attribute/element/entity
- * should be treated ignoring theirs case.  However, in XML documents,
- * they should be distinguished with sensitiveness of their case.
- * CMNode is basically designed to represent DTDs or Schemas for XML
- * documents.  So, it doesn't have interfaces to retrieve such information.
- * However, declarations in the HTML CM should provide such information.
- * This intermediate interface is intended to provide whether ignore cases
- * or not.<br>
- */
-interface HTMLCMNode extends org.eclipse.wst.xml.core.internal.contentmodel.CMNode {
-
-	/**
-	 * Returns <code>true</code>, if declaration is for HTML attribute/element/entity.
-	 * Otherwise, returns <code>false</code>.
-	 * @return boolean
-	 */
-	boolean shouldIgnoreCase();
-}
\ No newline at end of file
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
deleted file mode 100644
index 893c7d8..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java
+++ /dev/null
@@ -1,366 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-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.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Base class for all Hed???? classes.
- */
-abstract class HTMLElemDeclImpl extends CMContentImpl implements HTMLElementDeclaration, HTMLPropertyDeclaration {
-
-	// DTD
-	protected CMNamedNodeMapImpl attributes = null;
-	protected String typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMPTY;
-	/** Never access this field directly.  Instead, use getComplexTypeDefinition method. */
-	private ComplexTypeDefinition typeDefinition = null;
-	protected CMGroupImpl inclusion = null;
-	protected CMGroupImpl exclusion = null;
-	// advanced information
-	protected CMNamedNodeMap prohibitedAncestors = null;
-	protected int correctionType = CORRECT_NONE;
-	protected int formatType = FORMAT_HTML;
-	protected int layoutType = LAYOUT_NONE;
-	protected int omitType = OMIT_NONE;
-	protected boolean keepSpaces = false;
-	protected boolean indentChild = false;
-	protected ElementCollection elementCollection = null;
-	protected AttributeCollection attributeCollection = null;
-	protected final static CMNamedNodeMap EMPTY_MAP = new 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 Iterator() {
-				public boolean hasNext() {
-					return false;
-				}
-
-				public Object next() {
-					return null;
-				}
-
-				public void remove() {
-				}
-			};
-		}
-	};
-
-	/**
-	 * HTMLElemDeclImpl constructor.
-	 * In the HTML DTD, an element declaration has no specification
-	 * for its occurrence.  Occurrence is specifed in content model, like
-	 * <code>(LI)+</code>.  To avoid confusion (and complexity),
-	 * occurrence of an element declaration is always 1 (it means, min = 1 and
-	 * max = 1).  Instead, occurrence of CMGroup represents actual occurrence
-	 * of the content.
-	 * <br>
-	 * @param name java.lang.String
-	 */
-	public HTMLElemDeclImpl(String elementName, ElementCollection collection) {
-		super(elementName, 1, 1);
-		elementCollection = collection;
-		attributeCollection = collection.getAttributeCollection();
-	}
-
-	/**
-	 */
-	protected abstract void createAttributeDeclarations();
-
-	private ComplexTypeDefinition createComplexTypeDefinition() {
-		if (typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_CDATA) || typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_EMPTY) || typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_PCDATA))
-			return null;
-
-		ComplexTypeDefinitionFactory factory = ComplexTypeDefinitionFactory.getInstance();
-		if (factory == null)
-			return null; // fatal error.
-
-		ComplexTypeDefinition def = factory.createTypeDefinition(typeDefinitionName, elementCollection);
-		return def;
-	}
-
-	/**
-	 * Get an attribute declaration.
-	 */
-	public HTMLAttributeDeclaration getAttributeDeclaration(String attrName) {
-		if (attributes == null) {
-			createAttributeDeclarations();
-			if (attributes == null)
-				return null; // fail to create
-		}
-
-		CMNode cmnode = attributes.getNamedItem(attrName);
-		if (cmnode == null) {
-			return null;
-		}
-		else {
-			return (HTMLAttributeDeclaration) cmnode; // already exists.
-		}
-	}
-
-	/**
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public CMNamedNodeMap getAttributes() {
-		if (attributes == null)
-			createAttributeDeclarations(); // lazy eval.
-		return attributes;
-	}
-
-	/**
-	 * Get an instance of complex type definition.
-	 */
-	private ComplexTypeDefinition getComplexTypeDefinition() {
-		if (typeDefinition == null)
-			typeDefinition = createComplexTypeDefinition();
-		return typeDefinition;
-	}
-
-	/**
-	 * Content.<br>
-	 * Element declarations which type is EMPTY or CDATA (maybe PCDATA)
-	 * <strong>MUST</strong> override this method and always return null.
-	 * This default implementation always tries to create a complex type definition
-	 * instance and access to it.
-	 * <br>
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public CMContent getContent() {
-		ComplexTypeDefinition def = getComplexTypeDefinition(); // lazy eval.
-		return (def != null) ? def.getContent() : null;
-	}
-
-	/**
-	 * Content type.<br>
-	 * Element declarations which type is EMPTY or CDATA (maybe PCDATA)
-	 * <strong>MUST</strong> override this method and return an appropriate type.
-	 * This default implementation always tries to create a complex type definition
-	 * instance and access to it.
-	 * <br>
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public int getContentType() {
-		ComplexTypeDefinition def = getComplexTypeDefinition(); // lazy eval.
-		return (def != null) ? def.getContentType() : CMElementDeclaration.CDATA;
-	}
-
-	/**
-	 * @see HTMLElementDeclaration#getCorrectionType
-	 */
-	public int getCorrectionType() {
-		return correctionType;
-	}
-
-	/**
-	 * HTML element doesn't have any data type.  So, this method always
-	 * returns <code>null</code>.<br>
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public CMDataType getDataType() {
-		return null;
-	}
-
-	/**
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public String getElementName() {
-		return getNodeName();
-	}
-
-	/**
-	 * Exclusion.
-	 * Almost elements don't have a exclusion.
-	 * Only classes those have exclusion should override this method.
-	 */
-	public CMContent getExclusion() {
-		return null;
-	}
-
-	/**
-	 * Default format type is <code>FORMAT_HTML</code>.<br>
-	 */
-	public int getFormatType() {
-		return formatType;
-	}
-
-	/**
-	 * Inclusion.
-	 * Almost elements don't have a inclusion.
-	 * Only classes those have inclusion should override this method.
-	 */
-	public CMContent getInclusion() {
-		return null;
-	}
-
-	/**
-	 */
-	public int getLayoutType() {
-		return layoutType;
-	}
-
-	/**
-	 * Line break hint is strongly related to layout type.
-	 * Indeed, in the C++DOM, it is determined from layout type only.
-	 * So, this implementation, as the default implementation for all declarations,
-	 * also determines from layout type only.<br>
-	 * @return int
-	 */
-	public int getLineBreakHint() {
-		switch (getLayoutType()) {
-			case HTMLElementDeclaration.LAYOUT_BLOCK :
-				return HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END;
-			case HTMLElementDeclaration.LAYOUT_BREAK :
-				return HTMLElementDeclaration.BREAK_AFTER_START;
-			case HTMLElementDeclaration.LAYOUT_HIDDEN :
-				return HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END;
-			default :
-				return HTMLElementDeclaration.BREAK_NONE;
-		}
-	}
-
-	/**
-	 * No HTML element has local elements.  So, this method always
-	 * returns an empty map.
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public CMNamedNodeMap getLocalElements() {
-		return EMPTY_MAP;
-	}
-
-	/**
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 */
-	public int getNodeType() {
-		return CMNode.ELEMENT_DECLARATION;
-	}
-
-	/**
-	 */
-	public int getOmitType() {
-		return omitType;
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		return EMPTY_MAP;
-	}
-
-	/**
-	 */
-	public boolean supports(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
-			return true;
-		}
-		else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
-			ComplexTypeDefinition def = getComplexTypeDefinition();
-			return (def != null);
-		}
-		else {
-			PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
-			if (pp == null)
-				return false;
-			return pp.supports(this);
-		}
-
-	}
-
-	/**
-	 */
-	public Object getProperty(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
-			return new Boolean(true);
-		}
-		else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
-			ComplexTypeDefinition def = getComplexTypeDefinition();
-			return (def != null) ? def.getPrimaryCandidate() : null;
-		}
-		else {
-			PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
-			if (pp == null)
-				return null;
-			return pp.get(this);
-		}
-	}
-
-	/**
-	 * Return element names which terminates this element.<br>
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return null;
-	}
-
-	/**
-	 * return true when the element is a JSP element.
-	 */
-	public boolean isJSP() {
-		return false;
-	}
-
-	/**
-	 * In some elements, such as APPLET, a source generator should indent child
-	 * elements that their parents.  That is, a source generator should generate
-	 * source  of APPLET and PARAMS like this:
-	 * <PRE>
-	 *   &lt;APPLET ...&gt;
-	 *     &lt;PARAM ... &gt;
-	 *     &lt;PARAM ... &gt;
-	 *   &lt;/APPLET&gt;
-	 * <PRE>
-	 * @return boolean
-	 */
-	public boolean shouldIndentChildSource() {
-		return indentChild;
-	}
-
-	/**
-	 * Most of elements can compact spaces in their child text nodes.
-	 * Some special elements should keep them in their source.
-	 * @return boolean
-	 */
-	public boolean shouldKeepSpaces() {
-		return keepSpaces;
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public boolean shouldTerminateAt(HTMLElementDeclaration nextElement) {
-		Iterator i = getTerminators();
-		if (i == null)
-			return false;
-		String nextName = nextElement.getElementName();
-		while (i.hasNext()) {
-			if (nextName.equals(i.next()))
-				return true;
-		}
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElementDeclaration.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElementDeclaration.java
deleted file mode 100644
index 7fe71f3..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElementDeclaration.java
+++ /dev/null
@@ -1,80 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * This interface is intended to be a public interface which has
- * interfaces defined in both of {@link <code>CMElementDeclaration</code>}
- * and {@link <code>HTMLCMNode</code>}.<br>
- * In addition to this, some interfaces are added to this interface,
- * those are specially to HTML elements.<br>
- */
-public interface HTMLElementDeclaration extends CMElementDeclaration {
-
-	/** Tag ommission; Not ommisible. */
-	int OMIT_NONE = 0;
-	/** Tag ommission; Both tags are ommisible. */
-	int OMIT_BOTH = 1;
-	/** Tag ommission; The end tag is ommisible. */
-	int OMIT_END = 2;
-	/** Tag ommission; The end tag is ommitted when created. */
-	int OMIT_END_DEFAULT = 3;
-	/** Tag ommission; The end tag must be omitted. */
-	int OMIT_END_MUST = 4;
-	/** Line Break; No break. */
-	int BREAK_NONE = 10;
-	/** Line Break; Break after the start tag. */
-	int BREAK_AFTER_START = 11;
-	/** Line Break; Break both before the start tagn and after the end tag. */
-	int BREAK_BEFORE_START_AND_AFTER_END = 12;
-	/* Layout */
-	/** initial value; the value should never returns to client programs. */
-	int LAYOUT_NONE = 100;
-	int LAYOUT_BLOCK = 101;
-	int LAYOUT_WRAP = 102;
-	/** No wrap object; like IMG, APPLET,... */
-	int LAYOUT_OBJECT = 103;
-	/** BR */
-	int LAYOUT_BREAK = 104;
-	/** Hidden object; like HTML or HEAD */
-	int LAYOUT_HIDDEN = 105;
-	/* Correction */
-	/** Correct; No correct. */
-	int CORRECT_NONE = 1000;
-	/** Correct; Meaningless when the content is empty. */
-	int CORRECT_EMPTY = 1001;
-	/** Correct; Meaningless when no attribut is set. */
-	int CORRECT_NEUTRAL = 1002;
-	/** Correct; Meaningless when same element is nested. */
-	int CORRECT_DUPLICATED = 1003;
-	/** Format; HTML */
-	int FORMAT_HTML = 10000;
-	/** Format; SSI */
-	int FORMAT_SSI = 10001;
-	/** Format; JSP script */
-	int FORMAT_JSP_SCRIPT = 10002;
-	/** Format; JSP directive */
-	int FORMAT_JSP_DIRECTIVE = 10003;
-	/** Format; XML */
-	int FORMAT_XML = 10004;
-	/** Format; MW */
-	int FORMAT_MW = 10005;
-
-	/**
-	 * A short hand method to get an attribute declaration of a HTML element.
-	 * @param attrName java.lang.String
-	 */
-	HTMLAttributeDeclaration getAttributeDeclaration(String attrName);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclImpl.java
deleted file mode 100644
index 137647e..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclImpl.java
+++ /dev/null
@@ -1,76 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-class HTMLEntityDeclImpl extends CMNodeImpl implements HTMLEntityDeclaration {
-
-	private java.lang.String value = null;
-
-	/**
-	 * CMEntityDeclImpl constructor comment.
-	 * @param entityName java.lang.String; Entity name.
-	 * @param entityValue java.lang.String; Value string.
-	 */
-	public HTMLEntityDeclImpl(String entityName, String entityValue) {
-		super(entityName);
-		value = entityValue;
-	}
-
-	/**
-	 * getName method
-	 * @return java.lang.String
-	 */
-	public String getName() {
-		return getNodeName();
-	}
-
-	/**
-	 * Get CMNode type.<br>
-	 * @return int; Always return ENTITY_DECLARATION.
-	 */
-	public int getNodeType() {
-		return CMNode.ENTITY_DECLARATION;
-	}
-
-	/**
-	 * getValue method
-	 * @return java.lang.String
-	 */
-	public String getValue() {
-		return value;
-	}
-
-	/**
-	 */
-	public boolean supports(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
-			return true;
-		return super.supports(propertyName);
-	}
-
-	/**
-	 * Entities in HTML documents are always treated with ignoring cases.
-	 * Because no special entities are defined in JSP 1.0, this method
-	 * can always return <code>true</code>.<br>
-	 */
-	public Object getProperty(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
-			return new Boolean(true);
-		return super.getProperty(propertyName);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclaration.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclaration.java
deleted file mode 100644
index 2663e23..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclaration.java
+++ /dev/null
@@ -1,22 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * This interface is intended to be a public interface which has
- * interfaces defined in both of {@link <code>CMEntityDeclaration</code>}
- * and {@link <code>HTMLCMNode</code>}.<br>
- */
-public interface HTMLEntityDeclaration extends org.eclipse.wst.xml.core.internal.contentmodel.CMEntityDeclaration {
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLPropertyDeclaration.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLPropertyDeclaration.java
deleted file mode 100644
index 3553507..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLPropertyDeclaration.java
+++ /dev/null
@@ -1,102 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * This interface is commonly used in declaration implementation, and internal use.
- * Use getProperty() method for public use.
- */
-public interface HTMLPropertyDeclaration {
-	/**
-	 * To determin the type, look up the following keywords in C++DOM/DTDParser.cpp:
-	 * <ul>
-	 *   <li>CORRECT_DUPLICATED - <code>GROUP_NODUP</code></li>
-	 *   <li>CORRECT_EMPTY - <code>GROUP_COMPACT</code></li>
-	 *   <li>CORRECT_NEUTRAL - <code>GROUP_NEUTRAL</code></li>
-	 *   <li>CORRECT_NONE - <code>(N/A)</code></li>
-	 * </ul>
-	 * @return int
-	 */
-	int getCorrectionType();
-	/**
-	 * Get the list of declarations those should be excluded from the content.<br>
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
-	 */
-	CMContent getExclusion();
-	/**
-	 * To determin the type, see the following files in the C++DOM:
-	 *   ElementType.cpp - ElementType#setGroup().
-	 *   Element.cpp - Element#getStartTag().
-	 * @return int
-	 */
-	int getFormatType();
-	/**
-	 * Get the list of declarations those should be included into the content.<br>
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
-	 */
-	CMContent getInclusion();
-	/**
-	 * To determin the type, look up the following keywords in C++DOM/DTDParser.cpp:
-	 * <ul>
-	 *   <li>LAYOUT_BLOCK - <code>GROUP_BLOCK</code></li>
-	 *   <li>LAYOUT_BREAK - <code>GROUP_BREAK</code></li>
-	 *   <li>LAYOUT_HIDDEN - <code>GROUP_HIDDEN</code></li>
-	 *   <li>LAYOUT_NONE - <code>(N/A)</code></li>
-	 *   <li>LAYOUT_OBJECT - <code>GROUP_NOWRAP</code></li>
-	 *   <li>LAYOUT_WRAP - <code>(N/A)</code></li>
-	 * </ul>
-	 * @return int
-	 */
-	int getLayoutType();
-	/**
-	 * To determine the type, see <code>Element::isBreakingBeforeElement()</code>
-	 * and <code>Element::isBreakingAfterElement()</code> defined in C++DOM/Element.cpp.<br>
-	 * @return int
-	 */
-	int getLineBreakHint();
-	/**
-	 * To determine the type, Check the HTML DTD.
-	 * And look up <code>GROUP_NOEND</code> in C++DOM/DTDParser.cpp.<br>
-	 * @return int
-	 */
-	int getOmitType();
-	/**
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap
-	 */
-	CMNamedNodeMap getProhibitedAncestors();
-	/**
-	 * return true when the element is a JSP element.
-	 */
-	boolean isJSP();
-	/**
-	 * @return boolean
-	 */
-	boolean shouldIndentChildSource();
-	/**
-	 * Some elements should keep spaces in its child text nodes.
-	 * For example, PRE and TEXTAREA.  This method returns true,
-	 * if a target element is one of such elements.
-	 * @return boolean
-	 */
-	boolean shouldKeepSpaces();
-	/**
-	 * Returns <code>true</code>, if <code>nextElement</code> terminates
-	 * the current element.
-	 * Some elements like <code>P</code> terminates other <code>P</code>.
-	 * That is, when <code>&lt;P&gt;</code> appears at the next to <code>P</code>,
-	 * which end tags is omitted, it represents not only the beginning of the
-	 * new <code>P</code> element but also the end of the previous <code>P</code>.
-	 */
-	boolean shouldTerminateAt(HTMLElementDeclaration nextElement);
-}
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
deleted file mode 100644
index 9ce421f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java
+++ /dev/null
@@ -1,99 +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
- *******************************************************************************/
-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.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;
-
-/**
- * A.
- */
-final class HedA extends HedInlineContainer {
-
-	/**
-	 */
-	public HedA(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.A, collection);
-		// CORRECT_EMPTY - GROUP_COMPACT
-		correctionType = CORRECT_EMPTY;
-	}
-
-	/**
-	 * %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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %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());
-	}
-
-	/**
-	 * Exclusion.
-	 * <code>A</code> has the exclusion.
-	 * It is <code>A</code> itself.
-	 */
-	public CMContent getExclusion() {
-		if (exclusion != null)
-			return exclusion; // already created.
-		if (elementCollection == null)
-			return null;
-
-		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		CMNode a = elementCollection.getNamedItem(HTML40Namespace.ElementName.A);
-		if (a != null)
-			exclusion.appendChild(a);
-
-		return exclusion;
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.A, HTML40Namespace.ElementName.BUTTON};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedADDRESS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedADDRESS.java
deleted file mode 100644
index 4f9b73c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedADDRESS.java
+++ /dev/null
@@ -1,58 +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
- *******************************************************************************/
-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.CMNamedNodeMap;
-
-/**
- * ADDRESS.
- */
-final class HedADDRESS extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedADDRESS(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.ADDRESS, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_ADDRESS;
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs;
-	 */
-	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;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAPPLET.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAPPLET.java
deleted file mode 100644
index d8244cd..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAPPLET.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * APPLET.
- */
-final class HedAPPLET extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedAPPLET(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.APPLET, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_PARAM_CONTAINER;
-		layoutType = LAYOUT_OBJECT;
-		indentChild = true;
-	}
-
-	/**
-	 * %coreattrs;
-	 * (codebase %URI; #IMPLIED)
-	 * (archive CDATA #IMPLIED)
-	 * (code CDATA #IMPLIED)
-	 * (object CDATA #IMPLIED)
-	 * (alt %Text; #IMPLIED) ... should be defined locally.
-	 * (name CDATA #IMPLIED)
-	 * (width %Length; #REQUIRED)
-	 * (height %Length; #REQUIRED)
-	 * (align %IAlign; #IMPLIED)
-	 * (hspace %Pixels; #IMPLIED)
-	 * (vspace %Pixels; #IMPLIED)
-	 * (mayscript (mayscript) #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %coreattrs;
-		attributeCollection.getCore(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_CODEBASE, HTML40Namespace.ATTR_NAME_ARCHIVE, HTML40Namespace.ATTR_NAME_CODE, HTML40Namespace.ATTR_NAME_OBJECT, HTML40Namespace.ATTR_NAME_ALT, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_HSPACE, HTML40Namespace.ATTR_NAME_VSPACE, HTML40Namespace.ATTR_NAME_MAYSCRIPT};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// %align; ... should be defined locally.
-		HTMLAttrDeclImpl attr = AttributeCollection.createAlignForImage();
-		if (attr != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 567e6ce..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java
+++ /dev/null
@@ -1,61 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * AREA.
- */
-final class HedAREA extends HedEmpty {
-
-	/**
-	 */
-	public HedAREA(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.AREA, collection);
-		// LAYOUT_HIDDEN.
-		// Because, AREA is GROUP_HIDDEN in the C++DOM/DTDParser.cpp.
-		layoutType = LAYOUT_HIDDEN;
-	}
-
-	/**
-	 * 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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-		attributes = new CMNamedNodeMapImpl();
-
-		// %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());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASE.java
deleted file mode 100644
index 7417dae..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASE.java
+++ /dev/null
@@ -1,50 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * BASE.
- */
-final class HedBASE extends HedEmpty {
-
-	/**
-	 */
-	public HedBASE(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.BASE, collection);
-		// LAYOUT_HIDDEN.
-		// Because, BASE is GROUP_HIDDEN in the C++DOM/DTDParser.cpp.
-		layoutType = LAYOUT_HIDDEN;
-	}
-
-	/**
-	 * BASE.
-	 * (href %URI; #IMPLIED)
-	 * (target %FrameTarget; #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {HTML40Namespace.ATTR_NAME_HREF, HTML40Namespace.ATTR_NAME_TARGET};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASEFONT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASEFONT.java
deleted file mode 100644
index 01ccce0..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASEFONT.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * BASEFONT.
- */
-final class HedBASEFONT extends HedEmpty {
-
-	/**
-	 */
-	public HedBASEFONT(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.BASEFONT, collection);
-		// LAYOUT_OBJECT - GROUP_NOWRAP.
-		layoutType = LAYOUT_OBJECT;
-	}
-
-	/**
-	 * BASEFONT.
-	 * (id ID #IMPLIED)
-	 * (size CDATA #REQUIRED) ... should be localy defined.
-	 * (color %Color; #IMPLIED)
-	 * (face CDATA #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {HTML40Namespace.ATTR_NAME_ID, HTML40Namespace.ATTR_NAME_COLOR, HTML40Namespace.ATTR_NAME_FACE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// (size CDATA #REQUIRED) ... should be localy defined.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SIZE, attr);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBDO.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBDO.java
deleted file mode 100644
index 67c2609..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBDO.java
+++ /dev/null
@@ -1,61 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * BDO.
- */
-final class HedBDO extends HedInlineContainer {
-
-	/**
-	 */
-	public HedBDO(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.BDO, collection);
-		// CORRECT_EMPTY - GROUP_COMPACT
-		correctionType = CORRECT_EMPTY;
-	}
-
-	/**
-	 * %coreattrs;
-	 * (lang %LanguageCode; #IMPLIED)
-	 * (dir (ltr|rtl) #REQUIRED) ... should be defined locally.
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %coreattrs;
-		attributeCollection.getCore(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_LANG};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		//  (dir (ltr|rtl) #REQUIRED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		String[] values = {HTML40Namespace.ATTR_VALUE_LTR, HTML40Namespace.ATTR_VALUE_RTL};
-		atype.setEnumValues(values);
-
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_DIR, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_DIR, attr);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBGSOUND.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBGSOUND.java
deleted file mode 100644
index 03b0881..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBGSOUND.java
+++ /dev/null
@@ -1,47 +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
- *******************************************************************************/
-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.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-
-
-final class HedBGSOUND extends HedEmpty {
-
-	public HedBGSOUND(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.BGSOUND, collection);
-		layoutType = LAYOUT_OBJECT;
-	}
-
-	/**
-	 * (src, CDATA, #IMPLIED)
-	 * (loop, CDATA, #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return;
-		if (attributeCollection == null)
-			return; // fatal
-		attributes = new CMNamedNodeMapImpl();
-		// src
-		HTMLAttributeDeclaration attr = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_SRC);
-		if (attr != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
-		// loop
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_INFINITE);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_LOOP, atype, CMAttributeDeclaration.OPTIONAL);
-		if (attr != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_LOOP, attr);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBLOCKQUOTE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBLOCKQUOTE.java
deleted file mode 100644
index b587b23..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBLOCKQUOTE.java
+++ /dev/null
@@ -1,63 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * BLOCKQUOTE.
- */
-final class HedBLOCKQUOTE extends HedFlowContainer {
-
-	/**
-	 */
-	public HedBLOCKQUOTE(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.BLOCKQUOTE, collection);
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs;
-	 * (cite %URI; #IMPLIED) 
-	 */
-	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_CITE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBODY.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBODY.java
deleted file mode 100644
index ad52960..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBODY.java
+++ /dev/null
@@ -1,96 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * BODY.
- */
-final class HedBODY extends HedFlowContainer {
-
-	private static String[] terminators = {HTML40Namespace.ElementName.HEAD, HTML40Namespace.ElementName.BODY, HTML40Namespace.ElementName.FRAMESET, HTML40Namespace.ElementName.HTML};
-
-	/**
-	 */
-	public HedBODY(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.BODY, collection);
-		layoutType = LAYOUT_BLOCK;
-		omitType = OMIT_BOTH;
-	}
-
-	/**
-	 * %attrs;
-	 * %bodycolors;
-	 * (onload %Script; #IMPLIED)
-	 * (onunload %Script; #IMPLIED)
-	 * (background %URI; #IMPLIED)
-	 * (marginwidth %Pixels; #IMPLIED) ... D205514
-	 * (marginheight %Pixels; #IMPLIED) .. D205514
-	 * (topmargin, CDATA, #IMPLIED) ...... D205514
-	 * (bottommargin, CDATA, #IMPLIED) ... D205514
-	 * (leftmargin, CDATA, #IMPLIED) ..... D205514
-	 * (rightmargin, CDATA, #IMPLIED) .... D205514
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// %bodycolors;
-		attributeCollection.getBodycolors(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_ONLOAD, HTML40Namespace.ATTR_NAME_ONUNLOAD, HTML40Namespace.ATTR_NAME_BACKGROUND,
-		// <<D205514
-					HTML40Namespace.ATTR_NAME_MARGINWIDTH, HTML40Namespace.ATTR_NAME_MARGINHEIGHT, HTML40Namespace.ATTR_NAME_TOPMARGIN, HTML40Namespace.ATTR_NAME_BOTTOMMARGIN, HTML40Namespace.ATTR_NAME_LEFTMARGIN, HTML40Namespace.ATTR_NAME_RIGHTMARGIN
-		// D205514
-		};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 * Inclusion.
-	 * "Lazy eval."<br>
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
-	 */
-	public CMContent getInclusion() {
-		if (inclusion != null)
-			return inclusion; // already created.
-		if (elementCollection == null)
-			return null;
-
-		// (INS|DEL)
-		inclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		String[] names = {HTML40Namespace.ElementName.INS, HTML40Namespace.ElementName.DEL};
-		elementCollection.getDeclarations(inclusion, Arrays.asList(names).iterator());
-		return inclusion;
-	}
-
-	/**
-	 * BODY has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBR.java
deleted file mode 100644
index 39749a5..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBR.java
+++ /dev/null
@@ -1,51 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * BR.
- */
-final class HedBR extends HedEmpty {
-
-	/**
-	 */
-	public HedBR(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.BR, collection);
-		// LAYOUT_BREAK.
-		// Because, BR is GROUP_BREAK in the C++DOM/DTDParser.cpp.
-		layoutType = LAYOUT_BREAK;
-	}
-
-	/**
-	 * BR.
-	 * %coreattrs;
-	 * (clear (left | all | right | none) none)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %coreattrs;
-		attributeCollection.getCore(attributes);
-		// clear
-		HTMLAttributeDeclaration attr = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_CLEAR);
-		if (attr != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_CLEAR, attr);
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 6112d25..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java
+++ /dev/null
@@ -1,101 +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
- *******************************************************************************/
-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.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;
-
-/**
- * BUTTON.
- */
-final class HedBUTTON extends HedFlowContainer {
-
-	/**
-	 */
-	public HedBUTTON(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.BUTTON, collection);
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %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);
-	}
-
-	/**
-	 * Exclusion.
-	 * <code>FORM</code> has the exclusion.
-	 * It is <code>FORM</code> itself.
-	 */
-	public CMContent getExclusion() {
-		if (exclusion != null)
-			return exclusion; // already created.
-		if (elementCollection == null)
-			return null; // fatal
-
-		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		String[] names = {HTML40Namespace.ElementName.A, HTML40Namespace.ElementName.FORM, HTML40Namespace.ElementName.ISINDEX, HTML40Namespace.ElementName.FIELDSET, HTML40Namespace.ElementName.IFRAME};
-		elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
-		elementCollection.getFormctrl(exclusion);
-
-		return exclusion;
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.BUTTON};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCAPTION.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCAPTION.java
deleted file mode 100644
index 167086c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCAPTION.java
+++ /dev/null
@@ -1,48 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * CAPTION.
- */
-final class HedCAPTION extends HedInlineContainer {
-
-	/**
-	 */
-	public HedCAPTION(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.CAPTION, collection);
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs;
-	 * (align %CAlign; #IMPLIED) ... should be defined locally.
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-		HTMLAttrDeclImpl attr = AttributeCollection.createAlignForCaption();
-		if (attr != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCENTER.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCENTER.java
deleted file mode 100644
index 310a875..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCENTER.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-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.CMNamedNodeMap;
-
-/**
- * CENTER.
- */
-final class HedCENTER extends HedFlowContainer {
-
-	/**
-	 */
-	public HedCENTER(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.CENTER, collection);
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs;
-	 */
-	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;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOL.java
deleted file mode 100644
index e381ed3..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOL.java
+++ /dev/null
@@ -1,67 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * COL.
- */
-final class HedCOL extends HedEmpty {
-
-	/**
-	 */
-	public HedCOL(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.COL, collection);
-		// LAYOUT_BLOCK.
-		// Because, COL is GROUP_BLOCK in the C++DOM/DTDParser.cpp.
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * COL.
-	 * %attrs;
-	 * (span NUMBER 1)
-	 * (width %MultiLength; #IMPLIED) ... should be defined locally.
-	 * %cellhalign;
-	 * %cellvalign;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-		// (span NUMBER 1)
-		String[] names = {HTML40Namespace.ATTR_NAME_SPAN};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// (width %MultiLength; #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MULTI_LENGTH);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_WIDTH, attr);
-
-		// %cellhalign;
-		attributeCollection.getCellhalign(attributes);
-		// %cellvalign;
-		attributeCollection.getCellvalign(attributes);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOLGROUP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOLGROUP.java
deleted file mode 100644
index 7bf229c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOLGROUP.java
+++ /dev/null
@@ -1,74 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * COLGROUP.
- */
-final class HedCOLGROUP extends HTMLElemDeclImpl {
-
-	private static String[] terminators = {HTML40Namespace.ElementName.COLGROUP, HTML40Namespace.ElementName.CAPTION, HTML40Namespace.ElementName.THEAD, HTML40Namespace.ElementName.TBODY, HTML40Namespace.ElementName.TFOOT, HTML40Namespace.ElementName.TR};
-
-	public HedCOLGROUP(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.COLGROUP, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_COLUMN_GROUP;
-		layoutType = LAYOUT_BLOCK;
-		omitType = OMIT_END;
-		indentChild = true;
-	}
-
-	/**
-	 * %attrs;
-	 * (span NUMBER 1)
-	 * (width %MultiLength; #IMPLIED) ... should be defined locally.
-	 * %cellhalign;
-	 * %cellvalign;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// %cellhalign;
-		attributeCollection.getCellhalign(attributes);
-		// %cellvalign;
-		attributeCollection.getCellvalign(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_SPAN};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// (width %MultiLength; #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MULTI_LENGTH);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_WIDTH, attr);
-	}
-
-	/**
-	 * LI has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDD.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDD.java
deleted file mode 100644
index a200227..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDD.java
+++ /dev/null
@@ -1,59 +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
- *******************************************************************************/
-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;
-
-
-/**
- * DD.
- */
-final class HedDD extends HedFlowContainer {
-
-	private static String[] terminators = {HTML40Namespace.ElementName.DT, HTML40Namespace.ElementName.DD};
-
-	/**
-	 */
-	public HedDD(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.DD, collection);
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-		omitType = OMIT_END_DEFAULT;
-	}
-
-	/**
-	 * %attrs;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-	}
-
-	/**
-	 * DD has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDIV.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDIV.java
deleted file mode 100644
index 54aa19d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDIV.java
+++ /dev/null
@@ -1,63 +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
- *******************************************************************************/
-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.CMNamedNodeMap;
-
-/**
- * DIV.
- */
-final class HedDIV extends HedFlowContainer {
-
-	/**
-	 */
-	public HedDIV(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.DIV, collection);
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs;
-	 * %align;
-	 * %reserved;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// %align;
-		HTMLAttrDeclImpl attr = AttributeCollection.createAlignForParagraph();
-		if (attr != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-		// %reserved; ... empty
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDL.java
deleted file mode 100644
index ec67ee9..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDL.java
+++ /dev/null
@@ -1,64 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * DL.
- */
-final class HedDL extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedDL(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.DL, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_DEFINITION_LIST;
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-		indentChild = true;
-	}
-
-	/**
-	 * %arrays;
-	 * (compact (compact) #IMPLIED)
-	 */
-	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_COMPACT};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDT.java
deleted file mode 100644
index 7ace822..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDT.java
+++ /dev/null
@@ -1,59 +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
- *******************************************************************************/
-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;
-
-
-/**
- * DT.
- */
-final class HedDT extends HedInlineContainer {
-
-	private static String[] terminators = {HTML40Namespace.ElementName.DT, HTML40Namespace.ElementName.DD};
-
-	/**
-	 */
-	public HedDT(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.DT, collection);
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-		omitType = OMIT_END_DEFAULT;
-	}
-
-	/**
-	 * %attrs;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-	}
-
-	/**
-	 * DT has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEMBED.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEMBED.java
deleted file mode 100644
index 558a3d7..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEMBED.java
+++ /dev/null
@@ -1,94 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * EMBED.
- */
-final class HedEMBED extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedEMBED(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.EMBED, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMBED;
-		layoutType = LAYOUT_OBJECT;
-		omitType = OMIT_END_DEFAULT;
-	}
-
-	/**
-	 * %coreattrs;
-	 * %events;
-	 * (src %URI; #REQUIRED) ... should be defined locally.
-	 * (height %Length; #IMPLIED)
-	 * (width %Length; #IMPLIED)
-	 * (align %IAlign; #IMPLIED) ... should be defined locally.
-	 * (hspace %Pixels; #IMPLIED)
-	 * (vspace %Pixels; #IMPLIED)
-	 * (loop CDATA #IMPLIED)
-	 * (hidden CDATA #IMPLIED)
-	 * (volume CDATA #IMPLIED)
-	 * (autostart (true|false) #IMPLIED)
-	 * (autoplay (true|false) #IMPLIED)
-	 * (autosize (true|false) #IMPLIED)
-	 * (controller (true|false) true)
-	 * (scale CDATA #IMPLIED)
-	 * (showcontrols (true|false) #IMPLIED)
-	 * (playcount NUMBER #IMPLIED)
-	 * (repeat CDATA #IMPLIED)
-	 * (panel CDATA #IMPLIED)
-	 * (text CDATA #IMPLIED)
-	 * (palette CDATA #IMPLIED)
-	 * (textfocus CDATA #IMPLIED)
-	 * (type CDATA #IMPLIED) ... should be defined locally.
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %coreattrs;
-		attributeCollection.getCore(attributes);
-		// %events;
-		attributeCollection.getEvents(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HSPACE, HTML40Namespace.ATTR_NAME_VSPACE, HTML40Namespace.ATTR_NAME_LOOP, HTML40Namespace.ATTR_NAME_HIDDEN, HTML40Namespace.ATTR_NAME_VOLUME, HTML40Namespace.ATTR_NAME_AUTOSTART, HTML40Namespace.ATTR_NAME_AUTOPLAY, HTML40Namespace.ATTR_NAME_AUTOSIZE, HTML40Namespace.ATTR_NAME_CONTROLLER, HTML40Namespace.ATTR_NAME_SCALE, HTML40Namespace.ATTR_NAME_SHOWCONTROLS, HTML40Namespace.ATTR_NAME_PLAYCOUNT, HTML40Namespace.ATTR_NAME_REPEAT, HTML40Namespace.ATTR_NAME_PANEL, HTML40Namespace.ATTR_NAME_TEXT, HTML40Namespace.ATTR_NAME_PALETTE, HTML40Namespace.ATTR_NAME_TEXTFOCUS};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		HTMLCMDataTypeImpl atype = null;
-		HTMLAttrDeclImpl attr = null;
-		// (src %URI; #REQUIRED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
-
-		// (align %IAlign; #IMPLIED) ... should be defined locally.
-		attr = AttributeCollection.createAlignForImage();
-		if (attr != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-
-		// (type CDATA #IMPLIED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEmpty.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEmpty.java
deleted file mode 100644
index 8f5898a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEmpty.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Base class for EMPTY type element declarations.
- */
-abstract class HedEmpty extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedEmpty(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMPTY;
-		// EMPTY type has no end tag.
-		omitType = OMIT_END_MUST;
-	}
-
-	/**
-	 * Content.<br>
-	 * EMPTY type always returns <code>null</code>.
-	 * <br>
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
-	 */
-	public CMContent getContent() {
-		return null;
-	}
-
-	/**
-	 * Content type.<br>
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.EMPTY;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 2db5e0d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-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.CMNamedNodeMap;
-
-/**
- * FIELDSET.
- */
-final class HedFIELDSET extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedFIELDSET(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.FIELDSET, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FIELDSET;
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs;
-	 */
-	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.BUTTON, HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFONT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFONT.java
deleted file mode 100644
index fc610b5..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFONT.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * FONT.
- */
-final class HedFONT extends HedInlineContainer {
-
-	/**
-	 */
-	public HedFONT(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.FONT, collection);
-		// CORRECT_EMPTY - GROUP_COMPACT
-		correctionType = CORRECT_EMPTY;
-	}
-
-	/**
-	 * %coreattrs;
-	 * %i18n;
-	 * (size CDATA #IMPLIED) ... should be defined locally.
-	 * (color %Color; #IMPLIED)
-	 * (face CDATA #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %coreattrs;
-		attributeCollection.getCore(attributes);
-		// %i18n;
-		attributeCollection.getI18n(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_COLOR, HTML40Namespace.ATTR_NAME_FACE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// (size CDATA #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SIZE, attr);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFORM.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFORM.java
deleted file mode 100644
index d7c60ae..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFORM.java
+++ /dev/null
@@ -1,92 +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
- *******************************************************************************/
-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.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;
-
-/**
- * FORM.
- */
-final class HedFORM extends HedFlowContainer {
-
-	/**
-	 */
-	public HedFORM(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.FORM, collection);
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs;
-	 * (action %URI; #REQUIRED)
-	 * (method (GET|POST) GET)
-	 * (enctype %ContentType; "application/x-www-form-urlencoded")
-	 * (accept %ContentTypes; #IMPLIED)
-	 * (name CDATA #IMPLIED)
-	 * (onsubmit %Script; #IMPLIED)
-	 * (onreset %Script; #IMPLIED)
-	 * (target %FrameTarget; #IMPLIED)
-	 * (accept-charset %Charsets; #IMPLIED)
-	 */
-	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_ACTION, HTML40Namespace.ATTR_NAME_METHOD, HTML40Namespace.ATTR_NAME_ENCTYPE, HTML40Namespace.ATTR_NAME_ACCEPT, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_ONSUBMIT, HTML40Namespace.ATTR_NAME_ONRESET, HTML40Namespace.ATTR_NAME_TARGET, HTML40Namespace.ATTR_NAME_ACCEPT_CHARSET};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 * Exclusion.
-	 * <code>FORM</code> has the exclusion.
-	 * It is <code>FORM</code> itself.
-	 */
-	public CMContent getExclusion() {
-		if (exclusion != null)
-			return exclusion; // already created.
-		if (elementCollection == null)
-			return null; // fatal
-
-		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		CMNode form = elementCollection.getNamedItem(HTML40Namespace.ElementName.FORM);
-		if (form != null)
-			exclusion.appendChild(form);
-
-		return exclusion;
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.BUTTON, HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.FORM, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAME.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAME.java
deleted file mode 100644
index bb844cd..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAME.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * FRAME.
- */
-final class HedFRAME extends HedEmpty {
-
-	/**
-	 */
-	public HedFRAME(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.FRAME, collection);
-		// LAYOUT_HIDDEN.
-		// Because, FRAME is GROUP_HIDDEN in the C++DOM/DTDParser.cpp.
-		layoutType = LAYOUT_HIDDEN;
-	}
-
-	/**
-	 * FRAME.
-	 * %coreattrs;
-	 * (longdesc %URI; #IMPLIED)
-	 * (name CDATA #IMPLIED)
-	 * (src %URI; #IMPLIED)
-	 * (frameborder (1|0) 1)
-	 * (marginwidth %Pixels; #IMPLIED)
-	 * (marginheight %Pixels; #IMPLIED)
-	 * (noresize (noresize) #IMPLIED)
-	 * (scrolling (yes|no|auto) auto)
-	 * (bordercolor %Color #IMPLIED) ... D205514
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		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_NORESIZE, HTML40Namespace.ATTR_NAME_SCROLLING, HTML40Namespace.ATTR_NAME_BORDERCOLOR // D20554
-		};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAMESET.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAMESET.java
deleted file mode 100644
index 0f38961..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAMESET.java
+++ /dev/null
@@ -1,80 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * FRAMESET.
- */
-final class HedFRAMESET extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedFRAMESET(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.FRAMESET, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FRAMESET;
-		layoutType = LAYOUT_HIDDEN;
-		indentChild = true;
-	}
-
-	/**
-	 * %coreattrs;
-	 * (rows %MultiLengths; #IMPLIED) ... should be defined locally.
-	 * (cols %MultiLengths; #IMPLIED) ... should be defined locally.
-	 * (onload %Script; #IMPLIED)
-	 * (onunload %Script; #IMPLIED)
-	 * (frameborder (yes|no) #IMPLIED) ... should be defined locally.
-	 * (border %Pixels; #IMPLIED)
-	 * (bordercolor %Color #IMPLIED) ... D205514
-	 * (framespacing CDATA #IMPLIED) ... D215684
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getCore(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_ONLOAD, HTML40Namespace.ATTR_NAME_ONUNLOAD, HTML40Namespace.ATTR_NAME_BORDER, HTML40Namespace.ATTR_NAME_BORDERCOLOR, // D205514
-					HTML40Namespace.ATTR_NAME_FRAMESPACING // D215684
-		};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		HTMLCMDataTypeImpl atype = null;
-		HTMLAttrDeclImpl attr = null;
-		// (rows %MultiLengths; #IMPLIED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MULTI_LENGTH);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_ROWS, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ROWS, attr);
-
-		// (cols %MultiLengths; #IMPLIED) ... should be defined locally.
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_COLS, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_COLS, attr);
-
-		// (frameborder (yes|no) #IMPLIED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		String[] values = {HTML40Namespace.ATTR_VALUE_YES, HTML40Namespace.ATTR_VALUE_NO};
-		atype.setEnumValues(values);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_FRAMEBORDER, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_FRAMEBORDER, attr);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFlowContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFlowContainer.java
deleted file mode 100644
index 96d47e2..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFlowContainer.java
+++ /dev/null
@@ -1,26 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * Base class for (%flow;)* containers.
- */
-abstract class HedFlowContainer extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedFlowContainer(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FLOW_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFontStyle.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFontStyle.java
deleted file mode 100644
index 9b787c0..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFontStyle.java
+++ /dev/null
@@ -1,64 +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
- *******************************************************************************/
-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.CMNamedNodeMap;
-
-/**
- * %fontstyle;
- */
-final class HedFontStyle extends HedInlineContainer {
-
-	/**
-	 */
-	public HedFontStyle(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		if (elementName.equalsIgnoreCase(HTML40Namespace.ElementName.BIG) || elementName.equalsIgnoreCase(HTML40Namespace.ElementName.SMALL)) {
-			correctionType = CORRECT_EMPTY;
-		}
-		else { // B, I, U, ...
-			correctionType = CORRECT_DUPLICATED;
-		}
-	}
-
-	/**
-	 * %attrs;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		String myName = getElementName();
-		if (!myName.equalsIgnoreCase(HTML40Namespace.ElementName.BIG) && !myName.equalsIgnoreCase(HTML40Namespace.ElementName.SMALL))
-			return EMPTY_MAP;
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.PRE};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEAD.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEAD.java
deleted file mode 100644
index d2c2e8a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEAD.java
+++ /dev/null
@@ -1,78 +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
- *******************************************************************************/
-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;
-
-
-/**
- * HTML.
- */
-final class HedHEAD extends HTMLElemDeclImpl {
-
-	private static String[] terminators = {HTML40Namespace.ElementName.HEAD, HTML40Namespace.ElementName.BODY, HTML40Namespace.ElementName.FRAMESET, HTML40Namespace.ElementName.HTML};
-
-	/**
-	 */
-	public HedHEAD(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.HEAD, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HEAD;
-		layoutType = LAYOUT_HIDDEN;
-		omitType = OMIT_BOTH;
-	}
-
-	/**
-	 * Create all attribute declarations.
-	 * This method is called once in the constructor of the super class.
-	 * The <code>HEAD</code> element may have the following attributes:
-	 * <table>
-	 * <tbody>
-	 *   <tr>
-	 *     <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>%i18n;</td><td>-</td><td>-</td><td>-</td><td>-</td>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>profile</td><td>URI</td><td>#IMPLIED</td><td>N/A</td><td>-</td>
-	 *   </tr>
-	 * </tbody>
-	 * </table>
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %i18n;
-		attributeCollection.getI18n(attributes);
-		// profile
-		HTMLAttributeDeclaration adec = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_PROFILE);
-		if (adec != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_PROFILE, adec);
-	}
-
-	/**
-	 * HEAD has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHR.java
deleted file mode 100644
index bf7155e..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHR.java
+++ /dev/null
@@ -1,77 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * HR.
- */
-final class HedHR extends HedEmpty {
-
-	/**
-	 */
-	public HedHR(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.HR, collection);
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs
-	 * (align (left|center|right) #IMPLIED) ... should be defined locally.
-	 * (noshade (noshade) #IMPLIED)
-	 * (size %Pixels; #IMPLIED)
-	 * (width %Length; #IMPLIED)
-	 * (color %Color; #IMPLIED) ... D205514
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-		// (align (left|center|right) #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		String[] values = {HTML40Namespace.ATTR_VALUE_LEFT, HTML40Namespace.ATTR_VALUE_CENTER, HTML40Namespace.ATTR_VALUE_RIGHT};
-		atype.setEnumValues(values);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-
-		// the rest.
-		String[] names = {HTML40Namespace.ATTR_NAME_NOSHADE, HTML40Namespace.ATTR_NAME_SIZE, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_COLOR // D205514
-		};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 1522395..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java
+++ /dev/null
@@ -1,80 +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
- *******************************************************************************/
-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;
-
-
-/**
- * HTML.
- */
-final class HedHTML extends HTMLElemDeclImpl {
-
-	private static String[] terminators = {HTML40Namespace.ElementName.HTML};
-
-	/**
-	 */
-	public HedHTML(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.HTML, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HTML;
-		layoutType = LAYOUT_HIDDEN;
-		omitType = OMIT_BOTH;
-	}
-
-	/**
-	 * Create all attribute declarations.
-	 * This method is called once in the constructor of the super class.
-	 * The <code>HTML</code> element may have the following attributes:
-	 * <table>
-	 * <tbody>
-	 *   <tr>
-	 *     <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
-	 *   </tr>
-	 *   <tr>
-	 *     <td><code>%i18n;</code></td><td>-</td><td>-</td><td>-</td>
-	 *     <td>{@link PDCMDocImpl#getAttrDeclarationsI18n}</td>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>version</td><td>CDATA</td><td>#FIXED</td>
-	 *     <td>{@link HTML_VERSION_TRANSITIONAL}</td><td>deplecated in HTML4.01</td>
-	 *   </tr>
-	 * </tbody>
-	 * </table>
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		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);
-	}
-
-	/**
-	 * HTML has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHeading.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHeading.java
deleted file mode 100644
index 3123cec..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHeading.java
+++ /dev/null
@@ -1,84 +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
- *******************************************************************************/
-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.CMNamedNodeMap;
-
-/**
- * H[1-6].
- */
-final class HedHeading extends HedInlineContainer {
-
-	/**
-	 */
-	public HedHeading(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * Create all attribute declarations.
-	 * This method is called once in the constructor of the super class.
-	 * The <code>H1</code> element may have the following attributes:
-	 * <table>
-	 * <tbody>
-	 *   <tr>
-	 *     <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>%attrs;</td><td>-</td><td>-</td><td>-</td><td>-</td>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>%align;</td><td>-</td><td>-</td><td>-</td><td>-</td>
-	 *   </tr>
-	 * </tbody>
-	 * </table>
-	 * <p><b>%align;</b> means <code>align (left|center|right|justify) #IMPLIED</code>.
-	 * Unfortunately, this <code>align</code> is different from one in
-	 * <code>IMG</code> or <code>TABLE</code>.  So, the attribute declaration
-	 * of <code>align</code> should be localy created and it shouldn't be registered
-	 * in a <code>HCMDocImpl</code> instance.</p>
-	 * <p>However, %align is used in sevaral times.  I wouldn't write same code
-	 * in many times.  So, I add a new utility method into <code>CMUtil</code>
-	 * to create the attribute declaration.</p>
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// align
-		HTMLAttrDeclImpl attr = AttributeCollection.createAlignForParagraph();
-		if (attr != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 6036741..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java
+++ /dev/null
@@ -1,76 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * IFRAME.
- */
-final class HedIFRAME extends HedFlowContainer {
-
-	/**
-	 */
-	public HedIFRAME(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.IFRAME, collection);
-		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.
-		if (attributeCollection == null)
-			return; // fatal
-
-		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);
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.BUTTON};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index ae1296b..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java
+++ /dev/null
@@ -1,88 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * IMG.
- */
-final class HedIMG extends HedEmpty {
-
-	/**
-	 */
-	public HedIMG(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.IMG, collection);
-		layoutType = LAYOUT_OBJECT;
-	}
-
-	/**
-	 * 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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %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);
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.PRE};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index ecf5aae..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java
+++ /dev/null
@@ -1,122 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * INPUT.
- */
-final class HedINPUT extends HedEmpty {
-
-	/**
-	 */
-	public HedINPUT(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.INPUT, collection);
-		layoutType = LAYOUT_OBJECT;
-	}
-
-	/**
-	 * 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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %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());
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.BUTTON};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedISINDEX.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedISINDEX.java
deleted file mode 100644
index c3ec75d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedISINDEX.java
+++ /dev/null
@@ -1,65 +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
- *******************************************************************************/
-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.CMNamedNodeMap;
-
-/**
- * ISINDEX.
- */
-final class HedISINDEX extends HedEmpty {
-
-	/**
-	 */
-	public HedISINDEX(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.ISINDEX, collection);
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * ISINDEX.
-	 * %coreattrs;
-	 * %i18n;
-	 * (prompt %Text; #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %coreattrs;
-		attributeCollection.getCore(attributes);
-		// %i18n;
-		attributeCollection.getI18n(attributes);
-
-		HTMLAttributeDeclaration attr = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_PROMPT);
-		if (attr != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_PROMPT, attr);
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.BUTTON, HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedInlineContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedInlineContainer.java
deleted file mode 100644
index 08812aa..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedInlineContainer.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * Base class for (%inline;)* containers.
- */
-abstract class HedInlineContainer extends HTMLElemDeclImpl {
-
-	/**
-	 * HedInlineContainer.
-	 * @param elementName java.lang.String
-	 * @param collection ElementCollection
-	 */
-	public HedInlineContainer(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_INLINE_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLABEL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLABEL.java
deleted file mode 100644
index aecb7b3..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLABEL.java
+++ /dev/null
@@ -1,93 +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
- *******************************************************************************/
-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.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;
-
-/**
- * LABEL.
- */
-final class HedLABEL extends HedInlineContainer {
-
-	/**
-	 */
-	public HedLABEL(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.LABEL, collection);
-	}
-
-	/**
-	 * %attrs;
-	 * (for IDREF #IMPLIED) ... should be defined locally.
-	 * (accesskey %Character; #IMPLIED)
-	 * (onfocus %Script; #IMPLIED)
-	 * (onblur %Script; #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-		// (for IDREF #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.IDREF);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_FOR, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_FOR, attr);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 * Exclusion.
-	 * <code>LABEL</code> has the exclusion.
-	 * It is <code>LABEL</code> itself.
-	 */
-	public CMContent getExclusion() {
-		if (exclusion != null)
-			return exclusion; // already created.
-		if (elementCollection == null)
-			return null;
-
-		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		CMNode label = elementCollection.getNamedItem(HTML40Namespace.ElementName.LABEL);
-		if (label != null)
-			exclusion.appendChild(label);
-
-		return exclusion;
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.BUTTON, HTML40Namespace.ElementName.LABEL};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLEGEND.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLEGEND.java
deleted file mode 100644
index f66d866..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLEGEND.java
+++ /dev/null
@@ -1,54 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * LEGEND.
- */
-final class HedLEGEND extends HedInlineContainer {
-
-	/**
-	 */
-	public HedLEGEND(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.LEGEND, collection);
-	}
-
-	/**
-	 * (accesskey %Character; #IMPLIED)
-	 * (align %LAlign; #IMPLIED) ... shuld be defined locally.
-	 */
-	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_ACCESSKEY};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// align
-		HTMLAttrDeclImpl attr = AttributeCollection.createAlignForLegend();
-		if (attr != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 9012dab..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java
+++ /dev/null
@@ -1,71 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * LI.
- */
-final class HedLI extends HedFlowContainer {
-
-	private static String[] terminators = {HTML40Namespace.ElementName.LI};
-
-	/**
-	 */
-	public HedLI(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.LI, collection);
-		layoutType = LAYOUT_BLOCK;
-		omitType = OMIT_END_DEFAULT;
-	}
-
-	/**
-	 * %attrs;
-	 * (type %LIStyle; #IMPLIED) ... should be defined locally.
-	 * (value NUMBER #IMPLIED) ... should be defined locally.
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %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);
-	}
-
-	/**
-	 * LI has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 5fe5269..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java
+++ /dev/null
@@ -1,63 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * LINK.
- */
-final class HedLINK extends HedEmpty {
-
-	/**
-	 */
-	public HedLINK(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.LINK, collection);
-		layoutType = LAYOUT_HIDDEN;
-	}
-
-	/**
-	 * 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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %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);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedListItemContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedListItemContainer.java
deleted file mode 100644
index ca49717..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedListItemContainer.java
+++ /dev/null
@@ -1,30 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * Base class for list item container declarations.
- * - OL, UL, MENU, DIR.
- */
-abstract class HedListItemContainer extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedListItemContainer(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_LI_CONTAINER;
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-		indentChild = true;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMAP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMAP.java
deleted file mode 100644
index 4e1036f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMAP.java
+++ /dev/null
@@ -1,53 +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
- *******************************************************************************/
-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.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-
-
-/**
- * MAP.
- */
-final class HedMAP extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedMAP(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.MAP, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_MAP;
-		layoutType = LAYOUT_OBJECT;
-		indentChild = true;
-	}
-
-	/**
-	 * %attrs;
-	 * (name CDATA #REQUIRED) ... should be defined locally
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-		// (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);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMARQUEE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMARQUEE.java
deleted file mode 100644
index c9cadcb..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMARQUEE.java
+++ /dev/null
@@ -1,81 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * MARQUEE.
- */
-final class HedMARQUEE extends HedFlowContainer {
-
-	/**
-	 */
-	public HedMARQUEE(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.MARQUEE, collection);
-		layoutType = LAYOUT_OBJECT;
-	}
-
-	/**
-	 * %attrs;
-	 * (behavior (scroll|slide|alternate) scroll)
-	 * (bgcolor %Color; #IMPLIED)
-	 * (direction (left|right|up|down) left)
-	 * (height CDATA #IMPLIED) ... should be defined locally.
-	 * (hspace NUMBER #IMPLIED) ... should be defined locally.
-	 * (loop CDATA #IMPLIED)
-	 * (scrollamount NUMBER #IMPLIED)
-	 * (scrolldelay NUMBER #IMPLIED)
-	 * (vspace NUMBER #IMPLIED) ... should be defined locally.
-	 * (width CDATA #IMPLIED) ... should be defined locally.
-	 * (truespeed (truespeed) #IMPLIED)
-	 */
-	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_BEHAVIOR, HTML40Namespace.ATTR_NAME_BGCOLOR, HTML40Namespace.ATTR_NAME_DIRECTION, HTML40Namespace.ATTR_NAME_LOOP, HTML40Namespace.ATTR_NAME_SCROLLAMOUNT, HTML40Namespace.ATTR_NAME_SCROLLDELAY, HTML40Namespace.ATTR_NAME_TRUESPEED};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		HTMLCMDataTypeImpl atype = null;
-		HTMLAttrDeclImpl attr = null;
-		// (height CDATA #IMPLIED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_HEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_HEIGHT, attr);
-
-		// (width CDATA #IMPLIED) ... should be defined locally.
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_WIDTH, attr);
-
-		// (hspace NUMBER #IMPLIED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_HSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_HSPACE, attr);
-
-		// (vspace NUMBER #IMPLIED) ... should be defined locally.
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_VSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_VSPACE, attr);
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 1957036..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java
+++ /dev/null
@@ -1,88 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * MENU/DIR.
- */
-final class HedMENU extends HedListItemContainer {
-
-	/**
-	 */
-	public HedMENU(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-	}
-
-	/**
-	 * MENU/DIR.
-	 * (compact (compact) #IMPLIED)
-	 */
-	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_COMPACT};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 * Exclusion.
-	 * <code>MENU/DIR</code> has the exclusion.
-	 * It is <code>%block;</code>.
-	 * %block; is:
-	 * P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
-	 * NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
-	 * TABLE | FIELDSET | ADDRESS.
-	 * %heading; is: H1 | H2 | H3 | H4 | H5 | H6.
-	 * %list; is : UL | OL | DIR | MENU.
-	 * %preformatted; is PRE.
-	 */
-	public CMContent getExclusion() {
-		if (exclusion != null)
-			return exclusion; // already created.
-		if (elementCollection == null)
-			return null;
-
-		// %block;
-		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		String[] names = {HTML40Namespace.ElementName.P, HTML40Namespace.ElementName.H1, HTML40Namespace.ElementName.H2, HTML40Namespace.ElementName.H3, HTML40Namespace.ElementName.H4, HTML40Namespace.ElementName.H5, HTML40Namespace.ElementName.H6, HTML40Namespace.ElementName.UL, HTML40Namespace.ElementName.OL, HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU, HTML40Namespace.ElementName.PRE, HTML40Namespace.ElementName.DL, HTML40Namespace.ElementName.DIV, HTML40Namespace.ElementName.CENTER, HTML40Namespace.ElementName.NOSCRIPT, HTML40Namespace.ElementName.NOFRAMES, HTML40Namespace.ElementName.BLOCKQUOTE, HTML40Namespace.ElementName.FORM, HTML40Namespace.ElementName.ISINDEX, HTML40Namespace.ElementName.HR, HTML40Namespace.ElementName.TABLE, HTML40Namespace.ElementName.FIELDSET, HTML40Namespace.ElementName.ADDRESS};
-		elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
-		return exclusion;
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 3b7e008..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java
+++ /dev/null
@@ -1,59 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * META.
- */
-final class HedMETA extends HedEmpty {
-
-	/**
-	 */
-	public HedMETA(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.META, collection);
-		layoutType = LAYOUT_HIDDEN;
-	}
-
-	/**
-	 * 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)
-			return; // already created.
-		if (attributeCollection == null)
-			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());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMarkChanges.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMarkChanges.java
deleted file mode 100644
index 3cff404..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMarkChanges.java
+++ /dev/null
@@ -1,50 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * (INS|DEL)
- */
-final class HedMarkChanges extends HedFlowContainer {
-
-	/**
-	 */
-	public HedMarkChanges(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-	}
-
-	/**
-	 * %attrs;
-	 * (cite %URI; #IMPLIED)
-	 * (datetime %Datetime; #IMPLIED) 
-	 */
-	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_CITE, HTML40Namespace.ATTR_NAME_DATETIME};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOBR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOBR.java
deleted file mode 100644
index 4e3a1a2..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOBR.java
+++ /dev/null
@@ -1,33 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * NOBR -- not standard tag but it is commonly used.
- */
-final class HedNOBR extends HedInlineContainer {
-
-
-	public HedNOBR(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.NOBR, collection);
-		correctionType = HTMLElementDeclaration.CORRECT_DUPLICATED;
-	}
-
-	protected void createAttributeDeclarations() {
-		// No attributes is defined.
-		if (attributes != null)
-			return;
-		attributes = new CMNamedNodeMapImpl();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOEMBED.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOEMBED.java
deleted file mode 100644
index 3d5d5fd..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOEMBED.java
+++ /dev/null
@@ -1,42 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * NOEMBED.
- */
-final class HedNOEMBED extends HedFlowContainer {
-
-	/**
-	 */
-	public HedNOEMBED(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.NOEMBED, collection);
-	}
-
-	/**
-	 * %coreattrs;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %coreattrs;
-		attributeCollection.getCore(attributes);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOFRAMES.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOFRAMES.java
deleted file mode 100644
index 3d2d044..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOFRAMES.java
+++ /dev/null
@@ -1,79 +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
- *******************************************************************************/
-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.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;
-
-/**
- * NOFRAMES.
- */
-final class HedNOFRAMES extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedNOFRAMES(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.NOFRAMES, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_NOFRAMES_CONTENT;
-		layoutType = LAYOUT_HIDDEN;
-	}
-
-	/**
-	 * %attrs;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-	}
-
-	/**
-	 * Exclusion.
-	 * <code>NOFRAMES</code> has the exclusion.
-	 * It is <code>NOFRAMES</code> itself.
-	 */
-	public CMContent getExclusion() {
-		if (exclusion != null)
-			return exclusion; // already created.
-		if (elementCollection == null)
-			return null;
-
-		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		CMNode label = elementCollection.getNamedItem(HTML40Namespace.ElementName.NOFRAMES);
-		if (label != null)
-			exclusion.appendChild(label);
-
-		return exclusion;
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU, HTML40Namespace.ElementName.NOFRAMES};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOSCRIPT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOSCRIPT.java
deleted file mode 100644
index df9a403..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOSCRIPT.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-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.CMNamedNodeMap;
-
-/**
- * NOSCRIPT.
- */
-final class HedNOSCRIPT extends HedFlowContainer {
-
-	/**
-	 */
-	public HedNOSCRIPT(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.NOSCRIPT, collection);
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs;
-	 */
-	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;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOBJECT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOBJECT.java
deleted file mode 100644
index f229abb..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOBJECT.java
+++ /dev/null
@@ -1,86 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * OBJECT.
- */
-final class HedOBJECT extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedOBJECT(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.OBJECT, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_PARAM_CONTAINER;
-		layoutType = LAYOUT_OBJECT;
-		indentChild = true;
-	}
-
-	/**
-	 * %attrs;
-	 * %reserved; ... empty.
-	 * (declare (declare) #IMPLIED)
-	 * (classid %URI; #IMPLIED)
-	 * (codebase %URI; #IMPLIED)
-	 * (data %URI; #IMPLIED)
-	 * (type %ContentType; #IMPLIED)
-	 * (codetype %ContentType; #IMPLIED)
-	 * (archive CDATA #IMPLIED)
-	 * (standby %Text; #IMPLIED)
-	 * (height %Length; #IMPLIED)
-	 * (width %Length; #IMPLIED)
-	 * (usemap %URI; #IMPLIED)
-	 * (name CDATA #IMPLIED)
-	 * (tabindex NUMBER #IMPLIED)
-	 * (align %IAlign; #IMPLIED) ... should be defined locally.
-	 * (border %Pixels; #IMPLIED)
-	 * (hspace %Pixels; #IMPLIED)
-	 * (vspace %Pixels; #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// %reserved; ... empty.
-
-		String[] names = {HTML40Namespace.ATTR_NAME_DECLARE, HTML40Namespace.ATTR_NAME_CLASSID, HTML40Namespace.ATTR_NAME_CODEBASE, HTML40Namespace.ATTR_NAME_DATA, HTML40Namespace.ATTR_NAME_TYPE, HTML40Namespace.ATTR_NAME_CODETYPE, HTML40Namespace.ATTR_NAME_ARCHIVE, HTML40Namespace.ATTR_NAME_STANDBY, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_USEMAP, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_BORDER, HTML40Namespace.ATTR_NAME_HSPACE, HTML40Namespace.ATTR_NAME_VSPACE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-		// %align; ... should be defined locally.
-		HTMLAttrDeclImpl attr = AttributeCollection.createAlignForImage();
-		if (attr != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.PRE};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index ad26f3a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java
+++ /dev/null
@@ -1,70 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * OL.
- */
-final class HedOL extends HedListItemContainer {
-
-	/**
-	 */
-	public HedOL(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.OL, collection);
-	}
-
-	/**
-	 * OL.
-	 * (type %OLStyle; #IMPLIED) ... should be defined locally.
-	 * (compact (compact) #IMPLIED)
-	 * (start NUMBER #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %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());
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTGROUP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTGROUP.java
deleted file mode 100644
index 1367344..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTGROUP.java
+++ /dev/null
@@ -1,55 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * OPTGROUP.
- */
-final class HedOPTGROUP extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedOPTGROUP(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.OPTGROUP, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_OPTION_CONTAINER;
-		layoutType = LAYOUT_HIDDEN;
-		indentChild = true;
-	}
-
-	/**
-	 * %attrs;
-	 * (disabled (disabled) #IMPLIED)
-	 * (label %Text; #REQUIRED) ... should be defined locally.
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// (disabled (disabled) #IMPLIED)
-		String[] names = {HTML40Namespace.ATTR_NAME_DISABLED};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// (label %Text; #REQUIRED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_LABEL, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_LABEL, attr);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTION.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTION.java
deleted file mode 100644
index 0568bd7..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTION.java
+++ /dev/null
@@ -1,66 +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
- *******************************************************************************/
-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;
-
-
-/**
- * OPTION.
- */
-final class HedOPTION extends HedPcdata {
-
-	private static String[] terminators = {HTML40Namespace.ElementName.OPTION};
-
-	/**
-	 */
-	public HedOPTION(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.OPTION, collection);
-		layoutType = LAYOUT_HIDDEN;
-		omitType = OMIT_END;
-	}
-
-	/**
-	 * OPTION.
-	 * %attrs;
-	 * (selected (selected) #IMPLIED)
-	 * (disabled (disabled) #IMPLIED)
-	 * (label %Text; #IMPLIED)
-	 * (value CDATA #IMPLIED)
-	 */
-	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_SELECTED, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_LABEL, HTML40Namespace.ATTR_NAME_VALUE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 * OPTION has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedP.java
deleted file mode 100644
index 3ee637c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedP.java
+++ /dev/null
@@ -1,104 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * P.
- */
-final class HedP extends HedInlineContainer {
-
-	private static Collection terminators = null;
-
-	/**
-	 */
-	public HedP(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.P, collection);
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-		omitType = OMIT_END;
-	}
-
-	/**
-	 * Create all attribute declarations.
-	 * This method is called once in the constructor of the super class.
-	 * The <code>P</code> element may have the following attributes:
-	 * <table>
-	 * <tbody>
-	 *   <tr>
-	 *     <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>%attrs;</td><td>-</td><td>-</td><td>-</td><td>-</td>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>%align;</td><td>-</td><td>-</td><td>-</td><td>-</td>
-	 *   </tr>
-	 * </tbody>
-	 * </table>
-	 * <p><b>%align;</b> means <code>align (left|center|right|justify) #IMPLIED</code>.
-	 * Unfortunately, this <code>align</code> is different from one in
-	 * <code>IMG</code> or <code>TABLE</code>.  So, the attribute declaration
-	 * of <code>align</code> should be localy created and it shouldn't be registered
-	 * in a <code>HCMDocImpl</code> instance.</p>
-	 * <p>However, %align is used in sevaral times.  I wouldn't write same code
-	 * in many times.  So, I add a new utility method into <code>CMUtil</code>
-	 * to create the attribute declaration.</p>
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-		attributes = new CMNamedNodeMapImpl();
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// align
-		HTMLAttrDeclImpl adec = AttributeCollection.createAlignForParagraph();
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, adec);
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-		return prohibitedAncestors;
-	}
-
-	/**
-	 * Return names of terminators.
-	 * <code>P</code> has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		if (terminators != null)
-			return terminators.iterator();
-		//<<D217982
-		terminators = new Vector();
-		terminators.addAll(elementCollection.getNamesOfBlock());
-		terminators.add(HTML40Namespace.ElementName.LI);
-		terminators.add(HTML40Namespace.ElementName.DT);
-		terminators.add(HTML40Namespace.ElementName.DD);
-		//D217982
-		return terminators.iterator();
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index bb44fe5..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * PARAM.
- */
-final class HedPARAM extends HedEmpty {
-
-	/**
-	 */
-	public HedPARAM(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.PARAM, collection);
-		layoutType = LAYOUT_HIDDEN;
-	}
-
-	/**
-	 * 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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		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);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPRE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPRE.java
deleted file mode 100644
index 4e6b228..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPRE.java
+++ /dev/null
@@ -1,91 +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
- *******************************************************************************/
-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.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;
-
-/**
- * PRE.
- */
-final class HedPRE extends HedInlineContainer {
-
-	/**
-	 * PRE element should keep spaces in its source.
-	 */
-	public HedPRE(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.PRE, collection);
-		// CORRECT_EMPTY - GROUP_COMPACT
-		correctionType = CORRECT_EMPTY;
-
-		keepSpaces = true;
-	}
-
-	/**
-	 * %attrs;
-	 * (width NUMBER #IMPLIED) ... should be defined locally.
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// (width NUMBER #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_WIDTH, attr);
-	}
-
-	/**
-	 * Exclusion.
-	 * <code>PRE</code> has the exclusion.
-	 * It is <code>%pre.exclusion;</code>.
-	 * %pre.exclusion is:
-	 * IMG | OBJECT | APPLET | BIG | SMALL | SUB | SUP | FONT | BASEFONT
-	 */
-	public CMContent getExclusion() {
-		if (exclusion != null)
-			return exclusion; // already created.
-		if (elementCollection == null)
-			return null;
-
-		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		String[] names = {HTML40Namespace.ElementName.IMG, HTML40Namespace.ElementName.OBJECT, HTML40Namespace.ElementName.APPLET, HTML40Namespace.ElementName.BIG, HTML40Namespace.ElementName.SMALL, HTML40Namespace.ElementName.SUB, HTML40Namespace.ElementName.SUP, HTML40Namespace.ElementName.FONT, HTML40Namespace.ElementName.BASEFONT};
-		elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
-
-		return exclusion;
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPcdata.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPcdata.java
deleted file mode 100644
index 7e14c31..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPcdata.java
+++ /dev/null
@@ -1,47 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Base class for PCDATA type element declarations.<br>
- */
-abstract class HedPcdata extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedPcdata(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_PCDATA;
-	}
-
-	/**
-	 * Content.<br>
-	 * PCDATA type always returns <code>null</code>.
-	 * <br>
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
-	 */
-	public CMContent getContent() {
-		return null;
-	}
-
-	/**
-	 * Content type.<br>
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.PCDATA;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPhrase.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPhrase.java
deleted file mode 100644
index 7561e1e..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPhrase.java
+++ /dev/null
@@ -1,41 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * %phrase;
- */
-final class HedPhrase extends HedInlineContainer {
-
-	/**
-	 */
-	public HedPhrase(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		correctionType = HTMLElementDeclaration.CORRECT_DUPLICATED;
-	}
-
-	/**
-	 * %attrs;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedQ.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedQ.java
deleted file mode 100644
index 018232f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedQ.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * Q.
- */
-final class HedQ extends HedInlineContainer {
-
-	/**
-	 */
-	public HedQ(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.Q, collection);
-		correctionType = CORRECT_DUPLICATED;
-	}
-
-	/**
-	 * %attrs;
-	 * (cite %URI; #IMPLIED) 
-	 */
-	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_CITE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index a279a0d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java
+++ /dev/null
@@ -1,81 +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
- *******************************************************************************/
-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.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;
-
-/**
- * SCRIPT.
- */
-final class HedSCRIPT extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedSCRIPT(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.SCRIPT, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_CDATA;
-		layoutType = LAYOUT_OBJECT;
-	}
-
-	/**
-	 * 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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		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);
-	}
-
-	/**
-	 * <code>SCRIPT</code> is CDATA type.
-	 * So, the method always returns <code>null</code>.
-	 * <br>
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
-	 */
-	public CMContent getContent() {
-		return null;
-	}
-
-	/**
-	 * CDATA content.<br>
-	 * @return int
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.CDATA;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 8e3c3f4..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java
+++ /dev/null
@@ -1,79 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * SELECT.
- */
-final class HedSELECT extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedSELECT(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.SELECT, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_SELECT;
-		layoutType = LAYOUT_OBJECT;
-		indentChild = true;
-	}
-
-	/**
-	 * %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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(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());
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.BUTTON};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSPAN.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSPAN.java
deleted file mode 100644
index b5aaa17..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSPAN.java
+++ /dev/null
@@ -1,44 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * SPAN.
- */
-final class HedSPAN extends HedInlineContainer {
-
-	/**
-	 * SPAN.
-	 */
-	public HedSPAN(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.SPAN, collection);
-	}
-
-	/**
-	 * %attrs;
-	 * %reserved; ... empty.
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIBase.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIBase.java
deleted file mode 100644
index 6638be7..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIBase.java
+++ /dev/null
@@ -1,50 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-
-
-
-/**
- * Base class for SSI declarations.
- */
-abstract class HedSSIBase extends HedEmpty {
-
-	/**
-	 */
-	public HedSSIBase(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		layoutType = LAYOUT_OBJECT;
-	}
-
-	/**
-	 */
-	public int getFormatType() {
-		return HTMLElementDeclaration.FORMAT_SSI;
-	}
-
-	/**
-	 */
-	public boolean supports(String propName) {
-		if (propName.equals(HTMLCMProperties.IS_SSI))
-			return true;
-		return super.supports(propName);
-	}
-
-	/*
-	 */
-	public Object getProperty(String propName) {
-		if (propName.equals(HTMLCMProperties.IS_SSI))
-			return new Boolean(true);
-		return super.getProperty(propName);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIConfig.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIConfig.java
deleted file mode 100644
index 71d292c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIConfig.java
+++ /dev/null
@@ -1,48 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:CONFIG.
- */
-final class HedSSIConfig extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIConfig(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.SSI_CONFIG, collection);
-	}
-
-	/**
-	 * SSI:CONFIG.
-	 * (errmsg CDATA #IMPLIED)
-	 * (sizefmt CDATA #IMPLIED)
-	 * (timefmt CDATA #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {HTML40Namespace.ATTR_NAME_ERRMSG, HTML40Namespace.ATTR_NAME_SIZEFMT, HTML40Namespace.ATTR_NAME_TIMEFMT};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIEcho.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIEcho.java
deleted file mode 100644
index 38c5e6d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIEcho.java
+++ /dev/null
@@ -1,46 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:ECHO.
- */
-final class HedSSIEcho extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIEcho(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.SSI_ECHO, collection);
-	}
-
-	/**
-	 * SSI:ECHO
-	 * (var CDATA #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {HTML40Namespace.ATTR_NAME_VAR};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIExec.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIExec.java
deleted file mode 100644
index b2c3c85..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIExec.java
+++ /dev/null
@@ -1,47 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:EXEC.
- */
-final class HedSSIExec extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIExec(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.SSI_EXEC, collection);
-	}
-
-	/**
-	 * SSI:EXEC
-	 * (cgi %URI; #IMPLIED)
-	 * (cmd CDATA #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {HTML40Namespace.ATTR_NAME_CGI, HTML40Namespace.ATTR_NAME_CMD};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFlastmod.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFlastmod.java
deleted file mode 100644
index 4a83941..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFlastmod.java
+++ /dev/null
@@ -1,47 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:FLASTMOD.
- */
-final class HedSSIFlastmod extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIFlastmod(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.SSI_FLASTMOD, collection);
-	}
-
-	/**
-	 * SSI:FLASTMOD
-	 * (file %URI; #IMPLIED)
-	 * (virtual %URI #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {HTML40Namespace.ATTR_NAME_FILE, HTML40Namespace.ATTR_NAME_VIRTUAL};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFsize.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFsize.java
deleted file mode 100644
index 93f7541..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFsize.java
+++ /dev/null
@@ -1,47 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:FSIZE.
- */
-final class HedSSIFsize extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIFsize(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.SSI_FSIZE, collection);
-	}
-
-	/**
-	 * SSI:FSIZE
-	 * (file %URI; #IMPLIED)
-	 * (virtual %URI #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {HTML40Namespace.ATTR_NAME_FILE, HTML40Namespace.ATTR_NAME_VIRTUAL};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIInclude.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIInclude.java
deleted file mode 100644
index d28a553..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIInclude.java
+++ /dev/null
@@ -1,47 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:INCLUDE.
- */
-final class HedSSIInclude extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIInclude(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.SSI_INCLUDE, collection);
-	}
-
-	/**
-	 * SSI:INCLUDE
-	 * (file %URI; #IMPLIED)
-	 * (virtual %URI #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {HTML40Namespace.ATTR_NAME_FILE, HTML40Namespace.ATTR_NAME_VIRTUAL};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIPrintenv.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIPrintenv.java
deleted file mode 100644
index 05c303d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIPrintenv.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-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.CMNamedNodeMap;
-
-/**
- * SSI:PRINTENV.
- */
-final class HedSSIPrintenv extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIPrintenv(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.SSI_PRINTENV, collection);
-	}
-
-	/**
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-	}
-
-	/**
-	 * SSI:PRINTENV has no attributes.  So, this method should
-	 * always return <code>null</code>.
-	 * Note: Since somebody doesn't expect null is returned, return the empty attribute
-	 * like a custom tag which doesn't have attributes
-	 */
-	public CMNamedNodeMap getAttributes() {
-		return super.getAttributes();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSISet.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSISet.java
deleted file mode 100644
index ed8c41a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSISet.java
+++ /dev/null
@@ -1,47 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:SET.
- */
-final class HedSSISet extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSISet(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.SSI_SET, collection);
-	}
-
-	/**
-	 * SSI:SET
-	 * (var CDATA #IMPLIED)
-	 * (value CDATA #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {HTML40Namespace.ATTR_NAME_VAR, HTML40Namespace.ATTR_NAME_VALUE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 3782d5b..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java
+++ /dev/null
@@ -1,77 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * STYLE.
- */
-final class HedSTYLE extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedSTYLE(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.STYLE, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_CDATA;
-		layoutType = LAYOUT_HIDDEN;
-	}
-
-	/**
-	 * STYLE
-	 * %i18n;
-	 * (type %ContentType; #REQUIRED) ... should be defined locally.
-	 * (media %MediaDesc; #IMPLIED)
-	 * (title %Text; #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			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);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-	}
-
-	/**
-	 * Content.<br>
-	 * <code>STYLE</code> is CDATA content type.  So, it always returns <code>null</code>.
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
-	 */
-	public CMContent getContent() {
-		return null;
-	}
-
-	/**
-	 * CDATA content.<br>
-	 * @return int
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.CDATA;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedScripts.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedScripts.java
deleted file mode 100644
index dab20e1..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedScripts.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-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.CMNamedNodeMap;
-
-/**
- * SUB and SUP.
- */
-final class HedScripts extends HedInlineContainer {
-
-	/**
-	 */
-	public HedScripts(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		correctionType = CORRECT_EMPTY;
-	}
-
-	/**
-	 * %attrs;
-	 */
-	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.PRE};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 77aea58..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java
+++ /dev/null
@@ -1,90 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * TABLE.
- */
-final class HedTABLE extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedTABLE(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.TABLE, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_TABLE;
-		layoutType = LAYOUT_BLOCK;
-		indentChild = true;
-	}
-
-	/**
-	 * 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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %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);
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 4fb0f5e..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java
+++ /dev/null
@@ -1,77 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * TEXTAREA.
- */
-final class HedTEXTAREA extends HedPcdata {
-
-	/**
-	 * TEXTAREA should keep spaces in its source.
-	 */
-	public HedTEXTAREA(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.TEXTAREA, collection);
-		layoutType = LAYOUT_OBJECT;
-
-		keepSpaces = true;
-	}
-
-	/**
-	 * 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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-		attributes = new CMNamedNodeMapImpl();
-
-		// %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());
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.BUTTON};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTITLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTITLE.java
deleted file mode 100644
index ae8cf19..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTITLE.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * TITLE.
- */
-final class HedTITLE extends HedPcdata {
-
-	/**
-	 */
-	public HedTITLE(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.TITLE, collection);
-		layoutType = LAYOUT_HIDDEN;
-	}
-
-	/**
-	 * TITLE.
-	 * %i18n;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %i18n;
-		attributeCollection.getI18n(attributes);
-	}
-
-	/**
-	 * Exclusion.
-	 * <code>TITLE</code> has the exclusion.
-	 * It is <code>%head.misc;</code>.
-	 * %head.misc; is <code>SCRIPT|STYLE|META|LINK|OBJECT</code>.
-	 */
-	public CMContent getExclusion() {
-		if (exclusion != null)
-			return exclusion; // already created.
-		if (elementCollection == null)
-			return null;
-
-		// (SCRIPT|STYLE|META|LINK|OBJECT)
-		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-
-		String[] names = {HTML40Namespace.ElementName.SCRIPT, HTML40Namespace.ElementName.STYLE, HTML40Namespace.ElementName.META, HTML40Namespace.ElementName.LINK, HTML40Namespace.ElementName.OBJECT};
-		elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
-		return exclusion;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTR.java
deleted file mode 100644
index cf15cf0..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTR.java
+++ /dev/null
@@ -1,74 +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
- *******************************************************************************/
-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;
-
-
-/**
- * TR.
- */
-final class HedTR extends HTMLElemDeclImpl {
-
-	private static String[] terminators = {HTML40Namespace.ElementName.TR};
-
-	/**
-	 */
-	public HedTR(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.TR, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_TCELL_CONTAINER;
-		layoutType = LAYOUT_BLOCK;
-		omitType = OMIT_END;
-		indentChild = true;
-	}
-
-	/**
-	 * %attrs;
-	 * %cellhalign;
-	 * %cellvalign;
-	 * (bgcolor %Color; #IMPLIED)
-	 * (background %URI; #IMPLIED)
-	 * (bordercolor %Color #IMPLIED) ... D205514
-	 * (height %Length #IMPLIED) bug2246
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// %cellhalign;
-		attributeCollection.getCellhalign(attributes);
-		// %cellvalign;
-		attributeCollection.getCellvalign(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_BGCOLOR, HTML40Namespace.ATTR_NAME_BACKGROUND, HTML40Namespace.ATTR_NAME_BORDERCOLOR, HTML40Namespace.ATTR_NAME_HEIGHT // D205514
-		};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 * TR has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableBody.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableBody.java
deleted file mode 100644
index ad2e6a7..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableBody.java
+++ /dev/null
@@ -1,73 +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
- *******************************************************************************/
-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;
-
-
-/**
- * THEAD/TFOOT/TBODY
- */
-final class HedTableBody extends HTMLElemDeclImpl {
-
-	private static String[] terminators = {HTML40Namespace.ElementName.CAPTION, HTML40Namespace.ElementName.COL, HTML40Namespace.ElementName.COLGROUP, HTML40Namespace.ElementName.THEAD, HTML40Namespace.ElementName.TBODY, HTML40Namespace.ElementName.TFOOT};
-
-	/**
-	 */
-	public HedTableBody(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_TR_CONTAINER;
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-		if (elementName == HTML40Namespace.ElementName.TBODY) {
-			omitType = OMIT_BOTH;
-		}
-		else {
-			omitType = OMIT_END;
-		}
-		indentChild = true;
-	}
-
-	/**
-	 * TBODY/TFOOT/THEAD
-	 * %attrs;
-	 * %cellhalign;
-	 * %cellvalign;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// %cellhalign;
-		attributeCollection.getCellhalign(attributes);
-		// %cellvalign;
-		attributeCollection.getCellvalign(attributes);
-	}
-
-	/**
-	 * THEAD, TFOOT and TBODY have terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableCell.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableCell.java
deleted file mode 100644
index 5a791e6..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableCell.java
+++ /dev/null
@@ -1,80 +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
- *******************************************************************************/
-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;
-
-
-/**
- * (TH | TD).
- */
-final class HedTableCell extends HedFlowContainer {
-
-	private static String[] terminators = {HTML40Namespace.ElementName.TR, HTML40Namespace.ElementName.TH, HTML40Namespace.ElementName.TD};
-
-	/**
-	 */
-	public HedTableCell(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		layoutType = LAYOUT_BLOCK;
-		omitType = OMIT_END;
-	}
-
-	/**
-	 * %attrs;
-	 * (abbr %Text; #IMPLIED)
-	 * (axis CDATA #IMPLIED)
-	 * (headers IDREFS #IMPLIED)
-	 * (scope %Scope; #IMPLIED)
-	 * (rowspan NUMBER 1)
-	 * (colspan NUMBER 1)
-	 * %cellhalign;
-	 * %cellvalign;
-	 * (nowrap (nowrap) #IMPLIED)
-	 * (bgcolor %Color; #IMPLIED)
-	 * (width %Length; #IMPLIED)
-	 * (height %Length; #IMPLIED)
-	 * (background %URI; #IMPLIED)
-	 * (bordercolor %Color #IMPLIED) ... D205514
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// %cellhalign;
-		attributeCollection.getCellhalign(attributes);
-		// %cellvalign;
-		attributeCollection.getCellvalign(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_ABBR, HTML40Namespace.ATTR_NAME_AXIS, HTML40Namespace.ATTR_NAME_HEADERS, HTML40Namespace.ATTR_NAME_SCOPE, HTML40Namespace.ATTR_NAME_ROWSPAN, HTML40Namespace.ATTR_NAME_COLSPAN, HTML40Namespace.ATTR_NAME_NOWRAP, HTML40Namespace.ATTR_NAME_BGCOLOR, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_BACKGROUND, HTML40Namespace.ATTR_NAME_BORDERCOLOR // D205514
-		};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 * TH and TD have terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedUL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedUL.java
deleted file mode 100644
index 2244e67..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedUL.java
+++ /dev/null
@@ -1,73 +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
- *******************************************************************************/
-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.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * UL.
- */
-final class HedUL extends HedListItemContainer {
-
-	/**
-	 */
-	public HedUL(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.UL, collection);
-	}
-
-	/**
-	 * UL.
-	 * (type %ULStyle; #IMPLIED) ... should be defined locally.
-	 * (compact (compact) #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-		// (type %ULStyle; #IMPLIED) ... should be defined locally.
-		// %ULStyle; is (disc|square|circle).
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		String[] values = {HTML40Namespace.ATTR_VALUE_DISC, HTML40Namespace.ATTR_VALUE_SQUARE, HTML40Namespace.ATTR_VALUE_CIRCLE};
-		atype.setEnumValues(values);
-		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};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedWBR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedWBR.java
deleted file mode 100644
index 2e4e54d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedWBR.java
+++ /dev/null
@@ -1,32 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-final class HedWBR extends HedEmpty {
-
-	public HedWBR(ElementCollection collection) {
-		super(HTML40Namespace.ElementName.WBR, collection);
-		// LAYOUT_BREAK.
-		// same as BR.
-		layoutType = LAYOUT_BREAK;
-	}
-
-	protected void createAttributeDeclarations() {
-		// No attributes is defined.
-		if (attributes != null)
-			return;
-		attributes = new CMNamedNodeMapImpl();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCMDocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCMDocImpl.java
deleted file mode 100644
index 0d60d50..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCMDocImpl.java
+++ /dev/null
@@ -1,73 +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
- *******************************************************************************/
-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.CMNode;
-
-/**
- * Implementation of CMDocument for the JSP 1.1.
- */
-class JCMDocImpl extends CMNodeImpl implements JSPCMDocument {
-
-	/** Namespace for all names of elements, entities and attributes. */
-	private CMNamespaceImpl namespace = null;
-	private JSPElementCollection elements = null;
-
-	/**
-	 * HCMDocImpl constructor comment.
-	 */
-	public JCMDocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
-		super(docTypeName);
-		namespace = targetNamespace;
-		elements = new JSPElementCollection();
-	}
-
-	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 null;
-	}
-
-	public HTMLEntityDeclaration getEntityDeclaration(String entityName) {
-		return null;
-	}
-
-	/**
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
-	 */
-	public org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace getNamespace() {
-		return namespace;
-	}
-
-	/**
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 */
-	public int getNodeType() {
-		return CMNode.DOCUMENT;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP11Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP11Namespace.java
deleted file mode 100644
index acfff3b..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP11Namespace.java
+++ /dev/null
@@ -1,112 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-/**
- * JSP 1.1 Namespace. Note, this interface was 
- * copied form JSP core packages. One implication 
- * is that extra care is needed in using '==' instead 
- * of '.equals'.
- */
-public interface JSP11Namespace {
-
-	public static interface ElementName {
-		// Element names
-		public static final String SCRIPTLET = "jsp:scriptlet"; //$NON-NLS-1$
-		public static final String EXPRESSION = "jsp:expression"; //$NON-NLS-1$
-		public static final String DECLARATION = "jsp:declaration"; //$NON-NLS-1$
-		public static final String DIRECTIVE_PAGE = "jsp:directive.page"; //$NON-NLS-1$
-		public static final String DIRECTIVE_INCLUDE = "jsp:directive.include"; //$NON-NLS-1$
-		public static final String DIRECTIVE_TAGLIB = "jsp:directive.taglib"; //$NON-NLS-1$
-		public static final String USEBEAN = "jsp:useBean"; //$NON-NLS-1$
-		public static final String SETPROPERTY = "jsp:setProperty"; //$NON-NLS-1$
-		public static final String GETPROPERTY = "jsp:getProperty"; //$NON-NLS-1$
-		public static final String INCLUDE = "jsp:include"; //$NON-NLS-1$
-		public static final String FORWARD = "jsp:forward"; //$NON-NLS-1$
-		public static final String PLUGIN = "jsp:plugin"; //$NON-NLS-1$
-		public static final String PARAMS = "jsp:params"; //$NON-NLS-1$
-		public static final String FALLBACK = "jsp:fallback"; //$NON-NLS-1$
-		public static final String PARAM = "jsp:param"; //$NON-NLS-1$
-		public static final String ROOT = "jsp:root"; //$NON-NLS-1$
-		public static final String TEXT = "jsp:text"; //$NON-NLS-1$
-	}
-
-	public static final String JSP11_URI = ""; //$NON-NLS-1$
-	public static final String JSP_TAG_PREFIX = "jsp"; //$NON-NLS-1$
-	// attribute names
-	//   directive.page
-	public static final String ATTR_NAME_LANGUAGE = "language"; //$NON-NLS-1$
-	public static final String ATTR_NAME_EXTENDS = "extends"; //$NON-NLS-1$
-	public static final String ATTR_NAME_CONTENT_TYPE = "contentType"; //$NON-NLS-1$
-	public static final String ATTR_NAME_IMPORT = "import"; //$NON-NLS-1$
-	public static final String ATTR_NAME_SESSION = "session"; //$NON-NLS-1$
-	public static final String ATTR_NAME_BUFFER = "buffer"; //$NON-NLS-1$
-	public static final String ATTR_NAME_AUTOFLUSH = "autoFlush"; //$NON-NLS-1$
-	public static final String ATTR_NAME_IS_THREAD_SAFE = "isThreadSafe"; //$NON-NLS-1$
-	public static final String ATTR_NAME_INFO = "info"; //$NON-NLS-1$
-	public static final String ATTR_NAME_ERROR_PAGE = "errorPage"; //$NON-NLS-1$
-	public static final String ATTR_NAME_IS_ERROR_PAGE = "isErrorPage"; //$NON-NLS-1$
-	public static final String ATTR_NAME_PAGE_ENCODING = "pageEncoding"; //$NON-NLS-1$
-	//   directive.include
-	public static final String ATTR_NAME_FILE = "file"; //$NON-NLS-1$
-	//   directive.taglib
-	public static final String ATTR_NAME_URI = "uri"; //$NON-NLS-1$
-	public static final String ATTR_NAME_PREFIX = "prefix"; //$NON-NLS-1$
-	//   useBean
-	public static final String ATTR_NAME_ID = "id"; //$NON-NLS-1$
-	public static final String ATTR_NAME_SCOPE = "scope"; //$NON-NLS-1$
-	public static final String ATTR_NAME_CLASS = "class"; //$NON-NLS-1$
-	public static final String ATTR_NAME_BEAN_NAME = "beanName"; //$NON-NLS-1$
-	public static final String ATTR_NAME_TYPE = "type"; //$NON-NLS-1$
-	//   setProperty
-	public static final String ATTR_NAME_NAME = "name"; //$NON-NLS-1$
-	public static final String ATTR_NAME_PROPERTY = "property"; //$NON-NLS-1$
-	public static final String ATTR_NAME_VALUE = "value"; //$NON-NLS-1$
-	public static final String ATTR_NAME_PARAM = "param"; //$NON-NLS-1$
-	//   include
-	public static final String ATTR_NAME_PAGE = "page"; //$NON-NLS-1$
-	public static final String ATTR_NAME_FLUSH = "flush"; //$NON-NLS-1$
-	//   plugin
-	public static final String ATTR_NAME_CODE = "code"; //$NON-NLS-1$
-	public static final String ATTR_NAME_CODEBASE = "codebase"; //$NON-NLS-1$
-	public static final String ATTR_NAME_ALIGN = "align"; //$NON-NLS-1$
-	public static final String ATTR_NAME_ARCHIVE = "archive"; //$NON-NLS-1$
-	public static final String ATTR_NAME_HEIGHT = "height"; //$NON-NLS-1$
-	public static final String ATTR_NAME_HSPACE = "hspace"; //$NON-NLS-1$
-	public static final String ATTR_NAME_JREVERSION = "jreversion"; //$NON-NLS-1$
-	public static final String ATTR_NAME_VSPACE = "vspace"; //$NON-NLS-1$
-	public static final String ATTR_NAME_WIDTH = "width"; //$NON-NLS-1$
-	public static final String ATTR_NAME_NSPLUGINURL = "nspluginurl"; //$NON-NLS-1$
-	public static final String ATTR_NAME_IEPLUGINURL = "iepluginurl"; //$NON-NLS-1$
-	//   root
-	public static final String ATTR_NAME_XMLNS_JSP = "xmlns:jsp"; //$NON-NLS-1$
-	public static final String ATTR_NAME_VERSION = "version"; //$NON-NLS-1$
-	// attribute values
-	public static final String ATTR_VALUE_TRUE = "true"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_FALSE = "false"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_JAVA = "java"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_CT_DEFAULT = "text/html; charset=ISO-8859-1";//D195366 //$NON-NLS-1$
-	public static final String ATTR_VALUE_BUFSIZ_DEFAULT = "8kb"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_PAGE = "page"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_SESSION = "session"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_REQUEST = "request"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_APPLICATION = "application"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_BEAN = "bean"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_APPLET = "applet"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_TOP = "top"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_MIDDLE = "middle"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_BOTTOM = "bottom"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_LEFT = "left"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_RIGHT = "right"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_JVER11 = "1.1"; //$NON-NLS-1$
-	public static final String ATTR_VALUE_XMLNS_JSP = "http://java.sun.com/JSP/Page"; //$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/contentmodel/JSPCMDocument.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPCMDocument.java
deleted file mode 100644
index a7f37c9..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPCMDocument.java
+++ /dev/null
@@ -1,28 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * JSP extension for CMDocument.
- * This interface provides some short hand methods to get declarations
- * by a name.
- */
-public interface JSPCMDocument extends org.eclipse.wst.xml.core.internal.contentmodel.CMDocument {
-
-	/**
-	 * A short hand method to get a element declaration for a JSP element.
-	 * JSP declaration class implements HTMLElementDeclaration interface.
-	 * @param elementName java.lang.String
-	 */
-	HTMLElementDeclaration getElementDeclaration(String elementName);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java
deleted file mode 100644
index a2efa22..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java
+++ /dev/null
@@ -1,895 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-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.CMNode;
-
-/**
- * Factory for element declarations of the JSP 1.1.
- */
-final class JSPElementCollection extends DeclCollection implements JSP11Namespace.ElementName {
-
-
-	private class TypePacket {
-		public String name = null;
-		public int content = CMElementDeclaration.EMPTY;
-		public int omit = HTMLElementDeclaration.OMIT_NONE;
-		public int lineBreak = HTMLElementDeclaration.BREAK_NONE;
-		public int layout = HTMLElementDeclaration.LAYOUT_NONE;
-		public int correct = HTMLElementDeclaration.CORRECT_NONE;
-		public int format = HTMLElementDeclaration.FORMAT_XML;
-		public boolean indentChild = false;
-
-		public TypePacket() {
-		}
-	}
-
-	/** JSP element declaration. */
-	private class ElemDecl extends CMContentImpl implements HTMLElementDeclaration, HTMLPropertyDeclaration {
-		private TypePacket type = null;
-		private CMGroupImpl content = null;
-		private CMNamedNodeMapImpl attributes = null;
-
-		public ElemDecl(TypePacket t) {
-			super(t.name, 1, 1);
-			type = t;
-		}
-
-		public void setContent(CMGroupImpl group) {
-			content = group;
-		}
-
-		public void setAttributes(CMNamedNodeMapImpl attrs) {
-			attributes = attrs;
-		}
-
-		// implementes CMNode
-		public int getNodeType() {
-			return CMNode.ELEMENT_DECLARATION;
-		}
-
-		public boolean supports(String propertyName) {
-			if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
-				return true;
-			}
-			else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
-				return true;
-			}
-			else {
-				PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
-				if (pp == null)
-					return false;
-				return pp.supports(this);
-			}
-		}
-
-		public Object getProperty(String propertyName) {
-			if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
-				return new Boolean(false); //D208839
-			}
-			else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
-				String myName = getElementName();
-				if (myName == JSP11Namespace.ElementName.PLUGIN) {
-					return getNamedItem(JSP11Namespace.ElementName.PARAMS); // outer class method.
-				}
-				else if (myName == JSP11Namespace.ElementName.PARAMS) {
-					return getNamedItem(JSP11Namespace.ElementName.PARAM); // outer class method.
-				}
-				else {
-					return null;
-				}
-			}
-			else {
-				PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
-				if (pp == null)
-					return null;
-				return pp.get(this);
-			}
-		}
-
-		// implementes CMElementDeclaration
-		public CMNamedNodeMap getAttributes() {
-			return attributes;
-		}
-
-		public CMContent getContent() {
-			return content;
-		}
-
-		public int getContentType() {
-			return type.content;
-		}
-
-		public CMDataType getDataType() {
-			return null;
-		}
-
-		public String getElementName() {
-			return getNodeName();
-		}
-
-		public CMNamedNodeMap getLocalElements() {
-			return null;
-		}
-
-		// implementes HTMLElementDeclaration
-		public HTMLAttributeDeclaration getAttributeDeclaration(String attrName) {
-			if (attributes == null)
-				return null;
-			return (HTMLAttributeDeclaration) attributes.getNamedItem(attrName);
-		}
-
-		public int getCorrectionType() {
-			return type.correct;
-		}
-
-		public CMContent getExclusion() {
-			return null;
-		}
-
-		public CMContent getInclusion() {
-			return null;
-		}
-
-		public CMNamedNodeMap getProhibitedAncestors() {
-			return EMPTY_MAP;
-		}
-
-		public int getFormatType() {
-			return type.format;
-		}
-
-		public int getLayoutType() {
-			return type.layout;
-		}
-
-		public int getLineBreakHint() {
-			return type.lineBreak;
-		}
-
-		public int getOmitType() {
-			return type.omit;
-		}
-
-		public boolean shouldTerminateAt(HTMLElementDeclaration dec) {
-			return false;
-		}
-
-		public boolean shouldKeepSpaces() {
-			return false;
-		}
-
-		public boolean shouldIndentChildSource() {
-			return type.indentChild;
-		}
-
-		public boolean isJSP() {
-			return true;
-		}
-	}
-
-	// element IDs
-	private static class Ids {
-		public static final int ID_SCRIPTLET = 0;
-		public static final int ID_EXPRESSION = 1;
-		public static final int ID_DECLARATION = 2;
-		public static final int ID_DIRECTIVE_PAGE = 3;
-		public static final int ID_DIRECTIVE_INCLUDE = 4;
-		public static final int ID_DIRECTIVE_TAGLIB = 5;
-		public static final int ID_USEBEAN = 6;
-		public static final int ID_SETPROPERTY = 7;
-		public static final int ID_GETPROPERTY = 8;
-		public static final int ID_INCLUDE = 9;
-		public static final int ID_FORWARD = 10;
-		public static final int ID_PLUGIN = 11;
-		public static final int ID_PARAMS = 12;
-		public static final int ID_FALLBACK = 13;
-		public static final int ID_PARAM = 14;
-		public static final int ID_ROOT = 15;
-		public static final int ID_TEXT = 16;
-
-		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 = Ids.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;
-	}
-
-	// attribute creater
-	private class JACreater implements JSP11Namespace {
-		// attribute declaration
-		private class AttrDecl extends CMNodeImpl implements HTMLAttributeDeclaration {
-			HTMLCMDataTypeImpl type = null;
-			int usage = CMAttributeDeclaration.OPTIONAL;
-
-			// methods
-			public AttrDecl(String attrName) {
-				super(attrName);
-			}
-
-			public String getAttrName() {
-				return getNodeName();
-			}
-
-			public CMDataType getAttrType() {
-				return type;
-			}
-
-			/** @deprecated by superclass */
-			public String getDefaultValue() {
-				if (type.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_DEFAULT)
-					return null;
-				return type.getImpliedValue();
-			}
-
-			/** @deprecated  by superclass */
-			public Enumeration getEnumAttr() {
-				Vector v = new Vector(Arrays.asList(type.getEnumeratedValues()));
-				return v.elements();
-			}
-
-			public int getNodeType() {
-				return CMNode.ATTRIBUTE_DECLARATION;
-			}
-
-			public int getUsage() {
-				return usage;
-			}
-
-			public boolean shouldIgnoreCase() {
-				return false;
-			}
-		}
-
-		private CMNamedNodeMapImpl declarations = null;
-
-		public JACreater() {
-			declarations = new CMNamedNodeMapImpl();
-		}
-
-		public CMNamedNodeMapImpl getDeclarations(int eid) {
-			switch (eid) {
-				case Ids.ID_DIRECTIVE_PAGE :
-					createForDirPage();
-					break;
-				case Ids.ID_DIRECTIVE_INCLUDE :
-					createForDirInclude();
-					break;
-				case Ids.ID_DIRECTIVE_TAGLIB :
-					createForDirTaglib();
-					break;
-				case Ids.ID_USEBEAN :
-					createForUseBean();
-					break;
-				case Ids.ID_SETPROPERTY :
-					createForSetProperty();
-					break;
-				case Ids.ID_GETPROPERTY :
-					createForGetProperty();
-					break;
-				case Ids.ID_INCLUDE :
-					createForInclude();
-					break;
-				case Ids.ID_FORWARD :
-					createForForward();
-					break;
-				case Ids.ID_PLUGIN :
-					createForPlugin();
-					break;
-				case Ids.ID_PARAM :
-					createForParam();
-					break;
-				case Ids.ID_ROOT :
-					createForRoot();
-					break;
-				default :
-					// should warn.
-					break;
-			}
-			return declarations;
-		}
-
-		private AttrDecl createBoolType(String name, String defValue) {
-			AttrDecl adec = new AttrDecl(name);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
-			adec.type.setEnumValues(values);
-			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, defValue);
-			return adec;
-		}
-
-		private void createForDirPage() {
-			AttrDecl adec = null;
-			// ("language" CDATA DECLARED "java")
-			adec = new AttrDecl(ATTR_NAME_LANGUAGE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_JAVA);
-			declarations.putNamedItem(ATTR_NAME_LANGUAGE, adec);
-
-			// ("extends" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_EXTENDS);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_EXTENDS, adec);
-
-			// ("contentType" CDATA DECLARED "text/html; ISO-8859-1")
-			adec = new AttrDecl(ATTR_NAME_CONTENT_TYPE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_CT_DEFAULT);
-			declarations.putNamedItem(ATTR_NAME_CONTENT_TYPE, adec);
-
-			// ("import" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_IMPORT);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_IMPORT, adec);
-
-			// ("session" ENUM DECLARED (true|false) "true")
-			adec = createBoolType(ATTR_NAME_SESSION, ATTR_VALUE_TRUE);
-			if (adec != null)
-				declarations.putNamedItem(ATTR_NAME_SESSION, adec);
-
-			// ("buffer" CDATA DECLARED "8kb")
-			adec = new AttrDecl(ATTR_NAME_BUFFER);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_BUFSIZ_DEFAULT);
-			declarations.putNamedItem(ATTR_NAME_BUFFER, adec);
-
-			// ("autoFlush" ENUM DECLARED (true|false) "true")
-			adec = createBoolType(ATTR_NAME_AUTOFLUSH, ATTR_VALUE_TRUE);
-			if (adec != null)
-				declarations.putNamedItem(ATTR_NAME_AUTOFLUSH, adec);
-
-			// ("isThreadSafe" ENUM DECLARED (true|false) "true")
-			adec = createBoolType(ATTR_NAME_IS_THREAD_SAFE, ATTR_VALUE_TRUE);
-			if (adec != null)
-				declarations.putNamedItem(ATTR_NAME_IS_THREAD_SAFE, adec);
-
-			// ("info" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_INFO);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_INFO, adec);
-
-			// ("errorPage" URI IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_ERROR_PAGE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
-			declarations.putNamedItem(ATTR_NAME_ERROR_PAGE, adec);
-
-			// ("isErrorPage" ENUM DECLARED (true|false) "false")
-			adec = createBoolType(ATTR_NAME_IS_ERROR_PAGE, ATTR_VALUE_FALSE);
-			if (adec != null)
-				declarations.putNamedItem(ATTR_NAME_IS_ERROR_PAGE, adec);
-
-			// ("pageEncoding" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_PAGE_ENCODING);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_PAGE_ENCODING, adec);
-
-		}
-
-		private void createForDirInclude() {
-			// ("file" URI REQUIRED); Defect TORO:185241
-			AttrDecl adec = new AttrDecl(ATTR_NAME_FILE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_FILE, adec);
-		}
-
-		private void createForDirTaglib() {
-			// ("uri" URI REQUIRED)
-			AttrDecl adec = new AttrDecl(ATTR_NAME_URI);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_URI, adec);
-
-			// ("prefix" CDATA REQUIRED)
-			adec = new AttrDecl(ATTR_NAME_PREFIX);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_PREFIX, adec);
-		}
-
-		private void createForUseBean() {
-			// ("id" ID REQUIRED)
-			AttrDecl adec = new AttrDecl(ATTR_NAME_ID);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.ID);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_ID, adec);
-
-			// ("scope" ENUM DECLARED (page|session|request|application) "page")
-			adec = new AttrDecl(ATTR_NAME_SCOPE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_PAGE, ATTR_VALUE_SESSION, ATTR_VALUE_REQUEST, ATTR_VALUE_APPLICATION};
-			adec.type.setEnumValues(values);
-			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_PAGE);
-			declarations.putNamedItem(ATTR_NAME_SCOPE, adec);
-
-			// ("class" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_CLASS);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_CLASS, adec);
-
-			// ("beanName" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_BEAN_NAME);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_BEAN_NAME, adec);
-
-			// ("type" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_TYPE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_TYPE, adec);
-		}
-
-		private void createForSetProperty() {
-			// ("name" IDREF REQUIRED)
-			AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.IDREF);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
-			// ("property" CDATA REQUIRED)
-			adec = new AttrDecl(ATTR_NAME_PROPERTY);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_PROPERTY, adec);
-
-			// ("value" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_VALUE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_VALUE, adec);
-
-			// ("param" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_PARAM);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_PARAM, adec);
-
-		}
-
-		private void createForGetProperty() {
-			// ("name" IDREF REQUIRED)
-			AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.IDREF);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
-			// ("property" CDATA REQUIRED)
-			adec = new AttrDecl(ATTR_NAME_PROPERTY);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_PROPERTY, adec);
-
-		}
-
-		private void createForInclude() {
-			AttrDecl adec = null;
-			// ("page" URI REQUIRED)
-			adec = new AttrDecl(ATTR_NAME_PAGE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_PAGE, adec);
-
-			// ("flush" ENUM REQUIRED (true|false)); Defect TORO:185241
-			adec = new AttrDecl(ATTR_NAME_FLUSH);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
-			adec.type.setEnumValues(values);
-			declarations.putNamedItem(ATTR_NAME_FLUSH, adec);
-		}
-
-		private void createForForward() {
-			// ("page" URI REQUIRED)
-			AttrDecl adec = new AttrDecl(ATTR_NAME_PAGE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_PAGE, adec);
-		}
-
-		private void createForPlugin() {
-			// ("type" ENUM REQUIRED (bean|applet))
-			AttrDecl adec = new AttrDecl(ATTR_NAME_TYPE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			String[] values = {ATTR_VALUE_BEAN, ATTR_VALUE_APPLET};
-			adec.type.setEnumValues(values);
-			declarations.putNamedItem(ATTR_NAME_TYPE, adec);
-
-			// ("code" CDATA REQUIRED)
-			adec = new AttrDecl(ATTR_NAME_CODE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_CODE, adec);
-
-			// ("codebase" URI REQUIRED)
-			adec = new AttrDecl(ATTR_NAME_CODEBASE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_CODEBASE, adec);
-
-			// ("align" ENUM IMPLIED (top|middle|bottom|left|right))
-			adec = new AttrDecl(ATTR_NAME_ALIGN);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] aligns = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
-			adec.type.setEnumValues(aligns);
-			declarations.putNamedItem(ATTR_NAME_ALIGN, adec);
-
-			// ("archive" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_ARCHIVE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_ARCHIVE, adec);
-
-			// ("height" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_HEIGHT);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_HEIGHT, adec);
-
-			// ("hspace" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_HSPACE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_HSPACE, adec);
-
-			// ("jreversion" CDATA DECLARED "1.1")
-			adec = new AttrDecl(ATTR_NAME_JREVERSION);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_JVER11);
-			declarations.putNamedItem(ATTR_NAME_JREVERSION, adec);
-
-			// ("name" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_NAME);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
-			// ("vspace" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_VSPACE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_VSPACE, adec);
-
-			// ("width" CDATA IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_WIDTH);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			declarations.putNamedItem(ATTR_NAME_WIDTH, adec);
-
-			// ("nspluginurl" URI IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_NSPLUGINURL);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
-			declarations.putNamedItem(ATTR_NAME_NSPLUGINURL, adec);
-
-			// ("iepluginurl" URI IMPLIED)
-			adec = new AttrDecl(ATTR_NAME_IEPLUGINURL);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
-			declarations.putNamedItem(ATTR_NAME_IEPLUGINURL, adec);
-		}
-
-		private void createForParam() {
-			// ("name" CDATA REQUIRED)
-			AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
-			// ("value" CDATA REQUIRED); Defect TORO:185241
-			adec = new AttrDecl(ATTR_NAME_VALUE);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_VALUE, adec);
-
-		}
-
-		private void createForRoot() {
-			// ("xmlns:jsp" CDATA "http://jva.sun.com/JSP/Page")
-			AttrDecl adec = new AttrDecl(ATTR_NAME_XMLNS_JSP);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_XMLNS_JSP);
-			declarations.putNamedItem(ATTR_NAME_XMLNS_JSP, adec);
-			// ("version" CDATA REQUIRED)
-			adec = new AttrDecl(ATTR_NAME_VERSION);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_VERSION, adec);
-		}
-	}
-
-	private final static CMNamedNodeMap EMPTY_MAP = new 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 Iterator() {
-				public boolean hasNext() {
-					return false;
-				}
-
-				public Object next() {
-					return null;
-				}
-
-				public void remove() {
-				}
-			};
-		}
-	};
-	private static String[] names = null;
-
-	static {
-		names = new String[Ids.getNumOfIds()];
-		names[Ids.ID_SCRIPTLET] = SCRIPTLET;
-		names[Ids.ID_EXPRESSION] = EXPRESSION;
-		names[Ids.ID_DECLARATION] = DECLARATION;
-		names[Ids.ID_DIRECTIVE_PAGE] = DIRECTIVE_PAGE;
-		names[Ids.ID_DIRECTIVE_INCLUDE] = DIRECTIVE_INCLUDE;
-		names[Ids.ID_DIRECTIVE_TAGLIB] = DIRECTIVE_TAGLIB;
-		names[Ids.ID_USEBEAN] = USEBEAN;
-		names[Ids.ID_SETPROPERTY] = SETPROPERTY;
-		names[Ids.ID_GETPROPERTY] = GETPROPERTY;
-		names[Ids.ID_INCLUDE] = INCLUDE;
-		names[Ids.ID_FORWARD] = FORWARD;
-		names[Ids.ID_PLUGIN] = PLUGIN;
-		names[Ids.ID_PARAMS] = PARAMS;
-		names[Ids.ID_FALLBACK] = FALLBACK;
-		names[Ids.ID_PARAM] = PARAM;
-		names[Ids.ID_ROOT] = ROOT;
-		names[Ids.ID_TEXT] = TEXT;
-	}
-
-	/**
-	 */
-	public JSPElementCollection() {
-		super(names, TOLERANT_CASE);
-	}
-
-	/**
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 * @param elementName java.lang.String
-	 */
-	protected CMNode create(String elementName) {
-		return createElemDecl(getID(elementName));
-	}
-
-	/**
-	 * @param eid int
-	 */
-	private CMGroupImpl createContent(int eid) {
-		if (eid == ID_UNKNOWN)
-			return null;
-
-		CMGroupImpl content = null;
-		CMNode child = null;
-
-		switch (eid) {
-			case Ids.ID_INCLUDE :
-			case Ids.ID_FORWARD :
-				// (jsp:param)*
-				content = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
-				child = item(Ids.ID_PARAM);
-				if (child != null)
-					content.appendChild(child);
-				break;
-			case Ids.ID_PLUGIN :
-				// (jsp:params | jsp:fallback)?
-				content = new CMGroupImpl(CMGroup.CHOICE, 0, 1);
-				// jsp:params
-				child = item(Ids.ID_PARAMS);
-				if (child != null)
-					content.appendChild(child);
-				// jsp:fallback
-				child = item(Ids.ID_FALLBACK);
-				if (child != null)
-					content.appendChild(child);
-				break;
-			case Ids.ID_PARAMS :
-				// (jsp:param)+
-				content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
-				child = item(Ids.ID_PARAM);
-				if (child != null)
-					content.appendChild(child);
-				break;
-			case Ids.ID_ROOT :
-				// %Body;
-				// --> (jsp:text|%Directives;|%Scripts;|%Actions;)*
-				//     %Directives --> jsp:directive.page|jsp:directive.include
-				//     %Scripts; --> jsp:scriptlet|jsp:declaration|jsp:expression
-				//     %Actions --> jsp:useBean|jsp.setProperty|jsp:getProperty
-				//                  |jsp:include|jsp:forward|jsp:plugin
-				content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
-				int validChildren[] = {Ids.ID_TEXT,
-				// %Directves;
-							Ids.ID_DIRECTIVE_PAGE, Ids.ID_DIRECTIVE_INCLUDE,
-							// %Scripts;
-							Ids.ID_SCRIPTLET, Ids.ID_DECLARATION, Ids.ID_EXPRESSION,
-							// %Actions;
-							Ids.ID_USEBEAN, Ids.ID_SETPROPERTY, Ids.ID_GETPROPERTY, Ids.ID_INCLUDE, Ids.ID_FORWARD, Ids.ID_PLUGIN};
-				for (int i = 0; i < validChildren.length; i++) {
-					child = item(validChildren[i]);
-					if (child != null)
-						content.appendChild(child);
-				}
-				break;
-		}
-
-		return content;
-	}
-
-	/**
-	 * @param eid int
-	 */
-	private HTMLElementDeclaration createElemDecl(int eid) {
-		if (eid == ID_UNKNOWN)
-			return null;
-
-		TypePacket packet = new TypePacket();
-		switch (eid) {
-			case Ids.ID_SCRIPTLET :
-				// content, omit, lineBreak, layout, correct, format
-				// scriptlet
-				packet.name = SCRIPTLET;
-				packet.content = CMElementDeclaration.CDATA;
-				packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
-				packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
-				break;
-			case Ids.ID_EXPRESSION :
-				// expression
-				packet.name = EXPRESSION;
-				packet.content = CMElementDeclaration.CDATA;
-				packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
-				packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
-				break;
-			case Ids.ID_DECLARATION :
-				// declaration
-				packet.name = DECLARATION;
-				packet.content = CMElementDeclaration.CDATA;
-				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
-				packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
-				break;
-			case Ids.ID_DIRECTIVE_PAGE :
-				// directive.page
-				packet.name = DIRECTIVE_PAGE;
-				packet.omit = HTMLElementDeclaration.OMIT_END;
-				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
-				packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
-				break;
-			case Ids.ID_DIRECTIVE_INCLUDE :
-				// directive.inlcude
-				packet.name = DIRECTIVE_INCLUDE;
-				packet.omit = HTMLElementDeclaration.OMIT_END;
-				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
-				packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
-				break;
-			case Ids.ID_DIRECTIVE_TAGLIB :
-				// directive.taglib
-				packet.name = DIRECTIVE_TAGLIB;
-				packet.omit = HTMLElementDeclaration.OMIT_END;
-				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
-				packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
-				break;
-			case Ids.ID_USEBEAN :
-				// useBean
-				packet.name = USEBEAN;
-				packet.content = CMElementDeclaration.ANY;
-				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
-				packet.indentChild = true;
-				break;
-			case Ids.ID_SETPROPERTY :
-				// setProperty
-				packet.name = SETPROPERTY;
-				packet.omit = HTMLElementDeclaration.OMIT_END;
-				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
-				break;
-			case Ids.ID_GETPROPERTY :
-				// getProperty
-				packet.name = GETPROPERTY;
-				packet.omit = HTMLElementDeclaration.OMIT_END;
-				packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
-				break;
-			case Ids.ID_INCLUDE :
-				// include
-				packet.name = INCLUDE;
-				packet.content = CMElementDeclaration.ELEMENT;
-				packet.omit = HTMLElementDeclaration.OMIT_END;
-				packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
-				packet.indentChild = true;
-				break;
-			case Ids.ID_FORWARD :
-				// forward
-				packet.name = FORWARD;
-				packet.content = CMElementDeclaration.ELEMENT;
-				packet.omit = HTMLElementDeclaration.OMIT_END;
-				packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
-				packet.indentChild = true;
-				break;
-			case Ids.ID_PLUGIN :
-				// plugin
-				packet.name = PLUGIN;
-				packet.content = CMElementDeclaration.ELEMENT;
-				packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
-				packet.indentChild = true;
-				break;
-			case Ids.ID_PARAMS :
-				// params
-				packet.name = PARAMS;
-				packet.content = CMElementDeclaration.ELEMENT;
-				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
-				packet.indentChild = true;
-				break;
-			case Ids.ID_FALLBACK :
-				// fallback
-				packet.name = FALLBACK;
-				packet.content = CMElementDeclaration.CDATA;
-				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
-				break;
-			case Ids.ID_PARAM :
-				// param
-				packet.name = PARAM;
-				packet.omit = HTMLElementDeclaration.OMIT_END;
-				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
-				break;
-			case Ids.ID_ROOT :
-				packet.name = ROOT;
-				packet.content = CMElementDeclaration.ELEMENT;
-				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN; // same as HTML
-				break;
-			case Ids.ID_TEXT :
-				packet.name = TEXT;
-				packet.content = CMElementDeclaration.PCDATA;
-				break;
-			default :
-				// unknown ID
-				return null;
-		}
-
-		ElemDecl dec = new ElemDecl(packet);
-
-		CMGroupImpl content = createContent(eid);
-		if (content != null)
-			dec.setContent(content);
-
-		JACreater creater = new JACreater();
-		dec.setAttributes(creater.getDeclarations(eid));
-
-		return dec;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProvider.java
deleted file mode 100644
index 09cba4b..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProvider.java
+++ /dev/null
@@ -1,23 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-/**
- * PropertyProvider class.
- * This class is intended to be used in HTMLElementDeclaration instances.
- */
-interface PropertyProvider {
-
-	boolean supports(HTMLElementDeclaration edecl);
-
-	Object get(HTMLElementDeclaration edecl);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProviderFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProviderFactory.java
deleted file mode 100644
index 38e2619..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProviderFactory.java
+++ /dev/null
@@ -1,360 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.AnnotationMap;
-
-/**
- * The factory object of PropertyProvider.
- */
-final class PropertyProviderFactory {
-
-
-	/**
-	 * DefaultProvider is intended to be used for unknown properties.
-	 * It always returns null value for any properties.
-	 */
-	class DefaultProvider implements PropertyProvider {
-		public DefaultProvider() {
-			super();
-		}
-
-		public boolean supports(HTMLElementDeclaration edecl) {
-			return false;
-		}
-
-		public Object get(HTMLElementDeclaration edecl) {
-			return null;
-		}
-	}
-
-	abstract class AbstractElementPropertyProvider implements PropertyProvider {
-		protected AbstractElementPropertyProvider() {
-			super();
-		}
-
-		public boolean supports(HTMLElementDeclaration edecl) {
-			return (edecl != null);
-		}
-
-		public Object get(HTMLElementDeclaration edecl) {
-			if (!(edecl instanceof HTMLPropertyDeclaration))
-				return null;
-			return getElementProperty((HTMLPropertyDeclaration)edecl);
-		}
-
-		abstract protected Object getElementProperty(HTMLPropertyDeclaration decl);
-	}
-
-	/*
-	 * "tagInfo"
-	 * gets documentation for the element
-	 */
-	class PPTagInfo extends AbstractElementPropertyProvider {
-		private final static String htmlAnnotationLoc = "data/htmref.xml"; //$NON-NLS-1$
-		protected AnnotationMap fAnnotationMap = null;
-
-		public PPTagInfo() {
-			super();
-		}
-
-		/**
-		 * Gets the annotationMap.
-		 * @return Returns a AnnotationMap
-		 */
-		protected AnnotationMap getAnnotationMap() {
-			if (fAnnotationMap == null) {
-				fAnnotationMap = new AnnotationMap();
-				try {
-					fAnnotationMap.load(htmlAnnotationLoc, HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
-				}
-				catch (Exception e) {
-					// no annotation available
-				}
-			}
-			return fAnnotationMap;
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			if (decl instanceof HTMLElementDeclaration) {
-				return getAnnotationMap().getProperty(((HTMLElementDeclaration)decl).getElementName(), "tagInfo"); //$NON-NLS-1$
-			} else {
-				return null;
-			}
-		}
-	}
-
-	/*
-	 * "shouldKeepSpace"
-	 */
-	class PPShouldKeepSpace extends AbstractElementPropertyProvider {
-		public PPShouldKeepSpace() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return new Boolean(decl.shouldKeepSpaces());
-		}
-	}
-
-	/*
-	 * "shouldIndentChildSource"
-	 */
-	class PPShouldIndentChildSource extends AbstractElementPropertyProvider {
-		public PPShouldIndentChildSource() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return new Boolean(decl.shouldIndentChildSource());
-		}
-	}
-
-	/*
-	 * "terminators"
-	 */
-	class PPTerminators extends AbstractElementPropertyProvider {
-		public PPTerminators() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			if (! (decl instanceof HTMLElemDeclImpl)) return null;
-			return ((HTMLElemDeclImpl)decl).getTerminators();
-		}
-	}
-
-	/*
-	 * "prohibitedAncestors"
-	 */
-	class PPProhibitedAncestors extends AbstractElementPropertyProvider {
-		public PPProhibitedAncestors() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return decl.getProhibitedAncestors();
-		}
-	}
-
-	/*
-	 * "isJSP"
-	 */
-	class PPIsJSP extends AbstractElementPropertyProvider {
-		public PPIsJSP() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return new Boolean(decl.isJSP());
-		}
-	}
-
-	/*
-	 * "isXHTML"
-	 * HTMLElementDeclaration itself never represent any XHTML element declaration.
-	 * So, this property must be always false.
-	 */
-	class PPIsXHTML extends AbstractElementPropertyProvider {
-		public PPIsXHTML() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return new Boolean(false);
-		}
-	}
-
-	/*
-	 * "isSSI"
-	 * Each declaration class for SSI elements must provide this property itself,
-	 * and then return true.  Other declaration must always return false.
-	 */
-	class PPIsSSI extends AbstractElementPropertyProvider {
-		public PPIsSSI() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return new Boolean(false);
-		}
-	}
-
-	/*
-	 * "lineBreakHint"
-	 */
-	class PPLineBreakHint extends AbstractElementPropertyProvider {
-		public PPLineBreakHint() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			String hint = HTMLCMProperties.Values.BREAK_NONE;
-			switch (decl.getLineBreakHint()) {
-				case HTMLElementDeclaration.BREAK_AFTER_START :
-					hint = HTMLCMProperties.Values.BREAK_AFTER_START;
-					break;
-				case HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END :
-					hint = HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END;
-					break;
-				case HTMLElementDeclaration.BREAK_NONE :
-				// nothing to do
-				default :
-					break;
-			}
-			return hint;
-		}
-	}
-
-	/*
-	 * "layoutType"
-	 */
-	class PPLayoutType extends AbstractElementPropertyProvider {
-		public PPLayoutType() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			String type = HTMLCMProperties.Values.LAYOUT_NONE;
-			switch (decl.getLayoutType()) {
-				case HTMLElementDeclaration.LAYOUT_BLOCK :
-					type = HTMLCMProperties.Values.LAYOUT_BLOCK;
-					break;
-				case HTMLElementDeclaration.LAYOUT_BREAK :
-					type = HTMLCMProperties.Values.LAYOUT_BREAK;
-					break;
-				case HTMLElementDeclaration.LAYOUT_HIDDEN :
-					type = HTMLCMProperties.Values.LAYOUT_HIDDEN;
-					break;
-				case HTMLElementDeclaration.LAYOUT_OBJECT :
-					type = HTMLCMProperties.Values.LAYOUT_OBJECT;
-					break;
-				case HTMLElementDeclaration.LAYOUT_WRAP :
-					type = HTMLCMProperties.Values.LAYOUT_WRAP;
-					break;
-				case HTMLElementDeclaration.LAYOUT_NONE :
-				// nothing to do.
-				default :
-					break;
-			}
-			return type;
-		}
-	}
-
-	/*
-	 * "omitType"
-	 */
-	class PPOmitType extends AbstractElementPropertyProvider {
-		public PPOmitType() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			String type = HTMLCMProperties.Values.OMIT_NONE;
-			switch (decl.getOmitType()) {
-				case HTMLElementDeclaration.OMIT_BOTH :
-					type = HTMLCMProperties.Values.OMIT_BOTH;
-					break;
-				case HTMLElementDeclaration.OMIT_END :
-					type = HTMLCMProperties.Values.OMIT_END;
-					break;
-				case HTMLElementDeclaration.OMIT_END_DEFAULT :
-					type = HTMLCMProperties.Values.OMIT_END_DEFAULT;
-					break;
-				case HTMLElementDeclaration.OMIT_END_MUST :
-					type = HTMLCMProperties.Values.OMIT_END_MUST;
-					break;
-				case HTMLElementDeclaration.OMIT_NONE :
-				// nothing to do.
-				default :
-					break;
-			}
-			return type;
-		}
-	}
-
-	/*
-	 * "inclusion"
-	 */
-	class PPInclusion extends AbstractElementPropertyProvider {
-		public PPInclusion() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return decl.getInclusion();
-		}
-	}
-
-	public static PropertyProvider getProvider(String propName) {
-		PropertyProviderFactory factory = getInstance();
-		PropertyProvider pp = (PropertyProvider) factory.registry.get(propName);
-		if (pp != null)
-			return pp;
-
-		pp = factory.create(propName);
-		if (pp == null)
-			return factory.defaultProvider;
-
-		factory.registry.put(propName, pp);
-		return pp;
-	}
-
-	private static PropertyProviderFactory instance = null;
-
-	private synchronized static PropertyProviderFactory getInstance() {
-		if (instance != null)
-			return instance;
-		instance = new PropertyProviderFactory();
-		return instance;
-	}
-
-	private Hashtable registry = new Hashtable();
-	private PropertyProvider defaultProvider = new DefaultProvider();
-
-	private PropertyProviderFactory() {
-		super();
-	}
-
-	private PropertyProvider create(String propName) {
-		PropertyProvider pp = null;
-		if (propName.equals(HTMLCMProperties.IS_JSP))
-			pp = new PPIsJSP();
-		else if (propName.equals(HTMLCMProperties.IS_XHTML))
-			pp = new PPIsXHTML();
-		else if (propName.equals(HTMLCMProperties.IS_SSI))
-			pp = new PPIsSSI();
-		else if (propName.equals(HTMLCMProperties.LAYOUT_TYPE))
-			pp = new PPLayoutType();
-		else if (propName.equals(HTMLCMProperties.LINE_BREAK_HINT))
-			pp = new PPLineBreakHint();
-		else if (propName.equals(HTMLCMProperties.PROHIBITED_ANCESTORS))
-			pp = new PPProhibitedAncestors();
-		else if (propName.equals(HTMLCMProperties.SHOULD_KEEP_SPACE))
-			pp = new PPShouldKeepSpace();
-		else if (propName.equals(HTMLCMProperties.SHOULD_INDENT_CHILD_SOURCE))
-			pp = new PPShouldIndentChildSource();
-		else if (propName.equals(HTMLCMProperties.TERMINATORS))
-			pp = new PPTerminators();
-		else if (propName.equals(HTMLCMProperties.TAGINFO))
-			pp = new PPTagInfo();
-		else if (propName.equals(HTMLCMProperties.OMIT_TYPE))
-			pp = new PPOmitType();
-		else if (propName.equals(HTMLCMProperties.INCLUSION))
-			pp = new PPInclusion();
-
-		return pp;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/AttributeCollection.java
deleted file mode 100644
index 5d28203..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/AttributeCollection.java
+++ /dev/null
@@ -1,314 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDataType;
-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.CMNode;
-
-/**
- * Factory for attribute declarations.
- */
-final class AttributeCollection extends CMNamedNodeMapImpl implements CHTMLNamespace {
-	/**
-	 * constructor.
-	 */
-	public AttributeCollection() {
-		super();
-	}
-
-	/**
-	 * Create an attribute declaration.
-	 * @param attrName java.lang.String
-	 */
-	private HTMLAttrDeclImpl create(String attrName) {
-		HTMLAttrDeclImpl attr = null;
-		HTMLCMDataTypeImpl atype = null;
-
-		if (attrName.equalsIgnoreCase(ATTR_NAME_ACTION)) {
-			// (action %URI #REQUIRED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ACTION, atype, CMAttributeDeclaration.REQUIRED);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ALT)) {
-			// (alt %Text; #REQUIRED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ALT, atype, CMAttributeDeclaration.REQUIRED);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_BORDER)) {
-			// (border %Pixels; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDER, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CHECKED)) {
-			// (checked (checked) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_CHECKED};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CHECKED, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_CLEAR)) {
-			// (clear (left | all | right | none) none)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_ALL, ATTR_VALUE_RIGHT, ATTR_VALUE_NONE};
-			atype.setEnumValues(values);
-			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_NONE);
-
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_CLEAR, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_COLS)) {
-			// (cols NUMBER #REQUIRED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_COLS, atype, CMAttributeDeclaration.REQUIRED);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ENCTYPE)) {
-			// (enctype %ContentType; "application/x-www-form-urlencoded")
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
-			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_WWW_FORM_URLENCODED);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ENCTYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_HEIGHT)) {
-			// (height %Length; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_HEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_HREF)) {
-			// (href %URI; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_HREF, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_HSPACE)) {
-			// (hspace %Pixels; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_HSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_HTTP_EQUIV)) {
-			// (http-equiv NAME #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_HTTP_EQUIV, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_MAXLENGTH)) {
-			// (maxlength NUMBER #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_MAXLENGTH, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_METHOD)) {
-			// (method (GET|POST) GET)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_VALUE_GET, ATTR_VALUE_POST};
-			atype.setEnumValues(values);
-			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_GET);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_METHOD, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_MULTIPLE)) {
-			// (multiple (multiple) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_MULTIPLE};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_MULTIPLE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_NAME)) {
-			// (name CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_NOSHADE)) {
-			// (noshade (noshade) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_NOSHADE};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_NOSHADE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_ROWS)) {
-			// (rows NUMBER #REQUIRED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_ROWS, atype, CMAttributeDeclaration.REQUIRED);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SELECTED)) {
-			// (selected (selected) #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-			String[] values = {ATTR_NAME_SELECTED};
-			atype.setEnumValues(values);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SELECTED, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SIZE)) {
-			// (size %Pixels; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_SRC)) {
-			// (src %URI; #IMPLIED)
-			// NOTE: "src" attributes are defined in several elements.
-			//		 The definition of IMG is different from others.
-			//		 So, it should be locally defined.
-			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_SRC, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_TYPE)) {
-			// (type %CotentType; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_VALUE)) {
-			// (value CDATA #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_VERSION)) {
-			// (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);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_WIDTH)) {
-			// (width %Length; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-
-		}
-		else if (attrName.equalsIgnoreCase(ATTR_NAME_VSPACE)) {
-			// (vspace %Pixels; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
-			attr = new HTMLAttrDeclImpl(ATTR_NAME_VSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-
-			// <<D205514
-		}
-		else {
-			// unknown attribute; maybe error.
-			// should warn.
-			attr = null;
-		}
-
-		return attr;
-	}
-
-	/**
-	 * Get %bodycolors; declarations.
-	 */
-	public void getBodycolors(CMNamedNodeMapImpl declarations) {
-	}
-
-	/**
-	 * Get align attribute which has %IAlign; as values..
-	 */
-	public static final HTMLAttrDeclImpl createAlignForImage() {
-		// align (local)
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		// set enum values
-		String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
-		atype.setEnumValues(values);
-
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-		return attr;
-	}
-
-	/**
-	 * Create an attribute declaration for <code>align</code>
-	 * in several elements, like <code>P</code>, <code>DIV</code>.
-	 * The values are different from attributes those have the same name
-	 * in other elements (<code>IMG</code> and <code>TABLE</code>).
-	 * So, it can't treat as global attributes.
-	 * <strong>NOTE: These attribute declaration has
-	 * no owner CMDocument instance.</strong>
-	 */
-	public static final HTMLAttrDeclImpl createAlignForParagraph() {
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		// set enum values: left|center|right|justify
-		String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT,};
-		atype.setEnumValues(values);
-
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-		return attr;
-	}
-
-	/**
-	 * Get %attrs; declarations.
-	 * %attrs; consists of %coreattrs;, %i18n, and %events;.
-	 */
-	public void getAttrs(CMNamedNodeMapImpl declarations) {
-	}
-
-	/**
-	 * Get %coreattrs; declarations.
-	 */
-	public void getCore(CMNamedNodeMapImpl declarations) {
-	}
-
-	/**
-	 * Get a global attribute declaration.
-	 * @param attrName java.lang.String
-	 */
-	public HTMLAttributeDeclaration getDeclaration(String attrName) {
-		CMNode cmnode = getNamedItem(attrName);
-		if (cmnode != null)
-			return (HTMLAttributeDeclaration) cmnode; // already exists.
-
-		HTMLAttrDeclImpl dec = create(attrName);
-		if (dec != null)
-			putNamedItem(attrName, dec);
-
-		return dec;
-	}
-
-	/**
-	 * Get declarations which are specified by names.
-	 * @param names java.util.Iterator
-	 */
-	public void getDeclarations(CMNamedNodeMapImpl declarations, Iterator names) {
-		while (names.hasNext()) {
-			String attrName = (String) names.next();
-			HTMLAttributeDeclaration dec = getDeclaration(attrName);
-			if (dec != null)
-				declarations.putNamedItem(attrName, dec);
-		}
-	}
-
-	/**
-	 * Get %events; declarations.
-	 */
-	public void getEvents(CMNamedNodeMapImpl declarations) {
-	}
-
-	/**
-	 * Get %i18n; declarations.
-	 */
-	public void getI18n(CMNamedNodeMapImpl declarations) {
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHCMDocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHCMDocImpl.java
deleted file mode 100644
index 5ebf483..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHCMDocImpl.java
+++ /dev/null
@@ -1,80 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocument;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLEntityDeclaration;
-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.
- */
-public class CHCMDocImpl extends CMNodeImpl implements HTMLCMDocument {
-
-	/** Namespace for all names of elements, entities and attributes. */
-	private CMNamespace namespace = null;
-	private ElementCollection elements = null;
-	private EntityCollection entities = null;
-	private AttributeCollection attributes = null;
-
-	/**
-	 */
-	public CHCMDocImpl(String docTypeName, CMNamespace targetNamespace) {
-		super(docTypeName);
-		namespace = targetNamespace;
-		attributes = new AttributeCollection();
-		elements = new ElementCollection(attributes);
-		entities = new EntityCollection();
-	}
-
-	AttributeCollection getAttributes() {
-		return attributes;
-	}
-
-	public HTMLElementDeclaration getElementDeclaration(String elementName) {
-		if (elements == null)
-			return null;
-		return (HTMLElementDeclaration) elements.getNamedItem(elementName);
-	}
-
-	public CMNamedNodeMap getElements() {
-		return elements;
-	}
-
-	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 org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace getNamespace() {
-		return namespace;
-	}
-
-	/**
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 */
-	public int getNodeType() {
-		return CMNode.DOCUMENT;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHTMLNamespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHTMLNamespace.java
deleted file mode 100644
index 95d5c21..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHTMLNamespace.java
+++ /dev/null
@@ -1,152 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * Provide all names defined in the HTML 4.0? specification.
- */
-public interface CHTMLNamespace {
-
-	// Element names
-	public static interface ElementName {
-		public static final String A = HTML40Namespace.ElementName.A;
-		public static final String ADDRESS = HTML40Namespace.ElementName.ADDRESS;
-		public static final String BASE = HTML40Namespace.ElementName.BASE;
-		public static final String BLOCKQUOTE = HTML40Namespace.ElementName.BLOCKQUOTE;
-		public static final String BODY = HTML40Namespace.ElementName.BODY;
-		public static final String BR = HTML40Namespace.ElementName.BR;
-		public static final String CENTER = HTML40Namespace.ElementName.CENTER;
-		public static final String DD = HTML40Namespace.ElementName.DD;
-		public static final String DIR = HTML40Namespace.ElementName.DIR;
-		public static final String DIV = HTML40Namespace.ElementName.DIV;
-		public static final String DL = HTML40Namespace.ElementName.DL;
-		public static final String DT = HTML40Namespace.ElementName.DT;
-		public static final String FORM = HTML40Namespace.ElementName.FORM;
-		public static final String H1 = HTML40Namespace.ElementName.H1;
-		public static final String H2 = HTML40Namespace.ElementName.H2;
-		public static final String H3 = HTML40Namespace.ElementName.H3;
-		public static final String H4 = HTML40Namespace.ElementName.H4;
-		public static final String H5 = HTML40Namespace.ElementName.H5;
-		public static final String H6 = HTML40Namespace.ElementName.H6;
-		public static final String HEAD = HTML40Namespace.ElementName.HEAD;
-		public static final String HR = HTML40Namespace.ElementName.HR;
-		public static final String HTML = HTML40Namespace.ElementName.HTML;
-		public static final String IMG = HTML40Namespace.ElementName.IMG;
-		public static final String INPUT = HTML40Namespace.ElementName.INPUT;
-		public static final String LI = HTML40Namespace.ElementName.LI;
-		public static final String MENU = HTML40Namespace.ElementName.MENU;
-		public static final String META = HTML40Namespace.ElementName.META;
-		public static final String OL = HTML40Namespace.ElementName.OL;
-		public static final String OPTION = HTML40Namespace.ElementName.OPTION;
-		public static final String P = HTML40Namespace.ElementName.P;
-		public static final String PRE = HTML40Namespace.ElementName.PRE;
-		public static final String SELECT = HTML40Namespace.ElementName.SELECT;
-		public static final String TEXTAREA = HTML40Namespace.ElementName.TEXTAREA;
-		public static final String TITLE = HTML40Namespace.ElementName.TITLE;
-		public static final String UL = HTML40Namespace.ElementName.UL;
-		public static final String SSI_CONFIG = HTML40Namespace.ElementName.SSI_CONFIG;
-		public static final String SSI_ECHO = HTML40Namespace.ElementName.SSI_ECHO;
-		public static final String SSI_EXEC = HTML40Namespace.ElementName.SSI_EXEC;
-		public static final String SSI_FSIZE = HTML40Namespace.ElementName.SSI_FSIZE;
-		public static final String SSI_FLASTMOD = HTML40Namespace.ElementName.SSI_FLASTMOD;
-		public static final String SSI_INCLUDE = HTML40Namespace.ElementName.SSI_INCLUDE;
-		public static final String SSI_PRINTENV = HTML40Namespace.ElementName.SSI_PRINTENV;
-		public static final String SSI_SET = HTML40Namespace.ElementName.SSI_SET;
-	}
-
-	// Character Entities
-	public static interface EntityName {
-	}
-
-	// global attribute names
-	public static final String ATTR_NAME_VERSION = HTML40Namespace.ATTR_NAME_VERSION;
-	public static final String ATTR_NAME_SRC = HTML40Namespace.ATTR_NAME_SRC;
-	public static final String ATTR_NAME_ALT = HTML40Namespace.ATTR_NAME_ALT;
-	public static final String ATTR_NAME_HEIGHT = HTML40Namespace.ATTR_NAME_HEIGHT;
-	public static final String ATTR_NAME_WIDTH = HTML40Namespace.ATTR_NAME_WIDTH;
-	public static final String ATTR_NAME_ALIGN = HTML40Namespace.ATTR_NAME_ALIGN;
-	public static final String ATTR_NAME_BORDER = HTML40Namespace.ATTR_NAME_BORDER;
-	public static final String ATTR_NAME_HSPACE = HTML40Namespace.ATTR_NAME_HSPACE;
-	public static final String ATTR_NAME_VSPACE = HTML40Namespace.ATTR_NAME_VSPACE;
-	public static final String ATTR_NAME_NAME = HTML40Namespace.ATTR_NAME_NAME;
-	public static final String ATTR_NAME_CLEAR = HTML40Namespace.ATTR_NAME_CLEAR;
-	public static final String ATTR_NAME_NOSHADE = HTML40Namespace.ATTR_NAME_NOSHADE;
-	public static final String ATTR_NAME_CHECKED = HTML40Namespace.ATTR_NAME_CHECKED;
-	public static final String ATTR_NAME_MAXLENGTH = HTML40Namespace.ATTR_NAME_MAXLENGTH;
-	public static final String ATTR_NAME_ISTYLE = HTML40Namespace.ATTR_NAME_ISTYLE;
-	public static final String ATTR_NAME_HTTP_EQUIV = HTML40Namespace.ATTR_NAME_HTTP_EQUIV;
-	public static final String ATTR_NAME_CONTENT = HTML40Namespace.ATTR_NAME_CONTENT;
-
-	public static final String ATTR_NAME_HREF = HTML40Namespace.ATTR_NAME_HREF;
-	public static final String ATTR_NAME_MULTIPLE = HTML40Namespace.ATTR_NAME_MULTIPLE;
-	public static final String ATTR_NAME_SELECTED = HTML40Namespace.ATTR_NAME_SELECTED;
-	public static final String ATTR_NAME_ROWS = HTML40Namespace.ATTR_NAME_ROWS;
-	public static final String ATTR_NAME_COLS = HTML40Namespace.ATTR_NAME_COLS;
-	public static final String ATTR_NAME_ACTION = HTML40Namespace.ATTR_NAME_ACTION;
-	public static final String ATTR_NAME_METHOD = HTML40Namespace.ATTR_NAME_METHOD;
-	public static final String ATTR_NAME_ENCTYPE = HTML40Namespace.ATTR_NAME_ENCTYPE;
-	public static final String ATTR_NAME_SIZE = HTML40Namespace.ATTR_NAME_SIZE;
-	public static final String ATTR_NAME_TYPE = HTML40Namespace.ATTR_NAME_TYPE;
-	public static final String ATTR_NAME_VALUE = HTML40Namespace.ATTR_NAME_VALUE;
-
-
-
-	public static final String ATTR_NAME_ERRMSG = HTML40Namespace.ATTR_NAME_ERRMSG;
-	public static final String ATTR_NAME_SIZEFMT = HTML40Namespace.ATTR_NAME_SIZEFMT;
-	public static final String ATTR_NAME_TIMEFMT = HTML40Namespace.ATTR_NAME_TIMEFMT;
-	public static final String ATTR_NAME_VAR = HTML40Namespace.ATTR_NAME_VAR;
-	public static final String ATTR_NAME_CGI = HTML40Namespace.ATTR_NAME_CGI;
-	public static final String ATTR_NAME_CMD = HTML40Namespace.ATTR_NAME_CMD;
-	public static final String ATTR_NAME_FILE = HTML40Namespace.ATTR_NAME_FILE;
-	public static final String ATTR_NAME_VIRTUAL = HTML40Namespace.ATTR_NAME_VIRTUAL;
-
-	// global attribute values; mainly used in enumeration.
-	public static final String ATTR_VALUE_VERSION_TRANSITIONAL = "-//W3C//DTD Compact HTML 1.0 Draft//EN"; //$NON-NLS-1$
-	//   for align (top|middle|bottom|left|right)
-	public static final String ATTR_VALUE_TOP = HTML40Namespace.ATTR_VALUE_TOP;
-	public static final String ATTR_VALUE_MIDDLE = HTML40Namespace.ATTR_VALUE_MIDDLE;
-	public static final String ATTR_VALUE_BOTTOM = HTML40Namespace.ATTR_VALUE_BOTTOM;
-	public static final String ATTR_VALUE_LEFT = HTML40Namespace.ATTR_VALUE_LEFT;
-	public static final String ATTR_VALUE_CENTER = HTML40Namespace.ATTR_VALUE_CENTER;
-	public static final String ATTR_VALUE_RIGHT = HTML40Namespace.ATTR_VALUE_RIGHT;
-	//   for clear (left|all|right|none): left and right are already defined above.
-	public static final String ATTR_VALUE_ALL = HTML40Namespace.ATTR_VALUE_ALL;
-	public static final String ATTR_VALUE_NONE = HTML40Namespace.ATTR_VALUE_NONE;
-	//   for type of INPUT
-	//       (text | password | checkbox | radio | submit | reset |
-	//        file | hidden | image | button)
-	public static final String ATTR_VALUE_TEXT = HTML40Namespace.ATTR_VALUE_TEXT;
-	public static final String ATTR_VALUE_PASSWORD = HTML40Namespace.ATTR_VALUE_PASSWORD;
-	public static final String ATTR_VALUE_CHECKBOX = HTML40Namespace.ATTR_VALUE_CHECKBOX;
-	public static final String ATTR_VALUE_RADIO = HTML40Namespace.ATTR_VALUE_RADIO;
-	public static final String ATTR_VALUE_SUBMIT = HTML40Namespace.ATTR_VALUE_SUBMIT;
-	public static final String ATTR_VALUE_RESET = HTML40Namespace.ATTR_VALUE_RESET;
-	public static final String ATTR_VALUE_HIDDEN = HTML40Namespace.ATTR_VALUE_HIDDEN;
-	//   for span, colspan, rowspan
-	public static final String ATTR_VALUE_1 = HTML40Namespace.ATTR_VALUE_1;
-	//   for frameborder
-	public static final String ATTR_VALUE_0 = HTML40Namespace.ATTR_VALUE_0;
-	//   for method of FORM
-	public static final String ATTR_VALUE_GET = HTML40Namespace.ATTR_VALUE_GET;
-	public static final String ATTR_VALUE_POST = HTML40Namespace.ATTR_VALUE_POST;
-	public static final String ATTR_VALUE_WWW_FORM_URLENCODED = HTML40Namespace.ATTR_VALUE_WWW_FORM_URLENCODED;
-	//   for behaviro of MARQUEE
-	public static final String ATTR_VALUE_SCROLL = HTML40Namespace.ATTR_VALUE_SCROLL;
-	public static final String ATTR_VALUE_SLIDE = HTML40Namespace.ATTR_VALUE_SLIDE;
-	public static final String ATTR_VALUE_ALTERNATE = HTML40Namespace.ATTR_VALUE_ALTERNATE;
-	//   for direction of MARQUEE
-	public static final String ATTR_VALUE_UP = HTML40Namespace.ATTR_VALUE_UP;
-	public static final String ATTR_VALUE_DOWN = HTML40Namespace.ATTR_VALUE_DOWN;
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMContentImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMContentImpl.java
deleted file mode 100644
index 28b7966..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMContentImpl.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Implementation of CMContent for HTML CM.
- */
-abstract class CMContentImpl extends CMNodeImpl implements org.eclipse.wst.xml.core.internal.contentmodel.CMContent {
-
-	public static final int UNBOUNDED = -1;
-	/**  -1: it's UNBOUNDED. */
-	private int maxOccur = UNBOUNDED;
-	/**  0: it's OPTIONAL, 1, it's REQUIRED. */
-	private int minOccur = 0;
-
-	/**
-	 * The primary consturctor.
-	 * Use this one for usual cases.<br>
-	 */
-	public CMContentImpl(String name, int min, int max) {
-		super(name);
-		minOccur = min;
-		maxOccur = max;
-	}
-
-	/**
-	 * getMaxOccur method
-	 * @return int
-	 *
-	 * If -1, it's UNBOUNDED.
-	 */
-	public int getMaxOccur() {
-		return maxOccur;
-	}
-
-	/**
-	 * getMinOccur method
-	 * @return int
-	 *
-	 * If 0, it's OPTIONAL.
-	 * If 1, it's REQUIRED.
-	 */
-	public int getMinOccur() {
-		return minOccur;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMGroupImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMGroupImpl.java
deleted file mode 100644
index 812b3ed..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMGroupImpl.java
+++ /dev/null
@@ -1,83 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-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;
-
-/**
- */
-class CMGroupImpl extends CMContentImpl implements CMGroup {
-
-	private int operator = CMGroup.SEQUENCE;
-	private CMNodeListImpl children = null;
-
-	/**
-	 * CMGroupImpl constructor comment.
-	 */
-	public CMGroupImpl(int op, int minOccur, int maxOccur) {
-		super(null, minOccur, maxOccur);
-		switch (op) {
-			case CMGroup.ALL :
-			case CMGroup.CHOICE :
-			case CMGroup.SEQUENCE :
-				operator = op;
-				break;
-			default :
-				// should warn.
-				break;
-		}
-	}
-
-	/**
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 * @param org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 */
-	protected CMNode appendChild(CMNode child) {
-		if (child == null)
-			return null;
-		if (children == null)
-			children = new CMNodeListImpl();
-		return children.appendNode(child);
-	}
-
-	/**
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList
-	 */
-	public CMNodeList getChildNodes() {
-		return children;
-	}
-
-	/**
-	 * getNodeType method
-	 * @return int
-	 *
-	 * Returns one of :
-	 * ELEMENT_DECLARATION, ATTRIBUTE_DECLARATION, GROUP, ENTITY_DECLARATION.
-	 */
-	public int getNodeType() {
-		return CMNode.GROUP;
-	}
-
-	/**
-	 * getOperation method
-	 * @return int
-	 *
-	 * Returns one of :
-	 * ALONE (a), SEQUENCE (a,b), CHOICE (a|b), ALL (a&b).
-	 */
-	public int getOperator() {
-		return operator;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java
deleted file mode 100644
index a32cdfd..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java
+++ /dev/null
@@ -1,97 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * An implementation of the CMNamedNodeMap interface.
- * This class is intented to be used as a container of attribute declarations.
- * If someone wants to use this class for other purpose, he must pay attention
- * to the fact that this class is tolerant of the key name case.  That is, this
- * class does not distinguish "name", "NAME", and "Name" as a key name.
- */
-class CMNamedNodeMapImpl implements org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap {
-
-	private java.util.Hashtable items = null;
-
-	/**
-	 */
-	public CMNamedNodeMapImpl() {
-		super();
-		items = new java.util.Hashtable();
-	}
-
-	/**
-	 * getLength method
-	 * @return int
-	 */
-	public int getLength() {
-		return items.size();
-	}
-
-	/**
-	 * getNamedItem method
-	 * @return CMNode <code>null</code> for unknown keys.
-	 * @param name java.lang.String
-	 */
-	public CMNode getNamedItem(String name) {
-		String cookedName = makeCanonicalForm(name);
-		if (!items.containsKey(cookedName))
-			return null;
-		return (CMNode) items.get(cookedName);
-	}
-
-	/**
-	 * item method
-	 * @return CMNode
-	 * @param index int
-	 */
-	public CMNode item(int index) {
-		Iterator iter = iterator();
-		while (iter.hasNext()) {
-			CMNode node = (CMNode) iter.next();
-			if (--index < 0)
-				return node;
-		}
-		return null;
-	}
-
-	/**
-	 * @return java.util.Iterator
-	 */
-	public Iterator iterator() {
-		return items.values().iterator();
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param rawForm java.lang.String
-	 */
-	private String makeCanonicalForm(String rawForm) {
-		return rawForm.toUpperCase();
-	}
-
-	/**
-	 * @param key java.lang.String
-	 * @param item java.lang.String
-	 */
-	void putNamedItem(String name, CMNode item) {
-		String cookedName = makeCanonicalForm(name);
-		if (items.containsKey(cookedName))
-			return; // already registered.
-		items.put(cookedName, item);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeImpl.java
deleted file mode 100644
index c383848..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeImpl.java
+++ /dev/null
@@ -1,64 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-
-
-
-/**
- */
-abstract class CMNodeImpl implements org.eclipse.wst.xml.core.internal.contentmodel.CMNode {
-
-	private java.lang.String name = null;
-
-	/**
-	 * CMNodeImpl constructor comment.
-	 */
-	public CMNodeImpl(String nm) {
-		super();
-		name = nm;
-	}
-
-	/**
-	 * getNodeName method
-	 * @return java.lang.String
-	 */
-	public String getNodeName() {
-		return name;
-	}
-
-	/**
-	 * getProperty method
-	 * @return java.lang.Object
-	 *
-	 * Returns the object property desciped by the propertyName
-	 *
-	 */
-	public Object getProperty(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.IS_XHTML))
-			return new Boolean(false);
-		return null;
-	}
-
-	/**
-	 * supports method
-	 * @return boolean
-	 *
-	 * Returns true if the CMNode supports a specified property
-	 *
-	 */
-	public boolean supports(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.IS_XHTML))
-			return true;
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeListImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeListImpl.java
deleted file mode 100644
index 3e4404a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeListImpl.java
+++ /dev/null
@@ -1,59 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Analog of dom.NodeList for CM.
- */
-class CMNodeListImpl implements org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList {
-
-	private java.util.Vector nodes = null;
-
-	/**
-	 * CMNodeListImpl constructor comment.
-	 */
-	public CMNodeListImpl() {
-		super();
-		nodes = new java.util.Vector();
-	}
-
-	/**
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 * @param node org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 */
-	protected CMNode appendNode(CMNode node) {
-		nodes.addElement(node);
-		return node;
-	}
-
-	/**
-	 * getLength method
-	 * @return int
-	 */
-	public int getLength() {
-		return nodes.size();
-	}
-
-	/**
-	 * item method
-	 * @return CMNode
-	 * @param index int
-	 */
-	public CMNode item(int index) {
-		if (index < 0 || index >= nodes.size())
-			return null;
-		return (CMNode) nodes.elementAt(index);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinition.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinition.java
deleted file mode 100644
index a0c2dfd..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinition.java
+++ /dev/null
@@ -1,76 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * This class is intended to represent a complex type definition
- * in XML Schema.<br>
- */
-abstract class ComplexTypeDefinition {
-
-	protected CMGroupImpl content = null;
-	protected ElementCollection collection = null;
-	protected String primaryCandidateName = null;
-
-	/**
-	 * ComplexTypeDefinition constructor comment.
-	 */
-	public ComplexTypeDefinition(ElementCollection elementCollection) {
-		super();
-		collection = elementCollection;
-		createContent();
-	}
-
-	/**
-	 * Create an actual content model.
-	 * This method should be called once and only once in the constructor.<br>
-	 */
-	protected abstract void createContent();
-
-	/**
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMGroup
-	 */
-	public CMGroup getContent() {
-		return content;
-	}
-
-	/**
-	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
-	 * those are defined in CMElementDeclaration.
-	 */
-	/* NOTE: Do we need LOGICAL type?
-	 * -- 3/7/2001
-	 */
-	public abstract int getContentType();
-
-	/**
-	 * Get content hint.
-	 */
-	public HTMLElementDeclaration getPrimaryCandidate() {
-		if (primaryCandidateName == null)
-			return null;
-		return (HTMLElementDeclaration) collection.getNamedItem(primaryCandidateName);
-	}
-
-	/**
-	 * Name of complex type definition.
-	 * Each singleton must know its own name.
-	 * All names should be defined in
-	 * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
-	 * @return java.lang.String
-	 */
-	public abstract String getTypeName();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinitionFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinitionFactory.java
deleted file mode 100644
index 5f346bf..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinitionFactory.java
+++ /dev/null
@@ -1,144 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Factory of ComplexTypeDefinition.
- */
-final class ComplexTypeDefinitionFactory {
-
-	private static ComplexTypeDefinitionFactory instance = null;
-	private java.util.Hashtable definitions = null;
-	// constants for complex type name
-	/** for ADDRESS. */
-	public final static String CTYPE_ADDRESS = "CTYPE_ADDRESS";//$NON-NLS-1$
-	/** CDATA content. No ComplexTypeDefinition instance shuld be created. */
-	public final static String CTYPE_CDATA = "CTYPE_CDATA";//$NON-NLS-1$
-	/** col group content. COL* */
-	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 EMBED. */
-	public final static String CTYPE_EMBED = "CTYPE_EMBED";//$NON-NLS-1$
-	/** empty content. No ComplexTypeDefinition instance should be created. */
-	public final static String CTYPE_EMPTY = "CTYPE_EMPTY";//$NON-NLS-1$
-	/** for FIELDSET. */
-	public final static String CTYPE_FIELDSET = "CTYPE_FIELDSET";//$NON-NLS-1$
-	/** for FRAMESET. */
-	public final static String CTYPE_FRAMESET = "CTYPE_FRAMESET";//$NON-NLS-1$
-	/** flow content. (%flow;)* */
-	public final static String CTYPE_FLOW_CONTAINER = "CTYPE_FLOW_CONTAINER";//$NON-NLS-1$
-	/** html content. HEAD, (FRAMESET|BODY) */
-	public final static String CTYPE_HTML = "CTYPE_HTML";//$NON-NLS-1$
-	/** head content. TITLE & ISINDEX? & BASE? */
-	public final static String CTYPE_HEAD = "CTYPE_HEAD";//$NON-NLS-1$
-	/** inline content. (%inline;)* */
-	public final static String CTYPE_INLINE_CONTAINER = "CTYPE_INLINE_CONTAINER";//$NON-NLS-1$
-	/** list item container. (LI)+ */
-	public final static String CTYPE_LI_CONTAINER = "CTYPE_LI_CONTAINER";//$NON-NLS-1$
-	/** for MAP. */
-	public final static String CTYPE_MAP = "CTYPE_MAP";//$NON-NLS-1$
-	/** noframes content. */
-	public final static String CTYPE_NOFRAMES_CONTENT = "CTYPE_NOFRAMES_CONTENT";//$NON-NLS-1$
-	/** for OPTGROUP. */
-	public final static String CTYPE_OPTION_CONTAINER = "CTYPE_OPTION_CONTAINER";//$NON-NLS-1$
-	/** param container. For OBJECT/APPLET. */
-	public final static String CTYPE_PARAM_CONTAINER = "CTYPE_PARAM_CONTAINER";//$NON-NLS-1$
-	/** PCDATA content. No ComplexTypeDefinition instance shuld be created. */
-	public final static String CTYPE_PCDATA = "CTYPE_PCDATA";//$NON-NLS-1$
-	/** for SELECT. */
-	public final static String CTYPE_SELECT = "CTYPE_SELECT";//$NON-NLS-1$
-	/** table content. CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+ */
-	public final static String CTYPE_TABLE = "CTYPE_TABLE";//$NON-NLS-1$
-	/** table cell contaier. (TH|TD)+ */
-	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$
-
-	/**
-	 * ComplexTypeDefinitionFactory constructor comment.
-	 */
-	private ComplexTypeDefinitionFactory() {
-		super();
-		definitions = new java.util.Hashtable();
-	}
-
-	/**
-	 * Factory method for ComplexTypeDefinition.
-	 * Each instance created in this method must be registered into
-	 * the map with its name.
-	 * @param definitionName java.lang.String
-	 * @param elementCollection ElementCollection
-	 */
-	public ComplexTypeDefinition createTypeDefinition(String definitionName, ElementCollection elementCollection) {
-		if (definitions.containsKey(definitionName)) {
-			return (ComplexTypeDefinition) definitions.get(definitionName);
-		}
-
-		ComplexTypeDefinition def = null;
-		if (definitionName == CTYPE_ADDRESS) {
-			def = new CtdAddress(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_DEFINITION_LIST) {
-			def = new CtdDl(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_FLOW_CONTAINER) {
-			def = new CtdFlowContainer(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_HEAD) {
-			def = new CtdHead(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_HTML) {
-			def = new CtdHtml(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_INLINE_CONTAINER) {
-			def = new CtdInlineContainer(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_LI_CONTAINER) {
-			def = new CtdLiContainer(elementCollection);
-
-
-		}
-		else if (definitionName == CTYPE_OPTION_CONTAINER) {
-			def = new CtdOptionContainer(elementCollection);
-
-		}
-		else if (definitionName == CTYPE_SELECT) {
-			def = new CtdSelect(elementCollection);
-
-		}
-		else {
-			def = null;
-		}
-		if (def == null)
-			return null; // fail to create.
-		definitions.put(definitionName, def);
-		return def;
-	}
-
-	/**
-	 * For singleton.<br>
-	 */
-	public synchronized static ComplexTypeDefinitionFactory getInstance() {
-		if (instance != null)
-			return instance;
-		instance = new ComplexTypeDefinitionFactory();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdAddress.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdAddress.java
deleted file mode 100644
index 84796f4..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdAddress.java
+++ /dev/null
@@ -1,70 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-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 ADDRESS.
- */
-final class CtdAddress extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdAddress(ElementCollection elementCollection) {
-		super(elementCollection);
-	}
-
-	/**
-	 * ((%inline) | P)*.
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( | )*
-		content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
-		// (%inline)
-		CMGroupImpl inlines = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		if (inlines == null)
-			return;
-		collection.getInline(inlines);
-		content.appendChild(inlines);
-		// P
-		CMNode p = collection.getNamedItem(CHTMLNamespace.ElementName.P);
-		if (p != null)
-			content.appendChild(p);
-	}
-
-	/**
-	 * ((%inline) | P)*.
-	 * Because %inline; contains #PCDATA, the type is MIXED.
-	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
-	 * those are defined in CMElementDeclaration.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.MIXED;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_ADDRESS;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdDl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdDl.java
deleted file mode 100644
index dcfb159..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdDl.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-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 DL.
- */
-final class CtdDl extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdDl(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = CHTMLNamespace.ElementName.DT;
-	}
-
-	/**
-	 * (DT | DD)+
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( | )+
-		content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
-		// DT
-		CMNode dec = collection.getNamedItem(CHTMLNamespace.ElementName.DT);
-		if (dec != null)
-			content.appendChild(dec);
-		// DD
-		dec = collection.getNamedItem(CHTMLNamespace.ElementName.DD);
-		if (dec != null)
-			content.appendChild(dec);
-	}
-
-	/**
-	 * (DT | DD)+.
-	 * @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_DEFINITION_LIST;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdFlowContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdFlowContainer.java
deleted file mode 100644
index ee94d62..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdFlowContainer.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * Complex type definition for containers of <code>%flow;</code>.
- */
-final class CtdFlowContainer extends ComplexTypeDefinition {
-
-	/**
-	 */
-	public CtdFlowContainer(ElementCollection elementCollection) {
-		super(elementCollection);
-	}
-
-	/**
-	 * (%flow;)*
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
-		collection.getFlow(content);
-	}
-
-	public int getContentType() {
-		return CMElementDeclaration.MIXED;
-	}
-
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_FLOW_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHead.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHead.java
deleted file mode 100644
index 5361c3a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHead.java
+++ /dev/null
@@ -1,174 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-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;
-
-/**
- * Complex type definition for the head content.
- * Content Model: (TITLE & ISINDEX? & BASE?)
- */
-final class CtdHead extends ComplexTypeDefinition {
-
-	/**
-	 */
-	public CtdHead(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = CHTMLNamespace.ElementName.TITLE;
-	}
-
-	/**
-	 * for HEAD.
-	 * To avoid using inclusion, the content model comes from the XHTML 1.0.
-	 *
-	 * (%head.misc;, ((title, %head.misc;, (base, %head.misc;)?) | (base, %head.misc;, (title, %head.misc;))))
-	 * And %head.misc; is:
-	 * (script|style|meta|link|object|isindex)*
-	 *
-	 * 0: (%head.misc, A)
-	 * A: (B | C)
-	 * B: (title, %head.misc;, D)
-	 * C: (base, %head.misc;, E)
-	 * D: (base, %head.misc;)?
-	 * E: (title, %head.misc;)
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// At 1st, create %head.misc; content.
-		// %head.misc;
-		//   ( | )*
-		CMGroupImpl misc = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
-		if (misc == null)
-			return;
-		String[] names = {CHTMLNamespace.ElementName.META,};
-		collection.getDeclarations(misc, Arrays.asList(names).iterator());
-		// 2nd, get a title
-		CMNode title = collection.getNamedItem(CHTMLNamespace.ElementName.TITLE);
-		// 3rd, get a base
-		CMNode base = collection.getNamedItem(CHTMLNamespace.ElementName.BASE);
-		if (title == null || base == null)
-			return;
-
-		// Top level content is a sequence of %head.misc; and A.
-		// 0: (%head.misc;, A)
-		//   create a sequence
-		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-		if (content == null)
-			return;
-		//   append %head.misc;
-		content.appendChild(misc);
-		//   create A and append it to the top level.
-		{
-			// A is a choice of B and C.
-			// A: (B | C)
-			//   create a choice
-			CMGroupImpl gA = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-			if (gA == null)
-				return;
-			//   append A to the top level.
-			content.appendChild(gA);
-
-			// create B and append it to A
-			{
-				// B is a sequence of title, %head.misc;, and D.
-				// B: (title, %head.misc;, D)
-				//   create a sequence
-				CMGroupImpl gB = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-				if (gB == null)
-					return;
-				//   append B to A.
-				gA.appendChild(gB);
-
-				//   append title to B
-				gB.appendChild(title);
-				//   append %head.misc; to B
-				gB.appendChild(misc);
-				//   create D and append it to B.
-				{
-					// D is a sequence of base, %head.misc;.
-					// D: (base, %head.misc;)?
-					//   create a sequence
-					CMGroupImpl gD = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
-					if (gD == null)
-						return;
-					//   append D to B.
-					gB.appendChild(gD);
-
-					//   append base to D
-					gD.appendChild(base);
-					//   append %head.misc; to D.
-					gD.appendChild(misc);
-				}
-			}
-			// create C and append it to A
-			{
-				// C is a sequence of base, %head.misc;, and E
-				// C: (base, %head.misc;, E)
-				//   create a sequence
-				CMGroupImpl gC = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-				if (gC == null)
-					return;
-				//   append C to A.
-				gA.appendChild(gC);
-
-				//   append base to C
-				gC.appendChild(base);
-				//   append %head.misc; to C
-				gC.appendChild(misc);
-
-				//   create E and append it to C.
-				{
-					// E is a sequence of title and %head.misc;.
-					// E: (title, %head.misc;)
-					//   create a sequence
-					CMGroupImpl gE = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-					if (gE == null)
-						return;
-					//   append E to C.
-					gC.appendChild(gE);
-
-					//   append title to E
-					gE.appendChild(title);
-					//   append %head.misc; to E.
-					gE.appendChild(misc);
-				}
-			}
-		}
-	}
-
-	/**
-	 * Element content.<br>
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.ELEMENT;
-	}
-
-	/**
-	 * Name of complex type definition.
-	 * Each singleton must know its own name.
-	 * All names should be defined in
-	 * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_HEAD;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHtml.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHtml.java
deleted file mode 100644
index 72bab17..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHtml.java
+++ /dev/null
@@ -1,74 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-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;
-
-/**
- * Complex type definition for <code>HTML</code>.<br>
- * Content Model:
- * HEAD, (FRAMESET|BODY)<br>
- */
-final class CtdHtml extends ComplexTypeDefinition {
-
-	/**
-	 */
-	public CtdHtml(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = CHTMLNamespace.ElementName.HEAD;
-	}
-
-	/**
-	 * (%html.content;).
-	 * %html.content; is HEAD, (FRAMESET | BODY).
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( )
-		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-		if (content == null)
-			return;
-
-		// HEAD
-		CMNode edec = collection.getNamedItem(CHTMLNamespace.ElementName.HEAD);
-		if (edec != null)
-			content.appendChild(edec);
-
-		// ( | )
-		CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		content.appendChild(group);
-
-		// FRAMESET, BODY
-		String[] names = {CHTMLNamespace.ElementName.BODY};
-		collection.getDeclarations(group, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 * Element content.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.ELEMENT;
-	}
-
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_HTML;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdInlineContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdInlineContainer.java
deleted file mode 100644
index 973944a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdInlineContainer.java
+++ /dev/null
@@ -1,50 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * Complex type definition for (%inline;)*.
- */
-final class CtdInlineContainer extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdInlineContainer(ElementCollection elementCollection) {
-		super(elementCollection);
-	}
-
-	/**
-	 * (%inline)*.
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
-		collection.getInline(content);
-	}
-
-	public int getContentType() {
-		return CMElementDeclaration.MIXED;
-	}
-
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_INLINE_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdLiContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdLiContainer.java
deleted file mode 100644
index 8e4716a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdLiContainer.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-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;
-
-/**
- * List item container.
- * (LI)+
- */
-final class CtdLiContainer extends ComplexTypeDefinition {
-
-	/**
-	 * @param elemenCollection ElementCollection
-	 */
-	public CtdLiContainer(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = CHTMLNamespace.ElementName.LI;
-	}
-
-	/**
-	 * (LI)+.
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// (LI)+
-		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
-		CMNode li = collection.getNamedItem(CHTMLNamespace.ElementName.LI);
-		if (li != null)
-			content.appendChild(li);
-	}
-
-	/**
-	 * ELEMENT content.<br>
-	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
-	 * those are defined in CMElementDeclaration.
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.ELEMENT;
-	}
-
-	/**
-	 * Name of complex type definition.
-	 * Each singleton must know its own name.
-	 * All names should be defined in
-	 * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_LI_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdOptionContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdOptionContainer.java
deleted file mode 100644
index b1e0a54..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdOptionContainer.java
+++ /dev/null
@@ -1,69 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-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;
-
-/**
- * OPTION container.
- * (OPTION)+
- */
-final class CtdOptionContainer extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdOptionContainer(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = CHTMLNamespace.ElementName.OPTION;
-	}
-
-	/**
-	 * (OPTION)+.
-	 */
-	protected void createContent() {
-		if (content != null)
-			return; // already created.
-		if (collection == null)
-			return;
-
-		// ( )+
-		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
-		// OPTION
-		CMNode dec = collection.getNamedItem(CHTMLNamespace.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;
-	}
-
-	/**
-	 * Name of complex type definition.
-	 * Each singleton must know its own name.
-	 * All names should be defined in
-	 * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
-	 * @return java.lang.String
-	 */
-	public String getTypeName() {
-		return ComplexTypeDefinitionFactory.CTYPE_OPTION_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdSelect.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdSelect.java
deleted file mode 100644
index cc0d61e..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdSelect.java
+++ /dev/null
@@ -1,64 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-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 SELECT.
- */
-final class CtdSelect extends ComplexTypeDefinition {
-
-	/**
-	 * @param elementCollection ElementCollection
-	 */
-	public CtdSelect(ElementCollection elementCollection) {
-		super(elementCollection);
-		primaryCandidateName = CHTMLNamespace.ElementName.OPTION;
-	}
-
-	/**
-	 * (OPTGROUP | 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(CHTMLNamespace.ElementName.OPTION);
-		if (dec != null)
-			content.appendChild(dec);
-	}
-
-	/**
-	 * (OPTGROUP | 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_SELECT;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.java
deleted file mode 100644
index 2b56527..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.java
+++ /dev/null
@@ -1,234 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- */
-abstract class DeclCollection implements CMNamedNodeMap {
-
-
-	protected class DualMap {
-		public DualMap() {
-			super();
-		}
-
-		public DualMap(Object[] objects) {
-			super();
-			initialize(objects);
-		}
-
-		public int size() {
-			return table.length;
-		}
-
-		public Object getValue(int key) {
-			if (!isValidIndex(key))
-				return null;
-			return table[key];
-		}
-
-		public int getKey(Object value) {
-			Integer keyObj = (Integer) map.get(value);
-			if (keyObj == null)
-				return ID_UNKNOWN;
-			return keyObj.intValue();
-		}
-
-		protected void initialize(Object[] objects) {
-			if (objects == null)
-				return;
-			table = objects;
-			map = new HashMap();
-			for (int key = 0; key < objects.length; key++) {
-				Object value = table[key];
-				map.put(value, new Integer(key));
-			}
-		}
-
-		private Object[] table = null;
-		private HashMap map = null;
-
-		private boolean isValidIndex(int index) {
-			return index >= 0 && index < table.length;
-		}
-	}
-
-	protected class TolerantStringDualMap extends DualMap {
-		public TolerantStringDualMap(String[] names) {
-			super();
-			Object[] objects = new Object[names.length];
-			for (int i = 0; i < names.length; i++) {
-				objects[i] = makeCanonicalForm(names[i]);
-			}
-			initialize(objects);
-		}
-
-		public int getKey(Object value) {
-			try {
-				String name = (String) value;
-				return super.getKey(makeCanonicalForm(name));
-			}
-			catch (ClassCastException e) {
-				return ID_UNKNOWN;
-			}
-		}
-
-		private String makeCanonicalForm(String raw) {
-			return raw.toUpperCase();
-		}
-	}
-
-	private class DeclIterator implements Iterator {
-		public DeclIterator() {
-			maxid = fDecls.length - 1;
-		}
-
-		public boolean hasNext() {
-			return id < maxid;
-		}
-
-		public Object next() {
-			if (!hasNext())
-				return null;
-			return item(++id);
-		}
-
-		public void remove() { /* nothing should be done. */
-		}
-
-		private int id = -1;
-		private int maxid = -1;
-	}
-
-	CMNode[] fDecls = null;
-	protected final static boolean STRICT_CASE = false;
-	protected final static boolean TOLERANT_CASE = true;
-	protected final static int ID_UNKNOWN = -1;
-	private DualMap fMap = null;
-
-	/**
-	 */
-	public DeclCollection(String[] names, boolean tolerant) {
-		super();
-		fDecls = new CMNode[names.length];
-		if (tolerant) {
-			fMap = new TolerantStringDualMap(names);
-		}
-		else {
-			fMap = new DualMap(names);
-		}
-	}
-
-	/**
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 * @param id int
-	 */
-	protected abstract CMNode create(String name);
-
-	/**
-	 */
-	public CMNamedNodeMap getDeclarations(String[] names) {
-		CMNamedNodeMapImpl map = new CMNamedNodeMapImpl();
-		for (int i = 0; i < names.length; i++) {
-			String name = names[i];
-			CMNode node = getNamedItem(name);
-			if (node == null)
-				continue;
-			map.putNamedItem(name, node);
-		}
-		return map;
-	}
-
-	public void getDeclarations(CMGroupImpl group, Iterator names) {
-		while (names.hasNext()) {
-			String entityName = (String) names.next();
-			CMNode dec = getNamedItem(entityName);
-			if (dec != null)
-				group.appendChild(dec);
-		}
-	}
-
-	/**
-	 * Map name to id.
-	 * @return int
-	 * @param name java.lang.String
-	 */
-	protected int getID(String name) {
-		return fMap.getKey(name);
-	}
-
-	/**
-	 * getLength method
-	 * @return int
-	 */
-	public int getLength() {
-		return fDecls.length;
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param id int
-	 */
-	protected String getName(int id) {
-		return (String) fMap.getValue(id);
-	}
-
-	/**
-	 * getNamedItem method
-	 * @return CMNode
-	 * @param name java.lang.String
-	 */
-	public CMNode getNamedItem(String name) {
-		int id = getID(name);
-		if (!isValidID(id))
-			return null;
-		return item(id);
-	}
-
-	/**
-	 * @return boolean
-	 * @param id int
-	 */
-	private boolean isValidID(int id) {
-		return id >= 0 && id < fDecls.length;
-	}
-
-	/**
-	 * item method
-	 * @return CMNode
-	 * @param index int
-	 */
-	public CMNode item(int index) {
-		if (!isValidID(index))
-			return null;
-		CMNode decl = fDecls[index];
-		if (decl != null)
-			return decl; // already exist.
-
-		decl = create(getName(index));
-		fDecls[index] = decl;
-		return decl;
-	}
-
-	/**
-	 */
-	public Iterator iterator() {
-		return new DeclIterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ElementCollection.java
deleted file mode 100644
index bf5ad46..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ElementCollection.java
+++ /dev/null
@@ -1,492 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for element declarations.
- */
-final class ElementCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ElementName {
-
-
-	// Element IDs
-	private static class Ids {
-		public static final int ID_A = 0;
-		public static final int ID_ADDRESS = 1;
-		public static final int ID_BASE = 2;
-		public static final int ID_BLOCKQUOTE = 3;
-		public static final int ID_BODY = 4;
-		public static final int ID_BR = 5;
-		public static final int ID_CENTER = 6;
-		public static final int ID_DD = 7;
-		public static final int ID_DIR = 8;
-		public static final int ID_DIV = 9;
-		public static final int ID_DL = 10;
-		public static final int ID_DT = 11;
-		public static final int ID_FORM = 12;
-		public static final int ID_H1 = 13;
-		public static final int ID_H2 = 14;
-		public static final int ID_H3 = 15;
-		public static final int ID_H4 = 16;
-		public static final int ID_H5 = 17;
-		public static final int ID_H6 = 18;
-		public static final int ID_HEAD = 19;
-		public static final int ID_HR = 20;
-		public static final int ID_HTML = 21;
-		public static final int ID_IMG = 22;
-		public static final int ID_INPUT = 23;
-		public static final int ID_LI = 24;
-		public static final int ID_MENU = 25;
-		public static final int ID_META = 26;
-		public static final int ID_OL = 27;
-		public static final int ID_OPTION = 28;
-		public static final int ID_P = 29;
-		public static final int ID_PRE = 30;
-		public static final int ID_SELECT = 31;
-		public static final int ID_TEXTAREA = 32;
-		public static final int ID_TITLE = 33;
-		public static final int ID_UL = 34;
-		public static final int ID_SSI_CONFIG = 35;
-		public static final int ID_SSI_ECHO = 36;
-		public static final int ID_SSI_EXEC = 37;
-		public static final int ID_SSI_FSIZE = 38;
-		public static final int ID_SSI_FLASTMOD = 39;
-		public static final int ID_SSI_INCLUDE = 40;
-		public static final int ID_SSI_PRINTENV = 41;
-		public static final int ID_SSI_SET = 42;
-
-		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 = Ids.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;
-	}
-
-	/** %formctl;. INPUT | SELECT | TEXTAREA */
-	private static final String[] FORMCTL = {INPUT, SELECT, TEXTAREA};
-	/** %phrase;.
-	 * DFN
-	 */
-	private static final String[] PHRASE = {DFN};
-	/** %special;.
-	 * A | IMG | BR
-	 */
-	private static final String[] SPECIAL = {A, IMG, BR};
-	/** %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};
-	private AttributeCollection attributeCollection = null;
-	private static String[] names = null;
-
-	static {
-		names = new String[Ids.getNumOfIds()];
-		names[Ids.ID_A] = A;
-		names[Ids.ID_ADDRESS] = ADDRESS;
-		names[Ids.ID_BASE] = BASE;
-		names[Ids.ID_BLOCKQUOTE] = BLOCKQUOTE;
-		names[Ids.ID_BODY] = BODY;
-		names[Ids.ID_BR] = BR;
-		names[Ids.ID_CENTER] = CENTER;
-		names[Ids.ID_DD] = DD;
-		names[Ids.ID_DIR] = DIR;
-		names[Ids.ID_DIV] = DIV;
-		names[Ids.ID_DL] = DL;
-		names[Ids.ID_DT] = DT;
-		names[Ids.ID_FORM] = FORM;
-		names[Ids.ID_H1] = H1;
-		names[Ids.ID_H2] = H2;
-		names[Ids.ID_H3] = H3;
-		names[Ids.ID_H4] = H4;
-		names[Ids.ID_H5] = H5;
-		names[Ids.ID_H6] = H6;
-		names[Ids.ID_HEAD] = HEAD;
-		names[Ids.ID_HR] = HR;
-		names[Ids.ID_HTML] = HTML;
-		names[Ids.ID_IMG] = IMG;
-		names[Ids.ID_INPUT] = INPUT;
-		names[Ids.ID_LI] = LI;
-		names[Ids.ID_MENU] = MENU;
-		names[Ids.ID_META] = META;
-		names[Ids.ID_OL] = OL;
-		names[Ids.ID_OPTION] = OPTION;
-		names[Ids.ID_P] = P;
-		names[Ids.ID_PRE] = PRE;
-		names[Ids.ID_SELECT] = SELECT;
-		names[Ids.ID_TEXTAREA] = TEXTAREA;
-		names[Ids.ID_TITLE] = TITLE;
-		names[Ids.ID_UL] = UL;
-		names[Ids.ID_SSI_CONFIG] = SSI_CONFIG;
-		names[Ids.ID_SSI_ECHO] = SSI_ECHO;
-		names[Ids.ID_SSI_EXEC] = SSI_EXEC;
-		names[Ids.ID_SSI_FSIZE] = SSI_FSIZE;
-		names[Ids.ID_SSI_FLASTMOD] = SSI_FLASTMOD;
-		names[Ids.ID_SSI_INCLUDE] = SSI_INCLUDE;
-		names[Ids.ID_SSI_PRINTENV] = SSI_PRINTENV;
-		names[Ids.ID_SSI_SET] = SSI_SET;
-	}
-
-	/**
-	 */
-	public ElementCollection(AttributeCollection collection) {
-		super(names, TOLERANT_CASE);
-		attributeCollection = collection;
-	}
-
-	/**
-	 * Actually creates HTMLElementDeclaration instance.
-	 * @return HTMLElementDeclaration
-	 */
-	protected CMNode create(String elementName) {
-		HTMLElemDeclImpl edec = null;
-
-		if (elementName.equalsIgnoreCase(A)) {
-			edec = new HedA(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(ADDRESS)) {
-			edec = new HedADDRESS(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BASE)) {
-			edec = new HedBASE(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BLOCKQUOTE)) {
-			edec = new HedBLOCKQUOTE(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BODY)) {
-			edec = new HedBODY(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(BR)) {
-			edec = new HedBR(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(CENTER)) {
-			edec = new HedCENTER(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(DD)) {
-			edec = new HedDD(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(DIR)) {
-			edec = new HedMENU(DIR, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(DIV)) {
-			edec = new HedDIV(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(DL)) {
-			edec = new HedDL(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(DT)) {
-			edec = new HedDT(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(FORM)) {
-			edec = new HedFORM(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(H1)) {
-			edec = new HedHeading(H1, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(H2)) {
-			edec = new HedHeading(H2, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(H3)) {
-			edec = new HedHeading(H3, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(H4)) {
-			edec = new HedHeading(H4, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(H5)) {
-			edec = new HedHeading(H5, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(H6)) {
-			edec = new HedHeading(H6, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(HEAD)) {
-			edec = new HedHEAD(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(HR)) {
-			edec = new HedHR(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(HTML)) {
-			edec = new HedHTML(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(IMG)) {
-			edec = new HedIMG(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(INPUT)) {
-			edec = new HedINPUT(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(LI)) {
-			edec = new HedLI(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(MENU)) {
-			edec = new HedMENU(MENU, this);
-
-		}
-		else if (elementName.equalsIgnoreCase(META)) {
-			edec = new HedMETA(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(OL)) {
-			edec = new HedOL(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(OPTION)) {
-			edec = new HedOPTION(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(P)) {
-			edec = new HedP(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(PRE)) {
-			edec = new HedPRE(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SELECT)) {
-			edec = new HedSELECT(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(TEXTAREA)) {
-			edec = new HedTEXTAREA(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(TITLE)) {
-			edec = new HedTITLE(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(UL)) {
-			edec = new HedUL(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_CONFIG)) {
-			edec = new HedSSIConfig(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_ECHO)) {
-			edec = new HedSSIEcho(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_EXEC)) {
-			edec = new HedSSIExec(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_FSIZE)) {
-			edec = new HedSSIFsize(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_FLASTMOD)) {
-			edec = new HedSSIFlastmod(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_INCLUDE)) {
-			edec = new HedSSIInclude(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_PRINTENV)) {
-			edec = new HedSSIPrintenv(this);
-
-		}
-		else if (elementName.equalsIgnoreCase(SSI_SET)) {
-			edec = new HedSSISet(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 = null;
-		}
-		return edec;
-	}
-
-	public AttributeCollection getAttributeCollection() {
-		return attributeCollection;
-	}
-
-	/**
-	 */
-	public final Collection getNamesOfBlock() {
-		// P | %list | %preformatted | DL | DIV | CENTER | BLOCKQUOTE | FORM | HR
-		String[] blockMisc = {P, DL, DIV, CENTER, BLOCKQUOTE, FORM, HR,};
-		Vector blockNames = new Vector(Arrays.asList(blockMisc));
-		// %heading;
-		blockNames.addAll(Arrays.asList(HEADING));
-		// %list;
-		blockNames.addAll(Arrays.asList(LIST));
-		// %preformatted;
-		blockNames.addAll(Arrays.asList(PREFORMATTED));
-
-		return blockNames;
-	}
-
-	/**
-	 * %block;.
-	 * %block; is:
-	 * P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
-	 * NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
-	 * TABLE | FIELDSET | ADDRESS.<br>
-	 * @param group CMGroupImpl Return values.
-	 */
-	public final void getBlock(CMGroupImpl group) {
-		if (group == null)
-			return;
-		getDeclarations(group, getNamesOfBlock().iterator());
-	}
-
-	/**
-	 * Create element declarations and store them
-	 * into a <code>CMGroupImpl</code> instance.
-	 * @param group CMGroupImpl Return values.
-	 */
-	public final void getFlow(CMGroupImpl group) {
-		if (group == null)
-			return;
-		getBlock(group);
-		getInline(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) {
-		return;
-	}
-
-	/**
-	 * 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());
-	}
-
-	/**
-	 * Create element declarations and store them
-	 * into a <code>CMGroupImpl</code> instance.
-	 * @param group CMGroupImpl Return values.
-	 */
-	public final void getInline(CMGroupImpl group) {
-		if (group == null)
-			return;
-		getFontstyle(group);
-		getPhrase(group);
-		getSpecial(group);
-		getFormctrl(group);
-	}
-
-	/**
-	 * %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());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/EntityCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/EntityCollection.java
deleted file mode 100644
index 7b44593..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/EntityCollection.java
+++ /dev/null
@@ -1,837 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.lang.reflect.Field;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for entity declarations.
- */
-final class EntityCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.EntityName {
-
-
-	private static class Ids {
-		public static final int ID_AACUTE_L = 0;
-		public static final int ID_AACUTE_U = 1;
-		public static final int ID_ACIRC_L = 2;
-		public static final int ID_ACIRC_U = 3;
-		public static final int ID_ACUTE = 4;
-		public static final int ID_AELIG_L = 5;
-		public static final int ID_AELIG_U = 6;
-		public static final int ID_AGRAVE_L = 7;
-		public static final int ID_AGRAVE_U = 8;
-		public static final int ID_ALEFSYM = 9;
-		public static final int ID_ALPHA_L = 10;
-		public static final int ID_ALPHA_U = 11;
-		public static final int ID_AMP = 12;
-		public static final int ID_AND = 13;
-		public static final int ID_ANG = 14;
-		public static final int ID_ARING_L = 15;
-		public static final int ID_ARING_U = 16;
-		public static final int ID_ASYMP = 17;
-		public static final int ID_ATILDE_L = 18;
-		public static final int ID_ATILDE_U = 19;
-		public static final int ID_AUML_L = 20;
-		public static final int ID_AUML_U = 21;
-		public static final int ID_BDQUO = 22;
-		public static final int ID_BETA_L = 23;
-		public static final int ID_BETA_U = 24;
-		public static final int ID_BRVBAR = 25;
-		public static final int ID_BULL = 26;
-		public static final int ID_CAP = 27;
-		public static final int ID_CCEDIL_L = 28;
-		public static final int ID_CCEDIL_U = 29;
-		public static final int ID_CEDIL = 30;
-		public static final int ID_CENT = 31;
-		public static final int ID_CHI_L = 32;
-		public static final int ID_CHI_U = 33;
-		public static final int ID_CIRC = 34;
-		public static final int ID_CLUBS = 35;
-		public static final int ID_CONG = 36;
-		public static final int ID_COPY = 37;
-		public static final int ID_CRARR = 38;
-		public static final int ID_CUP = 39;
-		public static final int ID_CURREN = 40;
-		public static final int ID_DAGGER_L = 41;
-		public static final int ID_DAGGER_U = 42;
-		public static final int ID_DARR_L = 43;
-		public static final int ID_DARR_U = 44;
-		public static final int ID_DEG = 45;
-		public static final int ID_DELTA_L = 46;
-		public static final int ID_DELTA_U = 47;
-		public static final int ID_DIAMS = 48;
-		public static final int ID_DIVIDE = 49;
-		public static final int ID_EACUTE_L = 50;
-		public static final int ID_EACUTE_U = 51;
-		public static final int ID_ECIRC_L = 52;
-		public static final int ID_ECIRC_U = 53;
-		public static final int ID_EGRAVE_L = 54;
-		public static final int ID_EGRAVE_U = 55;
-		public static final int ID_EMPTY = 56;
-		public static final int ID_EMSP = 57;
-		public static final int ID_ENSP = 58;
-		public static final int ID_EPSILON_L = 59;
-		public static final int ID_EPSILON_U = 60;
-		public static final int ID_EQUIV = 61;
-		public static final int ID_ETA_L = 62;
-		public static final int ID_ETA_U = 63;
-		public static final int ID_ETH_L = 64;
-		public static final int ID_ETH_U = 65;
-		public static final int ID_EUML_L = 66;
-		public static final int ID_EUML_U = 67;
-		public static final int ID_EURO = 68;
-		public static final int ID_EXIST = 69;
-		public static final int ID_FNOF = 70;
-		public static final int ID_FORALL = 71;
-		public static final int ID_FRAC12 = 72;
-		public static final int ID_FRAC14 = 73;
-		public static final int ID_FRAC34 = 74;
-		public static final int ID_FRASL = 75;
-		public static final int ID_GAMMA_L = 76;
-		public static final int ID_GAMMA_U = 77;
-		public static final int ID_GE = 78;
-		public static final int ID_GT = 79;
-		public static final int ID_HARR_L = 80;
-		public static final int ID_HARR_U = 81;
-		public static final int ID_HEARTS = 82;
-		public static final int ID_HELLIP = 83;
-		public static final int ID_IACUTE_L = 84;
-		public static final int ID_IACUTE_U = 85;
-		public static final int ID_ICIRC_L = 86;
-		public static final int ID_ICIRC_U = 87;
-		public static final int ID_IEXCL = 88;
-		public static final int ID_IGRAVE_L = 89;
-		public static final int ID_IGRAVE_U = 90;
-		public static final int ID_IMAGE = 91;
-		public static final int ID_INFIN = 92;
-		public static final int ID_INT = 93;
-		public static final int ID_IOTA_L = 94;
-		public static final int ID_IOTA_U = 95;
-		public static final int ID_IQUEST = 96;
-		public static final int ID_ISIN = 97;
-		public static final int ID_IUML_L = 98;
-		public static final int ID_IUML_U = 99;
-		public static final int ID_KAPPA_L = 100;
-		public static final int ID_KAPPA_U = 101;
-		public static final int ID_LAMBDA_L = 102;
-		public static final int ID_LAMBDA_U = 103;
-		public static final int ID_LANG = 104;
-		public static final int ID_LAQUO = 105;
-		public static final int ID_LARR_L = 106;
-		public static final int ID_LARR_U = 107;
-		public static final int ID_LCEIL = 108;
-		public static final int ID_LDQUO = 109;
-		public static final int ID_LE = 110;
-		public static final int ID_LFLOOR = 111;
-		public static final int ID_LOWAST = 112;
-		public static final int ID_LOZ = 113;
-		public static final int ID_LRM = 114;
-		public static final int ID_LSAQUO = 115;
-		public static final int ID_LSQUO = 116;
-		public static final int ID_LT = 117;
-		public static final int ID_MACR = 118;
-		public static final int ID_MDASH = 119;
-		public static final int ID_MICRO = 120;
-		public static final int ID_MIDDOT = 121;
-		public static final int ID_MINUS = 122;
-		public static final int ID_MU_L = 123;
-		public static final int ID_MU_U = 124;
-		public static final int ID_NABLA = 125;
-		public static final int ID_NBSP = 126;
-		public static final int ID_NDASH = 127;
-		public static final int ID_NE = 128;
-		public static final int ID_NI = 129;
-		public static final int ID_NOT = 130;
-		public static final int ID_NOTIN = 131;
-		public static final int ID_NSUB = 132;
-		public static final int ID_NTILDE_L = 133;
-		public static final int ID_NTILDE_U = 134;
-		public static final int ID_NU_L = 135;
-		public static final int ID_NU_U = 136;
-		public static final int ID_OACUTE_L = 137;
-		public static final int ID_OACUTE_U = 138;
-		public static final int ID_OCIRC_L = 139;
-		public static final int ID_OCIRC_U = 140;
-		public static final int ID_OELIG_L = 141;
-		public static final int ID_OELIG_U = 142;
-		public static final int ID_OGRAVE_L = 143;
-		public static final int ID_OGRAVE_U = 144;
-		public static final int ID_OLINE = 145;
-		public static final int ID_OMEGA_L = 146;
-		public static final int ID_OMEGA_U = 147;
-		public static final int ID_OMICRON_L = 148;
-		public static final int ID_OMICRON_U = 149;
-		public static final int ID_OPLUS = 150;
-		public static final int ID_OR = 151;
-		public static final int ID_ORDF = 152;
-		public static final int ID_ORDM = 153;
-		public static final int ID_OSLASH_L = 154;
-		public static final int ID_OSLASH_U = 155;
-		public static final int ID_OTILDE_L = 156;
-		public static final int ID_OTILDE_U = 157;
-		public static final int ID_OTIMES = 158;
-		public static final int ID_OUML_L = 159;
-		public static final int ID_OUML_U = 160;
-		public static final int ID_PARA = 161;
-		public static final int ID_PART = 162;
-		public static final int ID_PERMIL = 163;
-		public static final int ID_PERP = 164;
-		public static final int ID_PHI_L = 165;
-		public static final int ID_PHI_U = 166;
-		public static final int ID_PIV = 167;
-		public static final int ID_PI_L = 168;
-		public static final int ID_PI_U = 169;
-		public static final int ID_PLUSMN = 170;
-		public static final int ID_POUND = 171;
-		public static final int ID_PRIME_L = 172;
-		public static final int ID_PRIME_U = 173;
-		public static final int ID_PROD = 174;
-		public static final int ID_PROP = 175;
-		public static final int ID_PSI_L = 176;
-		public static final int ID_PSI_U = 177;
-		public static final int ID_QUOT = 178;
-		public static final int ID_RADIC = 179;
-		public static final int ID_RANG = 180;
-		public static final int ID_RAQUO = 181;
-		public static final int ID_RARR_L = 182;
-		public static final int ID_RARR_U = 183;
-		public static final int ID_RCEIL = 184;
-		public static final int ID_RDQUO = 185;
-		public static final int ID_REAL = 186;
-		public static final int ID_REG = 187;
-		public static final int ID_RFLOOR = 188;
-		public static final int ID_RHO_L = 189;
-		public static final int ID_RHO_U = 190;
-		public static final int ID_RLM = 191;
-		public static final int ID_RSAQUO = 192;
-		public static final int ID_RSQUO = 193;
-		public static final int ID_SBQUO = 194;
-		public static final int ID_SCARON_L = 195;
-		public static final int ID_SCARON_U = 196;
-		public static final int ID_SDOT = 197;
-		public static final int ID_SECT = 198;
-		public static final int ID_SHY = 199;
-		public static final int ID_SIGMAF = 200;
-		public static final int ID_SIGMA_L = 201;
-		public static final int ID_SIGMA_U = 202;
-		public static final int ID_SIM = 203;
-		public static final int ID_SPADES = 204;
-		public static final int ID_SUB = 205;
-		public static final int ID_SUBE = 206;
-		public static final int ID_SUM = 207;
-		public static final int ID_SUP = 208;
-		public static final int ID_SUP1 = 209;
-		public static final int ID_SUP2 = 210;
-		public static final int ID_SUP3 = 211;
-		public static final int ID_SUPE = 212;
-		public static final int ID_SZLIG = 213;
-		public static final int ID_TAU_L = 214;
-		public static final int ID_TAU_U = 215;
-		public static final int ID_THERE4 = 216;
-		public static final int ID_THETASYM = 217;
-		public static final int ID_THETA_L = 218;
-		public static final int ID_THETA_U = 219;
-		public static final int ID_THINSP = 220;
-		public static final int ID_THORN_L = 221;
-		public static final int ID_THORN_U = 222;
-		public static final int ID_TILDE = 223;
-		public static final int ID_TIMES = 224;
-		public static final int ID_TRADE = 225;
-		public static final int ID_UACUTE_L = 226;
-		public static final int ID_UACUTE_U = 227;
-		public static final int ID_UARR_L = 228;
-		public static final int ID_UARR_U = 229;
-		public static final int ID_UCIRC_L = 230;
-		public static final int ID_UCIRC_U = 231;
-		public static final int ID_UGRAVE_L = 232;
-		public static final int ID_UGRAVE_U = 233;
-		public static final int ID_UML = 234;
-		public static final int ID_UPSIH = 235;
-		public static final int ID_UPSILON_L = 236;
-		public static final int ID_UPSILON_U = 237;
-		public static final int ID_UUML_L = 238;
-		public static final int ID_UUML_U = 239;
-		public static final int ID_WEIERP = 240;
-		public static final int ID_XI_L = 241;
-		public static final int ID_XI_U = 242;
-		public static final int ID_YACUTE_L = 243;
-		public static final int ID_YACUTE_U = 244;
-		public static final int ID_YEN = 245;
-		public static final int ID_YUML_L = 246;
-		public static final int ID_YUML_U = 247;
-		public static final int ID_ZETA_L = 248;
-		public static final int ID_ZETA_U = 249;
-		public static final int ID_ZWJ = 250;
-		public static final int ID_ZWNJ = 251;
-
-		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 252.
-			// -- 5/24/2001
-			Class clazz = Ids.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;
-	}
-
-	private static String[] names = null;
-
-	static {
-		names = new String[Ids.getNumOfIds()];
-		names[Ids.ID_AACUTE_L] = AACUTE_L;
-		names[Ids.ID_AACUTE_U] = AACUTE_U;
-		names[Ids.ID_ACIRC_L] = ACIRC_L;
-		names[Ids.ID_ACIRC_U] = ACIRC_U;
-		names[Ids.ID_ACUTE] = ACUTE;
-		names[Ids.ID_AELIG_L] = AELIG_L;
-		names[Ids.ID_AELIG_U] = AELIG_U;
-		names[Ids.ID_AGRAVE_L] = AGRAVE_L;
-		names[Ids.ID_AGRAVE_U] = AGRAVE_U;
-		names[Ids.ID_ALEFSYM] = ALEFSYM;
-		names[Ids.ID_ALPHA_L] = ALPHA_L;
-		names[Ids.ID_ALPHA_U] = ALPHA_U;
-		names[Ids.ID_AMP] = AMP;
-		names[Ids.ID_AND] = AND;
-		names[Ids.ID_ANG] = ANG;
-		names[Ids.ID_ARING_L] = ARING_L;
-		names[Ids.ID_ARING_U] = ARING_U;
-		names[Ids.ID_ASYMP] = ASYMP;
-		names[Ids.ID_ATILDE_L] = ATILDE_L;
-		names[Ids.ID_ATILDE_U] = ATILDE_U;
-		names[Ids.ID_AUML_L] = AUML_L;
-		names[Ids.ID_AUML_U] = AUML_U;
-		names[Ids.ID_BDQUO] = BDQUO;
-		names[Ids.ID_BETA_L] = BETA_L;
-		names[Ids.ID_BETA_U] = BETA_U;
-		names[Ids.ID_BRVBAR] = BRVBAR;
-		names[Ids.ID_BULL] = BULL;
-		names[Ids.ID_CAP] = CAP;
-		names[Ids.ID_CCEDIL_L] = CCEDIL_L;
-		names[Ids.ID_CCEDIL_U] = CCEDIL_U;
-		names[Ids.ID_CEDIL] = CEDIL;
-		names[Ids.ID_CENT] = CENT;
-		names[Ids.ID_CHI_L] = CHI_L;
-		names[Ids.ID_CHI_U] = CHI_U;
-		names[Ids.ID_CIRC] = CIRC;
-		names[Ids.ID_CLUBS] = CLUBS;
-		names[Ids.ID_CONG] = CONG;
-		names[Ids.ID_COPY] = COPY;
-		names[Ids.ID_CRARR] = CRARR;
-		names[Ids.ID_CUP] = CUP;
-		names[Ids.ID_CURREN] = CURREN;
-		names[Ids.ID_DAGGER_L] = DAGGER_L;
-		names[Ids.ID_DAGGER_U] = DAGGER_U;
-		names[Ids.ID_DARR_L] = DARR_L;
-		names[Ids.ID_DARR_U] = DARR_U;
-		names[Ids.ID_DEG] = DEG;
-		names[Ids.ID_DELTA_L] = DELTA_L;
-		names[Ids.ID_DELTA_U] = DELTA_U;
-		names[Ids.ID_DIAMS] = DIAMS;
-		names[Ids.ID_DIVIDE] = DIVIDE;
-		names[Ids.ID_EACUTE_L] = EACUTE_L;
-		names[Ids.ID_EACUTE_U] = EACUTE_U;
-		names[Ids.ID_ECIRC_L] = ECIRC_L;
-		names[Ids.ID_ECIRC_U] = ECIRC_U;
-		names[Ids.ID_EGRAVE_L] = EGRAVE_L;
-		names[Ids.ID_EGRAVE_U] = EGRAVE_U;
-		names[Ids.ID_EMPTY] = EMPTY;
-		names[Ids.ID_EMSP] = EMSP;
-		names[Ids.ID_ENSP] = ENSP;
-		names[Ids.ID_EPSILON_L] = EPSILON_L;
-		names[Ids.ID_EPSILON_U] = EPSILON_U;
-		names[Ids.ID_EQUIV] = EQUIV;
-		names[Ids.ID_ETA_L] = ETA_L;
-		names[Ids.ID_ETA_U] = ETA_U;
-		names[Ids.ID_ETH_L] = ETH_L;
-		names[Ids.ID_ETH_U] = ETH_U;
-		names[Ids.ID_EUML_L] = EUML_L;
-		names[Ids.ID_EUML_U] = EUML_U;
-		names[Ids.ID_EURO] = EURO;
-		names[Ids.ID_EXIST] = EXIST;
-		names[Ids.ID_FNOF] = FNOF;
-		names[Ids.ID_FORALL] = FORALL;
-		names[Ids.ID_FRAC12] = FRAC12;
-		names[Ids.ID_FRAC14] = FRAC14;
-		names[Ids.ID_FRAC34] = FRAC34;
-		names[Ids.ID_FRASL] = FRASL;
-		names[Ids.ID_GAMMA_L] = GAMMA_L;
-		names[Ids.ID_GAMMA_U] = GAMMA_U;
-		names[Ids.ID_GE] = GE;
-		names[Ids.ID_GT] = GT;
-		names[Ids.ID_HARR_L] = HARR_L;
-		names[Ids.ID_HARR_U] = HARR_U;
-		names[Ids.ID_HEARTS] = HEARTS;
-		names[Ids.ID_HELLIP] = HELLIP;
-		names[Ids.ID_IACUTE_L] = IACUTE_L;
-		names[Ids.ID_IACUTE_U] = IACUTE_U;
-		names[Ids.ID_ICIRC_L] = ICIRC_L;
-		names[Ids.ID_ICIRC_U] = ICIRC_U;
-		names[Ids.ID_IEXCL] = IEXCL;
-		names[Ids.ID_IGRAVE_L] = IGRAVE_L;
-		names[Ids.ID_IGRAVE_U] = IGRAVE_U;
-		names[Ids.ID_IMAGE] = IMAGE;
-		names[Ids.ID_INFIN] = INFIN;
-		names[Ids.ID_INT] = INT;
-		names[Ids.ID_IOTA_L] = IOTA_L;
-		names[Ids.ID_IOTA_U] = IOTA_U;
-		names[Ids.ID_IQUEST] = IQUEST;
-		names[Ids.ID_ISIN] = ISIN;
-		names[Ids.ID_IUML_L] = IUML_L;
-		names[Ids.ID_IUML_U] = IUML_U;
-		names[Ids.ID_KAPPA_L] = KAPPA_L;
-		names[Ids.ID_KAPPA_U] = KAPPA_U;
-		names[Ids.ID_LAMBDA_L] = LAMBDA_L;
-		names[Ids.ID_LAMBDA_U] = LAMBDA_U;
-		names[Ids.ID_LANG] = LANG;
-		names[Ids.ID_LAQUO] = LAQUO;
-		names[Ids.ID_LARR_L] = LARR_L;
-		names[Ids.ID_LARR_U] = LARR_U;
-		names[Ids.ID_LCEIL] = LCEIL;
-		names[Ids.ID_LDQUO] = LDQUO;
-		names[Ids.ID_LE] = LE;
-		names[Ids.ID_LFLOOR] = LFLOOR;
-		names[Ids.ID_LOWAST] = LOWAST;
-		names[Ids.ID_LOZ] = LOZ;
-		names[Ids.ID_LRM] = LRM;
-		names[Ids.ID_LSAQUO] = LSAQUO;
-		names[Ids.ID_LSQUO] = LSQUO;
-		names[Ids.ID_LT] = LT;
-		names[Ids.ID_MACR] = MACR;
-		names[Ids.ID_MDASH] = MDASH;
-		names[Ids.ID_MICRO] = MICRO;
-		names[Ids.ID_MIDDOT] = MIDDOT;
-		names[Ids.ID_MINUS] = MINUS;
-		names[Ids.ID_MU_L] = MU_L;
-		names[Ids.ID_MU_U] = MU_U;
-		names[Ids.ID_NABLA] = NABLA;
-		names[Ids.ID_NBSP] = NBSP;
-		names[Ids.ID_NDASH] = NDASH;
-		names[Ids.ID_NE] = NE;
-		names[Ids.ID_NI] = NI;
-		names[Ids.ID_NOT] = NOT;
-		names[Ids.ID_NOTIN] = NOTIN;
-		names[Ids.ID_NSUB] = NSUB;
-		names[Ids.ID_NTILDE_L] = NTILDE_L;
-		names[Ids.ID_NTILDE_U] = NTILDE_U;
-		names[Ids.ID_NU_L] = NU_L;
-		names[Ids.ID_NU_U] = NU_U;
-		names[Ids.ID_OACUTE_L] = OACUTE_L;
-		names[Ids.ID_OACUTE_U] = OACUTE_U;
-		names[Ids.ID_OCIRC_L] = OCIRC_L;
-		names[Ids.ID_OCIRC_U] = OCIRC_U;
-		names[Ids.ID_OELIG_L] = OELIG_L;
-		names[Ids.ID_OELIG_U] = OELIG_U;
-		names[Ids.ID_OGRAVE_L] = OGRAVE_L;
-		names[Ids.ID_OGRAVE_U] = OGRAVE_U;
-		names[Ids.ID_OLINE] = OLINE;
-		names[Ids.ID_OMEGA_L] = OMEGA_L;
-		names[Ids.ID_OMEGA_U] = OMEGA_U;
-		names[Ids.ID_OMICRON_L] = OMICRON_L;
-		names[Ids.ID_OMICRON_U] = OMICRON_U;
-		names[Ids.ID_OPLUS] = OPLUS;
-		names[Ids.ID_OR] = OR;
-		names[Ids.ID_ORDF] = ORDF;
-		names[Ids.ID_ORDM] = ORDM;
-		names[Ids.ID_OSLASH_L] = OSLASH_L;
-		names[Ids.ID_OSLASH_U] = OSLASH_U;
-		names[Ids.ID_OTILDE_L] = OTILDE_L;
-		names[Ids.ID_OTILDE_U] = OTILDE_U;
-		names[Ids.ID_OTIMES] = OTIMES;
-		names[Ids.ID_OUML_L] = OUML_L;
-		names[Ids.ID_OUML_U] = OUML_U;
-		names[Ids.ID_PARA] = PARA;
-		names[Ids.ID_PART] = PART;
-		names[Ids.ID_PERMIL] = PERMIL;
-		names[Ids.ID_PERP] = PERP;
-		names[Ids.ID_PHI_L] = PHI_L;
-		names[Ids.ID_PHI_U] = PHI_U;
-		names[Ids.ID_PIV] = PIV;
-		names[Ids.ID_PI_L] = PI_L;
-		names[Ids.ID_PI_U] = PI_U;
-		names[Ids.ID_PLUSMN] = PLUSMN;
-		names[Ids.ID_POUND] = POUND;
-		names[Ids.ID_PRIME_L] = PRIME_L;
-		names[Ids.ID_PRIME_U] = PRIME_U;
-		names[Ids.ID_PROD] = PROD;
-		names[Ids.ID_PROP] = PROP;
-		names[Ids.ID_PSI_L] = PSI_L;
-		names[Ids.ID_PSI_U] = PSI_U;
-		names[Ids.ID_QUOT] = QUOT;
-		names[Ids.ID_RADIC] = RADIC;
-		names[Ids.ID_RANG] = RANG;
-		names[Ids.ID_RAQUO] = RAQUO;
-		names[Ids.ID_RARR_L] = RARR_L;
-		names[Ids.ID_RARR_U] = RARR_U;
-		names[Ids.ID_RCEIL] = RCEIL;
-		names[Ids.ID_RDQUO] = RDQUO;
-		names[Ids.ID_REAL] = REAL;
-		names[Ids.ID_REG] = REG;
-		names[Ids.ID_RFLOOR] = RFLOOR;
-		names[Ids.ID_RHO_L] = RHO_L;
-		names[Ids.ID_RHO_U] = RHO_U;
-		names[Ids.ID_RLM] = RLM;
-		names[Ids.ID_RSAQUO] = RSAQUO;
-		names[Ids.ID_RSQUO] = RSQUO;
-		names[Ids.ID_SBQUO] = SBQUO;
-		names[Ids.ID_SCARON_L] = SCARON_L;
-		names[Ids.ID_SCARON_U] = SCARON_U;
-		names[Ids.ID_SDOT] = SDOT;
-		names[Ids.ID_SECT] = SECT;
-		names[Ids.ID_SHY] = SHY;
-		names[Ids.ID_SIGMAF] = SIGMAF;
-		names[Ids.ID_SIGMA_L] = SIGMA_L;
-		names[Ids.ID_SIGMA_U] = SIGMA_U;
-		names[Ids.ID_SIM] = SIM;
-		names[Ids.ID_SPADES] = SPADES;
-		names[Ids.ID_SUB] = SUB;
-		names[Ids.ID_SUBE] = SUBE;
-		names[Ids.ID_SUM] = SUM;
-		names[Ids.ID_SUP] = SUP;
-		names[Ids.ID_SUP1] = SUP1;
-		names[Ids.ID_SUP2] = SUP2;
-		names[Ids.ID_SUP3] = SUP3;
-		names[Ids.ID_SUPE] = SUPE;
-		names[Ids.ID_SZLIG] = SZLIG;
-		names[Ids.ID_TAU_L] = TAU_L;
-		names[Ids.ID_TAU_U] = TAU_U;
-		names[Ids.ID_THERE4] = THERE4;
-		names[Ids.ID_THETASYM] = THETASYM;
-		names[Ids.ID_THETA_L] = THETA_L;
-		names[Ids.ID_THETA_U] = THETA_U;
-		names[Ids.ID_THINSP] = THINSP;
-		names[Ids.ID_THORN_L] = THORN_L;
-		names[Ids.ID_THORN_U] = THORN_U;
-		names[Ids.ID_TILDE] = TILDE;
-		names[Ids.ID_TIMES] = TIMES;
-		names[Ids.ID_TRADE] = TRADE;
-		names[Ids.ID_UACUTE_L] = UACUTE_L;
-		names[Ids.ID_UACUTE_U] = UACUTE_U;
-		names[Ids.ID_UARR_L] = UARR_L;
-		names[Ids.ID_UARR_U] = UARR_U;
-		names[Ids.ID_UCIRC_L] = UCIRC_L;
-		names[Ids.ID_UCIRC_U] = UCIRC_U;
-		names[Ids.ID_UGRAVE_L] = UGRAVE_L;
-		names[Ids.ID_UGRAVE_U] = UGRAVE_U;
-		names[Ids.ID_UML] = UML;
-		names[Ids.ID_UPSIH] = UPSIH;
-		names[Ids.ID_UPSILON_L] = UPSILON_L;
-		names[Ids.ID_UPSILON_U] = UPSILON_U;
-		names[Ids.ID_UUML_L] = UUML_L;
-		names[Ids.ID_UUML_U] = UUML_U;
-		names[Ids.ID_WEIERP] = WEIERP;
-		names[Ids.ID_XI_L] = XI_L;
-		names[Ids.ID_XI_U] = XI_U;
-		names[Ids.ID_YACUTE_L] = YACUTE_L;
-		names[Ids.ID_YACUTE_U] = YACUTE_U;
-		names[Ids.ID_YEN] = YEN;
-		names[Ids.ID_YUML_L] = YUML_L;
-		names[Ids.ID_YUML_U] = YUML_U;
-		names[Ids.ID_ZETA_L] = ZETA_L;
-		names[Ids.ID_ZETA_U] = ZETA_U;
-		names[Ids.ID_ZWJ] = ZWJ;
-		names[Ids.ID_ZWNJ] = ZWNJ;
-	}
-	private static char[] values = null;
-
-	static {
-		values = new char[Ids.getNumOfIds()];
-		values[Ids.ID_AACUTE_L] = 225;
-		values[Ids.ID_AACUTE_U] = 193;
-		values[Ids.ID_ACIRC_L] = 226;
-		values[Ids.ID_ACIRC_U] = 194;
-		values[Ids.ID_ACUTE] = 180;
-		values[Ids.ID_AELIG_L] = 230;
-		values[Ids.ID_AELIG_U] = 198;
-		values[Ids.ID_AGRAVE_L] = 224;
-		values[Ids.ID_AGRAVE_U] = 192;
-		values[Ids.ID_ALEFSYM] = 8501;
-		values[Ids.ID_ALPHA_L] = 945;
-		values[Ids.ID_ALPHA_U] = 913;
-		values[Ids.ID_AMP] = 38;
-		values[Ids.ID_AND] = 8743;
-		values[Ids.ID_ANG] = 8736;
-		values[Ids.ID_ARING_L] = 229;
-		values[Ids.ID_ARING_U] = 197;
-		values[Ids.ID_ASYMP] = 8776;
-		values[Ids.ID_ATILDE_L] = 227;
-		values[Ids.ID_ATILDE_U] = 195;
-		values[Ids.ID_AUML_L] = 228;
-		values[Ids.ID_AUML_U] = 196;
-		values[Ids.ID_BDQUO] = 8222;
-		values[Ids.ID_BETA_L] = 946;
-		values[Ids.ID_BETA_U] = 914;
-		values[Ids.ID_BRVBAR] = 166;
-		values[Ids.ID_BULL] = 8226;
-		values[Ids.ID_CAP] = 8745;
-		values[Ids.ID_CCEDIL_L] = 231;
-		values[Ids.ID_CCEDIL_U] = 199;
-		values[Ids.ID_CEDIL] = 184;
-		values[Ids.ID_CENT] = 162;
-		values[Ids.ID_CHI_L] = 967;
-		values[Ids.ID_CHI_U] = 935;
-		values[Ids.ID_CIRC] = 710;
-		values[Ids.ID_CLUBS] = 9827;
-		values[Ids.ID_CONG] = 8773;
-		values[Ids.ID_COPY] = 169;
-		values[Ids.ID_CRARR] = 8629;
-		values[Ids.ID_CUP] = 8746;
-		values[Ids.ID_CURREN] = 164;
-		values[Ids.ID_DAGGER_L] = 8224;
-		values[Ids.ID_DAGGER_U] = 8225;
-		values[Ids.ID_DARR_L] = 8595;
-		values[Ids.ID_DARR_U] = 8659;
-		values[Ids.ID_DEG] = 176;
-		values[Ids.ID_DELTA_L] = 948;
-		values[Ids.ID_DELTA_U] = 916;
-		values[Ids.ID_DIAMS] = 9830;
-		values[Ids.ID_DIVIDE] = 247;
-		values[Ids.ID_EACUTE_L] = 233;
-		values[Ids.ID_EACUTE_U] = 201;
-		values[Ids.ID_ECIRC_L] = 234;
-		values[Ids.ID_ECIRC_U] = 202;
-		values[Ids.ID_EGRAVE_L] = 232;
-		values[Ids.ID_EGRAVE_U] = 200;
-		values[Ids.ID_EMPTY] = 8709;
-		values[Ids.ID_EMSP] = 8195;
-		values[Ids.ID_ENSP] = 8194;
-		values[Ids.ID_EPSILON_L] = 949;
-		values[Ids.ID_EPSILON_U] = 917;
-		values[Ids.ID_EQUIV] = 8801;
-		values[Ids.ID_ETA_L] = 951;
-		values[Ids.ID_ETA_U] = 919;
-		values[Ids.ID_ETH_L] = 240;
-		values[Ids.ID_ETH_U] = 208;
-		values[Ids.ID_EUML_L] = 235;
-		values[Ids.ID_EUML_U] = 203;
-		values[Ids.ID_EURO] = 8364;
-		values[Ids.ID_EXIST] = 8707;
-		values[Ids.ID_FNOF] = 402;
-		values[Ids.ID_FORALL] = 8704;
-		values[Ids.ID_FRAC12] = 189;
-		values[Ids.ID_FRAC14] = 188;
-		values[Ids.ID_FRAC34] = 190;
-		values[Ids.ID_FRASL] = 8260;
-		values[Ids.ID_GAMMA_L] = 947;
-		values[Ids.ID_GAMMA_U] = 915;
-		values[Ids.ID_GE] = 8805;
-		values[Ids.ID_GT] = 62;
-		values[Ids.ID_HARR_L] = 8596;
-		values[Ids.ID_HARR_U] = 8660;
-		values[Ids.ID_HEARTS] = 9829;
-		values[Ids.ID_HELLIP] = 8230;
-		values[Ids.ID_IACUTE_L] = 237;
-		values[Ids.ID_IACUTE_U] = 205;
-		values[Ids.ID_ICIRC_L] = 238;
-		values[Ids.ID_ICIRC_U] = 206;
-		values[Ids.ID_IEXCL] = 161;
-		values[Ids.ID_IGRAVE_L] = 236;
-		values[Ids.ID_IGRAVE_U] = 204;
-		values[Ids.ID_IMAGE] = 8465;
-		values[Ids.ID_INFIN] = 8734;
-		values[Ids.ID_INT] = 8747;
-		values[Ids.ID_IOTA_L] = 953;
-		values[Ids.ID_IOTA_U] = 921;
-		values[Ids.ID_IQUEST] = 191;
-		values[Ids.ID_ISIN] = 8712;
-		values[Ids.ID_IUML_L] = 239;
-		values[Ids.ID_IUML_U] = 207;
-		values[Ids.ID_KAPPA_L] = 954;
-		values[Ids.ID_KAPPA_U] = 922;
-		values[Ids.ID_LAMBDA_L] = 955;
-		values[Ids.ID_LAMBDA_U] = 923;
-		values[Ids.ID_LANG] = 9001;
-		values[Ids.ID_LAQUO] = 171;
-		values[Ids.ID_LARR_L] = 8592;
-		values[Ids.ID_LARR_U] = 8656;
-		values[Ids.ID_LCEIL] = 8968;
-		values[Ids.ID_LDQUO] = 8220;
-		values[Ids.ID_LE] = 8804;
-		values[Ids.ID_LFLOOR] = 8970;
-		values[Ids.ID_LOWAST] = 8727;
-		values[Ids.ID_LOZ] = 9674;
-		values[Ids.ID_LRM] = 8206;
-		values[Ids.ID_LSAQUO] = 8249;
-		values[Ids.ID_LSQUO] = 8216;
-		values[Ids.ID_LT] = 60;
-		values[Ids.ID_MACR] = 175;
-		values[Ids.ID_MDASH] = 8212;
-		values[Ids.ID_MICRO] = 181;
-		values[Ids.ID_MIDDOT] = 183;
-		values[Ids.ID_MINUS] = 8722;
-		values[Ids.ID_MU_L] = 956;
-		values[Ids.ID_MU_U] = 924;
-		values[Ids.ID_NABLA] = 8711;
-		values[Ids.ID_NBSP] = 160;
-		values[Ids.ID_NDASH] = 8211;
-		values[Ids.ID_NE] = 8800;
-		values[Ids.ID_NI] = 8715;
-		values[Ids.ID_NOT] = 172;
-		values[Ids.ID_NOTIN] = 8713;
-		values[Ids.ID_NSUB] = 8836;
-		values[Ids.ID_NTILDE_L] = 241;
-		values[Ids.ID_NTILDE_U] = 209;
-		values[Ids.ID_NU_L] = 957;
-		values[Ids.ID_NU_U] = 925;
-		values[Ids.ID_OACUTE_L] = 243;
-		values[Ids.ID_OACUTE_U] = 211;
-		values[Ids.ID_OCIRC_L] = 244;
-		values[Ids.ID_OCIRC_U] = 212;
-		values[Ids.ID_OELIG_L] = 339;
-		values[Ids.ID_OELIG_U] = 338;
-		values[Ids.ID_OGRAVE_L] = 242;
-		values[Ids.ID_OGRAVE_U] = 210;
-		values[Ids.ID_OLINE] = 8254;
-		values[Ids.ID_OMEGA_L] = 969;
-		values[Ids.ID_OMEGA_U] = 937;
-		values[Ids.ID_OMICRON_L] = 959;
-		values[Ids.ID_OMICRON_U] = 927;
-		values[Ids.ID_OPLUS] = 8853;
-		values[Ids.ID_OR] = 8744;
-		values[Ids.ID_ORDF] = 170;
-		values[Ids.ID_ORDM] = 186;
-		values[Ids.ID_OSLASH_L] = 248;
-		values[Ids.ID_OSLASH_U] = 216;
-		values[Ids.ID_OTILDE_L] = 245;
-		values[Ids.ID_OTILDE_U] = 213;
-		values[Ids.ID_OTIMES] = 8855;
-		values[Ids.ID_OUML_L] = 246;
-		values[Ids.ID_OUML_U] = 214;
-		values[Ids.ID_PARA] = 182;
-		values[Ids.ID_PART] = 8706;
-		values[Ids.ID_PERMIL] = 8240;
-		values[Ids.ID_PERP] = 8869;
-		values[Ids.ID_PHI_L] = 966;
-		values[Ids.ID_PHI_U] = 934;
-		values[Ids.ID_PIV] = 982;
-		values[Ids.ID_PI_L] = 960;
-		values[Ids.ID_PI_U] = 928;
-		values[Ids.ID_PLUSMN] = 177;
-		values[Ids.ID_POUND] = 163;
-		values[Ids.ID_PRIME_L] = 8242;
-		values[Ids.ID_PRIME_U] = 8243;
-		values[Ids.ID_PROD] = 8719;
-		values[Ids.ID_PROP] = 8733;
-		values[Ids.ID_PSI_L] = 968;
-		values[Ids.ID_PSI_U] = 936;
-		values[Ids.ID_QUOT] = 34;
-		values[Ids.ID_RADIC] = 8730;
-		values[Ids.ID_RANG] = 9002;
-		values[Ids.ID_RAQUO] = 187;
-		values[Ids.ID_RARR_L] = 8594;
-		values[Ids.ID_RARR_U] = 8658;
-		values[Ids.ID_RCEIL] = 8969;
-		values[Ids.ID_RDQUO] = 8221;
-		values[Ids.ID_REAL] = 8476;
-		values[Ids.ID_REG] = 174;
-		values[Ids.ID_RFLOOR] = 8971;
-		values[Ids.ID_RHO_L] = 961;
-		values[Ids.ID_RHO_U] = 929;
-		values[Ids.ID_RLM] = 8207;
-		values[Ids.ID_RSAQUO] = 8250;
-		values[Ids.ID_RSQUO] = 8217;
-		values[Ids.ID_SBQUO] = 8218;
-		values[Ids.ID_SCARON_L] = 353;
-		values[Ids.ID_SCARON_U] = 352;
-		values[Ids.ID_SDOT] = 8901;
-		values[Ids.ID_SECT] = 167;
-		values[Ids.ID_SHY] = 173;
-		values[Ids.ID_SIGMAF] = 962;
-		values[Ids.ID_SIGMA_L] = 963;
-		values[Ids.ID_SIGMA_U] = 931;
-		values[Ids.ID_SIM] = 8764;
-		values[Ids.ID_SPADES] = 9824;
-		values[Ids.ID_SUB] = 8834;
-		values[Ids.ID_SUBE] = 8838;
-		values[Ids.ID_SUM] = 8721;
-		values[Ids.ID_SUP] = 8835;
-		values[Ids.ID_SUP1] = 185;
-		values[Ids.ID_SUP2] = 178;
-		values[Ids.ID_SUP3] = 179;
-		values[Ids.ID_SUPE] = 8839;
-		values[Ids.ID_SZLIG] = 223;
-		values[Ids.ID_TAU_L] = 964;
-		values[Ids.ID_TAU_U] = 932;
-		values[Ids.ID_THERE4] = 8756;
-		values[Ids.ID_THETASYM] = 977;
-		values[Ids.ID_THETA_L] = 952;
-		values[Ids.ID_THETA_U] = 920;
-		values[Ids.ID_THINSP] = 8201;
-		values[Ids.ID_THORN_L] = 254;
-		values[Ids.ID_THORN_U] = 222;
-		values[Ids.ID_TILDE] = 732;
-		values[Ids.ID_TIMES] = 215;
-		values[Ids.ID_TRADE] = 8482;
-		values[Ids.ID_UACUTE_L] = 250;
-		values[Ids.ID_UACUTE_U] = 218;
-		values[Ids.ID_UARR_L] = 8593;
-		values[Ids.ID_UARR_U] = 8657;
-		values[Ids.ID_UCIRC_L] = 251;
-		values[Ids.ID_UCIRC_U] = 219;
-		values[Ids.ID_UGRAVE_L] = 249;
-		values[Ids.ID_UGRAVE_U] = 217;
-		values[Ids.ID_UML] = 168;
-		values[Ids.ID_UPSIH] = 978;
-		values[Ids.ID_UPSILON_L] = 965;
-		values[Ids.ID_UPSILON_U] = 933;
-		values[Ids.ID_UUML_L] = 252;
-		values[Ids.ID_UUML_U] = 220;
-		values[Ids.ID_WEIERP] = 8472;
-		values[Ids.ID_XI_L] = 958;
-		values[Ids.ID_XI_U] = 926;
-		values[Ids.ID_YACUTE_L] = 253;
-		values[Ids.ID_YACUTE_U] = 221;
-		values[Ids.ID_YEN] = 165;
-		values[Ids.ID_YUML_L] = 255;
-		values[Ids.ID_YUML_U] = 376;
-		values[Ids.ID_ZETA_L] = 950;
-		values[Ids.ID_ZETA_U] = 918;
-		values[Ids.ID_ZWJ] = 8205;
-		values[Ids.ID_ZWNJ] = 8204;
-	}
-
-	/**
-	 */
-	public EntityCollection() {
-		super(names, STRICT_CASE);
-	}
-
-	/**
-	 * Create an entity declaration.
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 * @param attrName java.lang.String
-	 */
-	protected CMNode create(String entityName) {
-		int id = getID(entityName);
-		if (id == ID_UNKNOWN)
-			return null;
-
-		String value = String.valueOf(values[id]);
-		HTMLEntityDeclImpl dec = new HTMLEntityDeclImpl(entityName, value);
-
-		return dec;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLAttrDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLAttrDeclImpl.java
deleted file mode 100644
index 505d662..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLAttrDeclImpl.java
+++ /dev/null
@@ -1,118 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Implementation class of {@link <code>HTMLAttributeDeclaration</code>} interface.<br>
- */
-class HTMLAttrDeclImpl extends CMNodeImpl implements HTMLAttributeDeclaration {
-
-	private HTMLCMDataTypeImpl type = null;
-	private int usage = 0;
-
-	/**
-	 */
-	public HTMLAttrDeclImpl(String attrName, HTMLCMDataTypeImpl valueType, int valueUsage) {
-		super(attrName);
-		this.type = valueType;
-
-		switch (valueUsage) {
-			case OPTIONAL :
-			case REQUIRED :
-			case FIXED :
-			case PROHIBITED :
-				this.usage = valueUsage;
-				break;
-			default :
-				// should warn...
-				this.usage = OPTIONAL; // fall back
-				break;
-		}
-	}
-
-	/**
-	 * getAttrName method
-	 * @return java.lang.String
-	 */
-	public String getAttrName() {
-		return getNodeName();
-	}
-
-	/**
-	 * getAttrType method
-	 * @return CMDataType
-	 */
-	public CMDataType getAttrType() {
-		return type;
-	}
-
-	/**
-	 * @deprecated in superclass
-	 */
-	public String getDefaultValue() {
-		if (type.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_DEFAULT)
-			return null;
-		return type.getImpliedValue();
-	}
-
-	/**
-	 * @deprecated in superclass
-	 */
-	public Enumeration getEnumAttr() {
-		Vector v = new Vector(Arrays.asList(type.getEnumeratedValues()));
-		return v.elements();
-	}
-
-	/**
-	 * getNodeType method
-	 * @return int
-	 *
-	 * Returns one of :
-	 * ELEMENT_DECLARATION, ATTRIBUTE_DECLARATION, GROUP, ENTITY_DECLARATION.
-	 */
-	public int getNodeType() {
-		return CMNode.ATTRIBUTE_DECLARATION;
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getUsage() {
-		return usage;
-	}
-
-	/**
-	 */
-	public boolean supports(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
-			return true;
-		return super.supports(propertyName);
-	}
-
-	/**
-	 */
-	public Object getProperty(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
-			return new Boolean(true);
-		return super.getProperty(propertyName);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMDataTypeImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMDataTypeImpl.java
deleted file mode 100644
index 64931b6..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMDataTypeImpl.java
+++ /dev/null
@@ -1,126 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-class HTMLCMDataTypeImpl extends CMNodeImpl implements HTMLCMDataType {
-
-	private int impliedValueKind = IMPLIED_VALUE_NONE;
-	private String impliedValue = null;
-	private final static String[] emptyArray = new String[0];
-	private String[] enumValues = emptyArray;
-	private String instanceValue = null;
-
-	/**
-	 * HTMLCMDataTypeImpl constructor comment.
-	 * @param nm java.lang.String
-	 */
-	public HTMLCMDataTypeImpl(String typeName) {
-		super(typeName);
-	}
-
-	/**
-	 * HTMLCMDataTypeImpl constructor comment.
-	 * @param nm java.lang.String
-	 */
-	public HTMLCMDataTypeImpl(String typeName, String instanceValue) {
-		super(typeName);
-		this.instanceValue = instanceValue;
-	}
-
-	/**
-	 * 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.
-	 */
-	public String generateInstanceValue() {
-		return instanceValue;
-	}
-
-	/**
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDataType
-	 */
-	public String getDataTypeName() {
-		return getNodeName();
-	}
-
-	/**
-	 * getTypeName method
-	 * @return java.lang.String[]
-	 *
-	 */
-	public String[] getEnumeratedValues() {
-		return enumValues;
-	}
-
-	/**
-	 * getTypeName method
-	 * @return java.lang.String  
-	 *
-	 * Returns the implied value or null if none exists.
-	 */
-	public String getImpliedValue() {
-		return impliedValue;
-	}
-
-	/**
-	 * getImpliedValueKind method
-	 * @return int
-	 *
-	 * Returns one of :
-	 * IMPLIED_VALUE_NONE, IMPLIED_VALUE_FIXED, IMPLIED_VALUE_DEFAULT.
-	 */
-	public int getImpliedValueKind() {
-		return impliedValueKind;
-	}
-
-	/**
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 */
-	public int getNodeType() {
-		return CMNode.DATA_TYPE;
-	}
-
-	/**
-	 */
-	void setEnumValues(String[] values) {
-		enumValues = new String[values.length];
-		for (int i = 0; i < values.length; i++) {
-			enumValues[i] = values[i];
-		}
-	}
-
-	/**
-	 * package scope.
-	 */
-	void setImpliedValue(int kind, String value) {
-		switch (kind) {
-			case IMPLIED_VALUE_FIXED :
-			case IMPLIED_VALUE_DEFAULT :
-				impliedValueKind = kind;
-				impliedValue = value;
-				break;
-			case IMPLIED_VALUE_NONE :
-			default :
-				impliedValueKind = IMPLIED_VALUE_NONE;
-				impliedValue = null; // maybe a null string?
-				break;
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMNode.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMNode.java
deleted file mode 100644
index a1e555a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMNode.java
+++ /dev/null
@@ -1,32 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-/**
- * In HTML Documents, name and value of an attribute/element/entity
- * should be treated ignoring theirs case.  However, in XML documents,
- * they should be distinguished with sensitiveness of their case.
- * CMNode is basically designed to represent DTDs or Schemas for XML
- * documents.  So, it doesn't have interfaces to retrieve such information.
- * However, declarations in the HTML CM should provide such information.
- * This intermediate interface is intended to provide whether ignore cases
- * or not.<br>
- */
-interface HTMLCMNode extends org.eclipse.wst.xml.core.internal.contentmodel.CMNode {
-
-	/**
-	 * Returns <code>true</code>, if declaration is for HTML attribute/element/entity.
-	 * Otherwise, returns <code>false</code>.
-	 * @return boolean
-	 */
-	boolean shouldIgnoreCase();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLElemDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLElemDeclImpl.java
deleted file mode 100644
index 759294d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLElemDeclImpl.java
+++ /dev/null
@@ -1,369 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-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.HTMLCMProperties;
-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.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Base class for all Hed???? classes.
- */
-abstract class HTMLElemDeclImpl extends CMContentImpl implements HTMLElementDeclaration, HTMLPropertyDeclaration {
-
-	// DTD
-	protected CMNamedNodeMapImpl attributes = null;
-	protected String typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMPTY;
-	/** Never access this field directly.  Instead, use getComplexTypeDefinition method. */
-	private ComplexTypeDefinition typeDefinition = null;
-	protected CMGroupImpl inclusion = null;
-	protected CMGroupImpl exclusion = null;
-	// advanced information
-	protected CMNamedNodeMap prohibitedAncestors = null;
-	protected int correctionType = CORRECT_NONE;
-	protected int formatType = FORMAT_HTML;
-	protected int layoutType = LAYOUT_NONE;
-	protected int omitType = OMIT_NONE;
-	protected boolean keepSpaces = false;
-	protected boolean indentChild = false;
-	protected ElementCollection elementCollection = null;
-	protected AttributeCollection attributeCollection = null;
-	protected final static CMNamedNodeMap EMPTY_MAP = new 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 Iterator() {
-				public boolean hasNext() {
-					return false;
-				}
-
-				public Object next() {
-					return null;
-				}
-
-				public void remove() {
-				}
-			};
-		}
-	};
-
-	/**
-	 * HTMLElemDeclImpl constructor.
-	 * In the HTML DTD, an element declaration has no specification
-	 * for its occurrence.  Occurrence is specifed in content model, like
-	 * <code>(LI)+</code>.  To avoid confusion (and complexity),
-	 * occurrence of an element declaration is always 1 (it means, min = 1 and
-	 * max = 1).  Instead, occurrence of CMGroup represents actual occurrence
-	 * of the content.
-	 * <br>
-	 * @param name java.lang.String
-	 */
-	public HTMLElemDeclImpl(String elementName, ElementCollection collection) {
-		super(elementName, 1, 1);
-		elementCollection = collection;
-		attributeCollection = collection.getAttributeCollection();
-	}
-
-	/**
-	 */
-	protected abstract void createAttributeDeclarations();
-
-	private ComplexTypeDefinition createComplexTypeDefinition() {
-		if (typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_CDATA) || typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_EMPTY) || typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_PCDATA))
-			return null;
-
-		ComplexTypeDefinitionFactory factory = ComplexTypeDefinitionFactory.getInstance();
-		if (factory == null)
-			return null; // fatal error.
-
-		ComplexTypeDefinition def = factory.createTypeDefinition(typeDefinitionName, elementCollection);
-		return def;
-	}
-
-	/**
-	 * Get an attribute declaration.
-	 */
-	public HTMLAttributeDeclaration getAttributeDeclaration(String attrName) {
-		if (attributes == null) {
-			createAttributeDeclarations();
-			if (attributes == null)
-				return null; // fail to create
-		}
-
-		CMNode cmnode = attributes.getNamedItem(attrName);
-		if (cmnode == null) {
-			return null;
-		}
-		else {
-			return (HTMLAttributeDeclaration) cmnode; // already exists.
-		}
-	}
-
-	/**
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public CMNamedNodeMap getAttributes() {
-		if (attributes == null)
-			createAttributeDeclarations(); // lazy eval.
-		return attributes;
-	}
-
-	/**
-	 * Get an instance of complex type definition.
-	 */
-	private ComplexTypeDefinition getComplexTypeDefinition() {
-		if (typeDefinition == null)
-			typeDefinition = createComplexTypeDefinition();
-		return typeDefinition;
-	}
-
-	/**
-	 * Content.<br>
-	 * Element declarations which type is EMPTY or CDATA (maybe PCDATA)
-	 * <strong>MUST</strong> override this method and always return null.
-	 * This default implementation always tries to create a complex type definition
-	 * instance and access to it.
-	 * <br>
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public CMContent getContent() {
-		ComplexTypeDefinition def = getComplexTypeDefinition(); // lazy eval.
-		return (def != null) ? def.getContent() : null;
-	}
-
-	/**
-	 * Content type.<br>
-	 * Element declarations which type is EMPTY or CDATA (maybe PCDATA)
-	 * <strong>MUST</strong> override this method and return an appropriate type.
-	 * This default implementation always tries to create a complex type definition
-	 * instance and access to it.
-	 * <br>
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public int getContentType() {
-		ComplexTypeDefinition def = getComplexTypeDefinition(); // lazy eval.
-		return (def != null) ? def.getContentType() : CMElementDeclaration.CDATA;
-	}
-
-	/**
-	 * @see HTMLElementDeclaration#getCorrectionType
-	 */
-	public int getCorrectionType() {
-		return correctionType;
-	}
-
-	/**
-	 * HTML element doesn't have any data type.  So, this method always
-	 * returns <code>null</code>.<br>
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public CMDataType getDataType() {
-		return null;
-	}
-
-	/**
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public String getElementName() {
-		return getNodeName();
-	}
-
-	/**
-	 * Exclusion.
-	 * Almost elements don't have a exclusion.
-	 * Only classes those have exclusion should override this method.
-	 */
-	public CMContent getExclusion() {
-		return null;
-	}
-
-	/**
-	 * Default format type is <code>FORMAT_HTML</code>.<br>
-	 */
-	public int getFormatType() {
-		return formatType;
-	}
-
-	/**
-	 * Inclusion.
-	 * Almost elements don't have a inclusion.
-	 * Only classes those have inclusion should override this method.
-	 */
-	public CMContent getInclusion() {
-		return null;
-	}
-
-	/**
-	 */
-	public int getLayoutType() {
-		return layoutType;
-	}
-
-	/**
-	 * Line break hint is strongly related to layout type.
-	 * Indeed, in the C++DOM, it is determined from layout type only.
-	 * So, this implementation, as the default implementation for all declarations,
-	 * also determines from layout type only.<br>
-	 * @return int
-	 */
-	public int getLineBreakHint() {
-		switch (getLayoutType()) {
-			case HTMLElementDeclaration.LAYOUT_BLOCK :
-				return HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END;
-			case HTMLElementDeclaration.LAYOUT_BREAK :
-				return HTMLElementDeclaration.BREAK_AFTER_START;
-			case HTMLElementDeclaration.LAYOUT_HIDDEN :
-				return HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END;
-			default :
-				return HTMLElementDeclaration.BREAK_NONE;
-		}
-	}
-
-	/**
-	 * No HTML element has local elements.  So, this method always
-	 * returns an empty map.
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public CMNamedNodeMap getLocalElements() {
-		return EMPTY_MAP;
-	}
-
-	/**
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
-	 */
-	public int getNodeType() {
-		return CMNode.ELEMENT_DECLARATION;
-	}
-
-	/**
-	 */
-	public int getOmitType() {
-		return omitType;
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		return EMPTY_MAP;
-	}
-
-	/**
-	 */
-	public boolean supports(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
-			return true;
-		}
-		else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
-			ComplexTypeDefinition def = getComplexTypeDefinition();
-			return (def != null);
-		}
-		else {
-			PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
-			if (pp == null)
-				return false;
-			return pp.supports(this);
-		}
-
-	}
-
-	/**
-	 */
-	public Object getProperty(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
-			return new Boolean(true);
-		}
-		else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
-			ComplexTypeDefinition def = getComplexTypeDefinition();
-			return (def != null) ? def.getPrimaryCandidate() : null;
-		}
-		else {
-			PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
-			if (pp == null)
-				return null;
-			return pp.get(this);
-		}
-	}
-
-	/**
-	 * Return element names which terminates this element.<br>
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return null;
-	}
-
-	/**
-	 * return true when the element is a JSP element.
-	 */
-	public boolean isJSP() {
-		return false;
-	}
-
-	/**
-	 * In some elements, such as APPLET, a source generator should indent child
-	 * elements that their parents.  That is, a source generator should generate
-	 * source  of APPLET and PARAMS like this:
-	 * <PRE>
-	 *   &lt;APPLET ...&gt;
-	 *     &lt;PARAM ... &gt;
-	 *     &lt;PARAM ... &gt;
-	 *   &lt;/APPLET&gt;
-	 * <PRE>
-	 * @return boolean
-	 */
-	public boolean shouldIndentChildSource() {
-		return indentChild;
-	}
-
-	/**
-	 * Most of elements can compact spaces in their child text nodes.
-	 * Some special elements should keep them in their source.
-	 * @return boolean
-	 */
-	public boolean shouldKeepSpaces() {
-		return keepSpaces;
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public boolean shouldTerminateAt(HTMLElementDeclaration nextElement) {
-		Iterator i = getTerminators();
-		if (i == null)
-			return false;
-		String nextName = nextElement.getElementName();
-		while (i.hasNext()) {
-			if (nextName.equals(i.next()))
-				return true;
-		}
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLEntityDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLEntityDeclImpl.java
deleted file mode 100644
index c63d2a8..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLEntityDeclImpl.java
+++ /dev/null
@@ -1,77 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLEntityDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-class HTMLEntityDeclImpl extends CMNodeImpl implements HTMLEntityDeclaration {
-
-	private java.lang.String value = null;
-
-	/**
-	 * CMEntityDeclImpl constructor comment.
-	 * @param entityName java.lang.String; Entity name.
-	 * @param entityValue java.lang.String; Value string.
-	 */
-	public HTMLEntityDeclImpl(String entityName, String entityValue) {
-		super(entityName);
-		value = entityValue;
-	}
-
-	/**
-	 * getName method
-	 * @return java.lang.String
-	 */
-	public String getName() {
-		return getNodeName();
-	}
-
-	/**
-	 * Get CMNode type.<br>
-	 * @return int; Always return ENTITY_DECLARATION.
-	 */
-	public int getNodeType() {
-		return CMNode.ENTITY_DECLARATION;
-	}
-
-	/**
-	 * getValue method
-	 * @return java.lang.String
-	 */
-	public String getValue() {
-		return value;
-	}
-
-	/**
-	 */
-	public boolean supports(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
-			return true;
-		return super.supports(propertyName);
-	}
-
-	/**
-	 * Entities in HTML documents are always treated with ignoring cases.
-	 * Because no special entities are defined in JSP 1.0, this method
-	 * can always return <code>true</code>.<br>
-	 */
-	public Object getProperty(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
-			return new Boolean(true);
-		return super.getProperty(propertyName);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedA.java
deleted file mode 100644
index 455ca28..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedA.java
+++ /dev/null
@@ -1,98 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-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;
-
-/**
- * A.
- */
-final class HedA extends HedInlineContainer {
-
-	/**
-	 */
-	public HedA(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.A, collection);
-		// CORRECT_EMPTY - GROUP_COMPACT
-		correctionType = CORRECT_EMPTY;
-	}
-
-	/**
-	 * %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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_HREF,};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 * Exclusion.
-	 * <code>A</code> has the exclusion.
-	 * It is <code>A</code> itself.
-	 */
-	public CMContent getExclusion() {
-		if (exclusion != null)
-			return exclusion; // already created.
-		if (elementCollection == null)
-			return null;
-
-		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		CMNode a = elementCollection.getNamedItem(CHTMLNamespace.ElementName.A);
-		if (a != null)
-			exclusion.appendChild(a);
-
-		return exclusion;
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {CHTMLNamespace.ElementName.A,};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedADDRESS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedADDRESS.java
deleted file mode 100644
index 55579d8..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedADDRESS.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * ADDRESS.
- */
-final class HedADDRESS extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedADDRESS(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.ADDRESS, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_ADDRESS;
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs;
-	 */
-	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 = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBASE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBASE.java
deleted file mode 100644
index ab2c816..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBASE.java
+++ /dev/null
@@ -1,47 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * BASE.
- */
-final class HedBASE extends HedEmpty {
-
-	/**
-	 */
-	public HedBASE(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.BASE, collection);
-		// LAYOUT_HIDDEN.
-		// Because, BASE is GROUP_HIDDEN in the C++DOM/DTDParser.cpp.
-		layoutType = LAYOUT_HIDDEN;
-	}
-
-	/**
-	 * BASE.
-	 * (href %URI; #IMPLIED)
-	 * (target %FrameTarget; #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_HREF,};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBLOCKQUOTE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBLOCKQUOTE.java
deleted file mode 100644
index 818156e..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBLOCKQUOTE.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * BLOCKQUOTE.
- */
-final class HedBLOCKQUOTE extends HedFlowContainer {
-
-	/**
-	 */
-	public HedBLOCKQUOTE(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.BLOCKQUOTE, collection);
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs;
-	 * (cite %URI; #IMPLIED) 
-	 */
-	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 = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBODY.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBODY.java
deleted file mode 100644
index 992288f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBODY.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * BODY.
- */
-final class HedBODY extends HedFlowContainer {
-
-	private static String[] terminators = {CHTMLNamespace.ElementName.HEAD, CHTMLNamespace.ElementName.BODY, CHTMLNamespace.ElementName.HTML};
-
-	/**
-	 */
-	public HedBODY(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.BODY, collection);
-		layoutType = LAYOUT_BLOCK;
-		omitType = OMIT_BOTH;
-	}
-
-	/**
-	 * %attrs;
-	 * %bodycolors;
-	 * (onload %Script; #IMPLIED)
-	 * (onunload %Script; #IMPLIED)
-	 * (background %URI; #IMPLIED)
-	 * (marginwidth %Pixels; #IMPLIED) ... D205514
-	 * (marginheight %Pixels; #IMPLIED) .. D205514
-	 * (topmargin, CDATA, #IMPLIED) ...... D205514
-	 * (bottommargin, CDATA, #IMPLIED) ... D205514
-	 * (leftmargin, CDATA, #IMPLIED) ..... D205514
-	 * (rightmargin, CDATA, #IMPLIED) .... D205514
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// %bodycolors;
-		attributeCollection.getBodycolors(attributes);
-
-	}
-
-	/**
-	 * BODY has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBR.java
deleted file mode 100644
index 30ef48b..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBR.java
+++ /dev/null
@@ -1,51 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-
-
-
-/**
- * BR.
- */
-final class HedBR extends HedEmpty {
-
-	/**
-	 */
-	public HedBR(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.BR, collection);
-		// LAYOUT_BREAK.
-		// Because, BR is GROUP_BREAK in the C++DOM/DTDParser.cpp.
-		layoutType = LAYOUT_BREAK;
-	}
-
-	/**
-	 * BR.
-	 * %coreattrs;
-	 * (clear (left | all | right | none) none)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %coreattrs;
-		attributeCollection.getCore(attributes);
-		// clear
-		HTMLAttributeDeclaration attr = attributeCollection.getDeclaration(CHTMLNamespace.ATTR_NAME_CLEAR);
-		if (attr != null)
-			attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_CLEAR, attr);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedCENTER.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedCENTER.java
deleted file mode 100644
index c2c60d6..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedCENTER.java
+++ /dev/null
@@ -1,55 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * CENTER.
- */
-final class HedCENTER extends HedFlowContainer {
-
-	/**
-	 */
-	public HedCENTER(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.CENTER, collection);
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs;
-	 */
-	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 = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDD.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDD.java
deleted file mode 100644
index a5da292..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDD.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * DD.
- */
-final class HedDD extends HedFlowContainer {
-
-	private static String[] terminators = {CHTMLNamespace.ElementName.DT, CHTMLNamespace.ElementName.DD};
-
-	/**
-	 */
-	public HedDD(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.DD, collection);
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-		omitType = OMIT_END_DEFAULT;
-	}
-
-	/**
-	 * %attrs;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-	}
-
-	/**
-	 * DD has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDIV.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDIV.java
deleted file mode 100644
index adb56c2..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDIV.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * DIV.
- */
-final class HedDIV extends HedFlowContainer {
-
-	/**
-	 */
-	public HedDIV(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.DIV, collection);
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs;
-	 * %align;
-	 * %reserved;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// %align;
-		HTMLAttrDeclImpl attr = AttributeCollection.createAlignForParagraph();
-		if (attr != null)
-			attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
-		// %reserved; ... empty
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDL.java
deleted file mode 100644
index c09c9ac..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDL.java
+++ /dev/null
@@ -1,59 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * DL.
- */
-final class HedDL extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedDL(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.DL, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_DEFINITION_LIST;
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-		indentChild = true;
-	}
-
-	/**
-	 * %arrays;
-	 * (compact (compact) #IMPLIED)
-	 */
-	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 = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDT.java
deleted file mode 100644
index e12c4c4..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDT.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * DT.
- */
-final class HedDT extends HedInlineContainer {
-
-	private static String[] terminators = {CHTMLNamespace.ElementName.DT, CHTMLNamespace.ElementName.DD};
-
-	/**
-	 */
-	public HedDT(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.DT, collection);
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-		omitType = OMIT_END_DEFAULT;
-	}
-
-	/**
-	 * %attrs;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-	}
-
-	/**
-	 * DT has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedEmpty.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedEmpty.java
deleted file mode 100644
index 92c30da..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedEmpty.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Base class for EMPTY type element declarations.
- */
-abstract class HedEmpty extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedEmpty(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMPTY;
-		// EMPTY type has no end tag.
-		omitType = OMIT_END_MUST;
-	}
-
-	/**
-	 * Content.<br>
-	 * EMPTY type always returns <code>null</code>.
-	 * <br>
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
-	 */
-	public CMContent getContent() {
-		return null;
-	}
-
-	/**
-	 * Content type.<br>
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.EMPTY;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFORM.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFORM.java
deleted file mode 100644
index 599ca9a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFORM.java
+++ /dev/null
@@ -1,91 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-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;
-
-/**
- * FORM.
- */
-final class HedFORM extends HedFlowContainer {
-
-	/**
-	 */
-	public HedFORM(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.FORM, collection);
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs;
-	 * (action %URI; #REQUIRED)
-	 * (method (GET|POST) GET)
-	 * (enctype %ContentType; "application/x-www-form-urlencoded")
-	 * (accept %ContentTypes; #IMPLIED)
-	 * (name CDATA #IMPLIED)
-	 * (onsubmit %Script; #IMPLIED)
-	 * (onreset %Script; #IMPLIED)
-	 * (target %FrameTarget; #IMPLIED)
-	 * (accept-charset %Charsets; #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_ACTION, CHTMLNamespace.ATTR_NAME_METHOD, CHTMLNamespace.ATTR_NAME_ENCTYPE, CHTMLNamespace.ATTR_NAME_NAME,};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 * Exclusion.
-	 * <code>FORM</code> has the exclusion.
-	 * It is <code>FORM</code> itself.
-	 */
-	public CMContent getExclusion() {
-		if (exclusion != null)
-			return exclusion; // already created.
-		if (elementCollection == null)
-			return null; // fatal
-
-		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		CMNode form = elementCollection.getNamedItem(CHTMLNamespace.ElementName.FORM);
-		if (form != null)
-			exclusion.appendChild(form);
-
-		return exclusion;
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.FORM, CHTMLNamespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFlowContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFlowContainer.java
deleted file mode 100644
index 99f307b..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFlowContainer.java
+++ /dev/null
@@ -1,26 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Base class for (%flow;)* containers.
- */
-abstract class HedFlowContainer extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedFlowContainer(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FLOW_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHEAD.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHEAD.java
deleted file mode 100644
index 2366dce..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHEAD.java
+++ /dev/null
@@ -1,71 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * HTML.
- */
-final class HedHEAD extends HTMLElemDeclImpl {
-
-	private static String[] terminators = {CHTMLNamespace.ElementName.HEAD, CHTMLNamespace.ElementName.BODY, CHTMLNamespace.ElementName.HTML};
-
-	/**
-	 */
-	public HedHEAD(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.HEAD, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HEAD;
-		layoutType = LAYOUT_HIDDEN;
-		omitType = OMIT_BOTH;
-	}
-
-	/**
-	 * Create all attribute declarations.
-	 * This method is called once in the constructor of the super class.
-	 * The <code>HEAD</code> element may have the following attributes:
-	 * <table>
-	 * <tbody>
-	 *   <tr>
-	 *     <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>%i18n;</td><td>-</td><td>-</td><td>-</td><td>-</td>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>profile</td><td>URI</td><td>#IMPLIED</td><td>N/A</td><td>-</td>
-	 *   </tr>
-	 * </tbody>
-	 * </table>
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %i18n;
-		attributeCollection.getI18n(attributes);
-	}
-
-	/**
-	 * HEAD has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHR.java
deleted file mode 100644
index ed65ab3..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHR.java
+++ /dev/null
@@ -1,75 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-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;
-
-/**
- * HR.
- */
-final class HedHR extends HedEmpty {
-
-	/**
-	 */
-	public HedHR(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.HR, collection);
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * %attrs
-	 * (align (left|center|right) #IMPLIED) ... should be defined locally.
-	 * (noshade (noshade) #IMPLIED)
-	 * (size %Pixels; #IMPLIED)
-	 * (width %Length; #IMPLIED)
-	 * (color %Color; #IMPLIED) ... D205514
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-		// (align (left|center|right) #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		String[] values = {CHTMLNamespace.ATTR_VALUE_LEFT, CHTMLNamespace.ATTR_VALUE_CENTER, CHTMLNamespace.ATTR_VALUE_RIGHT};
-		atype.setEnumValues(values);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
-
-		// the rest.
-		String[] names = {CHTMLNamespace.ATTR_NAME_NOSHADE, CHTMLNamespace.ATTR_NAME_SIZE, CHTMLNamespace.ATTR_NAME_WIDTH,};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHTML.java
deleted file mode 100644
index a6243d2..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHTML.java
+++ /dev/null
@@ -1,80 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-
-
-/**
- * HTML.
- */
-final class HedHTML extends HTMLElemDeclImpl {
-
-	private static String[] terminators = {CHTMLNamespace.ElementName.HTML};
-
-	/**
-	 */
-	public HedHTML(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.HTML, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HTML;
-		layoutType = LAYOUT_HIDDEN;
-		omitType = OMIT_BOTH;
-	}
-
-	/**
-	 * Create all attribute declarations.
-	 * This method is called once in the constructor of the super class.
-	 * The <code>HTML</code> element may have the following attributes:
-	 * <table>
-	 * <tbody>
-	 *   <tr>
-	 *     <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
-	 *   </tr>
-	 *   <tr>
-	 *     <td><code>%i18n;</code></td><td>-</td><td>-</td><td>-</td>
-	 *     <td>{@link PDCMDocImpl#getAttrDeclarationsI18n}</td>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>version</td><td>CDATA</td><td>#FIXED</td>
-	 *     <td>{@link HTML_VERSION_TRANSITIONAL}</td><td>deplecated in HTML4.01</td>
-	 *   </tr>
-	 * </tbody>
-	 * </table><br>
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %i18n;
-		attributeCollection.getI18n(attributes);
-		// version
-		HTMLAttributeDeclaration adec = attributeCollection.getDeclaration(CHTMLNamespace.ATTR_NAME_VERSION);
-		if (adec != null)
-			attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_VERSION, adec);
-	}
-
-	/**
-	 * HTML has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHeading.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHeading.java
deleted file mode 100644
index 398e97a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHeading.java
+++ /dev/null
@@ -1,84 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * H[1-6].
- */
-final class HedHeading extends HedInlineContainer {
-
-	/**
-	 */
-	public HedHeading(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-	}
-
-	/**
-	 * Create all attribute declarations.
-	 * This method is called once in the constructor of the super class.
-	 * The <code>H1</code> element may have the following attributes:
-	 * <table>
-	 * <tbody>
-	 *   <tr>
-	 *     <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>%attrs;</td><td>-</td><td>-</td><td>-</td><td>-</td>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>%align;</td><td>-</td><td>-</td><td>-</td><td>-</td>
-	 *   </tr>
-	 * </tbody>
-	 * </table>
-	 * <p><b>%align;</b> means <code>align (left|center|right|justify) #IMPLIED</code>.
-	 * Unfortunately, this <code>align</code> is different from one in
-	 * <code>IMG</code> or <code>TABLE</code>.  So, the attribute declaration
-	 * of <code>align</code> should be localy created and it shouldn't be registered
-	 * in a <code>HCMDocImpl</code> instance.</p>
-	 * <p>However, %align is used in sevaral times.  I wouldn't write same code
-	 * in many times.  So, I add a new utility method into <code>CMUtil</code>
-	 * to create the attribute declaration.</p>
-	 * <br>
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// align
-		HTMLAttrDeclImpl attr = AttributeCollection.createAlignForParagraph();
-		if (attr != null)
-			attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedIMG.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedIMG.java
deleted file mode 100644
index ae95384..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedIMG.java
+++ /dev/null
@@ -1,87 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-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;
-
-/**
- * IMG.
- */
-final class HedIMG extends HedEmpty {
-
-	/**
-	 */
-	public HedIMG(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.IMG, collection);
-		layoutType = LAYOUT_OBJECT;
-	}
-
-	/**
-	 * 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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %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(CHTMLNamespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_SRC, attr);
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_ALT, CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_HEIGHT, CHTMLNamespace.ATTR_NAME_WIDTH, CHTMLNamespace.ATTR_NAME_BORDER, CHTMLNamespace.ATTR_NAME_HSPACE, CHTMLNamespace.ATTR_NAME_VSPACE,};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// align (local); should be defined locally.
-		attr = AttributeCollection.createAlignForImage();
-		attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {CHTMLNamespace.ElementName.PRE};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedINPUT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedINPUT.java
deleted file mode 100644
index bf0951c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedINPUT.java
+++ /dev/null
@@ -1,108 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * INPUT.
- */
-final class HedINPUT extends HedEmpty {
-
-	/**
-	 */
-	public HedINPUT(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.INPUT, collection);
-		layoutType = LAYOUT_OBJECT;
-	}
-
-	/**
-	 * 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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %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 = {CHTMLNamespace.ATTR_VALUE_TEXT, CHTMLNamespace.ATTR_VALUE_PASSWORD, CHTMLNamespace.ATTR_VALUE_CHECKBOX, CHTMLNamespace.ATTR_VALUE_RADIO, CHTMLNamespace.ATTR_VALUE_SUBMIT, CHTMLNamespace.ATTR_VALUE_RESET, CHTMLNamespace.ATTR_VALUE_HIDDEN,};
-		atype.setEnumValues(values);
-		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, CHTMLNamespace.ATTR_VALUE_TEXT);
-		attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_TYPE, attr);
-
-		// (size CDATA #IMPLIED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_SIZE, attr);
-
-		// (alt CDATA #IMPLIED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_ALT, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALT, attr);
-
-		// (align %IAlign; #IMPLIED) ... should be defined locally.
-		attr = AttributeCollection.createAlignForImage();
-		attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
-
-		// the rest.
-		String[] names = {CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_VALUE, CHTMLNamespace.ATTR_NAME_CHECKED, CHTMLNamespace.ATTR_NAME_SIZE, CHTMLNamespace.ATTR_NAME_MAXLENGTH, CHTMLNamespace.ATTR_NAME_SRC, CHTMLNamespace.ATTR_NAME_ALT, CHTMLNamespace.ATTR_NAME_ALIGN, CHTMLNamespace.ATTR_NAME_ISTYLE,
-		//<<D215684
-					CHTMLNamespace.ATTR_NAME_WIDTH, CHTMLNamespace.ATTR_NAME_HEIGHT, CHTMLNamespace.ATTR_NAME_BORDER
-		//<D215684
-		};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedInlineContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedInlineContainer.java
deleted file mode 100644
index 99f14c9..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedInlineContainer.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Base class for (%inline;)* containers.
- */
-abstract class HedInlineContainer extends HTMLElemDeclImpl {
-
-	/**
-	 * HedInlineContainer.
-	 * @param elementName java.lang.String
-	 * @param collection ElementCollection
-	 */
-	public HedInlineContainer(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_INLINE_CONTAINER;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedLI.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedLI.java
deleted file mode 100644
index 6a3a344..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedLI.java
+++ /dev/null
@@ -1,58 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * LI.
- */
-final class HedLI extends HedFlowContainer {
-
-	private static String[] terminators = {CHTMLNamespace.ElementName.LI};
-
-	/**
-	 */
-	public HedLI(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.LI, collection);
-		layoutType = LAYOUT_BLOCK;
-		omitType = OMIT_END_DEFAULT;
-	}
-
-	/**
-	 * %attrs;
-	 * (type %LIStyle; #IMPLIED) ... should be defined locally.
-	 * (value NUMBER #IMPLIED) ... should be defined locally.
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-	}
-
-	/**
-	 * LI has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedListItemContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedListItemContainer.java
deleted file mode 100644
index 9e457c7..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedListItemContainer.java
+++ /dev/null
@@ -1,30 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Base class for list item container declarations.
- * - OL, UL, MENU, DIR.
- */
-abstract class HedListItemContainer extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedListItemContainer(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_LI_CONTAINER;
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-		indentChild = true;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMENU.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMENU.java
deleted file mode 100644
index 581d954..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMENU.java
+++ /dev/null
@@ -1,86 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-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;
-
-/**
- * MENU/DIR.
- */
-final class HedMENU extends HedListItemContainer {
-
-	/**
-	 */
-	public HedMENU(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-	}
-
-	/**
-	 * MENU/DIR.
-	 * (compact (compact) #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-	}
-
-	/**
-	 * Exclusion.
-	 * <code>MENU/DIR</code> has the exclusion.
-	 * It is <code>%block;</code>.
-	 * %block; is:
-	 * P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
-	 * NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
-	 * TABLE | FIELDSET | ADDRESS.
-	 * %heading; is: H1 | H2 | H3 | H4 | H5 | H6.
-	 * %list; is : UL | OL | DIR | MENU.
-	 * %preformatted; is PRE.
-	 * <br>
-	 */
-	public CMContent getExclusion() {
-		if (exclusion != null)
-			return exclusion; // already created.
-		if (elementCollection == null)
-			return null;
-
-		// %block;
-		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		String[] names = {CHTMLNamespace.ElementName.P, CHTMLNamespace.ElementName.H1, CHTMLNamespace.ElementName.H2, CHTMLNamespace.ElementName.H3, CHTMLNamespace.ElementName.H4, CHTMLNamespace.ElementName.H5, CHTMLNamespace.ElementName.H6, CHTMLNamespace.ElementName.UL, CHTMLNamespace.ElementName.OL, CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU, CHTMLNamespace.ElementName.PRE, CHTMLNamespace.ElementName.DL, CHTMLNamespace.ElementName.DIV, CHTMLNamespace.ElementName.CENTER, CHTMLNamespace.ElementName.BLOCKQUOTE, CHTMLNamespace.ElementName.FORM, CHTMLNamespace.ElementName.HR, CHTMLNamespace.ElementName.ADDRESS};
-		elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
-		return exclusion;
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMETA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMETA.java
deleted file mode 100644
index 882eca9..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMETA.java
+++ /dev/null
@@ -1,67 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * META.
- */
-final class HedMETA extends HedEmpty {
-
-	/**
-	 */
-	public HedMETA(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.META, collection);
-		layoutType = LAYOUT_HIDDEN;
-	}
-
-	/**
-	 * 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)
-			return; // already created.
-		if (attributeCollection == null)
-			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(CHTMLNamespace.ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_NAME, attr);
-
-		// 249493
-		atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_CONTENT, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_CONTENT, attr);
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_HTTP_EQUIV,
-		//		CHTMLNamespace.ATTR_NAME_CONTENT
-		};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOL.java
deleted file mode 100644
index b2583d0..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOL.java
+++ /dev/null
@@ -1,58 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * OL.
- */
-final class HedOL extends HedListItemContainer {
-
-	/**
-	 */
-	public HedOL(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.OL, collection);
-	}
-
-	/**
-	 * OL.
-	 * (type %OLStyle; #IMPLIED) ... should be defined locally.
-	 * (compact (compact) #IMPLIED)
-	 * (start NUMBER #IMPLIED)
-	 */
-	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 = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOPTION.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOPTION.java
deleted file mode 100644
index 84a081d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOPTION.java
+++ /dev/null
@@ -1,63 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * OPTION.
- */
-final class HedOPTION extends HedPcdata {
-
-	private static String[] terminators = {CHTMLNamespace.ElementName.OPTION};
-
-	/**
-	 */
-	public HedOPTION(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.OPTION, collection);
-		layoutType = LAYOUT_HIDDEN;
-		omitType = OMIT_END;
-	}
-
-	/**
-	 * OPTION.
-	 * %attrs;
-	 * (selected (selected) #IMPLIED)
-	 * (disabled (disabled) #IMPLIED)
-	 * (label %Text; #IMPLIED)
-	 * (value CDATA #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_SELECTED, CHTMLNamespace.ATTR_NAME_VALUE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-
-	/**
-	 * OPTION has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		return Arrays.asList(terminators).iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedP.java
deleted file mode 100644
index eb056eb..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedP.java
+++ /dev/null
@@ -1,104 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * P.
- */
-final class HedP extends HedInlineContainer {
-
-	private static Collection terminators = null;
-
-	/**
-	 */
-	public HedP(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.P, collection);
-		correctionType = CORRECT_EMPTY;
-		layoutType = LAYOUT_BLOCK;
-		omitType = OMIT_END;
-	}
-
-	/**
-	 * Create all attribute declarations.
-	 * This method is called once in the constructor of the super class.
-	 * The <code>P</code> element may have the following attributes:
-	 * <table>
-	 * <tbody>
-	 *   <tr>
-	 *     <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>%attrs;</td><td>-</td><td>-</td><td>-</td><td>-</td>
-	 *   </tr>
-	 *   <tr>
-	 *     <td>%align;</td><td>-</td><td>-</td><td>-</td><td>-</td>
-	 *   </tr>
-	 * </tbody>
-	 * </table>
-	 * <p><b>%align;</b> means <code>align (left|center|right|justify) #IMPLIED</code>.
-	 * Unfortunately, this <code>align</code> is different from one in
-	 * <code>IMG</code> or <code>TABLE</code>.  So, the attribute declaration
-	 * of <code>align</code> should be localy created and it shouldn't be registered
-	 * in a <code>HCMDocImpl</code> instance.</p>
-	 * <p>However, %align is used in sevaral times.  I wouldn't write same code
-	 * in many times.  So, I add a new utility method into <code>CMUtil</code>
-	 * to create the attribute declaration.</p>
-	 * <br>
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-		attributes = new CMNamedNodeMapImpl();
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// align
-		HTMLAttrDeclImpl adec = AttributeCollection.createAlignForParagraph();
-		attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, adec);
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-		String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-		return prohibitedAncestors;
-	}
-
-	/**
-	 * Return names of terminators.
-	 * <code>P</code> has terminators.
-	 * @return java.util.Iterator
-	 */
-	protected Iterator getTerminators() {
-		if (terminators != null)
-			return terminators.iterator();
-		//<<D217982
-		terminators = new Vector();
-		terminators.addAll(elementCollection.getNamesOfBlock());
-		terminators.add(CHTMLNamespace.ElementName.LI);
-		terminators.add(CHTMLNamespace.ElementName.DT);
-		terminators.add(CHTMLNamespace.ElementName.DD);
-		//D217982
-		return terminators.iterator();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPRE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPRE.java
deleted file mode 100644
index 99f5975..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPRE.java
+++ /dev/null
@@ -1,90 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-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;
-
-/**
- * PRE.
- */
-final class HedPRE extends HedInlineContainer {
-
-	/**
-	 * PRE element should keep spaces in its source.
-	 */
-	public HedPRE(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.PRE, collection);
-		// CORRECT_EMPTY - GROUP_COMPACT
-		correctionType = CORRECT_EMPTY;
-
-		keepSpaces = true;
-	}
-
-	/**
-	 * %attrs;
-	 * (width NUMBER #IMPLIED) ... should be defined locally.
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-		// (width NUMBER #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_WIDTH, attr);
-	}
-
-	/**
-	 * Exclusion.
-	 * <code>PRE</code> has the exclusion.
-	 * It is <code>%pre.exclusion;</code>.
-	 * %pre.exclusion is:
-	 * IMG | OBJECT | APPLET | BIG | SMALL | SUB | SUP | FONT | BASEFONT
-	 */
-	public CMContent getExclusion() {
-		if (exclusion != null)
-			return exclusion; // already created.
-		if (elementCollection == null)
-			return null;
-
-		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-		String[] names = {CHTMLNamespace.ElementName.IMG,};
-		elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
-
-		return exclusion;
-	}
-
-	/**
-	 */
-	public CMNamedNodeMap getProhibitedAncestors() {
-		if (prohibitedAncestors != null)
-			return prohibitedAncestors;
-
-		String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPcdata.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPcdata.java
deleted file mode 100644
index 15b13c3..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPcdata.java
+++ /dev/null
@@ -1,47 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Base class for PCDATA type element declarations.<br>
- */
-abstract class HedPcdata extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedPcdata(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_PCDATA;
-	}
-
-	/**
-	 * Content.<br>
-	 * PCDATA type always returns <code>null</code>.
-	 * <br>
-	 * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
-	 */
-	public CMContent getContent() {
-		return null;
-	}
-
-	/**
-	 * Content type.<br>
-	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
-	 */
-	public int getContentType() {
-		return CMElementDeclaration.PCDATA;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSELECT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSELECT.java
deleted file mode 100644
index cbd0bb8..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSELECT.java
+++ /dev/null
@@ -1,65 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * SELECT.
- */
-final class HedSELECT extends HTMLElemDeclImpl {
-
-	/**
-	 */
-	public HedSELECT(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.SELECT, collection);
-		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_SELECT;
-		layoutType = LAYOUT_OBJECT;
-		indentChild = true;
-	}
-
-	/**
-	 * %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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-		// (size NUMBER #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_SIZE, attr);
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_MULTIPLE,};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIBase.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIBase.java
deleted file mode 100644
index b0e0bd3..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIBase.java
+++ /dev/null
@@ -1,52 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-
-
-
-
-/**
- * Base class for SSI declarations.
- */
-abstract class HedSSIBase extends HedEmpty {
-
-	/**
-	 */
-	public HedSSIBase(String elementName, ElementCollection collection) {
-		super(elementName, collection);
-		layoutType = LAYOUT_OBJECT;
-	}
-
-	/**
-	 */
-	public int getFormatType() {
-		return HTMLElementDeclaration.FORMAT_SSI;
-	}
-
-	/**
-	 */
-	public boolean supports(String propName) {
-		if (propName.equals(HTMLCMProperties.IS_SSI))
-			return true;
-		return super.supports(propName);
-	}
-
-	/*
-	 */
-	public Object getProperty(String propName) {
-		if (propName.equals(HTMLCMProperties.IS_SSI))
-			return new Boolean(true);
-		return super.getProperty(propName);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIConfig.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIConfig.java
deleted file mode 100644
index d5e92e3..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIConfig.java
+++ /dev/null
@@ -1,45 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:CONFIG.
- */
-final class HedSSIConfig extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIConfig(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.SSI_CONFIG, collection);
-	}
-
-	/**
-	 * SSI:CONFIG.
-	 * (errmsg CDATA #IMPLIED)
-	 * (sizefmt CDATA #IMPLIED)
-	 * (timefmt CDATA #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_ERRMSG, CHTMLNamespace.ATTR_NAME_SIZEFMT, CHTMLNamespace.ATTR_NAME_TIMEFMT};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIEcho.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIEcho.java
deleted file mode 100644
index 3cf3f7c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIEcho.java
+++ /dev/null
@@ -1,43 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:ECHO.
- */
-final class HedSSIEcho extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIEcho(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.SSI_ECHO, collection);
-	}
-
-	/**
-	 * SSI:ECHO
-	 * (var CDATA #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_VAR};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIExec.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIExec.java
deleted file mode 100644
index e97cb5d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIExec.java
+++ /dev/null
@@ -1,44 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:EXEC.
- */
-final class HedSSIExec extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIExec(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.SSI_EXEC, collection);
-	}
-
-	/**
-	 * SSI:EXEC
-	 * (cgi %URI; #IMPLIED)
-	 * (cmd CDATA #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_CGI, CHTMLNamespace.ATTR_NAME_CMD};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFlastmod.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFlastmod.java
deleted file mode 100644
index 75eaf9d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFlastmod.java
+++ /dev/null
@@ -1,44 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:FLASTMOD.
- */
-final class HedSSIFlastmod extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIFlastmod(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.SSI_FLASTMOD, collection);
-	}
-
-	/**
-	 * SSI:FLASTMOD
-	 * (file %URI; #IMPLIED)
-	 * (virtual %URI #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_FILE, CHTMLNamespace.ATTR_NAME_VIRTUAL};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFsize.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFsize.java
deleted file mode 100644
index 3fbf3c1..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFsize.java
+++ /dev/null
@@ -1,44 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:FSIZE.
- */
-final class HedSSIFsize extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIFsize(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.SSI_FSIZE, collection);
-	}
-
-	/**
-	 * SSI:FSIZE
-	 * (file %URI; #IMPLIED)
-	 * (virtual %URI #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_FILE, CHTMLNamespace.ATTR_NAME_VIRTUAL};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIInclude.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIInclude.java
deleted file mode 100644
index 4788b5e..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIInclude.java
+++ /dev/null
@@ -1,44 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:INCLUDE.
- */
-final class HedSSIInclude extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIInclude(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.SSI_INCLUDE, collection);
-	}
-
-	/**
-	 * SSI:INCLUDE
-	 * (file %URI; #IMPLIED)
-	 * (virtual %URI #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_FILE, CHTMLNamespace.ATTR_NAME_VIRTUAL};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIPrintenv.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIPrintenv.java
deleted file mode 100644
index 0064a4f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIPrintenv.java
+++ /dev/null
@@ -1,48 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * SSI:PRINTENV.
- */
-final class HedSSIPrintenv extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSIPrintenv(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.SSI_PRINTENV, collection);
-	}
-
-	/**
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-	}
-
-	/**
-	 * SSI:PRINTENV has no attributes.  So, this method should
-	 * always return <code>null</code>.
-	 * Note: Since somebody doesn't expect null is returned, return the empty attribute
-	 * like a custom tag which doesn't have attributes
-	 */
-	public CMNamedNodeMap getAttributes() {
-		return super.getAttributes();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSISet.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSISet.java
deleted file mode 100644
index e1a8e1d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSISet.java
+++ /dev/null
@@ -1,44 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:SET.
- */
-final class HedSSISet extends HedSSIBase {
-
-	/**
-	 */
-	public HedSSISet(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.SSI_SET, collection);
-	}
-
-	/**
-	 * SSI:SET
-	 * (var CDATA #IMPLIED)
-	 * (value CDATA #IMPLIED)
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_VAR, CHTMLNamespace.ATTR_NAME_VALUE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTEXTAREA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTEXTAREA.java
deleted file mode 100644
index bef9535..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTEXTAREA.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * TEXTAREA.
- */
-final class HedTEXTAREA extends HedPcdata {
-
-	/**
-	 * TEXTAREA should keep spaces in its source.
-	 */
-	public HedTEXTAREA(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.TEXTAREA, collection);
-		layoutType = LAYOUT_OBJECT;
-
-		keepSpaces = true;
-	}
-
-	/**
-	 * 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)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-		attributes = new CMNamedNodeMapImpl();
-
-		// %attrs;
-		attributeCollection.getAttrs(attributes);
-
-		String[] names = {CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_ROWS, CHTMLNamespace.ATTR_NAME_COLS, CHTMLNamespace.ATTR_NAME_ISTYLE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTITLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTITLE.java
deleted file mode 100644
index 007bf35..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTITLE.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * TITLE.
- */
-final class HedTITLE extends HedPcdata {
-
-	/**
-	 */
-	public HedTITLE(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.TITLE, collection);
-		layoutType = LAYOUT_HIDDEN;
-	}
-
-	/**
-	 * TITLE.
-	 * %i18n;
-	 */
-	protected void createAttributeDeclarations() {
-		if (attributes != null)
-			return; // already created.
-		if (attributeCollection == null)
-			return; // fatal
-
-		attributes = new CMNamedNodeMapImpl();
-
-		// %i18n;
-		attributeCollection.getI18n(attributes);
-	}
-
-	/**
-	 * Exclusion.
-	 * <code>TITLE</code> has the exclusion.
-	 * It is <code>%head.misc;</code>.
-	 * %head.misc; is <code>SCRIPT|STYLE|META|LINK|OBJECT</code>.
-	 * <br>
-	 */
-	public CMContent getExclusion() {
-		if (exclusion != null)
-			return exclusion; // already created.
-		if (elementCollection == null)
-			return null;
-
-		// (SCRIPT|STYLE|META|LINK|OBJECT)
-		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-
-		String[] names = {CHTMLNamespace.ElementName.META,};
-		elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
-		return exclusion;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedUL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedUL.java
deleted file mode 100644
index 15ddbc1..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedUL.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * UL.
- */
-final class HedUL extends HedListItemContainer {
-
-	/**
-	 */
-	public HedUL(ElementCollection collection) {
-		super(CHTMLNamespace.ElementName.UL, collection);
-	}
-
-	/**
-	 * UL.
-	 * (type %ULStyle; #IMPLIED) ... should be defined locally.
-	 * (compact (compact) #IMPLIED)
-	 */
-	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 = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
-		prohibitedAncestors = elementCollection.getDeclarations(names);
-
-		return prohibitedAncestors;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProvider.java
deleted file mode 100644
index 6ed567d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProvider.java
+++ /dev/null
@@ -1,26 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-
-
-
-/**
- * PropertyProvider class.
- * This class is intended to be used in HTMLElementDeclaration instances.
- */
-interface PropertyProvider {
-
-	boolean supports(HTMLElementDeclaration edecl);
-
-	Object get(HTMLElementDeclaration edecl);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProviderFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProviderFactory.java
deleted file mode 100644
index 2c7b1b9..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProviderFactory.java
+++ /dev/null
@@ -1,364 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-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.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.AnnotationMap;
-
-/**
- * The factory object of PropertyProvider.
- */
-final class PropertyProviderFactory {
-
-
-	/**
-	 * DefaultProvider is intended to be used for unknown properties.
-	 * It always returns null value for any properties.
-	 */
-	class DefaultProvider implements PropertyProvider {
-		public DefaultProvider() {
-			super();
-		}
-
-		public boolean supports(HTMLElementDeclaration edecl) {
-			return false;
-		}
-
-		public Object get(HTMLElementDeclaration edecl) {
-			return null;
-		}
-	}
-
-	abstract class AbstractElementPropertyProvider implements PropertyProvider {
-		protected AbstractElementPropertyProvider() {
-			super();
-		}
-
-		public boolean supports(HTMLElementDeclaration edecl) {
-			return (edecl != null);
-		}
-
-		public Object get(HTMLElementDeclaration edecl) {
-			if (!(edecl instanceof HTMLPropertyDeclaration))
-				return null;
-			return getElementProperty((HTMLPropertyDeclaration)edecl);
-		}
-
-		abstract protected Object getElementProperty(HTMLPropertyDeclaration decl);
-	}
-
-	/*
-	 * "tagInfo"
-	 * gets documentation for the element
-	 */
-	class PPTagInfo extends AbstractElementPropertyProvider {
-		private final static String htmlAnnotationLoc = "data/htmref.xml"; //$NON-NLS-1$
-		protected AnnotationMap fAnnotationMap = null;
-
-		public PPTagInfo() {
-			super();
-		}
-
-		/**
-		 * Gets the annotationMap.
-		 * @return Returns a AnnotationMap
-		 */
-		protected AnnotationMap getAnnotationMap() {
-			if (fAnnotationMap == null) {
-				fAnnotationMap = new AnnotationMap();
-				try {
-					fAnnotationMap.load(htmlAnnotationLoc, HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
-				}
-				catch (Exception e) {
-					// no annotation available
-				}
-			}
-			return fAnnotationMap;
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			if (decl instanceof HTMLElementDeclaration) {
-				return getAnnotationMap().getProperty(((HTMLElementDeclaration)decl).getElementName(), "tagInfo"); //$NON-NLS-1$
-			} else {
-				return null;
-			}
-		}
-	}
-
-	/*
-	 * "shouldKeepSpace"
-	 */
-	class PPShouldKeepSpace extends AbstractElementPropertyProvider {
-		public PPShouldKeepSpace() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return new Boolean(decl.shouldKeepSpaces());
-		}
-	}
-
-	/*
-	 * "shouldIndentChildSource"
-	 */
-	class PPShouldIndentChildSource extends AbstractElementPropertyProvider {
-		public PPShouldIndentChildSource() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return new Boolean(decl.shouldIndentChildSource());
-		}
-	}
-
-	/*
-	 * "terminators"
-	 */
-	class PPTerminators extends AbstractElementPropertyProvider {
-		public PPTerminators() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			if (decl == null)
-				return null;
-			if (! (decl instanceof HTMLElemDeclImpl)) return null;
-			return ((HTMLElemDeclImpl)decl).getTerminators();
-		}
-	}
-
-	/*
-	 * "prohibitedAncestors"
-	 */
-	class PPProhibitedAncestors extends AbstractElementPropertyProvider {
-		public PPProhibitedAncestors() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return decl.getProhibitedAncestors();
-		}
-	}
-
-	/*
-	 * "isJSP"
-	 */
-	class PPIsJSP extends AbstractElementPropertyProvider {
-		public PPIsJSP() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return new Boolean(decl.isJSP());
-		}
-	}
-
-	/*
-	 * "isXHTML"
-	 * HTMLElementDeclaration itself never represent any XHTML element declaration.
-	 * So, this property must be always false.
-	 */
-	class PPIsXHTML extends AbstractElementPropertyProvider {
-		public PPIsXHTML() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return new Boolean(false);
-		}
-	}
-
-	/*
-	 * "isSSI"
-	 * Each declaration class for SSI elements must provide this property itself,
-	 * and then return true.  Other declaration must always return false.
-	 */
-	class PPIsSSI extends AbstractElementPropertyProvider {
-		public PPIsSSI() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return new Boolean(false);
-		}
-	}
-
-	/*
-	 * "lineBreakHint"
-	 */
-	class PPLineBreakHint extends AbstractElementPropertyProvider {
-		public PPLineBreakHint() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			String hint = HTMLCMProperties.Values.BREAK_NONE;
-			switch (decl.getLineBreakHint()) {
-				case HTMLElementDeclaration.BREAK_AFTER_START :
-					hint = HTMLCMProperties.Values.BREAK_AFTER_START;
-					break;
-				case HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END :
-					hint = HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END;
-					break;
-				case HTMLElementDeclaration.BREAK_NONE :
-				// nothing to do
-				default :
-					break;
-			}
-			return hint;
-		}
-	}
-
-	/*
-	 * "layoutType"
-	 */
-	class PPLayoutType extends AbstractElementPropertyProvider {
-		public PPLayoutType() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			String type = HTMLCMProperties.Values.LAYOUT_NONE;
-			switch (decl.getLayoutType()) {
-				case HTMLElementDeclaration.LAYOUT_BLOCK :
-					type = HTMLCMProperties.Values.LAYOUT_BLOCK;
-					break;
-				case HTMLElementDeclaration.LAYOUT_BREAK :
-					type = HTMLCMProperties.Values.LAYOUT_BREAK;
-					break;
-				case HTMLElementDeclaration.LAYOUT_HIDDEN :
-					type = HTMLCMProperties.Values.LAYOUT_HIDDEN;
-					break;
-				case HTMLElementDeclaration.LAYOUT_OBJECT :
-					type = HTMLCMProperties.Values.LAYOUT_OBJECT;
-					break;
-				case HTMLElementDeclaration.LAYOUT_WRAP :
-					type = HTMLCMProperties.Values.LAYOUT_WRAP;
-					break;
-				case HTMLElementDeclaration.LAYOUT_NONE :
-				// nothing to do.
-				default :
-					break;
-			}
-			return type;
-		}
-	}
-
-	/*
-	 * "omitType"
-	 */
-	class PPOmitType extends AbstractElementPropertyProvider {
-		public PPOmitType() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			String type = HTMLCMProperties.Values.OMIT_NONE;
-			switch (decl.getOmitType()) {
-				case HTMLElementDeclaration.OMIT_BOTH :
-					type = HTMLCMProperties.Values.OMIT_BOTH;
-					break;
-				case HTMLElementDeclaration.OMIT_END :
-					type = HTMLCMProperties.Values.OMIT_END;
-					break;
-				case HTMLElementDeclaration.OMIT_END_DEFAULT :
-					type = HTMLCMProperties.Values.OMIT_END_DEFAULT;
-					break;
-				case HTMLElementDeclaration.OMIT_END_MUST :
-					type = HTMLCMProperties.Values.OMIT_END_MUST;
-					break;
-				case HTMLElementDeclaration.OMIT_NONE :
-				// nothing to do.
-				default :
-					break;
-			}
-			return type;
-		}
-	}
-
-	/*
-	 * "inclusion"
-	 */
-	class PPInclusion extends AbstractElementPropertyProvider {
-		public PPInclusion() {
-			super();
-		}
-
-		protected Object getElementProperty(HTMLPropertyDeclaration decl) {
-			return decl.getInclusion();
-		}
-	}
-
-	public static PropertyProvider getProvider(String propName) {
-		PropertyProviderFactory factory = getInstance();
-		PropertyProvider pp = (PropertyProvider) factory.registry.get(propName);
-		if (pp != null)
-			return pp;
-
-		pp = factory.create(propName);
-		if (pp == null)
-			return factory.defaultProvider;
-
-		factory.registry.put(propName, pp);
-		return pp;
-	}
-
-	private static PropertyProviderFactory instance = null;
-
-	private synchronized static PropertyProviderFactory getInstance() {
-		if (instance != null)
-			return instance;
-		instance = new PropertyProviderFactory();
-		return instance;
-	}
-
-	private Hashtable registry = new Hashtable();
-	private PropertyProvider defaultProvider = new DefaultProvider();
-
-	private PropertyProviderFactory() {
-		super();
-	}
-
-	private PropertyProvider create(String propName) {
-		PropertyProvider pp = null;
-		if (propName.equals(HTMLCMProperties.IS_JSP))
-			pp = new PPIsJSP();
-		else if (propName.equals(HTMLCMProperties.IS_XHTML))
-			pp = new PPIsXHTML();
-		else if (propName.equals(HTMLCMProperties.IS_SSI))
-			pp = new PPIsSSI();
-		else if (propName.equals(HTMLCMProperties.LAYOUT_TYPE))
-			pp = new PPLayoutType();
-		else if (propName.equals(HTMLCMProperties.LINE_BREAK_HINT))
-			pp = new PPLineBreakHint();
-		else if (propName.equals(HTMLCMProperties.PROHIBITED_ANCESTORS))
-			pp = new PPProhibitedAncestors();
-		else if (propName.equals(HTMLCMProperties.SHOULD_KEEP_SPACE))
-			pp = new PPShouldKeepSpace();
-		else if (propName.equals(HTMLCMProperties.SHOULD_INDENT_CHILD_SOURCE))
-			pp = new PPShouldIndentChildSource();
-		else if (propName.equals(HTMLCMProperties.TERMINATORS))
-			pp = new PPTerminators();
-		else if (propName.equals(HTMLCMProperties.TAGINFO))
-			pp = new PPTagInfo();
-		else if (propName.equals(HTMLCMProperties.OMIT_TYPE))
-			pp = new PPOmitType();
-		else if (propName.equals(HTMLCMProperties.INCLUSION))
-			pp = new PPInclusion();
-
-		return pp;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ssi/SSICMDocumentFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ssi/SSICMDocumentFactory.java
deleted file mode 100644
index 949941f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ssi/SSICMDocumentFactory.java
+++ /dev/null
@@ -1,158 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.ssi;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-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.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- * CMDocument factory for SSI documents.
- */
-public final class SSICMDocumentFactory {
-
-	private final static String PREFIX = "SSI";//$NON-NLS-1$
-	private final static String DOC_TYPE_NAME = "SSI";//$NON-NLS-1$
-
-	static class CMNamespaceImpl implements CMNamespace {
-		public CMNamespaceImpl() {
-			super();
-		}
-
-		public String getPrefix() {
-			return PREFIX;
-		}
-
-		public String getURI() {
-			return ""; //$NON-NLS-1$
-		}
-
-		public String getNodeName() {
-			return DOC_TYPE_NAME;
-		}
-
-		public int getNodeType() {
-			return CMNode.NAME_SPACE;
-		}
-
-		public boolean supports(String propertyName) {
-			return false;
-		}
-
-		public Object getProperty(String propertyName) {
-			return null;
-		}
-
-	}
-
-	static class CMDocImpl implements CMDocument {
-		private static CMDocument hcm = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
-
-		static class Elements implements CMNamedNodeMap {
-			private static String[] names = {HTML40Namespace.ElementName.SSI_CONFIG, HTML40Namespace.ElementName.SSI_ECHO, HTML40Namespace.ElementName.SSI_EXEC, HTML40Namespace.ElementName.SSI_FSIZE, HTML40Namespace.ElementName.SSI_FLASTMOD, HTML40Namespace.ElementName.SSI_INCLUDE, HTML40Namespace.ElementName.SSI_PRINTENV, HTML40Namespace.ElementName.SSI_SET};
-			private Hashtable map = new Hashtable();
-
-			public Elements() {
-				CMNamedNodeMap elems = hcm.getElements();
-				for (int i = 0; i < names.length; i++) {
-					String name = names[i];
-					CMElementDeclaration dec = (CMElementDeclaration) elems.getNamedItem(name);
-					if (dec != null)
-						map.put(name, dec);
-				}
-			}
-
-			public int getLength() {
-				return map.size();
-			}
-
-			public CMNode getNamedItem(String name) {
-				String cooked = getCanonicalName(name);
-				if (!map.containsKey(cooked))
-					return null;
-				return (CMNode) map.get(cooked);
-			}
-
-			public CMNode item(int index) {
-				Iterator iter = iterator();
-				while (iter.hasNext()) {
-					Object node = iter.next();
-					if (--index < 0)
-						return (CMNode) node;
-				}
-				return null;
-			}
-
-			public Iterator iterator() {
-				return map.values().iterator();
-			}
-
-			private String getCanonicalName(String rawName) {
-				return rawName.toUpperCase();
-			}
-		}
-
-		static private Elements elements = new Elements();
-
-
-		public CMDocImpl() {
-			super();
-		}
-
-		public String getNodeName() {
-			return ""; //$NON-NLS-1$
-		}
-
-		public int getNodeType() {
-			return CMNode.DOCUMENT;
-		}
-
-		public CMNamedNodeMap getElements() {
-			return elements;
-		}
-
-		public CMNamedNodeMap getEntities() {
-			return null;
-		}
-
-		public CMNamespace getNamespace() {
-			return ssins;
-		}
-
-		public Object getProperty(String propertyName) {
-			return null;
-		}
-
-		public boolean supports(String propertyName) {
-			return false;
-		}
-	}
-
-	private static CMNamespace ssins = new CMNamespaceImpl();
-	private static CMDocument mycm = new CMDocImpl();
-
-	private SSICMDocumentFactory() {
-		super();
-	}
-
-	public static CMDocument getCMDocument() {
-		return mycm;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java
deleted file mode 100644
index 66b6bc2..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java
+++ /dev/null
@@ -1,261 +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.html.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;
-
-	/**
-	 * 
-	 */
-	private 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.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ByteReader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ByteReader.java
deleted file mode 100644
index bfca51a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ByteReader.java
+++ /dev/null
@@ -1,109 +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.html.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) {
-		this.fInputStream = inputStream;
-		if (!inputStream.markSupported()) {
-			throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
-		}
-		this.fBuffer = new byte[size];
-
-	}
-
-	public void close() throws IOException {
-		this.fInputStream.close();
-	}
-
-	public void mark(int readAheadLimit) {
-		this.fInputStream.mark(readAheadLimit);
-	}
-
-	public boolean markSupported() {
-		return true;
-	}
-
-	public int read() throws IOException {
-		int b0 = this.fInputStream.read();
-		return (b0 & 0x00FF);
-	}
-
-	public int read(char ch[], int offset, int length) throws IOException {
-		if (length > this.fBuffer.length) {
-			length = this.fBuffer.length;
-		}
-
-		int count = this.fInputStream.read(this.fBuffer, 0, length);
-
-		for (int i = 0; i < count; i++) {
-			int b0 = this.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 this.fInputStream.available() > 0;
-	}
-
-	public void reset() throws IOException {
-		this.fInputStream.reset();
-	}
-
-	public long skip(long n) throws IOException {
-		return this.fInputStream.skip(n);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ContentDescriberForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ContentDescriberForHTML.java
deleted file mode 100644
index 66897c2..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ContentDescriberForHTML.java
+++ /dev/null
@@ -1,225 +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
- *******************************************************************************/
-package org.eclipse.wst.html.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 ContentDescriberForHTML implements ITextContentDescriber {
-
-	final private static QualifiedName[] SUPPORTED_OPTIONS = {IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK, IContentDescriptionExtended.DETECTED_CHARSET, IContentDescriptionExtended.UNSUPPORTED_CHARSET, IContentDescriptionExtended.APPROPRIATE_DEFAULT};
-	private IResourceCharsetDetector resourceCharsetDetector;
-
-	public int describe(InputStream contents, IContentDescription description) throws IOException {
-		int result = IContentDescriber.INDETERMINATE;
-
-		if (description == null) {
-			result = computeValidity(contents);
-		}
-		else {
-			calculateSupportedOptions(contents, description);
-			// assummming we should return same 'validity' value we did
-			// when called before. (technically, could be a performance issue
-			// in future, so might want to check if any 'ol value would
-			// be ok here.
-			result = computeValidity(contents);
-		}
-
-		return result;
-	}
-
-	public int describe(Reader contents, IContentDescription description) throws IOException {
-		int result = IContentDescriber.INDETERMINATE;
-
-		if (description == null) {
-			result = computeValidity(contents);
-		}
-		else {
-			calculateSupportedOptions(contents, description);
-			// assummming we should return same 'validity' value we did
-			// when called before. (technically, could be a performance issue
-			// in future, so might want to check if hard coded 'valid' would
-			// be ok here.
-			result = computeValidity(contents);
-		}
-
-		return result;
-	}
-
-	public QualifiedName[] getSupportedOptions() {
-
-		return SUPPORTED_OPTIONS;
-	}
-
-	private void calculateSupportedOptions(InputStream contents, IContentDescription description) throws IOException {
-		if (isRelevent(description)) {
-			IResourceCharsetDetector detector = getDetector();
-			detector.set(contents);
-			handleCalculations(description, detector);
-		}
-	}
-
-	/**
-	 * @param contents
-	 * @param description
-	 * @throws IOException
-	 */
-	private void calculateSupportedOptions(Reader contents, IContentDescription description) throws IOException {
-		if (isRelevent(description)) {
-			IResourceCharsetDetector detector = getDetector();
-			detector.set(contents);
-			handleCalculations(description, detector);
-		}
-	}
-
-	private int computeValidity(InputStream inputStream) {
-		// currently no contents specific check for valid HTML contents
-		// (this may change once we add XHTML content type)
-		return IContentDescriber.INDETERMINATE;
-	}
-
-	private int computeValidity(Reader reader) {
-		// currently no contents specific check for valid HTML contents
-		// (this may change once we add XHTML content type)
-		return IContentDescriber.INDETERMINATE;
-	}
-
-	private IResourceCharsetDetector getDetector() {
-		if (resourceCharsetDetector == null) {
-			resourceCharsetDetector = new HTMLResourceEncodingDetector();
-		}
-		return resourceCharsetDetector;
-	}
-
-	/**
-	 * @param description
-	 * @param detector
-	 * @throws IOException
-	 */
-	private void handleCalculations(IContentDescription description, IResourceCharsetDetector detector) throws IOException {
-		// note: if we're asked for one, we set them all. I need to be sure if
-		// called
-		// mulitiple times (one for each, say) that we don't waste time
-		// processing same
-		// content again.
-		EncodingMemento encodingMemento = ((HTMLResourceEncodingDetector) detector).getEncodingMemento();
-		// 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 default.the
-				Object defaultCharset = getDetector().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, I'm assuming
-					description.setProperty(IContentDescription.CHARSET, javaCharset);
-				}
-			}
-		}
-
-		// avoid adding anything if not absolutly needed, since always
-		// "cached" per session
-		// description.setProperty(IContentDescriptionExtended.ENCODING_MEMENTO,
-		// encodingMemento);
-	}
-
-	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;
-		// else if
-		// (description.isRequested(IContentDescriptionExtended.ENCODING_MEMENTO))
-		// result = true;
-		return result;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java
deleted file mode 100644
index be7f3a0..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java
+++ /dev/null
@@ -1,173 +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.html.core.internal.contenttype;
-
-/**
- * 
- * This is ported from PageDesigner's hpbcom/Kanji.cpp's
- * Kanji::guess_kanji_code(),
- *  
- */
-public class EncodingGuesser {
-	private static final int ASCII = 0; // ASCII
-	// ISO-2022-JP
-	private static final int ASCII_IN = 8; // This is after ISO2022's change
-	// Shift-JIS
-	private static final int EUC_HALFKANA = 6; // This is Half Kana in EUC-JP
-	private static final int EUC_JP = 3; // This is EUC-JP
-	private static final int ISO2022_JP = 4; // This is ISO-2022-JP
-	private static final int JIS_HALFKANA = 7; // THis is Half Kana in
-	private static final byte KT_EUC1 = 0x40;
-	private static final byte KT_EUC2 = (byte) 0x80;
-	// ASCII
-	private static final byte KT_JIN = 0x01;
-	private static final byte KT_JOUT = 0x02;
-	//	private static final byte KT_ESC = 0x04;
-	//	private static final byte KT_JIS = 0x08;
-	private static final byte KT_SFT1 = 0x10;
-	private static final byte KT_SFT2 = 0x20;
-	private static final byte ktype[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00 */
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 10 */
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x09, 0x08, 0x08, 0x08, /* !"#$%&' *//* " */
-	0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* ()*+,-./ */
-	0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 01234567 */
-	0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 89:; <=>? */
-	0x29, 0x28, 0x2b, 0x28, 0x28, 0x28, 0x28, 0x28, /* @ABCDEFG */
-	0x2a, 0x28, 0x2a, 0x28, 0x28, 0x28, 0x28, 0x28, /* HIJKLMNO */
-	0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* PQRSTUVW */
-	0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* XYZ[\]^_ */
-	0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* abcdefg */
-	0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* hijklmno */
-	0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* pqrstuvw */
-	0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, /* xyz{|}~ */
-	0x20, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, /* 80 */
-	0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, /* 90 */
-	0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* A0 */
-	(byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* B0 */
-	(byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* C0 */
-	(byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* D0 */
-	(byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, /* E0 */
-	(byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, /* F0 */
-	(byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xc0, (byte) 0xc0, 0x00,};
-	//	private static final int ISO8859_1 = 1; // ISO-1
-	private static final int SHIFT_JIS = 2; // This is Shift-JIS
-	private static final int SJIS_HALFKANA = 5; // This is Half Kana in
-
-	/**
-	 * Currently, only Japanese encodings are supported.
-	 */
-	private static final int UNKNOWN = -1; // Unknown
-
-	/**
-	 * @return java.lang.String
-	 * @param code
-	 *            int
-	 * 
-	 * Convert private int to IANA Encoding name.
-	 */
-	private static String convertToIANAEncodingName(int code) {
-		String encoding = null;
-
-		switch (code) {
-			case SHIFT_JIS :
-			case SJIS_HALFKANA :
-				encoding = "Shift_JIS";//$NON-NLS-1$
-				break;
-			case EUC_JP :
-			case EUC_HALFKANA :
-				encoding = "EUC-JP";//$NON-NLS-1$
-				break;
-			case ISO2022_JP :
-			case JIS_HALFKANA :
-				encoding = "ISO-2022-JP";//$NON-NLS-1$
-			default :
-				break;
-		}
-
-		return encoding;
-	}
-
-	/**
-	 * Return guessed Java Encoding name target: bytes to be inspected length:
-	 * length of target
-	 */
-	public static String guessEncoding(byte[] target, int length) {
-		int code = UNKNOWN;
-
-		// Currently, only Japanese is supported.
-		String system_ctype = java.util.Locale.getDefault().getLanguage();
-		String jp_ctype = java.util.Locale.JAPANESE.getLanguage();
-		if (system_ctype.compareTo(jp_ctype) == 0) {
-			// Ok, I'm under ja_JP.
-			code = ASCII;
-			int pos = 0;
-			while ((code == ASCII) && (length > 0)) {
-				int ch1 = target[pos];
-				ch1 = ch1 & 0x000000FF;
-				int ch2 = (length >= 2) ? target[pos + 1] : 0;
-				ch2 = ch2 & 0x000000FF;
-				int ch3 = (length >= 3) ? target[pos + 2] : 0;
-				ch3 = ch3 & 0x000000FF;
-				code = guessJapaneseKanjiCode(ch1, ch2, ch3, 0);
-				pos++;
-				length--;
-			}
-			switch (code) {
-				case ISO2022_JP :
-				case JIS_HALFKANA :
-					code = ISO2022_JP;
-					break;
-				case EUC_JP :
-					code = EUC_JP;
-					break;
-				default :
-					code = SHIFT_JIS;
-			}
-		}
-		return (convertToIANAEncodingName(code));
-	}
-
-	/**
-	 * Guess the encoding. halfkana_flag = 0x01 ( detect SJIS half kana )
-	 * halfkana_flag = 0x02 ( detect EUC half kana )
-	 */
-	private static int guessJapaneseKanjiCode(int ch1, int ch2, int ch3, int halfkana_flag) {
-		boolean sjis_hankaku_flag = ((halfkana_flag & 0x01) != 0) ? true : false;
-		boolean euc_hankaku_flag = ((halfkana_flag & 0x02) != 0) ? true : false;
-
-		if (ch1 == 0)
-			return UNKNOWN;
-		if (sjis_hankaku_flag && ch1 >= 0xa1 && ch1 <= 0xdf)
-			return SJIS_HALFKANA;
-		else if (euc_hankaku_flag && ch1 == 0x8e && ch2 >= 0xa1 && ch2 <= 0xdf)
-			return EUC_HALFKANA;
-		else if (((ktype[ch1] & KT_SFT1) != 0) && ((ktype[ch2] & KT_SFT2) != 0))
-			return SHIFT_JIS;
-		else if (((ktype[ch1] & KT_EUC1) != 0) && ((ktype[ch2] & KT_EUC2) != 0))
-			return EUC_JP;
-		else if (ch1 == 0x1b && ((ktype[ch2] & KT_JIN) != 0))
-			return ISO2022_JP;
-		else if (ch1 >= 0xa1 && ch1 <= 0xdf)
-			return SJIS_HALFKANA;
-		else if (ch1 == 0x1b && ch2 == 0x28/* '(' */&& ch3 == 0x49/* 'I' */)
-			return JIS_HALFKANA;
-		else if (ch1 == 0x1b && ch2 == 0x28/* '(' */&& ((ktype[ch3] & KT_JOUT) != 0))
-			return ASCII_IN;
-
-		return ASCII;
-	}
-
-	public EncodingGuesser() {
-		super();
-	}
-}
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
deleted file mode 100644
index dc68f67..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java
+++ /dev/null
@@ -1,1690 +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
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 1/27/04 6:41 PM */
-
-/*nlsXXX*/  
-package org.eclipse.wst.html.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.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 1/27/04 6:41 PM from the specification file
- * <tt>file:/D:/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jflex</tt>
- */
-public class HTMLHeadTokenizer {
-
-	/** this character denotes the end of file */
-	final public static int YYEOF = -1;
-
-	/** lexical states */
-	final public static int ST_META_TAG = 4;
-	final public static int YYINITIAL = 0;
-	final public static int UnDelimitedString = 12;
-	final public static int DQ_STRING = 8;
-	final public static int SQ_STRING = 10;
-	final public static int ST_XMLDecl = 2;
-	final public static int QuotedAttributeValue = 6;
-
-	/**
-	 * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
-	 * YY_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 final static int YY_LEXSTATE[] = {0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7};
-
-	/** 
-	 * Translates characters to character classes
-	 */
-	final private static String yycmap_packed = "\11\0\1\6\1\7\2\0\1\11\22\0\1\22\1\0\1\40\2\0" + "\1\44\1\0\1\43\5\0\1\34\1\0\1\42\13\0\1\45\1\12" + "\1\10\1\31\1\13\1\0\1\21\1\0\1\24\1\26\1\17\1\0" + "\1\30\1\32\1\27\2\0\1\16\1\15\1\23\1\25\1\33\1\35" + "\2\0\1\20\1\36\1\37\1\0\1\14\1\41\7\0\1\21\1\0" + "\1\24\1\26\1\17\1\0\1\30\1\32\1\27\2\0\1\16\1\15" + "\1\23\1\25\1\33\1\35\2\0\1\20\1\36\1\37\1\0\1\14" + "\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
-	 */
-	final private static char[] yycmap = yy_unpack_cmap(yycmap_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", "Internal error: unknown state", "Error: could not match input", "Error: pushback value was too large"};
-
-	/** 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;
-
-
-	/** the number of characters up to the start of the matched text */
-	private int yychar;
-
-
-	/** 
-	 * 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 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;
-	boolean foundContentTypeValue = false;
-
-
-
-	public HTMLHeadTokenizer() {
-		super();
-	}
-
-	public void reset(Reader in) {
-		/* 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;
-
-
-		/* the number of characters up to the start of the matched text */
-		yychar = 0;
-
-
-		/** 
-		 * yy_atBOL == true <=> the scanner is currently at the beginning 
-		 * of a line
-		 */
-		yy_atBOL = false;
-
-		/* 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;
-
-
-		fStateStack.clear();
-
-		hasMore = true;
-
-		// its a little wasteful to "throw away" first char array generated
-		// by class init (via auto generated code), but we really do want
-		// a small buffer for our head parsers.
-		if (yy_buffer.length != MAX_TO_SCAN) {
-			yy_buffer = new char[MAX_TO_SCAN];
-		}
-
-
-	}
-
-
-	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 HTMLHeadTokenizer(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 HTMLHeadTokenizer(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[] 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 < 174) {
-			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.
-	 *
-	 * @param   errorCode  the code of the errormessage to display
-	 */
-	private void yy_ScanError(int errorCode) {
-		try {
-			System.out.println(YY_ERROR_MSG[errorCode]);
-		}
-		catch (ArrayIndexOutOfBoundsException e) {
-			System.out.println(YY_ERROR_MSG[YY_UNKNOWN_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()!
-	 */
-	private void yypushback(int number) {
-		if (number > yylength())
-			yy_ScanError(YY_PUSHBACK_2BIG);
-
-		yy_markedPos -= number;
-	}
-
-
-	/**
-	 * 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;
-			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   IOException  if any I/O-Error occurs
-	 */
-	public String primGetNextToken() throws java.io.IOException {
-		int yy_input;
-		int yy_action;
-
-
-		while (true) {
-
-			yychar += yylength();
-
-			yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos - 1] == '\n';
-			if (!yy_atBOL && yy_buffer[yy_markedPos - 1] == '\r') {
-				yy_atBOL = yy_advance() != '\n';
-				if (!yy_atEOF)
-					yy_currentPos--;
-			}
-
-			yy_action = -1;
-
-			yy_currentPos = yy_startRead = yy_markedPos;
-
-			if (yy_atBOL)
-				yy_state = YY_LEXSTATE[yy_lexical_state + 1];
-			else
-				yy_state = YY_LEXSTATE[yy_lexical_state];
-
-
-			yy_forAction : {
-				while (true) {
-
-					yy_input = yy_advance();
-
-					if (yy_input == YYEOF)
-						break yy_forAction;
-
-					yy_input = yycmap[yy_input];
-
-					boolean yy_isFinal = false;
-					boolean yy_noLookAhead = false;
-
-					yy_forNext : {
-						switch (yy_state) {
-							case 0 :
-								switch (yy_input) {
-									case 1 :
-										yy_isFinal = true;
-										yy_state = 9;
-										break yy_forNext;
-									case 2 :
-										yy_isFinal = true;
-										yy_state = 10;
-										break yy_forNext;
-									case 3 :
-										yy_isFinal = true;
-										yy_state = 11;
-										break yy_forNext;
-									case 10 :
-										yy_isFinal = true;
-										yy_state = 12;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
-
-							case 1 :
-								switch (yy_input) {
-									case 1 :
-										yy_isFinal = true;
-										yy_state = 9;
-										break yy_forNext;
-									case 2 :
-										yy_isFinal = true;
-										yy_state = 10;
-										break yy_forNext;
-									case 3 :
-										yy_isFinal = true;
-										yy_state = 11;
-										break yy_forNext;
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 13;
-										break yy_forNext;
-									case 10 :
-										yy_isFinal = true;
-										yy_state = 14;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
-
-							case 2 :
-								switch (yy_input) {
-									case 11 :
-										yy_isFinal = true;
-										yy_state = 15;
-										break yy_forNext;
-									case 15 :
-										yy_isFinal = true;
-										yy_state = 16;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
-
-							case 3 :
-								switch (yy_input) {
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 17;
-										break yy_forNext;
-									case 26 :
-										yy_isFinal = true;
-										yy_state = 18;
-										break yy_forNext;
-									case 34 :
-										yy_isFinal = true;
-										yy_state = 19;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
-
-							case 4 :
-								switch (yy_input) {
-									case 6 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 21;
-										break yy_forNext;
-									case 7 :
-										yy_isFinal = true;
-										yy_state = 22;
-										break yy_forNext;
-									case 32 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 23;
-										break yy_forNext;
-									case 35 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 24;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 20;
-										break yy_forNext;
-								}
-
-							case 5 :
-								switch (yy_input) {
-									case 7 :
-									case 9 :
-									case 10 :
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 26;
-										break yy_forNext;
-									case 11 :
-									case 34 :
-										yy_isFinal = true;
-										yy_state = 27;
-										break yy_forNext;
-									case 32 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 28;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 25;
-										break yy_forNext;
-								}
-
-							case 6 :
-								switch (yy_input) {
-									case 7 :
-									case 9 :
-									case 10 :
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 26;
-										break yy_forNext;
-									case 34 :
-										yy_isFinal = true;
-										yy_state = 27;
-										break yy_forNext;
-									case 35 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 28;
-										break yy_forNext;
-									case 36 :
-										yy_isFinal = true;
-										yy_state = 29;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 25;
-										break yy_forNext;
-								}
-
-							case 7 :
-								switch (yy_input) {
-									case 10 :
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 26;
-										break yy_forNext;
-									case 34 :
-										yy_isFinal = true;
-										yy_state = 27;
-										break yy_forNext;
-									case 11 :
-										yy_isFinal = true;
-										yy_state = 29;
-										break yy_forNext;
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 30;
-										break yy_forNext;
-									case 32 :
-									case 35 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 31;
-										break yy_forNext;
-									case 37 :
-										yy_isFinal = true;
-										yy_state = 32;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 25;
-										break yy_forNext;
-								}
-
-							case 9 :
-								switch (yy_input) {
-									case 2 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 33;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 10 :
-								switch (yy_input) {
-									case 1 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 34;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 11 :
-								switch (yy_input) {
-									case 4 :
-										yy_state = 35;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 12 :
-								switch (yy_input) {
-									case 13 :
-										yy_state = 36;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 13 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 37;
-										break yy_forNext;
-									case 10 :
-										yy_state = 38;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 14 :
-								switch (yy_input) {
-									case 13 :
-										yy_state = 36;
-										break yy_forNext;
-									case 11 :
-										yy_state = 39;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 15 :
-								switch (yy_input) {
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 40;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 16 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 41;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 18 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 42;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 19 :
-								switch (yy_input) {
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 43;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 21 :
-								switch (yy_input) {
-									case 6 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 21;
-										break yy_forNext;
-									case 7 :
-										yy_state = 44;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 20;
-										break yy_forNext;
-								}
-
-							case 22 :
-								switch (yy_input) {
-									case 6 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 21;
-										break yy_forNext;
-									case 7 :
-										yy_state = 44;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 20;
-										break yy_forNext;
-								}
-
-							case 27 :
-								switch (yy_input) {
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 45;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 29 :
-								switch (yy_input) {
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 46;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 32 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 32;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 35 :
-								switch (yy_input) {
-									case 5 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 47;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 36 :
-								switch (yy_input) {
-									case 15 :
-										yy_state = 48;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 37 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 37;
-										break yy_forNext;
-									case 10 :
-										yy_state = 38;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 38 :
-								switch (yy_input) {
-									case 11 :
-										yy_state = 39;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 39 :
-								switch (yy_input) {
-									case 12 :
-										yy_state = 49;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 41 :
-								switch (yy_input) {
-									case 20 :
-										yy_state = 50;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 42 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 51;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 44 :
-								switch (yy_input) {
-									case 6 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 21;
-										break yy_forNext;
-									case 7 :
-										yy_state = 44;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 20;
-										break yy_forNext;
-								}
-
-							case 48 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 52;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 49 :
-								switch (yy_input) {
-									case 13 :
-										yy_state = 53;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 50 :
-								switch (yy_input) {
-									case 21 :
-										yy_state = 54;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 51 :
-								switch (yy_input) {
-									case 27 :
-										yy_state = 55;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 52 :
-								switch (yy_input) {
-									case 17 :
-										yy_state = 56;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 53 :
-								switch (yy_input) {
-									case 14 :
-										yy_state = 57;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 54 :
-								switch (yy_input) {
-									case 22 :
-										yy_state = 58;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 55 :
-								switch (yy_input) {
-									case 28 :
-										yy_state = 59;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 56 :
-								switch (yy_input) {
-									case 18 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 60;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 57 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 61;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 58 :
-								switch (yy_input) {
-									case 23 :
-										yy_state = 62;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 59 :
-								switch (yy_input) {
-									case 15 :
-										yy_state = 63;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 61 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 61;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 62 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 64;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 63 :
-								switch (yy_input) {
-									case 29 :
-										yy_state = 65;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 64 :
-								switch (yy_input) {
-									case 24 :
-										yy_state = 66;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 65 :
-								switch (yy_input) {
-									case 30 :
-										yy_state = 67;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 66 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 66;
-										break yy_forNext;
-									case 8 :
-										yy_isFinal = true;
-										yy_state = 68;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 67 :
-								switch (yy_input) {
-									case 23 :
-										yy_state = 69;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 68 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 68;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 69 :
-								switch (yy_input) {
-									case 31 :
-										yy_state = 70;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 70 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 70;
-										break yy_forNext;
-									case 8 :
-										yy_state = 71;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 71 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 71;
-										break yy_forNext;
-									case 20 :
-										yy_state = 72;
-										break yy_forNext;
-									case 32 :
-										yy_state = 73;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 72 :
-								switch (yy_input) {
-									case 21 :
-										yy_state = 74;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 73 :
-								switch (yy_input) {
-									case 20 :
-										yy_state = 72;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 74 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 75;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 75 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 76;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 76 :
-								switch (yy_input) {
-									case 15 :
-										yy_state = 77;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 77 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 78;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 78 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 79;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 79 :
-								switch (yy_input) {
-									case 28 :
-										yy_state = 80;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 80 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 81;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 81 :
-								switch (yy_input) {
-									case 33 :
-										yy_state = 82;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 82 :
-								switch (yy_input) {
-									case 27 :
-										yy_state = 83;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 83 :
-								switch (yy_input) {
-									case 15 :
-										yy_state = 84;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 84 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 85;
-										break yy_forNext;
-									case 32 :
-										yy_state = 86;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 85 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 85;
-										break yy_forNext;
-									case 20 :
-										yy_state = 87;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 86 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 85;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 87 :
-								switch (yy_input) {
-									case 21 :
-										yy_state = 88;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 88 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 89;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 89 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 90;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 90 :
-								switch (yy_input) {
-									case 15 :
-										yy_state = 91;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 91 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 92;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 92 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 93;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 93 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 93;
-										break yy_forNext;
-									case 8 :
-										yy_isFinal = true;
-										yy_state = 94;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							case 94 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 94;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
-
-							default :
-								yy_ScanError(YY_ILLEGAL_STATE);
-								break;
-						}
-					}
-
-					if (yy_isFinal) {
-						yy_action = yy_state;
-						yy_markedPos = yy_currentPos;
-						if (yy_noLookAhead)
-							break yy_forAction;
-					}
-
-				}
-			}
-
-
-			switch (yy_action) {
-
-				case 26 :
-					{
-						yypushback(1);
-						popState();
-						valueText = string.toString();
-						return EncodingParserConstants.InvalidTerminatedStringValue;
-					}
-				case 96 :
-					break;
-				case 20 :
-				case 21 :
-					{
-						yypushback(1);
-						yybegin(UnDelimitedString);
-						string.setLength(0);
-					}
-				case 97 :
-					break;
-				case 17 :
-					{
-						yybegin(YYINITIAL);
-						if (foundContentTypeValue)
-							hasMore = false;
-						return HTMLHeadTokenizerConstants.MetaTagEnd;
-					}
-				case 98 :
-					break;
-				case 31 :
-					{
-						yypushback(1);
-						popState();
-						valueText = string.toString();
-						return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;
-					}
-				case 99 :
-					break;
-				case 43 :
-					{
-						yybegin(YYINITIAL);
-						if (foundContentTypeValue)
-							hasMore = false;
-						return HTMLHeadTokenizerConstants.MetaTagEnd;
-					}
-				case 100 :
-					break;
-				case 45 :
-					{
-						yypushback(2);
-						popState();
-						valueText = string.toString();
-						return EncodingParserConstants.InvalidTerminatedStringValue;
-					}
-				case 101 :
-					break;
-				case 46 :
-					{
-						yypushback(2);
-						popState();
-						valueText = string.toString();
-						return EncodingParserConstants.InvalidTerminatedStringValue;
-					}
-				case 102 :
-					break;
-				case 61 :
-					{
-						if (yychar == 0) {
-							yybegin(ST_XMLDecl);
-							return XMLHeadTokenizerConstants.XMLDeclStart;
-						}
-					}
-				case 103 :
-					break;
-				case 8 :
-				case 9 :
-				case 10 :
-				case 11 :
-				case 12 :
-				case 13 :
-				case 14 :
-				case 15 :
-				case 16 :
-				case 18 :
-				case 19 :
-				case 22 :
-					{
-						if (yychar > MAX_TO_SCAN) {
-							hasMore = false;
-							return EncodingParserConstants.MAX_CHARS_REACHED;
-						}
-					}
-				case 104 :
-					break;
-				case 60 :
-					{
-						yybegin(ST_META_TAG);
-						return HTMLHeadTokenizerConstants.MetaTagStart;
-					}
-				case 105 :
-					break;
-				case 40 :
-					{
-						yybegin(YYINITIAL);
-						return XMLHeadTokenizerConstants.XMLDeclEnd;
-					}
-				case 106 :
-					break;
-				case 94 :
-					{
-						pushCurrentState();
-						yybegin(QuotedAttributeValue);
-						foundContentTypeValue = true;
-						return HTMLHeadTokenizerConstants.MetaTagContentType;
-					}
-				case 107 :
-					break;
-				case 68 :
-					{
-						pushCurrentState();
-						yybegin(QuotedAttributeValue);
-						return XMLHeadTokenizerConstants.XMLDelEncoding;
-					}
-				case 108 :
-					break;
-				case 33 :
-					{
-						hasMore = false;
-						return EncodingParserConstants.UTF16BE;
-					}
-				case 109 :
-					break;
-				case 34 :
-					{
-						hasMore = false;
-						return EncodingParserConstants.UTF16LE;
-					}
-				case 110 :
-					break;
-				case 47 :
-					{
-						hasMore = false;
-						return EncodingParserConstants.UTF83ByteBOM;
-					}
-				case 111 :
-					break;
-				case 28 :
-					{
-						popState();
-						valueText = string.toString();
-						return EncodingParserConstants.StringValue;
-					}
-				case 112 :
-					break;
-				case 25 :
-				case 27 :
-				case 29 :
-				case 32 :
-					{
-						string.append(yytext());
-					}
-				case 113 :
-					break;
-				case 24 :
-					{
-						yybegin(SQ_STRING);
-						string.setLength(0);
-					}
-				case 114 :
-					break;
-				case 23 :
-					{
-						yybegin(DQ_STRING);
-						string.setLength(0);
-					}
-				case 115 :
-					break;
-				case 30 :
-					{
-						yypushback(1);
-						popState();
-						valueText = string.toString();
-						return EncodingParserConstants.UnDelimitedStringValue;
-					}
-				case 116 :
-					break;
-				default :
-					if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
-						yy_atEOF = true;
-						yy_do_eof();
-						{
-							hasMore = false;
-							return EncodingParserConstants.EOF;
-						}
-					}
-					else {
-						yy_ScanError(YY_NO_MATCH);
-					}
-			}
-		}
-	}
-
-	/**
-	 * Runs the scanner on input files.
-	 *
-	 * This main method is the debugging routine for the scanner.
-	 * It prints each returned token to System.out until the end of
-	 * file is reached, or an error occured.
-	 *
-	 * @param argv   the command line, contains the filenames to run
-	 *               the scanner on.
-	 */
-	public static void main(String argv[]) {
-		for (int i = 0; i < argv.length; i++) {
-			HTMLHeadTokenizer scanner = null;
-			try {
-				scanner = new HTMLHeadTokenizer(new java.io.FileReader(argv[i]));
-			}
-			catch (java.io.FileNotFoundException e) {
-				System.out.println("File not found : \"" + argv[i] + "\"");
-				System.exit(1);
-			}
-			catch (ArrayIndexOutOfBoundsException e) {
-				System.out.println("Usage : java HTMLHeadTokenizer <inputfile>");
-				System.exit(1);
-			}
-
-			try {
-				do {
-					System.out.println(scanner.primGetNextToken());
-				}
-				while (!scanner.yy_atEOF);
-
-			}
-			catch (java.io.IOException e) {
-				System.out.println("An I/O error occured while scanning :");
-				System.out.println(e);
-				System.exit(1);
-			}
-			catch (Exception e) {
-				e.printStackTrace();
-				System.exit(1);
-			}
-		}
-	}
-
-
-}
\ No newline at end of file
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
deleted file mode 100644
index 938bcde..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java
+++ /dev/null
@@ -1,20 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-
-public interface HTMLHeadTokenizerConstants {
-
-	String MetaTagEnd = "MetaTagEnd"; //$NON-NLS-1$
-	String MetaTagStart = "MetaTagStart"; //$NON-NLS-1$
-	String MetaTagContentType = "MetaTagContentType"; //$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
deleted file mode 100644
index bff2219..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java
+++ /dev/null
@@ -1,187 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-import java.io.IOException;
-import java.util.regex.Pattern;
-
-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;
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-
-public class HTMLResourceEncodingDetector extends AbstractResourceEncodingDetector implements IResourceCharsetDetector {
-
-	private HTMLHeadTokenizer fTokenizer;
-
-	/**
-	 * There is no spec defined encoding for HTML (historically), so null is
-	 * returned.
-	 */
-	public String getSpecDefaultEncoding() {
-		return null;
-	}
-
-	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) {
-			canHandleAsUnicodeStream = true;
-			String enc = "UTF-16BE"; //$NON-NLS-1$
-			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
-		}
-		else if (tokenType == EncodingParserConstants.UTF16LE) {
-			canHandleAsUnicodeStream = true;
-			String enc = "UTF-16"; //$NON-NLS-1$
-			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
-		}
-		return canHandleAsUnicodeStream;
-	}
-
-	/**
-	 * @return Returns the tokenizer.
-	 */
-	private HTMLHeadTokenizer getTokenizer() {
-		// TODO: need to work on 'reset' in tokenizer, so new instance isn't
-		// always needed
-		//if (fTokenizer == null) {
-		fTokenizer = new HTMLHeadTokenizer();
-		//		}
-		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 {
-		checkInContent();
-		if (fEncodingMemento == null) {
-			checkHeuristics();
-		}
-	}
-
-	/**
-	 *  
-	 */
-	private void checkHeuristics() throws IOException {
-		boolean noHeuristic = false;
-		String heuristicEncoding = null;
-		try {
-			fReader.reset();
-			fReader.mark(CodedIO.MAX_MARK_SIZE);
-			byte[] bytes = new byte[CodedIO.MAX_MARK_SIZE];
-			int nRead = 0;
-			for (int i = 0; i < bytes.length; i++) {
-				if (fReader.ready()) {
-					int oneByte = fReader.read();
-					nRead++;
-					if (oneByte <= 0xFF) {
-						bytes[i] = (byte) oneByte;
-					}
-					else {
-						noHeuristic = true;
-						break;
-					}
-				}
-				else {
-					break;
-				}
-			}
-			if (!noHeuristic) {
-				heuristicEncoding = EncodingGuesser.guessEncoding(bytes, nRead);
-			}
-		}
-		catch (IOException e) {
-			// if any IO exception, then not a heuristic case
-		}
-		finally {
-			fReader.reset();
-		}
-		if (heuristicEncoding != null) {
-			createEncodingMemento(heuristicEncoding, EncodingMemento.GUESSED_ENCODING_FROM_STREAM);
-		}
-
-	}
-
-	private void checkInContent() throws IOException {
-		HTMLHeadTokenizer tokenizer = getTokenizer();
-		tokenizer.reset(fReader);
-		HeadParserToken token = null;
-		String tokenType = null;
-		String contentTypeValue = null;
-		do {
-			token = tokenizer.getNextToken();
-			tokenType = token.getType();
-			if (canHandleAsUnicodeStream(tokenType)) {
-				// side effect of canHandle is to create appropriate
-				// memento
-			}
-			else if (tokenType == HTMLHeadTokenizerConstants.MetaTagContentType) {
-				if (tokenizer.hasMoreTokens()) {
-					HeadParserToken valueToken = tokenizer.getNextToken();
-					String valueTokenType = valueToken.getType();
-					if (isLegalString(valueTokenType)) {
-						contentTypeValue = valueToken.getText();
-
-					}
-				}
-			}
-
-		}
-		while (tokenizer.hasMoreTokens());
-		if (contentTypeValue != null) {
-			parseContentTypeValue(contentTypeValue);
-		}
-	}
-
-	private void parseContentTypeValue(String contentType) {
-		String charset = null;
-		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()) {
-							charset = parts[0].substring(eqpos);
-							charset = charset.trim();
-						}
-					}
-				}
-			}
-			else {
-				//fContentType = parts[0];
-			}
-		}
-		if (parts.length > 1) {
-			charset = parts[1];
-		}
-		
-		if (charset != null && charset.length() > 0) {
-			createEncodingMemento(charset, EncodingMemento.FOUND_ENCODING_IN_CONTENT);
-		}
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HeadParserToken.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HeadParserToken.java
deleted file mode 100644
index ffd0406..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/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.html.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.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
deleted file mode 100644
index 5006745..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/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.html.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.html.core/src/org/eclipse/wst/html/core/internal/contenttype/NullMemento.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/NullMemento.java
deleted file mode 100644
index 5e22af0..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/NullMemento.java
+++ /dev/null
@@ -1,37 +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.html.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.html.core/src/org/eclipse/wst/html/core/internal/document/DOMStyleModelImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DOMStyleModelImpl.java
deleted file mode 100644
index 7dbc200..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DOMStyleModelImpl.java
+++ /dev/null
@@ -1,67 +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
- *******************************************************************************/
-/*
- * Created on Sep 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.html.core.internal.document;
-
-import org.eclipse.wst.xml.core.internal.document.DOMModelImpl;
-import org.w3c.dom.Document;
-
-/**
- * @author davidw
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class DOMStyleModelImpl extends DOMModelImpl {
-	public DOMStyleModelImpl() {
-		// remember, the document is created in super constructor, 
-		// via internalCreateDocument
-		super();
-	}
-
-	public void releaseFromEdit() {
-		releaseStyleSheets();
-		super.releaseFromEdit();
-	}
-
-	/**
-	 */
-	public void releaseFromRead() {
-		releaseStyleSheets();
-		super.releaseFromRead();
-	}
-
-	private void releaseStyleSheets() {
-		if (!isShared()) {
-			Document doc = getDocument();
-			if (doc instanceof DocumentStyleImpl) {
-				((DocumentStyleImpl) doc).releaseStyleSheets();
-			}
-		}
-	}
-
-	/**
-	 * createDocument method
-	 * @return org.w3c.dom.Document
-	 */
-	protected Document internalCreateDocument() {
-		DocumentStyleImpl document = new DocumentStyleImpl();
-		document.setModel(this);
-		return document;
-	}
-
-
-}
\ No newline at end of file
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
deleted file mode 100644
index ff46210..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java
+++ /dev/null
@@ -1,96 +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
- *******************************************************************************/
-/*
- * Created on Sep 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.html.core.internal.document;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.DocumentCSS;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- * @author davidw
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class DocumentStyleImpl extends DocumentImpl implements IDOMDocument, DocumentCSS {
-	public DocumentStyleImpl() {
-		super();
-	}
-
-	protected DocumentStyleImpl(DocumentImpl that) {
-		super(that);
-	}
-
-	public CSSStyleDeclaration getOverrideStyle(Element element, String pseudoName) {
-		INodeAdapter adapter = getAdapterFor(IStyleSheetListAdapter.class);
-		if (adapter == null)
-			return null;
-		return ((IStyleSheetListAdapter) adapter).getOverrideStyle(element, pseudoName);
-	}
-
-	public StyleSheetList getStyleSheets() {
-		INodeAdapter adapter = getAdapterFor(IStyleSheetListAdapter.class);
-		if (adapter == null)
-			return null;
-		return ((IStyleSheetListAdapter) adapter).getStyleSheets();
-	}
-
-	protected void releaseStyleSheets() {
-		INodeAdapter adapter = getExistingAdapter(IStyleSheetListAdapter.class);
-		if (adapter == null)
-			return;
-		((IStyleSheetListAdapter) adapter).releaseStyleSheets();
-	}
-
-	/**
-	 * createElement method
-	 * @return org.w3c.dom.Element
-	 * @param tagName java.lang.String
-	 */
-	public Element createElement(String tagName) throws DOMException {
-		checkTagNameValidity(tagName);
-
-		ElementStyleImpl element = new ElementStyleImpl();
-		element.setOwnerDocument(this);
-		element.setTagName(tagName);
-		return element;
-	}
-
-	/**
-	 * cloneNode method
-	 * @return org.w3c.dom.Node
-	 * @param deep boolean
-	 */
-	public Node cloneNode(boolean deep) {
-		DocumentStyleImpl cloned = new DocumentStyleImpl(this);
-		if (deep)
-			cloned.importChildNodes(this, true);
-		return cloned;
-	}
-
-	protected void setModel(IDOMModel model) {
-		super.setModel(model);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/ElementStyleImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/ElementStyleImpl.java
deleted file mode 100644
index 943218b..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/ElementStyleImpl.java
+++ /dev/null
@@ -1,73 +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
- *******************************************************************************/
-/*
- * Created on Sep 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.html.core.internal.document;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.ElementCSSInlineStyle;
-import org.w3c.dom.stylesheets.LinkStyle;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-public class ElementStyleImpl extends ElementImpl implements IDOMElement, ElementCSSInlineStyle, LinkStyle {
-	public ElementStyleImpl() {
-		super();
-	}
-
-	public ElementStyleImpl(ElementImpl that) {
-		super(that);
-	}
-
-	public StyleSheet getSheet() {
-		INodeAdapter adapter = getAdapterFor(IStyleSheetAdapter.class);
-		if (adapter == null)
-			return null;
-		if (!(adapter instanceof IStyleSheetAdapter))
-			return null;
-		return ((IStyleSheetAdapter) adapter).getSheet();
-	}
-
-	public CSSStyleDeclaration getStyle() {
-		INodeAdapter adapter = getAdapterFor(IStyleDeclarationAdapter.class);
-		if (adapter == null)
-			return null;
-		if (!(adapter instanceof IStyleDeclarationAdapter))
-			return null;
-		return ((IStyleDeclarationAdapter) adapter).getStyle();
-	}
-
-	protected void setOwnerDocument(Document ownerDocument) {
-		super.setOwnerDocument(ownerDocument);
-	}
-
-	protected void setTagName(String tagName) {
-		super.setTagName(tagName);
-	}
-
-	public Node cloneNode(boolean deep) {
-		ElementImpl cloned = new ElementStyleImpl(this);
-		if (deep)
-			cloneChildNodes(cloned, deep);
-		return cloned;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java
deleted file mode 100644
index 4207f6f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java
+++ /dev/null
@@ -1,302 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.html.core.internal.cleanup.HTMLCleanupProcessorImpl;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
-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.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-/**
- */
-public class HTMLConverter {
-
-	/**
-	 */
-	public HTMLConverter() {
-		super();
-
-	}
-
-	public void cleanupModel(IDOMModel model) {
-		if (model == null)
-			return;
-
-		HTMLCleanupProcessorImpl processor = new HTMLCleanupProcessorImpl();
-		IStructuredCleanupPreferences pref = processor.getCleanupPreferences();
-
-		// backup options
-		boolean compressEmptyElementTags = pref.getCompressEmptyElementTags();
-		boolean insertRequiredAttrs = pref.getInsertRequiredAttrs();
-		boolean insertMissingTags = pref.getInsertMissingTags();
-		boolean quoteAttrValues = pref.getQuoteAttrValues();
-		boolean formatSource = pref.getFormatSource();
-		int tagNameCase = pref.getTagNameCase();
-		int attrNameCase = pref.getAttrNameCase();
-
-		// setup options
-		pref.setCompressEmptyElementTags(true);
-		pref.setInsertRequiredAttrs(true);
-		pref.setInsertMissingTags(true);
-		pref.setQuoteAttrValues(true);
-		pref.setFormatSource(false);
-		if (model.getDocument().isXMLType()) { // XHTML
-			pref.setTagNameCase(HTMLCorePreferenceNames.LOWER);
-			pref.setAttrNameCase(HTMLCorePreferenceNames.LOWER);
-		}
-		else {
-			pref.setTagNameCase(HTMLCorePreferenceNames.ASIS);
-			pref.setAttrNameCase(HTMLCorePreferenceNames.ASIS);
-		}
-
-		processor.cleanupModel(model);
-
-		// set back options
-		pref.setCompressEmptyElementTags(compressEmptyElementTags);
-		pref.setInsertRequiredAttrs(insertRequiredAttrs);
-		pref.setInsertMissingTags(insertMissingTags);
-		pref.setQuoteAttrValues(quoteAttrValues);
-		pref.setFormatSource(formatSource);
-		pref.setTagNameCase(tagNameCase);
-		pref.setAttrNameCase(attrNameCase);
-	}
-
-	/**
-	 * declaratoin: "data" for XML declaration, such as "version=\"1.0\""
-	 * publicId: publicId for DOCTYPE declaration
-	 */
-	public void convert(IDOMModel model, String declaration, String publicId) {
-		if (model == null)
-			return;
-		setDeclaration(model, declaration, publicId);
-		cleanupModel(model);
-	}
-
-	/**
-	 * declaratoin: "data" for XML declaration, such as "version=\"1.0\""
-	 * publicId: publicId for DOCTYPE declaration
-	 */
-	public void convert(InputStream input, OutputStream output, String declaration, String publicId) throws UnsupportedEncodingException, IOException, CoreException {
-		IDOMModel model = readModel(input);
-		if (model == null)
-			return;
-		try {
-			convert(model, declaration, publicId);
-			writeModel(model, output);
-		}
-		finally {
-			if (model != null)
-				model.releaseFromEdit();
-		}
-	}
-
-	/**
-	 * declaratoin: "data" for XML declaration, such as "version=\"1.0\""
-	 * publicId: publicId for DOCTYPE declaration
-	 */
-	public void convert(IFile file, String declaration, String publicId) throws IOException, CoreException {
-		IDOMModel model = readModel(file);
-		if (model == null)
-			return;
-		try {
-			convert(model, declaration, publicId);
-			writeModel(model, file);
-		}
-		finally {
-			if (model != null)
-				model.releaseFromEdit();
-		}
-	}
-
-	/**
-	 */
-	private static void insertBreak(IDOMModel model, Node node) {
-		if (model == null || node == null)
-			return;
-		if (node.getNodeType() == Node.TEXT_NODE)
-			return;
-
-		// get delimiter string
-		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
-			return;
-		String delim = structuredDocument.getLineDelimiter();
-		if (delim == null || delim.length() == 0)
-			return;
-
-		Node parent = node.getParentNode();
-		if (parent == null)
-			return;
-		Document document = node.getOwnerDocument();
-		if (document == null)
-			return;
-		Text text = document.createTextNode(delim);
-		parent.insertBefore(text, node);
-	}
-
-	/**
-	 */
-	private IDOMModel readModel(InputStream input) throws IOException, UnsupportedEncodingException {
-		if (input == null)
-			return null;
-		// create temporary model
-		String id = input.toString() + ".html"; //$NON-NLS-1$
-		IModelManager manager = StructuredModelManager.getModelManager();
-		IStructuredModel model = manager.getModelForEdit(id, input, null);
-		if (!(model instanceof IDOMModel)) {
-			if (model == null)
-				model.releaseFromEdit();
-			return null;
-		}
-		return (IDOMModel) model;
-	}
-
-	/**
-	 */
-	private IDOMModel readModel(IFile file) throws IOException, CoreException {
-		if (file == null)
-			return null;
-		IModelManager manager = StructuredModelManager.getModelManager();
-		IStructuredModel model = manager.getModelForEdit(file);
-		if (!(model instanceof IDOMModel)) {
-			if (model != null)
-				model.releaseFromEdit();
-			return null;
-		}
-		return (IDOMModel) model;
-	}
-
-	/**
-	 */
-	public void setDeclaration(IDOMModel model, String declaration, String publicId) {
-		if (model == null)
-			return;
-		IDOMDocument document = model.getDocument();
-		if (document == null)
-			return;
-
-		try {
-			model.aboutToChangeModel();
-
-			ProcessingInstruction pi = null;
-			Node child = document.getFirstChild();
-			if (child != null && child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
-				String target = child.getNodeName();
-				if (target != null && target.equals("xml")) { //$NON-NLS-1$
-					pi = (ProcessingInstruction) child;
-					child = child.getNextSibling();
-				}
-			}
-			IDOMDocumentType docType = (IDOMDocumentType) document.getDoctype();
-
-			if (declaration != null) {
-				if (pi != null) {
-					pi.setData(declaration);
-				}
-				else {
-					pi = document.createProcessingInstruction("xml", declaration); //$NON-NLS-1$
-					document.insertBefore(pi, child);
-					insertBreak(model, child);
-				}
-			}
-
-			if (publicId != null) {
-				HTMLDocumentTypeEntry entry = HTMLDocumentTypeRegistry.getInstance().getEntry(publicId);
-				String name = (entry != null ? entry.getName() : null);
-				if (name == null || name.length() == 0)
-					name = "HTML"; // default //$NON-NLS-1$
-				if (docType != null) {
-					if (!name.equals(docType.getName())) { // replace
-						Node parent = docType.getParentNode();
-						child = docType;
-						docType = (IDOMDocumentType) document.createDoctype(name);
-						parent.insertBefore(docType, child);
-						parent.removeChild(child);
-					}
-				}
-				else {
-					docType = (IDOMDocumentType) document.createDoctype(name);
-					document.insertBefore(docType, child);
-					insertBreak(model, child);
-				}
-				docType.setPublicId(publicId);
-				if (entry != null) {
-					String systemId = entry.getSystemId();
-					if (systemId != null)
-						docType.setSystemId(systemId);
-					String namespaceURI = entry.getNamespaceURI();
-					if (namespaceURI != null) {
-						Element element = document.getDocumentElement();
-						if (element != null) {
-							element.setAttribute("xmlns", namespaceURI); //$NON-NLS-1$
-						}
-					}
-				}
-			}
-		}
-		finally {
-			model.changedModel();
-		}
-	}
-
-	/**
-	 */
-	private void writeModel(IDOMModel model, OutputStream output) throws UnsupportedEncodingException, IOException, CoreException {
-		if (model == null || output == null)
-			return;
-		model.save();
-	}
-
-	/**
-	 */
-	private void writeModel(IDOMModel model, IFile file) throws IOException, CoreException {
-		if (model == null || file == null)
-			return;
-		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
-			return;
-		//ByteArrayOutputStream output = null;
-		ByteArrayInputStream input = null;
-		try {
-			//output = new
-			// ByteArrayOutputStream(structuredDocument.getLength());
-			model.save();
-			//input = new ByteArrayInputStream(output.toByteArray());
-			//file.setContents(input, true, true, null);
-		}
-		finally {
-			//			if (output != null)
-			//				output.close();
-			if (input != null)
-				input.close();
-		}
-
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 4241bbc..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
+++ /dev/null
@@ -1,303 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-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.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.internal.contentproperties.ContentSettings;
-import org.eclipse.wst.sse.internal.contentproperties.ContentSettingsChangeSubject;
-import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
-import org.eclipse.wst.sse.internal.contentproperties.IContentSettingsListener;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapterImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Node;
-
-/**
- */
-public class HTMLDocumentTypeAdapter extends DocumentTypeAdapterImpl implements IContentSettingsListener, HTMLDocumentTypeConstants {
-
-	private HTMLDocumentTypeAdapterFactory fFactory = null;
-	private HTMLDocumentTypeEntry entry = null;
-	private boolean isXMLType = false;
-	private final static String XML = "xml"; //$NON-NLS-1$
-	private final static String XHTML = "xhtml"; //$NON-NLS-1$
-	private final static String WML = "wml"; //$NON-NLS-1$
-
-
-	/**
-	 */
-	protected HTMLDocumentTypeAdapter() {
-		super();
-	}
-
-	/**
-	 */
-	protected HTMLDocumentTypeAdapter(IDOMDocument document, HTMLDocumentTypeAdapterFactory factory) {
-		super(document);
-
-		this.fFactory = factory;
-
-		// initialize
-		documentTypeChanged();
-
-		ContentSettingsChangeSubject.getSubject().addListener(this);
-	}
-
-	/**
-	 */
-	public void contentSettingsChanged(IResource resource) {
-		if (resource == null)
-			return;
-		IDOMDocument document = getDocument();
-		if (document == null)
-			return;
-		IDOMModel model = document.getModel();
-		if (model == null)
-			return;
-		IFile file = getFile(model);
-		if (file == null)
-			return;
-		IProject project = file.getProject();
-		if (project == null)
-			return;
-		if (!project.equals(resource.getProject()))
-			return;
-		documentTypeChanged();
-	}
-
-	/**
-	 */
-	private void documentTypeChanged() {
-		IDOMDocument document = getDocument();
-		if (document == null)
-			return; // error
-		IDOMModel model = document.getModel();
-		if (model == null)
-			return; // error
-
-		IFile file = getFile(model);
-
-		// find DOCTYPE delcaration and Public ID
-		String publicId = null;
-		DocumentType newDocumentType = findDocumentType(document);
-		if (newDocumentType != null) {
-			publicId = newDocumentType.getPublicId();
-		} else {
-			// lookup default set by contentsettings
-			publicId = getDefaultPublicId(file);
-		}
-
-		// lookup DOCTYPE registry
-		HTMLDocumentTypeEntry newEntry = null;
-		if (publicId != null) {
-			newEntry = HTMLDocumentTypeRegistry.getInstance().getEntry(publicId);
-		}
-
-		boolean newXMLType = (newEntry != null ? newEntry.isXMLType() : false);
-		boolean newWMLType = (newEntry != null ? newEntry.isWMLType() : false);
-
-		if (!newXMLType) {
-			// find XML declaration
-			if (findXMLNode(document) != null) {
-				newXMLType = true;
-			}
-
-			// check file extension
-			if (file != null) {
-				String ext = file.getFileExtension();
-				if (ext != null && ext.equalsIgnoreCase(XHTML)) {
-					newXMLType = true;
-				}
-
-				if (ext != null && ext.equalsIgnoreCase(WML)) {
-					newXMLType = true;
-					newWMLType = true;
-				}
-			}
-
-		}
-
-		if (newEntry == null) {
-			// lookup system default
-			if (newXMLType && newDocumentType == null) {
-				// use default XHTML, if it's XML and no document type
-				// declared
-				if (newWMLType)
-					newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_WML);
-				else
-					newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_XHTML);
-
-			} else {
-				newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_HTML);
-			}
-			if (newEntry == null)
-				return; // error
-		}
-
-		if (newDocumentType == null) {
-			DocumentType oldDocumentType = getDocumentType();
-			if (oldDocumentType == null || oldDocumentType.getName() != newEntry.getName()) {
-				// create implicit DocumentType
-				DOMImplementation impl = document.getImplementation();
-				if (impl != null) {
-					String name = newEntry.getName();
-					publicId = newEntry.getPublicId();
-					String systemId = newEntry.getSystemId();
-					newDocumentType = impl.createDocumentType(name, publicId, systemId);
-				}
-			}
-		}
-
-		boolean notify = false;
-		if (this.entry != null) { // do not notify on initialization
-			notify = (newEntry != this.entry || newXMLType != this.isXMLType);
-		}
-
-		if (newDocumentType != null)
-			setDocumentType(newDocumentType);
-		this.entry = newEntry;
-		this.isXMLType = newXMLType;
-
-		if (notify)
-			notifyDocumentTypeChanged();
-	}
-
-	/**
-	 */
-	private IDOMDocumentType findDocumentType(IDOMDocument document) {
-		IDOMDocumentType documentType = (IDOMDocumentType) document.getDoctype();
-		if (documentType != null && documentType.getExistingAdapter(DocumentTypeAdapter.class) == null) {
-			// watch future changes
-			documentType.addAdapter(this);
-		}
-		return documentType;
-	}
-
-	/**
-	 */
-	private Node findXMLNode(Document document) {
-		for (Node child = document.getFirstChild(); child != null; child = child.getNextSibling()) {
-			if (child.getNodeType() != Node.PROCESSING_INSTRUCTION_NODE)
-				continue;
-			String target = child.getNodeName();
-			if (target != null && target.equals(XML)) {
-				return child;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 */
-	public int getAttrNameCase() {
-		if (isXMLType())
-			return LOWER_CASE; // XHTML
-		return this.fFactory.getAttrNameCase();
-	}
-
-	/**
-	 */
-	private String getDefaultPublicId(IFile file) {
-		if (file == null)
-			return null;
-		IProject project = file.getProject();
-		if (project == null)
-			return null;
-		IContentSettings settings = ContentSettings.getInstance();
-		if (settings == null)
-			return null;
-		String publicId = settings.getProperty(file, IContentSettings.HTML_DOCUMENT_TYPE);
-		if (publicId == null || publicId.length() == 0) {
-			// look up project default
-			publicId = settings.getProperty(project, IContentSettings.HTML_DOCUMENT_TYPE);
-		}
-		return publicId;
-	}
-
-	private IFile getFile(IStructuredModel model) {
-		IFile result = null;
-		String location = model.getBaseLocation();
-		if (location != null) {
-			IPath path = new Path(location);
-			if (!path.toFile().exists() && path.segmentCount() > 1) {
-				result = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 */
-	public int getTagNameCase() {
-		if (isXMLType())
-			return LOWER_CASE; // XHTML
-		return this.fFactory.getTagNameCase();
-	}
-
-	/**
-	 */
-	public boolean hasFeature(String feature) {
-		if (feature == null)
-			return false;
-		if (feature.equals(HTML))
-			return true;
-		if (feature.equals(SSI))
-			return true;
-		if (feature.equals(FRAMESET)) {
-			if (this.entry == null)
-				return false;
-			return this.entry.hasFrameset();
-		}
-		return false;
-	}
-
-	/**
-	 */
-	public boolean isXMLType() {
-		return this.isXMLType;
-	}
-
-	/**
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		if (notifier == null)
-			return;
-		if (notifier instanceof IDOMDocument) {
-			if (eventType != INodeNotifier.STRUCTURE_CHANGED)
-				return;
-		} else {
-			if (eventType != INodeNotifier.CHANGE)
-				return;
-		}
-		documentTypeChanged();
-	}
-
-	/**
-	 */
-	public void release() {
-		ContentSettingsChangeSubject.getSubject().removeListener(this);
-		super.release();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapterFactory.java
deleted file mode 100644
index 14028b0..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapterFactory.java
+++ /dev/null
@@ -1,170 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-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.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-
-/**
- */
-public class HTMLDocumentTypeAdapterFactory implements INodeAdapterFactory, Preferences.IPropertyChangeListener {
-
-	private int tagNameCase = DocumentTypeAdapter.LOWER_CASE;
-	private int attrNameCase = DocumentTypeAdapter.LOWER_CASE;
-	private Preferences preferences = null;
-
-	// for removal later on release()
-	private HashMap fDoc2AdapterMap = new HashMap();
-	
-	/**
-	 */
-	public HTMLDocumentTypeAdapterFactory() {
-		super();
-		this.preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
-
-		if (this.preferences != null) {
-			updateCases(); // initialize
-			this.preferences.addPropertyChangeListener(this);
-		}
-	}
-
-	/**
-	 * Method that returns the adapter associated with the given object. It
-	 * may be a singleton or not ... depending on the needs of the
-	 * INodeAdapter ... but in general it is recommended for an adapter to be
-	 * stateless, so the efficiencies of a singleton can be gained.
-	 * 
-	 * The implementation of this method should call addAdapter on the adapted
-	 * object with the correct instance of the adapter.
-	 */
-	public INodeAdapter adapt(INodeNotifier notifier) {
-		INodeAdapter result = null;
-		// only adapt IDOMDocument
-		if (notifier instanceof IDOMDocument) {
-
-			// if already has an adapter, no need to recreate/initialize.
-			// Note: this means if "doctype" for DOM changes,
-			// theDocumentTypeAdatper for that DOM
-			// should be removed (and released) and it will be re-created next
-			// time required.
-			DocumentTypeAdapter oldAdapter = (DocumentTypeAdapter) notifier.getExistingAdapter(DocumentTypeAdapter.class);
-			if (oldAdapter != null) {
-				result = oldAdapter;
-			}
-			else {
-				
-				// if there already was an adapter
-				//if(fAdapter != null) 
-				//	fAdapter.release();
-				
-				// note, the factory is included in this case to have a central place
-				// to come back to for case preferences.
-				result = new HTMLDocumentTypeAdapter((IDOMDocument) notifier, this);
-				notifier.addAdapter(result);
-				
-				fDoc2AdapterMap.put(notifier, result);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 */
-	public int getAttrNameCase() {
-		return this.attrNameCase;
-	}
-
-	/**
-	 */
-	public int getTagNameCase() {
-		return this.tagNameCase;
-	}
-
-	/**
-	 */
-	public boolean isFactoryForType(Object type) {
-		return (type == DocumentTypeAdapter.class);
-	}
-
-	/**
-	 */
-	public void propertyChange(Preferences.PropertyChangeEvent event) {
-		if (event == null)
-			return;
-		String property = event.getProperty();
-		if (property == null)
-			return;
-
-		if (property.equals(HTMLCorePreferenceNames.TAG_NAME_CASE) || property.equals(HTMLCorePreferenceNames.ATTR_NAME_CASE)) {
-			updateCases();
-		}
-	}
-
-	/**
-	 */
-	private void updateCases() {
-		this.tagNameCase = DocumentTypeAdapter.LOWER_CASE;
-		this.attrNameCase = DocumentTypeAdapter.LOWER_CASE;
-
-		if (this.preferences == null)
-			return;
-
-		int tagCase = this.preferences.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
-		if (tagCase == HTMLCorePreferenceNames.LOWER)
-			this.tagNameCase = DocumentTypeAdapter.LOWER_CASE;
-		else if (tagCase == HTMLCorePreferenceNames.UPPER)
-			this.tagNameCase = DocumentTypeAdapter.UPPER_CASE;
-		
-		int attCase = this.preferences.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
-		if (attCase == HTMLCorePreferenceNames.LOWER)
-			this.attrNameCase = DocumentTypeAdapter.LOWER_CASE;
-		else if (attCase == HTMLCorePreferenceNames.UPPER)
-			this.tagNameCase = DocumentTypeAdapter.UPPER_CASE;
-	}
-
-	/**
-	 */
-	public void release() {
-		
-		if(!fDoc2AdapterMap.isEmpty()) {
-			Object[] docs = fDoc2AdapterMap.keySet().toArray();
-			DocumentTypeAdapter adapter = null;
-			for (int i = 0; i < docs.length; i++) {
-				adapter = (DocumentTypeAdapter)fDoc2AdapterMap.get(docs[i]);
-				adapter.release();
-				((IDOMDocument)docs[i]).removeAdapter(adapter);
-			}
-			fDoc2AdapterMap.clear();
-		}
-		
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=95960
-		if (this.preferences != null) {
-			this.preferences.removePropertyChangeListener(this);
-		}
-	}
-
-	/**
-	 * Overriding copy method
-	 */
-	public INodeAdapterFactory copy() {
-		return new HTMLDocumentTypeAdapterFactory();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeConstants.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeConstants.java
deleted file mode 100644
index abc3284..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeConstants.java
+++ /dev/null
@@ -1,19 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-public interface HTMLDocumentTypeConstants {
-
-	public final static String HTML = "HTML"; //$NON-NLS-1$
-	public final static String FRAMESET = "FRAMESET"; //$NON-NLS-1$
-	public final static String SSI = "SSI"; //$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/document/HTMLDocumentTypeEntry.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeEntry.java
deleted file mode 100644
index c8a51b3..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeEntry.java
+++ /dev/null
@@ -1,126 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-/**
- */
-public class HTMLDocumentTypeEntry {
-
-	private String name;
-	private String publicId;
-	private String systemId;
-	private String namespaceURI;
-	private boolean isXMLType;
-	private boolean isXHTMLType;
-	private boolean isWMLType;
-	private boolean hasFrameset;
-	private String displayName;
-	private boolean isDefaultXHTML;
-	private boolean isDefaultWML;
-	private static String XHTML_NAME = "html"; //$NON-NLS-1$
-	private static String HTML_NAME = "HTML"; //$NON-NLS-1$
-
-	/**
-	 */
-	private HTMLDocumentTypeEntry() {
-		super();
-	}
-
-	/**
-	 */
-	public HTMLDocumentTypeEntry(String name, String publicId, String systemId, String namespaceURI, boolean isXHTMLType, boolean hasFrameset, String displayName, boolean isDefaultXHTML, boolean isDefaultWML, boolean isWMLType) {
-		super();
-
-		if (name != null && name.length() > 0) {
-			this.name = name;
-		}
-		else {
-			if (isXMLType)
-				this.name = XHTML_NAME;// need code for wml?
-			else
-				this.name = HTML_NAME;
-		}
-		this.publicId = publicId;
-		this.systemId = systemId;
-		this.namespaceURI = namespaceURI;
-		this.isXMLType = isXHTMLType | isWMLType;
-		this.hasFrameset = hasFrameset;
-		this.displayName = displayName;
-		this.isDefaultXHTML = isDefaultXHTML;
-		this.isDefaultWML = isDefaultWML;
-		this.isXHTMLType = isXHTMLType;
-		this.isWMLType = isWMLType;
-	}
-
-	/**
-	 */
-	public final String getName() {
-		return this.name;
-	}
-
-	/**
-	 */
-	public final String getNamespaceURI() {
-		return this.namespaceURI;
-	}
-
-	/**
-	 */
-	public final String getPublicId() {
-		return this.publicId;
-	}
-
-	/**
-	 */
-	public final String getSystemId() {
-		return this.systemId;
-	}
-
-	/**
-	 */
-	public final boolean isXMLType() {
-		return this.isXMLType;
-	}
-
-	/**
-	 */
-	public final boolean hasFrameset() {
-		return this.hasFrameset;
-	}
-
-	/**
-	 */
-	public final String getDisplayName() {
-		return this.displayName;
-	}
-
-	/**
-	 */
-	public final boolean isDefaultXHTML() {
-		return this.isDefaultXHTML;
-	}
-
-	public final boolean isDefaultWML() {
-		return this.isDefaultWML;
-	}
-
-
-	public final boolean isXHTMLType() {
-		return isXHTMLType;
-	}
-
-	public final boolean isWMLType() {
-		return isWMLType;
-	}
-
-}
\ No newline at end of file
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
deleted file mode 100644
index 6f9cd0c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java
+++ /dev/null
@@ -1,139 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-/**
- */
-public class HTMLDocumentTypeRegistry {
-
-	private static HTMLDocumentTypeRegistry instance = null;
-	private Hashtable entries = null;
-	private HTMLDocumentTypeEntry defaultEntry = null;
-	private HTMLDocumentTypeEntry defaultXHTMLEntry = null;
-	private HTMLDocumentTypeEntry defaultWMLEntry = null;
-	private HTMLDocumentTypeEntry defaultCHTMLEntry = 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;
-
-	public static final String CHTML_PUBLIC_ID = "-//W3C//DTD Compact HTML 1.0 Draft//EN";//$NON-NLS-1$
-
-	/**
-	 */
-	private HTMLDocumentTypeRegistry() {
-		super();
-
-		this.entries = new Hashtable();
-		// HTML 4.01
-		String name = "HTML";//$NON-NLS-1$
-		String publicId = "-//W3C//DTD HTML 4.01 Transitional//EN";//$NON-NLS-1$
-		String displayName = "HTML 4.01 Transitional"; //$NON-NLS-1$
-		this.defaultEntry = new HTMLDocumentTypeEntry(name, publicId, null, null, false, false, displayName, false, false, false);
-		this.entries.put(publicId, this.defaultEntry);
-		publicId = "-//W3C//DTD HTML 4.01//EN";//$NON-NLS-1$
-		displayName = "HTML 4.01 Strict"; //$NON-NLS-1$
-		this.entries.put(publicId, new HTMLDocumentTypeEntry(name, publicId, null, null, false, false, displayName, false, false, false));
-		publicId = "-//W3C//DTD HTML 4.01 Frameset//EN";//$NON-NLS-1$
-		displayName = "HTML 4.01 Frameset"; //$NON-NLS-1$
-		this.entries.put(publicId, new HTMLDocumentTypeEntry(name, publicId, null, null, false, true, displayName, false, false, false));
-		// CHTML
-		name = "HTML";//$NON-NLS-1$
-		publicId = CHTML_PUBLIC_ID;
-		displayName = "Compact HTML 1.0 Draft"; //$NON-NLS-1$
-		this.defaultCHTMLEntry = new HTMLDocumentTypeEntry(name, publicId, null, null, false, false, displayName, false, false, false);
-		this.entries.put(publicId, this.defaultCHTMLEntry);
-
-		HTMLDocumentTypeRegistryReader reader = new HTMLDocumentTypeRegistryReader();
-		if (reader != null)
-			reader.readRegistry(this);
-	}
-
-	/**
-	 */
-	void regist(String pid, HTMLDocumentTypeEntry doctype) {
-		if (pid == null || doctype == null)
-			return;
-		this.entries.put(pid, doctype);
-		if (this.defaultXHTMLEntry == null) {
-			if (doctype.isDefaultXHTML())
-				this.defaultXHTMLEntry = doctype;
-		}
-		if (this.defaultWMLEntry == null) {
-			if (doctype.isDefaultWML())
-				this.defaultWMLEntry = doctype;
-		}
-	}
-
-	/**
-	 * 
-	 */
-	public HTMLDocumentTypeEntry getDefaultEntry(int type) {
-		HTMLDocumentTypeEntry entry = null;
-		switch (type) {
-			case DEFAULT_XHTML :
-				entry = this.defaultXHTMLEntry;
-				break;
-			case DEFAULT_WML :
-				entry = this.defaultWMLEntry;
-				break;
-			case DEFAULT_CHTML :
-				entry = this.defaultCHTMLEntry;
-				break;
-			case DEFAULT_HTML :
-			default :
-				entry = this.defaultEntry;
-				break;
-		}
-		return entry;
-	}
-
-	/**
-	 * 
-	 */
-	public HTMLDocumentTypeEntry getDefaultEntry() {
-		return this.defaultEntry;
-	}
-
-	/**
-	 */
-	public HTMLDocumentTypeEntry getXHTMLDefaultEntry() {
-		return this.defaultXHTMLEntry;
-	}
-
-	/**
-	 */
-	public Enumeration getEntries() {
-		return this.entries.elements();
-	}
-
-	/**
-	 */
-	public HTMLDocumentTypeEntry getEntry(String publicId) {
-		if (publicId == null)
-			return null;
-		return (HTMLDocumentTypeEntry) this.entries.get(publicId);
-	}
-
-	/**
-	 */
-	public synchronized static HTMLDocumentTypeRegistry getInstance() {
-		if (instance == null)
-			instance = new HTMLDocumentTypeRegistry();
-		return instance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistryReader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistryReader.java
deleted file mode 100644
index 2dbf6ed..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistryReader.java
+++ /dev/null
@@ -1,107 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-
-/**
- */
-class HTMLDocumentTypeRegistryReader {
-
-	//
-	private final static String PLUGIN_ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
-	private final static String EXTENSION_POINT_ID = "documentTypes"; //$NON-NLS-1$
-	private final static String TAG_NAME = "documentType"; //$NON-NLS-1$
-	private final static String ATT_PID = "publicID"; //$NON-NLS-1$
-	private final static String ATT_SID = "systemID"; //$NON-NLS-1$
-	private final static String ATT_IS_XHTML = "isXHTML"; //$NON-NLS-1$
-	private final static String ATT_IS_WML = "isWML"; //$NON-NLS-1$
-	private final static String ATT_HAS_FRAMESET = "hasFrameset"; //$NON-NLS-1$
-	private final static String ATT_NSURI = "namespaceURI"; //$NON-NLS-1$
-	private final static String ATT_ENAME = "elementName"; //$NON-NLS-1$
-	private final static String ATT_DNAME = "displayName"; //$NON-NLS-1$
-	private final static String ATT_IS_DEFAULT_XHTML = "defaultXHTML"; //$NON-NLS-1$
-	private final static String ATT_IS_DEFAULT_WML = "defaultWML"; //$NON-NLS-1$
-	private final static String ATV_TRUE = "true"; //$NON-NLS-1$
-	private final static String ATV_NULL_STRING = ""; //$NON-NLS-1$
-
-	/**
-	 */
-	HTMLDocumentTypeRegistryReader() {
-		super();
-	}
-
-	/**
-	 */
-	void readRegistry(HTMLDocumentTypeRegistry reg) {
-		if (reg == null)
-			return;
-		IExtensionRegistry registry = Platform.getExtensionRegistry();
-		IExtensionPoint point = registry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
-		if (point != null) {
-			IConfigurationElement[] elements = point.getConfigurationElements();
-			for (int i = 0; i < elements.length; i++) {
-				HTMLDocumentTypeEntry doctype = readElement(elements[i]);
-				// null can be returned if there's an error reading the element
-				if (doctype != null) {
-					reg.regist(doctype.getPublicId(), doctype);
-				}
-			}
-		}
-	}
-
-	/**
-	 */
-	private HTMLDocumentTypeEntry readElement(IConfigurationElement element) {
-		HTMLDocumentTypeEntry doctype = null;
-		String pid = null;
-		String sid = null;
-		String nsuri = null;
-		String root = null;
-		boolean xhtml = true;
-		boolean frameset = false;
-		String dname = null;
-		boolean defaultXhtml = false;
-		boolean defaultWML = false;
-		boolean isWML = false;
-
-		if (element.getName().equals(TAG_NAME)) {
-			pid = element.getAttribute(ATT_PID);
-			// publicID attribute is mandatory.
-			if (pid == null || pid.equals(ATV_NULL_STRING))
-				return null;
-
-			sid = element.getAttribute(ATT_SID);
-			nsuri = element.getAttribute(ATT_NSURI);
-			root = element.getAttribute(ATT_ENAME);
-			xhtml = getBoolean(element, ATT_IS_XHTML);
-			frameset = getBoolean(element, ATT_HAS_FRAMESET);
-			dname = element.getAttribute(ATT_DNAME);
-			defaultXhtml = getBoolean(element, ATT_IS_DEFAULT_XHTML);
-			defaultWML = getBoolean(element, ATT_IS_DEFAULT_WML);
-			isWML = getBoolean(element, ATT_IS_WML);
-			doctype = new HTMLDocumentTypeEntry(root, pid, sid, nsuri, xhtml, frameset, dname, defaultXhtml, defaultWML, isWML);
-		}
-		return doctype;
-	}
-
-	/**
-	 */
-	private boolean getBoolean(IConfigurationElement element, String att) {
-		String value = element.getAttribute(att);
-		if (value != null && value.equals(ATV_TRUE))
-			return true;
-		return false;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 1033d09..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java
+++ /dev/null
@@ -1,356 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-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;
-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.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.document.CMNodeUtil;
-import org.eclipse.wst.xml.core.internal.document.ModelParserAdapter;
-import org.eclipse.wst.xml.core.internal.document.TagAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * HTMLDocumentImpl class
- */
-public class HTMLModelParserAdapter implements ModelParserAdapter {
-	/**
-	 * note: I made public, temparily, so could be used by JSPLoader
-	 */
-	protected HTMLModelParserAdapter() {
-		super();
-	}
-
-	private boolean shouldTerminateAt(CMElementDeclaration parent, CMElementDeclaration child) {
-		if (!parent.supports(HTMLCMProperties.TERMINATORS))
-			return false;
-		java.util.Iterator i = (java.util.Iterator) parent.getProperty(HTMLCMProperties.TERMINATORS);
-		if (i == null)
-			return false;
-		String nextName = child.getElementName();
-		while (i.hasNext()) {
-			// NOTE: CMElementDeclaration of child is not always HTMLCMElementDeclaration.
-			// It might be one of based on DTD (for XHTML element).  So, comparison must
-			// be performed ignoring case.
-			// -- 3/20/2002
-			String terminator = (String) i.next();
-			if (terminator == null)
-				continue;
-			if (nextName.equalsIgnoreCase(terminator))
-				return true;
-		}
-		return false;
-	}
-
-	/**
-	 */
-	public boolean canContain(Element element, Node child) {
-		if (element == null || child == null)
-			return false;
-		IDOMElement impl = (IDOMElement) element;
-
-		if (child.getNodeType() == Node.ELEMENT_NODE) {
-			if (!impl.isGlobalTag())
-				return true; // non HTML tag
-			IDOMElement childElement = (IDOMElement) child;
-
-			CMElementDeclaration myDec = CMNodeUtil.getElementDeclaration(element);
-			if (myDec == null)
-				return true;
-			//if (!(myDec instanceof HTMLElementDeclaration)) return true;
-			if (myDec.getContentType() == CMElementDeclaration.EMPTY)
-				return false;
-
-			if (!childElement.isGlobalTag())
-				return true; // non HTML tag
-			CMElementDeclaration childDec = CMNodeUtil.getElementDeclaration(childElement);
-			if (childDec == null)
-				return true;
-			//if (!(childDec instanceof HTMLElementDeclaration)) return true;
-
-			if (myDec instanceof HTMLElementDeclaration) {
-				if (((Boolean) ((HTMLElementDeclaration) myDec).getProperty(HTMLCMProperties.IS_JSP)).booleanValue())
-					return true;
-			}
-			if (shouldTerminateAt(myDec, childDec) && !isValidChild(myDec, childDec)) {
-				return false;
-			}
-
-			String tagName = impl.getTagName();
-			if (tagName == null)
-				return true;
-			String childName = childElement.getTagName();
-			if (childName == null)
-				return true;
-			if (!impl.hasStartTag() && !impl.hasEndTag()) {
-				// implicit element
-				if (tagName.equalsIgnoreCase(childElement.getTagName()))
-					return false;
-				if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD)) {
-					if (!childName.equalsIgnoreCase(HTML40Namespace.ElementName.META) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.TITLE) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.LINK) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.BASE) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.ISINDEX)) {
-						return false;
-					}
-				}
-
-				Node parent = element.getParentNode();
-				if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
-					IDOMElement parentElement = (IDOMElement) parent;
-					if (!parentElement.hasStartTag() && !parentElement.hasEndTag()) {
-						if (!canContain(parentElement, child))
-							return false;
-					}
-				}
-				return true;
-			}
-
-			// contexual termination for TABLE content tags
-			boolean isTableContent = false;
-			if (childName.equalsIgnoreCase(HTML40Namespace.ElementName.TBODY) || childName.equalsIgnoreCase(HTML40Namespace.ElementName.THEAD) || childName.equalsIgnoreCase(HTML40Namespace.ElementName.TFOOT)) {
-				if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TABLE))
-					return true;
-				isTableContent = true;
-			}
-			else if (childName.equalsIgnoreCase(HTML40Namespace.ElementName.TR)) {
-				if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TBODY) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.THEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TFOOT) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TABLE))
-					return true;
-				isTableContent = true;
-			}
-			else if (childName.equalsIgnoreCase(HTML40Namespace.ElementName.TD) || childName.equalsIgnoreCase(HTML40Namespace.ElementName.TH)) {
-				if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TR) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TBODY) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.THEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TFOOT) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TABLE))
-					return true;
-				isTableContent = true;
-			}
-			if (isTableContent) {
-				// TABLE content tags should terminate non TABLE content tags,
-				// if in TABLE
-				for (Node parent = element.getParentNode(); parent != null; parent = parent.getParentNode()) {
-					if (parent.getNodeType() != Node.ELEMENT_NODE)
-						break;
-					IDOMElement parentElement = (IDOMElement) parent;
-					String parentName = parentElement.getTagName();
-					if (parentName == null)
-						continue;
-					if (parentName.equalsIgnoreCase(HTML40Namespace.ElementName.TABLE))
-						return false;
-				}
-			}
-			if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.EMBED)) {
-				if (!childName.equalsIgnoreCase(HTML40Namespace.ElementName.NOEMBED))
-					return false;
-			}
-		}
-		else if (child.getNodeType() == Node.TEXT_NODE) {
-			String tagName = impl.getTagName();
-			if (tagName != null && tagName.equalsIgnoreCase(HTML40Namespace.ElementName.EMBED)) {
-				IDOMText text = (IDOMText) child;
-				if (!text.isElementContentWhitespace())
-					return false;
-			}
-		}
-		else if (child.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
-			if (impl.isImplicitTag())
-				return false;
-		}
-
-		return true;
-	}
-
-	/**
-	 */
-	public boolean canBeImplicitTag(Element element) {
-		return false;
-	}
-
-	/**
-	 */
-	public boolean canBeImplicitTag(Element element, Node child) {
-		return false;
-	}
-
-	/**
-	 */
-	public Element createCommentElement(Document document, String data, boolean isJSPTag) {
-		if (document == null || data == null || data.length() == 0)
-			return null;
-
-		return createMetaElement(document, data, isJSPTag);
-	}
-
-	/**
-	 * This routine create an implicit Element for given parent and child,
-	 * such as HTML, BODY, HEAD, and TBODY for HTML document.
-	 */
-	public Element createImplicitElement(Document document, Node parent, Node child) {
-		return null;
-	}
-
-	/**
-	 */
-	private Element createMetaElement(Document document, String data, boolean isJSPTag) {
-		if (data == null || data.length() == 0)
-			return null;
-
-		TagScanner scanner = new TagScanner(data, 0, true); // one line
-		String name = scanner.nextName();
-		if (name == null || !name.equalsIgnoreCase(MetaData.METADATA))
-			return null;
-
-		String type = null;
-		boolean isStartSpan = false;
-		boolean isEndSpan = false;
-		name = scanner.nextName();
-		while (name != null) {
-			String value = scanner.nextValue();
-			if (name.equalsIgnoreCase(MetaData.TYPE)) {
-				if (value == null)
-					return null;
-				if (value.equalsIgnoreCase(MetaData.DESIGNER_CONTROL)) {
-					type = MetaData.DESIGNER_CONTROL;
-				}
-				else if (value.equalsIgnoreCase(MetaData.DYNAMIC_DATA)) {
-					type = MetaData.DYNAMIC_DATA;
-				}
-				else if (value.equalsIgnoreCase(MetaData.AUTHOR_TIME_VISUAL)) {
-					type = MetaData.AUTHOR_TIME_VISUAL;
-				}
-				else if (value.equalsIgnoreCase(MetaData.ANNOTATION)) {
-					type = MetaData.ANNOTATION;
-				}
-				else {
-					return null;
-				}
-			}
-			else if (name.equalsIgnoreCase(MetaData.STARTSPAN)) {
-				isStartSpan = true;
-			}
-			else if (name.equalsIgnoreCase(MetaData.ENDSPAN)) {
-				if (!isStartSpan)
-					isEndSpan = true;
-			}
-			name = scanner.nextName();
-		}
-		if (type == null)
-			return null;
-		if (!isStartSpan && !isEndSpan)
-			return null;
-		String metaData = null;
-		int offset = scanner.getNextOffset(); // skip new line
-		if (offset < data.length())
-			metaData = data.substring(offset);
-		if (metaData == null)
-			metaData = new String();
-
-		IDOMElement element = (IDOMElement) document.createElement(MetaData.PREFIX + type);
-
-		MetaDataAdapter adapter = new MetaDataAdapter(type);
-		if (isStartSpan) {
-			if (metaData != null)
-				adapter.setData(metaData);
-		}
-		else {
-			if (metaData != null)
-				adapter.setEndData(metaData);
-		}
-		element.addAdapter(adapter);
-		adapter.setElement(element);
-		element.setJSPTag(isJSPTag);
-
-		return element;
-	}
-
-	/**
-	 */
-	public String getFindRootName(String tagName) {
-		if (tagName == null)
-			return null;
-		// tag matching should not beyond TABLE tag except BODY tag
-		if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.BODY))
-			return null;
-		return HTML40Namespace.ElementName.TABLE;
-	}
-
-	/**
-	 */
-	public boolean isAdapterForType(Object type) {
-		return (type == ModelParserAdapter.class);
-	}
-
-	/**
-	 */
-	public boolean isEndTag(IDOMElement element) {
-		TagAdapter adapter = (TagAdapter) element.getExistingAdapter(TagAdapter.class);
-		if (adapter != null)
-			return adapter.isEndTag();
-		return element.isEndTag();
-	}
-
-	/**
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		// do nothing on notifiy change
-		// TODO: this means good candidate for regular platform adapter
-	}
-
-	private static boolean isValidChild(CMElementDeclaration parent, CMElementDeclaration child) {
-		if (parent == null || child == null)
-			return false;
-		CMContent content = parent.getContent();
-		if (content == null)
-			return false;
-		return isChild(content, child);
-	}
-
-	/**
-	 */
-	private static boolean isChild(CMContent content, CMElementDeclaration target) {
-		switch (content.getNodeType()) {
-			case CMNode.ELEMENT_DECLARATION :
-				return isSameDeclaration((CMElementDeclaration) content, target);
-			case CMNode.GROUP :
-				CMNodeList children = ((CMGroup) content).getChildNodes();
-				for (int i = 0; i < children.getLength(); i++) {
-					CMNode child = children.item(i);
-					switch (child.getNodeType()) {
-						case CMNode.ELEMENT_DECLARATION :
-							if (isSameDeclaration((CMElementDeclaration) child, target))
-								return true;
-							continue; // Go next child.
-						case CMNode.GROUP :
-							if (isChild((CMContent) child, target))
-								return true;
-							continue; // Go next child.
-						default :
-							continue; // Go next child.
-					}
-				}
-		}
-		return false;
-	}
-
-	/**
-	 */
-	private static boolean isSameDeclaration(CMElementDeclaration aDec, CMElementDeclaration otherDec) {
-		return aDec.getElementName() == otherDec.getElementName();
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapterFactory.java
deleted file mode 100644
index 397419e..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapterFactory.java
+++ /dev/null
@@ -1,83 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-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.document.ModelParserAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-
-/**
- */
-public class HTMLModelParserAdapterFactory implements INodeAdapterFactory {
-
-	private static HTMLModelParserAdapterFactory instance = null;
-
-	/**
-	 */
-	private HTMLModelParserAdapterFactory() {
-		super();
-	}
-
-	/**
-	 * Method that returns the adapter associated with the given object. It
-	 * may be a singleton or not ... depending on the needs of the
-	 * INodeAdapter ... but in general it is recommended for an adapter to be
-	 * stateless, so the efficiencies of a singleton can be gained.
-	 * 
-	 * The implementation of this method should call addAdapter on the adapted
-	 * object with the correct instance of the adapter.
-	 */
-	public INodeAdapter adapt(INodeNotifier notifier) {
-		INodeAdapter adapter = null;
-		if (notifier != null) {
-			if (notifier instanceof IDOMDocument) {
-				adapter = notifier.getExistingAdapter(ModelParserAdapter.class);
-				if (adapter == null) {
-					adapter = new HTMLModelParserAdapter();
-					notifier.addAdapter(adapter);
-				}
-			}
-		}
-		return adapter;
-
-	}
-
-	/**
-	 */
-	public synchronized static HTMLModelParserAdapterFactory getInstance() {
-		if (instance == null)
-			instance = new HTMLModelParserAdapterFactory();
-		return instance;
-	}
-
-	/**
-	 */
-	public boolean isFactoryForType(Object type) {
-		return (type == ModelParserAdapter.class);
-	}
-
-	/**
-	 */
-	public void release() {
-		// no state to cleanup
-	}
-
-	/**
-	 * Overriding copy method
-	 */
-	public INodeAdapterFactory copy() {
-		return getInstance();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaData.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaData.java
deleted file mode 100644
index 132e18b..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaData.java
+++ /dev/null
@@ -1,28 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-/**
- */
-public interface MetaData {
-
-	static final String METADATA = "METADATA";//$NON-NLS-1$
-	static final String TYPE = "type";//$NON-NLS-1$
-	static final String STARTSPAN = "startspan";//$NON-NLS-1$
-	static final String ENDSPAN = "endspan";//$NON-NLS-1$
-	static final String DESIGNER_CONTROL = "DesignerControl";//$NON-NLS-1$
-	static final String DYNAMIC_DATA = "DynamicData";//$NON-NLS-1$
-	static final String AUTHOR_TIME_VISUAL = "AuthorTimeVisual";//$NON-NLS-1$
-	static final String ANNOTATION = "Annotation";//$NON-NLS-1$
-	static final String PREFIX = "METADATA:";//$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/document/MetaDataAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaDataAdapter.java
deleted file mode 100644
index 4fc4ca9..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaDataAdapter.java
+++ /dev/null
@@ -1,301 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-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.document.TagAdapter;
-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;
-
-/**
- */
-public class MetaDataAdapter implements TagAdapter, MetaData {
-
-	private IDOMElement element = null;
-	private String type = null;
-	private String data = null;
-	private String endData = null;
-
-	/**
-	 */
-	public MetaDataAdapter(String type) {
-		super();
-
-		if (type != null) {
-			if (type.equals(ANNOTATION)) {
-				this.type = ANNOTATION;
-			}
-			else if (type.equals(AUTHOR_TIME_VISUAL)) {
-				this.type = AUTHOR_TIME_VISUAL;
-			}
-			else {
-				this.type = type;
-			}
-		}
-	}
-
-	/**
-	 */
-	private String getData(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return null;
-		ITextRegionList regions = flatNode.getRegions();
-		if (regions == null)
-			return null;
-
-		String data = null;
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			String regionType = region.getType();
-			if (isCommentText(regionType)) {
-				data = flatNode.getText(region);
-				break;
-			}
-		}
-		if (data == null)
-			return null;
-		int length = data.length();
-		int offset = 0;
-		for (; offset < length; offset++) {
-			char c = data.charAt(offset);
-			if (c == '\r' || c == '\n') {
-				offset++;
-				break;
-			}
-		}
-		for (; offset < length; offset++) {
-			char c = data.charAt(offset);
-			if (c != '\r' && c != '\n') {
-				break;
-			}
-		}
-		return data.substring(offset);
-	}
-
-	private boolean isCommentText(String regionType) {
-		boolean result = false;
-		result = isDOMComment(regionType) || isNestedContentComment(regionType);
-		return result;
-	}
-
-	/**
-	 * 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 isNestedContentComment(String regionType) {
-		final String JSP_COMMENT_TEXT = "JSP_COMMENT_TEXT"; //$NON-NLS-1$
-		return regionType.equals(JSP_COMMENT_TEXT);
-	}
-
-	private boolean isDOMComment(String regionType) {
-		return regionType == DOMRegionContext.XML_COMMENT_TEXT;
-	}
-
-	public String getData() {
-		if (this.element == null)
-			return null;
-		IStructuredDocumentRegion flatNode = this.element.getStartStructuredDocumentRegion();
-		if (flatNode == null)
-			return null;
-		if (this.data != null)
-			return this.data;
-		return getData(flatNode);
-	}
-
-	/**
-	 */
-	private String getDelimiter(IDOMModel model) {
-		String delim = null;
-		if (model != null) {
-			IStructuredDocument structuredDocument = model.getStructuredDocument();
-			if (structuredDocument != null)
-				delim = structuredDocument.getLineDelimiter();
-		}
-		if (delim == null)
-			delim = "\r\n";//$NON-NLS-1$
-		return delim;
-	}
-
-	/**
-	 */
-	public String getEndData() {
-		if (this.element == null)
-			return null;
-		IStructuredDocumentRegion flatNode = this.element.getEndStructuredDocumentRegion();
-		if (flatNode == null)
-			return null;
-		if (this.endData != null)
-			return this.endData;
-		return getData(flatNode);
-	}
-
-	/**
-	 */
-	public String getEndTag(IDOMElement element) {
-		StringBuffer buffer = new StringBuffer();
-		if (element.isJSPTag())
-			buffer.append("<%--");//$NON-NLS-1$
-		else
-			buffer.append("<!--");//$NON-NLS-1$
-		buffer.append(METADATA);
-		buffer.append(' ');
-		buffer.append(TYPE);
-		buffer.append("=\"");//$NON-NLS-1$
-		buffer.append(this.type);
-		buffer.append("\" ");//$NON-NLS-1$
-		buffer.append(MetaData.ENDSPAN);
-		String data = getEndData();
-		if (data != null && data.length() > 0) {
-			String delim = getDelimiter(element.getModel());
-			buffer.append(delim);
-			buffer.append(data);
-			buffer.append(delim);
-		}
-		if (element.isJSPTag())
-			buffer.append("--%>");//$NON-NLS-1$
-		else
-			buffer.append("-->");//$NON-NLS-1$
-
-		return buffer.toString();
-	}
-
-	/**
-	 */
-	public String getStartTag(IDOMElement element) {
-		StringBuffer buffer = new StringBuffer();
-		if (element.isJSPTag())
-			buffer.append("<%--");//$NON-NLS-1$
-		else
-			buffer.append("<!--");//$NON-NLS-1$
-		buffer.append(METADATA);
-		buffer.append(' ');
-		buffer.append(TYPE);
-		buffer.append("=\"");//$NON-NLS-1$
-		buffer.append(this.type);
-		buffer.append("\" ");//$NON-NLS-1$
-		buffer.append(MetaData.STARTSPAN);
-		String data = getData();
-		if (data != null && data.length() > 0) {
-			String delim = getDelimiter(element.getModel());
-			buffer.append(delim);
-			buffer.append(data);
-			buffer.append(delim);
-		}
-		if (element.isJSPTag())
-			buffer.append("--%>");//$NON-NLS-1$
-		else
-			buffer.append("-->");//$NON-NLS-1$
-
-		return buffer.toString();
-	}
-
-	/**
-	 */
-	public String getType() {
-		return this.type;
-	}
-
-	/**
-	 */
-	public boolean isAdapterForType(Object type) {
-		return (type == TagAdapter.class || type == MetaDataAdapter.class);
-	}
-
-	/**
-	 */
-	public boolean isEndTag() {
-		if (this.element == null)
-			return false;
-		if (this.element.hasStartTag())
-			return false;
-		if (this.element.hasEndTag())
-			return true;
-		if (this.data != null)
-			return false;
-		return (this.endData != null);
-	}
-
-	/**
-	 */
-	public boolean isRuntimeContainer() {
-		return (this.type == ANNOTATION || this.type == AUTHOR_TIME_VISUAL);
-	}
-
-	/**
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-	}
-
-	/**
-	 */
-	public void setData(String data) {
-		this.data = data;
-
-		if (this.element != null)
-			this.element.notifyStartTagChanged();
-	}
-
-	/**
-	 */
-	public void setEndData(String data) {
-		this.endData = data;
-
-		if (this.element != null)
-			this.element.notifyEndTagChanged();
-	}
-
-	/**
-	 */
-	public void setElement(IDOMElement element) {
-		this.element = element;
-
-		if (this.element != null) {
-			this.element.setCommentTag(true);
-			if (this.type != MetaData.ANNOTATION) {
-				this.element.setJSPTag(true);
-			}
-		}
-	}
-
-	/**
-	 */
-	public void setRuntimeSource(String source) {
-		if (source == null)
-			return;
-		if (this.element == null)
-			return;
-		if (isRuntimeContainer())
-			return;
-
-		IDOMModel model = this.element.getModel();
-		if (model == null)
-			return;
-		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
-			return;
-		int offset = this.element.getStartEndOffset();
-		int end = this.element.getEndStartOffset();
-		int length = end - offset;
-		structuredDocument.replaceText(model, offset, length, source);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/TagScanner.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/TagScanner.java
deleted file mode 100644
index 17e0bb1..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/TagScanner.java
+++ /dev/null
@@ -1,166 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-/**
- */
-class TagScanner {
-
-	private String tag = null;
-	private int offset = 0;
-	private int length = 0;
-	private boolean oneLine = false;
-
-	/**
-	 */
-	TagScanner(String tag, int offset) {
-		super();
-
-		this.tag = tag;
-		this.offset = offset;
-		if (tag != null)
-			this.length = tag.length();
-	}
-
-	/**
-	 */
-	TagScanner(String tag, int offset, boolean oneLine) {
-		this(tag, offset);
-
-		this.oneLine = oneLine;
-	}
-
-	/**
-	 */
-	int getNextOffset() {
-		for (; this.offset < this.length; this.offset++) {
-			char c = this.tag.charAt(this.offset);
-			if (!isEnd(c))
-				break;
-		}
-		return this.offset;
-	}
-
-	/**
-	 */
-	int getOffset() {
-		return this.offset;
-	}
-
-	/**
-	 */
-	private final boolean isEnd(char c) {
-		return (this.oneLine && (c == '\r' || c == '\n'));
-	}
-
-	/**
-	 */
-	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 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;
-	}
-
-	/**
-	 */
-	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;
-
-		return this.tag.substring(nameOffset, this.offset);
-	}
-
-	/**
-	 */
-	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;
-
-		return this.tag.substring(valueOffset, valueEnd);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/UnknownTagAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/UnknownTagAdapter.java
deleted file mode 100644
index c6fcf4a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/UnknownTagAdapter.java
+++ /dev/null
@@ -1,82 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.document.TagAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- */
-public class UnknownTagAdapter implements TagAdapter {
-
-	private String startTag = null;
-	private String endTag = null;
-
-	/**
-	 */
-	public UnknownTagAdapter() {
-		super();
-	}
-
-	/**
-	 */
-	public String getEndTag(IDOMElement element) {
-		String tag = null;
-		if (this.endTag != null) {
-			tag = this.endTag;
-			this.endTag = null;
-		}
-		return tag;
-	}
-
-	/**
-	 */
-	public String getStartTag(IDOMElement element) {
-		String tag = null;
-		if (this.startTag != null) {
-			tag = this.startTag;
-			this.startTag = null;
-		}
-		return tag;
-	}
-
-	/**
-	 */
-	public boolean isAdapterForType(Object type) {
-		return (type == TagAdapter.class);
-	}
-
-	/**
-	 */
-	public boolean isEndTag() {
-		return false;
-	}
-
-	/**
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-	}
-
-	/**
-	 */
-	public void setEndTag(String endTag) {
-		this.endTag = endTag;
-	}
-
-	/**
-	 */
-	public void setStartTag(String startTag) {
-		this.startTag = startTag;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentCharsetDetector.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentCharsetDetector.java
deleted file mode 100644
index a0242c9..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentCharsetDetector.java
+++ /dev/null
@@ -1,42 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.encoding;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.html.core.internal.contenttype.HTMLResourceEncodingDetector;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-
-/**
- * This class parses beginning portion of HTML file to get the encoding value
- * in a META tag. Example:
- * <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- * 
- * Note: even though, technically, a META tag must come in a <HEAD>tag, we
- * don't check for that, under the assumption that whatever, or whereever, the
- * the first <META>tag is, it is the one intended to be used by the user, and
- * they may just be trying to repair the error. The HTML validator will tell
- * them if its in the wrong location.
- *  
- */
-public class HTMLDocumentCharsetDetector extends HTMLResourceEncodingDetector implements IDocumentCharsetDetector {
-
-
-	public HTMLDocumentCharsetDetector() {
-		super();
-	}
-
-	public void set(IDocument document) {
-		set(new DocumentReader(document, 0));
-
-
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentLoader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentLoader.java
deleted file mode 100644
index 43a50a9..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentLoader.java
+++ /dev/null
@@ -1,161 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.encoding;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.html.core.internal.contenttype.EncodingGuesser;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeAdapterFactory;
-import org.eclipse.wst.html.core.internal.document.HTMLModelParserAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.HTMLStyleSelectorAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.StyleAdapterFactory;
-import org.eclipse.wst.html.core.internal.modelquery.ModelQueryAdapterFactoryForHTML;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-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.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-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.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.propagate.PropagatingAdapterFactoryImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class HTMLDocumentLoader extends AbstractDocumentLoader {
-
-	public HTMLDocumentLoader() {
-		super();
-	}
-
-	/**
-	 * Convenience method to add tag names using BlockMarker object
-	 */
-	protected void addHTMLishTag(XMLSourceParser parser, String tagname) {
-		BlockMarker bm = new BlockMarker(tagname, null, DOMRegionContext.BLOCK_TEXT, false);
-		parser.addBlockMarker(bm);
-	}
-
-	/**
-	 * Default encoding. For HTML, there is no spec.
-	 */
-	protected String getSpecDefaultEncoding() {
-		return null;
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param string
-	 *            byte[]
-	 * @param length
-	 *            int
-	 * 
-	 * Do automatic encoding detection by guess
-	 */
-	protected String getEncodingNameByGuess(byte[] string, int length) {
-		final String ianaEnc = EncodingGuesser.guessEncoding(string, length);
-		return ianaEnc;
-	}
-
-	/*
-	 * @see AbstractLoader#createNewStructuredDocument()
-	 */
-	protected IEncodedDocument newEncodedDocument() {
-		IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
-		((BasicStructuredDocument) structuredDocument).setReParser(new XMLStructuredDocumentReParser());
-
-		return structuredDocument;
-	}
-
-	/*
-	 * @see IModelLoader#getParser()
-	 */
-	public RegionParser getParser() {
-		XMLSourceParser parser = new XMLSourceParser();
-		// for the "static HTML" case, we need to initialize
-		// Blocktags here.
-		addHTMLishTag(parser, "script"); //$NON-NLS-1$
-		addHTMLishTag(parser, "style"); //$NON-NLS-1$
-		return parser;
-	}
-
-	/**
-	 * This method must return those factories which must be attached to the
-	 * structuredModel before content is applied.
-	 */
-	public List getAdapterFactories() {
-		List result = new ArrayList();
-		INodeAdapterFactory factory = null;
-		factory = StyleAdapterFactory.getInstance();
-		result.add(factory);
-		factory = HTMLStyleSelectorAdapterFactory.getInstance();
-		result.add(factory);
-		factory = new HTMLDocumentTypeAdapterFactory();
-		result.add(factory);
-		factory = HTMLModelParserAdapterFactory.getInstance();
-		result.add(factory);
-		//
-		factory = new ModelQueryAdapterFactoryForHTML();
-		result.add(factory);
-
-		factory = new PropagatingAdapterFactoryImpl();
-		result.add(factory);
-
-
-		return result;
-	}
-
-	protected String getPreferredNewLineDelimiter() {
-		return ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(ContentTypeIdForHTML.ContentTypeID_HTML);
-	}
-
-	public IDocumentCharsetDetector getDocumentEncodingDetector() {
-		if (fDocumentEncodingDetector == null) {
-			fDocumentEncodingDetector = new HTMLDocumentCharsetDetector();
-		}
-		return fDocumentEncodingDetector;
-	}
-
-	protected void preLoadAdapt(IStructuredModel structuredModel) {
-		// DMW: just added this preload on 8/16/2002
-		// I noticed the ProagatingAdapterFactory was being added,
-		// that that the ProagatingAdapterAdapter was not being
-		// preload adapted -- I'm assuing it ALWAYS has to be.
-		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);
-	}
-
-	public IDocumentPartitioner getDefaultDocumentPartitioner() {
-		return new StructuredTextPartitionerForHTML();
-	}
-
-	public IDocumentLoader newInstance() {
-		return new HTMLDocumentLoader();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLModelLoader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLModelLoader.java
deleted file mode 100644
index 0f84fc8..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLModelLoader.java
+++ /dev/null
@@ -1,112 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.encoding;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.html.core.internal.document.DOMStyleModelImpl;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeAdapterFactory;
-import org.eclipse.wst.html.core.internal.document.HTMLModelParserAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.HTMLStyleSelectorAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.StyleAdapterFactory;
-import org.eclipse.wst.html.core.internal.modelquery.ModelQueryAdapterFactoryForHTML;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-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.parser.XMLSourceParser;
-import org.eclipse.wst.xml.core.internal.propagate.PropagatingAdapterFactoryImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class HTMLModelLoader extends AbstractModelLoader {
-
-
-	public HTMLModelLoader() {
-		super();
-	}
-
-	/**
-	 * Convenience method to add tag names using BlockMarker object
-	 */
-	protected void addHTMLishTag(XMLSourceParser parser, String tagname) {
-		BlockMarker bm = new BlockMarker(tagname, null, DOMRegionContext.BLOCK_TEXT, false);
-		parser.addBlockMarker(bm);
-	}
-
-	public IStructuredModel newModel() {
-		DOMStyleModelImpl model = new DOMStyleModelImpl();
-		return model;
-	}
-
-	/**
-	 * This method must return those factories which must be attached to the
-	 * structuredModel before content is applied.
-	 */
-	public List getAdapterFactories() {
-		List result = new ArrayList();
-		INodeAdapterFactory factory = null;
-		factory = StyleAdapterFactory.getInstance();
-		result.add(factory);
-		factory = HTMLStyleSelectorAdapterFactory.getInstance();
-		result.add(factory);
-		factory = new HTMLDocumentTypeAdapterFactory();
-		result.add(factory);
-		factory = HTMLModelParserAdapterFactory.getInstance();
-		result.add(factory);
-		//
-		factory = new ModelQueryAdapterFactoryForHTML();
-		result.add(factory);
-
-		factory = new PropagatingAdapterFactoryImpl();
-		result.add(factory);
-		
-
-		return result;
-	}
-
-	protected void preLoadAdapt(IStructuredModel structuredModel) {
-		super.preLoadAdapt(structuredModel);
-		// DMW: just added this preload on 8/16/2002
-		// I noticed the ProagatingAdapterFactory was being added,
-		// that that the ProagatingAdapterAdapter was not being
-		// preload adapted -- I'm assuing it ALWAYS has to be.
-		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());
-		}	}
-
-	public IModelLoader newInstance() {
-		return new HTMLModelLoader();
-	}
-
-	public IDocumentLoader getDocumentLoader() {
-		if (documentLoaderInstance == null) {
-			documentLoaderInstance = new HTMLDocumentLoader();
-		}
-		return documentLoaderInstance;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/EmbeddedCSSFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/EmbeddedCSSFormatter.java
deleted file mode 100644
index 294906c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/EmbeddedCSSFormatter.java
+++ /dev/null
@@ -1,90 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-
-
-import org.eclipse.wst.css.core.internal.format.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-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.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-
-// nakamori_TODO: check and remove
-
-public class EmbeddedCSSFormatter extends HTMLFormatter {
-
-	//private IAdapterFactory factory = new CSSSourceFormatterFactory(CSSSourceFormatter.class, true);
-	/**
-	 */
-	protected EmbeddedCSSFormatter() {
-		super();
-	}
-
-	/**
-	 */
-	protected void formatNode(IDOMNode node, HTMLFormatContraints contraints) {
-		if (node == null)
-			return;
-		IDOMText text = (IDOMText) node;
-
-		String source = getCSSContent(node);
-		if (source == null) { // fallback
-			source = text.getSource();
-		}
-
-		int offset = text.getStartOffset();
-		int length = text.getEndOffset() - offset;
-		replaceSource(text.getModel(), offset, length, source);
-		setWidth(contraints, source);
-	}
-
-	/**
-	 */
-	private String getCSSContent(IDOMNode text) {
-		ICSSModel model = getCSSModel(text);
-		if (model == null)
-			return null;
-		ICSSNode document = model.getDocument();
-		if (document == null)
-			return null;
-		INodeNotifier notifier = (INodeNotifier) document;
-		INodeAdapter adapter = notifier.getAdapterFor(CSSSourceFormatter.class);
-		if (adapter == null)
-			return null;
-		CSSSourceFormatter formatter = (CSSSourceFormatter) adapter;
-		StringBuffer buffer = formatter.format(document);
-		if (buffer == null)
-			return null;
-		return buffer.toString();
-	}
-
-	/**
-	 */
-	private ICSSModel getCSSModel(IDOMNode text) {
-		if (text == null)
-			return null;
-		INodeNotifier notifier = (INodeNotifier) text.getParentNode();
-		if (notifier == null)
-			return null;
-		INodeAdapter adapter = notifier.getAdapterFor(IStyleSheetAdapter.class);
-		if (adapter == null)
-			return null;
-		if (!(adapter instanceof IStyleSheetAdapter))
-			return null;
-		IStyleSheetAdapter styleAdapter = (IStyleSheetAdapter) adapter;
-		return styleAdapter.getModel();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java
deleted file mode 100644
index 27fcc9b..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java
+++ /dev/null
@@ -1,356 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.format.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-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.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.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.IStructuredFormatPreferencesXML;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-
-// nakamori_TODO: check and remove CSS formatting
-
-public class HTMLElementFormatter extends HTMLFormatter {
-
-	/**
-	 */
-	protected HTMLElementFormatter() {
-		super();
-	}
-
-	/**
-	 */
-	private void compressTailingSpaces(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		int offset = region.getTextEnd();
-		int count = region.getEnd() - offset;
-		if (count == 1) {
-			String source = flatNode.getFullText(region);
-			int start = region.getStart();
-			if (source != null && source.charAt(offset - start) == ' ') {
-				// nothing to do
-				return;
-			}
-		}
-		replaceSource(flatNode, offset, count, " ");//$NON-NLS-1$
-	}
-
-	/**
-	 */
-	private void formatEndTag(IDOMElement element, HTMLFormatContraints contraints) {
-		IStructuredDocumentRegion endStructuredDocumentRegion = element.getEndStructuredDocumentRegion();
-		if (endStructuredDocumentRegion == null)
-			return;
-
-		if (element.isJSPTag() || element.isCommentTag()) {
-			String endTag = endStructuredDocumentRegion.getText();
-			if (endTag != null && endTag.length() > 0) {
-				setWidth(contraints, endTag);
-			}
-			return;
-		}
-
-		ITextRegion prevRegion = null;
-		ITextRegionList regions = endStructuredDocumentRegion.getRegions();
-		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_NAME || isNestedTag(regionType)) {
-				if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_END_TAG_OPEN) {
-					removeTailingSpaces(endStructuredDocumentRegion, prevRegion);
-				}
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_CLOSE) {
-				if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_NAME || isNestedRootTag(prevRegion.getType()))) {
-					removeTailingSpaces(endStructuredDocumentRegion, prevRegion);
-				}
-			}
-			prevRegion = region;
-		}
-		if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_NAME || isNestedRootTag(prevRegion.getType()))) {
-			removeTailingSpaces(endStructuredDocumentRegion, prevRegion);
-		}
-
-		String newEndTag = endStructuredDocumentRegion.getText();
-		if (newEndTag != null && newEndTag.length() > 0) {
-			setWidth(contraints, newEndTag);
-		}
-	}
-
-	/**
-	 */
-	protected void formatNode(IDOMNode node, HTMLFormatContraints contraints) {
-		if (node == null)
-			return;
-		IDOMElement element = (IDOMElement) node;
-
-		formatStartTag(element, contraints);
-
-		formatChildNodes(element, contraints);
-
-		formatEndTag(element, contraints);
-	}
-
-	/**
-	 */
-	private void formatStartTag(IDOMElement element, HTMLFormatContraints contraints) {
-		IStructuredDocumentRegion startStructuredDocumentRegion = element.getStartStructuredDocumentRegion();
-		if (startStructuredDocumentRegion == null)
-			return;
-
-		// We should format attributes in JSPTag?
-		// if (element.isJSPTag() || element.isCommentTag()) {
-		if (element.isCommentTag()) {
-			String startTag = startStructuredDocumentRegion.getText();
-			if (startTag != null && startTag.length() > 0) {
-				setWidth(contraints, startTag);
-			}
-			return;
-		}
-
-		// first process style attribute
-		if (element.isGlobalTag()) {
-			Attr attr = element.getAttributeNode("style");//$NON-NLS-1$
-			if (attr != null)
-				formatStyleAttr(attr);
-		}
-		boolean insertBreak = false;
-		insertBreak = ((IStructuredFormatPreferencesXML) getFormatPreferences()).getSplitMultiAttrs();
-
-		if (insertBreak) {
-			NamedNodeMap attributes = element.getAttributes();
-			if (attributes == null || attributes.getLength() < 2)
-				insertBreak = false;
-		}
-		String breakSpaces = getBreakSpaces(element);
-		String indent = getIndent();
-		if (indent != null && indent.length() > 0) {
-			breakSpaces += indent;
-		}
-		ITextRegion lastBreakRegion = null;
-
-		ITextRegion prevRegion = null;
-		ITextRegionList regions = startStructuredDocumentRegion.getRegions();
-		Iterator e = regions.iterator();
-		while (e.hasNext()) {
-			ITextRegion region = (ITextRegion) e.next();
-			if (region == null)
-				continue;
-
-			ITextRegion breakRegion = null;
-
-			String regionType = region.getType();
-			if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTag(regionType)) {
-				if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_TAG_OPEN) {
-					removeTailingSpaces(startStructuredDocumentRegion, prevRegion);
-				}
-				breakRegion = region;
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-				if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS)) {
-					// attribute name without value
-					breakRegion = prevRegion;
-				}
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
-				if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-					removeTailingSpaces(startStructuredDocumentRegion, prevRegion);
-				}
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-				if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
-					removeTailingSpaces(startStructuredDocumentRegion, prevRegion);
-				}
-				breakRegion = region;
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_CLOSE || regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-				if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS)) {
-					// attribute name without value
-					breakRegion = prevRegion;
-				}
-			}
-
-			if (breakRegion != null) {
-				int end = breakRegion.getTextEnd();
-				if (lastBreakRegion != null) {
-					int offset = lastBreakRegion.getEnd();
-					int count = end - offset;
-					if (insertBreak || !isWidthAvailable(contraints, count + 1)) {
-						replaceTailingSpaces(startStructuredDocumentRegion, lastBreakRegion, breakSpaces);
-						setWidth(contraints, breakSpaces);
-					}
-					else {
-						compressTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
-						addWidth(contraints, 1);
-					}
-					addWidth(contraints, count);
-				}
-				else {
-					addWidth(contraints, end);
-				}
-				lastBreakRegion = breakRegion;
-			}
-
-			prevRegion = region;
-		}
-		if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS)) {
-			// attribute name without value
-			int end = prevRegion.getTextEnd();
-			if (lastBreakRegion != null) {
-				int offset = lastBreakRegion.getEnd();
-				int count = end - offset;
-				if (insertBreak || !isWidthAvailable(contraints, count + 1)) {
-					replaceTailingSpaces(startStructuredDocumentRegion, lastBreakRegion, breakSpaces);
-					setWidth(contraints, breakSpaces);
-				}
-				else {
-					compressTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
-					addWidth(contraints, 1);
-				}
-				addWidth(contraints, count);
-			}
-			else {
-				addWidth(contraints, end);
-			}
-			lastBreakRegion = prevRegion;
-		}
-
-		if (lastBreakRegion != null) {
-			int offset = lastBreakRegion.getTextEnd();
-			int count = startStructuredDocumentRegion.getLength() - offset;
-			if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-				compressTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
-				count++;
-			}
-			else
-				removeTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
-			addWidth(contraints, count);
-		}
-		else {
-			addWidth(contraints, startStructuredDocumentRegion.getLength());
-		}
-	}
-
-	/**
-	 * 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 isNestedTag(String regionType) {
-		final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
-		final String JSP_DIRECTIVE_NAME = "JSP_DIRECTIVE_NAME"; //$NON-NLS-1$
-		boolean result = regionType.equals(JSP_ROOT_TAG_NAME) || regionType.equals(JSP_DIRECTIVE_NAME);
-		return result;
-	}
-
-	/**
-	 * 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 isNestedRootTag(String regionType) {
-		final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
-		boolean result = regionType.equals(JSP_ROOT_TAG_NAME);
-		return result;
-	}
-
-
-	/**
-	 */
-	private void formatStyleAttr(Attr attr) {
-		if (attr == null)
-			return;
-		String value = getCSSValue(attr);
-		if (value == null)
-			return;
-		String oldValue = ((IDOMNode) attr).getValueSource();
-		if (oldValue != null && value.equals(oldValue))
-			return;
-		attr.setValue(value);
-	}
-
-	/**
-	 */
-	private ICSSModel getCSSModel(Attr attr) {
-		if (attr == null)
-			return null;
-		INodeNotifier notifier = (INodeNotifier) attr.getOwnerElement();
-		if (notifier == null)
-			return null;
-		INodeAdapter adapter = notifier.getAdapterFor(IStyleDeclarationAdapter.class);
-		if (adapter == null)
-			return null;
-		if (!(adapter instanceof IStyleDeclarationAdapter))
-			return null;
-		IStyleDeclarationAdapter styleAdapter = (IStyleDeclarationAdapter) adapter;
-		return styleAdapter.getModel();
-	}
-
-	/**
-	 */
-	private String getCSSValue(Attr attr) {
-		ICSSModel model = getCSSModel(attr);
-		if (model == null)
-			return null;
-		ICSSNode document = model.getDocument();
-		if (document == null)
-			return null;
-		INodeNotifier notifier = (INodeNotifier) document;
-		INodeAdapter adapter = notifier.getAdapterFor(CSSSourceFormatter.class);
-		if (adapter == null)
-			return null;
-		CSSSourceFormatter formatter = (CSSSourceFormatter) adapter;
-		StringBuffer buffer = formatter.format(document);
-		if (buffer == null)
-			return null;
-		return buffer.toString();
-	}
-
-	/**
-	 */
-	private void removeTailingSpaces(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		int offset = region.getTextEnd();
-		int count = region.getEnd() - offset;
-		if (count <= 0)
-			return;
-		replaceSource(flatNode, offset, count, null);
-	}
-
-	/**
-	 */
-	private void replaceTailingSpaces(IStructuredDocumentRegion flatNode, ITextRegion region, String spaces) {
-		int offset = region.getTextEnd();
-		int count = region.getEnd() - offset;
-		if (count == spaces.length()) {
-			String source = flatNode.getFullText(region);
-			if (source != null && source.endsWith(spaces)) {
-				// nothing to do
-				return;
-			}
-		}
-		replaceSource(flatNode, offset, count, spaces);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatContraintsImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatContraintsImpl.java
deleted file mode 100644
index c650384..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatContraintsImpl.java
+++ /dev/null
@@ -1,42 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-import org.eclipse.wst.sse.core.internal.format.StructuredFormatContraints;
-
-/**
- * @deprecated
- * Please un-deprecate this if Page Designer thinks they are needed.
- */
-public class HTMLFormatContraintsImpl extends StructuredFormatContraints implements HTMLFormatContraints {
-	protected int fAvailableLineWidth;
-
-	/**
-	 * @deprecated
-	 * 	It's very hard to keep the available line width accurate.
-	 * 	Sometimes a node wants to start on a new line, sometimes it doesn't.
-	 * 	It's best for the node to figure out the available line width on the fly.
-	 */
-	public int getAvailableLineWidth() {
-		return fAvailableLineWidth;
-	}
-
-	/**
-	 * @deprecated
-	 * 	It's very hard to keep the available line width accurate.
-	 * 	Sometimes a node wants to start on a new line, sometimes it doesn't.
-	 * 	It's best for the node to figure out the available line width on the fly.
-	 */
-	public void setAvailableLineWidth(int availableLineWidth) {
-		fAvailableLineWidth = availableLineWidth;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatProcessorImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatProcessorImpl.java
deleted file mode 100644
index 0665cc4..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatProcessorImpl.java
+++ /dev/null
@@ -1,61 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-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.provisional.format.FormatProcessorXML;
-import org.eclipse.wst.xml.core.internal.provisional.format.IStructuredFormatPreferencesXML;
-import org.eclipse.wst.xml.core.internal.provisional.format.StructuredFormatPreferencesXML;
-import org.w3c.dom.Node;
-
-public class HTMLFormatProcessorImpl extends FormatProcessorXML {
-	protected String getFileExtension() {
-		return "html"; //$NON-NLS-1$
-	}
-
-	protected IStructuredFormatter getFormatter(Node node) {
-		IStructuredFormatter formatter = HTMLFormatterFactory.getInstance().createFormatter(node, getFormatPreferences());
-
-		return formatter;
-	}
-
-	public IStructuredFormatPreferences getFormatPreferences() {
-		if (fFormatPreferences == null) {
-			fFormatPreferences = new StructuredFormatPreferencesXML();
-
-			Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
-			if (preferences != null) {
-				fFormatPreferences.setLineWidth(preferences.getInt(HTMLCorePreferenceNames.LINE_WIDTH));
-				((IStructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
-				fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
-				char indentChar = ' ';
-				String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
-				if (HTMLCorePreferenceNames.TAB.equals(indentCharPref)) {
-					indentChar = '\t';
-				}
-				int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
-
-				StringBuffer indent = new StringBuffer();
-				for (int i = 0; i < indentationWidth; i++) {
-					indent.append(indentChar);
-				}
-				fFormatPreferences.setIndent(indent.toString());
-			}
-		}
-
-		return fFormatPreferences;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatter.java
deleted file mode 100644
index 6333ccf..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatter.java
+++ /dev/null
@@ -1,651 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.BadLocationException;
-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.HTMLCMProperties;
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-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.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-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.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.format.IStructuredFormatPreferencesXML;
-import org.eclipse.wst.xml.core.internal.provisional.format.StructuredFormatPreferencesXML;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class HTMLFormatter implements IStructuredFormatter {
-
-	private static final String HTML_NAME = "html";//$NON-NLS-1$
-	private static final String BODY_NAME = "BODY";//$NON-NLS-1$
-
-	/**
-	 */
-	protected void addWidth(HTMLFormatContraints contraints, int width) {
-		if (contraints == null)
-			return;
-		if (!splitLines() || getLineWidth() < 0)
-			return;
-
-		int availableWidth = contraints.getAvailableLineWidth() - width;
-		if (availableWidth < 0)
-			availableWidth = 0;
-		contraints.setAvailableLineWidth(availableWidth);
-	}
-
-	/**
-	 */
-	protected boolean canFormatChild(Node node) {
-		while (node != null) {
-			if (node.getNodeType() != Node.ELEMENT_NODE)
-				return true;
-			CMElementDeclaration decl = getElementDeclaration((Element) node);
-			if (decl != null) {
-				if (decl.getContentType() == CMElementDeclaration.CDATA)
-					return false;
-				if (decl.supports(HTMLCMProperties.SHOULD_KEEP_SPACE)) {
-					boolean shouldKeepSpace = ((Boolean) decl.getProperty(HTMLCMProperties.SHOULD_KEEP_SPACE)).booleanValue();
-					if (shouldKeepSpace)
-						return false;
-				}
-			}
-			node = node.getParentNode();
-		}
-		return false;
-	}
-
-	/**
-	 */
-	protected boolean canInsertBreakAfter(CMElementDeclaration decl) {
-		if (decl == null)
-			return false;
-		if (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT))
-			return false;
-		String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT);
-		if (hint == null)
-			return false;
-		return (hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END) || hint.equals(HTMLCMProperties.Values.BREAK_AFTER_START));
-	}
-
-	/**
-	 */
-	protected boolean canInsertBreakAfter(Node node) {
-		if (node == null)
-			return false;
-		Node parent = node.getParentNode();
-		if (parent == null)
-			return false;
-		Node next = node.getNextSibling();
-
-		if (parent.getNodeType() == Node.DOCUMENT_NODE) {
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				// do not insert break after unclosed tag
-				if (!((IDOMElement) node).isClosed())
-					return false;
-			}
-			return true;
-		}
-		else if (parent.getNodeType() == Node.ELEMENT_NODE) {
-			IDOMElement element = (IDOMElement) parent;
-			// do not insert break before missing end tag
-			if (next == null && element.getEndStructuredDocumentRegion() == null)
-				return false;
-
-			// insert line break under non-HTML elements including JSP elements
-			if (element.getPrefix() != null)
-				return true;
-
-			CMElementDeclaration decl = getElementDeclaration(element);
-			if (decl != null) {
-				if (decl.getContentType() == CMElementDeclaration.ELEMENT)
-					return true;
-				String tagName = element.getTagName();
-				// special for direct children under BODY
-				if (tagName != null && tagName.equalsIgnoreCase(BODY_NAME))
-					return true;
-			}
-		}
-
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			IDOMElement element = (IDOMElement) node;
-			CMElementDeclaration decl = getElementDeclaration(element);
-			if (canInsertBreakAfter(decl)) {
-				// spcial for BR
-				return canFormatChild(parent);
-			}
-		}
-		if (next != null && next.getNodeType() == Node.ELEMENT_NODE) {
-			CMElementDeclaration decl = getElementDeclaration((Element) next);
-			if (canInsertBreakBefore(decl))
-				return true;
-		}
-		return false;
-	}
-
-	/**
-	 */
-	protected boolean canInsertBreakBefore(CMElementDeclaration decl) {
-		if (decl == null)
-			return false;
-		if (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT))
-			return false;
-		String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT);
-		if (hint == null)
-			return false;
-		return hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END);
-	}
-
-	/**
-	 */
-	protected boolean canInsertBreakBefore(Node node) {
-		if (node == null)
-			return false;
-		Node parent = node.getParentNode();
-		if (parent == null)
-			return false;
-		Node prev = node.getPreviousSibling();
-
-		if (parent.getNodeType() == Node.DOCUMENT_NODE) {
-			if (prev == null)
-				return false;
-			return true;
-		}
-		else if (parent.getNodeType() == Node.ELEMENT_NODE) {
-			IDOMElement element = (IDOMElement) parent;
-			// do not insert break after missing start tag
-			if (prev == null && element.getStartStructuredDocumentRegion() == null)
-				return false;
-
-			// insert line break under non-HTML elements including JSP elements
-			if (element.getPrefix() != null)
-				return true;
-
-			CMElementDeclaration decl = getElementDeclaration(element);
-			if (decl != null) {
-				if (decl.getContentType() == CMElementDeclaration.ELEMENT)
-					return true;
-				String tagName = element.getTagName();
-				// special for direct children under BODY
-				if (tagName != null && tagName.equalsIgnoreCase(BODY_NAME))
-					return true;
-			}
-		}
-
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			CMElementDeclaration decl = getElementDeclaration((Element) node);
-			if (canInsertBreakBefore(decl))
-				return true;
-		}
-		if (prev != null && prev.getNodeType() == Node.ELEMENT_NODE) {
-			CMElementDeclaration decl = getElementDeclaration((Element) prev);
-			if (canInsertBreakAfter(decl)) {
-				// spcial for BR
-				return canFormatChild(parent);
-			}
-		}
-		return false;
-	}
-
-	/**
-	 */
-	public void format(Node node) {
-		format(node, getFormatContraints());
-	}
-
-	/**
-	 */
-	public void format(Node node, IStructuredFormatContraints contraints) {
-		if (node instanceof IDOMNode && contraints instanceof HTMLFormatContraints)
-			format((IDOMNode) node, (HTMLFormatContraints) contraints);
-	}
-
-	public void format(IDOMNode node, HTMLFormatContraints contraints) {
-		if (node == null)
-			return;
-		if (node.getParentNode() == null)
-			return; // do not format removed node
-
-		setWidth(contraints, node);
-
-		if (canInsertBreakBefore(node))
-			insertBreakBefore(node, contraints);
-
-		formatNode(node, contraints);
-
-		if (canInsertBreakAfter(node))
-			insertBreakAfter(node, contraints);
-	}
-
-	/**
-	 */
-	protected void formatChildNodes(IDOMNode node, HTMLFormatContraints contraints) {
-		if (node == null)
-			return;
-		if (!node.hasChildNodes())
-			return;
-
-		// concat adjacent texts
-		node.normalize();
-
-		// disable sibling indent during formatting all the children
-		boolean indent = false;
-		if (contraints != null) {
-			indent = contraints.getFormatWithSiblingIndent();
-			contraints.setFormatWithSiblingIndent(false);
-		}
-
-		boolean insertBreak = true;
-		IDOMNode child = (IDOMNode) node.getFirstChild();
-		while (child != null) {
-			if (child.getParentNode() != node)
-				break;
-			IDOMNode next = (IDOMNode) child.getNextSibling();
-
-			if (insertBreak && canInsertBreakBefore(child)) {
-				insertBreakBefore(child, contraints);
-			}
-
-			IStructuredFormatter formatter = HTMLFormatterFactory.getInstance().createFormatter(child, getFormatPreferences());
-			if (formatter != null) {
-				if (formatter instanceof HTMLFormatter) {
-					HTMLFormatter htmlFormatter = (HTMLFormatter) formatter;
-					htmlFormatter.formatNode(child, contraints);
-				}
-				else {
-					formatter.format(child);
-				}
-			}
-
-			if (canInsertBreakAfter(child)) {
-				insertBreakAfter(child, contraints);
-				insertBreak = false; // not to insert twice
-			}
-			else {
-				insertBreak = true;
-			}
-
-			child = next;
-		}
-
-		if (contraints != null)
-			contraints.setFormatWithSiblingIndent(indent);
-	}
-
-	/**
-	 */
-	protected void formatNode(IDOMNode node, HTMLFormatContraints contraints) {
-		if (node == null)
-			return;
-
-		if (node.hasChildNodes()) { // container
-			formatChildNodes(node, contraints);
-		}
-		else { // leaf
-			IStructuredDocumentRegion flatNode = node.getStartStructuredDocumentRegion();
-			if (flatNode != null) {
-				String source = flatNode.getText();
-				if (source != null && source.length() > 0) {
-					setWidth(contraints, source);
-				}
-			}
-		}
-	}
-
-	/**
-	 */
-	protected String getBreakSpaces(Node node) {
-		if (node == null)
-			return null;
-		StringBuffer buffer = new StringBuffer();
-
-		String delim = ((IDOMNode) node).getModel().getStructuredDocument().getLineDelimiter();
-		if (delim != null && delim.length() > 0)
-			buffer.append(delim);
-
-		String indent = getIndent();
-		if (indent != null && indent.length() > 0) {
-			for (Node parent = node.getParentNode(); parent != null; parent = parent.getParentNode()) {
-				if (parent.getNodeType() != Node.ELEMENT_NODE)
-					break;
-				// ignore omitted tag
-				if (((IDOMNode) parent).getStartStructuredDocumentRegion() == null)
-					continue;
-
-				IDOMElement element = (IDOMElement) parent;
-				if (element.getPrefix() != null) {
-					String localName = element.getLocalName();
-					// special for html:html
-					if (localName != null && !localName.equals(HTML_NAME)) {
-						buffer.append(indent);
-					}
-					continue;
-				}
-
-				CMElementDeclaration decl = getElementDeclaration(element);
-				if (decl != null && decl.supports(HTMLCMProperties.SHOULD_INDENT_CHILD_SOURCE)) {
-					boolean shouldIndent = ((Boolean) decl.getProperty(HTMLCMProperties.SHOULD_INDENT_CHILD_SOURCE)).booleanValue();
-					if (shouldIndent)
-						buffer.append(indent);
-				}
-
-			}
-		}
-
-		return buffer.toString();
-	}
-
-	/**
-	 */
-	protected String getIndent() {
-		return getFormatPreferences().getIndent();
-	}
-
-	/**
-	 */
-	protected int getLineWidth() {
-		return getFormatPreferences().getLineWidth();
-	}
-
-	/**
-	 */
-	protected CMElementDeclaration getElementDeclaration(Element element) {
-		if (element == null)
-			return null;
-		Document document = element.getOwnerDocument();
-		if (document == null)
-			return null;
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
-		if (modelQuery == null)
-			return null;
-		return modelQuery.getCMElementDeclaration(element);
-	}
-
-	/**
-	 */
-	protected void insertBreakAfter(IDOMNode node, HTMLFormatContraints contraints) {
-		if (node == null)
-			return;
-		if (node.getNodeType() == Node.TEXT_NODE)
-			return;
-		Node parent = node.getParentNode();
-		if (parent == null)
-			return;
-		Node next = node.getNextSibling();
-
-		String spaces = null;
-		if (next == null) { // last spaces
-			// use parent indent for the end tag
-			spaces = getBreakSpaces(parent);
-		}
-		else if (next.getNodeType() == Node.TEXT_NODE) {
-			if (contraints != null && contraints.getFormatWithSiblingIndent()) {
-				IDOMNode text = (IDOMNode) next;
-				IStructuredFormatter formatter = HTMLFormatterFactory.getInstance().createFormatter(text, getFormatPreferences());
-				if (formatter instanceof HTMLTextFormatter) {
-					HTMLTextFormatter textFormatter = (HTMLTextFormatter) formatter;
-					textFormatter.formatText(text, contraints, HTMLTextFormatter.FORMAT_HEAD);
-				}
-			}
-			return;
-		}
-		else {
-			spaces = getBreakSpaces(node);
-		}
-		if (spaces == null || spaces.length() == 0)
-			return;
-
-		replaceSource(node.getModel(), node.getEndOffset(), 0, spaces);
-		setWidth(contraints, spaces);
-	}
-
-	/**
-	 */
-	protected void insertBreakBefore(IDOMNode node, HTMLFormatContraints contraints) {
-		if (node == null)
-			return;
-		if (node.getNodeType() == Node.TEXT_NODE)
-			return;
-		Node parent = node.getParentNode();
-		if (parent == null)
-			return;
-		Node prev = node.getPreviousSibling();
-
-		String spaces = null;
-		if (prev != null && prev.getNodeType() == Node.TEXT_NODE) {
-			if (contraints != null && contraints.getFormatWithSiblingIndent()) {
-				IDOMNode text = (IDOMNode) prev;
-				IStructuredFormatter formatter = HTMLFormatterFactory.getInstance().createFormatter(text, getFormatPreferences());
-				if (formatter instanceof HTMLTextFormatter) {
-					HTMLTextFormatter textFormatter = (HTMLTextFormatter) formatter;
-					textFormatter.formatText(text, contraints, HTMLTextFormatter.FORMAT_TAIL);
-				}
-			}
-			return;
-		}
-		else {
-			spaces = getBreakSpaces(node);
-		}
-		if (spaces == null || spaces.length() == 0)
-			return;
-
-		replaceSource(node.getModel(), node.getStartOffset(), 0, spaces);
-		setWidth(contraints, spaces);
-	}
-
-	/**
-	 */
-	protected boolean isWidthAvailable(HTMLFormatContraints contraints, int width) {
-		if (contraints == null)
-			return true;
-		if (!splitLines() || getLineWidth() < 0)
-			return true;
-		return (contraints.getAvailableLineWidth() >= width);
-	}
-
-	/**
-	 */
-	protected boolean keepBlankLines(HTMLFormatContraints contraints) {
-		if (contraints == null)
-			return true;
-		return (!contraints.getClearAllBlankLines());
-	}
-
-	/**
-	 */
-	protected void replaceSource(IStructuredDocumentRegion flatNode, int offset, int length, String source) {
-		if (flatNode == null)
-			return;
-		IStructuredDocument structuredDocument = flatNode.getParentDocument();
-		if (structuredDocument == null)
-			return;
-		if (source == null)
-			source = new String();
-		int startOffset = flatNode.getStartOffset();
-		if (structuredDocument.containsReadOnly(startOffset + offset, length))
-			return;
-		// We use 'structuredDocument' as the requester object just so this and the other
-		// format-related 'repalceText' (in replaceSource) can use the same requester.
-		// Otherwise, if requester is not identical, 
-		// the undo group gets "broken" into multiple pieces based
-		// on the requesters being different. Technically, any unique, common
-		// requester object would work.
-		structuredDocument.replaceText(structuredDocument, startOffset + offset, length, source);
-	}
-
-	/**
-	 */
-	protected void replaceSource(IDOMModel model, int offset, int length, String source) {
-		if (model == null)
-			return;
-		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
-			return;
-		if (source == null)
-			source = new String();
-		if (structuredDocument.containsReadOnly(offset, length))
-			return;
-		// We use 'structuredDocument' as the requester object just so this and the other
-		// format-related 'repalceText' (in replaceSource) can use the same requester.
-		// Otherwise, if requester is not identical, 
-		// the undo group gets "broken" into multiple pieces based
-		// on the requesters being different. Technically, any unique, common
-		// requester object would work. 
-		structuredDocument.replaceText(structuredDocument, offset, length, source);
-	}
-
-	/**
-	 */
-	protected void setWidth(HTMLFormatContraints contraints, String source) {
-		if (contraints == null)
-			return;
-		if (source == null)
-			return;
-		int length = source.length();
-		if (length == 0)
-			return;
-
-		if (!splitLines())
-			return;
-		int lineWidth = getLineWidth();
-		if (lineWidth < 0)
-			return;
-
-		int offset = source.lastIndexOf('\n');
-		int offset2 = source.lastIndexOf('\r');
-		if (offset2 > offset)
-			offset = offset2;
-		if (offset >= 0)
-			offset++;
-
-		int availableWidth = 0;
-		if (offset >= 0) {
-			availableWidth = lineWidth - (length - offset);
-		}
-		else {
-			availableWidth = contraints.getAvailableLineWidth() - length;
-		}
-		if (availableWidth < 0)
-			availableWidth = 0;
-		contraints.setAvailableLineWidth(availableWidth);
-	}
-
-	/**
-	 */
-	protected void setWidth(HTMLFormatContraints contraints, Node node) {
-		if (contraints == null)
-			return;
-		if (node == null)
-			return;
-		IStructuredDocument structuredDocument = ((IDOMNode) node).getStructuredDocument();
-		if (structuredDocument == null)
-			return; // error
-
-		if (!splitLines())
-			return;
-		int lineWidth = getLineWidth();
-		if (lineWidth < 0)
-			return;
-
-		int offset = ((IDOMNode) node).getStartOffset();
-		int line = structuredDocument.getLineOfOffset(offset);
-		int lineOffset = 0;
-		try {
-			lineOffset = structuredDocument.getLineOffset(line);
-		}
-		catch (BadLocationException ex) {
-			return; // error
-		}
-		if (lineOffset > offset)
-			return; // error
-
-		int availableWidth = lineWidth - (offset - lineOffset);
-		if (availableWidth < 0)
-			availableWidth = 0;
-
-		contraints.setAvailableLineWidth(availableWidth);
-	}
-
-	/**
-	 */
-	protected boolean splitLines() {
-		return true;//getFormatPreferences().getSplitLines();
-	}
-
-	protected IStructuredFormatPreferences fFormatPreferences = null;
-	protected HTMLFormatContraints fFormatContraints = null;
-	protected IProgressMonitor fProgressMonitor = null;
-
-	//public void format(XMLNode node, FormatContraints formatContraints) {
-	//	if (formatContraints.getFormatWithSiblingIndent())
-	//		formatContraints.setCurrentIndent(getSiblingIndent(node));
-	//
-	//	formatNode(node, formatContraints);
-	//}
-
-	public void setFormatPreferences(IStructuredFormatPreferences formatPreferences) {
-		fFormatPreferences = formatPreferences;
-	}
-
-	public IStructuredFormatPreferences getFormatPreferences() {
-		if (fFormatPreferences == null) {
-			fFormatPreferences = new StructuredFormatPreferencesXML();
-
-			Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
-			if (preferences != null) {
-				fFormatPreferences.setLineWidth(preferences.getInt(HTMLCorePreferenceNames.LINE_WIDTH));
-				((IStructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
-				fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
-				char indentChar = ' ';
-				String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
-				if (HTMLCorePreferenceNames.TAB.equals(indentCharPref)) {
-					indentChar = '\t';
-				}
-				int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
-
-				StringBuffer indent = new StringBuffer();
-				for (int i = 0; i < indentationWidth; i++) {
-					indent.append(indentChar);
-				}
-				fFormatPreferences.setIndent(indent.toString());
-			}
-		}
-
-		return fFormatPreferences;
-	}
-
-	public IStructuredFormatContraints getFormatContraints() {
-		if (fFormatContraints == null) {
-			fFormatContraints = new HTMLFormatContraintsImpl();
-
-			fFormatContraints.setAvailableLineWidth(getFormatPreferences().getLineWidth());
-			fFormatContraints.setClearAllBlankLines(getFormatPreferences().getClearAllBlankLines());
-		}
-
-		return fFormatContraints;
-	}
-
-	public void setProgressMonitor(IProgressMonitor progressMonitor) {
-		fProgressMonitor = progressMonitor;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatterFactory.java
deleted file mode 100644
index b17c60a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatterFactory.java
+++ /dev/null
@@ -1,109 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-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.provisional.format.IStructuredFormatPreferencesXML;
-import org.eclipse.wst.xml.core.internal.provisional.format.StructuredFormatPreferencesXML;
-import org.w3c.dom.Node;
-
-// nakamori_TODO: check and remove CSS formatting
-
-class HTMLFormatterFactory {
-	private static HTMLFormatterFactory fInstance = null;
-	protected IStructuredFormatPreferencesXML fFormatPreferences = null;
-
-	static synchronized HTMLFormatterFactory getInstance() {
-		if (fInstance == null) {
-			fInstance = new HTMLFormatterFactory();
-		}
-		return fInstance;
-	}
-
-	protected IStructuredFormatter createFormatter(Node node, IStructuredFormatPreferences formatPreferences) {
-		IStructuredFormatter formatter = null;
-
-		switch (node.getNodeType()) {
-			case Node.ELEMENT_NODE :
-				formatter = new HTMLElementFormatter();
-				break;
-			case Node.TEXT_NODE :
-				if (isEmbeddedCSS(node)) {
-					formatter = new EmbeddedCSSFormatter();
-				}
-				else {
-					formatter = new HTMLTextFormatter();
-				}
-				break;
-			default :
-				formatter = new HTMLFormatter();
-				break;
-		}
-
-		// init FormatPreferences
-		formatter.setFormatPreferences(formatPreferences);
-
-		return formatter;
-	}
-
-	/**
-	 */
-	private boolean isEmbeddedCSS(Node node) {
-		if (node == null)
-			return false;
-		Node parent = node.getParentNode();
-		if (parent == null)
-			return false;
-		if (parent.getNodeType() != Node.ELEMENT_NODE)
-			return false;
-		String name = parent.getNodeName();
-		if (name == null)
-			return false;
-		return name.equalsIgnoreCase("STYLE");//$NON-NLS-1$
-	}
-
-
-	private HTMLFormatterFactory() {
-		super();
-	}
-
-	protected IStructuredFormatPreferencesXML getFormatPreferences() {
-		if (fFormatPreferences == null) {
-			fFormatPreferences = new StructuredFormatPreferencesXML();
-
-			Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
-			if (preferences != null) {
-				fFormatPreferences.setLineWidth(preferences.getInt(HTMLCorePreferenceNames.LINE_WIDTH));
-				fFormatPreferences.setSplitMultiAttrs(preferences.getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
-				fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
-				char indentChar = ' ';
-				String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
-				if (HTMLCorePreferenceNames.TAB.equals(indentCharPref)) {
-					indentChar = '\t';
-				}
-				int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
-
-				StringBuffer indent = new StringBuffer();
-				for (int i = 0; i < indentationWidth; i++) {
-					indent.append(indentChar);
-				}
-				fFormatPreferences.setIndent(indent.toString());
-			}
-		}
-
-		return fFormatPreferences;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java
deleted file mode 100644
index a152f82..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java
+++ /dev/null
@@ -1,299 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-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.Element;
-import org.w3c.dom.Node;
-
-public class HTMLTextFormatter extends HTMLFormatter {
-
-	public static int FORMAT_ALL = 0;
-	public static int FORMAT_HEAD = 1;
-	public static int FORMAT_TAIL = 2;
-
-	/**
-	 */
-	protected HTMLTextFormatter() {
-		super();
-	}
-
-	/**
-	 */
-	private boolean canFormatText(IDOMText text) {
-		if (text == null)
-			return false;
-
-		IStructuredDocumentRegion flatNode = text.getFirstStructuredDocumentRegion();
-		if (flatNode != null) {
-			String type = flatNode.getType();
-			if (isUnparsedRegion(type))
-				return false;
-		}
-
-		Node parent = text.getParentNode();
-		if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
-			IDOMElement element = (IDOMElement) parent;
-			if (!element.isGlobalTag() && !text.isElementContentWhitespace())
-				return false;
-		}
-
-		return canFormatChild(parent);
-	}
-
-	private boolean isUnparsedRegion(String type) {
-		boolean result = isNestedScannedRegion(type) || isBlockScannedRegion(type);
-		return result;
-	}
-
-	private boolean isBlockScannedRegion(String type) {
-		return type == DOMRegionContext.BLOCK_TEXT;
-	}
-
-	/**
-	 * 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 isNestedScannedRegion(String type) {
-		final String JSP_CONTENT = "JSP_CONTENT"; //$NON-NLS-1$
-		return type.equals(JSP_CONTENT);
-	}
-
-	/**
-	 */
-	private boolean canRemoveHeadingSpaces(IDOMNode node) {
-		if (node == null)
-			return false;
-		if (node.getPreviousSibling() != null)
-			return false;
-		Node parent = node.getParentNode();
-		if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE)
-			return false;
-
-		CMElementDeclaration decl = getElementDeclaration((Element) parent);
-		if (decl == null || (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT)))
-			return false;
-		String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT);
-		return hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END);
-	}
-
-	/**
-	 */
-	private boolean canRemoveTailingSpaces(IDOMNode node) {
-		if (node == null)
-			return false;
-		if (node.getNextSibling() != null)
-			return false;
-		Node parent = node.getParentNode();
-		if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE)
-			return false;
-
-		CMElementDeclaration decl = getElementDeclaration((Element) parent);
-		if (decl == null || (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT)))
-			return false;
-		String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT);
-		return hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END);
-	}
-
-	/**
-	 */
-	protected void formatNode(IDOMNode node, HTMLFormatContraints contraints) {
-		formatText(node, contraints, FORMAT_ALL); // full format
-	}
-
-	/**
-	 */
-	protected void formatText(IDOMNode node, HTMLFormatContraints contraints, int mode) {
-		if (node == null)
-			return;
-		Node parent = node.getParentNode();
-		if (parent == null)
-			return;
-
-		IDOMText text = (IDOMText) node;
-		String source = text.getSource();
-
-		if (!canFormatText(text)) {
-			setWidth(contraints, source);
-			return;
-		}
-
-		int offset = text.getStartOffset();
-		int length = text.getEndOffset() - offset;
-
-		// format adjacent text at once
-		if (mode == FORMAT_HEAD) {
-			Node next = node.getNextSibling();
-			while (next != null && next.getNodeType() == Node.TEXT_NODE) {
-				IDOMText nextText = (IDOMText) next;
-				length += (nextText.getEndOffset() - nextText.getStartOffset());
-				String nextSource = nextText.getSource();
-				if (nextSource != null && nextSource.length() > 0) {
-					if (source == null)
-						source = nextSource;
-					else
-						source += nextSource;
-				}
-				next = next.getNextSibling();
-			}
-		}
-		else if (mode == FORMAT_TAIL) {
-			Node prev = node.getPreviousSibling();
-			while (prev != null && prev.getNodeType() == Node.TEXT_NODE) {
-				IDOMText prevText = (IDOMText) prev;
-				offset = prevText.getStartOffset();
-				length += (prevText.getEndOffset() - offset);
-				String prevSource = prevText.getSource();
-				if (prevSource != null && prevSource.length() > 0) {
-					if (source == null)
-						source = prevSource;
-					else
-						source = prevSource + source;
-				}
-				prev = prev.getPreviousSibling();
-			}
-		}
-
-		SpaceConverter converter = new SpaceConverter(source, keepBlankLines(contraints));
-
-		int wordLength = converter.nextWord();
-		if (wordLength == 0) { // only spaces
-			if (!converter.hasSpaces())
-				return; // empty
-			boolean removeSpaces = false;
-			if (parent.getNodeType() == Node.ELEMENT_NODE) {
-				// check if tags are omitted
-				IDOMNode element = (IDOMNode) parent;
-				if (node.getPreviousSibling() == null && element.getStartStructuredDocumentRegion() == null) {
-					removeSpaces = true;
-				}
-				else if (node.getNextSibling() == null && element.getEndStructuredDocumentRegion() == null) {
-					removeSpaces = true;
-				}
-			}
-			if (removeSpaces) {
-				converter.replaceSpaces(null);
-			}
-			else if (!isWidthAvailable(contraints, 2) || canInsertBreakAfter(node) || canInsertBreakBefore(node)) {
-				String spaces = null;
-				if (node.getNextSibling() == null) { // last spaces
-					// use parent indent for the end tag
-					spaces = getBreakSpaces(parent);
-				}
-				else {
-					spaces = getBreakSpaces(node);
-				}
-				converter.replaceSpaces(spaces);
-				setWidth(contraints, spaces);
-			}
-			else if (canRemoveHeadingSpaces(node) || canRemoveTailingSpaces(node)) {
-				converter.replaceSpaces(null);
-			}
-			else {
-				converter.compressSpaces();
-				addWidth(contraints, 1);
-			}
-		}
-		else {
-			String breakSpaces = null;
-
-			// format heading spaces
-			boolean hasSpaces = converter.hasSpaces();
-			if (mode == FORMAT_TAIL) {
-				// keep spaces as is
-				addWidth(contraints, converter.getSpaceCount());
-			}
-			else if ((hasSpaces && !isWidthAvailable(contraints, wordLength + 1)) || canInsertBreakBefore(node)) {
-				breakSpaces = getBreakSpaces(node);
-				converter.replaceSpaces(breakSpaces);
-				setWidth(contraints, breakSpaces);
-			}
-			else {
-				if (hasSpaces) {
-					if (canRemoveHeadingSpaces(node)) {
-						converter.replaceSpaces(null);
-					}
-					else {
-						converter.compressSpaces();
-						addWidth(contraints, 1);
-					}
-				}
-			}
-			addWidth(contraints, wordLength);
-
-			// format middle
-			wordLength = converter.nextWord();
-			while (wordLength > 0) {
-				if (mode != FORMAT_ALL) {
-					// keep spaces as is
-					addWidth(contraints, converter.getSpaceCount());
-				}
-				else if (!isWidthAvailable(contraints, wordLength + 1)) {
-					if (breakSpaces == null)
-						breakSpaces = getBreakSpaces(node);
-					converter.replaceSpaces(breakSpaces);
-					setWidth(contraints, breakSpaces);
-				}
-				else {
-					converter.compressSpaces();
-					addWidth(contraints, 1);
-				}
-				addWidth(contraints, wordLength);
-				wordLength = converter.nextWord();
-			}
-
-			// format tailing spaces
-			hasSpaces = converter.hasSpaces();
-			if (mode == FORMAT_HEAD) {
-				// keep spaces as is
-				addWidth(contraints, converter.getSpaceCount());
-			}
-			else if ((hasSpaces && !isWidthAvailable(contraints, 2)) || canInsertBreakAfter(node)) {
-				if (node.getNextSibling() == null) { // last test
-					// use parent indent for the end tag
-					breakSpaces = getBreakSpaces(parent);
-				}
-				else {
-					if (breakSpaces == null)
-						breakSpaces = getBreakSpaces(node);
-				}
-				converter.replaceSpaces(breakSpaces);
-				setWidth(contraints, breakSpaces);
-			}
-			else {
-				if (hasSpaces) {
-					if (canRemoveTailingSpaces(node)) {
-						converter.replaceSpaces(null);
-					}
-					else {
-						converter.compressSpaces();
-						addWidth(contraints, 1);
-					}
-				}
-			}
-		}
-
-		if (converter.isModified()) {
-			source = converter.getSource();
-			replaceSource(text.getModel(), offset, length, source);
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/SpaceConverter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/SpaceConverter.java
deleted file mode 100644
index a7b6f66..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/SpaceConverter.java
+++ /dev/null
@@ -1,233 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-
-
-final class SpaceConverter {
-
-	private String source = null;
-	private int length = 0;
-	private int startOffset = 0;
-	private int endOffset = 0;
-	private int spaceCount = 0;
-	private int wordCount = 0;
-	private StringBuffer buffer = null;
-	private int lastOffset = 0;
-	private boolean keepBlankLines = false;
-
-	/**
-	 */
-	public SpaceConverter(String source) {
-		super();
-
-		if (source == null) {
-			this.source = new String();
-		}
-		else {
-			this.source = source;
-			this.length = source.length();
-		}
-	}
-
-	/**
-	 */
-	public SpaceConverter(String source, boolean keepBlankLines) {
-		super();
-
-		if (source == null) {
-			this.source = new String();
-		}
-		else {
-			this.source = source;
-			this.length = source.length();
-		}
-		this.keepBlankLines = keepBlankLines;
-	}
-
-	/**
-	 */
-	public void compressSpaces() {
-		if (this.spaceCount == 0)
-			return;
-		if (this.spaceCount == 1 && this.source.charAt(this.startOffset) == ' ')
-			return;
-
-		if (this.buffer == null)
-			this.buffer = new StringBuffer();
-		if (this.startOffset > this.lastOffset) {
-			this.buffer.append(this.source.substring(this.lastOffset, this.startOffset));
-		}
-
-		this.buffer.append(' ');
-
-		this.lastOffset = this.startOffset + this.spaceCount;
-	}
-
-	/**
-	 */
-	public String getSource() {
-		if (this.buffer == null)
-			this.buffer = new StringBuffer();
-		if (this.length > this.lastOffset) {
-			this.buffer.append(this.source.substring(this.lastOffset, this.length));
-		}
-		return this.buffer.toString();
-	}
-
-	/**
-	 */
-	public int getSpaceCount() {
-		return this.spaceCount;
-	}
-
-	/**
-	 */
-	public boolean hasSpaces() {
-		return (this.spaceCount > 0);
-	}
-
-	/**
-	 */
-	public boolean isModified() {
-		return (this.buffer != null);
-	}
-
-	/**
-	 * Add number of the old blank lines to new space string
-	 */
-	private static String mergeBlankLines(String newSpaces, String oldSpaces) {
-		if (newSpaces == null || newSpaces.length() == 0)
-			return newSpaces;
-		if (oldSpaces == null)
-			return newSpaces;
-
-		// count old new lines
-		int newLineCount = 0;
-		int oldLength = oldSpaces.length();
-		for (int i = 0; i < oldLength; i++) {
-			char c = oldSpaces.charAt(i);
-			if (c == '\r') {
-				newLineCount++;
-				if (i + 1 < oldLength) {
-					c = oldSpaces.charAt(i + 1);
-					if (c == '\n')
-						i++;
-				}
-			}
-			else {
-				if (c == '\n')
-					newLineCount++;
-			}
-		}
-		if (newLineCount < 2)
-			return newSpaces; // no blank line
-
-		// here assuming newSpaces starts with a new line if any
-		String delim = null;
-		char d = newSpaces.charAt(0);
-		if (d == '\r') {
-			if (newSpaces.length() > 1 && newSpaces.charAt(1) == '\n')
-				delim = "\r\n";//$NON-NLS-1$
-			else
-				delim = "\r";//$NON-NLS-1$
-		}
-		else {
-			if (d == '\n')
-				delim = "\n";//$NON-NLS-1$
-			else
-				return newSpaces; // no new line
-		}
-
-		newLineCount--;
-		StringBuffer buffer = new StringBuffer(newSpaces.length() + newLineCount * 2);
-		while (newLineCount > 0) {
-			buffer.append(delim);
-			newLineCount--;
-		}
-		buffer.append(newSpaces);
-		return buffer.toString();
-	}
-
-	/**
-	 */
-	public int nextWord() {
-		if (this.endOffset == this.length) {
-			this.startOffset = this.endOffset;
-			this.spaceCount = 0;
-			this.wordCount = 0;
-			return 0;
-		}
-
-		this.startOffset = this.endOffset;
-		int i = this.startOffset;
-		for (; i < this.length; i++) {
-			if (!Character.isWhitespace(this.source.charAt(i)))
-				break;
-		}
-		this.spaceCount = i - this.startOffset;
-
-		int wordOffset = i;
-		for (; i < this.length; i++) {
-			if (Character.isWhitespace(this.source.charAt(i)))
-				break;
-		}
-		this.wordCount = i - wordOffset;
-		this.endOffset = i;
-
-		return this.wordCount;
-	}
-
-	/**
-	 */
-	public void replaceSpaces(String spaces) {
-		int spaceLength = (spaces != null ? spaces.length() : 0);
-		String oldSpaces = null;
-		if (spaceLength == this.spaceCount) {
-			if (spaceLength == 0)
-				return;
-			if (this.startOffset == 0) {
-				if (this.source.startsWith(spaces))
-					return;
-			}
-			else if (this.endOffset == this.length) {
-				if (this.source.endsWith(spaces))
-					return;
-			}
-			else {
-				int textOffset = this.startOffset + this.spaceCount;
-				oldSpaces = this.source.substring(this.startOffset, textOffset);
-				if (oldSpaces.equals(spaces))
-					return;
-			}
-		}
-		if (this.keepBlankLines && this.spaceCount > 0) {
-			if (oldSpaces == null) {
-				int textOffset = this.startOffset + this.spaceCount;
-				oldSpaces = this.source.substring(this.startOffset, textOffset);
-			}
-			if (oldSpaces != null) {
-				spaces = mergeBlankLines(spaces, oldSpaces);
-			}
-		}
-
-		if (this.buffer == null)
-			this.buffer = new StringBuffer();
-		if (this.startOffset > this.lastOffset) {
-			this.buffer.append(this.source.substring(this.lastOffset, this.startOffset));
-		}
-
-		if (spaceLength > 0)
-			this.buffer.append(spaces);
-
-		this.lastOffset = this.startOffset + this.spaceCount;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java
deleted file mode 100644
index aa1be40..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java
+++ /dev/null
@@ -1,105 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.document.CSSModelImpl;
-import org.eclipse.wst.css.core.internal.provisional.adapters.ICSSModelAdapter;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-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.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-
-/**
- */
-public abstract class AbstractCSSModelAdapter implements ICSSModelAdapter {
-	private final static String CSS_ID = ContentTypeIdForCSS.ContentTypeID_CSS;
-
-	private Element element = null;
-	private ICSSModel model = null;
-
-	/**
-	 */
-	AbstractCSSModelAdapter() {
-		super();
-	}
-
-	/**
-	 */
-	protected ICSSModel createModel() {
-		// create embedded CSS model (not for external CSS)
-		if (getElement() == null)
-			return null;
-		IStructuredModel baseModel = ((IDOMNode) getElement()).getModel();
-		ICSSModel newModel = (ICSSModel) baseModel.getModelManager().createUnManagedStructuredModelFor(CSS_ID);
-		((CSSModelImpl) newModel).setOwnerDOMNode(getElement());
-		return newModel;
-	}
-
-	/**
-	 */
-	public Element getElement() {
-		return this.element;
-	}
-
-	/**
-	 */
-	protected ICSSModel getExistingModel() {
-		return this.model;
-	}
-
-	/**
-	 */
-	protected void notifyStyleChanged(Element target) {
-		INodeNotifier notifier = (INodeNotifier) target;
-		if (notifier == null)
-			return;
-		Collection adapters = notifier.getAdapters();
-		if (adapters == null)
-			return;
-		Iterator it = adapters.iterator();
-		if (it == null)
-			return;
-		while (it.hasNext()) {
-			INodeAdapter adapter = (INodeAdapter) it.next();
-			if (adapter instanceof StyleListener) {
-				StyleListener listener = (StyleListener) adapter;
-				listener.styleChanged();
-			}
-		}
-	}
-
-	/**
-	 */
-	void setElement(Element element) {
-		this.element = element;
-	}
-
-	/**
-	 * check 
-	 * 1. If attributes of element is valid (type,rel ...)
-	 * 2. If content model supports this element / attribute (future ?)
-	 */
-	protected boolean isValidAttribute() {
-		return (getElement() != null);
-	}
-
-	/**
-	 */
-	protected void setModel(ICSSModel model) {
-		this.model = model;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractStyleSheetAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractStyleSheetAdapter.java
deleted file mode 100644
index a2daac2..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractStyleSheetAdapter.java
+++ /dev/null
@@ -1,231 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.event.ICSSStyleListener;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IModelProvideAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.util.ImportedCollector;
-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.document.XMLModelNotifier;
-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.stylesheets.DocumentStyle;
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-import org.w3c.dom.traversal.DocumentTraversal;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- */
-public abstract class AbstractStyleSheetAdapter extends AbstractCSSModelAdapter implements ICSSStyleListener, IStyleSheetAdapter {
-
-	// this variable to hold the class is just a VAJava trick.
-	// it improves performance in VAJava by minimizing class loading.
-	private final Class StyleSheetAdapterClass = IStyleSheetAdapter.class;
-	private Collection styleChangedNodes;
-
-	/**
-	 */
-	protected AbstractStyleSheetAdapter() {
-		super();
-	}
-
-	/**
-	 */
-	protected ICSSModel createModel() {
-		ICSSModel newModel = super.createModel();
-		if (newModel != null) {
-			// get ModelProvideAdapter
-			IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
-			// notify adapter
-			if (adapter != null)
-				adapter.modelProvided(newModel);
-		}
-		return newModel;
-	}
-
-	/**
-	 */
-	public StyleSheet getSheet() {
-		ICSSModel model = getModel();
-		if (model == null)
-			return null;
-		return (StyleSheet) model.getDocument();
-	}
-
-	/**
-	 * 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 == StyleSheetAdapterClass);
-	}
-
-	/**
-	 */
-	public void released() {
-		ICSSModel currentModel = getModel();
-
-		// get ModelProvideAdapter
-		IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
-
-		setElement(null);
-		setModel(null);
-
-		if (adapter != null)
-			adapter.modelReleased(currentModel);
-
-		if (currentModel != null)
-			currentModel.releaseFromRead();
-	}
-
-	/**
-	 */
-	public void removed() {
-		ICSSModel currentModel = getModel();
-
-		setModel(null);
-
-		// get ModelProvideAdapter
-		IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
-		if (adapter != null)
-			adapter.modelRemoved(currentModel);
-
-		if (currentModel != null)
-			currentModel.releaseFromRead();
-	}
-
-
-	public void styleChanged(ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media) {
-		Element element = getElement();
-		if (element == null)
-			return; // might released
-		Document doc = element.getOwnerDocument();
-		if (doc == null)
-			return; // error
-
-		// to notify GEF tree 
-		if (doc instanceof INodeNotifier) {
-			Collection adapters = ((INodeNotifier) doc).getAdapters();
-			if (adapters == null)
-				return;
-			Iterator it = adapters.iterator();
-			if (it == null)
-				return;
-			while (it.hasNext()) {
-				INodeAdapter adapter = (INodeAdapter) it.next();
-				if (adapter instanceof ICSSStyleListener) {
-					((ICSSStyleListener) adapter).styleChanged(srcModel, removed, added, media);
-				}
-			}
-		}
-		//
-
-		if (styleChangedNodes == null) {
-			styleChangedNodes = new HashSet();
-		}
-
-		try {
-			int removedSelNum = removed != null ? removed.length : 0;
-			int addedSelNum = added != null ? added.length : 0;
-
-			NodeIterator iter = ((DocumentTraversal) doc).createNodeIterator(doc, NodeFilter.SHOW_ELEMENT, null, true);
-			Node node;
-			while ((node = iter.nextNode()) != null) {
-				if (node.getNodeType() == Node.ELEMENT_NODE) {
-					Element elm = (Element) node;
-					boolean match = false;
-					int i;
-					for (i = 0; i < removedSelNum && !match; i++) {
-						match = removed[i].match(elm, null);
-					}
-					for (i = 0; i < addedSelNum && !match; i++) {
-						match = added[i].match(elm, null);
-					}
-					if (match) {
-						if (!styleChangedNodes.contains(elm))
-							styleChangedNodes.add(elm);
-						// notifyStyleChanged(elm);
-					}
-				}
-			}
-		}
-		catch (ClassCastException ex) {
-			// Document doesn't implement DocumentTraversal...
-		}
-
-	}
-
-	
-	public void styleUpdate(ICSSModel srcModel) {
-		IDOMNode node = (IDOMNode) getElement();
-		if (node == null)
-			return;
-		IDOMModel model = node.getModel();
-		if (model == null)
-			return;
-		XMLModelNotifier notifier = model.getModelNotifier();
-		if (notifier == null)
-			return;
-
-		// before updating, all sub-models should be loaded!
-		DocumentStyle document = (DocumentStyle) model.getDocument();
-		StyleSheetList styles = document.getStyleSheets();
-		if (styles != null) {
-			int n = styles.getLength();
-			ImportedCollector trav = new ImportedCollector();
-			for (int i = 0; i < n; i++) {
-				org.w3c.dom.stylesheets.StyleSheet sheet = styles.item(i);
-				if (sheet instanceof ICSSNode)
-					trav.apply((ICSSNode) sheet);
-			}
-		}
-
-		// flash style changed events
-		if (styleChangedNodes != null) {
-			Object[] elements = styleChangedNodes.toArray();
-			for (int i = 0; elements != null && i < elements.length; i++)
-				notifyStyleChanged((Element) elements[i]);
-			styleChangedNodes.clear();
-		}
-
-		// to notify GEF tree 
-		if (document instanceof INodeNotifier) {
-			Collection adapters = ((INodeNotifier) document).getAdapters();
-			if (adapters == null)
-				return;
-			Iterator it = adapters.iterator();
-			if (it == null)
-				return;
-			while (it.hasNext()) {
-				INodeAdapter adapter = (INodeAdapter) it.next();
-				if (adapter instanceof ICSSStyleListener) {
-					((ICSSStyleListener) adapter).styleUpdate(srcModel);
-				}
-			}
-		}
-
-		notifier.propertyChanged(node);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryContext.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryContext.java
deleted file mode 100644
index 6572ae6..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryContext.java
+++ /dev/null
@@ -1,137 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.eclipse.wst.css.core.internal.util.CSSLinkConverter;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-
-/**
- */
-class CSSQueryContext extends CSSPropertyContext {
-
-	/**
-	 */
-	public CSSQueryContext() {
-		super();
-	}
-
-	/**
-	 */
-	public CSSQueryContext(ICSSStyleDeclaration decl) {
-		super(decl);
-	}
-
-	/**
-	 *
-	 */
-	public void applyFull(ICSSStyleDeclaration decl) {
-		if (decl == null)
-			return;
-		Enumeration keys = fProperties.keys();
-		while (keys.hasMoreElements()) {
-			Object key = keys.nextElement();
-			Object val = fProperties.get(key);
-
-			if (val instanceof CSSQueryDeclarationData) {
-				ICSSStyleDeclItem declItem = ((CSSQueryDeclarationData) val).getDeclItem();
-				if (declItem.getLength() <= 0) {
-					ICSSStyleDeclItem itemToRemove = decl.getDeclItemNode(key.toString());
-					if (itemToRemove != null) {
-						decl.removeDeclItemNode(itemToRemove);
-					}
-				}
-				else {
-					decl.setDeclItemNode(declItem);
-				}
-			}
-			else {
-				String value = (val instanceof ICSSValue) ? ((ICSSValue) val).getCSSValueText() : val.toString();
-
-				if (value == null || value.length() <= 0) {
-					ICSSStyleDeclItem itemToRemove = decl.getDeclItemNode(key.toString());
-					if (itemToRemove != null) {
-						decl.removeDeclItemNode(itemToRemove);
-					}
-				}
-				else {
-					decl.setProperty(key.toString(), value, null);
-				}
-			}
-		}
-	}
-
-	/**
-	 */
-	private boolean check(String propName, boolean important, int specificity) {
-		Object current = fProperties.get(propName);
-		if (current != null && current instanceof CSSQueryValueData) {
-			CSSQueryValueData currentValue = (CSSQueryValueData) current;
-			if ((!important && currentValue.important) || (currentValue.getSpecificity() > specificity)) {
-				return false;
-			}
-		}
-		return true;
-	}
-
-	/**
-	 */
-	public void overrideWithExpand(ICSSStyleDeclaration decl, int specificity) {
-		if (decl == null)
-			return;
-
-		CSSLinkConverter conv = new CSSLinkConverter(decl.getOwnerDocument().getModel());
-
-		int nProperties = decl.getLength();
-		for (int i = 0; i < nProperties; i++) {
-			String propName = decl.item(i);
-			if (propName != null) {
-				String propN = propName.trim().toLowerCase();
-				if (propN.length() != 0) {
-					PropCMProperty prop = PropCMProperty.getInstanceOf(propN);
-					String priority = decl.getPropertyPriority(propName);
-					boolean important = priority != null && priority.length() > 0;
-					if (prop != null && prop.isShorthand()) {
-						// expand shorthand property
-						CSSQueryContext context = new CSSQueryContext();
-						expandToLeaf(prop, decl.getPropertyValue(propName), context);
-
-						Enumeration properties = context.properties();
-						while (properties.hasMoreElements()) {
-							propN = properties.nextElement().toString();
-							if (check(propN, important, specificity)) {
-								fProperties.put(propN, new CSSQueryValueData(conv.toAbsolute(context.get(propN)), important, specificity));
-							}
-						}
-					}
-					else {
-						if (check(propN, important, specificity)) {
-							ICSSStyleDeclItem declItem = (ICSSStyleDeclItem) decl.getDeclItemNode(propName).cloneNode(true);
-							int nValues = declItem.getLength();
-							for (int j = 0; j < nValues; j++) {
-								conv.toAbsolute(declItem.item(j));
-							}
-							declItem.setPriority(null);
-							fProperties.put(propN, new CSSQueryDeclarationData(declItem, important, specificity));
-						}
-					}
-				}
-			}
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryDeclarationData.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryDeclarationData.java
deleted file mode 100644
index a156d20..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryDeclarationData.java
+++ /dev/null
@@ -1,44 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-
-
-
-/**
- */
-public class CSSQueryDeclarationData extends CSSQueryValueData {
-
-
-	ICSSStyleDeclItem declItem;
-
-	public CSSQueryDeclarationData(ICSSStyleDeclItem declItem, boolean imp, int specificity) {
-		super(null, imp, specificity);
-		this.declItem = declItem;
-	}
-
-	/**
-	 */
-	ICSSStyleDeclItem getDeclItem() {
-		return declItem;
-	}
-
-	/**
-	 */
-	public String toString() {
-		if (value == null && declItem != null) {
-			value = declItem.getCSSValueText();
-		}
-		return value;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryTraverser.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryTraverser.java
deleted file mode 100644
index 04f6b6d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryTraverser.java
+++ /dev/null
@@ -1,115 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.util.AbstractCssTraverser;
-import org.eclipse.wst.css.core.internal.util.CSSStyleDeclarationFactory;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.ElementCSSInlineStyle;
-
-/**
- */
-public class CSSQueryTraverser extends AbstractCssTraverser {
-
-	private Element element;
-	private String pseudoName;
-	private CSSQueryContext context = null;
-	ICSSStyleDeclaration decl = null;
-
-	/**
-	 */
-	public ICSSStyleDeclaration getDeclaration() {
-		try {
-			ICSSStyleDeclaration inlineStyle = (ICSSStyleDeclaration) ((ElementCSSInlineStyle) element).getStyle();
-			if (inlineStyle != null) {
-				if (context == null) {
-					context = new CSSQueryContext();
-				}
-				context.overrideWithExpand(inlineStyle, 10000);
-				// style attribute's specificity is 100 (in CSS2 spec.) and
-				// our implement use 100 as base number (see CSSSelector.java)
-			}
-		}
-		catch (ClassCastException ex) {
-			// element is not ElementCSSInlineStyle ???
-		}
-		if (context == null)
-			return null;
-
-		if (decl == null)
-			decl = CSSStyleDeclarationFactory.getInstance().createStyleDeclaration();
-		context.applyFull(decl);
-		return decl;
-	}
-
-	/**
-	 */
-	private void overwriteDeclaration(ICSSStyleDeclaration d, int specificity) {
-		if (d == null)
-			return;
-		if (context == null)
-			context = new CSSQueryContext();
-		context.overrideWithExpand(d, specificity);
-	}
-
-	/**
-	 */
-	protected short postNode(ICSSNode node) {
-		return TRAV_CONT;
-	}
-
-	/**
-	 */
-	protected short preNode(ICSSNode node) {
-		if (node instanceof ICSSStyleRule) {
-			// style rule
-			ICSSStyleRule style = (ICSSStyleRule) node;
-			ICSSSelectorList list = style.getSelectors();
-			int nSelectors = list.getLength();
-			int maxSpecificity = -1;
-			for (int iSelector = 0; iSelector < nSelectors; iSelector++) {
-				// Check each Selector Lists
-				ICSSSelector selector = list.getSelector(iSelector);
-				int specificity = selector.getSpecificity();
-				if (maxSpecificity < specificity && selector.match(element, pseudoName)) {
-					maxSpecificity = specificity;
-				}
-			}
-			if (maxSpecificity >= 0) {
-				// apply this style to the element
-				overwriteDeclaration((ICSSStyleDeclaration) style.getStyle(), maxSpecificity);
-			}
-			return TRAV_PRUNE;
-		}
-		return TRAV_CONT;
-	}
-
-	/**
-	 */
-	private void resetContext() {
-		context = null;
-	}
-
-	/**
-	 */
-	public void setElement(Element element, String pseudoName) {
-		this.element = element;
-		this.pseudoName = pseudoName;
-		resetContext();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryValueData.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryValueData.java
deleted file mode 100644
index edd74cd..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryValueData.java
+++ /dev/null
@@ -1,47 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-import org.eclipse.wst.css.core.internal.util.declaration.ValueData;
-
-
-
-/**
- */
-class CSSQueryValueData extends ValueData {
-
-	private int specificity;
-
-	/**
-	 */
-	public CSSQueryValueData() {
-		super();
-	}
-
-	/**
-	 */
-	public CSSQueryValueData(String val, boolean imp) {
-		super(val, imp);
-	}
-
-	/**
-	 */
-	public CSSQueryValueData(String val, boolean imp, int specificity) {
-		super(val, imp);
-		this.specificity = specificity;
-	}
-
-	/**
-	 */
-	int getSpecificity() {
-		return specificity;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLDocumentAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLDocumentAdapter.java
deleted file mode 100644
index 3aed14c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLDocumentAdapter.java
+++ /dev/null
@@ -1,398 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSClassTraverser;
-import org.eclipse.wst.css.core.internal.util.ImportRuleCollector;
-import org.eclipse.wst.html.core.internal.contentmodel.JSP11Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-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.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-
-
-/**
- */
-public class HTMLDocumentAdapter implements IStyleSheetListAdapter, StyleSheetList {
-
-	private Document document = null;
-	private Vector styleAdapters = null;
-	private Vector oldStyleAdapters = null;
-
-	/**
-	 */
-	HTMLDocumentAdapter() {
-		super();
-	}
-
-	/**
-	 */
-	private void addStyleSheet(Element node) {
-		IDOMElement element = (IDOMElement) node;
-		String tagName = element.getTagName();
-		if (tagName == null)
-			return;
-		boolean isContainer = false;
-		if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.NOSCRIPT) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.BASE) || tagName.equalsIgnoreCase(JSP11Namespace.ElementName.ROOT) || (!element.isGlobalTag() && element.isContainer())) {
-			isContainer = true;
-		}
-		else if (element.isCommentTag()) {
-			Node parent = element.getParentNode();
-			if (parent == element.getOwnerDocument()) {
-				// This condition is too severe, actually do not work for JSF template.
-				// But above (! globalTag() && isContainer()) cover JSF template + tpl template
-				isContainer = true;
-			}
-			else if (parent.getNodeType() == Node.ELEMENT_NODE) {
-				tagName = ((Element) parent).getTagName();
-				if (tagName != null && tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD)) {
-					isContainer = true;
-				}
-			}
-		}
-
-		else {
-			String localName = element.getLocalName();
-			if (localName != null && localName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML)) {
-				// taglib html tag
-				isContainer = true;
-			}
-			else {
-				INodeNotifier notifier = element;
-				INodeAdapter adapter = notifier.getAdapterFor(IStyleSheetAdapter.class);
-				if (adapter != null && adapter instanceof IStyleSheetAdapter) {
-					this.styleAdapters.addElement(adapter);
-				}
-			}
-		}
-		if (isContainer) {
-			INodeNotifier notifier = element;
-			if (notifier.getExistingAdapter(IStyleSheetListAdapter.class) == null) {
-				notifier.addAdapter(this);
-			}
-			for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) {
-				if (child.getNodeType() != Node.ELEMENT_NODE)
-					continue;
-				addStyleSheet((Element) child);
-			}
-		}
-	}
-
-	/**
-	 */
-	void childReplaced() {
-		if (this.styleAdapters == null)
-			return;
-
-		// backup old adapters to be released on updating in getStyleSheets()
-		this.oldStyleAdapters = this.styleAdapters;
-		// invalidate the list
-		this.styleAdapters = null;
-
-		notifyStyleSheetsChanged(this.document);
-	}
-
-	/**
-	 */
-	public Enumeration getClasses() {
-		StyleSheetList sheetList = getStyleSheets();
-		int nSheets = sheetList.getLength();
-
-		final ArrayList classes = new ArrayList();
-
-		CSSClassTraverser traverser = new CSSClassTraverser();
-		traverser.setTraverseImported(true);
-
-		for (int i = 0; i < nSheets; i++) {
-			org.w3c.dom.stylesheets.StyleSheet sheet = sheetList.item(i);
-			if (sheet instanceof ICSSNode) {
-				traverser.apply((ICSSNode) sheet);
-			}
-		}
-		classes.addAll(traverser.getClassNames());
-
-		return new Enumeration() {
-			int i = 0;
-
-			public boolean hasMoreElements() {
-				return i < classes.size();
-			}
-
-			public Object nextElement() {
-				return classes.get(i++);
-			}
-		};
-	}
-
-	/**
-	 */
-	private List getValidAdapters() {
-		Vector validAdapters = new Vector();
-		if (this.styleAdapters != null) {
-			Iterator i = this.styleAdapters.iterator();
-			while (i.hasNext()) {
-				Object obj = i.next();
-				if (obj instanceof AbstractStyleSheetAdapter && ((AbstractStyleSheetAdapter) obj).isValidAttribute()) {
-					validAdapters.add(obj);
-				}
-			}
-		}
-		return validAdapters;
-	}
-
-	/**
-	 */
-	public int getLength() {
-		return getValidAdapters().size();
-	}
-
-	/**
-	 */
-	public CSSStyleDeclaration getOverrideStyle(Element element, String pseudoName) {
-		StyleSheetList ssl = getStyleSheets();
-		int numStyles = ssl.getLength();
-
-		CSSQueryTraverser query = new CSSQueryTraverser();
-		query.setTraverseImported(true);
-		query.setTraverseImportFirst(true);
-		query.setElement(element, pseudoName);
-
-		for (int i = 0; i < numStyles; i++) {
-			// loop for styles (<style> and <link>)
-			org.w3c.dom.stylesheets.StyleSheet ss = ssl.item(i);
-
-			try {
-				query.apply((ICSSNode) ss);
-			}
-			catch (ClassCastException ex) {
-				// I can handle only CSS style
-			}
-		}
-
-		return query.getDeclaration();
-	}
-
-	/**
-	 */
-	public StyleSheetList getStyleSheets() {
-		if (this.styleAdapters == null) {
-			if (this.document == null)
-				return null;
-
-			this.styleAdapters = new Vector();
-			for (Node child = this.document.getFirstChild(); child != null; child = child.getNextSibling()) {
-				if (child.getNodeType() != Node.ELEMENT_NODE)
-					continue;
-				addStyleSheet((Element) child);
-			}
-
-			removeOldStyleSheets();
-		}
-		return this;
-	}
-
-	/**
-	 * 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 == IStyleSheetListAdapter.class);
-	}
-
-	/**
-	 */
-	public StyleSheet item(int index) {
-		if (this.styleAdapters == null)
-			return null;
-
-		List validAdapters = getValidAdapters();
-
-		if (index < 0 || index >= validAdapters.size())
-			return null;
-		org.w3c.dom.stylesheets.StyleSheet sheet = ((IStyleSheetAdapter) validAdapters.get(index)).getSheet();
-		if (sheet == null) {// for LINK element whose link is broken
-			ICSSModel model = ((AbstractStyleSheetAdapter) this.styleAdapters.elementAt(index)).createModel();
-			sheet = ((model != null) ? (StyleSheet) model.getDocument() : null);
-		}
-		return sheet;
-	}
-
-	/**
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		Node node = null;
-		switch (eventType) {
-			case INodeNotifier.ADD :
-				node = (Node) newValue;
-				break;
-			case INodeNotifier.REMOVE :
-				node = (Node) oldValue;
-				break;
-			case INodeNotifier.CHANGE :
-				node = (Node) notifier;
-				break;
-			default :
-				break;
-		}
-		if (node == null || node.getNodeType() != Node.ELEMENT_NODE)
-			return;
-		IDOMElement element = (IDOMElement) node;
-		String tagName = element.getTagName();
-		if (tagName == null)
-			return;
-
-		if (eventType == INodeNotifier.CHANGE) {
-			if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.BASE)) {
-				refreshAdapters();
-			}
-		}
-		else {
-			if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.LINK) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.NOSCRIPT) || tagName.equalsIgnoreCase(JSP11Namespace.ElementName.ROOT) || element.isCommentTag() || (!element.isGlobalTag() && element.isContainer())) {
-				childReplaced();
-			}
-			else if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.BASE)) {
-				refreshAdapters();
-			}
-			else {
-				String localName = element.getLocalName();
-				if (localName != null && localName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML)) {
-					// taglib html tag
-					childReplaced();
-				}
-			}
-		}
-	}
-
-	/**
-	 * reload LINK / @import if BASE changed
-	 */
-	private void refreshAdapters() {
-		Iterator iAdapter = this.styleAdapters.iterator();
-		while (iAdapter.hasNext()) {
-			Object adapter = iAdapter.next();
-			if (adapter instanceof LinkElementAdapter) {
-				((LinkElementAdapter) adapter).refreshSheet();
-			}
-			else if (adapter instanceof StyleElementAdapter) {
-				ICSSModel model = ((StyleElementAdapter) adapter).getModel();
-				ImportRuleCollector trav = new ImportRuleCollector();
-				trav.apply(model);
-				Iterator iRule = trav.getRules().iterator();
-				while (iRule.hasNext()) {
-					ICSSImportRule rule = (ICSSImportRule) iRule.next();
-					rule.refreshStyleSheet();
-				}
-			}
-		}
-	}
-
-	/**
-	 */
-	private void notifyStyleSheetsChanged(Document target) {
-		INodeNotifier notifier = (INodeNotifier) target;
-		if (notifier == null)
-			return;
-		Collection adapters = notifier.getAdapters();
-		if (adapters == null)
-			return;
-		Iterator it = adapters.iterator();
-		if (it == null)
-			return;
-		while (it.hasNext()) {
-			INodeAdapter adapter = (INodeAdapter) it.next();
-			if (adapter instanceof StyleListener) {
-				StyleListener listener = (StyleListener) adapter;
-				listener.styleChanged();
-			}
-		}
-	}
-
-	/**
-	 */
-	private void releaseOldStyleSheets() {
-		if (this.oldStyleAdapters == null)
-			return;
-		Iterator it = this.oldStyleAdapters.iterator();
-		while (it.hasNext()) {
-			IStyleSheetAdapter adapter = (IStyleSheetAdapter) it.next();
-			if (adapter == null)
-				continue;
-			// if the same adapter is in the current list,
-			// do not release
-			if (this.styleAdapters != null && this.styleAdapters.contains(adapter))
-				continue;
-			adapter.released();
-		}
-		this.oldStyleAdapters = null;
-	}
-
-	/**
-	 */
-	public void releaseStyleSheets() {
-		releaseOldStyleSheets();
-
-		if (this.styleAdapters == null)
-			return;
-		Iterator it = this.styleAdapters.iterator();
-		while (it.hasNext()) {
-			IStyleSheetAdapter adapter = (IStyleSheetAdapter) it.next();
-			if (adapter != null)
-				adapter.released();
-		}
-		this.styleAdapters = null;
-	}
-
-	/**
-	 */
-	private void removeOldStyleSheets() {
-		if (this.oldStyleAdapters == null)
-			return;
-		Iterator it = this.oldStyleAdapters.iterator();
-		while (it.hasNext()) {
-			IStyleSheetAdapter adapter = (IStyleSheetAdapter) it.next();
-			if (adapter == null)
-				continue;
-			// if the same adapter is in the current list,
-			// do not release
-			if (this.styleAdapters != null && this.styleAdapters.contains(adapter))
-				continue;
-			adapter.removed();
-		}
-		this.oldStyleAdapters = null;
-	}
-
-	/**
-	 */
-	void setDocument(Document document) {
-		this.document = document;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index ba48234..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java
+++ /dev/null
@@ -1,141 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import java.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;
-
-/**
- * Insert the type's description here.
- */
-public class HTMLStyleSelectorAdapter implements IStyleSelectorAdapter {
-
-	static private HTMLStyleSelectorAdapter instance;
-	private Object toMatch = IStyleSelectorAdapter.class;
-
-	public synchronized static HTMLStyleSelectorAdapter getInstance() {
-		if (instance == null) {
-			instance = new HTMLStyleSelectorAdapter();
-		}
-		return instance;
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return type == toMatch;
-	}
-
-	public boolean match(ICSSSimpleSelector selector, Element element, String pseudoName) {
-		if (element == null)
-			return false;
-		int i;
-		String key;
-
-		// PseudoName
-		i = selector.getNumOfPseudoNames();
-		if (i > 0) {
-			if (pseudoName == null || pseudoName.length() == 0)
-				return false;
-			for (i = i - 1; i >= 0; i--) {
-				if (pseudoName.equalsIgnoreCase(selector.getPseudoName(i))) {
-					break;
-				}
-			}
-			if (i < 0)
-				return false;
-		}
-
-		// check tag name
-		if (!selector.isUniversal() && !element.getNodeName().equalsIgnoreCase(selector.getName()))
-			return false;
-
-		// check id
-		i = selector.getNumOfIDs();
-		if (i > 0) {
-			if (i > 1)
-				return false;
-			key = element.getAttribute("id");//$NON-NLS-1$
-			if (key == null)
-				return false;
-			if (!selector.getID(0).equals(key))
-				return false;
-		}
-
-		// check class
-		i = selector.getNumOfClasses();
-		if (i > 0) {
-			key = element.getAttribute("class");//$NON-NLS-1$
-			if (key == null)
-				return false;
-			StringTokenizer tokenizer = new StringTokenizer(key);
-			for (i = i - 1; i >= 0; i--) {
-				boolean ok = false;
-				while (tokenizer.hasMoreTokens()) {
-					if (selector.getClass(i).equals(tokenizer.nextToken())) {
-						ok = true;
-						break;
-					}
-				}
-				if (!ok)
-					return false;
-			}
-		}
-
-		// check attributes
-		for (i = selector.getNumOfAttributes() - 1; i >= 0; i--) {
-			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)
-					return false;
-				if (countTokens > 1) {
-					String token = tokenizer.nextToken("= \t\r\n\f");//$NON-NLS-1$
-					StringTokenizer attrValueTokenizer = null;
-					if (token.equals("~")) {//$NON-NLS-1$
-						attrValueTokenizer = new StringTokenizer(attrValue);
-					}
-					else if (token.equals("|")) {//$NON-NLS-1$
-						attrValueTokenizer = new StringTokenizer(attrValue, "-");//$NON-NLS-1$
-					}
-					if (attrValueTokenizer != null) {
-						if (tokenizer.hasMoreTokens()) {
-							token = tokenizer.nextToken();
-							boolean ok = false;
-							while (attrValueTokenizer.hasMoreTokens()) {
-								if (token.equals(attrValueTokenizer.nextToken())) {
-									ok = true;
-									break;
-								}
-							}
-							if (!ok)
-								return false;
-						}
-					}
-					else {
-						if (!attrValue.equals(token))
-							return false;
-					}
-				}
-			}
-		}
-
-		return true;
-	}
-
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapterFactory.java
deleted file mode 100644
index 4c66fbf..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapterFactory.java
+++ /dev/null
@@ -1,77 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSelectorAdapter;
-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;
-
-/**
- * Insert the type's description here.
- */
-public class HTMLStyleSelectorAdapterFactory implements INodeAdapterFactory {
-
-	private static HTMLStyleSelectorAdapterFactory instance;
-	private Object toMatch = IStyleSelectorAdapter.class;
-
-	/**
-	 * CSSModelProvideAdapterFactory constructor comment.
-	 */
-	public HTMLStyleSelectorAdapterFactory() {
-		super();
-	}
-
-	/**
-	 * Method that returns the adapter associated with the given object.
-	 * It may be a singleton or not ... depending on the needs of the INodeAdapter  ...
-	 * but in general it is recommended for an adapter to be stateless, 
-	 * so the efficiencies of a singleton can be gained.
-	 *
-	 * The implementation of this method should call addAdapter on the adapted
-	 * object with the correct instance of the adapter.
-	 */
-	public INodeAdapter adapt(INodeNotifier notifier) {
-		INodeAdapter adapter = notifier.getExistingAdapter(IStyleSelectorAdapter.class);
-		if (adapter != null)
-			return adapter;
-		adapter = HTMLStyleSelectorAdapter.getInstance();
-		notifier.addAdapter(adapter);
-		return adapter;
-	}
-
-	public synchronized static HTMLStyleSelectorAdapterFactory getInstance() {
-		if (instance == null)
-			instance = new HTMLStyleSelectorAdapterFactory();
-		return instance;
-	}
-
-	/**
-	 * isFactoryForType method comment.
-	 */
-	public boolean isFactoryForType(Object type) {
-		return type == toMatch;
-	}
-
-	public void release() {
-		// default is to do nothing
-	}
-
-	/**
-	 * Overriding copy method
-	 */
-	public INodeAdapterFactory copy() {
-		return getInstance();
-	}
-
-}
\ No newline at end of file
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
deleted file mode 100644
index 3156ed7..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java
+++ /dev/null
@@ -1,272 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IModelProvideAdapter;
-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.sse.core.internal.provisional.INodeNotifier;
-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.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- */
-public class LinkElementAdapter extends AbstractStyleSheetAdapter {
-
-	private final static String CSS_ID = ContentTypeIdForCSS.ContentTypeID_CSS;
-	private boolean replaceModel = true;
-	// this variable to hold the class is just a VAJava trick.
-	// it improves performance in VAJava by minimizing class loading.
-	private final Class ModelProvideAdapterClass = IModelProvideAdapter.class;
-
-	/**
-	 */
-	protected LinkElementAdapter() {
-		super();
-	}
-
-	/**
-	 */
-	private void attrReplaced() {
-		this.replaceModel = true;
-
-		Element element = getElement();
-		if (element == null)
-			return; // error
-		Document document = element.getOwnerDocument();
-		if (document == null)
-			return; // error
-		INodeNotifier notifier = (INodeNotifier) document;
-		HTMLDocumentAdapter adapter = (HTMLDocumentAdapter) notifier.getAdapterFor(IStyleSheetListAdapter.class);
-		if (adapter == null)
-			return;
-		adapter.childReplaced();
-	}
-
-	protected ICSSModel createModel() {
-		// create phantom(broken link) external CSS model
-		if (getElement() == null)
-			return null;
-		IStructuredModel baseModel = ((IDOMNode) getElement()).getModel();
-		ICSSModel newModel = (ICSSModel) baseModel.getModelManager().createUnManagedStructuredModelFor(CSS_ID);
-
-		// calculate base location and set
-		// get resolver in Model
-		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;
-		if ((absurl == null) || (absurl.length() == 0)) {
-			IPath basePath = new Path(baseModel.getBaseLocation());
-			URLHelper helper = new URLHelper(basePath.removeLastSegments(1).toString());
-			absurl = helper.toAbsolute(ref == null ? "" : ref);//$NON-NLS-1$
-		}
-		if ((absurl == null) || (absurl.length() == 0)) {
-			absurl = ref;
-		}
-		if (absurl == null) {
-			absurl = "";//$NON-NLS-1$
-		}
-		newModel.setBaseLocation(absurl);
-
-		// set style listener
-		newModel.addStyleListener(this);
-
-		return newModel;
-	}
-
-	/**
-	 */
-	public ICSSModel getModel() {
-		ICSSModel model = getExistingModel();
-		if (this.replaceModel) {
-			ICSSModel oldModel = model;
-
-			model = retrieveModel();
-			setModel(model);
-
-			// release old model
-			if (oldModel != null) {
-				// get ModelProvideAdapter
-				IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
-				adapter.modelRemoved(oldModel);
-
-				oldModel.releaseFromRead();
-
-			}
-			this.replaceModel = false;
-		}
-		return model;
-	}
-
-	/**
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		if (eventType != INodeNotifier.CHANGE)
-			return;
-		Attr attr = (Attr) changedFeature;
-		if (attr == null)
-			return;
-		String name = attr.getName();
-		if (name.equalsIgnoreCase("rel") || //$NON-NLS-1$
-					name.equalsIgnoreCase("type") || //$NON-NLS-1$	
-					name.equalsIgnoreCase("href")) {//$NON-NLS-1$
-			attrReplaced();
-		}
-	}
-
-	/**
-	 */
-	public void refreshSheet() {
-		if (!replaceModel) {
-			removed();
-			replaceModel = true;
-
-			IDOMNode node = (IDOMNode) getElement();
-			if (node != null) {
-				node.notify(INodeNotifier.CHANGE, getElement().getAttributeNode(org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ATTR_NAME_HREF), null, null, node.getStartOffset());
-			}
-		}
-	}
-
-	/**
-	 */
-	public void released() {
-		ICSSModel model = getExistingModel();
-		if (model != null) {
-			try {
-				// get ModelProvideAdapter
-				IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
-
-				// set element to null first, so that no document wide updates
-				setElement(null);
-				setModel(null);
-
-				if (adapter != null)
-					adapter.modelReleased(model);
-			}
-			finally {
-				model.releaseFromRead();
-			}
-		}
-		this.replaceModel = false;
-	}
-
-	/**
-	 */
-	public void removed() {
-		ICSSModel model = getExistingModel();
-		if (model != null) {
-			try {
-				setModel(null);
-
-				// get ModelProvideAdapter
-				IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
-				if (adapter != null)
-					adapter.modelRemoved(model);
-			}
-			finally {
-				model.releaseFromRead();
-			}
-		}
-		this.replaceModel = false;
-	}
-
-	/**
-	 */
-	protected boolean isValidAttribute() {
-		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$
-			return false;
-		String type = element.getAttribute("type");//$NON-NLS-1$
-		if (type != null && !type.equalsIgnoreCase("text/css"))//$NON-NLS-1$
-			return false;
-		String href = element.getAttribute("href");//$NON-NLS-1$
-		if (href == null || href.length() == 0)
-			return false;
-		return true;
-	}
-
-	/**
-	 */
-	private ICSSModel retrieveModel() {
-		if (!isValidAttribute()) {
-			return null;
-		}
-
-		// null,attr check is done in isValidAttribute()
-		Element element = getElement();
-		String href = element.getAttribute("href");//$NON-NLS-1$
-
-		IDOMModel baseModel = ((IDOMNode) element).getModel();
-		if (baseModel == null)
-			return null;
-		Object id = baseModel.getId();
-		if (!(id instanceof String))
-			return null;
-		//String base = (String)id;
-
-		// get ModelProvideAdapter
-		IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(ModelProvideAdapterClass);
-
-		URLModelProvider provider = new URLModelProvider();
-		try {
-			IStructuredModel newModel = provider.getModelForRead(baseModel, href);
-			if (newModel == null)
-				return null;
-			if (!(newModel instanceof ICSSModel)) {
-				newModel.releaseFromRead();
-				return null;
-			}
-
-			// notify adapter
-			if (adapter != null)
-				adapter.modelProvided(newModel);
-
-			return (ICSSModel) newModel;
-		}
-		catch (UnsupportedEncodingException e) {
-		}
-		catch (IOException e) {
-		}
-
-		return null;
-	}
-
-	/**
-	 */
-	protected void setModel(ICSSModel model) {
-		ICSSModel oldModel = getExistingModel();
-		if (model == oldModel)
-			return;
-		super.setModel(model);
-		if (this.replaceModel)
-			this.replaceModel = false;
-		if (oldModel != null)
-			oldModel.removeStyleListener(this);
-		if (model != null)
-			model.addStyleListener(this);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAdapterFactory.java
deleted file mode 100644
index 83318df..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAdapterFactory.java
+++ /dev/null
@@ -1,162 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-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.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.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- */
-public class StyleAdapterFactory implements INodeAdapterFactory {
-
-	private static StyleAdapterFactory instance = null;
-
-	//	private static String CSS_CONTENT_TYPE = "text/css";//$NON-NLS-1$
-	/**
-	 */
-	private StyleAdapterFactory() {
-		super();
-	}
-
-	/**
-	 */
-	public INodeAdapter adapt(INodeNotifier notifier) {
-		if (notifier == null)
-			return null;
-
-		Node node = (Node) notifier;
-		short nodeType = node.getNodeType();
-		if (nodeType == Node.DOCUMENT_NODE) {
-			INodeAdapter adapter = notifier.getExistingAdapter(IStyleSheetListAdapter.class);
-			if (adapter != null)
-				return adapter;
-			HTMLDocumentAdapter newAdapter = new HTMLDocumentAdapter();
-			newAdapter.setDocument((Document) node);
-			notifier.addAdapter(newAdapter);
-			return newAdapter;
-		}
-		if (nodeType != Node.ELEMENT_NODE)
-			return null;
-
-		Element element = (Element) node;
-		String tagName = element.getTagName();
-		if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
-			if (!isTagAvailable(element.getOwnerDocument(), HTML40Namespace.ElementName.STYLE)) {
-				return null;
-			}
-			//		String type = element.getAttribute(HTML40Namespace.ATTR_NAME_TYPE);
-			//		if (type != null && ! type.equalsIgnoreCase(CSS_CONTENT_TYPE)) {
-			//			return null;
-			//		}
-			INodeAdapter adapter = notifier.getExistingAdapter(IStyleSheetAdapter.class);
-			if (adapter != null)
-				return adapter;
-			StyleElementAdapter newAdapter = new StyleElementAdapter();
-			newAdapter.setElement(element);
-			notifier.addAdapter(newAdapter);
-			return newAdapter;
-		}
-		else if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.LINK)) {
-			if (!isTagAvailable(element.getOwnerDocument(), HTML40Namespace.ElementName.LINK)) {
-				return null;
-			}
-			INodeAdapter adapter = notifier.getExistingAdapter(IStyleSheetAdapter.class);
-			if (adapter != null)
-				return adapter;
-			LinkElementAdapter newAdapter = new LinkElementAdapter();
-			newAdapter.setElement(element);
-			notifier.addAdapter(newAdapter);
-			return newAdapter;
-		}
-
-		INodeAdapter adapter = notifier.getExistingAdapter(IStyleDeclarationAdapter.class);
-		if (adapter != null)
-			return adapter;
-
-		if (!isAttributeAvailable(element, HTML40Namespace.ATTR_NAME_STYLE)) {
-			return null;
-		}
-		StyleAttrAdapter newAdapter = new StyleAttrAdapter();
-		newAdapter.setElement(element);
-		notifier.addAdapter(newAdapter);
-		return newAdapter;
-	}
-
-	/**
-	 */
-	public synchronized static StyleAdapterFactory getInstance() {
-		if (instance == null)
-			instance = new StyleAdapterFactory();
-		return instance;
-	}
-
-	/**
-	 */
-	public boolean isFactoryForType(Object type) {
-		return (type == IStyleSheetAdapter.class || type == IStyleDeclarationAdapter.class || type == IStyleSheetListAdapter.class);
-	}
-
-	public void release() {
-		// default is to do nothing
-	}
-
-	private static boolean isTagAvailable(Document document, String elementName) {
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
-		if (modelQuery != null) {
-			CMDocument cmdoc = modelQuery.getCorrespondingCMDocument(document);
-			CMNamedNodeMap map = cmdoc.getElements();
-			if ((CMElementDeclaration) map.getNamedItem(elementName) != null) {
-				return true;
-			}
-		}
-
-		return false;
-	}
-
-	private static boolean isAttributeAvailable(Element element, String attrName) {
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
-		if (modelQuery != null) {
-			CMElementDeclaration decl = modelQuery.getCMElementDeclaration(element);
-			if (decl != null) {
-				CMNamedNodeMap map = decl.getAttributes();
-				if ((CMAttributeDeclaration) map.getNamedItem(attrName) != null) {
-					return true;
-				}
-			}
-		}
-
-		return false;
-	}
-
-	/**
-	 * Overriding Object's clone() method
-	 */
-	public INodeAdapterFactory copy() {
-		return getInstance();
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAttrAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAttrAdapter.java
deleted file mode 100644
index db14d1c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAttrAdapter.java
+++ /dev/null
@@ -1,248 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.parser.CSSSourceParser;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-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.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- */
-public class StyleAttrAdapter extends AbstractCSSModelAdapter implements IStructuredDocumentListener, IStyleDeclarationAdapter {
-
-	private boolean ignoreNotification = false;
-	private final static String STYLE = "style";//$NON-NLS-1$
-
-	/**
-	 */
-	StyleAttrAdapter() {
-		super();
-	}
-
-	/**
-	 */
-	public ICSSModel getModel() {
-		ICSSModel model = getExistingModel();
-		if (model == null && isModelNecessary()) {
-			model = createModel();
-			if (model == null)
-				return null;
-			
-			IStructuredDocument structuredDocument = model.getStructuredDocument();
-			if (structuredDocument == null)
-				return null;
-
-			RegionParser parser = structuredDocument.getParser();
-			if (parser instanceof CSSSourceParser) {
-				((CSSSourceParser)parser).setParserMode(CSSSourceParser.MODE_DECLARATION);
-			} else {
-				return null;
-			}
-			
-			structuredDocument.addDocumentChangedListener(this);
-
-			setModel(model); // need to set before valueChanged()
-			valueChanged();
-		}
-		if (model != null && !isModelNecessary()) {
-			model = null;
-			valueChanged();
-		}
-		return model;
-	}
-
-	/**
-	 */
-	public CSSStyleDeclaration getStyle() {
-		ICSSModel model = getModel();
-		if (model == null)
-			return null;
-		return (CSSStyleDeclaration) model.getDocument();
-	}
-
-	/**
-	 * 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 == IStyleDeclarationAdapter.class);
-	}
-
-	/**
-	 */
-	public void newModel(NewDocumentEvent event) {
-		if (event == null)
-			return;
-		if (event.getOriginalRequester() == this)
-			return;
-
-		setValue();
-	}
-
-	/**
-	 */
-	public void noChange(NoChangeEvent structuredDocumentEvent) {
-	}
-
-	/**
-	 */
-	public void nodesReplaced(StructuredDocumentRegionsReplacedEvent event) {
-		if (event == null)
-			return;
-		if (event.getOriginalRequester() == this)
-			return;
-
-		setValue();
-	}
-
-	/**
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		if (this.ignoreNotification)
-			return;
-
-		if (eventType != INodeNotifier.CHANGE)
-			return;
-		Attr attr = (Attr) changedFeature;
-		if (attr == null)
-			return;
-		String name = attr.getName();
-		if (name.equalsIgnoreCase(STYLE)) {
-			valueChanged();
-		}
-	}
-
-	/**
-	 */
-	public void regionChanged(RegionChangedEvent event) {
-		if (event == null)
-			return;
-		if (event.getOriginalRequester() == this)
-			return;
-
-		setValue();
-	}
-
-	/**
-	 */
-	public void regionsReplaced(RegionsReplacedEvent event) {
-		if (event == null)
-			return;
-		if (event.getOriginalRequester() == this)
-			return;
-
-		setValue();
-	}
-
-	/**
-	 */
-	private void setValue() {
-		Element element = getElement();
-		if (element == null)
-			return;
-		ICSSModel model = getExistingModel();
-		if (model == null)
-			return;
-		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
-			return;
-
-		String value = null;
-		IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
-		if (flatNodes != null) {
-			int count = flatNodes.getLength();
-			if (count > 0) {
-				StringBuffer buffer = new StringBuffer();
-				for (int i = 0; i < count; i++) {
-					IStructuredDocumentRegion flatNode = flatNodes.item(i);
-					if (flatNode == null)
-						continue;
-					buffer.append(flatNode.getText());
-				}
-				value = buffer.toString();
-			}
-		}
-
-		this.ignoreNotification = true;
-		if (value == null || value.length() == 0) {
-			element.removeAttribute(STYLE);
-		}
-		else {
-			Attr attr = element.getAttributeNode(STYLE);
-			if (attr != null) {
-				((IDOMNode) attr).setValueSource(value);
-			}
-			else {
-				Document document = element.getOwnerDocument();
-				attr = document.createAttribute(STYLE);
-				((IDOMNode) attr).setValueSource(value);
-				element.setAttributeNode(attr);
-			}
-		}
-		this.ignoreNotification = false;
-
-		notifyStyleChanged(element);
-	}
-
-	/**
-	 */
-	private void valueChanged() {
-		Element element = getElement();
-		if (element == null)
-			return;
-		if (!isModelNecessary()) { // removed
-			setModel(null);
-
-			notifyStyleChanged(element);
-			return;
-		}
-
-		ICSSModel model = getExistingModel();
-		if (model == null)
-			return; // defer
-		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
-			return; // error
-
-		String value = null;
-		Attr attr = element.getAttributeNode(org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ATTR_NAME_STYLE);
-		if (attr != null)
-			value = ((IDOMNode) attr).getValueSource();
-		structuredDocument.setText(this, value);
-
-		notifyStyleChanged(element);
-	}
-
-	/**
-	 * @return boolean
-	 */
-	private boolean isModelNecessary() {
-		return getElement() != null && getElement().getAttributeNode(org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ATTR_NAME_STYLE) != null;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 73e378f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java
+++ /dev/null
@@ -1,411 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IModelProvideAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-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.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.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- */
-public class StyleElementAdapter extends AbstractStyleSheetAdapter implements IStructuredDocumentListener {
-
-	private boolean replaceModel = true;
-	private boolean ignoreNotification = false;
-
-	/**
-	 */
-	protected StyleElementAdapter() {
-		super();
-	}
-
-	/**
-	 * Preparation of applying changes from CSS sub-model to HTML model
-	 */
-	private void changeStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return;
-		Element element = getElement();
-		if (element == null)
-			return;
-		ICSSModel model = getExistingModel();
-		if (model == null)
-			return;
-		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
-			return;
-
-		// get old content length
-		Node child = element.getFirstChild();
-		if (child == null || child.getNodeType() != Node.TEXT_NODE)
-			return;
-		IDOMNode content = (IDOMNode) child;
-		int oldLength = content.getEndOffset() - content.getStartOffset();
-
-		// get new content length
-		int newLength = 0;
-		IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
-		if (flatNodes != null) {
-			int count = flatNodes.getLength();
-			if (count > 0) {
-				IStructuredDocumentRegion last = flatNodes.item(count - 1);
-				if (last != null)
-					newLength = last.getEnd();
-			}
-		}
-
-		int offset = flatNode.getStart();
-		int end = flatNode.getEnd();
-		int diff = oldLength - newLength;
-		int length = end - offset + diff;
-		String data = flatNode.getText();
-
-		replaceData(offset, length, data);
-	}
-
-	/**
-	 * Apply changes from HTML model to CSS sub-model
-	 */
-	private void contentChanged() {
-		Element element = getElement();
-		if (element == null)
-			return;
-		ICSSModel model = getExistingModel();
-		if (model == null)
-			return;
-		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
-			return;
-
-		String data = null;
-		Node child = element.getFirstChild();
-		if (child != null && child.getNodeType() == Node.TEXT_NODE && child.getNextSibling() == null) {
-			data = child.getNodeValue();
-		}
-		if (data == null)
-			data = "";//$NON-NLS-1$
-
-		// minimize replace range
-		int start = 0, end = 0;
-		String oldData = structuredDocument.get();
-		if (oldData == null)
-			oldData = "";//$NON-NLS-1$
-
-		// search differenct character position from first
-		for (; start < oldData.length() && start < data.length(); start++)
-			if (oldData.charAt(start) != data.charAt(start))
-				break;
-
-		if (start == oldData.length() && start == data.length())
-			return; // no change
-		else if (start == oldData.length()) {
-			structuredDocument.replaceText(getRequesterH2C(), start, 0, data.substring(start)); // append text to last
-		}
-		else if (start == data.length()) {
-			structuredDocument.replaceText(getRequesterH2C(), start, oldData.length() - start, ""); // remove text of last //$NON-NLS-1$
-		}
-		else {
-			// search differenct character position from last
-			for (; start < oldData.length() - end && start < data.length() - end; end++) {
-				if (oldData.charAt(oldData.length() - end - 1) != data.charAt(data.length() - end - 1))
-					break;
-			}
-			structuredDocument.replaceText(getRequesterH2C(), start, oldData.length() - end - start, data.substring(start, data.length() - end));
-		}
-
-	}
-
-	/**
-	 */
-	public ICSSModel getModel() {
-		ICSSModel model = getExistingModel();
-		if (this.replaceModel) {
-			ICSSModel oldModel = model;
-			model = createModel();
-
-			setModel(model); // need to set before contentChanged()
-			contentChanged();
-
-			if (oldModel != null) {
-				// get ModelProvideAdapter
-				IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
-				if (adapter != null) {
-					adapter.modelRemoved(oldModel);
-				}
-			}
-
-			this.replaceModel = false;
-		}
-		return model;
-	}
-
-	/**
-	 */
-	protected boolean isValidAttribute() {
-		Element element = getElement();
-		if (element == null) {
-			return false;
-		}
-		String type = element.getAttribute(HTML40Namespace.ATTR_NAME_TYPE);
-		if (type != null && type.length() > 0 &&!type.equalsIgnoreCase("text/css")) { //$NON-NLS-1$
-			return false;
-		}
-		return true;
-	}
-
-	/**
-	 */
-	protected ICSSModel createModel() {
-		if (!isValidAttribute()) {
-			return null;
-		}
-
-		ICSSModel model = super.createModel();
-		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
-			return null;
-		structuredDocument.addDocumentChangedListener(this);
-
-		return model;
-	}
-
-	/**
-	 */
-	//  public ICSSModel getModel() {
-	//  	ICSSModel model = getExistingModel();
-	//  	if (model == null) {
-	//  		model = createModel();
-	//  		if (model == null) return null;
-	//  		IStructuredDocument structuredDocument = model.getStructuredDocument();
-	//  		if (structuredDocument == null) return null;
-	//  		structuredDocument.addModelChangedListener(this);
-	//  		setModel(model); // need to set before contentChanged()
-	//  		contentChanged();
-	//  	}
-	//  	return model;
-	//  }
-	/**
-	 */
-	private Object getRequesterH2C() {
-		return (getElement() != null && ((IDOMNode) getElement()).getModel() != null) ? (Object) ((IDOMNode) getElement()).getModel() : this;
-	}
-
-	/**
-	 */
-	private Object getRequesterC2H() {
-		return (getModel() != null) ? (Object) getModel() : this;
-	}
-
-	/**
-	 * Implementing IStructuredDocumentListener's method
-	 * Event from CSS Flat Model
-	 */
-	public void newModel(NewDocumentEvent event) {
-		if (event == null)
-			return;
-		if (event.getOriginalRequester() == getRequesterH2C())
-			return;
-		IStructuredDocument structuredDocument = event.getStructuredDocument();
-		if (structuredDocument == null)
-			return;
-		IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
-		if (flatNodes == null)
-			return;
-
-		replaceStructuredDocumentRegions(flatNodes, null);
-	}
-
-	/**
-	 * Implementing IStructuredDocumentListener's method
-	 * Event from CSS Flat Model
-	 */
-	public void noChange(NoChangeEvent structuredDocumentEvent) {
-	}
-
-	/**
-	 * Implementing IStructuredDocumentListener's method
-	 * Event from CSS Flat Model
-	 */
-	public void nodesReplaced(StructuredDocumentRegionsReplacedEvent event) {
-		if (event == null)
-			return;
-		if (event.getOriginalRequester() == getRequesterH2C())
-			return;
-		IStructuredDocumentRegionList oldStructuredDocumentRegions = event.getOldStructuredDocumentRegions();
-		IStructuredDocumentRegionList newStructuredDocumentRegions = event.getNewStructuredDocumentRegions();
-		if (oldStructuredDocumentRegions == null && newStructuredDocumentRegions == null)
-			return;
-
-		replaceStructuredDocumentRegions(newStructuredDocumentRegions, oldStructuredDocumentRegions);
-	}
-
-	/**
-	 * Overriding INodeAdapter's method
-	 * Event from <STYLE> element
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		if (this.ignoreNotification)
-			return;
-
-		if (eventType == INodeNotifier.ADD || eventType == INodeNotifier.REMOVE || eventType == INodeNotifier.CONTENT_CHANGED) {
-			contentChanged();
-		}
-		else if (eventType == INodeNotifier.CHANGE) {
-			Attr attr = (Attr) changedFeature;
-			if (attr == null)
-				return;
-			String name = attr.getName();
-			if (name.equalsIgnoreCase("type")) { //$NON-NLS-1$
-				this.replaceModel = true;
-
-				Element element = getElement();
-				if (element == null) {
-					return;
-				}
-				Document document = element.getOwnerDocument();
-				if (document == null) {
-					return;
-				}
-				HTMLDocumentAdapter adapter = (HTMLDocumentAdapter) ((INodeNotifier) document).getAdapterFor(IStyleSheetListAdapter.class);
-				if (adapter != null) {
-					adapter.childReplaced();
-				}
-			}
-		}
-	}
-
-	/**
-	 * Implementing IStructuredDocumentListener's method
-	 * Event from CSS Flat Model
-	 */
-	public void regionChanged(RegionChangedEvent event) {
-		if (event == null)
-			return;
-		if (event.getOriginalRequester() == getRequesterH2C())
-			return;
-		IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
-		if (flatNode == null)
-			return;
-
-		changeStructuredDocumentRegion(flatNode);
-	}
-
-	/**
-	 * Implementing IStructuredDocumentListener's method
-	 * Event from CSS Flat Model
-	 */
-	public void regionsReplaced(RegionsReplacedEvent event) {
-		if (event == null)
-			return;
-		if (event.getOriginalRequester() == getRequesterH2C())
-			return;
-		IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
-		if (flatNode == null)
-			return;
-
-		changeStructuredDocumentRegion(flatNode);
-	}
-
-	/**
-	 * Apply changes from CSS sub-model to HTML model
-	 */
-	private void replaceData(int offset, int length, String data) {
-		IDOMNode element = (IDOMNode) getElement();
-		if (element == null)
-			return;
-		IDOMModel ownerModel = element.getModel();
-		if (ownerModel == null)
-			return;
-		IStructuredDocument structuredDocument = ownerModel.getStructuredDocument();
-		if (structuredDocument == null)
-			return;
-		IStructuredDocumentRegion flatNode = element.getStartStructuredDocumentRegion();
-		if (flatNode == null)
-			return;
-
-		int contentOffset = flatNode.getEndOffset();
-		if (data == null)
-			data = "";//$NON-NLS-1$
-
-		this.ignoreNotification = true;
-		structuredDocument.replaceText(getRequesterC2H(), contentOffset + offset, length, data);
-		this.ignoreNotification = false;
-	}
-
-	/**
-	 * Preparation of applying changes from CSS sub-model to HTML model
-	 */
-	private void replaceStructuredDocumentRegions(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
-		int offset = 0;
-		int length = 0;
-		if (oldStructuredDocumentRegions != null) {
-			int count = oldStructuredDocumentRegions.getLength();
-			if (count > 0) {
-				IStructuredDocumentRegion first = oldStructuredDocumentRegions.item(0);
-				if (first != null)
-					offset = first.getStart();
-				IStructuredDocumentRegion last = oldStructuredDocumentRegions.item(count - 1);
-				if (last != null)
-					length = last.getEnd() - offset;
-			}
-		}
-		String data = null;
-		if (newStructuredDocumentRegions != null) {
-			int count = newStructuredDocumentRegions.getLength();
-			if (count > 0) {
-				StringBuffer buffer = new StringBuffer();
-				for (int i = 0; i < count; i++) {
-					IStructuredDocumentRegion flatNode = newStructuredDocumentRegions.item(i);
-					if (flatNode == null)
-						continue;
-					buffer.append(flatNode.getText());
-					if (i == 0)
-						offset = flatNode.getStart();
-				}
-				data = buffer.toString();
-			}
-		}
-
-		replaceData(offset, length, data);
-	}
-
-	/**
-	 */
-	protected void setModel(ICSSModel model) {
-		ICSSModel oldModel = getExistingModel();
-		if (model == oldModel)
-			return;
-		super.setModel(model);
-		if (oldModel != null)
-			oldModel.removeStyleListener(this);
-		if (model != null)
-			model.addStyleListener(this);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleListener.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleListener.java
deleted file mode 100644
index bc8d16f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleListener.java
+++ /dev/null
@@ -1,22 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-/**
- */
-public interface StyleListener {
-
-	/**
-	 */
-	void styleChanged();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLHelper.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLHelper.java
deleted file mode 100644
index 9413d68..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLHelper.java
+++ /dev/null
@@ -1,33 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-/**
- * @deprecated 
- */
-public class URLHelper extends org.eclipse.wst.css.core.internal.util.URLHelper {
-
-	/**
-	 * @param baseUrl
-	 */
-	public URLHelper(String baseUrl) {
-		super(baseUrl);
-	}
-
-	/**
-	 * @param baseUrl
-	 * @param docRoot
-	 */
-	public URLHelper(String baseUrl, String docRoot) {
-		super(baseUrl, docRoot);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java
deleted file mode 100644
index 83baf5b..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java
+++ /dev/null
@@ -1,445 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.UnsupportedCharsetException;
-
-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.IWorkspaceRoot;
-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.html.core.internal.document.HTMLDocumentTypeConstants;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-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.StructuredModelManager;
-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.util.PathHelper;
-import org.eclipse.wst.sse.core.internal.util.ProjectResolver;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-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.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-// TODO when this class is removed from .core, PathHelper and URLHelper class
-// also can be removed.
-
-/**
- */
-public class URLModelProvider {
-
-	private static final int GET_MODEL_FOR_READ = 1;
-	//	private static final int GET_NEW_MODEL_FOR_READ = 2;
-	private static final int GET_MODEL_FOR_EDIT = 3;
-	//	private static final int GET_NEW_MODEL_FOR_EDIT = 4;
-	//	private static final int READ_BUFFER_SIZE = 4096;
-	// IModelManager
-	private IModelManager modelManager = null;
-
-	/**
-	 */
-	public URLModelProvider() {
-		super();
-
-		// obtain model manager
-		modelManager = StructuredModelManager.getModelManager();
-	}
-
-	/**
-	 * Calculate ID from a filename. This must be same as
-	 * FileModelProvider.calculateId(IFile)
-	 */
-	private static String calculateId(IPath fullIPath) {
-		return fullIPath.toString();
-	}
-
-	/**
-	 * <code>baseModel</code>: the model containing the link
-	 * <code>ref</code>: the link URL string
-	 */
-	private IStructuredModel getCommonModelFor(final IStructuredModel baseModel, final String ref, final int which) throws IOException {
-		// first, create absolute url
-		String absURL = resolveURI(baseModel, ref, true);
-		if ((absURL == null) || (absURL.length() == 0)) {
-			return null;
-		}
-
-		// need to remove file:// scheme if necessary
-		try {
-			final java.net.URL aURL = new java.net.URL(absURL);
-			// An actual URL was given, only file:/// is supported
-			// resolve it by finding the file it points to
-			if (!aURL.getProtocol().equals("platform")) { //$NON-NLS-1$
-				if (aURL.getProtocol().equals("file") && (aURL.getHost().equals("localhost") || aURL.getHost().length() == 0)) {//$NON-NLS-2$//$NON-NLS-1$
-					absURL = aURL.getFile();
-					final IPath ipath = new Path(absURL);
-					//  if path has a device, and if it begins with
-					// IPath.SEPARATOR, remove it
-					final String device = ipath.getDevice();
-					if ((device != null) && (device.length() > 0)) {
-						if (device.charAt(0) == IPath.SEPARATOR) {
-							final String newDevice = device.substring(1);
-							absURL = ipath.setDevice(newDevice).toString();
-						}
-					}
-
-				}
-			}
-		}
-		catch (java.net.MalformedURLException mfuExc) {
-		}
-
-
-		// next, decide project
-		IProject project = null;
-		final IPath fullIPath = new Path(absURL);
-		IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
-		IContainer container = workspace.getContainerForLocation(fullIPath);
-		if (container != null) {
-			// fullIPath doesn't exist in workspace
-			project = container.getProject();
-		}
-
-		// If HTML document has a link to an extern CSS which is not in
-		// IProject
-		// workspace.getContainerForLoation() may return null. We need to take
-		// care
-		// of this case
-
-		// now, get absURL's IFile
-		if ((project != null) && (project.getLocation().isPrefixOf(fullIPath) == false)) {
-			// it's at outside of Project
-			return null;
-		}
-
-		IStructuredModel model = null;
-		if (project != null) {
-			IPath filePath = fullIPath.removeFirstSegments(project.getLocation().segmentCount());
-			IFile file = (filePath != null && !filePath.isEmpty()) ? project.getFile(filePath) : null;
-			if (file == null) {
-				return null;
-			}
-
-			// obtain model
-			if (which == GET_MODEL_FOR_EDIT) {
-				model = getModelForEdit(file);
-			}
-			else if (which == GET_MODEL_FOR_READ) {
-				model = getModelForRead(file);
-			}
-
-			// setting synchronization stamp is IModelManager's client's
-			// responsibility
-			if (model != null && model.getSynchronizationStamp() == IResource.NULL_STAMP)
-				model.resetSynchronizationStamp(file);
-		}
-		else {
-			String id = null;
-			InputStream inStream = null;
-			// obtain resolver
-			URIResolver resolver = (project != null) ? (URIResolver) project.getAdapter(URIResolver.class) : null;
-			if (resolver == null) {
-				// ProjectResolver can take care of the case if project is
-				// null.
-				resolver = new ProjectResolver(project);
-			}
-			if (resolver == null) {
-				return null;
-			}
-
-			// there is no project. we can't expect IProject help to create
-			// id/inputStream
-			java.io.File file = fullIPath.toFile();
-
-			// obatin id
-			id = calculateId(fullIPath);
-
-			// obtain InputStream
-			try {
-				inStream = new FileInputStream(file);
-			}
-			catch (FileNotFoundException fnfe) {
-				// the file does not exist, or we don't have read permission
-				return null;
-			}
-
-			// obtain model
-			try {
-				if (which == GET_MODEL_FOR_EDIT) {
-					model = getModelManager().getModelForEdit(id, inStream, resolver);
-				}
-				else if (which == GET_MODEL_FOR_READ) {
-					model = getModelManager().getModelForRead(id, inStream, resolver);
-				}
-			}
-			catch (UnsupportedEncodingException ue) {
-			}
-			catch (IOException ioe) {
-			}
-			finally {
-				// close now !
-				if (inStream != null) {
-					inStream.close();
-				}
-			}
-		}
-
-
-		// set locationid
-		if (model != null && model.getBaseLocation() == null) {
-			model.setBaseLocation(fullIPath.toString());
-		}
-
-		return model;
-	}
-
-	/**
-	 * <code>baseModel</code>: the model containing the link
-	 * <code>ref</code>: the link URL string
-	 */
-	public IStructuredModel getModelForEdit(IStructuredModel baseModel, String ref) throws IOException {
-		return getCommonModelFor(baseModel, ref, GET_MODEL_FOR_EDIT);
-	}
-
-	/**
-	 */
-	private IStructuredModel getModelForEdit(IFile file) throws IOException {
-		if (file == null)
-			return null;
-		IModelManager manager = getModelManager();
-
-		// create a fake InputStream
-		IStructuredModel model = null;
-		try {
-			model = manager.getModelForEdit(file);
-		}
-		catch (UnsupportedCharsetException ex) {
-			try {
-				model = manager.getModelForEdit(file, EncodingRule.FORCE_DEFAULT);
-			}
-			catch (IOException ioe) {
-			}
-			catch (CoreException ce) {
-			}
-		}
-		catch (CoreException ce) {
-		}
-		return model;
-	}
-
-	/**
-	 * <code>baseModel</code>: the model containing the link
-	 * <code>ref</code>: the link URL string
-	 */
-	public IStructuredModel getModelForRead(IStructuredModel baseModel, String ref) throws UnsupportedEncodingException, IOException {
-		return getCommonModelFor(baseModel, ref, GET_MODEL_FOR_READ);
-	}
-
-	/**
-	 */
-	private IStructuredModel getModelForRead(IFile file) throws IOException {
-		if (file == null)
-			return null;
-		IModelManager manager = getModelManager();
-
-		// create a fake InputStream
-		IStructuredModel model = null;
-		try {
-			model = manager.getModelForRead(file);
-		}
-		catch (UnsupportedCharsetException ex) {
-			try {
-				model = manager.getModelForRead(file, EncodingRule.FORCE_DEFAULT);
-			}
-			catch (IOException ioe) {
-			}
-			catch (CoreException ce) {
-			}
-		}
-		catch (CoreException ce) {
-		}
-		return model;
-	}
-
-	/**
-	 */
-	private IModelManager getModelManager() {
-		return modelManager;
-	}
-
-	public IStructuredModel getNewModelForEdit(IFile iFile) {
-		if (iFile == null)
-			return null;
-		IModelManager manager = getModelManager();
-		if (manager == null)
-			return null;
-
-		IStructuredModel model = null;
-		try {
-			model = manager.getNewModelForEdit(iFile, false);
-		}
-		catch (IOException ex) {
-		}
-		catch (ResourceInUse riu) {
-		}
-		catch (ResourceAlreadyExists rae) {
-		}
-		catch (CoreException ce) {
-		}
-		return model;
-	}
-
-	public IStructuredModel getNewModelForRead(IFile iFile) {
-		if (iFile == null)
-			return null;
-		IModelManager manager = getModelManager();
-		if (manager == null)
-			return null;
-
-		IStructuredModel model = null;
-		try {
-			model = manager.getNewModelForEdit(iFile, false);
-		}
-		catch (IOException ex) {
-		}
-		catch (ResourceInUse riu) {
-		}
-		catch (ResourceAlreadyExists rae) {
-		}
-		catch (CoreException ce) {
-		}
-		return model;
-	}
-
-	/**
-	 * Utility to check the model is HTML family or not
-	 */
-	static private boolean isHTMLFamily(IStructuredModel model) {
-		if (model instanceof IDOMModel) {
-			IDOMDocument document = ((IDOMModel) model).getDocument();
-			DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
-			if (adapter != null)
-				return adapter.hasFeature(HTMLDocumentTypeConstants.HTML);
-		}
-		return false;
-	}
-
-	/**
-	 * <code>baseModel</code>: the model containing the link
-	 * <code>ref</code>: the link URL string
-	 * <code>resolveCrossProjectLinks</code>: If resolveCrossProjectLinks
-	 * is set to true, then this method will properly resolve the URI if it is
-	 * a valid URI pointing to another (appropriate) project.
-	 */
-	public static String resolveURI(IStructuredModel baseModel, String ref, boolean resolveCrossProjectLinks) {
-		if (baseModel == null)
-			return null;
-		// for HTML, 'href' attribute value of BASE element
-		// should be used, if exists any
-		String baseHref = null;
-		// dmw_TODO needs to be changed to handle a content model
-		// of HTML or XHTML
-		if (isHTMLFamily(baseModel)) {
-			final IDOMModel xmlmodel = (IDOMModel) baseModel;
-			final IDOMDocument doc = xmlmodel.getDocument();
-			// look for <BASE> w/ href
-			final NodeList nl = doc.getElementsByTagName("BASE");//$NON-NLS-1$
-			if ((nl != null) && (nl.getLength() > 0)) {
-				// per each <BASE>
-				for (int i = 0; i < nl.getLength(); i++) {
-					final Node baseNode = nl.item(i);
-					if (baseNode != null) {
-						// get all attrs
-						final NamedNodeMap attrNodes = baseNode.getAttributes();
-						if (attrNodes != null) {
-							final Node attrNode = attrNodes.getNamedItem("HREF");//$NON-NLS-1$
-							if (attrNode != null) {
-								// found href=""
-								final String attrValue = attrNode.getNodeValue();
-								if (attrValue != null) {
-									baseHref = attrValue.trim();
-								}
-							}
-						}
-					}
-					// what if there are multiple <BASE> tags ??
-					if (baseHref != null) {
-						break;
-					}
-				}
-			}
-		}
-
-		// get resolver in Model
-		final URIResolver resolver = baseModel.getResolver();
-
-		// resolve to absolute url
-		final String absurl = (resolver != null) ? ((baseHref != null) ? resolver.getLocationByURI(ref, baseHref, resolveCrossProjectLinks) : resolver.getLocationByURI(ref, resolveCrossProjectLinks)) : null;
-		if ((resolver != null) && (absurl == null) && (ref != null) && (ref.trim().length() > 0) && (ref.trim().charAt(0) == '/')) {
-			// to reach here means :
-			//    ref is a Docroot relative
-			//    resolver can't resolve ref
-			// so that href is a broken and should not create model
-			return null;
-		}
-		if ((absurl != null) && (absurl.length() > 0)) {
-			return absurl;
-		}
-
-		// maybe ref is at outside of the Project
-		// obtain docroot;
-		final IContainer container = (resolver != null) ? resolver.getRootLocation() : null;
-		String docroot = null;
-		if (container != null) {
-			docroot = container.getLocation().toString();
-		}
-		if (docroot == null) {
-			docroot = baseModel.getBaseLocation();
-		}
-		if (docroot == null) {
-			// should not be
-			return null;
-		}
-
-		// obtain document url
-		String modelBaseLocation = baseModel.getBaseLocation();
-		if ((modelBaseLocation == null) || (modelBaseLocation.length() == 0)) {
-			// fallback...
-			modelBaseLocation = baseModel.getId();
-		}
-		if ((modelBaseLocation == null) || (modelBaseLocation.length() == 0)) {
-			// i can't resolve uri !
-			return null;
-		}
-
-		// resolve url
-		URLHelper helper = new URLHelper(PathHelper.getContainingFolderPath(modelBaseLocation), PathHelper.getContainingFolderPath(PathHelper.appendTrailingURLSlash(docroot)));
-		return helper.toAbsolute(ref);
-	}
-
-}
-
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
deleted file mode 100644
index e000a05..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java
+++ /dev/null
@@ -1,167 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelhandler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSelectorAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeAdapterFactory;
-import org.eclipse.wst.html.core.internal.document.HTMLModelParserAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.HTMLStyleSelectorAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.StyleAdapterFactory;
-import org.eclipse.wst.html.core.internal.modelquery.ModelQueryAdapterFactoryForEmbeddedHTML;
-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.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.document.ModelParserAdapter;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class EmbeddedHTML implements EmbeddedTypeHandler {
-
-	public String ContentTypeID_EmbeddedHTML = "org.eclipse.wst.html.core.internal.contenttype.EmbeddedHTML"; //$NON-NLS-1$
-	private List supportedMimeTypes;
-
-	/**
-	 * Constructor for EmbeddedHTML.
-	 */
-	public EmbeddedHTML() {
-		super();
-	}
-
-	/**
-	 * Convenience method to add tag names using BlockMarker object
-	 */
-	private void addHTMLishTag(BlockTagParser parser, String tagname) {
-		BlockMarker bm = new BlockMarker(tagname, null, DOMRegionContext.BLOCK_TEXT, false);
-		parser.addBlockMarker(bm);
-	}
-
-	/**
-	 * @see EmbeddedContentType#getFamilyId()
-	 */
-	public String getFamilyId() {
-		return ModelHandlerForHTML.AssociatedContentTypeID;
-	}
-
-	/*
-	 * Only "model side" embedded factories can be added here.
-	 */
-	public List getAdapterFactories() {
-		List factories = new ArrayList();
-		factories.add(new ModelQueryAdapterFactoryForEmbeddedHTML());
-		// factories.addAll(PluginContributedFactoryReader.getInstance().getFactories(this));
-		return factories;
-	}
-
-	/*
-	 * @see EmbeddedContentType#initializeParser(RegionParser)
-	 */
-	public void initializeParser(JSPCapableParser parser) {
-		addHTMLishTag(parser, "script"); //$NON-NLS-1$
-		addHTMLishTag(parser, "style"); //$NON-NLS-1$
-	}
-
-	public List getSupportedMimeTypes() {
-		if (supportedMimeTypes == null) {
-			supportedMimeTypes = new ArrayList();
-			supportedMimeTypes.add("text/html"); //$NON-NLS-1$
-			supportedMimeTypes.add("text/xhtml"); //$NON-NLS-1$
-			supportedMimeTypes.add("application/xhtml+xml"); //$NON-NLS-1$
-			supportedMimeTypes.add("application/xml"); //$NON-NLS-1$
-			supportedMimeTypes.add("text/vnd.wap.wml"); //$NON-NLS-1$
-		}
-		return supportedMimeTypes;
-	}
-
-	public void initializeFactoryRegistry(FactoryRegistry registry) {
-		Assert.isNotNull(registry);
-
-		INodeAdapterFactory factory = null;
-		if (!registry.contains(DocumentTypeAdapter.class)) {
-			factory = new HTMLDocumentTypeAdapterFactory();
-			registry.addFactory(factory);
-		}
-		if (!registry.contains(ModelParserAdapter.class)) {
-			factory = HTMLModelParserAdapterFactory.getInstance();
-			registry.addFactory(factory);
-		}
-		if (!registry.contains(IStyleSelectorAdapter.class)) {
-
-			factory = HTMLStyleSelectorAdapterFactory.getInstance();
-			registry.addFactory(factory);
-		}
-		if (!registry.contains(IStyleSheetAdapter.class)) {
-
-			factory = StyleAdapterFactory.getInstance();
-			registry.addFactory(factory);
-		}
-
-	}
-
-	public void uninitializeFactoryRegistry(FactoryRegistry registry) {
-		Assert.isNotNull(registry);
-
-		// ISSUE: should these factories be released? Or just 
-		// removed from this registry, because we are getting ready to
-		// re-add them?
-		INodeAdapterFactory factory = null;
-		if (!registry.contains(DocumentTypeAdapter.class)) {
-			factory = registry.getFactoryFor(DocumentTypeAdapter.class);
-			factory.release();
-			registry.removeFactory(factory);
-		}
-		if (!registry.contains(ModelParserAdapter.class)) {
-			factory = registry.getFactoryFor(ModelParserAdapter.class);
-			factory.release();
-			registry.removeFactory(factory);
-		}
-		if (!registry.contains(IStyleSelectorAdapter.class)) {
-			factory = registry.getFactoryFor(IStyleSelectorAdapter.class);
-			factory.release();
-			registry.removeFactory(factory);
-		}
-		if (!registry.contains(IStyleSheetAdapter.class)) {
-			factory = registry.getFactoryFor(IStyleSheetAdapter.class);
-			factory.release();
-			registry.removeFactory(factory);
-		}
-
-	}
-
-	public void uninitializeParser(JSPCapableParser 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$
-	}
-
-	public EmbeddedTypeHandler newInstance() {
-		return new EmbeddedHTML();
-	}
-
-	/**
-	 * will someday be controlled via extension point
-	 */
-	public boolean isDefault() {
-		return true;
-	}
-
-	public boolean canHandleMimeType(String mimeType) {
-		return getSupportedMimeTypes().contains(mimeType);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/ModelHandlerForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/ModelHandlerForHTML.java
deleted file mode 100644
index 06cc15a..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/ModelHandlerForHTML.java
+++ /dev/null
@@ -1,55 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelhandler;
-
-import org.eclipse.wst.html.core.internal.encoding.HTMLDocumentCharsetDetector;
-import org.eclipse.wst.html.core.internal.encoding.HTMLDocumentLoader;
-import org.eclipse.wst.html.core.internal.encoding.HTMLModelLoader;
-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;
-
-public class ModelHandlerForHTML 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.wst.html.core.htmlsource"; //$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_HTML = "org.eclipse.wst.html.core.modelhandler"; //$NON-NLS-1$
-
-
-	public ModelHandlerForHTML() {
-		super();
-		setId(ModelHandlerID_HTML);
-		setAssociatedContentTypeId(AssociatedContentTypeID);
-	}
-
-	public IModelLoader getModelLoader() {
-		return new HTMLModelLoader();
-	}
-
-	public IDocumentCharsetDetector getEncodingDetector() {
-		return new HTMLDocumentCharsetDetector();
-	}
-
-	public IDocumentLoader getDocumentLoader() {
-		return new HTMLDocumentLoader();
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMAttributeDeclarationBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMAttributeDeclarationBuddySystem.java
deleted file mode 100644
index ae41f91..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMAttributeDeclarationBuddySystem.java
+++ /dev/null
@@ -1,67 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- */
-class CMAttributeDeclarationBuddySystem extends CMNodeBuddySystem implements CMAttributeDeclaration {
-
-
-	public CMAttributeDeclarationBuddySystem(CMAttributeDeclaration self, CMAttributeDeclaration buddy, boolean isXHTML) {
-		super(self, buddy, isXHTML);
-	}
-
-	/*
-	 * @see CMAttributeDeclaration#getAttrName()
-	 */
-	public String getAttrName() {
-		return getSelf().getAttrName();
-	}
-
-	/*
-	 * @see CMAttributeDeclaration#getAttrType()
-	 */
-	public CMDataType getAttrType() {
-		return getSelf().getAttrType();
-	}
-
-	/*
-	 * @see CMAttributeDeclaration#getDefaultValue()
-	 * @deprecated in superclass
-	 */
-	public String getDefaultValue() {
-		return getSelf().getDefaultValue();
-	}
-
-	/*
-	 * @see CMAttributeDeclaration#getEnumAttr()
-	 * @deprecated in superclass
-	 */
-	public Enumeration getEnumAttr() {
-		return getSelf().getEnumAttr();
-	}
-
-	/*
-	 * @see CMAttributeDeclaration#getUsage()
-	 */
-	public int getUsage() {
-		return getSelf().getUsage();
-	}
-
-	private CMAttributeDeclaration getSelf() {
-		return (CMAttributeDeclaration) self;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMDocumentForBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMDocumentForBuddySystem.java
deleted file mode 100644
index 0f8f13e..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMDocumentForBuddySystem.java
+++ /dev/null
@@ -1,119 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.contentmodel.ssi.SSICMDocumentFactory;
-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.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- */
-class CMDocumentForBuddySystem extends CMNodeBuddySystem implements CMDocument {
-
-
-	private static CMDocument getHTMLCMDocument() {
-		return HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
-	}
-
-	class Elements extends CMNamedNodeMapForBuddySystem {
-		public Elements(CMNamedNodeMap elements, boolean isXHTML) {
-			super(isXHTML);
-			makeBuddySystem(elements);
-			addSSIDecls();
-		}
-
-		protected String getKeyName(CMNode original) {
-			CMElementDeclaration edecl = getDecl(original);
-			if (edecl == null)
-				return null;
-			return edecl.getElementName();
-		}
-
-		protected CMNode createBuddySystem(CMNode original) {
-			CMElementDeclaration edecl = getDecl(original);
-			return new CMElementDeclarationBuddySystem(edecl, isXHTML());
-		}
-
-		private CMElementDeclaration getDecl(CMNode cmnode) {
-			if (cmnode == null)
-				return null;
-			if (cmnode.getNodeType() != CMNode.ELEMENT_DECLARATION)
-				return null;
-			return (CMElementDeclaration) cmnode;
-		}
-
-		private void addSSIDecls() {
-			CMDocument ssi = SSICMDocumentFactory.getCMDocument();
-			if (ssi == null)
-				return;
-			CMNamedNodeMap elements = ssi.getElements();
-			Iterator i = elements.iterator();
-			while (i.hasNext()) {
-				CMElementDeclaration decl = (CMElementDeclaration) i.next();
-				if (decl == null)
-					continue;
-				put(decl.getElementName(), decl);
-			}
-		}
-	}
-
-	private Elements elements = null;
-
-	public CMDocumentForBuddySystem(CMDocument self, boolean isXHTML) {
-		super(self, getHTMLCMDocument(), isXHTML);
-	}
-
-	/*
-	 * @see CMDocument#getElements()
-	 */
-	public CMNamedNodeMap getElements() {
-		if (elements != null)
-			return elements;
-		CMDocument cmdoc = getSelf();
-		if (cmdoc == null)
-			return null;
-		elements = new Elements(cmdoc.getElements(), isXHTML);
-		return elements;
-	}
-
-	/*
-	 * @see CMDocument#getEntities()
-	 */
-	public CMNamedNodeMap getEntities() {
-		CMDocument cmdoc = getSelf();
-		if (cmdoc == null)
-			return null;
-		return cmdoc.getEntities();
-	}
-
-	/*
-	 * @see CMDocument#getNamespace()
-	 */
-	public CMNamespace getNamespace() {
-		CMDocument cmdoc = getSelf();
-		if (cmdoc == null)
-			return null;
-		return cmdoc.getNamespace();
-	}
-
-	private CMDocument getSelf() {
-		if (self.getNodeType() != CMNode.DOCUMENT)
-			return null;
-		return (CMDocument) self;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMElementDeclarationBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMElementDeclarationBuddySystem.java
deleted file mode 100644
index c71b4e0..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMElementDeclarationBuddySystem.java
+++ /dev/null
@@ -1,201 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-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.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- */
-class CMElementDeclarationBuddySystem extends CMNodeBuddySystem implements CMElementDeclaration {
-
-
-	private static CMDocument htmlcm = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
-
-	private static CMElementDeclaration getHTMLCMElemDecl(CMElementDeclaration original) {
-		CMElementDeclaration buddy = null;
-		if (htmlcm != null) {
-			CMNamedNodeMap elems = htmlcm.getElements();
-			if (elems != null) {
-				buddy = (CMElementDeclaration) elems.getNamedItem(original.getElementName());
-			}
-		}
-		return buddy;
-	}
-
-	private class Attrs extends CMNamedNodeMapForBuddySystem {
-		private CMNamedNodeMap buddyAttrs = null;
-
-		public Attrs(CMNamedNodeMap attrs, CMNamedNodeMap buddyAttrs, boolean isXHTML) {
-			super(isXHTML);
-			this.buddyAttrs = buddyAttrs;
-			makeBuddySystem(attrs);
-		}
-
-		protected String getKeyName(CMNode original) {
-			CMAttributeDeclaration adecl = getDecl(original);
-			if (adecl == null)
-				return null;
-			return adecl.getAttrName();
-		}
-
-		protected CMNode createBuddySystem(CMNode original) {
-			CMAttributeDeclaration adecl = getDecl(original);
-			if (adecl == null)
-				return null;
-			CMAttributeDeclaration buddy = null;
-			if (buddyAttrs != null) {
-				buddy = (CMAttributeDeclaration) buddyAttrs.getNamedItem(adecl.getAttrName());
-			}
-			return new CMAttributeDeclarationBuddySystem(adecl, buddy, isXHTML());
-		}
-
-		private CMAttributeDeclaration getDecl(CMNode cmnode) {
-			if (cmnode == null)
-				return null;
-			if (cmnode.getNodeType() != CMNode.ATTRIBUTE_DECLARATION)
-				return null;
-			return (CMAttributeDeclaration) cmnode;
-		}
-	}
-
-	private Attrs attributes = null;
-
-	public CMElementDeclarationBuddySystem(CMElementDeclaration self, boolean isXHTML) {
-		super(self, getHTMLCMElemDecl(self), isXHTML);
-	}
-
-	/*
-	 * @see CMElementDeclaration#getAttributes()
-	 */
-	public CMNamedNodeMap getAttributes() {
-		if (attributes != null)
-			return attributes;
-		CMElementDeclaration edecl = getSelf();
-		if (edecl == null)
-			return null;
-		CMElementDeclaration htmlDecl = getBuddy();
-		CMNamedNodeMap htmlAttrs = (htmlDecl == null) ? null : htmlDecl.getAttributes();
-		attributes = new Attrs(edecl.getAttributes(), htmlAttrs, isXHTML);
-		return attributes;
-	}
-
-	/*
-	 * @see CMElementDeclaration#getContent()
-	 */
-	public CMContent getContent() {
-		CMElementDeclaration edecl = getSelf();
-		if (edecl == null)
-			return null;
-		return edecl.getContent();
-	}
-
-	/*
-	 * @see CMElementDeclaration#getContentType()
-	 */
-	public int getContentType() {
-		CMElementDeclaration edecl = getSelf();
-		if (edecl == null)
-			return CMElementDeclaration.ANY;
-		return edecl.getContentType();
-	}
-
-	/*
-	 * @see CMElementDeclaration#getElementName()
-	 */
-	public String getElementName() {
-		CMElementDeclaration edecl = getSelf();
-		if (edecl == null)
-			return null;
-		return edecl.getElementName();
-	}
-
-	/*
-	 * @see CMElementDeclaration#getDataType()
-	 */
-	public CMDataType getDataType() {
-		CMElementDeclaration edecl = getSelf();
-		if (edecl == null)
-			return null;
-		return edecl.getDataType();
-	}
-
-	/*
-	 * @see CMElementDeclaration#getLocalElements()
-	 */
-	public CMNamedNodeMap getLocalElements() {
-		CMElementDeclaration edecl = getSelf();
-		if (edecl == null)
-			return null;
-		return edecl.getLocalElements();
-	}
-
-	/*
-	 * @see CMContent#getMaxOccur()
-	 */
-	public int getMaxOccur() {
-		CMElementDeclaration edecl = getSelf();
-		if (edecl == null)
-			return -1;
-		return edecl.getMaxOccur();
-	}
-
-	/*
-	 * @see CMContent#getMinOccur()
-	 */
-	public int getMinOccur() {
-		CMElementDeclaration edecl = getSelf();
-		if (edecl == null)
-			return -1;
-		return edecl.getMinOccur();
-	}
-
-	/*
-	 * @see CMNode#supports(String)
-	 */
-	public boolean supports(String propertyName) {
-		if (isXHTML && propertyName.equals(HTMLCMProperties.OMIT_TYPE))
-			return true;
-		return super.supports(propertyName);
-	}
-
-	/*
-	 * @see CMNode#getProperty(String)
-	 */
-	public Object getProperty(String propertyName) {
-		if (isXHTML && propertyName.equals(HTMLCMProperties.OMIT_TYPE))
-			return HTMLCMProperties.Values.OMIT_NONE;
-		return super.getProperty(propertyName);
-	}
-
-	private CMElementDeclaration getSelf() {
-		if (self.getNodeType() != CMNode.ELEMENT_DECLARATION)
-			return null;
-		return (CMElementDeclaration) self;
-	}
-
-	private CMElementDeclaration getBuddy() {
-		if (buddy == null)
-			return null;
-		if (buddy.getNodeType() != CMNode.ELEMENT_DECLARATION)
-			return null;
-		return (CMElementDeclaration) buddy;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNamedNodeMapForBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNamedNodeMapForBuddySystem.java
deleted file mode 100644
index 643daa6..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNamedNodeMapForBuddySystem.java
+++ /dev/null
@@ -1,109 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-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;
-
-/**
- */
-abstract class CMNamedNodeMapForBuddySystem implements CMNamedNodeMap {
-
-
-	private boolean isXHTML = false;
-	private Hashtable map = new Hashtable();
-
-	/**
-	 * Constructor of CMNamedNodeMapForBuddySystem.
-	 * CAUTION: Each derived class must call 'makeBuddySystem' method in its
-	 * constructor to build up its contents.
-	 */
-	public CMNamedNodeMapForBuddySystem(boolean isXHTML) {
-		super();
-		this.isXHTML = isXHTML;
-	}
-
-	/*
-	 * @see CMNamedNodeMap#getLength()
-	 */
-	public int getLength() {
-		return map.size();
-	}
-
-	/*
-	 * @see CMNamedNodeMap#getNamedItem(String)
-	 */
-	public CMNode getNamedItem(String name) {
-		String key = canonicalName(name);
-		if (!map.containsKey(key))
-			return null;
-		return (CMNode) map.get(key);
-	}
-
-	/*
-	 * @see CMNamedNodeMap#item(int)
-	 */
-	public CMNode item(int index) {
-		Iterator iter = iterator();
-		while (iter.hasNext()) {
-			Object node = iter.next();
-			if (--index < 0)
-				return (CMNode) node;
-		}
-		return null;
-	}
-
-	/*
-	 * @see CMNamedNodeMap#iterator()
-	 */
-	public Iterator iterator() {
-		return map.values().iterator();
-	}
-
-	/* package scope. */
-	void put(String name, CMNode cmnode) {
-		if (name == null || cmnode == null)
-			return;
-		map.put(canonicalName(name), cmnode);
-	}
-
-	abstract protected String getKeyName(CMNode original);
-
-	abstract protected CMNode createBuddySystem(CMNode original);
-
-	protected boolean isXHTML() {
-		return isXHTML;
-	}
-
-	/**
-	 * Each derived class must call this method in its constructor
-	 * to build up its contents.
-	 */
-	protected void makeBuddySystem(CMNamedNodeMap original) {
-		Iterator i = original.iterator();
-		if (i == null)
-			return;
-		while (i.hasNext()) {
-			CMNode org = (CMNode) i.next();
-			String key = getKeyName(org);
-			CMNode newNode = createBuddySystem(org);
-			put(key, newNode);
-		}
-	}
-
-	private String canonicalName(String name) {
-		return name.toUpperCase();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNodeBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNodeBuddySystem.java
deleted file mode 100644
index b7a8be7..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNodeBuddySystem.java
+++ /dev/null
@@ -1,74 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- */
-class CMNodeBuddySystem implements CMNode {
-
-
-	protected boolean isXHTML = false;
-	protected CMNode self = null;
-	protected CMNode buddy = null;
-
-	public CMNodeBuddySystem(CMNode self, CMNode buddy, boolean isXHTML) {
-		super();
-		this.self = self;
-		this.buddy = buddy;
-		this.isXHTML = isXHTML;
-	}
-
-	/*
-	 * @see CMNode#getNodeName()
-	 */
-	public String getNodeName() {
-		return self.getNodeName();
-	}
-
-	/*
-	 * @see CMNode#getNodeType()
-	 */
-	public int getNodeType() {
-		return self.getNodeType();
-	}
-
-	/*
-	 * @see CMNode#supports(String)
-	 */
-	public boolean supports(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
-			return true;
-		if (propertyName.equals(HTMLCMProperties.IS_XHTML))
-			return true;
-		if (buddy == null)
-			return false;
-		return buddy.supports(propertyName);
-	}
-
-	/*
-	 * @see CMNode#getProperty(String)
-	 */
-	public Object getProperty(String propertyName) {
-		if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
-			return new Boolean(!isXHTML);
-		}
-		if (propertyName.equals(HTMLCMProperties.IS_XHTML)) {
-			return new Boolean(isXHTML);
-		}
-
-		if (buddy == null || (!buddy.supports(propertyName)))
-			return null;
-		return buddy.getProperty(propertyName);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/DocumentQuery.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/DocumentQuery.java
deleted file mode 100644
index e72c263..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/DocumentQuery.java
+++ /dev/null
@@ -1,200 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.ranges.Range;
-
-/**
- */
-public interface DocumentQuery {
-
-	/**
-	 * isRenderRoot() returns true if - node is BODY element (both explicit
-	 * and implicit) - node is portalhtml:body element - node is Document node
-	 * and the document is treated as fragment (with BODY context) Note that
-	 * in editing a fragment file, Document node should be treated as a
-	 * substitute of BODY element.
-	 */
-	boolean isRenderRoot(Node node);
-
-	/**
-	 * isHeadCorrespondent() returns true if - node is HEAD element (both
-	 * explicit and implicit) - node is portalhtml:head element - node is
-	 * Document node and the document is treated as fragment (with HEAD
-	 * context) Note that in editing a fragment file (with HEAD context),
-	 * Document node should be treated as a substitute of HEAD element.
-	 */
-	boolean isHeadCorrespondent(Node node);
-
-	/**
-	 * Implicit BODY element will be gone in V6 SED model. So page designer
-	 * provides an API to get a range whose content nodes are rendered in
-	 * design view. getRenderRootRange() returns - a range from BODY's first
-	 * to its last (if the document has BODY element) - a range form
-	 * Document's first to its last (if the document is fragment with BODY
-	 * context) - null (if the document is fragment with HEAD context) [The
-	 * following cases will be supported since V6] - a range from a custom
-	 * tag's first to its last (if the document has a custom tag which
-	 * generates BODY element at runtime) - a range from Document's
-	 * appropirate offset to its last (if the document does not have explicit
-	 * BODY/HTML) - a range from HTML element's appropriate offset to its last
-	 * (if the document does not have explicit BODY but have explicit HTML)
-	 * 
-	 * @param doc
-	 * @return
-	 */
-	Range getRenderRootRange(Document doc);
-
-	/**
-	 * Implicit HEAD element will be gone in V6 SED model. So page designer
-	 * provides an API to get a range whose content nodes are treated as HEAD
-	 * element's child. getHeadCorrespondentRange() returns - a range from
-	 * HEAD's first to its last (if the document has HEAD element) - a range
-	 * form Document's first to its last (if the document is fragment with
-	 * HEAD context) - null (if the document is fragment with BODY context)
-	 * [The following cases will be supported since V6] - a range from a
-	 * custom tag's first to its last (if the document has a custom tag which
-	 * generates HEAD element at runtime) - a range from Document's first to
-	 * appropirate offset (if the document does not have explicit HEAD/HTML) -
-	 * a range from HTML element's first to appropriate offset (if the
-	 * document does not have explicit HEAD but have explicit HTML)
-	 * 
-	 * @param doc
-	 * @return
-	 */
-	Range getHeadCorrespondentRange(Document doc);
-
-	/**
-	 * getRenderRootNode() with [create=false] returns - BODY element if this
-	 * document is not fragment and has BODY element - null if this document
-	 * is not fragment and does not have BODY element - Document node if this
-	 * document is fragment with BODY context - null if this document is
-	 * fragment with HEAD context [The following cases will be supported since
-	 * V6] - a custom tag which generates BODY tag at runtime - Document node
-	 * or HTML element if this document is not fragment but does not have
-	 * explicit BODY element getRenderRootNode() with [create=true] returns -
-	 * BODY element if this document is not fragment and has BODY element (no
-	 * modifictation) - newly created BODY element if this document is not
-	 * fragment but does not have BODY element - Document node if this
-	 * document is fragment with BODY context (no modifictation) [The
-	 * following cases will be supported since V6] - a custom tag which
-	 * generates BODY tag at runtime (no modifictation) - newly created BODY
-	 * element if this document is not fragment but does not have explicit
-	 * BODY element getRenderRootNode() throws HTMLCommandException (since V6)
-	 * if - this document is fragment with HEAD context and - "create"
-	 * parameter is true Note that in editing a fragment file, Document node
-	 * should be treated as a substitute of BODY element.
-	 * 
-	 * @param childOrDocument
-	 * @param create
-	 * @return
-	 */
-	Node getRenderRootNode(Node childOrDocument, boolean create);
-
-	/**
-	 * getHeadCorrespondentNode() with [create=false] returns - HEAD element
-	 * if this document is not fragment and has HEAD element - null if this
-	 * document is not fragment and does not have HEAD element - Document node
-	 * if this document is fragment with HEAD context - null if this document
-	 * is fragment with BODY context [The following cases will be supported
-	 * since V6] - a custom tag which generates HEAD tag at runtime - Document
-	 * node or HTML element if this document is not fragment but does not have
-	 * explicit HEAD element getHeadCorrespondentNode() with [create=true]
-	 * returns - HEAD element if this document is not fragment and has HEAD
-	 * element (no modifictation) - newly created HEAD element if this
-	 * document is not fragment but does not have HEAD element - Document node
-	 * if this document is fragment with HEAD context (no modifictation) [The
-	 * following cases will be supported since V6] - a custom tag which
-	 * generates HEAD tag at runtime (no modifictation) - newly created HEAD
-	 * element if this document is not fragment but does not have explicit
-	 * HEAD element getHeadCorrespondentNode() throws HTMLCommandException
-	 * (since V6) if - this document is fragment with BODY context and -
-	 * "create" parameter is true Note that in editing a fragment file,
-	 * Document node should be treated as a substitute of HEAD element.
-	 * 
-	 * @param childOrDocument
-	 * @param create
-	 * @return
-	 */
-	Node getHeadCorrespondentNode(Node childOrDocument, boolean create);
-
-	/**
-	 * getHtmlCorrespondentNode() throws HTMLCommandException (since V6) if -
-	 * this document is fragment and "create" parameter is true
-	 * 
-	 * @param childOrDocument
-	 * @param create
-	 * @return
-	 */
-	Node getHtmlCorrespondentNode(Node childOrDocument, boolean create);
-
-	/**
-	 * This inner class is intended for insertion target. please use this like
-	 * the following : DocumentQuery.InsertionTarget ins;
-	 * ins.getParent().insertBefore(youInsertionNode, ins.getRef());
-	 */
-	public class InsertionTarget {
-		private final Node parent;
-		private final Node ref;
-
-		public InsertionTarget(Node parent, Node ref) {
-			this.parent = parent;
-			this.ref = ref;
-		}
-
-		public Node getParent() {
-			return parent;
-		}
-
-		public Node getRef() {
-			return ref;
-		}
-	}
-
-	/**
-	 * getHeadInsertionTarget() returns appropriate insetion target location
-	 * for HEAD child tags such as <script>, <style>, <meta>etc. Basically
-	 * this function returns <HEAD>tag's the last position. Note that this
-	 * would not create actual <HEAD>tag when the document does not have it.
-	 * <HEAD>is omittable tag so this function returns appropriate position
-	 * to which implicit <HEAD>can be inserted, if the document has no
-	 * <HEAD>.
-	 * 
-	 * @param doc
-	 * @return
-	 */
-	InsertionTarget getHeadInsertionTarget(Document doc);
-
-	/**
-	 * getPageInsertionTarget() returns appropriate insetion target location
-	 * for page-level markups, such as JSP directives, usebean tags or <html>
-	 * tag. Basically this function returns just before <HTML>tag. Note that
-	 * this would not create actual <HTML>tag when the document does not have
-	 * it. In such case, this function returns a position just before the
-	 * meaningful tags such as HTML/JSP elements.
-	 * 
-	 * @param doc
-	 * @return
-	 */
-	InsertionTarget getPageInsertionTarget(Document doc);
-
-	/**
-	 * isFragment() returns whether the document is fragment or complete
-	 * document
-	 * 
-	 * @param doc
-	 * @return
-	 */
-	boolean isFragment(Document doc);
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapter.java
deleted file mode 100644
index 23e396d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapter.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- */
-public interface ElementDeclarationAdapter extends INodeAdapter {
-
-	/**
-	 */
-	CMElementDeclaration getDeclaration();
-
-	/**
-	 */
-	void setDeclaration(CMElementDeclaration declaration);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapterFactory.java
deleted file mode 100644
index a4981cb..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapterFactory.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-
-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 ElementDeclarationAdapterFactory implements INodeAdapterFactory {
-
-	private static ElementDeclarationAdapterFactory instance = null;
-
-	/**
-	 */
-	private ElementDeclarationAdapterFactory() {
-		super();
-	}
-
-	/**
-	 */
-	public INodeAdapter adapt(INodeNotifier notifier) {
-		if (notifier == null)
-			return null;
-		INodeAdapter adapter = notifier.getExistingAdapter(ElementDeclarationAdapter.class);
-		if (adapter != null)
-			return adapter;
-		adapter = new HTMLElementDeclarationAdapter();
-		notifier.addAdapter(adapter);
-		return adapter;
-	}
-
-	/**
-	 */
-	public synchronized static ElementDeclarationAdapterFactory getInstance() {
-		if (instance == null)
-			instance = new ElementDeclarationAdapterFactory();
-		return instance;
-	}
-
-	/**
-	 */
-	public boolean isFactoryForType(Object type) {
-		return (type == ElementDeclarationAdapter.class);
-	}
-
-	public void release() {
-		// default is to do nothing
-	}
-
-	/**
-	 * Overriding copy method
-	 */
-	public INodeAdapterFactory copy() {
-		return getInstance();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HMQUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HMQUtil.java
deleted file mode 100644
index 42ddb16..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HMQUtil.java
+++ /dev/null
@@ -1,121 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-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.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.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public final class HMQUtil {
-
-	private final static Vector nullVector = new Vector();
-
-	/* HMQUtil class must not instantiate. */
-	private HMQUtil() {
-		super();
-	}
-
-	/* gather all element declarations in inclusion of each parent of the target. 
-	 * the inclusion of the target is also gathered. */
-	public static Collection getInclusions(Element target) {
-		if (target == null)
-			return nullVector;
-		Collection inclusions = gatherInclusions(getAncestorDeclarations(target));
-
-		Hashtable availables = new Hashtable();
-		Iterator iter = inclusions.iterator();
-		while (iter.hasNext()) {
-			CMContent inclusion = (CMContent) iter.next();
-			switch (inclusion.getNodeType()) {
-				case CMNode.GROUP :
-					extractDeclarations(availables, (CMGroup) inclusion);
-					break;
-				case CMNode.ELEMENT_DECLARATION :
-					addInclusion(availables, (CMElementDeclaration) inclusion);
-					break;
-			}
-		}
-
-		return availables.values();
-	}
-
-	private static Collection getAncestorDeclarations(Element target) {
-		Vector ancestors = new Vector();
-
-		Document doc = target.getOwnerDocument();
-		ModelQuery query = ModelQueryUtil.getModelQuery(doc);
-		CMElementDeclaration decl = query.getCMElementDeclaration(target);
-		ancestors.add(decl);
-
-		Element parent = getParent(target);
-		while (parent != null) {
-			decl = query.getCMElementDeclaration(parent);
-			if (decl != null)
-				ancestors.add(decl);
-			parent = getParent(parent);
-		}
-		return ancestors;
-	}
-
-	private static void addInclusion(Hashtable availables, CMElementDeclaration decl) {
-		String name = decl.getElementName();
-		if (availables.containsKey(name))
-			return;
-		availables.put(name, decl);
-	}
-
-	private static Collection gatherInclusions(Collection ancestors) {
-		Vector inclusions = new Vector();
-		Iterator iter = ancestors.iterator();
-		while (iter.hasNext()) {
-			CMElementDeclaration decl = (CMElementDeclaration) iter.next();
-			if (decl.supports(HTMLCMProperties.INCLUSION)) {
-				CMContent inclusion = (CMContent) decl.getProperty(HTMLCMProperties.INCLUSION);
-				if (inclusion != null)
-					inclusions.add(inclusion);
-			}
-		}
-		return inclusions;
-	}
-
-	private static Element getParent(Node target) {
-		Node parent = target.getParentNode();
-		while (parent != null) {
-			if (parent.getNodeType() == Node.ELEMENT_NODE)
-				return (Element) parent;
-			parent = parent.getParentNode();
-		}
-		return null;
-	}
-
-	private static void extractDeclarations(Hashtable availables, CMGroup group) {
-		CMNodeList content = group.getChildNodes();
-		for (int i = 0; i < content.getLength(); i++) {
-			CMNode cmn = content.item(i);
-			if (cmn == null || cmn.getNodeType() != CMNode.ELEMENT_DECLARATION)
-				continue;
-			addInclusion(availables, (CMElementDeclaration) cmn);
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLElementDeclarationAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLElementDeclarationAdapter.java
deleted file mode 100644
index 8797f54..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLElementDeclarationAdapter.java
+++ /dev/null
@@ -1,54 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- */
-public class HTMLElementDeclarationAdapter implements ElementDeclarationAdapter {
-
-	private CMElementDeclaration declaration = null;
-
-	/**
-	 */
-	public HTMLElementDeclarationAdapter() {
-		super();
-	}
-
-	/**
-	 */
-	public CMElementDeclaration getDeclaration() {
-		return this.declaration;
-	}
-
-	/**
-	 * 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 == ElementDeclarationAdapter.class);
-	}
-
-	/**
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-	}
-
-	/**
-	 */
-	public void setDeclaration(CMElementDeclaration declaration) {
-		this.declaration = declaration;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryAssociationProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryAssociationProvider.java
deleted file mode 100644
index e1a0d98..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryAssociationProvider.java
+++ /dev/null
@@ -1,54 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.SimpleAssociationProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-
-/**
- */
-public class HTMLModelQueryAssociationProvider extends SimpleAssociationProvider {
-
-	/**
-	 * @param modelQueryCMProvider org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryCMProvider
-	 */
-	public HTMLModelQueryAssociationProvider(CMDocumentCache cache, URIResolver idResolver) {
-		super(new HTMLModelQueryCMProvider(cache, idResolver));
-	}
-
-	// MIWA: We cannot cache a CMElementDeclaration any more.  Because, when the DOCTYPE
-	// was changed, CMDocument would be changed.  Then, a cached CMElementDeclaration
-	// would be invalid.  If some performance problems occurs, we consider a smarter
-	// cache mechanism.
-	//
-	//	public CMElementDeclaration getCMElementDeclaration(Element element) {
-	//		// check if element declaration is cached
-	//		INodeNotifier notifier = (INodeNotifier) element;
-	//		ElementDeclarationAdapter adapter = (ElementDeclarationAdapter) notifier.getExistingAdapter(ElementDeclarationAdapter.class);
-	//		if (adapter != null)
-	//			return adapter.getDeclaration();
-	//
-	//		CMElementDeclaration decl = super.getCMElementDeclaration(element);
-	//
-	//		// cache HTML element declaration only
-	//		if (decl != null && decl instanceof HTMLElementDeclaration) {
-	//			IAdapterFactory factory = ElementDeclarationAdapterFactory.getInstance();
-	//			adapter = (ElementDeclarationAdapter) factory.adapt(notifier);
-	//			if (adapter != null)
-	//				adapter.setDeclaration(decl);
-	//		}
-	//
-	//		return decl;
-	//	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 53ac1d9..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java
+++ /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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryCMProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Node;
-
-/**
- * CMDocument provider for HTML and XHTML documents.
- */
-public class HTMLModelQueryCMProvider implements ModelQueryCMProvider {
-
-
-	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();
-	private static Hashtable buddyCache = new Hashtable();
-
-	private XHTMLAssociationProvider xhtmlassoc = null;
-
-	public HTMLModelQueryCMProvider(CMDocumentCache cache, URIResolver idResolver) {
-		super();
-		xhtmlassoc = new XHTMLAssociationProvider(cache, idResolver);
-	}
-
-	/**
-	 * Returns the CMDocument that corresponds to the DOM Node.
-	 * or null if no CMDocument is appropriate for the DOM Node.
-	 */
-	public CMDocument getCorrespondingCMDocument(Node node) {
-		IDOMDocument owner = getOwnerXMLDocument(node);
-		if (owner == null)
-			return null;
-
-		String pid = getPublicId(owner);
-		if (pid == null)
-			return staticHTML;
-
-		HTMLDocumentTypeEntry entry = doctypeRegistry.getEntry(pid);
-		if (entry == null)
-			return staticHTML;
-
-		pid = entry.getPublicId();
-		CMDocument dtdcm = xhtmlassoc.getXHTMLCMDocument(pid, entry.getSystemId());
-		if (dtdcm == null) {
-			if (pid != null && pid.equals(HTMLDocumentTypeRegistry.CHTML_PUBLIC_ID)) {
-				return staticCHTML;
-			}
-			return staticHTML;
-		}
-
-		CMDocument buddycm = (CMDocument) buddyCache.get(pid);
-		if (buddycm != null)
-			return buddycm;
-
-		buddycm = new CMDocumentForBuddySystem(dtdcm, entry.isXMLType());
-		buddyCache.put(pid, buddycm);
-		return buddycm;
-	}
-
-	// private methods
-	private IDOMDocument getOwnerXMLDocument(Node node) {
-		if (node == null)
-			return null;
-		Document owner = (node.getNodeType() == Node.DOCUMENT_NODE) ? (Document) node : node.getOwnerDocument();
-		if (owner == null)
-			return null;
-		if (!(owner instanceof IDOMDocument))
-			return null;
-		return (IDOMDocument) owner;
-	}
-
-	private String getPublicId(IDOMDocument doc) {
-		if (doc == null)
-			return null;
-		DocumentType doctype = doc.getDoctype();
-		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
deleted file mode 100644
index 8786484..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java
+++ /dev/null
@@ -1,140 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-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.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-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.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.MovableModelQuery;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class HTMLModelQueryImpl extends ModelQueryImpl implements MovableModelQuery {
-
-	protected CMDocumentCache fCache = null;
-
-	public HTMLModelQueryImpl(CMDocumentCache cache, URIResolver idResolver) {
-		super(new HTMLModelQueryAssociationProvider(cache, idResolver));
-		fCache = cache;
-	}
-
-	public List getAvailableContent(Element element, CMElementDeclaration ed, int includeOptions) {
-		List originalCandidates = super.getAvailableContent(element, ed, includeOptions);
-		if ((includeOptions & INCLUDE_CHILD_NODES) == 0)
-			return originalCandidates;
-		// When the target document is XHTML, it is waste to find inclusions,
-		// since inclusion is available in HTML only.
-		if (!ed.supports(HTMLCMProperties.IS_XHTML))
-			return originalCandidates;
-		
-		Boolean isXhtml = Boolean.FALSE;
-		isXhtml = (Boolean) ed.getProperty(HTMLCMProperties.IS_XHTML);
-		if (isXhtml != null && isXhtml.booleanValue())
-			return originalCandidates;
-
-		// OK, the target is surely a HTML element, so it may have inclusion.
-		// Try to find it.
-		Vector candidates = new Vector(originalCandidates);
-
-		switch (ed.getContentType()) {
-			case CMElementDeclaration.ANY :
-			case CMElementDeclaration.ELEMENT :
-			case CMElementDeclaration.MIXED :
-				// do enumerate inclusions.
-				candidates.addAll(HMQUtil.getInclusions(element));
-				break;
-			case CMElementDeclaration.EMPTY :
-			case CMElementDeclaration.PCDATA :
-			case CMElementDeclaration.CDATA :
-			default :
-				// should not add any inclusions.
-				// so, nothing to do here.
-				break;
-		}
-		// If the current element does not available, it is impossible
-		// to filter out exclusion.
-		if (element == null)
-			return candidates;
-
-		// 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);
-		}
-
-		return content;
-	}
-
-	/**
-	 * @see MovableModelQuery#setIdResolver(IdResolver)
-	 */
-	public void setIdResolver(URIResolver newIdResolver) {
-		modelQueryAssociationProvider = new HTMLModelQueryAssociationProvider(fCache, newIdResolver);
-	}
-
-	// utilities
-	private static boolean isExcluded(CMElementDeclaration candidate, Element target) {
-		CMNamedNodeMap prohibited = getProhibitedAncestors(candidate);
-		if (prohibited == null)
-			return false;
-		Element parent = target;
-		while (parent != null) {
-			CMNode pdec = prohibited.getNamedItem(parent.getNodeName());
-			if (pdec != null)
-				return true;
-			parent = getExplicitParentElement(parent);
-		}
-		return false;
-	}
-
-	private static CMNamedNodeMap getProhibitedAncestors(CMElementDeclaration dec) {
-		if (!dec.supports(HTMLCMProperties.PROHIBITED_ANCESTORS))
-			return null;
-		return (CMNamedNodeMap) dec.getProperty(HTMLCMProperties.PROHIBITED_ANCESTORS);
-	}
-
-	/* get an ancestor element ignoring implicit ones. */
-	private static Element getExplicitParentElement(Node child) {
-		if (child == null)
-			return null;
-
-		Node p = child.getParentNode();
-		while (p != null) {
-			if (p.getNodeType() == Node.ELEMENT_NODE) {
-				if (p instanceof IDOMElement) {
-					if (((IDOMElement) p).isImplicitTag()) {
-						p = p.getParentNode();
-						continue;
-					}
-				}
-				return (Element) p;
-			}
-			p = p.getParentNode();
-		}
-		return null;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedHTML.java
deleted file mode 100644
index ef7c263..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedHTML.java
+++ /dev/null
@@ -1,47 +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.html.core.internal.modelquery;
-
-
-
-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.ssemodelquery.ModelQueryAdapter;
-
-public class ModelQueryAdapterFactoryForEmbeddedHTML extends ModelQueryAdapterFactoryForHTML {
-
-
-	/**
-	 * Constructor for ModelQueryAdapterFactoryForEmbeddedHTML.
-	 */
-	public ModelQueryAdapterFactoryForEmbeddedHTML() {
-		super(ModelQueryAdapter.class, false);
-	}
-
-
-	public INodeAdapterFactory copy() {
-
-		return new ModelQueryAdapterFactoryForEmbeddedHTML();
-	}
-
-	/**
-	 * 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);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForHTML.java
deleted file mode 100644
index 125df78..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForHTML.java
+++ /dev/null
@@ -1,212 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-
-import java.io.File;
-
-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.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.html.core.internal.Logger;
-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.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.modelquery.XMLCatalogIdResolver;
-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;
-
-/**
- * Creates a ModelQueryAdapter for HTML models
- */
-public class ModelQueryAdapterFactoryForHTML extends AbstractAdapterFactory {
-
-	ModelQueryAdapterImpl modelQueryAdapter;
-	IStructuredModel modelStateNotifier;
-	private InternalModelStateListener internalModelStateListener;
-
-	class InternalModelStateListener implements IModelStateListener {
-
-		/**
-		 * @see IModelStateListener#modelAboutToBeChanged(IStructuredModel)
-		 */
-		public void modelAboutToBeChanged(IStructuredModel model) {
-			// ISSUE: should we "freeze" state, or anything?
-		}
-
-		public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
-			// ISSUE: should we "freeze" state, or anything?
-
-		}
-
-		/**
-		 * @see IModelStateListener#modelChanged(IStructuredModel)
-		 */
-		public void modelChanged(IStructuredModel model) {
-			// nothing to do?
-		}
-
-		/**
-		 * @see IModelStateListener#modelDirtyStateChanged(IStructuredModel,
-		 *      boolean)
-		 */
-		public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
-			// nothing to do
-		}
-
-		public void modelReinitialized(IStructuredModel structuredModel) {
-			updateResolver(structuredModel);
-		}
-
-		/**
-		 * @see IModelStateListener#modelResourceDeleted(IStructuredModel)
-		 */
-		public void modelResourceDeleted(IStructuredModel model) {
-			// nothing to do?
-		}
-
-		/**
-		 * @see IModelStateListener#modelResourceMoved(IStructuredModel,
-		 *      IStructuredModel)
-		 */
-		public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) {
-			modelStateNotifier.removeModelStateListener(this);
-			modelStateNotifier = newModel;
-			updateResolver(modelStateNotifier);
-			modelStateNotifier.addModelStateListener(this);
-		}
-
-		private void updateResolver(IStructuredModel model) {
-			String baseLocation = model.getBaseLocation();
-			IFile baseFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
-			if (baseFile != null) {
-				baseLocation = baseFile.getLocation().toString();
-			}
-			modelQueryAdapter.setIdResolver(new XMLCatalogIdResolver(baseLocation, model.getResolver()));
-		}
-
-	}
-
-
-	/**
-	 * ModelQueryAdapterFactoryForHTML constructor comment. Note: this is a
-	 * case there the key is not exactly same as the class we are after.
-	 */
-	public ModelQueryAdapterFactoryForHTML() {
-		super(ModelQueryAdapter.class, true);
-	}
-
-	/**
-	 * We need this protected version to allow subclasses to pass up standard
-	 * behaviour.
-	 * 
-	 * @param adapterKey
-	 * @param registerAdapters
-	 */
-
-	protected ModelQueryAdapterFactoryForHTML(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-
-
-	public INodeAdapterFactory copy() {
-
-		return new ModelQueryAdapterFactoryForHTML();
-	}
-
-	public void release() {
-		super.release();
-		if (modelStateNotifier != null) {
-			modelStateNotifier.removeModelStateListener(internalModelStateListener);
-		}
-
-		modelStateNotifier = null;
-
-		if (modelQueryAdapter != null) {
-			modelQueryAdapter.release();
-		}
-	}
-
-	/**
-	 * createAdapter method comment.
-	 * 
-	 * XXX: we must make this method more independent of 'location' (at least
-	 * provide some fall-back method).
-	 */
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-
-		if (Debug.displayInfo) {
-			Logger.log(Logger.INFO_DEBUG, "-----------------------ModelQueryAdapterFactoryForHTML.createAdapter" + target); //$NON-NLS-1$
-		}
-		if (modelQueryAdapter == null) {
-			if (target instanceof IDOMNode) {
-				IDOMNode xmlNode = (IDOMNode) target;
-				modelStateNotifier = xmlNode.getModel();
-				modelStateNotifier.addModelStateListener(getInternalModelStateListener());
-
-				IStructuredModel model = xmlNode.getModel();
-				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());
-						IPath derivedPath = null;
-						if (basePath.segmentCount() > 1)
-							derivedPath = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath).getLocation();
-						else
-							derivedPath = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(basePath);
-						if (derivedPath != null) {
-							baseLocation = derivedPath.toString();
-						}
-					}
-				}
-				if (Debug.displayInfo)
-					System.out.println("----------------ModelQueryAdapterFactoryForHTML... baseLocation : " + baseLocation); //$NON-NLS-1$
-
-				CMDocumentCache cmDocumentCache = new CMDocumentCache();
-				URIResolver idResolver = null;
-
-				org.eclipse.wst.sse.core.internal.util.URIResolver resolver = model.getResolver();
-				if (baseLocation != null || resolver != null) {
-					idResolver = new XMLCatalogIdResolver(baseLocation, resolver);
-				}
-				ModelQuery modelQuery = new HTMLModelQueryImpl(cmDocumentCache, idResolver);
-				modelQuery.setEditMode(ModelQuery.EDIT_MODE_UNCONSTRAINED);
-				modelQueryAdapter = new ModelQueryAdapterImpl(cmDocumentCache, modelQuery, idResolver);
-			}
-		}
-		return modelQueryAdapter;
-	}
-
-
-
-	private final InternalModelStateListener getInternalModelStateListener() {
-		if (internalModelStateListener == null) {
-			internalModelStateListener = new InternalModelStateListener();
-		}
-		return internalModelStateListener;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 5a1eecf..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java
+++ /dev/null
@@ -1,95 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-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.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 {
-
-	protected URIResolver idResolver = null;
-	private String fCachedGrammerURI;
-	private String fCachedPublicID;
-	private String fCachedSystemID;
-	private static final boolean USE_QUICK_CACHE = true;
-
-	public XHTMLAssociationProvider(CMDocumentCache cache, URIResolver idResolver) {
-		super(cache);
-		this.idResolver = idResolver;
-	}
-
-	/**
-	 * 
-	 * @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 identiical 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 (fCachedGrammerURI != null && fCachedPublicID.equals(publicId) && fCachedSystemID.equals(systemId)) {
-				grammerURI = fCachedGrammerURI;
-			}
-			else {
-				grammerURI = idResolver.resolve(null, publicId, systemId);
-				fCachedGrammerURI = grammerURI;
-				fCachedPublicID = publicId;
-				fCachedSystemID = systemId;
-			}
-		}
-		else {
-			grammerURI = idResolver.resolve(null, publicId, systemId);
-		}
-
-		if (grammerURI == null)
-			return null;
-
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88896
-		// previously called the deprecated 2 argument form of getCMDocument,
-		// which eventually
-		// resulted in empty string for type, which I don't think the
-		// infrastructure was prepared
-		// for. So, I deleted deprecated methods, and switched to null.
-		// 'null' means to "create based on uri"
-		// and 'dtd' would work to mean load only those registered as dtd's
-		// CMDocument cmDocument = documentManager.getCMDocument(publicId,
-		// grammerURI);
-		// CMDocument cmDocument = documentManager.getCMDocument(publicId,
-		// grammerURI, "dtd");
-		CMDocument cmDocument = documentManager.getCMDocument(publicId, grammerURI, null);
-		return cmDocument;
-	}
-
-	/**
-	 */
-	protected String resolveGrammarURI(Document document, String publicId, String systemId) {
-		return idResolver.resolve(null, publicId, systemId);
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 1683e1c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
+++ /dev/null
@@ -1,59 +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.html.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.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-/**
- * Sets default values for HTML Core preferences
- */
-public class HTMLCorePreferenceInitializer extends AbstractPreferenceInitializer {
-
-	public void initializeDefaultPreferences() {
-		IEclipsePreferences node = new DefaultScope().getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
-
-		// formatting preferences
-		node.putInt(HTMLCorePreferenceNames.LINE_WIDTH, 72);
-		node.putBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES, false);
-		node.put(HTMLCorePreferenceNames.INDENTATION_CHAR, HTMLCorePreferenceNames.TAB);
-		node.putInt(HTMLCorePreferenceNames.INDENTATION_SIZE, 1);
-		node.putBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS, false);
-
-		// cleanup preferences
-		node.putInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE, HTMLCorePreferenceNames.ASIS);
-		node.putInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE, HTMLCorePreferenceNames.ASIS);
-		// node.putBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS,
-		// true);
-		node.putBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, true);
-		node.putBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS, true);
-		node.putBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES, true);
-		node.putBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE, true);
-		node.putBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES, false);
-
-		// code generation preferences
-		node.put(CommonEncodingPreferenceNames.INPUT_CODESET, ""); //$NON-NLS-1$
-		String defaultEnc = "UTF-8";//$NON-NLS-1$
-		String systemEnc = System.getProperty("file.encoding"); //$NON-NLS-1$
-		if (systemEnc != null) {
-			defaultEnc = CommonCharsetNames.getPreferredDefaultIanaName(systemEnc, "UTF-8");//$NON-NLS-1$
-		}
-		node.put(CommonEncodingPreferenceNames.OUTPUT_CODESET, defaultEnc);
-		node.put(CommonEncodingPreferenceNames.END_OF_LINE_CODE, ""); //$NON-NLS-1$
-
-		node.putInt(HTMLCorePreferenceNames.TAG_NAME_CASE, HTMLCorePreferenceNames.LOWER);
-		node.putInt(HTMLCorePreferenceNames.ATTR_NAME_CASE, HTMLCorePreferenceNames.LOWER);
-	}
-}
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
deleted file mode 100644
index 90e1d78..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
+++ /dev/null
@@ -1,214 +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
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.preferences;
-
-/**
- * Common preference keys used by HTML core
- * 
- * @plannedfor 1.0
- */
-public class HTMLCorePreferenceNames {
-	private HTMLCorePreferenceNames() {
-		// empty private constructor so users cannot instantiate class
-	}
-
-	/**
-	 * 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>
-	 */
-	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 case to use on all tag names during cleanup.
-	 * <p>
-	 * Value is of type <code>Integer</code>.<br />
-	 * Possible values: {LOWER, UPPER, ASIS}
-	 * </p>
-	 */
-	public static final String CLEANUP_TAG_NAME_CASE = "cleanupTagNameCase";//$NON-NLS-1$
-
-	/**
-	 * Indicates case to use on all attribute names during cleanup.
-	 * <p>
-	 * Value is of type <code>Integer</code>.<br />
-	 * Possible values: {LOWER, UPPER, ASIS}
-	 * </p>
-	 */
-	public static final String CLEANUP_ATTR_NAME_CASE = "cleanupAttrNameCase";//$NON-NLS-1$
-
-	/**
-	 * Preferred markup case for tag names in code generation
-	 * <p>
-	 * Value is of type <code>Integer</code>.<br />
-	 * Possible values: {LOWER, UPPER}
-	 * </p>
-	 */
-	public static final String TAG_NAME_CASE = "tagNameCase";//$NON-NLS-1$
-
-	/**
-	 * Preferred markup case for attribute names in code generation
-	 * <p>
-	 * Value is of type <code>Integer</code>.<br />
-	 * Possible values: {LOWER, UPPER}
-	 * </p>
-	 */
-	public static final String ATTR_NAME_CASE = "attrNameCase";//$NON-NLS-1$
-
-	/**
-	 * Possible value for the preference #TAG_NAME_CASE or #ATTR_NAME_CASE.
-	 * Indicates to leave case as is.
-	 * 
-	 * @see #LOWER
-	 * @see #UPPER
-	 * @see #TAG_NAME_CASE
-	 * @see #ATTR_NAME_CASE
-	 */
-	public static final int ASIS = 0;
-
-	/**
-	 * Possible value for the preference #TAG_NAME_CASE or #ATTR_NAME_CASE.
-	 * Indicates to make name lowercase.
-	 * 
-	 * @see #ASIS
-	 * @see #UPPER
-	 * @see #TAG_NAME_CASE
-	 * @see #ATTR_NAME_CASE
-	 */
-	public static final int LOWER = 1;
-
-	/**
-	 * Possible value for the preference #TAG_NAME_CASE or #ATTR_NAME_CASE.
-	 * Indicates to make name uppercase.
-	 * 
-	 * @see #LOWER
-	 * @see #ASIS
-	 * @see #TAG_NAME_CASE
-	 * @see #ATTR_NAME_CASE
-	 */
-	public static final int UPPER = 2;
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML40Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML40Namespace.java
deleted file mode 100644
index 9c944f0..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML40Namespace.java
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 5396cd6..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java
+++ /dev/null
@@ -1,116 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.provisional;
-
-
-/**
- * HTMLCMProperties defines all property names and pre-defined values in HTML CM.
- * All of those properties can be retreived from element declarations of HTML CM
- * via CMNode#getProperty(String propName).
- */
-public interface HTMLCMProperties {
-
-	/**
-	 * "shouldIgnoreCase" returns java.lang.Boolean object.
-	 */
-	public static final String SHOULD_IGNORE_CASE = "shouldIgnoreCase";//$NON-NLS-1$
-	/**
-	 * "shouldKeepSpace" returns java.lang.Boolean object.
-	 */
-	public static final String SHOULD_KEEP_SPACE = "shouldKeepSpace";//$NON-NLS-1$
-	/**
-	 * "indentChildSource" returns java.lang.Boolean object.
-	 */
-	public static final String SHOULD_INDENT_CHILD_SOURCE = "shouldIndentChildSource";//$NON-NLS-1$
-	/**
-	 * "terminators" returns java.util.Iterator (an array of String objects).
-	 */
-	public static final String TERMINATORS = "terminators";//$NON-NLS-1$
-	/**
-	 * "contentHint" returns CMElementDeclaration instnace.
-	 */
-	public static final String CONTENT_HINT = "contentHint";//$NON-NLS-1$
-	/**
-	 * "prohibitedAncestors" returns org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap.
-	 */
-	public static final String PROHIBITED_ANCESTORS = "prohibitedAncestors";//$NON-NLS-1$
-	/**
-	 * "isJSP" returns java.lang.Boolean object.
-	 */
-	public static final String IS_JSP = "isJSP";//$NON-NLS-1$
-	/**
-	 * "isXHTML" returns java.lang.Boolean object.
-	 */
-	public static final String IS_XHTML = "isXHTML";//$NON-NLS-1$
-	/**
-	 * "isSSI" returns java.lang.Boolean object.
-	 */
-	public static final String IS_SSI = "isSSI";//$NON-NLS-1$
-	/**
-	 * "lineBreakHint" returns String (one of pre-defined values in Values).
-	 */
-	public static final String LINE_BREAK_HINT = "lineBreakHint";//$NON-NLS-1$
-	/**
-	 * "layoutType" returns String (one of pre-defined values in Values).
-	 */
-	public static final String LAYOUT_TYPE = "layoutType";//$NON-NLS-1$
-	/**
-	 * "tagInfo" returns String (documentation for this element).
-	 */
-	public static final String TAGINFO = "tagInfo";//$NON-NLS-1$
-	/**
-	 * "omitType" returns String (one of pre-defined values in Values).
-	 */
-	public static final String OMIT_TYPE = "omitType";//$NON-NLS-1$
-	/**
-	 * "inclusion" returns org.eclipse.wst.xml.core.internal.contentmodel.CMContent.
-	 */
-	public static final String INCLUSION = "inclusion";//$NON-NLS-1$
-	/**
-	 * "isScriptable" returns java.lang.Boolean object.
-	 */
-	public static final String IS_SCRIPTABLE = "isScriptable"; //$NON-NLS-1$
-
-	public static interface Values {
-		/*
-		 * for LINE_BREAK_HINT = "lineBreakHint".
-		 */
-		public static final String BREAK_NONE = "breakNone";//$NON-NLS-1$
-		public static final String BREAK_AFTER_START = "breakAfterStart";//$NON-NLS-1$
-		public static final String BREAK_BEFORE_START_AND_AFTER_END = "breakBeforeStartAndAfterEnd";//$NON-NLS-1$
-		/*
-		 * for LAYOUT_TYPE = "layoutType"
-		 */
-		public static final String LAYOUT_BLOCK = "layoutBlock";//$NON-NLS-1$
-		/** BR */
-		public static final String LAYOUT_BREAK = "layoutBreak";//$NON-NLS-1$
-		/** Hidden object; like HTML or HEAD */
-		public static final String LAYOUT_HIDDEN = "layoutHidden";//$NON-NLS-1$
-		public static final String LAYOUT_NONE = "layoutNone";//$NON-NLS-1$
-		/** No wrap object; like IMG, APPLET,... */
-		public static final String LAYOUT_OBJECT = "layoutObject";//$NON-NLS-1$
-		public static final String LAYOUT_WRAP = "layoutWrap";//$NON-NLS-1$
-		/*
-		 * for OMIT_TYPE = "omitType"
-		 */
-		/** Not ommisible. */
-		public static final String OMIT_NONE = "omitNone";//$NON-NLS-1$
-		/** Both tags are ommisible. */
-		public static final String OMIT_BOTH = "omitBoth";//$NON-NLS-1$
-		/** The end tag is ommisible. */
-		public static final String OMIT_END = "omitEnd";//$NON-NLS-1$
-		/** The end tag is ommitted when created. */
-		public static final String OMIT_END_DEFAULT = "omitEndDefault";//$NON-NLS-1$
-		/** The end tag must be omitted. */
-		public static final String OMIT_END_MUST = "omitEndMust";//$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/provisional/HTMLFilesPreferenceNames.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFilesPreferenceNames.java
deleted file mode 100644
index fe2b4ea..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFilesPreferenceNames.java
+++ /dev/null
@@ -1,33 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.provisional;
-
-import org.eclipse.core.runtime.IProduct;
-import org.eclipse.core.runtime.Platform;
-
-/**
- * @deprecated not used in WTP
- */
-public interface HTMLFilesPreferenceNames {
-
-	static final String DEFAULT_SUFFIX = "defaultSuffix";//$NON-NLS-1$
-	static final String HTML_SUFFIX = "html";//$NON-NLS-1$
-	static final String GENERATE_DOCUMENT_TYPE = "generateDocumentType";//$NON-NLS-1$
-	static final String GENERATE_GENERATOR = "generateGenerator";//$NON-NLS-1$
-	// added this as a potential way to handle changing
-	// product names "up" the stack. Note, not declared final 
-	// to avoid getting 'inlined' by compiler.
-	static IProduct product = Platform.getProduct();
-	// Platform.getProduct() is spec'd so it might return null.
-	// Its expected for any final product it would not be, so we'll return 
-	// "WTP" for development/interim builds. No need to translate. 
-	static String GENERATOR = (product == null) ? "WTP": product.getName(); //$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/provisional/HTMLFormatContraints.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFormatContraints.java
deleted file mode 100644
index a4cde9f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFormatContraints.java
+++ /dev/null
@@ -1,35 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.provisional;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-
-/**
- * @deprecated
- * Please un-deprecate this if Page Designer thinks they are needed.
- */
-public interface HTMLFormatContraints extends IStructuredFormatContraints {
-	/**
-	 * @deprecated
-	 * 	It's very hard to keep the available line width accurate.
-	 * 	Sometimes a node wants to start on a new line, sometimes it doesn't.
-	 * 	It's best for the node to figure out the available line width on the fly.
-	 */
-	int getAvailableLineWidth();
-
-	/**
-	 * @deprecated
-	 * 	It's very hard to keep the available line width accurate.
-	 * 	Sometimes a node wants to start on a new line, sometimes it doesn't.
-	 * 	It's best for the node to figure out the available line width on the fly.
-	 */
-	void setAvailableLineWidth(int availableLineWidth);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/PreferenceNames.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/PreferenceNames.java
deleted file mode 100644
index 530c28d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/PreferenceNames.java
+++ /dev/null
@@ -1,35 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.provisional;
-
-
-public interface PreferenceNames {
-
-	String TRUE = "true"; //$NON-NLS-1$
-	String FALSE = "false"; //$NON-NLS-1$
-	String YES = "yes"; //$NON-NLS-1$
-	String NO = "no"; //$NON-NLS-1$
-
-
-	String SETTINGS = "settings"; //$NON-NLS-1$
-
-	String TREEVIEW = "treeview"; //$NON-NLS-1$
-	String DEFAULT_DEPTH = "defaultdepth"; //$NON-NLS-1$
-
-	String ASIS = "as-is"; //$NON-NLS-1$
-	String LOWER = "lower"; //$NON-NLS-1$
-	String UPPER = "upper"; //$NON-NLS-1$
-
-	String PREFERRED_CASE = "preferred-case"; //$NON-NLS-1$
-	String TAGNAME = "tagname"; //$NON-NLS-1$
-	String ATTRIBUTENAME = "attributename"; //$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/provisional/contenttype/ContentTypeIdForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeIdForHTML.java
deleted file mode 100644
index d01304d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeIdForHTML.java
+++ /dev/null
@@ -1,40 +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
- *     
- *******************************************************************************/
-
-package org.eclipse.wst.html.core.internal.provisional.contenttype;
-
-/**
- * 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 class ContentTypeIdForHTML {
-	/**
-	 * The value of the contenttype id field must match what is specified in
-	 * plugin.xml file. Note: this value is intentially not declared as final,
-	 * so it will not be inlined.
-	 */
-	public final static String ContentTypeID_HTML = getConstantString();
-
-	/**
-	 * Don't allow instantiation.
-	 */
-	private ContentTypeIdForHTML() {
-		super();
-	}
-
-	static String getConstantString() {
-		return "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java
deleted file mode 100644
index a8131c6..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.eclipse.wst.html.core.internal.provisional.text;
-
-
-/**
- * This interface is not intended to be implemented. It defines the partition
- * types for HTML. Clients should reference the partition type Strings defined
- * here directly.
- * 
- * @plannedfor 1.0
- */
-public interface IHTMLPartitionTypes {
-
-	String HTML_DEFAULT = "org.eclipse.wst.html.HTML_DEFAULT"; //$NON-NLS-1$
-	String HTML_DECLARATION = "org.eclipse.wst.html.HTML_DECLARATION"; //$NON-NLS-1$
-	String HTML_COMMENT = "org.eclipse.wst.html.HTML_COMMENT"; //$NON-NLS-1$
-
-	String SCRIPT = "org.eclipse.wst.html.SCRIPT"; //$NON-NLS-1$
-	String STYLE = "org.eclipse.wst.html.STYLE"; //$NON-NLS-1$
-
-	// ISSUE: I think meta tag areas are here too?
-}
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
deleted file mode 100644
index 3153e81..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
+++ /dev/null
@@ -1,208 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.text;
-
-import java.util.Locale;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.css.core.internal.provisional.text.ICSSPartitionTypes;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
-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.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.text.rules.IStructuredTypedRegion;
-import org.eclipse.wst.sse.core.internal.util.ScriptLanguageKeys;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
-
-/**
- * Document partitioner for HTML. Client-side scripts of type JavaScript are
- * reported as ST_SCRIPT, all others for <script language="foo" type="foo2">
- * as SCRIPT.language:FOO and SCRIPT.type:FOO2.
- */
-public class StructuredTextPartitionerForHTML extends StructuredTextPartitionerForXML implements IStructuredTextPartitioner {
-
-	private final static String[] configuredContentTypes = new String[]{IHTMLPartitionTypes.HTML_DEFAULT, IHTMLPartitionTypes.HTML_DECLARATION, IHTMLPartitionTypes.HTML_COMMENT, IHTMLPartitionTypes.SCRIPT, ICSSPartitionTypes.STYLE};
-
-	public static final String JAVASCRIPT = "javascript"; //$NON-NLS-1$
-	public static final String JAVASCRIPT_APPLICATION = "application/x-javascript"; //$NON-NLS-1$
-
-	public StructuredTextPartitionerForHTML() {
-		super();
-	}
-
-	public IStructuredTypedRegion createPartition(int offset, int length, String type) {
-		if (type == IHTMLPartitionTypes.SCRIPT) {
-			IStructuredDocumentRegion node = fStructuredDocument.getRegionAtCharacterOffset(offset);
-			if (node != null) {
-				String stype = getScriptingPartitionType(node);
-				return super.createPartition(offset, length, stype);
-			}
-		}
-		return super.createPartition(offset, length, type);
-	}
-
-	protected void setInternalPartition(int offset, int length, String type) {
-		String localType = type;
-		if (type == IHTMLPartitionTypes.SCRIPT) {
-			IStructuredDocumentRegion node = fStructuredDocument.getRegionAtCharacterOffset(offset);
-			if (node != null) {
-				localType = getScriptingPartitionType(node);
-			}
-		}
-		super.setInternalPartition(offset, length, localType);
-	}
-
-	private String getScriptingPartitionType(IStructuredDocumentRegion coreNode) {
-		String language = null;
-		String type = null;
-		String result = IHTMLPartitionTypes.SCRIPT;
-		IStructuredDocumentRegion node = coreNode;
-		ITextRegion attrNameRegion = null;
-		while (node != null && isValidScriptingRegionType(node.getType())) {
-			node = node.getPrevious();
-		}
-
-		ITextRegionList regions = node.getRegions();
-		if (regions.size() > 4 && regions.get(1).getType() == DOMRegionContext.XML_TAG_NAME) {
-			ITextRegion potentialLanguageRegion = regions.get(1);
-			String potentialLanguageString = node.getText(potentialLanguageRegion);
-			if (potentialLanguageString.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT)) {
-				for (int i = 0; i < regions.size(); i++) {
-					ITextRegion region = regions.get(i);
-					String regionType = region.getType();
-					if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
-						attrNameRegion = region;
-					else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-						String attrName = node.getText(attrNameRegion);
-						if (attrName.equalsIgnoreCase(HTML40Namespace.ATTR_NAME_LANGUAGE))
-							language = StringUtils.strip(node.getText(region));
-						else if (attrName.equalsIgnoreCase(HTML40Namespace.ATTR_NAME_TYPE)) {
-							type = StringUtils.strip(node.getText(region));
-							break;
-						}
-						attrNameRegion = null;
-					}
-				}
-			}
-		}
-		if (type != null)
-			result = lookupScriptType(type);
-		else if (language != null)
-			result = lookupScriptLanguage(language);
-		return result;
-	}
-
-	private boolean isValidScriptingRegionType(String type) {
-		return type == DOMRegionContext.BLOCK_TEXT || type == DOMRegionContext.XML_CDATA_OPEN || type == DOMRegionContext.XML_CDATA_TEXT || type == DOMRegionContext.XML_CDATA_CLOSE;
-	}
-
-	protected void initLegalContentTypes() {
-		fSupportedTypes = getConfiguredContentTypes();
-	}
-
-	private String lookupScriptType(String type) {
-		for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS.length; i++)
-			if (ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS[i].equalsIgnoreCase(type))
-				return IHTMLPartitionTypes.SCRIPT;
-		return IHTMLPartitionTypes.SCRIPT + ".type." + type.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$
-	}
-
-	private String lookupScriptLanguage(String language) {
-		for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS.length; i++)
-			if (ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS[i].equalsIgnoreCase(language))
-				return IHTMLPartitionTypes.SCRIPT;
-		return IHTMLPartitionTypes.SCRIPT + ".language." + language.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$
-	}
-
-	public String getPartitionType(ITextRegion region, int offset) {
-		String result = null;
-		if (region.getType() == DOMRegionContext.XML_COMMENT_TEXT || region.getType() == DOMRegionContext.XML_COMMENT_OPEN)
-			result = IHTMLPartitionTypes.HTML_COMMENT;
-		else if (region.getType() == DOMRegionContext.XML_DOCTYPE_DECLARATION || region.getType() == DOMRegionContext.XML_DECLARATION_OPEN)
-			result = IHTMLPartitionTypes.HTML_DECLARATION;
-		else
-			result = super.getPartitionType(region, offset);
-		return result;
-	}
-
-	public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, IStructuredDocumentRegion nextNode) {
-		
-		ITextRegion previousStartTagNameRegion = null;
-		ITextRegion nextEndTagNameRegion = null;
-		
-		ITextRegion[] regions = previousNode.getRegions().toArray();
-		for (int i = 0; i < regions.length; i++) {
-			if(regions[i].getType() == DOMRegionContext.XML_TAG_NAME) {
-				previousStartTagNameRegion = regions[i];
-				break;
-			}
-		}
-		regions = nextNode.getRegions().toArray();
-		for (int i = 0; i < regions.length; i++) {
-			if(regions[i].getType() == DOMRegionContext.XML_TAG_NAME) {
-				nextEndTagNameRegion = regions[i];
-				break;
-			}
-		}
-		
-		if(previousStartTagNameRegion == null || nextEndTagNameRegion == null)
-			return IHTMLPartitionTypes.HTML_DEFAULT;
-		
-		String name1 = previousNode.getText(previousStartTagNameRegion);
-		String name2 = nextNode.getText(nextEndTagNameRegion);
-		if (name1.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT) && name2.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT))
-			//			return ST_SCRIPT;
-			return getScriptingPartitionType(fStructuredDocument.getRegionAtCharacterOffset(previousNode.getStartOffset(previousStartTagNameRegion)));
-		else if (name1.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) && name2.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE))
-			return ICSSPartitionTypes.STYLE;
-		return super.getPartitionTypeBetween(previousNode, nextNode);
-	}
-
-
-	protected String getPartitionType(ForeignRegion region, int offset) {
-		String tagname = region.getSurroundingTag();
-		String result = null;
-		// tagname should not be null,
-		// but see https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4911
-		if (tagname == null) {
-			result = getUnknown();
-		}
-		else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT))
-			result = IHTMLPartitionTypes.SCRIPT;
-		else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE))
-			result = ICSSPartitionTypes.STYLE;
-		else
-			result = super.getPartitionType(region, offset);
-
-		return result;
-	}
-
-	public String getDefaultPartitionType() {
-		return IHTMLPartitionTypes.HTML_DEFAULT;
-	}
-
-	public IDocumentPartitioner newInstance() {
-		return new StructuredTextPartitionerForHTML();
-	}
-
-	/**
-	 * @return
-	 */
-	public static String[] getConfiguredContentTypes() {
-		return configuredContentTypes;
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/AbstractErrorInfo.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/AbstractErrorInfo.java
deleted file mode 100644
index b9b4d93..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/AbstractErrorInfo.java
+++ /dev/null
@@ -1,40 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-abstract class AbstractErrorInfo implements ErrorInfo, ErrorState {
-
-
-	private int state = NONE_ERROR;
-	private Segment seg = null;
-
-	public AbstractErrorInfo(int state, Segment seg) {
-		super();
-		this.state = state;
-		this.seg = seg;
-	}
-
-	abstract public String getHint();
-
-	abstract public short getTargetType();
-
-	public int getLength() {
-		return (seg == null) ? 0 : seg.getLength();
-	}
-
-	public int getOffset() {
-		return (seg == null) ? 0 : seg.getOffset();
-	}
-
-	public int getState() {
-		return this.state;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index a8af2e5..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java
+++ /dev/null
@@ -1,200 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.modelquery.HMQUtil;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-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.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-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.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-final class CMUtil {
-
-	/**
-	 * Never instantiate!
-	 */
-	private CMUtil() {
-		super();
-	}
-
-	/**
-	 * You cannot always retrieve HTMLElementDeclaration via an Element instance.
-	 * Because, it occasionally a JSP custom tag. -- 9/7/2001
-	 */
-	public static CMElementDeclaration getDeclaration(Element target) {
-		Document doc = target.getOwnerDocument();
-		ModelQuery query = ModelQueryUtil.getModelQuery(doc);
-		return query.getCMElementDeclaration(target);
-	}
-
-	/**
-	 */
-	public static boolean isCaseSensitive(CMElementDeclaration decl) {
-		if (decl == null || (!decl.supports(HTMLCMProperties.SHOULD_IGNORE_CASE)))
-			return false;
-		return !((Boolean) decl.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
-	}
-
-	/**
-	 */
-	private static boolean isChild(CMContent content, CMElementDeclaration target) {
-		switch (content.getNodeType()) {
-			case CMNode.ELEMENT_DECLARATION :
-				if (isWholeTagOmissible((CMElementDeclaration) content))
-					if (isChild(((CMElementDeclaration) content).getContent(), target))
-						return true;
-				return isSameDeclaration((CMElementDeclaration) content, target);
-			case CMNode.GROUP :
-				CMNodeList children = ((CMGroup) content).getChildNodes();
-				for (int i = 0; i < children.getLength(); i++) {
-					CMNode child = children.item(i);
-					switch (child.getNodeType()) {
-						case CMNode.ELEMENT_DECLARATION :
-							if (isWholeTagOmissible((CMElementDeclaration) child))
-								if (isChild(((CMElementDeclaration) child).getContent(), target))
-									return true;
-							if (isSameDeclaration((CMElementDeclaration) child, target))
-								return true;
-							continue; // Go next child.
-						case CMNode.GROUP :
-							if (isChild((CMContent) child, target))
-								return true;
-							continue; // Go next child.
-						default :
-							continue; // Go next child.
-					}
-				}
-		}
-		return false;
-	}
-
-	/**
-	 */
-	public static boolean isEndTagOmissible(CMElementDeclaration decl) {
-		if (!(decl.supports(HTMLCMProperties.OMIT_TYPE)))
-			return false;
-		String omitType = (String) decl.getProperty(HTMLCMProperties.OMIT_TYPE);
-		return !omitType.equals(HTMLCMProperties.Values.OMIT_NONE);
-	}
-
-	/**
-	 */
-	public static boolean isWholeTagOmissible(CMElementDeclaration decl) {
-		if (!(decl.supports(HTMLCMProperties.OMIT_TYPE)))
-			return false;
-		String omitType = (String) decl.getProperty(HTMLCMProperties.OMIT_TYPE);
-		return omitType.equals(HTMLCMProperties.Values.OMIT_BOTH);
-	}
-	
-	/**
-	 */
-	public static boolean isJSP(CMElementDeclaration decl) {
-		if (!decl.supports(HTMLCMProperties.IS_JSP))
-			return false;
-		return ((Boolean) decl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue();
-	}
-
-	/**
-	 */
-	public static boolean isXHTML(CMElementDeclaration decl) {
-		if (!decl.supports(HTMLCMProperties.IS_XHTML))
-			return false;
-		return ((Boolean) decl.getProperty(HTMLCMProperties.IS_XHTML)).booleanValue();
-	}
-
-	/**
-	 * 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 isHTML(CMElementDeclaration decl) {
-		return (!isJSP(decl)) && (!isSSI(decl));
-	}
-
-	/**
-	 */
-	private static boolean isSameDeclaration(CMElementDeclaration aDec, CMElementDeclaration otherDec) {
-		return aDec.getElementName() == otherDec.getElementName();
-	}
-
-	/**
-	 */
-	public static boolean isSSI(CMElementDeclaration edec) {
-		if (edec == null)
-			return false;
-		if (!edec.supports(HTMLCMProperties.IS_SSI))
-			return false;
-		return ((Boolean) edec.getProperty(HTMLCMProperties.IS_SSI)).booleanValue();
-	}
-
-	/**
-	 * Call this method only when the parent content type is one of
-	 * the following: ANY, ELEMENT, or MIXED.
-	 */
-	public static boolean isValidChild(CMElementDeclaration parent, CMElementDeclaration child) {
-		if (parent == null || child == null)
-			return false;
-		if (isHTML(parent) && (!isHTML(child)))
-			return true;
-		CMContent content = parent.getContent();
-		if (content == null)
-			return false;
-		return isChild(content, child);
-	}
-
-	public static boolean isForeign(Element target) {
-		if (!(target instanceof IDOMElement))
-			return true;
-		IDOMElement element = (IDOMElement) target;
-		return !element.isGlobalTag();
-	}
-
-	/**
-	 * This method returns true if all of the following conditions are met:
-	 * (1) value type is ENUM,
-	 * (2) only one value is defined in the enumeration,
-	 * (3) the value has same name to the attribute name.
-	 */
-	public static boolean isBooleanAttr(CMAttributeDeclaration adec) {
-		CMDataType attrtype = adec.getAttrType();
-		if (attrtype == null)
-			return false;
-		if (attrtype.getDataTypeName() != CMDataType.ENUM)
-			return false;
-		String[] values = attrtype.getEnumeratedValues();
-		if (values.length != 1)
-			return false;
-		return values[0].equals(adec.getAttrName());
-	}
-
-	public static boolean isValidInclusion(CMElementDeclaration decl, Element parent) {
-		Iterator iter = HMQUtil.getInclusions(parent).iterator();
-		while (iter.hasNext()) {
-			CMElementDeclaration inclusion = (CMElementDeclaration) iter.next();
-			if (isSameDeclaration(decl, inclusion))
-				return true;
-		}
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CompositeValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CompositeValidator.java
deleted file mode 100644
index 0ad2128..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CompositeValidator.java
+++ /dev/null
@@ -1,74 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-abstract class CompositeValidator extends ValidationComponent {
-
-	protected Vector components = new Vector();
-
-	/**
-	 * CompositeValidator constructor comment.
-	 */
-	public CompositeValidator() {
-		super();
-	}
-
-	/**
-	 */
-	public void setReporter(ValidationReporter reporter) {
-		super.setReporter(reporter);
-
-		Iterator i = components.iterator();
-		while (i.hasNext()) {
-			ValidationAdapter component = (ValidationAdapter) i.next();
-			if (component == null)
-				continue;
-			component.setReporter(reporter);
-		}
-	}
-
-	/**
-	 */
-	public void validate(IndexedRegion node) {
-		Iterator i = components.iterator();
-		while (i.hasNext()) {
-			ValidationComponent component = (ValidationComponent) i.next();
-			if (component == null)
-				continue;
-			component.validate(node);
-		}
-	}
-
-	/**
-	 */
-	void add(ValidationComponent validator) {
-		components.add(validator);
-	}
-
-	/**
-	 * This method registers all components in 'validators'.
-	 * Each derivative must call this methid in its constructor.
-	 */
-	protected void register(ValidationComponent[] validators) {
-		for (int i = 0; i < validators.length; i++) {
-			if (validators[i] != null)
-				add(validators[i]);
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/DocumentPropagatingValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/DocumentPropagatingValidator.java
deleted file mode 100644
index 1bb7a86..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/DocumentPropagatingValidator.java
+++ /dev/null
@@ -1,52 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-import org.eclipse.wst.xml.core.internal.validate.AbstractPropagatingValidator;
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-class DocumentPropagatingValidator extends AbstractPropagatingValidator {
-
-
-	private ValidationComponent validator = new HTMLSimpleDocumentValidator();
-	private ElementPropagatingValidator propagatee = new ElementPropagatingValidator();
-
-	public DocumentPropagatingValidator() {
-		super();
-	}
-
-	public void validate(IndexedRegion node) {
-		getPropagatee().setReporter(this.reporter);
-		super.validate(node);
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return (type == DocumentPropagatingValidator.class || super.isAdapterForType(type));
-	}
-
-	public void setReporter(ValidationReporter reporter) {
-		super.setReporter(reporter);
-		validator.setReporter(reporter);
-		propagatee.setReporter(reporter);
-	}
-
-	protected final ValidationComponent getPropagatee() {
-		return propagatee;
-	}
-
-	protected final ValidationAdapter getValidator() {
-		return validator;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ElementPropagatingValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ElementPropagatingValidator.java
deleted file mode 100644
index 5b83741..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ElementPropagatingValidator.java
+++ /dev/null
@@ -1,44 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-import org.eclipse.wst.xml.core.internal.validate.AbstractPropagatingValidator;
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-class ElementPropagatingValidator extends AbstractPropagatingValidator {
-
-
-	private ValidationComponent validator = new HTMLSimpleValidator();
-
-	public ElementPropagatingValidator() {
-		super();
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return (type == ElementPropagatingValidator.class || super.isAdapterForType(type));
-	}
-
-	public void setReporter(ValidationReporter reporter) {
-		super.setReporter(reporter);
-		validator.setReporter(reporter);
-	}
-
-	protected ValidationComponent getPropagatee() {
-		return this;
-	}
-
-	protected ValidationAdapter getValidator() {
-		return validator;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfo.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfo.java
deleted file mode 100644
index 34b430e..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfo.java
+++ /dev/null
@@ -1,26 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-interface ErrorInfo {
-
-	public String getHint();
-
-	public int getLength();
-
-	public int getOffset();
-
-	public int getState();
-
-	public short getTargetType();
-}
\ No newline at end of file
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
deleted file mode 100644
index 6026c2c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-final class ErrorInfoImpl extends AbstractErrorInfo {
-
-	private Node target = null;
-
-	//	private Segment seg = null;
-	/**
-	 */
-	public ErrorInfoImpl(int state, Segment errorSeg, Node target) {
-		super(state, errorSeg);
-		this.target = target;
-	}
-
-	/**
-	 */
-	public String getHint() {
-		switch (target.getNodeType()) {
-			case Node.ATTRIBUTE_NODE :
-				switch (getState()) {
-					case UNDEFINED_VALUE_ERROR :
-					case MISMATCHED_VALUE_ERROR :
-					case UNCLOSED_ATTR_VALUE :
-						//D210422
-						return ((Attr) target).getValue();
-					default :
-						return target.getNodeName();
-				}
-			case Node.TEXT_NODE :
-				return ((Text) target).getData();
-			case Node.ELEMENT_NODE :
-			default :
-				return target.getNodeName();
-		}
-	}
-
-	public short getTargetType() {
-		return target.getNodeType();
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index f725940..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java
+++ /dev/null
@@ -1,41 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-interface ErrorState {
-	static final int NONE_ERROR = 0;
-	// generic error
-	static final int UNDEFINED_NAME_ERROR = 11;
-	static final int UNDEFINED_VALUE_ERROR = 12;
-	static final int MISMATCHED_VALUE_ERROR = 13;
-	// format error
-	static final int FORMAT_ERROR_LEVEL = 100;
-	static final int INVALID_NAME_ERROR = 101;
-	static final int INVALID_CHAR_ERROR = 102;
-	static final int MISMATCHED_ERROR = 103;
-	static final int MISMATCHED_END_TAG_ERROR = 104;
-	static final int MISSING_START_TAG_ERROR = 105;
-	static final int MISSING_END_TAG_ERROR = 106;
-	static final int UNNECESSARY_END_TAG_ERROR = 107;
-	static final int INVALID_ATTR_ERROR = 108;
-	static final int INVALID_DIRECTIVE_ERROR = 109;
-	static final int UNCLOSED_TAG_ERROR = 110;
-	static final int UNCLOSED_END_TAG_ERROR = 111;
-	static final int INVALID_EMPTY_ELEMENT_TAG = 112;
-	static final int UNCLOSED_ATTR_VALUE = 113; //D210422
-	// layout error
-	static final int LAYOUT_ERROR_LEVEL = 1000;
-	static final int INVALID_CONTENT_ERROR = 1001;
-	static final int DUPLICATE_ERROR = 1002;
-	static final int COEXISTENCE_ERROR = 1003;
-}
\ No newline at end of file
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
deleted file mode 100644
index c16984c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java
+++ /dev/null
@@ -1,78 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-final class FMUtil {
-
-	public final static int SEG_NONE = 0;
-	public final static int SEG_WHOLE_TAG = 1;
-	public final static int SEG_START_TAG = 2;
-	public final static int SEG_END_TAG = 3;
-
-	/**
-	 */
-	private FMUtil() {
-		super();
-	}
-
-	/**
-	 */
-	public final static Segment getSegment(IDOMNode target, int segType) {
-		if (target == null)
-			return new Segment(0, 0);
-		Segment seg = null;
-		IStructuredDocumentRegion startTag = null;
-		IStructuredDocumentRegion endTag = null;
-		switch (segType) {
-			case SEG_WHOLE_TAG :
-				startTag = target.getFirstStructuredDocumentRegion();
-				if (startTag != null) {
-					endTag = target.getLastStructuredDocumentRegion();
-					seg = new Segment(startTag, endTag);
-				}
-				else {
-					int startOffset = target.getStartOffset();
-					int endOffset = target.getEndOffset();
-					seg = new Segment(startOffset, endOffset - startOffset);
-				}
-				break;
-			case SEG_START_TAG :
-				startTag = target.getStartStructuredDocumentRegion();
-				if (startTag != null) {
-					seg = new Segment(startTag);
-				}
-				else {
-					seg = new Segment(target.getStartOffset(), 0);
-				}
-				break;
-			case SEG_END_TAG :
-				endTag = target.getEndStructuredDocumentRegion();
-				if (endTag != null) {
-					seg = new Segment(endTag);
-				}
-				else {
-					seg = new Segment(target.getEndOffset(), 0);
-				}
-				break;
-			case SEG_NONE :
-			default :
-				return new Segment(0, 0);
-		}
-		return seg;
-	}
-
-
-}
\ No newline at end of file
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
deleted file mode 100644
index 63f5831..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
+++ /dev/null
@@ -1,255 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-import java.util.Iterator;
-
-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.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.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.provisional.document.IDOMAttr;
-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.Element;
-import org.w3c.dom.NamedNodeMap;
-
-public class HTMLAttributeValidator extends PrimeValidator {
-
-	private static final int REGION_NAME = 1;
-	private static final int REGION_VALUE = 2;
-	// <<D210422
-	private static final char SINGLE_QUOTE = '\'';
-	private static final char DOUBLE_QUOTE = '\"';
-
-	// D210422
-	/**
-	 * HTMLAttributeValidator constructor comment.
-	 */
-	public HTMLAttributeValidator() {
-		super();
-	}
-
-	/**
-	 */
-	private Segment getErrorSegment(IDOMNode errorNode, int regionType) {
-		ITextRegion rgn = null;
-		switch (regionType) {
-			case REGION_NAME :
-				rgn = errorNode.getNameRegion();
-				break;
-			case REGION_VALUE :
-				rgn = errorNode.getValueRegion();
-				break;
-			default :
-				// nothing to do.
-				break;
-		}
-		if (rgn != null) {
-			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);
-				}
-			}
-		}
-		return new Segment(errorNode.getStartOffset(), 0);
-	}
-
-	/**
-	 * 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 == HTMLAttributeValidator.class) || super.isAdapterForType(type));
-	}
-
-	/**
-	 */
-	public void validate(IndexedRegion node) {
-		Element target = (Element) node;
-		if (CMUtil.isForeign(target))
-			return;
-		CMElementDeclaration edec = CMUtil.getDeclaration(target);
-		if (edec == null)
-			return;
-		CMNamedNodeMap declarations = edec.getAttributes();
-
-		NamedNodeMap attrs = target.getAttributes();
-		for (int i = 0; i < attrs.getLength(); i++) {
-			int rgnType = REGION_NAME;
-			int state = ErrorState.NONE_ERROR;
-			Attr a = (Attr) attrs.item(i);
-			// D203637; If the target attr has prefix, the validator should
-			// not
-			// warn about it. That is, just ignore. It is able to check
-			// whether
-			// an attr has prefix or not by calling XMLAttr#isGlobalAttr().
-			// When a attr has prefix (not global), it returns false.
-			boolean isXMLAttr = a instanceof IDOMAttr;
-			if (isXMLAttr) {
-				IDOMAttr xmlattr = (IDOMAttr) a;
-				if (!xmlattr.isGlobalAttr())
-					continue; // skip futher validation and begin next loop.
-			}
-
-			CMAttributeDeclaration adec = (CMAttributeDeclaration) declarations.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
-				if (hasJSPRegion(((IDOMNode) a).getNameRegion())) {
-					rgnType = REGION_NAME;
-					state = ErrorState.UNDEFINED_NAME_ERROR;
-				}
-			}
-			else {
-				// The attr declaration was found.
-				// At 1st, the name should be checked.
-				if (CMUtil.isHTML(edec) && (!CMUtil.isXHTML(edec))) {
-					// If the target element is pure HTML (not XHTML), some
-					// attributes
-					// might be written in boolean format. It should be check
-					// specifically.
-					if (CMUtil.isBooleanAttr(adec) && ((IDOMAttr) a).hasNameOnly())
-						continue; // OK, keep going. No more check is needed
-					// against this attr.
-				}
-				else {
-					// If the target is other than pure HTML (JSP or XHTML),
-					// the name
-					// must be checked exactly (ie in case sensitive way).
-					String actual = a.getName();
-					String desired = adec.getAttrName();
-					if (!actual.equals(desired)) { // case mismatch
-						rgnType = REGION_NAME;
-						state = ErrorState.MISMATCHED_ERROR;
-					}
-				}
-				// Then, the value must be checked.
-				if (state == ErrorState.NONE_ERROR) { // Need more check.
-					// Now, the value should be checked, if the type is ENUM.
-					CMDataType attrType = adec.getAttrType();
-					String actualValue = a.getValue();
-					if (attrType.getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED) {
-						// Check FIXED value.
-						String validValue = attrType.getImpliedValue();
-						if (!actualValue.equals(validValue)) {
-							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];
-								// At 1st, compare ignoring case.
-								if (actualValue.equalsIgnoreCase(candidate)) {
-									found = true;
-									if (CMUtil.isCaseSensitive(edec) && (!actualValue.equals(candidate))) {
-										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 JSP.
-								if (hasJSPRegion(((IDOMNode) a).getValueRegion())) {
-									rgnType = REGION_VALUE;
-									state = ErrorState.UNDEFINED_VALUE_ERROR;
-								}
-							}
-						}
-					}
-				}
-				// <<D210422
-				if (state == ErrorState.NONE_ERROR) { // Need more check.
-					if (isXMLAttr) {
-						String source = ((IDOMAttr) a).getValueRegionText();
-						if (source != null) {
-							char firstChar = source.charAt(0);
-							char lastChar = source.charAt(source.length() - 1);
-							if (isQuote(firstChar) || isQuote(lastChar)) {
-								if (lastChar != firstChar) {
-									rgnType = REGION_VALUE;
-									state = ErrorState.UNCLOSED_ATTR_VALUE;
-								}
-							}
-						}
-					}
-				}
-				// D210422
-			}
-			if (state != ErrorState.NONE_ERROR) {
-				Segment seg = getErrorSegment((IDOMNode) a, rgnType);
-				if (seg != null)
-					reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(state, seg, a)));
-			}
-		}
-	}
-
-	/**
-	 */
-	private boolean hasJSPRegion(ITextRegion container) {
-		if (!(container instanceof ITextRegionContainer))
-			return false;
-		ITextRegionList regions = ((ITextRegionContainer) container).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 || (isNextedTagName(regionType)))
-				return true;
-		}
-		return false;
-	}
-
-    /**
-     * 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 isNextedTagName(String regionType) {
-		final String JSP_SCRIPTLET_OPEN = "JSP_SCRIPTLET_OPEN"; //$NON-NLS-1$
-		final String JSP_EXPRESSION_OPEN = "JSP_EXPRESSION_OPEN"; //$NON-NLS-1$
-		final String JSP_DECLARATION_OPEN = "JSP_DECLARATION_OPEN"; //$NON-NLS-1$
-		final String JSP_DIRECTIVE_OPEN = "JSP_DIRECTIVE_OPEN"; //$NON-NLS-1$
-
-		boolean result = regionType.equals(JSP_SCRIPTLET_OPEN) || regionType.equals(JSP_EXPRESSION_OPEN) || regionType.equals(JSP_DECLARATION_OPEN) || regionType.equals(JSP_DIRECTIVE_OPEN);
-		return result;
-	}
-
-	// <<D214022
-	private boolean isQuote(char c) {
-		return (c == SINGLE_QUOTE) || (c == DOUBLE_QUOTE);
-	}
-	// D210422
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLDocumentContentValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLDocumentContentValidator.java
deleted file mode 100644
index 026e6d2..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLDocumentContentValidator.java
+++ /dev/null
@@ -1,196 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-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.document.DocumentTypeAdapter;
-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.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 HTMLDocumentContentValidator extends PrimeValidator {
-
-
-	private final static class Division {
-		private Vector explicitHtmls = new Vector();
-		private Vector rest = new Vector();
-
-		public Division(Document document, NodeList children) {
-			String rootTagName = getRootTagName(document);
-			for (int i = 0; i < children.getLength(); i++) {
-				Node child = children.item(i);
-				if (isHtmlTag(child, rootTagName)) {
-					explicitHtmls.add(child);
-				}
-				else {
-					rest.add(child);
-				}
-			}
-		}
-
-		public boolean hasExplicitHtmls() {
-			return explicitHtmls.size() > 0;
-		}
-
-		public List getExplicitHtmls() {
-			return explicitHtmls;
-		}
-
-		public Iterator getRestNodes() {
-			return rest.iterator();
-		}
-
-		/* utilities */
-		private static boolean isHtmlTag(Node node, String tagName) {
-			if (node.getNodeType() != Node.ELEMENT_NODE)
-				return false;
-			return ((Element) node).getTagName().equalsIgnoreCase(tagName);
-		}
-
-		private static String getRootTagName(Document document) {
-			DocumentTypeAdapter adapter = (DocumentTypeAdapter) ((IDOMDocument) document).getAdapterFor(DocumentTypeAdapter.class);
-			if (adapter != null) {
-				DocumentType docType = adapter.getDocumentType();
-				if (docType != null) {
-					return docType.getName();
-				}
-			}
-
-			return HTML40Namespace.ElementName.HTML;
-		}
-	}
-
-	/**
-	 * HTMLDocumentContentValidator constructor comment.
-	 */
-	public HTMLDocumentContentValidator() {
-		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 == HTMLDocumentContentValidator.class) || super.isAdapterForType(type));
-	}
-
-	/**
-	 */
-	public void validate(IndexedRegion node) {
-		// isFragment check should be more intelligent.
-		boolean isFragment = true;
-
-		Document target = (Document) node;
-		NodeList children = target.getChildNodes();
-		if (children == null)
-			return;
-
-		Division division = new Division(target, children);
-		if (division.hasExplicitHtmls()) {
-			isFragment = false;
-
-			List explicits = division.getExplicitHtmls();
-			if (explicits.size() > 1) {
-				for (int i = 1; i < explicits.size(); i++) {
-					Element html = (Element) explicits.get(i);
-					// report error (duplicate)
-					Segment errorSeg = FMUtil.getSegment((IDOMNode) html, FMUtil.SEG_START_TAG);
-					if (errorSeg != null)
-						reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(ErrorState.DUPLICATE_ERROR, errorSeg, html)));
-				}
-			}
-		}
-		validateContent(division.getRestNodes(), isFragment);
-	}
-
-	/*
-	 * This methods validate nodes other than HTML elements.
-	 */
-	private void validateContent(Iterator children, boolean isFragment) {
-		boolean foundDoctype = false;
-		while (children.hasNext()) {
-			IDOMNode child = (IDOMNode) children.next();
-
-			int error = ErrorState.NONE_ERROR;
-			int segType = FMUtil.SEG_WHOLE_TAG;
-
-			switch (child.getNodeType()) {
-				case Node.ELEMENT_NODE :
-					if (!isFragment) {
-						Element childElem = (Element) child;
-						CMElementDeclaration ced = CMUtil.getDeclaration(childElem);
-						// Undefined element is valid.
-						if (ced == null)
-							continue;
-						// JSP (includes custom tags) and SSI are valid.
-						if (CMUtil.isForeign(childElem) || CMUtil.isSSI(ced))
-							continue; // Defect 186774
-
-						// report error (invalid content)
-						error = ErrorState.INVALID_CONTENT_ERROR;
-						// mark the whole start tag as error.
-						segType = FMUtil.SEG_START_TAG;
-					}
-					break;
-				case Node.TEXT_NODE :
-					if (!isFragment) {
-						// TEXT node is valid when it contains white space
-						// characters only.
-						// Otherwise, it is invalid content.
-						if (((IDOMText) child).isElementContentWhitespace())
-							continue;
-						error = ErrorState.INVALID_CONTENT_ERROR;
-						segType = FMUtil.SEG_WHOLE_TAG;
-					}
-					break;
-				case Node.DOCUMENT_TYPE_NODE :
-					// DOCTYPE is also valid when it appears once and only
-					// once.
-					if (!foundDoctype) {
-						foundDoctype = true;
-						continue;
-					}
-					error = ErrorState.DUPLICATE_ERROR;
-					segType = FMUtil.SEG_WHOLE_TAG;
-					break;
-				case Node.COMMENT_NODE :
-				// always valid.
-				case Node.PROCESSING_INSTRUCTION_NODE :
-					continue;
-				default :
-					if (!isFragment) {
-						error = ErrorState.INVALID_CONTENT_ERROR;
-						segType = FMUtil.SEG_WHOLE_TAG;
-					}
-					break;
-			}
-			if (error != ErrorState.NONE_ERROR) {
-				Segment errorSeg = FMUtil.getSegment(child, segType);
-				if (errorSeg != null)
-					reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(error, errorSeg, child)));
-			}
-		}
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementAncestorValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementAncestorValidator.java
deleted file mode 100644
index 6ae5e13..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementAncestorValidator.java
+++ /dev/null
@@ -1,70 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-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.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-
-public class HTMLElementAncestorValidator extends PrimeValidator {
-
-	/**
-	 * HTMLElementAncestorValidator constructor comment.
-	 */
-	public HTMLElementAncestorValidator() {
-		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 == HTMLElementAncestorValidator.class) || super.isAdapterForType(type));
-	}
-
-	/**
-	 * Check exclusion which is defined in only HTML DTD (SGML).
-	 */
-	public void validate(IndexedRegion node) {
-		Element target = (Element) node;
-		if (CMUtil.isForeign(target))
-			return;
-		CMElementDeclaration dec = CMUtil.getDeclaration(target);
-		if (dec == null)
-			return; // cannot validate.
-		if (!CMUtil.isHTML(dec))
-			return; // no need to validate
-		if (!dec.supports(HTMLCMProperties.PROHIBITED_ANCESTORS))
-			return; // cannot validate.
-		CMNamedNodeMap prohibited = (CMNamedNodeMap) dec.getProperty(HTMLCMProperties.PROHIBITED_ANCESTORS);
-		if (prohibited.getLength() <= 0)
-			return; // no prohibited ancestors.
-
-		Element parent = SMUtil.getParentElement(target);
-		while (parent != null) {
-			CMNode pdec = prohibited.getNamedItem(parent.getNodeName());
-			if (pdec != null) { // prohibited element is found in ancestors.
-				Segment errorSeg = FMUtil.getSegment((IDOMNode) node, FMUtil.SEG_START_TAG);
-				if (errorSeg != null)
-					reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(ErrorState.INVALID_CONTENT_ERROR, errorSeg, target)));
-				break; // If one prohibited ancestor is found, it's enough.
-			}
-			parent = SMUtil.getParentElement(parent);
-		}
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 8ec0839..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java
+++ /dev/null
@@ -1,180 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-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.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class HTMLElementContentValidator extends PrimeValidator {
-
-	/**
-	 * HTMLElementContentValidator constructor comment.
-	 */
-	public HTMLElementContentValidator() {
-		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 == HTMLElementContentValidator.class) || super.isAdapterForType(type));
-	}
-
-	/**
-	 */
-	public void validate(IndexedRegion node) {
-		Element target = (Element) node;
-		if (CMUtil.isForeign(target))
-			return;
-
-		validateContent(target, target.getChildNodes());
-	}
-
-	private void validateContent(Element parent, NodeList children) {
-		for (int i = 0; i < children.getLength(); i++) {
-			Node child = children.item(i);
-			if (child == null)
-				continue;
-
-			// perform actual validation
-			validateNode(parent, child);
-		}
-	}
-
-	// private int countExplicitSiblings(Element parent, String tagName) {
-	// NodeList children = parent.getChildNodes();
-	// int count = 0;
-	// for (int i = 0; i < children.getLength(); i++) {
-	// Node child = children.item(i);
-	// if (child.getNodeType() != Node.ELEMENT_NODE)
-	// continue;
-	// if (tagName.equalsIgnoreCase(((Element) child).getTagName())) {
-	// count++;
-	// }
-	// }
-	// return count;
-	// }
-
-	/*
-	 * The implementation of the following method is practical but accurate.
-	 * The accurate maximum occurence should be retreive from the content
-	 * model. However, it is useful enough, since almost implicit elements are
-	 * HTML, HEAD, or BODY.
-	 */
-	// private int getMaxOccur(Element parent, String childTag) {
-	// return 1;
-	// }
-	private void validateNode(Element target, Node child) {
-		// 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
-		int contentType = CMElementDeclaration.ANY;
-		CMElementDeclaration edec = CMUtil.getDeclaration(target);
-		if (edec != null)
-			contentType = edec.getContentType();
-
-		int error = ErrorState.NONE_ERROR;
-		int segType = FMUtil.SEG_WHOLE_TAG;
-
-		switch (child.getNodeType()) {
-			case Node.ELEMENT_NODE :
-				Element childElem = (Element) child;
-				// Defect 200321:
-				// This validator cares only HTML/XHTML elements. If a child
-				// is
-				// an element of foreign markup languages, just ignore it.
-				if (CMUtil.isForeign(childElem))
-					return;
-
-				CMElementDeclaration ced = CMUtil.getDeclaration((Element) child);
-				// 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)))
-					return;
-
-				switch (contentType) {
-					case CMElementDeclaration.ANY :
-						// Keep going.
-						return;
-					case CMElementDeclaration.ELEMENT :
-					case CMElementDeclaration.MIXED :
-						if (ced == null)
-							return;
-						if (CMUtil.isValidChild(edec, ced))
-							return;
-						// Now, it is the time to check inclusion, unless the
-						// target
-						// document is not a XHTML.
-						if (!CMUtil.isXHTML(edec)) {
-							// pure HTML
-							if (CMUtil.isValidInclusion(ced, target))
-								return;
-						}
-						error = ErrorState.INVALID_CONTENT_ERROR;
-						break;
-					default :
-						error = ErrorState.INVALID_CONTENT_ERROR;
-						break;
-				}
-				// Mark the whole START tag as an error segment.
-				segType = FMUtil.SEG_START_TAG;
-				break;
-			case Node.TEXT_NODE :
-				switch (contentType) {
-					case CMElementDeclaration.ANY :
-					case CMElementDeclaration.MIXED :
-					case CMElementDeclaration.PCDATA :
-					case CMElementDeclaration.CDATA :
-						// D184339
-						// Keep going.
-						return;
-					case CMElementDeclaration.ELEMENT :
-					case CMElementDeclaration.EMPTY :
-						if (((IDOMText) child).isElementContentWhitespace())
-							return;
-						error = ErrorState.INVALID_CONTENT_ERROR;
-						break;
-					default :
-						error = ErrorState.INVALID_CONTENT_ERROR;
-						break;
-				}
-				// Mark the whole node as an error segment.
-				segType = FMUtil.SEG_WHOLE_TAG;
-				break;
-			case Node.COMMENT_NODE :
-			case Node.PROCESSING_INSTRUCTION_NODE :
-				if (contentType != CMElementDeclaration.EMPTY)
-					return;
-				error = ErrorState.INVALID_CONTENT_ERROR;
-				// Mark the whole node as an error segment.
-				segType = FMUtil.SEG_WHOLE_TAG;
-				break;
-			default :
-				error = ErrorState.INVALID_CONTENT_ERROR;
-				// Mark the whole node as an error segment.
-				segType = FMUtil.SEG_WHOLE_TAG;
-				break;
-		}
-		if (error != ErrorState.NONE_ERROR) {
-			Segment errorSeg = FMUtil.getSegment((IDOMNode) child, segType);
-			if (errorSeg != null)
-				reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(error, errorSeg, child)));
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleDocumentValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleDocumentValidator.java
deleted file mode 100644
index f9a9392..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleDocumentValidator.java
+++ /dev/null
@@ -1,39 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-class HTMLSimpleDocumentValidator extends CompositeValidator {
-
-	/**
-	 * HTMLSimpleDocumentValidator constructor comment.
-	 */
-	public HTMLSimpleDocumentValidator() {
-		super();
-
-		ValidationComponent[] validators = new ValidationComponent[2];
-
-		validators[0] = new HTMLDocumentContentValidator();
-		validators[1] = new SyntaxValidator();
-
-		register(validators);
-	}
-
-	/**
-	 * 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 == HTMLSimpleDocumentValidator.class) || super.isAdapterForType(type));
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleValidator.java
deleted file mode 100644
index ff2a5e1..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleValidator.java
+++ /dev/null
@@ -1,42 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-class HTMLSimpleValidator extends CompositeValidator {
-
-	/**
-	 * HTMLSimpleValidator constructor comment.
-	 */
-	public HTMLSimpleValidator() {
-		super();
-
-		ValidationComponent[] validators = new ValidationComponent[5];
-
-		validators[0] = new HTMLAttributeValidator();
-		validators[1] = new HTMLElementContentValidator();
-		validators[2] = new SyntaxValidator();
-		validators[3] = new HTMLElementAncestorValidator();
-		validators[4] = new NamespaceValidator();
-
-		register(validators);
-	}
-
-	/**
-	 * 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 == HTMLSimpleValidator.class) || super.isAdapterForType(type));
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLValidationAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLValidationAdapterFactory.java
deleted file mode 100644
index 7b50886..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLValidationAdapterFactory.java
+++ /dev/null
@@ -1,72 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-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.validate.ValidationAdapter;
-import org.w3c.dom.Node;
-
-public class HTMLValidationAdapterFactory extends AbstractAdapterFactory {
-
-	private static HTMLValidationAdapterFactory instance = null;
-
-	/**
-	 * HTMLValidationAdapterFactory constructor comment.
-	 */
-	public HTMLValidationAdapterFactory() {
-		super(ValidationAdapter.class, true);
-	}
-
-	/**
-	 * HTMLValidationAdapterFactory constructor comment.
-	 * @param adapterKey java.lang.Object
-	 * @param registerAdapters boolean
-	 */
-	public HTMLValidationAdapterFactory(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-	/**
-	 */
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		Node node = (Node) target;
-		switch (node.getNodeType()) {
-			case Node.DOCUMENT_NODE :
-				return new DocumentPropagatingValidator();
-			case Node.ELEMENT_NODE :
-				return new ElementPropagatingValidator();
-			default :
-				return new NullValidator();
-		}
-	}
-
-	/**
-	 */
-	public synchronized static HTMLValidationAdapterFactory getInstance() {
-		if (instance != null)
-			return instance;
-		instance = new HTMLValidationAdapterFactory();
-		return instance;
-	}
-
-	/**
-	 * Overriding Object's clone() method
-	 * This is used in IModelManager's IStructuredModel copying.
-	 */
-	public INodeAdapterFactory copy() {
-		return getInstance();
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index c60b51c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java
+++ /dev/null
@@ -1,253 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import java.util.Hashtable;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.html.core.internal.HTMLCoreMessages;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
-import org.w3c.dom.Node;
-
-class MessageFactory implements ErrorState {
-
-
-	private static class ErrorTable {
-		private class Packet {
-			public Packet(String msg, int severity) {
-				this.msg = msg;
-				this.severity = severity;
-			}
-
-			public String getMessage() {
-				return msg;
-			}
-
-			public int getSeverity() {
-				return severity;
-			}
-
-			private String msg = null;
-			private int severity = -1;
-		}
-
-		public ErrorTable() {
-		}
-
-		public void put(int state, String msg, int severity) {
-			Packet packet = new Packet(msg, severity);
-			map.put(new Integer(state), packet);
-		}
-
-		public String getMessage(int state) {
-			return getPacket(state).getMessage();
-		}
-
-		public int getSeverity(int state) {
-			return getPacket(state).getSeverity();
-		}
-
-		private Packet getPacket(int state) {
-			return (Packet) map.get(new Integer(state));
-		}
-
-		private Hashtable map = new Hashtable();
-	}
-
-	private static interface NodeType {
-		static final int ATTRIBUTE = 0;
-		static final int ELEMENT = 1;
-		static final int DOCUMENT_TYPE = 2;
-		static final int TEXT = 3;
-		static final int COMMENT = 4;
-		static final int CDATA_SECTION = 5;
-		static final int PROCESSING_INSTRUCTION = 6;
-		static final int ENTITY_REFERENCE = 7;
-
-		static final int MAX_TYPE = 8;
-	}
-
-	// error messages
-	private static final String MSG_NO_ERROR = HTMLCoreMessages.No_error__UI_;
-	private static final String MSG_UNDEFINED_ATTR_ERROR = HTMLCoreMessages.Undefined_attribute_name___ERROR_;
-	private static final String MSG_UNDEFINED_VALUE_ERROR = HTMLCoreMessages.Undefined_attribute_value__ERROR_;
-	private static final String MSG_DUPLICATE_ATTR_ERROR = HTMLCoreMessages.Multiple_values_specified__ERROR_;
-	private static final String MSG_MISMATCHED_ATTR_ERROR = HTMLCoreMessages.Attribute_name___0___uses__ERROR_;
-	private static final String MSG_INVALID_ATTR_ERROR = HTMLCoreMessages.Invalid_attribute_name___0_ERROR_;
-	private static final String MSG_ATTR_NO_VALUE_ERROR = HTMLCoreMessages.Invalid_attribute___0____ERROR_;
-	private static final String MSG_INVALID_CONTENT_ERROR = HTMLCoreMessages.Invalid_location_of_tag____ERROR_;
-	private static final String MSG_DUPLICATE_TAG_ERROR = HTMLCoreMessages.Duplicate_tag___0____ERROR_;
-	private static final String MSG_MISSING_START_TAG_ERROR = HTMLCoreMessages.No_start_tag____0_____ERROR_;
-	private static final String MSG_MISSING_END_TAG_ERROR = HTMLCoreMessages.No_end_tag_____0_____ERROR_;
-	private static final String MSG_UNNECESSARY_END_TAG_ERROR = HTMLCoreMessages.End_tag_____0____not_neede_ERROR_;
-	private static final String MSG_UNDEFINED_TAG_ERROR = HTMLCoreMessages.Unknown_tag___0____ERROR_;
-	private static final String MSG_MISMATCHED_TAG_ERROR = HTMLCoreMessages.Tag_name___0___uses_wrong__ERROR_;
-	private static final String MSG_INVALID_TAG_ERROR = HTMLCoreMessages.Invalid_tag_name___0____ERROR_;
-	private static final String MSG_INVALID_DIRECTIVE_ERROR = HTMLCoreMessages.Invalid_JSP_directive___0__ERROR_;
-	private static final String MSG_INVALID_TEXT_ERROR = HTMLCoreMessages.Invalid_text_string___0____ERROR_;
-	private static final String MSG_INVALID_CHAR_ERROR = HTMLCoreMessages.Invalid_character_used_in__ERROR_;
-	private static final String MSG_UNKNOWN_ERROR = HTMLCoreMessages.Unknown_error__ERROR_;
-	private static final String MSG_UNCLOSED_START_TAG_ERROR = HTMLCoreMessages.Start_tag____0____not_clos_ERROR_;
-	private static final String MSG_UNCLOSED_END_TAG_ERROR = HTMLCoreMessages.End_tag_____0____not_close_ERROR_;
-	private static final String MSG_MISMATCHED_ATTR_VALUE_ERROR = HTMLCoreMessages.Attribute_value___0___uses_ERROR_;
-	private static final String MSG_UNCLOSED_COMMENT_ERROR = HTMLCoreMessages.Comment_not_closed__ERROR_;
-	private static final String MSG_UNCLOSED_DOCTYPE_ERROR = HTMLCoreMessages.DOCTYPE_declaration_not_cl_ERROR_;
-	private static final String MSG_UNCLOSED_PI_ERROR = HTMLCoreMessages.Processing_instruction_not_ERROR_;
-	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 ErrorTable[] errTables = new ErrorTable[NodeType.MAX_TYPE];
-
-	static {
-		for (int i = 0; i < NodeType.MAX_TYPE; i++) {
-			errTables[i] = new ErrorTable();
-		}
-		// NOTE: The severities are just stub.  They must be reviewed.
-		// -- 8/30/2001
-
-		// attribute error map
-		ErrorTable attrTable = errTables[NodeType.ATTRIBUTE];// short hand
-		attrTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-		attrTable.put(UNDEFINED_NAME_ERROR, MSG_UNDEFINED_ATTR_ERROR, ValidationMessage.WARNING);
-		attrTable.put(UNDEFINED_VALUE_ERROR, MSG_UNDEFINED_VALUE_ERROR, ValidationMessage.WARNING);
-		attrTable.put(MISMATCHED_ERROR, MSG_MISMATCHED_ATTR_ERROR, ValidationMessage.WARNING);
-		attrTable.put(INVALID_NAME_ERROR, MSG_INVALID_ATTR_ERROR, ValidationMessage.WARNING);
-		attrTable.put(INVALID_ATTR_ERROR, MSG_ATTR_NO_VALUE_ERROR, ValidationMessage.WARNING);
-		attrTable.put(DUPLICATE_ERROR, MSG_DUPLICATE_ATTR_ERROR, ValidationMessage.WARNING);
-		attrTable.put(MISMATCHED_VALUE_ERROR, MSG_MISMATCHED_ATTR_VALUE_ERROR, ValidationMessage.ERROR);
-		//<<D210422
-		attrTable.put(UNCLOSED_ATTR_VALUE, MSG_UNCLOSED_ATTR_VALUE_ERROR, ValidationMessage.WARNING);
-		//D210422
-		// element error map
-		ErrorTable elemTable = errTables[NodeType.ELEMENT];// short hand
-		elemTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-		elemTable.put(UNDEFINED_NAME_ERROR, MSG_UNDEFINED_TAG_ERROR, ValidationMessage.WARNING);
-		elemTable.put(INVALID_NAME_ERROR, MSG_INVALID_TAG_ERROR, ValidationMessage.ERROR);
-		elemTable.put(MISMATCHED_ERROR, MSG_MISMATCHED_TAG_ERROR, ValidationMessage.WARNING);
-		elemTable.put(MISMATCHED_END_TAG_ERROR, MSG_MISMATCHED_TAG_ERROR, ValidationMessage.ERROR);
-		elemTable.put(MISSING_START_TAG_ERROR, MSG_MISSING_START_TAG_ERROR, ValidationMessage.ERROR);
-		elemTable.put(MISSING_END_TAG_ERROR, MSG_MISSING_END_TAG_ERROR, ValidationMessage.WARNING);
-		elemTable.put(UNNECESSARY_END_TAG_ERROR, MSG_UNNECESSARY_END_TAG_ERROR, ValidationMessage.WARNING);
-		elemTable.put(INVALID_DIRECTIVE_ERROR, MSG_INVALID_DIRECTIVE_ERROR, ValidationMessage.ERROR);
-		elemTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-		elemTable.put(DUPLICATE_ERROR, MSG_DUPLICATE_TAG_ERROR, ValidationMessage.WARNING);
-		elemTable.put(COEXISTENCE_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-		elemTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_START_TAG_ERROR, ValidationMessage.ERROR);
-		elemTable.put(UNCLOSED_END_TAG_ERROR, MSG_UNCLOSED_END_TAG_ERROR, ValidationMessage.ERROR);
-		elemTable.put(INVALID_EMPTY_ELEMENT_TAG, MSG_INVALID_EMPTY_ELEMENT_TAG, ValidationMessage.WARNING);
-
-		// document type error map
-		ErrorTable docTable = errTables[NodeType.DOCUMENT_TYPE];// short hand
-		docTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-		docTable.put(DUPLICATE_ERROR, MSG_DUPLICATE_TAG_ERROR, ValidationMessage.ERROR);
-		docTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-		docTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_DOCTYPE_ERROR, ValidationMessage.ERROR);
-
-		// text error map
-		ErrorTable textTable = errTables[NodeType.TEXT];
-		textTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-		textTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_TEXT_ERROR, ValidationMessage.WARNING);
-		textTable.put(INVALID_CHAR_ERROR, MSG_INVALID_CHAR_ERROR, ValidationMessage.WARNING);
-
-		// comment error map
-		ErrorTable commTable = errTables[NodeType.COMMENT];
-		commTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-		commTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-		commTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_COMMENT_ERROR, ValidationMessage.ERROR);
-
-		// cdata section error map
-		ErrorTable cdatTable = errTables[NodeType.CDATA_SECTION];
-		cdatTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-		cdatTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-		cdatTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_CDATA_SECTION_ERROR, ValidationMessage.ERROR);
-
-		// processing instruction error map
-		ErrorTable piTable = errTables[NodeType.PROCESSING_INSTRUCTION];
-		piTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-		piTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-		piTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_PI_ERROR, ValidationMessage.ERROR);
-
-		// entity reference error map
-		ErrorTable erTable = errTables[NodeType.ENTITY_REFERENCE];
-		erTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
-		erTable.put(UNDEFINED_NAME_ERROR, MSG_UNDEFINED_TAG_ERROR, ValidationMessage.WARNING);
-		erTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-	}
-
-	/**
-	 */
-	public static ValidationMessage createMessage(ErrorInfo info) {
-		String errorMsg = getErrorMessage(info);
-		int errorSeverity = getErrorSeverity(info);
-		return new ValidationMessage(errorMsg, info.getOffset(), info.getLength(), errorSeverity);
-	}
-
-	private static String getErrorMessage(ErrorInfo info) {
-		ErrorTable tab = getErrorTable(info.getTargetType());
-		if (tab == null)
-			return MSG_UNKNOWN_ERROR;
-
-		String template = tab.getMessage(info.getState());
-		Object[] arguments = {info.getHint()};
-		String s = null;
-		try {
-			s = NLS.bind(template, arguments);
-		}
-		catch (IllegalArgumentException e) {
-			Logger.logException(e);
-			s = template + ":" + arguments.toString(); //$NON-NLS-1$
-		}
-		return s;
-	}
-
-	/**
-	 */
-	private static int getErrorSeverity(ErrorInfo info) {
-		ErrorTable tab = getErrorTable(info.getTargetType());
-		if (tab == null)
-			return 0;
-		return tab.getSeverity(info.getState());
-	}
-
-	private static ErrorTable getErrorTable(short nodetype) {
-		ErrorTable tab = null;
-		switch (nodetype) {
-			case Node.ATTRIBUTE_NODE :
-				tab = errTables[NodeType.ATTRIBUTE];
-				break;
-			case Node.ELEMENT_NODE :
-				tab = errTables[NodeType.ELEMENT];
-				break;
-			case Node.DOCUMENT_TYPE_NODE :
-				tab = errTables[NodeType.DOCUMENT_TYPE];
-				break;
-			case Node.TEXT_NODE :
-				tab = errTables[NodeType.TEXT];
-				break;
-			case Node.COMMENT_NODE :
-				tab = errTables[NodeType.COMMENT];
-				break;
-			case Node.CDATA_SECTION_NODE :
-				tab = errTables[NodeType.CDATA_SECTION];
-				break;
-			case Node.PROCESSING_INSTRUCTION_NODE :
-				tab = errTables[NodeType.PROCESSING_INSTRUCTION];
-				break;
-			case Node.ENTITY_REFERENCE_NODE :
-				tab = errTables[NodeType.ENTITY_REFERENCE];
-				break;
-			default :
-				return null;
-		}
-		return tab;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index bda5f6f..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java
+++ /dev/null
@@ -1,127 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-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.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-public class NamespaceValidator extends PrimeValidator implements ErrorState {
-
-	private final static String XMLNS_PREFIX = "xmlns";//$NON-NLS-1$
-	private final static String NS_SEPARATOR = ":";//$NON-NLS-1$
-
-	public NamespaceValidator() {
-		super();
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return ((type == NamespaceValidator.class) || super.isAdapterForType(type));
-	}
-
-	public void validate(IndexedRegion node) {
-		Element target = (Element) node;
-		if (isXMLElement(target) && hasUnknownPrefix(target)) {
-			IDOMElement e = (IDOMElement) target;
-			if (!isValidPrefix(e.getPrefix(), target) && !e.isCommentTag()) {
-				// report unknown tag error.
-				Segment errorSeg = FMUtil.getSegment(e, FMUtil.SEG_START_TAG);
-				if (errorSeg != null)
-					reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(UNDEFINED_NAME_ERROR, errorSeg, e)));
-			}
-		}
-		// (2) check prefix of each attr 
-		NamedNodeMap attrs = target.getAttributes();
-		for (int i = 0; i < attrs.getLength(); i++) {
-			Node n = attrs.item(i);
-			if (!(n instanceof IDOMAttr))
-				continue;
-			IDOMAttr a = (IDOMAttr) n;
-			String prefix = a.getPrefix();
-			if ((prefix != null) && isUnknownAttr(a, target)) {
-				// The attr has unknown prefix.  So, check it.
-				if (!isValidPrefix(prefix, target)) {
-					// report unknown attr error.
-					ITextRegion r = a.getNameRegion();
-					if (r == null)
-						continue;
-					int a_offset = a.getNameRegionStartOffset();
-					int a_length = a.getNameRegion().getLength();
-					reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(UNDEFINED_NAME_ERROR, new Segment(a_offset, a_length), a)));
-				}
-			}
-		}
-	}
-
-	// private methods	
-	private boolean isXMLElement(Element target) {
-		return target instanceof IDOMElement;
-	}
-
-	private boolean hasUnknownPrefix(Element target) {
-		return isUnknownElement(target) && CMUtil.isForeign(target);
-	}
-
-	private boolean isUnknownElement(Element target) {
-		CMElementDeclaration dec = CMUtil.getDeclaration(target);
-		return dec == null;
-	}
-
-	private boolean isUnknownAttr(IDOMAttr attr, Element target) {
-		CMElementDeclaration dec = CMUtil.getDeclaration(target);
-		if (dec == null)
-			return true; // unknown.
-		CMNamedNodeMap adecls = dec.getAttributes();
-		CMAttributeDeclaration adec = (CMAttributeDeclaration) adecls.getNamedItem(attr.getName());
-		return adec == null;
-	}
-
-	private boolean isValidPrefix(String prefix, Element e) {
-		if (prefix.equals(XMLNS_PREFIX))
-			return true; // "xmlns:foo" attr is always valid.
-
-		// (1) check the element has the namespace definition or not.
-		if (isValidPrefixWithinElement(prefix, e))
-			return true;
-
-		// (2) check ancestors of the element have the namespace definition or not.
-		Element parent = SMUtil.getParentElement(e);
-		while (parent != null) {
-			if (isValidPrefixWithinElement(prefix, parent))
-				return true;
-			parent = SMUtil.getParentElement(parent);
-		}
-		return false;
-	}
-
-	private boolean isValidPrefixWithinElement(String prefix, Element e) {
-		String ns = XMLNS_PREFIX + NS_SEPARATOR + prefix;
-		NamedNodeMap attrs = e.getAttributes();
-		for (int i = 0; i < attrs.getLength(); i++) {
-			Node n = attrs.item(i);
-			if (n == null)
-				continue;
-			if (n.getNodeType() != Node.ATTRIBUTE_NODE)
-				continue;
-			if (ns.equals(((Attr) n).getName()))
-				return true;
-		}
-		return false;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NullValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NullValidator.java
deleted file mode 100644
index fb1f93c..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NullValidator.java
+++ /dev/null
@@ -1,34 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-/**
- * NullValidator class is intended to be a replacement of null
- * for ValidationComponent type.
- */
-final class NullValidator extends ValidationComponent {
-
-	public NullValidator() {
-		super();
-	}
-
-	public void validate(IndexedRegion node) {
-		return;
-	}
-
-	public void setReporter(ValidationReporter reporter) {
-		return;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/PrimeValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/PrimeValidator.java
deleted file mode 100644
index b44f258..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/PrimeValidator.java
+++ /dev/null
@@ -1,25 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-abstract class PrimeValidator extends ValidationComponent {
-
-	/**
-	 * PrimeValidator constructor comment.
-	 */
-	public PrimeValidator() {
-		super();
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SMUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SMUtil.java
deleted file mode 100644
index 6bf6fed..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SMUtil.java
+++ /dev/null
@@ -1,36 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-final class SMUtil {
-
-	private SMUtil() {
-		super();
-	}
-
-	/* get an ancestor element ignoring implicit ones. */
-	public static Element getParentElement(Node child) {
-		if (child == null)
-			return null;
-
-		Node p = child.getParentNode();
-		while (p != null) {
-			if (p.getNodeType() == Node.ELEMENT_NODE) {
-				return (Element) p;
-			}
-			p = p.getParentNode();
-		}
-		return null;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/Segment.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/Segment.java
deleted file mode 100644
index b9fd37e..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/Segment.java
+++ /dev/null
@@ -1,64 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-public class Segment {
-
-	private int offset = 0;
-	private int length = 0;
-
-	/**
-	 */
-	public Segment(int offset, int length) {
-		super();
-		this.offset = offset;
-		this.length = length;
-	}
-
-	public Segment(IStructuredDocumentRegion region) {
-		super();
-		this.offset = region.getStartOffset();
-		this.length = region.getLength();
-	}
-
-	/**
-	 * NOTE: 'start' and 'end' must be the start and end of the contiguous regions.
-	 * Otherwise, this class cannot work correctly.
-	 */
-	public Segment(IStructuredDocumentRegion start, IStructuredDocumentRegion end) {
-		super();
-		this.offset = start.getStartOffset();
-		int endOffset = (end == null) ? start.getEndOffset() : end.getEndOffset();
-		this.length = endOffset - this.offset;
-	}
-
-	//public Segment(ITextRegion start, ITextRegion end) {
-	//	super();
-	//	this.offset = start.getStartOffset();
-	//	int endOffset = (end == null) ? start.getEndOffset() : end.getEndOffset();
-	//	this.length = endOffset - this.offset;
-	//}
-	/**
-	 */
-	public int getLength() {
-		return this.length;
-	}
-
-	/**
-	 */
-	public int getOffset() {
-		return this.offset;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index ae6ac8d..0000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java
+++ /dev/null
@@ -1,345 +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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-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.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.document.InvalidCharacterException;
-import org.eclipse.wst.xml.core.internal.document.SourceValidator;
-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.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-class SyntaxValidator extends PrimeValidator implements ErrorState {
-
-
-	static private boolean isValidRegion(ITextRegion rgn) {
-		String type = rgn.getType();
-		if (type == null)
-			return false; // no type is invalid.
-		if (type == DOMRegionContext.XML_END_TAG_OPEN || type == DOMRegionContext.XML_TAG_NAME || type == DOMRegionContext.XML_TAG_CLOSE) {
-			return true;
-		}
-		return false;
-	}
-
-	static private String getTagName(IStructuredDocumentRegion tag) {
-		ITextRegionList regions = tag.getRegions();
-		Iterator iter = regions.iterator();
-		while (iter.hasNext()) {
-			ITextRegion rgn = (ITextRegion) iter.next();
-			if (rgn.getType() == DOMRegionContext.XML_TAG_NAME)
-				return tag.getText(rgn);
-		}
-		return "";//$NON-NLS-1$
-	}
-
-	static private boolean isEmptyContent(CMElementDeclaration decl) {
-		return (decl != null) && (decl.getContentType() == CMElementDeclaration.EMPTY);
-	}
-
-	public SyntaxValidator() {
-		super();
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return ((type == SyntaxValidator.class) || super.isAdapterForType(type));
-	}
-
-	class ElementInfo {
-		public ElementInfo() {
-			super();
-		}
-
-		public IDOMElement target = null;
-		public CMElementDeclaration decl = null;
-		public IStructuredDocumentRegion startTag = null;
-		public IStructuredDocumentRegion endTag = null;
-		public boolean hasStartTag = false;
-		public boolean hasEndTag = false;
-		public boolean isXHTML = false;
-	}
-
-	public void validate(IndexedRegion indexedNode) {
-		Node node = (Node) indexedNode;
-		validateChildren(node);
-
-		if (node.getNodeType() != Node.ELEMENT_NODE)
-			return;
-		if (!(node instanceof IDOMElement))
-			return;
-
-		ElementInfo info = new ElementInfo();
-		info.target = (IDOMElement) node;
-
-		// gather information to validate from target at once.
-		getInfo(info);
-
-		if (info.target.isGlobalTag()) {
-			validateTags(info);
-			validateNames(info);
-			if (info.decl != null && info.isXHTML) {
-				validateTagCase(info);
-			}
-		}
-	}
-
-	private void getInfo(ElementInfo info) {
-		info.decl = CMUtil.getDeclaration(info.target);
-		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());
-		}
-	}
-
-	class TagErrorInfoImpl extends AbstractErrorInfo {
-		private String hint = null;
-
-		public TagErrorInfoImpl(int state, IStructuredDocumentRegion tag, String hint) {
-			super(state, new Segment(tag));
-			this.hint = hint;
-		}
-
-		public String getHint() {
-			return hint;
-		}
-
-		public short getTargetType() {
-			return Node.ELEMENT_NODE;
-		}
-	}
-
-	private boolean isEndTagCorrupted(ElementInfo info) {
-		ITextRegionList regions = info.endTag.getRegions();
-		if (regions == null || regions.isEmpty())
-			return false;
-		Iterator iter = regions.iterator();
-		while (iter.hasNext()) {
-			ITextRegion rgn = (ITextRegion) iter.next();
-			if (!isValidRegion(rgn))
-				return true; // found invalid region type.
-		}
-		return false; // all regions are valid.
-	}
-
-	private String getEndTagFullText(ElementInfo info) {
-		String hint = "";//$NON-NLS-1$
-		ITextRegionList regions = info.endTag.getRegions();
-		Iterator iter = regions.iterator();
-		while (iter.hasNext()) {
-			ITextRegion rgn = (ITextRegion) iter.next();
-			String type = rgn.getType();
-			if (type == null)
-				continue;
-			if (type == DOMRegionContext.XML_END_TAG_OPEN || type == DOMRegionContext.XML_TAG_CLOSE)
-				continue;
-			hint += info.endTag.getFullText(rgn);
-		}
-		return hint;
-	}
-
-	private void reportCorruptedEndTagError(ElementInfo info) {
-		String hint = getEndTagFullText(info);
-		TagErrorInfoImpl error = new TagErrorInfoImpl(UNDEFINED_NAME_ERROR, info.endTag, hint);
-		this.reporter.report(MessageFactory.createMessage(error));
-	}
-
-	private void validateTags(ElementInfo info) {
-		if (info.hasStartTag) {
-			if (!info.target.isStartTagClosed()) {
-				// Mark the whole START tag as an error segment.
-				Segment errorSeg = new Segment(info.startTag);
-				report(UNCLOSED_TAG_ERROR, errorSeg, info.target);
-			}
-		}
-		else {
-			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);
-						report(MISSING_START_TAG_ERROR, errorSeg, info.target);
-					}
-				}
-			}
-		}
-
-		if (info.hasEndTag) {
-			if (!info.target.isClosed()) {
-				// Set the whole END tag as error segment.
-				Segment errorSeg = new Segment(info.endTag);
-				report(UNCLOSED_END_TAG_ERROR, errorSeg, info.target);
-			}
-		}
-		else {
-			if (info.isXHTML) { // XHTML
-				if (!info.target.isEmptyTag()) {
-					if (isEmptyContent(info.decl)) {
-						// 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);
-						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)) {
-						// Set the error mark to the end of the element.
-						Segment errorSeg = new Segment(info.target.getEndOffset(), 0);
-						report(MISSING_END_TAG_ERROR, errorSeg, info.target);
-					}
-				}
-			}
-		}
-	}
-
-	/* perform validation about tag name definition. */
-	private void validateNames(ElementInfo 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) {
-				reportCorruptedEndTagError(info);
-			}
-			else {
-				Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
-				report(UNDEFINED_NAME_ERROR, errorSeg, info.target);
-			}
-		}
-		else {
-			// Even if a declaration could be retrieved, if the end
-			// tag is corrupted, it should be reported as undefined
-			// name. (D202493)
-			if (corrupted) {
-				reportCorruptedEndTagError(info);
-			}
-		}
-	}
-
-	/* perform validation tag case only for XHTML document */
-	private void validateTagCase(ElementInfo info) {
-		String declared = info.decl.getElementName();
-		String startTagName = "";//$NON-NLS-1$
-		String endTagName = "";//$NON-NLS-1$
-		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(MessageFactory.createMessage(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(MessageFactory.createMessage(error));
-				}
-			}
-		}
-	}
-
-	private void validateChildren(Node target) {
-		if ((target.getNodeType() == Node.ELEMENT_NODE) && CMUtil.isForeign((Element) target))
-			return;
-
-		for (Node child = target.getFirstChild(); child != null; child = child.getNextSibling()) {
-			switch (child.getNodeType()) {
-				case Node.TEXT_NODE :
-					{
-						IDOMNode text = (IDOMNode) child;
-						int charOffset = validateTextSource(text);
-						if (charOffset >= 0) {
-							charOffset += text.getStartOffset();
-							Segment errorSeg = new Segment(charOffset, 1);
-							if (errorSeg != null)
-								report(INVALID_CHAR_ERROR, errorSeg, text);
-						}
-						break;
-					}
-				case Node.COMMENT_NODE :
-				case Node.DOCUMENT_TYPE_NODE :
-				case Node.PROCESSING_INSTRUCTION_NODE :
-				case Node.CDATA_SECTION_NODE :
-					{
-						IDOMNode tag = (IDOMNode) child;
-						if (!tag.isClosed()) {
-							Segment errorSeg = FMUtil.getSegment(tag, FMUtil.SEG_WHOLE_TAG);
-							if (errorSeg != null)
-								report(UNCLOSED_TAG_ERROR, errorSeg, tag);
-						}
-						break;
-					}
-				default :
-					break;
-			}
-		}
-	}
-
-	private int validateTextSource(IDOMNode text) {
-		try {
-			SourceValidator validator = new SourceValidator(text);
-			validator.validateSource(text.getSource());
-		}
-		catch (InvalidCharacterException ex) {
-			return ex.getOffset();
-		}
-		return -1;
-	}
-
-	private void report(int state, Segment errorSeg, Node node) {
-		ErrorInfo info = new ErrorInfoImpl(state, errorSeg, node);
-		reporter.report(MessageFactory.createMessage(info));
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/.classpath b/bundles/org.eclipse.wst.html.ui/.classpath
deleted file mode 100644
index d7ce462..0000000
--- a/bundles/org.eclipse.wst.html.ui/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?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"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.html.ui/.cvsignore b/bundles/org.eclipse.wst.html.ui/.cvsignore
deleted file mode 100644
index 1077fe5..0000000
--- a/bundles/org.eclipse.wst.html.ui/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-htmleditor.jar
-temp.folder
-build.xml
-@dot
-src.zip
diff --git a/bundles/org.eclipse.wst.html.ui/.options b/bundles/org.eclipse.wst.html.ui/.options
deleted file mode 100644
index 6d015ff..0000000
--- a/bundles/org.eclipse.wst.html.ui/.options
+++ /dev/null
@@ -1 +0,0 @@
-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
deleted file mode 100644
index 38bee73..0000000
--- a/bundles/org.eclipse.wst.html.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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.html.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 4953857..0000000
--- a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,50 +0,0 @@
-#Mon May 30 17:55:36 EDT 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-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.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-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.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-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=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-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.unsafeTypeOperation=warning
-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.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.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
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
deleted file mode 100644
index 42fb716..0000000
--- a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Fri May 27 23:56:32 EDT 2005
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-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
deleted file mode 100644
index 92311f0..0000000
--- a/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,50 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.html.ui; singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.wst.html.ui.internal.HTMLUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.html.ui,
- org.eclipse.wst.html.internal.validation,
- org.eclipse.wst.html.ui.internal,
- org.eclipse.wst.html.ui.internal.autoedit,
- org.eclipse.wst.html.ui.internal.contentassist,
- org.eclipse.wst.html.ui.internal.contentoutline,
- org.eclipse.wst.html.ui.internal.contentproperties.ui,
- org.eclipse.wst.html.ui.internal.correction,
- org.eclipse.wst.html.ui.internal.derived,
- org.eclipse.wst.html.ui.internal.edit.ui,
- org.eclipse.wst.html.ui.internal.editor,
- org.eclipse.wst.html.ui.internal.hyperlink,
- org.eclipse.wst.html.ui.internal.preferences,
- org.eclipse.wst.html.ui.internal.preferences.ui,
- org.eclipse.wst.html.ui.internal.projection,
- org.eclipse.wst.html.ui.internal.registry,
- org.eclipse.wst.html.ui.internal.search,
- org.eclipse.wst.html.ui.internal.style,
- org.eclipse.wst.html.ui.internal.taginfo,
- org.eclipse.wst.html.ui.internal.templates,
- org.eclipse.wst.html.ui.internal.text,
- org.eclipse.wst.html.ui.internal.wizard,
- org.eclipse.wst.html.ui.views.contentoutline
-Require-Bundle: org.eclipse.ui.ide,
- org.eclipse.ui.views,
- org.eclipse.jface.text,
- org.eclipse.ui.workbench.texteditor,
- org.eclipse.ui.editors,
- org.eclipse.ui,
- org.eclipse.wst.sse.ui,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.css.ui,
- org.eclipse.wst.sse.core,
- org.eclipse.wst.css.core,
- org.eclipse.wst.html.core,
- org.eclipse.wst.xml.core,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.wst.common.uriresolver,
- org.eclipse.wst.validation,
- org.eclipse.wst.javascript.ui
-Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.html.ui/about.html b/bundles/org.eclipse.wst.html.ui/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/bundles/org.eclipse.wst.html.ui/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>February 24, 2005</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.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/build.properties b/bundles/org.eclipse.wst.html.ui/build.properties
deleted file mode 100644
index f486ed6..0000000
--- a/bundles/org.eclipse.wst.html.ui/build.properties
+++ /dev/null
@@ -1,23 +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
-###############################################################################
-bin.includes = plugin.xml,\
-               icons/,\
-               plugin.properties,\
-               templates/,\
-               META-INF/,\
-               .,\
-               about.html
-bin.excludes = bin/**,\
-               @dot/**,\
-               temp.folder/**
-source.. = src/,\
-           src-html-validation/
-src.includes = build.properties
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
deleted file mode 100644
index 8175aa9..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/dtool16/newhtml_wiz.gif
+++ /dev/null
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
deleted file mode 100644
index 976e18d..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/etool16/newhtml_wiz.gif
+++ /dev/null
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
deleted file mode 100644
index 75ebdb8..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/sourceEditor.gif
+++ /dev/null
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
deleted file mode 100644
index b99b45c..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/table.gif
+++ /dev/null
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
deleted file mode 100644
index f58992d..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-anchor.gif
+++ /dev/null
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
deleted file mode 100644
index 005fa99..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-body.gif
+++ /dev/null
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
deleted file mode 100644
index d143fcf..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-button.gif
+++ /dev/null
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
deleted file mode 100644
index bbb40cb..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-font.gif
+++ /dev/null
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
deleted file mode 100644
index 3b13958..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-form.gif
+++ /dev/null
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
deleted file mode 100644
index 65f516e..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-generic.gif
+++ /dev/null
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
deleted file mode 100644
index fb39ba6..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-html.gif
+++ /dev/null
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
deleted file mode 100644
index ef3235d..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image-map.gif
+++ /dev/null
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
deleted file mode 100644
index a988c1d..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image.gif
+++ /dev/null
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
deleted file mode 100644
index 4084602..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-jsp.gif
+++ /dev/null
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
deleted file mode 100644
index 5d1f81b..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-template.gif
+++ /dev/null
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
deleted file mode 100644
index b129090..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-title.gif
+++ /dev/null
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
deleted file mode 100644
index 5e7fb33..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/wizban/newhfile_wiz.gif b/bundles/org.eclipse.wst.html.ui/icons/full/wizban/newhfile_wiz.gif
deleted file mode 100644
index 603e1ed..0000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/wizban/newhfile_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/plugin.properties b/bundles/org.eclipse.wst.html.ui/plugin.properties
deleted file mode 100644
index 306240d..0000000
--- a/bundles/org.eclipse.wst.html.ui/plugin.properties
+++ /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
-###############################################################################
-providerName=Eclipse.org
-pluginName=HTML UI Source Editor
-nlFeatureName=HTML UI NL Support
-HTML_Source_Page_Editor.name=HTML Editor
-HTML_Files.name=HTML Files
-HTML_Source.name=HTML Source
-HTML_Templates.name=HTML Templates
-HTML_Styles.name=HTML Styles
-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
-_UI_WIZARD_CREATE_NEW_FILE = Create a new HTML page
-##
-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
diff --git a/bundles/org.eclipse.wst.html.ui/plugin.xml b/bundles/org.eclipse.wst.html.ui/plugin.xml
deleted file mode 100644
index 1516fd2..0000000
--- a/bundles/org.eclipse.wst.html.ui/plugin.xml
+++ /dev/null
@@ -1,479 +0,0 @@
-<?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="icons/full/obj16/sourceEditor.gif"
-			default="true"
-			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" />
-		<propertySheetConfiguration
-			class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
-			target="org.eclipse.wst.html.core.htmlsource" />
-		<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="structuredtextfoldingprovider"
-			class="org.eclipse.wst.html.ui.internal.projection.StructuredTextFoldingProviderHTML"
-			target="org.eclipse.wst.html.core.htmlsource" />
-		<provisionalConfiguration
-			type="correctionassistant"
-			class="org.eclipse.wst.html.ui.internal.correction.CorrectionAssistantProviderHTML"
-			target="org.eclipse.wst.html.core.htmlsource" />
-		<provisionalDefinition
-			type="preferencepages"
-			value="org.eclipse.wst.html.ui.preferences, org.eclipse.wst.html.ui.preferences.source, org.eclipse.wst.html.ui.preferences.templates, org.eclipse.wst.html.ui.preferences.styles"
-			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">
-		<!-- HTML PREFERENCE PAGES-->
-		<page
-			name="%HTML_Files.name"
-			category="org.eclipse.wst.sse.ui.internal.provisional.preferences"
-			class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLFilesPreferencePage"
-			id="org.eclipse.wst.html.ui.preferences">
-		</page>
-		<page
-			name="%HTML_Source.name"
-			category="org.eclipse.wst.html.ui.preferences"
-			class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLSourcePreferencePage"
-			id="org.eclipse.wst.html.ui.preferences.source">
-		</page>
-		<page
-			name="%HTML_Templates.name"
-			category="org.eclipse.wst.html.ui.preferences"
-			class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLTemplatePreferencePage"
-			id="org.eclipse.wst.html.ui.preferences.templates">
-		</page>
-		<page
-			name="%HTML_Styles.name"
-			category="org.eclipse.wst.html.ui.preferences"
-			class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLColorPage"
-			id="org.eclipse.wst.html.ui.preferences.styles">
-		</page>
-	</extension>
-	<!-- Web content settings -->
-	<extension point="org.eclipse.ui.propertyPages">
-		<!-- for j2ee web project -->
-		<page
-			objectClass="org.eclipse.core.resources.IProject"
-			adaptable="true"
-			name="%WebContentSettings.name"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.ProjectContentSettingsPropertyPage"
-			id="org.eclipse.wst.html.ui.dynamicprojectpropertypage">
-			<filter
-				name="nature"
-				value="org.eclipse.wst.webproject.WebNature">
-			</filter>
-		</page>
-		<!-- for static web project -->
-		<page
-			objectClass="org.eclipse.core.resources.IProject"
-			adaptable="true"
-			name="%WebContentSettings.name"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.ProjectContentSettingsPropertyPage"
-			id="org.eclipse.wst.html.ui.staticprojectpropertypage">
-			<filter
-				name="nature"
-				value="org.eclipse.wst.webproject.StaticWebNature">
-			</filter>
-		</page>
-		<page
-			objectClass="org.eclipse.core.resources.IFile"
-			adaptable="true"
-			name="%WebContentSettings.name"
-			nameFilter="*.htm*"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
-			id="org.eclipse.wst.html.ui.htmlpropertypage">
-		</page>
-		<page
-			objectClass="org.eclipse.core.resources.IFile"
-			adaptable="true"
-			name="%WebContentSettings.name"
-			nameFilter="*.shtml"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
-			id="org.eclipse.wst.html.ui.htmlpropertypage">
-		</page>
-		<page
-			objectClass="org.eclipse.core.resources.IFile"
-			adaptable="true"
-			name="%WebContentSettings.name"
-			nameFilter="*.xhtml"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
-			id="org.eclipse.wst.html.ui.htmlpropertypage">
-		</page>
-		<page
-			objectClass="org.eclipse.core.resources.IFile"
-			adaptable="true"
-			name="%WebContentSettings.name"
-			nameFilter="*.jhtml"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
-			id="org.eclipse.wst.html.ui.htmlpropertypage">
-		</page>
-		<page
-			objectClass="org.eclipse.core.resources.IFile"
-			adaptable="true"
-			name="%WebContentSettings.name"
-			nameFilter="*.jsp"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
-			id="org.eclipse.wst.html.ui.htmlpropertypage">
-		</page>
-		<page
-			objectClass="org.eclipse.core.resources.IFile"
-			adaptable="true"
-			name="%WebContentSettings.name"
-			nameFilter="*.jspf"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
-			id="org.eclipse.wst.html.ui.htmlpropertypage">
-		</page>
-		<page
-			objectClass="org.eclipse.core.resources.IFile"
-			adaptable="true"
-			name="%WebContentSettings.name"
-			nameFilter="*.jsf"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
-			id="org.eclipse.wst.html.ui.htmlpropertypage">
-		</page>
-		<page
-			objectClass="org.eclipse.core.resources.IFile"
-			adaptable="true"
-			name="%WebContentSettings.name"
-			nameFilter="*.wml"
-			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.HTMLContentSettingsPropertyPage"
-			id="org.eclipse.wst.html.ui.htmlpropertypage">
-		</page>
-	</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>
-	<!-- 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.validator">
-		<validator>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.html">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.htm">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.xhtml">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.htpl">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.wml">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jsp">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jspf">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jsf">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jsv">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jtpl">
-			</filter>
-			<helper
-				class="org.eclipse.wst.html.internal.validation.HTMLValidationWorkbenchHelper">
-			</helper>
-			<run
-				enabled="false"
-				class="org.eclipse.wst.html.internal.validation.HTMLValidator">
-			</run>
-		</validator>
-	</extension>
-
-	<!--======================================================================================-->
-	<!-- As you type validation                                      						  -->
-	<!--======================================================================================-->
-
-	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
-		<validator
-			scope="partial"
-			class="org.eclipse.wst.html.internal.validation.HTMLValidator"
-			id="org.eclipse.wst.html.htmlsourcevalidator">
-			<contentTypeIdentifier
-				id="org.eclipse.wst.html.core.htmlsource">
-				<partitionType id="org.eclipse.wst.html.HTML_DEFAULT">
-				</partitionType>
-			</contentTypeIdentifier>
-			<contentTypeIdentifier
-				id="org.eclipse.jst.jsp.core.jspsource">
-				<partitionType id="org.eclipse.wst.html.HTML_DEFAULT">
-				</partitionType>				
-				<partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
-				</partitionType>
-			</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="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 J2EE Project Navigator -->
-	<extension
-		id="org.eclipse.wst.html.commonWizard.newHTML"
-		point="org.eclipse.wst.common.navigator.workbench.commonWizard">
-		<commonWizard
-			type="new"
-			wizardId="org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard">
-			<enablement>
-				<or>
-					<objectClass
-						name="org.eclipse.core.resources.IProject">
-					</objectClass>
-					<objectClass
-						name="org.eclipse.core.resources.IFolder">
-					</objectClass>
-					<objectClass
-						name="org.eclipse.core.resources.IFile">
-					</objectClass>
-				</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>
-</plugin>
diff --git a/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd b/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd
deleted file mode 100644
index 5a31888..0000000
--- a/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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 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.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
deleted file mode 100644
index dc4df1f..0000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationReporter.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
- *******************************************************************************/
-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.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-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;
-
-	/**
-	 */
-	public HTMLValidationReporter(IValidator owner, IReporter reporter, IFile file, IStructuredModel model) {
-		super();
-		this.owner = owner;
-		this.reporter = reporter;
-		this.file = file;
-		this.model = model;
-	}
-
-	/**
-	 */
-	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)
-			return;
-		if (this.file == null)
-			return;
-
-		IMessage mes = translateMessage(message);
-
-		if (this.reporter != null) {
-			this.reporter.addMessage(this.owner, mes);
-		}
-		else {
-			// 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;
-			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;
-	}
-}
\ 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
deleted file mode 100644
index 90c9f77..0000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationResult.java
+++ /dev/null
@@ -1,64 +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
- *******************************************************************************/
-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);
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 90bfde5..0000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationWorkbenchHelper.java
+++ /dev/null
@@ -1,47 +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.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
deleted file mode 100644
index 756566a..0000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java
+++ /dev/null
@@ -1,440 +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
- *******************************************************************************/
-package org.eclipse.wst.html.internal.validation;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-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.IPath;
-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.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.html.core.internal.validate.HTMLValidationAdapterFactory;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-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.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-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.core.Message;
-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.IValidator;
-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 implements IValidator, ISourceValidator {
-	private static final String ORG_ECLIPSE_JST_JSP_CORE_JSPSOURCE = "org.eclipse.jst.jsp.core.jspsource"; //$NON-NLS-1$
-	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;
-
-	public HTMLValidator() {
-		super();
-	}
-
-	/**
-	 */
-	public void cleanup(IReporter reporter) {
-		// nothing to do
-	}
-
-	/**
-	 */
-	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 {
-			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 ex) {
-		}
-
-		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 {
-				IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
-
-				IContentDescription contentDescription = file.getContentDescription();
-				IContentType htmlContentType = contentTypeManager.getContentType(ORG_ECLIPSE_WST_HTML_CORE_HTMLSOURCE);
-				if (contentDescription != null) {
-					IContentType fileContentType = contentDescription.getContentType();
-
-					if (htmlContentType != null) {
-						if (fileContentType.isKindOf(htmlContentType)) {
-							result = true;
-						}
-						else {
-							// ISSUE: here's a little "backwards" dependancy.
-							// there should be a "JSPEMBEDDEDHTML validator"
-							// contributed by JSP plugin.
-							IContentType jspContentType = contentTypeManager.getContentType(ORG_ECLIPSE_JST_JSP_CORE_JSPSOURCE);
-							if (jspContentType != null) {
-								result = fileContentType.isKindOf(jspContentType);
-							}
-						}
-					}
-				}
-				else if (htmlContentType != null) {
-					result = htmlContentType.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("HTML");//$NON-NLS-1$
-	}
-
-	/**
-	 */
-	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))
-				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 = 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);
-					
-					String fileName = ""; //$NON-NLS-1$
-					IPath filePath = file.getFullPath();
-					if (filePath != null) {
-						fileName = filePath.toString();
-					}
-					String args[] = new String[]{fileName};
-		
-					Message mess = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(HTMLUIMessages.MESSAGE_HTML_VALIDATION_MESSAGE_UI_, args));
-					mess.setParams(args);
-					reporter.displaySubtask(this, mess);
-				}
-				adapter.validate(ir);
-			}
-		}
-		finally {
-			if(model != null)
-				model.releaseFromRead();
-		}
-	}
-
-	/**
-	 * @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) {
-		// don't need to do anything
-	}
-	
-	/**
-	 */
-	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);
-		if (reporter != null) {
-			String fileName = ""; //$NON-NLS-1$
-			IPath filePath = file.getFullPath();
-			if (filePath != null) {
-				fileName = filePath.toString();
-			}
-			String args[] = new String[]{fileName};
-
-			// Message mess = new Message("HTMLValidation", //$NON-NLS-1$
-			// SeverityEnum.LOW_SEVERITY,
-			// "MESSAGE_HTML_VALIDATION_MESSAGE_UI_", //$NON-NLS-1$
-			// args);
-			Message mess = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(HTMLUIMessages.MESSAGE_HTML_VALIDATION_MESSAGE_UI_, args));
-			mess.setParams(args);
-			reporter.displaySubtask(this, mess);
-		}
-		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)
-					continue;
-				if (resource instanceof IFile) {
-					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;
-			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 {
-			// 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));
-	}
-}
\ 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
deleted file mode 100644
index 5eba129..0000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/LocalizedMessage.java
+++ /dev/null
@@ -1,65 +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
- *******************************************************************************/
-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();
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 71ede2d..0000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListHelper.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.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
deleted file mode 100644
index dcc3c5a..0000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListUtility.java
+++ /dev/null
@@ -1,436 +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.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 (Throwable 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);
-		}
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 1a697d1..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
+++ /dev/null
@@ -1,328 +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.html.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextHover;
-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.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.wst.css.core.internal.provisional.text.ICSSPartitionTypes;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-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.text.IHTMLPartitionTypes;
-import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML;
-import org.eclipse.wst.html.ui.internal.autoedit.AutoEditStrategyForTabs;
-import org.eclipse.wst.html.ui.internal.autoedit.StructuredAutoEditStrategyHTML;
-import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor;
-import org.eclipse.wst.html.ui.internal.contentassist.NoRegionContentAssistProcessorForHTML;
-import org.eclipse.wst.html.ui.internal.hyperlink.XMLHyperlinkDetector;
-import org.eclipse.wst.html.ui.internal.style.LineStyleProviderForHTML;
-import org.eclipse.wst.html.ui.internal.taginfo.HTMLInformationProvider;
-import org.eclipse.wst.html.ui.internal.taginfo.HTMLTagInfoHoverProcessor;
-import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
-import org.eclipse.wst.javascript.ui.internal.common.style.LineStyleProviderForJavaScript;
-import org.eclipse.wst.javascript.ui.internal.common.taginfo.JavaScriptInformationProvider;
-import org.eclipse.wst.javascript.ui.internal.common.taginfo.JavaScriptTagInfoHoverProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
-import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
-import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
-
-/**
- * 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 LineStyleProvider fLineStyleProviderForJavascript;
-	/*
-	 * One instance per configuration
-	 */
-	private StructuredTextViewerConfiguration fXMLSourceViewerConfiguration;
-
-	/**
-	 * 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]);
-		}
-
-		if (contentType == IHTMLPartitionTypes.HTML_DEFAULT || contentType == IHTMLPartitionTypes.HTML_DECLARATION) {
-			allStrategies.add(new StructuredAutoEditStrategyHTML());
-		}
-
-		// 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] = IStructuredPartitionTypes.DEFAULT_PARTITION;
-			fConfiguredContentTypes[1] = IStructuredPartitionTypes.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[] processors = null;
-
-		if ((partitionType == IHTMLPartitionTypes.HTML_DEFAULT) || (partitionType == IHTMLPartitionTypes.HTML_COMMENT)) {
-			processors = new IContentAssistProcessor[]{new HTMLContentAssistProcessor()};
-		}
-		else if (partitionType == IHTMLPartitionTypes.SCRIPT) {
-			processors = new IContentAssistProcessor[]{new JavaScriptContentAssistProcessor()};
-		}
-		else if (partitionType == ICSSPartitionTypes.STYLE) {
-			processors = new IContentAssistProcessor[]{new CSSContentAssistProcessor()};
-		}
-		else if (partitionType == IStructuredPartitionTypes.UNKNOWN_PARTITION) {
-			processors = new IContentAssistProcessor[]{new NoRegionContentAssistProcessorForHTML()};
-		}
-
-		return processors;
-	}
-
-	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
-		final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IHTMLPartitionTypes.HTML_DEFAULT);
-
-		formatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
-
-		return formatter;
-	}
-
-	public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
-		if (contentType == IHTMLPartitionTypes.HTML_DEFAULT) {
-			// use xml's doubleclick strategy
-			return getXMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, IXMLPartitions.XML_DEFAULT);
-		}
-		else
-			return super.getDoubleClickStrategy(sourceViewer, contentType);
-	}
-
-	public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
-		if (sourceViewer == null || !fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED))
-			return null;
-
-		List allDetectors = new ArrayList(0);
-		allDetectors.add(new XMLHyperlinkDetector());
-
-		IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer);
-		for (int m = 0; m < superDetectors.length; m++) {
-			IHyperlinkDetector detector = superDetectors[m];
-			if (!allDetectors.contains(detector)) {
-				allDetectors.add(detector);
-			}
-		}
-		return (IHyperlinkDetector[]) allDetectors.toArray(new IHyperlinkDetector[0]);
-	}
-
-	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()]);
-	}
-
-	protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
-		IInformationProvider provider = null;
-		if (partitionType == IHTMLPartitionTypes.HTML_DEFAULT) {
-			// HTML
-			provider = new HTMLInformationProvider();
-		}
-		else if (partitionType == IHTMLPartitionTypes.SCRIPT) {
-			// HTML JavaScript
-			provider = new JavaScriptInformationProvider();
-		}
-		return provider;
-	}
-
-	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
-		LineStyleProvider[] providers = null;
-
-		if (partitionType == IHTMLPartitionTypes.HTML_DEFAULT || partitionType == IHTMLPartitionTypes.HTML_COMMENT || partitionType == IHTMLPartitionTypes.HTML_DECLARATION) {
-			providers = new LineStyleProvider[]{getLineStyleProviderForHTML()};
-		}
-		else if (partitionType == IHTMLPartitionTypes.SCRIPT) {
-			providers = new LineStyleProvider[]{getLineStyleProviderForJavascript()};
-		}
-		else if (partitionType == ICSSPartitionTypes.STYLE) {
-			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;
-	}
-
-	private LineStyleProvider getLineStyleProviderForJavascript() {
-		if (fLineStyleProviderForJavascript == null) {
-			fLineStyleProviderForJavascript = new LineStyleProviderForJavaScript();
-		}
-		return fLineStyleProviderForJavascript;
-	}
-
-	public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
-		ITextHover textHover = null;
-
-		// look for appropriate text hover processor to return based on
-		// content type and state mask
-		TextHoverManager manager = SSEUIPlugin.getDefault().getTextHoverManager();
-		TextHoverManager.TextHoverDescriptor[] hoverDescs = manager.getTextHovers();
-		int i = 0;
-		while (i < hoverDescs.length && textHover == null) {
-			if (hoverDescs[i].isEnabled() && EditorUtility.computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
-				String hoverType = hoverDescs[i].getId();
-				if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType)) {
-					// check if script or html is needed
-					if (contentType == IHTMLPartitionTypes.SCRIPT) {
-						textHover = manager.createBestMatchHover(new JavaScriptTagInfoHoverProcessor());
-					}
-					else if (contentType == IHTMLPartitionTypes.HTML_DEFAULT) {
-						textHover = manager.createBestMatchHover(new HTMLTagInfoHoverProcessor());
-					}
-				}
-				else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType))
-					// check if script or html is needed
-					if (contentType == IHTMLPartitionTypes.SCRIPT) {
-						textHover = new JavaScriptTagInfoHoverProcessor();
-					}
-					else if (contentType == IHTMLPartitionTypes.HTML_DEFAULT) {
-						textHover = new HTMLTagInfoHoverProcessor();
-					}
-			}
-			i++;
-		}
-
-		// no appropriate text hovers found, try super
-		if (textHover == null) {
-			textHover = super.getTextHover(sourceViewer, contentType, stateMask);
-		}
-		return textHover;
-	}
-
-	private StructuredTextViewerConfiguration getXMLSourceViewerConfiguration() {
-		if (fXMLSourceViewerConfiguration == null) {
-			fXMLSourceViewerConfiguration = new StructuredTextViewerConfigurationXML();
-		}
-		return fXMLSourceViewerConfiguration;
-	}
-}
\ 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
deleted file mode 100644
index b4547be..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
+++ /dev/null
@@ -1,110 +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.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;
-
-	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 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 Creating_files_encoding;
-	public static String MESSAGE_HTML_VALIDATION_MESSAGE_UI_;
-	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_Public_ID;
-	public static String UI_System_ID;
-	public static String UI_none;
-	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;
-
-	// 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
-	
-	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;
-	}
-}
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
deleted file mode 100644
index e77314f..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java
+++ /dev/null
@@ -1,98 +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
- *******************************************************************************/
-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
deleted file mode 100644
index efddd5d..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
+++ /dev/null
@@ -1,83 +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
-###############################################################################
-## 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</BODY>\n</HTML>
-
-HTMLFilesPreferencePage_0=Loading files...
-#
-_UI_WIZARD_NEW_TITLE = New HTML Page
-_UI_WIZARD_NEW_HEADING = HTML Page
-_UI_WIZARD_NEW_DESCRIPTION = Create a new HTML Page.
-_ERROR_FILENAME_MUST_END_HTML = The file name must end in one of the following extensions {0}.
-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.
-#
-Creating_files_encoding=Creating files encoding preference
-MESSAGE_HTML_VALIDATION_MESSAGE_UI_=HTML Syntax : {0}
-# 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:
-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_Public_ID=Public ID:
-UI_System_ID=System ID:
-UI_none=none
-
-# 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
-# above are possibly unused strings that may be deleted
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
deleted file mode 100644
index 0b872f0..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java
+++ /dev/null
@@ -1,160 +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.html.ui.internal;
-
-
-
-import java.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
deleted file mode 100644
index 4ba3a6c..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/AutoEditStrategyForTabs.java
+++ /dev/null
@@ -1,187 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-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
deleted file mode 100644
index 6d8e2be..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.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.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.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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.eclipse.wst.xml.ui.internal.Logger;
-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) {
-					smartInsertForComment(command, document, model);
-					smartInsertForEndTag(command, document, model);
-				}
-			}
-		}
-		finally {
-			if (model != null)
-				model.releaseFromRead();
-		}
-	}
-
-	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 smartInsertForComment(DocumentCommand command, IDocument document, IStructuredModel model) {
-		try {
-			if (command.text.equals("-") && document.getLength() >= 3 && document.get(command.offset - 3, 3).equals("<!-")) { //$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);
-		}
-
-	}
-
-	private void smartInsertForEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
-		try {
-			if (command.text.equals("/") && document.getLength() >= 1 && document.get(command.offset - 1, 1).equals("<")) { //$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();
-					if (endTagStructuredDocumentRegion == null) {
-						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);
-		}
-	}
-
-	/**
-	 * 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
deleted file mode 100644
index 650a4c3..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java
+++ /dev/null
@@ -1,40 +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.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.internal.util.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
deleted file mode 100644
index ff35669..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
+++ /dev/null
@@ -1,484 +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
- *******************************************************************************/
-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.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.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.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
-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.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.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.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;
-
-public class HTMLContentAssistProcessor extends AbstractContentAssistProcessor implements IPropertyChangeListener {
-	private INodeAdapterFactory factoryForCSS = null;
-	protected IPreferenceStore fPreferenceStore = null;
-	protected boolean isXHTML = false;
-	private HTMLTemplateCompletionProcessor fTemplateProcessor = 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);
-	}
-
-	/**
-	 * @see AbstractContentAssistProcessor#addXMLProposal(ContentAssistRequest)
-	 */
-	protected void addXMLProposal(ContentAssistRequest contentAssistRequest) {
-		if (isXHTML)
-			super.addXMLProposal(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) {
-		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, contentAssistRequest.getReplacementBeginPosition());
-				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);
-		addTemplates(request, TemplateContextTypeIdsHTML.ALL);
-		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((StructuredTextViewer) 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$
-							// return JS content assist...
-							JavaScriptContentAssistProcessor jsProcessor = new JavaScriptContentAssistProcessor();
-							return jsProcessor.computeCompletionProposals(textViewer, documentPosition);
-						}
-					}
-				}
-			}
-		}
-
-		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 = getHTMLTagPropsosal((StructuredTextViewer) 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((StructuredTextViewer) 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 getHTMLTagPropsosal(StructuredTextViewer 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
-						CMElementDeclaration htmlDecl = (CMElementDeclaration) mq.getCorrespondingCMDocument(doc).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 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();
-		}
-		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
deleted file mode 100644
index f3daa1a..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java
+++ /dev/null
@@ -1,130 +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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import org.eclipse.core.runtime.Preferences;
-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() {
-		//IPreferenceStore prefs = CommonPreferencesPlugin.getDefault().getPreferenceStore(ContentType.ContentTypeID_HTML);
-		Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences();
-		fTagCase = prefs.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
-		fAttrCase = prefs.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
-	}
-
-	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$
-				}
-			}
-		}
-
-		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;
-	}
-
-
-}
\ No newline at end of file
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
deleted file mode 100644
index cc01530..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
+++ /dev/null
@@ -1,78 +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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-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.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;
-
-
-/**
- * Completion processor for HTML Templates. Most of the work is already done
- * by the HTML Content Assist processor, so by the time the
- * HTMLTemplateCompletionProcessor is asked for content assist proposals, the
- * HTML content assist processor has already set the context type for
- * templates.
- */
-class HTMLTemplateCompletionProcessor extends TemplateCompletionProcessor {
-	private String fContextTypeId = 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();
-	}
-
-	void setContextType(String contextTypeId) {
-		fContextTypeId = contextTypeId;
-	}
-}
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
deleted file mode 100644
index a63a6f2..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java
+++ /dev/null
@@ -1,38 +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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.css.core.internal.provisional.text.ICSSPartitionTypes;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
-import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
-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(IHTMLPartitionTypes.HTML_DEFAULT, htmlProcessor);
-		addPartitionProcessor(IHTMLPartitionTypes.HTML_COMMENT, htmlProcessor);
-
-		IContentAssistProcessor jsContentAssistProcessor = new JavaScriptContentAssistProcessor();
-		addPartitionProcessor(IHTMLPartitionTypes.SCRIPT, jsContentAssistProcessor);
-
-		IContentAssistProcessor cssContentAssistProcessor = new CSSContentAssistProcessor();
-		addPartitionProcessor(ICSSPartitionTypes.STYLE, cssContentAssistProcessor);
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index b6f9af7..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java
+++ /dev/null
@@ -1,83 +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
- *******************************************************************************/
-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;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 6da4ce2..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/HTMLNodeActionManager.java
+++ /dev/null
@@ -1,129 +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
- *******************************************************************************/
-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();
-		}
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 0881b05..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java
+++ /dev/null
@@ -1,50 +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
- *******************************************************************************/
-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());
-	}
-
-}
\ No newline at end of file
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
deleted file mode 100644
index 3a18a7d..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java
+++ /dev/null
@@ -1,77 +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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentoutline;
-
-
-
-import org.eclipse.jface.resource.ImageDescriptor;
-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) {
-		ImageDescriptor imageDescriptor = HTMLEditorPluginImageHelper.getInstance().getImageDescriptor(imageResourceName);
-		if (imageDescriptor != null)
-			return imageDescriptor.createImage();
-		return null;
-	}
-
-	/**
-	 * 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) {
-			if (node.getNodeName().equalsIgnoreCase("table")) //$NON-NLS-1$
-				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TABLE);
-			else if (node.getNodeName().equalsIgnoreCase("a")) //$NON-NLS-1$
-				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_ANCHOR);
-			else if (node.getNodeName().equalsIgnoreCase("body")) //$NON-NLS-1$
-				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_BODY);
-			else if (node.getNodeName().equalsIgnoreCase("button")) //$NON-NLS-1$
-				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_BUTTON);
-			else if (node.getNodeName().equalsIgnoreCase("font")) //$NON-NLS-1$
-				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_FONT);
-			else if (node.getNodeName().equalsIgnoreCase("form")) //$NON-NLS-1$
-				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_FORM);
-			else if (node.getNodeName().equalsIgnoreCase("html")) //$NON-NLS-1$
-				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_HTML);
-			else if (node.getNodeName().equalsIgnoreCase("img")) //$NON-NLS-1$
-				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE);
-			else if (node.getNodeName().equalsIgnoreCase("map")) //$NON-NLS-1$
-				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE_MAP);
-			else if (node.getNodeName().equalsIgnoreCase("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
deleted file mode 100644
index d72abeb..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java
+++ /dev/null
@@ -1,30 +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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-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
deleted file mode 100644
index 173e80c..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import java.util.Iterator;
-
-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
deleted file mode 100644
index e66d242..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java
+++ /dev/null
@@ -1,172 +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
- *******************************************************************************/
-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;
-
-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]);
-		}
-	}
-
-}
\ No newline at end of file
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
deleted file mode 100644
index 94f24e4..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java
+++ /dev/null
@@ -1,23 +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
- *******************************************************************************/
-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>
- */
-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
deleted file mode 100644
index 552c1db..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java
+++ /dev/null
@@ -1,24 +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
- *******************************************************************************/
-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>
- */
-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
deleted file mode 100644
index 6367d10..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-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;
-
-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
deleted file mode 100644
index b2f148f..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,277 +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
- *******************************************************************************/
-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;
-
-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
deleted file mode 100644
index b5c84d6..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,279 +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
- *******************************************************************************/
-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;
-
-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/correction/CorrectionAssistantProviderHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java
deleted file mode 100644
index 56428dc..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java
+++ /dev/null
@@ -1,50 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-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.internal.provisional.text.IHTMLPartitionTypes;
-import org.eclipse.wst.sse.ui.internal.correction.CorrectionAssistantProvider;
-import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
-import org.eclipse.wst.xml.ui.internal.correction.CorrectionProcessorXML;
-
-/**
- * Correction assistant for HTML
- */
-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, IHTMLPartitionTypes.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
deleted file mode 100644
index 6425ba3..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/derived/SingleCharReader.java
+++ /dev/null
@@ -1,66 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-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
deleted file mode 100644
index 3e5870b..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-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;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index f6139b5..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java
+++ /dev/null
@@ -1,162 +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.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.internal.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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
deleted file mode 100644
index af25260..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java
+++ /dev/null
@@ -1,318 +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
- *******************************************************************************/
-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;
-
-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 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);
-
-		// 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();
-
-		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.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 = tagNameCaseCheck || attrNameCaseCheck || fCheckBoxInsertMissingTags.getSelection() || fCheckBoxQuoteAttrValues.getSelection() || fCheckBoxFormatSource.getSelection() || eolCheck;
-		getButton(IDialogConstants.OK_ID).setEnabled(buttonEnabled);
-	}
-
-	void setisXHTMLType(boolean isXHTML) {
-		fIsXHTML = isXHTML;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 3e4863d..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java
+++ /dev/null
@@ -1,149 +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
- *******************************************************************************/
-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.jface.resource.JFaceResources;
-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 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;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index ffc1e7d..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java
+++ /dev/null
@@ -1,32 +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
- *******************************************************************************/
-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.gif";			//$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
deleted file mode 100644
index 0afe504..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-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$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileEditorInput.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileEditorInput.java
deleted file mode 100644
index 4bc2468..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileEditorInput.java
+++ /dev/null
@@ -1,159 +0,0 @@
-package org.eclipse.wst.html.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.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 IPathEditorInput, 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.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileHyperlink.java
deleted file mode 100644
index 07b14ed..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.eclipse.wst.html.ui.internal.hyperlink;
-
-import java.io.File;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-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.Logger;
-
-/**
- * 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() {
-		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.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/WorkspaceFileHyperlink.java
deleted file mode 100644
index 8ee3ac1..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.eclipse.wst.html.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.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.Logger;
-
-/**
- * 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() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
-	 */
-	public String getHyperlinkText() {
-		// 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).setHighlightRange(fHighlightRange.getOffset(), fHighlightRange.getLength(), true);
-				}
-			}
-			catch (PartInitException pie) {
-				Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
-			}
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java
deleted file mode 100644
index 4d8b548..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java
+++ /dev/null
@@ -1,503 +0,0 @@
-package org.eclipse.wst.html.ui.internal.hyperlink;
-
-import java.io.File;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-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.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.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;
-
-/**
- * Detects hyperlinks in XML tags. Includes detection in DOCTYPE and attribute
- * values. Resolves references to schemas, dtds, etc using the Common URI
- * Resolver.
- * 
- */
-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.jst.jsp.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 && file.exists()) {
-					// 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 = ++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.exists();
-		}
-		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.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
deleted file mode 100644
index 36fee03..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java
+++ /dev/null
@@ -1,89 +0,0 @@
-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.text.templates.Template;
-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();
-
-		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 styleValue = ColorHelper.getColorString(127, 0, 127) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, styleValue);
-		
-		styleValue = ColorHelper.getColorString(42, 0, 255)  + NOBACKGROUNDBOLD;
-		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.getColorString(63, 95, 191)  + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.COMMENT_BORDER, styleValue);
-		store.setDefault(IStyleConstantsXML.COMMENT_TEXT, styleValue);
-		
-		styleValue = ColorHelper.getColorString(0, 128, 128)  + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.DECL_BORDER, styleValue);
-
-		styleValue = ColorHelper.getColorString(0, 0, 128)  + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.DOCTYPE_NAME, styleValue);
-		store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, styleValue);
-		
-		styleValue = ColorHelper.getColorString(128, 128, 128)  + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, styleValue);
-
-		styleValue = ColorHelper.getColorString(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.getColorString(0, 128, 128)  + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.TAG_BORDER, styleValue);
-		
-		styleValue = ColorHelper.getColorString(63, 127, 127)  + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.TAG_NAME, styleValue);
-		
-		styleValue = ColorHelper.getColorString(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.getColorString(0, 128, 128)  + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.CDATA_BORDER, styleValue);
-		
-		styleValue = ColorHelper.getColorString(0, 0, 0)  + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.CDATA_TEXT, styleValue);
-		
-		styleValue = ColorHelper.getColorString(191, 95, 63)  + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsHTML.SCRIPT_AREA_BORDER, 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 differnt language)
-		 */
-		String templateName = ""; //$NON-NLS-1$
-		Template template = HTMLUIPlugin.getDefault().getTemplateStore().findTemplateById("org.eclipse.wst.html.ui.templates.html"); //$NON-NLS-1$
-		if (template != null)
-			templateName = template.getName();
-		store.setDefault(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
-	}
-
-}
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
deleted file mode 100644
index b4fc968..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java
+++ /dev/null
@@ -1,65 +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.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$
-}
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
deleted file mode 100644
index 5039c72..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java
+++ /dev/null
@@ -1,124 +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
- *******************************************************************************/
-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.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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;
-
-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/HTMLFilesPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
deleted file mode 100644
index 097e0bf..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
+++ /dev/null
@@ -1,115 +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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.layout.GridData;
-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.PlatformUI;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-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.EncodingSettings;
-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);
-		createContentsForCreatingOrSavingGroup(scrolledComposite);
-		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 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());		
-	}
-	protected void createContentsForCreatingGroup(Composite parent) {
-		Group creatingGroup = createGroup(parent, 2);
-		creatingGroup.setText(HTMLUIMessages.Creating_files);
-		
-		// Encoding..
-		Label label = createLabel(creatingGroup, HTMLUIMessages.Encoding_desc);
-		((GridData)label.getLayoutData()).horizontalSpan = 2;
-		fEncodingSettings = new EncodingSettings(creatingGroup);
-		((GridData)fEncodingSettings.getLayoutData()).horizontalSpan = 2;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index b055458..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java
+++ /dev/null
@@ -1,139 +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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.IPreferenceStore;
-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.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.xml.ui.internal.preferences.XMLSourcePreferencePage;
-
-public class HTMLSourcePreferencePage extends XMLSourcePreferencePage {
-
-	protected Button fTagNameAsIs = null;
-	protected Button fTagNameUpper = null;
-	protected Button fTagNameLower = null;
-	protected Button fAttrNameAsIs = null;
-	protected Button fAttrNameUpper = null;
-	protected Button fAttrNameLower = null;
-
-	protected void createContentsForGrammarConstraintsGroup(Composite parent) {
-		// do nothing
-	}
-
-	protected void performDefaultsForGrammarConstraintsGroup() {
-		// do nothing
-	}
-
-	protected void initializeValuesForGrammarConstraintsGroup() {
-		// do nothing
-	}
-
-	protected void storeValuesForGrammarConstraintsGroup() {
-		// do nothing
-	}
-
-	protected void createContentsForContentAssistGroup(Composite parent) {
-		super.createContentsForContentAssistGroup(parent);
-
-		// add one more group of preferences
-		createContentsForPreferredCaseGroup(parent, 2);
-	}
-
-	protected 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;
-
-	}
-
-	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);
-
-		super.performDefaults();
-	}
-
-	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);
-
-		super.initializeValues();
-	}
-
-	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);
-
-		super.storeValues();
-	}
-
-	public boolean performOk() {
-		boolean result = super.performOk();
-
-		doSavePreferenceStore();
-
-		return result;
-	}
-
-	protected Preferences getModelPreferences() {
-		return HTMLCorePlugin.getDefault().getPluginPreferences();
-	}
-	
-	protected IPreferenceStore doGetPreferenceStore() {
-		return HTMLUIPlugin.getDefault().getPreferenceStore();
-	}
-	
-	protected void doSavePreferenceStore() {
-		HTMLUIPlugin.getDefault().savePluginPreferences(); // UI
-		HTMLCorePlugin.getDefault().savePluginPreferences(); // model
-	}
-
-	/* (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_SOURCE_HELPID);
-		return c;
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 2bf1f90..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java
+++ /dev/null
@@ -1,58 +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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-
-
-/**
- * Preference page for HTML templates
- */
-public class HTMLTemplatePreferencePage extends TemplatePreferencePage {
-	
-	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;
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
deleted file mode 100644
index a156802..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
+++ /dev/null
@@ -1,105 +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.html.ui.internal.projection;
-
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-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.INodeNotifier;
-import org.w3c.dom.Node;
-
-public class ProjectionModelNodeAdapterFactoryHTML extends AbstractAdapterFactory {
-	// copies of this class located in:
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-
-	private ProjectionViewer fProjectionViewer;
-
-	public ProjectionModelNodeAdapterFactoryHTML(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-	public ProjectionModelNodeAdapterFactoryHTML(Object adapterKey) {
-		super(adapterKey);
-	}
-
-	public ProjectionModelNodeAdapterFactoryHTML() {
-		this(ProjectionModelNodeAdapterHTML.class);
-	}
-
-	/**
-	 * Actually creates an adapter for the parent of target if target is the
-	 * "adapt-able" node
-	 */
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		if ((fProjectionViewer != null) && (target instanceof Node) && ((Node) target).getNodeType() == Node.ELEMENT_NODE) {
-			Node node = (Node) target;
-			if (isNodeProjectable(node)) {
-
-				// actually work with the parent node to listen for add,
-				// delete events
-				Node parent = node.getParentNode();
-				if (parent instanceof INodeNotifier) {
-					INodeNotifier parentNotifier = (INodeNotifier) parent;
-					ProjectionModelNodeAdapterHTML parentAdapter = (ProjectionModelNodeAdapterHTML) parentNotifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
-					if (parentAdapter == null) {
-						// create a new adapter for parent
-						parentAdapter = new ProjectionModelNodeAdapterHTML(this);
-						parentNotifier.addAdapter(parentAdapter);
-					}
-					// call update on parent because a new node has just been
-					// added
-					parentAdapter.updateAdapter(parent);
-				}
-			}
-		}
-
-		return null;
-	}
-
-	ProjectionViewer getProjectionViewer() {
-		return fProjectionViewer;
-	}
-
-	/**
-	 * Returns true if node is a node type able to fold
-	 * 
-	 * @param node
-	 * @return boolean true if node is projectable, false otherwise
-	 */
-	boolean isNodeProjectable(Node node) {
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			String tagName = node.getNodeName();
-			// node is only projectable if it is head, body, script, style,
-			// table tags
-			if (HTML40Namespace.ElementName.HEAD.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.BODY.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.SCRIPT.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.STYLE.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.TABLE.equalsIgnoreCase((tagName)))
-				return true;
-		}
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.AbstractAdapterFactory#release()
-	 */
-	public void release() {
-		fProjectionViewer = null;
-
-		super.release();
-	}
-
-	void setProjectionViewer(ProjectionViewer viewer) {
-		fProjectionViewer = viewer;
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
deleted file mode 100644
index cd082e8..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
+++ /dev/null
@@ -1,263 +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.html.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.wst.html.ui.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.IndexedRegion;
-import org.w3c.dom.Node;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterHTML implements INodeAdapter {
-
-	private class TagProjectionAnnotation extends ProjectionAnnotation {
-		private boolean fIsVisible = false; /* workaround for BUG85874 */
-		private Node fNode;
-
-		public TagProjectionAnnotation(Node node, boolean isCollapsed) {
-			super(isCollapsed);
-			fNode = node;
-		}
-
-		public Node getNode() {
-			return fNode;
-		}
-
-		public void setNode(Node node) {
-			fNode = node;
-		}
-
-		/**
-		 * Does not paint hidden annotations. Annotations are hidden when they
-		 * only span one line.
-		 * 
-		 * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC,
-		 *      org.eclipse.swt.widgets.Canvas,
-		 *      org.eclipse.swt.graphics.Rectangle)
-		 */
-		public void paint(GC gc, Canvas canvas, Rectangle rectangle) {
-			/* workaround for BUG85874 */
-			/*
-			 * only need to check annotations that are expanded because hidden
-			 * annotations should never have been given the chance to
-			 * collapse.
-			 */
-			if (!isCollapsed()) {
-				// working with rectangle, so need the styledtext line height
-				int lineHeight = fAdapterFactory.getProjectionViewer().getTextWidget().getLineHeight();
-
-				// do not draw annotations that only span one line and mark
-				// them as not visible
-				if ((rectangle.height / lineHeight) <= 1) {
-					fIsVisible = false;
-					return;
-				}
-			}
-			fIsVisible = true;
-			super.paint(gc, canvas, rectangle);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.text.source.projection.ProjectionAnnotation#markCollapsed()
-		 */
-		public void markCollapsed() {
-			/* workaround for BUG85874 */
-			// do not mark collapsed if annotation is not visible
-			if (fIsVisible)
-				super.markCollapsed();
-		}
-	}
-
-	// copies of this class located in:
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.html.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	ProjectionModelNodeAdapterFactoryHTML fAdapterFactory;
-	private Map fTagAnnotations = new HashMap();
-
-	public ProjectionModelNodeAdapterHTML(ProjectionModelNodeAdapterFactoryHTML factory) {
-		fAdapterFactory = factory;
-	}
-
-	/**
-	 * Create a projection position from the given node. Able to get
-	 * projection position if node isNodeProjectable.
-	 * 
-	 * @param node
-	 * @return null if no projection position possible, a Position otherwise
-	 */
-	private Position createProjectionPosition(Node node) {
-		Position pos = null;
-		if (fAdapterFactory.isNodeProjectable(node) && node instanceof IndexedRegion) {
-			IDocument document = fAdapterFactory.getProjectionViewer().getDocument();
-			if (document != null) {
-				IndexedRegion inode = (IndexedRegion) node;
-				int start = inode.getStartOffset();
-				int end = inode.getEndOffset();
-				if (start >= 0 && start < end) {
-					try {
-//						// region-based
-//						// extra line when collapsed, but no region increase when add newline
-//						pos = new Position(start, end - start);
-						
-//						// line-based
-//						// extra line when collapsed, but no region increase when add newline
-//						IRegion startLineRegion = document.getLineInformationOfOffset(start);
-//						IRegion endLineRegion = document.getLineInformationOfOffset(end);
-//						int startOffset = startLineRegion.getOffset();
-//						int endOffset = endLineRegion.getOffset() + endLineRegion.getLength();
-//						if (endOffset > startOffset) {
-//							pos = new Position(startOffset, endOffset - startOffset);
-//						}
-						
-						// line-based
-						// no extra line when collapsed, but region increase when add newline
-						int startLine = document.getLineOfOffset(start);
-						int endLine = document.getLineOfOffset(end);
-						if (endLine + 1 < document.getNumberOfLines()) {
-							int offset = document.getLineOffset(startLine);
-							int endOffset = document.getLineOffset(endLine + 1);
-							pos = new Position(offset, endOffset - offset);
-						}
-					} catch (BadLocationException x) {
-						Logger.log(Logger.WARNING_DEBUG, null, x);
-					}
-				}
-			}
-		}
-		return pos;
-	}
-
-	/**
-	 * Find TagProjectionAnnotation for node in the current list of projection
-	 * annotations for this adapter
-	 * 
-	 * @param node
-	 * @return TagProjectionAnnotation
-	 */
-	private TagProjectionAnnotation getExistingAnnotation(Node node) {
-		TagProjectionAnnotation anno = null;
-
-		if ((node != null) && (!fTagAnnotations.isEmpty())) {
-			Iterator it = fTagAnnotations.keySet().iterator();
-			while (it.hasNext() && anno == null) {
-				TagProjectionAnnotation a = (TagProjectionAnnotation) it.next();
-				Node n = a.getNode();
-				if (node.equals(n)) {
-					anno = a;
-				}
-			}
-		}
-		return anno;
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return type == ProjectionModelNodeAdapterHTML.class;
-	}
-
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		// check if folding is even enabled, if not, just ignore notifyChanged
-		// events
-		if (fAdapterFactory.getProjectionViewer() == null) {
-			return;
-		}
-
-		if ((eventType == INodeNotifier.STRUCTURE_CHANGED) && (notifier instanceof Node)) {
-			updateAdapter((Node) notifier);
-		}
-	}
-
-	/**
-	 * Update the projection annotation of all the nodes that are children of
-	 * node
-	 * 
-	 * @param node
-	 */
-	void updateAdapter(Node node) {
-		long start = System.currentTimeMillis();
-
-		Map additions = new HashMap();
-		Map projectionAnnotations = new HashMap();
-
-		// go through immediate child nodes and figure out projection
-		// model annotations
-		if (node != null) {
-			Node childNode = node.getFirstChild();
-			while (childNode != null) {
-				Position newPos = createProjectionPosition(childNode);
-				if (newPos != null) {
-					TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(childNode, false);
-					TagProjectionAnnotation existing = getExistingAnnotation(childNode);
-					if (existing == null) {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(newAnnotation, newPos);
-						// add to map containing annotations to add
-						additions.put(newAnnotation, newPos);
-					} else {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(existing, newPos);
-						// remove from map containing annotations to delete
-						fTagAnnotations.remove(existing);
-					}
-				}
-				childNode = childNode.getNextSibling();
-			}
-
-			// in the end, want to delete anything leftover in old list, add
-			// everything in additions, and update everything in
-			// projectionAnnotations
-			ProjectionAnnotation[] oldList = null;
-			if (!fTagAnnotations.isEmpty()) {
-				oldList = (ProjectionAnnotation[]) fTagAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-			ProjectionAnnotation[] modifyList = null;
-			if (!projectionAnnotations.isEmpty()) {
-				modifyList = (ProjectionAnnotation[]) projectionAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-			ProjectionViewer viewer = fAdapterFactory.getProjectionViewer();
-			ProjectionAnnotationModel annotationModel = viewer.getProjectionAnnotationModel();
-			annotationModel.modifyAnnotations(oldList, additions, modifyList);
-		}
-
-		// save new list of annotations
-		fTagAnnotations = additions;
-
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf) {
-			String nodeName = node != null ? node.getNodeName() : "null"; //$NON-NLS-1$
-			System.out.println("ProjectionModelNodeAdapterHTML.updateAdapter (" + nodeName + "):" + (end - start)); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java
deleted file mode 100644
index d6a0457..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java
+++ /dev/null
@@ -1,216 +0,0 @@
-package org.eclipse.wst.html.ui.internal.projection;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-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.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Updates the projection model of a structured model for HTML.
- */
-public class StructuredTextFoldingProviderHTML implements IStructuredTextFoldingProvider, IProjectionListener {
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.html.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private IDocument fDocument;
-	private ProjectionViewer fViewer;
-
-	/**
-	 * Adds an adapter to node and its children
-	 * 
-	 * @param node
-	 * @param level
-	 */
-	private void addAdapterToNodeAndChildren(Node node, int level) {
-		if (node instanceof INodeNotifier) {
-			INodeNotifier notifier = (INodeNotifier) node;
-
-			// try and get the adapter for the current node and update the
-			// adapter with projection information
-			ProjectionModelNodeAdapterHTML adapter = (ProjectionModelNodeAdapterHTML) notifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
-			if (adapter != null) {
-				adapter.updateAdapter(node);
-			}
-			else {
-				// just call getadapter so the adapter is created and
-				// automatically initialized
-				notifier.getAdapterFor(ProjectionModelNodeAdapterHTML.class);
-			}
-
-			Node nextChild = node.getFirstChild();
-			while (nextChild != null) {
-				Node childNode = nextChild;
-				nextChild = childNode.getNextSibling();
-
-				addAdapterToNodeAndChildren(childNode, level + 1);
-			}
-		}
-	}
-
-	/**
-	 * Goes through every node and adds an adapter onto each for tracking
-	 * purposes
-	 */
-	private void addAllAdapters() {
-		long start = System.currentTimeMillis();
-
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-			if (sModel != null) {
-				int startOffset = 0;
-				IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
-				if (startNode instanceof Node) {
-					int level = 0;
-					Node nextSibling = (Node) startNode;
-					while (nextSibling != null) {
-						Node currentNode = nextSibling;
-						nextSibling = currentNode.getNextSibling();
-
-						addAdapterToNodeAndChildren(currentNode, level);
-					}
-				}
-			}
-		}
-		finally {
-			if (sModel != null) {
-				sModel.releaseFromRead();
-			}
-		}
-
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf)
-			System.out.println("StructuredTextFoldingProviderHTML.addAllAdapters: " + (end - start)); //$NON-NLS-1$
-	}
-
-	/**
-	 * Get the ProjectionModelNodeAdapterFactoryHTML to use with this
-	 * provider.
-	 * 
-	 * @return ProjectionModelNodeAdapterFactoryHTML
-	 */
-	private ProjectionModelNodeAdapterFactoryHTML getAdapterFactory(boolean createIfNeeded) {
-		long start = System.currentTimeMillis();
-
-		ProjectionModelNodeAdapterFactoryHTML factory = null;
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-			if (sModel != null) {
-				FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
-				// getting the projectionmodelnodeadapter for the first time
-				// so do some initializing
-				if (!factoryRegistry.contains(ProjectionModelNodeAdapterHTML.class) && createIfNeeded) {
-					ProjectionModelNodeAdapterFactoryHTML newFactory = new ProjectionModelNodeAdapterFactoryHTML();
-
-					// add factory to factory registry
-					factoryRegistry.addFactory(newFactory);
-
-					// add factory to propogating adapter
-					IDOMModel domModel = (IDOMModel) sModel;
-					Document document = domModel.getDocument();
-					PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
-					if (propagatingAdapter != null) {
-						propagatingAdapter.addAdaptOnCreateFactory(newFactory);
-					}
-				}
-
-				// try and get the factory
-				factory = (ProjectionModelNodeAdapterFactoryHTML) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterHTML.class);
-			}
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-		
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf)
-			System.out.println("StructuredTextFoldingProviderHTML.getAdapterFactory: " + (end - start)); //$NON-NLS-1$
-		return factory;
-	}
-
-	/**
-	 * Initialize this provider with the correct document. Assumes projection
-	 * is enabled. (otherwise, only install would have been called)
-	 */
-	public void initialize() {
-		if (!isInstalled())
-			return;
-
-		// set projection viewer to null on old document's adapter factory
-		ProjectionModelNodeAdapterFactoryHTML factory = getAdapterFactory(false);
-		if (factory != null) {
-			factory.setProjectionViewer(null);
-		}
-
-		// clear out all annotations
-		if (fViewer.getProjectionAnnotationModel() != null)
-			fViewer.getProjectionAnnotationModel().removeAllAnnotations();
-		
-		fDocument = fViewer.getDocument();
-
-		if (fDocument != null) {
-			// set projection viewer on new document's adapter factory
-			factory = getAdapterFactory(true);
-			if (factory != null) {
-				factory.setProjectionViewer(fViewer);
-			}
-
-			addAllAdapters();
-		}
-	}
-
-	/**
-	 * Associate a ProjectionViewer with this IStructuredTextFoldingProvider
-	 * 
-	 * @param viewer
-	 */
-	public void install(ProjectionViewer viewer) {
-		// uninstall before trying to install new viewer
-		if (isInstalled()) {
-			uninstall();
-		}
-		fViewer = viewer;
-		fViewer.addProjectionListener(this);
-	}
-
-	private boolean isInstalled() {
-		return fViewer != null;
-	}
-
-	public void projectionDisabled() {
-		ProjectionModelNodeAdapterFactoryHTML factory = getAdapterFactory(false);
-		if (factory != null) {
-			factory.setProjectionViewer(null);
-		}
-
-		fDocument = null;
-	}
-
-	public void projectionEnabled() {
-		initialize();
-	}
-
-	/**
-	 * Disconnect this IStructuredTextFoldingProvider from projection viewer
-	 */
-	public void uninstall() {
-		if (isInstalled()) {
-			projectionDisabled();
-
-			fViewer.removeProjectionListener(this);
-			fViewer = null;
-		}
-	}
-}
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
deleted file mode 100644
index 58bb496..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java
+++ /dev/null
@@ -1,66 +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
- *******************************************************************************/
-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
-	}
-
-}
\ No newline at end of file
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
deleted file mode 100644
index 23c2c49..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java
+++ /dev/null
@@ -1,34 +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.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
deleted file mode 100644
index 4a3e740..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java
+++ /dev/null
@@ -1,32 +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.html.ui.internal.search;
-
-import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes;
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
-import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-/**
- * Configures a FindOccurrencesProcessor with HTML partitions and regions
- */
-public class HTMLFindOccurrencesProcessor extends FindOccurrencesProcessor {
-
-	protected String[] getPartitionTypes() {
-		return new String[]{IHTMLPartitionTypes.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
deleted file mode 100644
index 5c7c88d..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java
+++ /dev/null
@@ -1,22 +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
- *******************************************************************************/
-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
deleted file mode 100644
index a2b5e7a..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java
+++ /dev/null
@@ -1,75 +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
- *******************************************************************************/
-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);
-		}
-		if (region.getType() == DOMRegionContext.BLOCK_TEXT) {
-			return (TextAttribute)getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
-		}
-		// 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();
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index 9c85f32..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java
+++ /dev/null
@@ -1,55 +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
- *******************************************************************************/
-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)
- * 
- * @author amywu
- */
-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);
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index b8f7103..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLTagInfoHoverProcessor.java
+++ /dev/null
@@ -1,28 +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
- *******************************************************************************/
-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();
-	}
-
-}
\ No newline at end of file
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
deleted file mode 100644
index aca7d17..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java
+++ /dev/null
@@ -1,38 +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.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
deleted file mode 100644
index bf775f4..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java
+++ /dev/null
@@ -1,34 +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
- *******************************************************************************/
-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
deleted file mode 100644
index 794b13d..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java
+++ /dev/null
@@ -1,50 +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.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/HTMLDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java
deleted file mode 100644
index 7cbce42..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,27 +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
- *******************************************************************************/
-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));
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index b9d8561..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/IJavaPartitions.java
+++ /dev/null
@@ -1,54 +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.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
deleted file mode 100644
index e3cace3..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaCodeReader.java
+++ /dev/null
@@ -1,244 +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.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
deleted file mode 100644
index 01602a2..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaHeuristicScanner.java
+++ /dev/null
@@ -1,986 +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.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
deleted file mode 100644
index 020769f..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaPairMatcher.java
+++ /dev/null
@@ -1,277 +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.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
deleted file mode 100644
index d88615e..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/Symbols.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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.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/NewHTMLTemplatesWizardPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java
deleted file mode 100644
index d5b61db..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java
+++ /dev/null
@@ -1,474 +0,0 @@
-package org.eclipse.wst.html.ui.internal.wizard;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-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.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;
-
-/**
- * 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);
-
-		// Create linked text to just to templates preference page
-		Link link = new Link(innerParent, SWT.NONE);
-		link.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_6);
-		data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
-		link.setLayoutData(data);
-		link.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				linkClicked();
-			}
-		});
-
-		// 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);
-
-		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) {
-		SourceViewer viewer = new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		SourceViewerConfiguration configuration = new SourceViewerConfiguration();
-		viewer.configure(configuration);
-		IDocument document = new Document();
-		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);
-		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() {
-		String templateName = HTMLUIPlugin.getDefault().getPreferenceStore().getString(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
-		if (templateName == null || templateName.length() == 0) {
-			fLastSelectedTemplateName = ""; //$NON-NLS-1$
-			fUseTemplateButton.setSelection(false);
-		}
-		else {
-			fLastSelectedTemplateName = templateName;
-			fUseTemplateButton.setSelection(true);
-		}
-		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
deleted file mode 100644
index 081f609..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package org.eclipse.wst.html.ui.internal.wizard;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStreamWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-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.osgi.util.NLS;
-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.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.ide.IDE;
-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.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;
-
-public class NewHTMLWizard extends Wizard implements INewWizard {
-	private WizardNewFileCreationPage fNewFilePage;
-	private NewHTMLTemplatesWizardPage fNewFileTemplatesPage;
-	private IStructuredSelection fSelection;
-	private List fValidExtensions = null;
-
-	/**
-	 * Get list of valid extensions for JSP Content type
-	 * 
-	 * @return
-	 */
-	List getValidExtensions() {
-		if (fValidExtensions == null) {
-			IContentType type = Platform.getContentTypeManager().getContentType(ContentTypeIdForHTML.ContentTypeID_HTML);
-			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
-		}
-		return fValidExtensions;
-	}
-
-	public void addPages() {
-		fNewFilePage = new WizardNewFileCreationPage("HTMLWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))) { //$NON-NLS-1$
-			protected boolean validatePage() {
-				IPath handlePath = new Path(getFileName());
-				String extension = handlePath.getFileExtension();
-				if (extension == null || !getValidExtensions().contains(extension)) {
-					setErrorMessage(NLS.bind(HTMLUIMessages._ERROR_FILENAME_MUST_END_HTML, getValidExtensions().toString()));
-					return false;
-				}
-				setErrorMessage(null);
-				return super.validatePage();
-			}
-		};
-		fNewFilePage.setTitle(HTMLUIMessages._UI_WIZARD_NEW_HEADING);
-		fNewFilePage.setDescription(HTMLUIMessages._UI_WIZARD_NEW_DESCRIPTION);
-
-		addPage(fNewFilePage);
-		
-		fNewFileTemplatesPage = new NewHTMLTemplatesWizardPage();
-		addPage(fNewFileTemplatesPage);
-	}
-
-	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() {
-		// save user options for next use
-		fNewFileTemplatesPage.saveLastSavedPreferences();
-
-		// create a new empty file
-		IFile file = fNewFilePage.createNewFile();
-
-		// put template contents into file
-		String templateString = fNewFileTemplatesPage.getTemplateString();
-		if (templateString != null) {
-			// 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);
-		return true;
-	}
-}
\ 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
deleted file mode 100644
index 4214204..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLContentOutlineConfiguration.java
+++ /dev/null
@@ -1,44 +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.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
deleted file mode 100644
index b0e4a4f..0000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties
+++ /dev/null
@@ -1,44 +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
-###############################################################################
-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">\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">\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.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.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)
\ 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
deleted file mode 100644
index b51832a..0000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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.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.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>
-
-</templates>
diff --git a/bundles/org.eclipse.wst.sse.core/.classpath b/bundles/org.eclipse.wst.sse.core/.classpath
deleted file mode 100644
index c41d101..0000000
--- a/bundles/org.eclipse.wst.sse.core/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src-encoding"/>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="src-tasktags"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="src" path="src-contentproperties"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.sse.core/.cvsignore b/bundles/org.eclipse.wst.sse.core/.cvsignore
deleted file mode 100644
index fa4ec03..0000000
--- a/bundles/org.eclipse.wst.sse.core/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-bin
-model.jar
-build.xml
-temp.folder
-org.eclipse.wst.sse.core_1.0.0.jar
-@dot
-src.zip
diff --git a/bundles/org.eclipse.wst.sse.core/.options b/bundles/org.eclipse.wst.sse.core/.options
deleted file mode 100644
index d83ceee..0000000
--- a/bundles/org.eclipse.wst.sse.core/.options
+++ /dev/null
@@ -1,17 +0,0 @@
-org.eclipse.wst.sse.core/debug=true
-org.eclipse.wst.sse.core/dom/adapter/notification/time=false
-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/lifecycle=false
-org.eclipse.wst.sse.core/structuredmodel/lifecycle=false
-org.eclipse.wst.sse.core/structuredmodel/state=false
-org.eclipse.wst.sse.core/structuredmodel/locks=true
-org.eclipse.wst.sse.core/structuredmodel/modelmanager=false
-org.eclipse.wst.sse.core/tasks=false
-org.eclipse.wst.sse.core/tasks/detection=false
-org.eclipse.wst.sse.core/tasks/job=false
-org.eclipse.wst.sse.core/tasks/overalltime=false
-org.eclipse.wst.sse.core/tasks/time=false
-org.eclipse.wst.sse.core/tasks/preferences=false
-org.eclipse.wst.sse.core/tasks/registry=false
diff --git a/bundles/org.eclipse.wst.sse.core/.project b/bundles/org.eclipse.wst.sse.core/.project
deleted file mode 100644
index 36c5b34..0000000
--- a/bundles/org.eclipse.wst.sse.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.sse.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.sse.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index c46d2b5..0000000
--- a/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,69 +0,0 @@
-#Sat Oct 01 03:58:44 EDT 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-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=500
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-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.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=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-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.missingSerialVersion=warning
-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=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-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.unsafeTypeOperation=warning
-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.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.sse.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 1c37f54..0000000
--- a/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Fri May 27 23:57:51 EDT 2005
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-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.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex
deleted file mode 100644
index 96fe58a..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex
+++ /dev/null
@@ -1,286 +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.common.encoding.contentspecific.css;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.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 CSSHeadTokenizer() {
-		super();
-	}
-
-	  public void reset (Reader in) {
-	  	/* 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;
-
-  		/**
-  		 * 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
-  		 */
-  		yy_atBOL = false;
-
-  		/* 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;
-
-
-  		fStateStack.clear();
-  		
-  		hasMore = true;
-  		
-		// its a little wasteful to "throw away" first char array generated
-		// by class init (via auto generated code), but we really do want
-		// a small buffer for our head parsers.
-		if (yy_buffer.length != MAX_TO_SCAN) {
-			yy_buffer = new char[MAX_TO_SCAN];
-		}
-  		
-
-  	}
-
-
-	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 CSSHeadTokenizer
-%function primGetNextToken
-%type String
-%char
-%unicode
-%ignorecase 
-%debug
-%switch
-
-
-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
-
-
-%state ST_XMLDecl
-%state CHARSET_RULE
-%state QuotedAttributeValue
-%state DQ_STRING
-%state SQ_STRING
-%state UnDelimitedString
-
-%%
-
-
-<YYINITIAL>  
-{
-	{UTF16BE}   		{hasMore = false; return EncodingParserConstants.UTF16BE;}
-	{UTF16LE}   		{hasMore = false; return EncodingParserConstants.UTF16LE;}
-	{UTF83ByteBOM}   	{hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}
-
-	// force to be started on first line, but we do allow preceeding spaces
-	^ {S}* "<\?xml" {S}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}
-	
-	^ {S}* "@charset"     {if (yychar == 0 )  {yybegin(CHARSET_RULE); return CSSHeadTokenizerConstants.CHARSET_RULE;}}
-	
-
-}	
-
-// I don't think there's really an XML form of CSS files ... but will leave here for consistency	
-<ST_XMLDecl> 
-{
-	//"version" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}
-	"encoding" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}
-	// note this "forced end" once end of XML Declaration found
-	"\?>"    {yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd;}
-}	
-
-<CHARSET_RULE> 
-{
-
-	{S}*  {pushCurrentState(); yybegin(QuotedAttributeValue);}
-	";"    { yybegin(YYINITIAL);  hasMore = false; return CSSHeadTokenizerConstants.RuleEnd;}
-}
-	
-
-<QuotedAttributeValue>
-{
-	\"                      { yybegin(DQ_STRING); string.setLength(0); }
-	\'			{ yybegin(SQ_STRING); string.setLength(0); }
-	// in this state, anything other than a space character can start an undelimited string
-	{S}*.           { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}
-
-}	
-
-
-<DQ_STRING>
-{
-
-	\"                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"<"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	
-	">"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\/>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	";"                      { yypushback(1); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-	
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<SQ_STRING>
-{
-
-	\'                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"%>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"<"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	">"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\/>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	";"                      { yypushback(1); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<UnDelimitedString>
-{
-
-
-	{S}                     { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"<"			{ yypushback(1);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
-	\'			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	\"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	
-	">"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\/>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	";"                      { yypushback(1); popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
-	.			{ 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)
-<YYINITIAL, ST_XMLDecl, QuotedAttributeValue, CHARSET_RULE>
-{
-// this is the fallback (match "anything") rule  (for this scanner, input is ignored, and position advanced, if not recognized)
-.|\n              {if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}
-}
-
-// this rule always in effect
-<<EOF>>         {hasMore = false; return EncodingParserConstants.EOF;}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java
deleted file mode 100644
index 4dfc385..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java
+++ /dev/null
@@ -1,977 +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
- *     
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 1/27/04 6:42 PM */
-
-/*nlsXXX*/
-package org.eclipse.wst.common.encoding.contentspecific.css;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.XMLHeadTokenizerConstants;
-
-
-
-
-/**
- * This class is a scanner generated by 
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 1/27/04 6:42 PM from the specification file
- * <tt>file:/D:/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jflex</tt>
- */
-public class CSSHeadTokenizer {
-
-  /** this character denotes the end of file */
-  final public static int YYEOF = -1;
-
-  /** lexical states */
-  final public static int YYINITIAL = 0;
-  final public static int UnDelimitedString = 12;
-  final public static int DQ_STRING = 8;
-  final public static int SQ_STRING = 10;
-  final public static int ST_XMLDecl = 2;
-  final public static int QuotedAttributeValue = 6;
-  final public static int CHARSET_RULE = 4;
-
-  /**
-   * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
-   * YY_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 final static int YY_LEXSTATE[] = { 
-     0,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,  7, 7
-  };
-
-  /** 
-   * Translates characters to character classes
-   */
-  final private static String yycmap_packed = 
-    "\11\0\1\6\1\11\2\0\1\10\22\0\1\6\1\0\1\36\2\0"+
-    "\1\41\1\0\1\37\7\0\1\40\13\0\1\35\1\12\1\7\1\34"+
-    "\1\13\1\17\1\22\1\0\1\20\1\31\1\25\1\0\1\33\1\21"+
-    "\1\32\2\0\1\16\1\15\1\27\1\30\2\0\1\23\1\24\1\26"+
-    "\3\0\1\14\10\0\1\22\1\0\1\20\1\31\1\25\1\0\1\33"+
-    "\1\21\1\32\2\0\1\16\1\15\1\27\1\30\2\0\1\23\1\24"+
-    "\1\26\3\0\1\14\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
-   */
-  final private static char [] yycmap = yy_unpack_cmap(yycmap_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",
-    "Internal error: unknown state",
-    "Error: could not match input",
-    "Error: pushback value was too large"
-  };
-
-  /** 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 boolean hasMore = true;
-	private final static int MAX_TO_SCAN = 1000;
-	StringBuffer string = new StringBuffer();
-	// state stack for easier state handling
-	private IntStack fStateStack = new IntStack();
-	private String valueText = null;
-
-
-
-	public CSSHeadTokenizer() {
-		super();
-	}
-
-	  public void reset (Reader in) {
-	  	/* 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;
-
-  		/**
-  		 * 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
-  		 */
-  		yy_atBOL = false;
-
-  		/* 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;
-
-
-  		fStateStack.clear();
-  		
-  		hasMore = true;
-  		
-		// its a little wasteful to "throw away" first char array generated
-		// by class init (via auto generated code), but we really do want
-		// a small buffer for our head parsers.
-		if (yy_buffer.length != MAX_TO_SCAN) {
-			yy_buffer = new char[MAX_TO_SCAN];
-		}
-  		
-
-  	}
-
-
-	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 CSSHeadTokenizer(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 CSSHeadTokenizer(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 [] 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 < 158) {
-      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.
-   *
-   * @param   errorCode  the code of the errormessage to display
-   */
-  private void yy_ScanError(int errorCode) {
-    try {
-      System.out.println(YY_ERROR_MSG[errorCode]);
-    }
-    catch (ArrayIndexOutOfBoundsException e) {
-      System.out.println(YY_ERROR_MSG[YY_UNKNOWN_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()!
-   */
-  private void yypushback(int number) {
-    if ( number > yylength() )
-      yy_ScanError(YY_PUSHBACK_2BIG);
-
-    yy_markedPos -= number;
-  }
-
-
-  /**
-   * 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;
-    	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   IOException  if any I/O-Error occurs
-   */
-  public String primGetNextToken() throws java.io.IOException {
-    int yy_input;
-    int yy_action;
-
-
-    while (true) {
-
-      yychar+= yylength();
-
-      yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos-1] == '\n';
-      if (!yy_atBOL && yy_buffer[yy_markedPos-1] == '\r') {
-        yy_atBOL = yy_advance() != '\n';
-        if (!yy_atEOF) yy_currentPos--;
-      }
-
-      yy_action = -1;
-
-      yy_currentPos = yy_startRead = yy_markedPos;
-
-      if (yy_atBOL)
-        yy_state = YY_LEXSTATE[yy_lexical_state+1];
-      else
-        yy_state = YY_LEXSTATE[yy_lexical_state];
-
-
-      yy_forAction: {
-        while (true) {
-
-          yy_input = yy_advance();
-
-          if ( yy_input == YYEOF ) break yy_forAction;
-
-          yy_input = yycmap[yy_input];
-
-          boolean yy_isFinal = false;
-          boolean yy_noLookAhead = false;
-
-          yy_forNext: { switch (yy_state) {
-            case 0:
-              switch (yy_input) {
-                case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
-                case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
-                case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
-              }
-
-            case 1:
-              switch (yy_input) {
-                case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
-                case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
-                case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
-                case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_state = 12; break yy_forNext;
-                case 10: yy_isFinal = true; yy_state = 13; break yy_forNext;
-                case 15: yy_isFinal = true; yy_state = 14; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
-              }
-
-            case 2:
-              switch (yy_input) {
-                case 11: yy_isFinal = true; yy_state = 15; break yy_forNext;
-                case 21: yy_isFinal = true; yy_state = 16; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
-              }
-
-            case 3:
-              switch (yy_input) {
-                case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_state = 17; break yy_forNext;
-                case 29: yy_isFinal = true; yy_noLookAhead = true; yy_state = 18; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
-              }
-
-            case 4:
-              switch (yy_input) {
-                case 6: 
-                case 8: yy_isFinal = true; yy_state = 20; break yy_forNext;
-                case 9: yy_isFinal = true; yy_state = 21; break yy_forNext;
-                case 30: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
-                case 31: yy_isFinal = true; yy_noLookAhead = true; yy_state = 23; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 19; break yy_forNext;
-              }
-
-            case 5:
-              switch (yy_input) {
-                case 8: 
-                case 9: 
-                case 10: 
-                case 28: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
-                case 11: 
-                case 32: yy_isFinal = true; yy_state = 26; break yy_forNext;
-                case 29: yy_isFinal = true; yy_noLookAhead = true; yy_state = 27; break yy_forNext;
-                case 30: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 24; break yy_forNext;
-              }
-
-            case 6:
-              switch (yy_input) {
-                case 8: 
-                case 9: 
-                case 10: 
-                case 28: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
-                case 32: yy_isFinal = true; yy_state = 26; break yy_forNext;
-                case 29: yy_isFinal = true; yy_noLookAhead = true; yy_state = 27; break yy_forNext;
-                case 31: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
-                case 33: yy_isFinal = true; yy_state = 29; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 24; break yy_forNext;
-              }
-
-            case 7:
-              switch (yy_input) {
-                case 10: 
-                case 28: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
-                case 32: yy_isFinal = true; yy_state = 26; break yy_forNext;
-                case 11: yy_isFinal = true; yy_state = 29; break yy_forNext;
-                case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 30; break yy_forNext;
-                case 29: yy_isFinal = true; yy_noLookAhead = true; yy_state = 31; break yy_forNext;
-                case 30: 
-                case 31: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 24; break yy_forNext;
-              }
-
-            case 9:
-              switch (yy_input) {
-                case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 33; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 10:
-              switch (yy_input) {
-                case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 34; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 11:
-              switch (yy_input) {
-                case 4: yy_state = 35; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 12:
-              switch (yy_input) {
-                case 6: 
-                case 8: 
-                case 9: yy_state = 36; break yy_forNext;
-                case 10: yy_state = 37; break yy_forNext;
-                case 15: yy_state = 38; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 13:
-              switch (yy_input) {
-                case 11: yy_state = 39; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 14:
-              switch (yy_input) {
-                case 16: yy_state = 40; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 15:
-              switch (yy_input) {
-                case 28: yy_isFinal = true; yy_noLookAhead = true; yy_state = 41; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 16:
-              switch (yy_input) {
-                case 23: yy_state = 42; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 17:
-              switch (yy_input) {
-                case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_state = 17; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 20:
-              switch (yy_input) {
-                case 6: 
-                case 8: yy_isFinal = true; yy_state = 20; break yy_forNext;
-                case 9: yy_state = 43; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 19; break yy_forNext;
-              }
-
-            case 21:
-              switch (yy_input) {
-                case 6: 
-                case 8: yy_isFinal = true; yy_state = 20; break yy_forNext;
-                case 9: yy_state = 43; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 19; break yy_forNext;
-              }
-
-            case 26:
-              switch (yy_input) {
-                case 28: yy_isFinal = true; yy_noLookAhead = true; yy_state = 44; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 29:
-              switch (yy_input) {
-                case 28: yy_isFinal = true; yy_noLookAhead = true; yy_state = 45; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 35:
-              switch (yy_input) {
-                case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 46; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 36:
-              switch (yy_input) {
-                case 6: 
-                case 8: 
-                case 9: yy_state = 36; break yy_forNext;
-                case 10: yy_state = 37; break yy_forNext;
-                case 15: yy_state = 38; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 37:
-              switch (yy_input) {
-                case 11: yy_state = 39; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 38:
-              switch (yy_input) {
-                case 16: yy_state = 40; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 39:
-              switch (yy_input) {
-                case 12: yy_state = 47; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 40:
-              switch (yy_input) {
-                case 17: yy_state = 48; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 42:
-              switch (yy_input) {
-                case 16: yy_state = 49; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 43:
-              switch (yy_input) {
-                case 6: 
-                case 8: yy_isFinal = true; yy_state = 20; break yy_forNext;
-                case 9: yy_state = 43; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 19; break yy_forNext;
-              }
-
-            case 47:
-              switch (yy_input) {
-                case 13: yy_state = 50; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 48:
-              switch (yy_input) {
-                case 18: yy_state = 51; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 49:
-              switch (yy_input) {
-                case 24: yy_state = 52; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 50:
-              switch (yy_input) {
-                case 14: yy_state = 53; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 51:
-              switch (yy_input) {
-                case 19: yy_state = 54; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 52:
-              switch (yy_input) {
-                case 25: yy_state = 55; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 53:
-              switch (yy_input) {
-                case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_state = 56; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 54:
-              switch (yy_input) {
-                case 20: yy_state = 57; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 55:
-              switch (yy_input) {
-                case 26: yy_state = 58; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 56:
-              switch (yy_input) {
-                case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_state = 56; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 57:
-              switch (yy_input) {
-                case 21: yy_state = 59; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 58:
-              switch (yy_input) {
-                case 23: yy_state = 60; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 59:
-              switch (yy_input) {
-                case 22: yy_isFinal = true; yy_noLookAhead = true; yy_state = 61; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 60:
-              switch (yy_input) {
-                case 27: yy_state = 62; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 62:
-              switch (yy_input) {
-                case 6: 
-                case 8: 
-                case 9: yy_state = 62; break yy_forNext;
-                case 7: yy_isFinal = true; yy_state = 63; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 63:
-              switch (yy_input) {
-                case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_state = 63; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            default:
-              yy_ScanError(YY_ILLEGAL_STATE);
-              break;
-          } }
-
-          if ( yy_isFinal ) {
-            yy_action = yy_state; 
-            yy_markedPos = yy_currentPos; 
-            if ( yy_noLookAhead ) break yy_forAction;
-          }
-
-        }
-      }
-
-
-      switch (yy_action) {    
-
-        case 45: 
-          {  yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 65: break;
-        case 25: 
-          {  yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 66: break;
-        case 19: 
-        case 20: 
-          {  yypushback(1); yybegin(UnDelimitedString); string.setLength(0); }
-        case 67: break;
-        case 18: 
-          {  yybegin(YYINITIAL);  hasMore = false; return CSSHeadTokenizerConstants.RuleEnd; }
-        case 68: break;
-        case 32: 
-          {  yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
-        case 69: break;
-        case 44: 
-          {  yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 70: break;
-        case 61: 
-          { if (yychar == 0 )  {yybegin(CHARSET_RULE); return CSSHeadTokenizerConstants.CHARSET_RULE;} }
-        case 71: break;
-        case 56: 
-          { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;} }
-        case 72: break;
-        case 8: 
-        case 9: 
-        case 10: 
-        case 11: 
-        case 12: 
-        case 13: 
-        case 14: 
-        case 15: 
-        case 16: 
-        case 21: 
-          { if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
-        case 73: break;
-        case 41: 
-          { yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd; }
-        case 74: break;
-        case 63: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
-        case 75: break;
-        case 3: 
-        case 17: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); }
-        case 76: break;
-        case 46: 
-          { hasMore = false; return EncodingParserConstants.UTF83ByteBOM; }
-        case 77: break;
-        case 33: 
-          { hasMore = false; return EncodingParserConstants.UTF16BE; }
-        case 78: break;
-        case 34: 
-          { hasMore = false; return EncodingParserConstants.UTF16LE; }
-        case 79: break;
-        case 24: 
-        case 26: 
-        case 29: 
-          {  string.append( yytext() );  }
-        case 80: break;
-        case 23: 
-          {  yybegin(SQ_STRING); string.setLength(0);  }
-        case 81: break;
-        case 22: 
-          {  yybegin(DQ_STRING); string.setLength(0);  }
-        case 82: break;
-        case 27: 
-          {  yypushback(1); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;  }
-        case 83: break;
-        case 28: 
-          {  popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;  }
-        case 84: break;
-        case 30: 
-          {  yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
-        case 85: break;
-        case 31: 
-          {  yypushback(1); popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
-        case 86: break;
-        default: 
-          if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
-            yy_atEOF = true;
-            yy_do_eof();
-              { hasMore = false; return EncodingParserConstants.EOF; }
-          } 
-          else {
-            yy_ScanError(YY_NO_MATCH);
-          }
-      }
-    }
-  }    
-
-  /**
-   * Runs the scanner on input files.
-   *
-   * This main method is the debugging routine for the scanner.
-   * It prints each returned token to System.out until the end of
-   * file is reached, or an error occured.
-   *
-   * @param argv   the command line, contains the filenames to run
-   *               the scanner on.
-   */
-  public static void main(String argv[]) {
-    for (int i = 0; i < argv.length; i++) {
-      CSSHeadTokenizer scanner = null;
-      try {
-        scanner = new CSSHeadTokenizer( new java.io.FileReader(argv[i]) );
-      }
-      catch (java.io.FileNotFoundException e) {
-        System.out.println("File not found : \""+argv[i]+"\"");
-        System.exit(1);
-      }
-      catch (java.io.IOException e) {
-        System.out.println("Error opening file \""+argv[i]+"\"");
-        System.exit(1);
-      }
-      catch (ArrayIndexOutOfBoundsException e) {
-        System.out.println("Usage : java CSSHeadTokenizer <inputfile>");
-        System.exit(1);
-      }
-
-      try {
-        do {
-          System.out.println(scanner.primGetNextToken());
-        } while (!scanner.yy_atEOF);
-
-      }
-      catch (java.io.IOException e) {
-        System.out.println("An I/O error occured while scanning :");
-        System.out.println(e);
-        System.exit(1);
-      }
-      catch (Exception e) {
-        e.printStackTrace();
-        System.exit(1);
-      }
-    }
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizerGenJava.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizerGenJava.cmd
deleted file mode 100644
index 9ef06e9..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizerGenJava.cmd
+++ /dev/null
@@ -1,23 +0,0 @@
-@echo off
-
-rem The following variables need to be set/specified for each "development machine"
-set PATH=%PATH%;d:jdks\j2sdk1.4.1_02\bin
-set WORKSPACE_LOCATION=D:\builds\Workspaces\PureHeadWorkspace
-set JFLEX_LIB_LOCATION=D:\DevTimeSupport\JFlex\lib
-
-rem The following variables differ from project to project, but should be otherwise constant
-set MAIN_NAME=CSSHeadTokenizer
-set PROJECT_SRC=\org.eclipse.wst.common.encoding.contentspecific\src\
-set PACKAGE_DIR=com\ibm\encoding\resource\contentspecific\css\
-
-rem Given the above "framework" and the command themselves, these variables should never need to be modified
-set JAVA_FILE=%MAIN_NAME%.java
-set JFLEX_RULES=%MAIN_NAME%.jflex
-set SKELETON_FILE=%MAIN_NAME%.skeleton
-
-IF EXIST %JAVA_FILE% del %JAVA_FILE%
-rem java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES% -skel %SKELETON_FILE% 1>jflexout.txt 2>jflexerr.txt
-java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES%  1>jflexout.txt 2>jflexerr.txt
-IF EXIST %JAVA_FILE% copy %JAVA_FILE% %WORKSPACE_LOCATION%%PROJECT_SRC%%PACKAGE_DIR%%JAVA_FILE%
-
-rem pause
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexerr.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexerr.txt
deleted file mode 100644
index e69de29..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexerr.txt
+++ /dev/null
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexout.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexout.txt
deleted file mode 100644
index e0743ca..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexout.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Reading "CSSHeadTokenizer.jflex"
-Constructing NFA : 458 states in NFA
-Converting NFA to DFA : 
-........................................................................................
-102 states before minimization, 64 states in minimized DFA
-Writing code to "CSSHeadTokenizer.java"
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
deleted file mode 100644
index 2bc923d..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex
+++ /dev/null
@@ -1,285 +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.common.encoding.contentspecific.html;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.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;
-	boolean foundContentTypeValue = false;
-
-
-
-	public HTMLHeadTokenizer() {
-		super();
-	}
-
-	  public void reset (Reader in) {
-	  	/* 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;
-
-  		/**
-  		 * 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
-  		 */
-  		yy_atBOL = false;
-
-  		/* 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;
-
-
-  		fStateStack.clear();
-  		
-  		hasMore = true;
-  		
-		// its a little wasteful to "throw away" first char array generated
-		// by class init (via auto generated code), but we really do want
-		// a small buffer for our head parsers.
-		if (yy_buffer.length != MAX_TO_SCAN) {
-			yy_buffer = new char[MAX_TO_SCAN];
-		}
-  		
-
-  	}
-
-
-	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 HTMLHeadTokenizer
-%function primGetNextToken
-%type String
-%char
-%unicode
-%ignorecase 
-%debug
-%switch
-
-
-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
-
-
-%state ST_XMLDecl
-%state ST_META_TAG
-%state QuotedAttributeValue
-%state DQ_STRING
-%state SQ_STRING
-%state UnDelimitedString
-
-%%
-
-
-<YYINITIAL>  
-{
-	{UTF16BE}   		{hasMore = false; return EncodingParserConstants.UTF16BE;}
-	{UTF16LE}   		{hasMore = false; return EncodingParserConstants.UTF16LE;}
-	{UTF83ByteBOM}   	{hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}
-
-	// force to be started on first line, but we do allow preceeding spaces
-	^ {S}* "<\?xml" {S}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}
-	
-	"<META "       {yybegin(ST_META_TAG); return HTMLHeadTokenizerConstants.MetaTagStart;}
-	
-
-}	
-	
-<ST_XMLDecl> 
-{
-	//"version" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}
-	"encoding" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}
-	// note this "forced end" once end of XML Declaration found
-	"\?>"    {yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd;}
-}	
-
-<ST_META_TAG> 
-{
-
-	"http-equiv" {S}* \= {S}* \"? "Content-Type" \"? {S}+ "content" {BeginAttribeValue}  {pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType;}
-	">"    { yybegin(YYINITIAL);  if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd;}
-	"\/>"    { yybegin(YYINITIAL); if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd;}
-}
-	
-
-<QuotedAttributeValue>
-{
-	\"                      { yybegin(DQ_STRING); string.setLength(0); }
-	\'			{ yybegin(SQ_STRING); string.setLength(0); }
-	// in this state, anything other than a space character can start an undelimited string
-	{S}*.           { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}
-
-}	
-
-
-<DQ_STRING>
-{
-
-	\"                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"<"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	
-	">"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\/>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<SQ_STRING>
-{
-
-	\'                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"%>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"<"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	">"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\/>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<UnDelimitedString>
-{
-
-
-	// note this initial special case for HTTP contenttype values
-	";"{S}*			{ string.append( yytext() ); }
-	{S}                     { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"<"			{ yypushback(1);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
-	\'			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	\"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	
-	">"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\/>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	.			{ 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)
-<YYINITIAL, ST_XMLDecl, QuotedAttributeValue, ST_META_TAG>
-{
-// this is the fallback (match "anything") rule  (for this scanner, input is ignored, and position advanced, if not recognized)
-.|\n              {if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}
-}
-
-// this rule always in effect
-<<EOF>>         {hasMore = false; return EncodingParserConstants.EOF;}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.java
deleted file mode 100644
index a1ec0f5..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.java
+++ /dev/null
@@ -1,1206 +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
- *     
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 1/27/04 6:41 PM */
-
-/*nlsXXX*/
-package org.eclipse.wst.common.encoding.contentspecific.html;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.XMLHeadTokenizerConstants;
-
-
-
-
-/**
- * This class is a scanner generated by 
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 1/27/04 6:41 PM from the specification file
- * <tt>file:/D:/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jflex</tt>
- */
-public class HTMLHeadTokenizer {
-
-  /** this character denotes the end of file */
-  final public static int YYEOF = -1;
-
-  /** lexical states */
-  final public static int ST_META_TAG = 4;
-  final public static int YYINITIAL = 0;
-  final public static int UnDelimitedString = 12;
-  final public static int DQ_STRING = 8;
-  final public static int SQ_STRING = 10;
-  final public static int ST_XMLDecl = 2;
-  final public static int QuotedAttributeValue = 6;
-
-  /**
-   * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
-   * YY_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 final static int YY_LEXSTATE[] = { 
-     0,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,  7, 7
-  };
-
-  /** 
-   * Translates characters to character classes
-   */
-  final private static String yycmap_packed = 
-    "\11\0\1\6\1\7\2\0\1\11\22\0\1\22\1\0\1\40\2\0"+
-    "\1\44\1\0\1\43\5\0\1\34\1\0\1\42\13\0\1\45\1\12"+
-    "\1\10\1\31\1\13\1\0\1\21\1\0\1\24\1\26\1\17\1\0"+
-    "\1\30\1\32\1\27\2\0\1\16\1\15\1\23\1\25\1\33\1\35"+
-    "\2\0\1\20\1\36\1\37\1\0\1\14\1\41\7\0\1\21\1\0"+
-    "\1\24\1\26\1\17\1\0\1\30\1\32\1\27\2\0\1\16\1\15"+
-    "\1\23\1\25\1\33\1\35\2\0\1\20\1\36\1\37\1\0\1\14"+
-    "\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
-   */
-  final private static char [] yycmap = yy_unpack_cmap(yycmap_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",
-    "Internal error: unknown state",
-    "Error: could not match input",
-    "Error: pushback value was too large"
-  };
-
-  /** 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 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;
-	boolean foundContentTypeValue = false;
-
-
-
-	public HTMLHeadTokenizer() {
-		super();
-	}
-
-	  public void reset (Reader in) {
-	  	/* 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;
-
-  		/**
-  		 * 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
-  		 */
-  		yy_atBOL = false;
-
-  		/* 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;
-
-
-  		fStateStack.clear();
-  		
-  		hasMore = true;
-  		
-		// its a little wasteful to "throw away" first char array generated
-		// by class init (via auto generated code), but we really do want
-		// a small buffer for our head parsers.
-		if (yy_buffer.length != MAX_TO_SCAN) {
-			yy_buffer = new char[MAX_TO_SCAN];
-		}
-  		
-
-  	}
-
-
-	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 HTMLHeadTokenizer(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 HTMLHeadTokenizer(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 [] 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 < 174) {
-      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.
-   *
-   * @param   errorCode  the code of the errormessage to display
-   */
-  private void yy_ScanError(int errorCode) {
-    try {
-      System.out.println(YY_ERROR_MSG[errorCode]);
-    }
-    catch (ArrayIndexOutOfBoundsException e) {
-      System.out.println(YY_ERROR_MSG[YY_UNKNOWN_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()!
-   */
-  private void yypushback(int number) {
-    if ( number > yylength() )
-      yy_ScanError(YY_PUSHBACK_2BIG);
-
-    yy_markedPos -= number;
-  }
-
-
-  /**
-   * 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;
-    	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   IOException  if any I/O-Error occurs
-   */
-  public String primGetNextToken() throws java.io.IOException {
-    int yy_input;
-    int yy_action;
-
-
-    while (true) {
-
-      yychar+= yylength();
-
-      yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos-1] == '\n';
-      if (!yy_atBOL && yy_buffer[yy_markedPos-1] == '\r') {
-        yy_atBOL = yy_advance() != '\n';
-        if (!yy_atEOF) yy_currentPos--;
-      }
-
-      yy_action = -1;
-
-      yy_currentPos = yy_startRead = yy_markedPos;
-
-      if (yy_atBOL)
-        yy_state = YY_LEXSTATE[yy_lexical_state+1];
-      else
-        yy_state = YY_LEXSTATE[yy_lexical_state];
-
-
-      yy_forAction: {
-        while (true) {
-
-          yy_input = yy_advance();
-
-          if ( yy_input == YYEOF ) break yy_forAction;
-
-          yy_input = yycmap[yy_input];
-
-          boolean yy_isFinal = false;
-          boolean yy_noLookAhead = false;
-
-          yy_forNext: { switch (yy_state) {
-            case 0:
-              switch (yy_input) {
-                case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
-                case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
-                case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
-                case 10: yy_isFinal = true; yy_state = 12; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
-              }
-
-            case 1:
-              switch (yy_input) {
-                case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
-                case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
-                case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_isFinal = true; yy_state = 13; break yy_forNext;
-                case 10: yy_isFinal = true; yy_state = 14; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
-              }
-
-            case 2:
-              switch (yy_input) {
-                case 11: yy_isFinal = true; yy_state = 15; break yy_forNext;
-                case 15: yy_isFinal = true; yy_state = 16; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
-              }
-
-            case 3:
-              switch (yy_input) {
-                case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 17; break yy_forNext;
-                case 26: yy_isFinal = true; yy_state = 18; break yy_forNext;
-                case 34: yy_isFinal = true; yy_state = 19; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
-              }
-
-            case 4:
-              switch (yy_input) {
-                case 6: 
-                case 9: 
-                case 18: yy_isFinal = true; yy_state = 21; break yy_forNext;
-                case 7: yy_isFinal = true; yy_state = 22; break yy_forNext;
-                case 32: yy_isFinal = true; yy_noLookAhead = true; yy_state = 23; break yy_forNext;
-                case 35: yy_isFinal = true; yy_noLookAhead = true; yy_state = 24; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
-              }
-
-            case 5:
-              switch (yy_input) {
-                case 7: 
-                case 9: 
-                case 10: 
-                case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
-                case 11: 
-                case 34: yy_isFinal = true; yy_state = 27; break yy_forNext;
-                case 32: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
-              }
-
-            case 6:
-              switch (yy_input) {
-                case 7: 
-                case 9: 
-                case 10: 
-                case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
-                case 34: yy_isFinal = true; yy_state = 27; break yy_forNext;
-                case 35: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
-                case 36: yy_isFinal = true; yy_state = 29; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
-              }
-
-            case 7:
-              switch (yy_input) {
-                case 10: 
-                case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
-                case 34: yy_isFinal = true; yy_state = 27; break yy_forNext;
-                case 11: yy_isFinal = true; yy_state = 29; break yy_forNext;
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_isFinal = true; yy_noLookAhead = true; yy_state = 30; break yy_forNext;
-                case 32: 
-                case 35: yy_isFinal = true; yy_noLookAhead = true; yy_state = 31; break yy_forNext;
-                case 37: yy_isFinal = true; yy_state = 32; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
-              }
-
-            case 9:
-              switch (yy_input) {
-                case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 33; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 10:
-              switch (yy_input) {
-                case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 34; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 11:
-              switch (yy_input) {
-                case 4: yy_state = 35; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 12:
-              switch (yy_input) {
-                case 13: yy_state = 36; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 13:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_state = 37; break yy_forNext;
-                case 10: yy_state = 38; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 14:
-              switch (yy_input) {
-                case 13: yy_state = 36; break yy_forNext;
-                case 11: yy_state = 39; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 15:
-              switch (yy_input) {
-                case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 40; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 16:
-              switch (yy_input) {
-                case 19: yy_state = 41; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 18:
-              switch (yy_input) {
-                case 16: yy_state = 42; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 19:
-              switch (yy_input) {
-                case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 43; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 21:
-              switch (yy_input) {
-                case 6: 
-                case 9: 
-                case 18: yy_isFinal = true; yy_state = 21; break yy_forNext;
-                case 7: yy_state = 44; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
-              }
-
-            case 22:
-              switch (yy_input) {
-                case 6: 
-                case 9: 
-                case 18: yy_isFinal = true; yy_state = 21; break yy_forNext;
-                case 7: yy_state = 44; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
-              }
-
-            case 27:
-              switch (yy_input) {
-                case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 45; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 29:
-              switch (yy_input) {
-                case 25: yy_isFinal = true; yy_noLookAhead = true; yy_state = 46; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 32:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_isFinal = true; yy_state = 32; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 35:
-              switch (yy_input) {
-                case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 47; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 36:
-              switch (yy_input) {
-                case 15: yy_state = 48; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 37:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_state = 37; break yy_forNext;
-                case 10: yy_state = 38; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 38:
-              switch (yy_input) {
-                case 11: yy_state = 39; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 39:
-              switch (yy_input) {
-                case 12: yy_state = 49; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 41:
-              switch (yy_input) {
-                case 20: yy_state = 50; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 42:
-              switch (yy_input) {
-                case 16: yy_state = 51; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 44:
-              switch (yy_input) {
-                case 6: 
-                case 9: 
-                case 18: yy_isFinal = true; yy_state = 21; break yy_forNext;
-                case 7: yy_state = 44; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
-              }
-
-            case 48:
-              switch (yy_input) {
-                case 16: yy_state = 52; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 49:
-              switch (yy_input) {
-                case 13: yy_state = 53; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 50:
-              switch (yy_input) {
-                case 21: yy_state = 54; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 51:
-              switch (yy_input) {
-                case 27: yy_state = 55; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 52:
-              switch (yy_input) {
-                case 17: yy_state = 56; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 53:
-              switch (yy_input) {
-                case 14: yy_state = 57; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 54:
-              switch (yy_input) {
-                case 22: yy_state = 58; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 55:
-              switch (yy_input) {
-                case 28: yy_state = 59; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 56:
-              switch (yy_input) {
-                case 18: yy_isFinal = true; yy_noLookAhead = true; yy_state = 60; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 57:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_isFinal = true; yy_state = 61; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 58:
-              switch (yy_input) {
-                case 23: yy_state = 62; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 59:
-              switch (yy_input) {
-                case 15: yy_state = 63; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 61:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_isFinal = true; yy_state = 61; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 62:
-              switch (yy_input) {
-                case 19: yy_state = 64; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 63:
-              switch (yy_input) {
-                case 29: yy_state = 65; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 64:
-              switch (yy_input) {
-                case 24: yy_state = 66; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 65:
-              switch (yy_input) {
-                case 30: yy_state = 67; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 66:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_state = 66; break yy_forNext;
-                case 8: yy_isFinal = true; yy_state = 68; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 67:
-              switch (yy_input) {
-                case 23: yy_state = 69; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 68:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_isFinal = true; yy_state = 68; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 69:
-              switch (yy_input) {
-                case 31: yy_state = 70; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 70:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_state = 70; break yy_forNext;
-                case 8: yy_state = 71; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 71:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_state = 71; break yy_forNext;
-                case 20: yy_state = 72; break yy_forNext;
-                case 32: yy_state = 73; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 72:
-              switch (yy_input) {
-                case 21: yy_state = 74; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 73:
-              switch (yy_input) {
-                case 20: yy_state = 72; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 74:
-              switch (yy_input) {
-                case 19: yy_state = 75; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 75:
-              switch (yy_input) {
-                case 16: yy_state = 76; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 76:
-              switch (yy_input) {
-                case 15: yy_state = 77; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 77:
-              switch (yy_input) {
-                case 19: yy_state = 78; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 78:
-              switch (yy_input) {
-                case 16: yy_state = 79; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 79:
-              switch (yy_input) {
-                case 28: yy_state = 80; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 80:
-              switch (yy_input) {
-                case 16: yy_state = 81; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 81:
-              switch (yy_input) {
-                case 33: yy_state = 82; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 82:
-              switch (yy_input) {
-                case 27: yy_state = 83; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 83:
-              switch (yy_input) {
-                case 15: yy_state = 84; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 84:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_state = 85; break yy_forNext;
-                case 32: yy_state = 86; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 85:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_state = 85; break yy_forNext;
-                case 20: yy_state = 87; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 86:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_state = 85; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 87:
-              switch (yy_input) {
-                case 21: yy_state = 88; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 88:
-              switch (yy_input) {
-                case 19: yy_state = 89; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 89:
-              switch (yy_input) {
-                case 16: yy_state = 90; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 90:
-              switch (yy_input) {
-                case 15: yy_state = 91; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 91:
-              switch (yy_input) {
-                case 19: yy_state = 92; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 92:
-              switch (yy_input) {
-                case 16: yy_state = 93; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 93:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_state = 93; break yy_forNext;
-                case 8: yy_isFinal = true; yy_state = 94; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 94:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: 
-                case 18: yy_isFinal = true; yy_state = 94; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            default:
-              yy_ScanError(YY_ILLEGAL_STATE);
-              break;
-          } }
-
-          if ( yy_isFinal ) {
-            yy_action = yy_state; 
-            yy_markedPos = yy_currentPos; 
-            if ( yy_noLookAhead ) break yy_forAction;
-          }
-
-        }
-      }
-
-
-      switch (yy_action) {    
-
-        case 26: 
-          {  yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 96: break;
-        case 20: 
-        case 21: 
-          {  yypushback(1); yybegin(UnDelimitedString); string.setLength(0); }
-        case 97: break;
-        case 17: 
-          {  yybegin(YYINITIAL);  if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd; }
-        case 98: break;
-        case 31: 
-          {  yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
-        case 99: break;
-        case 43: 
-          {  yybegin(YYINITIAL); if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd; }
-        case 100: break;
-        case 45: 
-          {  yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 101: break;
-        case 46: 
-          {  yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 102: break;
-        case 61: 
-          { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;} }
-        case 103: break;
-        case 8: 
-        case 9: 
-        case 10: 
-        case 11: 
-        case 12: 
-        case 13: 
-        case 14: 
-        case 15: 
-        case 16: 
-        case 18: 
-        case 19: 
-        case 22: 
-          { if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
-        case 104: break;
-        case 60: 
-          { yybegin(ST_META_TAG); return HTMLHeadTokenizerConstants.MetaTagStart; }
-        case 105: break;
-        case 40: 
-          { yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd; }
-        case 106: break;
-        case 94: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType; }
-        case 107: break;
-        case 68: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
-        case 108: break;
-        case 33: 
-          { hasMore = false; return EncodingParserConstants.UTF16BE; }
-        case 109: break;
-        case 34: 
-          { hasMore = false; return EncodingParserConstants.UTF16LE; }
-        case 110: break;
-        case 47: 
-          { hasMore = false; return EncodingParserConstants.UTF83ByteBOM; }
-        case 111: break;
-        case 28: 
-          {  popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;  }
-        case 112: break;
-        case 25: 
-        case 27: 
-        case 29: 
-        case 32: 
-          {  string.append( yytext() );  }
-        case 113: break;
-        case 24: 
-          {  yybegin(SQ_STRING); string.setLength(0);  }
-        case 114: break;
-        case 23: 
-          {  yybegin(DQ_STRING); string.setLength(0);  }
-        case 115: break;
-        case 30: 
-          {  yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
-        case 116: break;
-        default: 
-          if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
-            yy_atEOF = true;
-            yy_do_eof();
-              { hasMore = false; return EncodingParserConstants.EOF; }
-          } 
-          else {
-            yy_ScanError(YY_NO_MATCH);
-          }
-      }
-    }
-  }    
-
-  /**
-   * Runs the scanner on input files.
-   *
-   * This main method is the debugging routine for the scanner.
-   * It prints each returned token to System.out until the end of
-   * file is reached, or an error occured.
-   *
-   * @param argv   the command line, contains the filenames to run
-   *               the scanner on.
-   */
-  public static void main(String argv[]) {
-    for (int i = 0; i < argv.length; i++) {
-      HTMLHeadTokenizer scanner = null;
-      try {
-        scanner = new HTMLHeadTokenizer( new java.io.FileReader(argv[i]) );
-      }
-      catch (java.io.FileNotFoundException e) {
-        System.out.println("File not found : \""+argv[i]+"\"");
-        System.exit(1);
-      }
-      catch (java.io.IOException e) {
-        System.out.println("Error opening file \""+argv[i]+"\"");
-        System.exit(1);
-      }
-      catch (ArrayIndexOutOfBoundsException e) {
-        System.out.println("Usage : java HTMLHeadTokenizer <inputfile>");
-        System.exit(1);
-      }
-
-      try {
-        do {
-          System.out.println(scanner.primGetNextToken());
-        } while (!scanner.yy_atEOF);
-
-      }
-      catch (java.io.IOException e) {
-        System.out.println("An I/O error occured while scanning :");
-        System.out.println(e);
-        System.exit(1);
-      }
-      catch (Exception e) {
-        e.printStackTrace();
-        System.exit(1);
-      }
-    }
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizerGenJava.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizerGenJava.cmd
deleted file mode 100644
index 96f2325..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizerGenJava.cmd
+++ /dev/null
@@ -1,23 +0,0 @@
-@echo off
-
-rem The following variables need to be set/specified for each "development machine"
-set PATH=%PATH%;d:jdks\j2sdk1.4.1_02\bin
-set WORKSPACE_LOCATION=D:\builds\Workspaces\PureHeadWorkspace
-set JFLEX_LIB_LOCATION=D:\DevTimeSupport\JFlex\lib
-
-rem The following variables differ from project to project, but should be otherwise constant
-set MAIN_NAME=HTMLHeadTokenizer
-set PROJECT_SRC=\org.eclipse.wst.common.encoding.contentspecific\src\
-set PACKAGE_DIR=com\ibm\encoding\resource\contentspecific\html\
-
-rem Given the above "framework" and the command themselves, these variables should never need to be modified
-set JAVA_FILE=%MAIN_NAME%.java
-set JFLEX_RULES=%MAIN_NAME%.jflex
-set SKELETON_FILE=%MAIN_NAME%.skeleton
-
-IF EXIST %JAVA_FILE% del %JAVA_FILE%
-rem java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES% -skel %SKELETON_FILE% 1>jflexout.txt 2>jflexerr.txt
-java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES%  1>jflexout.txt 2>jflexerr.txt
-IF EXIST %JAVA_FILE% copy %JAVA_FILE% %WORKSPACE_LOCATION%%PROJECT_SRC%%PACKAGE_DIR%%JAVA_FILE%
-
-rem pause
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexerr.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexerr.txt
deleted file mode 100644
index e69de29..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexerr.txt
+++ /dev/null
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexout.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexout.txt
deleted file mode 100644
index 1469e9c..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexout.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Reading "HTMLHeadTokenizer.jflex"
-
-Warning : Macro "SpaceChar" has been declared but never used.
-Constructing NFA : 660 states in NFA
-Converting NFA to DFA : 
-.........................................................................................................................
-135 states before minimization, 95 states in minimized DFA
-Writing code to "HTMLHeadTokenizer.java"
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.jFlex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.jFlex
deleted file mode 100644
index a5dd0f4..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/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.sse.core.xml.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.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.java
deleted file mode 100644
index 07bdcf2..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.java
+++ /dev/null
@@ -1,594 +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
- *     
- *******************************************************************************/
-/* The following code was generated by JFlex 1.4 on 7/17/04 3:43 AM */
-
-/*nlsXXX*/
-package org.eclipse.wst.sse.core.xml.internal.parser;
-
-
-
-
-/**
- * This class is a scanner generated by 
- * <a href="http://www.jflex.de/">JFlex</a> 1.4
- * on 7/17/04 3:43 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 = 
-    "\11\0\1\1\1\2\2\0\1\1\22\0\1\1\14\0\1\0\2\0"+
-    "\12\0\1\3\6\0\32\3\4\0\1\3\1\0\32\3\74\0\1\0"+
-    "\10\0\27\3\1\0\37\3\1\0\72\3\2\0\13\3\2\0\10\3"+
-    "\1\0\65\3\1\0\104\3\11\0\44\3\3\0\2\3\4\0\36\3"+
-    "\70\0\131\3\22\0\7\3\16\0\2\0\56\0\106\0\32\0\2\0"+
-    "\44\0\1\3\1\0\3\3\1\0\1\3\1\0\24\3\1\0\54\3"+
-    "\1\0\7\3\3\0\1\3\1\0\1\3\1\0\1\3\1\0\1\3"+
-    "\1\0\22\3\15\0\14\3\1\0\102\3\1\0\14\3\1\0\44\3"+
-    "\1\0\4\0\11\0\65\3\2\0\2\3\2\0\2\3\3\0\34\3"+
-    "\2\0\10\3\2\0\2\3\67\0\46\3\2\0\1\3\7\0\46\3"+
-    "\12\0\21\0\1\0\27\0\1\0\3\0\1\0\1\0\1\0\2\0"+
-    "\1\0\1\0\13\0\33\3\5\0\3\3\56\0\32\3\5\0\1\0"+
-    "\12\3\10\0\15\0\12\0\6\0\1\0\107\3\2\0\5\3\1\0"+
-    "\17\3\1\0\4\3\1\0\1\3\17\0\2\3\2\0\1\0\4\0"+
-    "\2\0\12\0\u0207\0\3\0\1\0\65\3\2\0\1\0\1\3\20\0"+
-    "\3\0\4\0\3\0\12\3\2\0\2\0\12\0\21\0\3\0\1\0"+
-    "\10\3\2\0\2\3\2\0\26\3\1\0\7\3\1\0\1\3\3\0"+
-    "\4\3\2\0\1\0\1\0\7\0\2\0\2\0\2\0\3\0\11\0"+
-    "\1\0\4\0\2\3\1\0\3\3\2\0\2\0\12\0\2\3\20\0"+
-    "\1\0\2\0\6\3\4\0\2\3\2\0\26\3\1\0\7\3\1\0"+
-    "\2\3\1\0\2\3\1\0\2\3\2\0\1\0\1\0\5\0\4\0"+
-    "\2\0\2\0\3\0\13\0\4\3\1\0\1\3\7\0\12\0\2\0"+
-    "\3\3\14\0\3\0\1\0\7\3\1\0\1\3\1\0\3\3\1\0"+
-    "\26\3\1\0\7\3\1\0\2\3\1\0\5\3\2\0\1\0\1\3"+
-    "\10\0\1\0\3\0\1\0\3\0\22\0\1\3\5\0\12\0\21\0"+
-    "\3\0\1\0\10\3\2\0\2\3\2\0\26\3\1\0\7\3\1\0"+
-    "\2\3\2\0\4\3\2\0\1\0\1\3\6\0\3\0\2\0\2\0"+
-    "\3\0\10\0\2\0\4\0\2\3\1\0\3\3\4\0\12\0\22\0"+
-    "\2\0\1\0\6\3\3\0\3\3\1\0\4\3\3\0\2\3\1\0"+
-    "\1\3\1\0\2\3\3\0\2\3\3\0\3\3\3\0\10\3\1\0"+
-    "\3\3\4\0\5\0\3\0\3\0\1\0\4\0\11\0\1\0\17\0"+
-    "\11\0\21\0\3\0\1\0\10\3\1\0\3\3\1\0\27\3\1\0"+
-    "\12\3\1\0\5\3\4\0\7\0\1\0\3\0\1\0\4\0\7\0"+
-    "\2\0\11\0\2\3\4\0\12\0\22\0\2\0\1\0\10\3\1\0"+
-    "\3\3\1\0\27\3\1\0\12\3\1\0\5\3\4\0\7\0\1\0"+
-    "\3\0\1\0\4\0\7\0\2\0\7\0\1\3\1\0\2\3\4\0"+
-    "\12\0\22\0\2\0\1\0\10\3\1\0\3\3\1\0\27\3\1\0"+
-    "\20\3\4\0\6\0\2\0\3\0\1\0\4\0\11\0\1\0\10\0"+
-    "\2\3\4\0\12\0\221\0\56\3\1\0\1\3\1\0\2\3\7\0"+
-    "\5\0\6\3\1\0\10\0\1\0\12\0\47\0\2\3\1\0\1\3"+
-    "\2\0\2\3\1\0\1\3\2\0\1\3\6\0\4\3\1\0\7\3"+
-    "\1\0\3\3\1\0\1\3\1\0\1\3\2\0\2\3\1\0\2\3"+
-    "\1\0\1\3\1\0\2\3\6\0\1\0\2\0\1\3\2\0\5\3"+
-    "\1\0\1\0\1\0\6\0\2\0\12\0\76\0\2\0\6\0\12\0"+
-    "\13\0\1\0\1\0\1\0\1\0\1\0\4\0\2\0\10\3\1\0"+
-    "\41\3\7\0\24\0\1\0\6\0\4\0\6\0\1\0\1\0\1\0"+
-    "\25\0\3\0\7\0\1\0\1\0\346\0\46\3\12\0\47\3\11\0"+
-    "\1\3\1\0\2\3\1\0\3\3\1\0\1\3\1\0\2\3\1\0"+
-    "\5\3\51\0\1\3\1\0\1\3\1\0\1\3\13\0\1\3\1\0"+
-    "\1\3\1\0\1\3\3\0\2\3\3\0\1\3\5\0\3\3\1\0"+
-    "\1\3\1\0\1\3\1\0\1\3\1\0\1\3\3\0\2\3\3\0"+
-    "\2\3\1\0\1\3\50\0\1\3\11\0\1\3\2\0\1\3\2\0"+
-    "\2\3\7\0\2\3\1\0\1\3\1\0\7\3\50\0\1\3\4\0"+
-    "\1\3\10\0\1\3\u0c06\0\234\3\4\0\132\3\6\0\26\3\2\0"+
-    "\6\3\2\0\46\3\2\0\6\3\2\0\10\3\1\0\1\3\1\0"+
-    "\1\3\1\0\1\3\1\0\37\3\2\0\65\3\1\0\7\3\1\0"+
-    "\1\3\3\0\3\3\1\0\7\3\3\0\4\3\2\0\6\3\4\0"+
-    "\15\3\5\0\3\3\1\0\7\3\323\0\15\0\4\0\1\0\104\0"+
-    "\1\3\3\0\2\3\2\0\1\3\121\0\3\3\u0e82\0\1\0\1\0"+
-    "\1\3\31\0\11\3\6\0\1\0\5\0\13\0\124\3\4\0\2\0"+
-    "\2\0\2\0\2\0\132\3\1\0\3\0\6\0\50\3\u1cd3\0\u51a6\3"+
-    "\u0c5a\0\u2ba4\3\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\4\1";
-
-  private static int [] zzUnpackAction() {
-    int [] result = new int[7];
-    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\0\20\0\24\0\30";
-
-  private static int [] zzUnpackRowMap() {
-    int [] result = new int[7];
-    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, 1, -1, 2, -1, -1, -1, -1, 2, 3, 
-    4, 2, 2, 3, 4, 5, -1, 4, 4, 6, 
-    5, 5, 4, 5, 6, 6, -1, 6, 
-  };
-
-  /* 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\5\1";
-
-  private static int [] zzUnpackAttribute() {
-    int [] result = new int[7];
-    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: */
-
-	/**
-	 * 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 < 1226) {
-      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;
-          }
-        case 3: break;
-        case 2: 
-          { return true;
-          }
-        case 4: break;
-        default: 
-          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
-            zzAtEOF = true;
-              { {return false;} }
-          } 
-          else {
-            zzScanError(ZZ_NO_MATCH);
-          }
-      }
-    }
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10NamesGenJava.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10NamesGenJava.cmd
deleted file mode 100644
index 2477d14..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10NamesGenJava.cmd
+++ /dev/null
@@ -1,25 +0,0 @@
-@echo on
-
-rem The following variables need to be set/specified for each "development machine"
-set PATH=%PATH%;D:\JDKs\j2sdk1.4.2_03\bin
-set WORKSPACE_LOCATION=D:\builds\Workspaces\RC2
-set JFLEX_LIB_LOCATION=D:\DevTimeSupport\JFlex-1.4\lib
-
-rem The following variables differ from project to project, but should be otherwise constant
-set MAIN_NAME=XML10Names
-
-set PROJECT_SRC=\org.eclipse.wst.sse.core.xml\src\
-set PACKAGE_DIR=com\ibm\sse\model\xml\internal\parser\
-
-
-rem Given the above "framework" and the command themselves, these variables should never need to be modified
-set JAVA_FILE=%MAIN_NAME%.java
-set JFLEX_RULES=%MAIN_NAME%.jflex
-set SKELETON_FILE=%MAIN_NAME%.skeleton
-
-IF EXIST %JAVA_FILE% del %JAVA_FILE%
-rem java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES% -skel %SKELETON_FILE% 1>jflexout.txt 2>jflexerr.txt
-java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES%  1>jflexout.txt 2>jflexerr.txt
-IF EXIST %JAVA_FILE% copy %JAVA_FILE% %WORKSPACE_LOCATION%%PROJECT_SRC%%PACKAGE_DIR%%JAVA_FILE%
-
-pause
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10NamesGenJavaJFlex14.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10NamesGenJavaJFlex14.cmd
deleted file mode 100644
index aafbf61..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10NamesGenJavaJFlex14.cmd
+++ /dev/null
@@ -1,25 +0,0 @@
-@echo on
-
-rem The following variables need to be set/specified for each "development machine"
-set PATH=%PATH%;D:\JDKs\j2sdk1.4.2_03\bin
-set WORKSPACE_LOCATION=D:\builds\Workspaces\RC2
-set JFLEX_LIB_LOCATION=D:\DevTimeSupport\JFlex-1.4\lib
-
-rem The following variables differ from project to project, but should be otherwise constant
-set MAIN_NAME=XML10Names
-
-set PROJECT_SRC=\org.eclipse.wst.sse.core.xml\src\
-set PACKAGE_DIR=com\ibm\sse\model\xml\internal\parser\
-
-
-rem Given the above "framework" and the command themselves, these variables should never need to be modified
-set JAVA_FILE=%MAIN_NAME%.java
-set JFLEX_RULES=%MAIN_NAME%.jflex
-set SKELETON_FILE=%MAIN_NAME%.skeleton
-
-IF EXIST %JAVA_FILE% del %JAVA_FILE%
-rem java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\Jflex.jar;. JFlex.Main %JFLEX_RULES% -skel %SKELETON_FILE% 1>jflexout.txt 2>jflexerr.txt
-java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\Jflex.jar;. JFlex.Main %JFLEX_RULES%  1>jflexout.txt 2>jflexerr.txt
-IF EXIST %JAVA_FILE% copy %JAVA_FILE% %WORKSPACE_LOCATION%%PROJECT_SRC%%PACKAGE_DIR%%JAVA_FILE%
-
-pause
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexerr.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexerr.txt
deleted file mode 100644
index e69de29..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexerr.txt
+++ /dev/null
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexout.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexout.txt
deleted file mode 100644
index 6e960b5..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexout.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Reading "XML10Names.jflex"
-Constructing NFA : 36 states in NFA
-Converting NFA to DFA : 
-...........
-13 states before minimization, 7 states in minimized DFA
-Writing code to "XML10Names.java"
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.jFlex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.jFlex
deleted file mode 100644
index d6fe899..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.jFlex
+++ /dev/null
@@ -1,260 +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.common.encoding.contentspecific.xml;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.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
-
-
-%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}* "<\?xml" {S}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}
-	
-}	
-	
-<ST_XMLDecl> 
-{
-	"version" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}
-	"encoding" {BeginAttribeValue} {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). 
-	"\?>"    {yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd;}
-}	
-
-	
-
-<QuotedAttributeValue>
-{
-	\"                      { yybegin(DQ_STRING); string.setLength(0); }
-	\'			{ yybegin(SQ_STRING); string.setLength(0); }
-	// in this state, anything other than a space character can start an undelimited string
-	{S}*.           { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}
-
-}	
-
-
-<DQ_STRING>
-{
-
-	\"                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	'<'			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<SQ_STRING>
-{
-
-	\'                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"%>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	'<'			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<UnDelimitedString>
-{
-
-	{S}                     { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	'<'	
-	{ yypushback(1);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
-	\'			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	
-	\"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	
-	.			{ 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)
-<YYINITIAL, ST_XMLDecl, QuotedAttributeValue>
-{
-// this is the fallback (match "anything") rule  (for this scanner, input is ignored, and position advanced, if not recognized)
-.|\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.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.java
deleted file mode 100644
index af0375c..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.java
+++ /dev/null
@@ -1,905 +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
- *     
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 4/6/04 11:13 PM */
-
-/*nlsXXX*/
-package org.eclipse.wst.common.encoding.contentspecific.xml;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.XMLHeadTokenizerConstants;
-
-
-
-
-
-/**
- * This class is a scanner generated by 
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 4/6/04 11:13 PM from the specification file
- * <tt>file:/D:/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.jflex</tt>
- */
-public class XMLHeadTokenizer {
-
-  /** this character denotes the end of file */
-  final public static int YYEOF = -1;
-
-  /** lexical states */
-  final public static int YYINITIAL = 0;
-  final public static int UnDelimitedString = 10;
-  final public static int DQ_STRING = 6;
-  final public static int SQ_STRING = 8;
-  final public static int ST_XMLDecl = 2;
-  final public static int QuotedAttributeValue = 4;
-
-  /**
-   * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
-   * YY_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 final static int YY_LEXSTATE[] = { 
-     0,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6, 6
-  };
-
-  /** 
-   * Translates characters to character classes
-   */
-  final private static String yycmap_packed = 
-    "\11\0\1\6\1\7\2\0\1\11\22\0\1\6\1\0\1\27\2\0"+
-    "\1\31\1\0\1\30\24\0\1\12\1\10\1\26\1\13\3\0\1\21"+
-    "\1\23\1\17\1\0\1\25\1\0\1\24\2\0\1\16\1\15\1\20"+
-    "\1\22\10\0\1\14\12\0\1\21\1\23\1\17\1\0\1\25\1\0"+
-    "\1\24\2\0\1\16\1\15\1\20\1\22\10\0\1\14\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
-   */
-  final private static char [] yycmap = yy_unpack_cmap(yycmap_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",
-    "Internal error: unknown state",
-    "Error: could not match input",
-    "Error: pushback value was too large"
-  };
-
-  /** 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 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 */
-	  	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;
-
-  		/**
-  		 * 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
-  		 */
-  		yy_atBOL = false;
-
-  		/* 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;
-
-
-  		fStateStack.clear();
-  		
-  		hasMore = true;
-  		
-  		// its a little wasteful to "throw away" first char array generated
-  		// by class init (via auto generated code), but we really do want 
-  		// a small buffer for our head parsers. 
-  		if (yy_buffer.length != MAX_TO_SCAN) {
-  			yy_buffer = new char[MAX_TO_SCAN];
-  		}
-
-
-  	}
-
-
-	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.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 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 [] 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 < 128) {
-      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.
-   *
-   * @param   errorCode  the code of the errormessage to display
-   */
-  private void yy_ScanError(int errorCode) {
-    try {
-      System.out.println(YY_ERROR_MSG[errorCode]);
-    }
-    catch (ArrayIndexOutOfBoundsException e) {
-      System.out.println(YY_ERROR_MSG[YY_UNKNOWN_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()!
-   */
-  private void yypushback(int number) {
-    if ( number > yylength() )
-      yy_ScanError(YY_PUSHBACK_2BIG);
-
-    yy_markedPos -= number;
-  }
-
-
-  /**
-   * 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;
-    	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   IOException  if any I/O-Error occurs
-   */
-  public String primGetNextToken() throws java.io.IOException {
-    int yy_input;
-    int yy_action;
-
-
-    while (true) {
-
-      yychar+= yylength();
-
-      yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos-1] == '\n';
-      if (!yy_atBOL && yy_buffer[yy_markedPos-1] == '\r') {
-        yy_atBOL = yy_advance() != '\n';
-        if (!yy_atEOF) yy_currentPos--;
-      }
-
-      yy_action = -1;
-
-      yy_currentPos = yy_startRead = yy_markedPos;
-
-      if (yy_atBOL)
-        yy_state = YY_LEXSTATE[yy_lexical_state+1];
-      else
-        yy_state = YY_LEXSTATE[yy_lexical_state];
-
-
-      yy_forAction: {
-        while (true) {
-
-          yy_input = yy_advance();
-
-          if ( yy_input == YYEOF ) break yy_forAction;
-
-          yy_input = yycmap[yy_input];
-
-          boolean yy_isFinal = false;
-          boolean yy_noLookAhead = false;
-
-          yy_forNext: { switch (yy_state) {
-            case 0:
-              switch (yy_input) {
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 7; break yy_forNext;
-              }
-
-            case 1:
-              switch (yy_input) {
-                case 1: yy_isFinal = true; yy_state = 8; break yy_forNext;
-                case 2: yy_isFinal = true; yy_state = 9; break yy_forNext;
-                case 3: yy_isFinal = true; yy_state = 10; break yy_forNext;
-                case 6: 
-                case 7: 
-                case 9: yy_isFinal = true; yy_state = 11; break yy_forNext;
-                case 10: yy_isFinal = true; yy_state = 12; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 7; break yy_forNext;
-              }
-
-            case 2:
-              switch (yy_input) {
-                case 11: yy_isFinal = true; yy_state = 13; break yy_forNext;
-                case 15: yy_isFinal = true; yy_state = 14; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 7; break yy_forNext;
-              }
-
-            case 3:
-              switch (yy_input) {
-                case 6: 
-                case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
-                case 7: yy_isFinal = true; yy_state = 17; break yy_forNext;
-                case 23: yy_isFinal = true; yy_noLookAhead = true; yy_state = 18; break yy_forNext;
-                case 24: yy_isFinal = true; yy_noLookAhead = true; yy_state = 19; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 15; break yy_forNext;
-              }
-
-            case 4:
-              switch (yy_input) {
-                case 7: 
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 21; break yy_forNext;
-                case 11: yy_isFinal = true; yy_state = 22; break yy_forNext;
-                case 23: yy_isFinal = true; yy_noLookAhead = true; yy_state = 23; break yy_forNext;
-                case 24: yy_isFinal = true; yy_state = 24; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
-              }
-
-            case 5:
-              switch (yy_input) {
-                case 7: 
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 21; break yy_forNext;
-                case 24: yy_isFinal = true; yy_state = 25; break yy_forNext;
-                case 25: yy_isFinal = true; yy_state = 26; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
-              }
-
-            case 6:
-              switch (yy_input) {
-                case 11: yy_isFinal = true; yy_state = 26; break yy_forNext;
-                case 6: 
-                case 7: 
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 27; break yy_forNext;
-                case 23: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
-                case 24: yy_isFinal = true; yy_state = 29; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 20; break yy_forNext;
-              }
-
-            case 8:
-              switch (yy_input) {
-                case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 30; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 9:
-              switch (yy_input) {
-                case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 31; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 10:
-              switch (yy_input) {
-                case 4: yy_state = 32; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 11:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: yy_state = 33; break yy_forNext;
-                case 10: yy_state = 34; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 12:
-              switch (yy_input) {
-                case 11: yy_state = 35; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 13:
-              switch (yy_input) {
-                case 22: yy_isFinal = true; yy_noLookAhead = true; yy_state = 36; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 14:
-              switch (yy_input) {
-                case 16: yy_state = 37; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 16:
-              switch (yy_input) {
-                case 6: 
-                case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
-                case 7: yy_state = 38; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 15; break yy_forNext;
-              }
-
-            case 17:
-              switch (yy_input) {
-                case 6: 
-                case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
-                case 7: yy_state = 38; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 15; break yy_forNext;
-              }
-
-            case 22:
-              switch (yy_input) {
-                case 22: yy_isFinal = true; yy_noLookAhead = true; yy_state = 39; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 24:
-              switch (yy_input) {
-                case 10: yy_state = 40; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 25:
-              switch (yy_input) {
-                case 10: yy_state = 40; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 26:
-              switch (yy_input) {
-                case 22: yy_isFinal = true; yy_noLookAhead = true; yy_state = 41; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 29:
-              switch (yy_input) {
-                case 10: yy_state = 40; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 32:
-              switch (yy_input) {
-                case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 42; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 33:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: yy_state = 33; break yy_forNext;
-                case 10: yy_state = 34; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 34:
-              switch (yy_input) {
-                case 11: yy_state = 35; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 35:
-              switch (yy_input) {
-                case 12: yy_state = 43; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 37:
-              switch (yy_input) {
-                case 17: yy_state = 44; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 38:
-              switch (yy_input) {
-                case 6: 
-                case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
-                case 7: yy_state = 38; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 15; break yy_forNext;
-              }
-
-            case 40:
-              switch (yy_input) {
-                case 24: yy_isFinal = true; yy_noLookAhead = true; yy_state = 21; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 43:
-              switch (yy_input) {
-                case 13: yy_state = 45; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 44:
-              switch (yy_input) {
-                case 18: yy_state = 46; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 45:
-              switch (yy_input) {
-                case 14: yy_state = 47; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 46:
-              switch (yy_input) {
-                case 19: yy_state = 48; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 47:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: yy_isFinal = true; yy_state = 49; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 48:
-              switch (yy_input) {
-                case 20: yy_state = 50; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 49:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: yy_isFinal = true; yy_state = 49; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 50:
-              switch (yy_input) {
-                case 16: yy_state = 51; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 51:
-              switch (yy_input) {
-                case 21: yy_state = 52; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 52:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: yy_state = 52; break yy_forNext;
-                case 8: yy_isFinal = true; yy_state = 53; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 53:
-              switch (yy_input) {
-                case 6: 
-                case 7: 
-                case 9: yy_isFinal = true; yy_state = 53; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            default:
-              yy_ScanError(YY_ILLEGAL_STATE);
-              break;
-          } }
-
-          if ( yy_isFinal ) {
-            yy_action = yy_state; 
-            yy_markedPos = yy_currentPos; 
-            if ( yy_noLookAhead ) break yy_forAction;
-          }
-
-        }
-      }
-
-
-      switch (yy_action) {    
-
-        case 25: 
-          {  popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
-        case 55: break;
-        case 21: 
-          {  yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 56: break;
-        case 15: 
-        case 16: 
-          {  yypushback(1); yybegin(UnDelimitedString); string.setLength(0); }
-        case 57: break;
-        case 28: 
-        case 29: 
-          {  yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
-        case 58: break;
-        case 39: 
-          {  yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 59: break;
-        case 41: 
-          {  yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 60: break;
-        case 7: 
-        case 8: 
-        case 9: 
-        case 10: 
-        case 11: 
-        case 12: 
-        case 13: 
-        case 14: 
-        case 17: 
-          { if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
-        case 61: break;
-        case 30: 
-          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;} }
-        case 62: break;
-        case 31: 
-          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;} }
-        case 63: break;
-        case 42: 
-          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;} }
-        case 64: break;
-        case 49: 
-          { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;} }
-        case 65: break;
-        case 36: 
-          { yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd; }
-        case 66: break;
-        case 53: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
-        case 67: break;
-        case 23: 
-          {  popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;  }
-        case 68: break;
-        case 20: 
-        case 22: 
-        case 24: 
-        case 26: 
-          {  string.append( yytext() );  }
-        case 69: break;
-        case 19: 
-          {  yybegin(SQ_STRING); string.setLength(0);  }
-        case 70: break;
-        case 18: 
-          {  yybegin(DQ_STRING); string.setLength(0);  }
-        case 71: break;
-        case 27: 
-          {  yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
-        case 72: break;
-        default: 
-          if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
-            yy_atEOF = true;
-            yy_do_eof();
-              { hasMore = false; return EncodingParserConstants.EOF; }
-          } 
-          else {
-            yy_ScanError(YY_NO_MATCH);
-          }
-      }
-    }
-  }    
-
-  /**
-   * Runs the scanner on input files.
-   *
-   * This main method is the debugging routine for the scanner.
-   * It prints each returned token to System.out until the end of
-   * file is reached, or an error occured.
-   *
-   * @param argv   the command line, contains the filenames to run
-   *               the scanner on.
-   */
-  public static void main(String argv[]) {
-    for (int i = 0; i < argv.length; i++) {
-      XMLHeadTokenizer scanner = null;
-      try {
-        scanner = new XMLHeadTokenizer( new java.io.FileReader(argv[i]) );
-      }
-      catch (java.io.FileNotFoundException e) {
-        System.out.println("File not found : \""+argv[i]+"\"");
-        System.exit(1);
-      }
-      catch (java.io.IOException e) {
-        System.out.println("Error opening file \""+argv[i]+"\"");
-        System.exit(1);
-      }
-      catch (ArrayIndexOutOfBoundsException e) {
-        System.out.println("Usage : java XMLHeadTokenizer <inputfile>");
-        System.exit(1);
-      }
-
-      try {
-        do {
-          System.out.println(scanner.primGetNextToken());
-        } while (!scanner.yy_atEOF);
-
-      }
-      catch (java.io.IOException e) {
-        System.out.println("An I/O error occured while scanning :");
-        System.out.println(e);
-        System.exit(1);
-      }
-      catch (Exception e) {
-        e.printStackTrace();
-        System.exit(1);
-      }
-    }
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizerGenJava.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizerGenJava.cmd
deleted file mode 100644
index 7ec1c7b..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizerGenJava.cmd
+++ /dev/null
@@ -1,28 +0,0 @@
-@echo on
-
-rem The following variables need to be set/specified for each "development machine"
-set PATH=%PATH%;D:\JDKs\j2sdk1.4.2_03\bin
-set WORKSPACE_LOCATION=D:\builds\Workspaces\WSWBM8
-set JFLEX_LIB_LOCATION=D:\DevTimeSupport\JFlex\lib
-
-rem The following variables differ from project to project, but should be otherwise constant
-set MAIN_NAME=XMLHeadTokenizer
-
-rem set PROJECT_SRC=\org.eclipse.wst.sse.core.xml\src\
-rem set PACKAGE_DIR=com\ibm\sse\model\xml\encoding\
-
-set PROJECT_SRC=\org.eclipse.wst.common.encoding.contentspecific\src\
-set PACKAGE_DIR=com\ibm\encoding\resource\contentspecific\xml\
-
-
-rem Given the above "framework" and the command themselves, these variables should never need to be modified
-set JAVA_FILE=%MAIN_NAME%.java
-set JFLEX_RULES=%MAIN_NAME%.jflex
-set SKELETON_FILE=%MAIN_NAME%.skeleton
-
-IF EXIST %JAVA_FILE% del %JAVA_FILE%
-rem java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES% -skel %SKELETON_FILE% 1>jflexout.txt 2>jflexerr.txt
-java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES%  1>jflexout.txt 2>jflexerr.txt
-IF EXIST %JAVA_FILE% copy %JAVA_FILE% %WORKSPACE_LOCATION%%PROJECT_SRC%%PACKAGE_DIR%%JAVA_FILE%
-
-pause
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexerr.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexerr.txt
deleted file mode 100644
index e69de29..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexerr.txt
+++ /dev/null
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexout.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexout.txt
deleted file mode 100644
index 316c32e..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexout.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Reading "XMLHeadTokenizer.jflex"
-
-Warning : Macro "SpaceChar" has been declared but never used.
-Constructing NFA : 358 states in NFA
-Converting NFA to DFA : 
-...................................................................
-79 states before minimization, 54 states in minimized DFA
-Writing code to "XMLHeadTokenizer.java"
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/oldXMLHeadTokenizer.skeleton b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/oldXMLHeadTokenizer.skeleton
deleted file mode 100644
index 9809602..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/oldXMLHeadTokenizer.skeleton
+++ /dev/null
@@ -1,263 +0,0 @@
-
-  /** 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",		//$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$
-  };
-
---- 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;
-
-  
-  /** yy_atEOF == true <=> the scanner has returned a value for EOF */
-  private boolean yy_atEOF;
-
-	// state stack for handling embedded regions
-	private IntStack fStateStack = new IntStack();
-
-
---- 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 - 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]);
-	System.out.println("ScanError: " + errorCode + ": " + YY_ERROR_MSG[errorCode]);
-    }
-    catch (ArrayIndexOutOfBoundsException e) {
-      //Logger.log(Logger.ERROR, YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
-	System.out.println("ScanError: " + errorCode + ": " + 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()!
-   */
-  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/SedModel/CSSTokenizer/devel/CSSTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.java
deleted file mode 100644
index b30ce69..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.java
+++ /dev/null
@@ -1,1948 +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
- *     
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 04/10/01 22:53 */
-
-/*nlsXXX*/
-package org.eclipse.wst.sse.core.css.internal.parser;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.css.internal.parser.regions.CSSTextRegionFactory;
-import org.eclipse.wst.sse.core.css.parser.CSSRegionContexts;
-import org.eclipse.wst.sse.core.css.parser.CSSTextToken;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-/**
- * This class is a scanner generated by 
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- */
-public class CSSTokenizer implements CSSRegionContexts {
-
-  /** this character denotes the end of file */
-  final public static int YYEOF = -1;
-
-  /** lexical states */
-  final public static int ST_SELECTOR_ATTRIBUTE_NAME = 11;
-  final public static int ST_IMPORT_DELIMITER = 5;
-  final public static int ST_DECLARATION_PRE_VALUE = 17;
-  final public static int ST_SELECTOR = 0;
-  final public static int ST_CHARSET_DELIMITER = 2;
-  final public static int ST_DECLARATION_VALUE = 18;
-  final public static int ST_PAGE_PSEUDO_PAGE = 8;
-  final public static int ST_IMPORT_URI = 3;
-  final public static int ST_SELECTOR_ATTRIBUTE_END = 14;
-  final public static int ST_SELECTOR_ATTRIBUTE_OPERATOR = 12;
-  final public static int ST_DECLARATION = 15;
-  final public static int ST_PAGE_DELIMITER = 9;
-  final public static int ST_SELECTOR_ATTRIBUTE_VALUE = 13;
-  final public static int ST_MEDIA_MEDIUM = 6;
-  final public static int ST_CHARSET_NAME = 1;
-  final public static int ST_IMPORT_MEDIUM = 4;
-  final public static int ST_DECLARATION_SEPARATOR = 16;
-  final public static int ST_FONT_FACE_DELIMITER = 9;
-  final public static int ST_MEDIA_DELIMITER = 7;
-  final public static int ST_SELECTOR_MODIFIER = 10;
-  final public static int YYINITIAL = 0;
-
-  /** 
-   * Translates characters to character classes
-   */
-  final private static String yycmap_packed = 
-    "\11\0\1\11\1\17\1\0\1\4\1\20\22\0\1\6\1\31\1\10"+
-    "\1\22\1\16\1\72\1\16\1\5\1\26\1\12\1\35\1\14\1\55"+
-    "\1\13\1\15\1\34\12\1\1\62\1\50\1\30\1\67\1\32\1\21"+
-    "\1\36\1\43\1\27\1\40\1\57\1\46\1\64\1\61\1\41\1\51"+
-    "\2\2\1\25\1\52\1\65\1\54\1\53\1\2\1\24\1\44\1\47"+
-    "\1\23\5\2\1\66\1\3\1\71\1\16\1\2\1\16\1\42\1\7"+
-    "\1\37\1\56\1\45\1\63\1\61\1\41\1\51\2\2\1\25\1\52"+
-    "\1\65\1\54\1\53\1\2\1\24\1\44\1\47\1\23\5\2\1\60"+
-    "\1\70\1\33\1\70\1\0\uff80\2";
-
-  /** 
-   * 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,    59,   118,   177,   236,   295,   354,   413,   472,   531, 
-      590,   649,   708,   767,   826,   885,   944,  1003,  1062,  1121, 
-     1180,  1239,  1298,  1357,  1416,  1475,  1534,  1121,  1593,  1121, 
-     1652,  1711,  1121,  1770,  1829,  1888,  1121,  1947,  2006,  2065, 
-     2124,  2183,  2242,  1121,  2301,  2360,  2419,  1121,  1121,  2478, 
-     2537,  2596,  1121,  2655,  2714,  1121,  1121,  2773,  2832,  2891, 
-     1121,  2950,  1121,  3009,  3068,  3127,  3186,  3245,  3304,  3363, 
-     3422,  1121,  1121,  3481,  3540,  3599,  3658,  3717,  1121,  3776, 
-     3835,  3894,  3953,  4012,  4071,  1593,  1121,  4130,  1239,  4189, 
-     4248,  1416,  4307,  1475,  4366,  4425,  4484,  4543,  4602,  4661, 
-     4720,  4779,  4838,  4897,  1770,  4956,  1121,  1829,  5015,  5074, 
-     1947,  5133,  1121,  2006,  5192,  5251,  2183,  5310,  5369,  2360, 
-     5428,  5487,  2537,  5546,  5605,  1121,  2714,  2832,  5664,  5723, 
-     3068,  5782,  3127,  5841,  1121,  3186,  5900,  5959,  3363,  6018, 
-     6077,  6136,  6195,  3894,  1121,  3599,  1121,  6254,  3658,  6313, 
-     1121,  3717,  6372,  6431,  6490,  6549,  3953,  6608,  6667,  6726, 
-     4071,  6785,  1121,  4130,  6844,  1121,  6903,  6962,  7021,  7080, 
-     7139,  7198,  7257,  7316,  7375,  7434,  7493,  7552,  1770,  7611, 
-     7670,  1829,  7729,  7788,  1947,  7847,  7906,  2006,  7965,  8024, 
-     8083,  8142,  8201,  8260,  8319,  8378,  3127,  8437,  8496,  3186, 
-     8555,  8614,  8673,  8732,  8791,  3658,  8850,  8909,  3717,  8968, 
-     9027,  9086,  9145,  9204,  9263,  9322,  9381,  1121,  1121,  9440, 
-     9499,  9558,  9617,  9676,  9735,  9794,  9853,  9912,  9971, 10030, 
-    10089, 10148, 10207, 10266, 10325, 10384, 10443, 10502, 10561, 10620, 
-    10679, 10738, 10797, 10856, 10915, 10974, 11033, 11092, 11151, 11210, 
-    11269, 11328, 11387, 11446, 11505,  1121, 11564, 11623,  1121, 11682, 
-    11741, 11800, 11859, 11918, 11977, 12036, 12095, 12154, 12213,  1121, 
-    12272, 12331, 12390, 12449, 12508, 12567, 12626, 12685, 12744, 12803, 
-    12862, 12921, 12980, 13039, 13098, 13157, 13216, 11092, 13275, 13334, 
-     1121, 13393, 13452, 13511, 13570, 13629, 13688,  1121, 13747, 13806, 
-    13865, 13924, 13983, 14042, 14101, 14160, 14219, 12036, 14278, 14337, 
-    14396, 14455, 14514, 14573, 14632, 14691, 14750, 14809, 14868, 14927, 
-    14986, 15045, 15104, 15163, 15222, 15281, 15340, 13157, 15399, 15458, 
-    15517, 15576, 15635, 15694, 15753,  1121, 15812, 15871, 15930, 15989, 
-    16048, 16107, 16166, 16225, 16284, 16343, 16402, 16461, 16520, 16579, 
-    16638, 16697, 16756, 16815, 16874, 16933, 16992, 17051, 17110, 17169, 
-    17228, 17287, 17346, 17405, 17464, 17523, 17582, 17641, 17700, 17759, 
-    17818, 17877, 17936, 17995, 18054,  1121, 18113, 18172, 18231, 18290, 
-    18349, 18408, 18467, 18526, 18585, 12154, 18644, 12213, 18703, 18762, 
-    18821, 18880, 18939, 18998, 19057, 19116, 19175, 19234, 13275, 19293, 
-    13334, 19352, 19411, 19470, 19529, 19588, 19647, 19706, 19765, 19824, 
-    19883, 19942,  1121, 20001, 20060, 20119, 20178,  1121, 20237, 20296, 
-    20355,  1121, 20414, 20473, 20532, 20591, 20650, 20709, 20768, 20827, 
-    20886, 20945
-  };
-
-  /** 
-   * The packed transition table of the DFA
-   */
-  final private static String yy_packed = 
-    "\2\24\1\25\1\26\1\27\1\24\1\27\1\25\1\24"+
-    "\1\27\1\24\1\30\1\24\1\31\1\24\2\27\1\24"+
-    "\1\32\3\25\1\24\1\25\1\33\2\24\1\34\1\35"+
-    "\1\36\1\37\11\25\1\24\4\25\1\24\2\25\1\24"+
-    "\1\25\1\40\3\25\1\41\10\24\1\27\1\42\1\27"+
-    "\1\24\1\43\1\27\1\24\1\44\3\24\2\27\7\24"+
-    "\1\33\2\24\1\34\1\35\1\24\1\37\40\24\1\27"+
-    "\1\24\1\27\2\24\1\27\1\24\1\44\3\24\2\27"+
-    "\7\24\1\33\2\24\1\34\1\35\1\24\1\37\11\24"+
-    "\1\45\26\24\1\27\1\46\1\27\1\24\1\47\1\27"+
-    "\1\24\1\44\3\24\2\27\2\24\1\50\4\24\1\33"+
-    "\2\24\1\34\1\35\1\24\1\37\11\24\1\45\24\24"+
-    "\1\51\1\52\1\27\1\24\1\27\1\51\1\24\1\27"+
-    "\1\24\1\53\3\24\2\27\2\24\3\51\1\24\1\51"+
-    "\1\33\2\24\1\34\1\35\1\24\1\37\11\51\1\45"+
-    "\4\51\1\24\2\51\1\24\1\51\1\24\3\51\11\24"+
-    "\1\27\1\24\1\27\2\24\1\27\1\24\1\44\3\24"+
-    "\2\27\7\24\1\33\2\24\1\34\1\35\1\24\1\37"+
-    "\11\24\1\45\4\24\1\54\17\24\1\55\1\56\1\27"+
-    "\1\24\1\27\1\55\1\24\1\27\1\24\1\57\3\24"+
-    "\2\27\2\24\3\55\1\24\1\55\1\33\2\24\1\34"+
-    "\1\35\1\24\1\37\11\55\1\24\4\55\1\24\2\55"+
-    "\1\24\1\55\1\24\3\55\11\24\1\27\1\24\1\27"+
-    "\2\24\1\27\1\24\1\44\3\24\2\27\7\24\1\33"+
-    "\2\24\1\34\1\35\1\24\1\37\16\24\1\60\2\24"+
-    "\1\61\14\24\1\62\1\63\1\27\1\24\1\27\1\62"+
-    "\1\24\1\27\1\24\1\64\3\24\2\27\2\24\3\62"+
-    "\1\24\1\62\1\33\2\24\1\34\1\35\1\24\1\37"+
-    "\11\62\1\24\4\62\1\24\2\62\1\65\1\62\1\66"+
-    "\3\62\11\24\1\27\1\24\1\27\2\24\1\27\1\24"+
-    "\1\44\3\24\2\27\7\24\1\33\2\24\1\34\1\35"+
-    "\1\24\1\37\21\24\1\65\16\24\1\67\1\24\1\67"+
-    "\2\24\1\67\1\24\1\44\1\70\1\31\1\24\2\67"+
-    "\1\24\1\32\5\24\1\33\1\24\1\70\1\34\1\35"+
-    "\1\36\1\37\16\24\1\71\2\24\1\65\1\24\1\40"+
-    "\3\24\1\41\6\24\1\72\1\73\1\27\1\24\1\27"+
-    "\1\72\1\24\1\27\1\24\1\74\3\24\2\27\2\24"+
-    "\3\72\1\24\1\72\1\33\2\24\1\34\1\35\1\24"+
-    "\1\37\11\72\1\24\4\72\1\24\2\72\1\24\1\72"+
-    "\1\24\3\72\11\24\1\27\1\24\1\27\2\24\1\27"+
-    "\1\24\1\44\3\24\2\27\7\24\1\33\2\24\1\34"+
-    "\1\35\1\24\1\37\30\24\1\75\1\76\1\77\3\24"+
-    "\1\100\1\101\1\27\1\102\1\27\1\100\1\103\1\27"+
-    "\1\24\1\104\3\24\2\27\2\24\3\100\1\24\1\100"+
-    "\1\33\2\24\1\34\1\35\1\24\1\37\11\100\1\24"+
-    "\4\100\1\24\2\100\1\24\1\100\1\24\3\100\11\24"+
-    "\1\27\1\24\1\27\2\24\1\27\1\24\1\44\3\24"+
-    "\2\27\7\24\1\33\2\24\1\34\1\35\1\24\1\37"+
-    "\32\24\1\77\3\24\1\105\1\106\1\27\1\24\1\27"+
-    "\1\105\1\24\1\27\1\24\1\107\3\24\2\27\2\24"+
-    "\3\105\1\24\1\105\1\33\2\24\1\34\1\35\1\24"+
-    "\1\37\11\105\1\110\4\105\1\24\2\105\1\24\1\105"+
-    "\1\24\3\105\11\24\1\27\1\24\1\27\2\24\1\27"+
-    "\1\24\1\44\3\24\2\27\7\24\1\33\2\24\1\34"+
-    "\1\35\1\24\1\37\11\24\1\110\11\24\1\111\11\24"+
-    "\1\112\1\113\1\114\1\27\1\115\1\27\1\113\1\116"+
-    "\1\27\1\117\1\120\1\121\1\122\1\24\2\27\1\24"+
-    "\1\123\1\124\2\113\1\24\1\113\1\33\1\125\1\24"+
-    "\1\34\1\126\1\24\1\37\11\113\1\110\4\113\1\127"+
-    "\2\113\1\24\1\113\1\24\3\113\6\24\1\112\1\113"+
-    "\1\114\1\130\1\115\1\130\1\113\1\116\1\130\1\117"+
-    "\1\120\1\121\1\122\1\24\2\130\1\24\1\123\1\124"+
-    "\2\113\1\24\1\113\1\33\1\125\1\24\1\34\1\126"+
-    "\1\24\1\37\11\113\1\110\4\113\1\127\2\113\1\24"+
-    "\1\113\1\24\3\113\5\24\74\0\2\25\1\131\3\0"+
-    "\1\25\3\0\1\25\7\0\3\25\1\0\1\25\7\0"+
-    "\11\25\1\0\4\25\1\0\2\25\1\0\1\25\1\0"+
-    "\3\25\6\0\1\132\2\25\1\0\2\25\1\132\1\25"+
-    "\1\0\5\25\2\0\16\25\1\132\2\25\1\132\2\25"+
-    "\1\132\10\25\1\132\4\25\1\132\7\25\4\0\1\27"+
-    "\1\0\1\27\2\0\1\27\5\0\2\27\53\0\2\25"+
-    "\1\131\3\0\1\25\3\0\1\133\7\0\3\25\1\0"+
-    "\1\25\7\0\11\25\1\0\4\25\1\0\2\25\1\0"+
-    "\1\25\1\0\3\25\6\0\2\134\1\135\3\0\1\134"+
-    "\3\0\1\134\7\0\3\134\1\0\1\134\7\0\11\134"+
-    "\1\0\4\134\1\0\2\134\1\0\1\134\1\0\3\134"+
-    "\6\0\2\136\1\137\3\0\1\136\3\0\1\136\7\0"+
-    "\3\136\1\0\1\136\7\0\11\136\1\0\4\136\1\0"+
-    "\2\136\1\0\1\136\1\0\3\136\36\0\1\140\76\0"+
-    "\1\141\74\0\2\142\10\0\1\143\1\144\1\145\7\0"+
-    "\2\146\10\0\1\147\1\150\3\0\1\147\3\0\1\147"+
-    "\7\0\3\147\1\0\1\147\7\0\11\147\1\0\4\147"+
-    "\1\0\2\147\1\0\1\147\1\0\3\147\6\0\2\151"+
-    "\1\152\1\0\1\153\11\151\2\0\52\151\1\0\2\154"+
-    "\1\155\1\0\3\154\1\153\6\154\2\0\52\154\13\0"+
-    "\1\156\60\0\2\157\1\160\1\0\1\161\11\157\2\0"+
-    "\52\157\1\0\2\162\1\163\1\0\3\162\1\161\6\162"+
-    "\2\0\52\162\24\0\1\164\47\0\2\51\1\165\3\0"+
-    "\1\51\3\0\1\51\7\0\3\51\1\0\1\51\7\0"+
-    "\11\51\1\0\4\51\1\0\2\51\1\0\1\51\1\0"+
-    "\3\51\6\0\1\166\2\51\1\0\2\51\1\166\1\51"+
-    "\1\0\5\51\2\0\16\51\1\166\2\51\1\166\2\51"+
-    "\1\166\10\51\1\166\4\51\1\166\7\51\1\0\2\51"+
-    "\1\165\3\0\1\51\3\0\1\167\7\0\3\51\1\0"+
-    "\1\51\7\0\11\51\1\0\4\51\1\0\2\51\1\0"+
-    "\1\51\1\0\3\51\6\0\2\55\1\170\3\0\1\55"+
-    "\3\0\1\55\7\0\3\55\1\0\1\55\7\0\11\55"+
-    "\1\0\4\55\1\0\2\55\1\0\1\55\1\0\3\55"+
-    "\6\0\1\171\2\55\1\0\2\55\1\171\1\55\1\0"+
-    "\5\55\2\0\16\55\1\171\2\55\1\171\2\55\1\171"+
-    "\10\55\1\171\4\55\1\171\7\55\1\0\2\55\1\170"+
-    "\3\0\1\55\3\0\1\172\7\0\3\55\1\0\1\55"+
-    "\7\0\11\55\1\0\4\55\1\0\2\55\1\0\1\55"+
-    "\1\0\3\55\6\0\2\62\1\173\3\0\1\62\3\0"+
-    "\1\62\7\0\3\62\1\0\1\62\7\0\11\62\1\0"+
-    "\4\62\1\0\2\62\1\0\1\62\1\0\3\62\6\0"+
-    "\1\174\2\62\1\0\2\62\1\174\1\62\1\0\5\62"+
-    "\2\0\16\62\1\174\2\62\1\174\2\62\1\174\10\62"+
-    "\1\174\4\62\1\174\7\62\1\0\2\62\1\173\3\0"+
-    "\1\62\3\0\1\175\7\0\3\62\1\0\1\62\7\0"+
-    "\11\62\1\0\4\62\1\0\2\62\1\0\1\62\1\0"+
-    "\3\62\7\0\1\62\1\173\3\0\1\62\3\0\1\62"+
-    "\7\0\3\62\1\0\1\62\7\0\11\62\1\0\4\62"+
-    "\1\0\2\62\1\0\1\62\1\0\3\62\5\0\4\176"+
-    "\1\177\1\176\1\177\2\176\1\177\2\176\1\0\2\176"+
-    "\2\177\11\176\1\0\25\176\1\0\12\176\1\0\2\72"+
-    "\1\200\3\0\1\72\3\0\1\72\7\0\3\72\1\0"+
-    "\1\72\7\0\11\72\1\0\4\72\1\0\2\72\1\0"+
-    "\1\72\1\0\3\72\6\0\1\201\2\72\1\0\2\72"+
-    "\1\201\1\72\1\0\5\72\2\0\16\72\1\201\2\72"+
-    "\1\201\2\72\1\201\10\72\1\201\4\72\1\201\7\72"+
-    "\1\0\2\72\1\200\3\0\1\72\3\0\1\202\7\0"+
-    "\3\72\1\0\1\72\7\0\11\72\1\0\4\72\1\0"+
-    "\2\72\1\0\1\72\1\0\3\72\74\0\1\75\4\0"+
-    "\2\100\1\203\3\0\1\100\3\0\1\100\7\0\3\100"+
-    "\1\0\1\100\7\0\11\100\1\0\4\100\1\0\2\100"+
-    "\1\0\1\100\1\0\3\100\6\0\1\204\2\100\1\0"+
-    "\2\100\1\204\1\100\1\0\5\100\2\0\16\100\1\204"+
-    "\2\100\1\204\2\100\1\204\10\100\1\204\4\100\1\204"+
-    "\7\100\1\0\2\205\1\206\1\0\1\207\11\205\2\0"+
-    "\52\205\1\0\2\210\1\211\1\0\3\210\1\207\6\210"+
-    "\2\0\52\210\1\0\2\100\1\203\3\0\1\100\3\0"+
-    "\1\212\7\0\3\100\1\0\1\100\7\0\11\100\1\0"+
-    "\4\100\1\0\2\100\1\0\1\100\1\0\3\100\6\0"+
-    "\2\105\1\213\3\0\1\105\3\0\1\105\7\0\3\105"+
-    "\1\0\1\105\7\0\11\105\1\0\4\105\1\0\2\105"+
-    "\1\0\1\105\1\0\3\105\6\0\1\214\2\105\1\0"+
-    "\2\105\1\214\1\105\1\0\5\105\2\0\16\105\1\214"+
-    "\2\105\1\214\2\105\1\214\10\105\1\214\4\105\1\214"+
-    "\7\105\1\0\2\105\1\213\3\0\1\105\3\0\1\215"+
-    "\7\0\3\105\1\0\1\105\7\0\11\105\1\0\4\105"+
-    "\1\0\2\105\1\0\1\105\1\0\3\105\6\0\1\112"+
-    "\1\216\1\217\3\0\1\216\3\0\1\216\1\0\1\220"+
-    "\5\0\3\216\1\0\1\216\7\0\11\216\1\0\4\216"+
-    "\1\0\2\216\1\0\1\216\1\0\3\216\4\0\1\221"+
-    "\1\0\2\113\1\222\3\0\1\113\3\0\1\113\7\0"+
-    "\3\113\1\223\1\113\7\0\11\113\1\0\4\113\1\0"+
-    "\2\113\1\0\1\113\1\0\3\113\6\0\1\224\2\113"+
-    "\1\0\2\113\1\224\1\113\1\0\5\113\2\0\16\113"+
-    "\1\224\2\113\1\224\2\113\1\224\10\113\1\224\4\113"+
-    "\1\224\7\113\1\0\2\225\1\226\1\0\1\227\11\225"+
-    "\2\0\52\225\1\0\2\230\1\231\1\0\3\230\1\227"+
-    "\6\230\2\0\52\230\1\0\1\232\1\113\1\222\3\0"+
-    "\1\113\3\0\1\233\1\0\1\220\5\0\3\113\1\223"+
-    "\1\113\7\0\11\113\1\0\4\113\1\0\2\113\1\0"+
-    "\1\113\1\0\3\113\6\0\1\112\13\0\1\220\56\0"+
-    "\1\234\72\0\2\235\1\236\3\0\1\235\3\0\1\235"+
-    "\7\0\3\235\1\0\1\235\7\0\11\235\1\0\4\235"+
-    "\1\0\2\235\1\0\1\235\1\0\3\235\6\0\2\113"+
-    "\1\222\3\0\1\113\3\0\1\113\1\237\6\0\1\113"+
-    "\1\240\1\113\1\223\1\113\7\0\11\113\1\0\4\113"+
-    "\1\0\2\113\1\0\1\113\1\0\3\113\11\0\1\241"+
-    "\1\0\1\241\2\0\1\241\5\0\2\241\30\0\1\242"+
-    "\21\0\4\243\1\244\1\243\1\244\2\243\1\244\5\243"+
-    "\2\244\12\243\1\0\14\243\1\0\22\243\1\0\1\245"+
-    "\1\25\1\131\1\25\1\0\1\25\1\245\1\0\1\25"+
-    "\1\0\1\25\3\0\2\25\2\0\3\25\1\0\1\25"+
-    "\7\0\1\245\2\25\1\245\2\25\1\245\2\25\1\0"+
-    "\4\25\1\0\1\245\1\25\1\0\1\25\1\0\1\245"+
-    "\2\25\6\0\2\25\1\131\3\0\1\25\3\0\1\25"+
-    "\7\0\3\25\1\0\1\25\2\0\1\246\4\0\11\25"+
-    "\1\0\4\25\1\0\2\25\1\0\1\25\1\0\3\25"+
-    "\6\0\1\247\2\134\1\0\2\134\1\247\1\134\1\0"+
-    "\5\134\2\0\16\134\1\247\2\134\1\247\2\134\1\247"+
-    "\10\134\1\247\4\134\1\247\7\134\1\0\1\250\2\136"+
-    "\1\0\2\136\1\250\1\136\1\0\5\136\2\0\16\136"+
-    "\1\250\2\136\1\250\2\136\1\250\10\136\1\250\4\136"+
-    "\1\250\7\136\13\0\1\251\57\0\35\141\1\252\35\141"+
-    "\41\0\1\253\103\0\1\254\65\0\2\255\66\0\2\256"+
-    "\103\0\1\257\17\0\2\147\1\150\3\0\1\147\3\0"+
-    "\1\147\7\0\3\147\1\260\1\147\7\0\11\147\1\0"+
-    "\4\147\1\0\2\147\1\0\1\147\1\0\3\147\6\0"+
-    "\1\261\2\147\1\0\2\147\1\261\1\147\1\0\5\147"+
-    "\2\0\16\147\1\261\2\147\1\261\2\147\1\261\10\147"+
-    "\1\261\4\147\1\261\7\147\1\0\1\262\1\151\1\152"+
-    "\1\151\1\263\1\151\1\262\10\151\1\264\16\151\1\262"+
-    "\2\151\1\262\2\151\1\262\10\151\1\262\4\151\1\262"+
-    "\7\151\1\0\1\265\1\154\1\155\3\154\1\265\1\266"+
-    "\7\154\1\267\16\154\1\265\2\154\1\265\2\154\1\265"+
-    "\10\154\1\265\4\154\1\265\7\154\32\0\1\246\41\0"+
-    "\1\270\1\157\1\160\1\157\1\271\1\157\1\270\10\157"+
-    "\1\272\16\157\1\270\2\157\1\270\2\157\1\270\10\157"+
-    "\1\270\4\157\1\270\7\157\1\0\1\273\1\162\1\163"+
-    "\3\162\1\273\1\274\7\162\1\275\16\162\1\273\2\162"+
-    "\1\273\2\162\1\273\10\162\1\273\4\162\1\273\7\162"+
-    "\25\0\1\276\46\0\1\277\1\51\1\165\1\51\1\0"+
-    "\1\51\1\277\1\0\1\51\1\0\1\51\3\0\2\51"+
-    "\2\0\3\51\1\0\1\51\7\0\1\277\2\51\1\277"+
-    "\2\51\1\277\2\51\1\0\4\51\1\0\1\277\1\51"+
-    "\1\0\1\51\1\0\1\277\2\51\6\0\2\51\1\165"+
-    "\3\0\1\51\3\0\1\51\7\0\3\51\1\0\1\51"+
-    "\2\0\1\246\4\0\11\51\1\0\4\51\1\0\2\51"+
-    "\1\0\1\51\1\0\3\51\6\0\1\300\1\55\1\170"+
-    "\1\55\1\0\1\55\1\300\1\0\1\55\1\0\1\55"+
-    "\3\0\2\55\2\0\3\55\1\0\1\55\7\0\1\300"+
-    "\2\55\1\300\2\55\1\300\2\55\1\0\4\55\1\0"+
-    "\1\300\1\55\1\0\1\55\1\0\1\300\2\55\6\0"+
-    "\2\55\1\170\3\0\1\55\3\0\1\55\7\0\3\55"+
-    "\1\0\1\55\2\0\1\246\4\0\11\55\1\0\4\55"+
-    "\1\0\2\55\1\0\1\55\1\0\3\55\6\0\1\301"+
-    "\1\62\1\173\1\62\1\0\1\62\1\301\1\0\1\62"+
-    "\1\0\1\62\3\0\2\62\2\0\3\62\1\0\1\62"+
-    "\7\0\1\301\2\62\1\301\2\62\1\301\2\62\1\0"+
-    "\4\62\1\0\1\301\1\62\1\0\1\62\1\0\1\301"+
-    "\2\62\6\0\2\62\1\173\3\0\1\62\3\0\1\62"+
-    "\7\0\3\62\1\0\1\62\2\0\1\246\4\0\11\62"+
-    "\1\0\4\62\1\0\2\62\1\0\1\62\1\0\3\62"+
-    "\6\0\1\302\1\72\1\200\1\72\1\0\1\72\1\302"+
-    "\1\0\1\72\1\0\1\72\3\0\2\72\2\0\3\72"+
-    "\1\0\1\72\7\0\1\302\2\72\1\302\2\72\1\302"+
-    "\2\72\1\0\4\72\1\0\1\302\1\72\1\0\1\72"+
-    "\1\0\1\302\2\72\6\0\2\72\1\200\3\0\1\72"+
-    "\3\0\1\72\7\0\3\72\1\0\1\72\2\0\1\246"+
-    "\4\0\11\72\1\0\4\72\1\0\2\72\1\0\1\72"+
-    "\1\0\3\72\6\0\1\303\1\100\1\203\1\100\1\0"+
-    "\1\100\1\303\1\0\1\100\1\0\1\100\3\0\2\100"+
-    "\2\0\3\100\1\0\1\100\7\0\1\303\2\100\1\303"+
-    "\2\100\1\303\2\100\1\0\4\100\1\0\1\303\1\100"+
-    "\1\0\1\100\1\0\1\303\2\100\6\0\1\304\1\205"+
-    "\1\206\1\205\1\305\1\205\1\304\10\205\1\306\16\205"+
-    "\1\304\2\205\1\304\2\205\1\304\10\205\1\304\4\205"+
-    "\1\304\7\205\1\0\1\307\1\210\1\211\3\210\1\307"+
-    "\1\310\7\210\1\311\16\210\1\307\2\210\1\307\2\210"+
-    "\1\307\10\210\1\307\4\210\1\307\7\210\1\0\2\100"+
-    "\1\203\3\0\1\100\3\0\1\100\7\0\3\100\1\0"+
-    "\1\100\2\0\1\246\4\0\11\100\1\0\4\100\1\0"+
-    "\2\100\1\0\1\100\1\0\3\100\6\0\1\312\1\105"+
-    "\1\213\1\105\1\0\1\105\1\312\1\0\1\105\1\0"+
-    "\1\105\3\0\2\105\2\0\3\105\1\0\1\105\7\0"+
-    "\1\312\2\105\1\312\2\105\1\312\2\105\1\0\4\105"+
-    "\1\0\1\312\1\105\1\0\1\105\1\0\1\312\2\105"+
-    "\6\0\2\105\1\213\3\0\1\105\3\0\1\105\7\0"+
-    "\3\105\1\0\1\105\2\0\1\246\4\0\11\105\1\0"+
-    "\4\105\1\0\2\105\1\0\1\105\1\0\3\105\6\0"+
-    "\2\216\1\217\3\0\1\216\3\0\1\216\7\0\3\216"+
-    "\1\0\1\216\7\0\11\216\1\0\4\216\1\0\2\216"+
-    "\1\0\1\216\1\0\3\216\6\0\1\313\2\216\1\0"+
-    "\2\216\1\313\1\216\1\0\5\216\2\0\16\216\1\313"+
-    "\2\216\1\313\2\216\1\313\10\216\1\313\4\216\1\313"+
-    "\7\216\1\0\1\314\1\113\1\222\1\113\1\0\1\113"+
-    "\1\314\1\0\1\113\1\0\1\113\3\0\2\113\2\0"+
-    "\3\113\1\223\1\113\7\0\1\314\2\113\1\314\2\113"+
-    "\1\314\2\113\1\0\4\113\1\0\1\314\1\113\1\0"+
-    "\1\113\1\0\1\314\2\113\6\0\1\315\1\225\1\226"+
-    "\1\225\1\316\1\225\1\315\10\225\1\317\16\225\1\315"+
-    "\2\225\1\315\2\225\1\315\10\225\1\315\4\225\1\315"+
-    "\7\225\1\0\1\320\1\230\1\231\3\230\1\320\1\321"+
-    "\7\230\1\322\16\230\1\320\2\230\1\320\2\230\1\320"+
-    "\10\230\1\320\4\230\1\320\7\230\1\0\1\232\1\113"+
-    "\1\222\3\0\1\113\3\0\1\113\1\0\1\220\5\0"+
-    "\3\113\1\223\1\113\7\0\11\113\1\0\4\113\1\0"+
-    "\2\113\1\0\1\113\1\0\3\113\4\0\1\221\1\0"+
-    "\2\113\1\222\3\0\1\113\3\0\1\113\7\0\3\113"+
-    "\1\223\1\113\2\0\1\246\4\0\11\113\1\0\4\113"+
-    "\1\0\2\113\1\0\1\113\1\0\3\113\6\0\1\234"+
-    "\1\216\1\217\3\0\1\216\3\0\1\216\7\0\3\216"+
-    "\1\0\1\216\7\0\11\216\1\0\4\216\1\0\2\216"+
-    "\1\0\1\216\1\0\3\216\4\0\1\221\1\0\1\323"+
-    "\2\235\1\0\2\235\1\323\1\235\1\0\5\235\2\0"+
-    "\16\235\1\323\2\235\1\323\2\235\1\323\10\235\1\323"+
-    "\4\235\1\323\7\235\1\0\1\324\5\0\1\324\11\0"+
-    "\1\324\5\0\1\324\7\0\2\324\1\0\2\324\1\0"+
-    "\2\324\7\0\2\324\3\0\2\324\7\0\2\113\1\222"+
-    "\3\0\1\113\3\0\1\113\7\0\2\113\1\325\1\223"+
-    "\1\113\7\0\11\113\1\0\4\113\1\0\2\113\1\0"+
-    "\1\113\1\0\3\113\57\0\1\326\21\0\1\327\1\25"+
-    "\1\131\1\25\1\0\1\25\1\327\1\0\1\25\1\0"+
-    "\1\25\3\0\2\25\2\0\3\25\1\0\1\25\7\0"+
-    "\1\327\2\25\1\327\2\25\1\327\2\25\1\0\4\25"+
-    "\1\0\1\327\1\25\1\0\1\25\1\0\1\327\2\25"+
-    "\6\0\1\330\1\134\1\135\1\134\1\0\1\134\1\330"+
-    "\1\0\1\134\1\0\1\134\3\0\2\134\2\0\3\134"+
-    "\1\0\1\134\7\0\1\330\2\134\1\330\2\134\1\330"+
-    "\2\134\1\0\4\134\1\0\1\330\1\134\1\0\1\134"+
-    "\1\0\1\330\2\134\6\0\1\331\1\136\1\137\1\136"+
-    "\1\0\1\136\1\331\1\0\1\136\1\0\1\136\3\0"+
-    "\2\136\2\0\3\136\1\0\1\136\7\0\1\331\2\136"+
-    "\1\331\2\136\1\331\2\136\1\0\4\136\1\0\1\331"+
-    "\1\136\1\0\1\136\1\0\1\331\2\136\20\0\1\332"+
-    "\57\0\34\141\1\333\1\252\35\141\42\0\2\334\102\0"+
-    "\1\335\75\0\2\336\74\0\1\337\76\0\1\340\7\0"+
-    "\1\341\1\342\1\260\1\0\1\260\1\341\1\0\1\260"+
-    "\1\0\1\341\3\0\2\260\2\0\3\341\1\0\1\341"+
-    "\7\0\11\341\1\0\4\341\1\0\2\341\1\0\1\341"+
-    "\1\0\3\341\6\0\1\343\1\147\1\150\1\147\1\0"+
-    "\1\147\1\343\1\0\1\147\1\0\1\147\3\0\2\147"+
-    "\2\0\3\147\1\260\1\147\7\0\1\343\2\147\1\343"+
-    "\2\147\1\343\2\147\1\0\4\147\1\0\1\343\1\147"+
-    "\1\0\1\147\1\0\1\343\2\147\6\0\1\344\1\151"+
-    "\1\152\1\151\1\153\1\151\1\344\27\151\1\344\2\151"+
-    "\1\344\2\151\1\344\10\151\1\344\4\151\1\344\7\151"+
-    "\1\0\2\151\1\152\1\0\1\153\12\151\1\0\52\151"+
-    "\1\0\1\345\1\154\1\155\3\154\1\345\1\153\26\154"+
-    "\1\345\2\154\1\345\2\154\1\345\10\154\1\345\4\154"+
-    "\1\345\7\154\1\0\2\154\1\155\1\0\3\154\1\153"+
-    "\7\154\1\0\52\154\1\0\1\346\1\157\1\160\1\157"+
-    "\1\161\1\157\1\346\27\157\1\346\2\157\1\346\2\157"+
-    "\1\346\10\157\1\346\4\157\1\346\7\157\1\0\2\157"+
-    "\1\160\1\0\1\161\12\157\1\0\52\157\1\0\1\347"+
-    "\1\162\1\163\3\162\1\347\1\161\26\162\1\347\2\162"+
-    "\1\347\2\162\1\347\10\162\1\347\4\162\1\347\7\162"+
-    "\1\0\2\162\1\163\1\0\3\162\1\161\7\162\1\0"+
-    "\52\162\26\0\1\350\45\0\1\351\1\51\1\165\1\51"+
-    "\1\0\1\51\1\351\1\0\1\51\1\0\1\51\3\0"+
-    "\2\51\2\0\3\51\1\0\1\51\7\0\1\351\2\51"+
-    "\1\351\2\51\1\351\2\51\1\0\4\51\1\0\1\351"+
-    "\1\51\1\0\1\51\1\0\1\351\2\51\6\0\1\352"+
-    "\1\55\1\170\1\55\1\0\1\55\1\352\1\0\1\55"+
-    "\1\0\1\55\3\0\2\55\2\0\3\55\1\0\1\55"+
-    "\7\0\1\352\2\55\1\352\2\55\1\352\2\55\1\0"+
-    "\4\55\1\0\1\352\1\55\1\0\1\55\1\0\1\352"+
-    "\2\55\6\0\1\353\1\62\1\173\1\62\1\0\1\62"+
-    "\1\353\1\0\1\62\1\0\1\62\3\0\2\62\2\0"+
-    "\3\62\1\0\1\62\7\0\1\353\2\62\1\353\2\62"+
-    "\1\353\2\62\1\0\4\62\1\0\1\353\1\62\1\0"+
-    "\1\62\1\0\1\353\2\62\6\0\1\354\1\72\1\200"+
-    "\1\72\1\0\1\72\1\354\1\0\1\72\1\0\1\72"+
-    "\3\0\2\72\2\0\3\72\1\0\1\72\7\0\1\354"+
-    "\2\72\1\354\2\72\1\354\2\72\1\0\4\72\1\0"+
-    "\1\354\1\72\1\0\1\72\1\0\1\354\2\72\6\0"+
-    "\1\355\1\100\1\203\1\100\1\0\1\100\1\355\1\0"+
-    "\1\100\1\0\1\100\3\0\2\100\2\0\3\100\1\0"+
-    "\1\100\7\0\1\355\2\100\1\355\2\100\1\355\2\100"+
-    "\1\0\4\100\1\0\1\355\1\100\1\0\1\100\1\0"+
-    "\1\355\2\100\6\0\1\356\1\205\1\206\1\205\1\207"+
-    "\1\205\1\356\27\205\1\356\2\205\1\356\2\205\1\356"+
-    "\10\205\1\356\4\205\1\356\7\205\1\0\2\205\1\206"+
-    "\1\0\1\207\12\205\1\0\52\205\1\0\1\357\1\210"+
-    "\1\211\3\210\1\357\1\207\26\210\1\357\2\210\1\357"+
-    "\2\210\1\357\10\210\1\357\4\210\1\357\7\210\1\0"+
-    "\2\210\1\211\1\0\3\210\1\207\7\210\1\0\52\210"+
-    "\1\0\1\360\1\105\1\213\1\105\1\0\1\105\1\360"+
-    "\1\0\1\105\1\0\1\105\3\0\2\105\2\0\3\105"+
-    "\1\0\1\105\7\0\1\360\2\105\1\360\2\105\1\360"+
-    "\2\105\1\0\4\105\1\0\1\360\1\105\1\0\1\105"+
-    "\1\0\1\360\2\105\6\0\1\361\1\216\1\217\1\216"+
-    "\1\0\1\216\1\361\1\0\1\216\1\0\1\216\3\0"+
-    "\2\216\2\0\3\216\1\0\1\216\7\0\1\361\2\216"+
-    "\1\361\2\216\1\361\2\216\1\0\4\216\1\0\1\361"+
-    "\1\216\1\0\1\216\1\0\1\361\2\216\6\0\1\362"+
-    "\1\113\1\222\1\113\1\0\1\113\1\362\1\0\1\113"+
-    "\1\0\1\113\3\0\2\113\2\0\3\113\1\223\1\113"+
-    "\7\0\1\362\2\113\1\362\2\113\1\362\2\113\1\0"+
-    "\4\113\1\0\1\362\1\113\1\0\1\113\1\0\1\362"+
-    "\2\113\6\0\1\363\1\225\1\226\1\225\1\227\1\225"+
-    "\1\363\27\225\1\363\2\225\1\363\2\225\1\363\10\225"+
-    "\1\363\4\225\1\363\7\225\1\0\2\225\1\226\1\0"+
-    "\1\227\12\225\1\0\52\225\1\0\1\364\1\230\1\231"+
-    "\3\230\1\364\1\227\26\230\1\364\2\230\1\364\2\230"+
-    "\1\364\10\230\1\364\4\230\1\364\7\230\1\0\2\230"+
-    "\1\231\1\0\3\230\1\227\7\230\1\0\52\230\1\0"+
-    "\1\365\1\235\1\236\1\235\1\0\1\235\1\365\1\0"+
-    "\1\235\1\0\1\235\3\0\2\235\2\0\3\235\1\0"+
-    "\1\235\7\0\1\365\2\235\1\365\2\235\1\365\2\235"+
-    "\1\0\4\235\1\0\1\365\1\235\1\0\1\235\1\0"+
-    "\1\365\2\235\6\0\1\366\5\0\1\366\3\0\1\367"+
-    "\5\0\1\366\5\0\1\366\7\0\2\366\1\0\2\366"+
-    "\1\0\2\366\7\0\2\366\3\0\2\366\7\0\2\113"+
-    "\1\222\3\0\1\113\3\0\1\113\7\0\3\113\1\370"+
-    "\1\113\7\0\11\113\1\0\4\113\1\0\2\113\1\0"+
-    "\1\113\1\0\3\113\60\0\1\371\20\0\1\372\1\25"+
-    "\1\131\1\25\1\0\1\25\1\372\1\0\1\25\1\0"+
-    "\1\25\3\0\2\25\2\0\3\25\1\0\1\25\7\0"+
-    "\1\372\2\25\1\372\2\25\1\372\2\25\1\0\4\25"+
-    "\1\0\1\372\1\25\1\0\1\25\1\0\1\372\2\25"+
-    "\6\0\1\373\1\134\1\135\1\134\1\0\1\134\1\373"+
-    "\1\0\1\134\1\0\1\134\3\0\2\134\2\0\3\134"+
-    "\1\0\1\134\7\0\1\373\2\134\1\373\2\134\1\373"+
-    "\2\134\1\0\4\134\1\0\1\373\1\134\1\0\1\134"+
-    "\1\0\1\373\2\134\6\0\1\374\1\136\1\137\1\136"+
-    "\1\0\1\136\1\374\1\0\1\136\1\0\1\136\3\0"+
-    "\2\136\2\0\3\136\1\0\1\136\7\0\1\374\2\136"+
-    "\1\374\2\136\1\374\2\136\1\0\4\136\1\0\1\374"+
-    "\1\136\1\0\1\136\1\0\1\374\2\136\31\0\1\375"+
-    "\122\0\1\376\67\0\1\377\66\0\2\u0100\73\0\1\u0101"+
-    "\24\0\2\341\1\342\1\u0102\1\0\1\u0102\1\341\1\0"+
-    "\1\u0102\1\u0103\1\341\3\0\2\u0102\2\0\3\341\1\0"+
-    "\1\341\7\0\11\341\1\0\4\341\1\0\2\341\1\0"+
-    "\1\341\1\0\3\341\6\0\1\u0104\2\341\1\0\2\341"+
-    "\1\u0104\1\341\1\0\5\341\2\0\16\341\1\u0104\2\341"+
-    "\1\u0104\2\341\1\u0104\10\341\1\u0104\4\341\1\u0104\7\341"+
-    "\1\0\1\u0105\1\147\1\150\1\147\1\0\1\147\1\u0105"+
-    "\1\0\1\147\1\0\1\147\3\0\2\147\2\0\3\147"+
-    "\1\260\1\147\7\0\1\u0105\2\147\1\u0105\2\147\1\u0105"+
-    "\2\147\1\0\4\147\1\0\1\u0105\1\147\1\0\1\147"+
-    "\1\0\1\u0105\2\147\6\0\1\u0106\1\151\1\152\1\151"+
-    "\1\153\1\151\1\u0106\27\151\1\u0106\2\151\1\u0106\2\151"+
-    "\1\u0106\10\151\1\u0106\4\151\1\u0106\7\151\1\0\1\u0107"+
-    "\1\154\1\155\3\154\1\u0107\1\153\26\154\1\u0107\2\154"+
-    "\1\u0107\2\154\1\u0107\10\154\1\u0107\4\154\1\u0107\7\154"+
-    "\1\0\1\u0108\1\157\1\160\1\157\1\161\1\157\1\u0108"+
-    "\27\157\1\u0108\2\157\1\u0108\2\157\1\u0108\10\157\1\u0108"+
-    "\4\157\1\u0108\7\157\1\0\1\u0109\1\162\1\163\3\162"+
-    "\1\u0109\1\161\26\162\1\u0109\2\162\1\u0109\2\162\1\u0109"+
-    "\10\162\1\u0109\4\162\1\u0109\7\162\1\0\2\u010a\1\u010b"+
-    "\1\350\1\u010c\1\350\1\u010a\1\u010d\1\350\1\u010e\4\u010a"+
-    "\2\350\5\u010a\1\0\44\u010a\1\0\1\u010f\1\51\1\165"+
-    "\1\51\1\0\1\51\1\u010f\1\0\1\51\1\0\1\51"+
-    "\3\0\2\51\2\0\3\51\1\0\1\51\7\0\1\u010f"+
-    "\2\51\1\u010f\2\51\1\u010f\2\51\1\0\4\51\1\0"+
-    "\1\u010f\1\51\1\0\1\51\1\0\1\u010f\2\51\6\0"+
-    "\1\u0110\1\55\1\170\1\55\1\0\1\55\1\u0110\1\0"+
-    "\1\55\1\0\1\55\3\0\2\55\2\0\3\55\1\0"+
-    "\1\55\7\0\1\u0110\2\55\1\u0110\2\55\1\u0110\2\55"+
-    "\1\0\4\55\1\0\1\u0110\1\55\1\0\1\55\1\0"+
-    "\1\u0110\2\55\6\0\1\u0111\1\62\1\173\1\62\1\0"+
-    "\1\62\1\u0111\1\0\1\62\1\0\1\62\3\0\2\62"+
-    "\2\0\3\62\1\0\1\62\7\0\1\u0111\2\62\1\u0111"+
-    "\2\62\1\u0111\2\62\1\0\4\62\1\0\1\u0111\1\62"+
-    "\1\0\1\62\1\0\1\u0111\2\62\6\0\1\u0112\1\72"+
-    "\1\200\1\72\1\0\1\72\1\u0112\1\0\1\72\1\0"+
-    "\1\72\3\0\2\72\2\0\3\72\1\0\1\72\7\0"+
-    "\1\u0112\2\72\1\u0112\2\72\1\u0112\2\72\1\0\4\72"+
-    "\1\0\1\u0112\1\72\1\0\1\72\1\0\1\u0112\2\72"+
-    "\6\0\1\u0113\1\100\1\203\1\100\1\0\1\100\1\u0113"+
-    "\1\0\1\100\1\0\1\100\3\0\2\100\2\0\3\100"+
-    "\1\0\1\100\7\0\1\u0113\2\100\1\u0113\2\100\1\u0113"+
-    "\2\100\1\0\4\100\1\0\1\u0113\1\100\1\0\1\100"+
-    "\1\0\1\u0113\2\100\6\0\1\u0114\1\205\1\206\1\205"+
-    "\1\207\1\205\1\u0114\27\205\1\u0114\2\205\1\u0114\2\205"+
-    "\1\u0114\10\205\1\u0114\4\205\1\u0114\7\205\1\0\1\u0115"+
-    "\1\210\1\211\3\210\1\u0115\1\207\26\210\1\u0115\2\210"+
-    "\1\u0115\2\210\1\u0115\10\210\1\u0115\4\210\1\u0115\7\210"+
-    "\1\0\1\u0116\1\105\1\213\1\105\1\0\1\105\1\u0116"+
-    "\1\0\1\105\1\0\1\105\3\0\2\105\2\0\3\105"+
-    "\1\0\1\105\7\0\1\u0116\2\105\1\u0116\2\105\1\u0116"+
-    "\2\105\1\0\4\105\1\0\1\u0116\1\105\1\0\1\105"+
-    "\1\0\1\u0116\2\105\6\0\1\u0117\1\216\1\217\1\216"+
-    "\1\0\1\216\1\u0117\1\0\1\216\1\0\1\216\3\0"+
-    "\2\216\2\0\3\216\1\0\1\216\7\0\1\u0117\2\216"+
-    "\1\u0117\2\216\1\u0117\2\216\1\0\4\216\1\0\1\u0117"+
-    "\1\216\1\0\1\216\1\0\1\u0117\2\216\6\0\1\u0118"+
-    "\1\113\1\222\1\113\1\0\1\113\1\u0118\1\0\1\113"+
-    "\1\0\1\113\3\0\2\113\2\0\3\113\1\223\1\113"+
-    "\7\0\1\u0118\2\113\1\u0118\2\113\1\u0118\2\113\1\0"+
-    "\4\113\1\0\1\u0118\1\113\1\0\1\113\1\0\1\u0118"+
-    "\2\113\6\0\1\u0119\1\225\1\226\1\225\1\227\1\225"+
-    "\1\u0119\27\225\1\u0119\2\225\1\u0119\2\225\1\u0119\10\225"+
-    "\1\u0119\4\225\1\u0119\7\225\1\0\1\u011a\1\230\1\231"+
-    "\3\230\1\u011a\1\227\26\230\1\u011a\2\230\1\u011a\2\230"+
-    "\1\u011a\10\230\1\u011a\4\230\1\u011a\7\230\1\0\1\u011b"+
-    "\1\235\1\236\1\235\1\0\1\235\1\u011b\1\0\1\235"+
-    "\1\0\1\235\3\0\2\235\2\0\3\235\1\0\1\235"+
-    "\7\0\1\u011b\2\235\1\u011b\2\235\1\u011b\2\235\1\0"+
-    "\4\235\1\0\1\u011b\1\235\1\0\1\235\1\0\1\u011b"+
-    "\2\235\6\0\1\u011c\5\0\1\u011c\3\0\1\367\5\0"+
-    "\1\u011c\5\0\1\u011c\7\0\2\u011c\1\0\2\u011c\1\0"+
-    "\2\u011c\7\0\2\u011c\3\0\2\u011c\7\0\1\u011d\5\0"+
-    "\1\u011d\11\0\1\u011d\5\0\1\u011d\7\0\2\u011d\1\0"+
-    "\2\u011d\1\0\2\u011d\7\0\2\u011d\3\0\2\u011d\7\0"+
-    "\2\u011e\1\u011f\1\u0120\1\u0121\1\u0120\1\u011e\1\u0122\1\u0120"+
-    "\1\u0123\4\u011e\2\u0120\5\u011e\1\0\44\u011e\54\0\1\u0124"+
-    "\17\0\1\u0125\1\25\1\131\1\25\1\0\1\25\1\u0125"+
-    "\1\0\1\25\1\0\1\25\3\0\2\25\2\0\3\25"+
-    "\1\0\1\25\7\0\1\u0125\2\25\1\u0125\2\25\1\u0125"+
-    "\2\25\1\0\4\25\1\0\1\u0125\1\25\1\0\1\25"+
-    "\1\0\1\u0125\2\25\6\0\1\u0126\1\134\1\135\1\134"+
-    "\1\0\1\134\1\u0126\1\0\1\134\1\0\1\134\3\0"+
-    "\2\134\2\0\3\134\1\0\1\134\7\0\1\u0126\2\134"+
-    "\1\u0126\2\134\1\u0126\2\134\1\0\4\134\1\0\1\u0126"+
-    "\1\134\1\0\1\134\1\0\1\u0126\2\134\6\0\1\u0127"+
-    "\1\136\1\137\1\136\1\0\1\136\1\u0127\1\0\1\136"+
-    "\1\0\1\136\3\0\2\136\2\0\3\136\1\0\1\136"+
-    "\7\0\1\u0127\2\136\1\u0127\2\136\1\u0127\2\136\1\0"+
-    "\4\136\1\0\1\u0127\1\136\1\0\1\136\1\0\1\u0127"+
-    "\2\136\51\0\1\u0128\52\0\1\u0129\110\0\2\u012a\42\0"+
-    "\1\u012b\63\0\1\u0102\1\0\1\u0102\2\0\1\u0102\1\u0103"+
-    "\4\0\2\u0102\53\0\1\u012c\1\341\1\342\1\341\1\0"+
-    "\1\341\1\u012c\1\0\1\341\1\u0103\1\341\3\0\2\341"+
-    "\2\0\3\341\1\0\1\341\7\0\1\u012c\2\341\1\u012c"+
-    "\2\341\1\u012c\2\341\1\0\4\341\1\0\1\u012c\1\341"+
-    "\1\0\1\341\1\0\1\u012c\2\341\6\0\1\u012d\1\147"+
-    "\1\150\1\147\1\0\1\147\1\u012d\1\0\1\147\1\0"+
-    "\1\147\3\0\2\147\2\0\3\147\1\260\1\147\7\0"+
-    "\1\u012d\2\147\1\u012d\2\147\1\u012d\2\147\1\0\4\147"+
-    "\1\0\1\u012d\1\147\1\0\1\147\1\0\1\u012d\2\147"+
-    "\6\0\1\u012e\1\151\1\152\1\151\1\153\1\151\1\u012e"+
-    "\27\151\1\u012e\2\151\1\u012e\2\151\1\u012e\10\151\1\u012e"+
-    "\4\151\1\u012e\7\151\1\0\1\u012f\1\154\1\155\3\154"+
-    "\1\u012f\1\153\26\154\1\u012f\2\154\1\u012f\2\154\1\u012f"+
-    "\10\154\1\u012f\4\154\1\u012f\7\154\1\0\1\u0130\1\157"+
-    "\1\160\1\157\1\161\1\157\1\u0130\27\157\1\u0130\2\157"+
-    "\1\u0130\2\157\1\u0130\10\157\1\u0130\4\157\1\u0130\7\157"+
-    "\1\0\1\u0131\1\162\1\163\3\162\1\u0131\1\161\26\162"+
-    "\1\u0131\2\162\1\u0131\2\162\1\u0131\10\162\1\u0131\4\162"+
-    "\1\u0131\7\162\1\0\2\u010a\1\u010b\1\u0132\1\0\2\u010a"+
-    "\1\0\1\u0132\1\u010e\4\u010a\2\u0132\5\u010a\1\0\44\u010a"+
-    "\1\0\1\u0133\1\u010a\1\u010b\1\u0132\2\u010a\1\u0133\1\u010a"+
-    "\1\u0132\1\u0134\4\u010a\2\u0132\16\u010a\1\u0133\2\u010a\1\u0133"+
-    "\2\u010a\1\u0133\10\u010a\1\u0133\4\u010a\1\u0133\7\u010a\1\0"+
-    "\2\u010c\1\u0135\1\0\1\u0132\11\u010c\2\0\52\u010c\1\0"+
-    "\2\u010d\1\u0136\1\0\3\u010d\1\u0132\6\u010d\2\0\52\u010d"+
-    "\1\0\1\u0137\1\51\1\165\1\51\1\0\1\51\1\u0137"+
-    "\1\0\1\51\1\0\1\51\3\0\2\51\2\0\3\51"+
-    "\1\0\1\51\7\0\1\u0137\2\51\1\u0137\2\51\1\u0137"+
-    "\2\51\1\0\4\51\1\0\1\u0137\1\51\1\0\1\51"+
-    "\1\0\1\u0137\2\51\6\0\1\u0138\1\55\1\170\1\55"+
-    "\1\0\1\55\1\u0138\1\0\1\55\1\0\1\55\3\0"+
-    "\2\55\2\0\3\55\1\0\1\55\7\0\1\u0138\2\55"+
-    "\1\u0138\2\55\1\u0138\2\55\1\0\4\55\1\0\1\u0138"+
-    "\1\55\1\0\1\55\1\0\1\u0138\2\55\6\0\1\u0139"+
-    "\1\62\1\173\1\62\1\0\1\62\1\u0139\1\0\1\62"+
-    "\1\0\1\62\3\0\2\62\2\0\3\62\1\0\1\62"+
-    "\7\0\1\u0139\2\62\1\u0139\2\62\1\u0139\2\62\1\0"+
-    "\4\62\1\0\1\u0139\1\62\1\0\1\62\1\0\1\u0139"+
-    "\2\62\6\0\1\u013a\1\72\1\200\1\72\1\0\1\72"+
-    "\1\u013a\1\0\1\72\1\0\1\72\3\0\2\72\2\0"+
-    "\3\72\1\0\1\72\7\0\1\u013a\2\72\1\u013a\2\72"+
-    "\1\u013a\2\72\1\0\4\72\1\0\1\u013a\1\72\1\0"+
-    "\1\72\1\0\1\u013a\2\72\6\0\1\u013b\1\100\1\203"+
-    "\1\100\1\0\1\100\1\u013b\1\0\1\100\1\0\1\100"+
-    "\3\0\2\100\2\0\3\100\1\0\1\100\7\0\1\u013b"+
-    "\2\100\1\u013b\2\100\1\u013b\2\100\1\0\4\100\1\0"+
-    "\1\u013b\1\100\1\0\1\100\1\0\1\u013b\2\100\6\0"+
-    "\1\u013c\1\205\1\206\1\205\1\207\1\205\1\u013c\27\205"+
-    "\1\u013c\2\205\1\u013c\2\205\1\u013c\10\205\1\u013c\4\205"+
-    "\1\u013c\7\205\1\0\1\u013d\1\210\1\211\3\210\1\u013d"+
-    "\1\207\26\210\1\u013d\2\210\1\u013d\2\210\1\u013d\10\210"+
-    "\1\u013d\4\210\1\u013d\7\210\1\0\1\u013e\1\105\1\213"+
-    "\1\105\1\0\1\105\1\u013e\1\0\1\105\1\0\1\105"+
-    "\3\0\2\105\2\0\3\105\1\0\1\105\7\0\1\u013e"+
-    "\2\105\1\u013e\2\105\1\u013e\2\105\1\0\4\105\1\0"+
-    "\1\u013e\1\105\1\0\1\105\1\0\1\u013e\2\105\6\0"+
-    "\1\u013f\1\216\1\217\1\216\1\0\1\216\1\u013f\1\0"+
-    "\1\216\1\0\1\216\3\0\2\216\2\0\3\216\1\0"+
-    "\1\216\7\0\1\u013f\2\216\1\u013f\2\216\1\u013f\2\216"+
-    "\1\0\4\216\1\0\1\u013f\1\216\1\0\1\216\1\0"+
-    "\1\u013f\2\216\6\0\1\u0140\1\113\1\222\1\113\1\0"+
-    "\1\113\1\u0140\1\0\1\113\1\0\1\113\3\0\2\113"+
-    "\2\0\3\113\1\223\1\113\7\0\1\u0140\2\113\1\u0140"+
-    "\2\113\1\u0140\2\113\1\0\4\113\1\0\1\u0140\1\113"+
-    "\1\0\1\113\1\0\1\u0140\2\113\6\0\1\u0141\1\225"+
-    "\1\226\1\225\1\227\1\225\1\u0141\27\225\1\u0141\2\225"+
-    "\1\u0141\2\225\1\u0141\10\225\1\u0141\4\225\1\u0141\7\225"+
-    "\1\0\1\u0142\1\230\1\231\3\230\1\u0142\1\227\26\230"+
-    "\1\u0142\2\230\1\u0142\2\230\1\u0142\10\230\1\u0142\4\230"+
-    "\1\u0142\7\230\1\0\1\u0143\1\235\1\236\1\235\1\0"+
-    "\1\235\1\u0143\1\0\1\235\1\0\1\235\3\0\2\235"+
-    "\2\0\3\235\1\0\1\235\7\0\1\u0143\2\235\1\u0143"+
-    "\2\235\1\u0143\2\235\1\0\4\235\1\0\1\u0143\1\235"+
-    "\1\0\1\235\1\0\1\u0143\2\235\6\0\1\u0144\5\0"+
-    "\1\u0144\3\0\1\367\5\0\1\u0144\5\0\1\u0144\7\0"+
-    "\2\u0144\1\0\2\u0144\1\0\2\u0144\7\0\2\u0144\3\0"+
-    "\2\u0144\7\0\1\u0145\5\0\1\u0145\11\0\1\u0145\5\0"+
-    "\1\u0145\7\0\2\u0145\1\0\2\u0145\1\0\2\u0145\7\0"+
-    "\2\u0145\3\0\2\u0145\7\0\2\u011e\1\u011f\1\u0146\1\0"+
-    "\2\u011e\1\0\1\u0146\1\u0123\4\u011e\2\u0146\5\u011e\1\0"+
-    "\44\u011e\1\0\1\u0147\1\u011e\1\u011f\1\u0146\2\u011e\1\u0147"+
-    "\1\u011e\1\u0146\1\u0148\4\u011e\2\u0146\16\u011e\1\u0147\2\u011e"+
-    "\1\u0147\2\u011e\1\u0147\10\u011e\1\u0147\4\u011e\1\u0147\7\u011e"+
-    "\1\0\2\u0121\1\u0149\1\0\1\u0146\11\u0121\2\0\52\u0121"+
-    "\1\0\2\u0122\1\u014a\1\0\3\u0122\1\u0146\6\u0122\2\0"+
-    "\52\u0122\24\0\1\u014b\47\0\1\u014c\1\25\1\131\1\25"+
-    "\1\0\1\25\1\u014c\1\0\1\25\1\0\1\25\3\0"+
-    "\2\25\2\0\3\25\1\0\1\25\7\0\1\u014c\2\25"+
-    "\1\u014c\2\25\1\u014c\2\25\1\0\4\25\1\0\1\u014c"+
-    "\1\25\1\0\1\25\1\0\1\u014c\2\25\6\0\1\u014d"+
-    "\1\134\1\135\1\134\1\0\1\134\1\u014d\1\0\1\134"+
-    "\1\0\1\134\3\0\2\134\2\0\3\134\1\0\1\134"+
-    "\7\0\1\u014d\2\134\1\u014d\2\134\1\u014d\2\134\1\0"+
-    "\4\134\1\0\1\u014d\1\134\1\0\1\134\1\0\1\u014d"+
-    "\2\134\6\0\1\u014e\1\136\1\137\1\136\1\0\1\136"+
-    "\1\u014e\1\0\1\136\1\0\1\136\3\0\2\136\2\0"+
-    "\3\136\1\0\1\136\7\0\1\u014e\2\136\1\u014e\2\136"+
-    "\1\u014e\2\136\1\0\4\136\1\0\1\u014e\1\136\1\0"+
-    "\1\136\1\0\1\u014e\2\136\52\0\2\u014f\73\0\1\u0150"+
-    "\106\0\2\u0151\7\0\1\u0152\1\341\1\342\1\341\1\0"+
-    "\1\341\1\u0152\1\0\1\341\1\u0103\1\341\3\0\2\341"+
-    "\2\0\3\341\1\0\1\341\7\0\1\u0152\2\341\1\u0152"+
-    "\2\341\1\u0152\2\341\1\0\4\341\1\0\1\u0152\1\341"+
-    "\1\0\1\341\1\0\1\u0152\2\341\6\0\1\u0153\1\147"+
-    "\1\150\1\147\1\0\1\147\1\u0153\1\0\1\147\1\0"+
-    "\1\147\3\0\2\147\2\0\3\147\1\260\1\147\7\0"+
-    "\1\u0153\2\147\1\u0153\2\147\1\u0153\2\147\1\0\4\147"+
-    "\1\0\1\u0153\1\147\1\0\1\147\1\0\1\u0153\2\147"+
-    "\6\0\1\u0154\1\151\1\152\1\151\1\153\1\151\1\u0154"+
-    "\27\151\1\u0154\2\151\1\u0154\2\151\1\u0154\10\151\1\u0154"+
-    "\4\151\1\u0154\7\151\1\0\1\u0155\1\154\1\155\3\154"+
-    "\1\u0155\1\153\26\154\1\u0155\2\154\1\u0155\2\154\1\u0155"+
-    "\10\154\1\u0155\4\154\1\u0155\7\154\1\0\1\u0156\1\157"+
-    "\1\160\1\157\1\161\1\157\1\u0156\27\157\1\u0156\2\157"+
-    "\1\u0156\2\157\1\u0156\10\157\1\u0156\4\157\1\u0156\7\157"+
-    "\1\0\1\u0157\1\162\1\163\3\162\1\u0157\1\161\26\162"+
-    "\1\u0157\2\162\1\u0157\2\162\1\u0157\10\162\1\u0157\4\162"+
-    "\1\u0157\7\162\4\0\1\u0132\1\0\1\u0132\2\0\1\u0132"+
-    "\1\u010e\4\0\2\u0132\53\0\1\u0158\1\u010a\1\u010b\1\u010a"+
-    "\1\0\1\u010a\1\u0158\1\0\1\u010a\1\u010e\13\u010a\1\0"+
-    "\10\u010a\1\u0158\2\u010a\1\u0158\2\u010a\1\u0158\10\u010a\1\u0158"+
-    "\4\u010a\1\u0158\7\u010a\1\0\1\u0159\1\u010c\1\u0135\1\u010c"+
-    "\1\u015a\1\u010c\1\u0159\10\u010c\1\u015b\16\u010c\1\u0159\2\u010c"+
-    "\1\u0159\2\u010c\1\u0159\10\u010c\1\u0159\4\u010c\1\u0159\7\u010c"+
-    "\1\0\1\u015c\1\u010d\1\u0136\3\u010d\1\u015c\1\u015d\7\u010d"+
-    "\1\u015e\16\u010d\1\u015c\2\u010d\1\u015c\2\u010d\1\u015c\10\u010d"+
-    "\1\u015c\4\u010d\1\u015c\7\u010d\1\0\1\u015f\1\51\1\165"+
-    "\1\51\1\0\1\51\1\u015f\1\0\1\51\1\0\1\51"+
-    "\3\0\2\51\2\0\3\51\1\0\1\51\7\0\1\u015f"+
-    "\2\51\1\u015f\2\51\1\u015f\2\51\1\0\4\51\1\0"+
-    "\1\u015f\1\51\1\0\1\51\1\0\1\u015f\2\51\6\0"+
-    "\1\u0160\1\55\1\170\1\55\1\0\1\55\1\u0160\1\0"+
-    "\1\55\1\0\1\55\3\0\2\55\2\0\3\55\1\0"+
-    "\1\55\7\0\1\u0160\2\55\1\u0160\2\55\1\u0160\2\55"+
-    "\1\0\4\55\1\0\1\u0160\1\55\1\0\1\55\1\0"+
-    "\1\u0160\2\55\6\0\1\u0161\1\62\1\173\1\62\1\0"+
-    "\1\62\1\u0161\1\0\1\62\1\0\1\62\3\0\2\62"+
-    "\2\0\3\62\1\0\1\62\7\0\1\u0161\2\62\1\u0161"+
-    "\2\62\1\u0161\2\62\1\0\4\62\1\0\1\u0161\1\62"+
-    "\1\0\1\62\1\0\1\u0161\2\62\6\0\1\u0162\1\72"+
-    "\1\200\1\72\1\0\1\72\1\u0162\1\0\1\72\1\0"+
-    "\1\72\3\0\2\72\2\0\3\72\1\0\1\72\7\0"+
-    "\1\u0162\2\72\1\u0162\2\72\1\u0162\2\72\1\0\4\72"+
-    "\1\0\1\u0162\1\72\1\0\1\72\1\0\1\u0162\2\72"+
-    "\6\0\1\u0163\1\100\1\203\1\100\1\0\1\100\1\u0163"+
-    "\1\0\1\100\1\0\1\100\3\0\2\100\2\0\3\100"+
-    "\1\0\1\100\7\0\1\u0163\2\100\1\u0163\2\100\1\u0163"+
-    "\2\100\1\0\4\100\1\0\1\u0163\1\100\1\0\1\100"+
-    "\1\0\1\u0163\2\100\6\0\1\u0164\1\205\1\206\1\205"+
-    "\1\207\1\205\1\u0164\27\205\1\u0164\2\205\1\u0164\2\205"+
-    "\1\u0164\10\205\1\u0164\4\205\1\u0164\7\205\1\0\1\u0165"+
-    "\1\210\1\211\3\210\1\u0165\1\207\26\210\1\u0165\2\210"+
-    "\1\u0165\2\210\1\u0165\10\210\1\u0165\4\210\1\u0165\7\210"+
-    "\1\0\1\u0166\1\105\1\213\1\105\1\0\1\105\1\u0166"+
-    "\1\0\1\105\1\0\1\105\3\0\2\105\2\0\3\105"+
-    "\1\0\1\105\7\0\1\u0166\2\105\1\u0166\2\105\1\u0166"+
-    "\2\105\1\0\4\105\1\0\1\u0166\1\105\1\0\1\105"+
-    "\1\0\1\u0166\2\105\6\0\1\u0167\1\216\1\217\1\216"+
-    "\1\0\1\216\1\u0167\1\0\1\216\1\0\1\216\3\0"+
-    "\2\216\2\0\3\216\1\0\1\216\7\0\1\u0167\2\216"+
-    "\1\u0167\2\216\1\u0167\2\216\1\0\4\216\1\0\1\u0167"+
-    "\1\216\1\0\1\216\1\0\1\u0167\2\216\6\0\1\u0168"+
-    "\1\113\1\222\1\113\1\0\1\113\1\u0168\1\0\1\113"+
-    "\1\0\1\113\3\0\2\113\2\0\3\113\1\223\1\113"+
-    "\7\0\1\u0168\2\113\1\u0168\2\113\1\u0168\2\113\1\0"+
-    "\4\113\1\0\1\u0168\1\113\1\0\1\113\1\0\1\u0168"+
-    "\2\113\6\0\1\u0169\1\225\1\226\1\225\1\227\1\225"+
-    "\1\u0169\27\225\1\u0169\2\225\1\u0169\2\225\1\u0169\10\225"+
-    "\1\u0169\4\225\1\u0169\7\225\1\0\1\u016a\1\230\1\231"+
-    "\3\230\1\u016a\1\227\26\230\1\u016a\2\230\1\u016a\2\230"+
-    "\1\u016a\10\230\1\u016a\4\230\1\u016a\7\230\1\0\1\u016b"+
-    "\1\235\1\236\1\235\1\0\1\235\1\u016b\1\0\1\235"+
-    "\1\0\1\235\3\0\2\235\2\0\3\235\1\0\1\235"+
-    "\7\0\1\u016b\2\235\1\u016b\2\235\1\u016b\2\235\1\0"+
-    "\4\235\1\0\1\u016b\1\235\1\0\1\235\1\0\1\u016b"+
-    "\2\235\6\0\1\u016c\5\0\1\u016c\3\0\1\367\5\0"+
-    "\1\u016c\5\0\1\u016c\7\0\2\u016c\1\0\2\u016c\1\0"+
-    "\2\u016c\7\0\2\u016c\3\0\2\u016c\7\0\1\u016d\5\0"+
-    "\1\u016d\11\0\1\u016d\5\0\1\u016d\7\0\2\u016d\1\0"+
-    "\2\u016d\1\0\2\u016d\7\0\2\u016d\3\0\2\u016d\12\0"+
-    "\1\u0146\1\0\1\u0146\2\0\1\u0146\1\u0123\4\0\2\u0146"+
-    "\53\0\1\u016e\1\u011e\1\u011f\1\u011e\1\0\1\u011e\1\u016e"+
-    "\1\0\1\u011e\1\u0123\13\u011e\1\0\10\u011e\1\u016e\2\u011e"+
-    "\1\u016e\2\u011e\1\u016e\10\u011e\1\u016e\4\u011e\1\u016e\7\u011e"+
-    "\1\0\1\u016f\1\u0121\1\u0149\1\u0121\1\u0170\1\u0121\1\u016f"+
-    "\10\u0121\1\u0171\16\u0121\1\u016f\2\u0121\1\u016f\2\u0121\1\u016f"+
-    "\10\u0121\1\u016f\4\u0121\1\u016f\7\u0121\1\0\1\u0172\1\u0122"+
-    "\1\u014a\3\u0122\1\u0172\1\u0173\7\u0122\1\u0174\16\u0122\1\u0172"+
-    "\2\u0122\1\u0172\2\u0122\1\u0172\10\u0122\1\u0172\4\u0122\1\u0172"+
-    "\7\u0122\47\0\1\u0175\24\0\2\25\1\131\1\25\1\0"+
-    "\2\25\1\0\1\25\1\0\1\25\3\0\2\25\2\0"+
-    "\3\25\1\0\1\25\7\0\11\25\1\0\4\25\1\0"+
-    "\2\25\1\0\1\25\1\0\3\25\6\0\1\u0176\1\134"+
-    "\1\135\1\134\1\0\1\134\1\u0176\1\0\1\134\1\0"+
-    "\1\134\3\0\2\134\2\0\3\134\1\0\1\134\7\0"+
-    "\1\u0176\2\134\1\u0176\2\134\1\u0176\2\134\1\0\4\134"+
-    "\1\0\1\u0176\1\134\1\0\1\134\1\0\1\u0176\2\134"+
-    "\6\0\1\u0177\1\136\1\137\1\136\1\0\1\136\1\u0177"+
-    "\1\0\1\136\1\0\1\136\3\0\2\136\2\0\3\136"+
-    "\1\0\1\136\7\0\1\u0177\2\136\1\u0177\2\136\1\u0177"+
-    "\2\136\1\0\4\136\1\0\1\u0177\1\136\1\0\1\136"+
-    "\1\0\1\u0177\2\136\54\0\1\u0178\65\0\2\u0179\30\0"+
-    "\1\u017a\1\341\1\342\1\341\1\0\1\341\1\u017a\1\0"+
-    "\1\341\1\u0103\1\341\3\0\2\341\2\0\3\341\1\0"+
-    "\1\341\7\0\1\u017a\2\341\1\u017a\2\341\1\u017a\2\341"+
-    "\1\0\4\341\1\0\1\u017a\1\341\1\0\1\341\1\0"+
-    "\1\u017a\2\341\6\0\1\u017b\1\147\1\150\1\147\1\0"+
-    "\1\147\1\u017b\1\0\1\147\1\0\1\147\3\0\2\147"+
-    "\2\0\3\147\1\260\1\147\7\0\1\u017b\2\147\1\u017b"+
-    "\2\147\1\u017b\2\147\1\0\4\147\1\0\1\u017b\1\147"+
-    "\1\0\1\147\1\0\1\u017b\2\147\6\0\1\u017c\1\151"+
-    "\1\152\1\151\1\153\1\151\1\u017c\27\151\1\u017c\2\151"+
-    "\1\u017c\2\151\1\u017c\10\151\1\u017c\4\151\1\u017c\7\151"+
-    "\1\0\1\u017d\1\154\1\155\3\154\1\u017d\1\153\26\154"+
-    "\1\u017d\2\154\1\u017d\2\154\1\u017d\10\154\1\u017d\4\154"+
-    "\1\u017d\7\154\1\0\1\u017e\1\157\1\160\1\157\1\161"+
-    "\1\157\1\u017e\27\157\1\u017e\2\157\1\u017e\2\157\1\u017e"+
-    "\10\157\1\u017e\4\157\1\u017e\7\157\1\0\1\u017f\1\162"+
-    "\1\163\3\162\1\u017f\1\161\26\162\1\u017f\2\162\1\u017f"+
-    "\2\162\1\u017f\10\162\1\u017f\4\162\1\u017f\7\162\1\0"+
-    "\1\u0180\1\u010a\1\u010b\1\u010a\1\0\1\u010a\1\u0180\1\0"+
-    "\1\u010a\1\u010e\13\u010a\1\0\10\u010a\1\u0180\2\u010a\1\u0180"+
-    "\2\u010a\1\u0180\10\u010a\1\u0180\4\u010a\1\u0180\7\u010a\1\0"+
-    "\1\u0181\1\u010c\1\u0135\1\u010c\1\u0132\1\u010c\1\u0181\27\u010c"+
-    "\1\u0181\2\u010c\1\u0181\2\u010c\1\u0181\10\u010c\1\u0181\4\u010c"+
-    "\1\u0181\7\u010c\1\0\2\u010c\1\u0135\2\u0132\1\u015a\2\u010c"+
-    "\1\u015a\1\u0182\4\u010c\2\u0132\52\u010c\1\0\2\u010c\1\u0135"+
-    "\1\0\1\u0132\12\u010c\1\0\52\u010c\1\0\1\u0183\1\u010d"+
-    "\1\u0136\3\u010d\1\u0183\1\u0132\26\u010d\1\u0183\2\u010d\1\u0183"+
-    "\2\u010d\1\u0183\10\u010d\1\u0183\4\u010d\1\u0183\7\u010d\1\0"+
-    "\2\u010d\1\u0136\1\u0132\1\u010d\1\u015d\1\u010d\1\u0132\1\u015d"+
-    "\1\u0184\4\u010d\2\u0132\52\u010d\1\0\2\u010d\1\u0136\1\0"+
-    "\3\u010d\1\u0132\7\u010d\1\0\52\u010d\1\0\2\51\1\165"+
-    "\1\51\1\0\2\51\1\0\1\51\1\0\1\51\3\0"+
-    "\2\51\2\0\3\51\1\0\1\51\7\0\11\51\1\0"+
-    "\4\51\1\0\2\51\1\0\1\51\1\0\3\51\6\0"+
-    "\2\55\1\170\1\55\1\0\2\55\1\0\1\55\1\0"+
-    "\1\55\3\0\2\55\2\0\3\55\1\0\1\55\7\0"+
-    "\11\55\1\0\4\55\1\0\2\55\1\0\1\55\1\0"+
-    "\3\55\6\0\2\62\1\173\1\62\1\0\2\62\1\0"+
-    "\1\62\1\0\1\62\3\0\2\62\2\0\3\62\1\0"+
-    "\1\62\7\0\11\62\1\0\4\62\1\0\2\62\1\0"+
-    "\1\62\1\0\3\62\6\0\2\72\1\200\1\72\1\0"+
-    "\2\72\1\0\1\72\1\0\1\72\3\0\2\72\2\0"+
-    "\3\72\1\0\1\72\7\0\11\72\1\0\4\72\1\0"+
-    "\2\72\1\0\1\72\1\0\3\72\6\0\2\100\1\203"+
-    "\1\100\1\0\2\100\1\0\1\100\1\0\1\100\3\0"+
-    "\2\100\2\0\3\100\1\0\1\100\7\0\11\100\1\0"+
-    "\4\100\1\0\2\100\1\0\1\100\1\0\3\100\6\0"+
-    "\1\u0185\1\205\1\206\1\205\1\207\1\205\1\u0185\27\205"+
-    "\1\u0185\2\205\1\u0185\2\205\1\u0185\10\205\1\u0185\4\205"+
-    "\1\u0185\7\205\1\0\1\u0186\1\210\1\211\3\210\1\u0186"+
-    "\1\207\26\210\1\u0186\2\210\1\u0186\2\210\1\u0186\10\210"+
-    "\1\u0186\4\210\1\u0186\7\210\1\0\2\105\1\213\1\105"+
-    "\1\0\2\105\1\0\1\105\1\0\1\105\3\0\2\105"+
-    "\2\0\3\105\1\0\1\105\7\0\11\105\1\0\4\105"+
-    "\1\0\2\105\1\0\1\105\1\0\3\105\6\0\1\u0187"+
-    "\1\216\1\217\1\216\1\0\1\216\1\u0187\1\0\1\216"+
-    "\1\0\1\216\3\0\2\216\2\0\3\216\1\0\1\216"+
-    "\7\0\1\u0187\2\216\1\u0187\2\216\1\u0187\2\216\1\0"+
-    "\4\216\1\0\1\u0187\1\216\1\0\1\216\1\0\1\u0187"+
-    "\2\216\6\0\2\113\1\222\1\113\1\0\2\113\1\0"+
-    "\1\113\1\0\1\113\3\0\2\113\2\0\3\113\1\223"+
-    "\1\113\7\0\11\113\1\0\4\113\1\0\2\113\1\0"+
-    "\1\113\1\0\3\113\6\0\1\u0188\1\225\1\226\1\225"+
-    "\1\227\1\225\1\u0188\27\225\1\u0188\2\225\1\u0188\2\225"+
-    "\1\u0188\10\225\1\u0188\4\225\1\u0188\7\225\1\0\1\u0189"+
-    "\1\230\1\231\3\230\1\u0189\1\227\26\230\1\u0189\2\230"+
-    "\1\u0189\2\230\1\u0189\10\230\1\u0189\4\230\1\u0189\7\230"+
-    "\1\0\1\u018a\1\235\1\236\1\235\1\0\1\235\1\u018a"+
-    "\1\0\1\235\1\0\1\235\3\0\2\235\2\0\3\235"+
-    "\1\0\1\235\7\0\1\u018a\2\235\1\u018a\2\235\1\u018a"+
-    "\2\235\1\0\4\235\1\0\1\u018a\1\235\1\0\1\235"+
-    "\1\0\1\u018a\2\235\6\0\1\u018b\5\0\1\u018b\3\0"+
-    "\1\367\5\0\1\u018b\5\0\1\u018b\7\0\2\u018b\1\0"+
-    "\2\u018b\1\0\2\u018b\7\0\2\u018b\3\0\2\u018b\7\0"+
-    "\1\u018c\5\0\1\u018c\11\0\1\u018c\5\0\1\u018c\7\0"+
-    "\2\u018c\1\0\2\u018c\1\0\2\u018c\7\0\2\u018c\3\0"+
-    "\2\u018c\7\0\1\u018d\1\u011e\1\u011f\1\u011e\1\0\1\u011e"+
-    "\1\u018d\1\0\1\u011e\1\u0123\13\u011e\1\0\10\u011e\1\u018d"+
-    "\2\u011e\1\u018d\2\u011e\1\u018d\10\u011e\1\u018d\4\u011e\1\u018d"+
-    "\7\u011e\1\0\1\u018e\1\u0121\1\u0149\1\u0121\1\u0146\1\u0121"+
-    "\1\u018e\27\u0121\1\u018e\2\u0121\1\u018e\2\u0121\1\u018e\10\u0121"+
-    "\1\u018e\4\u0121\1\u018e\7\u0121\1\0\2\u0121\1\u0149\2\u0146"+
-    "\1\u0170\2\u0121\1\u0170\1\u018f\4\u0121\2\u0146\52\u0121\1\0"+
-    "\2\u0121\1\u0149\1\0\1\u0146\12\u0121\1\0\52\u0121\1\0"+
-    "\1\u0190\1\u0122\1\u014a\3\u0122\1\u0190\1\u0146\26\u0122\1\u0190"+
-    "\2\u0122\1\u0190\2\u0122\1\u0190\10\u0122\1\u0190\4\u0122\1\u0190"+
-    "\7\u0122\1\0\2\u0122\1\u014a\1\u0146\1\u0122\1\u0173\1\u0122"+
-    "\1\u0146\1\u0173\1\u0191\4\u0122\2\u0146\52\u0122\1\0\2\u0122"+
-    "\1\u014a\1\0\3\u0122\1\u0146\7\u0122\1\0\52\u0122\42\0"+
-    "\2\u0192\30\0\2\134\1\135\1\134\1\0\2\134\1\0"+
-    "\1\134\1\0\1\134\3\0\2\134\2\0\3\134\1\0"+
-    "\1\134\7\0\11\134\1\0\4\134\1\0\2\134\1\0"+
-    "\1\134\1\0\3\134\6\0\2\136\1\137\1\136\1\0"+
-    "\2\136\1\0\1\136\1\0\1\136\3\0\2\136\2\0"+
-    "\3\136\1\0\1\136\7\0\11\136\1\0\4\136\1\0"+
-    "\2\136\1\0\1\136\1\0\3\136\44\0\2\u0193\33\0"+
-    "\1\u0194\1\341\1\342\1\341\1\0\1\341\1\u0194\1\0"+
-    "\1\341\1\u0103\1\341\3\0\2\341\2\0\3\341\1\0"+
-    "\1\341\7\0\1\u0194\2\341\1\u0194\2\341\1\u0194\2\341"+
-    "\1\0\4\341\1\0\1\u0194\1\341\1\0\1\341\1\0"+
-    "\1\u0194\2\341\6\0\2\147\1\150\1\147\1\0\2\147"+
-    "\1\0\1\147\1\0\1\147\3\0\2\147\2\0\3\147"+
-    "\1\260\1\147\7\0\11\147\1\0\4\147\1\0\2\147"+
-    "\1\0\1\147\1\0\3\147\6\0\2\151\1\152\1\151"+
-    "\1\153\65\151\1\0\2\154\1\155\4\154\1\153\62\154"+
-    "\1\0\2\157\1\160\1\157\1\161\65\157\1\0\2\162"+
-    "\1\163\4\162\1\161\62\162\1\0\1\u0195\1\u010a\1\u010b"+
-    "\1\u010a\1\0\1\u010a\1\u0195\1\0\1\u010a\1\u010e\13\u010a"+
-    "\1\0\10\u010a\1\u0195\2\u010a\1\u0195\2\u010a\1\u0195\10\u010a"+
-    "\1\u0195\4\u010a\1\u0195\7\u010a\1\0\1\u0196\1\u010c\1\u0135"+
-    "\1\u010c\1\u0132\1\u010c\1\u0196\27\u010c\1\u0196\2\u010c\1\u0196"+
-    "\2\u010c\1\u0196\10\u010c\1\u0196\4\u010c\1\u0196\7\u010c\1\0"+
-    "\1\u0197\1\u010d\1\u0136\3\u010d\1\u0197\1\u0132\26\u010d\1\u0197"+
-    "\2\u010d\1\u0197\2\u010d\1\u0197\10\u010d\1\u0197\4\u010d\1\u0197"+
-    "\7\u010d\1\0\2\205\1\206\1\205\1\207\65\205\1\0"+
-    "\2\210\1\211\4\210\1\207\62\210\1\0\2\216\1\217"+
-    "\1\216\1\0\2\216\1\0\1\216\1\0\1\216\3\0"+
-    "\2\216\2\0\3\216\1\0\1\216\7\0\11\216\1\0"+
-    "\4\216\1\0\2\216\1\0\1\216\1\0\3\216\6\0"+
-    "\2\225\1\226\1\225\1\227\65\225\1\0\2\230\1\231"+
-    "\4\230\1\227\62\230\1\0\2\235\1\236\1\235\1\0"+
-    "\2\235\1\0\1\235\1\0\1\235\3\0\2\235\2\0"+
-    "\3\235\1\0\1\235\7\0\11\235\1\0\4\235\1\0"+
-    "\2\235\1\0\1\235\1\0\3\235\20\0\1\367\60\0"+
-    "\1\u0198\5\0\1\u0198\11\0\1\u0198\5\0\1\u0198\7\0"+
-    "\2\u0198\1\0\2\u0198\1\0\2\u0198\7\0\2\u0198\3\0"+
-    "\2\u0198\7\0\1\u0199\1\u011e\1\u011f\1\u011e\1\0\1\u011e"+
-    "\1\u0199\1\0\1\u011e\1\u0123\13\u011e\1\0\10\u011e\1\u0199"+
-    "\2\u011e\1\u0199\2\u011e\1\u0199\10\u011e\1\u0199\4\u011e\1\u0199"+
-    "\7\u011e\1\0\1\u019a\1\u0121\1\u0149\1\u0121\1\u0146\1\u0121"+
-    "\1\u019a\27\u0121\1\u019a\2\u0121\1\u019a\2\u0121\1\u019a\10\u0121"+
-    "\1\u019a\4\u0121\1\u019a\7\u0121\1\0\1\u019b\1\u0122\1\u014a"+
-    "\3\u0122\1\u019b\1\u0146\26\u0122\1\u019b\2\u0122\1\u019b\2\u0122"+
-    "\1\u019b\10\u0122\1\u019b\4\u0122\1\u019b\7\u0122\65\0\1\u019c"+
-    "\52\0\2\u019d\25\0\1\u019e\1\341\1\342\1\341\1\0"+
-    "\1\341\1\u019e\1\0\1\341\1\u0103\1\341\3\0\2\341"+
-    "\2\0\3\341\1\0\1\341\7\0\1\u019e\2\341\1\u019e"+
-    "\2\341\1\u019e\2\341\1\0\4\341\1\0\1\u019e\1\341"+
-    "\1\0\1\341\1\0\1\u019e\2\341\6\0\1\u019f\1\u010a"+
-    "\1\u010b\1\u010a\1\0\1\u010a\1\u019f\1\0\1\u010a\1\u010e"+
-    "\13\u010a\1\0\10\u010a\1\u019f\2\u010a\1\u019f\2\u010a\1\u019f"+
-    "\10\u010a\1\u019f\4\u010a\1\u019f\7\u010a\1\0\1\u01a0\1\u010c"+
-    "\1\u0135\1\u010c\1\u0132\1\u010c\1\u01a0\27\u010c\1\u01a0\2\u010c"+
-    "\1\u01a0\2\u010c\1\u01a0\10\u010c\1\u01a0\4\u010c\1\u01a0\7\u010c"+
-    "\1\0\1\u01a1\1\u010d\1\u0136\3\u010d\1\u01a1\1\u0132\26\u010d"+
-    "\1\u01a1\2\u010d\1\u01a1\2\u010d\1\u01a1\10\u010d\1\u01a1\4\u010d"+
-    "\1\u01a1\7\u010d\1\0\1\u01a2\5\0\1\u01a2\11\0\1\u01a2"+
-    "\5\0\1\u01a2\7\0\2\u01a2\1\0\2\u01a2\1\0\2\u01a2"+
-    "\7\0\2\u01a2\3\0\2\u01a2\7\0\1\u01a3\1\u011e\1\u011f"+
-    "\1\u011e\1\0\1\u011e\1\u01a3\1\0\1\u011e\1\u0123\13\u011e"+
-    "\1\0\10\u011e\1\u01a3\2\u011e\1\u01a3\2\u011e\1\u01a3\10\u011e"+
-    "\1\u01a3\4\u011e\1\u01a3\7\u011e\1\0\1\u01a4\1\u0121\1\u0149"+
-    "\1\u0121\1\u0146\1\u0121\1\u01a4\27\u0121\1\u01a4\2\u0121\1\u01a4"+
-    "\2\u0121\1\u01a4\10\u0121\1\u01a4\4\u0121\1\u01a4\7\u0121\1\0"+
-    "\1\u01a5\1\u0122\1\u014a\3\u0122\1\u01a5\1\u0146\26\u0122\1\u01a5"+
-    "\2\u0122\1\u01a5\2\u0122\1\u01a5\10\u0122\1\u01a5\4\u0122\1\u01a5"+
-    "\7\u0122\47\0\1\u01a6\24\0\2\341\1\342\1\341\1\0"+
-    "\2\341\1\0\1\341\1\u0103\1\341\3\0\2\341\2\0"+
-    "\3\341\1\0\1\341\7\0\11\341\1\0\4\341\1\0"+
-    "\2\341\1\0\1\341\1\0\3\341\6\0\1\u01a7\1\u010a"+
-    "\1\u010b\1\u010a\1\0\1\u010a\1\u01a7\1\0\1\u010a\1\u010e"+
-    "\13\u010a\1\0\10\u010a\1\u01a7\2\u010a\1\u01a7\2\u010a\1\u01a7"+
-    "\10\u010a\1\u01a7\4\u010a\1\u01a7\7\u010a\1\0\1\u01a8\1\u010c"+
-    "\1\u0135\1\u010c\1\u0132\1\u010c\1\u01a8\27\u010c\1\u01a8\2\u010c"+
-    "\1\u01a8\2\u010c\1\u01a8\10\u010c\1\u01a8\4\u010c\1\u01a8\7\u010c"+
-    "\1\0\1\u01a9\1\u010d\1\u0136\3\u010d\1\u01a9\1\u0132\26\u010d"+
-    "\1\u01a9\2\u010d\1\u01a9\2\u010d\1\u01a9\10\u010d\1\u01a9\4\u010d"+
-    "\1\u01a9\7\u010d\1\0\1\u01aa\1\u011e\1\u011f\1\u011e\1\0"+
-    "\1\u011e\1\u01aa\1\0\1\u011e\1\u0123\13\u011e\1\0\10\u011e"+
-    "\1\u01aa\2\u011e\1\u01aa\2\u011e\1\u01aa\10\u011e\1\u01aa\4\u011e"+
-    "\1\u01aa\7\u011e\1\0\1\u01ab\1\u0121\1\u0149\1\u0121\1\u0146"+
-    "\1\u0121\1\u01ab\27\u0121\1\u01ab\2\u0121\1\u01ab\2\u0121\1\u01ab"+
-    "\10\u0121\1\u01ab\4\u0121\1\u01ab\7\u0121\1\0\1\u01ac\1\u0122"+
-    "\1\u014a\3\u0122\1\u01ac\1\u0146\26\u0122\1\u01ac\2\u0122\1\u01ac"+
-    "\2\u0122\1\u01ac\10\u0122\1\u01ac\4\u0122\1\u01ac\7\u0122\1\0"+
-    "\2\u010a\1\u010b\1\u010a\1\0\2\u010a\1\0\1\u010a\1\u010e"+
-    "\13\u010a\1\0\44\u010a\1\0\1\u01ad\1\u010c\1\u0135\1\u010c"+
-    "\1\u0132\1\u010c\1\u01ad\27\u010c\1\u01ad\2\u010c\1\u01ad\2\u010c"+
-    "\1\u01ad\10\u010c\1\u01ad\4\u010c\1\u01ad\7\u010c\1\0\1\u01ae"+
-    "\1\u010d\1\u0136\3\u010d\1\u01ae\1\u0132\26\u010d\1\u01ae\2\u010d"+
-    "\1\u01ae\2\u010d\1\u01ae\10\u010d\1\u01ae\4\u010d\1\u01ae\7\u010d"+
-    "\1\0\2\u011e\1\u011f\1\u011e\1\0\2\u011e\1\0\1\u011e"+
-    "\1\u0123\13\u011e\1\0\44\u011e\1\0\1\u01af\1\u0121\1\u0149"+
-    "\1\u0121\1\u0146\1\u0121\1\u01af\27\u0121\1\u01af\2\u0121\1\u01af"+
-    "\2\u0121\1\u01af\10\u0121\1\u01af\4\u0121\1\u01af\7\u0121\1\0"+
-    "\1\u01b0\1\u0122\1\u014a\3\u0122\1\u01b0\1\u0146\26\u0122\1\u01b0"+
-    "\2\u0122\1\u01b0\2\u0122\1\u01b0\10\u0122\1\u01b0\4\u0122\1\u01b0"+
-    "\7\u0122\1\0\2\u010c\1\u0135\1\u010c\1\u0132\65\u010c\1\0"+
-    "\2\u010d\1\u0136\4\u010d\1\u0132\62\u010d\1\0\2\u0121\1\u0149"+
-    "\1\u0121\1\u0146\65\u0121\1\0\2\u0122\1\u014a\4\u0122\1\u0146"+
-    "\62\u0122";
-
-  /** 
-   * 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",
-    "Internal error: unknown state",
-    "Error: could not match input",
-    "Error: pushback value was too large"
-  };
-
-  /**
-   * YY_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
-   */
-  private final static byte YY_ATTRIBUTE[] = {
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
-     0,  0,  0,  9,  1,  1,  1,  1,  1,  1,  1,  9,  1,  9,  1,  1, 
-     9,  1,  1,  1,  9,  1,  1,  1,  1,  1,  1,  9,  1,  1,  1,  9, 
-     9,  1,  1,  1,  9,  1,  3,  9,  9,  1,  1,  1,  9,  1,  9,  1, 
-     1,  1,  1,  1,  1,  1,  1,  9,  9,  1,  1,  1,  1,  1,  9,  1, 
-     1,  1,  1,  1,  1,  1,  9,  3,  0,  1,  1,  1,  0,  1,  0,  0, 
-     0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  9,  0,  0,  0,  0,  0, 
-     9,  0,  0,  0,  0,  1,  1,  0,  1,  1,  0,  1,  1, 13,  7,  0, 
-     1,  1,  0,  1,  0,  0,  9,  0,  0,  1,  0,  1,  1,  1,  0,  0, 
-     9,  0,  9,  1,  0,  0,  9,  0,  0,  1,  1,  1,  1,  0,  0,  1, 
-     0,  0, 13,  7,  1,  9,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0, 
-     1,  0,  1,  0,  0,  1,  0,  0,  1,  0,  0,  1,  0,  0,  1,  1, 
-     1,  1,  1,  0,  1,  0,  0,  1,  0,  1,  1,  1,  0,  1,  0,  0, 
-     1,  0,  1,  1,  1,  0,  1,  1,  1,  9,  9,  0,  0,  0,  0,  0, 
-     0,  0,  1,  0,  0,  0,  0,  0,  1,  1,  1,  1,  1,  0,  0,  1, 
-     1,  1,  0,  0,  1,  1,  0,  1,  0,  1,  1,  1,  0,  0,  0,  9, 
-     0,  0,  9,  0,  1,  0,  0,  0,  0,  0,  0,  0,  0,  9,  1,  1, 
-     1,  1,  1,  0,  0,  1,  1,  1,  0,  0,  1,  1,  1,  0,  0,  0, 
-     0,  0,  9,  0,  1,  1,  1,  0,  0,  9,  0,  0,  1,  0,  0,  0, 
-     0,  0,  0,  1,  0,  0,  1,  1,  1,  1,  1,  0,  0,  1,  1,  1, 
-     0,  0,  1,  1,  1,  0,  0,  1,  0,  0,  0,  1,  1,  1,  0,  9, 
-     0,  0,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1, 
-     1,  1,  1,  0,  0,  1,  1,  1,  0,  0,  1,  1,  1,  0,  0,  0, 
-     0,  0,  0,  0,  0,  1,  1,  9,  0,  0,  1,  0,  0,  0,  0,  0, 
-     0,  1,  0,  1,  0,  0,  1,  0,  0,  1,  1,  1,  0,  0,  1,  0, 
-     1,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  9,  0,  0,  0, 
-     0,  9,  0,  0,  0,  9,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
-  };
-
-  /** 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 code: */
-	private final static String UNDEFINED = "undefined";
-	private String fBufferedContext = null;
-	private int fBufferedStart;
-//	private int fBufferedTextLength;
-	private int fBufferedLength;
-//	private StringBuffer fBufferedText = null;
-	private CSSTextRegionFactory fRegionFactory = CSSTextRegionFactory.getInstance();
-	private int fInitialState = YYINITIAL;
-	public final static int BUFFER_SIZE_NORMAL = 16384;
-	public final static int BUFFER_SIZE_SMALL = 256;
-	private int fInitialBufferSize = BUFFER_SIZE_NORMAL;
-
-	public void setInitialState(int state) {
-		fInitialState = state;
-	}
-	
-	public void setInitialBufferSize(int size) {
-		fInitialBufferSize = size;
-	}
-
-	/* user method */
-  	public final ITextRegion getNextToken() throws IOException {
-		String context;
-		String nextTokenType;
-		boolean spaceFollows;
-//		StringBuffer text;
-		int start;
-		int textLength;
-		int length;
-		if (fBufferedContext != null) {
-			context = fBufferedContext;
-//			text = fBufferedText;
-			start = fBufferedStart;
-			textLength = length = fBufferedLength;
-
-			fBufferedContext = null;
-		} else {
-			context = primGetNextToken();
-//			text = new StringBuffer(yytext());
-			start = yychar;
-			textLength = length = yylength();
-		}
-
-		if (context != null) {
-			if (context == UNDEFINED) {
-				// undef -> concatenate undef's
-				nextTokenType = primGetNextToken();
-				while (nextTokenType == UNDEFINED) {
-//					text.append(yytext());
-					textLength += yylength();
-					length = textLength;
-					nextTokenType = primGetNextToken();
-				}
-				fBufferedContext = nextTokenType;
-//				fBufferedText = new StringBuffer(yytext());
-				fBufferedStart = yychar;
-				fBufferedLength = yylength();
-			} else {
-				nextTokenType = null;
-				spaceFollows = false;
-				if (CSSRegionUtil.isDeclarationValueType(context)) { // declaration value can contain VALUE_S
-					nextTokenType = primGetNextToken();
-					spaceFollows = (nextTokenType == CSS_DECLARATION_VALUE_S);
-				} else if (canContainSpace(context)) {
-					nextTokenType = primGetNextToken();
-					spaceFollows = (nextTokenType == CSS_S);
-				}
-				if (nextTokenType != null) { // nextToken is retrieved
-					if (spaceFollows) {
-						// next is space -> append
-//						text.append(yytext());
-						length += yylength();
-					} else {
-						// next is NOT space -> push this for next time, return itself
-						fBufferedContext = nextTokenType;
-//						fBufferedText = new StringBuffer(yytext());
-						fBufferedStart = yychar;
-						fBufferedLength = yylength();
-					}
-				}
-			}
-		}
-
-		if (context != null) {
-			if (context == UNDEFINED) {
-				context = CSS_UNKNOWN;
-			}
-			return fRegionFactory.createRegion(context, start, textLength, length);
-		} else {
-			return null;
-		}
-  	}
-
-	/* user method */
-	/* for standalone use */
-  	public final List parseText() throws IOException {
-  		List tokens = new ArrayList();
-
-  		CSSTextToken token;
-		for (String kind = primGetNextToken(); kind != null; kind = primGetNextToken()) {
-			token = new CSSTextToken();
-			token.kind = kind;  				
-			token.start = yychar;
-			token.length = yylength();
-			token.image = yytext();
-			tokens.add(token);
-		}
-
-  		return tokens;
-  	}
-  	
-  	/* user method */
-  	private boolean canContainSpace(String type) {
-  		if (type == CSS_DELIMITER || type == CSS_RBRACE || type == CSS_DECLARATION_DELIMITER) {
-  			return false;
-  		} else {
-  			return true;
-  		}
-  	}
-
-	/* user method */
-	public final int getOffset() {
-		return yychar;
-	}
-	
-	/* user method */
-	public final boolean isEOF() {
-		return yy_atEOF;
-	}
-
-	/* user method */
-	public void reset(char[] charArray) {
-		reset(new CharArrayReader(charArray), 0);
-	}
-
-	/* user method */
-	public final void reset(java.io.Reader in, int newOffset) {
-		/** the input device */
-		yy_reader = in;
-
-		/** the current state of the DFA */
-		yy_state = 0;
-
-		/** the current lexical state */
-		yy_lexical_state = fInitialState; //YYINITIAL;
-
-		/** this buffer contains the current text to be matched and is
-			the source of the yytext() string */
-		if (yy_buffer.length != fInitialBufferSize) {
-			yy_buffer = new char[fInitialBufferSize];
-		}
-		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;
-
-		/**
-		 * 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
-		 */
-		yy_atBOL = false;
-		
-		/** yy_atEOF == true <=> the scanner has returned a value for EOF */
-		yy_atEOF = false;
-
-		/* user variables */
-		//		fUndefined.delete(0, fUndefined.length());
-	}
-
-	/* user method */
-	public CSSTokenizer() {
-		super();
-	}
-
-
-
-  /**
-   * 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 CSSTokenizer(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 CSSTokenizer(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[21004];
-    int i = 0;  /* index in packed string  */
-    int j = 0;  /* index in unpacked array */
-    while (i < 13906) {
-      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 < 170) {
-      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.
-   *
-   * @param   errorCode  the code of the errormessage to display
-   */
-  private void yy_ScanError(int errorCode) {
-    try {
-      System.out.println(YY_ERROR_MSG[errorCode]);
-    }
-    catch (ArrayIndexOutOfBoundsException e) {
-      System.out.println(YY_ERROR_MSG[YY_UNKNOWN_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()!
-   */
-  private void yypushback(int number) {
-    if ( number > yylength() )
-      yy_ScanError(YY_PUSHBACK_2BIG);
-
-    yy_markedPos -= 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   IOException  if any I/O-Error occurs
-   */
-  public String primGetNextToken() throws java.io.IOException {
-    int yy_input;
-    int yy_action;
-
-    yy_pushbackPos = -1;
-    boolean yy_was_pushback;
-
-    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_was_pushback = false;
-
-      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 & 2) > 0 )
-            yy_pushbackPos = yy_currentPos;
-
-          if ( (yy_attributes & 1) > 0 ) {
-            yy_was_pushback = (yy_attributes & 4) > 0;
-            yy_action = yy_state; 
-            yy_markedPos = yy_currentPos; 
-            if ( (yy_attributes & 8) > 0 ) break yy_forAction;
-          }
-
-        }
-      }
-
-      if (yy_was_pushback)
-        yy_markedPos = yy_pushbackPos;
-
-      switch (yy_action) {    
-
-        case 421: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IMPORTANT;  }
-        case 433: break;
-        case 412: 
-          {  yybegin(ST_FONT_FACE_DELIMITER); return CSS_FONT_FACE;  }
-        case 434: break;
-        case 375: 
-          {  yybegin(ST_CHARSET_NAME); return CSS_CHARSET;  }
-        case 435: break;
-        case 335: 
-          {  yybegin(ST_IMPORT_URI); return CSS_IMPORT;  }
-        case 436: break;
-        case 297: 
-          {  yybegin(ST_MEDIA_MEDIUM); return CSS_MEDIA;  }
-        case 437: break;
-        case 290: 
-        case 327: 
-        case 398: 
-        case 400: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_URI;  }
-        case 438: break;
-        case 269: 
-        case 307: 
-        case 385: 
-        case 387: 
-          {  yybegin(ST_IMPORT_MEDIUM); return CSS_URI;  }
-        case 439: break;
-        case 255: 
-          {  yybegin(ST_PAGE_PSEUDO_PAGE); return CSS_PAGE;  }
-        case 440: break;
-        case 218: 
-          {  return CSS_COMMENT;  }
-        case 441: break;
-        case 217: 
-          {  return CSS_CDO;  }
-        case 442: break;
-        case 211: 
-        case 245: 
-        case 283: 
-        case 284: 
-        case 323: 
-        case 324: 
-        case 363: 
-        case 364: 
-        case 394: 
-        case 395: 
-        case 407: 
-        case 417: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_UNICODE_RANGE;  }
-        case 443: break;
-        case 165: 
-          {  return CSS_CDC;  }
-        case 444: break;
-        case 162: 
-          {  return CSS_DECLARATION_VALUE_S;  }
-        case 445: break;
-        case 156: 
-        case 210: 
-        case 244: 
-        case 282: 
-        case 322: 
-        case 362: 
-        case 393: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_HASH;  }
-        case 446: break;
-        case 150: 
-        case 205: 
-        case 208: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_STRING;  }
-        case 447: break;
-        case 57: 
-        case 59: 
-        case 128: 
-        case 129: 
-        case 193: 
-        case 235: 
-        case 273: 
-        case 313: 
-        case 353: 
-          {  yybegin(ST_SELECTOR_ATTRIBUTE_OPERATOR); return CSS_SELECTOR_ATTRIBUTE_NAME;  }
-        case 448: break;
-        case 56: 
-          {  yybegin(ST_SELECTOR); return CSS_SELECTOR_SEPARATOR;  }
-        case 449: break;
-        case 55: 
-        case 125: 
-          {  yybegin(ST_SELECTOR); return CSS_SELECTOR_COMBINATOR;  }
-        case 450: break;
-        case 52: 
-          {  yybegin(ST_DECLARATION); return CSS_LBRACE;  }
-        case 451: break;
-        case 49: 
-        case 51: 
-        case 123: 
-        case 124: 
-        case 192: 
-        case 234: 
-        case 272: 
-        case 312: 
-        case 352: 
-          {  yybegin(ST_PAGE_DELIMITER); return CSS_PAGE_SELECTOR;  }
-        case 452: break;
-        case 48: 
-          {  yybegin(YYINITIAL); return CSS_LBRACE;  }
-        case 453: break;
-        case 47: 
-          {  yybegin(ST_MEDIA_MEDIUM); return CSS_MEDIA_SEPARATOR;  }
-        case 454: break;
-        case 44: 
-        case 46: 
-        case 120: 
-        case 121: 
-        case 191: 
-        case 233: 
-        case 271: 
-        case 311: 
-        case 351: 
-          {  yybegin(ST_MEDIA_DELIMITER); return CSS_MEDIUM;  }
-        case 455: break;
-        case 43: 
-          {  yybegin(ST_IMPORT_MEDIUM); return CSS_MEDIA_SEPARATOR;  }
-        case 456: break;
-        case 20: 
-        case 23: 
-        case 89: 
-        case 90: 
-        case 164: 
-        case 214: 
-        case 249: 
-        case 292: 
-        case 331: 
-          {  yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ELEMENT_NAME;  }
-        case 457: break;
-        case 22: 
-        case 54: 
-        case 87: 
-        case 126: 
-        case 163: 
-          {  return CSS_S;  }
-        case 458: break;
-        case 27: 
-          {  yybegin(YYINITIAL); return CSS_RBRACE;  }
-        case 459: break;
-        case 29: 
-          {  yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_UNIVERSAL;  }
-        case 460: break;
-        case 32: 
-          {  yybegin(ST_SELECTOR_ATTRIBUTE_NAME); return CSS_SELECTOR_ATTRIBUTE_START;  }
-        case 461: break;
-        case 36: 
-          {  yybegin(YYINITIAL); return CSS_DELIMITER;  }
-        case 462: break;
-        case 40: 
-        case 42: 
-        case 117: 
-        case 118: 
-        case 190: 
-        case 232: 
-        case 270: 
-        case 310: 
-        case 350: 
-          {  yybegin(ST_IMPORT_DELIMITER); return CSS_MEDIUM;  }
-        case 463: break;
-        case 60: 
-          {  yybegin(ST_SELECTOR_ATTRIBUTE_VALUE); return CSS_SELECTOR_ATTRIBUTE_OPERATOR;  }
-        case 464: break;
-        case 62: 
-          {  yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ATTRIBUTE_END;  }
-        case 465: break;
-        case 63: 
-        case 67: 
-        case 131: 
-        case 134: 
-        case 137: 
-        case 194: 
-        case 196: 
-        case 199: 
-        case 236: 
-        case 274: 
-        case 314: 
-        case 354: 
-          {  yybegin(ST_SELECTOR_ATTRIBUTE_END); return CSS_SELECTOR_ATTRIBUTE_VALUE;  }
-        case 466: break;
-        case 68: 
-        case 70: 
-        case 139: 
-        case 140: 
-        case 201: 
-        case 239: 
-        case 277: 
-        case 317: 
-        case 357: 
-          {  yybegin(ST_DECLARATION_SEPARATOR); return CSS_DECLARATION_PROPERTY;  }
-        case 467: break;
-        case 71: 
-          {  yybegin(ST_DECLARATION); return CSS_DECLARATION_DELIMITER;  }
-        case 468: break;
-        case 72: 
-          {  yybegin(ST_DECLARATION_PRE_VALUE); return CSS_DECLARATION_SEPARATOR;  }
-        case 469: break;
-        case 73: 
-        case 155: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_NUMBER;  }
-        case 470: break;
-        case 74: 
-        case 79: 
-        case 83: 
-        case 147: 
-        case 153: 
-        case 154: 
-        case 159: 
-        case 203: 
-        case 212: 
-        case 241: 
-        case 279: 
-        case 319: 
-        case 359: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IDENT;  }
-        case 471: break;
-        case 78: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE;  }
-        case 472: break;
-        case 85: 
-        case 86: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_OPERATOR;  }
-        case 473: break;
-        case 91: 
-        case 166: 
-        case 215: 
-        case 250: 
-        case 293: 
-        case 332: 
-        case 373: 
-          {  yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_CLASS;  }
-        case 474: break;
-        case 93: 
-        case 167: 
-        case 216: 
-        case 251: 
-        case 294: 
-        case 333: 
-        case 374: 
-          {  yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ID;  }
-        case 475: break;
-        case 102: 
-        case 176: 
-        case 226: 
-        case 258: 
-        case 260: 
-        case 300: 
-        case 338: 
-        case 378: 
-          {  yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_PSEUDO;  }
-        case 476: break;
-        case 106: 
-        case 178: 
-        case 181: 
-          {  yybegin(ST_CHARSET_DELIMITER); return CSS_STRING;  }
-        case 477: break;
-        case 112: 
-        case 184: 
-        case 187: 
-          {  yybegin(ST_IMPORT_MEDIUM); return CSS_STRING;  }
-        case 478: break;
-        case 141: 
-        case 202: 
-        case 240: 
-        case 278: 
-        case 318: 
-        case 358: 
-        case 390: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_DIMENSION;  }
-        case 479: break;
-        case 144: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_PERCENTAGE;  }
-        case 480: break;
-        case 146: 
-        case 247: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_FUNCTION;  }
-        case 481: break;
-        case 19: 
-        case 21: 
-        case 24: 
-        case 25: 
-        case 26: 
-        case 28: 
-        case 30: 
-        case 31: 
-        case 33: 
-        case 34: 
-        case 35: 
-        case 37: 
-        case 38: 
-        case 39: 
-        case 41: 
-        case 45: 
-        case 50: 
-        case 53: 
-        case 58: 
-        case 61: 
-        case 64: 
-        case 65: 
-        case 66: 
-        case 69: 
-        case 75: 
-        case 76: 
-        case 77: 
-        case 80: 
-        case 81: 
-        case 82: 
-        case 84: 
-          { 
-	return UNDEFINED;
- }
-        case 482: break;
-        default: 
-          if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
-            yy_atEOF = true;
-              return null;
-          } 
-          else {
-            yy_ScanError(YY_NO_MATCH);
-          }
-      }
-    }
-  }    
-
-  /**
-   * Runs the scanner on input files.
-   *
-   * This main method is the debugging routine for the scanner.
-   * It prints each returned token to System.out until the end of
-   * file is reached, or an error occured.
-   *
-   * @param argv   the command line, contains the filenames to run
-   *               the scanner on.
-   */
-  public static void main(String argv[]) {
-    for (int i = 0; i < argv.length; i++) {
-      CSSTokenizer scanner = null;
-      try {
-        scanner = new CSSTokenizer( new java.io.FileReader(argv[i]) );
-      }
-      catch (java.io.FileNotFoundException e) {
-        System.out.println("File not found : \""+argv[i]+"\"");
-        System.exit(1);
-      }
-      catch (java.io.IOException e) {
-        System.out.println("Error opening file \""+argv[i]+"\"");
-        System.exit(1);
-      }
-      catch (ArrayIndexOutOfBoundsException e) {
-        System.out.println("Usage : java CSSTokenizer <inputfile>");
-        System.exit(1);
-      }
-
-      try {
-        do {
-          System.out.println(scanner.primGetNextToken());
-        } while (!scanner.yy_atEOF);
-
-      }
-      catch (java.io.IOException e) {
-        System.out.println("An I/O error occured while scanning :");
-        System.out.println(e);
-        System.exit(1);
-      }
-      catch (Exception e) {
-        e.printStackTrace();
-        System.exit(1);
-      }
-    }
-  }
-
-
-}
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
deleted file mode 100644
index f6cac38..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex
+++ /dev/null
@@ -1,495 +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.sse.core.css.internal.parser;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.css.internal.parser.regions.CSSTextRegionFactory;
-import org.eclipse.wst.sse.core.css.parser.CSSRegionContexts;
-import org.eclipse.wst.sse.core.css.parser.CSSTextToken;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-%%
-
-%public
-%class CSSTokenizer
-%implements CSSRegionContexts
-%function primGetNextToken
-%type String
-%char
-%line
-%unicode
-%caseless
-%debug
-%pack
-
-%{
-	private final static String UNDEFINED = "undefined";
-	private String fBufferedContext = null;
-	private int fBufferedStart;
-//	private int fBufferedTextLength;
-	private int fBufferedLength;
-//	private StringBuffer fBufferedText = null;
-	private CSSTextRegionFactory fRegionFactory = CSSTextRegionFactory.getInstance();
-	private int fInitialState = YYINITIAL;
-	public final static int BUFFER_SIZE_NORMAL = 16384;
-	public final static int BUFFER_SIZE_SMALL = 256;
-	private int fInitialBufferSize = BUFFER_SIZE_NORMAL;
-
-	public void setInitialState(int state) {
-		fInitialState = state;
-	}
-	
-	public void setInitialBufferSize(int size) {
-		fInitialBufferSize = size;
-	}
-
-	/* user method */
-  	public final ITextRegion getNextToken() throws IOException {
-		String context;
-		String nextTokenType;
-		boolean spaceFollows;
-//		StringBuffer text;
-		int start;
-		int textLength;
-		int length;
-		if (fBufferedContext != null) {
-			context = fBufferedContext;
-//			text = fBufferedText;
-			start = fBufferedStart;
-			textLength = length = fBufferedLength;
-
-			fBufferedContext = null;
-		} else {
-			context = primGetNextToken();
-//			text = new StringBuffer(yytext());
-			start = yychar;
-			textLength = length = yylength();
-		}
-
-		if (context != null) {
-			if (context == UNDEFINED) {
-				// undef -> concatenate undef's
-				nextTokenType = primGetNextToken();
-				while (nextTokenType == UNDEFINED) {
-//					text.append(yytext());
-					textLength += yylength();
-					length = textLength;
-					nextTokenType = primGetNextToken();
-				}
-				fBufferedContext = nextTokenType;
-//				fBufferedText = new StringBuffer(yytext());
-				fBufferedStart = yychar;
-				fBufferedLength = yylength();
-			} else {
-				nextTokenType = null;
-				spaceFollows = false;
-				if (CSSRegionUtil.isDeclarationValueType(context)) { // declaration value can contain VALUE_S
-					nextTokenType = primGetNextToken();
-					spaceFollows = (nextTokenType == CSS_DECLARATION_VALUE_S);
-				} else if (canContainSpace(context)) {
-					nextTokenType = primGetNextToken();
-					spaceFollows = (nextTokenType == CSS_S);
-				}
-				if (nextTokenType != null) { // nextToken is retrieved
-					if (spaceFollows) {
-						// next is space -> append
-//						text.append(yytext());
-						length += yylength();
-					} else {
-						// next is NOT space -> push this for next time, return itself
-						fBufferedContext = nextTokenType;
-//						fBufferedText = new StringBuffer(yytext());
-						fBufferedStart = yychar;
-						fBufferedLength = yylength();
-					}
-				}
-			}
-		}
-
-		if (context != null) {
-			if (context == UNDEFINED) {
-				context = CSS_UNKNOWN;
-			}
-			return fRegionFactory.createRegion(context, start, textLength, length);
-		} else {
-			return null;
-		}
-  	}
-
-	/* user method */
-	/* for standalone use */
-  	public final List parseText() throws IOException {
-  		List tokens = new ArrayList();
-
-  		CSSTextToken token;
-		for (String kind = primGetNextToken(); kind != null; kind = primGetNextToken()) {
-			token = new CSSTextToken();
-			token.kind = kind;  				
-			token.start = yychar;
-			token.length = yylength();
-			token.image = yytext();
-			tokens.add(token);
-		}
-
-  		return tokens;
-  	}
-  	
-  	/* user method */
-  	private boolean canContainSpace(String type) {
-  		if (type == CSS_DELIMITER || type == CSS_RBRACE || type == CSS_DECLARATION_DELIMITER) {
-  			return false;
-  		} else {
-  			return true;
-  		}
-  	}
-
-	/* user method */
-	public final int getOffset() {
-		return yychar;
-	}
-	
-	/* user method */
-	public final boolean isEOF() {
-		return yy_atEOF;
-	}
-
-	/* user method */
-	public void reset(char[] charArray) {
-		reset(new CharArrayReader(charArray), 0);
-	}
-
-	/* user method */
-	public final void reset(java.io.Reader in, int newOffset) {
-		/** the input device */
-		yy_reader = in;
-
-		/** the current state of the DFA */
-		yy_state = 0;
-
-		/** the current lexical state */
-		yy_lexical_state = fInitialState; //YYINITIAL;
-
-		/** this buffer contains the current text to be matched and is
-			the source of the yytext() string */
-		if (yy_buffer.length != fInitialBufferSize) {
-			yy_buffer = new char[fInitialBufferSize];
-		}
-		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;
-
-		/**
-		 * 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
-		 */
-		yy_atBOL = false;
-		
-		/** yy_atEOF == true <=> the scanner has returned a value for EOF */
-		yy_atEOF = false;
-
-		/* user variables */
-		//		fUndefined.delete(0, fUndefined.length());
-	}
-
-	/* user method */
-	public CSSTokenizer() {
-		super();
-	}
-
-%}
-
-%state ST_CHARSET_NAME
-%state ST_CHARSET_DELIMITER
-%state ST_IMPORT_URI
-%state ST_IMPORT_MEDIUM
-%state ST_IMPORT_DELIMITER
-%state ST_MEDIA_MEDIUM
-%state ST_MEDIA_DELIMITER
-%state ST_PAGE_PSEUDO_PAGE
-%state ST_PAGE_DELIMITER
-%state ST_FONT_FACE_DELIMITER
-%state ST_SELECTOR
-%state ST_SELECTOR_MODIFIER
-%state ST_SELECTOR_ATTRIBUTE_NAME
-%state ST_SELECTOR_ATTRIBUTE_OPERATOR
-%state ST_SELECTOR_ATTRIBUTE_VALUE
-%state ST_SELECTOR_ATTRIBUTE_END
-%state ST_DECLARATION
-%state ST_DECLARATION_SEPARATOR
-%state ST_DECLARATION_PRE_VALUE
-%state ST_DECLARATION_VALUE
-
-h = [0-9a-f]
-nonascii = [\u0080-\uffff]
-unicode = \\{h}{1,6}[ \t\r\n\f]?
-escape = {unicode}|\\[ -~\u0080-\uffff]
-nmstart = [_a-zA-Z-]|{nonascii}|{escape}
-nmchar = [_a-zA-Z0-9-]|{nonascii}|{escape}
-string1 = \"([\t !#$%&(-~]|\\{nl}|\'|{nonascii}|{escape})*\"
-string2 = \'([\t !#$%&(-~]|\\{nl}|\"|{nonascii}|{escape})*\'
-
-ident = {nmstart}{nmchar}*
-name = {nmchar}+
-num = [+-]?([0-9]+|[0-9]*"."[0-9]+)
-string = {string1}|{string2}
-url = ([ !#$%&*-~]|{nonascii}|{escape})*
-s = [ \t\r\n\f]
-w = {s}*
-nl = \n|\r\n|\r|\f
-range = \?{1,6}|{h}(\?{0,5}|{h}(\?{0,4}|{h}(\?{0,3}|{h}(\?{0,2}|{h}(\??|{h})))))
-
-hash = "#"{name}
-uri = ("url("{w}{string}{w}")"|"url("{w}{url}{w}")")
-function = {ident}"("
-unicode_range = "U"\+[0-9a-fA-F?]{1,6}("-"[0-9a-fA-F?]{1,6})?
-
-%%
-
-/*
- * *** global ***
- */
-
-{s}+ { return CSS_S; }
-"<!--" { return CSS_CDO; }
-"-->" { return CSS_CDC; }
-"}" { yybegin(YYINITIAL); return CSS_RBRACE; }
-\/\*[^*]*\*+([^/*][^*]*\*+)*\/ { return CSS_COMMENT; }
-
-//<YYINITIAL> {
-//	"@import" {	yybegin(ST_IMPORT_URI); return CSS_IMPORT; }
-//}
-
-/*
- * *** charset rule ***
- * CHARSET_SYM S* STRING S* ';'
- */
-
-"@charset" { yybegin(ST_CHARSET_NAME); return CSS_CHARSET; }
-
-<ST_CHARSET_NAME> {
-	{string} { yybegin(ST_CHARSET_DELIMITER); return CSS_STRING; }
-}
-
-<ST_CHARSET_DELIMITER> {
-	";" { yybegin(YYINITIAL); return CSS_DELIMITER; }
-}
-
-/*
- * *** import rule ***
- * IMPORT_SYM S* [STRING|URI] S* [ medium [ COMMA S* medium]* ]? ';' S*
- */
-
-"@import" { yybegin(ST_IMPORT_URI); return CSS_IMPORT; }
-
-<ST_IMPORT_URI> {
-	{string} { yybegin(ST_IMPORT_MEDIUM); return CSS_STRING; }
-	//	"url("{w}{string}{w}")" { yybegin(ST_IMPORT_MEDIUM); return CSS_URI; }
-	//	"url("{w}{url}{w}")" { yybegin(ST_IMPORT_MEDIUM); return CSS_URI; }
-	{uri} { yybegin(ST_IMPORT_MEDIUM); return CSS_URI; }
-	";" { yybegin(YYINITIAL); return CSS_DELIMITER; }
-}
-
-<ST_IMPORT_MEDIUM> {
-	{ident} { yybegin(ST_IMPORT_DELIMITER); return CSS_MEDIUM; }
-	";" { yybegin(YYINITIAL); return CSS_DELIMITER; }
-}
-
-<ST_IMPORT_DELIMITER> {
-	";" { yybegin(YYINITIAL); return CSS_DELIMITER; }
-	"," { yybegin(ST_IMPORT_MEDIUM); return CSS_MEDIA_SEPARATOR; }
-}
-
-/*
- * *** media rule ***
- * MEDIA_SYM S* medium [ COMMA S* medium ]* LBRACE S* ruleset* '}' S*
- */
-
-"@media" { yybegin(ST_MEDIA_MEDIUM); return CSS_MEDIA; }
-
-/* 
- * medium
- * IDENT S*
- */
-<ST_MEDIA_MEDIUM> {
-	{ident} { yybegin(ST_MEDIA_DELIMITER); return CSS_MEDIUM; }
-}
-
-<ST_MEDIA_DELIMITER> {
-	"{" { yybegin(YYINITIAL); return CSS_LBRACE; }
-	"," { yybegin(ST_MEDIA_MEDIUM); return CSS_MEDIA_SEPARATOR; }
-}
-
-/*
- * *** page rule **
- * PAGE_SYM S* pseudo_page? S* LBRACE S* declaration [ ';' S* declaration ]* '}' S*
- */
-
-"@page" { yybegin(ST_PAGE_PSEUDO_PAGE); return CSS_PAGE; }
- 
-/*
- * pseudo_page
- * ':' IDENT
- */
-
-<ST_PAGE_PSEUDO_PAGE> {
-	":"?{ident} { yybegin(ST_PAGE_DELIMITER); return CSS_PAGE_SELECTOR; }
-	"{" { yybegin(ST_DECLARATION); return CSS_LBRACE; }
-}
-
-<ST_PAGE_DELIMITER> {
-	"{" { yybegin(ST_DECLARATION); return CSS_LBRACE; }
-}
-
-/*
- * font-face
- * FONT_FACE_SYM S* '{' S* declaration [ ';' S* declaration '* '}' S*
- */
-
-"@font-face" { yybegin(ST_FONT_FACE_DELIMITER); return CSS_FONT_FACE; }
-
-<ST_FONT_FACE_DELIMITER> {
-	"{" { yybegin(ST_DECLARATION); return CSS_LBRACE; }
-}
-
-/*
- * selector
- * simple_selector [ combinator simple_selector ]*
- */
-
-/*
- * simple_selector
- * element_name [ HASH | class | attrib | pseudo ]* | [ HASH | class | attrib | pseudo ]+
- */
-
-<YYINITIAL, ST_SELECTOR_MODIFIER, ST_SELECTOR> {
-	"*" { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_UNIVERSAL; }
-	{hash} { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ID; }
-//	":"{ident} { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_PSEUDO; }
-	":"{ident}("("{s}*{ident}{s}*")")? { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_PSEUDO; }
-	"."{name} { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_CLASS; }
-	"[" { yybegin(ST_SELECTOR_ATTRIBUTE_NAME); return CSS_SELECTOR_ATTRIBUTE_START; }
-}
-
-<YYINITIAL, ST_SELECTOR> {
-	{ident} { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ELEMENT_NAME; }
-}
-
-<ST_SELECTOR_MODIFIER> {
-	"," { yybegin(ST_SELECTOR); return CSS_SELECTOR_SEPARATOR; }
-	// using LOOKAHEAD
-	{s}+/[^+>\{] { yybegin(ST_SELECTOR); return CSS_SELECTOR_COMBINATOR; }
-	"+"|">" { yybegin(ST_SELECTOR); return CSS_SELECTOR_COMBINATOR; }
-	"{" { yybegin(ST_DECLARATION); return CSS_LBRACE; }
-}
-
-/*
- * attrib
- * '[' S* IDENT S* [ [ '=' | INCLUDES | DASHMATCH ] S* [ IDENT | STRING ] S* ]? ']'
- */
-
-<ST_SELECTOR_ATTRIBUTE_NAME> {
-	{ident} { yybegin(ST_SELECTOR_ATTRIBUTE_OPERATOR); return CSS_SELECTOR_ATTRIBUTE_NAME; }
-}
-
-<ST_SELECTOR_ATTRIBUTE_OPERATOR> {
-	"="|"~="|"|=" { yybegin(ST_SELECTOR_ATTRIBUTE_VALUE); return CSS_SELECTOR_ATTRIBUTE_OPERATOR; }
-	"]" { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ATTRIBUTE_END; }
-}
-
-<ST_SELECTOR_ATTRIBUTE_VALUE> {
-	{ident}|{string} { yybegin(ST_SELECTOR_ATTRIBUTE_END); return CSS_SELECTOR_ATTRIBUTE_VALUE; }
-}
-
-<ST_SELECTOR_ATTRIBUTE_END> {
-	"]" { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ATTRIBUTE_END; }
-}
-
-/*
- * declaration
- * property ':' S* expr prio? | // empty //
- */
-
-<ST_DECLARATION> {
-	{ident} { yybegin(ST_DECLARATION_SEPARATOR); return CSS_DECLARATION_PROPERTY; }
-}
-
-<ST_DECLARATION_SEPARATOR> {
-	":" { yybegin(ST_DECLARATION_PRE_VALUE); return CSS_DECLARATION_SEPARATOR; }
-}
-
-<ST_DECLARATION_PRE_VALUE, ST_DECLARATION_VALUE> {
-	"!"{s}*"important" { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IMPORTANT; }
-	{ident} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IDENT; }
-	")" { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE; }
-	{num}{ident} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_DIMENSION; }
-	{num}"%" { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_PERCENTAGE; }
-	{num} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_NUMBER; }
-	{function} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_FUNCTION; }
-	{string} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_STRING; }
-	{uri} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_URI; }
-	"#"{name} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_HASH; }
-	{unicode_range} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_UNICODE_RANGE; }
-	[,/] { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_OPERATOR; }
-}
-
-<ST_DECLARATION_VALUE> {
-	{s}+/[^;}] { return CSS_DECLARATION_VALUE_S; }
-}
-
-<ST_DECLARATION, ST_DECLARATION_SEPARATOR, ST_DECLARATION_PRE_VALUE, ST_DECLARATION_VALUE> {
-	";" { yybegin(ST_DECLARATION); return CSS_DECLARATION_DELIMITER; }
-	//	"}" { yybegin(YYINITIAL); return CSS_RBRACE; }
-}
-
-
-//<YYINITIAL, ST_IMPORT_URI, ST_IMPORT_MEDIUM, ST_IMPORT_DELIMITER> {
-//	\/\*[^*]*\*+([^/*][^*]*\*+)*\/ { return CSS_COMMENT; }
-//	{s}+ { return CSS_S; }
-//	. { return UNDEFINED; }
-//}
-
-//<YYINITIAL, ST_IMPORT_URI, ST_IMPORT_MEDIUM, ST_IMPORT_DELIMITER> {
-//	[^ \t\r\n\f]+ { return CSS_UNKNOWN; }
-//}
-
-. {
-	return UNDEFINED;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.cmd
deleted file mode 100644
index 30fce78..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.cmd
+++ /dev/null
@@ -1,7 +0,0 @@
-@echo off
-set PATH=%PATH%;c:\jdk1.4\bin
-java -Xmx470000000 -cp JFlex\lib\sed-jflex.jar;. JFlex.Main JSPTokenizer -skel skeleton.sed
-java -Xmx470000000 -cp JFlex\lib\sed-jflex.jar;. JFlex.Main XMLTokenizer -skel skeleton.sed
-rm -f JSPTokenizer.java~ JSPTokenizer~ XMLTokenizer.java~ XMLTokenizer~
-copy XMLTokenizer.java ..\..\..\..\sedmodel\com\ibm\sed\parser\internal
-copy JSPTokenizer.java ..\..\..\..\sedmodel\com\ibm\sed\parser\internal
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.sh b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.sh
deleted file mode 100644
index f7872f3..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-JAVADIR=C:/App/IBM/Java141/bin
-JAVAOPT=-Xmx470000000
-CLASSPATH=../../HTMLTokenizer/devel/JFlex/lib/sed-jflex.jar\;.
-DESTDIR=../../../../../org.eclipse.wst.sse.core.css/src/com/ibm/sse/model/css/internal/parser
-
-#export PATH=$PATH:/opt/IBMJava2-131/bin/:/opt/IBMJava2-13/bin/:/opt/jdk1.4
-#java -Xmx470000000 -cp JFlex/lib/sed-jflex.jar;. JFlex.Main CSSTokenizer -skel skeleton.sse
-
-$JAVADIR/java $JAVAOPT -cp $CLASSPATH JFlex.Main CSSTokenizer.jflex
-
-rm -f CSSTokenizer.java~ CSSTokenizer.jflex~
-cp -v CSSTokenizer.java $DESTDIR
-#$JAVADIR/javac $DESTDIR/*.java
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/README b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/README
deleted file mode 100644
index 8bbbc73..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/README
+++ /dev/null
@@ -1,11 +0,0 @@
-devel     - the active development environment (sans JDK)
-            - latest version of HTMLTokenizer specification and generated code
-            - slightly updated JAR file to avoid any possible as-shipped
-              compilation errors
-            - modified skeleton to prevent VM exits on unmatched input
-            - "flex" scripts to run JFlex with modified skeleton and updated JAR
-            - active RCS archive
-resources - backup/pristine resources
-            - Unmodified JFlex 1.2.2 download
-            - Separate modifications to the JFlex skeleton
-            - W3C XML recommendation used for several of the HTMLTokenizer rules
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.java
deleted file mode 100644
index b926627..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.java
+++ /dev/null
@@ -1,3598 +0,0 @@
-/* The following code was generated by JFlex 1.2.2 on 8/16/05 3:02 PM */
-
-/*******************************************************************************
- * 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.jst.jsp.core.internal.parser.internal;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-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.ltk.parser.TagMarker;
-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.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.xml.core.internal.parser.ContextRegionContainer;
-import org.eclipse.wst.xml.core.internal.parser.IntStack;
-
-
-/**
- * This class is a scanner generated by 
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 8/16/05 3:02 PM from the specification file
- * <tt>file:/D:/eclipse.wtp/workspace/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex</tt>
- */
-public class JSPTokenizer implements BlockTokenizer, DOMJSPRegionContexts {
-
-  /** this character denotes the end of file */
-  final public static int YYEOF = -1;
-
-  /** lexical states */
-  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 = 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 = 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_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 = 50;
-  final public static int ST_JSP_SQUOTED_VBL = 56;
-  final public static int ST_XML_ATTRIBUTE_VALUE_SQUOTED = 40;
-  final public static int ST_XML_ATTRIBUTE_NAME = 23;
-  final public static int ST_XML_EQUALS = 24;
-  final public static int YYINITIAL = 0;
-  final public static int ST_JSP_DIRECTIVE_ATTRIBUTE_NAME = 19;
-  final public static int ST_JSP_CONTENT = 16;
-  final public static int ST_XML_DOCTYPE_ID_SYSTEM = 31;
-  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 = 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;
-  final public static int ST_CDATA_TEXT = 1;
-  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 = 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 = 55;
-  final public static int ST_DHTML_ATTRIBUTE_NAME = 12;
-  final public static int ST_ABORT_EMBEDDED = 42;
-  final public static int ST_XML_DOCTYPE_EXTERNAL_ID = 29;
-  final public static int ST_JSP_COMMENT = 38;
-  final public static int ST_PI_CONTENT = 7;
-  final public static int ST_BLOCK_TAG_INTERNAL_SCAN = 37;
-  final public static int ST_PI = 5;
-  final public static int ST_XML_DECLARATION = 26;
-  final public static int ST_JSP_DIRECTIVE_NAME = 17;
-  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;
-
-  /** 
-   * 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\63"+
-    "\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\70\1\1\1\50\1\2\1\4\1\21"+
-    "\1\37\1\71\1\35\1\36\1\54\1\66\1\60\1\60\1\61\1\60"+
-    "\1\60\1\32\1\31\1\62\1\51\1\53\1\60\1\65\1\64\1\40"+
-    "\1\67\2\60\1\27\1\52\1\60\1\34\1\102\1\23\1\0\1\10"+
-    "\1\0\1\56\1\101\1\72\1\57\1\42\1\66\1\73\1\60\1\45"+
-    "\1\76\1\60\1\33\1\31\1\47\1\46\1\77\1\60\1\43\1\44"+
-    "\1\55\1\100\1\41\1\60\1\30\1\52\1\60\1\16\1\0\1\103"+
-    "\71\0\1\75\10\0\27\74\1\0\37\74\1\0\72\74\2\0\13\74"+
-    "\2\0\10\74\1\0\65\74\1\0\104\74\11\0\44\74\3\0\2\74"+
-    "\4\0\36\74\70\0\131\74\22\0\7\74\16\0\2\75\56\0\106\75"+
-    "\32\0\2\75\44\0\1\74\1\75\3\74\1\0\1\74\1\0\24\74"+
-    "\1\0\54\74\1\0\7\74\3\0\1\74\1\0\1\74\1\0\1\74"+
-    "\1\0\1\74\1\0\22\74\15\0\14\74\1\0\102\74\1\0\14\74"+
-    "\1\0\44\74\1\0\4\75\11\0\65\74\2\0\2\74\2\0\2\74"+
-    "\3\0\34\74\2\0\10\74\2\0\2\74\67\0\46\74\2\0\1\74"+
-    "\7\0\46\74\12\0\21\75\1\0\27\75\1\0\3\75\1\0\1\75"+
-    "\1\0\2\75\1\0\1\75\13\0\33\74\5\0\3\74\56\0\32\74"+
-    "\5\0\1\75\12\74\10\75\15\0\12\75\6\0\1\75\107\74\2\0"+
-    "\5\74\1\0\17\74\1\0\4\74\1\0\1\74\17\75\2\74\2\75"+
-    "\1\0\4\75\2\0\12\75\u0207\0\3\75\1\0\65\74\2\0\1\75"+
-    "\1\74\20\75\3\0\4\75\3\0\12\74\2\75\2\0\12\75\21\0"+
-    "\3\75\1\0\10\74\2\0\2\74\2\0\26\74\1\0\7\74\1\0"+
-    "\1\74\3\0\4\74\2\0\1\75\1\0\7\75\2\0\2\75\2\0"+
-    "\3\75\11\0\1\75\4\0\2\74\1\0\3\74\2\75\2\0\12\75"+
-    "\2\74\20\0\1\75\2\0\6\74\4\0\2\74\2\0\26\74\1\0"+
-    "\7\74\1\0\2\74\1\0\2\74\1\0\2\74\2\0\1\75\1\0"+
-    "\5\75\4\0\2\75\2\0\3\75\13\0\4\74\1\0\1\74\7\0"+
-    "\12\75\2\75\3\74\14\0\3\75\1\0\7\74\1\0\1\74\1\0"+
-    "\3\74\1\0\26\74\1\0\7\74\1\0\2\74\1\0\5\74\2\0"+
-    "\1\75\1\74\10\75\1\0\3\75\1\0\3\75\22\0\1\74\5\0"+
-    "\12\75\21\0\3\75\1\0\10\74\2\0\2\74\2\0\26\74\1\0"+
-    "\7\74\1\0\2\74\2\0\4\74\2\0\1\75\1\74\6\75\3\0"+
-    "\2\75\2\0\3\75\10\0\2\75\4\0\2\74\1\0\3\74\4\0"+
-    "\12\75\22\0\2\75\1\0\6\74\3\0\3\74\1\0\4\74\3\0"+
-    "\2\74\1\0\1\74\1\0\2\74\3\0\2\74\3\0\3\74\3\0"+
-    "\10\74\1\0\3\74\4\0\5\75\3\0\3\75\1\0\4\75\11\0"+
-    "\1\75\17\0\11\75\21\0\3\75\1\0\10\74\1\0\3\74\1\0"+
-    "\27\74\1\0\12\74\1\0\5\74\4\0\7\75\1\0\3\75\1\0"+
-    "\4\75\7\0\2\75\11\0\2\74\4\0\12\75\22\0\2\75\1\0"+
-    "\10\74\1\0\3\74\1\0\27\74\1\0\12\74\1\0\5\74\4\0"+
-    "\7\75\1\0\3\75\1\0\4\75\7\0\2\75\7\0\1\74\1\0"+
-    "\2\74\4\0\12\75\22\0\2\75\1\0\10\74\1\0\3\74\1\0"+
-    "\27\74\1\0\20\74\4\0\6\75\2\0\3\75\1\0\4\75\11\0"+
-    "\1\75\10\0\2\74\4\0\12\75\221\0\56\74\1\0\1\74\1\75"+
-    "\2\74\7\75\5\0\6\74\1\75\10\75\1\0\12\75\47\0\2\74"+
-    "\1\0\1\74\2\0\2\74\1\0\1\74\2\0\1\74\6\0\4\74"+
-    "\1\0\7\74\1\0\3\74\1\0\1\74\1\0\1\74\2\0\2\74"+
-    "\1\0\2\74\1\0\1\74\1\75\2\74\6\75\1\0\2\75\1\74"+
-    "\2\0\5\74\1\0\1\75\1\0\6\75\2\0\12\75\76\0\2\75"+
-    "\6\0\12\75\13\0\1\75\1\0\1\75\1\0\1\75\4\0\2\75"+
-    "\10\74\1\0\41\74\7\0\24\75\1\0\6\75\4\0\6\75\1\0"+
-    "\1\75\1\0\25\75\3\0\7\75\1\0\1\75\346\0\46\74\12\0"+
-    "\47\74\11\0\1\74\1\0\2\74\1\0\3\74\1\0\1\74\1\0"+
-    "\2\74\1\0\5\74\51\0\1\74\1\0\1\74\1\0\1\74\13\0"+
-    "\1\74\1\0\1\74\1\0\1\74\3\0\2\74\3\0\1\74\5\0"+
-    "\3\74\1\0\1\74\1\0\1\74\1\0\1\74\1\0\1\74\3\0"+
-    "\2\74\3\0\2\74\1\0\1\74\50\0\1\74\11\0\1\74\2\0"+
-    "\1\74\2\0\2\74\7\0\2\74\1\0\1\74\1\0\7\74\50\0"+
-    "\1\74\4\0\1\74\10\0\1\74\u0c06\0\234\74\4\0\132\74\6\0"+
-    "\26\74\2\0\6\74\2\0\46\74\2\0\6\74\2\0\10\74\1\0"+
-    "\1\74\1\0\1\74\1\0\1\74\1\0\37\74\2\0\65\74\1\0"+
-    "\7\74\1\0\1\74\3\0\3\74\1\0\7\74\3\0\4\74\2\0"+
-    "\6\74\4\0\15\74\5\0\3\74\1\0\7\74\323\0\15\75\4\0"+
-    "\1\75\104\0\1\74\3\0\2\74\2\0\1\74\121\0\3\74\u0e82\0"+
-    "\1\75\1\0\1\74\31\0\11\74\6\75\1\0\5\75\13\0\124\74"+
-    "\4\0\2\75\2\0\2\75\2\0\132\74\1\0\3\75\6\0\50\74"+
-    "\u1cd3\0\u51a6\74\u0c5a\0\u2ba4\74\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,    68,   136,   204,   272,   340,   408,   476,   544,   612, 
-      680,   748,   816,   884,   952,  1020,  1088,  1156,  1224,  1292, 
-     1360,  1428,  1496,  1564,  1632,  1700,  1768,  1836,  1904,  1972, 
-     2040,  2108,  2176,  2244,  2312,  2380,  2448,  2516,  2584,  2652, 
-     2720,  2788,  2856,  2924,  2992,  3060,  3128,  3196,  3264,  3332, 
-     3400,  3468,  3536,  3604,  3672,  3740,  3808,  3876,  3944,  4012, 
-     4080,  4148,  4216,  4284,  4352,  4284,  4352,  4420,  4284,  4284, 
-     4352,  4488,  4556,  4624,  4692,  4760,  4828,  4896,  4284,  4352, 
-     4964,  5032,  5100,  4284,  5168,  5168,  5236,  5304,  5372,  4964, 
-     4284,  5440,  5508,  4284,  5576,  5644,  5712,  5780,  4284,  4352, 
-     5848,  5916,  5984,  6052,  6120,  6188,  4284,  6256,  6256,  6324, 
-     6392,  6460,  6528,  6596,  4284,  6664,  6732,  6800,  6868,  6936, 
-     7004,  4284,  7072,  7140,  7208,  7276,  7344,  7412,  7480,  7548, 
-     4284,  7616,  7684,  7752,  7820,  7888,  7956,  8024,  8092,  8092, 
-     8160,  8228,  8296,  8364,  8364,  8432,  8500,  8568,  8636,  8636, 
-     8704,  8772,  8840,  8908,  4284,  8976,  8976,  9044,  9112,  9180, 
-     9248,  4284,  4284,  4352,  9316,  4284,  4352,  9384,  9452,  9520, 
-     9588,  4284,  9656,  9724,  9792,  9860,  4284,  9928,  9996, 10064, 
-    10132,  4284,  4284, 10200,  4284, 10268, 10336, 10268, 10404, 10472, 
-    10404,  4284,  4284, 10540, 10608, 10676,  4284, 10744, 10812, 10880, 
-    10948, 11016,  4284,  4284, 11084,  4284, 11152, 11220, 11152, 11288, 
-    11356, 11288,  4284,  4284, 11424, 11492, 11560,  4284, 11628, 11696, 
-    11764,  4284,  4284, 11832, 11900, 11968, 12036, 12104,  4284, 12172, 
-    12240, 12308, 12376, 12444, 12512, 12580, 12648, 12716,  4284, 12784, 
-    12852,  4284,  4284,  5168,  5304,  4284, 12920,  5372, 12988,  5440, 
-     5576,  5644, 13056,  5712,  4284, 13124, 13192,  5780, 13260,  4284, 
-    11900,  4284,  6256,  6324,  4284, 13328,  6392, 13396,  4284, 13464, 
-    13532,  7072, 13600,  7276,  4284, 13668,  7344, 13736, 13804, 13872, 
-    13940, 14008, 14076,  7820,  4284, 14144, 14212,  8092,  8160,  4284, 
-    14280, 14348, 14416, 14484, 14552,  8296,  8092,  8364,  8432,  4284, 
-     8500,  8568,  8364,  8636,  8704,  4284, 14620, 14688, 14756, 14824, 
-    14892, 14960, 15028,  8976,  9044,  4284, 15096, 15164, 15232, 15300, 
-    15368, 15436, 15504, 15572, 15640, 15708,  4284,  4284,  4284, 15776, 
-     4284,  4284, 15844, 15912, 15980, 16048, 10268,  4284, 16116, 16184, 
-    10404,  4284, 16252, 16320, 16388, 16456, 16524, 16592, 16660, 16728, 
-    16796, 10948, 11152,  4284, 16864, 16932, 11288,  4284, 17000, 17068, 
-    17136, 17204, 17272, 17340, 17408, 17476, 17544,  4284,  4284,  4284, 
-    17612, 17680, 17748, 17816, 17884,  4284, 17952, 18020,  4284,  4284, 
-     4284,  4284,  4284,  4692, 18088, 18156, 18224, 18292, 18360, 18428, 
-    18360, 18496, 18564, 18496, 18632, 18700, 18768, 18836, 18904, 18972, 
-    19040, 19040, 19108, 19176, 19176,  8840,  8840, 19244, 19312, 19380, 
-    19380,  9180,  9180, 19448, 19516, 19584, 15980, 10064, 10064, 19652, 
-    10268, 10268, 19720, 10404, 10404, 19788, 10540, 10540, 16524, 19856, 
-    10744, 10744, 16728, 19924, 10948, 10948, 11152, 11152, 19992, 11288, 
-    11288, 20060, 11424, 11424, 17272, 20128, 11628, 11628, 17476, 20196, 
-     4284,  4284, 20264, 20332,  4284, 20400, 20468, 20536,  7072,  4284, 
-     4284, 20604, 20672, 20740, 20808, 20876, 14484, 14824, 20944, 15300, 
-    21012,  4284,  4284, 21080, 21148, 21216,  4284, 21284, 21352, 21420, 
-    21488,  4284, 21556, 21624, 21692, 21760, 21828, 21896, 21964, 22032, 
-    22100, 22168, 22236, 22304, 22372, 22440, 22508, 22576, 22644, 22712, 
-    22780, 22848, 22916,  4692, 22984, 23052, 23120, 23188, 23256,  4284, 
-     4284, 23324, 23392, 23460, 23528, 16524, 16728, 23596, 23664, 17272, 
-    17476, 23732, 23800, 23868,  4284,  4284,  4284, 23936, 24004, 24072, 
-    24140, 24208, 24276, 24344,  6800, 24412, 24480, 24548, 24616, 24684, 
-    24752, 24820,  4284, 24888,  8840,  9180, 10268, 10404, 11152, 11288, 
-    24956, 25024, 25092, 25160, 25228, 25296, 25364, 25432, 25500, 25568, 
-    25636, 25704, 25772, 25840, 25908, 25976, 26044, 26112, 26180, 26248, 
-    26316, 26384, 26452, 26520, 26588, 26656, 26724, 26792, 26860, 26928, 
-    26996, 27064, 27132, 27200, 27268, 27336, 27404, 27472, 27540, 27608, 
-     4284, 27676, 27744, 27812, 27880,  6800, 27948, 28016, 28084, 28152, 
-    28220, 28288, 28356, 28424, 28492, 28560, 28628, 28696, 28764, 28832
-  };
-
-  /** 
-   * The packed transition table of the DFA
-   */
-  final private static String yy_packed = 
-    "\1\72\1\73\11\72\1\74\1\72\1\75\4\72\1\76"+
-    "\40\72\1\77\20\72\1\100\1\101\102\100\1\102\1\103"+
-    "\21\102\1\104\2\102\1\105\55\102\1\106\1\107\102\106"+
-    "\1\102\1\103\5\102\1\110\16\102\1\105\56\102\1\103"+
-    "\2\102\1\111\1\112\2\102\2\113\5\102\1\112\6\102"+
-    "\1\112\2\114\3\113\1\102\10\113\1\115\2\113\1\102"+
-    "\10\113\1\115\1\113\1\102\4\113\1\102\4\113\1\102"+
-    "\4\113\3\102\1\103\2\102\1\111\1\116\11\102\1\116"+
-    "\6\102\1\116\55\102\1\117\1\120\2\117\1\121\21\117"+
-    "\1\105\55\117\1\102\1\103\2\102\1\122\1\112\2\102"+
-    "\2\123\5\102\1\112\6\102\1\112\5\123\1\102\13\123"+
-    "\1\102\12\123\1\102\4\123\1\102\4\123\1\102\4\123"+
-    "\3\102\1\103\2\102\1\122\1\112\2\102\2\123\5\102"+
-    "\1\112\6\102\1\112\5\123\1\102\13\123\1\124\12\123"+
-    "\1\102\4\123\1\102\4\123\1\102\4\123\2\102\1\125"+
-    "\1\103\1\102\1\126\1\127\1\112\4\125\1\130\1\125"+
-    "\1\131\2\125\1\112\6\125\1\112\55\125\1\102\1\103"+
-    "\2\102\1\132\21\102\1\105\56\102\1\103\1\133\1\134"+
-    "\1\102\1\112\2\102\2\135\5\102\1\112\6\102\1\112"+
-    "\5\135\1\102\13\135\1\102\12\135\1\102\4\135\1\102"+
-    "\4\135\1\102\4\135\3\102\1\103\1\133\1\134\1\102"+
-    "\1\112\2\102\2\135\5\102\1\112\6\102\1\112\5\135"+
-    "\1\102\13\135\1\136\12\135\1\102\4\135\1\102\4\135"+
-    "\1\102\4\135\2\102\1\137\1\103\1\133\1\140\1\137"+
-    "\1\112\4\137\1\141\1\137\1\142\2\137\1\112\6\137"+
-    "\1\112\55\137\1\102\1\103\3\102\1\112\11\102\1\112"+
-    "\6\102\1\112\55\102\1\143\1\144\20\143\1\145\3\143"+
-    "\1\105\55\143\1\102\1\146\3\102\1\112\2\102\2\147"+
-    "\5\102\1\112\2\102\1\150\3\102\1\112\5\147\1\102"+
-    "\13\147\1\102\12\147\1\102\4\147\1\102\4\147\1\102"+
-    "\4\147\3\102\1\146\3\102\1\151\11\102\1\151\2\102"+
-    "\1\150\3\102\1\151\56\102\1\146\3\102\1\112\2\102"+
-    "\2\152\5\102\1\112\2\102\1\150\3\102\1\112\5\152"+
-    "\1\102\13\152\1\102\12\152\1\102\4\152\1\102\4\152"+
-    "\1\102\4\152\3\102\1\146\3\102\1\112\2\102\2\152"+
-    "\5\102\1\112\2\102\1\150\3\102\1\112\5\152\1\102"+
-    "\13\152\1\153\12\152\1\102\4\152\1\102\4\152\1\102"+
-    "\4\152\2\102\1\154\1\146\1\102\1\155\1\154\1\112"+
-    "\4\154\1\156\1\154\1\157\2\154\1\112\2\154\1\160"+
-    "\3\154\1\112\55\154\1\161\1\162\1\163\1\164\4\161"+
-    "\2\165\15\161\5\166\1\161\13\166\1\161\12\166\1\161"+
-    "\4\166\1\161\4\166\1\161\1\167\3\166\2\161\1\102"+
-    "\1\170\1\163\1\164\1\102\1\112\2\102\2\171\5\102"+
-    "\1\112\6\102\1\112\5\171\1\102\13\171\1\102\12\171"+
-    "\1\102\4\171\1\102\4\171\1\102\4\171\3\102\1\170"+
-    "\1\163\1\164\1\102\1\112\2\102\2\171\5\102\1\112"+
-    "\6\102\1\112\5\171\1\102\13\171\1\172\12\171\1\102"+
-    "\4\171\1\102\4\171\1\102\4\171\2\102\1\173\1\174"+
-    "\1\163\1\175\1\173\1\112\4\173\1\176\1\173\1\177"+
-    "\1\200\1\173\1\112\6\173\1\112\34\173\1\201\20\173"+
-    "\1\102\1\202\1\203\2\102\1\112\11\102\1\112\6\102"+
-    "\1\112\7\102\1\204\1\205\2\102\1\206\11\102\1\206"+
-    "\1\102\1\205\1\204\25\102\1\103\1\203\2\102\1\112"+
-    "\11\102\1\112\6\102\1\112\5\102\1\207\50\102\1\103"+
-    "\1\203\2\102\1\112\2\102\2\210\5\102\1\112\6\102"+
-    "\1\112\5\210\1\207\13\210\1\102\12\210\1\102\4\210"+
-    "\1\102\4\210\1\102\4\210\3\102\1\103\1\203\2\102"+
-    "\1\112\11\102\1\112\6\102\1\112\5\102\1\207\7\102"+
-    "\1\211\6\102\1\212\10\102\1\211\12\102\1\212\4\102"+
-    "\1\213\1\103\1\203\1\214\1\213\1\112\4\213\1\215"+
-    "\1\213\1\216\2\213\1\112\6\213\1\112\5\213\1\217"+
-    "\47\213\1\220\1\103\1\203\1\221\1\220\1\112\4\220"+
-    "\1\222\1\220\1\223\2\220\1\112\6\220\1\112\5\220"+
-    "\1\224\47\220\1\225\1\103\1\203\1\226\1\225\1\112"+
-    "\4\225\1\227\1\225\1\230\2\225\1\112\6\225\1\112"+
-    "\55\225\1\231\1\232\1\233\101\231\1\234\1\103\1\203"+
-    "\1\235\1\234\1\112\4\234\1\236\1\234\1\237\2\234"+
-    "\1\112\6\234\1\112\55\234\1\240\1\241\1\242\101\240"+
-    "\1\243\1\244\102\243\1\102\1\245\24\102\1\105\55\102"+
-    "\1\246\1\247\102\246\1\102\1\103\5\102\1\250\16\102"+
-    "\1\105\55\102\1\251\1\252\3\251\1\253\6\251\1\254"+
-    "\1\255\1\251\1\253\6\251\1\253\34\251\1\256\20\251"+
-    "\1\257\1\252\3\257\1\260\4\257\1\261\2\257\1\262"+
-    "\1\257\1\260\6\257\1\260\34\257\1\263\20\257\1\102"+
-    "\1\103\24\102\1\105\55\102\1\264\1\265\10\264\1\266"+
-    "\1\264\1\267\1\270\65\264\1\271\1\272\1\273\12\272"+
-    "\1\102\11\272\1\274\55\272\1\275\1\276\10\275\1\102"+
-    "\13\275\1\277\55\275\1\102\1\103\12\102\1\300\11\102"+
-    "\1\105\56\102\1\103\10\102\1\301\13\102\1\105\55\102"+
-    "\1\302\1\303\10\302\1\261\67\302\1\304\1\305\1\306"+
-    "\1\307\12\306\1\254\65\306\1\310\1\305\1\311\1\312"+
-    "\10\311\1\313\1\311\1\314\46\311\1\315\17\311\1\316"+
-    "\1\317\1\320\12\317\1\102\11\317\1\321\55\317\1\322"+
-    "\1\323\10\322\1\102\13\322\1\324\55\322\1\102\1\103"+
-    "\12\102\1\325\11\102\1\105\56\102\1\103\10\102\1\326"+
-    "\13\102\1\105\55\102\1\327\1\330\10\327\1\261\67\327"+
-    "\1\331\1\332\1\333\1\334\12\333\1\254\65\333\1\335"+
-    "\1\332\1\72\1\0\11\72\1\0\1\72\1\0\4\72"+
-    "\1\0\40\72\1\0\20\72\3\0\1\336\1\337\15\0"+
-    "\1\340\2\0\1\341\63\0\1\342\2\0\2\343\5\0"+
-    "\1\342\6\0\1\342\5\343\1\0\13\343\1\0\12\343"+
-    "\1\344\4\343\1\0\4\343\1\0\4\343\2\0\1\345"+
-    "\1\0\11\345\1\0\1\345\1\346\1\347\3\345\1\0"+
-    "\61\345\5\0\1\342\2\0\2\350\5\0\1\342\6\0"+
-    "\1\342\5\350\1\0\13\350\1\0\12\350\1\0\4\350"+
-    "\1\0\4\350\1\0\4\350\2\0\1\345\1\0\11\345"+
-    "\1\0\2\345\1\351\3\345\1\0\40\345\1\352\20\345"+
-    "\126\0\1\353\2\0\1\354\101\0\1\355\67\0\1\356"+
-    "\76\0\1\357\106\0\1\112\11\0\1\112\6\0\1\112"+
-    "\63\0\4\113\6\0\1\113\6\0\5\113\1\0\13\113"+
-    "\1\0\12\113\1\0\4\113\1\0\11\113\10\0\4\113"+
-    "\6\0\1\113\6\0\2\113\1\360\2\113\1\0\13\113"+
-    "\1\0\12\113\1\0\4\113\1\0\11\113\10\0\4\113"+
-    "\6\0\1\113\6\0\2\113\1\361\2\113\1\0\13\113"+
-    "\1\0\12\113\1\0\4\113\1\0\11\113\7\0\1\116"+
-    "\11\0\1\116\6\0\1\116\57\0\1\362\103\0\1\363"+
-    "\107\0\4\123\6\0\1\123\6\0\5\123\1\0\13\123"+
-    "\1\0\12\123\1\0\4\123\1\0\11\123\2\0\1\125"+
-    "\2\0\1\364\1\125\1\0\4\125\1\0\1\125\1\0"+
-    "\2\125\1\0\6\125\1\0\56\125\1\0\1\363\1\364"+
-    "\1\125\1\0\4\125\1\0\1\125\1\0\2\125\1\0"+
-    "\6\125\1\0\55\125\1\365\1\0\10\365\1\366\2\365"+
-    "\1\367\45\365\1\367\20\365\1\370\1\0\12\370\1\366"+
-    "\1\371\45\370\1\371\20\370\2\0\1\133\1\372\106\0"+
-    "\4\135\6\0\1\135\6\0\5\135\1\0\13\135\1\0"+
-    "\12\135\1\0\4\135\1\0\11\135\2\0\1\137\2\0"+
-    "\1\373\1\137\1\0\4\137\1\0\1\137\1\0\2\137"+
-    "\1\0\6\137\1\0\56\137\1\0\1\133\1\374\1\137"+
-    "\1\0\4\137\1\0\1\137\1\0\2\137\1\0\6\137"+
-    "\1\0\55\137\1\141\1\0\1\375\1\376\1\141\1\375"+
-    "\4\141\1\377\1\141\1\375\1\u0100\1\141\1\375\6\141"+
-    "\1\375\34\141\1\u0100\20\141\1\142\1\0\1\u0101\1\u0102"+
-    "\1\142\1\u0101\4\142\1\u0101\1\142\1\377\1\u0103\1\142"+
-    "\1\u0101\6\142\1\u0101\34\142\1\u0103\20\142\2\0\1\u0104"+
-    "\123\0\1\353\2\0\1\u0105\64\0\4\147\6\0\1\147"+
-    "\6\0\5\147\1\0\13\147\1\0\12\147\1\0\4\147"+
-    "\1\0\11\147\4\0\1\u0106\106\0\1\151\11\0\1\151"+
-    "\6\0\1\151\63\0\4\152\6\0\1\152\6\0\5\152"+
-    "\1\0\13\152\1\0\12\152\1\0\4\152\1\0\11\152"+
-    "\2\0\1\154\2\0\1\u0107\1\154\1\0\4\154\1\0"+
-    "\1\154\1\0\2\154\1\0\6\154\1\0\55\154\1\u0108"+
-    "\1\0\10\u0108\1\u0109\2\u0108\1\u010a\45\u0108\1\u010a\20\u0108"+
-    "\1\u010b\1\0\12\u010b\1\u0109\1\u010c\45\u010b\1\u010c\20\u010b"+
-    "\1\154\1\0\1\u0106\1\u0107\1\154\1\0\4\154\1\0"+
-    "\1\154\1\0\2\154\1\0\6\154\1\0\55\154\1\161"+
-    "\3\0\23\161\5\0\1\161\13\0\1\161\12\0\1\161"+
-    "\4\0\1\161\4\0\1\161\4\0\2\161\3\0\1\336"+
-    "\16\0\1\353\2\0\1\341\60\0\1\u010d\101\0\1\161"+
-    "\3\0\2\161\4\165\6\161\1\165\6\161\5\166\1\161"+
-    "\13\166\1\161\12\166\1\161\4\166\1\161\4\166\1\165"+
-    "\4\166\2\161\6\0\4\166\6\0\1\166\6\0\5\166"+
-    "\1\0\13\166\1\0\12\166\1\0\4\166\1\0\11\166"+
-    "\10\0\4\166\6\0\1\166\6\0\5\166\1\0\7\166"+
-    "\1\u010e\3\166\1\0\12\166\1\0\4\166\1\0\11\166"+
-    "\5\0\1\336\4\0\2\u010f\10\0\1\353\2\0\1\341"+
-    "\1\0\5\u010f\1\0\13\u010f\1\0\12\u010f\1\0\4\u010f"+
-    "\1\0\4\u010f\1\0\4\u010f\10\0\4\171\6\0\1\171"+
-    "\6\0\5\171\1\0\13\171\1\0\12\171\1\0\4\171"+
-    "\1\0\11\171\2\0\1\173\2\0\1\u0110\1\173\1\0"+
-    "\4\173\1\0\1\173\1\0\2\173\1\0\6\173\1\0"+
-    "\55\173\3\0\1\336\4\0\2\u0111\10\0\1\353\2\0"+
-    "\1\341\1\0\5\u0111\1\0\13\u0111\1\0\12\u0111\1\0"+
-    "\4\u0111\1\0\4\u0111\1\0\4\u0111\2\0\1\173\1\0"+
-    "\1\u010d\1\u0110\1\173\1\0\4\173\1\0\1\173\1\0"+
-    "\2\173\1\0\6\173\1\0\55\173\1\u0112\1\0\10\u0112"+
-    "\1\u0113\2\u0112\1\u0114\45\u0112\1\u0114\20\u0112\1\u0115\1\0"+
-    "\12\u0115\1\u0113\1\u0116\45\u0115\1\u0116\20\u0115\1\173\2\0"+
-    "\1\u0110\1\173\1\0\4\173\1\0\1\173\1\0\1\173"+
-    "\1\u0117\1\0\6\173\1\0\56\173\2\0\1\u0110\1\173"+
-    "\1\0\4\173\1\0\1\173\1\0\1\173\1\u0118\1\0"+
-    "\6\173\1\0\55\173\3\0\1\336\16\0\1\353\2\0"+
-    "\1\u0105\124\0\1\u0119\2\0\1\u0119\72\0\1\u011a\14\0"+
-    "\1\u011a\60\0\2\u011b\50\0\23\u011c\1\u011d\60\u011c\6\0"+
-    "\4\210\6\0\1\210\6\0\5\210\1\0\13\210\1\0"+
-    "\12\210\1\0\4\210\1\0\11\210\54\0\1\u011e\120\0"+
-    "\1\u011f\10\0\1\u011f\3\0\1\213\2\0\1\u0120\1\213"+
-    "\1\0\4\213\1\0\1\213\1\0\2\213\1\0\6\213"+
-    "\1\0\55\213\1\u0121\1\0\10\u0121\1\u0122\2\u0121\1\u0123"+
-    "\45\u0121\1\u0123\20\u0121\1\u0124\1\0\1\u0124\2\u0125\1\u0124"+
-    "\4\u0125\2\u0124\1\u0126\1\u0127\1\u0124\4\u0125\1\u0124\10\u0125"+
-    "\1\u0124\26\u0125\1\u0127\10\u0125\2\u0124\4\u0125\2\u0124\1\217"+
-    "\2\u011c\1\u0128\1\217\1\u011c\4\217\1\u011c\1\217\1\u011c"+
-    "\2\217\1\u011c\3\217\1\u0129\2\217\1\u011c\55\217\1\220"+
-    "\2\0\1\u012a\1\220\1\0\4\220\1\0\1\220\1\0"+
-    "\2\220\1\0\6\220\1\0\55\220\12\u012b\1\u012c\71\u012b"+
-    "\14\u012d\1\u012c\67\u012d\1\224\2\u011c\1\u012e\1\224\1\u011c"+
-    "\4\224\1\u011c\1\224\1\u011c\2\224\1\u011c\3\224\1\u012f"+
-    "\2\224\1\u011c\55\224\1\225\2\0\1\u0130\1\225\1\0"+
-    "\4\225\1\0\1\225\1\0\2\225\1\0\6\225\1\0"+
-    "\55\225\1\u0131\1\0\10\u0131\1\u0132\2\u0131\1\u0133\45\u0131"+
-    "\1\u0133\20\u0131\1\u0134\1\0\1\u0134\2\u0135\1\u0134\4\u0135"+
-    "\2\u0134\1\u0136\1\u0137\1\u0134\4\u0135\1\u0134\10\u0135\1\u0134"+
-    "\26\u0135\1\u0137\10\u0135\2\u0134\4\u0135\2\u0134\2\231\1\0"+
-    "\103\231\1\0\17\231\1\u0138\2\231\1\u0139\56\231\1\234"+
-    "\2\0\1\u013a\1\234\1\0\4\234\1\0\1\234\1\0"+
-    "\2\234\1\0\6\234\1\0\55\234\1\u013b\1\0\10\u013b"+
-    "\1\u013c\2\u013b\1\u013d\45\u013b\1\u013d\20\u013b\1\u013e\1\0"+
-    "\1\u013e\2\u013f\1\u013e\4\u013f\2\u013e\1\u0140\1\u0141\1\u013e"+
-    "\4\u013f\1\u013e\10\u013f\1\u013e\26\u013f\1\u0141\10\u013f\2\u013e"+
-    "\4\u013f\2\u013e\2\240\1\0\103\240\1\0\17\240\1\u0142"+
-    "\2\240\1\u0143\56\240\22\0\1\u0144\2\0\1\354\65\0"+
-    "\1\u0145\74\0\1\251\1\0\12\251\1\0\1\u0146\45\251"+
-    "\1\u0146\20\251\3\0\1\u0147\16\0\1\353\2\0\1\354"+
-    "\56\0\1\251\1\0\3\251\1\253\6\251\1\0\1\u0146"+
-    "\1\251\1\253\6\251\1\253\34\251\1\u0146\36\251\1\u0148"+
-    "\103\251\1\u0149\65\251\1\257\1\0\10\257\1\0\2\257"+
-    "\1\u014a\45\257\1\u014a\21\257\1\0\3\257\1\260\4\257"+
-    "\1\0\2\257\1\u014a\1\257\1\260\6\257\1\260\34\257"+
-    "\1\u014a\36\257\1\u014b\103\257\1\u014c\65\257\12\264\1\0"+
-    "\1\264\1\0\1\u014d\65\264\1\0\12\264\1\0\1\264"+
-    "\1\0\1\u014d\4\264\1\u014e\60\264\1\0\12\264\1\0"+
-    "\1\264\1\0\1\264\1\u014f\64\264\1\u0150\14\u0151\1\u0152"+
-    "\103\u0151\1\u0152\5\u0151\1\u0153\2\u0151\1\u0154\56\u0151\12\u0155"+
-    "\1\u0156\103\u0155\1\u0156\7\u0155\1\u0157\2\u0155\1\u0158\56\u0155"+
-    "\12\302\1\0\67\302\1\u0159\1\0\12\302\1\0\7\302"+
-    "\1\u015a\57\302\1\u0159\1\0\12\302\1\u015b\71\302\14\306"+
-    "\1\0\65\306\1\u015c\1\0\14\306\1\0\5\306\1\u015d"+
-    "\57\306\1\u015c\1\0\14\306\1\u015e\67\306\12\311\1\0"+
-    "\1\311\1\0\66\311\1\0\12\311\1\0\1\311\1\0"+
-    "\5\311\1\u015f\60\311\1\0\12\311\1\0\1\311\1\0"+
-    "\1\311\1\u0160\64\311\1\0\14\u0161\1\u0162\103\u0161\1\u0162"+
-    "\5\u0161\1\u0163\2\u0161\1\u0164\56\u0161\12\u0165\1\u0166\103\u0165"+
-    "\1\u0166\7\u0165\1\u0167\2\u0165\1\u0168\56\u0165\12\327\1\0"+
-    "\67\327\1\u0169\1\0\12\327\1\0\7\327\1\u016a\57\327"+
-    "\1\u0169\1\0\12\327\1\u016b\71\327\14\333\1\0\65\333"+
-    "\1\u016c\1\0\14\333\1\0\5\333\1\u016d\57\333\1\u016c"+
-    "\1\0\14\333\1\u016e\67\333\7\0\1\u016f\11\0\1\u0170"+
-    "\3\0\1\u0171\22\0\1\u0172\42\0\1\u0173\24\0\1\u0174"+
-    "\54\0\1\342\2\0\2\u0175\5\0\1\342\6\0\1\342"+
-    "\5\u0175\1\0\13\u0175\1\0\12\u0175\1\0\4\u0175\1\0"+
-    "\4\u0175\1\0\4\u0175\2\0\1\u0176\1\0\3\u0176\1\u0177"+
-    "\4\343\1\u0176\1\0\3\u0176\1\u0177\1\343\1\u0176\1\0"+
-    "\3\u0176\1\u0177\5\343\1\u0176\13\343\1\u0176\12\343\1\u0176"+
-    "\4\343\1\u0178\11\343\2\u0176\20\0\1\u0179\7\0\1\u017a"+
-    "\70\0\1\346\66\0\103\347\1\u017b\1\u0176\1\0\3\u0176"+
-    "\1\u0177\4\350\1\u0176\1\0\3\u0176\1\u0177\1\350\1\u0176"+
-    "\1\0\3\u0176\1\u0177\5\350\1\u0176\13\350\1\u0176\12\350"+
-    "\1\u0176\4\350\1\u017c\11\350\2\u0176\103\351\1\u017d\63\0"+
-    "\1\352\45\0\1\u0171\22\0\1\u0172\67\0\1\u0174\51\0"+
-    "\1\u017e\103\0\1\u017f\107\0\4\113\6\0\1\113\6\0"+
-    "\3\113\2\u0180\1\0\13\113\1\0\12\113\1\0\4\113"+
-    "\1\0\11\113\10\0\4\113\6\0\1\113\6\0\5\113"+
-    "\1\0\13\113\1\0\2\113\1\u0181\7\113\1\0\4\113"+
-    "\1\0\6\113\1\u0181\2\113\2\0\12\365\1\366\3\365"+
-    "\1\0\65\365\14\370\1\366\1\370\1\0\65\370\1\375"+
-    "\1\0\10\375\1\377\2\375\1\u0182\45\375\1\u0182\20\375"+
-    "\1\141\2\375\1\376\1\141\1\375\4\141\1\377\1\141"+
-    "\1\375\1\141\1\137\1\375\6\141\1\375\55\141\1\u0101"+
-    "\1\0\12\u0101\1\377\1\u0183\45\u0101\1\u0183\20\u0101\1\142"+
-    "\2\u0101\1\u0102\1\142\1\u0101\4\142\1\u0101\1\142\1\377"+
-    "\1\142\1\137\1\u0101\6\142\1\u0101\55\142\12\u0108\1\u0109"+
-    "\3\u0108\1\0\65\u0108\14\u010b\1\u0109\1\u010b\1\0\65\u010b"+
-    "\6\0\4\166\6\0\1\166\6\0\5\166\1\0\13\166"+
-    "\1\0\12\166\1\0\4\166\1\0\6\166\1\u0184\2\166"+
-    "\10\0\4\u010f\6\0\1\u010f\6\0\5\u010f\1\0\13\u010f"+
-    "\1\0\12\u010f\1\0\4\u010f\1\0\11\u010f\10\0\4\u0111"+
-    "\6\0\1\u0111\6\0\5\u0111\1\0\13\u0111\1\0\12\u0111"+
-    "\1\0\4\u0111\1\0\11\u0111\2\0\12\u0112\1\u0113\3\u0112"+
-    "\1\0\65\u0112\14\u0115\1\u0113\1\u0115\1\0\65\u0115\1\u0185"+
-    "\2\u0186\1\u0187\1\u0185\1\u0186\4\u0185\1\u0186\1\u0185\1\u0186"+
-    "\2\u0185\1\u0186\6\u0185\1\u0186\54\u0185\1\173\1\u0188\2\u0189"+
-    "\1\u018a\1\u0188\1\u0189\4\u0188\1\u0189\1\u0188\1\u0189\2\u0188"+
-    "\1\u0189\6\u0188\1\u0189\54\u0188\1\173\35\0\1\u018b\34\0"+
-    "\1\u018b\51\0\1\u018c\14\0\1\u018c\70\0\1\u018d\11\0"+
-    "\1\u018d\73\0\1\u018e\17\0\1\u018e\110\0\1\u018f\7\0"+
-    "\1\u018f\2\0\12\u0121\1\u0122\3\u0121\1\0\65\u0121\1\u0124"+
-    "\1\0\12\u0124\1\u0122\1\u0190\45\u0124\1\u0190\21\u0124\1\0"+
-    "\12\u0124\1\u0191\1\u0190\45\u0124\1\u0190\20\u0124\14\0\1\u0192"+
-    "\67\0\14\u0124\1\u0191\1\u0124\1\0\65\u0124\12\u0131\1\u0132"+
-    "\3\u0131\1\0\65\u0131\1\u0134\1\0\12\u0134\1\u0132\1\u0193"+
-    "\45\u0134\1\u0193\21\u0134\1\0\12\u0134\1\u0194\1\u0193\45\u0134"+
-    "\1\u0193\20\u0134\14\0\1\u0195\67\0\14\u0134\1\u0194\1\u0134"+
-    "\1\0\65\u0134\2\231\1\0\22\231\1\u0196\22\231\1\u0197"+
-    "\35\231\1\0\31\231\1\u0198\47\231\12\u013b\1\u013c\3\u013b"+
-    "\1\0\65\u013b\1\u013e\1\0\12\u013e\1\u013c\1\u0199\45\u013e"+
-    "\1\u0199\21\u013e\1\0\12\u013e\1\u019a\1\u0199\45\u013e\1\u0199"+
-    "\20\u013e\14\0\1\u019b\67\0\14\u013e\1\u019a\1\u013e\1\0"+
-    "\65\u013e\2\240\1\0\22\240\1\u019c\22\240\1\u019d\35\240"+
-    "\1\0\31\240\1\u019e\47\240\7\0\1\u019f\11\0\1\u0170"+
-    "\3\0\1\u0171\22\0\1\u0172\55\0\1\u01a0\61\0\16\251"+
-    "\1\0\65\251\16\257\1\0\65\257\12\264\1\0\1\264"+
-    "\1\0\1\264\1\u01a1\64\264\1\u0150\12\264\1\0\1\264"+
-    "\1\0\1\u014d\7\264\1\u01a2\22\264\1\u01a3\32\264\1\0"+
-    "\12\u01a1\1\0\1\u01a1\1\0\66\u01a1\1\0\12\u0150\1\0"+
-    "\1\u0150\1\0\1\u01a4\65\u0150\1\0\14\u0151\1\u0152\10\u0151"+
-    "\1\u01a5\22\u0151\1\u01a6\47\u0151\1\u0152\17\u0151\1\u01a7\47\u0151"+
-    "\12\u0155\1\u0156\12\u0155\1\u01a8\22\u0155\1\u01a9\45\u0155\1\u0156"+
-    "\21\u0155\1\u01aa\47\u0155\12\302\1\0\103\302\1\0\12\302"+
-    "\1\u01ab\22\302\1\u01ac\31\302\1\u0159\1\0\102\u01ad\1\u01ae"+
-    "\1\u01ad\14\306\1\0\103\306\1\0\10\306\1\u01af\22\306"+
-    "\1\u01b0\31\306\1\u015c\1\0\102\u01b1\1\u01b2\1\u01b1\12\311"+
-    "\1\0\1\311\1\0\10\311\1\u01b3\22\311\1\u01b4\32\311"+
-    "\1\0\14\u0161\1\u0162\10\u0161\1\u01b5\22\u0161\1\u01b6\47\u0161"+
-    "\1\u0162\17\u0161\1\u01b7\47\u0161\12\u0165\1\u0166\12\u0165\1\u01b8"+
-    "\22\u0165\1\u01b9\45\u0165\1\u0166\21\u0165\1\u01ba\47\u0165\12\327"+
-    "\1\0\103\327\1\0\12\327\1\u01bb\22\327\1\u01bc\31\327"+
-    "\1\u0169\1\0\102\u01bd\1\u01be\1\u01bd\14\333\1\0\103\333"+
-    "\1\0\10\333\1\u01bf\22\333\1\u01c0\31\333\1\u016c\1\0"+
-    "\102\u01c1\1\u01c2\1\u01c1\7\0\1\u01c3\103\0\1\u01c4\131\0"+
-    "\1\u01c5\46\0\1\u0175\1\0\11\u0175\1\0\6\u0175\1\0"+
-    "\61\u0175\1\u0176\1\0\11\u0176\1\0\6\u0176\1\0\45\u0176"+
-    "\1\0\14\u0176\1\0\3\u0176\1\u0177\5\u0176\1\0\3\u0176"+
-    "\1\u0177\2\u0176\1\0\3\u0176\1\u0177\41\u0176\1\u01c6\13\u0176"+
-    "\20\0\1\u0179\47\0\1\u01c7\33\0\1\u01c8\14\0\3\u01c8"+
-    "\2\0\1\u01c8\11\0\1\u01c8\1\0\2\u01c8\6\0\1\u01c8"+
-    "\2\0\2\u01c8\6\0\1\u01c8\10\0\4\113\6\0\1\113"+
-    "\6\0\5\113\1\0\11\113\1\u01c9\1\113\1\0\1\u01c9"+
-    "\11\113\1\0\4\113\1\0\11\113\2\0\12\375\1\377"+
-    "\3\375\1\0\65\375\14\u0101\1\377\1\u0101\1\0\65\u0101"+
-    "\6\0\3\166\1\u01ca\6\0\1\166\6\0\5\166\1\0"+
-    "\13\166\1\0\12\166\1\0\4\166\1\0\11\166\2\0"+
-    "\1\u0185\2\u0186\1\u0187\1\u0185\1\u0186\4\u0185\1\u0186\1\u0185"+
-    "\1\u0186\2\u0185\1\u0186\6\u0185\1\u0186\54\u0185\1\u01cb\103\u0186"+
-    "\1\u01cc\1\u0188\2\u0189\1\u018a\1\u0188\1\u0189\4\u0188\1\u0189"+
-    "\1\u0188\1\u0189\2\u0188\1\u0189\6\u0188\1\u0189\54\u0188\1\u01cb"+
-    "\103\u0189\1\u01cd\40\0\1\u01ce\14\0\1\u01ce\60\0\2\u01cf"+
-    "\101\0\1\u01d0\112\0\1\u01d1\14\0\1\u01d1\60\0\2\u01d2"+
-    "\50\0\14\u0124\1\u0122\1\u0124\1\0\65\u0124\3\0\2\u01d3"+
-    "\1\0\4\u01d3\2\0\1\u0126\1\u01d3\1\0\4\u01d3\1\0"+
-    "\10\u01d3\1\0\37\u01d3\2\0\4\u01d3\2\0\14\u0134\1\u0132"+
-    "\1\u0134\1\0\65\u0134\3\0\2\u01d4\1\0\4\u01d4\2\0"+
-    "\1\u0136\1\u01d4\1\0\4\u01d4\1\0\10\u01d4\1\0\37\u01d4"+
-    "\2\0\4\u01d4\2\0\2\231\1\0\32\231\1\u01d5\46\231"+
-    "\14\u013e\1\u013c\1\u013e\1\0\65\u013e\3\0\2\u01d6\1\0"+
-    "\4\u01d6\2\0\1\u0140\1\u01d6\1\0\4\u01d6\1\0\10\u01d6"+
-    "\1\0\37\u01d6\2\0\4\u01d6\2\0\2\240\1\0\32\240"+
-    "\1\u01d7\46\240\7\0\1\u01d8\76\0\1\u01d9\101\0\12\u0150"+
-    "\1\0\1\u0150\1\0\1\u0150\1\0\65\u0150\14\u0151\1\u0152"+
-    "\20\u0151\1\u01da\46\u0151\12\u0155\1\u0156\22\u0155\1\u01db\46\u0155"+
-    "\12\u01dc\1\u01dd\70\u01dc\1\0\14\u01de\1\u01dd\66\u01de\1\0"+
-    "\14\u0161\1\u0162\20\u0161\1\u01df\46\u0161\12\u0165\1\u0166\22\u0165"+
-    "\1\u01e0\46\u0165\12\u01e1\1\u01e2\70\u01e1\1\0\14\u01e3\1\u01e2"+
-    "\66\u01e3\37\0\1\u01e4\135\0\1\u01c6\33\0\1\u01c8\14\0"+
-    "\3\u01c8\2\0\1\u01c8\11\0\1\u01c8\1\0\2\u01c8\6\0"+
-    "\1\u01c8\1\0\1\u01c7\2\u01c8\6\0\1\u01c8\10\0\4\113"+
-    "\6\0\1\113\6\0\5\113\1\0\6\113\1\u01e5\4\113"+
-    "\1\0\12\113\1\0\1\113\1\u01e5\2\113\1\0\11\113"+
-    "\10\0\4\166\6\0\1\166\6\0\5\166\1\0\6\166"+
-    "\1\u01e6\4\166\1\0\6\166\1\u01e7\3\166\1\0\4\166"+
-    "\1\0\11\166\54\0\1\u01e8\76\0\1\u01e9\13\0\1\u01e9"+
-    "\64\0\1\u01ea\11\0\1\u01ea\71\0\1\u01eb\11\0\1\u01eb"+
-    "\74\0\1\u01ec\13\0\1\u01ec\22\0\2\231\1\0\33\231"+
-    "\1\u01ed\45\231\2\240\1\0\33\240\1\u01ee\45\240\14\u0151"+
-    "\1\u0152\21\u0151\1\u01ef\45\u0151\12\u0155\1\u0156\23\u0155\1\u01f0"+
-    "\45\u0155\12\u01dc\1\u01ad\67\u01dc\1\u01f1\1\u01ad\14\u01de\1\u01b1"+
-    "\65\u01de\1\u01f2\1\u01b1\14\u0161\1\u0162\21\u0161\1\u01f3\45\u0161"+
-    "\12\u0165\1\u0166\23\u0165\1\u01f4\45\u0165\12\u01e1\1\u01bd\67\u01e1"+
-    "\1\u01f5\1\u01bd\14\u01e3\1\u01c1\65\u01e3\1\u01f6\1\u01c1\37\0"+
-    "\1\u01f7\52\0\4\113\6\0\1\113\6\0\5\113\1\0"+
-    "\3\113\1\u01f8\7\113\1\0\4\113\1\u01f8\5\113\1\0"+
-    "\4\113\1\0\11\113\10\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\11\166\1\u01f9\1\166\1\0\12\166\1\0"+
-    "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\10\166\1\u01fa\2\166\1\0\12\166\1\0"+
-    "\4\166\1\0\11\166\55\0\1\u01fb\23\0\1\u01fb\50\0"+
-    "\1\u01fc\17\0\1\u01fc\66\0\1\u01fd\12\0\1\u01fd\52\0"+
-    "\1\u01fe\107\0\1\u01ff\34\0\1\u01ff\11\0\2\231\1\0"+
-    "\34\231\1\u0200\44\231\2\240\1\0\34\240\1\u0201\44\240"+
-    "\14\u0151\1\u0152\22\u0151\1\u0202\44\u0151\12\u0155\1\u0156\24\u0155"+
-    "\1\u0203\44\u0155\12\u01dc\1\u0204\67\u01dc\1\u01f1\1\u01ad\14\u01de"+
-    "\1\u0205\65\u01de\1\u01f2\1\u01b1\14\u0161\1\u0162\22\u0161\1\u0206"+
-    "\44\u0161\12\u0165\1\u0166\24\u0165\1\u0207\44\u0165\12\u01e1\1\u0208"+
-    "\67\u01e1\1\u01f5\1\u01bd\14\u01e3\1\u0209\65\u01e3\1\u01f6\1\u01c1"+
-    "\40\0\1\u020a\51\0\4\166\6\0\1\166\6\0\5\166"+
-    "\1\0\11\166\1\u020b\1\166\1\0\12\166\1\0\4\166"+
-    "\1\0\11\166\10\0\4\166\6\0\1\166\6\0\5\166"+
-    "\1\0\6\166\1\u020c\4\166\1\0\12\166\1\0\4\166"+
-    "\1\0\11\166\44\0\1\u020d\11\0\1\u020d\67\0\1\u020e"+
-    "\14\0\1\u020e\66\0\1\u020f\14\0\1\u020f\26\0\2\231"+
-    "\1\0\35\231\1\u0210\43\231\2\240\1\0\35\240\1\u0211"+
-    "\43\240\14\u0151\1\u0152\23\u0151\1\u0212\43\u0151\12\u0155\1\u0156"+
-    "\25\u0155\1\u0213\43\u0155\14\u0161\1\u0162\23\u0161\1\u0214\43\u0161"+
-    "\12\u0165\1\u0166\25\u0165\1\u0215\43\u0165\37\0\1\u0216\52\0"+
-    "\4\166\6\0\1\166\6\0\5\166\1\0\13\166\1\0"+
-    "\4\166\1\u0217\5\166\1\0\4\166\1\0\11\166\10\0"+
-    "\4\166\6\0\1\166\6\0\5\166\1\0\5\166\1\u0218"+
-    "\5\166\1\0\12\166\1\0\4\166\1\0\11\166\2\0"+
-    "\2\231\1\0\34\231\1\u0219\44\231\2\240\1\0\34\240"+
-    "\1\u021a\44\240\14\u0151\1\u0152\22\u0151\1\u021b\44\u0151\12\u0155"+
-    "\1\u0156\24\u0155\1\u021c\44\u0155\14\u0161\1\u0162\22\u0161\1\u021d"+
-    "\44\u0161\12\u0165\1\u0166\24\u0165\1\u021e\44\u0165\34\0\1\u021f"+
-    "\55\0\4\166\6\0\1\166\6\0\5\166\1\0\13\166"+
-    "\1\0\12\166\1\0\4\166\1\0\1\166\1\u0220\7\166"+
-    "\2\0\2\231\1\0\31\231\1\u0221\47\231\2\240\1\0"+
-    "\31\240\1\u0222\47\240\14\u0151\1\u0152\17\u0151\1\u0223\47\u0151"+
-    "\12\u0155\1\u0156\21\u0155\1\u0224\47\u0155\14\u0161\1\u0162\17\u0161"+
-    "\1\u0225\47\u0161\12\u0165\1\u0166\21\u0165\1\u0226\47\u0165\6\0"+
-    "\4\166\6\0\1\166\6\0\5\166\1\0\13\166\1\0"+
-    "\4\166\1\u0227\5\166\1\0\4\166\1\0\11\166\10\0"+
-    "\4\166\6\0\1\166\6\0\5\166\1\0\10\166\1\u0228"+
-    "\2\166\1\0\12\166\1\0\4\166\1\0\11\166\10\0"+
-    "\4\166\6\0\1\166\6\0\5\166\1\0\4\166\1\u0229"+
-    "\6\166\1\0\12\166\1\0\4\166\1\0\11\166\10\0"+
-    "\4\166\6\0\1\166\6\0\5\166\1\0\5\166\1\u022a"+
-    "\5\166\1\0\12\166\1\0\4\166\1\0\11\166\2\0"+
-    "\6\u022b\4\u022c\6\u022b\1\u022c\5\u022b\1\0\5\u022c\1\u022b"+
-    "\13\u022c\1\u022b\12\u022c\1\u022b\4\u022c\1\u022b\11\u022c\2\u022b"+
-    "\41\0\1\u022d\3\0\1\u022e\7\0\1\u022f\1\u0230\20\0"+
-    "\1\u0231\12\0\4\166\6\0\1\166\6\0\5\166\1\0"+
-    "\4\166\1\u0232\3\166\1\u0233\2\166\1\0\4\166\1\u0234"+
-    "\1\u0235\4\166\1\0\4\166\1\0\6\166\1\u0236\2\166"+
-    "\60\0\1\u0237\74\0\1\u0238\112\0\1\u0239\102\0\1\u023a"+
-    "\104\0\1\u023b\33\0\4\166\6\0\1\166\6\0\5\166"+
-    "\1\0\13\166\1\0\5\166\1\u023c\4\166\1\0\4\166"+
-    "\1\0\11\166\10\0\4\166\6\0\1\166\6\0\5\166"+
-    "\1\0\12\166\1\u023d\1\0\12\166\1\0\4\166\1\0"+
-    "\11\166\10\0\4\166\6\0\1\166\6\0\5\166\1\0"+
-    "\13\166\1\0\5\166\1\u023e\4\166\1\0\4\166\1\0"+
-    "\11\166\10\0\4\166\6\0\1\166\6\0\5\166\1\0"+
-    "\13\166\1\0\4\166\1\u023f\5\166\1\0\4\166\1\0"+
-    "\11\166\10\0\4\166\6\0\1\166\6\0\5\166\1\0"+
-    "\13\166\1\0\5\166\1\u0240\4\166\1\0\4\166\1\0"+
-    "\11\166\45\0\1\u0241\132\0\1\u0242\104\0\1\u0243\65\0"+
-    "\1\u0244\121\0\1\u0245\16\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\6\166\1\u0246\4\166\1\0\12\166\1\0"+
-    "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\13\166\1\0\12\166\1\0\4\166\1\0"+
-    "\1\166\1\u0247\7\166\10\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\13\166\1\0\12\166\1\0\4\166\1\0"+
-    "\2\166\1\u0248\6\166\10\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\13\166\1\0\4\166\1\u0249\5\166\1\0"+
-    "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\13\166\1\0\12\166\1\0\4\166\1\0"+
-    "\2\166\1\u024a\6\166\47\0\1\u024b\71\0\1\u024c\103\0"+
-    "\1\u024d\113\0\1\u024e\102\0\1\u024f\47\0\4\166\6\0"+
-    "\1\166\6\0\5\166\1\0\10\166\1\u0250\2\166\1\0"+
-    "\12\166\1\0\4\166\1\0\11\166\10\0\4\166\6\0"+
-    "\1\166\6\0\4\166\1\u0251\1\0\13\166\1\0\12\166"+
-    "\1\0\4\166\1\0\11\166\10\0\4\166\6\0\1\166"+
-    "\6\0\4\166\1\u0252\1\0\13\166\1\0\12\166\1\0"+
-    "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\6\166\1\u0253\4\166\1\0\12\166\1\0"+
-    "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\5\166\1\u0254\5\166\1\0\12\166\1\0"+
-    "\4\166\1\0\11\166\60\0\1\u0255\125\0\1\u0256\50\0"+
-    "\1\u0257\103\0\1\u0258\44\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\13\166\1\0\5\166\1\u0259\4\166\1\0"+
-    "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\13\166\1\0\12\166\1\0\4\166\1\0"+
-    "\7\166\1\u025a\1\166\10\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\10\166\1\u025b\2\166\1\0\12\166\1\0"+
-    "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\10\166\1\u025c\2\166\1\0\12\166\1\0"+
-    "\4\166\1\0\11\166\103\0\1\u025d\61\0\1\u0245\125\0"+
-    "\1\u024f\103\0\1\u025e\10\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\13\166\1\0\12\166\1\0\4\166\1\0"+
-    "\10\166\1\u025f\10\0\4\166\6\0\1\166\6\0\5\166"+
-    "\1\0\13\166\1\0\6\166\1\u024a\3\166\1\0\4\166"+
-    "\1\0\11\166\10\0\4\166\6\0\1\166\6\0\5\166"+
-    "\1\0\13\166\1\0\12\166\1\0\4\166\1\0\10\166"+
-    "\1\u0254\10\0\4\166\6\0\1\166\6\0\5\166\1\0"+
-    "\13\166\1\0\12\166\1\0\4\166\1\0\10\166\1\u0260"+
-    "\35\0\1\u0245\150\0\1\u0261\11\0\4\166\6\0\1\166"+
-    "\6\0\4\166\1\u024a\1\0\13\166\1\0\12\166\1\0"+
-    "\4\166\1\0\11\166\10\0\4\166\6\0\1\166\6\0"+
-    "\5\166\1\0\13\166\1\0\12\166\1\0\4\166\1\0"+
-    "\7\166\1\u0262\1\166\57\0\1\u0245\34\0\4\166\6\0"+
-    "\1\166\6\0\5\166\1\0\13\166\1\0\4\166\1\u024a"+
-    "\5\166\1\0\4\166\1\0\11\166\2\0";
-
-  /** 
-   * 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, 
-     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,  0,  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,  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,  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,  1,  0,  0,  0,  9,  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,  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,  0,  0,  1,  3,  2,  2,  3,  2,  2,  0,  0,  0,  0,  0,  0, 
-     1,  0,  0,  1,  0,  1,  1,  1,  0,  1,  0,  1,  1,  1,  0,  0, 
-     1,  1,  1,  0,  3,  3,  2,  3,  3,  2,  1,  1,  0,  0,  1,  1, 
-     0,  0,  1,  1,  3,  3,  2,  3,  3,  2,  1,  1,  0,  0,  1,  1, 
-     0,  0,  9,  9,  0,  1,  9,  0,  1,  1,  5, 13, 13,  0,  0,  0, 
-     0,  0,  0,  0,  1,  0,  1,  9,  9,  2,  2,  0,  9,  0,  2,  2, 
-     0,  9,  0,  0,  1,  1,  1,  0,  0,  0,  0,  0,  1,  1,  2,  2, 
-     0,  0,  2,  2,  0,  0,  0,  1,  1,  1,  0,  0,  0,  9,  9,  1, 
-     1,  2,  2,  1,  1,  2,  2,  1,  1,  0,  1,  1,  9,  9,  9,  1, 
-     1,  2,  2,  2,  2,  0,  1,  1,  1,  1,  2,  2,  2,  2,  9,  1, 
-     1,  1,  3,  3,  3,  3,  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 */
-  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 ContextRegionContainer fBufferedEmbeddedContainer = null;
-	private String f_context = null;
-
-	// state stack for handling embedded regions
-	private IntStack fStateStack = new IntStack();
-	// a "hint" as to what an embedded region should be evaluated
-	private String fEmbeddedHint = UNDEFINED;
-	// 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 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 name of the current tag inside of an embedded region
-	private String internalTagName = null;
-	private String internalContext = null;
-
-	// the list of tag name BlockMarkers
-	private List fBlockMarkers = new ArrayList(0);
-	private List fNestablePrefixes = new ArrayList(1);
-	
-	// where the last internal container block was found
-	private int fLastInternalBlockStart = -1;
-
-	// required to not seek text blocks on an end tag
-	private boolean fIsBlockingEnabled = false;
-	private boolean fIsCaseSensitiveBlocking = true;
-
-	private static final boolean fForbidJSP = false;
-	
-	private int fELlevel = 0;
-
-	private JSPParserRegionFactory fRegionFactory = new JSPParserRegionFactory();
-
-	private static final String rcsver = "$Id: JSPTokenizer.java,v 1.4 2005/08/16 19:03:41 nitind Exp $";//$NON-NLS-1$
-
-	/**
-	 * user method 
-	 */
-	public final void addBlockMarker(BlockMarker marker) {
-		if(containsTagName(marker.getTagName()))
-			return;
-		fBlockMarkers.add(marker);
-	}
-	/**
-	 * user method
-	 */
-	public final void addNestablePrefix(TagMarker marker) {
-		fNestablePrefixes.add(marker);
-	}
-	/* user method */
-	public List getNestablePrefixes() {
-		return fNestablePrefixes;
-	}
-	/**
-	 * user method
-	 */
-	private boolean isNestable(String tagName) {
-		//Iterator blocks = fNestablePrefixes.iterator();
-		//while(blocks.hasNext()) {
-		//	TagMarker marker = (TagMarker)blocks.next();
-		//	String markerName = marker.getTagName();
-		//	if(tagName.length() > markerName.length() + 1 && tagName.startsWith(markerName) && tagName.charAt(markerName.length()) == ':') {
-		//		return marker.isGlobal() || getOffset() >= marker.getMarker().getStart();
-		//	}
-		//}
-		//return false;
-		return true;
-	}
-	/**
-	 * user method 
-	 */
-	public final void removeNestablePrefix(String name) {
-		if (fNestablePrefixes != null) {
-			Iterator nestables = fNestablePrefixes.iterator();
-			while (nestables.hasNext()) {
-				if (((TagMarker) nestables.next()).getTagName().equalsIgnoreCase(name))
-					nestables.remove();
-			}
-		}
-	}
-	/**
-	 * 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 */
-	private final void assembleEmbeddedTagSequence(String startType, String endTagName) {
-		assembleEmbeddedContainer(startType, null, endTagName);
-	}
-	/* user method */
-	private final void assembleEmbeddedContainer(String startType, String[] endTypes) {
-		assembleEmbeddedContainer(startType, endTypes, null);
-	}
-	/* user method */
-	private final void assembleEmbeddedContainer(String startType, String endType) {
-		assembleEmbeddedContainer(startType, new String[]{endType}, null);
-	}
-	/**
-	 *  user method 
-	 * 
-	 * Assembles an embedded container beginning with the given startType as
-	 * the first ContextRegion within it and of the type fEmbeddedHint.  The
-	 * endTypes[] array contains the context types that will cause a successful
-	 * exit.  Use of the endTagName parameter alters this behavior to force an
-	 * exit on an XML_TAG_CLOSE after seeing an XML_TAG_NAME whose significant
-	 * text matches the endTagName String.  All contents in between are
-	 * insignificant, and yes, this means comments are allowed inside.
-	 **/
-	private final void assembleEmbeddedContainer(String startType, String[] endTypes, String endTagName) {
-		// the context of the region being added to the embedded container
-		internalContext = startType;
-		// keep track of where this container began; to provide relative indeces for the regions
-		int containerStart = yychar;
-		boolean notFinished = true;
-		// keep track of where we seem to be so that the endTagName can be checked
-		boolean isInEndTag = false;
-		boolean isInFirstTag = true;
-		// create the embedded container and setup its "type"
-		if (fEmbeddedContainer == null) {
-			fEmbeddedContainer = new ContextRegionContainer();
-			fEmbeddedContainer.setType(fEmbeddedHint);
-			fEmbeddedContainer.setStart(containerStart);
-			// TODO: parent region needs to be set .... but not sure where to get it from 
-			//		fEmbeddedContainer.setParent(parentRegion);
-		}
-		containerStart = fEmbeddedContainer.getStart();
-		while (notFinished) {
-			// add the region to the container
-			if (internalContext != null && internalContext != PROXY_CONTEXT) {
-				ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
-				fEmbeddedContainer.getRegions().add(newToken);
-				fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
-				fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
-				// DW, 4/16/2003 token regions no longer have parents
-				//newToken.setParent(fEmbeddedContainer);
-			}
-			try {
-				// longscan determines whether to attempt a blockTagScan within the embedded container
-				boolean longscan = false;
-				// save the tokenizer state in case of a block tag scan
-				int previousState = yystate();
-				String previousCurrentTagName = fCurrentTagName;
-				int previousPostState = fEmbeddedPostState;
-				String previousEmbeddedHint = fEmbeddedHint;
-				// determine if a block tag scan is necessary
-				if (internalContext == XML_TAG_NAME) {
-					internalTagName = yytext();
-					if(!isNestable(internalTagName)) {
-						internalTagName = null;
-						// snagged a tag name we shouldn't have
-						fEmbeddedPostState = ST_ABORT_EMBEDDED;
-						notFinished = false;
-					}
-				}
-				else if (internalContext == XML_TAG_OPEN || internalContext == XML_END_TAG_OPEN) {
-					internalTagName = null;
-				}
-				// do upkeep for endTagName usage; must be here since the next token could be the close
-				if (internalContext == XML_END_TAG_OPEN) {
-					isInEndTag = true;
-				} else if (internalContext == XML_TAG_CLOSE) {
-					isInFirstTag = isInEndTag = false;
-				} else {
-				 	ITextRegionList embeddedRegions = fEmbeddedContainer.getRegions();
-					if (embeddedRegions.size() > 2 && (embeddedRegions.get(embeddedRegions.size()-1)).getType() == XML_TAG_CLOSE && (embeddedRegions.get(embeddedRegions.size() - 3)).getType() == XML_TAG_OPEN && internalTagName != null) {
-						if (containsTagName(internalTagName)) {
-							longscan = true;
-							yybegin(ST_BLOCK_TAG_SCAN);
-						}
-					}
-				}
-				if (longscan)
-					fCurrentTagName = internalTagName;
-				// read the next region and context
-				internalContext = primGetNextToken();
-				if (longscan) {
-					// Returning from a block tag scan requires restoring some state variables
-					// as well as handling the block region and setting up for normal scanning
-					// inside the embedded container
-					ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
-					fEmbeddedContainer.getRegions().add(newToken);
-					fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
-					fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
-					// DW, 4/16/2003 token regions no longer have parents
-					// newToken.setParent(fEmbeddedContainer);
-					longscan = false;
-					fEmbeddedPostState = previousPostState;
-					fEmbeddedHint = previousEmbeddedHint;
-					fCurrentTagName = previousCurrentTagName;
-					yybegin(previousState);
-					internalContext = primGetNextToken();
-				}
-			} catch (IOException e) {
-				// primGetNextToken() calls may throw an IOException
-				// catch and do nothing since the isEOF check below
-				// will properly exit if the input was too short
-			} catch (Exception f) {
-				// some other exception happened; never should
-				Logger.logException(f);
-			}
-			boolean isEndingType = yystate() == ST_ABORT_EMBEDDED;
-			if(!isEndingType) {
-				// check for ending context
-				if (endTagName == null) {
-					for (int i = 0; i < endTypes.length; i++) {
-						isEndingType = isEndingType || (internalContext == endTypes[i]);
-					}
-				}
-				else {
-					isEndingType = ((isInEndTag && internalContext == XML_TAG_CLOSE) || (isInFirstTag && internalContext == XML_EMPTY_TAG_CLOSE)) && internalTagName != null && internalTagName.equals(endTagName);
-				}
-			}
-			ITextRegionList embeddedList = fEmbeddedContainer.getRegions();
-			notFinished = notFinished && ((!isEndingType) && !isEOF() && (endTagName != null || internalContext != UNDEFINED) && !(internalContext == PROXY_CONTEXT && (embeddedList.get(embeddedList.size()-1)).getType() == UNDEFINED));
-		}
-		// finish adding the last context
-		if (internalContext != null && internalContext != PROXY_CONTEXT) {
-			ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
-			fEmbeddedContainer.getRegions().add(newToken);
-			// DW, 4/16/2003 token regions no longer have parents
-			//newToken.setParent(fEmbeddedContainer);
-			fEmbeddedContainer.setLength(yychar - containerStart + yylength());
-			fEmbeddedContainer.setTextLength(yychar - containerStart + yylength());
-		}
-		yybegin(fEmbeddedPostState);
-	}
-	/* user method */
-	public final boolean isCaseSensitiveBlocking() {
-		return fIsCaseSensitiveBlocking;
-	}
-	/* user method */
-	public final void setCaseSensitiveBlocking(boolean newValue) {
-		fIsCaseSensitiveBlocking = newValue;
-	}
-	/* user method */
-	public boolean getBlockMarkerAllowsJSP() {
-		return getBlockMarkerAllowsJSP(fCurrentTagName);
-	}
-	/* user method */
-	public boolean getBlockMarkerAllowsJSP(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 marker.allowsJSP();
-			else if(!casesensitive && marker.getTagName().equalsIgnoreCase(name))
-				return marker.allowsJSP();
-		}
-		return true;
-	}
-	/* user method */
-	public boolean getBlockMarkerCaseSensitivity() {
-		return getBlockMarkerCaseSensitivity(fCurrentTagName);
-	}
-	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 allowJSP - check for and allow for JSP markup <%%>
- * @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, 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)
-			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) {
-				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));
-					}
-				}
-				// 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 
- * does a lookahead for the current tag name
- */
-private final String doBlockTagScan() throws IOException {
-	fIsCaseSensitiveBlocking = getBlockMarkerCaseSensitivity();
-	return doScan("</" + fCurrentTagName, true, getBlockMarkerAllowsJSP(), 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 {
-		fEmbeddedContainer = null;
-		// load the starting non-whitespace token (assume that it is so)
-		if (fShouldLoadBuffered) {
-			if (fBufferedEmbeddedContainer != null) {
-				ITextRegion container = fBufferedEmbeddedContainer;
-				fBufferedEmbeddedContainer = null;
-				fShouldLoadBuffered = false;
-				return container;
-			}
-			context = fBufferedContext;
-			start = fBufferedStart;
-			textLength = length = fBufferedLength;
-			fShouldLoadBuffered = false;
-		} else {
-			context = primGetNextToken();
-			if (context == PROXY_CONTEXT) {
-				return fEmbeddedContainer;
-			} else if (context == XML_TAG_NAME || f_context == JSP_ROOT_TAG_NAME || f_context == JSP_DIRECTIVE_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 == PROXY_CONTEXT) {
-			fBufferedEmbeddedContainer = fEmbeddedContainer;
-			fShouldLoadBuffered = true;
-		} else if (f_context == XML_TAG_NAME || f_context == JSP_ROOT_TAG_NAME || f_context == JSP_DIRECTIVE_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 JSPTokenizer(){
-		super();
-	}
-	/* user method */
-	public JSPTokenizer(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();
-	
-		fLastInternalBlockStart = -1;
-	
-		context = null;
-		start = 0;
-		textLength = 0;
-		length = 0;
-	
-		fEmbeddedContainer = null;
-		
-		fELlevel = 0;
-	}
-	/**
-	 * user method
-	 *
-	 */
-	public BlockTokenizer newInstance() {
-		JSPTokenizer newInstance = new JSPTokenizer();
-		// 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);
-		}
-		for(int i = 0; i < fNestablePrefixes.size(); i++) {
-			TagMarker marker = (TagMarker) fNestablePrefixes.get(i);
-			if(marker.isGlobal())
-				newInstance.addNestablePrefix(marker);
-		}
-		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, true, true, XML_COMMENT_TEXT, ST_XML_COMMENT_END, ST_XML_COMMENT_END);
-	}
-	/* user method */
-	private final String scanJSPCommentText() throws IOException {
-		// Scan for '--%>' and return the text up to that point as
-		//   JSP_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
-		//  case change to the ST_JSP_COMMENT_END state and return the next
-		//  context as usual.
-		return doScan("--%>", false, false, true, JSP_COMMENT_TEXT, ST_JSP_COMMENT_END, ST_JSP_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 JSPTokenizer(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 JSPTokenizer(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[28900];
-    int i = 0;  /* index in packed string  */
-    int j = 0;  /* index in unpacked array */
-    while (i < 7180) {
-      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 < 1376) {
-      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;
-
-    yy_pushbackPos = -1;
-    boolean yy_was_pushback;
-
-    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_was_pushback = false;
-
-      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 & 2) > 0 )
-            yy_pushbackPos = yy_currentPos;
-
-          if ( (yy_attributes & 1) > 0 ) {
-            yy_was_pushback = (yy_attributes & 4) > 0;
-            yy_action = yy_state; 
-            yy_markedPos = yy_currentPos; 
-            if ( (yy_attributes & 8) > 0 ) break yy_forAction;
-          }
-
-        }
-      }
-
-      if (yy_was_pushback)
-        yy_markedPos = yy_pushbackPos;
-
-      switch (yy_action) {    
-
-        case 578: 
-        case 583: 
-        case 590: 
-        case 595: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("jsp directive tag name");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return JSP_DIRECTIVE_NAME;
- }
-        case 611: break;
-        case 542: 
-        case 544: 
-        case 545: 
-        case 546: 
-        case 547: 
-        case 548: 
-        case 549: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nCDATA start");//$NON-NLS-1$
-	fStateStack.push(yystate());
-	yybegin(ST_CDATA_TEXT);
-	return XML_CDATA_OPEN;
- }
-        case 612: break;
-        case 534: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("jsp:root tag name");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return JSP_ROOT_TAG_NAME;
- }
-        case 613: break;
-        case 526: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("element");//$NON-NLS-1$
-	yybegin(ST_XML_ELEMENT_DECLARATION);
-	return XML_ELEMENT_DECLARATION;
- }
-        case 614: break;
-        case 525: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attlist");//$NON-NLS-1$
-	yybegin(ST_XML_ATTLIST_DECLARATION);
-	return XML_ATTLIST_DECLARATION;
- }
-        case 615: break;
-        case 524: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_DECLARATION);
-	return XML_DOCTYPE_DECLARATION;
- }
-        case 616: break;
-        case 510: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype external id");//$NON-NLS-1$
-	fEmbeddedHint = XML_DOCTYPE_EXTERNAL_ID_PUBREF;
-	yybegin(ST_XML_DOCTYPE_ID_PUBLIC);
-	return XML_DOCTYPE_EXTERNAL_ID_PUBLIC;
- }
-        case 617: break;
-        case 509: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype external id");//$NON-NLS-1$
-	fEmbeddedHint = XML_DOCTYPE_EXTERNAL_ID_SYSREF;
-	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
-	return XML_DOCTYPE_EXTERNAL_ID_SYSTEM;
- }
-        case 618: break;
-        case 503: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction target");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_DHTML_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
- }
-        case 619: break;
-        case 481: 
-        case 519: 
-        case 520: 
-          { 
-	return JSP_VBL_QUOTED_CONTENT;
- }
-        case 620: break;
-        case 476: 
-        case 515: 
-        case 516: 
-          { 
-	return JSP_EL_QUOTED_CONTENT;
- }
-        case 621: break;
-        case 472: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nJSP comment close");//$NON-NLS-1$
-	yybegin(YYINITIAL);
-	return JSP_COMMENT_CLOSE;
- }
-        case 622: break;
-        case 471: 
-          { 
-	yybegin(ST_JSP_COMMENT);
-	assembleEmbeddedContainer(JSP_COMMENT_OPEN, JSP_COMMENT_CLOSE);
-	if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN)
-		yybegin(ST_BLOCK_TAG_SCAN);
-	return PROXY_CONTEXT;
- }
-        case 623: break;
-        case 460: 
-          { 
-	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-	}
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	fStateStack.push(yystate());
-	if(yylength() > 2)
-		yypushback(yylength() -2);
-	if(Debug.debugTokenizer)
-		dump("VBL in attr value");//$NON-NLS-1$
-	yybegin(ST_JSP_VBL);
-	fELlevel++;
-	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE});
-	fStateStack.pop();
-	yybegin(ST_XML_ATTRIBUTE_NAME);
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-	return PROXY_CONTEXT;
- }
-        case 624: break;
-        case 459: 
-          { 
-	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-	}
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	fStateStack.push(yystate());
-	if(yylength() > 2)
-		yypushback(yylength() -2);
-	if(Debug.debugTokenizer)
-		dump("EL in attr value");//$NON-NLS-1$
-	yybegin(ST_JSP_EL);
-	fELlevel++;
-	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE});
-	fStateStack.pop();
-	yybegin(ST_XML_ATTRIBUTE_NAME);
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-	return PROXY_CONTEXT;
- }
-        case 625: break;
-        case 454: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nCharRef");//$NON-NLS-1$
-	return XML_CHAR_REFERENCE;
- }
-        case 626: break;
-        case 451: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\ncomment start");//$NON-NLS-1$
-	fEmbeddedHint = XML_COMMENT_TEXT;
-	fEmbeddedPostState = ST_XML_COMMENT;
-	yybegin(ST_XML_COMMENT);
-	return XML_COMMENT_OPEN;
- }
-        case 627: break;
-        case 450: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nJSP comment start");//$NON-NLS-1$
-	yybegin(ST_JSP_COMMENT);
-	return JSP_COMMENT_OPEN;
- }
-        case 628: break;
-        case 383: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction target");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_XML_PI_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
- }
-        case 629: break;
-        case 382: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("comment end");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-	yybegin(YYINITIAL);
-	return XML_COMMENT_CLOSE;
- }
-        case 630: break;
-        case 381: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("CDATA end");//$NON-NLS-1$
-	yybegin(fStateStack.pop());
-	return XML_CDATA_CLOSE;
- }
-        case 631: break;
-        case 380: 
-          { 
-	yybegin(ST_JSP_VBL);
-	if(yylength() > 2)
-		yypushback(yylength() - 2);
-	fELlevel++;
-	fEmbeddedHint = XML_CONTENT;
-	fEmbeddedPostState = YYINITIAL;
-	assembleEmbeddedContainer(JSP_VBL_OPEN, JSP_VBL_CLOSE);
-	fEmbeddedHint = XML_CONTENT;
-	yybegin(YYINITIAL);
-	return PROXY_CONTEXT;
- }
-        case 632: break;
-        case 379: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nPEReference");//$NON-NLS-1$
-	return XML_PE_REFERENCE;
- }
-        case 633: break;
-        case 378: 
-          { 
-	yybegin(ST_JSP_EL);
-	if(yylength() > 2)
-		yypushback(yylength() - 2);
-	fELlevel++;
-	fEmbeddedHint = XML_CONTENT;
-	fEmbeddedPostState = YYINITIAL;
-	assembleEmbeddedContainer(JSP_EL_OPEN, JSP_EL_CLOSE);
-	fEmbeddedHint = XML_CONTENT;
-	yybegin(YYINITIAL);
-	return PROXY_CONTEXT;
- }
-        case 634: break;
-        case 375: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nEntityRef");//$NON-NLS-1$
-	return XML_ENTITY_REFERENCE;
- }
-        case 635: break;
-        case 369: 
-        case 406: 
-        case 412: 
-        case 418: 
-        case 421: 
-        case 424: 
-        case 427: 
-        case 431: 
-        case 435: 
-        case 437: 
-        case 440: 
-        case 443: 
-        case 447: 
-          { 
-	/* JSP expression begun (anywhere)
-	 * A consequence of the start anywhere possibility is that the
-	 *  incoming state must be checked to see if it's erroneous
-	 *  due to the order of precedence generated
-	 */
-	// begin sanity checks
-	if(yystate() == ST_JSP_CONTENT) {
-		// at the beginning?!
-		yypushback(2);
-		return JSP_CONTENT;
-	}
-	else if(yystate() == ST_BLOCK_TAG_SCAN) {
-		yypushback(3);
-		return doBlockTagScan();
-	}
-	else if(yystate() == ST_XML_COMMENT) {
-		yypushback(3);
-		return scanXMLCommentText();
-	}
-	else if(yystate() == ST_JSP_COMMENT) {
-		yypushback(3);
-		return scanJSPCommentText();
-	}
-	// end sanity checks
-	fStateStack.push(yystate());
-	if(fStateStack.peek()==YYINITIAL) {
-		// the simple case, just an expression out in content
-		if(Debug.debugTokenizer)
-			dump("\nJSP expression start");//$NON-NLS-1$
-		yybegin(ST_JSP_CONTENT);
-		return JSP_EXPRESSION_OPEN;
-	}
-	else {
-		if (Debug.debugTokenizer) {
-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-		}
-		if(Debug.debugTokenizer)
-			dump("JSP expression start");//$NON-NLS-1$
-		if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
-		else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
-		else if(yystate() == ST_CDATA_TEXT) {
-			fEmbeddedPostState = ST_CDATA_TEXT;
-			fEmbeddedHint = XML_CDATA_TEXT;
-		}
-		yybegin(ST_JSP_CONTENT);
-		assembleEmbeddedContainer(JSP_EXPRESSION_OPEN, JSP_CLOSE);
-		if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
-			yybegin(ST_BLOCK_TAG_SCAN);
-			return BLOCK_TEXT;
-		}
-		// required help for successive embedded regions
-		if(yystate() == ST_XML_TAG_NAME) {
-			fEmbeddedHint = XML_TAG_NAME;
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-		}
-		else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
-			fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-			fEmbeddedPostState = ST_XML_EQUALS;
-		}
-		else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
-			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-		}
-		return PROXY_CONTEXT;
-	}
- }
-        case 636: break;
-        case 368: 
-        case 405: 
-        case 411: 
-        case 417: 
-        case 420: 
-        case 423: 
-        case 426: 
-        case 430: 
-        case 434: 
-        case 436: 
-        case 439: 
-        case 442: 
-        case 446: 
-          { 
-	/* JSP declaration begun (anywhere)
-	 * A consequence of the start anywhere possibility is that the
-	 *  incoming state must be checked to see if it's erroneous
-	 *  due to the order of precedence generated
-	 */
-	// begin sanity checks
-	if(yystate() == ST_JSP_CONTENT) {
-		// at the beginning?!
-		yypushback(2);
-		return JSP_CONTENT;
-	}
-	else if(yystate() == ST_BLOCK_TAG_SCAN) {
-		yypushback(3);
-		return doBlockTagScan();
-	}
-	else if(yystate() == ST_XML_COMMENT) {
-		yypushback(3);
-		return scanXMLCommentText();
-	}
-	else if(yystate() == ST_JSP_COMMENT) {
-		yypushback(3);
-		return scanJSPCommentText();
-	}
-	// end sanity checks
-	fStateStack.push(yystate());
-	if(fStateStack.peek()==YYINITIAL) {
-		// the simple case, just a declaration out in content
-		if(Debug.debugTokenizer)
-			dump("\nJSP declaration start");//$NON-NLS-1$
-		yybegin(ST_JSP_CONTENT);
-		return JSP_DECLARATION_OPEN;
-	}
-	else {
-		if (Debug.debugTokenizer) {
-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-		}
-		if(Debug.debugTokenizer)
-			dump("JSP declaration start");//$NON-NLS-1$
-		if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
-		else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
-		else if(yystate() == ST_CDATA_TEXT) {
-			fEmbeddedPostState = ST_CDATA_TEXT;
-			fEmbeddedHint = XML_CDATA_TEXT;
-		}
-		yybegin(ST_JSP_CONTENT);
-		assembleEmbeddedContainer(JSP_DECLARATION_OPEN, JSP_CLOSE);
-		if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
-			yybegin(ST_BLOCK_TAG_SCAN);
-			return BLOCK_TEXT;
-		}
-		// required help for successive embedded regions
-		if(yystate() == ST_XML_TAG_NAME) {
-			fEmbeddedHint = XML_TAG_NAME;
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-		}
-		else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
-			fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-			fEmbeddedPostState = ST_XML_EQUALS;
-		}
-		else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
-			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-		}
-		return PROXY_CONTEXT;
-	}
- }
-        case 637: break;
-        case 367: 
-          { 
-	fStateStack.push(yystate());
-	if(fStateStack.peek()==YYINITIAL) {
-		if(Debug.debugTokenizer)
-			dump("\nJSP directive start");//$NON-NLS-1$
-		yybegin(ST_JSP_DIRECTIVE_NAME);
-		return JSP_DIRECTIVE_OPEN;
-	}
-	else {
-		if (Debug.debugTokenizer) {
-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-		}
-		if(Debug.debugTokenizer)
-			dump("JSP directive start");//$NON-NLS-1$
-		yybegin(ST_JSP_DIRECTIVE_NAME);
-		assembleEmbeddedContainer(JSP_DIRECTIVE_OPEN, new String[]{JSP_DIRECTIVE_CLOSE, JSP_CLOSE});
-		if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
-			yybegin(ST_BLOCK_TAG_SCAN);
-			return BLOCK_TEXT;
-		}
-		return PROXY_CONTEXT;
-	}
- }
-        case 638: break;
-        case 357: 
-          { 
-	yybegin(ST_JSP_VBL_DQUOTES_END);
-	return JSP_VBL_QUOTED_CONTENT;
- }
-        case 639: break;
-        case 353: 
-          { 
-	yybegin(ST_JSP_VBL_SQUOTES_END);
-	return JSP_VBL_QUOTED_CONTENT;
- }
-        case 640: break;
-        case 351: 
-          { 
-	fELlevel++;
-	if(fELlevel == 1) {
-		return JSP_VBL_OPEN;
-	}
- }
-        case 641: break;
-        case 341: 
-          { 
-	yybegin(ST_JSP_EL_DQUOTES_END);
-	return JSP_EL_QUOTED_CONTENT;
- }
-        case 642: break;
-        case 337: 
-          { 
-	yybegin(ST_JSP_EL_SQUOTES_END);
-	return JSP_EL_QUOTED_CONTENT;
- }
-        case 643: break;
-        case 335: 
-          { 
-	//System.out.println(JSP_EL_CONTENT+ ":[" + yytext() + "]");
-	return JSP_EL_CONTENT;
- }
-        case 644: break;
-        case 334: 
-          { 
-	fELlevel++;
-	if(fELlevel == 1) {
-		return JSP_EL_OPEN;
-	}
- }
-        case 645: break;
-        case 331: 
-          { 
-	int enterState = yystate();
-	yybegin(ST_JSP_DQUOTED_VBL);
-	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_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)) {
-		yybegin(ST_ABORT_EMBEDDED);
-		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	}
-	else {
-		yybegin(enterState);
-	}
-	return PROXY_CONTEXT;
- }
-        case 646: break;
-        case 330: 
-          { 
-	int enterState = yystate();
-	yybegin(ST_JSP_DQUOTED_EL);
-	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_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)) {
-		yybegin(ST_ABORT_EMBEDDED);
-		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	}
-	else {
-		yybegin(enterState);
-	}
-	return PROXY_CONTEXT;
- }
-        case 647: break;
-        case 328: 
-          { 
-	int enterState = yystate();
-	yybegin(ST_JSP_SQUOTED_VBL);
-	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_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)) {
-		yybegin(ST_ABORT_EMBEDDED);
-		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	}
-	else {
-		yybegin(enterState);
-	}
-	return PROXY_CONTEXT;
- }
-        case 648: break;
-        case 327: 
-          { 
-	int enterState = yystate();
-	yybegin(ST_JSP_SQUOTED_EL);
-	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_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)) {
-		yybegin(ST_ABORT_EMBEDDED);
-		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	}
-	else {
-		yybegin(enterState);
-	}
-	return PROXY_CONTEXT;
- }
-        case 649: break;
-        case 326: 
-          { 
-	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-	}
-	int incomingState = yystate();
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	if(Debug.debugTokenizer)
-		dump("JSP attribute value start - end tag");//$NON-NLS-1$
-	yybegin(ST_XML_TAG_NAME);
-	assembleEmbeddedContainer(XML_END_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
-	if(yystate() != ST_ABORT_EMBEDDED)
-        yybegin(incomingState);
-	return PROXY_CONTEXT;
- }
-        case 650: break;
-        case 284: 
-        case 296: 
-        case 302: 
-          { 
-	return XML_DOCTYPE_INTERNAL_SUBSET;
- }
-        case 651: break;
-        case 272: 
-          { 
-	String tagName = yytext().substring(1);
-	// pushback to just after the opening bracket
-	yypushback(yylength() - 1);
-	if(!isNestable(tagName)) {
-		yybegin(ST_XML_TAG_NAME);
-		return XML_TAG_OPEN;
-	}
-	if(Debug.debugTokenizer)
-		dump("tag in place of attr value");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	fStateStack.push(yystate());
-	// embedded container should be looking for the name (again) next
-	yybegin(ST_XML_TAG_NAME);
-	assembleEmbeddedTagSequence(XML_TAG_OPEN, tagName); // ?
-	fStateStack.pop();
-	yybegin(ST_XML_ATTRIBUTE_NAME);
-	return PROXY_CONTEXT;
- }
-        case 652: break;
-        case 270: 
-          { 
-	String tagName = yytext().substring(1);
-	// pushback to just after the opening bracket
-	yypushback(yylength() - 1);
-	if(!isNestable(tagName)) {
-		yybegin(ST_XML_TAG_NAME);
-		return XML_TAG_OPEN;
-	}
-	if(Debug.debugTokenizer)
-		dump("tag in place of attr name");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	fStateStack.push(yystate());
-	// embedded container should be looking for the name (again) next
-	yybegin(ST_XML_TAG_NAME);
-	assembleEmbeddedTagSequence(XML_TAG_OPEN, tagName); // ?
-	fStateStack.pop();
-	yybegin(ST_XML_EQUALS);
-	return PROXY_CONTEXT;
- }
-        case 653: break;
-        case 268: 
-          { 
-        yybegin(YYINITIAL);
-	fEmbeddedHint = UNDEFINED;
-	if(Debug.debugTokenizer)
-		dump("empty tag close");//$NON-NLS-1$
-        return XML_EMPTY_TAG_CLOSE;
- }
-        case 654: break;
-        case 125: 
-          { 
-	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-	}
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
-	yybegin(ST_XML_ATTRIBUTE_VALUE_DQUOTED);
-	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);
-	fStateStack.pop();
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-	yybegin(ST_XML_ATTRIBUTE_NAME);
-	return PROXY_CONTEXT;
- }
-        case 655: break;
-        case 123: 
-          { 
-	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-	}
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	fStateStack.push(yystate());
-	if(Debug.debugTokenizer)
-		dump("JSP tag embedded name start - start tag");//$NON-NLS-1$
-	yybegin(ST_XML_TAG_NAME);
-	assembleEmbeddedContainer(XML_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
-	fStateStack.pop();
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-	return PROXY_CONTEXT;
- }
-        case 656: break;
-        case 122: 
-        case 127: 
-        case 128: 
-        case 274: 
-        case 278: 
-        case 279: 
-        case 388: 
-        case 391: 
-        case 458: 
-          { 
-	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 657: break;
-        case 121: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("equals");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-        yybegin(ST_XML_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
- }
-        case 658: break;
-        case 120: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attr name");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-        yybegin(ST_XML_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
- }
-        case 659: break;
-        case 116: 
-        case 117: 
-        case 118: 
-        case 269: 
-        case 387: 
-        case 457: 
-        case 485: 
-        case 486: 
-        case 504: 
-        case 505: 
-        case 522: 
-        case 523: 
-        case 535: 
-        case 543: 
-        case 550: 
-        case 551: 
-        case 552: 
-        case 553: 
-        case 555: 
-        case 561: 
-        case 562: 
-        case 563: 
-        case 564: 
-        case 565: 
-        case 571: 
-        case 572: 
-        case 573: 
-        case 574: 
-        case 575: 
-        case 581: 
-        case 582: 
-        case 584: 
-        case 585: 
-        case 591: 
-        case 592: 
-        case 593: 
-        case 594: 
-        case 600: 
-        case 601: 
-        case 602: 
-        case 603: 
-        case 606: 
-        case 607: 
-        case 609: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("tag name");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
- }
-        case 660: break;
-        case 114: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("tag close");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-	if(isBlockMarker()) {
-		fEmbeddedHint = getBlockMarkerContext();
-		fEmbeddedPostState = ST_BLOCK_TAG_SCAN;
-        	yybegin(ST_BLOCK_TAG_SCAN);
-	}
-	else
-        	yybegin(YYINITIAL);
-        return XML_TAG_CLOSE;
- }
-        case 661: break;
-        case 107: 
-        case 111: 
-        case 264: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attr value");//$NON-NLS-1$
-        yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 662: break;
-        case 106: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("equals");//$NON-NLS-1$
-        yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
- }
-        case 663: break;
-        case 105: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attr name");//$NON-NLS-1$
-        yybegin(ST_JSP_DIRECTIVE_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
- }
-        case 664: break;
-        case 102: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("JSP directive name");//$NON-NLS-1$
-	yybegin(ST_JSP_DIRECTIVE_NAME_WHITESPACE);
-	return JSP_DIRECTIVE_NAME;
- }
-        case 665: break;
-        case 98: 
-        case 99: 
-        case 100: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("JSP code content");//$NON-NLS-1$
-	return doScan("%>", false, false, false, JSP_CONTENT, ST_JSP_CONTENT, ST_JSP_CONTENT);
- }
-        case 666: break;
-        case 94: 
-        case 96: 
-        case 97: 
-        case 254: 
-        case 255: 
-        case 258: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction attribute value");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_DHTML_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 667: break;
-        case 93: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction '='");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-        yybegin(ST_DHTML_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
- }
-        case 668: break;
-        case 92: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction attribute name");//$NON-NLS-1$
-        yybegin(ST_DHTML_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
- }
-        case 669: break;
-        case 90: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction end");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 670: break;
-        case 84: 
-        case 86: 
-        case 245: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction attribute value");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_XML_PI_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 671: break;
-        case 83: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction '='");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-        yybegin(ST_XML_PI_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
- }
-        case 672: break;
-        case 50: 
-        case 200: 
-        case 201: 
-        case 204: 
-        case 214: 
-        case 215: 
-        case 218: 
-        case 219: 
-        case 362: 
-        case 365: 
-          { 
-	return JSP_VBL_CONTENT;
- }
-        case 673: break;
-        case 43: 
-        case 179: 
-        case 180: 
-        case 183: 
-        case 193: 
-        case 194: 
-        case 197: 
-        case 198: 
-        case 332: 
-        case 346: 
-        case 349: 
-        case 416: 
-          { 
-	return JSP_EL_CONTENT;
- }
-        case 674: break;
-        case 35: 
-        case 159: 
-        case 160: 
-        case 322: 
-        case 413: 
-        case 470: 
-        case 493: 
-        case 512: 
-        case 528: 
-        case 537: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attlist contentspec");//$NON-NLS-1$
-	return XML_ATTLIST_DECL_CONTENT;
- }
-        case 675: break;
-        case 33: 
-        case 152: 
-        case 153: 
-        case 312: 
-        case 407: 
-        case 468: 
-        case 492: 
-        case 511: 
-        case 527: 
-        case 536: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("elementdecl contentspec");//$NON-NLS-1$
-	return XML_ELEMENT_DECL_CONTENT;
- }
-        case 676: break;
-        case 22: 
-        case 112: 
-          { 
-	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;
-	}
-	yybegin(YYINITIAL);
-        return XML_CONTENT;
- }
-        case 677: break;
-        case 18: 
-        case 104: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("white space");//$NON-NLS-1$
-	yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_NAME);
-	return WHITE_SPACE;
- }
-        case 678: break;
-        case 5: 
-        case 8: 
-        case 9: 
-        case 10: 
-        case 12: 
-        case 13: 
-        case 14: 
-        case 15: 
-        case 17: 
-        case 19: 
-        case 20: 
-        case 21: 
-        case 23: 
-        case 24: 
-        case 25: 
-        case 26: 
-        case 27: 
-        case 28: 
-        case 29: 
-        case 30: 
-        case 31: 
-        case 32: 
-        case 34: 
-        case 40: 
-        case 41: 
-        case 73: 
-        case 170: 
-        case 175: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("white space");//$NON-NLS-1$
-        return WHITE_SPACE;
- }
-        case 679: break;
-        case 0: 
-        case 57: 
-        case 60: 
-        case 62: 
-        case 226: 
-        case 228: 
-        case 229: 
-        case 231: 
-        case 233: 
-        case 372: 
-        case 373: 
-        case 374: 
-        case 453: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nXML content");//$NON-NLS-1$
-	return XML_CONTENT;
- }
-        case 680: break;
-        case 58: 
-        case 101: 
-        case 113: 
-        case 119: 
-        case 129: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nstart tag open");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_NAME;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-        yybegin(ST_XML_TAG_NAME);
-        return XML_TAG_OPEN;
- }
-        case 681: break;
-        case 59: 
-        case 61: 
-        case 65: 
-        case 66: 
-        case 67: 
-        case 71: 
-        case 72: 
-        case 81: 
-        case 85: 
-        case 87: 
-        case 88: 
-        case 89: 
-        case 91: 
-        case 95: 
-        case 103: 
-        case 108: 
-        case 109: 
-        case 110: 
-        case 115: 
-        case 124: 
-        case 131: 
-        case 132: 
-        case 133: 
-        case 134: 
-        case 136: 
-        case 137: 
-        case 139: 
-        case 140: 
-        case 141: 
-        case 144: 
-        case 145: 
-        case 146: 
-        case 149: 
-        case 150: 
-        case 151: 
-        case 156: 
-        case 157: 
-        case 158: 
-        case 164: 
-        case 167: 
-        case 172: 
-        case 173: 
-        case 177: 
-        case 178: 
-        case 185: 
-        case 186: 
-        case 188: 
-        case 189: 
-        case 195: 
-        case 199: 
-        case 206: 
-        case 207: 
-        case 209: 
-        case 210: 
-        case 216: 
-        case 220: 
-          { 
-	if (Debug.debugTokenizer)
-		System.out.println("!!!unexpected!!!: \"" + yytext() + "\":" + //$NON-NLS-2$//$NON-NLS-1$
-			yychar + "-" + (yychar + yylength()));//$NON-NLS-1$
-	return UNDEFINED;
- }
-        case 682: break;
-        case 63: 
-        case 64: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("CDATA text");//$NON-NLS-1$
-	fEmbeddedPostState = ST_CDATA_TEXT;
-	fEmbeddedHint = XML_CDATA_TEXT;
-	String returnedContext = doScan("]]>", false, true, true, XML_CDATA_TEXT, ST_CDATA_END,  ST_CDATA_END);//$NON-NLS-1$
-	if(returnedContext == XML_CDATA_TEXT)
-		yybegin(ST_CDATA_END);
-	return returnedContext;
- }
-        case 683: break;
-        case 68: 
-        case 187: 
-        case 190: 
-        case 208: 
-        case 211: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("LINE FEED");//$NON-NLS-1$
-	return WHITE_SPACE;
- }
-        case 684: break;
-        case 69: 
-        case 70: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("comment content");//$NON-NLS-1$
-	return scanXMLCommentText();
- }
-        case 685: break;
-        case 74: 
-        case 75: 
-        case 76: 
-        case 239: 
-        case 240: 
-        case 384: 
-        case 456: 
-        case 484: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("processing instruction target");//$NON-NLS-1$
-	fEmbeddedHint = XML_CONTENT;
-        yybegin(ST_PI_WS);
-        return XML_TAG_NAME;
- }
-        case 686: break;
-        case 77: 
-          { 
-        yybegin(ST_PI_CONTENT);
-        return WHITE_SPACE;
- }
-        case 687: break;
-        case 78: 
-        case 79: 
-        case 80: 
-          { 
-		// 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 688: break;
-        case 82: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction attribute name");//$NON-NLS-1$
-        yybegin(ST_XML_PI_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
- }
-        case 689: break;
-        case 126: 
-          { 
-	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-	}
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
-	yybegin(ST_XML_ATTRIBUTE_VALUE_SQUOTED);
-	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);
-	fStateStack.pop();
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-	return PROXY_CONTEXT;
- }
-        case 690: break;
-        case 130: 
-          { 
-	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 691: break;
-        case 135: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype type");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_EXTERNAL_ID);
-	return XML_DOCTYPE_NAME;
- }
-        case 692: break;
-        case 138: 
-        case 142: 
-        case 289: 
-        case 293: 
-        case 400: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype public reference");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-	fEmbeddedPostState = YYINITIAL;
-	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
-	return XML_DOCTYPE_EXTERNAL_ID_PUBREF;
- }
-        case 693: break;
-        case 143: 
-        case 147: 
-        case 299: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype system reference");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-	fEmbeddedPostState = YYINITIAL;
-	yybegin(ST_XML_DECLARATION_CLOSE);
-	return XML_DOCTYPE_EXTERNAL_ID_SYSREF;
- }
-        case 694: break;
-        case 148: 
-        case 305: 
-        case 309: 
-        case 403: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("elementdecl name");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-	fEmbeddedPostState = YYINITIAL;
-	yybegin(ST_XML_ELEMENT_DECLARATION_CONTENT);
-	return XML_ELEMENT_DECL_NAME;
- }
-        case 695: break;
-        case 154: 
-          { 
-	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 696: break;
-        case 155: 
-        case 315: 
-        case 319: 
-        case 409: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attlist name");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-	fEmbeddedPostState = YYINITIAL;
-	yybegin(ST_XML_ATTLIST_DECLARATION_CONTENT);
-	return XML_ATTLIST_DECL_NAME;
- }
-        case 697: break;
-        case 161: 
-          { 
-	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 698: break;
-        case 165: 
-        case 166: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nJSP comment text");//$NON-NLS-1$
-	return scanJSPCommentText();
- }
-        case 699: break;
-        case 168: 
-        case 174: 
-          { 
-	return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 700: break;
-        case 169: 
-          { 
-	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-	}
-	int incomingState = yystate();
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	if(Debug.debugTokenizer)
-		dump("tag inside of JSP attribute value start");//$NON-NLS-1$
-	yybegin(ST_XML_TAG_NAME);
-	assembleEmbeddedContainer(XML_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
-	if(yystate() != ST_ABORT_EMBEDDED)
-        yybegin(incomingState);
-	return PROXY_CONTEXT;
- }
-        case 701: break;
-        case 171: 
-          { 
-	return XML_TAG_ATTRIBUTE_VALUE_SQUOTE;
- }
-        case 702: break;
-        case 176: 
-          { 
-	return XML_TAG_ATTRIBUTE_VALUE_DQUOTE;
- }
-        case 703: break;
-        case 181: 
-          { 
-	yybegin(ST_JSP_EL_DQUOTES);
-	return JSP_EL_DQUOTE;
- }
-        case 704: break;
-        case 182: 
-          { 
-	yybegin(ST_JSP_EL_SQUOTES);
-	return JSP_EL_SQUOTE;
- }
-        case 705: break;
-        case 184: 
-          { 
-	fELlevel--;
-	if(fELlevel == 0) {
-		yybegin(YYINITIAL);
-		return JSP_EL_CLOSE;
-	}
-	return JSP_EL_CONTENT;
- }
-        case 706: break;
-        case 191: 
-          { 
-	yybegin(ST_JSP_EL);
-	return JSP_EL_SQUOTE;
- }
-        case 707: break;
-        case 192: 
-          { 
-	yybegin(ST_JSP_EL);
-	return JSP_EL_DQUOTE;
- }
-        case 708: break;
-        case 196: 
-          { 
-	return JSP_EL_CLOSE;
- }
-        case 709: break;
-        case 202: 
-          { 
-	yybegin(ST_JSP_VBL_DQUOTES);
-	return JSP_VBL_DQUOTE;
- }
-        case 710: break;
-        case 203: 
-          { 
-	yybegin(ST_JSP_VBL_SQUOTES);
-	return JSP_VBL_SQUOTE;
- }
-        case 711: break;
-        case 205: 
-          { 
-	fELlevel--;
-	if(fELlevel == 0) {
-		yybegin(YYINITIAL);
-		return JSP_VBL_CLOSE;
-	}
-	return JSP_VBL_CONTENT;
- }
-        case 712: break;
-        case 212: 
-          { 
-	yybegin(ST_JSP_VBL);
-	return JSP_VBL_SQUOTE;
- }
-        case 713: break;
-        case 213: 
-          { 
-	yybegin(ST_JSP_VBL);
-	return JSP_VBL_DQUOTE;
- }
-        case 714: break;
-        case 217: 
-          { 
-	return JSP_VBL_CLOSE;
- }
-        case 715: break;
-        case 221: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nend tag open");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_NAME;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-        yybegin(ST_XML_TAG_NAME);
-        return XML_END_TAG_OPEN;
- }
-        case 716: break;
-        case 222: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nprocessing instruction start");//$NON-NLS-1$
-	yybegin(ST_PI);
-        return XML_PI_OPEN;
- }
-        case 717: break;
-        case 223: 
-        case 234: 
-        case 311: 
-        case 321: 
-        case 323: 
-        case 333: 
-        case 338: 
-        case 342: 
-        case 345: 
-        case 348: 
-        case 350: 
-        case 354: 
-        case 358: 
-        case 361: 
-        case 364: 
-          { 
-	/* JSP scriptlet begun (anywhere)
-	 * A consequence of the start anywhere possibility is that the
-	 *  incoming state must be checked to see if it's erroneous
-	 *  due to the order of precedence generated
-	 */
-	// begin sanity checks
-	if(yystate() == ST_JSP_CONTENT) {
-		// at the beginning?!
-		yypushback(1);
-		return JSP_CONTENT;
-	}
-	else if(yystate() == ST_BLOCK_TAG_SCAN) {
-		yypushback(2);
-		return doBlockTagScan();
-	}
-	else if(yystate() == ST_XML_COMMENT) {
-		yypushback(2);
-		return scanXMLCommentText();
-	}
-	else if(yystate() == ST_JSP_COMMENT) {
-		yypushback(2);
-		return scanJSPCommentText();
-	}
-	// finished sanity checks
-	fStateStack.push(yystate());
-	if(fStateStack.peek()==YYINITIAL) {
-		// the simple case, just a regular scriptlet out in content
-		if(Debug.debugTokenizer)
-			dump("\nJSP scriptlet start");//$NON-NLS-1$
-		yybegin(ST_JSP_CONTENT);
-		return JSP_SCRIPTLET_OPEN;
-	}
-	else {
-		if (Debug.debugTokenizer) {
-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-		}
-		if(Debug.debugTokenizer)
-			dump("JSP scriptlet start");//$NON-NLS-1$
-		if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
-		else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
-		else if(yystate() == ST_CDATA_TEXT) {
-			fEmbeddedPostState = ST_CDATA_TEXT;
-			fEmbeddedHint = XML_CDATA_TEXT;
-		}
-		yybegin(ST_JSP_CONTENT);
-		assembleEmbeddedContainer(JSP_SCRIPTLET_OPEN, JSP_CLOSE);
-		if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
-			yybegin(ST_BLOCK_TAG_SCAN);
-			return BLOCK_TEXT;
-		}
-		// required help for successive embedded regions
-		if(yystate() == ST_XML_TAG_NAME) {
-			fEmbeddedHint = XML_TAG_NAME;
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-		}
-		else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
-			fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-			fEmbeddedPostState = ST_XML_EQUALS;
-		}
-		else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
-			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-		}
-		return PROXY_CONTEXT;
-	}
- }
-        case 718: break;
-        case 224: 
-          { 
-	fStateStack.push(yystate());
-	if(Debug.debugTokenizer)
-		dump("\ndeclaration start");//$NON-NLS-1$
-        yybegin(ST_XML_DECLARATION);
-	return XML_DECLARATION_OPEN;
- }
-        case 719: break;
-        case 238: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("processing instruction end");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 720: break;
-        case 241: 
-          { 
-		// ended with nothing inside
-		fEmbeddedHint = UNDEFINED;
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 721: break;
-        case 242: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction end");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 722: break;
-        case 259: 
-          { 
-	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 723: break;
-        case 261: 
-          { 
-	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 724: break;
-        case 162: 
-        case 163: 
-          { 
-		return doBlockTagScan();
-	 }
-        case 725: 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.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
deleted file mode 100644
index 3e02cc8..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
+++ /dev/null
@@ -1,2557 +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.jst.jsp.core.internal.parser.internal;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-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.ltk.parser.TagMarker;
-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.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.xml.core.internal.parser.ContextRegionContainer;
-import org.eclipse.wst.xml.core.internal.parser.IntStack;
-
-%%
-
-%{
-	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 ContextRegionContainer fBufferedEmbeddedContainer = null;
-	private String f_context = null;
-
-	// state stack for handling embedded regions
-	private IntStack fStateStack = new IntStack();
-	// a "hint" as to what an embedded region should be evaluated
-	private String fEmbeddedHint = UNDEFINED;
-	// 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 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 name of the current tag inside of an embedded region
-	private String internalTagName = null;
-	private String internalContext = null;
-
-	// the list of tag name BlockMarkers
-	private List fBlockMarkers = new ArrayList(0);
-	private List fNestablePrefixes = new ArrayList(1);
-	
-	// where the last internal container block was found
-	private int fLastInternalBlockStart = -1;
-
-	// required to not seek text blocks on an end tag
-	private boolean fIsBlockingEnabled = false;
-	private boolean fIsCaseSensitiveBlocking = true;
-
-	private static final boolean fForbidJSP = false;
-	
-	private int fELlevel = 0;
-
-	private JSPParserRegionFactory fRegionFactory = new JSPParserRegionFactory();
-
-	private static final String rcsver = "$Id: JSPTokenizer.jflex,v 1.4.2.1 2004/10/20 15:21:33 kitlo Exp $";//$NON-NLS-1$
-
-	/**
-	 * user method 
-	 */
-	public final void addBlockMarker(BlockMarker marker) {
-		if(containsTagName(marker.getTagName()))
-			return;
-		fBlockMarkers.add(marker);
-	}
-	/**
-	 * user method
-	 */
-	public final void addNestablePrefix(TagMarker marker) {
-		fNestablePrefixes.add(marker);
-	}
-	/* user method */
-	public List getNestablePrefixes() {
-		return fNestablePrefixes;
-	}
-	/**
-	 * user method
-	 */
-	private boolean isNestable(String tagName) {
-		//Iterator blocks = fNestablePrefixes.iterator();
-		//while(blocks.hasNext()) {
-		//	TagMarker marker = (TagMarker)blocks.next();
-		//	String markerName = marker.getTagName();
-		//	if(tagName.length() > markerName.length() + 1 && tagName.startsWith(markerName) && tagName.charAt(markerName.length()) == ':') {
-		//		return marker.isGlobal() || getOffset() >= marker.getMarker().getStart();
-		//	}
-		//}
-		//return false;
-		return true;
-	}
-	/**
-	 * user method 
-	 */
-	public final void removeNestablePrefix(String name) {
-		if (fNestablePrefixes != null) {
-			Iterator nestables = fNestablePrefixes.iterator();
-			while (nestables.hasNext()) {
-				if (((TagMarker) nestables.next()).getTagName().equalsIgnoreCase(name))
-					nestables.remove();
-			}
-		}
-	}
-	/**
-	 * 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 */
-	private final void assembleEmbeddedTagSequence(String startType, String endTagName) {
-		assembleEmbeddedContainer(startType, null, endTagName);
-	}
-	/* user method */
-	private final void assembleEmbeddedContainer(String startType, String[] endTypes) {
-		assembleEmbeddedContainer(startType, endTypes, null);
-	}
-	/* user method */
-	private final void assembleEmbeddedContainer(String startType, String endType) {
-		assembleEmbeddedContainer(startType, new String[]{endType}, null);
-	}
-	/**
-	 *  user method 
-	 * 
-	 * Assembles an embedded container beginning with the given startType as
-	 * the first ContextRegion within it and of the type fEmbeddedHint.  The
-	 * endTypes[] array contains the context types that will cause a successful
-	 * exit.  Use of the endTagName parameter alters this behavior to force an
-	 * exit on an XML_TAG_CLOSE after seeing an XML_TAG_NAME whose significant
-	 * text matches the endTagName String.  All contents in between are
-	 * insignificant, and yes, this means comments are allowed inside.
-	 **/
-	private final void assembleEmbeddedContainer(String startType, String[] endTypes, String endTagName) {
-		// the context of the region being added to the embedded container
-		internalContext = startType;
-		// keep track of where this container began; to provide relative indeces for the regions
-		int containerStart = yychar;
-		boolean notFinished = true;
-		// keep track of where we seem to be so that the endTagName can be checked
-		boolean isInEndTag = false;
-		boolean isInFirstTag = true;
-		// create the embedded container and setup its "type"
-		if (fEmbeddedContainer == null) {
-			fEmbeddedContainer = new ContextRegionContainer();
-			fEmbeddedContainer.setType(fEmbeddedHint);
-			fEmbeddedContainer.setStart(containerStart);
-			// TODO: parent region needs to be set .... but not sure where to get it from 
-			//		fEmbeddedContainer.setParent(parentRegion);
-		}
-		containerStart = fEmbeddedContainer.getStart();
-		while (notFinished) {
-			// add the region to the container
-			if (internalContext != null && internalContext != PROXY_CONTEXT) {
-				ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
-				fEmbeddedContainer.getRegions().add(newToken);
-				fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
-				fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
-				// DW, 4/16/2003 token regions no longer have parents
-				//newToken.setParent(fEmbeddedContainer);
-			}
-			try {
-				// longscan determines whether to attempt a blockTagScan within the embedded container
-				boolean longscan = false;
-				// save the tokenizer state in case of a block tag scan
-				int previousState = yystate();
-				String previousCurrentTagName = fCurrentTagName;
-				int previousPostState = fEmbeddedPostState;
-				String previousEmbeddedHint = fEmbeddedHint;
-				// determine if a block tag scan is necessary
-				if (internalContext == XML_TAG_NAME) {
-					internalTagName = yytext();
-					if(!isNestable(internalTagName)) {
-						internalTagName = null;
-						// snagged a tag name we shouldn't have
-						fEmbeddedPostState = ST_ABORT_EMBEDDED;
-						notFinished = false;
-					}
-				}
-				else if (internalContext == XML_TAG_OPEN || internalContext == XML_END_TAG_OPEN) {
-					internalTagName = null;
-				}
-				// do upkeep for endTagName usage; must be here since the next token could be the close
-				if (internalContext == XML_END_TAG_OPEN) {
-					isInEndTag = true;
-				} else if (internalContext == XML_TAG_CLOSE) {
-					isInFirstTag = isInEndTag = false;
-				} else {
-				 	ITextRegionList embeddedRegions = fEmbeddedContainer.getRegions();
-					if (embeddedRegions.size() > 2 && (embeddedRegions.get(embeddedRegions.size()-1)).getType() == XML_TAG_CLOSE && (embeddedRegions.get(embeddedRegions.size() - 3)).getType() == XML_TAG_OPEN && internalTagName != null) {
-						if (containsTagName(internalTagName)) {
-							longscan = true;
-							yybegin(ST_BLOCK_TAG_SCAN);
-						}
-					}
-				}
-				if (longscan)
-					fCurrentTagName = internalTagName;
-				// read the next region and context
-				internalContext = primGetNextToken();
-				if (longscan) {
-					// Returning from a block tag scan requires restoring some state variables
-					// as well as handling the block region and setting up for normal scanning
-					// inside the embedded container
-					ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
-					fEmbeddedContainer.getRegions().add(newToken);
-					fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());
-					fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());
-					// DW, 4/16/2003 token regions no longer have parents
-					// newToken.setParent(fEmbeddedContainer);
-					longscan = false;
-					fEmbeddedPostState = previousPostState;
-					fEmbeddedHint = previousEmbeddedHint;
-					fCurrentTagName = previousCurrentTagName;
-					yybegin(previousState);
-					internalContext = primGetNextToken();
-				}
-			} catch (IOException e) {
-				// primGetNextToken() calls may throw an IOException
-				// catch and do nothing since the isEOF check below
-				// will properly exit if the input was too short
-			} catch (Exception f) {
-				// some other exception happened; never should
-				Logger.logException(f);
-			}
-			boolean isEndingType = yystate() == ST_ABORT_EMBEDDED;
-			if(!isEndingType) {
-				// check for ending context
-				if (endTagName == null) {
-					for (int i = 0; i < endTypes.length; i++) {
-						isEndingType = isEndingType || (internalContext == endTypes[i]);
-					}
-				}
-				else {
-					isEndingType = ((isInEndTag && internalContext == XML_TAG_CLOSE) || (isInFirstTag && internalContext == XML_EMPTY_TAG_CLOSE)) && internalTagName != null && internalTagName.equals(endTagName);
-				}
-			}
-			ITextRegionList embeddedList = fEmbeddedContainer.getRegions();
-			notFinished = notFinished && ((!isEndingType) && !isEOF() && (endTagName != null || internalContext != UNDEFINED) && !(internalContext == PROXY_CONTEXT && (embeddedList.get(embeddedList.size()-1)).getType() == UNDEFINED));
-		}
-		// finish adding the last context
-		if (internalContext != null && internalContext != PROXY_CONTEXT) {
-			ITextRegion newToken = fRegionFactory.createToken(internalContext, yychar - containerStart, yylength(), yylength());
-			fEmbeddedContainer.getRegions().add(newToken);
-			// DW, 4/16/2003 token regions no longer have parents
-			//newToken.setParent(fEmbeddedContainer);
-			fEmbeddedContainer.setLength(yychar - containerStart + yylength());
-			fEmbeddedContainer.setTextLength(yychar - containerStart + yylength());
-		}
-		yybegin(fEmbeddedPostState);
-	}
-	/* user method */
-	public final boolean isCaseSensitiveBlocking() {
-		return fIsCaseSensitiveBlocking;
-	}
-	/* user method */
-	public final void setCaseSensitiveBlocking(boolean newValue) {
-		fIsCaseSensitiveBlocking = newValue;
-	}
-	/* user method */
-	public boolean getBlockMarkerAllowsJSP() {
-		return getBlockMarkerAllowsJSP(fCurrentTagName);
-	}
-	/* user method */
-	public boolean getBlockMarkerAllowsJSP(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 marker.allowsJSP();
-			else if(!casesensitive && marker.getTagName().equalsIgnoreCase(name))
-				return marker.allowsJSP();
-		}
-		return true;
-	}
-	/* user method */
-	public boolean getBlockMarkerCaseSensitivity() {
-		return getBlockMarkerCaseSensitivity(fCurrentTagName);
-	}
-	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 allowJSP - check for and allow for JSP markup <%%>
- * @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, 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)
-			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) {
-				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));
-					}
-				}
-				// 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 
- * does a lookahead for the current tag name
- */
-private final String doBlockTagScan() throws IOException {
-	fIsCaseSensitiveBlocking = getBlockMarkerCaseSensitivity();
-	return doScan("</" + fCurrentTagName, true, getBlockMarkerAllowsJSP(), 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 {
-		fEmbeddedContainer = null;
-		// load the starting non-whitespace token (assume that it is so)
-		if (fShouldLoadBuffered) {
-			if (fBufferedEmbeddedContainer != null) {
-				ITextRegion container = fBufferedEmbeddedContainer;
-				fBufferedEmbeddedContainer = null;
-				fShouldLoadBuffered = false;
-				return container;
-			}
-			context = fBufferedContext;
-			start = fBufferedStart;
-			textLength = length = fBufferedLength;
-			fShouldLoadBuffered = false;
-		} else {
-			context = primGetNextToken();
-			if (context == PROXY_CONTEXT) {
-				return fEmbeddedContainer;
-			} else if (context == XML_TAG_NAME || f_context == JSP_ROOT_TAG_NAME || f_context == JSP_DIRECTIVE_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 == PROXY_CONTEXT) {
-			fBufferedEmbeddedContainer = fEmbeddedContainer;
-			fShouldLoadBuffered = true;
-		} else if (f_context == XML_TAG_NAME || f_context == JSP_ROOT_TAG_NAME || f_context == JSP_DIRECTIVE_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 JSPTokenizer(){
-		super();
-	}
-	/* user method */
-	public JSPTokenizer(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();
-	
-		fLastInternalBlockStart = -1;
-	
-		context = null;
-		start = 0;
-		textLength = 0;
-		length = 0;
-	
-		fEmbeddedContainer = null;
-		
-		fELlevel = 0;
-	}
-	/**
-	 * user method
-	 *
-	 */
-	public BlockTokenizer newInstance() {
-		JSPTokenizer newInstance = new JSPTokenizer();
-		// 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);
-		}
-		for(int i = 0; i < fNestablePrefixes.size(); i++) {
-			TagMarker marker = (TagMarker) fNestablePrefixes.get(i);
-			if(marker.isGlobal())
-				newInstance.addNestablePrefix(marker);
-		}
-		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, true, true, XML_COMMENT_TEXT, ST_XML_COMMENT_END, ST_XML_COMMENT_END);
-	}
-	/* user method */
-	private final String scanJSPCommentText() throws IOException {
-		// Scan for '--%>' and return the text up to that point as
-		//   JSP_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
-		//  case change to the ST_JSP_COMMENT_END state and return the next
-		//  context as usual.
-		return doScan("--%>", false, false, true, JSP_COMMENT_TEXT, ST_JSP_COMMENT_END, ST_JSP_COMMENT_END);
-	}
-%}
-
-%eof{
-// do nothing, this is the downstream parser's job
-%eof}
-
-%public
-%class JSPTokenizer
-%implements BlockTokenizer, DOMJSPRegionContexts
-%function primGetNextToken
-%type String
-%char
-%line
-%unicode
-%pack
-
-%state ST_CDATA_TEXT
-%state ST_CDATA_END
-%state ST_XML_COMMENT
-%state ST_XML_COMMENT_END
-%state ST_PI
-%state ST_PI_WS
-%state ST_PI_CONTENT
-%state ST_XML_PI_ATTRIBUTE_NAME
-%state ST_XML_PI_EQUALS
-%state ST_XML_PI_ATTRIBUTE_VALUE
-%state ST_XML_PI_TAG_CLOSE
-%state ST_DHTML_ATTRIBUTE_NAME
-%state ST_DHTML_EQUALS
-%state ST_DHTML_ATTRIBUTE_VALUE
-%state ST_DHTML_TAG_CLOSE
-
-// scriptlet state(s)
-%state ST_JSP_CONTENT
-%state ST_JSP_DIRECTIVE_NAME
-%state ST_JSP_DIRECTIVE_NAME_WHITESPACE
-%state ST_JSP_DIRECTIVE_ATTRIBUTE_NAME
-%state ST_JSP_DIRECTIVE_EQUALS
-%state ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE
-
-// normal tag states
-%state ST_XML_TAG_NAME
-%state ST_XML_ATTRIBUTE_NAME
-%state ST_XML_EQUALS
-%state ST_XML_ATTRIBUTE_VALUE
-
-// declaration (DTD) states
-%state ST_XML_DECLARATION
-%state ST_XML_DECLARATION_CLOSE
-
-%state ST_XML_DOCTYPE_DECLARATION
-%state ST_XML_DOCTYPE_EXTERNAL_ID
-%state ST_XML_DOCTYPE_ID_PUBLIC
-%state ST_XML_DOCTYPE_ID_SYSTEM
-
-%state ST_XML_ELEMENT_DECLARATION
-%state ST_XML_ELEMENT_DECLARATION_CONTENT
-
-%state ST_XML_ATTLIST_DECLARATION
-%state ST_XML_ATTLIST_DECLARATION_CONTENT
-
-
-%state ST_BLOCK_TAG_SCAN
-%state ST_BLOCK_TAG_INTERNAL_SCAN
-
-%state ST_JSP_COMMENT
-%state ST_JSP_COMMENT_END
-
-%state ST_XML_ATTRIBUTE_VALUE_SQUOTED
-%state ST_XML_ATTRIBUTE_VALUE_DQUOTED
-
-%state ST_ABORT_EMBEDDED
-
-%state ST_JSP_EL
-%state ST_JSP_EL_SQUOTES
-%state ST_JSP_EL_DQUOTES
-%state ST_JSP_EL_SQUOTES_END
-%state ST_JSP_EL_DQUOTES_END
-
-%state ST_JSP_DQUOTED_EL
-%state ST_JSP_SQUOTED_EL
-
-%state ST_JSP_VBL
-%state ST_JSP_VBL_SQUOTES
-%state ST_JSP_VBL_DQUOTES
-%state ST_JSP_VBL_SQUOTES_END
-%state ST_JSP_VBL_DQUOTES_END
-
-%state ST_JSP_DQUOTED_VBL
-%state ST_JSP_SQUOTED_VBL
-
-// Letter = ([A-Za-z])
-// Digit = ([0-9])
-
-/**
- * smaller tokens
- */
-genericTagOpen       = <
-genericTagClose      = >
-genericEndTagOpen    = <\/
-genericEmptyTagClose = \/>
-
-PIstart = <\?
-PIend   = \?>
-
-
-// [1] document ::= prolog element Misc*
-document = ({prolog} {element} {Misc}*)
-
-// [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
- //Char = (.)
-Char = [\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD] 
-
-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+
-S = [\x20\x09\x0D\x0A]+
-
-// [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
-NameChar = ({Letter} | {Digit} | \. | \- | _ | : | {CombiningChar} | {Extender})
-
-// [5] Name ::= (Letter | '_' | ':') NameChar*
-//Name = ({NameChar}{NameChar}*)
-Name = ({Letter} | _ | :){NameChar}*
-
-// [6] Names ::= {Name} ({S} {Name})*
-Names = ({Name} ({S} {Name})*)
-
-// [7] Nmtoken ::= (NameChar)+
-Nmtoken = ({NameChar}+)
-
-// [8] Nmtokens ::= Nmtoken (S Nmtoken)*
-Nmtokens = ({Nmtoken} ({S} {Nmtoken})*)
-
-// [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' |  "'" ([^%&'] | PEReference | Reference)* "'"
-EntityValue = (\" ([^%&\"] | {PEReference} | {Reference})* \" |  \' ([^%&\'] | {PEReference} | {Reference})* \')
-
-// \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<>/] )*)
-
-// [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") 
-SystemLiteral = ((\" [^\"]* \") | (\' [^\']* \')) 
-
-// [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
-PubidLiteral = (\" {PubidChar}* \" | \' ({PubidChar}\')* "'")
-
-// [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
-PubidChar = ([\040\015\012] | [a-zA-Z0-9] | [\-\'()\+,.\/:=?;!\*#@\$_%])
-
-// [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
-// implement lookahead behavior during action definition
-CharData = ([^<&(\]\]>)]*)
-
-// [15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
-CommentStart = (<!\-\-)
-CommentEnd   = (\-\->)
-Comment = ({CommentStart}.*{CommentEnd})
-
-// [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
-PI = (<\?{PITarget} {Char}* \?>)
-
-// [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
-PITarget = ({Name}((X|x)(M|m)(L|l)))
-
-// [18] CDSect ::= CDStart CData CDEnd
-CDSect = ({CDStart}{CData}{CDEnd})
-
-// [19] CDStart ::= '<![CDATA['
-CDStart = <!\[CDATA\[
-
-// [20] CData ::= (Char* - (Char* ']]>' Char*)) 
-// implement lookahead behavior during action definition
-CData = ([^(\]\]>)]*)
-
-// [21] CDEnd ::= ']]>'
-CDEnd = (\]\]>)
-
-// [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
-prolog = ({XMLDecl}? {Misc}* ({doctypedecl} {Misc}*)?)
-
-// [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
-XMLDecl = (<\?xml {VersionInfo} {EncodingDecl}? {SDDecl}? {S}? \?>)
-
-// [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")
-VersionInfo = ({S}version{Eq}(\'{VersionNum}\' | \"{VersionNum}\"))
-
-// [25] Eq ::= S? '=' S?
-Eq = (\=)
-
-// [26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')+
-VersionNum = (([a-zA-Z0-9_.:]|\-)+)
-
-// [27] Misc ::= Comment | PI |  S
-Misc = ({Comment} | {PI} | {S})
-
-// [28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)?  S? ('[' (markupdecl | PEReference | S)* ']' S?)? '>'
-doctypedecl = (<\!DOCTYPE{S}{Name} ({S}{ExternalID})? {S}? (\[ ({markupdecl}|{PEReference}|{S})* \]{S}?)?>)
-
-// [29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment
-markupdecl = ({elementdecl} | {AttlistDecl} | {EntityDecl} | {NotationDecl} | {PI} | {Comment})
-
-// [30] extSubset ::= TextDecl? extSubsetDecl
-extSubset = ({TextDecl}? {extSubsetDecl})
-
-// [31] extSubsetDecl ::= ( markupdecl | conditionalSect | PEReference | S )*
-extSubsetDecl = (( {markupdecl} | {conditionalSect} | {PEReference} | {S} )*)
-
-// [32]  SDDecl  ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))
-SDDecl  = ({S}standalone{Eq}{S}*((\'(yes|no)\')|(\"(yes|no)\")))
-
-// [33]  LanguageID  ::= Langcode ('-' Subcode)*
-LanguageID  = ({Langcode}(\-{Subcode})*)
-
-// [34]  Langcode ::= ISO639Code |  IanaCode |  UserCode
-Langcode = ({ISO639Code} |  {IanaCode} |  {UserCode})
-
-// [35]  ISO639Code ::= ([a-z] | [A-Z]) ([a-z] | [A-Z])
-ISO639Code = (([a-z]|[A-Z])([a-z]|[A-Z]))
-
-// [36]  IanaCode ::= ('i' | 'I') '-' ([a-z] | [A-Z])+
-IanaCode = ((i|I)\-([a-z]|[A-Z])+)
-
-// [37]  UserCode ::= ('x' | 'X') '-' ([a-z] | [A-Z])+
-UserCode = ((x|X)\-([a-z]|[A-Z])+)
-
-// [38]  Subcode ::= ([a-z] | [A-Z])+
-Subcode = (([a-z]|[A-Z])+)
-
-// [39]  element  ::= EmptyElemTag | STag content ETag
-element  = ({EmptyElemTag} | {STag} {content} {ETag})
-
-// [40]  STag  ::= '<' Name (S Attribute)* S? '>'
-STag = (<{Name}({S}{Attribute})*{S}?>)
-
-// [41]  Attribute ::= Name Eq AttValue
-Attribute = ({Name}{S}*{Eq}{S}*{AttValue})
-
-// [42]  ETag  ::= 'Name S? '>'
-ETag = (<\/{Name}{S}?>)
-
-// [43]  content  ::= (element | CharData | Reference | CDSect | PI | Comment)*
-content = (({element} | {CharData} | {Reference} | {CDSect} | {PI} | {Comment})*)
-
-// [44]  EmptyElemTag  ::= '<' Name (S Attribute)* S? '/>'
-EmptyElemTag = (<{Name}({S}{Attribute})*{S}?\/>)
-
-// [45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'
-elementdecl = (<\!ELEMENT{S}{Name}{S}{contentspec}{S}?>)
-
-// [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
-contentspec = (EMPTY|ANY|{Mixed}|{children})
-
-// [47] children ::= (choice | seq) ('?' | '*' | '+')?
-children = (({choice}|{seq})(\?|\*|\+)?)
-
-// CAUSES LOOP THROUGH DEFS OF CHOICE AND SEQ
-// [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
-cp = (({Name} | {choice} | {seq}) (\?|\*|\+)?)
-
-// [49] choice ::= '(' S? cp ( S? '|' S? cp )* S? ')'
-// choice = \({S}?{cp}({S}?\|{S}?{cp})*{S}?\)
-choice = \({S}?{Name}({S}?\|{S}?{Name})*{S}?\)
-
-// [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
-// seq = (\({S}?{cp}({S}?\,{S}?{cp})*{S}?\))
-seq = (\({S}?{Name}({S}?\,{S}?{Name})*{S}?\))
-
-// [51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S?  ')*' | '(' S? '#PCDATA' S? ')'
-Mixed = ({S}?\#PCDATA({S}?\|{S}?{Name})*{S}?)*\|({S}?\#PCDATA{S}?)
-
-// [52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'
-AttlistDecl = (<\!ATTLIST{S}{Name}{AttDef}*{S}?>)
-
-// [53] AttDef ::= S Name S AttType S DefaultDecl
-AttDef = ({S}{Name}{S}{AttType}{S}{DefaultDecl})
-
-// [54] AttType ::= StringType | TokenizedType | EnumeratedType 
-AttType = ({StringType} | {TokenizedType} | {EnumeratedType})
-
-// [55] StringType ::= 'CDATA'
-StringType = (CDATA)
-
-// [56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS'
-TokenizedType = (ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS)
-
-// [57] EnumeratedType ::= NotationType | Enumeration 
-EnumeratedType = ({NotationType} | {Enumeration})
-
-// [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')' 
-NotationType = (NOTATION{S}\({S}?{Name}({S}?\|{S}?{Name})*{S}?\))
-
-// [59] Enumeration ::= '(' S? Nmtoken (S? '|' S?  Nmtoken)* S? ')'
-Enumeration = (\({S}?{Nmtoken}({S}?\|{S}?{Nmtoken})*{S}?\))
-
-// [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
-DefaultDecl = (\#REQUIRED|\#IMPLIED|((\#FIXED{S})?{AttValue}))
-
-// [61] conditionalSect ::= includeSect | ignoreSect 
-conditionalSect = ({includeSect} | {ignoreSect})
-
-// [62] includeSect ::= '<![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>' 
-includeSect = (<\!\[{S}?INCLUDE{S}?\[{extSubsetDecl}\]\]>)
-
-// [63] ignoreSect ::= '<![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>'
-ignoreSect = (<\!\[{S}?IGNORE{S}?\[{ignoreSectContents}*\]\]>)
-
-// [64] ignoreSectContents ::= Ignore ('<![' ignoreSectContents ']]>' Ignore)*
-ignoreSectContents = ({Ignore}(<\!\[{ignoreSectContents}\]\]>{Ignore})*)
-
-// [65] Ignore ::= Char* - (Char* ('<![' | ']]>') Char*)
-Ignore =  ([^(\<\!\[|\]\]\>)]*)
-
-// [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
-CharRef = (&#[0-9]+;|&#x[0-9a-fA-F]+;)
-
-// [67] Reference ::= EntityRef | CharRef
-Reference = ({EntityRef} | {CharRef})
-
-// [68] EntityRef = '&' Name ';'
-EntityRef = (&{Name};)
-
-// [69] PEReference ::= '%' Name ';'
-PEReference = (%{Name};)
-
-// [70] EntityDecl ::= GEDecl | PEDecl
-EntityDecl = ({GEDecl} | {PEDecl})
-
-// [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'
-GEDecl = (<\!ENTITY{S}{Name}{S}{EntityDef}{S}?>)
-
-// [72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
-PEDecl = (<\!ENTITY{S}\%{S}{Name}{S}{PEDef}{S}?>)
-
-// [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
-EntityDef = ({EntityValue} | ({ExternalID}{NDataDecl}?))
-
-// [74] PEDef ::= EntityValue | ExternalID
-PEDef = ({EntityValue} | {ExternalID})
-
-// [75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral 
-ExternalID = (SYSTEM{S}{SystemLiteral}|PUBLIC{S}{PubidLiteral}{S}{SystemLiteral} )
-
-// [76] NDataDecl ::= S 'NDATA' S Name
-NDataDecl = ({S}NDATA{S}{Name})
-
-// [77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
-TextDecl = (<\?xml{VersionInfo}?{EncodingDecl}{S}?\?>)
-
-// [78] extParsedEnt ::= TextDecl? content
-extParsedEnt = ({TextDecl}?{content})
-
-// [79] extPE ::= TextDecl? extSubsetDecl
-extPE = ({TextDecl}?{extSubsetDecl})
-
-// [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' |  "'" EncName "'" ) 
-EncodingDecl = ({S}encoding{S}*{Eq}{S}*(\"{EncName}\"|\'{EncName}\'))
-
-// [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
-EncName = ([A-Za-z]([A-Za-z0-9._]|\-)*)
-
-// [82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID |  PublicID) S? '>'
-NotationDecl = (<\!NOTATION{S}{Name}{S}({ExternalID}|{PublicID}){S}?>)
-
-// [83] PublicID ::= 'PUBLIC' S PubidLiteral
-PublicID = (PUBLIC{S}{PubidLiteral})
-
-// [84]  Letter ::= BaseChar | Ideographic
-Letter = ({BaseChar} | {Ideographic})
-
-// [85]  BaseChar ::= [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6]
-// | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131]
-// | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E]
-// | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5]
-// | [#x01FA-#x0217] | [#x0250-#x02A8] | [#x02BB-#x02C1] | #x0386
-// | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] | [#x03A3-#x03CE]
-// | [#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0
-// | [#x03E2-#x03F3] | [#x0401-#x040C] | [#x040E-#x044F]
-// | [#x0451-#x045C] | [#x045E-#x0481] | [#x0490-#x04C4]
-// | [#x04C7-#x04C8] | [#x04CB-#x04CC] | [#x04D0-#x04EB]
-// | [#x04EE-#x04F5] | [#x04F8-#x04F9] | [#x0531-#x0556] | #x0559
-// | [#x0561-#x0586] | [#x05D0-#x05EA] | [#x05F0-#x05F2]
-// | [#x0621-#x063A] | [#x0641-#x064A] | [#x0671-#x06B7]
-// | [#x06BA-#x06BE] | [#x06C0-#x06CE] | [#x06D0-#x06D3] | #x06D5
-// | [#x06E5-#x06E6] | [#x0905-#x0939] | #x093D | [#x0958-#x0961]
-// | [#x0985-#x098C] | [#x098F-#x0990] | [#x0993-#x09A8]
-// | [#x09AA-#x09B0] | #x09B2 | [#x09B6-#x09B9] | [#x09DC-#x09DD]
-// | [#x09DF-#x09E1] | [#x09F0-#x09F1] | [#x0A05-#x0A0A]
-// | [#x0A0F-#x0A10] | [#x0A13-#x0A28] | [#x0A2A-#x0A30]
-// | [#x0A32-#x0A33] | [#x0A35-#x0A36] | [#x0A38-#x0A39]
-// | [#x0A59-#x0A5C] | #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B]
-// | #x0A8D | [#x0A8F-#x0A91] | [#x0A93-#x0AA8] | [#x0AAA-#x0AB0]
-// | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] | #x0ABD | #x0AE0
-// | [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28]
-// | [#x0B2A-#x0B30] | [#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D
-// | [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] | [#x0B85-#x0B8A]
-// | [#x0B8E-#x0B90] | [#x0B92-#x0B95] | [#x0B99-#x0B9A] | #x0B9C
-// | [#x0B9E-#x0B9F] | [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA]
-// | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9] | [#x0C05-#x0C0C]
-// | [#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33]
-// | [#x0C35-#x0C39] | [#x0C60-#x0C61] | [#x0C85-#x0C8C]
-// | [#x0C8E-#x0C90] | [#x0C92-#x0CA8] | [#x0CAA-#x0CB3]
-// | [#x0CB5-#x0CB9] | #x0CDE | [#x0CE0-#x0CE1] | [#x0D05-#x0D0C]
-// | [#x0D0E-#x0D10] | [#x0D12-#x0D28] | [#x0D2A-#x0D39]
-// | [#x0D60-#x0D61] | [#x0E01-#x0E2E] | #x0E30 | [#x0E32-#x0E33]
-// | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 | [#x0E87-#x0E88]
-// | #x0E8A | #x0E8D | [#x0E94-#x0E97] | [#x0E99-#x0E9F]
-// | [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB]
-// | [#x0EAD-#x0EAE] | #x0EB0 | [#x0EB2-#x0EB3] | #x0EBD
-// | [#x0EC0-#x0EC4] | [#x0F40-#x0F47] | [#x0F49-#x0F69]
-// | [#x10A0-#x10C5] | [#x10D0-#x10F6] | #x1100 | [#x1102-#x1103]
-// | [#x1105-#x1107] | #x1109 | [#x110B-#x110C] | [#x110E-#x1112]
-// | #x113C | #x113E | #x1140 | #x114C | #x114E | #x1150
-// | [#x1154-#x1155] | #x1159 | [#x115F-#x1161] | #x1163 | #x1165
-// | #x1167 | #x1169 | [#x116D-#x116E] | [#x1172-#x1173] | #x1175
-// | #x119E | #x11A8 | #x11AB | [#x11AE-#x11AF] | [#x11B7-#x11B8]
-// | #x11BA | [#x11BC-#x11C2] | #x11EB | #x11F0 | #x11F9
-// | [#x1E00-#x1E9B] | [#x1EA0-#x1EF9] | [#x1F00-#x1F15]
-// | [#x1F18-#x1F1D] | [#x1F20-#x1F45] | [#x1F48-#x1F4D]
-// | [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D | [#x1F5F-#x1F7D]
-// | [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE | [#x1FC2-#x1FC4]
-// | [#x1FC6-#x1FCC] | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB]
-// | [#x1FE0-#x1FEC] | [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126
-// | [#x212A-#x212B] | #x212E | [#x2180-#x2182] | [#x3041-#x3094]
-// | [#x30A1-#x30FA] | [#x3105-#x312C] | [#xAC00-#xD7A3]
-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]
-
-// [86]  Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
-Ideographic = [\u4E00-\u9FA5\u3007\u3021-\u3029]
-
-// [87]      CombiningChar    ::=    [#x0300-#x0345]    | [#x0360-#x0361]
-// | [#x0483-#x0486]          | [#x0591-#x05A1]         | [#x05A3-#x05B9]
-// | [#x05BB-#x05BD]       | #x05BF       | [#x05C1-#x05C2]	 | #x05C4
-// | [#x064B-#x0652]    | #x0670    | [#x06D6-#x06DC]   | [#x06DD-#x06DF]
-// | [#x06E0-#x06E4]          | [#x06E7-#x06E8]         | [#x06EA-#x06ED]
-// | [#x0901-#x0903]       | #x093C       | [#x093E-#x094C]      | #x094D
-// | [#x0951-#x0954]    | [#x0962-#x0963]    | [#x0981-#x0983]   | #x09BC
-// | #x09BE       | #x09BF       | [#x09C0-#x09C4]      | [#x09C7-#x09C8]
-// | [#x09CB-#x09CD]   | #x09D7   | [#x09E2-#x09E3]   | #x0A02   | #x0A3C
-// | #x0A3E       | #x0A3F       | [#x0A40-#x0A42]      | [#x0A47-#x0A48]
-// | [#x0A4B-#x0A4D]    | [#x0A70-#x0A71]    | [#x0A81-#x0A83]   | #x0ABC
-// | [#x0ABE-#x0AC5]          | [#x0AC7-#x0AC9]         | [#x0ACB-#x0ACD]
-// | [#x0B01-#x0B03]    | #x0B3C    | [#x0B3E-#x0B43]   | [#x0B47-#x0B48]
-// | [#x0B4B-#x0B4D]          | [#x0B56-#x0B57]         | [#x0B82-#x0B83]
-// | [#x0BBE-#x0BC2]    | [#x0BC6-#x0BC8]    | [#x0BCA-#x0BCD]   | #x0BD7
-// | [#x0C01-#x0C03]          | [#x0C3E-#x0C44]         | [#x0C46-#x0C48]
-// | [#x0C4A-#x0C4D]          | [#x0C55-#x0C56]         | [#x0C82-#x0C83]
-// | [#x0CBE-#x0CC4]          | [#x0CC6-#x0CC8]         | [#x0CCA-#x0CCD]
-// | [#x0CD5-#x0CD6]          | [#x0D02-#x0D03]         | [#x0D3E-#x0D43]
-// | [#x0D46-#x0D48]       | [#x0D4A-#x0D4D]       | #x0D57      | #x0E31
-// | [#x0E34-#x0E3A]    | [#x0E47-#x0E4E]    | #x0EB1   | [#x0EB4-#x0EB9]
-// | [#x0EBB-#x0EBC]    | [#x0EC8-#x0ECD]    | [#x0F18-#x0F19]   | #x0F35
-// | #x0F37      | #x0F39     | #x0F3E     | #x0F3F     | [#x0F71-#x0F84]
-// | [#x0F86-#x0F8B]    | [#x0F90-#x0F95]    | #x0F97   | [#x0F99-#x0FAD]
-// | [#x0FB1-#x0FB7]       | #x0FB9       | [#x20D0-#x20DC]      | #x20E1
-// | [#x302A-#x302F] | #x3099 | #x309A
-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]
-
-// [88]   Digit  ::=  [#x0030-#x0039] | [#x0660-#x0669] | [#x06F0-#x06F9]
-// | [#x0966-#x096F]          | [#x09E6-#x09EF]         | [#x0A66-#x0A6F]
-// | [#x0AE6-#x0AEF]          | [#x0B66-#x0B6F]         | [#x0BE7-#x0BEF]
-// | [#x0C66-#x0C6F]          | [#x0CE6-#x0CEF]         | [#x0D66-#x0D6F]
-// | [#x0E50-#x0E59] | [#x0ED0-#x0ED9] | [#x0F20-#x0F29]
-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]
-
-// [89]  Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46
-// | #x0EC6       | #x3005       | [#x3031-#x3035]      | [#x309D-#x309E]
-// | [#x30FC-#x30FE]
-Extender = [\u00B7\u02D0\u02D1\u0387\u0640\u0E46\u0EC6\u3005\u3031-\u3035\u309D-\u309E\u30FC-\u30FE]
-
-
-
-/**
- * JSP and scripting marker allowances
- */
-
-jspCommentStart = <%--
-jspCommentEnd   = --%>
-
-jspScriptletStart        = <%
-jspExpressionStart       = {jspScriptletStart}=
-jspDeclarationStart      = {jspScriptletStart}\!
-jspScriptletEnd          = %>
-jspDirectiveStart        = {jspScriptletStart}@
-
-%%
-
-/* 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}* {
-	if(Debug.debugTokenizer)
-		dump("white space");//$NON-NLS-1$
-        return WHITE_SPACE;
-}
-
-// BEGIN REGULAR XML
-/* handle opening a new tag almost anywhere */
-
-
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, 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> {genericTagOpen} {
-	if(Debug.debugTokenizer)
-		dump("\nstart tag open");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_NAME;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-        yybegin(ST_XML_TAG_NAME);
-        return XML_TAG_OPEN;
-}
-/* VERY special cases for tags as values */
-/* quoted JSP */
-<ST_XML_ATTRIBUTE_VALUE_DQUOTED> ["] {
-	return XML_TAG_ATTRIBUTE_VALUE_DQUOTE;
-}
-<ST_XML_ATTRIBUTE_VALUE_SQUOTED> ['] {
-	return XML_TAG_ATTRIBUTE_VALUE_SQUOTE;
-}
-<ST_XML_ATTRIBUTE_VALUE> ["] {
-	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-	}
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
-	yybegin(ST_XML_ATTRIBUTE_VALUE_DQUOTED);
-	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);
-	fStateStack.pop();
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-	yybegin(ST_XML_ATTRIBUTE_NAME);
-	return PROXY_CONTEXT;
-}
-<ST_XML_ATTRIBUTE_VALUE> ['] {
-	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-	}
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
-	yybegin(ST_XML_ATTRIBUTE_VALUE_SQUOTED);
-	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);
-	fStateStack.pop();
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-	return PROXY_CONTEXT;
-}
-
-<ST_XML_ATTRIBUTE_VALUE_DQUOTED> ([^<"\x24\x23]|[\x24\x23][^\x7b])+ {
-	return XML_TAG_ATTRIBUTE_VALUE;
-}
-<ST_XML_ATTRIBUTE_VALUE_SQUOTED> ([^<'\x24\x23]|[\x24\x23][^\x7b])+ {
-	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$
-	}
-	int incomingState = yystate();
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	if(Debug.debugTokenizer)
-		dump("tag inside of JSP attribute value start");//$NON-NLS-1$
-	yybegin(ST_XML_TAG_NAME);
-	assembleEmbeddedContainer(XML_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
-	if(yystate() != ST_ABORT_EMBEDDED)
-        yybegin(incomingState);
-	return PROXY_CONTEXT;
-}
-<ST_XML_ATTRIBUTE_VALUE_DQUOTED,ST_XML_ATTRIBUTE_VALUE_SQUOTED> {genericEndTagOpen} {
-	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-	}
-	int incomingState = yystate();
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	if(Debug.debugTokenizer)
-		dump("JSP attribute value start - end tag");//$NON-NLS-1$
-	yybegin(ST_XML_TAG_NAME);
-	assembleEmbeddedContainer(XML_END_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
-	if(yystate() != ST_ABORT_EMBEDDED)
-        yybegin(incomingState);
-	return PROXY_CONTEXT;
-}
-
-/* unquoted */
-<ST_XML_ATTRIBUTE_VALUE> {genericTagOpen} {
-	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-	}
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	fStateStack.push(yystate());
-	if(Debug.debugTokenizer)
-		dump("JSP tag embedded name start - start tag");//$NON-NLS-1$
-	yybegin(ST_XML_TAG_NAME);
-	assembleEmbeddedContainer(XML_TAG_OPEN, new String[]{XML_TAG_CLOSE,XML_EMPTY_TAG_CLOSE});
-	fStateStack.pop();
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-	return PROXY_CONTEXT;
-}
-
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_XML_DECLARATION> {genericEndTagOpen} {
-	if(Debug.debugTokenizer)
-		dump("\nend tag open");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_NAME;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-        yybegin(ST_XML_TAG_NAME);
-        return XML_END_TAG_OPEN;
-}
-/* specially treated JSP tag names */
-<ST_XML_TAG_NAME> jsp:root {
-	if(Debug.debugTokenizer)
-		dump("jsp:root tag name");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return JSP_ROOT_TAG_NAME;
-}
-<ST_XML_TAG_NAME> jsp:directive.(page|include|tag|taglib|attribute|variable) {
-	if(Debug.debugTokenizer)
-		dump("jsp directive tag name");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return JSP_DIRECTIVE_NAME;
-}
-/* the tag's name was found, start scanning for attributes */
-<ST_XML_TAG_NAME> {Name} {
-	if(Debug.debugTokenizer)
-		dump("tag name");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
-}
-
-/* another attribute name was found, resume looking for the equals sign */
-<ST_XML_ATTRIBUTE_NAME, ST_XML_EQUALS> {Name} {
-	if(Debug.debugTokenizer)
-		dump("attr name");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-        yybegin(ST_XML_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
-}
-/* an equal sign was found, what's next is the value */
-<ST_XML_EQUALS> {Eq} {
-	if(Debug.debugTokenizer)
-		dump("equals");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-        yybegin(ST_XML_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
-}
-/* the value was found, look for the next name */
-<ST_XML_ATTRIBUTE_VALUE> {AttValue} {
-	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;
-}
-/* the tag's close was found */
-<ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE> {genericTagClose} {
-	if(Debug.debugTokenizer)
-		dump("tag close");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-	if(isBlockMarker()) {
-		fEmbeddedHint = getBlockMarkerContext();
-		fEmbeddedPostState = ST_BLOCK_TAG_SCAN;
-        	yybegin(ST_BLOCK_TAG_SCAN);
-	}
-	else
-        	yybegin(YYINITIAL);
-        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} {
-        yybegin(YYINITIAL);
-	fEmbeddedHint = UNDEFINED;
-	if(Debug.debugTokenizer)
-		dump("empty tag close");//$NON-NLS-1$
-        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]* {
-	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;
-	}
-	yybegin(YYINITIAL);
-        return XML_CONTENT;
-}
-
-// END REGULAR XML
-
-// BEGIN NESTED XML TAGS
-<ST_XML_ATTRIBUTE_NAME, ST_XML_EQUALS> <{Name} {
-	String tagName = yytext().substring(1);
-	// pushback to just after the opening bracket
-	yypushback(yylength() - 1);
-	if(!isNestable(tagName)) {
-		yybegin(ST_XML_TAG_NAME);
-		return XML_TAG_OPEN;
-	}
-	if(Debug.debugTokenizer)
-		dump("tag in place of attr name");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	fStateStack.push(yystate());
-	// embedded container should be looking for the name (again) next
-	yybegin(ST_XML_TAG_NAME);
-	assembleEmbeddedTagSequence(XML_TAG_OPEN, tagName); // ?
-	fStateStack.pop();
-	yybegin(ST_XML_EQUALS);
-	return PROXY_CONTEXT;
-}
-<ST_XML_ATTRIBUTE_VALUE> <{Name} {
-	String tagName = yytext().substring(1);
-	// pushback to just after the opening bracket
-	yypushback(yylength() - 1);
-	if(!isNestable(tagName)) {
-		yybegin(ST_XML_TAG_NAME);
-		return XML_TAG_OPEN;
-	}
-	if(Debug.debugTokenizer)
-		dump("tag in place of attr value");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	fStateStack.push(yystate());
-	// embedded container should be looking for the name (again) next
-	yybegin(ST_XML_TAG_NAME);
-	assembleEmbeddedTagSequence(XML_TAG_OPEN, tagName); // ?
-	fStateStack.pop();
-	yybegin(ST_XML_ATTRIBUTE_NAME);
-	return PROXY_CONTEXT;
-}
-// END NESTED XML
-
-// 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} {
-	if(Debug.debugTokenizer)
-		dump("\ncomment start");//$NON-NLS-1$
-	fEmbeddedHint = XML_COMMENT_TEXT;
-	fEmbeddedPostState = ST_XML_COMMENT;
-	yybegin(ST_XML_COMMENT);
-	return XML_COMMENT_OPEN;
-}
-<ST_XML_COMMENT> .|\r|\n {
-	if(Debug.debugTokenizer)
-		dump("comment content");//$NON-NLS-1$
-	return scanXMLCommentText();
-}
-
-<ST_XML_COMMENT_END> {CommentEnd} {
-	if(Debug.debugTokenizer)
-		dump("comment end");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-	yybegin(YYINITIAL);
-	return XML_COMMENT_CLOSE;
-}
-
-<ST_JSP_CONTENT> {jspScriptletEnd} {
-	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;
-}
-<ST_JSP_CONTENT> . {
-	if(Debug.debugTokenizer)
-		dump("JSP code content");//$NON-NLS-1$
-	return doScan("%>", false, false, false, JSP_CONTENT, ST_JSP_CONTENT, ST_JSP_CONTENT);
-}
-{jspScriptletStart} {
-	/* JSP scriptlet begun (anywhere)
-	 * A consequence of the start anywhere possibility is that the
-	 *  incoming state must be checked to see if it's erroneous
-	 *  due to the order of precedence generated
-	 */
-	// begin sanity checks
-	if(yystate() == ST_JSP_CONTENT) {
-		// at the beginning?!
-		yypushback(1);
-		return JSP_CONTENT;
-	}
-	else if(yystate() == ST_BLOCK_TAG_SCAN) {
-		yypushback(2);
-		return doBlockTagScan();
-	}
-	else if(yystate() == ST_XML_COMMENT) {
-		yypushback(2);
-		return scanXMLCommentText();
-	}
-	else if(yystate() == ST_JSP_COMMENT) {
-		yypushback(2);
-		return scanJSPCommentText();
-	}
-	// finished sanity checks
-	fStateStack.push(yystate());
-	if(fStateStack.peek()==YYINITIAL) {
-		// the simple case, just a regular scriptlet out in content
-		if(Debug.debugTokenizer)
-			dump("\nJSP scriptlet start");//$NON-NLS-1$
-		yybegin(ST_JSP_CONTENT);
-		return JSP_SCRIPTLET_OPEN;
-	}
-	else {
-		if (Debug.debugTokenizer) {
-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-		}
-		if(Debug.debugTokenizer)
-			dump("JSP scriptlet start");//$NON-NLS-1$
-		if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
-		else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
-		else if(yystate() == ST_CDATA_TEXT) {
-			fEmbeddedPostState = ST_CDATA_TEXT;
-			fEmbeddedHint = XML_CDATA_TEXT;
-		}
-		yybegin(ST_JSP_CONTENT);
-		assembleEmbeddedContainer(JSP_SCRIPTLET_OPEN, JSP_CLOSE);
-		if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
-			yybegin(ST_BLOCK_TAG_SCAN);
-			return BLOCK_TEXT;
-		}
-		// required help for successive embedded regions
-		if(yystate() == ST_XML_TAG_NAME) {
-			fEmbeddedHint = XML_TAG_NAME;
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-		}
-		else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
-			fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-			fEmbeddedPostState = ST_XML_EQUALS;
-		}
-		else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
-			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-		}
-		return PROXY_CONTEXT;
-	}
-}
-{jspExpressionStart} {
-	/* JSP expression begun (anywhere)
-	 * A consequence of the start anywhere possibility is that the
-	 *  incoming state must be checked to see if it's erroneous
-	 *  due to the order of precedence generated
-	 */
-	// begin sanity checks
-	if(yystate() == ST_JSP_CONTENT) {
-		// at the beginning?!
-		yypushback(2);
-		return JSP_CONTENT;
-	}
-	else if(yystate() == ST_BLOCK_TAG_SCAN) {
-		yypushback(3);
-		return doBlockTagScan();
-	}
-	else if(yystate() == ST_XML_COMMENT) {
-		yypushback(3);
-		return scanXMLCommentText();
-	}
-	else if(yystate() == ST_JSP_COMMENT) {
-		yypushback(3);
-		return scanJSPCommentText();
-	}
-	// end sanity checks
-	fStateStack.push(yystate());
-	if(fStateStack.peek()==YYINITIAL) {
-		// the simple case, just an expression out in content
-		if(Debug.debugTokenizer)
-			dump("\nJSP expression start");//$NON-NLS-1$
-		yybegin(ST_JSP_CONTENT);
-		return JSP_EXPRESSION_OPEN;
-	}
-	else {
-		if (Debug.debugTokenizer) {
-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-		}
-		if(Debug.debugTokenizer)
-			dump("JSP expression start");//$NON-NLS-1$
-		if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
-		else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
-		else if(yystate() == ST_CDATA_TEXT) {
-			fEmbeddedPostState = ST_CDATA_TEXT;
-			fEmbeddedHint = XML_CDATA_TEXT;
-		}
-		yybegin(ST_JSP_CONTENT);
-		assembleEmbeddedContainer(JSP_EXPRESSION_OPEN, JSP_CLOSE);
-		if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
-			yybegin(ST_BLOCK_TAG_SCAN);
-			return BLOCK_TEXT;
-		}
-		// required help for successive embedded regions
-		if(yystate() == ST_XML_TAG_NAME) {
-			fEmbeddedHint = XML_TAG_NAME;
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-		}
-		else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
-			fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-			fEmbeddedPostState = ST_XML_EQUALS;
-		}
-		else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
-			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-		}
-		return PROXY_CONTEXT;
-	}
-}
-{jspDeclarationStart} {
-	/* JSP declaration begun (anywhere)
-	 * A consequence of the start anywhere possibility is that the
-	 *  incoming state must be checked to see if it's erroneous
-	 *  due to the order of precedence generated
-	 */
-	// begin sanity checks
-	if(yystate() == ST_JSP_CONTENT) {
-		// at the beginning?!
-		yypushback(2);
-		return JSP_CONTENT;
-	}
-	else if(yystate() == ST_BLOCK_TAG_SCAN) {
-		yypushback(3);
-		return doBlockTagScan();
-	}
-	else if(yystate() == ST_XML_COMMENT) {
-		yypushback(3);
-		return scanXMLCommentText();
-	}
-	else if(yystate() == ST_JSP_COMMENT) {
-		yypushback(3);
-		return scanJSPCommentText();
-	}
-	// end sanity checks
-	fStateStack.push(yystate());
-	if(fStateStack.peek()==YYINITIAL) {
-		// the simple case, just a declaration out in content
-		if(Debug.debugTokenizer)
-			dump("\nJSP declaration start");//$NON-NLS-1$
-		yybegin(ST_JSP_CONTENT);
-		return JSP_DECLARATION_OPEN;
-	}
-	else {
-		if (Debug.debugTokenizer) {
-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-		}
-		if(Debug.debugTokenizer)
-			dump("JSP declaration start");//$NON-NLS-1$
-		if(yystate() == ST_XML_ATTRIBUTE_VALUE_DQUOTED)
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;
-		else if(yystate() == ST_XML_ATTRIBUTE_VALUE_SQUOTED)
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;
-		else if(yystate() == ST_CDATA_TEXT) {
-			fEmbeddedPostState = ST_CDATA_TEXT;
-			fEmbeddedHint = XML_CDATA_TEXT;
-		}
-		yybegin(ST_JSP_CONTENT);
-		assembleEmbeddedContainer(JSP_DECLARATION_OPEN, JSP_CLOSE);
-		if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
-			yybegin(ST_BLOCK_TAG_SCAN);
-			return BLOCK_TEXT;
-		}
-		// required help for successive embedded regions
-		if(yystate() == ST_XML_TAG_NAME) {
-			fEmbeddedHint = XML_TAG_NAME;
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-		}
-		else if((yystate() == ST_XML_ATTRIBUTE_NAME || yystate() == ST_XML_EQUALS)) {
-			fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-			fEmbeddedPostState = ST_XML_EQUALS;
-		}
-		else if(yystate() == ST_XML_ATTRIBUTE_VALUE) {
-			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-		}
-		return PROXY_CONTEXT;
-	}
-}
-<ST_BLOCK_TAG_INTERNAL_SCAN> {jspCommentStart}  {
-	yybegin(ST_JSP_COMMENT);
-	assembleEmbeddedContainer(JSP_COMMENT_OPEN, JSP_COMMENT_CLOSE);
-	if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN)
-		yybegin(ST_BLOCK_TAG_SCAN);
-	return PROXY_CONTEXT;
-}
-<YYINITIAL,ST_BLOCK_TAG_INTERNAL_SCAN> {jspDirectiveStart}  {
-	fStateStack.push(yystate());
-	if(fStateStack.peek()==YYINITIAL) {
-		if(Debug.debugTokenizer)
-			dump("\nJSP directive start");//$NON-NLS-1$
-		yybegin(ST_JSP_DIRECTIVE_NAME);
-		return JSP_DIRECTIVE_OPEN;
-	}
-	else {
-		if (Debug.debugTokenizer) {
-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-		}
-		if(Debug.debugTokenizer)
-			dump("JSP directive start");//$NON-NLS-1$
-		yybegin(ST_JSP_DIRECTIVE_NAME);
-		assembleEmbeddedContainer(JSP_DIRECTIVE_OPEN, new String[]{JSP_DIRECTIVE_CLOSE, JSP_CLOSE});
-		if(yystate() == ST_BLOCK_TAG_INTERNAL_SCAN) {
-			yybegin(ST_BLOCK_TAG_SCAN);
-			return BLOCK_TEXT;
-		}
-		return PROXY_CONTEXT;
-	}
-}
-<ST_JSP_DIRECTIVE_NAME> {Name} {
-	if(Debug.debugTokenizer)
-		dump("JSP directive name");//$NON-NLS-1$
-	yybegin(ST_JSP_DIRECTIVE_NAME_WHITESPACE);
-	return JSP_DIRECTIVE_NAME;
-}
-<ST_JSP_DIRECTIVE_NAME_WHITESPACE> {S}? {
-	if(Debug.debugTokenizer)
-		dump("white space");//$NON-NLS-1$
-	yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_NAME);
-	return WHITE_SPACE;
-}
-<ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS> {Name} {
-	if(Debug.debugTokenizer)
-		dump("attr name");//$NON-NLS-1$
-        yybegin(ST_JSP_DIRECTIVE_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
-}
-<ST_JSP_DIRECTIVE_EQUALS> {Eq} {
-	if(Debug.debugTokenizer)
-		dump("equals");//$NON-NLS-1$
-        yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
-}
-<ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE> {AttValue} {
-	if(Debug.debugTokenizer)
-		dump("attr value");//$NON-NLS-1$
-        yybegin(ST_JSP_DIRECTIVE_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
-}
-<ST_JSP_DIRECTIVE_NAME, ST_JSP_DIRECTIVE_NAME_WHITESPACE, ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS, ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE> {jspScriptletEnd} {
-	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;
-}
-
-<YYINITIAL> {jspCommentStart} {
-	if(Debug.debugTokenizer)
-		dump("\nJSP comment start");//$NON-NLS-1$
-	yybegin(ST_JSP_COMMENT);
-	return JSP_COMMENT_OPEN;
-}
-
-<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});
-	// abort early when an unescaped double quote is found in the EL
-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE)) {
-		yybegin(ST_ABORT_EMBEDDED);
-		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	}
-	else {
-		yybegin(enterState);
-	}
-	return PROXY_CONTEXT;
-}
-<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});
-	// abort early when an unescaped double quote is found in the VBL
-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE)) {
-		yybegin(ST_ABORT_EMBEDDED);
-		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	}
-	else {
-		yybegin(enterState);
-	}
-	return PROXY_CONTEXT;
-}
-<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});
-	// abort early when an unescaped single quote is found in the EL
-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
-		yybegin(ST_ABORT_EMBEDDED);
-		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	}
-	else {
-		yybegin(enterState);
-	}
-	return PROXY_CONTEXT;
-}
-<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});
-	// abort early when an unescaped single quote is found in the VBL
-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
-		yybegin(ST_ABORT_EMBEDDED);
-		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	}
-	else {
-		yybegin(enterState);
-	}
-	return PROXY_CONTEXT;
-}
-
-// unescaped double quote, return as ending region
-<ST_JSP_DQUOTED_EL,ST_JSP_DQUOTED_VBL> ["] {
-	return 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;
-}
-
-
-// paired escaped double quotes
-<ST_JSP_DQUOTED_EL> \\\" ([^\\]|\\[^"}]+)* \\\" {
-	return JSP_EL_QUOTED_CONTENT;
-}
-// everything else EL
-<ST_JSP_DQUOTED_EL> ([^\\}"]|\\[^"])+ {
-	return JSP_EL_CONTENT;
-}
-<ST_JSP_DQUOTED_EL> \\\" {
-	return JSP_EL_CONTENT;
-}
-// paired escaped quotes
-<ST_JSP_SQUOTED_EL> \\\' ([^\\]|\\[^'}]+)* \\\' {
-	return JSP_EL_QUOTED_CONTENT;
-}
-// everything else EL
-<ST_JSP_SQUOTED_EL> ([^\\}']|\\[^'])+ {
-	return JSP_EL_CONTENT;
-}
-<ST_JSP_SQUOTED_EL> \\\' {
-	return JSP_EL_CONTENT;
-}
-<ST_JSP_DQUOTED_EL,ST_JSP_SQUOTED_EL> } {
-	return JSP_EL_CLOSE;
-}
-
-
-// paired escaped quotes
-<ST_JSP_DQUOTED_VBL> \\\" ([^\\]|\\[^"}]+)* \\\" {
-	return JSP_VBL_QUOTED_CONTENT;
-}
-// everything else VBL
-<ST_JSP_DQUOTED_VBL> ([^\\}"]|\\[^"])+ {
-	return JSP_VBL_CONTENT;
-}
-<ST_JSP_DQUOTED_VBL> \\\" {
-	return JSP_VBL_CONTENT;
-}
-// paired escaped quotes
-<ST_JSP_SQUOTED_VBL> \\\' ([^\\]|\\[^'}]+)* \\\' {
-	return JSP_VBL_QUOTED_CONTENT;
-}
-// everything else VBL
-<ST_JSP_SQUOTED_VBL> ([^\\}']|\\[^'])+ {
-	return JSP_VBL_CONTENT;
-}
-<ST_JSP_SQUOTED_VBL> \\\' {
-	return JSP_VBL_CONTENT;
-}
-
-<ST_JSP_DQUOTED_VBL,ST_JSP_SQUOTED_VBL> } {
-	return JSP_VBL_CLOSE;
-}
-
-
-// XML content area EL
-<YYINITIAL> \x24\x7b[^\x7d]*/\x7d {
-	yybegin(ST_JSP_EL);
-	if(yylength() > 2)
-		yypushback(yylength() - 2);
-	fELlevel++;
-	fEmbeddedHint = XML_CONTENT;
-	fEmbeddedPostState = YYINITIAL;
-	assembleEmbeddedContainer(JSP_EL_OPEN, JSP_EL_CLOSE);
-	fEmbeddedHint = XML_CONTENT;
-	yybegin(YYINITIAL);
-	return PROXY_CONTEXT;
-}
-<ST_JSP_EL> \x24\x7b {
-	fELlevel++;
-	if(fELlevel == 1) {
-		return JSP_EL_OPEN;
-	}
-}
-// XML content area VBL
-<YYINITIAL> \x23\x7b[^\x7d]*/\x7d {
-	yybegin(ST_JSP_VBL);
-	if(yylength() > 2)
-		yypushback(yylength() - 2);
-	fELlevel++;
-	fEmbeddedHint = XML_CONTENT;
-	fEmbeddedPostState = YYINITIAL;
-	assembleEmbeddedContainer(JSP_VBL_OPEN, JSP_VBL_CLOSE);
-	fEmbeddedHint = XML_CONTENT;
-	yybegin(YYINITIAL);
-	return PROXY_CONTEXT;
-}
-<ST_JSP_VBL> \x23\x7b {
-	fELlevel++;
-	if(fELlevel == 1) {
-		return JSP_VBL_OPEN;
-	}
-}
-// return anything not starting quotes or ending the VBL as content
-<ST_JSP_VBL> [^\x7d\x22\x27]* {
-	return JSP_VBL_CONTENT;
-}
-// return anything not starting quotes or ending the EL as content
-<ST_JSP_EL> [^\x7d\x22\x27]* {
-	return JSP_EL_CONTENT;
-}
-
-
-// quotes
-<ST_JSP_EL> \x22 {
-	yybegin(ST_JSP_EL_DQUOTES);
-	return JSP_EL_DQUOTE;
-}
-<ST_JSP_EL_DQUOTES> [^\x22]+/\x22 {
-	yybegin(ST_JSP_EL_DQUOTES_END);
-	return JSP_EL_QUOTED_CONTENT;
-}
-<ST_JSP_EL_DQUOTES_END> \x22 {
-	yybegin(ST_JSP_EL);
-	return JSP_EL_DQUOTE;
-}
-<ST_JSP_EL> \x27 {
-	yybegin(ST_JSP_EL_SQUOTES);
-	return JSP_EL_SQUOTE;
-}
-<ST_JSP_EL_SQUOTES> [^\x27]+/\x27 {
-	yybegin(ST_JSP_EL_SQUOTES_END);
-	return JSP_EL_QUOTED_CONTENT;
-}
-<ST_JSP_EL_SQUOTES_END> \x27 {
-	yybegin(ST_JSP_EL);
-	return JSP_EL_SQUOTE;
-}
-// quotes
-<ST_JSP_VBL> \x22 {
-	yybegin(ST_JSP_VBL_DQUOTES);
-	return JSP_VBL_DQUOTE;
-}
-<ST_JSP_VBL_DQUOTES> [^\x22]+/\x22 {
-	yybegin(ST_JSP_VBL_DQUOTES_END);
-	return JSP_VBL_QUOTED_CONTENT;
-}
-<ST_JSP_VBL_DQUOTES_END> \x22 {
-	yybegin(ST_JSP_VBL);
-	return JSP_VBL_DQUOTE;
-}
-<ST_JSP_VBL> \x27 {
-	yybegin(ST_JSP_VBL_SQUOTES);
-	return JSP_VBL_SQUOTE;
-}
-<ST_JSP_VBL_SQUOTES> [^\x27]+/\x27 {
-	yybegin(ST_JSP_VBL_SQUOTES_END);
-	return JSP_VBL_QUOTED_CONTENT;
-}
-<ST_JSP_VBL_SQUOTES_END> \x27 {
-	yybegin(ST_JSP_VBL);
-	return JSP_VBL_SQUOTE;
-}
-
-// unquoted content
-<ST_JSP_EL> ([^}\x27\x22\x24]|\x24[^\x7b\x27\x22])+ {
-	//System.out.println(JSP_EL_CONTENT+ ":[" + yytext() + "]");
-	return JSP_EL_CONTENT;
-}
-<ST_JSP_EL> } {
-	fELlevel--;
-	if(fELlevel == 0) {
-		yybegin(YYINITIAL);
-		return JSP_EL_CLOSE;
-	}
-	return JSP_EL_CONTENT;
-}
-<ST_JSP_VBL> } {
-	fELlevel--;
-	if(fELlevel == 0) {
-		yybegin(YYINITIAL);
-		return JSP_VBL_CLOSE;
-	}
-	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 {
-	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-	}
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	fStateStack.push(yystate());
-	if(yylength() > 2)
-		yypushback(yylength() -2);
-	if(Debug.debugTokenizer)
-		dump("EL in attr value");//$NON-NLS-1$
-	yybegin(ST_JSP_EL);
-	fELlevel++;
-	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE});
-	fStateStack.pop();
-	yybegin(ST_XML_ATTRIBUTE_NAME);
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-	return PROXY_CONTEXT;
-}
-// VBL unquoted in tag or attribute values
-<ST_XML_ATTRIBUTE_VALUE> \x23\x7b[^\x7d]+/\x7d {
-	if (Debug.debugTokenizer) {
-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$
-	}
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-	fStateStack.push(yystate());
-	if(yylength() > 2)
-		yypushback(yylength() -2);
-	if(Debug.debugTokenizer)
-		dump("VBL in attr value");//$NON-NLS-1$
-	yybegin(ST_JSP_VBL);
-	fELlevel++;
-	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE});
-	fStateStack.pop();
-	yybegin(ST_XML_ATTRIBUTE_NAME);
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-	return PROXY_CONTEXT;
-}
-
-<ST_JSP_COMMENT> .|\r|\n {
-	if(Debug.debugTokenizer)
-		dump("\nJSP comment text");//$NON-NLS-1$
-	return scanJSPCommentText();
-}
-<ST_JSP_COMMENT_END> {jspCommentEnd} {
-	if(Debug.debugTokenizer)
-		dump("\nJSP comment close");//$NON-NLS-1$
-	yybegin(YYINITIAL);
-	return JSP_COMMENT_CLOSE;
-}
-
-// XML misc
-
-{CDStart} {
-	if(Debug.debugTokenizer)
-		dump("\nCDATA start");//$NON-NLS-1$
-	fStateStack.push(yystate());
-	yybegin(ST_CDATA_TEXT);
-	return XML_CDATA_OPEN;
-}
-<ST_CDATA_TEXT> .|\r|\n {
-	if(Debug.debugTokenizer)
-		dump("CDATA text");//$NON-NLS-1$
-	fEmbeddedPostState = ST_CDATA_TEXT;
-	fEmbeddedHint = XML_CDATA_TEXT;
-	String returnedContext = doScan("]]>", false, true, true, XML_CDATA_TEXT, ST_CDATA_END,  ST_CDATA_END);//$NON-NLS-1$
-	if(returnedContext == XML_CDATA_TEXT)
-		yybegin(ST_CDATA_END);
-	return returnedContext;
-}
-<ST_CDATA_END> {CDEnd} {
-	if(Debug.debugTokenizer)
-		dump("CDATA end");//$NON-NLS-1$
-	yybegin(fStateStack.pop());
-	return XML_CDATA_CLOSE;
-}
-
-<YYINITIAL> {PEReference} {
-	if(Debug.debugTokenizer)
-		dump("\nPEReference");//$NON-NLS-1$
-	return XML_PE_REFERENCE;
-}
-<YYINITIAL> {CharRef} {
-	if(Debug.debugTokenizer)
-		dump("\nCharRef");//$NON-NLS-1$
-	return XML_CHAR_REFERENCE;
-}
-<YYINITIAL> {EntityRef} {
-	if(Debug.debugTokenizer)
-		dump("\nEntityRef");//$NON-NLS-1$
-	return XML_ENTITY_REFERENCE;
-}
-
-<YYINITIAL> {PIstart} {
-	if(Debug.debugTokenizer)
-		dump("\nprocessing instruction start");//$NON-NLS-1$
-	yybegin(ST_PI);
-        return XML_PI_OPEN;
-}
-// the next three are order dependent
-<ST_PI> ((X|x)(M|m)(L|l)) {
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction target");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_XML_PI_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
-}
-<ST_PI> ([iI][mM][pP][oO][rR][tT]) {
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction target");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_DHTML_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
-}
-<ST_PI> {Name} {
-	if(Debug.debugTokenizer)
-		dump("processing instruction target");//$NON-NLS-1$
-	fEmbeddedHint = XML_CONTENT;
-        yybegin(ST_PI_WS);
-        return XML_TAG_NAME;
-}
-<ST_PI_WS> {S}+ {
-        yybegin(ST_PI_CONTENT);
-        return WHITE_SPACE;
-}
-<ST_PI, ST_PI_WS> \?> {
-	if(Debug.debugTokenizer)
-		dump("processing instruction end");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
-}
-<ST_PI_CONTENT> . {
-		// block scan until close is found
-	return doScan("?>", false, false, false, XML_PI_CONTENT, ST_XML_PI_TAG_CLOSE, ST_XML_PI_TAG_CLOSE);
-}
-<ST_PI_CONTENT,ST_XML_PI_TAG_CLOSE> \?> {
-		// ended with nothing inside
-		fEmbeddedHint = UNDEFINED;
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
-}
-
-<ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_EQUALS> {Name} {
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction attribute name");//$NON-NLS-1$
-        yybegin(ST_XML_PI_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
-}
-<ST_XML_PI_EQUALS> {Eq} {
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction '='");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-        yybegin(ST_XML_PI_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
-}
-/* the value was found, look for the next name */
-<ST_XML_PI_ATTRIBUTE_VALUE> {AttValue} {
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction attribute value");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_XML_PI_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
-}
-/* the PI's close was found */
-<ST_XML_PI_EQUALS, ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_ATTRIBUTE_VALUE> {PIend} {
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction end");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
-}
-// DHTML
-<ST_DHTML_ATTRIBUTE_NAME, ST_DHTML_EQUALS> {Name} {
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction attribute name");//$NON-NLS-1$
-        yybegin(ST_DHTML_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
-}
-<ST_DHTML_EQUALS> {Eq} {
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction '='");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;
-	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;
-        yybegin(ST_DHTML_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
-}
-/* the value was found, look for the next name */
-<ST_DHTML_ATTRIBUTE_VALUE> {AttValue} | ([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction attribute value");//$NON-NLS-1$
-	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;
-	fEmbeddedPostState = ST_XML_EQUALS;
-        yybegin(ST_DHTML_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
-}
-/* The DHTML PI's close was found */
-<ST_DHTML_EQUALS, ST_DHTML_ATTRIBUTE_NAME, ST_DHTML_ATTRIBUTE_VALUE> [/]*> {
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction end");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
-}
-
-// XML declarations
-
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE> {genericTagOpen}! {
-	fStateStack.push(yystate());
-	if(Debug.debugTokenizer)
-		dump("\ndeclaration start");//$NON-NLS-1$
-        yybegin(ST_XML_DECLARATION);
-	return XML_DECLARATION_OPEN;
-}
-<ST_XML_DECLARATION> [Ee][Ll][Ee][Mm][Ee][Nn][Tt] {
-	if(Debug.debugTokenizer)
-		dump("element");//$NON-NLS-1$
-	yybegin(ST_XML_ELEMENT_DECLARATION);
-	return XML_ELEMENT_DECLARATION;
-}
-<ST_XML_DECLARATION> [Dd][Oo][Cc][Tt][Yy][Pp][Ee] {
-	if(Debug.debugTokenizer)
-		dump("doctype");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_DECLARATION);
-	return XML_DOCTYPE_DECLARATION;
-}
-<ST_XML_DECLARATION> [Aa][Tt][Tt][Ll][Ii][Ss][Tt] {
-	if(Debug.debugTokenizer)
-		dump("attlist");//$NON-NLS-1$
-	yybegin(ST_XML_ATTLIST_DECLARATION);
-	return XML_ATTLIST_DECLARATION;
-}
-
-// begin DOCTYPE handling procedure
-<ST_XML_DOCTYPE_DECLARATION, ST_XML_DOCTYPE_EXTERNAL_ID, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DECLARATION_CLOSE> \[[^\]]*\] {
-	return XML_DOCTYPE_INTERNAL_SUBSET;
-}
-
-<ST_XML_DOCTYPE_DECLARATION> {Name} {
-	if(Debug.debugTokenizer)
-		dump("doctype type");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_EXTERNAL_ID);
-	return XML_DOCTYPE_NAME;
-}
-<ST_XML_DOCTYPE_EXTERNAL_ID> [Pp][Uu][Bb][Ll][Ii][Cc] {
-	if(Debug.debugTokenizer)
-		dump("doctype external id");//$NON-NLS-1$
-	fEmbeddedHint = XML_DOCTYPE_EXTERNAL_ID_PUBREF;
-	yybegin(ST_XML_DOCTYPE_ID_PUBLIC);
-	return XML_DOCTYPE_EXTERNAL_ID_PUBLIC;
-}
-<ST_XML_DOCTYPE_EXTERNAL_ID> [Ss][Yy][Ss][Tt][Ee][Mm] {
-	if(Debug.debugTokenizer)
-		dump("doctype external id");//$NON-NLS-1$
-	fEmbeddedHint = XML_DOCTYPE_EXTERNAL_ID_SYSREF;
-	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
-	return XML_DOCTYPE_EXTERNAL_ID_SYSTEM;
-}
-<ST_XML_DOCTYPE_ID_PUBLIC> {AttValue}|{PubidLiteral} {
-	if(Debug.debugTokenizer)
-		dump("doctype public reference");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-	fEmbeddedPostState = YYINITIAL;
-	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
-	return XML_DOCTYPE_EXTERNAL_ID_PUBREF;
-}
-<ST_XML_DOCTYPE_ID_SYSTEM> {AttValue}|{SystemLiteral} {
-	if(Debug.debugTokenizer)
-		dump("doctype system reference");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-	fEmbeddedPostState = YYINITIAL;
-	yybegin(ST_XML_DECLARATION_CLOSE);
-	return XML_DOCTYPE_EXTERNAL_ID_SYSREF;
-}
-// end DOCTYPE handling
-
-// begin ELEMENT handling procedure
-<ST_XML_ELEMENT_DECLARATION> {AttValue}|{PubidLiteral} {
-	if(Debug.debugTokenizer)
-		dump("elementdecl name");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-	fEmbeddedPostState = YYINITIAL;
-	yybegin(ST_XML_ELEMENT_DECLARATION_CONTENT);
-	return XML_ELEMENT_DECL_NAME;
-}
-<ST_XML_ELEMENT_DECLARATION_CONTENT> [^>]* {
-	if(Debug.debugTokenizer)
-		dump("elementdecl contentspec");//$NON-NLS-1$
-	return XML_ELEMENT_DECL_CONTENT;
-}
-
-<ST_XML_ELEMENT_DECLARATION_CONTENT> {genericTagClose} {
-	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;
-}
-// end ELEMENT handling
-
-// begin ATTLIST handling procedure
-<ST_XML_ATTLIST_DECLARATION> {AttValue}|{PubidLiteral} {
-	if(Debug.debugTokenizer)
-		dump("attlist name");//$NON-NLS-1$
-	fEmbeddedHint = UNDEFINED;
-	fEmbeddedPostState = YYINITIAL;
-	yybegin(ST_XML_ATTLIST_DECLARATION_CONTENT);
-	return XML_ATTLIST_DECL_NAME;
-}
-<ST_XML_ATTLIST_DECLARATION_CONTENT> [^>]* {
-	if(Debug.debugTokenizer)
-		dump("attlist contentspec");//$NON-NLS-1$
-	return XML_ATTLIST_DECL_CONTENT;
-}
-
-<ST_XML_ATTLIST_DECLARATION_CONTENT> {genericTagClose} {
-	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;
-}
-// end ATTLIST handling
-
-<ST_XML_DECLARATION, ST_XML_DOCTYPE_DECLARATION, ST_XML_DOCTYPE_EXTERNAL_ID, ST_XML_ATTLIST_DECLARATION, ST_XML_ELEMENT_DECLARATION, ST_XML_DECLARATION_CLOSE, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_EXTERNAL_ID> {genericTagClose} {
-	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;
-}
-// end DECLARATION handling
-
-<YYINITIAL> ([^<&%\x24\x23]*|\x23+|\x24+|[&%]{S}+{Name}[^&%<]*|[\x24\x23][^\x7b<&%]|[&%]{Name}([^;&%<]*|{S}+;*)) {
-	if(Debug.debugTokenizer)
-		dump("\nXML content");//$NON-NLS-1$
-	return XML_CONTENT;
-}
-
-
-<ST_BLOCK_TAG_SCAN> .|\r|\n {
-		return doBlockTagScan();
-	}
-
-. {
-	if (Debug.debugTokenizer)
-		System.out.println("!!!unexpected!!!: \"" + yytext() + "\":" + //$NON-NLS-2$//$NON-NLS-1$
-			yychar + "-" + (yychar + yylength()));//$NON-NLS-1$
-	return UNDEFINED;
-}
-
-\040 {
-	if(Debug.debugTokenizer)
-		dump("SPACE");//$NON-NLS-1$
-	return WHITE_SPACE;
-}
-\011 {
-	if(Debug.debugTokenizer)
-		dump("0x9");//$NON-NLS-1$
-	return WHITE_SPACE;
-}
-\015 
-{
-	if(Debug.debugTokenizer)
-		dump("CARRIAGE RETURN");//$NON-NLS-1$
-	return WHITE_SPACE;
-}
-\012 {
-	if(Debug.debugTokenizer)
-		dump("LINE FEED");//$NON-NLS-1$
-	return WHITE_SPACE;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.java
deleted file mode 100644
index d0537ad..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.java
+++ /dev/null
@@ -1,1881 +0,0 @@
-/* The following code was generated by JFlex 1.2.2 on 8/16/05 3:07 PM */
-
-/*******************************************************************************
- * 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;
-
-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.internal.util.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 8/16/05 3:07 PM 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\51"+
-    "\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\54\1\1\1\43\1\2\1\4\1\16"+
-    "\1\32\1\55\1\30\1\31\1\35\1\52\1\34\1\34\1\40\1\34"+
-    "\1\34\1\26\1\25\1\42\1\41\1\45\1\34\1\36\1\37\1\33"+
-    "\1\53\2\34\1\23\1\44\1\34\1\27\1\0\1\20\1\0\1\10"+
-    "\1\0\1\47\1\55\1\56\1\50\1\35\1\52\1\34\1\34\1\40"+
-    "\2\34\1\26\1\25\1\42\1\41\1\45\1\34\1\36\1\37\1\46"+
-    "\1\53\1\34\1\34\1\24\1\44\1\34\1\0\1\0\72\0\1\60"+
-    "\10\0\27\57\1\0\37\57\1\0\72\57\2\0\13\57\2\0\10\57"+
-    "\1\0\65\57\1\0\104\57\11\0\44\57\3\0\2\57\4\0\36\57"+
-    "\70\0\131\57\22\0\7\57\16\0\2\60\56\0\106\60\32\0\2\60"+
-    "\44\0\1\57\1\60\3\57\1\0\1\57\1\0\24\57\1\0\54\57"+
-    "\1\0\7\57\3\0\1\57\1\0\1\57\1\0\1\57\1\0\1\57"+
-    "\1\0\22\57\15\0\14\57\1\0\102\57\1\0\14\57\1\0\44\57"+
-    "\1\0\4\60\11\0\65\57\2\0\2\57\2\0\2\57\3\0\34\57"+
-    "\2\0\10\57\2\0\2\57\67\0\46\57\2\0\1\57\7\0\46\57"+
-    "\12\0\21\60\1\0\27\60\1\0\3\60\1\0\1\60\1\0\2\60"+
-    "\1\0\1\60\13\0\33\57\5\0\3\57\56\0\32\57\5\0\1\60"+
-    "\12\57\10\60\15\0\12\60\6\0\1\60\107\57\2\0\5\57\1\0"+
-    "\17\57\1\0\4\57\1\0\1\57\17\60\2\57\2\60\1\0\4\60"+
-    "\2\0\12\60\u0207\0\3\60\1\0\65\57\2\0\1\60\1\57\20\60"+
-    "\3\0\4\60\3\0\12\57\2\60\2\0\12\60\21\0\3\60\1\0"+
-    "\10\57\2\0\2\57\2\0\26\57\1\0\7\57\1\0\1\57\3\0"+
-    "\4\57\2\0\1\60\1\0\7\60\2\0\2\60\2\0\3\60\11\0"+
-    "\1\60\4\0\2\57\1\0\3\57\2\60\2\0\12\60\2\57\20\0"+
-    "\1\60\2\0\6\57\4\0\2\57\2\0\26\57\1\0\7\57\1\0"+
-    "\2\57\1\0\2\57\1\0\2\57\2\0\1\60\1\0\5\60\4\0"+
-    "\2\60\2\0\3\60\13\0\4\57\1\0\1\57\7\0\12\60\2\60"+
-    "\3\57\14\0\3\60\1\0\7\57\1\0\1\57\1\0\3\57\1\0"+
-    "\26\57\1\0\7\57\1\0\2\57\1\0\5\57\2\0\1\60\1\57"+
-    "\10\60\1\0\3\60\1\0\3\60\22\0\1\57\5\0\12\60\21\0"+
-    "\3\60\1\0\10\57\2\0\2\57\2\0\26\57\1\0\7\57\1\0"+
-    "\2\57\2\0\4\57\2\0\1\60\1\57\6\60\3\0\2\60\2\0"+
-    "\3\60\10\0\2\60\4\0\2\57\1\0\3\57\4\0\12\60\22\0"+
-    "\2\60\1\0\6\57\3\0\3\57\1\0\4\57\3\0\2\57\1\0"+
-    "\1\57\1\0\2\57\3\0\2\57\3\0\3\57\3\0\10\57\1\0"+
-    "\3\57\4\0\5\60\3\0\3\60\1\0\4\60\11\0\1\60\17\0"+
-    "\11\60\21\0\3\60\1\0\10\57\1\0\3\57\1\0\27\57\1\0"+
-    "\12\57\1\0\5\57\4\0\7\60\1\0\3\60\1\0\4\60\7\0"+
-    "\2\60\11\0\2\57\4\0\12\60\22\0\2\60\1\0\10\57\1\0"+
-    "\3\57\1\0\27\57\1\0\12\57\1\0\5\57\4\0\7\60\1\0"+
-    "\3\60\1\0\4\60\7\0\2\60\7\0\1\57\1\0\2\57\4\0"+
-    "\12\60\22\0\2\60\1\0\10\57\1\0\3\57\1\0\27\57\1\0"+
-    "\20\57\4\0\6\60\2\0\3\60\1\0\4\60\11\0\1\60\10\0"+
-    "\2\57\4\0\12\60\221\0\56\57\1\0\1\57\1\60\2\57\7\60"+
-    "\5\0\6\57\1\60\10\60\1\0\12\60\47\0\2\57\1\0\1\57"+
-    "\2\0\2\57\1\0\1\57\2\0\1\57\6\0\4\57\1\0\7\57"+
-    "\1\0\3\57\1\0\1\57\1\0\1\57\2\0\2\57\1\0\2\57"+
-    "\1\0\1\57\1\60\2\57\6\60\1\0\2\60\1\57\2\0\5\57"+
-    "\1\0\1\60\1\0\6\60\2\0\12\60\76\0\2\60\6\0\12\60"+
-    "\13\0\1\60\1\0\1\60\1\0\1\60\4\0\2\60\10\57\1\0"+
-    "\41\57\7\0\24\60\1\0\6\60\4\0\6\60\1\0\1\60\1\0"+
-    "\25\60\3\0\7\60\1\0\1\60\346\0\46\57\12\0\47\57\11\0"+
-    "\1\57\1\0\2\57\1\0\3\57\1\0\1\57\1\0\2\57\1\0"+
-    "\5\57\51\0\1\57\1\0\1\57\1\0\1\57\13\0\1\57\1\0"+
-    "\1\57\1\0\1\57\3\0\2\57\3\0\1\57\5\0\3\57\1\0"+
-    "\1\57\1\0\1\57\1\0\1\57\1\0\1\57\3\0\2\57\3\0"+
-    "\2\57\1\0\1\57\50\0\1\57\11\0\1\57\2\0\1\57\2\0"+
-    "\2\57\7\0\2\57\1\0\1\57\1\0\7\57\50\0\1\57\4\0"+
-    "\1\57\10\0\1\57\u0c06\0\234\57\4\0\132\57\6\0\26\57\2\0"+
-    "\6\57\2\0\46\57\2\0\6\57\2\0\10\57\1\0\1\57\1\0"+
-    "\1\57\1\0\1\57\1\0\37\57\2\0\65\57\1\0\7\57\1\0"+
-    "\1\57\3\0\3\57\1\0\7\57\3\0\4\57\2\0\6\57\4\0"+
-    "\15\57\5\0\3\57\1\0\7\57\323\0\15\60\4\0\1\60\104\0"+
-    "\1\57\3\0\2\57\2\0\1\57\121\0\3\57\u0e82\0\1\60\1\0"+
-    "\1\57\31\0\11\57\6\60\1\0\5\60\13\0\124\57\4\0\2\60"+
-    "\2\0\2\60\2\0\132\57\1\0\3\60\6\0\50\57\u1cd3\0\u51a6\57"+
-    "\u0c5a\0\u2ba4\57\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,    49,    98,   147,   196,   245,   294,   343,   392,   441, 
-      490,   539,   588,   637,   686,   735,   784,   833,   882,   931, 
-      980,  1029,  1078,  1127,  1176,  1225,  1274,  1323,  1372,  1421, 
-     1470,  1519,  1568,  1617,  1666,  1715,  1764,  1715,  1764,  1813, 
-     1715,  1715,  1764,  1862,  1911,  1960,  2009,  2058,  2107,  2156, 
-     1715,  1764,  2205,  2254,  2303,  1715,  2352,  2352,  2401,  2450, 
-     2499,  2205,  1715,  2548,  2597,  1715,  2646,  2695,  2744,  2793, 
-     2842,  2891,  1715,  2940,  2989,  3038,  3087,  1715,  3136,  3185, 
-     3234,  3283,  3332,  1715,  3381,  3430,  3479,  3528,  3577,  3626, 
-     3675,  3724,  3724,  3773,  3822,  3871,  3920,  3920,  3969,  4018, 
-     4067,  4116,  4116,  4165,  4214,  4263,  4312,  1715,  4361,  4361, 
-     4410,  4459,  4508,  4557,  1715,  1715,  1764,  1715,  1715,  4606, 
-     4655,  4704,  4753,  4802,  4851,  4900,  4949,  1715,  4998,  5047, 
-     1715,  1715,  2352,  5096,  2450,  1715,  5145,  2499,  2548,  2646, 
-     2695,  5194,  2744,  1715,  5243,  2793,  1715,  3136,  5292,  3234, 
-     1715,  5341,  3283,  4606,  5390,  5439,  5488,  3528,  1715,  5537, 
-     5586,  3724,  5635,  3773,  1715,  5684,  5733,  5782,  5782,  5831, 
-     5880,  3871,  3724,  3920,  5929,  3969,  1715,  5978,  4018,  4067, 
-     3920,  4116,  6027,  4165,  1715,  6076,  6125,  6174,  6174,  6223, 
-     6272,  6321,  4361,  6370,  4410,  1715,  6419,  6468,  6517,  6517, 
-     6566,  6615,  6664,  6713,  6762,  6811,  6860,  1715,  6909,  6958, 
-     1715,  1715,  1715,  2009,  7007,  7056,  7105,  7154,  7203,  7252, 
-     5684,  7301,  7301,  6076,  7350,  7350,  7399,  6419,  7448,  7448, 
-     7497,  1715,  7546,  7595,  1715,  7644,  7693,  7742,  7791,  7840, 
-     7889,  7938,  5831,  6223,  7987,  6566,  8036,  8085,  8134,  8183, 
-     8232,  8281,  8330,  8379,  8428,  8477,  8526,  8575,  8624,  8673, 
-     8722,  1715,  1715,  8771,  8820,  8869,  8918,  1715,  1715,  1715, 
-     8967,  9016,  9065,  9114,  9163,  1715,  4263,  4508
-  };
-
-  /** 
-   * 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\41\40\1\44"+
-    "\1\45\57\44\1\46\1\47\16\46\1\50\1\46\1\51"+
-    "\36\46\1\52\1\53\57\52\1\46\1\47\5\46\1\54"+
-    "\12\46\1\51\37\46\1\47\2\46\1\55\1\56\2\46"+
-    "\1\57\3\46\1\56\5\46\1\56\2\60\2\57\1\46"+
-    "\10\57\1\61\2\57\1\46\5\57\1\46\2\57\1\46"+
-    "\3\57\2\46\1\47\2\46\1\55\1\62\6\46\1\62"+
-    "\5\46\1\62\36\46\1\63\1\64\2\63\1\65\15\63"+
-    "\1\51\36\63\1\46\1\47\2\46\1\66\1\56\2\46"+
-    "\1\67\3\46\1\56\5\46\1\56\4\67\1\46\13\67"+
-    "\1\46\5\67\1\46\2\67\1\46\3\67\2\46\1\47"+
-    "\2\46\1\66\1\56\2\46\1\67\3\46\1\56\5\46"+
-    "\1\56\4\67\1\46\13\67\1\70\5\67\1\46\2\67"+
-    "\1\46\3\67\1\46\1\71\1\47\1\46\1\72\1\73"+
-    "\1\56\3\71\1\74\1\71\1\75\1\56\5\71\1\56"+
-    "\36\71\1\46\1\47\2\46\1\76\15\46\1\51\37\46"+
-    "\1\47\1\77\1\100\1\46\1\56\2\46\1\101\3\46"+
-    "\1\56\5\46\1\56\4\101\1\46\13\101\1\46\5\101"+
-    "\1\46\2\101\1\46\3\101\2\46\1\47\1\77\1\100"+
-    "\1\46\1\56\2\46\1\101\3\46\1\56\5\46\1\56"+
-    "\4\101\1\46\13\101\1\102\5\101\1\46\2\101\1\46"+
-    "\3\101\1\46\1\103\1\47\1\77\1\104\1\103\1\56"+
-    "\3\103\1\105\1\103\1\106\1\56\5\103\1\56\36\103"+
-    "\1\46\1\47\3\46\1\56\6\46\1\56\5\46\1\56"+
-    "\36\46\1\107\1\110\1\111\1\112\4\107\1\113\12\107"+
-    "\4\114\1\107\13\114\1\107\5\114\1\107\2\114\1\107"+
-    "\3\114\1\107\1\46\1\110\1\111\1\112\1\46\1\56"+
-    "\2\46\1\115\3\46\1\56\5\46\1\56\4\115\1\46"+
-    "\13\115\1\46\5\115\1\46\2\115\1\46\3\115\2\46"+
-    "\1\110\1\111\1\112\1\46\1\56\2\46\1\115\3\46"+
-    "\1\56\5\46\1\56\4\115\1\46\13\115\1\116\5\115"+
-    "\1\46\2\115\1\46\3\115\1\46\1\117\1\110\1\111"+
-    "\1\120\1\117\1\56\3\117\1\121\1\117\1\122\1\56"+
-    "\5\117\1\56\36\117\1\46\1\123\1\124\2\46\1\56"+
-    "\6\46\1\56\5\46\1\56\6\46\1\125\1\126\2\46"+
-    "\1\127\11\46\1\126\1\125\11\46\1\47\1\124\2\46"+
-    "\1\56\6\46\1\56\5\46\1\56\4\46\1\130\32\46"+
-    "\1\47\1\124\2\46\1\56\2\46\1\131\3\46\1\56"+
-    "\5\46\1\56\4\131\1\130\13\131\1\46\5\131\1\46"+
-    "\2\131\1\46\3\131\2\46\1\47\1\124\2\46\1\56"+
-    "\6\46\1\56\5\46\1\56\4\46\1\130\7\46\1\132"+
-    "\5\46\1\133\13\46\1\134\1\47\1\124\1\135\1\134"+
-    "\1\56\3\134\1\136\1\134\1\137\1\56\5\134\1\56"+
-    "\4\134\1\140\31\134\1\141\1\47\1\124\1\142\1\141"+
-    "\1\56\3\141\1\143\1\141\1\144\1\56\5\141\1\56"+
-    "\4\141\1\145\31\141\1\146\1\47\1\124\1\147\1\146"+
-    "\1\56\3\146\1\150\1\146\1\151\1\56\5\146\1\56"+
-    "\36\146\1\152\1\153\1\154\56\152\1\155\1\47\1\124"+
-    "\1\156\1\155\1\56\3\155\1\157\1\155\1\160\1\56"+
-    "\5\155\1\56\36\155\1\161\1\162\1\163\56\161\1\164"+
-    "\1\165\57\164\1\40\1\0\10\40\1\0\4\40\1\0"+
-    "\41\40\3\0\1\166\1\167\14\0\1\170\44\0\1\171"+
-    "\2\0\1\172\3\0\1\171\5\0\1\171\4\172\1\0"+
-    "\13\172\1\0\5\172\1\173\2\172\1\0\3\172\6\0"+
-    "\1\171\2\0\1\174\3\0\1\171\5\0\1\171\4\174"+
-    "\1\0\13\174\1\0\5\174\1\0\2\174\1\0\3\174"+
-    "\103\0\1\175\57\0\1\176\47\0\1\177\53\0\1\200"+
-    "\63\0\1\56\6\0\1\56\5\0\1\56\44\0\3\57"+
-    "\4\0\1\57\5\0\4\57\1\0\13\57\1\0\5\57"+
-    "\1\0\2\57\1\0\4\57\6\0\3\57\4\0\1\57"+
-    "\5\0\2\57\1\201\1\57\1\0\13\57\1\0\5\57"+
-    "\1\0\2\57\1\0\4\57\6\0\3\57\4\0\1\57"+
-    "\5\0\2\57\1\202\1\57\1\0\13\57\1\0\5\57"+
-    "\1\0\2\57\1\0\4\57\5\0\1\62\6\0\1\62"+
-    "\5\0\1\62\40\0\1\203\60\0\1\204\64\0\3\67"+
-    "\4\0\1\67\5\0\4\67\1\0\13\67\1\0\5\67"+
-    "\1\0\2\67\1\0\4\67\1\71\2\0\1\205\1\71"+
-    "\1\0\3\71\1\0\1\71\2\0\5\71\1\0\37\71"+
-    "\1\0\1\204\1\205\1\71\1\0\3\71\1\0\1\71"+
-    "\2\0\5\71\1\0\36\71\1\74\1\0\1\206\1\207"+
-    "\1\74\1\206\3\74\1\210\1\74\2\206\5\74\1\206"+
-    "\36\74\1\75\1\0\1\211\1\212\1\75\1\211\3\75"+
-    "\1\211\1\75\1\210\1\211\5\75\1\211\36\75\2\0"+
-    "\1\77\1\213\63\0\3\101\4\0\1\101\5\0\4\101"+
-    "\1\0\13\101\1\0\5\101\1\0\2\101\1\0\4\101"+
-    "\1\103\2\0\1\214\1\103\1\0\3\103\1\0\1\103"+
-    "\2\0\5\103\1\0\37\103\1\0\1\77\1\215\1\103"+
-    "\1\0\3\103\1\0\1\103\2\0\5\103\1\0\36\103"+
-    "\1\105\1\0\1\216\1\217\1\105\1\216\3\105\1\220"+
-    "\1\105\2\216\5\105\1\216\36\105\1\106\1\0\1\221"+
-    "\1\222\1\106\1\221\3\106\1\221\1\106\1\220\1\221"+
-    "\5\106\1\221\36\106\1\107\3\0\17\107\4\0\1\107"+
-    "\13\0\1\107\5\0\1\107\2\0\1\107\3\0\1\107"+
-    "\3\0\1\166\15\0\1\170\41\0\1\223\56\0\1\107"+
-    "\3\0\2\107\3\113\4\107\1\113\5\107\4\114\1\107"+
-    "\13\114\1\107\5\114\1\107\2\114\1\107\3\114\1\113"+
-    "\6\0\3\114\4\0\1\114\5\0\4\114\1\0\13\114"+
-    "\1\0\5\114\1\0\2\114\1\0\4\114\6\0\3\115"+
-    "\4\0\1\115\5\0\4\115\1\0\13\115\1\0\5\115"+
-    "\1\0\2\115\1\0\4\115\1\117\2\0\1\224\1\117"+
-    "\1\0\3\117\1\0\1\117\2\0\5\117\1\0\37\117"+
-    "\1\0\1\223\1\224\1\117\1\0\3\117\1\0\1\117"+
-    "\2\0\5\117\1\0\36\117\1\121\1\0\1\225\1\226"+
-    "\1\121\1\225\3\121\1\227\1\121\2\225\5\121\1\225"+
-    "\36\121\1\122\1\0\1\230\1\231\1\122\1\230\3\122"+
-    "\1\230\1\122\1\227\1\230\5\122\1\230\36\122\3\0"+
-    "\1\166\15\0\1\232\100\0\1\233\52\0\1\234\12\0"+
-    "\1\234\40\0\1\235\32\0\20\236\1\237\40\236\6\0"+
-    "\3\131\4\0\1\131\5\0\4\131\1\0\13\131\1\0"+
-    "\5\131\1\0\2\131\1\0\4\131\44\0\1\240\67\0"+
-    "\1\241\5\0\1\134\2\0\1\242\1\134\1\0\3\134"+
-    "\1\0\1\134\2\0\5\134\1\0\36\134\1\136\1\0"+
-    "\1\243\1\244\1\136\1\243\3\136\1\245\1\136\2\243"+
-    "\5\136\1\243\36\136\1\246\1\0\1\247\1\250\1\251"+
-    "\1\247\3\251\1\247\1\246\1\252\1\253\3\251\1\246"+
-    "\1\251\1\253\4\251\1\246\27\251\2\246\1\140\2\236"+
-    "\1\254\1\140\1\236\3\140\1\236\1\140\2\236\3\140"+
-    "\1\255\1\140\1\236\36\140\1\141\2\0\1\256\1\141"+
-    "\1\0\3\141\1\0\1\141\2\0\5\141\1\0\36\141"+
-    "\1\143\2\257\1\260\1\143\1\257\3\143\1\261\1\143"+
-    "\2\257\5\143\1\257\36\143\1\144\2\262\1\263\1\144"+
-    "\1\262\3\144\1\262\1\144\1\261\1\262\5\144\1\262"+
-    "\36\144\1\145\2\236\1\264\1\145\1\236\3\145\1\236"+
-    "\1\145\2\236\3\145\1\265\1\145\1\236\36\145\1\146"+
-    "\2\0\1\266\1\146\1\0\3\146\1\0\1\146\2\0"+
-    "\5\146\1\0\36\146\1\150\1\0\1\267\1\270\1\150"+
-    "\1\267\3\150\1\271\1\150\2\267\5\150\1\267\36\150"+
-    "\1\272\1\0\1\273\1\274\1\275\1\273\3\275\1\273"+
-    "\1\272\1\276\1\277\3\275\1\272\1\275\1\277\4\275"+
-    "\1\272\27\275\2\272\2\152\1\0\60\152\1\0\16\152"+
-    "\1\300\37\152\1\155\2\0\1\301\1\155\1\0\3\155"+
-    "\1\0\1\155\2\0\5\155\1\0\36\155\1\157\1\0"+
-    "\1\302\1\303\1\157\1\302\3\157\1\304\1\157\2\302"+
-    "\5\157\1\302\36\157\1\305\1\0\1\306\1\307\1\310"+
-    "\1\306\3\310\1\306\1\305\1\311\1\312\3\310\1\305"+
-    "\1\310\1\312\4\310\1\305\27\310\2\305\2\161\1\0"+
-    "\60\161\1\0\16\161\1\313\37\161\7\0\1\314\17\0"+
-    "\1\315\36\0\1\171\2\0\1\40\3\0\1\171\5\0"+
-    "\1\171\4\40\1\0\13\40\1\0\5\40\1\0\2\40"+
-    "\1\0\3\40\1\0\1\316\1\0\3\316\1\317\3\172"+
-    "\1\316\1\0\1\316\1\317\1\172\1\316\1\0\2\316"+
-    "\1\317\4\172\1\316\13\172\1\316\5\172\1\316\2\172"+
-    "\1\320\4\172\15\0\1\321\6\0\1\322\34\0\1\316"+
-    "\1\0\3\316\1\317\3\174\1\316\1\0\1\316\1\317"+
-    "\1\174\1\316\1\0\2\316\1\317\4\174\1\316\13\174"+
-    "\1\316\5\174\1\316\2\174\1\323\4\174\27\0\1\315"+
-    "\33\0\1\324\60\0\1\325\64\0\3\57\4\0\1\57"+
-    "\5\0\3\57\1\326\1\0\13\57\1\0\5\57\1\0"+
-    "\2\57\1\0\4\57\6\0\3\57\4\0\1\57\5\0"+
-    "\4\57\1\0\13\57\1\0\1\57\1\327\3\57\1\0"+
-    "\2\57\1\0\4\57\1\206\1\0\7\206\1\210\47\206"+
-    "\1\211\1\0\11\211\1\210\45\211\1\216\1\0\7\216"+
-    "\1\220\47\216\1\221\1\0\11\221\1\220\45\221\1\225"+
-    "\1\0\7\225\1\227\47\225\1\230\1\0\11\230\1\227"+
-    "\45\230\30\0\1\330\25\0\1\330\35\0\1\331\12\0"+
-    "\1\331\47\0\1\332\62\0\1\333\76\0\1\334\3\0"+
-    "\1\243\1\0\7\243\1\245\47\243\1\246\1\0\1\247"+
-    "\1\335\1\246\1\247\3\246\1\247\1\246\1\245\1\247"+
-    "\5\246\1\247\36\246\1\247\1\0\11\247\1\245\45\247"+
-    "\1\246\1\0\1\247\1\335\1\246\1\247\3\246\1\247"+
-    "\1\246\1\336\1\247\5\246\1\247\36\246\13\0\1\337"+
-    "\45\0\1\247\1\0\11\247\1\336\45\247\11\257\1\261"+
-    "\47\257\13\262\1\261\45\262\1\267\1\0\7\267\1\271"+
-    "\47\267\1\272\1\0\1\273\1\340\1\272\1\273\3\272"+
-    "\1\273\1\272\1\271\1\273\5\272\1\273\36\272\1\273"+
-    "\1\0\11\273\1\271\45\273\1\272\1\0\1\273\1\340"+
-    "\1\272\1\273\3\272\1\273\1\272\1\341\1\273\5\272"+
-    "\1\273\36\272\13\0\1\342\45\0\1\273\1\0\11\273"+
-    "\1\341\45\273\2\152\1\0\24\152\1\343\31\152\1\302"+
-    "\1\0\7\302\1\304\47\302\1\305\1\0\1\306\1\344"+
-    "\1\305\1\306\3\305\1\306\1\305\1\304\1\306\5\305"+
-    "\1\306\36\305\1\306\1\0\11\306\1\304\45\306\1\305"+
-    "\1\0\1\306\1\344\1\305\1\306\3\305\1\306\1\305"+
-    "\1\345\1\306\5\305\1\306\36\305\13\0\1\346\45\0"+
-    "\1\306\1\0\11\306\1\345\45\306\2\161\1\0\24\161"+
-    "\1\347\31\161\7\0\1\350\101\0\1\351\30\0\1\316"+
-    "\1\0\10\316\1\0\4\316\1\0\34\316\1\0\5\316"+
-    "\1\0\3\316\1\317\4\316\1\0\1\316\1\317\2\316"+
-    "\1\0\2\316\1\317\31\316\1\352\4\316\15\0\1\321"+
-    "\36\0\1\353\21\0\1\354\12\0\3\354\2\0\1\354"+
-    "\11\0\2\354\1\0\1\354\2\0\2\354\10\0\3\57"+
-    "\4\0\1\57\5\0\4\57\1\0\11\57\1\355\1\57"+
-    "\1\0\5\57\1\0\2\57\1\0\4\57\33\0\1\356"+
-    "\12\0\1\356\40\0\1\357\57\0\1\360\66\0\1\361"+
-    "\12\0\1\361\40\0\1\362\35\0\2\363\1\0\3\363"+
-    "\2\0\1\252\4\363\1\0\6\363\1\0\27\363\5\0"+
-    "\2\364\1\0\3\364\2\0\1\276\4\364\1\0\6\364"+
-    "\1\0\27\364\2\0\2\152\1\0\25\152\1\365\30\152"+
-    "\3\0\2\366\1\0\3\366\2\0\1\311\4\366\1\0"+
-    "\6\366\1\0\27\366\2\0\2\161\1\0\25\161\1\367"+
-    "\30\161\31\0\1\370\103\0\1\352\21\0\1\354\12\0"+
-    "\3\354\2\0\1\354\11\0\2\354\1\0\1\354\1\0"+
-    "\1\353\2\354\10\0\3\57\4\0\1\57\5\0\4\57"+
-    "\1\0\6\57\1\371\4\57\1\0\5\57\1\0\2\57"+
-    "\1\0\4\57\44\0\1\372\54\0\1\373\55\0\1\374"+
-    "\60\0\1\375\63\0\1\376\20\0\2\152\1\0\26\152"+
-    "\1\377\27\152\2\161\1\0\26\161\1\u0100\27\161\32\0"+
-    "\1\u0101\34\0\3\57\4\0\1\57\5\0\4\57\1\0"+
-    "\3\57\1\u0102\7\57\1\0\2\57\1\u0102\2\57\1\0"+
-    "\2\57\1\0\4\57\45\0\1\u0103\52\0\1\u0104\63\0"+
-    "\1\u0105\43\0\1\u0106\63\0\1\u0107\25\0\1\u0107\2\0"+
-    "\2\152\1\0\27\152\1\u0108\26\152\2\161\1\0\27\161"+
-    "\1\u0109\26\161\33\0\1\u010a\32\0\1\u010b\3\57\3\0"+
-    "\1\u010b\1\57\4\0\1\u010b\4\57\1\0\13\57\1\0"+
-    "\5\57\1\0\2\57\1\0\4\57\35\0\1\u010c\56\0"+
-    "\1\u010d\12\0\1\u010d\45\0\1\u010e\12\0\1\u010e\12\0"+
-    "\2\152\1\0\30\152\1\u010f\25\152\2\161\1\0\30\161"+
-    "\1\u0110\25\161\32\0\1\u0111\33\0\1\u010b\6\0\1\u010b"+
-    "\5\0\1\u010b\36\0\2\152\1\0\27\152\1\u0112\26\152"+
-    "\2\161\1\0\27\161\1\u0113\26\161\27\0\1\u0114\31\0"+
-    "\2\152\1\0\24\152\1\u0115\31\152\2\161\1\0\24\161"+
-    "\1\u0116\31\161";
-
-  /** 
-   * 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,  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,  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,  0,  0,  0,  0,  0,  0,  1,  0,  0, 
-     1,  0,  1,  0,  1,  0,  1,  9,  0,  1,  9,  0,  1,  0,  0,  0, 
-     0,  0,  0,  0,  1,  0,  1,  0,  1,  0,  0,  0,  0,  0,  1,  1, 
-     0,  1,  0,  0,  0,  9,  9,  1,  1,  0,  1,  9,  9,  9,  1,  1, 
-     0,  1,  1,  9,  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[9212];
-    int i = 0;  /* index in packed string  */
-    int j = 0;  /* index in unpacked array */
-    while (i < 3220) {
-      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 275: 
-        case 276: 
-        case 277: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nCDATA start");//$NON-NLS-1$
-	fStateStack.push(yystate());
-	yybegin(ST_CDATA_TEXT);
-	return XML_CDATA_OPEN;
- }
-        case 279: break;
-        case 269: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("element");//$NON-NLS-1$
-	yybegin(ST_XML_ELEMENT_DECLARATION);
-	return XML_ELEMENT_DECLARATION;
- }
-        case 280: break;
-        case 268: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attlist");//$NON-NLS-1$
-	yybegin(ST_XML_ATTLIST_DECLARATION);
-	return XML_ATTLIST_DECLARATION;
- }
-        case 281: break;
-        case 267: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_DECLARATION);
-	return XML_DOCTYPE_DECLARATION;
- }
-        case 282: break;
-        case 262: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype external id");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_ID_PUBLIC);
-	return XML_DOCTYPE_EXTERNAL_ID_PUBLIC;
- }
-        case 283: break;
-        case 261: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype external id");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
-	return XML_DOCTYPE_EXTERNAL_ID_SYSTEM;
- }
-        case 284: break;
-        case 257: 
-        case 266: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction target");//$NON-NLS-1$
-        yybegin(ST_DHTML_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
- }
-        case 285: break;
-        case 234: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nCharRef");//$NON-NLS-1$
-	return XML_CHAR_REFERENCE;
- }
-        case 286: break;
-        case 231: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\ncomment start");//$NON-NLS-1$
-	yybegin(ST_XML_COMMENT);
-	return XML_COMMENT_OPEN;
- }
-        case 287: break;
-        case 213: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction target");//$NON-NLS-1$
-        yybegin(ST_XML_PI_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
- }
-        case 288: break;
-        case 212: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("comment end");//$NON-NLS-1$
-	yybegin(YYINITIAL);
-	return XML_COMMENT_CLOSE;
- }
-        case 289: break;
-        case 211: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("CDATA end");//$NON-NLS-1$
-	yybegin(fStateStack.pop());
-	return XML_CDATA_CLOSE;
- }
-        case 290: break;
-        case 210: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nPEReference");//$NON-NLS-1$
-	return XML_PE_REFERENCE;
- }
-        case 291: break;
-        case 207: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nEntityRef");//$NON-NLS-1$
-	return XML_ENTITY_REFERENCE;
- }
-        case 292: break;
-        case 158: 
-        case 172: 
-        case 180: 
-          { 
-	return XML_DOCTYPE_INTERNAL_SUBSET;
- }
-        case 293: break;
-        case 146: 
-          { 
-        yybegin(YYINITIAL);
-	if(Debug.debugTokenizer)
-		dump("empty tag close");//$NON-NLS-1$
-        return XML_EMPTY_TAG_CLOSE;
- }
-        case 294: break;
-        case 131: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction end");//$NON-NLS-1$
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 295: break;
-        case 130: 
-          { 
-		// ended with nothing inside
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 296: break;
-        case 127: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("processing instruction end");//$NON-NLS-1$
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 297: break;
-        case 119: 
-          { 
-	fStateStack.push(yystate());
-	if(Debug.debugTokenizer)
-		dump("\ndeclaration start");//$NON-NLS-1$
-        yybegin(ST_XML_DECLARATION);
-	return XML_DECLARATION_OPEN;
- }
-        case 298: break;
-        case 118: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nprocessing instruction start");//$NON-NLS-1$
-	yybegin(ST_PI);
-        return XML_PI_OPEN;
- }
-        case 299: break;
-        case 62: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction end");//$NON-NLS-1$
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 300: break;
-        case 56: 
-        case 58: 
-        case 59: 
-        case 60: 
-        case 135: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction attribute value");//$NON-NLS-1$
-        yybegin(ST_XML_PI_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 301: break;
-        case 55: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction '='");//$NON-NLS-1$
-        yybegin(ST_XML_PI_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
- }
-        case 302: break;
-        case 54: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction attribute name");//$NON-NLS-1$
-        yybegin(ST_XML_PI_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
- }
-        case 303: break;
-        case 50: 
-        case 51: 
-        case 52: 
-          { 
-	// block scan until close is found
-	return doScan("?>", false, XML_PI_CONTENT, ST_XML_PI_TAG_CLOSE, ST_XML_PI_TAG_CLOSE);
- }
-        case 304: break;
-        case 49: 
-          { 
-        yybegin(ST_PI_CONTENT);
-        return WHITE_SPACE;
- }
-        case 305: break;
-        case 46: 
-        case 47: 
-        case 48: 
-        case 128: 
-        case 129: 
-        case 214: 
-        case 236: 
-        case 248: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("processing instruction target");//$NON-NLS-1$
-        yybegin(ST_PI_WS);
-        return XML_TAG_NAME;
- }
-        case 306: break;
-        case 41: 
-        case 42: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("comment content");//$NON-NLS-1$
-	return scanXMLCommentText();
- }
-        case 307: break;
-        case 40: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("LINE FEED");//$NON-NLS-1$
-	return WHITE_SPACE;
- }
-        case 308: break;
-        case 0: 
-        case 31: 
-        case 121: 
-        case 123: 
-        case 205: 
-        case 206: 
-        case 233: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nXML content");//$NON-NLS-1$
-	return XML_CONTENT;
- }
-        case 309: 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 310: break;
-        case 16: 
-        case 70: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("inappropriate tag name");//$NON-NLS-1$
-	yybegin(YYINITIAL);
-        return XML_CONTENT;
- }
-        case 311: break;
-        case 27: 
-        case 105: 
-        case 106: 
-        case 191: 
-        case 226: 
-        case 244: 
-        case 254: 
-        case 263: 
-        case 270: 
-        case 273: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("elementdecl contentspec");//$NON-NLS-1$
-	return XML_ELEMENT_DECL_CONTENT;
- }
-        case 312: break;
-        case 29: 
-        case 112: 
-        case 113: 
-        case 202: 
-        case 230: 
-        case 246: 
-        case 255: 
-        case 264: 
-        case 271: 
-        case 274: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attlist contentspec");//$NON-NLS-1$
-	return XML_ATTLIST_DECL_CONTENT;
- }
-        case 313: break;
-        case 32: 
-        case 71: 
-        case 82: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nstart tag open");//$NON-NLS-1$
-        yybegin(ST_XML_TAG_NAME);
-        return XML_TAG_OPEN;
- }
-        case 314: break;
-        case 33: 
-        case 34: 
-        case 37: 
-        case 38: 
-        case 39: 
-        case 43: 
-        case 44: 
-        case 53: 
-        case 57: 
-        case 61: 
-        case 63: 
-        case 67: 
-        case 73: 
-        case 79: 
-        case 84: 
-        case 85: 
-        case 86: 
-        case 87: 
-        case 89: 
-        case 90: 
-        case 92: 
-        case 97: 
-        case 102: 
-        case 109: 
-          { 
-	if (Debug.debugTokenizer)
-		System.out.println("!!!unexpected!!!: \"" + yytext() + "\":" + //$NON-NLS-2$//$NON-NLS-1$
-			yychar + "-" + (yychar + yylength()));//$NON-NLS-1$
-	return UNDEFINED;
- }
-        case 315: 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 316: break;
-        case 64: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction attribute name");//$NON-NLS-1$
-        yybegin(ST_DHTML_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
- }
-        case 317: break;
-        case 65: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction '='");//$NON-NLS-1$
-        yybegin(ST_DHTML_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
- }
-        case 318: break;
-        case 66: 
-        case 68: 
-        case 69: 
-        case 143: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction attribute value");//$NON-NLS-1$
-        yybegin(ST_DHTML_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 319: break;
-        case 72: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("tag close");//$NON-NLS-1$
-	if(isBlockMarker()) {
-        	yybegin(ST_BLOCK_TAG_SCAN);
-	}
-	else
-        	yybegin(YYINITIAL);
-        return XML_TAG_CLOSE;
- }
-        case 320: break;
-        case 74: 
-        case 75: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("tag name");//$NON-NLS-1$
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
- }
-        case 321: break;
-        case 76: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attr name");//$NON-NLS-1$
-        yybegin(ST_XML_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
- }
-        case 322: break;
-        case 77: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("equals");//$NON-NLS-1$
-        yybegin(ST_XML_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
- }
-        case 323: break;
-        case 78: 
-        case 80: 
-        case 81: 
-        case 150: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attr value");//$NON-NLS-1$
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 324: break;
-        case 83: 
-          { 
-	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 325: break;
-        case 88: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype type");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_EXTERNAL_ID);
-	return XML_DOCTYPE_NAME;
- }
-        case 326: break;
-        case 91: 
-        case 93: 
-        case 94: 
-        case 95: 
-        case 164: 
-        case 165: 
-        case 168: 
-        case 169: 
-        case 221: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype public reference");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
-	return XML_DOCTYPE_EXTERNAL_ID_PUBREF;
- }
-        case 327: break;
-        case 96: 
-        case 98: 
-        case 99: 
-        case 100: 
-        case 176: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype system reference");//$NON-NLS-1$
-	yybegin(ST_XML_DECLARATION_CLOSE);
-	return XML_DOCTYPE_EXTERNAL_ID_SYSREF;
- }
-        case 328: break;
-        case 101: 
-        case 103: 
-        case 104: 
-        case 184: 
-        case 185: 
-        case 188: 
-        case 189: 
-        case 224: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("elementdecl name");//$NON-NLS-1$
-	yybegin(ST_XML_ELEMENT_DECLARATION_CONTENT);
-	return XML_ELEMENT_DECL_NAME;
- }
-        case 329: break;
-        case 107: 
-          { 
-	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 330: break;
-        case 108: 
-        case 110: 
-        case 111: 
-        case 195: 
-        case 196: 
-        case 199: 
-        case 200: 
-        case 228: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attlist name");//$NON-NLS-1$
-	yybegin(ST_XML_ATTLIST_DECLARATION_CONTENT);
-	return XML_ATTLIST_DECL_NAME;
- }
-        case 331: break;
-        case 114: 
-          { 
-	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 332: break;
-        case 117: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nend tag open");//$NON-NLS-1$
-        yybegin(ST_XML_TAG_NAME);
-        return XML_END_TAG_OPEN;
- }
-        case 333: break;
-        case 115: 
-        case 116: 
-          { 
-		return doBlockTagScan();
-	 }
-        case 334: 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.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex
deleted file mode 100644
index 213dade..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex
+++ /dev/null
@@ -1,1322 +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;
-
-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.internal.util.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;
-
-%%
-
-%{
-	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);
-}
-%}
-
-%eof{
-// do nothing, this is the downstream parser's job
-%eof}
-
-%public
-%class XMLTokenizer
-%implements BlockTokenizer, DOMRegionContext
-%function primGetNextToken
-%type String
-%char
-%line
-%unicode
-%pack
-
-%state ST_CDATA_TEXT
-%state ST_CDATA_END
-%state ST_XML_COMMENT
-%state ST_XML_COMMENT_END
-%state ST_PI
-%state ST_PI_WS
-%state ST_PI_CONTENT
-%state ST_XML_PI_ATTRIBUTE_NAME
-%state ST_XML_PI_EQUALS
-%state ST_XML_PI_ATTRIBUTE_VALUE
-%state ST_XML_PI_TAG_CLOSE
-%state ST_DHTML_ATTRIBUTE_NAME
-%state ST_DHTML_EQUALS
-%state ST_DHTML_ATTRIBUTE_VALUE
-%state ST_DHTML_TAG_CLOSE
-
-// normal tag states
-%state ST_XML_TAG_NAME
-%state ST_XML_ATTRIBUTE_NAME
-%state ST_XML_EQUALS
-%state ST_XML_ATTRIBUTE_VALUE
-
-// declaration (DTD) states
-%state ST_XML_DECLARATION
-%state ST_XML_DECLARATION_CLOSE
-
-%state ST_XML_DOCTYPE_DECLARATION
-%state ST_XML_DOCTYPE_EXTERNAL_ID
-%state ST_XML_DOCTYPE_ID_PUBLIC
-%state ST_XML_DOCTYPE_ID_SYSTEM
-
-%state ST_XML_ELEMENT_DECLARATION
-%state ST_XML_ELEMENT_DECLARATION_CONTENT
-
-%state ST_XML_ATTLIST_DECLARATION
-%state ST_XML_ATTLIST_DECLARATION_CONTENT
-
-%state ST_BLOCK_TAG_SCAN
-
-// Letter = ([A-Za-z])
-// Digit = ([0-9])
-
-/**
- * smaller tokens
- */
-genericTagOpen       = <
-genericTagClose      = >
-genericEndTagOpen    = <\/
-genericEmptyTagClose = \/>
-
-PIstart = <\?
-PIend   = \?>
-
-
-// [1] document ::= prolog element Misc*
-document = ({prolog} {element} {Misc}*)
-
-// [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
- //Char = (.)
-Char = [\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD] 
-
-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+
-S = [\x20\x09\x0D\x0A]+
-
-// [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
-NameChar = ({Letter} | {Digit} | \. | \- | _ | : | {CombiningChar} | {Extender})
-
-// [5] Name ::= (Letter | '_' | ':') NameChar*
-//Name = ({NameChar}{NameChar}*)
-Name = ({Letter} | _ | :){NameChar}*
-
-// [6] Names ::= {Name} ({S} {Name})*
-Names = ({Name} ({S} {Name})*)
-
-// [7] Nmtoken ::= (NameChar)+
-Nmtoken = ({NameChar}+)
-
-// [8] Nmtokens ::= Nmtoken (S Nmtoken)*
-Nmtokens = ({Nmtoken} ({S} {Nmtoken})*)
-
-// [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' |  "'" ([^%&'] | PEReference | Reference)* "'"
-EntityValue = (\" ([^%&\"] | {PEReference} | {Reference})* \" |  \' ([^%&\'] | {PEReference} | {Reference})* \')
-
-// [10] AttValue ::= '"' ([^<&"] | Reference)* '"' |  "'" ([^<&'] | Reference)* "'"
-AttValue = ( \" ([^<\"] | {Reference})* \" | \' ([^<\'] | {Reference})* \'  | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* )
-
-// [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") 
-SystemLiteral = ((\" [^\"]* \") | (\' [^\']* \')) 
-
-// [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
-PubidLiteral = (\" {PubidChar}* \" | \' ({PubidChar}\')* "'")
-
-// [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
-PubidChar = ([\040\015\012] | [a-zA-Z0-9] | [\-\'()\+,.\/:=?;!\*#@\$_%])
-
-// [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
-// implement lookahead behavior during action definition
-CharData = ([^<&(\]\]>)]*)
-
-// [15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
-CommentStart = (<!\-\-)
-CommentEnd   = (\-\->)
-Comment = ({CommentStart}.*{CommentEnd})
-
-// [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
-PI = (<\?{PITarget} {Char}* \?>)
-
-// [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
-PITarget = ({Name}((X|x)(M|m)(L|l)))
-
-// [18] CDSect ::= CDStart CData CDEnd
-CDSect = ({CDStart}{CData}{CDEnd})
-
-// [19] CDStart ::= '<![CDATA['
-CDStart = <!\[CDATA\[
-
-// [20] CData ::= (Char* - (Char* ']]>' Char*)) 
-// implement lookahead behavior during action definition
-CData = ([^(\]\]>)]*)
-
-// [21] CDEnd ::= ']]>'
-CDEnd = (\]\]>)
-
-// [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
-prolog = ({XMLDecl}? {Misc}* ({doctypedecl} {Misc}*)?)
-
-// [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
-XMLDecl = (<\?xml {VersionInfo} {EncodingDecl}? {SDDecl}? {S}? \?>)
-
-// [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")
-VersionInfo = ({S}version{Eq}(\'{VersionNum}\' | \"{VersionNum}\"))
-
-// [25] Eq ::= S? '=' S?
-Eq = (\=)
-
-// [26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')+
-VersionNum = (([a-zA-Z0-9_.:]|\-)+)
-
-// [27] Misc ::= Comment | PI |  S
-Misc = ({Comment} | {PI} | {S})
-
-// [28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)?  S? ('[' (markupdecl | PEReference | S)* ']' S?)? '>'
-doctypedecl = (<\!DOCTYPE{S}{Name} ({S}{ExternalID})? {S}? (\[ ({markupdecl}|{PEReference}|{S})* \]{S}?)?>)
-
-// [29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment
-markupdecl = ({elementdecl} | {AttlistDecl} | {EntityDecl} | {NotationDecl} | {PI} | {Comment})
-
-// [30] extSubset ::= TextDecl? extSubsetDecl
-extSubset = ({TextDecl}? {extSubsetDecl})
-
-// [31] extSubsetDecl ::= ( markupdecl | conditionalSect | PEReference | S )*
-extSubsetDecl = (( {markupdecl} | {conditionalSect} | {PEReference} | {S} )*)
-
-// [32]  SDDecl  ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))
-SDDecl  = ({S}standalone{Eq}{S}*((\'(yes|no)\')|(\"(yes|no)\")))
-
-// [33]  LanguageID  ::= Langcode ('-' Subcode)*
-LanguageID  = ({Langcode}(\-{Subcode})*)
-
-// [34]  Langcode ::= ISO639Code |  IanaCode |  UserCode
-Langcode = ({ISO639Code} |  {IanaCode} |  {UserCode})
-
-// [35]  ISO639Code ::= ([a-z] | [A-Z]) ([a-z] | [A-Z])
-ISO639Code = (([a-z]|[A-Z])([a-z]|[A-Z]))
-
-// [36]  IanaCode ::= ('i' | 'I') '-' ([a-z] | [A-Z])+
-IanaCode = ((i|I)\-([a-z]|[A-Z])+)
-
-// [37]  UserCode ::= ('x' | 'X') '-' ([a-z] | [A-Z])+
-UserCode = ((x|X)\-([a-z]|[A-Z])+)
-
-// [38]  Subcode ::= ([a-z] | [A-Z])+
-Subcode = (([a-z]|[A-Z])+)
-
-// [39]  element  ::= EmptyElemTag | STag content ETag
-element  = ({EmptyElemTag} | {STag} {content} {ETag})
-
-// [40]  STag  ::= '<' Name (S Attribute)* S? '>'
-STag = (<{Name}({S}{Attribute})*{S}?>)
-
-// [41]  Attribute ::= Name Eq AttValue
-Attribute = ({Name}{S}*{Eq}{S}*{AttValue})
-
-// [42]  ETag  ::= 'Name S? '>'
-ETag = (<\/{Name}{S}?>)
-
-// [43]  content  ::= (element | CharData | Reference | CDSect | PI | Comment)*
-content = (({element} | {CharData} | {Reference} | {CDSect} | {PI} | {Comment})*)
-
-// [44]  EmptyElemTag  ::= '<' Name (S Attribute)* S? '/>'
-EmptyElemTag = (<{Name}({S}{Attribute})*{S}?\/>)
-
-// [45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'
-elementdecl = (<\!ELEMENT{S}{Name}{S}{contentspec}{S}?>)
-
-// [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
-contentspec = (EMPTY|ANY|{Mixed}|{children})
-
-// [47] children ::= (choice | seq) ('?' | '*' | '+')?
-children = (({choice}|{seq})(\?|\*|\+)?)
-
-// CAUSES LOOP THROUGH DEFS OF CHOICE AND SEQ
-// [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
-cp = (({Name} | {choice} | {seq}) (\?|\*|\+)?)
-
-// [49] choice ::= '(' S? cp ( S? '|' S? cp )* S? ')'
-// choice = \({S}?{cp}({S}?\|{S}?{cp})*{S}?\)
-choice = \({S}?{Name}({S}?\|{S}?{Name})*{S}?\)
-
-// [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
-// seq = (\({S}?{cp}({S}?\,{S}?{cp})*{S}?\))
-seq = (\({S}?{Name}({S}?\,{S}?{Name})*{S}?\))
-
-// [51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S?  ')*' | '(' S? '#PCDATA' S? ')'
-Mixed = ({S}?\#PCDATA({S}?\|{S}?{Name})*{S}?)*\|({S}?\#PCDATA{S}?)
-
-// [52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'
-AttlistDecl = (<\!ATTLIST{S}{Name}{AttDef}*{S}?>)
-
-// [53] AttDef ::= S Name S AttType S DefaultDecl
-AttDef = ({S}{Name}{S}{AttType}{S}{DefaultDecl})
-
-// [54] AttType ::= StringType | TokenizedType | EnumeratedType 
-AttType = ({StringType} | {TokenizedType} | {EnumeratedType})
-
-// [55] StringType ::= 'CDATA'
-StringType = (CDATA)
-
-// [56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS'
-TokenizedType = (ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS)
-
-// [57] EnumeratedType ::= NotationType | Enumeration 
-EnumeratedType = ({NotationType} | {Enumeration})
-
-// [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')' 
-NotationType = (NOTATION{S}\({S}?{Name}({S}?\|{S}?{Name})*{S}?\))
-
-// [59] Enumeration ::= '(' S? Nmtoken (S? '|' S?  Nmtoken)* S? ')'
-Enumeration = (\({S}?{Nmtoken}({S}?\|{S}?{Nmtoken})*{S}?\))
-
-// [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
-DefaultDecl = (\#REQUIRED|\#IMPLIED|((\#FIXED{S})?{AttValue}))
-
-// [61] conditionalSect ::= includeSect | ignoreSect 
-conditionalSect = ({includeSect} | {ignoreSect})
-
-// [62] includeSect ::= '<![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>' 
-includeSect = (<\!\[{S}?INCLUDE{S}?\[{extSubsetDecl}\]\]>)
-
-// [63] ignoreSect ::= '<![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>'
-ignoreSect = (<\!\[{S}?IGNORE{S}?\[{ignoreSectContents}*\]\]>)
-
-// [64] ignoreSectContents ::= Ignore ('<![' ignoreSectContents ']]>' Ignore)*
-ignoreSectContents = ({Ignore}(<\!\[{ignoreSectContents}\]\]>{Ignore})*)
-
-// [65] Ignore ::= Char* - (Char* ('<![' | ']]>') Char*)
-Ignore =  ([^(\<\!\[|\]\]\>)]*)
-
-// [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
-CharRef = (&#[0-9]+;|&#x[0-9a-fA-F]+;)
-
-// [67] Reference ::= EntityRef | CharRef
-Reference = ({EntityRef} | {CharRef})
-
-// [68] EntityRef = '&' Name ';'
-EntityRef = (&{Name};)
-
-// [69] PEReference ::= '%' Name ';'
-PEReference = (%{Name};)
-
-// [70] EntityDecl ::= GEDecl | PEDecl
-EntityDecl = ({GEDecl} | {PEDecl})
-
-// [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'
-GEDecl = (<\!ENTITY{S}{Name}{S}{EntityDef}{S}?>)
-
-// [72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
-PEDecl = (<\!ENTITY{S}\%{S}{Name}{S}{PEDef}{S}?>)
-
-// [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
-EntityDef = ({EntityValue} | ({ExternalID}{NDataDecl}?))
-
-// [74] PEDef ::= EntityValue | ExternalID
-PEDef = ({EntityValue} | {ExternalID})
-
-// [75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral 
-ExternalID = (SYSTEM{S}{SystemLiteral}|PUBLIC{S}{PubidLiteral}{S}{SystemLiteral} )
-
-// [76] NDataDecl ::= S 'NDATA' S Name
-NDataDecl = ({S}NDATA{S}{Name})
-
-// [77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
-TextDecl = (<\?xml{VersionInfo}?{EncodingDecl}{S}?\?>)
-
-// [78] extParsedEnt ::= TextDecl? content
-extParsedEnt = ({TextDecl}?{content})
-
-// [79] extPE ::= TextDecl? extSubsetDecl
-extPE = ({TextDecl}?{extSubsetDecl})
-
-// [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' |  "'" EncName "'" ) 
-EncodingDecl = ({S}encoding{S}*{Eq}{S}*(\"{EncName}\"|\'{EncName}\'))
-
-// [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
-EncName = ([A-Za-z]([A-Za-z0-9._]|\-)*)
-
-// [82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID |  PublicID) S? '>'
-NotationDecl = (<\!NOTATION{S}{Name}{S}({ExternalID}|{PublicID}){S}?>)
-
-// [83] PublicID ::= 'PUBLIC' S PubidLiteral
-PublicID = (PUBLIC{S}{PubidLiteral})
-
-// [84]  Letter ::= BaseChar | Ideographic
-Letter = ({BaseChar} | {Ideographic})
-
-// [85]  BaseChar ::= [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6]
-// | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131]
-// | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E]
-// | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5]
-// | [#x01FA-#x0217] | [#x0250-#x02A8] | [#x02BB-#x02C1] | #x0386
-// | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] | [#x03A3-#x03CE]
-// | [#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0
-// | [#x03E2-#x03F3] | [#x0401-#x040C] | [#x040E-#x044F]
-// | [#x0451-#x045C] | [#x045E-#x0481] | [#x0490-#x04C4]
-// | [#x04C7-#x04C8] | [#x04CB-#x04CC] | [#x04D0-#x04EB]
-// | [#x04EE-#x04F5] | [#x04F8-#x04F9] | [#x0531-#x0556] | #x0559
-// | [#x0561-#x0586] | [#x05D0-#x05EA] | [#x05F0-#x05F2]
-// | [#x0621-#x063A] | [#x0641-#x064A] | [#x0671-#x06B7]
-// | [#x06BA-#x06BE] | [#x06C0-#x06CE] | [#x06D0-#x06D3] | #x06D5
-// | [#x06E5-#x06E6] | [#x0905-#x0939] | #x093D | [#x0958-#x0961]
-// | [#x0985-#x098C] | [#x098F-#x0990] | [#x0993-#x09A8]
-// | [#x09AA-#x09B0] | #x09B2 | [#x09B6-#x09B9] | [#x09DC-#x09DD]
-// | [#x09DF-#x09E1] | [#x09F0-#x09F1] | [#x0A05-#x0A0A]
-// | [#x0A0F-#x0A10] | [#x0A13-#x0A28] | [#x0A2A-#x0A30]
-// | [#x0A32-#x0A33] | [#x0A35-#x0A36] | [#x0A38-#x0A39]
-// | [#x0A59-#x0A5C] | #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B]
-// | #x0A8D | [#x0A8F-#x0A91] | [#x0A93-#x0AA8] | [#x0AAA-#x0AB0]
-// | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] | #x0ABD | #x0AE0
-// | [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28]
-// | [#x0B2A-#x0B30] | [#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D
-// | [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] | [#x0B85-#x0B8A]
-// | [#x0B8E-#x0B90] | [#x0B92-#x0B95] | [#x0B99-#x0B9A] | #x0B9C
-// | [#x0B9E-#x0B9F] | [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA]
-// | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9] | [#x0C05-#x0C0C]
-// | [#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33]
-// | [#x0C35-#x0C39] | [#x0C60-#x0C61] | [#x0C85-#x0C8C]
-// | [#x0C8E-#x0C90] | [#x0C92-#x0CA8] | [#x0CAA-#x0CB3]
-// | [#x0CB5-#x0CB9] | #x0CDE | [#x0CE0-#x0CE1] | [#x0D05-#x0D0C]
-// | [#x0D0E-#x0D10] | [#x0D12-#x0D28] | [#x0D2A-#x0D39]
-// | [#x0D60-#x0D61] | [#x0E01-#x0E2E] | #x0E30 | [#x0E32-#x0E33]
-// | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 | [#x0E87-#x0E88]
-// | #x0E8A | #x0E8D | [#x0E94-#x0E97] | [#x0E99-#x0E9F]
-// | [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB]
-// | [#x0EAD-#x0EAE] | #x0EB0 | [#x0EB2-#x0EB3] | #x0EBD
-// | [#x0EC0-#x0EC4] | [#x0F40-#x0F47] | [#x0F49-#x0F69]
-// | [#x10A0-#x10C5] | [#x10D0-#x10F6] | #x1100 | [#x1102-#x1103]
-// | [#x1105-#x1107] | #x1109 | [#x110B-#x110C] | [#x110E-#x1112]
-// | #x113C | #x113E | #x1140 | #x114C | #x114E | #x1150
-// | [#x1154-#x1155] | #x1159 | [#x115F-#x1161] | #x1163 | #x1165
-// | #x1167 | #x1169 | [#x116D-#x116E] | [#x1172-#x1173] | #x1175
-// | #x119E | #x11A8 | #x11AB | [#x11AE-#x11AF] | [#x11B7-#x11B8]
-// | #x11BA | [#x11BC-#x11C2] | #x11EB | #x11F0 | #x11F9
-// | [#x1E00-#x1E9B] | [#x1EA0-#x1EF9] | [#x1F00-#x1F15]
-// | [#x1F18-#x1F1D] | [#x1F20-#x1F45] | [#x1F48-#x1F4D]
-// | [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D | [#x1F5F-#x1F7D]
-// | [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE | [#x1FC2-#x1FC4]
-// | [#x1FC6-#x1FCC] | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB]
-// | [#x1FE0-#x1FEC] | [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126
-// | [#x212A-#x212B] | #x212E | [#x2180-#x2182] | [#x3041-#x3094]
-// | [#x30A1-#x30FA] | [#x3105-#x312C] | [#xAC00-#xD7A3]
-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]
-
-// [86]  Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
-Ideographic = [\u4E00-\u9FA5\u3007\u3021-\u3029]
-
-// [87]      CombiningChar    ::=    [#x0300-#x0345]    | [#x0360-#x0361]
-// | [#x0483-#x0486]          | [#x0591-#x05A1]         | [#x05A3-#x05B9]
-// | [#x05BB-#x05BD]       | #x05BF       | [#x05C1-#x05C2]	 | #x05C4
-// | [#x064B-#x0652]    | #x0670    | [#x06D6-#x06DC]   | [#x06DD-#x06DF]
-// | [#x06E0-#x06E4]          | [#x06E7-#x06E8]         | [#x06EA-#x06ED]
-// | [#x0901-#x0903]       | #x093C       | [#x093E-#x094C]      | #x094D
-// | [#x0951-#x0954]    | [#x0962-#x0963]    | [#x0981-#x0983]   | #x09BC
-// | #x09BE       | #x09BF       | [#x09C0-#x09C4]      | [#x09C7-#x09C8]
-// | [#x09CB-#x09CD]   | #x09D7   | [#x09E2-#x09E3]   | #x0A02   | #x0A3C
-// | #x0A3E       | #x0A3F       | [#x0A40-#x0A42]      | [#x0A47-#x0A48]
-// | [#x0A4B-#x0A4D]    | [#x0A70-#x0A71]    | [#x0A81-#x0A83]   | #x0ABC
-// | [#x0ABE-#x0AC5]          | [#x0AC7-#x0AC9]         | [#x0ACB-#x0ACD]
-// | [#x0B01-#x0B03]    | #x0B3C    | [#x0B3E-#x0B43]   | [#x0B47-#x0B48]
-// | [#x0B4B-#x0B4D]          | [#x0B56-#x0B57]         | [#x0B82-#x0B83]
-// | [#x0BBE-#x0BC2]    | [#x0BC6-#x0BC8]    | [#x0BCA-#x0BCD]   | #x0BD7
-// | [#x0C01-#x0C03]          | [#x0C3E-#x0C44]         | [#x0C46-#x0C48]
-// | [#x0C4A-#x0C4D]          | [#x0C55-#x0C56]         | [#x0C82-#x0C83]
-// | [#x0CBE-#x0CC4]          | [#x0CC6-#x0CC8]         | [#x0CCA-#x0CCD]
-// | [#x0CD5-#x0CD6]          | [#x0D02-#x0D03]         | [#x0D3E-#x0D43]
-// | [#x0D46-#x0D48]       | [#x0D4A-#x0D4D]       | #x0D57      | #x0E31
-// | [#x0E34-#x0E3A]    | [#x0E47-#x0E4E]    | #x0EB1   | [#x0EB4-#x0EB9]
-// | [#x0EBB-#x0EBC]    | [#x0EC8-#x0ECD]    | [#x0F18-#x0F19]   | #x0F35
-// | #x0F37      | #x0F39     | #x0F3E     | #x0F3F     | [#x0F71-#x0F84]
-// | [#x0F86-#x0F8B]    | [#x0F90-#x0F95]    | #x0F97   | [#x0F99-#x0FAD]
-// | [#x0FB1-#x0FB7]       | #x0FB9       | [#x20D0-#x20DC]      | #x20E1
-// | [#x302A-#x302F] | #x3099 | #x309A
-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]
-
-// [88]   Digit  ::=  [#x0030-#x0039] | [#x0660-#x0669] | [#x06F0-#x06F9]
-// | [#x0966-#x096F]          | [#x09E6-#x09EF]         | [#x0A66-#x0A6F]
-// | [#x0AE6-#x0AEF]          | [#x0B66-#x0B6F]         | [#x0BE7-#x0BEF]
-// | [#x0C66-#x0C6F]          | [#x0CE6-#x0CEF]         | [#x0D66-#x0D6F]
-// | [#x0E50-#x0E59] | [#x0ED0-#x0ED9] | [#x0F20-#x0F29]
-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]
-
-// [89]  Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46
-// | #x0EC6       | #x3005       | [#x3031-#x3035]      | [#x309D-#x309E]
-// | [#x30FC-#x30FE]
-Extender = [\u00B7\u02D0\u02D1\u0387\u0640\u0E46\u0EC6\u3005\u3031-\u3035\u309D-\u309E\u30FC-\u30FE]
-
-%%
-
-
-/* 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_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;
-}
-
-// BEGIN REGULAR XML
-/* handle opening a new tag almost anywhere */
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_DECLARATION, ST_XML_ATTRIBUTE_VALUE> {genericTagOpen} {
-	if(Debug.debugTokenizer)
-		dump("\nstart tag open");//$NON-NLS-1$
-        yybegin(ST_XML_TAG_NAME);
-        return XML_TAG_OPEN;
-}
-
-/* unquoted */
-
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_XML_DECLARATION> {genericEndTagOpen} {
-	if(Debug.debugTokenizer)
-		dump("\nend tag open");//$NON-NLS-1$
-        yybegin(ST_XML_TAG_NAME);
-        return XML_END_TAG_OPEN;
-}
-/* the tag's name was found, start scanning for attributes */
-<ST_XML_TAG_NAME> {Name} {
-	if(Debug.debugTokenizer)
-		dump("tag name");//$NON-NLS-1$
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
-}
-/* another attribute name was found, resume looking for the equals sign */
-<ST_XML_ATTRIBUTE_NAME, ST_XML_EQUALS> {Name} {
-	if(Debug.debugTokenizer)
-		dump("attr name");//$NON-NLS-1$
-        yybegin(ST_XML_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
-}
-/* an equal sign was found, what's next is the value */
-<ST_XML_EQUALS> {Eq} {
-	if(Debug.debugTokenizer)
-		dump("equals");//$NON-NLS-1$
-        yybegin(ST_XML_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
-}
-/* the value was found, look for the next name */
-/* allow for unbalanced quotes, mostly a duplicate of the AttValue rule */
-<ST_XML_ATTRIBUTE_VALUE> {AttValue} | ([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
-	if(Debug.debugTokenizer)
-		dump("attr value");//$NON-NLS-1$
-        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} {
-	if(Debug.debugTokenizer)
-		dump("tag close");//$NON-NLS-1$
-	if(isBlockMarker()) {
-        	yybegin(ST_BLOCK_TAG_SCAN);
-	}
-	else
-        	yybegin(YYINITIAL);
-        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} {
-        yybegin(YYINITIAL);
-	if(Debug.debugTokenizer)
-		dump("empty tag close");//$NON-NLS-1$
-        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]* {
-	if(Debug.debugTokenizer)
-		dump("inappropriate tag name");//$NON-NLS-1$
-	yybegin(YYINITIAL);
-        return XML_CONTENT;
-}
-
-// END REGULAR XML
-
-
-// XML Comments
-
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_XML_DECLARATION> {CommentStart} {
-	if(Debug.debugTokenizer)
-		dump("\ncomment start");//$NON-NLS-1$
-	yybegin(ST_XML_COMMENT);
-	return XML_COMMENT_OPEN;
-}
-<ST_XML_COMMENT> .|\r|\n {
-	if(Debug.debugTokenizer)
-		dump("comment content");//$NON-NLS-1$
-	return scanXMLCommentText();
-}
-
-<ST_XML_COMMENT_END> {CommentEnd} {
-	if(Debug.debugTokenizer)
-		dump("comment end");//$NON-NLS-1$
-	yybegin(YYINITIAL);
-	return XML_COMMENT_CLOSE;
-}
-
-// XML misc
-
-{CDStart} {
-	if(Debug.debugTokenizer)
-		dump("\nCDATA start");//$NON-NLS-1$
-	fStateStack.push(yystate());
-	yybegin(ST_CDATA_TEXT);
-	return XML_CDATA_OPEN;
-}
-<ST_CDATA_TEXT> .|\r|\n {
-	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;
-}
-<ST_CDATA_END> {CDEnd} {
-	if(Debug.debugTokenizer)
-		dump("CDATA end");//$NON-NLS-1$
-	yybegin(fStateStack.pop());
-	return XML_CDATA_CLOSE;
-}
-
-<YYINITIAL> {PEReference} {
-	if(Debug.debugTokenizer)
-		dump("\nPEReference");//$NON-NLS-1$
-	return XML_PE_REFERENCE;
-}
-<YYINITIAL> {CharRef} {
-	if(Debug.debugTokenizer)
-		dump("\nCharRef");//$NON-NLS-1$
-	return XML_CHAR_REFERENCE;
-}
-<YYINITIAL> {EntityRef} {
-	if(Debug.debugTokenizer)
-		dump("\nEntityRef");//$NON-NLS-1$
-	return XML_ENTITY_REFERENCE;
-}
-
-<YYINITIAL> {PIstart} {
-	if(Debug.debugTokenizer)
-		dump("\nprocessing instruction start");//$NON-NLS-1$
-	yybegin(ST_PI);
-        return XML_PI_OPEN;
-}
-// the next three are order dependent
-<ST_PI> ((X|x)(M|m)(L|l)) {
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction target");//$NON-NLS-1$
-        yybegin(ST_XML_PI_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
-}
-<ST_PI> ([iI][mM][pP][oO][rR][tT]{S}*) {
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction target");//$NON-NLS-1$
-        yybegin(ST_DHTML_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
-}
-<ST_PI> {Name} {
-	if(Debug.debugTokenizer)
-		dump("processing instruction target");//$NON-NLS-1$
-        yybegin(ST_PI_WS);
-        return XML_TAG_NAME;
-}
-<ST_PI_WS> {S}+ {
-        yybegin(ST_PI_CONTENT);
-        return WHITE_SPACE;
-}
-<ST_PI, ST_PI_WS> \?> {
-	if(Debug.debugTokenizer)
-		dump("processing instruction end");//$NON-NLS-1$
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
-}
-<ST_PI_CONTENT> . {
-	// block scan until close is found
-	return doScan("?>", false, XML_PI_CONTENT, ST_XML_PI_TAG_CLOSE, ST_XML_PI_TAG_CLOSE);
-}
-<ST_PI_CONTENT,ST_XML_PI_TAG_CLOSE> \?> {
-		// ended with nothing inside
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
-}
-<ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_EQUALS> {Name} {
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction attribute name");//$NON-NLS-1$
-        yybegin(ST_XML_PI_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
-}
-<ST_XML_PI_EQUALS> {Eq} {
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction '='");//$NON-NLS-1$
-        yybegin(ST_XML_PI_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
-}
-/* the value was found, look for the next name */
-<ST_XML_PI_ATTRIBUTE_VALUE> {AttValue} | ([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction attribute value");//$NON-NLS-1$
-        yybegin(ST_XML_PI_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
-}
-/* the PI's close was found */
-<ST_XML_PI_EQUALS, ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_ATTRIBUTE_VALUE> {PIend} {
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction end");//$NON-NLS-1$
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
-}
-// DHTML
-<ST_DHTML_ATTRIBUTE_NAME, ST_DHTML_EQUALS> {Name} {
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction attribute name");//$NON-NLS-1$
-        yybegin(ST_DHTML_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
-}
-<ST_DHTML_EQUALS> {Eq} {
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction '='");//$NON-NLS-1$
-        yybegin(ST_DHTML_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
-}
-/* the value was found, look for the next name */
-<ST_DHTML_ATTRIBUTE_VALUE> {AttValue} | ([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction attribute value");//$NON-NLS-1$
-        yybegin(ST_DHTML_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
-}
-/* The DHTML PI's close was found */
-<ST_DHTML_EQUALS, ST_DHTML_ATTRIBUTE_NAME, ST_DHTML_ATTRIBUTE_VALUE> [/]*> {
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction end");//$NON-NLS-1$
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
-}
-
-// XML declarations
-
-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE> {genericTagOpen}! {
-	fStateStack.push(yystate());
-	if(Debug.debugTokenizer)
-		dump("\ndeclaration start");//$NON-NLS-1$
-        yybegin(ST_XML_DECLARATION);
-	return XML_DECLARATION_OPEN;
-}
-<ST_XML_DECLARATION> [Ee][Ll][Ee][Mm][Ee][Nn][Tt] {
-	if(Debug.debugTokenizer)
-		dump("element");//$NON-NLS-1$
-	yybegin(ST_XML_ELEMENT_DECLARATION);
-	return XML_ELEMENT_DECLARATION;
-}
-<ST_XML_DECLARATION> [Dd][Oo][Cc][Tt][Yy][Pp][Ee] {
-	if(Debug.debugTokenizer)
-		dump("doctype");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_DECLARATION);
-	return XML_DOCTYPE_DECLARATION;
-}
-<ST_XML_DECLARATION> [Aa][Tt][Tt][Ll][Ii][Ss][Tt] {
-	if(Debug.debugTokenizer)
-		dump("attlist");//$NON-NLS-1$
-	yybegin(ST_XML_ATTLIST_DECLARATION);
-	return XML_ATTLIST_DECLARATION;
-}
-
-// begin DOCTYPE handling procedure
-<ST_XML_DOCTYPE_DECLARATION, ST_XML_DOCTYPE_EXTERNAL_ID, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DECLARATION_CLOSE> \[[^\]]*\] {
-	return XML_DOCTYPE_INTERNAL_SUBSET;
-}
-
-<ST_XML_DOCTYPE_DECLARATION> {Name} {
-	if(Debug.debugTokenizer)
-		dump("doctype type");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_EXTERNAL_ID);
-	return XML_DOCTYPE_NAME;
-}
-<ST_XML_DOCTYPE_EXTERNAL_ID> [Pp][Uu][Bb][Ll][Ii][Cc] {
-	if(Debug.debugTokenizer)
-		dump("doctype external id");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_ID_PUBLIC);
-	return XML_DOCTYPE_EXTERNAL_ID_PUBLIC;
-}
-<ST_XML_DOCTYPE_EXTERNAL_ID> [Ss][Yy][Ss][Tt][Ee][Mm] {
-	if(Debug.debugTokenizer)
-		dump("doctype external id");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
-	return XML_DOCTYPE_EXTERNAL_ID_SYSTEM;
-}
-<ST_XML_DOCTYPE_ID_PUBLIC> {AttValue}|{PubidLiteral}|([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
-	if(Debug.debugTokenizer)
-		dump("doctype public reference");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
-	return XML_DOCTYPE_EXTERNAL_ID_PUBREF;
-}
-<ST_XML_DOCTYPE_ID_SYSTEM> {AttValue}|{SystemLiteral}|([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
-	if(Debug.debugTokenizer)
-		dump("doctype system reference");//$NON-NLS-1$
-	yybegin(ST_XML_DECLARATION_CLOSE);
-	return XML_DOCTYPE_EXTERNAL_ID_SYSREF;
-}
-// end DOCTYPE handling
-
-// begin ELEMENT handling procedure
-<ST_XML_ELEMENT_DECLARATION> {AttValue}|{PubidLiteral}|([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
-	if(Debug.debugTokenizer)
-		dump("elementdecl name");//$NON-NLS-1$
-	yybegin(ST_XML_ELEMENT_DECLARATION_CONTENT);
-	return XML_ELEMENT_DECL_NAME;
-}
-<ST_XML_ELEMENT_DECLARATION_CONTENT> [^>]* {
-	if(Debug.debugTokenizer)
-		dump("elementdecl contentspec");//$NON-NLS-1$
-	return XML_ELEMENT_DECL_CONTENT;
-}
-
-<ST_XML_ELEMENT_DECLARATION_CONTENT> {genericTagClose} {
-	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;
-}
-// end ELEMENT handling
-
-// begin ATTLIST handling procedure
-<ST_XML_ATTLIST_DECLARATION> {AttValue}|{PubidLiteral}|([\'\"]([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* ) {
-	if(Debug.debugTokenizer)
-		dump("attlist name");//$NON-NLS-1$
-	yybegin(ST_XML_ATTLIST_DECLARATION_CONTENT);
-	return XML_ATTLIST_DECL_NAME;
-}
-<ST_XML_ATTLIST_DECLARATION_CONTENT> [^>]* {
-	if(Debug.debugTokenizer)
-		dump("attlist contentspec");//$NON-NLS-1$
-	return XML_ATTLIST_DECL_CONTENT;
-}
-
-<ST_XML_ATTLIST_DECLARATION_CONTENT> {genericTagClose} {
-	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;
-}
-// end ATTLIST handling
-
-<ST_XML_DECLARATION, ST_XML_DOCTYPE_DECLARATION, ST_XML_DOCTYPE_EXTERNAL_ID, ST_XML_ATTLIST_DECLARATION, ST_XML_ELEMENT_DECLARATION, ST_XML_DECLARATION_CLOSE, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_EXTERNAL_ID> {genericTagClose} {
-	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;
-}
-// end DECLARATION handling
-
-<YYINITIAL> [^<&%]*|[&%]{S}+{Name}[^&%<]*|[&%]{Name}([^;&%<]*|{S}+;*) {
-	if(Debug.debugTokenizer)
-		dump("\nXML content");//$NON-NLS-1$
-	return XML_CONTENT;
-}
-
-
-<ST_BLOCK_TAG_SCAN> .|\r|\n {
-		return doBlockTagScan();
-	}
-
-. {
-	if (Debug.debugTokenizer)
-		System.out.println("!!!unexpected!!!: \"" + yytext() + "\":" + //$NON-NLS-2$//$NON-NLS-1$
-			yychar + "-" + (yychar + yylength()));//$NON-NLS-1$
-	return UNDEFINED;
-}
-
-\040 {
-	if(Debug.debugTokenizer)
-		dump("SPACE");//$NON-NLS-1$
-	return WHITE_SPACE;
-}
-\011 {
-	if(Debug.debugTokenizer)
-		dump("0x9");//$NON-NLS-1$
-	return WHITE_SPACE;
-}
-\015 
-{
-	if(Debug.debugTokenizer)
-		dump("CARRIAGE RETURN");//$NON-NLS-1$
-	return WHITE_SPACE;
-}
-\012 {
-	if(Debug.debugTokenizer)
-		dump("LINE FEED");//$NON-NLS-1$
-	return WHITE_SPACE;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.cmd
deleted file mode 100644
index 59e811c..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.cmd
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-cmd /c flexx.cmd
-cmd /c flexj.cmd
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.sh b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.sh
deleted file mode 100644
index 5cb6e3b..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-export PATH=$PATH:/opt/IBMJava2-131/bin/:/opt/IBMJava2-13/bin/:/opt/jdk1.4
-java -Xmx470000000 -cp JFlex/lib/sed-jflex.jar;. JFlex.Main JSPTokenizer.jflex -skel skeleton.sse
-java -Xmx470000000 -cp JFlex/lib/sed-jflex.jar;. JFlex.Main XMLTokenizer.jflex -skel skeleton.sse
-rm -f JSPTokenizer.java~ JSPTokenizer~ XMLTokenizer.java~ XMLTokenizer~
-cp -v XMLTokenizer.java ../../../../sedmodel/com/ibm/sed/parser/internal
-cp -v JSPTokenizer.java ../../../../sedmodel/com/ibm/sed/parser/internal
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexj.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexj.cmd
deleted file mode 100644
index 04aab36..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexj.cmd
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-PATH=%PATH%;c:\jdk1.4.2_08\bin
-java -Xmx470000000 -cp d:\JFlex\1.2.2\lib\JFlex.jar;. JFlex.Main JSPTokenizer.jflex -skel skeleton.sse && rm -f JSPTokenizer.java~ JSPTokenizer~ && copy JSPTokenizer.java ..\..\..\..\..\org.eclipse.jst.jsp.core\src\org\eclipse\jst\jsp\core\internal\parser\\internal\JSPTokenizer.java
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexx.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexx.cmd
deleted file mode 100644
index fcb1f81..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexx.cmd
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-PATH=%PATH%;c:\jdk1.4.2_08\bin
-java -Xmx470000000 -cp d:\JFlex\1.2.2\lib\JFlex.jar;. JFlex.Main XMLTokenizer.jflex -skel skeleton.sse && rm -f XMLTokenizer.java~ XMLTokenizer~ && copy XMLTokenizer.java ..\..\..\..\..\org.eclipse.wst.xml.core\src\org\eclipse\wst\xml\core\internal\parser\XMLTokenizer.java
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse
deleted file mode 100644
index 92b7634..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse
+++ /dev/null
@@ -1,351 +0,0 @@
-
-  /** 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",		//$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$
-  };
-
---- 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 - 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;
-}
-
---- 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/SedModel/HTMLTokenizer/devel/skeleton.sse.readme b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse.readme
deleted file mode 100644
index eb89700..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse.readme
+++ /dev/null
@@ -1,6 +0,0 @@
-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/build.xml b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/build.xml
deleted file mode 100644
index 03fc4fe..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/build.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="tokenizer" default="CSSTokenizer">
-	<target name="init" depends="properties">
-		<property name="workspace.dir" value="../.."/>
-		<property name="jflex.jar" value="SedModel/HTMLTokenizer/devel/JFlex/lib/sed-jflex.jar"/>
-		<property name="jflex.maxmemory" value="470000000"/>
-		<property name="jflex.opt" value="-skel SedModel/HTMLTokenizer/devel/skeleton.sse"/>
-	</target>
-
-	<target name="properties" if="eclipse.running">
-		<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
-	</target>
-
-	<target name="CSSTokenizer" depends="init">
-		<property name="src.dir" value="SedModel/CSSTokenizer/devel"/>
-		<property name="src.file" value="CSSTokenizer.jflex"/>			
-		<property name="dest.dir" value="org.eclipse.wst.sse.core.css/src/com/ibm/sse/model/css/internal/parser"/>
-		<antcall target="build-tokenizer">
-			<param name="jflex.opt" value=""/>
-		</antcall>
-	</target>
-
-	<target name="XMLTokenizer" depends="init">
-		<property name="src.dir" value="SedModel/HTMLTokenizer/devel"/>
-		<property name="src.file" value="XMLTokenizer"/>			
-		<property name="dest.dir" value="org.eclipse.wst.sse.core.xml/src/com/ibm/sse/model/xml/internal/parser"/>
-		<antcall target="build-tokenizer"/>
-	</target>
-
-	<target name="JSPTokenizer" depends="init">
-		<property name="src.dir" value="SedModel/HTMLTokenizer/devel"/>
-		<property name="src.file" value="JSPTokenizer.jflex"/>			
-		<property name="dest.dir" value="org.eclipse.wst.sse.core.jsp/src/com/ibm/sse/model/jsp/parser/internal"/>
-		<antcall target="build-tokenizer"/>
-	</target>
-
-	<target name="build-tokenizer" depends="init">
-		<antcall target="run-jflex"/>
-		<antcall target="copy"/>
-		<antcall target="clean"/>
-	</target>
-
-	<target name="run-jflex" depends="init">
-		<java classname="JFlex.Main" maxmemory="${jflex.maxmemory}" fork="yes" >
-			<arg line="${src.dir}/${src.file} ${jflex.opt}"/>
-			<classpath>
-				<pathelement location="${jflex.jar}"/>
-			</classpath>
-		</java>
-	</target>
-	
-	<target name="copy" depends="init">
-		<copy todir="${workspace.dir}/${dest.dir}" overwrite="true" verbose="true">
-			<fileset dir="${src.dir}">
-				<include name="*.java"/>
-			</fileset>
-		</copy>
-	</target>
-	
-	<target name="clean" depends="init">
-		<delete verbose="true">
-			<fileset dir="${src.dir}" defaultexcludes="no">
-				<include name="*~"/>
-			</fileset>
-		</delete>
-	</target>
-	
-
-</project>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 5be5741..0000000
--- a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,43 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.sse.core; singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.wst.sse.core.internal.SSECorePlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.sse.core.internal,
- org.eclipse.wst.sse.core.internal.cleanup,
- org.eclipse.wst.sse.core.internal.document,
- org.eclipse.wst.sse.core.internal.encoding,
- org.eclipse.wst.sse.core.internal.encoding.util,
- org.eclipse.wst.sse.core.internal.exceptions,
- org.eclipse.wst.sse.core.internal.filebuffers,
- org.eclipse.wst.sse.core.internal.format,
- org.eclipse.wst.sse.core.internal.ltk.modelhandler,
- org.eclipse.wst.sse.core.internal.ltk.parser,
- org.eclipse.wst.sse.core.internal.model,
- org.eclipse.wst.sse.core.internal.modelhandler,
- org.eclipse.wst.sse.core.internal.parser,
- org.eclipse.wst.sse.core.internal.preferences,
- org.eclipse.wst.sse.core.internal.provisional,
- org.eclipse.wst.sse.core.internal.provisional.document,
- org.eclipse.wst.sse.core.internal.provisional.events,
- org.eclipse.wst.sse.core.internal.provisional.exceptions,
- org.eclipse.wst.sse.core.internal.provisional.model,
- org.eclipse.wst.sse.core.internal.provisional.tasks,
- org.eclipse.wst.sse.core.internal.provisional.text,
- org.eclipse.wst.sse.core.internal.tasks,
- org.eclipse.wst.sse.core.internal.text,
- org.eclipse.wst.sse.core.internal.text.rules,
- org.eclipse.wst.sse.core.internal.undo,
- org.eclipse.wst.sse.core.internal.util,
- org.eclipse.wst.sse.core.internal.validate,
- org.eclipse.wst.sse.internal.contentproperties
-Require-Bundle: org.eclipse.core.resources,
- org.eclipse.text;visibility:=reexport,
- org.eclipse.core.runtime,
- org.eclipse.core.filebuffers,
- org.eclipse.wst.common.uriresolver,
- org.eclipse.emf.common
-Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.sse.core/README.txt b/bundles/org.eclipse.wst.sse.core/README.txt
deleted file mode 100644
index 4eb3ccf..0000000
--- a/bundles/org.eclipse.wst.sse.core/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-The core model of the sse framework. It provides the base document classes,
-builders and parsers.
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/about.html b/bundles/org.eclipse.wst.sse.core/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/bundles/org.eclipse.wst.sse.core/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>February 24, 2005</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.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/build.properties b/bundles/org.eclipse.wst.sse.core/build.properties
deleted file mode 100644
index 54b5ea1..0000000
--- a/bundles/org.eclipse.wst.sse.core/build.properties
+++ /dev/null
@@ -1,32 +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
-#     
-###############################################################################
-source.. = src-encoding/,\
-           src/,\
-           src-tasktags/,\
-           src-contentproperties/
-bin.includes = plugin.xml,\
-               plugin.properties,\
-               .options,\
-               config/,\
-               META-INF/,\
-               .,\
-               about.html
-bin.excludes = bin/**,\
-               @dot/**,\
-               temp.folder/**
-src.includes = DevTimeSupport/,\
-               schema/,\
-               doc/,\
-               component.xml,\
-               build.properties
-output.. = bin/
diff --git a/bundles/org.eclipse.wst.sse.core/component.xml b/bundles/org.eclipse.wst.sse.core/component.xml
deleted file mode 100644
index dae223c..0000000
--- a/bundles/org.eclipse.wst.sse.core/component.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.wst.sse">
-	<description url="http://eclipse.org/webtools/wst/components/sse/overview.html"></description>
-	<component-depends unrestricted="true"></component-depends>
-	<plugin id="org.eclipse.wst.sse.core" fragment="false" />
-	<plugin id="org.eclipse.wst.sse.doc.user" fragment="false" />
-	<plugin id="org.eclipse.wst.sse.ui" fragment="false" />
-	<package name="org.eclipse.wst.sse.ui.views.properties" api="false">
-		<type name="PropertySheetConfiguration" subclass="true" instantiate="true" />
-		<type name="IPropertySourceExtension" implement="true" />
-	</package>
-	<package name="org.eclipse.wst.sse.ui" api="false">
-		<type name="StructuredTextEditor" subclass="false" instantiate="true" />
-		<type name="StructuredTextViewerConfiguration" subclass="true" instantiate="true" />
-	</package>
-	<package name="org.eclipse.wst.sse.ui.views.contentoutline" api="false">
-		<type name="ContentOutlineConfiguration" subclass="true" instantiate="true" />
-	</package>
-	<plugin id="org.eclipse.wst.sse.ui.infopop" fragment="false" />
-</component>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/config/charset.properties b/bundles/org.eclipse.wst.sse.core/config/charset.properties
deleted file mode 100644
index 9e00ac8..0000000
--- a/bundles/org.eclipse.wst.sse.core/config/charset.properties
+++ /dev/null
@@ -1,83 +0,0 @@
-! the number of codeset names
-totalnumber=24
-
-! Only translate the xx.label strings.  Do not translate the xx.iana or xx.java strings.
-
-codeset.0.label=ISO 10646/Unicode(UTF-8)
-codeset.0.iana=UTF-8
-
-codeset.1.label=ISO 10646/Unicode(UTF-16) Big Endian
-codeset.1.iana=UTF-16
-
-codeset.2.label=ISO 10646/Unicode(UTF-16BE) Big Endian
-codeset.2.iana=UTF-16BE
-
-codeset.3.label=ISO 10646/Unicode(UTF-16LE) Little Endian
-codeset.3.iana=UTF-16LE
-
-codeset.4.label=US ASCII
-codeset.4.iana=US-ASCII
-
-codeset.5.label=ISO Latin-1
-codeset.5.iana=ISO-8859-1
-
-! (Slavic: Czech, Croat, German, Hungarian, Polish, Romanian, Slovak, Slovenian)
-codeset.6.label=Central/East European (Slavic) 
-codeset.6.iana=ISO-8859-2
-
-! (Esperanto, Galician, Maltese, Turkish)
-codeset.7.label=Southern European
-codeset.7.iana=ISO-8859-3
-
-codeset.8.label=Arabic, Logical
-codeset.8.iana=ISO-8859-6
-
-codeset.9.label=Arabic
-codeset.9.iana=windows-1256
-
-codeset.10.label=Chinese, National Standard
-codeset.10.iana=GB18030
-
-codeset.11.label=Traditional Chinese, Big5
-codeset.11.iana=BIG5
-
-! (Estonian, Latvian, Lithuanian)
-codeset.12.label=Cyrillic, ISO-8859-4
-codeset.12.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=Greek
-codeset.14.iana=ISO-8859-7
-
-codeset.15.label=Hebrew, Visual
-codeset.15.iana=ISO-8859-8
-
-! label=Hebrew, Logical
-! iana=ISO-8859-8-I
-
-codeset.16.label=Hebrew
-codeset.16.iana=windows-1255
-
-codeset.17.label=Japanese, EUC-JP
-codeset.17.iana=EUC-JP
-
-codeset.18.label=Japanese, ISO 2022
-codeset.18.iana=ISO-2022-JP
-
-codeset.19.label=Japanese, Shift-JIS
-codeset.19.iana=Shift_JIS
-
-codeset.20.label=Korean, EUC-KR
-codeset.20.iana=EUC-KR
-
-codeset.21.label=Korean, ISO 2022
-codeset.21.iana=ISO-2022-KR
-
-codeset.22.label=Thai, TISI
-codeset.22.iana=TIS-620
-
-codeset.23.label=Turkish
-codeset.23.iana=ISO-8859-9
diff --git a/bundles/org.eclipse.wst.sse.core/config/defaultIANA.properties b/bundles/org.eclipse.wst.sse.core/config/defaultIANA.properties
deleted file mode 100644
index 94a4063..0000000
--- a/bundles/org.eclipse.wst.sse.core/config/defaultIANA.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file lists charset mappings between an encoding and its default
-# equivalent encoding listed in charset.properties
-# format: anyname=iana name listed in charset.properties
-
-# No translation necessary
-windows-1252=ISO-8859-1
-windows-932=Shift_JIS
-windows-31j=Shift_JIS
-x-euc-jp-linux=EUC-JP 
-windows-949=EUC-KR
-x-windows-949=EUC-KR
-windows-950=BIG5
-x-windows-950=BIG5
-windows-936=GB18030
-x-mswin-936=GB18030
-GB2312=GB18030
-x-EUC-CN=GB18030
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/config/override.properties b/bundles/org.eclipse.wst.sse.core/config/override.properties
deleted file mode 100644
index 70438b1..0000000
--- a/bundles/org.eclipse.wst.sse.core/config/override.properties
+++ /dev/null
@@ -1,24 +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
-#     
-###############################################################################
-# This file lists charset mappings which supplement or override those
-# provided by the VM. There are few cases where this should be required.
-# Note: there is no integrety checking to see if the validCharsetName is indeed
-# valid for a given VM, so errors would only show up when attempted to 
-# be used.
-
-# No translation necessary
-
-# format: anyname=validjavaCharsetName
-ISO-8859-8-I=ISO-8859-8
-X-SJIS=Shift_JIS
-X-EUC-JP=Shift_JIS
diff --git a/bundles/org.eclipse.wst.sse.core/doc/book.css b/bundles/org.eclipse.wst.sse.core/doc/book.css
deleted file mode 100644
index 9278cd8..0000000
--- a/bundles/org.eclipse.wst.sse.core/doc/book.css
+++ /dev/null
@@ -1,106 +0,0 @@
-P.Code {
-	display: block;
-	text-align: left;
-	text-indent: 0.00pt;
-	margin-top: 0.000000pt;
-	margin-bottom: 0.000000pt;
-	margin-right: 0.000000pt;
-	margin-left: 15pt;
-	font-size: 10.000000pt;
-	font-weight: medium;
-	font-style: Regular;
-	color: #4444CC;
-	text-decoration: none;
-	vertical-align: baseline;
-	text-transform: none;
-	font-family: "Courier New";
-}
-H6.CaptionFigColumn {
-	display: block;
-	text-align: left;
-	text-indent: 0.000000pt;
-	margin-top: 3.000000pt;
-	margin-bottom: 11.000000pt;
-	margin-right: 0.000000pt;
-	margin-left: 0.000000pt;
-	font-size: 9.000000pt;
-	font-weight: medium;
-	font-style: Italic;
-	color: #000000;
-	text-decoration: none;
-	vertical-align: baseline;
-	text-transform: none;
-	font-family: "Arial";
-}
-P.Note {
-	display: block;
-	text-align: left;
-	text-indent: 0pt;
-	margin-top: 19.500000pt;
-	margin-bottom: 19.500000pt;
-	margin-right: 0.000000pt;
-	margin-left: 30pt;
-	font-size: 11.000000pt;
-	font-weight: medium;
-	font-style: Italic;
-	color: #000000;
-	text-decoration: none;
-	vertical-align: baseline;
-	text-transform: none;
-	font-family: "Arial";
-}
-EM.UILabel {
-	font-weight: Bold;
-	font-style: Regular;
-	text-decoration: none;
-	vertical-align: baseline;
-	text-transform: none;
-}
-EM.CodeName {
-	font-weight: Bold;
-	font-style: Regular;
-	text-decoration: none;
-	vertical-align: baseline;
-	text-transform: none;
-	font-family:"Courier New";
-}
-
-
-
-
-/* following font face declarations need to be removed for DBCS */
-
-body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-family: Arial, Helvetica, sans-serif; color: #000000}
-pre				{ font-family: Courier, monospace}
-
-/* end font face declarations */
-
-/* following font size declarations should be OK for DBCS */
-body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-size: 10pt; }
-pre				{ font-size: 10pt}
-
-/* end font size declarations */
-
-body	     { background: #FFFFFF}
-h1           { font-size: 18pt; margin-top: 5; margin-bottom: 1 }	
-h2           { font-size: 14pt; margin-top: 25; margin-bottom: 3 }
-h3           { font-size: 11pt; margin-top: 20; margin-bottom: 3 }
-h4           { font-size: 10pt; margin-top: 20; margin-bottom: 3; font-style: italic }
-p            { margin-top: 10px; margin-bottom: 10px }
-pre	     { margin-left: 6; font-size: 9pt }
-a:link	     { color: #0000FF }
-a:hover	     { color: #000080 }
-a:visited    { text-decoration: underline }
-ul	     { margin-top: 0; margin-bottom: 10 }
-li	     { margin-top: 0; margin-bottom: 0 } 
-li p	     { margin-top: 0; margin-bottom: 0 } 
-ol	     { margin-top: 0; margin-bottom: 10 }
-dl	     { margin-top: 0; margin-bottom: 10 }
-dt	     { margin-top: 0; margin-bottom: 0; font-weight: bold }
-dd	     { margin-top: 0; margin-bottom: 0 }
-strong	     { font-weight: bold}
-em	     { font-style: italic}
-var	     { font-style: italic}
-div.revision { border-left-style: solid; border-left-width: thin; 
-				   border-left-color: #7B68EE; padding-left:5 }
-th	     { font-weight: bold }
diff --git a/bundles/org.eclipse.wst.sse.core/doc/schema.css b/bundles/org.eclipse.wst.sse.core/doc/schema.css
deleted file mode 100644
index 4efbf26..0000000
--- a/bundles/org.eclipse.wst.sse.core/doc/schema.css
+++ /dev/null
@@ -1,66 +0,0 @@
-H6.CaptionFigColumn#header {
-	font-size:16px; 
-	display:inline
-}
-
-P.Note#copyright {
-	font-size: smaller; 
-	font-style: normal;
-	color: #336699; 
-	display:inline;
-	margin-top: 3.000000pt;
-	margin-bottom: 11.000000pt;
-	margin-right: 0.000000pt;
-	margin-left: 0.000000pt;
-}
-
-P.Code#dtd {
-	color: #800000; 
-	margin-top: 0.000000pt;
-	margin-bottom: 0.000000pt;
-	margin-right: 0.000000pt;
-	margin-left: 10.000000pt;
-}
-
-P.Code#dtdAttlist {
-	color: #800000; 
-	margin-top: 0.000000pt;
-	margin-bottom: 0.000000pt;
-	margin-right: 0.000000pt;
-	margin-left: 20.000000pt;
-}
-
-P.Code#tag {
-	color: #000080; 
-	display:inline;
-	margin-top: 0.000000pt;
-	margin-bottom: 0.000000pt;
-	margin-right: 0.000000pt;
-	margin-left: 0.000000pt;
-}
-
-P.Code#cstring {
-	color: #008000; 
-	display:inline;
-	margin-top: 0.000000pt;
-	margin-bottom: 0.000000pt;
-	margin-right: 0.000000pt;
-	margin-left: 0.000000pt;	
-}
-
-.ConfigMarkup#elementDesc {
-	color: black;
-	margin-top: 0.000000pt;
-	margin-bottom: 0.000000pt;
-	margin-right: 0.000000pt;
-	margin-left: 10.000000pt;
-}
-
-.ConfigMarkup#attlistDesc {
-	color: black;
-	margin-top: 0.000000pt;
-	margin-bottom: 0.000000pt;
-	margin-right: 0.000000pt;
-	margin-left: 32.000000pt;
-}
-
diff --git a/bundles/org.eclipse.wst.sse.core/plugin.properties b/bundles/org.eclipse.wst.sse.core/plugin.properties
deleted file mode 100644
index 9bc14b0..0000000
--- a/bundles/org.eclipse.wst.sse.core/plugin.properties
+++ /dev/null
@@ -1,26 +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
-#     
-###############################################################################
-providerName=Eclipse.org
-pluginName=Structured Text Model
-nlFeatureName=Structured Text Model NL Support
-# extension names
-Adapt_On_Create_Factory_Extension.name=Adapt On Create Factory Extension
-Document_Types_Extension.name=Document Types Extension
-JSP_Embedded_Content_Type_Handler_Extension.name=JSP Embedded Content Type Handler Extension
-Content_Type_Factory_Contribution_Extension.name=Content Type Factory Contribution Extension
-CSS_Profile_Extension.name=CSS Profile Extension
-Comment_Element_Handler_Extension.name=Comment Element Handler Extension
-Model_Handler_Extension.name=Model Handler Extension
-Format_Processors_Extension_Point.name=Format Processors Extension Point
-Task_Scanner_Extension_Point.name=Task Scanner Extension Point
-Structured_Sources_Task_Extension.name=Structured Sources Task
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/plugin.xml b/bundles/org.eclipse.wst.sse.core/plugin.xml
deleted file mode 100644
index 789d85d..0000000
--- a/bundles/org.eclipse.wst.sse.core/plugin.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-
-	<!-- deprecated -->
-	<extension-point id="adaptOnCreateFactory" name="%Adapt_On_Create_Factory_Extension.name" schema="schema/adaptOnCreateFactory.exsd"/>
-	<!-- not for use by clients (internal)-->
-	<extension-point id="documentTypes" name="%Document_Types_Extension.name" schema="schema/documentTypes.exsd"/>
-	<!-- not for use by clients (internal)-->
-	<extension-point id="embeddedTypeHandler" name="%JSP_Embedded_Content_Type_Handler_Extension.name" schema="schema/embeddedTypeHandler.exsd"/>
-	<!-- deprecated -->
-	<extension-point id="contentTypeFactoryContribution" name="%Content_Type_Factory_Contribution_Extension.name" schema="schema/contentTypeFactoryContribution.exsd"/>
-	<!-- I commented out ... clients should just use the normal platform way of registering these 
-		adapterFactories. At worst, they'd need a small plugin with 'startup' specified ... but that's 
-		better than us getting hit with the performance impact (of loading plugins and pre-reqs, etc.). 
-		<extension-point id="uriResolverAdapterFactory" name="Resource Adapter Factory for Creating URIResolvers"/>
-	-->
-	<!-- not for use by clients (internal)-->
-	<extension-point id="cssprofile" name="%CSS_Profile_Extension.name" schema="schema/cssprofile.exsd"/>
-	<!-- not for use by clients (internal)-->
-	<extension-point id="commentElementHandler" name="%Comment_Element_Handler_Extension.name" schema="schema/commentElementHandler.exsd"/>
-
-	<!-- not for use by clients (internal)-->
-	<extension-point id="modelHandler" name="%Model_Handler_Extension.name" schema="schema/modelHandler.exsd"/>
-	<!-- not for use by clients (internal)-->
-	<extension-point
-		id="formatProcessors"
-		name="%Format_Processors_Extension_Point.name"
-		schema="schema/formatProcessors.exsd" />
-
-	<!-- not for use by clients (internal)-->
-	<extension-point id="taskscanner" name="%Task_Scanner_Extension_Point.name" schema="schema/taskscanner.exsd"/>
-
-	<!-- define our task marker type -->
-	<extension
-		id="task"
-		name="%Structured_Sources_Task_Extension.name"
-		point="org.eclipse.core.resources.markers">
-		<super type="org.eclipse.core.resources.taskmarker" />
-		<persistent value="true" />
-	</extension>
-
-	<!-- Make sure default preference values are set at runtime -->
-	<extension point="org.eclipse.core.runtime.preferences">
-		<initializer
-			class="org.eclipse.wst.sse.core.internal.preferences.PreferenceInitializer" />
-	</extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.sse.core/schema/adaptOnCreateFactory.exsd b/bundles/org.eclipse.wst.sse.core/schema/adaptOnCreateFactory.exsd
deleted file mode 100644
index ddbf899..0000000
--- a/bundles/org.eclipse.wst.sse.core/schema/adaptOnCreateFactory.exsd
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.sse.core" id="adaptOnCreateFactory" name="Adapt On Create Factory Extension Point"/>
-      </appInfo>
-      <documentation>
-         &lt;b&gt;This extension point is deprecated and should not be used.&lt;/b&gt;
-      </documentation>
-   </annotation>
-
-   <element name="extension">
-      <complexType>
-         <sequence>
-         </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>
-
-   <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.sse.core/schema/commentElementHandler.exsd b/bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd
deleted file mode 100644
index 1441736..0000000
--- a/bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.sse.core" id="commentElementHandler" name="Comment Element Handler Extension Point"/>
-      </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="handler-custom"/>
-         </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="handler-custom">
-      <complexType>
-         <sequence>
-            <element ref="startwith"/>
-         </sequence>
-         <attribute name="commenttype" 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>
-
-   <element name="startwith">
-      <complexType>
-         <attribute name="prefix" 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) 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.sse.core/schema/contentTypeFactoryContribution.exsd b/bundles/org.eclipse.wst.sse.core/schema/contentTypeFactoryContribution.exsd
deleted file mode 100644
index cf8418e..0000000
--- a/bundles/org.eclipse.wst.sse.core/schema/contentTypeFactoryContribution.exsd
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.sse.core" id="contentTypeFactoryContribution" name="Content Type Factory Contribution Extension Point"/>
-      </appInfo>
-      <documentation>
-         &lt;b&gt;This extension point is deprecated and should not be used.&lt;/b&gt;
-      </documentation>
-   </annotation>
-
-   <element name="extension">
-      <complexType>
-         <sequence>
-         </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>
-
-   <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) 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.sse.core/schema/cssprofile.exsd b/bundles/org.eclipse.wst.sse.core/schema/cssprofile.exsd
deleted file mode 100644
index 923e853..0000000
--- a/bundles/org.eclipse.wst.sse.core/schema/cssprofile.exsd
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.sse.core" id="cssprofile" name="CSS Profile Extension Point"/>
-      </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="profile" 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="profile">
-      <complexType>
-         <attribute name="name" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-               <appInfo>
-                  <meta.attribute translatable="true"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-         <attribute name="default" type="boolean">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="uri" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="id" 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) 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.sse.core/schema/documentTypes.exsd b/bundles/org.eclipse.wst.sse.core/schema/documentTypes.exsd
deleted file mode 100644
index b90f35f..0000000
--- a/bundles/org.eclipse.wst.sse.core/schema/documentTypes.exsd
+++ /dev/null
@@ -1,172 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.sse.core" id="documentTypes" name="Document Types Extension Point"/>
-      </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="documentType" 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="documentType">
-      <complexType>
-         <attribute name="elementName" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="displayName" type="string">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-               <appInfo>
-                  <meta.attribute translatable="true"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-         <attribute name="namespaceURI" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="isXHTML" type="boolean">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="hasFrameset" type="boolean">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="publicID" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="systemID" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="defaultXHTML" type="boolean">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="isWML" type="boolean">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="defaultWML" type="boolean">
-            <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) 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.sse.core/schema/embeddedTypeHandler.exsd b/bundles/org.eclipse.wst.sse.core/schema/embeddedTypeHandler.exsd
deleted file mode 100644
index bbcde8d..0000000
--- a/bundles/org.eclipse.wst.sse.core/schema/embeddedTypeHandler.exsd
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.sse.core" id="embeddedTypeHandler" name="JSP Embedded Content Type Handler Extension Point"/>
-      </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="embeddedTypeHandler"/>
-         </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="embeddedTypeHandler">
-      <complexType>
-         <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) 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.sse.core/schema/formatProcessors.exsd b/bundles/org.eclipse.wst.sse.core/schema/formatProcessors.exsd
deleted file mode 100644
index e5bd5eb..0000000
--- a/bundles/org.eclipse.wst.sse.core/schema/formatProcessors.exsd
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.sse.core" id="formatProcessors" name="Format Processors Extension Point"/>
-      </appInfo>
-      <documentation>
-         This extension point is for defining the format processsor for a content type.
-      </documentation>
-   </annotation>
-
-   <element name="extension">
-      <complexType>
-         <sequence>
-            <element ref="processor"/>
-         </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="processor">
-      <complexType>
-         <attribute name="class" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="java"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-         <attribute name="contentTypeId" 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>
-         &lt;pre&gt;
-   &lt;extension
-         point=&quot;org.eclipse.wst.sse.core.formatProcessors&quot;&gt;
-      &lt;processor
-            class=&quot;org.eclipse.wst.sse.core.xml.format.FormatProcessorXML&quot;
-            contentTypeId=&quot;org.eclipse.core.runtime.xml&quot;&gt;
-      &lt;/processor&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.sse.core/schema/modelHandler.exsd b/bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd
deleted file mode 100644
index 1c375bb..0000000
--- a/bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.sse.core" id="modelHandler" name="Model Handler Extension Point"/>
-      </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 minOccurs="0" maxOccurs="unbounded">
-            <element ref="modelHandler"/>
-         </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="modelHandler">
-      <complexType>
-         <attribute name="id" 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>
-         <attribute name="associatedContentTypeId" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="default" type="string">
-            <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) 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.sse.core/schema/taskscanner.exsd b/bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd
deleted file mode 100644
index 46c03fb..0000000
--- a/bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.sse.core" id="taskscanner" name="Task Scanner Extension Point"/>
-      </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="scanner"/>
-         </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="scanner">
-      <complexType>
-         <attribute name="contentTypeIds" 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>
-         <attribute name="id" 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) 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.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractContentSettingsHandler.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractContentSettingsHandler.java
deleted file mode 100644
index 2ea4a2d..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractContentSettingsHandler.java
+++ /dev/null
@@ -1,80 +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.sse.internal.contentproperties;
-
-import org.eclipse.core.resources.IResourceDelta;
-
-abstract class AbstractContentSettingsHandler implements IContentSettingsHandler {
-
-
-	private IContentSettings contentSettings = ContentSettingsCreator.create();
-	private IResourceDelta fDelta;
-
-	private void commonWithRespectToKind() {
-		getContentSettings().releaseCache();
-	}
-
-	protected final IContentSettings getContentSettings() {
-		return contentSettings;
-	}
-
-	protected final IResourceDelta getDelta() {
-		return fDelta;
-	}
-
-
-	/*
-	 * @see IContentSettingsHandler#handle(IResourceDelta)
-	 */
-	public void handle(final IResourceDelta delta) {
-		this.fDelta = delta;
-		// get Resource delta kind
-		final int kind = delta.getKind();
-		// never used!?
-		//IResource resource = delta.getResource();
-
-
-		switch (kind) {
-			case IResourceDelta.CHANGED : {
-				handleChanged();
-			}
-				break;
-			case IResourceDelta.REMOVED : {
-				handleRemoved();
-			}
-				break;
-			case IResourceDelta.ADDED : {
-				handleAdded();
-			}
-				break;
-
-
-		}
-
-
-
-	}
-
-	protected void handleAdded() {
-		commonWithRespectToKind();
-	}
-
-	protected void handleChanged() {
-		commonWithRespectToKind();
-	}
-
-	protected void handleRemoved() {
-		commonWithRespectToKind();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractSubject.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractSubject.java
deleted file mode 100644
index d3d16b0..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractSubject.java
+++ /dev/null
@@ -1,50 +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.sse.internal.contentproperties;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-public abstract class AbstractSubject implements INotify, ISubject {
-
-
-
-	private static Map listenerList = new Hashtable();
-
-	public synchronized void addListener(IContentSettingsListener listener) {
-		listenerList.put(listener, listener);
-	}
-
-	/*
-	 * @see IContentSettingsEventSubject#notifyContentSettingsListeners(Object)
-	 */
-	public synchronized void notifyListeners(org.eclipse.core.resources.IResource changedResource) {
-
-		Set keys = listenerList.keySet();
-		Iterator iter = keys.iterator();
-
-		while (iter.hasNext()) {
-			IContentSettingsListener csl = (IContentSettingsListener) iter.next();
-			csl.contentSettingsChanged(changedResource);
-		}
-	}
-
-	public synchronized void removeListener(IContentSettingsListener listener) {
-		listenerList.remove(listener);
-	}
-
-
-
-}
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
deleted file mode 100644
index 7044188..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java
+++ /dev/null
@@ -1,667 +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.sse.internal.contentproperties;
-
-
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-
-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.wst.sse.core.internal.Logger;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class ContentSettings implements IContentSettings {
-	private static final String contentSettingsName = ".contentsettings";//$NON-NLS-1$
-
-	private static SimpleNodeOperator domOperator;
-
-	private static IProject preProject;
-
-	private static final IContentSettings singleton = new ContentSettings();
-
-	public static final String getContentSettingsName() {
-		return contentSettingsName;
-	}
-
-	public synchronized static IContentSettings getInstance() {
-		return singleton;
-	}
-
-	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 final String rootElementName = "contentsettings";//$NON-NLS-1$
-
-
-
-	private ContentSettings() {
-		currProject = null;
-		contentSettingsPath = null;
-	}
-
-
-	private void _setProperties(final IResource resource, final Map properties) {
-		if (resource == null || properties == null || properties.isEmpty())
-			return;
-		if (!(resource.getType() == IResource.PROJECT || resource.getType() == IResource.FILE))
-			return;
-
-		contentSettingsPath = getContentSettingsPath(resource);
-		if (contentSettingsPath == null)
-			return;
-
-		try {
-
-			if (!existsContentSettings()) {
-				// create DOM tree for new XML Document
-				createNewDOMTree();
-			} else {
-				// create DOM tree from existing contentsettings.
-				createDOMTree();
-			}
-
-		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
-			Logger.logException(e);
-			try {
-				createNewDOMTree();
-				writeDOMDocument();
-			} catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
-				Logger.logException(e2);
-				preProject = currProject;
-				return;
-			} catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
-				Logger.logException(e2);
-				preProject = currProject;
-				return;
-			}
-
-		} catch (SimpleNodeOperator.CreateContentSettingsFailureException e) {
-			Logger.logException(e);
-			preProject = currProject;
-			return;
-		}
-
-		Element e = null;
-		if (resource.getType() == IResource.PROJECT) {
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
-			if (e == null) {
-				// create project Element and add it into tree
-				e = (Element) domOperator.addElementUnderRoot(this.projectElementName);
-			}
-		} else if (resource.getType() == IResource.FILE) {
-			// check exists file Element
-			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
-			if (e == null) {
-				// create file Element and add path into it.
-				e = (Element) domOperator.addElementUnderRoot(this.fileElementName);
-				domOperator.addAttributeAt(e, getPathAttr(), getRelativePathFromProject(resource));
-			}
-		}
-
-		// check exists propertyName attribute
-		Map attrList = domOperator.getAttributesOf(e);
-		boolean hasAttr = true;
-		if (attrList == null || attrList.isEmpty())
-			hasAttr = false;
-		Set keys = properties.keySet();
-		Iterator ii = keys.iterator();
-		while (ii.hasNext()) {
-			String propertyName = (String) ii.next();
-			String propertyValue = (String) properties.get(propertyName);
-
-
-			if (!hasAttr || (String) attrList.get(propertyName) == null)
-				// create propertyName attribute and add
-				domOperator.addAttributeAt(e, propertyName, propertyValue);
-			else
-				// set attribute value
-				domOperator.updateAttributeAt(e, propertyName, propertyValue);
-		}
-
-		// write dom tree into .contentsettings
-		try {
-			writeDOMDocument();
-		} catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
-			Logger.logException(ex);
-			preProject = currProject;
-			return;
-		}
-
-		preProject = currProject;
-
-
-	}
-
-
-	private void _setProperty(final IResource resource, final String propertyName, final String propertyValue) {
-		if (resource == null || propertyName == null)
-			return;
-		if (!(resource.getType() == IResource.PROJECT || resource.getType() == IResource.FILE))
-			return;
-
-		contentSettingsPath = getContentSettingsPath(resource);
-		if (contentSettingsPath == null)
-			return;
-
-		try {
-
-			if (!existsContentSettings()) {
-				// create DOM tree for new XML Document
-				createNewDOMTree();
-			} else {
-				// create DOM tree from existing contentsettings.
-				createDOMTree();
-			}
-
-		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
-			Logger.logException(e);
-			try {
-				createNewDOMTree();
-				writeDOMDocument();
-			} catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
-				Logger.logException(e2);
-				preProject = currProject;
-				return;
-			} catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
-				Logger.logException(e2);
-				preProject = currProject;
-				return;
-			}
-
-		} catch (SimpleNodeOperator.CreateContentSettingsFailureException e) {
-			Logger.logException(e);
-			preProject = currProject;
-			return;
-		}
-
-		Element e = null;
-		if (resource.getType() == IResource.PROJECT) {
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
-			if (e == null) {
-				// create project Element and add it into tree
-				e = (Element) domOperator.addElementUnderRoot(this.projectElementName);
-			}
-		} else if (resource.getType() == IResource.FILE) {
-			// check exists file Element
-			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
-			if (e == null) {
-				// create file Element and add path into it.
-				e = (Element) domOperator.addElementUnderRoot(this.fileElementName);
-				domOperator.addAttributeAt(e, getPathAttr(), getRelativePathFromProject(resource));
-			}
-		}
-
-		// check exists propertyName attribute
-
-		Map attrList = domOperator.getAttributesOf(e);
-		if (attrList == null || attrList.isEmpty() || (String) attrList.get(propertyName) == null)
-			// create propertyName attribute and add
-			domOperator.addAttributeAt(e, propertyName, propertyValue);
-		else
-			// set attribute value
-			domOperator.updateAttributeAt(e, propertyName, propertyValue);
-
-
-		// write dom tree into .contentsettings
-		try {
-			writeDOMDocument();
-		} catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
-			Logger.logException(ex);
-			preProject = currProject;
-			return;
-		}
-
-		preProject = currProject;
-
-
-	}
-
-
-	private void createDOMTree() throws SimpleNodeOperator.ReadContentSettingsFailureException {
-		if (domOperator == null || (currProject != null && (!currProject.equals(preProject)) && contentSettingsPath != null))
-			domOperator = new SimpleNodeOperator(contentSettingsPath);
-
-
-	}
-
-	/*
-	 * private void createNewDOMTree() throws
-	 * SimpleNodeOperator.CreateContentSettingsFailureException{ // create New
-	 * document when no file exists. DOMImplementation impl =
-	 * DOMImplementationImpl.getDOMImplementation(); Document document =
-	 * impl.createDocument(null,rootElementName,null); domOperator = new
-	 * SimpleNodeOperator(document); }
-	 */
-	private void createNewDOMTree() throws SimpleNodeOperator.CreateContentSettingsFailureException {
-		Document document = null;
-		try {
-			document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
-		} catch (ParserConfigurationException e) {
-			Logger.logException("exception creating document", e); //$NON-NLS-1$
-		} catch (FactoryConfigurationError e) {
-			Logger.logException("exception creating document", e); //$NON-NLS-1$
-		}
-		if (document != null) {
-			document.appendChild(document.createElement(rootElementName));
-			domOperator = new SimpleNodeOperator(document);
-		}
-	}
-
-
-	/**
-	 *  
-	 */
-	public synchronized void deleteAllProperties(final IResource deletedFile) {
-		if (deletedFile == null)
-			return;
-		//	if (deletedFile.exists()) return;
-		if ((deletedFile).getType() != IResource.FILE && (deletedFile).getType() != IResource.PROJECT)
-			return;
-
-
-		contentSettingsPath = getContentSettingsPath(deletedFile);//getProjectOf((IResource)deletedFile)
-		// +
-		// IPath.SEPARATOR
-		// +
-		// contentSettingsName;
-		if (contentSettingsPath == null)
-			return;
-		if (!existsContentSettings())
-			return;
-
-		try {
-			createDOMTree();
-		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
-			Logger.logException(e);
-			return;
-		}
-
-		Element e = null;
-		if (deletedFile.getType() == IResource.PROJECT)
-			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
-		else if (deletedFile.getType() == IResource.FILE)
-			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(deletedFile));
-		if (e == null) {
-			preProject = currProject;
-			return;
-		}
-
-
-		// when deletedFile entry exists.
-		if (deletedFile.getType() == IResource.PROJECT)
-			domOperator.removeElementWith(this.projectElementName);
-		else if (deletedFile.getType() == IResource.FILE)
-			domOperator.removeElementWith(getPathAttr(), getRelativePathFromProject(deletedFile));
-
-
-		// write dom tree into .contentsettings
-		try {
-			writeDOMDocument();
-		} catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
-			Logger.logException(ex);
-			preProject = currProject;
-			return;
-		}
-
-		preProject = currProject;
-
-
-	}
-
-	public synchronized void deleteProperty(final IResource resource, final String propertyName) {
-		if (resource == null)
-			return;
-		if (!(resource.getType() == IResource.PROJECT || resource.getType() == IResource.FILE))
-			return;
-		contentSettingsPath = getContentSettingsPath(resource);
-		if (contentSettingsPath == null)
-			return;
-
-		if (!existsContentSettings()) {
-			return; // when .contentsettings.xml is NOT exist.
-		}
-		try {
-			createDOMTree();
-		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e) {
-			Logger.logException(e);
-			try {
-				createNewDOMTree();
-				writeDOMDocument();
-			} catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
-				Logger.logException(e2);
-				preProject = currProject;
-				return;
-			} catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
-				Logger.logException(e2);
-				preProject = currProject;
-				return;
-			}
-		}
-
-		Element e = null;
-		if (resource.getType() == IResource.PROJECT)
-			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
-		else if (resource.getType() == IResource.FILE)
-			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
-
-
-		if (e != null) {
-			domOperator.removeAttributeAt(e, propertyName);
-			// write dom tree into .contentsettings
-			try {
-				writeDOMDocument();
-			} catch (SimpleNodeOperator.WriteContentSettingsFailureException ex) {
-				Logger.logException(ex);
-				preProject = currProject;
-				return;
-			}
-		}
-
-		preProject = currProject;
-
-	}
-
-
-	private boolean existsContentSettings() {
-		if (contentSettingsPath == null)
-			return false;
-
-		IResource file = currProject.getFile(contentSettingsName);
-		if (file == null)
-			return false;
-		if (file.isAccessible())
-			return true;
-		else
-			return false;
-
-	}
-
-	public boolean existsProperties(IResource resource) {
-		if (resource == null)
-			return false;
-
-		if (!(resource.getType() == IResource.PROJECT || resource.getType() == IResource.FILE))
-			return false;
-
-		contentSettingsPath = getContentSettingsPath(resource);
-		if (contentSettingsPath == null)
-			return false;
-
-		if (!existsContentSettings())
-			return false; // when .contentsettings.xml is NOT exist.
-
-		try {
-			createDOMTree();
-		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e1) {
-			return false;
-		}
-
-		Element e = null;
-		if (resource.getType() == IResource.PROJECT)
-			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
-		else if (resource.getType() == IResource.FILE)
-			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
-
-		preProject = currProject;
-		if (e == null)
-			return false;
-
-		Map properties = domOperator.getAttributesOf(e);
-		if (properties == null)
-			return false;
-		properties.remove(getPathAttr());// if IFile,removed
-		if (properties.isEmpty())
-			return false;
-		return true;
-
-	}
-
-	private String getContentSettingsPath(IResource resource) {
-		String projectPath = getProjectOf(resource);
-		StringBuffer strbuf = new StringBuffer(""); //$NON-NLS-1$
-		if (projectPath != null) {
-			strbuf.append(projectPath);
-			strbuf.append(IPath.SEPARATOR);
-			strbuf.append(contentSettingsName);
-		} else
-			return null;
-
-		String str = strbuf.toString();
-		strbuf.delete(0, strbuf.length());
-		return str;
-	}
-
-	public final String getPathAttr() {
-		return PATHATTR;
-	}
-
-
-	private String getProjectOf(IResource resource) {
-		//if (resource==null) return null;
-		currProject = resource.getProject();
-		//String projectPath=null;
-
-		IPath path = currProject.getLocation();
-		if (path == null) {
-			path = ResourcesPlugin.getWorkspace().getRoot().getLocation();
-			if (path != null) {
-				path = path.addTrailingSeparator();
-				path = path.append(currProject.getName());
-			}
-		}
-		return (path != null) ? path.toString() : null;
-
-	}
-
-
-	public synchronized Map getProperties(final IResource resource) {
-		if (resource == null)
-			return null;
-
-		if (!(resource.getType() == IResource.PROJECT || resource.getType() == IResource.FILE))
-			return null;
-
-		contentSettingsPath = getContentSettingsPath(resource);
-		if (contentSettingsPath == null)
-			return null;
-
-		if (!existsContentSettings()) {
-			return null; // when .contentsettings.xml is NOT exist.
-		}
-
-
-		try {
-			createDOMTree();
-		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e1) {
-			Logger.logException(e1);
-			// create DOM tree for new XML Document
-			try {
-				createNewDOMTree();
-				writeDOMDocument();
-			} catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
-				Logger.logException(e2);
-				preProject = currProject;
-				return null;
-			} catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
-				Logger.logException(e2);
-				preProject = currProject;
-				return null;
-			}
-
-		}
-
-
-		Element e = null;
-		if (resource.getType() == IResource.PROJECT)
-			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
-		else if (resource.getType() == IResource.FILE)
-			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
-
-
-		if (e != null) {
-
-			Map properties = domOperator.getAttributesOf(e);
-			preProject = currProject;
-			if (properties == null)
-				return null;
-			if (properties.isEmpty())
-				return null;
-			properties.remove(getPathAttr());
-			return properties;
-		} else {
-			preProject = currProject;
-			return null;// when project or file element is NOT exist.
-		}
-	}
-
-	public synchronized String getProperty(final IResource resource, final String propertyName) {
-		if (resource == null)
-			return null;
-
-		if (!(resource.getType() == IResource.PROJECT || resource.getType() == IResource.FILE))
-			return null;
-
-		contentSettingsPath = getContentSettingsPath(resource);
-		if (contentSettingsPath == null)
-			return null;
-
-		if (!existsContentSettings()) {
-			return null; // when .contentsettings.xml is NOT exist.
-		}
-
-
-		try {
-			createDOMTree();
-		} catch (SimpleNodeOperator.ReadContentSettingsFailureException e1) {
-			Logger.logException(e1);
-			// create DOM tree for new XML Document
-			try {
-				createNewDOMTree();
-				writeDOMDocument();
-			} catch (SimpleNodeOperator.CreateContentSettingsFailureException e2) {
-				Logger.logException(e2);
-				preProject = currProject;
-				return null;
-			} catch (SimpleNodeOperator.WriteContentSettingsFailureException e2) {
-				Logger.logException(e2);
-				preProject = currProject;
-				return null;
-			}
-
-		}
-
-
-		Element e = null;
-		if (resource.getType() == IResource.PROJECT)
-			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
-		else if (resource.getType() == IResource.FILE)
-			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
-
-
-		if (e != null) {
-			String result = e.getAttribute(propertyName);
-			preProject = currProject;
-			return result;
-		} else {
-			preProject = currProject;
-			return null;// when project or file element is NOT exist.
-		}
-	}
-
-	private String getRelativePathFromProject(IResource resource) {
-		if (resource == null)
-			return null;
-
-		IPath path = resource.getProjectRelativePath();
-		if (path == null)
-			return null; // if resource is project or workspace root
-		String resourcePath = path.toString();
-
-		return resourcePath;
-
-	}
-
-	public synchronized void releaseCache() {
-		domOperator = null;
-	}
-
-	public synchronized void setProperties(final IResource resource, final Map properties) {
-		// deny to set "path" attribute value.
-		Set keys = properties.keySet();
-		Iterator ii = keys.iterator();
-		while (ii.hasNext()) {
-			if (this.getPathAttr().equals(ii.next()))
-				return;
-		}
-		this._setProperties(resource, properties);
-	}
-
-	public synchronized void setProperty(final IResource resource, final String propertyName, final String propertyValue) {
-		// deny to set "path" attribute value.
-		if (this.getPathAttr().equals(propertyName))
-			return;
-		this._setProperty(resource, propertyName, propertyValue);
-	}
-
-	private void writeDOMDocument() throws SimpleNodeOperator.WriteContentSettingsFailureException {
-		try {
-
-			ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-			domOperator.writeDocument(outputStream);
-			outputStream.flush();
-			outputStream.close();
-
-			ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
-
-			IFile outputFile = currProject.getFile(contentSettingsName);
-			if (outputFile.exists())
-				outputFile.setContents(inputStream, true, true, null);
-			else
-				outputFile.create(inputStream, true, null);
-
-			inputStream.close();
-		} catch (CoreException e) {
-			Logger.logException(e);
-			throw new SimpleNodeOperator.WriteContentSettingsFailureException("invalid outputFile in writeDOMDocument()");//$NON-NLS-1$
-		} catch (IOException e) {
-			Logger.logException(e);
-			throw new SimpleNodeOperator.WriteContentSettingsFailureException("invalid outputStream or inputStream in writeDOMDocument()");//$NON-NLS-1$
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsChangeSubject.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsChangeSubject.java
deleted file mode 100644
index 0cdf8ed..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsChangeSubject.java
+++ /dev/null
@@ -1,59 +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.sse.internal.contentproperties;
-
-
-
-public class ContentSettingsChangeSubject extends AbstractSubject {
-
-
-	private static INotify notify;
-	private static ISubject subject;
-
-	protected static INotify getNotify() {
-		if (notify == null && subject == null) {
-			synchronized (ContentSettingsChangeSubject.class) {
-				if (notify == null && subject == null) {
-					notify = new ContentSettingsChangeSubject();
-					subject = (ISubject) notify;
-				}
-			}
-		}
-
-		return notify;
-	}
-
-	public static ISubject getSubject() {
-		if (subject == null && notify == null) {
-			synchronized (ContentSettingsChangeSubject.class) {
-				if (subject == null && notify == null) {
-					subject = new ContentSettingsChangeSubject();
-					notify = (INotify) subject;
-				}
-			}
-		}
-		return subject;
-	}
-
-	public synchronized void addListener(IContentSettingsListener listener) {
-		super.addListener(listener);
-	}
-
-	public synchronized void notifyListeners(org.eclipse.core.resources.IResource changedResource) {
-		super.notifyListeners(changedResource);
-	}
-
-	public synchronized void removeListener(IContentSettingsListener listener) {
-		super.removeListener(listener);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsCreator.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsCreator.java
deleted file mode 100644
index d4947a7..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsCreator.java
+++ /dev/null
@@ -1,23 +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.sse.internal.contentproperties;
-
-
-
-public class ContentSettingsCreator {
-
-	public final static IContentSettings create() {
-		return ContentSettings.getInstance();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsFileHandler.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsFileHandler.java
deleted file mode 100644
index 042b07e..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsFileHandler.java
+++ /dev/null
@@ -1,144 +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.sse.internal.contentproperties;
-
-
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-
-class ContentSettingsFileHandler extends AbstractContentSettingsHandler {
-
-
-
-	private Map properties;
-
-
-	private void getProperties(IResource file) {
-		properties = getContentSettings().getProperties(file);
-	}
-
-	/*
-	 * @see AbstractContentSettingsHandler#handleAdded()
-	 */
-	protected void handleAdded() {
-		super.handleAdded();
-
-		if (super.getDelta().getFlags() == 0) {
-			// pulldown memu->copy->create file without override, new file,
-			// import without override
-			// copy,new,import has same kind(=1) and flag(=0).
-
-		} else if ((getDelta().getFlags() & IResourceDelta.MOVED_FROM) != 0) {
-			// pulldown menu-> rename without override,pulldown menu->move
-			// without override
-			// instead of this method,handleRemoved() works for this delta
-
-		}
-
-	}
-
-
-	/*
-	 * @see AbstractContentSettingsHandler#handleChanged()
-	 */
-	protected void handleChanged() {
-		// edit
-		if (getDelta().getFlags() == IResourceDelta.CONTENT && (getDelta().getFlags() & IResourceDelta.REPLACED) == 0) {
-			super.handleChanged();
-
-		} else if (getDelta().getFlags() == IResourceDelta.CONTENT && (getDelta().getFlags() & IResourceDelta.REPLACED) != 0) {
-			// override as a result of copy or import
-			// in Web project, copy with override doesn't happen
-
-			// override as move or rename
-			// handleRemoved() works for this delta
-			super.handleChanged();
-
-		}
-
-
-	}
-
-	/*
-	 * @see AbstractContentSettingsHandler#handleRemoved()
-	 */
-	protected void handleRemoved() {
-		super.handleRemoved();
-		IFile deletedFile = null;
-
-		// if entry exists then remove it.
-		if (getDelta().getFlags() == 0) {
-			// pulldown menu->delete
-			deletedFile = (IFile) getDelta().getResource();
-
-			if (deletedFile == null)
-				return;
-			getContentSettings().deleteAllProperties(deletedFile);
-
-			getContentSettings().releaseCache();
-		}
-
-		else if ((getDelta().getFlags() & IResourceDelta.MOVED_TO) != 0) {
-
-			// pulldown menu-> rename, pulldown menu->move
-			deletedFile = (IFile) getDelta().getResource();
-			getProperties(deletedFile);
-
-			// get destination IResource
-			IPath targetPath = getDelta().getMovedToPath();
-			IWorkspaceRoot iwr = ResourcesPlugin.getWorkspace().getRoot();
-			IResource targetFile = iwr.getFile(targetPath);//iwr.findMember(targetPath);
-
-			// set property of destination file
-			getContentSettings().deleteAllProperties(targetFile);
-			setProperties(targetFile);
-			if (properties != null)
-				properties.clear();
-			properties = null;
-		}
-
-		if (deletedFile == null)
-			return;
-		getContentSettings().deleteAllProperties(deletedFile);
-
-		getContentSettings().releaseCache();
-
-	}
-
-	private void setProperties(IResource file) {
-		if (file.getFileExtension() == null)
-			return;
-		if (!(file.getFileExtension().equalsIgnoreCase("shtml")//$NON-NLS-1$
-					|| file.getFileExtension().equalsIgnoreCase("htm")//$NON-NLS-1$
-					|| file.getFileExtension().equalsIgnoreCase("html")//$NON-NLS-1$
-					|| file.getFileExtension().equalsIgnoreCase("jhtml")//$NON-NLS-1$
-					|| file.getFileExtension().equalsIgnoreCase("xhtml")//$NON-NLS-1$
-					|| file.getFileExtension().equalsIgnoreCase("jsp")//$NON-NLS-1$
-					|| file.getFileExtension().equalsIgnoreCase("css")//$NON-NLS-1$
-					|| file.getFileExtension().equalsIgnoreCase("jsf")//$NON-NLS-1$
-		|| file.getFileExtension().equalsIgnoreCase("jspf")))//$NON-NLS-1$
-			return;
-		if (properties == null || properties.isEmpty())
-			return;
-		getContentSettings().setProperties(file, properties);
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSelfHandler.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSelfHandler.java
deleted file mode 100644
index 73e42f5..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSelfHandler.java
+++ /dev/null
@@ -1,90 +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.sse.internal.contentproperties;
-
-
-
-import org.eclipse.core.resources.IResourceDelta;
-
-final class ContentSettingsSelfHandler extends AbstractContentSettingsHandler {
-
-	private static INotify notify;// = new ContentSettingsChangedSubject();
-
-
-	private final void getSubject() {
-		notify = ContentSettingsChangeSubject.getNotify();
-	}
-
-	/*
-	 * @see AbstractContentSettingsHandler#handleAdded()
-	 */
-	protected void handleAdded() {
-		getSubject();
-		if (super.getDelta().getFlags() == 0) {
-			// pulldown memu->copy->create file without override, new file,
-			// property page create .contentsettings
-			super.handleAdded();
-			notify.notifyListeners(getDelta().getResource());
-
-		} else if ((getDelta().getFlags() & IResourceDelta.MOVED_FROM) != 0) {
-			// pulldown menu-> rename without override,pulldown menu->move
-			// without override
-			super.handleAdded();
-			notify.notifyListeners(getDelta().getResource());
-
-		}
-
-	}
-
-
-	/*
-	 * @see AbstractContentSettingsHandler#handleChanged()
-	 */
-	protected void handleChanged() {
-		getSubject();
-		if ((getDelta().getFlags() & IResourceDelta.CONTENT) != 0 && (getDelta().getFlags() & IResourceDelta.REPLACED) == 0) {
-			// result of edit, property page operate setProperty(apply or ok
-			// button) in .contentsettings
-			super.handleChanged();
-
-			notify.notifyListeners(getDelta().getResource());
-
-		} else if ((getDelta().getFlags() & IResourceDelta.CONTENT) != 0 && (getDelta().getFlags() & IResourceDelta.REPLACED) != 0) {
-			super.handleChanged();
-			notify.notifyListeners(getDelta().getResource());
-
-		}
-
-
-	}
-
-	/*
-	 * @see AbstractContentSettingsHandler#handleRemoved()
-	 */
-	protected void handleRemoved() {
-		getSubject();
-		if (getDelta().getFlags() == 0) {
-			// pulldown menu->delete
-			super.handleRemoved();
-			notify.notifyListeners(getDelta().getResource());
-
-		} else if ((getDelta().getFlags() & IResourceDelta.MOVED_TO) != 0) {
-			// pulldown menu-> rename, pulldown menu->move
-			super.handleRemoved();
-			notify.notifyListeners(getDelta().getResource());
-
-		}
-
-	}
-
-}
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
deleted file mode 100644
index ac8a94f..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java
+++ /dev/null
@@ -1,170 +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.sse.internal.contentproperties;
-
-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.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.sse.core.internal.Logger;
-
-public class ContentSettingsSynchronizer implements IResourceChangeListener {
-	class ContentSettingsVisitor implements IResourceDeltaVisitor {
-		// redefinition in ContentSettings.java
-		private String contentSettingsName = ContentSettings.getContentSettingsName(); //$NON-NLS-1$
-		private IResourceChangeEvent fEvent;
-		private IContentSettingsHandler handler;
-
-		public ContentSettingsVisitor(IResourceChangeEvent event) {
-			this.fEvent = event;
-		}
-
-		/**
-		 * @see IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
-		 */
-		public boolean visit(IResourceDelta delta) {
-			if (delta == null)
-				return false;
-			IResource resource = delta.getResource();
-			if (resource == null)
-				return false;
-			// parent folder or project
-			if (delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() == 0)
-				return true;
-			final int resourceType = resource.getType();
-			switch (resourceType) {
-				case IResource.PROJECT :
-					return false;
-				case IResource.FILE :
-					// whether resource is .contentsettings file or not
-					IProject project = delta.getResource().getProject();
-					if (this.fEvent.getType() == IResourceChangeEvent.POST_CHANGE && resource.equals(project.getFile(this.contentSettingsName))) {
-						// new object for .contentsettings
-						handler = new ContentSettingsSelfHandler();
-					}
-					else if (this.fEvent.getType() == IResourceChangeEvent.PRE_BUILD && resource.getFileExtension() != null) {
-						// TODO change to content type!
-						if (resource.getFileExtension().equalsIgnoreCase("shtml") //$NON-NLS-1$
-									|| resource.getFileExtension().equalsIgnoreCase("htm") //$NON-NLS-1$
-									|| resource.getFileExtension().equalsIgnoreCase("html") //$NON-NLS-1$
-									|| resource.getFileExtension().equalsIgnoreCase("jhtml") //$NON-NLS-1$
-									|| resource.getFileExtension().equalsIgnoreCase("xhtml") //$NON-NLS-1$
-									|| resource.getFileExtension().equalsIgnoreCase("jsp") //$NON-NLS-1$
-									|| resource.getFileExtension().equalsIgnoreCase("css") //$NON-NLS-1$
-									|| resource.getFileExtension().equalsIgnoreCase("jsf") //$NON-NLS-1$
-									|| resource.getFileExtension().equalsIgnoreCase("jspf")) { //$NON-NLS-1$
-							// new object for IFile
-							handler = new ContentSettingsFileHandler();
-							handler.handle(delta);
-							handler = null;
-							return true;
-						}
-					}
-					else
-						return false; // true or false;motomoto true;
-					break;
-				case IResource.FOLDER :
-					return true;
-				default :
-					return true;
-			}
-//			final IResourceDelta fDelta = delta;
-//			final IContentSettingsHandler deltaHandler = this.handler;
-			// XXX FIXME
-			// I commented out following to move this to "model" 
-			// packages. Since wasnt't hooked up/working anyway, I think 
-			// ok for now, but need to re-work as Job, once we do implement 
-			// settings for resources again. 
-//			Display display = getDisplay();
-//			if (display != null && !display.isDisposed()) {
-//				display.asyncExec(new Runnable() {
-//					public void run() {
-//						if (deltaHandler != null) {
-//							deltaHandler.handle(fDelta);
-//						}
-//					}
-//				});
-//			}
-//			else if (deltaHandler != null) {
-//				deltaHandler.handle(fDelta);
-//			}
-			handler = null;
-			return true; // true or false;motomoto true;
-		}
-	}
-
-	private static ContentSettingsSynchronizer instance = null;
-
-	public synchronized static ContentSettingsSynchronizer getInstance() {
-		if (instance == null)
-			instance = new ContentSettingsSynchronizer();
-		return instance;
-	}
-
-	private ContentSettingsVisitor csVisitor;
-	private boolean fListening = false;
-	private IProject fProject;
-
-
-	private final IProject getProject() {
-		return fProject;
-	}
-
-	private final IWorkspace getWorkspace() {
-		if (getProject() == null)
-			return ResourcesPlugin.getWorkspace();
-		return getProject().getWorkspace();
-	}
-
-	public synchronized void install() {
-		if (!fListening) {
-			getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.PRE_BUILD | IResourceChangeEvent.POST_CHANGE);
-			fListening = true;
-		}
-	}
-
-	/**
-	 * @return
-	 */
-	public synchronized boolean isListening() {
-		return fListening;
-	}
-
-	/*
-	 * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent)
-	 */
-	public void resourceChanged(IResourceChangeEvent event) {
-		IResourceDelta delta = event.getDelta();
-		if (delta != null) {
-			try {
-				if (csVisitor == null)
-					csVisitor = new ContentSettingsVisitor(event);
-				delta.accept(csVisitor);
-			}
-			catch (CoreException e) {
-				Logger.logException(e);
-			}
-		}
-		csVisitor = null;
-	}
-
-	public synchronized void unInstall() {
-		getWorkspace().removeResourceChangeListener(this);
-		fListening = false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettings.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettings.java
deleted file mode 100644
index 69ea6e4..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettings.java
+++ /dev/null
@@ -1,79 +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.sse.internal.contentproperties;
-
-
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-
-public interface IContentSettings {
-	/**
-	 *  
-	 */
-	public final String CSS_PROFILE = "css-profile"; //$NON-NLS-1$
-	/**
-	 *  
-	 */
-	public final String DEVICE_PROFILE = "target-device"; //$NON-NLS-1$
-
-	/**
-	 *  
-	 */
-	public final String DOCUMENT_TYPE = "document-type"; //$NON-NLS-1$
-	/**
-	 *  
-	 */
-	public final String HTML_DOCUMENT_TYPE = "html-document-type"; //$NON-NLS-1$
-
-	/**
-	 *  
-	 */
-	public void deleteAllProperties(final IResource deletedFile);
-
-	/**
-	 *  
-	 */
-	public void deleteProperty(final IResource resource, final String propertyName);
-
-	/**
-	 *  
-	 */
-	public boolean existsProperties(IResource resource);
-
-	/**
-	 *  
-	 */
-	public Map getProperties(final IResource resource);
-
-	/**
-	 *  
-	 */
-	public String getProperty(final IResource resource, final String propertyName);
-
-	/**
-	 * release cache of DOM tree in .contentsettings
-	 */
-	public void releaseCache();
-
-	/**
-	 *  
-	 */
-	public void setProperties(final IResource resource, final Map properties);
-
-	/**
-	 *  
-	 */
-	public void setProperty(final IResource resource, final String propertyName, final String propertyValue);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsHandler.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsHandler.java
deleted file mode 100644
index 22ed3b2..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsHandler.java
+++ /dev/null
@@ -1,22 +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.sse.internal.contentproperties;
-
-
-
-import org.eclipse.core.resources.IResourceDelta;
-
-interface IContentSettingsHandler {
-
-	public void handle(final IResourceDelta delta);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsListener.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsListener.java
deleted file mode 100644
index 2e02260..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsListener.java
+++ /dev/null
@@ -1,20 +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.sse.internal.contentproperties;
-
-
-
-public interface IContentSettingsListener {
-
-	void contentSettingsChanged(org.eclipse.core.resources.IResource e);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/INotify.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/INotify.java
deleted file mode 100644
index e1c9af1..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/INotify.java
+++ /dev/null
@@ -1,20 +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.sse.internal.contentproperties;
-
-
-
-interface INotify {
-
-	void notifyListeners(org.eclipse.core.resources.IResource resource);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ISubject.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ISubject.java
deleted file mode 100644
index 813ba01..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ISubject.java
+++ /dev/null
@@ -1,23 +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.sse.internal.contentproperties;
-
-
-
-public interface ISubject {
-
-	void addListener(IContentSettingsListener listener);
-
-	void removeListener(IContentSettingsListener listener);
-
-}
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
deleted file mode 100644
index 3b22857..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java
+++ /dev/null
@@ -1,351 +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.sse.internal.contentproperties;
-
-
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.wst.sse.core.internal.Logger;
-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;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeIterator;
-import org.xml.sax.SAXException;
-
-class SimpleNodeOperator {
-
-	class CreateContentSettingsFailureException extends Exception {
-		/**
-		 * Comment for <code>serialVersionUID</code>
-		 */
-		private static final long serialVersionUID = 1L;
-
-		public CreateContentSettingsFailureException(String reason) {
-			super(reason);
-		}
-	}
-
-
-	class ReadContentSettingsFailureException extends Exception {
-		/**
-		 * Comment for <code>serialVersionUID</code>
-		 */
-		private static final long serialVersionUID = 1L;
-
-		public ReadContentSettingsFailureException(String reason) {
-			super(reason);
-		}
-	}
-
-	static class WriteContentSettingsFailureException extends Exception {
-		/**
-		 * Comment for <code>serialVersionUID</code>
-		 */
-		private static final long serialVersionUID = 1L;
-
-		public WriteContentSettingsFailureException(String reason) {
-			super(reason);
-		}
-	}
-
-	// writer class for .contentSettings.
-	class XMLDocumentWriter {
-		OutputStream fOut;
-
-		protected XMLDocumentWriter(OutputStream out) {
-			this.fOut = out;
-		}
-
-		protected final void close() {
-			try {
-				fOut.close();
-			} catch (IOException e) {
-				// do nothing, shouldn't matter
-			}
-		}
-
-		protected void serialize(Document sourceDocument) throws WriteContentSettingsFailureException {
-			// JAXP transformation
-			Source domSource = new DOMSource(sourceDocument);
-			try {
-				Transformer serializer = TransformerFactory.newInstance().newTransformer();
-				try {
-					serializer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
-					serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); //$NON-NLS-1$ //$NON-NLS-2$
-				} catch (IllegalArgumentException e) {
-					// unsupported properties
-				}
-				serializer.transform(domSource, new StreamResult(fOut));
-			} catch (TransformerConfigurationException e) {
-				throw new WriteContentSettingsFailureException(e.getMessage());
-			} catch (TransformerFactoryConfigurationError e) {
-				throw new WriteContentSettingsFailureException(e.getMessage());
-			} catch (TransformerException e) {
-				throw new WriteContentSettingsFailureException(e.getMessage());
-			}
-		}
-	}
-
-	public static void main(String[] args) {
-		SimpleNodeOperator a = null;
-		try {
-			a = new SimpleNodeOperator("workspace/org.eclipse.examples.contentsettings/.contentsettings.xml");//$NON-NLS-1$
-		} catch (Exception e) {
-			System.exit(0);
-		}
-
-		// print all Elements
-		//a.printTree(iter);
-
-		// add Element
-		Map attMap = new Hashtable();
-		attMap.put("path", "hogepath");//$NON-NLS-1$ //$NON-NLS-2$
-		attMap.put("fDocument-type", "documenthogehoge");//$NON-NLS-1$ //$NON-NLS-2$
-		a.addElementUnderRoot("file", attMap);//$NON-NLS-1$
-
-		try {
-			a.writeDocument(System.out);
-		} catch (Exception e) {
-			System.err.println(e.toString());
-		}
-
-	}
-
-	//never used
-	//private DOMParser parser;
-	private Document fDocument;
-	private Node root;
-
-	private String settingsFileName;
-
-
-	public SimpleNodeOperator(Document doc) throws CreateContentSettingsFailureException {
-
-		if (doc == null)
-			throw new CreateContentSettingsFailureException("Document doc==null");//$NON-NLS-1$
-		fDocument = doc;
-		root = fDocument.getLastChild();
-		if (root == null)
-			throw new CreateContentSettingsFailureException("Node root==null");//$NON-NLS-1$
-	}
-
-	public SimpleNodeOperator(String fullPath) throws ReadContentSettingsFailureException {
-		this.settingsFileName = fullPath;
-		createObjectOfDocument();
-	}
-
-	// add attribute(attName=attValue) of ele without checking overlapping of
-	// another attributes of ele.
-	// if overlapping ,override
-	protected Node addAttributeAt(Element ele, String attName, String attValue) {
-		Attr att = fDocument.createAttribute(attName);
-		att.setValue(attValue);
-		if (ele != null)
-			ele.setAttributeNode(att);
-		return ele;
-	}
-
-	protected Node addElementUnder(Node parent, String tagName, Map attMap) {
-		if (parent == null || tagName == null)
-			return null;
-		Element e = fDocument.createElement(tagName);
-		if (attMap != null) {
-			if (!attMap.isEmpty()) {
-				Set attKeys = attMap.keySet();
-				Iterator iter = attKeys.iterator();
-				while (iter.hasNext()) {
-					String key = (String) iter.next();
-					e.setAttribute(key, (String) attMap.get(key));
-				}
-			}
-		}
-		parent.appendChild(e);
-		return e;
-	}
-
-	protected final Node addElementUnderRoot(String tagName) {
-		return addElementUnder(root, tagName, null);
-	}
-
-	// add element with attMap as attribute without checking overlapping.
-	protected final Node addElementUnderRoot(String tagName, Map attMap) {
-		return addElementUnder(root, tagName, attMap);
-	}
-
-	private void createObjectOfDocument() throws ReadContentSettingsFailureException {
-		try {
-			fDocument = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File(settingsFileName));
-		} catch (SAXException e) {
-			Logger.logException("exception parsing" + settingsFileName, e); //$NON-NLS-1$
-		} catch (IOException e) {
-			Logger.logException("I/O exception parsing" + settingsFileName, e); //$NON-NLS-1$
-		} catch (ParserConfigurationException e) {
-			Logger.logException("exception accessing DOMImplementation", e); //$NON-NLS-1$
-		} catch (FactoryConfigurationError e) {
-			Logger.logException("exception accessing DOMImplementation", e); //$NON-NLS-1$
-		}
-		//get the root of the XML fDocument
-		root = fDocument.getLastChild();
-		if (root == null) {
-			throw new ReadContentSettingsFailureException("Error: Node root==null");//$NON-NLS-1$
-		}
-	}
-
-	protected Map getAttributesOf(Node node) {
-		if (!node.hasAttributes())
-			return null;
-		Map map = new HashMap();
-		NamedNodeMap attrs = node.getAttributes();
-		int size = attrs.getLength();
-		for (int i = 0; i < size; i++) {
-			Attr attr = (Attr) attrs.item(i);
-			map.put(attr.getName(), attr.getValue());
-		}
-		return (map);
-	}
-
-	private Node getElementWithAttribute(Node first, String attName, String attValue) {
-		Node navpoint = first;
-		while (navpoint != null) {
-			if (navpoint.getNodeType() == Node.ELEMENT_NODE) {
-				NamedNodeMap m = navpoint.getAttributes();
-				if (m == null)
-					continue;
-				if (m.getNamedItem(attName) != null) {
-					if (attValue.equals(((Attr) m.getNamedItem(attName)).getNodeValue()))
-						return navpoint;
-				}
-				NodeList childNodes = navpoint.getChildNodes();
-				if (childNodes != null && childNodes.getLength() > 0) {
-					Node holdNode = getElementWithAttribute(navpoint.getFirstChild(), attName, attValue);
-					if (holdNode != null) {
-						return holdNode;
-					}
-				}
-			}
-			navpoint = navpoint.getNextSibling();
-		}
-		return null;
-	}
-
-
-	// return a (first) Element with attr(attName=attValue) it if exists,
-	// otherwise return null
-	protected Node getElementWithAttribute(String attName, String attValue) {
-		if (attName == null || attValue == null || !fDocument.hasChildNodes())
-			return null;
-		return getElementWithAttribute(fDocument.getFirstChild(), attName, attValue);
-	}
-
-	// retrun Element which has nodeName as Node Name
-	protected Node getElementWithNodeName(String nodeName) {
-		if (nodeName == null)
-			return null;
-		NodeList nodes = fDocument.getElementsByTagName(nodeName);
-		if (nodes.getLength() > 0) {
-			return nodes.item(0);
-		}
-		return null;
-	}
-
-	public void printTree(NodeIterator iter) {
-		Node n;
-		while ((n = iter.nextNode()) != null) {
-			System.out.println(n.getNodeName() + ":");//$NON-NLS-1$
-			NamedNodeMap m = n.getAttributes();
-			if (m == null)
-				continue;
-			for (int i = 0; i < m.getLength(); i++) {
-				String attName = m.item(i).getNodeName();
-				System.out.print(" " + attName + "=" + m.item(i).getNodeValue());//$NON-NLS-1$ //$NON-NLS-2$
-			}
-			System.out.println("");//$NON-NLS-1$
-		}
-	}
-
-
-	// remove attribute(attName) at ele.
-	protected Attr removeAttributeAt(Element ele, String attName) {
-		if (ele == null || attName == null)
-			return null;
-		Attr att = ele.getAttributeNode(attName);
-		ele.removeAttribute(attName);
-		return att;
-	}
-
-	protected Element removeElementWith(String nodeName) {
-		NodeList nodes = fDocument.getElementsByTagName(nodeName);
-		for (int i = 0; i < nodes.getLength(); i++) {
-			nodes.item(i).getParentNode().removeChild(nodes.item(i));
-		}
-		return null;
-	}
-
-	// remove a (first) Element with attr(attName=attValue) and return it if
-	// exists, otherwise return null
-	protected Element removeElementWith(String attName, String attValue) {
-		if (fDocument.hasChildNodes()) {
-			Node element = getElementWithAttribute(attName, attValue);
-			if (element != null && element.getNodeType() == Node.ELEMENT_NODE) {
-				element.getParentNode().removeChild(element);
-				return (Element) element;
-			}
-		}
-		return null;
-
-	}
-
-	// update attribute(attName=newValue) at ele if both ele and attribute of
-	// ele exist
-	protected void updateAttributeAt(Element ele, String attName, String newValue) {
-		Attr att = null;
-		if (ele != null)
-			if ((att = ele.getAttributeNode(attName)) != null)
-				att.setValue(newValue);
-	}
-
-	protected void writeDocument(OutputStream out) throws WriteContentSettingsFailureException {
-		XMLDocumentWriter writer = new XMLDocumentWriter(out);
-		try {
-			writer.serialize(fDocument);
-		} finally {
-			writer.close();
-		}
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedIO.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedIO.java
deleted file mode 100644
index a2d9998..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedIO.java
+++ /dev/null
@@ -1,258 +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.sse.core.internal.encoding;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.wst.sse.core.internal.encoding.util.Assert;
-import org.eclipse.wst.sse.core.internal.encoding.util.Logger;
-import org.osgi.framework.Bundle;
-
-
-public abstract class CodedIO {
-
-	private final boolean DEBUG = false;
-	
-	public static final int MAX_BUF_SIZE = 1024 * 8;
-
-	public static final int MAX_MARK_SIZE = MAX_BUF_SIZE;
-
-	public static final String NO_SPEC_DEFAULT = "NoSpecDefault"; //$NON-NLS-1$
-
-	private static Properties overridenCharsets = null;
-
-	/**
-	 * <p>
-	 * There are two well known understood cases where the standard/default
-	 * Java Mappings are not sufficient. (Thanks to Hirotaka Matsumoto for
-	 * providing these two). I believe there are others that individual
-	 * customers have requested to override on a case by case basis, but I've
-	 * lost the details. TODO-future: document some of those use-cases.
-	 * </p>
-	 * <ul>
-	 * <li>ISO-8859-8-I</li>
-	 * <p>
-	 * In the code conversion point of view, ISO-9959-8 and ISO-8859-8-I are
-	 * the same. However. the representation on the browser is different. (
-	 * It's very very hard to explain this into the words, but once you will
-	 * see, you will understand it :) Many BiDi HTML/JSPs use ISO-8859-8-I in
-	 * META/page directive. So WSAD needs to support this encoding.
-	 * </p>
-	 * <li>X-SJIS</li>
-	 * <p>
-	 * Because Mosaic/Navigator 2.0 supported only X-SJIS/X-EUC-JP, lots of
-	 * old HTML files used X-SJIS/X-EUC-JP so that the customers still want us
-	 * to support this code conversion for HTML files.
-	 * </p>
-	 * </ul>
-	 * 
-	 * @param detectedCharsetName
-	 * @return the detectedCharsetName, if no overrides, otherwise the charset
-	 *         name that should be used instead of detectedCharsetName
-	 */
-	/**
-	 * This method is deliberatly 'default access' since clients should not
-	 * need to access this information directly.
-	 */
-	static public String checkMappingOverrides(String detectedCharsetName) {
-		// This method MUST return what was passed in, if
-		// there are no
-		// overrides.
-		String result = detectedCharsetName;
-		String newResult = getOverridenCharsets().getProperty(detectedCharsetName);
-		if (newResult != null) {
-			result = newResult;
-		}
-		return result;
-	}
-
-	/**
-	 * Note: once this instance is created, trace info still needs to be
-	 * appended by caller, depending on the context its created.
-	 */
-	public static EncodingMemento createEncodingMemento(byte[] detectedBom, String javaCharsetName, String detectedCharsetName, String unSupportedName, String specDefaultEncoding, String reason) {
-		EncodingMemento result = new EncodingMemento();
-		result.setJavaCharsetName(javaCharsetName);
-		result.setDetectedCharsetName(detectedCharsetName);
-		// TODO: if detectedCharset and spec default is
-		// null, need to use "work
-		// bench based" defaults.
-		if (specDefaultEncoding == null)
-			result.setAppropriateDefault(NO_SPEC_DEFAULT);
-		else
-			result.setAppropriateDefault(specDefaultEncoding);
-		if (unSupportedName != null) {
-			result.setInvalidEncoding(unSupportedName);
-		}
-		// check if valid
-		try {
-			Charset.isSupported(javaCharsetName);
-		} catch (IllegalCharsetNameException e) {
-			result.setInvalidEncoding(javaCharsetName);
-		}
-
-		// check UTF83ByteBOMUsed and UnicodeStream
-		if (detectedBom != null) {
-			if (detectedBom.length == 2)
-				result.setUnicodeStream(true);
-			else if (detectedBom.length == 3)
-				result.setUTF83ByteBOMUsed(true);
-		}
-		return result;
-	}
-
-	/**
-	 * Note: once this instance is created, trace info still needs to be
-	 * appended by caller, depending on the context its created.
-	 */
-	public static EncodingMemento createEncodingMemento(String detectedCharsetName) {
-		return createEncodingMemento(detectedCharsetName, null);
-	}
-
-	/**
-	 * Note: once this instance is created, trace info still needs to be
-	 * appended by caller, depending on the context its created.
-	 */
-	public static EncodingMemento createEncodingMemento(String detectedCharsetName, String reason) {
-		return createEncodingMemento(detectedCharsetName, reason, null);
-	}
-
-	/**
-	 * Note: once this instance is created, trace info still needs to be
-	 * appended by caller, depending on the context its created.
-	 */
-	public static EncodingMemento createEncodingMemento(String detectedCharsetName, String reason, String specDefaultEncoding) {
-		EncodingMemento result = new EncodingMemento();
-		result = new EncodingMemento();
-		String javaCharset = getAppropriateJavaCharset(detectedCharsetName);
-		result.setJavaCharsetName(javaCharset);
-		result.setDetectedCharsetName(detectedCharsetName);
-		// TODO: if detectedCharset and spec default is
-		// null, need to use "work
-		// bench based" defaults.
-		if (specDefaultEncoding == null)
-			result.setAppropriateDefault(NO_SPEC_DEFAULT);
-		else
-			result.setAppropriateDefault(specDefaultEncoding);
-		// check if valid
-		try {
-			Charset.isSupported(javaCharset);
-		} catch (IllegalCharsetNameException e) {
-			result.setInvalidEncoding(javaCharset);
-		}
-
-		return result;
-	}
-
-	/**
-	 * 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
-	 */
-	public static String getAppropriateJavaCharset(String detectedCharsetName) {
-		// we don't allow null argument (or risk NPE or
-		// IllegalArgumentException later at several
-		// points.
-		Assert.isNotNull(detectedCharsetName, "illegal charset argument. it can not be null"); //$NON-NLS-1$
-		String result = detectedCharsetName;
-		// 1. Check explicit mapping overrides from
-		// property file
-		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;
-		// Note: this will immediatly throw
-		// "UnsuppotedCharsetException" if it
-		// invalid. Issue: Is it more client friendly to
-		// eat that exception and return null?
-		javaCharset = Charset.forName(result);
-		if (javaCharset != null) {
-			result = javaCharset.name();
-		}
-		return result;
-	}
-
-	/**
-	 * @return Returns the overridenCharsets.
-	 */
-	private static Properties getOverridenCharsets() {
-		if (overridenCharsets == null) {
-			overridenCharsets = new Properties();
-			Bundle keyBundle = Platform.getBundle(ICodedResourcePlugin.ID);
-			IPath keyPath = new Path("config/override.properties"); //$NON-NLS-1$
-			URL location = Platform.find(keyBundle, keyPath);
-			InputStream propertiesInputStream = null;
-			try {
-				propertiesInputStream = location.openStream();
-				overridenCharsets.load(propertiesInputStream);
-			} catch (IOException e) {
-				// if can't read, just assume there's no
-				// overrides
-				// and repeated attempts will not occur,
-				// since they
-				// will be represented by an empty
-				// Properties object
-			}
-		}
-		return overridenCharsets;
-	}
-
-	/**
-	 * This class need not be instantiated (though its subclasses can be).
-	 */
-	protected CodedIO() {
-		super();
-	}
-
-	protected EncodingMemento createMemento(IContentDescription contentDescription) {
-		EncodingMemento result;
-		String appropriateDefault = contentDescription.getContentType().getDefaultCharset();
-		String detectedCharset = (String) contentDescription.getProperty(IContentDescriptionExtended.DETECTED_CHARSET);
-		String unSupportedCharset = (String) contentDescription.getProperty(IContentDescriptionExtended.UNSUPPORTED_CHARSET);
-		String javaCharset = contentDescription.getCharset();
-		// integrity checks for debugging
-		if (javaCharset == null) {
-			Logger.log(Logger.INFO_DEBUG, "charset equaled null!"); //$NON-NLS-1$
-		} else if (javaCharset.length() == 0) {
-			Logger.log(Logger.INFO_DEBUG, "charset equaled emptyString!"); //$NON-NLS-1$
-		}
-		byte[] BOM = (byte[]) contentDescription.getProperty(IContentDescription.BYTE_ORDER_MARK);
-		//result = (EncodingMemento)
-		// contentDescription.getProperty(IContentDescriptionExtended.ENCODING_MEMENTO);
-		result = createEncodingMemento(BOM, javaCharset, detectedCharset, unSupportedCharset, appropriateDefault, null);
-		if (!result.isValid()) {
-			result.setAppropriateDefault(appropriateDefault);
-			// integrity check for debugging "invalid" cases.
-			// the apprriate default we have, should equal what's in the
-			// detected field. (not sure this is always required)
-			if (DEBUG && appropriateDefault != null && !appropriateDefault.equals(detectedCharset)) {
-				Logger.log(Logger.INFO_DEBUG, "appropriate did not equal detected, as expected for invalid charset case"); //$NON-NLS-1$
-			}
-		}
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedReaderCreator.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedReaderCreator.java
deleted file mode 100644
index 1bb216d..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedReaderCreator.java
+++ /dev/null
@@ -1,533 +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.sse.core.internal.encoding;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CodingErrorAction;
-
-import org.eclipse.core.resources.IFile;
-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.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.sse.core.internal.SSECoreMessages;
-import org.eclipse.wst.sse.core.internal.encoding.util.Assert;
-import org.eclipse.wst.sse.core.internal.encoding.util.BufferedLimitedStream;
-import org.eclipse.wst.sse.core.internal.encoding.util.Logger;
-import org.eclipse.wst.sse.core.internal.encoding.util.NullInputStream;
-import org.eclipse.wst.sse.core.internal.encoding.util.UnicodeBOMEncodingDetector;
-import org.eclipse.wst.sse.core.internal.exceptions.UnsupportedCharsetExceptionWithDetail;
-
-
-/**
- * The purpose of this class is to centralize analysis of a file to determine
- * the most appropriate rules of decoding it. The intended use is to set the
- * input, then get the reader for that input which will have its encoding set
- * appropriately. Additionally, there is an EncodingMemento provided, which
- * will be required, in some cases, to later determine the most appropriate
- * form of encoded output.
- */
-public class CodedReaderCreator extends CodedIO {
-
-
-	private boolean fClientSuppliedStream;
-
-
-	private EncodingMemento fEncodingMemento;
-
-	private EncodingRule fEncodingRule;
-
-	private String fFilename;
-
-	private IFile fIFile;
-
-
-	private InputStream fInputStream;
-
-	public CodedReaderCreator() {
-
-		super();
-	}
-
-	public CodedReaderCreator(IFile file) throws CoreException, IOException {
-
-		this();
-		set(file);
-		setEncodingRule(EncodingRule.CONTENT_BASED);
-	}
-
-	public CodedReaderCreator(IFile file, EncodingRule encodingRule) throws CoreException, IOException {
-
-		this();
-		set(file);
-		setEncodingRule(encodingRule);
-	}
-
-	public CodedReaderCreator(String filename, InputStream inputStream) {
-
-		this();
-		set(filename, inputStream);
-		setEncodingRule(EncodingRule.CONTENT_BASED);
-	}
-
-	public CodedReaderCreator(String filename, InputStream inputStream, EncodingRule encodingRule) {
-
-		this();
-		set(filename, inputStream);
-		setEncodingRule(encodingRule);
-	}
-
-	private EncodingMemento checkForEncodingInContents(InputStream limitedStream) throws CoreException, IOException {
-		EncodingMemento result = null;
-
-		// if encoding memento already set, then iFile must
-		// have been set, and no need to get again.
-		if (fEncodingMemento != null) {
-			result = fEncodingMemento;
-		}
-		else {
-			if (fClientSuppliedStream) {
-				try {
-					limitedStream.reset();
-					IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
-					IContentDescription contentDescription = contentTypeManager.getDescriptionFor(limitedStream, fFilename, IContentDescription.ALL);
-					if (contentDescription != null) {
-						fEncodingMemento = createMemento(contentDescription);
-					}
-					result = fEncodingMemento;
-				}
-				finally {
-					limitedStream.reset();
-				}
-			}
-			else {
-				// throw new IllegalStateException("unexpected state:
-				// encodingMemento was null but no input stream supplied by
-				// client"); //$NON-NLS-1$
-				result = null;
-			}
-		}
-
-		if (result != null && !result.isValid() && !forceDefault()) {
-			throw new UnsupportedCharsetExceptionWithDetail(result);
-		}
-
-		return result;
-	}
-
-	/**
-	 * @param resettableLimitedStream
-	 */
-	private EncodingMemento checkStreamForBOM(InputStream resettableLimitedStream) {
-		EncodingMemento result = null;
-		UnicodeBOMEncodingDetector unicodeBOMEncodingDetector = new UnicodeBOMEncodingDetector();
-		unicodeBOMEncodingDetector.set(resettableLimitedStream);
-		result = unicodeBOMEncodingDetector.getEncodingMemento();
-		return result;
-	}
-
-	/**
-	 * @param iFile
-	 * @throws CoreException
-	 * @throws IOException
-	 */
-	private EncodingMemento findMementoFromFileCase() throws CoreException, IOException {
-		EncodingMemento result = null;
-		IContentDescription contentDescription = null;
-		try {
-			// This method provides possible improved performance at the
-			// cost of sometimes returning null
-			if (fIFile.exists())
-				contentDescription = fIFile.getContentDescription();
-		}
-		catch (CoreException e) {
-			// Assume if core exception occurs, we can still try more
-			// expensive
-			// discovery options.
-			Logger.logException(e);
-		}
-		if (contentDescription == null && fIFile.isAccessible()) {
-			InputStream contents = null;
-			try {
-				contents = fIFile.getContents();
-				contentDescription = Platform.getContentTypeManager().getDescriptionFor(contents, fIFile.getName(), IContentDescription.ALL);
-			}
-			catch (CoreException e1) {
-				// Assume if core exception occurs, we can't really do much
-				// with
-				// determining encoding, etc.
-				Logger.logException(e1);
-				throw e1;
-			}
-			catch (IOException e2) {
-				// We likely couldn't get the contents of the file, something
-				// is really wrong
-				Logger.logException(e2);
-				throw e2;
-			}
-			if (contents != null) {
-				try {
-					contents.close();
-				}
-				catch (IOException e2) {
-					Logger.logException(e2);
-				}
-			}
-		}
-		if (contentDescription != null) {
-			result = createMemento(contentDescription);
-		}
-
-		return result;
-	}
-
-	/**
-	 * The primary method which contains the highest level rules for how to
-	 * decide appropriate decoding rules: 1. first check for unicode stream 2.
-	 * then looked for encoding specified in content (according to the type of
-	 * content that is it ... xml, html, jsp, etc. 3. then check for various
-	 * settings: file settings first, if null check project settings, if null,
-	 * check user preferences. 4. lastly (or, what is the last user
-	 * preference) is to use "workbench defaults".
-	 * 
-	 * @throws IOException
-	 * @throws CoreException
-	 */
-	private EncodingMemento findMementoFromStreamCase() throws CoreException, IOException {
-
-		EncodingMemento result = null;
-		InputStream resettableLimitedStream = null;
-		try {
-			resettableLimitedStream = getLimitedStream(getResettableStream());
-			if (resettableLimitedStream != null) {
-				// first check for unicode stream
-				result = checkStreamForBOM(resettableLimitedStream);
-				// if not that, then check contents
-				if (result == null) {
-					resettableLimitedStream.reset();
-					result = checkForEncodingInContents(resettableLimitedStream);
-				}
-
-			}
-			else {
-				// stream null, may name's not.
-				if (fFilename != null) {
-					// filename not null
-					IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
-					IContentDescription contentDescription = contentTypeManager.getDescriptionFor(new NullInputStream(), fFilename, IContentDescription.ALL);
-					if (contentDescription != null) {
-						result = createMemento(contentDescription);
-					}
-				}
-			}
-		}
-		finally {
-			if (resettableLimitedStream != null) {
-				handleStreamClose(resettableLimitedStream);
-			}
-		}
-		return result;
-	}
-
-	private boolean forceDefault() {
-
-		boolean result = false;
-		if (fEncodingRule != null && fEncodingRule == EncodingRule.FORCE_DEFAULT)
-			result = true;
-		return result;
-	}
-
-	public Reader getCodedReader() throws CoreException, IOException {
-
-		Reader result = null;
-		// we make a local copy of encoding memento so
-		// stream won't
-		// be accessed simultaneously.
-		EncodingMemento encodingMemento = getEncodingMemento();
-		Assert.isNotNull(encodingMemento, "Appears reader requested before file or stream set"); //$NON-NLS-1$
-		InputStream streamToReturn = getResettableStream();
-		streamToReturn.reset();
-		// if UTF 3 byte BOM is used (or UTF-16LE), the
-		// built in converters
-		// don't
-		// correct skip all three bytes ... so skip
-		// remaining one to leave
-		// stream transparently ready for client.
-		// see ... TODO look up bug number
-		if (encodingMemento.isUnicodeStream()) {
-			streamToReturn.skip(2);
-		}
-		else if (encodingMemento.isUTF83ByteBOMUsed()) {
-			streamToReturn.skip(3);
-		}
-		String charsetName = encodingMemento.getJavaCharsetName();
-		if (charsetName == null) {
-			charsetName = encodingMemento.getDetectedCharsetName();
-		}
-		if (!encodingMemento.isValid() && !forceDefault()) {
-			throw new UnsupportedCharsetExceptionWithDetail(encodingMemento);
-		}
-
-		if (fEncodingRule == EncodingRule.FORCE_DEFAULT) {
-			charsetName = encodingMemento.getAppropriateDefault();
-		}
-		Charset charset = Charset.forName(charsetName);
-		CharsetDecoder charsetDecoder = charset.newDecoder();
-		if (fEncodingRule == EncodingRule.IGNORE_CONVERSION_ERROR) {
-			charsetDecoder.onMalformedInput(CodingErrorAction.REPLACE);
-			charsetDecoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
-		}
-		else {
-			charsetDecoder.onMalformedInput(CodingErrorAction.REPORT);
-			charsetDecoder.onUnmappableCharacter(CodingErrorAction.REPORT);
-		}
-		// more efficient to be buffered, and I know of no
-		// reason not to return
-		// that directly.
-		result = new BufferedReader(new InputStreamReader(streamToReturn, charsetDecoder), CodedIO.MAX_BUF_SIZE);
-		result.mark(CodedIO.MAX_BUF_SIZE);
-		return result;
-	}
-
-	public EncodingMemento getEncodingMemento() throws CoreException, IOException {
-		// figure out encoding memento from encoding strategy
-		if (fEncodingMemento == null) {
-			if (fClientSuppliedStream) {
-				fEncodingMemento = findMementoFromStreamCase();
-			}
-			else if (fIFile != null) {
-				fEncodingMemento = findMementoFromFileCase();
-			}
-		}
-
-		// if encoding stratagy doesn't provide answer,
-		// then try file settings, project settings,
-		// user preferences, and
-		// finally workbench default.
-		//
-		if (fEncodingMemento == null || fEncodingMemento.getDetectedCharsetName() == null) {
-			fEncodingMemento = getEncodingMementoFromResourceAndPreference();
-		}
-
-		// use DefaultNameRules from NonContentBasedEncodingRules as the final
-		// default
-		if (fEncodingMemento == null) {
-			fEncodingMemento = handleNotProvidedFromContentCase();
-		}
-
-		return fEncodingMemento;
-	}
-
-	/*
-	 * This method is called only when encoding is not detected in the file.
-	 * 
-	 * Here is encoding lookup order we will try: - try resource content
-	 * description (Eclipse Text file encoding) - try resource content
-	 * properties (for JSP only) - try content type encoding preferences (for
-	 * HTML only) - try resource content description (Eclipse Text file
-	 * encoding, implicit check)
-	 * 
-	 * Note: This method appears in both CodedReaderCreator and
-	 * CodedStreamCreator (with just a minor difference). They should be kept
-	 * the same.
-	 */
-	private EncodingMemento getEncodingMementoFromResourceAndPreference() throws IOException, CoreException {
-		EncodingMemento encodingMemento = fEncodingMemento;
-
-		// Follow Eclipse Platform's direction. Get the charset from IFile.
-		if (fIFile != null) {
-			String charset = fIFile.getCharset();
-			encodingMemento = CodedIO.createEncodingMemento(charset);
-		}
-
-		return encodingMemento;
-	}
-
-	/**
-	 * Ensures that an InputStream has mark/reset support, is readlimit is
-	 * set, and that the stream is "limitable" (that is, reports "end of
-	 * input" rather than allow going past mark). This is very specialized
-	 * stream introduced to overcome
-	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=67211. See also
-	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68565
-	 */
-	private InputStream getLimitedStream(InputStream original) {
-		if (original == null)
-			return null;
-		if (original instanceof BufferedLimitedStream)
-			return original;
-		InputStream s = new BufferedLimitedStream(original, CodedIO.MAX_MARK_SIZE);
-		s.mark(CodedIO.MAX_MARK_SIZE);
-		return s;
-	}
-
-	private InputStream getResettableStream() throws CoreException, IOException {
-
-		InputStream resettableStream = null;
-
-		if (fIFile != null) {
-			InputStream inputStream = null;
-			try {
-				// note we always get contents, even if out of synch
-				inputStream = fIFile.getContents(true);
-			}
-			catch (CoreException e) {
-				// SHOULD actually check for existence of
-				// fIStorage, but
-				// for now will just assume core exception
-				// means it
-				// doesn't exist on file system, yet.
-				// and we'll log, just in case its a noteable error
-				Logger.logException(e);
-				inputStream = new NullInputStream();
-			}
-			resettableStream = new BufferedInputStream(inputStream, CodedIO.MAX_BUF_SIZE);
-		}
-		else {
-			if (fInputStream != null) {
-				if (fInputStream.markSupported()) {
-					resettableStream = fInputStream;
-					// try {
-					resettableStream.reset();
-					// }
-					// catch (IOException e) {
-					// // assumed just hasn't been marked yet, so ignore
-					// }
-				}
-				else {
-					resettableStream = new BufferedInputStream(fInputStream, CodedIO.MAX_BUF_SIZE);
-				}
-			}
-		}
-
-		if (resettableStream == null) {
-			resettableStream = new NullInputStream();
-		}
-
-		// mark this once, stream at "zero" position
-		resettableStream.mark(MAX_MARK_SIZE);
-		return resettableStream;
-	}
-
-	private EncodingMemento handleNotProvidedFromContentCase() {
-
-		EncodingMemento result = null;
-		String specDefault = null;
-		// try {
-		// specDefault = getEncodingDetector().getSpecDefaultEncoding();
-		// }
-		// catch (CoreException e) {
-		// // If this exception occurs, assumes there is
-		// // no specDefault
-		// }
-		// catch (IOException e) {
-		// // If this exception occurs, assumes there is
-		// // no specDefault
-		// }
-		// finally {
-		// try {
-		// handleStreamClose(fEncodingDetectorStream);
-		// }
-		// catch (IOException e1) {
-		// // severe error, not much to do here
-		// }
-		// }
-		// this logic should be moved to 'detection' if not already
-		String charset = NonContentBasedEncodingRules.useDefaultNameRules(specDefault);
-		Assert.isNotNull(charset, "post condition failed"); //$NON-NLS-1$
-		result = CodedIO.createEncodingMemento(charset);
-		return result;
-	}
-
-	/**
-	 * @param resettableInputStream
-	 * @throws IOException
-	 */
-	private void handleStreamClose(InputStream resettableInputStream) throws IOException {
-
-		if (resettableInputStream != null) {
-			if (fClientSuppliedStream) {
-				resettableInputStream.reset();
-			}
-			else {
-
-				resettableInputStream.close();
-			}
-		}
-	}
-
-	// TODO We just copy the content properties encoding to current resource's
-	// encoding for now. May improve the UI later by setting an informational
-	// message and/or disable the content properties encoding field.
-	// TODO: remake private else remove
-	void migrateContentPropertiesEncoding(String encoding) throws CoreException {
-		final IFile file = fIFile;
-		final String charset = encoding;
-		// TODO: externalize string later
-		Job migrater = new Job(SSECoreMessages.Migrate_Charset) { //$NON-NLS-1$
-			protected IStatus run(IProgressMonitor monitor) {
-				if (file != null) {
-					try {
-						file.setCharset(charset, null);
-					}
-					catch (CoreException e) {
-						Logger.logException(e);
-					}
-				}
-				return Status.OK_STATUS;
-			}
-		};
-		migrater.setSystem(true);
-		migrater.schedule();
-	}
-
-	private void resetAll() {
-
-		fEncodingRule = null;
-		fIFile = null;
-		fFilename = null;
-		fInputStream = null;
-		fEncodingMemento = null;
-		fClientSuppliedStream = false;
-	}
-
-	public void set(IFile iFile) throws CoreException, IOException {
-		Assert.isNotNull(iFile, "illegal argument"); //$NON-NLS-1$
-		resetAll();
-		fIFile = iFile;
-	}
-
-	public void set(String filename, InputStream inputStream) {
-
-		resetAll();
-		fFilename = filename;
-		fInputStream = inputStream;
-		fClientSuppliedStream = true;
-	}
-
-	public void setEncodingRule(EncodingRule encodingRule) {
-
-		fEncodingRule = encodingRule;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedStreamCreator.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedStreamCreator.java
deleted file mode 100644
index 07d319f..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedStreamCreator.java
+++ /dev/null
@@ -1,509 +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.sse.core.internal.encoding;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.StringReader;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetEncoder;
-import java.nio.charset.CodingErrorAction;
-import java.nio.charset.UnmappableCharacterException;
-
-import org.eclipse.core.resources.IFile;
-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.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.sse.core.internal.SSECoreMessages;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.encoding.util.Assert;
-import org.eclipse.wst.sse.core.internal.encoding.util.Logger;
-import org.eclipse.wst.sse.core.internal.exceptions.CharConversionErrorWithDetail;
-import org.eclipse.wst.sse.core.internal.exceptions.MalformedOutputExceptionWithDetail;
-import org.eclipse.wst.sse.core.internal.exceptions.UnsupportedCharsetExceptionWithDetail;
-
-
-public class CodedStreamCreator extends CodedIO {
-
-	private final static int INITIAL_BUFFER_SIZE = 1024 * 16;
-
-	// the 32 bytes used by default by ByteOutputStream is
-	// a little small
-	private static final String PROGRAM_ERROR__FAILED_TO_FIND_ANY_CHARSET_ANYWHERE_ = "Program error: failed to find any charset anywhere!"; //$NON-NLS-1$
-
-	private static final String UTF_16BE_CHARSET_NAME = "UTF-16BE"; //$NON-NLS-1$
-	private static final String UTF_16LE_CHARSET_NAME = "UTF-16LE"; //$NON-NLS-1$
-	//	private static final String UTF_16_CHARSET_NAME = "UTF-16";
-	// //$NON-NLS-1$
-
-	private static final String UTF_8_CHARSET_NAME = "UTF-8"; //$NON-NLS-1$
-
-	private boolean fClientSuppliedReader;
-
-	// future_TODO: this 'checkConversion' can be a little
-	// pricey for large
-	// files, chould be a user preference, or something.
-	// private static final boolean checkConversion = true;
-	private EncodingMemento fCurrentEncodingMemento;
-
-	private EncodingMemento fEncodingMemento;
-
-	private String fFilename;
-
-	private boolean fHasBeenAnalyzed;
-
-	private IFile fIFile;
-
-	private EncodingMemento fPreviousEncodingMemento;
-
-	private Reader fReader;
-
-	private Reader fResettableReader;
-	private byte[] UTF16BEBOM = new byte[]{(byte) 0xFE, (byte) 0xFF};
-
-	private byte[] UTF16LEBOM = new byte[]{(byte) 0xFF, (byte) 0xFE};
-	private byte[] UTF3BYTEBOM = new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF};
-
-	public CodedStreamCreator() {
-		super();
-	}
-
-	public CodedStreamCreator(String filename, char[] characterArray) {
-		super();
-		fFilename = filename;
-		fReader = new CharArrayReader(characterArray);
-	}
-
-	public CodedStreamCreator(String filename, Reader reader) {
-		super();
-		fFilename = filename;
-		fReader = reader;
-	}
-
-	public CodedStreamCreator(String filename, String textString) {
-		super();
-		fFilename = filename;
-		fReader = new StringReader(textString);
-	}
-
-	/**
-	 * The primary method which contains the highest level rules for how to
-	 * decide appropriate decoding rules: 1. first check for unicode stream 2.
-	 * then looked for encoding specified in content (according to the type of
-	 * content that is it ... xml, html, jsp, etc. 3. then check for various
-	 * settings: file settings first, if null check project settings, if null,
-	 * check user preferences. 4. lastly (or, what is the last user
-	 * preference) is to use "workbench defaults".
-	 */
-	private void analyze() throws CoreException, IOException {
-		Reader resettableReader = getResettableReader();
-		try {
-			if (fCurrentEncodingMemento == null) {
-				resettableReader.reset();
-				fCurrentEncodingMemento = checkForEncodingInContents();
-			}
-			// if encoding stratagy doesn't provide answer,
-			// then try file settings, project settings,
-			// user preferences, and
-			// finally workbench default.
-			//
-			if (fCurrentEncodingMemento == null || fCurrentEncodingMemento.getDetectedCharsetName() == null) {
-				resettableReader.reset();
-				fCurrentEncodingMemento = getEncodingMementoFromResourceAndPreference();
-			}
-
-			// use DefaultNameRules from NonContentBasedEncodingRules as the
-			// final default
-			if (fEncodingMemento == null) {
-				handleNotProvidedFromContentCase();
-			}
-
-			fHasBeenAnalyzed = true;
-		} finally {
-			if (resettableReader != null) {
-				resettableReader.reset();
-			}
-		}
-	}
-
-	/**
-	 * Need to check conversion early on. There's some danger than old
-	 * contents of a file are set to empty, if an exception occurs.
-	 * 
-	 * @param allText
-	 * @param encoding
-	 * @param encodingRule
-	 * @throws java.io.UnsupportedEncodingException
-	 * @throws MalformedOutputExceptionWithDetail
-	 * @deprecated - we need to find "cheaper" way to to this functionality so
-	 *             likely to go away in future
-	 */
-	private void checkConversion(EncodingMemento memento, EncodingRule encodingRule) throws IOException {
-		String javaEncoding = memento.getJavaCharsetName();
-		String detectedEncoding = memento.getDetectedCharsetName();
-		Charset charset = Charset.forName(javaEncoding);
-		CharsetEncoder charsetEncoder = charset.newEncoder();
-		charsetEncoder.onMalformedInput(CodingErrorAction.REPORT);
-		charsetEncoder.onUnmappableCharacter(CodingErrorAction.REPORT);
-		Reader reader = getResettableReader();
-		reader.reset();
-		int currentChar = reader.read();
-		int currentPos = 1;
-		try {
-			while (currentChar != -1) {
-				// note: this can probably be made more
-				// efficient later to
-				// check buffer by buffer, instead of
-				// character by character.
-				try {
-					boolean canConvert = charsetEncoder.canEncode((char) currentChar);
-					if (!canConvert) {
-						if (encodingRule == EncodingRule.IGNORE_CONVERSION_ERROR) {
-							// if we're told to ignore the
-							// encoding conversion
-							// error,
-							// notice we still want to detect
-							// and log it. We simply
-							// don't throw the exception, and
-							// we do continue with
-							// the
-							// save.
-							Logger.log(Logger.ERROR, "Encoding Conversion Error during save"); //$NON-NLS-1$
-						} else {
-							throw new MalformedOutputExceptionWithDetail(javaEncoding, detectedEncoding, currentPos);
-						}
-					}
-					currentChar = reader.read();
-					currentPos++;
-				}
-				// IBM's JRE seems to throw NPE when DBCS char is given to
-				// SBCS charsetEncoder
-				catch (NullPointerException e) {
-					throw new CharConversionErrorWithDetail(javaEncoding); //$NON-NLS-1$
-				}
-			}
-			// if we get all the way through loop without throwing exception,
-			// then there must
-			// be an error not detectable when going character by character.
-			throw new CharConversionErrorWithDetail(javaEncoding); //$NON-NLS-1$
-		} finally {
-			reader.reset();
-		}
-	}
-
-	private EncodingMemento checkForEncodingInContents() throws CoreException, IOException {
-		EncodingMemento result = null;
-
-		// if encoding memento already set, and no need to get again.
-		if (fEncodingMemento != null) {
-			result = fEncodingMemento;
-		} else {
-			if (fClientSuppliedReader) {
-				fReader.reset();
-				IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
-				try {
-					IContentDescription contentDescription = contentTypeManager.getDescriptionFor(fReader, fFilename, IContentDescription.ALL);
-					if (contentDescription != null) {
-						fEncodingMemento = createMemento(contentDescription);
-					} else {
-						fEncodingMemento = CodedIO.createEncodingMemento("UTF-8"); //$NON-NLS-1$
-					}
-				} catch (NullPointerException e) {
-					// TODO: work around for 5/14 bug in base, should be
-					// removed when move up to 5/21
-					// just created a simple default one
-					fEncodingMemento = CodedIO.createEncodingMemento("UTF-8"); //$NON-NLS-1$
-				}
-				result = fEncodingMemento;
-			} else {
-				throw new IllegalStateException("unexpected state: encodingMemento was null but no input stream supplied"); //$NON-NLS-1$
-			}
-		}
-		//		try {
-		//			result = getEncodingDetector().getEncodingMemento();
-		//			if (result != null && !result.isValid() && !forceDefault()) {
-		//				throw new UnsupportedCharsetExceptionWithDetail(result);
-		//			}
-		//		}
-		//		finally {
-		//			handleStreamClose(fEncodingDetectorStream);
-		//		}
-		return result;
-	}
-
-
-	private void dump(OutputStream outputStream, EncodingRule encodingRule, boolean use3ByteBOMifUTF8) throws CoreException, IOException {
-		getCurrentEncodingMemento();
-		String javaEncodingName = null;
-		if (encodingRule == EncodingRule.CONTENT_BASED) {
-			if (fCurrentEncodingMemento.isValid()) {
-				javaEncodingName = fCurrentEncodingMemento.getJavaCharsetName();
-			} else {
-				throw new UnsupportedCharsetExceptionWithDetail(fCurrentEncodingMemento);
-			}
-		} else if (encodingRule == EncodingRule.IGNORE_CONVERSION_ERROR)
-			javaEncodingName = fCurrentEncodingMemento.getJavaCharsetName();
-		else if (encodingRule == EncodingRule.FORCE_DEFAULT)
-			javaEncodingName = fCurrentEncodingMemento.getAppropriateDefault();
-		// write appropriate "header" unicode BOM bytes
-		// Note: Java seems to write appropriate header for
-		// UTF-16, but not
-		// UTF-8 nor UTF-16BE. This
-		// may vary by JRE version, so need to test well.
-		// Note: javaEncodingName can be null in invalid
-		// cases, so we no hard
-		// to skip whole check if that's the case.
-		if (javaEncodingName != null) {
-			if ((javaEncodingName.equals(UTF_8_CHARSET_NAME) && use3ByteBOMifUTF8) || (javaEncodingName.equals(UTF_8_CHARSET_NAME) && fCurrentEncodingMemento.isUTF83ByteBOMUsed())) {
-				outputStream.write(UTF3BYTEBOM);
-			} else if (javaEncodingName.equals(UTF_16LE_CHARSET_NAME)) {
-				outputStream.write(UTF16LEBOM);
-			} else if (javaEncodingName.equals(UTF_16BE_CHARSET_NAME)) {
-				outputStream.write(UTF16BEBOM);
-			}
-		}
-		// TODO add back in line delimiter handling the
-		// "right" way (updating
-		// markers, not requiring string, etc. .. may need
-		// to move to document
-		// level)
-		//allTextBuffer =
-		// handleLineDelimiter(allTextBuffer, document);
-		Reader reader = getResettableReader();
-		// be sure to test large "readers" ... we'll need
-		// to make sure they all
-		// can reset to initial position (StringReader,
-		// CharArrayReader, and
-		// DocumentReader should all work ok).
-		reader.reset();
-		// There must be cleaner logic somehow, but the
-		// idea is that
-		// javaEncodingName can be null
-		// if original detected encoding is not valid (and
-		// if FORCE_DEFAULT was
-		// not specified). Hence, we WANT the first
-		// Charset.forName to
-		// throw appropriate exception.
-		Charset charset = null;
-
-		// this call checks "override" properties file
-		javaEncodingName = CodedIO.getAppropriateJavaCharset(javaEncodingName);
-
-		if (javaEncodingName == null) {
-			charset = Charset.forName(fCurrentEncodingMemento.getDetectedCharsetName());
-		} else {
-			charset = Charset.forName(javaEncodingName);
-		}
-		CharsetEncoder charsetEncoder = charset.newEncoder();
-		if (!(encodingRule == EncodingRule.IGNORE_CONVERSION_ERROR)) {
-			charsetEncoder.onMalformedInput(CodingErrorAction.REPORT);
-			charsetEncoder.onUnmappableCharacter(CodingErrorAction.REPORT);
-		} else {
-			charsetEncoder.onMalformedInput(CodingErrorAction.REPLACE);
-			charsetEncoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
-
-		}
-		OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, charsetEncoder);
-		//TODO: this may no longer be needed (and is at
-		// least wrong spot for
-		// it).
-		//		if (checkConversion && (!(encodingRule ==
-		// EncodingRule.IGNORE_CONVERSION_ERROR))) {
-		//			checkConversion(fCurrentEncodingMemento,
-		// encodingRule);
-		//		}
-		char[] charbuf = new char[CodedIO.MAX_BUF_SIZE];
-		int nRead = 0;
-		try {
-			while (nRead != -1) {
-				nRead = reader.read(charbuf, 0, MAX_BUF_SIZE);
-				if (nRead > 0) {
-					outputStreamWriter.flush();
-					outputStreamWriter.write(charbuf, 0, nRead);
-				}
-			}
-		} catch (UnmappableCharacterException e) {
-			checkConversion(fCurrentEncodingMemento, encodingRule);
-		} finally {
-			// since we don't own the original output stream, we
-			// won't close it ours.
-			// the caller who passed it to us must close original one
-			// when appropriate.
-			// (but we do flush to be sure all up-to-date)
-			outputStreamWriter.flush();
-		}
-	}
-
-	private boolean get3ByteBOMPreference() {
-		return SSECorePlugin.getDefault().getPluginPreferences().getBoolean(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8);
-	}
-
-	public ByteArrayOutputStream getCodedByteArrayOutputStream() throws CoreException, IOException {
-		return getCodedByteArrayOutputStream(EncodingRule.CONTENT_BASED);
-	}
-
-	public ByteArrayOutputStream getCodedByteArrayOutputStream(EncodingRule encodingRule) throws CoreException, IOException {
-		//Assert.isNotNull(fPreviousEncodingMemento,
-		// "previousEncodingMemento
-		// needs to be set first");
-		ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(INITIAL_BUFFER_SIZE);
-		dump(byteArrayOutputStream, encodingRule, get3ByteBOMPreference());
-		return byteArrayOutputStream;
-	}
-
-	public EncodingMemento getCurrentEncodingMemento() throws CoreException, IOException {
-		//Assert.isNotNull(fPreviousEncodingMemento,
-		// "previousEncodingMemento
-		// needs to be set first");
-		if (!fHasBeenAnalyzed) {
-			analyze();
-		}
-		// post condition
-		Assert.isNotNull(fCurrentEncodingMemento, "illegal post condition state"); //$NON-NLS-1$
-		// be sure to carry over appropriate encoding
-		// "state" that may be
-		// relevent.
-		if (fPreviousEncodingMemento != null) {
-			fCurrentEncodingMemento.setUTF83ByteBOMUsed(fPreviousEncodingMemento.isUTF83ByteBOMUsed());
-		}
-		return fCurrentEncodingMemento;
-	}
-
-	/*
-	 * This method is called only when encoding is not detected in the file.
-	 * 
-	 * Here is encoding lookup order we will try: - try resource content
-	 * description (Eclipse Text file encoding) - try resource content
-	 * properties (for JSP only) - try content type encoding preferences (for
-	 * HTML only) - try resource content description (Eclipse Text file
-	 * encoding, implicit check)
-	 * 
-	 * Note: This method appears in both CodedReaderCreator and
-	 * CodedStreamCreator (with just a minor difference). They should be kept
-	 * the same.
-	 */
-	private EncodingMemento getEncodingMementoFromResourceAndPreference() throws IOException, CoreException {
-		EncodingMemento encodingMemento = fEncodingMemento;
-
-		// Follow Eclipse Platform's direction. Get the charset from IFile.
-		if (fIFile != null) {
-			String charset = fIFile.getCharset();
-			encodingMemento = CodedIO.createEncodingMemento(charset);
-		}
-
-		return encodingMemento;
-	}
-
-	private Reader getResettableReader() {
-		if (fResettableReader == null) {
-			if (fReader.markSupported()) {
-				fResettableReader = fReader;
-			} else {
-				fResettableReader = new BufferedReader(fReader);
-				try {
-					fResettableReader.mark(MAX_MARK_SIZE);
-				} catch (IOException e) {
-					// impossible, since we just checked if
-					// markable
-					throw new Error(e);
-				}
-
-			}
-		}
-		return fResettableReader;
-	}
-
-	protected void handleNotProvidedFromContentCase() {
-		// move to "detectors" if not already
-		String specDefault = null;
-		//specDefault = getEncodingDetector().getSpecDefaultEncoding();
-		String charset = NonContentBasedEncodingRules.useDefaultNameRules(specDefault);
-		Assert.isNotNull(charset, PROGRAM_ERROR__FAILED_TO_FIND_ANY_CHARSET_ANYWHERE_);
-		fCurrentEncodingMemento = CodedIO.createEncodingMemento(charset);
-	}
-
-	// TODO We just copy the content properties encoding to current resource's
-	// encoding for now. May improve the UI later by setting an informational
-	// message and/or disable the content properties encoding field.
-	// TODO make priviate if needed, else remove
-	void migrateContentPropertiesEncoding(String encoding) throws CoreException {
-		if (fIFile != null)
-			fIFile.setCharset(encoding, null);
-		final IFile file = fIFile;
-		final String charset = encoding;
-		// TODO: externalize string later
-		Job migrater = new Job(SSECoreMessages.Migrate_Charset) { //$NON-NLS-1$
-			protected IStatus run(IProgressMonitor monitor) {
-				if (file != null) {
-					try {
-						file.setCharset(charset, null);
-					} catch (CoreException e) {
-						Logger.logException(e);
-					}
-				}
-				return Status.OK_STATUS;
-			}
-		};
-		migrater.setSystem(true);
-		migrater.schedule();
-
-	}
-
-	/**
-	 *  
-	 */
-	private void resetAll() {
-		fFilename = null;
-		fReader = null;
-		fPreviousEncodingMemento = null;
-		fCurrentEncodingMemento = null;
-		fHasBeenAnalyzed = false;
-		fClientSuppliedReader = false;
-	}
-
-	public void set(IFile file, Reader reader) {
-		fIFile = file;
-		set(file.getName(), reader);
-	}
-
-	public void set(String filename, char[] characterArray) {
-		resetAll();
-		fFilename = filename;
-		fReader = new CharArrayReader(characterArray);
-	}
-
-	public void set(String filename, Reader reader) {
-		resetAll();
-		fFilename = filename;
-		fReader = reader;
-		fClientSuppliedReader = true;
-	}
-
-	public void set(String filename, String textString) {
-		set(filename, new StringReader(textString));
-	}
-
-	public void setPreviousEncodingMemento(EncodingMemento previousEncodingMemento) {
-		fPreviousEncodingMemento = previousEncodingMemento;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonCharsetNames.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonCharsetNames.java
deleted file mode 100644
index 10e08f9..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonCharsetNames.java
+++ /dev/null
@@ -1,258 +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.sse.core.internal.encoding;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.UnsupportedCharsetException;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Properties;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.encoding.util.Logger;
-import org.osgi.framework.Bundle;
-
-/**
- * CommonCharsets is a utility class to provide a central place to map some
- * IANA charset name to a Java charset name. In 1.4 JRE's this mostly is a
- * thin wrapper of existing Charset functionality. It does, however, allow
- * some "overriding" of the built in JRE mappings in the event they are
- * necessary. See CodedIO.checkMappingOverrides.
- * <p>
- * This class also provides some convenient human readable description for the
- * charset names which can be used in user interfaces. The description is NL
- * aware based on locale. The data is populated via the charset.properties
- * file only once, based on static initialization of the hashtables.
- * <p>
- * The IANA tags are based on reference information found at the
- * http://www.iana.org site. Specifically see
- * http://www.iana.org/assignments/character-sets
- */
-public final class CommonCharsetNames {
-
-	private static Properties defaultIANAmappings = null;
-
-	private static ArrayList encodings = null;
-
-	private static Hashtable supportedEncodingDisplayNames = null;
-
-	/**
-	 * Returns list of commonly available encoding names. Suitable for
-	 * populating a UI dialog or drop down. This list would be a subset of all
-	 * possible charsets the VM supports (which can get into the hundreds).
-	 * For the VM supported charsets, use
-	 * <code>Charset.availableCharsets()</code>
-	 * 
-	 * @return String[]
-	 */
-	public static String[] getCommonCharsetNames() {
-		String[] enc = new String[getEncodings().size()];
-		getEncodings().toArray(enc);
-		return enc;
-	}
-
-	/**
-	 * @return Returns the defaultIANAmappings.
-	 */
-	private static Properties getDefaultIANAMappings() {
-		if (defaultIANAmappings == null) {
-			defaultIANAmappings = new Properties();
-			Bundle keyBundle = Platform.getBundle(ICodedResourcePlugin.ID);
-			IPath keyPath = new Path("config/defaultIANA.properties"); //$NON-NLS-1$
-			URL location = Platform.find(keyBundle, keyPath);
-			InputStream propertiesInputStream = null;
-			try {
-				propertiesInputStream = location.openStream();
-				defaultIANAmappings.load(propertiesInputStream);
-			}
-			catch (IOException e) {
-				// if can't read, just assume there's no
-				// default IANA mappings
-				// and repeated attempts will not occur,
-				// since they
-				// will be represented by an empty
-				// Properties object
-			}
-		}
-		return defaultIANAmappings;
-	}
-
-	/**
-	 * Returns display (translated) string for encoding name. If there is no
-	 * "custom" translated version available, it defers to ther VM's Charset
-	 * support. It will return null if no display name is available.
-	 * 
-	 * @param String
-	 *            charset name
-	 * @return Human friendly display name
-	 */
-	public static String getDisplayString(String charsetName) {
-		if (charsetName == null)
-			return null;
-		String result = (String) getSupportedEncodingDisplayNames().get(charsetName);
-		if (result == null) {
-			// if we don't have a special one, just return
-			// what's provided by Charset
-
-			try {
-				Charset charset = Charset.forName(charsetName);
-				result = charset.displayName();
-			}
-			catch (UnsupportedCharsetException e) {
-				// if not supported, the display name is
-				// the least of clients concerns :)
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * @return Returns the javaEncodings.
-	 */
-	private static ArrayList getEncodings() {
-		if (encodings == null) {
-			initHashTables();
-		}
-		return encodings;
-	}
-
-	public static String getIanaPreferredCharsetName(String charsetName) {
-		String preferredName = charsetName;
-
-		try {
-			Charset charset = Charset.forName(charsetName);
-			if (charset.name() != null) {
-				preferredName = charset.name();
-			}
-		}
-		catch (IllegalCharsetNameException e) {
-			// just return input if illegal
-		}
-		catch (UnsupportedCharsetException e) {
-			// just return input if illegal
-		}
-		return preferredName;
-	}
-
-	/**
-	 * Returns a default IANA name that is listed in CommonCharsetNames. Here
-	 * is how it checks: 1. check to see if charsetName is in the
-	 * CommonCharsetNames list and if so, just return it. 2. check to see if
-	 * charsetName is listed in defaultIANAmappings which contains a mapping
-	 * of more common encodings and the default IANA name they should map to.
-	 * 3. return defaultIanaName if all else fails
-	 */
-	public static String getPreferredDefaultIanaName(String charsetName, String defaultIanaName) {
-		String preferredName = defaultIanaName;
-		String guessedName = charsetName;
-		try {
-			guessedName = CodedIO.getAppropriateJavaCharset(charsetName);
-		}
-		catch (IllegalCharsetNameException e) {
-			// just ignore if illegal
-		}
-		catch (UnsupportedCharsetException e) {
-			// just ignore if illegal
-		}
-		if (getEncodings().contains(guessedName))
-			preferredName = guessedName;
-		else {
-			preferredName = getDefaultIANAMappings().getProperty(guessedName, preferredName);
-		}
-
-		return preferredName;
-	}
-
-	/**
-	 * @return
-	 */
-	private static Hashtable getSupportedEncodingDisplayNames() {
-		if (supportedEncodingDisplayNames == null) {
-			initHashTables();
-		}
-		return supportedEncodingDisplayNames;
-	}
-
-	private static void initHashTables() {
-		if (supportedEncodingDisplayNames == null) {
-			// Initialize hash table for encoding table
-			supportedEncodingDisplayNames = new Hashtable();
-			encodings = new ArrayList();
-
-			ResourceBundle bundle = null;
-			InputStream bundleStream = null;
-			try {
-				URL bundleURL = Platform.find(Platform.getBundle(ICodedResourcePlugin.ID), Path.fromOSString("$nl$/config/charset.properties")); //$NON-NLS-1$
-				if (bundleURL != null) {
-					bundleStream = bundleURL.openStream();
-					bundle = new PropertyResourceBundle(bundleStream);
-				}
-
-				String totalNumString = bundle.getString("totalnumber");//$NON-NLS-1$
-				int totalNum = 0;
-				if (totalNumString.length() != 0) {
-					try {
-						totalNum = Integer.valueOf(totalNumString).intValue();
-					}
-					catch (NumberFormatException e) {
-						totalNum = 0;
-					}
-				}
-
-				for (int i = 0; i < totalNum; i++) {
-					String iana = bundle.getString("codeset." + i + ".iana");//$NON-NLS-2$//$NON-NLS-1$
-					String displayName = bundle.getString("codeset." + i + ".label");//$NON-NLS-2$//$NON-NLS-1$
-
-					encodings.add(iana);
-					supportedEncodingDisplayNames.put(iana, displayName);
-				}
-			}
-			catch (IOException e) {
-				Logger.logException("invalid install or configuration", e); //$NON-NLS-1$
-			}
-			finally {
-				try {
-					if (bundleStream != null)
-						bundleStream.close();
-				}
-				catch (IOException x) {
-				}
-			}
-		}
-	}
-
-	public static void main(String[] args) {
-		// unit test only
-		String test = "Cp1252"; //$NON-NLS-1$
-		String result = CommonCharsetNames.getIanaPreferredCharsetName(test);
-		System.out.println(test + " --> " + result); //$NON-NLS-1$
-
-		test = "MS932"; //$NON-NLS-1$
-		result = CommonCharsetNames.getIanaPreferredCharsetName(test);
-		System.out.println(test + " --> " + result); //$NON-NLS-1$
-
-	}
-
-	public CommonCharsetNames() {
-		super();
-		initHashTables();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonEncodingPreferenceNames.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonEncodingPreferenceNames.java
deleted file mode 100644
index 70354d5..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonEncodingPreferenceNames.java
+++ /dev/null
@@ -1,73 +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.sse.core.internal.encoding;
-
-/**
- * Common preference keys used to specify encoding and end of line.
- */
-public class CommonEncodingPreferenceNames {
-	
-	private CommonEncodingPreferenceNames() {
-		// empty private constructor so users cannot instantiate class
-	}
-
-	/**
-	 * Constant to be used when referring to CR/MAC line delimiter
-	 */
-	public static final String CR = "EOL_Mac"; //$NON-NLS-1$
-	/**
-	 * Constant to be used when referring to CRLF/WINDOWS line delimiter
-	 */
-	public static final String CRLF = "EOL_Windows"; //$NON-NLS-1$
-	/**
-	 * The end-of-line character(s) to use.
-	 */
-	public static final String END_OF_LINE_CODE = "endOfLineCode";//$NON-NLS-1$
-	/**
-	 * The character code to use when reading a file.
-	 */
-	public static final String INPUT_CODESET = "inputCodeset";//$NON-NLS-1$
-
-	/**
-	 * Constant to be used when referring to LF/UNIX line delimiter
-	 */
-	public static final String LF = "EOL_Unix"; //$NON-NLS-1$
-	/**
-	 * Constant to be used when referring to No translation of line delimiters
-	 */
-	public static final String NO_TRANSLATION = ""; //$NON-NLS-1$
-	/**
-	 * The character code to use when writing a file.
-	 */
-	public static final String OUTPUT_CODESET = "outputCodeset";//$NON-NLS-1$
-
-	/**
-	 * String representation of CR/MAC line delimiter
-	 */
-	public static final String STRING_CR = "\r";//$NON-NLS-1$
-
-	/**
-	 * String representation of CRLF/WINDOWS line delimiter
-	 */
-	public static final String STRING_CRLF = "\r\n";//$NON-NLS-1$
-
-	/**
-	 * String representation of LF/UNIX line delimiter
-	 */
-	public static final String STRING_LF = "\n";//$NON-NLS-1$
-
-	/**
-	 * String Use 3 byte BOM (Byte Order Mark) when saving UTF-8 encoded files
-	 */
-	public static final String USE_3BYTE_BOM_WITH_UTF8 = "Use3ByteBOMWithUTF8"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentBasedPreferenceGateway.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentBasedPreferenceGateway.java
deleted file mode 100644
index 332a09d..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentBasedPreferenceGateway.java
+++ /dev/null
@@ -1,165 +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.sse.core.internal.encoding;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.osgi.framework.Bundle;
-import org.osgi.service.prefs.Preferences;
-
-
-public class ContentBasedPreferenceGateway {
-	private static String DEFAULT_LOCATION = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
-	private static String RUNTIME_XML_ID = "org.eclipse.runtime.xml"; //$NON-NLS-1$
-	private static String SSE_XML_ID = "org.eclipse.wst.xml.core.xmlsource"; //$NON-NLS-1$
-
-	/**
-	 * @param pluginId
-	 * @return
-	 */
-	private static boolean bundleExists(String pluginId) {
-
-		// this just verifies there's really a plugin with this ID in "stack"
-		Bundle bundle = Platform.getBundle(pluginId);
-		return (!(bundle == null));
-	}
-
-	/**
-	 * @param contentType
-	 * @return
-	 */
-	private static String getContributorPluginId(IContentType contentType) {
-		// TODO: need to have registration info here, but for now, we'll use
-		// simple heuristic to cover the cases we know about.
-		String fullId = null;
-		if (contentType == null) {
-			fullId = DEFAULT_LOCATION;
-		} else {
-			fullId = contentType.getId();
-		}
-		String pluginId = inferPluginId(fullId);
-		// only one known case, so far, of hard coded re-direction
-		// (not sure this is even needed, but just in case).
-		// We don't want to store/change runtime.xml preferences
-		if (RUNTIME_XML_ID.equals(pluginId)) {
-			pluginId = SSE_XML_ID;
-		}
-		return pluginId;
-	}
-
-	private static Preferences getDefaultPreferences(IContentType contentType) {
-		IEclipsePreferences eclipsePreferences = Platform.getPreferencesService().getRootNode();
-		// TODO: eventaully need extension mechanism to avoid these hard coded
-		// mechanism.
-		// The idea is to load/store based on plugin's preferences, where the
-		// content type was contributed
-		// Eventually, too, we could do more "dynamic lookup" to get parent
-		// types for defaults, etc.
-
-		// Get default plugin preferences
-		String pluginPreferenceLocation = DefaultScope.SCOPE + IPath.SEPARATOR + getContributorPluginId(contentType);
-		Preferences pluginPreferences = eclipsePreferences.node(pluginPreferenceLocation);
-
-		// the below code does not work at this time because content type
-		// preferences are stored in the place as plugin preferences
-
-		//		Preferences contentPreferences = null;
-		//		if (contentType != null) {
-		//			contentPreferences = pluginPreferences.node(contentType.getId());
-		//		}
-		//		else {
-		//			contentPreferences = pluginPreferences.node(DEFAULT_LOCATION );
-		//		}
-		//
-		//		return contentPreferences;
-
-		return pluginPreferences;
-
-	}
-
-	private static Preferences getDefaultPreferences(String contentTypeId) {
-		IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeId);
-		return getDefaultPreferences(contentType);
-	}
-
-	public static Preferences getPreferences(IContentType contentType) {
-		IEclipsePreferences eclipsePreferences = Platform.getPreferencesService().getRootNode();
-		// TODO: eventaully need extension mechanism to avoid these hard coded
-		// mechanism.
-		// The idea is to load/store based on plugin's preferences, where the
-		// content type was contributed
-		// Eventually, too, we could do more "dynamic lookup" to get parent
-		// types for defaults, etc.
-
-		// Get instance plugin preferences
-		String pluginPreferenceLocation = Plugin.PLUGIN_PREFERENCE_SCOPE + IPath.SEPARATOR + getContributorPluginId(contentType);
-		Preferences pluginPreferences = eclipsePreferences.node(pluginPreferenceLocation);
-
-		// the below code does not work at this time because content type
-		// preferences are stored in the place as plugin preferences
-
-		//		Preferences contentPreferences = null;
-		//		if (contentType != null) {
-		//			contentPreferences = pluginPreferences.node(contentType.getId());
-		//		}
-		//		else {
-		//			contentPreferences = pluginPreferences.node(DEFAULT_LOCATION );
-		//		}
-		//
-		//		return contentPreferences;
-		return pluginPreferences;
-
-	}
-
-	public static Preferences getPreferences(String contentTypeId) {
-		IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeId);
-		return getPreferences(contentType);
-	}
-
-	public static String getPreferencesString(IContentType contentType, String key) {
-		Preferences preferences = getPreferences(contentType);
-		String value = preferences.get(key, getDefaultPreferences(contentType).get(key, null));
-		return value;
-	}
-
-	public static String getPreferencesString(String contentTypeId, String key) {
-		Preferences preferences = getPreferences(contentTypeId);
-		String value = preferences.get(key, getDefaultPreferences(contentTypeId).get(key, null));
-		return value;
-	}
-
-	/**
-	 * @param fullId
-	 * @return
-	 */
-	private static String inferPluginId(String fullId) {
-		// simply trim off last "segment" from full ID.
-		int lastSegmentPos = fullId.lastIndexOf('.');
-		String pluginId = null;
-		if (lastSegmentPos != -1) {
-			pluginId = fullId.substring(0, lastSegmentPos);
-		} else {
-			// weird case? We'll at least put/get them somewhere
-			pluginId = DEFAULT_LOCATION;
-		}
-		if (!bundleExists(pluginId)) {
-			// use default location
-			pluginId = DEFAULT_LOCATION;
-		}
-		return pluginId;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentTypeEncodingPreferences.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentTypeEncodingPreferences.java
deleted file mode 100644
index 432ad24..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentTypeEncodingPreferences.java
+++ /dev/null
@@ -1,179 +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.sse.core.internal.encoding;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.wst.sse.core.internal.encoding.util.Assert;
-
-
-/**
- * A convenience class to statically get preferenences.
- */
-
-public abstract class ContentTypeEncodingPreferences {
-
-	// actually a null/empty string also means use workbench default so this
-	// constant might not really be necessary
-	public static final String WORKBENCH_DEFAULT = "WORKBENCH_DEFAULT"; //$NON-NLS-1$
-
-
-	private static final String getJavaPlatformDefaultEncoding() {
-		// note: its important to use this system property,
-		// instead
-		// of
-		// ByteToCharConverter.getDefault().getCharacterEncoding()
-		// inorder to handle changes "on the fly". the
-		// ByteToCharConverter
-		// default is apparently set only when VM starts.
-		// There's not really any "cusomter scnererios"
-		// that change the
-		// default encoding "on the fly", but its at least
-		// used during
-		// our automated tests.
-		String enc = System.getProperty("file.encoding"); //$NON-NLS-1$
-		// return blank as null
-		if (enc != null && enc.trim().length() == 0) {
-			enc = null;
-		}
-		return enc;
-	}
-
-
-	public static final String getPreferredNewLineDelimiter(String contentTypeId) {
-		String result = null;
-		String newLineCode = null;
-		newLineCode = ContentBasedPreferenceGateway.getPreferencesString(contentTypeId, CommonEncodingPreferenceNames.END_OF_LINE_CODE);
-		if (newLineCode == null)
-			result = null;
-		else if (newLineCode.equals(CommonEncodingPreferenceNames.CR))
-			result = CommonEncodingPreferenceNames.STRING_CR;
-		else if (newLineCode.equals(CommonEncodingPreferenceNames.LF))
-			result = CommonEncodingPreferenceNames.STRING_LF;
-		else if (newLineCode.equals(CommonEncodingPreferenceNames.CRLF))
-			result = CommonEncodingPreferenceNames.STRING_CRLF;
-		return result;
-	}
-
-	/**
-	 * Returns current output encoding preference for contentTypeIdentifier
-	 * (unique IANA encoding)
-	 */
-	public static final String getUserPreferredCharsetName(String contentTypeId) {
-		String prefEncoding = ContentBasedPreferenceGateway.getPreferencesString(contentTypeId, CommonEncodingPreferenceNames.OUTPUT_CODESET);
-		String encoding = prefEncoding;
-		// get workbench encoding preference if preference
-		// requests it
-		if (prefEncoding == null || prefEncoding.trim().length() == 0 || prefEncoding.equals(ContentTypeEncodingPreferences.WORKBENCH_DEFAULT)) {
-			encoding = ContentTypeEncodingPreferences.getWorkbenchPreferredCharsetName();
-		}
-		return encoding;
-	}
-
-	/**
-	 * Utility method to get specified preference. Subclasses can't override,
-	 * since we expect this to work in a consistent way. Note: this is
-	 * specific to HTML and CSS and is intended to supply a "default spec"
-	 * other than the workbench platform's default, only for those cases where
-	 * there is no encoding specified anywhere else, e.g. in the file, or as a
-	 * file or folder property.
-	 */
-	public static final String getUserSpecifiedDefaultEncodingPreference() {
-		String ContentTypeID_HTML = "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
-		return getUserSpecifiedDefaultEncodingPreference(ContentTypeID_HTML);
-	}
-
-	public static final String getUserSpecifiedDefaultEncodingPreference(String contentTypeID) {
-		String enc = null;
-
-		// first try to get base's default encoding for content type
-		IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
-		if (contentType != null) {
-			enc = contentType.getDefaultCharset();
-		}
-		
-		// next try to get sse's default encoding for content type
-		if (enc == null || enc.trim().length() == 0) {
-			enc = ContentBasedPreferenceGateway.getPreferencesString(contentTypeID, CommonEncodingPreferenceNames.INPUT_CODESET);
-		}
-		
-		// next, just try and use workbench encoding
-		if (enc == null || enc.trim().length() == 0) {
-			enc = getWorkbenchSpecifiedDefaultEncoding();
-		}
-		
-		// return blank as null
-		if (enc != null && enc.trim().length() == 0) {
-			enc = null;
-		}
-		return enc;
-	}
-
-	/**
-	 * Returns Workbench encoding preference. Note: if workbench encoding is
-	 * null, platform encoding will be returned.
-	 */
-	private static final String getWorkbenchPreferredCharsetName() {
-		String charset = ResourcesPlugin.getEncoding();
-		charset = CommonCharsetNames.getIanaPreferredCharsetName(charset);
-		return charset;
-	}
-
-	/**
-	 * Returns Workbench encoding preference. Will return null if none
-	 * specified.
-	 */
-	private static final String getWorkbenchSpecifiedDefaultEncoding() {
-		ResourcesPlugin resourcePlugin = ResourcesPlugin.getPlugin();
-		String enc = resourcePlugin.getPluginPreferences().getString(ResourcesPlugin.PREF_ENCODING);
-		// return blank as null
-		if (enc != null && enc.trim().length() == 0) {
-			enc = null;
-		}
-		return enc;
-	}
-
-	public static final String useDefaultNameRules(IResourceCharsetDetector encodingProvider) {
-		String result = null;
-		String enc = null;
-		enc = encodingProvider.getSpecDefaultEncoding();
-		if (enc != null) {
-			result = enc;
-		} else {
-			enc = getUserSpecifiedDefaultEncodingPreference();
-			if (enc != null && enc.trim().length() > 0) {
-				result = enc;
-			} else {
-				if (enc == null || enc.trim().length() == 0) {
-					enc = getWorkbenchSpecifiedDefaultEncoding();
-					if (enc != null) {
-						result = enc;
-					}
-				}
-				if (enc == null || enc.trim().length() == 0) {
-					enc = getJavaPlatformDefaultEncoding();
-					// enc should never be null (but we'll
-					// check anyway)
-					if (enc != null) {
-						result = enc;
-					}
-				}
-			}
-		}
-		Assert.isNotNull(enc, "post condition invalid"); //$NON-NLS-1$
-		result = CodedIO.checkMappingOverrides(enc);
-		return result;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingMemento.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingMemento.java
deleted file mode 100644
index 853dfde..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingMemento.java
+++ /dev/null
@@ -1,249 +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.sse.core.internal.encoding;
-
-import org.eclipse.core.runtime.content.IContentDescription;
-
-
-/**
- * This class is to simply hold information and data about the type of
- * encoding found for a resource. It not only includes names, etc., but also
- * gives hints about the algorithm, or rule, that the encodng was determined.
- * Having all this info in a central object, associated with the Document
- * (technically, IStructuredDocument), allows for better user error messages,
- * and better handling of knowing how to dump a file, given we know how it was
- * loaded.
- * 
- * Note: the data in this class is only valid if its has actually gone through
- * the loading or dumping sequence. It is not accurate, for example, if a
- * structuredDocument is simply created and then setText called. In this type
- * of case, accuracy for loading and dumping is not required, since its all
- * re-discovered. One limitation is that structuredDocument's created "from
- * scratch" this way, don't have any encoding information to count on, and
- * would have to arrange the processing to be done. (And it is done,
- * automatically if going through loader or dumper, but perhaps not in future
- * new uses. TODO: this can be inproved in future versions.)
- * 
- * isInitialized is set when the loader or dumper processes have been used,
- * but even this can't be counted on 100% if the document has been modified
- * since.
- * 
- */
-public class EncodingMemento implements Cloneable {
-
-	public final static String CLONED = "cloned"; //$NON-NLS-1$
-	public final static String DEFAULTS_ASSUMED_FOR_EMPTY_INPUT = "DefaultsAssumedForEmptyInput"; //$NON-NLS-1$
-	public final static String DEFAULTS_USED_DUE_TO_SMALL_STREAM = "defaultsUsedDueToSmallStream"; //$NON-NLS-1$
-
-
-	/*
-	 * Strings to be used for tracing. TODO: need to clean this up, we no
-	 * longer use all of them
-	 */
-	public final static String DETECTED_STANDARD_UNICODE_BYTES = "detectedStandardUnicodeBytes"; //$NON-NLS-1$
-	public final static String FOUND_ENCODING_IN_CONTENT = "foundEncodingInContent"; //$NON-NLS-1$
-	public final static String FOUND_ENCODING_IN_STREAM = "foundEncodingInStream"; //$NON-NLS-1$
-	public final static String FOUND_ENCODING_IN_STRUCTURED_DOCUMENT = "foundEncodingInStructuredDocument"; //$NON-NLS-1$
-	public final static String GUESSED_ENCODING_FROM_STREAM = "GuessEncodingFromStream"; //$NON-NLS-1$
-	public final static String JAVA_NAME_FOUND_AS_IANA_NAME = "noMappingFoundButJavaNameFoundToBeIANAName"; //$NON-NLS-1$
-	public final static String JAVA_NAME_FOUND_IN_ALIAS_NAME = "noMappingFoundButJavaNameFoundInAliasTable"; //$NON-NLS-1$
-	public final static String NO_IANA_NAME_FOUND = "noMappingFoundFromJavaNameToIANAName"; //$NON-NLS-1$
-	public final static String USED_CONTENT_TYPE_DEFAULT = "UsedContentTypeDefault"; //$NON-NLS-1$
-	public final static String USED_JAVA_DEFAULT = "UsedJavaDefault"; //$NON-NLS-1$
-	public final static String USED_MEMENTO_FROM_LOAD = "usedMementoFromLoad"; //$NON-NLS-1$
-	public final static String USED_PROPERTY_SETTINGS = "USED_PROPERTY_SETTINGS"; //$NON-NLS-1$
-	public final static String USED_USER_SPECIFIED_PREFERENCE = "UsedUserSpecifiedPreference"; //$NON-NLS-1$
-	public final static String USED_WORKSPACE_DEFAULT = "UsedWorkspaceDefault"; //$NON-NLS-1$
-	public final static String USER_IS_USING_JAVA_ENCODING = "UserIsUsingJavaEncoding"; //$NON-NLS-1$
-	private String fAppropriateDefault;
-	private String fDetectedCharsetName;
-	private String fInvalidEncoding;
-
-
-	private String fJavaCharsetName;
-	private boolean fUnicodeStream;
-	private boolean fUTF83ByteBOMUsed;
-
-	public EncodingMemento() {
-		super();
-	}
-
-	/**
-	 * Returns a clone of this object.
-	 */
-	public Object clone() {
-		EncodingMemento object = null;
-		try {
-			object = (EncodingMemento) super.clone();
-		}
-		catch (CloneNotSupportedException e) {
-			// impossible, since we're implementing here
-		}
-
-		return object;
-
-	}
-
-	/**
-	 * Returns the appropriateDefault. This is only set if an invalid encoding
-	 * was found, and contains an charset appropriate to use as a default
-	 * value, if, for example, the user decides to load the document anyway,
-	 * even though the charset was found to be invalid.
-	 * 
-	 * @return String
-	 */
-	public String getAppropriateDefault() {
-		if (fAppropriateDefault == null) {
-			fAppropriateDefault = NonContentBasedEncodingRules.useDefaultNameRules(null);
-		}
-		return fAppropriateDefault;
-	}
-
-	/**
-	 * Returns the charset name, if it is different from the charset name
-	 * found in getJavaCharsetName. This can happen, for example, if there are
-	 * differences in case. This method might return SHIFT_JIS, and the the
-	 * getJavaCharsetName might return Shift_JIS -- if SHIFT_JIS was detected
-	 * in file/document. If the original file contained the correct case, then
-	 * this method would return null. The getJavaCharsetName is typically the
-	 * one that should always be used, and this one only used for certain
-	 * error conditions, or or if when creating a "duplicate" resource, it was
-	 * desired to use exactly the charset name as in the original document. As
-	 * an example of this later case, the original document might contain
-	 * ISO-8859-9, but the detected charset name might contain ISO-8859-9-I.
-	 * 
-	 * @return String
-	 */
-	public String getDetectedCharsetName() {
-		return fDetectedCharsetName;
-	}
-
-	/**
-	 * Returns a charset name that was detected, but not found to be a charset
-	 * suppoorted by the VM.
-	 * 
-	 * @return String
-	 */
-	public String getInvalidEncoding() {
-		return fInvalidEncoding;
-	}
-
-	/**
-	 * Returns the java cononical charset name.
-	 * 
-	 * @return String
-	 */
-	public String getJavaCharsetName() {
-		return fJavaCharsetName;
-	}
-
-	/**
-	 * Note: we may be able to remove this method, if it turns out this work
-	 * is done by "text" type.
-	 * 
-	 * @deprecated -
-	 */
-	public byte[] getUnicodeBOM() {
-		byte[] bom = null;
-		if (isUTF83ByteBOMUsed())
-			bom = IContentDescription.BOM_UTF_8;
-		else if (isUnicodeStream()) {
-			if (getJavaCharsetName().equals("UTF-16") || getJavaCharsetName().equals("UTF-16LE")) { //$NON-NLS-1$ //$NON-NLS-2$
-				bom = IContentDescription.BOM_UTF_16LE;
-			}
-			else if (getJavaCharsetName().equals("UTF-16BE")) { //$NON-NLS-1$
-				bom = IContentDescription.BOM_UTF_16BE;
-			}
-
-		}
-		return bom;
-	}
-
-	/**
-	 * Note: in our implementation, the stream is a unicode stream if the
-	 * charset is UTF-16, UTF-16LE, or UTF-16BE. A stream with 3 byte BOM is
-	 * not considered unicode stream here.
-	 * 
-	 * @return returns true if is a unicode (UTF-16) stream
-	 */
-	public boolean isUnicodeStream() {
-		return fUnicodeStream;
-	}
-
-	/**
-	 * Note: in our implementation, the stream is a unicode stream if the
-	 * charset is UTF-16, UTF-16LE, or UTF-16BE. A stream with 3 byte BOM is
-	 * not considered unicode stream here.
-	 * 
-	 * Set during load, can be used by dumper to write 3 byte BOM, which Java
-	 * does not normally do. This helps maintain compatibility with other
-	 * programs (those that wrote the 3 byte BOM there to begin with.
-	 * 
-	 * @return boolean
-	 */
-	public boolean isUTF83ByteBOMUsed() {
-		return fUTF83ByteBOMUsed;
-	}
-
-	public boolean isValid() {
-		return getInvalidEncoding() == null;
-	}
-
-	/**
-	 * Sets the appropriateDefault.
-	 * 
-	 * @param appropriateDefault
-	 *            The appropriateDefault to set
-	 */
-	public void setAppropriateDefault(String appropriateDefault) {
-		fAppropriateDefault = appropriateDefault;
-	}
-
-
-	public void setDetectedCharsetName(String detectedCharsetName) {
-		fDetectedCharsetName = detectedCharsetName;
-	}
-
-	public void setInvalidEncoding(String invalidEncoding) {
-		fInvalidEncoding = invalidEncoding;
-	}
-
-	/**
-	 * Sets the javaEncodingName.
-	 * 
-	 * @param javaEncodingName
-	 *            The javaEncodingName to set
-	 */
-	public void setJavaCharsetName(String javaCharsetName) {
-		fJavaCharsetName = javaCharsetName;
-	}
-
-	/**
-	 * @param b
-	 */
-	public void setUnicodeStream(boolean unicodeStream) {
-		fUnicodeStream = unicodeStream;
-
-	}
-
-	/**
-	 * Sets the uTF83ByteBOMfound.
-	 * 
-	 * @param uTF83ByteBOMfound
-	 *            The uTF83ByteBOMfound to set
-	 */
-	public void setUTF83ByteBOMUsed(boolean uTF83ByteBOMUsed) {
-		fUTF83ByteBOMUsed = uTF83ByteBOMUsed;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingRule.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingRule.java
deleted file mode 100644
index 53fbbe2..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingRule.java
+++ /dev/null
@@ -1,59 +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.sse.core.internal.encoding;
-
-
-/**
- * Class to provided "enumerated types" for encoding rule parameter. This is
- * to be used by client to have some control over how encoding is determined.
- */
-public class EncodingRule {
-	/**
-	 * CONTENT_BASED means the class which uses the parameter (such as
-	 * contentType Loaders) should use what ever rules it normally would.
-	 * (Note, some content type loaders may not always literally use the file
-	 * content to determine encoding, but the point is they should use what
-	 * ever rules they normally would.)
-	 */
-	public static final EncodingRule CONTENT_BASED = new EncodingRule("CONTENT_BASED"); //$NON-NLS-1$
-	/**
-	 * FORCE_DEFAULT means the class which uses the parameter (such as
-	 * contentType Loaders) should use what ever it defines as the default
-	 * encoding.
-	 */
-	public static final EncodingRule FORCE_DEFAULT = new EncodingRule("FORCE_DEFAULT"); //$NON-NLS-1$
-
-	/**
-	 * IGNORE_CONVERSION_ERROR means that the save operation should save even
-	 * if it encounters conversion errors. This will result in some data loss,
-	 * so should only be used after the user confirms that is indeed what they
-	 * want to do.
-	 */
-	public static final EncodingRule IGNORE_CONVERSION_ERROR = new EncodingRule("IGNORE_CONVERSION_ERROR"); //$NON-NLS-1$
-
-
-	private final String encodingRule;
-
-	/**
-	 * Constructor for EncodingRule is private, so no one can instantiate
-	 * except this class itself.
-	 */
-	private EncodingRule(String ruleName) {
-		super();
-		encodingRule = ruleName;
-	}
-
-	public String toString() {
-		return encodingRule;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ICodedResourcePlugin.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ICodedResourcePlugin.java
deleted file mode 100644
index 42b01de..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ICodedResourcePlugin.java
+++ /dev/null
@@ -1,19 +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.sse.core.internal.encoding;
-
-
-public interface ICodedResourcePlugin {
-	String ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IContentDescriptionExtended.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IContentDescriptionExtended.java
deleted file mode 100644
index a778ad3..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IContentDescriptionExtended.java
+++ /dev/null
@@ -1,42 +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.sse.core.internal.encoding;
-
-import org.eclipse.core.runtime.QualifiedName;
-
-
-public interface IContentDescriptionExtended {
-	/**
-	 * The APPROPRIATE_DEFAULT field is used only when the
-	 * IContentType.getDefaultCharset returns null. Its typically set from
-	 * user preferences. Known uses cases are HTML and CSS, where there is no
-	 * "spec default" for those content types.
-	 */
-	public static final QualifiedName APPROPRIATE_DEFAULT = new QualifiedName(ICodedResourcePlugin.ID, "appropriateDefault"); //$NON-NLS-1$
-	/**
-	 * The DETECTED_CHARSET property should be set when the "detected" charset
-	 * is different from the java charset, even though functionally
-	 * equivelent. This can occur, for example, when the cases are different,
-	 * or when an alias name is used instead of the conanical name.
-	 */
-	public final static QualifiedName DETECTED_CHARSET = new QualifiedName(ICodedResourcePlugin.ID, "detectedCharset"); //$NON-NLS-1$
-	/**
-	 * The UNSUPPORTED_CHARSET property holds the charset value, if its been
-	 * found to be an unsuppoted charset. This is helpful in error messages,
-	 * or in cases when even though the charset is invalid, the java charset
-	 * is assumed to be the default.
-	 */
-	public final static QualifiedName UNSUPPORTED_CHARSET = new QualifiedName(ICodedResourcePlugin.ID, "unsupportedCharset"); //$NON-NLS-1$
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IResourceCharsetDetector.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IResourceCharsetDetector.java
deleted file mode 100644
index 6995b51..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IResourceCharsetDetector.java
+++ /dev/null
@@ -1,21 +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.sse.core.internal.encoding;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-
-public interface IResourceCharsetDetector extends IStreamCharsetDetector {
-	void set(IStorage iStorage) throws CoreException;
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IStreamCharsetDetector.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IStreamCharsetDetector.java
deleted file mode 100644
index f51aecc..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IStreamCharsetDetector.java
+++ /dev/null
@@ -1,28 +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.sse.core.internal.encoding;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-public interface IStreamCharsetDetector {
-	String getEncoding() throws IOException;
-
-	String getSpecDefaultEncoding();
-
-	void set(InputStream inputStream);
-
-	void set(Reader reader);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/NonContentBasedEncodingRules.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/NonContentBasedEncodingRules.java
deleted file mode 100644
index b7c9ae6..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/NonContentBasedEncodingRules.java
+++ /dev/null
@@ -1,139 +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.sse.core.internal.encoding;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-
-public class NonContentBasedEncodingRules {
-
-	private static final String getJavaPlatformDefaultEncoding() {
-		String enc = System.getProperty("file.encoding"); //$NON-NLS-1$
-		// return blank as null
-		if (enc != null && enc.trim().length() == 0) {
-			enc = null;
-		}
-		return enc;
-	}
-
-
-	public static String getUserSpecifiedDefaultForContentType(IFile iFile) {
-		String enc = null;
-		
-		IContentType contentType = null;
-		try {
-			contentType = iFile.getContentDescription().getContentType();
-			
-			// first try to get base's default encoding for content type 
-			if (contentType != null) {
-				enc = contentType.getDefaultCharset();
-			}
-
-			// next try to get sse's default encoding for content type
-			if (enc == null || enc.trim().length() == 0) {
-				enc = ContentBasedPreferenceGateway.getPreferencesString(contentType, CommonEncodingPreferenceNames.INPUT_CODESET);
-			}
-			
-			// return blank as null
-			if (enc != null && enc.trim().length() == 0) {
-				enc = null;
-			}
-		} catch (CoreException e) {
-			// if core exception occurs, assume no preference!
-			enc = null;
-		}
-		return enc;
-	}
-
-	public static String getUserSpecifiedDefaultForContentType(String contentTypeId) {
-		String enc = null;
-		
-		// first try to get base's default encoding for content type
-		IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeId);
-		if (contentType != null) {
-			enc = contentType.getDefaultCharset();
-		}
-		
-		// next try to get sse's default encoding for content type
-		if (enc == null || enc.trim().length() == 0) {
-			enc = ContentBasedPreferenceGateway.getPreferencesString(contentTypeId, CommonEncodingPreferenceNames.INPUT_CODESET);
-		}
-		
-		// return blank as null
-		if (enc != null && enc.trim().length() == 0) {
-			enc = null;
-		}
-		return enc;
-	}
-
-	private static final String getWorkbenchSpecifiedDefaultEncoding() {
-		ResourcesPlugin resourcePlugin = ResourcesPlugin.getPlugin();
-		String enc = resourcePlugin.getPluginPreferences().getString(ResourcesPlugin.PREF_ENCODING);
-		// return blank as null
-		if (enc != null && enc.trim().length() == 0) {
-			enc = null;
-		}
-		return enc;
-	}
-
-	/**
-	 * @param specDefault
-	 *            This is the default charset name that would ordinarily be
-	 *            used for a particular type of content. Null may be
-	 *            specififed for those types with no spec default. If the spec
-	 *            default is known (and passed in), then it will be returned
-	 *            after being checked to see if there's be any user specified
-	 *            "override" for that charset (which would be rare). In other
-	 *            words, if the spec is known, there's little reason to use
-	 *            this method.
-	 * @return the charset that should be used according to the rules
-	 *         established by this class.
-	 */
-	public static final String useDefaultNameRules(String specDefault) {
-		String enc = null;
-		String result = null;
-		enc = specDefault;
-		if (enc != null) {
-			result = enc;
-		} else {
-			enc = ContentTypeEncodingPreferences.getUserSpecifiedDefaultEncodingPreference();
-			if (enc != null && enc.trim().length() > 0) {
-				result = enc.trim();
-			} else {
-				if (enc == null || enc.trim().length() == 0) {
-					enc = getWorkbenchSpecifiedDefaultEncoding();
-					if (enc != null) {
-						result = enc.trim();
-					}
-				}
-				if (enc == null || enc.trim().length() == 0) {
-					enc = getJavaPlatformDefaultEncoding();
-					// enc should never be null (but we'll
-					// check anyway)
-					if (enc != null) {
-						result = enc;
-					}
-				}
-			}
-		}
-		result = CodedIO.checkMappingOverrides(result);
-		return result;
-	}
-
-	private NonContentBasedEncodingRules() {
-		super();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Assert.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Assert.java
deleted file mode 100644
index 85f18dd..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Assert.java
+++ /dev/null
@@ -1,120 +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.sse.core.internal.encoding.util;
-
-/**
- * <code>Assert</code> is useful for for embedding runtime sanity checks in
- * code. The predicate methods all test a condition and throw some type of
- * unchecked exception if the condition does not hold.
- * <p>
- * Assertion failure exceptions, like most runtime exceptions, are thrown when
- * something is misbehaving. Assertion failures are invariably unspecified
- * behavior; consequently, clients should never rely on these being thrown
- * (and certainly should not being catching them specifically).
- * </p>
- */
-public final class Assert {
-
-	/**
-	 * <code>AssertionFailedException</code> is a runtime exception thrown
-	 * by some of the methods in <code>Assert</code>.
-	 * <p>
-	 * This class is not declared public to prevent some misuses; programs
-	 * that catch or otherwise depend on assertion failures are susceptible to
-	 * unexpected breakage when assertions in the code are added or removed.
-	 * </p>
-	 */
-	static class AssertionFailedException extends RuntimeException {
-		/**
-		 * Comment for <code>serialVersionUID</code>
-		 */
-		private static final long serialVersionUID = 1L;
-
-		/**
-		 * Constructs a new exception.
-		 */
-		public AssertionFailedException() {
-			super();
-		}
-
-		/**
-		 * Constructs a new exception with the given message.
-		 */
-		public AssertionFailedException(String detail) {
-			super(detail);
-		}
-	}
-
-	/**
-	 * Asserts that an argument is legal. If the given boolean is not
-	 * <code>true</code>, an <code>IllegalArgumentException</code> is
-	 * thrown. The given message is included in that exception, to aid
-	 * debugging.
-	 * 
-	 * @param expression
-	 *            the outcode of the check
-	 * @param message
-	 *            the message to include in the exception
-	 * @return <code>true</code> if the check passes (does not return if the
-	 *         check fails)
-	 * @exception IllegalArgumentException
-	 *                if the legality test failed
-	 */
-	public static boolean isLegal(boolean expression, String message) {
-		if (!expression)
-			throw new AssertionFailedException(message);
-		return expression;
-	}
-
-	/**
-	 * Asserts that the given object is not <code>null</code>. If this is
-	 * not the case, some kind of unchecked exception is thrown. The given
-	 * message is included in that exception, to aid debugging.
-	 * 
-	 * @param object
-	 *            the value to test
-	 * @param message
-	 *            the message to include in the exception
-	 * @exception IllegalArgumentException
-	 *                if the object is <code>null</code>
-	 */
-	public static void isNotNull(Object object, String message) {
-		if (object == null) {
-			throw new AssertionFailedException();
-		}
-	}
-
-	/**
-	 * Asserts that the given boolean is <code>true</code>. If this is not
-	 * the case, some kind of unchecked exception is thrown. The given message
-	 * is included in that exception, to aid debugging.
-	 * 
-	 * @param expression
-	 *            the outcode of the check
-	 * @param message
-	 *            the message to include in the exception
-	 * @return <code>true</code> if the check passes (does not return if the
-	 *         check fails)
-	 */
-	public static boolean isTrue(boolean expression, String message) {
-		if (!expression) {
-			throw new AssertionFailedException();
-		}
-		return expression;
-	}
-
-	/* This class is not intended to be instantiated. */
-	private Assert() {
-		super();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedReader.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedReader.java
deleted file mode 100644
index f026bda..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedReader.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.eclipse.wst.sse.core.internal.encoding.util;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.Reader;
-
-/**
- * This is a pretty limited implementation, sort of specific 
- * to the way its used by tokenizers (JFlex). To really 
- * be general purpose, would need more work. 
- *
- */
-
-
-public class BufferedLimitedReader extends BufferedReader {
-	private int limitedCount;
-	private int nRead;
-
-	public BufferedLimitedReader(Reader reader, int size) {
-		super(reader, size);
-		if (reader.markSupported()) {
-			try {
-				mark(size);
-			}
-			catch (IOException e) {
-				// impossible
-				e.printStackTrace();
-			}
-		}
-		limitedCount = size;
-	}
-
-	public int read() throws IOException {
-		int result = 0;
-		nRead++;
-		if (nRead > limitedCount) {
-			result = -1;
-		}
-		else {
-			result = super.read();
-		}
-		return result;
-
-	}
-
-	public int read(char cbuf[], int off, int len) throws IOException {
-		int result = 0;
-		if (nRead + len > limitedCount) {
-			result = -1;
-		}
-		else {
-			result = super.read(cbuf, off, len);
-			nRead = nRead + result;
-		}
-		return result;
-	}
-	
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedStream.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedStream.java
deleted file mode 100644
index 7e20cb9..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedStream.java
+++ /dev/null
@@ -1,79 +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.sse.core.internal.encoding.util;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-public class BufferedLimitedStream extends BufferedInputStream {
-
-	private int limitedCount;
-
-	public BufferedLimitedStream(InputStream inStream, int size) {
-		super(inStream, size);
-		mark(size);
-		try {
-			limitedCount = Math.min(size, inStream.available());
-		} catch (IOException e) {
-			// unlikely
-			limitedCount = 0;
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#available()
-	 */
-	public synchronized int available() throws IOException {
-
-		return limitedCount - pos;
-	}
-
-	/**
-	 * copied down from super class
-	 */
-	private void ensureOpen() throws IOException {
-		if (in == null)
-			throw new IOException("Stream closed"); //$NON-NLS-1$
-	}
-
-	/**
-	 * copied down from super class then, changed to simiulate EOF if goes
-	 * beyond buffered amount
-	 */
-	public synchronized int read() throws IOException {
-		ensureOpen();
-		// for this special stream, indicate "end of file" when buffer is
-		// full
-		if (pos >= limitedCount) {
-			return -1;
-		}
-		return super.read();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#read(byte[], int, int)
-	 */
-	public synchronized int read(byte[] b, int off, int len) throws IOException {
-		// for this special stream, indicate "end of file" when buffer is
-		// full
-		if (pos >= limitedCount) {
-			return -1;
-		}
-		return super.read(b, off, len);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ByteReader.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ByteReader.java
deleted file mode 100644
index e3dc503..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ByteReader.java
+++ /dev/null
@@ -1,109 +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.sse.core.internal.encoding.util;
-
-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) {
-		this.fInputStream = inputStream;
-		if (!inputStream.markSupported()) {
-			throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
-		}
-		this.fBuffer = new byte[size];
-
-	}
-
-	public void close() throws IOException {
-		this.fInputStream.close();
-	}
-
-	public void mark(int readAheadLimit) {
-		this.fInputStream.mark(readAheadLimit);
-	}
-
-	public boolean markSupported() {
-		return true;
-	}
-
-	public int read() throws IOException {
-		int b0 = this.fInputStream.read();
-		return (b0 & 0x00FF);
-	}
-
-	public int read(char ch[], int offset, int length) throws IOException {
-		if (length > this.fBuffer.length) {
-			length = this.fBuffer.length;
-		}
-
-		int count = this.fInputStream.read(this.fBuffer, 0, length);
-
-		for (int i = 0; i < count; i++) {
-			int b0 = this.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 this.fInputStream.available() > 0;
-	}
-
-	public void reset() throws IOException {
-		this.fInputStream.reset();
-	}
-
-	public long skip(long n) throws IOException {
-		return this.fInputStream.skip(n);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/CodedResourcePlugin.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/CodedResourcePlugin.java
deleted file mode 100644
index 32c0b70..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/CodedResourcePlugin.java
+++ /dev/null
@@ -1,55 +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.sse.core.internal.encoding.util;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.encoding.ICodedResourcePlugin;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class CodedResourcePlugin extends Plugin implements ICodedResourcePlugin {
-	//The shared instance.
-	private static CodedResourcePlugin plugin;
-
-	/**
-	 * Returns the shared instance.
-	 */
-	public static CodedResourcePlugin getDefault() {
-		return plugin;
-	}
-
-	/**
-	 * Returns the workspace instance.
-	 */
-	public static IWorkspace getWorkspace() {
-		return ResourcesPlugin.getWorkspace();
-	}
-
-	/**
-	 * The constructor.
-	 */
-	public CodedResourcePlugin() {
-		super();
-		plugin = this;
-	}
-
-	protected void initializeDefaultPluginPreferences() {
-		Preferences prefs = getPluginPreferences();
-		prefs.setDefault(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8, false);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Logger.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Logger.java
deleted file mode 100644
index 1226c04..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Logger.java
+++ /dev/null
@@ -1,158 +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.sse.core.internal.encoding.util;
-
-import java.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.sse.core.internal.encoding"; //$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.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/NullInputStream.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/NullInputStream.java
deleted file mode 100644
index 43f3aa2..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/NullInputStream.java
+++ /dev/null
@@ -1,69 +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.sse.core.internal.encoding.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-
-public class NullInputStream extends InputStream {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#mark(int)
-	 */
-	public synchronized void mark(int readlimit) {
-		// nothing to do
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#markSupported()
-	 */
-	public boolean markSupported() {
-		// we can mark nothing.
-		// and, we are using this Null class specifically for
-		// a "fake" resettable stream.
-		return true;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#read()
-	 */
-	public int read() throws IOException {
-
-		return -1;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#reset()
-	 */
-	public synchronized void reset() throws IOException {
-		// nothing to do
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#skip(long)
-	 */
-	public long skip(long n) throws IOException {
-		return 0;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ResourceBundleHelper.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ResourceBundleHelper.java
deleted file mode 100644
index e57c7ed..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ResourceBundleHelper.java
+++ /dev/null
@@ -1,61 +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.sse.core.internal.encoding.util;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.Platform;
-
-//TODO: rework this with new platform/runtime APIs (if still needed).
-
-public class ResourceBundleHelper {
-
-	public static ResourceBundle getResourceBundle(String resourceURI) throws MalformedURLException, IOException {
-		return getResourceBundle(resourceURI, Locale.getDefault());
-	}
-
-	public static ResourceBundle getResourceBundle(String resourceURI, Locale targetLocale) throws MalformedURLException, IOException {
-		// 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 IllegalArgumentException("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);
-	}
-}
-
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/UnicodeBOMEncodingDetector.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/UnicodeBOMEncodingDetector.java
deleted file mode 100644
index 6cc5194..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/UnicodeBOMEncodingDetector.java
+++ /dev/null
@@ -1,213 +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.sse.core.internal.encoding.util;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.nio.charset.Charset;
-
-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;
-
-
-/**
- * This is a "common function" class to decide if an input stream, is a
- * unicode stream.
- */
-public class UnicodeBOMEncodingDetector implements IResourceCharsetDetector {
-
-	//private static final String UTF_16_CHARSET_NAME = "UTF-16";
-	// //$NON-NLS-1$
-
-	public static class NotEnoughInputForBOMException extends IOException {
-
-		/**
-		 * Default <code>serialVersionUID</code>
-		 */
-		private static final long serialVersionUID = 1L;
-
-		public NotEnoughInputForBOMException() {
-			super();
-		}
-
-		public NotEnoughInputForBOMException(String s) {
-			super(s);
-		}
-
-	}
-
-	private final static byte BB = (byte) 0xBB;
-	private final static byte BF = (byte) 0xBF;
-	private final static byte EF = (byte) 0xEF;
-	private final static byte FE = (byte) -2;
-
-	private final static byte FF = (byte) -1;
-	private static final String UTF_16BE_CHARSET_NAME = "UTF-16BE"; //$NON-NLS-1$
-	private static final String UTF_16LE_CHARSET_NAME = "UTF-16LE"; //$NON-NLS-1$
-
-	private static final String UTF_8_CHARSET_NAME = "UTF-8"; //$NON-NLS-1$
-
-	private InputStream fInputStream = null;
-	private boolean fNoBOMPossible;
-
-	private EncodingMemento checkForBOM(InputStream inputStream) {
-		EncodingMemento result = null;
-
-		try {
-			byte b1 = getNextByte(inputStream);
-			byte b2 = getNextByte(inputStream);
-			if (b1 == FE && b2 == FF) {
-				result = createEncodingMemento(UTF_16BE_CHARSET_NAME);
-				result.setUnicodeStream(true);
-			} else {
-				if (b1 == FF && b2 == FE) {
-					result = createEncodingMemento(UTF_16LE_CHARSET_NAME);
-					result.setUnicodeStream(true);
-				} else {
-					byte b3 = getNextByte((inputStream));
-					if (b1 == EF && b2 == BB && b3 == BF) {
-						result = createEncodingMemento(UTF_8_CHARSET_NAME);
-						result.setUTF83ByteBOMUsed(true);
-					}
-				}
-			}
-		} catch (NotEnoughInputForBOMException e) {
-			// This is sort of unexpected for normal cases, but can occur for
-			// empty
-			// streams. And, this can occur "normally" for non-BOM streams
-			// that
-			// have only two
-			// bytes, and for which those two bytes match the first two bytes
-			// of UTF-8
-			// BOM In any case, we'll simply return null;
-			result = null;
-		} catch (IOException e) {
-			// other errors should be impossible
-			throw new Error(e);
-		}
-
-		return result;
-	}
-
-	private EncodingMemento createEncodingMemento(String javaEncodingName) {
-		EncodingMemento encodingMemento = new EncodingMemento();
-		encodingMemento.setJavaCharsetName(javaEncodingName);
-		String ianaName = Charset.forName(javaEncodingName).name();
-		encodingMemento.setDetectedCharsetName(ianaName);
-		if (javaEncodingName.equals(UTF_8_CHARSET_NAME)) {
-			encodingMemento.setUTF83ByteBOMUsed(true);
-		}
-		return encodingMemento;
-	}
-
-	public String getEncoding() throws IOException {
-
-		return getEncodingMemento().getDetectedCharsetName();
-	}
-
-	/**
-	 * Returns IANA encoding name if BOM detected in stream. If a BOM is
-	 * detected, the stream is left positioned after readying the BOM. If a
-	 * BOM is not detected, the steam is reset.
-	 * 
-	 * 0xFEFF UTF-16, big-endian 0xFFFE UTF-16, little-endian 0xEFBBBF UTF-8
-	 * (BOM is optional)
-	 * 
-	 * @param inputStream -
-	 *            must be a resetable (mark supported) stream so it can be
-	 *            reset, if not BOM encoded stream
-	 * @return String - IANA encodingname (may not work well on 1.3, but 1.4
-	 *         seems to have good support for IANA names)
-	 */
-	public EncodingMemento getEncodingMemento() {
-
-		EncodingMemento result = null;
-		if (!fNoBOMPossible) {
-
-			if (fInputStream == null)
-				throw new IllegalStateException("input must be set before use"); //$NON-NLS-1$
-
-			if (!fInputStream.markSupported()) {
-				throw new IllegalArgumentException("inputStream must be resetable"); //$NON-NLS-1$
-			}
-
-			result = checkForBOM(fInputStream);
-		}
-
-		return result;
-
-	}
-
-	private byte getNextByte(InputStream inputStream) throws IOException {
-
-		int byteCharAsInt = -1;
-		// be sure we won't block
-		if (inputStream.available() > 0) {
-			byteCharAsInt = inputStream.read();
-			byteCharAsInt = byteCharAsInt & 0XFF;
-		}
-		// to avoid confustion over meaning of returned byte,
-		// throw exception if EOF reached.
-		if (byteCharAsInt == -1)
-			throw new NotEnoughInputForBOMException("typically not an error"); //$NON-NLS-1$
-		return (byte) byteCharAsInt;
-	}
-
-	/**
-	 *  
-	 */
-
-	public String getSpecDefaultEncoding() {
-		// There is no default for this case
-		return null;
-	}
-
-	/**
-	 *  
-	 */
-	private void resetAll() {
-		fNoBOMPossible = false;
-		fInputStream = null;
-
-	}
-
-	/**
-	 *  
-	 */
-
-	public void set(InputStream inputStream) {
-		resetAll();
-		fInputStream = inputStream;
-	}
-
-	public void set(IStorage iStorage) throws CoreException {
-		set(new BufferedInputStream(iStorage.getContents(), CodedIO.MAX_BUF_SIZE));
-
-	}
-
-	public void set(Reader reader) {
-		if (reader instanceof ByteReader) {
-			ByteReader byteReader = (ByteReader) reader;
-			fInputStream = byteReader.fInputStream;
-		} else {
-			fNoBOMPossible = true;
-		}
-
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/CharConversionErrorWithDetail.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/CharConversionErrorWithDetail.java
deleted file mode 100644
index 8d5253c..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/CharConversionErrorWithDetail.java
+++ /dev/null
@@ -1,43 +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.sse.core.internal.exceptions;
-
-import java.nio.charset.CharacterCodingException;
-
-
-public class CharConversionErrorWithDetail extends CharacterCodingException {
-	/**
-	 * Comment for <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-	private String fCharsetName;
-
-	public CharConversionErrorWithDetail() {
-		super();
-	}
-
-	/**
-	 * @param s
-	 */
-	public CharConversionErrorWithDetail(String charsetName) {
-		super();
-		fCharsetName = charsetName;
-	}
-
-	/**
-	 * @return Returns the fCharsetName.
-	 */
-	public String getCharsetName() {
-		return fCharsetName;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedInputExceptionWithDetail.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedInputExceptionWithDetail.java
deleted file mode 100644
index 629567d..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedInputExceptionWithDetail.java
+++ /dev/null
@@ -1,103 +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.sse.core.internal.exceptions;
-
-import java.nio.charset.CharacterCodingException;
-
-
-/**
- * Intended to be a more precise form of the MalformedInputException, where
- * character position and attempted encoding can be attempted.
- */
-public class MalformedInputExceptionWithDetail extends CharacterCodingException {
-
-	/**
-	 * Default <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-	private int fCharPosition;
-	private String fDetectedCharsetName;
-	private boolean fExceededMax = false;
-	private String fJavaCharsetName;
-	private int fMaxBuffer;
-
-	/**
-	 * Disallow default constructor. If attemptedEncoding and charPostion can
-	 * not be provided, use one of java's MalformedException.
-	 */
-	protected MalformedInputExceptionWithDetail() {
-		// Nothing to do
-	}
-
-	public MalformedInputExceptionWithDetail(String encodingName, int charPostion) {
-		this.fJavaCharsetName = encodingName;
-		this.fDetectedCharsetName = encodingName;
-		this.fCharPosition = charPostion;
-	}
-
-	public MalformedInputExceptionWithDetail(String attemptedJavaEncoding, String attemptedIANAEncoding, int charPostion) {
-		this.fJavaCharsetName = attemptedJavaEncoding;
-		this.fDetectedCharsetName = attemptedIANAEncoding;
-		this.fCharPosition = charPostion;
-	}
-
-	/**
-	 * If charPosition = -1 this could be because the character position
-	 * exceeded the maximum buffer size, maxBuffer, then exceededMax = true.
-	 */
-	public MalformedInputExceptionWithDetail(String attemptedJavaEncoding, String attemptedIANAEncoding, int charPostion, boolean exceededMax, int maxBuffer) {
-		this.fJavaCharsetName = attemptedJavaEncoding;
-		this.fDetectedCharsetName = attemptedIANAEncoding;
-		this.fCharPosition = charPostion;
-		this.fExceededMax = exceededMax;
-		this.fMaxBuffer = maxBuffer;
-	}
-
-	/**
-	 */
-	public java.lang.String getAttemptedIANAEncoding() {
-		return fDetectedCharsetName;
-	}
-
-	/**
-	 */
-	public java.lang.String getAttemptedJavaEncoding() {
-		return fJavaCharsetName;
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getCharPosition() {
-		return fCharPosition;
-	}
-
-	/**
-	 * Returns the maxBuffer.
-	 * 
-	 * @return int
-	 */
-	public int getMaxBuffer() {
-		return fMaxBuffer;
-	}
-
-	/**
-	 * Returns the exceededMax.
-	 * 
-	 * @return boolean
-	 */
-	public boolean isExceededMax() {
-		return fExceededMax;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedOutputExceptionWithDetail.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedOutputExceptionWithDetail.java
deleted file mode 100644
index 6cf9f7c..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedOutputExceptionWithDetail.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.sse.core.internal.exceptions;
-
-
-public class MalformedOutputExceptionWithDetail extends MalformedInputExceptionWithDetail {
-
-	/**
-	 * Default <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Disallow default constructor. If attemptedEncoding and charPostion can
-	 * not be provided, use sun.io.MalformedException.
-	 */
-	private MalformedOutputExceptionWithDetail() {
-		// default constructor is disallowed, since if
-		// extra info can not be provided, the regular
-		// Malformed exception should be thrown
-	}
-
-	/**
-	 * Constructor for MalformedOutputExceptionWithDetail.
-	 * 
-	 * @param attemptedJavaEncoding
-	 * @param attemptedIANAEncoding
-	 * @param charPostion
-	 */
-	public MalformedOutputExceptionWithDetail(String attemptedJavaEncoding, String attemptedIANAEncoding, int charPostion) {
-		super(attemptedJavaEncoding, attemptedIANAEncoding, charPostion);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/UnsupportedCharsetExceptionWithDetail.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/UnsupportedCharsetExceptionWithDetail.java
deleted file mode 100644
index 7cdc40b..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/UnsupportedCharsetExceptionWithDetail.java
+++ /dev/null
@@ -1,47 +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.sse.core.internal.exceptions;
-
-import java.nio.charset.UnsupportedCharsetException;
-
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-
-
-/**
- * This is intended for same purpose as it super class, but simply provides
- * more information about than the name in error. This is especially useful
- * for "UIs" which can present users with the error, and the
- * "appropriateDefault" that can be used for a particular input.
- */
-public class UnsupportedCharsetExceptionWithDetail extends UnsupportedCharsetException {
-
-	/**
-	 * Default <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-	private EncodingMemento fEncodingMementio;
-
-	public UnsupportedCharsetExceptionWithDetail(EncodingMemento encodingMemento) {
-		this(encodingMemento.getDetectedCharsetName());
-		fEncodingMementio = encodingMemento;
-	}
-
-	protected UnsupportedCharsetExceptionWithDetail(String charsetName) {
-		super(charsetName);
-	}
-
-	public EncodingMemento getEncodingMemento() {
-		return fEncodingMementio;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/IFileTaskScanner.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/IFileTaskScanner.java
deleted file mode 100644
index 79c4780..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/IFileTaskScanner.java
+++ /dev/null
@@ -1,73 +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.sse.core.internal.provisional.tasks;
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-
-/**
- * Scanners for the main Task Scanner. Scanners may be contributed using the
- * org.eclipse.wst.sse.core.taskscanner extension point. For resources and
- * resource deltas with matching content types, the main scanner will first
- * call the startup() method, scan(), and then shutdown() in sequence. Scanner
- * instances will be reused across projects but are not shared per content
- * type. Scanners should not hold on to references to models or resources
- * after shutdown() and should take care not to leak memory or resources.
- */
-public interface IFileTaskScanner {
-	/**
-	 * Marker type ID of task markers that are created, all scanners are
-	 * expected to use this type or subtypes
-	 */
-	String TASK_MARKER_ID = SSECorePlugin.ID + ".task"; //$NON-NLS-1$;
-
-	/**
-	 * Requests that the list of automatically discovered tasks for the given
-	 * file be updated. Once completed, the list of tasks should correspond
-	 * exactly to the file's contents.
-	 * 
-	 * @param file -
-	 *            the file to be scanned
-	 * @param taskTags -
-	 *            the list of task tags for which to scan
-	 * @param monitor -
-	 *            a progress monitor
-	 * @return an array of maps containing the attributes for task markers to
-	 *         be created
-	 */
-	Map[] scan(IFile file, TaskTag[] taskTags, IProgressMonitor monitor);
-
-	/**
-	 * Notifies the scanner that scanning is done for now. Resources held from
-	 * startup should now be released.
-	 * 
-	 * @param project -
-	 *            the project that was just scanned
-	 */
-	void shutdown(IProject project);
-
-	/**
-	 * Notifies the scanner that a sequence of scans is about to be requested.
-	 * Ideally the time to load preferences and perform any expensive
-	 * configuration for the given project.
-	 * 
-	 * @param project -
-	 *            the project that is about to be scanned
-	 * 
-	 */
-	void startup(IProject project);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/TaskTag.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/TaskTag.java
deleted file mode 100644
index cab7258..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/TaskTag.java
+++ /dev/null
@@ -1,52 +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.sse.core.internal.provisional.tasks;
-
-import org.eclipse.core.resources.IMarker;
-
-/**
- * Simple representation of the values that make up a Task Tag
- */
-public final class TaskTag {
-
-	public static final int PRIORITY_HIGH = IMarker.PRIORITY_HIGH;
-	public static final int PRIORITY_LOW = IMarker.PRIORITY_LOW;
-	public static final int PRIORITY_NORMAL = IMarker.PRIORITY_NORMAL;
-
-	/**
-	 * this task tag's priority
-	 */
-	private int fPriority = PRIORITY_NORMAL;
-	
-	/**
-	 * this task tag's "tagging" text
-	 */
-	private String fTag = null;
-
-	public TaskTag(String tag, int priority) {
-		super();
-		fTag = tag;
-		fPriority = priority;
-	}
-
-	public int getPriority() {
-		return fPriority;
-	}
-
-	public String getTag() {
-		return fTag;
-	}
-
-	public String toString() {
-		return getTag() + ":" + getPriority(); //$NON-NLS-1$
-	}
-}
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
deleted file mode 100644
index 69b13b7..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java
+++ /dev/null
@@ -1,183 +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.sse.core.internal.tasks;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.provisional.tasks.IFileTaskScanner;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-
-public class FileTaskScannerRegistryReader {
-	private class ScannerInfo {
-		String fId;
-		IFileTaskScanner fScanner;
-
-		ScannerInfo(String id, IFileTaskScanner scanner) {
-			super();
-			fId = id;
-			fScanner = scanner;
-		}
-
-		public boolean equals(Object obj) {
-			return obj instanceof ScannerInfo && fId.equals(((ScannerInfo) obj).fId);
-		}
-
-		public String getId() {
-			return fId;
-		}
-
-		public IFileTaskScanner getScanner() {
-			return fScanner;
-		}
-	}
-
-	private static FileTaskScannerRegistryReader _instance = null;
-
-	public static FileTaskScannerRegistryReader getInstance() {
-		if (_instance == null) {
-			_instance = new FileTaskScannerRegistryReader();
-		}
-		return _instance;
-	}
-
-	private String ATT_CLASS = "class"; //$NON-NLS-1$
-
-	private String ATT_CONTENT_TYPES = "contentTypeIds"; //$NON-NLS-1$
-
-	private String ATT_ID = "id"; //$NON-NLS-1$
-
-	private IConfigurationElement[] fScannerElements;
-
-	// a mapping from content types to ScannerInfo instances
-	private Map fScannerInfos = null;
-
-	private String NAME_SCANNER = "scanner"; //$NON-NLS-1$
-
-	private String SCANNER_EXTENSION_POINT_ID = SSECorePlugin.ID + ".taskscanner"; //$NON-NLS-1$
-
-	private FileTaskScannerRegistryReader() {
-		super();
-	}
-
-	IFileTaskScanner[] getFileTaskScanners(IContentType[] contentTypes) {
-		if (fScannerElements == null) {
-			readRegistry();
-		}
-
-		List scannerInfos = new ArrayList(1);
-
-		for (int i = 0; i < contentTypes.length; i++) {
-			ScannerInfo[] scannerInfosForContentType = (ScannerInfo[]) fScannerInfos.get(contentTypes[i].getId());
-			if (scannerInfosForContentType == null) {
-				scannerInfosForContentType = loadScanners(contentTypes[i]);
-			}
-			// only add non-duplicate scanners
-			for (int j = 0; j < scannerInfosForContentType.length; j++) {
-				if (!scannerInfos.contains(scannerInfosForContentType[j])) {
-					scannerInfos.add(scannerInfosForContentType[j]);
-				}
-			}
-		}
-		IFileTaskScanner[] scanners = new IFileTaskScanner[scannerInfos.size()];
-		for (int i = 0; i < scanners.length; i++) {
-			scanners[i] = ((ScannerInfo) scannerInfos.get(i)).getScanner();
-		}
-		return scanners;
-	}
-
-	public String[] getSupportedContentTypeIds() {
-		if (fScannerElements == null) {
-			readRegistry();
-		}
-
-		// find the relevant extensions
-		List types = new ArrayList(0);
-		IConfigurationElement[] scannerElements = fScannerElements;
-		for (int j = 0; j < scannerElements.length; j++) {
-			if (!scannerElements[j].getName().equals(NAME_SCANNER))
-				continue;
-			String[] contentTypeIds = StringUtils.unpack(scannerElements[j].getAttribute(ATT_CONTENT_TYPES));
-			for (int i = 0; i < contentTypeIds.length; i++) {
-				if (!types.contains(contentTypeIds[i])) {
-					types.add(contentTypeIds[i]);
-				}
-			}
-		}
-
-		return (String[]) types.toArray(new String[types.size()]);
-	}
-
-	private ScannerInfo[] loadScanners(IContentType contentType) {
-		List elements = new ArrayList(0);
-		ScannerInfo[] scannerInfos = null;
-		IConfigurationElement[] delegateElements = fScannerElements;
-		if (contentType != null) {
-			IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
-			for (int j = 0; j < delegateElements.length; j++) {
-				if (!delegateElements[j].getName().equals(NAME_SCANNER))
-					continue;
-				String[] supportedContentTypeIds = StringUtils.unpack(delegateElements[j].getAttribute(ATT_CONTENT_TYPES));
-				IContentType[] supportedContentTypes = new IContentType[supportedContentTypeIds.length];
-				for (int k = 0; k < supportedContentTypeIds.length; k++) {
-					supportedContentTypes[k] = contentTypeManager.getContentType(supportedContentTypeIds[k].trim());
-				}
-				for (int k = 0; k < supportedContentTypeIds.length; k++) {
-					// allow subtypes to be returned as well
-					if (supportedContentTypes[k] != null && contentType.isKindOf(supportedContentTypes[k])) {
-						elements.add(delegateElements[j]);
-					}
-				}
-			}
-			// instantiate and save the scanners
-			List scannerInfoList = new ArrayList(elements.size());
-			for (int i = 0; i < elements.size(); i++) {
-				try {
-					IFileTaskScanner scanner = (IFileTaskScanner) ((IConfigurationElement) elements.get(i)).createExecutableExtension(ATT_CLASS);
-					if (scanner != null) {
-						scannerInfoList.add(new ScannerInfo(((IConfigurationElement) elements.get(i)).getAttribute(ATT_ID), scanner));
-					}
-				}
-				catch (CoreException e) {
-					Logger.logException("Non-fatal exception creating task scanner for " + contentType.getId(), e); //$NON-NLS-1$
-				}
-			}
-			scannerInfos = (ScannerInfo[]) scannerInfoList.toArray(new ScannerInfo[scannerInfoList.size()]);
-			fScannerInfos.put(contentType.getId(), scannerInfos);
-			if (Logger.DEBUG_TASKSREGISTRY) {
-				System.out.println("Created " + scannerInfos.length + " task scanner for " + contentType.getId()); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-		}
-		return scannerInfos;
-	}
-
-	private void readRegistry() {
-		fScannerInfos = new HashMap();
-		// Just remember the elements, so plugins don't have to be activated,
-		// unless extension attributes match those of interest
-		IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(SCANNER_EXTENSION_POINT_ID);
-		if (point != null) {
-			fScannerElements = point.getConfigurationElements();
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/StructuredFileTaskScanner.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/StructuredFileTaskScanner.java
deleted file mode 100644
index 29e7e17..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/StructuredFileTaskScanner.java
+++ /dev/null
@@ -1,333 +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.sse.core.internal.tasks;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.nio.charset.CharacterCodingException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-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.ResourcesPlugin;
-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.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-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.modelhandler.ModelHandlerRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
-import org.eclipse.wst.sse.core.internal.provisional.tasks.IFileTaskScanner;
-import org.eclipse.wst.sse.core.internal.provisional.tasks.TaskTag;
-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;
-
-/**
- * A delegate to create IMarker.TASKs for "todos" and similiar comments.
- */
-public abstract class StructuredFileTaskScanner implements IFileTaskScanner {
-	// the list of attributes for the new tasks for the current file
-	protected List fNewMarkerAttributeMaps = null;
-
-	List oldMarkers = null;
-	private long time0;
-
-	public StructuredFileTaskScanner() {
-		super();
-		fNewMarkerAttributeMaps = new ArrayList();
-		if (Logger.DEBUG_TASKS) {
-			System.out.println(getClass().getName() + " instance created"); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Returns the attributes with which a newly created marker will be
-	 * initialized. Modified from the method in MarkerRulerAction
-	 * 
-	 * @return the initial marker attributes
-	 */
-	protected Map createInitialMarkerAttributes(String text, int documentLine, int startOffset, int length, int priority) {
-		Map attributes = new HashMap(6);
-		// marker line numbers are 1-based
-		attributes.put(IMarker.LINE_NUMBER, new Integer(documentLine + 1));
-		attributes.put(IMarker.TASK, IFileTaskScanner.TASK_MARKER_ID);
-		attributes.put(IMarker.CHAR_START, new Integer(startOffset));
-		attributes.put(IMarker.CHAR_END, new Integer(startOffset + length));
-		attributes.put(IMarker.MESSAGE, text);
-		attributes.put(IMarker.USER_EDITABLE, Boolean.TRUE);
-		attributes.put("org.eclipse.ui.part.IShowInTarget", new String[]{""}); //$NON-NLS-1$ //$NON-NLS-2$
-
-		switch (priority) {
-			case IMarker.PRIORITY_HIGH : {
-				attributes.put(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_HIGH));
-			}
-				break;
-			case IMarker.PRIORITY_LOW : {
-				attributes.put(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_LOW));
-			}
-				break;
-			default : {
-				attributes.put(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_NORMAL));
-			}
-		}
-
-		return attributes;
-	}
-
-	private String detectCharset(IFile file) {
-		if (file.getType() == IResource.FILE && file.isAccessible()) {
-			IContentDescription d = null;
-			try {
-				// optimized description lookup, might not succeed
-				d = file.getContentDescription();
-				if (d != null)
-					return d.getCharset();
-			}
-			catch (CoreException e) {
-				/*
-				 * should not be possible given the accessible and file type
-				 * check above
-				 */
-			}
-			InputStream contents = null;
-			try {
-				contents = file.getContents();
-				IContentDescription description = Platform.getContentTypeManager().getDescriptionFor(contents, file.getName(), new QualifiedName[]{IContentDescription.CHARSET});
-				if (description != null) {
-					return description.getCharset();
-				}
-			}
-			catch (IOException e) {
-				// will try to cleanup in finally
-			}
-			catch (CoreException e) {
-				Logger.logException(e);
-			}
-			finally {
-				if (contents != null) {
-					try {
-						contents.close();
-					}
-					catch (Exception e) {
-						// not sure how to recover at this point
-					}
-				}
-			}
-		}
-		return ResourcesPlugin.getEncoding();
-	}
-
-	/**
-	 * @param document
-	 * @param documentRegion
-	 * @param comment
-	 */
-	protected void findTasks(IDocument document, TaskTag[] taskTags, IStructuredDocumentRegion documentRegion, ITextRegion comment) {
-		if (isCommentRegion(documentRegion, comment)) {
-			int startOffset = documentRegion.getStartOffset(comment);
-			int endOffset = documentRegion.getTextEndOffset(comment);
-			try {
-				int startLine = document.getLineOfOffset(startOffset);
-				int endLine = document.getLineOfOffset(endOffset);
-				for (int lineNumber = startLine; lineNumber <= endLine; lineNumber++) {
-					IRegion line = document.getLineInformation(lineNumber);
-					int begin = Math.max(startOffset, line.getOffset());
-					int end = Math.min(endOffset, line.getOffset() + line.getLength());
-					int length = end - begin;
-
-					/* XXX: This generates a lot of garbage objects */
-
-					String commentedText = getCommentedText(document, begin, length);
-					String comparisonText = commentedText.toLowerCase(Locale.ENGLISH);
-
-					for (int i = 0; i < taskTags.length; i++) {
-						int tagIndex = comparisonText.indexOf(taskTags[i].getTag().toLowerCase(Locale.ENGLISH));
-						if (tagIndex >= 0) {
-							String markerDescription = commentedText.substring(tagIndex);
-							int markerOffset = begin + tagIndex;
-							int markerLength = end - markerOffset;
-							fNewMarkerAttributeMaps.add(createInitialMarkerAttributes(markerDescription, lineNumber, markerOffset, markerLength, taskTags[i].getPriority()));
-						}
-					}
-				}
-			}
-			catch (BadLocationException e) {
-				Logger.logException(e);
-			}
-		}
-	}
-
-	private void findTasks(IFile file, final TaskTag[] taskTags, IProgressMonitor monitor) {
-		try {
-			IModelHandler handler = ModelHandlerRegistry.getInstance().getHandlerFor(file);
-
-			// records if the optimized streamish parse was possible
-			boolean didStreamParse = false;
-			final IProgressMonitor progressMonitor = monitor;
-			final IEncodedDocument defaultDocument = handler.getDocumentLoader().createNewStructuredDocument();
-			if (defaultDocument instanceof IStructuredDocument) {
-				RegionParser parser = ((IStructuredDocument) defaultDocument).getParser();
-				if (parser instanceof StructuredDocumentRegionParser) {
-					didStreamParse = true;
-					String charset = detectCharset(file);
-					StructuredDocumentRegionParser documentParser = (StructuredDocumentRegionParser) parser;
-					final IDocument textDocument = new Document();
-					setDocumentContent(textDocument, file.getContents(true), charset);
-					documentParser.reset(new DocumentReader(textDocument));
-					documentParser.addStructuredDocumentRegionHandler(new StructuredDocumentRegionHandler() {
-						public void nodeParsed(IStructuredDocumentRegion documentRegion) {
-							ITextRegionList regions = documentRegion.getRegions();
-							for (int j = 0; j < regions.size(); j++) {
-								ITextRegion comment = regions.get(j);
-								findTasks(textDocument, taskTags, documentRegion, comment);
-							}
-							// disconnect the document regions
-							if (documentRegion.getPrevious() != null) {
-								documentRegion.getPrevious().setPrevious(null);
-								documentRegion.getPrevious().setNext(null);
-							}
-							if (progressMonitor.isCanceled()) {
-								textDocument.set(""); //$NON-NLS-1$
-							}
-						}
-
-						public void resetNodes() {
-						}
-					});
-					documentParser.getDocumentRegions();
-				}
-			}
-			if (!didStreamParse) {
-				// Use a StructuredDocument
-				IEncodedDocument document = handler.getDocumentLoader().createNewStructuredDocument(file);
-				if (document instanceof IStructuredDocument) {
-					IStructuredDocumentRegion documentRegion = ((IStructuredDocument) document).getFirstStructuredDocumentRegion();
-					while (documentRegion != null) {
-						ITextRegionList regions = documentRegion.getRegions();
-						for (int j = 0; j < regions.size(); j++) {
-							ITextRegion comment = regions.get(j);
-							findTasks(document, taskTags, documentRegion, comment);
-						}
-						documentRegion = documentRegion.getNext();
-					}
-				}
-			}
-		}
-		catch (CoreException e) {
-			Logger.logException("Exception with " + file.getFullPath().toString(), e); //$NON-NLS-1$
-		}
-		catch (CharacterCodingException e) {
-			Logger.log(Logger.INFO, "StructuredFileTaskScanner encountered CharacterCodingException reading " + file.getLocation()); //$NON-NLS-1$
-		}
-		catch (Exception e) {
-			Logger.logException("Exception with " + file.getFullPath().toString(), e); //$NON-NLS-1$
-		}
-	}
-
-	protected String getCommentedText(IDocument document, int begin, int length) throws BadLocationException {
-		return document.get(begin, length);
-	}
-
-	protected abstract boolean isCommentRegion(IStructuredDocumentRegion region, ITextRegion textRegion);
-
-	public synchronized Map[] scan(IFile file, TaskTag[] taskTags, IProgressMonitor monitor) {
-		fNewMarkerAttributeMaps.clear();
-		if (monitor.isCanceled() || !shouldScan(file)) {
-			return new Map[0];
-		}
-		if (Logger.DEBUG_TASKSPERF) {
-			time0 = System.currentTimeMillis();
-		}
-		if (taskTags.length > 0) {
-			findTasks(file, taskTags, monitor);
-		}
-		if (Logger.DEBUG_TASKSPERF) {
-			System.out.println("" + (System.currentTimeMillis() - time0) + "ms for " + file.getLocation()); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		return (Map[]) fNewMarkerAttributeMaps.toArray(new Map[fNewMarkerAttributeMaps.size()]);
-	}
-
-	/**
-	 * Sets the document content from this stream and closes the stream
-	 */
-	protected void setDocumentContent(IDocument document, InputStream contentStream, String charset) {
-		Reader in = null;
-		try {
-			in = new BufferedReader(new InputStreamReader(contentStream, charset), 2048);
-			StringBuffer buffer = new StringBuffer(2048);
-			char[] readBuffer = new char[2048];
-			int n = in.read(readBuffer);
-			while (n > 0) {
-				buffer.append(readBuffer, 0, n);
-				n = in.read(readBuffer);
-			}
-			document.set(buffer.toString());
-		}
-		catch (IOException x) {
-		}
-		finally {
-			if (in != null) {
-				try {
-					in.close();
-				}
-				catch (IOException x) {
-				}
-			}
-		}
-	}
-
-	boolean shouldScan(IResource r) {
-		// skip "dot" files
-		String s = r.getName();
-		return s.length() == 0 || s.charAt(0) != '.';
-	}
-
-	public void shutdown(IProject project) {
-		if (Logger.DEBUG_TASKS) {
-			System.out.println(this + " shutdown for " + project.getName()); //$NON-NLS-1$
-		}
-	}
-
-	public void startup(IProject project) {
-		if (Logger.DEBUG_TASKS) {
-			System.out.println(this + " startup for " + project.getName()); //$NON-NLS-1$
-		}
-		if (Logger.DEBUG_TASKSPERF) {
-			time0 = System.currentTimeMillis();
-		}
-		if (Logger.DEBUG_TASKSPERF) {
-			System.out.println("" + (System.currentTimeMillis() - time0) + "ms loading prefs for " + project.getName()); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-}
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
deleted file mode 100644
index 479be62..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java
+++ /dev/null
@@ -1,222 +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.sse.core.internal.tasks;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.SSECoreMessages;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.osgi.framework.Bundle;
-
-/**
- * Queueing Job for processing deltas and projects.
- */
-class TaskScanningJob extends Job {
-	static final int JOB_DELAY_DELTA = 500;
-	private static final int JOB_DELAY_PROJECT = 1000;
-	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$
-
-	TaskScanningJob() {
-		super(SSECoreMessages.TaskScanner_0);
-		fQueue = new ArrayList();
-		setPriority(Job.DECORATE);
-		setSystem(false);
-
-		SSECorePlugin.getDefault().getPluginPreferences().setDefault(TASK_TAG_PROJECTS_ALREADY_SCANNED, ""); //$NON-NLS-1$
-	}
-
-	synchronized void addDelta(IResourceDelta delta) {
-		fQueue.add(delta);
-		if (Logger.DEBUG_TASKSJOB) {
-			String kind = null;
-			switch (delta.getKind()) {
-				case IResourceDelta.ADDED :
-					kind = " [IResourceDelta.ADDED]"; //$NON-NLS-1$
-					break;
-				case IResourceDelta.CHANGED :
-					kind = " [IResourceDelta.CHANGED]"; //$NON-NLS-1$
-					break;
-				case IResourceDelta.REMOVED :
-					kind = " [IResourceDelta.REMOVED]"; //$NON-NLS-1$
-					break;
-				case IResourceDelta.ADDED_PHANTOM :
-					kind = " [IResourceDelta.ADDED_PHANTOM]"; //$NON-NLS-1$
-					break;
-				case IResourceDelta.REMOVED_PHANTOM :
-					kind = " [IResourceDelta.REMOVED_PHANTOM]"; //$NON-NLS-1$
-					break;
-			}
-			System.out.println("Adding delta " + delta.getFullPath() + kind); //$NON-NLS-1$
-		}
-		schedule(JOB_DELAY_DELTA);
-	}
-
-	synchronized void addProject(IProject project) {
-		if (isEnabledProject(project)) {
-			fQueue.add(project);
-			if (Logger.DEBUG_TASKSJOB) {
-				System.out.println("Adding project " + project.getName()); //$NON-NLS-1$
-			}
-			schedule(JOB_DELAY_PROJECT);
-		}
-	}
-
-	/**
-	 * 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.isRunning() || Platform.getBundle(OSGI_FRAMEWORK_ID).getState() == Bundle.STOPPING;
-		if (Logger.DEBUG_TASKSJOB && shuttingDown) {
-			System.out.println("TaskScanningJob: system is shutting down!"); //$NON-NLS-1$
-		}
-		return shuttingDown;
-	}
-
-	private boolean isEnabledProject(IResource project) {
-		String[] projectsScanned = StringUtils.unpack(SSECorePlugin.getDefault().getPluginPreferences().getString(TASK_TAG_PROJECTS_ALREADY_SCANNED));
-
-		boolean shouldScan = true;
-		String name = project.getName();
-		for (int j = 0; shouldScan && j < projectsScanned.length; j++) {
-			if (projectsScanned[j].equals(name)) {
-				if (Logger.DEBUG_TASKSJOB)
-					System.out.println("Scanning Job skipping " + project.getName()); //$NON-NLS-1$
-				shouldScan = false;
-			}
-		}
-		return shouldScan;
-	}
-
-	synchronized List retrieveQueue() {
-		List queue = fQueue;
-		fQueue = new ArrayList();
-		return queue;
-	}
-
-	protected IStatus run(IProgressMonitor monitor) {
-		if (frameworkIsShuttingDown())
-			return Status.CANCEL_STATUS;
-
-		validateRememberedProjectList(TASK_TAG_PROJECTS_ALREADY_SCANNED);
-
-		IStatus status = null;
-		List currentQueue = retrieveQueue();
-		List errors = null;
-		int ticks = currentQueue.size();
-		String taskName = null;
-		if (Logger.DEBUG_TASKSJOB) {
-			taskName = "Scanning (" + ticks + " work items)"; //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		else {
-			taskName = SSECoreMessages.TaskScanningJob_0;
-		}
-		monitor.beginTask(taskName, ticks);
-
-		IProgressMonitor scanMonitor = null;
-		while (!currentQueue.isEmpty()) {
-			Object o = currentQueue.remove(0);
-			if (frameworkIsShuttingDown())
-				return Status.CANCEL_STATUS;
-			try {
-				scanMonitor = new SubProgressMonitor(monitor, 1);
-				if (o instanceof IResourceDelta) {
-					WorkspaceTaskScanner.getInstance().scan((IResourceDelta) o, scanMonitor);
-				}
-				else if (o instanceof IProject) {
-					WorkspaceTaskScanner.getInstance().scan((IProject) o, scanMonitor);
-					String[] projectsPreviouslyScanned = StringUtils.unpack(SSECorePlugin.getDefault().getPluginPreferences().getString(TASK_TAG_PROJECTS_ALREADY_SCANNED));
-					String[] updatedProjects = new String[projectsPreviouslyScanned.length + 1];
-					updatedProjects[projectsPreviouslyScanned.length] = ((IResource) o).getName();
-					System.arraycopy(projectsPreviouslyScanned, 0, updatedProjects, 0, projectsPreviouslyScanned.length);
-					SSECorePlugin.getDefault().getPluginPreferences().setValue(TASK_TAG_PROJECTS_ALREADY_SCANNED, StringUtils.pack(updatedProjects));
-				}
-			}
-			catch (Exception e) {
-				if (errors == null) {
-					errors = new ArrayList();
-				}
-				errors.add(new Status(IStatus.ERROR, SSECorePlugin.ID, IStatus.ERROR, "", e)); //$NON-NLS-1$
-			}
-		}
-		monitor.done();
-
-		if (errors == null || errors.isEmpty()) {
-			status = Status.OK_STATUS;
-		}
-		else {
-			if (errors.size() == 1) {
-				status = (IStatus) errors.get(0);
-			}
-			else {
-				IStatus[] statii = (IStatus[]) errors.toArray(new IStatus[errors.size()]);
-				status = new MultiStatus(SSECorePlugin.ID, IStatus.ERROR, statii, SSECoreMessages.TaskScanningJob_1, null);
-			}
-		}
-
-		SSECorePlugin.getDefault().savePluginPreferences();
-		return status;
-	}
-
-	private void validateRememberedProjectList(String preferenceName) {
-		String[] rememberedProjectNames = StringUtils.unpack(SSECorePlugin.getDefault().getPluginPreferences().getString(preferenceName));
-		IResource[] workspaceProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
-		String[] projectNames = new String[workspaceProjects.length];
-		for (int i = 0; i < projectNames.length; i++) {
-			projectNames[i] = workspaceProjects[i].getName();
-		}
-
-		List projectNamesToRemember = new ArrayList(rememberedProjectNames.length);
-		for (int i = 0; i < rememberedProjectNames.length; i++) {
-			boolean rememberedProjectExists = false;
-			for (int j = 0; !rememberedProjectExists && j < projectNames.length; j++) {
-				if (rememberedProjectNames[i].equals(projectNames[j])) {
-					rememberedProjectExists = true;
-				}
-			}
-			if (rememberedProjectExists) {
-				projectNamesToRemember.add(rememberedProjectNames[i]);
-			}
-			else if (Logger.DEBUG_TASKSJOB) {
-				System.out.println("Removing " + rememberedProjectNames[i] + " removed from " + preferenceName); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-		}
-
-		if (projectNamesToRemember.size() != rememberedProjectNames.length) {
-			SSECorePlugin.getDefault().getPluginPreferences().setValue(preferenceName, StringUtils.pack((String[]) projectNamesToRemember.toArray(new String[projectNamesToRemember.size()])));
-		}
-	}
-}
\ No newline at end of file
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
deleted file mode 100644
index ec581ea..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java
+++ /dev/null
@@ -1,133 +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.sse.core.internal.tasks;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-
-public class TaskScanningScheduler {
-	private class ListenerVisitor implements IResourceChangeListener, IResourceDeltaVisitor {
-		public void resourceChanged(IResourceChangeEvent event) {
-			IResourceDelta delta = event.getDelta();
-			if (delta.getResource() != null) {
-				int resourceType = delta.getResource().getType();
-				if (resourceType == IResource.PROJECT || resourceType == IResource.ROOT) {
-					try {
-						delta.accept(this);
-					}
-					catch (CoreException e) {
-						Logger.logException("Exception handling resource change", e); //$NON-NLS-1$
-					}
-				}
-			}
-		}
-
-		public boolean visit(IResourceDelta delta) throws CoreException {
-			if ((delta.getKind() & IResourceDelta.MARKERS) > 0 || (delta.getKind() & IResourceDelta.ENCODING) > 0 || (delta.getKind() & IResourceDelta.NO_CHANGE) > 0)
-				return false;
-
-			IResource resource = delta.getResource();
-			if (resource != null) {
-				if (resource.getType() == IResource.ROOT)
-					return true;
-				else if (resource.getType() == IResource.PROJECT) {
-					fJob.addDelta(delta);
-					return false;
-				}
-			}
-			return false;
-		}
-
-	}
-
-	private static TaskScanningScheduler scheduler;
-
-	public static void refresh() {
-		SSECorePlugin.getDefault().getPluginPreferences().setValue(TaskScanningJob.TASK_TAG_PROJECTS_ALREADY_SCANNED, ""); //$NON-NLS-1$
-		scheduler.enqueue(ResourcesPlugin.getWorkspace().getRoot());
-	}
-
-	public static void refresh(IProject project) {
-		String[] projectNames = StringUtils.unpack(SSECorePlugin.getDefault().getPluginPreferences().getString(TaskScanningJob.TASK_TAG_PROJECTS_ALREADY_SCANNED)); //$NON-NLS-1$
-		List freshProjectList = new ArrayList();
-		for (int i = 0; i < projectNames.length; i++) {
-			if (!projectNames[i].equals(project.getName())) {
-				freshProjectList.add(projectNames[i]);
-			}
-		}
-		String freshProjects = StringUtils.pack((String[]) freshProjectList.toArray(new String[freshProjectList.size()]));
-		SSECorePlugin.getDefault().getPluginPreferences().setValue(TaskScanningJob.TASK_TAG_PROJECTS_ALREADY_SCANNED, freshProjects); //$NON-NLS-1$
-
-		scheduler.enqueue(project);
-	}
-
-
-	/**
-	 * Only for use by SSECorePlugin class
-	 */
-	public static void shutdown() {
-		if (scheduler != null) {
-			scheduler.fJob.cancel();
-			ResourcesPlugin.getWorkspace().removeResourceChangeListener(scheduler.visitor);
-		}
-	}
-
-	/**
-	 * Only for use by SSECorePlugin class
-	 */
-	public static void startup() {
-		scheduler = new TaskScanningScheduler();
-
-		/*
-		 * According to
-		 * http://www.eclipse.org/eclipse/development/performance/bloopers.html,
-		 * POST_CHANGE listeners add a trivial performance cost
-		 */
-		ResourcesPlugin.getWorkspace().addResourceChangeListener(scheduler.visitor, IResourceChangeEvent.POST_CHANGE);
-
-		scheduler.enqueue(ResourcesPlugin.getWorkspace().getRoot());
-	}
-
-	TaskScanningJob fJob = null;
-
-	ListenerVisitor visitor = null;
-
-	private TaskScanningScheduler() {
-		super();
-		fJob = new TaskScanningJob();
-		visitor = new ListenerVisitor();
-	}
-
-	void enqueue(IProject project) {
-		fJob.addProject(project);
-	}
-
-	void enqueue(IWorkspaceRoot root) {
-		IProject[] allProjects = root.getProjects();
-		for (int i = 0; i < allProjects.length; i++) {
-			fJob.addProject(allProjects[i]);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskTagPreferenceKeys.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskTagPreferenceKeys.java
deleted file mode 100644
index bb3e305..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskTagPreferenceKeys.java
+++ /dev/null
@@ -1,24 +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.sse.core.internal.tasks;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-
-public final class TaskTagPreferenceKeys {
-	public static final String TASK_TAG_CONTENTTYPES_IGNORED = "ignored-contentTypes"; //$NON-NLS-1$
-	public static final String TASK_TAG_ENABLE = "enabled"; //$NON-NLS-1$
-	public static final String TASK_TAG_NODE = SSECorePlugin.ID + IPath.SEPARATOR + "task-tags"; //$NON-NLS-1$
-	public static final String TASK_TAG_PER_PROJECT = "use-project-settings"; //$NON-NLS-1$
-	public static final String TASK_TAG_PRIORITIES = "taskPriorities"; //$NON-NLS-1$
-	public static final String TASK_TAG_TAGS = "taskTags"; //$NON-NLS-1$
-}
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
deleted file mode 100644
index 5499867..0000000
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java
+++ /dev/null
@@ -1,433 +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.sse.core.internal.tasks;
-
-import java.util.ArrayList;
-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.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-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.SubProgressMonitor;
-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.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.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.tasks.IFileTaskScanner;
-import org.eclipse.wst.sse.core.internal.provisional.tasks.TaskTag;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-
-/**
- * Dispatcher for scanning based on deltas and requested projects
- */
-class WorkspaceTaskScanner {
-	private static WorkspaceTaskScanner _instance = null;
-
-	static synchronized WorkspaceTaskScanner getInstance() {
-		if (_instance == null) {
-			_instance = new WorkspaceTaskScanner();
-		}
-		return _instance;
-	}
-
-	final String DEFAULT_MARKER_TYPE = IFileTaskScanner.TASK_MARKER_ID;
-	private List fActiveScanners = null;
-	private IContentType[] fCurrentIgnoreContentTypes = null;
-	private TaskTag[] fCurrentTaskTags = null;
-
-	private FileTaskScannerRegistryReader registry = null;
-
-	private long time0;
-
-	/**
-	 * 
-	 */
-	private WorkspaceTaskScanner() {
-		super();
-		registry = FileTaskScannerRegistryReader.getInstance();
-		fActiveScanners = new ArrayList();
-		fCurrentTaskTags = new TaskTag[0];
-		fCurrentIgnoreContentTypes = new IContentType[0];
-	}
-
-	private IContentType[] detectContentTypes(IResource resource) {
-		IContentType[] types = null;
-		if (resource.getType() == IResource.FILE && resource.isAccessible()) {
-			types = Platform.getContentTypeManager().findContentTypesFor(resource.getName());
-			if (types.length == 0) {
-				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
-					 */
-				}
-			}
-			if (types == null) {
-				types = Platform.getContentTypeManager().findContentTypesFor(resource.getName());
-			}
-			if (Logger.DEBUG_TASKSCONTENTTYPE) {
-				if (types.length > 0) {
-					if (types.length > 1) {
-						System.out.println(resource.getFullPath() + ": " + "multiple based on name (probably hierarchical)"); //$NON-NLS-1$ //$NON-NLS-2$
-					}
-					for (int i = 0; i < types.length; i++) {
-						System.out.println(resource.getFullPath() + " matched: " + types[i].getId()); //$NON-NLS-1$
-					}
-				}
-			}
-		}
-		return types;
-	}
-
-	/**
-	 * @param resource
-	 * @return
-	 */
-	private IProject getProject(IResource resource) {
-		IProject project = null;
-		if (resource.getType() == IResource.PROJECT) {
-			project = (IProject) resource;
-		}
-		else {
-			project = resource.getProject();
-		}
-		return project;
-	}
-
-	private boolean init(IResource resource) {
-		IProject project = getProject(resource);
-
-		IPreferencesService preferencesService = Platform.getPreferencesService();
-		IScopeContext[] lookupOrder = new IScopeContext[]{new ProjectScope(project), new InstanceScope(), new DefaultScope()};
-
-		boolean proceed = preferencesService.getBoolean(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_ENABLE, false, lookupOrder);
-
-		if (Logger.DEBUG_TASKSPREFS) {
-			System.out.println(getClass().getName() + " scan of " + resource.getFullPath() + ":" + proceed); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		if (proceed) {
-			String[] tags = StringUtils.unpack(preferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_TAGS, null, lookupOrder));
-			String[] priorities = StringUtils.unpack(preferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, null, lookupOrder));
-			String[] currentIgnoreContentTypeIDs = StringUtils.unpack(preferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, null, lookupOrder));
-			if (Logger.DEBUG_TASKSPREFS) {
-				System.out.print(getClass().getName() + " tags: "); //$NON-NLS-1$
-				for (int i = 0; i < tags.length; i++) {
-					if (i > 0) {
-						System.out.print(","); //$NON-NLS-1$
-					}
-					System.out.print(tags[i]);
-				}
-				System.out.println();
-				System.out.print(getClass().getName() + " priorities: "); //$NON-NLS-1$
-				for (int i = 0; i < priorities.length; i++) {
-					if (i > 0) {
-						System.out.print(","); //$NON-NLS-1$
-					}
-					System.out.print(priorities[i]);
-				}
-				System.out.println();
-				System.out.print(getClass().getName() + " ignored content types: "); //$NON-NLS-1$
-				for (int i = 0; i < currentIgnoreContentTypeIDs.length; i++) {
-					if (i > 0) {
-						System.out.print(","); //$NON-NLS-1$
-					}
-					System.out.print(currentIgnoreContentTypeIDs[i]);
-				}
-				System.out.println();
-			}
-			fCurrentIgnoreContentTypes = new IContentType[currentIgnoreContentTypeIDs.length];
-			IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
-			for (int i = 0; i < currentIgnoreContentTypeIDs.length; i++) {
-				fCurrentIgnoreContentTypes[i] = contentTypeManager.getContentType(currentIgnoreContentTypeIDs[i]);
-			}
-			int max = Math.min(tags.length, priorities.length);
-			fCurrentTaskTags = new TaskTag[max];
-			for (int i = 0; i < max; i++) {
-				int priority = TaskTag.PRIORITY_NORMAL;
-				try {
-					priority = Integer.parseInt(priorities[i]);
-				}
-				catch (NumberFormatException e) {
-					// default to normal priority
-				}
-				fCurrentTaskTags[i] = new TaskTag(tags[i], priority);
-			}
-		}
-		return proceed;
-	}
-
-	void internalScan(final IProject project, final IResource resource, final IProgressMonitor scanMonitor) {
-		if (scanMonitor.isCanceled())
-			return;
-		try {
-			String name = resource.getName();
-			if (resource.isAccessible() && !resource.isDerived() && !resource.isPhantom() && !resource.isTeamPrivateMember() && name.length() != 0 && name.charAt(0) != '.') {
-				if ((resource.getType() & IResource.FOLDER) > 0 || (resource.getType() & IResource.PROJECT) > 0) {
-					SubProgressMonitor childMonitor = new SubProgressMonitor(scanMonitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
-					IResource[] children = ((IContainer) resource).members();
-					childMonitor.beginTask("", children.length); //$NON-NLS-1$
-					for (int i = 0; i < children.length; i++) {
-						internalScan(project, children[i], childMonitor);
-					}
-					childMonitor.done();
-				}
-				else if ((resource.getType() & IResource.FILE) > 0) {
-					scanFile(project, fCurrentTaskTags, (IFile) resource, scanMonitor);
-					scanMonitor.worked(1);
-				}
-			}
-			else {
-				scanMonitor.worked(1);
-
-			}
-			scanMonitor.done();
-		}
-		catch (CoreException e) {
-			Logger.logException(e);
-		}
-	}
-
-	void internalScan(IResourceDelta delta, final IProgressMonitor monitor) {
-		if (monitor.isCanceled())
-			return;
-		try {
-			String name = delta.getFullPath().lastSegment();
-			IResource resource = delta.getResource();
-			if (!resource.isDerived() && !resource.isPhantom() && !resource.isTeamPrivateMember() && name.length() != 0 && name.charAt(0) != '.') {
-				if ((resource.getType() & IResource.FOLDER) > 0 || (resource.getType() & IResource.PROJECT) > 0) {
-					IResourceDelta[] children = delta.getAffectedChildren();
-					if (name.length() != 0 && name.charAt(0) != '.' && children.length > 0) {
-						SubProgressMonitor childMonitor = new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
-						childMonitor.beginTask("", children.length); //$NON-NLS-1$
-						for (int i = children.length - 1; i >= 0; i--) {
-							internalScan(children[i], new SubProgressMonitor(childMonitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
-						}
-						childMonitor.done();
-					}
-					else {
-						monitor.worked(1);
-					}
-				}
-				else if ((resource.getType() & IResource.FILE) > 0) {
-					if ((delta.getKind() & IResourceDelta.ADDED) > 0 || ((delta.getKind() & IResourceDelta.CHANGED) > 0 && (delta.getFlags() & IResourceDelta.CONTENT) > 0)) {
-						IFile file = (IFile) resource;
-						scanFile(file.getProject(), fCurrentTaskTags, file, monitor);
-					}
-					monitor.worked(1);
-				}
-			}
-			else {
-				monitor.worked(1);
-			}
-		}
-		catch (Exception e) {
-			monitor.done();
-			Logger.logException(e);
-		}
-	}
-
-	private void replaceTaskMarkers(final IFile file, final Map markerAttributes[], IProgressMonitor monitor) {
-		final IFile finalFile = file;
-		if (file.isAccessible()) {
-			try {
-				IWorkspaceRunnable r = new IWorkspaceRunnable() {
-					public void run(IProgressMonitor progressMonitor) throws CoreException {
-						try {
-							/*
-							 * Delete old Task markers (don't delete regular
-							 * Tasks since that includes user-defined ones
-							 */
-							file.deleteMarkers(DEFAULT_MARKER_TYPE, true, IResource.DEPTH_ZERO);
-						}
-						catch (CoreException e) {
-							Logger.logException("exception deleting old tasks", e); //$NON-NLS-1$ 
-						}
-						if (markerAttributes != null && markerAttributes.length > 0) {
-							if (Logger.DEBUG_TASKS) {
-								System.out.println("" + markerAttributes.length + " tasks for " + file.getFullPath()); //$NON-NLS-1$ //$NON-NLS-2$
-							}
-							for (int i = 0; i < markerAttributes.length; i++) {
-								String specifiedMarkerType = (String) markerAttributes[i].get(IMarker.TASK);
-								IMarker marker = finalFile.createMarker(specifiedMarkerType != null ? specifiedMarkerType : DEFAULT_MARKER_TYPE);
-								marker.setAttributes(markerAttributes[i]);
-							}
-						}
-					}
-				};
-				if(file.isAccessible()) {
-					finalFile.getWorkspace().run(r, file, IWorkspace.AVOID_UPDATE, monitor);
-				}
-			}
-			catch (CoreException e1) {
-				Logger.logException(e1);
-			}
-		}
-	}
-
-	void scan(final IProject project, final IProgressMonitor scanMonitor) {
-		if (scanMonitor.isCanceled())
-			return;
-		if (Logger.DEBUG_TASKS) {
-			System.out.println(getClass().getName() + " scanning project " + project.getName()); //$NON-NLS-1$
-		}
-		if (!project.isAccessible()) {
-			if (Logger.DEBUG_TASKS) {
-				System.out.println(getClass().getName() + " skipping inaccessible project " + project.getName()); //$NON-NLS-1$
-			}
-			return;
-		}
-
-		if (Logger.DEBUG_TASKSOVERALLPERF) {
-			time0 = System.currentTimeMillis();
-		}
-		try {
-			scanMonitor.beginTask("", project.members().length); //$NON-NLS-1$
-			if (init(project)) {
-				internalScan(project, project, scanMonitor);
-				shutdownDelegates(project);
-			}
-			scanMonitor.done();
-		}
-		catch (CoreException e) {
-			Logger.logException(e);
-		}
-		if (Logger.DEBUG_TASKSOVERALLPERF) {
-			System.out.println("" + (System.currentTimeMillis() - time0) + "ms for " + project.getFullPath()); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-
-
-	void scan(IResourceDelta delta, final IProgressMonitor monitor) {
-		if (monitor.isCanceled())
-			return;
-		if (Logger.DEBUG_TASKSOVERALLPERF) {
-			time0 = System.currentTimeMillis();
-		}
-		monitor.beginTask("", 1); //$NON-NLS-1$
-		if (init(delta.getResource())) {
-			internalScan(delta, monitor);
-			shutdownDelegates(delta.getResource().getProject());
-		}
-		monitor.done();
-		if (Logger.DEBUG_TASKSOVERALLPERF) {
-			System.out.println("" + (System.currentTimeMillis() - time0) + "ms for " + delta.getFullPath()); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-
-	void scanFile(IProject project, TaskTag[] taskTags, IFile file, IProgressMonitor monitor) {
-		if (monitor.isCanceled())
-			return;
-
-		SubProgressMonitor scannerMonitor = new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
-		List markerAttributes = null;
-		IContentType[] types = detectContentTypes(file);
-		IFileTaskScanner[] fileScanners = null;
-		if (types != null) {
-			if (fCurrentIgnoreContentTypes.length == 0) {
-				fileScanners = registry.getFileTaskScanners(types);
-			}
-			else {
-				List validTypes = new ArrayList();
-				// obtain a filtered list of delegates
-				for (int i = 0; i < types.length; i++) {
-					boolean ignoreContentType = false;
-					for (int j = 0; j < fCurrentIgnoreContentTypes.length; j++) {
-						ignoreContentType = ignoreContentType || types[i].isKindOf(fCurrentIgnoreContentTypes[j]);
-					}
-					if (!ignoreContentType) {
-						validTypes.add(types[i]);
-					}
-				}
-				fileScanners = registry.getFileTaskScanners((IContentType[]) validTypes.toArray(new IContentType[validTypes.size()]));
-			}
-			if (fileScanners.length > 0) {
-				for (int j = 0; fileScanners != null && j < fileScanners.length; j++) {
-					if (scannerMonitor.isCanceled())
-						continue;
-					scannerMonitor.beginTask(file.getFullPath().toString(), fileScanners.length); //$NON-NLS-1$
-					try {
-						if (!fActiveScanners.contains(fileScanners[j]) && !monitor.isCanceled()) {
-							fileScanners[j].startup(file.getProject());
-							fActiveScanners.add(fileScanners[j]);
-						}
-						Map[] taskMarkerAttributes = fileScanners[j].scan(file, taskTags, scannerMonitor);
-						/*
-						 * TODO: pool the marker results so there's only one
-						 * operation creating them
-						 */
-						for (int i = 0; i < taskMarkerAttributes.length; i++) {
-							if (markerAttributes == null) {
-								markerAttributes = new ArrayList();
-							}
-							markerAttributes.add(taskMarkerAttributes[i]);
-						}
-						scannerMonitor.worked(1);
-					}
-					catch (Exception e) {
-						Logger.logException(file.getFullPath().toString(), e);
-					}
-				}
-				scannerMonitor.done();
-			}
-			else {
-				monitor.worked(1);
-			}
-		}
-		if (monitor.isCanceled())
-			return;
-		// only update markers if we ran a scanner on this file
-		if (fileScanners != null && fileScanners.length > 0) {
-			if (markerAttributes != null) {
-				replaceTaskMarkers(file, (Map[]) markerAttributes.toArray(new Map[markerAttributes.size()]), monitor);
-			}
-			else {
-				replaceTaskMarkers(file, null, monitor);
-			}
-		}
-	}
-
-	private void shutdownDelegates(IProject project) {
-		for (int j = 0; j < fActiveScanners.size(); j++) {
-			try {
-				((IFileTaskScanner) fActiveScanners.get(j)).shutdown(project);
-			}
-			catch (Exception e) {
-				Logger.logException(project.getFullPath().toString(), e);
-			}
-		}
-		fActiveScanners = new ArrayList(1);
-	}
-}
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
deleted file mode 100644
index 7eb7a45..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java
+++ /dev/null
@@ -1,688 +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.sse.core.internal;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.IFileBuffer;
-import org.eclipse.core.filebuffers.IFileBufferListener;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-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.ResourcesPlugin;
-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.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jface.text.IDocument;
-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.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel;
-import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-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;
-
-
-public class FileBufferModelManager {
-
-	static class DocumentInfo {
-		/**
-		 * The ITextFileBuffer
-		 */
-		ITextFileBuffer buffer = null;
-
-		/**
-		 * The platform content-type ID of this document
-		 */
-		String contentTypeID = null;
-
-		/**
-		 * The IStructureModel containing this document; might be null at
-		 * points in the ITextFileBuffer's lifecycle
-		 */
-		IStructuredModel model = null;
-
-		/**
-		 * Whether FileBufferModelManager called connect() for this
-		 * DocumentInfo's text filebuffer
-		 */
-		boolean selfConnected = false;
-
-		int bufferReferenceCount = 0;
-		int modelReferenceCount = 0;
-	}
-
-	/**
-	 * A URIResolver instance of models built on java.io.Files
-	 */
-	class ExternalURIResolver implements URIResolver {
-		IPath fLocation;
-
-		ExternalURIResolver(IPath location) {
-			fLocation = location;
-		}
-
-		public String getFileBaseLocation() {
-			return fLocation.toString();
-		}
-
-		public String getLocationByURI(String uri) {
-			return getLocationByURI(uri, getFileBaseLocation(), false);
-		}
-
-		public String getLocationByURI(String uri, boolean resolveCrossProjectLinks) {
-			return getLocationByURI(uri, getFileBaseLocation(), resolveCrossProjectLinks);
-		}
-
-		public String getLocationByURI(String uri, String baseReference) {
-			return getLocationByURI(uri, baseReference, false);
-		}
-
-		public String getLocationByURI(String uri, String baseReference, boolean resolveCrossProjectLinks) {
-			// ignore resolveCrossProjectLinks value
-			if (uri == null)
-				return null;
-			if (uri.startsWith("file:")) { //$NON-NLS-1$
-				try {
-					URL url = new URL(uri);
-					return url.getFile();
-				}
-				catch (MalformedURLException e) {
-				}
-			}
-			return URIHelper.normalize(uri, baseReference, Path.ROOT.toString());
-		}
-
-		public IProject getProject() {
-			return null;
-		}
-
-		public IContainer getRootLocation() {
-			return ResourcesPlugin.getWorkspace().getRoot();
-		}
-
-		public InputStream getURIStream(String uri) {
-			return null;
-		}
-
-		public void setFileBaseLocation(String newLocation) {
-		}
-
-		public void setProject(IProject newProject) {
-		}
-	}
-
-	/**
-	 * A URIResolver instance of models built on the extensible WST URI
-	 * resolver
-	 */
-	class CommonURIResolver implements URIResolver {
-		IPath fLocation;
-		IPath fPath;
-		final static String SEPARATOR = "/"; //$NON-NLS-1$ 
-		final static String FILE_PREFIX = "file://"; //$NON-NLS-1$
-
-		CommonURIResolver(IPath path, IPath location) {
-			fLocation = location;
-			fPath = path;
-		}
-
-		public String getFileBaseLocation() {
-			return fLocation.toString();
-		}
-
-		public String getLocationByURI(String uri) {
-			return getLocationByURI(uri, getFileBaseLocation(), false);
-		}
-
-		public String getLocationByURI(String uri, boolean resolveCrossProjectLinks) {
-			return getLocationByURI(uri, getFileBaseLocation(), resolveCrossProjectLinks);
-		}
-
-		public String getLocationByURI(String uri, String baseReference) {
-			return getLocationByURI(uri, baseReference, false);
-		}
-
-		public String getLocationByURI(String uri, String baseReference, boolean resolveCrossProjectLinks) {
-			boolean baseHasPrefix = baseReference != null && baseReference.startsWith(FILE_PREFIX);
-			String reference = null;
-			if (baseHasPrefix) {
-				reference = baseReference;
-			}
-			else {
-				reference = FILE_PREFIX + baseReference;
-			}
-			String result = URIResolverPlugin.createResolver().resolve(reference, null, uri);
-			// Logger.log(Logger.INFO_DEBUG,
-			// "URIResolverPlugin.createResolver().resolve("
-			// + reference + ", null, " +uri+") = " + result);
-			if (!baseHasPrefix && result.startsWith(FILE_PREFIX) && result.length() > FILE_PREFIX.length()) {
-				result = result.substring(FILE_PREFIX.length());
-			}
-			return result;
-		}
-
-		public IProject getProject() {
-			return ResourcesPlugin.getWorkspace().getRoot().getProject(fPath.segment(0));
-		}
-
-		public IContainer getRootLocation() {
-			String root = URIResolverPlugin.createResolver().resolve(FILE_PREFIX + getFileBaseLocation(), null, SEPARATOR);
-			IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(root));
-			for (int i = 0; i < files.length; i++) {
-				if ((files[i].getType() & IResource.FOLDER) == IResource.FOLDER) {
-					if (((IFolder) files[i]).getFullPath().isPrefixOf(fPath)) {
-						return (IFolder) files[i];
-					}
-				}
-			}
-			return getProject();
-		}
-
-		public InputStream getURIStream(String uri) {
-			return null;
-		}
-
-		public void setFileBaseLocation(String newLocation) {
-		}
-
-		public void setProject(IProject newProject) {
-		}
-	}
-
-	/**
-	 * Maps interesting documents in file buffers to those file buffers.
-	 * Required to allows us to go from documents to complete models.
-	 */
-	class FileBufferMapper implements IFileBufferListener {
-		public void bufferContentAboutToBeReplaced(IFileBuffer buffer) {
-		}
-
-		public void bufferContentReplaced(IFileBuffer buffer) {
-		}
-
-		public void bufferCreated(IFileBuffer buffer) {
-			if (buffer instanceof ITextFileBuffer) {
-				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$
-				}
-				DocumentInfo info = new DocumentInfo();
-				info.buffer = textBuffer;
-				info.contentTypeID = detectContentType(buffer.getLocation()).getId();
-				info.bufferReferenceCount++;
-				fDocumentMap.put(textBuffer.getDocument(), info);
-			}
-		}
-
-		public void bufferDisposed(IFileBuffer buffer) {
-			if (buffer instanceof ITextFileBuffer) {
-				ITextFileBuffer textBuffer = (ITextFileBuffer) buffer;
-				if (!(textBuffer.getDocument() instanceof IStructuredDocument))
-					return;
-				if (Logger.DEBUG_TEXTBUFFERLIFECYCLE) {
-					Logger.log(Logger.INFO, "Discarded buffer: " + buffer.getLocation().toString() + " " + buffer + " " + ((ITextFileBuffer) buffer).getDocument()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-				}
-				DocumentInfo info = (DocumentInfo) fDocumentMap.get(textBuffer.getDocument());
-				if (info != null) {
-					info.bufferReferenceCount--;
-					if (info.bufferReferenceCount == 0 && info.modelReferenceCount == 0)
-						fDocumentMap.remove(textBuffer.getDocument());
-				}
-			}
-		}
-
-		public void dirtyStateChanged(IFileBuffer buffer, boolean isDirty) {
-			if (buffer instanceof ITextFileBuffer) {
-				if (Logger.DEBUG_TEXTBUFFERLIFECYCLE) {
-					Logger.log(Logger.INFO, "Buffer dirty state changed: (" + isDirty + ") " + buffer.getLocation().toString() + " " + buffer + " " + ((ITextFileBuffer) buffer).getDocument()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-				}
-				ITextFileBuffer textBuffer = (ITextFileBuffer) buffer;
-				if (!(textBuffer.getDocument() instanceof IStructuredDocument))
-					return;
-				DocumentInfo info = (DocumentInfo) fDocumentMap.get(textBuffer.getDocument());
-				if (info != null && info.model != null) {
-					String msg = "Updating model dirty state for" + info.buffer.getLocation(); //$NON-NLS-1$
-					if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT || Logger.DEBUG_TEXTBUFFERLIFECYCLE) {
-						Logger.log(Logger.INFO, msg);
-					}
-					info.model.setDirtyState(isDirty);
-
-					IFile workspaceFile = FileBuffers.getWorkspaceFileAtLocation(info.buffer.getLocation());
-					if (!isDirty && workspaceFile != null) {
-						info.model.resetSynchronizationStamp(workspaceFile);
-					}
-				}
-			}
-		}
-
-		public void stateChangeFailed(IFileBuffer buffer) {
-		}
-
-		public void stateChanging(IFileBuffer buffer) {
-		}
-
-		public void stateValidationChanged(IFileBuffer buffer, boolean isStateValidated) {
-		}
-
-		public void underlyingFileDeleted(IFileBuffer buffer) {
-			if (buffer instanceof ITextFileBuffer) {
-				if (Logger.DEBUG_TEXTBUFFERLIFECYCLE) {
-					Logger.log(Logger.INFO, "Deleted buffer: " + buffer.getLocation().toOSString() + " " + buffer); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-			}
-		}
-
-		public void underlyingFileMoved(IFileBuffer buffer, IPath path) {
-			if (buffer instanceof ITextFileBuffer) {
-				if (Logger.DEBUG_TEXTBUFFERLIFECYCLE) {
-					Logger.log(Logger.INFO, "Moved buffer from: " + buffer.getLocation().toOSString() + " " + buffer); //$NON-NLS-1$ //$NON-NLS-2$
-					Logger.log(Logger.INFO, "Moved buffer to: " + path.toOSString() + " " + buffer); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-			}
-		}
-	}
-
-	private static FileBufferModelManager instance;
-
-	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$
-				}
-			}
-			FileBuffers.getTextFileBufferManager().removeFileBufferListener(instance.fFileBufferListener);
-			instance = null;
-		}
-	}
-
-	static final void startup() {
-		getInstance();
-	}
-
-	// a map of IStructuredDocuments to DocumentInfo objects
-	Map fDocumentMap = null;
-
-	IFileBufferListener fFileBufferListener = null;
-
-	FileBufferModelManager() {
-		super();
-		fDocumentMap = new Hashtable(4);
-		FileBuffers.getTextFileBufferManager().addFileBufferListener(fFileBufferListener = new FileBufferMapper());
-	}
-
-	public String calculateId(IFile file) {
-		if (file == null) {
-			Exception iae = new IllegalArgumentException("can not calculate a model ID without an IFile"); //$NON-NLS-1$ 
-			Logger.logException(iae);
-			return null;
-		}
-
-		String id = null;
-		IPath path = file.getFullPath();
-		if (path != null) {
-			/*
-			 * The ID of models must be the same as the normalized paths
-			 * stored in the underlying FileBuffers to retrieve them by common
-			 * ID later on. We chose the FileBuffer normalized path over the
-			 * previously used absolute IFile path because the buffers should
-			 * already exist before we build a model and we can't retrieve a
-			 * FileBuffer using the ID of a model that doesn't yet exist.
-			 */
-			id = FileBuffers.normalizeLocation(path).toString();
-		}
-		return id;
-
-	}
-
-
-	public String calculateId(IDocument document) {
-		if (document == null) {
-			Exception iae = new IllegalArgumentException("can not calculate a model ID without a document reference"); //$NON-NLS-1$ 
-			Logger.logException(iae);
-			return null;
-		}
-
-		String id = null;
-		ITextFileBuffer buffer = getBuffer(document);
-		if (buffer != null) {
-			id = buffer.getLocation().toString();
-		}
-		return id;
-	}
-
-	URIResolver createURIResolver(ITextFileBuffer buffer) {
-		IPath location = buffer.getLocation();
-		IFile workspaceFile = FileBuffers.getWorkspaceFileAtLocation(location);
-		URIResolver resolver = null;
-		if (workspaceFile != null) {
-			IProject project = workspaceFile.getProject();
-			resolver = (URIResolver) project.getAdapter(URIResolver.class);
-			if (resolver == null) {
-				resolver = new CommonURIResolver(workspaceFile.getFullPath(), workspaceFile.getLocation());
-			}
-			resolver.setFileBaseLocation(workspaceFile.getLocation().toString());
-		}
-		else {
-			resolver = new ExternalURIResolver(location);
-		}
-		return resolver;
-	}
-
-
-	IContentType detectContentType(IPath location) {
-		IContentType type = null;
-
-		IResource resource = FileBuffers.getWorkspaceFileAtLocation(location);
-		if (resource != null) {
-			if (resource.getType() == IResource.FILE && resource.isAccessible()) {
-				IContentDescription d = null;
-				try {
-					// Optimized description lookup, might not succeed
-					d = ((IFile) resource).getContentDescription();
-					if (d != null) {
-						type = d.getContentType();
-					}
-				}
-				catch (CoreException e) {
-					// Should not be possible given the accessible and file
-					// type check above
-				}
-				if (type == null) {
-					type = Platform.getContentTypeManager().findContentTypeFor(resource.getName());
-				}
-			}
-		}
-		else {
-			File file = FileBuffers.getSystemFileAtLocation(location);
-			if (file != null) {
-				InputStream input = null;
-				try {
-					input = new FileInputStream(file);
-					type = Platform.getContentTypeManager().findContentTypeFor(input, location.toOSString());
-				}
-				catch (FileNotFoundException e) {
-				}
-				catch (IOException e) {
-				}
-				finally {
-					if (input != null) {
-						try {
-							input.close();
-						}
-						catch (IOException e1) {
-						}
-					}
-				}
-				if (type == null) {
-					type = Platform.getContentTypeManager().findContentTypeFor(file.getName());
-				}
-			}
-		}
-		if (type == null) {
-			type = Platform.getContentTypeManager().getContentType(IContentTypeManager.CT_TEXT);
-		}
-		return type;
-	}
-
-	public ITextFileBuffer getBuffer(IDocument document) {
-		if (document == null) {
-			Exception iae = new IllegalArgumentException("can not get a buffer without a document reference"); //$NON-NLS-1$ 
-			Logger.logException(iae);
-			return null;
-		}
-
-		DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
-		if (info != null)
-			return info.buffer;
-		return null;
-	}
-
-	String getContentTypeID(IDocument document) {
-		DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
-		if (info != null)
-			return info.contentTypeID;
-		return null;
-	}
-
-	IStructuredModel getModel(File file) {
-		if (file == null) {
-			Exception iae = new IllegalArgumentException("can not get/create a model without a java.io.File"); //$NON-NLS-1$ 
-			Logger.logException(iae);
-			return null;
-		}
-
-		IStructuredModel model = null;
-		ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
-		try {
-			IPath location = new Path(file.getAbsolutePath());
-			if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
-				Logger.log(Logger.INFO, "FileBufferModelManager connecting to File " + location); //$NON-NLS-1$
-			}
-			bufferManager.connect(location, getProgressMonitor());
-			ITextFileBuffer buffer = bufferManager.getTextFileBuffer(location);
-			if (buffer != null) {
-				DocumentInfo info = (DocumentInfo) fDocumentMap.get(buffer.getDocument());
-				info.selfConnected = true;
-				model = getModel((IStructuredDocument) buffer.getDocument());
-			}
-		}
-		catch (CoreException e) {
-			Logger.logException("Error getting model for " + file.getPath(), e); //$NON-NLS-1$
-		}
-		return model;
-	}
-
-	public IStructuredModel getModel(IFile file) {
-		if (file == null) {
-			Exception iae = new IllegalArgumentException("can not get/create a model without an IFile"); //$NON-NLS-1$ 
-			Logger.logException(iae);
-			return null;
-		}
-
-		IStructuredModel model = null;
-		ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
-		try {
-			if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
-				Logger.log(Logger.INFO, "FileBufferModelManager connecting to IFile " + file.getLocation()); //$NON-NLS-1$
-			}
-			// see TextFileDocumentProvider#createFileInfo about why we use
-			// IFile#getFullPath
-			// here, not IFile#getLocation.
-			IPath location = file.getFullPath();
-			if (location != null) {
-				bufferManager.connect(location, getProgressMonitor());
-				ITextFileBuffer buffer = bufferManager.getTextFileBuffer(location);
-				if (buffer != null) {
-					DocumentInfo info = (DocumentInfo) fDocumentMap.get(buffer.getDocument());
-					if (info != null) {
-						/*
-						 * Note: "info" being null at this point is a slight
-						 * error.
-						 * 
-						 * The connect call from above (or at some time
-						 * earlier in the session) would have notified the
-						 * FileBufferMapper of the creation of the
-						 * corresponding text buffer and created the
-						 * DocumentInfo object for IStructuredDocuments.
-						 */
-						info.selfConnected = true;
-					}
-					/*
-					 * Check the document type. Although returning null for
-					 * unknown documents would be fair, try to get a model if
-					 * the document is at least a valid type.
-					 */
-					IDocument bufferDocument = buffer.getDocument();
-					if (bufferDocument instanceof IStructuredDocument) {
-						model = getModel((IStructuredDocument) bufferDocument);
-					}
-				}
-			}
-		}
-		catch (CoreException e) {
-			Logger.logException("Error getting model for " + file.getLocation(), e); //$NON-NLS-1$
-		}
-		return model;
-	}
-
-	public IStructuredModel getModel(IStructuredDocument document) {
-		if (document == null) {
-			Exception iae = new IllegalArgumentException("can not get/create a model without a document reference"); //$NON-NLS-1$ 
-			Logger.logException(iae);
-			return null;
-		}
-
-		DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
-		if (info != null && info.model == null) {
-			if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
-				Logger.log(Logger.INFO, "FileBufferModelManager creating model for " + info.buffer.getLocation() + " " + info.buffer.getDocument()); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			info.modelReferenceCount++;
-
-			IStructuredModel model = null;
-			IModelHandler handler = ModelHandlerRegistry.getInstance().getHandlerForContentTypeId(info.contentTypeID);
-			IModelLoader loader = handler.getModelLoader();
-			model = loader.createModel(document, info.buffer.getLocation().toString(), handler);
-			try {
-				info.model = model;
-				model.setId(info.buffer.getLocation().toString());
-				// handler now set by loader, for now
-				// model.setModelHandler(handler);
-				if (model instanceof AbstractStructuredModel) {
-					((AbstractStructuredModel) model).setContentTypeIdentifier(info.contentTypeID);
-				}
-				model.setResolver(createURIResolver(getBuffer(document)));
-				if (info.buffer.isDirty()) {
-					model.setDirtyState(true);
-				}
-			}
-			catch (ResourceInUse e) {
-				Logger.logException("attempted to create new model with existing ID", e); //$NON-NLS-1$
-				model = null;
-			}
-		}
-		if (info != null) {
-			return info.model;
-		}
-		return null;
-	}
-
-	/**
-	 * @return
-	 */
-	private IProgressMonitor getProgressMonitor() {
-		return new NullProgressMonitor();
-	}
-
-	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$ 
-			Logger.logException(iae);
-			return false;
-		}
-
-		DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
-		return info != null;
-	}
-
-	public void releaseModel(IDocument document) {
-		if (document == null) {
-			Exception iae = new IllegalArgumentException("can not release a model without a document reference"); //$NON-NLS-1$ 
-			Logger.logException(iae);
-			return;
-		}
-		DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
-		if (info != null) {
-			if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
-				Logger.log(Logger.INFO, "FileBufferModelManager noticed full release of model for " + info.buffer.getLocation() + " " + info.buffer.getDocument()); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			info.model = null;
-			info.modelReferenceCount--;
-			if (info.selfConnected) {
-				if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
-					Logger.log(Logger.INFO, "FileBufferModelManager disconnecting from " + info.buffer.getLocation() + " " + info.buffer.getDocument()); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-				IPath location = info.buffer.getLocation();
-				try {
-					FileBuffers.getTextFileBufferManager().disconnect(location, getProgressMonitor());
-				}
-				catch (CoreException e) {
-					Logger.logException("Error releasing model for " + location, e); //$NON-NLS-1$
-				}
-			}
-		}
-	}
-
-	public void revert(IDocument document) {
-		if (document == null) {
-			Exception iae = new IllegalArgumentException("can not release a model without a document reference"); //$NON-NLS-1$ 
-			Logger.logException(iae);
-			return;
-		}
-		DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
-		if (info == null) {
-			Logger.log(Logger.ERROR, "FileBufferModelManager was asked to revert a document but was not being managed");
-		}
-		else {
-			// get path just for potential error message
-			IPath location = info.buffer.getLocation();
-			try {
-				// ISSUE: in future, clients should provide progress monitor
-				info.buffer.revert(getProgressMonitor());
-			}
-			catch (CoreException e) {
-				// ISSUE: shoudl we not be re-throwing CoreExceptions? Or
-				// not catch them at all?
-				Logger.logException("Error reverting model for " + location, e); //$NON-NLS-1$
-			}
-		}
-	}
-}
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
deleted file mode 100644
index 2004918..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java
+++ /dev/null
@@ -1,20 +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.sse.core.internal;
-
-
-public interface IExecutionDelegate {
-
-	void execute(Runnable runnable);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ILockable.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ILockable.java
deleted file mode 100644
index 0eec235..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ILockable.java
+++ /dev/null
@@ -1,30 +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.sse.core.internal;
-
-import org.eclipse.core.runtime.jobs.ILock;
-
-/**
- * 
- * Not API: not to be used or implemented by clients. This is a special
- * purpose interface to help guard some threading issues betweeen model and
- * document. Will be changed soon.
- *  
- */
-
-public interface ILockable {
-
-	ILock getLockObject();
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/JSPAwareAdapterFactory.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/JSPAwareAdapterFactory.java
deleted file mode 100644
index 72bc183..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/JSPAwareAdapterFactory.java
+++ /dev/null
@@ -1,22 +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.sse.core.internal;
-
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-
-
-public interface JSPAwareAdapterFactory extends INodeAdapterFactory {
-
-	void initializeWith(EmbeddedTypeHandler embeddedContentType);
-}
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
deleted file mode 100644
index 2b65d7e..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java
+++ /dev/null
@@ -1,181 +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.sse.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;
-
-/**
- * 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.sse.core"; //$NON-NLS-1$
-	/**
-	 * true if both platform and this plugin are in debug mode
-	 */
-	public static final boolean DEBUG = Platform.inDebugMode() && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/debug")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging adapter
-	 * notification time
-	 */
-	public static final boolean DEBUG_ADAPTERNOTIFICATIONTIME = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/dom/adapter/notification/time")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging structured
-	 * document
-	 */
-	public static final boolean DEBUG_DOCUMENT = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/structureddocument")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging file buffer
-	 * model management
-	 */
-	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 text buffer
-	 * lifecycle
-	 */
-	public static final boolean DEBUG_TEXTBUFFERLIFECYCLE = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/filebuffers/lifecycle")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging model
-	 * lifecycle
-	 */
-	public static final boolean DEBUG_LIFECYCLE = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/structuredmodel/lifecycle")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging model state
-	 */
-	public static final boolean DEBUG_MODELSTATE = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/structuredmodel/state")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging model lock
-	 * state
-	 */
-	public static final boolean DEBUG_MODELLOCK = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/structuredmodel/locks")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging model
-	 * manager
-	 */
-	public static final boolean DEBUG_MODELMANAGER = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/structuredmodel/modelmanager")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging task tags
-	 */
-	public static final boolean DEBUG_TASKS = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging task tags
-	 * content type detection
-	 */
-	public static final boolean DEBUG_TASKSCONTENTTYPE = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/detection")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging task tags
-	 * jobs
-	 */
-	public static final boolean DEBUG_TASKSJOB = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/job")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging task tags
-	 * overall performance
-	 */
-	public static final boolean DEBUG_TASKSOVERALLPERF = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/overalltime")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging task tags
-	 * performance
-	 */
-	public static final boolean DEBUG_TASKSPERF = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/time")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging task tags
-	 * preferences
-	 */
-	public static final boolean DEBUG_TASKSPREFS = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/preferences")); //$NON-NLS-1$ //$NON-NLS-2$
-	/**
-	 * true if platform and plugin are in debug mode and debugging task tags
-	 * registry
-	 */
-	public static final boolean DEBUG_TASKSREGISTRY = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/registry")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	/*
-	 * Keep our own copy in case we want to add other severity levels
-	 */
-	public static final int OK = IStatus.OK;
-	public static final int INFO = IStatus.INFO;
-	public static final int WARNING = IStatus.WARNING;
-	public static final int ERROR = IStatus.ERROR;
-
-	/**
-	 * Adds message to log.
-	 * 
-	 * @param level
-	 *            severity level of the message (OK, INFO, WARNING, ERROR,
-	 * @param message
-	 *            text to add to the log
-	 * @param exception
-	 *            exception thrown
-	 */
-	private static void _log(int level, String message, Throwable exception) {
-		message = (message != null) ? message : ""; //$NON-NLS-1$
-		Status statusObj = new Status(level, PLUGIN_ID, level, message, exception);
-		Bundle bundle = Platform.getBundle(PLUGIN_ID);
-		if (bundle != null)
-			Platform.getLog(bundle).log(statusObj);
-	}
-
-	/**
-	 * Write a message to the log with the given severity level
-	 * 
-	 * @param level
-	 *            ERROR, WARNING, INFO, OK
-	 * @param message
-	 *            message to add to the log
-	 */
-	public static void log(int level, String message) {
-		_log(level, message, null);
-	}
-
-	/**
-	 * Writes a message and exception to the log with the given severity level
-	 * 
-	 * @param level
-	 *            ERROR, WARNING, INFO, OK
-	 * @param message
-	 *            message to add to the log
-	 * @param exception
-	 *            exception to add to the log
-	 */
-	public static void log(int level, String message, Throwable exception) {
-		_log(level, message, exception);
-	}
-
-	/**
-	 * Writes the exception as an error in the log along with an accompanying
-	 * message
-	 * 
-	 * @param message
-	 *            message to add to the log
-	 * @param exception
-	 *            exception to add to the log
-	 */
-	public static void logException(String message, Throwable exception) {
-		_log(IStatus.ERROR, message, exception);
-	}
-
-	/**
-	 * Writes the exception as an error in the log
-	 * 
-	 * @param exception
-	 *            exception to add to the log
-	 */
-	public static void logException(Throwable exception) {
-		_log(IStatus.ERROR, exception.getMessage(), exception);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ModelManagerPluginRegistryReader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ModelManagerPluginRegistryReader.java
deleted file mode 100644
index 2a4b786..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ModelManagerPluginRegistryReader.java
+++ /dev/null
@@ -1,198 +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.sse.core.internal;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-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.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.osgi.framework.Bundle;
-
-
-public class ModelManagerPluginRegistryReader {
-	private static ModelManagerPluginRegistryReader reader = null;
-
-	public synchronized static ModelManagerPluginRegistryReader getInstance() {
-		if (reader == null) {
-			reader = new ModelManagerPluginRegistryReader();
-		}
-		return reader;
-	}
-
-	protected final String ATTR_ADAPTERKEY = "adapterKeyClass"; //$NON-NLS-1$
-	protected final String ATTR_CLASS = "class"; //$NON-NLS-1$
-	protected final String ATTR_CONTENTTYPE = "type"; //$NON-NLS-1$
-	protected final String ATTR_REGISTERADAPTER = "registerAdapters"; //$NON-NLS-1$
-
-	protected final String EXTENSION_POINT_ID = "adaptOnCreateFactory"; //$NON-NLS-1$
-	protected final String TAG_NAME = "AdaptOnCreateFactory"; //$NON-NLS-1$
-
-	/**
-	 * XMLEditorPluginRegistryReader constructor comment.
-	 */
-	protected ModelManagerPluginRegistryReader() {
-		super();
-	}
-
-	public List getFactories(IDocumentTypeHandler handler) {
-		return loadRegistry(handler.getId());
-	}
-
-	public List getFactories(String type) {
-		return loadRegistry(type);
-	}
-
-	protected INodeAdapterFactory loadFactoryFromConfigurationElement(IConfigurationElement element, Object requesterType) {
-		INodeAdapterFactory factory = null;
-		if (element.getName().equals(TAG_NAME)) {
-			String contentType = element.getAttribute(ATTR_CONTENTTYPE);
-			if (!contentType.equals(requesterType))
-				return null;
-			String className = element.getAttribute(ATTR_CLASS);
-			String adapterKeyClass = element.getAttribute(ATTR_ADAPTERKEY);
-			String registerAdapters = element.getAttribute(ATTR_REGISTERADAPTER);
-
-			// if className is null, then no one defined the extension point
-			// for adapter factories
-			if (className != null) {
-				String name = element.getDeclaringExtension().getNamespace();
-				Bundle bundle = null;
-				try {
-					bundle = Platform.getBundle(name);
-				}
-				catch (Exception e) {
-					// if an error occurs here, its probably that the plugin
-					// could not be found/loaded
-					Logger.logException("Could not find bundle: " + name, e); //$NON-NLS-1$
-
-				}
-				if (bundle != null) {
-					boolean useExtendedConstructor = false;
-					boolean doRegisterAdapters = false;
-					Object adapterKey = null;
-
-					if (registerAdapters != null && registerAdapters.length() > 0 && Boolean.valueOf(registerAdapters).booleanValue()) {
-						doRegisterAdapters = true;
-					}
-					if (adapterKeyClass != null) {
-						try {
-							Class aClass = null;
-							// aClass = classLoader != null ?
-							// classLoader.loadClass(adapterKeyClass) :
-							// Class.forName(adapterKeyClass);
-							if (bundle.getState() != Bundle.UNINSTALLED) {
-								aClass = bundle.loadClass(adapterKeyClass);
-							}
-							else {
-								aClass = Class.forName(adapterKeyClass);
-							}
-							if (aClass != null) {
-								useExtendedConstructor = true;
-								adapterKey = aClass;
-							}
-							else {
-								adapterKey = adapterKeyClass;
-							}
-						}
-						catch (Exception anyErrors) {
-							adapterKey = adapterKeyClass;
-						}
-					}
-
-					try {
-						Class theClass = null;
-						// Class theClass = classLoader != null ?
-						// classLoader.loadClass(className) :
-						// Class.forName(className);
-						if (bundle.getState() != Bundle.UNINSTALLED) {
-							theClass = bundle.loadClass(className);
-						}
-						else {
-							theClass = Class.forName(className);
-						}
-						if (useExtendedConstructor) {
-							java.lang.reflect.Constructor[] ctors = theClass.getConstructors();
-							for (int i = 0; i < ctors.length; i++) {
-								Class[] paramTypes = ctors[i].getParameterTypes();
-								if (ctors[i].isAccessible() && paramTypes.length == 2 && paramTypes[0].equals(Object.class) && paramTypes[1].equals(boolean.class)) {
-									try {
-										factory = (INodeAdapterFactory) ctors[i].newInstance(new Object[]{adapterKey, new Boolean(doRegisterAdapters)});
-									}
-									catch (IllegalAccessException e) {
-										// log for now, unless we find reason
-										// not to
-										Logger.log(Logger.INFO, e.getMessage());
-									}
-									catch (IllegalArgumentException e) {
-										// log for now, unless we find reason
-										// not to
-										Logger.log(Logger.INFO, e.getMessage());
-									}
-									catch (InstantiationException e) {
-										// log for now, unless we find reason
-										// not to
-										Logger.log(Logger.INFO, e.getMessage());
-									}
-									catch (InvocationTargetException e) {
-										// log for now, unless we find reason
-										// not to
-										Logger.log(Logger.INFO, e.getMessage());
-									}
-									catch (ExceptionInInitializerError e) {
-										// log or now, unless we find reason
-										// not to
-										Logger.log(Logger.INFO, e.getMessage());
-									}
-								}
-							}
-						}
-						if (factory == null) {
-							factory = (INodeAdapterFactory) element.createExecutableExtension(ATTR_CLASS);
-						}
-					}
-					catch (ClassNotFoundException e) {
-						// log or now, unless we find reason not to
-						Logger.log(Logger.INFO, e.getMessage());
-					}
-					catch (CoreException e) {
-						// log or now, unless we find reason not to
-						Logger.log(Logger.INFO, e.getMessage());
-					}
-				}
-			}
-		}
-		return factory;
-	}
-
-	protected List loadRegistry(Object contentType) {
-		List factoryList = new Vector();
-		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
-		IExtensionPoint point = extensionRegistry.getExtensionPoint(SSECorePlugin.ID, EXTENSION_POINT_ID);
-		if (point != null) {
-			IConfigurationElement[] elements = point.getConfigurationElements();
-			for (int i = 0; i < elements.length; i++) {
-				INodeAdapterFactory factory = loadFactoryFromConfigurationElement(elements[i], contentType);
-				if (factory != null)
-					factoryList.add(factory);
-			}
-		}
-		return factoryList;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NoCancelProgressMonitor.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NoCancelProgressMonitor.java
deleted file mode 100644
index c9f129f..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NoCancelProgressMonitor.java
+++ /dev/null
@@ -1,35 +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.sse.core.internal;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-
-
-public class NoCancelProgressMonitor extends NullProgressMonitor {
-
-
-	public NoCancelProgressMonitor() {
-		super();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.IProgressMonitor#isCanceled()
-	 */
-	public boolean isCanceled() {
-
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NotImplementedException.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NotImplementedException.java
deleted file mode 100644
index 3a0b985..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NotImplementedException.java
+++ /dev/null
@@ -1,37 +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.sse.core.internal;
-
-
-public class NotImplementedException extends RuntimeException {
-	/**
-	 * Comment for <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-
-	public NotImplementedException() {
-		super();
-	}
-
-	public NotImplementedException(String message) {
-		super(message);
-	}
-
-	public NotImplementedException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-	public NotImplementedException(Throwable cause) {
-		super(cause);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NullMemento.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NullMemento.java
deleted file mode 100644
index af3c72c..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NullMemento.java
+++ /dev/null
@@ -1,37 +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.sse.core.internal;
-
-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.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapter.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapter.java
deleted file mode 100644
index b1f7b5a..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapter.java
+++ /dev/null
@@ -1,38 +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.sse.core.internal;
-
-import java.util.List;
-
-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 interface PropagatingAdapter extends INodeAdapter {
-
-	void addAdaptOnCreateFactory(INodeAdapterFactory factory);
-
-	List getAdaptOnCreateFactories();
-
-	/**
-	 * This method should be called immediately after adding a factory,
-	 * typically on the document (top level) node, so all nodes can be
-	 * adapted, if needed. This is needed for those occasions when a factory
-	 * is addeded after some nodes may have already been created at the time
-	 * the factory is added.
-	 */
-	void initializeForFactory(INodeAdapterFactory factory, INodeNotifier node);
-
-	// dmw: should have getFactoryFor?
-	void release();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapterFactory.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapterFactory.java
deleted file mode 100644
index 9092882..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapterFactory.java
+++ /dev/null
@@ -1,29 +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.sse.core.internal;
-
-
-
-import java.util.ArrayList;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-
-
-
-public interface PropagatingAdapterFactory extends INodeAdapterFactory {
-
-	void addContributedFactories(INodeAdapterFactory factory);
-
-	void setContributedFactories(ArrayList list);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECoreMessages.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECoreMessages.java
deleted file mode 100644
index 15fd1aa..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECoreMessages.java
+++ /dev/null
@@ -1,39 +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.sse.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by SSE Core
- * 
- * @plannedfor 1.0
- */
-public class SSECoreMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.sse.core.internal.SSECorePluginResources";//$NON-NLS-1$
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, SSECoreMessages.class);
-	}
-
-	private SSECoreMessages() {
-		// cannot create new instance
-	}
-
-	public static String A_model_s_id_can_not_be_nu_EXC_;
-	public static String Program_Error__ModelManage_EXC_;
-	public static String Original_Error__UI_;
-	public static String Text_Change_UI_;
-	public static String TaskScanner_0;
-	public static String TaskScanningJob_0;
-	public static String TaskScanningJob_1;
-	public static String Migrate_Charset;
-}
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
deleted file mode 100644
index fd4a755..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java
+++ /dev/null
@@ -1,93 +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.sse.core.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-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.provisional.StructuredModelManager;
-import org.osgi.framework.BundleContext;
-
-
-/**
- * SSE Core Plugin.
- */
-public class SSECorePlugin extends Plugin {
-	static SSECorePlugin instance = null;
-
-	public static final String ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
-
-	public static SSECorePlugin getDefault() {
-		return instance;
-	}
-
-	public SSECorePlugin() {
-		super();
-		instance = this;
-	}
-
-	/**
-	 * Set default non-UI
-	 */
-	protected void initializeDefaultPluginPreferences() {
-		Preferences prefs = getDefault().getPluginPreferences();
-		// set model preference defaults
-
-		prefs.setDefault(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8, false);
-		
-		prefs.setDefault(CommonModelPreferenceNames.TASK_TAG_ENABLE, false);
-		prefs.setDefault(CommonModelPreferenceNames.TASK_TAG_TAGS, "TODO,FIXME,XXX"); //$NON-NLS-1$
-		prefs.setDefault(CommonModelPreferenceNames.TASK_TAG_PRIORITIES, "1,2,1"); //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
-	 */
-	public void stop(BundleContext context) throws Exception {
-		savePluginPreferences();
-		FileBufferModelManager.shutdown();
-
-		super.stop(context);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
-	 */
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-
-		// initialize FileBuffer handling
-		FileBufferModelManager.startup();
-	}
-
-	/**
-	 * @deprecated
-	 */
-	public ModelHandlerRegistry getModelHandlerRegistry() {
-		return ModelHandlerRegistry.getInstance();
-	}
-
-	/**
-	 * @deprecated - use StructuredModelManager.getModelManager();
-	 */
-	public IModelManager getModelManager() {
-		return StructuredModelManager.getModelManager();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePluginResources.properties b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePluginResources.properties
deleted file mode 100644
index a522f19..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePluginResources.properties
+++ /dev/null
@@ -1,21 +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
-#
-###############################################################################
-A_model_s_id_can_not_be_nu_EXC_=A model's id can not be null
-Program_Error__ModelManage_EXC_=Program Error: ModelManagerImpl::saveModel. Model should be in the cache
-Original_Error__UI_=Original Error:
-Text_Change_UI_=Text Change
-TaskScanner_0=Scanning for Tasks
-TaskScanningJob_0=Scanning
-TaskScanningJob_1=Errors while detecting Tasks
-###############################################################################
-Migrate_Charset=Migrate Charset
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/AbstractStructuredCleanupProcessor.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/AbstractStructuredCleanupProcessor.java
deleted file mode 100644
index 320c0fd..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/AbstractStructuredCleanupProcessor.java
+++ /dev/null
@@ -1,456 +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.sse.core.internal.cleanup;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-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.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-
-public abstract class AbstractStructuredCleanupProcessor implements IStructuredCleanupProcessor {
-	public boolean refreshCleanupPreferences = true; // special flag for JUnit
-
-	// tests to skip refresh
-	// of cleanup preferences
-	// when it's set to false
-
-	public String cleanupContent(String input) throws IOException, CoreException {
-		IStructuredModel structuredModel = null;
-		InputStream inputStream = null;
-		try {
-			// setup structuredModel
-			inputStream = new ByteArrayInputStream(input.getBytes("UTF8")); //$NON-NLS-1$
-			String id = inputStream.toString() + getContentType();
-			structuredModel = StructuredModelManager.getModelManager().getModelForRead(id, inputStream, null);
-
-			// cleanup
-			cleanupModel(structuredModel, 0, structuredModel.getStructuredDocument().getLength());
-
-			// return output
-			return structuredModel.getStructuredDocument().get();
-		} finally {
-			ensureClosed(null, inputStream);
-			// release from model manager
-			if (structuredModel != null)
-				structuredModel.releaseFromRead();
-		}
-	}
-
-	public String cleanupContent(String input, int start, int length) throws IOException, CoreException {
-		IStructuredModel structuredModel = null;
-		InputStream inputStream = null;
-		try {
-			// setup structuredModel
-			inputStream = new ByteArrayInputStream(input.getBytes("UTF8")); //$NON-NLS-1$
-			String id = inputStream.toString() + getContentType();
-			structuredModel = StructuredModelManager.getModelManager().getModelForRead(id, inputStream, null);
-
-			// cleanup
-			cleanupModel(structuredModel, start, length);
-
-			// return output
-			return structuredModel.getStructuredDocument().get();
-		} finally {
-			ensureClosed(null, inputStream);
-			// release from model manager
-			if (structuredModel != null)
-				structuredModel.releaseFromRead();
-		}
-	}
-
-	public void cleanupDocument(IDocument document) throws IOException, CoreException {
-		if (document == 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().getExistingModelForEdit(document);
-
-			// cleanup
-			cleanupModel(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 cleanupDocument(IDocument document, int start, int length) throws IOException, CoreException {
-		if (document == null)
-			return;
-
-		if (start >= 0 && length >= 0 && start + length <= document.getLength()) {
-			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().getExistingModelForEdit(document);
-
-				// cleanup
-				cleanupModel(structuredModel, start, length);
-
-				// 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 cleanupFile(IFile file) throws IOException, CoreException {
-		IStructuredModel structuredModel = null;
-		//OutputStream outputStream = null;
-		try {
-			// setup structuredModel
-			structuredModel = StructuredModelManager.getModelManager().getModelForRead(file);
-
-			// cleanup
-			cleanupModel(structuredModel, 0, structuredModel.getStructuredDocument().getLength());
-
-			// save output to file
-			//outputStream = new
-			// FileOutputStream(file.getLocation().toString());
-			structuredModel.save(file);
-		} finally {
-			//ensureClosed(outputStream, null);
-			// release from model manager
-			if (structuredModel != null)
-				structuredModel.releaseFromRead();
-		}
-	}
-
-	public void cleanupFile(IFile file, int start, int length) throws IOException, CoreException {
-		IStructuredModel structuredModel = null;
-		//OutputStream outputStream = null;
-		try {
-			// setup structuredModel
-			structuredModel = StructuredModelManager.getModelManager().getModelForRead(file);
-
-			// cleanup
-			cleanupModel(structuredModel, start, length);
-
-			// save output to file
-			//outputStream = new
-			// FileOutputStream(file.getLocation().toString());
-			structuredModel.save(file);
-		} finally {
-			//ensureClosed(outputStream, null);
-			// release from model manager
-			if (structuredModel != null)
-				structuredModel.releaseFromRead();
-		}
-	}
-
-	public void cleanupFileName(String fileName) throws IOException, CoreException {
-		IStructuredModel structuredModel = null;
-		InputStream inputStream = null;
-		//OutputStream outputStream = null;
-		try {
-			// setup structuredModel
-			inputStream = new FileInputStream(fileName);
-			structuredModel = StructuredModelManager.getModelManager().getModelForRead(fileName, inputStream, null);
-
-			// cleanup
-			cleanupModel(structuredModel, 0, structuredModel.getStructuredDocument().getLength());
-
-			// save output to file
-			//outputStream = new FileOutputStream(fileName);
-			structuredModel.save();
-		} finally {
-			//ensureClosed(outputStream, inputStream);
-			// release from model manager
-			if (structuredModel != null)
-				structuredModel.releaseFromRead();
-		}
-	}
-
-	public void cleanupFileName(String fileName, int start, int length) throws IOException, CoreException {
-		IStructuredModel structuredModel = null;
-		InputStream inputStream = null;
-		//OutputStream outputStream = null;
-		try {
-			// setup structuredModel
-			inputStream = new FileInputStream(fileName);
-			structuredModel = StructuredModelManager.getModelManager().getModelForRead(fileName, inputStream, null);
-
-			// cleanup
-			cleanupModel(structuredModel, start, length);
-
-			// save output to file
-			//outputStream = new FileOutputStream(fileName);
-			structuredModel.save();
-		} finally {
-			//ensureClosed(outputStream, inputStream);
-			// release from model manager
-			if (structuredModel != null)
-				structuredModel.releaseFromRead();
-		}
-	}
-
-	public void cleanupModel(IStructuredModel structuredModel) {
-
-		int start = 0;
-		int length = structuredModel.getStructuredDocument().getLength();
-		cleanupModel(structuredModel, start, length);
-	}
-
-	public void cleanupModel(IStructuredModel structuredModel, int start, int length) {
-
-		if (structuredModel != null) {
-			if ((start >= 0) && (length <= structuredModel.getStructuredDocument().getLength())) {
-				Vector activeNodes = getActiveNodes(structuredModel, start, length);
-				if (activeNodes.size() > 0) {
-					Node firstNode = (Node) activeNodes.firstElement();
-					Node lastNode = (Node) activeNodes.lastElement();
-					boolean done = false;
-					Node eachNode = firstNode;
-					Node nextNode = null;
-					while (!done) {
-						// update "done"
-						done = (eachNode == lastNode);
-
-						// get next sibling before cleanup because eachNode
-						// may
-						// be deleted,
-						// for example when it's an empty text node
-						nextNode = eachNode.getNextSibling();
-
-						// cleanup selected node(s)
-						cleanupNode(eachNode);
-
-						// update each node
-						if (nextNode != null && nextNode.getParentNode() == null)
-							// nextNode is deleted during cleanup
-							eachNode = eachNode.getNextSibling();
-						else
-							eachNode = nextNode;
-
-						// This should not be needed, but just in case
-						// something went wrong with with eachNode.
-						// We don't want an infinite loop here.
-						if (eachNode == null)
-							done = true;
-					}
-
-					// format source
-					if (getFormatSourcePreference(structuredModel)) {
-						// format the document
-						IStructuredFormatProcessor formatProcessor = getFormatProcessor();
-						formatProcessor.formatModel(structuredModel);
-					}
-
-					// convert EOL codes
-					if (getConvertEOLCodesPreference(structuredModel)) {
-						IDocument document = structuredModel.getStructuredDocument();
-						String endOfLineCode = getEOLCodePreference(structuredModel);
-						String endOfLineCodeString = null;
-						if (endOfLineCode.compareTo(CommonEncodingPreferenceNames.LF) == 0)
-							endOfLineCodeString = CommonEncodingPreferenceNames.STRING_LF;
-						else if (endOfLineCode.compareTo(CommonEncodingPreferenceNames.CR) == 0)
-							endOfLineCodeString = CommonEncodingPreferenceNames.STRING_CR;
-						else if (endOfLineCode.compareTo(CommonEncodingPreferenceNames.CRLF) == 0)
-							endOfLineCodeString = CommonEncodingPreferenceNames.STRING_CRLF;
-						if (endOfLineCodeString != null) {
-							convertLineDelimiters(document, endOfLineCodeString);
-							// DMW: 8/24/2002 setting line delimiter in
-							// document allows
-							// subsequent editing to insert the same line
-							// delimiter.
-							if (document instanceof IStructuredDocument) {
-								((IStructuredDocument) document).setLineDelimiter(endOfLineCodeString);
-							}
-							structuredModel.setDirtyState(true);
-						}
-					}
-				}
-			}
-		}
-	}
-
-	public void cleanupNode(Node node) {
-		if (node != null) {
-			Node cleanupNode = node;
-
-			// cleanup the owner node if it's an attribute node
-			if (cleanupNode.getNodeType() == Node.ATTRIBUTE_NODE)
-				cleanupNode = ((Attr) cleanupNode).getOwnerElement();
-
-			// refresh cleanup preferences before getting cleanup handler
-			if (refreshCleanupPreferences)
-				refreshCleanupPreferences();
-
-			// get cleanup handler
-			IStructuredCleanupHandler cleanupHandler = getCleanupHandler(cleanupNode);
-			if (cleanupHandler != null) {
-				// cleanup each node
-				cleanupHandler.cleanup(cleanupNode);
-			}
-		}
-	}
-
-	protected void convertLineDelimiters(IDocument document, String newDelimiter) {
-		final int lineCount = document.getNumberOfLines();
-		Map partitioners = TextUtilities.removeDocumentPartitioners(document);		
-		try {
-			for (int i = 0; i < lineCount; i++) {
-				final String delimiter = document.getLineDelimiter(i);
-				if (delimiter != null && delimiter.length() > 0 && !delimiter.equals(newDelimiter)) {
-					IRegion region = document.getLineInformation(i);
-					document.replace(region.getOffset() + region.getLength(), delimiter.length(), newDelimiter);
-				}
-			}
-		} catch (BadLocationException e) {
-			Logger.logException(e);
-		} finally {
-			TextUtilities.addDocumentPartitioners(document, partitioners);
-		}
-	}
-
-	protected void ensureClosed(OutputStream outputStream, InputStream inputStream) {
-		try {
-			if (inputStream != null) {
-				inputStream.close();
-			}
-		} catch (IOException e) {
-			Logger.logException(e); // hopeless
-		}
-		try {
-			if (outputStream != null) {
-				outputStream.close();
-			}
-		} catch (IOException e) {
-			Logger.logException(e); // hopeless
-		}
-	}
-
-	protected Vector getActiveNodes(IStructuredModel structuredModel, int startNodeOffset, int length) {
-		Vector activeNodes = new Vector();
-
-		if (structuredModel != null) {
-			Node startNode = (Node) structuredModel.getIndexedRegion(startNodeOffset);
-			Node endNode = (Node) structuredModel.getIndexedRegion(startNodeOffset + length);
-
-			// make sure it's an non-empty document
-			if (startNode != null) {
-				while (isSiblingOf(startNode, endNode) == false) {
-					if (endNode != null)
-						endNode = endNode.getParentNode();
-					if (endNode == null) {
-						startNode = startNode.getParentNode();
-						endNode = (Node) structuredModel.getIndexedRegion(startNodeOffset + length);
-					}
-				}
-
-				while (startNode != endNode) {
-					activeNodes.addElement(startNode);
-					startNode = startNode.getNextSibling();
-				}
-				if (startNode != null)
-					activeNodes.addElement(startNode);
-			}
-		}
-
-		return activeNodes;
-	}
-
-	abstract protected IStructuredCleanupHandler getCleanupHandler(Node node);
-
-	abstract protected String getContentType();
-
-	protected boolean getConvertEOLCodesPreference(IStructuredModel structuredModel) {
-
-		boolean convertEOLCodes = true;
-		IStructuredCleanupHandler cleanupHandler = getCleanupHandler((Node) structuredModel.getIndexedRegion(0));
-		if (cleanupHandler != null) {
-			IStructuredCleanupPreferences cleanupPreferences = cleanupHandler.getCleanupPreferences();
-			convertEOLCodes = cleanupPreferences.getConvertEOLCodes();
-		}
-		return convertEOLCodes;
-	}
-
-	protected String getEOLCodePreference(IStructuredModel structuredModel) {
-
-		String eolCode = System.getProperty("line.separator"); //$NON-NLS-1$
-
-		IStructuredCleanupHandler cleanupHandler = getCleanupHandler((Node) structuredModel.getIndexedRegion(0));
-		if (cleanupHandler != null) {
-			IStructuredCleanupPreferences cleanupPreferences = cleanupHandler.getCleanupPreferences();
-			eolCode = cleanupPreferences.getEOLCode();
-		}
-		return eolCode;
-	}
-
-	abstract protected IStructuredFormatProcessor getFormatProcessor();
-
-	protected boolean getFormatSourcePreference(IStructuredModel structuredModel) {
-
-		boolean formatSource = true;
-		IStructuredCleanupHandler cleanupHandler = getCleanupHandler((Node) structuredModel.getIndexedRegion(0));
-		if (cleanupHandler != null) {
-			IStructuredCleanupPreferences cleanupPreferences = cleanupHandler.getCleanupPreferences();
-			formatSource = cleanupPreferences.getFormatSource();
-		}
-		return formatSource;
-	}
-
-	protected boolean isSiblingOf(Node node, Node endNode) {
-		if (endNode == null) {
-			return true;
-		} else {
-			Node siblingNode = node;
-			while (siblingNode != null) {
-				if (siblingNode == endNode)
-					return true;
-				else
-					siblingNode = siblingNode.getNextSibling();
-			}
-			return false;
-		}
-	}
-
-	abstract protected void refreshCleanupPreferences();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupHandler.java
deleted file mode 100644
index 1a0dd8a..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupHandler.java
+++ /dev/null
@@ -1,23 +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.sse.core.internal.cleanup;
-
-import org.w3c.dom.Node;
-
-public interface IStructuredCleanupHandler {
-	Node cleanup(Node node);
-
-	IStructuredCleanupPreferences getCleanupPreferences();
-
-	void setCleanupPreferences(IStructuredCleanupPreferences cleanupPreferences);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupPreferences.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupPreferences.java
deleted file mode 100644
index a848532..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupPreferences.java
+++ /dev/null
@@ -1,56 +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.sse.core.internal.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-
-public interface IStructuredCleanupPreferences {
-
-	int getAttrNameCase();
-
-	boolean getCompressEmptyElementTags();
-
-	boolean getConvertEOLCodes();
-
-	String getEOLCode();
-
-	boolean getFormatSource();
-
-	boolean getInsertMissingTags();
-
-	boolean getInsertRequiredAttrs();
-
-	boolean getQuoteAttrValues();
-
-	int getTagNameCase();
-
-	void setAttrNameCase(int attrNameCase);
-
-	void setCompressEmptyElementTags(boolean compressEmptyElementTags);
-
-	void setConvertEOLCodes(boolean convertEOLCodes);
-
-	void setEOLCode(String EOLCode);
-
-	void setFormatSource(boolean formatSource);
-
-	void setInsertMissingTags(boolean insertMissingTags);
-
-	void setInsertRequiredAttrs(boolean insertRequiredAttrs);
-
-	void setPreferences(Preferences preferences);
-
-	void setQuoteAttrValues(boolean quoteAttrValues);
-
-	void setTagNameCase(int tagNameCase);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupProcessor.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupProcessor.java
deleted file mode 100644
index 5b31c42..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupProcessor.java
+++ /dev/null
@@ -1,114 +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.sse.core.internal.cleanup;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.w3c.dom.Node;
-
-/**
- * This interface and related classes are 'internal' and should not 
- * be treated as API, even though used across components in WTP. 
- * Consider it a work in progress.
- */
-
-public interface IStructuredCleanupProcessor {
-	/**
-	 * This form of the CleanupProcessor takes an input string as input,
-	 * creates an InputStream from the input string, create a temporary model
-	 * of the content type specified, cleanups the whole model, then returns
-	 * the cleaned up input string.
-	 */
-	String cleanupContent(String content) throws IOException, CoreException;
-
-	/**
-	 * This form of the CleanupProcessor takes an input string as input,
-	 * creates an InputStream from the input string, create a temporary model
-	 * of the content type specified, cleanups the model within start and
-	 * length, then returns the cleaned up input string.
-	 */
-	String cleanupContent(String content, int start, int length) throws IOException, CoreException;
-
-	/**
-	 * This form of the CleanupProcessor takes an IDocument as input, creates
-	 * a temporary model of content type calculated using the IDocument's file
-	 * extension, cleanups the whole model, then releases the model.
-	 */
-	void cleanupDocument(IDocument document) throws IOException, CoreException;
-
-	/**
-	 * This form of the CleanupProcessor takes an IDocument as input, creates
-	 * a temporary model of content type calculated using the IDocument's file
-	 * extension, cleanups the model within start and length, then releases
-	 * the model.
-	 */
-	void cleanupDocument(IDocument document, int start, int length) throws IOException, CoreException;
-
-	/**
-	 * This form of the CleanupProcessor takes an IFile as input, creates a
-	 * temporary model of content type calculated using the IFile's file
-	 * extension, cleanups the whole model, then releases the model. The IFile
-	 * is updated when the last reference of the model is released in the
-	 * model manager.
-	 */
-	void cleanupFile(IFile file) throws IOException, CoreException;
-
-	/**
-	 * This form of the CleanupProcessor takes an IFile as input, creates a
-	 * temporary model of content type calculated using the IFile's file
-	 * extension, cleanups the model within start and length, then releases
-	 * the model. The IFile is updated when the last reference of the model is
-	 * released in the model manager.
-	 */
-	void cleanupFile(IFile file, int start, int length) throws IOException, CoreException;
-
-	/**
-	 * This form of the CleanupProcessor takes a file name as input,creates an
-	 * InputStream from the file, create a temporary model of content type
-	 * calculated using the file name's file extension, cleanups the whole
-	 * model, then releases the model. The file is updated when the last
-	 * reference of the model is released in the model manager.
-	 */
-	void cleanupFileName(String fileName) throws IOException, CoreException;
-
-	/**
-	 * This form of the CleanupProcessor takes a file name as input,creates an
-	 * InputStream from the file, create a temporary model of content type
-	 * calculated using the file name's file extension, cleanups the model
-	 * within start and length, then releases the model. The file is updated
-	 * when the last reference of the model is released in the model manager.
-	 */
-	void cleanupFileName(String fileName, int start, int length) throws IOException, CoreException;
-
-	/**
-	 * This form of the CleanupProcessor takes a model as input, and cleanups
-	 * the whole model.
-	 */
-	void cleanupModel(IStructuredModel structuredModel);
-
-	/**
-	 * This form of the CleanupProcessor takes a model as input, and cleanups
-	 * the model within start and length.
-	 */
-	void cleanupModel(IStructuredModel structuredModel, int start, int length);
-
-	/**
-	 * This form of the CleanupProcessor takes a node as input, and formats
-	 * the node and all its children.
-	 */
-	void cleanupNode(Node node);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredCleanupPreferences.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredCleanupPreferences.java
deleted file mode 100644
index 65fbfcf..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredCleanupPreferences.java
+++ /dev/null
@@ -1,135 +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.sse.core.internal.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-
-
-public class StructuredCleanupPreferences implements IStructuredCleanupPreferences {
-	private int fAttrNameCase;
-	private boolean fCompressEmptyElementTags;
-	private boolean fConvertEOLCodes;
-	private String fEOLCode;
-	private boolean fFormatSource;
-	private boolean fInsertMissingTags;
-	private boolean fInsertRequiredAttrs;
-	//private IPreferenceStore fPreferenceStore = null;
-	private Preferences fPreferences = null;
-	private boolean fQuoteAttrValues;
-
-	private int fTagNameCase;
-
-	public int getAttrNameCase() {
-
-		return fAttrNameCase;
-	}
-
-	public boolean getCompressEmptyElementTags() {
-
-		return fCompressEmptyElementTags;
-	}
-
-	public boolean getConvertEOLCodes() {
-
-		return fConvertEOLCodes;
-	}
-
-	public String getEOLCode() {
-
-		return fEOLCode;
-	}
-
-	public boolean getFormatSource() {
-
-		return fFormatSource;
-	}
-
-	public boolean getInsertMissingTags() {
-
-		return fInsertMissingTags;
-	}
-
-	public boolean getInsertRequiredAttrs() {
-
-		return fInsertRequiredAttrs;
-	}
-
-	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 setCompressEmptyElementTags(boolean compressEmptyElementTags) {
-
-		fCompressEmptyElementTags = compressEmptyElementTags;
-	}
-
-	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 setInsertRequiredAttrs(boolean insertRequiredAttrs) {
-
-		fInsertRequiredAttrs = insertRequiredAttrs;
-	}
-
-	public void setPreferences(Preferences prefs) {
-
-		fPreferences = prefs;
-	}
-
-	public void setQuoteAttrValues(boolean quoteAttrValues) {
-
-		fQuoteAttrValues = quoteAttrValues;
-	}
-
-	public void setTagNameCase(int tagNameCase) {
-
-		fTagNameCase = tagNameCase;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandler.java
deleted file mode 100644
index 00869af..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandler.java
+++ /dev/null
@@ -1,20 +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.sse.core.internal.cleanup;
-
-public interface StructuredContentCleanupHandler {
-
-	IStructuredCleanupProcessor getCleanupProcessor(String contentType);
-
-	void setCleanupProcessor(IStructuredCleanupProcessor cleanupProcessor, String contentType);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandlerImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandlerImpl.java
deleted file mode 100644
index 6b4c9d0..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandlerImpl.java
+++ /dev/null
@@ -1,43 +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.sse.core.internal.cleanup;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.text.Assert;
-
-public class StructuredContentCleanupHandlerImpl implements StructuredContentCleanupHandler {
-	protected Map fCleanupProcessors;
-
-	public IStructuredCleanupProcessor getCleanupProcessor(String contentType) {
-		Assert.isNotNull(contentType);
-
-		if (fCleanupProcessors == null)
-			return null;
-
-		return (IStructuredCleanupProcessor) fCleanupProcessors.get(contentType);
-	}
-
-	public void setCleanupProcessor(IStructuredCleanupProcessor cleanupProcessor, String contentType) {
-		Assert.isNotNull(contentType);
-
-		if (fCleanupProcessors == null)
-			fCleanupProcessors = new HashMap();
-
-		if (fCleanupProcessors == null)
-			fCleanupProcessors.remove(contentType);
-		else
-			fCleanupProcessors.put(contentType, cleanupProcessor);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/AbstractDocumentLoader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/AbstractDocumentLoader.java
deleted file mode 100644
index dda92ea..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/AbstractDocumentLoader.java
+++ /dev/null
@@ -1,396 +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.sse.core.internal.document;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.MalformedInputException;
-import java.nio.charset.UnmappableCharacterException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.encoding.CodedReaderCreator;
-import org.eclipse.wst.sse.core.internal.encoding.ContentTypeEncodingPreferences;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.exceptions.MalformedInputExceptionWithDetail;
-import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-
-
-
-/**
- * This class reads a file and creates an Structured Model.
- */
-public abstract class AbstractDocumentLoader implements IDocumentLoader {
-
-	private CodedReaderCreator fCodedReaderCreator;
-	protected IDocumentCharsetDetector fDocumentEncodingDetector;
-	// private boolean fPropertiesObtained;
-
-	protected EncodingMemento fEncodingMemento;
-	protected Reader fFullPreparedReader;
-
-	/**
-	 * AbstractLoader constructor also initializes encoding converter/mapper
-	 */
-	public AbstractDocumentLoader() {
-		super();
-	}
-
-	protected final StringBuffer convertLineDelimiters(StringBuffer allTextBuffer, String lineDelimiterToUse) {
-		// TODO: avoid use of String instance
-		String allText = allTextBuffer.toString();
-		IDocument tempDoc = new Document(allText);
-		if (lineDelimiterToUse == null)
-			lineDelimiterToUse = System.getProperty("line.separator"); //$NON-NLS-1$
-		StringBuffer newText = new StringBuffer();
-		int lineCount = tempDoc.getNumberOfLines();
-		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.append(allText.substring(lineStartOffset, lineEndOffset));
-				if ((i < lineCount - 1) && (tempDoc.getLineDelimiter(i) != null))
-					newText.append(lineDelimiterToUse);
-			}
-			catch (org.eclipse.jface.text.BadLocationException exception) {
-				// should fix up to either throw nothing, or the right thing,
-				// but
-				// in the course of refactoring, this was easiest "quick fix".
-				throw new RuntimeException(exception);
-			}
-		}
-		return newText;
-	}
-
-	/**
-	 * This method must return a new instance of IEncodedDocument, that has
-	 * been initialized with appropriate parser. For many loaders, the
-	 * (default) parser used is known for any input. For others, the correct
-	 * parser (and its initialization) is normally dependent on the content of
-	 * the file. This no-argument method should assume "empty input" and would
-	 * therefore return the default parser for the default contentType.
-	 */
-	public IEncodedDocument createNewStructuredDocument() {
-		IEncodedDocument structuredDocument = newEncodedDocument();
-		// Make sure every structuredDocument has an Encoding Memento,
-		// which is the default one for "empty" structuredDocuments
-		String charset = ContentTypeEncodingPreferences.useDefaultNameRules(getDocumentEncodingDetector());
-		String specDefaultCharset = getDocumentEncodingDetector().getSpecDefaultEncoding();
-		structuredDocument.setEncodingMemento(CodedIO.createEncodingMemento(charset, EncodingMemento.DEFAULTS_ASSUMED_FOR_EMPTY_INPUT, specDefaultCharset));
-
-		IDocumentPartitioner defaultPartitioner = getDefaultDocumentPartitioner();
-		if (structuredDocument instanceof IDocumentExtension3) {
-			((IDocumentExtension3) structuredDocument).setDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, defaultPartitioner);
-		}
-		else {
-			structuredDocument.setDocumentPartitioner(defaultPartitioner);
-		}
-		defaultPartitioner.connect(structuredDocument);
-
-		return structuredDocument;
-	}
-
-	/**
-	 * This abstract version should handle most cases, but won't if
-	 * contentType is sensitive to encoding, and/or embedded types
-	 */
-	public IEncodedDocument createNewStructuredDocument(IFile iFile) throws IOException, CoreException {
-		IEncodedDocument structuredDocument = createNewStructuredDocument();
-		try {
-
-			CodedReaderCreator creator = getCodedReaderCreator();
-			creator.set(iFile);
-			fEncodingMemento = creator.getEncodingMemento();
-			structuredDocument.setEncodingMemento(fEncodingMemento);
-			fFullPreparedReader = getCodedReaderCreator().getCodedReader();
-
-			setDocumentContentsFromReader(structuredDocument, fFullPreparedReader);
-		}
-		finally {
-			if (fFullPreparedReader != null) {
-				fFullPreparedReader.close();
-			}
-		}
-		return structuredDocument;
-	}
-
-	public IEncodedDocument createNewStructuredDocument(String filename, InputStream inputStream) throws UnsupportedEncodingException, IOException {
-		return createNewStructuredDocument(filename, inputStream, EncodingRule.CONTENT_BASED);
-	}
-
-	public IEncodedDocument createNewStructuredDocument(String filename, InputStream inputStream, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException {
-		if (filename == null && inputStream == null) {
-			throw new IllegalArgumentException("can not have both null filename and inputstream"); //$NON-NLS-1$
-		}
-		IEncodedDocument structuredDocument = createNewStructuredDocument();
-		CodedReaderCreator codedReaderCreator = getCodedReaderCreator();
-		try {
-			codedReaderCreator.set(filename, inputStream);
-			codedReaderCreator.setEncodingRule(encodingRule);
-			fEncodingMemento = codedReaderCreator.getEncodingMemento();
-			fFullPreparedReader = codedReaderCreator.getCodedReader();
-			structuredDocument.setEncodingMemento(fEncodingMemento);
-			setDocumentContentsFromReader(structuredDocument, fFullPreparedReader);
-		}
-		catch (CoreException e) {
-			// impossible in this context
-			throw new Error(e);
-		}
-		finally {
-			if (fFullPreparedReader != null) {
-				fFullPreparedReader.close();
-			}
-		}
-
-		return structuredDocument;
-	}
-
-	private int getCharPostionOfFailure(BufferedReader inputStream) {
-		int charPosition = 1;
-		int charRead = -1;
-		boolean errorFound = false;
-		do {
-			try {
-				charRead = inputStream.read();
-				charPosition++;
-			}
-			catch (IOException e) {
-				// this is expected, since we're expecting failure,
-				// so no need to do anything.
-				errorFound = true;
-				break;
-			}
-		}
-		while (!(charRead == -1 || errorFound));
-
-		if (errorFound)
-			// dmw, blindly modified to +1 to get unit tests to work, moving
-			// from Java 1.3, to 1.4
-			// not sure how/why this behavior would have changed. (Its as if
-			// 'read' is reporting error
-			// one character early).
-			return charPosition + 1;
-		else
-			return -1;
-	}
-
-	/**
-	 * @return Returns the codedReaderCreator.
-	 */
-	protected CodedReaderCreator getCodedReaderCreator() {
-		if (fCodedReaderCreator == null) {
-			fCodedReaderCreator = new CodedReaderCreator();
-		}
-		return fCodedReaderCreator;
-	}
-
-	/**
-	 * Creates the partitioner to be used with the
-	 * IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING partitioning
-	 * 
-	 * @return IDocumentPartitioner
-	 */
-	public abstract IDocumentPartitioner getDefaultDocumentPartitioner();
-
-	/**
-	 * Returns the encodingMemento.
-	 * 
-	 * @return EncodingMemento
-	 */
-	public EncodingMemento getEncodingMemento() {
-		if (fEncodingMemento == null) {
-			throw new IllegalStateException("Program Error: encodingMemento was accessed before it was set"); //$NON-NLS-1$
-		}
-		return fEncodingMemento;
-	}
-
-	/**
-	 * @return Returns the fullPreparedReader.
-	 */
-	protected Reader getFullPreparedReader() throws UnsupportedEncodingException, CoreException, IOException {
-		if (fFullPreparedReader == null) {
-			fFullPreparedReader = getCodedReaderCreator().getCodedReader();
-		}
-		return fFullPreparedReader;
-	}
-
-	/**
-	 * If subclass doesn't implement, return null
-	 */
-	protected String getPreferredNewLineDelimiter() {
-		return null;
-	}
-
-	/**
-	 * A utility method, but depends on subclasses to impliment 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
-	 * needed, but sets the correct end-of-line delimiter in
-	 * structuredDocument. Minor note: can't use this exact method in dumpers,
-	 * since the decision to change or not is a little different, and since
-	 * there we have to change text of structuredDocument if found to need
-	 * conversion. (Where as for loading, we assume we haven't yet set text in
-	 * structuredDocument, but will be done by other method just a tiny biy
-	 * later). Needs to be public to handle interface. It is in the interface
-	 * just so ModelManagerImpl can use it in a special circumstance.
-	 */
-	public StringBuffer handleLineDelimiter(StringBuffer originalString, IEncodedDocument theFlatModel) {
-		// TODO: need to handle line delimiters so Marker Positions are
-		// updated
-		StringBuffer convertedText = null;
-		// based on text, make a guess on what's being used as
-		// line delimiter
-		String probableLineDelimiter = TextUtilities.determineLineDelimiter(originalString, theFlatModel.getLegalLineDelimiters(), System.getProperty("line.separator")); //$NON-NLS-1$
-		String preferredLineDelimiter = getPreferredNewLineDelimiter();
-		if (preferredLineDelimiter == null) {
-			// when preferredLineDelimiter is null, it means "leave alone"
-			// so no conversion needed.
-			// set here, only if null (should already be set, but if not,
-			// we'll set so any subsequent editing inserts what we're
-			// assuming)
-			if (!theFlatModel.getPreferredLineDelimiter().equals(probableLineDelimiter)) {
-				theFlatModel.setPreferredLineDelimiter(probableLineDelimiter);
-			}
-			convertedText = originalString;
-		}
-		else {
-			if (!preferredLineDelimiter.equals(probableLineDelimiter)) {
-				// technically, wouldn't have to convert line delimiters
-				// here at beginning, but when we save, if the preferred
-				// line delimter is "leave alone" then we do leave alone,
-				// so best to be right from beginning.
-				convertedText = convertLineDelimiters(originalString, preferredLineDelimiter);
-				theFlatModel.setPreferredLineDelimiter(preferredLineDelimiter);
-			}
-			else {
-				// they are already the same, no conversion needed
-				theFlatModel.setPreferredLineDelimiter(preferredLineDelimiter);
-				convertedText = originalString;
-			}
-		}
-		return convertedText;
-	}
-
-	protected abstract IEncodedDocument newEncodedDocument();
-
-	/**
-	 * Very mechanical method, just to read the characters, once the reader is
-	 * correctly created. Can throw MalFormedInputException.
-	 */
-	private StringBuffer readInputStream(Reader reader) throws IOException {
-
-		int fBlocksRead = 0;
-		StringBuffer buffer = new StringBuffer();
-		int numRead = 0;
-		try {
-			char tBuff[] = new char[CodedIO.MAX_BUF_SIZE];
-			while (numRead != -1) {
-				numRead = reader.read(tBuff, 0, tBuff.length);
-				if (numRead > 0) {
-					buffer.append(tBuff, 0, numRead);
-					fBlocksRead++;
-				}
-			}
-		}
-		catch (MalformedInputException e) {
-			throw new MalformedInputExceptionWithDetail(fEncodingMemento.getJavaCharsetName(), fBlocksRead * CodedIO.MAX_BUF_SIZE + numRead + e.getInputLength());
-		}
-		catch (UnmappableCharacterException e) {
-			throw new MalformedInputExceptionWithDetail(fEncodingMemento.getJavaCharsetName(), fBlocksRead * CodedIO.MAX_BUF_SIZE + numRead + e.getInputLength());
-
-		}
-		return buffer;
-	}
-
-	public void reload(IEncodedDocument encodedDocument, Reader inputStreamReader) throws IOException {
-		if (inputStreamReader == null) {
-			throw new IllegalArgumentException("stream reader can not be null"); //$NON-NLS-1$
-		}
-		int READ_BUFFER_SIZE = 8192;
-		int MAX_BUFFERED_SIZE_FOR_RESET_MARK = 200000;
-		// temp .... eventually we'lll only read as needed
-		BufferedReader bufferedReader = new BufferedReader(inputStreamReader, MAX_BUFFERED_SIZE_FOR_RESET_MARK);
-		bufferedReader.mark(MAX_BUFFERED_SIZE_FOR_RESET_MARK);
-		StringBuffer buffer = new StringBuffer();
-		try {
-			int numRead = 0;
-			char tBuff[] = new char[READ_BUFFER_SIZE];
-			while ((numRead = bufferedReader.read(tBuff, 0, tBuff.length)) != -1) {
-				buffer.append(tBuff, 0, numRead);
-			}
-			// remember -- we didn't open stream ... so we don't close it
-		}
-		catch (MalformedInputException e) {
-			// int pos = e.getInputLength();
-			EncodingMemento localEncodingMemento = getEncodingMemento();
-			boolean couldReset = true;
-			String encodingNameInError = localEncodingMemento.getJavaCharsetName();
-			if (encodingNameInError == null) {
-				encodingNameInError = localEncodingMemento.getDetectedCharsetName();
-			}
-			try {
-				bufferedReader.reset();
-			}
-			catch (IOException resetException) {
-				// the only errro that can occur during reset is an
-				// IOException
-				// due to already being past the rest mark. In that case, we
-				// throw more generic message
-				couldReset = false;
-			}
-			// -1 can be used by UI layer as a code that "position could not
-			// be
-			// determined"
-			int charPostion = -1;
-			if (couldReset) {
-
-				charPostion = getCharPostionOfFailure(bufferedReader);
-				// getCharPostionOfFailure(new InputStreamReader(inStream,
-				// javaEncodingNameInError));
-			}
-			// all of that just to throw more accurate error
-			// note: we do the conversion to ianaName, instead of using the
-			// local
-			// variable,
-			// because this is ultimately only for the user error message
-			// (that
-			// is,
-			// the error occurred
-			// in context of javaEncodingName no matter what ianaEncodingName
-			// is
-			throw new MalformedInputExceptionWithDetail(encodingNameInError, CodedIO.getAppropriateJavaCharset(encodingNameInError), charPostion, !couldReset, MAX_BUFFERED_SIZE_FOR_RESET_MARK);
-		}
-		StringBuffer stringbuffer = buffer;
-		encodedDocument.set(stringbuffer.toString());
-
-	}
-
-	protected void setDocumentContentsFromReader(IEncodedDocument structuredDocument, Reader reader) throws IOException {
-
-		StringBuffer allText = readInputStream(reader);
-		structuredDocument.set(allText.toString());
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/DocumentReader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/DocumentReader.java
deleted file mode 100644
index 64b5b10..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/DocumentReader.java
+++ /dev/null
@@ -1,125 +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.sse.core.internal.document;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.jface.text.IDocument;
-
-/**
- * A java.io.Reader that can operate off of an IDocument.
- */
-public class DocumentReader extends Reader {
-	private IDocument fDocument = null;
-	private int mark = 0;
-	private int position = 0;
-
-	public DocumentReader() {
-		super();
-	}
-
-	public DocumentReader(IDocument document) {
-		this(document, 0);
-	}
-
-	public DocumentReader(IDocument document, int initialPosition) {
-		super();
-		fDocument = document;
-		position = initialPosition;
-	}
-
-	public void close() throws IOException {
-		// do nothing for a 'document'
-	}
-
-	/**
-	 * @return
-	 */
-	public IDocument getDocument() {
-		return fDocument;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.Reader#mark(int)
-	 */
-	public void mark(int readAheadLimit) throws IOException {
-		mark = position;
-	}
-
-	public boolean markSupported() {
-		return true;
-	}
-
-	public int read(char[] cbuf, int off, int len) throws IOException {
-		char[] readChars = null;
-		try {
-			if (position >= fDocument.getLength())
-				return -1;
-			// the IDocument is likely using a GapTextStore, so we can't
-			// retrieve a char[] directly
-			if (position + len > fDocument.getLength())
-				readChars = fDocument.get(position, fDocument.getLength() - position).toCharArray();
-			else
-				readChars = fDocument.get(position, len).toCharArray();
-			System.arraycopy(readChars, 0, cbuf, off, readChars.length);
-			//				System.out.println("" + position + ":" + readChars.length + " "
-			// + StringUtils.escape(new String(readChars)));
-			position += readChars.length;
-			return readChars.length;
-		} catch (Exception e) {
-			throw new IOException("Exception while reading from IDocument: " + e); //$NON-NLS-1$
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.Reader#reset()
-	 */
-	public void reset() throws IOException {
-		position = mark;
-	}
-
-	public void reset(IDocument document, int initialPosition) {
-		fDocument = document;
-		position = initialPosition;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.Reader#reset()
-	 */
-	public void reset(int pos) throws IOException {
-		position = pos;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.Reader#skip(long)
-	 */
-	public long skip(long n) throws IOException {
-		long skipped = n;
-		if (position + n > fDocument.getLength()) {
-			skipped = fDocument.getLength() - position;
-			position = fDocument.getLength();
-		} else {
-			position += n;
-		}
-		return skipped;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentCharsetDetector.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentCharsetDetector.java
deleted file mode 100644
index 697b70e..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentCharsetDetector.java
+++ /dev/null
@@ -1,22 +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.sse.core.internal.document;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-
-
-
-public interface IDocumentCharsetDetector extends IResourceCharsetDetector {
-	void set(IDocument document);
-}
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
deleted file mode 100644
index e6b7b48..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentLoader.java
+++ /dev/null
@@ -1,70 +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.sse.core.internal.document;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
-
-
-public interface IDocumentLoader {
-
-	IEncodedDocument createNewStructuredDocument();
-
-	/**
-	 * This API is like createNewStructuredDocument, except it should populate
-	 * the structuredDocument with the contents of IFile. Also, those
-	 * StructuredDocuments which are sensitive to the input (that is, the
-	 * parser or parser initialization my require the input) should
-	 * additionally initialize the parser, etc., appropriate to the input.
-	 * 
-	 * As always, the appropriate decoding should be used.
-	 */
-	IEncodedDocument createNewStructuredDocument(IFile iFile) throws java.io.IOException, CoreException;
-
-	/**
-	 * This method must return a new instance of IEncodedDocument, that has
-	 * been initialized with appropriate parser. For many loaders, the
-	 * (default) parser used is known for any input. For others, the correct
-	 * parser (and its initialization) is normally dependent on the content of
-	 * the file. This no-argument method should assume "empty input" and would
-	 * therefore return the default parser for the default contentType.
-	 */
-	IEncodedDocument createNewStructuredDocument(String filename, InputStream istream) throws java.io.IOException;
-
-	IEncodedDocument createNewStructuredDocument(String filename, InputStream istream, EncodingRule encodingRule) throws java.io.IOException;
-
-	IDocumentPartitioner getDefaultDocumentPartitioner();
-
-	IDocumentCharsetDetector getDocumentEncodingDetector();
-
-	/**
-	 * A utility method, but depends on subclasses to impliment 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
-	 * needed, but sets the correct end-of-line delimiter in
-	 * structuredDocument. The returned value is either the original string,
-	 * if no conversion is needed, or a new string with end-of-lines
-	 * converted.
-	 */
-	StringBuffer handleLineDelimiter(StringBuffer originalString, IEncodedDocument theStructuredDocument);
-
-	void reload(IEncodedDocument document, Reader reader) throws IOException;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/StructuredDocumentFactory.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/StructuredDocumentFactory.java
deleted file mode 100644
index fe5df34..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/StructuredDocumentFactory.java
+++ /dev/null
@@ -1,66 +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.sse.core.internal.document;
-
-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.text.BasicStructuredDocument;
-import org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument;
-
-
-/**
- * At the moment, this is primarily intended as a convenience to help switch
- * between various types of threading models in the document, all in a central
- * piece of code.
- */
-public class StructuredDocumentFactory {
-	private static final int WRITE_SYNCHRONIZED = 3;
-	private static final int DEFAULT = WRITE_SYNCHRONIZED;
-	private static final int UNSYNCHRONIZED = 1;
-
-	private static IStructuredDocument getNewStructuredDocumentInstance(int type, RegionParser parser) {
-		IStructuredDocument result = null;
-		switch (type) {
-			case UNSYNCHRONIZED :
-				result = new BasicStructuredDocument(parser);
-				break;
-			case WRITE_SYNCHRONIZED :
-				result = new JobSafeStructuredDocument(parser);
-				break;
-
-			default :
-				throw new IllegalArgumentException("request document type was not known"); //$NON-NLS-1$
-
-		}
-		return result;
-	}
-
-	/**
-	 * Provides the (system default) structured document initialized with the
-	 * parser.
-	 * 
-	 * @param parser
-	 * @return
-	 */
-	public static IStructuredDocument getNewStructuredDocumentInstance(RegionParser parser) {
-		return getNewStructuredDocumentInstance(DEFAULT, parser);
-	}
-
-	/**
-	 * Not intended to be instantiated
-	 * 
-	 */
-	private StructuredDocumentFactory() {
-		super();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/TextUtilities.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/TextUtilities.java
deleted file mode 100644
index 91ec598..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/TextUtilities.java
+++ /dev/null
@@ -1,73 +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.sse.core.internal.document;
-
-
-/**
- * Collection of text functions.
- * 
- * @deprecated - marked as deprecated to remind us to phase this out (and/or
- *             move to "finished" version).
- */
-public class TextUtilities {
-
-	/**
-	 * @deprecated if possible, its best to use
-	 *             IDocument.getLegalLineDelimiters()
-	 */
-	public final static String[] fgDelimiters = new String[]{"\n", "\r", "\r\n"};//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-
-	/**
-	 * Determines which one of fgDelimiters appears first in the text. If none
-	 * of them the hint is returned.
-	 */
-	public static String determineLineDelimiter(StringBuffer textBuffer, String[] possibles, String hint) {
-		try {
-			// TODO: avoid use of String instance
-			String text = textBuffer.toString();
-			int[] info = indexOf(possibles, text, 0);
-			return possibles[info[1]];
-		} catch (ArrayIndexOutOfBoundsException x) {
-		}
-		return hint;
-	}
-
-	/**
-	 * Returns the position in the string greater than offset of the longest
-	 * matching search string.
-	 */
-	private static int[] indexOf(String[] searchStrings, String text, int offset) {
-
-		int[] result = {-1, -1};
-
-		for (int i = 0; i < searchStrings.length; i++) {
-			int index = text.indexOf(searchStrings[i], offset);
-			if (index >= 0) {
-
-				if (result[0] == -1) {
-					result[0] = index;
-					result[1] = i;
-				} else if (index < result[0]) {
-					result[0] = index;
-					result[1] = i;
-				} else if (index == result[0] && searchStrings[i].length() > searchStrings[result[1]].length()) {
-					result[0] = index;
-					result[1] = i;
-				}
-			}
-		}
-
-		return result;
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/filebuffers/BasicStructuredDocumentFactory.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/filebuffers/BasicStructuredDocumentFactory.java
deleted file mode 100644
index e69240e..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/filebuffers/BasicStructuredDocumentFactory.java
+++ /dev/null
@@ -1,91 +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.sse.core.internal.filebuffers;
-
-import org.eclipse.core.filebuffers.IDocumentFactory;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerRegistry;
-import org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument;
-
-
-/**
- * Generic IDocumentFactory for IStructuredDocuments to be used by the
- * org.eclipse.core.filebuffers.documentCreation extension point. This class
- * is not meant to be subclassed.
- * 
- * @plannedfor 1.0
- */
-public class BasicStructuredDocumentFactory implements IDocumentFactory, IExecutableExtension {
-
-	/*
-	 * The content type ID used to declare this factory; it is used to find
-	 * the corresponding support for creating the document
-	 */
-	private String fContentTypeIdentifier = null;
-
-	/**
-	 * Constructor, only to be used by the
-	 * org.eclipse.core.filebuffers.documentCreation extension point.
-	 */
-	public BasicStructuredDocumentFactory() {
-		super();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.filebuffers.IDocumentFactory#createDocument()
-	 */
-	public IDocument createDocument() {
-		IDocument document = null;
-		IContentType contentType = Platform.getContentTypeManager().getContentType(getContentTypeIdentifier());
-		IModelHandler handler = null;
-		while (handler == null && !IContentTypeManager.CT_TEXT.equals(contentType.getId())) {
-			handler = ModelHandlerRegistry.getInstance().getHandlerForContentTypeId(contentType.getId());
-			contentType = contentType.getBaseType();
-		}
-		if (handler != null) {
-			document = handler.getDocumentLoader().createNewStructuredDocument();
-		}
-		else {
-			document = new JobSafeStructuredDocument();
-		}
-		return document;
-	}
-
-	private String getContentTypeIdentifier() {
-		return fContentTypeIdentifier;
-	}
-
-	/*
-	 * Loads the content type ID to be used when creating the Structured Document. 
-	 * 
-	 * @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 {
-		fContentTypeIdentifier = config.getAttribute("contentTypeId"); //$NON-NLS-1$
-		if (data != null) {
-			if (data instanceof String && data.toString().length() > 0) {
-				fContentTypeIdentifier = (String) data;
-			}
-		}
-	}
-}
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
deleted file mode 100644
index a20b1a7..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java
+++ /dev/null
@@ -1,483 +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.sse.core.internal.format;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Vector;
-
-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.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-
-public abstract class AbstractStructuredFormatProcessor implements IStructuredFormatProcessor {
-	protected IStructuredFormatContraints fFormatContraints = null;
-	protected IProgressMonitor fProgressMonitor = null;
-	public boolean refreshFormatPreferences = true; // special flag for JUnit
-
-	protected void ensureClosed(OutputStream outputStream, InputStream inputStream) {
-
-		try {
-			if (inputStream != null) {
-				inputStream.close();
-			}
-		} catch (IOException e) {
-			Logger.logException(e); // hopeless
-		}
-		try {
-			if (outputStream != null) {
-				outputStream.close();
-			}
-		} catch (IOException e) {
-			Logger.logException(e); // hopeless
-		}
-	}
-
-	public String formatContent(String input) throws IOException, CoreException {
-		if (input == null)
-			return input;
-
-		IStructuredModel structuredModel = null;
-		InputStream inputStream = null;
-		try {
-			// setup structuredModel
-			// Note: We are getting model for read. Will return formatted
-			// string and NOT save model.
-			inputStream = new ByteArrayInputStream(input.getBytes("UTF8")); //$NON-NLS-1$
-			String id = inputStream.toString() + "." + getFileExtension(); //$NON-NLS-1$
-			structuredModel = StructuredModelManager.getModelManager().getModelForRead(id, inputStream, null);
-
-			// format
-			formatModel(structuredModel);
-
-			// return output
-			return structuredModel.getStructuredDocument().get();
-		} finally {
-			ensureClosed(null, inputStream);
-			// release from model manager
-			if (structuredModel != null)
-				structuredModel.releaseFromRead();
-		}
-	}
-
-	public String formatContent(String input, int start, int length) throws IOException, CoreException {
-		if (input == null)
-			return input;
-
-		if (start >= 0 && length >= 0 && start + length <= input.length()) {
-			IStructuredModel structuredModel = null;
-			InputStream inputStream = null;
-			try {
-				// setup structuredModel
-				// Note: We are getting model for read. Will return formatted
-				// string and NOT save model.
-				inputStream = new ByteArrayInputStream(input.getBytes("UTF8")); //$NON-NLS-1$
-				String id = inputStream.toString() + "." + getFileExtension(); //$NON-NLS-1$
-				structuredModel = StructuredModelManager.getModelManager().getModelForRead(id, inputStream, null);
-
-				// format
-				formatModel(structuredModel, start, length);
-
-				// return output
-				return structuredModel.getStructuredDocument().get();
-			} finally {
-				ensureClosed(null, inputStream);
-				// release from model manager
-				if (structuredModel != null)
-					structuredModel.releaseFromRead();
-			}
-		} else
-			return input;
-	}
-
-	public void formatDocument(IDocument document) throws IOException, CoreException {
-		if (document == 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().getExistingModelForEdit(document);
-
-			// 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 formatDocument(IDocument document, int start, int length) throws IOException, CoreException {
-		if (document == null)
-			return;
-
-		if (start >= 0 && length >= 0 && start + length <= document.getLength()) {
-			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().getExistingModelForEdit(document);
-
-				// format
-				formatModel(structuredModel, start, length);
-
-				// 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 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 formatFile(IFile file, int start, int length) 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, start, length);
-
-			// 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 formatFileName(String fileName) throws IOException, CoreException {
-		if (fileName == null)
-			return;
-
-		IStructuredModel structuredModel = null;
-		InputStream inputStream = null;
-		//OutputStream outputStream = null;
-		try {
-			// setup structuredModel
-			// Note: We are getting model for edit. Will save model if model
-			// changed.
-			inputStream = new FileInputStream(fileName);
-			structuredModel = StructuredModelManager.getModelManager().getModelForEdit(fileName, inputStream, null);
-
-			// format
-			formatModel(structuredModel);
-
-			// save model if needed
-			if (!structuredModel.isSharedForEdit() && structuredModel.isSaveNeeded())
-				structuredModel.save();
-		} finally {
-			//ensureClosed(outputStream, inputStream);
-			// release from model manager
-			if (structuredModel != null)
-				structuredModel.releaseFromEdit();
-		}
-	}
-
-	public void formatFileName(String fileName, int start, int length) throws IOException, CoreException {
-		if (fileName == null)
-			return;
-
-		IStructuredModel structuredModel = null;
-		InputStream inputStream = null;
-		//OutputStream outputStream = null;
-		try {
-			// setup structuredModel
-			// Note: We are getting model for edit. Will save model if model
-			// changed.
-			inputStream = new FileInputStream(fileName);
-			structuredModel = StructuredModelManager.getModelManager().getModelForEdit(fileName, inputStream, null);
-
-			// format
-			formatModel(structuredModel, start, length);
-
-			// save model if needed
-			if (!structuredModel.isSharedForEdit() && structuredModel.isSaveNeeded())
-				structuredModel.save();
-		} finally {
-			//ensureClosed(outputStream, inputStream);
-			// 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 (structuredModel != null) {
-			try {
-				// whenever formatting model, fire abouttochange/modelchanged
-				structuredModel.aboutToChangeModel();
-				if (start == 0 && length == structuredModel.getStructuredDocument().getLength())
-					setFormatWithSiblingIndent(structuredModel, false);
-				else
-					setFormatWithSiblingIndent(structuredModel, true);
-	
-				if (start >= 0 && length >= 0 && start + length <= structuredModel.getStructuredDocument().getLength()) {
-					Vector activeNodes = getActiveNodes(structuredModel, start, length);
-					if (activeNodes.size() > 0) {
-						Node firstNode = (Node) activeNodes.firstElement();
-						Node lastNode = (Node) activeNodes.lastElement();
-	
-						boolean done = false;
-						Node eachNode = firstNode;
-						Node nextNode = null;
-						// TODO: we should be able to call something like
-						// sequentialRewrite, but
-						// doesn't work for
-						// our case, since we do "gets" during reparsing, so makes
-						// sequential rewrite
-						// store actually
-						// less efficient than gap store. Someday we need our own
-						// gap store, that
-						// handles
-						// structured text more efficiently. I thought I'd leave
-						// this commented out
-						// code here
-						// as a reminder.
-						//					try {
-						//						structuredModel.getStructuredDocument().startSequentialRewrite(false);
-						while (!done) {
-							// update "done"
-							done = (eachNode == lastNode);
-	
-							// get next sibling before format because eachNode
-							// may
-							// be deleted,
-							// for example when it's an empty text node
-							nextNode = eachNode.getNextSibling();
-	
-							// format each node
-							formatNode(eachNode);
-	
-							// update each node
-							if (nextNode != null && nextNode.getParentNode() == null)
-								// nextNode is deleted during format
-								eachNode = eachNode.getNextSibling();
-							else
-								eachNode = nextNode;
-	
-							// This should not be needed, but just in case
-							// something went wrong with with eachNode.
-							// We don't want an infinite loop here.
-							if (eachNode == null)
-								done = true;
-						}
-						//					}
-						//					finally {
-						//						structuredModel.getStructuredDocument().stopSequentialRewrite();
-						//					}
-					}
-				}
-			} finally {
-				// always make sure to fire changedmodel when done
-				structuredModel.changedModel();
-			}
-		}
-	}
-
-	public void formatNode(Node node) {
-		if (node != null) {
-			Node newNode = node;
-
-			// format the owner node if it's an attribute node
-			if (node.getNodeType() == Node.ATTRIBUTE_NODE)
-				newNode = ((Attr) node).getOwnerElement();
-
-			// refresh format preferences before getting formatter
-			if (refreshFormatPreferences)
-				refreshFormatPreferences();
-
-			// get formatter and format contraints
-			IStructuredFormatter formatter = getFormatter(newNode);
-			// TODO_future: added assert to replace "redundant null check".
-			// if formatter is ever null, we should provide some
-			// default formatter to serve as place holder.
-			Assert.isNotNull(formatter, "formatter was null for a node, "); //$NON-NLS-1$
-			IStructuredFormatContraints formatContraints = formatter.getFormatContraints();
-			formatContraints.setFormatWithSiblingIndent(true);
-			// format each node
-			formatter.format(newNode, formatContraints);
-		}
-	}
-
-	protected Vector getActiveNodes(IStructuredModel structuredModel, int startNodeOffset, int length) {
-		Vector activeNodes = new Vector();
-
-		if (structuredModel != null) {
-			Node startNode = (Node) structuredModel.getIndexedRegion(startNodeOffset);
-			// see https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4711
-			//
-			// We have to watch for selection boundary conditions. Use this as
-			// an example: <a>text</a><b>text</b>,
-			// If the whole <a> node is selected, like:
-			// |<a>text</a>|<b>text</b>, we need to substract the length by 1
-			// to find
-			// the node at the end of the selection:
-			// structuredModel.getIndexedRegion(startNodeOffset + length - 1),
-			// or else
-			// we'd find the next adjacent node.
-			//
-			// However, when the selection length is 0 (meaning no text is
-			// selected), the cursor is at the beginning
-			// of the node we want to format: |<a>text</a><b>text</b>, the
-			// node at the end of the selection is:
-			// structuredModel.getIndexedRegion(startNodeOffset + length).
-			int endNodeOffset = length > 0 ? startNodeOffset + length - 1 : startNodeOffset + length;
-			Node endNode = (Node) structuredModel.getIndexedRegion(endNodeOffset);
-
-			// make sure it's an non-empty document
-			if (startNode != null) {
-				while (isSiblingOf(startNode, endNode) == false) {
-					if (endNode != null)
-						endNode = endNode.getParentNode();
-					if (endNode == null) {
-						startNode = startNode.getParentNode();
-						// see
-						// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4711
-						// and notes above
-						endNodeOffset = length > 0 ? startNodeOffset + length - 1 : startNodeOffset + length;
-						endNode = (Node) structuredModel.getIndexedRegion(endNodeOffset);
-					}
-				}
-
-				while (startNode != endNode) {
-					activeNodes.addElement(startNode);
-					startNode = startNode.getNextSibling();
-				}
-				if (startNode != null)
-					activeNodes.addElement(startNode);
-			}
-		}
-
-		return activeNodes;
-	}
-
-	abstract protected String getFileExtension();
-
-	protected IStructuredFormatContraints getFormatContraints(IStructuredModel structuredModel) {
-		// 262135 - NPE during format of empty document
-		if (fFormatContraints == null && structuredModel != null) {
-			Node node = (Node) structuredModel.getIndexedRegion(0);
-
-			if (node != null) {
-				IStructuredFormatter formatter = getFormatter(node);
-				if (formatter != null) {
-					fFormatContraints = formatter.getFormatContraints();
-				}
-			}
-		}
-
-		return fFormatContraints;
-	}
-
-	abstract protected IStructuredFormatter getFormatter(Node node);
-
-	protected boolean isSiblingOf(Node node, Node endNode) {
-		if (endNode == null) {
-			return true;
-		} else {
-			Node siblingNode = node;
-			while (siblingNode != null) {
-				if (siblingNode == endNode)
-					return true;
-				else
-					siblingNode = siblingNode.getNextSibling();
-			}
-			return false;
-		}
-	}
-
-	abstract protected void refreshFormatPreferences();
-
-	protected void setFormatWithSiblingIndent(IStructuredModel structuredModel, boolean formatWithSiblingIndent) {
-		// 262135 - NPE during format of empty document
-		IStructuredFormatContraints formatContraints = getFormatContraints(structuredModel);
-
-		if (formatContraints != null)
-			formatContraints.setFormatWithSiblingIndent(formatWithSiblingIndent);
-	}
-
-	public void setProgressMonitor(IProgressMonitor monitor) {
-		fProgressMonitor = monitor;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatContraints.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatContraints.java
deleted file mode 100644
index 11d7ca2..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatContraints.java
+++ /dev/null
@@ -1,35 +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.sse.core.internal.format;
-
-/**
- * These are items that change from element to element.
- * Passed from node to node in a recursive call.
- * eg. current indent is 2 deep, but for the next node might be 3...
- */
-public interface IStructuredFormatContraints {
-	boolean getClearAllBlankLines();
-
-	String getCurrentIndent();
-
-	boolean getFormatWithSiblingIndent();
-
-	/** 
-	 * some special elements can ignore clearing blank lines
-	 * */
-	void setClearAllBlankLines(boolean clearAllBlankLines);
-
-	void setCurrentIndent(String currentIndent);
-
-	void setFormatWithSiblingIndent(boolean formatWithSiblingIndent);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatPreferences.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatPreferences.java
deleted file mode 100644
index f7819f3..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatPreferences.java
+++ /dev/null
@@ -1,33 +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.sse.core.internal.format;
-
-/**
- * These are items that do not change from element to element.
- * Passed from node to node in a recursive call because sometimes
- * child nodes don't have access to the preferences
- */
-public interface IStructuredFormatPreferences {
-	
-	boolean getClearAllBlankLines();
-
-	String getIndent();
-
-	int getLineWidth();
-
-	void setClearAllBlankLines(boolean clearAllBlankLines);
-
-	void setIndent(String indent);
-
-	void setLineWidth(int lineWidth);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatProcessor.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatProcessor.java
deleted file mode 100644
index 2f24813..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatProcessor.java
+++ /dev/null
@@ -1,70 +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.sse.core.internal.format;
-
-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.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.w3c.dom.Node;
-
-/**
- * The main formatting engine.  
- * Loops through all the nodes in an IStructuredModel.
- */
-public interface IStructuredFormatProcessor {
-
-	/**
-	 * This form of the FormatProcessor takes an IDocument as input, creates a
-	 * temporary model of content type calculated using the IDocument's file
-	 * extension, formats the model within start and length, then releases the
-	 * model.
-	 */
-	void formatDocument(IDocument document, int start, int length) throws IOException, CoreException;
-
-	/**
-	 * This form of the FormatProcessor takes an IFile as input, creates a
-	 * temporary model of content type calculated using the IFile's file
-	 * extension, formats the whole model, then releases the model.
-	 */
-	void formatFile(IFile file) throws IOException, CoreException;
-
-	/**
-	 * This form of the FormatProcessor takes a model as input, and formats
-	 * the whole model.
-	 */
-	void formatModel(IStructuredModel structuredModel);
-
-	/**
-	 * This form of the FormatProcessor takes a model as input, and formats
-	 * the model within start and length.
-	 */
-	void formatModel(IStructuredModel structuredModel, int start, int length);
-
-	/**
-	 * This form of the FormatProcessor takes a node as input, and formats the
-	 * node and all its children.
-	 */
-	void formatNode(Node node);
-
-	/**
-	 * Sets the progress monitor for this <code>IStructuredFormatProcessor</code>.
-	 * The monitor is used to display progress or cancel if the formatter is run 
-	 * in a background job.
-	 * @param monitor
-	 */
-	void setProgressMonitor(IProgressMonitor monitor);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatter.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatter.java
deleted file mode 100644
index c22ee6b..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatter.java
+++ /dev/null
@@ -1,36 +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.sse.core.internal.format;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.w3c.dom.Node;
-
-/**
- * Knows how to format a particular node.
- * 
- * eg. generic node, text node, document node, comment, etc...
- */
-public interface IStructuredFormatter {
-	
-	void format(Node node);
-
-	void format(Node node, IStructuredFormatContraints formatContraints);
-
-	IStructuredFormatContraints getFormatContraints();
-
-	IStructuredFormatPreferences getFormatPreferences();
-
-	void setFormatPreferences(IStructuredFormatPreferences formatPreferences);
-
-	void setProgressMonitor(IProgressMonitor monitor);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatContraints.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatContraints.java
deleted file mode 100644
index e26cff2..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatContraints.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.sse.core.internal.format;
-
-public class StructuredFormatContraints implements IStructuredFormatContraints {
-	protected int fAvailableLineWidth;
-	protected boolean fClearAllBlankLines;
-	protected String fCurrentIndent = ""; //$NON-NLS-1$
-	protected boolean fFormatWithSiblingIndent = false;
-
-	public boolean getClearAllBlankLines() {
-		return fClearAllBlankLines;
-	}
-
-	public String getCurrentIndent() {
-		return fCurrentIndent;
-	}
-
-	public boolean getFormatWithSiblingIndent() {
-		return fFormatWithSiblingIndent;
-	}
-
-	public void setClearAllBlankLines(boolean clearAllBlankLines) {
-		fClearAllBlankLines = clearAllBlankLines;
-	}
-
-	public void setCurrentIndent(String currentIndent) {
-		fCurrentIndent = currentIndent;
-	}
-
-	public void setFormatWithSiblingIndent(boolean formatWithSiblingIndent) {
-		fFormatWithSiblingIndent = formatWithSiblingIndent;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatPreferences.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatPreferences.java
deleted file mode 100644
index 67ad7cd..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatPreferences.java
+++ /dev/null
@@ -1,43 +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.sse.core.internal.format;
-
-public class StructuredFormatPreferences implements IStructuredFormatPreferences {
-	private boolean fClearAllBlankLines;
-	private String fIndent;
-	private int fLineWidth;
-
-	public boolean getClearAllBlankLines() {
-		return fClearAllBlankLines;
-	}
-
-	public String getIndent() {
-		return fIndent;
-	}
-
-	public int getLineWidth() {
-		return fLineWidth;
-	}
-
-	public void setClearAllBlankLines(boolean clearAllBlankLines) {
-		fClearAllBlankLines = clearAllBlankLines;
-	}
-
-	public void setIndent(String indent) {
-		fIndent = indent;
-	}
-
-	public void setLineWidth(int lineWidth) {
-		fLineWidth = lineWidth;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/AbstractModelHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/AbstractModelHandler.java
deleted file mode 100644
index 629fa26..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/AbstractModelHandler.java
+++ /dev/null
@@ -1,72 +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.sse.core.internal.ltk.modelhandler;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.internal.modelhandler.PluginContributedFactoryReader;
-
-/**
- * ISSUE: need to provide this functionality in improved API.
- */
-
-public abstract class AbstractModelHandler implements IModelHandler {
-	private String associatedContentTypeId;
-	private boolean defaultSetting;
-	private String modelHandlerID;
-
-	public AbstractModelHandler() {
-		super();
-	}
-
-	/**
-	 * These factories are added automatically by model manager
-	 */
-	public List getAdapterFactories() {
-		List result = new ArrayList();
-		Collection holdFactories = PluginContributedFactoryReader.getInstance().getFactories(this);
-		if (holdFactories != null) {
-			result.addAll(holdFactories);
-		}
-		return result;
-	}
-
-	public String getAssociatedContentTypeId() {
-		return associatedContentTypeId;
-	}
-
-	public abstract IDocumentCharsetDetector getEncodingDetector();
-
-	public String getId() {
-		return modelHandlerID;
-	}
-
-	public boolean isDefault() {
-		return defaultSetting;
-	}
-
-	protected void setAssociatedContentTypeId(String contentTypeId) {
-		associatedContentTypeId = contentTypeId;
-	}
-
-	public void setDefault(boolean defaultParam) {
-		defaultSetting = defaultParam;
-	}
-
-	protected void setId(String id) {
-		modelHandlerID = id;
-	}
-}
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
deleted file mode 100644
index 4e37d5c..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/EmbeddedTypeHandler.java
+++ /dev/null
@@ -1,77 +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.sse.core.internal.ltk.modelhandler;
-
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-
-
-/**
- */
-public interface EmbeddedTypeHandler {
-
-	/**
-	 * 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.
-	 */
-	List getAdapterFactories();
-
-	/**
-	 * Returns the unique identifier for the content type family this
-	 * ContentTypeDescription belongs to.
-	 */
-	String getFamilyId();
-
-	/**
-	 * Returns a list of mime types (as Strings) this handler is appropriate
-	 * for
-	 */
-	List getSupportedMimeTypes();
-	
-	/**
-	 * If this hander can handle a given mimeType.
-	 * 
-	 * This is a looser check than simply checking if a give mimeType
-	 * in the list of supported types, so it should be used with that
-	 * in mind.  That is, the supported mimeType list should ideally be
-	 * checked first.
-	 * 
-	 * eg. if a mime type ends with "+xml", like voice+xml
-	 *     the EmbeddedXML handler should be able to handle it
-	 *     
-	 * @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.
-	 */
-	void initializeFactoryRegistry(FactoryRegistry registry);
-
-	/**
-	 * initializeParser Its purpose is to setBlockTags
-	 */
-	void initializeParser(JSPCapableParser parser);
-
-	boolean isDefault();
-
-	EmbeddedTypeHandler newInstance();
-
-	void uninitializeFactoryRegistry(FactoryRegistry registry);
-
-	void uninitializeParser(JSPCapableParser 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
deleted file mode 100644
index b50c852..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IDocumentTypeHandler.java
+++ /dev/null
@@ -1,42 +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.sse.core.internal.ltk.modelhandler;
-
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-
-/**
- * Interface to allow custom content types to be defined as extension points
- * in plugins.
- */
-public interface IDocumentTypeHandler {
-
-	/**
-	 * The Loader is reponsible for decoding the Resource,
-	 */
-	IDocumentLoader getDocumentLoader();
-
-	/**
-	 * @deprecated - likely to go away, so I marked as deprecated to
-	 *             discoursage use
-	 */
-	IDocumentCharsetDetector getEncodingDetector();
-
-	/**
-	 * Must return unique ID that is the same as identified in plugin registry
-	 */
-	String getId();
-
-
-
-}
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
deleted file mode 100644
index 102b3fa..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IModelHandler.java
+++ /dev/null
@@ -1,43 +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.sse.core.internal.ltk.modelhandler;
-
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
-
-
-public interface IModelHandler extends IDocumentTypeHandler {
-	/**
-	 * This method should return Factories which are added automatically by
-	 * IModelManager. This can and will often be an empty List (or null),
-	 * since some AdapterFactories must be added by Loader directly, and most
-	 * should be added by Editors. FormatAdapterFactory is an example of one
-	 * that can be returned here, since the timing of adding it is not
-	 * critical, but it may be needed even when an editor is not being used.
-	 */
-	List getAdapterFactories();
-
-	/**
-	 * Returns the ID for the associated ContentTypeHandler But is needed for
-	 * now.
-	 */
-	String getAssociatedContentTypeId();
-
-	/**
-	 * The Loader is reponsible for decoding the Resource,
-	 */
-	IModelLoader getModelLoader();
-
-	boolean isDefault();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockMarker.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockMarker.java
deleted file mode 100644
index 267ff54..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockMarker.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.sse.core.internal.ltk.parser;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-/**
- * ISSUE: need to provide functionality in improved API. 
- */
-public class BlockMarker extends TagMarker {
-
-	// allow for JSP expressions within the block
-	protected boolean fAllowJSP = true;
-
-	protected boolean fCaseSensitive = false;
-
-	// the context for the contents of this tag (BLOCK_TEXT, JSP_CONTENT,
-	// etc.)
-	protected String fContext;
-
-	/**
-	 * It's not appropriate to make "empty" BlockMarker, so we'll mark as
-	 * private.
-	 */
-	private BlockMarker() {
-		super();
-	}
-
-	public BlockMarker(String tagName, ITextRegion marker, String context) {
-		this(tagName, marker, context, true);
-	}
-
-	public BlockMarker(String tagName, ITextRegion marker, String context, boolean caseSensitive) {
-		this(tagName, marker, context, caseSensitive, true);
-	}
-
-	public BlockMarker(String tagName, ITextRegion marker, String context, boolean caseSensitive, boolean allowJSP) {
-		super(tagName, marker);
-		setContext(context);
-		setCaseSensitive(caseSensitive);
-		setAllowJSP(allowJSP);
-	}
-
-	public BlockMarker(String tagName, String regionContext, boolean caseSensitive) {
-		this(tagName, null, regionContext, caseSensitive, false);
-	}
-
-	/**
-	 * Gets the allowJSP.
-	 * 
-	 * @return Returns a boolean
-	 */
-	public boolean allowsJSP() {
-		return fAllowJSP;
-	}
-
-	/**
-	 * Gets the context.
-	 * 
-	 * @return Returns a String
-	 */
-	public String getContext() {
-		return fContext;
-	}
-
-	/**
-	 * 
-	 * @return boolean
-	 */
-	public final boolean isCaseSensitive() {
-		return fCaseSensitive;
-	}
-
-	/**
-	 * Sets the allowJSP.
-	 * 
-	 * @param allowJSP
-	 *            The allowJSP to set
-	 */
-	public void setAllowJSP(boolean allowJSP) {
-		fAllowJSP = allowJSP;
-	}
-
-	public final void setCaseSensitive(boolean sensitive) {
-		fCaseSensitive = sensitive;
-	}
-
-	/**
-	 * Sets the context.
-	 * 
-	 * @param context
-	 *            The context to set
-	 */
-	public void setContext(String context) {
-		fContext = context;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTagParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTagParser.java
deleted file mode 100644
index 2c5d4d9..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTagParser.java
+++ /dev/null
@@ -1,32 +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.sse.core.internal.ltk.parser;
-
-
-
-import java.util.List;
-
-public interface BlockTagParser {
-
-	void addBlockMarker(BlockMarker marker);
-
-	void beginBlockScan(String tagName);
-
-	BlockMarker getBlockMarker(String tagName);
-
-	List getBlockMarkers();
-
-	void removeBlockMarker(BlockMarker marker);
-
-	void removeBlockMarker(String tagName);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTokenizer.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTokenizer.java
deleted file mode 100644
index 6b83c46..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTokenizer.java
+++ /dev/null
@@ -1,58 +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.sse.core.internal.ltk.parser;
-
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-public interface BlockTokenizer {
-
-	void addBlockMarker(BlockMarker marker);
-
-	void beginBlockMarkerScan(String newTagName, String context);
-
-	void beginBlockTagScan(String newTagName);
-
-	List getBlockMarkers();
-
-	ITextRegion getNextToken() throws IOException;
-
-	int getOffset();
-
-	boolean isEOF();
-
-	BlockTokenizer newInstance();
-
-	void removeBlockMarker(BlockMarker marker);
-
-	void removeBlockMarker(String tagname);
-
-	void reset(char[] charArray);
-
-	void reset(char[] charArray, int newOffset);
-
-	void reset(InputStream in);
-
-	void reset(InputStream in, int newOffset);
-
-	void reset(Reader in);
-
-	void reset(Reader in, int newOffset);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/IBlockedStructuredDocumentRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/IBlockedStructuredDocumentRegion.java
deleted file mode 100644
index 30eab0c..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/IBlockedStructuredDocumentRegion.java
+++ /dev/null
@@ -1,41 +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.sse.core.internal.ltk.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-/**
- * IBlockedStructuredDocumentRegion is just like an IStructuredDocumentRegion
- * except results from parsing a "block tag" (such as SCRIPT or STYLE).
- * Because these are "variable" partition types, its often handy (efficient)
- * to keep track of the partition type.
- * 
- * @plannedfor 1.0
- */
-public interface IBlockedStructuredDocumentRegion extends IStructuredDocumentRegion {
-	/**
-	 * Return the partion type for this region.
-	 * 
-	 * @return the partion type.
-	 */
-	String getPartitionType();
-
-	/**
-	 * Sets the partion type.
-	 * 
-	 * For use by parsers and re-parsers only.
-	 * 
-	 * @param partitionType
-	 */
-	void setPartitionType(String partitionType);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/JSPCapableParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/JSPCapableParser.java
deleted file mode 100644
index 367f5a6..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/JSPCapableParser.java
+++ /dev/null
@@ -1,28 +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.sse.core.internal.ltk.parser;
-
-import java.util.List;
-
-public interface JSPCapableParser extends RegionParser, BlockTagParser {
-	void addNestablePrefix(TagMarker marker);
-
-	/**
-	 * returns the TagMarkers for prefixes that are allowed to be nestable
-	 * 
-	 * @return
-	 */
-	List getNestablePrefixes();
-
-	void removeNestablePrefix(String tagName);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/RegionParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/RegionParser.java
deleted file mode 100644
index ec8e972..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/RegionParser.java
+++ /dev/null
@@ -1,52 +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.sse.core.internal.ltk.parser;
-
-
-
-import java.io.Reader;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-
-public interface RegionParser {
-
-	IStructuredDocumentRegion getDocumentRegions();
-
-	List getRegions();
-
-	/**
-	 * The 'newInstance' method is similar to 'clone', but does not include
-	 * the copying of any content. For a pure RegionParser itself, there would
-	 * be little state to "clone", but for some subtypes, such as
-	 * StructuredDocumentRegionParser and JSPCapableParser, there could the
-	 * more internal data to "clone", such as the internal tokenizer should be
-	 * cloned (including block tags, etc).
-	 */
-	RegionParser newInstance();
-
-	void reset(Reader reader);
-
-	/**
-	 * An additional offset for use with any position-dependant parsing rules
-	 */
-	void reset(Reader reader, int offset);
-
-	void reset(String input);
-
-	/**
-	 * An additional offset for use with any position-dependant parsing rules
-	 */
-	void reset(String input, int offset);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandler.java
deleted file mode 100644
index e9ce306..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandler.java
+++ /dev/null
@@ -1,28 +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.sse.core.internal.ltk.parser;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-public interface StructuredDocumentRegionHandler {
-
-	// Sent when a IStructuredDocumentRegion is first parsed
-	public void nodeParsed(IStructuredDocumentRegion aCoreStructuredDocumentRegion);
-
-	// Sent when the calling parser's model undergoes a full reset
-	//   and any information based upon the old model should be
-	//   cleared
-	public void resetNodes();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandlerExtension.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandlerExtension.java
deleted file mode 100644
index 01db26f..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandlerExtension.java
+++ /dev/null
@@ -1,20 +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.sse.core.internal.ltk.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-public interface StructuredDocumentRegionHandlerExtension extends StructuredDocumentRegionHandler {
-	void setStructuredDocument(IStructuredDocument newDocument);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParser.java
deleted file mode 100644
index 34a2499..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParser.java
+++ /dev/null
@@ -1,24 +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.sse.core.internal.ltk.parser;
-
-
-
-public interface StructuredDocumentRegionParser extends RegionParser {
-
-	void addStructuredDocumentRegionHandler(StructuredDocumentRegionHandler handler);
-
-	void removeStructuredDocumentRegionHandler(StructuredDocumentRegionHandler handler);
-
-	void resetHandlers();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParserExtension.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParserExtension.java
deleted file mode 100644
index c3d8c1c..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParserExtension.java
+++ /dev/null
@@ -1,28 +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.sse.core.internal.ltk.parser;
-
-import java.util.List;
-
-
-
-public interface StructuredDocumentRegionParserExtension extends StructuredDocumentRegionParser {
-	/**
-	 * Returns the current list of StructuredDocumentRegionHandlers listening
-	 * to this parser.
-	 * 
-	 * @return List - the list of listeners, the list may not be null and each
-	 *         element in it must implement StructuredDocumentRegionHandler
-	 */
-	List getStructuredDocumentRegionHandlers();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/TagMarker.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/TagMarker.java
deleted file mode 100644
index b732e6b..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/TagMarker.java
+++ /dev/null
@@ -1,80 +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.sse.core.internal.ltk.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-/**
- * ISSUE: need to provide functionality in improved API. 
- */
-
-public class TagMarker {
-
-	// a ITextRegion (meant to be updated with the model) marking the position
-	// where this tagname becomes effective
-	protected ITextRegion fMarker = null;
-
-	// the tagname
-	protected String fTagName = null;
-
-	/**
-	 *  
-	 */
-	public TagMarker() {
-		super();
-	}
-
-	public TagMarker(String tagname) {
-		super();
-		setTagName(tagname);
-	}
-
-	public TagMarker(String tagname, ITextRegion marker) {
-		super();
-		setTagName(tagname);
-		setMarker(marker);
-	}
-
-	public final ITextRegion getMarker() {
-		return fMarker;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public final String getTagName() {
-		return fTagName;
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public boolean isGlobal() {
-		return fMarker == null;
-	}
-
-	/**
-	 * @param newMarker
-	 */
-	public final void setMarker(ITextRegion newMarker) {
-		fMarker = newMarker;
-	}
-
-	/**
-	 * @param newTagname
-	 *            java.lang.String
-	 */
-	public final void setTagName(String newTagName) {
-		fTagName = newTagName;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractModelLoader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractModelLoader.java
deleted file mode 100644
index a9512d2..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractModelLoader.java
+++ /dev/null
@@ -1,529 +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.sse.core.internal.model;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-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.BlockTagParser;
-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.StructuredDocumentRegionHandlerExtension;
-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.IModelLoader;
-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.provisional.document.IEncodedDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-
-
-/**
- * This class reads a file and creates an Structured Model.
- */
-public abstract class AbstractModelLoader implements IModelLoader {
-	protected static final int encodingNameSearchLimit = 1000;
-
-	private static long computeMem() {
-		for (int i = 0; i < 5; i++) {
-			System.gc();
-			System.runFinalization();
-		}
-		return Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
-	}
-
-	private boolean DEBUG = false;
-	protected IDocumentLoader documentLoaderInstance;
-
-	/**
-	 * AbstractLoader constructor also initializes encoding converter/mapper
-	 */
-	public AbstractModelLoader() {
-		super();
-	}
-
-	protected void addFactories(IStructuredModel model, List factoryList) {
-		Assert.isNotNull(model);
-		FactoryRegistry registry = model.getFactoryRegistry();
-		Assert.isNotNull(registry, "IStructuredModel " + model.getId() + " has a null FactoryRegistry"); //$NON-NLS-1$ //$NON-NLS-2$
-		if (factoryList != null) {
-			Iterator iterator = factoryList.iterator();
-			while (iterator.hasNext()) {
-				INodeAdapterFactory factory = (INodeAdapterFactory) iterator.next();
-				registry.addFactory(factory);
-			}
-		}
-	}
-
-	/**
-	 * This method should perform all the model initialization required before
-	 * it contains content, namely, it should call newModel, the
-	 * createNewStructuredDocument(), then add those adapter factories which
-	 * must be set before content is applied. This method should be called by
-	 * "load" method. (this is tentative API)
-	 */
-	public IStructuredModel createModel() {
-		documentLoaderInstance = null;
-		IStructuredModel model = newModel();
-		IEncodedDocument structuredDocument = getDocumentLoader().createNewStructuredDocument();
-		if (structuredDocument instanceof IStructuredDocument) {
-			model.setStructuredDocument((IStructuredDocument) structuredDocument);
-			addFactories(model, getAdapterFactories());
-			//
-			initEmbeddedTypePre(model);
-			initEmbeddedTypePost(model);
-			// For types with propagating adapters, its important
-			// that the propagating adapter be in place before the contents
-			// are set.
-			preLoadAdapt(model);
-		}
-		return model;
-	}
-
-	public IStructuredModel createModel(IStructuredDocument structuredDocument, String baseLocation, IModelHandler handler) {
-		documentLoaderInstance = null;
-		IStructuredModel model = newModel();
-		model.setBaseLocation(baseLocation);
-		
-		// handler must be set early, incase a re-init is 
-		// required during creation.
-		model.setModelHandler(handler);
-		
-		addFactories(model, getAdapterFactories());
-		// For types with propagating adapters, it's important
-		// that the propagating adapter be in place before the contents
-		// are set.
-		preLoadAdapt(model);
-		initEmbeddedTypePre(model);
-
-		model.setStructuredDocument(structuredDocument);
-		//
-		initEmbeddedTypePost(model);
-
-		return model;
-	}
-
-	/**
-	 * This method is used for cloning models.
-	 */
-	public IStructuredModel createModel(IStructuredModel oldModel) {
-		documentLoaderInstance = null;
-		IStructuredModel newModel = newModel();
-		IStructuredDocument oldStructuredDocument = oldModel.getStructuredDocument();
-		IStructuredDocument newStructuredDocument = oldStructuredDocument.newInstance();
-		newModel.setStructuredDocument(newStructuredDocument);
-		// NOTE: we DO NOT simply add the standard ones to the new model
-		// addFactories(newModel, getAdapterFactories());
-		// Now, we take the opportunity to add Factories from the oldModel's
-		// registry to the new model's registry .. if they do not already
-		// exist there.
-		duplicateFactoryRegistry(newModel, oldModel);
-		if (newModel instanceof AbstractStructuredModel) {
-			((AbstractStructuredModel) newModel).setContentTypeIdentifier(oldModel.getContentTypeIdentifier());
-		}
-		// addFactories(newModel, oldModel);
-		initEmbeddedType(oldModel, newModel);
-		// For types with propagating adapters, its important
-		// that the propagating adapter be in place before the contents
-		// are set.
-		preLoadAdapt(newModel);
-		return newModel;
-	}
-
-	private void duplicateFactoryRegistry(IStructuredModel newModel, IStructuredModel oldModel) {
-		List oldAdapterFactories = oldModel.getFactoryRegistry().getFactories();
-		List newAdapterFactories = new ArrayList();
-		Iterator oldListIterator = oldAdapterFactories.iterator();
-		while (oldListIterator.hasNext()) {
-			INodeAdapterFactory oldAdapterFactory = (INodeAdapterFactory) oldListIterator.next();
-			// now "clone" the adapterfactory
-			newAdapterFactories.add(oldAdapterFactory.copy());
-		}
-		// now that we have the "cloned" list, add to new model
-		addFactories(newModel, newAdapterFactories);
-	}
-
-	/**
-	 * This method must return those factories which must be attached to the
-	 * structuredModel before content is applied.
-	 */
-	public List getAdapterFactories() {
-		// abstract method returns none
-		return new ArrayList(0);
-	}
-
-	abstract public IDocumentLoader getDocumentLoader();
-
-	/**
-	 * Method initEmbeddedType. Nothing to do here in super class.
-	 * 
-	 * @param model
-	 */
-	protected void initEmbeddedTypePre(IStructuredModel model) {
-	}
-	protected void initEmbeddedTypePost(IStructuredModel model) {
-	}
-
-	/**
-	 * Method initEmbeddedType. Nothing to do here in super class.
-	 * 
-	 * @param oldModel
-	 * @param newModel
-	 */
-	protected void initEmbeddedType(IStructuredModel oldModel, IStructuredModel newModel) {
-	}
-
-	public void load(IFile file, IStructuredModel model) throws IOException, CoreException {
-		IEncodedDocument structuredDocument = model.getStructuredDocument();
-		if (file == null)
-			structuredDocument = getDocumentLoader().createNewStructuredDocument();
-		else
-			structuredDocument = getDocumentLoader().createNewStructuredDocument(file);
-
-		// TODO: need to straighten out IEncodedDocument mess
-		if (structuredDocument instanceof IStructuredDocument)
-			transformInstance(model.getStructuredDocument(), (IStructuredDocument) structuredDocument);
-		else
-			model.getStructuredDocument().set(structuredDocument.get());
-
-		// original hack
-		// model.setStructuredDocument((IStructuredDocument)
-		// structuredDocument);
-		// ((IStructuredDocument) structuredDocument).fireNewDocument(this);
-		documentLoaderInstance = null;
-		// technicq of future
-		// model.setStructuredDocument((IStructuredDocument)
-		// structuredDocument);
-		// documentLoaderInstance = null;
-	}
-
-	public void load(InputStream inputStream, IStructuredModel model, EncodingRule encodingRule) throws UnsupportedEncodingException, java.io.IOException {
-		// note we don't open the stream, so we don't close it
-		IEncodedDocument structuredDocument = model.getStructuredDocument();
-		if (inputStream == null) {
-			structuredDocument = getDocumentLoader().createNewStructuredDocument();
-		}
-		else {
-			// assume's model has been initialized already with base location
-			structuredDocument = getDocumentLoader().createNewStructuredDocument(model.getBaseLocation(), inputStream, encodingRule);
-			// TODO: model's not designed for this!
-			// we want to move to this "set" method, but the 'fire' was needed
-			// as
-			// a work around for strucutredModel not handling 'set' right, but
-			// that 'fireNewDocument' method was causing unbalance
-			// "aboutToChange" and "changed"
-			// events.
-			// model.setStructuredDocument((IStructuredDocument)
-			// structuredDocument);
-			// ((IStructuredDocument)
-			// structuredDocument).fireNewDocument(this);
-			model.getStructuredDocument().set(structuredDocument.get());
-
-		}
-		documentLoaderInstance = null;
-
-	}
-
-	/**
-	 * deprecated -- use EncodingRule form
-	 */
-	synchronized public void load(InputStream inputStream, IStructuredModel model, String encodingName, String lineDelimiter) throws UnsupportedEncodingException, java.io.IOException {
-		// note we don't open the stream, so we don't close it
-		// TEMP work around to maintain previous function,
-		// until everyone can change to EncodingRule.FORCE_DEFAULT
-		if (encodingName != null && encodingName.trim().length() == 0) {
-			// redirect to new method
-			load(inputStream, model, EncodingRule.FORCE_DEFAULT);
-		}
-		else {
-			load(inputStream, model, EncodingRule.CONTENT_BASED);
-		}
-	}
-
-	public void load(String filename, InputStream inputStream, IStructuredModel model, String junk, String dummy) throws UnsupportedEncodingException, java.io.IOException {
-
-		long memoryUsed = 0;
-		if (DEBUG) {
-			memoryUsed = computeMem();
-			System.out.println("measuring heap memory for " + filename); //$NON-NLS-1$
-			// System.out.println("heap memory used before load: " +
-			// memoryUsed);
-		}
-
-		// during an initial load, we expect the olddocument to be empty
-		// during re-load, however, it would be full.
-		IEncodedDocument newstructuredDocument = null;
-		IEncodedDocument oldStructuredDocument = model.getStructuredDocument();
-
-		// get new document
-		if (inputStream == null) {
-			newstructuredDocument = getDocumentLoader().createNewStructuredDocument();
-		}
-		else {
-			newstructuredDocument = getDocumentLoader().createNewStructuredDocument(filename, inputStream);
-		}
-		if (DEBUG) {
-			long memoryAtEnd = computeMem();
-			// System.out.println("heap memory used after loading new
-			// document: " + memoryAtEnd);
-			System.out.println("    heap memory implied used by document: " + (memoryAtEnd - memoryUsed)); //$NON-NLS-1$
-		}
-
-
-		// TODO: need to straighten out IEncodedDocument mess
-		if (newstructuredDocument instanceof IStructuredDocument) {
-			transformInstance((IStructuredDocument) oldStructuredDocument, (IStructuredDocument) newstructuredDocument);
-		}
-		else {
-			// we don't really expect this case, just included for safety
-			oldStructuredDocument.set(newstructuredDocument.get());
-		}
-		// original hack
-		// model.setStructuredDocument((IStructuredDocument)
-		// structuredDocument);
-		// ((IStructuredDocument) structuredDocument).fireNewDocument(this);
-		documentLoaderInstance = null;
-		// technicq of future
-		// model.setStructuredDocument((IStructuredDocument)
-		// structuredDocument);
-		// documentLoaderInstance = null;
-		if (DEBUG) {
-			long memoryAtEnd = computeMem();
-			// System.out.println("heap memory used after setting to model: "
-			// + memoryAtEnd);
-			System.out.println("    heap memory implied used by document and model: " + (memoryAtEnd - memoryUsed)); //$NON-NLS-1$
-		}
-
-	}
-
-	/**
-	 * required by interface, being declared here abstractly just as another
-	 * reminder.
-	 */
-	abstract public IStructuredModel newModel();
-
-	/**
-	 * There's nothing to do here in abstract class for initializing adapters.
-	 * Subclasses can and should override this method and provide proper
-	 * intialization (For example, to get DOM document and 'getAdapter' on it,
-	 * so that the first node/notifier has the adapter on it.)
-	 */
-	protected void preLoadAdapt(IStructuredModel structuredModel) {
-
-
-	}
-
-	/**
-	 * Normally, here in the abstact class, there's nothing to do, but we will
-	 * reset text, since this MIGHT end up being called to recover from error
-	 * conditions (e.g. IStructuredDocument exceptions) And, can be called by
-	 * subclasses.
-	 */
-	public IStructuredModel reinitialize(IStructuredModel model) {
-		// Note: the "minimumization" routines
-		// of 'replaceText' allow many old nodes to pass through, when
-		// really its assumed they are created anew.
-		// so we need to use 'setText' (I think "setText' ends up
-		// throwing a 'newModel' event though, that may have some
-		// implications.
-		model.getStructuredDocument().setText(this, model.getStructuredDocument().get());
-		return model;
-	}
-
-	/**
-	 * This method gets a fresh copy of the data, and repopulates the models
-	 * ... by a call to setText on the structuredDocument. This method is
-	 * needed in some cases where clients are sharing a model and then changes
-	 * canceled. Say for example, one editor and several "displays" are
-	 * sharing a model, if the editor is closed without saving changes, then
-	 * the displays still need a model, but they should revert to the original
-	 * unsaved version.
-	 */
-	synchronized public void reload(InputStream inputStream, IStructuredModel structuredModel) {
-		documentLoaderInstance = null;
-		try {
-			// temp solution ... we should be able to do better (more
-			// efficient) in future.
-			// Adapters will (probably) need to be sensitive to the fact that
-			// the document instance changed
-			// (by being life cycle listeners)
-			load(inputStream, structuredModel, EncodingRule.CONTENT_BASED);
-
-			// // Note: we apparently read the data (and encoding) correctly
-			// // before, we just need to make sure we followed the same rule
-			// as
-			// // before.
-			// EncodingMemento previousMemento =
-			// structuredModel.getStructuredDocument().getEncodingMemento();
-			// EncodingRule previousRule = previousMemento.getEncodingRule();
-			// //IFile file = ResourceUtil.getFileFor(structuredModel);
-			// // Note: there's opportunity here for some odd behavior, if the
-			// // settings have changed from the first load to the reload.
-			// But,
-			// // hopefully,
-			// // will result in the intended behavior.
-			// Reader allTextReader =
-			// getDocumentLoader().readInputStream(inputStream, previousRule);
-			//
-			// // TODO: avoid use of String instance
-			// getDocumentLoader().reload(structuredModel.getStructuredDocument(),
-			// allTextReader);
-			// // and now "reset" encoding memento to keep it current with the
-			// // one
-			// // that was just determined.
-			// structuredModel.getStructuredDocument().setEncodingMemento(getDocumentLoader().getEncodingMemento());
-			// structuredModel.setDirtyState(false);
-			// StructuredTextUndoManager undoMgr =
-			// structuredModel.getUndoManager();
-			// if (undoMgr != null) {
-			// undoMgr.reset();
-			// }
-		}
-		catch (UnsupportedEncodingException e) {
-			// couldn't happen. The program has apparently
-			// read the model once, and there'd be no reason the encoding
-			// could not be used again.
-			Logger.logException("Warning:  XMLLoader::reload.  This exception really should not have happened!! But will attemp to continue after dumping stack trace", e); //$NON-NLS-1$
-			throw new Error("Program Error", e); //$NON-NLS-1$
-		}
-		catch (IOException e) {
-			// couldn't happen. The program has apparently
-			// read the model once, and there'd be no (common) reason it
-			// couldn't be loaded again.
-			Logger.logException("Warning:  XMLLoader::reload.  This exception really should not have happened!! But will attemp to continue after dumping stack trace", e); //$NON-NLS-1$
-			throw new Error("Program Error", e); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * this work is done better elsewhere, but done here for this version to
-	 * reduce changes. especially since the need for it should go away once we
-	 * no longer need to re-use old document instance.
-	 */
-	private void transformInstance(IStructuredDocument oldInstance, IStructuredDocument newInstance) {
-		/**
-		 * https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4920
-		 * 
-		 * JSP taglib support broken, correct by duplicating extended setup
-		 * information (BlockTagParser extension,
-		 * StructuredDocumentRegionParser extensions)
-		 */
-		RegionParser oldParser = oldInstance.getParser();
-		RegionParser newParser = newInstance.getParser().newInstance();
-		// Register all of the old StructuredDocumentRegionHandlers on the new
-		// parser
-		if (oldParser instanceof StructuredDocumentRegionParserExtension && newParser instanceof StructuredDocumentRegionParserExtension) {
-			List oldHandlers = ((StructuredDocumentRegionParserExtension) oldParser).getStructuredDocumentRegionHandlers();
-			for (int i = 0; i < oldHandlers.size(); i++) {
-				StructuredDocumentRegionHandler handler = ((StructuredDocumentRegionHandler) oldHandlers.get(i));
-				if (handler instanceof StructuredDocumentRegionHandlerExtension) {
-					/**
-					 * Skip the transferring here, the handler will do this
-					 * after everything else but the source is transferred.
-					 */
-				}
-				else {
-					((StructuredDocumentRegionParser) oldParser).removeStructuredDocumentRegionHandler(handler);
-					((StructuredDocumentRegionParser) newParser).addStructuredDocumentRegionHandler(handler);
-					handler.resetNodes();
-				}
-			}
-		}
-		// Add any global BlockMarkers to the new parser
-		if (oldParser instanceof BlockTagParser && newParser instanceof BlockTagParser) {
-			List oldBlockMarkers = ((BlockTagParser) oldParser).getBlockMarkers();
-			for (int i = 0; i < oldBlockMarkers.size(); i++) {
-				BlockMarker blockMarker = ((BlockMarker) oldBlockMarkers.get(i));
-				if (blockMarker.isGlobal()) {
-					((BlockTagParser) newParser).addBlockMarker(blockMarker);
-				}
-			}
-		}
-
-		((BasicStructuredDocument) oldInstance).setParser(newParser);
-
-		((BasicStructuredDocument) oldInstance).setReParser(newInstance.getReParser().newInstance());
-
-		if (newInstance.getDocumentPartitioner() instanceof StructuredTextPartitioner) {
-			StructuredTextPartitioner partitioner = null;
-			if (oldInstance instanceof IDocumentExtension3 && newInstance instanceof IDocumentExtension3) {
-				partitioner = ((StructuredTextPartitioner) ((IDocumentExtension3) newInstance).getDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING));
-				if (partitioner != null) {
-					partitioner = (StructuredTextPartitioner) partitioner.newInstance();
-				}
-				((IDocumentExtension3) oldInstance).setDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, partitioner);
-			}
-			if (partitioner == null) {
-				partitioner = (StructuredTextPartitioner) ((StructuredTextPartitioner) newInstance.getDocumentPartitioner()).newInstance();
-				oldInstance.setDocumentPartitioner(partitioner);
-			}
-			if (partitioner != null) {
-				partitioner.connect(oldInstance);
-			}
-		}
-
-		String existingLineDelimiter = null;
-		try {
-			existingLineDelimiter = newInstance.getLineDelimiter(0);
-		}
-		catch (BadLocationException e) {
-			// if empty file, assume platform default
-			// TODO: should be using user set preference, per content type?
-			existingLineDelimiter = System.getProperty("line.separator"); //$NON-NLS-1$
-		}
-
-		oldInstance.setLineDelimiter(existingLineDelimiter); //$NON-NLS-1$);
-		if (newInstance.getEncodingMemento() != null) {
-			oldInstance.setEncodingMemento((EncodingMemento) newInstance.getEncodingMemento().clone());
-		}
-
-		/**
-		 * https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4920
-		 * 
-		 * JSP taglib support broken, correct by duplicating extended setup
-		 * information (BlockTagParser extension,
-		 * StructuredDocumentRegionParser extensions)
-		 */
-		if (oldParser instanceof StructuredDocumentRegionParserExtension && newParser instanceof StructuredDocumentRegionParserExtension) {
-			List oldHandlers = ((StructuredDocumentRegionParserExtension) oldParser).getStructuredDocumentRegionHandlers();
-			for (int i = 0; i < oldHandlers.size(); i++) {
-				StructuredDocumentRegionHandler handler = ((StructuredDocumentRegionHandler) oldHandlers.get(i));
-				if (handler instanceof StructuredDocumentRegionHandlerExtension) {
-					StructuredDocumentRegionHandlerExtension handlerExtension = (StructuredDocumentRegionHandlerExtension) handler;
-					handlerExtension.setStructuredDocument(oldInstance);
-				}
-			}
-		}
-		String holdString = newInstance.get();
-		newInstance = null;
-		oldInstance.set(holdString);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractStructuredModel.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractStructuredModel.java
deleted file mode 100644
index 5fe3224..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractStructuredModel.java
+++ /dev/null
@@ -1,1591 +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.sse.core.internal.model;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.wst.sse.core.internal.ILockable;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.SSECoreMessages;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.provisional.DocumentChanged;
-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.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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.exceptions.ResourceInUse;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-
-public abstract class AbstractStructuredModel implements IStructuredModel {
-
-	private static final String MODEL_MANAGER_NULL = "Warning: AbstractStructuredModel::close:  model manager was null during a close of a model (which should be impossible)"; //$NON-NLS-1$
-
-	class DirtyStateWatcher implements IStructuredDocumentListener {
-
-		public void newModel(NewDocumentEvent structuredDocumentEvent) {
-
-			// I don't think its safe to assume a new model
-			// is always "fresh", so we'll leave dirty state
-			// unchanged;
-			// but we'll tell everyone about it.
-			setDirtyState(fDirtyState);
-		}
-
-		public void noChange(NoChangeEvent structuredDocumentEvent) {
-
-			// don't change dirty state
-		}
-
-		public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
-
-			setDirtyState(true);
-			// no need to listen any more
-			if (fStructuredDocument != null) {
-				fStructuredDocument.removeDocumentChangedListener(fDirtyStateWatcher);
-			}
-		}
-
-		public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
-
-			setDirtyState(true);
-			// no need to listen any more
-			if (fStructuredDocument != null) {
-				fStructuredDocument.removeDocumentChangedListener(fDirtyStateWatcher);
-			}
-		}
-
-		public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
-
-			setDirtyState(true);
-			// no need to listen any more
-			if (fStructuredDocument != null) {
-				fStructuredDocument.removeDocumentChangedListener(fDirtyStateWatcher);
-			}
-		}
-	}
-
-	class DocumentToModelNotifier implements IStructuredDocumentListener, IModelAboutToBeChangedListener {
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.events.IModelAboutToBeChangedListener#modelAboutToBeChanged(org.eclipse.wst.sse.core.events.AboutToBeChangedEvent)
-		 */
-		public void modelAboutToBeChanged(AboutToBeChangedEvent structuredDocumentEvent) {
-			// If we didn't originate the change, take note we are about to
-			// change based on our underlying document changing.
-			// If we did originate the change, we, or client, should have
-			// already called aboutToChangeModel.
-			if (structuredDocumentEvent.getOriginalRequester() != this) {
-				aboutToChangeModel();
-			}
-
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#newModel(org.eclipse.wst.sse.core.events.NewDocumentEvent)
-		 */
-		public void newModel(NewDocumentEvent structuredDocumentEvent) {
-			// if we didn't originate the change, take note we have changed
-			if (structuredDocumentEvent.getOriginalRequester() != this) {
-				changedModel();
-			}
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#noChange(org.eclipse.wst.sse.core.events.NoChangeEvent)
-		 */
-		public void noChange(NoChangeEvent structuredDocumentEvent) {
-			// if we didn't originate the change, take note we have changed
-			if (structuredDocumentEvent.getOriginalRequester() != this) {
-				changedModel();
-			}
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#nodesReplaced(org.eclipse.wst.sse.core.events.StructuredDocumentRegionsReplacedEvent)
-		 */
-		public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
-			// if we didn't originate the change, take note we have changed
-			if (structuredDocumentEvent.getOriginalRequester() != this) {
-				changedModel();
-			}
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#regionChanged(org.eclipse.wst.sse.core.events.RegionChangedEvent)
-		 */
-		public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
-			// if we didn't originate the change, take note we have changed
-			if (structuredDocumentEvent.getOriginalRequester() != this) {
-				changedModel();
-			}
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.core.events.IStructuredDocumentListener#regionsReplaced(org.eclipse.wst.sse.core.events.RegionsReplacedEvent)
-		 */
-		public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
-			// if we didn't originate the change, take note we have changed
-			if (structuredDocumentEvent.getOriginalRequester() != this) {
-				changedModel();
-			}
-		}
-
-	}
-
-	private FactoryRegistry factoryRegistry;
-	private String fBaseLocation;
-	boolean fDirtyState;
-	DirtyStateWatcher fDirtyStateWatcher;
-	DocumentToModelNotifier fDocumentToModelNotifier;
-	private String fExplicitContentTypeIdentifier;
-	private String fId;
-
-	private LifecycleNotificationManager fLifecycleNotificationManager;
-
-	private final Object fListenerLock = new byte[0];
-	protected ILock fLockObject;
-	// private String fLineDelimiter;
-	// private Object fType;
-	private IModelHandler fModelHandler;
-	private IModelManager fModelManager;
-	private int fModelStateChanging;
-	private Object[] fModelStateListeners;
-	private boolean fNewState = false;
-	private URIResolver fResolver;
-	protected IStructuredDocument fStructuredDocument;
-	/**
-	 * The time stamp of the underlying resource's modification date, at the
-	 * time this model was created, or the last time it was saved. Note: for
-	 * this version, this variable is not set automatically, be needs to be
-	 * managed by client. The FileModelProvider does this for most cases, but
-	 * if client do not use FileModelProvider, they must set this variable
-	 */
-	public long fSynchronizationStamp = IResource.NULL_STAMP;
-	private boolean reinitializationNeeded;
-	private Object reinitializeStateData;
-
-	/**
-	 * AbstractStructuredModel constructor comment.
-	 */
-	public AbstractStructuredModel() {
-
-		super();
-		fDirtyStateWatcher = new DirtyStateWatcher();
-		fDocumentToModelNotifier = new DocumentToModelNotifier();
-	}
-
-
-	private void _commonRelease() {
-
-		// TODO_future: I suspect ALL this type of logic should be
-		// on manager side.
-
-		if (factoryRegistry != null) {
-			factoryRegistry.release();
-		}
-		// if document as not been changed, we'll still be listening for
-		// first change. This is not a critical clean up, since presumanly
-		// whole model and document are "going away", but can make
-		// other memory leaks harder to find if we stay attached.
-		// (Note: my first thought was to set fStructuredDocument to null
-		// also,
-		// but there's others in shutdown process that still need to
-		// get it, in order to disconnect from it.)
-		if (fStructuredDocument != null) {
-			fStructuredDocument.removeDocumentChangedListener(fDirtyStateWatcher);
-			fStructuredDocument.removeDocumentAboutToChangeListener(fDocumentToModelNotifier);
-			fStructuredDocument.removeDocumentChangedListener(fDocumentToModelNotifier);
-		}
-
-		// we set document to null, mostly so
-		// any initiatilation done there can be undone.
-		// (likely needs some restructured to not need?)
-		setStructuredDocument(null);
-	}
-
-	/**
-	 * This method is just for getting an instance of the model manager of the
-	 * right Impl type, to be used "internally" for making protected calls
-	 * directly to the impl class.
-	 */
-	private ModelManagerImpl _getModelManager() {
-		// TODO_future: redesign so we don't need this 'Impl' version
-		if (fModelManager == null) {
-			fModelManager = StructuredModelManager.getModelManager();
-		}
-
-		return (ModelManagerImpl) fModelManager;
-	}
-
-	/**
-	 * 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() {
-
-
-		// notice this is just a public avenue to our protected method
-		internalAboutToBeChanged();
-	}
-
-
-	public void aboutToReinitializeModel() {
-
-
-
-		// notice this is just a public avenue to our protected method
-		fireModelAboutToBeReinitialized();
-	}
-
-
-	public void addModelLifecycleListener(IModelLifecycleListener listener) {
-
-		synchronized (fListenerLock) {
-
-			if (fLifecycleNotificationManager == null) {
-				fLifecycleNotificationManager = new LifecycleNotificationManager();
-			}
-			fLifecycleNotificationManager.addListener(listener);
-		}
-	}
-
-	public void addModelStateListener(IModelStateListener listener) {
-
-		synchronized (fListenerLock) {
-
-			if (!Utilities.contains(fModelStateListeners, listener)) {
-				int oldSize = 0;
-				if (fModelStateListeners != null) {
-					// normally won't be null, but we need to be sure, for
-					// first
-					// time through
-					oldSize = fModelStateListeners.length;
-				}
-				int newSize = oldSize + 1;
-				Object[] newListeners = new Object[newSize];
-				if (fModelStateListeners != null) {
-					System.arraycopy(fModelStateListeners, 0, newListeners, 0, oldSize);
-				}
-				// add listener to last position
-				newListeners[newSize - 1] = listener;
-				//
-				// now switch new for old
-				fModelStateListeners = newListeners;
-			}
-		}
-	}
-
-	/**
-	 * This lock to lock the small bits of data and operations in the models
-	 * themselfes. this lock is "shared" with document, so, eventually,
-	 * changes can be made safefly from either side.
-	 */
-	protected final void beginLock() {
-
-		// if we get a different lock object
-		// than we had before, besure to release
-		// old one first before losing it.
-		// ISSUE: this smells like an error condition,
-		// when would this happen? better to check in set document?
-		ILock documentLock = getLockObjectFromDocument();
-
-		if (fLockObject != null && fLockObject != documentLock) {
-			fLockObject.release();
-			if (Logger.DEBUG) {
-				Logger.log(Logger.INFO, "Model lock released early" + fLockObject + " apparently document switched?"); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-
-		}
-		fLockObject = documentLock;
-		if (fLockObject != null) {
-			fLockObject.acquire();
-			if (Logger.DEBUG) {
-				Logger.log(Logger.INFO, "Model lock acquired: " + fLockObject); //$NON-NLS-1$
-			}
-		}
-	}
-
-	public void beginRecording(Object requester) {
-
-		beginRecording(requester, null, null);
-	}
-
-	public void beginRecording(Object requester, int cursorPosition, int selectionLength) {
-
-		beginRecording(requester, null, null, cursorPosition, selectionLength);
-	}
-
-	public void beginRecording(Object requester, String label) {
-
-		beginRecording(requester, label, null);
-	}
-
-	public void beginRecording(Object requester, String label, int cursorPosition, int selectionLength) {
-
-		beginRecording(requester, label, null, cursorPosition, selectionLength);
-	}
-
-	public void beginRecording(Object requester, String label, String description) {
-
-		if (getUndoManager() != null)
-			getUndoManager().beginRecording(requester, label, description);
-	}
-
-	public void beginRecording(Object requester, String label, String description, int cursorPosition, int selectionLength) {
-
-		if (getUndoManager() != null)
-			getUndoManager().beginRecording(requester, label, description, cursorPosition, selectionLength);
-	}
-
-	/**
-	 * 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() {
-
-
-		// notice this is just a public avenue to our protected method
-		internalModelChanged();
-		// also note!
-		// if we've been "changed" by a client, we might still need
-		// to be re-initialized, so we'll check and handle that here.
-		// Note only does this provide a solution to some "missed"
-		// re-inits, in provides a built in way for clients to
-		// "force" the model to handle itself, by bracketing any
-		// changes with aboutToChange and changed, the model itself
-		// will check. But only call re-init if all other pending
-		// modelChanged states have been handled.
-		if (fModelStateChanging == 0 && isReinitializationNeeded()) {
-			reinit();
-		}
-	}
-
-
-	/**
-	 * Based on similar method in FileDocumentProvider. It will provide what
-	 * the modificationStamp would be if resetSynchronzationStamp(resource)
-	 * were used, although for this 'compute' API, no changes to the instance
-	 * are made.
-	 */
-	public long computeModificationStamp(IResource resource) {
-
-
-		long modificationStamp = resource.getModificationStamp();
-		IPath path = resource.getLocation();
-		if (path == null) {
-			return modificationStamp;
-		}
-		// Note: checking existence of file is a little different than
-		// impl in
-		// the FileDocumentProvider. See defect number 223790.
-		File file = path.toFile();
-		if (!file.exists()) {
-			return modificationStamp;
-		}
-		modificationStamp = file.lastModified();
-		return modificationStamp;
-	}
-
-
-	/**
-	 * Provides a copy of the model, but a new ID must be provided. The
-	 * principle of this copy is not to copy fields, etc., as is typically
-	 * done in a clone method, but to return a model with the same content in
-	 * the structuredDocument. Note: It is the callers responsibility to
-	 * setBaseLocation, listners, etc., as appropriate. Type and Encoding are
-	 * the only fields set by this method. If the newId provided already exist
-	 * in the model manager, a ResourceInUse exception is thrown.
-	 */
-	public IStructuredModel copy(String newId) throws ResourceInUse {
-
-
-		IStructuredModel newModel = null;
-		// this first one should fail, if not, its treated as an error
-		// If the caller wants to use an existing one, they can call
-		// getExisting
-		// after this failure
-		newModel = getModelManager().getExistingModelForEdit(newId);
-		if (newModel != null) {
-			// be sure to release the reference we got "by accident" (and
-			// no
-			// longer need)
-			newModel.releaseFromEdit();
-			throw new ResourceInUse();
-		}
-		newModel = getModelManager().copyModelForEdit(getId(), newId);
-		return newModel;
-	}
-
-
-	/**
-	 * Disable undo management.
-	 */
-	public void disableUndoManagement() {
-
-		if (getUndoManager() != null)
-			getUndoManager().disableUndoManagement();
-	}
-
-	/**
-	 * Enable undo management.
-	 */
-	public void enableUndoManagement() {
-
-		if (getUndoManager() != null)
-			getUndoManager().enableUndoManagement();
-	}
-
-	/**
-	 * endLock is protected only for a very special purpose. So subclasses can
-	 * call it to end the lock after updates have been made, but before
-	 * notifications are sent
-	 * 
-	 */
-	protected final void endLock() {
-		if (fLockObject != null) {
-			fLockObject.release();
-			if (Logger.DEBUG) {
-				Logger.log(Logger.INFO, "Model lock released: " + fLockObject); //$NON-NLS-1$
-			}
-
-		}
-	}
-
-	public void endRecording(Object requester) {
-
-		if (getUndoManager() != null)
-			getUndoManager().endRecording(requester);
-	}
-
-	public void endRecording(Object requester, int cursorPosition, int selectionLength) {
-
-		if (getUndoManager() != null)
-			getUndoManager().endRecording(requester, cursorPosition, selectionLength);
-	}
-
-	/**
-	 * Informs all registered model state listeners that the the model is
-	 * about to under go a change. This change might be in terms of contents
-	 * or might be in terms of the model's id or base location.
-	 */
-	private void fireModelAboutToBeChanged() {
-
-		// we must assign listeners to local variable, since the add and
-		// remove listner
-		// methods can change the actual instance of the listener array
-		// from another thread
-		if (fModelStateListeners != null) {
-			Object[] holdListeners = fModelStateListeners;
-			for (int i = 0; i < holdListeners.length; i++) {
-				((IModelStateListener) holdListeners[i]).modelAboutToBeChanged(this);
-			}
-		}
-
-	}
-
-	protected void fireModelAboutToBeReinitialized() {
-
-		// we must assign listeners to local variable, since the add and
-		// remove
-		// listner
-		// methods can change the actual instance of the listener array from
-		// another thread
-		if (fModelStateListeners != null) {
-			if (Logger.DEBUG_MODELSTATE) {
-				Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelAboutToBeReinitialized"); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			Object[] holdListeners = fModelStateListeners;
-			for (int i = 0; i < holdListeners.length; i++) {
-				// NOTE: trick for transition. We actual use the same
-				// listeners
-				// as modelState, but only send this to those that have
-				// implemented ModelStateExtended.
-				IModelStateListener listener = (IModelStateListener) holdListeners[i];
-				listener.modelAboutToBeReinitialized(this);
-			}
-		}
-	}
-
-	private void fireModelChanged() {
-		// we must assign listeners
-		// to local variable, since the add
-		// and remove listner
-		// methods can change the actual instance of the listener
-		// array from another thread
-		if (fModelStateListeners != null) {
-			Object[] holdListeners = fModelStateListeners;
-			for (int i = 0; i < holdListeners.length; i++) {
-				try {
-					((IModelStateListener) holdListeners[i]).modelChanged(this);
-				}
-				// its so criticial that the begin/end arrive in
-				// pairs,
-				// if there happends to be an error in one of the
-				// modelChanged,
-				// they we want to be sure rest complete ok.
-				catch (Exception e) {
-					Logger.logException(e);
-				}
-			}
-
-		}
-	}
-
-	/**
-	 * Informs all registered model state listeners about a change in the
-	 * dirty state of the model. The dirty state is entirely about changes in
-	 * the content of the model (not, for example, about changes to id, or
-	 * base location -- see modelMoved).
-	 */
-	protected void fireModelDirtyStateChanged(IStructuredModel element, boolean isDirty) {
-
-		// we must assign listeners to local variable, since the add and
-		// remove
-		// listner
-		// methods can change the actual instance of the listener array from
-		// another thread
-		if (fModelStateListeners != null) {
-			if (Logger.DEBUG_MODELSTATE) {
-				Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelDirtyStateChanged"); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			Object[] holdListeners = fModelStateListeners;
-			for (int i = 0; i < holdListeners.length; i++) {
-				((IModelStateListener) holdListeners[i]).modelDirtyStateChanged(element, isDirty);
-			}
-		}
-	}
-
-	protected void fireModelReinitialized() {
-
-		// we must assign listeners to local variable, since the add and
-		// remove
-		// listner
-		// methods can change the actual instance of the listener array from
-		// another thread
-		if (fModelStateListeners != null) {
-			if (Logger.DEBUG_MODELSTATE) {
-				Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelReinitialized"); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			Object[] holdListeners = fModelStateListeners;
-			for (int i = 0; i < holdListeners.length; i++) {
-				IModelStateListener listener = (IModelStateListener) holdListeners[i];
-				listener.modelReinitialized(this);
-			}
-		}
-	}
-
-	/**
-	 * Informs all registered model state listeners about the deletion of a
-	 * model's underlying resource.
-	 */
-	protected void fireModelResourceDeleted(IStructuredModel element) {
-
-		// we must assign listeners to local variable, since the add and
-		// remove
-		// listner
-		// methods can change the actual instance of the listener array from
-		// another thread
-		if (fModelStateListeners != null) {
-			if (Logger.DEBUG_MODELSTATE) {
-				Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelResourceDeleted"); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			Object[] holdListeners = fModelStateListeners;
-			for (int i = 0; i < holdListeners.length; i++) {
-				((IModelStateListener) holdListeners[i]).modelResourceDeleted(element);
-			}
-		}
-	}
-
-	/**
-	 * Informs all registered model state listeners that the resource
-	 * underlying a model has been moved. This is typically reflected in a
-	 * change to the id, baseLocation, or both.
-	 */
-	protected void fireModelResourceMoved(IStructuredModel originalElement, IStructuredModel movedElement) {
-
-		// we must assign listeners to local variable, since the add and
-		// remove
-		// listner
-		// methods can change the actual instance of the listener array from
-		// another thread
-		if (fModelStateListeners != null) {
-			if (Logger.DEBUG_MODELSTATE) {
-				Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelResourceMoved"); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			Object[] holdListeners = fModelStateListeners;
-			for (int i = 0; i < holdListeners.length; i++) {
-				((IModelStateListener) holdListeners[i]).modelResourceMoved(originalElement, movedElement);
-			}
-		}
-	}
-
-	public Object getAdapter(Class adapter) {
-
-		return Platform.getAdapterManager().getAdapter(this, adapter);
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public java.lang.String getBaseLocation() {
-
-		return fBaseLocation;
-	}
-
-	/**
-	 * @see org.eclipse.wst.sse.core.internal.provisional.IStructuredModel#getContentTypeIdentifier()
-	 */
-	public String getContentTypeIdentifier() {
-		if (fExplicitContentTypeIdentifier != null)
-			return fExplicitContentTypeIdentifier;
-		return fModelHandler.getAssociatedContentTypeId();
-	}
-
-	/**
-	 * 
-	 */
-	public FactoryRegistry getFactoryRegistry() {
-		if (factoryRegistry == null) {
-			factoryRegistry = new FactoryRegistry();
-		}
-		return factoryRegistry;
-	}
-
-	/**
-	 * The id is the id that the model manager uses to identify this model
-	 */
-	public String getId() {
-
-
-		return fId;
-	}
-
-	public abstract IndexedRegion getIndexedRegion(int offset);
-
-	/**
-	 * @return
-	 */
-	private ILock getLockObjectFromDocument() {
-
-		// we always "get afresh" the lock object from our document,
-		// just in case the instance of the document changes.
-		ILock result = null;
-		IStructuredDocument doc = fStructuredDocument;
-		if (doc != null) {
-			if (doc instanceof ILockable) {
-				// remember, more than one client can get the
-				// lock object, its during the aquire that the
-				// lock on the thread is obtained.
-				result = ((ILockable) doc).getLockObject();
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Gets the contentTypeDescription.
-	 * 
-	 * @return Returns a ContentTypeDescription
-	 */
-	public IModelHandler getModelHandler() {
-
-		return fModelHandler;
-	}
-
-
-	public IModelManager getModelManager() {
-
-		return _getModelManager();
-	}
-
-	/**
-	 * This function returns the reference count of underlying model.
-	 */
-	// TODO: try to refine the design not to use this function
-	public int getReferenceCount() {
-
-
-		if (getModelManager() == null)
-			return 0;
-		return getModelManager().getReferenceCount(getId());
-	}
-
-
-	/**
-	 * This function returns the reference count of underlying model.
-	 */
-	// TODO: try to refine the design not to use this function
-	public int getReferenceCountForEdit() {
-
-
-
-		if (getModelManager() == null)
-			return 0;
-		return getModelManager().getReferenceCountForEdit(getId());
-	}
-
-
-	/**
-	 * This function returns the reference count of underlying model.
-	 */
-	// TODO: try to refine the design not to use this function
-	public int getReferenceCountForRead() {
-
-
-
-		if (getModelManager() == null)
-			return 0;
-		return getModelManager().getReferenceCountForRead(getId());
-	}
-
-	public Object getReinitializeStateData() {
-
-		return reinitializeStateData;
-	}
-
-
-
-	public URIResolver getResolver() {
-
-		return fResolver;
-	}
-
-
-	public IStructuredDocument getStructuredDocument() {
-
-		IStructuredDocument result = null;
-		result = fStructuredDocument;
-		return result;
-	}
-
-	/**
-	 * Insert the method's description here. Creation date: (9/7/2001 2:30:26
-	 * PM)
-	 * 
-	 * @return long
-	 */
-	public long getSynchronizationStamp() {
-
-		return fSynchronizationStamp;
-	}
-
-	public IStructuredTextUndoManager getUndoManager() {
-
-		IStructuredTextUndoManager structuredTextUndoManager = null;
-		IStructuredDocument structuredDocument = getStructuredDocument();
-		if (structuredDocument == null) {
-			structuredTextUndoManager = null;
-		}
-		else {
-			structuredTextUndoManager = structuredDocument.getUndoManager();
-		}
-		return structuredTextUndoManager;
-	}
-
-	public void initId(String id) {
-		fId = id;
-	}
-
-	final protected void internalAboutToBeChanged() {
-
-		// notice we only fire this event if we are not
-		// already in a model state changing sequence
-		if (fModelStateChanging == 0) {
-
-			if (Logger.DEBUG_MODELSTATE) {
-				Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelAboutToBeChanged"); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-
-			try {
-				fireModelAboutToBeChanged();
-			}
-			catch (Exception e) {
-				Logger.logException("Exception while notifying model state listers of about to change", e); //$NON-NLS-1$
-			}
-			finally {
-				// begin lock after listeners notified, otherwise
-				// deadlock could occur if they call us back.
-				beginLock();
-			}
-
-		}
-		// we always increment counter, for every request (so *must* receive
-		// corresponding number of 'changedModel' requests)
-		fModelStateChanging++;
-	}
-
-	/**
-	 * Informs all registered model state listeners that an impending change
-	 * is now complete. This method must only be called by 'modelChanged'
-	 * since it keeps track of counts.
-	 */
-	final protected void internalModelChanged() {
-
-		// always decrement
-		fModelStateChanging--;
-
-
-		// Check integrity
-		// to be less than zero is a programming error,
-		// but we'll reset to zero
-		// and try to continue
-		if (fModelStateChanging < 0) {
-			fModelStateChanging = 0;
-			// should not be locked, but just in case
-			endLock();
-			throw new IllegalStateException("Program Error: modelStateChanging was less than zero"); //$NON-NLS-1$
-		}
-
-
-		// We only fire this event if all pending requests are done.
-		// That is, if we've received the same number of modelChanged as
-		// we have aboutToChangeModel.
-		if (fModelStateChanging == 0) {
-			if (Logger.DEBUG_MODELSTATE) {
-				Logger.log(Logger.INFO, "IModelStateListener event for " + getId() + " : modelChanged"); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-
-			endLock();
-			// notifify listeners outside of locked state (or deadlock
-			// can occur if one of them calls us back.
-			fireModelChanged();
-		}
-	}
-
-	public boolean isDirty() {
-
-		return fDirtyState;
-	}
-
-	/**
-	 * This method has very special purpose, its used in subclass
-	 * 'changedModel' to know when to do "ending" sorts of things, right
-	 * before a call to super.ChangedModel would in deed put the model in
-	 * 'end' state. Put another way, at the beginning of the subclasses's
-	 * changedModel, the isModelStateChanging is true, but at end, it will be
-	 * false. So, this method allows a small "peek ahead".
-	 */
-	protected boolean isModelChangeStateOnVergeOfEnding() {
-
-
-		return fModelStateChanging == 1;
-	}
-
-	/**
-	 * This method can be called to determine if the model is within a
-	 * "aboutToChange" and "changed" sequence.
-	 */
-	public boolean isModelStateChanging() {
-
-
-		return fModelStateChanging > 0;
-	}
-
-	public boolean isNew() {
-
-		return fNewState;
-	}
-
-	public boolean isReinitializationNeeded() {
-
-		return reinitializationNeeded;
-	}
-
-	public boolean isSaveNeeded() {
-
-
-		if (!isSharedForEdit())
-			return isDirty();
-		else
-			return false;
-	}
-
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model.
-	 */
-	public boolean isShared() {
-		if (getModelManager() == null)
-			return false;
-		return getModelManager().isShared(getId());
-	}
-
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model.
-	 */
-	public boolean isSharedForEdit() {
-
-
-		if (getModelManager() == null)
-			return false;
-		return getModelManager().isSharedForEdit(getId());
-	}
-
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model.
-	 */
-	public boolean isSharedForRead() {
-
-
-		if (getModelManager() == null)
-			return false;
-		return getModelManager().isSharedForRead(getId());
-	}
-
-
-	public void modelReinitialized() {
-
-
-		// notice this is just a public avenue to our protected method
-		fireModelReinitialized();
-	}
-
-	public IStructuredModel newInstance() throws IOException {
-
-		IStructuredModel newModel = null;
-		// we delegate to the model manager, so loader, etc., can be
-		// used.
-		newModel = getModelManager().createNewInstance(this);
-		return newModel;
-	}
-
-	public IStructuredModel reinit() {
-
-
-		IStructuredModel result = null;
-		if (fModelStateChanging == 0) {
-			try {
-				aboutToChangeModel();
-				aboutToReinitializeModel();
-				result = _getModelManager().reinitialize(this);
-			}
-			finally {
-				setReinitializeNeeded(false);
-				setReinitializeStateData(null);
-				modelReinitialized();
-				changedModel();
-			}
-		}
-		else {
-			if (Logger.DEBUG) {
-				Logger.log(Logger.INFO, "indeed!!!"); //$NON-NLS-1$
-			}
-		}
-		return result;
-	}
-
-
-	/**
-	 * This function allows the model to free up any resources it might be
-	 * using. In particular, itself, as stored in the IModelManager.
-	 */
-	public void releaseFromEdit() {
-
-
-		if (getModelManager() == null) {
-			throw new IllegalStateException(MODEL_MANAGER_NULL); //$NON-NLS-1$
-		}
-		else {
-			// be sure to check the shared state before releasing. (Since
-			// isShared assumes a count
-			// of 1 means not shared ... and we want our '1' to be that
-			// one.)
-			boolean isShared = isShared();
-
-			if (!isShared) {
-				signalPreLifeCycleEventRelease(this);
-			}
-
-			_getModelManager().releaseFromEdit(getId());
-			// if no one else is using us, free up
-			// our resources
-			if (!isShared) {
-				_commonRelease();
-				signalPostLifeCycleListenerRelease(this);
-			}
-		}
-
-	}
-
-	/**
-	 * This function allows the model to free up any resources it might be
-	 * using. In particular, itself, as stored in the IModelManager.
-	 */
-	public void releaseFromRead() {
-
-		if (getModelManager() == null) {
-			throw new IllegalStateException(MODEL_MANAGER_NULL); //$NON-NLS-1$
-		}
-		else {
-			// be sure to check the shared state before
-			// releasing. (Since isShared assumes a count
-			// of 1 means not shared ... and we want
-			// our '1' to be that one.)
-			boolean isShared = isShared();
-
-			if (!isShared) {
-				signalPreLifeCycleEventRelease(this);
-			}
-
-			_getModelManager().releaseFromRead(getId());
-			// if no one else is using us, free up
-			// an resources
-			if (!isShared) {
-				// factoryRegistry.release();
-				_commonRelease();
-				signalPostLifeCycleListenerRelease(this);
-			}
-		}
-	}
-
-
-	/**
-	 * This function replenishes the model with the resource without saving
-	 * any possible changes. It is used when one editor may be closing, and
-	 * specifially says not to save the model, but another "display" of the
-	 * model still needs to hang on to some model, so needs a fresh copy.
-	 */
-	public IStructuredModel reload(InputStream inputStream) throws IOException {
-		IStructuredModel result = null;
-		try {
-			aboutToChangeModel();
-			result = _getModelManager().reloadModel(getId(), inputStream);
-		}
-		catch (UnsupportedEncodingException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-		finally {
-			changedModel();
-		}
-		return result;
-	}
-
-	public void removeModelLifecycleListener(IModelLifecycleListener listener) {
-
-		// if manager is null, then none have been added, so
-		// no need to remove it.
-		if (fLifecycleNotificationManager == null)
-			return;
-		synchronized (fListenerLock) {
-			fLifecycleNotificationManager.removeListener(listener);
-		}
-	}
-
-
-	public void removeModelStateListener(IModelStateListener listener) {
-
-		if (listener == null)
-			return;
-		if (fModelStateListeners == null)
-			return;
-		// if its not in the listeners, we'll ignore the request
-		synchronized (fListenerLock) {
-			if (Utilities.contains(fModelStateListeners, listener)) {
-				int oldSize = fModelStateListeners.length;
-				int newSize = oldSize - 1;
-				Object[] newListeners = new Object[newSize];
-				int index = 0;
-				for (int i = 0; i < oldSize; i++) {
-					if (fModelStateListeners[i] == listener) { // ignore
-					}
-					else {
-						// copy old to new if its not the one we are
-						// removing
-						newListeners[index++] = fModelStateListeners[i];
-					}
-				}
-				// now that we have a new array, let's switch it for the
-				// old
-				// one
-				fModelStateListeners = newListeners;
-			}
-		}
-	}
-
-
-	/**
-	 * A method that modififies the model's synchonization stamp to match the
-	 * resource. Turns out there's several ways of doing it, so this ensures a
-	 * common algorithm.
-	 */
-	public void resetSynchronizationStamp(IResource resource) {
-
-
-		setSynchronizationStamp(computeModificationStamp(resource));
-	}
-
-
-	/**
-	 * This API allows a client to initiate notification to all interested
-	 * parties that a model's underlying resource has been deleted.
-	 */
-	public void resourceDeleted() {
-
-
-		// notice this is just a public avenue to our protected method
-		fireModelResourceDeleted(this);
-	}
-
-
-	/**
-	 * This method allows a model client to initiate notification to all
-	 * interested parties that a model's underlying resource location has
-	 * changed. Note: we assume caller has already changed baseLocation, Id,
-	 * etc., since its really up to the client to determine what's "new" about
-	 * a moved model. Caution: 'this' and 'newModel' may be the same object.
-	 * This is the case for current working with FileModelProvider, but have
-	 * left the dual argument for future possiblities.
-	 */
-	public void resourceMoved(IStructuredModel newModel) {
-
-
-		// notice this is just a public avenue to our protected method
-		fireModelResourceMoved(this, newModel);
-	}
-
-
-	public void save() throws UnsupportedEncodingException, IOException, CoreException {
-
-		int type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.PRE_EVENT;
-		ModelLifecycleEvent modelLifecycleEvent = new ModelLifecycleEvent(this, type);
-		signalLifecycleEvent(modelLifecycleEvent);
-
-		try {
-			String stringId = getId();
-			_getModelManager().saveModel(stringId, EncodingRule.CONTENT_BASED);
-		}
-
-		finally {
-			// we put end notificatin in finally block, so even if
-			// error occurs during save, listeners are still notified,
-			// since their code could depend on receiving, to clean up
-			// some state, or coordinate other resources.
-			type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.POST_EVENT;
-			modelLifecycleEvent = new ModelLifecycleEvent(this, type);
-			signalLifecycleEvent(modelLifecycleEvent);
-		}
-	}
-
-
-	public void save(EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
-
-		int type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.PRE_EVENT;
-		ModelLifecycleEvent modelLifecycleEvent = new ModelLifecycleEvent(this, type);
-		signalLifecycleEvent(modelLifecycleEvent);
-
-		try {
-			String stringId = getId();
-			_getModelManager().saveModel(stringId, encodingRule);
-		}
-		finally {
-			// we put end notificatin in finally block, so even if
-			// error occurs during save, listeners are still notified,
-			// since their code could depend on receiving, to clean up
-			// some state, or coordinate other resources.
-			type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.POST_EVENT;
-			modelLifecycleEvent = new ModelLifecycleEvent(this, type);
-			signalLifecycleEvent(modelLifecycleEvent);
-		}
-	}
-
-
-	public void save(IFile iFile) throws UnsupportedEncodingException, IOException, CoreException {
-
-		int type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.PRE_EVENT;
-		ModelLifecycleEvent modelLifecycleEvent = new ModelLifecycleEvent(this, type);
-		signalLifecycleEvent(modelLifecycleEvent);
-
-		try {
-			String stringId = getId();
-			_getModelManager().saveModel(iFile, stringId, EncodingRule.CONTENT_BASED);
-		}
-
-		finally {
-			// we put end notificatin in finally block, so even if
-			// error occurs during save, listeners are still notified,
-			// since their code could depend on receiving, to clean up
-			// some state, or coordinate other resources.
-			type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.POST_EVENT;
-			modelLifecycleEvent = new ModelLifecycleEvent(this, type);
-			signalLifecycleEvent(modelLifecycleEvent);
-		}
-	}
-
-
-	public void save(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
-
-		int type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.PRE_EVENT;
-		ModelLifecycleEvent modelLifecycleEvent = new ModelLifecycleEvent(this, type);
-		signalLifecycleEvent(modelLifecycleEvent);
-
-		try {
-			String stringId = getId();
-			_getModelManager().saveModel(iFile, stringId, encodingRule);
-		}
-		finally {
-			// we put end notificatin in finally block, so even if
-			// error occurs during save, listeners are still notified,
-			// since their code could depend on receiving, to clean up
-			// some state, or coordinate other resources.
-			type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.POST_EVENT;
-			modelLifecycleEvent = new ModelLifecycleEvent(this, type);
-			signalLifecycleEvent(modelLifecycleEvent);
-		}
-	}
-
-
-	public void save(OutputStream outputStream) throws UnsupportedEncodingException, CoreException, IOException {
-
-		int type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.PRE_EVENT;
-		ModelLifecycleEvent modelLifecycleEvent = new ModelLifecycleEvent(this, type);
-		signalLifecycleEvent(modelLifecycleEvent);
-
-		try {
-			String stringId = getId();
-			_getModelManager().saveModel(stringId, outputStream, EncodingRule.CONTENT_BASED);
-		}
-
-		finally {
-			// we put end notificatin in finally block, so even if
-			// error occurs during save, listeners are still notified,
-			// since their code could depend on receiving, to clean up
-			// some state, or coordinate other resources.
-			type = ModelLifecycleEvent.MODEL_SAVED | ModelLifecycleEvent.POST_EVENT;
-			modelLifecycleEvent = new ModelLifecycleEvent(this, type);
-			signalLifecycleEvent(modelLifecycleEvent);
-		}
-	}
-
-
-	/**
-	 * This attribute is typically used to denote the model's underlying
-	 * resource.
-	 */
-	public void setBaseLocation(java.lang.String newBaseLocation) {
-
-		fBaseLocation = newBaseLocation;
-	}
-
-	public void setContentTypeIdentifier(String contentTypeIdentifier) {
-		fExplicitContentTypeIdentifier = contentTypeIdentifier;
-	}
-
-	/**
-	 * 
-	 */
-	public void setDirtyState(boolean dirtyState) {
-
-		// no need to process (set or fire event), if same value
-		if (fDirtyState != dirtyState) {
-			// prechange notificaiton
-			int type = ModelLifecycleEvent.MODEL_DIRTY_STATE | ModelLifecycleEvent.PRE_EVENT;
-			ModelLifecycleEvent modelLifecycleEvent = new ModelLifecycleEvent(this, type);
-			signalLifecycleEvent(modelLifecycleEvent);
-
-
-			// the actual change
-			fDirtyState = dirtyState;
-
-			// old notification
-			// TODO: C3 remove old notification
-			if (fDirtyState == false) {
-				// if we are being set to not dirty (such as just been saved)
-				// then we need to start listening for changes
-				// again to know when to set state to true;
-				getStructuredDocument().addDocumentChangedListener(fDirtyStateWatcher);
-			}
-			fireModelDirtyStateChanged(this, dirtyState);
-
-
-			// post change notification
-			type = ModelLifecycleEvent.MODEL_DIRTY_STATE | ModelLifecycleEvent.POST_EVENT;
-			modelLifecycleEvent = new ModelLifecycleEvent(this, type);
-			signalLifecycleEvent(modelLifecycleEvent);
-		}
-	}
-
-	/**
-	 * @deprecated - will likely be deprecated soon, in favor of direct 'adds'
-	 *             ... but takes some redesign.
-	 */
-	public void setFactoryRegistry(FactoryRegistry factoryRegistry) {
-		this.factoryRegistry = factoryRegistry;
-	}
-
-	/**
-	 * The id is the id that the model manager uses to identify this model. If
-	 * it is being set here, it means the model manger is already managing the
-	 * model with another id, so we have to keep it in sync. This method calls
-	 * notifies listners, if they haven't been notified already, that a "model
-	 * state change" is about to occur.
-	 */
-	public void setId(String newId) throws ResourceInUse {
-
-
-		// It makes no sense, I don't think, to have an id of null, so
-		// we'll throw an illegal argument exception if someone trys. Note:
-		// the IModelManager could not manage a model with an id of null,
-		// since it uses hashtables, and you can't have a null id for a
-		// hashtable.
-		if (newId == null)
-			throw new IllegalArgumentException(SSECoreMessages.A_model_s_id_can_not_be_nu_EXC_); //$NON-NLS-1$ = "A model's id can not be null"
-		// To gaurd againt throwing a spurious ResourceInUse exception,
-		// which can occur when two pieces of code both want to change the id,
-		// so the second request is spurious, we'll ignore any requests that
-		// attempt to change the id to what it already is ... note, we use
-		// 'equals', not identity ('==') so that things like
-		// strings can be used. This is the same criteria that ids are
-		// found in model manager -- well, actually, I just checked, and for
-		// the hashtable impl, the criteria uses .equals AND the condition
-		// that the hash values be identical (I'm assuming this is always
-		// true, if equals is true, for now, I'm not sure
-		// we can assume that hashtable will always be used, but in
-		// general, should match.)
-		//
-		if (newId.equals(fId))
-			return;
-		// we must gaurd against reassigning an id to one that we already
-		// are managing.
-		if (getModelManager() != null) {
-			IStructuredModel newModel = getModelManager().getExistingModelForEdit(newId);
-			if (newModel != null) {
-				// be sure to release the reference we got unexepectantly
-				// (and no longer need)
-				newModel.releaseFromEdit();
-				throw new ResourceInUse();
-			}
-		}
-		try {
-			// normal code path
-			aboutToChangeModel();
-			String oldId = fId;
-			fId = newId;
-			if (getModelManager() != null) {
-				// if managed and the id has changed, notify to
-				// IModelManager
-				// TODO: try to refine the design not to do that
-				if (oldId != null && newId != null && !newId.equals(oldId)) {
-					getModelManager().moveModel(oldId, newId);
-				}
-			}
-		}
-		finally {
-			// make sure this finally is only executed if 'about to Change
-			// model' has
-			// ben executed.
-			changedModel();
-		}
-	}
-
-	/**
-	 * Sets the contentTypeDescription.
-	 * 
-	 * @param contentTypeDescription
-	 *            The contentTypeDescription to set
-	 */
-	public void setModelHandler(IModelHandler modelHandler) {
-
-		// no need to fire events if modelHandler has been null
-		// for this model --
-		// this is an attempt at initialization optimization and may need
-		// to change in future.
-		boolean trueChange = false;
-		if (fModelHandler != null)
-			trueChange = true;
-		if (trueChange) {
-			internalAboutToBeChanged();
-		}
-		fModelHandler = modelHandler;
-		if (trueChange) {
-			internalModelChanged();
-		}
-	}
-
-
-
-	public void setModelManager(IModelManager newModelManager) {
-
-		fModelManager = newModelManager;
-	}
-
-	/**
-	 * 
-	 */
-	public void setNewState(boolean newState) {
-
-		fNewState = newState;
-	}
-
-	/**
-	 * Sets a "flag" that reinitialization is needed.
-	 */
-	public void setReinitializeNeeded(boolean needed) {
-
-		reinitializationNeeded = needed;
-	}
-
-	/**
-	 * Holds any data that the reinit procedure might find useful in
-	 * reinitializing the model. This is handy, since the reinitialization may
-	 * not take place at once, and some "old" data may be needed to properly
-	 * undo previous settings. Note: the parameter was intentially made to be
-	 * of type 'Object' so different models can use in different ways.
-	 */
-	public void setReinitializeStateData(Object object) {
-
-		reinitializeStateData = object;
-	}
-
-
-	public void setResolver(URIResolver newResolver) {
-
-		fResolver = newResolver;
-	}
-
-
-	public void setStructuredDocument(IStructuredDocument newStructuredDocument) {
-		boolean lifeCycleNotification = false;
-		if (fStructuredDocument != null) {
-			fStructuredDocument.removeDocumentChangedListener(fDirtyStateWatcher);
-			fStructuredDocument.removeDocumentAboutToChangeListener(fDocumentToModelNotifier);
-			fStructuredDocument.removeDocumentChangedListener(fDocumentToModelNotifier);
-			// prechange notificaiton
-			lifeCycleNotification = true;
-			ModelLifecycleEvent modelLifecycleEvent = new DocumentChanged(ModelLifecycleEvent.PRE_EVENT, this, fStructuredDocument, newStructuredDocument);
-			signalLifecycleEvent(modelLifecycleEvent);
-		}
-
-		// hold for life cycle notification
-		IStructuredDocument previousDocument = fStructuredDocument;
-		// the actual change
-		fStructuredDocument = newStructuredDocument;
-
-
-		// at the super class level, we'll listen for structuredDocument
-		// changes
-		// so we can set our dirty state flag
-		if (fStructuredDocument != null) {
-			fStructuredDocument.addDocumentChangedListener(fDirtyStateWatcher);
-			fStructuredDocument.addDocumentAboutToChangeListener(fDocumentToModelNotifier);
-			fStructuredDocument.addDocumentChangedListener(fDocumentToModelNotifier);
-		}
-
-		if (lifeCycleNotification) {
-			// post change notification
-			ModelLifecycleEvent modelLifecycleEvent = new DocumentChanged(ModelLifecycleEvent.POST_EVENT, this, previousDocument, newStructuredDocument);
-			signalLifecycleEvent(modelLifecycleEvent);
-		}
-	}
-
-	/**
-	 * Insert the method's description here. Creation date: (9/7/2001 2:30:26
-	 * PM)
-	 * 
-	 * @param newSynchronizationStamp
-	 *            long
-	 */
-	protected void setSynchronizationStamp(long newSynchronizationStamp) {
-
-		fSynchronizationStamp = newSynchronizationStamp;
-	}
-
-	public void setUndoManager(IStructuredTextUndoManager undoManager) {
-
-		IStructuredDocument structuredDocument = getStructuredDocument();
-		if (structuredDocument == null) {
-			throw new IllegalStateException("document was null when undo manager set on model"); //$NON-NLS-1$
-		}
-		structuredDocument.setUndoManager(undoManager);
-	}
-
-	/**
-	 * to be called only be "friendly" classes, such as ModelManger, and
-	 * subclasses.
-	 */
-	void signalLifecycleEvent(ModelLifecycleEvent event) {
-
-		if (fLifecycleNotificationManager == null)
-			return;
-		fLifecycleNotificationManager.signalLifecycleEvent(event);
-	}
-
-	private void signalPostLifeCycleListenerRelease(IStructuredModel structuredModel) {
-		int type = ModelLifecycleEvent.MODEL_RELEASED | ModelLifecycleEvent.POST_EVENT;
-		// what's wrong with this design that a cast is needed here!?
-		ModelLifecycleEvent event = new ModelLifecycleEvent(structuredModel, type);
-		((AbstractStructuredModel) structuredModel).signalLifecycleEvent(event);
-	}
-
-	private void signalPreLifeCycleEventRelease(IStructuredModel structuredModel) {
-		int type = ModelLifecycleEvent.MODEL_RELEASED | ModelLifecycleEvent.PRE_EVENT;
-		// what's wrong with this design that a cast is needed here!?
-		ModelLifecycleEvent event = new ModelLifecycleEvent(structuredModel, type);
-		((AbstractStructuredModel) structuredModel).signalLifecycleEvent(event);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/FactoryRegistry.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/FactoryRegistry.java
deleted file mode 100644
index f536729..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/FactoryRegistry.java
+++ /dev/null
@@ -1,179 +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.sse.core.internal.model;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-
-
-/**
- * This class simply maintains the list of factories and returns singleton
- * instances of them. Some "built in" types are automatically created form
- * FactoryConfig, if not found registerd, but normally clients can/should
- * register their own factories.
- * 
- * Not intended for clients to subclass or instantiate.
- * 
- */
-public final class FactoryRegistry {
-
-	private List factories;
-
-	/**
-	 * intentionally default access
-	 */
-	FactoryRegistry() {
-		super();
-
-	}
-
-	private List _getFactories() {
-
-		if (factories == null) {
-			// may need to use java.util.Collections.synchronizedList() if
-			// syncronization becomes
-			// necessary (and if so, remember to synchronize on factories)
-			factories = new ArrayList();
-		}
-		return factories;
-
-	}
-
-	public void addFactory(INodeAdapterFactory factory) {
-		_getFactories().add(factory);
-	}
-
-	public void clearFactories() {
-		factories.clear();
-	}
-
-	/*
-	 * @see FactoryRegistry#contains(Object)
-	 */
-	public boolean contains(Object type) {
-		boolean result = false;
-		// note: we're not using cloned list, so strictly speaking
-		// is not thread safe.
-		List internalList = _getFactories();
-		for (int i = 0; i < internalList.size(); i++) {
-			INodeAdapterFactory factory = (INodeAdapterFactory) internalList.get(i);
-			if (factory.isFactoryForType(type)) {
-				result = true;
-				break;
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Returns a shallow copy of the list of factories in the registry. Note:
-	 * this can not be used to add/remove factories. Its primarily provided
-	 * for those few cases where a list of factories must be copied from one
-	 * model and added to another.
-	 */
-	public List getFactories() {
-		// note: for object integrity, we don't let anyone get
-		// our main list (so they have to add through addFactory),
-		// but we will return a shallow "cloned" list.
-		List factoryList = new ArrayList(_getFactories());
-		return factoryList;
-	}
-
-	/**
-	 * This method is a not a pure resistry. Factories retrieved based on
-	 * their response to "isFactoryForType(type)". Note that if there is more
-	 * than one factory that can answer 'true' that the most recently added
-	 * factory is used.
-	 */
-	public INodeAdapterFactory getFactoryFor(Object type) {
-
-		INodeAdapterFactory result = null;
-		if (factories == null)
-			return null;
-		int listSize = factories.size();
-		for (int i = listSize - 1; i >= 0; i--) {
-			// It is the adapter factories responsibility to answer
-			// isFactoryForType so it gets choosen.
-			// Notice we are going through the list backwards to get the
-			// factory added last.
-			INodeAdapterFactory a = (INodeAdapterFactory) factories.get(i);
-			if (a.isFactoryForType(type)) {
-				result = a;
-				break;
-			}
-		}
-		return result;
-
-	}
-
-	/**
-	 * 
-	 */
-	public void release() {
-		// modified to work on copy of list, for V5PTF1
-		// send release to local copy of list
-		// of factories, since some factories, during
-		// their release function, may remove
-		// themselves from the registry.
-		List localList = getFactories();
-		for (int i = 0; i < localList.size(); i++) {
-			INodeAdapterFactory a = (INodeAdapterFactory) localList.get(i);
-			// To help bullet proof code, we'll catch and log
-			// any messages thrown by factories during release,
-			// but we'll attempt to keep going.
-			// In nearly all cases, though, such errors are
-			// severe for product/client, and need to be fixed.
-			try {
-				a.release();
-			}
-			catch (Exception e) {
-				Logger.logException("Program problem releasing factory" + a, e); //$NON-NLS-1$
-			}
-		}
-	}
-
-	/**
-	 * Removes a factory if it can be retrieved by getFactoryFor(type). If
-	 * there is more than one, all are removed. If there is none, the call
-	 * simply returns (that is, it is not considered an error).
-	 */
-	public void removeFactoriesFor(java.lang.Object type) {
-		if (factories != null) {
-			int listSize = factories.size();
-			// we'll go backwards through list, since we're removing, so
-			// 'size' change won't matter.
-			// Note: I'm assuming other items in the collection do not change
-			// position
-			// simply because another was removed.
-			for (int i = listSize - 1; i >= 0; i--) {
-				// It is the adapter factories responsibility to answer
-				// isFactoryForType so it gets choosen.
-				INodeAdapterFactory a = (INodeAdapterFactory) factories.get(i);
-				if (a.isFactoryForType(type)) {
-					factories.remove(a);
-				}
-			}
-		}
-	}
-
-	public void removeFactory(INodeAdapterFactory factory) {
-		_getFactories().remove(factory);
-
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/LifecycleNotificationManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/LifecycleNotificationManager.java
deleted file mode 100644
index ee2a932..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/LifecycleNotificationManager.java
+++ /dev/null
@@ -1,119 +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.sse.core.internal.model;
-
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-
-/**
- * For "internal use" only by AbstractStructuredModel
- */
-
-class LifecycleNotificationManager {
-	private Object[] fListeners;
-
-	LifecycleNotificationManager() {
-		super();
-	}
-
-	/**
-	 * Adds a new copy of the given listener to the list of Life Cycle
-	 * Listeners.
-	 * 
-	 * Multiple copies of the same listener are allowed. This is required to
-	 * support threaded listener management properly and for model-driven move
-	 * to work. For example, two adds and a single remove should result in the
-	 * listener still listening for events.
-	 * 
-	 * @param listener
-	 */
-	void addListener(IModelLifecycleListener listener) {
-		if (Logger.DEBUG && Utilities.contains(fListeners, listener)) {
-			Logger.log(Logger.WARNING, "IModelLifecycleListener " + listener + " listening more than once"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		int oldSize = 0;
-		if (fListeners != null) {
-			// normally won't be null, but we need to be sure, for first
-			// time through
-			oldSize = fListeners.length;
-		}
-		int newSize = oldSize + 1;
-		Object[] newListeners = new Object[newSize];
-		if (fListeners != null) {
-			System.arraycopy(fListeners, 0, newListeners, 0, oldSize);
-		}
-		// add listener to last position
-		newListeners[newSize - 1] = listener;
-		//
-		// now switch new for old
-		fListeners = newListeners;
-	}
-
-	/**
-	 * Removes a single copy of the given listener from the list of Life Cycle
-	 * Listeners.
-	 * 
-	 * @param listener
-	 */
-	void removeListener(IModelLifecycleListener listener) {
-		if (Utilities.contains(fListeners, listener)) {
-			// if its not in the listeners, we'll ignore the request
-			int oldSize = fListeners.length;
-			int newSize = oldSize - 1;
-			Object[] newListeners = new Object[newSize];
-			int index = 0;
-			boolean removedOnce = false;
-			for (int i = 0; i < oldSize; i++) {
-				if (fListeners[i] == listener && !removedOnce) {
-					// ignore on the first match
-					removedOnce = true;
-				} else {
-					// copy old to new if it's not the one we are removing
-					newListeners[index++] = fListeners[i];
-				}
-			}
-			// now that we have a new array, let's switch it for the old
-			// one
-			fListeners = newListeners;
-		}
-		if (Logger.DEBUG && Utilities.contains(fListeners, listener)) {
-			Logger.log(Logger.WARNING, "IModelLifecycleListener " + listener + " removed once but still listening"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-
-	void signalLifecycleEvent(ModelLifecycleEvent event) {
-		if (Logger.DEBUG_LIFECYCLE) {
-			Logger.log(Logger.INFO, "ModelLifecycleEvent fired for " + event.getModel().getId() + ": " + event.toString()); //$NON-NLS-1$ //$NON-NLS-2$
-			System.out.println("ModelLifecycleEvent fired for " + event.getModel().getId() + ": " + event.toString()); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		// We must assign listeners to local variable, since the add and
-		// remove listener methods can change the actual instance of the
-		// listener array from another thread
-		if (fListeners != null) {
-			Object[] holdListeners = fListeners;
-			for (int i = 0; i < holdListeners.length; i++) {
-				IModelLifecycleListener listener = (IModelLifecycleListener) holdListeners[i];
-				// only one type of listener for now ... this could become
-				// more complex
-				if ((event.getInternalType() & ModelLifecycleEvent.PRE_EVENT) == ModelLifecycleEvent.PRE_EVENT) {
-					listener.processPreModelEvent(event);
-				}
-				if ((event.getInternalType() & ModelLifecycleEvent.POST_EVENT) == ModelLifecycleEvent.POST_EVENT) {
-					listener.processPostModelEvent(event);
-				}
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelLifecycleEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelLifecycleEvent.java
deleted file mode 100644
index acab6d5..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelLifecycleEvent.java
+++ /dev/null
@@ -1,117 +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.sse.core.internal.model;
-
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-/**
- * This is an early version of a class that may change over the next few
- * milestones.
- */
-
-
-public class ModelLifecycleEvent {
-
-
-	// this list is for "public" consumption
-	public static final int MODEL_SAVED = 0x0001;
-	public static final int MODEL_RELEASED = 0x00002;
-	public static final int MODEL_DOCUMENT_CHANGED = 0x0003;
-	public static final int MODEL_DIRTY_STATE = 0x0004;
-	public static final int MODEL_REVERT= 0x0005;
-
-	// TODO: finish support for these
-	// following not implemented yet
-	public static final int MODEL_REINITIALIZED = 0x0006;
-	//public static final int ADAPTERS_NOTIFIED = 0x0007;
-	//public static final int MODEL_RESOURCE_MOVED = 0x0008;
-	//public static final int MODEL_RESOURCE_DELETED = 0x0009;
-
-	// This list (upper two bytes) is for only internal mechanisms and
-	// subclasses
-	// For simplicity they are "masked out" when client calls getType()
-	protected static final int PRE_EVENT = 0x0100;
-	private final static int MASK = 0x00FF;
-	protected static final int POST_EVENT = 0x0200;
-
-
-	private IStructuredModel fModel;
-	private int fType;
-
-	public ModelLifecycleEvent() {
-		super();
-	}
-
-	public ModelLifecycleEvent(int type) {
-		this();
-		fType = type;
-	}
-
-	public ModelLifecycleEvent(IStructuredModel structuredModel, int type) {
-		this(type);
-		fModel = structuredModel;
-	}
-
-	private String debugString(int type) {
-		String result = null;
-		switch (type & MASK) {
-			case MODEL_SAVED :
-				result = "MODEL_SAVED"; //$NON-NLS-1$
-				break;
-			case MODEL_RELEASED :
-				result = "MODEL_RELEASED"; //$NON-NLS-1$
-				break;
-			case MODEL_DOCUMENT_CHANGED :
-				result = "MODEL_DOCUMENT_CHANGED"; //$NON-NLS-1$
-				break;
-			case MODEL_DIRTY_STATE :
-				result = "MODEL_DIRTY_STATE"; //$NON-NLS-1$
-				break;
-			/*
-			 * case MODEL_REINITIALIZED : result = "MODEL_REINITIALIZED";
-			 * break; case MODEL_RELOADED : result = "MODEL_RELOADED"; break;
-			 * case ADAPTERS_NOTIFIED : result = "ADAPTERS_NOTIFIED"; break;
-			 * case MODEL_RESOURCE_MOVED : result = "MODEL_RESOURCE_MOVED";
-			 * break; case MODEL_RESOURCE_DELETED : result =
-			 * "MODEL_RESOURCE_DELETED"; break;
-			 */
-			default :
-				throw new IllegalStateException("ModelLifecycleEvent did not have valid type"); //$NON-NLS-1$
-		}
-		return result;
-	}
-
-	protected int getInternalType() {
-
-		return fType;
-	}
-
-	public IStructuredModel getModel() {
-
-		return fModel;
-	}
-
-	public int getType() {
-
-		// for now, we'll mask type to "public" ones this easy
-		// way ... but I know there must be a better way
-		return fType & MASK;
-	}
-
-	public String toString() {
-		String result = null;
-		result = "ModelLifecycleEvent: " + debugString(fType); //$NON-NLS-1$
-		return result;
-	}
-
-}
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
deleted file mode 100644
index ddd6527..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelManagerImpl.java
+++ /dev/null
@@ -1,1610 +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.sse.core.internal.model;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-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.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.NullMemento;
-import org.eclipse.wst.sse.core.internal.SSECoreMessages;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.encoding.CodedStreamCreator;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.encoding.ContentBasedPreferenceGateway;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.exceptions.MalformedOutputExceptionWithDetail;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
-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.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
-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.Assert;
-import org.eclipse.wst.sse.core.internal.util.ProjectResolver;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-/**
- * Not intended to be subclassed, referenced or instantiated by clients.
- * 
- * This class is responsible for creating, retriving, 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'.
- */
-public class ModelManagerImpl implements IModelManager {
-
-	static class EnumeratedModelIds implements Enumeration {
-
-		Enumeration fSharedObjectKeys;
-
-		protected EnumeratedModelIds(Dictionary sharedObjects) {
-
-			if (sharedObjects == null) {
-				// if no shared objects yet, return empty enumeration
-				fSharedObjectKeys = null;
-			}
-			else {
-				fSharedObjectKeys = sharedObjects.keys();
-			}
-		}
-
-		public boolean hasMoreElements() {
-
-			boolean result = false;
-			if (fSharedObjectKeys != null)
-				result = fSharedObjectKeys.hasMoreElements();
-			return result;
-		}
-
-		public Object nextElement() {
-
-			if (fSharedObjectKeys == null)
-				throw new NoSuchElementException();
-			return fSharedObjectKeys.nextElement();
-		}
-	}
-
-	static class ReadEditType {
-		ReadEditType(String type) {
-		}
-	}
-
-	/**
-	 * A Data class to track our shared objects
-	 */
-	static class SharedObject {
-		int referenceCountForEdit;
-		int referenceCountForRead;
-		IStructuredModel theSharedModel;
-
-		SharedObject(IStructuredModel sharedModel) {
-			theSharedModel = sharedModel;
-			referenceCountForRead = 0;
-			referenceCountForEdit = 0;
-		}
-	}
-	
-	private Exception debugException = null;
-
-	/**
-	 * Our singleton instance
-	 */
-	private static ModelManagerImpl instance;
-	private final static int READ_BUFFER_SIZE = 4096;
-
-	/**
-	 * Not to be called by clients, will be made restricted access.
-	 * 
-	 * @return
-	 */
-	public synchronized static IModelManager getInstance() {
-
-		if (instance == null) {
-			instance = new ModelManagerImpl();
-		}
-		return instance;
-	}
-
-	private final ReadEditType EDIT = new ReadEditType("edit"); //$NON-NLS-1$
-	/**
-	 * Our cache of managed objects
-	 */
-	private Dictionary fManagedObjects;
-
-	private ModelHandlerRegistry fModelHandlerRegistry;
-	private int modelManagerStateChanging;
-	private final ReadEditType READ = new ReadEditType("read"); //$NON-NLS-1$
-
-	/**
-	 * Intentially default access only.
-	 * 
-	 */
-	ModelManagerImpl() {
-
-		super();
-		fManagedObjects = new Hashtable();
-	}
-
-	private IStructuredModel _commonCreateModel(InputStream inputStream, String id, IModelHandler handler, URIResolver resolver, ReadEditType rwType, EncodingRule encodingRule) throws IOException {
-
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		IStructuredModel model = null;
-		if (sharedObject == null) {
-			try {
-				model = _commonCreateModel(id, handler, resolver);
-				IModelLoader loader = handler.getModelLoader();
-				loader.load(Utilities.getMarkSupportedStream(inputStream), model, encodingRule);
-			}
-			catch (ResourceInUse e) {
-				// impossible, since we've already found
-				handleProgramError(e);
-			}
-			if (model != null) {
-				// add to our cache
-				sharedObject = new SharedObject(model);
-				_initCount(sharedObject, rwType);
-				fManagedObjects.put(id, sharedObject);
-			}
-		}
-		else {
-			// if shared object is initially in our cache, then simply
-			// increment its ref count,
-			// and return the object.
-			_incrCount(sharedObject, rwType);
-		}
-		// we expect to always return something
-		if (sharedObject == null) {
-			debugException = new Exception("instance only for stack trace"); //$NON-NLS-1$
-			Logger.logException("Program Error: no model recorded for id " + id, debugException); //$NON-NLS-1$
-		}
-
-
-		// note: clients must call release for each time they call get.
-		return sharedObject.theSharedModel;
-	}
-
-	private IStructuredModel _commonCreateModel(InputStream inputStream, String id, IModelHandler handler, URIResolver resolver, ReadEditType rwType, String encoding, String lineDelimiter) throws IOException {
-
-		if (id == null) {
-			throw new IllegalArgumentException("Program Error: id may not be null"); //$NON-NLS-1$
-		}
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		IStructuredModel model = null;
-		if (sharedObject == null) {
-			try {
-				model = _commonCreateModel(id, handler, resolver);
-				IModelLoader loader = handler.getModelLoader();
-				if (inputStream == null) {
-					Logger.log(Logger.WARNING, "model was requested for id " + id + " without a content InputStream"); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-				loader.load(id, Utilities.getMarkSupportedStream(inputStream), model, encoding, lineDelimiter);
-			}
-			catch (ResourceInUse e) {
-				// impossible, since we've already found
-				handleProgramError(e);
-			}
-			if (model != null) {
-				// add to our cache
-				sharedObject = new SharedObject(model);
-				_initCount(sharedObject, rwType);
-				fManagedObjects.put(id, sharedObject);
-			}
-		}
-		else {
-			// if shared object is initially in our cache, then simply
-			// increment its ref count,
-			// and return the object.
-			_incrCount(sharedObject, rwType);
-		}
-		// we expect to always return something
-		Assert.isNotNull(sharedObject, "Program Error: no model recorded for id " + id); //$NON-NLS-1$
-		// note: clients must call release for each time they call get.
-		return sharedObject.theSharedModel;
-	}
-
-	private IStructuredModel _commonCreateModel(String id, IModelHandler handler, URIResolver resolver) throws ResourceInUse {
-
-		IModelLoader loader = handler.getModelLoader();
-		IStructuredModel result = loader.createModel();
-		// in the past, id was null for "unmanaged" case, so we won't
-		// try and set it
-		if (id != null) {
-			result.setId(id);
-		}
-		result.setModelHandler(handler);
-		result.setResolver(resolver);
-		// some obvious redunancy here that maybe could be improved
-		// in future, but is necessary for now
-		result.setBaseLocation(id);
-		if (resolver != null) {
-			resolver.setFileBaseLocation(id);
-		}
-		addFactories(result, handler);
-		return result;
-	}
-
-	private IStructuredModel _commonGetModel(IFile iFile, ReadEditType rwType, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
-		IStructuredModel model = null;
-
-		if (iFile != null && iFile.exists()) {
-			String id = calculateId(iFile);
-			IModelHandler handler = calculateType(iFile);
-			URIResolver resolver = calculateURIResolver(iFile);
-			InputStream inputStream = Utilities.getMarkSupportedStream(iFile.getContents(true));
-			try {
-				model = _commonCreateModel(inputStream, id, handler, resolver, rwType, encodingRule);
-			}
-			finally {
-				if (inputStream != null) {
-					inputStream.close();
-				}
-			}
-		}
-
-		return model;
-	}
-
-	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);
-
-		return model;
-	}
-
-	private IStructuredModel _commonGetModel(IFile file, String id, IModelHandler handler, URIResolver resolver, 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$
-
-		IStructuredModel model = null;
-
-		if (file != null && file.exists()) {
-			SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-			if (sharedObject == null) {
-				model = FileBufferModelManager.getInstance().getModel(file);
-				if (model != null) {
-					// add to our cache
-					sharedObject = new SharedObject(model);
-					_initCount(sharedObject, rwType);
-					fManagedObjects.put(id, sharedObject);
-				}
-			}
-			else {
-				// if shared object is initially in our cache, then simply
-				// increment its ref count,
-				// and return the object.
-				_incrCount(sharedObject, rwType);
-			}
-
-			// if we don't know how to create a model
-			// for this type of file, return null
-			if(sharedObject != null) {
-				// note: clients must call release for each time they call get.
-				model = sharedObject.theSharedModel;
-			}
-		}
-		
-		return model;
-	}
-
-	private SharedObject _commonNewModel(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException {
-		IStructuredModel aSharedModel = null;
-		// First, check if resource already exists on file system.
-		// if is does, then throw Resource in Use iff force==false
-
-		if (iFile.exists() && !force) {
-			throw new ResourceAlreadyExists();
-		}
-
-		String id = calculateId(iFile);
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-
-		if (sharedObject != null && !force) {
-			// if in cache already, and force is not true, then this is an
-			// error
-			// in call
-			throw new ResourceInUse();
-		}
-
-		// if we get to hear without above exceptions, then all is ok 
-		// to get model like normal, but set 'new' attribute (where the 
-		// 'new' attribute means this is a model without a corresponding 
-		// underlying resource. 
-		aSharedModel = FileBufferModelManager.getInstance().getModel(iFile);
-		aSharedModel.setNewState(true);
-		sharedObject = addToCache(id, aSharedModel);
-		// when resource is provided, we can set
-		// synchronization stamp ... otherwise client should
-		// Note: one client which does this is FileModelProvider.
-		aSharedModel.resetSynchronizationStamp(iFile);
-		return sharedObject;
-	}
-
-	public IStructuredModel _getModelFor(IStructuredDocument document, ReadEditType accessType) {
-		IStructuredModel model = null;
-		String id = FileBufferModelManager.getInstance().calculateId(document);
-		Assert.isNotNull(id, "unknown IStructuredDocument " + document); //$NON-NLS-1$
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		if (sharedObject != null) {
-			sharedObject = (SharedObject) fManagedObjects.get(id);
-			_incrCount(sharedObject, accessType);
-			model = sharedObject.theSharedModel;
-		}
-		else {
-			model = FileBufferModelManager.getInstance().getModel(document);
-			sharedObject = new SharedObject(model);
-			_initCount(sharedObject, accessType);
-			fManagedObjects.put(id, sharedObject);
-		}
-		return model;
-	}
-
-	private void _incrCount(SharedObject sharedObject, ReadEditType type) {
-		if (type == READ) {
-			sharedObject.referenceCountForRead++;
-		}
-		else if (type == EDIT) {
-			sharedObject.referenceCountForEdit++;
-		}
-		else
-			throw new IllegalArgumentException();
-	}
-
-	private void _initCount(SharedObject sharedObject, ReadEditType type) {
-		if (type == READ) {
-			sharedObject.referenceCountForRead = 1;
-		}
-		else if (type == EDIT) {
-			sharedObject.referenceCountForEdit = 1;
-		}
-		else
-			throw new IllegalArgumentException();
-	}
-
-	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$
-		List factoryList = handler.getAdapterFactories();
-		addFactories(model, factoryList);
-	}
-
-	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$
-		// Note: we add all of them from handler, even if
-		// already exists. May need to reconsider this.
-		if (factoryList != null) {
-			Iterator iterator = factoryList.iterator();
-			while (iterator.hasNext()) {
-				INodeAdapterFactory factory = (INodeAdapterFactory) iterator.next();
-				registry.addFactory(factory);
-			}
-		}
-	}
-
-	private SharedObject addToCache(String id, IStructuredModel aSharedModel) {
-		SharedObject sharedObject;
-		sharedObject = new SharedObject(aSharedModel);
-		fManagedObjects.put(id, sharedObject);
-		return sharedObject;
-	}
-
-	/**
-	 * Calculate id provides a common way to determine the id from the input
-	 * ... needed to get and save the model. It is a simple class utility, but
-	 * is an instance method so can be accessed via interface.
-	 */
-	public String calculateId(IFile file) {
-		return FileBufferModelManager.getInstance().calculateId(file);
-	}
-
-	private IModelHandler calculateType(IFile iFile) throws CoreException {
-		// IModelManager mm = ((ModelManagerPlugin)
-		// Platform.getPlugin(ModelManagerPlugin.ID)).getModelManager();
-		ModelHandlerRegistry cr = getModelHandlerRegistry();
-		IModelHandler cd = cr.getHandlerFor(iFile);
-		return cd;
-	}
-
-	private IModelHandler calculateType(String filename, InputStream inputStream) throws IOException {
-		ModelHandlerRegistry cr = getModelHandlerRegistry();
-		IModelHandler cd = cr.getHandlerFor(filename, inputStream);
-		return cd;
-	}
-
-	/**
-	 * 
-	 */
-	private URIResolver calculateURIResolver(IFile file) {
-		// Note: see comment in plugin.xml for potentially
-		// breaking change in behavior.
-
-		IProject project = file.getProject();
-		URIResolver resolver = (URIResolver) project.getAdapter(URIResolver.class);
-		if (resolver == null)
-			resolver = new ProjectResolver(project);
-		resolver.setFileBaseLocation(file.getLocation().toString());
-		return resolver;
-	}
-
-	/*
-	 * Note: This method appears in both ModelManagerImpl and JSEditor (with
-	 * just a minor difference). They should be kept the same.
-	 * 
-	 * @deprecated - handled by platform
-	 */
-	private void convertLineDelimiters(IDocument document, IFile iFile) throws CoreException {
-		// Note: calculateType(iFile) returns a default xml model handler if
-		// content type is null.
-		String contentTypeId = calculateType(iFile).getAssociatedContentTypeId();
-		String endOfLineCode = ContentBasedPreferenceGateway.getPreferencesString(contentTypeId, CommonEncodingPreferenceNames.END_OF_LINE_CODE);
-		// endOfLineCode == null means the content type does not support this
-		// function (e.g. DTD)
-		// endOfLineCode == "" means no translation
-		if (endOfLineCode != null && endOfLineCode.length() > 0) {
-			String lineDelimiterToUse = System.getProperty("line.separator"); //$NON-NLS-1$
-			if (endOfLineCode.equals(CommonEncodingPreferenceNames.CR))
-				lineDelimiterToUse = CommonEncodingPreferenceNames.STRING_CR;
-			else if (endOfLineCode.equals(CommonEncodingPreferenceNames.LF))
-				lineDelimiterToUse = CommonEncodingPreferenceNames.STRING_LF;
-			else if (endOfLineCode.equals(CommonEncodingPreferenceNames.CRLF))
-				lineDelimiterToUse = CommonEncodingPreferenceNames.STRING_CRLF;
-
-			TextEdit multiTextEdit = new MultiTextEdit();
-			int lineCount = document.getNumberOfLines();
-			try {
-				for (int i = 0; i < lineCount; i++) {
-					IRegion lineInfo = document.getLineInformation(i);
-					int lineStartOffset = lineInfo.getOffset();
-					int lineLength = lineInfo.getLength();
-					int lineEndOffset = lineStartOffset + lineLength;
-
-					if (i < lineCount - 1) {
-						String currentLineDelimiter = document.getLineDelimiter(i);
-						if (currentLineDelimiter != null && currentLineDelimiter.compareTo(lineDelimiterToUse) != 0)
-							multiTextEdit.addChild(new ReplaceEdit(lineEndOffset, currentLineDelimiter.length(), lineDelimiterToUse));
-					}
-				}
-
-				if (multiTextEdit.getChildrenSize() > 0)
-					multiTextEdit.apply(document);
-			}
-			catch (BadLocationException exception) {
-				// just adding generic runtime here, until whole method deleted.
-				throw new RuntimeException(exception.getMessage());
-			}
-		}
-	}
-
-	/**
-	 * this used to be in loader, but has been moved here
-	 */
-	private IStructuredModel copy(IStructuredModel model, String newId) throws ResourceInUse {
-		IStructuredModel newModel = null;
-		IStructuredModel oldModel = model;
-		IModelHandler modelHandler = oldModel.getModelHandler();
-		IModelLoader loader = modelHandler.getModelLoader();
-		// newModel = loader.newModel();
-		newModel = loader.createModel(oldModel);
-		// newId, oldModel.getResolver(), oldModel.getModelManager());
-		newModel.setModelHandler(modelHandler);
-		// IStructuredDocument oldStructuredDocument =
-		// oldModel.getStructuredDocument();
-		// IStructuredDocument newStructuredDocument =
-		// oldStructuredDocument.newInstance();
-		// newModel.setStructuredDocument(newStructuredDocument);
-		newModel.setResolver(oldModel.getResolver());
-		newModel.setModelManager(oldModel.getModelManager());
-		// duplicateFactoryRegistry(newModel, oldModel);
-		newModel.setId(newId);
-		// set text of new one after all initialization is done
-		String contents = oldModel.getStructuredDocument().getText();
-		newModel.getStructuredDocument().setText(this, contents);
-		return newModel;
-	}
-
-	/**
-	 */
-	public synchronized IStructuredModel copyModelForEdit(String oldId, String newId) throws ResourceInUse {
-		IStructuredModel newModel = null;
-		// get the existing model associated with this id
-		IStructuredModel model = getExistingModel(oldId);
-		// if it doesn't exist, ignore request (though this would normally
-		// be a programming error.
-		if (model == null)
-			return null;
-		// now be sure newModel does not exist
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(newId);
-		if (sharedObject != null) {
-			throw new ResourceInUse();
-		}
-		// get loader based on existing type (note the type assumption)
-		// Object type = ((IStructuredModel) model).getType();
-		// IModelHandler type = model.getModelHandler();
-		// IModelLoader loader = (IModelLoader) getModelLoaders().get(type);
-		// IModelLoader loader = (IModelLoader) getModelLoaders().get(type);
-		// ask the loader to copy
-		newModel = copy(model, newId);
-		if (newModel != null) {
-			// add to our cache
-			sharedObject = new SharedObject(newModel);
-			sharedObject.referenceCountForEdit = 1;
-			fManagedObjects.put(newId, sharedObject);
-			trace("copied model", newId, sharedObject.referenceCountForEdit); //$NON-NLS-1$
-		}
-		return newModel;
-	}
-
-	/**
-	 * 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".
-	 */
-	public synchronized IStructuredModel createNewInstance(IStructuredModel oldModel) throws IOException {
-		IModelHandler handler = oldModel.getModelHandler();
-		IModelLoader loader = handler.getModelLoader();
-		IStructuredModel newModel = loader.createModel(oldModel);
-		newModel.setModelHandler(handler);
-		if (newModel instanceof AbstractStructuredModel) {
-			((AbstractStructuredModel) newModel).setContentTypeIdentifier(oldModel.getContentTypeIdentifier());
-		}
-		URIResolver oldResolver = oldModel.getResolver();
-		newModel.setResolver(oldResolver);
-		try {
-			newModel.setId(DUPLICATED_MODEL);
-		}
-		catch (ResourceInUse e) {
-			// impossible, since this is an unmanaged model
-		}
-		// base location should be null, but we'll set to
-		// null to be sure.
-		newModel.setBaseLocation(null);
-		return newModel;
-	}
-
-	/**
-	 * 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.
-	 * 
-	 * @throws ResourceInUse
-	 * 
-	 */
-	public synchronized IStructuredDocument createNewStructuredDocumentFor(IFile iFile) throws ResourceAlreadyExists, IOException, CoreException {
-		if (iFile.exists()) {
-			throw new ResourceAlreadyExists(iFile.getFullPath().toOSString());
-		}
-		// Will reconsider in future version
-		// String id = calculateId(iFile);
-		// if (isResourceInUse(id)) {
-		// throw new ResourceInUse(iFile.getFullPath().toOSString());
-		// }
-		IDocumentLoader loader = null;
-		IModelHandler handler = calculateType(iFile);
-		loader = handler.getDocumentLoader();
-		// for this API, "createNew" we assume the IFile does not exist yet
-		// as checked above, so just create empty document.
-		IStructuredDocument result = (IStructuredDocument) loader.createNewStructuredDocument();
-		return result;
-	}
-
-	/**
-	 * 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.
-	 * 
-	 * @throws ResourceInUse
-	 */
-	public synchronized IStructuredDocument createStructuredDocumentFor(IFile iFile) throws IOException, CoreException {
-		if (!iFile.exists()) {
-			throw new FileNotFoundException(iFile.getFullPath().toOSString());
-		}
-		// Will reconsider in future version
-		// String id = calculateId(iFile);
-		// if (isResourceInUse(id)) {
-		// throw new ResourceInUse(iFile.getFullPath().toOSString());
-		// }
-		IDocumentLoader loader = null;
-		IModelHandler handler = calculateType(iFile);
-		loader = handler.getDocumentLoader();
-		IStructuredDocument result = (IStructuredDocument) loader.createNewStructuredDocument(iFile);
-		return result;
-	}
-
-	/**
-	 * Conveience 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.
-	 * 
-	 * @deprecated - TODO: to be removed by C4 do we really need this? I
-	 *             recommend to - use createStructuredDocumentFor(filename,
-	 *             null, null) - the filename does not need to represent a
-	 *             real - file, but can take for form of dummy.jsp, test.xml,
-	 *             etc. - That way we don't hard code the handler, but specify
-	 *             we - want the handler that "goes with" a certain type of -
-	 *             file.
-	 */
-	public synchronized IStructuredDocument createStructuredDocumentFor(String contentTypeId) {
-		IDocumentLoader loader = null;
-		ModelHandlerRegistry cr = getModelHandlerRegistry();
-		IModelHandler handler = cr.getHandlerForContentTypeId(contentTypeId);
-		if (handler == null)
-			Logger.log(Logger.ERROR, "Program error: no model handler found for " + contentTypeId); //$NON-NLS-1$
-		loader = handler.getDocumentLoader();
-		IStructuredDocument result = (IStructuredDocument) loader.createNewStructuredDocument();
-		return result;
-	}
-
-	/**
-	 * Conveience method, since a proper IStructuredDocument must have a
-	 * proper parser assigned.
-	 * 
-	 * @deprecated -- - TODO: to be removed by C4 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.
-	 */
-	public IStructuredDocument createStructuredDocumentFor(String filename, InputStream inputStream, URIResolver resolver) throws IOException {
-		IDocumentLoader loader = null;
-		InputStream istream = Utilities.getMarkSupportedStream(inputStream);
-		if (istream != null) {
-			istream.reset();
-		}
-		IModelHandler handler = calculateType(filename, istream);
-		loader = handler.getDocumentLoader();
-		IStructuredDocument result = null;
-		if (inputStream == null) {
-			result = (IStructuredDocument) loader.createNewStructuredDocument();
-		}
-		else {
-			result = (IStructuredDocument) loader.createNewStructuredDocument(filename, istream);
-		}
-		return result;
-	}
-
-	/**
-	 * Special case method. This method was created for the special case where
-	 * there is an encoding for input stream that should override all the
-	 * normal rules for encoding. For example, if there is an encoding
-	 * (charset) specified in HTTP response header, then that encoding is used
-	 * to translate the input stream to a string, but then the normal encoding
-	 * rules are ignored, so that the string is not translated twice (for
-	 * example, if its an HTML "file", then even if it contains a charset in
-	 * meta tag, its ignored since its assumed its all correctly decoded by
-	 * the HTTP charset.
-	 */
-	public synchronized IStructuredDocument createStructuredDocumentFor(String filename, InputStream inputStream, URIResolver resolver, String encoding) throws IOException {
-		String content = readInputStream(inputStream, encoding);
-		IStructuredDocument result = createStructuredDocumentFor(filename, content, resolver);
-		return result;
-	}
-
-	/**
-	 * Convenience method. This method can be used when the resource does not
-	 * really exist (e.g. when content is being created, but hasn't been
-	 * written to disk yet). Note that since the content is being provided as
-	 * a String, it is assumed to already be decoded correctly so no
-	 * transformation is done.
-	 */
-	public synchronized IStructuredDocument createStructuredDocumentFor(String filename, String content, URIResolver resolver) throws IOException {
-		// TODO: avoid all these String instances
-		StringBuffer contentBuffer = new StringBuffer(content);
-		IDocumentLoader loader = null;
-		IModelHandler handler = calculateType(filename, null);
-		loader = handler.getDocumentLoader();
-		IStructuredDocument result = (IStructuredDocument) loader.createNewStructuredDocument();
-		StringBuffer convertedContent = loader.handleLineDelimiter(contentBuffer, result);
-		result.setEncodingMemento(new NullMemento());
-		result.setText(this, convertedContent.toString());
-		return result;
-	}
-
-	/**
-	 * @param iFile
-	 * @param result
-	 * @return
-	 * @throws CoreException
-	 */
-	private IStructuredModel createUnManagedEmptyModelFor(IFile iFile) throws CoreException {
-		IStructuredModel result = null;
-		IModelHandler handler = calculateType(iFile);
-		String id = calculateId(iFile);
-		URIResolver resolver = calculateURIResolver(iFile);
-
-		try {
-			result = _commonCreateModel(id, handler, resolver);
-		}
-		catch (ResourceInUse e) {
-			// impossible, since we're not sharing
-			// (even if it really is in use ... we don't care)
-			// this may need to be re-examined.
-			if (Logger.DEBUG_MODELMANAGER)
-				Logger.log(Logger.INFO, "ModelMangerImpl::createUnManagedStructuredModelFor. Model unexpectedly in use."); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		return result;
-	}
-
-	/**
-	 * Conveience method. It depends on the loaders newModel method to return
-	 * an appropriate StrucuturedModel appropriately initialized.
-	 */
-	public synchronized IStructuredModel createUnManagedStructuredModelFor(IFile iFile) throws IOException, CoreException {
-		IStructuredModel result = null;
-		result = createUnManagedEmptyModelFor(iFile);
-
-		IDocumentLoader loader = result.getModelHandler().getDocumentLoader();
-		IEncodedDocument document = loader.createNewStructuredDocument(iFile);
-
-		result.getStructuredDocument().setText(this, document.get());
-
-		return result;
-	}
-
-	/**
-	 * Conveience method. It depends on the loaders newModel method to return
-	 * an appropriate StrucuturedModel appropriately initialized.
-	 */
-	public synchronized IStructuredModel createUnManagedStructuredModelFor(String contentTypeId) {
-		return createUnManagedStructuredModelFor(contentTypeId, null);
-	}
-
-	/**
-	 * Conveience method. It depends on the loaders newModel method to return
-	 * an appropriate StrucuturedModel appropriately initialized.
-	 */
-	public synchronized IStructuredModel createUnManagedStructuredModelFor(String contentTypeId, URIResolver resolver) {
-		IStructuredModel result = null;
-		ModelHandlerRegistry cr = getModelHandlerRegistry();
-		IModelHandler handler = cr.getHandlerForContentTypeId(contentTypeId);
-		try {
-			result = _commonCreateModel(UNMANAGED_MODEL, handler, resolver); //$NON-NLS-1$
-		}
-		catch (ResourceInUse e) {
-			// impossible, since we're not sharing
-			// (even if it really is in use ... we don't care)
-			// this may need to be re-examined.
-			if (Logger.DEBUG_MODELMANAGER)
-				Logger.log(Logger.INFO, "ModelMangerImpl::createUnManagedStructuredModelFor. Model unexpectedly in use."); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		return result;
-	}
-
-	private EnumeratedModelIds getEnumeratedModelIds() {
-		// return new instance each time so will "act like" proper enumeration
-		// to client
-		// (if we cached, may not be at beginning).
-		return new EnumeratedModelIds(fManagedObjects);
-	}
-
-	private IStructuredModel getExistingModel(Object id) {
-
-		IStructuredModel result = null;
-		// let's see if we already have it in our cache
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		// if not, then we'll simply return null
-		if (sharedObject != null) {
-			result = sharedObject.theSharedModel;
-		}
-		return result;
-	}
-
-	/**
-	 * Note: users of this 'model' must still release it when finished.
-	 * Returns null if there's not a model corresponding to document.
-	 */
-	public synchronized IStructuredModel getExistingModelForEdit(IDocument document) {
-		IStructuredModel result = null;
-		Enumeration ids = getEnumeratedModelIds();
-		while (ids.hasMoreElements()) {
-			Object potentialId = ids.nextElement();
-			IStructuredModel tempResult = getExistingModel(potentialId);
-			if (document == tempResult.getStructuredDocument()) {
-				result = getExistingModelForEdit(potentialId);
-				break;
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * 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.
-	 */
-	public synchronized IStructuredModel getExistingModelForEdit(IFile iFile) {
-
-		Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
-		Object id = calculateId(iFile);
-		IStructuredModel result = getExistingModelForEdit(id);
-		return result;
-	}
-
-	/**
-	 * 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.
-	 * 
-	 * @deprecated use IFile form - this one will become protected or private
-	 */
-	public synchronized IStructuredModel getExistingModelForEdit(Object id) {
-
-		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-		IStructuredModel result = null;
-		// let's see if we already have it in our cache
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		// if not, then we'll simply return null
-		if (sharedObject != null) {
-			// if shared object is in our cache, then simply increment its ref
-			// count,
-			// and return the object.
-			sharedObject.referenceCountForEdit++;
-			result = sharedObject.theSharedModel;
-			trace("got existing model for Edit: ", id); //$NON-NLS-1$
-			trace("   incremented referenceCountForEdit ", id, sharedObject.referenceCountForEdit); //$NON-NLS-1$
-		}
-		return result;
-	}
-
-	/**
-	 * Note: users of this 'model' must still release it when finished.
-	 * Returns null if there's not a model corresponding to document.
-	 */
-	public synchronized IStructuredModel getExistingModelForRead(IDocument document) {
-		IStructuredModel result = null;
-		Enumeration ids = getEnumeratedModelIds();
-		while (ids.hasMoreElements()) {
-			Object potentialId = ids.nextElement();
-			IStructuredModel tempResult = getExistingModel(potentialId);
-			if (document == tempResult.getStructuredDocument()) {
-				result = getExistingModelForRead(potentialId);
-				break;
-			}
-		}
-		return result;
-	}
-
-	public synchronized IStructuredModel getExistingModelForRead(IFile iFile) {
-
-		Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
-		Object id = calculateId(iFile);
-		IStructuredModel result = getExistingModelForRead(id);
-		return result;
-	}
-
-	/**
-	 * 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.
-	 * 
-	 * @deprecated use IFile form - this one will become protected or private
-	 */
-	public synchronized IStructuredModel getExistingModelForRead(Object id) {
-
-		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-		IStructuredModel result = null;
-		// let's see if we already have it in our cache
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		// if not, then we'll simply return null
-		if (sharedObject != null) {
-			// if shared object is in our cache, then simply increment its ref
-			// count,
-			// and return the object.
-			sharedObject.referenceCountForRead++;
-			result = sharedObject.theSharedModel;
-		}
-		return result;
-	}
-
-	/**
-	 * @deprecated DMW: Tom, this is "special" for links builder Assuming its
-	 *             still needed, wouldn't it be better to change to
-	 *             getExistingModels()? -- will be removed. Its not thread
-	 *             safe for one thread to get the Enumeration, when underlying
-	 *             data could be changed in another thread.
-	 */
-	public synchronized Enumeration getExistingModelIds() {
-
-		Enumeration result = getEnumeratedModelIds();
-		return result;
-	}
-
-	// TODO: replace (or supplement) this is a "model info" association to the
-	// IFile that created the model
-	private IFile getFileFor(IStructuredModel model) {
-		if (model == null)
-			return null;
-		String path = model.getBaseLocation();
-		if (path == null || path.length() == 0) {
-			Object id = model.getId();
-			if (id == null)
-				return null;
-			path = id.toString();
-		}
-		// TOODO needs rework for linked resources
-		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-		IFile file = root.getFileForLocation(new Path(path));
-		return file;
-	}
-
-	/**
-	 * One of the primary forms to get a managed model
-	 */
-	public synchronized IStructuredModel getModelForEdit(IFile iFile) throws IOException, CoreException {
-		Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
-		return _commonGetModel(iFile, EDIT, null, null);
-	}
-
-	public synchronized IStructuredModel getModelForEdit(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
-
-		Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
-		return _commonGetModel(iFile, EDIT, encodingRule);
-	}
-
-	public synchronized IStructuredModel getModelForEdit(IFile iFile, String encoding, String lineDelimiter) throws java.io.UnsupportedEncodingException, IOException, CoreException {
-
-		Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
-		return _commonGetModel(iFile, EDIT, encoding, lineDelimiter);
-	}
-
-	public synchronized IStructuredModel getModelForEdit(IStructuredDocument document) {
-		return _getModelFor(document, EDIT);
-	}
-
-	/**
-	 * @see IModelManager
-	 * @deprecated use IFile or String form
-	 */
-	public synchronized 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$
-		String stringId = id.toString();
-		return getModelForEdit(stringId, Utilities.getMarkSupportedStream(inputStream), resolver);
-	}
-
-	/**
-	 * @see IModelManager
-	 * @deprecated - use IFile or String form
-	 */
-	public synchronized IStructuredModel getModelForEdit(Object id, Object modelType, String encodingName, String lineDelimiter, InputStream inputStream, URIResolver resolver) throws java.io.UnsupportedEncodingException, IOException {
-
-		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-		String stringId = id.toString();
-		return getModelForEdit(stringId, Utilities.getMarkSupportedStream(inputStream), resolver);
-	}
-
-	public synchronized IStructuredModel getModelForEdit(String id, InputStream inputStream, URIResolver resolver) throws IOException {
-		if (id == null) {
-			throw new IllegalArgumentException("Program Error: id may not be null"); //$NON-NLS-1$
-		}
-		IStructuredModel result = null;
-
-		InputStream istream = Utilities.getMarkSupportedStream(inputStream);
-		IModelHandler handler = calculateType(id, istream);
-		if (handler != null) {
-			result = _commonCreateModel(istream, id, handler, resolver, EDIT, null, null);
-		}
-		else {
-			Logger.log(Logger.INFO, "no model handler found for id"); //$NON-NLS-1$
-		}
-		return result;
-	}
-
-	/**
-	 * One of the primary forms to get a managed model
-	 */
-	public synchronized IStructuredModel getModelForRead(IFile iFile) throws IOException, CoreException {
-
-		Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
-		return _commonGetModel(iFile, READ, null, null);
-	}
-
-	public synchronized IStructuredModel getModelForRead(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
-		Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
-		return _commonGetModel(iFile, READ, encodingRule);
-	}
-
-	public synchronized IStructuredModel getModelForRead(IFile iFile, String encodingName, String lineDelimiter) throws java.io.UnsupportedEncodingException, IOException, CoreException {
-		Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
-		return _commonGetModel(iFile, READ, encodingName, lineDelimiter);
-	}
-
-	public synchronized IStructuredModel getModelForRead(IStructuredDocument document) {
-		return _getModelFor(document, READ);
-	}
-
-	/**
-	 * @see IModelManager
-	 * @deprecated use IFile or String form
-	 */
-	public synchronized IStructuredModel getModelForRead(Object id, InputStream inputStream, URIResolver resolver) throws java.io.UnsupportedEncodingException, IOException {
-		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-		String stringId = id.toString();
-		return getModelForRead(stringId, Utilities.getMarkSupportedStream(inputStream), resolver);
-	}
-
-	/**
-	 * @see IModelManager
-	 * @deprecated use IFile form
-	 */
-	public synchronized IStructuredModel getModelForRead(Object id, Object modelType, String encodingName, String lineDelimiter, InputStream inputStream, URIResolver resolver) throws java.io.UnsupportedEncodingException, IOException {
-		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-		String stringId = id.toString();
-		return getModelForRead(stringId, Utilities.getMarkSupportedStream(inputStream), resolver);
-	}
-
-	public synchronized IStructuredModel getModelForRead(String id, InputStream inputStream, URIResolver resolver) throws IOException {
-		InputStream istream = Utilities.getMarkSupportedStream(inputStream);
-		IModelHandler handler = calculateType(id, istream);
-		IStructuredModel result = null;
-		result = _commonCreateModel(istream, id, handler, resolver, READ, null, null);
-		return result;
-	}
-
-	/**
-	 * @deprecated - only temporarily visible
-	 */
-	public ModelHandlerRegistry getModelHandlerRegistry() {
-		if (fModelHandlerRegistry == null) {
-			fModelHandlerRegistry = ModelHandlerRegistry.getInstance();
-		}
-		return fModelHandlerRegistry;
-	}
-
-	/**
-	 * @see IModelManager#getNewModelForEdit(IFile, boolean)
-	 */
-	public synchronized IStructuredModel getNewModelForEdit(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException {
-		Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
-		SharedObject sharedObject = _commonNewModel(iFile, force);
-		sharedObject.referenceCountForEdit = 1;
-		return sharedObject.theSharedModel;
-	}
-
-	/**
-	 * @see IModelManager#getNewModelForRead(IFile, boolean)
-	 */
-	public synchronized IStructuredModel getNewModelForRead(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException {
-
-		Assert.isNotNull(iFile, "IFile parameter can not be null"); //$NON-NLS-1$
-		SharedObject sharedObject = _commonNewModel(iFile, force);
-		sharedObject.referenceCountForRead = 1;
-		return sharedObject.theSharedModel;
-	}
-
-	/**
-	 * This function returns the reference count of underlying model.
-	 * 
-	 * @param id
-	 *            Object The id of the model TODO: try to refine the design
-	 *            not to use this function
-	 */
-	public synchronized int getReferenceCount(Object id) {
-		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-		int count = 0;
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		if (sharedObject != null)
-			count = sharedObject.referenceCountForRead + sharedObject.referenceCountForEdit;
-		return count;
-	}
-
-	/**
-	 * This function returns the reference count of underlying model.
-	 * 
-	 * @param id
-	 *            Object The id of the model TODO: try to refine the design
-	 *            not to use this function
-	 */
-	public synchronized int getReferenceCountForEdit(Object id) {
-		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-		int count = 0;
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		if (sharedObject != null)
-			count = sharedObject.referenceCountForEdit;
-		return count;
-	}
-
-	/**
-	 * This function returns the reference count of underlying model.
-	 * 
-	 * @param id
-	 *            Object The id of the model TODO: try to refine the design
-	 *            not to use this function
-	 */
-	public synchronized int getReferenceCountForRead(Object id) {
-		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-		int count = 0;
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		if (sharedObject != null)
-			count = sharedObject.referenceCountForRead;
-		return count;
-	}
-
-	private void handleConvertLineDelimiters(IStructuredDocument structuredDocument, IFile iFile, EncodingRule encodingRule, EncodingMemento encodingMemento) throws CoreException, MalformedOutputExceptionWithDetail, UnsupportedEncodingException {
-		if (structuredDocument.getNumberOfLines() > 1) {
-			convertLineDelimiters(structuredDocument, iFile);
-		}
-	}
-
-	private void handleProgramError(Throwable t) {
-
-		Logger.logException("Impossible Program Error", t); //$NON-NLS-1$
-	}
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model.
-	 */
-	public synchronized boolean isShared(Object id) {
-		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-		int count = 0;
-		boolean result = false;
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		if (sharedObject != null)
-			count = sharedObject.referenceCountForRead + sharedObject.referenceCountForEdit;
-		result = count > 1;
-		return result;
-	}
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model.
-	 * 
-	 * @param id
-	 *            Object The id of the model
-	 */
-	public synchronized boolean isSharedForEdit(Object id) {
-		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-		int count = 0;
-		boolean result = false;
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		if (sharedObject != null)
-			count = sharedObject.referenceCountForEdit;
-		result = count > 1;
-		return result;
-	}
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model.
-	 * 
-	 * @param id
-	 *            Object The id of the model
-	 */
-	public synchronized boolean isSharedForRead(Object id) {
-		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-		int count = 0;
-		boolean result = false;
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		if (sharedObject != null)
-			count = sharedObject.referenceCountForRead;
-		result = count > 1;
-		return result;
-	}
-
-	/**
-	 * This method can be called to determine if the model manager is within a
-	 * "aboutToChange" and "changed" sequence.
-	 */
-	public synchronized boolean isStateChanging() {
-
-		return modelManagerStateChanging > 0;
-	}
-
-	/**
-	 * This method changes the id of the model. TODO: try to refine the design
-	 * not to use this function
-	 */
-	public synchronized 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$
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(oldId);
-		// if not found in cache, ignore request.
-		// this would normally be a program error
-		if (sharedObject != null) {
-			fManagedObjects.remove(oldId);
-			fManagedObjects.put(newId, sharedObject);
-		}
-	}
-
-	private String readInputStream(InputStream inputStream, String ianaEncodingName) throws UnsupportedEncodingException, IOException {
-
-		String allText = null;
-		if ((ianaEncodingName != null) && (ianaEncodingName.length() != 0)) {
-			String enc = CodedIO.getAppropriateJavaCharset(ianaEncodingName);
-			if (enc == null) {
-				// if no conversion was possible, let's assume that
-				// the encoding is already a java encoding name, so we'll
-				// proceed with that assumption. This is the case, for
-				// example,
-				// for the reload() procedure.
-				// If in fact it is not a valid java encoding, then
-				// the "allText=" line will cause an
-				// UnsupportedEncodingException
-				enc = ianaEncodingName;
-			}
-			allText = readInputStream(new InputStreamReader(inputStream, enc));
-		}
-		else {
-			// we normally assume encoding is provided for this method, but if
-			// not,
-			// we'll use platform default
-			allText = readInputStream(new InputStreamReader(inputStream));
-		}
-		return allText;
-	}
-
-	private String readInputStream(InputStreamReader inputStream) throws IOException {
-
-		int numRead = 0;
-		StringBuffer buffer = new StringBuffer();
-		char tBuff[] = new char[READ_BUFFER_SIZE];
-		while ((numRead = inputStream.read(tBuff, 0, tBuff.length)) != -1) {
-			buffer.append(tBuff, 0, numRead);
-		}
-		// remember -- we didn't open stream ... so we don't close it
-		return buffer.toString();
-	}
-
-	/*
-	 * @see IModelManager#reinitialize(IStructuredModel)
-	 */
-	public synchronized IStructuredModel reinitialize(IStructuredModel model) {
-
-		// getHandler (assume its the "new one")
-		IModelHandler handler = model.getModelHandler();
-		// getLoader for that new one
-		IModelLoader loader = handler.getModelLoader();
-		// ask it to reinitialize
-		model = loader.reinitialize(model);
-		// the loader should check to see if the one it received
-		// is the same type it would normally create.
-		// if not, it must "start from scratch" and create a whole
-		// new one.
-		// if it is of the same type, it should just 'replace text'
-		// replacing all the existing text with the new text.
-		// the important one is the JSP loader ... it should go through
-		// its embedded content checking and initialization
-		return model;
-	}
-
-	/**
-	 * default for use in same package, not subclasses
-	 * 
-	 */
-	synchronized void releaseFromEdit(Object id) {
-		// ISSUE: many of these asserts should be changed to "logs"
-		// and continue to limp along?
-
-		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-		SharedObject sharedObject = null;
-
-		// ISSUE: here we need better "spec" what to do with
-		// unmanaged or duplicated models. Release still needs
-		// to be called on them, for now, but the model manager
-		// doesn't need to do anything.
-		if (id.equals(UNMANAGED_MODEL) || id.equals(DUPLICATED_MODEL)) {
-			// do nothing related to model managment.
-		}
-		else {
-			sharedObject = (SharedObject) fManagedObjects.get(id);
-			Assert.isNotNull(sharedObject, "release was requested on a model that was not being managed"); //$NON-NLS-1$
-
-
-			if (sharedObject != null) {
-				sharedObject.referenceCountForEdit--;
-				if ((sharedObject.referenceCountForRead == 0) && (sharedObject.referenceCountForEdit == 0)) {
-					discardModel(id, sharedObject);
-				}
-				// if edit goes to zero, but still open for read,
-				// then we should reload here, so we are in synch with
-				// contents on disk.
-				// ISSUE: should we check isDirty here? 
-				// ANSWER: here, for now now. model still has its own dirty flag for some reason. 
-				// we need to address * that * too. 
-				if ((sharedObject.referenceCountForRead > 0) && (sharedObject.referenceCountForEdit == 0) && sharedObject.theSharedModel.isDirty()) {
-					signalPreLifeCycleListenerRevert(sharedObject.theSharedModel);
-					revertModel(id, sharedObject);
-					sharedObject.theSharedModel.setDirtyState(false);
-					signalPostLifeCycleListenerRevert(sharedObject.theSharedModel);
-				}
-			}
-		}
-	}
-	
-	// private for now, though public forms have been requested, in past.
-	private void revertModel(Object id, SharedObject sharedObject) {
-		IStructuredDocument structuredDocument = sharedObject.theSharedModel.getStructuredDocument();
-		FileBufferModelManager.getInstance().revert(structuredDocument);
-	}
-	private void signalPreLifeCycleListenerRevert(IStructuredModel structuredModel) {
-		int type = ModelLifecycleEvent.MODEL_REVERT | ModelLifecycleEvent.PRE_EVENT;
-		// what's wrong with this design that a cast is needed here!?
-		ModelLifecycleEvent event = new ModelLifecycleEvent(structuredModel, type);
-		((AbstractStructuredModel) structuredModel).signalLifecycleEvent(event);
-	}
-	private void signalPostLifeCycleListenerRevert(IStructuredModel structuredModel) {
-		int type = ModelLifecycleEvent.MODEL_REVERT | ModelLifecycleEvent.POST_EVENT;
-		// what's wrong with this design that a cast is needed here!?
-		ModelLifecycleEvent event = new ModelLifecycleEvent(structuredModel, type);
-		((AbstractStructuredModel) structuredModel).signalLifecycleEvent(event);
-	}
-
-	private void discardModel(Object id, SharedObject sharedObject) {
-		fManagedObjects.remove(id);
-		IStructuredDocument structuredDocument = sharedObject.theSharedModel.getStructuredDocument();
-		FileBufferModelManager.getInstance().releaseModel(structuredDocument);
-		// setting the document to null is required since some subclasses
-		// of model might have "cleanup" of listners, etc., to remove,
-		// which were initialized during the intial setStructuredDocument
-		sharedObject.theSharedModel.setStructuredDocument(null);
-	}
-
-	/**
-	 * default for use in same package, not subclasses
-	 * 
-	 */
-	synchronized void releaseFromRead(Object id) {
-		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
-		SharedObject sharedObject = null;
-
-		if (id.equals(UNMANAGED_MODEL) || id.equals(DUPLICATED_MODEL)) {
-			// do nothing related to model managment.
-		}
-		else {
-
-			sharedObject = (SharedObject) fManagedObjects.get(id);
-			Assert.isNotNull(sharedObject, "release was requested on a model that was not being managed"); //$NON-NLS-1$
-		}
-
-		if (sharedObject != null) {
-			sharedObject.referenceCountForRead--;
-			if ((sharedObject.referenceCountForRead == 0) && (sharedObject.referenceCountForEdit == 0)) {
-				discardModel(id, sharedObject);
-			}
-			// ISSUE: if edit goes to zero, but still open for read,
-			// then we should reload here, so we are in synch with
-			// contents on disk.
-		}
-	}
-
-	/**
-	 * This is similar to the getModel method, except this method does not use
-	 * the cached version, but forces the cached version to be replaced with a
-	 * fresh, unchanged version. Note: this method does not change any
-	 * reference counts. Also, if there is not already a cached version of the
-	 * model, then this call is essentially ignored (that is, it does not put
-	 * a model in the cache) and returns null.
-	 * 
-	 * @deprecated - will become protected, use reload directly on model
-	 */
-	public synchronized IStructuredModel reloadModel(Object id, java.io.InputStream inputStream) throws java.io.UnsupportedEncodingException {
-
-		// get the existing model associated with this id
-		IStructuredModel structuredModel = getExistingModel(id);
-		// for the model to be null is probably an error (that is,
-		// reload should not have been called, but we'll guard against
-		// a null pointer example and return null if we are no longer managing
-		// that model.
-		if (structuredModel != null) {
-			// get loader based on existing type
-			// dmwTODO evaluate when reload should occur
-			// with potentially new type (e.g. html 'save as' jsp).
-			IModelHandler handler = structuredModel.getModelHandler();
-			IModelLoader loader = handler.getModelLoader();
-			// ask the loader to re-load
-			loader.reload(Utilities.getMarkSupportedStream(inputStream), structuredModel);
-			trace("re-loading model", id); //$NON-NLS-1$
-		}
-		return structuredModel;
-	}
-
-	public void saveModel(IFile iFile, String id, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
-		// let's see if we already have it in our cache
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		if (sharedObject == null || sharedObject.theSharedModel == null) {
-			throw new IllegalStateException(SSECoreMessages.Program_Error__ModelManage_EXC_); //$NON-NLS-1$ = "Program Error: ModelManagerImpl::saveModel. Model should be in the cache"
-		}
-		else {
-			boolean saved = false;
-			// if this model was based on a File Buffer and we're writing back
-			// to the same location, use the buffer to do the writing
-			if (FileBufferModelManager.getInstance().isExistingBuffer(sharedObject.theSharedModel.getStructuredDocument())) {
-				ITextFileBuffer buffer = FileBufferModelManager.getInstance().getBuffer(sharedObject.theSharedModel.getStructuredDocument());
-				IPath fileLocation = FileBuffers.normalizeLocation(iFile.getFullPath());
-				if (fileLocation.equals(buffer.getLocation())) {
-					buffer.commit(new NullProgressMonitor(), true);
-					saved = true;
-				}
-			}
-			if (!saved) {
-				IStructuredModel model = sharedObject.theSharedModel;
-				IStructuredDocument document = model.getStructuredDocument();
-				saveStructuredDocument(document, iFile, encodingRule);
-				trace("saving model", id); //$NON-NLS-1$
-			}
-			sharedObject.theSharedModel.setDirtyState(false);
-			sharedObject.theSharedModel.setNewState(false);
-		}
-	}
-
-	/**
-	 * Saving the model really just means to save it's structured document.
-	 * 
-	 * @param id
-	 * @param outputStream
-	 * @param encodingRule
-	 * @throws UnsupportedEncodingException
-	 * @throws IOException
-	 * @throws CoreException
-	 */
-	public void saveModel(String id, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
-		// let's see if we already have it in our cache
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		if (sharedObject == null) {
-			throw new IllegalStateException(SSECoreMessages.Program_Error__ModelManage_EXC_); //$NON-NLS-1$ = "Program Error: ModelManagerImpl::saveModel. Model should be in the cache"
-		}
-		else {
-			// if this model was based on a File Buffer and we're writing back
-			// to the same location, use the buffer to do the writing
-			if (FileBufferModelManager.getInstance().isExistingBuffer(sharedObject.theSharedModel.getStructuredDocument())) {
-				ITextFileBuffer buffer = FileBufferModelManager.getInstance().getBuffer(sharedObject.theSharedModel.getStructuredDocument());
-				buffer.commit(new NullProgressMonitor(), true);
-			}
-			else {
-				IFile iFile = getFileFor(sharedObject.theSharedModel);
-				IStructuredModel model = sharedObject.theSharedModel;
-				IStructuredDocument document = model.getStructuredDocument();
-				saveStructuredDocument(document, iFile);
-				trace("saving model", id); //$NON-NLS-1$
-			}
-		}
-		sharedObject.theSharedModel.setDirtyState(false);
-		sharedObject.theSharedModel.setNewState(false);
-	}
-
-	/**
-	 * @deprecated - this method is less efficient than IFile form, since it
-	 *             requires an extra "copy" of byte array, and should be avoid
-	 *             in favor of the IFile form.
-	 */
-	public void saveModel(String id, OutputStream outputStream, EncodingRule encodingRule) throws UnsupportedEncodingException, CoreException, IOException {
-
-		// let's see if we already have it in our cache
-		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
-		if (sharedObject == null) {
-			throw new IllegalStateException(SSECoreMessages.Program_Error__ModelManage_EXC_); //$NON-NLS-1$ = "Program Error: ModelManagerImpl::saveModel. Model should be in the cache"
-		}
-		else {
-			CodedStreamCreator codedStreamCreator = new CodedStreamCreator();
-			codedStreamCreator.set(sharedObject.theSharedModel.getId(), new DocumentReader(sharedObject.theSharedModel.getStructuredDocument()));
-			codedStreamCreator.setPreviousEncodingMemento(sharedObject.theSharedModel.getStructuredDocument().getEncodingMemento());
-			ByteArrayOutputStream byteArrayOutputStream = codedStreamCreator.getCodedByteArrayOutputStream(encodingRule);
-			byte[] outputBytes = byteArrayOutputStream.toByteArray();
-			outputStream.write(outputBytes);
-			trace("saving model", id); //$NON-NLS-1$
-		}
-		sharedObject.theSharedModel.setDirtyState(false);
-		sharedObject.theSharedModel.setNewState(false);
-	}
-
-	public void saveStructuredDocument(IStructuredDocument structuredDocument, IFile iFile) throws UnsupportedEncodingException, CoreException, IOException {
-		saveStructuredDocument(structuredDocument, iFile, EncodingRule.CONTENT_BASED);
-	}
-
-	public void saveStructuredDocument(IStructuredDocument structuredDocument, IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, CoreException, IOException {
-		if (FileBufferModelManager.getInstance().isExistingBuffer(structuredDocument)) {
-			ITextFileBuffer buffer = FileBufferModelManager.getInstance().getBuffer(structuredDocument);
-			if (iFile.getLocation().equals(buffer.getLocation())) {
-				buffer.commit(new NullProgressMonitor(), true);
-			}
-		}
-		else {
-			// IModelHandler handler = calculateType(iFile);
-			// IDocumentDumper dumper = handler.getDocumentDumper();
-			CodedStreamCreator codedStreamCreator = new CodedStreamCreator();
-			Reader reader = new DocumentReader(structuredDocument);
-			codedStreamCreator.set(iFile, reader);
-			codedStreamCreator.setPreviousEncodingMemento(structuredDocument.getEncodingMemento());
-			EncodingMemento encodingMemento = codedStreamCreator.getCurrentEncodingMemento();
-
-			// be sure document's is updated, in case exception is thrown in
-			// getCodedByteArrayOutputStream
-			structuredDocument.setEncodingMemento(encodingMemento);
-
-			// Convert line delimiters after encoding memento is figured out,
-			// but
-			// before writing to output stream.
-			handleConvertLineDelimiters(structuredDocument, iFile, encodingRule, encodingMemento);
-
-			ByteArrayOutputStream codedByteStream = codedStreamCreator.getCodedByteArrayOutputStream(encodingRule);
-			InputStream codedStream = new ByteArrayInputStream(codedByteStream.toByteArray());
-			if (iFile.exists())
-				iFile.setContents(codedStream, true, true, null);
-			else
-				iFile.create(codedStream, false, null);
-			codedByteStream.close();
-			codedStream.close();
-		}
-	}
-
-	/**
-	 * Common trace method
-	 */
-	private void trace(String msg, Object id) {
-		if (Logger.DEBUG_MODELMANAGER) {
-			Logger.log(Logger.INFO, msg + " " + Utilities.makeShortId(id)); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-
-	/**
-	 * Common trace method
-	 */
-	private void trace(String msg, Object id, int value) {
-		if (Logger.DEBUG_MODELMANAGER) {
-			Logger.log(Logger.INFO, msg + Utilities.makeShortId(id) + " (" + value + ")"); //$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/modelhandler/EmbeddedTypeRegistry.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistry.java
deleted file mode 100644
index 36d7563..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistry.java
+++ /dev/null
@@ -1,35 +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.sse.core.internal.modelhandler;
-
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-
-/**
- * The entries in this registry are, conceptually, singleton's Since only one
- * instance is created in the registry, and then that instance returned when
- * required.
- * 
- * Note that there is intentionally no 'remove' method, Since the registry
- * itself is read it when once, from the platform's plugin registry, and is
- * not intended to be modified after that. A change in an extenstion in a
- * plugin.xml will only take effect when the workbench is re-started.
- *  
- */
-public interface EmbeddedTypeRegistry {
-
-	/**
-	 * Method to return the specific type for the specific mimetype.
-	 */
-	public EmbeddedTypeHandler getTypeFor(String mimeType);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryImpl.java
deleted file mode 100644
index cfa88ae..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryImpl.java
+++ /dev/null
@@ -1,132 +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.sse.core.internal.modelhandler;
-
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-
-
-/**
- *  
- */
-public class EmbeddedTypeRegistryImpl implements EmbeddedTypeRegistry {
-
-	private static EmbeddedTypeRegistry instance = null;
-
-	public synchronized static EmbeddedTypeRegistry getInstance() {
-		if (instance == null) {
-			instance = new EmbeddedTypeRegistryImpl();
-		}
-		return instance;
-	}
-
-	private HashSet hashSet = null;
-	private EmbeddedTypeHandler registryDefaultHandler = null;
-
-	/*
-	 * @see ContentTypeRegistry#getTypeFor(String)
-	 */
-	/**
-	 * Constructor for ContentTypeRegistryImpl.
-	 */
-	private EmbeddedTypeRegistryImpl() {
-		super();
-		hashSet = new HashSet();
-		new EmbeddedTypeRegistryReader().readRegistry(hashSet);
-	}
-
-	/**
-	 * @see ContentTypeRegistry#add(ContentTypeDescription)
-	 */
-	void add(IDocumentTypeHandler contentTypeDescription) {
-		hashSet.add(contentTypeDescription);
-	}
-
-	private EmbeddedTypeHandler getJSPDefaultEmbeddedType() {
-		return getTypeFor("text/html"); //$NON-NLS-1$
-	}
-
-	/**
-	 * Method getRegistryDefault. We cache the default handler, since can't
-	 * change once plugin descriptors are loaded.
-	 * 
-	 * @return EmbeddedTypeHandler
-	 */
-	private EmbeddedTypeHandler getRegistryDefault() {
-		if (registryDefaultHandler == null) {
-			Iterator it = hashSet.iterator();
-			while ((registryDefaultHandler == null) && (it.hasNext())) { // safe
-				// cast
-				// since
-				// 'add'
-				// requires
-				// EmbeddedContentTypeDescription
-				EmbeddedTypeHandler item = (EmbeddedTypeHandler) it.next();
-				if ((item != null) && (item.isDefault())) {
-					registryDefaultHandler = item;
-					break;
-				}
-			}
-		}
-		return registryDefaultHandler;
-	}
-
-	/**
-	 * Finds the contentTypeDescription based on literal id. Its basically a
-	 * "first found first returned". Note the order is fairly unpredictable,
-	 * so non-unique ids would cause problems.
-	 */
-	public EmbeddedTypeHandler getTypeFor(String mimeType) {
-		// Note: the reason we have this precondition is that the
-		// default is different inside the registry than when called,
-		// for example, from the JSPLoader. For the JSPLoader, if there
-		// is no mimetype, the default should be HTML. Here, if there is
-		// some mimetype, but it is not recognized, we return a default
-		// for XML. This is required for various voice xml types, etc.
-		EmbeddedTypeHandler found = null;
-		if (mimeType == null || mimeType.trim().length() == 0) {
-			found = getJSPDefaultEmbeddedType();
-		} else {
-			Iterator it = hashSet.iterator();
-			while ((found == null) && (it.hasNext())) { // safe cast since
-				// 'add' requires
-				// EmbeddedContentTypeDescription
-				EmbeddedTypeHandler item = (EmbeddedTypeHandler) it.next();
-				if ((item != null) && (item.getSupportedMimeTypes().contains(mimeType))) {
-					found = item;
-					break;
-				}
-			}
-			// if no exact match, do the "looser" check
-			if(found == null) {
-				it = hashSet.iterator();
-				while ((found == null) && (it.hasNext())) { 
-					EmbeddedTypeHandler item = (EmbeddedTypeHandler) it.next();
-					if ((item != null) && (item.canHandleMimeType(mimeType))) {
-						found = item;
-						break;
-					}
-				}
-			}
-		}
-		// no matches, use default
-		if (found == null) {
-			found = getRegistryDefault();
-		}
-		return found;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryReader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryReader.java
deleted file mode 100644
index 1344178..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryReader.java
+++ /dev/null
@@ -1,71 +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.sse.core.internal.modelhandler;
-
-import java.util.Set;
-
-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.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-
-
-public class EmbeddedTypeRegistryReader {
-	protected String ATT_CLASS = "class"; //$NON-NLS-1$
-	protected String EXTENSION_POINT_ID = "embeddedTypeHandler"; //$NON-NLS-1$
-
-
-	protected String PLUGIN_ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
-	protected String TAG_NAME = "embeddedTypeHandler"; //$NON-NLS-1$
-
-	EmbeddedTypeRegistryReader() {
-		super();
-	}
-
-	protected EmbeddedTypeHandler readElement(IConfigurationElement element) {
-
-		EmbeddedTypeHandler contentTypeDescription = null;
-		if (element.getName().equals(TAG_NAME)) {
-			try {
-				contentTypeDescription = (EmbeddedTypeHandler) element.createExecutableExtension(ATT_CLASS);
-			} catch (Exception e) {
-				Logger.logException(e);
-			}
-		}
-		Assert.isNotNull(contentTypeDescription, "Error reading content type description"); //$NON-NLS-1$
-		return contentTypeDescription;
-	}
-
-	/**
-	 * We simply require an 'add' method, of what ever it is we are to read
-	 * into
-	 */
-	void readRegistry(Set set) {
-		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
-		IExtensionPoint point = extensionRegistry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
-		if (point != null) {
-			IConfigurationElement[] elements = point.getConfigurationElements();
-			for (int i = 0; i < elements.length; i++) {
-				EmbeddedTypeHandler embeddedContentType = readElement(elements[i]);
-				// null can be returned if there's an error reading the
-				// element
-				if (embeddedContentType != null) {
-					set.add(embeddedContentType);
-				}
-			}
-		}
-	}
-}
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
deleted file mode 100644
index 2a63cfa..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java
+++ /dev/null
@@ -1,295 +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.sse.core.internal.modelhandler;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-
-public class ModelHandlerRegistry {
-	private static ModelHandlerRegistry instance = null;
-	static final String INTERNAL_DEFAULT_EXTENSION = "org.eclipse.wst.xml.core.internal.modelhandler"; //$NON-NLS-1$
-
-	public synchronized static ModelHandlerRegistry getInstance() {
-		if (instance == null) {
-			instance = new ModelHandlerRegistry();
-		}
-		return instance;
-	}
-
-	private IModelHandler defaultHandler = null;
-	private ModelHandlerRegistryReader reader = new ModelHandlerRegistryReader();
-
-	private ModelHandlerRegistry() {
-		super();
-		reader = new ModelHandlerRegistryReader().readRegistry();
-	}
-
-	/**
-	 * Finds the default model handler. Note: we still go through the registry
-	 * to be sure to get the existing instance, but then we do remember it, so
-	 * subsequent requests will be faster. The first time through, we do check
-	 * the whole list, to be sure there is only one.
-	 * 
-	 */
-	final public IModelHandler getDefault() {
-		if (defaultHandler == null) {
-			IConfigurationElement[] elements = reader.elements;
-			for (int i = 0; i < elements.length; i++) {
-				boolean ofInterest = reader.isElementDefault(elements[i]);
-				if (ofInterest) {
-					/*
-					 * If, here within the search loop we've already found one
-					 * defaultHandler, then something is wrong!
-					 */
-					if (defaultHandler == null) {
-						defaultHandler = reader.getInstance(elements[i]);
-					}
-					else {
-						String errorString = "Program or configuration error. More than one default content handler found"; //$NON-NLS-1$
-						Logger.log(Logger.ERROR, errorString);
-						throw new IllegalStateException(errorString);
-					}
-				}
-			}
-		}
-		if (defaultHandler == null) {
-			String errorString = "Program or configuration error. No default content type handler found."; //$NON-NLS-1$
-			Logger.log(Logger.ERROR, errorString);
-			throw new IllegalStateException(errorString);
-		}
-		return defaultHandler;
-	}
-
-	/**
-	 * Finds a ModelHandler based on literal extension id. It's basically a
-	 * "first found first returned". No specific order is guaranteed and the
-	 * uniqueness of IDs is not considered.
-	 * 
-	 * @param extensionId
-	 * @return the given extension, or null
-	 */
-	private IModelHandler getHandlerExtension(String extensionId) {
-		IModelHandler found = null;
-		IConfigurationElement[] elements = reader.elements;
-		if (elements != null) {
-			for (int i = 0; i < elements.length; i++) {
-				String currentId = reader.getId(elements[i]);
-				if (extensionId.equals(currentId)) {
-					IModelHandler item = reader.getInstance(elements[i]);
-					found = item;
-				}
-			}
-		}
-		else if (Logger.DEBUG){
-			Logger.log(Logger.WARNING, "There were no Model Handler found in registry"); //$NON-NLS-1$
-		}
-		return found;
-	}
-
-	/**
-	 * Finds the registered IModelHandler for a given named file's content
-	 * type.
-	 * 
-	 * @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 {
-		IModelHandler modelHandler = null;
-		IContentDescription contentDescription = null;
-		IContentType contentType = null;
-		boolean accessible = file.isAccessible();
-		if (accessible) {
-			/* Try the optimized method first as the description may be cached */
-			contentDescription = file.getContentDescription();
-			if (contentDescription != null) {
-				// use the provided description
-				contentType = contentDescription.getContentType();
-			}
-			else {
-				/* use the more thorough discovery method to get a description */
-				InputStream contents = null;
-				try {
-					contents = file.getContents(true);
-					contentDescription = Platform.getContentTypeManager().getDescriptionFor(contents, file.getName(), IContentDescription.ALL);
-					if (contentDescription != null) {
-						contentType = contentDescription.getContentType();
-					}
-				}
-				catch (IOException e) {
-					// nothing further can be done, but will log for debugging
-					Logger.logException(e);
-				}
-				finally {
-					if (contents != null) {
-						try {
-							contents.close();
-						}
-						catch (IOException e1) {
-							// nothing can be done
-						}
-					}
-				}
-			}
-		}
-
-		/*
-		 * If we couldn't get the content type from a description, try basing
-		 * it on just the filename
-		 */
-		if (contentType == null) {
-			contentType = Platform.getContentTypeManager().findContentTypeFor(file.getName());
-		}
-
-		if (contentType != null) {
-			modelHandler = getHandlerForContentType(contentType);
-		}
-		else {
-			// hard coding for null content type
-			modelHandler = getHandlerExtension(INTERNAL_DEFAULT_EXTENSION); //$NON-NLS-1$
-		}
-
-		return modelHandler;
-	}
-
-
-	/**
-	 * Finds the registered IModelHandler for a given named InputStream.
-	 * 
-	 * @param inputName
-	 * @param inputStream
-	 * @return The IModelHandler registered for the content type of the given
-	 *         input. 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 IOException
-	 */
-	public IModelHandler getHandlerFor(String inputName, InputStream inputStream) throws IOException {
-		InputStream iStream = Utilities.getMarkSupportedStream(inputStream);
-		IModelHandler modelHandler = null;
-		IContentType contentType = null;
-		if (inputStream != null) {
-			try {
-				iStream.mark(CodedIO.MAX_MARK_SIZE);
-				contentType = Platform.getContentTypeManager().findContentTypeFor(Utilities.getLimitedStream(iStream), inputName);
-			}
-			finally {
-				if (iStream != null && iStream.markSupported()) {
-					iStream.reset();
-				}
-			}
-
-		}
-		if (contentType == null) {
-			contentType = Platform.getContentTypeManager().findContentTypeFor(inputName);
-		}
-		// if all else failed, try to detect solely on contents; done last for
-		// performance reasons
-		if (contentType == null) {
-			contentType = Platform.getContentTypeManager().findContentTypeFor(Utilities.getLimitedStream(iStream), null);
-		}
-		modelHandler = getHandlerForContentType(contentType);
-		return modelHandler;
-	}
-
-	/**
-	 * Finds the registered IModelHandler for a given IContentType.
-	 * 
-	 * @param contentType
-	 * @return The IModelHandler registered for the given content type. 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.
-	 */
-	private IModelHandler getHandlerForContentType(IContentType contentType) {
-		IModelHandler handler = null;
-		if (contentType != null) {
-			IConfigurationElement exactContentTypeElement = null;
-			IConfigurationElement kindOfContentTypeElement = null;
-			int kindOfContentTypeDepth = 0;
-			IConfigurationElement[] elements = reader.elements;
-			if (elements != null) {
-				for (int i = 0; i < elements.length && exactContentTypeElement == null; i++) {
-					String currentId = reader.getAssociatedContentTypeId(elements[i]);
-					IContentType associatedContentType = Platform.getContentTypeManager().getContentType(currentId);
-					if (contentType.equals(associatedContentType)) {
-						exactContentTypeElement = elements[i];
-					}
-					else if (contentType.isKindOf(associatedContentType)) {
-						/*
-						 * Update the kindOfElement variable only if this
-						 * element's content type is "deeper" (depth test
-						 * ensures the first content type is remembered)
-						 */
-						IContentType testContentType = associatedContentType;
-						int testDepth = 0;
-						while (testContentType != null) {
-							testDepth++;
-							testContentType = testContentType.getBaseType();
-						}
-						if (testDepth > kindOfContentTypeDepth) {
-							kindOfContentTypeElement = elements[i];
-							kindOfContentTypeDepth = testDepth;
-						}
-					}
-				}
-			}
-			else if (Logger.DEBUG){
-				Logger.log(Logger.WARNING, "There were no Model Handler found in registry"); //$NON-NLS-1$
-			}
-			if (exactContentTypeElement != null) {
-				handler = reader.getInstance(exactContentTypeElement);
-			}
-			else if (kindOfContentTypeElement != null) {
-				handler = reader.getInstance(kindOfContentTypeElement);
-			}
-		}
-
-		if (handler == null) {
-			// temp hard coding for null content type arguments
-			handler = getHandlerExtension(INTERNAL_DEFAULT_EXTENSION); //$NON-NLS-1$
-		}
-		return handler;
-	}
-
-	/**
-	 * Finds the registered IModelHandler for a given content type ID. No
-	 * specific order is guaranteed and the uniqueness of IDs is not
-	 * considered.
-	 * 
-	 * @param contentType
-	 * @return The IModelHandler registered for the given content type ID. 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.
-	 */
-	public IModelHandler getHandlerForContentTypeId(String contentTypeId) {
-		IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeId);
-		return getHandlerForContentType(contentType);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistryReader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistryReader.java
deleted file mode 100644
index 9765b6b..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistryReader.java
+++ /dev/null
@@ -1,106 +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.sse.core.internal.modelhandler;
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.CoreException;
-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.sse.core.internal.ltk.modelhandler.AbstractModelHandler;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-
-
-/**
- * This class just converts what's in the plugins registry into a form more
- * easily useable by others, the ContentTypeRegistry.
- */
-class ModelHandlerRegistryReader {
-	private HashMap allReadyCreateInstances = new HashMap();
-	protected String ATT_ASSOCIATED_CONTENT_TYPE = "associatedContentTypeId"; //$NON-NLS-1$
-	protected String ATT_CLASS = "class"; //$NON-NLS-1$
-	protected String ATT_DEFAULT = "default"; //$NON-NLS-1$
-	protected String ATT_ID = "id"; //$NON-NLS-1$
-	IConfigurationElement[] elements;
-	protected String EXTENSION_POINT_ID = "modelHandler"; //$NON-NLS-1$
-	//
-	protected String PLUGIN_ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
-	protected String TAG_NAME = "modelHandler"; //$NON-NLS-1$
-
-	//
-	/**
-	 * ContentTypeRegistryReader constructor comment.
-	 */
-	ModelHandlerRegistryReader() {
-		super();
-	}
-
-	String getAssociatedContentTypeId(IConfigurationElement element) {
-		String value = element.getAttribute(ATT_ASSOCIATED_CONTENT_TYPE);
-		return value;
-	}
-
-	String getId(IConfigurationElement element) {
-		String idValue = element.getAttribute(ATT_ID);
-		return idValue;
-	}
-
-	synchronized IModelHandler getInstance(IConfigurationElement element) {
-		// May need to reconsider, but for now, we'll assume all clients must
-		// subclass AbstractContentTypeIdentifier. Its easier and safer, for
-		// this
-		// low level "system" object. (That is, we can check and set "package
-		// protected"
-		// attributes.
-		AbstractModelHandler modelHandler = (AbstractModelHandler) allReadyCreateInstances.get(getId(element));
-		if (modelHandler == null) {
-			try {
-				modelHandler = (AbstractModelHandler) element.createExecutableExtension(ATT_CLASS);
-				if (modelHandler != null) {
-					allReadyCreateInstances.put(getId(element), modelHandler);
-					String defaultValue = element.getAttribute(ATT_DEFAULT);
-					if (defaultValue != null && "true".equals(defaultValue)) //$NON-NLS-1$
-						modelHandler.setDefault(true);
-					else
-						modelHandler.setDefault(false);
-					// TODO -- set and check attributes vs. created instance
-					//contentTypeIdentifier.setOrCheckId(element.getAttribute(ATT_ID));
-				}
-			} catch (CoreException e) {
-				org.eclipse.wst.sse.core.internal.Logger.logException(e);
-			}
-		}
-		return modelHandler;
-	}
-
-	public boolean isElementDefault(IConfigurationElement element) {
-		String defaultValue = element.getAttribute(ATT_DEFAULT);
-		if (defaultValue != null && "true".equals(defaultValue)) //$NON-NLS-1$
-			return true;
-		else
-			return false;
-	}
-
-	ModelHandlerRegistryReader readRegistry() {
-		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
-		IExtensionPoint point = extensionRegistry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
-		if (point != null) {
-			// just remember the elements, so plugins don't have to
-			// be activated, unless extension matches those "of interest".
-			elements = point.getConfigurationElements();
-		}
-		return this;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerUtility.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerUtility.java
deleted file mode 100644
index acaef3a..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerUtility.java
+++ /dev/null
@@ -1,50 +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.sse.core.internal.modelhandler;
-
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-
-/**
- * 
- * Likely a temporary class to be replaced by plugin, eventually.
- */
-public class ModelHandlerUtility {
-
-	private static ModelHandlerRegistry contentTypeRegistry;
-
-	public static IDocumentTypeHandler getContentTypeFor(String string) {
-		return getContentTypeRegistry().getHandlerForContentTypeId(string);
-	}
-
-	private static ModelHandlerRegistry getContentTypeRegistry() {
-		if (contentTypeRegistry == null) {
-			contentTypeRegistry = ModelHandlerRegistry.getInstance();
-		}
-		return contentTypeRegistry;
-	}
-
-	public static EmbeddedTypeHandler getDefaultEmbeddedType() {
-		return getEmbeddedContentTypeFor("text/html"); //$NON-NLS-1$
-	}
-
-	public static EmbeddedTypeHandler getEmbeddedContentTypeFor(String string) {
-		EmbeddedTypeHandler instance = null;
-		instance = EmbeddedTypeRegistryImpl.getInstance().getTypeFor(string);
-		return instance;
-	}
-
-	public ModelHandlerUtility() {
-		super();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/PluginContributedFactoryReader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/PluginContributedFactoryReader.java
deleted file mode 100644
index 874534c..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/PluginContributedFactoryReader.java
+++ /dev/null
@@ -1,126 +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.sse.core.internal.modelhandler;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-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.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-
-
-/**
- * 
- * Clients can make use of IExecutableExtension to handle the optional adapter
- * class and key. Typically, many clients use a typical pattern of providing
- * an adapter class and key in their null argument constructor anyway, so
- * they'd only have to use IExecutableExtension if the factory was for more
- * than one.
- */
-public class PluginContributedFactoryReader {
-	//	protected final String ATTR_ADAPTERKEY = "adapterKeyClass";
-	// //$NON-NLS-1$
-	//	protected final String ATTR_REGISTERADAPTER = "registerAdapters";
-	// //$NON-NLS-1$
-	private static PluginContributedFactoryReader reader = null;
-
-	public synchronized static PluginContributedFactoryReader getInstance() {
-		if (reader == null) {
-			reader = new PluginContributedFactoryReader();
-		}
-		return reader;
-	}
-
-	protected final String ATTR_CLASS = "class"; //$NON-NLS-1$
-	protected final String ATTR_CONTENTTYPE = "contentTypeIdentiferId"; //$NON-NLS-1$
-
-	protected final String EXTENSION_POINT_ID = "contentTypeFactoryContribution"; //$NON-NLS-1$
-	protected final String TAG_NAME = "factory"; //$NON-NLS-1$
-
-	protected PluginContributedFactoryReader() {
-		super();
-	}
-
-	public List getFactories(IDocumentTypeHandler handler) {
-		return loadRegistry(handler.getId());
-	}
-
-	public List getFactories(String type) {
-		return loadRegistry(type);
-	}
-
-	protected INodeAdapterFactory loadFactoryFromConfigurationElement(IConfigurationElement element, Object requesterType) {
-		INodeAdapterFactory factory = null;
-		if (element.getName().equals(TAG_NAME)) {
-			String contentType = element.getAttribute(ATTR_CONTENTTYPE);
-			if (!requesterType.equals(contentType))
-				return null;
-			String className = element.getAttribute(ATTR_CLASS);
-			//			String adapterKeyClass = element.getAttribute(ATTR_ADAPTERKEY);
-			//			String registerAdapters =
-			// element.getAttribute(ATTR_REGISTERADAPTER);
-
-			// if className is null, then no one defined the extension point
-			// for adapter factories
-			if (className != null) {
-				try {
-					factory = (INodeAdapterFactory) element.createExecutableExtension(ATTR_CLASS);
-				} catch (CoreException e) {
-					// if an error occurs here, its probably that the plugin
-					// could not be found/loaded
-					org.eclipse.wst.sse.core.internal.Logger.logException("Could not find class: " + className, e); //$NON-NLS-1$
-				} catch (Exception e) {
-					// if an error occurs here, its probably that the plugin
-					// could not be found/loaded -- but in any case we just
-					// want
-					// to log the error and continue running and best we can.
-					org.eclipse.wst.sse.core.internal.Logger.logException("Could not find class: " + className, e); //$NON-NLS-1$
-				}
-				//				if (plugin != null) {
-				//					factory = oldAttributesCode(element, factory, className,
-				// plugin);
-				//
-			}
-		}
-
-		return factory;
-	}
-
-	protected List loadRegistry(Object contentType) {
-		List factoryList = null; // new Vector();
-		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
-		IExtensionPoint point = extensionRegistry.getExtensionPoint(SSECorePlugin.ID, EXTENSION_POINT_ID);
-		if (point != null) {
-			IConfigurationElement[] elements = point.getConfigurationElements();
-			if (elements.length > 0) {
-				// this is called a lot, so don't create vector unless really
-				// needed
-				// TODO: could eventually cache in a hashtable, or something,
-				// to avoid repeat processing
-				factoryList = new Vector();
-				for (int i = 0; i < elements.length; i++) {
-					INodeAdapterFactory factory = loadFactoryFromConfigurationElement(elements[i], contentType);
-					if (factory != null)
-						factoryList.add(factory);
-				}
-			}
-		}
-		return factoryList;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ContextRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ContextRegion.java
deleted file mode 100644
index 3428768..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ContextRegion.java
+++ /dev/null
@@ -1,197 +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.sse.core.internal.parser;
-
-
-
-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;
-
-
-/**
- * Regions of this class are intended specifically for XML/HTML/JSPs. Other
- * languages may need their own subclasses. (See the updateModel method).
- */
-public class ContextRegion implements ITextRegion {
-	protected int fLength;
-
-	protected int fStart;
-	protected int fTextLength;
-	protected String fType;
-
-	protected ContextRegion() {
-		super();
-	}
-
-	public ContextRegion(String newContext, int newStart, int newTextLength, int newLength) {
-		fType = newContext;
-		fStart = newStart;
-		fTextLength = newTextLength;
-		fLength = newLength;
-	}
-
-
-	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) {
-		fTextLength += i;
-
-	}
-
-	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;
-	}
-
-	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;
-	}
-
-	boolean canHandleAsLetterOrDigit(String changes, int requestStart, int lengthToReplace) {
-		boolean result = false;
-		// Make sure we are in a non-white space area
-		if ((requestStart <= (getTextEnd())) && (allLetterOrDigit(changes))) {
-			result = true;
-		}
-		return result;
-	}
-
-	boolean canHandleAsWhiteSpace(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 (getEnd() > 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.
-			if (requestStart > 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;
-	}
-
-	public boolean contains(int position) {
-
-		return fStart <= position && position < fStart + fLength;
-	}
-
-	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 void setLength(int i) {
-		fLength = i;
-	}
-
-	public void setStart(int i) {
-		fStart = i;
-	}
-
-	public void setTextLength(int i) {
-		fTextLength = i;
-	}
-
-	public void setType(String string) {
-		fType = string;
-	}
-
-	public String toString() {
-		String className = getClass().getName();
-		String shortClassName = className.substring(className.lastIndexOf(".") + 1); //$NON-NLS-1$
-		String result = shortClassName + "--> " + getType() + ": " + getStart() + "-" + getTextEnd() + (getTextEnd() != getEnd() ? ("/" + 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;
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
-		// the four types we used to handle here, have all been moved to
-		// specific region classes.
-		// XML_TAG_ATTRIBUTE_VALUE
-		// XML_TAG_ATTRIBUTE_NAME
-		// XML_CONTENT
-		// XML_CDATA_TEXT
-		return null;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ForeignRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ForeignRegion.java
deleted file mode 100644
index f486d00..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ForeignRegion.java
+++ /dev/null
@@ -1,88 +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.sse.core.internal.parser;
-
-
-
-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;
-
-
-public class ForeignRegion extends ContextRegion {
-
-	private String language = null;
-	private String surroundingTag = null;
-
-	/**
-	 * ForeignRegion constructor comment.
-	 */
-	private ForeignRegion() {
-		super();
-	}
-
-	public ForeignRegion(String newContext, int newStart, int newTextLength, int newLength) {
-		super(newContext, newStart, newTextLength, newLength);
-	}
-
-	public ForeignRegion(String newContext, int newStart, int newTextLength, int newLength, String newLanguage) {
-		super(newContext, newStart, newTextLength, newLength);
-		setLanguage(newLanguage);
-	}
-
-	/**
-	 * 
-	 * @return java.lang.String
-	 */
-	public java.lang.String getLanguage() {
-		return language;
-	}
-
-	/**
-	 * @return java.lang.String
-	 */
-	public java.lang.String getSurroundingTag() {
-		return surroundingTag;
-	}
-
-	/**
-	 * 
-	 * @param newLanguage
-	 *            java.lang.String
-	 */
-	public void setLanguage(java.lang.String newLanguage) {
-		language = newLanguage;
-	}
-
-	/**
-	 * @param newSurroundingTag
-	 *            java.lang.String
-	 */
-	public void setSurroundingTag(java.lang.String newSurroundingTag) {
-		surroundingTag = newSurroundingTag;
-	}
-
-	public String toString() {
-		return "FOREIGN: " + super.toString();//$NON-NLS-1$
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion flatnode, String changes, int requestStart, int lengthToReplace) {
-		org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent result = null;
-		int lengthDifference = org.eclipse.wst.sse.core.internal.util.Utilities.calculateLengthDifference(changes, lengthToReplace);
-		fLength += lengthDifference;
-		fTextLength += lengthDifference;
-		result = new RegionChangedEvent(flatnode.getParentDocument(), requester, flatnode, this, changes, requestStart, lengthToReplace);
-
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/CommonModelPreferenceNames.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/CommonModelPreferenceNames.java
deleted file mode 100644
index 61a513b..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/CommonModelPreferenceNames.java
+++ /dev/null
@@ -1,76 +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.sse.core.internal.preferences;
-
-/**
- * @deprecated CommonModelPreferenceNames are now managed by each individual
- *             content type. (XXCorePreferenceNames)
- * 
- */
-public interface CommonModelPreferenceNames {
-	String TAB_WIDTH = "tabWidth";//$NON-NLS-1$
-	String LINE_WIDTH = "lineWidth";//$NON-NLS-1$
-	String SPLIT_MULTI_ATTRS = "splitMultiAttrs";//$NON-NLS-1$
-	String INDENT_USING_TABS = "indentUsingTabs";//$NON-NLS-1$
-	String CLEAR_ALL_BLANK_LINES = "clearAllBlankLines";//$NON-NLS-1$
-
-	String TAG_NAME_CASE = "tagNameCase";//$NON-NLS-1$
-	String ATTR_NAME_CASE = "attrNameCase";//$NON-NLS-1$
-
-	String FORMATTING_SUPPORTED = "formattingSupported";//$NON-NLS-1$
-
-	String PREFERRED_MARKUP_CASE_SUPPORTED = "preferredMarkupCaseSupported";//$NON-NLS-1$
-
-	String TASK_TAG_TAGS = "task-tag-tags"; //$NON-NLS-1$
-	String TASK_TAG_PRIORITIES = "task-tag-priorities"; //$NON-NLS-1$
-	String TASK_TAG_ENABLE = "task-tags"; //$NON-NLS-1$
-	String TASK_TAG_PROJECTS_IGNORED = "task-tag-projects-toIgnore"; //$NON-NLS-1$
-
-
-	/**
-	 * these are preferences that should be inherited from the "embedded
-	 * preference store" for example: if you ask for th OVERVIEW_RULER
-	 * preference for JSP, you will automatically get the preference from the
-	 * HTML preference store.
-	 */
-	String EMBEDDED_CONTENT_TYPE_PREFERENCES[] = {TAB_WIDTH, LINE_WIDTH, SPLIT_MULTI_ATTRS, INDENT_USING_TABS, CLEAR_ALL_BLANK_LINES, TAG_NAME_CASE, ATTR_NAME_CASE,};
-
-	String FORMATTING_PREFERENCES[] = {TAB_WIDTH, LINE_WIDTH, SPLIT_MULTI_ATTRS, INDENT_USING_TABS, CLEAR_ALL_BLANK_LINES,};
-
-	String AUTO = "Auto";//$NON-NLS-1$
-	String UTF_8 = "UTF-8";//$NON-NLS-1$
-	String ISO_8859_1 = "ISO-8859-1";//$NON-NLS-1$
-
-	int ASIS = 0;
-	int LOWER = 1;
-	int UPPER = 2;
-
-	// cleanup preference names
-	String CLEANUP_TAG_NAME_CASE = "cleanupTagNameCase";//$NON-NLS-1$
-	String CLEANUP_ATTR_NAME_CASE = "cleanupAttrNameCase";//$NON-NLS-1$
-	String COMPRESS_EMPTY_ELEMENT_TAGS = "compressEmptyElementTags";//$NON-NLS-1$
-	String INSERT_REQUIRED_ATTRS = "insertRequiredAttrs";//$NON-NLS-1$
-	String INSERT_MISSING_TAGS = "insertMissingTags";//$NON-NLS-1$
-	String QUOTE_ATTR_VALUES = "quoteAttrValues";//$NON-NLS-1$
-	String FORMAT_SOURCE = "formatSource";//$NON-NLS-1$
-	String CONVERT_EOL_CODES = "convertEOLCodes";//$NON-NLS-1$
-	String CLEANUP_EOL_CODE = "cleanupEOLCode";//$NON-NLS-1$
-
-	String LAST_ACTIVE_PAGE = "lastActivePage";//$NON-NLS-1$	
-
-	// need to put default tab width preference here so it is accessible by
-	// both model and editor
-	// this way, editor does not need to query model's default tab width
-	// preference
-	int DEFAULT_TAB_WIDTH = 4;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/PreferenceInitializer.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/PreferenceInitializer.java
deleted file mode 100644
index d9b1f1e..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/PreferenceInitializer.java
+++ /dev/null
@@ -1,32 +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
- *     
- *******************************************************************************/
-package org.eclipse.wst.sse.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.tasks.TaskTagPreferenceKeys;
-
-public class PreferenceInitializer extends AbstractPreferenceInitializer {
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
-	 */
-	public void initializeDefaultPreferences() {
-		IEclipsePreferences taskTagDefaults = new DefaultScope().getNode(TaskTagPreferenceKeys.TASK_TAG_NODE);
-		taskTagDefaults.putBoolean(TaskTagPreferenceKeys.TASK_TAG_ENABLE, false);
-		taskTagDefaults.put(TaskTagPreferenceKeys.TASK_TAG_TAGS, "TODO,FIXME,XXX"); //$NON-NLS-1$
-		taskTagDefaults.put(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, "1,2,1"); //$NON-NLS-1$
-		taskTagDefaults.put(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, ""); //$NON-NLS-1$
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractAdapterFactory.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractAdapterFactory.java
deleted file mode 100644
index 4aa9c80..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractAdapterFactory.java
+++ /dev/null
@@ -1,158 +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.sse.core.internal.provisional;
-
-/**
- * An abstract implementation of IAdapterFactory. All implementers of
- * IAdapterFactory should subclass this class. The default constructor uses
- * itself (this) as the key. Subclasses need to provide a way to create the
- * adapter, and can override or call other methods.
- */
-abstract public class AbstractAdapterFactory implements INodeAdapterFactory {
-
-
-
-	private Object fAdapterKey;
-
-	private boolean fShouldRegisterAdapter;
-
-	/**
-	 * If this default constructor used, setAdapterKey and setShouldRegister
-	 * should be used to properly initialize.
-	 */
-	protected AbstractAdapterFactory() {
-		super();
-
-	}
-
-
-	public AbstractAdapterFactory(Object adapterKey) {
-		this(adapterKey, true);
-	}
-
-	/**
-	 * Suclasses may extended this constructor, if needed.
-	 */
-
-	public AbstractAdapterFactory(Object adapterKey, boolean registerAdapters) {
-
-		super();
-		fAdapterKey = adapterKey;
-		fShouldRegisterAdapter = registerAdapters;
-
-	}
-
-	/**
-	 * ISSUE: should be final. See those that implement it 
-	 * for complicating details and "unknowns". 
-	 */
-	public INodeAdapter adapt(INodeNotifier target) {
-		INodeAdapter adapter = null;
-		if (target != null) {
-			adapter = target.getExistingAdapter(fAdapterKey);
-			if (adapter == null) {
-				adapter = adaptNew(target);
-			}
-		}
-		return adapter;
-	}
-
-	/**
-	 * Subclasses should normally implement their own 'copy' method. By
-	 * default, we'll return the same instance, for convenience of those using
-	 * singleton factories (which have no state, and so need to do anything on
-	 * 'release').
-	 * 
-	 */
-	public INodeAdapterFactory copy() {
-		return this;
-	}
-
-	/**
-	 * This method needs to return true of this factory is for adapters of
-	 * type 'type'. It is required that it return true if 'equals' and this
-	 * default behavior is provided by this super class. Clients may extend
-	 * this behavior if more complex logic is required.
-	 */
-	public boolean isFactoryForType(Object type) {
-		return type.equals(fAdapterKey);
-	}
-
-	/**
-	 * Subclasses may need to "cleanup" their adapter factory, release
-	 * adapters, resources, etc. Subclasses may extend this method if such
-	 * clean up is required. Note: while current behavior is to do nothing,
-	 * subclasses should not assume this would always be true, so should
-	 * always call super.release at the end of their method.
-	 */
-	public void release() {
-		// default for superclass is to do nothing
-	}
-
-	/**
-	 * Only for special cases there the adapter key can be set in the
-	 * constructor. It can be set here. If it is set more than, and
-	 */
-	final protected void setAdapterKey(Object key) {
-		if (fAdapterKey != null && !(fAdapterKey.equals(key)))
-			throw new IllegalStateException("INodeAdapter Key cannot be changed."); //$NON-NLS-1$
-		fAdapterKey = key;
-	}
-
-	/**
-	 * Can be called by subclasses during 'adapt' process, but must not be
-	 * overridden or reimplemented by subclasses.
-	 * 
-	 * @param target
-	 * @return
-	 */
-	protected final INodeAdapter adaptNew(INodeNotifier target) {
-		INodeAdapter adapter = createAdapter(target);
-		if (adapter != null) {
-			if (fShouldRegisterAdapter) {
-				target.addAdapter(adapter);
-			}
-		}
-		return adapter;
-	}
-
-	/**
-	 * Subclasses must implement this method. It is called by infrastructure
-	 * when an instance is needed. It is provided the node notifier, which may
-	 * or may not be relevent when creating the adapter. Note: the adapter
-	 * does not have to literally be a new intance and is actually recommended
-	 * to typically be a singleton for performance reasons.
-	 * 
-	 * @param target
-	 * @return
-	 */
-	abstract protected INodeAdapter createAdapter(INodeNotifier target);
-
-
-	protected final boolean isShouldRegisterAdapter() {
-		return fShouldRegisterAdapter;
-	}
-
-
-	protected final void setShouldRegisterAdapter(boolean shouldRegisterAdapter) {
-		// ISSUE: technically we probably should not allow this value to
-		// change, after initialization, but is not so easy to do,
-		// and I'm not sure its "worth" the protection.
-		fShouldRegisterAdapter = shouldRegisterAdapter;
-	}
-
-
-	protected final Object getAdapterKey() {
-		return fAdapterKey;
-	}
-}
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
deleted file mode 100644
index 1014270..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java
+++ /dev/null
@@ -1,240 +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.sse.core.internal.provisional;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-
-
-
-/**
- * AbstractNotifier is similar to (and based on) the EMF NotifierImpl class,
- * but is not related to EMF per se. This class is simpler (that is, not as
- * many functions).
- * 
- * Implementers of this INodeNotifier must subclass this class.
- */
-public abstract class AbstractNotifier implements INodeNotifier {
-	private final static int growthConstant = 3;
-	private int adapterCount = 0;
-
-	private INodeAdapter[] fAdapters;
-
-	/**
-	 * AbstractNotifier constructor comment.
-	 */
-	public AbstractNotifier() {
-		super();
-	}
-
-	/**
-	 * addAdapter method comment.
-	 */
-	public synchronized void addAdapter(INodeAdapter adapter) {
-
-		if (adapter == null)
-			return;
-		ensureCapacity(adapterCount + 1);
-		fAdapters[adapterCount++] = adapter;
-	}
-
-	private void ensureCapacity(int needed) {
-		if (fAdapters == null) {
-			// first time
-			fAdapters = new INodeAdapter[needed + growthConstant];
-			return;
-		}
-		int oldLength = fAdapters.length;
-		if (oldLength < needed) {
-			INodeAdapter[] oldAdapters = fAdapters;
-			INodeAdapter[] newAdapters = new INodeAdapter[needed + growthConstant];
-			System.arraycopy(oldAdapters, 0, newAdapters, 0, adapterCount);
-			fAdapters = newAdapters;
-		}
-	}
-
-	/**
-	 * NOT API: used only for testing.
-	 * 
-	 * @return int
-	 */
-	public int getAdapterCount() {
-		return adapterCount;
-	}
-
-	/**
-	 * Default behavior for getting an adapter.
-	 */
-	public 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,
-		// let's create it
-		if (result == null) {
-			FactoryRegistry reg = getFactoryRegistry();
-			if (reg != null) {
-				INodeAdapterFactory factory = reg.getFactoryFor(type);
-				if (factory != null) {
-					result = factory.adapt(this);
-				}
-			}
-			// We won't prevent null from being returned, but it would be
-			// unusual.
-			// It might be because Factory is not working correctly, or
-			// not installed, so we'll allow warning message.
-			if ((result == null) && (org.eclipse.wst.sse.core.internal.util.Debug.displayWarnings)) {
-				System.out.println("Warning: no adapter was found or created for " + type); //$NON-NLS-1$
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Returns a shallow clone of list, since clients should not manipulate
-	 * our list directly. Instead, they should use add/removeAdapter.
-	 */
-	public Collection getAdapters() {
-		if (fAdapters != null) {
-			if (adapterCount == 0) {
-				fAdapters = null;
-				return Collections.EMPTY_LIST;
-			}
-			else {
-				// we need to make a new array, to be sure
-				// it doesn't contain nulls at end, which may be
-				// present there for "growth".
-				INodeAdapter[] tempAdapters = new INodeAdapter[adapterCount];
-				System.arraycopy(fAdapters, 0, tempAdapters, 0, adapterCount);
-				// EMF uses the unmodifiableCollection. Its a bit of a
-				// performance
-				// drain, but may want to leave in since
-				// it would "fail fast" if someone was trying to modify the
-				// list.
-				return Collections.unmodifiableCollection(Arrays.asList(tempAdapters));
-				// return Arrays.asList(newAdapters);
-			}
-		}
-		else
-			return Collections.EMPTY_LIST;
-	}
-
-	private long getAdapterTimeCriteria() {
-		// to "re-get" the property each time is a little awkward, but we
-		// do it that way to avoid adding instance variable just for
-		// debugging.
-		// This method should only be called if debugAdapterNotifcationTime
-		// is true.
-		final String criteriaStr = Platform.getDebugOption("org.eclipse.wst.sse.core/dom/adapter/notification/time/criteria"); //$NON-NLS-1$
-		long criteria = -1;
-		if (criteriaStr != null) {
-			try {
-				criteria = Long.parseLong(criteriaStr);
-			}
-			catch (NumberFormatException e) {
-				// catch to be sure we don't burb in notification loop,
-				// but ignore, since just a debug aid
-			}
-		}
-		return criteria;
-	}
-
-	public INodeAdapter getExistingAdapter(Object type) {
-		INodeAdapter result = null;
-		for (int i = 0; i < adapterCount; i++) {
-			INodeAdapter a = fAdapters[i];
-			if (a.isAdapterForType(type)) {
-				result = a;
-				break;
-			}
-		}
-		// if we didn't find one in our list,
-		// return the null result
-		return result;
-	}
-
-	abstract public FactoryRegistry getFactoryRegistry();
-
-	public void notify(int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-
-		if (fAdapters != null) {
-			int localAdapterCount = 0;
-			INodeAdapter[] localAdapters = null;
-
-			// lock object while making local assignments
-			synchronized (this) {
-				localAdapterCount = adapterCount;
-				localAdapters = new INodeAdapter[localAdapterCount];
-				System.arraycopy(fAdapters, 0, localAdapters, 0, localAdapterCount);
-			}
-
-			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$
-					}
-				}
-				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$
-					}
-				}
-
-			}
-		}
-	}
-
-	public synchronized void removeAdapter(INodeAdapter a) {
-		if (fAdapters == null || a == null)
-			return;
-		int newIndex = 0;
-		INodeAdapter[] newAdapters = new INodeAdapter[fAdapters.length];
-		int oldAdapterCount = adapterCount;
-		boolean found = false;
-		for (int oldIndex = 0; oldIndex < oldAdapterCount; oldIndex++) {
-			INodeAdapter candidate = fAdapters[oldIndex];
-			if (a == candidate) {
-				adapterCount--;
-				found = true;
-			}
-			else
-				newAdapters[newIndex++] = fAdapters[oldIndex];
-		}
-		if (found)
-			fAdapters = newAdapters;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/DocumentChanged.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/DocumentChanged.java
deleted file mode 100644
index f0987dc..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/DocumentChanged.java
+++ /dev/null
@@ -1,61 +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.sse.core.internal.provisional;
-
-import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-public class DocumentChanged extends ModelLifecycleEvent {
-	private IStructuredDocument fNewDocument;
-
-	private IStructuredDocument fOldDocument;
-
-	protected DocumentChanged() {
-
-		super(ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED);
-
-	}
-
-	protected DocumentChanged(int additionalType, IStructuredModel model) {
-
-		super(model, ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED | additionalType);
-
-	}
-
-	public DocumentChanged(int additionalType, IStructuredModel model, IStructuredDocument oldDocument, IStructuredDocument newDocument) {
-
-		this(additionalType, model);
-		fOldDocument = oldDocument;
-		fNewDocument = newDocument;
-	}
-
-	public IStructuredDocument getNewDocument() {
-
-		return fNewDocument;
-	}
-
-	public IStructuredDocument getOldDocument() {
-
-		return fOldDocument;
-	}
-
-	void setNewDocument(IStructuredDocument newDocument) {
-
-		fNewDocument = newDocument;
-	}
-
-	void setOldDocument(IStructuredDocument oldDocument) {
-
-		fOldDocument = oldDocument;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLifecycleListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLifecycleListener.java
deleted file mode 100644
index a0b7e97..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLifecycleListener.java
+++ /dev/null
@@ -1,27 +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.sse.core.internal.provisional;
-
-import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
-
-/**
- * This is an early version of a class that may change over the next few
- * milestones.
- */
-
-public interface IModelLifecycleListener {
-
-	void processPostModelEvent(ModelLifecycleEvent event);
-
-	void processPreModelEvent(ModelLifecycleEvent event);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLoader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLoader.java
deleted file mode 100644
index ccbff88..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLoader.java
+++ /dev/null
@@ -1,87 +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.sse.core.internal.provisional;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-/**
- * Responsible for creating a new Model from a resource, or as a new, empty
- * instance.
- * 
- */
-public interface IModelLoader {
-	/**
-	 * This method should perform all the model initialization required before
-	 * it contains content, namely, it should call newModel, the
-	 * createNewStructuredDocument(), then setAdapterFactories. (this is
-	 * tentative)
-	 */
-	IStructuredModel createModel();
-
-	/**
-	 * Method createModel. Creates a new model based on old one.
-	 * 
-	 * @param oldModel
-	 * @return IStructuredModel
-	 */
-	IStructuredModel createModel(IStructuredModel oldModel);
-
-	/**
-	 * This method must return those factories which must be attached to the
-	 * structuredModel before content is applied.
-	 */
-	List getAdapterFactories();
-
-	void load(IFile file, IStructuredModel model) throws IOException, CoreException;
-
-	void load(InputStream inputStream, IStructuredModel model, EncodingRule encodingRule) throws IOException;
-
-	void load(String filename, InputStream inputStream, IStructuredModel model, String encodingName, String lineDelimiter) throws IOException;
-
-	IModelLoader newInstance();
-
-	/**
-	 * This method should always return an new, empty Structured Model
-	 * appropriate for itself.
-	 */
-	IStructuredModel newModel();
-
-	IStructuredModel reinitialize(IStructuredModel model);
-
-	/**
-	 * This method should get a fresh copy of the data, and repopulate the
-	 * models ... normally by a call to setText on the structuredDocument, for
-	 * StructuredModels. This method is needed in some cases where clients are
-	 * sharing a model and then changes canceled. Say for example, one editor
-	 * and several "displays" are sharing a model, if the editor is closed
-	 * without saving changes, then the displays still need a model, but they
-	 * should revert to the original unsaved version.
-	 */
-	void reload(InputStream inputStream, IStructuredModel model);
-
-	/**
-	 * Create a Structured Model with the given StructuredDocument instance as
-	 * its document (instead of a new document instance as well)
-	 */
-	IStructuredModel createModel(IStructuredDocument document, String baseLocation, IModelHandler handler);
-
-}
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
deleted file mode 100644
index 03155a8..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelManager.java
+++ /dev/null
@@ -1,297 +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.sse.core.internal.provisional;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Enumeration;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-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.
- * 
- * Clients can reference, but should not implement.
- * 
- * @see StructuredModelManger
- */
-public interface IModelManager {
-
-	public final static String DUPLICATED_MODEL = "org.eclipse.wst.sse.core.IModelManager.DUPLICATED_MODEL"; //$NON-NLS-1$
-	public final static String UNMANAGED_MODEL = "org.eclipse.wst.sse.core.IModelManager.UNMANAGED_MODEL"; //$NON-NLS-1$
-
-	/**
-	 * Calculate id provides a common way to determine the id from the input
-	 * ... needed to get and save the model. It is a simple class utility, but
-	 * is an instance method so can be accessed via interface.
-	 */
-	public String calculateId(IFile file);
-
-	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".
-	 */
-	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.
-	 * 
-	 */
-	IStructuredDocument createNewStructuredDocumentFor(IFile iFile) throws ResourceAlreadyExists, IOException, CoreException;
-
-	/**
-	 * 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.
-	 */
-	IStructuredDocument createStructuredDocumentFor(IFile iFile) throws IOException, CoreException;
-
-	/**
-	 * Conveience 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.
-	 */
-	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;
-
-	IStructuredDocument createStructuredDocumentFor(String filename, InputStream inputStream, URIResolver resolver, String ianaEncodingName) throws IOException;
-
-	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.
-	 */
-	IStructuredModel createUnManagedStructuredModelFor(IFile iFile) throws IOException, CoreException;
-
-	/**
-	 * Conveience method. It depends on the loaders newModel method to return
-	 * an appropriate StrucuturedModel appropriately initialized.
-	 */
-	IStructuredModel createUnManagedStructuredModelFor(String contentTypeId);
-
-	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.
-	 */
-	IStructuredModel getExistingModelForEdit(IDocument document);
-
-	public IStructuredModel getExistingModelForEdit(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.
-	 */
-	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.
-	 */
-	IStructuredModel getExistingModelForRead(IDocument document);
-
-	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.
-	 */
-	public IStructuredModel getExistingModelForRead(Object id);
-
-	public Enumeration getExistingModelIds();
-
-	public IStructuredModel getModelForEdit(IFile iFile) throws IOException, CoreException;
-
-	/*
-	 * @deprecated - encoding is handled automatically
-	 */
-	public IStructuredModel getModelForEdit(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
-
-	public IStructuredModel getModelForEdit(IFile iFile, String encoding, String lineDelimiter) throws UnsupportedEncodingException, IOException, CoreException;
-
-	public IStructuredModel getModelForEdit(IStructuredDocument textFileBufferDocument);
-
-	/*
-	 * @deprecated - a URI resolver should be automatically created when
-	 *             needed
-	 */
-	public IStructuredModel getModelForEdit(String id, InputStream inStream, URIResolver resolver) throws UnsupportedEncodingException, IOException;
-
-	public IStructuredModel getModelForRead(IFile iFile) throws IOException, CoreException;
-
-	/*
-	 * @deprecated - encoding is handled automatically
-	 */
-	public IStructuredModel getModelForRead(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
-
-	/*
-	 * @deprecated - encoding and line delimiters are handled automatically
-	 */
-	public IStructuredModel getModelForRead(IFile iFile, String encoding, String lineDelimiter) throws UnsupportedEncodingException, IOException, CoreException;
-
-	public IStructuredModel getModelForRead(IStructuredDocument textFileBufferDocument);
-
-	/*
-	 * @deprecated - a URI resolver should be automatically created when
-	 *             needed
-	 */
-	public IStructuredModel getModelForRead(String filename, InputStream inStream, URIResolver resolver) throws UnsupportedEncodingException, IOException;
-
-	/**
-	 * This method will not create a new model if it already exists ... if
-	 * 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.
-	 */
-	IStructuredModel getNewModelForEdit(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException;
-
-	/**
-	 * This method will not create a new model if it already exists ... if
-	 * 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.
-	 */
-	IStructuredModel getNewModelForRead(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException;
-
-	/**
-	 * This function returns the 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
-	 */
-	int getReferenceCount(Object id);
-
-	/**
-	 * This function returns the 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
-	 */
-	int getReferenceCountForEdit(Object id);
-
-	/**
-	 * This function returns the 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
-	 */
-	int getReferenceCountForRead(Object id);
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model.
-	 * 
-	 * @param id
-	 *            Object The id of the model
-	 */
-	boolean isShared(Object id);
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model.
-	 * 
-	 * @param id
-	 *            Object The id of the model
-	 */
-	boolean isSharedForEdit(Object id);
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model.
-	 * 
-	 * @param id
-	 *            Object The id of the model
-	 */
-	boolean isSharedForRead(Object id);
-
-	/**
-	 * 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
-	 * not to use this function
-	 * 
-	 * @deprecated
-	 */
-	void moveModel(Object oldId, Object newId);
-
-	/**
-	 * This method can be called when the content type of a model changes. Its
-	 * 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
-	 * from xml to dtd), but in practice, the intent of this API is to return
-	 * the same instance, just using different handlers, adapter factories,
-	 * etc.
-	 */
-	IStructuredModel reinitialize(IStructuredModel model) throws IOException;
-
-	/**
-	 * This is similar to the getModel method, except this method does not use
-	 * the cached version, but forces the cached version to be replaced with a
-	 * fresh, unchanged version. Note: this method does not change any
-	 * reference counts. Also, if there is not already a cached version of the
-	 * model, then this call is essentially ignored (that is, it does not put
-	 * a model in the cache) and returns null.
-	 * 
-	 * @deprecated
-	 */
-	IStructuredModel reloadModel(Object id, InputStream inStream) throws UnsupportedEncodingException;
-
-	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/IModelStateListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelStateListener.java
deleted file mode 100644
index 0ebdd8b..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelStateListener.java
+++ /dev/null
@@ -1,64 +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.sse.core.internal.provisional;
-
-
-
-/**
- * Interface for those wanting to listen to a model's state changing.
- */
-public interface IModelStateListener {
-
-	/**
-	 * A model is about to be changed. This typically is initiated by one
-	 * client of the model, to signal a large change and/or a change to the
-	 * model's ID or base Location. A typical use might be if a client might
-	 * want to suspend processing until all changes have been made.
-	 */
-	void modelAboutToBeChanged(IStructuredModel model);
-
-	/**
-	 * Signals that the changes foretold by modelAboutToBeChanged have been
-	 * made. A typical use might be to refresh, or to resume processing that
-	 * was suspended as a result of modelAboutToBeChanged.
-	 */
-	void modelChanged(IStructuredModel model);
-
-	/**
-	 * Notifies that a model's dirty state has changed, and passes that state
-	 * in isDirty. A model becomes dirty when any change is made, and becomes
-	 * not-dirty when the model is saved.
-	 */
-	void modelDirtyStateChanged(IStructuredModel model, boolean isDirty);
-
-	/**
-	 * A modelDeleted means the underlying resource has been deleted. The
-	 * model itself is not removed from model management until all have
-	 * released it. Note: baseLocation is not (necessarily) changed in this
-	 * event, but may not be accurate.
-	 */
-	void modelResourceDeleted(IStructuredModel model);
-
-	/**
-	 * A model has been renamed or copied (as in saveAs..). In the renamed
-	 * case, the two paramenters are the same instance, and only contain the
-	 * new info for id and base location.
-	 */
-	void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel);
-
-	void modelAboutToBeReinitialized(IStructuredModel structuredModel);
-
-	void modelReinitialized(IStructuredModel structuredModel);
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapter.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapter.java
deleted file mode 100644
index a81418e..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapter.java
+++ /dev/null
@@ -1,43 +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.sse.core.internal.provisional;
-
-/**
- * This interface allows nodes to be adapted.
- * 
- * The main difference between this type of adapter (IAdaptable) and base
- * adapter is that these adapters are notified of changes.
- * 
- * @plannedfor 1.0
- */
-
-public interface INodeAdapter {
-
-	/**
-	 * The infrastructure calls this method to determine if the adapter is
-	 * appropriate for 'type'. Typically, adapters return true based on
-	 * identity comparison to 'type', but this is not required, that is, the
-	 * decision can be based on complex logic.
-	 * 
-	 */
-	boolean isAdapterForType(Object type);
-
-	/**
-	 * Sent to adapter when notifier changes. Each notifier is responsible for
-	 * defining specific eventTypes, feature changed, etc.
-	 * 
-	 * ISSUE: may be more evolvable if the argument was one big 'notifier
-	 * event' instance.
-	 */
-	void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapterFactory.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapterFactory.java
deleted file mode 100644
index 3967c48..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapterFactory.java
+++ /dev/null
@@ -1,76 +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.sse.core.internal.provisional;
-
-/**
- * INodeNotifiers can be adapted by INodeAdapters. This factory interface
- * provides a way to provide factories which are invoked by the infrastructure
- * to manage this process, from creating, to adapting, to releasing, if
- * required.
- * 
- * @plannedfor 1.0
- * 
- */
-public interface INodeAdapterFactory {
-
-	/**
-	 * The primary purpose of an adapter factory is to create an adapter and
-	 * associate it with an INodeNotifier. This adapt method Method that
-	 * returns the adapter associated with the given object. The
-	 * implementation of this method should call addAdapter on the adapted
-	 * object with the correct instance of the adapter, if appropriate.
-	 * 
-	 * Note: the instance of the adapter returned may be a singleton or not
-	 * ... depending on the needs of the INodeAdapter ... but in general it is
-	 * recommended for an adapter to be stateless, so the efficiencies of a
-	 * singleton can be gained.
-	 * 
-	 * @param object
-	 *            the node notifier to be adapted
-	 */
-	INodeAdapter adapt(INodeNotifier object);
-
-	/**
-	 * Unlike clone, this method may or may not return the same instance, such
-	 * as in the case where the IAdapterFactory is intended to be a singleton.
-	 * 
-	 * @return an instance of this adapter factory.
-	 */
-	public INodeAdapterFactory copy();
-
-	/**
-	 * isFactoryForType is called by infrastructure to decide if this adapter
-	 * factory is apporiate to use for an adapter request that specifies
-	 * 'type'.
-	 * 
-	 * @param type -
-	 *            same object used to identify/request adapters.
-	 * @return true if factory is appropriate for type, false otherwise.
-	 */
-	boolean isFactoryForType(Object type);
-
-	/**
-	 * release is called by infrastructure when the factory registry is
-	 * released (which is done when a structured model is released). This
-	 * intened for the factory to be allowed to clean up any state information
-	 * it may have.
-	 * 
-	 * Note: while not recommended, due to performance reasons, if individual
-	 * adapters need some cleanup (or need to be released) it is (typically)
-	 * the responsibility of the adapter factory to track them, and initiate
-	 * what ever clean up is needed. In other works, cleanup at the adatper
-	 * level is not provided by infrastructure.
-	 */
-	public void release();
-
-}
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
deleted file mode 100644
index 13103b3..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeNotifier.java
+++ /dev/null
@@ -1,103 +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.sse.core.internal.provisional;
-
-
-
-import java.util.Collection;
-
-/**
- * INodeNotifiers and INodeAdapters form a collaboration that allows clients
- * to use the typical adapter pattern but with notification added, that is,
- * client's adapters will be notified when the nodeNotifier changes.
- * 
- * @plannedfor 1.0
- */
-
-public interface INodeNotifier {
-
-	/**
-	 * The change represents a non-structural change, sent to node notifier's
-	 * parent.
-	 */
-	static final int CHANGE = 1;
-	/**
-	 * The change represents an add event.
-	 */
-	static final int ADD = 2;
-
-	/**
-	 * The change represents a remove event.
-	 */
-	static final int REMOVE = 3;
-
-	/**
-	 * The change represents a structural change, sent to least-common parent
-	 * of node notifiers involved in the structural change
-	 */
-	static final int STRUCTURE_CHANGED = 4;
-
-	/**
-	 * The change represents a notification to parent notifier than its
-	 * contents have changed.
-	 */
-	static final int CONTENT_CHANGED = 5;
-
-
-	/**
-	 * NOT API: these strings are for printing, such as during debuging
-	 */
-	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$
-
-
-	/**
-	 * Add an adapter of this notifier.
-	 * 
-	 * @param adapter
-	 *            the adapter to be added
-	 * 
-	 */
-	void addAdapter(INodeAdapter adapter);
-
-	/**
-	 * Return an exisiting adapter of type "type" or if none found create a
-	 * new adapter using a registered adapter factory
-	 */
-	INodeAdapter getAdapterFor(Object type);
-
-	/**
-	 * Return a read-only Collection of the Adapters to this notifier.
-	 * 
-	 * @return collection of adapters.
-	 */
-	Collection getAdapters();
-
-	/**
-	 * Return an exisiting adapter of type "type" or null if none found
-	 */
-	INodeAdapter getExistingAdapter(Object type);
-
-	/**
-	 * sent to adapter when its nodeNotifier changes.
-	 */
-	void notify(int eventType, Object changedFeature, Object oldValue, Object newValue, int pos);
-
-	/**
-	 * Remove an adapter of this notifier. If the adapter does not exist for
-	 * this node notifier, this request is ignored.
-	 * 
-	 * @param adapter
-	 *            the adapter to remove
-	 */
-	void removeAdapter(INodeAdapter adapter);
-}
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
deleted file mode 100644
index cc789db..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IStructuredModel.java
+++ /dev/null
@@ -1,390 +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.sse.core.internal.provisional;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-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.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-
-
-/**
- * IStructuredModel's are mainly interesting by their extensions and
- * implementers. The main purposed of this abstraction it to provide a common
- * way to manage models that have an associated structured documnet.
- * 
- * @plannedfor 1.0
- * 
- * ISSUE: this interface needs ton of cleanup!
- */
-public interface IStructuredModel extends IAdaptable {
-
-
-	/**
-	 * 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 listeners is
-	 * sent only once.
-	 * 
-	 * Note that the client who is making these changes has the responsibility
-	 * to restore the model's 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.
-	 * 
-	 * This method is a matched pair to changedModel, and must be called
-	 * before changedModel. A client should never call changedModel without
-	 * calling aboutToChangeModel first nor call aboutToChangeModel without
-	 * calling changedModel later from the same Thread.
-	 */
-	void aboutToChangeModel();
-
-	void addModelLifecycleListener(IModelLifecycleListener listener);
-
-	void addModelStateListener(IModelStateListener listener);
-
-	/**
-	 * Begin recording undo transactions.
-	 */
-	void beginRecording(Object requester);
-
-	/**
-	 * Begin recording undo transactions.
-	 */
-	void beginRecording(Object requester, int cursorPosition, int selectionLength);
-
-	/**
-	 * Begin recording undo transactions.
-	 */
-	void beginRecording(Object requester, String label);
-
-	/**
-	 * Begin recording undo transactions.
-	 */
-	void beginRecording(Object requester, String label, int cursorPosition, int selectionLength);
-
-	/**
-	 * Begin recording undo transactions.
-	 */
-	void beginRecording(Object requester, String label, String description);
-
-	/**
-	 * Begin recording undo transactions.
-	 */
-	void beginRecording(Object requester, String label, String description, int cursorPosition, int selectionLength);
-
-	/**
-	 * 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.
-	 * 
-	 */
-	void changedModel();
-
-	long computeModificationStamp(IResource resource);
-
-	/**
-	 * @deprecated
-	 */
-	IStructuredModel copy(String id) throws ResourceInUse, ResourceAlreadyExists;
-
-	/**
-	 * Disable undo management.
-	 */
-	void disableUndoManagement();
-
-	/**
-	 * Enable undo management.
-	 */
-	void enableUndoManagement();
-
-	/**
-	 * End recording undo transactions.
-	 */
-	void endRecording(Object requester);
-
-	/**
-	 * End recording undo transactions.
-	 */
-	void endRecording(Object requester, int cursorPosition, int selectionLength);
-
-	/**
-	 * This is a client-defined value for what that client (and/or loader)
-	 * considers the "base" of the structured model. Frequently the location
-	 * is either a workspace root-relative path of a workspace resource or an
-	 * absolute path in the local file system.
-	 */
-	String getBaseLocation();
-
-	/**
-	 * @return The associated content type identifier (String) for this model.
-	 */
-	String getContentTypeIdentifier();
-
-	/**
-	 * 
-	 * @return The model's FactoryRegistry. A model is not valid without one.
-	 */
-	FactoryRegistry getFactoryRegistry();
-
-	/**
-	 * The id is the id that the model manager uses to identify this model
-	 */
-	String getId();
-
-	/**
-	 * 
-	 */
-	IndexedRegion getIndexedRegion(int offset);
-
-	/**
-	 * ContentTypeDescription provides an object that describes what the
-	 * content of the file is, e.g. HTML, XML, etc. Compare with
-	 * getExternalFileTypeDescription. Though they both return objects of type
-	 * ContentTypeDescription, the external file type is intended to denote
-	 * JSP, regardless of what the content of that JSP file is. Even for a JSP
-	 * file, the ContentTypeDescription will be set according to that file's
-	 * "internal" contents.
-	 * 
-	 * @return ContentTypeDescription
-	 */
-	IModelHandler getModelHandler();
-
-	IModelManager getModelManager();
-
-	/**
-	 * This function returns the reference count of underlying model.
-	 * 
-	 * @param id
-	 *            Object The id of the model TODO: try to refine the design
-	 *            not to use this function
-	 */
-	int getReferenceCount();
-
-	/**
-	 * This function returns the reference count of underlying model.
-	 * 
-	 * @param id
-	 *            Object The id of the model TODO: try to refine the design
-	 *            not to use this function
-	 */
-	int getReferenceCountForEdit();
-
-	/**
-	 * This function returns the reference count of underlying model.
-	 * 
-	 * @param id
-	 *            Object The id of the model TODO: try to refine the design
-	 *            not to use this function
-	 */
-	int getReferenceCountForRead();
-
-	Object getReinitializeStateData();
-
-	/**
-	 * Get URI resolution helper
-	 */
-	URIResolver getResolver();
-
-	IStructuredDocument getStructuredDocument();
-
-	/**
-	 * modification date of underlying resource, when this model was open, or
-	 * last saved. (Note: for this version, the client must manage the
-	 * accuracy of this data)
-	 */
-	long getSynchronizationStamp();
-
-	/**
-	 * Get undo manager.
-	 */
-	IStructuredTextUndoManager getUndoManager();
-
-	/**
-	 * 
-	 */
-	boolean isDirty();
-
-	/**
-	 * This method can be called to determine if the model is within a
-	 * "aboutToChange" and "changed" sequence.
-	 */
-	public boolean isModelStateChanging();
-
-	/**
-	 * 
-	 */
-	boolean isNew();
-
-	boolean isReinitializationNeeded();
-
-	/**
-	 * This is a combination of if the model is dirty and if the model is
-	 * shared for write access. The last writer as the responsibility to be
-	 * sure the user is prompted to save.
-	 */
-	public boolean isSaveNeeded();
-
-	/**
-	 * This function returns true if either isSharedForRead or isSharedForEdit
-	 * is true.
-	 */
-	boolean isShared();
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model.
-	 */
-	boolean isSharedForEdit();
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model.
-	 */
-	boolean isSharedForRead();
-
-	/**
-	 * newInstance is similar to clone, except that the newInstance contains
-	 * no content. Its purpose is so clients can get a temporary, unmanaged,
-	 * model of the same "type" as the original. Note: the client may still
-	 * need to do some intialization of the model returned by newInstance,
-	 * depending on desired use. For example, the only factories in the
-	 * newInstance are those that would be normally be created for a model of
-	 * the given contentType. Others are not copied automatically, and if
-	 * desired, should be added by client.
-	 */
-	IStructuredModel newInstance() throws IOException;
-
-	/**
-	 * Performs a reinit procedure. For this model. Note for future: there may
-	 * be a day where the model returned from this method is a different
-	 * instance than the instance it was called on. This will occur when there
-	 * is full support for "save as" type functions, where the model could
-	 * theoretically change completely.
-	 */
-	IStructuredModel reinit() throws IOException;
-
-	/**
-	 * This function allows the model to free up any resources it might be
-	 * using. In particular, itself, as stored in the IModelManager.
-	 * 
-	 */
-	void releaseFromEdit();
-
-	/**
-	 * This function allows the model to free up any resources it might be
-	 * using. In particular, itself, as stored in the IModelManager.
-	 * 
-	 */
-	void releaseFromRead();
-
-	/**
-	 * This function replenishes the model with the resource without saving
-	 * any possible changes. It is used when one editor may be closing, and
-	 * specifially says not to save the model, but another "display" of the
-	 * model still needs to hang on to some model, so needs a fresh copy.
-	 * 
-	 * Only valid for use with managed models.
-	 */
-	IStructuredModel reload(InputStream inputStream) throws IOException;
-
-	void removeModelLifecycleListener(IModelLifecycleListener listener);
-
-	void removeModelStateListener(IModelStateListener listener);
-
-	/**
-	 * A method that modififies the model's synchonization stamp to match the
-	 * resource. Turns out there's several ways of doing it, so this ensures a
-	 * common algorithm.
-	 */
-	void resetSynchronizationStamp(IResource resource);
-
-	void resourceDeleted();
-
-	void resourceMoved(IStructuredModel newModel);
-
-	void save() throws UnsupportedEncodingException, IOException, CoreException;
-
-	void save(EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
-
-	void save(IFile iFile) throws UnsupportedEncodingException, IOException, CoreException;
-
-	void save(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
-
-	void save(OutputStream outputStream) throws UnsupportedEncodingException, IOException, CoreException;
-
-	void setBaseLocation(String newBaseLocation);
-
-	public void setDirtyState(boolean dirtyState);
-
-	void setFactoryRegistry(FactoryRegistry registry);
-
-	/**
-	 * The id is the id that the model manager uses to identify this model
-	 */
-	void setId(String id) throws ResourceInUse;
-
-	void setModelHandler(IModelHandler modelHandler);
-
-	void setModelManager(IModelManager modelManager);
-
-	public void setNewState(boolean newState);
-
-	/**
-	 * Sets a "flag" that reinitialization is needed.
-	 */
-	void setReinitializeNeeded(boolean b);
-
-	/**
-	 * Holds any data that the reinit procedure might find useful in
-	 * reinitializing the model. This is handy, since the reinitialization may
-	 * not take place at once, and some "old" data may be needed to properly
-	 * undo previous settings. Note: the parameter was intentially made to be
-	 * of type 'Object' so different models can use in different ways.
-	 */
-	void setReinitializeStateData(Object object);
-
-	/**
-	 * Set the URI resolution helper
-	 */
-	void setResolver(URIResolver uriResolver);
-
-	void setStructuredDocument(IStructuredDocument structuredDocument);
-
-	/**
-	 * Set undo manager.
-	 */
-	void setUndoManager(IStructuredTextUndoManager undoManager);
-}
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
deleted file mode 100644
index 7bf5dca..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IndexedRegion.java
+++ /dev/null
@@ -1,74 +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.sse.core.internal.provisional;
-
-
-
-/**
- * This type is used to indicate positions and lengths in source. Notice that
- * while getEndOffset and getLength are redundant, given that
- * 
- * <pre>
- * <code>
- *          getEndOffset() == getStartOffset() + getLength(); 
- * </code>
- * </pre>
- * 
- * we provide (require) both since in some cases implementors may be able to
- * provide one or the other more efficiently.
- * 
- * Note: it is not part of the API contract that implementors of IndexedRegion --
- * as a whole collection for a particular source -- must completely cover the
- * original source. They currently often do, so thought I'd mention explicitly
- * this may not always be true.
- * 
- * @plannedfor 1.0
- */
-public interface IndexedRegion {
-
-	/**
-	 * Can be used to test if the indexed regions contains the test position.
-	 * 
-	 * @param testPosition
-	 * @return true if test position is greater than or equal to start offset
-	 *         and less than start offset plus length.
-	 */
-	boolean contains(int testPosition);
-
-	/**
-	 * Can be used to get end offset of source text, relative to beginning of
-	 * documnt. Implementers should return -1 if, or some reason, the region
-	 * is not valid.
-	 * 
-	 * @return endoffset
-	 */
-	int getEndOffset();
-
-	/**
-	 * Can be used to get source postion of beginning of indexed region.
-	 * Implementers should return -1 if, or some reason, the region is not
-	 * valid.
-	 * 
-	 * @return int position of start of index region.
-	 */
-	int getStartOffset();
-
-	/**
-	 * Can be used to get the length of the source text. Implementers should
-	 * return -1 if, or some reason, the region is not valid.
-	 * 
-	 * @return int position of length of index region.
-	 */
-	int getLength();
-
-}
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
deleted file mode 100644
index be5d56f..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java
+++ /dev/null
@@ -1,71 +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
- *     
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.provisional;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.model.ModelManagerImpl;
-import org.osgi.framework.Bundle;
-
-/**
- * Class to allow access to ModelManager. Not intended to be subclassed.
- * 
- * @plannedfor 1.0
- */
-final public class StructuredModelManager {
-	/**
-	 * Do not allow instances to be created.
-	 */
-	private StructuredModelManager() {
-		super();
-	}
-
-	/**
-	 * Provides access to the instance of IModelManager. Returns null if model
-	 * manager can not be created or is not valid (such as, when workbench is
-	 * shutting down).
-	 * 
-	 * @return IModelManager - returns the one model manager for structured
-	 *         model
-	 */
-	public static IModelManager getModelManager() {
-		boolean isReady = false;
-		IModelManager modelManager = null;
-		while (!isReady) {
-			Bundle localBundle = Platform.getBundle(SSECorePlugin.ID);
-			int state = localBundle.getState();
-			if (state == Bundle.ACTIVE) {
-				isReady = true;
-				// getInstance is a synchronized static method.
-				modelManager = ModelManagerImpl.getInstance();
-			}
-			else if (state == Bundle.STARTING) {
-				try {
-					Thread.sleep(100);
-				}
-				catch (InterruptedException e) {
-					// ignore, just loop again
-				}
-			}
-			else if (state == Bundle.STOPPING || state == Bundle.UNINSTALLED) {
-				isReady = true;
-				modelManager = null;
-			}
-			else {
-				// not sure about other states, 'resolved', 'installed'
-				isReady = true;
-				modelManager = null;
-			}
-		}
-		return modelManager;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IEncodedDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IEncodedDocument.java
deleted file mode 100644
index 48194ae..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IEncodedDocument.java
+++ /dev/null
@@ -1,58 +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.sse.core.internal.provisional.document;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-
-/**
- * This interface is strictly to define important "document properties" not
- * found in IDocument, but not central to "StructuredDocument".
- * 
- * Its not to be be implmented by clients.
- * 
- * @plannedfor 1.0
- */
-
-public interface IEncodedDocument extends IDocument {
-
-	/**
-	 * Returns the encoding memento for this document.
-	 * 
-	 * @return the encoding memento for this document.
-	 */
-	EncodingMemento getEncodingMemento();
-
-	/**
-	 * Returns the preferred line delimiter for this document.
-	 */
-	String getPreferredLineDelimiter();
-
-	/**
-	 * Sets the encoding memento for this document.
-	 * 
-	 * Is not to be called by clients, only document creation classes.
-	 * 
-	 * @param localEncodingMemento
-	 */
-	void setEncodingMemento(EncodingMemento localEncodingMemento);
-
-	/**
-	 * Sets the preferredLineDelimiter. Is not to be called by clients, only
-	 * document creation classes.
-	 * 
-	 * @param probableLineDelimiter
-	 */
-	void setPreferredLineDelimiter(String probableLineDelimiter);
-
-}
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
deleted file mode 100644
index 4d7dd6f..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IStructuredDocumentProposed.java
+++ /dev/null
@@ -1,223 +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.sse.core.internal.provisional.document;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.Position;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
-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.IStructuredDocumentRegionList;
-
-
-/**
- * A IStructuredDocument is a collection of StructuredDocumentRegions. It's
- * often called a "flat model" because its does contain some structural
- * information, but not very much, usually, at most, a few levels of
- * containment.
- * 
- * Clients should not implement.
- * 
- * @plannedfor 1.0
- */
-public interface IStructuredDocumentProposed extends IDocument, IDocumentExtension, IAdaptable {
-
-	/**
-	 * The document changing listeners receives the same events as the
-	 * document listeners, but the difference is the timing and
-	 * synchronization of data changes and notifications.
-	 */
-	void addDocumentChangingListener(IDocumentListener listener);
-
-	/**
-	 * this API ensures that any portion of the document within startOff to
-	 * length is not readonly (that is, that its editable). Note that if the
-	 * range overlaps with other readonly regions, those other readonly
-	 * regions will be adjusted.
-	 * 
-	 * @param startOffset
-	 * @param length
-	 */
-	void clearReadOnly(int startOffset, int length);
-
-	/**
-	 * returns true if any portion of startOffset to length is readonly
-	 * 
-	 * @param startOffset
-	 * @param length
-	 * @return
-	 */
-	boolean containsReadOnly(int startOffset, int length);
-
-	/**
-	 * Returns the region contained by offset.
-	 * 
-	 * @param offset
-	 * @return
-	 */
-	IStructuredDocumentRegion getRegionAtCharacterOffset(int offset);
-
-	/**
-	 * Resturns a list of the structured document regions.
-	 * 
-	 * Note: possibly expensive call, not to be used casually.
-	 * 
-	 * @return a list of the structured document regions.
-	 */
-	IStructuredDocumentRegionList getRegionList();
-
-
-	/**
-	 * Returns the text of this document.
-	 * 
-	 * Same as 'get' in super class, added for descriptiveness.
-	 * 
-	 * @return the text of this document.
-	 */
-	String getText();
-
-	/**
-	 * causes that portion of the document from startOffset to length to be
-	 * marked as readonly. Note that if this range overlaps with some other
-	 * region with is readonly, the regions are effectivly combined.
-	 * 
-	 * @param startOffset
-	 * @param length
-	 */
-	void makeReadOnly(int startOffset, int length);
-
-	/**
-	 * newInstance is similar to clone, except it contains no data. One
-	 * important thing to duplicate is the parser, with the parser correctly
-	 * "cloned", including its tokeninzer, block tags, etc.
-	 * 
-	 * NOTE: even after obtaining a 'newInstance' the client may have to do
-	 * some initialization, for example, it may need to add its own model
-	 * listeners. Or, as another example, if the IStructuredDocument has a
-	 * parser of type StructuredDocumentRegionParser, then the client may need
-	 * to add its own StructuredDocumentRegionHandler to that parser, if it is
-	 * in fact needed.
-	 */
-	IStructuredDocumentProposed newInstance();
-
-	/**
-	 * The document changing listeners receives the same events as the
-	 * document listeners, but the difference is the timing and
-	 * synchronization of data changes and notifications.
-	 */
-	void removeDocumentChangingListener(IDocumentListener listener);
-
-	/**
-	 * One of the APIs to manipulate the IStructuredDocument.
-	 * 
-	 * replaceText replaces the text from oldStart to oldEnd with the new text
-	 * found in the requestedChange string. If oldStart and oldEnd are equal,
-	 * it is an insertion request. If requestedChange is null (or empty) it is
-	 * a delete request. Otherwise it is a replace request.
-	 * 
-	 * Similar to 'replace' in super class.
-	 */
-	StructuredDocumentEvent replaceText(Object requester, int oldStart, int replacementLength, String requestedChange);
-
-	/**
-	 * Note, same as replaceText API, but will allow readonly areas to be
-	 * replaced. This method is not to be called by clients, only
-	 * infrastructure. For example, one case where its ok is with undo
-	 * operations (since, presumably, if user just did something that
-	 * happended to involve some inserting readonly text, they should normally
-	 * be allowed to still undo that operation. There might be other cases
-	 * where its used to give the user a choice, e.g. "you are about to
-	 * overwrite read only portions, do you want to continue".
-	 */
-	StructuredDocumentEvent overrideReadOnlyreplaceText(Object requester, int oldStart, int replacementLength, String requestedChange);
-
-	/**
-	 * One of the APIs to manipulate the IStructuredDocument in terms of Text.
-	 * 
-	 * The setText method replaces all text in the model.
-	 * 
-	 * @param requester -
-	 *            the object requesting the document be created.
-	 * @param allText -
-	 *            all the text of the document.
-	 * @return NewDocumentEvent - besides causing this event to be sent to
-	 *         document listeners, the event is returned.
-	 */
-	NewDocumentEvent setText(Object requester, String allText);
-
-	/**
-	 * Returns the encoding memento for this document.
-	 * 
-	 * @return the encoding memento for this document.
-	 */
-	EncodingMemento getEncodingMemento();
-
-	/**
-	 * Returns the line delimiter detected when this document was read from
-	 * storage.
-	 * 
-	 * @return line delimiter detected when this document was read from
-	 *         storage.
-	 */
-	String getDetectedLineDelimiter();
-
-	/**
-	 * Sets the encoding memento for this document.
-	 * 
-	 * Is not to be called by clients, only document creation classes.
-	 * 
-	 * @param localEncodingMemento
-	 */
-	void setEncodingMemento(EncodingMemento localEncodingMemento);
-
-	/**
-	 * Sets the detected line delimiter when the document was read. Is not to
-	 * be called by clients, only document creation classes.
-	 * 
-	 * @param probableLineDelimiter
-	 */
-	void setDetectedLineDelimiter(String probableLineDelimiter);
-
-	/**
-	 * This function provides a way for clients to compare a string with a
-	 * region of the documnet, without having to retrieve (create) a string
-	 * from the document, thus more efficient of lots of comparisons being
-	 * done.
-	 * 
-	 * @param ignoreCase -
-	 *            if true the characters are compared based on identity. If
-	 *            false, the string are compared with case accounted for.
-	 * @param testString -
-	 *            the string to compare.
-	 * @param documentOffset -
-	 *            the document in the offset to start the comparison.
-	 * @param length -
-	 *            the length in the document to compare (Note: technically,
-	 *            clients could just provide the string, and we could infer
-	 *            the length from the string supplied, but this leaves every
-	 *            client to correctly not even ask us if the the string length
-	 *            doesn't match the expected length, so this is an effort to
-	 *            maximize performance with correct code.
-	 * @return true if matches, false otherwise.
-	 */
-	boolean stringMatches(boolean ignoreCase, String testString, int documentOffset, int length);
-	
-	Position createPosition(int offset, String category, String type);
-	
-	Position createPosition(int offset, int length, String category, String type);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/AboutToBeChangedEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/AboutToBeChangedEvent.java
deleted file mode 100644
index 583e75d..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/AboutToBeChangedEvent.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.sse.core.internal.provisional.events;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * This event is send to structured document listeners. It is perfectly
- * analagous to its corresponding jface DocumentEvent and is provided simply
- * to allow clients to distinguish the source of the event.
- * 
- * @plannedfor 1.0
- */
-public class AboutToBeChangedEvent extends StructuredDocumentEvent {
-
-
-	/**
-	 * Creates an instance of this event.
-	 * 
-	 * @param document
-	 *            document involved in the change
-	 * @param originalRequester
-	 *            source of original request
-	 * @param changes
-	 *            the text changes
-	 * @param offset
-	 *            offset of request
-	 * @param lengthToReplace
-	 *            amount, if any, of replaced text
-	 */
-	public AboutToBeChangedEvent(IStructuredDocument document, Object originalRequester, String changes, int offset, int lengthToReplace) {
-		super(document, originalRequester, changes, offset, lengthToReplace);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IModelAboutToBeChangedListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IModelAboutToBeChangedListener.java
deleted file mode 100644
index 2af8184..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IModelAboutToBeChangedListener.java
+++ /dev/null
@@ -1,26 +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.sse.core.internal.provisional.events;
-
-
-
-/**
- * Clients can implement this interface, and register with the
- * structuredDocument using addAboutToBeChangedListner to be notified that the
- * structuredDocument is about to be changed, but hasn't been changed at the
- * time this event is fired.
- */
-public interface IModelAboutToBeChangedListener {
-
-	void modelAboutToBeChanged(AboutToBeChangedEvent structuredDocumentEvent);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IStructuredDocumentListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IStructuredDocumentListener.java
deleted file mode 100644
index 8262a01..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IStructuredDocumentListener.java
+++ /dev/null
@@ -1,30 +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.sse.core.internal.provisional.events;
-
-/**
- * @deprecated will be removed since we now subclass DocumentEvent.
- */
-
-public interface IStructuredDocumentListener {
-
-	public void newModel(NewDocumentEvent structuredDocumentEvent);
-
-	public void noChange(NoChangeEvent structuredDocumentEvent);
-
-	public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent);
-
-	public void regionChanged(RegionChangedEvent structuredDocumentEvent);
-
-	public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentContentEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentContentEvent.java
deleted file mode 100644
index 7dbd179..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentContentEvent.java
+++ /dev/null
@@ -1,40 +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.sse.core.internal.provisional.events;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * The NewDocumentContentEvent is fired when an instance of a
- * IStructuredDocument replaces all of its text.
- * 
- * ISSUE: not currently used, but there's still some efficiencies to be had so
- * plan to implement.
- * 
- * @plannedfor 1.0
- */
-public class NewDocumentContentEvent extends NewDocumentEvent {
-	/**
-	 * Creates an instance of this event.
-	 * 
-	 * @param document
-	 *            the document being changed
-	 * @param originalRequester
-	 *            the original requester of the change
-	 */
-	public NewDocumentContentEvent(IStructuredDocument document, Object originalRequester) {
-		super(document, originalRequester);
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentEvent.java
deleted file mode 100644
index bf78ce4..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentEvent.java
+++ /dev/null
@@ -1,68 +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.sse.core.internal.provisional.events;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * The NewDocumentEvent is fired when an instance of a IStructuredDocument
- * sets or replaces all of its text.
- * 
- * ISSUE: need to change so this is used for 'set' only.
- * 
- * @plannedfor 1.0
- */
-public class NewDocumentEvent extends StructuredDocumentEvent {
-
-
-	/**
-	 * Creates a new instance of the NewDocumentEvent.
-	 * 
-	 * @param document
-	 *            being changed
-	 * @param originalRequester
-	 *            source of request
-	 */
-	public NewDocumentEvent(IStructuredDocument document, Object originalRequester) {
-		super(document, originalRequester);
-	}
-
-	/**
-	 * This returns the length of the new document.
-	 * 
-	 * @return int returns the length of the new document.
-	 */
-	public int getLength() {
-		return getStructuredDocument().getLength();
-	}
-
-	/**
-	 * This doesn't mean quite the same thing as the IStructuredDocument
-	 * Events in the super class. It always will return zero.
-	 * 
-	 * @return int for a newDocument, the offset of is always 0
-	 */
-	public int getOffset() {
-		return 0;
-	}
-
-	/**
-	 * For a new document, the text involved is the complete text.
-	 * 
-	 * @return String the text that is the complete text of the documnet.
-	 */
-	public String getText() {
-		String results = getStructuredDocument().getText();
-		return results;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NoChangeEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NoChangeEvent.java
deleted file mode 100644
index 3f5e788..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NoChangeEvent.java
+++ /dev/null
@@ -1,73 +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.sse.core.internal.provisional.events;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * This event is sent if, after analysis, it is found there is no reason to
- * change the structuredDocument. This might occur, for example, if someone
- * pastes in the exact same text that they are replacing, or if someone tries
- * to change a read-only region.
- * 
- * This might be important, for example, if some state variables are set on an
- * "about the change" event. then if there is no change (i.e.no other event is
- * fired), those state variables could reset, or whatever, upon receiving this
- * event.
- * 
- * @plannedfor 1.0
- */
-public class NoChangeEvent extends StructuredDocumentEvent {
-	/**
-	 * NO_CONTENT_CHANGE means that a some text was requested to be replaced
-	 * with identical text, so no change is actually done.
-	 */
-	public final static int NO_CONTENT_CHANGE = 2;
-	/**
-	 * NO_EVENT is used in rare error conditions, when, basically, a request
-	 * to change the document is made before the previous request has
-	 * completed. This event to used so aboutToChange/Changed cycles can
-	 * complete as required, but the document is most likely not modified as
-	 * expected.
-	 */
-	public final static int NO_EVENT = 8;
-	/**
-	 * READ_ONLY_STATE_CHANGE means that the "read only" state of the text was
-	 * changed, not the content itself.
-	 */
-	public final static int READ_ONLY_STATE_CHANGE = 4;
-
-	/**
-	 * set to one of the above detailed reasons for why no change was done.
-	 */
-	public int reason = 0;
-
-	/**
-	 * NoChangeEvent constructor. This event can occur if there was a request
-	 * to modify a document or its properties, but there as not really is no
-	 * change to a document's content.
-	 * 
-	 * @param source
-	 * @param originalSource
-	 *            java.lang.Object
-	 * @param changes
-	 *            java.lang.String
-	 * @param offset
-	 *            int
-	 * @param lengthToReplace
-	 *            int
-	 */
-	public NoChangeEvent(IStructuredDocument source, Object originalSource, String changes, int offset, int lengthToReplace) {
-		super(source, originalSource, changes, offset, lengthToReplace);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionChangedEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionChangedEvent.java
deleted file mode 100644
index 95c935d..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionChangedEvent.java
+++ /dev/null
@@ -1,80 +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.sse.core.internal.provisional.events;
-
-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;
-
-/**
- * This event is used when a document region changes in a non-structural way.
- * Non-structural, that is, as far as the IStructuredDocument is concerned.
- * The whole region, along with the new text is sent, just in case a listener
- * (e.g. a tree model) might make its own determination of what to do, and
- * needs the whole region to act appropriately.
- * 
- * Note: users should not make assumptions about whether the region is
- * literally the same instance or not -- it is currently a different instance
- * that is identical to the old except for the changed region, but this
- * implementation may change.
- * 
- * @plannedfor 1.0
- */
-public class RegionChangedEvent extends StructuredDocumentEvent {
-	private ITextRegion fChangedRegion;
-	private IStructuredDocumentRegion fStructuredDocumentRegion;
-
-	/**
-	 * Creates instance of a RegionChangedEvent.
-	 * 
-	 * @param document
-	 *            the document being changed.
-	 * @param originalRequester
-	 *            the object making the request for the change.
-	 * @param structuredDocumentRegion
-	 *            the containing region
-	 * @param changedRegion
-	 *            the region that has changed.
-	 * @param changes
-	 *            the string representing the change.
-	 * @param offset
-	 *            the offset of the change.
-	 * @param lengthToReplace
-	 *            the length specified to be replaced.
-	 */
-	public RegionChangedEvent(IStructuredDocument document, Object originalRequester, IStructuredDocumentRegion structuredDocumentRegion, ITextRegion changedRegion, String changes, int offset, int lengthToReplace) {
-		super(document, originalRequester, changes, offset, lengthToReplace);
-		fStructuredDocumentRegion = structuredDocumentRegion;
-		fChangedRegion = changedRegion;
-	}
-
-
-	/**
-	 * Returns the text region changed.
-	 * 
-	 * @return the text region changed
-	 */
-	public ITextRegion getRegion() {
-		return fChangedRegion;
-	}
-
-
-	/**
-	 * Returns the document region changed.
-	 * 
-	 * @return the document region changed
-	 */
-	public IStructuredDocumentRegion getStructuredDocumentRegion() {
-		return fStructuredDocumentRegion;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionsReplacedEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionsReplacedEvent.java
deleted file mode 100644
index 21a2e4f..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionsReplacedEvent.java
+++ /dev/null
@@ -1,85 +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.sse.core.internal.provisional.events;
-
-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.ITextRegionList;
-
-/**
- * This event is used when a node's regions change, but the document region
- * itself doesn't. This says nothing about the semantics of the document
- * region, that may still have changed. Also, its assumed/required that all
- * the regions are replaced (even those that may not have changed).
- * 
- * @plannedfor 1.0
- */
-public class RegionsReplacedEvent extends StructuredDocumentEvent {
-	private ITextRegionList fNewRegions;
-	private ITextRegionList fOldRegions;
-	private IStructuredDocumentRegion fStructuredDocumentRegion;
-
-	/**
-	 * Creates an instance of the RegionsReplacedEvent.
-	 * 
-	 * @param document -
-	 *            document being changed.
-	 * @param originalRequester -
-	 *            requester of the change.
-	 * @param structuredDocumentRegion -
-	 *            the region containing the change.
-	 * @param oldRegions -
-	 *            the old Regions being replaced.
-	 * @param newRegions -
-	 *            the new regions being added.
-	 * @param changes -
-	 *            the String representing the change.
-	 * @param offset -
-	 *            the offset of the change.
-	 * @param lengthToReplace -
-	 *            the length of text to replace.
-	 */
-	public RegionsReplacedEvent(IStructuredDocument document, Object originalRequester, IStructuredDocumentRegion structuredDocumentRegion, ITextRegionList oldRegions, ITextRegionList newRegions, String changes, int offset, int lengthToReplace) {
-		super(document, originalRequester, changes, offset, lengthToReplace);
-		fStructuredDocumentRegion = structuredDocumentRegion;
-		fOldRegions = oldRegions;
-		fNewRegions = newRegions;
-	}
-
-	/**
-	 * Returns the new text regions.
-	 * 
-	 * @return the new text regions.
-	 */
-	public ITextRegionList getNewRegions() {
-		return fNewRegions;
-	}
-
-	/**
-	 * Returns the old text regions.
-	 * 
-	 * @return the old text regions.
-	 */
-	public ITextRegionList getOldRegions() {
-		return fOldRegions;
-	}
-
-	/**
-	 * Returns the structured document region.
-	 * 
-	 * @return the structured document region.
-	 */
-	public IStructuredDocumentRegion getStructuredDocumentRegion() {
-		return fStructuredDocumentRegion;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentEvent.java
deleted file mode 100644
index 6fa48cd..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentEvent.java
+++ /dev/null
@@ -1,146 +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.sse.core.internal.provisional.events;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-/**
- * IStructuredDocument events are generated by the IStructuredDocument, after
- * the IStructuredDocument acts on a request. Not intended to be instantiated,
- * except by subclasses in infrastructure. Not intended to be subclassed by
- * clients.
- * 
- * @plannedfor 1.0
- */
-public abstract class StructuredDocumentEvent extends DocumentEvent {
-	private String fDeletedText;
-	private Object fOriginalRequester;
-
-	/**
-	 * There is no public null-arg version of this constructor.
-	 */
-	private StructuredDocumentEvent() {
-		super();
-	}
-
-	/**
-	 * We assume (and require) that an IStructuredDocument's are always the
-	 * source of StructuredDocument events.
-	 * 
-	 * @param document -
-	 *            the document being changed
-	 */
-	private StructuredDocumentEvent(IStructuredDocument document) {
-		super();
-		if (document == null)
-			throw new IllegalArgumentException("null source"); //$NON-NLS-1$
-		fDocument = document;
-		fOriginalRequester = document;
-	}
-
-	/**
-	 * We assume (and require) that an IStructuredDocument's are always the
-	 * source of StructuredDocument events.
-	 * 
-	 * @param document -
-	 *            the document being changed.
-	 * @param originalRequester -
-	 *            the original requester of the change.
-	 */
-	StructuredDocumentEvent(IStructuredDocument document, Object originalRequester) {
-		this(document);
-		fOriginalRequester = originalRequester;
-	}
-
-	/**
-	 * We assume (and require) that an IStructuredDocument's are always the
-	 * source of StructuredDocument events.
-	 * 
-	 * @param document -
-	 *            the document being changed.
-	 * @param originalRequester -
-	 *            the requester of the change.
-	 * @param changes -
-	 *            the String representing the new text
-	 * @param offset -
-	 *            the offset of the change.
-	 * @param lengthToReplace -
-	 *            the length of text to replace.
-	 */
-	StructuredDocumentEvent(IStructuredDocument document, Object originalRequester, String changes, int offset, int lengthToReplace) {
-		this(document);
-		fOriginalRequester = originalRequester;
-		fText = changes;
-		fOffset = offset;
-		fLength = lengthToReplace;
-	}
-
-	/**
-	 * Provides the text that is being deleted.
-	 * 
-	 * @return the text that is being deleted, or null if none is being
-	 *         deleted.
-	 */
-	public String getDeletedText() {
-		return fDeletedText;
-	}
-
-	/**
-	 * This method returns the object that originally caused the event to
-	 * fire. This is typically not the object that created the event (the
-	 * IStructuredDocument) but instead the object that made a request to the
-	 * IStructuredDocument.
-	 * 
-	 * @return the object that made the request to the document
-	 */
-	public Object getOriginalRequester() {
-		return fOriginalRequester;
-	}
-
-	/**
-	 * This method is equivalent to 'getDocument' except it returns an object
-	 * of the appropriate type (namely, a IStructuredDocument, instead of
-	 * IDocument).
-	 * 
-	 * @return IStructuredDocumnt - the document being changed
-	 */
-	public IStructuredDocument getStructuredDocument() {
-		// a safe case, since constructor can only be called with a
-		// IStructuredDocument
-		return (IStructuredDocument) fDocument;
-	}
-
-	/**
-	 * Not to be called by clients, only parsers and reparsers. (will
-	 * eventually be moved to an SPI package).
-	 * 
-	 * @param newDeletedText -
-	 *            the text that has been deleted.
-	 */
-	public void setDeletedText(String newDeletedText) {
-		fDeletedText = newDeletedText;
-	}
-
-	/**
-	 * for debugging only
-	 * 
-	 * @deprecated - need to fix unit tests which depend on this exact format,
-	 *             then delete this
-	 */
-	public String toString() {
-		// return getClass().getName() + "[source=" + source + "]";
-		return getClass().getName();
-	}
-}
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
deleted file mode 100644
index 149e4d6..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentRegionsReplacedEvent.java
+++ /dev/null
@@ -1,73 +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.sse.core.internal.provisional.events;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-
-/**
- * This event is used when a IStructuredDocumentRegion is deleted, or replaced
- * with more than one IStructuredDocumentRegion, or when simply more than one
- * IStructuredDocumentRegion changes.
- * 
- * @plannedfor 1.0
- */
-public class StructuredDocumentRegionsReplacedEvent extends StructuredDocumentEvent {
-
-	private IStructuredDocumentRegionList fNewStructuredDocumentRegions;
-	private IStructuredDocumentRegionList fOldStructuredDocumentRegions;
-
-	/**
-	 * Creates an instance of StructuredDocumentRegionsReplacedEvent
-	 * 
-	 * @param document -
-	 *            the document being changed.
-	 * @param originalRequester -
-	 *            the requester of the change.
-	 * @param oldStructuredDocumentRegions -
-	 *            the old document regions removed.
-	 * @param newStructuredDocumentRegions -
-	 *            the new document regions added.
-	 * @param changes -
-	 *            a string representing the text change.
-	 * @param offset -
-	 *            the offset of the change.
-	 * @param lengthToReplace -
-	 *            the length of text requested to be replaced.
-	 */
-	public StructuredDocumentRegionsReplacedEvent(IStructuredDocument document, Object originalRequester, IStructuredDocumentRegionList oldStructuredDocumentRegions, IStructuredDocumentRegionList newStructuredDocumentRegions, String changes, int offset, int lengthToReplace) {
-		super(document, originalRequester, changes, offset, lengthToReplace);
-		fOldStructuredDocumentRegions = oldStructuredDocumentRegions;
-		fNewStructuredDocumentRegions = newStructuredDocumentRegions;
-	}
-
-	/**
-	 * Returns the new structured document regions.
-	 * 
-	 * @return the new structured document regions.
-	 */
-	public IStructuredDocumentRegionList getNewStructuredDocumentRegions() {
-		return fNewStructuredDocumentRegions;
-	}
-
-	/**
-	 * Returns the old structured document regions.
-	 * 
-	 * @return the old structured document regions.
-	 */
-	public IStructuredDocumentRegionList getOldStructuredDocumentRegions() {
-		return fOldStructuredDocumentRegions;
-	}
-}
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
deleted file mode 100644
index 69233cc..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java
+++ /dev/null
@@ -1,40 +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.sse.core.internal.provisional.exceptions;
-
-
-
-public class ResourceAlreadyExists extends Exception {
-
-	/**
-	 * Comment for <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ResourceAlreadyExists constructor comment.
-	 */
-	public ResourceAlreadyExists() {
-		super();
-	}
-
-	/**
-	 * ResourceAlreadyExists constructor comment.
-	 * 
-	 * @param s
-	 *            java.lang.String
-	 */
-	public ResourceAlreadyExists(String s) {
-		super(s);
-	}
-}
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
deleted file mode 100644
index 77dac51..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java
+++ /dev/null
@@ -1,40 +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.sse.core.internal.provisional.exceptions;
-
-
-
-public class ResourceInUse extends Exception {
-
-	/**
-	 * Comment for <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ResourceAlreadyExists constructor comment.
-	 */
-	public ResourceInUse() {
-		super();
-	}
-
-	/**
-	 * ResourceAlreadyExists constructor comment.
-	 * 
-	 * @param s
-	 *            java.lang.String
-	 */
-	public ResourceInUse(String s) {
-		super(s);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelManagerProposed.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelManagerProposed.java
deleted file mode 100644
index cda0f7b..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelManagerProposed.java
+++ /dev/null
@@ -1,338 +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.sse.core.internal.provisional.model;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-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;
-
-/**
- * Responsible for managing IStructuredModels.
- * 
- * This allows clients to share models, so they do not have to be re-created
- * or passed around from one client to another. Clients should internally
- * enforce that models are gotten and released from locations close to each
- * other to prevent model leaks.
- * 
- * There are three ways to get a model based on usage and responsibility: for
- * 'MODIFY', just for 'SHARED', and 'UNSHARED'. Contrary to their names, a
- * model can technically be modified, and all modifications directly affect
- * the commonly shared version of the model. It is part of the API contract,
- * however, that clients who get a model for SHARED do not modify it. The
- * significance of the 'MODIFY' model is that the client is registering their
- * interest in saving changes to the model.
- * 
- * Clients can reference this interface, but should not implement.
- * 
- * @see org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager
- * @plannedfor 1.0
- */
-public interface IModelManagerProposed {
-
-	/**
-	 * AccessType is used internally as a JRE 1.4 compatible enumerated type.
-	 * Not intended to be referenced by clients.
-	 */
-	static class AccessType {
-		private String fType;
-
-		/**
-		 * default access contructor we use to create our specific constants.
-		 * 
-		 * @param type
-		 */
-		AccessType(String type) {
-			super();
-			fType = type;
-		}
-
-		/**
-		 * For debug purposes only.
-		 */
-		public String toString() {
-			return "Model Access Type: " + fType; //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Constant to provide compile time safe parameter. <code>NOTSHARED</code>signifies
-	 * the client intentially wants a model that is not shared with other
-	 * clients. NOTSHARED models can not be saved.
-	 */
-	final AccessType NOTSHARED = new AccessType("NOTSHARED"); //$NON-NLS-1$
-
-	/**
-	 * Constant to provide compile-time safe parameter. <code>SHARED</code>signifies
-	 * the client is not intending to make changes and does not care whether
-	 * the model accessed is saved.
-	 */
-	final AccessType SHARED = new AccessType("SHARED"); //$NON-NLS-1$
-
-	/**
-	 * Constant to provide compile-time safe parameter. <code>MODIFY</code>signifies
-	 * the client is intending to make changes and is responsible for saving
-	 * changes (or not) if they are the last one holding MODIFY access to the
-	 * model before it's released.
-	 */
-	final AccessType MODIFY = new AccessType("MODIFY"); //$NON-NLS-1$
-
-	/**
-	 * copyModel is similar to a deep clone. The resulting model is shared,
-	 * according to the value of ReadEditType. If a model already is being
-	 * managed for 'newLocation' then a ResourceInUse exception is thrown,
-	 * unless the ReadEditType is NOTSHARED, in which case the resulting model
-	 * can not be saved.
-	 * 
-	 * @param oldLocation
-	 * @param newLocation
-	 * @param type
-	 * @return
-	 * @throws ResourceInUse
-	 * 
-	 * ISSUE: is this important enough to be API, or can clients solve
-	 * themselves
-	 */
-	IStructuredModel copyModel(IPath oldLocation, IPath newLocation, AccessType type) throws ResourceInUse;
-
-	/**
-	 * createNewInstance is similar to clone, except the new instance has no
-	 * text content. Note: this produces an UNSHARED model, for temporary use,
-	 * that has the same characteristics as original model. If a true shared
-	 * model is desired, use "copy".
-	 * 
-	 * ISSUE: still needed?
-	 * 
-	 * @param requester
-	 * @param model
-	 * @return
-	 * @throws IOException
-	 */
-	public IStructuredModel createNewInstance(Object requester, IStructuredModel model) throws IOException;
-
-	/**
-	 * Factory method, since a proper IStructuredDocument must have a proper
-	 * parser assigned. Note: its assume that IPath 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.
-	 * 
-	 * ISSUE: do we want to support this via model manager, or else where?
-	 * ISSUE: do we need two of these? What's legacy use case?
-	 * 
-	 * @param location
-	 * @param progressMonitor
-	 * @return
-	 * @throws ResourceAlreadyExists
-	 * @throws IOException
-	 * @throws CoreException
-	 */
-	IStructuredDocument createNewStructuredDocumentFor(IPath location, IProgressMonitor progressMonitor) throws ResourceAlreadyExists, IOException, CoreException;
-
-	/**
-	 * Factory method, since a proper IStructuredDocument must have a proper
-	 * parser assigned. Note: clients should verify that the resource
-	 * identified by the IPath exists before using this method. If this IFile
-	 * does not exist, then createNewStructuredDocument is the correct API to
-	 * use.
-	 * 
-	 * ISSUE: do we want to support this via model manager, or else where?
-	 * ISSUE: do we need two of these? What's legacy use case?
-	 * 
-	 * @param location
-	 * @param progressMonitor
-	 * @return
-	 * @throws IOException
-	 * @throws CoreException
-	 */
-	IStructuredDocument createStructuredDocumentFor(IPath location, IProgressMonitor progressMonitor) throws IOException, CoreException;
-
-	/**
-	 * Note: callers of this method must still release the model when
-	 * finished. Returns the model for this document if it already exists and
-	 * is being shared. Returns null if this is not the case. The ReadEditType
-	 * must be either MODIFY or SHARED.
-	 * 
-	 * ISSUE: should we accept IDocument on parameter for future evolution,
-	 * and constrain to StructuredDocuments at runtime?
-	 * 
-	 * @param requester
-	 * @param type
-	 * @param document
-	 * @return
-	 */
-	IStructuredModel getExistingModel(Object requester, AccessType type, IDocument document);
-
-	/**
-	 * Callers of this method must still release the model when finished.
-	 * Returns the model for this location if it already exists and is being
-	 * shared. Returns null if this is not the case. The ReadEditType must be
-	 * either MODIFY or SHARED.
-	 * 
-	 * @param requester
-	 * @param type
-	 * @param location
-	 * @return
-	 */
-	public IStructuredModel getExistingModel(Object requester, AccessType type, IPath location);
-
-	/**
-	 * Returns the model that has the specified document as its structured
-	 * document.
-	 * 
-	 * @param requester
-	 * @param type
-	 * @param progressMonitor
-	 * @param document
-	 * @return
-	 */
-	public IStructuredModel getModel(Object requester, AccessType type, IProgressMonitor progressMonitor, IDocument document);
-
-	/**
-	 * Returns the model based on the content at the specified location.
-	 * 
-	 * Note: if the ModelManager does not know how to create a model for 
-	 * such a file for content, null is return.
-	 * ISSUE: should we throw some special, meaningful, checked 
-	 * exception instead?
-	 * 
-	 * @param requester
-	 * @param type
-	 * @param progressMonitor
-	 * @param location
-	 * @return
-	 * @throws IOException
-	 * @throws CoreException
-	 */
-	public IStructuredModel getModel(Object requester, AccessType type, IProgressMonitor progressMonitor, IPath location) throws IOException, CoreException;
-
-	/**
-	 * This method will not create a new model if it already exists ... if
-	 * 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 requester
-	 * @param location
-	 * @param force
-	 * @param type
-	 * @param progressMonitor
-	 * @return
-	 * @throws ResourceAlreadyExists
-	 * @throws ResourceInUse
-	 * @throws IOException
-	 * @throws CoreException
-	 */
-	IStructuredModel getNewModel(Object requester, IPath location, boolean force, AccessType type, IProgressMonitor progressMonitor) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException;
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model.
-	 * 
-	 * @param location
-	 * @return
-	 */
-	boolean isShared(IPath location);
-
-	/**
-	 * This function returns true if there are other references to the
-	 * underlying model, shared in the specified way. The ReadEditType must be
-	 * either MODIFY or SHARED.
-	 * 
-	 * @param location
-	 * @param type
-	 * @return
-	 */
-	boolean isShared(IPath location, AccessType type);
-
-	/**
-	 * This method can be called when the content type of a model changes. Its
-	 * 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.
-	 * 
-	 * @param model
-	 * @return
-	 * @throws IOException
-	 */
-	IStructuredModel reinitialize(IStructuredModel model) throws IOException;
-
-
-	/**
-	 * This is used by clients to signify that they are finished with a model
-	 * and will no longer access it or any of its underlying data (such as its
-	 * structured document). The ReadEditType must match what ever the client
-	 * used in the corresponding 'get' method.
-	 * 
-	 * This method must be called for every 'get'. Clients should use the
-	 * try/finally pattern to ensure the release is called even if there is an
-	 * unexpected exception.
-	 * 
-	 * @param requester
-	 * @param structuredModel
-	 * @param type
-	 */
-	void releaseModel(Object requester, IStructuredModel structuredModel, AccessType type);
-
-	/**
-	 * Writes the underlying document to the IPath.
-	 * 
-	 * ISSUE: we want to just "dump" contents to location, but need to spec.
-	 * all the different cases of shared, etc.
-	 * 
-	 * ?If to same location as 'get', then same instance of model, If to
-	 * different location (esp. if shared) then need to leave old instance of
-	 * model, create new model, and save to new location. ?
-	 * 
-	 * Cases: IPath is null, write to IPath created with IPath specificed and
-	 * equals IPath created with, write to IPath IPath specified and not
-	 * equals IPath created with, dumps to new IPath, no change in current
-	 * model state.
-	 * 
-	 * ISSUE: think through 'normalization' cases
-	 * 
-	 * 
-	 * @param structuredModel
-	 * @param location - already normalized?
-	 * @param progressMonitor
-	 * @throws UnsupportedEncodingException
-	 * @throws IOException
-	 * @throws CoreException
-	 * 
-	 * ISSUE: resource aleady exists? veto override
-	 */
-	void saveModel(IStructuredModel structuredModel, IPath location, IProgressMonitor progressMonitor) throws UnsupportedEncodingException, IOException, CoreException;
-
-	/**
-	 * Writes the underlying document to the IPath if the model is only shared
-	 * for EDIT by one client. This is the recommended way for 'background
-	 * jobs' to save models, in case the model is being shared by an editor,
-	 * or other client that might desire user intervention to save a resource.
-	 * 
-	 * @param structuredModel
-	 * @param location - already normalized?
-	 * @param progressMonitor
-	 * @throws UnsupportedEncodingException
-	 * @throws IOException
-	 * @throws CoreException
-	 * 
-	 * ISSUE: is locaiton needed in this case, or just use the one it was
-	 * created with
-	 */
-	void saveModelIfNotShared(IStructuredModel structuredModel, IPath location, IProgressMonitor progressMonitor) throws UnsupportedEncodingException, IOException, CoreException;
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelStateListenerProposed.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelStateListenerProposed.java
deleted file mode 100644
index e4a4baa..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelStateListenerProposed.java
+++ /dev/null
@@ -1,36 +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.sse.core.internal.provisional.model;
-
-
-/**
- * Interface for those wanting to listen to a model's state changing.
- * 
- * @plannedfor 1.0
- */
-public interface IModelStateListenerProposed {
-
-	/**
-	 * A model is about to be changed. The event object itself signifies which
-	 * model, and any pertinent information.
-	 */
-	void modelAboutToBeChanged(IStructuredModelEvent event);
-
-	/**
-	 * Signals that the changes foretold by modelAboutToBeChanged have been
-	 * made. A typical use might be to refresh, or to resume processing that
-	 * was suspended as a result of modelAboutToBeChanged.
-	 */
-	void modelChanged(IStructuredModelEvent event);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/INodeAdapterFactoryManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/INodeAdapterFactoryManager.java
deleted file mode 100644
index 6c2d165..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/INodeAdapterFactoryManager.java
+++ /dev/null
@@ -1,33 +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.sse.core.internal.provisional.model;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-/**
- * Provides a means for clients to register IAdapterFactories for use
- * by infrastructure when StructuredModels are created. 
- */
-public interface INodeAdapterFactoryManager {
-
-	/**
-	 * 
-	 * @param factory
-	 * @param contentType
-	 */
-	void addAdapterFactory(INodeAdapterFactory factory, IContentType contentType);
-
-	void removeAdapterFactory(INodeAdapterFactory factory, IContentType contentType);
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelEvent.java
deleted file mode 100644
index 3c5a16e..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelEvent.java
+++ /dev/null
@@ -1,17 +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
- *     
- *******************************************************************************/
-
-package org.eclipse.wst.sse.core.internal.provisional.model;
-
-public interface IStructuredModelEvent {
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelProposed.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelProposed.java
deleted file mode 100644
index 7d984da..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelProposed.java
+++ /dev/null
@@ -1,152 +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.sse.core.internal.provisional.model;
-
-import java.io.IOException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-/**
- * IStructuredModel's are mainly interesting by their extensions and
- * implementers. The main purposed of this abstraction it to provide a common
- * way to manage models that have an associated structured documnet.
- * 
- * @plannedfor 1.0
- * 
- */
-public interface IStructuredModelProposed extends IAdaptable {
-
-
-	/**
-	 * 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 listeners is
-	 * sent only once.
-	 * 
-	 * Note that the client who is making these changes has the responsibility
-	 * to restore the model's 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.
-	 * 
-	 * This method is a matched pair to changedModel, and must be called
-	 * before changedModel. A client should never call changedModel without
-	 * calling aboutToChangeModel first nor call aboutToChangeModel without
-	 * calling changedModel later from the same Thread.
-	 */
-	void aboutToChangeModel();
-
-	void addModelStateListener(IModelStateListener listener);
-
-	/**
-	 * 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.
-	 * 
-	 */
-	void changedModel();
-
-	/**
-	 * This is a client-defined value for what that client (and/or loader)
-	 * considers the "base" of the structured model. Frequently the location
-	 * is either a workspace root-relative path of a workspace resource or an
-	 * absolute path in the local file system.
-	 */
-	IPath getLocation();
-
-	/**
-	 * @return The associated content type identifier (String) for this model.
-	 */
-	IContentType getContentType() throws CoreException;
-
-	/**
-	 * 
-	 * @return The model's FactoryRegistry. A model is not valid without one.
-	 */
-	FactoryRegistry getFactoryRegistry();
-
-	/**
-	 * Return the index region at offset. Returns null if there is no
-	 * IndexedRegion that contains offset.
-	 */
-	IndexedRegion getIndexedRegion(int offset);
-
-	/**
-	 * ISSUE: do we want to provide this? How to ensure job/thread safety
-	 * 
-	 * @return
-	 */
-	IndexedRegion[] getIndexedRegions();
-
-	/**
-	 * Rreturns the IStructuredDocument that underlies this model
-	 * 
-	 * @return
-	 */
-	IStructuredDocument getStructuredDocument();
-
-	/**
-	 * 
-	 */
-	boolean isDirty();
-
-	/**
-	 * This method can be called to determine if the model is within a
-	 * "aboutToChange" and "changed" sequence.
-	 */
-	public boolean isModelStateChanging();
-
-	/**
-	 * 
-	 */
-	boolean isNew();
-
-	boolean isReinitializationNeeded();
-
-	/**
-	 * This is a combination of if the model is dirty and if the model is
-	 * shared for write access. The last writer as the responsibility to be
-	 * sure the user is prompted to save.
-	 */
-	public boolean isSaveNeeded();
-
-	/**
-	 * newInstance is similar to clone, except that the newInstance contains
-	 * no content. Its purpose is so clients can get a temporary, unmanaged,
-	 * model of the same "type" as the original. Note: the client may still
-	 * need to do some intialization of the model returned by newInstance,
-	 * depending on desired use. For example, the only factories in the
-	 * newInstance are those that would be normally be created for a model of
-	 * the given contentType. Others are not copied automatically, and if
-	 * desired, should be added by client.
-	 */
-	IStructuredModelProposed newInstance() throws IOException;
-
-	void removeModelStateListener(IModelStateListener listener);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocument.java
deleted file mode 100644
index 9cff78e..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocument.java
+++ /dev/null
@@ -1,218 +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.sse.core.internal.provisional.text;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.text.IDocumentExtension;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-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.events.IModelAboutToBeChangedListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-
-
-/**
- * A IStructuredDocument is a collection of StructuredDocumentRegions. It's
- * often called "flat" because its contents by design do not contain much
- * structural information beyond containment. Clients should not implement.
- */
-public interface IStructuredDocument extends IEncodedDocument, IDocumentExtension, IAdaptable {
-
-	void addDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener);
-
-	/**
-	 * The StructuredDocumentListeners and ModelChangedListeners are very
-	 * similar. They both receive identical events. The difference is the
-	 * timing. The "pure" StructuredDocumentListeners are notified after the
-	 * structuredDocument has been changed, but before other, related models
-	 * may have been changed such as the Structural Model. The Structural
-	 * model is in fact itself a "pure" StructuredDocumentListner. The
-	 * ModelChangedListeners can rest assured that all models and data have
-	 * been updated from the change by the tiem they are notified. This is
-	 * especially important for the text widget, for example, which may rely
-	 * on both structuredDocument and structural model information.
-	 */
-	void addDocumentChangedListener(IStructuredDocumentListener listener);
-
-	/**
-	 * The StructuredDocumentListeners and ModelChangedListeners are very
-	 * similar. They both receive identical events. The difference is the
-	 * timing. The "pure" StructuredDocumentListeners are notified after the
-	 * structuredDocument has been changed, but before other, related models
-	 * may have been changed such as the Structural Model. The Structural
-	 * model is in fact itself a "pure" StructuredDocumentListner. The
-	 * ModelChangedListeners can rest assured that all models and data have
-	 * been updated from the change by the tiem they are notified. This is
-	 * especially important for the text widget, for example, which may rely
-	 * on both structuredDocument and structural model information.
-	 */
-	void addDocumentChangingListener(IStructuredDocumentListener listener);
-
-	/**
-	 * this API ensures that any portion of the document within startOff to
-	 * length is not readonly (that is, that its editable). Note that if the
-	 * range overlaps with other readonly regions, those other readonly
-	 * regions will be adjusted.
-	 * 
-	 * @param startOffset
-	 * @param length
-	 */
-	void clearReadOnly(int startOffset, int length);
-
-	/**
-	 * returns true if any portion of startOffset to length is readonly
-	 * 
-	 * @param startOffset
-	 * @param length
-	 * @return
-	 */
-	boolean containsReadOnly(int startOffset, int length);
-
-	/**
-	 * This method is to remember info about the encoding When the resource
-	 * was last loaded or saved. Note: it is not kept "current", that is, can
-	 * not be depended on blindly to reflect what encoding to use. For that,
-	 * must go through the normal rules expressed in Loaders and Dumpers.
-	 */
-
-	EncodingMemento getEncodingMemento();
-
-	org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion getFirstStructuredDocumentRegion();
-
-	org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion getLastStructuredDocumentRegion();
-
-	/**
-	 * This can be considered the preferred delimiter.
-	 */
-	public String getLineDelimiter();
-
-	int getLineOfOffset(int offset); // throws SourceEditingException;
-
-	/**
-	 * The parser is now required on constructor, so there are occasions it
-	 * needs to be retrieved, such as to be initialized by EmbeddedContentType
-	 */
-	RegionParser getParser();
-
-	/**
-	 * @deprecated use getStructuredDocumentRegions()
-	 * @return
-	 */
-	IStructuredDocumentRegionList getRegionList();
-
-	/**
-	 * Returns the <code>IStructuredDocumentRegion</code> at the given character offset.
-	 * @param offset
-	 * @return the <code>IStructuredDocumentRegion</code> at the given character offset.
-	 */
-	IStructuredDocumentRegion getRegionAtCharacterOffset(int offset);
-	
-	/**
-	 * Returns <code>IStructuredDocumentRegion</code>s in the specified range.
-	 * @param offset
-	 * @param length
-	 * @return <code>IStructuredDocumentRegion</code>s in the specified range.
-	 */
-	IStructuredDocumentRegion[] getStructuredDocumentRegions(int offset, int length);
-	
-	/**
-	 * Returns all <code>IStructuredDocumentRegion</code>s in the document.
-	 * @return all <code>IStructuredDocumentRegion</code>s in the document.
-	 */
-	IStructuredDocumentRegion[] getStructuredDocumentRegions();
-	
-	/**
-	 * Note: this method was made public, and part of the interface, for
-	 * easier testing. Clients normally never manipulate the reparser directly
-	 * (nor should they need to).
-	 */
-	IStructuredTextReParser getReParser();
-
-	String getText();
-
-	IStructuredTextUndoManager getUndoManager();
-
-	/**
-	 * causes that portion of the document from startOffset to length to be
-	 * marked as readonly. Note that if this range overlaps with some other
-	 * region with is readonly, the regions are effectivly combined.
-	 * 
-	 * @param startOffset
-	 * @param length
-	 */
-	void makeReadOnly(int startOffset, int length);
-
-	/**
-	 * newInstance is similar to clone, except it contains no data. One
-	 * important thing to duplicate is the parser, with the parser correctly
-	 * "cloned", including its tokeninzer, block tags, etc.
-	 * 
-	 * NOTE: even after obtaining a 'newInstance' the client may have to do
-	 * some initialization, for example, it may need to add its own model
-	 * listeners. Or, as another example, if the IStructuredDocument has a
-	 * parser of type StructuredDocumentRegionParser, then the client may need
-	 * to add its own StructuredDocumentRegionHandler to that parser, if it is
-	 * in fact needed.
-	 */
-	IStructuredDocument newInstance();
-
-	void removeDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener);
-
-	void removeDocumentChangedListener(IStructuredDocumentListener listener);
-
-	void removeDocumentChangingListener(IStructuredDocumentListener listener);
-
-	/**
-	 * One of the APIs to manipulate the IStructuredDocument.
-	 * 
-	 * replaceText replaces the text from oldStart to oldEnd with the new text
-	 * found in the requestedChange string. If oldStart and oldEnd are equal,
-	 * it is an insertion request. If requestedChange is null (or empty) it is
-	 * a delete request. Otherwise it is a replace request.
-	 */
-	StructuredDocumentEvent replaceText(Object source, int oldStart, int replacementLength, String requestedChange);
-
-	/**
-	 * Note, same as replaceText API, but will allow readonly areas to be
-	 * replaced. This should seldom be called with a value of "true" for
-	 * ignoreReadOnlySetting. One case where its ok is with undo operations
-	 * (since, presumably, if user just did something that happended to
-	 * involve some inserting readonly text, they should normally be allowed
-	 * to still undo that operation. Otherwise, I can't think of a single
-	 * example, unless its to give the user a choice, e.g. "you are about to
-	 * overwrite read only portions, do you want to continue".
-	 */
-	StructuredDocumentEvent replaceText(Object source, int oldStart, int replacementLength, String requestedChange, boolean ignoreReadOnlySetting);
-
-	/**
-	 * This method is to remember info about the encoding When the resource
-	 * was last loaded or saved. Note: it is not kept "current", that is, can
-	 * not be depended on blindly to reflect what encoding to use. For that,
-	 * must go through the normal rules expressed in Loaders and Dumpers.
-	 */
-	void setEncodingMemento(EncodingMemento encodingMemento);
-
-	public void setLineDelimiter(String delimiter);
-
-	/**
-	 * One of the APIs to manipulate the IStructuredDocument in terms of Text.
-	 * 
-	 * The setText method replaces all text in the model.
-	 */
-	StructuredDocumentEvent setText(Object requester, String allText);
-
-	void setUndoManager(IStructuredTextUndoManager undoManager);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegion.java
deleted file mode 100644
index 314d1aa..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegion.java
+++ /dev/null
@@ -1,163 +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.sse.core.internal.provisional.text;
-
-/**
- * A ITextRegionCollection is a collection of ITextRegions. It is a structural
- * unit, but a minimal one. For example, in might consist of a "start tag" but
- * not a whole XML element.
- */
-public interface IStructuredDocumentRegion extends ITextRegionCollection {
-
-	/**
-	 * Adds a text region to the end of the collection of regions contained by
-	 * this region. It is the parsers responsibility to make sure its a
-	 * correct region (that is, its start offset is one greater than previous
-	 * regions end offset)
-	 * 
-	 * For use by parsers and reparsers only.
-	 */
-	void addRegion(ITextRegion aRegion);
-
-	/**
-	 * Returns the structured document region that follows this one or null if
-	 * at end of document.
-	 * 
-	 * @return the structured document region that follows this one.
-	 * 
-	 * ISSUE: for thread safety, this should be more restrictive.
-	 */
-	IStructuredDocumentRegion getNext();
-
-	/**
-	 * Returns this regions parent document.
-	 * 
-	 * @return this regions parent document.
-	 */
-	IStructuredDocument getParentDocument();
-
-	/**
-	 * Returns the structured document region that preceeds this one or null
-	 * if at beginning of document.
-	 * 
-	 * @return the structured document region that follows this one.
-	 * 
-	 * ISSUE: for thread safety, this should be more restrictive.
-	 */
-	IStructuredDocumentRegion getPrevious();
-
-	/**
-	 * Returns true if this document has been deleted, and is no longer part
-	 * of the actual structured document. This field can be used in
-	 * multi-threaded operations, which may retrieve a long list of regions
-	 * and be iterating through them at the same time the document is
-	 * modified, and regions deleted.
-	 * 
-	 * @return true if this region is no longer part of document.
-	 */
-	boolean isDeleted();
-
-	/**
-	 * Returns true if this structured document region was ended "naturally"
-	 * by syntactic rules, or if simply assumed to end so another could be
-	 * started.
-	 * 
-	 * @return true if region has syntactic end.
-	 */
-	boolean isEnded();
-
-	/**
-	 * Tests is region is equal to this one, ignoring position offsets of
-	 * shift.
-	 * 
-	 * For use by parsers and reparsers only.
-	 * 
-	 * @param region
-	 * @param shift
-	 * @return
-	 */
-	boolean sameAs(IStructuredDocumentRegion region, int shift);
-
-	/**
-	 * Tests if <code>oldRegion</code> is same as <code>newRegion</code>,
-	 * ignoring position offsets of <code>shift</code>.
-	 * 
-	 * ISSUE: which document region are old and new in?
-	 * 
-	 * For use by parsers and reparsers only.
-	 * 
-	 * @param oldRegion
-	 * @param documentRegion
-	 * @param newRegion
-	 * @param shift
-	 * @return
-	 */
-	boolean sameAs(ITextRegion oldRegion, IStructuredDocumentRegion documentRegion, ITextRegion newRegion, int shift);
-
-	/**
-	 * Set to true if/when this region is removed from a document, during the
-	 * process of re-parsing.
-	 * 
-	 * For use by parsers and reparsers only.
-	 * 
-	 * @param deleted
-	 */
-	void setDeleted(boolean deleted);
-
-	/**
-	 * Set to true by parser/reparser if region deemed to end syntactically.
-	 * 
-	 * For use by parsers and reparsers only.
-	 * 
-	 * @param hasEnd
-	 */
-	void setEnded(boolean hasEnd);
-
-	/**
-	 * Sets length of region.
-	 * 
-	 * For use by parsers and reparsers only.
-	 */
-	void setLength(int newLength);
-
-	/**
-	 * Assigns pointer to next region, or null if last region.
-	 * 
-	 * For use by parsers and reparsers only.
-	 */
-	void setNext(IStructuredDocumentRegion newNext);
-
-	/**
-	 * Assigns parent documnet.
-	 * 
-	 * For use by parsers and reparsers only.
-	 */
-	void setParentDocument(IStructuredDocument document);
-
-	/**
-	 * Assigns pointer to previous region, or null if first region.
-	 * 
-	 * For use by parsers and reparsers only.
-	 */
-	void setPrevious(IStructuredDocumentRegion newPrevious);
-
-	/**
-	 * Sets start offset of region, relative to beginning of document.
-	 * 
-	 * For use by parsers and reparsers only.
-	 */
-	void setStart(int newStart);
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegionList.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegionList.java
deleted file mode 100644
index 0d7db56..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegionList.java
+++ /dev/null
@@ -1,52 +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.sse.core.internal.provisional.text;
-
-import java.util.Enumeration;
-
-/**
- * This is a class used to provide a list of StructuredDocumentRegions, so the
- * implementation of how the list is formed can be hidden (encapsulated by
- * this class).
- * 
- * ISSUE: should extend ITextRegionList instead?
- * 
- * @plannedfor 1.0
- * 
- */
-public interface IStructuredDocumentRegionList {
-
-	/**
-	 * Returns enumeration.
-	 * 
-	 * @return enumeration.
-	 */
-	Enumeration elements();
-
-	/**
-	 * Returns size of list.
-	 * 
-	 * @return size of list.
-	 */
-	int getLength();
-
-	/**
-	 * Returns the structured document region at index i.
-	 * 
-	 * @param i
-	 *            index of region to return
-	 * @return the region at specified offset.
-	 */
-	IStructuredDocumentRegion item(int i);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java
deleted file mode 100644
index 75e37f0..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.eclipse.wst.sse.core.internal.provisional.text;
-
-/**
- * This interface is not intended to be implemented.
- * It defines the partitioning for StructuredDocuments.
- * Clients should reference the partition type Strings defined here directly.
- * 
- * @plannedfor 1.0
- */
-public interface IStructuredPartitionTypes {
-
-	String DEFAULT_PARTITION = "org.eclipse.wst.sse.ST_DEFAULT"; //$NON-NLS-1$
-	String UNKNOWN_PARTITION = "org.eclipse.wst.sse.UNKNOWN_PARTITION_TYPE"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitioning.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitioning.java
deleted file mode 100644
index f7e940c..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitioning.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.eclipse.wst.sse.core.internal.provisional.text;
-
-/**
- * Identifies the way that Documents are partitioned.
- * 
- * @plannedfor 1.0
- */
-public interface IStructuredPartitioning {
-	
-	/** String to identify default partitioning*/
-	String DEFAULT_STRUCTURED_PARTITIONING = "org.eclipse.wst.sse.core.default_structured_text_partitioning"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java
deleted file mode 100644
index d4c2ba4..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java
+++ /dev/null
@@ -1,86 +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.sse.core.internal.provisional.text;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.sse.core.internal.text.rules.IStructuredTypedRegion;
-
-
-/**
- * A partitioner interface required for handling the embedded content type 
- * properly. 
- * 
- * ISSUE: need to investigate necessity of these methods
- * 
- * @plannedfor 1.0
- */
-
-public interface IStructuredTextPartitioner extends IDocumentPartitioner {
-
-	/**
-	 * Used by JSP partitioner to ensure that the partitioner of the
-	 * embedded content type gets to create the partition in case the specific
-	 * classes are important.
-	 * 
-	 * ISSUE: investigate if we really need this...
-	 */
-	IStructuredTypedRegion createPartition(int offset, int length, String partitionType);
-
-	/**
-	 * Returns the Default partition type for this partitioner.
-	 * <p>
-	 * eg:
-	 * <br><code>org.eclipse.wst.xml.core.text.IXMLPartitions.XML_DEFAULT</code>
-	 * <br><code>org.eclipse.wst.html.core.text.IHTMLPartitions.HTML_DEFAULT</code>
-	 * <br><code>org.eclipse.wst.jsp.core.text.IJSPPartitions.JSP_DEFAULT</code>
-	 * </p>
-	 * @see org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes
-	 * @see org.eclipse.wst.xml.core.text.IXMLPartitions
-	 * @see org.eclipse.wst.html.core.text.IHTMLPartitions
-	 * @see org.eclipse.wst.jsp.core.text.IJSPPartitions
-	 * 
-	 * @return the Default partition type for this partitioner.
-	 */
-	String getDefaultPartitionType();
-
-	/**
-	 * Returns the particular partition type for the given region/offset.
-	 * <p>
-	 * eg:
-	 * <br><code>org.eclipse.wst.xml.core.text.IXMLPartitions.XML_DEFAULT</code>
-	 * <br><code>org.eclipse.wst.html.core.text.IHTMLPartitions.HTML_DEFAULT</code>
-	 * <br><code>org.eclipse.wst.jsp.core.text.IJSPPartitions.JSP_DEFAULT</code>
-	 * </p>
-	 * 
-	 * @param region of the IStructuredDocument
-	 * @param offset in the IStructuredDoucment
-	 * @return the particular partition type for the given region/offset.
-	 */
-	String getPartitionType(ITextRegion region, int offset);
-
-	/**
-	 * Returns the partition type String of the IStructuredDocumentRegion 
-	 * between the 2 region parameters.
-	 * Useful for finding the partition type of a 0 length region.
-	 * eg.
-	 * <pre>
-	 * 	<script type="text/javascript">|</script>
-	 * </pre>
-	 * @param previousNode
-	 * @param nextNode
-	 * @return the partition type of the node between previousNode and nextNode
-	 * @deprecated move to IDocumentPartitionerExtension2 ->
-	 *  String getContentType(int offset, boolean preferOpenPartitions);
-	 */
-	String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, IStructuredDocumentRegion nextNode);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextReParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextReParser.java
deleted file mode 100644
index e465fa9..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextReParser.java
+++ /dev/null
@@ -1,72 +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.sse.core.internal.provisional.text;
-
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-
-/**
- * IStructuredTextReParser describes the characteristics and responsibilities
- * for reparsing a structured document.
- * 
- * @plannedfor 1.0
- */
-public interface IStructuredTextReParser {
-
-	/**
-	 * Begins the process of reparsing, by providing the information needed
-	 * for the reparse. The reparse is actually performed when the reparse
-	 * method is called. Will through an IllegalStateException if document as
-	 * not be set.
-	 * 
-	 * @param requester
-	 * @param start
-	 * @param lengthToReplace
-	 * @param changes
-	 */
-	void initialize(Object requester, int start, int lengthToReplace, String changes);
-
-	/**
-	 * This method is provided to enable multiple threads to reparse a
-	 * document. This is needed since the intialize method sets state
-	 * variables that must be "in sync" with the structuredDocument.
-	 */
-	public boolean isParsing();
-
-	/**
-	 * Returns a new instance of this reparser, used when cloning documents.
-	 * 
-	 * @return a new instance of this reparser.
-	 */
-	public IStructuredTextReParser newInstance();
-
-	/**
-	 * An entry point for reparsing. It needs to calculates the dirty start
-	 * and dirty end in terms of structured document regions based on the
-	 * start point and length of the changes, which are provided by the
-	 * initialize method. Will through an IllegalStateException if document as
-	 * not be set.
-	 * 
-	 */
-	public StructuredDocumentEvent reparse();
-
-
-
-	/**
-	 * The reparser is initialized with its document, either in or shortly
-	 * after its constructed is called.
-	 * 
-	 * @param structuredDocument
-	 */
-	public void setStructuredDocument(IStructuredDocument newStructuredDocument);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegion.java
deleted file mode 100644
index b1281ab..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegion.java
+++ /dev/null
@@ -1,158 +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.sse.core.internal.provisional.text;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-
-/**
- * A simple description of a bit of text (technically, a bit of a text buffer)
- * that has a "type" associated with it. For example, for the XML text
- * "&LT;IMG&GT;", the ' <' might form a region of type "open bracket" where as
- * the text "IMG" might form a region of type "tag name".
- * 
- * Note that there are three positions associated with a region, the start,
- * the end, and the end of the text. The end of the region should always be
- * greater than or equal to the end of the text, because the end of the text
- * simply includes any white space that might follow the non-whitespace
- * portion of the region. This whitespace is assumed to be ignorable except
- * for reasons of maintaining it in the original document for formatting,
- * appearance, etc.
- * 
- * Follows the Prime Directives:
- * 
- * getEnd() == getStart() + getLength()
- * 
- * getTextEnd() == getStart() + getTextLength();
- * 
- * Event though 'end' and 'length' are redundant (given start), both methods
- * are provided, since some parsers/implementations favor one or the other for
- * efficiency.
- * 
- * @plannedfor 1.0
- */
-public interface ITextRegion {
-
-	/**
-	 * Changes length of region. May be less than, equal to, or greater than
-	 * zero. It may not, however, cause the length of the region to be less
-	 * than or equal to zero, or an illegal argument acception may be thrown
-	 * at runtime.
-	 * 
-	 * For use by parsers and reparsers only.
-	 */
-	void adjustLength(int i);
-
-	/**
-	 * Changes start offset of region. May be less than, equal to, or greater
-	 * than zero. It may not, however, cause the offset of the region to be
-	 * less than zero, or an illegal argument acception may be thrown at
-	 * runtime.
-	 * 
-	 * For use by parsers and reparsers only.
-	 */
-	void adjustStart(int i);
-
-	/**
-	 * Changes text length of region.
-	 * 
-	 * May be less than, equal to, or greater than zero. It may not, however,
-	 * cause the text length of the region to be greater than the length of a
-	 * region, or an illegal argument acception may be thrown at runtime.
-	 * 
-	 * For use by parsers and reparsers only.
-	 */
-	void adjustTextLength(int i);
-
-	/**
-	 * Makes this regions start, length, and text length equal to the
-	 * paremter's start, length, and text length.
-	 * 
-	 * @param region
-	 */
-	void equatePositions(ITextRegion region);
-
-	/**
-	 * Returns the end offset of this region. Whether is relative to the
-	 * document, or another region depends on the subtype.
-	 * 
-	 * Follows the Prime Directive: getEnd() == getStart() + getLength()
-	 * 
-	 * @return the end offset of this region.
-	 */
-	int getEnd();
-
-	/**
-	 * Returns the length of the region.
-	 * 
-	 * Follows the Prime Directive: getEnd() == getStart() + getLength()
-	 * 
-	 * @return the length of the region.
-	 */
-	int getLength();
-
-	/**
-	 * Returns the start of the region. Whether is relative to the document,
-	 * or another region depends on the subtype.
-	 * 
-	 * Follows the Prime Directive: getEnd() == getStart() + getLength()
-	 * 
-	 * @return the start of the region.
-	 */
-	int getStart();
-
-	/**
-	 * Returns the end offset of the text of this region.
-	 * 
-	 * In some implementations, the "end" of the region (accessible via
-	 * getEnd()) also contains any and all white space that may or may not be
-	 * present after the "token" (read: relevant) part of the region. This
-	 * method, getTextEnd(), is specific for the "token" part of the region,
-	 * without the whitespace.
-	 * 
-	 * @return the end offset of the text of this region.
-	 */
-	int getTextEnd();
-
-	/**
-	 * Returns the length of the text of this region.
-	 * 
-	 * 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.
-	 * 
-	 * @return the length of the text of this region.
-	 */
-	int getTextLength();
-
-	/**
-	 * Returns the type of this region.
-	 * 
-	 * @see regiontypes, structureddocumentregiontypes
-	 * @return the type of this region.
-	 */
-	String getType();
-
-	/**
-	 * Allows the region itself to participate in reparsing process.
-	 * 
-	 * The region itself can decide if it can determine the appropriate event
-	 * to return, based on the requested change. If it can not, this method
-	 * must return null, so a "higher level" reparsing process will be given
-	 * the oppurtunity to decide. If it returns an Event, that's it, not other
-	 * reparsing process will get an oppurtunity to reparse.
-	 * 
-	 * For use by parsers and reparsers only.
-	 * 
-	 */
-	StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionCollection.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionCollection.java
deleted file mode 100644
index 08890ae..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionCollection.java
+++ /dev/null
@@ -1,178 +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.sse.core.internal.provisional.text;
-
-/**
- * ITextRegionCollection, as its name implies, is a collection of
- * ITextRegions.
- * 
- * @plannedfor 1.0
- */
-public interface ITextRegionCollection extends ITextRegion {
-
-	/**
-	 * Used to determine if a region contains a particular offset, where
-	 * offset is relative to the beginning of a document.
-	 * 
-	 * @param offset
-	 * @return true if offset is greater than or equal to regions start and
-	 *         less than its end offset.
-	 */
-	boolean containsOffset(int offset);
-
-	/**
-	 * Used to determine if a region contains a particular offset.
-	 * 
-	 * ISSUE: I need to figure out what this is really for! (that is, how to
-	 * describe it, or if still needed).
-	 * 
-	 * @param offset
-	 * @return true if offset is greater than or equal to regions start and
-	 *         less than its end offset.
-	 */
-	boolean containsOffset(ITextRegion region, int offset);
-
-	/**
-	 * Returns the end offset of this region, relative to beginning of
-	 * document.
-	 * 
-	 * For some subtypes, but not all, it is equivilent to getEnd().
-	 * 
-	 * @return the end offset of this region.
-	 */
-	int getEndOffset();
-
-	/**
-	 * Returns the end offset, relative to the beginning of the document of
-	 * the contained region.
-	 * 
-	 * @param containedRegion
-	 * @return the end offset of the contained region.
-	 */
-	int getEndOffset(ITextRegion containedRegion);
-
-	/**
-	 * Returns the first region of those contained by this region collection.
-	 * 
-	 * @return the first region.
-	 */
-	ITextRegion getFirstRegion();
-
-	/**
-	 * Returns the full text of this region, including whitespace.
-	 * 
-	 * @return the full text of this region, including whitespace.
-	 */
-	String getFullText();
-
-	/**
-	 * Returns the full text of the contained region, including whitespace.
-	 * 
-	 * @return the full text of the contained region, including whitespace.
-	 */
-	String getFullText(ITextRegion containedRegion);
-
-	/**
-	 * Returns the last region of those contained by this region collection.
-	 * 
-	 * @return the last region.
-	 */
-	ITextRegion getLastRegion();
-
-	/**
-	 * Returns the number of regions contained by this region.
-	 * 
-	 * @return the number of regions contained by this region.
-	 */
-	int getNumberOfRegions();
-
-	/**
-	 * Returns the region that contains offset. In the case of "nested"
-	 * regions, returns the top most region.
-	 * 
-	 * @param offset
-	 *            relative to beginning of document.
-	 * @return the region that contains offset. In the case of "nested"
-	 *         regions, returns the top most region.
-	 */
-	ITextRegion getRegionAtCharacterOffset(int offset);
-
-	/**
-	 * Returns the regions contained by this region.
-	 * 
-	 * Note: no assumptions should be made about the object identity of the
-	 * regions returned. Put another way, due to memory use optimizations,
-	 * even if the underlying text has not changed, the regions may or may not
-	 * be the same ones returned from one call to the next.
-	 * 
-	 * @return the regions contained by this region.
-	 */
-	ITextRegionList getRegions();
-
-	/**
-	 * Returns the start offset of this region, relative to the beginning of
-	 * the document.
-	 * 
-	 * @return the start offset of this region
-	 */
-	int getStartOffset();
-
-	/**
-	 * Returns the start offset of the contained region, relative to the
-	 * beginning of the document.
-	 * 
-	 * @return the start offset of the contained region
-	 */
-	int getStartOffset(ITextRegion containedRegion);
-
-	/**
-	 * Returns the text of this region, not including white space.
-	 * 
-	 * @return the text of this region, not including white space.
-	 */
-	String getText();
-
-	/**
-	 * Returns the text of the contained region, not including white space.
-	 * 
-	 * @return the text of the contained region, not including white space.
-	 */
-	String getText(ITextRegion containedRegion);
-
-	/**
-	 * Returns the end offset of the text of this region, not including white
-	 * space.
-	 * 
-	 * @return the end offset of the text of this region, not including white
-	 *         space.
-	 */
-	int getTextEndOffset();
-
-	/**
-	 * Returns the end offset of the text of the contained region, not
-	 * including white space.
-	 * 
-	 * @return the end offset of the text of the contained region, not
-	 *         including white space.
-	 */
-	int getTextEndOffset(ITextRegion containedRegion);
-
-	/**
-	 * Assigns the collection contained in this region.
-	 * 
-	 * For use by parsers and reparsers only.
-	 * 
-	 * @param containedRegions
-	 */
-	void setRegions(ITextRegionList containedRegions);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionContainer.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionContainer.java
deleted file mode 100644
index 654ca81..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionContainer.java
+++ /dev/null
@@ -1,40 +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.sse.core.internal.provisional.text;
-
-/**
- * ITextRegionContainer contains other regions, like a ITextRegionCollection
- * but is itself a region in an ITextRegionCollection, so its "parent" region
- * is maintained.
- * 
- * @plannedfor 1.0
- */
-public interface ITextRegionContainer extends ITextRegionCollection {
-
-	/**
-	 * Returns the parent region.
-	 * 
-	 * @return the parent region.
-	 */
-	ITextRegionCollection getParent();
-
-	/**
-	 * Sets the parent region.
-	 * 
-	 * For use by parsers and reparsers only.
-	 * 
-	 * @param parent
-	 *            the ITextRegionCollection this region is contained in.
-	 */
-	void setParent(ITextRegionCollection parent);
-}
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
deleted file mode 100644
index a013572..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java
+++ /dev/null
@@ -1,131 +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.sse.core.internal.provisional.text;
-
-import java.util.Iterator;
-
-/**
- * ITextRegionList is to provide a list of regions. It can be used so clients
- * do not need to be aware of underlying implementation.
- */
-public interface ITextRegionList {
-
-	/**
-	 * Adds region to the list.
-	 * 
-	 * For use by parsers and reparsers only, while list is being created.
-	 * 
-	 * @param region
-	 * @return
-	 */
-	public boolean add(ITextRegion region);
-
-	/**
-	 * Adds new regions to the list.
-	 * 
-	 * For use by parsers and reparsers only, while list is being created.
-	 * 
-	 * @param insertPos
-	 * @param newRegions
-	 * @return
-	 */
-	public boolean addAll(int insertPos, ITextRegionList newRegions);
-
-	/**
-	 * Removes all regions from the list.
-	 * 
-	 * For use by parsers and reparsers only, while list is being created.
-	 * 
-	 */
-	public void clear();
-
-
-	/**
-	 * Returns the region at <code>index</code>, where 0 is first one in
-	 * the list. Throws an <code>ArrayIndexOutOfBoundsException</code> if
-	 * list is empty, or if index is out of range.
-	 * 
-	 * @param index
-	 * @return
-	 */
-	public ITextRegion get(int index);
-
-	/**
-	 * Returns the index of <code>region</code> or -1 if <code>region</code>
-	 * is not in the list.
-	 * 
-	 * @param region
-	 * @return
-	 */
-	public int indexOf(ITextRegion region);
-
-	/**
-	 * Returns true if list has no regions.
-	 * 
-	 * @return true if list has no regions.
-	 */
-	public boolean isEmpty();
-
-
-	/**
-	 * Returns an iterator for this list.
-	 * 
-	 * @return an iterator for this list.
-	 */
-	public Iterator iterator();
-
-	/**
-	 * Removes the region at index.
-	 * 
-	 * For use by parsers and reparsers only, while list is being created.
-	 * 
-	 */
-	public ITextRegion remove(int index);
-
-	/**
-	 * Removes the region.
-	 * 
-	 * For use by parsers and reparsers only, while list is being created.
-	 * 
-	 */
-	public void remove(ITextRegion region);
-
-
-	/**
-	 * Removes all regionList from this list.
-	 * 
-	 * For use by parsers and reparsers only, while list is being created.
-	 * 
-	 */
-	public void removeAll(ITextRegionList regionList);
-
-	/**
-	 * Returns the size of the list.
-	 * 
-	 * @return the size of the list.
-	 */
-	public int size();
-
-
-	/**
-	 * Creates and returns the regions in an array. No assumptions should be
-	 * made if the regions in the array are clones are same instance of
-	 * original region.
-	 * 
-	 * ISSUE: do we need to specify if cloned copies or not?
-	 * 
-	 * @return an array of regions.
-	 */
-	public ITextRegion[] toArray();
-
-}
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
deleted file mode 100644
index 5a3e195..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java
+++ /dev/null
@@ -1,2632 +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.sse.core.internal.text;
-
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Collections;
-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.jface.text.BadLocationException;
-import org.eclipse.jface.text.BadPartitioningException;
-import org.eclipse.jface.text.BadPositionCategoryException;
-import org.eclipse.jface.text.DefaultLineTracker;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.DocumentPartitioningChangedEvent;
-import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.IDocumentPartitionerExtension;
-import org.eclipse.jface.text.IDocumentPartitionerExtension2;
-import org.eclipse.jface.text.IDocumentPartitioningListener;
-import org.eclipse.jface.text.IDocumentPartitioningListenerExtension;
-import org.eclipse.jface.text.IDocumentPartitioningListenerExtension2;
-import org.eclipse.jface.text.ILineTracker;
-import org.eclipse.jface.text.IPositionUpdater;
-import org.eclipse.jface.text.IRegion;
-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;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-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.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.StructuredDocumentEvent;
-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.IStructuredPartitioning;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextReParser;
-import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.core.internal.undo.StructuredTextUndoManager;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-
-/**
- * The standard implementation of structured document.
- */
-public class BasicStructuredDocument implements IStructuredDocument, IDocumentExtension, IDocumentExtension3, CharSequence, IRegionComparible {
-
-	/**
-	 * This ThreadLocal construct is used so each thread can maintain its only
-	 * pointer to the double linked list that manages the documents regions.
-	 * The only thing we "gaurd" for is that a previously cached region has
-	 * been deleted.
-	 * 
-	 * The object that is kept in the thread local's map, is just a pointer to
-	 * an array position. That's because the object there needs to be "free"
-	 * from references to other objects, or it will not be garbage collected.
-	 */
-	private class CurrentDocumentRegionCache {
-		// I'm assuming for now there would never be so many threads that
-		// this arrayList needs to be bounded, or 'cleaned up'.
-		// this assumption should be tested in practice and long running
-		// 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 ThreadLocal threadLocalCachePosition = new ThreadLocal();
-
-		IStructuredDocumentRegion get() {
-			IStructuredDocumentRegion region = null;
-			int pos = getThreadLocalPosition();
-			try {
-				region = (IStructuredDocumentRegion) cachedRegionPositionArray.get(pos);
-			}
-			catch (IndexOutOfBoundsException e) {
-				// even though the cachedRegionPosition is synchronized,
-				// that just means each access is syncronized, its
-				// still possible for another thread to cause it to
-				// be cleared, after this thread gets it position.
-				// So, if that happens, all we can do is reset to beginning.
-				// This should be extremely rare (in other words, probably
-				// not worth using synchronized blocks
-				// to access cachedRegionPositionArray.
-				reinitThreadLocalPosition();
-				resetToInitialState();
-			}
-			if (region == null) {
-				region = resetToInitialState();
-			}
-			else
-			// region not null
-			if (region.isDeleted()) {
-				region = resetToInitialState();
-			}
-			return region;
-		}
-
-		private int getThreadLocalPosition() {
-			Object threadLocalObject = threadLocalCachePosition.get();
-			int pos = -1;
-			if (threadLocalObject == null) {
-
-				pos = reinitThreadLocalPosition();
-			}
-			else {
-				pos = ((Integer) threadLocalObject).intValue();
-			}
-			return pos;
-		}
-
-		/**
-		 * @return
-		 */
-		private int reinitThreadLocalPosition() {
-			Integer position;
-			int pos;
-			// TODO_future: think of a better solution that doesn't
-			// require this kludge. This is especially required because
-			// some infrasture, such as reconciler, actually null out
-			// their thread object and recreate it, 500 msecs later
-			// (approximately).
-			// Note: the likely solution in future is to clear after every
-			// heavy use of getCachedRegion, such as in creating node
-			// lists, or reparsing or partioning.
-			if (cachedRegionPositionArray.size() > MAX_SIZE) {
-				cachedRegionPositionArray.clear();
-				if (DEBUG) {
-					System.out.println("cachedRegionPositionArray cleared at size " + MAX_SIZE); //$NON-NLS-1$
-				}
-			}
-			position = new Integer(cachedRegionPositionArray.size());
-			threadLocalCachePosition.set(position);
-			cachedRegionPositionArray.add(position.intValue(), null);
-			pos = position.intValue();
-			return pos;
-		}
-
-		private IStructuredDocumentRegion resetToInitialState() {
-			IStructuredDocumentRegion region;
-			region = getFirstStructuredDocumentRegion();
-			set(region);
-			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();
-				cachedRegionPositionArray.set(pos, region);
-			}
-			catch (IndexOutOfBoundsException e) {
-				// even though the cachedRegionPosition is synchronized,
-				// that just means each access is syncronized, its
-				// still possible for another thread to cause it to
-				// be cleared, after this thread gets it position.
-				// So, if that happens, all we can do is reset to beginning.
-				// This should be extremely rare (in other words, probably
-				// not worth using synchronized blocks
-				// to access cachedRegionPositionArray.
-				reinitThreadLocalPosition();
-				resetToInitialState();
-			}
-		}
-	}
-
-	/**
-	 * This NullDocumentEvent is used to complete the "aboutToChange" and
-	 * "changed" cycle, when in fact the original change is no longer valid.
-	 * The only known (valid) case of this is when a model re-initialize takes
-	 * place, which causes setText to be called in the middle of some previous
-	 * change. [This architecture will be improved in future].
-	 */
-	public class NullDocumentEvent extends DocumentEvent {
-		public NullDocumentEvent() {
-			this(BasicStructuredDocument.this, 0, 0, ""); //$NON-NLS-1$
-		}
-
-		private NullDocumentEvent(IDocument doc, int offset, int length, String text) {
-			super(doc, offset, length, text);
-		}
-	}
-
-	class RegisteredReplace {
-		/** The owner of this replace operation. */
-		IDocumentListener fOwner;
-		/** The replace operation */
-		IDocumentExtension.IReplace fReplace;
-
-		/**
-		 * Creates a new bundle object.
-		 * 
-		 * @param owner
-		 *            the document listener owning the replace operation
-		 * @param replace
-		 *            the replace operation
-		 */
-		RegisteredReplace(IDocumentListener owner, IDocumentExtension.IReplace replace) {
-			fOwner = owner;
-			fReplace = replace;
-		}
-	}
-
-	/**
-	 * these control variable isn't mark as 'final' since there's some unit
-	 * tests that manipulate it. For final product, it should be.
-	 */
-
-	private static boolean USE_LOCAL_THREAD = true;
-
-	/**
-	 * purely for debugging/performance measurements In practice, would always
-	 * be 'true'. (and should never be called by called by clients). Its not
-	 * 'final' or private just so it can be varied during
-	 * debugging/performance measurement runs.
-	 * 
-	 * @param use_local_thread
-	 */
-	public static void setUSE_LOCAL_THREAD(final boolean use_local_thread) {
-		USE_LOCAL_THREAD = use_local_thread;
-	}
-
-	private IStructuredDocumentRegion cachedDocumentRegion;
-	private EncodingMemento encodingMemento;
-	private boolean fAcceptPostNotificationReplaces = true;
-	private CurrentDocumentRegionCache fCurrentDocumnetRegionCache;
-	private DocumentEvent fDocumentEvent;
-	private IDocumentListener[] fDocumentListeners;
-
-	/**
-	 * The registered document partitioners.
-	 */
-	private Map fDocumentPartitioners;
-	/** The registered document partitioning listeners */
-	private List fDocumentPartitioningListeners;
-	private IStructuredDocumentRegion firstDocumentRegion;
-	private RegionParser fParser;
-	private GenericPositionManager fPositionManager;
-	private List fPostNotificationChanges;
-	private IDocumentListener[] fPrenotifiedDocumentListeners;
-	private int fReentranceCount = 0;
-	private IStructuredTextReParser fReParser;
-	private int fStoppedCount = 0;
-
-	private ITextStore fStore;
-	private Object[] fStructuredDocumentAboutToChangeListeners;
-	private Object[] fStructuredDocumentChangedListeners;
-	private Object[] fStructuredDocumentChangingListeners;
-
-	private ILineTracker fTracker;
-	private IStructuredTextUndoManager fUndoManager;
-	private IStructuredDocumentRegion lastDocumentRegion;
-
-	private byte[] listenerLock = new byte[0];
-	private NullDocumentEvent NULL_DOCUMENT_EVENT;
-
-	//
-	/**
-	 * in case preferred delimiter is not set, we'll assume the platform
-	 * default Note: it is not final static to make sure it won't be inlined
-	 * by compiler.
-	 */
-	private final String PlatformLineDelimiter = System.getProperty("line.separator"); //$NON-NLS-1$
-	/**
-	 * theoretically, a document can contain mixed line delimiters
-	 */
-	private String preferedDelimiter;
-	private final String READ_ONLY_REGIONS_CATEGORY = "_READ_ONLY_REGIONS_CATEGORY_"; //$NON-NLS-1$
-	/**
-	 * debug variable only
-	 * 
-	 * @param parser
-	 */
-	private long startStreamTime;
-	/**
-	 * debug variable only
-	 * 
-	 * @param parser
-	 */
-	private long startTime;
-
-	public BasicStructuredDocument() {
-		super();
-		fCurrentDocumnetRegionCache = new CurrentDocumentRegionCache();
-		fStore = new StructuredDocumentTextStore(50, 300);
-		setLineTracker(new DefaultLineTracker());
-		NULL_DOCUMENT_EVENT = new NullDocumentEvent();
-
-		internal_addPositionCategory(READ_ONLY_REGIONS_CATEGORY);
-		internal_addPositionUpdater(new DeleteEqualPositionUpdater(READ_ONLY_REGIONS_CATEGORY));
-
-	}
-
-	/**
-	 * This is the primary way to get a new structuredDocument. Its best to
-	 * use the factory methods in ModelManger to create a new
-	 * IStructuredDocument, since it will get and initialize the parser
-	 * according to the desired content type.
-	 */
-	public BasicStructuredDocument(RegionParser parser) {
-		this();
-		Assert.isNotNull(parser, "Program Error: IStructuredDocument can not be created with null parser"); //$NON-NLS-1$
-		// go through setter in case there is side effects
-		internal_setParser(parser);
-	}
-
-	private void _clearDocumentEvent() {
-		// no hard and fast requirement to null out ... just seems like
-		// a good idea, since we are done with it.
-		fDocumentEvent = null;
-	}
-
-	private void _fireDocumentAboutToChange(Object[] listeners) {
-		// most DocumentAboutToBeChanged listeners do not anticipate
-		// DocumentEvent == null. So make sure documentEvent is not
-		// null. (this should never happen, yet it does sometimes)
-		if (fDocumentEvent == null) {
-			fDocumentEvent = new NullDocumentEvent();
-		}
-		// we must assign listeners to local variable, since the add and
-		// remove
-		// listner
-		// methods can change the actual instance of the listener array from
-		// another thread
-		if (listeners != null) {
-			Object[] holdListeners = listeners;
-			// Note: the docEvent is created in replaceText API
-			// fire
-			for (int i = 0; i < holdListeners.length; i++) {
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					startTime = System.currentTimeMillis();
-				}
-				// safeguard from listeners that throw exceptions
-				try {
-					// this is a safe cast, since addListners requires a
-					// IStructuredDocumentListener
-					((IDocumentListener) holdListeners[i]).documentAboutToBeChanged(fDocumentEvent);
-				}
-				catch (Exception exception) {
-					Logger.logException(exception);
-				}
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					long stopTime = System.currentTimeMillis();
-					System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
-				}
-			}
-		}
-	}
-
-	private void notifyDocumentPartitionersAboutToChange(DocumentEvent documentEvent) {
-		if (fDocumentPartitioners != null) {
-			Iterator e = fDocumentPartitioners.values().iterator();
-			while (e.hasNext()) {
-				IDocumentPartitioner p = (IDocumentPartitioner) e.next();
-				// safeguard from listeners that throw exceptions
-				try {
-					p.documentAboutToBeChanged(documentEvent);
-				}
-				catch (Exception exception) {
-					Logger.logException(exception);
-				}
-			}
-		}
-	}
-
-	private void _fireDocumentChanged(Object[] listeners, StructuredDocumentEvent event) {
-
-		// we must assign listeners to local variable, since the add and
-		// remove
-		// listner
-		// methods can change the actual instance of the listener array from
-		// another thread
-		if (listeners != null) {
-			Object[] holdListeners = listeners;
-			// NOTE: document event is created in replace Text API and setText
-			// API
-			// now fire
-			for (int i = 0; i < holdListeners.length; i++) {
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					startTime = System.currentTimeMillis();
-				}
-
-				// safeguard from listeners that throw exceptions
-				try {
-					// this is a safe cast, since addListners requires a
-					// IStructuredDocumentListener
-					// Notes: fDocumentEvent can be "suddenly" null, if one of
-					// the
-					// previous changes
-					// caused a "setText" to be called. The only known case of
-					// this
-					// is a model reset
-					// due to page directive changing. Eventually we should
-					// change
-					// archetecture to have
-					// event que and be able to "cancel" pending events, but
-					// for
-					// now, we'll just pass a
-					// NullDocumentEvent. By the way, it is important to send
-					// something, since clients might
-					// have indeterminant state due to "aboutToChange" being
-					// sent
-					// earlier.
-					if (fDocumentEvent == null) {
-						((IDocumentListener) holdListeners[i]).documentChanged(NULL_DOCUMENT_EVENT);
-					}
-					else {
-						((IDocumentListener) holdListeners[i]).documentChanged(fDocumentEvent);
-					}
-				}
-				catch (Exception exception) {
-					Logger.logException(exception);
-				}
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					long stopTime = System.currentTimeMillis();
-					System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
-				}
-			}
-		}
-	}
-
-	private void notifyDocumentPartitionersDocumentChanged(DocumentEvent documentEvent) {
-		if (fDocumentPartitioners != null) {
-			Iterator e = fDocumentPartitioners.values().iterator();
-			while (e.hasNext()) {
-				IDocumentPartitioner p = (IDocumentPartitioner) e.next();
-				// safeguard from listeners that throw exceptions
-				try {
-					if (p instanceof IDocumentPartitionerExtension) {
-						// IRegion changedPartion =
-						((IDocumentPartitionerExtension) p).documentChanged2(documentEvent);
-					}
-					else {
-						p.documentChanged(documentEvent);
-					}
-				}
-				catch (Exception exception) {
-					Logger.logException(exception);
-				}
-			}
-		}
-	}
-
-
-	private void _fireEvent(Object[] listeners, NoChangeEvent event) {
-		// we must assign listeners to local variable, since the add and
-		// remove
-		// listner
-		// methods can change the actual instance of the listener array from
-		// another thread
-		if (listeners != null) {
-			Object[] holdListeners = listeners;
-			for (int i = 0; i < holdListeners.length; i++) {
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					startTime = System.currentTimeMillis();
-				}
-				// safeguard from listeners that throw exceptions
-				try {
-					// this is a safe cast, since addListners requires a
-					// IStructuredDocumentListener
-					((IStructuredDocumentListener) holdListeners[i]).noChange(event);
-				}
-				catch (Exception exception) {
-					Logger.logException(exception);
-				}
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					long stopTime = System.currentTimeMillis();
-					System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
-				}
-			}
-		}
-	}
-
-	private void _fireEvent(Object[] listeners, RegionChangedEvent event) {
-		// we must assign listeners to local variable, since the add and
-		// remove
-		// listner
-		// methods can change the actual instance of the listener array from
-		// another thread
-		if (listeners != null) {
-			Object[] holdListeners = listeners;
-			for (int i = 0; i < holdListeners.length; i++) {
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					startTime = System.currentTimeMillis();
-				}
-				// safeguard from listeners that throw exceptions
-				try {
-					// this is a safe cast, since addListners requires a
-					// IStructuredDocumentListener
-					((IStructuredDocumentListener) holdListeners[i]).regionChanged(event);
-				}
-				catch (Exception exception) {
-					Logger.logException(exception);
-				}
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					long stopTime = System.currentTimeMillis();
-					System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
-				}
-			}
-		}
-	}
-
-	private void _fireEvent(Object[] listeners, RegionsReplacedEvent event) {
-		// we must assign listeners to local variable, since the add and
-		// remove
-		// listner
-		// methods can change the actual instance of the listener array from
-		// another thread
-		if (listeners != null) {
-			Object[] holdListeners = listeners;
-			for (int i = 0; i < holdListeners.length; i++) {
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					startTime = System.currentTimeMillis();
-				}
-				// safeguard from listeners that throw exceptions
-				try {
-					// this is a safe cast, since addListners requires a
-					// IStructuredDocumentListener
-					((IStructuredDocumentListener) holdListeners[i]).regionsReplaced(event);
-				}
-				catch (Exception exception) {
-					Logger.logException(exception);
-				}
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					long stopTime = System.currentTimeMillis();
-					System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
-				}
-			}
-		}
-	}
-
-	private void _fireEvent(Object[] listeners, StructuredDocumentRegionsReplacedEvent event) {
-		// we must assign listeners to local variable, since the add and
-		// remove
-		// listner
-		// methods can change the actual instance of the listener array from
-		// another thread
-		if (listeners != null) {
-			Object[] holdListeners = listeners;
-			for (int i = 0; i < holdListeners.length; i++) {
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					startTime = System.currentTimeMillis();
-				}
-				// safeguard from listeners that throw exceptions
-				try {
-					// this is a safe cast, since addListners requires a
-					// IStructuredDocumentListener
-					((IStructuredDocumentListener) holdListeners[i]).nodesReplaced(event);
-				}
-				catch (Exception exception) {
-					Logger.logException(exception);
-				}
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					long stopTime = System.currentTimeMillis();
-					System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
-				}
-			}
-		}
-	}
-
-	private void _fireStructuredDocumentAboutToChange(Object[] listeners) {
-		// we must assign listeners to local variable, since the add and
-		// remove
-		// listner
-		// methods can change the actual instance of the listener array from
-		// another thread
-		if (listeners != null) {
-			Object[] holdListeners = listeners;
-			// Note: the docEvent is created in replaceText API
-			// fire
-			for (int i = 0; i < holdListeners.length; i++) {
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					startTime = System.currentTimeMillis();
-				}
-				// safeguard from listeners that throw exceptions
-				try {
-					// notice the AboutToBeChangedEvent is created from the
-					// DocumentEvent, since it is (nearly)
-					// the same information. ?What to do about
-					// originalRequester?
-					if (fDocumentEvent == null) {
-						fDocumentEvent = new NullDocumentEvent();
-					}
-					AboutToBeChangedEvent aboutToBeChangedEvent = new AboutToBeChangedEvent(this, null, fDocumentEvent.getText(), fDocumentEvent.getOffset(), fDocumentEvent.getLength());
-					// this is a safe cast, since addListners requires a
-					// IStructuredDocumentListener
-					((IModelAboutToBeChangedListener) holdListeners[i]).modelAboutToBeChanged(aboutToBeChangedEvent);
-				}
-				catch (Exception exception) {
-					Logger.logException(exception);
-				}
-				if (Debug.perfTest || Debug.perfTestStructuredDocumentEventOnly) {
-					long stopTime = System.currentTimeMillis();
-					System.out.println("\n\t\t\t\t IStructuredDocument::fireStructuredDocumentEvent. Time was " + (stopTime - startTime) + " msecs to fire NewModelEvent to instance of " + holdListeners[i].getClass()); //$NON-NLS-2$//$NON-NLS-1$
-				}
-			}
-		}
-	}
-
-	protected void acquireLock() {
-		// do nothing here in super class
-	}
-
-	/**
-	 * addModelAboutToBeChangedListener method comment.
-	 */
-	public void addDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener) {
-		synchronized (listenerLock) {
-
-			// make sure listener is not already in listening
-			// (and if it is, print a warning to aid debugging, if needed)
-			if (!Utilities.contains(fStructuredDocumentAboutToChangeListeners, listener)) {
-				int oldSize = 0;
-				if (fStructuredDocumentAboutToChangeListeners != null) {
-					// normally won't be null, but we need to be sure, for
-					// first
-					// time through
-					oldSize = fStructuredDocumentAboutToChangeListeners.length;
-				}
-				int newSize = oldSize + 1;
-				Object[] newListeners = new Object[newSize];
-				if (fStructuredDocumentAboutToChangeListeners != null) {
-					System.arraycopy(fStructuredDocumentAboutToChangeListeners, 0, newListeners, 0, oldSize);
-				}
-				// add listener to last position
-				newListeners[newSize - 1] = listener;
-				//
-				// now switch new for old
-				fStructuredDocumentAboutToChangeListeners = newListeners;
-				//
-			}
-		}
-	}
-
-	/**
-	 * The StructuredDocumentListners and ModelChagnedListeners are very
-	 * similar. They both receive identical events. The difference is the
-	 * timing. The "pure" StructuredDocumentListners are notified after the
-	 * structuredDocument has been changed, but before other, related models
-	 * may have been changed such as the Structural Model. The Structural
-	 * model is in fact itself a "pure" StructuredDocumentListner. The
-	 * ModelChangedListeners can rest assured that all models and data have
-	 * been updated from the change by the tiem they are notified. This is
-	 * especially important for the text widget, for example, which may rely
-	 * on both structuredDocument and structural model information.
-	 */
-	public void addDocumentChangedListener(IStructuredDocumentListener listener) {
-		synchronized (listenerLock) {
-
-			if (Debug.debugStructuredDocument) {
-				System.out.println("IStructuredDocument::addModelChangedListener. Request to add an instance of " + listener.getClass() + " as a listener on structuredDocument."); //$NON-NLS-2$//$NON-NLS-1$
-			}
-			// make sure listener is not already in listening
-			// (and if it is, print a warning to aid debugging, if needed)
-			if (Utilities.contains(fStructuredDocumentChangedListeners, listener)) {
-				if (Debug.displayWarnings) {
-					System.out.println("IStructuredDocument::addModelChangedListener. listener " + listener + " was addeded more than once. "); //$NON-NLS-2$//$NON-NLS-1$
-				}
-			}
-			else {
-				if (Debug.debugStructuredDocument) {
-					System.out.println("IStructuredDocument::addModelChangedListener. Adding an instance of " + listener.getClass() + " as a listener on structuredDocument."); //$NON-NLS-2$//$NON-NLS-1$
-				}
-				int oldSize = 0;
-				if (fStructuredDocumentChangedListeners != null) {
-					// normally won't be null, but we need to be sure, for
-					// first
-					// time through
-					oldSize = fStructuredDocumentChangedListeners.length;
-				}
-				int newSize = oldSize + 1;
-				Object[] newListeners = new Object[newSize];
-				if (fStructuredDocumentChangedListeners != null) {
-					System.arraycopy(fStructuredDocumentChangedListeners, 0, newListeners, 0, oldSize);
-				}
-				// add listener to last position
-				newListeners[newSize - 1] = listener;
-				//
-				// now switch new for old
-				fStructuredDocumentChangedListeners = newListeners;
-				//
-				// when a listener is added,
-				// send the new model event to that one particular listener,
-				// so it
-				// can initialize itself with the current state of the model
-				// listener.newModel(new NewModelEvent(this, listener));
-			}
-		}
-	}
-
-	public void addDocumentChangingListener(IStructuredDocumentListener listener) {
-		synchronized (listenerLock) {
-
-			if (Debug.debugStructuredDocument) {
-				System.out.println("IStructuredDocument::addStructuredDocumentListener. Request to add an instance of " + listener.getClass() + " as a listener on structuredDocument."); //$NON-NLS-2$//$NON-NLS-1$
-			}
-			// make sure listener is not already in listening
-			// (and if it is, print a warning to aid debugging, if needed)
-			if (Utilities.contains(fStructuredDocumentChangingListeners, listener)) {
-				if (Debug.displayWarnings) {
-					System.out.println("IStructuredDocument::addStructuredDocumentListener. listener " + listener + " was addeded more than once. "); //$NON-NLS-2$//$NON-NLS-1$
-				}
-			}
-			else {
-				if (Debug.debugStructuredDocument) {
-					System.out.println("IStructuredDocument::addStructuredDocumentListener. Adding an instance of " + listener.getClass() + " as a listener on structuredDocument."); //$NON-NLS-2$//$NON-NLS-1$
-				}
-				int oldSize = 0;
-				if (fStructuredDocumentChangingListeners != null) {
-					// normally won't be null, but we need to be sure, for
-					// first
-					// time through
-					oldSize = fStructuredDocumentChangingListeners.length;
-				}
-				int newSize = oldSize + 1;
-				Object[] newListeners = new Object[newSize];
-				if (fStructuredDocumentChangingListeners != null) {
-					System.arraycopy(fStructuredDocumentChangingListeners, 0, newListeners, 0, oldSize);
-				}
-				// add listener to last position
-				newListeners[newSize - 1] = listener;
-				//
-				// now switch new for old
-				fStructuredDocumentChangingListeners = newListeners;
-				//
-				// when a listener is added,
-				// send the new model event to that one particular listener,
-				// so it
-				// can initialize itself with the current state of the model
-				// listener.newModel(new NewModelEvent(this, listener));
-			}
-		}
-	}
-
-	/**
-	 * We manage our own document listners, instead of delegating to our
-	 * parentDocument, so we can fire at very end (and not when the
-	 * parentDocument changes).
-	 * 
-	 */
-	public void addDocumentListener(IDocumentListener listener) {
-		synchronized (listenerLock) {
-
-			// make sure listener is not already in listening
-			// (and if it is, print a warning to aid debugging, if needed)
-			if (!Utilities.contains(fDocumentListeners, listener)) {
-				int oldSize = 0;
-				if (fDocumentListeners != null) {
-					// normally won't be null, but we need to be sure, for
-					// first
-					// time through
-					oldSize = fDocumentListeners.length;
-				}
-				int newSize = oldSize + 1;
-				IDocumentListener[] newListeners = null;
-				newListeners = new IDocumentListener[newSize];
-				if (fDocumentListeners != null) {
-					System.arraycopy(fDocumentListeners, 0, newListeners, 0, oldSize);
-				}
-				// add listener to last position
-				newListeners[newSize - 1] = listener;
-				// now switch new for old
-				fDocumentListeners = newListeners;
-			}
-		}
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#addDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
-	 * 
-	 * Registers the document partitioning listener with the document. After
-	 * registration the IDocumentPartitioningListener is informed about each
-	 * partition change cause by a document manipulation. If a document
-	 * partitioning listener is also a document listener, the following
-	 * notification sequence is guaranteed if a document manipulation changes
-	 * the document partitioning: 1)
-	 * listener.documentAboutToBeChanged(DocumentEvent); 2)
-	 * listener.documentPartitioningChanged(); 3)
-	 * listener.documentChanged(DocumentEvent); If the listener is already
-	 * registered nothing happens.
-	 * 
-	 * @see IDocumentPartitioningListener
-	 */
-
-	public void addDocumentPartitioningListener(IDocumentPartitioningListener listener) {
-		synchronized (listenerLock) {
-
-			Assert.isNotNull(listener);
-			if (fDocumentPartitioningListeners == null) {
-				fDocumentPartitioningListeners = new ArrayList(1);
-			}
-			if (!fDocumentPartitioningListeners.contains(listener))
-				fDocumentPartitioningListeners.add(listener);
-		}
-	}
-
-	/**
-	 * Adds the position to the document's default position category. The
-	 * default category must be specified by the implementer. A position that
-	 * has been added to a position category is updated at each change applied
-	 * to the document.
-	 * 
-	 * @exception BadLocationException
-	 *                If position is not a valid range in the document
-	 */
-	public void addPosition(Position position) throws BadLocationException {
-		getPositionManager().addPosition(position);
-	}
-
-	/**
-	 * @see IDocument#addPosition
-	 * @exception BadLocationException
-	 *                If position is not a valid range in the document
-	 * @exception BadPositionCategoryException
-	 *                If the category is not defined for the document
-	 */
-	public void addPosition(String category, Position position) throws BadLocationException, BadPositionCategoryException {
-		getPositionManager().addPosition(category, position);
-	}
-
-	/**
-	 * @see IDocument#addPositionCategory
-	 */
-	public void addPositionCategory(String category) {
-		internal_addPositionCategory(category);
-	}
-
-	/**
-	 * @see IDocument#addPositionUpdater
-	 */
-	public void addPositionUpdater(IPositionUpdater updater) {
-		internal_addPositionUpdater(updater);
-	}
-
-	/**
-	 * Adds the given document listener as one which is notified before those
-	 * document listeners added with <code>addDocumentListener</code> are
-	 * notified. If the given listener is also registered using
-	 * <code>addDocumentListener</code> it will be notified twice. If the
-	 * listener is already registered nothing happens.
-	 * <p>
-	 * 
-	 * This method is not for public use, it may only be called by
-	 * implementers of <code>IDocumentAdapter</code> and only if those
-	 * implementers need to implement <code>IDocumentListener</code>.
-	 * 
-	 * @param documentAdapter
-	 *            the listener to be added as prenotified document listener
-	 */
-	public void addPrenotifiedDocumentListener(IDocumentListener documentAdapter) {
-		synchronized (listenerLock) {
-
-			if (fPrenotifiedDocumentListeners != null) {
-				int previousSize = fPrenotifiedDocumentListeners.length;
-				IDocumentListener[] listeners = new IDocumentListener[previousSize + 1];
-				System.arraycopy(fPrenotifiedDocumentListeners, 0, listeners, 0, previousSize);
-				listeners[previousSize] = documentAdapter;
-				fPrenotifiedDocumentListeners = listeners;
-			}
-			else {
-				fPrenotifiedDocumentListeners = new IDocumentListener[1];
-				fPrenotifiedDocumentListeners[0] = documentAdapter;
-			}
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.CharSequence#charAt(int)
-	 */
-	public char charAt(int arg0) {
-		try {
-			return getChar(0);
-		}
-		catch (BadLocationException e) {
-			throw new IndexOutOfBoundsException();
-		}
-	}
-
-	/**
-	 * This form of the API removes all read only positions, as should be done
-	 * we 'setText' is called. Note: an alternative algorithm may simply
-	 * remove the category (and it would get added back in later, if/when
-	 * readonly regions added.
-	 */
-	private void clearReadOnly() {
-		Position[] positions = null;
-		try {
-			positions = getPositions(READ_ONLY_REGIONS_CATEGORY);
-		}
-		catch (BadPositionCategoryException e) {
-			Logger.logException("program error: should never occur", e); //$NON-NLS-1$
-		}
-		for (int i = 0; i < positions.length; i++) {
-			Position position = positions[i];
-			// note we don't fire the "about to change" or "changed" events,
-			// since presumably, text is all going away and being replaced
-			// anyway.
-			position.delete();
-		}
-	}
-
-
-	public void clearReadOnly(int startOffset, int length) {
-		// TODO DW I still need to implement smarter algorithm that
-		// adust existing RO regions, if needed. For now, I'll just
-		// remove any that overlap.
-		try {
-			Position[] positions = getPositions(READ_ONLY_REGIONS_CATEGORY);
-			for (int i = 0; i < positions.length; i++) {
-				Position position = positions[i];
-				if (position.overlapsWith(startOffset, length)) {
-					String effectedText = this.get(startOffset, length);
-					// fDocumentEvent = new DocumentEvent(this, startOffset,
-					// length, effectedText);
-					fireReadOnlyAboutToBeChanged();
-					position.delete();
-					NoChangeEvent noChangeEvent = new NoChangeEvent(this, null, effectedText, startOffset, length);
-					noChangeEvent.reason = NoChangeEvent.READ_ONLY_STATE_CHANGE;
-					fireReadOnlyStructuredDocumentEvent(noChangeEvent);
-				}
-			}
-		}
-		catch (BadPositionCategoryException e) {
-			// just means no readonly regions been defined yet
-			// so nothing to do.
-		}
-	}
-
-	/**
-	 * Computes the index at which a <code>Position</code> with the
-	 * specified offset would be inserted into the given category. As the
-	 * ordering inside a category only depends on the offset, the index must
-	 * be choosen to be the first of all positions with the same offset.
-	 * 
-	 * @param category
-	 *            the category in which would be added
-	 * @param offset
-	 *            the position offset to be considered
-	 * @return the index into the category
-	 * @exception BadLocationException
-	 *                if offset is invalid in this document
-	 * @exception BadPositionCategoryException
-	 *                if category is undefined in this document
-	 */
-	public int computeIndexInCategory(String category, int offset) throws org.eclipse.jface.text.BadPositionCategoryException, org.eclipse.jface.text.BadLocationException {
-		return getPositionManager().computeIndexInCategory(category, offset);
-	}
-
-	/**
-	 * Computes the number of lines in the given text. For a given implementer
-	 * of this interface this method returns the same result as
-	 * <code>set(text); getNumberOfLines()</code>.
-	 * 
-	 * @param text
-	 *            the text whose number of lines should be computed
-	 * @return the number of lines in the given text
-	 */
-	public int computeNumberOfLines(String text) {
-		return getTracker().computeNumberOfLines(text);
-	}
-
-	/**
-	 * Computes the partitioning of the given document range using the
-	 * document's partitioner.
-	 * 
-	 * @param offset
-	 *            the document offset at which the range starts
-	 * @param length
-	 *            the length of the document range
-	 * @return a specification of the range's partitioning
-	 * @throws BadLocationException
-	 * @throws BadPartitioningException
-	 */
-	public ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException {
-		ITypedRegion[] typedRegions = null;
-		try {
-			typedRegions = computePartitioning(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, offset, length, false);
-		}
-		catch (BadPartitioningException e) {
-			// impossible in this context
-			throw new Error(e);
-		}
-		if (typedRegions == null) {
-			typedRegions = new ITypedRegion[0];
-		}
-		return typedRegions;
-	}
-
-
-	public ITypedRegion[] computePartitioning(String partitioning, int offset, int length, boolean includeZeroLengthPartitions) throws BadLocationException, BadPartitioningException {
-		if ((0 > offset) || (0 > length) || (offset + length > getLength()))
-			throw new BadLocationException();
-
-		IDocumentPartitioner partitioner = getDocumentPartitioner(partitioning);
-
-		if (partitioner instanceof IDocumentPartitionerExtension2)
-			return ((IDocumentPartitionerExtension2) partitioner).computePartitioning(offset, length, includeZeroLengthPartitions);
-		else if (partitioner != null)
-			return partitioner.computePartitioning(offset, length);
-		else if (IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING.equals(partitioning))
-			return new TypedRegion[]{new TypedRegion(offset, length, DEFAULT_CONTENT_TYPE)};
-		else
-			throw new BadPartitioningException();
-	}
-
-	/**
-	 * @see IDocument#containsPosition
-	 */
-	public boolean containsPosition(String category, int offset, int length) {
-		return getPositionManager().containsPosition(category, offset, length);
-	}
-
-	/**
-	 * @see IDocument#containsPositionCategory
-	 */
-	public boolean containsPositionCategory(String category) {
-		return getPositionManager().containsPositionCategory(category);
-	}
-
-	public boolean containsReadOnly(int startOffset, int length) {
-		boolean result = false;
-		try {
-			Position[] positions = getPositions(READ_ONLY_REGIONS_CATEGORY);
-			for (int i = 0; i < positions.length; i++) {
-				Position position = positions[i];
-				if (position.overlapsWith(startOffset, length)) {
-					result = true;
-					break;
-				}
-			}
-		}
-		catch (BadPositionCategoryException e) {
-			// just means no readonly regions been defined yet
-			// so obviously false
-			result = false;
-		}
-		return result;
-	}
-
-	private void executePostNotificationChanges() {
-		if (fStoppedCount > 0)
-			return;
-		while (fPostNotificationChanges != null) {
-			List changes = fPostNotificationChanges;
-			fPostNotificationChanges = null;
-			Iterator e = changes.iterator();
-			while (e.hasNext()) {
-				RegisteredReplace replace = (RegisteredReplace) e.next();
-				replace.fReplace.perform(this, replace.fOwner);
-			}
-		}
-	}
-
-	private void fireDocumentAboutToChanged() {
-		// most DocumentAboutToBeChanged listeners do not anticipate
-		// DocumentEvent == null. So make sure documentEvent is not
-		// null. (this should never happen, yet it does sometimes)
-		if (fDocumentEvent == null) {
-			fDocumentEvent = new NullDocumentEvent();
-		}
-
-		_fireStructuredDocumentAboutToChange(fStructuredDocumentAboutToChangeListeners);
-		// Note: the docEvent is created in replaceText API! (or set Text)
-		_fireDocumentAboutToChange(fPrenotifiedDocumentListeners);
-		notifyDocumentPartitionersAboutToChange(fDocumentEvent);
-		_fireDocumentAboutToChange(fDocumentListeners);
-	}
-
-	/**
-	 * Fires the document partitioning changed notification to all registered
-	 * document partitioning listeners. Uses a robust iterator.
-	 * 
-	 * @param event
-	 *            the document partitioning changed event
-	 * 
-	 * @see IDocumentPartitioningListenerExtension2
-	 */
-	protected void fireDocumentPartitioningChanged(DocumentPartitioningChangedEvent event) {
-		if (fDocumentPartitioningListeners == null || fDocumentPartitioningListeners.size() == 0)
-			return;
-
-		List list = new ArrayList(fDocumentPartitioningListeners);
-		Iterator e = list.iterator();
-		while (e.hasNext()) {
-			IDocumentPartitioningListener l = (IDocumentPartitioningListener) e.next();
-			if (l instanceof IDocumentPartitioningListenerExtension2) {
-				IDocumentPartitioningListenerExtension2 extension2 = (IDocumentPartitioningListenerExtension2) l;
-				extension2.documentPartitioningChanged(event);
-			}
-			else if (l instanceof IDocumentPartitioningListenerExtension) {
-				IDocumentPartitioningListenerExtension extension = (IDocumentPartitioningListenerExtension) l;
-				extension.documentPartitioningChanged(this, event.getCoverage());
-			}
-			else {
-				l.documentPartitioningChanged(this);
-			}
-		}
-
-	}
-
-	private void fireReadOnlyAboutToBeChanged() {
-		_fireStructuredDocumentAboutToChange(fStructuredDocumentAboutToChangeListeners);
-		// Note: the docEvent is created in replaceText API! (or set Text)
-		// _fireDocumentAboutToChange(fPrenotifiedDocumentListeners);
-		// _fireDocumentAboutToChange(fDocumentListeners);
-	}
-
-	private void fireReadOnlyStructuredDocumentEvent(NoChangeEvent event) {
-		_fireEvent(fStructuredDocumentChangingListeners, event);
-		_fireEvent(fStructuredDocumentChangedListeners, event);
-		// _fireDocumentChanged(fPrenotifiedDocumentListeners, event);
-		// _fireDocumentChanged(fDocumentListeners, event);
-		// _clearDocumentEvent();
-	}
-
-	private void fireStructuredDocumentEvent(NoChangeEvent event) {
-		_fireEvent(fStructuredDocumentChangingListeners, event);
-		_fireEvent(fStructuredDocumentChangedListeners, event);
-		_fireDocumentChanged(fPrenotifiedDocumentListeners, event);
-		notifyDocumentPartitionersDocumentChanged(event);
-		_fireDocumentChanged(fDocumentListeners, event);
-		_clearDocumentEvent();
-	}
-
-	private void fireStructuredDocumentEvent(RegionChangedEvent event) {
-		_fireEvent(fStructuredDocumentChangingListeners, event);
-		_fireEvent(fStructuredDocumentChangedListeners, event);
-		_fireDocumentChanged(fPrenotifiedDocumentListeners, event);
-		notifyDocumentPartitionersDocumentChanged(event);
-		_fireDocumentChanged(fDocumentListeners, event);
-		_clearDocumentEvent();
-	}
-
-	private void fireStructuredDocumentEvent(RegionsReplacedEvent event) {
-		_fireEvent(fStructuredDocumentChangingListeners, event);
-		_fireEvent(fStructuredDocumentChangedListeners, event);
-		_fireDocumentChanged(fPrenotifiedDocumentListeners, event);
-		notifyDocumentPartitionersDocumentChanged(event);
-		_fireDocumentChanged(fDocumentListeners, event);
-		_clearDocumentEvent();
-	}
-
-	private void fireStructuredDocumentEvent(StructuredDocumentRegionsReplacedEvent event) {
-		_fireEvent(fStructuredDocumentChangingListeners, event);
-		_fireEvent(fStructuredDocumentChangedListeners, event);
-		_fireDocumentChanged(fPrenotifiedDocumentListeners, event);
-		notifyDocumentPartitionersDocumentChanged(event);
-		_fireDocumentChanged(fDocumentListeners, event);
-		_clearDocumentEvent();
-	}
-
-	/**
-	 * Returns the document's complete text.
-	 */
-	public String get() {
-		return getStore().get(0, getLength());
-	}
-
-	/**
-	 * Returns length characters from the document's text starting from the
-	 * specified position.
-	 * 
-	 * @throws BadLocationException
-	 * 
-	 * @exception BadLocationException
-	 *                If the range is not valid in the document
-	 */
-	public String get(int offset, int length) {
-		String result = null;
-		int myLength = getLength();
-		if (0 > offset)
-			offset = 0;
-		if (0 > length)
-			length = 0;
-		if (offset + length > myLength) {
-			// first try adjusting length to fit
-			int lessLength = myLength - offset;
-			if ((lessLength >= 0) && (offset + lessLength == myLength)) {
-				length = lessLength;
-			}
-			else {
-				// second, try offset
-				int moreOffset = myLength - length;
-				if ((moreOffset >= 0) && (moreOffset + length == myLength)) {
-					offset = moreOffset;
-				}
-				else {
-					// can happen if myLength is 0.
-					// no adjustment possible.
-					result = new String();
-				}
-			}
-
-		}
-		if (result == null) {
-			result = getStore().get(offset, length);
-		}
-		return result;
-	}
-
-	public Object getAdapter(Class adapter) {
-		return Platform.getAdapterManager().getAdapter(this, adapter);
-	}
-
-	IStructuredDocumentRegion getCachedDocumentRegion() {
-		IStructuredDocumentRegion result = null;
-		if (USE_LOCAL_THREAD) {
-			result = fCurrentDocumnetRegionCache.get();
-		}
-		else {
-			result = cachedDocumentRegion;
-		}
-		return result;
-	}
-
-	/**
-	 * @see IDocument#getChar
-	 * @exception BadLocationException
-	 *                If position is not a valid range in the document
-	 */
-	public char getChar(int pos) throws BadLocationException {
-		char result = 0x00;
-		try {
-			result = getStore().get(pos);
-		}
-		catch (IndexOutOfBoundsException e) {
-			throw new BadLocationException(e.getLocalizedMessage());
-		}
-		return result;
-	}
-
-	/**
-	 * Returns the type of the document partition containing the given
-	 * character position.
-	 */
-	public String getContentType(int offset) throws BadLocationException {
-		return getDocumentPartitioner().getContentType(offset);
-	}
-
-
-	public String getContentType(String partitioning, int offset, boolean preferOpenPartitions) throws BadLocationException, BadPartitioningException {
-		if ((0 > offset) || (offset > getLength()))
-			throw new BadLocationException();
-
-		IDocumentPartitioner partitioner = getDocumentPartitioner(partitioning);
-
-		if (partitioner instanceof IDocumentPartitionerExtension2)
-			return ((IDocumentPartitionerExtension2) partitioner).getContentType(offset, preferOpenPartitions);
-		else if (partitioner != null)
-			return partitioner.getContentType(offset);
-		else if (IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING.equals(partitioning))
-			return DEFAULT_CONTENT_TYPE;
-		else
-			throw new BadPartitioningException();
-	}
-
-	/**
-	 * Returns the document's partitioner.
-	 * 
-	 * @see IDocumentPartitioner
-	 */
-	public IDocumentPartitioner getDocumentPartitioner() {
-		return getDocumentPartitioner(IDocumentExtension3.DEFAULT_PARTITIONING);
-	}
-
-
-	public IDocumentPartitioner getDocumentPartitioner(String partitioning) {
-
-		IDocumentPartitioner documentPartitioner = null;
-		if (fDocumentPartitioners != null) {
-			documentPartitioner = (IDocumentPartitioner) fDocumentPartitioners.get(partitioning);
-		}
-		return documentPartitioner;
-	}
-
-	public EncodingMemento getEncodingMemento() {
-		return encodingMemento;
-	}
-
-	public IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
-		// should we update cachedNode?
-		// We should to keep consistent philosophy of remembering last
-		// requested position,
-		// for efficiency.
-		setCachedDocumentRegion(firstDocumentRegion);
-		return firstDocumentRegion;
-	}
-
-	public IStructuredDocumentRegion getLastStructuredDocumentRegion() {
-		// should we update cachedNode?
-		// We should to keep consistent philosophy of remembering last
-		// requested position,
-		// for efficiency.
-		setCachedDocumentRegion(lastDocumentRegion);
-		return lastDocumentRegion;
-	}
-
-	/*
-	 * -------------------------- partitions
-	 * ----------------------------------
-	 */
-	public String[] getLegalContentTypes() {
-		String[] result = null;
-		try {
-			result = getLegalContentTypes(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
-		}
-		catch (BadPartitioningException e) {
-			// impossible in this context
-			throw new Error(e);
-		}
-		return result;
-	}
-
-	public String[] getLegalContentTypes(String partitioning) throws BadPartitioningException {
-		IDocumentPartitioner partitioner = getDocumentPartitioner(partitioning);
-		if (partitioner != null)
-			return partitioner.getLegalContentTypes();
-		if (IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING.equals(partitioning))
-			return new String[]{DEFAULT_CONTENT_TYPE};
-		throw new BadPartitioningException();
-	}
-
-	/*
-	 * ------------------ line delimiter conversion
-	 * ---------------------------
-	 */
-	public String[] getLegalLineDelimiters() {
-		return getTracker().getLegalLineDelimiters();
-	}
-
-	/**
-	 * @see IDocument#getLength
-	 */
-	public int getLength() {
-		return getStore().getLength();
-	}
-
-	public String getLineDelimiter() {
-		if (preferedDelimiter == null) {
-			preferedDelimiter = PlatformLineDelimiter;
-		}
-		return preferedDelimiter;
-	}
-
-	/**
-	 * Returns the line delimiter of that line
-	 * 
-	 * @exception BadLocationException
-	 *                If the line number is invalid in the document
-	 */
-	public String getLineDelimiter(int line) throws org.eclipse.jface.text.BadLocationException {
-		return getTracker().getLineDelimiter(line);
-	}
-
-	/**
-	 * Returns a description of the specified line. The line is described by
-	 * its offset and its length excluding the line's delimiter.
-	 * 
-	 * @param line
-	 *            the line of interest
-	 * @return a line description
-	 * @exception BadLocationException
-	 *                if the line number is invalid in this document
-	 */
-	public org.eclipse.jface.text.IRegion getLineInformation(int line) throws org.eclipse.jface.text.BadLocationException {
-		return getTracker().getLineInformation(line);
-	}
-
-	/**
-	 * Returns a description of the line at the given offset. The description
-	 * contains the offset and the length of the line excluding the line's
-	 * delimiter.
-	 * 
-	 * @param offset
-	 *            the offset whose line should be described
-	 * @return a region describing the line
-	 * @exception BadLocationException
-	 *                if offset is invalid in this document
-	 */
-	public org.eclipse.jface.text.IRegion getLineInformationOfOffset(int offset) throws org.eclipse.jface.text.BadLocationException {
-		return getTracker().getLineInformationOfOffset(offset);
-	}
-
-	/*
-	 * ---------------------- line information
-	 * --------------------------------
-	 */
-	public int getLineLength(int line) throws org.eclipse.jface.text.BadLocationException {
-		return getTracker().getLineLength(line);
-	}
-
-	/**
-	 * Determines the offset of the first character of the given line.
-	 * 
-	 * @param line
-	 *            the line of interest
-	 * @return the document offset
-	 * @exception BadLocationException
-	 *                if the line number is invalid in this document
-	 */
-	public int getLineOffset(int line) throws org.eclipse.jface.text.BadLocationException {
-		return getTracker().getLineOffset(line);
-	}
-
-	public int getLineOfOffset(int offset) {
-		int result = -1;
-		try {
-			result = getTracker().getLineNumberOfOffset(offset);
-		}
-		catch (BadLocationException e) {
-			if (Logger.DEBUG_DOCUMENT)
-				Logger.log(Logger.INFO, "Dev. Program Info Only: IStructuredDocument::getLineOfOffset: offset out of range, zero assumed. offset = " + offset, e); //$NON-NLS-1$ //$NON-NLS-2$
-			result = 0;
-		}
-		return result;
-	}
-
-	/**
-	 * Returns the number of lines in this document
-	 * 
-	 * @return the number of lines in this document
-	 */
-	public int getNumberOfLines() {
-		return getTracker().getNumberOfLines();
-	}
-
-	/**
-	 * Returns the number of lines which are occupied by a given text range.
-	 * 
-	 * @param offset
-	 *            the offset of the specified text range
-	 * @param length
-	 *            the length of the specified text range
-	 * @return the number of lines occupied by the specified range
-	 * @exception BadLocationException
-	 *                if specified range is invalid in this tracker
-	 */
-	public int getNumberOfLines(int offset, int length) throws org.eclipse.jface.text.BadLocationException {
-		return getTracker().getNumberOfLines(offset, length);
-	}
-
-	/**
-	 * This is public, temporarily, for use by tag lib classes.
-	 */
-	public RegionParser getParser() {
-		if (fParser == null) {
-			throw new IllegalStateException("IStructuredDocument::getParser. Parser needs to be set before use"); //$NON-NLS-1$
-		}
-		return fParser;
-	}
-
-	/**
-	 * Returns the document partition in which the position is located. The
-	 * partition is specified as typed region.
-	 */
-	public ITypedRegion getPartition(int offset) throws BadLocationException {
-		ITypedRegion partition = null;
-		try {
-			partition = getPartition(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, offset, false);
-		}
-		catch (BadPartitioningException e) {
-			throw new Error(e);
-		}
-		if (partition == null) {
-			throw new Error();
-		}
-		return partition;
-	}
-
-
-	public ITypedRegion getPartition(String partitioning, int offset, boolean preferOpenPartitions) throws BadLocationException, BadPartitioningException {
-		if ((0 > offset) || (offset > getLength()))
-			throw new BadLocationException();
-		ITypedRegion result = null;
-
-		IDocumentPartitioner partitioner = getDocumentPartitioner(partitioning);
-
-		if (partitioner instanceof IDocumentPartitionerExtension2) {
-			result = ((IDocumentPartitionerExtension2) partitioner).getPartition(offset, preferOpenPartitions);
-		}
-		else if (partitioner != null) {
-			result = partitioner.getPartition(offset);
-		}
-		else if (IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING.equals(partitioning)) {
-			result = new TypedRegion(0, getLength(), DEFAULT_CONTENT_TYPE);
-		}
-		else
-			throw new BadPartitioningException();
-		return result;
-	}
-
-
-	public String[] getPartitionings() {
-		if (fDocumentPartitioners == null)
-			return new String[0];
-		String[] partitionings = new String[fDocumentPartitioners.size()];
-		fDocumentPartitioners.keySet().toArray(partitionings);
-		return partitionings;
-	}
-
-	/**
-	 * Returns all position categories added to this document.
-	 */
-	public String[] getPositionCategories() {
-		return getPositionManager().getPositionCategories();
-	}
-
-	/**
-	 * @return Returns the positionManager.
-	 */
-	private GenericPositionManager getPositionManager() {
-		if (fPositionManager == null) {
-			fPositionManager = new GenericPositionManager(this);
-		}
-		return fPositionManager;
-	}
-
-	/**
-	 * Returns all Positions of the given position category.
-	 * 
-	 * @exception BadPositionCategoryException
-	 *                If category is not defined for the document
-	 */
-	public Position[] getPositions(String category) throws org.eclipse.jface.text.BadPositionCategoryException {
-		return getPositionManager().getPositions(category);
-	}
-
-	/**
-	 * @see IDocument#getPositionUpdaters
-	 */
-	public IPositionUpdater[] getPositionUpdaters() {
-		return getPositionManager().getPositionUpdaters();
-	}
-
-	/**
-	 * This method can return null, which is the case if the offset is just
-	 * before or just after the existing text. Compare with
-	 * getNodeAtCharacterOffset.
-	 */
-	public IStructuredDocumentRegion getRegionAtCharacterOffset(int offset) {
-		IStructuredDocumentRegion result = null;
-
-		// FIXME: need to synch on 'cachedRegion' (but since that's a
-		// constantly changing object, we
-		// can't, so need to add a "region_lock" object, and use it here, and
-		// in re-parser.
-		// Oh, and need to make sure, after synch, that the region is not
-		// deleted, and if so, I guess go back
-		// to the beginning!
-
-		// cached node can be null when document is empty
-		IStructuredDocumentRegion potentialCachedRegion = getCachedDocumentRegion();
-		if (potentialCachedRegion != null) {
-
-			// 
-
-			// if we already have the right node, return that.
-			if (potentialCachedRegion.containsOffset(offset)) {
-				result = potentialCachedRegion;
-			}
-			else {
-				// first, find out what direction to go, relative to
-				// cachedNode.
-				// negative means "towards the front" of the file,
-				// postitive
-				// means
-				// towards the end.
-				int direction = offset - potentialCachedRegion.getStart();
-				if (direction < 0) {
-					// search towards beginning
-					while (!potentialCachedRegion.containsOffset(offset)) {
-						IStructuredDocumentRegion tempNode = potentialCachedRegion.getPrevious();
-						if (tempNode == null) {
-							break;
-						}
-						else {
-							potentialCachedRegion = tempNode;
-						}
-					}
-				}
-				else {
-					// search towards end
-					// There is a legitamat condition where the
-					// offset will not be contained in any node,
-					// which is if the offset is just past the last
-					// character of text.
-					// And, we must gaurd against setting cachedNode to
-					// null!
-					while (!potentialCachedRegion.containsOffset(offset)) {
-						IStructuredDocumentRegion tempNode = potentialCachedRegion.getNext();
-						if (tempNode == null)
-							break;
-						else
-							potentialCachedRegion = tempNode;
-					}
-				}
-			}
-			result = potentialCachedRegion;
-		}
-		// just to be doubly sure we never assign null to an already valid
-		// cachedRegion.
-		// I believe any time 'result' is null at this point, that just means
-		// we have an
-		// empty document, and the cachedRegion is already null, but we check
-		// and print
-		// warning, just so during development we be sure we never accidently
-		// break this assumption.
-		if (result != null)
-			setCachedDocumentRegion(result);
-		else if (getCachedDocumentRegion() != null) {
-			throw new IllegalStateException("Program Error: no region could be found to cache, but cache was non null. Indicates corrupted model or region list"); //$NON-NLS-1$
-		}
-
-		return result;
-	}
-
-	public IStructuredDocumentRegionList getRegionList() {
-		CoreNodeList result = null;
-		if (getCachedDocumentRegion() == null)
-			result = new CoreNodeList(null);
-		else
-			result = new CoreNodeList(getFirstStructuredDocumentRegion());
-
-		return result;
-	}
-
-
-	public IStructuredDocumentRegion[] getStructuredDocumentRegions() {
-		return getStructuredDocumentRegions(0, getLength());
-	}
-
-	/**
-	 * <p>
-	 * In the case of 0 length, the <code>IStructuredDocumentRegion</code>
-	 * at the character offset is returened. In other words, the region to the
-	 * right of the caret is returned. except for at the end of the document,
-	 * then the last region is returned.
-	 * </p>
-	 * <p>
-	 * Otherwise all the regions "inbetween" the indicated range are returned,
-	 * including the regions which overlap the region.
-	 * </p>
-	 * 
-	 * <br>
-	 * eg.
-	 * <p>
-	 * <br>
-	 * eg.
-	 * 
-	 * <pre>
-	 * &lt;html&gt;[&lt;head&gt;&lt;/head&gt;]&lt;/html&gt; returns &lt;head&gt;,&lt;/head&gt;
-	 * </pre>
-	 *    <pre>
-	 * &lt;ht[ml&gt;&lt;head&gt;&lt;/he]ad&gt;&lt;/html&gt; returns &lt;html&gt;,&lt;head&gt;,&lt;/head&gt;
-	 * </pre>
-	 * 
-	 * <pre>
-	 *   &lt;html&gt;[&lt;head&gt;&lt;/head&gt;]&lt;/html&gt; returns &lt;head&gt;,&lt;/head&gt;
-	 * </pre>
-	 *    <pre>
-	 *   &lt;ht[ml&gt;&lt;head&gt;&lt;/he]ad&gt;&lt;/html&gt; returns &lt;html&gt;,&lt;head&gt;,&lt;/head&gt;
-	 * </pre>
-	 * 
-	 * </p>
-	 */
-	public IStructuredDocumentRegion[] getStructuredDocumentRegions(int start, int length) {
-
-		if (length < 0)
-			throw new IllegalArgumentException("can't have negative length"); //$NON-NLS-1$
-
-		// this will make the right edge of the range point into the selection
-		// eg. <html>[<head></head>]</html>
-		// will return <head>,</head> instead of <head>,</head>,</html>
-		if (length > 0)
-			length--;
-
-		List results = new ArrayList();
-
-		// start thread safe block
-		try {
-			acquireLock();
-
-			IStructuredDocumentRegion currentRegion = getRegionAtCharacterOffset(start);
-			IStructuredDocumentRegion endRegion = getRegionAtCharacterOffset(start + length);
-			while (currentRegion != endRegion && currentRegion != null) {
-				results.add(currentRegion);
-				currentRegion = currentRegion.getNext();
-			}
-			// need to add that last end region
-			// can be null in the case of an empty document
-			if (endRegion != null)
-				results.add(endRegion);
-		}
-		finally {
-			releaseLock();
-		}
-		// end thread safe block
-
-		return (IStructuredDocumentRegion[]) results.toArray(new IStructuredDocumentRegion[results.size()]);
-	}
-
-	/**
-	 * was made public for easier testing. Normally should never be used by
-	 * client codes.
-	 */
-	public IStructuredTextReParser getReParser() {
-		if (fReParser == null) {
-			fReParser = new StructuredDocumentReParser();
-			fReParser.setStructuredDocument(this);
-		}
-		return fReParser;
-	}
-
-	private ITextStore getStore() {
-		Assert.isNotNull(fStore);
-		return fStore;
-	}
-
-	public String getText() {
-		String result = get();
-		return result;
-	}
-
-	/**
-	 * Returns the document's line tracker. Assumes that the document has been
-	 * initialized with a line tracker.
-	 * 
-	 * @return the document's line tracker
-	 */
-	private ILineTracker getTracker() {
-		Assert.isNotNull(fTracker);
-		return fTracker;
-	}
-
-	public IStructuredTextUndoManager getUndoManager() {
-		if (fUndoManager == null) {
-			fUndoManager = new StructuredTextUndoManager();
-		}
-		return fUndoManager;
-	}
-
-	void initializeFirstAndLastDocumentRegion() {
-		// cached Node must also be first, at the initial point. Only
-		// valid
-		// to call this method right after the first parse.
-		// 
-		// when starting afresh, our cachedNode should be our firstNode,
-		// so be sure to initialize the firstNode
-		firstDocumentRegion = getCachedDocumentRegion();
-		// be sure to use 'getNext' for this initial finding of the last
-		// node,
-		// since the implementation of node.getLastNode may simply call
-		// structuredDocument.getLastStructuredDocumentRegion!
-		IStructuredDocumentRegion aNode = firstDocumentRegion;
-		if (aNode == null) {
-			// defect 254607: to handle empty documents right, if
-			// firstnode is
-			// null, make sure last node is null too
-			lastDocumentRegion = null;
-		}
-		else {
-			while (aNode != null) {
-				lastDocumentRegion = aNode;
-				aNode = aNode.getNext();
-			}
-		}
-	}
-
-	/**
-	 * @see IDocument#insertPositionUpdater
-	 */
-	public void insertPositionUpdater(IPositionUpdater updater, int index) {
-		getPositionManager().insertPositionUpdater(updater, index);
-	}
-
-	private void internal_addPositionCategory(String category) {
-		getPositionManager().addPositionCategory(category);
-	}
-
-	private void internal_addPositionUpdater(IPositionUpdater updater) {
-		getPositionManager().addPositionUpdater(updater);
-	}
-
-	private void internal_setParser(RegionParser newParser) {
-		fParser = newParser;
-	}
-
-	String internalGet(int offset, int length) {
-		String result = null;
-		// int myLength = getLength();
-		// if ((0 > offset) || (0 > length) || (offset + length > myLength))
-		// throw new BadLocationException();
-		result = getStore().get(offset, length);
-		return result;
-	}
-
-	/**
-	 * @param requester
-	 * @param start
-	 * @param replacementLength
-	 * @param changes
-	 * @return
-	 */
-	private StructuredDocumentEvent internalReplaceText(Object requester, int start, int replacementLength, String changes, boolean ignoreReadOnlySettings) {
-		StructuredDocumentEvent result = null;
-
-		stopPostNotificationProcessing();
-		if (changes == null)
-			changes = ""; //$NON-NLS-1$
-		// 
-		if (Debug.debugStructuredDocument)
-			System.out.println(getClass().getName() + "::replaceText(" + start + "," + replacementLength + "," + changes + ")"); //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-		if (Debug.perfTestStructuredDocumentOnly || Debug.perfTest || Debug.perfTestRawStructuredDocumentOnly) {
-			startStreamTime = System.currentTimeMillis();
-		}
-		try {
-			// Note: event must be computed before 'fire' method called
-			fDocumentEvent = new DocumentEvent(this, start, replacementLength, changes);
-			fireDocumentAboutToChanged();
-
-			try {
-				acquireLock();
-
-				if (!ignoreReadOnlySettings && (containsReadOnly(start, replacementLength))) {
-					NoChangeEvent noChangeEvent = new NoChangeEvent(this, requester, changes, start, replacementLength);
-					noChangeEvent.reason = NoChangeEvent.READ_ONLY_STATE_CHANGE;
-					result = noChangeEvent;
-				}
-				else {
-					result = updateModel(requester, start, replacementLength, changes);
-				}
-			}
-			finally {
-				releaseLock();
-			}
-
-
-			if (Debug.perfTestRawStructuredDocumentOnly || Debug.perfTest) {
-				long stopStreamTime = System.currentTimeMillis();
-				System.out.println("\n\t\t\t\t Time for IStructuredDocument raw replaceText: " + (stopStreamTime - startStreamTime)); //$NON-NLS-1$
-			}
-			if (Debug.debugStructuredDocument) {
-				System.out.println("event type returned by replaceTextWithNoDebuggingThread: " + result); //$NON-NLS-1$
-			}
-		}
-		finally {
-			// FUTURE_TO_DO: implement callback mechanism? to avoid instanceof
-			// and casting
-			// fireStructuredDocumentEvent must be called in order to end
-			// documentAboutToBeChanged state
-			if (result == null) {
-				// result should not be null, but if an exception was thrown,
-				// it will be
-				// so send a noChangeEvent and log the problem
-				NoChangeEvent noChangeEvent = new NoChangeEvent(this, requester, changes, start, replacementLength);
-				noChangeEvent.reason = NoChangeEvent.NO_EVENT;
-				fireStructuredDocumentEvent(noChangeEvent);
-				Logger.log(Logger.ERROR, "Program Error: invalid structured document event"); //$NON-NLS-1$
-			}
-			else {
-				if (result instanceof RegionChangedEvent) {
-					fireStructuredDocumentEvent((RegionChangedEvent) result);
-				}
-				else {
-					if (result instanceof RegionsReplacedEvent) {
-						fireStructuredDocumentEvent((RegionsReplacedEvent) result);
-					}
-					else {
-						if (result instanceof StructuredDocumentRegionsReplacedEvent) {
-							// probably more efficient to mark old regions as
-							// 'deleted' at the time
-							// that are determined to be deleted, but I'll do
-							// here
-							// in then central spot
-							// for programming ease.
-							updateDeletedFields((StructuredDocumentRegionsReplacedEvent) result);
-							fireStructuredDocumentEvent((StructuredDocumentRegionsReplacedEvent) result);
-						}
-						else {
-							if (result instanceof NoChangeEvent) {
-								fireStructuredDocumentEvent((NoChangeEvent) result);
-							}
-							else {
-								// if here, this means a new event was created
-								// and not handled here
-								// just send a no event until this issue is
-								// resolved.
-								NoChangeEvent noChangeEvent = new NoChangeEvent(this, requester, changes, start, replacementLength);
-								noChangeEvent.reason = NoChangeEvent.NO_EVENT;
-								fireStructuredDocumentEvent(noChangeEvent);
-								Logger.log(Logger.INFO, "Program Error: unexpected structured document event: " + result); //$NON-NLS-1$
-							}
-						}
-					}
-				}
-			}
-			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$
-			}
-			resumePostNotificationProcessing();
-		}
-		return result;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.CharSequence#length()
-	 */
-	public int length() {
-
-		return getLength();
-	}
-
-	public void makeReadOnly(int startOffset, int length) {
-
-		// doesn't make sense to have a readonly region of 0 length,
-		// so we'll ignore those requests
-		if (length <= 0)
-			return;
-		String affectedText = this.get(startOffset, length);
-		// a document event for "read only" change ... must
-		// be followed by "no change" structuredDocument event
-		// fDocumentEvent = new DocumentEvent(this, startOffset, length,
-		// affectedText);
-		fireReadOnlyAboutToBeChanged();
-		// if (containsReadOnly(startOffset, length)) {
-		// adjustReadOnlyRegions(startOffset, length);
-		// } else {
-		// we can blindly add category, since no harm done if already
-		// exists.
-		addPositionCategory(READ_ONLY_REGIONS_CATEGORY);
-		Position newPosition = new Position(startOffset, length);
-		try {
-			addPosition(READ_ONLY_REGIONS_CATEGORY, newPosition);
-			// FIXME: need to change API to pass in requester, so this event
-			// can be
-			// created correctly, instead of using null.
-			NoChangeEvent noChangeEvent = new NoChangeEvent(this, null, affectedText, startOffset, length);
-			noChangeEvent.reason = NoChangeEvent.READ_ONLY_STATE_CHANGE;
-			fireReadOnlyStructuredDocumentEvent(noChangeEvent);
-		}
-		catch (BadLocationException e) {
-			// for now, log and ignore. Perhaps later we
-			// could adjust to handle some cases?
-			Logger.logException(("could not create readonly region at " + startOffset + " to " + length), e); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		catch (BadPositionCategoryException e) {
-			// should never occur, since we add category
-			Logger.logException(e);
-		}
-	}
-
-	public IStructuredDocument newInstance() {
-		IStructuredDocument newInstance = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser().newInstance());
-		((BasicStructuredDocument) newInstance).setReParser(getReParser().newInstance());
-		if (getDocumentPartitioner() instanceof StructuredTextPartitioner) {
-			newInstance.setDocumentPartitioner(((StructuredTextPartitioner) getDocumentPartitioner()).newInstance());
-			newInstance.getDocumentPartitioner().connect(newInstance);
-		}
-		newInstance.setLineDelimiter(getLineDelimiter());
-		if (getEncodingMemento() != null) {
-			newInstance.setEncodingMemento((EncodingMemento) getEncodingMemento().clone());
-		}
-		return newInstance;
-	}
-
-	/*
-	 * (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) {
-		boolean result = false;
-		ITextStore store = getStore();
-		if (store instanceof IRegionComparible) {
-			result = ((IRegionComparible) store).regionMatches(offset, length, stringToCompare);
-		}
-		else {
-			result = get(offset, length).equals(stringToCompare);
-		}
-		return result;
-	}
-
-	public boolean regionMatchesIgnoreCase(int offset, int length, String stringToCompare) {
-		boolean result = false;
-		ITextStore store = getStore();
-		if (store instanceof IRegionComparible) {
-			result = ((IRegionComparible) store).regionMatchesIgnoreCase(offset, length, stringToCompare);
-		}
-		else {
-			result = get(offset, length).equalsIgnoreCase(stringToCompare);
-		}
-		return result;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentExtension#registerPostNotificationReplace(org.eclipse.jface.text.IDocumentListener,
-	 *      org.eclipse.jface.text.IDocumentExtension.IReplace)
-	 */
-	public void registerPostNotificationReplace(IDocumentListener owner, IDocumentExtension.IReplace replace) {
-		if (fAcceptPostNotificationReplaces) {
-			if (fPostNotificationChanges == null)
-				fPostNotificationChanges = new ArrayList(1);
-			fPostNotificationChanges.add(new RegisteredReplace(owner, replace));
-		}
-	}
-
-	protected void releaseLock() {
-		// do nothing here in super class
-	}
-
-	public void removeDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener) {
-		synchronized (listenerLock) {
-
-			if ((fStructuredDocumentAboutToChangeListeners != null) && (listener != null)) {
-				// if its not in the listeners, we'll ignore the request
-				if (Utilities.contains(fStructuredDocumentAboutToChangeListeners, listener)) {
-					int oldSize = fStructuredDocumentAboutToChangeListeners.length;
-					int newSize = oldSize - 1;
-					Object[] newListeners = new Object[newSize];
-					int index = 0;
-					for (int i = 0; i < oldSize; i++) {
-						if (fStructuredDocumentAboutToChangeListeners[i] == listener) { // ignore
-						}
-						else {
-							// copy old to new if its not the one we are
-							// removing
-							newListeners[index++] = fStructuredDocumentAboutToChangeListeners[i];
-						}
-					}
-					// now that we have a new array, let's switch it for the
-					// old
-					// one
-					fStructuredDocumentAboutToChangeListeners = newListeners;
-				}
-			}
-		}
-	}
-
-	/**
-	 * removeModelChangedListener method comment.
-	 */
-	public void removeDocumentChangedListener(IStructuredDocumentListener listener) {
-		synchronized (listenerLock) {
-
-			if ((fStructuredDocumentChangedListeners != null) && (listener != null)) {
-				// if its not in the listeners, we'll ignore the request
-				if (Utilities.contains(fStructuredDocumentChangedListeners, listener)) {
-					int oldSize = fStructuredDocumentChangedListeners.length;
-					int newSize = oldSize - 1;
-					Object[] newListeners = new Object[newSize];
-					int index = 0;
-					for (int i = 0; i < oldSize; i++) {
-						if (fStructuredDocumentChangedListeners[i] == listener) { // ignore
-						}
-						else {
-							// copy old to new if its not the one we are
-							// removing
-							newListeners[index++] = fStructuredDocumentChangedListeners[i];
-						}
-					}
-					// now that we have a new array, let's switch it for the
-					// old
-					// one
-					fStructuredDocumentChangedListeners = newListeners;
-				}
-			}
-		}
-	}
-
-	public void removeDocumentChangingListener(IStructuredDocumentListener listener) {
-		synchronized (listenerLock) {
-
-			if ((fStructuredDocumentChangingListeners != null) && (listener != null)) {
-				// if its not in the listeners, we'll ignore the request
-				if (Utilities.contains(fStructuredDocumentChangingListeners, listener)) {
-					int oldSize = fStructuredDocumentChangingListeners.length;
-					int newSize = oldSize - 1;
-					Object[] newListeners = new Object[newSize];
-					int index = 0;
-					for (int i = 0; i < oldSize; i++) {
-						if (fStructuredDocumentChangingListeners[i] == listener) { // ignore
-						}
-						else {
-							// copy old to new if its not the one we are
-							// removing
-							newListeners[index++] = fStructuredDocumentChangingListeners[i];
-						}
-					}
-					// now that we have a new array, let's switch it for the
-					// old
-					// one
-					fStructuredDocumentChangingListeners = newListeners;
-				}
-			}
-		}
-	}
-
-	public void removeDocumentListener(IDocumentListener listener) {
-		synchronized (listenerLock) {
-
-			if ((fDocumentListeners != null) && (listener != null)) {
-				// if its not in the listeners, we'll ignore the request
-				if (Utilities.contains(fDocumentListeners, listener)) {
-					int oldSize = fDocumentListeners.length;
-					int newSize = oldSize - 1;
-					IDocumentListener[] newListeners = new IDocumentListener[newSize];
-					int index = 0;
-					for (int i = 0; i < oldSize; i++) {
-						if (fDocumentListeners[i] == listener) { // ignore
-						}
-						else {
-							// copy old to new if its not the one we are
-							// removing
-							newListeners[index++] = fDocumentListeners[i];
-						}
-					}
-					// now that we have a new array, let's switch it for the
-					// old
-					// one
-					fDocumentListeners = newListeners;
-				}
-			}
-		}
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#removeDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
-	 */
-	public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener) {
-		synchronized (listenerLock) {
-
-			Assert.isNotNull(listener);
-			if (fDocumentPartitioningListeners != null)
-				fDocumentPartitioningListeners.remove(listener);
-		}
-	}
-
-	/**
-	 * Removes the given <code>Position</code> from the document's default
-	 * position category. The default position category is to be defined by
-	 * the implementers. If the position is not part of the document's default
-	 * category nothing happens.
-	 */
-	public void removePosition(Position position) {
-		getPositionManager().removePosition(position);
-	}
-
-	/**
-	 * @see IDocument#removePosition
-	 * @exception BadPositionCategoryException
-	 *                If the category is not defined for the document
-	 */
-	public void removePosition(String category, Position position) throws BadPositionCategoryException {
-		getPositionManager().removePosition(category, position);
-	}
-
-	/**
-	 * @see IDocument#removePositionCategory
-	 * @exception BadPositionCategoryException
-	 *                If the category is not defined for the document
-	 */
-	public void removePositionCategory(String category) throws BadPositionCategoryException {
-		getPositionManager().removePositionCategory(category);
-	}
-
-	/**
-	 * @see IDocument#removePositionUpdater
-	 */
-	public void removePositionUpdater(IPositionUpdater updater) {
-		getPositionManager().removePositionUpdater(updater);
-	}
-
-	/**
-	 * Removes the given document listener from teh document's list of
-	 * prenotified document listeners. If the listener is not registered with
-	 * the document nothing happens.
-	 * <p>
-	 * 
-	 * This method is not for public use, it may only be called by
-	 * implementers of <code>IDocumentAdapter</code> and only if those
-	 * implementers need to implement <code>IDocumentListener</code>.
-	 * 
-	 * @param documentAdapter
-	 *            the listener to be removed
-	 * 
-	 * @see #addPrenotifiedDocumentListener(IDocumentListener)
-	 */
-	public void removePrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener documentAdapter) {
-		synchronized (listenerLock) {
-
-			if (Utilities.contains(fPrenotifiedDocumentListeners, documentAdapter)) {
-				int previousSize = fPrenotifiedDocumentListeners.length;
-				if (previousSize > 1) {
-					IDocumentListener[] listeners = new IDocumentListener[previousSize - 1];
-					int previousIndex = 0;
-					int newIndex = 0;
-					while (previousIndex < previousSize) {
-						if (fPrenotifiedDocumentListeners[previousIndex] != documentAdapter)
-							listeners[newIndex++] = fPrenotifiedDocumentListeners[previousIndex];
-						previousIndex++;
-					}
-					fPrenotifiedDocumentListeners = listeners;
-				}
-				else {
-					fPrenotifiedDocumentListeners = null;
-				}
-			}
-		}
-	}
-
-	/**
-	 * This method is for INTERNAL USE ONLY and is NOT API.
-	 * 
-	 * Rebuilds the StructuredDocumentRegion chain from the existing text.
-	 * FileBuffer support does not allow clients to know the document's
-	 * location before the text contents are set.
-	 * 
-	 * @see set(String)
-	 */
-	public void reparse(Object requester) {
-		stopPostNotificationProcessing();
-		clearReadOnly();
-
-		acquireLock();
-		try {
-			CharSequenceReader subSetTextStoreReader = new CharSequenceReader((CharSequence) getStore(), 0, getStore().getLength());
-			resetParser(subSetTextStoreReader, 0);
-			//
-			setCachedDocumentRegion(getParser().getDocumentRegions());
-			// when starting afresh, our cachedNode should be our firstNode,
-			// so be sure to initialize the firstNode and lastNode
-			initializeFirstAndLastDocumentRegion();
-			StructuredDocumentRegionIterator.setParentDocument(getCachedDocumentRegion(), this);
-		}
-		finally {
-			releaseLock();
-		}
-
-		resumePostNotificationProcessing();
-	}
-
-	/**
-	 * @see IDocument#replace
-	 * @exception BadLocationException
-	 *                If position is not a valid range in the document
-	 */
-	public void replace(int pos, int length, String string) 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);
-	}
-
-	/**
-	 * Replace the text with "newText" starting at position "start" for a
-	 * length of "replaceLength".
-	 * <p>
-	 * 
-	 * @param start
-	 *            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
-	 *            start offset of text to replace
-	 * @param newText
-	 *            start offset of text to replace
-	 *            <p>
-	 *            Implementors have to notify TextChanged listeners after the
-	 *            content has been updated. The TextChangedEvent should be set
-	 *            as follows:
-	 * 
-	 * event.type = SWT.TextReplaced event.start = start of the replaced text
-	 * event.numReplacedLines = number of replaced lines event.numNewLines =
-	 * number of new lines event.replacedLength = length of the replaced text
-	 * event.newLength = length of the new text
-	 * 
-	 * NOTE: numNewLines is the number of inserted lines and numReplacedLines
-	 * is the number of deleted lines based on the change that occurs
-	 * visually. For example:
-	 * 
-	 * replacedText newText numReplacedLines numNewLines "" "\n" 0 1 "\n\n"
-	 * "a" 2 0 "a" "\n\n" 0 2
-	 */
-	/**
-	 * 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 start, int replacementLength, String changes, boolean ignoreReadOnlySettings) {
-		return internalReplaceText(requester, start, replacementLength, changes, ignoreReadOnlySettings);
-	}
-
-	void resetParser(int startOffset, int endOffset) {
-
-		RegionParser parser = getParser();
-		ITextStore textStore = getStore();
-		if (textStore instanceof CharSequence) {
-			CharSequenceReader subSetTextStoreReader = new CharSequenceReader((CharSequence) textStore, startOffset, endOffset - startOffset);
-			parser.reset(subSetTextStoreReader, startOffset);
-		}
-		else {
-			String newNodeText = get(startOffset, endOffset - startOffset);
-			parser.reset(newNodeText, startOffset);
-
-		}
-
-	}
-
-	void resetParser(Reader reader, int startOffset) {
-		RegionParser parser = getParser();
-		parser.reset(reader, startOffset);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentExtension#resumePostNotificationProcessing()
-	 */
-	public void resumePostNotificationProcessing() {
-		--fStoppedCount;
-		if (fStoppedCount == 0 && fReentranceCount == 0)
-			executePostNotificationChanges();
-	}
-
-	/**
-	 * @deprecated in superclass in 3.0 - use a FindReplaceDocumentAdapter
-	 *             directly
-	 * @see IDocument#search
-	 */
-	public int search(int startPosition, String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord) throws BadLocationException {
-		// (dmw) I added this warning, to know if still being used. I'm not
-		// sure it
-		// works as expected any longer.
-		// but the warning should be removed, once know.
-		Logger.log(Logger.INFO, "WARNING: using unsupported deprecated method 'search'"); //$NON-NLS-1$
-		int offset = -1;
-		IRegion match = new FindReplaceDocumentAdapter(this).find(startPosition, findString, forwardSearch, caseSensitive, wholeWord, false);
-		if (match != null) {
-			offset = match.getOffset();
-		}
-		return offset;
-	}
-
-	/**
-	 * @see IDocument#setText
-	 */
-	public void set(String string) {
-		if (Debug.displayInfo) {
-			System.out.println("Note: IStructuredDocument::setText(String) .... its better to use setText(source, string) API for structuredDocument updates"); //$NON-NLS-1$
-		}
-		setText(null, string);
-	}
-
-	/**
-	 * This may be marked public, but should be packaged protected, once
-	 * refactoring is complete (in other words, not for client use).
-	 */
-	public void setCachedDocumentRegion(IStructuredDocumentRegion structuredRegion) {
-		if (USE_LOCAL_THREAD) {
-			fCurrentDocumnetRegionCache.set(structuredRegion);
-		}
-		else {
-			cachedDocumentRegion = structuredRegion;
-		}
-	}
-
-	/**
-	 * Sets the document's partitioner.
-	 * 
-	 * @see IDocumentPartitioner
-	 */
-	public void setDocumentPartitioner(IDocumentPartitioner partitioner) {
-		setDocumentPartitioner(IDocumentExtension3.DEFAULT_PARTITIONING, partitioner);
-	}
-
-
-	public void setDocumentPartitioner(String partitioning, IDocumentPartitioner partitioner) {
-		if (partitioner == null) {
-			if (fDocumentPartitioners != null) {
-				fDocumentPartitioners.remove(partitioning);
-				if (fDocumentPartitioners.size() == 0)
-					fDocumentPartitioners = null;
-			}
-		}
-		else {
-			if (fDocumentPartitioners == null)
-				fDocumentPartitioners = new HashMap();
-			fDocumentPartitioners.put(partitioning, partitioner);
-		}
-		DocumentPartitioningChangedEvent event = new DocumentPartitioningChangedEvent(this);
-		event.setPartitionChange(partitioning, 0, getLength());
-		fireDocumentPartitioningChanged(event);
-	}
-
-	public void setEncodingMemento(EncodingMemento encodingMemento) {
-		this.encodingMemento = encodingMemento;
-	}
-
-	void setFirstDocumentRegion(IStructuredDocumentRegion region) {
-		firstDocumentRegion = region;
-
-	}
-
-	void setLastDocumentRegion(IStructuredDocumentRegion region) {
-		lastDocumentRegion = region;
-
-	}
-
-	/**
-	 * @see IStructuredDocument#setLineDelimiter(String)
-	 */
-	public void setLineDelimiter(String delimiter) {
-		// make sure our preferred delimiter is
-		// one of the legal ones
-		if (Utilities.containsString(getLegalLineDelimiters(), delimiter)) {
-			preferedDelimiter = delimiter;
-		}
-		else {
-			if (Logger.DEBUG_DOCUMENT)
-				Logger.log(Logger.INFO, "Attempt to set linedelimiter to non-legal delimiter"); //$NON-NLS-1$ //$NON-NLS-2$
-			preferedDelimiter = PlatformLineDelimiter;
-		}
-	}
-
-	/**
-	 * Sets the document's line tracker. Must be called at the beginning of
-	 * the constructor.
-	 * 
-	 * @param tracker
-	 *            the document's line tracker
-	 */
-	private void setLineTracker(ILineTracker tracker) {
-		fTracker = tracker;
-	}
-
-	public void setParser(RegionParser newParser) {
-		internal_setParser(newParser);
-	}
-
-	/**
-	 * @param positionManager
-	 *            The positionManager to set.
-	 */
-	// TODO: make private is needed, else remove
-	void setPositionManager(GenericPositionManager positionManager) {
-		fPositionManager = positionManager;
-	}
-
-	/**
-	 * 
-	 */
-	public void setReParser(IStructuredTextReParser newReParser) {
-		fReParser = newReParser;
-		if (fReParser != null) {
-			fReParser.setStructuredDocument(this);
-		}
-	}
-
-	/**
-	 * One of the APIs to manipulate the IStructuredDocument in terms of text.
-	 */
-	public StructuredDocumentEvent setText(Object requester, String theString) {
-
-		StructuredDocumentEvent result = null;
-
-		result = replaceText(requester, 0, getLength(), theString, true);
-		
-		return result;
-	}
-
-	/**
-	 * Sets the document's text store. Must be called at the beginning of the
-	 * constructor.
-	 * 
-	 * @param store
-	 *            the document's text store
-	 */
-	private void setTextStore(ITextStore store) {
-		fStore = store;
-	}
-
-	public void setUndoManager(IStructuredTextUndoManager undoManager) {
-
-		// if the undo manager has already been set, then
-		// fail fast, since changing the undo manager will lead
-		// to unusual results (or at least loss of undo stack).
-		if (fUndoManager != null && fUndoManager != undoManager) {
-			throw new IllegalArgumentException("can not change undo manager once its been set"); //$NON-NLS-1$
-		}
-		else {
-			fUndoManager = undoManager;
-		}
-	}
-
-
-	public void startSequentialRewrite(boolean normalized) {
-		ITextStore store = new SequentialRewriteTextStore(getStore());
-		setTextStore(store);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentExtension#stopPostNotificationProcessing()
-	 */
-	public void stopPostNotificationProcessing() {
-		++fStoppedCount;
-	}
-
-
-	public void stopSequentialRewrite() {
-		if (getStore() instanceof SequentialRewriteTextStore) {
-			SequentialRewriteTextStore srws = (SequentialRewriteTextStore) getStore();
-			ITextStore source = srws.getSourceStore();
-			setTextStore(source);
-			srws.dispose();
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.CharSequence#subSequence(int, int)
-	 */
-	public CharSequence subSequence(int arg0, int arg1) {
-		return get(arg0, arg1);
-	}
-
-	/**
-	 * @param result
-	 */
-	private void updateDeletedFields(StructuredDocumentRegionsReplacedEvent event) {
-		IStructuredDocumentRegionList oldRegions = event.getOldStructuredDocumentRegions();
-		for (int i = 0; i < oldRegions.getLength(); i++) {
-			IStructuredDocumentRegion structuredDocumentRegion = oldRegions.item(i);
-			structuredDocumentRegion.setDeleted(true);
-		}
-
-	}
-
-	/**
-	 * Called by re-parser. Note: this method may be "public" but should only
-	 * be called by re-parsers in the right circumstances.
-	 */
-	public void updateDocumentData(int start, int lengthToReplace, String changes) {
-		stopPostNotificationProcessing();
-		getStore().replace(start, lengthToReplace, changes);
-		try {
-			getTracker().replace(start, lengthToReplace, changes);
-		}
-
-		catch (BadLocationException e) {
-			// should be impossible here, but will log for now
-			Logger.logException(e);
-		}
-		if (fPositionManager != null) {
-			fPositionManager.updatePositions(new DocumentEvent(this, start, lengthToReplace, changes));
-		}
-		resumePostNotificationProcessing();
-	}
-
-	private StructuredDocumentEvent updateModel(Object requester, int start, int lengthToReplace, String changes) {
-		StructuredDocumentEvent result = null;
-		IStructuredTextReParser reParser = getReParser();
-		// initialize the IStructuredTextReParser with the standard data
-		// that's
-		// always needed
-		reParser.initialize(requester, start, lengthToReplace, changes);
-		result = reParser.reparse();
-		// if result is null at this point, then there must be an error, since
-		// even if there
-		// was no change (either disallow due to readonly, or a person pasted
-		// the same thing
-		// they had selected) then a "NoChange" event should have been fired.
-		Assert.isNotNull(result, "no structuredDocument event was created in IStructuredDocument::updateStructuredDocument"); //$NON-NLS-1$
-		return result;
-	}
-
-	public String getPreferredLineDelimiter() {
-		return getLineDelimiter();
-	}
-
-	public void setPreferredLineDelimiter(String probableLineDelimiter) {
-		setLineDelimiter(probableLineDelimiter);
-
-	}
-}
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
deleted file mode 100644
index 61559cb..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java
+++ /dev/null
@@ -1,600 +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.sse.core.internal.text;
-
-
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.sse.core.internal.Logger;
-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.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.util.Assert;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-
-public class BasicStructuredDocumentRegion implements IStructuredDocumentRegion {
-	private static final String TEXT_STORE_NOT_ASSIGNED = "text store not assigned yet"; //$NON-NLS-1$
-	private static final String UNDEFINED = "org.eclipse.wst.sse.core.structuredDocument.UNDEFINED"; //$NON-NLS-1$
-
-	private ITextRegionList _regions;
-	private boolean fIsDeleted = false;
-	// private String fType;
-	/**
-	 * allow a pointer back to this nodes model
-	 */
-	private IStructuredDocument fParentDocument;
-	/**
-	 * was this node terminated normally
-	 */
-	// 0 == false, 1 == true
-	private byte hasEnd = 0;
-	protected int fLength;
-	private IStructuredDocumentRegion next = null;
-	private IStructuredDocumentRegion previous = null;
-	protected int start;
-
-	public BasicStructuredDocumentRegion() {
-		super();
-		_regions = new TextRegionListImpl();
-
-	}
-
-	/**
-	 * Even inside-this class uses of 'regions' should use this method, as
-	 * this is where (soft) memory management/reparsing, etc., will be
-	 * centralized.
-	 */
-	private ITextRegionList _getRegions() {
-
-		return _regions;
-	}
-
-	public void addRegion(ITextRegion aRegion) {
-		_getRegions().add(aRegion);
-	}
-
-	public void adjust(int i) {
-		start += i;
-	}
-
-	public void adjustLength(int i) {
-		fLength += i;
-	}
-
-	public void adjustStart(int i) {
-		start += i;
-	}
-
-	public void adjustTextLength(int i) {
-		// not supported
-
-	}
-
-	public boolean containsOffset(int i) {
-
-		return getStartOffset() <= i && i < getEndOffset();
-	}
-
-	public boolean containsOffset(ITextRegion containedRegion, int offset) {
-		return getStartOffset(containedRegion) <= offset && offset < getEndOffset(containedRegion);
-	}
-
-	public void equatePositions(ITextRegion region) {
-		start = region.getStart();
-		fLength = region.getLength();
-	}
-
-	/**
-	 * getEnd and getEndOffset are the same only for
-	 * IStructuredDocumentRegions
-	 */
-	public int getEnd() {
-		return start + fLength;
-	}
-
-	/**
-	 * getEnd and getEndOffset are the same only for
-	 * IStructuredDocumentRegions
-	 */
-	public int getEndOffset() {
-		return getEnd();
-	}
-
-	public int getEndOffset(ITextRegion containedRegion) {
-		return getStartOffset(containedRegion) + containedRegion.getLength();
-	}
-
-	public ITextRegion getFirstRegion() {
-		if (_getRegions() == null)
-			return null;
-		return _getRegions().get(0);
-	}
-
-	public String getFullText() {
-		String result = ""; //$NON-NLS-1$
-		try {
-			result = getParentDocument().get(start, fLength);
-		}
-		catch (BadLocationException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-		return result;
-	}
-
-	public String getFullText(ITextRegion aRegion) {
-		String result = ""; //$NON-NLS-1$
-		try {
-			int regionStart = aRegion.getStart();
-			int regionLength = aRegion.getLength();
-			result = fParentDocument.get(start + regionStart, regionLength);
-		}
-		catch (BadLocationException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-		return result;
-	}
-
-	public String getFullText(String context) {
-		// DMW: looping is faster than enumeration,
-		// so switched around 2/12/03
-		// Enumeration e = getRegions().elements();
-		ITextRegion region = null;
-		String result = ""; //$NON-NLS-1$
-		int length = getRegions().size();
-		for (int i = 0; i < length; i++) {
-			region = getRegions().get(i);
-			if (region.getType() == context)
-				result += getFullText(region);
-		}
-		return result;
-	}
-
-	public ITextRegion getLastRegion() {
-		if (_getRegions() == null)
-			return null;
-		return _getRegions().get(_getRegions().size() - 1);
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public IStructuredDocumentRegion getNext() {
-		return next;
-	}
-
-	public int getNumberOfRegions() {
-		return _getRegions().size();
-	}
-
-	public IStructuredDocument getParentDocument() {
-
-		return fParentDocument;
-	}
-
-	public IStructuredDocumentRegion getPrevious() {
-		return previous;
-	}
-
-	/**
-	 * The parameter offset refers to the overall offset in the document.
-	 */
-	public ITextRegion getRegionAtCharacterOffset(int offset) {
-		ITextRegion result = null;
-		if (_getRegions() != 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 (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 _getRegions();
-	}
-
-	/**
-	 * getStart and getStartOffset are the same only for
-	 * IStrucutredDocumentRegions
-	 */
-	public int getStart() {
-		return start;
-	}
-
-	/**
-	 * getStart and getStartOffset are the same only for
-	 * IStrucutredDocumentRegions
-	 */
-	public int getStartOffset() {
-		return getStart();
-	}
-
-	public int getStartOffset(ITextRegion containedRegion) {
-		// assert: containedRegion can not be null
-		// (might be performance hit if literally put in assert call,
-		// but containedRegion can not be null). Needs to be checked
-		// by calling code.
-		return getStartOffset() + containedRegion.getStart();
-	}
-
-	public String getText() {
-		String result = null;
-		try {
-			if (fParentDocument == null) {
-				// likely to happen during inspecting
-				result = TEXT_STORE_NOT_ASSIGNED;
-			}
-			else {
-				result = fParentDocument.get(start, fLength);
-			}
-		}
-		catch (BadLocationException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-		return result;
-	}
-
-	public String getText(ITextRegion aRegion) {
-		// assert: aRegion can not be null
-		// (might be performance hit if literally put in assert call,
-		// but aRegion can not be null). Needs to be checked
-		// by calling code.
-		try {
-			return fParentDocument.get(this.getStartOffset(aRegion), aRegion.getTextLength());
-		}
-		catch (BadLocationException e) {
-			Logger.logException(e);
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	/**
-	 * Returns the text of the first region with the matching context type
-	 */
-	public String getText(String context) {
-		// DMW: looping is faster than enumeration,
-		// so switched around 2/12/03
-		// Enumeration e = getRegions().elements();
-		ITextRegion region = null;
-		String result = ""; //$NON-NLS-1$
-		int length = getRegions().size();
-		for (int i = 0; i < length; i++) {
-			region = getRegions().get(i);
-			if (region.getType() == context) {
-				result = getText(region);
-				break;
-			}
-		}
-		return result;
-	}
-
-	public int getTextEnd() {
-		return start + fLength;
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getTextEndOffset() {
-		ITextRegion region = _getRegions().get(_getRegions().size() - 1);
-		return getStartOffset() + region.getTextEnd();
-	}
-
-	public int getTextEndOffset(ITextRegion containedRegion) {
-		return getStartOffset(containedRegion) + containedRegion.getTextLength();
-	}
-
-	public int getTextLength() {
-		return fLength;
-	}
-
-	/**
-	 * Provides the type of IStructuredDocumentRegion ... not to be confused
-	 * with type of XML node! This is subclassed, if something other than type
-	 * of first region is desired.
-	 * 
-	 */
-	public String getType() {
-		String result = UNDEFINED;
-		ITextRegionList subregions = getRegions();
-		if (subregions != null && subregions.size() > 0) {
-			ITextRegion firstRegion = subregions.get(0);
-			if (firstRegion != null) {
-				result = firstRegion.getType();
-			}
-		}
-		return result;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.text.IStructuredDocumentRegion#isDeleted()
-	 */
-	public boolean isDeleted() {
-		return fIsDeleted || (fParentDocument == null);
-	}
-
-	/**
-	 * 
-	 * @return boolean
-	 */
-	public boolean isEnded() {
-		return (hasEnd == 1);
-	}
-
-	public boolean sameAs(IStructuredDocumentRegion region, int shift) {
-		boolean result = false;
-		// if region == null, we return false;
-		if (region != null) {
-			// if the regions are the same instance, they are equal
-			if (this == region) {
-				result = true;
-			}
-			else {
-				// this is the non-trivial part
-				// note: we change for type first, then start offset and end
-				// offset,
-				// since that would decide many cases right away and avoid the
-				// text comparison
-				if (getType() == region.getType()) {
-					if (sameOffsetsAs(region, shift) && sameTextAs(region, shift)) {
-						result = true;
-					}
-				}
-
-			}
-		}
-		return result;
-	}
-
-	public boolean sameAs(ITextRegion oldRegion, IStructuredDocumentRegion newDocumentRegion, ITextRegion newRegion, int shift) {
-		boolean result = false;
-		// if any region is null, we return false (even if both are!)
-		if ((oldRegion != null) && (newRegion != null)) {
-			// if the regions are the same instance, they are equal
-			if (oldRegion == newRegion) {
-				result = true;
-			}
-			else {
-				// this is the non-trivial part
-				// note: we change for type first, then start offset and end
-				// offset,
-				// since that would decide many cases right away and avoid the
-				// text comparison
-				if (oldRegion.getType() == newRegion.getType()) {
-					if (sameOffsetsAs(oldRegion, newDocumentRegion, newRegion, shift)) {
-						if (sameTextAs(oldRegion, newDocumentRegion, newRegion, shift)) {
-							result = true;
-						}
-					}
-				}
-			}
-
-		}
-
-		return result;
-	}
-
-	private boolean sameOffsetsAs(IStructuredDocumentRegion region, int shift) {
-		if (getStartOffset() == region.getStartOffset() - shift) {
-			if (getEndOffset() == region.getEndOffset() - shift) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	private boolean sameOffsetsAs(ITextRegion oldRegion, IStructuredDocumentRegion documentRegion, ITextRegion newRegion, int shift) {
-		if (getStartOffset(oldRegion) == documentRegion.getStartOffset(newRegion) - shift) {
-			if (getEndOffset(oldRegion) == documentRegion.getEndOffset(newRegion) - shift) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	private boolean sameTextAs(IStructuredDocumentRegion region, int shift) {
-		boolean result = false;
-		try {
-			if (getText().equals(region.getText())) {
-				result = true;
-			}
-		}
-		// ISSUE: we should not need this
-		catch (StringIndexOutOfBoundsException e) {
-			result = false;
-		}
-
-		return result;
-	}
-
-	private boolean sameTextAs(ITextRegion oldRegion, IStructuredDocumentRegion documentRegion, ITextRegion newRegion, int shift) {
-		boolean result = false;
-
-		if (getText(oldRegion).equals(documentRegion.getText(newRegion))) {
-			result = true;
-		}
-
-		return result;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.text.IStructuredDocumentRegion#setDelete(boolean)
-	 */
-	public void setDeleted(boolean isDeleted) {
-		fIsDeleted = isDeleted;
-
-	}
-
-	/**
-	 * 
-	 * @param newHasEnd
-	 *            boolean
-	 */
-	public void setEnded(boolean newHasEnd) {
-		if (newHasEnd) {
-			hasEnd = 1;
-		}
-		else {
-			hasEnd = 0;
-		}
-	}
-
-	public void setLength(int newLength) {
-		// textLength = newLength;
-		fLength = newLength;
-	}
-
-	public void setNext(IStructuredDocumentRegion newNext) {
-		next = newNext;
-	}
-
-	public void setParentDocument(IStructuredDocument document) {
-		fParentDocument = document;
-
-	}
-
-	public void setPrevious(IStructuredDocumentRegion newPrevious) {
-		previous = newPrevious;
-	}
-
-	public void setRegions(ITextRegionList containedRegions) {
-		_regions = containedRegions;
-	}
-
-	public void setStart(int newStart) {
-		start = newStart;
-	}
-
-	public String toString() {
-		// 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.
-		// Also note, this method can not be changed, without "breaking"
-		// unit tests, since some of them compare current results to previous
-		// results.
-		String result = null;
-		result = "[" + getStart() + ", " + getEnd() + "] (" + getText() + ")"; //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-		return result;
-	}
-
-	private void updateDownStreamRegions(ITextRegion changedRegion, int lengthDifference) {
-		int listLength = _getRegions().size();
-		int startIndex = 0;
-		// first, loop through to find index of where to start
-		for (int i = 0; i < listLength; i++) {
-			ITextRegion region = _getRegions().get(i);
-			if (region == changedRegion) {
-				startIndex = i;
-				break;
-			}
-		}
-		// now, beginning one past the one that was changed, loop
-		// through to end of list, adjusting the start postions.
-		startIndex++;
-		for (int j = startIndex; j < listLength; j++) {
-			ITextRegion region = _getRegions().get(j);
-			region.adjustStart(lengthDifference);
-		}
-	}
-
-	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion structuredDocumentRegion, String changes, int requestStart, int lengthToReplace) {
-		StructuredDocumentEvent result = null;
-		int lengthDifference = Utilities.calculateLengthDifference(changes, lengthToReplace);
-		// Get the region pointed to by the requestStart postion, and give
-		// that region a chance to effect
-		// the update.
-		ITextRegion region = getRegionAtCharacterOffset(requestStart);
-		// if there is no region, then the requested changes must come right
-		// after the
-		// node (and right after the last region). This happens, for example,
-		// when someone
-		// types something at the end of the document, or more commonly, when
-		// they are right
-		// at the beginning of one node, and the dirty start is therefore
-		// calculated to be the
-		// previous node.
-		// So, in this case, we'll give the last region a chance to see if it
-		// wants to
-		// swallow the requested changes -- but only for inserts -- deletes
-		// and "replaces"
-		// should be reparsed if they are in these border regions, and only if
-		// the
-		if ((region == null) && (lengthToReplace == 0)) {
-			region = _getRegions().get(_getRegions().size() - 1);
-			// make sure the region is contiguous
-			if (getEndOffset(region) == requestStart) {
-				result = region.updateRegion(requester, this, changes, requestStart, lengthToReplace);
-			}
-		}
-		else {
-			if (region != null) {
-				//
-				// If the requested change spans more than one region, then
-				// we don't give the region a chance to update.
-				if ((containsOffset(region, requestStart)) && (containsOffset(region, requestStart + lengthToReplace))) {
-					result = region.updateRegion(requester, this, changes, requestStart, lengthToReplace);
-				}
-			}
-		}
-		// if result is not null, then we need to update the start and end
-		// postions of the regions that follow this one
-		// if result is null, then apply the flatnode specific checks on what
-		// it can change
-		// (i.e. more than one region, but no change to the node itself)
-		if (result != null) {
-			// That is, a region decided it could handle the change and
-			// created
-			// a region changed event.
-			Assert.isTrue(result instanceof RegionChangedEvent, "Program Error"); //$NON-NLS-1$
-			updateDownStreamRegions(((RegionChangedEvent) result).getRegion(), lengthDifference);
-			// PLUS, we need to update our own node end point (length)
-			setLength(getLength() + lengthDifference);
-		}
-
-		return result;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CharSequenceReader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CharSequenceReader.java
deleted file mode 100644
index 081f630..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CharSequenceReader.java
+++ /dev/null
@@ -1,127 +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.sse.core.internal.text;
-
-import java.io.IOException;
-import java.io.Reader;
-
-public class CharSequenceReader extends Reader {
-	private int fCurrentPosition;
-	private int fMaximumReadOffset;
-
-	private CharSequence fOriginalSource;
-
-	/**
-	 *  
-	 */
-	CharSequenceReader() {
-		super();
-	}
-
-
-	public CharSequenceReader(CharSequence originalSource, int offset, int length) {
-		// ISSUE: should we "fail fast" if requested length is more than there
-		// is?
-		fOriginalSource = originalSource;
-		int startOffset = offset;
-		int maxRequestedOffset = startOffset + length;
-		int maxPossibleOffset = 0 + originalSource.length();
-		fMaximumReadOffset = Math.min(maxRequestedOffset, maxPossibleOffset);
-
-		fCurrentPosition = startOffset;
-
-	}
-
-	/**
-	 * @param lock
-	 */
-	CharSequenceReader(Object lock) {
-		super(lock);
-		// for thread safety, may need to add back locking mechanism
-		// in our custom constructor. This constructor left here just
-		// for a reminder.
-	}
-
-	public void close() throws IOException {
-		// nothing to do when we close
-		// (may be to eventually "unlock" or null out some varibles
-		// just for hygene.
-		// or, perhaps if already closed once throw IOException? for
-		// consistency?
-	}
-
-	/**
-	 * @return Returns the originalSource.
-	 * @deprecated - only temporarily public, should be 'default' eventually
-	 *             or go away altogether.
-	 */
-	public CharSequence getOriginalSource() {
-		return fOriginalSource;
-	}
-
-	public int read() {
-		int result = -1;
-		if (fCurrentPosition < fMaximumReadOffset) {
-			result = fOriginalSource.charAt(fCurrentPosition++);
-		}
-		return result;
-	}
-
-	/**
-	 * Read characters into a portion of an array. This method will block
-	 * until some input is available, an I/O error occurs, or the end of the
-	 * stream is reached.
-	 * 
-	 * @param cbuf
-	 *            Destination buffer
-	 * @param off
-	 *            Offset at which to start storing characters
-	 * @param len
-	 *            Maximum number of characters to read
-	 * 
-	 * @return The number of characters read, or -1 if the end of the stream
-	 *         has been reached
-	 * 
-	 * @exception IOException
-	 *                If an I/O error occurs
-	 */
-
-	public int read(char[] cbuf, int off, int len) throws IOException {
-		int charsToRead = -1;
-		// if already over max, just return -1
-		// remember, currentPosition is what is getting ready to be read
-		// (that is, its already been incremented in read()).
-		if (fCurrentPosition < fMaximumReadOffset) {
-
-
-			int buffMaxToRead = cbuf.length - off;
-			int minRequested = Math.min(buffMaxToRead, len);
-			int lengthRemaining = fMaximumReadOffset - fCurrentPosition;
-			charsToRead = Math.min(minRequested, lengthRemaining);
-
-
-			CharSequence seq = fOriginalSource.subSequence(fCurrentPosition, fCurrentPosition + charsToRead);
-			// for now, hard assumption that original is a String since source
-			// is assumed to be document, or text store
-			String seqString = (String) seq;
-			seqString.getChars(0, seqString.length(), cbuf, off);
-
-
-
-			fCurrentPosition = fCurrentPosition + charsToRead;
-
-
-		}
-		return charsToRead;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CoreNodeList.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CoreNodeList.java
deleted file mode 100644
index fef7449..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CoreNodeList.java
+++ /dev/null
@@ -1,130 +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.sse.core.internal.text;
-
-
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-
-
-public class CoreNodeList implements IStructuredDocumentRegionList {
-	int countedLength;
-	int currentIndex = -1;
-
-	IStructuredDocumentRegion[] flatNodes;
-	IStructuredDocumentRegion head;
-
-	/**
-	 * CoreNodeList constructor comment.
-	 */
-	public CoreNodeList() {
-		super();
-		// create an array, even if zero length
-		flatNodes = new IStructuredDocumentRegion[0];
-	}
-
-	public CoreNodeList(IStructuredDocumentRegion newHead) {
-		super();
-		// save head
-		head = newHead;
-		int count = 0;
-		IStructuredDocumentRegion countNode = newHead;
-		// we have to go through the list once, to get its
-		// length in order to create the array
-		while (countNode != null) {
-			count++;
-			countNode = countNode.getNext();
-		}
-		// create an array, even if zero length
-		flatNodes = new IStructuredDocumentRegion[count];
-		// start countNode over again, so to speak.
-		countNode = newHead;
-		count = 0;
-		while (countNode != null) {
-			flatNodes[count++] = countNode;
-			countNode = countNode.getNext();
-		}
-		if (count > 0) {
-			currentIndex = 0;
-			// else it stays at -1 initialized at object creation
-			//
-			// save length
-			countedLength = count;
-		}
-	}
-
-	public CoreNodeList(IStructuredDocumentRegion start, IStructuredDocumentRegion end) {
-		super();
-		// save head
-		head = start;
-		int count = 0;
-		IStructuredDocumentRegion countNode = start;
-		if ((start == null) || (end == null)) {
-			// error condition
-			//throw new IllegalArgumentException("Must provide start and end
-			// nodes to construct CoreNodeList");
-		} else {
-			count = 1;
-			while ((countNode != null) && (countNode != end)) {
-				count++;
-				countNode = countNode.getNext();
-			}
-		}
-		// if we ended because the last one was null,
-		// backup one.
-		if (countNode == null)
-			count--;
-		if (count < 0) {
-			count = 0;
-		}
-		flatNodes = new IStructuredDocumentRegion[count];
-		if (count > 0) {
-			flatNodes[0] = countNode = start;
-			for (int i = 1; i < count; i++) {
-				flatNodes[i] = flatNodes[i - 1].getNext();
-			}
-
-		}
-		currentIndex = 0;
-		countedLength = count;
-	}
-
-	public Enumeration elements() {
-		StructuredDocumentRegionEnumeration result = null;
-		if ((flatNodes != null) && (flatNodes.length > 0))
-			result = new StructuredDocumentRegionEnumeration(flatNodes[0], flatNodes[flatNodes.length - 1]);
-		else
-			result = new StructuredDocumentRegionEnumeration(null);
-		return result;
-	}
-
-	public int getLength() {
-		return flatNodes.length;
-	}
-
-	public boolean includes(Object o) {
-		if (flatNodes == null)
-			return false;
-		for (int i = 0; i < flatNodes.length; i++)
-			if (flatNodes[i] == o)
-				return true;
-		return false;
-	}
-
-	public IStructuredDocumentRegion item(int i) {
-		return flatNodes[i];
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/DeleteEqualPositionUpdater.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/DeleteEqualPositionUpdater.java
deleted file mode 100644
index 3cdfd54..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/DeleteEqualPositionUpdater.java
+++ /dev/null
@@ -1,66 +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.sse.core.internal.text;
-
-import org.eclipse.jface.text.BadPositionCategoryException;
-import org.eclipse.jface.text.DefaultPositionUpdater;
-
-/**
- * Follows the behavior of DefaultPositionUpdater except in addition to
- * deleting/overwriting text which completely contains the position deletes
- * the position, deleting text that equals the text in position also deletes
- * the position.
- * 
- * @see org.eclipse.jface.text.DefaultPositionUpdater
- */
-public class DeleteEqualPositionUpdater extends DefaultPositionUpdater {
-
-	/**
-	 * @param category
-	 */
-	public DeleteEqualPositionUpdater(String category) {
-		super(category);
-	}
-
-	/**
-	 * Determines whether the currently investigated position has been deleted
-	 * by the replace operation specified in the current event. If so, it
-	 * deletes the position and removes it from the document's position
-	 * category.
-	 * 
-	 * NOTE: position is deleted if current event completely overwrites
-	 * position OR if current event deletes the area surrounding/including the
-	 * position
-	 * 
-	 * @return <code>true</code> if position has been deleted
-	 */
-	protected boolean notDeleted() {
-		// position is deleted if current event completely overwrites position
-		// OR if
-		// current event deletes the area surrounding/including the position
-		if ((fOffset < fPosition.offset && (fPosition.offset + fPosition.length < fOffset + fLength)) || (fOffset <= fPosition.offset && (fPosition.offset + fPosition.length <= fOffset + fLength) && fReplaceLength == 0)) {
-
-			fPosition.delete();
-
-			try {
-				fDocument.removePosition(getCategory(), fPosition);
-			} catch (BadPositionCategoryException x) {
-			}
-
-			return false;
-		}
-
-		return true;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/GenericPositionManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/GenericPositionManager.java
deleted file mode 100644
index 5083724..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/GenericPositionManager.java
+++ /dev/null
@@ -1,401 +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.sse.core.internal.text;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.BadPositionCategoryException;
-import org.eclipse.jface.text.DefaultPositionUpdater;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IPositionUpdater;
-import org.eclipse.jface.text.Position;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-
-
-
-public class GenericPositionManager {
-	private CharSequence fCharSequence;
-
-
-
-	private Map fPositions;
-	/** All registered document position updaters */
-	private List fPositionUpdaters;
-
-	/**
-	 * don't allow instantiation with out document pointer
-	 *  
-	 */
-	private GenericPositionManager() {
-		super();
-	}
-
-	/**
-	 *  
-	 */
-	public GenericPositionManager(CharSequence charSequence) {
-		this();
-		// we only use charSequence for "length", to
-		// made more generic than "document" even "text store"
-		fCharSequence = charSequence;
-		completeInitialization();
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#addPosition(org.eclipse.jface.text.Position)
-	 */
-	public void addPosition(Position position) throws BadLocationException {
-		try {
-			addPosition(IDocument.DEFAULT_CATEGORY, position);
-		} catch (BadPositionCategoryException e) {
-		}
-	}
-
-
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#addPosition(java.lang.String,
-	 *      org.eclipse.jface.text.Position)
-	 */
-	public void addPosition(String category, Position position) throws BadLocationException, BadPositionCategoryException {
-
-		if ((0 > position.offset) || (0 > position.length) || (position.offset + position.length > getDocumentLength()))
-			throw new BadLocationException();
-
-		if (category == null)
-			throw new BadPositionCategoryException();
-
-		List list = (List) fPositions.get(category);
-		if (list == null)
-			throw new BadPositionCategoryException();
-
-		list.add(computeIndexInPositionList(list, position.offset), position);
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#addPositionCategory(java.lang.String)
-	 */
-	public void addPositionCategory(String category) {
-
-		if (category == null)
-			return;
-
-		if (!containsPositionCategory(category))
-			fPositions.put(category, new ArrayList());
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#addPositionUpdater(org.eclipse.jface.text.IPositionUpdater)
-	 */
-	public void addPositionUpdater(IPositionUpdater updater) {
-		insertPositionUpdater(updater, fPositionUpdaters.size());
-	}
-
-
-	/**
-	 * Initializes document listeners, positions, and position updaters. Must
-	 * be called inside the constructor after the implementation plug-ins have
-	 * been set.
-	 */
-	protected void completeInitialization() {
-
-		fPositions = new HashMap();
-		fPositionUpdaters = new ArrayList();
-
-		addPositionCategory(IDocument.DEFAULT_CATEGORY);
-		addPositionUpdater(new DefaultPositionUpdater(IDocument.DEFAULT_CATEGORY));
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#computeIndexInCategory(java.lang.String,
-	 *      int)
-	 */
-	public int computeIndexInCategory(String category, int offset) throws BadLocationException, BadPositionCategoryException {
-
-		if (0 > offset || offset > getDocumentLength())
-			throw new BadLocationException();
-
-		List c = (List) fPositions.get(category);
-		if (c == null)
-			throw new BadPositionCategoryException();
-
-		return computeIndexInPositionList(c, offset);
-	}
-
-
-	/**
-	 * Computes the index in the list of positions at which a position with
-	 * the given offset would be inserted. The position is supposed to become
-	 * the first in this list of all positions with the same offset.
-	 * 
-	 * @param positions
-	 *            the list in which the index is computed
-	 * @param offset
-	 *            the offset for which the index is computed
-	 * @return the computed index
-	 * 
-	 * @see IDocument#computeIndexInCategory(String, int)
-	 */
-	protected int computeIndexInPositionList(List positions, int offset) {
-
-		if (positions.size() == 0)
-			return 0;
-
-		int left = 0;
-		int right = positions.size() - 1;
-		int mid = 0;
-		Position p = null;
-
-		while (left < right) {
-
-			mid = (left + right) / 2;
-
-			p = (Position) positions.get(mid);
-			if (offset < p.getOffset()) {
-				if (left == mid)
-					right = left;
-				else
-					right = mid - 1;
-			} else if (offset > p.getOffset()) {
-				if (right == mid)
-					left = right;
-				else
-					left = mid + 1;
-			} else if (offset == p.getOffset()) {
-				left = right = mid;
-			}
-
-		}
-
-		int pos = left;
-		p = (Position) positions.get(pos);
-		if (offset > p.getOffset()) {
-			// append to the end
-			pos++;
-		} else {
-			// entry will became the first of all entries with the same
-			// offset
-			do {
-				--pos;
-				if (pos < 0)
-					break;
-				p = (Position) positions.get(pos);
-			} while (offset == p.getOffset());
-			++pos;
-		}
-
-		Assert.isTrue(0 <= pos && pos <= positions.size());
-
-		return pos;
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#containsPosition(java.lang.String,
-	 *      int, int)
-	 */
-	public boolean containsPosition(String category, int offset, int length) {
-
-		if (category == null)
-			return false;
-
-		List list = (List) fPositions.get(category);
-		if (list == null)
-			return false;
-
-		int size = list.size();
-		if (size == 0)
-			return false;
-
-		int index = computeIndexInPositionList(list, offset);
-		if (index < size) {
-			Position p = (Position) list.get(index);
-			while (p != null && p.offset == offset) {
-				if (p.length == length)
-					return true;
-				++index;
-				p = (index < size) ? (Position) list.get(index) : null;
-			}
-		}
-
-		return false;
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#containsPositionCategory(java.lang.String)
-	 */
-	public boolean containsPositionCategory(String category) {
-		if (category != null)
-			return fPositions.containsKey(category);
-		return false;
-	}
-
-
-
-	public int getDocumentLength() {
-		return fCharSequence.length();
-	}
-
-	/**
-	 * Returns all positions managed by the document grouped by category.
-	 * 
-	 * @return the document's positions
-	 */
-	protected Map getDocumentManagedPositions() {
-		return fPositions;
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#getPositionCategories()
-	 */
-	public String[] getPositionCategories() {
-		String[] categories = new String[fPositions.size()];
-		Iterator keys = fPositions.keySet().iterator();
-		for (int i = 0; i < categories.length; i++)
-			categories[i] = (String) keys.next();
-		return categories;
-	}
-
-
-	public Position[] getPositions(String category) throws BadPositionCategoryException {
-
-		if (category == null)
-			throw new BadPositionCategoryException();
-
-		List c = (List) fPositions.get(category);
-		if (c == null)
-			throw new BadPositionCategoryException();
-
-		Position[] positions = new Position[c.size()];
-		c.toArray(positions);
-		return positions;
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#getPositionUpdaters()
-	 */
-	public IPositionUpdater[] getPositionUpdaters() {
-		IPositionUpdater[] updaters = new IPositionUpdater[fPositionUpdaters.size()];
-		fPositionUpdaters.toArray(updaters);
-		return updaters;
-	}
-
-
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#insertPositionUpdater(org.eclipse.jface.text.IPositionUpdater,
-	 *      int)
-	 */
-	public void insertPositionUpdater(IPositionUpdater updater, int index) {
-
-		for (int i = fPositionUpdaters.size() - 1; i >= 0; i--) {
-			if (fPositionUpdaters.get(i) == updater)
-				return;
-		}
-
-		if (index == fPositionUpdaters.size())
-			fPositionUpdaters.add(updater);
-		else
-			fPositionUpdaters.add(index, updater);
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#removePosition(org.eclipse.jface.text.Position)
-	 */
-	public void removePosition(Position position) {
-		try {
-			removePosition(IDocument.DEFAULT_CATEGORY, position);
-		} catch (BadPositionCategoryException e) {
-		}
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#removePosition(java.lang.String,
-	 *      org.eclipse.jface.text.Position)
-	 */
-	public void removePosition(String category, Position position) throws BadPositionCategoryException {
-
-		if (position == null)
-			return;
-
-		if (category == null)
-			throw new BadPositionCategoryException();
-
-		List c = (List) fPositions.get(category);
-		if (c == null)
-			throw new BadPositionCategoryException();
-
-		// remove based on identity not equality
-		int size = c.size();
-		for (int i = 0; i < size; i++) {
-			if (position == c.get(i)) {
-				c.remove(i);
-				return;
-			}
-		}
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#removePositionCategory(java.lang.String)
-	 */
-	public void removePositionCategory(String category) throws BadPositionCategoryException {
-
-		if (category == null)
-			return;
-
-		if (!containsPositionCategory(category))
-			throw new BadPositionCategoryException();
-
-		fPositions.remove(category);
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocument#removePositionUpdater(org.eclipse.jface.text.IPositionUpdater)
-	 */
-	public void removePositionUpdater(IPositionUpdater updater) {
-		for (int i = fPositionUpdaters.size() - 1; i >= 0; i--) {
-			if (fPositionUpdaters.get(i) == updater) {
-				fPositionUpdaters.remove(i);
-				return;
-			}
-		}
-	}
-
-
-	/**
-	 * Updates all positions of all categories to the change described by the
-	 * document event. All registered document updaters are called in the
-	 * sequence they have been arranged. Uses a robust iterator.
-	 * 
-	 * @param event
-	 *            the document event describing the change to which to adapt
-	 *            the positions
-	 */
-	protected void updatePositions(DocumentEvent event) {
-		List list = new ArrayList(fPositionUpdaters);
-		Iterator e = list.iterator();
-		while (e.hasNext()) {
-			IPositionUpdater u = (IPositionUpdater) e.next();
-			u.update(event);
-		}
-	}
-
-
-}
-
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IExecutionDelegatable.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IExecutionDelegatable.java
deleted file mode 100644
index 4efbeb5..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IExecutionDelegatable.java
+++ /dev/null
@@ -1,20 +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.sse.core.internal.text;
-
-import org.eclipse.wst.sse.core.internal.IExecutionDelegate;
-
-public interface IExecutionDelegatable {
-
-	void setExecutionDelegate(IExecutionDelegate executionDelegate);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IRegionComparible.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IRegionComparible.java
deleted file mode 100644
index 3230439..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IRegionComparible.java
+++ /dev/null
@@ -1,20 +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.sse.core.internal.text;
-
-public interface IRegionComparible {
-	boolean regionMatches(int offset, int length, String stringToCompare);
-
-	boolean regionMatchesIgnoreCase(int offset, int length, String stringToCompare);
-
-}
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
deleted file mode 100644
index 99b0eea..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java
+++ /dev/null
@@ -1,173 +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.sse.core.internal.text;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.jobs.ILock;
-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.StructuredDocumentEvent;
-
-
-
-public class JobSafeStructuredDocument extends BasicStructuredDocument implements IExecutionDelegatable, ILockable {
-
-	private IExecutionDelegate fExecutionDelegate;
-	private ILock fLockable = Platform.getJobManager().newLock();
-
-	public JobSafeStructuredDocument() {
-		super();
-	}
-
-
-	public JobSafeStructuredDocument(RegionParser parser) {
-		super(parser);
-	}
-
-
-	/**
-	 *  
-	 */
-	protected final void acquireLock() {
-		getLockObject().acquire();
-	}
-
-	private IExecutionDelegate getExecutionDelegate() {
-		return fExecutionDelegate;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.ILockable#getLock()
-	 */
-
-	public ILock getLockObject() {
-		return fLockable;
-	}
-
-
-	/**
-	 *  
-	 */
-	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)
-	 */
-	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).
-			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;
-					}
-				}
-			};
-			// 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];
-			}
-		}
-		return event;
-	}
-
-	public void setExecutionDelegate(IExecutionDelegate delegate) {
-		fExecutionDelegate = delegate;
-	}
-
-
-	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).
-			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;
-					}
-				}
-			};
-			// 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];
-			}
-		}
-		return event;
-	}
-
-}
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
deleted file mode 100644
index a3d63f8..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java
+++ /dev/null
@@ -1,445 +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.sse.core.internal.text;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.BadPositionCategoryException;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.IDocumentPartitioningListener;
-import org.eclipse.jface.text.IPositionUpdater;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.TypedRegion;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.NotImplementedException;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-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.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.IStructuredDocumentRegionList;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextReParser;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-
-
-/**
- * Purely a dummy "marker" instance for StructuredDocumentRegions which are
- * created temorarily in the course of re-parsing. Primarily a place holder,
- * but can be needed to get text from.
- */
-public class MinimalDocument implements IStructuredDocument {
-	private SubSetTextStore data;
-
-	/**
-	 * Marked private to be sure never created without data being initialized.
-	 *  
-	 */
-	private MinimalDocument() {
-		super();
-	}
-
-	public MinimalDocument(SubSetTextStore initialContents) {
-		this();
-		data = initialContents;
-	}
-
-	public void addDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void addDocumentChangedListener(IStructuredDocumentListener listener) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void addDocumentChangingListener(IStructuredDocumentListener listener) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void addDocumentListener(IDocumentListener listener) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void addDocumentPartitioningListener(IDocumentPartitioningListener listener) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void addPosition(Position position) throws BadLocationException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void addPosition(String category, Position position) throws BadLocationException, BadPositionCategoryException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void addPositionCategory(String category) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void addPositionUpdater(IPositionUpdater updater) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void addPrenotifiedDocumentListener(IDocumentListener documentAdapter) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void clearReadOnly(int startOffset, int length) {
-		// TODO: this is called from notifier loop inappropriately
-		//	throw new NotImplementedException("intentionally not implemented");
-	}
-
-	public int computeIndexInCategory(String category, int offset) throws BadLocationException, BadPositionCategoryException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public int computeNumberOfLines(String text) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public boolean containsPosition(String category, int offset, int length) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public boolean containsPositionCategory(String category) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public boolean containsReadOnly(int startOffset, int length) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void fireNewDocument(Object requester) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public String get() {
-		String result = null;
-		result = data.get(0, data.getLength());
-		return result;
-	}
-
-	public String get(int offset, int length) throws BadLocationException {
-		String result = null;
-		try {
-			result = data.get(offset, length);
-		} catch (StringIndexOutOfBoundsException e) {
-			throw new BadLocationException();
-		}
-		return result;
-	}
-
-	public Object getAdapter(Class adapter) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public char getChar(int offset) throws BadLocationException {
-		return data.get(offset);
-	}
-
-	public String getContentType(int offset) throws BadLocationException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public IDocumentPartitioner getDocumentPartitioner() {
-		// temp fix
-		return null;
-		//		throw new NotImplementedException("intentionally not implemented");
-	}
-
-	public EncodingMemento getEncodingMemento() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public IStructuredDocumentRegion getLastStructuredDocumentRegion() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public String[] getLegalContentTypes() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public String[] getLegalLineDelimiters() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public int getLength() {
-		return data.getLength();
-	}
-
-	public String getPreferedLineDelimiter() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public String getLineDelimiter(int line) throws BadLocationException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public IRegion getLineInformation(int line) throws BadLocationException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public IRegion getLineInformationOfOffset(int offset) throws BadLocationException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public int getLineLength(int line) throws BadLocationException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public int getLineOffset(int line) throws BadLocationException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public int getLineOfOffset(int offset) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public int getNumberOfLines() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public int getNumberOfLines(int offset, int length) throws BadLocationException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public RegionParser getParser() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public ITypedRegion getPartition(int offset) throws BadLocationException {
-		Logger.log(Logger.WARNING, "An instance of MinimalDocument was asked for its partition, sometime indicating a deleted region was being accessed."); //$NON-NLS-1$
-		return new TypedRegion(0,0, "undefined"); //$NON-NLS-1$
-		//throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public String[] getPositionCategories() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public Position[] getPositions(String category) throws BadPositionCategoryException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public IPositionUpdater[] getPositionUpdaters() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public IStructuredDocumentRegion getRegionAtCharacterOffset(int offset) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public IStructuredDocumentRegionList getRegionList() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public IStructuredTextReParser getReParser() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public String getText() {
-		return data.get(0, data.getLength());
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.text.IStructuredDocument#getUndoManager()
-	 */
-	public IStructuredTextUndoManager getUndoManager() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void insertPositionUpdater(IPositionUpdater updater, int index) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void makeReadOnly(int startOffset, int length) {
-		// TODO: this is called from notifier loop inappropriately
-		//	throw new NotImplementedException("intentionally not implemented");
-	}
-
-	public IStructuredDocument newInstance() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentExtension#registerPostNotificationReplace(org.eclipse.jface.text.IDocumentListener,
-	 *      org.eclipse.jface.text.IDocumentExtension.IReplace)
-	 */
-	public void registerPostNotificationReplace(IDocumentListener owner, IReplace replace) throws UnsupportedOperationException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$		
-	}
-
-	public void removeDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void removeDocumentChangedListener(IStructuredDocumentListener listener) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void removeDocumentChangingListener(IStructuredDocumentListener listener) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void removeDocumentListener(IDocumentListener listener) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void removePosition(Position position) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void removePosition(String category, Position position) throws BadPositionCategoryException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void removePositionCategory(String category) throws BadPositionCategoryException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void removePositionUpdater(IPositionUpdater updater) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void removePrenotifiedDocumentListener(IDocumentListener documentAdapter) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void replace(int offset, int length, String text) throws BadLocationException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-		//		data.replace(offset, length, text);
-	}
-
-	public StructuredDocumentEvent replaceText(Object source, int oldStart, int replacementLength, String requestedChange) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.text.IStructuredDocument#replaceText(java.lang.Object,
-	 *      int, int, java.lang.String, boolean)
-	 */
-	public StructuredDocumentEvent replaceText(Object source, int oldStart, int replacementLength, String requestedChange, boolean ignoreReadOnlySetting) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentExtension#resumePostNotificationProcessing()
-	 */
-	public void resumePostNotificationProcessing() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public int search(int startOffset, String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord) throws BadLocationException {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void set(String text) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-		//		data.set(text);
-	}
-
-	public void setDocumentPartitioner(IDocumentPartitioner partitioner) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void setEncodingMemento(EncodingMemento encodingMemento) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public void setPreferredLineDelimiter(String delimiter) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public StructuredDocumentEvent setText(Object requester, String allText) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.text.IStructuredDocument#setUndoManager(org.eclipse.wst.sse.core.undo.StructuredTextUndoManager)
-	 */
-	public void setUndoManager(IStructuredTextUndoManager undoManager) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentExtension#startSequentialRewrite(boolean)
-	 */
-	public void startSequentialRewrite(boolean normalize) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentExtension#stopPostNotificationProcessing()
-	 */
-	public void stopPostNotificationProcessing() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentExtension#stopSequentialRewrite()
-	 */
-	public void stopSequentialRewrite() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-
-	public String getLineDelimiter() {
-		return null;
-	}
-
-	public String getPreferredLineDelimiter() {
-		return null;
-	}
-
-	public void setLineDelimiter(String delimiter) {
-		
-	}
-	
-	public IStructuredDocumentRegion[] getStructuredDocumentRegions() {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-	
-	public IStructuredDocumentRegion[] getStructuredDocumentRegions(int start, int length) {
-		throw new NotImplementedException("intentionally not implemented"); //$NON-NLS-1$
-	}
-}
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
deleted file mode 100644
index f6dd9db..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java
+++ /dev/null
@@ -1,1651 +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.sse.core.internal.text;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTagParser;
-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.StructuredDocumentEvent;
-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.IStructuredTextReParser;
-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.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-
-/**
- * This class provides a centralized place to put "reparsing" logic. This is
- * the logic that reparses the text incrementally, as a user types in new
- * characters, or DOM nodes are inserted or deleted. Note: it is not a thread
- * safe class.
- */
-public class StructuredDocumentReParser implements IStructuredTextReParser {
-	protected IStructuredDocumentRegion dirtyEnd = null;
-	protected IStructuredDocumentRegion dirtyStart = null;
-	final private String doubleQuote = new String(new char[]{'\"'});
-	protected final CoreNodeList EMPTY_LIST = new CoreNodeList();
-	protected String fChanges;
-	protected String fDeletedText;
-
-	private FindReplaceDocumentAdapter fFindReplaceDocumentAdapter = null;
-	protected int fLengthDifference;
-	protected int fLengthToReplace;
-	protected Object fRequester;
-	protected int fStart;
-	// note: this is the impl class of IStructuredDocument, not the interface
-	// FUTURE_TO_DO: I believe some of these can be made private now.?
-	protected BasicStructuredDocument fStructuredDocument;
-
-	/**
-	 * variable used in anticiapation of multithreading
-	 */
-	protected boolean isParsing;
-	final private String singleQuote = new String(new char[]{'\''});
-
-	public StructuredDocumentReParser() {
-		super();
-	}
-
-	public StructuredDocumentEvent _checkBlockNodeList(List blockTagList) {
-		StructuredDocumentEvent result = null;
-		if (blockTagList != null) {
-			for (int i = 0; i < blockTagList.size(); i++) {
-				org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker blockTag = (org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker) blockTagList.get(i);
-				String tagName = blockTag.getTagName();
-				result = checkForCriticalName("<" + tagName); //$NON-NLS-1$
-				if (result != null)
-					break;
-				result = checkForCriticalName("</" + tagName); //$NON-NLS-1$
-				if (result != null)
-					break;
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Common utility for checking for critical word such as " <SCRIPT>"
-	 */
-	private StructuredDocumentEvent _checkForCriticalWord(String criticalTarget, boolean checkEnd) {
-		StructuredDocumentEvent result = null;
-		int documentLength = fStructuredDocument.getLength();
-		int propLen = fLengthToReplace;
-		if (propLen > documentLength)
-			propLen = documentLength;
-		int startNeighborhood = fStart - criticalTarget.length();
-		int adjustInsert = 0;
-		if (startNeighborhood < 0) {
-			adjustInsert = 0 - startNeighborhood;
-			startNeighborhood = 0;
-		}
-		int endNeighborhood = fStart + fLengthToReplace + criticalTarget.length() - 1;
-		if (endNeighborhood > documentLength)
-			endNeighborhood = documentLength - 1;
-		int oldlen = endNeighborhood - startNeighborhood; // + 1;
-		if (oldlen + startNeighborhood > documentLength) {
-			oldlen = documentLength - startNeighborhood;
-		}
-		String oldText = fStructuredDocument.get(startNeighborhood, oldlen);
-		String peek = StringUtils.paste(oldText, fChanges, criticalTarget.length() - adjustInsert, fLengthToReplace);
-		boolean isCriticalString = checkTagNames(oldText, criticalTarget, checkEnd);
-		boolean toBeCriticalString = checkTagNames(peek, criticalTarget, checkEnd);
-		if ((isCriticalString != toBeCriticalString) || // OR if both are
-					// critical and there's
-					// a change in the end
-					// tag ('>')
-					((isCriticalString && toBeCriticalString) && (changeInIsEndedState(oldText, peek)))) {
-			// if it involves a change of a critical string (making one where
-			// there wasn't, or removing
-			// one where there was one) then reparse everthing.
-			result = reparse(0, documentLength - 1);
-		}
-		return result;
-	}
-
-	private int _computeStartOfDifferences(CoreNodeList oldNodes, CoreNodeList newNodes) {
-		int startOfDifferences = -1;
-		int newNodesLength = newNodes.getLength();
-		boolean foundDifference = false;
-		boolean done = false;
-		// we'll control our loop based on the old List length
-		int oldNodesLength = oldNodes.getLength();
-		// be sure to check 'done' first, so startOfDifferences isn't
-		// icremented if done is true
-		done : while ((!done) && (++startOfDifferences < oldNodesLength)) {
-			IStructuredDocumentRegion oldNode = oldNodes.item(startOfDifferences);
-			// this lessThanEffectedRegion is to check to be sure the node is
-			// infact a candidate
-			// to be considered as "old". This check is important for the case
-			// where some
-			// text is replaceing text that
-			// appears identical, but is a different instance. For example, if
-			// the text
-			// is <P><B></B></P> and <B></B> is inserted at postion 3,
-			// resulting in <P><B></B><B></B></P>
-			// we do not want the
-			// first <B> to be considered old ... it is the new one, the
-			// second
-			// <B> is the old one.
-			if (_lessThanEffectedRegion(oldNode)) {
-				// be sure to check that we have new nodes to compare against.
-				if (startOfDifferences > newNodesLength) {
-					foundDifference = false;
-					done = true;
-					continue done;
-				} else {
-					//
-					IStructuredDocumentRegion newNode = newNodes.item(startOfDifferences);
-					// note: shift is 0 while at beginning of list, before the
-					// insertion (or deletion) point. After that, it is
-					// fStart+fLengthDifference
-					if (!(oldNode.sameAs(newNode, 0))) {
-						foundDifference = true;
-						done = true;
-						continue done;
-					} else { // if they are equal, then we will be keeping the
-						// old one, so
-						// we need to be sure its parentDocument is set back
-						// to
-						// the right instance
-						oldNode.setParentDocument(fStructuredDocument);
-					}
-				}
-			} else {
-				// we didn't literally find a difference, but we count it as
-				// such by implication
-				foundDifference = true;
-				done = true;
-				continue done;
-			}
-		}
-		// if we literally found a difference, then all is ok and we can
-		// return
-		// it.
-		// if we did not literally find one, then we have to decide why.
-		if (!foundDifference) {
-			if (newNodesLength == oldNodesLength) { // then lists are
-				// identical
-				// (and may be of zero
-				// length)
-				startOfDifferences = -1;
-			} else {
-				if (newNodesLength > oldNodesLength) { // then lists are
-					// identical except for
-					// newNodes added
-					startOfDifferences = oldNodesLength;
-				} else {
-					if (newNodesLength < oldNodesLength) { // then lists are
-						// identical except
-						// for old Nodes
-						// deleted
-						startOfDifferences = newNodesLength;
-					}
-				}
-			}
-		}
-		return startOfDifferences;
-	}
-
-	private int _computeStartOfDifferences(IStructuredDocumentRegion oldNodeParam, ITextRegionList oldRegions, IStructuredDocumentRegion newNodeParam, ITextRegionList newRegions) {
-		int startOfDifferences = -1;
-		int newRegionsLength = newRegions.size();
-		boolean foundDifference = false;
-		boolean done = false;
-		// we'll control our loop based on the old List length
-		int oldRegionsLength = oldRegions.size();
-		// be sure to check 'done' first, so startOfDifferences isn't
-		// icremented if done is true
-		done : while ((!done) && (++startOfDifferences < oldRegionsLength)) {
-			ITextRegion oldRegion = oldRegions.get(startOfDifferences);
-			// this lessThanEffectedRegion is to check to be sure the node is
-			// infact a candidate
-			// to be considered as "old". This check is important for the case
-			// where some
-			// text is replaceing text that
-			// appears identical, but is a different instance. For example, if
-			// the text
-			// is <P><B></B></P> and <B></B> is inserted at postion 3,
-			// resulting in <P><B></B><B></B></P>
-			// we do not want the
-			// first <B> to be considered old ... it is the new one, the
-			// second
-			// <B> is the old one.
-			if (_lessThanEffectedRegion(oldNodeParam, oldRegion)) {
-				// be sure to check that we have new nodes to compare against.
-				if (startOfDifferences > newRegionsLength) {
-					foundDifference = false;
-					done = true;
-					continue done;
-				} else {
-					//
-					ITextRegion newRegion = newRegions.get(startOfDifferences);
-					// note: shift is 0 while at beginning of list, before the
-					// insertion (or deletion) point. After that, it is
-					// fStart+fLengthDifference
-					if (!(oldNodeParam.sameAs(oldRegion, newNodeParam, newRegion, 0))) {
-						foundDifference = true;
-						done = true;
-						continue done;
-					} else {
-						// if they are equal, then we will be keeping the old
-						// one.
-						// unlike the flatnode case, there is no reason to
-						// update
-						// the textstore, since its the same text store in
-						// either case
-						// (since its the same flatnode)
-						//oldRegion.setTextStore(fStructuredDocument.parentDocument);
-					}
-				}
-			} else {
-				// we didn't literally find a difference, but we count it as
-				// such by implication
-				foundDifference = true;
-				done = true;
-				continue done;
-			}
-		}
-		// if we literally found a difference, then all is ok and we can
-		// return
-		// it.
-		// if we did not literally find one, then we have to decide why.
-		if (!foundDifference) {
-			if (newRegionsLength == oldRegionsLength) { // then lists are
-				// identical (and may
-				// be of zero length)
-				startOfDifferences = -1;
-			} else {
-				if (newRegionsLength > oldRegionsLength) { // then lists are
-					// identical except
-					// for newRegions
-					// added
-					startOfDifferences = oldRegionsLength;
-				} else {
-					if (newRegionsLength < oldRegionsLength) { // then lists
-						// are identical
-						// except for
-						// old Nodes
-						// deleted
-						startOfDifferences = newRegionsLength;
-					}
-				}
-			}
-		}
-		return startOfDifferences;
-	}
-
-	/**
-	 * Part 1 of 2 steps to do a core_reparse
-	 * 
-	 * Parses a portion of the current text in the IStructuredDocument and
-	 * returns the raw result
-	 */
-	private IStructuredDocumentRegion _core_reparse_text(int rescanStart, int rescanEnd) {
-		fStructuredDocument.resetParser(rescanStart, rescanEnd);
-		return fStructuredDocument.getParser().getDocumentRegions();
-	}
-
-	/**
-	 * Part 2 of 2 steps to do a core_reparse
-	 * 
-	 * Integrates a list of StructuredDocumentRegions based on the current
-	 * text contents of the IStructuredDocument into the IStructuredDocument
-	 * data structure
-	 */
-	private StructuredDocumentEvent _core_reparse_update_model(IStructuredDocumentRegion newNodesHead, int rescanStart, int rescanEnd, CoreNodeList oldNodes, boolean firstTime) {
-		StructuredDocumentEvent result = null;
-		CoreNodeList newNodes = null;
-		// rescan
-		newNodes = new CoreNodeList(newNodesHead);
-		// adjust our newNode chain so the offset positions match
-		// our text store (not the simple string of text reparsed)
-		StructuredDocumentRegionIterator.adjustStart(newNodesHead, rescanStart);
-		// initialize the parentDocument variable of each instance in the new
-		// chain
-		StructuredDocumentRegionIterator.setParentDocument(newNodesHead, fStructuredDocument);
-		// initialize the structuredDocument variable of each instance in the
-		// new chain
-		//StructuredDocumentRegionIterator.setStructuredDocument(newNodesHead,
-		// fStructuredDocument);
-		//
-		if (firstTime) {
-			fStructuredDocument.setCachedDocumentRegion(newNodesHead);
-			fStructuredDocument.initializeFirstAndLastDocumentRegion();
-			// note: since we are inserting nodes, for the first time, there
-			// is
-			// no adjustments
-			// to downstream stuff necessary.
-			result = new StructuredDocumentRegionsReplacedEvent(fStructuredDocument, fRequester, oldNodes, newNodes, fChanges, fStart, fLengthToReplace);
-		} else {
-			// note: integrates changes into model as a side effect
-			result = minimumEvent(oldNodes, newNodes);
-		}
-		result.setDeletedText(fDeletedText);
-		return result;
-	}
-
-	private CoreNodeList _formMinimumList(CoreNodeList flatnodes, int startOfDifferences, int endOfDifferences) {
-		CoreNodeList minimalNodes = null;
-		// if startOfDifferces is still its initial value, then we have an
-		// empty document
-		if (startOfDifferences == -1) {
-			minimalNodes = EMPTY_LIST;
-		} else {
-			// if we do not have any flatnode in our flatnode list, then
-			// simply
-			// return our standard empty list
-			if (flatnodes.getLength() == 0) {
-				minimalNodes = EMPTY_LIST;
-			} else {
-				// if startOfDifferences is greater than endOfDifferences,
-				// then
-				// that means the calculations "crossed" each other, and
-				// hence,
-				// there really is no differences, so, again, return the empty
-				// list
-				if (startOfDifferences > endOfDifferences) {
-					minimalNodes = EMPTY_LIST;
-				} else {
-					// the last check be sure we have some differnces
-					if ((endOfDifferences > -1)) {
-						minimalNodes = new CoreNodeList(flatnodes.item(startOfDifferences), flatnodes.item(endOfDifferences));
-					} else {
-						// there were no differences, the list wasn't
-						// minimized, so simply return it.
-						minimalNodes = flatnodes;
-					}
-				}
-			}
-		}
-		return minimalNodes;
-	}
-
-	private boolean _greaterThanEffectedRegion(IStructuredDocumentRegion oldNode) {
-		boolean result = false;
-		int nodeStart = oldNode.getStartOffset();
-		int changedRegionEnd = fStart + fLengthToReplace - 1;
-		result = nodeStart > changedRegionEnd;
-		return result;
-	}
-
-	private boolean _greaterThanEffectedRegion(IStructuredDocumentRegion oldNode, ITextRegion oldRegion) {
-		boolean result = false;
-		int regionStartOffset = oldNode.getStartOffset(oldRegion);
-		int effectedRegionEnd = fStart + fLengthToReplace - 1;
-		result = regionStartOffset > effectedRegionEnd;
-		return result;
-	}
-
-	private boolean _lessThanEffectedRegion(IStructuredDocumentRegion oldNode) {
-		boolean result = false;
-		int nodeEnd = oldNode.getEndOffset() - 1;
-		result = nodeEnd < fStart;
-		return result;
-	}
-
-	private boolean _lessThanEffectedRegion(IStructuredDocumentRegion oldNode, ITextRegion oldRegion) {
-		boolean result = false;
-		int nodeEnd = oldNode.getEndOffset(oldRegion) - 1;
-		result = nodeEnd < fStart;
-		return result;
-	}
-
-	private boolean _regionsSameKind(ITextRegion newRegion, ITextRegion oldRegion) {
-		boolean result = false;
-		// if one region is a container region, and the other not, always
-		// return false
-		// else, just check their type.
-		//      DW druing refactoring, looks like a "typo" here, using 'old' in
-		// both.
-		//		if (isContainerRegion(oldRegion) != isContainerRegion(oldRegion))
-		if (isCollectionRegion(oldRegion) != isCollectionRegion(newRegion))
-			result = false;
-		else if (oldRegion.getType() == newRegion.getType())
-			result = true;
-		return result;
-	}
-
-	//	private boolean hasCollectionRegions(ITextRegion aRegion) {
-	//		boolean result = false;
-	//		if (aRegion instanceof ITextRegionCollection) {
-	//			ITextRegionCollection regionContainter = (ITextRegionCollection)
-	// aRegion;
-	//			ITextRegionList regions = regionContainter.getRegions();
-	//			Iterator iterator = regions.iterator();
-	//			while (iterator.hasNext()) {
-	//				if (aRegion instanceof ITextRegionCollection) {
-	//					result = true;
-	//					break;
-	//				}
-	//			}
-	//		}
-	//		return result;
-	//	}
-	/**
-	 * This method is specifically to detect changes in 'isEnded' state,
-	 * although it still does so with heuristics. If number of '>' changes,
-	 * assume the isEnded state has changed.
-	 */
-	private boolean changeInIsEndedState(String oldText, String newText) {
-		int nOld = StringUtils.occurrencesOf(oldText, '>');
-		int nNew = StringUtils.occurrencesOf(newText, '>');
-		return !(nOld == nNew);
-	}
-
-	private void checkAndAssignParent(IStructuredDocumentRegion oldNode, ITextRegion region) {
-		if (region instanceof ITextRegionContainer) {
-			((ITextRegionContainer) region).setParent(oldNode);
-			return;
-		}
-		if (region instanceof ITextRegionCollection) {
-			ITextRegionCollection textRegionCollection = (ITextRegionCollection) region;
-			ITextRegionList regionList = textRegionCollection.getRegions();
-			for (int i = 0; i < regionList.size(); i++) {
-				ITextRegion innerRegion = regionList.get(i);
-				checkAndAssignParent(oldNode, innerRegion);
-			}
-		}
-	}
-
-	/**
-	 * A change to a CDATA tag can result in all being reparsed.
-	 */
-	private StructuredDocumentEvent checkForCDATA() {
-		StructuredDocumentEvent result = null;
-		result = checkForCriticalKey("<![CDATA["); //$NON-NLS-1$
-		if (result == null)
-			result = checkForCriticalKey("]]>"); //$NON-NLS-1$
-		return result;
-	}
-
-	/**
-	 * If a comment start or end tag is being added or deleted, we'll rescan
-	 * the whole document. The reason is that content that is revealed or
-	 * commented out can effect the interpretation of the rest of the
-	 * document. Note: for now this is very XML specific, can refactor/improve
-	 * later.
-	 */
-	protected StructuredDocumentEvent checkForComments() {
-		StructuredDocumentEvent result = null;
-		result = checkForCriticalKey("<!--"); //$NON-NLS-1$
-		if (result == null)
-			result = checkForCriticalKey("-->"); //$NON-NLS-1$
-		// we'll also check for these degenerate cases
-		if (result == null)
-			result = checkForCriticalKey("<!--->"); //$NON-NLS-1$
-		return result;
-	}
-
-	/**
-	 * Common utility for checking for critical word such as " <SCRIPT>"
-	 */
-	protected StructuredDocumentEvent checkForCriticalKey(String criticalTarget) {
-		return _checkForCriticalWord(criticalTarget, false);
-	}
-
-	/**
-	 * Common utility for checking for critical word such as " <SCRIPT>"
-	 */
-	private StructuredDocumentEvent checkForCriticalName(String criticalTarget) {
-		return _checkForCriticalWord(criticalTarget, true);
-	}
-
-	//	/**
-	//	 * Currently this method is pretty specific to ?ML
-	//	 * @deprecated - not really deprecated, but plan to make
-	//	 * protected ... I'm not sure why its public or misspelled?
-	//	 */
-	protected StructuredDocumentEvent checkForCrossStructuredDocumentRegionBoundryCases() {
-		StructuredDocumentEvent result = null;
-		// Case 1: See if the language's syntax requires that multiple
-		// StructuredDocumentRegions be rescanned
-		if (result == null) {
-			result = checkForCrossStructuredDocumentRegionSyntax();
-		}
-		// Case 2: "block tags" whose content is left unparsed
-		if (result == null) {
-			Object parser = fStructuredDocument.getParser();
-			if (parser instanceof BlockTagParser) {
-				List blockTags = ((BlockTagParser) parser).getBlockMarkers();
-				result = _checkBlockNodeList(blockTags);
-			}
-		}
-		// FUTURE_TO_DO: is there a better place to do this?
-		// or! do we already do it some other more central place?
-		if (result != null) {
-			result.setDeletedText(fDeletedText);
-		}
-		return result;
-	}
-
-	/**
-	 * Allow a reparser to check for extra syntactic cases that require
-	 * parsing beyond the flatNode boundary.
-	 * 
-	 * This implementation is very XML-centric.
-	 */
-	protected StructuredDocumentEvent checkForCrossStructuredDocumentRegionSyntax() {
-		StructuredDocumentEvent result;
-		// Case 1: Quote characters are involved
-		result = checkForQuotes();
-		if (result == null) {
-			// Case 2: The input forms or undoes a comment beginning or
-			// comment
-			// end
-			result = checkForComments();
-		}
-		if (result == null) {
-			// Case 3: The input forms or undoes a processing instruction
-			result = checkForPI();
-		}
-		if (result == null) {
-			// Case 4: The input forms or undoes a CDATA section
-			result = checkForCDATA();
-		}
-		return result;
-	}
-
-	/**
-	 * Checks to see if change request exactly matches the text it would be
-	 * replacing. (In future, this, or similar method is where to check for
-	 * "read only" attempted change.)
-	 */
-	private StructuredDocumentEvent checkForNoChange() {
-		StructuredDocumentEvent result = null;
-		// don't check equals unless lengths match
-		// should be a tiny bit faster, since usually not
-		// of equal lengths (I'm surprised String's equals method
-		// doesn't do this.)
-		if ((fChanges != null) && (fDeletedText != null) && (fChanges.length() == fDeletedText.length()) && (fChanges.equals(fDeletedText))) {
-			result = new NoChangeEvent(fStructuredDocument, fRequester, fChanges, fStart, fLengthToReplace);
-		}
-		return result;
-	}
-
-	/**
-	 * A change to a PI tag can result in all being reparsed.
-	 */
-	private StructuredDocumentEvent checkForPI() {
-		StructuredDocumentEvent result = null;
-		result = checkForCriticalKey("<?"); //$NON-NLS-1$
-		if (result == null)
-			result = checkForCriticalKey("?>"); //$NON-NLS-1$
-		return result;
-	}
-
-	//  For simplicity, if either text to be deleted, or text to be inserted
-	// contains at least
-	//  one quote, we'll search for previous quote in document, if any, and use
-	// that flatnode as
-	//  a dirty start, and we'll use end of document as dirty end. We need to
-	// assume either \" or
-	//  \' is an exceptable quote. (NOTE: this is, loosely, an XML assumption
-	// --
-	// other languages
-	//  would differ, but we'll "hard code" for XML for now.
-	// future_TODO: this is a really bad heuristic ... we should be looking
-	// for
-	// odd number of quotes
-	// within a structuredDocumentRegion (or something!) This causes way too
-	// much reparsing on
-	// simple cases, like deleting a tag with a quoted attribute!
-	private StructuredDocumentEvent checkForQuotes() {
-		// routine is supported with null or empty string meaning the same
-		// thing: deletion
-		if (fChanges == null)
-			fChanges = ""; //$NON-NLS-1$
-		//
-		StructuredDocumentEvent result = null;
-		try {
-			int dirtyStartPos = -1;
-			String proposedDeletion = fStructuredDocument.get(fStart, fLengthToReplace);
-			if (fStart < fStructuredDocument.getLength()) {
-				if ((fChanges.indexOf(singleQuote) > -1) || (proposedDeletion.indexOf(singleQuote) > -1)) {
-					IRegion singleQuoteRegion = getFindReplaceDocumentAdapter().find(fStart, singleQuote, false, false, false, false);
-					if (singleQuoteRegion != null) {
-						dirtyStartPos = singleQuoteRegion.getOffset();
-					}
-				} else if ((fChanges.indexOf(doubleQuote) > -1) || (proposedDeletion.indexOf(doubleQuote) > -1)) {
-					IRegion doubleQuoteRegion = getFindReplaceDocumentAdapter().find(fStart, doubleQuote, false, false, false, false);
-					if (doubleQuoteRegion != null) {
-						dirtyStartPos = doubleQuoteRegion.getOffset();
-					}
-				}
-			}
-			if (dirtyStartPos > -1) {
-				// then we found one, do create new structuredDocument event
-				// based on the previous quote to end of document
-				// except, we need to be positive that the previous quote is
-				// in a "safe start" region (e.g. if in JSP content, we need
-				// to
-				// backup till we include the whole JSP region, in order for
-				// it
-				// to be correctly re-parsed. The backing up is done in the
-				// reparse/find dirty start from hint
-				// method.
-				result = reparse(dirtyStartPos, fStructuredDocument.getLength() - 1);
-			}
-		} catch (BadLocationException e) {
-			Logger.logException(e);
-		}
-		if (result != null) {
-			result.setDeletedText(fDeletedText);
-		}
-		return result;
-	}
-
-	private StructuredDocumentEvent checkHeuristics() {
-		StructuredDocumentEvent result = null;
-		result = checkForNoChange();
-		if (result == null) {
-			result = checkForCrossStructuredDocumentRegionBoundryCases();
-			if (result == null) {
-				result = quickCheck();
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Takes into account "tag name" rules for comparisons; case-insensitive.
-	 */
-	private boolean checkTagNames(String compareText, String criticalTarget, boolean checkEnd) {
-		boolean result = false;
-		if ((compareText == null) || (criticalTarget == null))
-			return false;
-		int posOfCriticalWord = compareText.toLowerCase().indexOf(criticalTarget.toLowerCase());
-		result = posOfCriticalWord > -1;
-		if (checkEnd && result) {
-			// instead of returning true right away, we'll only return true
-			// the
-			// potentially matched tag is indeed a tag, for example, if
-			// <SCRIPT
-			// becomes <SCRIPTS we don't want to say the latter is a critical
-			// tag
-			int lastPos = posOfCriticalWord + criticalTarget.length();
-			if (lastPos < compareText.length()) {
-				char lastChar = compareText.charAt(lastPos);
-				// Future: check formal definition of this java method, vs.
-				// XML
-				// parsing rules
-				result = (!Character.isLetterOrDigit(lastChar));
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * The core reparsing method ... after the dirty start and dirty end have
-	 * been calculated elsewhere, and the text updated.
-	 */
-	protected StructuredDocumentEvent core_reparse(int rescanStart, int rescanEnd, CoreNodeList oldNodes, boolean firstTime) {
-		IStructuredDocumentRegion newNodesHead = null;
-		StructuredDocumentEvent result = null;
-		newNodesHead = _core_reparse_text(rescanStart, rescanEnd);
-		result = _core_reparse_update_model(newNodesHead, rescanStart, rescanEnd, oldNodes, firstTime);
-		return result;
-	}
-
-	/**
-	 * Resets state to "not parsing"
-	 */
-	private synchronized void endReParse() {
-		isParsing = false;
-		dirtyStart = null;
-		dirtyEnd = null;
-	}
-
-	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();
-			}
-		}
-		// moved to subclass for quick transition
-		// 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;
-			// moved to subclass to speed transition
-			//			while (isPartOfBlockRegion(potential)) {
-			//				potential = potential.getPrevious();
-			//			}
-			if (potential != null) {
-				result = potential;
-				fStructuredDocument.setCachedDocumentRegion(result);
-			}
-		}
-		dirtyStart = result;
-	}
-
-	protected CoreNodeList formOldNodes(IStructuredDocumentRegion dirtyStart, IStructuredDocumentRegion dirtyEnd) {
-		CoreNodeList oldNodes = new CoreNodeList(dirtyStart, dirtyEnd);
-		// Now save the old text, that "goes with" the old nodes and regions.
-		// Notice we are getting it directly from the text store
-		String oldText = null;
-		int oldStart = -1;
-		int oldEnd = -1;
-		// make sure there is some text, if not, use empty string
-		// (if one node is not null, the other should ALWAYS be not null too,
-		// since it
-		// would at least be equal to it.)
-		if (dirtyStart != null) {
-			oldStart = dirtyStart.getStart();
-			oldEnd = dirtyEnd.getEnd();
-			oldText = fStructuredDocument.get(oldStart, oldEnd - oldStart);
-		} else {
-			oldStart = 0;
-			oldEnd = 0;
-			oldText = ""; //$NON-NLS-1$
-		}
-		// create a temporary text store for this text
-		SubSetTextStore subTextStore = new SubSetTextStore(oldText, oldStart, oldEnd, fStructuredDocument.getLength());
-		// Now update the text store of the oldNodes
-		StructuredDocumentRegionIterator.setParentDocument(oldNodes, new MinimalDocument(subTextStore));
-		return oldNodes;
-	}
-
-	/**
-	 * @return Returns the findReplaceDocumentAdapter.
-	 */
-	public FindReplaceDocumentAdapter getFindReplaceDocumentAdapter() {
-		if (fFindReplaceDocumentAdapter == null) {
-			fFindReplaceDocumentAdapter = new FindReplaceDocumentAdapter(fStructuredDocument);
-		}
-		return fFindReplaceDocumentAdapter;
-	}
-
-	// Note: if thead safety is needed, this and all the other public methods
-	// of this class
-	// should be synchronized.
-	public void initialize(Object requester, int start, int lengthToReplace, String changes) {
-		isParsing = true;
-		fRequester = requester;
-		fStart = start;
-		fLengthToReplace = lengthToReplace;
-		fChanges = changes;
-		// notice this one is derived
-		fLengthDifference = Utilities.calculateLengthDifference(fChanges, fLengthToReplace);
-		fDeletedText = fStructuredDocument.get(fStart, fLengthToReplace);
-	}
-
-	protected void insertNodes(IStructuredDocumentRegion previousOldNode, IStructuredDocumentRegion nextOldNode, CoreNodeList newNodes) {
-		//
-		IStructuredDocumentRegion firstNew = null;
-		IStructuredDocumentRegion lastNew = null;
-		//
-		IStructuredDocumentRegion oldPrevious = previousOldNode;
-		IStructuredDocumentRegion oldNext = nextOldNode;
-		//
-		if (newNodes.getLength() > 0) {
-			// get pointers
-			firstNew = newNodes.item(0);
-			lastNew = newNodes.item(newNodes.getLength() - 1);
-			// switch surrounding StructuredDocumentRegions' references to
-			// lists
-			if (oldPrevious != null)
-				oldPrevious.setNext(firstNew);
-			if (oldNext != null) {
-				oldNext.setPrevious(lastNew);
-			} else {
-				// SIDE EFFECT
-				// if oldNext is null, that means we are replaceing the
-				// lastNode in the chain,
-				// so we need to update the structuredDocuments lastNode as
-				// the
-				// last of the new nodes.
-				fStructuredDocument.setLastDocumentRegion(newNodes.item(newNodes.getLength() - 1));
-			}
-			if (firstNew != null)
-				firstNew.setPrevious(oldPrevious);
-			if (lastNew != null)
-				lastNew.setNext(oldNext);
-		}
-		// else nothing to insert
-	}
-
-	/**
-	 * @param oldRegion
-	 */
-	private boolean isCollectionRegion(ITextRegion aRegion) {
-		return (aRegion instanceof ITextRegionCollection);
-	}
-
-	/**
-	 * @return boolean
-	 */
-	public boolean isParsing() {
-		return isParsing;
-	}
-
-	/**
-	 * The minimization algorithm simply checks the old nodes to see if any of
-	 * them "survived" the rescan and are unchanged. If so, the instance of
-	 * the old node is used instead of the new node. Before the requested
-	 * change, need to check type, offsets, and text to determine if the same.
-	 * After the requested change, need to check type and text, but adjust the
-	 * offsets to what ever the change was.
-	 */
-	protected StructuredDocumentEvent minimumEvent(CoreNodeList oldNodes, CoreNodeList newNodes) {
-		StructuredDocumentEvent event = null;
-		CoreNodeList minimalOldNodes = null;
-		CoreNodeList minimalNewNodes = null;
-		// To minimize nodes, we'll collect all those
-		// that are not equal into old and new lists
-		// Note: we assume that old and new nodes
-		// are basically contiguous -- and we force it to be so,
-		// by starting at the beginning to
-		// find first difference, and then starting at the end to find
-		// last difference. Everything in between we assume is different.
-		//
-		//
-		//
-		// startOfDifferences is the index into the core node list where the
-		// first difference
-		// occurs. But it may point into the old or the new list.
-		int startOfDifferences = _computeStartOfDifferences(oldNodes, newNodes);
-		int endOfDifferencesOld = -1;
-		int endOfDifferencesNew = -1;
-		// if one of the lists are shorter than where the differences start,
-		// then
-		// then some portion of the lists are identical
-		if ((startOfDifferences >= oldNodes.getLength()) || (startOfDifferences >= newNodes.getLength())) {
-			if (oldNodes.getLength() < newNodes.getLength()) {
-				// Then there are new regions to add
-				//     these lengths will cause the vector of old ones to not
-				//     have any elements, and the vector of new regions to have
-				//     just the new ones not in common with the old ones
-				//startOfDifferences should equal oldNodes.getLength(),
-				// calculated above on _computeStartOfDifferences
-				minimalOldNodes = EMPTY_LIST;
-				endOfDifferencesNew = newNodes.getLength() - 1;
-				minimalNewNodes = _formMinimumList(newNodes, startOfDifferences, endOfDifferencesNew);
-			} else {
-				if (oldNodes.getLength() > newNodes.getLength()) {
-					// delete old
-					// then there are old regions to delete
-					//    these lengths will cause the vector of old regions to
-					//    contain the ones to delete, and the vector of new
-					// regions
-					//    not have any elements
-					//startOfDifferences should equal newNodes.getLength(),
-					// calculated above on _computeStartOfDifferences
-					endOfDifferencesOld = oldNodes.getLength() - 1;
-					minimalOldNodes = _formMinimumList(oldNodes, startOfDifferences, endOfDifferencesOld);
-					minimalNewNodes = EMPTY_LIST;
-				} else
-					// unlikely event
-					event = new NoChangeEvent(fStructuredDocument, fRequester, fChanges, fStart, fLengthToReplace);
-			}
-		} else {
-			// We found a normal startOfDiffernces, but have not yet found the
-			// ends.
-			// We'll look for the end of differences by going backwards down
-			// the two lists.
-			// Here we need a seperate index for each array, since they may be
-			// (and
-			// probably are) of different lengths.
-			int indexOld = oldNodes.getLength() - 1;
-			int indexNew = newNodes.getLength() - 1;
-			// The greaterThanEffectedRegion is important to gaurd against
-			// incorrect counting
-			// when something identical is inserted to what's already there
-			// (see minimization test case 5)
-			// Note: the indexOld > startOfDifferences keeps indexOld from
-			// getting too small,
-			// so that the subsequent oldNodes.item(indexOld) is always valid.
-			while ((indexOld >= startOfDifferences) && (_greaterThanEffectedRegion(oldNodes.item(indexOld)))) {
-				if (!(oldNodes.item(indexOld).sameAs(newNodes.item(indexNew), fLengthDifference))) {
-					break;
-				} else {
-					// if they are equal, then we will be keeping the old one,
-					// so
-					// we need to be sure its parentDocument is set back to
-					// the
-					// right instance
-					oldNodes.item(indexOld).setParentDocument(fStructuredDocument);
-				}
-				indexOld--;
-				indexNew--;
-			}
-			endOfDifferencesOld = indexOld;
-			endOfDifferencesNew = indexNew;
-			minimalOldNodes = _formMinimumList(oldNodes, startOfDifferences, endOfDifferencesOld);
-			minimalNewNodes = _formMinimumList(newNodes, startOfDifferences, endOfDifferencesNew);
-		} /////////////////////////////////////////
-		//
-		IStructuredDocumentRegion firstDownStreamNode = null;
-		event = regionCheck(minimalOldNodes, minimalNewNodes);
-		if (event != null) {
-			firstDownStreamNode = minimalOldNodes.item(0).getNext();
-			if (firstDownStreamNode != null && fLengthDifference != 0) { // if
-				// firstDownStream
-				// is
-				// null,
-				// then
-				// we're
-				// at
-				// the
-				// end
-				// of
-				// the
-				// document
-				StructuredDocumentRegionIterator.adjustStart(firstDownStreamNode, fLengthDifference);
-			} //
-		} else {
-			event = nodesReplacedCheck(minimalOldNodes, minimalNewNodes);
-			// now splice the new chain of nodes to where the old chain is (or
-			// was)
-			// the firstDownStreamNode (the first of those after the new
-			// nodes)
-			// is
-			// remembered as a tiny optimization.
-			if (minimalOldNodes.getLength() == 0 && minimalNewNodes.getLength() > 0) {
-				// if no old nodes are being deleted, then use the
-				// the newNodes offset (minus one) to find the point to
-				// update downstream nodes, and after updating downstream
-				// nodes postions, insert the new ones.
-				int insertOffset = minimalNewNodes.item(0).getStartOffset();
-				IStructuredDocumentRegion lastOldUnchangedNode = null;
-				if (insertOffset > 0) {
-					lastOldUnchangedNode = fStructuredDocument.getRegionAtCharacterOffset(insertOffset - 1);
-					firstDownStreamNode = lastOldUnchangedNode.getNext();
-				} else {
-					// we're inserting at very beginning
-					firstDownStreamNode = fStructuredDocument.getFirstStructuredDocumentRegion();
-					// SIDE EFFECT: change the firstNode pointer if we're
-					// inserting at beginning
-					fStructuredDocument.setFirstDocumentRegion(minimalNewNodes.item(0));
-				}
-				StructuredDocumentRegionIterator.adjustStart(firstDownStreamNode, fLengthDifference);
-				insertNodes(lastOldUnchangedNode, firstDownStreamNode, minimalNewNodes);
-				// this (nodes replaced) is the only case where we need to
-				// update the cached Node
-				reSetCachedNode(minimalOldNodes, minimalNewNodes);
-			} else {
-				firstDownStreamNode = switchNodeLists(minimalOldNodes, minimalNewNodes);
-				// no need to adjust the length of the new nodes themselves,
-				// they
-				// are already correct, but we do need to
-				// adjust all "down stream" nodes with the length of the
-				// insertion or deletion
-				// --- adjustment moved to calling method.
-				if (firstDownStreamNode != null) {
-					// && event != null
-					StructuredDocumentRegionIterator.adjustStart(firstDownStreamNode, fLengthDifference);
-				} //
-				// this (nodes replaced) is the only case where we need to
-				// update the cached Node
-				reSetCachedNode(minimalOldNodes, minimalNewNodes);
-			}
-		}
-		return event;
-	}
-
-	// TODO: This should be abstract.
-	public IStructuredTextReParser newInstance() {
-		return new StructuredDocumentReParser();
-	}
-
-	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);
-		return result;
-	}
-
-	/**
-	 * A method to allow any heuristic "quick checks" that might cover many
-	 * many cases, before expending the time on a full reparse.
-	 *  
-	 */
-	public StructuredDocumentEvent quickCheck() {
-		StructuredDocumentEvent result = null;
-		// if the dirty start is null, then we have an empty document.
-		// in which case we'll return null so everything can be
-		// reparsed "from scratch" . If its not null, we'll give the flatnode
-		// a
-		// chance
-		// to handle, but only if there is one flatnode involved.
-		if (dirtyStart != null && dirtyStart == dirtyEnd) {
-			IStructuredDocumentRegion targetNode = dirtyStart;
-			result = dirtyStart.updateRegion(fRequester, targetNode, fChanges, fStart, fLengthToReplace);
-			if (result != null) {
-				// at this point only, we need to update the text store and
-				// and downstream nodes.
-				// FUTURE_TO_DO: can this dependency on structuredDocument
-				// method be eliminated?
-				fStructuredDocument.updateDocumentData(fStart, fLengthToReplace, fChanges);
-				IStructuredDocumentRegion firstDownStreamNode = targetNode.getNext();
-				// then flatnode must have been the last one, so need to
-				// update
-				// any downstream ones
-				if (firstDownStreamNode != null) {
-					StructuredDocumentRegionIterator.adjustStart(firstDownStreamNode, fLengthDifference);
-				}
-			}
-		}
-		if (result != null) {
-			result.setDeletedText(fDeletedText);
-		}
-		return result;
-	}
-
-	/**
-	 * If only one node is involved, sees how many regions are changed. If
-	 * only one, then its a 'regionChanged' event ... if more than one, its a
-	 * 'regionsReplaced' event.
-	 */
-	protected StructuredDocumentEvent regionCheck(CoreNodeList oldNodes, CoreNodeList newNodes) {
-		if (Debug.debugStructuredDocument)
-			System.out.println("IStructuredDocument::regionsReplacedCheck"); //$NON-NLS-1$
-		//$NON-NLS-1$
-		//$NON-NLS-1$
-		// the "regionsReplaced" event could only be true if and only if the
-		// nodelists
-		// are each only "1" in length.
-		StructuredDocumentEvent result = null;
-		int oldLength = oldNodes.getLength();
-		int newLength = newNodes.getLength();
-		if ((oldLength != 1) || (newLength != 1)) {
-			result = null;
-		} else {
-			IStructuredDocumentRegion oldNode = oldNodes.item(0);
-			IStructuredDocumentRegion newNode = newNodes.item(0);
-			result = regionCheck(oldNode, newNode);
-		}
-		return result;
-	}
-
-	/**
-	 * If only one node is involved, sees how many regions are changed. If
-	 * only one, then its a 'regionChanged' event ... if more than one, its a
-	 * 'regionsReplaced' event.
-	 */
-	protected StructuredDocumentEvent regionCheck(IStructuredDocumentRegion oldNode, IStructuredDocumentRegion newNode) {
-		//
-		StructuredDocumentEvent result = null;
-		ITextRegionList oldRegions = oldNode.getRegions();
-		ITextRegionList newRegions = newNode.getRegions();
-		ITextRegion[] oldRegionsArray = oldRegions.toArray();
-		ITextRegion[] newRegionsArray = newRegions.toArray();
-		//
-		// for the 'regionsReplaced' event, we don't care if
-		// the regions changed due to type, or text,
-		// we'll just collect all those that are not equal
-		// into the old and new region lists.
-		// Note: we, of course, assume that old and new regions
-		// are basically contiguous -- and we force it to be so,
-		// even if not literally so, by starting at beginning to
-		// find first difference, and then starting at end to find
-		// last difference. Everything in between we assume is different.
-		//
-		// going up is easy, we start at zero in each, and continue
-		// till regions are not the same.
-		int startOfDifferences = _computeStartOfDifferences(oldNode, oldRegions, newNode, newRegions);
-		int endOfDifferencesOld = -1;
-		int endOfDifferencesNew = -1;
-		//
-		//
-		// if one of the lists are shorter than where the differences start,
-		// then
-		// then some portion of the lists are identical
-		if ((startOfDifferences >= oldRegions.size()) || (startOfDifferences >= newRegions.size())) {
-			if (oldRegions.size() < newRegions.size()) {
-				// INSERT CASE
-				// then there are new regions to add
-				//     these lengths will cause the vector of old ones to not
-				//     have any elements, and the vector of new regions to have
-				//     just the new ones.
-				startOfDifferences = oldRegionsArray.length;
-				endOfDifferencesOld = oldRegionsArray.length - 1;
-				endOfDifferencesNew = newRegionsArray.length - 1;
-			} else {
-				if (oldRegions.size() > newRegions.size()) {
-					// DELETE CASE
-					// then there are old regions to delete
-					//    these lengths will cause the vector of old regions to
-					//    contain the ones to delete, and the vector of new
-					// regions
-					//    not have any elements
-					startOfDifferences = newRegionsArray.length;
-					endOfDifferencesOld = oldRegionsArray.length - 1;
-					endOfDifferencesNew = newRegionsArray.length - 1;
-				} else {
-					// else the lists are identical!
-					// unlikely event, probably error in current design, since
-					// we check for identity at the very beginning of
-					// reparsing.
-					result = new NoChangeEvent(fStructuredDocument, fRequester, fChanges, fStart, fLengthToReplace);
-				}
-			}
-		} else {
-			if ((startOfDifferences > -1) && (endOfDifferencesOld < 0) && (endOfDifferencesNew < 0)) {
-				// We found a normal startOfDiffernces, but have not yet found
-				// the ends.
-				// We'll look for the end of differences by going backwards
-				// down the two lists.
-				// Here we need a seperate index for each array, since they
-				// may
-				// be (and
-				// probably are) of different lengths.
-				int indexOld = oldRegionsArray.length - 1;
-				int indexNew = newRegionsArray.length - 1;
-				while ((indexOld >= startOfDifferences) && (_greaterThanEffectedRegion(oldNode, oldRegionsArray[indexOld]))) {
-					if ((!(oldNode.sameAs(oldRegionsArray[indexOld], newNode, newRegionsArray[indexNew], fLengthDifference)))) {
-						//endOfDifferencesOld = indexOne;
-						//endOfDifferencesNew = indexTwo;
-						break;
-					}
-					indexOld--;
-					indexNew--;
-				}
-				endOfDifferencesOld = indexOld;
-				endOfDifferencesNew = indexNew;
-			}
-		}
-		//
-		// result != null means the impossible case above occurred
-		if (result == null) {
-			// Now form the two vectors of different regions
-			ITextRegionList holdOldRegions = new TextRegionListImpl();
-			ITextRegionList holdNewRegions = new TextRegionListImpl();
-			if (startOfDifferences > -1 && endOfDifferencesOld > -1) {
-				for (int i = startOfDifferences; i <= endOfDifferencesOld; i++) {
-					holdOldRegions.add(oldRegionsArray[i]);
-				}
-			}
-			if (startOfDifferences > -1 && endOfDifferencesNew > -1) {
-				for (int i = startOfDifferences; i <= endOfDifferencesNew; i++) {
-					holdNewRegions.add(newRegionsArray[i]);
-				}
-			}
-			if (holdOldRegions.size() == 0 && holdNewRegions.size() == 0) {
-				// then this means the regions were identical, which means
-				// someone
-				// pasted exactly the same thing they had selected, or !!!
-				// someone deleted the end bracket of the tag. !!!?
-				result = new NoChangeEvent(fStructuredDocument, fRequester, fChanges, fStart, fLengthToReplace);
-			} else {
-				//If both holdOldRegions and holdNewRegions are of length 1,
-				// then its
-				// a "region changed" event, else a "regions replaced" event.
-				// so we want the new instance of region to become part of the
-				// old instance of old node
-				if ((holdOldRegions.size() == 1) && (holdNewRegions.size() == 1) && _regionsSameKind((holdNewRegions.get(0)), (holdOldRegions.get(0)))) {
-					ITextRegion newOldRegion = swapNewForOldRegion(oldNode, holdOldRegions.get(0), newNode, holdNewRegions.get(0));
-					// -- need to update any down stream regions, within this
-					// 'oldNode'
-					updateDownStreamRegions(oldNode, newOldRegion);
-					result = new RegionChangedEvent(fStructuredDocument, fRequester, oldNode, newOldRegion, fChanges, fStart, fLengthToReplace);
-				} else {
-					replaceRegions(oldNode, holdOldRegions, newNode, holdNewRegions);
-					// -- need to update any down stream regions, within this
-					// 'oldNode'
-					// don't need with the way replaceRegions is implemented.
-					// It handles.
-					//if(holdNewRegions.size() > 0)
-					//updateDownStreamRegions(oldNode, (ITextRegion)
-					// holdNewRegions.lastElement());
-					result = new RegionsReplacedEvent(fStructuredDocument, fRequester, oldNode, holdOldRegions, holdNewRegions, fChanges, fStart, fLengthToReplace);
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * An entry point for reparsing. It calculates the dirty start and dirty
-	 * end flatnodes based on the start point and length of the changes.
-	 *  
-	 */
-	public StructuredDocumentEvent reparse() {
-		StructuredDocumentEvent result = null;
-		// if we do not have a cachedNode, then the document
-		// must be empty, so simply use 'null' as the dirtyStart and dirtyEnd
-		// otherwise, find them.
-		if (fStructuredDocument.getCachedDocumentRegion() != null) {
-			findDirtyStart(fStart);
-			int end = fStart + fLengthToReplace;
-			findDirtyEnd(end);
-		}
-		if (fStructuredDocument.getCachedDocumentRegion() != null) {
-			result = checkHeuristics();
-		}
-		if (result == null) {
-			result = reparse(dirtyStart, dirtyEnd);
-		}
-		endReParse();
-		return result;
-	}
-
-	/**
-	 * An entry point for reparsing. It calculates the dirty start and dirty
-	 * end flatnodes based on suggested positions to begin and end. This is
-	 * needed for cases where parsing must go beyond the immediate node and
-	 * its direct neighbors.
-	 *  
-	 */
-	protected StructuredDocumentEvent reparse(int reScanStartHint, int reScanEndHint) {
-		StructuredDocumentEvent result = null;
-		// if we do not have a cachedNode, then the document
-		// must be empty, so simply use 'null' as the dirtyStart and dirtyEnd
-		if (fStructuredDocument.getCachedDocumentRegion() != null) {
-			findDirtyStart(reScanStartHint);
-			findDirtyEnd(reScanEndHint);
-		}
-		result = reparse(dirtyStart, dirtyEnd);
-		isParsing = false;
-		// debug
-		//verifyStructured(result);
-		return result;
-	}
-
-	/**
-	 * The core reparsing method ... after the dirty start and dirty end have
-	 * been calculated elsewhere.
-	 */
-	protected StructuredDocumentEvent reparse(IStructuredDocumentRegion dirtyStart, IStructuredDocumentRegion dirtyEnd) {
-		StructuredDocumentEvent result = null;
-		int rescanStart = -1;
-		int rescanEnd = -1;
-		boolean firstTime = false;
-		//
-		// "save" the oldNodes (that may be replaced) in a list
-		CoreNodeList oldNodes = formOldNodes(dirtyStart, dirtyEnd);
-		if (dirtyStart == null || dirtyEnd == null) {
-			// dirtyStart or dirty end are null, then that means we didn't
-			// have
-			// a
-			// cached node, which means we have an empty document, so we
-			// just need to rescan the changes
-			rescanStart = 0;
-			rescanEnd = fChanges.length();
-			firstTime = true;
-		} else {
-			// set the start of the text to rescan
-			rescanStart = dirtyStart.getStart();
-			//
-			// set the end of the text to rescan
-			// notice we use the same rationale as for the rescanStart,
-			// with the added caveat that length has to be added to it,
-			// to compensate for the new text which has been added or deleted.
-			// If changes has zero length, then "length" will be negative,
-			// since
-			// we are deleting text. Otherwise, use the difference between
-			// what's selected to be replaced and the length of the new text.
-			rescanEnd = dirtyEnd.getEnd() + fLengthDifference;
-		}
-		// now that we have the old stuff "saved" away, update the document
-		// with the changes.
-		// FUTURE_TO_DO -- don't fire "document changed" event till later
-		fStructuredDocument.updateDocumentData(fStart, fLengthToReplace, fChanges);
-		// ------------------ now the real work
-		result = core_reparse(rescanStart, rescanEnd, oldNodes, firstTime);
-		//
-		// event is returned to the caller, incase there is
-		// some opitmization they can do
-		return result;
-	}
-
-	protected void replaceRegions(IStructuredDocumentRegion oldNode, ITextRegionList oldRegions, IStructuredDocumentRegion newNode, ITextRegionList newRegions) {
-		int insertPos = -1;
-		ITextRegionList regions = oldNode.getRegions();
-		// make a fake flatnode to be new parent of oldRegions, so their text
-		// will be right.
-		//IStructuredDocumentRegion holdOldStructuredDocumentRegion = new
-		// BasicStructuredDocumentRegion(oldNode);
-		//
-		// need to reset the parent of the new to-be-inserted regions to be
-		// the
-		// same oldNode that is the one having its regions changed
-		// DW, 4/16/2003, removed since ITextRegion no longer has parent.
-		// 		ITextRegionContainer oldParent = oldNode;
-		//		for (int i = 0; i < newRegions.size(); i++) {
-		//			AbstractRegion region = (AbstractRegion) newRegions.elementAt(i);
-		//			region.setParent(oldParent);
-		//		}
-		// if there are no old regions, insert the new regions according to
-		// offset
-		if (oldRegions.size() == 0) {
-			ITextRegion firstNewRegion = newRegions.get(0);
-			int firstOffset = newNode.getStartOffset(firstNewRegion);
-			// if at beginning, insert there
-			if (firstOffset == 0) {
-				insertPos = 0;
-			} else {
-				//
-				ITextRegion regionAtOffset = oldNode.getRegionAtCharacterOffset(firstOffset);
-				if (regionAtOffset == null)
-					insertPos = regions.size();
-				else
-					insertPos = regions.indexOf(regionAtOffset);
-			}
-		} else {
-			// else, delete old ones before inserting new ones in their place
-			ITextRegion firstOldRegion = oldRegions.get(0);
-			insertPos = regions.indexOf(firstOldRegion);
-			regions.removeAll(oldRegions);
-		}
-		regions.addAll(insertPos, newRegions);
-		// now regions vector of each node should be of equal length,
-		// so go through each, and make sure the old regions
-		// offsets matches the new regions offsets
-		// (we'll just assign them all, but could be slightly more effiecient)
-		ITextRegionList allNewRegions = newNode.getRegions();
-		for (int i = 0; i < regions.size(); i++) {
-			ITextRegion nextOldishRegion = regions.get(i);
-			ITextRegion nextNewRegion = allNewRegions.get(i);
-			nextOldishRegion.equatePositions(nextNewRegion);
-			checkAndAssignParent(oldNode, nextOldishRegion);
-		}
-		oldNode.setLength(newNode.getLength());
-		oldNode.setEnded(newNode.isEnded());
-		oldNode.setParentDocument(newNode.getParentDocument());
-		// removed concept of part of these regions, so no longer need to do.
-		//		for (int i = 0; i < oldRegions.size(); i++) {
-		//			ITextRegion region = (ITextRegion) oldRegions.elementAt(i);
-		//			region.setParent(holdOldStructuredDocumentRegion);
-		//		}
-	}
-
-	private void reSetCachedNode(CoreNodeList oldNodes, CoreNodeList newNodes) {
-		// use the last newNode as the new cachedNode postion, unless its null
-		// (e.g. when nodes are deleted) in which case, assign
-		// it to a "safe" node so we don't lose reference to the
-		// structuredDocument!
-		if (newNodes.getLength() > 0) {
-			// use last new node as the cache
-			fStructuredDocument.setCachedDocumentRegion(newNodes.item(newNodes.getLength() - 1));
-		} else {
-			// if cachedNode is an old node, then we're in trouble:
-			// we can't leave it as the cached node! and its already
-			// been disconnected from the model, so we can't do getNext
-			// or getPrevious, so we'll get one that is right before
-			// (or right after) the offset of the old nodes that are being
-			// deleted.
-			// 
-			// if newNodesHead and cachedNode are both null, then
-			// it means we were asked to insert an empty string into
-			// an empty document. So we have nothing to do here
-			// (that is, we have no node to cache)
-			// similarly if there are no new nodes and no old nodes then
-			// nothing to do (but that should never happen ... we shouldn't
-			// get there if there is no event to generate).
-			if ((fStructuredDocument.getCachedDocumentRegion() != null) && (oldNodes.getLength() > 0)) {
-				// note: we can't simple use nodeAtCharacterOffset, since it
-				// depends on cachedNode.
-				if (oldNodes.includes(fStructuredDocument.getCachedDocumentRegion()))
-					fStructuredDocument.setCachedDocumentRegion(fStructuredDocument.getFirstStructuredDocumentRegion());
-			}
-			if ((fStructuredDocument.getCachedDocumentRegion() == null) && (Debug.displayWarnings)) {
-				// this will happen now legitamately when all text is deleted
-				// from a document
-				System.out.println("Warning: StructuredDocumentReParser::reSetCachedNode: could not find a node to cache! (its ok if all text deleted)"); //$NON-NLS-1$
-			}
-		}
-	}
-
-	public void setStructuredDocument(IStructuredDocument newStructuredDocument) {
-		// NOTE: this method (and class) depend on being able to
-		// do the following cast (i.e. references some fields directly)
-		fStructuredDocument = (BasicStructuredDocument) newStructuredDocument;
-		fFindReplaceDocumentAdapter = null;
-	}
-
-	private IStructuredDocumentRegion splice(CoreNodeList oldNodes, CoreNodeList newNodes) {
-		//
-		IStructuredDocumentRegion firstOld = null;
-		IStructuredDocumentRegion firstNew = null;
-		IStructuredDocumentRegion lastOld = null;
-		IStructuredDocumentRegion lastNew = null;
-		//
-		IStructuredDocumentRegion oldPrevious = null;
-		IStructuredDocumentRegion oldNext = null;
-		IStructuredDocumentRegion newPrevious = null;
-		IStructuredDocumentRegion newNext = null;
-		//
-		// if called with both arguments empty lists, we can disregard.
-		// this happens, for example, when some text is replaced with the
-		// identical text.
-		if ((oldNodes.getLength() == 0) && (newNodes.getLength() == 0)) {
-			return null;
-		}
-		// get pointers
-		if (newNodes.getLength() > 0) {
-			firstNew = newNodes.item(0);
-			lastNew = newNodes.item(newNodes.getLength() - 1);
-		}
-		//
-		if (oldNodes.getLength() > 0) {
-			firstOld = oldNodes.item(0);
-			lastOld = oldNodes.item(oldNodes.getLength() - 1);
-			if (firstOld != null)
-				oldPrevious = firstOld.getPrevious();
-			if (lastOld != null)
-				oldNext = lastOld.getNext();
-		}
-		// handle switch
-		if (newNodes.getLength() > 0) {
-			// switch surrounding StructuredDocumentRegions' references to
-			// lists
-			if (oldPrevious != null)
-				oldPrevious.setNext(firstNew);
-			if (newPrevious != null)
-				newPrevious.setNext(firstOld);
-			if (oldNext != null)
-				oldNext.setPrevious(lastNew);
-			if (newNext != null)
-				newNext.setPrevious(lastOld);
-			// switch list pointers to surrounding StructuredDocumentRegions
-			if (firstOld != null)
-				firstOld.setPrevious(newPrevious);
-			if (lastOld != null)
-				lastOld.setNext(newNext);
-			if (firstNew != null)
-				firstNew.setPrevious(oldPrevious);
-			if (lastNew != null)
-				lastNew.setNext(oldNext);
-		} else {
-			// short circuit when there are no new nodes
-			if (oldPrevious != null)
-				oldPrevious.setNext(oldNext);
-			if (oldNext != null)
-				oldNext.setPrevious(oldPrevious);
-		}
-		//
-		// SIDE EFFECTs
-		// if we have oldNodes, and if oldNext or oldPrevious is null,
-		// that means we are replacing
-		// the lastNode or firstNode the structuredDocuments's chain of nodes,
-		// so we need to update the structuredDocuments last or first Node
-		// as the last or first of the new nodes.
-		// (and sometimes even these will be null! such as when deleting all
-		// text in a document).
-		if ((oldNext == null) && (oldNodes.getLength() > 0)) {
-			if (newNodes.getLength() > 0) {
-				fStructuredDocument.setLastDocumentRegion(lastNew);
-			} else {
-				// in this case, the last node is being deleted, but not
-				// replaced
-				// with anything. In this case, we can just back up one
-				// from the first old node
-				fStructuredDocument.setLastDocumentRegion(firstOld.getPrevious());
-			}
-		}
-		if ((oldPrevious == null) && (oldNodes.getLength() > 0)) {
-			if (newNodes.getLength() > 0) {
-				fStructuredDocument.setFirstDocumentRegion(firstNew);
-			} else {
-				// in this case the first node is being deleted, but not
-				// replaced
-				// with anything. So, we just go one forward past the last old
-				// node.
-				fStructuredDocument.setFirstDocumentRegion(lastOld.getNext());
-			}
-		}
-		// as a tiny optimization, we return the first of the downstream
-		// nodes,
-		// if any
-		return oldNext;
-	}
-
-	/**
-	 * The purpose of this method is to "reuse" the old container region, when
-	 * found to be same (so same instance doesn't change). The goal is to
-	 * "transform" the old region, so its equivelent to the newly parsed one.
-	 *  
-	 */
-	private ITextRegion swapNewForOldRegion(IStructuredDocumentRegion oldNode, ITextRegion oldRegion, IStructuredDocumentRegion newNode, ITextRegion newRegion) {
-		// makes the old region instance the correct size.
-		oldRegion.equatePositions(newRegion);
-		// adjusts old node instance appropriately
-		oldNode.setLength(newNode.getLength());
-		oldNode.setEnded(newNode.isEnded());
-		// we do have to set the parent document, since the oldNode's
-		// were set to a temporary one, then newNode's have the
-		// right one.
-		oldNode.setParentDocument(newNode.getParentDocument());
-		// if we're transforming a container region, we need to be sure to
-		// transfer the new embedded regions, to the old parent
-		// Note: if oldRegion hasEmbeddedRegions, then we know the
-		// newRegion does too, since we got here because they were the
-		// same type.
-		if (isCollectionRegion(oldRegion)) { // ||
-			// hasContainerRegions(oldRegion))
-			// {
-			transferEmbeddedRegions(oldNode, (ITextRegionContainer) oldRegion, (ITextRegionContainer) newRegion);
-		}
-		return oldRegion;
-	}
-
-	private IStructuredDocumentRegion switchNodeLists(CoreNodeList oldNodes, CoreNodeList newNodes) {
-		IStructuredDocumentRegion result = splice(oldNodes, newNodes);
-		// ensure that the old nodes hold no references to the existing model
-		if (oldNodes.getLength() > 0) {
-			IStructuredDocumentRegion firstItem = oldNodes.item(0);
-			firstItem.setPrevious(null);
-			IStructuredDocumentRegion lastItem = oldNodes.item(oldNodes.getLength() - 1);
-			lastItem.setNext(null);
-		}
-		return result;
-	}
-
-	/**
-	 * The purpose of this method is to "reuse" the old container region, when
-	 * found to be same (so same instance doesn't change). The goal is to
-	 * "transform" the old region, so its equivelent to the newly parsed one.
-	 *  
-	 */
-	private void transferEmbeddedRegions(IStructuredDocumentRegion oldNode, ITextRegionContainer oldRegion, ITextRegionContainer newRegion) {
-		// the oldRegion should already have the right parent, since
-		// we got here because all's equivelent except the region
-		// postions have changed.
-		//oldRegion.setParent(newRegion.getParent());
-		// but we should check if there's "nested" embedded regions, and if
-		// so, we can just move them over. setting their parent as this old
-		// region.
-		ITextRegionList newRegionsToTransfer = newRegion.getRegions();
-		oldRegion.setRegions(newRegionsToTransfer);
-		Iterator newRegionsInOldOne = newRegionsToTransfer.iterator();
-		while (newRegionsInOldOne.hasNext()) {
-			ITextRegion newOne = (ITextRegion) newRegionsInOldOne.next();
-			if (isCollectionRegion(newOne)) { // ||
-				// hasContainerRegions(newOne)) {
-				//((ITextRegionContainer) newOne).setParent(oldRegion);
-				oldRegion.setRegions(newRegion.getRegions());
-			}
-		}
-	}
-
-	private void updateDownStreamRegions(IStructuredDocumentRegion flatNode, ITextRegion lastKnownRegion) {
-		// so all regions after the last known region (last known to be ok)
-		// have to have their start and end values adjusted.
-		ITextRegionList regions = flatNode.getRegions();
-		int listLength = regions.size();
-		int startIndex = 0;
-		// first, loop through to find where to start
-		for (int i = 0; i < listLength; i++) {
-			ITextRegion region = regions.get(i);
-			if (region == lastKnownRegion) {
-				startIndex = i;
-				break;
-			}
-		}
-		// now, beginning one past the last known one, loop
-		// through to end of list, adjusting the start and end postions.
-		startIndex++;
-		for (int j = startIndex; j < listLength; j++) {
-			ITextRegion region = regions.get(j);
-			region.adjustStart(fLengthDifference);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionEnumeration.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionEnumeration.java
deleted file mode 100644
index 34f20b8..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionEnumeration.java
+++ /dev/null
@@ -1,87 +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.sse.core.internal.text;
-
-
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-
-
-public class StructuredDocumentRegionEnumeration implements Enumeration {
-
-	private int count;
-	private IStructuredDocumentRegion head;
-	private IStructuredDocumentRegion oldHead;
-
-	/**
-	 * StructuredDocumentRegionEnumeration constructor comment.
-	 */
-	public StructuredDocumentRegionEnumeration(IStructuredDocumentRegion newHead) {
-		super();
-		IStructuredDocumentRegion countNode = head = newHead;
-		while (countNode != null) {
-			count++;
-			countNode = countNode.getNext();
-		}
-		if (Debug.DEBUG > 5) {
-			System.out.println("N Nodes in StructuredDocumentRegionEnumeration Contructor: " + count); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * StructuredDocumentRegionEnumeration constructor comment.
-	 */
-	public StructuredDocumentRegionEnumeration(IStructuredDocumentRegion start, IStructuredDocumentRegion end) {
-		super();
-		IStructuredDocumentRegion countNode = head = start;
-		if ((start == null) || (end == null)) {
-			// error condition
-			count = 0;
-			return;
-		}
-		//If both nodes are non-null, we assume there is always at least one
-		// item
-		count = 1;
-		while (countNode != end) {
-			count++;
-			countNode = countNode.getNext();
-		}
-		if (org.eclipse.wst.sse.core.internal.util.Debug.DEBUG > 5) {
-			System.out.println("N Nodes in StructuredDocumentRegionEnumeration Contructor: " + count); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * hasMoreElements method comment.
-	 */
-	public synchronized boolean hasMoreElements() {
-		return count > 0;
-	}
-
-	/**
-	 * nextElement method comment.
-	 */
-	public synchronized Object nextElement() {
-		if (count > 0) {
-			count--;
-			oldHead = head;
-			head = head.getNext();
-			return oldHead;
-		}
-		throw new NoSuchElementException("StructuredDocumentRegionEnumeration"); //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionIterator.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionIterator.java
deleted file mode 100644
index 5b222cb..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionIterator.java
+++ /dev/null
@@ -1,115 +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.sse.core.internal.text;
-
-
-
-import java.util.Vector;
-
-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.util.Assert;
-
-
-public class StructuredDocumentRegionIterator {
-
-	public final static IStructuredDocumentRegion adjustStart(IStructuredDocumentRegion headNode, int adjustment) {
-		IStructuredDocumentRegion aNode = headNode;
-		while (aNode != null) {
-			aNode.adjustStart(adjustment);
-			aNode = aNode.getNext();
-		}
-		return headNode;
-	}
-
-	public final static int countRegions(IStructuredDocumentRegionList flatNodes) {
-		int result = 0;
-		if (flatNodes != null) {
-			int length = flatNodes.getLength();
-			for (int i = 0; i < length; i++) {
-				IStructuredDocumentRegion node = flatNodes.item(i);
-				// don't know why, but we're getting null pointer exceptions
-				// in this method
-				if (node != null) {
-					result = result + node.getNumberOfRegions();
-				}
-			}
-		}
-		return result;
-	}
-
-	public final static String getText(CoreNodeList flatNodes) {
-		String result = null;
-		if (flatNodes == null) {
-			result = ""; //$NON-NLS-1$
-		} else {
-			StringBuffer buff = new StringBuffer();
-			//IStructuredDocumentRegion aNode = null;
-			int length = flatNodes.getLength();
-			for (int i = 0; i < length; i++) {
-				buff.append(flatNodes.item(i).getText());
-			}
-			result = buff.toString();
-		}
-		return result;
-	}
-
-	public final static CoreNodeList setParentDocument(CoreNodeList nodelist, IStructuredDocument textStore) {
-		Assert.isNotNull(nodelist, "nodelist was null in CoreNodeList::setTextStore(CoreNodeList, StructuredTextStore)"); //$NON-NLS-1$
-		int len = nodelist.getLength();
-		for (int i = 0; i < len; i++) {
-			IStructuredDocumentRegion node = nodelist.item(i);
-			//Assert.isNotNull(node, "who's putting null in the node list? in
-			// CoreNodeList::setTextStore(CoreNodeList,
-			// StructuredTextStore)"); //$NON-NLS-1$
-			node.setParentDocument(textStore);
-		}
-		return nodelist;
-	}
-
-	//	public final static IStructuredDocumentRegion
-	// setStructuredDocument(IStructuredDocumentRegion headNode,
-	// BasicStructuredDocument structuredDocument) {
-	//		IStructuredDocumentRegion aNode = headNode;
-	//		while (aNode != null) {
-	//			aNode.setParentDocument(structuredDocument);
-	//			aNode = (IStructuredDocumentRegion) aNode.getNext();
-	//		}
-	//		return headNode;
-	//	}
-	public final static IStructuredDocumentRegion setParentDocument(IStructuredDocumentRegion headNode, IStructuredDocument document) {
-		IStructuredDocumentRegion aNode = headNode;
-		while (aNode != null) {
-			aNode.setParentDocument(document);
-			aNode = aNode.getNext();
-		}
-		return headNode;
-	}
-
-	public final static Vector toVector(IStructuredDocumentRegion headNode) {
-		IStructuredDocumentRegion aNode = headNode;
-		Vector v = new Vector();
-		while (aNode != null) {
-			v.addElement(aNode);
-			aNode = aNode.getNext();
-		}
-		return v;
-	}
-
-	/**
-	 *  
-	 */
-	private StructuredDocumentRegionIterator() {
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentSequentialRewriteTextStore.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentSequentialRewriteTextStore.java
deleted file mode 100644
index 5c31aa8..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentSequentialRewriteTextStore.java
+++ /dev/null
@@ -1,132 +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.sse.core.internal.text;
-
-import org.eclipse.jface.text.ITextStore;
-import org.eclipse.jface.text.SequentialRewriteTextStore;
-
-public class StructuredDocumentSequentialRewriteTextStore extends SequentialRewriteTextStore implements CharSequence, IRegionComparible {
-
-	/**
-	 * @param source
-	 */
-	public StructuredDocumentSequentialRewriteTextStore(ITextStore source) {
-		super(source);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.CharSequence#charAt(int)
-	 */
-	public char charAt(int index) {
-		return get(index);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.CharSequence#length()
-	 */
-	public int length() {
-		return getLength();
-	}
-
-	/**
-	 * @param c
-	 * @param d
-	 * @return
-	 */
-	private boolean matchesIgnoreCase(char c1, char c2) {
-		// we check both case conversions to handle those few cases,
-		// in languages such as Turkish, which have some characters
-		// which sort of have 3 cases.
-		boolean result = false;
-		if (Character.toUpperCase(c1) == Character.toUpperCase(c2))
-			result = true;
-		else if (Character.toLowerCase(c1) == Character.toLowerCase(c2))
-			result = true;
-		return result;
-	}
-
-	public boolean regionMatches(int offset, int length, String stringToCompare) {
-		boolean result = false;
-		int compareLength = stringToCompare.length();
-		if (compareLength == length) {
-			int endOffset = offset + length;
-			if (endOffset <= length()) {
-				result = regionMatches(offset, stringToCompare);
-			}
-		}
-
-		return result;
-	}
-
-	/**
-	 * This method assumes all lengths have been checked and fall withint
-	 * exceptable limits
-	 * 
-	 * @param offset
-	 * @param stringToCompare
-	 * @return
-	 */
-	private boolean regionMatches(int offset, String stringToCompare) {
-		boolean result = true;
-		int stringOffset = 0;
-		int len = stringToCompare.length();
-		for (int i = offset; i < len; i++) {
-			if (charAt(i) != stringToCompare.charAt(stringOffset++)) {
-				result = false;
-				break;
-			}
-		}
-		return result;
-	}
-
-	public boolean regionMatchesIgnoreCase(int offset, int length, String stringToCompare) {
-		boolean result = false;
-		int compareLength = stringToCompare.length();
-		if (compareLength == length) {
-			int endOffset = offset + length;
-			if (endOffset <= length()) {
-				result = regionMatchesIgnoreCase(offset, stringToCompare);
-			}
-		}
-
-		return result;
-	}
-
-	private boolean regionMatchesIgnoreCase(int offset, String stringToCompare) {
-		boolean result = true;
-		int stringOffset = 0;
-		int len = stringToCompare.length();
-		for (int i = offset; i < len; i++) {
-			if (!matchesIgnoreCase(charAt(i), stringToCompare.charAt(stringOffset++))) {
-				result = false;
-				break;
-			}
-		}
-		return result;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.CharSequence#subSequence(int, int)
-	 */
-	public CharSequence subSequence(int start, int end) {
-
-		return get(start, end - start);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentTextStore.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentTextStore.java
deleted file mode 100644
index 8a46e66..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentTextStore.java
+++ /dev/null
@@ -1,191 +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
- *     Viacheslav Kabanovich/Exadel 97817 Wrong algoritm in class StructuredDocumentTextStore
- *     			https://bugs.eclipse.org/bugs/show_bug.cgi?id=97817
- *     
- *******************************************************************************/
-package org.eclipse.wst.sse.core.internal.text;
-
-import org.eclipse.jface.text.GapTextStore;
-import org.eclipse.jface.text.ITextStore;
-
-public class StructuredDocumentTextStore implements ITextStore, CharSequence, IRegionComparible {
-
-	private GapTextStore fInternalStore;
-
-	/**
-	 *  
-	 */
-	public StructuredDocumentTextStore() {
-		this(50, 300);
-	}
-
-	/**
-	 * @param lowWatermark
-	 * @param highWatermark
-	 */
-	public StructuredDocumentTextStore(int lowWatermark, int highWatermark) {
-		super();
-		fInternalStore = new GapTextStore(lowWatermark, highWatermark);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.CharSequence#charAt(int)
-	 */
-	public char charAt(int index) {
-		return fInternalStore.get(index);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextStore#get(int)
-	 */
-	public char get(int offset) {
-
-		return fInternalStore.get(offset);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextStore#get(int, int)
-	 */
-	public String get(int offset, int length) {
-
-		return fInternalStore.get(offset, length);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextStore#getLength()
-	 */
-	public int getLength() {
-
-		return fInternalStore.getLength();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.CharSequence#length()
-	 */
-	public int length() {
-
-		return fInternalStore.getLength();
-	}
-
-	private boolean matchesIgnoreCase(char c1, char c2) {
-		// we check both case conversions to handle those few cases,
-		// in languages such as Turkish, which have some characters
-		// which sort of have 3 cases.
-		boolean result = false;
-		if (Character.toUpperCase(c1) == Character.toUpperCase(c2))
-			result = true;
-		else if (Character.toLowerCase(c1) == Character.toLowerCase(c2))
-			result = true;
-		return result;
-	}
-
-	public boolean regionMatches(int offset, int length, String stringToCompare) {
-		boolean result = false;
-		int compareLength = stringToCompare.length();
-		if (compareLength == length) {
-			int endOffset = offset + length;
-			if (endOffset <= length()) {
-				result = regionMatches(offset, stringToCompare);
-			}
-		}
-
-		return result;
-	}
-
-	/**
-	 * This method assumes all lengths have been checked and fall withint
-	 * exceptable limits
-	 * 
-	 * @param offset
-	 * @param stringToCompare
-	 * @return
-	 */
-	private boolean regionMatches(int offset, String stringToCompare) {
-		boolean result = true;
-		int stringOffset = 0;
-		int len = offset + stringToCompare.length();
-		for (int i = offset; i < len; i++) {
-			if (charAt(i) != stringToCompare.charAt(stringOffset++)) {
-				result = false;
-				break;
-			}
-		}
-		return result;
-	}
-
-	public boolean regionMatchesIgnoreCase(int offset, int length, String stringToCompare) {
-		boolean result = false;
-		int compareLength = stringToCompare.length();
-		if (compareLength == length) {
-			int endOffset = offset + length;
-			if (endOffset <= length()) {
-				result = regionMatchesIgnoreCase(offset, stringToCompare);
-			}
-		}
-
-		return result;
-	}
-
-	private boolean regionMatchesIgnoreCase(int offset, String stringToCompare) {
-		boolean result = true;
-		int stringOffset = 0;
-		int len = stringToCompare.length();
-		for (int i = offset; i < len; i++) {
-			if (!matchesIgnoreCase(charAt(i), stringToCompare.charAt(stringOffset++))) {
-				result = false;
-				break;
-			}
-		}
-		return result;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextStore#replace(int, int,
-	 *      java.lang.String)
-	 */
-	public void replace(int offset, int length, String text) {
-		fInternalStore.replace(offset, length, text);
-
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextStore#set(java.lang.String)
-	 */
-	public void set(String text) {
-		fInternalStore.set(text);
-
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.CharSequence#subSequence(int, int)
-	 */
-	public CharSequence subSequence(int start, int end) {
-		// convert 'end' to 'length'
-		return fInternalStore.get(start, end - start);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/SubSetTextStore.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/SubSetTextStore.java
deleted file mode 100644
index caca8b9..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/SubSetTextStore.java
+++ /dev/null
@@ -1,127 +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.sse.core.internal.text;
-
-/**
- * This is a convience or utility class that allows you to make a copy of a
- * part of a larger text store, but have the copy behave as if it was the
- * larger text store.
- * 
- * In other words, it provides a subset of a larger document, that "looks like"
- * the orginal document. That is, "looks like" in terms of offsets and lengths.
- * Valid access can only be made to data between the orignal offsets, even
- * though those offsets are in the same units at the original, and even though
- * the length appears to be long.
- * 
- * For example, if a subsettext store is created for the def part of abcdefgh,
- * then get(3,5) is valid, getLength is 8. Any other access, such as
- * getChar(2), would be invalid.
- */
-import org.eclipse.jface.text.ITextStore;
-
-/**
- * Similar to basics of IDocument, but the offsets are mapped from coordinates
- * of underlying storage to a "virtual" document.
- */
-public class SubSetTextStore implements ITextStore {
-	private int pseudoBeginOffset; // maps to "zero" postion of new text
-	//private int pseudoEndOffset;
-	private int pseudoLength; // length of old/original document
-	private StringBuffer stringBuffer = new StringBuffer();
-
-	/**
-	 * SubSetTextStore constructor comment.
-	 * 
-	 * @param initialContent
-	 *            java.lang.String
-	 */
-	public SubSetTextStore(String initialContent, int beginOffset, int endOffset, int originalDocumentLength) {
-		super();
-		pseudoBeginOffset = beginOffset;
-		//pseudoEndOffset = endOffset;
-		// used to be originalDocument.getLength ... not sure if used, or
-		// which
-		// is right
-		pseudoLength = originalDocumentLength;
-		stringBuffer = new StringBuffer(initialContent);
-		//set(initialContent);
-	}
-
-	// this is our "private" get, which methods in this class should
-	// use to get using "real" coordinates of underlying representation.
-	private String _get(int begin, int length) {
-		char[] chars = new char[length];
-		int srcEnd = begin + length;
-		stringBuffer.getChars(begin, srcEnd, chars, 0);
-		return new String(chars);
-	}
-
-	public char get(int offset) {
-		return stringBuffer.charAt(offset - pseudoBeginOffset);
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param begin
-	 *            int
-	 * @param end
-	 *            int
-	 */
-	public String get(int begin, int length) {
-		// remap the begin and end to "appear" to be in the
-		// same coordinates of the original parentDocument
-		return _get(begin - pseudoBeginOffset, length);
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param begin
-	 *            int
-	 * @param end
-	 *            int
-	 */
-	public char getChar(int pos) {
-		// remap the begin and end to "appear" to be in the
-		// same coordinates of the original parentDocument
-		return get(pos - pseudoBeginOffset);
-	}
-
-	/**
-	 * We redefine getLength so its not the true length of this sub-set
-	 * document, but the length of the original. This is needed, as a simple
-	 * example, if you want to see if the pseudo end is equal the last
-	 * position of the original document.
-	 */
-	public int getLength() {
-		return pseudoLength;
-	}
-
-	/**
-	 * Returns the length as if considered a true, standalone document
-	 */
-	public int getTrueLength() {
-		return stringBuffer.length();
-	}
-
-	public void replace(int begin, int length, String changes) {
-		// remap the begin and end to "appear" to be in the
-		// same coordinates of the original parentDocument
-		int end = begin + length;
-		stringBuffer.replace(begin - pseudoBeginOffset, end, changes);
-	}
-
-	public void set(String text) {
-		stringBuffer.setLength(0);
-		stringBuffer.append(text);
-	}
-}
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
deleted file mode 100644
index 000c24c..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java
+++ /dev/null
@@ -1,223 +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.sse.core.internal.text;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-
-
-public class TextRegionListImpl implements ITextRegionList {
-
-	private 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$
-
-		}
-
-	}
-
-	private class RegionIterator implements Iterator {
-		private ITextRegion[] fIteratorRegions;
-		private int index = -1;
-		private int maxindex = -1;
-
-		public RegionIterator() {
-			fIteratorRegions = toArray();
-			maxindex = fIteratorRegions.length - 1;
-		}
-
-		public boolean hasNext() {
-			return index < maxindex;
-		}
-
-		public Object next() {
-			if (!(index < maxindex))
-				throw new NoSuchElementException();
-			return fIteratorRegions[++index];
-		}
-
-		public void remove() {
-			throw new UnsupportedOperationException("can not remove regions via iterator"); //$NON-NLS-1$
-
-		}
-
-	}
-
-	private final static int growthConstant = 2;
-
-	private ITextRegion[] fRegions;
-	private int fRegionsCount = 0;
-
-	public TextRegionListImpl() {
-		super();
-	}
-
-	public TextRegionListImpl(ITextRegionList regionList) {
-		this();
-		fRegions = (ITextRegion[]) regionList.toArray().clone();
-		fRegionsCount = fRegions.length;
-	}
-
-	public boolean add(ITextRegion region) {
-
-		if (region == null)
-			return false;
-		ensureCapacity(fRegionsCount + 1);
-		fRegions[fRegionsCount++] = region;
-		return true;
-	}
-
-	public boolean addAll(int insertPos, ITextRegionList newRegions) {
-		// beginning of list is 0 to insertPos-1
-		// remainder of list is insertPos to fRegionsCount
-		// resulting total will be be fRegionsCount + newRegions.size()
-		if (insertPos < 0 || insertPos > fRegionsCount) {
-			throw new ArrayIndexOutOfBoundsException(insertPos);
-		}
-
-		int newRegionsSize = newRegions.size();
-
-		ensureCapacity(fRegionsCount + newRegionsSize);
-
-		int numMoved = fRegionsCount - insertPos;
-		if (numMoved > 0)
-			System.arraycopy(fRegions, insertPos, fRegions, insertPos + newRegionsSize, numMoved);
-
-		for (int i = 0; i < newRegionsSize; i++)
-			fRegions[insertPos++] = newRegions.get(i);
-
-		fRegionsCount += newRegionsSize;
-		return newRegionsSize != 0;
-
-	}
-
-	public void clear() {
-		// note: size of array is not reduced!
-		fRegionsCount = 0;
-	}
-
-	private void ensureCapacity(int needed) {
-		if (fRegions == null) {
-			// first time
-			fRegions = new ITextRegion[needed];
-			return;
-		}
-		int oldLength = fRegions.length;
-		if (oldLength < needed) {
-			ITextRegion[] oldAdapters = fRegions;
-			ITextRegion[] newAdapters = new ITextRegion[needed + growthConstant];
-			System.arraycopy(oldAdapters, 0, newAdapters, 0, fRegionsCount);
-			fRegions = newAdapters;
-		}
-	}
-
-	public ITextRegion get(int index) {
-		if (index < 0 || index > fRegionsCount) {
-			throw new ArrayIndexOutOfBoundsException(index);
-		}
-		ITextRegion result = fRegions[index];
-		return result;
-	}
-
-	public int indexOf(ITextRegion region) {
-
-		int result = -1;
-		if (region != null) {
-			if (fRegions != null) {
-				for (int i = 0; i < fRegions.length; i++) {
-					if (region.equals(fRegions[i])) {
-						result = i;
-						break;
-					}
-				}
-			}
-		}
-		return result;
-	}
-
-	public boolean isEmpty() {
-		return fRegionsCount == 0;
-	}
-
-	public Iterator iterator() {
-		if (size() == 0) {
-			return new NullIterator();
-		} else {
-			return new RegionIterator();
-		}
-	}
-
-	public ITextRegion remove(int index) {
-		// much more efficient ways to implement this, but
-		// I doubt if called often
-		ITextRegion oneToRemove = get(index);
-		remove(oneToRemove);
-		return oneToRemove;
-	}
-
-	public void remove(ITextRegion a) {
-		if (fRegions == null || a == null)
-			return;
-		int newIndex = 0;
-		ITextRegion[] newRegions = new ITextRegion[fRegionsCount];
-		int oldRegionCount = fRegionsCount;
-		boolean found = false;
-		for (int oldIndex = 0; oldIndex < oldRegionCount; oldIndex++) {
-			ITextRegion candidate = fRegions[oldIndex];
-			if (a == candidate) {
-				fRegionsCount--;
-				found = true;
-			} else
-				newRegions[newIndex++] = fRegions[oldIndex];
-		}
-		if (found)
-			fRegions = newRegions;
-	}
-
-	public void removeAll(ITextRegionList regionList) {
-		// much more efficient ways to implement this, but
-		// I doubt if called often
-		if (regionList != null) {
-			for (int i = 0; i < regionList.size(); i++) {
-				this.remove(regionList.get(i));
-			}
-		}
-
-	}
-
-	public int size() {
-		return fRegionsCount;
-	}
-
-	public ITextRegion[] toArray() {
-		// return "clone" of internal array
-		ITextRegion[] newArray = new ITextRegion[fRegionsCount];
-		System.arraycopy(fRegions, 0, newArray, 0, fRegionsCount);
-		return newArray;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredRegion.java
deleted file mode 100644
index e2a8138..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredRegion.java
+++ /dev/null
@@ -1,27 +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.sse.core.internal.text.rules;
-
-import org.eclipse.jface.text.IRegion;
-
-/**
- * Like super class except allows length and offset to be modified. This is
- * convenient for some algorithms, and allows region objects to be reused.
- * Note: There MIGHT be some code that assumes regions are immutable. This
- * class would not be appropriate for those uses.
- */
-public interface IStructuredRegion extends IRegion {
-	void setLength(int length);
-
-	void setOffset(int offset);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredTypedRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredTypedRegion.java
deleted file mode 100644
index 38a14af..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredTypedRegion.java
+++ /dev/null
@@ -1,24 +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.sse.core.internal.text.rules;
-
-import org.eclipse.jface.text.ITypedRegion;
-
-/**
- * Similar to extended interface, except it allows the length, offset, and
- * type to be set. This is useful when iterating through a number of "small"
- * regions, that all map to the the same partion regions.
- */
-public interface IStructuredTypedRegion extends IStructuredRegion, ITypedRegion {
-	void setType(String partitionType);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredRegion.java
deleted file mode 100644
index afa5efc..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredRegion.java
+++ /dev/null
@@ -1,91 +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.sse.core.internal.text.rules;
-
-import org.eclipse.jface.text.IRegion;
-
-
-
-/**
- * Similar to jface region except we wanted a setting on length
- */
-public class SimpleStructuredRegion implements IStructuredRegion {
-	/** The region length */
-	private int fLength;
-
-	/** The region offset */
-	private int fOffset;
-
-	/**
-	 * Create a new region.
-	 * 
-	 * @param offset
-	 *            the offset of the region
-	 * @param length
-	 *            the length of the region
-	 */
-	public SimpleStructuredRegion(int offset, int length) {
-		fOffset = offset;
-		fLength = length;
-	}
-
-	/**
-	 * Two regions are equal if they have the same offset and length.
-	 * 
-	 * @see Object#equals
-	 */
-	public boolean equals(Object o) {
-		if (o instanceof IRegion) {
-			IRegion r = (IRegion) o;
-			return r.getOffset() == fOffset && r.getLength() == fLength;
-		}
-		return false;
-	}
-
-	/*
-	 * @see IRegion#getLength
-	 */
-	public int getLength() {
-		return fLength;
-	}
-
-	/*
-	 * @see IRegion#getOffset
-	 */
-	public int getOffset() {
-		return fOffset;
-	}
-
-	/**
-	 * @see Object#hashCode hascode is overridden since we provide our own
-	 *      equals.
-	 */
-	public int hashCode() {
-		return (fOffset << 24) | (fLength << 16);
-	}
-
-	/**
-	 * Sets the length.
-	 * 
-	 * @param length
-	 *            The length to set
-	 */
-	public void setLength(int length) {
-		fLength = length;
-	}
-
-	public void setOffset(int offset) {
-		fOffset = offset;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredTypedRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredTypedRegion.java
deleted file mode 100644
index f30d54c..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredTypedRegion.java
+++ /dev/null
@@ -1,88 +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.sse.core.internal.text.rules;
-
-
-
-
-/**
- * Similar jace TypedRegion, but had to subclass our version which allowed
- * length to be set.
- */
-public class SimpleStructuredTypedRegion extends SimpleStructuredRegion implements IStructuredTypedRegion {
-
-	/** The region's type */
-	private String fType;
-
-	/**
-	 * Creates a typed region based on the given specification.
-	 * 
-	 * @param offset
-	 *            the region's offset
-	 * @param length
-	 *            the region's length
-	 * @param type
-	 *            the region's type
-	 */
-	public SimpleStructuredTypedRegion(int offset, int length, String type) {
-		super(offset, length);
-		fType = type;
-	}
-
-	/**
-	 * Two typed positions are equal if they have the same offset, length, and
-	 * type.
-	 * 
-	 * @see Object#equals
-	 */
-	public boolean equals(Object o) {
-		if (o instanceof SimpleStructuredTypedRegion) {
-			SimpleStructuredTypedRegion r = (SimpleStructuredTypedRegion) o;
-			return super.equals(r) && ((fType == null && r.getType() == null) || fType.equals(r.getType()));
-		}
-		return false;
-	}
-
-	/*
-	 * @see ITypedRegion#getType()
-	 */
-	public String getType() {
-		return fType;
-	}
-
-	/*
-	 * @see Object#hashCode
-	 */
-	public int hashCode() {
-		int type = fType == null ? 0 : fType.hashCode();
-		return super.hashCode() | type;
-	}
-
-	public void setType(String type) {
-		fType = type;
-	}
-
-	/**
-	 * @see java.lang.Object#toString()
-	 */
-	public String toString() {
-		StringBuffer s = new StringBuffer();
-		s.append(getOffset());
-		s.append(":"); //$NON-NLS-1$
-		s.append(getLength());
-		s.append(" - "); //$NON-NLS-1$
-		s.append(getType());
-		return s.toString();
-	}
-
-}
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
deleted file mode 100644
index 77fe5f0..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java
+++ /dev/null
@@ -1,604 +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.sse.core.internal.text.rules;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.wst.sse.core.internal.ltk.parser.IBlockedStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
-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.IStructuredPartitionTypes;
-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.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-
-
-/**
- * Base Document partitioner for StructuredDocuments. BLOCK_TEXT ITextRegions
- * have a partition type of BLOCK or BLOCK:TAGNAME if a surrounding tagname
- * was recorded.
- */
-public class StructuredTextPartitioner implements IDocumentPartitioner, IStructuredTextPartitioner {
-
-	static class CachedComputedPartitions {
-		int fLength;
-		int fOffset;
-		ITypedRegion[] fPartitions;
-		boolean isInValid;
-
-		CachedComputedPartitions(int offset, int length, ITypedRegion[] partitions) {
-			fOffset = offset;
-			fLength = length;
-			fPartitions = partitions;
-			isInValid = true;
-		}
-	}
-
-	private CachedComputedPartitions cachedPartitions = new CachedComputedPartitions(-1, -1, null);
-	protected String[] fSupportedTypes = null;
-	protected IStructuredTypedRegion internalReusedTempInstance = new SimpleStructuredTypedRegion(0, 0, IStructuredPartitionTypes.DEFAULT_PARTITION);
-	protected IStructuredDocument fStructuredDocument;
-
-	/**
-	 * StructuredTextPartitioner constructor comment.
-	 */
-	public StructuredTextPartitioner() {
-		super();
-	}
-
-	/**
-	 * 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
-	 * 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
-	 * document, so they won't have to worry about that.
-	 * 
-	 * @param offset
-	 *            the offset of the range of interest
-	 * @param length
-	 *            the length of the range of interest
-	 * @return the partitioning of the range
-	 */
-	public ITypedRegion[] computePartitioning(int offset, int length) {
-		if (fStructuredDocument == null) {
-			throw new IllegalStateException("document partitioner is not connected"); //$NON-NLS-1$
-		}
-		ITypedRegion[] results = null;
-
-
-
-		if ((!cachedPartitions.isInValid) && (offset == cachedPartitions.fOffset) && (length == cachedPartitions.fLength)) {
-			results = cachedPartitions.fPartitions;
-		} else {
-
-			if (length == 0) {
-				results = new ITypedRegion[]{getPartition(offset)};
-			} else {
-				List list = new ArrayList();
-				int endPos = offset + length;
-				if (endPos > fStructuredDocument.getLength()) {
-					// This can occur if the model instance is being
-					// changed
-					// and everyone's not yet up to date
-					return new ITypedRegion[]{createPartition(offset, length, getUnknown())};
-				}
-				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();
-						list.add(partition);
-						// and make current, previous
-						previousPartition = partition;
-					}
-				}
-				results = new ITypedRegion[list.size()];
-				list.toArray(results);
-			}
-			if (results.length > 0) {
-				// truncate returned results to requested range
-				if (results[0].getOffset() < offset && results[0] instanceof IStructuredRegion) {
-					((IStructuredRegion) results[0]).setOffset(offset);
-				}
-				int lastEnd = results[results.length - 1].getOffset() + results[results.length - 1].getLength();
-				if (lastEnd > offset + length && results[results.length - 1] instanceof IStructuredRegion) {
-					((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;
-		}
-		return results;
-	}
-
-
-
-	/**
-	 * Connects the document to the partitioner, i.e. indicates the begin of
-	 * the usage of the receiver as partitioner of the given document.
-	 */
-	public synchronized void connect(IDocument document) {
-		if (document instanceof IStructuredDocument) {
-			cachedPartitions.isInValid = true;
-			this.fStructuredDocument = (IStructuredDocument) document;
-		} else {
-			throw new IllegalArgumentException("This class and API are for Structured Documents only"); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Determines if the given ITextRegionContainer itself contains another
-	 * ITextRegionContainer
-	 * 
-	 * @param ITextRegionContainer
-	 * @return boolean
-	 */
-	protected boolean containsEmbeddedRegion(IStructuredDocumentRegion container) {
-		boolean containsEmbeddedRegion = false;
-
-		ITextRegionList regions = container.getRegions();
-		for (int i = 0; i < regions.size(); i++) {
-			ITextRegion region = regions.get(i);
-			if (region instanceof ITextRegionContainer) {
-				containsEmbeddedRegion = true;
-				break;
-			}
-		}
-		return containsEmbeddedRegion;
-	}
-
-	private IStructuredTypedRegion createNewPartitionInstance() {
-		return new SimpleStructuredTypedRegion(internalReusedTempInstance.getOffset(), internalReusedTempInstance.getLength(), internalReusedTempInstance.getType());
-	}
-
-	/**
-	 * Creates the concrete partition from the given values. Returns a new
-	 * instance for each call.
-	 * 
-	 * Subclasses may override.
-	 * 
-	 * @param offset
-	 * @param length
-	 * @param type
-	 * @return ITypedRegion
-	 * 
-	 * TODO: should be protected
-	 */
-	public IStructuredTypedRegion createPartition(int offset, int length, String type) {
-		return new SimpleStructuredTypedRegion(offset, length, type);
-	}
-
-	/**
-	 * Disconnects the document from the partitioner, i.e. indicates the end
-	 * of the usage of the receiver as partitioner of the given document.
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentPartitioner#disconnect()
-	 */
-	public synchronized void disconnect() {
-		cachedPartitions.isInValid = true;
-		this.fStructuredDocument = null;
-	}
-
-	/**
-	 * Informs about a forthcoming document change.
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentPartitioner#documentAboutToBeChanged(DocumentEvent)
-	 */
-	public void documentAboutToBeChanged(DocumentEvent event) {
-		cachedPartitions.isInValid = true;
-	}
-
-	/**
-	 * The document has been changed. The partitioner updates the set of
-	 * regions and returns whether the structure of the document partitioning
-	 * has been changed, i.e. whether partitions have been added or removed.
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentPartitioner#documentChanged(DocumentEvent)
-	 */
-	public boolean documentChanged(DocumentEvent event) {
-		boolean result = false;
-		if (event instanceof StructuredDocumentRegionsReplacedEvent) {
-			// partitions don't always change while document regions do,
-			// but that's the only "quick check" we have.
-			// I'm not sure if something more sophisticated will be needed
-			// in the future. (dmw, 02/18/04).
-			result = true;
-		}
-		return result;
-	}
-
-	protected boolean doParserSpecificCheck(int offset, boolean partitionFound, IStructuredDocumentRegion sdRegion, IStructuredDocumentRegion previousStructuredDocumentRegion, ITextRegion next, ITextRegion previousStart) {
-		// this (conceptually) abstract method is not concerned with
-		// specific region types
-		return false;
-	}
-
-	/**
-	 * Returns the content type of the partition containing the given
-	 * character position of the given document. The document has previously
-	 * been connected to the partitioner.
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentPartitioner#getContentType(int)
-	 */
-	public String getContentType(int offset) {
-		return getPartition(offset).getType();
-	}
-
-	/**
-	 * To be used by default!
-	 */
-	public String getDefaultPartitionType() {
-
-		return IStructuredPartitionTypes.DEFAULT_PARTITION;
-	}
-
-	/**
-	 * Returns the set of all possible content types the partitoner 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.
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentPartitioner#getLegalContentTypes()
-	 */
-	public java.lang.String[] getLegalContentTypes() {
-		if (fSupportedTypes == null) {
-			initLegalContentTypes();
-		}
-		return fSupportedTypes;
-	}
-
-	/**
-	 * Returns the partition containing the given character position of the
-	 * given document. The document has previously been connected to the
-	 * partitioner.
-	 * 
-	 * Note: this shouldn't be called dirctly 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
-	 * document, so they won't have to worry about that.
-	 * 
-	 * 
-	 * 
-	 * @see org.eclipse.jface.text.IDocumentPartitioner#getPartition(int)
-	 */
-	public ITypedRegion getPartition(int offset) {
-		internalGetPartition(offset, true);
-		return createNewPartitionInstance();
-	}
-
-	protected String getPartitionFromBlockedText(ITextRegion region, int offset, String result) {
-		// parser sensitive code was moved to subclass for quick transition
-		// this (conceptually) abstract version isn't concerned with blocked
-		// text
-
-		return result;
-	}
-
-	protected String getPartitionType(ForeignRegion region, int offset) {
-		String tagname = region.getSurroundingTag();
-		String result = null;
-		if (tagname != null) {
-			result = "BLOCK:" + tagname.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$
-		} else {
-			result = "BLOCK"; //$NON-NLS-1$
-		}
-		return result;
-	}
-
-
-	protected String getPartitionType(IBlockedStructuredDocumentRegion blockedStructuredDocumentRegion, int offset) {
-		String result = null;
-		ITextRegionList regions = blockedStructuredDocumentRegion.getRegions();
-
-		// regions should never be null, or hold zero regions, but just in
-		// case...
-		if (regions != null && regions.size() > 0) {
-			if (regions.size() == 1) {
-				// if only one, then its a "pure" blocked note.
-				// if more than one, then must contain some embedded region
-				// container
-				ITextRegion blockedRegion = regions.get(0);
-				// double check for code safefy, though should always be true
-				if (blockedRegion instanceof ForeignRegion) {
-					result = getPartitionType((ForeignRegion) blockedRegion, offset);
-				}
-			} else {
-				// must have some embedded region container, so we'll make
-				// sure we'll get the appropriate one
-				result = getReleventRegionType(blockedStructuredDocumentRegion, offset);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Method getPartitionType.
-	 * 
-	 * @param region
-	 * @return String
-	 */
-	private String getPartitionType(ITextRegion region) {
-		// if it get's to this "raw" level, then
-		// must be default.
-		return getDefaultPartitionType();
-	}
-
-	/**
-	 * Returns the partition based on region type. This basically maps from
-	 * one region-type space to another, higher level, region-type space.
-	 * 
-	 * @param region
-	 * @param offset
-	 * @return String
-	 */
-	public String getPartitionType(ITextRegion region, int offset) {
-		String result = getDefaultPartitionType();
-		//		if (region instanceof ContextRegionContainer) {
-		//			result = getPartitionType((ITextRegionContainer) region, offset);
-		//		} else {
-		if (region instanceof ITextRegionContainer) {
-			result = getPartitionType((ITextRegionContainer) region, offset);
-		}
-
-		result = getPartitionFromBlockedText(region, offset, result);
-
-		return result;
-
-	}
-
-	/**
-	 * Similar to method with 'ITextRegion' as argument, except for
-	 * RegionContainers, if it has embedded regions, then we need to drill
-	 * down and return DocumentPartition based on "lowest level" region type.
-	 * For example, in <body id=" <%= object.getID() %>" > The text between
-	 * <%= and %> would be a "java region" not an "HTML region".
-	 */
-	protected String getPartitionType(ITextRegionContainer region, int offset) {
-		// TODO this method needs to be 'cleaned up' after refactoring
-		// its instanceof logic seems messed up now.
-		String result = null;
-		if (region != null) {
-			ITextRegion coreRegion = region;
-			if (coreRegion instanceof ITextRegionContainer) {
-				result = getPartitionType((ITextRegionContainer) coreRegion, ((ITextRegionContainer) coreRegion).getRegions(), offset);
-			} else {
-				result = getPartitionType(region);
-			}
-		} else {
-			result = getPartitionType((ITextRegion) region, offset);
-		}
-
-		return result;
-	}
-
-	private String getPartitionType(ITextRegionContainer coreRegion, ITextRegionList regions, int offset) {
-		String result = null;
-		for (int i = 0; i < regions.size(); i++) {
-			ITextRegion region = regions.get(i);
-			if (coreRegion.containsOffset(region, offset)) {
-				result = getPartitionType(region, offset);
-				break;
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Computes the partition type for the zero-length partition between a
-	 * start tag and end tag with the given name regions.
-	 * 
-	 * @param previousStartTagNameRegion
-	 * @param nextEndTagNameRegion
-	 * @return String
-	 */
-	public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, IStructuredDocumentRegion nextNode) {
-		return getDefaultPartitionType();
-	}
-
-	/**
-	 * Return the ITextRegion at the given offset. For most cases, this will
-	 * be the flatNode itself. Should it contain an embedded
-	 * ITextRegionContainer, will return the internal region at the offset
-	 * 
-	 * 
-	 * @param flatNode
-	 * @param offset
-	 * @return ITextRegion
-	 */
-	private String getReleventRegionType(IStructuredDocumentRegion flatNode, int offset) {
-		//		* Note: the original form of this method -- which returned "deep"
-		// region, isn't that
-		//		* useful, after doing parent elimination refactoring,
-		//		* since once the deep region is returned, its hard to get its text
-		// or offset without
-		//		* proper parent.
-		ITextRegion resultRegion = null;
-		if (containsEmbeddedRegion(flatNode)) {
-			resultRegion = flatNode.getRegionAtCharacterOffset(offset);
-			if (resultRegion instanceof ITextRegionContainer) {
-				resultRegion = flatNode.getRegionAtCharacterOffset(offset);
-				ITextRegionList regions = ((ITextRegionContainer) resultRegion).getRegions();
-				for (int i = 0; i < regions.size(); i++) {
-					ITextRegion region = regions.get(i);
-					if (flatNode.getStartOffset(region) <= offset && offset < flatNode.getEndOffset(region)) {
-						resultRegion = region;
-						break;
-					}
-				}
-			}
-		} else {
-			resultRegion = flatNode;
-		}
-		return resultRegion.getType();
-	}
-
-	/**
-	 * To be used, instead of default, when there is some thing surprising
-	 * about are attempt to partition
-	 */
-	protected String getUnknown() {
-		return IStructuredPartitionTypes.UNKNOWN_PARTITION;
-	}
-
-	/**
-	 * to be abstract eventually
-	 */
-	protected void initLegalContentTypes() {
-		fSupportedTypes = new String[]{IStructuredPartitionTypes.DEFAULT_PARTITION, IStructuredPartitionTypes.UNKNOWN_PARTITION};
-	}
-
-	/**
-	 * Returns the partition containing the given character position of the
-	 * given document. The document has previously been connected to the
-	 * partitioner. If the checkBetween parameter is true, an offset between a
-	 * start and end tag will return a zero-length region.
-	 */
-	private void internalGetPartition(int offset, boolean checkBetween) {
-		if (fStructuredDocument == null) {
-			throw new IllegalStateException("document partitioner is not connected"); //$NON-NLS-1$
-		}
-
-		boolean partitionFound = false;
-		int docLength = fStructuredDocument.getLength();
-		// get document region type and map to partition type :
-		// Note: a partion can be smaller than a flatnode, if that flatnode
-		// contains a region container.
-		// That's why we need to get "relevent region".
-		IStructuredDocumentRegion structuredDocumentRegion = fStructuredDocument.getRegionAtCharacterOffset(offset);
-		// flatNode is null if empty document
-		// this is king of a "normal case" for empty document
-		if (structuredDocumentRegion == null && docLength == 0) {
-			// In order to prevent infinite error loops, this partition must
-			// never have a zero length
-			// unless the document is also zero length
-			setInternalPartition(offset, 0, getDefaultPartitionType());
-			partitionFound = true;
-		} else if (structuredDocumentRegion == null && docLength != 0) {
-			// this case is "unusual". When would region be null, and document
-			// longer
-			// than 0. I think this means somethings "out of sync". And we may
-			// want
-			// to "flag" that fact and just return one big region of
-			// 'unknown', instead
-			// of one character at a time.
-			setInternalPartition(offset, 1, getUnknown());
-			partitionFound = true;
-		} else if (checkBetween) {
-			// dmw: minimizes out to the first if test above
-			//			if (structuredDocumentRegion == null && docLength == 0) {
-			//				// known special case for an empty document
-			//				setInternalPartition(offset, 0, getDefault());
-			//				partitionFound = true;
-			//			}
-			//			else
-			if (structuredDocumentRegion.getStartOffset() == offset) {
-				IStructuredDocumentRegion previousStructuredDocumentRegion = structuredDocumentRegion.getPrevious();
-				if (previousStructuredDocumentRegion != null) {
-					ITextRegion next = structuredDocumentRegion.getRegionAtCharacterOffset(offset);
-					ITextRegion previousStart = previousStructuredDocumentRegion.getRegionAtCharacterOffset(previousStructuredDocumentRegion.getStartOffset());
-					partitionFound = doParserSpecificCheck(offset, partitionFound, structuredDocumentRegion, previousStructuredDocumentRegion, next, previousStart);
-				}
-			}
-		}
-		// dmw: Given the first two tests above minimize to this, this block
-		// can never run, right?
-		//		else if (structuredDocumentRegion == null) {
-		//			setInternalPartition(offset, 0, getDefault());
-		//			partitionFound = true;
-		//		}
-
-		if (!partitionFound) {
-			ITextRegion resultRegion = structuredDocumentRegion.getRegionAtCharacterOffset(offset);
-			partitionFound = isDocumentRegionBasedPartition(structuredDocumentRegion, resultRegion, 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);
-				} 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());
-					}
-				}
-			}
-		}
-	}
-
-	/**
-	 * Provides for a per-StructuredDocumentRegion override selecting the
-	 * partition type using more than just a single ITextRegion.
-	 * 
-	 * @param structuredDocumentRegion
-	 *            the StructuredDocumentRegion
-	 * @param containedChildRegion
-	 *            an ITextRegion within the given StructuredDocumentRegion
-	 *            that would normally determine the partition type by itself
-	 * @param offset
-	 *            the document offset
-	 * @return true if the partition type will be overridden, false to
-	 *         continue normal processing
-	 */
-	protected boolean isDocumentRegionBasedPartition(IStructuredDocumentRegion structuredDocumentRegion, ITextRegion containedChildRegion, int offset) {
-		return false;
-	}
-
-	public IDocumentPartitioner newInstance() {
-		return new StructuredTextPartitioner();
-	}
-
-	protected void setInternalPartition(int offset, int length, String type) {
-		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/CommandCursorPosition.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/CommandCursorPosition.java
deleted file mode 100644
index 3c32f5b..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/CommandCursorPosition.java
+++ /dev/null
@@ -1,66 +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.sse.core.internal.undo;
-
-
-
-public interface CommandCursorPosition {
-
-	/**
-	 * Returns the cursor position to be set to after this command is redone.
-	 * 
-	 * @return int
-	 */
-	int getRedoCursorPosition();
-
-	/**
-	 * Returns the length of text to be selected after this command is redone.
-	 * 
-	 * @return int
-	 */
-	int getRedoSelectionLength();
-
-	/**
-	 * Returns the cursor position to be set to after this command is undone.
-	 * 
-	 * @return int
-	 */
-	int getUndoCursorPosition();
-
-	/**
-	 * Returns the length of text to be selected after this command is undone.
-	 * 
-	 * @return int
-	 */
-	int getUndoSelectionLength();
-
-	/**
-	 * Sets the cursor position to be used after this command is redone.
-	 */
-	void setRedoCursorPosition(int cursorPosition);
-
-	/**
-	 * Sets the length of text to be selected after this command is redone.
-	 */
-	void setRedoSelectionLength(int selectionLength);
-
-	/**
-	 * Sets the cursor position to be used after this command is undone.
-	 */
-	void setUndoCursorPosition(int cursorPosition);
-
-	/**
-	 * Sets the length of text to be selected after this command is undone.
-	 */
-	void setUndoSelectionLength(int selectionLength);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IDocumentSelectionMediator.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IDocumentSelectionMediator.java
deleted file mode 100644
index a63882d..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IDocumentSelectionMediator.java
+++ /dev/null
@@ -1,35 +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.sse.core.internal.undo;
-
-import org.eclipse.jface.text.IDocument;
-
-
-public interface IDocumentSelectionMediator {
-	/**
-	 * Returns the document selection mediator's input document.
-	 * 
-	 * @return the document selection mediator's input document
-	 */
-	IDocument getDocument();
-
-	/**
-	 * Sets a new selection in the document as a result of an undo operation.
-	 * 
-	 * UndoDocumentEvent contains the requester of the undo operation, and the
-	 * offset and length of the new selection. Implementation of
-	 * IDocumentSelectionMediator can check if it's the requester that caused
-	 * the new selection, and decide if the new selection should be applied.
-	 */
-	void undoOperationSelectionChanged(UndoDocumentEvent event);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IStructuredTextUndoManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IStructuredTextUndoManager.java
deleted file mode 100644
index 57c741c..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IStructuredTextUndoManager.java
+++ /dev/null
@@ -1,155 +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.sse.core.internal.undo;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStack;
-
-public interface IStructuredTextUndoManager {
-
-	/**
-	 * Begin recording undo transactions.
-	 */
-	void beginRecording(Object requester);
-
-	/**
-	 * Begin recording undo transactions.
-	 */
-	void beginRecording(Object requester, int cursorPosition, int selectionLength);
-
-	/**
-	 * Begin recording undo transactions.
-	 */
-	void beginRecording(Object requester, String label);
-
-	/**
-	 * Begin recording undo transactions.
-	 */
-	void beginRecording(Object requester, String label, int cursorPosition, int selectionLength);
-
-	/**
-	 * Begin recording undo transactions.
-	 */
-	void beginRecording(Object requester, String label, String description);
-
-	/**
-	 * Begin recording undo transactions.
-	 */
-	void beginRecording(Object requester, String label, String description, int cursorPosition, int selectionLength);
-
-	/**
-	 * Connect the mediator to the undo manager.
-	 */
-	void connect(IDocumentSelectionMediator mediator);
-
-	/**
-	 * Disable undo management.
-	 */
-	void disableUndoManagement();
-
-	/**
-	 * Disconnect the mediator from the undo manager.
-	 */
-	void disconnect(IDocumentSelectionMediator mediator);
-
-	/**
-	 * Enable undo management.
-	 */
-	void enableUndoManagement();
-
-	/**
-	 * End recording undo transactions.
-	 */
-	void endRecording(Object requester);
-
-	/**
-	 * End recording undo transactions.
-	 */
-	void endRecording(Object requester, int cursorPosition, int selectionLength);
-
-	/**
-	 * <p>
-	 * Normally, the undo manager can figure out the best times when to end a
-	 * pending command and begin a new one ... to the structure of a structued
-	 * document. There are times, however, when clients may wish to override
-	 * those algorithms and end one earlier than normal. The one known case is
-	 * for multipage editors. If a user is on one page, and type '123' as
-	 * attribute value, then click around to other parts of page, or different
-	 * pages, then return to '123|' and type 456, then "undo" they typically
-	 * expect the undo to just undo what they just typed, the 456, not the
-	 * whole attribute value.
-	 * <p>
-	 * If there is no pending command, the request is ignored.
-	 */
-	public void forceEndOfPendingCommand(Object requester, int currentPosition, int length);
-
-	/**
-	 * Some clients need to do complicated things with undo stack. Plus, in
-	 * some cases, if clients setCommandStack temporarily, they have
-	 * reponsibility to set back to original one when finished.
-	 */
-	public CommandStack getCommandStack();
-
-	/**
-	 * Get the redo command even if it's not committed yet.
-	 */
-	Command getRedoCommand();
-
-	/**
-	 * Get the undo command even if it's not committed yet.
-	 */
-	Command getUndoCommand();
-
-	/**
-	 * Redo the last command in the undo manager.
-	 */
-	void redo();
-
-	/**
-	 * Redo the last command in the undo manager and notify the requester
-	 * about the new selection.
-	 */
-	void redo(IDocumentSelectionMediator requester);
-
-	/**
-	 * Returns whether at least one text change can be repeated. A text change
-	 * can be repeated only if it was executed and rolled back.
-	 * 
-	 * @return <code>true</code> if at least on text change can be repeated
-	 */
-	boolean redoable();
-
-	/**
-	 * Set the command stack.
-	 */
-	void setCommandStack(CommandStack commandStack);
-
-	/**
-	 * Undo the last command in the undo manager.
-	 */
-	void undo();
-
-	/**
-	 * Undo the last command in the undo manager and notify the requester
-	 * about the new selection.
-	 */
-	void undo(IDocumentSelectionMediator requester);
-
-	/**
-	 * Returns whether at least one text change can be rolled back.
-	 * 
-	 * @return <code>true</code> if at least one text change can be rolled
-	 *         back
-	 */
-	boolean undoable();
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommand.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommand.java
deleted file mode 100644
index 3c7ad37..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommand.java
+++ /dev/null
@@ -1,34 +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.sse.core.internal.undo;
-
-
-
-public interface StructuredTextCommand {
-
-	String getTextDeleted();
-
-	int getTextEnd();
-
-	String getTextInserted();
-
-	int getTextStart();
-
-	void setTextDeleted(String textDeleted);
-
-	void setTextEnd(int textEnd);
-
-	void setTextInserted(String textInserted);
-
-	void setTextStart(int textStart);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommandImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommandImpl.java
deleted file mode 100644
index e8e282a..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommandImpl.java
+++ /dev/null
@@ -1,137 +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.sse.core.internal.undo;
-
-
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-public class StructuredTextCommandImpl extends AbstractCommand implements StructuredTextCommand {
-
-	protected IDocument fDocument = null; // needed for updating the text
-	protected String fTextDeleted = null;
-	protected int fTextEnd = -1;
-	protected String fTextInserted = null;
-	protected int fTextStart = -1;
-
-	/**
-	 * We have no-arg constructor non-public to force document to be specfied.
-	 *  
-	 */
-	protected StructuredTextCommandImpl() {
-		super();
-	}
-
-	public StructuredTextCommandImpl(IDocument document) {
-		this();
-		fDocument = document; // needed for updating the text
-	}
-
-	public void execute() {
-	}
-
-	/**
-	 * getTextDeleted method comment.
-	 */
-	public java.lang.String getTextDeleted() {
-		return fTextDeleted;
-	}
-
-	/**
-	 * textEnd is the same as (textStart + textInserted.length())
-	 */
-	public int getTextEnd() {
-		return fTextEnd;
-	}
-
-	/**
-	 * getTextInserted method comment.
-	 */
-	public java.lang.String getTextInserted() {
-		return fTextInserted;
-	}
-
-	/**
-	 * getTextStart method comment.
-	 */
-	public int getTextStart() {
-		return fTextStart;
-	}
-
-	protected boolean prepare() {
-		return true;
-	}
-
-	public void redo() {
-		if (fDocument instanceof IStructuredDocument) {
-			// note: one of the few places we programatically ignore read-only
-			// settings
-			((IStructuredDocument) fDocument).replaceText(this, fTextStart, fTextDeleted.length(), fTextInserted, true);
-		} else {
-			try {
-				fDocument.replace(fTextStart, fTextDeleted.length(), fTextInserted);
-			} catch (BadLocationException e) {
-				// assumed impossible, for now
-				Logger.logException(e);
-			}
-		}
-	}
-
-	/**
-	 * setTextDeleted method comment.
-	 */
-	public void setTextDeleted(java.lang.String textDeleted) {
-		fTextDeleted = textDeleted;
-	}
-
-	/**
-	 * setTextEnd method comment.
-	 */
-	public void setTextEnd(int textEnd) {
-		fTextEnd = textEnd;
-	}
-
-	/**
-	 * setTextInserted method comment.
-	 */
-	public void setTextInserted(java.lang.String textInserted) {
-		fTextInserted = textInserted;
-	}
-
-	/**
-	 * setTextStart method comment.
-	 */
-	public void setTextStart(int textStart) {
-		fTextStart = textStart;
-	}
-
-	public void undo() {
-		if (fDocument instanceof IStructuredDocument) {
-			// note: one of the few places we programatically ignore read-only
-			// settings
-			((IStructuredDocument) fDocument).replaceText(this, fTextStart, fTextInserted.length(), fTextDeleted, true);
-		} else {
-			try {
-				fDocument.replace(fTextStart, fTextInserted.length(), fTextDeleted);
-			} catch (BadLocationException e) {
-				// assumed impossible, for now
-				Logger.logException(e);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCompoundCommandImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCompoundCommandImpl.java
deleted file mode 100644
index 86ca4a0..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCompoundCommandImpl.java
+++ /dev/null
@@ -1,260 +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.sse.core.internal.undo;
-
-
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CompoundCommand;
-
-
-
-public class StructuredTextCompoundCommandImpl extends CompoundCommand implements CommandCursorPosition {
-	protected int fRedoCursorPosition = -1;
-	protected int fRedoSelectionLength = 0;
-
-	protected int fUndoCursorPosition = -1;
-	protected int fUndoSelectionLength = 0;
-
-	/**
-	 * StructuredTextCompoundCommandImpl constructor comment.
-	 */
-	public StructuredTextCompoundCommandImpl() {
-		super();
-	}
-
-	/**
-	 * StructuredTextCompoundCommandImpl constructor comment.
-	 * 
-	 * @param resultIndex
-	 *            int
-	 */
-	public StructuredTextCompoundCommandImpl(int resultIndex) {
-		super(resultIndex);
-	}
-
-	/**
-	 * StructuredTextCompoundCommandImpl constructor comment.
-	 * 
-	 * @param resultIndex
-	 *            int
-	 * @param commandList
-	 *            java.util.List
-	 */
-	public StructuredTextCompoundCommandImpl(int resultIndex, java.util.List commandList) {
-		super(resultIndex, commandList);
-	}
-
-	/**
-	 * StructuredTextCompoundCommandImpl constructor comment.
-	 * 
-	 * @param resultIndex
-	 *            int
-	 * @param label
-	 *            java.lang.String
-	 */
-	public StructuredTextCompoundCommandImpl(int resultIndex, String label) {
-		super(resultIndex, label);
-	}
-
-	/**
-	 * StructuredTextCompoundCommandImpl constructor comment.
-	 * 
-	 * @param resultIndex
-	 *            int
-	 * @param label
-	 *            java.lang.String
-	 * @param commandList
-	 *            java.util.List
-	 */
-	public StructuredTextCompoundCommandImpl(int resultIndex, String label, java.util.List commandList) {
-		super(resultIndex, label, commandList);
-	}
-
-	/**
-	 * StructuredTextCompoundCommandImpl constructor comment.
-	 * 
-	 * @param resultIndex
-	 *            int
-	 * @param label
-	 *            java.lang.String
-	 * @param description
-	 *            java.lang.String
-	 */
-	public StructuredTextCompoundCommandImpl(int resultIndex, String label, String description) {
-		super(resultIndex, label, description);
-	}
-
-	/**
-	 * StructuredTextCompoundCommandImpl constructor comment.
-	 * 
-	 * @param resultIndex
-	 *            int
-	 * @param label
-	 *            java.lang.String
-	 * @param description
-	 *            java.lang.String
-	 * @param commandList
-	 *            java.util.List
-	 */
-	public StructuredTextCompoundCommandImpl(int resultIndex, String label, String description, java.util.List commandList) {
-		super(resultIndex, label, description, commandList);
-	}
-
-	/**
-	 * StructuredTextCompoundCommandImpl constructor comment.
-	 * 
-	 * @param commandList
-	 *            java.util.List
-	 */
-	public StructuredTextCompoundCommandImpl(java.util.List commandList) {
-		super(commandList);
-	}
-
-	/**
-	 * StructuredTextCompoundCommandImpl constructor comment.
-	 * 
-	 * @param label
-	 *            java.lang.String
-	 */
-	public StructuredTextCompoundCommandImpl(String label) {
-		super(label);
-	}
-
-	/**
-	 * StructuredTextCompoundCommandImpl constructor comment.
-	 * 
-	 * @param label
-	 *            java.lang.String
-	 * @param commandList
-	 *            java.util.List
-	 */
-	public StructuredTextCompoundCommandImpl(String label, java.util.List commandList) {
-		super(label, commandList);
-	}
-
-	/**
-	 * StructuredTextCompoundCommandImpl constructor comment.
-	 * 
-	 * @param label
-	 *            java.lang.String
-	 * @param description
-	 *            java.lang.String
-	 */
-	public StructuredTextCompoundCommandImpl(String label, String description) {
-		super(label, description);
-	}
-
-	/**
-	 * StructuredTextCompoundCommandImpl constructor comment.
-	 * 
-	 * @param label
-	 *            java.lang.String
-	 * @param description
-	 *            java.lang.String
-	 * @param commandList
-	 *            java.util.List
-	 */
-	public StructuredTextCompoundCommandImpl(String label, String description, java.util.List commandList) {
-		super(label, description, commandList);
-	}
-
-	/**
-	 * Returns the cursor position to be set to after this command is redone.
-	 * 
-	 * @return int
-	 */
-	public int getRedoCursorPosition() {
-		int cursorPosition = -1;
-
-		if (fRedoCursorPosition != -1)
-			cursorPosition = fRedoCursorPosition;
-		else if (!commandList.isEmpty()) {
-			int commandListSize = commandList.size();
-			Command lastCommand = (Command) commandList.get(commandListSize - 1);
-
-			if (lastCommand instanceof CommandCursorPosition)
-				cursorPosition = ((CommandCursorPosition) lastCommand).getRedoCursorPosition();
-		}
-
-		return cursorPosition;
-	}
-
-	/**
-	 * Returns the length of text to be selected after this command is redone.
-	 * 
-	 * @return int
-	 */
-	public int getRedoSelectionLength() {
-		return fRedoSelectionLength;
-	}
-
-	/**
-	 * Returns the cursor position to be set to after this command is undone.
-	 * 
-	 * @return int
-	 */
-	public int getUndoCursorPosition() {
-		int cursorPosition = -1;
-
-		if (fUndoCursorPosition != -1)
-			cursorPosition = fUndoCursorPosition;
-		else if (!commandList.isEmpty()) {
-			// never used
-			//int commandListSize = commandList.size();
-			Command firstCommand = (Command) commandList.get(0);
-
-			if (firstCommand instanceof CommandCursorPosition)
-				cursorPosition = ((CommandCursorPosition) firstCommand).getUndoCursorPosition();
-		}
-
-		return cursorPosition;
-	}
-
-	/**
-	 * Returns the length of text to be selected after this command is undone.
-	 * 
-	 * @return int
-	 */
-	public int getUndoSelectionLength() {
-		return fUndoSelectionLength;
-	}
-
-	/**
-	 * Sets the cursor position to be used after this command is redone.
-	 */
-	public void setRedoCursorPosition(int cursorPosition) {
-		fRedoCursorPosition = cursorPosition;
-	}
-
-	/**
-	 * Sets the length of text to be selected after this command is redone.
-	 */
-	public void setRedoSelectionLength(int selectionLength) {
-		fRedoSelectionLength = selectionLength;
-	}
-
-	/**
-	 * Sets the cursor position to be used after this command is undone.
-	 */
-	public void setUndoCursorPosition(int cursorPosition) {
-		fUndoCursorPosition = cursorPosition;
-	}
-
-	/**
-	 * Sets the length of text to be selected after this command is undone.
-	 */
-	public void setUndoSelectionLength(int selectionLength) {
-		fUndoSelectionLength = selectionLength;
-	}
-}
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
deleted file mode 100644
index 9c934eb..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
+++ /dev/null
@@ -1,625 +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.sse.core.internal.undo;
-
-import java.util.EventObject;
-
-import org.eclipse.emf.common.command.BasicCommandStack;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.command.CommandStackListener;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.SSECoreMessages;
-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.StructuredModelManager;
-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.StructuredDocumentEvent;
-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.Assert;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-
-public class StructuredTextUndoManager implements IStructuredTextUndoManager {
-
-	class InternalCommandStackListener implements CommandStackListener {
-		public void commandStackChanged(EventObject event) {
-			resetInternalCommands();
-		}
-	}
-
-	class InternalStructuredDocumentListener implements IStructuredDocumentListener {
-
-		public void newModel(NewDocumentEvent structuredDocumentEvent) {
-			// Do nothing. Do not push the new model's structuredDocument
-			// changes
-			// onto the undo command stack, or else the user may be able to
-			// undo
-			// an existing file to an empty file.
-		}
-
-		public void noChange(NoChangeEvent structuredDocumentEvent) {
-			// Since "no change", do nothing.
-		}
-
-		public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
-			processStructuredDocumentEvent(structuredDocumentEvent);
-		}
-
-		private void processStructuredDocumentEvent(String textDeleted, String textInserted, int textStart, int textEnd) {
-			if (fTextCommand != null && textStart == fTextCommand.getTextEnd()) {
-				// append to the text command
-				fTextCommand.setTextDeleted(fTextCommand.getTextDeleted().concat(textDeleted));
-				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) {
-				// 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);
-				}
-			}
-			else {
-				createNewTextCommand(textDeleted, textInserted, textStart, textEnd);
-			}
-
-			// save cursor position
-			fCursorPosition = textEnd;
-		}
-
-		private void processStructuredDocumentEvent(StructuredDocumentEvent structuredDocumentEvent) {
-			// Note: fListening tells us if we should listen to the
-			// StructuredDocumentEvent.
-			// fListening is set to false right before the undo/redo process
-			// and
-			// then set to true again
-			// right after the undo/redo process to block out and ignore all
-			// StructuredDocumentEvents generated
-			// by the undo/redo process.
-
-			// Process StructuredDocumentEvent if fListening is true.
-			//
-			// We are executing a command from the command stack if the
-			// requester
-			// is a command (for example, undo/redo).
-			// We should not process the flat model event when we are
-			// executing a
-			// command from the command stack.
-			if (fUndoManagementEnabled && !(structuredDocumentEvent.getOriginalRequester() instanceof Command)) {
-				// check requester if not recording
-				if (!fRecording)
-					checkRequester(structuredDocumentEvent.getOriginalRequester());
-
-				// process the structuredDocumentEvent
-				String textDeleted = structuredDocumentEvent.getDeletedText();
-				String textInserted = structuredDocumentEvent.getText();
-				int textStart = structuredDocumentEvent.getOffset();
-				int textEnd = textStart + textInserted.length();
-				processStructuredDocumentEvent(textDeleted, textInserted, textStart, textEnd);
-			}
-		}
-
-		public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
-			processStructuredDocumentEvent(structuredDocumentEvent);
-		}
-
-		public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
-			processStructuredDocumentEvent(structuredDocumentEvent);
-		}
-
-	}
-
-	private static final String TEXT_CHANGE_TEXT = SSECoreMessages.Text_Change_UI_; //$NON-NLS-1$
-	private CommandStack fCommandStack = null;
-	private StructuredTextCompoundCommandImpl fCompoundCommand = null;
-	private String fCompoundCommandDescription = null;
-	private String fCompoundCommandLabel = null;
-	int fCursorPosition = 0;
-	// private IStructuredModel fStructuredModel = null;
-	private IDocument fDocument;
-	private InternalCommandStackListener fInternalCommandStackListener;
-	// private Map fTextViewerToListenerMap = new HashMap();
-	private IStructuredDocumentListener fInternalStructuredDocumentListener;
-	private IDocumentSelectionMediator[] fMediators = null;
-	private boolean fRecording = false;
-	private int fRecordingCount = 0;
-	private Object fRequester;
-	StructuredTextCommandImpl fTextCommand = null;
-	private int fUndoCursorPosition = -1;
-	boolean fUndoManagementEnabled = true;
-	private int fUndoSelectionLength = 0;
-
-	public StructuredTextUndoManager() {
-		this(new BasicCommandStack());
-	}
-
-	public StructuredTextUndoManager(CommandStack commandStack) {
-		setCommandStack(commandStack);
-	}
-
-	private void addDocumentSelectionMediator(IDocumentSelectionMediator mediator) {
-		if (!Utilities.contains(fMediators, mediator)) {
-			int oldSize = 0;
-
-			if (fMediators != null) {
-				// normally won't be null, but we need to be sure, for first
-				// time through
-				oldSize = fMediators.length;
-			}
-
-			int newSize = oldSize + 1;
-			IDocumentSelectionMediator[] newMediators = new IDocumentSelectionMediator[newSize];
-			if (fMediators != null) {
-				System.arraycopy(fMediators, 0, newMediators, 0, oldSize);
-			}
-
-			// add the new undo mediator to last position
-			newMediators[newSize - 1] = mediator;
-
-			// now switch new for old
-			fMediators = newMediators;
-		}
-		else {
-			removeDocumentSelectionMediator(mediator);
-			addDocumentSelectionMediator(mediator);
-		}
-	}
-
-	public void beginRecording(Object requester) {
-		beginRecording(requester, null, null);
-	}
-
-	public void beginRecording(Object requester, int cursorPosition, int selectionLength) {
-		beginRecording(requester, null, null);
-
-		fUndoCursorPosition = cursorPosition;
-		fUndoSelectionLength = selectionLength;
-	}
-
-	public void beginRecording(Object requester, String label) {
-		beginRecording(requester, label, null);
-	}
-
-	public void beginRecording(Object requester, String label, int cursorPosition, int selectionLength) {
-		beginRecording(requester, label, null);
-
-		fUndoCursorPosition = cursorPosition;
-		fUndoSelectionLength = selectionLength;
-	}
-
-	public void beginRecording(Object requester, String label, String description) {
-		// save the requester
-		fRequester = requester;
-
-		// update label and desc only on the first level when recording is
-		// nested
-		if (fRecordingCount == 0) {
-			fCompoundCommandLabel = label;
-			if (fCompoundCommandLabel == null)
-				fCompoundCommandLabel = TEXT_CHANGE_TEXT;
-
-			fCompoundCommandDescription = description;
-			if (fCompoundCommandDescription == null)
-				fCompoundCommandDescription = TEXT_CHANGE_TEXT;
-
-			// clear commands
-			fTextCommand = null;
-			fCompoundCommand = null;
-		}
-
-		// update counter and flag
-		fRecordingCount++;
-		fRecording = true;
-
-		// no undo cursor position and undo selection length specified
-		// reset undo cursor position and undo selection length
-		fUndoCursorPosition = -1;
-		fUndoSelectionLength = 0;
-	}
-
-	public void beginRecording(Object requester, String label, String description, int cursorPosition, int selectionLength) {
-		beginRecording(requester, label, description);
-
-		fUndoCursorPosition = cursorPosition;
-		fUndoSelectionLength = selectionLength;
-	}
-
-	void checkRequester(Object requester) {
-		if (fRequester != null && !fRequester.equals(requester)) {
-			// Force restart of recording so the last compound command is
-			// closed.
-			//
-			// However, we should not force restart of recording when the
-			// request came from StructuredDocumentToTextAdapter or
-			// XMLModelImpl
-			// because cut/paste requests and character inserts to the
-			// textViewer are from StructuredDocumentToTextAdapter,
-			// and requests to delete a node in the XMLTableTreeViewer are
-			// from XMLModelImpl (which implements IStructuredModel).
-
-			if (!(requester instanceof IStructuredModel || requester instanceof IStructuredDocument)) {
-				resetInternalCommands();
-			}
-		}
-	}
-
-
-
-	public void connect(IDocumentSelectionMediator mediator) {
-		Assert.isNotNull(mediator);
-		if (fDocument == null) {
-			// add this undo manager as structured document listener
-			fDocument = mediator.getDocument();
-			// future_TODO: eventually we want to refactor or allow either
-			// type of document, but for now, we'll do instanceof check, and
-			// fail
-			// if not right type
-			if (fDocument instanceof IStructuredDocument) {
-				((IStructuredDocument) fDocument).addDocumentChangedListener(getInternalStructuredDocumentListener());
-			}
-			else {
-				throw new IllegalArgumentException("only meditator with structured documents currently handled"); //$NON-NLS-1$
-			}
-		}
-		else {
-			// if we've already had our document set, we'll just do this fail
-			// fast integrity check
-			if (!fDocument.equals(mediator.getDocument()))
-				throw new IllegalStateException("Connection to undo manager failed. Document for document selection mediator inconistent with undo manager."); //$NON-NLS-1$
-		}
-
-		addDocumentSelectionMediator(mediator);
-	}
-
-	void createNewTextCommand(String textDeleted, String textInserted, int textStart, int textEnd) {
-		StructuredTextCommandImpl textCommand = new StructuredTextCommandImpl(fDocument);
-		textCommand.setLabel(TEXT_CHANGE_TEXT);
-		textCommand.setDescription(TEXT_CHANGE_TEXT);
-		textCommand.setTextStart(textStart);
-		textCommand.setTextEnd(textEnd);
-		textCommand.setTextDeleted(textDeleted);
-		textCommand.setTextInserted(textInserted);
-
-		if (fRecording) {
-			if (fCompoundCommand == null) {
-				StructuredTextCompoundCommandImpl compoundCommand = new StructuredTextCompoundCommandImpl();
-				compoundCommand.setUndoCursorPosition(fUndoCursorPosition);
-				compoundCommand.setUndoSelectionLength(fUndoSelectionLength);
-
-				compoundCommand.setLabel(fCompoundCommandLabel);
-				compoundCommand.setDescription(fCompoundCommandDescription);
-				compoundCommand.append(textCommand);
-				fCommandStack.execute(compoundCommand);
-
-				fCompoundCommand = compoundCommand;
-			}
-			else {
-				fCompoundCommand.append(textCommand);
-			}
-		}
-		else {
-			fCommandStack.execute(textCommand);
-		}
-
-		fTextCommand = textCommand;
-	}
-
-	/**
-	 * Disable undo management.
-	 */
-	public void disableUndoManagement() {
-		fUndoManagementEnabled = false;
-	}
-
-	public void disconnect(IDocumentSelectionMediator mediator) {
-		removeDocumentSelectionMediator(mediator);
-
-		if (fMediators != null && fMediators.length == 0 && fDocument != null) {
-			// remove this undo manager as structured document listener
-			// future_TODO: eventually we want to refactor or allow either
-			// type of document, but for now, we'll do instanceof check, and
-			// fail
-			// if not right type
-			if (fDocument instanceof IStructuredDocument) {
-				((IStructuredDocument) fDocument).removeDocumentChangedListener(getInternalStructuredDocumentListener());
-			}
-			else {
-				throw new IllegalArgumentException("only meditator with structured documents currently handled"); //$NON-NLS-1$
-			}
-			// if no longer listening to document, then dont even track it
-			// anymore
-			// (this allows connect to reconnect to document again)
-			fDocument = null;
-		}
-	}
-
-	public void enableUndoManagement() {
-		fUndoManagementEnabled = true;
-	}
-
-	public void endRecording(Object requester) {
-		int cursorPosition = (fTextCommand != null) ? fTextCommand.getTextEnd() : -1;
-		int selectionLength = 0;
-
-		endRecording(requester, cursorPosition, selectionLength);
-	}
-
-	public void endRecording(Object requester, int cursorPosition, int selectionLength) {
-		// Recording could be stopped by forceEndOfPendingCommand(). Make sure
-		// we are still recording before proceeding, or else fRecordingCount
-		// may not be balanced.
-		if (fRecording) {
-			if (fCompoundCommand != null) {
-				fCompoundCommand.setRedoCursorPosition(cursorPosition);
-				fCompoundCommand.setRedoSelectionLength(selectionLength);
-			}
-
-			// end recording is a logical stopping point for text command,
-			// even when fRecordingCount > 0 (in nested beginRecording)
-			fTextCommand = null;
-
-			// update counter and flag
-			if (fRecordingCount > 0)
-				fRecordingCount--;
-			if (fRecordingCount == 0) {
-				fRecording = false;
-
-				// reset compound command only when fRecordingCount ==
-				// 0
-				fCompoundCommand = null;
-				fCompoundCommandLabel = null;
-				fCompoundCommandDescription = null;
-
-				// Also reset fRequester
-				fRequester = null;
-			}
-		}
-	}
-
-	/**
-	 * Utility method to find model given document
-	 */
-	private IStructuredModel findStructuredModel(IDocument document) {
-		IModelManager modelManager = StructuredModelManager.getModelManager();
-		IStructuredModel structuredModel = modelManager.getExistingModelForRead(document);
-		return structuredModel;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.undo.IStructuredTextUndoManager#forceEndOfPendingCommand(java.lang.Object,
-	 *      int, int)
-	 */
-	public void forceEndOfPendingCommand(Object requester, int currentPosition, int length) {
-		if (fRecording)
-			endRecording(requester, currentPosition, length);
-		else
-			resetInternalCommands();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.undo.IStructuredTextUndoManager#getCommandStack()
-	 */
-	public CommandStack getCommandStack() {
-		return fCommandStack;
-	}
-
-	/**
-	 * @return
-	 */
-	private CommandStackListener getInternalCommandStackListener() {
-		if (fInternalCommandStackListener == null) {
-			fInternalCommandStackListener = new InternalCommandStackListener();
-		}
-		return fInternalCommandStackListener;
-	}
-
-	/**
-	 * @return
-	 */
-	private IStructuredDocumentListener getInternalStructuredDocumentListener() {
-		if (fInternalStructuredDocumentListener == null) {
-			fInternalStructuredDocumentListener = new InternalStructuredDocumentListener();
-		}
-		return fInternalStructuredDocumentListener;
-	}
-
-	public Command getRedoCommand() {
-		return fCommandStack.getRedoCommand();
-	}
-
-	public Command getUndoCommand() {
-		return fCommandStack.getUndoCommand();
-	}
-
-	public void redo() {
-		redo(null);
-	}
-
-	public void redo(IDocumentSelectionMediator requester) {
-		IStructuredModel model = findStructuredModel(fDocument);
-		if (redoable()) {
-			try {
-				if (model != null)
-					model.aboutToChangeModel();
-
-				Command redoCommand = getRedoCommand();
-
-				// make sure to redo before setting document selection
-				fCommandStack.redo();
-
-				// set document selection
-				setRedoDocumentSelection(requester, redoCommand);
-			}
-			finally {
-				if (model != null) {
-					model.changedModel();
-					model.releaseFromRead();
-				}
-			}
-		}
-	}
-
-	public boolean redoable() {
-		return fCommandStack.canRedo();
-	}
-
-	private void removeDocumentSelectionMediator(IDocumentSelectionMediator mediator) {
-		if (fMediators != null && mediator != null) {
-			// if its not in the array, we'll ignore the request
-			if (Utilities.contains(fMediators, mediator)) {
-				int oldSize = fMediators.length;
-				int newSize = oldSize - 1;
-				IDocumentSelectionMediator[] newMediators = new IDocumentSelectionMediator[newSize];
-				int index = 0;
-				for (int i = 0; i < oldSize; i++) {
-					if (fMediators[i] == mediator) { // ignore
-					}
-					else {
-						// copy old to new if its not the one we are removing
-						newMediators[index++] = fMediators[i];
-					}
-				}
-				// now that we have a new array, let's switch it for the old
-				// one
-				fMediators = newMediators;
-			}
-		}
-	}
-
-	void resetInternalCommands() {
-		// Either the requester of the structured document change event is
-		// changed, or the command stack is changed. Need to reset internal
-		// commands so we won't continue to append changes.
-		fCompoundCommand = null;
-		fTextCommand = null;
-
-		// Also reset fRequester
-		fRequester = null;
-	}
-
-	public void setCommandStack(CommandStack commandStack) {
-		if (fCommandStack != null)
-			fCommandStack.removeCommandStackListener(getInternalCommandStackListener());
-
-		fCommandStack = commandStack;
-
-		if (fCommandStack != null)
-			fCommandStack.addCommandStackListener(getInternalCommandStackListener());
-	}
-
-	private void setRedoDocumentSelection(IDocumentSelectionMediator requester, Command command) {
-		int cursorPosition = -1;
-		int selectionLength = 0;
-
-		if (command instanceof CommandCursorPosition) {
-			CommandCursorPosition commandCursorPosition = (CommandCursorPosition) command;
-			cursorPosition = commandCursorPosition.getRedoCursorPosition();
-			selectionLength = commandCursorPosition.getRedoSelectionLength();
-		}
-		else if (command instanceof StructuredTextCommand) {
-			StructuredTextCommand structuredTextCommand = (StructuredTextCommand) command;
-			cursorPosition = structuredTextCommand.getTextStart();
-			selectionLength = structuredTextCommand.getTextInserted().length();
-		}
-
-		if (cursorPosition > -1 && fMediators != null && fMediators.length > 0) {
-			for (int i = 0; i < fMediators.length; i++) {
-				IDocument document = fMediators[i].getDocument();
-				fMediators[i].undoOperationSelectionChanged(new UndoDocumentEvent(requester, document, cursorPosition, selectionLength));
-			}
-		}
-	}
-
-	private void setUndoDocumentSelection(IDocumentSelectionMediator requester, Command command) {
-		int cursorPosition = -1;
-		int selectionLength = 0;
-
-		if (command instanceof CommandCursorPosition) {
-			CommandCursorPosition commandCursorPosition = (CommandCursorPosition) command;
-			cursorPosition = commandCursorPosition.getUndoCursorPosition();
-			selectionLength = commandCursorPosition.getUndoSelectionLength();
-		}
-		else if (command instanceof StructuredTextCommand) {
-			StructuredTextCommand structuredTextCommand = (StructuredTextCommand) command;
-			cursorPosition = structuredTextCommand.getTextStart();
-			selectionLength = structuredTextCommand.getTextDeleted().length();
-		}
-
-		if (cursorPosition > -1 && fMediators != null && fMediators.length > 0) {
-			for (int i = 0; i < fMediators.length; i++) {
-				IDocument document = fMediators[i].getDocument();
-				fMediators[i].undoOperationSelectionChanged(new UndoDocumentEvent(requester, document, cursorPosition, selectionLength));
-			}
-		}
-	}
-
-	public void undo() {
-		undo(null);
-	}
-
-	public void undo(IDocumentSelectionMediator requester) {
-		// Force an endRecording before undo.
-		//
-		// For example, recording was turned on on the Design Page of
-		// PageDesigner.
-		// Then undo is invoked on the Source Page. Recording should be
-		// stopped before we undo.
-		// Note that redo should not be available when we switch to the Source
-		// Page.
-		// Therefore, this force ending of recording is not needed in redo.
-		if (fRecording)
-			endRecording(this);
-
-		if (undoable()) {
-			IStructuredModel model = findStructuredModel(fDocument);
-			try {
-				if (model != null)
-					model.aboutToChangeModel();
-
-				Command undoCommand = getUndoCommand();
-
-				// make sure to undo before setting document selection
-				fCommandStack.undo();
-
-				// set document selection
-				setUndoDocumentSelection(requester, undoCommand);
-			}
-			finally {
-				if (model != null) {
-					model.changedModel();
-					model.releaseFromRead();
-				}
-			}
-		}
-	}
-
-	public boolean undoable() {
-		return fCommandStack.canUndo();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/UndoDocumentEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/UndoDocumentEvent.java
deleted file mode 100644
index 2f2f8d7..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/UndoDocumentEvent.java
+++ /dev/null
@@ -1,45 +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.sse.core.internal.undo;
-
-import org.eclipse.jface.text.IDocument;
-
-public class UndoDocumentEvent {
-	private IDocument fDocument;
-	private int fLength;
-	private int fOffset;
-	private IDocumentSelectionMediator fRequester;
-
-	public UndoDocumentEvent(IDocumentSelectionMediator requester, IDocument document, int offset, int length) {
-		fRequester = requester;
-		fDocument = document;
-		fOffset = offset;
-		fLength = length;
-	}
-
-	public IDocument getDocument() {
-		return fDocument;
-	}
-
-	public int getLength() {
-		return fLength;
-	}
-
-	public int getOffset() {
-		return fOffset;
-	}
-
-	public IDocumentSelectionMediator getRequester() {
-		return fRequester;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Assert.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Assert.java
deleted file mode 100644
index 3e20a5f..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Assert.java
+++ /dev/null
@@ -1,164 +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.sse.core.internal.util;
-
-
-/**
- * <code>Assert</code> is useful for for embedding runtime sanity checks in
- * code. The predicate methods all test a condition and throw some type of
- * unchecked exception if the condition does not hold.
- * <p>
- * Assertion failure exceptions, like most runtime exceptions, are thrown when
- * something is misbehaving. Assertion failures are invariably unspecified
- * behavior; consequently, clients should never rely on these being thrown
- * (and certainly should not being catching them specifically).
- * </p>
- */
-public final class Assert {
-
-	/**
-	 * <code>AssertionFailedException</code> is a runtime exception thrown
-	 * by some of the methods in <code>Assert</code>.
-	 * <p>
-	 * This class is not declared public to prevent some misuses; programs
-	 * that catch or otherwise depend on assertion failures are susceptible to
-	 * unexpected breakage when assertions in the code are added or removed.
-	 * </p>
-	 */
-	class AssertionFailedException extends RuntimeException {
-		/**
-		 * Comment for <code>serialVersionUID</code>
-		 */
-		private static final long serialVersionUID = 1L;
-
-		/**
-		 * Constructs a new exception.
-		 */
-		public AssertionFailedException() {
-			super();
-		}
-
-		/**
-		 * Constructs a new exception with the given message.
-		 */
-		public AssertionFailedException(String detail) {
-			super(detail);
-		}
-	}
-
-	/**
-	 * Asserts that an argument is legal. If the given boolean is not
-	 * <code>true</code>, an <code>IllegalArgumentException</code> is
-	 * thrown.
-	 * 
-	 * @param expression
-	 *            the outcode of the check
-	 * @return <code>true</code> if the check passes (does not return if the
-	 *         check fails)
-	 * @exception IllegalArgumentException
-	 *                if the legality test failed
-	 */
-	public static boolean isLegal(boolean expression) {
-		return isLegal(expression, ""); //$NON-NLS-1$
-	}
-
-	/**
-	 * Asserts that an argument is legal. If the given boolean is not
-	 * <code>true</code>, an <code>IllegalArgumentException</code> is
-	 * thrown. The given message is included in that exception, to aid
-	 * debugging.
-	 * 
-	 * @param expression
-	 *            the outcode of the check
-	 * @param message
-	 *            the message to include in the exception
-	 * @return <code>true</code> if the check passes (does not return if the
-	 *         check fails)
-	 * @exception IllegalArgumentException
-	 *                if the legality test failed
-	 */
-	public static boolean isLegal(boolean expression, String message) {
-		if (!expression)
-			throw new IllegalArgumentException();
-		return expression;
-	}
-
-	/**
-	 * Asserts that the given object is not <code>null</code>. If this is
-	 * not the case, some kind of unchecked exception is thrown.
-	 * 
-	 * @param object
-	 *            the value to test
-	 * @exception IllegalArgumentException
-	 *                if the object is <code>null</code>
-	 */
-	public static void isNotNull(Object object) {
-		isNotNull(object, ""); //$NON-NLS-1$
-	}
-
-	/**
-	 * Asserts that the given object is not <code>null</code>. If this is
-	 * not the case, some kind of unchecked exception is thrown. The given
-	 * message is included in that exception, to aid debugging.
-	 * 
-	 * @param object
-	 *            the value to test
-	 * @param message
-	 *            the message to include in the exception
-	 * @exception IllegalArgumentException
-	 *                if the object is <code>null</code>
-	 */
-	public static void isNotNull(Object object, String message) {
-		if (object == null) {
-			//Logger.log(Logger.ERROR, "null_argument: " + message); //$NON-NLS-1$
-			throw new Assert().new AssertionFailedException();
-		}
-	}
-
-	/**
-	 * Asserts that the given boolean is <code>true</code>. If this is not
-	 * the case, some kind of unchecked exception is thrown.
-	 * 
-	 * @param expression
-	 *            the outcode of the check
-	 * @return <code>true</code> if the check passes (does not return if the
-	 *         check fails)
-	 */
-	public static boolean isTrue(boolean expression) {
-		return isTrue(expression, ""); //$NON-NLS-1$
-	}
-
-	/**
-	 * Asserts that the given boolean is <code>true</code>. If this is not
-	 * the case, some kind of unchecked exception is thrown. The given message
-	 * is included in that exception, to aid debugging.
-	 * 
-	 * @param expression
-	 *            the outcode of the check
-	 * @param message
-	 *            the message to include in the exception
-	 * @return <code>true</code> if the check passes (does not return if the
-	 *         check fails)
-	 */
-	public static boolean isTrue(boolean expression, String message) {
-		if (!expression) {
-			throw new Assert().new AssertionFailedException();
-		}
-		return expression;
-	}
-
-	/* This class is not intended to be instantiated. */
-	private Assert() {
-		super();
-	}
-}
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
deleted file mode 100644
index e6bcf94..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java
+++ /dev/null
@@ -1,207 +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.sse.core.internal.util;
-
-
-
-import java.util.Enumeration;
-
-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.ITextRegionCollection;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-
-
-public final class Debug {
-	public static final boolean checkForMemoryLeaks = false;
-
-	public static final boolean collectStats = false;
-
-	public static final int DEBUG = 0;
-
-	public static final boolean DEBUG_THREADLOCAL = false;
-
-	public static final boolean debugBreakpoints = false;
-	public static final boolean debugCaretMediator = false;
-	public static final boolean debugDisplayTreePositions = false;
-	//
-	public static final boolean debugMediator = false;
-	//
-	public static final boolean debugNotification = false;
-	public static final boolean debugNotificationAndEvents = false;
-
-	public static final boolean debugNotifyDeferred = false;
-	public static final boolean debugReconciling = false;
-	//
-	public static final boolean debugRtfFormatProvider = false;
-	//
-	public static final boolean debugStructuredDocument = false;
-	public static final boolean debugTaglibs = false;
-	//
-	public static final boolean debugTokenizer = false;
-	//
-	public static final boolean debugTreeModel = false;
-	public static final boolean debugUpdateTreePositions = false;
-	public static final boolean displayInfo = false;
-
-	/** effects output of Logger */
-	public static final boolean displayToConsole = true;
-	public static final boolean displayWarnings = false;
-	//
-	public static final boolean failedTests = false;
-	public static final boolean headParsing = false;
-	public static final boolean jsDebugContextAssist = false;
-	//
-	public static final boolean jsDebugSyntaxColoring = false;
-
-	public static final boolean LOCKS = false;
-	// 
-	public static final boolean perfTest = false;
-	public static final boolean perfTestAdapterClassLoading = false;
-	public static final boolean perfTestFormat = false;
-	public static final boolean perfTestRawStructuredDocumentOnly = false;
-	public static final boolean perfTestStructuredDocumentEventOnly = false;
-	public static final boolean perfTestStructuredDocumentOnly = false;
-
-	//
-	public static final boolean syntaxHighlighting = false;
-	//
-	public static final boolean useStandardEolInWidget = false;
-
-	/**
-	 * For tests and debug only
-	 */
-
-	public static final void dump(IStructuredDocument structuredDocument) {
-		dump(structuredDocument, false);
-	}
-
-	public static final void dump(IStructuredDocument structuredDocument, boolean verbose) {
-		ITextRegionCollection flatNode = null;
-		System.out.println("Dump of structuredDocument:"); //$NON-NLS-1$
-		IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
-		Enumeration structuredDocumentRegions = flatNodes.elements();
-		while (structuredDocumentRegions.hasMoreElements()) {
-			flatNode = (ITextRegionCollection) structuredDocumentRegions.nextElement();
-			if (!verbose) {
-				String outString = flatNode.toString();
-				outString = org.eclipse.wst.sse.core.internal.util.StringUtils.escape(outString);
-				System.out.println(outString);
-			} else {
-				dump(flatNode, verbose);
-			}
-		}
-		System.out.println();
-		System.out.println("= = = = = ="); //$NON-NLS-1$
-		System.out.println();
-	}
-
-	/**
-	 * @param flatNode
-	 * @param verbose
-	 */
-	public static final void dump(ITextRegionCollection region, boolean verbose) {
-		if (region == null)
-			return;
-		if (verbose) {
-			printParent(region);
-		}
-		printChildRegions(region, 0);
-	}
-
-	private static void printChildRegions(ITextRegionCollection region, int depth) {
-		if (region != null) {
-			// ==> // ITextRegionCollection regionCollection = region;
-			System.out.println(region);
-			ITextRegionList regionList = region.getRegions();
-			for (int i = 0; i < regionList.size(); i++) {
-				ITextRegion r = regionList.get(i);
-				if (r instanceof ITextRegionCollection) {
-					ITextRegionCollection rc = (ITextRegionCollection) r;
-					printChildRegions(rc, depth++);
-				} else {
-					System.out.println(space(depth) + r);
-					depth--;
-				}
-			}
-		}
-	}
-
-	/**
-	 * Simple utility to make sure println's are some what in order
-	 */
-	public static final synchronized void println(String msg) {
-		System.out.println(System.currentTimeMillis() + "\t" + msg); //$NON-NLS-1$
-	}
-
-	private static void printParent(IStructuredDocumentRegion region) {
-		System.out.println("    [parent document: " + toStringUtil(region.getParentDocument()) + "]"); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	private static void printParent(ITextRegionCollection region) {
-		if (region instanceof IStructuredDocumentRegion) {
-			printParent((IStructuredDocumentRegion) region);
-		} else if (region instanceof ITextRegionContainer) {
-			printParent((ITextRegionContainer) region);
-		} else
-			System.out.println("    [parent document: " + "(na)" + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-	}
-
-	private static void printParent(ITextRegionContainer region) {
-		System.out.println("    [parent document: " + toStringUtil(region.getParent()) + "]"); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	/**
-	 * @param depth
-	 * @return
-	 */
-	private static String space(int depth) {
-		String result = "  "; //$NON-NLS-1$
-		for (int i = 0; i < depth; i++) {
-			result += "  "; //$NON-NLS-1$
-		}
-		return result;
-	}
-
-	public static final String toStringUtil(IStructuredDocument object) {
-		String className = object.getClass().getName();
-		String shortClassName = className.substring(className.lastIndexOf(".") + 1); //$NON-NLS-1$
-		String result = shortClassName;
-		// 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;
-
-	}
-
-	public static final String toStringUtil(ITextRegionCollection object) {
-		String className = object.getClass().getName();
-		String shortClassName = className.substring(className.lastIndexOf(".") + 1); //$NON-NLS-1$
-		String result = shortClassName;
-		// 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;
-
-	}
-
-	/**
-	 * Debug constructor comment.
-	 */
-	public Debug() {
-		super();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/DocumentInputStream.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/DocumentInputStream.java
deleted file mode 100644
index 6c259a2..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/DocumentInputStream.java
+++ /dev/null
@@ -1,108 +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.sse.core.internal.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-
-public class DocumentInputStream extends InputStream {
-	private IDocument fDocument;
-	private int fMark = -1;
-	private int fPosition = 0;
-
-	public DocumentInputStream(IDocument source) {
-		super();
-		fDocument = source;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#available()
-	 */
-	public int available() throws IOException {
-		return fDocument.getLength() - fPosition;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#close()
-	 */
-	public void close() throws IOException {
-		this.fDocument = null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#mark(int)
-	 */
-	public synchronized void mark(int readlimit) {
-		fMark = fPosition;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#markSupported()
-	 */
-	public boolean markSupported() {
-		return true;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#read()
-	 */
-	public int read() throws IOException {
-		try {
-			if (fPosition < fDocument.getLength())
-				return fDocument.getChar(fPosition++);
-			else
-				return -1;
-		} catch (BadLocationException e) {
-			throw new IOException(e.getMessage());
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#reset()
-	 */
-	public synchronized void reset() throws IOException {
-		fPosition = fMark;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.io.InputStream#skip(long)
-	 */
-	public long skip(long n) throws IOException {
-		long skipped = n;
-		if (n < fDocument.getLength() - fPosition) {
-			skipped = n;
-			fPosition += skipped;
-		} else {
-			skipped = fDocument.getLength() - fPosition;
-			fPosition = fDocument.getLength();
-		}
-		return skipped;
-	}
-}
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
deleted file mode 100644
index b9463b9..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/JarUtilities.java
+++ /dev/null
@@ -1,180 +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.sse.core.internal.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipException;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.wst.sse.core.internal.Logger;
-
-
-public class JarUtilities {
-
-	/**
-	 * @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."
-	 */
-	public static final String JSP11_TAGLIB = "META-INF/taglib.tld"; //$NON-NLS-1$
-
-	public static 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$
-		}
-	}
-
-	/**
-	 * Provides a stream to a local copy of the input or null if not possible
-	 */
-	protected static InputStream getCachedInputStream(String jarFilename, String entryName) {
-		File testFile = new File(jarFilename);
-		if (!testFile.exists())
-			return null;
-
-		InputStream cache = null;
-		ZipFile jarfile = null;
-		try {
-			jarfile = new ZipFile(jarFilename);
-		}
-		catch (IOException ioExc) {
-			Logger.logException("JarUtilities: " + jarFilename, ioExc); //$NON-NLS-1$
-			closeJarFile(jarfile);
-		}
-
-		if (jarfile != null) {
-			try {
-				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;
-						ByteArrayOutputStream buffer = null;
-						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);
-							}
-							cache = new ByteArrayInputStream(buffer.toByteArray());
-							closeJarFile(jarfile);
-						}
-						catch (IOException ioe) {
-							// no cleanup can be done
-						}
-						finally {
-							try {
-								entryInputStream.close();
-							}
-							catch (IOException e) {
-							}
-						}
-					}
-				}
-			}
-			finally {
-				closeJarFile(jarfile);
-			}
-		}
-		return cache;
-	}
-
-	public static String[] getEntryNames(IResource jarResource) {
-		if (jarResource == null || jarResource.getLocation() == null)
-			return new String[0];
-		return getEntryNames(jarResource.getLocation().toString());
-	}
-
-	public static String[] getEntryNames(String jarFilename) {
-		return getEntryNames(jarFilename, true);
-	}
-
-	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());
-			}
-		}
-		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);
-		}
-		String[] names = (String[]) entryNames.toArray(new String[0]);
-		return names;
-	}
-
-	public static InputStream getInputStream(IResource jarResource, String entryName) {
-		if (jarResource == null)
-			return null;
-		return getInputStream(jarResource.getLocation().toString(), entryName);
-	}
-
-	public static InputStream getInputStream(String jarFilename, String entryName) {
-		// check sanity
-		if (jarFilename == null || jarFilename.length() < 1 || entryName == null || entryName.length() < 1)
-			return null;
-
-		// JAR files are not allowed to have leading '/' in member names
-		String internalName = null;
-		if (entryName.startsWith("/")) //$NON-NLS-1$
-			internalName = entryName.substring(1);
-		else
-			internalName = entryName;
-
-		return getCachedInputStream(jarFilename, internalName);
-	}
-}
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
deleted file mode 100644
index 210aed3..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java
+++ /dev/null
@@ -1,148 +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.sse.core.internal.util;
-
-
-
-import java.io.File;
-import java.util.StringTokenizer;
-
-/**
- * Collection of helper methods to manage and convert links Originally part of
- * the LinksManager 
- */
-public class PathHelper {
-	public static final String BACKWARD_SLASH = "\\";//$NON-NLS-1$
-
-	public static final String FORWARD_SLASH = "/";//$NON-NLS-1$
-	public static final String RELATIVE_PATH_SIG = "../";//$NON-NLS-1$
-
-	/**
-	 * adjust relative path isside the absolute path
-	 */
-	public static String adjustPath(String path) {
-		int i = 0;
-		while ((i = path.indexOf(RELATIVE_PATH_SIG)) > 0) {
-			// split the string into two
-			String part1 = path.substring(0, i - 1);
-			String part2 = path.substring(i + RELATIVE_PATH_SIG.length() - 1);
-			// strip one path seg from part1
-			int j = part1.lastIndexOf(FORWARD_SLASH);
-			if (j == -1) {
-				// can't resolve. passed path is like
-				// E:/eclipseproject/../../sample.css.
-				return "";//$NON-NLS-1$
-			}
-			part1 = part1.substring(0, j);
-			path = part1 + part2;
-		}
-		return path;
-	}
-
-	/**
-	 * Append trailing url slash if needed
-	 */
-	public static String appendTrailingURLSlash(String input) {
-		// check to see already a slash
-		if (!input.endsWith(FORWARD_SLASH)) {
-			input += FORWARD_SLASH;
-		}
-		return input;
-	}
-
-	/**
-	 * Convert to relative url based on base
-	 */
-	public static String convertToRelative(String input, String base) {
-		// tokenize the strings
-		StringTokenizer inputTokenizer = new StringTokenizer(input, FORWARD_SLASH);
-		StringTokenizer baseTokenizer = new StringTokenizer(base, FORWARD_SLASH);
-		String token1 = "", token2 = "";//$NON-NLS-2$//$NON-NLS-1$
-		//
-		// Go through until equls
-		while (true) {
-			if (!inputTokenizer.hasMoreTokens() || !baseTokenizer.hasMoreTokens())
-				break;
-			token1 = baseTokenizer.nextToken();
-			token2 = inputTokenizer.nextToken();
-			if (!token1.equals(token2))
-				break;
-		}
-		// now generate the backs
-		String output = "";//$NON-NLS-1$
-		while (baseTokenizer.hasMoreTokens()) {
-			baseTokenizer.nextToken();
-			output += "../"; //$NON-NLS-1$
-		}
-		output += token2;
-		// generate the rest
-		while (inputTokenizer.hasMoreTokens()) {
-			output = output + FORWARD_SLASH + inputTokenizer.nextToken();
-		}
-		return output;
-	}
-
-	/**
-	 * Return the containing folder path. Will handle both url and file path
-	 */
-	public static String getContainingFolderPath(String path) {
-		String retValue = path;
-
-		int urlSlashIndex = path.lastIndexOf(FORWARD_SLASH);
-		int filePathSlashIndex = path.lastIndexOf(File.separator);
-		int index = filePathSlashIndex;
-		if (urlSlashIndex > filePathSlashIndex)
-			index = urlSlashIndex;
-		if (index >= 0)
-			retValue = path.substring(0, index);
-		return retValue;
-	}
-
-	/**
-	 * Remove leading path separator
-	 */
-	public static String removeLeadingPathSeparator(String path) {
-		if (path.startsWith(File.separator))
-			path = path.substring(File.separator.length());
-		return path;
-	}
-
-	/**
-	 * Remove leading path separator
-	 */
-	public static String removeLeadingSeparator(String path) {
-		if (path.startsWith(File.separator))
-			path = path.substring(File.separator.length());
-		else if (path.startsWith(FORWARD_SLASH) || path.startsWith(BACKWARD_SLASH))
-			path = path.substring(FORWARD_SLASH.length());
-		return path;
-	}
-
-	/**
-	 * Switch to file path slashes
-	 */
-	public static String switchToFilePathSlashes(String path) {
-		path = path.replace(FORWARD_SLASH.charAt(0), File.separatorChar);
-		path = path.replace(BACKWARD_SLASH.charAt(0), File.separatorChar);
-		return path;
-	}
-
-	/**
-	 * Switch to file path slashes
-	 */
-	public static String switchToForwardSlashes(String path) {
-		path = path.replace(File.separatorChar, FORWARD_SLASH.charAt(0));
-		path = path.replace(BACKWARD_SLASH.charAt(0), FORWARD_SLASH.charAt(0));
-		return path;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ProjectResolver.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ProjectResolver.java
deleted file mode 100644
index 4a7a937..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ProjectResolver.java
+++ /dev/null
@@ -1,234 +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.sse.core.internal.util;
-
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-
-/**
- * @deprecated The URIResolver interface is deprecated. Use the resolver from
- *             org.eclipse.wst.common.uriresolver.
- */
-public class ProjectResolver implements URIResolver {
-	private String fFileBaseLocation = null;
-	private IProject fProject = null;
-
-	/**
-	 * It is strongly recommended that clients use
-	 * project.getAdapter(URIResolver.class) to obtain a URIResolver aware of
-	 * the Project's special requirements. Note that a URIResolver may not be
-	 * returned at all so manually creating this object may still be required.
-	 */
-	public ProjectResolver(IProject project) {
-		super();
-		fProject = project;
-	}
-
-	public String getFileBaseLocation() {
-		return fFileBaseLocation;
-	}
-
-	public String getLocationByURI(String uri) {
-		return getLocationByURI(uri, getFileBaseLocation());
-	}
-
-	// defect 244817 end
-	/**
-	 * Resolve the (possibly relative) URI acording to RFC1808 using the
-	 * default file base location. Resolves resource references into absolute
-	 * resource locations without ensuring that the resource actually exists.
-	 * 
-	 * Note: currently resolveCrossProjectLinks is ignored in this
-	 * implementation.
-	 */
-	public String getLocationByURI(String uri, boolean resolveCrossProjectLinks) {
-		return getLocationByURI(uri, getFileBaseLocation(), resolveCrossProjectLinks);
-	}
-
-	public String getLocationByURI(String uri, String baseReference) {
-		if (uri == null)
-			return null;
-		/*
-		 * defect 244817 try { URL aURL = new URL(uri);
-		 */
-		/**
-		 * An actual URL was given, but only the "file:///" protocol is
-		 * supported. Resolve the URI by finding the file to which it points.
-		 */
-		/*
-		 * defect 244817 if (!aURL.getProtocol().equals("platform")) {
-		 * //$NON-NLS-1$ if (aURL.getProtocol().equals("file") &&
-		 * (aURL.getHost().equals("localhost") || aURL.getHost().length() ==
-		 * 0)) { //$NON-NLS-2$//$NON-NLS-1$ return aURL.getFile(); } return
-		 * uri; } } catch (MalformedURLException mfuExc) { }
-		 */
-		// defect 244817 start
-		if (isFileURL(uri)) {
-			try {
-				URL url = new URL(uri);
-				return getPath(url);
-			}
-			catch (MalformedURLException e) {
-			}
-		}
-		// defect 244817 end
-
-		// which of the serveral are we suppose to use here?
-		//
-
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71223
-		// Workaround for problem in URIHelper; uris starting with '/' are
-		// returned as-is.
-		String location = uri;
-		if (uri.startsWith("/")) { //$NON-NLS-1$
-			IProject p = getProject();
-			if (p != null && p.exists())
-				location = p.getLocation().toString() + uri;
-		}
-		else {
-			location = URIHelper.normalize(uri, baseReference, getRootLocationString());
-		}
-		return location;
-	}
-
-	/**
-	 * Perform the getLocationByURI action using the baseReference as the
-	 * point of reference instead of the default for this resolver
-	 * 
-	 * Note: currently resolveCrossProjectLinks is ignored in this
-	 * implementation.
-	 */
-	public String getLocationByURI(String uri, String baseReference, boolean resolveCrossProjectLinks) {
-		return getLocationByURI(uri, baseReference);
-	}
-
-	/**
-	 * 
-	 * @param path
-	 * @param host
-	 * @return String
-	 */
-	private String getPath(IPath path, String host) {
-		IPath newPath = path;
-		// They are potentially for only Windows operating system.
-		// a.) if path has a device, and if it begins with IPath.SEPARATOR,
-		// remove it
-		final String device = path.getDevice();
-		if ((device != null) && (device.length() > 0)) {
-			if (device.charAt(0) == IPath.SEPARATOR) {
-				final String newDevice = device.substring(1);
-				newPath = path.setDevice(newDevice);
-			}
-		}
-		// b.) if it has a hostname, it is UNC name... Any java or eclipse api
-		// helps it ??
-		if (path != null && host != null && host.length() != 0) {
-			IPath uncPath = new Path(host);
-			uncPath = uncPath.append(path);
-			newPath = uncPath.makeUNC(true);
-		}
-		return newPath.toString();
-	}
-
-	/**
-	 * 
-	 * @param url
-	 * @return String
-	 */
-	private String getPath(URL url) {
-		String ref = url.getRef() == null ? "" : "#" + url.getRef(); //$NON-NLS-1$ //$NON-NLS-2$
-		String strPath = url.getFile() + ref;
-		IPath path;
-		if (strPath.length() == 0) {
-			path = Path.ROOT;
-		}
-		else {
-			path = new Path(strPath);
-			String query = null;
-			StringTokenizer parser = new StringTokenizer(strPath, "?"); //$NON-NLS-1$
-			int tokenCount = parser.countTokens();
-			if (tokenCount == 2) {
-				path = new Path((String) parser.nextElement());
-				query = (String) parser.nextElement();
-			}
-			if (query == null) {
-				parser = new StringTokenizer(path.toString(), "#"); //$NON-NLS-1$
-				tokenCount = parser.countTokens();
-				if (tokenCount == 2) {
-					path = new Path((String) parser.nextElement());
-				}
-			}
-		}
-		return getPath(path, url.getHost());
-	}
-
-	public org.eclipse.core.resources.IProject getProject() {
-		return fProject;
-	}
-
-	public org.eclipse.core.resources.IContainer getRootLocation() {
-		return fProject;
-	}
-
-	protected String getRootLocationString() {
-		return fProject.getLocation().toString();
-	}
-
-	public InputStream getURIStream(String uri) {
-		return null;
-	}
-
-	// defect 244817 start
-	/**
-	 * 
-	 * @param passedSpec
-	 * @return boolean
-	 */
-	private boolean isFileURL(String passedSpec) {
-		if (passedSpec == null) {
-			return false;
-		}
-		final String spec = passedSpec.trim();
-		if (spec.length() == 0) {
-			return false;
-		}
-		final int limit = spec.length();
-		String newProtocol = null;
-		for (int index = 0; index < limit; index++) {
-			final char p = spec.charAt(index);
-			if (p == '/') { //$NON-NLS-1$
-				break;
-			}
-			if (p == ':') { //$NON-NLS-1$
-				newProtocol = spec.substring(0, index);
-				break;
-			}
-		}
-		return (newProtocol != null && newProtocol.compareToIgnoreCase("file") == 0); //$NON-NLS-1$
-	}
-
-	public void setFileBaseLocation(String newFileBaseLocation) {
-		fFileBaseLocation = newFileBaseLocation;
-	}
-
-	public void setProject(IProject newProject) {
-		fProject = newProject;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ResourceUtil.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ResourceUtil.java
deleted file mode 100644
index 0b2c8c3..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ResourceUtil.java
+++ /dev/null
@@ -1,79 +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.sse.core.internal.util;
-
-import org.eclipse.core.resources.IFile;
-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.wst.sse.core.internal.provisional.IStructuredModel;
-
-
-/**
- * @deprecated - makes assumptions on behalf of the requester
- */
-public class ResourceUtil {
-
-	/**
-	 * Obtains the IFile for a model
-	 * 
-	 * @param model
-	 *            the model to use
-	 * @return the IFile used to create the model, if it came from an IFile,
-	 *         null otherwise
-	 */
-	public static IFile getFileFor(IStructuredModel model) {
-		if (model == null)
-			return null;
-		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-		IFile file = null;
-		IPath location = new Path(model.getBaseLocation());
-		// if the path is not a path in the file system and there are at least
-		// 2 segments, it might be in the workspace
-		IFile[] files = root.findFilesForLocation(location);
-		if (files.length > 0) {
-			file = files[0];
-		}
-		else if (location.segmentCount() > 1) {
-			// remember, this IFile isn't guaranteed to exist
-			file = root.getFile(location);
-		}
-		return file;
-	}
-
-	/**
-	 * Obtain IFiles from IStructuredModel (includes linkedResources)
-	 * 
-	 * @return the corresponding files in the workspace, or an empty array if
-	 *         none
-	 */
-	public static IFile[] getFilesFor(IStructuredModel model) {
-		if (model == null)
-			return null;
-
-		IFile[] files = null;
-		IPath location = new Path(model.getBaseLocation());
-		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-		// if the path is not a path in the file system and there are at least
-		// 2 segments, it might be in the workspace
-		if (!location.toFile().exists() && location.segmentCount() > 1) {
-			// remember, this IFile isn't guaranteed to exist
-			files = new IFile[]{root.getFile(location)};
-		}
-		else {
-			files = root.findFilesForLocation(location);
-		}
-		return files;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ScriptLanguageKeys.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ScriptLanguageKeys.java
deleted file mode 100644
index 56e268b..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ScriptLanguageKeys.java
+++ /dev/null
@@ -1,39 +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.sse.core.internal.util;
-
-/**
- * Contains list of script languages and mime types
- */
-public interface ScriptLanguageKeys {
-
-	public static final String JAVA = "java"; //$NON-NLS-1$
-
-	public static final String[] JAVA_LANGUAGE_KEYS = new String[]{"java"}; //$NON-NLS-1$
-
-	public static final String JAVASCRIPT = "javascript"; //$NON-NLS-1$
-	public static final String[] JAVASCRIPT_LANGUAGE_KEYS = {"javascript", //$NON-NLS-1$
-				"javascript1.0", //$NON-NLS-1$
-				"javascript1.1", //$NON-NLS-1$
-				"javascript1.2", //$NON-NLS-1$
-				"javascript1.3", //$NON-NLS-1$
-				"javascript1.4", //$NON-NLS-1$
-				"javascript1.5", //$NON-NLS-1$
-				"javascript1.6", //$NON-NLS-1$
-				"jscript", //$NON-NLS-1$
-				"sashscript"}; //$NON-NLS-1$
-
-	public static final String[] JAVASCRIPT_MIME_TYPE_KEYS = {"text/javascript", //$NON-NLS-1$
-				"text/jscript", //$NON-NLS-1$
-				"text/sashscript"}; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/StringUtils.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/StringUtils.java
deleted file mode 100644
index 76e0afe..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/StringUtils.java
+++ /dev/null
@@ -1,743 +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.sse.core.internal.util;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.sse.core.internal.Logger;
-
-
-public class StringUtils {
-	protected static final String AMPERSTAND = "&"; //$NON-NLS-1$
-	protected static final String AMPERSTAND_ENTITY = "&&;"; //$NON-NLS-1$
-	protected static final String CARRIAGE_RETURN = "\r"; //$NON-NLS-1$
-	protected static final String CARRIAGE_RETURN_ENTITY = "\\r"; //$NON-NLS-1$
-	protected static final String CR = "\r"; //$NON-NLS-1$
-	protected static final String CRLF = "\r\n"; //$NON-NLS-1$
-	protected static final String DELIMITERS = " \t\n\r\f"; //$NON-NLS-1$
-	protected static final String DOUBLE_QUOTE = "\""; //$NON-NLS-1$
-	protected static final char DOUBLE_QUOTE_CHAR = '\"'; //$NON-NLS-1$
-	protected static final String DOUBLE_QUOTE_ENTITY = "&quot;"; //$NON-NLS-1$
-
-	protected static final String EQUAL_SIGN = "="; //$NON-NLS-1$
-	protected static final String EQUAL_SIGN_ENTITY = "&#61;"; //$NON-NLS-1$
-	private static final String FALSE = "false"; //$NON-NLS-1$
-	protected static final String GREATER_THAN = ">"; //$NON-NLS-1$
-	protected static final String GREATER_THAN_ENTITY = "&gt;"; //$NON-NLS-1$
-	protected static final String LESS_THAN = "<"; //$NON-NLS-1$
-	protected static final String LESS_THAN_ENTITY = "&lt;"; //$NON-NLS-1$
-	protected static final String LF = "\n"; //$NON-NLS-1$
-	protected static final String LINE_FEED = "\n"; //$NON-NLS-1$
-	protected static final String LINE_FEED_ENTITY = "\\n"; //$NON-NLS-1$
-	protected static final String LINE_FEED_TAG = "<dl>"; //$NON-NLS-1$
-	protected static final String LINE_TAB = "\t"; //$NON-NLS-1$
-	protected static final String LINE_TAB_ENTITY = "\\t"; //$NON-NLS-1$
-	protected static final String LINE_TAB_TAG = "<dd>"; //$NON-NLS-1$
-	protected static final String SINGLE_QUOTE = "'"; //$NON-NLS-1$
-	protected static final char SINGLE_QUOTE_CHAR = '\''; //$NON-NLS-1$
-	protected static final String SINGLE_QUOTE_ENTITY = "&#039;"; //$NON-NLS-1$
-	protected static final String SPACE = " "; //$NON-NLS-1$
-	protected static final String SPACE_ENTITY = "&nbsp;"; //$NON-NLS-1$
-	private static final String TRUE = "true"; //$NON-NLS-1$
-
-	/**
-	 * Append appendString to the end of aString only if aString does not end
-	 * with the insertString.
-	 */
-	public static String appendIfNotEndWith(String aString, String appendString) {
-		if ((aString != null) && (appendString != null))
-			if (aString.endsWith(appendString))
-				return aString;
-			else
-				return aString + appendString;
-		else
-			return aString;
-	}
-
-	/**
-	 * Breaks out space-separated words into an array of words. For example:
-	 * <code>"no comment"</code> into an array <code>a[0]="no"</code> and
-	 * <code>a[1]= "comment"</code>.
-	 * 
-	 * @param value
-	 *            the string to be converted
-	 * @return the list of words
-	 */
-	public static String[] asArray(String value) {
-		ArrayList list = new ArrayList();
-		StringTokenizer stok = new StringTokenizer(value);
-		while (stok.hasMoreTokens()) {
-			list.add(stok.nextToken());
-		}
-		String result[] = new String[list.size()];
-		list.toArray(result);
-		return result;
-	}
-
-	/**
-	 * Breaks out delim-separated words into an array of words. For example:
-	 * <code>"no comment"</code> into an array <code>a[0]="no"</code> and
-	 * <code>a[1]= "comment"</code>.
-	 * 
-	 * @param value
-	 *            the string to be converted
-	 * @return the list of words
-	 */
-	public static String[] asArray(String value, String delim) {
-		return asArray(value, delim, false);
-	}
-
-	/**
-	 * Breaks out delim-separated words into an array of words. For example:
-	 * <code>"no comment"</code> into an array <code>a[0]="no"</code> and
-	 * <code>a[1]= "comment"</code>.
-	 * 
-	 * @param value
-	 *            the string to be converted
-	 * @return the list of words
-	 */
-	public static String[] asArray(String value, String delim, boolean returnTokens) {
-		ArrayList list = new ArrayList();
-		StringTokenizer stok = new StringTokenizer(value, delim, returnTokens);
-		while (stok.hasMoreTokens()) {
-			list.add(stok.nextToken());
-		}
-		String result[] = new String[list.size()];
-		list.toArray(result);
-		return result;
-	}
-
-	/**
-	 * Breaks out delim-separated words into an array of words. For example:
-	 * <code>"abc,,def"</code> into an array <code>a[0]="abc"</code>,
-	 * <code>a[1]=null</code>, and <code>a[2]= "def"</code> where "," is
-	 * the delim.
-	 * 
-	 * @param value
-	 *            the string to be converted
-	 * @return the list of words
-	 */
-	public static String[] asFixedArray(String value, String delim) {
-		String array[] = asArray(value, delim, true);
-		int arrayLength = array.length;
-		boolean stringFound = false;
-		ArrayList list = new ArrayList();
-
-		for (int i = 0; i < arrayLength; i++) {
-			String token = array[i];
-			if (token.compareTo(delim) == 0) {
-				if (!stringFound)
-					list.add(null);
-				stringFound = false;
-			}
-			else {
-				list.add(token);
-				stringFound = true;
-			}
-		}
-		// add one more null if last token is the delim
-		if (!stringFound)
-			list.add(null);
-
-		String result[] = new String[list.size()];
-		list.toArray(result);
-		return result;
-	}
-
-	public static String chop(String source) {
-		return chop(source, "/"); //$NON-NLS-1$
-	}
-
-	public static String chop(String source, String delimiter) {
-		return source.substring(0, source.lastIndexOf(delimiter));
-	}
-
-	public static boolean contains(String[] arrayOfStrings, String needle, boolean caseSensitive) {
-		boolean result = false;
-		if (needle == null)
-			return false;
-		if (arrayOfStrings == null)
-			return false;
-
-		if (caseSensitive) {
-			for (int i = 0; i < arrayOfStrings.length; i++) {
-				if (needle.equals(arrayOfStrings[i])) {
-					result = true;
-					break;
-				}
-			}
-		}
-		else {
-			for (int i = 0; i < arrayOfStrings.length; i++) {
-				if (needle.equalsIgnoreCase(arrayOfStrings[i])) {
-					result = true;
-					break;
-				}
-			}
-		}
-		return result;
-	}
-
-	public static boolean containsLetters(String fullValue) {
-
-		if (fullValue == null || fullValue.length() == 0)
-			return false;
-
-		char[] chars = fullValue.toCharArray();
-		for (int i = 0; i < fullValue.length(); i++)
-			if (Character.isLetter(chars[i]))
-				return true;
-
-		return false;
-	}
-
-	public static boolean containsLineDelimiter(String aString) {
-		return indexOfLineDelimiter(aString) != -1;
-	}
-
-	public static String convertLineDelimiters(String allText, String lineDelimiterToUse) {
-		IDocument tempDoc = new Document(allText);
-
-		if (lineDelimiterToUse == null)
-			lineDelimiterToUse = System.getProperty("line.separator"); //$NON-NLS-1$
-
-		String newText = ""; //$NON-NLS-1$
-		int lineCount = tempDoc.getNumberOfLines();
-		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);
-
-				if ((i < lineCount - 1) && (tempDoc.getLineDelimiter(i) != null))
-					newText += lineDelimiterToUse;
-			}
-			catch (BadLocationException e) {
-				// log for now, unless we find reason not to
-				Logger.log(Logger.INFO, e.getMessage());
-			}
-		}
-
-		return newText;
-	}
-
-	/**
-	 * Replaces all instances of special HTML characters with the appropriate
-	 * HTML entity equivalent. WARNING only use this method for strings that
-	 * dont already have HTML-specific items such as tags and entities.
-	 * 
-	 * @param String
-	 *            content String to convert
-	 * 
-	 * @return String the converted string
-	 * @see HTMLPrinter#convertToHTMLContent(String content)
-	 */
-	public static String convertToHTMLContent(String content) {
-		content = replace(content, AMPERSTAND, AMPERSTAND_ENTITY);
-		content = replace(content, LESS_THAN, LESS_THAN_ENTITY);
-		content = replace(content, GREATER_THAN, GREATER_THAN_ENTITY);
-		content = replace(content, LINE_FEED, LINE_FEED_TAG);
-		content = replace(content, LINE_TAB, LINE_TAB_TAG);
-		content = replace(content, SINGLE_QUOTE, SINGLE_QUOTE_ENTITY);
-		content = replace(content, DOUBLE_QUOTE, DOUBLE_QUOTE_ENTITY);
-		content = replace(content, SPACE + SPACE, SPACE_ENTITY + SPACE_ENTITY); // replacing
-		// every
-		// space
-		// would
-		// be
-		// too
-		// much
-		return content;
-	}
-
-	/**
-	 * Converts a string into a form that will not conflict with saving it
-	 * into an INI file
-	 */
-	public static String escape(String normalString) {
-		if (normalString == null)
-			return null;
-		StringBuffer escapedBuffer = new StringBuffer();
-		StringTokenizer toker = new StringTokenizer(normalString, EQUAL_SIGN + LINE_FEED + CARRIAGE_RETURN + LINE_TAB, true);
-		String chunk = null;
-		while (toker.hasMoreTokens()) {
-			chunk = toker.nextToken();
-			if (chunk.equals(EQUAL_SIGN)) {
-				escapedBuffer.append(EQUAL_SIGN_ENTITY);
-			}
-			else if (chunk.equals(LINE_FEED)) {
-				escapedBuffer.append(LINE_FEED_ENTITY);
-			}
-			else if (chunk.equals(CARRIAGE_RETURN)) {
-				escapedBuffer.append(CARRIAGE_RETURN_ENTITY);
-			}
-			else if (chunk.equals(LINE_TAB)) {
-				escapedBuffer.append(LINE_TAB_ENTITY);
-			}
-			else {
-				escapedBuffer.append(chunk);
-			}
-		}
-		return escapedBuffer.toString();
-	}
-
-	/**
-	 * Returns the first line of the given text without a trailing delimiter
-	 * 
-	 * @param text
-	 * @return
-	 */
-	public static String firstLineOf(String text) {
-		if (text == null || text.length() < 1) {
-			return text;
-		}
-		IDocument doc = new Document(text);
-		try {
-			int lineNumber = doc.getLineOfOffset(0);
-			IRegion line = doc.getLineInformation(lineNumber);
-			return doc.get(line.getOffset(), line.getLength());
-		}
-		catch (BadLocationException e) {
-			// do nothing
-		}
-		return text;
-	}
-
-	public static int indexOfLastLineDelimiter(String aString) {
-		return indexOfLastLineDelimiter(aString, aString.length());
-	}
-
-	public static int indexOfLastLineDelimiter(String aString, int offset) {
-		int index = -1;
-
-		if (aString != null && aString.length() > 0) {
-			index = aString.lastIndexOf(CRLF, offset);
-			if (index == -1) {
-				index = aString.lastIndexOf(CR, offset);
-				if (index == -1)
-					index = aString.lastIndexOf(LF, offset);
-			}
-		}
-
-		return index;
-	}
-
-	public static int indexOfLineDelimiter(String aString) {
-		return indexOfLineDelimiter(aString, 0);
-	}
-
-	public static int indexOfLineDelimiter(String aString, int offset) {
-		int index = -1;
-
-		if (aString != null && aString.length() > 0) {
-			index = aString.indexOf(CRLF, offset);
-			if (index == -1) {
-				index = aString.indexOf(CR, offset);
-				if (index == -1)
-					index = aString.indexOf(LF, offset);
-			}
-		}
-
-		return index;
-	}
-
-	public static int indexOfNonblank(String aString) {
-		return indexOfNonblank(aString, 0);
-	}
-
-	public static int indexOfNonblank(String aString, int offset) {
-		int index = -1;
-
-		if (aString != null && aString.length() > 0) {
-			for (int i = offset; i < aString.length(); i++) {
-				if (DELIMITERS.indexOf(aString.substring(i, i + 1)) == -1) {
-					index = i;
-					break;
-				}
-			}
-		}
-
-		return index;
-	}
-
-	/**
-	 * Insert insertString to the beginning of aString only if aString does
-	 * not start with the insertString.
-	 */
-	public static String insertIfNotStartWith(String aString, String insertString) {
-		if ((aString != null) && (insertString != null))
-			if (aString.startsWith(insertString))
-				return aString;
-			else
-				return insertString + aString;
-		else
-			return aString;
-	}
-
-	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 == SINGLE_QUOTE_CHAR) && (lastChar == SINGLE_QUOTE_CHAR)) || ((firstChar == DOUBLE_QUOTE_CHAR) && (lastChar == DOUBLE_QUOTE_CHAR)));
-	}
-
-	/**
-	 * Unit tests.
-	 * 
-	 * @param args
-	 *            java.lang.String[]
-	 */
-	public static void main(String[] args) {
-		// testPaste();
-		testStripNonLetterDigits();
-	}
-
-	/*
-	 * Returns the merged form of both strings
-	 */
-	public static String merge(String newStart, String newEnd) {
-		String[] regions = overlapRegions(newStart, newEnd);
-		return regions[0] + regions[1] + regions[2];
-	}
-
-	public static int occurrencesOf(String searchString, char targetChar) {
-		int result = 0;
-		int len = searchString.length();
-		for (int i = 0; i < len; i++) {
-			if (targetChar == searchString.charAt(i))
-				result++;
-		}
-		return result;
-	}
-
-	/**
-	 * 
-	 * @return java.lang.String[]
-	 * @param start
-	 *            java.lang.String
-	 * @param end
-	 *            java.lang.String
-	 * 
-	 * Returns a 3 String array containing unique text from the start,
-	 * duplicated text that overlaps the start and end, and the unique text
-	 * from the end.
-	 */
-	private static String[] overlapRegions(String start, String end) {
-		String[] results = null;
-		if (start != null && end == null) {
-			results = new String[]{start, "", ""}; //$NON-NLS-2$//$NON-NLS-1$
-		}
-		else if (start == null && end != null) {
-			results = new String[]{"", "", end}; //$NON-NLS-2$//$NON-NLS-1$
-		}
-		else if (start == null && end == null) {
-			results = new String[]{"", "", ""}; //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-		}
-		else if (start != null && end != null) {
-
-			int startLength = start.length();
-			int endLength = end.length();
-
-			if (startLength == 0 || endLength == 0) {
-				results = new String[]{"", "", ""}; //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-			}
-			else {
-				results = new String[3];
-				String testStart = ""; //$NON-NLS-1$
-				String testEnd = ""; //$NON-NLS-1$
-				int mergeLength = Math.min(startLength, endLength);
-				boolean finished = false;
-				while (mergeLength > 0 && !finished) {
-					testStart = start.substring(startLength - mergeLength);
-					testEnd = end.substring(0, mergeLength);
-					// case sensitive
-					if (testStart.equals(testEnd)) {
-						finished = true;
-						results[0] = start.substring(0, startLength - mergeLength);
-						results[1] = start.substring(startLength - mergeLength);
-						results[2] = end.substring(mergeLength);
-					}
-					mergeLength--;
-				}
-				if (!finished) {
-					results[0] = start;
-					results[1] = ""; //$NON-NLS-1$
-					results[2] = end;
-				}
-			}
-		}
-		return results;
-	}
-
-	/**
-	 * Packs an array of Strings into a single comma delimited String.
-	 * 
-	 * @param strings
-	 * @return
-	 * @todo Generated comment
-	 */
-	public static String pack(String[] strings) {
-		StringBuffer buf = new StringBuffer();
-		for (int i = 0; i < strings.length; i++) {
-			buf.append(StringUtils.replace(strings[i], ",", "&comma;")); //$NON-NLS-1$ //$NON-NLS-2$
-			if (i < strings.length - 1)
-				buf.append(","); //$NON-NLS-1$
-		}
-		return buf.toString();
-	}
-
-	/*
-	 * Pastes the new text into the old at the start position, replacing text
-	 * implied by length.
-	 */
-	public static String paste(String oldText, String newText, int start, int length) {
-		String result = null;
-		StringBuffer sb = new StringBuffer();
-		int startIndex = start;
-		int endIndex = start + length;
-		if (startIndex > oldText.length()) {
-			startIndex = oldText.length();
-		}
-		sb.append(oldText.substring(0, startIndex));
-		// null or empty new text accompliches a delete
-		if (newText != null) {
-			sb.append(newText);
-		}
-		if (endIndex < oldText.length()) {
-
-			sb.append(oldText.substring(endIndex));
-		}
-		result = sb.toString();
-		return result;
-	}
-
-	/**
-	 * Replace matching literal portions of a string with another string
-	 */
-	public static String replace(String aString, String source, String target) {
-		if (aString == null)
-			return null;
-		String normalString = ""; //$NON-NLS-1$
-		int length = aString.length();
-		int position = 0;
-		int previous = 0;
-		int spacer = source.length();
-		while (position + spacer - 1 < length && aString.indexOf(source, position) > -1) {
-			position = aString.indexOf(source, previous);
-			normalString = normalString + aString.substring(previous, position) + target;
-			position += spacer;
-			previous = position;
-		}
-		normalString = normalString + aString.substring(position, aString.length());
-
-		return normalString;
-	}
-
-	/**
-	 * Restore the entity references for markup delimiters in text where they
-	 * have been replaced by the proper Unicode values through a DOM text
-	 * parser.
-	 */
-	public static String restoreMarkers(String text) {
-		String content = text;
-		content = replace(content, AMPERSTAND, AMPERSTAND_ENTITY);
-		content = replace(content, LESS_THAN, LESS_THAN_ENTITY);
-		content = replace(content, GREATER_THAN, GREATER_THAN_ENTITY);
-		return content;
-	}
-
-	/**
-	 * Removes extra whitespace characters and quotes
-	 */
-	public static String strip(String quotedString) {
-		if (quotedString == null || quotedString.length() == 0)
-			return quotedString;
-		String trimmed = quotedString.trim();
-		if (trimmed.length() < 2)
-			return quotedString;
-
-		char first = trimmed.charAt(0);
-		char nextToLast = trimmed.charAt(trimmed.length() - 2);
-		char last = trimmed.charAt(trimmed.length() - 1);
-
-		if ((first == '\"' && last == '\"' && nextToLast != '\\') || (first == '\'' && last == '\'' && nextToLast != '\\')) {
-			return trimmed.substring(1, trimmed.length() - 1);
-		}
-		return trimmed;
-	}
-
-	/**
-	 * This method strips anything from the beginning and end of a string that
-	 * is not a letter or digit. It is used by some encoding detectors to come
-	 * up with the encoding name from illformed input (e.g in <?xml
-	 * encoding="abc?> -- where final quote is left off, the '>' is returned
-	 * with the rest of the attribute value 'abc').
-	 */
-	public static String stripNonLetterDigits(String fullValue) {
-		if (fullValue == null || fullValue.length() == 0)
-			return fullValue;
-		int fullValueLength = fullValue.length();
-		int firstPos = 0;
-		while (firstPos < fullValueLength && !Character.isLetterOrDigit(fullValue.charAt(firstPos))) {
-			firstPos++;
-		}
-		int lastPos = fullValueLength - 1;
-		while (lastPos > firstPos && !Character.isLetterOrDigit(fullValue.charAt(lastPos))) {
-			lastPos--;
-		}
-		String result = fullValue;
-		if (firstPos != 0 || lastPos != fullValueLength) {
-			result = fullValue.substring(firstPos, lastPos + 1);
-		}
-		return result;
-	}
-
-	/**
-	 * Similar to strip, except quotes don't need to match such as "UTF' is
-	 * still stripped of both quotes. (Plus, this one does not detect escaped
-	 * quotes)
-	 */
-	public static String stripQuotes(String quotedValue) {
-		if (quotedValue == null)
-			return null;
-		// normally will never have leading or trailing blanks,
-		// but if it does, we'll do lenient interpretation
-		return stripQuotesLeaveInsideSpace(quotedValue).trim();
-	}
-
-	/**
-	 * Like strip quotes, except leaves the start and end space inside the
-	 * quotes
-	 * 
-	 * @param quotedValue
-	 * @return
-	 */
-	public static String stripQuotesLeaveInsideSpace(String quotedValue) {
-		if (quotedValue == null)
-			return null;
-		// nomally will never have leading or trailing blanks ... but just in
-		// case.
-		String result = quotedValue.trim();
-		int len = result.length();
-		if (len > 0) {
-			char firstChar = result.charAt(0);
-			if ((firstChar == SINGLE_QUOTE_CHAR) || (firstChar == DOUBLE_QUOTE_CHAR)) {
-				result = result.substring(1, len);
-			}
-			len = result.length();
-			if (len > 0) {
-				char lastChar = result.charAt(len - 1);
-				if ((lastChar == SINGLE_QUOTE_CHAR) || (lastChar == DOUBLE_QUOTE_CHAR)) {
-					result = result.substring(0, len - 1);
-				}
-			}
-		}
-		return result;
-	}
-
-	public static void testPaste() {
-		String testString = "The quick brown fox ..."; //$NON-NLS-1$
-		System.out.println(paste(testString, null, 4, 5));
-		System.out.println(paste(testString, null, 4, 6));
-		System.out.println(paste(testString, "", 4, 6)); //$NON-NLS-1$
-		System.out.println(paste(testString, "fast", 4, 6)); //$NON-NLS-1$
-		System.out.println(paste(testString, "fast ", 4, 6)); //$NON-NLS-1$
-		System.out.println(paste(testString, "But ", 0, 0)); //$NON-NLS-1$
-		System.out.println(paste("", "burp", 4, 6)); //$NON-NLS-2$//$NON-NLS-1$
-	}
-
-	public static void testStripNonLetterDigits() {
-		String testString = "abc"; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-		testString = ""; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-		testString = "\"abc\""; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-		testString = "\"ab-c1?"; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-		testString = "+++"; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-		testString = "abc="; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-		testString = "abc "; //$NON-NLS-1$
-		System.out.println(testString + " -->" + stripNonLetterDigits(testString) + "<--"); //$NON-NLS-1$ //$NON-NLS-2$
-
-	}
-
-	public static String toString(boolean booleanValue) {
-		if (booleanValue)
-			return TRUE;
-		else
-			return FALSE;
-	}
-
-	/**
-	 * Remove "escaped" chars from a string.
-	 */
-	public static String unescape(String aString) {
-		if (aString == null)
-			return null;
-		String normalString = replace(aString, EQUAL_SIGN_ENTITY, EQUAL_SIGN);
-		normalString = replace(normalString, LINE_FEED_ENTITY, LINE_FEED);
-		normalString = replace(normalString, CARRIAGE_RETURN_ENTITY, CARRIAGE_RETURN);
-		normalString = replace(normalString, LINE_TAB_ENTITY, LINE_TAB);
-		return normalString;
-	}
-
-	public static String uniqueEndOf(String newStart, String newEnd) {
-		String[] regions = overlapRegions(newStart, newEnd);
-		return regions[2];
-	}
-
-	/**
-	 * Unpacks a comma delimited String into an array of Strings
-	 * 
-	 * @param s
-	 * @return
-	 * @todo Generated comment
-	 */
-	public static String[] unpack(String s) {
-		if (s == null)
-			return new String[0];
-		StringTokenizer toker = new StringTokenizer(s, ","); //$NON-NLS-1$
-		List list = new ArrayList();
-		while (toker.hasMoreTokens()) {
-			// since we're separating the values with ',', escape ',' in the
-			// values
-			list.add(StringUtils.replace(toker.nextToken(), "&comma;", ",").trim()); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		return (String[]) list.toArray(new String[0]);
-	}
-
-	/**
-	 * StringUtils constructor comment.
-	 */
-	private StringUtils() {
-		super();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/TextUtilities.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/TextUtilities.java
deleted file mode 100644
index 65f94f3..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/TextUtilities.java
+++ /dev/null
@@ -1,63 +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.sse.core.internal.util;
-
-
-
-/**
- * Collection of text functions.
- * @deprecated - the JFace class is public in 3.1
- */
-// This class was originally copied from org.eclipse.jface.text, and made
-// public
-public class TextUtilities {
-	/**
-	 * Returns whether the text ends with one of the given search strings.
-	 */
-	public static boolean endsWith(String[] searchStrings, String text) {
-		for (int i = 0; i < searchStrings.length; i++) {
-			if (text.endsWith(searchStrings[i]))
-				return true;
-		}
-		return false;
-	}
-
-	/**
-	 * Returns the position in the string greater than offset of the longest
-	 * matching search string.
-	 */
-	public static int[] indexOf(String[] searchStrings, String text, int offset) {
-
-		int[] result = {-1, -1};
-
-		for (int i = 0; i < searchStrings.length; i++) {
-			int index = text.indexOf(searchStrings[i], offset);
-			if (index >= 0) {
-
-				if (result[0] == -1) {
-					result[0] = index;
-					result[1] = i;
-				} else if (index < result[0]) {
-					result[0] = index;
-					result[1] = i;
-				} else if (index == result[0] && searchStrings[i].length() > searchStrings[result[1]].length()) {
-					result[0] = index;
-					result[1] = i;
-				}
-			}
-		}
-
-		return result;
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/URIResolver.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/URIResolver.java
deleted file mode 100644
index ff34450..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/URIResolver.java
+++ /dev/null
@@ -1,81 +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.sse.core.internal.util;
-
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-
-
-/**
- * @deprecated
- * 
- * Should use extensible URIResolver from org.eclipse.wst.common.uriresolver
- * instead.
- */
-
-public interface URIResolver {
-
-	String getFileBaseLocation();
-
-	/**
-	 * Resolve the (possibly relative) URI acording to RFC1808 using the
-	 * default file base location. Resolves resource references into absolute
-	 * resource locations without ensuring that the resource actually exists.
-	 */
-	String getLocationByURI(String uri);
-
-	/**
-	 * Resolve the (possibly relative) URI acording to RFC1808 using the
-	 * default file base location. Resolves resource references into absolute
-	 * resource locations without ensuring that the resource actually exists.
-	 * 
-	 * If resolveCrossProjectLinks is set to true, then this method will
-	 * properly resolve the URI if it is a valid URI to another (appropriate)
-	 * project.
-	 */
-	String getLocationByURI(String uri, boolean resolveCrossProjectLinks);
-
-	/**
-	 * Perform the getLocationByURI action using the baseReference as the
-	 * point of reference instead of the default for this resolver
-	 */
-	String getLocationByURI(String uri, String baseReference);
-
-	/**
-	 * Perform the getLocationByURI action using the baseReference as the
-	 * point of reference instead of the default for this resolver
-	 * 
-	 * If resolveCrossProjectLinks is set to true, then this method will
-	 * properly resolve the URI if it is a valid URI to another (appropriate)
-	 * project.
-	 */
-	String getLocationByURI(String uri, String baseReference, boolean resolveCrossProjectLinks);
-
-	IProject getProject();
-
-	IContainer getRootLocation();
-
-	/**
-	 * Attempts to return a direct inputstream to the given URI which must be
-	 * relative to the default point of reference.
-	 * 
-	 */
-	InputStream getURIStream(String uri);
-
-	void setFileBaseLocation(String newLocation);
-
-	void setProject(IProject newProject);
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Utilities.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Utilities.java
deleted file mode 100644
index 16ed649..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Utilities.java
+++ /dev/null
@@ -1,130 +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.sse.core.internal.util;
-
-
-
-import java.io.BufferedInputStream;
-import java.io.InputStream;
-
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.encoding.util.BufferedLimitedStream;
-
-
-
-public class Utilities {
-
-	/**
-	 * a common calculation in some of the parsing methods (e.g. in
-	 * ContextRegion and IStructuredDocumentRegion)
-	 */
-	public static int calculateLengthDifference(String changes, int lengthToReplace) {
-		// determine the length by the text itself, or, if there is no text to
-		// insert (i.e. we are doing a delete) then calculate the length as
-		// a negative number to denote the amount to delete.
-		// For a straight insert, the selection Length will be zero.
-		int lengthDifference = 0;
-		if (changes == null) {
-			// the delete case
-			lengthDifference = 0 - lengthToReplace;
-		}
-		else {
-			lengthDifference = changes.length() - lengthToReplace;
-		}
-		if (Debug.debugStructuredDocument) {
-			System.out.println("lengthDifference: " + lengthDifference);//$NON-NLS-1$
-		}
-		return lengthDifference;
-	}
-
-	/**
-	 * Returns true iff both parameters are not null and the object is within
-	 * the array. Careful, this uses identity. Not good for basic strings.
-	 */
-	public static boolean contains(Object[] objectArray, Object object) {
-		boolean result = false;
-		// if object or objectArray is null, return false
-		if ((objectArray != null) && (object != null)) {
-			for (int i = 0; i < objectArray.length; i++) {
-				if (objectArray[i] == object) {
-					result = true;
-					break;
-				}
-			}
-		}
-		return result;
-	}
-
-	public static boolean containsString(String[] objectArray, String object) {
-		boolean result = false;
-		// if object or objectArray is null, return false
-		if ((objectArray != null) && (object != null)) {
-			for (int i = 0; i < objectArray.length; i++) {
-				if (objectArray[i].equals(object)) {
-					result = true;
-					break;
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Ensures that an InputStream has mark/reset support, is readlimit is
-	 * set, and that the stream is "limitable" (that is, reports "end of
-	 * input" rather than allow going past mark). This is very specialized
-	 * stream introduced to overcome
-	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=67211. See also
-	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68565
-	 */
-	public static InputStream getLimitedStream(InputStream original) {
-		if (original == null)
-			return null;
-		if (original instanceof BufferedLimitedStream)
-			return original;
-		return new BufferedLimitedStream(original, CodedIO.MAX_BUF_SIZE);
-	}
-
-	/**
-	 * Ensures that an InputStream has mark/reset support.
-	 */
-	public static InputStream getMarkSupportedStream(InputStream original) {
-		if (original == null)
-			return null;
-		if (original.markSupported())
-			return original;
-		InputStream buffered = new BufferedInputStream(original, CodedIO.MAX_BUF_SIZE);
-		buffered.mark(CodedIO.MAX_MARK_SIZE);
-		return buffered;
-	}
-
-	/**
-	 * Used for log/trace messages. Id is assumed to be some form of a
-	 * filename. See IModelManager.
-	 */
-	public static String makeShortId(Object id) {
-		if (id == null)
-			id = "NOID";//$NON-NLS-1$
-		String whole = id.toString();
-		String part = whole.substring(whole.lastIndexOf("/") + 1); //$NON-NLS-1$
-		return "..." + part; //$NON-NLS-1$
-	}
-
-
-	/**
-	 * Utilities constructor comment.
-	 */
-	public Utilities() {
-		super();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationAdapter.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationAdapter.java
deleted file mode 100644
index f285ac7..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationAdapter.java
+++ /dev/null
@@ -1,31 +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.sse.core.internal.validate;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-
-/**
- */
-public interface ValidationAdapter extends INodeAdapter {
-
-	/**
-	 */
-	void setReporter(ValidationReporter reporter);
-
-	/**
-	 */
-	void validate(IndexedRegion node);
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationMessage.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationMessage.java
deleted file mode 100644
index 9cca9ff..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationMessage.java
+++ /dev/null
@@ -1,69 +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.sse.core.internal.validate;
-
-
-
-/**
- */
-public class ValidationMessage {
-	public static final int ERROR = 1;
-	public static final int INFORMATION = 3;
-	public static final int WARNING = 2;
-	private int length;
-
-	private String message;
-	private int offset;
-	private int severity;
-
-	/**
-	 */
-	public ValidationMessage(String message, int offset, int severity) {
-		this(message, offset, 0, severity);
-	}
-
-	/**
-	 */
-	public ValidationMessage(String message, int offset, int length, int severity) {
-		super();
-
-		this.message = message;
-		this.offset = offset;
-		this.length = length;
-		this.severity = severity;
-	}
-
-	/**
-	 */
-	public int getLength() {
-		return this.length;
-	}
-
-	/**
-	 */
-	public String getMessage() {
-		return this.message;
-	}
-
-	/**
-	 */
-	public int getOffset() {
-		return this.offset;
-	}
-
-	/**
-	 */
-	public int getSeverity() {
-		return this.severity;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationReporter.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationReporter.java
deleted file mode 100644
index 4133d56..0000000
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationReporter.java
+++ /dev/null
@@ -1,24 +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.sse.core.internal.validate;
-
-
-
-/**
- */
-public interface ValidationReporter {
-
-	/**
-	 */
-	void report(ValidationMessage message);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/.classpath b/bundles/org.eclipse.wst.sse.ui/.classpath
deleted file mode 100644
index bc5a565..0000000
--- a/bundles/org.eclipse.wst.sse.ui/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src/"/>
-	<classpathentry kind="src" path="src-extensions/"/>
-	<classpathentry kind="src" path="src-encoding"/>
-	<classpathentry kind="src" path="src-tasktags"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.sse.ui/.cvsignore b/bundles/org.eclipse.wst.sse.ui/.cvsignore
deleted file mode 100644
index d7fd277..0000000
--- a/bundles/org.eclipse.wst.sse.ui/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-bin
-editor.jar
-build.xml
-temp.folder
-org.eclipse.wst.sse.ui_1.0.0.jar
-@dot
-src.zip
diff --git a/bundles/org.eclipse.wst.sse.ui/.options b/bundles/org.eclipse.wst.sse.ui/.options
deleted file mode 100644
index aaba6a7..0000000
--- a/bundles/org.eclipse.wst.sse.ui/.options
+++ /dev/null
@@ -1,62 +0,0 @@
-org.eclipse.wst.sse.ui/debug=true
-org.eclipse.wst.sse.ui/debug/tracefilter=
-
-#org.eclipse.wst.sse.ui.edit.util.ActionContributer._showDebugStatus
-org.eclipse.wst.sse.ui/actioncontributor/debugstatusfields=false
-
-
-#org.eclipse.wst.sse.ui.extension.TransferBuilder.debugTime
-org.eclipse.wst.sse.ui/transferbuilder/time=false
-
-org.eclipse.wst.sse.ui/extendedconfigurationbuilder=true
-#org.eclipse.wst.sse.ui.extension.ExtendedConfigurationBuilder.debugTime
-org.eclipse.wst.sse.ui/extendedconfigurationbuilder/time=false
-
-
-org.eclipse.wst.sse.ui/extendededitoractionbuilder=true
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugReadTime
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/readtime=false
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugContributeTime
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/contributetime=false
-
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugMenu
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugmenu=false
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugPopup
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugpopup=false
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugToolbar
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugtoolbar=false
-
-
-#org.eclipse.wst.sse.ui.FileModelProvider.debugOperations
-org.eclipse.wst.sse.ui/filemodelprovider/operations=false
-
-#org.eclipse.wst.sse.ui.FileModelProvider.debugLifecyclelistener
-org.eclipse.wst.sse.ui/filemodelprovider/lifecyclelistener=false
-
-#org.eclipse.wst.sse.ui.FileModelProvider.debugModelStatelistener
-org.eclipse.wst.sse.ui/filemodelprovider/modelstatelistener=false
-
-
-#org.eclipse.wst.sse.ui.StorageModelProvider.debugOperations
-org.eclipse.wst.sse.ui/storagemodelprovider/operations=false
-
-#org.eclipse.wst.sse.ui.StorageModelProvider.debugElementStatelistener
-org.eclipse.wst.sse.ui/storagemodelprovider/elementstatelistener=false
-
-org.eclipse.wst.sse.ui/contentOutline=false
-org.eclipse.wst.sse.ui/propertySheet=false
-
-#org.eclipse.wst.sse.ui.views.contentoutline.PropertyChangeUpdateActionContributionItem.debug
-org.eclipse.wst.sse.ui/propertyChangeUpdateActionContributionItem=false
-
-org.eclipse.wst.sse.ui/debug/reconcilerjob=false
-
-#org.eclipse.wst.sse.ui.internal.GotoAnnotationAction._debug
-org.eclipse.wst.sse.ui/gotoNextAnnotation=false
-
-org.eclipse.wst.sse.ui/preferences-properties=false
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/.project b/bundles/org.eclipse.wst.sse.ui/.project
deleted file mode 100644
index 78bd94c..0000000
--- a/bundles/org.eclipse.wst.sse.ui/.project
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.sse.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.sse.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 3fbd976..0000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,87 +0,0 @@
-#Mon May 30 17:52:20 EDT 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-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=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-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=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-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=ignore
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-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=warning
-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=error
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=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=warning
-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.unsafeTypeOperation=warning
-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.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.sse.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 5d9e4cf..0000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,6 +0,0 @@
-#Mon May 30 03:47:46 EDT 2005
-eclipse.preferences.version=1
-internal.default.compliance=user
-org.eclipse.jdt.ui.exception.name=e
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.overrideannotation=true
diff --git a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index c9a18d3..0000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Fri May 27 23:56:32 EDT 2005
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-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.sse.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 7c0be57..0000000
--- a/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,62 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.sse.ui; singleton:=true
-Bundle-Version: 1.0.1.qualifier
-Bundle-Activator: org.eclipse.wst.sse.ui.internal.SSEUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.sse.ui,
- org.eclipse.wst.sse.ui.internal,
- org.eclipse.wst.sse.ui.internal.actions,
- org.eclipse.wst.sse.ui.internal.contentassist,
- org.eclipse.wst.sse.ui.internal.contentoutline,
- org.eclipse.wst.sse.ui.internal.contentproperties.ui,
- org.eclipse.wst.sse.ui.internal.correction,
- org.eclipse.wst.sse.ui.internal.debug,
- org.eclipse.wst.sse.ui.internal.derived,
- org.eclipse.wst.sse.ui.internal.edit.util,
- org.eclipse.wst.sse.ui.internal.editor,
- org.eclipse.wst.sse.ui.internal.extension,
- org.eclipse.wst.sse.ui.internal.format,
- org.eclipse.wst.sse.ui.internal.hyperlink,
- org.eclipse.wst.sse.ui.internal.openon,
- org.eclipse.wst.sse.ui.internal.preferences,
- org.eclipse.wst.sse.ui.internal.preferences.ui,
- org.eclipse.wst.sse.ui.internal.projection,
- org.eclipse.wst.sse.ui.internal.properties,
- org.eclipse.wst.sse.ui.internal.provisional.extensions,
- org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint,
- org.eclipse.wst.sse.ui.internal.provisional.preferences,
- org.eclipse.wst.sse.ui.internal.provisional.registry,
- org.eclipse.wst.sse.ui.internal.provisional.style,
- org.eclipse.wst.sse.ui.internal.reconcile,
- org.eclipse.wst.sse.ui.internal.reconcile.validator,
- org.eclipse.wst.sse.ui.internal.search,
- org.eclipse.wst.sse.ui.internal.selection,
- org.eclipse.wst.sse.ui.internal.taginfo,
- org.eclipse.wst.sse.ui.internal.text,
- org.eclipse.wst.sse.ui.internal.ui,
- org.eclipse.wst.sse.ui.internal.util,
- org.eclipse.wst.sse.ui.internal.view.events,
- org.eclipse.wst.sse.ui.views.contentoutline,
- org.eclipse.wst.sse.ui.views.properties
-Require-Bundle: org.eclipse.ui.ide,
- org.eclipse.jface.text,
- org.eclipse.debug.core,
- org.eclipse.debug.ui,
- org.eclipse.ui.editors,
- org.eclipse.search,
- org.eclipse.swt,
- org.eclipse.jface,
- org.eclipse.ui,
- org.eclipse.ui.workbench.texteditor,
- org.eclipse.ui.workbench,
- org.eclipse.ui.views,
- org.eclipse.wst.sse.core,
- org.eclipse.core.filebuffers,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.wst.validation, 
- org.eclipse.emf.common
-Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.sse.ui/README.txt b/bundles/org.eclipse.wst.sse.ui/README.txt
deleted file mode 100644
index efe4522..0000000
--- a/bundles/org.eclipse.wst.sse.ui/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-The base editor of the sse framework. It provides the hooks for content assist,
-breakpoints, debugging, open-on, quickfix, spell checking and a content outline.
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/about.html b/bundles/org.eclipse.wst.sse.ui/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/bundles/org.eclipse.wst.sse.ui/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>February 24, 2005</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.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/build.properties b/bundles/org.eclipse.wst.sse.ui/build.properties
deleted file mode 100644
index c5ca9ad..0000000
--- a/bundles/org.eclipse.wst.sse.ui/build.properties
+++ /dev/null
@@ -1,38 +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
-#     
-###############################################################################
-bin.includes = plugin.xml,\
-               .options,\
-               .,\
-               data/,\
-               icons/,\
-               jspdebug.properties,\
-               plugin.properties,\
-               META-INF/,\
-               about.html
-bin.excludes = bin/**,\
-               @dot/**,\
-               temp.folder/**
-src.includes = toc.xml,\
-               testToc.xml,\
-               smoke/,\
-               schema/,\
-               jspdebug.properties,\
-               javadoc.xml,\
-               html/,\
-               data/,\
-               DevTimeSupport/,\
-               doc/
-source.. = src/,\
-           src-extensions/,\
-           src-encoding,\
-           src-tasktags/
diff --git a/bundles/org.eclipse.wst.sse.ui/html/maintopic.html b/bundles/org.eclipse.wst.sse.ui/html/maintopic.html
deleted file mode 100644
index a476078..0000000
--- a/bundles/org.eclipse.wst.sse.ui/html/maintopic.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-	<title>Main Topic</title>
-</head>
-
-<body>
-<h1>Main Topic</h1>
-Please enter your text here.
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/html/subtopic.html b/bundles/org.eclipse.wst.sse.ui/html/subtopic.html
deleted file mode 100644
index 8a61c50..0000000
--- a/bundles/org.eclipse.wst.sse.ui/html/subtopic.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-	<title>Sub Topic</title>
-</head>
-
-<body>
-<h1>Sub Topic</h1>
-Please enter your text here.
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/html/toc.html b/bundles/org.eclipse.wst.sse.ui/html/toc.html
deleted file mode 100644
index 326f0a9..0000000
--- a/bundles/org.eclipse.wst.sse.ui/html/toc.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-	<title>Table of Contents</title>
-</head>
-
-<body>
-<h1>Table of Contents</h1>
-Please enter your text here.
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/ctool16/spellcheck.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/ctool16/spellcheck.gif
deleted file mode 100644
index c71de32..0000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/ctool16/spellcheck.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/collapseall.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/collapseall.gif
deleted file mode 100644
index 7dc0de5..0000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/collapseall.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/delete.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/delete.gif
deleted file mode 100644
index 2e197c2..0000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/delete.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/synced.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/synced.gif
deleted file mode 100644
index 4b9e567..0000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/synced.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/dtool16/spellcheck.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/dtool16/spellcheck.gif
deleted file mode 100644
index a4cf55f..0000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/dtool16/spellcheck.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/collapseall.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/collapseall.gif
deleted file mode 100644
index a2d80a9..0000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/collapseall.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/delete.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/delete.gif
deleted file mode 100644
index 0ae6dec..0000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/delete.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/synced.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/synced.gif
deleted file mode 100644
index 05cefef..0000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/synced.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/etool16/spellcheck.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/etool16/spellcheck.gif
deleted file mode 100644
index c71de32..0000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/etool16/spellcheck.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/occ_match.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/occ_match.gif
deleted file mode 100644
index 9e033de..0000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/occ_match.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/preferences.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/preferences.gif
deleted file mode 100644
index 4c07fea..0000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/preferences.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/prop_ps.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/prop_ps.gif
deleted file mode 100644
index 3aec64d..0000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/prop_ps.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/sourceEditor.gif b/bundles/org.eclipse.wst.sse.ui/icons/sourceEditor.gif
deleted file mode 100644
index 75ebdb8..0000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/plugin.properties b/bundles/org.eclipse.wst.sse.ui/plugin.properties
deleted file mode 100644
index ff436b9..0000000
--- a/bundles/org.eclipse.wst.sse.ui/plugin.properties
+++ /dev/null
@@ -1,83 +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
-#     
-###############################################################################
-providerName=Eclipse.org
-pluginName=Structured Source Editor
-nlFeatureName=Structured Source Editor NL Support
-Standalone_Structured_Source_Editor.name=Standalone Structured Source Editor
-# Name on preferences page
-WEB_AND_XML_Files.name=Web and XML
-Structured_Text_Editor.name=Structured Text Editors
-Task_Tags_Preferences.name=Task Tags
-
-#
-sourceEditorFontDefiniton.label=Structured Text Editor Text Font
-sourceEditorFontDefintion.description=The Structured text editor text font is used by Structured text editors.
-
-Adapter_Factory_Description_Extension.name=Adapter Factory Description Extension
-Embedded_Content_Type_Adapter_Factory_Provider_Extension.name=Embedded Content Type Adapter Factory Provider Extension
-Extended_Editor_Actions_Extension.name=Extended Editor Actions Extension
-Drop_Target_Transfers_Extension.name=Drop Target Transfers Extension
-Extended_Editor_Configuration_Extension.name=Extended Editor Configuration Extension
-##########################################################################
-# These strings are used in Workbench Keys Preferences
-##########################################################################
-scope.structuredTextEditor.name=Editing in Structured Text Editors
-scope.structuredTextEditor.description=Editing in Structured Text Editors
-command.toggle.comment.name=Toggle Comment
-command.toggle.comment.description=Toggle Comment
-command.add.block.comment.name=Add Block Comment
-command.add.block.comment.description=Add Block Comment
-command.remove.block.comment.name=Remove Block Comment
-command.remove.block.comment.description=Remove Block Comment
-command.cleanup.document.name=Cleanup Document
-command.cleanup.document.description=Cleanup document
-command.format.document.name=Format Document
-command.format.document.description=Format document
-command.format.active.elements.name=Format Active Elements
-command.format.active.elements.description=Format active elements
-command.open.file.from.source.name=Open Selection
-command.open.file.from.source.description=Open an editor on the selected link
-command.search.find.occurrences.name=Occurrences in File
-command.search.find.occurrences.description=Find occurrences of the selection in the file
-ActionDefinition.selectEnclosing.name=Select Enclosing Element
-ActionDefinition.selectEnclosing.description=Expand selection to include enclosing element
-ActionDefinition.selectNext.name=Select Next Element
-ActionDefinition.selectNext.description=Expand selection to include next sibling
-ActionDefinition.selectPrevious.name=Select Previous Element
-ActionDefinition.selectPrevious.description=Expand selection to include previous sibling
-ActionDefinition.selectLast.name=Restore Last Selection
-ActionDefinition.selectLast.description=Restore last selection
-ActionDefinition.showJavadoc.name=Show Tooltip Description
-ActionDefinition.showJavadoc.description=Displays the hover help for the selected element
-ActionDefinition.quickFix.name=Quick Fix
-ActionDefinition.quickFix.description=Quick Fix
-
-#
-AddBookmark.label=Add Boo&kmark...
-SelectRuler.label=Select Ruler
-#
-##########################################################################
-# These strings are used in file and container resource popup menu
-##########################################################################
-Source=&Source
-FormatDocument=&Format document
-##
-Breakpoint_Extension_Point.name=Breakpoint Extension Point
-Source_Validation_Extension_Point.name=Reconcile Validator Extension Point
-###############################################################################
-# The following property keys maybe unused. Commented out on 4/12/2005. Uncomment if needed.
-#Bean_Info_Provider_Extension.name=Bean Info Provider Extension
-#SpellCheck_Extension_Point.name=SpellCheck Extension Point
-#Open_On_Extension_Point.name=Open On Extension Point
-#Spell_Check_label=Spell Check
-#Spell_Check_tooltip=Spell Check
diff --git a/bundles/org.eclipse.wst.sse.ui/plugin.xml b/bundles/org.eclipse.wst.sse.ui/plugin.xml
deleted file mode 100644
index d600ef5..0000000
--- a/bundles/org.eclipse.wst.sse.ui/plugin.xml
+++ /dev/null
@@ -1,473 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-	<extension-point
-		id="adapterFactoryDescription"
-		name="%Adapter_Factory_Description_Extension.name" />
-	<extension-point
-		id="extendedEditorActions"
-		name="%Extended_Editor_Actions_Extension.name" />
-	<extension-point
-		id="dropTargetTransfers"
-		name="%Drop_Target_Transfers_Extension.name" />
-	<extension-point
-		id="editorConfiguration"
-		name="%Extended_Editor_Configuration_Extension.name"
-		schema="schema/editorconfiguration.exsd" />
-
-
-	<!-- Make sure default preference values are set at runtime -->
-	<extension point="org.eclipse.core.runtime.preferences">
-		<initializer
-			class="org.eclipse.wst.sse.ui.internal.PreferenceInitializer" />
-	</extension>
-
-
-	<!-- reusable extensions -->
-	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
-		<sourceViewerConfiguration
-			class="org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration"
-			target="org.eclipse.wst.sse.ui.StructuredTextEditor" />
-		<provisionalDefinition
-			type="preferencepages"
-			value="org.eclipse.wst.sse.ui.preferences.editor"
-			target="org.eclipse.wst.sse.ui.StructuredTextEditor" />
-	</extension>
-	<!-- associate the NavigateActionSet with various parts of the XML perspective-->
-	<extension point="org.eclipse.ui.actionSetPartAssociations">
-		<actionSetPartAssociation
-			targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
-			<part
-				id="org.eclipse.wst.sse.ui.StructuredTextEditor">
-			</part>
-		</actionSetPartAssociation>
-		<actionSetPartAssociation
-			targetID="org.eclipse.ui.NavigateActionSet">
-			<!--
-				<part id="org.eclipse.ui.views.ResourceNavigator"/>
-				<part id="org.eclipse.ui.views.ContentOutline"/>
-			-->
-			<!--
-				should probably only "force" association of action sets for workbench parts that we own
-				or only if the view is focusse in the XMLPerspective
-			-->
-			<part
-				id="org.eclipse.wst.sse.ui.StructuredTextEditor">
-			</part>
-		</actionSetPartAssociation>
-	</extension>
-	<extension point="org.eclipse.ui.preferencePages">
-		<!-- ROOT PREFERENCE PAGE FOR WEB AND XML FILES -->
-		<!--  Comment out for now since this preference page is not used
-			<page
-			name="%WEB_AND_XML_Files.name"
-			class="org.eclipse.wst.sse.ui.internal.preferences.ui.FilePreferencePage"
-			id="org.eclipse.wst.sse.ui.internal.provisional.preferences">
-			</page>
-		-->
-		<page
-			name="%WEB_AND_XML_Files.name"
-			class="org.eclipse.wst.sse.ui.internal.preferences.ui.EmptyFilePreferencePage"
-			id="org.eclipse.wst.sse.ui.internal.provisional.preferences">
-		</page>
-		<!-- "common" task tags preference page -->
-		<page
-			name="%Task_Tags_Preferences.name"
-			category="org.eclipse.wst.sse.ui.internal.provisional.preferences"
-			class="org.eclipse.wst.sse.ui.internal.preferences.ui.TaskTagPreferencePage"
-			id="org.eclipse.wst.sse.ui.preferences.tasktags">
-		</page>
-
-		<!-- Source Editor Preference page under Workbench->Editors -->
-		<page
-			name="%Structured_Text_Editor.name"
-			category="org.eclipse.ui.preferencePages.Editors"
-			class="org.eclipse.wst.sse.ui.internal.preferences.ui.StructuredTextEditorPreferencePage"
-			id="org.eclipse.wst.sse.ui.preferences.editor">
-		</page>
-	</extension>
-	<!-- ================================================================================================ -->
-	<!-- common task tags property page -->
-	<!-- ================================================================================================ -->
-	<extension point="org.eclipse.ui.propertyPages">
-		<page
-			id="org.eclipse.wst.sse.ui.project.properties.tasktags"
-			name="%Task_Tags_Preferences.name"
-			objectClass="org.eclipse.core.resources.IProject"
-			adaptable="true"
-			class="org.eclipse.wst.sse.ui.internal.preferences.ui.TaskTagPreferencePage" />
-	</extension>
-
-	<!--
-		<extension-point id="dragSourceTransfers" name="Drag Source Transfers"/>
-	-->
-	<extension point="org.eclipse.ui.commands">
-		<!-- Edit commands -->
-		<command
-			name="%ActionDefinition.selectEnclosing.name"
-			description="%ActionDefinition.selectEnclosing.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.structure.select.enclosing">
-		</command>
-		<command
-			name="%ActionDefinition.selectNext.name"
-			description="%ActionDefinition.selectNext.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.structure.select.next">
-		</command>
-		<command
-			name="%ActionDefinition.selectPrevious.name"
-			description="%ActionDefinition.selectPrevious.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.structure.select.previous">
-		</command>
-		<command
-			name="%ActionDefinition.selectLast.name"
-			description="%ActionDefinition.selectLast.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.structure.select.last">
-		</command>
-		<command
-			name="%ActionDefinition.showJavadoc.name"
-			description="%ActionDefinition.showJavadoc.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.show.javadoc">
-		</command>
-		<command
-			name="%ActionDefinition.quickFix.name"
-			description="%ActionDefinition.quickFix.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.edit.text.java.correction.assist.proposals">
-		</command>
-		<!-- Source commands -->
-		<command
-			name="%command.toggle.comment.name"
-			description="%command.toggle.comment.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.toggle.comment">
-		</command>
-		<command
-			name="%command.add.block.comment.name"
-			description="%command.add.block.comment.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.add.block.comment">
-		</command>
-		<command
-			name="%command.remove.block.comment.name"
-			description="%command.remove.block.comment.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.remove.block.comment">
-		</command>
-		<command
-			name="%command.cleanup.document.name"
-			description="%command.cleanup.document.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.cleanup.document">
-		</command>
-		<command
-			name="%command.format.document.name"
-			description="%command.format.document.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.format.document">
-		</command>
-		<command
-			name="%command.format.active.elements.name"
-			description="%command.format.active.elements.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.format.active.elements">
-		</command>
-		<!-- Navigate commands -->
-		<command
-			name="%command.open.file.from.source.name"
-			description="%command.open.file.from.source.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.open.file.from.source">
-		</command>
-		<!-- Find Occurrences -->
-		<command
-			name="%command.search.find.occurrences.name"
-			description="%command.search.find.occurrences.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.sse.ui.search.find.occurrences">
-		</command>
-	</extension>
-	<!-- Keybinding scope for source editor -->
-	<extension point="org.eclipse.ui.contexts">
-		<context
-			name="%scope.structuredTextEditor.name"
-			parentId="org.eclipse.ui.textEditorScope"
-			description="%scope.structuredTextEditor.description"
-			id="org.eclipse.wst.sse.ui.structuredTextEditorScope">
-		</context>
-	</extension>
-	<!-- Keybindings for source editor -->
-	<extension point="org.eclipse.ui.bindings">
-		<!-- Edit commands -->
-		<key
-			sequence="Alt+Shift+ARROW_UP"
-			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
-			commandId="org.eclipse.wst.sse.ui.structure.select.enclosing"
-			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</key>
-		<key
-			sequence="Alt+Shift+ARROW_RIGHT"
-			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
-			commandId="org.eclipse.wst.sse.ui.structure.select.next"
-			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</key>
-		<key
-			sequence="Alt+Shift+ARROW_LEFT"
-			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
-			commandId="org.eclipse.wst.sse.ui.structure.select.previous"
-			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</key>
-		<key
-			sequence="Alt+Shift+ARROW_DOWN"
-			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
-			commandId="org.eclipse.wst.sse.ui.structure.select.last"
-			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</key>
-		<key
-			sequence="F2"
-			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
-			commandId="org.eclipse.wst.sse.ui.show.javadoc"
-			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</key>
-		<key
-			sequence="Ctrl+1"
-			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
-			commandId="org.eclipse.wst.sse.ui.edit.text.java.correction.assist.proposals"
-			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</key>
-		<!-- Source commands -->
-		<key
-			sequence="Ctrl+Shift+C"
-			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
-			commandId="org.eclipse.wst.sse.ui.toggle.comment"
-			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</key>
-		<key
-			sequence="Ctrl+Shift+/"
-			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
-			commandId="org.eclipse.wst.sse.ui.add.block.comment"
-			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</key>
-		<key
-			sequence="Ctrl+Shift+\"
-			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
-			commandId="org.eclipse.wst.sse.ui.remove.block.comment"
-			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</key>
-		<key
-			sequence="Ctrl+Shift+F"
-			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
-			commandId="org.eclipse.wst.sse.ui.format.document"
-			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</key>
-		<key
-			sequence="Ctrl+I"
-			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
-			commandId="org.eclipse.wst.sse.ui.format.active.elements"
-			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</key>
-		<!-- Navigate commands -->
-		<key
-			sequence="F3"
-			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
-			commandId="org.eclipse.wst.sse.ui.open.file.from.source"
-			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</key>
-		<!-- Find Occurrences -->
-		<key
-			sequence="Ctrl+Shift+A"
-			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
-			commandId="org.eclipse.wst.sse.ui.search.find.occurrences"
-			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</key>
-	</extension>
-	<!-- Font and colors contributions -->
-	<extension point="org.eclipse.ui.themes">
-		<themeElementCategory
-			label="%Structured_Text_Editor.name"
-			id="org.eclipse.wst.sse.ui">
-		</themeElementCategory>
-		<fontDefinition
-			label="%sourceEditorFontDefiniton.label"
-			categoryId="org.eclipse.wst.sse.ui"
-			defaultsTo="org.eclipse.jface.textfont"
-			id="org.eclipse.wst.sse.ui.textfont">
-			<description>
-				%sourceEditorFontDefintion.description
-			</description>
-		</fontDefinition>
-	</extension>
-	<extension point="org.eclipse.wst.sse.ui.dropTargetTransfers">
-		<dropTargetContribution
-			targetID="org.eclipse.wst.sse.ui.StructuredTextEditor"
-			id="org.eclipse.wst.sse.ui.extension.ExtendedTransfers">
-			<transfer
-				priority="mid"
-				singleton="true"
-				class="org.eclipse.swt.dnd.FileTransfer"
-				method="getInstance"
-				id="org.eclipse.swt.dnd.FileTransfer">
-			</transfer>
-			<dropAction
-				class="org.eclipse.wst.sse.ui.internal.FileDropAction"
-				transferID="org.eclipse.swt.dnd.FileTransfer"
-				id="org.eclipse.wst.sse.ui.internal.FileDropAction">
-			</dropAction>
-			<transfer
-				priority="low"
-				singleton="true"
-				class="org.eclipse.swt.dnd.TextTransfer"
-				method="getInstance"
-				id="org.eclipse.swt.dnd.TextTransfer">
-			</transfer>
-			<dropAction
-				class="org.eclipse.wst.sse.ui.internal.TextDropAction"
-				transferID="org.eclipse.swt.dnd.TextTransfer"
-				id="org.eclipse.wst.sse.ui.internal.TextDropAction">
-			</dropAction>
-		</dropTargetContribution>
-	</extension>
-
-	<extension point="org.eclipse.ui.editors.annotationTypes">
-		<type
-			super="org.eclipse.ui.workbench.texteditor.error"
-			markerType="org.eclipse.wst.sse.problem"
-			name="org.eclipse.wst.sse.ui.temp.error"
-			markerSeverity="2">
-		</type>
-		<type
-			super="org.eclipse.ui.workbench.texteditor.warning"
-			markerType="org.eclipse.wst.sse.problem"
-			name="org.eclipse.wst.sse.ui.temp.warning"
-			markerSeverity="1">
-		</type>
-
-		<type
-			super="org.eclipse.ui.workbench.texteditor.info"
-			markerType="org.eclipse.wst.sse.problem"
-			name="org.eclipse.wst.sse.ui.temp.info"
-			markerSeverity="0">
-		</type>
-	</extension>
-	<extension
-		point="org.eclipse.ui.editors.markerAnnotationSpecification">
-
-		<!--================================================================================================-->
-		<!-- same as eclipse text ui (including preference keys), except for vertical ruler & preference page -->
-		<!--================================================================================================-->
-		<specification
-			annotationType="org.eclipse.wst.sse.ui.temp.error"
-			annotationImageProvider="org.eclipse.wst.sse.ui.internal.ui.StructuredTextAnnotationImageProvider"
-			verticalRulerPreferenceValue="true"
-			verticalRulerPreferenceKey="sseErrorIndicationInVerticalRuler"
-			includeOnPreferencePage="false">
-		</specification>
-		<specification
-			annotationType="org.eclipse.wst.sse.ui.temp.warning"
-			annotationImageProvider="org.eclipse.wst.sse.ui.internal.ui.StructuredTextAnnotationImageProvider"
-			verticalRulerPreferenceValue="false"
-			verticalRulerPreferenceKey="sseWarningIndicationInVerticalRuler"
-			includeOnPreferencePage="false">
-		</specification>
-		<specification
-			annotationImageProvider="org.eclipse.wst.sse.ui.internal.ui.StructuredTextAnnotationImageProvider"
-			annotationType="org.eclipse.wst.sse.ui.temp.info">
-		</specification>
-	</extension>
-	<!-- dynamic content type supporting editor, no supported file extensions by default -->
-	<extension point="org.eclipse.ui.editors">
-		<editor
-			name="%Standalone_Structured_Source_Editor.name"
-			icon="icons/sourceEditor.gif"
-			contributorClass="org.eclipse.wst.sse.ui.internal.actions.ActionContributor"
-			class="org.eclipse.wst.sse.ui.StructuredTextEditor"
-			symbolicFontName="org.eclipse.wst.sse.ui.textfont"
-			id="org.eclipse.wst.sse.ui.StructuredTextEditor">
-		</editor>
-	</extension>
-	<extension point="org.eclipse.ui.popupMenus">
-		<objectContribution
-			objectClass="org.eclipse.core.resources.IContainer"
-			id="org.eclipse.wst.sse.ui.actions.ContainerSourceActions">
-			<menu
-				label="%Source"
-				path="additions"
-				id="source">
-				<groupMarker name="sourceGroup"></groupMarker>
-			</menu>
-			<action
-				label="%FormatDocument"
-				class="org.eclipse.wst.sse.ui.internal.actions.FormatActionDelegate"
-				menubarPath="source/sourceGroup"
-				enablesFor="+"
-				id="org.eclipse.wst.sse.ui.actions.ContainerSourceActions.Format">
-			</action>
-		</objectContribution>
-		<objectContribution
-			objectClass="org.eclipse.core.resources.IFile"
-			id="org.eclipse.wst.sse.ui.actions.FileSourceActions">
-			<menu
-				label="%Source"
-				path="additions"
-				id="source">
-				<groupMarker name="sourceGroup"></groupMarker>
-			</menu>
-			<action
-				label="%FormatDocument"
-				class="org.eclipse.wst.sse.ui.internal.actions.FormatActionDelegate"
-				menubarPath="source/sourceGroup"
-				enablesFor="+"
-				id="org.eclipse.wst.sse.ui.actions.FileSourceActions.Format">
-			</action>
-		</objectContribution>
-   	</extension>
-   <extension
-         point="org.eclipse.ui.editorActions">
-      <editorContribution
-            targetID="org.eclipse.wst.sse.ui.StructuredTextEditor"
-            id="org.eclipse.wst.sse.ui.StructuredTextEditor.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>
-         <action
-               label="%SelectRuler.label"
-               class="org.eclipse.ui.texteditor.SelectRulerAction"
-               actionID="RulerClick"
-               id="org.eclipse.ui.texteditor.SelectRulerAction">
-         </action>
-      </editorContribution>
-   </extension>
-
-	<!--================================================================================================-->
-	<!-- contribute a SearchResultViewPage for Occurrences in file                                      -->
-	<!--================================================================================================-->
-	<extension
-		id="Occurrences search page"
-		point="org.eclipse.search.searchResultViewPages">
-		<viewPage
-			id="org.eclipse.wst.sse.ui.search.OccurrencesSearchResultPage"
-			searchResultClass="org.eclipse.wst.sse.ui.internal.search.OccurrencesSearchResult"
-			class="org.eclipse.wst.sse.ui.internal.search.OccurrencesSearchViewPage">
-		</viewPage>
-	</extension>
-
-	<!-- extension point for breakpoint extension -->
-	<extension-point
-		id="breakpoint"
-		name="%Breakpoint_Extension_Point.name" />
-	<!-- extension point for source validation -->
-	<!-- interfaces for this extension point can be found in org.eclipse.wst.validation -->
-	<extension-point
-		id="sourcevalidation"
-		name="%Source_Validation_Extension_Point.name"
-		schema="schema/org.eclipse.wst.sse.editor.sourcevalidation.exsd" />
-</plugin>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd b/bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd
deleted file mode 100644
index 66e2130..0000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd
+++ /dev/null
@@ -1,256 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.sse.ui" id="editorConfiguration" name="Editor Configuration"/>
-      </appInfo>
-      <documentation>
-         The SSE StructuredTextEditor is intended to be as flexible as possible.  Much of its design centers around the notion of defining and redefining its behavior and appearance based on the content type of its input.  This extension point allows clients to provide an editor configuration to the StructuredTextEditor without having to subclass the editor.
-      </documentation>
-   </annotation>
-
-   <element name="extension">
-      <complexType>
-         <sequence>
-            <element ref="sourceViewerConfiguration" minOccurs="0" maxOccurs="unbounded"/>
-            <element ref="contentOutlineConfiguration" minOccurs="0" maxOccurs="unbounded"/>
-            <element ref="propertySheetConfiguration" minOccurs="0" maxOccurs="unbounded"/>
-            <element ref="provisionalConfiguration" minOccurs="0" maxOccurs="unbounded"/>
-            <element ref="provisionalDefinition" minOccurs="0" 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>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="sourceViewerConfiguration">
-      <annotation>
-         <documentation>
-            Defines the source viewer configuration, affecting syntax highlighting, content assist, hover help, and more in the current editor.
-         </documentation>
-      </annotation>
-      <complexType>
-         <attribute name="target" type="string" use="required">
-            <annotation>
-               <documentation>
-                  A string defining when to use this extension, either an editor or content type id.  Multiple targets may be given as a comma delimited value.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="class" type="string" use="required">
-            <annotation>
-               <documentation>
-                  Must subclass org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="java"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="contentOutlineConfiguration">
-      <annotation>
-         <documentation>
-            Defines how the current editor&apos;s input maps to elements with in a Tree control, as well as selection filtering, toolbar and menu contributions, etc in the Outline view.
-         </documentation>
-      </annotation>
-      <complexType>
-         <attribute name="target" type="string" use="required">
-            <annotation>
-               <documentation>
-                  A string defining when to use this extension, either an editor or content type id.  Multiple targets may be given as a comma delimited value.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="class" type="string" use="required">
-            <annotation>
-               <documentation>
-                  Must subclass org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="java"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="propertySheetConfiguration">
-      <annotation>
-         <documentation>
-            Defines how the current editor&apos;s input maps to properties in a Table control, as well as toolbar contributions, etc in the Properties view.
-         </documentation>
-      </annotation>
-      <complexType>
-         <attribute name="target" type="string" use="required">
-            <annotation>
-               <documentation>
-                  A string defining when to use this extension, either an editor or content type id.  Multiple targets may be given as a comma delimited value.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="class" type="string" use="required">
-            <annotation>
-               <documentation>
-                  Must subclass org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="java"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="provisionalConfiguration">
-      <annotation>
-         <documentation>
-            Declares a class fulfilling the requirements of a type to be used for the given target(s).
-&lt;br /&gt;Note: this is not API and is only used for provisional configuration types.
-         </documentation>
-      </annotation>
-      <complexType>
-         <attribute name="target" type="string" use="required">
-            <annotation>
-               <documentation>
-                  A string defining when to use this extension, either an editor or content type id.  Multiple targets may be given as a comma delimited value.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="type" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The type of configuration to find.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="class" type="string" use="required">
-            <annotation>
-               <documentation>
-                  Implementation class for this type.
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="java"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="provisionalDefinition">
-      <annotation>
-         <documentation>
-            Defines a value for a type to be used for the given target(s).
-&lt;br /&gt;Note: this is not API and is only used for provisional configuration types.
-         </documentation>
-      </annotation>
-      <complexType>
-         <attribute name="type" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The type of definition to find.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="value" type="string">
-            <annotation>
-               <documentation>
-                  The value of this definition.
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="target" type="string" use="required">
-            <annotation>
-               <documentation>
-                  A string defining when to use this extension, either an editor or content type id.  Multiple targets may be given as a comma delimited value.
-               </documentation>
-            </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.sse.ui.editorConfiguration&quot;&gt;
-      &lt;!-- associating a source viewer configuration to an input&apos;s content type--&gt;
-      &lt;sourceViewerConfiguration
-            class=&quot;org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML&quot;
-            target=&quot;org.eclipse.wst.html.core.htmlsource&quot;/&gt;
-      &lt;!-- associating an outline configuration to an input&apos;s content type --&gt;
-      &lt;contentOutlineConfiguration
-           class=&quot;org.eclipse.wst.sse.xml.ui.views.contentoutline.XMLContentOutlineConfiguration&quot;
-            target=&quot;org.eclipse.core.runtime.xml&quot;/&gt;
-      &lt;!-- associating a property sheet configuration to multiple content types --&gt;
-      &lt;propertySheetConfiguration
-            class=&quot;org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration&quot;
-            target=&quot;org.eclipse.wst.sse.contenttype.xml, org.eclipse.wst.html.core.htmlsource, org.eclipse.jst.jsp.core.jspsource&quot;/&gt;
-   &lt;/extension&gt;
-&lt;/pre&gt;
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         see &lt;code&gt;org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration&lt;/code&gt;, &lt;code&gt;org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration&lt;/code&gt;, &lt;code&gt;org.eclipse.wst.sse.ui.views.properties.StructuredPropertySheetConfiguration&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) 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 &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.sse.ui/schema/sourcevalidation.exsd b/bundles/org.eclipse.wst.sse.ui/schema/sourcevalidation.exsd
deleted file mode 100644
index 5250d31..0000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/sourcevalidation.exsd
+++ /dev/null
@@ -1,191 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.sse.ui" id="sourcevalidation" name="Source Validation"/>
-      </appInfo>
-      <documentation>
-         This extension point is provided to allow clients to contribute a validator (&lt;code&gt;org.eclipse.wst.validation.internal.provisional.core.IValidator&lt;/code&gt;)
-for as-you-type (source) validation.&lt;br&gt;
-
-If your validator can handle &quot;partial document&quot; validation, it should also implement ISourceValidator.  The validate call on ISourceValidator gets passed an IRegion representation of the part of the document that&apos;s dirty.&lt;br&gt;
-
-This should be much more efficient than validating the entire file each time someone types.&lt;br&gt;
-
-The validator is enabled for specific content type/partition combinations.&lt;br&gt;
-
-Required plugins are:&lt;br&gt;
-   org.eclipse.wst.sse.ui&lt;br&gt;
-   org.eclipse.wst.validation
-      </documentation>
-   </annotation>
-
-   <element name="extension">
-      <complexType>
-         <sequence>
-            <element ref="validator"/>
-         </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>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="validator">
-      <complexType>
-         <sequence>
-            <element ref="contentTypeIdentifier" minOccurs="1" maxOccurs="unbounded"/>
-         </sequence>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="class" type="string">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="scope" type="string">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="partitionType">
-      <complexType>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="contentTypeIdentifier">
-      <complexType>
-         <sequence>
-            <element ref="partitionType" minOccurs="0" maxOccurs="unbounded"/>
-         </sequence>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  
-               </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>
-         Example demonstrating how HTMLValidator contributes to as-you-type validation in the source editor.
-
-&lt;pre&gt;
-   &lt;extension
-         point=&quot;org.eclipse.wst.sse.ui.extensions.sourcevalidation&quot;&gt;
-      &lt;validator
-            scope=&quot;total&quot;
-            class=&quot;org.eclipse.wst.validation.html.HTMLValidator&quot;
-            id=&quot;org.eclipse.wst.validation.htmlsourcevalidator&quot;&gt;
-         &lt;contentTypeIdentifier
-               id=&quot;org.eclipse.wst.html.core.htmlsource&quot;&gt;
-            &lt;partitionType
-                  id=&quot;org.eclipse.wst.html.HTML_DEFAULT&quot;/&gt;
-         &lt;/contentTypeIdentifier&gt;
-         &lt;contentTypeIdentifier
-               id=&quot;org.eclipse.jst.jsp.core.jspsource&quot;&gt;
-            &lt;partitionType
-                  id=&quot;org.eclipse.wst.html.HTML_DEFAULT&quot;/&gt;
-         &lt;/contentTypeIdentifier&gt;
-      &lt;/validator&gt;
-   &lt;/extension&gt;
-&lt;/pre&gt;
-&lt;p&gt;
-Using ISourceValidator
-&lt;/p&gt;
-&lt;p&gt;
-If your validator can handle &quot;partial document&quot; validation, it should  implement ISourceValidator.  
-&lt;/p&gt;
-&lt;p&gt;
-The validate call on ISourceValidator gets passed an IRegion of the document which represents just the part that&apos;s dirty.  This should be much more efficient than validating the entire file each time someone types.
-&lt;/p&gt;
-&lt;p&gt;
-ISourceValidator has its &quot;connect(IDocument doc)&quot; method called when it&apos;s hooked up to the document (when the editor is opened), and &quot;disconnect(IDocument doc)&quot; called when the editor is closed, where any &quot;unhooking&quot; should take place.
-&lt;/p&gt;
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         Currently there is no supplied implementation for IValidator.
-      </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.sse.ui/src-encoding/org/eclipse/wst/sse/ui/internal/encoding/ui/EncodingPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src-encoding/org/eclipse/wst/sse/ui/internal/encoding/ui/EncodingPreferencePage.java
deleted file mode 100644
index 32cf3dd..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src-encoding/org/eclipse/wst/sse/ui/internal/encoding/ui/EncodingPreferencePage.java
+++ /dev/null
@@ -1,109 +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.sse.ui.internal.encoding.ui;
-
-import org.eclipse.jface.preference.PreferencePage;
-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.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.encoding.util.CodedResourcePlugin;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-/**
- * @deprecated - this should not be handled by the platform and not WTP
- */
-
-public class EncodingPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-	Button fUse3ByteBOMWithUTF8CheckBox = null;
-
-	private Button createCheckBox(Composite parent, String label) {
-		Button button = new Button(parent, SWT.CHECK | SWT.LEFT | SWT.WRAP);
-		button.setText(label);
-
-		boolean selection = CodedResourcePlugin.getDefault().getPluginPreferences().getBoolean(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8);
-		button.setSelection(selection);
-
-		return button;
-	}
-
-	private Composite createComposite(Composite parent) {
-		Composite composite = new Composite(parent, SWT.NONE);
-
-		//GridLayout
-		GridLayout layout = new GridLayout(1, true);
-		composite.setLayout(layout);
-
-		//GridData
-		GridData data = new GridData(GridData.FILL_BOTH);
-		composite.setLayoutData(data);
-
-		return composite;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
-	 */
-	protected Control createContents(Composite parent) {
-		Composite composite = createComposite(parent);
-
-		String description = SSEUIMessages.EncodingPreferencePage_0; //$NON-NLS-1$
-		
-		// ISSUE: the following to lines look redundant, 
-		// not sure what was trying to be accomplished. 
-		// May be dead code. 
-		createLabel(composite, description);
-		createLabel(composite, ""); //$NON-NLS-1$
-
-		String checkBoxLabel = SSEUIMessages.EncodingPreferencePage_1; //$NON-NLS-1$
-		fUse3ByteBOMWithUTF8CheckBox = createCheckBox(composite, checkBoxLabel);
-
-		return composite;
-	}
-
-	private Label createLabel(Composite parent, String text) {
-		Label label = new Label(parent, SWT.LEFT);
-		label.setText(text);
-
-		return label;
-	}
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
-	 */
-	public void init(IWorkbench workbench) {
-	}
-
-	public void performDefaults() {
-		boolean defaultSelection = CodedResourcePlugin.getDefault().getPluginPreferences().getDefaultBoolean(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8);
-		fUse3ByteBOMWithUTF8CheckBox.setSelection(defaultSelection);
-	}
-
-	public boolean performOk() {
-		CodedResourcePlugin.getDefault().getPluginPreferences().setValue(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8, fUse3ByteBOMWithUTF8CheckBox.getSelection());
-		CodedResourcePlugin.getDefault().savePluginPreferences();
-
-		return true;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java
deleted file mode 100644
index fdb15cb..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java
+++ /dev/null
@@ -1,151 +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.sse.ui.internal.provisional.extensions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.part.MultiPageEditorSite;
-
-public class ConfigurationPointCalculator {
-	public static final String DESIGN = ".design"; //$NON-NLS-1$
-	public static final String SOURCE = ".source"; //$NON-NLS-1$
-
-	public static String[] getConfigurationPoints(IEditorPart part, String contentType, String subContext, Class rootClass) {
-		ConfigurationPointCalculator calculator = new ConfigurationPointCalculator();
-		calculator.setContentType(contentType);
-		calculator.setPart(part);
-		calculator.setRootClass(rootClass);
-		calculator.setSubContext(subContext);
-		return calculator.getConfigurationPoints();
-	}
-
-	protected String fContentType = null;
-	protected IEditorPart fPart = null;
-
-	protected Class fRootClass = null;
-	protected String fSubContext = null;
-
-	/**
-	 * 
-	 */
-	public ConfigurationPointCalculator() {
-		super();
-	}
-
-	public String[] getConfigurationPoints() {
-		List points = new ArrayList(2);
-
-		IEditorSite site = fPart.getEditorSite();
-		String id = site.getId();
-		if (id != null && id.length() > 0 && !id.equals(fRootClass.getName()))
-			points.add(id);
-
-		if (site instanceof MultiPageEditorSite) {
-			String multipageID = ((MultiPageEditorSite) site).getMultiPageEditor().getSite().getId();
-			if (!points.contains(multipageID))
-				points.add(multipageID);
-			String sourcePageID = ((MultiPageEditorSite) site).getMultiPageEditor().getSite().getId() + ".source"; //$NON-NLS-1$
-			if (!points.contains(sourcePageID))
-				points.add(sourcePageID);
-		}
-		if (site instanceof MultiPageEditorSite) {
-			String multipageClassName = ((MultiPageEditorSite) site).getMultiPageEditor().getClass().getName();
-			if (!points.contains(multipageClassName))
-				points.add(multipageClassName);
-		}
-		Class editorClass = fPart.getClass();
-		while (editorClass != null && fRootClass != null && !editorClass.equals(fRootClass)) {
-			if (!points.contains(editorClass.getName()))
-				points.add(editorClass.getName());
-			editorClass = editorClass.getSuperclass();
-		}
-
-		IContentType contentType = Platform.getContentTypeManager().getContentType(fContentType);
-		while (contentType != null && !contentType.getId().equals(IContentTypeManager.CT_TEXT)) {
-			if (!points.contains(contentType.getId()))
-				points.add(contentType.getId());
-			contentType = contentType.getBaseType();
-		}
-
-		if (!points.contains(fRootClass.getName()))
-			points.add(fRootClass.getName());
-		return (String[]) points.toArray(new String[0]);
-	}
-
-	/**
-	 * @return Returns the contentType.
-	 */
-	public String getContentType() {
-		return fContentType;
-	}
-
-	/**
-	 * @return Returns the part.
-	 */
-	public IEditorPart getPart() {
-		return fPart;
-	}
-
-	/**
-	 * @return Returns the rootClass.
-	 */
-	public Class getRootClass() {
-		return fRootClass;
-	}
-
-	/**
-	 * @return Returns the subContext.
-	 */
-	public String getSubContext() {
-		return fSubContext;
-	}
-
-	/**
-	 * @param contentType
-	 *            The contentType to set.
-	 */
-	public void setContentType(String contentType) {
-		fContentType = contentType;
-	}
-
-	/**
-	 * @param part
-	 *            The part to set.
-	 */
-	public void setPart(IEditorPart part) {
-		fPart = part;
-	}
-
-	/**
-	 * @param rootClass
-	 *            The rootClass to set.
-	 */
-	public void setRootClass(Class rootClass) {
-		fRootClass = rootClass;
-	}
-
-	/**
-	 * @param subContext
-	 *            The subContext to set.
-	 */
-	public void setSubContext(String subContext) {
-		fSubContext = subContext;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISelfValidateEditAction.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISelfValidateEditAction.java
deleted file mode 100644
index 0dedc21..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISelfValidateEditAction.java
+++ /dev/null
@@ -1,27 +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.sse.ui.internal.provisional.extensions;
-
-
-
-/**
- * This is a marker interface to control ValidateEdit call Usually framework
- * calls IExtendedSimpleEditor#validateEdit() before calling
- * IExtendedEditorAction's run() method. However, if the action implements
- * this interface, framework won't call validateEdit() method.
- * 
- * The action should call validateEdit() at their own appropriate timing.
- */
-public interface ISelfValidateEditAction {
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISourceEditingTextTools.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISourceEditingTextTools.java
deleted file mode 100644
index d30edf2..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISourceEditingTextTools.java
+++ /dev/null
@@ -1,50 +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.sse.ui.internal.provisional.extensions;
-
-
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * Interface to provide convenient functions for editors that may not be
- * ITextEditors, but need to expose properties usually found in text editors
- */
-public interface ISourceEditingTextTools {
-
-	/**
-	 * @return the document offset at which the Caret is located
-	 */
-	public int getCaretOffset();
-
-	/**
-	 * @return the IDocument being edited. If this editor supports multiple
-	 *         documents, the document currently possessing the caret will be
-	 *         returned.
-	 */
-	public IDocument getDocument();
-
-	/**
-	 * @return The IEditorPart instance for this editor that is known to the
-	 *         workbench.
-	 */
-	public IEditorPart getEditorPart();
-
-	/**
-	 * @return The current selection within the editor. Implementors may
-	 *         support other types of selection.
-	 */
-	public ITextSelection getSelection();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointConstants.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointConstants.java
deleted file mode 100644
index a78e448..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointConstants.java
+++ /dev/null
@@ -1,21 +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.sse.ui.internal.provisional.extensions.breakpoint;
-
-/**
- * @author pavery
- */
-public interface IBreakpointConstants {
-	String ATTR_HIDDEN = "hidden"; //$NON-NLS-1$
-	String RESOURCE_PATH = "org.eclipse.wst.sse.ui.extensions.breakpoint.path"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java
deleted file mode 100644
index 89855d1..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java
+++ /dev/null
@@ -1,62 +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.sse.ui.internal.provisional.extensions.breakpoint;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-
-/**
- * Interface to provide breakpoint creation
- */
-public interface IBreakpointProvider {
-
-	/**
-	 * Adds breakpoint to specified position
-	 * 
-	 * @param document
-	 *            IDocument object
-	 * @param input
-	 *            current editor input, not necessarily an IFileEditorInput or
-	 *            linked to a resource in any way
-	 * @param lineNumber
-	 *            current line number
-	 * @param offset
-	 *            current caret offset
-	 * @throws CoreException
-	 * @return IStatus the status after being asked to add a breakpoint. The
-	 *         Severity of ERROR should only be used if the location
-	 *         information is both valid for a breakpoint and one could not be
-	 *         added.
-	 */
-	IStatus addBreakpoint(IDocument document, IEditorInput input, int lineNumber, int offset) throws CoreException;
-
-	/**
-	 * Returns corresponding resource from editor input
-	 * 
-	 * @param input
-	 * @return IResource
-	 */
-	IResource getResource(IEditorInput input);
-
-	/**
-	 * Set ISourceEditingTextTools object
-	 * 
-	 * @param tool
-	 *            ISourceEditingTextTools object
-	 */
-	void setSourceEditingTextTools(ISourceEditingTextTools tool);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IExtendedStorageEditorInput.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IExtendedStorageEditorInput.java
deleted file mode 100644
index dc41472..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IExtendedStorageEditorInput.java
+++ /dev/null
@@ -1,37 +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.sse.ui.internal.provisional.extensions.breakpoint;
-
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.texteditor.IElementStateListener;
-
-public interface IExtendedStorageEditorInput extends IStorageEditorInput {
-	/**
-	 * Adds the given element state listener to this input. Has no effect if
-	 * an identical listener is already registered. Typically used by the
-	 * IDocumentProvider to register itself for change notification.
-	 * 
-	 * @param listener
-	 *            the listener
-	 */
-	void addElementStateListener(IElementStateListener listener);
-
-	/**
-	 * Removes the given element state listener from this input. Has no affect
-	 * if an identical listener is not registered.
-	 * 
-	 * @param listener
-	 *            the listener
-	 */
-	void removeElementStateListener(IElementStateListener listener);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NodeLocation.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NodeLocation.java
deleted file mode 100644
index 7874d98..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NodeLocation.java
+++ /dev/null
@@ -1,48 +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.sse.ui.internal.provisional.extensions.breakpoint;
-
-
-public interface NodeLocation {
-	/**
-	 * Returns the document end offset of the end tag, -1 of there is no end
-	 * tag
-	 * 
-	 * @return
-	 */
-	int getEndTagEndOffset();
-
-	/**
-	 * Returns the document start offset of the end tag, -1 of there is no end
-	 * tag
-	 * 
-	 * @return
-	 */
-	int getEndTagStartOffset();
-
-	/**
-	 * Returns the document end offset of the start tag, -1 of there is no
-	 * start tag
-	 * 
-	 * @return
-	 */
-	int getStartTagEndOffset();
-
-	/**
-	 * Returns the document start offset of the start tag, -1 of there is no
-	 * start tag
-	 * 
-	 * @return
-	 */
-	int getStartTagStartOffset();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NullSourceEditingTextTools.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NullSourceEditingTextTools.java
deleted file mode 100644
index 65758a6..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NullSourceEditingTextTools.java
+++ /dev/null
@@ -1,63 +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.sse.ui.internal.provisional.extensions.breakpoint;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-
-public class NullSourceEditingTextTools implements ISourceEditingTextTools {
-	public static final String ID = "sourceeditingtexttools"; //$NON-NLS-1$
-	private ITextEditor fTextEditor;
-
-	/**
-	 * @return
-	 */
-	public synchronized static ISourceEditingTextTools getInstance() {
-		return new NullSourceEditingTextTools();
-	}
-
-	private NullSourceEditingTextTools() {
-		super();
-	}
-
-	public int getCaretOffset() {
-		ISelection sel = fTextEditor.getSelectionProvider().getSelection();
-		if (sel instanceof ITextSelection) {
-			return ((ITextSelection) sel).getOffset();
-		}
-		return -1;
-	}
-
-	public IDocument getDocument() {
-		return fTextEditor.getDocumentProvider().getDocument(fTextEditor.getEditorInput());
-	}
-
-	public IEditorPart getEditorPart() {
-		return fTextEditor;
-	}
-
-	public ITextSelection getSelection() {
-		if (fTextEditor != null)
-			return (ITextSelection) fTextEditor.getSelectionProvider().getSelection();
-		return TextSelection.emptySelection();
-	}
-
-	public void setTextEditor(ITextEditor editor) {
-		fTextEditor = editor;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java
deleted file mode 100644
index 4102329..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java
+++ /dev/null
@@ -1,373 +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.sse.ui.internal.preferences.ui;
-
-import java.text.Collator;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-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.viewers.CheckboxTreeViewer;
-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.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-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.Text;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.tasks.FileTaskScannerRegistryReader;
-import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.util.Sorter;
-
-class ExclusionsTab implements IPreferenceTab {
-	private class ArrayTreeContentProvider implements ITreeContentProvider {
-		public ArrayTreeContentProvider() {
-			super();
-		}
-
-		public void dispose() {
-		}
-
-		public Object[] getChildren(Object parentElement) {
-			if (parentElement instanceof Object[])
-				return fContentTypeSorter.sort((Object[]) parentElement);
-			return new Object[0];
-		}
-
-		public Object[] getElements(Object inputElement) {
-			return getChildren(inputElement);
-		}
-
-		public Object getParent(Object element) {
-			return null;
-		}
-
-		public boolean hasChildren(Object element) {
-			return getChildren(element).length > 0;
-		}
-
-		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-		}
-	}
-
-	private class ContentTypeLabelProvider extends LabelProvider {
-		public String getText(Object element) {
-			if (element != null) {
-				Object o = element;
-				if (o instanceof String) {
-					o = fContentTypeManager.getContentType(o.toString());
-				}
-				if (o instanceof IContentType) {
-					return ((IContentType) o).getName();
-				}
-			}
-			return super.getText(element);
-		}
-	}
-
-	/**
-	 * A QuickSorter that sorts and returns a IContentType-typed array
-	 */
-	private class ContentTypeSorter extends Sorter {
-		private Collator collator = Collator.getInstance(Locale.ENGLISH);
-
-		public boolean compare(Object elementOne, Object elementTwo) {
-			return (collator.compare(((IContentType) elementOne).getName(), ((IContentType) elementTwo).getName())) < 0;
-		}
-
-		public Object[] sort(Object[] unSortedCollection) {
-			Object[] types = super.sort(unSortedCollection);
-			IContentType[] sortedTypes = new IContentType[types.length];
-			if (types.length > 0) {
-				System.arraycopy(types, 0, sortedTypes, 0, sortedTypes.length);
-			}
-			return sortedTypes;
-		}
-	}
-
-	private class ContentTypeTreeProvider implements ITreeContentProvider {
-		public ContentTypeTreeProvider() {
-			super();
-		}
-
-		public void dispose() {
-		}
-
-		boolean equals(Object left, Object right) {
-			return left == null ? right == null : ((right != null) && left.equals(right));
-		}
-
-		public Object[] getChildren(Object parentElement) {
-			if (parentElement instanceof Object[]) {
-				return (Object[]) parentElement;
-			}
-			if (parentElement instanceof IContentType) {
-				List elements = new ArrayList(0);
-				IContentType[] allTypes = fContentTypeManager.getAllContentTypes();
-				for (int i = 0; i < allTypes.length; i++) {
-					if (!fSupportedContentTypes.contains(allTypes[i]) && equals(allTypes[i].getBaseType(), parentElement)) {
-						elements.add(allTypes[i]);
-					}
-				}
-				return fContentTypeSorter.sort(elements.toArray());
-			}
-			return new Object[0];
-		}
-
-		public Object[] getElements(Object inputElement) {
-			return getChildren(inputElement);
-		}
-
-		public Object getParent(Object element) {
-			Object parent = null;
-			if (element instanceof IContentType) {
-				parent = ((IContentType) element).getBaseType();
-			}
-			return parent;
-		}
-
-		public boolean hasChildren(Object element) {
-			return getChildren(element).length > 0;
-		}
-
-		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-		}
-	}
-
-	/**
-	 * A QuickSorter that sorts and returns a String-typed array
-	 */
-	private class StringSorter extends Sorter {
-		Collator collator = Collator.getInstance(Locale.ENGLISH);
-
-		public boolean compare(Object elementOne, Object elementTwo) {
-			return (collator.compare(elementOne.toString(), elementTwo.toString()) < 0);
-		}
-
-		public Object[] sort(Object[] unSortedCollection) {
-			Object[] sortedCollection = super.sort(unSortedCollection);
-			String[] strings = new String[sortedCollection.length];
-			// copy the array so can return a new sorted collection
-			if (strings.length > 0) {
-				System.arraycopy(sortedCollection, 0, strings, 0, strings.length);
-			}
-			return strings;
-		}
-	}
-
-	private static final boolean _debugPreferences = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/preferences")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private CheckboxTreeViewer fContentTypeList;
-
-	private IContentTypeManager fContentTypeManager = null;
-
-	ContentTypeSorter fContentTypeSorter = new ContentTypeSorter();
-
-	private IContentType[] fIgnoreContentTypes = null;
-
-	private IContentType[] fOriginalIgnoreContentTypes = null;
-
-	private TaskTagPreferencePage fOwner = null;
-
-	private IScopeContext[] fPreferencesLookupOrder = null;
-
-	private IPreferencesService fPreferencesService = null;
-
-	private List fSupportedContentTypes = null;
-
-	public ExclusionsTab(TaskTagPreferencePage parent, IPreferencesService preferencesService, IScopeContext[] lookupOrder) {
-		super();
-		fOwner = parent;
-		fPreferencesLookupOrder = lookupOrder;
-		fPreferencesService = preferencesService;
-		fContentTypeManager = Platform.getContentTypeManager();
-
-		String[] supportedContentTypeIDs = FileTaskScannerRegistryReader.getInstance().getSupportedContentTypeIds();
-		fSupportedContentTypes = new ArrayList(supportedContentTypeIDs.length);
-		for (int i = 0; i < supportedContentTypeIDs.length; i++) {
-			IContentType type = fContentTypeManager.getContentType(supportedContentTypeIDs[i]);
-			if (type != null) {
-				fSupportedContentTypes.add(type);
-			}
-		}
-		String[] ignoreContentTypes = StringUtils.unpack(fPreferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, SSECorePlugin.getDefault().getPluginPreferences().getDefaultString(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED), fPreferencesLookupOrder));
-		List contentTypes = new ArrayList();
-		for (int i = 0; i < ignoreContentTypes.length; i++) {
-			IContentType type = fContentTypeManager.getContentType(ignoreContentTypes[i]);
-			if (type != null) {
-				contentTypes.add(type);
-			}
-		}
-		fOriginalIgnoreContentTypes = fIgnoreContentTypes = (IContentType[]) contentTypes.toArray(new IContentType[contentTypes.size()]);
-	}
-
-	public Control createContents(Composite tabFolder) {
-		Composite composite = new Composite(tabFolder, SWT.NONE);
-		composite.setLayout(new GridLayout(2, true));
-		Text description = new Text(composite, SWT.READ_ONLY);
-		description.setText(SSEUIMessages.TaskTagExclusionTab_02);
-		description.setBackground(composite.getBackground());
-
-		fContentTypeList = new CheckboxTreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
-		fContentTypeList.setLabelProvider(new ContentTypeLabelProvider());
-		fContentTypeList.setContentProvider(new ArrayTreeContentProvider());
-
-		fContentTypeList.setInput(fSupportedContentTypes.toArray());
-		fContentTypeList.setCheckedElements(fSupportedContentTypes.toArray());
-		fContentTypeList.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
-		for (int i = 0; i < fIgnoreContentTypes.length; i++) {
-			fContentTypeList.setChecked(fIgnoreContentTypes[i], false);
-		}
-
-		Button selectAll = new Button(composite, SWT.PUSH);
-		selectAll.setText(SSEUIMessages.TaskTagPreferenceTab_17);
-		selectAll.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
-		selectAll.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				fContentTypeList.setCheckedElements(fSupportedContentTypes.toArray());
-			}
-		});
-
-		Button selectNone = new Button(composite, SWT.PUSH);
-		selectNone.setText(SSEUIMessages.TaskTagPreferenceTab_18);
-		selectNone.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
-		selectNone.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				fContentTypeList.setCheckedElements(new Object[0]);
-			}
-		});
-
-		new Label(composite, SWT.NONE).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
-
-		Text affectedTypesLabel = new Text(composite, SWT.READ_ONLY);
-		affectedTypesLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
-		affectedTypesLabel.setBackground(composite.getBackground());
-		affectedTypesLabel.setText(SSEUIMessages.TaskTagExclusionTab_03);
-
-		final TreeViewer contentTypeTreeViewer = new TreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
-		contentTypeTreeViewer.setLabelProvider(new ContentTypeLabelProvider());
-		contentTypeTreeViewer.setContentProvider(new ContentTypeTreeProvider());
-		contentTypeTreeViewer.setInput(new Object[0]);
-		contentTypeTreeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
-
-		fContentTypeList.addSelectionChangedListener(new ISelectionChangedListener() {
-			public void selectionChanged(SelectionChangedEvent event) {
-				if (event.getSelection() instanceof IStructuredSelection) {
-					Object[] o = ((IStructuredSelection) event.getSelection()).toArray();
-					contentTypeTreeViewer.setInput(o);
-					contentTypeTreeViewer.expandAll();
-					if (o.length > 0) {
-						contentTypeTreeViewer.reveal(o[0]);
-					}
-				}
-			}
-		});
-
-		return composite;
-	}
-
-	public String getTitle() {
-		return SSEUIMessages.TaskTagExclusionTab_01;
-	}
-
-	public void performApply() {
-		save();
-	}
-
-	public void performDefaults() {
-		if (_debugPreferences) {
-			System.out.println("Loading defaults in " + getClass().getName()); //$NON-NLS-1$
-		}
-		IEclipsePreferences[] defaultPreferences = new IEclipsePreferences[fPreferencesLookupOrder.length - 1];
-		for (int i = 1; i < defaultPreferences.length; i++) {
-			defaultPreferences[i - 1] = fPreferencesLookupOrder[i].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE);
-		}
-		String[] defaultIgnoreTypes = StringUtils.unpack(fPreferencesService.get(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, null, defaultPreferences)); //$NON-NLS-1$
-
-		List contentTypes = new ArrayList();
-		for (int i = 0; i < defaultIgnoreTypes.length; i++) {
-			IContentType type = fContentTypeManager.getContentType(defaultIgnoreTypes[i]);
-			if (type != null) {
-				contentTypes.add(type);
-			}
-		}
-		fIgnoreContentTypes = (IContentType[]) contentTypes.toArray(new IContentType[contentTypes.size()]);
-		fContentTypeList.setCheckedElements(fContentTypeManager.getAllContentTypes());
-		for (int i = 0; i < fIgnoreContentTypes.length; i++) {
-			fContentTypeList.setChecked(fIgnoreContentTypes[i], false);
-		}
-	}
-
-	public void performOk() {
-		List ignoredIds = save();
-		String[] ignoreIDs = (String[]) new StringSorter().sort(ignoredIds.toArray());
-		fIgnoreContentTypes = new IContentType[ignoreIDs.length];
-		for (int i = 0; i < ignoreIDs.length; i++) {
-			fIgnoreContentTypes[i] = fContentTypeManager.getContentType(ignoreIDs[i]);
-		}
-
-		if (!Arrays.equals(fOriginalIgnoreContentTypes, fIgnoreContentTypes)) {
-			fOwner.requestRedetection();
-		}
-		fOriginalIgnoreContentTypes = fIgnoreContentTypes;
-	}
-
-	private List save() {
-		List ignoredIds = new ArrayList();
-		List checked = Arrays.asList(fContentTypeList.getCheckedElements());
-		for (int i = 0; i < fSupportedContentTypes.size(); i++) {
-			if (!checked.contains(fSupportedContentTypes.get(i))) {
-				ignoredIds.add(((IContentType) fSupportedContentTypes.get(i)).getId());
-			}
-		}
-		IEclipsePreferences[] defaultPreferences = new IEclipsePreferences[fPreferencesLookupOrder.length - 1];
-		for (int i = 1; i < defaultPreferences.length; i++) {
-			defaultPreferences[i - 1] = fPreferencesLookupOrder[i].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE);
-		}
-
-		String defaultIgnoredContentTypeIds = StringUtils.pack((String[]) new StringSorter().sort(StringUtils.unpack(fPreferencesService.get(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, "", defaultPreferences)))); //$NON-NLS-1$
-		String ignoredContentTypeIds = StringUtils.pack((String[]) new StringSorter().sort(ignoredIds.toArray()));
-		if (ignoredContentTypeIds.equals(defaultIgnoredContentTypeIds)) {
-			if (_debugPreferences) {
-				System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED + " from scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			}
-			fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).remove(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED);
-		}
-		else {
-			if (_debugPreferences) {
-				System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED + " \"" + ignoredContentTypeIds + "\" in scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			}
-			fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).put(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, ignoredContentTypeIds);
-		}
-		return ignoredIds;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java
deleted file mode 100644
index 27383ed..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java
+++ /dev/null
@@ -1,450 +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.sse.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.Platform;
-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.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-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.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-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.Shell;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.sse.core.internal.provisional.tasks.TaskTag;
-import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-class MainTab implements IPreferenceTab {
-	public class TaskTagDialog extends Dialog {
-		public TaskTag taskTag = null;
-
-		Combo priorityCombo = null;
-		Text tagText = null;
-
-		public TaskTagDialog(Shell parentShell) {
-			super(parentShell);
-			setShellStyle(getShellStyle() | SWT.RESIZE);
-		}
-
-		protected void configureShell(Shell newShell) {
-			super.configureShell(newShell);
-			newShell.setText(SSEUIMessages.TaskTagPreferenceTab_5); //$NON-NLS-1$
-		}
-
-		protected Control createButtonBar(Composite parent) {
-			Control c = super.createButtonBar(parent);
-			getButton(IDialogConstants.OK_ID).setEnabled(taskTag == null || taskTag.getTag().length() > 0);
-			return c;
-		}
-
-		protected Control createDialogArea(Composite parent) {
-			Composite composite = new Composite(parent, SWT.NONE);
-			composite.setLayout(new GridLayout(2, false));
-			GridData gridData = new GridData(GridData.FILL_BOTH);
-			gridData.widthHint = parent.getDisplay().getClientArea().width / 5;
-			composite.setLayoutData(gridData);
-			Label label = new Label(composite, SWT.NONE);
-			label.setText(SSEUIMessages.TaskTagPreferenceTab_6); //$NON-NLS-1$
-			label.setLayoutData(new GridData());
-			tagText = new Text(composite, SWT.NONE);
-			tagText.setText(taskTag != null ? taskTag.getTag() : ""); //$NON-NLS-1$
-			tagText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-			tagText.addModifyListener(new ModifyListener() {
-				public void modifyText(ModifyEvent e) {
-					String testTag = tagText.getText();
-					String[] tags = new String[fTaskTags.length];
-					for (int i = 0; i < tags.length; i++) {
-						tags[i] = fTaskTags[i].getTag();
-					}
-					getButton(IDialogConstants.OK_ID).setEnabled(tagText.getText().length() > 0 && !Arrays.asList(tags).contains(testTag));
-					taskTag = new TaskTag(tagText.getText(), priorityCombo.getSelectionIndex());
-				}
-			});
-
-			label = new Label(composite, SWT.NONE);
-			label.setText(SSEUIMessages.TaskTagPreferenceTab_7); //$NON-NLS-1$
-			label.setLayoutData(new GridData());
-			priorityCombo = new Combo(composite, SWT.READ_ONLY | SWT.SINGLE);
-			priorityCombo.setItems(new String[]{SSEUIMessages.TaskTagPreferenceTab_0, SSEUIMessages.TaskTagPreferenceTab_1, SSEUIMessages.TaskTagPreferenceTab_2});
-			priorityCombo.select(taskTag != null ? taskTag.getPriority() : TaskTag.PRIORITY_NORMAL);
-			priorityCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-			priorityCombo.addSelectionListener(new SelectionAdapter() {
-				public void widgetSelected(SelectionEvent e) {
-					taskTag = new TaskTag(taskTag.getTag(), priorityCombo.getSelectionIndex());
-				}
-			});
-			return composite;
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
-		 */
-		protected void okPressed() {
-			taskTag = new TaskTag(tagText.getText(), priorityCombo.getSelectionIndex());
-			super.okPressed();
-		}
-	}
-
-	public class TaskTagTableLabelProvider extends LabelProvider implements ITableLabelProvider {
-		public TaskTagTableLabelProvider() {
-			super();
-		}
-
-		public Image getColumnImage(Object element, int columnIndex) {
-			return null;
-		}
-
-		public String getColumnText(Object element, int columnIndex) {
-			if (columnIndex < 1)
-				return ((TaskTag) element).getTag();
-			for (int i = 0; i < fTaskTags.length; i++) {
-				if (fTaskTags[i].equals(element)) {
-					if (fTaskTags[i].getPriority() == IMarker.PRIORITY_LOW) {
-						return SSEUIMessages.TaskTagPreferenceTab_0; //$NON-NLS-1$
-					}
-					else if (fTaskTags[i].getPriority() == IMarker.PRIORITY_HIGH) {
-						return SSEUIMessages.TaskTagPreferenceTab_2; //$NON-NLS-1$
-					}
-					else {
-						return SSEUIMessages.TaskTagPreferenceTab_1; //$NON-NLS-1$
-					}
-				}
-			}
-			return SSEUIMessages.TaskTagPreferenceTab_3; //$NON-NLS-1$
-		}
-	}
-
-	private static final boolean _debugPreferences = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/preferences")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private Control fControl;
-
-	private TaskTag[] fOriginalTaskTags;
-	private TaskTagPreferencePage fOwner = null;
-	private IScopeContext[] fPreferencesLookupOrder = null;
-
-	private IPreferencesService fPreferencesService = null;
-
-	private TaskTag[] fTaskTags;
-
-	private TableViewer valueTable = null;
-
-
-	public MainTab(TaskTagPreferencePage parent, IPreferencesService preferencesService, IScopeContext[] lookupOrder) {
-		super();
-		fOwner = parent;
-		fPreferencesLookupOrder = lookupOrder;
-		fPreferencesService = preferencesService;
-	}
-
-
-	private void addTag() {
-		TaskTagDialog dlg = new TaskTagDialog(fControl.getShell());
-		int result = dlg.open();
-		if (result == Window.OK) {
-			TaskTag newTag = dlg.taskTag;
-			List newTags = new ArrayList(Arrays.asList(fTaskTags));
-			newTags.add(newTag);
-			fTaskTags = (TaskTag[]) newTags.toArray(new TaskTag[newTags.size()]);
-			valueTable.setInput(fTaskTags);
-			valueTable.getTable().setSelection(fTaskTags.length - 1);
-		}
-	}
-
-	public Control createContents(Composite tabFolder) {
-		loadPreferenceValues();
-		fOriginalTaskTags = fTaskTags;
-
-		Composite composite = new Composite(tabFolder, SWT.NONE);
-		composite.setLayout(new GridLayout(2, false));
-		fControl = composite;
-
-		Text description = new Text(composite, SWT.READ_ONLY | SWT.SINGLE);
-		description.setText(SSEUIMessages.TaskTagPreferenceTab_33); //$NON-NLS-1$
-		description.setBackground(composite.getBackground());
-		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=104403
-		Point sizeHint = description.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-		gd.widthHint = sizeHint.x;
-		description.setLayoutData(gd);
-
-		valueTable = new TableViewer(composite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
-		valueTable.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
-		TableColumn textColumn = new TableColumn(valueTable.getTable(), SWT.NONE, 0);
-		textColumn.setText(SSEUIMessages.TaskTagPreferenceTab_12); //$NON-NLS-1$
-		TableColumn priorityColumn = new TableColumn(valueTable.getTable(), SWT.NONE, 1);
-		priorityColumn.setText(SSEUIMessages.TaskTagPreferenceTab_13); //$NON-NLS-1$
-		valueTable.setContentProvider(new ArrayContentProvider());
-		valueTable.setLabelProvider(new TaskTagTableLabelProvider());
-		valueTable.getTable().setLinesVisible(true);
-		valueTable.getTable().setHeaderVisible(true);
-		TableLayout layout = new TableLayout();
-		layout.addColumnData(new ColumnWeightData(1, 140, true));
-		layout.addColumnData(new ColumnWeightData(1, 140, true));
-		valueTable.getTable().setLayout(layout);
-
-		Composite buttons = new Composite(composite, SWT.NONE);
-		buttons.setLayout(new GridLayout());
-		buttons.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-
-		final Button addButton = new Button(buttons, SWT.PUSH);
-		addButton.setText(SSEUIMessages.TaskTagPreferenceTab_14); //$NON-NLS-1$
-		addButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-		final Button editButton = new Button(buttons, SWT.PUSH);
-		editButton.setText(SSEUIMessages.TaskTagPreferenceTab_15); //$NON-NLS-1$
-		editButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-		final Button removeButton = new Button(buttons, SWT.PUSH);
-		removeButton.setText(SSEUIMessages.TaskTagPreferenceTab_16); //$NON-NLS-1$
-		removeButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
-		editButton.setEnabled(false);
-		removeButton.setEnabled(false);
-
-		Label warning = new Label(composite, SWT.NONE);
-		warning.setLayoutData(new GridData());
-		warning.setText(SSEUIMessages.TaskTagPreferenceTab_19); //$NON-NLS-1$
-
-		final ISelectionChangedListener selectionChangedListener = new ISelectionChangedListener() {
-			public void selectionChanged(SelectionChangedEvent event) {
-				boolean enabledForSelection = !valueTable.getSelection().isEmpty();
-				editButton.setEnabled(enabledForSelection);
-				removeButton.setEnabled(enabledForSelection);
-			}
-		};
-		valueTable.addPostSelectionChangedListener(selectionChangedListener);
-		addButton.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				addTag();
-				valueTable.getTable().setSelection(fTaskTags.length - 1);
-				selectionChangedListener.selectionChanged(null);
-			}
-		});
-		editButton.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				int i = valueTable.getTable().getSelectionIndex();
-				editTag(i);
-				if (i >= 0) {
-					valueTable.getTable().setSelection(i);
-					selectionChangedListener.selectionChanged(null);
-				}
-			}
-		});
-		removeButton.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				int i = valueTable.getTable().getSelectionIndex();
-				removeTag(valueTable.getTable().getSelectionIndex());
-				if (i >= 0 && i < fTaskTags.length) {
-					valueTable.getTable().setSelection(i);
-				}
-			}
-		});
-		valueTable.addDoubleClickListener(new IDoubleClickListener() {
-			public void doubleClick(DoubleClickEvent event) {
-				int i = valueTable.getTable().getSelectionIndex();
-				editTag(i);
-				if (i >= 0) {
-					valueTable.getTable().setSelection(i);
-					selectionChangedListener.selectionChanged(null);
-				}
-			}
-		});
-
-		valueTable.setInput(fTaskTags);
-
-		return composite;
-	}
-
-	/**
-	 * @param selection
-	 */
-	private void editTag(int i) {
-		if (i < 0) {
-			return;
-		}
-
-		int selection = valueTable.getTable().getSelectionIndex();
-		TaskTagDialog dlg = new TaskTagDialog(fControl.getShell());
-		dlg.taskTag = fTaskTags[selection];
-		int result = dlg.open();
-		if (result == Window.OK) {
-			fTaskTags[selection] = dlg.taskTag;
-			valueTable.refresh();
-		}
-	}
-
-	public String getTitle() {
-		return SSEUIMessages.TaskTagPreferenceTab_20;
-	}
-
-	private void loadPreferenceValues() {
-		String tags = fPreferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_TAGS, "", fPreferencesLookupOrder); //$NON-NLS-1$
-		String priorities = fPreferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, "", fPreferencesLookupOrder); //$NON-NLS-1$
-		loadTagsAndPrioritiesFrom(tags, priorities);
-	}
-
-	/**
-	 * @param tags
-	 * @param priorities
-	 */
-	private void loadTagsAndPrioritiesFrom(String tagString, String priorityString) {
-		String[] tags = StringUtils.unpack(tagString);
-
-		StringTokenizer toker = null;
-		List list = new ArrayList();
-
-		toker = new StringTokenizer(priorityString, ","); //$NON-NLS-1$
-		while (toker.hasMoreTokens()) {
-			Integer number = null;
-			try {
-				number = Integer.valueOf(toker.nextToken());
-			}
-			catch (NumberFormatException e) {
-				number = new Integer(IMarker.PRIORITY_NORMAL);
-			}
-			list.add(number);
-		}
-		Integer[] priorities = (Integer[]) list.toArray(new Integer[0]);
-
-		fTaskTags = new TaskTag[Math.min(tags.length, priorities.length)];
-		for (int i = 0; i < fTaskTags.length; i++) {
-			fTaskTags[i] = new TaskTag(tags[i], priorities[i].intValue());
-		}
-	}
-
-	public void performApply() {
-		save();
-
-		if (!Arrays.equals(fOriginalTaskTags, fTaskTags)) {
-			fOwner.requestRedetection();
-		}
-		fOriginalTaskTags = fTaskTags;
-	}
-
-	public void performDefaults() {
-		if (_debugPreferences) {
-			System.out.println("Loading defaults in " + getClass().getName()); //$NON-NLS-1$
-		}
-		IEclipsePreferences[] preferences = new IEclipsePreferences[fPreferencesLookupOrder.length];
-		for (int i = 0; i < preferences.length; i++) {
-			preferences[i] = fPreferencesLookupOrder[i].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE);
-		}
-		String tags = fPreferencesService.get(TaskTagPreferenceKeys.TASK_TAG_TAGS, null, preferences);
-		String priorities = fPreferencesService.get(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, null, preferences);
-		loadTagsAndPrioritiesFrom(tags, priorities);
-		int selection = valueTable.getTable().getSelectionIndex();
-		valueTable.setInput(fTaskTags);
-		valueTable.getTable().setSelection(selection);
-	}
-
-	public void performOk() {
-		performApply();
-	}
-
-	/**
-	 * @param selection
-	 */
-	private void removeTag(int i) {
-		if (i < 0) {
-			return;
-		}
-		List taskTags = new ArrayList(Arrays.asList(fTaskTags));
-		taskTags.remove(i);
-		fTaskTags = (TaskTag[]) taskTags.toArray(new TaskTag[taskTags.size()]);
-		valueTable.setInput(fTaskTags);
-	}
-
-	private void save() {
-		IEclipsePreferences defaultPreferences = new DefaultScope().getNode(TaskTagPreferenceKeys.TASK_TAG_NODE);
-		String defaultTags = defaultPreferences.get(TaskTagPreferenceKeys.TASK_TAG_TAGS, null);
-		String defaultPriorities = defaultPreferences.get(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, null);
-
-		StringBuffer buf = new StringBuffer();
-		for (int i = 0; i < fTaskTags.length; i++) {
-			if (i > 0) {
-				buf.append(","); //$NON-NLS-1$
-			}
-			buf.append(fTaskTags[i].getTag());
-		}
-		String currentTags = buf.toString();
-		if (currentTags.equals(defaultTags) && !fPreferencesLookupOrder[0].getName().equals(DefaultScope.SCOPE)) {
-			if (_debugPreferences) {
-				System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_TAGS + " from scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			}
-			fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).remove(TaskTagPreferenceKeys.TASK_TAG_TAGS);
-		}
-		else {
-			fOwner.requestRedetection();
-			if (_debugPreferences) {
-				System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_TAGS + " \"" + currentTags + "\" in scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			}
-			fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).put(TaskTagPreferenceKeys.TASK_TAG_TAGS, currentTags);
-		}
-
-		StringBuffer buf2 = new StringBuffer();
-		for (int i = 0; i < fTaskTags.length; i++) {
-			if (i > 0) {
-				buf2.append(","); //$NON-NLS-1$
-			}
-			buf2.append(String.valueOf(fTaskTags[i].getPriority()));
-		}
-		String priorities = buf2.toString();
-
-		if (priorities.equals(defaultPriorities) && !fPreferencesLookupOrder[0].getName().equals(DefaultScope.SCOPE)) {
-			if (_debugPreferences) {
-				System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_PRIORITIES + " from scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			}
-			fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).remove(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES);
-		}
-		else {
-			fOwner.requestRedetection();
-			if (_debugPreferences) {
-				System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_PRIORITIES + " \"" + priorities + "\" in scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			}
-			fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).put(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, priorities);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/PropertyPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/PropertyPreferencePage.java
deleted file mode 100644
index cb1e7e9..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/PropertyPreferencePage.java
+++ /dev/null
@@ -1,268 +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.sse.ui.internal.preferences.ui;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-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;
-
-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;
-
-	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.setFont(composite.getFont());
-		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);
-		common.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-		if (fEnableProjectSettings != null) {
-			SelectionAdapter selectionAdapter = new SelectionAdapter() {
-				ControlEnableState enablements = null;
-
-				public void widgetSelected(SelectionEvent e) {
-					super.widgetSelected(e);
-					if (fEnableProjectSettings.getSelection()) {
-						if (enablements != null) {
-							enablements.restore();
-							enablements = null;
-						}
-					}
-					else {
-						enablements = ControlEnableState.disable(common);
-					}
-				}
-			};
-			selectionAdapter.widgetSelected(null);
-			fEnableProjectSettings.addSelectionListener(selectionAdapter);
-		}
-		return composite;
-	}
-
-	public void createControl(Composite parent) {
-		if (getProject() != null) {
-			noDefaultAndApplyButton();
-		}
-		super.createControl(parent);
-	}
-
-	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 && getElement() instanceof IProject) {
-			return (IProject) getElement();
-		}
-		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;
-	}
-
-	private void updateLinkEnablement() {
-		if (fData != null && fProjectSettingsLink != null) {
-			fProjectSettingsLink.setEnabled(!Boolean.TRUE.equals(fData.get(DISABLE_LINK)));
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/TaskTagPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/TaskTagPreferencePage.java
deleted file mode 100644
index 3f05cc2..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/TaskTagPreferencePage.java
+++ /dev/null
@@ -1,353 +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.sse.ui.internal.preferences.ui;
-
-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.ControlEnableState;
-import org.eclipse.jface.dialogs.MessageDialog;
-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.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.tasks.TaskScanningScheduler;
-import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.preferences.TabFolderLayout;
-import org.osgi.service.prefs.BackingStoreException;
-
-public class TaskTagPreferencePage extends PropertyPreferencePage {
-
-	private static final boolean _debugPreferences = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/preferences")); //$NON-NLS-1$ //$NON-NLS-2$
-	// Remember the last displayed tab for convenience
-	private static final String TASK_TAG_LAST_TAB = "task-tag-last-tab"; //$NON-NLS-1$
-
-	private int detectionRequested = 0;
-
-	private Button fEnableCheckbox = null;
-
-	private boolean fEnableTaskTags = true;
-
-	private boolean fOriginalEnableTaskTags = true;
-
-	private IPreferencesService fPreferencesService = null;
-
-	private Button fRedetectButton;
-
-	private SelectionListener fTabEnablementListener;
-
-	private TabFolder fTabFolder;
-	private IPreferenceTab[] fTabs = null;
-
-	public TaskTagPreferencePage() {
-		super();
-		fPreferencesService = Platform.getPreferencesService();
-	}
-
-	protected void contributeButtons(Composite parent) {
-		if (getElement() == null) {
-			((GridLayout) parent.getLayout()).numColumns += 2;
-			fRedetectButton = new Button(parent, SWT.PUSH);
-			fRedetectButton.setText(SSEUIMessages.TaskTagPreferencePage_32); //$NON-NLS-1$
-			fRedetectButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_FILL));
-			fRedetectButton.setEnabled(true);
-			fRedetectButton.addSelectionListener(new SelectionAdapter() {
-				public void widgetSelected(SelectionEvent e) {
-					Job redetectJob = new Job(SSEUIMessages.TaskTagPreferenceTab_27) { //$NON-NLS-1$
-						public Object getAdapter(Class adapter) {
-							return null;
-						}
-
-						protected IStatus run(IProgressMonitor monitor) {
-							TaskScanningScheduler.refresh();
-							return Status.OK_STATUS;
-						}
-					};
-					redetectJob.schedule();
-				}
-			});
-			Label spacer = new Label(parent, SWT.NONE);
-			spacer.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER));
-		}
-		super.contributeButtons(parent);
-	}
-
-	protected Control createCommonContents(Composite parent) {
-		Composite composite = new Composite(parent, SWT.NONE);
-		GridLayout compositeLayout = new GridLayout();
-		compositeLayout.marginLeft = 0;
-		compositeLayout.marginRight = 0;
-		composite.setLayout(compositeLayout);
-
-		IScopeContext[] preferenceScopes = createPreferenceScopes();
-		fOriginalEnableTaskTags = fEnableTaskTags = fPreferencesService.getBoolean(getPreferenceNodeQualifier(), TaskTagPreferenceKeys.TASK_TAG_ENABLE, false, preferenceScopes);
-		fEnableCheckbox = new Button(composite, SWT.CHECK);
-		fEnableCheckbox.setSelection(fEnableTaskTags);
-		fEnableCheckbox.setText(SSEUIMessages.TaskTagPreferenceTab_31); //$NON-NLS-1$
-		fEnableCheckbox.setSelection(fEnableTaskTags);
-		fEnableCheckbox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_END, false, false, 1, 1));
-
-		fTabFolder = new TabFolder(composite, SWT.NONE);
-		fTabFolder.setLayout(new TabFolderLayout());
-		fTabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
-
-		TabItem taskItem = new TabItem(fTabFolder, SWT.NONE);
-		MainTab mainTab = new MainTab(this, fPreferencesService, preferenceScopes);
-		taskItem.setText(mainTab.getTitle());
-		final Control taskTagsControl = mainTab.createContents(fTabFolder);
-		taskItem.setControl(taskTagsControl);
-
-		TabItem exclusionItem = new TabItem(fTabFolder, SWT.NONE);
-		ExclusionsTab exclusionsTab = new ExclusionsTab(this, fPreferencesService, preferenceScopes);
-		exclusionItem.setText(exclusionsTab.getTitle());
-		final Control exclusionControl = exclusionsTab.createContents(fTabFolder);
-		exclusionItem.setControl(exclusionControl);
-
-		fTabs = new IPreferenceTab[]{mainTab, exclusionsTab};
-
-		fTabEnablementListener = new SelectionAdapter() {
-			ControlEnableState[] lastEnableStates = null;
-
-			public void widgetSelected(SelectionEvent e) {
-				fEnableTaskTags = fEnableCheckbox.getSelection();
-				if (fEnableTaskTags) {
-					if (lastEnableStates != null) {
-						for (int i = 0; i < lastEnableStates.length; i++) {
-							if (lastEnableStates[i] != null) {
-								lastEnableStates[i].restore();
-							}
-						}
-						lastEnableStates = null;
-						fTabFolder.redraw();
-					}
-				}
-				else if (lastEnableStates == null) {
-					lastEnableStates = new ControlEnableState[fTabs.length + 1];
-					lastEnableStates[0] = ControlEnableState.disable(taskTagsControl);
-					lastEnableStates[1] = ControlEnableState.disable(exclusionControl);
-					if (fRedetectButton != null) {
-						lastEnableStates[2] = ControlEnableState.disable(fRedetectButton);
-					}
-				}
-			}
-		};
-		fTabEnablementListener.widgetSelected(null);
-		fEnableCheckbox.addSelectionListener(fTabEnablementListener);
-
-		// restore last selected tab
-		int activeTab = new DefaultScope().getNode(getPreferenceNodeQualifier()).getInt(TASK_TAG_LAST_TAB, 0);
-		if (activeTab > 0) {
-			fTabFolder.setSelection(activeTab);
-		}
-
-		SSEUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.PREFWEBX_TASKTAGS_HELPID);
-		return composite;
-	}
-
-	protected String getPreferenceNodeQualifier() {
-		return TaskTagPreferenceKeys.TASK_TAG_NODE;
-	}
-
-	protected String getPreferencePageID() {
-		return "org.eclipse.wst.sse.ui.preferences.tasktags";//$NON-NLS-1$
-
-	}
-
-	protected String getProjectSettingsKey() {
-		return TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT;
-	}
-
-	protected String getPropertyPageID() {
-		return "org.eclipse.wst.sse.ui.project.properties.tasktags";//$NON-NLS-1$
-	}
-
-	public String getTitle() {
-		return SSEUIMessages.TaskTagPreferenceTab_20; //$NON-NLS-1$
-	}
-
-	public void init(IWorkbench workbench) {
-	}
-
-	public void performApply() {
-		super.performApply();
-		save();
-
-		for (int i = 0; i < fTabs.length; i++) {
-			fTabs[i].performApply();
-		}
-
-		promptForRedetectIfNecessary();
-	}
-
-	public void performDefaults() {
-		super.performDefaults();
-		IEclipsePreferences defaultPreferences = createPreferenceScopes()[1].getNode(getPreferenceNodeQualifier());
-		fEnableTaskTags = defaultPreferences.getBoolean(TaskTagPreferenceKeys.TASK_TAG_ENABLE, false);
-		fEnableCheckbox.setSelection(fEnableTaskTags);
-		for (int i = 0; i < fTabs.length; i++) {
-			fTabs[i].performDefaults();
-		}
-		fTabEnablementListener.widgetSelected(null);
-		if (_debugPreferences) {
-			System.out.println("Loading defaults in " + getClass().getName()); //$NON-NLS-1$
-		}
-	}
-
-	public boolean performOk() {
-		boolean ok = super.performOk();
-		save();
-
-		for (int i = 0; i < fTabs.length; i++) {
-			fTabs[i].performOk();
-		}
-
-		promptForRedetectIfNecessary();
-
-		// save last tab (use Default scope since it won't be persisted)
-		new DefaultScope().getNode(getPreferenceNodeQualifier()).putInt(TASK_TAG_LAST_TAB, fTabFolder.getSelectionIndex());
-
-		IScopeContext[] contexts = createPreferenceScopes();
-		// remove project-specific information if it's not enabled
-		if (getProject() != null && !isElementSettingsEnabled()) {
-			if (_debugPreferences) {
-				System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT + " (" + true + ") in scope " + contexts[0].getName() + ":" + contexts[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$  
-			}
-			contexts[0].getNode(getPreferenceNodeQualifier()).remove(TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT);
-			if (_debugPreferences) {
-				System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED + " (" + true + ") in scope " + contexts[0].getName() + ":" + contexts[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$  
-			}
-			contexts[0].getNode(getPreferenceNodeQualifier()).remove(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED);
-			if (_debugPreferences) {
-				System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_PRIORITIES + " (" + true + ") in scope " + contexts[0].getName() + ":" + contexts[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$  
-			}
-			contexts[0].getNode(getPreferenceNodeQualifier()).remove(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES);
-			if (_debugPreferences) {
-				System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_TAGS + " (" + true + ") in scope " + contexts[0].getName() + ":" + contexts[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$  
-			}
-			contexts[0].getNode(getPreferenceNodeQualifier()).remove(TaskTagPreferenceKeys.TASK_TAG_TAGS);
-			if (_debugPreferences) {
-				System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_ENABLE + " (" + true + ") in scope " + contexts[0].getName() + ":" + contexts[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$  
-			}
-			contexts[0].getNode(getPreferenceNodeQualifier()).remove(TaskTagPreferenceKeys.TASK_TAG_ENABLE);
-		}
-		for (int i = 0; i < contexts.length; i++) {
-			try {
-				contexts[i].getNode(getPreferenceNodeQualifier()).flush();
-			}
-			catch (BackingStoreException e) {
-				Logger.logException("problem saving preference settings to scope " + contexts[i].getName(), e); //$NON-NLS-1$
-			}
-		}
-
-		return ok;
-	}
-
-
-	private void promptForRedetectIfNecessary() {
-		if (detectionRequested > 0) {
-			MessageDialog dialog = new MessageDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SSEUIMessages.TaskTagPreferenceTab_22, PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getImage(), SSEUIMessages.TaskTagPreferenceTab_23, MessageDialog.QUESTION, new String[]{SSEUIMessages.TaskTagPreferenceTab_24, SSEUIMessages.TaskTagPreferenceTab_25, SSEUIMessages.TaskTagPreferenceTab_26}, 2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-			int button = dialog.open();
-			if (button == 0) {
-				Job redetectJob = new Job(SSEUIMessages.TaskTagPreferenceTab_27) { //$NON-NLS-1$
-					public Object getAdapter(Class adapter) {
-						return null;
-					}
-
-					protected IStatus run(IProgressMonitor monitor) {
-						if (getProject() == null) {
-							if (_debugPreferences) {
-								System.out.println(getClass().getName() + ": rescanning all"); //$NON-NLS-1$
-							}
-							TaskScanningScheduler.refresh();
-						}
-						else {
-							if (_debugPreferences) {
-								System.out.println(getClass().getName() + ": rescanning " + getProject()); //$NON-NLS-1$
-							}
-							TaskScanningScheduler.refresh(getProject());
-						}
-						return Status.OK_STATUS;
-					}
-				};
-				redetectJob.schedule(500);
-			}
-			detectionRequested = 0;
-		}
-	}
-
-	void requestRedetection() {
-		detectionRequested++;
-	}
-
-	private void save() {
-		if (fEnableTaskTags != fOriginalEnableTaskTags) {
-			requestRedetection();
-		}
-		fOriginalEnableTaskTags = fEnableTaskTags;
-
-		IScopeContext[] preferenceScopes = createPreferenceScopes();
-		IEclipsePreferences defaultPreferences = preferenceScopes[1].getNode(getPreferenceNodeQualifier());
-		boolean defaultEnable = defaultPreferences.getBoolean(TaskTagPreferenceKeys.TASK_TAG_ENABLE, false);
-		if (fEnableTaskTags == defaultEnable) {
-			if (_debugPreferences) {
-				System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_ENABLE + " from scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			}
-			preferenceScopes[0].getNode(getPreferenceNodeQualifier()).remove(TaskTagPreferenceKeys.TASK_TAG_ENABLE);
-		}
-		else {
-			if (_debugPreferences) {
-				System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_ENABLE + " \"" + fEnableTaskTags + "\" 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(TaskTagPreferenceKeys.TASK_TAG_ENABLE, fEnableTaskTags);
-		}
-		if (getProject() != null && 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(TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT, true);
-		}
-		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(TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT);
-		}
-		try {
-			fPreferencesService.getRootNode().flush();
-		}
-		catch (BackingStoreException e) {
-			// log it, there is no recovery
-			Logger.logException(e);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EditorExecutionContext.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EditorExecutionContext.java
deleted file mode 100644
index 388a27d..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EditorExecutionContext.java
+++ /dev/null
@@ -1,85 +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.sse.ui;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.IExecutionDelegate;
-
-
-
-class EditorExecutionContext implements IExecutionDelegate {
-
-
-	StructuredTextEditor fEditor;
-
-	public EditorExecutionContext(StructuredTextEditor editor) {
-		super();
-		fEditor = editor;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.internal.document.IExecutionDelegate#execute(java.lang.Runnable)
-	 */
-	public void execute(final Runnable runnable) {
-		IWorkbench workbench = PlatformUI.getWorkbench();
-		final Display display = workbench.getDisplay();
-		if (display.getThread() == Thread.currentThread()) {
-			// if already in display thread, we can simply run, "as usual"
-			runnable.run();
-		} else {
-			// this is the part that's really new, that
-			// accomidate's a change in a document
-			// from background thread, by forcing it on
-			// the display thread.
-			final StructuredTextEditor editor = fEditor;
-			// if not in display thread, we "force" to run on display thread.
-			// see editors begin/end background job for other
-			// activities to best accomidate (for example, there
-			// is a "timed delay" before the editor itself leaves
-			// background-update mode).
-			// NOTE: this execute method itself is always called from
-			// inside of an ILock block, so another
-			// block is not not needed here for all these sycnExec's
-			display.syncExec(new Runnable() {
-				public void run() {
-					if (display != null && !display.isDisposed()) {
-						editor.beginBackgroundOperation();
-						try {
-							// here's where the document update/modification
-							// occurs
-							runnable.run();
-
-							// for future, possibly explore solutions such as
-							// this
-							//							IWorkbenchSiteProgressService jobService =
-							// (IWorkbenchSiteProgressService)
-							// editor.getEditorPart().getSite().getAdapter(IWorkbenchSiteProgressService.class);
-							//							jobService.runInUI(xxxxx)
-						} finally {
-							// this 'end' is just a signal to editor that this
-							// particular update is done. Its up to the editor
-							// to decide exactly when to leave its "background
-							// mode"
-							editor.endBackgroundOperation();
-						}
-					}
-				}
-			});
-		}
-	}
-}
-
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
deleted file mode 100644
index d57c8eb..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
+++ /dev/null
@@ -1,2969 +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.sse.ui;
-
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ResourceBundle;
-import java.util.Timer;
-import java.util.TimerTask;
-
-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.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ISelectionValidator;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextOperationTarget;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITextViewerExtension;
-import org.eclipse.jface.text.ITextViewerExtension2;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.source.ICharacterPairMatcher;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.text.source.LineChangeHover;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.jface.text.source.projection.ProjectionSupport;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTarget;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.events.MouseTrackAdapter;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.editors.text.ITextEditorHelpContextIds;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.texteditor.ChainedPreferenceStore;
-import org.eclipse.ui.texteditor.DefaultRangeIndicator;
-import org.eclipse.ui.texteditor.IAbstractTextEditorHelpContextIds;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.IStatusField;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
-import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
-import org.eclipse.ui.texteditor.TextOperationAction;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-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.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.text.IExecutionDelegatable;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorDropTargetAdapter;
-import org.eclipse.wst.sse.ui.internal.IExtendedContributor;
-import org.eclipse.wst.sse.ui.internal.IModelProvider;
-import org.eclipse.wst.sse.ui.internal.IPopupMenuContributor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.ReadOnlyAwareDropTargetAdapter;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.StorageModelProvider;
-import org.eclipse.wst.sse.ui.internal.StructuredLineChangeHover;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.UnknownContentTypeDialog;
-import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds;
-import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
-import org.eclipse.wst.sse.ui.internal.contentoutline.ConfigurableContentOutlinePage;
-import org.eclipse.wst.sse.ui.internal.correction.CorrectionAssistantProvider;
-import org.eclipse.wst.sse.ui.internal.debug.BreakpointRulerAction;
-import org.eclipse.wst.sse.ui.internal.debug.EditBreakpointAction;
-import org.eclipse.wst.sse.ui.internal.debug.ManageBreakpointAction;
-import org.eclipse.wst.sse.ui.internal.debug.ToggleBreakpointAction;
-import org.eclipse.wst.sse.ui.internal.debug.ToggleBreakpointsTarget;
-import org.eclipse.wst.sse.ui.internal.editor.EditorModelUtil;
-import org.eclipse.wst.sse.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.editor.StructuredModelDocumentProvider;
-import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
-import org.eclipse.wst.sse.ui.internal.hyperlink.OpenHyperlinkAction;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.eclipse.wst.sse.ui.internal.properties.ConfigurablePropertySheetPage;
-import org.eclipse.wst.sse.ui.internal.properties.ShowPropertiesAction;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ConfigurationPointCalculator;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.NullSourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.selection.SelectionHistory;
-import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
-import org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration;
-
-/**
- * A Text Editor for editing structured models and structured documents.
- * <p>
- * This class is not meant to be subclassed.<br />
- * New content types may associate source viewer, content outline, and
- * property sheet configurations to extend the existing functionality.
- * </p>
- * 
- * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
- * @see org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration
- * 
- * @since 1.0
- */
-
-public class StructuredTextEditor extends TextEditor {
-
-
-	// ISSUE: This use case is not clear to me.
-	// Is this listner and dance with dirty state for non-editor driven
-	// updates?
-	class InternalDocumentListener implements IDocumentListener {
-		// This is for the IDocumentListener interface
-		public void documentAboutToBeChanged(DocumentEvent event) {
-			fDirtyBeforeDocumentEvent = isDirty();
-		}
-
-		// This is for the IDocumentListener interface
-		public void documentChanged(DocumentEvent event) {
-			if (isEditorInputReadOnly()) {
-				// stop listening to document event
-				// caused by the undo after validateEdit
-				final int offset = event.getOffset() + event.getLength();
-				final IStructuredModel internalModel = getInternalModel();
-				fCurrentRunnable = new Runnable() {
-					public void run() {
-						if (!fEditorDisposed) {
-							boolean status = validateEditorInputState();
-							if (!status) {
-								if (internalModel != null) {
-									internalModel.getUndoManager().undo();
-									getSourceViewer().setSelectedRange(offset, 0);
-									if (!fDirtyBeforeDocumentEvent) {
-										// reset dirty state if
-										// model not dirty before
-										// document event
-										internalModel.setDirtyState(false);
-									}
-								}
-							}
-						}
-						fCurrentRunnable = null;
-					}
-				};
-				/*
-				 * We need to ensure that this is run via 'asyncExec' since
-				 * these notifications can come from a non-ui thread.
-				 * 
-				 * The non-ui thread call would occur when creating a new file
-				 * under ClearCase (or other library) control. The creation of
-				 * the new file would trigger a validateEdit call, on another
-				 * thread, that would prompt the user to add the new file to
-				 * version control.
-				 */
-				Display display = getDisplay();
-				if (display != null) {
-					if (Thread.currentThread() != display.getThread())
-						// future_TODO: there's probably a better
-						// way than relying on asycnExec
-						display.asyncExec(fCurrentRunnable);
-					else
-						fCurrentRunnable.run();
-				}
-			}
-		}
-	}
-
-	private class InternalModelStateListener implements IModelStateListener {
-		public void modelAboutToBeChanged(IStructuredModel model) {
-			if (getTextViewer() != null) {
-				// getTextViewer().setRedraw(false);
-			}
-		}
-
-		public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
-			if (getTextViewer() != null) {
-				// getTextViewer().setRedraw(false);
-				getTextViewer().unconfigure();
-			}
-		}
-
-		public void modelChanged(IStructuredModel model) {
-			if (getTextViewer() != null) {
-				// getTextViewer().setRedraw(true);
-				// Since the model can be changed on a background
-				// thread, we will update menus on display thread,
-				// if we are not already on display thread,
-				// and if there is not an update already pending.
-				// (we can get lots of 'modelChanged' events in rapid
-				// succession, so only need to do one.
-				if (!fUpdateMenuTextPending) {
-					runOnDisplayThreadIfNeededed(new Runnable() {
-						public void run() {
-							updateMenuText();
-							fUpdateMenuTextPending = false;
-						}
-					});
-				}
-
-			}
-		}
-
-		public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
-			// do nothing
-		}
-
-		public void modelReinitialized(IStructuredModel structuredModel) {
-			try {
-				if (getSourceViewer() != null) {
-					SourceViewerConfiguration cfg = getSourceViewerConfiguration();
-					getSourceViewer().configure(cfg);
-				}
-			}
-			catch (Exception e) {
-				// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=1166
-				// investigate each error case post beta
-				Logger.logException("problem trying to configure after model change", e); //$NON-NLS-1$
-			}
-			finally {
-				// so we don't freeze workbench (eg. during page language or
-				// content type change)
-				((ITextViewerExtension) getSourceViewer()).setRedraw(true);
-			}
-		}
-
-		// Note: this one should probably be used to
-		// control viewer
-		// instead of viewer having its own listener
-		public void modelResourceDeleted(IStructuredModel model) {
-			// do nothing
-		}
-
-		public void modelResourceMoved(IStructuredModel originalmodel, IStructuredModel movedmodel) {
-			// do nothing
-		}
-
-		/**
-		 * This 'Runnable' should be very brief, and should not "call out" to
-		 * other code especially if it depends on the state of the model.
-		 * 
-		 * @param r
-		 */
-		private void runOnDisplayThreadIfNeededed(Runnable r) {
-			// if there is no Display at all (that is, running headless),
-			// or if we are already running on the display thread, then
-			// simply execute the runnable.
-			if (getDisplay() == null || (Thread.currentThread() == getDisplay().getThread())) {
-				r.run();
-			}
-			else {
-				// otherwise force the runnable to run on the display thread.
-				getDisplay().asyncExec(r);
-			}
-		}
-	}
-
-	class MouseTracker extends MouseTrackAdapter implements MouseMoveListener {
-		/** The tracker's subject control. */
-		private Control fSubjectControl;
-
-		/**
-		 * Creates a new mouse tracker.
-		 */
-		public MouseTracker() {
-			// do nothing
-		}
-
-		public void mouseHover(MouseEvent event) {
-			// System.out.println("hover: "+event.x + "x" + event.y);
-			hoverX = event.x;
-			hoverY = event.y;
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.swt.events.MouseMoveListener#mouseMove(org.eclipse.swt.events.MouseEvent)
-		 */
-		public void mouseMove(MouseEvent e) {
-			hoverX = e.x;
-			hoverY = e.y;
-		}
-
-		/**
-		 * Starts this mouse tracker. The given control becomes this tracker's
-		 * subject control. Installs itself as mouse track listener on the
-		 * subject control.
-		 * 
-		 * @param subjectControl
-		 *            the subject control
-		 */
-		public void start(Control subjectControl) {
-			fSubjectControl = subjectControl;
-			if (fSubjectControl != null && !fSubjectControl.isDisposed()) {
-				fSubjectControl.addMouseMoveListener(this);
-				fSubjectControl.addMouseTrackListener(this);
-				fSubjectControl.addDisposeListener(new DisposeListener() {
-					public void widgetDisposed(DisposeEvent e) {
-						stop();
-					}
-				});
-			}
-		}
-
-		/**
-		 * Stops this mouse tracker. Removes itself as mouse track, mouse
-		 * move, and shell listener from the subject control.
-		 */
-		public void stop() {
-			if (fSubjectControl != null && !fSubjectControl.isDisposed()) {
-				fSubjectControl.removeMouseMoveListener(this);
-				fSubjectControl.removeMouseTrackListener(this);
-				fSubjectControl = null;
-			}
-		}
-	}
-
-	/**
-	 * Listens to double-click and selection from the outline page
-	 */
-	private class OutlinePageListener implements IDoubleClickListener, ISelectionChangedListener {
-		public void doubleClick(DoubleClickEvent event) {
-			if (event.getSelection().isEmpty())
-				return;
-
-			int start = -1;
-			int length = 0;
-			if (event.getSelection() instanceof IStructuredSelection) {
-				ISelection currentSelection = getSelectionProvider().getSelection();
-				if (currentSelection instanceof IStructuredSelection) {
-					Object current = ((IStructuredSelection) currentSelection).toArray();
-					Object newSelection = ((IStructuredSelection) event.getSelection()).toArray();
-					if (!current.equals(newSelection)) {
-						IStructuredSelection selection = (IStructuredSelection) event.getSelection();
-						Object o = selection.getFirstElement();
-						if (o instanceof IndexedRegion) {
-							start = ((IndexedRegion) o).getStartOffset();
-							length = ((IndexedRegion) o).getEndOffset() - start;
-						}
-						else if (o instanceof ITextRegion) {
-							start = ((ITextRegion) o).getStart();
-							length = ((ITextRegion) o).getEnd() - start;
-						}
-						else if (o instanceof IRegion) {
-							start = ((ITextRegion) o).getStart();
-							length = ((ITextRegion) o).getLength();
-						}
-					}
-				}
-			}
-			else if (event.getSelection() instanceof ITextSelection) {
-				start = ((ITextSelection) event.getSelection()).getOffset();
-				length = ((ITextSelection) event.getSelection()).getLength();
-			}
-			if (start > -1) {
-				getSourceViewer().setRangeIndication(start, length, false);
-				selectAndReveal(start, length);
-			}
-		}
-
-		public void selectionChanged(SelectionChangedEvent event) {
-			/*
-			 * Do not allow selection from other parts to affect selection in
-			 * the text widget if it has focus, or if we're still firing a
-			 * change of selection. Selection events "bouncing" off of other
-			 * parts are all that we can receive if we have focus (since we
-			 * forwarded our selection to the service just a moment ago), and
-			 * only the user should affect selection if we have focus.
-			 */
-
-			/* The isFiringSelection check only works if a selection listener */
-			if (event.getSelection().isEmpty() || fStructuredSelectionProvider.isFiringSelection())
-				return;
-
-			if (getSourceViewer() != null && getSourceViewer().getTextWidget() != null && !getSourceViewer().getTextWidget().isDisposed() && !getSourceViewer().getTextWidget().isFocusControl()) {
-				int start = -1;
-				int length = 0;
-				if (event.getSelection() instanceof IStructuredSelection) {
-					ISelection current = getSelectionProvider().getSelection();
-					if (current instanceof IStructuredSelection) {
-						Object[] currentSelection = ((IStructuredSelection) current).toArray();
-						Object[] newSelection = ((IStructuredSelection) event.getSelection()).toArray();
-						if (!Arrays.equals(currentSelection, newSelection)) {
-							if (newSelection.length > 0) {
-								/*
-								 * No ordering is guaranteed for multiple
-								 * selection
-								 */
-								Object o = newSelection[0];
-								if (o instanceof IndexedRegion) {
-									start = ((IndexedRegion) o).getStartOffset();
-									int end = ((IndexedRegion) o).getEndOffset();
-									if (newSelection.length > 1) {
-										for (int i = 1; i < newSelection.length; i++) {
-											start = Math.min(start, ((IndexedRegion) newSelection[i]).getStartOffset());
-											end = Math.max(end, ((IndexedRegion) newSelection[i]).getEndOffset());
-										}
-										length = end - start;
-									}
-								}
-								else if (o instanceof ITextRegion) {
-									start = ((ITextRegion) o).getStart();
-									int end = ((ITextRegion) o).getEnd();
-									if (newSelection.length > 1) {
-										for (int i = 1; i < newSelection.length; i++) {
-											start = Math.min(start, ((ITextRegion) newSelection[i]).getStart());
-											end = Math.max(end, ((ITextRegion) newSelection[i]).getEnd());
-										}
-										length = end - start;
-									}
-								}
-								else if (o instanceof IRegion) {
-									start = ((IRegion) o).getOffset();
-									int end = start + ((IRegion) o).getLength();
-									if (newSelection.length > 1) {
-										for (int i = 1; i < newSelection.length; i++) {
-											start = Math.min(start, ((IRegion) newSelection[i]).getOffset());
-											end = Math.max(end, ((IRegion) newSelection[i]).getOffset() + ((IRegion) newSelection[i]).getLength());
-										}
-										length = end - start;
-									}
-								}
-							}
-						}
-					}
-				}
-				else if (event.getSelection() instanceof ITextSelection) {
-					start = ((ITextSelection) event.getSelection()).getOffset();
-				}
-				if (start > -1) {
-					updateRangeIndication(event.getSelection());
-					selectAndReveal(start, length);
-				}
-			}
-		}
-	}
-
-	private class ShowInTargetListAdapter implements IShowInTargetList {
-		/**
-		 * Array of ID Strings that define the default show in targets for
-		 * this editor.
-		 * 
-		 * @see org.eclipse.ui.part.IShowInTargetList#getShowInTargetIds()
-		 * @return the array of ID Strings that define the default show in
-		 *         targets for this editor.
-		 */
-		public String[] getShowInTargetIds() {
-			return fShowInTargetIds;
-		}
-	}
-
-	/**
-	 * A post selection provider that wraps the provider implemented in
-	 * AbstractTextEditor to provide a StructuredTextSelection to post
-	 * selection listeners. Listens to selection changes from the source
-	 * viewer.
-	 */
-	private class StructuredSelectionProvider implements IPostSelectionProvider, ISelectionValidator {
-		/**
-		 * A "hybrid" text and structured selection class. Converts the source
-		 * viewer text selection to a generic "getIndexedRegion"-derived
-		 * structured selection, allowing selection changed listeners to
-		 * possibly not need to reference the model directly.
-		 */
-		private class StructuredTextSelection extends TextSelection implements IStructuredSelection {
-			private Object[] selectedStructures = null;
-
-			public StructuredTextSelection(ITextSelection selection) {
-				super(getSourceViewer().getDocument(), selection.getOffset(), selection.getLength());
-				selectedStructures = getSelectedObjects(selection);
-			}
-
-			public StructuredTextSelection(ITextSelection selection, Object[] selectedObjects) {
-				super(getSourceViewer().getDocument(), selection.getOffset(), selection.getLength());
-				selectedStructures = selectedObjects;
-			}
-
-			public Object getFirstElement() {
-				return selectedStructures.length > 0 ? selectedStructures[0] : null;
-			}
-
-			private Object[] getSelectedObjects(ITextSelection selection) {
-				IStructuredModel model = getInternalModel();
-				if (model != null) {
-					IndexedRegion region = model.getIndexedRegion(selection.getOffset());
-					int end = selection.getOffset() + selection.getLength();
-					if (region != null) {
-						if (end <= region.getEndOffset()) {
-							// single selection
-							selectedStructures = new Object[1];
-							selectedStructures[0] = region;
-						}
-						else {
-							// multiple selection
-							int maxLength = model.getStructuredDocument().getLength();
-							List structures = new ArrayList(2);
-							while (region != null && region.getEndOffset() <= end && region.getEndOffset() < maxLength) {
-								structures.add(region);
-								region = model.getIndexedRegion(region.getEndOffset() + 1);
-							}
-							selectedStructures = structures.toArray();
-						}
-					}
-				}
-				if (selectedStructures == null) {
-					selectedStructures = new Object[0];
-				}
-				return selectedStructures;
-			}
-
-			public boolean isEmpty() {
-				return super.isEmpty() && selectedStructures.length == 0;
-			}
-
-			public Iterator iterator() {
-				return toList().iterator();
-			}
-
-			public int size() {
-				return selectedStructures.length;
-			}
-
-			public Object[] toArray() {
-				return selectedStructures;
-			}
-
-			public List toList() {
-				return Arrays.asList(selectedStructures);
-			}
-
-			public String toString() {
-				return getOffset() + ":" + getLength() + "@" + selectedStructures; //$NON-NLS-1$ //$NON-NLS-2$
-			}
-		}
-
-		ISelectionProvider fParentProvider = null;
-		private boolean isFiringSelection = false;
-		private ListenerList listeners = new ListenerList();
-		private ListenerList postListeners = new ListenerList();
-		private ISelection fLastSelection = null;
-		private ISelectionProvider fLastSelectionProvider = null;
-		private SelectionChangedEvent fLastUpdatedSelectionChangedEvent = null;
-
-		StructuredSelectionProvider(ISelectionProvider parentProvider) {
-			fParentProvider = parentProvider;
-			fParentProvider.addSelectionChangedListener(new ISelectionChangedListener() {
-				public void selectionChanged(SelectionChangedEvent event) {
-					handleSelectionChanged(event);
-				}
-			});
-			if (fParentProvider instanceof IPostSelectionProvider) {
-				((IPostSelectionProvider) fParentProvider).addPostSelectionChangedListener(new ISelectionChangedListener() {
-					public void selectionChanged(SelectionChangedEvent event) {
-						handlePostSelectionChanged(event);
-					}
-				});
-			}
-		}
-
-		public void addPostSelectionChangedListener(ISelectionChangedListener listener) {
-			postListeners.add(listener);
-		}
-
-		public void addSelectionChangedListener(ISelectionChangedListener listener) {
-			listeners.add(listener);
-		}
-
-		private void fireSelectionChanged(final SelectionChangedEvent event, ListenerList listenerList) {
-			Object[] listeners = listenerList.getListeners();
-			isFiringSelection = true;
-			for (int i = 0; i < listeners.length; ++i) {
-				final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
-				Platform.run(new SafeRunnable() {
-					public void run() {
-						l.selectionChanged(event);
-					}
-				});
-			}
-			isFiringSelection = false;
-		}
-
-		private ISelectionProvider getParentProvider() {
-			return fParentProvider;
-		}
-
-		public ISelection getSelection() {
-			fLastSelection = null;
-			fLastSelectionProvider = null;
-			fLastUpdatedSelectionChangedEvent = null;
-
-			/*
-			 * When a client explicitly asks for selection, provide the hybrid
-			 * result.
-			 */
-			ISelection selection = getParentProvider().getSelection();
-			if (!(selection instanceof IStructuredSelection) && selection instanceof ITextSelection) {
-				selection = new StructuredTextSelection((ITextSelection) selection);
-			}
-			return selection;
-		}
-
-		void handlePostSelectionChanged(SelectionChangedEvent event) {
-			SelectionChangedEvent updatedEvent = null;
-			if (fLastSelection == event.getSelection() && fLastSelectionProvider == event.getSelectionProvider()) {
-				updatedEvent = fLastUpdatedSelectionChangedEvent;
-			}
-			else {
-				updatedEvent = updateEvent(event);
-			}
-			// only update the range indicator on post selection
-			updateRangeIndication(updatedEvent.getSelection());
-			fireSelectionChanged(updatedEvent, postListeners);
-		}
-
-		void handleSelectionChanged(SelectionChangedEvent event) {
-			SelectionChangedEvent updatedEvent = event;
-			if (fLastSelection != event.getSelection() || fLastSelectionProvider != event.getSelectionProvider()) {
-				fLastSelection = event.getSelection();
-				fLastSelectionProvider = event.getSelectionProvider();
-				fLastUpdatedSelectionChangedEvent = updatedEvent = updateEvent(event);
-			}
-			fireSelectionChanged(updatedEvent, listeners);
-		}
-
-		boolean isFiringSelection() {
-			return isFiringSelection;
-		}
-
-		public boolean isValid(ISelection selection) {
-			if (getParentProvider() instanceof ISelectionValidator) {
-				return ((ISelectionValidator) getParentProvider()).isValid(selection);
-			}
-			return true;
-		}
-
-		public void removePostSelectionChangedListener(ISelectionChangedListener listener) {
-			postListeners.remove(listener);
-		}
-
-		public void removeSelectionChangedListener(ISelectionChangedListener listener) {
-			listeners.remove(listener);
-		}
-
-		public void setSelection(ISelection selection) {
-			if (isFiringSelection()) {
-				return;
-			}
-
-			fLastSelection = null;
-			fLastSelectionProvider = null;
-			fLastUpdatedSelectionChangedEvent = null;
-
-			ISelection textSelection = updateSelection(selection);
-			getParentProvider().setSelection(textSelection);
-			updateRangeIndication(textSelection);
-		}
-
-		/**
-		 * Create a corresponding event that contains a
-		 * StructuredTextselection
-		 * 
-		 * @param event
-		 * @return
-		 */
-		private SelectionChangedEvent updateEvent(SelectionChangedEvent event) {
-			ISelection selection = event.getSelection();
-			if (selection instanceof ITextSelection && !(selection instanceof IStructuredSelection)) {
-				selection = new StructuredTextSelection((ITextSelection) event.getSelection());
-			}
-			SelectionChangedEvent newEvent = new SelectionChangedEvent(event.getSelectionProvider(), selection);
-			return newEvent;
-		}
-
-		/**
-		 * Create a corresponding StructuredTextselection
-		 * 
-		 * @param selection
-		 * @return
-		 */
-		private ISelection updateSelection(ISelection selection) {
-			ISelection updated = selection;
-			if (selection instanceof IStructuredSelection && !(selection instanceof ITextSelection) && !selection.isEmpty()) {
-				Object[] selectedObjects = ((IStructuredSelection) selection).toArray();
-				if (selectedObjects.length > 0) {
-					int start = -1;
-					int length = 0;
-
-					// no ordering is guaranteed for multiple selection
-					Object o = selectedObjects[0];
-					if (o instanceof IndexedRegion) {
-						start = ((IndexedRegion) o).getStartOffset();
-						int end = ((IndexedRegion) o).getEndOffset();
-						if (selectedObjects.length > 1) {
-							for (int i = 1; i < selectedObjects.length; i++) {
-								start = Math.min(start, ((IndexedRegion) selectedObjects[i]).getStartOffset());
-								end = Math.max(end, ((IndexedRegion) selectedObjects[i]).getEndOffset());
-							}
-							length = end - start;
-						}
-					}
-					else if (o instanceof ITextRegion) {
-						start = ((ITextRegion) o).getStart();
-						int end = ((ITextRegion) o).getEnd();
-						if (selectedObjects.length > 1) {
-							for (int i = 1; i < selectedObjects.length; i++) {
-								start = Math.min(start, ((ITextRegion) selectedObjects[i]).getStart());
-								end = Math.max(end, ((ITextRegion) selectedObjects[i]).getEnd());
-							}
-							length = end - start;
-						}
-					}
-
-					if (start > -1) {
-						updated = new StructuredTextSelection(new TextSelection(getSourceViewer().getDocument(), start, length), selectedObjects);
-					}
-				}
-			}
-			return updated;
-		};
-	}
-
-	class TimeOutExpired extends TimerTask {
-		public void run() {
-			getDisplay().syncExec(new Runnable() {
-				public void run() {
-					if (getDisplay() != null && !getDisplay().isDisposed())
-						endBusyStateInternal();
-				}
-			});
-		}
-
-	}
-
-	private class ConfigurationAndTarget {
-		private String fTargetId;
-		private StructuredTextViewerConfiguration fConfiguration;
-
-		public ConfigurationAndTarget(String targetId, StructuredTextViewerConfiguration config) {
-			fTargetId = targetId;
-			fConfiguration = config;
-		}
-
-		public String getTargetId() {
-			return fTargetId;
-		}
-
-		public StructuredTextViewerConfiguration getConfiguration() {
-			return fConfiguration;
-		}
-	}
-
-	/**
-	 * Not API. May be removed in the future.
-	 */
-	protected final static char[] BRACKETS = {'{', '}', '(', ')', '[', ']'};
-
-	private static final long BUSY_STATE_DELAY = 1000;
-	/**
-	 * Not API. May be removed in the future.
-	 */
-	protected static final String DOT = "."; //$NON-NLS-1$
-	private static final String EDITOR_CONTEXT_MENU_ID = "org.eclipse.wst.sse.ui.StructuredTextEditor.EditorContext"; //$NON-NLS-1$
-	private static final String EDITOR_CONTEXT_MENU_SUFFIX = ".source.EditorContext"; //$NON-NLS-1$
-	/** Non-NLS strings */
-	private static final String EDITOR_KEYBINDING_SCOPE_ID = "org.eclipse.wst.sse.ui.structuredTextEditorScope"; //$NON-NLS-1$
-	/**
-	 * Not API. May be removed in the future.
-	 */
-	public static final String GROUP_NAME_ADDITIONS = "additions"; //$NON-NLS-1$
-	/**
-	 * Not API. May be removed in the future.
-	 */
-	public static final String GROUP_NAME_FORMAT = "Format"; //$NON-NLS-1$
-	/**
-	 * Not API. May be removed in the future.
-	 */
-	public static final String GROUP_NAME_FORMAT_EXT = "Format.ext"; //$NON-NLS-1$
-
-	private static final String REDO_ACTION_DESC = SSEUIMessages.Redo___0___UI_; //$NON-NLS-1$ = "Redo: {0}."
-	private static final String REDO_ACTION_DESC_DEFAULT = SSEUIMessages.Redo_Text_Change__UI_; //$NON-NLS-1$ = "Redo Text Change."
-	private static final String REDO_ACTION_TEXT = SSEUIMessages._Redo__0___Ctrl_Y_UI_; //$NON-NLS-1$ = "&Redo {0} @Ctrl+Y"
-	private static final String REDO_ACTION_TEXT_DEFAULT = SSEUIMessages._Redo_Text_Change__Ctrl_Y_UI_; //$NON-NLS-1$ = "&Redo Text Change @Ctrl+Y"
-	private static final String RULER_CONTEXT_MENU_ID = "org.eclipse.wst.sse.ui.StructuredTextEditor.RulerContext"; //$NON-NLS-1$
-	private static final String RULER_CONTEXT_MENU_SUFFIX = ".source.RulerContext"; //$NON-NLS-1$
-
-	private final static String UNDERSCORE = "_"; //$NON-NLS-1$
-	/** Translatable strings */
-	private static final String UNDO_ACTION_DESC = SSEUIMessages.Undo___0___UI_; //$NON-NLS-1$ = "Undo: {0}."
-
-	private static final String UNDO_ACTION_DESC_DEFAULT = SSEUIMessages.Undo_Text_Change__UI_; //$NON-NLS-1$ = "Undo Text Change."
-	private static final String UNDO_ACTION_TEXT = SSEUIMessages._Undo__0___Ctrl_Z_UI_; //$NON-NLS-1$ = "&Undo {0} @Ctrl+Z"
-	private static final String UNDO_ACTION_TEXT_DEFAULT = SSEUIMessages._Undo_Text_Change__Ctrl_Z_UI_; //$NON-NLS-1$ = "&Undo Text Change @Ctrl+Z"
-	// development time/debug variables only
-	private int adapterRequests;
-
-	private long adapterTime;
-	private boolean fBackgroundJobEnded;
-	private boolean fBusyState;
-	private Timer fBusyTimer;
-	Runnable fCurrentRunnable = null;
-	boolean fDirtyBeforeDocumentEvent = false;
-	private ExtendedEditorDropTargetAdapter fDropAdapter;
-	private DropTarget fDropTarget;
-	private boolean fEditorDisposed = false;
-	private IEditorPart fEditorPart;
-	private IDocumentListener fInternalDocumentListener;
-	private InternalModelStateListener fInternalModelStateListener;
-	private MouseTracker fMouseTracker;
-	private IContentOutlinePage fOutlinePage;
-
-	private OutlinePageListener fOutlinePageListener = null;
-	/** This editor's projection model updater */
-	private IStructuredTextFoldingProvider fProjectionModelUpdater;
-	/** This editor's projection support */
-	private ProjectionSupport fProjectionSupport;
-	private IPropertySheetPage fPropertySheetPage;
-	private String fRememberTitle;
-	/** The ruler context menu to be disposed. */
-	private Menu fRulerContextMenu;
-	/** The ruler context menu manager to be disposed. */
-	private MenuManager fRulerContextMenuManager;
-
-	String[] fShowInTargetIds = new String[]{IPageLayout.ID_RES_NAV};
-
-	private IAction fShowPropertiesAction = null;
-	private IStructuredModel fStructuredModel;
-	StructuredSelectionProvider fStructuredSelectionProvider = null;
-	/** The text context menu to be disposed. */
-	private Menu fTextContextMenu;
-	/** The text context menu manager to be disposed. */
-	private MenuManager fTextContextMenuManager;
-	private String fViewerConfigurationTargetId;
-	/** The selection history of the editor */
-	private SelectionHistory fSelectionHistory;
-	private boolean fUpdateMenuTextPending;
-	int hoverX = -1;
-	int hoverY = -1;
-
-	private boolean shouldClose = false;
-	private long startPerfTime;
-	private boolean fisReleased;
-
-	/**
-	 * Creates a new Structured Text Editor.
-	 */
-	public StructuredTextEditor() {
-		super();
-		initializeDocumentProvider(null);
-	}
-
-	private void aboutToSaveModel() {
-		if (getInternalModel() != null) {
-			getInternalModel().aboutToChangeModel();
-		}
-	}
-
-	private void abstractTextEditorContextMenuAboutToShow(IMenuManager menu) {
-		menu.add(new Separator(ITextEditorActionConstants.GROUP_UNDO));
-		menu.add(new GroupMarker(ITextEditorActionConstants.GROUP_SAVE));
-		menu.add(new Separator(ITextEditorActionConstants.GROUP_COPY));
-		menu.add(new Separator(ITextEditorActionConstants.GROUP_PRINT));
-		menu.add(new Separator(ITextEditorActionConstants.GROUP_EDIT));
-		menu.add(new Separator(ITextEditorActionConstants.GROUP_FIND));
-		menu.add(new Separator(IWorkbenchActionConstants.GROUP_ADD));
-		menu.add(new Separator(ITextEditorActionConstants.GROUP_REST));
-		menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
-
-		if (isEditable()) {
-			addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ITextEditorActionConstants.UNDO);
-			addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ITextEditorActionConstants.REVERT_TO_SAVED);
-			addAction(menu, ITextEditorActionConstants.GROUP_SAVE, ITextEditorActionConstants.SAVE);
-			addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.CUT);
-			addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.COPY);
-			addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.PASTE);
-		}
-		else {
-			addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.COPY);
-		}
-
-		// from AbstractDecoratedTextEditor
-		IAction preferencesAction = getAction(ITextEditorActionConstants.CONTEXT_PREFERENCES);
-		menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator(ITextEditorActionConstants.GROUP_SETTINGS));
-		menu.appendToGroup(ITextEditorActionConstants.GROUP_SETTINGS, preferencesAction);
-	}
-
-	protected void addContextMenuActions(IMenuManager menu) {
-		// Only offer actions that affect the text if the viewer allows
-		// modification and supports any of these operations
-		IAction formatAll = getAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT);
-		IAction formatSelection = getAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS);
-		IAction cleanupAll = getAction(StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT);
-		boolean enableFormatMenu = (formatAll != null && formatAll.isEnabled()) || (formatSelection != null && formatSelection.isEnabled()) || (cleanupAll != null && cleanupAll.isEnabled());
-
-		if (getSourceViewer().isEditable() && enableFormatMenu) {
-			String label = SSEUIMessages.FormatMenu_label; //$NON-NLS-1$ = "Format"
-			MenuManager subMenu = new MenuManager(label, GROUP_NAME_FORMAT);
-			subMenu.add(new GroupMarker(GROUP_NAME_FORMAT_EXT));
-			addAction(subMenu, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT);
-			addAction(subMenu, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS);
-			subMenu.add(new GroupMarker(GROUP_NAME_ADDITIONS));
-			addAction(menu, ITextEditorActionConstants.GROUP_EDIT, StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT);
-			menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, subMenu);
-		}
-
-		// Some Design editors (DTD) rely on this view for their own uses
-		menu.appendToGroup(IWorkbenchActionConstants.GROUP_ADD, fShowPropertiesAction);
-	}
-
-	private void addExtendedContextMenuActions(IMenuManager menu) {
-		IEditorActionBarContributor c = getEditorSite().getActionBarContributor();
-		if (c instanceof IPopupMenuContributor) {
-			((IPopupMenuContributor) c).contributeToPopupMenu(menu);
-		}
-		else {
-			ExtendedEditorActionBuilder builder = new ExtendedEditorActionBuilder();
-			IExtendedContributor pmc = builder.readActionExtensions(getConfigurationPoints());
-			if (pmc != null) {
-				pmc.setActiveEditor(this);
-				pmc.contributeToPopupMenu(menu);
-			}
-		}
-	}
-
-	protected void addExtendedRulerContextMenuActions(IMenuManager menu) {
-		// none at this level
-	}
-
-
-
-	/**
-	 * Starts background mode.
-	 * <p>
-	 * Not API. May be removed in the future.
-	 * </p>
-	 */
-	void beginBackgroundOperation() {
-		fBackgroundJobEnded = false;
-		// if already in busy state, no need to do anything
-		// and, we only start, or reset, the timed busy
-		// state when we get the "endBackgroundOperation" call.
-		if (!inBusyState()) {
-			beginBusyStateInternal();
-		}
-	}
-
-	private void beginBusyStateInternal() {
-
-		fBusyState = true;
-		startBusyTimer();
-
-		ISourceViewer viewer = getSourceViewer();
-		if (viewer instanceof StructuredTextViewer) {
-			((StructuredTextViewer) viewer).beginBackgroundUpdate();
-
-		}
-		showBusy(true);
-	}
-
-	// private void addFindOccurrencesAction(String matchType, String
-	// matchText, IMenuManager menu) {
-	//
-	// AbstractFindOccurrencesAction action = new
-	// AbstractFindOccurrencesAction(getFileInEditor(), new
-	// SearchUIConfiguration(), (IStructuredDocument) getDocument(),
-	// matchType, matchText, getProgressMonitor());
-	// action.setText("Occurrences of \"" + matchText + "\" in File");
-	// menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, action);
-	// }
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.ITextEditor#close(boolean)
-	 */
-	public void close(final boolean save) {
-		/*
-		 * Instead of us closing directly, we have to close with our
-		 * containing (multipage) editor, if it exists.
-		 */
-		if (getSite() == null) {
-			// if site hasn't been set yet, then we're not
-			// completely open
-			// so set a flag not to open
-			shouldClose = true;
-		}
-		else {
-			if (getEditorPart() != null) {
-				Display display = getSite().getShell().getDisplay();
-				display.asyncExec(new Runnable() {
-
-					public void run() {
-						getSite().getPage().closeEditor(getEditorPart(), save);
-					}
-				});
-			}
-			else {
-				super.close(save);
-			}
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#collectContextMenuPreferencePages()
-	 */
-	protected String[] collectContextMenuPreferencePages() {
-		List allIds = new ArrayList(0);
-
-		// get contributed preference pages
-		ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
-		String[] configurationIds = getConfigurationPoints();
-		for (int i = 0; i < configurationIds.length; i++) {
-			String[] definitions = builder.getDefinitions("preferencepages", configurationIds[i]); //$NON-NLS-1$
-			for (int j = 0; j < definitions.length; j++) {
-				String someIds = definitions[j];
-				if (someIds != null && someIds.length() > 0) {
-					// supports multiple comma-delimited page IDs in one
-					// element
-					String[] ids = StringUtils.unpack(someIds);
-					for (int k = 0; k < ids.length; k++) {
-						// trim, just to keep things clean
-						String id = ids[k].trim();
-						if (!allIds.contains(id)) {
-							allIds.add(id);
-						}
-					}
-				}
-			}
-		}
-
-		// add pages contributed by super
-		String[] superPages = super.collectContextMenuPreferencePages();
-		for (int m = 0; m < superPages.length; m++) {
-			// trim, just to keep things clean
-			String id = superPages[m].trim();
-			if (!allIds.contains(id)) {
-				allIds.add(id);
-			}
-		}
-
-		return (String[]) allIds.toArray(new String[0]);
-	}
-
-	/**
-	 * Compute and set double-click action for the vertical ruler
-	 */
-	private void computeAndSetDoubleClickAction() {
-		/*
-		 * Make double-clicking on the ruler toggle a breakpoint instead of
-		 * toggling a bookmark. For lines where a breakpoint won't be created,
-		 * create a bookmark through the contributed RulerDoubleClick action.
-		 */
-		setAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK, new ToggleBreakpointAction(this, getVerticalRuler(), getAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK)));
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.ExtendedTextEditor#configureSourceViewerDecorationSupport(org.eclipse.ui.texteditor.SourceViewerDecorationSupport)
-	 */
-	protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support) {
-		support.setCharacterPairMatcher(createCharacterPairMatcher());
-		support.setMatchingCharacterPainterPreferenceKeys(EditorPreferenceNames.MATCHING_BRACKETS, EditorPreferenceNames.MATCHING_BRACKETS_COLOR);
-
-		super.configureSourceViewerDecorationSupport(support);
-	}
-
-	protected void createActions() {
-		super.createActions();
-		ResourceBundle resourceBundle = SSEUIMessages.getResourceBundle();
-		IWorkbenchHelpSystem helpSystem = SSEUIPlugin.getDefault().getWorkbench().getHelpSystem();
-		// TextView Action - moving the selected text to
-		// the clipboard
-		// override the cut/paste/delete action to make
-		// them run on read-only
-		// files
-		Action action = new TextOperationAction(resourceBundle, "Editor_Cut_", this, ITextOperationTarget.CUT, true); //$NON-NLS-1$
-		action.setActionDefinitionId(IWorkbenchActionDefinitionIds.CUT);
-		setAction(ITextEditorActionConstants.CUT, action);
-		helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.CUT_ACTION);
-		// TextView Action - inserting the clipboard
-		// content at the current
-		// position
-		// override the cut/paste/delete action to make
-		// them run on read-only
-		// files
-		action = new TextOperationAction(resourceBundle, "Editor_Paste_", this, ITextOperationTarget.PASTE, true); //$NON-NLS-1$
-		action.setActionDefinitionId(IWorkbenchActionDefinitionIds.PASTE);
-		setAction(ITextEditorActionConstants.PASTE, action);
-		helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.PASTE_ACTION);
-		// TextView Action - deleting the selected text or
-		// if selection is
-		// empty the character at the right of the current
-		// position
-		// override the cut/paste/delete action to make
-		// them run on read-only
-		// files
-		action = new TextOperationAction(resourceBundle, "Editor_Delete_", this, ITextOperationTarget.DELETE, true); //$NON-NLS-1$
-		action.setActionDefinitionId(IWorkbenchActionDefinitionIds.DELETE);
-		setAction(ITextEditorActionConstants.DELETE, action);
-		helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.DELETE_ACTION);
-		// SourceView Action - requesting information at
-		// the current insertion
-		// position
-		action = new TextOperationAction(SSEUIMessages.getResourceBundle(), StructuredTextEditorActionConstants.ACTION_NAME_INFORMATION + UNDERSCORE, this, ISourceViewer.INFORMATION, true);
-		action.setActionDefinitionId(ActionDefinitionIds.INFORMATION);
-		setAction(StructuredTextEditorActionConstants.ACTION_NAME_INFORMATION, action);
-		markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_INFORMATION, true);
-		// SourceView Action - requesting content assist to
-		// show completetion
-		// proposals for the current insert position
-		action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS + UNDERSCORE, this, ISourceViewer.CONTENTASSIST_PROPOSALS, true);
-		helpSystem.setHelp(action, IHelpContextIds.CONTMNU_CONTENTASSIST_HELPID);
-		action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
-		setAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS, action);
-		markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS, true);
-		// SourceView Action - requesting content assist to
-		// show the content
-		// information for the current insert position
-		action = new TextOperationAction(SSEUIMessages.getResourceBundle(), StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION + UNDERSCORE, this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION);
-		action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
-		setAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION, action);
-		markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION, true);
-		// StructuredTextViewer Action - requesting
-		// correction assist to show
-		// correction proposals for the current position
-		action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_QUICK_FIX + UNDERSCORE, this, StructuredTextViewer.QUICK_FIX, true);
-		action.setActionDefinitionId(ActionDefinitionIds.QUICK_FIX);
-		setAction(StructuredTextEditorActionConstants.ACTION_NAME_QUICK_FIX, action);
-		markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_QUICK_FIX, true);
-		// StructuredTextViewer Action - requesting format
-		// of the whole
-		// document
-		action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT + UNDERSCORE, this, StructuredTextViewer.FORMAT_DOCUMENT);
-		helpSystem.setHelp(action, IHelpContextIds.CONTMNU_FORMAT_DOC_HELPID);
-		action.setActionDefinitionId(ActionDefinitionIds.FORMAT_DOCUMENT);
-		setAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT, action);
-		markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT, true);
-		markAsSelectionDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT, true);
-		// StructuredTextViewer Action - requesting format
-		// of the active
-		// elements
-		action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS + UNDERSCORE, this, StructuredTextViewer.FORMAT_ACTIVE_ELEMENTS);
-		helpSystem.setHelp(action, IHelpContextIds.CONTMNU_FORMAT_ELEMENTS_HELPID);
-		action.setActionDefinitionId(ActionDefinitionIds.FORMAT_ACTIVE_ELEMENTS);
-		setAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS, action);
-		markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS, true);
-		markAsSelectionDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS, true);
-
-		// StructuredTextEditor Action - add breakpoints (falling back to the
-		// current double-click if they can't be added)
-		action = new ToggleBreakpointAction(this, getVerticalRuler());
-		setAction(ActionDefinitionIds.TOGGLE_BREAKPOINTS, action);
-		// StructuredTextEditor Action - manage breakpoints
-		action = new ManageBreakpointAction(this, getVerticalRuler());
-		setAction(ActionDefinitionIds.MANAGE_BREAKPOINTS, action);
-		// StructuredTextEditor Action - edit breakpoints
-		action = new EditBreakpointAction(this, getVerticalRuler());
-		setAction(ActionDefinitionIds.EDIT_BREAKPOINTS, action);
-		// StructuredTextViewer Action - open file on selection
-		action = new OpenHyperlinkAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE + UNDERSCORE, this, getSourceViewer());
-		action.setActionDefinitionId(ActionDefinitionIds.OPEN_FILE);
-		setAction(StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE, action);
-
-		computeAndSetDoubleClickAction();
-
-		fShowPropertiesAction = new ShowPropertiesAction();
-	}
-
-	protected LineChangeHover createChangeHover() {
-		return new StructuredLineChangeHover();
-	}
-
-	protected ICharacterPairMatcher createCharacterPairMatcher() {
-		ICharacterPairMatcher matcher = null;
-		ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
-		String[] ids = getConfigurationPoints();
-		for (int i = 0; matcher == null && i < ids.length; i++) {
-			matcher = (ICharacterPairMatcher) builder.getConfiguration(DocumentRegionEdgeMatcher.ID, ids[i]);
-		}
-		if (matcher == null) {
-			matcher = new ICharacterPairMatcher() {
-
-				public void clear() {
-				}
-
-				public void dispose() {
-				}
-
-				public int getAnchor() {
-					return ICharacterPairMatcher.LEFT;
-				}
-
-				public IRegion match(IDocument iDocument, int i) {
-					return null;
-				}
-			};
-		}
-		return matcher;
-	}
-
-	/**
-	 * Create a preference store that combines the source editor preferences
-	 * with the base editor's preferences.
-	 * 
-	 * @return IPreferenceStore
-	 */
-	private IPreferenceStore createCombinedPreferenceStore() {
-		IPreferenceStore sseEditorPrefs = SSEUIPlugin.getDefault().getPreferenceStore();
-		IPreferenceStore baseEditorPrefs = EditorsUI.getPreferenceStore();
-		return new ChainedPreferenceStore(new IPreferenceStore[]{sseEditorPrefs, baseEditorPrefs});
-	}
-
-	private ContentOutlineConfiguration createContentOutlineConfiguration() {
-		ContentOutlineConfiguration cfg = null;
-		ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
-		String[] ids = getConfigurationPoints();
-		for (int i = 0; cfg == null && i < ids.length; i++) {
-			cfg = (ContentOutlineConfiguration) builder.getConfiguration(ExtendedConfigurationBuilder.CONTENTOUTLINECONFIGURATION, ids[i]);
-		}
-		return cfg;
-	}
-
-	/**
-	 * Only gets the correction assistant associted with the current source
-	 * viewer configuration.
-	 * 
-	 * @return IContentAssistant or null
-	 */
-	private IContentAssistant createCorrectionAssistant() {
-		IContentAssistant assist = null;
-		ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
-		CorrectionAssistantProvider provider = (CorrectionAssistantProvider) builder.getConfiguration("correctionassistant", fViewerConfigurationTargetId); //$NON-NLS-1$
-		if (provider != null) {
-			assist = provider.getCorrectionAssistant(getSourceViewer());
-		}
-		return assist;
-	}
-
-	protected void createModelDependentFields() {
-		// none at this level
-	}
-
-	/**
-	 * {@inheritDoc}
-	 * <p>
-	 * Use StructuredTextViewerConfiguration if a viewerconfiguration has not
-	 * already been set. Also initialize StructuredTextViewer.
-	 * </p>
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createPartControl(org.eclipse.swt.widgets.Composite)
-	 */
-	public void createPartControl(Composite parent) {
-		if (getSourceViewerConfiguration() == null) {
-			ConfigurationAndTarget cat = createSourceViewerConfiguration();
-			fViewerConfigurationTargetId = cat.getTargetId();
-			StructuredTextViewerConfiguration newViewerConfiguration = cat.getConfiguration();
-			setSourceViewerConfiguration(newViewerConfiguration);
-		}
-
-		super.createPartControl(parent);
-
-		// instead of calling setInput twice, use initializeSourceViewer() to
-		// handle source viewer initialization previously handled by setInput
-		initializeSourceViewer();
-
-		// update editor context menu, vertical ruler context menu, infopop
-		if (getInternalModel() != null) {
-			updateEditorControlsForContentType(getInternalModel().getContentTypeIdentifier());
-		}
-		else {
-			updateEditorControlsForContentType(null);
-		}
-	}
-
-	protected PropertySheetConfiguration createPropertySheetConfiguration() {
-		PropertySheetConfiguration cfg = null;
-		ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
-		String[] ids = getConfigurationPoints();
-		for (int i = 0; cfg == null && i < ids.length; i++) {
-			cfg = (PropertySheetConfiguration) builder.getConfiguration(ExtendedConfigurationBuilder.PROPERTYSHEETCONFIGURATION, ids[i]);
-		}
-		return cfg;
-	}
-
-	/**
-	 * Loads the Show In Target IDs from the Extended Configuration extension
-	 * point.
-	 * 
-	 * @return
-	 */
-	private String[] createShowInTargetIds() {
-		List allIds = new ArrayList(0);
-		ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
-		String[] configurationIds = getConfigurationPoints();
-		for (int i = 0; i < configurationIds.length; i++) {
-			String[] definitions = builder.getDefinitions("showintarget", configurationIds[i]); //$NON-NLS-1$
-			for (int j = 0; j < definitions.length; j++) {
-				String someIds = definitions[j];
-				if (someIds != null && someIds.length() > 0) {
-					String[] ids = StringUtils.unpack(someIds);
-					for (int k = 0; k < ids.length; k++) {
-						// trim, just to keep things clean
-						String id = ids[k].trim();
-						if (!allIds.contains(id)) {
-							allIds.add(id);
-						}
-					}
-				}
-			}
-		}
-
-		if (!allIds.contains(IPageLayout.ID_RES_NAV)) {
-			allIds.add(IPageLayout.ID_RES_NAV);
-		}
-		if (!allIds.contains(IPageLayout.ID_OUTLINE)) {
-			allIds.add(IPageLayout.ID_OUTLINE);
-		}
-		return (String[]) allIds.toArray(new String[0]);
-	}
-
-	/**
-	 * @return
-	 */
-	private ISourceEditingTextTools createSourceEditingTextTools() {
-		ISourceEditingTextTools tools = null;
-		ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
-		String[] ids = getConfigurationPoints();
-		for (int i = 0; tools == null && i < ids.length; i++) {
-			tools = (ISourceEditingTextTools) builder.getConfiguration(NullSourceEditingTextTools.ID, ids[i]);
-		}
-		if (tools == null) {
-			tools = NullSourceEditingTextTools.getInstance();
-		}
-		Method method = null; //$NON-NLS-1$
-		try {
-			method = tools.getClass().getMethod("setTextEditor", new Class[]{StructuredTextEditor.class}); //$NON-NLS-1$
-		}
-		catch (NoSuchMethodException e) {
-		}
-		if (method == null) {
-			try {
-				method = tools.getClass().getMethod("setTextEditor", new Class[]{ITextEditor.class}); //$NON-NLS-1$
-			}
-			catch (NoSuchMethodException e) {
-			}
-		}
-		if (method == null) {
-			try {
-				method = tools.getClass().getMethod("setTextEditor", new Class[]{IEditorPart.class}); //$NON-NLS-1$
-			}
-			catch (NoSuchMethodException e) {
-			}
-		}
-		if (method != null) {
-			if (!method.isAccessible()) {
-				method.setAccessible(true);
-			}
-			try {
-				method.invoke(tools, new Object[]{this});
-			}
-			catch (Exception e) {
-				Logger.logException("Problem creating ISourceEditingTextTools implementation", e); //$NON-NLS-1$
-			}
-		}
-
-		return tools;
-	}
-
-	/**
-	 * Creates the source viewer to be used by this editor
-	 */
-	protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler verticalRuler, int styles) {
-		fAnnotationAccess = createAnnotationAccess();
-		fOverviewRuler = createOverviewRuler(getSharedColors());
-		StructuredTextViewer sourceViewer = createStructedTextViewer(parent, verticalRuler, styles);
-		initSourceViewer(sourceViewer);
-		return sourceViewer;
-	}
-
-	private ConfigurationAndTarget createSourceViewerConfiguration() {
-		ConfigurationAndTarget cat = null;
-		StructuredTextViewerConfiguration cfg = null;
-		ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
-		String[] ids = getConfigurationPoints();
-		for (int i = 0; cfg == null && i < ids.length; i++) {
-			cfg = (StructuredTextViewerConfiguration) builder.getConfiguration(ExtendedConfigurationBuilder.SOURCEVIEWERCONFIGURATION, ids[i]);
-			cat = new ConfigurationAndTarget(ids[i], cfg);
-		}
-		if (cfg == null) {
-			cfg = new StructuredTextViewerConfiguration();
-			String targetid = getClass().getName() + "#default"; //$NON-NLS-1$
-			cat = new ConfigurationAndTarget(targetid, cfg);
-		}
-		return cat;
-	}
-
-	protected StructuredTextViewer createStructedTextViewer(Composite parent, IVerticalRuler verticalRuler, int styles) {
-		return new StructuredTextViewer(parent, verticalRuler, getOverviewRuler(), isOverviewRulerVisible(), styles);
-	}
-
-	protected void createUndoRedoActions() {
-		// overridden to add icons to actions
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=111877
-		super.createUndoRedoActions();
-		IAction action = getAction(ITextEditorActionConstants.UNDO);
-		if (action != null) {
-			action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
-		}
-
-		action = getAction(ITextEditorActionConstants.REDO);
-		if (action != null) {
-			action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.IWorkbenchPart#dispose()
-	 */
-	public void dispose() {
-		Logger.trace("Source Editor", "StructuredTextEditor::dispose entry"); //$NON-NLS-1$ //$NON-NLS-2$
-		if (org.eclipse.wst.sse.core.internal.util.Debug.perfTestAdapterClassLoading) {
-			System.out.println("Total calls to getAdapter: " + adapterRequests); //$NON-NLS-1$
-			System.out.println("Total time in getAdapter: " + adapterTime); //$NON-NLS-1$
-			System.out.println("Average time per call: " + (adapterTime / adapterRequests)); //$NON-NLS-1$
-		}
-
-		// dispose of selection history
-		if (fSelectionHistory != null) {
-			fSelectionHistory.dispose();
-			fSelectionHistory = null;
-		}
-
-		// dispose of document folding support
-		if (fProjectionModelUpdater != null) {
-			fProjectionModelUpdater.uninstall();
-			fProjectionModelUpdater = null;
-		}
-
-		if (fProjectionSupport != null) {
-			fProjectionSupport.dispose();
-			fProjectionSupport = null;
-		}
-
-		// subclass may not have mouse tracker created
-		// need to check for null before stopping
-		if (fMouseTracker != null) {
-			fMouseTracker.stop();
-			fMouseTracker = null;
-		}
-
-		// dispose of menus that were being tracked
-		if (fTextContextMenu != null) {
-			fTextContextMenu.dispose();
-		}
-		if (fRulerContextMenu != null) {
-			fRulerContextMenu.dispose();
-		}
-		if (fTextContextMenuManager != null) {
-			fTextContextMenuManager.removeMenuListener(getContextMenuListener());
-			fTextContextMenuManager.removeAll();
-			fTextContextMenuManager.dispose();
-		}
-		if (fRulerContextMenuManager != null) {
-			fRulerContextMenuManager.removeMenuListener(getContextMenuListener());
-			fRulerContextMenuManager.removeAll();
-			fRulerContextMenuManager.dispose();
-		}
-
-		// added this 2/20/2004 based on probe results --
-		// seems should be handled by setModel(null), but
-		// that's a more radical change.
-		// and, technically speaking, should not be needed,
-		// but makes a memory leak
-		// less severe.
-		if (fStructuredModel != null) {
-			if (fStructuredModel.getStructuredDocument() != null) {
-				fStructuredModel.getStructuredDocument().removeDocumentListener(getInternalDocumentListener());
-			}
-			fStructuredModel.removeModelStateListener(getInternalModelStateListener());
-		}
-
-		IDocument doc = getDocumentProvider().getDocument(getEditorInput());
-		if (doc != null) {
-			doc.removeDocumentListener(getInternalDocumentListener());
-			if (doc instanceof IExecutionDelegatable) {
-				((IExecutionDelegatable) doc).setExecutionDelegate(null);
-			}
-		}
-
-		// some things in the configuration need to clean
-		// up after themselves
-		if (fOutlinePage != null) {
-			if (fOutlinePage instanceof ConfigurableContentOutlinePage && fOutlinePageListener != null) {
-				((ConfigurableContentOutlinePage) fOutlinePage).removeDoubleClickListener(fOutlinePageListener);
-			}
-			if (fOutlinePageListener != null) {
-				fOutlinePage.removeSelectionChangedListener(fOutlinePageListener);
-			}
-		}
-
-		fEditorDisposed = true;
-		disposeModelDependentFields();
-
-		if (fDropTarget != null)
-			fDropTarget.dispose();
-
-		setPreferenceStore(null);
-
-		// strictly speaking, but following null outs
-		// should not be needed,
-		// but in the event of a memory leak, they make the
-		// memory leak less
-		// severe
-		fDropAdapter = null;
-		fDropTarget = null;
-
-		super.dispose();
-		Logger.trace("Source Editor", "StructuredTextEditor::dispose exit"); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#disposeDocumentProvider()
-	 */
-	protected void disposeDocumentProvider() {
-		if (fStructuredModel != null && !fisReleased && !(getDocumentProvider() instanceof IModelProvider)) {
-			fStructuredModel.releaseFromEdit();
-			fisReleased = true;
-		}
-		super.disposeDocumentProvider();
-	}
-
-	/**
-	 * Disposes model specific editor helpers such as statusLineHelper.
-	 * Basically any code repeated in update() & dispose() should be placed
-	 * here.
-	 */
-	private void disposeModelDependentFields() {
-		// none at this level
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.ITextEditor#doRevertToSaved()
-	 */
-	public void doRevertToSaved() {
-		super.doRevertToSaved();
-		if (fOutlinePage != null && fOutlinePage instanceof IUpdate) {
-			((IUpdate) fOutlinePage).update();
-		}
-		// reset undo
-		IDocument doc = getDocumentProvider().getDocument(getEditorInput());
-		if (doc instanceof IStructuredDocument) {
-			((IStructuredDocument) doc).getUndoManager().getCommandStack().flush();
-		}
-
-		// update menu text
-		updateMenuText();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public void doSave(IProgressMonitor progressMonitor) {
-		try {
-			aboutToSaveModel();
-			updateEncodingMemento();
-			super.doSave(progressMonitor);
-		}
-		finally {
-			savedModel();
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractTextEditor#doSetInput(org.eclipse.ui.IEditorInput)
-	 */
-	protected void doSetInput(IEditorInput input) throws CoreException {
-		try {
-			// TODO: if opened in more than one editor, this will cause
-			// problems.
-			IEditorInput oldInput = getEditorInput();
-			if (oldInput != null) {
-				IDocument olddoc = getDocumentProvider().getDocument(oldInput);
-				if (olddoc != null && olddoc instanceof IExecutionDelegatable) {
-					((IExecutionDelegatable) olddoc).setExecutionDelegate(null);
-				}
-			}
-
-			if (fStructuredModel != null && !(getDocumentProvider() instanceof IModelProvider)) {
-				fStructuredModel.releaseFromEdit();
-			}
-
-			super.doSetInput(input);
-
-			IDocument newDocument = getDocumentProvider().getDocument(input);
-			if (newDocument instanceof IExecutionDelegatable) {
-				((IExecutionDelegatable) newDocument).setExecutionDelegate(new EditorExecutionContext(this));
-			}
-
-			IStructuredModel model = null;
-			// if we have a Model provider, get the model from it
-			if (getDocumentProvider() instanceof IModelProvider) {
-				model = ((IModelProvider) getDocumentProvider()).getModel(getEditorInput());
-				if (!model.isShared()) {
-					EditorModelUtil.addFactoriesTo(model);
-				}
-			}
-			else {
-				if (newDocument instanceof IStructuredDocument) {
-					// corresponding releaseFromEdit occurs in
-					// dispose()
-					model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) newDocument);
-					EditorModelUtil.addFactoriesTo(model);
-				}
-
-				else {
-					logUnexpectedDocumentKind(input);
-				}
-			}
-
-			if (fStructuredModel != null || model != null) {
-				setModel(model);
-			}
-
-			if (getInternalModel() != null) {
-				updateEditorControlsForContentType(getInternalModel().getContentTypeIdentifier());
-			}
-			else {
-				updateEditorControlsForContentType(null);
-			}
-
-			if (fProjectionModelUpdater != null)
-				fProjectionModelUpdater.initialize();
-
-			// start editor with smart insert mode
-			setInsertMode(SMART_INSERT);
-		}
-		catch (CoreException exception) {
-			// dispose editor
-			dispose();
-
-			throw new CoreException(exception.getStatus());
-		}
-	}
-
-	/**
-	 * Sets up this editor's context menu before it is made visible.
-	 * <p>
-	 * Not API. May be reduced to protected method in the future.
-	 * </p>
-	 * 
-	 * @param menu
-	 *            the menu
-	 */
-	public void editorContextMenuAboutToShow(IMenuManager menu) {
-		// To be consistant with the Java Editor, we want
-		// to remove
-		// ShiftRight and ShiftLeft from the context menu.
-		//
-		// ShiftRight and ShiftLeft were added in the super
-		// implemenation of
-		// this method. We want to skip it and call
-		// AbstractTextEditor's
-		// implementation directly. The easiest way is to
-		// copy the method here.
-
-		// super.editorContextMenuAboutToShow(menu);
-		abstractTextEditorContextMenuAboutToShow(menu);
-
-		addContextMenuActions(menu);
-		addExtendedContextMenuActions(menu);
-	}
-
-	/**
-	 * End background mode.
-	 * <p>
-	 * Not API. May be removed in the future.
-	 * </p>
-	 */
-	void endBackgroundOperation() {
-		fBackgroundJobEnded = true;
-		// note, we don't immediately end our 'internal busy' state,
-		// since we may get many calls in a short period of
-		// time. We always wait for the time out.
-		resetBusyState();
-	}
-
-	/**
-	 * Note this method can be called indirectly from background job operation
-	 * ... but expected to be gaurded there with ILock, plus, can be called
-	 * directly from timer thread, so the timer's run method guards with ILock
-	 * too.
-	 */
-	private void endBusyStateInternal() {
-		if (fBackgroundJobEnded) {
-			fBusyTimer.cancel();
-			showBusy(false);
-
-			ISourceViewer viewer = getSourceViewer();
-			if (viewer instanceof StructuredTextViewer) {
-				((StructuredTextViewer) viewer).endBackgroundUpdate();
-			}
-			fBusyState = false;
-		}
-		else {
-			// we will only be in this branch for a back ground job that is
-			// taking
-			// longer than our normal time-out period (meaning we got notified
-			// of
-			// the timeout "inbetween" calls to 'begin' and
-			// 'endBackgroundOperation'.
-			// (which, remember, can only happen since there are many calls to
-			// begin/end in a short period of time, and we only "reset" on the
-			// 'ends').
-			// In this event, there's really nothing to do, we're still in
-			// "busy state"
-			// and should start a new reset cycle once endBackgroundjob is
-			// called.
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-	 */
-	public Object getAdapter(Class required) {
-		if (org.eclipse.wst.sse.core.internal.util.Debug.perfTestAdapterClassLoading) {
-			startPerfTime = System.currentTimeMillis();
-		}
-		Object result = null;
-		// text editor
-		IStructuredModel internalModel = getInternalModel();
-		if (ITextEditor.class.equals(required)) {
-			result = this;
-		}
-		else if (IWorkbenchSiteProgressService.class.equals(required)) {
-			return getEditorPart().getSite().getAdapter(IWorkbenchSiteProgressService.class);
-		}
-		// content outline page
-		else if (IContentOutlinePage.class.equals(required)) {
-			if (fOutlinePage == null || fOutlinePage.getControl() == null || fOutlinePage.getControl().isDisposed()) {
-				ContentOutlineConfiguration cfg = createContentOutlineConfiguration();
-				if (cfg != null) {
-					ConfigurableContentOutlinePage outlinePage = new ConfigurableContentOutlinePage();
-					outlinePage.setConfiguration(cfg);
-					if (internalModel != null) {
-						outlinePage.setInputContentTypeIdentifier(internalModel.getContentTypeIdentifier());
-						outlinePage.setInput(internalModel);
-					}
-
-					if (fOutlinePageListener == null) {
-						fOutlinePageListener = new OutlinePageListener();
-					}
-
-					outlinePage.addSelectionChangedListener(fOutlinePageListener);
-					outlinePage.addDoubleClickListener(fOutlinePageListener);
-
-					fOutlinePage = outlinePage;
-				}
-			}
-			result = fOutlinePage;
-		}
-		// property sheet page, but only if the input's editable
-		else if (IPropertySheetPage.class.equals(required) && isEditable()) {
-			if (fPropertySheetPage == null || fPropertySheetPage.getControl() == null || fPropertySheetPage.getControl().isDisposed()) {
-				PropertySheetConfiguration cfg = createPropertySheetConfiguration();
-				if (cfg != null) {
-					ConfigurablePropertySheetPage propertySheetPage = new ConfigurablePropertySheetPage();
-					propertySheetPage.setConfiguration(cfg);
-					fPropertySheetPage = propertySheetPage;
-				}
-			}
-			result = fPropertySheetPage;
-		}
-		else if (IDocument.class.equals(required)) {
-			result = getDocumentProvider().getDocument(getEditorInput());
-		}
-		else if (ISourceEditingTextTools.class.equals(required)) {
-			result = createSourceEditingTextTools();
-		}
-		else if (IToggleBreakpointsTarget.class.equals(required)) {
-			result = ToggleBreakpointsTarget.getInstance();
-		}
-		else if (IShowInTargetList.class.equals(required)) {
-			return new ShowInTargetListAdapter();
-		}
-		else if (SelectionHistory.class.equals(required)) {
-			if (fSelectionHistory == null)
-				fSelectionHistory = new SelectionHistory(this);
-			return fSelectionHistory;
-		}
-		else {
-			if (result == null && internalModel != null) {
-				result = internalModel.getAdapter(required);
-			}
-			// others
-			if (result == null)
-				result = super.getAdapter(required);
-		}
-		if (org.eclipse.wst.sse.core.internal.util.Debug.perfTestAdapterClassLoading) {
-			long stop = System.currentTimeMillis();
-			adapterRequests++;
-			adapterTime += (stop - startPerfTime);
-		}
-		if (org.eclipse.wst.sse.core.internal.util.Debug.perfTestAdapterClassLoading) {
-			System.out.println("Total calls to getAdapter: " + adapterRequests); //$NON-NLS-1$
-			System.out.println("Total time in getAdapter: " + adapterTime); //$NON-NLS-1$
-			System.out.println("Average time per call: " + (adapterTime / adapterRequests)); //$NON-NLS-1$
-		}
-		return result;
-	}
-
-	private String[] getConfigurationPoints() {
-		String contentTypeIdentifierID = null;
-		if (getInternalModel() != null) {
-			contentTypeIdentifierID = getInternalModel().getContentTypeIdentifier();
-		}
-		return ConfigurationPointCalculator.getConfigurationPoints(this, contentTypeIdentifierID, ConfigurationPointCalculator.SOURCE, StructuredTextEditor.class);
-	}
-
-	/**
-	 * added checks to overcome bug such that if we are shutting down in an
-	 * error condition, then viewer will have already been disposed.
-	 */
-	protected String getCursorPosition() {
-		String result = null;
-		// this may be too expensive in terms of
-		// performance, to do this check
-		// every time, just to gaurd against error
-		// condition.
-		// perhaps there's a better way?
-		if (getSourceViewer() != null && getSourceViewer().getTextWidget() != null && !getSourceViewer().getTextWidget().isDisposed()) {
-			result = super.getCursorPosition();
-		}
-		else {
-			result = "0:0"; //$NON-NLS-1$
-		}
-		return result;
-	}
-
-
-	Display getDisplay() {
-		return PlatformUI.getWorkbench().getDisplay();
-	}
-
-	/**
-	 * Returns this editor part.
-	 * <p>
-	 * Not API. May be removed in the future.
-	 * </p>
-	 * 
-	 * @return this editor part
-	 */
-	public IEditorPart getEditorPart() {
-		if (fEditorPart == null)
-			return this;
-		return fEditorPart;
-	}
-
-	private IDocumentListener getInternalDocumentListener() {
-		if (fInternalDocumentListener == null) {
-			fInternalDocumentListener = new InternalDocumentListener();
-		}
-		return fInternalDocumentListener;
-	}
-
-	private IStructuredModel getInternalModel() {
-		return fStructuredModel;
-	}
-
-	private InternalModelStateListener getInternalModelStateListener() {
-		if (fInternalModelStateListener == null) {
-			fInternalModelStateListener = new InternalModelStateListener();
-		}
-		return fInternalModelStateListener;
-	}
-
-	/**
-	 * Returns this editor's StructuredModel.
-	 * <p>
-	 * Not API. Will be removed in the future.
-	 * </p>
-	 * 
-	 * @return returns this editor's IStructuredModel
-	 * @deprecated - This method allowed for uncontrolled access to the model
-	 *             instance and will be removed in the future. It is
-	 *             recommended that the current document provider be asked for
-	 *             the current document and the IModelManager then asked for
-	 *             the corresponding model with
-	 *             getExistingModelFor*(IDocument).
-	 */
-	public IStructuredModel getModel() {
-		if (getDocumentProvider() == null) {
-			// this indicated an error in startup sequence
-			Logger.trace(getClass().getName(), "Program Info Only: document provider was null when model requested"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		boolean initialModelNull = false;
-		if (fStructuredModel == null)
-			initialModelNull = true;
-		if (fStructuredModel == null) {
-			// lazily set the model instance, although this is an ABNORMAL
-			// CODE PATH
-			if (getDocumentProvider() instanceof IModelProvider) {
-				fStructuredModel = ((IModelProvider) getDocumentProvider()).getModel(getEditorInput());
-				fisReleased = false;
-			}
-			else {
-				IDocument doc = getDocumentProvider().getDocument(getEditorInput());
-				if (doc instanceof IStructuredDocument) {
-					IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(doc);
-					if (model == null) {
-						model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) doc);
-					}
-					fStructuredModel = model;
-					fisReleased = false;
-				}
-			}
-
-			// ISSUE: this looks bad ... edit-time factories not initialized
-			// unless someone calls getModel?
-			// factories will not be re-added if already exists
-			EditorModelUtil.addFactoriesTo(fStructuredModel);
-
-			if (initialModelNull && fStructuredModel != null) {
-				/*
-				 * DMW: 9/1/2002 -- why is update called here? No change has
-				 * been indicated? I'd like to remove, but will leave for now
-				 * to avoid breaking this hack. Should measure/breakpoint to
-				 * see how large the problem is. May cause performance
-				 * problems.
-				 * 
-				 * DMW: 9/8/2002 -- not sure why this was here initially, but
-				 * the intent/hack must have been to call update if this was
-				 * the first time fStructuredModel was set. So, I added the
-				 * logic to check for that "first time" case. It would appear
-				 * we don't really need. may remove in future when can test
-				 * more.
-				 */
-				update();
-			}
-		}
-		return fStructuredModel;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.part.IWorkbenchPartOrientation#getOrientation()
-	 */
-	public int getOrientation() {
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88714
-		return SWT.LEFT_TO_RIGHT;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.ITextEditor#getSelectionProvider()
-	 */
-	public ISelectionProvider getSelectionProvider() {
-		if (fStructuredSelectionProvider == null) {
-			ISelectionProvider parentProvider = super.getSelectionProvider();
-			if (parentProvider != null) {
-				fStructuredSelectionProvider = new StructuredSelectionProvider(parentProvider);
-			}
-		}
-		if (fStructuredSelectionProvider == null) {
-			return super.getSelectionProvider();
-		}
-		return fStructuredSelectionProvider;
-	}
-
-	/**
-	 * Returns the editor's source viewer. This method was created to expose
-	 * the protected final getSourceViewer() method.
-	 * <p>
-	 * Not API. May be removed in the future.
-	 * </p>
-	 * 
-	 * @return the editor's source viewer
-	 */
-	public StructuredTextViewer getTextViewer() {
-		return (StructuredTextViewer) getSourceViewer();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractTextEditor#handleCursorPositionChanged()
-	 */
-	protected void handleCursorPositionChanged() {
-		super.handleCursorPositionChanged();
-		updateStatusField(StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractTextEditor#handlePreferenceStoreChanged(org.eclipse.jface.util.PropertyChangeEvent)
-	 */
-	protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
-		String property = event.getProperty();
-
-		if (EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS.equals(property)) {
-			updateHoverBehavior();
-		}
-
-		if (IStructuredTextFoldingProvider.FOLDING_ENABLED.equals(property)) {
-			if (getSourceViewer() instanceof ProjectionViewer) {
-				// install projection support if it has not even been
-				// installed yet
-				if (isFoldingEnabled() && (fProjectionSupport == null) && (fProjectionModelUpdater == null)) {
-					installProjectionSupport();
-				}
-				ProjectionViewer pv = (ProjectionViewer) getSourceViewer();
-				if (pv.isProjectionMode() != isFoldingEnabled()) {
-					if (pv.canDoOperation(ProjectionViewer.TOGGLE))
-						pv.doOperation(ProjectionViewer.TOGGLE);
-				}
-			}
-			return;
-		}
-		super.handlePreferenceStoreChanged(event);
-	}
-
-	private boolean inBusyState() {
-		return fBusyState;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite,
-	 *      org.eclipse.ui.IEditorInput)
-	 */
-	public void init(IEditorSite site, IEditorInput input) throws PartInitException {
-		// if we've gotten an error elsewhere, before
-		// we've actually opened, then don't open.
-		if (shouldClose) {
-			setSite(site);
-			close(false);
-		}
-		else {
-			super.init(site, input);
-		}
-	}
-
-	/**
-	 * Set the document provider for this editor.
-	 * <p>
-	 * Not API. May be removed in the future.
-	 * </p>
-	 * 
-	 * @param documentProvider
-	 *            documentProvider to initialize
-	 */
-	public void initializeDocumentProvider(IDocumentProvider documentProvider) {
-		if (documentProvider != null) {
-			setDocumentProvider(documentProvider);
-		}
-	}
-
-	protected void initializeDrop(ITextViewer textViewer) {
-		int operations = DND.DROP_COPY | DND.DROP_MOVE;
-		fDropTarget = new DropTarget(textViewer.getTextWidget(), operations);
-		fDropAdapter = new ReadOnlyAwareDropTargetAdapter(true);
-		fDropAdapter.setTargetEditor(this);
-		fDropAdapter.setTargetIDs(getConfigurationPoints());
-		fDropAdapter.setTextViewer(textViewer);
-		fDropTarget.setTransfer(fDropAdapter.getTransfers());
-		fDropTarget.addDropListener(fDropAdapter);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#initializeEditor()
-	 */
-	protected void initializeEditor() {
-		super.initializeEditor();
-		// FIXME: here's where to add back in our custom encoding support
-		fEncodingSupport = null;
-		setPreferenceStore(createCombinedPreferenceStore());
-
-		setRangeIndicator(new DefaultRangeIndicator());
-		setEditorContextMenuId(EDITOR_CONTEXT_MENU_ID);
-		initializeDocumentProvider(null);
-		// set the infopop for source viewer
-		String helpId = getHelpContextId();
-		// no infopop set or using default text editor help, use default
-		if (helpId == null || ITextEditorHelpContextIds.TEXT_EDITOR.equals(helpId))
-			helpId = IHelpContextIds.XML_SOURCE_VIEW_HELPID;
-		setHelpContextId(helpId);
-		// defect 203158 - disable ruler context menu for
-		// beta
-		// setRulerContextMenuId(RULER_CONTEXT_MENU_ID);
-		configureInsertMode(SMART_INSERT, true);
-
-		// enable the base source editor activity when editor opens
-		try {
-			// FIXME: - commented out to avoid minor dependancy during
-			// transition to org.eclipse
-			// WTPActivityBridge.getInstance().enableActivity(CORE_SSE_ACTIVITY_ID,
-			// true);
-		}
-		catch (Exception t) {
-			// if something goes wrong with enabling activity, just log the
-			// error but dont
-			// have it break the editor
-			Logger.log(Logger.WARNING_DEBUG, t.getMessage(), t);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.editors.text.TextEditor#initializeKeyBindingScopes()
-	 */
-	protected void initializeKeyBindingScopes() {
-		setKeyBindingScopes(new String[]{EDITOR_KEYBINDING_SCOPE_ID});
-	}
-
-	/**
-	 * Initializes the editor's source viewer and other items that were source
-	 * viewer-dependent.
-	 */
-	private void initializeSourceViewer() {
-		IAction contentAssistAction = getAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS);
-		if (contentAssistAction instanceof IUpdate) {
-			((IUpdate) contentAssistAction).update();
-		}
-		IAction openHyperlinkAction = getAction(StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE);
-		if (openHyperlinkAction instanceof OpenHyperlinkAction) {
-			((OpenHyperlinkAction) openHyperlinkAction).setHyperlinkDetectors(getSourceViewerConfiguration().getHyperlinkDetectors(getSourceViewer()));
-		}
-
-		// do not even install projection support until folding is actually
-		// enabled
-		if (isFoldingEnabled()) {
-			installProjectionSupport();
-		}
-
-		// initialize source viewer's correction assistant
-		IContentAssistant correctionAssistant = createCorrectionAssistant();
-		getTextViewer().setCorrectionAssistant(correctionAssistant);
-	}
-
-	protected void initSourceViewer(StructuredTextViewer sourceViewer) {
-		// ensure decoration support is configured
-		getSourceViewerDecorationSupport(sourceViewer);
-		fMouseTracker = new MouseTracker();
-		fMouseTracker.start(sourceViewer.getTextWidget());
-		initializeDrop(sourceViewer);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.editors.text.TextEditor#installEncodingSupport()
-	 */
-	protected void installEncodingSupport() {
-		// TODO: install our custom support that can
-		// update document appropriately
-		// super.installEncodingSupport();
-	}
-
-	/**
-	 * Install everything necessary to get document folding working and enable
-	 * document folding
-	 */
-	private void installProjectionSupport() {
-		ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
-
-		fProjectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors());
-		fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); //$NON-NLS-1$
-		fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); //$NON-NLS-1$
-		fProjectionSupport.setHoverControlCreator(new IInformationControlCreator() {
-			public IInformationControl createInformationControl(Shell parent) {
-				return new DefaultInformationControl(parent);
-			}
-		});
-		fProjectionSupport.install();
-
-		IStructuredTextFoldingProvider updater = null;
-		ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
-		String[] ids = getConfigurationPoints();
-		for (int i = 0; updater == null && i < ids.length; i++) {
-			updater = (IStructuredTextFoldingProvider) builder.getConfiguration(IStructuredTextFoldingProvider.ID, ids[i]);
-		}
-
-		fProjectionModelUpdater = updater;
-		if (fProjectionModelUpdater != null)
-			fProjectionModelUpdater.install(projectionViewer);
-
-		if (isFoldingEnabled())
-			projectionViewer.doOperation(ProjectionViewer.TOGGLE);
-	}
-
-	/**
-	 * Return whether document folding should be enabled according to the
-	 * preference store settings.
-	 * 
-	 * @return <code>true</code> if document folding should be enabled
-	 */
-	private boolean isFoldingEnabled() {
-		IPreferenceStore store = getPreferenceStore();
-		// check both preference store and vm argument
-		return (store.getBoolean(IStructuredTextFoldingProvider.FOLDING_ENABLED) && (System.getProperty("org.eclipse.wst.sse.ui.foldingenabled") != null)); //$NON-NLS-1$
-	}
-
-	private void logUnexpectedDocumentKind(IEditorInput input) {
-		// display a dialog informing user of uknown content type
-		if (SSEUIPlugin.getDefault().getPreferenceStore().getBoolean(EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG)) {
-			Job job = new UIJob(SSEUIMessages.StructuredTextEditor_0) {
-				public IStatus runInUIThread(IProgressMonitor monitor) {
-					UnknownContentTypeDialog dialog = new UnknownContentTypeDialog(getSite().getShell(), SSEUIPlugin.getDefault().getPreferenceStore(), EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG);
-					dialog.open();
-					return Status.OK_STATUS;
-				}
-			};
-			job.schedule();
-		}
-
-		Logger.log(Logger.WARNING, "StructuredTextEditor being used without StructuredDocument"); //$NON-NLS-1$
-		String name = null;
-		if (input != null) {
-			name = input.getName();
-		}
-		else {
-			name = "input was null"; //$NON-NLS-1$
-		}
-		Logger.log(Logger.WARNING, "         Input Name: " + name); //$NON-NLS-1$
-		String implClass = null;
-		IDocument document = getDocumentProvider().getDocument(input);
-		if (document != null) {
-			implClass = document.getClass().getName();
-		}
-		else {
-			implClass = "document was null"; //$NON-NLS-1$
-		}
-		Logger.log(Logger.WARNING, "        Unexpected IDocumentProvider implementation: " + getDocumentProvider().getClass().getName()); //$NON-NLS-1$
-		Logger.log(Logger.WARNING, "        Unexpected IDocument implementation: " + implClass); //$NON-NLS-1$
-	}
-
-	/*
-	 * @see org.eclipse.ui.texteditor.AbstractTextEditor#performRevert()
-	 */
-	protected void performRevert() {
-		ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
-		projectionViewer.setRedraw(false);
-		try {
-
-			boolean projectionMode = projectionViewer.isProjectionMode();
-			if (projectionMode) {
-				projectionViewer.disableProjection();
-				if (fProjectionModelUpdater != null)
-					fProjectionModelUpdater.uninstall();
-			}
-
-			super.performRevert();
-
-			if (projectionMode) {
-				if (fProjectionModelUpdater != null)
-					fProjectionModelUpdater.install(projectionViewer);
-				projectionViewer.enableProjection();
-			}
-
-		}
-		finally {
-			projectionViewer.setRedraw(true);
-		}
-	}
-
-	/**
-	 * {@inheritDoc}
-	 * <p>
-	 * Not API. May be reduced to protected method in the future.
-	 * </p>
-	 */
-	public void rememberSelection() {
-		/*
-		 * This method was made public for use by editors that use
-		 * StructuredTextEditor (like some clients)
-		 */
-		super.rememberSelection();
-	}
-
-
-	/**
-	 * both starts and resets the busy state timer
-	 */
-	private void resetBusyState() {
-		// reset the "busy" timeout
-		if (fBusyTimer != null) {
-			fBusyTimer.cancel();
-		}
-		startBusyTimer();
-	}
-
-	/**
-	 * {@inheritDoc}
-	 * <p>
-	 * Not API. May be reduced to protected method in the future.
-	 * </p>
-	 */
-	public void restoreSelection() {
-		/*
-		 * This method was made public for use by editors that use
-		 * StructuredTextEditor (like some clients)
-		 */
-		// catch odd case where source viewer has no text
-		// widget (defect
-		// 227670)
-		if ((getSourceViewer() != null) && (getSourceViewer().getTextWidget() != null))
-			super.restoreSelection();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractTextEditor#rulerContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager)
-	 */
-	protected void rulerContextMenuAboutToShow(IMenuManager menu) {
-		super.rulerContextMenuAboutToShow(menu);
-
-		IStructuredModel internalModel = getInternalModel();
-		if (internalModel != null) {
-			boolean debuggingAvailable = BreakpointProviderBuilder.getInstance().isAvailable(internalModel.getContentTypeIdentifier(), BreakpointRulerAction.getFileExtension(getEditorInput()));
-			if (debuggingAvailable) {
-				// append actions to "debug" group (created in
-				// AbstractDecoratedTextEditor.rulerContextMenuAboutToShow(IMenuManager)
-				menu.appendToGroup("debug", getAction(ActionDefinitionIds.TOGGLE_BREAKPOINTS)); //$NON-NLS-1$
-				menu.appendToGroup("debug", getAction(ActionDefinitionIds.MANAGE_BREAKPOINTS)); //$NON-NLS-1$
-				menu.appendToGroup("debug", getAction(ActionDefinitionIds.EDIT_BREAKPOINTS)); //$NON-NLS-1$
-			}
-			addExtendedRulerContextMenuActions(menu);
-		}
-	}
-
-	/**
-	 * {@inheritDoc}
-	 * <p>
-	 * Overridden to expose part activation handling for multi-page editors.
-	 * </p>
-	 * <p>
-	 * Not API. May be reduced to protected method in the future.
-	 * </p>
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractTextEditor#safelySanityCheckState(org.eclipse.ui.IEditorInput)
-	 */
-	public void safelySanityCheckState(IEditorInput input) {
-		super.safelySanityCheckState(input);
-	}
-
-	private void savedModel() {
-		if (getInternalModel() != null) {
-			getInternalModel().changedModel();
-		}
-	}
-
-	/**
-	 * Ensure that the correct IDocumentProvider is used. For direct models, a
-	 * special provider is used. For StorageEditorInputs, use a custom
-	 * provider that creates a usable ResourceAnnotationModel. For everything
-	 * else, use the base support.
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#setDocumentProvider(org.eclipse.ui.IEditorInput)
-	 */
-	protected void setDocumentProvider(IEditorInput input) {
-		if (input instanceof IStructuredModel) {
-			// largely untested
-			setDocumentProvider(StructuredModelDocumentProvider.getInstance());
-		}
-		else if (input instanceof IStorageEditorInput && !(input instanceof IFileEditorInput)) {
-			setDocumentProvider(StorageModelProvider.getInstance());
-		}
-		else {
-			super.setDocumentProvider(input);
-		}
-	}
-
-	/**
-	 * Set editor part associated with this editor.
-	 * <p>
-	 * Not API. May be removed in the future.
-	 * </p>
-	 * 
-	 * @param editorPart
-	 *            editor part associated with this editor
-	 */
-	public void setEditorPart(IEditorPart editorPart) {
-		fEditorPart = editorPart;
-	}
-
-	/**
-	 * Sets the model field within this editor.
-	 * 
-	 * @deprecated - can eventually be eliminated
-	 */
-	private void setModel(IStructuredModel newModel) {
-		Assert.isNotNull(getDocumentProvider(), "document provider can not be null when setting model"); //$NON-NLS-1$
-		if (fStructuredModel != null) {
-			if (fStructuredModel.getStructuredDocument() != null) {
-				fStructuredModel.getStructuredDocument().removeDocumentListener(getInternalDocumentListener());
-			}
-			fStructuredModel.removeModelStateListener(getInternalModelStateListener());
-		}
-		fStructuredModel = newModel;
-		if (fStructuredModel != null) {
-			if (fStructuredModel.getStructuredDocument() != null) {
-				fStructuredModel.getStructuredDocument().addDocumentListener(getInternalDocumentListener());
-			}
-			fStructuredModel.addModelStateListener(getInternalModelStateListener());
-		}
-		// update() should be called whenever the model is
-		// set or changed
-		update();
-	}
-
-	/**
-	 * Sets the editor's source viewer configuration which it uses to
-	 * configure it's internal source viewer. This method was overwritten so
-	 * that viewer configuration could be set after editor part was created.
-	 */
-	protected void setSourceViewerConfiguration(SourceViewerConfiguration config) {
-		super.setSourceViewerConfiguration(config);
-		StructuredTextViewer stv = getTextViewer();
-		if (stv != null) {
-			// there should be no need to unconfigure
-			// before configure because
-			// configure will
-			// also unconfigure before configuring
-			stv.unconfigure();
-			stv.configure(config);
-
-			// update source viewer's correction assistant as well
-			IContentAssistant correctionAssistant = createCorrectionAssistant();
-			stv.setCorrectionAssistant(correctionAssistant);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.part.WorkbenchPart#showBusy(boolean)
-	 */
-	public void showBusy(boolean busy) {
-		if (busy) {
-			fRememberTitle = getPartName();
-			// update title and/or fonts and/or background
-			//
-			// temp solution, for testing, uses "busy"
-			setPartName(SSEUIMessages.busy); //$NON-NLS-1$
-		}
-		else {
-			// reset to what it was
-			setPartName(fRememberTitle);
-		}
-	}
-
-	private void startBusyTimer() {
-		// TODO: we need a resettable timer, so not so
-		// many are created
-		fBusyTimer = new Timer(true);
-		fBusyTimer.schedule(new TimeOutExpired(), BUSY_STATE_DELAY);
-	}
-
-	/**
-	 * Update should be called whenever the model is set or changed (as in
-	 * swapped)
-	 * <p>
-	 * Not API. May be removed in the future.
-	 * </p>
-	 */
-	public void update() {
-		if (fOutlinePage != null && fOutlinePage instanceof ConfigurableContentOutlinePage) {
-			ContentOutlineConfiguration cfg = createContentOutlineConfiguration();
-			((ConfigurableContentOutlinePage) fOutlinePage).setConfiguration(cfg);
-			IStructuredModel internalModel = getInternalModel();
-			((ConfigurableContentOutlinePage) fOutlinePage).setInputContentTypeIdentifier(internalModel.getContentTypeIdentifier());
-			((ConfigurableContentOutlinePage) fOutlinePage).setInput(internalModel);
-		}
-		if (fPropertySheetPage != null && fPropertySheetPage instanceof ConfigurablePropertySheetPage) {
-			PropertySheetConfiguration cfg = createPropertySheetConfiguration();
-			((ConfigurablePropertySheetPage) fPropertySheetPage).setConfiguration(cfg);
-		}
-		disposeModelDependentFields();
-
-		fShowInTargetIds = createShowInTargetIds();
-
-		updateSourceViewerConfiguration();
-
-		createModelDependentFields();
-	}
-
-	/**
-	 * Updates all content dependent actions.
-	 */
-	protected void updateContentDependentActions() {
-		super.updateContentDependentActions();
-		// super.updateContentDependentActions only updates
-		// the enable/disable
-		// state of all
-		// the content dependent actions.
-		// StructuredTextEditor's undo and redo actions
-		// have a detail label and
-		// description.
-		// They needed to be updated.
-		if (!fEditorDisposed)
-			updateMenuText();
-	}
-
-
-	/**
-	 * Updates the editor context menu by creating a new context menu with the
-	 * given menu id
-	 * 
-	 * @param contextMenuId
-	 *            Cannot be null
-	 */
-	private void updateEditorContextMenuId(String contextMenuId) {
-		// update editor context menu id if updating to a new id or if context
-		// menu is not already set up
-		if (!contextMenuId.equals(getEditorContextMenuId()) || (fTextContextMenu == null)) {
-			setEditorContextMenuId(contextMenuId);
-
-			if (getSourceViewer() != null) {
-				StyledText styledText = getSourceViewer().getTextWidget();
-				if (styledText != null) {
-					// dispose of previous context menu
-					if (fTextContextMenu != null) {
-						fTextContextMenu.dispose();
-					}
-					if (fTextContextMenuManager != null) {
-						fTextContextMenuManager.removeMenuListener(getContextMenuListener());
-						fTextContextMenuManager.removeAll();
-						fTextContextMenuManager.dispose();
-					}
-
-					fTextContextMenuManager = new MenuManager(getEditorContextMenuId(), getEditorContextMenuId());
-					fTextContextMenuManager.setRemoveAllWhenShown(true);
-					fTextContextMenuManager.addMenuListener(getContextMenuListener());
-
-					fTextContextMenu = fTextContextMenuManager.createContextMenu(styledText);
-					styledText.setMenu(fTextContextMenu);
-
-					getSite().registerContextMenu(getEditorContextMenuId(), fTextContextMenuManager, getSelectionProvider());
-
-					// also register this menu for source page part and
-					// structured text editor ids
-					String partId = getSite().getId();
-					if (partId != null) {
-						getSite().registerContextMenu(partId + EDITOR_CONTEXT_MENU_SUFFIX, fTextContextMenuManager, getSelectionProvider());
-					}
-					getSite().registerContextMenu(EDITOR_CONTEXT_MENU_ID, fTextContextMenuManager, getSelectionProvider());
-				}
-			}
-		}
-	}
-
-	/**
-	 * Updates editor context menu, vertical ruler menu, help context id for
-	 * new content type
-	 * 
-	 * @param contentType
-	 */
-	private void updateEditorControlsForContentType(String contentType) {
-		if (contentType == null) {
-			updateEditorContextMenuId(EDITOR_CONTEXT_MENU_ID);
-			updateRulerContextMenuId(RULER_CONTEXT_MENU_ID);
-			updateHelpContextId(ITextEditorHelpContextIds.TEXT_EDITOR);
-		}
-		else {
-			updateEditorContextMenuId(contentType + EDITOR_CONTEXT_MENU_SUFFIX);
-			updateRulerContextMenuId(contentType + RULER_CONTEXT_MENU_SUFFIX);
-			updateHelpContextId(contentType + "_source_HelpId"); //$NON-NLS-1$
-		}
-	}
-
-	private void updateEncodingMemento() {
-		boolean failed = false;
-		IStructuredModel internalModel = getInternalModel();
-		if (internalModel != null) {
-			IStructuredDocument doc = internalModel.getStructuredDocument();
-			EncodingMemento memento = doc.getEncodingMemento();
-			IDocumentCharsetDetector detector = internalModel.getModelHandler().getEncodingDetector();
-			if (memento != null && detector != null)
-				detector.set(doc);
-			try {
-				detector.getEncoding();
-			}
-			catch (IOException e) {
-				failed = true;
-			}
-			// be sure to use the new instance
-			// but only if no exception occurred.
-			// (we may find cases we need to do more error recover there)
-			// should be near impossible to get IOException from processing
-			// the
-			// *document*
-			if (!failed) {
-				doc.setEncodingMemento(memento);
-			}
-		}
-	}
-
-	/**
-	 * Updates the help context of the editor with the given help context id
-	 * 
-	 * @param helpContextId
-	 *            Cannot be null
-	 */
-	private void updateHelpContextId(String helpContextId) {
-		if (!helpContextId.equals(getHelpContextId())) {
-			setHelpContextId(helpContextId);
-
-			if (getSourceViewer() != null) {
-				StyledText styledText = getSourceViewer().getTextWidget();
-				if (styledText != null) {
-					IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-					helpSystem.setHelp(styledText, getHelpContextId());
-				}
-			}
-		}
-	}
-
-	/*
-	 * Update the hovering behavior depending on the preferences.
-	 */
-	private void updateHoverBehavior() {
-		SourceViewerConfiguration configuration = getSourceViewerConfiguration();
-		String[] types = configuration.getConfiguredContentTypes(getSourceViewer());
-
-		for (int i = 0; i < types.length; i++) {
-
-			String t = types[i];
-
-			ISourceViewer sourceViewer = getSourceViewer();
-			if (sourceViewer instanceof ITextViewerExtension2) {
-				// Remove existing hovers
-				((ITextViewerExtension2) sourceViewer).removeTextHovers(t);
-
-				int[] stateMasks = configuration.getConfiguredTextHoverStateMasks(getSourceViewer(), t);
-
-				if (stateMasks != null) {
-					for (int j = 0; j < stateMasks.length; j++) {
-						int stateMask = stateMasks[j];
-						ITextHover textHover = configuration.getTextHover(sourceViewer, t, stateMask);
-						((ITextViewerExtension2) sourceViewer).setTextHover(textHover, t, stateMask);
-					}
-				}
-				else {
-					ITextHover textHover = configuration.getTextHover(sourceViewer, t);
-					((ITextViewerExtension2) sourceViewer).setTextHover(textHover, t, ITextViewerExtension2.DEFAULT_HOVER_STATE_MASK);
-				}
-			}
-			else
-				sourceViewer.setTextHover(configuration.getTextHover(sourceViewer, t), t);
-		}
-	}
-
-	private void updateMenuText() {
-		if (fStructuredModel != null && !fStructuredModel.isModelStateChanging() && getTextViewer().getTextWidget() != null) {
-			// performance: don't force an update of the action bars unless
-			// required as it is expensive
-			String previousUndoText = null;
-			String previousUndoDesc = null;
-			String previousRedoText = null;
-			String previousRedoDesc = null;
-			boolean updateActions = false;
-			IAction undoAction = getAction(ITextEditorActionConstants.UNDO);
-			IAction redoAction = getAction(ITextEditorActionConstants.REDO);
-			if (undoAction != null) {
-				previousUndoText = undoAction.getText();
-				previousUndoDesc = undoAction.getDescription();
-				updateActions = updateActions || previousUndoText == null || previousUndoDesc == null;
-				undoAction.setText(UNDO_ACTION_TEXT_DEFAULT);
-				undoAction.setDescription(UNDO_ACTION_DESC_DEFAULT);
-			}
-			if (redoAction != null) {
-				previousRedoText = redoAction.getText();
-				previousRedoDesc = redoAction.getDescription();
-				updateActions = updateActions || previousRedoText == null || previousRedoDesc == null;
-				redoAction.setText(REDO_ACTION_TEXT_DEFAULT);
-				redoAction.setDescription(REDO_ACTION_DESC_DEFAULT);
-			}
-			if (fStructuredModel.getUndoManager() != null) {
-				IStructuredTextUndoManager undoManager = fStructuredModel.getUndoManager();
-				// get undo command
-				Command undoCommand = undoManager.getUndoCommand();
-				// set undo label and description
-				undoAction.setEnabled(undoManager.undoable());
-				if (undoCommand != null) {
-					String label = undoCommand.getLabel();
-					if (label != null) {
-						String customText = MessageFormat.format(UNDO_ACTION_TEXT, new String[]{label});
-						updateActions = updateActions || customText == null || previousUndoText == null || !customText.equals(previousUndoText);
-						undoAction.setText(customText);
-					}
-					String desc = undoCommand.getDescription();
-					if (desc != null) {
-						String customDesc = MessageFormat.format(UNDO_ACTION_DESC, new String[]{desc});
-						updateActions = updateActions || customDesc == null || previousRedoDesc == null || !customDesc.equals(previousUndoDesc);
-						undoAction.setDescription(customDesc);
-					}
-				}
-				// get redo command
-				Command redoCommand = undoManager.getRedoCommand();
-				// set redo label and description
-				redoAction.setEnabled(undoManager.redoable());
-				if (redoCommand != null) {
-					String label = redoCommand.getLabel();
-					if (label != null) {
-						String customText = MessageFormat.format(REDO_ACTION_TEXT, new String[]{label});
-						updateActions = updateActions || customText == null || previousRedoText == null || !customText.equals(previousRedoText);
-						redoAction.setText(customText);
-					}
-					String desc = redoCommand.getDescription();
-					if (desc != null) {
-						String customDesc = MessageFormat.format(REDO_ACTION_DESC, new String[]{desc});
-						updateActions = updateActions || customDesc == null || previousRedoDesc == null || !customDesc.equals(previousRedoDesc);
-						redoAction.setDescription(customDesc);
-					}
-				}
-			}
-			// tell the action bars to update
-			if (updateActions) {
-				if (getEditorSite().getActionBars() != null) {
-					getEditorSite().getActionBars().updateActionBars();
-				}
-				else if (getEditorPart() != null && getEditorPart().getEditorSite().getActionBars() != null) {
-					getEditorPart().getEditorSite().getActionBars().updateActionBars();
-				}
-			}
-		}
-	}
-
-	void updateRangeIndication(ISelection selection) {
-		if (selection instanceof IStructuredSelection && !((IStructuredSelection) selection).isEmpty()) {
-			Object[] objects = ((IStructuredSelection) selection).toArray();
-			if (objects.length > 0) {
-				int start = ((IndexedRegion) objects[0]).getStartOffset();
-				int end = ((IndexedRegion) objects[objects.length - 1]).getEndOffset();
-				getSourceViewer().setRangeIndication(start, end - start, false);
-			}
-			else {
-				getSourceViewer().removeRangeIndication();
-			}
-		}
-		else {
-			if (selection instanceof ITextSelection) {
-				getSourceViewer().setRangeIndication(((ITextSelection) selection).getOffset(), ((ITextSelection) selection).getLength(), false);
-			}
-			else {
-				getSourceViewer().removeRangeIndication();
-			}
-		}
-	}
-
-
-	/**
-	 * Updates the editor vertical ruler menu by creating a new vertical ruler
-	 * context menu with the given menu id
-	 * 
-	 * @param rulerMenuId
-	 *            Cannot be null
-	 */
-	private void updateRulerContextMenuId(String rulerMenuId) {
-		// update ruler context menu id if updating to a new id or if context
-		// menu is not already set up
-		if (!rulerMenuId.equals(getRulerContextMenuId()) || (fRulerContextMenu == null)) {
-			setRulerContextMenuId(rulerMenuId);
-
-			if (getVerticalRuler() != null) {
-				// dispose of previous ruler context menu
-				if (fRulerContextMenu != null) {
-					fRulerContextMenu.dispose();
-				}
-				if (fRulerContextMenuManager != null) {
-					fRulerContextMenuManager.removeMenuListener(getContextMenuListener());
-					fRulerContextMenuManager.removeAll();
-					fRulerContextMenuManager.dispose();
-				}
-
-				fRulerContextMenuManager = new MenuManager(getRulerContextMenuId(), getRulerContextMenuId());
-				fRulerContextMenuManager.setRemoveAllWhenShown(true);
-				fRulerContextMenuManager.addMenuListener(getContextMenuListener());
-
-				Control rulerControl = getVerticalRuler().getControl();
-				fRulerContextMenu = fRulerContextMenuManager.createContextMenu(rulerControl);
-				rulerControl.setMenu(fRulerContextMenu);
-
-				getSite().registerContextMenu(getRulerContextMenuId(), fRulerContextMenuManager, getSelectionProvider());
-
-				// also register this menu for source page part and structured
-				// text editor ids
-				String partId = getSite().getId();
-				if (partId != null) {
-					getSite().registerContextMenu(partId + RULER_CONTEXT_MENU_SUFFIX, fRulerContextMenuManager, getSelectionProvider());
-				}
-				getSite().registerContextMenu(RULER_CONTEXT_MENU_ID, fRulerContextMenuManager, getSelectionProvider());
-			}
-		}
-	}
-
-	private void updateSourceViewerConfiguration() {
-		SourceViewerConfiguration configuration = getSourceViewerConfiguration();
-		// no need to update source viewer configuration if one does not exist
-		// yet
-		if (configuration == null) {
-			return;
-		}
-		// do not configure source viewer configuration twice
-		boolean configured = false;
-
-		// structuredtextviewer only works with
-		// structuredtextviewerconfiguration
-		if (!(configuration instanceof StructuredTextViewerConfiguration)) {
-			ConfigurationAndTarget cat = createSourceViewerConfiguration();
-			fViewerConfigurationTargetId = cat.getTargetId();
-			configuration = cat.getConfiguration();
-			setSourceViewerConfiguration(configuration);
-			configured = true;
-		}
-		else {
-			ConfigurationAndTarget cat = createSourceViewerConfiguration();
-			StructuredTextViewerConfiguration newViewerConfiguration = cat.getConfiguration();
-			if (!(cat.getTargetId().equals(fViewerConfigurationTargetId))) {
-				// d282894 use newViewerConfiguration
-				fViewerConfigurationTargetId = cat.getTargetId();
-				configuration = newViewerConfiguration;
-				setSourceViewerConfiguration(configuration);
-				configured = true;
-			}
-		}
-
-		if (getSourceViewer() != null) {
-			// not sure if really need to reconfigure when input changes
-			// (maybe only need to reset viewerconfig's document)
-			if (!configured)
-				getSourceViewer().configure(configuration);
-			IAction contentAssistAction = getAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS);
-			if (contentAssistAction instanceof IUpdate) {
-				((IUpdate) contentAssistAction).update();
-			}
-			IAction openHyperlinkAction = getAction(StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE);
-			if (openHyperlinkAction instanceof OpenHyperlinkAction) {
-				((OpenHyperlinkAction) openHyperlinkAction).setHyperlinkDetectors(getSourceViewerConfiguration().getHyperlinkDetectors(getSourceViewer()));
-			}
-		}
-	}
-
-	protected void updateStatusField(String category) {
-		super.updateStatusField(category);
-
-		if (category == null)
-			return;
-
-		if (StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET.equals(category)) {
-			IStatusField field = getStatusField(category);
-			if (field != null) {
-				Point selection = getTextViewer().getTextWidget().getSelection();
-				int offset1 = widgetOffset2ModelOffset(getSourceViewer(), selection.x);
-				int offset2 = widgetOffset2ModelOffset(getSourceViewer(), selection.y);
-				String text = null;
-				if (offset1 != offset2)
-					text = "[" + offset1 + "-" + offset2 + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-				else
-					text = "[ " + offset1 + " ]"; //$NON-NLS-1$ //$NON-NLS-2$
-				field.setText(text == null ? fErrorLabel : text);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
deleted file mode 100644
index 00c932c..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
+++ /dev/null
@@ -1,471 +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.sse.ui;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.IUndoManager;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.formatter.IContentFormatter;
-import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter;
-import org.eclipse.jface.text.information.IInformationPresenter;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.InformationPresenter;
-import org.eclipse.jface.text.presentation.IPresentationReconciler;
-import org.eclipse.jface.text.reconciler.IReconciler;
-import org.eclipse.jface.text.source.IAnnotationHover;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
-import org.eclipse.ui.texteditor.ChainedPreferenceStore;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.StructuredTextAnnotationHover;
-import org.eclipse.wst.sse.ui.internal.contentassist.StructuredContentAssistant;
-import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
-import org.eclipse.wst.sse.ui.internal.hyperlink.HighlighterHyperlinkPresenter;
-import org.eclipse.wst.sse.ui.internal.provisional.preferences.CommonEditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor;
-import org.eclipse.wst.sse.ui.internal.taginfo.AnnotationHoverProcessor;
-import org.eclipse.wst.sse.ui.internal.taginfo.BestMatchHover;
-import org.eclipse.wst.sse.ui.internal.taginfo.ProblemAnnotationHoverProcessor;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
-
-
-/**
- * Configuration for the source viewer used by StructuredTextEditor.<br />
- * Note: While ISourceViewer is passed in for each get configuration, clients
- * should create a new viewer configuration instance for each instance of
- * source viewer as some methods return the same instance of an object,
- * regardless of the sourceviewer.
- * <p>
- * Clients should subclass and override just those methods which must be
- * specific to their needs.
- * </p>
- * 
- * @see org.eclipse.wst.sse.ui.StructuredTextEditor
- * @see org.eclipse.wst.sse.ui.internal.StructuredTextViewer
- * @since 1.0
- */
-public class StructuredTextViewerConfiguration extends TextSourceViewerConfiguration {
-	/*
-	 * One instance per configuration because creating a second assistant that
-	 * is added to a viewer can cause odd key-eating by the wrong one.
-	 */
-	private StructuredContentAssistant fContentAssistant = null;
-	/*
-	 * One instance per configuration
-	 */
-	private IReconciler fReconciler;
-
-
-	/**
-	 * Creates a structured text viewer configuration.
-	 */
-	public StructuredTextViewerConfiguration() {
-		super();
-		// initialize fPreferenceStore with same preference store used in
-		// StructuredTextEditor
-		fPreferenceStore = createCombinedPreferenceStore();
-	}
-
-	/**
-	 * Create a preference store that combines the source editor preferences
-	 * with the base editor's preferences.
-	 * 
-	 * @return IPreferenceStore
-	 */
-	private IPreferenceStore createCombinedPreferenceStore() {
-		IPreferenceStore sseEditorPrefs = SSEUIPlugin.getDefault().getPreferenceStore();
-		IPreferenceStore baseEditorPrefs = EditorsUI.getPreferenceStore();
-		return new ChainedPreferenceStore(new IPreferenceStore[]{sseEditorPrefs, baseEditorPrefs});
-	}
-
-	/**
-	 * Returns the annotation hover which will provide the information to be
-	 * shown in a hover popup window when requested for the given source
-	 * viewer.<br />
-	 * Note: Clients cannot override this method because this method returns a
-	 * specially configured Annotation Hover for the StructuredTextViewer.
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @return an annotation hover specially configured for
-	 *         StructuredTextViewer
-	 */
-	final public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
-		/*
-		 * This implmentation returns an annotation hover that works with
-		 * StructuredTextViewer and breakpoints. Important! must remember to
-		 * release it when done with it (during viewer.unconfigure)
-		 */
-		return new StructuredTextAnnotationHover();
-	}
-
-	/**
-	 * Returns the configured partitioning for the given source viewer. The
-	 * partitioning is used when the querying content types from the source
-	 * viewer's input document.<br />
-	 * Note: Clients cannot override this method at this time.
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @return the configured partitioning
-	 * @see #getConfiguredContentTypes(ISourceViewer)
-	 */
-	final public String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer) {
-		/*
-		 * This implementation returns default structured text partitioning
-		 */
-		return IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING;
-	}
-
-	public int[] getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer, String contentType) {
-		/*
-		 * This implementation returns configured text hover state masks for
-		 * StructuredTextViewers
-		 */
-		TextHoverManager.TextHoverDescriptor[] hoverDescs = SSEUIPlugin.getDefault().getTextHoverManager().getTextHovers();
-		int stateMasks[] = new int[hoverDescs.length];
-		int stateMasksLength = 0;
-		for (int i = 0; i < hoverDescs.length; i++) {
-			if (hoverDescs[i].isEnabled()) {
-				int j = 0;
-				int stateMask = computeStateMask(hoverDescs[i].getModifierString());
-				while (j < stateMasksLength) {
-					if (stateMasks[j] == stateMask)
-						break;
-					j++;
-				}
-				if (j == stateMasksLength)
-					stateMasks[stateMasksLength++] = stateMask;
-			}
-		}
-		if (stateMasksLength == hoverDescs.length)
-			return stateMasks;
-
-		int[] shortenedStateMasks = new int[stateMasksLength];
-		System.arraycopy(stateMasks, 0, shortenedStateMasks, 0, stateMasksLength);
-		return shortenedStateMasks;
-	}
-
-	/**
-	 * Returns the content assistant ready to be used with the given source
-	 * viewer.<br />
-	 * Note: The same instance of IContentAssistant is returned regardless of
-	 * the source viewer passed in.
-	 * <p>
-	 * Clients cannot override this method. Instead, clients wanting to add
-	 * their own processors should override
-	 * <code>getContentAssistProcessors(ISourceViewer, String)</code>
-	 * </p>
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @return a content assistant
-	 * @see #getContentAssistProcessors(ISourceViewer, String)
-	 */
-	final public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
-		/*
-		 * Note: This method was made final so that StructuredContentAssist is
-		 * always used and content assist extension point always works.
-		 */
-		if (fContentAssistant == null) {
-			fContentAssistant = new StructuredContentAssistant();
-
-			// content assistant configurations
-			fContentAssistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
-			fContentAssistant.enableAutoActivation(true);
-			fContentAssistant.setAutoActivationDelay(500);
-			fContentAssistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
-			fContentAssistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
-			fContentAssistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
-
-			// add content assist processors for each partition type
-			String[] types = getConfiguredContentTypes(sourceViewer);
-			for (int i = 0; i < types.length; i++) {
-				String type = types[i];
-
-				// add all content assist processors for current partiton type
-				IContentAssistProcessor[] processors = getContentAssistProcessors(sourceViewer, type);
-				if (processors != null) {
-					for (int j = 0; j < processors.length; j++) {
-						fContentAssistant.setContentAssistProcessor(processors[j], type);
-					}
-				}
-			}
-		}
-		return fContentAssistant;
-	}
-
-	/**
-	 * Returns the content assist processors that will be used for content
-	 * assist in the given source viewer and for the given partition type.
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @param partitionType
-	 *            the partition type for which the content assist processors
-	 *            are applicable
-	 * @return IContentAssistProcessors or null if should not be supported
-	 */
-	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
-		return null;
-	}
-
-	/**
-	 * Returns the content formatter ready to be used with the given source
-	 * viewer.
-	 * <p>
-	 * It is not recommended that clients override this method as it may
-	 * become <code>final</code> in the future and replaced by an extensible
-	 * framework.
-	 * </p>
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @return a content formatter or <code>null</code> if formatting should
-	 *         not be supported
-	 */
-	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
-		return null;
-	}
-
-	/**
-	 * Returns the hyperlink presenter for the given source viewer.<br />
-	 * Note: Clients cannot override this method because this method returns a
-	 * specially configured hyperlink presenter for the StructuredTextViewer.
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @return a hyperlink presenter specially configured for
-	 *         StructuredTextViewer
-	 */
-	final public IHyperlinkPresenter getHyperlinkPresenter(ISourceViewer sourceViewer) {
-		/*
-		 * This implementation returns a hyperlink presenter that uses
-		 * Highlither instead of PresentationReconciler
-		 */
-		if (fPreferenceStore == null) {
-			return super.getHyperlinkPresenter(sourceViewer);
-		}
-		return new HighlighterHyperlinkPresenter(fPreferenceStore);
-	}
-
-	/**
-	 * Returns the information control creator. The creator is a factory
-	 * creating information controls for the given source viewer.<br />
-	 * Note: Clients cannot override this method at this time.
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @return the information control creator
-	 */
-	final public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) {
-		// used by hover help
-		return new IInformationControlCreator() {
-			public IInformationControl createInformationControl(Shell parent) {
-				return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(false));
-			}
-		};
-	}
-
-	/**
-	 * Returns the information presenter ready to be used with the given
-	 * source viewer.
-	 * <p>
-	 * Clients cannot override this method. Instead, clients wanting to add
-	 * their own information providers should override
-	 * <code>getInformationProvider(ISourceViewer, String)</code>
-	 * </p>
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @return a content assistant
-	 * @see #getInformationProvider(ISourceViewer, String)
-	 */
-	final public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) {
-		InformationPresenter presenter = new InformationPresenter(getInformationPresenterControlCreator(sourceViewer));
-
-		// information presenter configurations
-		presenter.setSizeConstraints(60, 10, true, true);
-		presenter.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
-
-		// add information providers for each partition type
-		String[] types = getConfiguredContentTypes(sourceViewer);
-		for (int i = 0; i < types.length; i++) {
-			String type = types[i];
-
-			IInformationProvider provider = getInformationProvider(sourceViewer, type);
-			if (provider != null) {
-				presenter.setInformationProvider(provider, type);
-			}
-		}
-
-		return presenter;
-	}
-
-	/**
-	 * Returns the information provider that will be used for information
-	 * presentation in the given source viewer and for the given partition
-	 * type.
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @param partitionType
-	 *            the partition type for which the information provider is
-	 *            applicable
-	 * @return IInformationProvider or null if should not be supported
-	 */
-	protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
-		return null;
-	}
-
-	/**
-	 * Returns the information presenter control creator. The creator is a
-	 * factory creating the presenter controls for the given source viewer.
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @return an information control creator
-	 */
-	private IInformationControlCreator getInformationPresenterControlCreator(ISourceViewer sourceViewer) {
-		return new IInformationControlCreator() {
-			public IInformationControl createInformationControl(Shell parent) {
-				int shellStyle = SWT.RESIZE | SWT.TOOL;
-				int style = SWT.V_SCROLL | SWT.H_SCROLL;
-				return new DefaultInformationControl(parent, shellStyle, style, new HTMLTextPresenter(false));
-			}
-		};
-	}
-
-	/**
-	 * Returns the line style providers that will be used for syntax
-	 * highlighting in the given source viewer.
-	 * <p>
-	 * Not fully API since return type LineStyleProvider is not API.
-	 * </p>
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @param partitionType
-	 *            the partition type for which the lineStyleProviders are
-	 *            applicable
-	 * @return LineStyleProvders or null if should not be supported
-	 */
-	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
-		return null;
-	}
-
-	/**
-	 * StructuredTextViewer currently does not support presentation
-	 * reconciler, so clients cannot override this method to provide their own
-	 * presentation reconciler. <br />
-	 * See <code>getLineStyleProviders(ISourceViewer, String)</code> for
-	 * alternative way to provide highlighting information.
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @return always returns null
-	 * @see #getLineStyleProviders(ISourceViewer, String)
-	 */
-	final public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
-		/*
-		 * This implementation returns null because StructuredTextViewer does
-		 * not use presentation reconciler
-		 */
-		return null;
-	}
-
-	/**
-	 * Returns the reconciler ready to be used with the given source viewer.<br />
-	 * Note: The same instance of IReconciler is returned regardless of the
-	 * source viewer passed in.
-	 * <p>
-	 * Clients cannot override this method. Instead, clients wanting to add
-	 * their own reconciling strategy should use the
-	 * <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code>
-	 * extension point.
-	 * </p>
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @return a reconciler
-	 */
-	final public IReconciler getReconciler(ISourceViewer sourceViewer) {
-		boolean reconcilingEnabled = fPreferenceStore.getBoolean(CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS);
-		if (sourceViewer == null || !reconcilingEnabled)
-			return null;
-
-		/*
-		 * Only create reconciler if sourceviewer is present
-		 */
-		if (fReconciler == null && sourceViewer != null) {
-			StructuredRegionProcessor reconciler = new StructuredRegionProcessor();
-
-			// reconciler configurations
-			reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
-
-			fReconciler = reconciler;
-		}
-		return fReconciler;
-	}
-
-	public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
-		ITextHover textHover = null;
-
-		/*
-		 * Returns a default problem, annotation, and best match hover
-		 * depending on stateMask
-		 */
-		TextHoverManager.TextHoverDescriptor[] hoverDescs = SSEUIPlugin.getDefault().getTextHoverManager().getTextHovers();
-		int i = 0;
-		while (i < hoverDescs.length && textHover == null) {
-			if (hoverDescs[i].isEnabled() && computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
-				String hoverType = hoverDescs[i].getId();
-				if (TextHoverManager.PROBLEM_HOVER.equalsIgnoreCase(hoverType))
-					textHover = new ProblemAnnotationHoverProcessor();
-				else if (TextHoverManager.ANNOTATION_HOVER.equalsIgnoreCase(hoverType))
-					textHover = new AnnotationHoverProcessor();
-				else if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType))
-					textHover = new BestMatchHover(null);
-			}
-			i++;
-		}
-		return textHover;
-	}
-
-	/**
-	 * Returns the undo manager for the given source viewer.<br />
-	 * Note: Clients cannot override this method because this method returns a
-	 * specially configured undo manager for the StructuredTextViewer.
-	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @return an undo manager specially configured for StructuredTextViewer
-	 */
-	final public IUndoManager getUndoManager(ISourceViewer sourceViewer) {
-		/*
-		 * This implementation returns an UndoManager that is used exclusively
-		 * in StructuredTextViewer
-		 */
-		return new StructuredTextViewerUndoManager();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerUndoManager.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerUndoManager.java
deleted file mode 100644
index 33797c5..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerUndoManager.java
+++ /dev/null
@@ -1,200 +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.sse.ui;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.IUndoManager;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-
-
-/**
- * Undo manager exclusively for StructuredTextViewers ONLY. This undo manager
- * is aware that structured documents have their own undo manager. This
- * handles communication between IUndoManager and IStructuredTextUndoManager.
- */
-class StructuredTextViewerUndoManager implements IUndoManager {
-	class UndoNotifier implements ISelectionChangedListener {
-		public void selectionChanged(SelectionChangedEvent event) {
-			if ((fUndoManager != null) && (event != null)) {
-				if (event.getSelection() instanceof ITextSelection) {
-					fUndoManager.forceEndOfPendingCommand(this, ((ITextSelection) event.getSelection()).getOffset(), ((ITextSelection) event.getSelection()).getLength());
-				}
-			}
-		}
-
-	}
-
-	private StructuredTextViewer fTextViewer = null;
-	private IStructuredTextUndoManager fUndoManager = null;
-	private ISelectionChangedListener fUndoNotifier = new UndoNotifier();
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IUndoManager#beginCompoundChange()
-	 */
-	public void beginCompoundChange() {
-		// forward the request to the model-based undo manager
-		if (fUndoManager != null)
-			fUndoManager.beginRecording(fTextViewer);
-	}
-
-	/**
-	 * Associates a viewer to this undo manager and also attempts to get the
-	 * correct document-specific undo manager.
-	 * 
-	 * @param viewer -
-	 *            Assumes viewer instanceof StructuredTextViewer
-	 */
-	public void connect(ITextViewer viewer) {
-		// future_TODO could probably optimize this to check if already
-		// connected to same viewer/undo manager, dont do anything
-
-		// disconnect from any old manager/viewer
-		disconnect();
-
-		// connect to new viewer/undo manager
-		fTextViewer = (StructuredTextViewer) viewer;
-		IDocument doc = fTextViewer.getDocument();
-		if (doc instanceof IStructuredDocument) {
-			IStructuredDocument structuredDocument = (IStructuredDocument) doc;
-			setDocument(structuredDocument);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IUndoManager#disconnect()
-	 */
-	public void disconnect() {
-		// disconnect the viewer from the undo manager
-		if (fUndoManager != null) {
-			fTextViewer.removeSelectionChangedListener(fUndoNotifier);
-			fUndoManager.disconnect(fTextViewer);
-		}
-
-		// null out the viewer and undo manager
-		fTextViewer = null;
-		fUndoManager = null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IUndoManager#endCompoundChange()
-	 */
-	public void endCompoundChange() {
-		// forward the request to the model-based undo manager
-		if (fUndoManager != null)
-			fUndoManager.endRecording(fTextViewer);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IUndoManager#redo()
-	 */
-	public void redo() {
-		// forward the request to the model-based undo manager
-		if (fUndoManager != null)
-			fUndoManager.redo(fTextViewer);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IUndoManager#redoable()
-	 */
-	public boolean redoable() {
-		boolean canRedo = false;
-
-		// forward the request to the model-based undo manager
-		if (fUndoManager != null)
-			canRedo = fUndoManager.redoable();
-
-		return canRedo;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IUndoManager#reset()
-	 */
-	public void reset() {
-		// cannot really reset model-based undo manager because other clients
-		// will be affected
-	}
-
-	/**
-	 * Disconnect from the old undo manager and connect to the undo manager
-	 * associated with the new document.
-	 * 
-	 * @param document -
-	 *            assumes document is not null
-	 */
-	public void setDocument(IStructuredDocument document) {
-		if (fUndoManager != null) {
-			fTextViewer.removeSelectionChangedListener(fUndoNotifier);
-			fUndoManager.disconnect(fTextViewer);
-		}
-
-		fUndoManager = document.getUndoManager();
-		if (fUndoManager != null) {
-			fUndoManager.connect(fTextViewer);
-			fTextViewer.addSelectionChangedListener(fUndoNotifier);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IUndoManager#setMaximalUndoLevel(int)
-	 */
-	public void setMaximalUndoLevel(int undoLevel) {
-		// cannot really set maximal undo level on model-based undo manager
-		// because other clients will be affected
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IUndoManager#undo()
-	 */
-	public void undo() {
-		// forward the request to the model-based undo manager
-		if (fUndoManager != null)
-			fUndoManager.undo(fTextViewer);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.IUndoManager#undoable()
-	 */
-	public boolean undoable() {
-		boolean canUndo = false;
-
-		// forward the request to the model-based undo manager
-		if (fUndoManager != null)
-			canUndo = fUndoManager.undoable();
-
-		return canUndo;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/AbstractDropAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/AbstractDropAction.java
deleted file mode 100644
index d1771aa..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/AbstractDropAction.java
+++ /dev/null
@@ -1,94 +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.sse.ui.internal;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-
-/**
- */
-public abstract class AbstractDropAction implements IDropAction {
-
-	/*
-	 * Replaces targetEditor's current selection by "text"
-	 */
-	protected boolean insert(String text, IEditorPart targetEditor) {
-		if (text == null || text.length() == 0) {
-			return true;
-		}
-
-		ITextSelection textSelection = null;
-		IDocument doc = null;
-		ISelection selection = null;
-
-		ISourceEditingTextTools tools = (ISourceEditingTextTools) targetEditor.getAdapter(ISourceEditingTextTools.class);
-		if (tools != null) {
-			doc = tools.getDocument();
-			selection = tools.getSelection();
-		}
-
-		ITextEditor textEditor = null;
-		if (targetEditor instanceof ITextEditor) {
-			textEditor = (ITextEditor) targetEditor;
-		}
-		if (textEditor == null) {
-			textEditor = (ITextEditor) ((IAdaptable) targetEditor).getAdapter(ITextEditor.class);
-		}
-		if (textEditor == null && tools != null && tools.getEditorPart() instanceof ITextEditor) {
-			textEditor = (ITextEditor) tools.getEditorPart();
-		}
-		if (textEditor == null && tools != null && tools.getEditorPart() != null) {
-			textEditor = (ITextEditor) tools.getEditorPart().getAdapter(ITextEditor.class);
-		}
-
-		if (selection == null && textEditor != null) {
-			selection = textEditor.getSelectionProvider().getSelection();
-		}
-		if (doc == null && textEditor != null) {
-			doc = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
-		}
-
-		if (selection instanceof ITextSelection) {
-			textSelection = (ITextSelection) selection;
-			try {
-				doc.replace(textSelection.getOffset(), textSelection.getLength(), text);
-			}
-			catch (BadLocationException e) {
-				return false;
-			}
-		}
-		if (textEditor != null && textSelection != null) {
-			ISelectionProvider sp = textEditor.getSelectionProvider();
-			ITextSelection sel = new TextSelection(textSelection.getOffset(), text.length());
-			sp.setSelection(sel);
-			textEditor.selectAndReveal(sel.getOffset(), sel.getLength());
-		}
-
-		return true;
-	}
-
-	public boolean isSupportedData(Object data) {
-		return true;
-	}
-
-	public abstract boolean run(DropTargetEvent event, IEditorPart targetEditor);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/CaretMediator.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/CaretMediator.java
deleted file mode 100644
index e78d467..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/CaretMediator.java
+++ /dev/null
@@ -1,284 +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.sse.ui.internal;
-
-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.swt.SWT;
-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.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.sse.ui.internal.view.events.CaretEvent;
-import org.eclipse.wst.sse.ui.internal.view.events.ICaretListener;
-
-/**
- * Has the responsibility of listening for key events, and mouse events,
- * deciding if the caret has moved (without a text change), and if so, will
- * notify CaretListeners that the caret has moved. Objects which are
- * interested in ALL caret postion changes will also have to listen for
- * textChanged events.
- * 
- * @deprecated - use base selection notification
- */
-public class CaretMediator implements Listener {
-
-	class CaretMediatorListener implements KeyListener, MouseListener {
-		public void keyPressed(KeyEvent e) {
-			internalKeyPressed(e);
-		}
-
-		public void keyReleased(KeyEvent e) {
-			internalKeyReleased(e);
-		}
-
-		public void mouseDoubleClick(MouseEvent e) {
-		}
-
-		public void mouseDown(MouseEvent e) {
-			internalMouseDown(e);
-		}
-
-		public void mouseUp(MouseEvent e) {
-			internalMouseUp(e);
-		}
-	}
-
-	class RefreshDelayJob extends Job {
-		private int fDelay = 0;
-		RefreshDelayJob(int delay) {
-			super(SSEUIMessages.caret_update); //$NON-NLS-1$
-			setSystem(true);
-			fDelay = delay;
-		}
-
-		/**
-		 * Setup a delayed CaretEvent firing
-		 */
-		void touch() {
-			cancel();
-			schedule(fDelay);
-		}
-
-		protected IStatus run(IProgressMonitor monitor) {
-			handleEvent(null);
-			return Status.OK_STATUS;
-		}
-	}
-	
-	RefreshDelayJob fDelayer = null;
-	private static final int DELAY = 300;
-
-	/** used just for debug print outs */
-	private long endTime;
-	private long startTime;
-
-	protected ICaretListener[] fCaretListeners;
-	protected CaretMediatorListener internalListener;
-	protected StyledText textWidget;
-
-	/**
-	 * CaretMediator constructor comment.
-	 */
-	public CaretMediator() {
-		super();
-	}
-
-	/**
-	 * CaretMediator constructor comment. Must always provide the widget its
-	 * supposed to listen to.
-	 */
-	public CaretMediator(StyledText styledTextWidget) {
-		this();
-		setTextWidget(styledTextWidget);
-	}
-
-	public synchronized void addCaretListener(ICaretListener listener) {
-		if (Debug.debugStructuredDocument) {
-			System.out.println("CaretMediator::addCaretListener. Request to add an instance of " + listener.getClass() + " as a listener on caretlistner.");//$NON-NLS-2$//$NON-NLS-1$
-		}
-		// make sure listener is not already in listening array
-		// (and if it is, print a warning to aid debugging, if needed)
-
-		if (Utilities.contains(fCaretListeners, listener)) {
-			if (Debug.displayWarnings) {
-				System.out.println("CaretMediator::addCaretListener. listener " + listener + " was added more than once. ");//$NON-NLS-2$//$NON-NLS-1$
-			}
-		} else {
-			if (Debug.debugStructuredDocument) {
-				System.out.println("CaretMediator::addCaretListener. Adding an instance of " + listener.getClass() + " as a listener on caret mediator.");//$NON-NLS-2$//$NON-NLS-1$
-			}
-			int oldSize = 0;
-			if (fCaretListeners != null) {
-				// normally won't be null, but we need to be sure, for first
-				// time through
-				oldSize = fCaretListeners.length;
-			}
-			int newSize = oldSize + 1;
-			ICaretListener[] newListeners = new ICaretListener[newSize];
-			if (fCaretListeners != null) {
-				System.arraycopy(fCaretListeners, 0, newListeners, 0, oldSize);
-			}
-			// add listener to last position
-			newListeners[newSize - 1] = listener;
-			//
-			// now switch new for old
-			fCaretListeners = newListeners;
-
-		}
-	}
-
-	protected void fireCaretEvent(CaretEvent event) {
-		if (fCaretListeners != null) {
-			// we must assign listeners to local variable to be thread safe,
-			// since the add and remove listner methods
-			// can change this object's actual instance of the listener array
-			// from another thread
-			// (and since object assignment is atomic, we don't need to
-			// synchronize
-			ICaretListener[] holdListeners = fCaretListeners;
-			//
-			for (int i = 0; i < holdListeners.length; i++) {
-				holdListeners[i].caretMoved(event);
-			}
-		}
-	}
-
-	public void handleEvent(Event e) {
-		Display display = null;
-
-		if (Debug.debugCaretMediator) {
-			endTime = System.currentTimeMillis();
-			System.out.println("Timer fired: " + (endTime - startTime)); //$NON-NLS-1$
-		}
-
-		// check if 'okToUse'
-		if (textWidget != null && !textWidget.isDisposed()) {
-			display = textWidget.getDisplay();
-			if ((display != null) && (!display.isDisposed())) {
-				display.asyncExec(new Runnable() {
-					public void run() {
-						if (textWidget != null && !textWidget.isDisposed()) {
-							fireCaretEvent(new CaretEvent(textWidget, textWidget.getCaretOffset()));
-						}
-					}
-				});
-			}
-		}
-	}
-
-	protected void internalKeyPressed(KeyEvent e) {
-		fDelayer.cancel();
-	}
-
-	protected void internalKeyReleased(KeyEvent e) {
-		switch (e.keyCode) {
-			case SWT.ARROW_DOWN :
-			case SWT.ARROW_UP :
-			case SWT.ARROW_LEFT :
-			case SWT.ARROW_RIGHT :
-			case SWT.HOME :
-			case SWT.END :
-			case SWT.PAGE_DOWN :
-			case SWT.PAGE_UP : {
-				fDelayer.touch();
-				break;
-			}
-			default : {
-				// always update cursor postion, even during normal typing
-				// (the logic may look funny, since we always to the same
-				// thing, but we haven't always done the same thing, so I
-				// wanted to leave that fact documented via code.)
-				fDelayer.touch();
-			}
-		}
-	}
-
-	protected void internalMouseDown(MouseEvent e) {
-		fDelayer.cancel();
-	}
-
-	protected void internalMouseUp(MouseEvent e) {
-		// Note, even during a swipe select, when the mouse button goes up,
-		// and the widget is
-		// queried for the current caret postion, it always returns the
-		// beginning of the selection,
-		// which is desirable (at least for the known use of this feature,
-		// which is to signal
-		// that the property sheet can update itself.
-		fDelayer.touch();
-	}
-
-	public void release() {
-		fDelayer.cancel();
-		if (textWidget != null && !textWidget.isDisposed()) {
-			textWidget.removeKeyListener(internalListener);
-			textWidget.removeMouseListener(internalListener);
-			textWidget = null;
-		}
-	}
-
-	public synchronized void removeCaretListener(ICaretListener listener) {
-		if ((fCaretListeners != null) && (listener != null)) {
-			// if its not in the listeners, we'll ignore the request
-			if (Utilities.contains(fCaretListeners, listener)) {
-				int oldSize = fCaretListeners.length;
-				int newSize = oldSize - 1;
-				ICaretListener[] newListeners = new ICaretListener[newSize];
-				int index = 0;
-				for (int i = 0; i < oldSize; i++) {
-					if (fCaretListeners[i] == listener) { // ignore
-					} else {
-						// copy old to new if its not the one we are removing
-						newListeners[index++] = fCaretListeners[i];
-					}
-				}
-				// now that we have a new array, let's switch it for the old
-				// one
-				fCaretListeners = newListeners;
-			}
-		}
-	}
-
-	public void setTextWidget(StyledText newTextWidget) {
-		if(fDelayer == null) {
-			fDelayer = new RefreshDelayJob(DELAY);
-		}
-
-		// unhook from previous, if any
-		if (this.textWidget != null) {
-			fDelayer.cancel();
-			this.textWidget.removeKeyListener(internalListener);
-			this.textWidget.removeMouseListener(internalListener);
-		}
-
-		this.textWidget = newTextWidget;
-
-		if (internalListener == null) {
-			internalListener = new CaretMediatorListener();
-		}
-
-		if (this.textWidget != null) {
-			this.textWidget.addKeyListener(internalListener);
-			this.textWidget.addMouseListener(internalListener);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java
deleted file mode 100644
index fc2dc98..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java
+++ /dev/null
@@ -1,265 +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.sse.ui.internal;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Simple generic ID to class to mapping. Loads a specified class defined in a
- * configuration element with the matching type and target ID. Example
- * plugin.xml section:
- * 
- * &lt;extension
- * point=&quot;org.eclipse.wst.sse.ui.editorConfiguration&quot;&gt;contentoutlineconfiguration
- * target=&quot;org.eclipse.wst.sse.dtd.core.dtdsource&quot;
- * class=&quot;org.eclipse.wst.sse.ui.dtd.views.contentoutline.DTDContentOutlineConfiguration&quot;/&gt;
- * &lt;/extension&gt;
- * 
- * Used in code by getConfiguration(&quot;contentoutlineconfiguration&quot;,
- * &quot;org.eclipse.wst.dtd.ui.StructuredTextEditorDTD&quot;);
- * 
- */
-public class ExtendedConfigurationBuilder extends RegistryReader {
-	/**
-	 * Extension type to pass into getConfigurations to get content outline
-	 * configuration
-	 */
-	public static final String CONTENTOUTLINECONFIGURATION = "contentOutlineConfiguration"; //$NON-NLS-1$
-	/**
-	 * Extension type to pass into getConfigurations to get property sheet
-	 * configuration
-	 */
-	public static final String PROPERTYSHEETCONFIGURATION = "propertySheetConfiguration"; //$NON-NLS-1$
-	/**
-	 * Extension type to pass into getConfigurations to get source viewer
-	 * configuration
-	 */
-	public static final String SOURCEVIEWERCONFIGURATION = "sourceViewerConfiguration"; //$NON-NLS-1$
-
-	private static final String ATT_CLASS = "class"; //$NON-NLS-1$
-	private static final String ATT_TARGET = "target"; //$NON-NLS-1$
-	private static final String ATT_TYPE = "type"; //$NON-NLS-1$
-	private static final String CONFIGURATION = "provisionalConfiguration"; //$NON-NLS-1$
-	private static Map configurationMap = null;
-	private final static boolean debugTime = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/extendedconfigurationbuilder/time")); //$NON-NLS-1$  //$NON-NLS-2$
-	private static final String DEFINITION = "provisionalDefinition"; //$NON-NLS-1$
-	private static final String EP_EXTENDEDCONFIGURATION = "editorConfiguration"; //$NON-NLS-1$
-	private static ExtendedConfigurationBuilder instance = null;
-	public static final String VALUE = "value"; //$NON-NLS-1$
-
-	/**
-	 * Creates an extension. If the extension plugin has not been loaded a
-	 * busy cursor will be activated during the duration of the load.
-	 * 
-	 * @param element
-	 *            the config element defining the extension
-	 * @param classAttribute
-	 *            the name of the attribute carrying the class
-	 * @returns the extension object if successful. If an error occurs when
-	 *          createing executable extension, the exception is logged, and
-	 *          null returned.
-	 */
-	static Object createExtension(final IConfigurationElement element, final String classAttribute, final String targetID) {
-		final Object[] result = new Object[1];
-		String pluginId = element.getDeclaringExtension().getNamespace();
-		Bundle bundle = Platform.getBundle(pluginId);
-		if (bundle.getState() == Bundle.ACTIVE) {
-			try {
-				result[0] = element.createExecutableExtension(classAttribute);
-			}
-			catch (Exception e) {
-				// catch and log ANY exception while creating the extension
-				Logger.logException("error loading class " + classAttribute + " for " + targetID, e); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-		}
-		else {
-			BusyIndicator.showWhile(null, new Runnable() {
-				public void run() {
-					try {
-						result[0] = element.createExecutableExtension(classAttribute);
-					}
-					catch (Exception e) {
-						// catch and log ANY exception from extension point
-						Logger.logException("error loading class " + classAttribute + " for " + targetID, e); //$NON-NLS-1$ //$NON-NLS-2$
-					}
-				}
-			});
-		}
-		return result[0];
-	}
-
-	public synchronized static ExtendedConfigurationBuilder getInstance() {
-		if (instance == null)
-			instance = new ExtendedConfigurationBuilder();
-		return instance;
-	}
-
-	long time0 = 0;
-
-	private ExtendedConfigurationBuilder() {
-		super();
-	}
-
-	private List createConfigurations(List configurations, String extensionType, String targetID) {
-		if (configurations == null)
-			return new ArrayList(0);
-		List result = new ArrayList(1);
-		for (int i = 0; i < configurations.size(); i++) {
-			IConfigurationElement element = (IConfigurationElement) configurations.get(i);
-			if ((element.getName().equals(extensionType) || (element.getName().equals(CONFIGURATION) && extensionType.equals(element.getAttribute(ATT_TYPE))))) {
-				String[] targets = StringUtils.unpack(element.getAttribute(ATT_TARGET));
-				for (int j = 0; j < targets.length; j++) {
-					if (targetID.equals(targets[j].trim())) {
-						Object o = createExtension(element, ATT_CLASS, targetID);
-						if (o != null) {
-							result.add(o);
-						}
-					}
-				}
-			}
-		}
-		return result;
-	}
-
-	private IConfigurationElement[] findConfigurationElements(List configurations, String extensionType, String targetID) {
-		if (configurations == null)
-			return new IConfigurationElement[0];
-		List result = new ArrayList(1);
-		for (int i = 0; i < configurations.size(); i++) {
-			IConfigurationElement element = (IConfigurationElement) configurations.get(i);
-			if ((element.getName().equals(extensionType) || (element.getName().equals(DEFINITION) && extensionType.equals(element.getAttribute(ATT_TYPE))))) {
-				String[] targets = StringUtils.unpack(element.getAttribute(ATT_TARGET));
-				for (int j = 0; j < targets.length; j++) {
-					if (targetID.equals(targets[j].trim())) {
-						result.add(element);
-					}
-				}
-			}
-		}
-		return (IConfigurationElement[]) result.toArray(new IConfigurationElement[0]);
-	}
-
-	/**
-	 * Returns a configuration for the given extensionType matching the
-	 * targetID, if one is available. If more than one configuration is
-	 * defined, the first one found is returned.
-	 * 
-	 * @param extensionType
-	 * @param targetID
-	 * @return a configuration object, if one was defined
-	 */
-	public Object getConfiguration(String extensionType, String targetID) {
-		if (targetID == null || targetID.length() == 0)
-			return null;
-		List configurations = getConfigurations(extensionType, targetID);
-		if (configurations.isEmpty())
-			return null;
-		return configurations.get(0);
-	}
-
-	/**
-	 * Returns all configurations for the given extensionType matching the
-	 * targetID, if any are available.
-	 * 
-	 * @param extensionType
-	 * @param targetID
-	 * @return a List of configuration objects, which may or may not be empty
-	 */
-	public List getConfigurations(String extensionType, String targetID) {
-		if (targetID == null || targetID.length() == 0)
-			return new ArrayList(0);
-		if (configurationMap == null) {
-			configurationMap = new HashMap(0);
-			synchronized (configurationMap) {
-				readRegistry(Platform.getExtensionRegistry(), SSEUIPlugin.ID, EP_EXTENDEDCONFIGURATION);
-				if (debugTime) {
-					System.out.println(getClass().getName() + "#readRegistry():  " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
-					time0 = System.currentTimeMillis();
-				}
-			}
-		}
-		List extensions = (List) configurationMap.get(extensionType);
-		List configurations = createConfigurations(extensions, extensionType, targetID);
-		if (debugTime) {
-			if (!configurations.isEmpty())
-				System.out.println(getClass().getName() + "#getConfiguration(" + extensionType + ", " + targetID + "): configurations loaded in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			else
-				System.out.println(getClass().getName() + "#getConfiguration(" + extensionType + ", " + targetID + "): ran in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		}
-		return configurations;
-	}
-
-	/**
-	 * Returns all declared definitions for the given extensionType matching
-	 * the targetID, if any are available.
-	 * 
-	 * @param extensionType
-	 * @param targetID
-	 * @return An array containing the definitions, empty if none were
-	 *         declared
-	 */
-	public String[] getDefinitions(String extensionType, String targetID) {
-		if (targetID == null || targetID.length() == 0)
-			return new String[0];
-		if (debugTime) {
-			time0 = System.currentTimeMillis();
-		}
-		if (configurationMap == null) {
-			configurationMap = new HashMap(0);
-			synchronized (configurationMap) {
-				readRegistry(Platform.getExtensionRegistry(), SSEUIPlugin.ID, EP_EXTENDEDCONFIGURATION);
-				if (debugTime) {
-					System.out.println(getClass().getName() + "#readRegistry():  " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
-					time0 = System.currentTimeMillis();
-				}
-			}
-		}
-		List definitions = (List) configurationMap.get(extensionType);
-		IConfigurationElement[] elements = findConfigurationElements(definitions, extensionType, targetID);
-		String[] values = new String[elements.length];
-		for (int i = 0; i < values.length; i++) {
-			values[i] = elements[i].getAttribute(VALUE);
-		}
-		if (debugTime) {
-			if (values.length > 0)
-				System.out.println(getClass().getName() + "#getDefinitions(" + extensionType + ", " + targetID + "): definition loaded in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			else
-				System.out.println(getClass().getName() + "#getDefinitions(" + extensionType + ", " + targetID + "): ran in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		}
-		return values;
-	}
-
-	protected boolean readElement(IConfigurationElement element) {
-		String name = element.getName();
-		if (name.equals(CONFIGURATION) || name.equals(DEFINITION))
-			name = element.getAttribute(ATT_TYPE);
-		List configurations = (List) configurationMap.get(name);
-		if (configurations == null) {
-			configurations = new ArrayList(1);
-			configurationMap.put(name, configurations);
-		}
-		configurations.add(element);
-		return true;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorActionBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorActionBuilder.java
deleted file mode 100644
index ef7f745..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorActionBuilder.java
+++ /dev/null
@@ -1,789 +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.sse.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IKeyBindingService;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.part.MultiPageEditorSite;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.wst.sse.ui.internal.extension.ActionDescriptor;
-import org.eclipse.wst.sse.ui.internal.extension.IExtendedEditorActionProxyForDelayLoading;
-import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-
-
-/**
- * This class reads the registry for extensions that plug into 'editorActions'
- * extension point.
- */
-
-public class ExtendedEditorActionBuilder extends RegistryReader {
-
-	public class ExtendedContributor implements IExtendedContributor, IMenuListener {
-		private IExtendedSimpleEditor activeExtendedEditor = null;
-
-		private List cache;
-		private Map map = new HashMap();
-		private IMenuManager menuBar = null;
-
-		private Set menus = new HashSet();
-
-		public ExtendedContributor(List cache) {
-			this.cache = cache;
-		}
-
-		private IExtendedSimpleEditor computeExtendedEditor(final IEditorPart editor) {
-			IExtendedSimpleEditor simpleEditor = null;
-			if (editor instanceof IExtendedSimpleEditor) {
-				simpleEditor = (IExtendedSimpleEditor) editor;
-			}
-			if (editor != null && simpleEditor == null) {
-				final ISourceEditingTextTools tools = (ISourceEditingTextTools) editor.getAdapter(ISourceEditingTextTools.class);
-				if (tools != null) {
-					simpleEditor = new IExtendedSimpleEditor() {
-						public int getCaretPosition() {
-							return tools.getCaretOffset();
-						}
-
-						public IDocument getDocument() {
-							return tools.getDocument();
-						}
-
-						public IEditorPart getEditorPart() {
-							return tools.getEditorPart();
-						}
-
-						public Point getSelectionRange() {
-							ITextSelection selection = tools.getSelection();
-							return new Point(selection.getOffset(), selection.getOffset() + selection.getLength());
-						}
-
-					};
-				}
-			}
-			return simpleEditor;
-		}
-
-		public void contributeToMenu(IMenuManager menu) {
-			menuBar = menu;
-			long time0 = System.currentTimeMillis();
-			for (int i = 0; i < cache.size(); i++) {
-				Object obj = cache.get(i);
-				if (obj instanceof IConfigurationElement) {
-					IConfigurationElement menuElement = (IConfigurationElement) obj;
-					if ((menuElement.getName()).equals(TAG_MENU)) {
-						contributeMenu(menuElement, menu, true);
-						if (debugMenu)
-							System.out.println(getClass().getName() + "#contributeToMenu() added: " + menuElement.getAttribute(ATT_ID)); //$NON-NLS-1$
-					}
-				}
-				else if (obj instanceof ActionDescriptor) {
-					try {
-						ActionDescriptor ad = (ActionDescriptor) obj;
-						IMenuManager mm = contributeMenuAction(ad, menu, true, false);
-						if (mm != null) {
-							map.put(ad.getContributionItem(), mm);
-							mm.addMenuListener(this);
-							menus.add(mm);
-							if (debugMenu)
-								System.out.println(getClass().getName() + "#contributeToMenu() added: " + ad.getId()); //$NON-NLS-1$
-						}
-					}
-					catch (Exception e) {
-						Logger.logException("contributing to menu", e); //$NON-NLS-1$
-					}
-				}
-			}
-			if (debugContributeTime)
-				System.out.println(getClass().getName() + "#contributeToMenu(): ran in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		public void contributeToPopupMenu(IMenuManager menu) {
-			long time0 = System.currentTimeMillis();
-			for (int i = 0; i < cache.size(); i++) {
-				Object obj = cache.get(i);
-				if (obj instanceof IConfigurationElement) {
-					IConfigurationElement menuElement = (IConfigurationElement) obj;
-					if ((menuElement.getName()).equals(TAG_POPUPMENU)) {
-						contributeMenu(menuElement, menu, true);
-					}
-				}
-				else if (obj instanceof ActionDescriptor) {
-					try {
-						ActionDescriptor ad = (ActionDescriptor) obj;
-						IAction a = ad.getAction();
-						if (a instanceof IExtendedEditorAction) {
-							// uncaught exceptions could cause the menu to not
-							// be shown
-							try {
-								if (((ad.getPopupMenuPath() != null) || (ad.getPopupMenuGroup() != null)) && (a instanceof IExtendedEditorActionProxyForDelayLoading)) {
-								    ((IExtendedEditorActionProxyForDelayLoading)a).realize();
-								}
-
-								IExtendedEditorAction eea = (IExtendedEditorAction) a;
-								eea.setActiveExtendedEditor(activeExtendedEditor);
-								eea.update();
-								if (eea.isVisible()) {
-									IMenuManager parent = contributeMenuAction(ad, menu, true, true);
-									if (debugPopup && parent != null)
-										System.out.println(getClass().getName() + "#contributeToPopupMenu() added: " + ad.getId()); //$NON-NLS-1$
-								}
-							}
-							catch (Exception e) {
-								Logger.logException(e);
-							}
-
-						}
-						else {
-							IMenuManager parent = contributeMenuAction(ad, menu, true, true);
-							if (debugPopup && parent != null)
-								System.out.println(getClass().getName() + "#contributeToPopupMenu() added: " + ad.getId()); //$NON-NLS-1$
-						}
-					}
-					catch (Exception e) {
-						Logger.logException("contributing to popup", e); //$NON-NLS-1$
-					}
-				}
-			}
-			if (debugContributeTime)
-				System.out.println(getClass().getName() + "#contributeToPopupMenu(): ran in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		public void contributeToStatusLine(IStatusLineManager manager) {
-			// nothing from here
-		}
-
-		public void contributeToToolBar(IToolBarManager manager) {
-			long time0 = System.currentTimeMillis();
-			for (int i = 0; i < cache.size(); i++) {
-				Object obj = cache.get(i);
-				if (obj instanceof ActionDescriptor) {
-					try {
-						ActionDescriptor ad = (ActionDescriptor) obj;
-						IAction a = ad.getAction();
-						if (a instanceof IExtendedEditorAction) {
-							if (((ad.getToolbarPath() != null) || (ad.getToolbarGroup() != null)) && (a instanceof IExtendedEditorActionProxyForDelayLoading)) {
-							    ((IExtendedEditorActionProxyForDelayLoading)a).realize();
-							}
-							IExtendedEditorAction eea = (IExtendedEditorAction) a;
-							eea.setActiveExtendedEditor(activeExtendedEditor);
-							eea.update();
-							if (eea.isVisible()) {
-								boolean contributed = contributeToolbarAction(ad, manager, true);
-								if (debugToolbar && contributed)
-									System.out.println(getClass().getName() + "#contributeToToolBar() added: " + ad.getId()); //$NON-NLS-1$
-							}
-							else {
-								if (debugToolbar)
-									System.out.println(getClass().getName() + "#contributeToToolBar(): [skipped] " + ad.getId()); //$NON-NLS-1$
-							}
-						}
-						else {
-							boolean contributed = contributeToolbarAction(ad, manager, true);
-							if (debugToolbar && contributed)
-								System.out.println(getClass().getName() + "#contributeToToolBar() added: " + ad.getId()); //$NON-NLS-1$
-						}
-					}
-					catch (Exception e) {
-						Logger.logException("contributing to toolbar", e); //$NON-NLS-1$
-					}
-				}
-			}
-			if (debugContributeTime)
-				System.out.println(getClass().getName() + "#contributeToToolBar(): ran in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		public void dispose() {
-			Iterator it = menus.iterator();
-			while (it.hasNext()) {
-				Object o = it.next();
-				if (o instanceof IMenuManager) {
-					((IMenuManager) o).removeMenuListener(this);
-				}
-			}
-		}
-
-		public void init(IActionBars bars, IWorkbenchPage page) {
-			// nothing from here
-		}
-
-		public void menuAboutToShow(IMenuManager menu) {
-			// slows down the menu and interferes with it for other editors;
-			// optimize on visibility
-			IEditorSite site = null;
-			boolean activeEditorIsVisible = false;
-
-			if (activeExtendedEditor != null && activeExtendedEditor.getEditorPart() != null)
-				site = activeExtendedEditor.getEditorPart().getEditorSite();
-			if (site == null)
-				return;
-
-			// Eclipse bug 48784 - [MPE] ClassCast exception Workbench page
-			// isPartVisiable for MultiPageSite
-			if (site instanceof MultiPageEditorSite) {
-				Object multiPageEditor = ((MultiPageEditorSite) site).getMultiPageEditor();
-				activeEditorIsVisible = multiPageEditor.equals(site.getPage().getActiveEditor()) || multiPageEditor.equals(site.getPage().getActivePart());
-			}
-			else {
-				activeEditorIsVisible = site.getWorkbenchWindow().getPartService().getActivePart().equals(activeExtendedEditor.getEditorPart());
-			}
-			// due to a delay class loading, don't return now
-//			if (!activeEditorIsVisible)
-//				return;
-
-			IContributionItem[] items = menu.getItems();
-			if (items == null || items.length == 0)
-				return;
-
-			for (int i = 0; i < items.length; ++i) {
-				// add menu listener to submenu
-				if (items[i] instanceof IMenuManager) {
-					((IMenuManager) items[i]).addMenuListener(this);
-					menus.add(items[i]);
-				}
-			}
-
-			Set keys = map.keySet();
-			Iterator it = keys.iterator();
-			boolean needActionContributionItemUpdate = false;
-			while (it.hasNext()) {
-				IContributionItem item = (IContributionItem) it.next();
-				IMenuManager mm = (IMenuManager) map.get(item);
-				if (menu.getId() != null && menu.getId().equals(mm.getId()) && item instanceof ActionContributionItem) {
-					try {
-						IAction action = ((ActionContributionItem) item).getAction();
-
-						if (action instanceof IExtendedEditorActionProxyForDelayLoading) {
-						    IExtendedEditorActionProxyForDelayLoading eea = (IExtendedEditorActionProxyForDelayLoading)action;
-						    if (eea.isRealized() == false) {
-						        eea.realize();
-						        needActionContributionItemUpdate = true;
-						    }
-						}
-
-						if (activeEditorIsVisible || needActionContributionItemUpdate) {
-							if (action instanceof IUpdate) {
-								((IUpdate) action).update();
-							}
-						}
-
-						if (activeEditorIsVisible || needActionContributionItemUpdate) {
-							boolean visible = true;
-							if (action instanceof IExtendedEditorAction) {
-								visible = ((IExtendedEditorAction) action).isVisible();
-							}
-							item.setVisible(visible);
-						}
-
-						if (needActionContributionItemUpdate) {
-						    ((ActionContributionItem)item).update();
-						}
-
-					}
-					catch (Exception e) {
-						Logger.logException("updating actions", e); //$NON-NLS-1$
-					}
-				}
-			}
-			if (activeEditorIsVisible || needActionContributionItemUpdate) {
-			    if (needActionContributionItemUpdate) {
-			        // the action is realized so that need to update the menu w/
-			        // force set to true
-			        menu.update(true);
-			    } else {
-			        menu.update(false);
-			    }
-			}
-		}
-
-		public void setActiveEditor(IEditorPart editor) {
-			activeExtendedEditor = computeExtendedEditor(editor);
-			IKeyBindingService svc = (editor != null) ? editor.getEditorSite().getKeyBindingService() : null;
-			for (int i = 0; i < cache.size(); i++) {
-				Object obj = cache.get(i);
-				if (obj instanceof ActionDescriptor) {
-					ActionDescriptor ad = (ActionDescriptor) obj;
-					try {
-						IAction action = ad.getAction();
-						if (action instanceof IExtendedEditorAction) {
-							((IExtendedEditorAction) action).setActiveExtendedEditor(activeExtendedEditor);
-							((IExtendedEditorAction) action).update();
-							// update visibility right now so that the menu
-							// will show/hide properly
-							if (!((IExtendedEditorAction) action).isVisible() && ad.getContributionItem() != null)
-								ad.getContributionItem().setVisible(false);
-							if (svc != null && action.getActionDefinitionId() != null) {
-								svc.registerAction(action);
-							}
-						}
-					}
-					catch (Exception e) {
-						Logger.logException("setting active editor on actions", e); //$NON-NLS-1$
-					}
-				}
-			}
-
-			if (menuBar != null && editor != null) {
-				// Class clz = editor.getClass();
-				// while (clz != null) {
-				// if (clz.getName().equals(targetID)) {
-				// contributeToMenu(menuBar);
-				// break;
-				// }
-				// clz = clz.getSuperclass();
-				// }
-				if (targetIDs.contains(editor.getEditorSite().getId())) {
-					contributeToMenu(menuBar);
-				}
-			}
-
-			updateToolbarActions();
-		}
-
-		public void updateToolbarActions() {
-			for (int i = 0; i < cache.size(); i++) {
-				Object obj = cache.get(i);
-				if (obj instanceof ActionDescriptor) {
-					try {
-						ActionDescriptor ad = (ActionDescriptor) obj;
-						if (ad.getToolbarPath() != null) {
-							IAction action = ad.getAction();
-							if (action instanceof IUpdate) {
-								((IUpdate) action).update();
-							}
-						}
-					}
-					catch (Exception e) {
-						Logger.logException("updating toolbar actions", e); //$NON-NLS-1$
-					}
-				}
-			}
-		}
-	}
-
-	public static final String ATT_ID = "id"; //$NON-NLS-1$
-	public static final String ATT_LABEL = "label"; //$NON-NLS-1$
-	public static final String ATT_NAME = "name"; //$NON-NLS-1$
-	public static final String ATT_PATH = "path"; //$NON-NLS-1$
-
-	public static final String ATT_TARGET_ID = "targetID"; //$NON-NLS-1$
-	protected final static boolean debugContributeTime = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/extendededitoractionbuilder/contributetime")); //$NON-NLS-1$  //$NON-NLS-2$
-
-	protected final static boolean debugMenu = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugmenu")); //$NON-NLS-1$  //$NON-NLS-2$;
-	protected final static boolean debugPopup = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugpopup")); //$NON-NLS-1$  //$NON-NLS-2$;
-	protected final static boolean debugReadTime = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/extendededitoractionbuilder/readtime")); //$NON-NLS-1$  //$NON-NLS-2$
-	protected final static boolean debugToolbar = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugtoolbar")); //$NON-NLS-1$  //$NON-NLS-2$;
-
-	private static final String EXTENDED_EDITOR = "extendedEditor"; //$NON-NLS-1$
-
-	public static final String PL_EXTENDED_EDITOR_ACTIONS = "extendedEditorActions"; //$NON-NLS-1$
-
-	public static final String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
-	public static final String TAG_ACTION = "action"; //$NON-NLS-1$
-
-	public static final String TAG_CONTRIBUTION_TYPE = "editorContribution"; //$NON-NLS-1$
-
-	public static final String TAG_MENU = "menu"; //$NON-NLS-1$
-	public static final String TAG_POPUPMENU = "popupmenu"; //$NON-NLS-1$
-	public static final String TAG_RULERMENU = "rulermenu"; //$NON-NLS-1$
-	public static final String TAG_SEPARATOR = "separator"; //$NON-NLS-1$
-
-	protected List readingCache;
-
-	protected String targetContributionTag;
-	protected List targetIDs;
-
-	/**
-	 * The constructor.
-	 */
-	public ExtendedEditorActionBuilder() {
-		super();
-	}
-
-	/**
-	 * Creates a menu from the information in the menu configuration element
-	 * and adds it into the provided menu manager. If 'appendIfMissing' is
-	 * true, and menu path slot is not found, it will be created and menu will
-	 * be added into it. Otherwise, add operation will fail.
-	 */
-	protected void contributeMenu(IConfigurationElement menuElement, IMenuManager mng, boolean appendIfMissing) {
-		// Get config data.
-		String id = menuElement.getAttribute(ATT_ID);
-		String label = menuElement.getAttribute(ATT_LABEL);
-		String path = menuElement.getAttribute(ATT_PATH);
-		if (label == null) {
-			Logger.log(Logger.ERROR, "Invalid Menu Extension (label == null): " + id); //$NON-NLS-1$
-			return;
-		}
-
-		// Calculate menu path and group.
-		String group = null;
-		if (path != null) {
-			int loc = path.lastIndexOf('/');
-			if (loc != -1) {
-				group = path.substring(loc + 1);
-				path = path.substring(0, loc);
-			}
-			else {
-				// assume that path represents a slot
-				// so actual path portion should be null
-				group = path;
-				path = null;
-			}
-		}
-
-		// Find parent menu.
-		IMenuManager parent = mng;
-		if (path != null) {
-			parent = mng.findMenuUsingPath(path);
-			if (parent == null) {
-				// Logger.log("Invalid Menu Extension (Path is invalid): " +
-				// id);//$NON-NLS-1$
-				return;
-			}
-			// IMenuManager.findMenuUsingPath() returns invisible menu item if
-			// the manager can't find
-			// the specified path and create new MenuManager for it.
-			// I don't know this is a specification or bug.
-			// Anyway, to ensure the menu can be visible, setVisible(true)
-			// needs to be called.
-			parent.setVisible(true);
-		}
-
-		// Find reference group.
-		if (group == null)
-			group = IWorkbenchActionConstants.MB_ADDITIONS;
-		IContributionItem sep = parent.find(group);
-		if (sep == null) {
-			if (appendIfMissing)
-				parent.add(new Separator(group));
-			else {
-				Logger.log(Logger.ERROR, "Invalid Menu Extension (Group is invalid): " + id); //$NON-NLS-1$
-				return;
-			}
-		}
-
-		// If the menu does not exist create it.
-		IMenuManager newMenu = parent.findMenuUsingPath(id);
-		if (newMenu == null)
-			newMenu = new MenuManager(label, id);
-
-		// Create separators.
-		IConfigurationElement[] children = menuElement.getChildren(TAG_SEPARATOR);
-		for (int i = 0; i < children.length; i++) {
-			contributeSeparator(newMenu, children[i]);
-		}
-
-		// Add new menu
-		try {
-			parent.insertAfter(group, newMenu);
-		}
-		catch (IllegalArgumentException e) {
-			Logger.log(Logger.ERROR, "Invalid Menu Extension (Group is missing): " + id); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Contributes action from action descriptor into the provided menu
-	 * manager.
-	 */
-	protected IMenuManager contributeMenuAction(ActionDescriptor ad, IMenuManager menu, boolean appendIfMissing, boolean popupmenu) {
-		if (ad.getContributionItem() == null || ad.getAction() == null)
-			return null;
-
-		// Get config data.
-		String mpath = popupmenu ? ad.getPopupMenuPath() : ad.getMenuPath();
-		String mgroup = popupmenu ? ad.getPopupMenuGroup() : ad.getMenuGroup();
-		if (mpath == null && mgroup == null)
-			return null;
-
-		// Find parent menu.
-		IMenuManager parent = menu;
-		if (mpath != null) {
-			parent = parent.findMenuUsingPath(mpath);
-			if (parent == null) {
-				// Logger.log("Invalid Menu Extension (Path is invalid): " +
-				// ad.getId()); //$NON-NLS-1$
-				return null;
-			}
-			// IMenuManager.findMenuUsingPath() returns invisible menu item if
-			// the manager can't find
-			// the specified path and create new MenuManager for it.
-			// I don't know this is a specification or bug.
-			// Anyway, to ensure the menu can be visible, setVisible(true)
-			// needs to be called.
-			parent.setVisible(true);
-		}
-
-		// First remove existing menu item
-		IContributionItem item = parent.find(ad.getId());
-		if (item != null) {
-			parent.remove(ad.getId());
-		}
-
-		// Find reference group.
-		if (mgroup == null)
-			mgroup = IWorkbenchActionConstants.MB_ADDITIONS;
-		IContributionItem sep = parent.find(mgroup);
-		if (sep == null) {
-			if (appendIfMissing)
-				parent.add(sep = new Separator(mgroup));
-			else {
-				Logger.log(Logger.ERROR, "Invalid Menu Extension (Group is invalid): " + ad.getId()); //$NON-NLS-1$
-				return null;
-			}
-		}
-
-		// Add action.
-		try {
-			if (popupmenu) {
-				// Context menu need a newly created contribution item
-				if (sep != null && sep.isGroupMarker())
-					parent.appendToGroup(sep.getId(), ad.getAction());
-				else
-					parent.insertAfter(mgroup, ad.getAction());
-			}
-			else {
-				// Normal menu need to add existing contribution item to
-				// remove it from menu listener
-				if (sep != null && sep.isGroupMarker())
-					parent.appendToGroup(sep.getId(), ad.getContributionItem());
-				else
-					parent.insertAfter(mgroup, ad.getContributionItem());
-			}
-		}
-		catch (IllegalArgumentException e) {
-			Logger.log(Logger.ERROR, "Invalid Menu Extension (Group is missing): " + ad.getId()); //$NON-NLS-1$
-			parent = null;
-		}
-
-		return parent;
-	}
-
-	/**
-	 * Creates a named menu separator from the information in the
-	 * configuration element. If the separator already exists do not create a
-	 * second.
-	 */
-	protected boolean contributeSeparator(IMenuManager menu, IConfigurationElement element) {
-		String id = element.getAttribute(ATT_NAME);
-		if (id == null || id.length() <= 0)
-			return false;
-		IContributionItem sep = menu.find(id);
-		if (sep != null)
-			return false;
-		menu.add(new Separator(id));
-		return true;
-	}
-
-	/**
-	 * Contributes action from the action descriptor into the provided tool
-	 * bar manager.
-	 */
-	protected boolean contributeToolbarAction(ActionDescriptor ad, IToolBarManager toolbar, boolean appendIfMissing) {
-		if (ad.getContributionItem() == null || ad.getAction() == null)
-			return false;
-
-		// Get config data.
-		String tpath = ad.getToolbarPath();
-		String tgroup = ad.getToolbarGroup();
-		if (tpath == null && tgroup == null)
-			return false;
-
-		// First remove existing toolbar item
-		IContributionItem item = toolbar.find(ad.getId());
-		if (item != null) {
-			toolbar.remove(ad.getId());
-		}
-
-		// Find reference group.
-		if (tgroup == null)
-			tgroup = IWorkbenchActionConstants.MB_ADDITIONS;
-		IContributionItem sep = toolbar.find(tgroup);
-		if (sep == null) {
-			if (appendIfMissing)
-				toolbar.add(new Separator(tgroup));
-			else {
-				Logger.log(Logger.ERROR, "Invalid Toolbar Extension (Group is invalid): " + ad.getId()); //$NON-NLS-1$
-				return false;
-			}
-		}
-
-		// Add action to tool bar.
-		try {
-			if (sep != null && sep.isGroupMarker())
-				toolbar.appendToGroup(sep.getId(), ad.getAction());
-			else
-				toolbar.insertAfter(tgroup, ad.getAction());
-		}
-		catch (IllegalArgumentException e) {
-			Logger.log(Logger.ERROR, "Invalid Toolbar Extension (Group is missing): " + ad.getId()); //$NON-NLS-1$
-			return false;
-		}
-		return true;
-	}
-
-	/**
-	 * This factory method returns a new ActionDescriptor for the
-	 * configuration element. It should be implemented by subclasses.
-	 */
-	protected ActionDescriptor createActionDescriptor(IConfigurationElement element) {
-		ActionDescriptor ad = null;
-		try {
-			ad = new ActionDescriptor(element);
-			// these cases like "class not found" are handled
-			// at lower level, so no action if formed. In that
-			// case, we also don't want to form an action descriptor.
-			if ((ad != null) && (ad.getAction() == null)) {
-				ad = null;
-			}
-		}
-		catch (Exception e) {
-			Logger.traceException(EXTENDED_EDITOR, e);
-			ad = null;
-		}
-		return ad;
-	}
-
-	/**
-	 * Returns the name of the part ID attribute that is expected in the
-	 * target extension.
-	 */
-	protected String getTargetID(IConfigurationElement element) {
-		String value = element.getAttribute(ATT_TARGET_ID);
-		return value != null ? value : "???"; //$NON-NLS-1$
-	}
-
-	/**
-	 * Reads editor contributor if specified directly in the 'editor'
-	 * extension point, and all external contributions for this editor's ID
-	 * registered in 'editorActions' extension point.
-	 */
-	public IExtendedContributor readActionExtensions(String editorId) {
-		return readActionExtensions(new String[]{editorId});
-	}
-
-	/**
-	 * Reads editor contributor if specified directly in the 'editor'
-	 * extension point, and all external contributions for this editor's ID
-	 * registered in 'editorActions' extension point.
-	 */
-	public IExtendedContributor readActionExtensions(String[] ids) {
-		long time0 = System.currentTimeMillis();
-		ExtendedContributor ext = null;
-		readContributions(ids, TAG_CONTRIBUTION_TYPE, PL_EXTENDED_EDITOR_ACTIONS);
-		if (debugReadTime) {
-			String idlist = ""; //$NON-NLS-1$
-			if (ids.length > 0) {
-				for (int i = 0; i < ids.length; i++) {
-					idlist += ids[i];
-					if (i < ids.length - 1)
-						idlist += ","; //$NON-NLS-1$
-				}
-			}
-			System.out.println(getClass().getName() + "#readActionExtensions(" + idlist + "): read in " + (System.currentTimeMillis() - time0) + "ms [" + (readingCache != null ? readingCache.size() : 0) + " contributions]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		}
-		if (readingCache != null) {
-			ext = new ExtendedContributor(readingCache);
-			readingCache = null;
-		}
-		return ext;
-	}
-
-	/**
-	 * Reads the contributions from the registry for the provided workbench
-	 * part and the provided extension point IDs.
-	 */
-	protected void readContributions(String[] ids, String tag, String extensionPoint) {
-		readingCache = null;
-		targetIDs = Arrays.asList(ids);
-		targetContributionTag = tag;
-		IExtensionRegistry registry = Platform.getExtensionRegistry();
-		readRegistry(registry, PLUGIN_ID, extensionPoint);
-	}
-
-	/**
-	 * Implements abstract method to handle the provided XML element in the
-	 * registry.
-	 */
-	protected boolean readElement(IConfigurationElement element) {
-		String tag = element.getName();
-		if (tag.equals(targetContributionTag)) {
-			String id = getTargetID(element);
-			if (id == null || !targetIDs.contains(id)) {
-				// This is not of interest to us - don't go deeper
-				return true;
-			}
-		}
-		else if (tag.equals(TAG_MENU)) {
-			if (readingCache == null)
-				readingCache = new ArrayList();
-			readingCache.add(element);
-			return true; // just cache the element - don't go into it
-		}
-		else if (tag.equals(TAG_POPUPMENU)) {
-			if (readingCache == null)
-				readingCache = new ArrayList();
-			readingCache.add(element);
-			return true; // just cache the element - don't go into it
-		}
-		else if (tag.equals(TAG_RULERMENU)) {
-			if (readingCache == null)
-				readingCache = new ArrayList();
-			readingCache.add(element);
-			return true; // just cache the element - don't go into it
-		}
-		else if (tag.equals(TAG_ACTION)) {
-			if (readingCache == null)
-				readingCache = new ArrayList();
-			ActionDescriptor ad = createActionDescriptor(element);
-			if (ad != null)
-				readingCache.add(ad);
-			return true; // just cache the action - don't go into
-		}
-		else {
-			return false;
-		}
-
-		readElementChildren(element);
-		return true;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorDropTargetAdapter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorDropTargetAdapter.java
deleted file mode 100644
index fbdf6ba..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorDropTargetAdapter.java
+++ /dev/null
@@ -1,332 +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.sse.ui.internal;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.swt.custom.ST;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTargetAdapter;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Caret;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.sse.ui.internal.TransferBuilder.TransferProxyForDelayLoading;
-
-/**
- * ExtendedEditorDropTargetAdapter
- */
-public class ExtendedEditorDropTargetAdapter extends DropTargetAdapter {
-
-	private Point caret = null;
-	private String[] editorIds;
-	private int orgOffset = 0;
-	private IEditorPart targetEditor = null;
-	private ITextViewer textViewer = null;
-
-	private Transfer[] transfers = null;
-
-	private boolean useProxy;
-
-	/**
-	 * @deprecated use ExtendedEditorDropTargetAdapter(boolean useProxy) for
-	 *             the performance
-	 */
-	public ExtendedEditorDropTargetAdapter() {
-		this(false);
-	}
-
-	public ExtendedEditorDropTargetAdapter(boolean useProxy) {
-		super();
-		this.useProxy = useProxy;
-	}
-
-	protected boolean doDrop(Transfer transfer, DropTargetEvent event) {
-		TransferBuilder tb = new TransferBuilder(useProxy);
-
-		IDropAction[] as = null;
-		if (editorIds != null && editorIds.length > 0)
-			as = tb.getDropActions(editorIds, transfer);
-		else
-			as = tb.getDropActions(getTargetEditor().getClass().getName(), transfer);
-
-		for (int i = 0; i < as.length; ++i) {
-			IDropAction da = as[i];
-			Transfer actualTransfer;
-			if (transfer instanceof TransferProxyForDelayLoading) {
-				actualTransfer = ((TransferProxyForDelayLoading) transfer).getTransferClass();
-			}
-			else {
-				actualTransfer = transfer;
-			}
-			if (actualTransfer instanceof FileTransfer) {
-				if (event.data == null) {
-					Logger.log(Logger.ERROR, "No data in DropTargetEvent from " + event.widget); //$NON-NLS-1$
-					return false;
-				}
-				String[] strs = (String[]) event.data;
-				boolean[] bs = new boolean[strs.length];
-				int c = 0;
-				for (int j = 0; j < strs.length; ++j) {
-					bs[j] = false;
-					if (da.isSupportedData(strs[j])) {
-						event.data = new String[]{strs[j]};
-						if (!da.run(event, targetEditor)) {
-							bs[j] = true;
-							c++;
-						}
-					} else {
-						bs[j] = true;
-						c++;
-					}
-				}
-				if (c == 0) {
-					return true;
-				}
-
-				int k = 0;
-				String[] rests = new String[c];
-				for (int j = 0; j < strs.length; ++j) {
-					if (bs[j])
-						rests[k++] = strs[j];
-				}
-				event.data = rests;
-			} else if (da.isSupportedData(event.data)) {
-				if (da.run(event, targetEditor)) {
-					return true;
-				}
-			}
-		}
-
-		return false;
-	}
-
-	/**
-	 */
-	public void dragEnter(DropTargetEvent event) {
-		caret = null;
-		TransferData data = null;
-		Transfer[] ts = getTransfers();
-		for (int i = 0; i < ts.length; i++) {
-			for (int j = 0; j < event.dataTypes.length; j++) {
-				if (ts[i].isSupportedType(event.dataTypes[j])) {
-					data = event.dataTypes[j];
-					break;
-				}
-			}
-			if (data != null) {
-				event.currentDataType = data;
-				break;
-			}
-		}
-
-		if (textViewer != null) {
-			orgOffset = textViewer.getTextWidget().getCaretOffset();
-		}
-	}
-
-	public void dragLeave(DropTargetEvent event) {
-		if (textViewer != null) {
-			StyledText st = textViewer.getTextWidget();
-			st.setCaretOffset(orgOffset);
-			st.redraw();
-			st.update();
-		}
-	}
-
-	/**
-	 */
-	public void dragOver(DropTargetEvent event) {
-		event.operations &= ~DND.DROP_MOVE;
-		event.detail = DND.DROP_COPY;
-
-		if (textViewer != null) {
-			Point pt = toControl(new Point(event.x, event.y));
-			StyledText st = textViewer.getTextWidget();
-
-			// auto scroll
-			Rectangle ca = st.getClientArea();
-			int margin = st.getLineHeight();
-
-			if (pt.y < margin) { // up
-				st.invokeAction(ST.LINE_UP);
-			} else if (pt.y > ca.height - margin) { // down
-				st.invokeAction(ST.LINE_DOWN);
-			}
-
-			// draw insertion point
-			int offset = getDropOffset(st, pt);
-			if (offset != st.getCaretOffset()) {
-				st.setCaretOffset(offset);
-				st.setSelection(offset);
-			}
-
-			Point newCaret = st.getLocationAtOffset(offset);
-			if (newCaret.equals(caret))
-				return;
-
-			Caret ct = st.getCaret();
-			Point size = ct.getSize();
-
-			GC gc = new GC(st);
-			gc.setLineWidth(size.x);
-
-			// erase old caret
-			if (caret != null) {
-				Color originalForeground = gc.getForeground();
-				gc.setForeground(st.getBackground());
-				gc.drawRectangle(caret.x, caret.y, size.x, size.y);
-				gc.setForeground(originalForeground);
-			}
-
-			st.redraw();
-			st.update();
-
-			// draw new caret
-			caret = newCaret;
-			if (ct.getImage() != null)
-				gc.drawImage(ct.getImage(), caret.x, caret.y);
-			else {
-				gc.drawLine(caret.x, caret.y, caret.x, caret.y + size.y);
-			}
-
-			gc.dispose();
-		}
-	}
-
-	/**
-	 */
-	public void drop(DropTargetEvent event) {
-		if (event.operations == DND.DROP_NONE)
-			return;
-
-		if (textViewer != null) {
-			Point pt = toControl(new Point(event.x, event.y));
-			StyledText st = textViewer.getTextWidget();
-
-			int offset = getDropOffset(st, pt);
-			if (offset != st.getCaretOffset()) {
-				st.setCaretOffset(offset);
-			}
-
-			// ISelectionProvider sp = textViewer.getSelectionProvider();
-			// ISelection sel = new TextSelection(offset, 0);
-			// sp.setSelection(sel);
-			textViewer.setSelectedRange(offset, 0);
-		}
-
-		Transfer[] ts = getTransfers();
-		for (int i = 0; i < ts.length; i++) {
-			if (ts[i].isSupportedType(event.currentDataType)) {
-				if (doDrop(ts[i], event)) {
-					break;
-				}
-			}
-		}
-	}
-
-	protected int getDropOffset(DropTargetEvent event) {
-		Point pt = getTextViewer().getTextWidget().toControl(new Point(event.x, event.y));
-		StyledText st = textViewer.getTextWidget();
-		return getDropOffset(st, pt);
-	}
-
-	private int getDropOffset(StyledText st, Point pt) {
-		int offset = st.getCaretOffset();
-		try {
-			offset = st.getOffsetAtLocation(pt);
-		} catch (IllegalArgumentException e) {
-			// This is normal case if mouse cursor is on outside of valid
-			// text.
-			boolean found = false;
-			Point p = new Point((pt.x > 0 ? pt.x : 0), pt.y);
-			// search nearest character
-			for (; p.x > -1; p.x--) {
-				try {
-					offset = st.getOffsetAtLocation(p);
-
-					/*
-					 * Now that a valid offset has been found, try to place at
-					 * the end of the line
-					 */
-					if (textViewer != null && textViewer.getDocument() != null) {
-						IRegion lineInfo = null;
-						try {
-							lineInfo = textViewer.getDocument().getLineInformationOfOffset(offset);
-						} catch (BadLocationException e1) {
-						}
-						if (lineInfo != null)
-							offset = lineInfo.getOffset() + lineInfo.getLength();
-					}
-
-					found = true;
-					break;
-				} catch (IllegalArgumentException ex) {
-				}
-			}
-
-			if (!found) {
-				offset = st.getCharCount();
-			}
-		}
-		return offset;
-	}
-
-	public IEditorPart getTargetEditor() {
-		return targetEditor;
-	}
-
-	public ITextViewer getTextViewer() {
-		return textViewer;
-	}
-
-	/**
-	 * @return org.eclipse.swt.dnd.Transfer[]
-	 */
-	public Transfer[] getTransfers() {
-		if (transfers == null) {
-			TransferBuilder tb = new TransferBuilder(useProxy);
-			if (editorIds == null || editorIds.length == 0)
-				transfers = tb.getDropTargetTransfers(getTargetEditor().getClass().getName());
-			else
-				transfers = tb.getDropTargetTransfers(editorIds);
-		}
-		return transfers;
-	}
-
-	/**
-	 */
-	public void setTargetEditor(IEditorPart targetEditor) {
-		this.targetEditor = targetEditor;
-	}
-
-	public void setTargetIDs(String[] ids) {
-		editorIds = ids;
-	}
-
-	public void setTextViewer(ITextViewer textViewer) {
-		this.textViewer = textViewer;
-	}
-
-	private Point toControl(Point point) {
-		return (textViewer != null ? textViewer.getTextWidget().toControl(point) : point);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FileDropAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FileDropAction.java
deleted file mode 100644
index c8a3b31..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FileDropAction.java
+++ /dev/null
@@ -1,47 +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.sse.ui.internal;
-
-import org.eclipse.core.resources.IFile;
-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.swt.dnd.DropTargetEvent;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * Action for file drop
- */
-public class FileDropAction extends AbstractDropAction {
-	public boolean run(DropTargetEvent event, IEditorPart targetEditor) {
-		String[] strs = (String[]) event.data;
-		if (strs == null || strs.length == 0) {
-			return false;
-		}
-
-		String str = ""; //$NON-NLS-1$
-		for (int i = 0; i < strs.length; ++i) {
-			IPath path = new Path(strs[i]);
-			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-			IFile file = root.getFileForLocation(path);
-			if (file != null) {
-				path = file.getProjectRelativePath();
-			}
-
-			str += "\"" + path.toString() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		return insert(str, targetEditor);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FormatProcessorsExtensionReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FormatProcessorsExtensionReader.java
deleted file mode 100644
index 78badf8..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FormatProcessorsExtensionReader.java
+++ /dev/null
@@ -1,102 +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.sse.ui.internal;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
-import org.osgi.framework.Bundle;
-
-public class FormatProcessorsExtensionReader extends RegistryReader {
-	private static FormatProcessorsExtensionReader instance;
-
-	public synchronized static FormatProcessorsExtensionReader getInstance() {
-		if (instance == null) {
-			instance = new FormatProcessorsExtensionReader();
-
-			IExtensionRegistry registry = Platform.getExtensionRegistry();
-			instance.readRegistry(registry, "org.eclipse.wst.sse.core", "formatProcessors"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		return instance;
-	}
-
-	private Map map = new HashMap();
-//	 TODO: private field never read locally
-	String processorClassName;
-
-	public IStructuredFormatProcessor getFormatProcessor(String contentTypeId) {
-		if (contentTypeId == null)
-			return null;
-
-		IStructuredFormatProcessor formatProcessor = null;
-		if (map.containsKey(contentTypeId)) {
-			formatProcessor = (IStructuredFormatProcessor) map.get(contentTypeId);
-		} else {
-			IContentTypeManager manager = Platform.getContentTypeManager();
-			IContentType queryContentType = manager.getContentType(contentTypeId);
-			boolean found = false;
-			for (Iterator iter = map.keySet().iterator(); iter.hasNext();) {
-				String elementContentTypeId = (String) iter.next();
-				IContentType elementContentType = manager.getContentType(elementContentTypeId);
-				if (queryContentType.isKindOf(elementContentType)) {
-					formatProcessor = (IStructuredFormatProcessor) map.get(elementContentTypeId);
-					map.put(contentTypeId, formatProcessor);
-					found = true;
-					break;
-				}
-			}
-
-			if (!found)
-				map.put(contentTypeId, null);
-		}
-
-		return formatProcessor;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.internal.extension.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
-	 */
-	protected boolean readElement(IConfigurationElement element) {
-		if (element.getName().equals("processor")) { //$NON-NLS-1$
-			String contentTypeId = element.getAttribute("contentTypeId"); //$NON-NLS-1$
-			String processorClassName = element.getAttribute("class"); //$NON-NLS-1$
-			String pluginID = element.getDeclaringExtension().getNamespace();
-			Bundle bundle = Platform.getBundle(pluginID);
-
-			try {
-				IStructuredFormatProcessor processor = (IStructuredFormatProcessor)bundle.loadClass(processorClassName).newInstance();
-				map.put(contentTypeId, processor);
-
-				return true;
-			} catch (InstantiationException e) {
-				e.printStackTrace();
-			} catch (IllegalAccessException e) {
-				e.printStackTrace();
-			} catch (ClassNotFoundException e) {
-				e.printStackTrace();
-			}
-		}
-
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java
deleted file mode 100644
index 823f9ea..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java
+++ /dev/null
@@ -1,367 +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.sse.ui.internal;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.ui.texteditor.AnnotationPreference;
-import org.eclipse.ui.texteditor.IEditorStatusLine;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.MarkerAnnotation;
-import org.eclipse.ui.texteditor.TextEditorAction;
-
-/**
- * Based on org.eclipse.jdt.internal.ui.javaeditor.GotoAnnotationAction and
- * the org.eclipse.jdt.internal.ui.JavaEditor's gotoError() method. Rewritten
- * based on 3.0M7 version to operate generically.
- * 
- */
-public class GotoAnnotationAction extends TextEditorAction {
-
-	private static final boolean _debug = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/gotoNextAnnotation")); //$NON-NLS-1$  //$NON-NLS-2$
-	/**
-	 * Clears the status line on selection changed.
-	 */
-	protected class StatusLineClearer implements ISelectionChangedListener {
-		IStatusLineManager fStatusLineManager = null;
-
-		protected StatusLineClearer(IStatusLineManager mgr) {
-			super();
-			fStatusLineManager = mgr;
-		}
-
-		/*
-		 * @see ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
-		 */
-		public void selectionChanged(SelectionChangedEvent event) {
-			getTextEditor().getSelectionProvider().removeSelectionChangedListener(StatusLineClearer.this);
-
-			fStatusLineManager.setErrorMessage(null, null);
-			fStatusLineManager.setMessage(null, null);
-		}
-	}
-
-	private boolean fForward;
-	private String fLabel;
-
-	private String fPrefix;
-
-	/**
-	 * @param prefix
-	 * @param editor
-	 */
-	public GotoAnnotationAction(String prefix, boolean forward) {
-		super(SSEUIMessages.getResourceBundle(), prefix, null);
-		fForward = forward;
-		fPrefix = prefix;
-		fLabel = SSEUIMessages.getResourceBundle().getString(fPrefix);
-	}
-
-	/*
-	 * This is the default label used for description
-	 */
-	public String getDefaultLabel() {
-		return fLabel;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.action.Action#getDescription()
-	 */
-	public String getDescription() {
-		return getDefaultLabel();
-	}
-
-	/**
-	 * Returns the annotation closest to the given range respecting the given
-	 * direction. If an annotation is found, the annotations current position
-	 * is copied into the provided annotation position.
-	 * 
-	 * @param offset
-	 *            the region offset
-	 * @param length
-	 *            the region length
-	 * @param forward
-	 *            <code>true</code> for forwards, <code>false</code> for
-	 *            backward
-	 * @param annotationPosition
-	 *            the position of the found annotation
-	 * @return the found annotation
-	 */
-	protected Annotation getNextAnnotation(final int offset, final int length, boolean forward, Position annotationPosition) {
-		Annotation nextAnnotation = null;
-		Position nextAnnotationPosition = null;
-		Annotation containingAnnotation = null;
-		Position containingAnnotationPosition = null;
-		boolean currentAnnotation = false;
-
-		IDocument document = getTextEditor().getDocumentProvider().getDocument(getTextEditor().getEditorInput());
-		int endOfDocument = document.getLength();
-		int distance = Integer.MAX_VALUE;
-
-		IAnnotationModel model = getTextEditor().getDocumentProvider().getAnnotationModel(getTextEditor().getEditorInput());
-		// external files may not have an annotation model
-		if (model != null) {
-			Iterator e = model.getAnnotationIterator();
-			while (e.hasNext()) {
-				Annotation a = (Annotation) e.next();
-				if (!isNavigationTarget(a))
-					continue;
-
-				Position p = model.getPosition(a);
-				if (p == null)
-					continue;
-
-				if (forward && p.offset == offset || !forward && p.offset + p.getLength() == offset + length) {
-					if (containingAnnotation == null || (forward && p.length >= containingAnnotationPosition.length || !forward && p.length >= containingAnnotationPosition.length)) {
-						containingAnnotation = a;
-						containingAnnotationPosition = p;
-						currentAnnotation = p.length == length;
-					}
-				}
-				else {
-					int currentDistance = 0;
-
-					if (forward) {
-						currentDistance = p.getOffset() - offset;
-						if (currentDistance < 0) {
-							currentDistance = endOfDocument + currentDistance;
-						}
-
-						if (currentDistance < distance || currentDistance == distance && p.length < nextAnnotationPosition.length) {
-							distance = currentDistance;
-							nextAnnotation = a;
-							nextAnnotationPosition = p;
-						}
-					}
-					else {
-						currentDistance = offset + length - (p.getOffset() + p.length);
-						if (currentDistance < 0)
-							currentDistance = endOfDocument + currentDistance;
-
-						if (currentDistance < distance || currentDistance == distance && p.length < nextAnnotationPosition.length) {
-							distance = currentDistance;
-							nextAnnotation = a;
-							nextAnnotationPosition = p;
-						}
-					}
-				}
-			}
-		}
-		if (containingAnnotationPosition != null && (!currentAnnotation || nextAnnotation == null)) {
-			annotationPosition.setOffset(containingAnnotationPosition.getOffset());
-			annotationPosition.setLength(containingAnnotationPosition.getLength());
-			return containingAnnotation;
-		}
-		if (nextAnnotationPosition != null) {
-			annotationPosition.setOffset(nextAnnotationPosition.getOffset());
-			annotationPosition.setLength(nextAnnotationPosition.getLength());
-		}
-
-		return nextAnnotation;
-	}
-
-	private IStatusLineManager getStatusLineManager() {
-		// The original JavaEditor M7 implementation made use of an adapter,
-		// but that approach
-		// fails with a MultiPageEditorSite
-		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-		if (window == null)
-			return null;
-		IWorkbenchPage page = window.getActivePage();
-		if (page == null)
-			return null;
-		IEditorPart editor = page.getActiveEditor();
-		if (editor == null)
-			return null;
-		IEditorActionBarContributor contributor = editor.getEditorSite().getActionBarContributor();
-		if (contributor instanceof EditorActionBarContributor) {
-			return ((EditorActionBarContributor) contributor).getActionBars().getStatusLineManager();
-		}
-		return null;
-	}
-
-	public String getText() {
-		return getDefaultLabel();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.action.Action#getToolTipText()
-	 */
-	public String getToolTipText() {
-		return getDefaultLabel();
-	}
-
-	/**
-	 * Jumps to the error next according to the given direction based off
-	 * JavaEditor#gotoAnnotation()
-	 * 
-	 * @param forward
-	 *            is the direction
-	 */
-	public void gotoAnnotation(boolean forward) {
-		ITextSelection selection = (ITextSelection) getTextEditor().getSelectionProvider().getSelection();
-		Position position = new Position(0, 0);
-		if (false /* delayed - see bug 18316 */) {
-			getNextAnnotation(selection.getOffset(), selection.getLength(), forward, position);
-			getTextEditor().selectAndReveal(position.getOffset(), position.getLength());
-		}
-		else /* no delay - see bug 18316 */{
-			Annotation annotation = getNextAnnotation(selection.getOffset(), selection.getLength(), forward, position);
-			IEditorStatusLine editorStatusLine = (IEditorStatusLine) getTextEditor().getAdapter(IEditorStatusLine.class);
-			if (editorStatusLine != null) {
-				editorStatusLine.setMessage(true, null, null);
-				editorStatusLine.setMessage(false, null, null);
-			}
-			else {
-				IStatusLineManager mgr = getStatusLineManager();
-				if (mgr != null) {
-					mgr.setErrorMessage(null);
-					mgr.setMessage(null, null);
-				}
-			}
-			if (annotation != null) {
-				updateAnnotationViews(annotation);
-				if (_debug) {
-					System.out.println("select and reveal " + annotation.getType() + "@" + position.getOffset() + ":" + position.getLength()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-				}
-				getTextEditor().selectAndReveal(position.getOffset(), position.getLength());
-				if (editorStatusLine != null) {
-					editorStatusLine.setMessage(true, null, null);
-					editorStatusLine.setMessage(false, annotation.getText(), null);
-				}
-				else {
-					IStatusLineManager mgr = getStatusLineManager();
-					if (mgr != null) {
-						mgr.setErrorMessage(null);
-						mgr.setMessage(null, annotation.getText());
-					}
-					getTextEditor().getSelectionProvider().addSelectionChangedListener(new StatusLineClearer(mgr));
-				}
-			}
-		}
-	}
-
-	/**
-	 * Returns whether the given annotation is configured as a target for the
-	 * "Go to Next/Previous Annotation" actions
-	 * 
-	 * @param annotation
-	 *            the annotation
-	 * @return <code>true</code> if this is a target, <code>false</code>
-	 *         otherwise
-	 * @see Eclipse 3.0
-	 */
-	protected boolean isNavigationTarget(Annotation annotation) {
-		Preferences preferences = EditorsUI.getPluginPreferences();
-		AnnotationPreference preference = EditorsUI.getAnnotationPreferenceLookup().getAnnotationPreference(annotation);
-		// See bug 41689
-		// String key= forward ? preference.getIsGoToNextNavigationTargetKey()
-		// : preference.getIsGoToPreviousNavigationTargetKey();
-		String key = preference == null ? null : preference.getIsGoToNextNavigationTargetKey();
-		return (key != null && preferences.getBoolean(key));
-	}
-
-	public void run() {
-		gotoAnnotation(fForward);
-	}
-
-	public void setEditor(ITextEditor editor) {
-		super.setEditor(editor);
-		update();
-	}
-
-	/**
-	 * Updates the annotation views that show the given annotation.
-	 * 
-	 * @param annotation
-	 *            the annotation
-	 */
-	protected void updateAnnotationViews(Annotation annotation) {
-		IMarker marker = null;
-		if (annotation instanceof MarkerAnnotation)
-			marker = ((MarkerAnnotation) annotation).getMarker();
-
-		if (marker != null) {
-			try {
-				IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-				if (window != null) {
-					IWorkbenchPage page = window.getActivePage();
-					if (page != null) {
-						IViewPart view = null;
-						if (marker.isSubtypeOf(IMarker.PROBLEM)) {
-							view = page.findView(IPageLayout.ID_PROBLEM_VIEW);
-						}
-						else if (marker.isSubtypeOf(IMarker.TASK)) {
-							view = page.findView(IPageLayout.ID_TASK_LIST);
-						}
-						else if (marker.isSubtypeOf(IMarker.BOOKMARK)) {
-							view = page.findView(IPageLayout.ID_BOOKMARKS);
-						}
-						// If the view isn't open on this perspective, don't
-						// interact with it
-						if (view != null) {
-							Method method = view.getClass().getMethod("setSelection", new Class[]{IStructuredSelection.class, boolean.class}); //$NON-NLS-1$
-							if (method != null) {
-								method.invoke(view, new Object[]{new StructuredSelection(marker), Boolean.TRUE});
-								page.bringToTop(view);
-							}
-						}
-					}
-				}
-			}
-			// ignore exceptions, don't update any of the lists, just set
-			// statusline
-			catch (CoreException x) {
-				//
-			}
-			catch (NoSuchMethodException x) {
-				//
-			}
-			catch (IllegalAccessException x) {
-				//
-			}
-			catch (InvocationTargetException x) {
-				//
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IActionValidator.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IActionValidator.java
deleted file mode 100644
index 81d6eaa..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IActionValidator.java
+++ /dev/null
@@ -1,17 +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.sse.ui.internal;
-
-public interface IActionValidator {
-	boolean isValidAction();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IDropAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IDropAction.java
deleted file mode 100644
index ac2a70b..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IDropAction.java
+++ /dev/null
@@ -1,37 +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.sse.ui.internal;
-
-
-
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.ui.IEditorPart;
-
-/**
- */
-public interface IDropAction {
-
-
-	/**
-	 * @param data
-	 *            DropTargetEvent.data will be passed.
-	 * @return boolean true for supported data type
-	 */
-	public boolean isSupportedData(Object data);
-
-	/**
-	 * @return boolean true for the action is actually processed false for the
-	 *         action is not processed.
-	 */
-	public boolean run(DropTargetEvent event, IEditorPart targetEditor);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedContributor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedContributor.java
deleted file mode 100644
index 6839ff1..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedContributor.java
+++ /dev/null
@@ -1,30 +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.sse.ui.internal;
-
-
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.ui.IEditorActionBarContributor;
-
-public interface IExtendedContributor extends IEditorActionBarContributor, IPopupMenuContributor {
-	public void contributeToMenu(IMenuManager menu);
-
-	public void contributeToStatusLine(IStatusLineManager manager);
-
-	public void contributeToToolBar(IToolBarManager manager);
-
-	public void updateToolbarActions();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedEditorAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedEditorAction.java
deleted file mode 100644
index 7347734..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedEditorAction.java
+++ /dev/null
@@ -1,38 +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.sse.ui.internal;
-
-
-
-import org.eclipse.ui.texteditor.IUpdate;
-
-public interface IExtendedEditorAction extends IUpdate {
-
-	/**
-	 * Returns whether this action item is visible
-	 * 
-	 * @return <code>true</code> if this item is visible, and
-	 *         <code>false</code> otherwise
-	 */
-	public boolean isVisible();
-
-	/**
-	 * Sets the active editor for the action. Implementors should disconnect
-	 * from the old editor, connect to the new editor, and update the action
-	 * to reflect the new editor.
-	 * 
-	 * @param targetEditor
-	 *            the new editor target
-	 */
-	public void setActiveExtendedEditor(IExtendedSimpleEditor targetEditor);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedMarkupEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedMarkupEditor.java
deleted file mode 100644
index e35eaa5..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedMarkupEditor.java
+++ /dev/null
@@ -1,47 +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.sse.ui.internal;
-
-
-
-import java.util.List;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * IExtendedMarkupEditor
- * 
- * @deprecated use the editor's ISourceEditingTextTools adapter and cast to
- *             IDOMSourceEditingTextTools when appropriate
- */
-public interface IExtendedMarkupEditor  {
-
-	/**
-	 * @deprecated - use the IDOMSourceEditingTextTools.getNode(int) method
-	 *             with ISourceEditingTextTools.getCaretOffset()
-	 * @return
-	 */
-	public Node getCaretNode();
-
-	/**
-	 * @deprecated - use method on IDOMSourceEditingTextTools
-	 */
-	public Document getDOMDocument();
-
-	/**
-	 * @deprecated - some editors will provide the list of selected nodes as
-	 *             part of ISourceEditingTextTools.getSelection()
-	 */
-	public List getSelectedNodes();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedSimpleEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedSimpleEditor.java
deleted file mode 100644
index d93ad56..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedSimpleEditor.java
+++ /dev/null
@@ -1,33 +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.sse.ui.internal;
-
-/**
- * @deprecated, obtain a ISourceEditingTextTools adapter from the editor part
- */
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.IEditorPart;
-
-public interface IExtendedSimpleEditor {
-
-	public int getCaretPosition();
-
-	public IDocument getDocument();
-
-	public IEditorPart getEditorPart();
-
-	public Point getSelectionRange();
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IModelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IModelProvider.java
deleted file mode 100644
index 5a7d739..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IModelProvider.java
+++ /dev/null
@@ -1,21 +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.sse.ui.internal;
-
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-
-public interface IModelProvider extends IDocumentProvider {
-	IStructuredModel getModel(Object element);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IPopupMenuContributor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IPopupMenuContributor.java
deleted file mode 100644
index dfe5190..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IPopupMenuContributor.java
+++ /dev/null
@@ -1,22 +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.sse.ui.internal;
-
-
-
-import org.eclipse.jface.action.IMenuManager;
-
-public interface IPopupMenuContributor {
-
-	public void contributeToPopupMenu(IMenuManager menu);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IReleasable.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IReleasable.java
deleted file mode 100644
index 5806815..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IReleasable.java
+++ /dev/null
@@ -1,20 +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.sse.ui.internal;
-
-public interface IReleasable {
-	/**
-	 * Generic catch-all for releasing resources and other references
-	 */
-	void release();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ISourceViewerActionBarContributor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ISourceViewerActionBarContributor.java
deleted file mode 100644
index 0425582..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ISourceViewerActionBarContributor.java
+++ /dev/null
@@ -1,29 +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.sse.ui.internal;
-
-
-
-import org.eclipse.ui.IEditorActionBarContributor;
-
-public interface ISourceViewerActionBarContributor extends IEditorActionBarContributor {
-
-	/**
-	 * Enables disables actions that are specific to the source viewer (and
-	 * should only work when the source viewer is enabled)
-	 * 
-	 * @param enabled
-	 *            true if source viewer is currently enabled, false otherwise
-	 */
-	public void setViewerSpecificContributionsEnabled(boolean enabled);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ITemporaryAnnotation.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ITemporaryAnnotation.java
deleted file mode 100644
index fc25631..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ITemporaryAnnotation.java
+++ /dev/null
@@ -1,17 +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.sse.ui.internal;
-
-public interface ITemporaryAnnotation {
-	Object getKey();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java
deleted file mode 100644
index dfb1edc..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java
+++ /dev/null
@@ -1,161 +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.sse.ui.internal;
-
-
-
-import java.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.sse.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.sse.ui/src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java
deleted file mode 100644
index 61b56d9..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java
+++ /dev/null
@@ -1,74 +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
- *     
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.eclipse.wst.sse.ui.internal.provisional.preferences.CommonEditorPreferenceNames;
-
-
-public class PreferenceInitializer extends AbstractPreferenceInitializer {
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
-	 */
-	public void initializeDefaultPreferences() {
-		IPreferenceStore store = SSEUIPlugin.getDefault().getPreferenceStore();
-
-		// use the base annotation & quick diff preference page
-		EditorsUI.useAnnotationsPreferencePage(store);
-		EditorsUI.useQuickDiffPreferencePage(store);
-
-		// let annotations show up in the vertical ruler if that's what the
-		// preference is
-		//		// these annotation preferences have a different default value than
-		// the one the base provides
-		//		store.setDefault("errorIndicationInVerticalRuler", false);
-		// //$NON-NLS-1$
-		//		store.setDefault("warningIndicationInVerticalRuler", false);
-		// //$NON-NLS-1$
-
-		// these annotation preferences are not part of base text editor
-		// preference
-		store.setDefault(CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS, true);
-
-		setMatchingBracketsPreferences(store);
-
-		// hover help preferences are not part of base text editor preference
-		String mod2Name = Action.findModifierString(SWT.MOD2); // SWT.COMMAND
-		// on Mac;
-		// SWT.CONTROL
-		// elsewhere
-		store.setDefault(EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS, "combinationHover|true|0;problemHover|false|0;documentationHover|false|0;annotationHover|true|" + mod2Name); //$NON-NLS-1$
-
-		// set default read-only foreground color scale value
-		store.setDefault(EditorPreferenceNames.READ_ONLY_FOREGROUND_SCALE, 30);
-		
-		// set default enable folding value
-		store.setDefault(IStructuredTextFoldingProvider.FOLDING_ENABLED, false);
-		
-		// set default for show message dialog when unknown content type in editor
-		store.setDefault(EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG, true);
-	}
-
-	private void setMatchingBracketsPreferences(IPreferenceStore store) {
-		// matching brackets is not part of base text editor preference
-		store.setDefault(EditorPreferenceNames.MATCHING_BRACKETS, true);
-		PreferenceConverter.setDefault(store, EditorPreferenceNames.MATCHING_BRACKETS_COLOR, new RGB(192, 192, 192));
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ReadOnlyAwareDropTargetAdapter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ReadOnlyAwareDropTargetAdapter.java
deleted file mode 100644
index 1fb0b9d..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ReadOnlyAwareDropTargetAdapter.java
+++ /dev/null
@@ -1,50 +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.sse.ui.internal;
-
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-public class ReadOnlyAwareDropTargetAdapter extends ExtendedEditorDropTargetAdapter {
-
-	/**
-	 * @deprecated - use ReadOnlyAwareDropTargetAdapter(boolean useProxy) for
-	 *             the performance
-	 */
-	public ReadOnlyAwareDropTargetAdapter() {
-		super();
-	}
-
-	public ReadOnlyAwareDropTargetAdapter(boolean useProxy) {
-		super(useProxy);
-	}
-
-	public void drop(DropTargetEvent event) {
-		IDocument document = getTextViewer().getDocument();
-		if (document instanceof IStructuredDocument) {
-			if (((IStructuredDocument) document).containsReadOnly(getDropOffset(event), 0)) {
-				event.operations = DND.DROP_NONE;
-				event.detail = DND.DROP_NONE;
-				getTextViewer().getTextWidget().redraw();
-				getTextViewer().getTextWidget().update();
-				getTextViewer().getTextWidget().getDisplay().beep();
-			}
-		}
-		super.drop(event);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java
deleted file mode 100644
index be08070..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java
+++ /dev/null
@@ -1,409 +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.sse.ui.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by SSE UI
- * 
- * @plannedfor 1.0
- */
-public class SSEUIMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.sse.ui.internal.SSEUIPluginResources";//$NON-NLS-1$
-	private static ResourceBundle fResourceBundle;
-
-	public static ResourceBundle getResourceBundle() {
-		try {
-			if (fResourceBundle == null)
-				fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
-		} catch (MissingResourceException x) {
-			fResourceBundle = null;
-		}
-		return fResourceBundle;
-	}
-
-	private SSEUIMessages() {
-		// cannot create new instance
-	}
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, SSEUIMessages.class);
-	}
-
-	public static String Error_opening_file_UI_;
-	public static String _UI_File_is_read_only;
-	public static String _32concat_EXC_;
-	public static String Multiple_errors;
-	public static String _Undo_Text_Change__Ctrl_Z_UI_;
-	public static String Undo_Text_Change__UI_;
-	public static String _Undo__0___Ctrl_Z_UI_;
-	public static String Undo___0___UI_;
-	public static String _Redo_Text_Change__Ctrl_Y_UI_;
-	public static String Redo_Text_Change__UI_;
-	public static String _Redo__0___Ctrl_Y_UI_;
-	public static String Redo___0___UI_;
-	public static String FormatMenu_label;
-	public static String Format_Document_UI_;
-	public static String Format_Active_Elements_UI_;
-	public static String Text_Cut_UI_;
-	public static String Text_Paste_UI_;
-
-	public static String Cleanup_Document_UI_;
-
-	public static String Editor_Cut_label;
-	public static String Editor_Cut_tooltip;
-	public static String Editor_Cut_image;
-	public static String Editor_Cut_description;
-	public static String Editor_Copy_label;
-	public static String Editor_Copy_tooltip;
-	public static String Editor_Copy_image;
-	public static String Editor_Copy_description;
-	public static String Editor_Paste_label;
-	public static String Editor_Paste_tooltip;
-	public static String Editor_Paste_image;
-	public static String Editor_Paste_description;
-	public static String Editor_Delete_label;
-	public static String Editor_Delete_tooltip;
-	public static String Editor_Delete_image;
-	public static String Editor_Delete_description;
-
-	public static String ContentAssistProposals_label;
-	public static String ContentAssistProposals_tooltip;
-	public static String ContentAssistProposals_description;
-	public static String QuickFix_label;
-	public static String QuickFix_tooltip;
-	public static String QuickFix_image;
-	public static String QuickFix_description;
-	public static String ToggleComment_label;
-	public static String ToggleComment_tooltip;
-	public static String ToggleComment_image;
-	public static String ToggleComment_description;
-	public static String AddBlockComment_label;
-	public static String AddBlockComment_tooltip;
-	public static String AddBlockComment_image;
-	public static String AddBlockComment_description;
-	public static String RemoveBlockComment_label;
-	public static String RemoveBlockComment_tooltip;
-	public static String RemoveBlockComment_image;
-	public static String RemoveBlockComment_description;
-	public static String CleanupDocument_label;
-	public static String CleanupDocument_tooltip;
-	public static String CleanupDocument_image;
-	public static String CleanupDocument_description;
-	public static String FormatDocument_label;
-	public static String FormatDocument_tooltip;
-	public static String FormatDocument_image;
-	public static String FormatDocument_description;
-	public static String FormatActiveElements_label;
-	public static String FormatActiveElements_tooltip;
-	public static String FormatActiveElements_image;
-	public static String FormatActiveElements_description;
-	public static String OpenFileFromSource_label;
-	public static String OpenFileFromSource_tooltip;
-	public static String OpenFileFromSource_image;
-	public static String OpenFileFromSource_description;
-	public static String ShowTooltipDesc_label;
-	public static String ShowTooltipDesc_tooltip;
-	public static String ShowTooltipDesc_image;
-	public static String ShowTooltipDesc_description;
-	public static String StructureSelectEnclosing_label;
-	public static String StructureSelectEnclosing_tooltip;
-	public static String StructureSelectEnclosing_description;
-	public static String StructureSelectNext_label;
-	public static String StructureSelectNext_tooltip;
-	public static String StructureSelectNext_description;
-	public static String StructureSelectPrevious_label;
-	public static String StructureSelectPrevious_tooltip;
-	public static String StructureSelectPrevious_description;
-	public static String StructureSelectHistory_label;
-	public static String StructureSelectHistory_tooltip;
-	public static String StructureSelectHistory_description;
-	public static String Text_Shift_Right_UI_;
-	public static String Text_Shift_Left_UI_;
-
-	public static String _4concat;
-	public static String Content_type__UI_;
-	public static String Foreground_UI_;
-	public static String Background_UI_;
-	public static String Bold_UI_;
-	public static String Italics_UI;
-	public static String Restore_Default_UI_;
-	public static String Sample_text__UI_;
-
-	public static String AddBreakpoint_label;
-	public static String AddBreakpoint_tooltip;
-	public static String AddBreakpoint_description;
-	public static String AddBreakpoint_error_dialog_title;
-	public static String AddBreakpoint_error_dialog_message;
-	public static String ToggleBreakpoint_label;
-	public static String ToggleBreakpoint_tooltip;
-	public static String ToggleBreakpoint_description;
-	public static String EnableBreakpoint_label;
-	public static String EnableBreakpoint_tooltip;
-	public static String EnableBreakpoint_description;
-	public static String DisableBreakpoint_label;
-	public static String DisableBreakpoint_tooltip;
-	public static String DisableBreakpoint_description;
-	public static String ManageBreakpoints_add_label;
-	public static String ManageBreakpoints_remove_label;
-	public static String ManageBreakpoints_tooltip;
-	public static String ManageBreakpoints_error_adding_title1;
-	public static String ManageBreakpoints_error_adding_message1;
-
-	public static String AbstractColorPageDescription;
-	public static String EditorModelUtil_0;
-	public static String EditorModelUtil_1;
-
-	// web content settings
-	public static String UI_Default_HTML_DOCTYPE_ID___1;
-	public static String UI_CSS_profile___2;
-	public static String UI_Target_Device___3;
-
-	public static String Editor_ToggleInsertMode_label;
-
-	//
-	// These strings are used in Workbench menu bar
-	//
-	public static String ExpandSelectionToMenu_label;
-	public static String SourceMenu_label;
-
-	public static String FindOccurrencesActionProvider_0;
-	public static String RemoveAction_0;
-	public static String ShowPropertiesAction_0;
-	public static String ContentOutlineConfiguration_0;
-	public static String ContentOutlineConfiguration_1;
-	public static String AbstractOpenOn_0;
-	public static String FormatActionDelegate_jobName;
-	public static String FormatActionDelegate_errorStatusMessage;
-	public static String FormatActionDelegate_3;
-	public static String FormatActionDelegate_4;
-	public static String FormatActionDelegate_5;
-
-	public static String TranslucencyPreferenceTab_0;
-	public static String TranslucencyPreferenceTab_1;
-	public static String StructuredTextEditorPreferencePage_2;
-	public static String StructuredTextEditorPreferencePage_6;
-	public static String StructuredTextEditorPreferencePage_20;
-	public static String StructuredTextEditorPreferencePage_23;
-	public static String StructuredTextEditorPreferencePage_24;
-	public static String StructuredTextEditorPreferencePage_30;
-	public static String StructuredTextEditorPreferencePage_37;
-	public static String StructuredTextEditorPreferencePage_38;
-	public static String TaskTagPreferenceTab_0;
-	public static String TaskTagPreferenceTab_1;
-	public static String TaskTagPreferenceTab_2;
-	public static String TaskTagPreferenceTab_3;
-	public static String TaskTagPreferenceTab_5;
-	public static String TaskTagPreferenceTab_6;
-	public static String TaskTagPreferenceTab_7;
-	public static String TaskTagPreferenceTab_12;
-	public static String TaskTagPreferenceTab_13;
-	public static String TaskTagPreferenceTab_14;
-	public static String TaskTagPreferenceTab_15;
-	public static String TaskTagPreferenceTab_16;
-	public static String TaskTagPreferenceTab_17;
-	public static String TaskTagPreferenceTab_18;
-	public static String TaskTagPreferenceTab_19;
-	public static String TaskTagPreferenceTab_20;
-	public static String TaskTagPreferenceTab_22;
-	public static String TaskTagPreferenceTab_23;
-	public static String TaskTagPreferenceTab_24;
-	public static String TaskTagPreferenceTab_25;
-	public static String TaskTagPreferenceTab_26;
-	public static String TaskTagPreferenceTab_27;
-	public static String TaskTagPreferenceTab_28;
-	public static String TaskTagPreferenceTab_29;
-	public static String TaskTagPreferenceTab_30;
-	public static String TaskTagPreferenceTab_31;
-	public static String TaskTagPreferencePage_32;
-	public static String TaskTagPreferenceTab_33;
-	public static String TaskTagExclusionTab_01;
-	public static String TaskTagExclusionTab_02;
-	public static String TaskTagExclusionTab_03;
-
-	public static String PropertyPreferencePage_01;
-	public static String PropertyPreferencePage_02;
-
-	public static String FilePreferencePage_0;
-	public static String NoModificationCompletionProposal_0;
-	public static String ToggleBreakpointAction_0;
-	public static String ManageBreakpointAction_0;
-	public static String ManageBreakpointAction_1;
-	public static String EditBreakpointAction_0;
-	// Used in Structured Text Editor Preference Page / Hovers Tab
-	public static String TextHoverPreferenceTab_title;
-	public static String TextHoverPreferenceTab_hoverPreferences;
-	public static String TextHoverPreferenceTab_keyModifier;
-	public static String TextHoverPreferenceTab_description;
-	public static String TextHoverPreferenceTab_modifierIsNotValid;
-	public static String TextHoverPreferenceTab_modifierIsNotValidForHover;
-	public static String TextHoverPreferenceTab_duplicateModifier;
-	public static String TextHoverPreferenceTab_nameColumnTitle;
-	public static String TextHoverPreferenceTab_modifierColumnTitle;
-	public static String TextHoverPreferenceTab_delimiter;
-	public static String TextHoverPreferenceTab_insertDelimiterAndModifierAndDelimiter;
-	public static String TextHoverPreferenceTab_insertModifierAndDelimiter;
-	public static String TextHoverPreferenceTab_insertDelimiterAndModifier;
-
-	// used dynamically
-	public static String combinationHover_label;
-	public static String combinationHover_desc;
-	public static String problemHover_label;
-	public static String problemHover_desc;
-	public static String documentationHover_label;
-	public static String documentationHover_desc;
-	public static String annotationHover_label;
-	public static String annotationHover_desc;
-
-	public static String EditStructuredTextEditorPreferencesAction_0;
-	public static String StructuredTextEditorPreferencePage_0;
-	public static String PreferenceManager_0;
-
-	public static String OccurrencesSearchQuery_0;
-	public static String OccurrencesSearchQuery_2;
-	public static String ShowView_errorTitle;
-	public static String proc_dirty_regions_0;
-	// Encoding
-	public static String EncodingPreferencePage_0;
-	public static String EncodingPreferencePage_1;
-
-	public static String busy;
-	public static String caret_update;
-	public static String EmptyFilePreferencePage_0;
-
-	public static String OffsetStatusLineContributionItem_0;
-	public static String OffsetStatusLineContributionItem_2;
-	public static String OffsetStatusLineContributionItem_3;
-	public static String OffsetStatusLineContributionItem_4;
-	public static String OffsetStatusLineContributionItem_5;
-	public static String OffsetStatusLineContributionItem_6;
-	public static String OffsetStatusLineContributionItem_7;
-	public static String OffsetStatusLineContributionItem_8;
-	public static String OffsetStatusLineContributionItem_9;
-	public static String OffsetStatusLineContributionItem_10;
-	public static String OffsetStatusLineContributionItem_11;
-	public static String OffsetStatusLineContributionItem_12;
-	public static String OffsetStatusLineContributionItem_13;
-	public static String OffsetStatusLineContributionItem_15;
-	public static String OffsetStatusLineContributionItem_16;
-	public static String OffsetStatusLineContributionItem_17;
-	public static String OffsetStatusLineContributionItem_18;
-
-	/*
-	 * *****Below are possibly unused strings that may be removed *****
-	 */
-	public static String Save_label;
-	public static String An_error_has_occurred_when_ERROR_;
-	public static String Problems_During_Save_As_UI_;
-	public static String Save_could_not_be_complete_UI_;
-	public static String ManageBreakpoints_error_removing_title1;
-	public static String ManageBreakpoints_error_removing_message1;
-	public static String ManageBreakpoints_error_retrieving_message;
-	public static String JSPSourcePreferencePageDescription;
-	public static String Editor_error_save_message;
-	public static String Editor_error_save_title;
-	public static String Editor_warning_save_delete;
-
-	public static String Previous_annotation;
-	public static String Next_annotation;
-
-	public static String AnnotationTypes_Errors;
-	public static String AnnotationTypes_Warnings;
-	public static String AnnotationTypes_Tasks;
-	public static String AnnotationTypes_SearchResults;
-	public static String AnnotationTypes_Bookmarks;
-	public static String AnnotationTypes_Others;
-
-	public static String Editor_ConvertToWindows_label;
-	public static String Editor_ConvertToWindows_tooltip;
-	public static String Editor_ConvertToWindows_image;
-	public static String Editor_ConvertToWindows_description;
-
-	public static String Editor_ConvertToUNIX_label;
-	public static String Editor_ConvertToUNIX_tooltip;
-	public static String Editor_ConvertToUNIX_image;
-	public static String Editor_ConvertToUNIX_description;
-
-	public static String Editor_ConvertToMac_label;
-	public static String Editor_ConvertToMac_tooltip;
-	public static String Editor_ConvertToMac_image;
-	public static String Editor_ConvertToMac_description;
-	public static String ConvertLineDelimitersMenu_label;
-	public static String FindOccurrences_label;
-
-	public static String ConvertLineDelimitersToCRLFActionDelegate_jobName;
-	public static String ConvertLineDelimitersToCRLFActionDelegate_errorStatusMessage;
-	public static String ConvertLineDelimitersToCRLFActionDelegate_3;
-	public static String ConvertLineDelimitersToCRLFActionDelegate_4;
-
-	public static String TextHoverPreferenceTab_annotationRollover;
-	public static String TextHoverPreferenceTab_showAffordance;
-	public static String TextHoverPreferenceTab_enabled;
-
-	public static String BasicFindOccurrencesAction_0;
-	public static String BasicSearchLabelProvider_0;
-	public static String NavigationPreferenceTab_0;
-	public static String OccurrencesSearchQuery_1;
-	public static String FileModelProvider_0;
-	public static String JFaceNodeAdapter_0;
-
-	public static String ConfigureProjectSettings;
-	public static String ConfigureWorkspaceSettings;
-	public static String EnableProjectSettings;
-
-	public static String LoadingReferencedGrammars;
-	
-	public static String Folding;
-	public static String StructuredTextEditorPreferencePage_3;
-	public static String Projection_Toggle_label;
-	public static String Projection_Toggle_tooltip;
-	public static String Projection_Toggle_description;
-	public static String Projection_Toggle_image;
-	public static String Projection_ExpandAll_label;
-	public static String Projection_ExpandAll_tooltip;
-	public static String Projection_ExpandAll_description;
-	public static String Projection_ExpandAll_image;
-
-	// These strings are accessed using resource bundle and in properties
-	// file, need to use '.' instead of '_' in some keys
-	public static String Editor_ManageBookmarks_tooltip;
-	public static String Editor_ManageBookmarks_image;
-	public static String Editor_ManageBookmarks_description;
-	public static String Editor_ManageBookmarks_add_label;
-	public static String Editor_ManageBookmarks_remove_label;
-	public static String Editor_ManageBookmarks_add_dialog_title;
-	public static String Editor_ManageBookmarks_add_dialog_message;
-	public static String Editor_ManageBookmarks_error_dialog_title;
-	public static String Editor_ManageBookmarks_error_dialog_message;
-	public static String Editor_ManageTasks_tooltip;
-	public static String Editor_ManageTasks_image;
-	public static String Editor_ManageTasks_description;
-	public static String Editor_ManageTasks_add_label;
-	public static String Editor_ManageTasks_remove_label;
-	public static String Editor_ManageTasks_add_dialog_title;
-	public static String Editor_ManageTasks_add_dialog_message;
-	public static String Editor_ManageTasks_error_dialog_title;
-	public static String Editor_ManageTasks_error_dialog_message;
-	public static String StructuredTextEditorPreferencePage_39;
-	public static String StructuredTextEditor_0;
-	public static String UnknownContentTypeDialog_0;
-	public static String UnknownContentTypeDialog_1;
-	public static String UnknownContentTypeDialog_2;
-	public static String StyledTextColorPicker_0;
-
-	/*
-	 * *****Above are possibly unused strings that may be removed*****
-	 */
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPlugin.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPlugin.java
deleted file mode 100644
index 50783e7..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPlugin.java
+++ /dev/null
@@ -1,80 +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.sse.ui.internal;
-
-
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.sse.core.internal.tasks.TaskScanningScheduler;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistryImpl;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
-import org.osgi.framework.BundleContext;
-
-
-public class SSEUIPlugin extends AbstractUIPlugin {
-
-	public final static String ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
-
-	static SSEUIPlugin instance = null;
-
-	public static SSEUIPlugin getDefault() {
-		return instance;
-	}
-
-	public synchronized static SSEUIPlugin getInstance() {
-		return instance;
-	}
-
-	private TextHoverManager fTextHoverManager;
-
-	public SSEUIPlugin() {
-		super();
-		instance = this;
-	}
-
-	public AdapterFactoryRegistry getAdapterFactoryRegistry() {
-		return AdapterFactoryRegistryImpl.getInstance();
-
-	}
-
-	/**
-	 * Return text hover manager
-	 * 
-	 * @return TextHoverManager
-	 */
-	public TextHoverManager getTextHoverManager() {
-		if (fTextHoverManager == null) {
-			fTextHoverManager = new TextHoverManager();
-		}
-		return fTextHoverManager;
-	}
-
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-		/**
-		 * 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();
-		}
-	}
-
-	public void stop(BundleContext context) throws Exception {
-		super.stop(context);
-		TaskScanningScheduler.shutdown();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties
deleted file mode 100644
index af1d4f1..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties
+++ /dev/null
@@ -1,385 +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
-#
-###############################################################################
-Error_opening_file_UI_=Error opening file
-_UI_File_is_read_only=File {0} is read-only.
-_32concat_EXC_=Editor could not be open on {0}
-Multiple_errors=Multiple annotations found at this line:
-_Undo_Text_Change__Ctrl_Z_UI_=&Undo Text Change @Ctrl+Z
-Undo_Text_Change__UI_=Undo Text Change.
-_Undo__0___Ctrl_Z_UI_=&Undo {0} @Ctrl+Z
-Undo___0___UI_=Undo: {0}.
-_Redo_Text_Change__Ctrl_Y_UI_=&Redo Text Change @Ctrl+Y
-Redo_Text_Change__UI_=Redo Text Change.
-_Redo__0___Ctrl_Y_UI_=&Redo {0} @Ctrl+Y
-Redo___0___UI_=Redo: {0}.
-FormatMenu_label=F&ormat
-Format_Document_UI_=Format Document
-Format_Active_Elements_UI_=Format Active Elements
-Text_Cut_UI_=Text Cut
-Text_Paste_UI_=Text Paste
-###############################################################################
-Cleanup_Document_UI_=Cleanup Document
-
-Editor_Cut_label=Cu&t@Ctrl+X
-Editor_Cut_tooltip=Cut
-Editor_Cut_image=
-Editor_Cut_description=Cut
-
-Editor_Copy_label=&Copy@Ctrl+C
-Editor_Copy_tooltip=Copy
-Editor_Copy_image=
-Editor_Copy_description=Copy
-
-Editor_Paste_label=&Paste@Ctrl+V
-Editor_Paste_tooltip=Paste
-Editor_Paste_image=
-Editor_Paste_description=Paste
-
-Editor_Delete_label=&Delete@Delete
-Editor_Delete_tooltip=Delete
-Editor_Delete_image=
-Editor_Delete_description=Delete
-
-ContentAssistProposals_label=Con&tent Assist
-ContentAssistProposals_tooltip=Content Assist
-ContentAssistProposals_description=Content Assist
-
-QuickFix_label=&Quick Fix
-QuickFix_tooltip=Quick Fix
-QuickFix_image=
-QuickFix_description=Quick Fix
-
-ToggleComment_label=Togg&le Comment
-ToggleComment_tooltip=Toggle Comment
-ToggleComment_image=
-ToggleComment_description=Toggle Comment
-AddBlockComment_label=Add &Block Comment
-AddBlockComment_tooltip=Add Block Comment
-AddBlockComment_image=
-AddBlockComment_description=Add Block Comment
-RemoveBlockComment_label=Remove Bloc&k Comment
-RemoveBlockComment_tooltip=Remove Block Comment
-RemoveBlockComment_image=
-RemoveBlockComment_description=Remove Block Comment
-CleanupDocument_label=C&leanup Document...
-CleanupDocument_tooltip=Cleanup Document
-CleanupDocument_image=
-CleanupDocument_description=Cleanup Document
-FormatDocument_label=&Document
-FormatDocument_tooltip=Format Document
-FormatDocument_image=
-FormatDocument_description=Format Document
-FormatActiveElements_label=Act&ive Elements
-FormatActiveElements_tooltip=Format Active Elements
-FormatActiveElements_image=
-FormatActiveElements_description=Format Active Elements
-OpenFileFromSource_label=Op&en Selection
-OpenFileFromSource_tooltip=Open an editor on the selected link
-OpenFileFromSource_image=
-OpenFileFromSource_description=Open an editor on the selected link
-ShowTooltipDesc_label=Show &Tooltip Description
-ShowTooltipDesc_tooltip=Displays the hover help for the selected element
-ShowTooltipDesc_image=
-ShowTooltipDesc_description=Displays the hover help for the selected element
-StructureSelectEnclosing_label=&Enclosing Element
-StructureSelectEnclosing_tooltip=Expand selection to include enclosing element
-StructureSelectEnclosing_description=Expand selection to include enclosing element
-StructureSelectNext_label=&Next Element
-StructureSelectNext_tooltip=Expand selection to include next sibling
-StructureSelectNext_description=Expand selection to include next sibling
-StructureSelectPrevious_label=&Previous Element
-StructureSelectPrevious_tooltip=Expand selection to include previous sibling
-StructureSelectPrevious_description=Expand selection to include previous sibling
-StructureSelectHistory_label=&Restore Last Selection
-StructureSelectHistory_tooltip=Restore last selection
-StructureSelectHistory_description=Restore last selection
-Text_Shift_Right_UI_=Text Shift Right
-Text_Shift_Left_UI_=Text Shift Left
-
-_4concat=''{0}'' is not a valid input
-## The following strings are for "XML->XML Source->XML Style" Preferences, "Web Tools->Source->HTML Style" Preferences, and "Web Tools->Source->JavaScript Style" Preferences
-Content_type__UI_=Co&ntent type:
-Foreground_UI_=&Foreground:
-Background_UI_=&Background:
-Bold_UI_=B&old
-Italics_UI=Italics
-Restore_Default_UI_=&Restore Default
-Sample_text__UI_=&Sample text:
-##
-AddBreakpoint_label=Add &Breakpoint
-AddBreakpoint_tooltip=Add Breakpoint
-AddBreakpoint_description=Add Breakpoint
-AddBreakpoint_error_dialog_title=Add Breakpoint
-AddBreakpoint_error_dialog_message=Cannot add breakpoint
-##
-ToggleBreakpoint_label=Toggle Breakpoint
-ToggleBreakpoint_tooltip=Toggle Breakpoint
-ToggleBreakpoint_description=Toggle Breakpoint
-##
-EnableBreakpoint_label=Enable Breakpoint
-EnableBreakpoint_tooltip=Enable Breakpoint
-EnableBreakpoint_description=Enable Breakpoint
-##
-DisableBreakpoint_label=Disable Breakpoint
-DisableBreakpoint_tooltip=Disable Breakpoint
-DisableBreakpoint_description=Disable Breakpoint
-##
-ManageBreakpoints_add_label=Add &Breakpoint
-ManageBreakpoints_remove_label=Remove Breakpoint
-ManageBreakpoints_tooltip=Add/Remove Breakpoint
-ManageBreakpoints_error_adding_title1=Add Breakpoint
-ManageBreakpoints_error_adding_message1=Cannot add breakpoint
-
-AbstractColorPageDescription=Customize the syntax highlighting by selecting the type of text whose style you want to customize from either the combo box or the sample text area
-##
-EditorModelUtil_0=model in invalid state
-EditorModelUtil_1=There was a problem adding adapter factories
-
-# web content settings
-UI_Default_HTML_DOCTYPE_ID___1=&Document type:
-UI_CSS_profile___2=&CSS profile:
-UI_Target_Device___3=&Target device:
-
-Editor_ToggleInsertMode_label=Sma&rt Insert Mode
-
-##########################################################################
-# These strings are used in Workbench menu bar
-##########################################################################
-ExpandSelectionToMenu_label=E&xpand Selection To
-SourceMenu_label=&Source
-#
-FindOccurrencesActionProvider_0=Current selection does not resolve to a searchable element
-RemoveAction_0=Remove Property
-ShowPropertiesAction_0=P&roperties
-ContentOutlineConfiguration_0=Collapse All
-ContentOutlineConfiguration_1=Link with Editor
-AbstractOpenOn_0=Current text selection does not resolve to a file
-FormatActionDelegate_jobName=Formatting documents
-FormatActionDelegate_errorStatusMessage=Exceptions occurred while formatting documents
-FormatActionDelegate_3=Formatting {0}
-FormatActionDelegate_4=Exception occurred while formatting document {0}
-FormatActionDelegate_5=MalformedInputException occurred while formatting document {0}
-TranslucencyPreferenceTab_0=Read-Only text style
-TranslucencyPreferenceTab_1=Read-Only contrast percentage:
-StructuredTextEditorPreferencePage_2=Matching brackets highlight
-StructuredTextEditorPreferencePage_6=The following preferences apply to the HTML, JSP, XML, and other source editors.
-StructuredTextEditorPreferencePage_20=Highlight &matching brackets
-StructuredTextEditorPreferencePage_23=Appearance co&lor options:
-StructuredTextEditorPreferencePage_24=C&olor:
-StructuredTextEditorPreferencePage_30=&Report problems as you type
-StructuredTextEditorPreferencePage_37=Empty input
-StructuredTextEditorPreferencePage_38=is not a valid input.
-StructuredTextEditorPreferencePage_39=Inform when unsupported content type is in editor
-TaskTagPreferenceTab_0=Low
-TaskTagPreferenceTab_1=Normal
-TaskTagPreferenceTab_2=High
-TaskTagPreferenceTab_3=N/A
-TaskTagPreferenceTab_5=Task Tag
-TaskTagPreferenceTab_6=Tag:
-TaskTagPreferenceTab_7=Priority:
-TaskTagPreferenceTab_12=Tag
-TaskTagPreferenceTab_13=Priority
-TaskTagPreferenceTab_14=New...
-TaskTagPreferenceTab_15=Edit...
-TaskTagPreferenceTab_16=Remove
-TaskTagPreferenceTab_17=Select All
-TaskTagPreferenceTab_18=Deselect All
-TaskTagPreferenceTab_19=Note: tags are case insensitive
-TaskTagPreferenceTab_20=Task Tags
-TaskTagPreferenceTab_22=Task Tags Settings Changed
-TaskTagPreferenceTab_23=The task tags settings have changed.  Make these changes effective now?
-TaskTagPreferenceTab_24=Yes
-TaskTagPreferenceTab_25=No
-TaskTagPreferenceTab_26=Cancel
-TaskTagPreferenceTab_27=Scanning files for tasks
-TaskTagPreferenceTab_28=detection aborted
-TaskTagPreferenceTab_29=detection completed
-TaskTagPreferenceTab_30=detection encountered errors
-TaskTagPreferenceTab_31=Enable searching for Task Tags
-TaskTagPreferencePage_32=Clean and redetect Tasks
-TaskTagPreferenceTab_33=Tags in comments indicating Tasks:
-TaskTagExclusionTab_01=Filters
-TaskTagExclusionTab_02=Scan the selected Content Types:
-TaskTagExclusionTab_03=Affected Content Types:
-
-PropertyPreferencePage_01=Project Specific Configuration
-PropertyPreferencePage_02=Select the project to configure:
-
-FilePreferencePage_0=Expand the tree to edit preferences for a specific content type.
-NoModificationCompletionProposal_0=No corrections available
-ToggleBreakpointAction_0=Toggle &Breakpoints
-ManageBreakpointAction_0=&Enable Breakpoints
-ManageBreakpointAction_1=&Disable Breakpoints
-EditBreakpointAction_0=Breakpoint &Properties...
-## Used in Structured Text Editor Preference Page / Hovers Tab
-TextHoverPreferenceTab_title=Hovers
-TextHoverPreferenceTab_hoverPreferences=Text &Hover key modifier preferences:
-TextHoverPreferenceTab_keyModifier=Pressed key &modifier while hovering:
-TextHoverPreferenceTab_description=Description:
-TextHoverPreferenceTab_modifierIsNotValid=Modifier ''{0}'' is not valid.
-TextHoverPreferenceTab_modifierIsNotValidForHover=Modifier ''{0}'' for ''{1}'' hover is not valid.
-TextHoverPreferenceTab_duplicateModifier=''{0}'' hover uses the same modifier as ''{1}'' hover.
-TextHoverPreferenceTab_nameColumnTitle=Text Hover Name
-TextHoverPreferenceTab_modifierColumnTitle=Pressed Key Modifier While Hovering
-TextHoverPreferenceTab_delimiter=+
-TextHoverPreferenceTab_insertDelimiterAndModifierAndDelimiter=\ + {0} +
-TextHoverPreferenceTab_insertModifierAndDelimiter=\ {0} +
-TextHoverPreferenceTab_insertDelimiterAndModifier=\ + {0}
-combinationHover_label=Combined Hover
-combinationHover_desc=Tries the hovers in the sequence listed in the table below this one and uses the one which fits best for the selected element and the current context.
-problemHover_label=Problem Description
-problemHover_desc=Shows the description of the selected problem.
-documentationHover_label=Documentation Description
-documentationHover_desc=Shows the documentation of the selected element.
-annotationHover_label=Annotation Description
-annotationHover_desc=Shows the description of the selected annotation.
-EditStructuredTextEditorPreferencesAction_0=Editor Preferences
-StructuredTextEditorPreferencePage_0=Appearance
-PreferenceManager_0=Original Error:
-
-OccurrencesSearchQuery_0={0} - {1} Occurrences in {2}
-OccurrencesSearchQuery_2=file
-ShowView_errorTitle=Problems Showing View
-proc_dirty_regions_0 = Processing Dirty Regions
-## Encoding
-EncodingPreferencePage_0=Encoding settings for Web and XML files:
-EncodingPreferencePage_1=Use 3 byte BOM (Byte Order Mark) when saving UTF-8 encoded files
-busy=busy
-caret_update=caret update
-EmptyFilePreferencePage_0=Expand the tree to edit preferences for a specific content type.
-OffsetStatusLineContributionItem_0=Selection Information:
-OffsetStatusLineContributionItem_2=Partitions
-OffsetStatusLineContributionItem_3=ITextRegions
-OffsetStatusLineContributionItem_4=Structured Model Content-Type: 
-OffsetStatusLineContributionItem_5=Model Handler: 
-OffsetStatusLineContributionItem_6=Document Class: 
-OffsetStatusLineContributionItem_7=Document Provider Class: 
-OffsetStatusLineContributionItem_8=Partitionings:
-OffsetStatusLineContributionItem_9=Start
-OffsetStatusLineContributionItem_10=Length
-OffsetStatusLineContributionItem_11=Type
-OffsetStatusLineContributionItem_12=Input Type: 
-OffsetStatusLineContributionItem_13=Partitioner: 
-OffsetStatusLineContributionItem_15=Start
-OffsetStatusLineContributionItem_16=Length
-OffsetStatusLineContributionItem_17=Text Length
-OffsetStatusLineContributionItem_18=Context
-
-StructuredTextEditor_0=Unsupported content type warning
-UnknownContentTypeDialog_0=Unsupported Content Type
-UnknownContentTypeDialog_1=Do not show this message again
-UnknownContentTypeDialog_2=Unsupported content type in editor.\nTo associate file extension with a supported content type,\nplease see <a>Content Types Preference Page</a>
-
-################################################################################
-## Below are possibly unused strings that may be removed
-################################################################################
-Save_label=&Save
-An_error_has_occurred_when_ERROR_=An error has occurred when retrieving resources for the source editor. The Eclipse Workbench installation may have been corrupted.
-## save as problems (next two) should match what is in workbench
-Problems_During_Save_As_UI_=Problems During Save As...
-Save_could_not_be_complete_UI_=Save could not be completed.
-ManageBreakpoints_error_removing_title1=Remove Breakpoint
-ManageBreakpoints_error_removing_message1=Cannot remove breakpoint
-ManageBreakpoints_error_retrieving_message=Retrieving markers failed:
-JSPSourcePreferencePageDescription=Embedded content type\'s source preferences will be used. Select the file type for customization
-# The following lines copied from org\eclipse\ui\editors\text\TextEditorMessages.properties in org.eclipse.ui plugin
-Editor_error_save_message=Save could not be completed. {0}
-Editor_error_save_title=Problems During Save As...
-Editor_warning_save_delete=The original file ''{0}'' has been deleted.
-
-# actions
-Previous_annotation=Previous Annotation
-Next_annotation=Next Annotation
-# Annotation Types
-AnnotationTypes_Errors=Errors
-AnnotationTypes_Warnings=Warnings
-AnnotationTypes_Tasks=Tasks
-AnnotationTypes_SearchResults=Search Results
-AnnotationTypes_Bookmarks=Bookmarks
-AnnotationTypes_Others=Others
-
-Editor_ConvertToWindows_label=&Windows
-Editor_ConvertToWindows_tooltip=Converts line delimiters to Windows
-Editor_ConvertToWindows_image=
-Editor_ConvertToWindows_description=Converts line delimiters to Windows
-
-Editor_ConvertToUNIX_label=&UNIX
-Editor_ConvertToUNIX_tooltip=Converts line delimiters to UNIX
-Editor_ConvertToUNIX_image=
-Editor_ConvertToUNIX_description=Converts line delimiters to UNIX
-
-Editor_ConvertToMac_label=&Mac
-Editor_ConvertToMac_tooltip=Converts line delimiters to Mac
-Editor_ConvertToMac_image=
-Editor_ConvertToMac_description=Converts line delimiters to Mac
-ConvertLineDelimitersMenu_label=Co&nvert Line Delimiters to
-FindOccurrences_label=O&ccurrences in File
-
-ConvertLineDelimitersToCRLFActionDelegate_jobName=Converting line delimiters
-ConvertLineDelimitersToCRLFActionDelegate_errorStatusMessage=Exceptions occurred while converting line delimiters
-ConvertLineDelimitersToCRLFActionDelegate_3=Converting line delimiters for {0}
-ConvertLineDelimitersToCRLFActionDelegate_4=Exception occurred while converting line delimiters for document {0}
-TextHoverPreferenceTab_annotationRollover=&Enable annotation roll-over (on new editors)
-TextHoverPreferenceTab_showAffordance=&Show affordance in hover on how to make it sticky
-TextHoverPreferenceTab_enabled=&Enabled
-
-BasicFindOccurrencesAction_0=region match:
-BasicSearchLabelProvider_0=line
-NavigationPreferenceTab_0=Modifier ''{0}'' is not valid.
-OccurrencesSearchQuery_1={0} - 1 Occurrence in {1}
-FileModelProvider_0=Error reloading {0}
-JFaceNodeAdapter_0=Update Outline
-
-ConfigureProjectSettings=Configure Project Specific Settings...
-ConfigureWorkspaceSettings=Configure Workspace Settings...
-EnableProjectSettings=Enable project specific settings
-
-LoadingReferencedGrammars=Loading referenced grammars
-
-## Folding
-Folding=Folding
-StructuredTextEditorPreferencePage_3=Enable &folding
-Projection_Toggle_label= &Enable Folding
-Projection_Toggle_tooltip= Toggles Folding
-Projection_Toggle_description= Toggles folding for the current editor
-Projection_Toggle_image=
-Projection_ExpandAll_label= Expand &All
-Projection_ExpandAll_tooltip= Expands All Collapsed Regions
-Projection_ExpandAll_description= Expands any collapsed regions in the current editor
-Projection_ExpandAll_image=
-
-## These are copied from org.eclipse.ui.texteditor.EditorMessages.properties
-## They are needed temporarily until CMVC defect 203158 / Bugzilla defect 20054 is fixed
-Editor_ManageBookmarks_tooltip=Adds and Removes Bookmarks
-Editor_ManageBookmarks_image=
-Editor_ManageBookmarks_description=Adds and removes Bookmarks
-Editor_ManageBookmarks_add_label=Add Boo&kmark...
-Editor_ManageBookmarks_remove_label=Remove Boo&kmark
-Editor_ManageBookmarks_add_dialog_title=Add Bookmark
-Editor_ManageBookmarks_add_dialog_message=Enter Bookmark name
-Editor_ManageBookmarks_error_dialog_title=Managing Bookmarks
-Editor_ManageBookmarks_error_dialog_message=Problems managing bookmarks
-
-Editor_ManageTasks_tooltip=Adds and Removes Tasks
-Editor_ManageTasks_image=
-Editor_ManageTasks_description=Adds and removes Tasks
-Editor_ManageTasks_add_label=Add &Task...
-Editor_ManageTasks_remove_label=Remove &Task
-Editor_ManageTasks_add_dialog_title=Add Task
-Editor_ManageTasks_add_dialog_message=Enter Task description
-Editor_ManageTasks_error_dialog_title=Managing Tasks
-Editor_ManageTasks_error_dialog_message=Problems managing tasks
-################################################################################
-## Above are possibly unused strings that may be removed
-###############################################################################
-StyledTextColorPicker_0=Pick a color
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ShowViewAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ShowViewAction.java
deleted file mode 100644
index 6e43f03..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ShowViewAction.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.sse.ui.internal;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-
-/**
- * Surfaces a View.
- * 
- * @author Nitin Dahyabhai
- */
-public abstract class ShowViewAction extends Action {
-	/**
-	 *  
-	 */
-	public ShowViewAction() {
-		super();
-	}
-
-	/**
-	 * @param text
-	 */
-	public ShowViewAction(String text) {
-		super(text);
-	}
-
-	/**
-	 * @param text
-	 * @param image
-	 */
-	public ShowViewAction(String text, ImageDescriptor image) {
-		super(text, image);
-	}
-
-	/**
-	 * @param text
-	 * @param style
-	 */
-	public ShowViewAction(String text, int style) {
-		super(text, style);
-	}
-
-	/**
-	 * @return
-	 */
-	protected abstract String getViewID();
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.action.Action#run()
-	 */
-	public void run() {
-		super.run();
-		showView();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
-	 */
-	public void runWithEvent(Event event) {
-		super.runWithEvent(event);
-		showView();
-	}
-
-	/**
-	 *  
-	 */
-	private void showView() {
-		IWorkbenchWindow window = SSEUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
-		IWorkbenchPage page = window.getActivePage();
-		if (page != null) {
-			try {
-				page.showView(getViewID());
-			} catch (PartInitException e) {
-				ErrorDialog.openError(window.getShell(), SSEUIMessages.ShowView_errorTitle, //$NON-NLS-1$
-							e.getMessage(), e.getStatus());
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java
deleted file mode 100644
index fa76b6b..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java
+++ /dev/null
@@ -1,681 +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.sse.ui.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IStorage;
-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.jface.text.IDocument;
-import org.eclipse.jface.text.source.AnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.editors.text.FileDocumentProvider;
-import org.eclipse.ui.editors.text.StorageDocumentProvider;
-import org.eclipse.ui.texteditor.IElementStateListener;
-import org.eclipse.wst.sse.core.internal.encoding.CodedReaderCreator;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.sse.ui.internal.debug.BreakpointRulerAction;
-import org.eclipse.wst.sse.ui.internal.editor.EditorModelUtil;
-import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IExtendedStorageEditorInput;
-
-/**
- * A StorageDocumentProvider that is IStructuredModel aware
- */
-public class StorageModelProvider extends StorageDocumentProvider implements IModelProvider {
-
-	private class InternalElementStateListener implements IElementStateListener {
-		public void elementContentAboutToBeReplaced(Object element) {
-			if (debugElementStatelistener) {
-				System.out.println("StorageModelProvider: elementContentAboutToBeReplaced: " + ((IEditorInput) element).getName()); //$NON-NLS-1$
-			}
-			// we just forward the event
-			StorageModelProvider.this.fireElementContentAboutToBeReplaced(element);
-		}
-
-		public void elementContentReplaced(Object element) {
-			if (debugElementStatelistener) {
-				System.out.println("StorageModelProvider: elementContentReplaced: " + ((IEditorInput) element).getName()); //$NON-NLS-1$
-			}
-
-			StorageInfo info = (StorageInfo) getElementInfo(element);
-
-			/**
-			 * Force a reload of the markers into annotations since their
-			 * previous Positions have been deleted. Disconnecting and
-			 * reconnecting forces a call to the private catchupWithMarkers
-			 * method.
-			 */
-			if (info != null && info.fModel != null) {
-				info.fModel.disconnect(info.fDocument);
-			}
-
-			Reader reader = null;
-			IStructuredDocument innerdocument = null;
-			try {
-				// update document from input's contents
-				CodedReaderCreator codedReaderCreator = new CodedReaderCreator(calculateID((IStorageEditorInput) element), Utilities.getMarkSupportedStream(((IStorageEditorInput) element).getStorage().getContents()));
-				reader = codedReaderCreator.getCodedReader();
-
-				innerdocument = (IStructuredDocument) info.fDocument;
-
-				int originalLengthToReplace = innerdocument.getLength();
-
-				StringBuffer stringBuffer = new StringBuffer();
-				int bufferSize = 2048;
-				char[] buffer = new char[bufferSize];
-				int nRead = 0;
-				boolean eof = false;
-				while (!eof) {
-					nRead = reader.read(buffer, 0, bufferSize);
-					if (nRead == -1) {
-						eof = true;
-					}
-					else {
-						stringBuffer.append(buffer, 0, nRead);
-					}
-				}
-				innerdocument.replaceText(this, 0, originalLengthToReplace, stringBuffer.toString(), true);
-			}
-			catch (CoreException e) {
-				Logger.logException(e);
-			}
-			catch (IOException e) {
-				Logger.logException(e);
-			}
-			finally {
-				if (reader != null) {
-					try {
-						reader.close();
-					}
-					catch (IOException e1) {
-						// would be highly unusual
-						Logger.logException(e1);
-					}
-				}
-			}
-
-			// forward the event
-			if (info.fCanBeSaved) {
-				info.fCanBeSaved = false;
-				addUnchangedElementListeners(element, info);
-			}
-			fireElementContentReplaced(element);
-			fireElementDirtyStateChanged(element, false);
-
-			if (info != null && info.fModel != null) {
-				info.fModel.connect(info.fDocument);
-			}
-		}
-
-		public void elementDeleted(Object element) {
-			if (debugElementStatelistener) {
-				System.out.println("StorageModelProvider: elementDeleted: " + ((IEditorInput) element).getName()); //$NON-NLS-1$
-			}
-			// we just forward the event
-			StorageModelProvider.this.fireElementDeleted(element);
-		}
-
-		public void elementDirtyStateChanged(Object element, boolean isDirty) {
-			if (debugElementStatelistener) {
-				System.out.println("StorageModelProvider: elementDirtyStateChanged: " + ((IEditorInput) element).getName() + " (" + isDirty + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			}
-			// we just forward the event
-			StorageModelProvider.this.fireElementDirtyStateChanged(element, isDirty);
-		}
-
-		public void elementMoved(Object originalElement, Object movedElement) {
-			if (debugElementStatelistener) {
-				System.out.println("StorageModelProvider: elementMoved " + originalElement + " --> " + movedElement); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			// we just forward the event
-			StorageModelProvider.this.fireElementMoved(originalElement, movedElement);
-		}
-	}
-
-	/**
-	 * Collection of info that goes with a model.
-	 */
-	private class ModelInfo {
-		public IEditorInput fElement;
-		public boolean fShouldReleaseOnInfoDispose;
-		public IStructuredModel fStructuredModel;
-
-		public ModelInfo(IStructuredModel structuredModel, IEditorInput element, boolean selfCreated) {
-			fElement = element;
-			fStructuredModel = structuredModel;
-			fShouldReleaseOnInfoDispose = selfCreated;
-		}
-	}
-
-	static final boolean debugElementStatelistener = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/storagemodelprovider/elementstatelistener")); //$NON-NLS-1$ //$NON-NLS-2$
-	static final boolean debugOperations = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/storagemodelprovider/operations")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private static StorageModelProvider fInstance = null;
-
-	public synchronized static StorageModelProvider getInstance() {
-		if (fInstance == null)
-			fInstance = new StorageModelProvider();
-		return fInstance;
-	}
-
-	private IElementStateListener fInternalListener;
-	/** IStructuredModel information of all connected elements */
-	private Map fModelInfoMap = new HashMap();
-	private boolean fReuseModelDocument = true;
-
-	private StorageModelProvider() {
-		super();
-		fInternalListener = new InternalElementStateListener();
-	}
-
-	String calculateBaseLocation(IStorageEditorInput input) {
-		String location = null;
-		try {
-			IStorage storage = input.getStorage();
-			if (storage != null) {
-				IPath storagePath = storage.getFullPath();
-				String name = storage.getName();
-				if (storagePath != null) {
-					// If they are different, the IStorage contract is not
-					// being honored
-					// (https://bugs.eclipse.org/bugs/show_bug.cgi?id=73098).
-					// Favor the name.
-					if (!storagePath.lastSegment().equals(name)) {
-						IPath workingPath = storagePath.addTrailingSeparator();
-						location = workingPath.append(name).toString();
-					}
-					else {
-						location = storagePath.makeAbsolute().toString();
-					}
-				}
-				if (location == null)
-					location = name;
-			}
-		}
-		catch (CoreException e) {
-			Logger.logException(e);
-		}
-		finally {
-			if (location == null)
-				location = input.getName();
-		}
-		return location;
-	}
-
-	String calculateID(IStorageEditorInput input) {
-		/**
-		 * Typically CVS will return a path of "filename.ext" and the input's
-		 * name will be "filename.ext version". The path must be used to load
-		 * the model so that the suffix will be available to compute the
-		 * contentType properly. The editor input name can then be set as the
-		 * base location for display on the editor title bar.
-		 * 
-		 */
-		String path = null;
-		boolean addHash = false;
-		try {
-			IStorage storage = input.getStorage();
-			if (storage != null) {
-				IPath storagePath = storage.getFullPath();
-				String name = storage.getName();
-				// if either the name or storage path are null or they are
-				// identical, add a hash to it to guarantee uniqueness
-				addHash = storagePath == null || storagePath.toString().equals(name);
-				if (storagePath != null) {
-					// If they are different, the IStorage contract is not
-					// being honored
-					// (https://bugs.eclipse.org/bugs/show_bug.cgi?id=73098).
-					// Favor the name.
-					if (!storagePath.lastSegment().equals(name)) {
-						IPath workingPath = storagePath.addTrailingSeparator();
-						path = workingPath.append(name).toString();
-					}
-					else {
-						path = storagePath.makeAbsolute().toString();
-					}
-				}
-				if (path == null)
-					path = name;
-			}
-		}
-		catch (CoreException e) {
-			Logger.logException(e);
-		}
-		finally {
-			if (path == null)
-				path = ""; //$NON-NLS-1$
-		}
-		if (addHash)
-			path = input.hashCode() + path;
-		return path;
-	}
-
-	// public boolean canSaveDocument(Object element) {
-	// return false;
-	// }
-
-	protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
-		IAnnotationModel model = null;
-		if (debugOperations) {
-			if (element instanceof IStorageEditorInput)
-				System.out.println("StorageModelProvider: createAnnotationModel for " + ((IStorageEditorInput) element).getStorage().getFullPath()); //$NON-NLS-1$
-			else
-				System.out.println("StorageModelProvider: createAnnotationModel for " + element); //$NON-NLS-1$
-		}
-		if (element instanceof IStorageEditorInput) {
-			IStorageEditorInput input = (IStorageEditorInput) element;
-			String contentType = (getModel(input) != null ? getModel(input).getContentTypeIdentifier() : null);
-			String ext = BreakpointRulerAction.getFileExtension((IEditorInput) element);
-			IResource res = BreakpointProviderBuilder.getInstance().getResource(input, contentType, ext);
-			String id = input.getName();
-			if (input.getStorage() != null && input.getStorage().getFullPath() != null) {
-				id = input.getStorage().getFullPath().toString();
-			}
-			// we can only create a resource marker annotationmodel off of a
-			// valid resource
-			if (res != null)
-				model = new StructuredResourceMarkerAnnotationModel(res, id);
-			else
-				model = new AnnotationModel();
-		}
-		if (model == null) {
-			model = super.createAnnotationModel(element);
-		}
-		return model;
-	}
-
-	protected IDocument createDocument(Object element) {
-		if (debugOperations) {
-			if (element instanceof IStorageEditorInput)
-				try {
-					System.out.println("StorageModelProvider: createDocument for " + ((IStorageEditorInput) element).getStorage().getFullPath()); //$NON-NLS-1$
-				}
-				catch (CoreException e) {
-					System.out.println("StorageModelProvider: createDocument for " + element + "(exception caught)"); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-			else {
-				System.out.println("StorageModelProvider: createDocument for " + element); //$NON-NLS-1$
-			}
-		}
-
-		// The following is largely copied from FileModelProvider
-
-		IDocument document = null;
-		if (element instanceof IEditorInput) {
-			// create a new IDocument for the element; should always reflect
-			// the contents of the resource
-			ModelInfo info = getModelInfoFor((IEditorInput) element);
-			if (info == null) {
-				throw new IllegalArgumentException("no corresponding model info found"); //$NON-NLS-1$
-			}
-			IStructuredModel model = info.fStructuredModel;
-			if (model != null) {
-				if (!fReuseModelDocument && element instanceof IStorageEditorInput) {
-					Reader reader = null;
-					IStructuredDocument innerdocument = null;
-					try {
-						// update document from input's contents
-
-						CodedReaderCreator codedReaderCreator = new CodedReaderCreator(calculateID((IStorageEditorInput) element), Utilities.getMarkSupportedStream(((IStorageEditorInput) element).getStorage().getContents()));
-						reader = codedReaderCreator.getCodedReader();
-
-						innerdocument = model.getStructuredDocument();
-
-						int originalLengthToReplace = innerdocument.getLength();
-
-						/*
-						 * TODO_future: we could implement with sequential
-						 * rewrite, if we don't pickup automatically from
-						 * FileBuffer support, so not so much has to be pulled
-						 * into memory (as an extra big string), but we need
-						 * to carry that API through so that StructuredModel
-						 * is not notified until done.
-						 */
-
-						// innerdocument.startSequentialRewrite(true);
-						// innerdocument.replaceText(this, 0,
-						// innerdocument.getLength(), "");
-						StringBuffer stringBuffer = new StringBuffer();
-						int bufferSize = 2048;
-						char[] buffer = new char[bufferSize];
-						int nRead = 0;
-						boolean eof = false;
-						while (!eof) {
-							nRead = reader.read(buffer, 0, bufferSize);
-							if (nRead == -1) {
-								eof = true;
-							}
-							else {
-								stringBuffer.append(buffer, 0, nRead);
-								// innerdocument.replaceText(this,
-								// innerdocument.getLength(), 0, new
-								// String(buffer, 0, nRead));
-							}
-						}
-						// ignore read-only settings if reverting whole
-						// document
-						innerdocument.replaceText(this, 0, originalLengthToReplace, stringBuffer.toString(), true);
-						model.setDirtyState(false);
-
-					}
-					catch (CoreException e) {
-						Logger.logException(e);
-					}
-					catch (IOException e) {
-						Logger.logException(e);
-					}
-					finally {
-						if (reader != null) {
-							try {
-								reader.close();
-							}
-							catch (IOException e1) {
-								// would be highly unusual
-								Logger.logException(e1);
-							}
-						}
-						// if (innerdocument != null) {
-						// innerdocument.stopSequentialRewrite();
-						// }
-					}
-
-				}
-				if (document == null) {
-					document = model.getStructuredDocument();
-				}
-			}
-		}
-		return document;
-	}
-
-	/**
-	 * Also create ModelInfo - extra resource synchronization classes should
-	 * be stored within the ModelInfo
-	 */
-	protected ElementInfo createElementInfo(Object element) throws CoreException {
-		// create the corresponding ModelInfo if necessary
-		if (debugOperations) {
-			if (element instanceof IStorageEditorInput)
-				try {
-					System.out.println("StorageModelProvider: createElementInfo for " + ((IStorageEditorInput) element).getStorage().getFullPath()); //$NON-NLS-1$
-				}
-				catch (CoreException e) {
-					System.out.println("StorageModelProvider: createElementInfo for " + element + "(exception caught)"); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-			else
-				System.out.println("storageModelProvider: createElementInfo for " + element); //$NON-NLS-1$
-		}
-
-		if (getModelInfoFor((IEditorInput) element) == null) {
-			createModelInfo((IEditorInput) element);
-		}
-
-		ElementInfo info = super.createElementInfo(element);
-		return info;
-	}
-
-	public void createModelInfo(IEditorInput input) {
-		if (getModelInfoFor(input) == null) {
-			IStructuredModel structuredModel = selfCreateModel(input);
-			if (structuredModel != null) {
-				createModelInfo(input, structuredModel, true);
-			}
-		}
-	}
-
-	/**
-	 * To be used when model is provided to us, ensures that when setInput is
-	 * used on this input, the given model will be used.
-	 */
-	public void createModelInfo(IEditorInput input, IStructuredModel structuredModel, boolean releaseModelOnDisconnect) {
-		// we have to make sure factories are added, whether we created or
-		// not.
-		if (getModelInfoFor(input) != null || getModelInfoFor(structuredModel) != null) {
-			if (debugOperations) {
-				if (input instanceof IStorageEditorInput) {
-
-					try {
-						System.out.println("StorageModelProvider: DUPLICATE createModelInfo for " + ((IStorageEditorInput) input).getStorage().getFullPath()); //$NON-NLS-1$
-					}
-					catch (CoreException e) {
-						System.out.println("StorageModelProvider: DUPLICATE createModelInfo for " + input + "(exception caught)"); //$NON-NLS-1$ //$NON-NLS-2$
-					}
-				}
-				else {
-					System.out.println("storageModelProvider: DUPLICATE createModelInfo for " + input); //$NON-NLS-1$
-				}
-			}
-			return;
-		}
-
-		if (debugOperations) {
-			if (input instanceof IStorageEditorInput) {
-				try {
-					System.out.println("StorageModelProvider: createModelInfo for " + ((IStorageEditorInput) input).getStorage().getFullPath()); //$NON-NLS-1$
-				}
-				catch (CoreException e) {
-					System.out.println("StorageModelProvider: createModelInfo for " + input + "(exception caught)"); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-			}
-			else {
-				System.out.println("StorageModelProvider: createModelInfo for " + input); //$NON-NLS-1$
-			}
-		}
-
-
-		if (input instanceof IExtendedStorageEditorInput) {
-			((IExtendedStorageEditorInput) input).addElementStateListener(fInternalListener);
-		}
-
-		EditorModelUtil.addFactoriesTo(structuredModel);
-
-		ModelInfo modelInfo = new ModelInfo(structuredModel, input, releaseModelOnDisconnect);
-		fModelInfoMap.put(input, modelInfo);
-	}
-
-	protected void disposeElementInfo(Object element, ElementInfo info) {
-		if (debugOperations) {
-			if (element instanceof IStorageEditorInput) {
-				try {
-					System.out.println("StorageModelProvider: disposeElementInfo for " + ((IStorageEditorInput) element).getStorage().getFullPath()); //$NON-NLS-1$
-				}
-				catch (CoreException e) {
-					System.out.println("StorageModelProvider: disposeElementInfo for " + element + "(exception caught)"); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-			}
-			else {
-				System.out.println("StorageModelProvider: disposeElementInfo for " + element); //$NON-NLS-1$
-			}
-		}
-
-		if (element instanceof IEditorInput) {
-			IEditorInput input = (IEditorInput) element;
-			ModelInfo modelInfo = getModelInfoFor(input);
-			disposeModelInfo(modelInfo);
-		}
-		super.disposeElementInfo(element, info);
-	}
-
-	/**
-	 * disconnect from this model info
-	 * 
-	 * @param info
-	 */
-	public void disposeModelInfo(ModelInfo info) {
-		if (debugOperations) {
-			if (info.fElement instanceof IStorageEditorInput) {
-				try {
-					System.out.println("StorageModelProvider: disposeModelInfo for " + ((IStorageEditorInput) info.fElement).getStorage().getFullPath()); //$NON-NLS-1$
-				}
-				catch (CoreException e) {
-					System.out.println("StorageModelProvider: disposeModelInfo for " + info.fElement + "(exception caught)"); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-			}
-			else {
-				System.out.println("StorageModelProvider: disposeModelInfo for " + info.fElement); //$NON-NLS-1$
-			}
-		}
-
-		if (info.fElement instanceof IStorageEditorInput) {
-			if (info.fElement instanceof IExtendedStorageEditorInput) {
-				((IExtendedStorageEditorInput) info.fElement).removeElementStateListener(fInternalListener);
-			}
-			if (info.fShouldReleaseOnInfoDispose) {
-				info.fStructuredModel.releaseFromEdit();
-			}
-		}
-		fModelInfoMap.remove(info.fElement);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#doResetDocument(java.lang.Object,
-	 *      org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	protected void doResetDocument(Object element, IProgressMonitor monitor) throws CoreException {
-		fReuseModelDocument = false;
-		super.doResetDocument(element, monitor);
-		fReuseModelDocument = true;
-	}
-
-	/**
-	 * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#doSaveDocument(org.eclipse.core.runtime.IProgressMonitor,
-	 *      java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
-	 */
-	protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
-		new FileDocumentProvider().saveDocument(monitor, element, document, overwrite);
-	}
-
-	public IStructuredModel getModel(IEditorInput element) {
-		IStructuredModel result = null;
-		ModelInfo info = getModelInfoFor(element);
-		if (info != null) {
-			result = info.fStructuredModel;
-		}
-		return result;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.IModelProvider#getModel(java.lang.Object)
-	 */
-	public IStructuredModel getModel(Object element) {
-		if (element instanceof IEditorInput)
-			return getModel((IEditorInput) element);
-		return null;
-	}
-
-	private ModelInfo getModelInfoFor(IEditorInput element) {
-		ModelInfo result = (ModelInfo) fModelInfoMap.get(element);
-		return result;
-	}
-
-	private ModelInfo getModelInfoFor(IStructuredModel structuredModel) {
-		ModelInfo result = null;
-		if (structuredModel != null) {
-			ModelInfo[] modelInfos = (ModelInfo[]) fModelInfoMap.values().toArray(new ModelInfo[0]);
-			for (int i = 0; i < modelInfos.length; i++) {
-				ModelInfo info = modelInfos[i];
-				if (structuredModel.equals(info.fStructuredModel)) {
-					result = info;
-					break;
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Method loadModel.
-	 * 
-	 * @param input
-	 * @return IStructuredModel
-	 */
-	public IStructuredModel loadModel(IStorageEditorInput input) {
-		return loadModel(input, false);
-	}
-
-	/**
-	 * Method loadModel.
-	 * 
-	 * @param input
-	 * @param logExceptions
-	 * @return IStructuredModel
-	 */
-	public IStructuredModel loadModel(IStorageEditorInput input, boolean logExceptions) {
-		String id = calculateID(input);
-		if (id == null) {
-			return null;
-		}
-
-		InputStream contents = null;
-		try {
-			contents = input.getStorage().getContents();
-		}
-		catch (CoreException noStorageExc) {
-			if (logExceptions)
-				Logger.logException(NLS.bind(SSEUIMessages._32concat_EXC_, new Object[]{input.getName()}), noStorageExc);
-		}
-
-		IStructuredModel model = null;
-		try {
-			// first parameter must be unique
-			model = StructuredModelManager.getModelManager().getModelForEdit(id, contents, null);
-			model.setBaseLocation(calculateBaseLocation(input));
-		}
-		catch (IOException e) {
-			if (logExceptions)
-				Logger.logException(NLS.bind(SSEUIMessages._32concat_EXC_, new Object[]{input}), e);
-		}
-		finally {
-			if (contents != null) {
-				try {
-					contents.close();
-				}
-				catch (IOException e) {
-					// nothing
-				}
-				catch (Exception e) {
-					Logger.logException(e);
-				}
-			}
-		}
-		return model;
-	}
-
-	/**
-	 * @param input
-	 * @return
-	 */
-	private IStructuredModel selfCreateModel(IEditorInput input) {
-		return loadModel((IStorageEditorInput) input);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredDocumentToTextAdapter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredDocumentToTextAdapter.java
deleted file mode 100644
index 58993f9..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredDocumentToTextAdapter.java
+++ /dev/null
@@ -1,1332 +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.sse.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.jface.text.AbstractDocument;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ConfigurableLineTracker;
-import org.eclipse.jface.text.DefaultLineTracker;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentAdapter;
-import org.eclipse.jface.text.IDocumentAdapterExtension;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.IRepairableDocument;
-import org.eclipse.jface.text.ITextStore;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.projection.ProjectionDocument;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.custom.TextChangeListener;
-import org.eclipse.swt.custom.TextChangedEvent;
-import org.eclipse.swt.custom.TextChangingEvent;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.ILockable;
-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.StructuredDocumentEvent;
-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.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-
-
-/**
- * Adapts IStructuredDocument events and methods to StyledTextContent events
- * and methods
- */
-public class StructuredDocumentToTextAdapter implements IDocumentAdapter, IDocumentAdapterExtension {
-
-	private class DocumentClone extends AbstractDocument {
-
-
-		/**
-		 * Creates a new document clone with the given content.
-		 * 
-		 * @param content
-		 *            the content
-		 * @param lineDelimiters
-		 *            the line delimiters
-		 */
-		public DocumentClone(String content, String[] lineDelimiters) {
-			super();
-			setTextStore(new StringTextStore(content));
-			ConfigurableLineTracker tracker = new ConfigurableLineTracker(lineDelimiters);
-			setLineTracker(tracker);
-			getTracker().set(content);
-			completeInitialization();
-		}
-	}
-
-	// A pre-notification listener for the viewer's Document
-	class DocumentListener implements IDocumentListener {
-		protected boolean allTextChanged = false;
-
-		protected DocumentEvent currentEvent;
-
-		synchronized public void documentAboutToBeChanged(DocumentEvent event) {
-			if (isStoppedForwardingChanges())
-				return;
-
-			pendingDocumentChangedEvent = true;
-			allTextChanged = event.getOffset() <= 0 && event.getLength() >= StructuredDocumentToTextAdapter.this.getDocument().getLength();
-			currentEvent = event;
-
-			StructuredDocumentToTextAdapter.this.relayTextChanging(event.getOffset(), event.getLength(), event.getText());
-		}
-
-		synchronized public void documentChanged(DocumentEvent event) {
-			if (isStoppedForwardingChanges())
-				return;
-
-			if (currentEvent != null && event == currentEvent) {
-				if (allTextChanged) {
-					StructuredDocumentToTextAdapter.this.relayTextSet();
-				}
-				else {
-					// temp work around for immediate thread
-					// problem.
-					// should have more general solution
-					// soon. 'syncExec' are rumored to be
-					// prone to hang.
-					StructuredDocumentToTextAdapter.this.relayTextChanged();
-				}
-			}
-
-			currentEvent = null;
-			pendingDocumentChangedEvent = false;
-			handlePendingEvents();
-			lastEvent = null;
-
-		}
-	}
-
-	private static class StringTextStore implements ITextStore {
-
-		private String fContent;
-
-		/**
-		 * Creates a new string text store with the given content.
-		 * 
-		 * @param content
-		 *            the content
-		 */
-		public StringTextStore(String content) {
-			Assert.isNotNull(content, "content can not be null when setting text store"); //$NON-NLS-1$
-			fContent = content;
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.ITextStore#get(int)
-		 */
-		public char get(int offset) {
-			return fContent.charAt(offset);
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.ITextStore#get(int, int)
-		 */
-		public String get(int offset, int length) {
-			return fContent.substring(offset, offset + length);
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.ITextStore#getLength()
-		 */
-		public int getLength() {
-			return fContent.length();
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.ITextStore#replace(int, int,
-		 *      java.lang.String)
-		 */
-		public void replace(int offset, int length, String text) {
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.ITextStore#set(java.lang.String)
-		 */
-		public void set(String text) {
-		}
-
-	}
-
-	/**
-	 * Changes to the Document/IStructuredDocument can extend beyond the text
-	 * change area and require more redrawing to keep the hilighting correct.
-	 * The event must be saved so that the redraw is only sent after a
-	 * textChanged event is received.
-	 */
-	class StructuredDocumentListener implements IStructuredDocumentListener {
-
-		public void newModel(NewDocumentEvent structuredDocumentEvent) {
-
-			if (isStoppedForwardingChanges()) {
-				// if
-				// (StructuredDocumentToTextAdapter.this.fStopRelayingChanges)
-				// {
-				if (Debug.debugStructuredDocument) {
-					System.out.println("skipped relaying StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
-				}
-				return;
-			}
-			// should use textSet when all contents have
-			// changed
-			// otherwise need to use the pair of
-			// textChanging and
-			// textChanged.
-			StructuredDocumentToTextAdapter.this.lastEvent = structuredDocumentEvent;
-		}
-
-		public void noChange(final NoChangeEvent structuredDocumentEvent) {
-
-			if (Debug.debugStructuredDocument) {
-				System.out.println("skipped relaying StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
-			}
-			if (structuredDocumentEvent.reason == NoChangeEvent.READ_ONLY_STATE_CHANGE) {
-				if (pendingDocumentChangedEvent) {
-					if (lastEventQueue == null) {
-						lastEventQueue = new ArrayList();
-					}
-					lastEventQueue.add(structuredDocumentEvent);
-				}
-				else {
-					StructuredDocumentToTextAdapter.this.lastEvent = structuredDocumentEvent;
-				}
-			}
-		}
-
-		public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
-
-			if (isStoppedForwardingChanges()) {
-				// if
-				// (StructuredDocumentToTextAdapter.this.fStopRelayingChanges)
-				// {
-				if (Debug.debugStructuredDocument) {
-					System.out.println("not relaying StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
-				}
-				return;
-			}
-			if (Debug.debugStructuredDocument) {
-				System.out.println("saving StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
-			}
-			StructuredDocumentToTextAdapter.this.lastEvent = structuredDocumentEvent;
-		}
-
-		public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
-
-			if (isStoppedForwardingChanges()) {
-				// if
-				// (StructuredDocumentToTextAdapter.this.fStopRelayingChanges)
-				// {
-				if (Debug.debugStructuredDocument) {
-					System.out.println("not relaying StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
-				}
-				return;
-			}
-			if (Debug.debugStructuredDocument) {
-				System.out.println("saving StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
-			}
-			StructuredDocumentToTextAdapter.this.lastEvent = structuredDocumentEvent;
-		}
-
-		public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
-
-			if (isStoppedForwardingChanges()) {
-				// if
-				// (StructuredDocumentToTextAdapter.this.fStopRelayingChanges)
-				// {
-				if (Debug.debugStructuredDocument) {
-					System.out.println("not relaying StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
-				}
-				return;
-			}
-			if (Debug.debugStructuredDocument) {
-				System.out.println("saving StructuredDocumentEvent " + structuredDocumentEvent.getClass().getName()); //$NON-NLS-1$
-			}
-			StructuredDocumentToTextAdapter.this.lastEvent = structuredDocumentEvent;
-		}
-	}
-
-	private static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
-	private final static boolean redrawBackground = true;
-
-	/** The visible child document. */
-	private ProjectionDocument fChildDocument;
-
-	/** The master document */
-	private IDocument fDocument;
-	/** The document clone for the non-forwarding case. */
-	private IDocument fDocumentClone;
-
-	// only use this temp work around if on GTK
-	// it causes funny "cursor blinking" if used on windows
-	private final boolean forceRedrawOnRegionChanged = Platform.getWS().equals("gtk"); //$NON-NLS-1$
-	/** The original content */
-	private String fOriginalContent;
-	/** The original line delimiters */
-	private String[] fOriginalLineDelimiters;
-
-	private int fStopRelayingChangesRequests = 0;
-
-	private StyledText fStyledTextWidget;
-
-	/** The registered text changed listeners */
-	TextChangeListener[] fTextChangeListeners;
-	protected DocumentListener internalDocumentListener;
-
-	// The listeners for relaying DocumentEvents and
-	// requesting repaints
-	// after modification
-	private IStructuredDocumentListener internalStructuredDocumentListener;
-
-	protected StructuredDocumentEvent lastEvent = null;
-	List lastEventQueue;
-	boolean pendingDocumentChangedEvent;
-
-	private static final boolean DEBUG = false;
-
-	/**
-	 * TEST ONLY - TEST ONLY - TEST ONLY NOT API use this constructor only for
-	 * tests. Creates a new document adapter which is initiallly not connected
-	 * to any document.
-	 */
-	public StructuredDocumentToTextAdapter() {
-
-		internalStructuredDocumentListener = new StructuredDocumentListener();
-		internalDocumentListener = new DocumentListener();
-		// for testing only
-		// setDocument(getModelManager().createStructuredDocumentFor(ContentTypeIdentifierForXML.ContentTypeID_XML));
-	}
-
-	/**
-	 * Creates a new document adapter which is initiallly not connected to any
-	 * document.
-	 */
-	public StructuredDocumentToTextAdapter(StyledText styledTextWidget) {
-
-		// do not use 'this()' in this case
-		super();
-		internalStructuredDocumentListener = new StructuredDocumentListener();
-		internalDocumentListener = new DocumentListener();
-		fStyledTextWidget = styledTextWidget;
-	}
-
-	private void _setDocument(IDocument newDoc) {
-		if (fDocument instanceof IStructuredDocument) {
-			((IStructuredDocument) fDocument).removeDocumentChangedListener(internalStructuredDocumentListener);
-		}
-		fDocument = newDoc;
-		if (!isStoppedForwardingChanges()) {
-			fDocumentClone = null;
-			fOriginalContent = getDocument() != null ? getDocument().get() : null;
-			fOriginalLineDelimiters = getDocument() != null ? getDocument().getLegalLineDelimiters() : null;
-		}
-
-		if (DEBUG && fDocument != null && !(fDocument instanceof ILockable)) {
-
-			System.out.println("Warning: non ILockable document used in StructuredDocumentToTextAdapter"); //$NON-NLS-1$
-			System.out.println("         document updates on non-display thread will not be safe if editor open"); //$NON-NLS-1$
-		}
-		if (fDocument instanceof IStructuredDocument) {
-			((IStructuredDocument) fDocument).addDocumentChangedListener(internalStructuredDocumentListener);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.swt.custom.StyledTextContent#addTextChangeListener(org.eclipse.swt.custom.TextChangeListener)
-	 */
-	public synchronized void addTextChangeListener(TextChangeListener listener) {
-
-		// make sure listener is not already in listening
-		// (and if it is, print a warning to aid debugging,
-		// if needed)
-
-		if (Utilities.contains(fTextChangeListeners, listener)) {
-			if (Debug.displayWarnings) {
-				System.out.println("StructuredDocumentToTextAdapter::addTextChangedListeners. listener " + listener + " was added more than once. "); //$NON-NLS-2$//$NON-NLS-1$
-			}
-		}
-		else {
-			if (Debug.debugStructuredDocument) {
-				System.out.println("StructuredDocumentToTextAdapter::addTextChangedListeners. Adding an instance of " + listener.getClass() + " as a listener on text adapter."); //$NON-NLS-2$//$NON-NLS-1$
-			}
-			int oldSize = 0;
-			if (fTextChangeListeners != null) {
-				// normally won't be null, but we need to be
-				// sure, for first time through
-				oldSize = fTextChangeListeners.length;
-			}
-			int newSize = oldSize + 1;
-			TextChangeListener[] newListeners = new TextChangeListener[newSize];
-			if (fTextChangeListeners != null) {
-				System.arraycopy(fTextChangeListeners, 0, newListeners, 0, oldSize);
-			}
-			// add listener to last position
-			newListeners[newSize - 1] = listener;
-			//
-			// now switch new for old
-			fTextChangeListeners = newListeners;
-			//
-		}
-	}
-
-	/*
-	 * @see org.eclipse.swt.custom.StyledTextContent#getCharCount()
-	 */
-	public int getCharCount() {
-
-		// getDocument can sometimes be null during startup
-		// and dispose
-		int result = 0;
-		IDocument doc = getDocument();
-		if (doc != null) {
-			result = getSafeDocument().getLength();
-		}
-		return result;
-	}
-
-	private IDocument getClonedDocument() {
-		if (fDocumentClone == null) {
-			String content = fOriginalContent == null ? "" : fOriginalContent; //$NON-NLS-1$
-			String[] delims = fOriginalLineDelimiters == null ? DefaultLineTracker.DELIMITERS : fOriginalLineDelimiters;
-			fDocumentClone = new DocumentClone(content, delims);
-		}
-		return fDocumentClone;
-	}
-
-	Display getDisplay() {
-
-		// Note: the workbench should always have a display
-		// (unless running headless), whereas Display.getCurrent()
-		// only returns the display if the currently executing thread
-		// has one.
-		if (PlatformUI.isWorkbenchRunning())
-			return PlatformUI.getWorkbench().getDisplay();
-		else
-			return null;
-	}
-
-	/**
-	 * Returns the visible document.
-	 * 
-	 * @return IDocument
-	 */
-	protected IDocument getDocument() {
-
-		if (fChildDocument == null)
-			return fDocument;
-		return fChildDocument;
-	}
-
-	/**
-	 * Returns region in master document of given region (should be region in
-	 * projection document)
-	 * 
-	 * @return region if no projection document exists, region of master
-	 *         document if possible, null otherwise
-	 */
-	private IRegion getProjectionToMasterRegion(IRegion region) {
-		IRegion originalRegion = region;
-		if (fChildDocument != null) {
-			try {
-				originalRegion = fChildDocument.getProjectionMapping().toOriginRegion(region);
-			}
-			catch (BadLocationException e) {
-				Logger.logException(e);
-			}
-		}
-
-		return originalRegion;
-	}
-
-	/**
-	 * Returns offset in projection document of given offset (should be offset
-	 * in master document)
-	 * 
-	 * @return offset if no projection document exists, offset of projection
-	 *         document if possible, -1 otherwise
-	 */
-	private int getMasterToProjectionOffset(int offset) {
-		int originalOffset = offset;
-		if (fChildDocument != null) {
-			try {
-				originalOffset = fChildDocument.getProjectionMapping().toImageOffset(offset);
-			}
-			catch (BadLocationException e) {
-				Logger.logException(e);
-			}
-		}
-
-		return originalOffset;
-	}
-
-	/**
-	 * Return the line at the given character offset without delimiters.
-	 * <p>
-	 * 
-	 * @param offset
-	 *            offset of the line to return. Does not include delimiters of
-	 *            preceeding lines. Offset 0 is the first character of the
-	 *            document.
-	 * @return the line text without delimiters
-	 */
-	public java.lang.String getLine(int lineNumber) {
-
-		String result = null;
-		if (lineNumber >= getLineCount()) {
-			if (Debug.displayWarnings) {
-				System.out.println("Development Debug: IStructuredDocument:getLine() error. lineNumber requested (" + lineNumber + ") was greater than number of lines(" + getLineCount() + "). EmptyString returned"); //$NON-NLS-1$//$NON-NLS-3$//$NON-NLS-2$
-			}
-			result = EMPTY_STRING;
-		}
-		else {
-			IDocument doc = getSafeDocument();
-			if (doc == null) {
-				result = EMPTY_STRING;
-			}
-			else {
-				try {
-					IRegion r = doc.getLineInformation(lineNumber);
-					if (r.getLength() > 0) {
-						result = doc.get(r.getOffset(), r.getLength());
-					}
-					else {
-						result = EMPTY_STRING;
-					}
-				}
-				catch (BadLocationException e) {
-					result = EMPTY_STRING;
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Tries to repair the line information.
-	 * 
-	 * @param document
-	 *            the document
-	 * @see IRepairableDocument#repairLineInformation()
-	 * @see Eclipse 3.0
-	 */
-	private void repairLineInformation(IDocument document) {
-		if (document instanceof IRepairableDocument) {
-			IRepairableDocument repairable = (IRepairableDocument) document;
-			repairable.repairLineInformation();
-		}
-	}
-
-	/**
-	 * Return the line index at the given character offset.
-	 * <p>
-	 * 
-	 * @param offset
-	 *            offset of the line to return. The first character of the
-	 *            document is at offset 0. An offset of getLength() is valid
-	 *            and should answer the number of lines.
-	 * @return the line index. The first line is at index 0. If the character
-	 *         at offset is a delimiter character, answer the line index of
-	 *         the line that is delimited. For example, text = "\r\n\r\n",
-	 *         delimiter = "\r\n", then: getLineAtOffset(0) == 0
-	 *         getLineAtOffset(1) == 0 getLineAtOffset(2) == 1
-	 *         getLineAtOffset(3) == 1 getLineAtOffset(4) == 2
-	 */
-	public int getLineAtOffset(int offset) {
-
-		int result = 0;
-		IDocument doc = getSafeDocument();
-		if (doc != null) {
-			try {
-				result = doc.getLineOfOffset(offset);
-			}
-			catch (BadLocationException x) {
-				repairLineInformation(doc);
-				try {
-					result = doc.getLineOfOffset(offset);
-				}
-				catch (BadLocationException x2) {
-					// should not occur, but seems to for projection
-					// documents, related to repainting overview ruler
-					result = 0;
-				}
-			}
-		}
-		return result;
-	}
-
-	public int getLineCount() {
-		int result = 0;
-		IDocument doc = getSafeDocument();
-		if (doc != null) {
-			result = doc.getNumberOfLines();
-		}
-		return result;
-	}
-
-	/*
-	 * @see org.eclipse.swt.custom.StyledTextContent#getLineDelimiter
-	 */
-	public String getLineDelimiter() {
-		String result = null;
-		if (getParentDocument() instanceof IStructuredDocument) {
-			result = ((IStructuredDocument) getParentDocument()).getLineDelimiter();
-		}
-		else {
-			IDocument doc = getSafeDocument();
-			result = TextUtilities.getDefaultLineDelimiter(doc);
-		}
-		return result;
-	}
-
-	/**
-	 * Return the character offset of the first character of the given line.
-	 * <p>
-	 * 
-	 * @param lineIndex
-	 *            index of the line. The first line is at index 0.
-	 * @return offset offset of the first character of the line. The first
-	 *         character of the document is at offset 0. The return value
-	 *         should include line delimiters. For example, text =
-	 *         "\r\ntest\r\n", delimiter = "\r\n", then: getOffsetAtLine(0) ==
-	 *         0 getOffsetAtLine(1) == 2 getOffsetAtLine(2) == 8 NOTE: When
-	 *         there is no text (i.e., no lines), getOffsetAtLine(0) is a
-	 *         valid call that should return 0.
-	 */
-	public int getOffsetAtLine(int lineIndex) {
-
-		int result = 0;
-		IDocument doc = getSafeDocument();
-		if (doc != null) {
-			try {
-				result = doc.getLineOffset(lineIndex);
-			}
-			catch (BadLocationException e) {
-				result = 0;
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Returns the parent document
-	 * 
-	 * @return the parent document
-	 */
-	private IDocument getParentDocument() {
-		return fDocument;
-	}
-
-	/**
-	 * This is the document to use for request from the StyledText widget. Its
-	 * either the live documnet or a clone of it, depending on stop/resume
-	 * state.
-	 */
-	private IDocument getSafeDocument() {
-		IDocument result = null;
-		if (isStoppedForwardingChanges()) {
-			result = getClonedDocument();
-		}
-		else {
-			// note, this document can be normal structured text document,
-			// or the projection/child document
-			result = getDocument();
-		}
-		return result;
-	}
-
-	/**
-	 * @return org.eclipse.swt.custom.StyledText
-	 */
-	StyledText getStyledTextWidget() {
-		return fStyledTextWidget;
-	}
-
-	/**
-	 * Returns a string representing the content at the given range.
-	 * <p>
-	 * 
-	 * @param start
-	 *            the start offset of the text to return. Offset 0 is the
-	 *            first character of the document.
-	 * @param length
-	 *            the length of the text to return
-	 * @return the text at the given range
-	 */
-	public String getTextRange(int start, int length) {
-		String result = null;
-		try {
-			IDocument doc = getSafeDocument();
-			result = doc.get(start, length);
-		}
-		catch (BadLocationException e) {
-			result = EMPTY_STRING;
-		}
-		return result;
-	}
-
-	/**
-	 * assume only for "no change" events, for now
-	 */
-	protected void handlePendingEvents() {
-
-		if (lastEventQueue == null)
-			return;
-
-		Iterator iterator = lastEventQueue.iterator();
-		while (iterator.hasNext()) {
-			NoChangeEvent noChangeEvent = (NoChangeEvent) iterator.next();
-			redrawNoChange(noChangeEvent);
-		}
-
-		lastEventQueue = null;
-		lastEvent = null;
-	}
-
-	boolean isStoppedForwardingChanges() {
-		return fStopRelayingChangesRequests > 0;
-	}
-
-	/**
-	 * this method is assumed to be called only for read only region changes.
-	 */
-	protected void redrawNoChange(NoChangeEvent structuredDocumentEvent) {
-
-		if (isStoppedForwardingChanges())
-			return;
-		if (Debug.debugStructuredDocument) {
-			System.out.println("maybe redraw stuff"); //$NON-NLS-1$
-		}
-
-		int startOffset = structuredDocumentEvent.getOffset();
-		int length = structuredDocumentEvent.getLength();
-		redrawRangeWithLength(startOffset, length);
-
-	}
-
-	/**
-	 * Request a redraw of the text range occupied by the given
-	 * StructuredDocumentRegionsReplacedEvent
-	 * 
-	 * @param structuredDocumentEvent
-	 */
-	protected void redrawNodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
-
-		if (isStoppedForwardingChanges())
-			return;
-		if (Debug.debugStructuredDocument) {
-			System.out.println("maybe redraw stuff"); //$NON-NLS-1$
-		}
-		// just the new stuff
-		IStructuredDocumentRegionList newStructuredDocumentRegions = structuredDocumentEvent.getNewStructuredDocumentRegions();
-
-		int nNewNodes = newStructuredDocumentRegions.getLength();
-		if (nNewNodes > 0) {
-			IStructuredDocumentRegion firstNode = newStructuredDocumentRegions.item(0);
-			IStructuredDocumentRegion lastNode = newStructuredDocumentRegions.item(nNewNodes - 1);
-			redrawRange(firstNode.getStartOffset(), lastNode.getEndOffset());
-		}
-	}
-
-	/**
-	 * Redraws the give offsets in terms of the StructuredDocument. If only
-	 * part of the model is visible, ensures that only the visible portion of
-	 * the given range is redrawn.
-	 * 
-	 * @param startModelOffset
-	 * @param endModelOffset
-	 */
-	private void redrawRange(final int startModelOffset, final int endModelOffset) {
-
-		if (getDocument() == null)
-			return;
-		if (Debug.debugStructuredDocument) {
-			System.out.println("redraw stuff: " + startModelOffset + "-" + endModelOffset); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		if (fChildDocument == null) {
-			Runnable runnable = new Runnable() {
-				public void run() {
-					getStyledTextWidget().redrawRange(startModelOffset, endModelOffset - startModelOffset, redrawBackground);
-				}
-			};
-			runOnDisplayThreadIfNeedede(runnable);
-
-		}
-		else {
-			int high = getDocument().getLength();
-			int startOffset = getMasterToProjectionOffset(startModelOffset);
-
-			int endOffset = getMasterToProjectionOffset(endModelOffset);
-
-			// if offsets were not visible, just try to redraw everything in
-			// the child document
-			// // not visible
-			// if (endOffset < 0 || startOffset > high)
-			// return;
-			// restrict lower bound
-			if (startOffset < 0) {
-				startOffset = 0;
-			}
-			// restrict upper bound
-			// if (endOffset > high) {
-			// endOffset = high;
-			// }
-			if (endOffset < 0) {
-				endOffset = high;
-			}
-
-			int length = endOffset - startOffset;
-			// redrawBackground with false would be faster
-			// but assumes background (or font) is not
-			// changing
-			final int finalStartOffset = startOffset;
-			final int finallength = length;
-
-			Runnable runnable = new Runnable() {
-				public void run() {
-					getStyledTextWidget().redrawRange(finalStartOffset, finallength, redrawBackground);
-				}
-			};
-			runOnDisplayThreadIfNeedede(runnable);
-
-		}
-	}
-
-	/**
-	 * Redraws the give offsets in terms of the Flat Node model. If only part
-	 * of the model is visible, ensures that only the visible portion of the
-	 * given range is redrawn.
-	 * 
-	 * @param startModelOffset
-	 * @param endModelOffset
-	 */
-	private void redrawRangeWithLength(final int startModelOffset, final int length) {
-
-		if (getDocument() == null)
-			return;
-		if (Debug.debugStructuredDocument) {
-			System.out.println("redraw stuff: " + startModelOffset + "-" + length); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		if (fChildDocument == null) {
-			Runnable runnable = new Runnable() {
-				public void run() {
-					getStyledTextWidget().redrawRange(startModelOffset, length, redrawBackground);
-				}
-			};
-			runOnDisplayThreadIfNeedede(runnable);
-		}
-		else {
-			int high = getDocument().getLength();
-			// TODO need to take into account segmented visible regions
-			int startOffset = getMasterToProjectionOffset(startModelOffset);
-			// not visible
-			if (startOffset > high || length < 1)
-				return;
-			// restrict lower bound
-			if (startOffset < 0) {
-				startOffset = 0;
-			}
-			int endOffset = startOffset + length - 1;
-			// restrict upper bound
-			if (endOffset > high) {
-				endOffset = high;
-			}
-
-			// note: length of the child documnet should be
-			// updated,
-			// need to investigate why its not at this
-			// point, but is
-			// probably just because the document event
-			// handling is not
-			// completely finished.
-			int newLength = endOffset - startOffset; // d283007
-
-			// redrawBackground with false would be faster
-			// but assumes background (or font) is not
-			// changing
-			final int finalStartOffset = startOffset;
-			final int finalNewLength = newLength;
-			Runnable runnable = new Runnable() {
-				public void run() {
-					getStyledTextWidget().redrawRange(finalStartOffset, finalNewLength, redrawBackground);
-				}
-			};
-			runOnDisplayThreadIfNeedede(runnable);
-		}
-	}
-
-	/**
-	 * Request a redraw of the text range occupied by the given
-	 * RegionChangedEvent for certain (not all) ITextRegion contexts
-	 * 
-	 * @param structuredDocumentEvent
-	 */
-	protected void redrawRegionChanged(RegionChangedEvent structuredDocumentEvent) {
-
-		if (isStoppedForwardingChanges()) {
-			return;
-		}
-		if (Debug.debugStructuredDocument) {
-			System.out.println("maybe redraw stuff"); //$NON-NLS-1$
-		}
-
-
-		// (nsd) TODO: try to make this reliable somehow
-		// without being directly content dependent
-		// if ((region instanceof ITextRegionContainer) ||
-		// (type == XMLJSPRegionContexts.BLOCK_TEXT) ||
-		// (type == XMLJSPRegionContexts.JSP_CONTENT)) {
-		// IStructuredDocumentRegion flatNode =
-		// structuredDocumentEvent.getStructuredDocumentRegion();
-		// // redraw background of false is faster,
-		// // but assumes background (or font) is not
-		// changing
-		// redrawRange(flatNode.getStartOffset(region),
-		// flatNode.getEndOffset(region));
-		// }
-		if (forceRedrawOnRegionChanged) {
-			// workaround for redrawing problems on Linux-GTK
-			int startOffset = structuredDocumentEvent.getOffset();
-			int endOffset = structuredDocumentEvent.getOffset() + structuredDocumentEvent.getLength();
-			try {
-				IRegion startLine = structuredDocumentEvent.fDocument.getLineInformationOfOffset(startOffset);
-				IRegion endLine = structuredDocumentEvent.fDocument.getLineInformationOfOffset(endOffset);
-				if (startLine != null && endLine != null) {
-					redrawRange(startLine.getOffset(), endLine.getOffset() + endLine.getLength());
-				}
-			}
-			catch (BadLocationException e) {
-				// nothing for now
-			}
-		}
-	}
-
-	/**
-	 * Request a redraw of the text range occupied by the given
-	 * RegionsReplacedEvent
-	 * 
-	 * @param structuredDocumentEvent
-	 */
-	protected void redrawRegionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
-
-		if (isStoppedForwardingChanges())
-			return;
-		if (Debug.debugStructuredDocument) {
-			System.out.println("maybe redraw stuff"); //$NON-NLS-1$
-		}
-		ITextRegionList newRegions = structuredDocumentEvent.getNewRegions();
-		int nRegions = newRegions.size();
-		if (nRegions > 0) {
-			ITextRegion firstRegion = newRegions.get(0);
-			ITextRegion lastRegion = newRegions.get(nRegions - 1);
-			IStructuredDocumentRegion flatNode = structuredDocumentEvent.getStructuredDocumentRegion();
-			redrawRange(flatNode.getStartOffset(firstRegion), flatNode.getEndOffset(lastRegion));
-		}
-	}
-
-	protected void redrawTextChanged() {
-
-		if (lastEvent != null) {
-			// update display, since some cases can effect
-			// highlighting beyond the changed text area.
-			if (lastEvent instanceof StructuredDocumentRegionsReplacedEvent)
-				redrawNodesReplaced((StructuredDocumentRegionsReplacedEvent) lastEvent);
-			if (lastEvent instanceof RegionsReplacedEvent)
-				redrawRegionsReplaced((RegionsReplacedEvent) lastEvent);
-			if (lastEvent instanceof RegionChangedEvent)
-				redrawRegionChanged((RegionChangedEvent) lastEvent);
-			// moved following line to 'document changed' so
-			// the "last event" can be
-			// re-drawn after pending re-draws
-			// lastEvent = null;
-		}
-	}
-
-	/**
-	 * Sends a text replace event to all registered listeners.
-	 */
-	protected void relayTextChanged() {
-
-		if (isStoppedForwardingChanges()) {
-			if (Debug.debugStructuredDocument && getDocument() != null) {
-				System.out.println("NOT relaying text changed (" + getDocument().getLength() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			return;
-		}
-		if (Debug.debugStructuredDocument && getDocument() != null) {
-			System.out.println("relaying text changed (" + getDocument().getLength() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		final TextChangedEvent textChangedEvent = new TextChangedEvent(this);
-
-		// we must assign listeners to local variable, since
-		// the add and remove listener
-		// methods can change the actual instance of the
-		// listener array from another thread
-
-		Runnable runnable = new Runnable() {
-			public void run() {
-				if (fTextChangeListeners != null) {
-					Object[] holdListeners = fTextChangeListeners;
-					for (int i = 0; i < holdListeners.length; i++) {
-						// this is a safe cast, since addListeners
-						// requires a IStructuredDocumentListener
-						((TextChangeListener) holdListeners[i]).textChanged(textChangedEvent);
-					}
-				}
-			}
-		};
-		runOnDisplayThreadIfNeedede(runnable);
-		redrawTextChanged();
-	}
-
-	/**
-	 * Sends a text change to all registered listeners
-	 */
-	protected void relayTextChanging(int requestedStart, int requestedLength, String requestedChange) {
-
-		if (getDocument() == null)
-			return;
-		if (isStoppedForwardingChanges()) {
-			if (Debug.debugStructuredDocument && getDocument() != null) {
-				System.out.println("NOT relaying text changing: " + requestedStart + ":" + getDocument().getLength()); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			return;
-		}
-		if (Debug.debugStructuredDocument && getDocument() != null) {
-			System.out.println("relaying text changing: " + requestedStart + ":" + getDocument().getLength()); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		lastEvent = null;
-		try {
-			final TextChangingEvent textChangingEvent = new TextChangingEvent(this);
-
-			textChangingEvent.start = requestedStart;
-			textChangingEvent.replaceCharCount = requestedLength;
-			textChangingEvent.newCharCount = (requestedChange == null ? 0 : requestedChange.length());
-			textChangingEvent.replaceLineCount = getDocument().getNumberOfLines(requestedStart, requestedLength) - 1;
-			textChangingEvent.newText = requestedChange;
-			textChangingEvent.newLineCount = (requestedChange == null ? 0 : getDocument().computeNumberOfLines(requestedChange));
-
-			// we must assign listeners to local variable,
-			// since the add and remove listner
-			// methods can change the actual instance of the
-			// listener array from another thread
-			Runnable runnable = new Runnable() {
-				public void run() {
-					if (fTextChangeListeners != null) {
-						TextChangeListener[] holdListeners = fTextChangeListeners;
-						for (int i = 0; i < holdListeners.length; i++) {
-							// this is a safe cast, since
-							// addListeners requires a
-							// IStructuredDocumentListener
-							holdListeners[i].textChanging(textChangingEvent);
-						}
-					}
-				}
-			};
-			runOnDisplayThreadIfNeedede(runnable);
-		}
-		catch (BadLocationException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-	}
-
-	/**
-	 * Sends a text set event to all registered listeners. Widget should
-	 * redraw itself automatically.
-	 */
-	protected void relayTextSet() {
-
-		if (isStoppedForwardingChanges()) {
-			if (Debug.debugStructuredDocument && getDocument() != null) {
-				System.out.println("NOT relaying text set (" + getDocument().getLength() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			return;
-		}
-		if (Debug.debugStructuredDocument && getDocument() != null) {
-			System.out.println("relaying text set (" + getDocument().getLength() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		lastEvent = null;
-		final TextChangedEvent textChangedEvent = new TextChangedEvent(this);
-
-		// we must assign listeners to local variable, since
-		// the add and remove listner
-		// methods can change the actual instance of the
-		// listener array from another thread
-		Runnable runnable = new Runnable() {
-			public void run() {
-				if (fTextChangeListeners != null) {
-					TextChangeListener[] holdListeners = fTextChangeListeners;
-					for (int i = 0; i < holdListeners.length; i++) {
-						holdListeners[i].textSet(textChangedEvent);
-					}
-				}
-			}
-		};
-		runOnDisplayThreadIfNeedede(runnable);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.swt.custom.StyledTextContent#removeTextChangeListener(org.eclipse.swt.custom.TextChangeListener)
-	 */
-	public synchronized void removeTextChangeListener(final TextChangeListener listener) {
-
-		if ((fTextChangeListeners != null) && (listener != null)) {
-			// if its not in the listeners, we'll ignore the
-			// request
-			if (!Utilities.contains(fTextChangeListeners, listener)) {
-				if (Debug.displayWarnings) {
-					System.out.println("StructuredDocumentToTextAdapter::removeTextChangedListeners. listener " + listener + " was not present. "); //$NON-NLS-2$//$NON-NLS-1$
-				}
-			}
-			else {
-				if (Debug.debugStructuredDocument) {
-					System.out.println("StructuredDocumentToTextAdapter::addTextChangedListeners. Removing an instance of " + listener.getClass() + " as a listener on text adapter."); //$NON-NLS-2$//$NON-NLS-1$
-				}
-				final int oldSize = fTextChangeListeners.length;
-				int newSize = oldSize - 1;
-				final TextChangeListener[] newListeners = new TextChangeListener[newSize];
-
-				Runnable runnable = new Runnable() {
-					public void run() {
-						int index = 0;
-						for (int i = 0; i < oldSize; i++) {
-							if (fTextChangeListeners[i] != listener) {
-								// copy old to new if its not the
-								// one we are removing
-								newListeners[index++] = fTextChangeListeners[i];
-							}
-						}
-					}
-				};
-				runOnDisplayThreadIfNeedede(runnable);
-				// now that we have a new array, let's
-				// switch it for the old one
-				fTextChangeListeners = newListeners;
-			}
-		}
-	}
-
-	/**
-	 * Replace the text with "newText" starting at position "start" for a
-	 * length of "replaceLength".
-	 * <p>
-	 * Implementors have to notify TextChanged listeners after the content has
-	 * been updated. The TextChangedEvent should be set as follows:
-	 * <ul>
-	 * <li>event.type = SWT.TextReplaced
-	 * <li>event.start = start of the replaced text
-	 * <li>event.numReplacedLines = number of replaced lines
-	 * <li>event.numNewLines = number of new lines
-	 * <li>event.replacedLength = length of the replaced text
-	 * <li>event.newLength = length of the new text
-	 * </ul>
-	 * <b>NOTE: </b> numNewLines is the number of inserted lines and
-	 * numReplacedLines is the number of deleted lines based on the change
-	 * that occurs visually. For example:
-	 * <ul>
-	 * <li>(replacedText, newText) ==> (numReplacedLines, numNewLines)
-	 * <li>("", "\n") ==> (0, 1)
-	 * <li>("\n\n", "a") ==> (2, 0)
-	 * <li>("a", "\n\n") ==> (0, 2)
-	 * <li>("\n", "") ==> (1, 0)
-	 * </ul>
-	 * </p>
-	 * 
-	 * @param start
-	 *            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
-	 *            start offset of text to replace
-	 * @param newText
-	 *            start offset of text to replace
-	 */
-	public void replaceTextRange(int start, int replaceLength, String text) {
-
-		if (getParentDocument() instanceof IStructuredDocument) {
-			// the structuredDocument initiates the "changing"
-			// and "changed" events.
-			// they are both fired by the time this method
-			// returns.
-			IRegion region = getProjectionToMasterRegion(new Region(start, replaceLength));
-			if (region != null) {
-				((IStructuredDocument) getParentDocument()).replaceText(this, region.getOffset(), region.getLength(), text);
-				return;
-			}
-		}
-		// default is to just try and replace text range in current document
-		try {
-			getDocument().replace(start, replaceLength, text);
-		}
-		catch (BadLocationException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.IDocumentAdapterExtension#resumeForwardingDocumentChanges()
-	 */
-	public void resumeForwardingDocumentChanges() {
-
-		// from re-reading the textSet API in StyledText, we
-		// must call
-		// textSet if all the contents changed. If all the
-		// contents did
-		// not change, we need to call the pair of APIs,
-		// textChanging and
-		// textChanged. So, if we ever keep careful track of
-		// changes
-		// during stop forwarding and resume forwarding, we
-		// can
-		// investigate change make use of the pair of APIs.
-		fStopRelayingChangesRequests--;
-		if (fStopRelayingChangesRequests == 0) {
-			// fIsForwarding= true;
-			fDocumentClone = null;
-			fOriginalContent = null;
-			fOriginalLineDelimiters = null;
-			// fireTextSet();
-			relayTextSet();
-		}
-	}
-
-	/**
-	 * This 'Runnable' should be very brief, and should not "call out" to
-	 * other code which itself might call syncExec, or deadlock might occur.
-	 * 
-	 * @param r
-	 */
-	private void runOnDisplayThreadIfNeedede(Runnable r) {
-		// if there is no Display at all (that is, running headless),
-		// or if we are already running on the display thread, then
-		// simply execute the runnable.
-		if (getDisplay() == null || (Thread.currentThread() == getDisplay().getThread())) {
-			r.run();
-		}
-		else {
-			// otherwise force the runnable to run on the display thread.
-			//
-			// Its unclear if we need this at all, once
-			// we "force" document update to always take place on display
-			// thread.
-			IDocument doc = getDocument();
-			if (doc instanceof ILockable) {
-
-				ILock lock = null;
-				try {
-					lock = ((ILockable) doc).getLockObject();
-					lock.acquire();
-					getDisplay().syncExec(r);
-				}
-				finally {
-					if (lock != null) {
-						lock.release();
-					}
-				}
-			}
-			else {
-				// else, ignore!, since risk of deadlock
-				throw new IllegalStateException("non lockable document used for structuredDocumentToTextAdapter"); //$NON-NLS-1$
-			}
-		}
-	}
-
-	/**
-	 * @param newModel
-	 */
-	public void setDocument(IDocument document) {
-
-		if (getDocument() != null) {
-			getDocument().removePrenotifiedDocumentListener(internalDocumentListener);
-		}
-		lastEvent = null;
-		if (document instanceof ProjectionDocument) {
-			fChildDocument = (ProjectionDocument) document;
-			_setDocument(fChildDocument.getMasterDocument());
-		}
-		else {
-			fChildDocument = null;
-			_setDocument(document);
-		}
-		if (getDocument() != null) {
-			getDocument().addPrenotifiedDocumentListener(internalDocumentListener);
-		}
-	}
-
-	/**
-	 * @see IDocument#setText
-	 */
-	public void setText(String string) {
-
-		if (isStoppedForwardingChanges()) {
-			fDocumentClone = null;
-			fOriginalContent = getDocument().get();
-			fOriginalLineDelimiters = getDocument().getLegalLineDelimiters();
-		}
-		else if (getParentDocument() instanceof IStructuredDocument) {
-			((IStructuredDocument) getDocument()).setText(this, string);
-		}
-		else {
-			getDocument().set(string);
-		}
-		relayTextSet();
-	}
-
-	/**
-	 * This method was added to make testing easier. Normally, the widget is
-	 * specified on the constructor.
-	 */
-	public void setWidget(StyledText widget) {
-
-		fStyledTextWidget = widget;
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.IDocumentAdapterExtension#stopForwardingDocumentChanges()
-	 */
-	public void stopForwardingDocumentChanges() {
-
-		fStopRelayingChangesRequests++;
-		// only need to take snapshot on first request
-		if (fStopRelayingChangesRequests == 1) {
-			fDocumentClone = null;
-			fOriginalContent = getDocument().get();
-			fOriginalLineDelimiters = getDocument().getLegalLineDelimiters();
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredLineChangeHover.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredLineChangeHover.java
deleted file mode 100644
index fa5dc33..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredLineChangeHover.java
+++ /dev/null
@@ -1,48 +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.sse.ui.internal;
-
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.source.LineChangeHover;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Escapes diff hover presentation text (converts < to &lt; > to &gt; etc...)
- * so that html in the diff file (displayed in hover) isn't presented as style
- * (bold, italic, colors, etc...)
- * 
- * @author pavery
- */
-public class StructuredLineChangeHover extends LineChangeHover {
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.source.IAnnotationHoverExtension#getHoverControlCreator()
-	 */
-	public IInformationControlCreator getHoverControlCreator() {
-		// use the default information control creator that just displays text
-		// as text, not html content
-		// because there is no special html that should be presented when just
-		// showing diff
-		// in the future, sourceviewer should be used instead of this plain
-		// text control like java uses
-		// SourceViewerInformationControl
-		return new IInformationControlCreator() {
-			public IInformationControl createInformationControl(Shell parent) {
-				return new DefaultInformationControl(parent);
-			}
-		};
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredMarkerAnnotation.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredMarkerAnnotation.java
deleted file mode 100644
index 184e33f..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredMarkerAnnotation.java
+++ /dev/null
@@ -1,151 +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.sse.ui.internal;
-
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.source.IAnnotationPresentation;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.MarkerAnnotation;
-import org.eclipse.ui.texteditor.MarkerUtilities;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-
-
-/**
- * This is overridden to get around the problem of being registered as a
- * org.eclipse.wst.validation.core.problemmarker rather than a
- * org.eclipse.core.resource.problemmarker causing all problems to be skipped
- * in the OverviewRuler
- */
-public class StructuredMarkerAnnotation extends MarkerAnnotation implements IAnnotationPresentation {
-
-	private IDebugModelPresentation fPresentation;
-	//controls if icon should be painted gray
-	private boolean fIsGrayed = false;
-	String fAnnotationType = null;
-
-	StructuredMarkerAnnotation(IMarker marker) {
-		super(marker);
-		initAnnotationType();
-	}
-	
-	public final String getAnnotationType() {
-		return fAnnotationType;
-	}
-	
-	/**
-	 * Eventually will have to use IAnnotationPresentation & IAnnotationExtension
-	 * @see org.eclipse.ui.texteditor.MarkerAnnotation#getImage(org.eclipse.swt.widgets.Display)
-	 */
-	protected Image getImage(Display display) {
-		Image image = null;
-		if (fAnnotationType == TemporaryAnnotation.ANNOT_BREAKPOINT) {
-			image = super.getImage(display);
-			if (image == null) {
-				IMarker marker = getMarker();
-				if (marker != null && marker.exists()) {
-					image = fPresentation.getImage(getMarker());
-				}
-			}
-		}
-		else if(fAnnotationType == TemporaryAnnotation.ANNOT_ERROR) {
-			image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
-		}
-		else if(fAnnotationType == TemporaryAnnotation.ANNOT_WARNING) {
-			image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
-		}
-		else if(fAnnotationType == TemporaryAnnotation.ANNOT_INFO) {
-			image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK);
-		}
-			
-		if(image != null && isGrayed())
-			setImage(getGrayImage(display, image));
-		else 
-			setImage(image);
-		
-		return super.getImage(display);
-	}
-
-	private Image getGrayImage(Display display, Image image) {
-		if (image != null) {
-			String key= Integer.toString(image.hashCode());
-			// make sure we cache the gray image
-			Image grayImage = JFaceResources.getImageRegistry().get(key);
-			if (grayImage == null) {
-				grayImage= new Image(display, image, SWT.IMAGE_GRAY);
-				JFaceResources.getImageRegistry().put(key, grayImage);
-			}
-			image= grayImage;
-		}
-		return image;
-	}
-	
-	public final boolean isGrayed() {
-		return fIsGrayed;
-	}
-	
-	public final void setGrayed(boolean grayed) {
-		fIsGrayed = grayed;
-	}
-	
-	/**
-	 * Initializes the annotation's icon representation and its drawing layer
-	 * based upon the properties of the underlying marker.
-	 */
-	protected void initAnnotationType() {
-		
-		IMarker marker = getMarker();
-		if (MarkerUtilities.isMarkerType(marker, IBreakpoint.BREAKPOINT_MARKER)) {
-
-			if (fPresentation == null)
-				fPresentation = DebugUITools.newDebugModelPresentation();
-
-			setImage(null); // see bug 32469
-			setLayer(4);
-			//fImageType = BREAKPOINT_IMAGE;
-			fAnnotationType = TemporaryAnnotation.ANNOT_BREAKPOINT;
-
-		} else {
-			
-			fAnnotationType = TemporaryAnnotation.ANNOT_UNKNOWN;
-			try {
-				if (marker.isSubtypeOf(IMarker.PROBLEM)) {
-					int severity = marker.getAttribute(IMarker.SEVERITY, -1);
-					switch (severity) {
-						case IMarker.SEVERITY_ERROR :
-							fAnnotationType = TemporaryAnnotation.ANNOT_ERROR;
-							break;
-						case IMarker.SEVERITY_WARNING :
-							fAnnotationType = TemporaryAnnotation.ANNOT_WARNING;
-							break;
-						case IMarker.SEVERITY_INFO :
-							fAnnotationType = TemporaryAnnotation.ANNOT_INFO;
-							break;
-					}
-				}
-
-			} catch (CoreException e) {
-				Logger.logException(e);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModel.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModel.java
deleted file mode 100644
index ad6597d..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModel.java
+++ /dev/null
@@ -1,109 +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.sse.ui.internal;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.text.Position;
-import org.eclipse.ui.texteditor.MarkerAnnotation;
-import org.eclipse.ui.texteditor.MarkerUtilities;
-import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointConstants;
-
-
-/**
- * Source editor resource marker annotation model implementation
- */
-public class StructuredResourceMarkerAnnotationModel extends ResourceMarkerAnnotationModel {
-	public final static String SECONDARY_ID_KEY = IBreakpointConstants.RESOURCE_PATH;
-	protected IResource fMarkerResource;
-	protected String fSecondaryMarkerAttributeValue;
-
-	/**
-	 * Constructor
-	 * 
-	 * @param resource
-	 */
-	public StructuredResourceMarkerAnnotationModel(IResource resource) {
-		super(resource);
-		fMarkerResource = resource;
-	}
-
-	public StructuredResourceMarkerAnnotationModel(IResource resource, String secondaryID) {
-		super(resource);
-		fMarkerResource = resource;
-		fSecondaryMarkerAttributeValue = secondaryID;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#createMarkerAnnotation(org.eclipse.core.resources.IMarker)
-	 */
-	protected MarkerAnnotation createMarkerAnnotation(IMarker marker) {
-		/*
-		 * We need to do some special processing if marker is a validation
-		 * (aka problem) marker or if marker is a breakpoint marker so create
-		 * a special marker annotation for those markers. Otherwise, use
-		 * default.
-		 */
-		if (MarkerUtilities.isMarkerType(marker, IBreakpoint.BREAKPOINT_MARKER) || (MarkerUtilities.isMarkerType(marker, IMarker.PROBLEM))) {
-			return new StructuredMarkerAnnotation(marker);
-		}
-		return super.createMarkerAnnotation(marker);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#getMarkerPosition(org.eclipse.core.resources.IMarker)
-	 */
-	public Position getMarkerPosition(IMarker marker) {
-		Position pos = super.getMarkerPosition(marker);
-
-		// if ((pos == null || pos.getLength() == 0) && marker.getType() ==
-		// IInternalDebugUIConstants.ANN_INSTR_POINTER_CURRENT) {
-		if (pos == null || pos.getLength() == 0) {
-			// We probably should create position from marker if marker
-			// attributes specify a valid position
-			pos = createPositionFromMarker(marker);
-		}
-
-		return pos;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#isAcceptable(org.eclipse.core.resources.IMarker)
-	 */
-	protected boolean isAcceptable(IMarker marker) {
-		try {
-			Object attr = marker.getAttribute(IBreakpointConstants.ATTR_HIDDEN);
-			if (attr != null && ((Boolean) attr).equals(Boolean.TRUE))
-				return false;
-		}
-		catch (CoreException e) {
-			// ignore
-		}
-
-		if (fSecondaryMarkerAttributeValue == null)
-			return super.isAcceptable(marker);
-		String markerSecondaryMarkerAttributeValue = marker.getAttribute(SECONDARY_ID_KEY, ""); //$NON-NLS-1$
-		boolean isSameFile = fSecondaryMarkerAttributeValue.equalsIgnoreCase(markerSecondaryMarkerAttributeValue);
-		return super.isAcceptable(marker) && isSameFile;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModelFactory.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModelFactory.java
deleted file mode 100644
index 4844776..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModelFactory.java
+++ /dev/null
@@ -1,49 +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.sse.ui.internal;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModelFactory;
-
-/**
- * 
- * @author nsd
- * 
- * Used by the org.eclipse.core.filebuffers.annotationModelCreation extension
- * point
- */
-public class StructuredResourceMarkerAnnotationModelFactory extends ResourceMarkerAnnotationModelFactory {
-
-	public StructuredResourceMarkerAnnotationModelFactory() {
-		super();
-	}
-
-	/*
-	 * @see org.eclipse.core.filebuffers.IAnnotationModelFactory#createAnnotationModel(org.eclipse.core.runtime.IPath)
-	 */
-	public IAnnotationModel createAnnotationModel(IPath location) {
-		IAnnotationModel model = null;
-		IFile file = FileBuffers.getWorkspaceFileAtLocation(location);
-		if (file != null) {
-			model = new StructuredResourceMarkerAnnotationModel(file);
-		}
-		else {
-			model = new StructuredResourceMarkerAnnotationModel(ResourcesPlugin.getWorkspace().getRoot(), location.toString());
-		}
-		return model;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java
deleted file mode 100644
index ad15ec8..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java
+++ /dev/null
@@ -1,391 +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.sse.ui.internal;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationHover;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.texteditor.MarkerAnnotation;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-
-public class StructuredTextAnnotationHover implements IAnnotationHover {
-
-	/**
-	 * Provides a set of convenience methods for creating HTML pages. Taken
-	 * from org.eclipse.jdt.internal.ui.text.HTMLPrinter
-	 */
-	class HTMLPrinter {
-
-		HTMLPrinter() {
-		}
-
-		void addBullet(StringBuffer buffer, String bullet) {
-			if (bullet != null) {
-				buffer.append("<li>"); //$NON-NLS-1$
-				buffer.append(bullet);
-				buffer.append("</li>"); //$NON-NLS-1$
-			}
-		}
-
-		void addPageEpilog(StringBuffer buffer) {
-			buffer.append("</font></body></html>"); //$NON-NLS-1$
-		}
-
-		void addPageProlog(StringBuffer buffer) {
-			insertPageProlog(buffer, buffer.length());
-		}
-
-		void addParagraph(StringBuffer buffer, Reader paragraphReader) {
-			if (paragraphReader != null)
-				addParagraph(buffer, read(paragraphReader));
-		}
-
-		void addParagraph(StringBuffer buffer, String paragraph) {
-			if (paragraph != null) {
-				buffer.append("<p>"); //$NON-NLS-1$
-				buffer.append(paragraph);
-			}
-		}
-
-		void addSmallHeader(StringBuffer buffer, String header) {
-			if (header != null) {
-				buffer.append("<h5>"); //$NON-NLS-1$
-				buffer.append(header);
-				buffer.append("</h5>"); //$NON-NLS-1$
-			}
-		}
-
-		String convertToHTMLContent(String content) {
-			content = replace(content, '<', "&lt;"); //$NON-NLS-1$
-			return replace(content, '>', "&gt;"); //$NON-NLS-1$
-		}
-
-		void endBulletList(StringBuffer buffer) {
-			buffer.append("</ul>"); //$NON-NLS-1$
-		}
-
-		void insertPageProlog(StringBuffer buffer, int position) {
-			buffer.insert(position, "<html><body text=\"#000000\" bgcolor=\"#FFFF88\"><font size=-1>"); //$NON-NLS-1$
-		}
-
-		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) {
-			}
-
-			return null;
-		}
-
-		private 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();
-		}
-
-		void startBulletList(StringBuffer buffer) {
-			buffer.append("<ul>"); //$NON-NLS-1$
-		}
-	}
-
-	private IDebugModelPresentation fDebugModelPresentation;
-
-	private HTMLPrinter printer = new HTMLPrinter();
-
-	/**
-	 * Returns the distance to the ruler line.
-	 */
-	private int compareRulerLine(Position position, IDocument document, int line) {
-
-		if (position.getOffset() > -1 && position.getLength() > -1) {
-			try {
-				int markerLine = document.getLineOfOffset(position.getOffset());
-				if (line == markerLine)
-					return 1;
-				if (markerLine <= line && line <= document.getLineOfOffset(position.getOffset() + position.getLength()))
-					return 2;
-			}
-			catch (BadLocationException x) {
-			}
-		}
-
-		return 0;
-	}
-
-	/*
-	 * Formats the message of this hover to fit onto the screen.
-	 */
-	private String formatHoverText(String text, ISourceViewer sourceViewer) {
-		String result = null;
-		String lineDelim = new String();
-		try {
-			lineDelim = sourceViewer.getDocument().getLineDelimiter(0);
-		}
-		catch (org.eclipse.jface.text.BadLocationException exception) {
-			// skip, just use default
-		}
-		Display display = sourceViewer.getTextWidget().getDisplay();
-
-		// replace special characters in text with html entity (like <, >, &
-		// to &lt;, &gt;, &&;)
-		text = StringUtils.convertToHTMLContent(text);
-
-		Reader textReader = new StringReader(text);
-		GC gc = new GC(display);
-		try {
-			StringBuffer buf = new StringBuffer();
-
-			StructuredTextLineBreakingReader reader = new StructuredTextLineBreakingReader(textReader, gc, getHoverWidth(display));
-			String line = reader.readLine();
-			while (line != null) {
-				if (buf.length() != 0) {
-					buf.append(lineDelim);
-				}
-				buf.append(line);
-				line = reader.readLine();
-			}
-			result = buf.toString();
-		}
-		catch (IOException exception) {
-			Logger.logException(exception);
-		}
-		finally {
-			gc.dispose();
-		}
-		return result;
-	}
-
-	/*
-	 * Formats several message as HTML text.
-	 */
-	private String formatMultipleHoverText(List messages) {
-
-		StringBuffer buffer = new StringBuffer();
-		printer.addPageProlog(buffer);
-		printer.addParagraph(buffer, SSEUIMessages.Multiple_errors); //$NON-NLS-1$
-
-		printer.startBulletList(buffer);
-		Iterator e = messages.iterator();
-		while (e.hasNext())
-			printer.addBullet(buffer, printer.convertToHTMLContent((String) e.next()));
-		printer.endBulletList(buffer);
-
-		printer.addPageEpilog(buffer);
-		return buffer.toString();
-	}
-
-	/**
-	 * @see IVerticalRulerHover#getHoverInfo(ISourceViewer, int)
-	 */
-	public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
-		IMarker marker = getMarker(sourceViewer, lineNumber);
-		List messages = new ArrayList(marker == null ? 0 : 1);
-		if (marker != null) {
-			String text = marker.getAttribute(IMarker.MESSAGE, (String) null);
-			if (text != null) {
-				messages.add(text);
-			}
-			else {
-				try {
-					if (marker.isSubtypeOf(IBreakpoint.BREAKPOINT_MARKER)) {
-						IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
-						IBreakpoint[] breakpoints = manager.getBreakpoints();
-						for (int i = 0; i < breakpoints.length; i++) {
-							IBreakpoint breakpoint = breakpoints[i];
-							if (breakpoint.getMarker().equals(marker)) {
-								if (fDebugModelPresentation == null) {
-									fDebugModelPresentation = DebugUITools.newDebugModelPresentation();
-								}
-								text = fDebugModelPresentation.getText(breakpoint);
-								if (text != null) {
-									messages.add(text);
-								}
-							}
-						}
-					}
-				}
-				catch (CoreException e) {
-					Logger.logException(e);
-				}
-			}
-		}
-		List temporaryAnnotations = getTemporaryAnnotationsForLine(sourceViewer, lineNumber);
-		for (int i = 0; i < temporaryAnnotations.size(); i++) {
-			String message = ((Annotation) temporaryAnnotations.get(i)).getText();
-			if (message != null) {
-				boolean duplicated = false;
-				for (int j = 0; j < messages.size(); j++)
-					duplicated = duplicated || messages.get(j).equals(message);
-				if (!duplicated) {
-					messages.add(message);
-				}
-
-			}
-			else
-				messages.add(((ITemporaryAnnotation) temporaryAnnotations.get(i)).toString());
-		}
-		if (messages.size() > 1)
-			return formatMultipleHoverText(messages);
-		else if (messages.size() > 0)
-			return formatHoverText(messages.get(0).toString(), sourceViewer);
-		else
-			return null;
-	}
-
-	private int getHoverWidth(Display display) {
-		Rectangle displayBounds = display.getBounds();
-		int hoverWidth = displayBounds.width - (display.getCursorLocation().x - displayBounds.x);
-		hoverWidth -= 12; // XXX: Add some space to the border, Revisit
-		if (hoverWidth < 200) {
-			hoverWidth = 200;
-		}
-		return hoverWidth;
-	}
-
-	/**
-	 * Returns one marker which includes the ruler's line of activity.
-	 */
-	private IMarker getMarker(ISourceViewer viewer, int line) {
-
-		IDocument document = viewer.getDocument();
-		IAnnotationModel model = viewer.getAnnotationModel();
-
-		if (model == null)
-			return null;
-
-		List exact = new ArrayList();
-		List including = new ArrayList();
-
-		Iterator e = model.getAnnotationIterator();
-		while (e.hasNext()) {
-			Object o = e.next();
-			if (o instanceof MarkerAnnotation) {
-				MarkerAnnotation a = (MarkerAnnotation) o;
-				switch (compareRulerLine(model.getPosition(a), document, line)) {
-					case 1 :
-						exact.add(a.getMarker());
-						break;
-					case 2 :
-						including.add(a.getMarker());
-						break;
-				}
-			}
-		}
-
-		return select(exact, including);
-	}
-
-	/**
-	 * Returns one marker which includes the ruler's line of activity.
-	 */
-	private List getTemporaryAnnotationsForLine(ISourceViewer viewer, int line) {
-
-		IDocument document = viewer.getDocument();
-		IAnnotationModel model = viewer.getAnnotationModel();
-
-		if (model == null)
-			return null;
-
-		List exact = new ArrayList();
-		List including = new ArrayList();
-
-		Iterator e = model.getAnnotationIterator();
-		while (e.hasNext()) {
-			Object o = e.next();
-			if (o instanceof ITemporaryAnnotation) {
-				ITemporaryAnnotation a = (ITemporaryAnnotation) o;
-				Position position = model.getPosition((Annotation) a);
-				if (position == null)
-					continue;
-
-				switch (compareRulerLine(position, document, line)) {
-					case 1 :
-						exact.add(a);
-						break;
-					case 2 :
-						including.add(a);
-						break;
-				}
-			}
-		}
-
-		return exact;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.IReleasable#release()
-	 */
-	public void release() {
-		if (fDebugModelPresentation != null) {
-			fDebugModelPresentation.dispose();
-		}
-	}
-
-	/**
-	 * Selects one marker from the two lists.
-	 */
-	private IMarker select(List firstChoice, List secondChoice) {
-		if (!firstChoice.isEmpty())
-			return (IMarker) firstChoice.get(0);
-		if (!secondChoice.isEmpty())
-			return (IMarker) secondChoice.get(0);
-		return null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextEditor.java
deleted file mode 100644
index e69de29..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextEditor.java
+++ /dev/null
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextLineBreakingReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextLineBreakingReader.java
deleted file mode 100644
index 1140fab..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextLineBreakingReader.java
+++ /dev/null
@@ -1,114 +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.sse.ui.internal;
-
-
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.swt.graphics.GC;
-
-/*
- * Not a real reader. Could change if requested
- */
-public class StructuredTextLineBreakingReader {
-	private GC fGC;
-	private int fIndex;
-	private String fLine;
-	private int fMaxWidth;
-
-	private BufferedReader fReader;
-
-	/**
-	 * Creates a reader that breaks an input text to fit in a given width.
-	 * 
-	 * @param reader
-	 *            Reader of the input text
-	 * @param gc
-	 *            The graphic context that defines the currently used font
-	 *            sizes
-	 * @param maxLineWidth
-	 *            The max width (pixes) where the text has to fit in
-	 */
-	public StructuredTextLineBreakingReader(Reader reader, GC gc, int maxLineWidth) {
-		fReader = new BufferedReader(reader);
-		fGC = gc;
-		fMaxWidth = maxLineWidth;
-		fLine = null;
-		fIndex = 0;
-	}
-
-	private int findNextBreakIndex(int currIndex) {
-		int currWidth = 0;
-		int lineLength = fLine.length();
-
-		while (currIndex < lineLength) {
-			char ch = fLine.charAt(currIndex);
-			int nextIndex = currIndex + 1;
-			// leading whitespaces are counted to the following word
-			if (Character.isWhitespace(ch)) {
-				while (nextIndex < lineLength && Character.isWhitespace(fLine.charAt(nextIndex))) {
-					nextIndex++;
-				}
-			}
-			while (nextIndex < lineLength && !Character.isWhitespace(fLine.charAt(nextIndex))) {
-				nextIndex++;
-			}
-			String word = fLine.substring(currIndex, nextIndex);
-			int wordWidth = fGC.textExtent(word).x;
-			int nextWidth = wordWidth + currWidth;
-			if (nextWidth > fMaxWidth && wordWidth < fMaxWidth) {
-				return currIndex;
-			}
-			currWidth = nextWidth;
-			currIndex = nextIndex;
-		}
-		return currIndex;
-	}
-
-	private int findWordBegin(int idx) {
-		while (idx < fLine.length() && Character.isWhitespace(fLine.charAt(idx))) {
-			idx++;
-		}
-		return idx;
-	}
-
-	/**
-	 * Reads the next line. The lengths of the line will not exceed the gived
-	 * maximum width.
-	 */
-	public String readLine() throws IOException {
-		if (fLine == null) {
-			String line = fReader.readLine();
-			if (line == null) {
-				return null;
-			}
-			int lineLen = fGC.textExtent(line).x;
-			if (lineLen < fMaxWidth) {
-				return line;
-			}
-			fLine = line;
-			fIndex = 0;
-		}
-		int breakIdx = findNextBreakIndex(fIndex);
-		String res = fLine.substring(fIndex, breakIdx);
-		if (breakIdx < fLine.length()) {
-			fIndex = findWordBegin(breakIdx);
-		} else {
-			fLine = null;
-		}
-		return res;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextSelectionChangedEvent.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextSelectionChangedEvent.java
deleted file mode 100644
index 1b1dfe0..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextSelectionChangedEvent.java
+++ /dev/null
@@ -1,35 +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.sse.ui.internal;
-
-
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-
-/**
- * This event is used by the SourceEditorTreeViewer to tell the
- * ViewerSelectionManager that the selection really came from a user click on
- * the content outliner, instead of being set programatically.
- */
-public class StructuredTextSelectionChangedEvent extends org.eclipse.jface.viewers.SelectionChangedEvent {
-
-	/**
-	 * Comment for <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-
-	public StructuredTextSelectionChangedEvent(ISelectionProvider source, ISelection selection) {
-		super(source, selection);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java
deleted file mode 100644
index e0801ed..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java
+++ /dev/null
@@ -1,757 +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.sse.ui.internal;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentAdapter;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewerExtension2;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.formatter.FormattingContext;
-import org.eclipse.jface.text.formatter.FormattingContextProperties;
-import org.eclipse.jface.text.formatter.IContentFormatterExtension;
-import org.eclipse.jface.text.formatter.IFormattingContext;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.information.IInformationPresenter;
-import org.eclipse.jface.text.projection.ProjectionDocument;
-import org.eclipse.jface.text.reconciler.IReconciler;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IOverviewRuler;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-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.IEditorStatusLine;
-import org.eclipse.wst.sse.core.internal.cleanup.StructuredContentCleanupHandler;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.undo.IDocumentSelectionMediator;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.core.internal.undo.UndoDocumentEvent;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-
-public class StructuredTextViewer extends ProjectionViewer implements IDocumentSelectionMediator {
-	/** Text operation codes */
-	private static final int BASE = ProjectionViewer.EXPAND_ALL; // see
-	// ProjectionViewer.EXPAND_ALL
-	private static final int CLEANUP_DOCUMENT = BASE + 1;
-	public static final int FORMAT_ACTIVE_ELEMENTS = BASE + 3;
-
-	private static final String FORMAT_ACTIVE_ELEMENTS_TEXT = SSEUIMessages.Format_Active_Elements_UI_; //$NON-NLS-1$
-	public static final int FORMAT_DOCUMENT = BASE + 2;
-	private static final String FORMAT_DOCUMENT_TEXT = SSEUIMessages.Format_Document_UI_; //$NON-NLS-1$
-	public static final int QUICK_FIX = BASE + 4;
-	private static final String TEXT_CUT = SSEUIMessages.Text_Cut_UI_; //$NON-NLS-1$
-	private static final String TEXT_PASTE = SSEUIMessages.Text_Paste_UI_; //$NON-NLS-1$
-	private static final String TEXT_SHIFT_LEFT = SSEUIMessages.Text_Shift_Left_UI_; //$NON-NLS-1$ = "Text Shift Left"
-	private static final String TEXT_SHIFT_RIGHT = SSEUIMessages.Text_Shift_Right_UI_; //$NON-NLS-1$ = "Text Shift Right"
-	private static final boolean TRACE_EXCEPTIONS = true;
-
-	private boolean fBackgroundupdateInProgress;
-	private StructuredContentCleanupHandler fContentCleanupHandler = null;
-	private IContentAssistant fCorrectionAssistant;
-	private boolean fCorrectionAssistantInstalled;
-	private IDocumentAdapter fDocAdapter;
-
-	private Highlighter fHighlighter;
-
-	// private ViewerSelectionManager fViewerSelectionManager;
-	private SourceViewerConfiguration fConfiguration;
-
-	/**
-	 * @see org.eclipse.jface.text.source.SourceViewer#SourceViewer(Composite,
-	 *      IVerticalRuler, IOverviewRuler, boolean, int)
-	 */
-	public StructuredTextViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles) {
-		super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles);
-	}
-
-	/**
-	 * 
-	 */
-	private void beep() {
-		getTextWidget().getDisplay().beep();
-	}
-
-	public void beginBackgroundUpdate() {
-		fBackgroundupdateInProgress = true;
-		disableRedrawing();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextOperationTarget#canDoOperation(int)
-	 */
-	public boolean canDoOperation(int operation) {
-		if (fBackgroundupdateInProgress) {
-			return false;
-		}
-		switch (operation) {
-			case CONTENTASSIST_PROPOSALS : {
-				// (pa) if position isn't READ_ONLY (containsReadOnly()
-				// returns false),
-				// Otherwise, you DO want content assist (return true)
-				IDocument doc = getDocument();
-				if (doc != null && doc instanceof IStructuredDocument) {
-					return isEditable() && (!((IStructuredDocument) doc).containsReadOnly(getSelectedRange().x, 0));
-				}
-				break;
-			}
-			case QUICK_FIX : {
-				return isEditable();
-			}
-			case CLEANUP_DOCUMENT : {
-				return (fContentCleanupHandler != null && isEditable());
-			}
-			case FORMAT_DOCUMENT :
-			case FORMAT_ACTIVE_ELEMENTS : {
-				return (fContentFormatter != null && isEditable());
-			}
-		}
-		return super.canDoOperation(operation);
-	}
-
-	/**
-	 * Should be identical to superclass version. Plus, we get our own special
-	 * Highlighter. Plus we uninstall before installing.
-	 */
-	public void configure(SourceViewerConfiguration configuration) {
-
-		if (getTextWidget() == null)
-			return;
-
-		setDocumentPartitioning(configuration.getConfiguredDocumentPartitioning(this));
-
-		// always uninstall highlighter and null it out on new configuration
-		if (fHighlighter != null) {
-			fHighlighter.uninstall();
-			fHighlighter = null;
-		}
-
-		// install content type independent plugins
-		if (fPresentationReconciler != null)
-			fPresentationReconciler.uninstall();
-		fPresentationReconciler = configuration.getPresentationReconciler(this);
-		if (fPresentationReconciler != null)
-			fPresentationReconciler.install(this);
-
-		IReconciler newReconciler = configuration.getReconciler(this);
-
-		if (newReconciler != fReconciler || newReconciler == null || fReconciler == null) {
-
-			if (fReconciler != null) {
-				fReconciler.uninstall();
-			}
-
-			fReconciler = newReconciler;
-
-			if (fReconciler != null) {
-				fReconciler.install(this);
-				// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3858
-				// still need set document on the reconciler (strategies)
-				((StructuredRegionProcessor) fReconciler).setDocument(getDocument());
-			}
-		}
-
-		IContentAssistant newAssistant = configuration.getContentAssistant(this);
-		if (newAssistant != fContentAssistant || newAssistant == null || fContentAssistant == null) {
-			if (fContentAssistant != null)
-				fContentAssistant.uninstall();
-
-			fContentAssistant = newAssistant;
-
-			if (fContentAssistant != null) {
-				fContentAssistant.install(this);
-				fContentAssistantInstalled = true;
-			}
-			else {
-				// 248036
-				// disable the content assist operation if no content
-				// assistant
-				enableOperation(CONTENTASSIST_PROPOSALS, false);
-			}
-		}
-
-		fContentFormatter = configuration.getContentFormatter(this);
-
-		// do not uninstall old information presenter if it's the same
-		IInformationPresenter newInformationPresenter = configuration.getInformationPresenter(this);
-		if (newInformationPresenter == null || fInformationPresenter == null || !(newInformationPresenter.equals(fInformationPresenter))) {
-			if (fInformationPresenter != null)
-				fInformationPresenter.uninstall();
-			fInformationPresenter = newInformationPresenter;
-			if (fInformationPresenter != null)
-				fInformationPresenter.install(this);
-		}
-
-		// disconnect from the old undo manager before setting the new one
-		if (fUndoManager != null) {
-			fUndoManager.disconnect();
-		}
-		setUndoManager(configuration.getUndoManager(this));
-
-		// release old annotation hover before setting new one
-		if (fAnnotationHover instanceof StructuredTextAnnotationHover) {
-			((StructuredTextAnnotationHover) fAnnotationHover).release();
-		}
-		setAnnotationHover(configuration.getAnnotationHover(this));
-
-		// release old annotation hover before setting new one
-		if (fOverviewRulerAnnotationHover instanceof StructuredTextAnnotationHover) {
-			((StructuredTextAnnotationHover) fOverviewRulerAnnotationHover).release();
-		}
-		setOverviewRulerAnnotationHover(configuration.getAnnotationHover(this));
-
-		getTextWidget().setTabs(configuration.getTabWidth(this));
-		setHoverControlCreator(configuration.getInformationControlCreator(this));
-
-		// if hyperlink manager has already been created, uninstall it
-		if (fHyperlinkManager != null) {
-			setHyperlinkDetectors(null, SWT.NONE);
-		}
-		setHyperlinkPresenter(configuration.getHyperlinkPresenter(this));
-		IHyperlinkDetector[] hyperlinkDetectors = configuration.getHyperlinkDetectors(this);
-		int eventStateMask = configuration.getHyperlinkStateMask(this);
-		setHyperlinkDetectors(hyperlinkDetectors, eventStateMask);
-
-		// install content type specific plugins
-		String[] types = configuration.getConfiguredContentTypes(this);
-
-		// clear autoindent/autoedit strategies
-		fAutoIndentStrategies = null;
-		for (int i = 0; i < types.length; i++) {
-			String t = types[i];
-			setAutoEditStrategies(configuration.getAutoEditStrategies(this, t), t);
-			setTextDoubleClickStrategy(configuration.getDoubleClickStrategy(this, t), t);
-
-			int[] stateMasks = configuration.getConfiguredTextHoverStateMasks(this, t);
-			if (stateMasks != null) {
-				for (int j = 0; j < stateMasks.length; j++) {
-					int stateMask = stateMasks[j];
-					setTextHover(configuration.getTextHover(this, t, stateMask), t, stateMask);
-				}
-			}
-			else {
-				setTextHover(configuration.getTextHover(this, t), t, ITextViewerExtension2.DEFAULT_HOVER_STATE_MASK);
-			}
-
-			String[] prefixes = configuration.getIndentPrefixes(this, t);
-			if (prefixes != null && prefixes.length > 0)
-				setIndentPrefixes(prefixes, t);
-
-			prefixes = configuration.getDefaultPrefixes(this, t);
-			if (prefixes != null && prefixes.length > 0)
-				setDefaultPrefixes(prefixes, t);
-
-			// add highlighter/linestyleprovider
-			if (configuration instanceof StructuredTextViewerConfiguration) {
-				LineStyleProvider[] providers = ((StructuredTextViewerConfiguration) configuration).getLineStyleProviders(this, t);
-				if (providers != null) {
-					for (int j = 0; j < providers.length; ++j) {
-						// delay creation of highlighter till
-						// linestyleprovider needs to be added
-						if (fHighlighter == null)
-							fHighlighter = new Highlighter();
-						fHighlighter.addProvider(t, providers[j]);
-					}
-				}
-			}
-		}
-
-		// initialize highlighter after linestyleproviders were added
-		if (fHighlighter != null) {
-			fHighlighter.setDocumentPartitioning(configuration.getConfiguredDocumentPartitioning(this));
-			fHighlighter.install(this);
-			fHighlighter.setDocument((IStructuredDocument) getDocument());
-		}
-
-		activatePlugins();
-
-		fConfiguration = configuration;
-	}
-
-	/**
-	 * @param document
-	 * @param startOffset
-	 * @param endOffset
-	 * @return
-	 */
-	private boolean containsReadOnly(IDocument document, int startOffset, int endOffset) {
-
-		int start = startOffset;
-		int end = endOffset;
-		IStructuredDocument structuredDocument = null;
-		if (document instanceof IStructuredDocument) {
-			structuredDocument = (IStructuredDocument) document;
-		}
-		else {
-			if (document instanceof ProjectionDocument) {
-				IDocument doc = ((ProjectionDocument) document).getMasterDocument();
-				if (doc instanceof IStructuredDocument) {
-					structuredDocument = (IStructuredDocument) doc;
-					int adjust = ((ProjectionDocument) document).getProjectionMapping().getCoverage().getOffset();
-					start = adjust + start;
-					end = adjust + end;
-				}
-			}
-		}
-		if (structuredDocument == null) {
-			return false;
-		}
-		else {
-			int length = end - start;
-			return structuredDocument.containsReadOnly(start, length);
-		}
-	}
-
-	protected IDocumentAdapter createDocumentAdapter() {
-
-		fDocAdapter = new StructuredDocumentToTextAdapter(getTextWidget());
-		return fDocAdapter;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextOperationTarget#doOperation(int)
-	 */
-	public void doOperation(int operation) {
-
-		Point selection = getTextWidget().getSelection();
-		int cursorPosition = selection.x;
-		int selectionLength = selection.y - selection.x;
-		switch (operation) {
-			case CUT :
-				beginRecording(TEXT_CUT, TEXT_CUT, cursorPosition, selectionLength);
-				super.doOperation(operation);
-				selection = getTextWidget().getSelection();
-				cursorPosition = selection.x;
-				selectionLength = selection.y - selection.x;
-				endRecording(cursorPosition, selectionLength);
-				break;
-			case PASTE :
-				beginRecording(TEXT_PASTE, TEXT_PASTE, cursorPosition, selectionLength);
-				super.doOperation(operation);
-				selection = getTextWidget().getSelection();
-				cursorPosition = selection.x;
-				selectionLength = selection.y - selection.x;
-				endRecording(cursorPosition, selectionLength);
-				break;
-			case CONTENTASSIST_PROPOSALS :
-				// maybe not configured?
-				if (fContentAssistant != null && isEditable()) {
-					// CMVC 263269
-					// need an explicit check here because the
-					// contentAssistAction is no longer being updated on
-					// cursor
-					// position
-					if (canDoOperation(CONTENTASSIST_PROPOSALS)) {
-						String err = fContentAssistant.showPossibleCompletions();
-						if (err != null) {
-							// don't wanna beep if there is no error
-							PlatformStatusLineUtil.displayErrorMessage(err);
-						}
-						PlatformStatusLineUtil.addOneTimeClearListener();
-					}
-					else
-						beep();
-				}
-				break;
-			case CONTENTASSIST_CONTEXT_INFORMATION :
-				if (fContentAssistant != null) {
-					String err = fContentAssistant.showContextInformation();
-					PlatformStatusLineUtil.displayErrorMessage(err);
-					PlatformStatusLineUtil.addOneTimeClearListener();
-					// setErrorMessage(err);
-					// new OneTimeListener(getTextWidget(), new
-					// ClearErrorMessage());
-				}
-				break;
-			case QUICK_FIX :
-				if (isEditable() && fCorrectionAssistant != null && fCorrectionAssistantInstalled) {
-					String msg = fCorrectionAssistant.showPossibleCompletions();
-					setErrorMessage(msg);
-				}
-				break;
-			case SHIFT_RIGHT :
-				beginRecording(TEXT_SHIFT_RIGHT, TEXT_SHIFT_RIGHT, cursorPosition, selectionLength);
-				updateIndentationPrefixes();
-				super.doOperation(SHIFT_RIGHT);
-				selection = getTextWidget().getSelection();
-				cursorPosition = selection.x;
-				selectionLength = selection.y - selection.x;
-				endRecording(cursorPosition, selectionLength);
-				break;
-			case SHIFT_LEFT :
-				beginRecording(TEXT_SHIFT_LEFT, TEXT_SHIFT_LEFT, cursorPosition, selectionLength);
-				updateIndentationPrefixes();
-				super.doOperation(SHIFT_LEFT);
-				selection = getTextWidget().getSelection();
-				cursorPosition = selection.x;
-				selectionLength = selection.y - selection.x;
-				endRecording(cursorPosition, selectionLength);
-				break;
-			case FORMAT_DOCUMENT :
-				try {
-					// begin recording
-					beginRecording(FORMAT_DOCUMENT_TEXT, FORMAT_DOCUMENT_TEXT, cursorPosition, selectionLength);
-
-					// format
-					IRegion region = getModelCoverage();
-					if (fContentFormatter instanceof IContentFormatterExtension) {
-						IContentFormatterExtension extension = (IContentFormatterExtension) fContentFormatter;
-						IFormattingContext context = new FormattingContext();
-						context.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.TRUE);
-						context.setProperty(FormattingContextProperties.CONTEXT_REGION, region);
-						extension.format(getDocument(), context);
-					}
-					else {
-						fContentFormatter.format(getDocument(), region);
-					}
-				}
-				finally {
-					// end recording
-					selection = getTextWidget().getSelection();
-					cursorPosition = selection.x;
-					selectionLength = selection.y - selection.x;
-					endRecording(cursorPosition, selectionLength);
-				}
-				break;
-			case FORMAT_ACTIVE_ELEMENTS :
-				try {
-					// begin recording
-					beginRecording(FORMAT_ACTIVE_ELEMENTS_TEXT, FORMAT_ACTIVE_ELEMENTS_TEXT, cursorPosition, selectionLength);
-
-					// format
-					Point s = getSelectedRange();
-					IRegion region = new Region(s.x, s.y);
-					fContentFormatter.format(getDocument(), region);
-				}
-				finally {
-					// end recording
-					selection = getTextWidget().getSelection();
-					cursorPosition = selection.x;
-					selectionLength = selection.y - selection.x;
-					endRecording(cursorPosition, selectionLength);
-				}
-				break;
-			default :
-				super.doOperation(operation);
-		}
-	}
-
-	private void endRecording(int cursorPosition, int selectionLength) {
-		IDocument doc = getDocument();
-		if (doc instanceof IStructuredDocument) {
-			IStructuredDocument structuredDocument = (IStructuredDocument) doc;
-			IStructuredTextUndoManager undoManager = structuredDocument.getUndoManager();
-			undoManager.endRecording(this, cursorPosition, selectionLength);
-		}
-		else {
-			// TODO: how to handle other document types?
-		}
-	}
-
-	private void beginRecording(String label, String description, int cursorPosition, int selectionLength) {
-		IDocument doc = getDocument();
-		if (doc instanceof IStructuredDocument) {
-			IStructuredDocument structuredDocument = (IStructuredDocument) doc;
-			IStructuredTextUndoManager undoManager = structuredDocument.getUndoManager();
-			undoManager.beginRecording(this, label, description, cursorPosition, selectionLength);
-		}
-		else {
-			// TODO: how to handle other document types?
-		}
-	}
-
-	public void endBackgroundUpdate() {
-		fBackgroundupdateInProgress = false;
-		enabledRedrawing();
-	}
-
-	protected void handleDispose() {
-		Logger.trace("Source Editor", "StructuredTextViewer::handleDispose entry"); //$NON-NLS-1$ //$NON-NLS-2$
-
-		// before we dispose, we set a special "empty" selection, to prevent
-		// the "leak one document" that
-		// otherwise occurs when editor closed (since last selection stays in
-		// SelectedResourceManager.
-		// the occurance of the "leak" isn't so bad, but makes debugging other
-		// leaks very hard.
-		setSelection(TextSelection.emptySelection());
-
-		if (fHighlighter != null) {
-			fHighlighter.uninstall();
-		}
-		super.handleDispose();
-
-		Logger.trace("Source Editor", "StructuredTextViewer::handleDispose exit"); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	/*
-	 * Overridden for special support of background update and read-only
-	 * regions
-	 */
-	protected void handleVerifyEvent(VerifyEvent e) {
-		IRegion modelRange = event2ModelRange(e);
-		if (exposeModelRange(modelRange)) {
-			e.doit = false;
-			return;
-		}
-
-		if (fEventConsumer != null) {
-			fEventConsumer.processEvent(e);
-			if (!e.doit)
-				return;
-		}
-		if (fBackgroundupdateInProgress) {
-			e.doit = false;
-			beep();
-			return;
-		}
-		// for read-only support
-		if (containsReadOnly(getVisibleDocument(), e.start, e.end)) {
-			e.doit = false;
-			beep();
-			return;
-		}
-
-		try {
-			super.handleVerifyEvent(e);
-		}
-		catch (Exception x) {
-			// note, we catch and log any exception,
-			// since an otherwise can actually prevent typing!
-			// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=111318
-
-			if (TRACE_EXCEPTIONS)
-				Logger.logException("StructuredTextViewer.exception.verifyText", x); //$NON-NLS-1$
-
-		}
-	}
-
-	public int modelLine2WidgetLine(int modelLine) {
-		/**
-		 * need to override this method as a workaround for Bug 85709
-		 */
-		if (fInformationMapping == null) {
-			IDocument document = getDocument();
-			if (document != null) {
-				try {
-					IRegion modelLineRegion = getDocument().getLineInformation(modelLine);
-					IRegion region = getModelCoverage();
-					if (modelLineRegion != null && region != null) {
-						int modelEnd = modelLineRegion.getOffset() + modelLineRegion.getLength();
-						int regionEnd = region.getOffset() + region.getLength();
-						// returns -1 if modelLine is invalid
-						if ((modelLineRegion.getOffset() < region.getOffset()) || (modelEnd > regionEnd))
-							return -1;
-					}
-				}
-				catch (BadLocationException e) {
-					// returns -1 if modelLine is invalid
-					return -1;
-				}
-			}
-		}
-		return super.modelLine2WidgetLine(modelLine);
-	}
-
-	public int modelOffset2WidgetOffset(int modelOffset) {
-		/**
-		 * need to override this method as a workaround for Bug 85709
-		 */
-		if (fInformationMapping == null) {
-			IRegion region = getModelCoverage();
-			if (region != null) {
-				// returns -1 if modelOffset is invalid
-				if (modelOffset < region.getOffset() || modelOffset > (region.getOffset() + region.getLength()))
-					return -1;
-			}
-		}
-		return super.modelOffset2WidgetOffset(modelOffset);
-	}
-
-	public IRegion modelRange2WidgetRange(IRegion modelRange) {
-		// need to override this method as workaround for Bug85709
-		if (fInformationMapping == null) {
-			IRegion region = getModelCoverage();
-			if (region != null && modelRange != null) {
-				int modelEnd = modelRange.getOffset() + modelRange.getLength();
-				int regionEnd = region.getOffset() + region.getLength();
-				// returns null if modelRange is invalid
-				if ((modelRange.getOffset() < region.getOffset()) || (modelEnd > regionEnd))
-					return null;
-			}
-		}
-		return super.modelRange2WidgetRange(modelRange);
-	}
-
-	/**
-	 * Sets the correction assistant for the viewer. This method is temporary
-	 * workaround until the base adds a generic way to add
-	 * quickfix/quickassist.
-	 * 
-	 * @param correctionAssistant
-	 */
-	public void setCorrectionAssistant(IContentAssistant correctionAssistant) {
-		// correction assistant
-		if (fCorrectionAssistant != null)
-			fCorrectionAssistant.uninstall();
-		fCorrectionAssistant = correctionAssistant;
-		if (fCorrectionAssistant != null) {
-			// configuration
-			if (fCorrectionAssistant instanceof ContentAssistant) {
-				((ContentAssistant) fCorrectionAssistant).setDocumentPartitioning(getDocumentPartitioning());
-			}
-
-			fCorrectionAssistant.install(this);
-			fCorrectionAssistantInstalled = true;
-		}
-		else {
-			// disable the correction assist operation if no correction
-			// assistant
-			enableOperation(QUICK_FIX, false);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.source.ISourceViewer#setDocument(org.eclipse.jface.text.IDocument,
-	 *      org.eclipse.jface.text.source.IAnnotationModel, int, int)
-	 */
-	public void setDocument(IDocument document, IAnnotationModel annotationModel, int modelRangeOffset, int modelRangeLength) {
-		// partial fix for:
-		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=1970
-		// when our document is set, especially to null during close,
-		// immediately uninstall the reconciler.
-		// this is to avoid an unnecessary final "reconcile"
-		// that blocks display thread
-		if (document == null) {
-			if (fReconciler != null) {
-				fReconciler.uninstall();
-			}
-		}
-
-		super.setDocument(document, annotationModel, modelRangeOffset, modelRangeLength);
-
-		if (document instanceof IStructuredDocument) {
-			IStructuredDocument structuredDocument = (IStructuredDocument) document;
-
-			// notify highlighter
-			if (fHighlighter != null) {
-				fHighlighter.setDocument(structuredDocument);
-			}
-
-			// set document in the viewer-based undo manager
-			if (fUndoManager != null) {
-				fUndoManager.disconnect();
-				fUndoManager.connect(this);
-			}
-			// CaretEvent is not sent to ViewerSelectionManager after Save As.
-			// Need to notify ViewerSelectionManager here.
-			// notifyViewerSelectionManager(getSelectedRange().x,
-			// getSelectedRange().y);
-		}
-	}
-
-	/**
-	 * Use the active editor to set a status line message
-	 * 
-	 * @param msg
-	 */
-	private void setErrorMessage(String msg) {
-		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-		if (window != null) {
-			IWorkbenchPage page = window.getActivePage();
-			if (page != null) {
-				IEditorPart editor = page.getActiveEditor();
-				if (editor != null) {
-					IEditorStatusLine statusLine = (IEditorStatusLine) editor.getAdapter(IEditorStatusLine.class);
-					if (statusLine != null)
-						statusLine.setMessage(true, msg, null);
-				}
-			}
-		}
-	}
-
-	/**
-	 * Uninstalls anything that was installed by configure
-	 */
-	public void unconfigure() {
-		Logger.trace("Source Editor", "StructuredTextViewer::unconfigure entry"); //$NON-NLS-1$ //$NON-NLS-2$
-		if (fHighlighter != null) {
-			fHighlighter.uninstall();
-		}
-		if (fCorrectionAssistant != null) {
-			fCorrectionAssistant.uninstall();
-		}
-
-		if (fAnnotationHover instanceof StructuredTextAnnotationHover) {
-			((StructuredTextAnnotationHover) fAnnotationHover).release();
-		}
-
-		if (fOverviewRulerAnnotationHover instanceof StructuredTextAnnotationHover) {
-			((StructuredTextAnnotationHover) fOverviewRulerAnnotationHover).release();
-		}
-
-		// doesn't seem to be handled elsewhere, so we'll be sure error
-		// messages's are cleared.
-		setErrorMessage(null);
-
-		super.unconfigure();
-		fConfiguration = null;
-		Logger.trace("Source Editor", "StructuredTextViewer::unconfigure exit"); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.undo.IDocumentSelectionMediator#undoOperationSelectionChanged(org.eclipse.wst.sse.core.undo.UndoDocumentEvent)
-	 */
-	public void undoOperationSelectionChanged(UndoDocumentEvent event) {
-		if (event.getRequester() != null && event.getRequester().equals(this) && event.getDocument().equals(getDocument()))
-			setSelectedRange(event.getOffset(), event.getLength());
-	}
-
-	/**
-	 * Make sure indentation is correct before using.
-	 */
-	private void updateIndentationPrefixes() {
-		SourceViewerConfiguration configuration = fConfiguration;
-		if (fConfiguration != null) {
-			String[] types = configuration.getConfiguredContentTypes(this);
-			for (int i = 0; i < types.length; i++) {
-				String[] prefixes = configuration.getIndentPrefixes(this, types[i]);
-				if (prefixes != null && prefixes.length > 0)
-					setIndentPrefixes(prefixes, types[i]);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TextDropAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TextDropAction.java
deleted file mode 100644
index 27d196e..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TextDropAction.java
+++ /dev/null
@@ -1,27 +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.sse.ui.internal;
-
-
-
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * TextDropAction
- */
-public class TextDropAction extends AbstractDropAction {
-	public boolean run(DropTargetEvent event, IEditorPart targetEditor) {
-		return insert((String) event.data, targetEditor);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TransferBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TransferBuilder.java
deleted file mode 100644
index 4d089d8..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TransferBuilder.java
+++ /dev/null
@@ -1,662 +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.sse.ui.internal;
-
-
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.wst.sse.ui.internal.extension.DropActionProxy;
-import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Builds drop target transfers, drag source transfers, and drop actions
- */
-public class TransferBuilder extends RegistryReader {
-
-	public static final String ATT_CLASS = "class"; //$NON-NLS-1$
-	public static final String ATT_ID = "id"; //$NON-NLS-1$
-	public static final String ATT_METHOD = "method"; //$NON-NLS-1$
-	public static final String ATT_PRIORITY = "priority"; //$NON-NLS-1$
-	public static final String ATT_SINGLETON = "singleton"; //$NON-NLS-1$
-	public static final String ATT_TARGET_ID = "targetID"; //$NON-NLS-1$
-	public static final String ATT_TRANSFER_ID = "transferID"; //$NON-NLS-1$
-
-	private final static boolean debugTime = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/transferbuilder/time")); //$NON-NLS-1$  //$NON-NLS-2$
-
-	public static final String PL_DRAG_SOURCE_TRANSFERS = "dragSourceTransfers"; //$NON-NLS-1$
-	public static final String PL_DROP_TARGET_TRANSFERS = "dropTargetTransfers"; //$NON-NLS-1$
-
-	public static final String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
-
-	public static final String[] PRIORITIES = {"highest", "high", "mid", "low", "lowest"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-
-	public static final String TAG_DRAG_SOURCE_CONTRIBUTION = "dragSourceContribution"; //$NON-NLS-1$
-	public static final String TAG_DROP_ACTION = "dropAction"; //$NON-NLS-1$
-	public static final String TAG_DROP_TARGET_CONTRIBUTION = "dropTargetContribution"; //$NON-NLS-1$
-
-	public static final String TAG_TRANSFER = "transfer"; //$NON-NLS-1$
-
-	public static final String TRUE = "true"; //$NON-NLS-1$
-
-	private boolean useProxy;
-
-	class TransferProxyForDelayLoading extends Transfer {
-	    private IConfigurationElement element;
-	    private String classAttribute;
-	    private Transfer proxy;
-        private Method getTypeIdsMethod, getTypeNamesMethod, javaToNativeMethod, nativeToJavaMethod;
-
-	    TransferProxyForDelayLoading() {
-	        super();
-	    }
-
-	    TransferProxyForDelayLoading(IConfigurationElement elm, String clsAttr) {
-	        super();
-	        this.element = elm;
-	        this.classAttribute = clsAttr;
-	    }
-	    
-	    private Transfer newInstance() {
-	        if ((element != null) && (classAttribute != null)) {
-		        Object o = createExtension(element, classAttribute);
-		        if (o instanceof Transfer) {
-		            element = null;
-		            classAttribute = null;
-		            return (Transfer)o;
-		        }
-	        }
-	        return null;
-	    }
-
-	    public TransferData[] getSupportedTypes() {
-	        if (proxy == null) {
-	            proxy = newInstance();
-	        }
-	        if (proxy != null) {
-	            return proxy.getSupportedTypes();
-	        }
-	        return new TransferData[0];
-        }
-        protected int[] getTypeIds() {
-	        if (proxy == null) {
-	            proxy = newInstance();
-	        }
-	        if (proxy != null) {
-                if (getTypeIdsMethod == null) {
-    	            Class runtimeClass = proxy.getClass();
-                    NoSuchMethodException e = null;
-                    while (runtimeClass != null) {
-        	            try {
-        	                getTypeIdsMethod = runtimeClass.getDeclaredMethod("getTypeIds", new Class[0]);//$NON-NLS-1$
-                            getTypeIdsMethod.setAccessible(true);
-                            break;
-        	            } catch (NoSuchMethodException e1) {
-                            e = e1;
-                            runtimeClass = runtimeClass.getSuperclass();
-        	            } catch (SecurityException e2) {
-                            runtimeClass = runtimeClass.getSuperclass();
-        	            }
-                    }
-                    if ((getTypeIdsMethod == null) && (e != null)) {
-                        Logger.logException(e);
-                    }
-                }
-                if (getTypeIdsMethod != null) {
-                    try {
-                         // changed Integer[] return type to int[]
-                        int[] r = (int[])getTypeIdsMethod.invoke(proxy, new Object[0]);
-                        if ((r != null) && (r.length > 0)) {
-                            int[] ret = new int[r.length];
-                            for(int i = 0; i < r.length; i++) {
-                                ret[i] = r[i];
-                            }
-                            return ret;
-                        }
-                    } catch (IllegalAccessException e2) {
-                        Logger.logException(e2);
-                    } catch (InvocationTargetException e3) {
-                        Logger.logException(e3);
-                    }
-                }
-	        }
-            return new int[0];
-        }
-        protected String[] getTypeNames() {
-	        if (proxy == null) {
-	            proxy = newInstance();
-	        }
-	        if (proxy != null) {
-                if (getTypeNamesMethod == null) {
-    	            Class runtimeClass = proxy.getClass();
-                    NoSuchMethodException e = null;
-                    while (runtimeClass != null) {
-        	            try {
-        	                getTypeNamesMethod = runtimeClass.getDeclaredMethod("getTypeNames", new Class[0]);//$NON-NLS-1$
-                            getTypeNamesMethod.setAccessible(true);
-                            break;
-        	            } catch (NoSuchMethodException e1) {
-                            e = e1;
-                            runtimeClass = runtimeClass.getSuperclass();
-        	            } catch (SecurityException e2) {
-                            runtimeClass = runtimeClass.getSuperclass();
-        	            }
-                    }
-                    if ((getTypeNamesMethod == null) && (e != null)) {
-                        Logger.logException(e);
-                    }
-                }
-                if (getTypeNamesMethod != null) {
-                    try {
-                        return (String[])getTypeNamesMethod.invoke(proxy, new Object[0]);
-                    } catch (IllegalAccessException e2) {
-                        Logger.logException(e2);
-                    } catch (InvocationTargetException e3) {
-                        Logger.logException(e3);
-                    }
-                }
-	        }
-            return new String[0];
-        }
-        public boolean isSupportedType(TransferData transferData) {
-	        if (proxy == null) {
-	            proxy = newInstance();
-	        }
-	        if (proxy != null) {
-	            return proxy.isSupportedType(transferData);
-	        }
-            return false;
-        }
-        protected void javaToNative(Object object, TransferData transferData) {
-	        if (proxy == null) {
-	            proxy = newInstance();
-	        }
-	        if (proxy != null) {
-                if (javaToNativeMethod == null) {
-                    Class runtimeClass = proxy.getClass();
-                    NoSuchMethodException e = null;
-                    while (runtimeClass != null) {
-        	            try {
-        	                javaToNativeMethod = runtimeClass.getDeclaredMethod("javaToNative", new Class[]{object.getClass(), transferData.getClass()});//$NON-NLS-1$
-        	                javaToNativeMethod.setAccessible(true);
-                            break;
-        	            } catch (NoSuchMethodException e1) {
-                            e = e1;
-                            runtimeClass = runtimeClass.getSuperclass();
-        	            } catch (SecurityException e2) {
-                            runtimeClass = runtimeClass.getSuperclass();
-        	            }
-                    }
-                    if ((javaToNativeMethod == null) && (e != null)) {
-                        Logger.logException(e);
-                    }
-                }
-                if (javaToNativeMethod != null) {
-                    try {
-                        javaToNativeMethod.invoke(proxy, new Object[]{object, transferData});
-                    } catch (IllegalAccessException e2) {
-                        Logger.logException(e2);
-                    } catch (InvocationTargetException e3) {
-                        Logger.logException(e3);
-                    }
-                }
-	        }
-        }
-        protected Object nativeToJava(TransferData transferData) {
-	        if (proxy == null) {
-	            proxy = newInstance();
-	        }
-	        if (proxy != null) {
-                if (nativeToJavaMethod == null) {
-                    Class runtimeClass = proxy.getClass();
-                    NoSuchMethodException e = null;
-                    while (runtimeClass != null) {
-                        try {
-                            nativeToJavaMethod = runtimeClass.getDeclaredMethod("nativeToJava", new Class[]{transferData.getClass()});//$NON-NLS-1$
-                            nativeToJavaMethod.setAccessible(true);
-                            break;
-                        } catch (NoSuchMethodException e1) {
-                            e = e1;
-                            runtimeClass = runtimeClass.getSuperclass();
-        	            } catch (SecurityException e2) {
-                            runtimeClass = runtimeClass.getSuperclass();
-        	            }
-                    }
-                    if ((nativeToJavaMethod == null) && (e != null)) {
-                        Logger.logException(e);
-                    }
-                }
-                if (nativeToJavaMethod != null) {
-                    try {
-    	                return nativeToJavaMethod.invoke(proxy, new Object[]{transferData});
-    	            } catch (IllegalAccessException e2) {
-                   		Logger.logException(e2);
-    	            } catch (InvocationTargetException e3) {
-                   		Logger.logException(e3);
-    	            }
-                }
-	        }
-            return new Object();
-        }
-        Transfer getTransferClass() {
-	        if (proxy == null) {
-	            proxy = newInstance();
-	        }
-	        return proxy;
-        }
-	}
-	/**
-	 * @param element
-	 * @param classAttribute
-	 * @return Object
-	 * @throws CoreException
-	 */
-	static Object createExecutableExtension(final IConfigurationElement element, final String classAttribute) throws CoreException {
-
-		Object obj = null;
-
-		String singleton = element.getAttribute(ATT_SINGLETON);
-		String method = element.getAttribute(ATT_METHOD);
-		if (TRUE.equalsIgnoreCase(singleton) && method != null) {
-			try {
-				String name = element.getAttribute(ATT_CLASS);
-				String pluginId = element.getDeclaringExtension().getNamespace();
-				Class cls = Platform.getBundle(pluginId).loadClass(name);
-				Method mtd = cls.getMethod(method, new Class[]{});
-
-				obj = mtd.invoke(null, null);
-			} catch (ClassNotFoundException e) {
-				obj = null;
-			} catch (NoSuchMethodException e) {
-				obj = null;
-			} catch (IllegalAccessException e) {
-				obj = null;
-			} catch (InvocationTargetException e) {
-				obj = null;
-			}
-		} else {
-			obj = element.createExecutableExtension(classAttribute);
-		}
-
-		return obj;
-	}
-
-	/**
-	 * Creates an extension. If the extension plugin has not been loaded a
-	 * busy cursor will be activated during the duration of the load.
-	 * 
-	 * @param element
-	 * @param classAttribute
-	 * @return Object
-	 * @throws CoreException
-	 */
-	public static Object createExtension(final IConfigurationElement element, final String classAttribute) {
-		// If plugin has been loaded create extension.
-		// Otherwise, show busy cursor then create extension.
-		final Object[] result = new Object[1];
-		String pluginId = element.getDeclaringExtension().getNamespace();
-		Bundle bundle = Platform.getBundle(pluginId);
-		if (bundle.getState() == Bundle.ACTIVE) {
-			try {
-				return createExecutableExtension(element, classAttribute);
-			} catch (CoreException e) {
-				handleCreateExecutableException(result, e);
-			}
-		} else {
-			BusyIndicator.showWhile(null, new Runnable() {
-				public void run() {
-					try {
-						result[0] = createExecutableExtension(element, classAttribute);
-					} catch (Exception e) {
-						handleCreateExecutableException(result, e);
-					}
-				}
-			});
-		}
-		return result[0];
-	}
-
-	/**
-	 * @param result
-	 * @param e
-	 */
-	protected static void handleCreateExecutableException(Object[] result, Throwable e) {
-		Logger.logException(e);
-		result[0] = null;
-
-	}
-
-	protected List cache;
-	protected String targetContributionTag;
-
-	protected List targetIDs;
-
-	/**
-	 * @param element
-	 * @return IDropAction
-	 */
-	protected IDropAction createDropAction(IConfigurationElement element) {
-		Object obj = null;
-		obj = createExtension(element, ATT_CLASS);
-		if (obj == null)
-			return null;
-		return (obj instanceof IDropAction) ? (IDropAction) DropActionProxy.newInstance(obj) : null;
-	}
-
-	/**
-	 * @param transferId
-	 * @return IDropAction[]
-	 */
-	protected IDropAction[] createDropActions(String transferId) {
-		if (cache == null)
-			return new IDropAction[0];
-
-		final int num = cache.size();
-		if (num == 0)
-			return new IDropAction[0];
-
-		IDropAction[] as = new IDropAction[num];
-		int j = 0;
-		for (int p = 0; p < PRIORITIES.length; p++) {
-			for (int i = 0; i < num; i++) {
-				Object obj = cache.get(i);
-				if (!(obj instanceof IConfigurationElement))
-					continue;
-
-				IConfigurationElement element = (IConfigurationElement) obj;
-				if (!(TAG_DROP_ACTION.equals(element.getName())) || !(transferId.equals(element.getAttribute(ATT_TRANSFER_ID))))
-					continue;
-
-				if (PRIORITIES[p].equals(element.getAttribute(ATT_PRIORITY)) || (p == 2 && element.getAttribute(ATT_PRIORITY) == null)) {
-					IDropAction a = createDropAction(element);
-					if (a != null) {
-						as[j] = a;
-						j++;
-					}
-				}
-			}
-		}
-
-		if (num == j)
-			return as;
-
-		IDropAction[] as2 = new IDropAction[j];
-		for (int i = 0; i < j; i++) {
-			as2[i] = as[i];
-		}
-
-		return as2;
-	}
-
-	/**
-	 * @param element
-	 * @return Transfer
-	 */
-	protected Transfer createTransfer(IConfigurationElement element) {
-	    Object obj = null;
-	    if (useProxy) {
-	        obj = new TransferProxyForDelayLoading(element, ATT_CLASS);
-	    } else {
-	        obj = createExtension(element, ATT_CLASS);
-	    }
-		if (obj == null)
-			return null;
-		return (obj instanceof Transfer) ? (Transfer) obj : null;
-	}
-
-	/**
-	 * @return Transfer[]
-	 */
-	protected Transfer[] createTransfers() {
-		if (cache == null)
-			return new Transfer[0];
-
-		final int num = cache.size();
-		if (num == 0)
-			return new Transfer[0];
-
-		Transfer[] ts = new Transfer[num];
-		int j = 0;
-		for (int p = 0; p < PRIORITIES.length; p++) {
-			for (int i = 0; i < num; i++) {
-				Object obj = cache.get(i);
-				if (!(obj instanceof IConfigurationElement))
-					continue;
-
-				IConfigurationElement element = (IConfigurationElement) obj;
-				if (!TAG_TRANSFER.equals(element.getName()))
-					continue;
-
-				if (PRIORITIES[p].equals(element.getAttribute(ATT_PRIORITY)) || (p == 2 && element.getAttribute(ATT_PRIORITY) == null)) {
-					Transfer t = createTransfer(element);
-					if (t != null) {
-						ts[j] = t;
-						j++;
-					}
-				}
-			}
-		}
-
-		if (num == j)
-			return ts;
-
-		Transfer[] ts2 = new Transfer[j];
-		for (int i = 0; i < j; i++) {
-			ts2[i] = ts[i];
-		}
-
-		return ts2;
-	}
-
-	/**
-	 * @param editorId
-	 * @return Transfer[]
-	 */
-	public Transfer[] getDragSourceTransfers(String editorId) {
-		return getDragSourceTransfers(new String[]{editorId});
-	}
-
-	/**
-	 * @param editorIds
-	 * @return Transfer[]
-	 */
-	public Transfer[] getDragSourceTransfers(String[] editorIds) {
-		long time0 = System.currentTimeMillis();
-		readContributions(editorIds, TAG_DRAG_SOURCE_CONTRIBUTION, PL_DRAG_SOURCE_TRANSFERS);
-		Transfer[] transfers = createTransfers();
-		if (debugTime)
-			System.out.println(getClass().getName() + "#getDragSourceTransfers(" + editorIds + "): " + transfers.length + " transfers created in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		return transfers;
-	}
-
-	/**
-	 * @deprecated use getDropActions(String editorId, Transfer transfer) for the performance
-	 * @param editorId
-	 * @param className
-	 * @return IDropAction[]
-	 */
-	public IDropAction[] getDropActions(String editorId, String transferClassName) {
-		return getDropActions(new String[]{editorId}, transferClassName);
-	}
-	
-	/**
-	 * @param editorId
-	 * @param class
-	 * @return IDropAction[]
-	 */
-	public IDropAction[] getDropActions(String editorId, Transfer transfer) {
-		return getDropActions(new String[]{editorId}, transfer);
-	}
-	/**
-	 * @deprecated use getDropActions(String[] editorIds, Transfer transfer) for the performance
-	 * @param editorId
-	 * @param className
-	 * @return IDropAction[]
-	 */
-	public IDropAction[] getDropActions(String[] editorIds, String transferClassName) {
-		long time0 = System.currentTimeMillis();
-		readContributions(editorIds, TAG_DROP_TARGET_CONTRIBUTION, PL_DROP_TARGET_TRANSFERS);
-		String transferId = getTransferIdOfClassName(transferClassName);
-		IDropAction[] actions = createDropActions(transferId);
-		if (debugTime)
-			System.out.println(getClass().getName() + "#getDropActions(" + editorIds + "): " + actions.length + " drop actions created in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		return actions;
-	}
-
-	/**
-	 * @param editorId
-	 * @param class
-	 * @return IDropAction[]
-	 */
-	public IDropAction[] getDropActions(String[] editorIds, Transfer transfer) {
-	    String transferClassName;
-	    if (transfer instanceof TransferProxyForDelayLoading) {
-	        transferClassName = ((TransferProxyForDelayLoading)transfer).getTransferClass().getClass().getName();
-	    } else {
-	        transferClassName = transfer.getClass().getName();
-	    }
-	    return getDropActions(editorIds, transferClassName);
-	}
-	/**
-	 * @param editorId
-	 * @return Transfer[]
-	 */
-	public Transfer[] getDropTargetTransfers(String editorId) {
-		return getDropTargetTransfers(new String[]{editorId});
-	}
-
-	/**
-	 * @param editorIds
-	 * @return Transfer[]
-	 */
-	public Transfer[] getDropTargetTransfers(String[] editorIds) {
-		long time0 = System.currentTimeMillis();
-		readContributions(editorIds, TAG_DROP_TARGET_CONTRIBUTION, PL_DROP_TARGET_TRANSFERS);
-		Transfer[] transfers = createTransfers();
-		if (debugTime) {
-			String idlist = ""; //$NON-NLS-1$
-			if (editorIds.length > 0) {
-				for (int i = 0; i < editorIds.length; i++) {
-					idlist += editorIds[i];
-					if (i < editorIds.length - 1)
-						idlist += ","; //$NON-NLS-1$
-				}
-			}
-			System.out.println(getClass().getName() + "#getDropTargetTransfers(" + idlist + "): " + transfers.length + " transfers created in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		}
-		return transfers;
-	}
-
-	/**
-	 * Returns the name of the part ID attribute that is expected in the
-	 * target extension.
-	 * 
-	 * @param element
-	 * @return String
-	 */
-	protected String getTargetID(IConfigurationElement element) {
-		String value = element.getAttribute(ATT_TARGET_ID);
-		return value != null ? value : "???"; //$NON-NLS-1$
-	}
-
-	/**
-	 * @param className
-	 * @return String
-	 */
-	private String getTransferIdOfClassName(String className) {
-		String id = ""; //$NON-NLS-1$
-		final int num = cache.size();
-		if (className == null || cache == null || num == 0)
-			return id;
-
-		for (int i = 0; i < num; i++) {
-			Object obj = cache.get(i);
-			if (obj instanceof IConfigurationElement) {
-				IConfigurationElement element = (IConfigurationElement) obj;
-				if (className.equals(element.getAttribute(ATT_CLASS))) {
-					id = element.getAttribute(ATT_ID);
-					break;
-				}
-			}
-		}
-
-		return (id.length() != 0 ? id : className);
-	}
-
-	/**
-	 * Reads the contributions from the registry for the provided workbench
-	 * part and the provided extension point ID.
-	 * 
-	 * @param id
-	 * @param tag
-	 * @param extensionPoint
-	 */
-	protected void readContributions(String[] ids, String tag, String extensionPoint) {
-		cache = null;
-		targetIDs = Arrays.asList(ids);
-		targetContributionTag = tag;
-		IExtensionRegistry registry = Platform.getExtensionRegistry();
-		readRegistry(registry, PLUGIN_ID, extensionPoint);
-	}
-
-	protected boolean readElement(IConfigurationElement element) {
-		String tag = element.getName();
-		if (tag.equals(targetContributionTag)) {
-			String id = getTargetID(element);
-			if (id == null || !targetIDs.contains(id)) {
-				// This is not of interest to us - don't go deeper
-				return true;
-			}
-		} else if (tag.equals(TAG_TRANSFER)) {
-			if (cache == null)
-				cache = new ArrayList();
-			cache.add(element);
-			return true; // just cache the element - don't go into it
-		} else if (tag.equals(TAG_DROP_ACTION)) {
-			if (cache == null)
-				cache = new ArrayList();
-			//cache.add(createActionDescriptor(element));
-			cache.add(element);
-			return true; // just cache the action - don't go into
-		} else {
-			return false;
-		}
-
-		readElementChildren(element);
-		return true;
-	}
-	/**
-	 * @deprecated - use TransferBuilder(boolean useProxy) for the performance
-	 */
-	public TransferBuilder() {
-        this(false);
-    }
-
-    public TransferBuilder(boolean useProxy) {
-        super();
-        this.useProxy = useProxy;
-    }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/UnknownContentTypeDialog.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/UnknownContentTypeDialog.java
deleted file mode 100644
index 9bd2f89..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/UnknownContentTypeDialog.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.eclipse.wst.sse.ui.internal;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-
-/**
- * Message dialog informing user that an editor was open on unsupported
- * content type
- */
-public class UnknownContentTypeDialog extends MessageDialogWithToggle {
-
-	public UnknownContentTypeDialog(Shell parent, IPreferenceStore store, String key) {
-		// set message to null in super so that message does not appear twice
-		super(parent, SSEUIMessages.UnknownContentTypeDialog_0, null, null, INFORMATION, new String[]{IDialogConstants.OK_LABEL}, 0, SSEUIMessages.UnknownContentTypeDialog_1, false);
-		setPrefStore(store);
-		setPrefKey(key);
-	}
-
-	protected void buttonPressed(int buttonId) {
-		super.buttonPressed(buttonId);
-
-		// overwritten so that value stored is boolean, not string
-		if (buttonId != IDialogConstants.CANCEL_ID && getToggleState() && getPrefStore() != null && getPrefKey() != null) {
-			switch (buttonId) {
-				case IDialogConstants.YES_ID :
-				case IDialogConstants.YES_TO_ALL_ID :
-				case IDialogConstants.PROCEED_ID :
-				case IDialogConstants.OK_ID :
-					getPrefStore().setValue(getPrefKey(), false);
-					break;
-				case IDialogConstants.NO_ID :
-				case IDialogConstants.NO_TO_ALL_ID :
-					getPrefStore().setValue(getPrefKey(), true);
-					break;
-			}
-		}
-
-	}
-
-	protected Control createMessageArea(Composite composite) {
-		super.createMessageArea(composite);
-		Link messageLink = new Link(composite, SWT.NONE);
-		messageLink.setText(SSEUIMessages.UnknownContentTypeDialog_2);
-		messageLink.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				linkClicked();
-			}
-		});
-		return composite;
-	}
-
-	private void linkClicked() {
-		String pageId = "org.eclipse.ui.preferencePages.ContentTypes"; //$NON-NLS-1$
-		PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[]{pageId}, null);
-		dialog.open();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java
deleted file mode 100644
index b34e301..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java
+++ /dev/null
@@ -1,377 +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.sse.ui.internal.actions;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.editors.text.TextEditorActionContributor;
-import org.eclipse.ui.ide.IDEActionFactory;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.ITextEditorExtension;
-import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder;
-import org.eclipse.wst.sse.ui.internal.GotoAnnotationAction;
-import org.eclipse.wst.sse.ui.internal.IExtendedContributor;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.ui.OffsetStatusLineContributionItem;
-
-/**
- * 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 ActionContributor extends TextEditorActionContributor implements ISourceViewerActionBarContributor, IExtendedContributor {
-
-	public static final boolean _showDebugStatus = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/actioncontributor/debugstatusfields")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private static final String[] EDITOR_IDS = {"org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$
-
-	protected IExtendedContributor extendedContributor;
-	protected RetargetTextEditorAction fAddBlockComment = null;
-
-	protected Separator fCommandsSeparator = null;
-
-	private OffsetStatusLineContributionItem fDebugStatusOffset = null;
-	protected MenuManager fExpandSelectionToMenu = null;
-	protected GroupMarker fMenuAdditionsGroupMarker = null;
-	protected GotoAnnotationAction fNextAnnotation = null;
-
-	protected GotoAnnotationAction fPreviousAnnotation = null;
-	protected RetargetTextEditorAction fRemoveBlockComment = null;
-	protected RetargetTextEditorAction fShiftLeft = null;
-	protected RetargetTextEditorAction fShiftRight = null;
-	protected RetargetTextEditorAction fStructureSelectEnclosingAction = null;
-	protected RetargetTextEditorAction fStructureSelectHistoryAction = null;
-	protected RetargetTextEditorAction fStructureSelectNextAction = null;
-	protected RetargetTextEditorAction fStructureSelectPreviousAction = null;
-
-	protected RetargetTextEditorAction fToggleComment = null;
-	protected RetargetTextEditorAction fToggleInsertModeAction;
-	protected GroupMarker fToolbarAdditionsGroupMarker = null;
-	protected Separator fToolbarSeparator = null;
-
-	public ActionContributor() {
-		super();
-
-		ResourceBundle resourceBundle = SSEUIMessages.getResourceBundle();
-
-		fCommandsSeparator = new Separator();
-
-		// edit commands
-		fStructureSelectEnclosingAction = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_ENCLOSING + StructuredTextEditorActionConstants.DOT);
-		fStructureSelectEnclosingAction.setActionDefinitionId(ActionDefinitionIds.STRUCTURE_SELECT_ENCLOSING);
-
-		fStructureSelectNextAction = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_NEXT + StructuredTextEditorActionConstants.DOT);
-		fStructureSelectNextAction.setActionDefinitionId(ActionDefinitionIds.STRUCTURE_SELECT_NEXT);
-
-		fStructureSelectPreviousAction = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_PREVIOUS + StructuredTextEditorActionConstants.DOT);
-		fStructureSelectPreviousAction.setActionDefinitionId(ActionDefinitionIds.STRUCTURE_SELECT_PREVIOUS);
-
-		fStructureSelectHistoryAction = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_HISTORY + StructuredTextEditorActionConstants.DOT);
-		fStructureSelectHistoryAction.setActionDefinitionId(ActionDefinitionIds.STRUCTURE_SELECT_HISTORY);
-
-		fExpandSelectionToMenu = new MenuManager(SSEUIMessages.ExpandSelectionToMenu_label); //$NON-NLS-1$
-		fExpandSelectionToMenu.add(fStructureSelectEnclosingAction);
-		fExpandSelectionToMenu.add(fStructureSelectNextAction);
-		fExpandSelectionToMenu.add(fStructureSelectPreviousAction);
-		fExpandSelectionToMenu.add(fStructureSelectHistoryAction);
-
-		// source commands
-		fShiftRight = new RetargetTextEditorAction(resourceBundle, ITextEditorActionConstants.SHIFT_RIGHT + StructuredTextEditorActionConstants.DOT);
-		fShiftRight.setActionDefinitionId(ITextEditorActionDefinitionIds.SHIFT_RIGHT);
-
-		fShiftLeft = new RetargetTextEditorAction(resourceBundle, ITextEditorActionConstants.SHIFT_LEFT + StructuredTextEditorActionConstants.DOT);
-		fShiftLeft.setActionDefinitionId(ITextEditorActionDefinitionIds.SHIFT_LEFT);
-
-		fToggleComment = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_TOGGLE_COMMENT + StructuredTextEditorActionConstants.DOT);
-		fToggleComment.setActionDefinitionId(ActionDefinitionIds.TOGGLE_COMMENT);
-
-		fAddBlockComment = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_ADD_BLOCK_COMMENT + StructuredTextEditorActionConstants.DOT);
-		fAddBlockComment.setActionDefinitionId(ActionDefinitionIds.ADD_BLOCK_COMMENT);
-
-		fRemoveBlockComment = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_REMOVE_BLOCK_COMMENT + StructuredTextEditorActionConstants.DOT);
-		fRemoveBlockComment.setActionDefinitionId(ActionDefinitionIds.REMOVE_BLOCK_COMMENT);
-
-		// goto prev/next error
-		// CMVC 249017 for JavaEditor consistancy
-		fPreviousAnnotation = new GotoAnnotationAction("Previous_annotation", false); //$NON-NLS-1$
-		fPreviousAnnotation.setActionDefinitionId("org.eclipse.ui.navigate.previous"); //$NON-NLS-1$
-
-		fNextAnnotation = new GotoAnnotationAction("Next_annotation", true); //$NON-NLS-1$
-		fNextAnnotation.setActionDefinitionId("org.eclipse.ui.navigate.next"); //$NON-NLS-1$
-
-		// Read action extensions.
-		ExtendedEditorActionBuilder builder = new ExtendedEditorActionBuilder();
-		extendedContributor = builder.readActionExtensions(getExtensionIDs());
-
-		fMenuAdditionsGroupMarker = new GroupMarker(StructuredTextEditorActionConstants.GROUP_NAME_MENU_ADDITIONS);
-		fToolbarSeparator = new Separator();
-		fToolbarAdditionsGroupMarker = new GroupMarker(StructuredTextEditorActionConstants.GROUP_NAME_TOOLBAR_ADDITIONS);
-
-		fToggleInsertModeAction = new RetargetTextEditorAction(resourceBundle, "Editor.ToggleInsertMode.", IAction.AS_CHECK_BOX); //$NON-NLS-1$
-		fToggleInsertModeAction.setActionDefinitionId(ITextEditorActionDefinitionIds.TOGGLE_INSERT_MODE);
-
-		if (_showDebugStatus) {
-			fDebugStatusOffset = new OffsetStatusLineContributionItem(StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET, true, 20);
-		}
-	}
-
-	protected void addToMenu(IMenuManager menu) {
-		// edit commands
-		IMenuManager editMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
-		if (editMenu != null) {
-			editMenu.add(fCommandsSeparator);
-			editMenu.add(fToggleInsertModeAction);
-			editMenu.add(fCommandsSeparator);
-			editMenu.add(fExpandSelectionToMenu);
-			editMenu.add(fCommandsSeparator);
-			editMenu.add(fMenuAdditionsGroupMarker);
-		}
-
-		// source commands
-		String sourceMenuLabel = SSEUIMessages.SourceMenu_label; //$NON-NLS-1$
-		String sourceMenuId = "sourceMenuId"; // This is just a menu id. No //$NON-NLS-1$
-		// need to translate.
-		// //$NON-NLS-1$
-		IMenuManager sourceMenu = new MenuManager(sourceMenuLabel, sourceMenuId);
-		menu.insertAfter(IWorkbenchActionConstants.M_EDIT, sourceMenu);
-		if (sourceMenu != null) {
-			sourceMenu.add(fCommandsSeparator);
-			sourceMenu.add(fToggleComment);
-			sourceMenu.add(fAddBlockComment);
-			sourceMenu.add(fRemoveBlockComment);
-			sourceMenu.add(fShiftRight);
-			sourceMenu.add(fShiftLeft);
-		}
-	}
-
-	protected void addToPopupMenu(IMenuManager menu) {
-		// add nothing
-	}
-
-	protected void addToStatusLine(IStatusLineManager manager) {
-		if (_showDebugStatus) {
-			manager.add(fDebugStatusOffset);
-		}
-	}
-
-	protected void addToToolBar(IToolBarManager toolBarManager) {
-		toolBarManager.add(fToolbarSeparator);
-		toolBarManager.add(fToolbarAdditionsGroupMarker);
-	}
-
-	/**
-	 * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToMenu(IMenuManager)
-	 */
-	public void contributeToMenu(IMenuManager menu) {
-		super.contributeToMenu(menu);
-
-		addToMenu(menu);
-
-		if (extendedContributor != null) {
-			extendedContributor.contributeToMenu(menu);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.extension.IPopupMenuContributor#contributeToPopupMenu(org.eclipse.jface.action.IMenuManager)
-	 */
-	public void contributeToPopupMenu(IMenuManager menu) {
-
-		addToPopupMenu(menu);
-
-		if (extendedContributor != null) {
-			extendedContributor.contributeToPopupMenu(menu);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToStatusLine(org.eclipse.jface.action.IStatusLineManager)
-	 */
-	public void contributeToStatusLine(IStatusLineManager manager) {
-		super.contributeToStatusLine(manager);
-
-		addToStatusLine(manager);
-
-		if (extendedContributor != null) {
-			extendedContributor.contributeToStatusLine(manager);
-		}
-	}
-
-	/**
-	 * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(IToolBarManager)
-	 */
-	public void contributeToToolBar(IToolBarManager toolBarManager) {
-		super.contributeToToolBar(toolBarManager);
-
-		addToToolBar(toolBarManager);
-
-		if (extendedContributor != null) {
-			extendedContributor.contributeToToolBar(toolBarManager);
-		}
-	}
-
-	/**
-	 * @see org.eclipse.ui.part.EditorActionBarContributor#dispose()
-	 */
-	public void dispose() {
-		// need to call setActiveEditor before super.dispose because in both
-		// setActiveEditor & super.setActiveEditor if getEditorPart ==
-		// activeEditor,
-		// the method is just returned. so to get both methods to run,
-		// setActiveEditor
-		// needs to be called so that it correctly calls super.setActiveEditor
-		setActiveEditor(null);
-
-		super.dispose();
-
-		if (extendedContributor != null)
-			extendedContributor.dispose();
-	}
-
-	protected String[] getExtensionIDs() {
-		return EDITOR_IDS;
-	}
-
-	/**
-	 * @param editor
-	 * @return
-	 */
-	protected ITextEditor getTextEditor(IEditorPart editor) {
-		ITextEditor textEditor = null;
-		if (editor instanceof ITextEditor)
-			textEditor = (ITextEditor) editor;
-		if (textEditor == null && editor != null)
-			textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
-		return textEditor;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.IEditorActionBarContributor#init(org.eclipse.ui.IActionBars,
-	 *      org.eclipse.ui.IWorkbenchPage)
-	 */
-	public void init(IActionBars bars, IWorkbenchPage page) {
-		super.init(bars, page);
-	}
-
-	/**
-	 * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(IEditorPart)
-	 */
-	public void setActiveEditor(IEditorPart activeEditor) {
-		if (getActiveEditorPart() == activeEditor)
-			return;
-		super.setActiveEditor(activeEditor);
-
-		ITextEditor textEditor = getTextEditor(activeEditor);
-
-		IActionBars actionBars = getActionBars();
-		if (actionBars != null) {
-			actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_NEXT_ANNOTATION, fNextAnnotation);
-			actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_PREVIOUS_ANNOTATION, fPreviousAnnotation);
-			actionBars.setGlobalActionHandler(ActionFactory.PREVIOUS.getId(), fPreviousAnnotation);
-			actionBars.setGlobalActionHandler(ActionFactory.NEXT.getId(), fNextAnnotation);
-
-			if (textEditor != null) {
-				actionBars.setGlobalActionHandler(IDEActionFactory.ADD_TASK.getId(), getAction(textEditor, IDEActionFactory.ADD_TASK.getId()));
-				actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction(textEditor, IDEActionFactory.BOOKMARK.getId()));
-			}
-		}
-
-		fStructureSelectEnclosingAction.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_ENCLOSING));
-		fStructureSelectNextAction.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_NEXT));
-		fStructureSelectPreviousAction.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_PREVIOUS));
-		fStructureSelectHistoryAction.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_HISTORY));
-
-		fShiftRight.setAction(getAction(textEditor, ITextEditorActionConstants.SHIFT_RIGHT));
-		fShiftLeft.setAction(getAction(textEditor, ITextEditorActionConstants.SHIFT_LEFT));
-
-		fToggleComment.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_TOGGLE_COMMENT));
-		fAddBlockComment.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_ADD_BLOCK_COMMENT));
-		fRemoveBlockComment.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_REMOVE_BLOCK_COMMENT));
-
-		// go to prev/next error
-		// CMVC 249017 for JavaEditor consistancy
-		fPreviousAnnotation.setEditor(textEditor);
-		fNextAnnotation.setEditor(textEditor);
-
-		fToggleInsertModeAction.setAction(getAction(textEditor, ITextEditorActionConstants.TOGGLE_INSERT_MODE));
-
-		if (extendedContributor != null) {
-			extendedContributor.setActiveEditor(activeEditor);
-		}
-
-		if (_showDebugStatus && textEditor instanceof ITextEditorExtension) {
-			((ITextEditorExtension) textEditor).setStatusField(fDebugStatusOffset, StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET);
-			fDebugStatusOffset.setActiveEditor(textEditor);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.ISourceViewerActionBarContributor#setViewerSpecificContributionsEnabled(boolean)
-	 */
-	public void setViewerSpecificContributionsEnabled(boolean enabled) {
-		fShiftRight.setEnabled(enabled);
-		fShiftLeft.setEnabled(enabled);
-		fNextAnnotation.setEnabled(enabled);
-		fPreviousAnnotation.setEnabled(enabled);
-
-		/*
-		 * fComment.setEnabled(enabled); fUncomment.setEnabled(enabled);
-		 */
-		fToggleComment.setEnabled(enabled);
-		fAddBlockComment.setEnabled(enabled);
-		fRemoveBlockComment.setEnabled(enabled);
-		// convert line delimiters are not source viewer-specific
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.extension.IExtendedContributor#updateToolbarActions()
-	 */
-	public void updateToolbarActions() {
-		if (extendedContributor != null) {
-			extendedContributor.updateToolbarActions();
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java
deleted file mode 100644
index b26dae1..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java
+++ /dev/null
@@ -1,42 +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.sse.ui.internal.actions;
-
-
-
-/**
- * Defines the definitions ids for editor actions.
- */
-public interface ActionDefinitionIds {
-	//TODO: Can these be better defined with a "plugin prefix" to be more portable? 
-	public final static String ADD_BLOCK_COMMENT = "org.eclipse.wst.sse.ui.add.block.comment";//$NON-NLS-1$
-
-	public final static String CLEANUP_DOCUMENT = "org.eclipse.wst.sse.ui.cleanup.document";//$NON-NLS-1$
-	public final static String COMMENT = "org.eclipse.wst.sse.ui.comment";//$NON-NLS-1$
-	public final static String EDIT_BREAKPOINTS = "org.eclipse.wst.sse.ui.breakpoints.edit";//$NON-NLS-1$
-	public final static String FIND_OCCURRENCES = "org.eclipse.wst.sse.ui.search.find.occurrences";//$NON-NLS-1$
-	public final static String FORMAT_ACTIVE_ELEMENTS = "org.eclipse.wst.sse.ui.format.active.elements";//$NON-NLS-1$
-	public final static String FORMAT_DOCUMENT = "org.eclipse.wst.sse.ui.format.document";//$NON-NLS-1$
-	public final static String INFORMATION = "org.eclipse.wst.sse.ui.show.javadoc";//$NON-NLS-1$
-	public final static String MANAGE_BREAKPOINTS = "org.eclipse.wst.sse.ui.breakpoints.manage";//$NON-NLS-1$
-	public final static String OPEN_FILE = "org.eclipse.wst.sse.ui.open.file.from.source";//$NON-NLS-1$
-	public final static String QUICK_FIX = "org.eclipse.wst.sse.ui.edit.text.java.correction.assist.proposals";//$NON-NLS-1$
-	public final static String REMOVE_BLOCK_COMMENT = "org.eclipse.wst.sse.ui.remove.block.comment";//$NON-NLS-1$
-	public final static String STRUCTURE_SELECT_ENCLOSING = "org.eclipse.wst.sse.ui.structure.select.enclosing";//$NON-NLS-1$
-	public final static String STRUCTURE_SELECT_HISTORY = "org.eclipse.wst.sse.ui.structure.select.last";//$NON-NLS-1$
-	public final static String STRUCTURE_SELECT_NEXT = "org.eclipse.wst.sse.ui.structure.select.next";//$NON-NLS-1$
-	public final static String STRUCTURE_SELECT_PREVIOUS = "org.eclipse.wst.sse.ui.structure.select.previous";//$NON-NLS-1$
-	public final static String TOGGLE_COMMENT = "org.eclipse.wst.sse.ui.toggle.comment";//$NON-NLS-1$
-	public final static String TOGGLE_BREAKPOINTS = "org.eclipse.wst.sse.ui.breakpoints.toggle";//$NON-NLS-1$
-	public final static String UNCOMMENT = "org.eclipse.wst.sse.ui.uncomment";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActiveEditorActionHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActiveEditorActionHandler.java
deleted file mode 100644
index 5595d63..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActiveEditorActionHandler.java
+++ /dev/null
@@ -1,286 +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.sse.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.swt.events.HelpListener;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * @deprecated actions are not properly activated with this handler so do not
- *             use
- */
-public class ActiveEditorActionHandler implements IAction {
-
-	private String fActionId;
-	private IWorkbenchSite fSite;
-	private IAction fTargetAction;
-
-	public ActiveEditorActionHandler(IWorkbenchSite site, String id) {
-		super();
-		fActionId = id;
-		fSite = site;
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
-	 */
-	public void addPropertyChangeListener(IPropertyChangeListener listener) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#getAccelerator()
-	 */
-	public int getAccelerator() {
-		updateTargetAction();
-		return (fTargetAction != null ? fTargetAction.getAccelerator() : 0);
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#getActionDefinitionId()
-	 */
-	public String getActionDefinitionId() {
-		updateTargetAction();
-		return (fTargetAction != null ? fTargetAction.getActionDefinitionId() : null);
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#getDescription()
-	 */
-	public String getDescription() {
-		updateTargetAction();
-		return (fTargetAction != null ? fTargetAction.getDescription() : null);
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#getDisabledImageDescriptor()
-	 */
-	public ImageDescriptor getDisabledImageDescriptor() {
-		updateTargetAction();
-		return (fTargetAction != null ? fTargetAction.getDisabledImageDescriptor() : null);
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#getHelpListener()
-	 */
-	public HelpListener getHelpListener() {
-		updateTargetAction();
-		return (fTargetAction != null ? fTargetAction.getHelpListener() : null);
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#getHoverImageDescriptor()
-	 */
-	public ImageDescriptor getHoverImageDescriptor() {
-		updateTargetAction();
-		return (fTargetAction != null ? fTargetAction.getHoverImageDescriptor() : null);
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#getId()
-	 */
-	public String getId() {
-		return getClass().getName() + hashCode();
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#getImageDescriptor()
-	 */
-	public ImageDescriptor getImageDescriptor() {
-		updateTargetAction();
-		return (fTargetAction != null ? fTargetAction.getImageDescriptor() : null);
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#getMenuCreator()
-	 */
-	public IMenuCreator getMenuCreator() {
-		return null;
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#getStyle()
-	 */
-	public int getStyle() {
-		return IAction.AS_PUSH_BUTTON;
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#getText()
-	 */
-	public String getText() {
-		updateTargetAction();
-		return (fTargetAction != null ? fTargetAction.getText() : null);
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#getToolTipText()
-	 */
-	public String getToolTipText() {
-		updateTargetAction();
-		return (fTargetAction != null ? fTargetAction.getToolTipText() : null);
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#isChecked()
-	 */
-	public boolean isChecked() {
-		updateTargetAction();
-		return (fTargetAction != null ? fTargetAction.isChecked() : true);
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#isEnabled()
-	 */
-	public boolean isEnabled() {
-		updateTargetAction();
-		return (fTargetAction != null ? fTargetAction.isEnabled() : false);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.action.IAction#isHandled()
-	 */
-	public boolean isHandled() {
-		updateTargetAction();
-		return (fTargetAction != null ? fTargetAction.isHandled() : false);
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
-	 */
-	public void removePropertyChangeListener(IPropertyChangeListener listener) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#run()
-	 */
-	public void run() {
-		updateTargetAction();
-		if (fTargetAction != null)
-			fTargetAction.run();
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#runWithEvent(org.eclipse.swt.widgets.Event)
-	 */
-	public void runWithEvent(Event event) {
-		updateTargetAction();
-		if (fTargetAction != null)
-			fTargetAction.runWithEvent(event);
-	}
-
-	/**
-	 * NOT SUPPORTED
-	 * 
-	 * @see org.eclipse.jface.action.IAction#setAccelerator(int)
-	 */
-	public void setAccelerator(int keycode) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#setActionDefinitionId(java.lang.String)
-	 */
-	public void setActionDefinitionId(String id) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#setChecked(boolean)
-	 */
-	public void setChecked(boolean checked) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#setDescription(java.lang.String)
-	 */
-	public void setDescription(String text) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#setDisabledImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
-	 */
-	public void setDisabledImageDescriptor(ImageDescriptor newImage) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#setEnabled(boolean)
-	 */
-	public void setEnabled(boolean enabled) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#setHelpListener(org.eclipse.swt.events.HelpListener)
-	 */
-	public void setHelpListener(HelpListener listener) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#setHoverImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
-	 */
-	public void setHoverImageDescriptor(ImageDescriptor newImage) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#setId(java.lang.String)
-	 */
-	public void setId(String id) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#setImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
-	 */
-	public void setImageDescriptor(ImageDescriptor newImage) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#setMenuCreator(org.eclipse.jface.action.IMenuCreator)
-	 */
-	public void setMenuCreator(IMenuCreator creator) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#setText(java.lang.String)
-	 */
-	public void setText(String text) {
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#setToolTipText(java.lang.String)
-	 */
-	public void setToolTipText(String text) {
-	}
-
-	private void updateTargetAction() {
-		if (fSite != null && fSite.getWorkbenchWindow() != null && fSite.getWorkbenchWindow().getActivePage() != null) {
-			IEditorPart part = fSite.getWorkbenchWindow().getActivePage().getActiveEditor();
-			ITextEditor editor = null;
-			if (part instanceof ITextEditor)
-				editor = (ITextEditor) part;
-			else
-				editor = (ITextEditor) (part != null ? part.getAdapter(ITextEditor.class) : null);
-			if (editor != null) {
-				fTargetAction = editor.getAction(fActionId);
-			} else {
-				fTargetAction = null;
-			}
-		} else
-			fTargetAction = null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/CleanupAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/CleanupAction.java
deleted file mode 100644
index d015667..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/CleanupAction.java
+++ /dev/null
@@ -1,85 +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.sse.ui.internal.actions;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextEditorAction;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-public abstract class CleanupAction extends TextEditorAction {
-	protected Dialog fCleanupDialog;
-
-	public CleanupAction(ResourceBundle bundle, String prefix, ITextEditor editor) {
-		super(bundle, prefix, editor);
-	}
-
-	protected abstract Dialog getCleanupDialog(Shell shell);
-
-	protected abstract IStructuredCleanupProcessor getCleanupProcessor();
-
-	public void run() {
-		if (getTextEditor() instanceof StructuredTextEditor) {
-			final StructuredTextEditor editor = (StructuredTextEditor) getTextEditor();
-			Dialog cleanupDialog = getCleanupDialog(editor.getSite().getShell());
-			if (cleanupDialog != null) {
-				if (cleanupDialog.open() == Window.OK) {
-					// setup runnable
-					Runnable runnable = new Runnable() {
-						public void run() {
-							IStructuredCleanupProcessor cleanupProcessor = getCleanupProcessor();
-							if (cleanupProcessor != null)
-								cleanupProcessor.cleanupModel(editor.getModel());
-						}
-					};
-
-					// TODO: make independent of 'model'.
-					IStructuredModel model = editor.getModel();
-					if (model != null) {
-						try {
-							// 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.getTextViewer().getControl().getDisplay(), runnable);
-						} finally {
-							// 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());
-						}
-					}
-				}
-
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/FormatActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/FormatActionDelegate.java
deleted file mode 100644
index 5b6c61c..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/FormatActionDelegate.java
+++ /dev/null
@@ -1,228 +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.sse.ui.internal.actions;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IContainer;
-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.MultiStatus;
-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.jobs.Job;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.sse.core.internal.exceptions.MalformedInputExceptionWithDetail;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.ui.internal.FormatProcessorsExtensionReader;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-public class FormatActionDelegate extends ResourceActionDelegate {
-
-	class FormatJob extends Job {
-
-		public FormatJob(String name) {
-			super(name);
-		}
-
-		/**
-		 * @param container
-		 * @return
-		 */
-		private int getResourceCount(IResource[] members) {
-			int count = 0;
-
-			for (int i = 0; i < members.length; i++) {
-				if (members[i] instanceof IContainer) {
-					IContainer container = (IContainer) members[i];
-					try {
-						count += getResourceCount(container.members());
-					} catch (CoreException e) {
-						// skip counting
-					}
-				} else
-					count++;
-			}
-
-			return count;
-		}
-
-		/**
-		 * @param elements
-		 * @return
-		 */
-		private int getResourceCount(Object[] elements) {
-			int count = 0;
-
-			for (int i = 0; i < elements.length; i++) {
-				if (elements[i] instanceof IContainer) {
-					IContainer container = (IContainer) elements[i];
-					try {
-						count += getResourceCount(container.members());
-					} catch (CoreException e) {
-						// skip counting
-					}
-				} else
-					count++;
-			}
-
-			return count;
-		}
-
-		protected IStatus run(IProgressMonitor monitor) {
-			IStatus status = Status.OK_STATUS;
-
-			Object[] elements = fSelection.toArray();
-			int resourceCount = getResourceCount(elements);
-			monitor.beginTask("", resourceCount); //$NON-NLS-1$
-			for (int i = 0; i < elements.length; i++) {
-				if (elements[i] instanceof IResource) {
-					process(monitor, (IResource) elements[i]);
-					monitor.worked(1);
-				}
-			}
-			monitor.done();
-
-			if (fErrorStatus.getChildren().length > 0) {
-				status = fErrorStatus;
-				fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, SSEUIMessages.FormatActionDelegate_errorStatusMessage, null); //$NON-NLS-1$
-			}
-
-			return status;
-		}
-
-	}
-
-	private MultiStatus fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, SSEUIMessages.FormatActionDelegate_errorStatusMessage, null); //$NON-NLS-1$
-
-	protected void format(IProgressMonitor monitor, IFile file) {
-		try {
-			monitor.worked(1);
-			IContentDescription contentDescription = file.getContentDescription();
-			if (contentDescription == null)
-				return;
-
-			IContentType contentType = contentDescription.getContentType();
-			IStructuredFormatProcessor formatProcessor = getFormatProcessor(contentType.getId());
-			if (formatProcessor != null && (monitor == null || !monitor.isCanceled())) {
-				String message = NLS.bind(SSEUIMessages.FormatActionDelegate_3, new String[]{file.getFullPath().toString()});
-				monitor.subTask(message);
-				formatProcessor.setProgressMonitor(monitor);
-				formatProcessor.formatFile(file);
-			}
-		} catch (MalformedInputExceptionWithDetail e) {
-			String message = NLS.bind(SSEUIMessages.FormatActionDelegate_5, new String[]{file.getFullPath().toString()});
-			fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
-		} catch (IOException e) {
-			String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{file.getFullPath().toString()});
-			fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
-		} catch (CoreException e) {
-			String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{file.getFullPath().toString()});
-			fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
-		}
-	}
-
-	protected void format(IProgressMonitor monitor, IResource resource) {
-		if (resource instanceof IFile) {
-			IFile file = (IFile) resource;
-
-			if (monitor == null || !monitor.isCanceled())
-				format(monitor, file);
-		} else if (resource instanceof IContainer) {
-			IContainer container = (IContainer) resource;
-
-			try {
-				IResource[] members = container.members();
-				for (int i = 0; i < members.length; i++) {
-					if (monitor == null || !monitor.isCanceled())
-						format(monitor, members[i]);
-				}
-			} catch (CoreException e) {
-				String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{resource.getFullPath().toString()});
-				fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
-			}
-		}
-	}
-
-	protected IStructuredFormatProcessor getFormatProcessor(String contentTypeId) {
-		return FormatProcessorsExtensionReader.getInstance().getFormatProcessor(contentTypeId);
-	}
-
-	protected Job getJob() {
-		return new FormatJob(SSEUIMessages.FormatActionDelegate_jobName); //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.edit.util.ResourceActionDelegate#process(org.eclipse.core.runtime.IProgressMonitor,
-	 *      org.eclipse.core.resources.IResource)
-	 */
-	protected void process(IProgressMonitor monitor, IResource resource) {
-		format(monitor, resource);
-
-		try {
-			resource.refreshLocal(IResource.DEPTH_INFINITE, null);
-		} catch (CoreException e) {
-			String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{resource.getFullPath().toString()});
-			fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.wst.sse.ui.internal.actions.ResourceActionDelegate#processorAvailable(org.eclipse.core.resources.IResource)
-	 */
-	protected boolean processorAvailable(IResource resource) {
-		boolean result = false;
-		if (resource.isAccessible()) {
-			try {
-				if (resource instanceof IFile) {
-					IFile file = (IFile) resource;
-
-					IStructuredFormatProcessor formatProcessor = null;
-					IContentDescription contentDescription = file.getContentDescription();
-					if (contentDescription != null) {
-						IContentType contentType = contentDescription.getContentType();
-						formatProcessor = getFormatProcessor(contentType.getId());
-					}
-					if (formatProcessor != null)
-						result = true;
-				}
-				else if (resource instanceof IContainer) {
-					IContainer container = (IContainer) resource;
-					IResource[] members;
-					members = container.members();
-					for (int i = 0; i < members.length; i++) {
-						boolean available = processorAvailable(members[i]);
-
-						if (available) {
-							result = true;
-							break;
-						}
-					}
-				}
-			}
-			catch (CoreException e) {
-				Logger.logException(e);
-			}
-		}
-
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ResourceActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ResourceActionDelegate.java
deleted file mode 100644
index 3e2686a..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ResourceActionDelegate.java
+++ /dev/null
@@ -1,75 +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.sse.ui.internal.actions;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IActionDelegate;
-
-public class ResourceActionDelegate implements IActionDelegate {
-	protected IStructuredSelection fSelection;
-
-	protected Job getJob() {
-		// ResourceActionDelegate does not create background job
-		// subclass creates the background job for the action
-		return null;
-	}
-
-	protected boolean processorAvailable(IResource resource) {
-		// ResourceActionDelegate returns false by default
-		// subclass returns true if processor is available; false otherwise
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
-	 */
-	public void run(IAction action) {
-		if (fSelection != null && !fSelection.isEmpty()) {
-			Job job = getJob();
-			if (job != null)
-				job.schedule();
-		}
-	}
-
-	/*
-	 * (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) {
-		if (selection instanceof IStructuredSelection) {
-			fSelection = (IStructuredSelection) selection;
-			boolean available = false;
-
-			Object[] elements = fSelection.toArray();
-			for (int i = 0; i < elements.length; i++) {
-				if (elements[i] instanceof IResource) {
-					available = processorAvailable((IResource) elements[i]);
-
-					if (available)
-						break;
-				}
-			}
-
-			action.setEnabled(available);
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java
deleted file mode 100644
index 8d411b1..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.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.sse.ui.internal.actions;
-
-
-
-public interface StructuredTextEditorActionConstants {
-	public final static String ACTION_NAME_ADD_BLOCK_COMMENT = "AddBlockComment";//$NON-NLS-1$
-	public final static String ACTION_NAME_CLEANUP_DOCUMENT = "CleanupDocument";//$NON-NLS-1$
-	public final static String ACTION_NAME_COMMENT = "Comment";//$NON-NLS-1$
-	public final static String ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION = "ContentAssistContextInformation";//$NON-NLS-1$
-	public final static String ACTION_NAME_CONTENTASSIST_PROPOSALS = "ContentAssistProposals";//$NON-NLS-1$
-	public final static String ACTION_NAME_FIND_OCCURRENCES = "FindOccurrences"; //$NON-NLS-1$
-	public final static String ACTION_NAME_FORMAT_ACTIVE_ELEMENTS = "FormatActiveElements";//$NON-NLS-1$
-	public final static String ACTION_NAME_FORMAT_DOCUMENT = "FormatDocument";//$NON-NLS-1$
-	public final static String ACTION_NAME_INFORMATION = "ShowTooltipDesc";//$NON-NLS-1$
-	public final static String ACTION_NAME_MANAGE_BREAKPOINTS = "ManageBreakpoints";//$NON-NLS-1$
-	public final static String ACTION_NAME_OPEN_FILE = "OpenFileFromSource";//$NON-NLS-1$
-	public final static String ACTION_NAME_QUICK_FIX = "QuickFix";//$NON-NLS-1$
-	public final static String ACTION_NAME_REMOVE_BLOCK_COMMENT = "RemoveBlockComment";//$NON-NLS-1$
-	public final static String ACTION_NAME_STRUCTURE_SELECT_ENCLOSING = "StructureSelectEnclosing";//$NON-NLS-1$
-	public final static String ACTION_NAME_STRUCTURE_SELECT_HISTORY = "StructureSelectHistory";//$NON-NLS-1$
-	public final static String ACTION_NAME_STRUCTURE_SELECT_NEXT = "StructureSelectNext";//$NON-NLS-1$
-	public final static String ACTION_NAME_STRUCTURE_SELECT_PREVIOUS = "StructureSelectPrevious";//$NON-NLS-1$
-	public final static String ACTION_NAME_TOGGLE_COMMENT = "ToggleComment";//$NON-NLS-1$
-	public final static String ACTION_NAME_UNCOMMENT = "Uncomment";//$NON-NLS-1$
-
-	public final static String DOT = ".";//$NON-NLS-1$
-
-	public final static String GROUP_NAME_MENU_ADDITIONS = "MenuAdditions";//$NON-NLS-1$
-	public final static String GROUP_NAME_TOOLBAR_ADDITIONS = "ToolbarAdditions";//$NON-NLS-1$
-	
-	public final static String STATUS_CATEGORY_OFFSET = "Offset";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java
deleted file mode 100644
index 889952b..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java
+++ /dev/null
@@ -1,421 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.sse.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jface.contentassist.IContentAssistSubjectControl;
-import org.eclipse.jface.contentassist.ISubjectControlContentAssistProcessor;
-import org.eclipse.jface.contentassist.ISubjectControlContextInformationValidator;
-import org.eclipse.jface.text.Assert;
-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.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-
-/**
- * A processor that aggregates the proposals of multiple other processors.
- * When proposals are requested, the contained processors are queried in the
- * order they were added to the compound object. Copied from
- * org.eclipse.jdt.internal.ui.text.CompoundContentAssistProcessor.
- * Modification was made to add a dispose() method.
- */
-class CompoundContentAssistProcessor implements IContentAssistProcessor, ISubjectControlContentAssistProcessor {
-
-	private static class WrappedContextInformation implements IContextInformation {
-		private IContextInformation fInfo;
-		private IContentAssistProcessor fProcessor;
-
-		WrappedContextInformation(IContextInformation info, IContentAssistProcessor processor) {
-			fInfo = info;
-			fProcessor = processor;
-		}
-
-		/*
-		 * @see java.lang.Object#equals(java.lang.Object)
-		 */
-		public boolean equals(Object obj) {
-			return fInfo.equals(obj);
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.contentassist.IContextInformation#getContextDisplayString()
-		 */
-		public String getContextDisplayString() {
-			return fInfo.getContextDisplayString();
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.contentassist.IContextInformation#getImage()
-		 */
-		public Image getImage() {
-			return fInfo.getImage();
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.contentassist.IContextInformation#getInformationDisplayString()
-		 */
-		public String getInformationDisplayString() {
-			return fInfo.getInformationDisplayString();
-		}
-
-		/*
-		 * @see java.lang.Object#hashCode()
-		 */
-		public int hashCode() {
-			return fInfo.hashCode();
-		}
-
-		/*
-		 * @see java.lang.Object#toString()
-		 */
-		public String toString() {
-			return fInfo.toString();
-		}
-
-		IContentAssistProcessor getProcessor() {
-			return fProcessor;
-		}
-	}
-
-	private static class CompoundContentAssistValidator implements IContextInformationValidator {
-		List fValidators = new ArrayList();
-		IContextInformationValidator fValidator;
-
-		void add(IContextInformationValidator validator) {
-			fValidators.add(validator);
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#install(org.eclipse.jface.text.contentassist.IContextInformation,
-		 *      org.eclipse.jface.text.ITextViewer, int)
-		 */
-		public void install(IContextInformation info, ITextViewer viewer, int documentPosition) {
-			// install either the validator in the info, or all validators
-			fValidator = getValidator(info);
-			if (fValidator != null)
-				fValidator.install(info, viewer, documentPosition);
-			else {
-				for (Iterator it = fValidators.iterator(); it.hasNext();) {
-					IContextInformationValidator v = (IContextInformationValidator) it.next();
-					v.install(info, viewer, documentPosition);
-				}
-			}
-		}
-
-		IContextInformationValidator getValidator(IContextInformation info) {
-			if (info instanceof WrappedContextInformation) {
-				WrappedContextInformation wrap = (WrappedContextInformation) info;
-				return wrap.getProcessor().getContextInformationValidator();
-			}
-
-			return null;
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#isContextInformationValid(int)
-		 */
-		public boolean isContextInformationValid(int documentPosition) {
-			// use either the validator in the info, or all validators
-			boolean isValid = false;
-			if (fValidator != null)
-				isValid = fValidator.isContextInformationValid(documentPosition);
-			else {
-				for (Iterator it = fValidators.iterator(); it.hasNext();) {
-					IContextInformationValidator v = (IContextInformationValidator) it.next();
-					isValid |= v.isContextInformationValid(documentPosition);
-				}
-			}
-			return isValid;
-		}
-
-	}
-
-	private static class CompoundContentAssistValidatorEx extends CompoundContentAssistValidator implements ISubjectControlContextInformationValidator {
-
-		/*
-		 * @see ISubjectControlContextInformationValidator#install(IContextInformation,
-		 *      IContentAssistSubjectControl, int)
-		 */
-		public void install(IContextInformation info, IContentAssistSubjectControl contentAssistSubjectControl, int documentPosition) {
-			// install either the validator in the info, or all validators
-			fValidator = getValidator(info);
-			if (fValidator instanceof ISubjectControlContextInformationValidator)
-				((ISubjectControlContextInformationValidator) fValidator).install(info, contentAssistSubjectControl, documentPosition);
-			else {
-				for (Iterator it = fValidators.iterator(); it.hasNext();) {
-					if (it.next() instanceof ISubjectControlContextInformationValidator)
-						((ISubjectControlContextInformationValidator) it.next()).install(info, contentAssistSubjectControl, documentPosition);
-				}
-			}
-		}
-
-	}
-
-	private final Set fProcessors = new LinkedHashSet();
-
-	/**
-	 * Creates a new instance.
-	 */
-	public CompoundContentAssistProcessor() {
-	}
-
-	/**
-	 * Creates a new instance with one child processor.
-	 * 
-	 * @param processor
-	 *            the processor to add
-	 */
-	public CompoundContentAssistProcessor(IContentAssistProcessor processor) {
-		add(processor);
-	}
-
-	/**
-	 * Adds a processor to this compound processor.
-	 * 
-	 * @param processor
-	 *            the processor to add
-	 */
-	public void add(IContentAssistProcessor processor) {
-		Assert.isNotNull(processor);
-		fProcessors.add(processor);
-	}
-
-	/**
-	 * Removes a processor from this compound processor.
-	 * 
-	 * @param processor
-	 *            the processor to remove
-	 */
-	public void remove(IContentAssistProcessor processor) {
-		fProcessors.remove(processor);
-	}
-
-	/**
-	 * Creates a new instance and adds all specified processors.
-	 * 
-	 * @param processors
-	 */
-	public CompoundContentAssistProcessor(IContentAssistProcessor[] processors) {
-		for (int i = 0; i < processors.length; i++) {
-			add(processors[i]);
-		}
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer,
-	 *      int)
-	 */
-	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
-		List ret = new LinkedList();
-		for (Iterator it = fProcessors.iterator(); it.hasNext();) {
-			IContentAssistProcessor p = (IContentAssistProcessor) it.next();
-			ICompletionProposal[] proposals = p.computeCompletionProposals(viewer, documentOffset);
-			if (proposals != null)
-				ret.addAll(Arrays.asList(proposals));
-		}
-		return (ICompletionProposal[]) ret.toArray(new ICompletionProposal[ret.size()]);
-	}
-
-	/**
-	 * {@inheritDoc}
-	 * <p>
-	 * The returned objects are wrapper objects around the real information
-	 * containers.
-	 * </p>
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer,
-	 *      int)
-	 */
-	public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
-		List ret = new LinkedList();
-		for (Iterator it = fProcessors.iterator(); it.hasNext();) {
-			IContentAssistProcessor p = (IContentAssistProcessor) it.next();
-			IContextInformation[] informations = p.computeContextInformation(viewer, documentOffset);
-			if (informations != null)
-				for (int i = 0; i < informations.length; i++)
-					ret.add(new WrappedContextInformation(informations[i], p));
-		}
-		return (IContextInformation[]) ret.toArray(new IContextInformation[ret.size()]);
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
-	 */
-	public char[] getCompletionProposalAutoActivationCharacters() {
-		Set ret = new LinkedHashSet();
-		for (Iterator it = fProcessors.iterator(); it.hasNext();) {
-			IContentAssistProcessor p = (IContentAssistProcessor) it.next();
-			char[] chars = p.getCompletionProposalAutoActivationCharacters();
-			if (chars != null)
-				for (int i = 0; i < chars.length; i++)
-					ret.add(new Character(chars[i]));
-		}
-
-		char[] chars = new char[ret.size()];
-		int i = 0;
-		for (Iterator it = ret.iterator(); it.hasNext(); i++) {
-			Character ch = (Character) it.next();
-			chars[i] = ch.charValue();
-		}
-		return chars;
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
-	 */
-	public char[] getContextInformationAutoActivationCharacters() {
-		Set ret = new LinkedHashSet();
-		for (Iterator it = fProcessors.iterator(); it.hasNext();) {
-			IContentAssistProcessor p = (IContentAssistProcessor) it.next();
-			char[] chars = p.getContextInformationAutoActivationCharacters();
-			if (chars != null)
-				for (int i = 0; i < chars.length; i++)
-					ret.add(new Character(chars[i]));
-		}
-
-		char[] chars = new char[ret.size()];
-		int i = 0;
-		for (Iterator it = ret.iterator(); it.hasNext(); i++) {
-			Character ch = (Character) it.next();
-			chars[i] = ch.charValue();
-		}
-		return chars;
-	}
-
-	/**
-	 * Returns the first non- <code>null</code> error message of any
-	 * contained processor, or <code>null</code> if no processor has an
-	 * error message.
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
-	 * @return {@inheritDoc}
-	 */
-	public String getErrorMessage() {
-		for (Iterator it = fProcessors.iterator(); it.hasNext();) {
-			IContentAssistProcessor p = (IContentAssistProcessor) it.next();
-			String err = p.getErrorMessage();
-			if (err != null)
-				return err;
-		}
-		return null;
-	}
-
-	/**
-	 * {@inheritDoc}
-	 * <p>
-	 * The returned validator is a wrapper around the validators provided by
-	 * the child processors.
-	 * </p>
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
-	 */
-	public IContextInformationValidator getContextInformationValidator() {
-		boolean hasValidator = false;
-		boolean hasExtension = false;
-		for (Iterator it = fProcessors.iterator(); it.hasNext();) {
-			IContentAssistProcessor p = (IContentAssistProcessor) it.next();
-			IContextInformationValidator v = p.getContextInformationValidator();
-			if (v instanceof ISubjectControlContextInformationValidator) {
-				hasExtension = true;
-				break;
-			}
-			else if (v != null) {
-				hasValidator = true;
-			}
-		}
-
-		CompoundContentAssistValidator validator = null;
-		if (hasExtension)
-			validator = new CompoundContentAssistValidatorEx();
-		else if (hasValidator)
-			validator = new CompoundContentAssistValidator();
-
-		if (validator != null)
-			for (Iterator it = fProcessors.iterator(); it.hasNext();) {
-				IContentAssistProcessor p = (IContentAssistProcessor) it.next();
-				IContextInformationValidator v = p.getContextInformationValidator();
-				if (v != null)
-					validator.add(v);
-			}
-
-		return validator;
-	}
-
-	/*
-	 * @see ISubjectControlContentAssistProcessor#computeCompletionProposals(IContentAssistSubjectControl,
-	 *      int)
-	 */
-	public ICompletionProposal[] computeCompletionProposals(IContentAssistSubjectControl contentAssistSubjectControl, int documentOffset) {
-		List ret = new LinkedList();
-		for (Iterator it = fProcessors.iterator(); it.hasNext();) {
-			Object o = it.next();
-			if (o instanceof ISubjectControlContentAssistProcessor) {
-				ISubjectControlContentAssistProcessor p = (ISubjectControlContentAssistProcessor) o;
-				ICompletionProposal[] proposals = p.computeCompletionProposals(contentAssistSubjectControl, documentOffset);
-				if (proposals != null)
-					ret.addAll(Arrays.asList(proposals));
-			}
-		}
-
-		return (ICompletionProposal[]) ret.toArray(new ICompletionProposal[ret.size()]);
-	}
-
-	/**
-	 * {@inheritDoc}
-	 * <p>
-	 * The returned objects are wrapper objects around the real information
-	 * containers.
-	 * </p>
-	 * 
-	 * @see org.eclipse.jface.contentassist.ISubjectControlContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.contentassist.IContentAssistSubject,
-	 *      int)
-	 */
-	public IContextInformation[] computeContextInformation(IContentAssistSubjectControl contentAssistSubjectControl, int documentOffset) {
-		List ret = new LinkedList();
-		for (Iterator it = fProcessors.iterator(); it.hasNext();) {
-			Object o = it.next();
-			if (o instanceof ISubjectControlContentAssistProcessor) {
-				ISubjectControlContentAssistProcessor p = (ISubjectControlContentAssistProcessor) o;
-				IContextInformation[] informations = p.computeContextInformation(contentAssistSubjectControl, documentOffset);
-				if (informations != null)
-					for (int i = 0; i < informations.length; i++)
-						ret.add(new WrappedContextInformation(informations[i], p));
-			}
-		}
-		return (IContextInformation[]) ret.toArray(new IContextInformation[ret.size()]);
-	}
-
-	/**
-	 * Dispose of any content assist processors that need disposing
-	 */
-	public void dispose() {
-		// go through list of content assist processors and dispose
-		for (Iterator it = fProcessors.iterator(); it.hasNext();) {
-			IContentAssistProcessor p = (IContentAssistProcessor) it.next();
-			if (p instanceof IReleasable) {
-				((IReleasable) p).release();
-			}
-		}
-		fProcessors.clear();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java
deleted file mode 100644
index 3b62c6b..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java
+++ /dev/null
@@ -1,92 +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.sse.ui.internal.contentassist;
-
-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.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.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.ui.internal.StructuredTextViewer;
-
-
-/**
- * @author pavery
- *  
- */
-public class ContentAssistUtils {
-
-	/**
-	 * Returns the closest IndexedRegion for the offset and viewer allowing
-	 * for differences between viewer offsets and model positions. note: this
-	 * method returns an IndexedRegion for read only
-	 * 
-	 * @param viewer
-	 *            the viewer whose document is used to compute the proposals
-	 * @param documentOffset
-	 *            an offset within the document for which completions should
-	 *            be computed
-	 * @return an IndexedRegion
-	 */
-	public static IndexedRegion getNodeAt(StructuredTextViewer viewer, int documentOffset) {
-
-		if (viewer == null)
-			return null;
-
-		IndexedRegion node = null;
-		IModelManager mm = StructuredModelManager.getModelManager();
-		IStructuredModel model = null;
-		if (mm != null)
-			model = mm.getExistingModelForRead(viewer.getDocument());
-		try {
-			if (model != null) {
-				int lastOffset = documentOffset;
-				node = model.getIndexedRegion(documentOffset);
-				while (node == null && lastOffset >= 0) {
-					lastOffset--;
-					node = model.getIndexedRegion(lastOffset);
-				}
-			}
-		} finally {
-			if (model != null)
-				model.releaseFromRead();
-		}
-		return node;
-	}
-
-	/**
-	 * Returns the closest IStructuredDocumentRegion for the offest and
-	 * viewer.
-	 * 
-	 * @param viewer
-	 * @param documentOffset
-	 * @return the closest IStructuredDocumentRegion for the offest and
-	 *         viewer.
-	 */
-	public static IStructuredDocumentRegion getStructuredDocumentRegion(StructuredTextViewer viewer, int documentOffset) {
-		IStructuredDocumentRegion sdRegion = null;
-		if (viewer == null || viewer.getDocument() == null)
-			return null;
-
-		int lastOffset = documentOffset;
-		IStructuredDocument doc = (IStructuredDocument) viewer.getDocument();
-		sdRegion = doc.getRegionAtCharacterOffset(documentOffset);
-		while (sdRegion == null && lastOffset >= 0) {
-			lastOffset--;
-			sdRegion = doc.getRegionAtCharacterOffset(lastOffset);
-		}
-		return sdRegion;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java
deleted file mode 100644
index 9872fb2..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java
+++ /dev/null
@@ -1,315 +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.sse.ui.internal.contentassist;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITextViewerExtension5;
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposalExtension;
-import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-
-/**
- * An implementation of ICompletionProposal whose values can be read after
- * creation.
- */
-public class CustomCompletionProposal implements ICompletionProposal, ICompletionProposalExtension, ICompletionProposalExtension2, IRelevanceCompletionProposal {
-    
-	private String fAdditionalProposalInfo;
-
-    private IContextInformation fContextInformation;
-
-    private int fCursorPosition = 0;
-
-    private String fDisplayString;
-
-    private Image fImage;
-
-    private int fOriginalReplacementLength;
-
-    private int fRelevance = IRelevanceConstants.R_NONE;
-
-    private int fReplacementLength = 0;
-
-    private int fReplacementOffset = 0;
-
-    private String fReplacementString = null;
-
-    private boolean fUpdateLengthOnValidate;
-
-    private char[] fTriggers;
-
-    /**
-     * Constructor with relevance and replacement length update flag.
-     * 
-     * If the <code>updateReplacementLengthOnValidate</code> flag is true,
-     * then when the user types, the replacement length will be incremented by
-     * the number of new characters inserted from the original position.
-     * Otherwise the replacement length will not change on validate.
-     * 
-     * ex.
-     * 
-     * <tag |name="attr"> - the replacement length is 4 <tag i|name="attr"> -
-     * the replacement length is now 5 <tag id|name="attr"> - the replacement
-     * length is now 6 <tag |name="attr"> - the replacementlength is now 4 again
-     * <tag |name="attr"> - the replacment length remains 4
-     * 
-     */
-    public CustomCompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString,
-            IContextInformation contextInformation, String additionalProposalInfo, int relevance, boolean updateReplacementLengthOnValidate) {
-        fReplacementString = replacementString;
-        fReplacementOffset = replacementOffset;
-        fReplacementLength = replacementLength;
-        fCursorPosition = cursorPosition;
-        fImage = image;
-        fDisplayString = displayString;
-        fContextInformation = contextInformation;
-        fAdditionalProposalInfo = additionalProposalInfo;
-        fRelevance = relevance;
-        fUpdateLengthOnValidate = updateReplacementLengthOnValidate;
-        fOriginalReplacementLength = fReplacementLength;
-    }
-
-    public CustomCompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString,
-            IContextInformation contextInformation, String additionalProposalInfo, int relevance) {
-        this(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, relevance, true);
-    }
-
-    public void apply(IDocument document) {
-        CompletionProposal proposal = new CompletionProposal(getReplacementString(), getReplacementOffset(), getReplacementLength(), getCursorPosition(), getImage(), getDisplayString(),
-                getContextInformation(), getAdditionalProposalInfo());
-        proposal.apply(document);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension#apply(org.eclipse.jface.text.IDocument,
-     *      char, int)
-     */
-    public void apply(IDocument document, char trigger, int offset) {
-        CompletionProposal proposal = new CompletionProposal(getReplacementString(), getReplacementOffset(), getReplacementLength(), getCursorPosition(), getImage(), getDisplayString(),
-                getContextInformation(), getAdditionalProposalInfo());
-        // we currently don't do anything special for which character
-        // selected the proposal, and where the cursor offset is
-        // but we might in the future...
-        proposal.apply(document);
-        // we want to ContextInformationPresenter.updatePresentation() here
-    }
-
-    public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
-        IDocument document = viewer.getDocument();
-        // CMVC 252634 to compensate for "invisible" initial region
-        int caretOffset = viewer.getTextWidget().getCaretOffset();
-        if (viewer instanceof ITextViewerExtension5) {
-            ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
-            caretOffset = extension.widgetOffset2ModelOffset(caretOffset);
-        } else {
-            caretOffset = viewer.getTextWidget().getCaretOffset() + viewer.getVisibleRegion().getOffset();
-        }
-
-        if (caretOffset == getReplacementOffset()) {
-            apply(document);
-        } else {
-            // replace the text without affecting the caret Position as this
-            // causes the cursor to move on its own
-            try {
-                int endOffsetOfChanges = getReplacementString().length() + getReplacementOffset();
-                // Insert the portion of the new text that comes after the
-                // current caret position
-                if (endOffsetOfChanges >= caretOffset) {
-                    int postCaretReplacementLength = getReplacementOffset() + getReplacementLength() - caretOffset;
-                    int preCaretReplacementLength = getReplacementString().length() - (endOffsetOfChanges - caretOffset);
-                    if (postCaretReplacementLength < 0) {
-                        if (Debug.displayWarnings) {
-                            System.out.println("** postCaretReplacementLength was negative: " + postCaretReplacementLength); //$NON-NLS-1$
-                        }
-                        // This is just a quick fix while I figure out what
-                        // replacement length is supposed to be
-                        // in each case, otherwise we'll get negative
-                        // replacment length sometimes
-                        postCaretReplacementLength = 0;
-                    }
-                    document.replace(caretOffset, postCaretReplacementLength, getReplacementString().substring(preCaretReplacementLength));
-                }
-                // Insert the portion of the new text that comes before the
-                // current caret position
-                // Done second since offsets would change for the post text
-                // otherwise
-                // Outright insertions are handled here
-                if (caretOffset > getReplacementOffset()) {
-                    int preCaretTextLength = caretOffset - getReplacementOffset();
-                    document.replace(getReplacementOffset(), preCaretTextLength, getReplacementString().substring(0, preCaretTextLength));
-                }
-            } catch (BadLocationException x) {
-                apply(document);
-            } catch (StringIndexOutOfBoundsException e) {
-                apply(document);
-            }
-        }
-    }
-
-    public String getAdditionalProposalInfo() {
-        // return fProposal.getAdditionalProposalInfo();
-        return fAdditionalProposalInfo;
-    }
-
-    public IContextInformation getContextInformation() {
-        // return fProposal.getContextInformation();
-        return fContextInformation;
-    }
-
-    public void setContextInformation(IContextInformation contextInfo) {
-        fContextInformation = contextInfo;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension#getContextInformationPosition()
-     */
-    public int getContextInformationPosition() {
-        return getCursorPosition();
-    }
-
-    public int getCursorPosition() {
-        return fCursorPosition;
-    }
-
-    public void setCursorPosition(int pos) {
-        fCursorPosition = pos;
-    }
-
-    public String getDisplayString() {
-        // return fProposal.getDisplayString();
-        return fDisplayString;
-    }
-
-    public Image getImage() {
-        // return fProposal.getImage();
-        return fImage;
-    }
-
-    public int getRelevance() {
-        return fRelevance;
-    }
-
-    public int getReplacementLength() {
-        return fReplacementLength;
-    }
-
-    public int getReplacementOffset() {
-        return fReplacementOffset;
-    }
-
-    public String getReplacementString() {
-        return fReplacementString;
-    }
-
-    public Point getSelection(IDocument document) {
-        // return fProposal.getSelection(document);
-        CompletionProposal proposal = new CompletionProposal(getReplacementString(), getReplacementOffset(), getReplacementLength(), getCursorPosition(), getImage(), getDisplayString(),
-                getContextInformation(), getAdditionalProposalInfo());
-        return proposal.getSelection(document);
-    }
-
-    /**
-     * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension#getTriggerCharacters()
-     */
-
-    public char[] getTriggerCharacters() {
-        return fTriggers;
-    }
-
-    public void setTriggerCharacters(char[] triggers) {
-        fTriggers = triggers;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension#isValidFor(org.eclipse.jface.text.IDocument,
-     *      int)
-     */
-    public boolean isValidFor(IDocument document, int offset) {
-        return validate(document, offset, null);
-    }
-
-    /**
-     * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#selected(org.eclipse.jface.text.ITextViewer,
-     *      boolean)
-     */
-    public void selected(ITextViewer viewer, boolean smartToggle) {
-    }
-
-    // code is borrowed from JavaCompletionProposal
-    protected boolean startsWith(IDocument document, int offset, String word) {
-        int wordLength = word == null ? 0 : word.length();
-        if (offset > fReplacementOffset + wordLength)
-            return false;
-
-        try {
-            int length = offset - fReplacementOffset;
-            String start = document.get(fReplacementOffset, length);
-            return word.substring(0, length).equalsIgnoreCase(start);
-        } catch (BadLocationException x) {
-        }
-
-        return false;
-    }
-
-    /**
-     * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#unselected(org.eclipse.jface.text.ITextViewer)
-     */
-    public void unselected(ITextViewer viewer) {
-    }
-
-    /**
-     * borrowed from JavaCompletionProposal
-     * 
-     * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#validate(org.eclipse.jface.text.IDocument,
-     *      int, org.eclipse.jface.text.DocumentEvent)
-     */
-    public boolean validate(IDocument document, int offset, DocumentEvent event) {
-        if (offset < fReplacementOffset)
-            return false;
-        boolean validated = startsWith(document, offset, fDisplayString);
-        // CMVC 269884
-        if (fUpdateLengthOnValidate) {
-            int newLength = offset - getReplacementOffset();
-            int delta = newLength - fOriginalReplacementLength;
-            fReplacementLength = delta + fOriginalReplacementLength;
-        }
-        return validated;
-    }
-    
-    /**
-     * @param replacementOffset The fReplacementOffset to set.
-     */
-    public void setReplacementOffset(int replacementOffset) {
-        fReplacementOffset = replacementOffset;
-    }
-    /**
-     * @param replacementString The fReplacementString to set.
-     */
-    public void setReplacementString(String replacementString) {
-        fReplacementString = replacementString;
-    }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceCompletionProposal.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceCompletionProposal.java
deleted file mode 100644
index d67b10e..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceCompletionProposal.java
+++ /dev/null
@@ -1,28 +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.sse.ui.internal.contentassist;
-
-
-/**
- * CompletionProposal with a relevance value. The relevance value is used to
- * sort the completion proposals. Proposals with higher relevance should be
- * listed before proposals with lower relevance.
- * 
- * @author pavery
- */
-public interface IRelevanceCompletionProposal {
-	/**
-	 * Returns the relevance of the proposal.
-	 */
-	int getRelevance();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceConstants.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceConstants.java
deleted file mode 100644
index ba5a16e..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceConstants.java
+++ /dev/null
@@ -1,17 +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.sse.ui.internal.contentassist;
-
-public interface IRelevanceConstants {
-	int R_NONE = 0;
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java
deleted file mode 100644
index 62bb1dc..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java
+++ /dev/null
@@ -1,127 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- * 
- */
-package org.eclipse.wst.sse.ui.internal.contentassist;
-
-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.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-
-public class StructuredContentAssistant extends ContentAssistant {
-	private static final String CONTENT_ASSIST_PROCESSOR_EXTENDED_ID = "contentassistprocessor"; //$NON-NLS-1$
-
-	/**
-	 * personal list of content assist processors
-	 */
-	private Map fProcessors;
-	/**
-	 * list of partition types where extended processors have been installed
-	 */
-	private List fInstalledExtendedContentTypes;
-
-	/**
-	 * Each set content assist processor is placed inside a
-	 * CompoundContentAssistProcessor which allows multiple processors per
-	 * partition type
-	 * 
-	 * @param processor
-	 *            the content assist processor to register, or
-	 *            <code>null</code> to remove an existing one
-	 * @param contentType
-	 *            the content type under which to register
-	 */
-	public void setContentAssistProcessor(IContentAssistProcessor processor, String partitionType) {
-		if (fProcessors == null)
-			fProcessors = new HashMap();
-
-		CompoundContentAssistProcessor compoundProcessor = (CompoundContentAssistProcessor) getContentAssistProcessor(partitionType);
-
-		// if processor is null, you want to remove all processors of
-		// contentType
-		if (processor == null && compoundProcessor != null) {
-			compoundProcessor.dispose();
-			fProcessors.remove(partitionType);
-			compoundProcessor = null;
-		}
-		if (processor != null) {
-			// create a new compoundprocess if there already isnt one
-			if (compoundProcessor == null) {
-				compoundProcessor = new CompoundContentAssistProcessor();
-			}
-			// add processor to compound processor
-			compoundProcessor.add(processor);
-			// add compound procesor to processors list (will replace old one,
-			// even if same instance)
-			fProcessors.put(partitionType, compoundProcessor);
-		}
-		super.setContentAssistProcessor(compoundProcessor, partitionType);
-	}
-
-	/**
-	 * Returns the content assist processor to be used for the given content
-	 * type. Also installs any content assist processors that were added by
-	 * extension point.
-	 * 
-	 * @param contentType
-	 *            the type of the content for which this content assistant is
-	 *            to be requested
-	 * @return an instance content assist processor or <code>null</code> if
-	 *         none exists for the specified content type
-	 */
-	public IContentAssistProcessor getContentAssistProcessor(String partitionType) {
-		if (fInstalledExtendedContentTypes == null || !fInstalledExtendedContentTypes.contains(partitionType)) {
-			// get extended content assist processors that have not already
-			// been set
-			List processors = ExtendedConfigurationBuilder.getInstance().getConfigurations(CONTENT_ASSIST_PROCESSOR_EXTENDED_ID, partitionType);
-			if (processors != null && !processors.isEmpty()) {
-				Iterator iter = processors.iterator();
-				while (iter.hasNext()) {
-					IContentAssistProcessor processor = (IContentAssistProcessor) iter.next();
-					setContentAssistProcessor(processor, partitionType);
-				}
-			}
-			// add partition type to list of extended partition types
-			// installed (regardless of whether or not any extended content
-			// assist processors were installed because dont want to look it
-			// up every time)
-			if (fInstalledExtendedContentTypes == null)
-				fInstalledExtendedContentTypes = new ArrayList();
-			fInstalledExtendedContentTypes.add(partitionType);
-		}
-
-		IContentAssistProcessor processor = super.getContentAssistProcessor(partitionType);
-		return processor;
-	}
-
-	public void uninstall() {
-		// dispose of all content assist processors
-		if (fProcessors != null && !fProcessors.isEmpty()) {
-			Collection collection = fProcessors.values();
-			Iterator iter = collection.iterator();
-			while (iter.hasNext()) {
-				((CompoundContentAssistProcessor) iter.next()).dispose();
-			}
-			fProcessors.clear();
-		}
-		// clear out list of installed content types
-		if (fInstalledExtendedContentTypes != null) {
-			fInstalledExtendedContentTypes.clear();
-		}
-		super.uninstall();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java
deleted file mode 100644
index 2f1874c..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java
+++ /dev/null
@@ -1,708 +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.sse.ui.internal.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IContributionManager;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.util.DelegatingDragAdapter;
-import org.eclipse.jface.util.DelegatingDropAdapter;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.util.TransferDragSourceListener;
-import org.eclipse.jface.util.TransferDropTargetListener;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DragSource;
-import org.eclipse.swt.dnd.DropTarget;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.part.IShowInSource;
-import org.eclipse.ui.part.IShowInTarget;
-import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.ui.part.ShowInContext;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
-
-
-public class ConfigurableContentOutlinePage extends ContentOutlinePage implements IAdaptable {
-	/*
-	 * Menu listener to create the additions group and add any menu items
-	 * contributed by the configuration; required since the context menu is
-	 * cleared every time it is shown
-	 */
-	class AdditionGroupAdder implements IMenuListener {
-		public void menuAboutToShow(IMenuManager manager) {
-			IContributionItem[] items = manager.getItems();
-			if (items.length > 0 && items[items.length - 1].getId() != null) {
-				manager.insertAfter(items[items.length - 1].getId(), new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-			}
-			else {
-				manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-			}
-
-			// add configuration's menu items
-			IMenuListener listener = getConfiguration().getMenuListener(getTreeViewer());
-			if (listener != null) {
-				listener.menuAboutToShow(manager);
-			}
-		}
-	}
-
-	/**
-	 * Provides double-click registration so it can be done before the Control
-	 * is created.
-	 */
-	private class DoubleClickProvider implements IDoubleClickListener {
-		private IDoubleClickListener[] listeners = null;
-
-		void addDoubleClickListener(IDoubleClickListener newListener) {
-			if (listeners == null) {
-				listeners = new IDoubleClickListener[]{newListener};
-			}
-			else {
-				IDoubleClickListener[] newListeners = new IDoubleClickListener[listeners.length + 1];
-				System.arraycopy(listeners, 0, newListeners, 0, listeners.length);
-				newListeners[listeners.length] = newListener;
-				listeners = newListeners;
-			}
-		}
-
-		public void doubleClick(DoubleClickEvent event) {
-			fireDoubleClickEvent(event);
-		}
-
-		private void fireDoubleClickEvent(final DoubleClickEvent event) {
-			IDoubleClickListener[] firingListeners = listeners;
-			for (int i = 0; i < firingListeners.length; ++i) {
-				final IDoubleClickListener l = firingListeners[i];
-				Platform.run(new SafeRunnable() {
-					public void run() {
-						l.doubleClick(event);
-					}
-				});
-			}
-		}
-
-		void removeDoubleClickListener(IDoubleClickListener oldListener) {
-			if (listeners != null) {
-				if (listeners.length == 1 && listeners[0].equals(oldListener)) {
-					listeners = null;
-				}
-				else {
-					List newListeners = new ArrayList(Arrays.asList(listeners));
-					newListeners.remove(oldListener);
-					listeners = (IDoubleClickListener[]) newListeners.toArray(new IDoubleClickListener[listeners.length - 1]);
-				}
-			}
-		}
-	}
-
-	/**
-	 * Listens to post selection from the selection service, applying it to
-	 * the tree viewer.
-	 */
-	private class PostSelectionServiceListener implements ISelectionListener {
-		public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-			// from selection service
-			_DEBUG_TIME = System.currentTimeMillis();
-			if (getControl() != null && !getControl().isDisposed() && !getControl().isFocusControl() && getControl().isVisible() && !fSelectionProvider.isFiringSelection()) {
-				/*
-				 * Do not allow selection from other parts to affect selection
-				 * in the tree widget if it has focus. Selection events
-				 * "bouncing" off of other parts are all that we can receive
-				 * if we have focus (since we forward selection to the
-				 * service), and only the user should affect selection if we
-				 * have focus.
-				 */
-				ISelection validContentSelection = getConfiguration().getSelection(getTreeViewer(), selection);
-				getTreeViewer().refresh(true);
-				boolean isLinked = getConfiguration().isLinkedWithEditor(getTreeViewer());
-				if (isLinked) {
-					getTreeViewer().setSelection(validContentSelection, true);
-				}
-			}
-			if (_DEBUG) {
-				System.out.println("(O:" + (System.currentTimeMillis() - _DEBUG_TIME) + "ms) " + part + " : " + selection); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			}
-		}
-	}
-
-	/**
-	 * Forwards post-selection from the tree viewer to the listeners while
-	 * acting as this page's selection provider.
-	 */
-	private class SelectionProvider implements IPostSelectionProvider {
-		private class PostSelectionChangedListener implements ISelectionChangedListener {
-			public void selectionChanged(SelectionChangedEvent event) {
-				if (!isFiringSelection()) {
-					fireSelectionChanged(event, postListeners);
-				}
-			}
-		}
-
-		private class SelectionChangedListener implements ISelectionChangedListener {
-			public void selectionChanged(SelectionChangedEvent event) {
-				if (!isFiringSelection()) {
-					fireSelectionChanged(event, listeners);
-				}
-			}
-		}
-
-		private boolean isFiringSelection = false;
-		private ListenerList listeners = new ListenerList();
-		private ListenerList postListeners = new ListenerList();
-		private ISelectionChangedListener postSelectionChangedListener = new PostSelectionChangedListener();
-		private ISelectionChangedListener selectionChangedListener = new SelectionChangedListener();
-
-		public void addPostSelectionChangedListener(ISelectionChangedListener listener) {
-			postListeners.add(listener);
-		}
-
-		public void addSelectionChangedListener(ISelectionChangedListener listener) {
-			listeners.add(listener);
-		}
-
-		public void fireSelectionChanged(final SelectionChangedEvent event, ListenerList listenerList) {
-			isFiringSelection = true;
-			Object[] listeners = listenerList.getListeners();
-			for (int i = 0; i < listeners.length; ++i) {
-				final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
-				Platform.run(new SafeRunnable() {
-					public void run() {
-						l.selectionChanged(event);
-					}
-				});
-			}
-			isFiringSelection = false;
-		}
-
-		public ISelectionChangedListener getPostSelectionChangedListener() {
-			return postSelectionChangedListener;
-		}
-
-		public ISelection getSelection() {
-			if (getTreeViewer() != null) {
-				return getTreeViewer().getSelection();
-			}
-			return StructuredSelection.EMPTY;
-		}
-
-		public ISelectionChangedListener getSelectionChangedListener() {
-			return selectionChangedListener;
-		}
-
-		public boolean isFiringSelection() {
-			return isFiringSelection;
-		}
-
-		public void removePostSelectionChangedListener(ISelectionChangedListener listener) {
-			postListeners.remove(listener);
-		}
-
-		public void removeSelectionChangedListener(ISelectionChangedListener listener) {
-			listeners.remove(listener);
-		};
-
-		public void setSelection(ISelection selection) {
-			if (!isFiringSelection) {
-				getTreeViewer().setSelection(selection);
-			}
-		};
-	}
-
-	private class ShowInTarget implements IShowInTarget {
-		/*
-		 * @see org.eclipse.ui.part.IShowInTarget#show(org.eclipse.ui.part.ShowInContext)
-		 */
-		public boolean show(ShowInContext context) {
-			setSelection(context.getSelection());
-			return getTreeViewer().getSelection().equals(context.getSelection());
-		}
-	}
-
-	protected static final ContentOutlineConfiguration NULL_CONFIGURATION = new ContentOutlineConfiguration() {
-		public IContentProvider getContentProvider(TreeViewer viewer) {
-			return new ITreeContentProvider() {
-				public void dispose() {
-				}
-
-				public Object[] getChildren(Object parentElement) {
-					return null;
-				}
-
-				public Object[] getElements(Object inputElement) {
-					return null;
-				}
-
-				public Object getParent(Object element) {
-					return null;
-				}
-
-				public boolean hasChildren(Object element) {
-					return false;
-				}
-
-				public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-				}
-			};
-		}
-	};
-
-	private static final String OUTLINE_CONTEXT_MENU_ID = "org.eclipse.wst.sse.ui.StructuredTextEditor.OutlineContext"; //$NON-NLS-1$
-
-	private static final String OUTLINE_CONTEXT_MENU_SUFFIX = ".source.OutlineContext"; //$NON-NLS-1$
-	private final boolean _DEBUG = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/contentOutline")); //$NON-NLS-1$  //$NON-NLS-2$;
-
-	private long _DEBUG_TIME = 0;
-
-	private TransferDragSourceListener[] fActiveDragListeners;
-	private TransferDropTargetListener[] fActiveDropListeners;
-	private ContentOutlineConfiguration fConfiguration;
-
-	private Menu fContextMenu;
-	private String fContextMenuId;
-
-	private MenuManager fContextMenuManager;
-	private DoubleClickProvider fDoubleClickProvider = null;
-
-	private DelegatingDragAdapter fDragAdapter;
-	private DragSource fDragSource;
-	private DelegatingDropAdapter fDropAdapter;
-	private DropTarget fDropTarget;
-	private IEditorPart fEditor;
-	private IMenuListener fGroupAdder = null;
-	private Object fInput = null;
-
-	private String fInputContentTypeIdentifier = null;
-	private ISelectionListener fSelectionListener = null;
-
-	SelectionProvider fSelectionProvider = null;
-
-	/**
-	 * A ContentOutlinePage that abstract as much behavior as possible away
-	 * from the Controls and varies it by content type.
-	 */
-	public ConfigurableContentOutlinePage() {
-		super();
-		fGroupAdder = new AdditionGroupAdder();
-		fSelectionProvider = new SelectionProvider();
-	}
-
-	/**
-	 * Adds a listener to a list of those notified when someone double-clicks
-	 * in the page.
-	 * 
-	 * @param newListener -
-	 *            the listener to add
-	 */
-	public void addDoubleClickListener(IDoubleClickListener newListener) {
-		if (fDoubleClickProvider == null) {
-			fDoubleClickProvider = new DoubleClickProvider();
-		}
-		fDoubleClickProvider.addDoubleClickListener(newListener);
-	}
-
-	private String computeContextMenuID() {
-		String id = null;
-		if (fInputContentTypeIdentifier != null) {
-			id = fInputContentTypeIdentifier + OUTLINE_CONTEXT_MENU_SUFFIX;
-		}
-		return id;
-	}
-
-	/**
-	 * @see ContentOutlinePage#createControl
-	 */
-	public void createControl(Composite parent) {
-		super.createControl(parent);
-
-		IWorkbenchPage page = getSite().getWorkbenchWindow().getActivePage();
-		if (page != null) {
-			fEditor = page.getActiveEditor();
-		}
-
-		fDragAdapter = new DelegatingDragAdapter();
-		fDragSource = new DragSource(getControl(), DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK);
-		fDropAdapter = new DelegatingDropAdapter();
-		fDropTarget = new DropTarget(getControl(), DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK);
-
-		setConfiguration(getConfiguration());
-
-		/*
-		 * ContentOutlinePage only implements ISelectionProvider while the
-		 * tree viewer implements both ISelectionProvider and
-		 * IPostSelectionProvider. Use an ISelectionProvider that listens to
-		 * post selection from the tree viewer and forward only post selection
-		 * to the selection service.
-		 */
-		getTreeViewer().addPostSelectionChangedListener(fSelectionProvider.getPostSelectionChangedListener());
-		getTreeViewer().addSelectionChangedListener(fSelectionProvider.getSelectionChangedListener());
-		if (fDoubleClickProvider == null) {
-			fDoubleClickProvider = new DoubleClickProvider();
-		}
-		getTreeViewer().addDoubleClickListener(fDoubleClickProvider);
-		getSite().setSelectionProvider(fSelectionProvider);
-	}
-
-	public void dispose() {
-		super.dispose();
-		getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(getSelectionServiceListener());
-		if (fDoubleClickProvider != null) {
-			getTreeViewer().removeDoubleClickListener(fDoubleClickProvider);
-		}
-
-		// dispose menu controls
-		if (fContextMenu != null) {
-			fContextMenu.dispose();
-		}
-		if (fContextMenuManager != null) {
-			fContextMenuManager.removeMenuListener(fGroupAdder);
-			fContextMenuManager.removeAll();
-			fContextMenuManager.dispose();
-		}
-		setConfiguration(NULL_CONFIGURATION);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-	 */
-	public Object getAdapter(Class key) {
-		Object adapter = null;
-		if (key.equals(IShowInTarget.class)) {
-			adapter = new ShowInTarget();
-		}
-		final IEditorPart editor = fEditor;
-
-		if (key.equals(IShowInSource.class) && editor != null) {
-			adapter = new IShowInSource() {
-				public ShowInContext getShowInContext() {
-					return new ShowInContext(editor.getEditorInput(), editor.getEditorSite().getSelectionProvider().getSelection());
-				}
-			};
-		}
-		else if (key.equals(IShowInTargetList.class) && editor != null) {
-			adapter = editor.getAdapter(key);
-		}
-		return adapter;
-	}
-
-	/**
-	 * @return the currently used ContentOutlineConfiguration
-	 */
-	public ContentOutlineConfiguration getConfiguration() {
-		if (fConfiguration == null) {
-			fConfiguration = NULL_CONFIGURATION;
-		}
-		return fConfiguration;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
-	 */
-	public ISelection getSelection() {
-		return fSelectionProvider.getSelection();
-	}
-
-	private ISelectionListener getSelectionServiceListener() {
-		if (fSelectionListener == null) {
-			fSelectionListener = new PostSelectionServiceListener();
-		}
-		return fSelectionListener;
-	}
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.part.IPageBookViewPage#init(org.eclipse.ui.part.IPageSite)
-	 */
-	public void init(IPageSite pageSite) {
-		super.init(pageSite);
-		pageSite.getWorkbenchWindow().getSelectionService().addPostSelectionListener(getSelectionServiceListener());
-	}
-
-	/**
-	 * Removes a listener to a list of those notified when someone
-	 * double-clicks in the page.
-	 * 
-	 * @param oldListener -
-	 *            the listener to remove
-	 */
-	public void removeDoubleClickListener(IDoubleClickListener oldListener) {
-		if (fDoubleClickProvider != null) {
-			fDoubleClickProvider.removeDoubleClickListener(oldListener);
-		}
-	}
-
-	/**
-	 * Configures (or reconfigures) the page according to the given
-	 * configuration.
-	 * 
-	 * @param configuration
-	 */
-	public void setConfiguration(ContentOutlineConfiguration configuration) {
-		// intentionally do not check to see if the new configuration != old
-		// configuration
-		if (getTreeViewer() != null) {
-			// remove the key listeners
-			if (getControl() != null && !getControl().isDisposed()) {
-				KeyListener[] listeners = getConfiguration().getKeyListeners(getTreeViewer());
-				if (listeners != null) {
-					for (int i = 0; i < listeners.length; i++) {
-						getControl().removeKeyListener(listeners[i]);
-					}
-				}
-			}
-
-			IContributionManager toolbar = getSite().getActionBars().getToolBarManager();
-			if (toolbar != null) {
-				IContributionItem[] toolbarItems = getConfiguration().getToolbarContributions(getTreeViewer());
-				if (toolbarItems != null && toolbarItems.length > 0) {
-					for (int i = 0; i < toolbarItems.length; i++) {
-						toolbar.remove(toolbarItems[i]);
-					}
-					toolbar.update(false);
-				}
-			}
-
-			IContributionManager menubar = getSite().getActionBars().getMenuManager();
-			if (menubar != null) {
-				IContributionItem[] menuItems = getConfiguration().getMenuContributions(getTreeViewer());
-				if (menuItems != null && menuItems.length > 0) {
-					for (int i = 0; i < menuItems.length; i++) {
-						menubar.remove(menuItems[i]);
-					}
-					menubar.remove(IWorkbenchActionConstants.MB_ADDITIONS);
-					menubar.update(false);
-				}
-			}
-			// clear the DnD listeners and transfer types
-			if (fDragAdapter != null && !fDragAdapter.isEmpty() && !fDragSource.isDisposed() && fDragSource.getTransfer().length > 0) {
-				if (fActiveDragListeners != null) {
-					for (int i = 0; i < fActiveDragListeners.length; i++) {
-						fDragAdapter.removeDragSourceListener(fActiveDragListeners[i]);
-					}
-				}
-				fActiveDragListeners = null;
-				fDragSource.removeDragListener(fDragAdapter);
-				fDragSource.setTransfer(new Transfer[0]);
-			}
-			if (fDropAdapter != null && !fDropAdapter.isEmpty() && !fDropTarget.isDisposed() && fDropTarget.getTransfer().length > 0) {
-				if (fActiveDropListeners != null) {
-					for (int i = 0; i < fActiveDropListeners.length; i++) {
-						fDropAdapter.removeDropTargetListener(fActiveDropListeners[i]);
-					}
-				}
-				fActiveDropListeners = null;
-				fDropTarget.removeDropListener(fDropAdapter);
-				fDropTarget.setTransfer(new Transfer[0]);
-			}
-			getConfiguration().getContentProvider(getTreeViewer()).inputChanged(getTreeViewer(), fInput, null);
-			// release any ties to this tree viewer
-			getConfiguration().unconfigure(getTreeViewer());
-		}
-
-		fConfiguration = configuration;
-
-		if (getTreeViewer() != null && getControl() != null && !getControl().isDisposed()) {
-			// (re)set the providers
-			getTreeViewer().setLabelProvider(getConfiguration().getLabelProvider(getTreeViewer()));
-			getTreeViewer().setContentProvider(getConfiguration().getContentProvider(getTreeViewer()));
-
-			// view toolbar
-			IContributionManager toolbar = getSite().getActionBars().getToolBarManager();
-			if (toolbar != null) {
-				IContributionItem[] toolbarItems = getConfiguration().getToolbarContributions(getTreeViewer());
-				if (toolbarItems != null) {
-					for (int i = 0; i < toolbarItems.length; i++) {
-						toolbar.add(toolbarItems[i]);
-					}
-					toolbar.update(true);
-				}
-			}
-			// view menu
-			IContributionManager menu = getSite().getActionBars().getMenuManager();
-			if (menu != null) {
-				IContributionItem[] menuItems = getConfiguration().getMenuContributions(getTreeViewer());
-				if (menuItems != null) {
-					for (int i = 0; i < menuItems.length; i++) {
-						menuItems[i].setVisible(true);
-						menu.add(menuItems[i]);
-						menuItems[i].update();
-					}
-					menu.update(true);
-				}
-			}
-			// add the allowed DnD listeners and types
-			TransferDragSourceListener[] dragListeners = getConfiguration().getTransferDragSourceListeners(getTreeViewer());
-			if (fDragAdapter != null && dragListeners.length > 0) {
-				for (int i = 0; i < dragListeners.length; i++) {
-					fDragAdapter.addDragSourceListener(dragListeners[i]);
-				}
-				fActiveDragListeners = dragListeners;
-				fDragSource.addDragListener(fDragAdapter);
-				fDragSource.setTransfer(fDragAdapter.getTransfers());
-			}
-			TransferDropTargetListener[] dropListeners = getConfiguration().getTransferDropTargetListeners(getTreeViewer());
-			if (fDropAdapter != null && dropListeners.length > 0) {
-				for (int i = 0; i < dropListeners.length; i++) {
-					fDropAdapter.addDropTargetListener(dropListeners[i]);
-				}
-				fActiveDropListeners = dropListeners;
-				fDropTarget.addDropListener(fDropAdapter);
-				fDropTarget.setTransfer(fDropAdapter.getTransfers());
-			}
-			// add the key listeners
-			KeyListener[] listeners = getConfiguration().getKeyListeners(getTreeViewer());
-			if (listeners != null) {
-				for (int i = 0; i < listeners.length; i++) {
-					getControl().addKeyListener(listeners[i]);
-				}
-			}
-		}
-
-		if (fInput != null) {
-			setInput(fInput);
-		}
-	}
-
-	/**
-	 * @param editor
-	 *            The IEditorPart that "owns" this page. Used to support the
-	 *            "Show In..." menu.
-	 */
-	public void setEditorPart(IEditorPart editor) {
-		fEditor = editor;
-	}
-
-	/**
-	 * @param newInput
-	 *            The input for the page's viewer. Should only be set after a
-	 *            configuration has been applied.
-	 */
-	public void setInput(Object newInput) {
-		fInput = newInput;
-		/*
-		 * Intentionally not optimized for checking new input vs. old input so
-		 * that any existing content providers can be updated
-		 */
-		if (getControl() != null && !getControl().isDisposed()) {
-			getTreeViewer().setInput(fInput);
-			updateContextMenuId();
-		}
-	}
-
-	/**
-	 * @param id -
-	 *            the content type identifier to use for further extension
-	 */
-	public void setInputContentTypeIdentifier(String id) {
-		fInputContentTypeIdentifier = id;
-	}
-
-	/**
-	 * Updates the outline page's context menu for the current input
-	 */
-	private void updateContextMenuId() {
-		String computedContextMenuId = null;
-		// update outline view's context menu control and ID
-
-		if (fEditor == null) {
-			IWorkbenchPage page = getSite().getWorkbenchWindow().getActivePage();
-			if (page != null) {
-				fEditor = page.getActiveEditor();
-			}
-		}
-
-		computedContextMenuId = computeContextMenuID();
-
-		if (computedContextMenuId == null) {
-			computedContextMenuId = OUTLINE_CONTEXT_MENU_ID;
-		}
-
-		/*
-		 * Update outline context menu id if updating to a new id or if
-		 * context menu is not already set up
-		 */
-		if (!computedContextMenuId.equals(fContextMenuId) || (fContextMenu == null)) {
-			fContextMenuId = computedContextMenuId;
-
-			if (getControl() != null && !getControl().isDisposed()) {
-				// dispose of previous context menu
-				if (fContextMenu != null) {
-					fContextMenu.dispose();
-				}
-				if (fContextMenuManager != null) {
-					fContextMenuManager.removeMenuListener(fGroupAdder);
-					fContextMenuManager.removeAll();
-					fContextMenuManager.dispose();
-				}
-
-				fContextMenuManager = new MenuManager(fContextMenuId, fContextMenuId);
-				fContextMenuManager.setRemoveAllWhenShown(true);
-
-				fContextMenuManager.addMenuListener(fGroupAdder);
-
-				fContextMenu = fContextMenuManager.createContextMenu(getControl());
-				getControl().setMenu(fContextMenu);
-
-				getSite().registerContextMenu(fContextMenuId, fContextMenuManager, this);
-
-				/*
-				 * also register this menu for source page part and structured
-				 * text outline view ids
-				 */
-				if (fEditor != null) {
-					String partId = fEditor.getSite().getId();
-					if (partId != null) {
-						getSite().registerContextMenu(partId + OUTLINE_CONTEXT_MENU_SUFFIX, fContextMenuManager, this);
-					}
-				}
-				getSite().registerContextMenu(OUTLINE_CONTEXT_MENU_ID, fContextMenuManager, this);
-			}
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapter.java
deleted file mode 100644
index 1e96d5d..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapter.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.sse.ui.internal.contentoutline;
-
-
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-
-
-public interface IJFaceNodeAdapter extends INodeAdapter {
-
-	public Object[] getChildren(Object node);
-
-	/**
-	 * Returns an enumeration with the elements belonging to the passed
-	 * element. These are the top level items in a list, tree, table, etc...
-	 */
-	public Object[] getElements(Object node);
-
-	/**
-	 * Fetches the label image specific to this object instance.
-	 */
-	public Image getLabelImage(Object node);
-
-	/**
-	 * Fetches the label text specific to this object instance.
-	 */
-	public String getLabelText(Object node);
-
-	public Object getParent(Object node);
-
-	public boolean hasChildren(Object node);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapterFactory.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapterFactory.java
deleted file mode 100644
index 2a47fe1..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapterFactory.java
+++ /dev/null
@@ -1,26 +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.sse.ui.internal.contentoutline;
-
-import java.util.Collection;
-
-public interface IJFaceNodeAdapterFactory {
-	public void addListener(Object listener);
-
-	/**
-	 * returns "copy" so no one can modify our list. Its is a shallow copy.
-	 */
-	public Collection getListeners();
-
-	public void removeListener(Object listener);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateAction.java
deleted file mode 100644
index 3a538c2..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateAction.java
+++ /dev/null
@@ -1,80 +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.sse.ui.internal.contentoutline;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * An IAction.AS_CHECK_BOX action that sets and gets its checked state along
- * with a value from a preference store. Should be used with
- * PropertyChangeUpdateActionContributionItem to listen to changes in the
- * store and update the checked state from PropertyChangeEvents.
- */
-public class PropertyChangeUpdateAction extends Action implements IUpdate {
-	private String fPreferenceKey;
-	private IPreferenceStore fStore;
-	private boolean fUpdateFromPropertyChange = true;
-
-	public PropertyChangeUpdateAction(String text, IPreferenceStore store, String preferenceKey, boolean defaultValue) {
-		super(text, IAction.AS_CHECK_BOX);
-		fPreferenceKey = preferenceKey;
-		fStore = store;
-		fStore.setDefault(getPreferenceKey(), defaultValue);
-		setId(getPreferenceKey());
-		setChecked(getPreferenceStore().getBoolean(getPreferenceKey()));
-	}
-
-	/**
-	 * @return Returns the orderPreferenceKey.
-	 */
-	public String getPreferenceKey() {
-		return fPreferenceKey;
-	}
-
-	/**
-	 * @return Returns the store.
-	 */
-	public IPreferenceStore getPreferenceStore() {
-		return fStore;
-	}
-
-	/**
-	 * @return Returns the updateFromPropertyChange.
-	 */
-	public boolean isUpdateFromPropertyChange() {
-		return fUpdateFromPropertyChange;
-	}
-
-	public final void run() {
-		super.run();
-		fStore.setValue(getPreferenceKey(), isChecked());
-		if (!isUpdateFromPropertyChange())
-			update();
-	}
-
-	/**
-	 * @param updateFromPropertyChange
-	 *            The updateFromPropertyChange to set.
-	 */
-	public void setUpdateFromPropertyChange(boolean updateFromPropertyChange) {
-		fUpdateFromPropertyChange = updateFromPropertyChange;
-	}
-
-	public void update() {
-		setChecked(fStore.getBoolean(getPreferenceKey()));
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java
deleted file mode 100644
index 5c642ea..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java
+++ /dev/null
@@ -1,85 +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.sse.ui.internal.contentoutline;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * A listener on the given action's PreferenceStore. It calls .update() on the
- * action when the given key changes value.
- */
-public class PropertyChangeUpdateActionContributionItem extends ActionContributionItem {
-
-	private class PreferenceUpdateListener implements IPropertyChangeListener {
-		public void propertyChange(PropertyChangeEvent event) {
-			if (event.getProperty().equals(fProperty)) {
-				if (debug) {
-					System.out.println(fProperty + " preference changed, updating " + getAction()); //$NON-NLS-1$
-				}
-				((IUpdate) getAction()).update();
-			}
-		}
-	}
-
-	static final boolean debug = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/propertyChangeUpdateActionContributionItem")); //$NON-NLS-1$  //$NON-NLS-2$;
-
-	private IPropertyChangeListener fListener = null;
-
-	protected String fProperty = null;
-	private IPreferenceStore fStore;
-
-	public PropertyChangeUpdateActionContributionItem(PropertyChangeUpdateAction action) {
-		super(action);
-		fProperty = action.getPreferenceKey();
-		fStore = action.getPreferenceStore();
-		fListener = new PreferenceUpdateListener();
-		connect();
-	}
-
-	public void connect() {
-		if (debug) {
-			System.out.println("PropertyChangeUpdateActionContributionItem started listening for " + fProperty); //$NON-NLS-1$
-		}
-		if (fStore != null) {
-			fStore.addPropertyChangeListener(fListener);
-		}
-	}
-
-	public void disconnect() {
-		if (debug) {
-			System.out.println("PropertyChangeUpdateActionContributionItem stopped listening for " + fProperty); //$NON-NLS-1$
-		}
-		if (fStore != null) {
-			fStore.removePropertyChangeListener(fListener);
-		}
-	}
-
-	public void dispose() {
-		super.dispose();
-		disconnect();
-		fProperty = null;
-		fStore = null;
-	}
-
-	public String toString() {
-		if (getAction().getId() != null)
-			return super.toString();
-		else
-			return getClass().getName() + "(text=" + getAction().getText() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboList.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboList.java
deleted file mode 100644
index 7222ce6..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboList.java
+++ /dev/null
@@ -1,285 +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.sse.ui.internal.contentproperties.ui;
-
-
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-
-public class ComboList {
-	private Combo combo;
-
-
-	private List list;
-
-	public ComboList(Composite parent, int style) {
-		combo = new Combo(parent, style);
-		list = new ArrayList();
-	}
-
-
-	/*
-	 * following methods is original method of Combo class.
-	 */
-	public void add(String key) {
-		checkError();
-		combo.add(key);
-		list.add(key);
-	}
-
-	public void add(String key, int index) {
-		checkError();
-		combo.add(key, index);
-		list.add(index, key);
-	}
-
-	public void add(String key, String value) {
-		checkError();
-		combo.add(key);
-		list.add(value);
-	}
-
-	public void add(String key, String value, int index) {
-		checkError();
-		combo.add(key, index);
-		list.add(index, value);
-	}
-
-	public void addFocusListener(FocusListener listener) {
-		combo.addFocusListener(listener);
-	}
-
-	public void addModifyListener(org.eclipse.swt.events.ModifyListener listener) {
-		combo.addModifyListener(listener);
-	}
-
-	public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener) {
-		combo.addSelectionListener(listener);
-
-	}
-
-	private void checkError() {
-		if (!isConsistency()) {
-			Logger.log(Logger.WARNING, "Difference between the number of keys[" + combo.getItemCount() + "] and the number of values[" + list.size() + "] in ComboList"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		}
-	}
-
-	public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint) {
-		return combo.computeSize(wHint, hHint);
-	}
-
-	public Map createHashtable() {
-		checkError();
-		Map m = new Hashtable();
-		for (int i = 0; i < list.size(); i++)
-			m.put(combo.getItem(i), list.get(i));
-		return m;
-	}
-
-	public void deselect(int i) {
-		combo.deselect(i);
-	}
-
-	public void deselectAll() {
-		combo.deselectAll();
-	}
-
-	public boolean equals(Object obj) {
-		return combo.equals(obj);
-	}
-
-	private void exchangePosition(int i, int j) {
-		String tmpKey = getItem(i);
-		Object tmpValue = list.remove(i);
-
-		combo.setItem(i, getItem(j));
-		list.add(i, list.remove(j - 1));
-
-		combo.setItem(j, tmpKey);
-		list.add(j, tmpValue);
-	}
-
-	public boolean existsAsKey(String str) {
-		if (combo.indexOf(str) >= 0)
-			return true;
-		else
-			return false;
-	}
-
-	public boolean existsAsValue(String str) {
-		if (list.indexOf(str) >= 0)
-			return true;
-		else
-			return false;
-	}
-
-	public boolean getEnabled() {
-		return combo.getEnabled();
-	}
-
-	public String getItem(int index) {
-		return combo.getItem(index);
-	}
-
-	public int getItemCount() {
-		return combo.getItemCount();
-	}
-
-	public String getKey(String value) {
-		if (value == null)
-			return null;
-		int index = -1;
-		checkError();
-		for (int i = 0; i < list.size(); i++) {
-			if (!list.get(i).equals(value))
-				continue;
-			index = i;
-			break;
-		}
-		if (index != -1)
-			return combo.getItem(index);
-		else
-			return null;
-	}
-
-	public Object getLayoutData() {
-		return combo.getLayoutData();
-	}
-
-	public String getSelectedValue() {
-		checkError();
-		int index = getSelectionIndex();
-		if (index < 0)
-			return null;
-		return getValue(getItem(index));
-	}
-
-	public int getSelectionIndex() {
-		return combo.getSelectionIndex();
-	}
-
-	public String getText() {
-		return combo.getText();
-	}
-
-	public String getValue(String key) {
-		if (key == null)
-			return null;
-		int index = -1;
-		checkError();
-		for (int i = 0; i < combo.getItemCount(); i++) {
-			if (!combo.getItem(i).equals(key))
-				continue;
-			index = i;
-			break;
-		}
-		if (index != -1)
-			return (String) list.get(index);
-		else
-			return null;
-	}
-
-	public int indexOf(String str) {
-		return combo.indexOf(str);
-	}
-
-
-	public boolean isConsistency() {
-
-		if (list.size() == combo.getItemCount())
-			return true;
-		else
-			return false;
-	}
-
-
-	public void remove(int index) {
-		checkError();
-		combo.remove(index);
-		list.remove(index);
-	}
-
-	public void remove(String str) {
-		checkError();
-		combo.remove(str);
-		list.remove(str);
-	}
-
-	public void select(int index) {
-		combo.select(index);
-	}
-
-	public void setEnabled(boolean enabled) {
-		combo.setEnabled(enabled);
-	}
-
-	public boolean setFocus() {
-		return combo.setFocus();
-	}
-
-	public void setItem(int index, String str) {
-		checkError();
-		combo.setItem(index, str);
-		list.remove(index);
-		list.add(index, str);
-	}
-
-	public void setItem(String[] strArray) {
-		checkError();
-		combo.setItems(strArray);
-		for (int i = 0; i < strArray.length; i++)
-			list.add(strArray[i]);
-	}
-
-	public void setLayout(org.eclipse.swt.widgets.Layout lo) {
-		combo.setLayout(lo);
-	}
-
-	public void setLayoutData(Object layoutData) {
-		combo.setLayoutData(layoutData);
-	}
-
-	public void setSelection(Point point) {
-		combo.setSelection(point);
-	}
-
-	public void setText(String str) {
-		combo.setText(str);
-	}
-
-	public void sortByKey(int offset) {
-		if (offset < 0 || offset > this.combo.getItemCount() - 1)
-			return;
-		checkError();
-		//
-		for (int i = offset; i < combo.getItemCount() - 1; i++) {
-			for (int j = i + 1; j < combo.getItemCount(); j++) {
-				if (getItem(i).compareTo(getItem(j)) > 0) {
-					exchangePosition(i, j);
-				}
-			}
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboListOnPropertyPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboListOnPropertyPage.java
deleted file mode 100644
index 297c860..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboListOnPropertyPage.java
+++ /dev/null
@@ -1,37 +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.sse.ui.internal.contentproperties.ui;
-
-
-
-import org.eclipse.swt.widgets.Composite;
-
-
-public final class ComboListOnPropertyPage extends ComboList {
-
-
-	private String currentApplyValue;
-
-	public ComboListOnPropertyPage(Composite parent, int style) {
-		super(parent, style);
-	}
-
-	public final String getApplyValue() {
-		return currentApplyValue;
-	}
-
-	public final void setApplyValue(String currentApplyValue) {
-		this.currentApplyValue = currentApplyValue;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ContentSettingsPropertyPage.java
deleted file mode 100644
index 6273596..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,287 +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.sse.ui.internal.contentproperties.ui;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-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.IStatus;
-import org.eclipse.core.runtime.Status;
-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.Shell;
-import org.eclipse.ui.dialogs.PropertyPage;
-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.StructuredModelManager;
-import org.eclipse.wst.sse.internal.contentproperties.ContentSettings;
-import org.eclipse.wst.sse.internal.contentproperties.ContentSettingsCreator;
-import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-public abstract class ContentSettingsPropertyPage extends PropertyPage {
-	private static final IStatus STATUS_ERROR = new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.INFO, "ERROR", null); //$NON-NLS-1$
-
-	// for validateEdit()
-	private static final IStatus STATUS_OK = new Status(IStatus.OK, SSEUIPlugin.ID, IStatus.OK, "OK", null); //$NON-NLS-1$
-
-	/**
-	 * Method validateEdit.
-	 * 
-	 * @param file
-	 *            org.eclipse.core.resources.IFile
-	 * @param context
-	 *            org.eclipse.swt.widgets.Shell
-	 * @return IStatus
-	 */
-	private static IStatus validateEdit(IFile file, Shell context) {
-		if (file == null || !file.exists())
-			return STATUS_ERROR;
-		if (!(file.isReadOnly()))
-			return STATUS_OK;
-
-		IPath fullIPath = file.getLocation();
-
-		final long beforeModifiedFromJavaIO = fullIPath.toFile().lastModified();
-		final long beforeModifiedFromIFile = file.getModificationStamp();
-
-		IStatus status = ResourcesPlugin.getWorkspace().validateEdit(new IFile[]{file}, context);
-		if (!status.isOK())
-			return status;
-
-		final long afterModifiedFromJavaIO = fullIPath.toFile().lastModified();
-		final long afterModifiedFromIFile = file.getModificationStamp();
-
-		if (beforeModifiedFromJavaIO != afterModifiedFromJavaIO) {
-			IModelManager manager = StructuredModelManager.getModelManager();
-			IStructuredModel model = manager.getExistingModelForRead(file);
-			if (model != null) {
-				if (!model.isDirty()) {
-					try {
-						file.refreshLocal(IResource.DEPTH_ONE, null);
-					} catch (CoreException e) {
-						return STATUS_ERROR;
-					} finally {
-						model.releaseFromRead();
-					}
-				} else {
-					model.releaseFromRead();
-				}
-			}
-		}
-
-		if ((beforeModifiedFromJavaIO != afterModifiedFromJavaIO) || (beforeModifiedFromIFile != afterModifiedFromIFile)) {
-			// the file is replaced. Modification cannot be
-			// applied.
-			return STATUS_ERROR;
-		}
-		return STATUS_OK;
-	}
-
-	protected ComboListOnPropertyPage[] combo;
-	protected Composite composite;
-
-	protected IContentSettings contentSettings;
-	protected final String CSS_LABEL = SSEUIMessages.UI_CSS_profile___2; //$NON-NLS-1$
-	protected final String DEVICE_LABEL = SSEUIMessages.UI_Target_Device___3; //$NON-NLS-1$
-
-	protected final String DOCUMENT_LABEL = SSEUIMessages.UI_Default_HTML_DOCTYPE_ID___1; //$NON-NLS-1$
-	protected int numberOfCombo;
-	protected int numCols = 1;
-	protected int numRows = 1;
-	protected Composite propertyPage;
-
-	public ContentSettingsPropertyPage() {
-		super();
-	}
-
-	private void cleanUp() {
-		// Are There any way to guarantee to call cleanUp() to re-load
-		// downloaded .contentsettings file
-		// after ContentSettings.releaseCache() in ContentSettingSelfHandler
-		// class, which is called by resourceChangeEvent
-	}
-
-
-	protected ComboListOnPropertyPage createComboBoxOf(String title) {
-
-		Label label = new Label(propertyPage, SWT.LEFT);
-		label.setText(title);
-		if (title != null && title.startsWith(SSEUIMessages.UI_Default_HTML_DOCTYPE_ID___1)) { //$NON-NLS-1$
-			GridData data = new GridData();
-			data.horizontalIndent = 10;
-			label.setLayoutData(data);
-		}
-		ComboListOnPropertyPage combo = new ComboListOnPropertyPage(propertyPage, SWT.READ_ONLY);
-		GridData data = new GridData();
-		data.verticalAlignment = GridData.FILL;
-		//data.horizontalAlignment= GridData.FILL;
-		data.grabExcessHorizontalSpace = true;
-		combo.setLayoutData(data);
-		return combo;
-	}
-
-
-
-	protected Composite createComposite(Composite parent, int numColumns, int numRows) {
-		Composite composite = new Composite(parent, SWT.NONE);
-
-		//GridLayout
-		GridLayout layout = new GridLayout();
-		layout.numColumns = numColumns;
-		composite.setLayout(layout);
-
-		//GridData
-		GridData data = new GridData();
-		data.verticalAlignment = GridData.FILL;
-		data.horizontalAlignment = GridData.FILL;
-		data.grabExcessHorizontalSpace = true;
-		//		data.horizontalSpan=numColumns;
-		//		data.verticalSpan=numRows;
-
-		composite.setLayoutData(data);
-		return composite;
-	}
-
-
-	protected Control createContents(Composite parent) {
-
-		contentSettings = ContentSettingsCreator.create();
-
-		propertyPage = createComposite(parent, numCols, numRows);
-
-		createSettingsPageGUI();
-
-		return propertyPage;
-
-
-	}
-
-	protected abstract void createSettingsPageGUI();
-
-	//protected abstract void applySelectedPropertyValue(String str,int
-	// index);
-	protected abstract void deleteNoneProperty(int index);
-
-
-
-	protected boolean isInitValueChanged(String before, String after) {
-		if (before == null && after == null)
-			return false;
-		if (before != null && before.equals(after))
-			return false;
-		return true;
-	}
-
-
-
-	protected void performDefaults() {
-		super.performDefaults();
-		// selected(applied) item is restored.
-		for (int i = 0; i < numberOfCombo; i++) {
-			//String appliedValue = combo[i].getApplyValue();
-			//setSelectionItem(combo[i],appliedValue);
-			combo[i].select(0); // select none.
-
-		}
-
-	}
-
-	public boolean performOk() {
-		Map properties = new Hashtable();
-		if (validateState() == false) {
-			cleanUp();
-			return true;
-		}
-		for (int i = 0; i < numberOfCombo; i++) {
-			// get selected item in Combo box.
-			String str = combo[i].getSelectedValue();
-			if (str == null)
-				continue;
-			// if no change, skip setProperty
-			if (!isInitValueChanged(combo[i].getApplyValue(), str))
-				continue;
-			// if NONE is selected, delete attr instance (and write
-			// .contentsettings.)
-			if (str != null && str.length() == 0)
-				deleteNoneProperty(i);
-			else
-				putSelectedPropertyInto(properties, str, i);
-			//applySelectedPropertyValue(str,i);
-
-			// set apply value in ComboListOnPropertyPage.
-			combo[i].setApplyValue(str);
-		}
-		if (properties != null && !properties.isEmpty())
-			contentSettings.setProperties((IResource) super.getElement(), properties);
-		if (properties != null)
-			properties.clear();
-		properties = null;
-		if (!contentSettings.existsProperties((IResource) super.getElement()))
-			contentSettings.deleteAllProperties((IResource) super.getElement());
-		return true;
-	}
-
-	protected abstract void putSelectedPropertyInto(Map properties, String str, int i);
-
-
-	protected void setSelectionItem(ComboListOnPropertyPage combo, String value) {
-		if (combo.getItemCount() <= 0)
-			return;
-		combo.setApplyValue(value);
-		String item = combo.getKey(value);
-		if (item != null)
-			combo.select(combo.indexOf(item));
-		else
-			combo.select(0);
-
-	}
-
-	/*
-	 * Validate Edit. Similar function will be in HTMLCommand.java
-	 * ContentSettingsPropertyPage.java CSSActionManager.java
-	 * DesignRedoAction.java DesignUndoAction.java
-	 * HTMLConversionProcessor.java
-	 */
-	private boolean validateState() {
-
-		// get IFile of .contentsettings
-		final String name = ContentSettings.getContentSettingsName();
-		final IResource resource = (IResource) super.getElement();
-		final IProject project = resource.getProject();
-		IFile file = project.getFile(name);
-
-		if (file != null && !file.exists())
-			return true; //Is this really OK?
-		//If false should be returned,
-		//This statemant can be removed,
-		//since ModelManagerUtil.validateEdit()
-		//returns error to this case.
-
-		Shell shell = getControl().getShell();
-		IStatus status = validateEdit(file, shell);
-		return status.isOK() ? true : false;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/ContributedProcessorDescriptor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/ContributedProcessorDescriptor.java
deleted file mode 100644
index be6df0f..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/ContributedProcessorDescriptor.java
+++ /dev/null
@@ -1,35 +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.sse.ui.internal.correction;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-
-public class ContributedProcessorDescriptor {
-	private static final String CLASS = "class"; //$NON-NLS-1$
-
-	private IConfigurationElement fConfigurationElement;
-	private Object fProcessorInstance;
-
-	public ContributedProcessorDescriptor(IConfigurationElement element) {
-		fConfigurationElement = element;
-		fProcessorInstance = null;
-	}
-
-	public Object getProcessor() throws CoreException {
-		if (fProcessorInstance == null && fConfigurationElement != null) {
-			fProcessorInstance = fConfigurationElement.createExecutableExtension(CLASS);
-		}
-		return fProcessorInstance;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/CorrectionAssistantProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/CorrectionAssistantProvider.java
deleted file mode 100644
index cb1e243..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/CorrectionAssistantProvider.java
+++ /dev/null
@@ -1,31 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.sse.ui.internal.correction;
-
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.source.ISourceViewer;
-
-/**
- * Provides the appropriate correction assistant for a given source viewer.
- * This class should only be a placeholder until the base implements a common
- * way for quickfix/quick assist.
- */
-abstract public class CorrectionAssistantProvider {
-	/**
-	 * Returns the correction assistant for the given sourceviewer.
-	 * 
-	 * @param sourceViewer
-	 * @return
-	 */
-	abstract public IContentAssistant getCorrectionAssistant(ISourceViewer sourceViewer);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickAssistProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickAssistProcessor.java
deleted file mode 100644
index 444e092..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickAssistProcessor.java
+++ /dev/null
@@ -1,31 +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.sse.ui.internal.correction;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-
-
-public interface IQuickAssistProcessor {
-	/**
-	 * Returns true if the processor can assist at the given offset. This test
-	 * should be an optimistic guess and be extremly cheap.
-	 */
-	boolean canAssist(StructuredTextViewer viewer, int offset);
-
-	/**
-	 * Collects proposals for assistant at the given offset.
-	 */
-	ICompletionProposal[] getProposals(StructuredTextViewer viewer, int offset) throws CoreException;
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickFixProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickFixProcessor.java
deleted file mode 100644
index 77441ac..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickFixProcessor.java
+++ /dev/null
@@ -1,30 +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.sse.ui.internal.correction;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.source.Annotation;
-
-public interface IQuickFixProcessor {
-	/**
-	 * Returns true if the processor can fix the given problem. This test
-	 * should be an optimistic guess and be extremly cheap.
-	 */
-	boolean canFix(Annotation annnotation);
-
-	/**
-	 * Collects proposals for fixing the given problem.
-	 */
-	ICompletionProposal[] getProposals(Annotation annnotation) throws CoreException;
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/NoModificationCompletionProposal.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/NoModificationCompletionProposal.java
deleted file mode 100644
index c98bb53..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/NoModificationCompletionProposal.java
+++ /dev/null
@@ -1,77 +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.sse.ui.internal.correction;
-
-import org.eclipse.jface.text.IDocument;
-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.sse.ui.internal.SSEUIMessages;
-
-public class NoModificationCompletionProposal implements ICompletionProposal {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#apply(org.eclipse.jface.text.IDocument)
-	 */
-	public void apply(IDocument document) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
-	 */
-	public String getAdditionalProposalInfo() {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getContextInformation()
-	 */
-	public IContextInformation getContextInformation() {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
-	 */
-	public String getDisplayString() {
-		return SSEUIMessages.NoModificationCompletionProposal_0; //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage()
-	 */
-	public Image getImage() {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(org.eclipse.jface.text.IDocument)
-	 */
-	public Point getSelection(IDocument document) {
-		return null;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/StructuredCorrectionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/StructuredCorrectionProcessor.java
deleted file mode 100644
index 6183b92..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/StructuredCorrectionProcessor.java
+++ /dev/null
@@ -1,158 +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.sse.ui.internal.correction;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.CoreException;
-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.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-
-
-public class StructuredCorrectionProcessor implements IContentAssistProcessor {
-	protected IAnnotationModel fAnnotationModel;
-	protected IQuickAssistProcessor fQuickAssistProcessor;
-	protected IQuickFixProcessor fQuickFixProcessor;
-
-	public StructuredCorrectionProcessor(ISourceViewer sourceViewer) {
-		fAnnotationModel = sourceViewer.getAnnotationModel();
-	}
-
-	protected void addQuickAssistProposals(StructuredTextViewer viewer, ArrayList proposals, int documentOffset) {
-		try {
-			IQuickAssistProcessor processor = getQuickAssistProcessor();
-			if (processor != null && processor.canAssist(viewer, documentOffset)) {
-				ICompletionProposal[] res = processor.getProposals(viewer, documentOffset);
-				if (res != null) {
-					for (int k = 0; k < res.length; k++) {
-						proposals.add(res[k]);
-					}
-				}
-			}
-		} catch (CoreException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-	}
-
-	protected void addQuickFixProposals(StructuredTextViewer viewer, ArrayList proposals, int documentOffset) {
-		Iterator iter = fAnnotationModel.getAnnotationIterator();
-		while (iter.hasNext()) {
-			Annotation annotation = (Annotation) iter.next();
-			Position pos = fAnnotationModel.getPosition(annotation);
-			if (pos != null && documentOffset >= pos.offset && documentOffset <= pos.offset + pos.length) {
-				IQuickFixProcessor processor = getQuickFixProcessor();
-				if (processor != null && processor.canFix(annotation)) {
-					try {
-						ICompletionProposal[] res = processor.getProposals(annotation);
-						if (res != null) {
-							for (int k = 0; k < res.length; k++) {
-								proposals.add(res[k]);
-							}
-						}
-					} catch (CoreException e) {
-						// log for now, unless we find reason not to
-						Logger.log(Logger.INFO, e.getMessage());
-					}
-				}
-			}
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer,
-	 *      int)
-	 */
-	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
-		ArrayList proposals = new ArrayList();
-
-		if (viewer instanceof StructuredTextViewer) {
-			addQuickFixProposals((StructuredTextViewer) viewer, proposals, documentOffset);
-
-			if (proposals.isEmpty()) {
-				addQuickAssistProposals((StructuredTextViewer) viewer, proposals, documentOffset);
-			}
-		}
-
-		if (proposals.isEmpty())
-			proposals.add(new NoModificationCompletionProposal());
-
-		return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer,
-	 *      int)
-	 */
-	public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
-	 */
-	public char[] getCompletionProposalAutoActivationCharacters() {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
-	 */
-	public char[] getContextInformationAutoActivationCharacters() {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
-	 */
-	public IContextInformationValidator getContextInformationValidator() {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
-	 */
-	public String getErrorMessage() {
-		return null;
-	}
-
-	protected IQuickAssistProcessor getQuickAssistProcessor() {
-		return null;
-	}
-
-	protected IQuickFixProcessor getQuickFixProcessor() {
-		return null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java
deleted file mode 100644
index d37c77a..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java
+++ /dev/null
@@ -1,304 +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.sse.ui.internal.debug;
-
-import java.util.ArrayList;
-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.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPartService;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider;
-
-
-public abstract class BreakpointRulerAction extends Action implements IUpdate {
-
-	protected class MouseUpdater implements MouseListener {
-		public void mouseDoubleClick(MouseEvent e) {
-			// do nothing (here)
-		}
-
-		public void mouseDown(MouseEvent e) {
-			update();
-		}
-
-		public void mouseUp(MouseEvent e) {
-			// do nothing
-		}
-	}
-
-	public static final String getFileExtension(IEditorInput input) {
-		IPath path = null;
-		if (input instanceof IStorageEditorInput) {
-			try {
-				path = ((IStorageEditorInput) input).getStorage().getFullPath();
-			} catch (CoreException e) {
-				Logger.logException(e);
-			}
-		}
-		if (path != null) {
-			return path.getFileExtension();
-		}
-		String name = input.getName();
-		int index = name.lastIndexOf('.');
-		if (index == -1)
-			return null;
-		if (index == (name.length() - 1))
-			return ""; //$NON-NLS-1$
-		return name.substring(index + 1);
-	}
-
-	public static final IResource getResource(IEditorInput input) {
-		IResource resource = null;
-
-		if (input instanceof IFileEditorInput)
-			resource = ((IFileEditorInput) input).getFile();
-		if (resource == null)
-			resource = (IResource) input.getAdapter(IFile.class);
-		if (resource == null)
-			resource = (IResource) input.getAdapter(IResource.class);
-
-		IEditorPart editorPart = null;
-		if (resource == null) {
-			IWorkbench workbench = SSEUIPlugin.getDefault().getWorkbench();
-			if (workbench != null) {
-				IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
-				if (window != null) {
-					IPartService service = window.getPartService();
-					if (service != null) {
-						Object part = service.getActivePart();
-						if (part != null && part instanceof IEditorPart) {
-							editorPart = (IEditorPart) part;
-							if (editorPart != null) {
-								IStructuredModel model = null;
-								ITextEditor textEditor = null;
-								try {
-									if (editorPart instanceof ITextEditor) {
-										textEditor = (ITextEditor) editorPart;
-									}
-									if (textEditor == null) {
-										textEditor = (ITextEditor) editorPart.getAdapter(ITextEditor.class);
-									}
-									if (textEditor != null) {
-										IDocument textDocument = textEditor.getDocumentProvider().getDocument(input);
-										model = StructuredModelManager.getModelManager().getExistingModelForRead(textDocument);
-										if (model != null) {
-											resource = BreakpointProviderBuilder.getInstance().getResource(input, model.getContentTypeIdentifier(), getFileExtension(input));
-										}
-									}
-									if (resource == null) {
-										IBreakpointProvider[] providers = BreakpointProviderBuilder.getInstance().getBreakpointProviders(editorPart, null, getFileExtension(input));
-										for (int i = 0; i < providers.length && resource == null; i++) {
-											resource = providers[i].getResource(input);
-										}
-									}
-								} catch (Exception e) {
-									Logger.logException(e);
-								} finally {
-									if (model != null) {
-										model.releaseFromRead();
-									}
-								}
-							}
-
-						}
-					}
-				}
-
-			}
-		}
-		return resource;
-	}
-
-	protected MouseListener fMouseListener = null;
-
-	protected IVerticalRulerInfo fRulerInfo = null;
-	protected ITextEditor fTextEditor = null;
-
-	public BreakpointRulerAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
-		super();
-		fTextEditor = editor;
-		if(rulerInfo != null) {
-			fRulerInfo = rulerInfo;
-			fMouseListener = new MouseUpdater();
-			rulerInfo.getControl().addMouseListener(fMouseListener);
-		}
-	}
-
-	/**
-	 * Returns the <code>AbstractMarkerAnnotationModel</code> of the
-	 * editor's input.
-	 * 
-	 * @return the marker annotation model
-	 */
-	protected AbstractMarkerAnnotationModel getAnnotationModel() {
-		IDocumentProvider provider = fTextEditor.getDocumentProvider();
-		IAnnotationModel model = provider.getAnnotationModel(fTextEditor.getEditorInput());
-		if (model instanceof AbstractMarkerAnnotationModel)
-			return (AbstractMarkerAnnotationModel) model;
-		return null;
-	}
-
-	protected IBreakpoint[] getBreakpoints(IMarker[] markers) {
-		IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
-		List breakpoints = new ArrayList(markers.length);
-		for (int i = 0; i < markers.length; i++) {
-			IBreakpoint breakpoint = manager.getBreakpoint(markers[i]);
-			if (breakpoint != null) {
-				breakpoints.add(breakpoint);
-			}
-		}
-		return (IBreakpoint[]) breakpoints.toArray(new IBreakpoint[0]);
-	}
-
-	/**
-	 * Returns the <code>IDocument</code> of the editor's input.
-	 * 
-	 * @return the document of the editor's input
-	 */
-	protected IDocument getDocument() {
-		IDocumentProvider provider = fTextEditor.getDocumentProvider();
-		return provider.getDocument(fTextEditor.getEditorInput());
-	}
-
-	/**
-	 * Returns all markers which include the ruler's line of activity.
-	 * 
-	 * @return an array of markers which include the ruler's line of activity
-	 */
-	protected IMarker[] getMarkers() {
-		List markers = new ArrayList();
-
-		IResource resource = getResource();
-		IDocument document = getDocument();
-		AbstractMarkerAnnotationModel annotationModel = getAnnotationModel();
-
-		if (resource != null && annotationModel != null && resource.exists()) {
-			try {
-				IMarker[] allMarkers = resource.findMarkers(IBreakpoint.BREAKPOINT_MARKER, true, IResource.DEPTH_ZERO);
-				if (allMarkers != null) {
-					for (int i = 0; i < allMarkers.length; i++) {
-						if (includesRulerLine(annotationModel.getMarkerPosition(allMarkers[i]), document)) {
-							markers.add(allMarkers[i]);
-						}
-					}
-				}
-			} catch (CoreException x) {
-				//
-			}
-		}
-
-		return (IMarker[]) markers.toArray(new IMarker[0]);
-	}
-
-	protected IResource getResource() {
-		IEditorInput input = getTextEditor().getEditorInput();
-		IResource resource = getResource(input);
-		return resource;
-	}
-
-	/**
-	 * @return Returns the rulerInfo.
-	 */
-	public IVerticalRulerInfo getRulerInfo() {
-		return fRulerInfo;
-	}
-
-	/**
-	 * @return Returns the textEditor.
-	 */
-	public ITextEditor getTextEditor() {
-		return fTextEditor;
-	}
-
-	protected boolean hasMarkers() {
-		IResource resource = getResource();
-		IDocument document = getDocument();
-		AbstractMarkerAnnotationModel model = getAnnotationModel();
-
-		if (resource != null && model != null && resource.exists()) {
-			try {
-				IMarker[] allMarkers = resource.findMarkers(IBreakpoint.LINE_BREAKPOINT_MARKER, true, IResource.DEPTH_ZERO);
-				if (allMarkers != null) {
-					for (int i = 0; i < allMarkers.length; i++) {
-						if (includesRulerLine(model.getMarkerPosition(allMarkers[i]), document)) {
-							return true;
-						}
-					}
-				}
-			} catch (CoreException x) {
-				//
-			}
-		}
-		return false;
-	}
-
-	/**
-	 * Checks whether a position includes the ruler's line of activity.
-	 * 
-	 * @param position
-	 *            the position to be checked
-	 * @param document
-	 *            the document the position refers to
-	 * @return <code>true</code> if the line is included by the given
-	 *         position
-	 */
-	protected boolean includesRulerLine(Position position, IDocument document) {
-		if (position != null && fRulerInfo != null) {
-			try {
-				int markerLine = document.getLineOfOffset(position.getOffset());
-				int line = getRulerInfo().getLineOfLastMouseButtonActivity();
-				if (line == markerLine)
-					return true;
-				// commented because of "1GEUOZ9: ITPJUI:ALL - Confusing UI
-				// for
-				// multiline Bookmarks and Tasks"
-				// return (markerLine <= line && line <=
-				// document.getLineOfOffset(position.getOffset() +
-				// position.getLength()));
-			} catch (BadLocationException x) {
-				//
-			}
-		}
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java
deleted file mode 100644
index 056330a..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java
+++ /dev/null
@@ -1,438 +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.sse.ui.internal.debug;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-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.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPathEditorInput;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.editors.text.FileDocumentProvider;
-import org.eclipse.ui.editors.text.ILocationProvider;
-import org.eclipse.ui.editors.text.StorageDocumentProvider;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.ui.texteditor.AbstractDocumentProvider;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.IElementStateListener;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.MarkerRulerAction;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder;
-import org.eclipse.wst.sse.ui.internal.IExtendedContributor;
-import org.eclipse.wst.sse.ui.internal.IPopupMenuContributor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModel;
-import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds;
-import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ConfigurationPointCalculator;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IExtendedStorageEditorInput;
-
-
-/**
- * @author nitin
- * 
- * A text editor capable of using the IBreakpointProvider framework.
- * 
- * This class is intended to be used by clients who wish to use the
- * IBreakpointProvider framework but not the StructuredTextEditor, e.g. VBS
- * source editors. It is provided AS-IS and marked internal as it is
- * unsupported and subject to change at any time.
- */
-public class DebugTextEditor extends TextEditor {
-
-	private class ShowInTargetLister implements IShowInTargetList {
-		public String[] getShowInTargetIds() {
-			return fShowInTargetIds;
-		}
-	}
-
-	/**
-	 * DocumentProvider for IStorageEditorInputs - supports
-	 * IExtendedStorageEditorInput notifications and assigning breakpoint
-	 * markers.
-	 */
-	class StorageInputDocumentProvider extends StorageDocumentProvider implements IElementStateListener {
-		protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
-			IAnnotationModel model = null;
-			IStorageEditorInput storageInput = (IStorageEditorInput) element;
-			String ext = BreakpointRulerAction.getFileExtension(storageInput);
-			IContentType[] types = getEditorInputContentTypes(storageInput);
-			IResource res = null;
-			for (int i = 0; res == null && i < types.length; i++) {
-				res = BreakpointProviderBuilder.getInstance().getResource(storageInput, types[i].getId(), ext);
-			}
-			String id = storageInput.getName();
-			if (storageInput.getStorage() != null) {
-				IPath fullPath = storageInput.getStorage().getFullPath();
-				if (fullPath != null)
-					id = fullPath.toString();
-				else
-					id = storageInput.getName();
-			}
-			if (res != null)
-				model = new StructuredResourceMarkerAnnotationModel(res, id);
-			else
-				model = new StructuredResourceMarkerAnnotationModel(ResourcesPlugin.getWorkspace().getRoot(), id);
-
-			return model;
-		}
-
-		protected AbstractDocumentProvider.ElementInfo createElementInfo(Object element) throws CoreException {
-			if (element instanceof IExtendedStorageEditorInput) {
-				((IExtendedStorageEditorInput) element).addElementStateListener(this);
-			}
-			return super.createElementInfo(element);
-		}
-
-		protected void disposeElementInfo(Object element, ElementInfo info) {
-			if (element instanceof IExtendedStorageEditorInput) {
-				((IExtendedStorageEditorInput) element).removeElementStateListener(this);
-			}
-			super.disposeElementInfo(element, info);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.ui.editors.text.StorageDocumentProvider#doSaveDocument(org.eclipse.core.runtime.IProgressMonitor,
-		 *      java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
-		 */
-		protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
-			// untested
-			new FileDocumentProvider().saveDocument(monitor, element, document, overwrite);
-		}
-
-		public void elementContentAboutToBeReplaced(Object element) {
-			fireElementContentAboutToBeReplaced(element);
-		}
-
-		public void elementContentReplaced(Object element) {
-			fireElementContentReplaced(element);
-		}
-
-		public void elementDeleted(Object element) {
-			fireElementDeleted(element);
-		}
-
-		public void elementDirtyStateChanged(Object element, boolean isDirty) {
-			fireElementDirtyStateChanged(element, isDirty);
-		}
-
-		public void elementMoved(Object originalElement, Object movedElement) {
-			fireElementMoved(originalElement, movedElement);
-		}
-	}
-
-	String[] fShowInTargetIds = new String[]{IPageLayout.ID_RES_NAV};
-	private IShowInTargetList fShowInTargetListAdapter = new ShowInTargetLister();
-
-	IDocumentProvider fStorageInputDocumentProvider = null;
-
-	public DebugTextEditor() {
-		super();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.editors.text.TextEditor#createActions()
-	 */
-	protected void createActions() {
-		super.createActions();
-
-		// StructuredTextEditor Action - toggle breakpoints
-		IAction action = new ToggleBreakpointAction(this, getVerticalRuler()) {
-			protected String getContentType(IDocument document) {
-				ILocationProvider provider = (ILocationProvider) getEditorInput().getAdapter(ILocationProvider.class);
-				if (provider != null) {
-					IPath location = provider.getPath(getEditorInput());
-					return detectContentType(location).getId();
-				}
-				else if (getEditorInput() instanceof IPathEditorInput) {
-					IPath location = ((IPathEditorInput) getEditorInput()).getPath();
-					return detectContentType(location).getId();
-				}
-				return IContentTypeManager.CT_TEXT;
-			}
-		};
-		setAction(ActionDefinitionIds.TOGGLE_BREAKPOINTS, action);
-		// StructuredTextEditor Action - manage breakpoints
-		action = new ManageBreakpointAction(this, getVerticalRuler());
-		setAction(ActionDefinitionIds.MANAGE_BREAKPOINTS, action);
-		// StructuredTextEditor Action - edit breakpoints
-		action = new EditBreakpointAction(this, getVerticalRuler());
-		setAction(ActionDefinitionIds.EDIT_BREAKPOINTS, action);
-	}
-
-	/**
-	 * Loads the Show In Target IDs from the Extended Configuration extension
-	 * point.
-	 * 
-	 * @return
-	 */
-	protected String[] createShowInTargetIds() {
-		List allIds = new ArrayList(0);
-		ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
-		String[] configurationIds = getConfigurationPoints();
-		for (int i = 0; i < configurationIds.length; i++) {
-			String[] definitions = builder.getDefinitions("showintarget", configurationIds[i]); //$NON-NLS-1$
-			for (int j = 0; j < definitions.length; j++) {
-				String someIds = definitions[j];
-				if (someIds != null && someIds.length() > 0) {
-					String[] ids = StringUtils.unpack(someIds);
-					for (int k = 0; k < ids.length; k++) {
-						// trim, just to keep things clean
-						String id = ids[k].trim();
-						if (!allIds.contains(id)) {
-							allIds.add(id);
-						}
-					}
-				}
-			}
-		}
-
-		if (!allIds.contains(IPageLayout.ID_RES_NAV)) {
-			allIds.add(IPageLayout.ID_RES_NAV);
-		}
-		return (String[]) allIds.toArray(new String[0]);
-	}
-
-	IContentType detectContentType(IPath location) {
-		IContentType type = null;
-
-		IResource resource = FileBuffers.getWorkspaceFileAtLocation(location);
-		if (resource != null) {
-			if (resource.getType() == IResource.FILE && resource.isAccessible()) {
-				IContentDescription d = null;
-				try {
-					// Optimized description lookup, might not succeed
-					d = ((IFile) resource).getContentDescription();
-					if (d != null) {
-						type = d.getContentType();
-					}
-				}
-				catch (CoreException e) {
-					// Should not be possible given the accessible and file
-					// type check above
-				}
-				if (type == null) {
-					type = Platform.getContentTypeManager().findContentTypeFor(resource.getName());
-				}
-			}
-		}
-		else {
-			File file = FileBuffers.getSystemFileAtLocation(location);
-			if (file != null) {
-				InputStream input = null;
-				try {
-					input = new FileInputStream(file);
-					type = Platform.getContentTypeManager().findContentTypeFor(input, location.toOSString());
-				}
-				catch (FileNotFoundException e) {
-				}
-				catch (IOException e) {
-				}
-				finally {
-					if (input != null) {
-						try {
-							input.close();
-						}
-						catch (IOException e1) {
-						}
-					}
-				}
-				if (type == null) {
-					type = Platform.getContentTypeManager().findContentTypeFor(file.getName());
-				}
-			}
-		}
-		if (type == null) {
-			type = Platform.getContentTypeManager().getContentType(IContentTypeManager.CT_TEXT);
-		}
-		return type;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractTextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager)
-	 */
-	protected void editorContextMenuAboutToShow(IMenuManager menu) {
-		super.editorContextMenuAboutToShow(menu);
-
-		IEditorActionBarContributor c = getEditorSite().getActionBarContributor();
-		if (c instanceof IPopupMenuContributor) {
-			((IPopupMenuContributor) c).contributeToPopupMenu(menu);
-		}
-		else {
-			ExtendedEditorActionBuilder builder = new ExtendedEditorActionBuilder();
-			IExtendedContributor pmc = builder.readActionExtensions(getConfigurationPoints());
-			if (pmc != null) {
-				pmc.setActiveEditor(this);
-				pmc.contributeToPopupMenu(menu);
-			}
-		}
-	}
-
-	/**
-	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-	 */
-	public Object getAdapter(Class required) {
-		// Navigate action set menu
-		if (IShowInTargetList.class.equals(required))
-			return fShowInTargetListAdapter;
-		return super.getAdapter(required);
-	}
-
-
-	protected String[] getConfigurationPoints() {
-		return ConfigurationPointCalculator.getConfigurationPoints(this, getInputContentType(getEditorInput()), ConfigurationPointCalculator.SOURCE, DebugTextEditor.class);
-	}
-
-	IContentType[] getEditorInputContentTypes(IEditorInput input) {
-		IContentType[] types = null;
-		IResource resource = null;
-
-		if (input.getAdapter(IFile.class) != null) {
-			resource = (IFile) input.getAdapter(IFile.class);
-		}
-		else if (input.getAdapter(IFile.class) != null) {
-			resource = (IResource) input.getAdapter(IResource.class);
-		}
-		if (resource.getType() == IResource.FILE && resource.isAccessible()) {
-			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
-			}
-		}
-		if (types == null) {
-			types = Platform.getContentTypeManager().findContentTypesFor(input.getName());
-		}
-		return types;
-	}
-
-	/**
-	 * @param editorInput
-	 * @return
-	 */
-	private String getInputContentType(IEditorInput editorInput) {
-		IContentType[] types = getEditorInputContentTypes(editorInput);
-		if (types != null) {
-			return types[0].getId();
-		}
-		return null;
-	}
-
-	/**
-	 * 
-	 * @return
-	 */
-	private boolean isDebuggingAvailable() {
-		boolean debuggingAvailable = false;
-		IContentType[] types = getEditorInputContentTypes(getEditorInput());
-		for (int i = 0; !debuggingAvailable && i < types.length; i++) {
-			debuggingAvailable = debuggingAvailable || BreakpointProviderBuilder.getInstance().isAvailable(types[i].getId(), BreakpointRulerAction.getFileExtension(getEditorInput()));
-		}
-		return debuggingAvailable;
-	}
-
-	protected void rulerContextMenuAboutToShow(IMenuManager menu) {
-		if (isDebuggingAvailable()) {
-			menu.add(getAction(ActionDefinitionIds.TOGGLE_BREAKPOINTS));
-			menu.add(getAction(ActionDefinitionIds.MANAGE_BREAKPOINTS));
-			menu.add(getAction(ActionDefinitionIds.EDIT_BREAKPOINTS));
-			menu.add(new Separator());
-		}
-		else {
-			Logger.log(Logger.INFO, getClass().getName() + " could not enable debugging actions"); //$NON-NLS-1$
-		}
-		super.rulerContextMenuAboutToShow(menu);
-	}
-
-	/**
-	 * Ensure that the correct IDocumentProvider is used. For IFile and Files,
-	 * the default provider with a specified AnnotationModelFactory is used.
-	 * For StorageEditorInputs, use a custom provider that creates a usable
-	 * ResourceAnnotationModel
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#setDocumentProvider(org.eclipse.ui.IEditorInput)
-	 */
-	protected void setDocumentProvider(IEditorInput input) {
-		if (input instanceof IStorageEditorInput && !(input instanceof IFileEditorInput)) {
-			if (fStorageInputDocumentProvider == null) {
-				fStorageInputDocumentProvider = new StorageInputDocumentProvider();
-			}
-			setDocumentProvider(fStorageInputDocumentProvider);
-		}
-		else {
-			super.setDocumentProvider(input);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.AbstractTextEditor#updateContentDependentActions()
-	 */
-	protected void updateContentDependentActions() {
-		super.updateContentDependentActions();
-		if (isDebuggingAvailable()) {
-			setAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK, getAction(ActionDefinitionIds.TOGGLE_BREAKPOINTS));
-		}
-		else {
-			// The Default Text Editor uses editorContribution to perform this
-			// mapping, but since it relies on the IEditorSite ID, it can't be
-			// relied on for MultiPageEditorParts. Instead, force the action
-			// registration manually.
-			setAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK, new MarkerRulerAction(SSEUIMessages.getResourceBundle(), "Editor.ManageBookmarks.", this, getVerticalRuler(), IMarker.BOOKMARK, true)); //$NON-NLS-1$
-		}
-		fShowInTargetIds = createShowInTargetIds();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/EditBreakpointAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/EditBreakpointAction.java
deleted file mode 100644
index 8ac44a1..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/EditBreakpointAction.java
+++ /dev/null
@@ -1,63 +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.sse.ui.internal.debug;
-
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-public class EditBreakpointAction extends BreakpointRulerAction {
-	protected IBreakpoint[] breakpoints = null;
-
-	/**
-	 * @param editor
-	 * @param rulerInfo
-	 */
-	public EditBreakpointAction(ITextEditor editor, IVerticalRuler rulerInfo) {
-		super(editor, rulerInfo);
-		setText(SSEUIMessages.EditBreakpointAction_0); //$NON-NLS-1$
-	}
-
-	public void run() {
-		PropertyDialogAction action = new PropertyDialogAction(getTextEditor().getEditorSite(), new ISelectionProvider() {
-			public void addSelectionChangedListener(ISelectionChangedListener listener) {
-				// do nothing
-			}
-
-			public ISelection getSelection() {
-				return new StructuredSelection(breakpoints);
-			}
-
-			public void removeSelectionChangedListener(ISelectionChangedListener listener) {
-				// do nothing
-			}
-
-			public void setSelection(ISelection selection) {
-				// do nothing
-			}
-		});
-		action.run();
-	}
-
-	public void update() {
-		boolean enableThisAction = hasMarkers();
-		setEnabled(enableThisAction);
-		breakpoints = getBreakpoints(getMarkers());
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ManageBreakpointAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ManageBreakpointAction.java
deleted file mode 100644
index ddc7ac6..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ManageBreakpointAction.java
+++ /dev/null
@@ -1,90 +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.sse.ui.internal.debug;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-/**
- * ManageBreakpointAction - Enables and Disables
- */
-public class ManageBreakpointAction extends BreakpointRulerAction {
-
-	protected IBreakpoint[] breakpoints = null;
-	private boolean doEnable = true;
-
-	/**
-	 * @param editor
-	 * @param rulerInfo
-	 */
-	public ManageBreakpointAction(ITextEditor editor, IVerticalRuler rulerInfo) {
-		super(editor, rulerInfo);
-		setEnabled(true);
-	}
-
-	/**
-	 *  
-	 */
-	protected void disableBreakpoints(IBreakpoint[] breakpoints) {
-		for (int i = 0; i < breakpoints.length; i++) {
-			try {
-				breakpoints[i].setEnabled(false);
-			} catch (CoreException e) {
-				Logger.logException(e);
-			}
-		}
-	}
-
-	protected void enableBreakpoints(IBreakpoint[] breakpoints) {
-		for (int i = 0; i < breakpoints.length; i++) {
-			try {
-				breakpoints[i].setEnabled(true);
-			} catch (CoreException e) {
-				Logger.logException(e);
-			}
-		}
-	}
-
-	public void run() {
-		if (doEnable)
-			enableBreakpoints(breakpoints);
-		else
-			disableBreakpoints(breakpoints);
-	}
-
-	public void update() {
-		// doEnable means "enable" instead of "disable"
-		doEnable = true;
-		breakpoints = getBreakpoints(getMarkers());
-		for (int i = 0; doEnable && i < breakpoints.length; i++) {
-			IBreakpoint breakpoint = breakpoints[i];
-			try {
-				if (breakpoint.isEnabled()) {
-					doEnable = false;
-				}
-			} catch (CoreException e) {
-				Logger.logException("breakpoint not responding to isEnabled: " + breakpoint, e); //$NON-NLS-1$
-			}
-		}
-		setEnabled(breakpoints != null && breakpoints.length > 0);
-		if (doEnable)
-			setText(SSEUIMessages.ManageBreakpointAction_0); //$NON-NLS-1$
-		else
-			setText(SSEUIMessages.ManageBreakpointAction_1); //$NON-NLS-1$
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java
deleted file mode 100644
index fb20197..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java
+++ /dev/null
@@ -1,200 +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.sse.ui.internal.debug;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.IDocumentProviderExtension4;
-import org.eclipse.ui.texteditor.ITextEditor;
-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.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider;
-
-/**
- * ToggleBreakpointAction
- */
-public class ToggleBreakpointAction extends BreakpointRulerAction {
-	IAction fFallbackAction;
-
-	/**
-	 * @param editor
-	 * @param rulerInfo
-	 */
-	public ToggleBreakpointAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
-		super(editor, rulerInfo);
-		setText(SSEUIMessages.ToggleBreakpointAction_0); //$NON-NLS-1$
-	}
-
-	public ToggleBreakpointAction(ITextEditor editor, IVerticalRulerInfo rulerInfo, IAction fallbackAction) {
-		this(editor, rulerInfo);
-		fFallbackAction = fallbackAction;
-	}
-
-	protected boolean createBreakpoints(int lineNumber) {
-		/*
-		 * Note: we'll always allow processing to continue, even for a "read
-		 * only" IStorageEditorInput, for the ActiveScript debugger. But this
-		 * means sometimes the ActiveScript provider might get an input from
-		 * CVS or something that is not related to debugging.
-		 */
-
-		ITextEditor editor = getTextEditor();
-		IEditorInput input = editor.getEditorInput();
-		IDocument document = editor.getDocumentProvider().getDocument(input);
-		if (document == null)
-			return false;
-
-		String contentType = getContentType(document);
-		IBreakpointProvider[] providers = BreakpointProviderBuilder.getInstance().getBreakpointProviders(editor, contentType, getFileExtension(input));
-
-		int pos = -1;
-		ISourceEditingTextTools tools = (ISourceEditingTextTools) editor.getAdapter(ISourceEditingTextTools.class);
-		if (tools != null) {
-			pos = tools.getCaretOffset();
-		}
-
-		final int n = providers.length;
-		List errors = new ArrayList(0);
-		for (int i = 0; i < n; i++) {
-			try {
-				if (Debug.debugBreakpoints)
-					System.out.println(providers[i].getClass().getName() + " adding breakpoint to line " + lineNumber); //$NON-NLS-1$
-				IStatus status = providers[i].addBreakpoint(document, input, lineNumber, pos);
-				if (status != null && !status.isOK()) {
-					errors.add(status);
-				}
-			}
-			catch (CoreException e) {
-				errors.add(e.getStatus());
-			}
-			catch (Exception t) {
-				Logger.logException("exception while adding breakpoint", t); //$NON-NLS-1$
-			}
-		}
-
-		if (errors.size() > 0) {
-			Shell shell = editor.getSite().getShell();
-			MultiStatus allStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.INFO, (IStatus[]) errors.toArray(new IStatus[0]), SSEUIMessages.ManageBreakpoints_error_adding_message1, null); //$NON-NLS-1$
-			/*
-			 * Show for conditions more severe than INFO or when no
-			 * breakpoints were created
-			 */
-			if (allStatus.getSeverity() > IStatus.INFO || getBreakpoints(getMarkers()).length < 1) {
-				ErrorDialog.openError(shell, SSEUIMessages.ManageBreakpoints_error_adding_title1, SSEUIMessages.ManageBreakpoints_error_adding_message1, allStatus); //$NON-NLS-1$ //$NON-NLS-2$
-				return false;
-			}
-		}
-		/*
-		 * Although no errors were reported, no breakpoints exist on this line
-		 * after having run the existing providers. Run the fallback action.
-		 */
-		else if (fFallbackAction != null && !hasMarkers()) {
-			if (fFallbackAction instanceof ISelectionListener) {
-				((ISelectionListener) fFallbackAction).selectionChanged(null, null);
-			}
-			fFallbackAction.run();
-		}
-		return true;
-	}
-
-	protected String getContentType(IDocument document) {
-		IModelManager mgr = StructuredModelManager.getModelManager();
-		String contentType = null;
-
-		IDocumentProvider provider = fTextEditor.getDocumentProvider();
-		if (provider instanceof IDocumentProviderExtension4) {
-			try {
-				IContentType type = ((IDocumentProviderExtension4) provider).getContentType(fTextEditor.getEditorInput());
-				if (type != null)
-					contentType = type.getId();
-			}
-			catch (CoreException e) {
-				/*
-				 * A failure accessing the underlying store really isn't
-				 * interesting, although it can be a problem for
-				 * IStorageEditorInputs.
-				 */
-			}
-		}
-
-		if (contentType == null) {
-			IStructuredModel model = null;
-			try {
-				model = mgr.getExistingModelForRead(document);
-				if (model != null) {
-					contentType = model.getContentTypeIdentifier();
-				}
-			}
-			finally {
-				if (model != null) {
-					model.releaseFromRead();
-				}
-			}
-		}
-		return contentType;
-	}
-
-	protected void removeBreakpoints(int lineNumber) {
-		IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
-		IBreakpoint[] breakpoints = getBreakpoints(getMarkers());
-		for (int i = 0; i < breakpoints.length; i++) {
-			try {
-				breakpoints[i].getMarker().delete();
-				breakpointManager.removeBreakpoint(breakpoints[i], true);
-			}
-			catch (CoreException e) {
-				Logger.logException(e);
-			}
-		}
-	}
-
-	public void run() {
-		int lineNumber = fRulerInfo.getLineOfLastMouseButtonActivity() + 1;
-		boolean doAdd = !hasMarkers();
-		if (doAdd)
-			createBreakpoints(lineNumber);
-		else
-			removeBreakpoints(lineNumber);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IUpdate#update()
-	 */
-	public void update() {
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointsTarget.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointsTarget.java
deleted file mode 100644
index e0dd312..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointsTarget.java
+++ /dev/null
@@ -1,189 +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
- *     
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.debug;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * @author nsd
- */
-public class ToggleBreakpointsTarget implements IToggleBreakpointsTarget {
-	static final IToggleBreakpointsTarget instance = new ToggleBreakpointsTarget();
-
-	public static IToggleBreakpointsTarget getInstance() {
-		return instance;
-	}
-
-	/**
-	 * 
-	 */
-	private ToggleBreakpointsTarget() {
-		super();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean canToggleLineBreakpoints(IWorkbenchPart part, ISelection selection) {
-		ITextEditor editor = (ITextEditor) part.getAdapter(ITextEditor.class);
-		if (selection instanceof ITextSelection) {
-			ITextSelection textSelection = (ITextSelection) selection;
-			IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
-			if (document != null && textSelection.getOffset() > -1) {
-				int lineNumber = -1;
-				try {
-					lineNumber = document.getLineOfOffset(textSelection.getOffset());
-				}
-				catch (BadLocationException e) {
-				}
-				if (lineNumber >= 0) {
-					ToggleBreakpointAction toggler = new ToggleBreakpointAction(editor, null);
-					toggler.update();
-					return toggler.isEnabled();
-				}
-			}
-		}
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean canToggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) {
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleWatchpoints(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) {
-		return false;
-	}
-
-	private IBreakpoint[] getBreakpoints(IResource resource, IDocument document, AbstractMarkerAnnotationModel model, int lineNumber) {
-		List markers = new ArrayList();
-		if (resource != null && model != null && resource.exists()) {
-			try {
-				IMarker[] allMarkers = resource.findMarkers(IBreakpoint.LINE_BREAKPOINT_MARKER, true, IResource.DEPTH_ZERO);
-				if (allMarkers != null) {
-					for (int i = 0; i < allMarkers.length; i++) {
-						Position p = model.getMarkerPosition(allMarkers[i]);
-						int markerLine = -1;
-						try {
-							markerLine = document.getLineOfOffset(p.getOffset());
-						}
-						catch (BadLocationException e1) {
-						}
-						if (markerLine == lineNumber) {
-							markers.add(allMarkers[i]);
-						}
-					}
-				}
-			}
-			catch (CoreException x) {
-			}
-		}
-		IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
-		List breakpoints = new ArrayList(markers.size());
-		for (int i = 0; i < markers.size(); i++) {
-			IBreakpoint breakpoint = manager.getBreakpoint((IMarker) markers.get(i));
-			if (breakpoint != null) {
-				breakpoints.add(breakpoint);
-			}
-		}
-		return (IBreakpoint[]) breakpoints.toArray(new IBreakpoint[0]);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
-		ITextEditor editor = (ITextEditor) part.getAdapter(ITextEditor.class);
-		if (selection instanceof ITextSelection) {
-			ITextSelection textSelection = (ITextSelection) selection;
-			IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
-			int lineNumber = -1;
-			try {
-				lineNumber = document.getLineOfOffset(textSelection.getOffset());
-			}
-			catch (BadLocationException e) {
-			}
-			if (lineNumber >= 0) {
-				ToggleBreakpointAction toggler = new ToggleBreakpointAction(editor, null);
-				toggler.update();
-				if (toggler.isEnabled()) {
-					IResource resource = toggler.getResource();
-					AbstractMarkerAnnotationModel model = toggler.getAnnotationModel();
-					IBreakpoint[] breakpoints = getBreakpoints(resource, document, model, lineNumber);
-					if (breakpoints.length > 0) {
-						IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
-						for (int i = 0; i < breakpoints.length; i++) {
-							breakpoints[i].getMarker().delete();
-							breakpointManager.removeBreakpoint(breakpoints[i], true);
-						}
-					}
-					else {
-						toggler.createBreakpoints(lineNumber + 1);
-					}
-				}
-			}
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public void toggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleWatchpoints(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTML2TextReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTML2TextReader.java
deleted file mode 100644
index 22242b1..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTML2TextReader.java
+++ /dev/null
@@ -1,303 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.sse.ui.internal.derived;
-
-import java.io.IOException;
-import java.io.PushbackReader;
-import java.io.Reader;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-
-/*
- * Copied from org.eclipse.jdt.internal.ui.text.HTML2TextReader Modifications
- * were made to add br/ tag and fix warnings
- */
-/**
- * Reads the text contents from a reader of HTML contents and translates the
- * tags or cut them out.
- */
-public class HTML2TextReader extends SubstitutionTextReader {
-
-	private static final String EMPTY_STRING= ""; //$NON-NLS-1$
-	private static final Map fgEntityLookup;
-	private static final Set fgTags;
-
-	static {
-
-		fgTags= new HashSet();
-		fgTags.add("b"); //$NON-NLS-1$
-		fgTags.add("br"); //$NON-NLS-1$
-		fgTags.add("br/");//$NON-NLS-1$
-		fgTags.add("h5"); //$NON-NLS-1$
-		fgTags.add("p"); //$NON-NLS-1$
-		fgTags.add("dl"); //$NON-NLS-1$
-		fgTags.add("dt"); //$NON-NLS-1$
-		fgTags.add("dd"); //$NON-NLS-1$
-		fgTags.add("li"); //$NON-NLS-1$
-		fgTags.add("ul"); //$NON-NLS-1$
-		fgTags.add("pre"); //$NON-NLS-1$
-
-		fgEntityLookup= new HashMap(7);
-		fgEntityLookup.put("lt", "<"); //$NON-NLS-1$ //$NON-NLS-2$
-		fgEntityLookup.put("gt", ">"); //$NON-NLS-1$ //$NON-NLS-2$
-		fgEntityLookup.put("nbsp", " "); //$NON-NLS-1$ //$NON-NLS-2$
-		fgEntityLookup.put("amp", "&"); //$NON-NLS-1$ //$NON-NLS-2$
-		fgEntityLookup.put("circ", "^"); //$NON-NLS-1$ //$NON-NLS-2$
-		fgEntityLookup.put("tilde", "~"); //$NON-NLS-2$ //$NON-NLS-1$
-		fgEntityLookup.put("quot", "\"");		 //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	private int fCounter= 0;
-	private TextPresentation fTextPresentation;
-	private int fBold= 0;
-	private int fStartOffset= -1;
-	private boolean fInParagraph= false;
-	private boolean fIsPreformattedText= false;
-
-	/**
-	 * Transforms the html text from the reader to formatted text.
-	 * @param presentation If not <code>null</code>, formattings will be applied to
-	 * the presentation.
-	*/
-	public HTML2TextReader(Reader reader, TextPresentation presentation) {
-		super(new PushbackReader(reader));
-		fTextPresentation= presentation;
-	}
-
-	public int read() throws IOException {
-		int c= super.read();
-		if (c != -1)
-			++ fCounter;
-		return c;
-	}
-
-	protected void startBold() {
-		if (fBold == 0)
-			fStartOffset= fCounter;
-		++ fBold;
-	}
-
-	protected void startPreformattedText() {
-		fIsPreformattedText= true;
-		setSkipWhitespace(false);
-	}
-
-	protected void stopPreformattedText() {
-		fIsPreformattedText= false;
-		setSkipWhitespace(true);
-	}
-
-	protected void stopBold() {
-		-- fBold;
-		if (fBold == 0) {
-			if (fTextPresentation != null) {
-				fTextPresentation.addStyleRange(new StyleRange(fStartOffset, fCounter - fStartOffset, null, null, SWT.BOLD));
-			}
-			fStartOffset= -1;
-		}
-	}
-
-	/*
-	 * @see org.eclipse.jdt.internal.ui.text.SubstitutionTextReader#computeSubstitution(int)
-	 */
-	protected String computeSubstitution(int c) throws IOException {
-
-		if (c == '<')
-			return  processHTMLTag();
-		else if (c == '&')
-			return processEntity();
-		else if (fIsPreformattedText)
-			return processPreformattedText(c);
-
-		return null;
-	}
-
-	private String html2Text(String html) {
-
-		if (html == null || html.length() == 0)
-			return EMPTY_STRING;
-
-		String tag= html;
-		if ('/' == tag.charAt(0))
-			tag= tag.substring(1);
-
-		if (!fgTags.contains(tag))
-			return EMPTY_STRING;
-
-
-		if ("pre".equals(html)) { //$NON-NLS-1$
-			startPreformattedText();
-			return EMPTY_STRING;
-		}
-
-		if ("/pre".equals(html)) { //$NON-NLS-1$
-			stopPreformattedText();
-			return EMPTY_STRING;
-		}
-
-		if (fIsPreformattedText)
-			return EMPTY_STRING;
-
-		if ("b".equals(html)) { //$NON-NLS-1$
-			startBold();
-			return EMPTY_STRING;
-		}
-
-		if ("h5".equals(html) || "dt".equals(html)) { //$NON-NLS-1$ //$NON-NLS-2$
-			startBold();
-			return EMPTY_STRING;
-		}
-
-		if ("dl".equals(html)) //$NON-NLS-1$
-			return LINE_DELIM;
-
-		if ("dd".equals(html)) //$NON-NLS-1$
-			return "\t"; //$NON-NLS-1$
-
-		if ("li".equals(html)) //$NON-NLS-1$
-			return LINE_DELIM + "\t" + "- "; //$NON-NLS-1$ //$NON-NLS-2$
-
-		if ("/b".equals(html)) { //$NON-NLS-1$
-			stopBold();
-			return EMPTY_STRING;
-		}
-
-		if ("p".equals(html))  { //$NON-NLS-1$
-			fInParagraph= true;
-			return LINE_DELIM;
-		}
-
-		if ("br".equals(html) || "br/".equals(html)) //$NON-NLS-1$ //$NON-NLS-2$
-			return LINE_DELIM;
-
-		if ("/p".equals(html))  { //$NON-NLS-1$
-			boolean inParagraph= fInParagraph;
-			fInParagraph= false;
-			return inParagraph ? EMPTY_STRING : LINE_DELIM;
-		}
-
-		if ("/h5".equals(html) || "/dt".equals(html)) { //$NON-NLS-1$ //$NON-NLS-2$
-			stopBold();
-			return LINE_DELIM;
-		}
-
-		if ("/dd".equals(html)) //$NON-NLS-1$
-			return LINE_DELIM;
-
-		return EMPTY_STRING;
-	}
-
-	/*
-	 * A '<' has been read. Process a html tag
-	 */
-	private String processHTMLTag() throws IOException {
-
-		StringBuffer buf= new StringBuffer();
-		int ch;
-		do {
-
-			ch= nextChar();
-
-			while (ch != -1 && ch != '>') {
-				buf.append(Character.toLowerCase((char) ch));
-				ch= nextChar();
-				if (ch == '"'){
-					buf.append(Character.toLowerCase((char) ch));
-					ch= nextChar();
-					while (ch != -1 && ch != '"'){
-						buf.append(Character.toLowerCase((char) ch));
-						ch= nextChar();
-					}
-				}
-				if (ch == '<'){
-					unread(ch);
-					return '<' + buf.toString();
-				}
-			}
-
-			if (ch == -1)
-				return null;
-
-			int tagLen= buf.length();
-			// needs special treatment for comments
-			if ((tagLen >= 3 && "!--".equals(buf.substring(0, 3))) //$NON-NLS-1$
-				&& !(tagLen >= 5 && "--".equals(buf.substring(tagLen - 2)))) { //$NON-NLS-1$
-				// unfinished comment
-				buf.append(ch);
-			} else {
-				break;
-			}
-		} while (true);
-
-		return html2Text(buf.toString());
-	}
-
-	private String processPreformattedText(int c) {
-		if  (c == '\r' || c == '\n')
-			fCounter++;
-		return null;
-	}
-
-
-	private void unread(int ch) throws IOException {
-		((PushbackReader) getReader()).unread(ch);
-	}
-
-	protected String entity2Text(String symbol) {
-		if (symbol.length() > 1 && symbol.charAt(0) == '#') {
-			int ch;
-			try {
-				if (symbol.charAt(1) == 'x') {
-					ch= Integer.parseInt(symbol.substring(2), 16);
-				} else {
-					ch= Integer.parseInt(symbol.substring(1), 10);
-				}
-				return EMPTY_STRING + (char)ch;
-			} catch (NumberFormatException e) {
-				// log problem?
-			}
-		} else {
-			String str= (String) fgEntityLookup.get(symbol);
-			if (str != null) {
-				return str;
-			}
-		}
-		return "&" + symbol; // not found //$NON-NLS-1$
-	}
-
-	/*
-	 * A '&' has been read. Process a entity
-	 */
-	private String processEntity() throws IOException {
-		StringBuffer buf= new StringBuffer();
-		int ch= nextChar();
-		while (Character.isLetterOrDigit((char)ch) || ch == '#') {
-			buf.append((char) ch);
-			ch= nextChar();
-		}
-
-		if (ch == ';')
-			return entity2Text(buf.toString());
-
-		buf.insert(0, '&');
-		if (ch != -1)
-			buf.append((char) ch);
-		return buf.toString();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTMLTextPresenter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTMLTextPresenter.java
deleted file mode 100644
index 2a8e7b5..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTMLTextPresenter.java
+++ /dev/null
@@ -1,194 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.sse.ui.internal.derived;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.Iterator;
-
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-/*
- * Copied from org.eclipse.jdt.internal.ui.text.HTMLTextPresenter
- * Modifications were made to use own Logger to log exception, and the
- * ellipses constant
- */
-public class HTMLTextPresenter implements DefaultInformationControl.IInformationPresenter {
-	private static final String ELLIPSES = "..."; //$NON-NLS-1$
-	private static final String LINE_DELIM = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private int fCounter;
-	private boolean fEnforceUpperLineLimit;
-
-	public HTMLTextPresenter(boolean enforceUpperLineLimit) {
-		super();
-		fEnforceUpperLineLimit = enforceUpperLineLimit;
-	}
-
-	public HTMLTextPresenter() {
-		this(true);
-	}
-
-	protected Reader createReader(String hoverInfo, TextPresentation presentation) {
-		return new HTML2TextReader(new StringReader(hoverInfo), presentation);
-	}
-
-	protected void adaptTextPresentation(TextPresentation presentation, int offset, int insertLength) {
-
-		int yoursStart = offset;
-		int yoursEnd = offset + insertLength - 1;
-		yoursEnd = Math.max(yoursStart, yoursEnd);
-
-		Iterator e = presentation.getAllStyleRangeIterator();
-		while (e.hasNext()) {
-
-			StyleRange range = (StyleRange) e.next();
-
-			int myStart = range.start;
-			int myEnd = range.start + range.length - 1;
-			myEnd = Math.max(myStart, myEnd);
-
-			if (myEnd < yoursStart)
-				continue;
-
-			if (myStart < yoursStart)
-				range.length += insertLength;
-			else
-				range.start += insertLength;
-		}
-	}
-
-	private void append(StringBuffer buffer, String string, TextPresentation presentation) {
-
-		int length = string.length();
-		buffer.append(string);
-
-		if (presentation != null)
-			adaptTextPresentation(presentation, fCounter, length);
-
-		fCounter += length;
-	}
-
-	private String getIndent(String line) {
-		int length = line.length();
-
-		int i = 0;
-		while (i < length && Character.isWhitespace(line.charAt(i)))
-			++i;
-
-		return (i == length ? line : line.substring(0, i)) + " "; //$NON-NLS-1$
-	}
-
-	/*
-	 * @see IHoverInformationPresenter#updatePresentation(Display display,
-	 *      String, TextPresentation, int, int)
-	 */
-	public String updatePresentation(Display display, String hoverInfo, TextPresentation presentation, int maxWidth, int maxHeight) {
-
-		if (hoverInfo == null)
-			return null;
-
-		GC gc = new GC(display);
-		try {
-
-			StringBuffer buffer = new StringBuffer();
-			int maxNumberOfLines = Math.round(maxHeight / gc.getFontMetrics().getHeight());
-
-			fCounter = 0;
-			LineBreakingReader reader = new LineBreakingReader(createReader(hoverInfo, presentation), gc, maxWidth);
-
-			boolean lastLineFormatted = false;
-			String lastLineIndent = null;
-
-			String line = reader.readLine();
-			boolean lineFormatted = reader.isFormattedLine();
-			boolean firstLineProcessed = false;
-
-			while (line != null) {
-
-				if (fEnforceUpperLineLimit && maxNumberOfLines <= 0)
-					break;
-
-				if (firstLineProcessed) {
-					if (!lastLineFormatted)
-						append(buffer, LINE_DELIM, null);
-					else {
-						append(buffer, LINE_DELIM, presentation);
-						if (lastLineIndent != null)
-							append(buffer, lastLineIndent, presentation);
-					}
-				}
-
-				append(buffer, line, null);
-				firstLineProcessed = true;
-
-				lastLineFormatted = lineFormatted;
-				if (!lineFormatted)
-					lastLineIndent = null;
-				else if (lastLineIndent == null)
-					lastLineIndent = getIndent(line);
-
-				line = reader.readLine();
-				lineFormatted = reader.isFormattedLine();
-
-				maxNumberOfLines--;
-			}
-
-			if (line != null && buffer.length() > 0) {
-				append(buffer, LINE_DELIM, lineFormatted ? presentation : null);
-				append(buffer, ELLIPSES, presentation);
-			}
-
-			return trim(buffer, presentation);
-
-		} catch (IOException e) {
-			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-			return null;
-
-		} finally {
-			gc.dispose();
-		}
-	}
-
-	private String trim(StringBuffer buffer, TextPresentation presentation) {
-
-		int length = buffer.length();
-
-		int end = length - 1;
-		while (end >= 0 && Character.isWhitespace(buffer.charAt(end)))
-			--end;
-
-		if (end == -1)
-			return ""; //$NON-NLS-1$
-
-		if (end < length - 1)
-			buffer.delete(end + 1, length);
-		else
-			end = length;
-
-		int start = 0;
-		while (start < end && Character.isWhitespace(buffer.charAt(start)))
-			++start;
-
-		buffer.delete(0, start);
-		presentation.setResultWindow(new Region(start, buffer.length()));
-		return buffer.toString();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/LineBreakingReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/LineBreakingReader.java
deleted file mode 100644
index 0b30af6..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/LineBreakingReader.java
+++ /dev/null
@@ -1,124 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.sse.ui.internal.derived;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.Reader;
-import java.text.BreakIterator;
-
-import org.eclipse.swt.graphics.GC;
-
-/**
- * Copied from org.eclipse.jdt.internal.ui.text.LineBreakingReader.
- * Modifications were made to fix warnings.
- */
-/*
- * Not a real reader. Could change if requested
- */
-public class LineBreakingReader {
-	private GC fGC;
-
-	private String fLine;
-
-	private BreakIterator fLineBreakIterator;
-	private int fMaxWidth;
-	private int fOffset;
-
-
-	private BufferedReader fReader;
-
-	/**
-	 * Creates a reader that breaks an input text to fit in a given width.
-	 * 
-	 * @param reader
-	 *            Reader of the input text
-	 * @param gc
-	 *            The graphic context that defines the currently used font
-	 *            sizes
-	 * @param maxLineWidth
-	 *            The max width (pixes) where the text has to fit in
-	 */
-	public LineBreakingReader(Reader reader, GC gc, int maxLineWidth) {
-		fReader = new BufferedReader(reader);
-		fGC = gc;
-		fMaxWidth = maxLineWidth;
-		fOffset = 0;
-		fLine = null;
-		fLineBreakIterator = BreakIterator.getLineInstance();
-	}
-
-	private int findNextBreakOffset(int currOffset) {
-		int currWidth = 0;
-		int nextOffset = fLineBreakIterator.following(currOffset);
-		while (nextOffset != BreakIterator.DONE) {
-			String word = fLine.substring(currOffset, nextOffset);
-			int wordWidth = fGC.textExtent(word).x;
-			int nextWidth = wordWidth + currWidth;
-			if (nextWidth > fMaxWidth) {
-				if (currWidth > 0) {
-					return currOffset;
-				}
-				return nextOffset;
-			}
-			currWidth = nextWidth;
-			currOffset = nextOffset;
-			nextOffset = fLineBreakIterator.next();
-		}
-		return nextOffset;
-	}
-
-	private int findWordBegin(int idx) {
-		while (idx < fLine.length() && Character.isWhitespace(fLine.charAt(idx))) {
-			idx++;
-		}
-		return idx;
-	}
-
-	public boolean isFormattedLine() {
-		return fLine != null;
-	}
-
-	/**
-	 * Reads the next line. The lengths of the line will not exceed the gived
-	 * maximum width.
-	 */
-	public String readLine() throws IOException {
-		if (fLine == null) {
-			String line = fReader.readLine();
-			if (line == null)
-				return null;
-
-			int lineLen = fGC.textExtent(line).x;
-			if (lineLen < fMaxWidth) {
-				return line;
-			}
-			fLine = line;
-			fLineBreakIterator.setText(line);
-			fOffset = 0;
-		}
-		int breakOffset = findNextBreakOffset(fOffset);
-		String res;
-		if (breakOffset != BreakIterator.DONE) {
-			res = fLine.substring(fOffset, breakOffset);
-			fOffset = findWordBegin(breakOffset);
-			if (fOffset == fLine.length()) {
-				fLine = null;
-			}
-		} else {
-			res = fLine.substring(fOffset);
-			fLine = null;
-		}
-		return res;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SingleCharReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SingleCharReader.java
deleted file mode 100644
index 0c585b8..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SingleCharReader.java
+++ /dev/null
@@ -1,66 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.sse.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.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SubstitutionTextReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SubstitutionTextReader.java
deleted file mode 100644
index f8cc083..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SubstitutionTextReader.java
+++ /dev/null
@@ -1,158 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.sse.ui.internal.derived;
-
-import java.io.IOException;
-import java.io.Reader;
-
-/*
- * Copied from org.eclipse.jdt.internal.ui.text.SubstitutionTextReader.
- * Modifications were made to read() to allow whitespaces and fixed statement
- * unnecessarily nested within else clause warning in nextChar()
- */
-/**
- * Reads the text contents from a reader and computes for each character a
- * potential substitution. The substitution may eat more characters than only
- * the one passed into the computation routine.
- */
-public abstract class SubstitutionTextReader extends SingleCharReader {
-
-	protected static final String LINE_DELIM = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private Reader fReader;
-	protected boolean fWasWhiteSpace;
-	private int fCharAfterWhiteSpace;
-
-	/**
-	 * Tells whether white space characters are skipped.
-	 */
-	private boolean fSkipWhiteSpace = true;
-
-	private boolean fReadFromBuffer;
-	private StringBuffer fBuffer;
-	private int fIndex;
-
-
-	protected SubstitutionTextReader(Reader reader) {
-		fReader = reader;
-		fBuffer = new StringBuffer();
-		fIndex = 0;
-		fReadFromBuffer = false;
-		fCharAfterWhiteSpace = -1;
-		fWasWhiteSpace = true;
-	}
-
-	/**
-	 * Implement to compute the substitution for the given character and if
-	 * necessary subsequent characters. Use <code>nextChar</code> to read
-	 * subsequent characters.
-	 */
-	protected abstract String computeSubstitution(int c) throws IOException;
-
-	/**
-	 * Returns the internal reader.
-	 */
-	protected Reader getReader() {
-		return fReader;
-	}
-
-	/**
-	 * Returns the next character.
-	 */
-	protected int nextChar() throws IOException {
-		fReadFromBuffer = (fBuffer.length() > 0);
-		if (fReadFromBuffer) {
-			char ch = fBuffer.charAt(fIndex++);
-			if (fIndex >= fBuffer.length()) {
-				fBuffer.setLength(0);
-				fIndex = 0;
-			}
-			return ch;
-		}
-		int ch = fCharAfterWhiteSpace;
-		if (ch == -1) {
-			ch = fReader.read();
-		}
-		if (fSkipWhiteSpace && Character.isWhitespace((char) ch)) {
-			do {
-				ch = fReader.read();
-			} while (Character.isWhitespace((char) ch));
-			if (ch != -1) {
-				fCharAfterWhiteSpace = ch;
-				return ' ';
-			}
-		} else {
-			fCharAfterWhiteSpace = -1;
-		}
-		return ch;
-	}
-
-	/**
-	 * @see Reader#read()
-	 */
-	public int read() throws IOException {
-		int c;
-		do {
-
-			c = nextChar();
-			while (!fReadFromBuffer) {
-				String s = computeSubstitution(c);
-				if (s == null)
-					break;
-				if (s.length() > 0)
-					fBuffer.insert(0, s);
-				c = nextChar();
-			}
-
-		} while (fSkipWhiteSpace && fWasWhiteSpace && ((c == ' ') && !fReadFromBuffer));
-		/*
-		 * SSE: For above and below check, if whitespace is read from buffer,
-		 * do not skip
-		 */
-		fWasWhiteSpace = ((c == ' ' && !fReadFromBuffer) || c == '\r' || c == '\n');
-		return c;
-	}
-
-	/**
-	 * @see Reader#ready()
-	 */
-	public boolean ready() throws IOException {
-		return fReader.ready();
-	}
-
-	/**
-	 * @see Reader#close()
-	 */
-	public void close() throws IOException {
-		fReader.close();
-	}
-
-	/**
-	 * @see Reader#reset()
-	 */
-	public void reset() throws IOException {
-		fReader.reset();
-		fWasWhiteSpace = true;
-		fCharAfterWhiteSpace = -1;
-		fBuffer.setLength(0);
-		fIndex = 0;
-	}
-
-	protected final void setSkipWhitespace(boolean state) {
-		fSkipWhiteSpace = state;
-	}
-
-	protected final boolean isSkippingWhitespace() {
-		return fSkipWhiteSpace;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/edit/util/SharedEditorPluginImageHelper.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/edit/util/SharedEditorPluginImageHelper.java
deleted file mode 100644
index 2111583..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/edit/util/SharedEditorPluginImageHelper.java
+++ /dev/null
@@ -1,58 +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.sse.ui.internal.edit.util;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-
-
-public class SharedEditorPluginImageHelper {
-	public static final String IMG_DLCL_COLLAPSEALL = EditorPluginImages.IMG_DLCL_COLLAPSEALL;
-	public static final String IMG_DLCL_DELETE = EditorPluginImages.IMG_DLCL_DELETE;
-	public static final String IMG_DLCL_SYNCED = EditorPluginImages.IMG_DLCL_SYNCED;
-	public static final String IMG_ELCL_COLLAPSEALL = EditorPluginImages.IMG_ELCL_COLLAPSEALL;
-	public static final String IMG_ELCL_DELETE = EditorPluginImages.IMG_ELCL_DELETE;
-	public static final String IMG_ELCL_SYNCED = EditorPluginImages.IMG_ELCL_SYNCED;
-
-	/**
-	 * Retrieves the specified image from the source editor plugin's image
-	 * registry. Note: The returned <code>Image</code> is managed by the
-	 * workbench; clients must <b>not </b> dispose of the returned image.
-	 * 
-	 * @param symbolicName
-	 *            the symbolic name of the image; there are constants declared
-	 *            in this class for build-in images that come with the source
-	 *            editor
-	 * @return the image, or <code>null</code> if not found
-	 */
-	public static Image getImage(String symbolicName) {
-		return EditorPluginImageHelper.getInstance().getImage(symbolicName);
-	}
-
-	/**
-	 * Retrieves the image descriptor for specified image from the source
-	 * editor plugin's image registry. Unlike <code>Image</code>s, image
-	 * descriptors themselves do not need to be disposed.
-	 * 
-	 * @param symbolicName
-	 *            the symbolic name of the image; there are constants declared
-	 *            in this interface for build-in images that come with the
-	 *            source editor
-	 * @return the image descriptor, or <code>null</code> if not found
-	 */
-	public static ImageDescriptor getImageDescriptor(String symbolicName) {
-		return EditorPluginImageHelper.getInstance().getImageDescriptor(symbolicName);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorModelUtil.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorModelUtil.java
deleted file mode 100644
index ab721c8..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorModelUtil.java
+++ /dev/null
@@ -1,77 +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.sse.ui.internal.editor;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistryExtension;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-
-
-/**
- * INTERNAL USAGE ONLY
- * 
- * @author nsd
- */
-public class EditorModelUtil {
-
-	public static void addFactoriesTo(final IStructuredModel structuredModel) {
-		if (structuredModel == null)
-			return;
-		
-		AdapterFactoryRegistry adapterRegistry = SSEUIPlugin.getDefault().getAdapterFactoryRegistry();
-		String contentTypeId = structuredModel.getContentTypeIdentifier();
-
-		Iterator adapterFactoryProviders = null;
-		if (adapterRegistry instanceof AdapterFactoryRegistryExtension) {
-			adapterFactoryProviders = ((AdapterFactoryRegistryExtension) adapterRegistry).getAdapterFactories(contentTypeId);
-		}
-		else {
-			adapterFactoryProviders = adapterRegistry.getAdapterFactories();
-		}
-
-		FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
-		Assert.isNotNull(factoryRegistry, SSEUIMessages.EditorModelUtil_0); //$NON-NLS-1$
-		// Add all those appropriate for this particular type of content
-		while (adapterFactoryProviders.hasNext()) {
-			try {
-				final AdapterFactoryProvider provider = (AdapterFactoryProvider) adapterFactoryProviders.next();
-				/*
-				 * ContentType might have already been checked above, this
-				 * check is here for backwards compatability for those that
-				 * don't specify a content type
-				 */
-				if (provider.isFor(structuredModel.getModelHandler())) {
-					Platform.run(new SafeRunnable(SSEUIMessages.EditorModelUtil_1) { //$NON-NLS-1$
-									public void run() {
-										provider.addAdapterFactories(structuredModel);
-									}
-								});
-				}
-			}
-			catch (Exception e) {
-				Logger.logException(e);
-			}
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImageHelper.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImageHelper.java
deleted file mode 100644
index f78633f..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImageHelper.java
+++ /dev/null
@@ -1,155 +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.sse.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.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-
-/**
- * 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 EditorPluginImageHelper {
-	private static EditorPluginImageHelper instance = null;
-
-	/**
-	 * Gets the instance.
-	 * 
-	 * @return Returns a EditorPluginImageHelper
-	 */
-	public synchronized static EditorPluginImageHelper getInstance() {
-		if (instance == null)
-			instance = new EditorPluginImageHelper();
-		return instance;
-	}
-
-	//	 save a descriptor for each image
-	private HashMap fImageDescRegistry = null;
-	private final String PLUGINID = SSEUIPlugin.ID;
-
-	/**
-	 * 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;
-	}
-
-	/**
-	 * 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 JFaceResources.getImageRegistry();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImages.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImages.java
deleted file mode 100644
index 7b38844..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImages.java
+++ /dev/null
@@ -1,33 +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.sse.ui.internal.editor;
-
-/**
- * Bundle of most images used by the Source Editor plug-in.
- */
-public class EditorPluginImages {
-
-	public static final String IMG_CTOOL16_SPELLCHECK = "icons/full/ctool16/spellcheck.gif"; //$NON-NLS-1$
-	public static final String IMG_DLCL_COLLAPSEALL = "icons/full/dlcl16/collapseall.gif"; //$NON-NLS-1$
-	public static final String IMG_DLCL_DELETE = "icons/full/dlcl16/delete.gif"; //$NON-NLS-1$
-	public static final String IMG_DLCL_SYNCED = "icons/full/dlcl16/synced.gif"; //$NON-NLS-1$
-	public static final String IMG_DTOOL16_SPELLCHECK = "icons/full/dtool16/spellcheck.gif"; //$NON-NLS-1$
-	public static final String IMG_ELCL_COLLAPSEALL = "icons/full/elcl16/collapseall.gif"; //$NON-NLS-1$
-	public static final String IMG_ELCL_DELETE = "icons/full/elcl16/delete.gif"; //$NON-NLS-1$
-	public static final String IMG_ELCL_SYNCED = "icons/full/elcl16/synced.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL16_SPELLCHECK = "icons/full/etool16/spellcheck.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_OCC_MATCH = "icons/full/obj16/occ_match.gif"; //$NON-NLS-1$
-
-	public static final String IMG_OBJ_PREFERENCES = "icons/full/obj16/preferences.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_PROP_PS = "icons/full/obj16/prop_ps.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index 37a2dbd..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,58 +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.sse.ui.internal.editor;
-
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Help context ids for the Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- *  
- */
-public interface IHelpContextIds {
-
-	// org.eclipse.wst.sse.ui.
-	public static final String PREFIX = SSEUIPlugin.ID + "."; //$NON-NLS-1$
-	// Abstract Source Editor Context Menu
-	// Content Assist
-	public static final String CONTMNU_CONTENTASSIST_HELPID = PREFIX + "xmlm1010"; //$NON-NLS-1$
-	// Format Document
-	public static final String CONTMNU_FORMAT_DOC_HELPID = PREFIX + "xmlm1030"; //$NON-NLS-1$
-	// Format Active Elements
-	public static final String CONTMNU_FORMAT_ELEMENTS_HELPID = PREFIX + "xmlm1040"; //$NON-NLS-1$
-	// Cleanup Document
-	// public static final String CONTMNU_CLEANUP_DOC_HELPID = PREFIX +
-	// "xmlm1050"; //$NON-NLS-1$
-
-	// Properties
-	public static final String CONTMNU_PROPERTIES_HELPID = PREFIX + "xmlm1070"; //$NON-NLS-1$
-
-	// Structured Text Editor Preference Page
-	// Appearance
-	public static final String PREFSTE_APPEARANCE_HELPID = PREFIX + "sted0001"; //$NON-NLS-1$
-	// Hovers
-	public static final String PREFSTE_HOVERS_HELPID = PREFIX + "sted0003"; //$NON-NLS-1$
-
-//	// Read-Only Text Style
-//	public static final String PREFWEBX_READONLY_HELPID = PREFIX + "webx0001"; //$NON-NLS-1$
-
-	// Web and XML Preference Page
-	// Task Tags
-	public static final String PREFWEBX_TASKTAGS_HELPID = PREFIX + "webx0000"; //$NON-NLS-1$
-
-	// Source Editor View
-	public static final String XML_SOURCE_VIEW_HELPID = PREFIX + "xmlm2000"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/StructuredModelDocumentProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/StructuredModelDocumentProvider.java
deleted file mode 100644
index 32ffbcd..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/StructuredModelDocumentProvider.java
+++ /dev/null
@@ -1,263 +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.sse.ui.internal.editor;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-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.content.IContentType;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.IDocumentProviderExtension;
-import org.eclipse.ui.texteditor.IDocumentProviderExtension4;
-import org.eclipse.ui.texteditor.IElementStateListener;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-
-/**
- * @author nitin
- */
-public class StructuredModelDocumentProvider implements IDocumentProvider, IDocumentProviderExtension, IDocumentProviderExtension4 {
-	private static StructuredModelDocumentProvider _instance = null;
-
-	/**
-	 * @return Returns the instance.
-	 */
-	public static StructuredModelDocumentProvider getInstance() {
-		return _instance;
-	}
-
-	{
-		_instance = new StructuredModelDocumentProvider();
-	}
-
-	private StructuredModelDocumentProvider() {
-		super();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#aboutToChange(java.lang.Object)
-	 */
-	public void aboutToChange(Object element) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#addElementStateListener(org.eclipse.ui.texteditor.IElementStateListener)
-	 */
-	public void addElementStateListener(IElementStateListener listener) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#canSaveDocument(java.lang.Object)
-	 */
-	public boolean canSaveDocument(Object element) {
-		return ((IStructuredModel) element).isDirty();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#changed(java.lang.Object)
-	 */
-	public void changed(Object element) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#connect(java.lang.Object)
-	 */
-	public void connect(Object element) throws CoreException {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#disconnect(java.lang.Object)
-	 */
-	public void disconnect(Object element) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#getAnnotationModel(java.lang.Object)
-	 */
-	public IAnnotationModel getAnnotationModel(Object element) {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#getDocument(java.lang.Object)
-	 */
-	public IDocument getDocument(Object element) {
-		return ((IStructuredModel) element).getStructuredDocument();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#getModificationStamp(java.lang.Object)
-	 */
-	public long getModificationStamp(Object element) {
-		return ((IStructuredModel) element).getSynchronizationStamp();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#getStatus(java.lang.Object)
-	 */
-	public IStatus getStatus(Object element) {
-		return Status.OK_STATUS;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#getSynchronizationStamp(java.lang.Object)
-	 */
-	public long getSynchronizationStamp(Object element) {
-		return 0;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#isDeleted(java.lang.Object)
-	 */
-	public boolean isDeleted(Object element) {
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isModifiable(java.lang.Object)
-	 */
-	public boolean isModifiable(Object element) {
-		return true;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isReadOnly(java.lang.Object)
-	 */
-	public boolean isReadOnly(Object element) {
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isStateValidated(java.lang.Object)
-	 */
-	public boolean isStateValidated(Object element) {
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#mustSaveDocument(java.lang.Object)
-	 */
-	public boolean mustSaveDocument(Object element) {
-		return ((IStructuredModel) element).isDirty();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#removeElementStateListener(org.eclipse.ui.texteditor.IElementStateListener)
-	 */
-	public void removeElementStateListener(IElementStateListener listener) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#resetDocument(java.lang.Object)
-	 */
-	public void resetDocument(Object element) throws CoreException {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProvider#saveDocument(org.eclipse.core.runtime.IProgressMonitor,
-	 *      java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
-	 */
-	public void saveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
-		try {
-			((IStructuredModel) element).save();
-		}
-		catch (UnsupportedEncodingException e) {
-		}
-		catch (IOException e) {
-		}
-		catch (CoreException e) {
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#setCanSaveDocument(java.lang.Object)
-	 */
-	public void setCanSaveDocument(Object element) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#synchronize(java.lang.Object)
-	 */
-	public void synchronize(Object element) throws CoreException {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#updateStateCache(java.lang.Object)
-	 */
-	public void updateStateCache(Object element) throws CoreException {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#validateState(java.lang.Object,
-	 *      java.lang.Object)
-	 */
-	public void validateState(Object element, Object computationContext) throws CoreException {
-	}
-
-	public IContentType getContentType(Object element) throws CoreException {
-		return Platform.getContentTypeManager().getContentType(((IStructuredModel) element).getContentTypeIdentifier());
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ActionDescriptor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ActionDescriptor.java
deleted file mode 100644
index 9a72e7a..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ActionDescriptor.java
+++ /dev/null
@@ -1,378 +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.sse.ui.internal.extension;
-
-
-
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.ui.internal.IActionValidator;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.osgi.framework.Bundle;
-
-
-/**
- * When 'action' tag is found in the registry, an object of this class is
- * created. It creates the appropriate action object and captures information
- * that is later used to add this action object into menu/tool bar. This class
- * is reused for global (workbench) menu/tool bar, popup menu actions, as well
- * as view's pulldown and local tool bar.
- */
-public class ActionDescriptor {
-	public static final String ATT_ACCELERATOR = "accelerator"; //$NON-NLS-1$
-	public static final String ATT_CLASS = "class"; //$NON-NLS-1$
-	public static final String ATT_DEFINITION_ID = "definitionId"; //$NON-NLS-1$
-	public static final String ATT_DESCRIPTION = "description"; //$NON-NLS-1$
-	public static final String ATT_DISABLEDICON = "disabledIcon"; //$NON-NLS-1$
-	public static final String ATT_HELP_CONTEXT_ID = "helpContextId"; //$NON-NLS-1$
-	public static final String ATT_HOVERICON = "hoverIcon"; //$NON-NLS-1$
-	public static final String ATT_ICON = "icon"; //$NON-NLS-1$
-
-	public static final String ATT_ID = "id"; //$NON-NLS-1$
-	public static final String ATT_LABEL = "label"; //$NON-NLS-1$
-	public static final String ATT_MENUBAR_PATH = "menubarPath"; //$NON-NLS-1$
-	public static final String ATT_POPUPMENU_PATH = "popupmenuPath"; //$NON-NLS-1$
-	public static final String ATT_STATE = "state"; //$NON-NLS-1$
-	public static final String ATT_TOOLBAR_PATH = "toolbarPath"; //$NON-NLS-1$
-	public static final String ATT_TOOLTIP = "tooltip"; //$NON-NLS-1$
-
-	/**
-	 * Creates an extension. If the extension plugin has not been loaded a
-	 * busy cursor will be activated during the duration of the load.
-	 * 
-	 * @param element
-	 *            the config element defining the extension
-	 * @param classAttribute
-	 *            the name of the attribute carrying the class
-	 * @returns the extension object if successful. If an error occurs when
-	 *          createing executable extension, the exception is logged, and
-	 *          null returned.
-	 */
-	public static Object createExtension(final IConfigurationElement element, final String classAttribute) {
-		final Object[] result = new Object[1];
-		// If plugin has been loaded create extension.
-		// Otherwise, show busy cursor then create extension.
-		String pluginId = element.getDeclaringExtension().getNamespace();
-		Bundle bundle = Platform.getBundle(pluginId);
-		if (bundle.getState() == Bundle.ACTIVE) {
-			try {
-				result[0] = element.createExecutableExtension(classAttribute);
-			} catch (Exception e) {
-				// catch and log ANY exception from extension point
-				handleCreateExecutableException(result, e);
-			}
-		} else {
-			BusyIndicator.showWhile(null, new Runnable() {
-				public void run() {
-					try {
-						result[0] = element.createExecutableExtension(classAttribute);
-					} catch (Exception e) {
-						// catch and log ANY exception from extension point
-						handleCreateExecutableException(result, e);
-					}
-				}
-			});
-		}
-		return result[0];
-	}
-
-	private static void handleCreateExecutableException(final Object[] result, Throwable e) {
-		Logger.logException(e);
-		result[0] = null;
-	}
-
-	private String id;
-
-	private ActionContributionItem item;
-	private String menuGroup;
-	private String menuPath;
-	private String popupmenuGroup;
-	private String popupmenuPath;
-	private String toolbarGroup;
-	private String toolbarPath;
-
-	/**
-	 * Creates a new descriptor with the targetType
-	 */
-	public ActionDescriptor(IConfigurationElement actionElement) throws CoreException {
-
-		// Calculate menu and toolbar paths.
-		String mpath = actionElement.getAttribute(ATT_MENUBAR_PATH);
-		String mgroup = null;
-		if (mpath != null) {
-			int loc = mpath.lastIndexOf('/');
-			if (loc != -1) {
-				mgroup = mpath.substring(loc + 1);
-				mpath = mpath.substring(0, loc);
-			} else {
-				mgroup = mpath;
-				mpath = null;
-			}
-		}
-		menuPath = mpath;
-		menuGroup = mgroup;
-
-		String ppath = actionElement.getAttribute(ATT_POPUPMENU_PATH);
-		String pgroup = null;
-		if (ppath != null) {
-			int loc = ppath.lastIndexOf('/');
-			if (loc != -1) {
-				pgroup = ppath.substring(loc + 1);
-				ppath = ppath.substring(0, loc);
-			} else {
-				pgroup = ppath;
-				ppath = null;
-			}
-		}
-		popupmenuPath = ppath;
-		popupmenuGroup = pgroup;
-
-		String tpath = actionElement.getAttribute(ATT_TOOLBAR_PATH);
-		String tgroup = null;
-		if (tpath != null) {
-			int loc = tpath.lastIndexOf('/');
-			if (loc != -1) {
-				tgroup = tpath.substring(loc + 1);
-				tpath = tpath.substring(0, loc);
-			} else {
-				tgroup = tpath;
-				tpath = null;
-			}
-		}
-		toolbarPath = tpath;
-		toolbarGroup = tgroup;
-
-		// Create action.
-		IAction action = createAction(actionElement);
-		if (action == null)
-			return;
-
-		String label = actionElement.getAttribute(ATT_LABEL);
-		if (label != null)
-			action.setText(label);
-
-		id = actionElement.getAttribute(ATT_ID);
-		if (id == null) {
-			id = actionElement.getAttribute(ATT_CLASS);
-		}
-		if (id != null)
-			action.setId(id);
-
-		String defId = actionElement.getAttribute(ATT_DEFINITION_ID);
-		if (defId != null && defId.length() != 0) {
-			action.setActionDefinitionId(defId);
-		}
-
-		String tooltip = actionElement.getAttribute(ATT_TOOLTIP);
-		if (tooltip != null)
-			action.setToolTipText(tooltip);
-
-		String helpContextId = actionElement.getAttribute(ATT_HELP_CONTEXT_ID);
-		if (helpContextId != null) {
-			String fullID = helpContextId;
-			if (helpContextId.indexOf(".") == -1) //$NON-NLS-1$
-				// For backward compatibility we auto qualify the id if it is
-				// not qualified)
-				fullID = actionElement.getDeclaringExtension().getNamespace() + "." + helpContextId; //$NON-NLS-1$
-			PlatformUI.getWorkbench().getHelpSystem().setHelp(action, fullID);
-		}
-
-		String description = actionElement.getAttribute(ATT_DESCRIPTION);
-		if (description != null)
-			action.setDescription(description);
-
-		String state = actionElement.getAttribute(ATT_STATE);
-		if (state != null) {
-			action.setChecked(state.equals("true")); //$NON-NLS-1$
-		}
-
-		String icon = actionElement.getAttribute(ATT_ICON);
-		if (icon != null) {
-			action.setImageDescriptor(ImageUtil.getImageDescriptorFromExtension(actionElement.getDeclaringExtension(), icon));
-		}
-
-		String hoverIcon = actionElement.getAttribute(ATT_HOVERICON);
-		if (hoverIcon != null) {
-			action.setHoverImageDescriptor(ImageUtil.getImageDescriptorFromExtension(actionElement.getDeclaringExtension(), hoverIcon));
-		}
-
-		String disabledIcon = actionElement.getAttribute(ATT_DISABLEDICON);
-		if (disabledIcon != null) {
-			action.setDisabledImageDescriptor(ImageUtil.getImageDescriptorFromExtension(actionElement.getDeclaringExtension(), disabledIcon));
-		}
-
-		String accelerator = actionElement.getAttribute(ATT_ACCELERATOR);
-		if (accelerator != null)
-			processAccelerator(action, accelerator);
-
-		item = new ActionContributionItem(action);
-	}
-
-	/**
-	 * Parses the given accelerator text, and converts it to an accelerator
-	 * key code.
-	 * 
-	 * @param acceleratorText
-	 *            the accelerator text
-	 * @result the SWT key code, or 0 if there is no accelerator
-	 */
-	private int convertAccelerator(String acceleratorText) {
-		int accelerator = 0;
-		StringTokenizer stok = new StringTokenizer(acceleratorText, "+"); //$NON-NLS-1$
-
-		int keyCode = -1;
-
-		boolean hasMoreTokens = stok.hasMoreTokens();
-		while (hasMoreTokens) {
-			String token = stok.nextToken();
-			hasMoreTokens = stok.hasMoreTokens();
-			// Every token except the last must be one of the modifiers
-			// Ctrl, Shift, or Alt.
-			if (hasMoreTokens) {
-				int modifier = Action.findModifier(token);
-				if (modifier != 0) {
-					accelerator |= modifier;
-				} else { //Leave if there are none
-					return 0;
-				}
-			} else {
-				keyCode = Action.findKeyCode(token);
-			}
-		}
-		if (keyCode != -1) {
-			accelerator |= keyCode;
-		}
-		return accelerator;
-	}
-
-	/**
-	 */
-	private IAction createAction(IConfigurationElement actionElement) {
-		Object action = new ExtendedEditorActionProxyForDelayLoading(actionElement, ATT_CLASS);
-		if (action == null)
-			return null;
-		if (action instanceof IActionValidator) {
-			if (!((IActionValidator) action).isValidAction())
-				return null;
-		}
-		return (action instanceof IAction ? (IAction) ExtendedEditorActionProxy.newInstance(action) : null);
-	}
-
-	/**
-	 * Returns the action object held in this descriptor.
-	 */
-	public IAction getAction() {
-		return (item != null ? item.getAction() : null);
-	}
-
-	/**
-	 * Returns the IContributionItem object held in this descriptor.
-	 */
-	public IContributionItem getContributionItem() {
-		return item;
-	}
-
-	/**
-	 * Returns action's id as defined in the registry.
-	 */
-	public String getId() {
-		return id;
-	}
-
-	/**
-	 * Returns named slot (group) in the menu where this action should be
-	 * added.
-	 */
-	public String getMenuGroup() {
-		return menuGroup;
-	}
-
-	/**
-	 * Returns menu path where this action should be added. If null, the
-	 * action will not be added into the menu.
-	 */
-
-	public String getMenuPath() {
-		return menuPath;
-	}
-
-	/**
-	 * Returns named slot (group) in the popup menu where this action should
-	 * be added.
-	 */
-	public String getPopupMenuGroup() {
-		return popupmenuGroup;
-	}
-
-	/**
-	 * Returns popup menu path where this action should be added. If null, the
-	 * action will not be added into the popup menu.
-	 */
-
-	public String getPopupMenuPath() {
-		return popupmenuPath;
-	}
-
-	/**
-	 * Returns the named slot (group) in the tool bar where this action should
-	 * be added.
-	 */
-
-	public String getToolbarGroup() {
-		return toolbarGroup;
-	}
-
-	/**
-	 * Returns path in the tool bar where this action should be added. If
-	 * null, action will not be added to the tool bar.
-	 */
-	public String getToolbarPath() {
-		return toolbarPath;
-	}
-
-	/**
-	 * Process the accelerator definition. If it is a number then process the
-	 * code directly - if not then parse it and create the code
-	 */
-	private void processAccelerator(IAction action, String acceleratorText) {
-
-		if (acceleratorText.length() == 0)
-			return;
-
-		//Is it a numeric definition?
-		if (Character.isDigit(acceleratorText.charAt(0))) {
-			try {
-				action.setAccelerator(Integer.valueOf(acceleratorText).intValue());
-			} catch (NumberFormatException exception) {
-				Logger.log(Logger.ERROR, "Invalid accelerator declaration: " + id); //$NON-NLS-1$
-			}
-		} else
-			action.setAccelerator(convertAccelerator(acceleratorText));
-	}
-
-	/**
-	 * For debugging only.
-	 */
-	public String toString() {
-		return "ActionDescriptor(" + id + ")"; //$NON-NLS-2$//$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/BreakpointProviderBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/BreakpointProviderBuilder.java
deleted file mode 100644
index a4be642..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/BreakpointProviderBuilder.java
+++ /dev/null
@@ -1,405 +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.sse.ui.internal.extension;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Reads breakpoint extension registory and returns breakpoint provider
- * instances
- */
-public class BreakpointProviderBuilder extends RegistryReader {
-
-	private static final String ATT_CLASS = "class"; //$NON-NLS-1$
-	// private static final String ATT_ID = "id"; //$NON-NLS-1$
-	private static final String ATT_CONTENT_TYPES = "contentTypes"; //$NON-NLS-1$
-	private static final String ATT_EXTENSIONS = "extensions"; //$NON-NLS-1$
-	private static BreakpointProviderBuilder instance;
-	private static final String PL_BREAKPOINT = "breakpoint"; //$NON-NLS-1$
-
-	private static final String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
-
-	private static final String TAG_BREAKPOINT_CONTRIBUTION = "breakpointContribution"; //$NON-NLS-1$
-	private static final String TAG_PROVIDER = "provider"; //$NON-NLS-1$
-
-	/*
-	 * Creates an executable extension. @param element the config element
-	 * defining the extension @param classAttribute the name of the attribute
-	 * carrying the class @return the extension object @throws CoreException
-	 */
-	static Object createExecutableExtension(final IConfigurationElement element, final String classAttribute) throws CoreException {
-		return element.createExecutableExtension(classAttribute);
-	}
-
-	/**
-	 * Creates an extension. If the extension plugin has not been loaded a
-	 * busy cursor will be activated during the duration of the load.
-	 * 
-	 * @param element
-	 *            the config element defining the extension
-	 * @param classAttribute
-	 *            the name of the attribute carrying the class
-	 * @return the extension object
-	 * @throws CoreException
-	 */
-	public static Object createExtension(final IConfigurationElement element, final String classAttribute) {
-		// If plugin has been loaded create extension.
-		// Otherwise, show busy cursor then create extension.
-		final Object[] result = new Object[1];
-		String pluginId = element.getDeclaringExtension().getNamespace();
-		Bundle bundle = Platform.getBundle(pluginId);
-		if (bundle.getState() == Bundle.ACTIVE) {
-			try {
-				result[0] = createExecutableExtension(element, classAttribute);
-			}
-			catch (Exception e) {
-				handleCreateExecutableException(result, e);
-			}
-		}
-		else {
-			BusyIndicator.showWhile(null, new Runnable() {
-				public void run() {
-					try {
-						result[0] = createExecutableExtension(element, classAttribute);
-					}
-					catch (CoreException e) {
-						handleCreateExecutableException(result, e);
-					}
-				}
-			});
-
-		}
-		return result[0];
-	}
-
-	/**
-	 * returns singleton instance of BreakpointProviderBuilder
-	 * 
-	 * @return BreakpointProviderBuilder
-	 */
-	public synchronized static BreakpointProviderBuilder getInstance() {
-		if (instance == null) {
-			instance = new BreakpointProviderBuilder();
-		}
-		return instance;
-	}
-
-	/**
-	 * @param result
-	 * @param e
-	 */
-	private static void handleCreateExecutableException(Object[] result, Throwable e) {
-		Logger.logException(e);
-		result[0] = null;
-
-	}
-
-	protected List cache;
-	private Map map = new HashMap();
-
-	protected String targetContributionTag;
-
-	/*
-	 * Constructor
-	 */
-	private BreakpointProviderBuilder() {
-		super();
-	}
-
-	/*
-	 * Creates a breakpoint provider object to given element @param element
-	 * configuration element object @return IBreakpointProvider
-	 */
-	protected IBreakpointProvider createBreakpointProvider(IConfigurationElement element) {
-		Object obj = createExtension(element, ATT_CLASS);
-		if (obj == null)
-			return null;
-		return (obj instanceof IBreakpointProvider) ? (IBreakpointProvider) obj : null;
-	}
-
-	/*
-	 * Creates an array of breakpoint providers matching the given key to the
-	 * value of the IConfigurationElement attribute "attrName" @return
-	 * IBreakpointProvider[]
-	 */
-	protected IBreakpointProvider[] createBreakpointProviders(String attrName, String key) {
-		if (cache == null)
-			return new IBreakpointProvider[0];
-
-		final int num = cache.size();
-		if (num == 0)
-			return new IBreakpointProvider[0];
-
-		IBreakpointProvider[] bp = new IBreakpointProvider[num];
-		int j = 0;
-		for (int i = 0; i < num; i++) {
-			Object obj = cache.get(i);
-			if (!(obj instanceof IConfigurationElement))
-				continue;
-
-			IConfigurationElement element = (IConfigurationElement) obj;
-			if (!TAG_PROVIDER.equals(element.getName()))
-				continue;
-
-			boolean doCreate = false;
-
-			String attrValues = element.getAttribute(attrName);
-
-			if (attrValues != null) {
-				StringTokenizer tokenizer = new StringTokenizer(attrValues, ","); //$NON-NLS-1$
-				while (tokenizer.hasMoreTokens()) {
-					String type = tokenizer.nextToken();
-					if (type.trim().equalsIgnoreCase(key.trim())) {
-						doCreate = true;
-						break;
-					}
-				}
-			}
-
-			if (doCreate) {
-				IBreakpointProvider b = createBreakpointProvider(element);
-				if (b != null) {
-					bp[j] = b;
-					j++;
-				}
-			}
-		}
-
-		IBreakpointProvider[] bp2 = new IBreakpointProvider[j];
-		for (int i = 0; i < j; i++) {
-			bp2[i] = bp[i];
-		}
-
-		return bp2;
-	}
-
-	/*
-	 * Returns a matching array of extension points matching this key. Doesn't
-	 * cause instantiation of providers. @return IBreakpointProvider[]
-	 */
-	protected IConfigurationElement[] findElements(String key) {
-		initCache();
-
-		if (cache == null || cache.size() == 0)
-			return new IConfigurationElement[0];
-
-		int num = cache.size();
-		List elements = new ArrayList(1);
-		for (int i = 0; i < num; i++) {
-			Object obj = cache.get(i);
-			if (!(obj instanceof IConfigurationElement))
-				continue;
-
-			IConfigurationElement element = (IConfigurationElement) obj;
-			if (!TAG_PROVIDER.equals(element.getName()))
-				continue;
-
-			boolean add = false;
-			String types = element.getAttribute(ATT_CONTENT_TYPES);
-			String exts = element.getAttribute(ATT_EXTENSIONS);
-
-			if (types == null && exts == null) {
-				add = true;
-			}
-
-			if (!add && types != null && types.length() > 0) {
-				IContentType testType = Platform.getContentTypeManager().getContentType(key);
-				StringTokenizer tokenizer = new StringTokenizer(types, ","); //$NON-NLS-1$
-				while (tokenizer.hasMoreTokens()) {
-					String type = tokenizer.nextToken();
-					IContentType contentType = Platform.getContentTypeManager().getContentType(type);
-					if (contentType != null && testType != null && contentType.isKindOf(testType)) {
-						add = true;
-						break;
-					}
-				}
-			}
-
-			if (!add && exts != null) {
-				StringTokenizer tokenizer = new StringTokenizer(exts, ","); //$NON-NLS-1$
-				while (tokenizer.hasMoreTokens()) {
-					String ext = tokenizer.nextToken();
-					if (ext.trim().equals(key.trim())) {
-						add = true;
-						break;
-					}
-				}
-			}
-
-			if (add) {
-				elements.add(element);
-			}
-		}
-		return (IConfigurationElement[]) elements.toArray(new IConfigurationElement[0]);
-	}
-
-	/**
-	 * Returns an array of breakpoint providers for a specified content type
-	 * handler
-	 * 
-	 * @param handler
-	 *            a content type handler
-	 * @param ext
-	 *            file extension
-	 * @return IBreakpointProvider[]
-	 */
-	public IBreakpointProvider[] getBreakpointProviders(IEditorPart editorpart, String contentTypeID, String ext) {
-		initCache();
-
-		// Get breakpoint providers for this content type handler
-		IBreakpointProvider[] providers1 = new IBreakpointProvider[0];
-		IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
-		List holdProviders = new ArrayList(2);
-		while (contentType != null) {
-			IBreakpointProvider[] providers = (IBreakpointProvider[]) map.get(contentType.getId());
-			if (providers == null) {
-				providers = createBreakpointProviders(ATT_CONTENT_TYPES, contentType.getId());
-				if (providers != null) {
-					map.put(contentType.getId(), providers);
-				}
-			}
-			// providers were retrieved from cache or newly created
-			if(providers != null) {
-				holdProviders.addAll(Arrays.asList(providers));
-			}
-			contentType = contentType.getBaseType();
-		}
-		providers1 = (IBreakpointProvider[]) holdProviders.toArray(new IBreakpointProvider[holdProviders.size()]);
-
-		// Get breakpoint providers for this extension
-		IBreakpointProvider[] providers2 = new IBreakpointProvider[0];
-		if (ext != null) {
-			providers2 = (IBreakpointProvider[]) map.get(ext);
-			if (providers2 == null) {
-				providers2 = createBreakpointProviders(ATT_EXTENSIONS, ext);
-				if (providers2 != null) {
-					map.put(ext, providers2);
-				}
-			}
-		}
-
-		// create single hash set to remove duplication
-		Set s = new HashSet();
-		s.addAll(Arrays.asList(providers1));
-		s.addAll(Arrays.asList(providers2));
-
-		// create IBreakpointProvider[] to return
-		IBreakpointProvider[] providers = new IBreakpointProvider[s.size()];
-		Iterator itr = s.iterator();
-		int i = 0;
-		ISourceEditingTextTools tools = null;
-		if (editorpart != null && itr.hasNext())
-			tools = (ISourceEditingTextTools) editorpart.getAdapter(ISourceEditingTextTools.class);
-		while (itr.hasNext()) {
-			providers[i] = (IBreakpointProvider) itr.next();
-			providers[i].setSourceEditingTextTools(tools);
-			i++;
-		}
-		return providers;
-	}
-
-	/**
-	 * Returns corresponding resource from given parameters
-	 * 
-	 * @param input
-	 * @param handler
-	 * @param ext
-	 * @return IResource
-	 */
-	public IResource getResource(IEditorInput input, String contentType, String ext) {
-		IBreakpointProvider[] providers = getBreakpointProviders(null, contentType, ext);
-		IResource res = null;
-		for (int i = 0; i < providers.length; i++) {
-			res = providers[i].getResource(input);
-			if (res != null) {
-				break;
-			}
-		}
-		return res;
-	}
-
-	private void initCache() {
-		if (cache == null) {
-			cache = new ArrayList();
-			readContributions(TAG_BREAKPOINT_CONTRIBUTION, PL_BREAKPOINT);
-		}
-	}
-
-	/**
-	 * Returns an array of breakpoint providers for a specified content type
-	 * handler
-	 * 
-	 * @param contentType
-	 *            a content type ID or null
-	 * @param ext
-	 *            a filename extension or null
-	 * @return boolean
-	 */
-	public boolean isAvailable(String contentType, String ext) {
-		boolean available = false;
-		if (ext != null)
-			available = findElements(ext).length > 0;
-		if (!available && contentType != null)
-			available = findElements(contentType).length > 0;
-		return available;
-	}
-
-	/**
-	 * Reads the contributions from the registry for the provided workbench
-	 * part and the provided extension point ID.
-	 * 
-	 * @param tag
-	 * @param extensionPoint
-	 */
-	protected void readContributions(String tag, String extensionPoint) {
-		targetContributionTag = tag;
-		IExtensionRegistry registry = Platform.getExtensionRegistry();
-		readRegistry(registry, PLUGIN_ID, extensionPoint);
-	}
-
-	protected boolean readElement(IConfigurationElement element) {
-		String tag = element.getName();
-		if (tag.equals(targetContributionTag)) {
-			readElementChildren(element);
-			return true;
-		}
-		else if (tag.equals(TAG_PROVIDER)) {
-			cache.add(element);
-			return true; // just cache the element - don't go into it
-		}
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java
deleted file mode 100644
index 77132ea..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java
+++ /dev/null
@@ -1,150 +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.sse.ui.internal.extension;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.ui.internal.IExtendedSimpleEditor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISelfValidateEditAction;
-
-
-/**
- */
-public class DropActionProxy implements InvocationHandler {
-	public static Object newInstance(Object obj) {
-		Object instance = null;
-		try {
-			Set set = new HashSet();
-			Class clazz = obj.getClass();
-			while (clazz != null) {
-				Class[] interfaces = clazz.getInterfaces();
-				for (int i = 0; i < interfaces.length; i++) {
-					set.add(interfaces[i]);
-				}
-				clazz = clazz.getSuperclass();
-			}
-			Class[] classes = new Class[set.size()];
-			Iterator itr = set.iterator();
-			int i = 0;
-			while (itr.hasNext()) {
-				classes[i] = (Class) itr.next();
-				i++;
-			}
-			instance = Proxy.newProxyInstance(obj.getClass().getClassLoader(), classes, new DropActionProxy(obj));
-		} catch (Error e) {
-			Logger.logException("Exception while proxying a drop action", e); //$NON-NLS-1$
-			instance = obj;
-		}
-		return instance;
-	}
-
-	private IExtendedSimpleEditor editor = null;
-	private IStructuredModel fRecorder;
-	private Object obj;
-
-	private DropActionProxy(Object obj) {
-		this.obj = obj;
-	}
-
-	private void beginRecording() {
-		IDocument document = null;
-		if (editor != null) {
-			document = editor.getDocument();
-			if (document != null)
-				fRecorder = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
-			// Prepare for Undo
-			if (fRecorder != null) {
-				IStructuredTextUndoManager um = fRecorder.getUndoManager();
-				if (um != null) {
-					if (this.obj instanceof IAction)
-						um.beginRecording(this, ((IAction) this.obj).getText(), ((IAction) this.obj).getDescription());
-					else
-						um.beginRecording(this);
-				}
-			}
-		}
-	}
-
-	private void endRecording() {
-		if (fRecorder != null) {
-			IStructuredTextUndoManager um = fRecorder.getUndoManager();
-			if (um != null)
-				um.endRecording(this);
-			fRecorder.releaseFromEdit();
-			fRecorder = null;
-		}
-	}
-
-	/**
-	 * @see java.lang.reflect.InvocationHandler#invoke(Object, Method,
-	 *      Object[])
-	 */
-	public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
-		Object result;
-		String name = m.getName();
-		try {
-			if (name.equals("equals")) { //$NON-NLS-1$
-				// Workaround for JDK's bug 4652876
-				// "equals" always returns false even if both
-				// InvocationHandler
-				// class
-				// hold the same objects
-				// See
-				// http://developer.java.sun.com/developer/bugParade/bugs/4652876.html
-				// This problem is in the IBM SDK 1.3.1
-				// but I don't see the bug in Sun's JDK 1.4.1 (beta)
-				Object arg = args[0];
-				return (proxy.getClass() == arg.getClass() && equals(Proxy.getInvocationHandler(arg))) ? Boolean.TRUE : Boolean.FALSE;
-			} else if (name.equals("run")) { //$NON-NLS-1$
-				if (args[1] instanceof IExtendedSimpleEditor) {
-					editor = (IExtendedSimpleEditor) args[1];
-				}
-				beginRecording();
-				if ((editor != null) && !(obj instanceof ISelfValidateEditAction)) {
-					
-					// TODO: cleanup validateEdit
-					// just leaving this check and following code here for transition. 
-					// I assume we'll remove all need for 'validateEdit'
-					// or move to platform editor's validateState 
-					
-//					IStatus status = editor.validateEdit(getDisplay().getActiveShell());
-//					if (!status.isOK()) {
-//						return null;
-//					}
-				}
-			}
-			result = m.invoke(obj, args);
-		} catch (InvocationTargetException e) {
-			throw e.getTargetException();
-		} catch (Exception e) {
-			throw new RuntimeException(e.getMessage());
-		} finally {
-			if (name.equals("run")) { //$NON-NLS-1$
-				endRecording();
-			}
-		}
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java
deleted file mode 100644
index 410e6d5..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java
+++ /dev/null
@@ -1,149 +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.sse.ui.internal.extension;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.ui.internal.IExtendedSimpleEditor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISelfValidateEditAction;
-
-
-/**
- * Begins and ends UndoManager recording around run() and runWithEvent(...)
- */
-public class ExtendedEditorActionProxy implements InvocationHandler {
-	public static Object newInstance(Object obj) {
-		Set set = new HashSet();
-		Class clazz = obj.getClass();
-		while (clazz != null) {
-			Class[] interfaces = clazz.getInterfaces();
-			for (int i = 0; i < interfaces.length; i++) {
-				set.add(interfaces[i]);
-			}
-			clazz = clazz.getSuperclass();
-		}
-		Class[] classes = new Class[set.size()];
-		Iterator itr = set.iterator();
-		int i = 0;
-		while (itr.hasNext()) {
-			classes[i] = (Class) itr.next();
-			i++;
-		}
-		return Proxy.newProxyInstance(obj.getClass().getClassLoader(), classes, new ExtendedEditorActionProxy(obj));
-	}
-
-	private IExtendedSimpleEditor editor = null;
-	private IStructuredModel fRecorder;
-	private Object obj;
-
-	private ExtendedEditorActionProxy(Object obj) {
-		this.obj = obj;
-	}
-
-	private void beginRecording() {
-		IDocument document = null;
-		if (editor != null) {
-			document = editor.getDocument();
-			if (document != null)
-				fRecorder = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
-			// Prepare for Undo
-			if (fRecorder != null) {
-				IStructuredTextUndoManager um = fRecorder.getUndoManager();
-				if (um != null) {
-					um.beginRecording(this, ((IAction) this.obj).getText(), ((IAction) this.obj).getDescription());
-				}
-			}
-		}
-	}
-
-	private void endRecording() {
-		if (fRecorder != null) {
-			IStructuredTextUndoManager um = fRecorder.getUndoManager();
-			if (um != null) {
-				um.endRecording(this);
-			}
-			fRecorder.releaseFromEdit();
-			fRecorder = null;
-		}
-	}
-
-	/**
-	 * @see java.lang.reflect.InvocationHandler#invoke(Object, Method,
-	 *      Object[])
-	 */
-	public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
-		Object result = null;
-		String name = m.getName();
-		try {
-			if (name.equals("equals")) { //$NON-NLS-1$
-				// Workaround for JDK's bug 4652876
-				// "equals" always returns false even if both
-				// InvocationHandler
-				// class
-				// hold the same objects
-				// See
-				// http://developer.java.sun.com/developer/bugParade/bugs/4652876.html
-				// This problem is in the IBM SDK 1.3.1
-				// but I don't see the bug in Sun's JDK 1.4.1 (beta)
-				Object arg = args[0];
-				return (proxy.getClass() == arg.getClass() && equals(Proxy.getInvocationHandler(arg))) ? Boolean.TRUE : Boolean.FALSE;
-			} else if (name.equals("runWithEvent") || name.equals("run")) { //$NON-NLS-1$  //$NON-NLS-2$
-				beginRecording();
-				if ((editor != null) && !(this.obj instanceof ISelfValidateEditAction)) {
-					
-					// TODO: cleanup validateEdit
-					// just leaving this check and following code here for transition. 
-					// I assume we'll remove all need for 'validateEdit'
-					// or move to platform editor's validateState 
-
-//					IStatus status = editor.validateEdit(getDisplay().getActiveShell());
-//					if (!status.isOK()) {
-//						return null;
-//					}
-				}
-			} else if (name.equals("setActiveExtendedEditor")) { //$NON-NLS-1$
-				if (args[0] instanceof IExtendedSimpleEditor) {
-					editor = (IExtendedSimpleEditor) args[0];
-				}
-			}
-			result = m.invoke(this.obj, args);
-		} catch (InvocationTargetException e) {
-			Logger.logException(e.getTargetException());
-			//throw e.getTargetException();
-		} catch (Exception e) {
-			Logger.logException(e);
-			if (name.equals("runWithEvent") || name.equals("run")) { //$NON-NLS-1$  //$NON-NLS-2$
-				// only expose user-driven exceptions from "running" to the
-				// user
-				throw new RuntimeException(e.getMessage());
-			}
-		} finally {
-			if (name.equals("runWithEvent") || name.equals("run")) { //$NON-NLS-1$  //$NON-NLS-2$
-				endRecording();
-			}
-		}
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxyForDelayLoading.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxyForDelayLoading.java
deleted file mode 100644
index c4565df..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxyForDelayLoading.java
+++ /dev/null
@@ -1,752 +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.sse.ui.internal.extension;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.HelpListener;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.wst.sse.ui.internal.IExtendedEditorAction;
-import org.eclipse.wst.sse.ui.internal.IExtendedSimpleEditor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.osgi.framework.Bundle;
-
-public class ExtendedEditorActionProxyForDelayLoading implements IExtendedEditorAction, IExtendedEditorActionProxyForDelayLoading, IAction {
-    private IAction proxy;
-    private IAction dummy = new Action() { // this is for mainly its property change notify...
-    };
-    // proxy'ed properties
-    private String p_id;
-    private boolean set_p_id;
-    private String p_text;
-    private boolean set_p_text;
-    private String p_toolTipText;
-    private boolean set_p_toolTipText;
-    private String p_actionDefinitionId;
-    private boolean set_p_actionDefinitionId;
-    private ImageDescriptor p_image;
-    private boolean set_p_image;
-    private ImageDescriptor p_hoverImage;
-    private boolean set_p_hoverImage;
-    private ImageDescriptor p_disabledImage;
-    private boolean set_p_disabledImage;
-    private int p_accelerator;
-    private boolean set_p_accelerator;
-    private int p_style = AS_PUSH_BUTTON;
-    //private boolean set_p_style;
-    private HelpListener p_helpListener;
-    private boolean set_p_helpListener;
-    private boolean p_enabled = true; // should be same as what is done in
-    private boolean set_p_enabled;
-    private ListenerList p_listeners = new ListenerList(3);
-    private boolean set_p_listeners;
-    private boolean p_checked;
-    private boolean set_p_checked;
-    private IExtendedSimpleEditor p_targetEditor;
-    private boolean set_p_targetEditor;
-	private boolean p_isvisible = true; // should be true
-	
-	private IConfigurationElement element;
-	private String classAttribute;
-
-	 /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
-     */
-    public void addPropertyChangeListener(IPropertyChangeListener listener) {
-        p_listeners.add(listener);
-        set_p_listeners = true;
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            proxy.addPropertyChangeListener(listener);
-        } else {
-        	dummy.addPropertyChangeListener(listener);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#getAccelerator()
-     */
-    public int getAccelerator() {
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            return proxy.getAccelerator();
-        }
-        return p_accelerator;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#getActionDefinitionId()
-     */
-    public String getActionDefinitionId() {
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            return proxy.getActionDefinitionId();
-        }
-        return p_actionDefinitionId;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#getDescription()
-     */
-    public String getDescription() {
-        //        System.out.println(p_id + ": getDescription");
-        //        System.out.flush();
-        realize();
-        if (proxy != null) {
-            return proxy.getDescription();
-        }
-        return null;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#getDisabledImageDescriptor()
-     */
-    public ImageDescriptor getDisabledImageDescriptor() {
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            return proxy.getDisabledImageDescriptor();
-        }
-        return p_disabledImage;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#getHelpListener()
-     */
-    public HelpListener getHelpListener() {
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            return proxy.getHelpListener();
-        }
-        return p_helpListener;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#getHoverImageDescriptor()
-     */
-    public ImageDescriptor getHoverImageDescriptor() {
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            return proxy.getHoverImageDescriptor();
-        }
-        return p_hoverImage;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#getId()
-     */
-    public String getId() {
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            return proxy.getId();
-        }
-        return p_id;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#getImageDescriptor()
-     */
-    public ImageDescriptor getImageDescriptor() {
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            return proxy.getImageDescriptor();
-        }
-        return p_image;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#getMenuCreator()
-     */
-    public IMenuCreator getMenuCreator() {
-        //        System.out.println(p_id + ": getMenuCreator");
-        //        System.out.flush();
-        realize();
-        if (proxy != null) {
-            return proxy.getMenuCreator();
-        }
-        return null;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#getStyle()
-     */
-    public int getStyle() {
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            return proxy.getStyle();
-        }
-        return p_style;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#getText()
-     */
-    public String getText() {
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            return proxy.getText();
-        }
-        return p_text;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#getToolTipText()
-     */
-    public String getToolTipText() {
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            return proxy.getToolTipText();
-        }
-        return p_toolTipText;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#isChecked()
-     */
-    public boolean isChecked() {
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            return proxy.isChecked();
-        }
-        return p_checked;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#isEnabled()
-     */
-    public boolean isEnabled() {
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            return proxy.isEnabled();
-        }
-        return p_enabled;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
-     */
-    public void removePropertyChangeListener(IPropertyChangeListener listener) {
-        p_listeners.remove(listener);
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            proxy.removePropertyChangeListener(listener);
-        }
-        dummy.removePropertyChangeListener(listener);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#run()
-     */
-    public void run() {
-        realize();
-        if (proxy != null) {
-            // if this has a key accelerator, first update this action and to
-            // see if this action is enabled or not.
-            if ((proxy.getAccelerator() > 0) || (proxy.getActionDefinitionId() != null)) {
-                update();
-                if (isEnabled() == true) {
-                    proxy.run();
-                }
-            } else {
-                proxy.run();
-            }
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#runWithEvent(org.eclipse.swt.widgets.Event)
-     */
-    public void runWithEvent(Event event) {
-        realize();
-        if (proxy != null) {
-            // same as run()
-            if ((proxy.getAccelerator() > 0) || (proxy.getActionDefinitionId() != null)) {
-                update();
-                if (isEnabled() == true) {
-                    proxy.runWithEvent(event);
-                }
-            } else {
-                proxy.runWithEvent(event);
-            }
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#setActionDefinitionId(java.lang.String)
-     */
-    public void setActionDefinitionId(String id) {
-        p_actionDefinitionId = id;
-        set_p_actionDefinitionId = true;
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            proxy.setActionDefinitionId(id);
-        } else {
-        	dummy.setActionDefinitionId(id);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#setChecked(boolean)
-     */
-    public void setChecked(boolean checked) {
-        p_checked = checked;
-        set_p_checked = true;
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            proxy.setChecked(checked);
-        } else {
-        	dummy.setChecked(checked);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#setDescription(java.lang.String)
-     */
-    public void setDescription(String text) {
-        //        System.out.println(p_id + ": setDescription");
-        //        System.out.flush();
-        realize();
-        if (proxy != null) {
-            proxy.setDescription(text);
-        } else {
-        	dummy.setDescription(text);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#setDisabledImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
-     */
-    public void setDisabledImageDescriptor(ImageDescriptor newImage) {
-        p_disabledImage = newImage;
-        set_p_disabledImage = true;
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            proxy.setDisabledImageDescriptor(newImage);
-        } else {
-        	dummy.setDisabledImageDescriptor(newImage);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#setEnabled(boolean)
-     */
-    public void setEnabled(boolean enabled) {
-        p_enabled = enabled;
-        set_p_enabled = true;
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            proxy.setEnabled(enabled);
-        } else {
-        	dummy.setEnabled(enabled);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#setHelpListener(org.eclipse.swt.events.HelpListener)
-     */
-    public void setHelpListener(HelpListener listener) {
-        p_helpListener = listener;
-        set_p_helpListener = true;
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            proxy.setHelpListener(listener);
-        } else {
-        	dummy.setHelpListener(listener);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#setHoverImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
-     */
-    public void setHoverImageDescriptor(ImageDescriptor newImage) {
-        p_hoverImage = newImage;
-        set_p_hoverImage = true;
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            proxy.setHoverImageDescriptor(newImage);
-        } else {
-        	dummy.setHoverImageDescriptor(newImage);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#setId(java.lang.String)
-     */
-    public void setId(String id) {
-        p_id = id;
-        set_p_id = true;
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            proxy.setId(id);
-        } else {
-        	dummy.setId(id);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#setImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
-     */
-    public void setImageDescriptor(ImageDescriptor newImage) {
-        p_image = newImage;
-        set_p_image = true;
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            proxy.setImageDescriptor(newImage);
-        } else {
-        	dummy.setImageDescriptor(newImage);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#setMenuCreator(org.eclipse.jface.action.IMenuCreator)
-     */
-    public void setMenuCreator(IMenuCreator creator) {
-        //        System.out.println(p_id + ": setMenuCreator");
-        //        System.out.flush();
-        realize();
-        if (proxy != null) {
-            proxy.setMenuCreator(creator);
-        } else {
-        	dummy.setMenuCreator(creator);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#setText(java.lang.String)
-     */
-    public void setText(String text) {
-        p_text = text;
-        set_p_text = true;
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            proxy.setText(text);
-        } else {
-        	dummy.setText(text);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#setToolTipText(java.lang.String)
-     */
-    public void setToolTipText(String text) {
-        p_toolTipText = text;
-        set_p_toolTipText = true;
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            proxy.setToolTipText(text);
-        } else {
-        	dummy.setToolTipText(text);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#setAccelerator(int)
-     */
-    public void setAccelerator(int keycode) {
-        p_accelerator = keycode;
-        set_p_accelerator = true;
-        // don't realize class.
-        // realize();
-        if (proxy != null) {
-            proxy.setAccelerator(keycode);
-        } else {
-        	dummy.setAccelerator(keycode);
-        }
-    }
-
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.wst.sse.ui.internal.IExtendedEditorAction#setActiveExtendedEditor(com.ibm.sse.editor.extension.IExtendedSimpleEditor)
-	 */
-	public void setActiveExtendedEditor(IExtendedSimpleEditor targetEditor) {
-		p_targetEditor = targetEditor;
-		set_p_targetEditor = true;
-        // don't realize class.
-        // realize();
-        if ((proxy != null) && (proxy instanceof IExtendedEditorAction)) {
-            ((IExtendedEditorAction)proxy).setActiveExtendedEditor(targetEditor);
-        }
-	}
-
-	/* (non-Javadoc)
-	 * @see com.ibm.sse.editor.extension.IExtendedEditorAction#isVisible()
-	 */
-	public boolean isVisible() {
-        // don't realize class.
-        // realize();
-        if ((proxy != null) && (proxy instanceof IExtendedEditorAction)) {
-            return ((IExtendedEditorAction)proxy).isVisible();
-        }
-        return p_isvisible;
-	}
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.jface.action.IAction#isHandled
-     */
-	public boolean isHandled() {
-		return false;
-	}
-
-	// see ActionDescriptor#createExtension
-	private static IAction newInstance(final IConfigurationElement elm, final String cla) {
-		final Object[] result = new Object[1];
-		// If plugin has been loaded create extension.
-		// Otherwise, show busy cursor then create extension.
-		Bundle bundle= Platform.getBundle(elm.getDeclaringExtension().getNamespace());
-		if (bundle != null && bundle.getState() == Bundle.ACTIVE) {
-			try {
-				result[0] = elm.createExecutableExtension(cla);
-			}
-			catch (Exception e) {
-				// catch and log ANY exception from extension point
-				handleCreateExecutableException(result, e);
-			}
-		}
-		else {
-			BusyIndicator.showWhile(null, new Runnable() {
-				public void run() {
-					try {
-						result[0] = elm.createExecutableExtension(cla);
-					}
-					catch (Exception e) {
-						// catch and log ANY exception from extension point
-						handleCreateExecutableException(result, e);
-					}
-				}
-			});
-		}
-		if ((result[0] != null) && (result[0] instanceof IAction)) {
-			return (IAction)result[0];
-		}
-		return null;
-    }
-	
-	private static void handleCreateExecutableException(final Object[] result, Throwable e) {
-		Logger.logException(e);
-		result[0] = null;
-	}
-
-	/**
-     * Instantiate a real class here
-     */
-    public void realize() {
-        if ((proxy == null) && (element != null) && (classAttribute != null)) {
-            proxy = newInstance(element, classAttribute);
-	        if (proxy != null) {
-	            element = null;
-	            classAttribute = null;
-	            // propagate proxy'ed properties
-	            if (set_p_listeners == true) {
-	                if (p_listeners.size() > 0) {
-	                    Object[] l = p_listeners.getListeners();
-	                    int ls = l.length;
-	                    for (int i = 0; i < ls; i++) {
-	                        IPropertyChangeListener pl = (IPropertyChangeListener) l[i];
-	                        proxy.addPropertyChangeListener(pl);
-	                        dummy.removePropertyChangeListener(pl); // remove listener from dymmy so that we don't send notifications twice anymore
-	                    }
-	                }
-	            }
-	            if (set_p_accelerator == true) {
-	                proxy.setAccelerator(p_accelerator);
-	            }
-	            if (set_p_actionDefinitionId == true) {
-	                if (p_actionDefinitionId != null) {
-	                    proxy.setActionDefinitionId(p_actionDefinitionId);
-	                }
-	            }
-	            if (set_p_checked == true) {
-	                proxy.setChecked(p_checked);
-	            }
-	            if (set_p_disabledImage == true) {
-	                if (p_disabledImage != null) {
-	                    proxy.setDisabledImageDescriptor(p_disabledImage);
-	                }
-	            }
-	            if (set_p_enabled == true) {
-	                proxy.setEnabled(p_enabled);
-	            }
-	            if (set_p_helpListener == true) {
-	                if (p_helpListener != null) {
-	                    proxy.setHelpListener(p_helpListener);
-	                }
-	            }
-	            if (set_p_hoverImage == true) {
-	                if (p_hoverImage != null) {
-	                    proxy.setHoverImageDescriptor(p_hoverImage);
-	                }
-	            }
-	            if (set_p_id == true) {
-	                if (p_id != null) {
-	                    proxy.setId(p_id);
-	                }
-	            }
-	            if (set_p_image == true) {
-	                if (p_image != null) {
-	                    proxy.setImageDescriptor(p_image);
-	                }
-	            }
-	            if (set_p_text == true) {
-	                if (p_text != null) {
-	                    proxy.setText(p_text);
-	                }
-	            }
-	            if (set_p_toolTipText == true) {
-	                if (p_toolTipText != null) {
-	                    proxy.setToolTipText(p_toolTipText);
-	                }
-	            }
-	            if (set_p_targetEditor == true) {
-	                if (p_targetEditor != null) {
-				        if (proxy instanceof IExtendedEditorAction) {
-				            ((IExtendedEditorAction)proxy).setActiveExtendedEditor(p_targetEditor);
-				        }
-	                }
-	            }
-	        }
-        }
-    }
-
-    public boolean isRealized() {
-        return (proxy != null);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.texteditor.IUpdate#update()
-     */
-    public void update() {
-        // don't realize class.
-        // realize();
-        if ((proxy != null) && (proxy instanceof IUpdate)) {
-            ((IUpdate) proxy).update();
-        }
-    }
-
-    /**
-     * get a real action class
-     */
-    public IAction getAction() {
-        realize();
-        return proxy;
-    }
-
-
-    /**
-     * These are Actions's constructors
-     */
-    ExtendedEditorActionProxyForDelayLoading() {
-        super();
-     }
-    public ExtendedEditorActionProxyForDelayLoading(final IConfigurationElement element, final String classAttribute) {
-        super();
-        this.element = element;
-        this.classAttribute = classAttribute;
-    }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/IExtendedEditorActionProxyForDelayLoading.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/IExtendedEditorActionProxyForDelayLoading.java
deleted file mode 100644
index 0152cbe..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/IExtendedEditorActionProxyForDelayLoading.java
+++ /dev/null
@@ -1,22 +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.sse.ui.internal.extension;
-
-import org.eclipse.jface.action.IAction;
-
-
-public interface IExtendedEditorActionProxyForDelayLoading {
-    public IAction getAction();
-    public boolean isRealized();
-    public void realize();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ImageUtil.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ImageUtil.java
deleted file mode 100644
index b4ec693..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ImageUtil.java
+++ /dev/null
@@ -1,84 +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.sse.ui.internal.extension;
-
-
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.osgi.framework.Bundle;
-
-public class ImageUtil {
-
-
-	/**
-	 * Convenience Method. Returns an ImageDescriptor whose path, relative to
-	 * the plugin containing the <code>extension</code> is
-	 * <code>subdirectoryAndFilename</code>. If there isn't any value
-	 * associated with the name then <code>null
-	 * </code> is returned.
-	 * 
-	 * This method is convenience and only intended for use by the workbench
-	 * because it explicitly uses the workbench's registry for
-	 * caching/retrieving images from other extensions -- other plugins must
-	 * user their own registry. This convenience method is subject to removal.
-	 * 
-	 * Note: subdirectoryAndFilename must not have any leading "." or path
-	 * separators / or \ ISV's should use icons/mysample.gif and not
-	 * ./icons/mysample.gif
-	 * 
-	 * Note: This consults the plugin for extension and obtains its
-	 * installation location. all requested images are assumed to be in a
-	 * directory below and relative to that plugins installation directory.
-	 */
-	public static ImageDescriptor getImageDescriptorFromExtension(IExtension extension, String subdirectoryAndFilename) {
-		String pluginId = extension.getNamespace();
-		Bundle bundle = Platform.getBundle(pluginId);
-		return getImageDescriptorFromBundle(bundle, subdirectoryAndFilename);
-	}
-
-	/**
-	 * Convenience Method. Return an ImageDescriptor whose path relative to
-	 * the plugin described by <code>bundle</code> is
-	 * <code>subdirectoryAndFilename</code>. Returns <code>null</code> if
-	 * no image could be found.
-	 * 
-	 * This method is convenience and only intended for use by the workbench
-	 * because it explicitly uses the workbench's registry for
-	 * caching/retrieving images from other extensions -- other plugins must
-	 * user their own registry. This convenience method is subject to removal.
-	 * 
-	 * Note: subdirectoryAndFilename must not have any leading "." or path
-	 * separators / or \ ISV's should use icons/mysample.gif and not
-	 * ./icons/mysample.gif
-	 * 
-	 * Note: This consults the plugin for extension and obtains its
-	 * installation location. all requested images are assumed to be in a
-	 * directory below and relative to that plugins installation directory.
-	 */
-	public static ImageDescriptor getImageDescriptorFromBundle(Bundle bundle, String subdirectoryAndFilename) {
-
-		URL path = bundle.getEntry("/"); //$NON-NLS-1$
-		URL fullPathString = null;
-		try {
-			fullPathString = new URL(path, subdirectoryAndFilename);
-			return ImageDescriptor.createFromURL(fullPathString);
-		} catch (MalformedURLException e) {
-		}
-		return null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/RegistryReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/RegistryReader.java
deleted file mode 100644
index bd444ce..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/RegistryReader.java
+++ /dev/null
@@ -1,176 +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.sse.ui.internal.extension;
-
-
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.util.Sorter;
-
-
-/**
- * Template implementation of a registry reader that creates objects
- * representing registry contents. Typically, an extension contains one
- * element, but this reader handles multiple elements per extension.
- * 
- * To start reading the extensions from the registry for an extension point,
- * call the method <code>readRegistry</code>.
- * 
- * To read children of an IConfigurationElement, call the method
- * <code>readElementChildren</code> from your implementation of the method
- * <code>readElement</code>, as it will not be done by default.
- */
-public abstract class RegistryReader {
-
-
-	protected static final String TAG_DESCRIPTION = "description"; //$NON-NLS-1$
-
-	/**
-	 * The constructor.
-	 */
-	protected RegistryReader() {
-	}
-
-	/**
-	 * This method extracts description as a subelement of the given element.
-	 * 
-	 * @return description string if defined, or empty string if not.
-	 */
-	protected String getDescription(IConfigurationElement config) {
-		IConfigurationElement[] children = config.getChildren(TAG_DESCRIPTION);
-		if (children.length >= 1) {
-			return children[0].getValue();
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	/**
-	 * Logs the error in the workbench log using the provided text and the
-	 * information in the configuration element.
-	 */
-	protected void logError(IConfigurationElement element, String text) {
-		IExtension extension = element.getDeclaringExtension();
-		StringBuffer buf = new StringBuffer();
-		buf.append("Plugin " + extension.getNamespace() + ", extension " + extension.getExtensionPointUniqueIdentifier()); //$NON-NLS-2$//$NON-NLS-1$
-		buf.append("\n" + text); //$NON-NLS-1$
-		Logger.log(Logger.ERROR, buf.toString());
-	}
-
-	/**
-	 * Logs a very common registry error when a required attribute is missing.
-	 */
-	protected void logMissingAttribute(IConfigurationElement element, String attributeName) {
-		logError(element, "Required attribute '" + attributeName + "' not defined"); //$NON-NLS-2$//$NON-NLS-1$
-	}
-
-	/**
-	 * Logs a registry error when the configuration element is unknown.
-	 */
-	protected void logUnknownElement(IConfigurationElement element) {
-		logError(element, "Unknown extension tag found: " + element.getName()); //$NON-NLS-1$
-	}
-
-	/**
-	 * Apply a reproducable order to the list of extensions provided, such
-	 * that the order will not change as extensions are added or removed.
-	 */
-	protected IExtension[] orderExtensions(IExtension[] extensions) {
-		// By default, the order is based on plugin id sorted
-		// in ascending order. The order for a plugin providing
-		// more than one extension for an extension point is
-		// dependent in the order listed in the XML file.
-		Sorter sorter = new Sorter() {
-			public boolean compare(Object extension1, Object extension2) {
-				String s1 = ((IExtension) extension1).getNamespace().toUpperCase();
-				String s2 = ((IExtension) extension2).getNamespace().toUpperCase();
-				//Return true if elementTwo is 'greater than' elementOne
-				return s2.compareTo(s1) > 0;
-			}
-		};
-
-		Object[] sorted = sorter.sort(extensions);
-		IExtension[] sortedExtension = new IExtension[sorted.length];
-		System.arraycopy(sorted, 0, sortedExtension, 0, sorted.length);
-		return sortedExtension;
-	}
-
-	/**
-	 * Implement this method to read element's attributes. If children should
-	 * also be read, then implementor is responsible for calling
-	 * <code>readElementChildren</code>. Implementor is also responsible
-	 * for logging missing attributes.
-	 * 
-	 * @return true if element was recognized, false if not.
-	 */
-	protected abstract boolean readElement(IConfigurationElement element);
-
-	/**
-	 * Read the element's children. This is called by the subclass'
-	 * readElement method when it wants to read the children of the element.
-	 */
-	protected void readElementChildren(IConfigurationElement element) {
-		readElements(element.getChildren());
-	}
-
-	/**
-	 * Read each element one at a time by calling the subclass implementation
-	 * of <code>readElement</code>.
-	 * 
-	 * Logs an error if the element was not recognized.
-	 */
-	protected void readElements(IConfigurationElement[] elements) {
-		for (int i = 0; i < elements.length; i++) {
-			if (!readElement(elements[i]))
-				logUnknownElement(elements[i]);
-		}
-	}
-
-	/**
-	 * Read one extension by looping through its configuration elements.
-	 */
-	protected void readExtension(IExtension extension) {
-		readElements(extension.getConfigurationElements());
-	}
-
-	/**
-	 * @deprecated use readRegistry(IExtensionRegistry registry, String pluginId, String extensionPoint)
-	 */
-	protected void readRegistry(IPluginRegistry registry, String pluginId, String extensionPoint) {
-		IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPoint);
-		if (point != null) {
-			IExtension[] extensions = point.getExtensions();
-			extensions = orderExtensions(extensions);
-			for (int i = 0; i < extensions.length; i++)
-				readExtension(extensions[i]);
-		}
-	}
-	
-	/**
-	 * Start the registry reading process using the supplied plugin ID and
-	 * extension point.
-	 */
-	protected void readRegistry(IExtensionRegistry registry, String pluginId, String extensionPoint) {
-		IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPoint);
-		if (point != null) {
-			IExtension[] extensions = point.getExtensions();
-			extensions = orderExtensions(extensions);
-			for (int i = 0; i < extensions.length; i++)
-				readExtension(extensions[i]);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/format/StructuredFormattingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/format/StructuredFormattingStrategy.java
deleted file mode 100644
index 417ad27..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/format/StructuredFormattingStrategy.java
+++ /dev/null
@@ -1,91 +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.sse.ui.internal.format;
-
-import java.io.IOException;
-import java.util.LinkedList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-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.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-public class StructuredFormattingStrategy extends ContextBasedFormattingStrategy {
-
-	/** Documents to be formatted by this strategy */
-	private final LinkedList fDocuments = new LinkedList();
-	private IStructuredFormatProcessor fFormatProcessor;
-	/** Partitions to be formatted by this strategy */
-	private final LinkedList fPartitions = new LinkedList();
-	private IRegion fRegion;
-
-	/**
-	 * @param formatProcessor
-	 */
-	public StructuredFormattingStrategy(IStructuredFormatProcessor formatProcessor) {
-		super();
-
-		fFormatProcessor = formatProcessor;
-	}
-
-	/*
-	 * @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 && fRegion != null && fFormatProcessor != null) {
-			try {
-				fFormatProcessor.formatDocument(document, fRegion.getOffset(), fRegion.getLength());
-			}
-			catch (IOException e) {
-				// log for now, unless we find reason not to
-				Logger.log(Logger.INFO, e.getMessage());
-			}
-			catch (CoreException e) {
-				// log for now, unless we find reason not to
-				Logger.log(Logger.INFO, e.getMessage());
-			}
-		}
-	}
-
-	/*
-	 * @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));
-		fRegion = (IRegion) context.getProperty(FormattingContextProperties.CONTEXT_REGION);
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStops()
-	 */
-	public void formatterStops() {
-		super.formatterStops();
-
-		fPartitions.clear();
-		fDocuments.clear();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/HighlighterHyperlinkPresenter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/HighlighterHyperlinkPresenter.java
deleted file mode 100644
index 5085fa4..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/HighlighterHyperlinkPresenter.java
+++ /dev/null
@@ -1,468 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.hyperlink;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITextViewerExtension2;
-import org.eclipse.jface.text.ITextViewerExtension5;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter;
-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.custom.StyledText;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Display;
-
-
-/**
- * The is almost an exact copy of DefaultHyperlinkPresenter. However this
- * hyperlink presenter works with the StructuredTextEditor's Highlighter
- * instead of TextPresentation.
- * 
- * The main difference is <code>text.redrawRange(offset, length, true);</code>
- * is called instead of passing false for clearBackground. Also all mention of
- * TextPresentation was removed since it does not really apply.
- * 
- * @see org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter
- */
-public class HighlighterHyperlinkPresenter implements IHyperlinkPresenter, PaintListener, ITextInputListener, IDocumentListener, IPropertyChangeListener {
-
-	/**
-	 * A named preference that holds the color used for hyperlinks.
-	 * <p>
-	 * Value is of type <code>String</code>. A RGB color value encoded as a
-	 * string using class <code>PreferenceConverter</code>
-	 * </p>
-	 * 
-	 * @see org.eclipse.jface.resource.StringConverter
-	 * @see org.eclipse.jface.preference.PreferenceConverter
-	 */
-	public final static String HYPERLINK_COLOR = "hyperlinkColor"; //$NON-NLS-1$
-
-
-	/** The text viewer. */
-	private ITextViewer fTextViewer;
-	/** The hand cursor. */
-	private Cursor fCursor;
-	/** The link color. */
-	private Color fColor;
-	/** Tells whether to dispose the color on uninstall. */
-	private boolean fDisposeColor;
-	/** The currently active region. */
-	private IRegion fActiveRegion;
-	/** The currently active style range as position. */
-	private Position fRememberedPosition;
-	/** The optional preference store */
-	private IPreferenceStore fPreferenceStore;
-
-
-	/**
-	 * Creates a new default hyperlink presenter which uses
-	 * {@link #HYPERLINK_COLOR}to read the color from the given preference
-	 * store.
-	 * 
-	 * @param store
-	 *            the preference store
-	 */
-	public HighlighterHyperlinkPresenter(IPreferenceStore store) {
-		fPreferenceStore = store;
-		fDisposeColor = true;
-	}
-
-	/**
-	 * Creates a new default hyperlink presenter.
-	 * 
-	 * @param color
-	 *            the hyperlink color, to be disposed by the caller
-	 */
-	public HighlighterHyperlinkPresenter(Color color) {
-		fDisposeColor = false;
-		fColor = color;
-	}
-
-	public boolean canShowMultipleHyperlinks() {
-		return false;
-	}
-
-	public void showHyperlinks(IHyperlink[] hyperlinks) {
-		Assert.isLegal(hyperlinks != null && hyperlinks.length == 1);
-		highlightRegion(hyperlinks[0].getHyperlinkRegion());
-		activateCursor();
-	}
-
-	public void hideHyperlinks() {
-		repairRepresentation();
-		fRememberedPosition = null;
-	}
-
-	public void install(ITextViewer textViewer) {
-		Assert.isNotNull(textViewer);
-		fTextViewer = textViewer;
-		fTextViewer.addTextInputListener(this);
-
-		StyledText text = fTextViewer.getTextWidget();
-		if (text != null && !text.isDisposed()) {
-			text.addPaintListener(this);
-			if (fPreferenceStore != null)
-				fColor = createColor(fPreferenceStore, HYPERLINK_COLOR, text.getDisplay());
-		}
-
-		if (fPreferenceStore != null)
-			fPreferenceStore.addPropertyChangeListener(this);
-	}
-
-	public void uninstall() {
-		fTextViewer.removeTextInputListener(this);
-
-		if (fColor != null) {
-			if (fDisposeColor)
-				fColor.dispose();
-			fColor = null;
-		}
-
-		if (fCursor != null) {
-			fCursor.dispose();
-			fCursor = null;
-		}
-
-		StyledText text = fTextViewer.getTextWidget();
-		if (text != null && !text.isDisposed())
-			text.removePaintListener(this);
-
-		fTextViewer = null;
-
-		if (fPreferenceStore != null)
-			fPreferenceStore.removePropertyChangeListener(this);
-	}
-
-	public void setColor(Color color) {
-		Assert.isNotNull(fTextViewer);
-		fColor = color;
-	}
-
-	private void highlightRegion(IRegion region) {
-
-		if (region.equals(fActiveRegion))
-			return;
-
-		repairRepresentation();
-
-		StyledText text = fTextViewer.getTextWidget();
-		if (text == null || text.isDisposed())
-			return;
-
-
-		// Underline
-		int offset = 0;
-		int length = 0;
-		if (fTextViewer instanceof ITextViewerExtension5) {
-			ITextViewerExtension5 extension = (ITextViewerExtension5) fTextViewer;
-			IRegion widgetRange = extension.modelRange2WidgetRange(region);
-			if (widgetRange == null)
-				return;
-
-			offset = widgetRange.getOffset();
-			length = widgetRange.getLength();
-
-		}
-		else {
-			offset = region.getOffset() - fTextViewer.getVisibleRegion().getOffset();
-			length = region.getLength();
-		}
-
-		// needs to clean background due to StructuredTextEditor's highlighter
-		text.redrawRange(offset, length, true);
-
-		// Invalidate region ==> apply text presentation
-		fActiveRegion = region;
-
-		if (fTextViewer instanceof ITextViewerExtension2)
-			((ITextViewerExtension2) fTextViewer).invalidateTextPresentation(region.getOffset(), region.getLength());
-		else
-			fTextViewer.invalidateTextPresentation();
-	}
-
-	private void activateCursor() {
-		StyledText text = fTextViewer.getTextWidget();
-		if (text == null || text.isDisposed())
-			return;
-		Display display = text.getDisplay();
-		if (fCursor == null)
-			fCursor = new Cursor(display, SWT.CURSOR_HAND);
-		text.setCursor(fCursor);
-	}
-
-	private void resetCursor() {
-		StyledText text = fTextViewer.getTextWidget();
-		if (text != null && !text.isDisposed())
-			text.setCursor(null);
-
-		if (fCursor != null) {
-			fCursor.dispose();
-			fCursor = null;
-		}
-	}
-
-	private void repairRepresentation() {
-
-		if (fActiveRegion == null)
-			return;
-
-		int offset = fActiveRegion.getOffset();
-		int length = fActiveRegion.getLength();
-		fActiveRegion = null;
-
-		resetCursor();
-
-		// Invalidate ==> remove applied text presentation
-		if (fTextViewer instanceof ITextViewerExtension2)
-			((ITextViewerExtension2) fTextViewer).invalidateTextPresentation(offset, length);
-		else
-			fTextViewer.invalidateTextPresentation();
-
-		// Remove underline
-		if (fTextViewer instanceof ITextViewerExtension5) {
-			ITextViewerExtension5 extension = (ITextViewerExtension5) fTextViewer;
-			offset = extension.modelOffset2WidgetOffset(offset);
-		}
-		else {
-			offset -= fTextViewer.getVisibleRegion().getOffset();
-		}
-		try {
-			StyledText text = fTextViewer.getTextWidget();
-
-			// needs to clean background due to StructuredTextEditor's
-			// highlighter
-			text.redrawRange(offset, length, true);
-
-		}
-		catch (IllegalArgumentException x) {
-			// ignore - do not log
-		}
-	}
-
-	/*
-	 * @see PaintListener#paintControl(PaintEvent)
-	 */
-	public void paintControl(PaintEvent event) {
-		if (fActiveRegion == null)
-			return;
-
-		StyledText text = fTextViewer.getTextWidget();
-		if (text == null || text.isDisposed())
-			return;
-
-		int offset = 0;
-		int length = 0;
-
-		if (fTextViewer instanceof ITextViewerExtension5) {
-
-			ITextViewerExtension5 extension = (ITextViewerExtension5) fTextViewer;
-			IRegion widgetRange = extension.modelRange2WidgetRange(fActiveRegion);
-			if (widgetRange == null)
-				return;
-
-			offset = widgetRange.getOffset();
-			length = widgetRange.getLength();
-
-		}
-		else {
-
-			IRegion region = fTextViewer.getVisibleRegion();
-			if (!includes(region, fActiveRegion))
-				return;
-
-			offset = fActiveRegion.getOffset() - region.getOffset();
-			length = fActiveRegion.getLength();
-		}
-
-		// support for BIDI
-		Point minLocation = getMinimumLocation(text, offset, length);
-		Point maxLocation = getMaximumLocation(text, offset, length);
-
-		int x1 = minLocation.x;
-		int x2 = maxLocation.x - 1;
-		int y = minLocation.y + text.getLineHeight() - 1;
-
-		GC gc = event.gc;
-		if (fColor != null && !fColor.isDisposed())
-			gc.setForeground(fColor);
-		else if (fColor == null && !(offset < 0 && offset >= text.getCharCount())) {
-			StyleRange style = text.getStyleRangeAtOffset(offset);
-			if (style != null)
-				gc.setForeground(style.foreground);
-		}
-		gc.drawLine(x1, y, x2, y);
-	}
-
-	private Point getMinimumLocation(StyledText text, int offset, int length) {
-		int max = text.getCharCount();
-		Rectangle bounds = text.getBounds();
-		Point minLocation = new Point(bounds.width, bounds.height);
-		for (int i = 0; i <= length; i++) {
-			int k = offset + i;
-			if (k < 0 || k > max)
-				break;
-
-			Point location = text.getLocationAtOffset(k);
-			if (location.x < minLocation.x)
-				minLocation.x = location.x;
-			if (location.y < minLocation.y)
-				minLocation.y = location.y;
-		}
-
-		return minLocation;
-	}
-
-	private Point getMaximumLocation(StyledText text, int offset, int length) {
-		Point maxLocation = new Point(0, 0);
-
-		for (int i = 0; i <= length; i++) {
-			int k = offset + i;
-			if (k < 0 || k > text.getCharCount())
-				break;
-
-			Point location = text.getLocationAtOffset(k);
-			if (location.x > maxLocation.x)
-				maxLocation.x = location.x;
-			if (location.y > maxLocation.y)
-				maxLocation.y = location.y;
-		}
-
-		return maxLocation;
-	}
-
-	private boolean includes(IRegion region, IRegion position) {
-		return position.getOffset() >= region.getOffset() && position.getOffset() + position.getLength() <= region.getOffset() + region.getLength();
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
-	 */
-	public void documentAboutToBeChanged(DocumentEvent event) {
-		if (fActiveRegion != null) {
-			fRememberedPosition = new Position(fActiveRegion.getOffset(), fActiveRegion.getLength());
-			try {
-				event.getDocument().addPosition(fRememberedPosition);
-			}
-			catch (BadLocationException x) {
-				fRememberedPosition = null;
-			}
-		}
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
-	 */
-	public void documentChanged(DocumentEvent event) {
-		if (fRememberedPosition != null) {
-			if (!fRememberedPosition.isDeleted()) {
-
-				event.getDocument().removePosition(fRememberedPosition);
-				fActiveRegion = new Region(fRememberedPosition.getOffset(), fRememberedPosition.getLength());
-				fRememberedPosition = null;
-
-				StyledText widget = fTextViewer.getTextWidget();
-				if (widget != null && !widget.isDisposed()) {
-					widget.getDisplay().asyncExec(new Runnable() {
-						public void run() {
-							hideHyperlinks();
-						}
-					});
-				}
-
-			}
-			else {
-				fActiveRegion = null;
-				fRememberedPosition = null;
-				hideHyperlinks();
-			}
-		}
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.ITextInputListener#inputDocumentAboutToBeChanged(org.eclipse.jface.text.IDocument,
-	 *      org.eclipse.jface.text.IDocument)
-	 */
-	public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
-		if (oldInput == null)
-			return;
-		hideHyperlinks();
-		oldInput.removeDocumentListener(this);
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.ITextInputListener#inputDocumentChanged(org.eclipse.jface.text.IDocument,
-	 *      org.eclipse.jface.text.IDocument)
-	 */
-	public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
-		if (newInput == null)
-			return;
-		newInput.addDocumentListener(this);
-	}
-
-	/**
-	 * Creates a color from the information stored in the given preference
-	 * store.
-	 * 
-	 * @param store
-	 *            the preference store
-	 * @param key
-	 *            the key
-	 * @param display
-	 *            the display
-	 * @return the color or <code>null</code> if there is no such
-	 *         information available
-	 */
-	private Color createColor(IPreferenceStore store, String key, Display display) {
-
-		RGB rgb = null;
-
-		if (store.contains(key)) {
-
-			if (store.isDefault(key))
-				rgb = PreferenceConverter.getDefaultColor(store, key);
-			else
-				rgb = PreferenceConverter.getColor(store, key);
-
-			if (rgb != null)
-				return new Color(display, rgb);
-		}
-
-		return null;
-	}
-
-	/*
-	 * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
-	 */
-	public void propertyChange(PropertyChangeEvent event) {
-		if (!HYPERLINK_COLOR.equals(event.getProperty()))
-			return;
-
-		if (fDisposeColor && fColor != null && !fColor.isDisposed())
-			fColor.dispose();
-		fColor = null;
-
-		StyledText textWidget = fTextViewer.getTextWidget();
-		if (textWidget != null && !textWidget.isDisposed())
-			fColor = createColor(fPreferenceStore, HYPERLINK_COLOR, textWidget.getDisplay());
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/OpenHyperlinkAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/OpenHyperlinkAction.java
deleted file mode 100644
index 9994523..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/OpenHyperlinkAction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.hyperlink;
-
-import java.util.ResourceBundle;
-
-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.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextEditorAction;
-
-/**
- * Open hyperlink action
- */
-public class OpenHyperlinkAction extends TextEditorAction {
-	private IHyperlinkDetector[] fHyperlinkDetectors;
-	private ITextViewer fTextViewer;
-
-	public OpenHyperlinkAction(ResourceBundle bundle, String prefix, ITextEditor editor, ITextViewer viewer) {
-		super(bundle, prefix, editor);
-		fTextViewer = viewer;
-	}
-
-	public void setHyperlinkDetectors(IHyperlinkDetector[] detectors) {
-		fHyperlinkDetectors = detectors;
-	}
-
-	public void run() {
-		if (fHyperlinkDetectors == null)
-			return;
-		ISelection selection = getTextEditor().getSelectionProvider().getSelection();
-		if (selection == null || !(selection instanceof ITextSelection)) {
-			return;
-		}
-
-		ITextSelection textSelection = (ITextSelection) selection;
-		IRegion region = new Region(textSelection.getOffset(), textSelection.getLength());
-		IHyperlink hyperlink = null;
-
-		synchronized (fHyperlinkDetectors) {
-			for (int i = 0, length = fHyperlinkDetectors.length; i < length && hyperlink == null; i++) {
-				IHyperlinkDetector detector = fHyperlinkDetectors[i];
-				if (detector == null)
-					continue;
-
-				IHyperlink[] hyperlinks = detector.detectHyperlinks(fTextViewer, region, false);
-				if (hyperlinks == null)
-					continue;
-
-				if (hyperlinks.length > 0)
-					hyperlink = hyperlinks[0];
-			}
-		}
-		if (hyperlink != null) {
-			/**
-			 * Force the highlight range to change when the hyperlink is
-			 * opened by altering the highlighted range beforehand.
-			 */
-			getTextEditor().setHighlightRange(Math.max(0, region.getOffset() - 1), 0, false);
-			hyperlink.open();
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/AbstractOpenOn.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/AbstractOpenOn.java
deleted file mode 100644
index c8facd3..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/AbstractOpenOn.java
+++ /dev/null
@@ -1,267 +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.sse.ui.internal.openon;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.swt.program.Program;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-
-
-/**
- * This action class retrieves the link/file selected by the cursor and
- * attempts to open the link/file in the default editor or web browser
- * 
- * @deprecated Use base support for hyperlink navigation
- */
-abstract public class AbstractOpenOn implements IOpenOn {
-	protected final String CANNOT_OPEN = SSEUIMessages.AbstractOpenOn_0; //$NON-NLS-1$
-	// document currently associated with open
-	private IDocument fDocument;
-	protected final String FILE_PROTOCOL = "file:/";//$NON-NLS-1$
-	private final String HTTP_PROTOCOL = "http://";//$NON-NLS-1$
-
-	abstract protected IRegion doGetOpenOnRegion(int offset);
-
-	abstract protected void doOpenOn(IRegion region);
-
-	/**
-	 * Returns the current document associated with open on
-	 * 
-	 * @return IDocument
-	 */
-	public IDocument getDocument() {
-		return fDocument;
-	}
-
-	/**
-	 * Determines the editor associated with the given file name
-	 * 
-	 * @param filename
-	 * @return editor id of the editor associated with the given file name
-	 */
-	private String getEditorId(String filename) {
-		IWorkbench workbench = PlatformUI.getWorkbench();
-		IEditorRegistry editorRegistry = workbench.getEditorRegistry();
-		IEditorDescriptor descriptor = editorRegistry.getDefaultEditor(filename);
-		if (descriptor != null)
-			return descriptor.getId();
-		return EditorsUI.DEFAULT_TEXT_EDITOR_ID;
-	}
-
-	/**
-	 * 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
-	 */
-	protected IFile getFile(String fileString) {
-		IStructuredModel model = null;
-		IFile file = null;
-		try {
-			model = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
-			if (model != null) {
-				// use the base location to obtain the in-workspace IFile
-				IFile modelFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
-				if (modelFile != null) {
-					// find the referenced file's location on disk
-					String filesystemLocation = model.getResolver().getLocationByURI(fileString);
-					if (filesystemLocation != null) {
-						IFile[] workspaceFiles = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(filesystemLocation));
-						// favor a workspace file in the same project
-						for (int i = 0; i < workspaceFiles.length && file == null; i++) {
-							if (workspaceFiles[i].getProject().equals(modelFile.getProject())) {
-								file = workspaceFiles[i];
-							}
-						}
-						// if none were in the same project, just pick one
-						if (file == null && workspaceFiles.length > 0) {
-							file = workspaceFiles[0];
-						}
-					}
-				}
-			}
-		}
-		catch (Exception e) {
-			Logger.log(Logger.WARNING, e.getMessage());
-		}
-		finally {
-			if (model != null) {
-				model.releaseFromRead();
-			}
-		}
-		if (file == null && fileString.startsWith("/")) { //$NON-NLS-1$
-			file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fileString));
-		}
-		return file;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.IOpenOn#getOpenOnRegion(org.eclipse.jface.text.IDocument,
-	 *      int)
-	 */
-	public IRegion getOpenOnRegion(IDocument doc, int offset) {
-		IRegion region;
-		// set the document for this action
-		setDocument(doc);
-		region = doGetOpenOnRegion(offset);
-		// reset the document back to null for this action
-		setDocument(null);
-		return region;
-	}
-
-	/**
-	 * Try to open the external file, fileString in its default editor
-	 * 
-	 * @param fileString
-	 * @return IEditorPart editor opened or null if editor could not be opened
-	 */
-	protected IEditorPart openExternalFile(String fileString) {
-		// file does not exist in workspace so try to open using system editor
-		File file = new File(fileString);
-		// try to open existing external file if it exists
-		if (file.exists()) {
-			IEditorInput input = new ExternalFileEditorInput(file);
-			String editorId = getEditorId(fileString);
-
-			try {
-				IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-				return page.openEditor(input, editorId, true);
-			}
-			catch (PartInitException pie) {
-				Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Notifies user that open on selection action could not successfully open
-	 * the selection (writes message on status bar and beeps)
-	 */
-	protected void openFileFailed() {
-		PlatformStatusLineUtil.displayErrorMessage(CANNOT_OPEN);
-		PlatformStatusLineUtil.addOneTimeClearListener();
-	}
-
-	/**
-	 * Opens the IFile, input in its default editor, if possible, and returns
-	 * the editor opened. Possible reasons for failure: input cannot be found,
-	 * input does not exist in workbench, editor cannot be opened.
-	 * 
-	 * @return IEditorPart editor opened or null if input == null or does not
-	 *         exist, external editor was opened, editor could not be opened
-	 */
-	protected IEditorPart openFileInEditor(IFile input) {
-		if (input != null && input.exists()) {
-			try {
-				IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-				return IDE.openEditor(page, input, true);
-			}
-			catch (PartInitException pie) {
-				Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
-			}
-		}
-		return null;
-	}
-
-	// on
-
-	/**
-	 * Opens the appropriate editor for fileString
-	 * 
-	 * @param fileString
-	 */
-	protected void openFileInEditor(String fileString) {
-		IEditorPart editor = null;
-		if (fileString != null) {
-			// open web browser if this is a web address
-			String temp = fileString.toLowerCase();
-			if (temp.startsWith(HTTP_PROTOCOL)) {
-				Program.launch(fileString); // launches web browser/executable
-				// associated with uri
-				return;
-			}
-			// chop off the file protocol
-			if (temp.startsWith(FILE_PROTOCOL)) {
-				fileString = fileString.substring(FILE_PROTOCOL.length());
-			}
-
-			// try to locate the file in the workspace and return an IFile if
-			// found
-			IFile file = getFile(fileString);
-			if (file != null) {
-				// file exists in workspace
-				editor = openFileInEditor(file);
-			}
-			else {
-				// file does not exist in workspace
-				editor = openExternalFile(fileString);
-			}
-		}
-		// no editor was opened
-		if (editor == null) {
-			openFileFailed();
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.IOpenOn#openOn(org.eclipse.jface.text.IDocument,
-	 *      org.eclipse.jface.text.IRegion)
-	 */
-	public void openOn(IDocument doc, IRegion region) {
-		// set the document for this action
-		setDocument(doc);
-		// if no region was given this action fails
-		if (region == null)
-			openFileFailed();
-		else
-			doOpenOn(region);
-		// reset the document back to null for this action
-		setDocument(null);
-	}
-
-	/**
-	 * Sets current document associated with open on
-	 * 
-	 * @param document
-	 */
-	public void setDocument(IDocument document) {
-		fDocument = document;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/ExternalFileEditorInput.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/ExternalFileEditorInput.java
deleted file mode 100644
index 58eb658..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/ExternalFileEditorInput.java
+++ /dev/null
@@ -1,116 +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.sse.ui.internal.openon;
-
-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.IPersistableElement;
-import org.eclipse.ui.editors.text.ILocationProvider;
-
-/**
- * EditorInput for external files. Copied from
- * org.eclipse.ui.internal.editors.text.JavaFileEditorInput
- * 
- * @deprecated Use base support for hyperlink navigation
- */
-public class ExternalFileEditorInput implements IEditorInput, ILocationProvider {
-
-	private File fFile;
-
-	public ExternalFileEditorInput(File file) {
-		super();
-		fFile = file;
-	}
-
-	/*
-	 * @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);
-		}
-
-		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;
-		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.editors.text.ILocationProvider#getPath(java.lang.Object)
-	 */
-	public IPath getPath(Object element) {
-		if (element instanceof ExternalFileEditorInput) {
-			ExternalFileEditorInput input = (ExternalFileEditorInput) element;
-			return new Path(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.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/IOpenOn.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/IOpenOn.java
deleted file mode 100644
index ec4b292..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/IOpenOn.java
+++ /dev/null
@@ -1,46 +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.sse.ui.internal.openon;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-
-/**
- * Interface for Open On... navigation
- * 
- * @author amywu
- */
-public interface IOpenOn {
-	/**
-	 * Returns the entire region relevant to the current offset where an
-	 * openable source region is found. null if offset does not contain an
-	 * openable source.
-	 * 
-	 * @param document
-	 *            IDocument
-	 * @param offset
-	 *            int
-	 * @return IRegion entire region of openable source
-	 */
-	public IRegion getOpenOnRegion(IDocument document, int offset);
-
-	/**
-	 * Opens the file/source relevant to region if possible.
-	 * 
-	 * @param viewer
-	 *            ITextViewer
-	 * @param region
-	 *            Region to examine
-	 */
-	public void openOn(IDocument document, IRegion region);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenFileHyperlinkTracker.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenFileHyperlinkTracker.java
deleted file mode 100644
index cc4cdff..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenFileHyperlinkTracker.java
+++ /dev/null
@@ -1,660 +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.sse.ui.internal.openon;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITextViewerExtension5;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-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.MouseMoveListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-
-/**
- * @deprecated Use org.eclipse.jface.text.hyperlink.HyperlinkManager
- */
-public class OpenFileHyperlinkTracker implements KeyListener, MouseListener, MouseMoveListener, FocusListener, PaintListener, IPropertyChangeListener, IDocumentListener, ITextInputListener {
-
-	/** The session is active. */
-	private boolean fActive;
-
-	/** The currently active style range. */
-	private IRegion fActiveRegion;
-	/** Preference key for browser-like links to be enabled */
-	private String fBrowserLikeLinksKeyModifierKey;
-
-	/** The link color. */
-	private Color fColor;
-	/** The hand cursor. */
-	private Cursor fCursor;
-	/** The key modifier mask. */
-	private int fKeyModifierMask;
-	/** Preference key for hyperlink underline color */
-	private String fLinkColorKey;
-	/** The preference store */
-	private IPreferenceStore fPreferenceStore;
-	/** The currently active style range as position. */
-	private Position fRememberedPosition;
-
-	/** The text viewer this hyperlink tracker is associated with */
-	private ITextViewer fTextViewer;
-
-	/**
-	 *  
-	 */
-	public OpenFileHyperlinkTracker(ITextViewer textViewer) {
-		fTextViewer = textViewer;
-	}
-
-	private void activateCursor(ITextViewer viewer) {
-		StyledText text = viewer.getTextWidget();
-		if (text == null || text.isDisposed())
-			return;
-		Display display = text.getDisplay();
-		if (fCursor == null)
-			fCursor = new Cursor(display, SWT.CURSOR_HAND);
-		text.setCursor(fCursor);
-	}
-
-	private int computeStateMask(String modifiers) {
-		if (modifiers == null)
-			return -1;
-
-		if (modifiers.length() == 0)
-			return SWT.NONE;
-
-		int stateMask = 0;
-		StringTokenizer modifierTokenizer = new StringTokenizer(modifiers, ",;.:+-* "); //$NON-NLS-1$
-		while (modifierTokenizer.hasMoreTokens()) {
-			int modifier = EditorUtility.findLocalizedModifier(modifierTokenizer.nextToken());
-			if (modifier == 0 || (stateMask & modifier) == modifier)
-				return -1;
-			stateMask = stateMask | modifier;
-		}
-		return stateMask;
-	}
-
-	/**
-	 * Creates a color from the information stored in the given preference
-	 * store. Returns <code>null</code> if there is no such information
-	 * available.
-	 */
-	private Color createColor(IPreferenceStore store, String key, Display display) {
-
-		RGB rgb = null;
-
-		if (store.contains(key)) {
-
-			if (store.isDefault(key))
-				rgb = PreferenceConverter.getDefaultColor(store, key);
-			else
-				rgb = PreferenceConverter.getColor(store, key);
-		}
-
-		return EditorUtility.getColor(rgb);
-	}
-
-	public void deactivate() {
-		deactivate(false);
-	}
-
-	public void deactivate(boolean redrawAll) {
-		if (!fActive)
-			return;
-
-		repairRepresentation(redrawAll);
-		fActive = false;
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
-	 */
-	public void documentAboutToBeChanged(DocumentEvent event) {
-		if (fActive && fActiveRegion != null) {
-			fRememberedPosition = new Position(fActiveRegion.getOffset(), fActiveRegion.getLength());
-			try {
-				event.getDocument().addPosition(fRememberedPosition);
-			} catch (BadLocationException x) {
-				fRememberedPosition = null;
-			}
-		}
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
-	 */
-	public void documentChanged(DocumentEvent event) {
-		if (fRememberedPosition != null) {
-			if (!fRememberedPosition.isDeleted()) {
-
-				event.getDocument().removePosition(fRememberedPosition);
-				fActiveRegion = new Region(fRememberedPosition.getOffset(), fRememberedPosition.getLength());
-				fRememberedPosition = null;
-
-				ITextViewer viewer = getTextViewer();
-				if (viewer != null) {
-					StyledText widget = viewer.getTextWidget();
-					if (widget != null && !widget.isDisposed()) {
-						widget.getDisplay().asyncExec(new Runnable() {
-							public void run() {
-								deactivate();
-							}
-						});
-					}
-				}
-
-			} else {
-				fActiveRegion = null;
-				fRememberedPosition = null;
-				deactivate();
-			}
-		}
-	}
-
-	/*
-	 * @see org.eclipse.swt.events.FocusListener#focusGained(org.eclipse.swt.events.FocusEvent)
-	 */
-	public void focusGained(FocusEvent e) {
-	}
-
-	/*
-	 * @see org.eclipse.swt.events.FocusListener#focusLost(org.eclipse.swt.events.FocusEvent)
-	 */
-	public void focusLost(FocusEvent event) {
-		deactivate();
-	}
-
-	private int getCurrentTextOffset() {
-		try {
-			StyledText text = getTextViewer().getTextWidget();
-			if (text == null || text.isDisposed())
-				return -1;
-
-			Display display = text.getDisplay();
-			Point absolutePosition = display.getCursorLocation();
-			Point relativePosition = text.toControl(absolutePosition);
-
-			int widgetOffset = text.getOffsetAtLocation(relativePosition);
-			if (getTextViewer() instanceof ITextViewerExtension5) {
-				ITextViewerExtension5 extension = (ITextViewerExtension5) getTextViewer();
-				return extension.widgetOffset2ModelOffset(widgetOffset);
-			} else {
-				return widgetOffset + getTextViewer().getVisibleRegion().getOffset();
-			}
-
-		} catch (IllegalArgumentException e) {
-			return -1;
-		}
-	}
-
-	private Point getMaximumLocation(StyledText text, int offset, int length) {
-		Point maxLocation = new Point(Integer.MIN_VALUE, Integer.MIN_VALUE);
-
-		for (int i = 0; i <= length; i++) {
-			Point location = text.getLocationAtOffset(offset + i);
-
-			if (location.x > maxLocation.x)
-				maxLocation.x = location.x;
-			if (location.y > maxLocation.y)
-				maxLocation.y = location.y;
-		}
-
-		return maxLocation;
-	}
-
-	private Point getMinimumLocation(StyledText text, int offset, int length) {
-		Point minLocation = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE);
-
-		for (int i = 0; i <= length; i++) {
-			Point location = text.getLocationAtOffset(offset + i);
-
-			if (location.x < minLocation.x)
-				minLocation.x = location.x;
-			if (location.y < minLocation.y)
-				minLocation.y = location.y;
-		}
-
-		return minLocation;
-	}
-
-	private IPreferenceStore getNewPreferenceStore() {
-		return fPreferenceStore;
-	}
-
-	private ITextViewer getTextViewer() {
-		return fTextViewer;
-	}
-
-	private void highlightRegion(ITextViewer viewer, IRegion region) {
-
-		if (region.equals(fActiveRegion))
-			return;
-
-		repairRepresentation();
-
-		StyledText text = viewer.getTextWidget();
-		if (text == null || text.isDisposed())
-			return;
-
-
-		// Underline
-		int offset = 0;
-		int length = 0;
-		if (viewer instanceof ITextViewerExtension5) {
-			ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
-			IRegion widgetRange = extension.modelRange2WidgetRange(new Region(region.getOffset(), region.getLength()));
-			if (widgetRange == null)
-				return;
-
-			offset = widgetRange.getOffset();
-			length = widgetRange.getLength();
-
-		} else {
-			offset = region.getOffset() - viewer.getVisibleRegion().getOffset();
-			length = region.getLength();
-		}
-		// need clearBackground to be true for paint event to be fired
-		text.redrawRange(offset, length, true);
-
-		fActiveRegion = region;
-	}
-
-	private boolean includes(IRegion region, IRegion position) {
-		return position.getOffset() >= region.getOffset() && position.getOffset() + position.getLength() <= region.getOffset() + region.getLength();
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.ITextInputListener#inputDocumentAboutToBeChanged(org.eclipse.jface.text.IDocument,
-	 *      org.eclipse.jface.text.IDocument)
-	 */
-	public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
-		if (oldInput == null)
-			return;
-		deactivate();
-		oldInput.removeDocumentListener(this);
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.ITextInputListener#inputDocumentChanged(org.eclipse.jface.text.IDocument,
-	 *      org.eclipse.jface.text.IDocument)
-	 */
-	public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
-		if (newInput == null)
-			return;
-		newInput.addDocumentListener(this);
-	}
-
-	public void install(IPreferenceStore store) {
-		fPreferenceStore = store;
-		ITextViewer textViewer = getTextViewer();
-		if (textViewer == null)
-			return;
-
-		StyledText text = textViewer.getTextWidget();
-		if (text == null || text.isDisposed())
-			return;
-
-		updateColor(textViewer);
-
-		textViewer.addTextInputListener(this);
-
-		IDocument document = textViewer.getDocument();
-		if (document != null)
-			document.addDocumentListener(this);
-
-		text.addKeyListener(this);
-		text.addMouseListener(this);
-		text.addMouseMoveListener(this);
-		text.addFocusListener(this);
-		text.addPaintListener(this);
-
-		updateKeyModifierMask();
-
-		fPreferenceStore.addPropertyChangeListener(this);
-	}
-
-	/*
-	 * @see org.eclipse.swt.events.KeyListener#keyPressed(org.eclipse.swt.events.KeyEvent)
-	 */
-	public void keyPressed(KeyEvent event) {
-
-		if (fActive) {
-			deactivate();
-			return;
-		}
-
-		if (event.keyCode != fKeyModifierMask) {
-			deactivate();
-			return;
-		}
-
-		fActive = true;
-
-		//			removed for #25871
-		//
-		//			ISourceViewer viewer= getSourceViewer();
-		//			if (viewer == null)
-		//				return;
-		//			
-		//			IRegion region= getCurrentTextRegion(viewer);
-		//			if (region == null)
-		//				return;
-		//			
-		//			highlightRegion(viewer, region);
-		//			activateCursor(viewer);
-	}
-
-	/*
-	 * @see org.eclipse.swt.events.KeyListener#keyReleased(org.eclipse.swt.events.KeyEvent)
-	 */
-	public void keyReleased(KeyEvent event) {
-
-		if (!fActive)
-			return;
-
-		deactivate();
-	}
-
-	/*
-	 * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(org.eclipse.swt.events.MouseEvent)
-	 */
-	public void mouseDoubleClick(MouseEvent e) {
-	}
-
-	/*
-	 * @see org.eclipse.swt.events.MouseListener#mouseDown(org.eclipse.swt.events.MouseEvent)
-	 */
-	public void mouseDown(MouseEvent event) {
-
-		if (!fActive)
-			return;
-
-		if (event.stateMask != fKeyModifierMask) {
-			deactivate();
-			return;
-		}
-
-		if (event.button != 1) {
-			deactivate();
-			return;
-		}
-	}
-
-	/*
-	 * @see org.eclipse.swt.events.MouseMoveListener#mouseMove(org.eclipse.swt.events.MouseEvent)
-	 */
-	public void mouseMove(MouseEvent event) {
-
-		if (event.widget instanceof Control && !((Control) event.widget).isFocusControl()) {
-			deactivate();
-			return;
-		}
-
-		if (!fActive) {
-			if (event.stateMask != fKeyModifierMask)
-				return;
-			// modifier was already pressed
-			fActive = true;
-		}
-
-		ITextViewer viewer = getTextViewer();
-		if (viewer == null) {
-			deactivate();
-			return;
-		}
-
-		StyledText text = viewer.getTextWidget();
-		if (text == null || text.isDisposed()) {
-			deactivate();
-			return;
-		}
-
-		if ((event.stateMask & SWT.BUTTON1) != 0 && text.getSelectionCount() != 0) {
-			deactivate();
-			return;
-		}
-
-		IRegion region = null;
-		int offset = getCurrentTextOffset();
-		IOpenOn openOn = OpenOnProvider.getInstance().getOpenOn(getTextViewer().getDocument(), offset);
-		if (openOn != null) {
-			region = openOn.getOpenOnRegion(getTextViewer().getDocument(), offset);
-		}
-		if (region == null || region.getLength() == 0) {
-			repairRepresentation();
-			return;
-		}
-
-		highlightRegion(viewer, region);
-		activateCursor(viewer);
-	}
-
-	/*
-	 * @see org.eclipse.swt.events.MouseListener#mouseUp(org.eclipse.swt.events.MouseEvent)
-	 */
-	public void mouseUp(MouseEvent e) {
-
-		if (!fActive)
-			return;
-
-		if (e.button != 1) {
-			deactivate();
-			return;
-		}
-
-		boolean wasActive = fCursor != null;
-		IRegion previousRegion = fActiveRegion;
-
-		deactivate();
-
-		if (wasActive) {
-			IOpenOn openOn = OpenOnProvider.getInstance().getOpenOn(getTextViewer().getDocument(), previousRegion.getOffset());
-			if (openOn != null) {
-				openOn.openOn(getTextViewer().getDocument(), previousRegion);
-			}
-		}
-	}
-
-	/*
-	 * @see PaintListener#paintControl(PaintEvent)
-	 */
-	public void paintControl(PaintEvent event) {
-		if (fActiveRegion == null)
-			return;
-
-		ITextViewer viewer = getTextViewer();
-		if (viewer == null)
-			return;
-
-		StyledText text = viewer.getTextWidget();
-		if (text == null || text.isDisposed())
-			return;
-
-
-		int offset = 0;
-		int length = 0;
-
-		if (viewer instanceof ITextViewerExtension5) {
-
-			ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
-			IRegion widgetRange = extension.modelRange2WidgetRange(fActiveRegion);
-			if (widgetRange == null)
-				return;
-
-			offset = widgetRange.getOffset();
-			length = widgetRange.getLength();
-
-		} else {
-
-			IRegion region = viewer.getVisibleRegion();
-			if (!includes(region, fActiveRegion))
-				return;
-
-			offset = fActiveRegion.getOffset() - region.getOffset();
-			length = fActiveRegion.getLength();
-		}
-
-		// support for bidi
-		Point minLocation = getMinimumLocation(text, offset, length);
-		Point maxLocation = getMaximumLocation(text, offset, length);
-
-		int x1 = minLocation.x;
-		int x2 = minLocation.x + maxLocation.x - minLocation.x - 1;
-		int y = minLocation.y + text.getLineHeight() - 1;
-
-		GC gc = event.gc;
-		if (fColor != null && !fColor.isDisposed())
-			gc.setForeground(fColor);
-		gc.drawLine(x1, y, x2, y);
-	}
-
-	/*
-	 * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
-	 */
-	public void propertyChange(PropertyChangeEvent event) {
-		if (event.getProperty().equals(fLinkColorKey)) {
-			ITextViewer viewer = getTextViewer();
-			if (viewer != null)
-				updateColor(viewer);
-		} else if (event.getProperty().equals(fBrowserLikeLinksKeyModifierKey)) {
-			updateKeyModifierMask();
-		}
-	}
-
-	private void repairRepresentation() {
-		repairRepresentation(false);
-	}
-
-	private void repairRepresentation(boolean redrawAll) {
-
-		if (fActiveRegion == null)
-			return;
-
-		int offset = fActiveRegion.getOffset();
-		int length = fActiveRegion.getLength();
-		fActiveRegion = null;
-
-		ITextViewer viewer = getTextViewer();
-		if (viewer != null) {
-
-			resetCursor(viewer);
-
-			// Remove underline
-			if (viewer instanceof ITextViewerExtension5) {
-				ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
-				offset = extension.modelOffset2WidgetOffset(offset);
-			} else {
-				offset -= viewer.getVisibleRegion().getOffset();
-			}
-			try {
-				StyledText text = viewer.getTextWidget();
-
-				// need clearBackground to be true for paint event to be fired
-				text.redrawRange(offset, length, true);
-			} catch (IllegalArgumentException x) {
-				Logger.logException(x);
-			}
-		}
-	}
-
-	private void resetCursor(ITextViewer viewer) {
-		StyledText text = viewer.getTextWidget();
-		if (text != null && !text.isDisposed())
-			text.setCursor(null);
-
-		if (fCursor != null) {
-			fCursor.dispose();
-			fCursor = null;
-		}
-	}
-
-	public void setHyperlinkPreferenceKeys(String linkColorKey, String browserLikeLinksKeyModifierKey) {
-		fLinkColorKey = linkColorKey;
-		fBrowserLikeLinksKeyModifierKey = browserLikeLinksKeyModifierKey;
-	}
-
-	public void uninstall() {
-		if (fCursor != null) {
-			fCursor.dispose();
-			fCursor = null;
-		}
-
-		ITextViewer textViewer = getTextViewer();
-		if (textViewer == null)
-			return;
-
-		textViewer.removeTextInputListener(this);
-
-		IDocument document = textViewer.getDocument();
-		if (document != null)
-			document.removeDocumentListener(this);
-
-		IPreferenceStore preferenceStore = getNewPreferenceStore();
-		if (preferenceStore != null)
-			preferenceStore.removePropertyChangeListener(this);
-
-		StyledText text = textViewer.getTextWidget();
-		if (text == null || text.isDisposed())
-			return;
-
-		text.removeKeyListener(this);
-		text.removeMouseListener(this);
-		text.removeMouseMoveListener(this);
-		text.removeFocusListener(this);
-		text.removePaintListener(this);
-	}
-
-	private void updateColor(ITextViewer viewer) {
-		StyledText text = viewer.getTextWidget();
-		if (text == null || text.isDisposed())
-			return;
-
-		Display display = text.getDisplay();
-		fColor = createColor(getNewPreferenceStore(), fLinkColorKey, display);
-	}
-
-	private void updateKeyModifierMask() {
-		String modifiers = getNewPreferenceStore().getString(fBrowserLikeLinksKeyModifierKey);
-		fKeyModifierMask = computeStateMask(modifiers);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnAction.java
deleted file mode 100644
index 4448787..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnAction.java
+++ /dev/null
@@ -1,74 +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.sse.ui.internal.openon;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextEditorAction;
-import org.eclipse.wst.sse.ui.internal.IExtendedSimpleEditor;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-
-
-/**
- * Determines the appropriate IOpenFileAction to call based on current
- * partition.
- * 
- * @deprecated Use base support for hyperlink navigation
- */
-public class OpenOnAction extends TextEditorAction {
-	public OpenOnAction(ResourceBundle bundle, String prefix, ITextEditor editor) {
-		super(bundle, prefix, editor);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.action.IAction#run()
-	 */
-	public void run() {
-		BusyIndicator.showWhile(getTextEditor().getEditorSite().getShell().getDisplay(), new Runnable() {
-			public void run() {
-				ITextEditor editor = getTextEditor();
-
-				// figure out current offset
-				int offset = -1;
-				ISourceEditingTextTools textTools = (ISourceEditingTextTools) getTextEditor().getAdapter(ISourceEditingTextTools.class);
-				if (textTools != null) {
-					offset = textTools.getCaretOffset();
-				}
-				else if (editor instanceof IExtendedSimpleEditor) {
-					offset = ((IExtendedSimpleEditor) editor).getCaretPosition();
-				}
-				else {
-					if (editor.getSelectionProvider() != null) {
-						ISelection sel = editor.getSelectionProvider().getSelection();
-						if (sel instanceof ITextSelection) {
-							offset = ((ITextSelection) sel).getOffset();
-						}
-					}
-				}
-				IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
-				IOpenOn openOn = OpenOnProvider.getInstance().getOpenOn(document, offset);
-				if (openOn != null) {
-					openOn.openOn(document, new Region(offset, 0));
-				}
-			}
-		});
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnBuilder.java
deleted file mode 100644
index b62de63..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnBuilder.java
+++ /dev/null
@@ -1,267 +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.sse.ui.internal.openon;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
-
-
-/**
- * Reads extensions for open on extension point,
- * org.eclipse.wst.sse.ui.extensions.openon
- * 
- * @deprecated Use base support for hyperlink navigation
- */
-public class OpenOnBuilder extends RegistryReader {
-	public static final String ATT_CLASS = "class"; //$NON-NLS-1$
-
-	public static final String ATT_ID = "id"; //$NON-NLS-1$
-
-	private static OpenOnBuilder fInstance;
-	// extension point ID
-	public static final String PL_OPENON = "openon"; //$NON-NLS-1$
-
-	public static final String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
-	public static final String TAG_CONTENT_TYPE_IDENTIFIER = "contenttypeidentifier"; //$NON-NLS-1$
-
-	public static final String TAG_OPENON = "openon"; //$NON-NLS-1$
-	public static final String TAG_PARTITION_TYPE = "partitiontype"; //$NON-NLS-1$
-
-	/**
-	 * returns singleton instance of OpenOnBuilder
-	 * 
-	 * @return OpenOnBuilder
-	 */
-	public synchronized static OpenOnBuilder getInstance() {
-		if (fInstance == null) {
-			fInstance = new OpenOnBuilder();
-		}
-		return fInstance;
-	}
-
-	private String fCurrentContentType;
-	private OpenOnDefinition fCurrentOpenOnDefinition = null;
-
-	private List fOpenOnDefs = null;
-
-	protected String targetContributionTag;
-
-	/**
-	 * Returns the name of the part ID attribute that is expected in the
-	 * target extension.
-	 * 
-	 * @param element
-	 * @return String
-	 */
-	protected String getId(IConfigurationElement element) {
-		String value = element.getAttribute(ATT_ID);
-		return value;
-	}
-
-	protected String getOpenOnClass(IConfigurationElement element) {
-		String value = element.getAttribute(ATT_CLASS);
-		return value;
-	}
-
-	/**
-	 * Returns all the open on definition objects
-	 * 
-	 * @return
-	 */
-	public OpenOnDefinition[] getOpenOnDefinitions() {
-		initCache();
-		return (OpenOnDefinition[]) fOpenOnDefs.toArray(new OpenOnDefinition[fOpenOnDefs.size()]);
-	}
-
-	/**
-	 * Returns all the open on definition objects valid for
-	 * contentType/partitionType
-	 * 
-	 * @param contentType
-	 * @param partitionType
-	 * @return if either contentType or partitionType is null, null is
-	 *         returned
-	 */
-	public OpenOnDefinition[] getOpenOnDefinitions(String contentType, String partitionType) {
-		if (contentType == null || partitionType == null) {
-			// should not be able to define an openon without a content type
-			// but if it were possible then would need to search all openon
-			// definitions for
-			// definitions with empty contentType list
-			return null;
-		}
-
-		// entire list of openon definition objects
-		OpenOnDefinition[] allDefs = getOpenOnDefinitions();
-		// current list of open on definitions valid for
-		// contentType/partitionType
-		List defs = new ArrayList();
-		// default definitions that should be added to end of list of open on
-		// definitions
-		List lastDefs = new ArrayList();
-
-		for (int i = 0; i < allDefs.length; ++i) {
-			// for each one check if it contains contentType
-			List partitions = (List) allDefs[i].getContentTypes().get(contentType);
-			if (partitions != null) {
-				// this openon definition is valid for all partition types for
-				// this content type
-				if (partitions.isEmpty()) {
-					// this will be added to end of list because this is
-					// considered a default openon
-					lastDefs.add(allDefs[i]);
-				} else {
-					// examine the partition types of this openon
-					int j = 0; // current index in list of partitions
-					boolean added = false; // openon has been added to list
-					while (j < partitions.size() && !added) {
-						// this openon definition applies to partitionType so
-						// add to list of valid openons
-						if (partitionType.equals(partitions.get(j))) {
-							defs.add(allDefs[i]);
-							added = true;
-						} else {
-							// continue checking to see if this openon
-							// definition is valid for current partitionType
-							++j;
-						}
-					}
-				}
-			}
-		}
-		// append the default openon definitions
-		defs.addAll(lastDefs);
-
-		// return the list
-		return (OpenOnDefinition[]) defs.toArray(new OpenOnDefinition[defs.size()]);
-	}
-
-	private void initCache() {
-		if (fOpenOnDefs == null) {
-			fOpenOnDefs = new ArrayList(0);
-			readContributions(TAG_OPENON, PL_OPENON);
-		}
-	}
-
-	/**
-	 * Processes element which should be a configuration element specifying a
-	 * content type for the current open on tag. Assumes that there is a valid
-	 * current open on definition object.
-	 * 
-	 * @param element
-	 *            contenttypeidentifier configuration element
-	 */
-	private void processContentTypeTag(IConfigurationElement element) {
-		// add to current openOnDefinition
-		String theId = getId(element);
-
-		if (theId != null) {
-			fCurrentContentType = theId;
-			fCurrentOpenOnDefinition.addContentTypeId(fCurrentContentType);
-		} else {
-			fCurrentContentType = null;
-		}
-	}
-
-	/**
-	 * Processes element which should be a configuration element specifying an
-	 * open on object. Creates a new open on definition object and adds it to
-	 * the list of open on definition objects
-	 * 
-	 * @param element
-	 *            openon configuration element
-	 */
-	private void processOpenOnTag(IConfigurationElement element) {
-		String theId = getId(element);
-		String theClass = getOpenOnClass(element);
-
-		if (theId != null && theClass != null) {
-			// start building new OpenOnDefinition
-			fCurrentOpenOnDefinition = new OpenOnDefinition(theId, theClass, element);
-			fOpenOnDefs.add(fCurrentOpenOnDefinition);
-		} else {
-			fCurrentOpenOnDefinition = null;
-		}
-	}
-
-	/**
-	 * Processes element which should be a configuration element specifying a
-	 * partition type for the current open on/content type tag. Assumes that
-	 * there is a valid current open on/content type tag.
-	 * 
-	 * @param element
-	 *            partitiontype configuration element
-	 */
-	private void processPartitionTypeTag(IConfigurationElement element) {
-		// add to current openOnDefinition/contentType
-		String theId = getId(element);
-
-		if (theId != null) {
-			fCurrentOpenOnDefinition.addPartitionType(fCurrentContentType, theId);
-		}
-	}
-
-	/**
-	 * Reads the contributions from the registry for the provided workbench
-	 * part and the provided extension point ID.
-	 * 
-	 * @param tag
-	 * @param extensionPoint
-	 */
-	protected void readContributions(String tag, String extensionPoint) {
-		targetContributionTag = tag;
-		IExtensionRegistry registry = Platform.getExtensionRegistry();
-		readRegistry(registry, PLUGIN_ID, extensionPoint);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.internal.extension.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
-	 */
-	protected boolean readElement(IConfigurationElement element) {
-		String tag = element.getName();
-
-		if (tag.equals(targetContributionTag)) {
-			processOpenOnTag(element);
-
-			// make sure processing of current open on tag resulted in a
-			// current open on definition
-			// before continue reading the children
-			if (fCurrentOpenOnDefinition != null) {
-				readElementChildren(element);
-			}
-			return true;
-		} else if (tag.equals(TAG_CONTENT_TYPE_IDENTIFIER)) {
-			processContentTypeTag(element);
-
-			// make sure processing of current content type resulted in a
-			// valid content type
-			// before reading the children
-			if (fCurrentContentType != null) {
-				readElementChildren(element);
-			}
-			return true;
-		} else if (tag.equals(TAG_PARTITION_TYPE)) {
-			processPartitionTypeTag(element);
-			return true;
-		}
-
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnDefinition.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnDefinition.java
deleted file mode 100644
index e69159e..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnDefinition.java
+++ /dev/null
@@ -1,157 +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.sse.ui.internal.openon;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-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.swt.custom.BusyIndicator;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Open on definition object
- * 
- * @deprecated Use base support for hyperlink navigation
- */
-public class OpenOnDefinition {
-	private String fClassName = null;
-
-	private IConfigurationElement fConfigurationElement = null;
-
-	// a hash map of content type Ids (String) that points to lists of
-	// parition types (List of Strings)
-	// contentTypeId -> List(paritionType, paritionType, partitionType, ...)
-	// contentTypeId2 -> List(partitionType, partitionType, ...)
-	// ...
-	private HashMap fContentTypes = null;
-	private String fId = null;
-
-	/**
-	 * @param id
-	 * @param class1
-	 * @param configurationElement
-	 */
-	public OpenOnDefinition(String id, String class1, IConfigurationElement configurationElement) {
-		super();
-		fId = id;
-		fClassName = class1;
-		fConfigurationElement = configurationElement;
-		fContentTypes = new HashMap();
-	}
-
-	public void addContentTypeId(String contentTypeId) {
-		if (!fContentTypes.containsKey(contentTypeId))
-			fContentTypes.put(contentTypeId, new ArrayList());
-	}
-
-	public void addPartitionType(String contentTypeId, String partitionType) {
-		if (!fContentTypes.containsKey(contentTypeId))
-			fContentTypes.put(contentTypeId, new ArrayList());
-
-		List partitionList = (List) fContentTypes.get(contentTypeId);
-		partitionList.add(partitionType);
-	}
-
-	/**
-	 * Creates an extension. If the extension plugin has not been loaded a
-	 * busy cursor will be activated during the duration of the load.
-	 * 
-	 * @param propertyName
-	 * @return Object
-	 */
-	private Object createExtension(String propertyName) {
-		// If plugin has been loaded create extension.
-		// Otherwise, show busy cursor then create extension.
-		final IConfigurationElement element = getConfigurationElement();
-		final String name = propertyName;
-
-		final Object[] result = new Object[1];
-		String pluginId = element.getDeclaringExtension().getNamespace();
-		Bundle bundle = Platform.getBundle(pluginId);
-		if (bundle.getState() == Bundle.ACTIVE) {
-			try {
-				return element.createExecutableExtension(name);
-			} catch (CoreException e) {
-				handleCreateExecutableException(result, e);
-			}
-		} else {
-			BusyIndicator.showWhile(null, new Runnable() {
-				public void run() {
-					try {
-						result[0] = element.createExecutableExtension(name);
-					} catch (Exception e) {
-						handleCreateExecutableException(result, e);
-					}
-				}
-			});
-		}
-		return result[0];
-	}
-
-	/**
-	 * @return IOpenOn for this definition
-	 */
-	public IOpenOn createOpenOn() {
-		IOpenOn openOn = null;
-
-		if (getClassName() != null) {
-			openOn = (IOpenOn) createExtension(OpenOnBuilder.ATT_CLASS);
-		}
-
-		return openOn;
-	}
-
-	/**
-	 * @return Returns the fClass.
-	 */
-	public String getClassName() {
-		return fClassName;
-	}
-
-	/**
-	 * @return Returns the fConfigurationElement.
-	 */
-	public IConfigurationElement getConfigurationElement() {
-		return fConfigurationElement;
-	}
-
-	/**
-	 * @return Returns the fContentTypes.
-	 */
-	public HashMap getContentTypes() {
-		return fContentTypes;
-	}
-
-	/**
-	 * @return Returns the fId.
-	 */
-	public String getId() {
-		return fId;
-	}
-
-	/**
-	 * @param result
-	 * @param e
-	 */
-	private void handleCreateExecutableException(Object[] result, Throwable e) {
-		Logger.logException("Unable to create open on: " + getId(), e); //$NON-NLS-1$
-		e.printStackTrace();
-		result[0] = null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnProvider.java
deleted file mode 100644
index cc42bc2..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnProvider.java
+++ /dev/null
@@ -1,143 +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.sse.ui.internal.openon;
-
-
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextUtilities;
-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.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-
-
-/**
- * Determines the appropriate IOpenOn to call based on current partition.
- * 
- * @deprecated Use base support for hyperlink navigation
- */
-public class OpenOnProvider {
-	private static OpenOnProvider fInstance;
-
-	/**
-	 * returns singleton instance of OpenOnProvider
-	 * 
-	 * @return OpenOnProvider
-	 */
-	public synchronized static OpenOnProvider getInstance() {
-		if (fInstance == null) {
-			fInstance = new OpenOnProvider();
-		}
-		return fInstance;
-	}
-
-
-	/**
-	 * Returns the content type of document
-	 * 
-	 * @param document -
-	 *            assumes document is not null
-	 * @return String content type of given document
-	 */
-	protected String getContentType(IDocument document) {
-		String type = null;
-
-		IModelManager mgr = StructuredModelManager.getModelManager();
-		IStructuredModel model = null;
-		try {
-			model = mgr.getExistingModelForRead(document);
-			if (model != null) {
-				type = model.getContentTypeIdentifier();
-			}
-		}
-		finally {
-			if (model != null) {
-				model.releaseFromRead();
-			}
-		}
-		return type;
-	}
-
-	/**
-	 * Returns the appropriate IOpenOn for the current partition
-	 * 
-	 * @return
-	 */
-	public IOpenOn getOpenOn(IDocument document, int offset) {
-		IOpenOn openOn = null;
-
-		// determine the current partition
-		if (document != null) {
-			String contentTypeID = getContentType(document);
-			String partitionType = getPartitionType(document, offset);
-
-			IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
-
-			while (openOn == null && contentType != null) {
-				// Query OpenOnBuilder and get the list of OpenOns for the
-				// current partition
-				OpenOnDefinition[] defs = OpenOnBuilder.getInstance().getOpenOnDefinitions(contentType.getId(), partitionType);
-				contentType = contentType.getBaseType();
-
-				// If more than 1 openon is returned, need to further check
-				// which OpenOn is the appropriate one to return
-				// for now just returning the first one
-				if (defs != null && defs.length > 0) {
-					openOn = defs[0].createOpenOn();
-				}
-			}
-		}
-
-		return openOn;
-	}
-
-	/**
-	 * Returns the partition type located at offset in the document
-	 * 
-	 * @param document -
-	 *            assumes document is not null
-	 * @param offset
-	 * @return String partition type
-	 */
-	protected String getPartitionType(IDocument document, int offset) {
-		String type = null;
-		try {
-			// TODO: provide partitioning information so we're not using a default like this
-			if (document instanceof IStructuredDocument) {
-				type = TextUtilities.getContentType(document, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, offset, false);
-			}
-		}
-		catch (BadLocationException e1) {
-		}
-		finally {
-			if (type == null) {
-				try {
-					ITypedRegion region = document.getPartition(offset);
-					if (region != null) {
-						type = region.getType();
-					}
-				}
-				catch (BadLocationException e) {
-					type = null;
-				}
-			}
-		}
-		return type;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java
deleted file mode 100644
index 5130c77..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java
+++ /dev/null
@@ -1,86 +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.sse.ui.internal.preferences;
-
-/**
- * Preference keys for SSE UI
- */
-public class EditorPreferenceNames {
-	/**
-	 * A named preference that controls on-the-fly validation
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public static final String EVALUATE_TEMPORARY_PROBLEMS = getEvaluateTemporaryProblemsKey();
-
-	private static String getEvaluateTemporaryProblemsKey() {
-		return "evaluateTemporaryProblems"; //$NON-NLS-1$
-	}
-
-	/**
-	 * A named preference that controls whether bracket matching highlighting
-	 * is turned on or off.
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public final static String MATCHING_BRACKETS = getMatchingBracketsKey();
-
-	private static String getMatchingBracketsKey() {
-		return "matchingBrackets"; //$NON-NLS-1$
-	}
-
-	/**
-	 * A named preference that holds the color used to highlight matching
-	 * brackets.
-	 * <p>
-	 * Value is of type <code>String</code>. A RGB color value encoded as a
-	 * string using class <code>PreferenceConverter</code>
-	 * </p>
-	 */
-	public final static String MATCHING_BRACKETS_COLOR = getMatchingBracketsColorKey();
-
-	private static String getMatchingBracketsColorKey() {
-		return "matchingBracketsColor"; //$NON-NLS-1$
-	}
-
-	/**
-	 * A named preference that defines the key for the hover modifiers.
-	 * <p>
-	 * Value is of type <code>String</code>.
-	 * </p>
-	 */
-	public static final String EDITOR_TEXT_HOVER_MODIFIERS = getTextHoverModifiersKey();
-
-	private static String getTextHoverModifiersKey() {
-		return "hoverModifiers"; //$NON-NLS-1$
-	}
-
-	/**
-	 * A named preference that defines read only contrast scale.
-	 * <p>
-	 * Value is of type <code>Integer</code>.
-	 * </p>
-	 */
-	public static final String READ_ONLY_FOREGROUND_SCALE = getReadOnlyForegroundScaleKey();
-
-	private static String getReadOnlyForegroundScaleKey() {
-		return "readOnlyForegroundScale"; //$NON-NLS-1$
-	}
-
-	/**
-	 * A named preference that defines whether or not to show a message dialog
-	 * informing user of unknown content type in editor.
-	 */
-	public static final String SHOW_UNKNOWN_CONTENT_TYPE_MSG = "showUnknownContentTypeMsg"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/OverlayPreferenceStore.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/OverlayPreferenceStore.java
deleted file mode 100644
index 06054fe..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/OverlayPreferenceStore.java
+++ /dev/null
@@ -1,486 +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.sse.ui.internal.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceStore;
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-
-/**
- * An overlaying preference store. copied from JDT
- */
-public class OverlayPreferenceStore implements IPreferenceStore {
-
-	public static class OverlayKey {
-
-		TypeDescriptor fDescriptor;
-		String fKey;
-
-		public OverlayKey(TypeDescriptor descriptor, String key) {
-			fDescriptor = descriptor;
-			fKey = key;
-		}
-	}
-
-	private class PropertyListener implements IPropertyChangeListener {
-
-		/*
-		 * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
-		 */
-		public void propertyChange(PropertyChangeEvent event) {
-			OverlayKey key = findOverlayKey(event.getProperty());
-			if (key != null)
-				propagateProperty(fParent, key, fStore);
-		}
-	}
-
-
-	public static final class TypeDescriptor {
-		private TypeDescriptor() {
-		}
-	}
-
-	public static final TypeDescriptor BOOLEAN = new TypeDescriptor();
-	public static final TypeDescriptor DOUBLE = new TypeDescriptor();
-	public static final TypeDescriptor FLOAT = new TypeDescriptor();
-	public static final TypeDescriptor INT = new TypeDescriptor();
-	public static final TypeDescriptor LONG = new TypeDescriptor();
-	public static final TypeDescriptor STRING = new TypeDescriptor();
-	private boolean fLoaded;
-	private OverlayKey[] fOverlayKeys;
-
-
-	IPreferenceStore fParent;
-
-	private PropertyListener fPropertyListener;
-	IPreferenceStore fStore;
-
-
-	public OverlayPreferenceStore(IPreferenceStore parent, OverlayKey[] overlayKeys) {
-		fParent = parent;
-		fOverlayKeys = overlayKeys;
-		fStore = new PreferenceStore();
-	}
-
-	/**
-	 * The keys to add to the list of overlay keys.
-	 * <p>
-	 * Note: This method must be called before {@link #load()}is called.
-	 * </p>
-	 * 
-	 * @param keys
-	 * @plannedfor 3.0
-	 */
-	public void addKeys(OverlayKey[] keys) {
-		Assert.isTrue(!fLoaded);
-		Assert.isNotNull(keys);
-
-		int overlayKeysLength = fOverlayKeys.length;
-		OverlayKey[] result = new OverlayKey[keys.length + overlayKeysLength];
-
-		for (int i = 0, length = overlayKeysLength; i < length; i++)
-			result[i] = fOverlayKeys[i];
-
-		for (int i = 0, length = keys.length; i < length; i++)
-			result[overlayKeysLength + i] = keys[i];
-
-		fOverlayKeys = result;
-
-		if (fLoaded)
-			load();
-	}
-
-	/*
-	 * @see IPreferenceStore#addPropertyChangeListener(IPropertyChangeListener)
-	 */
-	public void addPropertyChangeListener(IPropertyChangeListener listener) {
-		fStore.addPropertyChangeListener(listener);
-	}
-
-	/*
-	 * @see IPreferenceStore#contains(String)
-	 */
-	public boolean contains(String name) {
-		return fStore.contains(name);
-	}
-
-	private boolean covers(String key) {
-		return (findOverlayKey(key) != null);
-	}
-
-	OverlayKey findOverlayKey(String key) {
-		for (int i = 0; i < fOverlayKeys.length; i++) {
-			if (fOverlayKeys[i].fKey.equals(key))
-				return fOverlayKeys[i];
-		}
-		return null;
-	}
-
-	/*
-	 * @see IPreferenceStore#firePropertyChangeEvent(String, Object, Object)
-	 */
-	public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) {
-		fStore.firePropertyChangeEvent(name, oldValue, newValue);
-	}
-
-	/*
-	 * @see IPreferenceStore#getBoolean(String)
-	 */
-	public boolean getBoolean(String name) {
-		return fStore.getBoolean(name);
-	}
-
-	/*
-	 * @see IPreferenceStore#getDefaultBoolean(String)
-	 */
-	public boolean getDefaultBoolean(String name) {
-		return fStore.getDefaultBoolean(name);
-	}
-
-	/*
-	 * @see IPreferenceStore#getDefaultDouble(String)
-	 */
-	public double getDefaultDouble(String name) {
-		return fStore.getDefaultDouble(name);
-	}
-
-	/*
-	 * @see IPreferenceStore#getDefaultFloat(String)
-	 */
-	public float getDefaultFloat(String name) {
-		return fStore.getDefaultFloat(name);
-	}
-
-	/*
-	 * @see IPreferenceStore#getDefaultInt(String)
-	 */
-	public int getDefaultInt(String name) {
-		return fStore.getDefaultInt(name);
-	}
-
-	/*
-	 * @see IPreferenceStore#getDefaultLong(String)
-	 */
-	public long getDefaultLong(String name) {
-		return fStore.getDefaultLong(name);
-	}
-
-	/*
-	 * @see IPreferenceStore#getDefaultString(String)
-	 */
-	public String getDefaultString(String name) {
-		return fStore.getDefaultString(name);
-	}
-
-	/*
-	 * @see IPreferenceStore#getDouble(String)
-	 */
-	public double getDouble(String name) {
-		return fStore.getDouble(name);
-	}
-
-	/*
-	 * @see IPreferenceStore#getFloat(String)
-	 */
-	public float getFloat(String name) {
-		return fStore.getFloat(name);
-	}
-
-	/*
-	 * @see IPreferenceStore#getInt(String)
-	 */
-	public int getInt(String name) {
-		return fStore.getInt(name);
-	}
-
-	/*
-	 * @see IPreferenceStore#getLong(String)
-	 */
-	public long getLong(String name) {
-		return fStore.getLong(name);
-	}
-
-	/*
-	 * @see IPreferenceStore#getString(String)
-	 */
-	public String getString(String name) {
-		return fStore.getString(name);
-	}
-
-	/*
-	 * @see IPreferenceStore#isDefault(String)
-	 */
-	public boolean isDefault(String name) {
-		return fStore.isDefault(name);
-	}
-
-	public void load() {
-		for (int i = 0; i < fOverlayKeys.length; i++)
-			loadProperty(fParent, fOverlayKeys[i], fStore, true);
-
-		fLoaded = true;
-
-	}
-
-	public void loadDefaults() {
-		for (int i = 0; i < fOverlayKeys.length; i++)
-			setToDefault(fOverlayKeys[i].fKey);
-	}
-
-	private void loadProperty(IPreferenceStore orgin, OverlayKey key, IPreferenceStore target, boolean forceInitialization) {
-		TypeDescriptor d = key.fDescriptor;
-		if (BOOLEAN == d) {
-
-			if (forceInitialization)
-				target.setValue(key.fKey, true);
-			target.setValue(key.fKey, orgin.getBoolean(key.fKey));
-			target.setDefault(key.fKey, orgin.getDefaultBoolean(key.fKey));
-
-		} else if (DOUBLE == d) {
-
-			if (forceInitialization)
-				target.setValue(key.fKey, 1.0D);
-			target.setValue(key.fKey, orgin.getDouble(key.fKey));
-			target.setDefault(key.fKey, orgin.getDefaultDouble(key.fKey));
-
-		} else if (FLOAT == d) {
-
-			if (forceInitialization)
-				target.setValue(key.fKey, 1.0F);
-			target.setValue(key.fKey, orgin.getFloat(key.fKey));
-			target.setDefault(key.fKey, orgin.getDefaultFloat(key.fKey));
-
-		} else if (INT == d) {
-
-			if (forceInitialization)
-				target.setValue(key.fKey, 1);
-			target.setValue(key.fKey, orgin.getInt(key.fKey));
-			target.setDefault(key.fKey, orgin.getDefaultInt(key.fKey));
-
-		} else if (LONG == d) {
-
-			if (forceInitialization)
-				target.setValue(key.fKey, 1L);
-			target.setValue(key.fKey, orgin.getLong(key.fKey));
-			target.setDefault(key.fKey, orgin.getDefaultLong(key.fKey));
-
-		} else if (STRING == d) {
-
-			if (forceInitialization)
-				target.setValue(key.fKey, "1"); //$NON-NLS-1$
-			target.setValue(key.fKey, orgin.getString(key.fKey));
-			target.setDefault(key.fKey, orgin.getDefaultString(key.fKey));
-
-		}
-	}
-
-	/*
-	 * @see IPreferenceStore#needsSaving()
-	 */
-	public boolean needsSaving() {
-		return fStore.needsSaving();
-	}
-
-	public void propagate() {
-		for (int i = 0; i < fOverlayKeys.length; i++)
-			propagateProperty(fStore, fOverlayKeys[i], fParent);
-	}
-
-	void propagateProperty(IPreferenceStore orgin, OverlayKey key, IPreferenceStore target) {
-
-		if (orgin.isDefault(key.fKey)) {
-			if (!target.isDefault(key.fKey))
-				target.setToDefault(key.fKey);
-			return;
-		}
-
-		TypeDescriptor d = key.fDescriptor;
-		if (BOOLEAN == d) {
-
-			boolean originValue = orgin.getBoolean(key.fKey);
-			boolean targetValue = target.getBoolean(key.fKey);
-			if (targetValue != originValue)
-				target.setValue(key.fKey, originValue);
-
-		} else if (DOUBLE == d) {
-
-			double originValue = orgin.getDouble(key.fKey);
-			double targetValue = target.getDouble(key.fKey);
-			if (targetValue != originValue)
-				target.setValue(key.fKey, originValue);
-
-		} else if (FLOAT == d) {
-
-			float originValue = orgin.getFloat(key.fKey);
-			float targetValue = target.getFloat(key.fKey);
-			if (targetValue != originValue)
-				target.setValue(key.fKey, originValue);
-
-		} else if (INT == d) {
-
-			int originValue = orgin.getInt(key.fKey);
-			int targetValue = target.getInt(key.fKey);
-			if (targetValue != originValue)
-				target.setValue(key.fKey, originValue);
-
-		} else if (LONG == d) {
-
-			long originValue = orgin.getLong(key.fKey);
-			long targetValue = target.getLong(key.fKey);
-			if (targetValue != originValue)
-				target.setValue(key.fKey, originValue);
-
-		} else if (STRING == d) {
-
-			String originValue = orgin.getString(key.fKey);
-			String targetValue = target.getString(key.fKey);
-			if (targetValue != null && originValue != null && !targetValue.equals(originValue))
-				target.setValue(key.fKey, originValue);
-
-		}
-	}
-
-	/*
-	 * @see IPreferenceStore#putValue(String, String)
-	 */
-	public void putValue(String name, String value) {
-		if (covers(name))
-			fStore.putValue(name, value);
-	}
-
-	/*
-	 * @see IPreferenceStore#removePropertyChangeListener(IPropertyChangeListener)
-	 */
-	public void removePropertyChangeListener(IPropertyChangeListener listener) {
-		fStore.removePropertyChangeListener(listener);
-	}
-
-	/*
-	 * @see IPreferenceStore#setDefault(String, boolean)
-	 */
-	public void setDefault(String name, boolean value) {
-		if (covers(name))
-			fStore.setDefault(name, value);
-	}
-
-	/*
-	 * @see IPreferenceStore#setDefault(String, double)
-	 */
-	public void setDefault(String name, double value) {
-		if (covers(name))
-			fStore.setDefault(name, value);
-	}
-
-	/*
-	 * @see IPreferenceStore#setDefault(String, float)
-	 */
-	public void setDefault(String name, float value) {
-		if (covers(name))
-			fStore.setDefault(name, value);
-	}
-
-	/*
-	 * @see IPreferenceStore#setDefault(String, int)
-	 */
-	public void setDefault(String name, int value) {
-		if (covers(name))
-			fStore.setDefault(name, value);
-	}
-
-	/*
-	 * @see IPreferenceStore#setDefault(String, long)
-	 */
-	public void setDefault(String name, long value) {
-		if (covers(name))
-			fStore.setDefault(name, value);
-	}
-
-	/*
-	 * @see IPreferenceStore#setDefault(String, String)
-	 */
-	public void setDefault(String name, String value) {
-		if (covers(name))
-			fStore.setDefault(name, value);
-	}
-
-	/*
-	 * @see IPreferenceStore#setToDefault(String)
-	 */
-	public void setToDefault(String name) {
-		fStore.setToDefault(name);
-	}
-
-	/*
-	 * @see IPreferenceStore#setValue(String, boolean)
-	 */
-	public void setValue(String name, boolean value) {
-		if (covers(name))
-			fStore.setValue(name, value);
-	}
-
-	/*
-	 * @see IPreferenceStore#setValue(String, double)
-	 */
-	public void setValue(String name, double value) {
-		if (covers(name))
-			fStore.setValue(name, value);
-	}
-
-	/*
-	 * @see IPreferenceStore#setValue(String, float)
-	 */
-	public void setValue(String name, float value) {
-		if (covers(name))
-			fStore.setValue(name, value);
-	}
-
-	/*
-	 * @see IPreferenceStore#setValue(String, int)
-	 */
-	public void setValue(String name, int value) {
-		if (covers(name))
-			fStore.setValue(name, value);
-	}
-
-	/*
-	 * @see IPreferenceStore#setValue(String, long)
-	 */
-	public void setValue(String name, long value) {
-		if (covers(name))
-			fStore.setValue(name, value);
-	}
-
-	/*
-	 * @see IPreferenceStore#setValue(String, String)
-	 */
-	public void setValue(String name, String value) {
-		if (covers(name))
-			fStore.setValue(name, value);
-	}
-
-	public void start() {
-		if (fPropertyListener == null) {
-			fPropertyListener = new PropertyListener();
-			fParent.addPropertyChangeListener(fPropertyListener);
-		}
-	}
-
-	public void stop() {
-		if (fPropertyListener != null) {
-			fParent.removePropertyChangeListener(fPropertyListener);
-			fPropertyListener = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/TabFolderLayout.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/TabFolderLayout.java
deleted file mode 100644
index b1b8903..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/TabFolderLayout.java
+++ /dev/null
@@ -1,61 +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.sse.ui.internal.preferences;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Layout;
-
-/**
- * Copied from JDT
- * 
- * @author pavery
- */
-public class TabFolderLayout extends Layout {
-
-	protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
-		if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
-			return new Point(wHint, hHint);
-
-		Control[] children = composite.getChildren();
-		int count = children.length;
-		int maxWidth = 0, maxHeight = 0;
-		for (int i = 0; i < count; i++) {
-			Control child = children[i];
-			Point pt = child.computeSize(SWT.DEFAULT, SWT.DEFAULT, flushCache);
-			maxWidth = Math.max(maxWidth, pt.x);
-			maxHeight = Math.max(maxHeight, pt.y);
-		}
-
-		if (wHint != SWT.DEFAULT)
-			maxWidth = wHint;
-		if (hHint != SWT.DEFAULT)
-			maxHeight = hHint;
-
-		return new Point(maxWidth, maxHeight);
-
-	}
-
-	protected void layout(Composite composite, boolean flushCache) {
-		Rectangle rect = composite.getClientArea();
-
-		Control[] children = composite.getChildren();
-		for (int i = 0; i < children.length; i++) {
-			children[i].setBounds(rect);
-		}
-	}
-}
-
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractColorPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractColorPage.java
deleted file mode 100644
index 0607c39..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractColorPage.java
+++ /dev/null
@@ -1,274 +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.sse.ui.internal.preferences.ui;
-
-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.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.IWorkbench;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-
-public abstract class AbstractColorPage extends org.eclipse.jface.preference.PreferencePage implements org.eclipse.ui.IWorkbenchPreferencePage {
-	protected OverlayPreferenceStore fOverlayStore;
-	protected StyledTextColorPicker fPicker = null;
-
-	/**
-	 * Creates the coloring group used in createContents This method can be
-	 * overwritten to set the text of the group or provide an infopop
-	 */
-	protected Composite createColoringComposite(Composite parent) {
-		Composite coloringComposite = createComposite(parent, 1);
-		return coloringComposite;
-	}
-
-	/**
-	 * Creates composite control and sets the default layout data.
-	 */
-	protected Composite createComposite(Composite parent, int numColumns) {
-		Composite composite = new Composite(parent, SWT.NULL);
-
-		//GridLayout
-		GridLayout layout = new GridLayout();
-		layout.numColumns = numColumns;
-		layout.marginHeight = 0;
-		layout.marginWidth = 0;
-		composite.setLayout(layout);
-
-		//GridData
-		GridData data = new GridData(GridData.FILL);
-		data.verticalAlignment = GridData.FILL;
-		data.horizontalAlignment = GridData.FILL;
-		composite.setLayoutData(data);
-		return composite;
-	}
-
-	protected Control createContents(Composite parent) {
-		// create scrollbars for this preference page when needed
-		final ScrolledComposite sc1 = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
-		sc1.setLayoutData(new GridData(GridData.FILL_BOTH));
-		Composite pageComponent = createComposite(sc1, 1);
-		sc1.setContent(pageComponent);
-
-		Label descLabel = createDescriptionLabel(pageComponent, SSEUIMessages.AbstractColorPageDescription); //$NON-NLS-1$
-		Composite coloringComposite = createColoringComposite(pageComponent);
-		createContentsForPicker(coloringComposite);
-
-		GridData gd = (GridData) descLabel.getLayoutData();
-		gd.widthHint = (coloringComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT)).x;
-		setSize(pageComponent);
-		return pageComponent;
-	}
-
-	/**
-	 * Creates the StyledTextColorPicker used in createContents This method
-	 * can be overwritten to set up StyledTextColorPicker differently
-	 */
-	protected void createContentsForPicker(Composite parent) {
-		// create the color picker
-		fPicker = new StyledTextColorPicker(parent, SWT.NULL);
-		GridData data = new GridData(GridData.FILL_BOTH);
-		fPicker.setLayoutData(data);
-
-		fPicker.setPreferenceStore(fOverlayStore);
-		setupPicker(fPicker);
-
-		fPicker.setText(getSampleText());
-	}
-
-	/**
-	 * Create description label displayed at top of preference page. This
-	 * method/label is used instead of PreferencePage's description label
-	 * because the ScrolledComposite contained in this page will not fully
-	 * work (horizontal scrolling) with PreferencePage's description label.
-	 */
-	protected Label createDescriptionLabel(Composite parent, String description) {
-		Label label = new Label(parent, SWT.LEFT | SWT.WRAP);
-		label.setText(description);
-
-		GridData data = new GridData(GridData.FILL_HORIZONTAL);
-		data.grabExcessHorizontalSpace = true;
-		label.setLayoutData(data);
-
-		return label;
-	}
-
-	/**
-	 * Creates composite control and sets the default layout data.
-	 */
-
-	protected Group createGroup(Composite parent, int numColumns) {
-		Group group = new Group(parent, SWT.NULL);
-
-		//GridLayout
-		GridLayout layout = new GridLayout();
-		layout.numColumns = numColumns;
-		group.setLayout(layout);
-
-		//GridData
-		GridData data = new GridData(GridData.FILL);
-		data.verticalAlignment = GridData.FILL;
-		data.horizontalAlignment = GridData.FILL;
-		data.grabExcessHorizontalSpace = true;
-		group.setLayoutData(data);
-
-		return group;
-	}
-
-	/**
-	 * Utility method that creates a label instance and sets the default
-	 * layout data.
-	 */
-	protected Label createLabel(Composite parent, String text) {
-		Label label = new Label(parent, SWT.LEFT);
-		label.setText(text);
-		GridData data = new GridData(GridData.FILL);
-		data.horizontalAlignment = GridData.FILL;
-		label.setLayoutData(data);
-		return label;
-	}
-
-	protected OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() {
-		return null;
-	}
-
-	protected Button createPushButton(Composite parent, String label) {
-		Button button = new Button(parent, SWT.PUSH);
-		button.setText(label);
-		GridData data = new GridData(GridData.FILL);
-		data.horizontalAlignment = GridData.FILL;
-		button.setLayoutData(data);
-		return button;
-	}
-
-	/**
-	 * Utility method that creates a text instance and sets the default layout
-	 * data.
-	 */
-	protected Text createTextField(Composite parent, String text) {
-		Text textfield = new Text(parent, SWT.LEFT);
-		textfield.setText(text);
-		GridData data = new GridData(GridData.FILL);
-		data.horizontalAlignment = GridData.FILL;
-		textfield.setLayoutData(data);
-		return textfield;
-	}
-
-	public void dispose() {
-		super.dispose();
-		if (fPicker != null && !fPicker.isDisposed())
-			fPicker.releasePickerResources();
-		if (fOverlayStore != null) {
-			fOverlayStore.stop();
-		}
-	}
-
-	public StyledTextColorPicker getPicker() {
-		return fPicker;
-	}
-
-	public abstract String getSampleText();
-
-	/**
-	 * Initializes this preference page for the given workbench.
-	 * <p>
-	 * This method is called automatically as the preference page is being
-	 * created and initialized. Clients must not call this method.
-	 * </p>
-	 * 
-	 * @param workbench
-	 *            the workbench
-	 */
-	public void init(IWorkbench workbench) {
-		fOverlayStore = new OverlayPreferenceStore(getPreferenceStore(), createOverlayStoreKeys());
-		fOverlayStore.load();
-		fOverlayStore.start();
-	}
-
-	/**
-	 * Initializes states of the controls using default values in the
-	 * preference store.
-	 */
-	protected void performDefaults() {
-		fOverlayStore.loadDefaults();
-		fPicker.refresh();
-	}
-
-	public boolean performOk() {
-		fOverlayStore.propagate();
-		 savePreferences();
-		return true;
-	}
-	
-	protected void savePreferences() {
-		// save plugin preferences here
-	}
-
-	/**
-	 * Sets the size of composite to the default value
-	 */
-	protected void setSize(Composite composite) {
-		if (composite != null) {
-			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);
-			}
-		}
-	}
-
-	protected abstract void setupPicker(StyledTextColorPicker picker);
-
-	public void setVisible(boolean visible) {
-		boolean doShrink = false;
-		// limiter, for the really huge fonts
-		if (visible) {
-			getPicker().refresh();
-			int x = Math.min(getControl().getShell().getSize().x, getControl().getDisplay().getClientArea().width * 9 / 10);
-			int y = Math.min(getControl().getShell().getSize().y, getControl().getDisplay().getClientArea().height * 9 / 10);
-			boolean shrinkWidth = (x != getControl().getShell().getSize().x);
-			boolean shrinkHeight = (y != getControl().getShell().getSize().y);
-			doShrink = shrinkWidth || shrinkHeight;
-			if (doShrink) {
-				// modify just the height
-				if (shrinkHeight && !shrinkWidth)
-					getShell().setBounds(getShell().getLocation().x, 0, getShell().getSize().x, getControl().getDisplay().getClientArea().height);
-				// modify just the width
-				else if (!shrinkHeight && shrinkWidth)
-					getShell().setBounds(0, getShell().getLocation().y, getControl().getDisplay().getClientArea().width, getShell().getSize().y);
-				// change the entire shell size to only fill the display, and
-				// move it to the origin
-				else
-					getShell().setBounds(0, 0, getControl().getDisplay().getClientArea().width, getControl().getDisplay().getClientArea().height);
-			}
-		}
-		super.setVisible(visible);
-		if (doShrink) {
-			getControl().getShell().redraw();
-			getControl().getShell().update();
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferencePage.java
deleted file mode 100644
index 708ff76..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferencePage.java
+++ /dev/null
@@ -1,280 +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.sse.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-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.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * (pa) why is this class abstract if there are no abstract methods?
- */
-public abstract class AbstractPreferencePage extends PreferencePage implements ModifyListener, SelectionListener, IWorkbenchPreferencePage {
-
-	protected final static int WIDTH_VALIDATION_LOWER_LIMIT = 0; //$NON-NLS-1$
-	protected final static int WIDTH_VALIDATION_UPPER_LIMIT = 999; //$NON-NLS-1$
-
-	protected Button createCheckBox(Composite group, String label) {
-		Button button = new Button(group, SWT.CHECK | SWT.LEFT);
-		button.setText(label);
-
-		//GridData
-		GridData data = new GridData(GridData.FILL);
-		data.verticalAlignment = GridData.CENTER;
-		data.horizontalAlignment = GridData.FILL;
-		button.setLayoutData(data);
-
-		return button;
-	}
-
-	protected 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;
-	}
-
-	protected Control createContents(Composite parent) {
-		return createScrolledComposite(parent);
-	}
-
-	protected Combo createDropDownBox(Composite parent) {
-		Combo comboBox = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
-
-		//GridData
-		GridData data = new GridData();
-		data.verticalAlignment = GridData.CENTER;
-		data.horizontalAlignment = GridData.FILL;
-		data.grabExcessHorizontalSpace = true;
-		comboBox.setLayoutData(data);
-
-		return comboBox;
-	}
-
-	protected Group createGroup(Composite parent, int numColumns) {
-		Group group = new Group(parent, SWT.NULL);
-
-		//GridLayout
-		GridLayout layout = new GridLayout();
-		layout.numColumns = numColumns;
-		group.setLayout(layout);
-
-		//GridData
-		GridData data = new GridData(GridData.FILL);
-		data.horizontalIndent = 0;
-		data.verticalAlignment = GridData.FILL;
-		data.horizontalAlignment = GridData.FILL;
-		data.grabExcessHorizontalSpace = true;
-		group.setLayoutData(data);
-
-		return group;
-	}
-
-	protected Label createLabel(Composite parent, String text) {
-		Label label = new Label(parent, SWT.LEFT);
-		label.setText(text);
-
-
-		//GridData
-		GridData data = new GridData(GridData.FILL);
-		data.verticalAlignment = GridData.CENTER;
-		data.horizontalAlignment = GridData.FILL;
-		label.setLayoutData(data);
-
-		return label;
-	}
-
-	protected Button createRadioButton(Composite group, String label) {
-		Button button = new Button(group, SWT.RADIO);
-		button.setText(label);
-
-		//GridData
-		GridData data = new GridData(GridData.FILL);
-		data.verticalAlignment = GridData.CENTER;
-		data.horizontalAlignment = GridData.FILL;
-		button.setLayoutData(data);
-
-		return button;
-	}
-
-	protected 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;
-	}
-
-	protected Label createSeparator(Composite parent, int columnSpan) {
-		// Create a spacer line
-		Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
-
-		//GridData
-		GridData data = new GridData(GridData.FILL);
-		data.verticalAlignment = GridData.CENTER;
-		data.horizontalAlignment = GridData.FILL;
-		data.horizontalSpan = columnSpan;
-
-		separator.setLayoutData(data);
-		return separator;
-	}
-
-	protected Text createTextField(Composite parent) {
-		Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
-
-		//GridData
-		GridData data = new GridData();
-		data.verticalAlignment = GridData.CENTER;
-		data.horizontalAlignment = GridData.FILL;
-		data.grabExcessHorizontalSpace = true;
-		text.setLayoutData(data);
-
-		return text;
-	}
-
-	protected void enableValues() {
-	}
-
-	protected Preferences getModelPreferences() {
-		return SSECorePlugin.getDefault().getPluginPreferences();
-	}
-
-	public void init(IWorkbench workbench) {
-	}
-
-	protected void initializeValues() {
-	}
-
-	protected boolean loadPreferences() {
-		BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
-			public void run() {
-				initializeValues();
-				validateValues();
-				enableValues();
-			}
-		});
-		return true;
-	}
-
-	public void modifyText(ModifyEvent e) {
-		// If we are called too early, i.e. before the controls are created
-		// then return
-		// to avoid null pointer exceptions
-		if (e.widget != null && e.widget.isDisposed())
-			return;
-
-		validateValues();
-		enableValues();
-	}
-
-	protected void performDefaults() {
-		super.performDefaults();
-	}
-
-	public boolean performOk() {
-		savePreferences();
-		return true;
-	}
-
-	protected boolean savePreferences() {
-		BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
-			public void run() {
-				storeValues();
-			}
-		});
-		return true;
-	}
-
-	protected void setInvalidInputMessage(String widthText) {
-		String msg = NLS.bind(SSEUIMessages._4concat, (new Object[]{widthText}));
-		setErrorMessage(msg);
-	}
-
-	protected void setSize(Composite composite) {
-		if (composite != null) {
-			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);
-			}
-		}
-	}
-
-	protected void storeValues() {
-		SSEUIPlugin.getDefault().savePluginPreferences();
-	}
-
-	protected void validateValues() {
-	}
-
-	public void widgetDefaultSelected(SelectionEvent e) {
-		widgetSelected(e);
-	}
-
-	public void widgetSelected(SelectionEvent e) {
-		// If we are called too early, i.e. before the controls are created
-		// then return
-		// to avoid null pointer exceptions
-		if (e.widget != null && e.widget.isDisposed())
-			return;
-
-		validateValues();
-		enableValues();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferenceTab.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferenceTab.java
deleted file mode 100644
index 0401f3f..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferenceTab.java
+++ /dev/null
@@ -1,266 +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.sse.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-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.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-
-/**
- * Generic preference tab page that contains helpful methods
- * 
- * @author amywu
- */
-abstract public class AbstractPreferenceTab implements IPreferenceTab {
-
-	Map fCheckBoxes = new HashMap();
-	private SelectionListener fCheckBoxListener = new SelectionListener() {
-		public void widgetDefaultSelected(SelectionEvent e) {
-		}
-
-		public void widgetSelected(SelectionEvent e) {
-			Button button = (Button) e.widget;
-			fOverlayStore.setValue((String) fCheckBoxes.get(button), button.getSelection());
-		}
-	};
-	private PreferencePage fMainPreferencePage;
-	private ModifyListener fNumberFieldListener = new ModifyListener() {
-		public void modifyText(ModifyEvent e) {
-			numberFieldChanged((Text) e.widget);
-		}
-	};
-	private ArrayList fNumberFields = new ArrayList();
-	OverlayPreferenceStore fOverlayStore;
-	private ModifyListener fTextFieldListener = new ModifyListener() {
-		public void modifyText(ModifyEvent e) {
-			Text text = (Text) e.widget;
-			fOverlayStore.setValue((String) fTextFields.get(text), text.getText());
-		}
-	};
-	Map fTextFields = new HashMap();
-
-	protected Button addCheckBox(Composite parent, String label, String key, int indentation) {
-		Button checkBox = new Button(parent, SWT.CHECK);
-		checkBox.setText(label);
-
-		GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
-		gd.horizontalIndent = indentation;
-		gd.horizontalSpan = 2;
-		checkBox.setLayoutData(gd);
-		checkBox.addSelectionListener(fCheckBoxListener);
-
-		fCheckBoxes.put(checkBox, key);
-
-		return checkBox;
-	}
-
-	/**
-	 * Returns an array of size 2: - first element is of type
-	 * <code>Label</code>- second element is of type <code>Text</code>
-	 * Use <code>getLabelControl</code> and <code>getTextControl</code> to
-	 * get the 2 controls.
-	 */
-	private Control[] addLabelledTextField(Composite composite, String label, String key, int textLimit, int indentation, boolean isNumber) {
-		Label labelControl = new Label(composite, SWT.NONE);
-		labelControl.setText(label);
-		GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
-		gd.horizontalIndent = indentation;
-		labelControl.setLayoutData(gd);
-
-		Text textControl = new Text(composite, SWT.BORDER | SWT.SINGLE);
-		gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
-		gd.widthHint = convertWidthInCharsToPixels(textControl, textLimit + 1);
-		textControl.setLayoutData(gd);
-		textControl.setTextLimit(textLimit);
-		fTextFields.put(textControl, key);
-		if (isNumber) {
-			fNumberFields.add(textControl);
-			textControl.addModifyListener(fNumberFieldListener);
-		} else {
-			textControl.addModifyListener(fTextFieldListener);
-		}
-
-		return new Control[]{labelControl, textControl};
-	}
-
-	protected Text addTextField(Composite composite, String label, String key, int textLimit, int indentation, boolean isNumber) {
-		return getTextControl(addLabelledTextField(composite, label, key, textLimit, indentation, isNumber));
-	}
-
-	/**
-	 * Applies the status to the status line of a dialog page.
-	 */
-	private void applyToStatusLine(IStatus status) {
-		String message = status.getMessage();
-		switch (status.getSeverity()) {
-			case IStatus.OK :
-				fMainPreferencePage.setMessage(message, IMessageProvider.NONE);
-				fMainPreferencePage.setErrorMessage(null);
-				break;
-			case IStatus.WARNING :
-				fMainPreferencePage.setMessage(message, IMessageProvider.WARNING);
-				fMainPreferencePage.setErrorMessage(null);
-				break;
-			case IStatus.INFO :
-				fMainPreferencePage.setMessage(message, IMessageProvider.INFORMATION);
-				fMainPreferencePage.setErrorMessage(null);
-				break;
-			default :
-				if (message.length() == 0) {
-					message = null;
-				}
-				fMainPreferencePage.setMessage(null);
-				fMainPreferencePage.setErrorMessage(message);
-				break;
-		}
-	}
-
-	/**
-	 * Returns the number of pixels corresponding to the width of the given
-	 * number of characters. This method was copied from
-	 * org.eclipse.jface.dialogs.DialogPage
-	 * <p>
-	 * 
-	 * @param a
-	 *            control in the page
-	 * @param chars
-	 *            the number of characters
-	 * @return the number of pixels
-	 */
-	private int convertWidthInCharsToPixels(Control testControl, int chars) {
-		// Compute and store a font metric
-		GC gc = new GC(testControl);
-		gc.setFont(JFaceResources.getDialogFont());
-		FontMetrics fontMetrics = gc.getFontMetrics();
-		gc.dispose();
-
-		// test for failure to initialize for backward compatibility
-		if (fontMetrics == null)
-			return 0;
-		return Dialog.convertWidthInCharsToPixels(fontMetrics, chars);
-	}
-
-	/**
-	 * @return Returns the fMainPreferencePage.
-	 */
-	protected PreferencePage getMainPreferencePage() {
-		return fMainPreferencePage;
-	}
-
-	/**
-	 * @return Returns the fOverlayStore.
-	 */
-	protected OverlayPreferenceStore getOverlayStore() {
-		return fOverlayStore;
-	}
-
-	private Text getTextControl(Control[] labelledTextField) {
-		return (Text) labelledTextField[1];
-	}
-
-	protected void initializeFields() {
-		Iterator e = fCheckBoxes.keySet().iterator();
-		while (e.hasNext()) {
-			Button b = (Button) e.next();
-			String key = (String) fCheckBoxes.get(b);
-			b.setSelection(fOverlayStore.getBoolean(key));
-		}
-
-		e = fTextFields.keySet().iterator();
-		while (e.hasNext()) {
-			Text t = (Text) e.next();
-			String key = (String) fTextFields.get(t);
-			t.setText(fOverlayStore.getString(key));
-		}
-	}
-
-	void numberFieldChanged(Text textControl) {
-		String number = textControl.getText();
-		IStatus status = validatePositiveNumber(number);
-		if (!status.matches(IStatus.ERROR))
-			fOverlayStore.setValue((String) fTextFields.get(textControl), number);
-		updateStatus(status);
-	}
-
-	/**
-	 * @param mainPreferencePage
-	 *            The fMainPreferencePage to set.
-	 */
-	protected void setMainPreferencePage(PreferencePage mainPreferencePage) {
-		fMainPreferencePage = mainPreferencePage;
-	}
-
-	/**
-	 * @param overlayStore
-	 *            The fOverlayStore to set.
-	 */
-	protected void setOverlayStore(OverlayPreferenceStore overlayStore) {
-		fOverlayStore = overlayStore;
-	}
-
-	/**
-	 * Update status of main preference page
-	 * 
-	 * @param status
-	 */
-	protected void updateStatus(IStatus status) {
-		if (!status.matches(IStatus.ERROR)) {
-			for (int i = 0; i < fNumberFields.size(); i++) {
-				Text text = (Text) fNumberFields.get(i);
-				IStatus s = validatePositiveNumber(text.getText());
-				status = s.getSeverity() > status.getSeverity() ? s : status;
-			}
-		}
-
-		fMainPreferencePage.setValid(!status.matches(IStatus.ERROR));
-		applyToStatusLine(status);
-	}
-
-	private IStatus validatePositiveNumber(String number) {
-		StatusInfo status = new StatusInfo();
-		if (number.length() == 0) {
-			status.setError(SSEUIMessages.StructuredTextEditorPreferencePage_37);
-		} else {
-			try {
-				int value = Integer.parseInt(number);
-				if (value < 0)
-					status.setError(number + SSEUIMessages.StructuredTextEditorPreferencePage_38);
-			} catch (NumberFormatException e) {
-				status.setError(number + SSEUIMessages.StructuredTextEditorPreferencePage_38);
-			}
-		}
-		return status;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorEditor.java
deleted file mode 100644
index e564d60..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorEditor.java
+++ /dev/null
@@ -1,142 +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.sse.ui.internal.preferences.ui;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.ACC;
-import org.eclipse.swt.accessibility.AccessibleControlAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlEvent;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.ColorDialog;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * A "button" of a certain color determined by the color picker.
- */
-public class ColorEditor {
-	Button fButton;
-	Color fColor;
-	RGB fColorValue;
-
-	private Point fExtent;
-	Image fImage;
-
-	public ColorEditor(Composite parent) {
-
-		fButton = new Button(parent, SWT.PUSH);
-		fExtent = computeImageSize(parent);
-		fImage = new Image(parent.getDisplay(), fExtent.x, fExtent.y);
-
-		GC gc = new GC(fImage);
-		gc.setBackground(fButton.getBackground());
-		gc.fillRectangle(0, 0, fExtent.x, fExtent.y);
-		gc.dispose();
-
-		fButton.setImage(fImage);
-
-		// bug2541 - associate color value to button's value field
-		fButton.getAccessible().addAccessibleControlListener(new AccessibleControlAdapter() {
-			/**
-			 * @see org.eclipse.swt.accessibility.AccessibleControlAdapter#getValue(AccessibleControlEvent)
-			 */
-			public void getValue(AccessibleControlEvent e) {
-				if (e.childID == ACC.CHILDID_SELF) {
-					if (getColorValue() != null)
-						e.result = getColorValue().toString();
-					else
-						e.result = null;
-				}
-			}
-		});
-
-		fButton.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent event) {
-				ColorDialog colorDialog = new ColorDialog(fButton.getShell());
-				colorDialog.setRGB(fColorValue);
-				RGB newColor = colorDialog.open();
-				if (newColor != null) {
-					fColorValue = newColor;
-					updateColorImage();
-				}
-			}
-		});
-
-		fButton.addDisposeListener(new DisposeListener() {
-			public void widgetDisposed(DisposeEvent event) {
-				if (fImage != null) {
-					fImage.dispose();
-					fImage = null;
-				}
-				if (fColor != null) {
-					fColor.dispose();
-					fColor = null;
-				}
-			}
-		});
-	}
-
-	protected Point computeImageSize(Control window) {
-		GC gc = new GC(window);
-		Font f = JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT);
-		gc.setFont(f);
-		int height = gc.getFontMetrics().getHeight();
-		gc.dispose();
-		Point p = new Point(height * 3 - 6, height);
-		return p;
-	}
-
-	public Button getButton() {
-		return fButton;
-	}
-
-	public RGB getColorValue() {
-		return fColorValue;
-	}
-
-	public void setColorValue(RGB rgb) {
-		fColorValue = rgb;
-		updateColorImage();
-	}
-
-	protected void updateColorImage() {
-
-		Display display = fButton.getDisplay();
-
-		GC gc = new GC(fImage);
-		gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
-		gc.drawRectangle(0, 2, fExtent.x - 1, fExtent.y - 4);
-
-		if (fColor != null)
-			fColor.dispose();
-
-		fColor = new Color(display, fColorValue);
-		gc.setBackground(fColor);
-		gc.fillRectangle(1, 3, fExtent.x - 2, fExtent.y - 5);
-		gc.dispose();
-
-		fButton.setImage(fImage);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java
deleted file mode 100644
index 24af137..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java
+++ /dev/null
@@ -1,147 +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.sse.ui.internal.preferences.ui;
-
-
-
-import java.util.StringTokenizer;
-
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-public class ColorHelper {
-	public final static String BACKGROUND = "background";//$NON-NLS-1$
-	public final static String BOLD = "bold";//$NON-NLS-1$
-	public final static String FOREGROUND = "foreground";//$NON-NLS-1$
-	public final static String NAME = "name";//$NON-NLS-1$
-	private final static String STYLE_SEPARATOR = "|"; //$NON-NLS-1$ 
-
-	/**
-	 * Return an RGB String given the int r, g, b values
-	 */
-	public static String getColorString(int r, int g, int b) {
-		return "#" + getHexString(r, 2) + getHexString(g, 2) + getHexString(b, 2);//$NON-NLS-1$
-	}
-
-	private static String getHexString(int value, int minWidth) {
-		String hexString = Integer.toHexString(value);
-		for (int i = hexString.length(); i < minWidth; i++) {
-			hexString = "0" + hexString;//$NON-NLS-1$
-		}
-		return hexString;
-	}
-
-	/**
-	 * Generates a preference string to be placed in preferences from the
-	 * given String array.
-	 * 
-	 * @param stylePrefs
-	 *            assumes not null and should be in the form of String[0] =
-	 *            Foreground RGB String, String[1] = Background RGB String,
-	 *            String[2] = Bold true/false
-	 * 
-	 * @return String in the form of Foreground RGB String | Background RGB
-	 *         String | Bold true/false
-	 */
-	public static String packStylePreferences(String[] stylePrefs) {
-		StringBuffer styleString = new StringBuffer();
-
-		if (stylePrefs.length == 3) {
-			for (int i = 0; i < 3; ++i) {
-				String s = stylePrefs[i];
-				styleString.append(s);
-
-				// add in the separator (except on last iteration)
-				if (i != 2) {
-					styleString.append(" " + STYLE_SEPARATOR + " "); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-			}
-		}
-
-		return styleString.toString();
-	}
-
-	/**
-	 * @return org.eclipse.swt.graphics.RGB
-	 * @param anRGBString
-	 *            java.lang.String
-	 */
-	public static RGB toRGB(String anRGBString) {
-		RGB result = null;
-		if (anRGBString.length() > 6 && anRGBString.charAt(0) == '#') {
-			int r = 0;
-			int g = 0;
-			int b = 0;
-			try {
-				r = Integer.valueOf(anRGBString.substring(1, 3), 16).intValue();
-				g = Integer.valueOf(anRGBString.substring(3, 5), 16).intValue();
-				b = Integer.valueOf(anRGBString.substring(5, 7), 16).intValue();
-				result = new RGB(r, g, b);
-			} catch (NumberFormatException nfExc) {
-				Logger.logException("Could not load highlighting preference for color " + anRGBString, nfExc);//$NON-NLS-1$
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * @return java.lang.String
-	 * @param anRGB
-	 *            org.eclipse.swt.graphics.RGB
-	 */
-	public static String toRGBString(RGB anRGB) {
-		if (anRGB == null)
-			return "#000000";//$NON-NLS-1$
-		String red = Integer.toHexString(anRGB.red);
-		while (red.length() < 2)
-			red = "0" + red;//$NON-NLS-1$
-		String green = Integer.toHexString(anRGB.green);
-		while (green.length() < 2)
-			green = "0" + green;//$NON-NLS-1$
-		String blue = Integer.toHexString(anRGB.blue);
-		while (blue.length() < 2)
-			blue = "0" + blue;//$NON-NLS-1$
-		return "#" + red + green + blue;//$NON-NLS-1$
-	}
-
-	/**
-	 * Extracts the foreground (RGB String), background (RGB String), bold
-	 * (boolean String) from the given preference string.
-	 * 
-	 * @param preference
-	 *            should be in the form of Foreground RGB String | Background
-	 *            RGB String | Bold true/false
-	 * @return String[] where String[0] = Foreground RGB String, String[1] =
-	 *         Background RGB String, String[2] = Bold true/false OR null if
-	 *         ran into problems extracting
-	 */
-	public static String[] unpackStylePreferences(String preference) {
-		String[] stylePrefs = null;
-		if (preference != null) {
-			StringTokenizer st = new StringTokenizer(preference, STYLE_SEPARATOR);
-			if (st.countTokens() == 3) {
-				String foreground = st.nextToken().trim();
-				String background = st.nextToken().trim();
-				String bold = st.nextToken().trim();
-
-				stylePrefs = new String[3];
-				stylePrefs[0] = foreground;
-				stylePrefs[1] = background;
-				stylePrefs[2] = bold;
-			}
-		}
-
-		return stylePrefs;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorNames.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorNames.java
deleted file mode 100644
index 8460954..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorNames.java
+++ /dev/null
@@ -1,27 +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.sse.ui.internal.preferences.ui;
-
-
-
-public interface ColorNames {
-	String BACKGROUND = "background"; //$NON-NLS-1$
-	String BOLD = "bold"; //$NON-NLS-1$
-	String COLOR = "color"; //$NON-NLS-1$
-
-	String COLORS = "colors"; //$NON-NLS-1$
-	String FOREGROUND = "foreground"; //$NON-NLS-1$
-	String ITALIC = "italic"; //$NON-NLS-1$
-
-	String NAME = "name"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/EmptyFilePreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/EmptyFilePreferencePage.java
deleted file mode 100644
index 36b9944..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/EmptyFilePreferencePage.java
+++ /dev/null
@@ -1,96 +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
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-package org.eclipse.wst.sse.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.sse.ui.internal.SSEUIMessages;
-
-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 = SSEUIMessages.EmptyFilePreferencePage_0; //$NON-NLS-1$
-		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) {
-			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.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/FilePreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/FilePreferencePage.java
deleted file mode 100644
index c55af89..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/FilePreferencePage.java
+++ /dev/null
@@ -1,132 +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.sse.ui.internal.preferences.ui;
-
-import org.eclipse.jface.preference.PreferencePage;
-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.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.preferences.TabFolderLayout;
-
-public class FilePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
-	private IPreferenceTab[] fTabs = null;
-
-	protected 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_VERTICAL;
-		data.horizontalAlignment = GridData.FILL_HORIZONTAL;
-		composite.setLayoutData(data);
-
-		return composite;
-	}
-
-	protected Control createContents(Composite parent) {
-		Composite composite = createComposite(parent, 1);
-
-		String description = SSEUIMessages.FilePreferencePage_0; //$NON-NLS-1$
-		createLabel(composite, description);
-		createLabel(composite, ""); //$NON-NLS-1$
-
-		TabFolder folder = new TabFolder(composite, SWT.NONE);
-		folder.setLayout(new TabFolderLayout());
-		folder.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-//		TabItem taskItem = new TabItem(folder, SWT.NONE);
-//		IPreferenceTab tasksTab = new TaskTagPreferenceTab();
-//		taskItem.setText(tasksTab.getTitle());
-//		Control taskTags = tasksTab.createContents(folder);
-//		taskItem.setControl(taskTags);
-
-		TabItem translucenceItem = new TabItem(folder, SWT.NONE);
-		IPreferenceTab translucenceTab = new TranslucencyPreferenceTab(this);
-		translucenceItem.setText(translucenceTab.getTitle());
-		Control translucenceControl = translucenceTab.createContents(folder);
-		translucenceItem.setControl(translucenceControl);
-
-		fTabs = new IPreferenceTab[]{/*tasksTab,*/ translucenceTab};
-
-		return composite;
-	}
-
-	protected Label createLabel(Composite parent, String text) {
-		Label label = new Label(parent, SWT.LEFT);
-		label.setText(text);
-
-		//GridData
-		GridData data = new GridData(GridData.FILL);
-		data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_FILL;
-		label.setLayoutData(data);
-
-		return label;
-	}
-
-	public void init(IWorkbench desktop) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.preference.PreferencePage#performApply()
-	 */
-	protected void performApply() {
-		super.performApply();
-		for (int i = 0; i < fTabs.length; i++) {
-			fTabs[i].performApply();
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
-	 */
-	protected void performDefaults() {
-		super.performDefaults();
-		for (int i = 0; i < fTabs.length; i++) {
-			fTabs[i].performDefaults();
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.preference.IPreferencePage#performOk()
-	 */
-	public boolean performOk() {
-		boolean ok = super.performOk();
-		for (int i = 0; i < fTabs.length; i++) {
-			fTabs[i].performOk();
-		}
-		SSECorePlugin.getDefault().savePluginPreferences();
-		return ok;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/IPreferenceTab.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/IPreferenceTab.java
deleted file mode 100644
index bfd411e..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/IPreferenceTab.java
+++ /dev/null
@@ -1,29 +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.sse.ui.internal.preferences.ui;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-public interface IPreferenceTab {
-
-	Control createContents(Composite tabFolder);
-
-	String getTitle();
-
-	void performApply();
-
-	void performDefaults();
-
-	void performOk();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StatusInfo.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StatusInfo.java
deleted file mode 100644
index 7ae5bb4..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StatusInfo.java
+++ /dev/null
@@ -1,202 +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.sse.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.ui.editors.text.EditorsUI;
-
-/**
- * A settable IStatus. Can be an error, warning, info or ok. For error, info
- * and warning states, a message describes the problem.
- * 
- * This class was copied from other StatusInfo classes that are located in
- * internal packages
- */
-class StatusInfo implements IStatus {
-	/** The severity of this status. */
-	private int fSeverity;
-
-	/** The message of this status. */
-	private String fStatusMessage;
-
-	/**
-	 * Creates a status set to OK (no message).
-	 */
-	public StatusInfo() {
-		this(OK, null);
-	}
-
-	/**
-	 * Creates a status with the given severity and message.
-	 * 
-	 * @param severity
-	 *            the severity of this status: ERROR, WARNING, INFO and OK.
-	 * @param message
-	 *            the message of this status. Applies only for ERROR, WARNING
-	 *            and INFO.
-	 */
-	public StatusInfo(int severity, String message) {
-		fStatusMessage = message;
-		fSeverity = severity;
-	}
-
-	/**
-	 * Returns always <code>null</code>.
-	 * 
-	 * @see IStatus#getChildren()
-	 */
-	public IStatus[] getChildren() {
-		return new IStatus[0];
-	}
-
-	/**
-	 * Returns always the error severity.
-	 * 
-	 * @see IStatus#getCode()
-	 */
-	public int getCode() {
-		return fSeverity;
-	}
-
-	/**
-	 * Returns always <code>null</code>.
-	 * 
-	 * @see IStatus#getException()
-	 */
-	public Throwable getException() {
-		return null;
-	}
-
-	/*
-	 * @see IStatus#getMessage()
-	 */
-	public String getMessage() {
-		return fStatusMessage;
-	}
-
-	/*
-	 * @see IStatus#getPlugin()
-	 */
-	public String getPlugin() {
-		return EditorsUI.PLUGIN_ID;
-	}
-
-	/*
-	 * @see IStatus#getSeverity()
-	 */
-	public int getSeverity() {
-		return fSeverity;
-	}
-
-	/**
-	 * Returns whether this status indicates an error.
-	 * 
-	 * @return <code>true</code> if this status has severity
-	 *         {@link IStatus#ERROR}and <code>false</code> otherwise
-	 */
-	public boolean isError() {
-		return fSeverity == IStatus.ERROR;
-	}
-
-	/**
-	 * Returns whether this status indicates an info.
-	 * 
-	 * @return <code>true</code> if this status has severity
-	 *         {@link IStatus#INFO}and <code>false</code> otherwise
-	 */
-	public boolean isInfo() {
-		return fSeverity == IStatus.INFO;
-	}
-
-	/**
-	 * Returns always <code>false</code>.
-	 * 
-	 * @see IStatus#isMultiStatus()
-	 */
-	public boolean isMultiStatus() {
-		return false;
-	}
-
-	/*
-	 * @see org.eclipse.core.runtime.IStatus#isOK()
-	 */
-	public boolean isOK() {
-		return fSeverity == IStatus.OK;
-	}
-
-	/**
-	 * Returns whether this status indicates a warning.
-	 * 
-	 * @return <code>true</code> if this status has severity
-	 *         {@link IStatus#WARNING}and <code>false</code> otherwise
-	 */
-	public boolean isWarning() {
-		return fSeverity == IStatus.WARNING;
-	}
-
-	/*
-	 * @see IStatus#matches(int)
-	 */
-	public boolean matches(int severityMask) {
-		return (fSeverity & severityMask) != 0;
-	}
-
-	/**
-	 * Sets the status to ERROR.
-	 * 
-	 * @param errorMessage
-	 *            the error message which can be an empty string, but not
-	 *            <code>null</code>
-	 */
-	public void setError(String errorMessage) {
-		Assert.isNotNull(errorMessage);
-		fStatusMessage = errorMessage;
-		fSeverity = IStatus.ERROR;
-	}
-
-	/**
-	 * Sets the status to INFO.
-	 * 
-	 * @param infoMessage
-	 *            the info message which can be an empty string, but not
-	 *            <code>null</code>
-	 */
-	public void setInfo(String infoMessage) {
-		Assert.isNotNull(infoMessage);
-		fStatusMessage = infoMessage;
-		fSeverity = IStatus.INFO;
-	}
-
-	/**
-	 * Sets the status to OK.
-	 */
-	public void setOK() {
-		fStatusMessage = null;
-		fSeverity = IStatus.OK;
-	}
-
-	/**
-	 * Sets the status to WARNING.
-	 * 
-	 * @param warningMessage
-	 *            the warning message which can be an empty string, but not
-	 *            <code>null</code>
-	 */
-	public void setWarning(String warningMessage) {
-		Assert.isNotNull(warningMessage);
-		fStatusMessage = warningMessage;
-		fSeverity = IStatus.WARNING;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java
deleted file mode 100644
index 22468d0..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java
+++ /dev/null
@@ -1,449 +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.sse.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.DialogPage;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.preference.PreferencePage;
-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.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-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.List;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-import org.eclipse.wst.sse.ui.internal.preferences.TabFolderLayout;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.eclipse.wst.sse.ui.internal.provisional.preferences.CommonEditorPreferenceNames;
-
-/**
- * Gutted version of JavaEditorPreferencePage
- * 
- * @author pavery
- */
-public class StructuredTextEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-	// vm argument to show folding preference
-	private static boolean showFoldingPreference = false;
-	static {
-		String foldingOn = System.getProperty("org.eclipse.wst.sse.ui.foldingenabled");		//$NON-NLS-1$
-		showFoldingPreference = foldingOn != null;
-	}
-	
-	private ColorEditor fAppearanceColorEditor;
-	private List fAppearanceColorList;
-
-	private final String[][] fAppearanceColorListModel = new String[][]{{SSEUIMessages.StructuredTextEditorPreferencePage_2, EditorPreferenceNames.MATCHING_BRACKETS_COLOR}}; //$NON-NLS-1$
-	private Map fCheckBoxes = new HashMap();
-	private SelectionListener fCheckBoxListener = new SelectionListener() {
-		public void widgetDefaultSelected(SelectionEvent e) {
-		}
-
-		public void widgetSelected(SelectionEvent e) {
-			Button button = (Button) e.widget;
-			fOverlayStore.setValue((String) fCheckBoxes.get(button), button.getSelection());
-		}
-	};
-
-	private Map fColorButtons = new HashMap();
-
-	private ArrayList fNumberFields = new ArrayList();
-	private OverlayPreferenceStore fOverlayStore;
-	/** Button controlling default setting of the selected reference provider. */
-//	 TODO: private field never read locally
-	Button fSetDefaultButton;
-	private IPreferenceTab[] fTabs = null;
-	private Map fTextFields = new HashMap();
-
-	public StructuredTextEditorPreferencePage() {
-		setDescription(SSEUIMessages.StructuredTextEditorPreferencePage_6); //$NON-NLS-1$
-		setPreferenceStore(SSEUIPlugin.getDefault().getPreferenceStore());
-
-		fOverlayStore = new OverlayPreferenceStore(getPreferenceStore(), createOverlayStoreKeys());
-	}
-
-	private Button addCheckBox(Composite parent, String label, String key, int indentation) {
-		Button checkBox = new Button(parent, SWT.CHECK);
-		checkBox.setText(label);
-
-		GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
-		gd.horizontalIndent = indentation;
-		gd.horizontalSpan = 2;
-		checkBox.setLayoutData(gd);
-		checkBox.addSelectionListener(fCheckBoxListener);
-
-		fCheckBoxes.put(checkBox, key);
-
-		return checkBox;
-	}
-
-	/**
-	 * Applies the status to the status line of a dialog page.
-	 */
-	public void applyToStatusLine(DialogPage page, IStatus status) {
-		String message = status.getMessage();
-		switch (status.getSeverity()) {
-			case IStatus.OK :
-				page.setMessage(message, IMessageProvider.NONE);
-				page.setErrorMessage(null);
-				break;
-			case IStatus.WARNING :
-				page.setMessage(message, IMessageProvider.WARNING);
-				page.setErrorMessage(null);
-				break;
-			case IStatus.INFO :
-				page.setMessage(message, IMessageProvider.INFORMATION);
-				page.setErrorMessage(null);
-				break;
-			default :
-				if (message.length() == 0) {
-					message = null;
-				}
-				page.setMessage(null);
-				page.setErrorMessage(message);
-				break;
-		}
-	}
-
-	private Control createAppearancePage(Composite parent) {
-		Composite appearanceComposite = new Composite(parent, SWT.NONE);
-		GridLayout layout = new GridLayout();
-		layout.numColumns = 2;
-		appearanceComposite.setLayout(layout);
-
-		String label = SSEUIMessages.StructuredTextEditorPreferencePage_20; //$NON-NLS-1$
-		addCheckBox(appearanceComposite, label, EditorPreferenceNames.MATCHING_BRACKETS, 0);
-
-		label = SSEUIMessages.StructuredTextEditorPreferencePage_30; //$NON-NLS-1$
-		addCheckBox(appearanceComposite, label, CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS, 0);
-		
-		label = SSEUIMessages.StructuredTextEditorPreferencePage_39;
-		addCheckBox(appearanceComposite, label, EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG, 0);
-
-		if (showFoldingPreference) {
-			label = "Enable folding (work in progress)"; 		//$NON-NLS-1$
-			addCheckBox(appearanceComposite, label, IStructuredTextFoldingProvider.FOLDING_ENABLED, 0);
-		}
-		
-		Label l = new Label(appearanceComposite, SWT.LEFT);
-		GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
-		gd.horizontalSpan = 2;
-		gd.heightHint = convertHeightInCharsToPixels(1) / 2;
-		l.setLayoutData(gd);
-
-		l = new Label(appearanceComposite, SWT.LEFT);
-		l.setText(SSEUIMessages.StructuredTextEditorPreferencePage_23); //$NON-NLS-1$
-		gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
-		gd.horizontalSpan = 2;
-		l.setLayoutData(gd);
-
-		Composite editorComposite = new Composite(appearanceComposite, SWT.NONE);
-		layout = new GridLayout();
-		layout.numColumns = 2;
-		layout.marginHeight = 0;
-		layout.marginWidth = 0;
-		editorComposite.setLayout(layout);
-		gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
-		gd.horizontalSpan = 2;
-		editorComposite.setLayoutData(gd);
-
-		fAppearanceColorList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
-		gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
-		gd.heightHint = convertHeightInCharsToPixels(5);
-		fAppearanceColorList.setLayoutData(gd);
-
-		Composite stylesComposite = new Composite(editorComposite, SWT.NONE);
-		layout = new GridLayout();
-		layout.marginHeight = 0;
-		layout.marginWidth = 0;
-		layout.numColumns = 2;
-		stylesComposite.setLayout(layout);
-		stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-		l = new Label(stylesComposite, SWT.LEFT);
-		// needs to be made final so label can be set in
-		// foregroundcolorbutton's acc listener
-		final String buttonLabel = SSEUIMessages.StructuredTextEditorPreferencePage_24; //$NON-NLS-1$ 
-		l.setText(buttonLabel);
-		gd = new GridData();
-		gd.horizontalAlignment = GridData.BEGINNING;
-		l.setLayoutData(gd);
-
-		fAppearanceColorEditor = new ColorEditor(stylesComposite);
-		Button foregroundColorButton = fAppearanceColorEditor.getButton();
-		gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.horizontalAlignment = GridData.BEGINNING;
-		foregroundColorButton.setLayoutData(gd);
-
-		fAppearanceColorList.addSelectionListener(new SelectionListener() {
-			public void widgetDefaultSelected(SelectionEvent e) {
-				// do nothing
-			}
-
-			public void widgetSelected(SelectionEvent e) {
-				handleAppearanceColorListSelection();
-			}
-		});
-		foregroundColorButton.addSelectionListener(new SelectionListener() {
-			public void widgetDefaultSelected(SelectionEvent e) {
-				// do nothing
-			}
-
-			public void widgetSelected(SelectionEvent e) {
-				int i = fAppearanceColorList.getSelectionIndex();
-				String key = fAppearanceColorListModel[i][1];
-
-				PreferenceConverter.setValue(fOverlayStore, key, fAppearanceColorEditor.getColorValue());
-			}
-		});
-
-		// bug2541 - associate color label to button's label field
-		foregroundColorButton.getAccessible().addAccessibleListener(new AccessibleAdapter() {
-			public void getName(AccessibleEvent e) {
-				if (e.childID == ACC.CHILDID_SELF)
-					e.result = buttonLabel;
-			}
-		});
-		
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(appearanceComposite, IHelpContextIds.PREFSTE_APPEARANCE_HELPID);
-		return appearanceComposite;
-	}
-
-	/*
-	 * @see PreferencePage#createContents(Composite)
-	 */
-	protected Control createContents(Composite parent) {
-		// need to create tabs before loading/starting overlaystore in case
-		// tabs also add values
-		IPreferenceTab hoversTab = new TextHoverPreferenceTab(this, fOverlayStore);
-
-		fOverlayStore.load();
-		fOverlayStore.start();
-
-		TabFolder folder = new TabFolder(parent, SWT.NONE);
-		folder.setLayout(new TabFolderLayout());
-		folder.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-		TabItem item = new TabItem(folder, SWT.NONE);
-		item.setText(SSEUIMessages.StructuredTextEditorPreferencePage_0); //$NON-NLS-1$
-		item.setControl(createAppearancePage(folder));
-
-		item = new TabItem(folder, SWT.NONE);
-		item.setText(hoversTab.getTitle());
-		item.setControl(hoversTab.createContents(folder));
-
-		fTabs = new IPreferenceTab[]{hoversTab};
-
-		initialize();
-
-		Dialog.applyDialogFont(folder);
-		return folder;
-	}
-
-	/*
-	 * @see PreferencePage#createControl(Composite)
-	 */
-	public void createControl(Composite parent) {
-		super.createControl(parent);
-		//WorkbenchHelp.setHelp(getControl(),
-		// IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE);
-	}
-
-	private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() {
-		ArrayList overlayKeys = new ArrayList();
-
-		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, EditorPreferenceNames.MATCHING_BRACKETS_COLOR));
-		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, EditorPreferenceNames.MATCHING_BRACKETS));
-		
-		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS));
-		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG));
-		
-		if (showFoldingPreference)
-			overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IStructuredTextFoldingProvider.FOLDING_ENABLED));
-		
-		OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
-		overlayKeys.toArray(keys);
-		return keys;
-	}
-
-	/*
-	 * @see DialogPage#dispose()
-	 */
-	public void dispose() {
-		if (fOverlayStore != null) {
-			fOverlayStore.stop();
-			fOverlayStore = null;
-		}
-
-		super.dispose();
-	}
-
-	private void handleAppearanceColorListSelection() {
-		int i = fAppearanceColorList.getSelectionIndex();
-		String key = fAppearanceColorListModel[i][1];
-		RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
-		fAppearanceColorEditor.setColorValue(rgb);
-	}
-
-	/*
-	 * @see IWorkbenchPreferencePage#init()
-	 */
-	public void init(IWorkbench workbench) {
-		// nothing to do
-	}
-
-	private void initialize() {
-		initializeFields();
-
-		for (int i = 0; i < fAppearanceColorListModel.length; i++)
-			fAppearanceColorList.add(fAppearanceColorListModel[i][0]);
-		fAppearanceColorList.getDisplay().asyncExec(new Runnable() {
-			public void run() {
-				if (fAppearanceColorList != null && !fAppearanceColorList.isDisposed()) {
-					fAppearanceColorList.select(0);
-					handleAppearanceColorListSelection();
-				}
-			}
-		});
-	}
-
-	private void initializeFields() {
-		Iterator e = fColorButtons.keySet().iterator();
-		while (e.hasNext()) {
-			ColorEditor c = (ColorEditor) e.next();
-			String key = (String) fColorButtons.get(c);
-			RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
-			c.setColorValue(rgb);
-		}
-
-		e = fCheckBoxes.keySet().iterator();
-		while (e.hasNext()) {
-			Button b = (Button) e.next();
-			String key = (String) fCheckBoxes.get(b);
-			b.setSelection(fOverlayStore.getBoolean(key));
-		}
-
-		e = fTextFields.keySet().iterator();
-		while (e.hasNext()) {
-			Text t = (Text) e.next();
-			String key = (String) fTextFields.get(t);
-			t.setText(fOverlayStore.getString(key));
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.preference.PreferencePage#performApply()
-	 */
-	protected void performApply() {
-		for (int i = 0; i < fTabs.length; i++) {
-			fTabs[i].performApply();
-		}
-		super.performApply();
-	}
-
-	/*
-	 * @see PreferencePage#performDefaults()
-	 */
-	protected void performDefaults() {
-		fOverlayStore.loadDefaults();
-
-		initializeFields();
-
-		handleAppearanceColorListSelection();
-
-		for (int i = 0; i < fTabs.length; i++) {
-			fTabs[i].performDefaults();
-		}
-
-		super.performDefaults();
-
-		// there is currently no need for a viewer
-		//		fPreviewViewer.invalidateTextPresentation();
-	}
-
-	/*
-	 * @see PreferencePage#performOk()
-	 */
-	public boolean performOk() {
-		for (int i = 0; i < fTabs.length; i++) {
-			fTabs[i].performOk();
-		}
-
-		fOverlayStore.propagate();
-		SSEUIPlugin.getDefault().savePluginPreferences();
-
-		// tab width is also a model-side preference so need to set it
-		// TODO need to handle tab width for formatter somehow
-//		int tabWidth = getPreferenceStore().getInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH);
-//		ModelPlugin.getDefault().getPluginPreferences().setValue(CommonModelPreferenceNames.TAB_WIDTH, tabWidth);
-//		ModelPlugin.getDefault().savePluginPreferences();
-
-		return true;
-	}
-
-	void updateStatus(IStatus status) {
-		if (!status.matches(IStatus.ERROR)) {
-			for (int i = 0; i < fNumberFields.size(); i++) {
-				Text text = (Text) fNumberFields.get(i);
-				IStatus s = validatePositiveNumber(text.getText());
-				status = s.getSeverity() > status.getSeverity() ? s : status;
-			}
-		}
-
-		setValid(!status.matches(IStatus.ERROR));
-		applyToStatusLine(this, status);
-	}
-
-	private IStatus validatePositiveNumber(String number) {
-		StatusInfo status = new StatusInfo();
-		if (number.length() == 0) {
-			status.setError(SSEUIMessages.StructuredTextEditorPreferencePage_37);
-		} else {
-			try {
-				int value = Integer.parseInt(number);
-				if (value < 0)
-					status.setError(number + SSEUIMessages.StructuredTextEditorPreferencePage_38);
-			} catch (NumberFormatException e) {
-				status.setError(number + SSEUIMessages.StructuredTextEditorPreferencePage_38);
-			}
-		}
-		return status;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StyledTextColorPicker.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StyledTextColorPicker.java
deleted file mode 100644
index 427998d..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StyledTextColorPicker.java
+++ /dev/null
@@ -1,946 +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.sse.ui.internal.preferences.ui;
-
-import java.io.CharArrayReader;
-import java.text.Collator;
-import java.util.Dictionary;
-import java.util.List;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.ACC;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlEvent;
-import org.eclipse.swt.accessibility.AccessibleControlListener;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-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.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.Font;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.PaletteData;
-import org.eclipse.swt.graphics.Point;
-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.ColorDialog;
-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.wst.sse.core.internal.ltk.parser.RegionParser;
-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.util.Debug;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.w3c.dom.Node;
-
-/**
- * This class is configurable by setting 3 properties: 1) an array of Strings
- * as the styleNames; one unique entry for every style type meant to be
- * configurable by the user 2) a Dictionary of descriptions, mapping the
- * styleNames to unique descriptions - meant for use within the selection
- * ComboBox TODO (pa) this should probably be working off document partitions
- * now (2.1+) 3) a Dictionary mapping parsed ITextRegion contexts (strings) to
- * the locally defined styleNames
- *  
- */
-public class StyledTextColorPicker extends Composite {
-	protected class DescriptionSorter extends org.eclipse.wst.sse.ui.internal.util.Sorter {
-		Collator collator = Collator.getInstance();
-
-		public boolean compare(Object elementOne, Object elementTwo) {
-			/**
-			 * Returns true if elementTwo is 'greater than' elementOne This is
-			 * the 'ordering' method of the sort operation. Each subclass
-			 * overides this method with the particular implementation of the
-			 * 'greater than' concept for the objects being sorted.
-			 */
-			return (collator.compare(elementOne.toString(), elementTwo.toString())) < 0;
-		}
-	}
-
-	public static final String BACKGROUND = "background"; //$NON-NLS-1$
-	public static final String BOLD = "bold"; //$NON-NLS-1$
-	public static final String COLOR = "color"; //$NON-NLS-1$
-
-	// names for preference elements ... non-NLS
-	public static final String FOREGROUND = "foreground"; //$NON-NLS-1$
-	public static final String ITALIC = "italic"; //$NON-NLS-1$
-	public static final String NAME = "name"; //$NON-NLS-1$
-
-	protected static final boolean showItalic = false;
-	protected AccessibleControlListener backgroundAccListener = new AccessibleControlAdapter() {
-		/**
-		 * @see org.eclipse.swt.accessibility.AccessibleControlAdapter#getValue(AccessibleControlEvent)
-		 */
-		public void getValue(AccessibleControlEvent e) {
-			if (e.childID == ACC.CHILDID_SELF) {
-				e.result = getColorButtonValue(fBackground);
-			}
-		}
-	};
-	protected SelectionListener buttonListener = new SelectionListener() {
-
-		public void widgetDefaultSelected(SelectionEvent e) {
-			widgetSelected(e);
-		}
-
-		public void widgetSelected(SelectionEvent e) {
-			String namedStyle = getStyleName(fStyleCombo.getItem(fStyleCombo.getSelectionIndex()));
-			if (namedStyle == null)
-				return;
-			if (e.widget == fForeground) {
-				// get current (newly old) style
-				String prefString = getPreferenceStore().getString(getPreferenceKey(namedStyle));
-				String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
-				if (stylePrefs != null) {
-					String oldValue = stylePrefs[0];
-					// open color dialog to get new color
-					String newValue = changeColor(oldValue);
-
-					if (!newValue.equals(oldValue)) {
-						stylePrefs[0] = newValue;
-						String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
-						getPreferenceStore().setValue(getPreferenceKey(namedStyle), newPrefString);
-						refresh();
-					}
-				}
-			} else if (e.widget == fBackground) {
-				// get current (newly old) style
-				String prefString = getPreferenceStore().getString(getPreferenceKey(namedStyle));
-				String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
-				if (stylePrefs != null) {
-					String oldValue = stylePrefs[1];
-					// open color dialog to get new color
-					String newValue = changeColor(oldValue);
-
-					if (!newValue.equals(oldValue)) {
-						stylePrefs[1] = newValue;
-						String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
-						getPreferenceStore().setValue(getPreferenceKey(namedStyle), newPrefString);
-						refresh();
-					}
-				}
-			} else if (e.widget == fBold) {
-				// get current (newly old) style
-				String prefString = getPreferenceStore().getString(getPreferenceKey(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);
-						getPreferenceStore().setValue(getPreferenceKey(namedStyle), newPrefString);
-						refresh();
-					}
-				}
-			} else if (showItalic && e.widget == fItalic) {
-				// get current (newly old) style
-				String prefString = getPreferenceStore().getString(getPreferenceKey(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);
-						getPreferenceStore().setValue(getPreferenceKey(namedStyle), newPrefString);
-						refresh();
-					}
-				}
-			} else if (e.widget == fClearStyle) {
-				getPreferenceStore().setToDefault(getPreferenceKey(namedStyle));
-				refresh();
-			}
-		}
-	};
-
-	protected SelectionListener comboListener = new SelectionListener() {
-
-		public void widgetDefaultSelected(SelectionEvent e) {
-			widgetSelected(e);
-		}
-
-		public void widgetSelected(SelectionEvent e) {
-			int selectedIndex = fStyleCombo.getSelectionIndex();
-			String description = selectedIndex >= 0 ? fStyleCombo.getItem(selectedIndex) : null;
-			activate(getStyleName(description));
-		}
-	};
-	protected Button fBackground;
-	protected Label fBackgroundLabel;
-	protected Button fBold;
-	protected Button fClearStyle;
-	// Dictionary mapping the ITextRegion types above to color names, which
-	// are, in turn, attributes
-	protected Dictionary fContextStyleMap = null;
-	protected Color fDefaultBackground = getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
-
-	protected Color fDefaultForeground = getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
-	// Dictionary mapping the ITextRegion types above to display strings, for
-	// use in the combo box
-	protected Dictionary fDescriptions = null;
-	protected Button fForeground;
-	protected Label fForegroundLabel;
-//	private String fGeneratorKey;
-	protected String fInput = ""; //$NON-NLS-1$
-	protected Button fItalic;
-
-	private IStructuredDocumentRegion fNodes = null;
-	// defect 200764 - ACC:display values for color buttons
-	protected AccessibleControlListener foregroundAccListener = new AccessibleControlAdapter() {
-		/**
-		 * @see org.eclipse.swt.accessibility.AccessibleControlAdapter#getValue(AccessibleControlEvent)
-		 */
-		public void getValue(AccessibleControlEvent e) {
-			if (e.childID == ACC.CHILDID_SELF) {
-				e.result = getColorButtonValue(fForeground);
-			}
-		}
-	};
-	// A RegionParser, which will turn the input into
-	// IStructuredDocumentRegion(s) and Regions
-	protected RegionParser fParser = null;
-
-	private IPreferenceStore fPreferenceStore;
-	protected Combo fStyleCombo = null;
-	// The list of supported ITextRegion types [Strings]
-	protected List fStyleList = null;
-
-	// controls in picker
-	protected StyledText fText = null;
-
-	/**
-	 * XMLTextColorPicker constructor comment.
-	 * 
-	 * @param parent
-	 *            org.eclipse.swt.widgets.Composite
-	 * @param style
-	 *            int
-	 */
-	public StyledTextColorPicker(Composite parent, int style) {
-		super(parent, style);
-		//GridLayout
-		GridLayout layout = new GridLayout();
-		layout.numColumns = 1;
-		setLayout(layout);
-		createControls(this);
-	}
-
-	// activate controls based on the given local color type
-	protected void activate(String namedStyle) {
-		if (namedStyle == null) {
-			fForeground.setEnabled(false);
-			fBackground.setEnabled(false);
-			fClearStyle.setEnabled(false);
-			fBold.setEnabled(false);
-			if (showItalic)
-				fItalic.setEnabled(false);
-			fForegroundLabel.setEnabled(false);
-			fBackgroundLabel.setEnabled(false);
-		} 
-		else {		
-			fForeground.setEnabled(true);
-			fBackground.setEnabled(true);
-			fClearStyle.setEnabled(true);
-			fBold.setEnabled(true);
-			if (showItalic)
-				fItalic.setEnabled(true);
-			fForegroundLabel.setEnabled(true);
-			fBackgroundLabel.setEnabled(true);
-			
-		}
-		TextAttribute attribute = getAttribute(namedStyle);
-		Color color = attribute.getForeground();
-		if (color == null) {
-			color = fDefaultForeground;
-		}
-		if (fForeground.getSize().x > 0 && fForeground.getSize().y > 0 && (fForeground.getImage() == null || fForeground.getImage().getImageData() == null || fForeground.getImage().getImageData().getRGBs() == null || fForeground.getImage().getImageData().getRGBs().length < 1 || !fForeground.getImage().getImageData().getRGBs()[0].equals(color.getRGB()))) {
-			if (fForeground.getImage() != null)
-				fForeground.getImage().dispose();
-			Image foreground = new Image(getDisplay(), new ImageData(fForeground.getSize().x, fForeground.getSize().y, 1, new PaletteData(new RGB[]{color.getRGB()})));
-			fForeground.setImage(foreground);
-		}
-		color = attribute.getBackground();
-		if (color == null) {
-			color = fDefaultBackground;
-		}
-		if (fBackground.getSize().x > 0 && fBackground.getSize().y > 0 && (fBackground.getImage() == null || fBackground.getImage().getImageData() == null || fBackground.getImage().getImageData().getRGBs() == null || fBackground.getImage().getImageData().getRGBs().length < 1 || !fBackground.getImage().getImageData().getRGBs()[0].equals(color.getRGB()))) {
-			if (fBackground.getImage() != null)
-				fBackground.getImage().dispose();
-			Image background = new Image(getDisplay(), new ImageData(fBackground.getSize().x, fBackground.getSize().y, 1, new PaletteData(new RGB[]{color.getRGB()})));
-			fBackground.setImage(background);
-		}
-		fBold.setSelection((attribute.getStyle() & SWT.BOLD) != 0);
-		if (showItalic)
-			fItalic.setSelection((attribute.getStyle() & SWT.ITALIC) != 0);
-	}
-
-	protected void applyStyles() {
-		if (fText == null || fText.isDisposed() || fInput == null || fInput.length() == 0)
-			return;
-		//		List regions = fParser.getRegions();
-		IStructuredDocumentRegion node = fNodes;
-		while (node != null) {
-			ITextRegionList regions = node.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) getContextStyleMap().get(currentRegion.getType());
-				if (namedStyle == null)
-					continue;
-				TextAttribute attribute = getAttribute(namedStyle);
-				if (attribute == null)
-					continue;
-				StyleRange style = new StyleRange(node.getStartOffset(currentRegion), currentRegion.getLength(), attribute.getForeground(), attribute.getBackground(), attribute.getStyle());
-				fText.setStyleRange(style);
-			}
-			node = node.getNext();
-		}
-	}
-
-	private RGB changeColor(RGB startValue) {
-		ColorDialog colorDlg = new ColorDialog(getShell());
-		if (startValue != null)
-			colorDlg.setRGB(startValue);
-		if(colorDlg.getText() == null || colorDlg.getText().length() == 0)
-			colorDlg.setText(SSEUIMessages.StyledTextColorPicker_0);
-		colorDlg.open();
-		RGB newRGB = colorDlg.getRGB();
-		if (newRGB != null)
-			return newRGB;
-		return startValue;
-	}
-
-	private String changeColor(String rgb) {
-		String changedColor = "null"; //$NON-NLS-1$
-
-		RGB newColor = changeColor(ColorHelper.toRGB(rgb));
-		// null check to see if using default value
-		if (newColor != null)
-			changedColor = ColorHelper.toRGBString(newColor);
-		return changedColor;
-	}
-
-	protected void close() {
-	}
-
-	/**
-	 * Determines size of color button copied from
-	 * org.eclipse.jdt.internal.ui.preferences.ColorEditor 1 modification -
-	 * added 4 to final height
-	 */
-	private Point computeImageSize(Control window) {
-		GC gc = new GC(window);
-		Font f = JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT);
-		gc.setFont(f);
-		int height = gc.getFontMetrics().getHeight();
-		gc.dispose();
-		Point p = new Point(height * 3 - 6, height + 4);
-		return p;
-	}
-
-	/**
-	 * Creates an new checkbox instance and sets the default layout data.
-	 * 
-	 * @param group
-	 *            the composite in which to create the checkbox
-	 * @param label
-	 *            the string to set into the checkbox
-	 * @return the new checkbox
-	 */
-	private Button createCheckBox(Composite group, String label) {
-		Button button = new Button(group, SWT.CHECK | SWT.CENTER);
-		if (label != null)
-			button.setText(label);
-		GridData data = new GridData(GridData.FILL_BOTH);
-		data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END;
-		//	data.verticalAlignment = GridData.VERTICAL_ALIGN_FILL;
-		button.setLayoutData(data);
-		return button;
-	}
-
-	private Combo createCombo(Composite parent, String[] labels, int selectedItem) {
-		Combo combo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
-		combo.setItems(labels);
-		if (selectedItem >= 0)
-			combo.select(selectedItem);
-		GridData data = new GridData(GridData.FILL_HORIZONTAL);
-		data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_FILL;
-		combo.setLayoutData(data);
-		return combo;
-	}
-
-	/**
-	 * 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.horizontalSpacing = 5;
-		layout.makeColumnsEqualWidth = false;
-		composite.setLayout(layout);
-		//GridData
-		GridData data = new GridData(GridData.FILL_VERTICAL);
-		data.grabExcessVerticalSpace = false;
-		data.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
-		composite.setLayoutData(data);
-		return composite;
-	}
-
-	protected void createControls(Composite parent) {
-		Composite styleRow = createComposite(parent, 3);
-		// row 1 - content type label, combo box, restore defaults
-		createLabel(styleRow, SSEUIMessages.Content_type__UI_); //$NON-NLS-1$ = "Content type:"
-		// Contexts combo box
-		fStyleCombo = createCombo(styleRow, new String[0], -1);
-		fClearStyle = createPushButton(styleRow, SSEUIMessages.Restore_Default_UI_); //$NON-NLS-1$ = "Restore Default"
-		Composite styleRow2;
-		if (showItalic)
-			styleRow2 = createComposite(parent, 7);
-		else
-			styleRow2 = createComposite(parent, 6);
-		// row 2 - foreground label, button, background label, button, bold,
-		// italics?
-		fForegroundLabel = createLabel(styleRow2, SSEUIMessages.Foreground_UI_); //$NON-NLS-1$ = "Foreground"
-		fForeground = createPushButton(styleRow2, ""); //$NON-NLS-1$
-		setAccessible(fForeground, fForegroundLabel.getText());
-		fForeground.getAccessible().addAccessibleControlListener(foregroundAccListener); // defect
-		// 200764
-		// -
-		// ACC:display
-		// values
-		// for
-		// color
-		// buttons
-		Point buttonSize = computeImageSize(parent);
-		((GridData) fForeground.getLayoutData()).widthHint = buttonSize.x;
-		((GridData) fForeground.getLayoutData()).heightHint = buttonSize.y;
-		fBackgroundLabel = createLabel(styleRow2, SSEUIMessages.Background_UI_); //$NON-NLS-1$ = "Background"
-		fBackground = createPushButton(styleRow2, ""); //$NON-NLS-1$
-		setAccessible(fBackground, fBackgroundLabel.getText());
-		fBackground.getAccessible().addAccessibleControlListener(backgroundAccListener); // defect
-		// 200764
-		// -
-		// ACC:display
-		// values
-		// for
-		// color
-		// buttons
-		((GridData) fBackground.getLayoutData()).widthHint = buttonSize.x;
-		((GridData) fBackground.getLayoutData()).heightHint = buttonSize.y;
-		createLabel(styleRow2, ""); //$NON-NLS-1$
-		fBold = createCheckBox(styleRow2, SSEUIMessages.Bold_UI_);
-		if (showItalic)
-			fItalic = createCheckBox(styleRow2, SSEUIMessages.Italics_UI);
-		//		// Defaults checkbox
-		fForeground.setEnabled(false);
-		fBackground.setEnabled(false);
-		fClearStyle.setEnabled(false);
-		fBold.setEnabled(false);
-		if (showItalic)
-			fItalic.setEnabled(false);
-		fForegroundLabel.setEnabled(false);
-		fBackgroundLabel.setEnabled(false);
-		Composite sample = createComposite(parent, 1);
-		createLabel(sample, SSEUIMessages.Sample_text__UI_); //$NON-NLS-1$ = "&Sample text:"
-		fText = new StyledText(sample, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER | SWT.READ_ONLY);
-		GridData data = new GridData(GridData.FILL_BOTH);
-		fText.setLayoutData(data);
-		fText.setEditable(false);
-		fText.setBackground(fDefaultBackground);
-		fText.setFont(JFaceResources.getTextFont());
-		fText.addKeyListener(getTextKeyListener());
-		fText.addSelectionListener(getTextSelectionListener());
-		fText.addMouseListener(getTextMouseListener());
-		fText.addTraverseListener(getTraverseListener()); // defect 220377 -
-		// Provide tab
-		// traversal for
-		// fText widget
-		setAccessible(fText, SSEUIMessages.Sample_text__UI_); //$NON-NLS-1$ = "&Sample text:"
-		fForeground.addSelectionListener(buttonListener);
-		fBackground.addSelectionListener(buttonListener);
-		fClearStyle.addSelectionListener(buttonListener);
-		fBold.addSelectionListener(buttonListener);
-		if (showItalic)
-			fItalic.addSelectionListener(buttonListener);
-		fStyleCombo.addSelectionListener(comboListener);
-	}
-
-	/**
-	 * Utility method that creates a label instance and sets the default
-	 * layout data.
-	 */
-	private Label createLabel(Composite parent, String text) {
-		Label label = new Label(parent, SWT.LEFT);
-		label.setText(text);
-		GridData data = new GridData();
-		data.horizontalAlignment = GridData.FILL;
-		label.setLayoutData(data);
-		return label;
-	}
-
-	private Button createPushButton(Composite parent, String label) {
-		Button button = new Button(parent, SWT.PUSH);
-		button.setText(label);
-		GridData data = new GridData(GridData.FILL_BOTH);
-		//	data.horizontalAlignment = GridData.FILL;
-		button.setLayoutData(data);
-		return button;
-	}
-
-	protected TextAttribute getAttribute(String namedStyle) {
-		TextAttribute ta = new TextAttribute(getDefaultForeground(), getDefaultBackground(), SWT.NORMAL);
-
-		if (namedStyle != null && getPreferenceStore() != null) {
-			String prefString = getPreferenceStore().getString(getPreferenceKey(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;
-				boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
-				if (bold)
-					fontModifier = fontModifier | SWT.BOLD;
-
-				if (showItalic) {
-					boolean italic = Boolean.valueOf(stylePrefs[3]).booleanValue();
-					if (italic)
-						fontModifier = fontModifier | SWT.ITALIC;
-				}
-
-				ta = new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, fontModifier);
-			}
-		}
-		return ta;
-	}
-
-	// defect 200764 - ACC:display values for color buttons
-	/**
-	 * @return String - color Button b's current RBG value
-	 */
-	private String getColorButtonValue(Button b) {
-		if ((b == null) || (b.getImage() == null) || (b.getImage().getImageData() == null) || (b.getImage().getImageData().getRGBs() == null) || (b.getImage().getImageData().getRGBs()[0] == null))
-			return null;
-		String val = b.getImage().getImageData().getRGBs()[0].toString();
-		return val;
-	}
-
-	/**
-	 * @deprecated use getPreferenceStore instead left for legacy clients,
-	 *             delete by WTP M4
-	 */
-	public Node getColorsNode() {
-		//return fColorsNode;
-		return null;
-	}
-
-	/**
-	 * @return java.util.Dictionary
-	 */
-	public Dictionary getContextStyleMap() {
-		return fContextStyleMap;
-	}
-
-	/**
-	 * @return org.eclipse.swt.graphics.Color
-	 */
-	public Color getDefaultBackground() {
-		return fDefaultBackground;
-	}
-
-	/**
-	 * @return org.eclipse.swt.graphics.Color
-	 */
-	public Color getDefaultForeground() {
-		return fDefaultForeground;
-	}
-
-	/**
-	 * @return java.util.Dictionary
-	 */
-	public Dictionary getDescriptions() {
-		return fDescriptions;
-	}
-
-	public Font getFont() {
-		return fText.getFont();
-	}
-
-	protected String getNamedStyleAtOffset(int offset) {
-		// ensure the offset is clean
-		if (offset >= fInput.length())
-			return getNamedStyleAtOffset(fInput.length() - 1);
-		else if (offset < 0)
-			return getNamedStyleAtOffset(0);
-		// find the ITextRegion at this offset
-		if (fNodes == null)
-			return null;
-		IStructuredDocumentRegion aNode = fNodes;
-		while (aNode != null && !aNode.containsOffset(offset))
-			aNode = aNode.getNext();
-		if (aNode != null) {
-			// find the ITextRegion's Context at this offset
-			ITextRegion interest = aNode.getRegionAtCharacterOffset(offset);
-			if (interest == null)
-				return null;
-			if (offset > aNode.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) getContextStyleMap().get(regionContext);
-			if (namedStyle != null) {
-				return namedStyle;
-			}
-		}
-		return null;
-	}
-
-
-	public RegionParser getParser() {
-		return fParser;
-	}
-
-	/**
-	 * @deprecated just key key (no need for generator)
-	 */
-	private String getPreferenceKey(String key) {
-		String newKey = key;
-//		if (fGeneratorKey != null) {
-//			newKey = PreferenceKeyGenerator.generateKey(key, fGeneratorKey);
-//		}
-		return newKey;
-	}
-
-	private IPreferenceStore getPreferenceStore() {
-		return fPreferenceStore;
-	}
-
-	/**
-	 * @return String[]
-	 */
-	public List getStyleList() {
-		return fStyleList;
-	}
-
-	private String getStyleName(String description) {
-		if (description == null)
-			return null;
-		String styleName = null;
-		java.util.Enumeration keys = getDescriptions().keys();
-		while (keys.hasMoreElements()) {
-			String test = keys.nextElement().toString();
-			if (getDescriptions().get(test).equals(description)) {
-				styleName = test;
-				break;
-			}
-		}
-		return styleName;
-	}
-
-	public String getText() {
-		return fInput;
-	}
-
-	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);
-				}
-			}
-
-// Commented out when moving to RC2 to remove "unused" error/warning			
-//			public void widgetDoubleSelected(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);
-				}
-			}
-		};
-	}
-
-	// defect 220377 - Provide tab traversal for fText widget
-	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;
-				}
-			}
-		};
-	}
-
-	// refresh the GUI after a color change
-	public void refresh() {
-		fText.setRedraw(false);
-		int selectedIndex = fStyleCombo.getSelectionIndex();
-		String description = selectedIndex >= 0 ? fStyleCombo.getItem(selectedIndex) : null;
-		activate(getStyleName(description));
-		// update Font
-		fText.setFont(JFaceResources.getTextFont());
-		// reapplyStyles
-		applyStyles();
-		fText.setRedraw(true);
-	}
-
-	public void releasePickerResources() {
-		if (fForeground != null && !fForeground.isDisposed() && fForeground.getImage() != null)
-			fForeground.getImage().dispose();
-		if (fBackground != null && !fBackground.isDisposed() && fBackground.getImage() != null)
-			fBackground.getImage().dispose();
-	}
-
-	private void selectColorAtOffset(int offset) {
-		String namedStyle = getNamedStyleAtOffset(offset);
-		if (namedStyle == null) {
-			fStyleCombo.deselectAll();
-			activate(null);
-			return;
-		}
-		String description = (String) getDescriptions().get(namedStyle);
-		if (description == null)
-			return;
-		int itemCount = fStyleCombo.getItemCount();
-		for (int i = 0; i < itemCount; i++) {
-			if (fStyleCombo.getItem(i).equals(description)) {
-				fStyleCombo.select(i);
-				break;
-			}
-		}
-		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;
-			}
-		});
-	}
-
-	/**
-	 * @deprecated use setPreferenceStore instead left for legacy clients,
-	 *             delete by WTP M4
-	 */
-	public void setColorsNode(Node newColorsNode) {
-		//fColorsNode = newColorsNode;
-	}
-
-	/**
-	 * @param newContextStyleMap
-	 *            java.util.Dictionary
-	 */
-	public void setContextStyleMap(Dictionary newContextStyleMap) {
-		fContextStyleMap = newContextStyleMap;
-	}
-
-	/**
-	 * @param newDefaultBackground
-	 *            org.eclipse.swt.graphics.Color
-	 */
-	public void setDefaultBackground(Color newDefaultBackground) {
-		fDefaultBackground = newDefaultBackground;
-	}
-
-	/**
-	 * @deprecated use setPreferenceStore instead left for legacy clients,
-	 *             delete by WTP M4
-	 */
-	public void setDefaultColorsNode(Node newDefaultColorsNode) {
-		//fDefaultColorsNode = newDefaultColorsNode;
-	}
-
-	/**
-	 * @param newDefaultForeground
-	 *            org.eclipse.swt.graphics.Color
-	 */
-	public void setDefaultForeground(Color newDefaultForeground) {
-		fDefaultForeground = newDefaultForeground;
-	}
-
-	/**
-	 * @param newDescriptions
-	 *            java.util.Dictionary
-	 */
-	public void setDescriptions(Dictionary newDescriptions) {
-		fDescriptions = newDescriptions;
-		updateStyleList();
-	}
-
-	public void setFont(Font font) {
-		fText.setFont(font);
-		fText.redraw();
-	}
-
-	/**
-	 * @deprecated generator key should no longer be needed
-	 */
-	public void setGeneratorKey(String key) {
-//		fGeneratorKey = key;
-	}
-
-	/**
-	 * @param newParser
-	 */
-	public void setParser(RegionParser newParser) {
-		fParser = newParser;
-	}
-
-	public void setPreferenceStore(IPreferenceStore store) {
-		fPreferenceStore = store;
-	}
-
-	/**
-	 * @param newStyleList
-	 *            String[]
-	 */
-	public void setStyleList(List newStyleList) {
-		fStyleList = newStyleList;
-		updateStyleList();
-	}
-
-	public void setText(String s) {
-		fInput = s;
-		getParser().reset(new CharArrayReader(fInput.toCharArray()));
-		fNodes = getParser().getDocumentRegions();
-		if (Debug.displayInfo)
-			System.out.println("Length of input: " //$NON-NLS-1$
-						//$NON-NLS-1$
-						+ s.length() + ", " //$NON-NLS-1$
-						+ getParser().getRegions().size() + " regions."); //$NON-NLS-1$
-		if (fText != null)
-			fText.setText(s);
-		applyStyles();
-	}
-
-
-
-	/**
-	 * @return org.eclipse.swt.graphics.RGB
-	 * @param anRGBString
-	 *            java.lang.String
-	 * @param defaultRGB
-	 *            org.eclipse.swt.graphics.RGB
-	 */
-	// TODO: never used
-	 RGB toRGB(String anRGBString, RGB defaultRGB) {
-		RGB result = ColorHelper.toRGB(anRGBString);
-		if (result == null)
-			return defaultRGB;
-		return result;
-	}
-
-	private void updateStyleList() {
-		if (fStyleList == null || fDescriptions == null)
-			return;
-		String[] descriptions = new String[fStyleList.size()];
-		for (int i = 0; i < fStyleList.size(); i++) {
-			if (fStyleList.get(i) != null)
-				descriptions[i] = (String) getDescriptions().get(fStyleList.get(i));
-			else
-				descriptions[i] = (String) fStyleList.get(i);
-		}
-		Object[] sortedObjects = new DescriptionSorter().sort(descriptions);
-		String[] sortedDescriptions = new String[descriptions.length];
-		for (int i = 0; i < descriptions.length; i++) {
-			sortedDescriptions[i] = sortedObjects[i].toString();
-		}
-		fStyleCombo.setItems(sortedDescriptions);
-		fStyleCombo.select(0); //defect 219855 - initially select first item
-		// in comboBox
-		//		fStyleCombo.deselectAll();
-	}
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TextHoverPreferenceTab.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TextHoverPreferenceTab.java
deleted file mode 100644
index 009239b..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TextHoverPreferenceTab.java
+++ /dev/null
@@ -1,453 +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.sse.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-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.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager.TextHoverDescriptor;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-/**
- * Preference tab for Structured text editor hover help preferences
- * 
- * @author amywu
- */
-public class TextHoverPreferenceTab extends AbstractPreferenceTab {
-
-	private class InternalTableLabelProvider extends LabelProvider implements ITableLabelProvider {
-		public InternalTableLabelProvider() {
-			super();
-		}
-
-		public Image getColumnImage(Object element, int columnIndex) {
-			return null;
-		}
-
-		public String getColumnText(Object element, int columnIndex) {
-			switch (columnIndex) {
-				case 0 : // text hover label
-					return ((TextHoverManager.TextHoverDescriptor) element).getLabel();
-
-				case 1 : // text hover state mask
-					return ((TextHoverManager.TextHoverDescriptor) element).getModifierString();
-
-				default :
-					break;
-			}
-
-			return null;
-		}
-	}
-
-	private static final String DELIMITER = SSEUIMessages.TextHoverPreferenceTab_delimiter; //$NON-NLS-1$
-	private Text fDescription;
-	private Table fHoverTable;
-	private TableViewer fHoverTableViewer;
-	private TableColumn fModifierColumn;
-	// for this preference page
-	private Text fModifierEditor;
-	private TableColumn fNameColumn;
-
-	private TextHoverDescriptor[] fTextHovers; // current list of text hovers
-
-	public TextHoverPreferenceTab(PreferencePage mainPreferencePage, OverlayPreferenceStore store) {
-		Assert.isNotNull(mainPreferencePage);
-		Assert.isNotNull(store);
-		setMainPreferencePage(mainPreferencePage);
-		setOverlayStore(store);
-		getOverlayStore().addKeys(createOverlayStoreKeys());
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#createContents(org.eclipse.swt.widgets.Composite)
-	 */
-	public Control createContents(Composite tabFolder) {
-		Composite hoverComposite = new Composite(tabFolder, SWT.NONE);
-		GridLayout layout = new GridLayout();
-		layout.numColumns = 2;
-		hoverComposite.setLayout(layout);
-		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
-		hoverComposite.setLayoutData(gd);
-
-		// commented out until these preferences are actually handled in some
-		// way
-		//		String rollOverLabel=
-		// ResourceHandler.getString("TextHoverPreferenceTab.annotationRollover");
-		// //$NON-NLS-1$
-		//		addCheckBox(hoverComposite, rollOverLabel,
-		// CommonEditorPreferenceNames.EDITOR_ANNOTATION_ROLL_OVER, 0);
-		//
-		//		// Affordance checkbox
-		//		String showAffordanceLabel =
-		// ResourceHandler.getString("TextHoverPreferenceTab.showAffordance");
-		// //$NON-NLS-1$
-		//		addCheckBox(hoverComposite, showAffordanceLabel,
-		// CommonEditorPreferenceNames.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE, 0);
-
-		Label label = new Label(hoverComposite, SWT.NONE);
-		label.setText(SSEUIMessages.TextHoverPreferenceTab_hoverPreferences); //$NON-NLS-1$
-		gd = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
-		gd.horizontalAlignment = GridData.BEGINNING;
-		label.setLayoutData(gd);
-
-		fHoverTableViewer = CheckboxTableViewer.newCheckList(hoverComposite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
-		// Hover table
-		fHoverTable = fHoverTableViewer.getTable();
-		fHoverTable.setHeaderVisible(true);
-		fHoverTable.setLinesVisible(true);
-
-		gd = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=104507
-	    GC gc = new GC(fHoverTable);
-	    gc.setFont(fHoverTable.getFont());
-	    FontMetrics fontMetrics = gc.getFontMetrics();
-	    gc.dispose();
-		int heightHint = Dialog.convertHeightInCharsToPixels(fontMetrics, 7);
-		gd.heightHint = heightHint;
-		
-		fHoverTable.setLayoutData(gd);
-
-		TableLayout tableLayout = new TableLayout();
-		tableLayout.addColumnData(new ColumnWeightData(1, 140, true));
-		tableLayout.addColumnData(new ColumnWeightData(1, 140, true));
-		fHoverTable.setLayout(tableLayout);
-
-		fHoverTable.addSelectionListener(new SelectionListener() {
-
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-
-			public void widgetSelected(SelectionEvent e) {
-				handleHoverListSelection();
-			}
-		});
-
-		fNameColumn = new TableColumn(fHoverTable, SWT.NONE);
-		fNameColumn.setText(SSEUIMessages.TextHoverPreferenceTab_nameColumnTitle); //$NON-NLS-1$
-		fNameColumn.setResizable(true);
-
-		fModifierColumn = new TableColumn(fHoverTable, SWT.NONE);
-		fModifierColumn.setText(SSEUIMessages.TextHoverPreferenceTab_modifierColumnTitle); //$NON-NLS-1$
-		fModifierColumn.setResizable(true);
-
-		fHoverTableViewer.setUseHashlookup(true);
-		fHoverTableViewer.setContentProvider(new ArrayContentProvider());
-		fHoverTableViewer.setLabelProvider(new InternalTableLabelProvider());
-		((CheckboxTableViewer) fHoverTableViewer).addCheckStateListener(new ICheckStateListener() {
-			/*
-			 * @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent)
-			 */
-			public void checkStateChanged(CheckStateChangedEvent event) {
-				String id = ((TextHoverDescriptor) event.getElement()).getId();
-				if (id == null)
-					return;
-
-				TextHoverManager.TextHoverDescriptor[] descriptors = getTextHoverManager().getTextHovers();
-				TextHoverManager.TextHoverDescriptor hoverConfig = null;
-				int i = 0, length = fTextHovers.length;
-				while (i < length) {
-					if (id.equals(descriptors[i].getId())) {
-						hoverConfig = fTextHovers[i];
-						hoverConfig.setEnabled(event.getChecked());
-						fModifierEditor.setEnabled(event.getChecked());
-						fHoverTableViewer.setSelection(new StructuredSelection(descriptors[i]));
-					}
-					i++;
-				}
-
-				handleHoverListSelection();
-				updateStatus(hoverConfig);
-			}
-		});
-
-		// Text field for modifier string
-		label = new Label(hoverComposite, SWT.LEFT);
-		label.setText(SSEUIMessages.TextHoverPreferenceTab_keyModifier); //$NON-NLS-1$
-		fModifierEditor = new Text(hoverComposite, SWT.BORDER);
-		gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
-		fModifierEditor.setLayoutData(gd);
-
-		fModifierEditor.addKeyListener(new KeyListener() {
-			private boolean isModifierCandidate;
-
-			public void keyPressed(KeyEvent e) {
-				isModifierCandidate = e.keyCode > 0 && e.character == 0 && e.stateMask == 0;
-			}
-
-			public void keyReleased(KeyEvent e) {
-				if (isModifierCandidate && e.stateMask > 0 && e.stateMask == e.stateMask && e.character == 0) {// &&
-					// e.time
-					// -time
-					// <
-					// 1000)
-					// {
-					String text = fModifierEditor.getText();
-					Point selection = fModifierEditor.getSelection();
-					int i = selection.x - 1;
-					while (i > -1 && Character.isWhitespace(text.charAt(i))) {
-						i--;
-					}
-					boolean needsPrefixDelimiter = i > -1 && !String.valueOf(text.charAt(i)).equals(DELIMITER);
-
-					i = selection.y;
-					while (i < text.length() && Character.isWhitespace(text.charAt(i))) {
-						i++;
-					}
-					boolean needsPostfixDelimiter = i < text.length() && !String.valueOf(text.charAt(i)).equals(DELIMITER);
-
-					String insertString;
-
-					if (needsPrefixDelimiter && needsPostfixDelimiter)
-						insertString = NLS.bind(SSEUIMessages.TextHoverPreferenceTab_insertDelimiterAndModifierAndDelimiter, new String[]{Action.findModifierString(e.stateMask)});
-					else if (needsPrefixDelimiter)
-						insertString = NLS.bind(SSEUIMessages.TextHoverPreferenceTab_insertDelimiterAndModifier, new String[]{Action.findModifierString(e.stateMask)});
-					else if (needsPostfixDelimiter)
-						insertString = NLS.bind(SSEUIMessages.TextHoverPreferenceTab_insertModifierAndDelimiter, new String[]{Action.findModifierString(e.stateMask)});
-					else
-						insertString = Action.findModifierString(e.stateMask);
-
-					if (insertString != null)
-						fModifierEditor.insert(insertString);
-				}
-			}
-		});
-
-		fModifierEditor.addModifyListener(new ModifyListener() {
-			public void modifyText(ModifyEvent e) {
-				handleModifierModified();
-			}
-		});
-
-		// Description
-		Label descriptionLabel = new Label(hoverComposite, SWT.LEFT);
-		descriptionLabel.setText(SSEUIMessages.TextHoverPreferenceTab_description); //$NON-NLS-1$
-		gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
-		gd.horizontalSpan = 2;
-		descriptionLabel.setLayoutData(gd);
-		fDescription = new Text(hoverComposite, SWT.LEFT | SWT.WRAP | SWT.MULTI | SWT.READ_ONLY | SWT.BORDER);
-		gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
-		gd.horizontalSpan = 2;
-		fDescription.setLayoutData(gd);
-
-		initialize();
-
-		Dialog.applyDialogFont(hoverComposite);
-
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(hoverComposite, IHelpContextIds.PREFSTE_HOVERS_HELPID);
-		return hoverComposite;
-	}
-
-	private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() {
-		ArrayList overlayKeys = new ArrayList();
-
-		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS));
-
-		OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
-		overlayKeys.toArray(keys);
-		return keys;
-	}
-
-	private String generateTextHoverString() {
-		StringBuffer buf = new StringBuffer();
-
-		for (int i = 0; i < fTextHovers.length; i++) {
-			buf.append(fTextHovers[i].getId());
-			buf.append(TextHoverManager.HOVER_ATTRIBUTE_SEPARATOR);
-			buf.append(Boolean.toString(fTextHovers[i].isEnabled()));
-			buf.append(TextHoverManager.HOVER_ATTRIBUTE_SEPARATOR);
-			String modifier = fTextHovers[i].getModifierString();
-			if (modifier == null || modifier.length() == 0)
-				modifier = TextHoverManager.NO_MODIFIER;
-			buf.append(modifier);
-			buf.append(TextHoverManager.HOVER_SEPARATOR);
-		}
-		return buf.toString();
-	}
-
-	private TextHoverManager getTextHoverManager() {
-		return SSEUIPlugin.getDefault().getTextHoverManager();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#getTitle()
-	 */
-	public String getTitle() {
-		return SSEUIMessages.TextHoverPreferenceTab_title; //$NON-NLS-1$
-	}
-
-	void handleHoverListSelection() {
-		int i = fHoverTable.getSelectionIndex();
-
-		if (i == -1) {
-			if (fHoverTable.getSelectionCount() == 0)
-				fModifierEditor.setEnabled(false);
-			return;
-		}
-
-		boolean enabled = fTextHovers[i].isEnabled();
-		fModifierEditor.setEnabled(enabled);
-		fModifierEditor.setText(fTextHovers[i].getModifierString());
-		String description = fTextHovers[i].getDescription();
-		if (description == null)
-			description = ""; //$NON-NLS-1$
-		fDescription.setText(description);
-	}
-
-	private void handleModifierModified() {
-		int i = fHoverTable.getSelectionIndex();
-		if (i == -1)
-			return;
-
-		String modifiers = fModifierEditor.getText();
-		fTextHovers[i].setModifierString(modifiers);
-
-		// update table
-		fHoverTableViewer.refresh(fTextHovers[i]);
-
-		updateStatus(fTextHovers[i]);
-	}
-
-	private void initialize() {
-		restoreFromOverlay();
-		fHoverTableViewer.setInput(fTextHovers);
-
-		initializeFields();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractPreferenceTab#initializeFields()
-	 */
-	protected void initializeFields() {
-		super.initializeFields();
-
-		fModifierEditor.setEnabled(false);
-		// initialize checkboxes in hover table
-		for (int i = 0; i < fTextHovers.length; i++)
-			fHoverTable.getItem(i).setChecked(fTextHovers[i].isEnabled());
-		fHoverTableViewer.refresh();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#performApply()
-	 */
-	public void performApply() {
-		performOk();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#performDefaults()
-	 */
-	public void performDefaults() {
-		initialize();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#performOk()
-	 */
-	public void performOk() {
-		String textHoverString = generateTextHoverString();
-		getOverlayStore().setValue(EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS, textHoverString);
-		getTextHoverManager().resetTextHovers(); // notify text hover manager
-		// it should reset to get
-		// latest preferences
-	}
-
-	/**
-	 * Populates fTextHovers with text hover description from the overlay
-	 * store (which is the preferences)
-	 */
-	private void restoreFromOverlay() {
-		String descriptorsString = getOverlayStore().getString(EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS);
-		fTextHovers = getTextHoverManager().generateTextHoverDescriptors(descriptorsString);
-	}
-
-	void updateStatus(TextHoverManager.TextHoverDescriptor hoverConfig) {
-		IStatus status = new StatusInfo();
-
-		if (hoverConfig != null && hoverConfig.isEnabled() && EditorUtility.computeStateMask(hoverConfig.getModifierString()) == -1)
-			status = new StatusInfo(IStatus.ERROR, NLS.bind(SSEUIMessages.TextHoverPreferenceTab_modifierIsNotValid, new String[]{hoverConfig.getModifierString()}));
-
-		int i = 0;
-		HashMap stateMasks = new HashMap(fTextHovers.length);
-		while (status.isOK() && i < fTextHovers.length) {
-			if (fTextHovers[i].isEnabled()) {
-				String label = fTextHovers[i].getLabel();
-				Integer stateMask = new Integer(EditorUtility.computeStateMask(fTextHovers[i].getModifierString()));
-				if (stateMask.intValue() == -1)
-					status = new StatusInfo(IStatus.ERROR, NLS.bind(SSEUIMessages.TextHoverPreferenceTab_modifierIsNotValidForHover, new String[]{fTextHovers[i].getModifierString(), label}));
-				else if (stateMasks.containsKey(stateMask))
-					status = new StatusInfo(IStatus.ERROR, NLS.bind(SSEUIMessages.TextHoverPreferenceTab_duplicateModifier, new String[]{label, (String) stateMasks.get(stateMask)}));
-				else
-					stateMasks.put(stateMask, label);
-			}
-			i++;
-		}
-
-		updateStatus(status);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TranslucencyPreferenceTab.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TranslucencyPreferenceTab.java
deleted file mode 100644
index d89b41d..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TranslucencyPreferenceTab.java
+++ /dev/null
@@ -1,149 +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.sse.ui.internal.preferences.ui;
-
-import org.eclipse.jface.preference.FieldEditor;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.IntegerFieldEditor;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-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.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-
-public class TranslucencyPreferenceTab implements IPreferenceTab {
-
-	private PreferencePage fMainPreferencePage;
-	private IntegerFieldEditor fTranslucencyScale = null;
-	private final int MAX_PERCENTAGE = 100;
-
-	private IPropertyChangeListener validityChangeListener = new IPropertyChangeListener() {
-		public void propertyChange(PropertyChangeEvent event) {
-			if (event.getProperty().equals(FieldEditor.IS_VALID))
-				updateValidState();
-		}
-	};
-
-	/**
-	 *  
-	 */
-	public TranslucencyPreferenceTab() {
-		super();
-	}
-
-	public TranslucencyPreferenceTab(PreferencePage mainPreferencePage) {
-		Assert.isNotNull(mainPreferencePage);
-		setMainPreferencePage(mainPreferencePage);
-	}
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#createContents(org.eclipse.swt.widgets.Composite)
-	 */
-	public Control createContents(Composite tabFolder) {
-		Composite composite = new Composite(tabFolder, SWT.NULL);
-		GridLayout layout = new GridLayout();
-		layout.numColumns = 2;
-		composite.setLayout(layout);
-
-		String text = SSEUIMessages.TranslucencyPreferenceTab_1; //$NON-NLS-1$
-		fTranslucencyScale = new IntegerFieldEditor(EditorPreferenceNames.READ_ONLY_FOREGROUND_SCALE, text, composite);
-
-		fTranslucencyScale.setErrorMessage(JFaceResources.getString("StringFieldEditor.errorMessage"));//$NON-NLS-1$
-		fTranslucencyScale.setPreferenceStore(getPreferenceStore());
-		fTranslucencyScale.setPreferencePage(getMainPreferencePage());
-		fTranslucencyScale.setTextLimit(Integer.toString(MAX_PERCENTAGE).length());
-		fTranslucencyScale.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
-		fTranslucencyScale.setValidRange(0, MAX_PERCENTAGE);
-		fTranslucencyScale.load();
-		fTranslucencyScale.setPropertyChangeListener(validityChangeListener);
-
-//		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.PREFWEBX_READONLY_HELPID);
-		return composite;
-	}
-
-	/**
-	 * @return Returns the fMainPreferencePage.
-	 */
-	private PreferencePage getMainPreferencePage() {
-		return fMainPreferencePage;
-	}
-
-	/**
-	 * @return Returns the preference store used in this tab
-	 */
-	private IPreferenceStore getPreferenceStore() {
-		return SSEUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#getTitle()
-	 */
-	public String getTitle() {
-		return SSEUIMessages.TranslucencyPreferenceTab_0; //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#performApply()
-	 */
-	public void performApply() {
-		fTranslucencyScale.store();
-		SSEUIPlugin.getDefault().savePluginPreferences();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#performDefaults()
-	 */
-	public void performDefaults() {
-		fTranslucencyScale.loadDefault();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.IPreferenceTab#performOk()
-	 */
-	public void performOk() {
-		performApply();
-	}
-
-	/**
-	 * @param mainPreferencePage
-	 *            The fMainPreferencePage to set.
-	 */
-	private void setMainPreferencePage(PreferencePage mainPreferencePage) {
-		fMainPreferencePage = mainPreferencePage;
-	}
-
-	private void updateValidState() {
-		if (getMainPreferencePage() != null) {
-			getMainPreferencePage().setValid(fTranslucencyScale.isValid());
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/IStructuredTextFoldingProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/IStructuredTextFoldingProvider.java
deleted file mode 100644
index 76d9af2..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/IStructuredTextFoldingProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.projection;
-
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-
-/**
- * Implementors of this interface which will create and maintain
- * {@link org.eclipse.jface.text.source.projection.ProjectionAnnotation}
- * objects that define folded regions in the the
- * {@link org.eclipse.jface.text.source.projection.ProjectionViewer}for a
- * structured model.
- */
-public interface IStructuredTextFoldingProvider {
-	public static final String ID = "structuredtextfoldingprovider"; //$NON-NLS-1$
-
-	/**
-	 * A named preference that controls whether folding is enabled in the
-	 * Structured Text editor.
-	 */
-	public final static String FOLDING_ENABLED = "foldingEnabled"; //$NON-NLS-1$ 
-
-	// copied interface from
-	// org.eclipse.jdt.ui.text.folding.IJavaFoldingStructureProvider
-	/**
-	 * Installs this structure provider on the given viewer. Implementations
-	 * should listen to the projection events generated by <code>viewer</code>
-	 * and enable / disable generation of projection structure accordingly.
-	 * 
-	 * @param viewer
-	 *            the projection viewer that displays the annotations created
-	 *            by this structure provider
-	 */
-	public void install(ProjectionViewer viewer);
-
-	/**
-	 * Uninstalls this structure provider. Any references to viewers should be
-	 * cleared.
-	 */
-	public void uninstall();
-
-	/**
-	 * Initialize this provider with the correct document. Assumes projection
-	 * is enabled. (otherwise, only install would have been called)
-	 */
-	public void initialize();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/AdapterPropertySheetEntryLabelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/AdapterPropertySheetEntryLabelProvider.java
deleted file mode 100644
index ec0a53c..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/AdapterPropertySheetEntryLabelProvider.java
+++ /dev/null
@@ -1,51 +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.sse.ui.internal.properties;
-
-
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.views.properties.IPropertySheetEntry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-
-public class AdapterPropertySheetEntryLabelProvider extends LabelProvider {
-	public Image getImage(Object element) {
-		if (element == null)
-			return null;
-		if (element instanceof IPropertySheetEntry) {
-			return ((IPropertySheetEntry) element).getImage();
-		}
-		if (element instanceof INodeNotifier) {
-			IPropertySheetEntry entry = (IPropertySheetEntry) ((INodeNotifier) element).getAdapterFor(IPropertySheetEntry.class);
-			if (entry != null)
-				return entry.getImage();
-		}
-		return super.getImage(element);
-	}
-
-	public String getText(Object element) {
-		if (element == null)
-			return null;
-		if (element instanceof IPropertySheetEntry) {
-			return ((IPropertySheetEntry) element).getValueAsString();
-		}
-		if (element instanceof INodeNotifier) {
-			IPropertySheetEntry entry = (IPropertySheetEntry) ((INodeNotifier) element).getAdapterFor(IPropertySheetEntry.class);
-			if (entry != null)
-				return entry.getValueAsString();
-		}
-		return super.getText(element);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ConfigurablePropertySheetPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ConfigurablePropertySheetPage.java
deleted file mode 100644
index 1e4f9aa..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ConfigurablePropertySheetPage.java
+++ /dev/null
@@ -1,189 +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.sse.ui.internal.properties;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.views.properties.IPropertySheetEntry;
-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.sse.ui.views.properties.IPropertySourceExtension;
-import org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration;
-
-
-/**
- * A configurable IPropertySheetPage since the standard PropertySheetPage does
- * not expose its viewer field.
- */
-
-public class ConfigurablePropertySheetPage extends PropertySheetPage {
-	private class NullPropertySheetConfiguration extends PropertySheetConfiguration {
-		public IPropertySourceProvider getPropertySourceProvider(IPropertySheetPage page) {
-			return null;
-		}
-	}
-
-	private static final boolean _DEBUG = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/propertySheet")); //$NON-NLS-1$  //$NON-NLS-2$;;
-
-	private long _DEBUG_TIME = 0;
-
-	private PropertySheetConfiguration fConfiguration;
-	private Object[] fSelectedEntries = null;
-	private ISelection fInput = null;
-	private IMenuManager fMenuManager;
-
-	private RemoveAction fRemoveAction;
-
-	private IStatusLineManager fStatusLineManager;
-
-	private IToolBarManager fToolBarManager;
-
-	private final PropertySheetConfiguration NULL_CONFIGURATION = new NullPropertySheetConfiguration();
-
-	public ConfigurablePropertySheetPage() {
-		super();
-	}
-
-	public void createControl(Composite parent) {
-		setPropertySourceProvider(getConfiguration().getPropertySourceProvider(this));
-		super.createControl(parent);
-	}
-
-	public void dispose() {
-		setConfiguration(null);
-		getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(this);
-		super.dispose();
-	}
-
-	public PropertySheetConfiguration getConfiguration() {
-		if (fConfiguration == null)
-			fConfiguration = NULL_CONFIGURATION;
-		return fConfiguration;
-	}
-
-	public void handleEntrySelection(ISelection selection) {
-		if (getControl() != null && !getControl().isDisposed() && selection != null) {
-			super.handleEntrySelection(selection);
-			if (selection instanceof IStructuredSelection) {
-				fSelectedEntries = ((IStructuredSelection) selection).toArray();
-			}
-			else {
-				fSelectedEntries = null;
-			}
-			fRemoveAction.setEnabled(!selection.isEmpty());
-		}
-	}
-
-	public void init(IPageSite pageSite) {
-		super.init(pageSite);
-		pageSite.getWorkbenchWindow().getSelectionService().addPostSelectionListener(this);
-	}
-
-	public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
-		super.makeContributions(menuManager, toolBarManager, statusLineManager);
-		fMenuManager = menuManager;
-		fToolBarManager = toolBarManager;
-		fStatusLineManager = statusLineManager;
-
-		fRemoveAction = new RemoveAction(this);
-		toolBarManager.add(fRemoveAction);
-		menuManager.add(fRemoveAction);
-		getConfiguration().addContributions(menuManager, toolBarManager, statusLineManager);
-
-		menuManager.update(true);
-	}
-
-	void remove() {
-		if (fSelectedEntries != null) {
-			Object[] entries = fSelectedEntries;
-			ISelection selection = fInput;
-			if (selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
-				IPropertySource source = getConfiguration().getPropertySourceProvider(this).getPropertySource(((IStructuredSelection) selection).getFirstElement());
-				if (source != null && source instanceof IPropertySourceExtension) {
-					for (int i = 0; i < entries.length; i++) {
-						if (entries[i] instanceof IPropertySheetEntry) {
-							IPropertySheetEntry entry = (IPropertySheetEntry) entries[i];
-							((IPropertySourceExtension) source).removeProperty(entry.getDisplayName());
-						}
-					}
-				}
-			}
-		}
-	}
-
-	/*
-	 * Filter the selection through the current Configuration. Not every
-	 * selection received is a Structured selection nor are the Structured
-	 * selection's elements all to be displayed.
-	 * 
-	 * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-		_DEBUG_TIME = System.currentTimeMillis();
-		if (getControl() != null && getControl().isVisible() && !getControl().isFocusControl()) {
-			ISelection preferredSelection = getConfiguration().getInputSelection(part, selection);
-			/*
-			 * Do some minor caching of the selection.
-			 * 
-			 * As a PropertySheetPage, we've always notified of selection
-			 * changes, but we've also subscribed to post selection
-			 * notification so we can track caret movements in source viewers.
-			 * When selecting a block of text, we're thus notified of the new
-			 * selection twice. Remembering what our last *effective*
-			 * selection was allows us to cut out most of the
-			 * double-notification penalty.
-			 */
-			if (!preferredSelection.equals(fInput)) {
-				fInput = preferredSelection;
-				fSelectedEntries = null;
-				super.selectionChanged(part, preferredSelection);
-			}
-
-			if (_DEBUG) {
-				System.out.println("(P:service " + (System.currentTimeMillis() - _DEBUG_TIME) + "ms) " + part + " : " + ((IStructuredSelection) preferredSelection).getFirstElement()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			}
-		}
-		else if (_DEBUG) {
-			System.out.println("[skipped] (P:" + (System.currentTimeMillis() - _DEBUG_TIME) + "ms) " + part + " : " + selection); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		}
-	}
-
-	/**
-	 * @param configuration
-	 *            The configuration to set.
-	 */
-	public void setConfiguration(PropertySheetConfiguration configuration) {
-		if (fConfiguration != null) {
-			fConfiguration.removeContributions(fMenuManager, fToolBarManager, fStatusLineManager);
-			fConfiguration.unconfigure();
-		}
-
-		fConfiguration = configuration;
-
-		if (fConfiguration != null) {
-			setPropertySourceProvider(fConfiguration.getPropertySourceProvider(this));
-			fConfiguration.addContributions(fMenuManager, fToolBarManager, fStatusLineManager);
-		}
-
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/CustomPropertyDescriptor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/CustomPropertyDescriptor.java
deleted file mode 100644
index 5c6904b..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/CustomPropertyDescriptor.java
+++ /dev/null
@@ -1,89 +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.sse.ui.internal.properties;
-
-
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-public class CustomPropertyDescriptor extends PropertyDescriptor {
-
-	protected Class cellEditorClass = null;
-
-	/**
-	 * Returns a property descriptor with a unique name and a display name.
-	 * 
-	 * @param id
-	 *            the id for the property
-	 * @param displayName
-	 *            the name to display for the property
-	 */
-	public CustomPropertyDescriptor(Object id, String newDisplayName, Class editorClass) {
-		super(id, newDisplayName);
-		setDescription((String) id);
-		setCellEditorClass(editorClass);
-	}
-
-	/**
-	 * Returns a property descriptor with a unique name and a display name.
-	 * 
-	 * @param uniqueName
-	 *            the unique name of the property
-	 * @param displayName
-	 *            the name to display for the property
-	 */
-	public CustomPropertyDescriptor(String uniqueName, String newDisplayName) {
-		this(uniqueName, newDisplayName, TextCellEditor.class);
-	}
-
-	public CellEditor createPropertyEditor(Composite parent) {
-		return getPropertyEditor(parent);
-	}
-
-	public Class getCellEditorClass() {
-		return cellEditorClass;
-	}
-
-	/**
-	 * Returns the editor used to edit the property.
-	 * 
-	 * @return an editor for the property
-	 */
-	protected CellEditor getPropertyEditor(Composite parent) {
-		if (getCellEditorClass() == null)
-			return null;
-
-		java.lang.reflect.Constructor constructor = null;
-		try {
-			constructor = getCellEditorClass().getDeclaredConstructor(new Class[]{Composite.class});
-		} catch (NoSuchMethodException nsme) {
-			return new TextCellEditor(parent);
-		}
-		if (constructor != null) {
-			try {
-				return (CellEditor) constructor.newInstance(new Object[]{parent});
-			} catch (InstantiationException ie) {
-			} catch (java.lang.reflect.InvocationTargetException ite) {
-			} catch (IllegalAccessException iae) {
-			}
-		}
-		return new TextCellEditor(parent);
-	}
-
-	public void setCellEditorClass(Class newCellEditorClass) {
-		cellEditorClass = newCellEditorClass;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/RemoveAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/RemoveAction.java
deleted file mode 100644
index 488b241..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/RemoveAction.java
+++ /dev/null
@@ -1,45 +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.sse.ui.internal.properties;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-
-public class RemoveAction extends Action {
-	private ConfigurablePropertySheetPage fPage;
-
-	public RemoveAction(ConfigurablePropertySheetPage page) {
-		super();
-		fPage = page;
-		setText(getText());
-		setToolTipText(getText());
-		setImageDescriptor(EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_ELCL_DELETE));
-		setDisabledImageDescriptor(EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_DLCL_DELETE));
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.Action#getText()
-	 */
-	public String getText() {
-		return SSEUIMessages.RemoveAction_0; //$NON-NLS-1$
-	}
-
-	/**
-	 * @see org.eclipse.jface.action.IAction#run()
-	 */
-	public void run() {
-		fPage.remove();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ShowPropertiesAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ShowPropertiesAction.java
deleted file mode 100644
index 2abb375..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ShowPropertiesAction.java
+++ /dev/null
@@ -1,38 +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.sse.ui.internal.properties;
-
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.ShowViewAction;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-import org.eclipse.wst.sse.ui.internal.editor.IHelpContextIds;
-
-/**
- * Surfaces the Properties view
- * 
- * @author Nitin Dahyabhai
- */
-public class ShowPropertiesAction extends ShowViewAction {
-	private final static String VIEW_ID = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
-
-	public ShowPropertiesAction() {
-		super(SSEUIMessages.ShowPropertiesAction_0, EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_OBJ_PROP_PS)); //$NON-NLS-1$
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IHelpContextIds.CONTMNU_PROPERTIES_HELPID);
-	}
-
-	protected String getViewID() {
-		return VIEW_ID;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/preferences/CommonEditorPreferenceNames.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/preferences/CommonEditorPreferenceNames.java
deleted file mode 100644
index d09f811..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/preferences/CommonEditorPreferenceNames.java
+++ /dev/null
@@ -1,35 +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.sse.ui.internal.provisional.preferences;
-
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-
-/**
- * Common editor preference keys used by the Structured Text Editor.
- * 
- * @plannedfor 1.0
- */
-public class CommonEditorPreferenceNames {
-	private CommonEditorPreferenceNames() {
-		// empty private constructor so users cannot instantiate class
-	}
-
-	/**
-	 * A named preference that controls as-you-type validation
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public static final String EVALUATE_TEMPORARY_PROBLEMS = EditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS;
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryProvider.java
deleted file mode 100644
index 5ccdeb2..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryProvider.java
+++ /dev/null
@@ -1,33 +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.sse.ui.internal.provisional.registry;
-
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-
-public interface AdapterFactoryProvider {
-
-	public void addAdapterFactories(IStructuredModel structuredModel);
-
-	// TODO_issue: IDocumentTypeHandler doesn't seem correct in this API.
-	// reexamine and see if should be ModelHandler, or ContentTypeIdentifer
-	// instead.
-	public boolean isFor(IDocumentTypeHandler contentTypeDescription);
-
-	/**
-	 * This method should only add those factories related to embedded content
-	 * type
-	 */
-	public void reinitializeFactories(IStructuredModel structuredModel);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistry.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistry.java
deleted file mode 100644
index 3b1990f..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistry.java
+++ /dev/null
@@ -1,32 +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.sse.ui.internal.provisional.registry;
-
-import java.util.Iterator;
-
-/**
- * This is basically a "factory for factories". It is to used to associate
- * "edit time" AdapterFactories with a StructuredModel, based on the
- * IStructuredModel's ContentTypeDescription. In plugin.xml files, there
- * should be an AdapterFactoryProvider defined for every definition of
- * ContentTypeDescription.
- */
-public interface AdapterFactoryRegistry {
-
-	/**
-	 * Returns an Iterator over a Collection of AdapterFactoryProviders
-	 * 
-	 * @return
-	 */
-	public Iterator getAdapterFactories();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryExtension.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryExtension.java
deleted file mode 100644
index c229f20..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryExtension.java
+++ /dev/null
@@ -1,22 +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.sse.ui.internal.provisional.registry;
-
-import java.util.Iterator;
-import java.util.List;
-
-public interface AdapterFactoryRegistryExtension {
-	Iterator getAdapterFactories(String contentTypeID);
-
-	List getAdapterFactoriesAsList(String contentTypeID);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryImpl.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryImpl.java
deleted file mode 100644
index e8f5bbc..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryImpl.java
+++ /dev/null
@@ -1,210 +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.sse.ui.internal.provisional.registry;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-public class AdapterFactoryRegistryImpl implements AdapterFactoryRegistry, AdapterFactoryRegistryExtension {
-
-	protected final static String ATT_CLASS = "class"; //$NON-NLS-1$
-
-	private static AdapterFactoryRegistry instance = null;
-
-	static synchronized public AdapterFactoryRegistry getInstance() {
-		if (instance == null) {
-			instance = new AdapterFactoryRegistryImpl();
-		}
-		return instance;
-	}
-
-	// this map exists so there is only one provider
-	// instance not duplicate providers for different content types
-	private HashMap adapterProviders = null;
-
-	private boolean DEBUG = false;
-	/**
-	 * This HashMap contains: [contentTypeId -> element2providerMap] | V
-	 * [configurationElement -> AdapterFactoryProvider]
-	 * 
-	 */
-	private HashMap hashMap = null;
-
-	// providers with no content type associated
-	// just added through the add(...) method
-	private HashSet unassociatedProviders = null;
-
-	private AdapterFactoryRegistryImpl() {
-		super();
-		this.hashMap = new HashMap();
-		this.unassociatedProviders = new HashSet();
-		this.adapterProviders = new HashMap();
-
-		// doesn't instantiate classes, just stores configuration elements
-		AdapterFactoryRegistryReader.readRegistry(hashMap);
-	}
-
-	void add(AdapterFactoryProvider adapterFactoryProvider) {
-		this.unassociatedProviders.add(adapterFactoryProvider);
-	}
-
-	public Iterator getAdapterFactories() {
-		if (DEBUG) {
-			System.out.println("===================================================================================="); //$NON-NLS-1$
-			System.out.println("GETTING ALL ADAPTER FACTORIES"); //$NON-NLS-1$
-		}
-
-		List results = new ArrayList();
-
-		// add providers that have no content type specification
-		results.addAll(this.unassociatedProviders);
-		Iterator it = this.hashMap.keySet().iterator();
-		String contentTypeId = null;
-		while (it.hasNext()) {
-			contentTypeId = (String) it.next();
-
-			if (DEBUG)
-				System.out.println(" + for: " + contentTypeId); //$NON-NLS-1$
-
-			results.addAll(getAdapterFactoriesAsList(contentTypeId));
-		}
-
-		if (DEBUG) {
-			System.out.println("===================================================================================="); //$NON-NLS-1$
-		}
-
-		return results.iterator();
-	}
-
-	public Iterator getAdapterFactories(String contentTypeID) {
-		if (DEBUG) {
-			System.out.println("===================================================================================="); //$NON-NLS-1$
-			System.out.println("GETTING ADAPTER FACTORIES for: " + contentTypeID); //$NON-NLS-1$
-		}
-
-		List results = new ArrayList();
-
-		// add providers that have no content type specification
-		results.addAll(unassociatedProviders);
-
-		// add unknown content type providers (for backwards compatability)
-		results.addAll(getAdapterFactoriesAsList(AdapterFactoryRegistryReader.UNKNOWN_CONTENT_TYPE));
-
-		// add providers for specific content type
-		results.addAll(getAdapterFactoriesAsList(Platform.getContentTypeManager().getContentType(contentTypeID)));
-
-
-		if (DEBUG) {
-			System.out.println("===================================================================================="); //$NON-NLS-1$
-		}
-
-		return results.iterator();
-	}
-
-	public List getAdapterFactoriesAsList(IContentType contentType) {
-		IContentType type = contentType;
-		List results = new ArrayList();
-		while (type != null && !type.getId().equals(IContentTypeManager.CT_TEXT)) {
-			results.addAll(getAdapterFactoriesAsList(type.getId()));
-			type = type.getBaseType();
-		}
-		return results;
-	}
-
-	/**
-	 * Using this new API, only AdapterFactoryProviders for a certain content
-	 * type are instantiated. This will allow for the minimum number of
-	 * plugins to be loaded rather than all that implement the adapter factory
-	 * extension point.
-	 * 
-	 * @param contentTypeID
-	 * @return
-	 */
-	public List getAdapterFactoriesAsList(String contentTypeID) {
-
-		List results = new ArrayList();
-
-		// get element2Provider map for specified content type
-		Object o = hashMap.get(contentTypeID);
-		if (o != null) {
-			// instantiate if necessary from
-			// element2adapterFactoryProvider
-			// map
-			Map element2Provider = (Map) o;
-			Iterator it = element2Provider.keySet().iterator();
-			IConfigurationElement element = null;
-			String classname = null;
-			Object existing = null;
-			AdapterFactoryProvider p = null;
-			while (it.hasNext()) {
-				element = (IConfigurationElement) it.next();
-				o = element2Provider.get(element);
-				if (o != null) {
-					// this provider has already been created
-					if (DEBUG)
-						System.out.println("already created: " + element.getAttribute(ATT_CLASS)); //$NON-NLS-1$
-
-					results.add(o);
-				}
-				else {
-					// need to create the provider
-					try {
-						classname = element.getAttribute(ATT_CLASS);
-
-						if (DEBUG)
-							System.out.println("about to create: " + classname); //$NON-NLS-1$
-
-						// check if we created one already
-						existing = this.adapterProviders.get(classname);
-						if (existing == null) {
-							// this is the only place
-							// AdapterFactoryProviders
-							// are created
-							p = (AdapterFactoryProvider) element.createExecutableExtension(ATT_CLASS); // $NON-NLS-1$
-							this.adapterProviders.put(classname, p);
-						}
-						else {
-							p = (AdapterFactoryProvider) existing;
-						}
-
-						// add to element2Provider for this contentType
-						element2Provider.put(element, p);
-						// add to results to return for this method
-						results.add(p);
-
-					}
-					catch (CoreException e) {
-						// if the provider throws any exception, just log
-						// and
-						// continue
-						Logger.logException(e);
-					}
-				}
-			}
-		}
-
-		return results;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryReader.java
deleted file mode 100644
index b5d49d4..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryReader.java
+++ /dev/null
@@ -1,142 +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.sse.ui.internal.provisional.registry;
-
-import java.util.HashMap;
-
-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.sse.ui.internal.Logger;
-
-
-/**
- * This class just converts what's in the plugins registry into a form more
- * easily useable by others, the ContentTypeRegistry.
- */
-class AdapterFactoryRegistryReader {
-	protected final static String ATT_CLASS = "class"; //$NON-NLS-1$
-
-	protected final static String ATT_ID = "id"; //$NON-NLS-1$
-
-	private static boolean DEBUG = false;
-	protected final static String EXTENSION_POINT_ID = "adapterFactoryDescription"; //$NON-NLS-1$
-	//
-	protected final static String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
-	protected final static String TAG_CONTENT_TYPE = "contentType"; //$NON-NLS-1$
-
-	protected final static String TAG_NAME = "adapterFactoryDescription"; //$NON-NLS-1$
-
-	public final static String UNKNOWN_CONTENT_TYPE = "unknown"; //$NON-NLS-1$
-
-	/**
-	 * adds configuration element to contentTypeId map [contentTypeId ->
-	 * element2providerMap] | V [element -> provider]
-	 * 
-	 * NOTE: this doesn't create the provider yet, that must be done on demand
-	 * and stored in the appropriate element2provider
-	 * 
-	 * @param map
-	 * @param contentTypeId
-	 * @param element
-	 */
-	private static void addElementForContentType(HashMap map, String contentTypeId, IConfigurationElement element) {
-
-		Object o = map.get(contentTypeId);
-		if (o == null) {
-			HashMap element2provider = new HashMap();
-			// don't create the executable extension yet
-			element2provider.put(element, null);
-			map.put(contentTypeId, element2provider);
-
-			if (DEBUG)
-				System.out.println("added " + element.getAttribute(ATT_CLASS) + ", but didn't create exec extension"); //$NON-NLS-1$ //$NON-NLS-2$
-		} else {
-			// add element to unknown list (not executable ext yet...)
-			HashMap element2provider = (HashMap) o;
-			element2provider.put(element, null);
-
-			if (DEBUG)
-				System.out.println("added " + element.getAttribute(ATT_CLASS) + " to unknown list, but didn't create exec extension"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-
-	/**
-	 * the map passed in: [contentTypeId -> element2providerMap] | V [element ->
-	 * provider]
-	 * 
-	 * @param element
-	 * @param map
-	 * @return
-	 */
-	protected static AdapterFactoryProvider readElement(IConfigurationElement element, HashMap map) {
-
-		AdapterFactoryProvider adapterFactoryProvider = null;
-		if (element.getName().equals(TAG_NAME)) {
-			try {
-				IConfigurationElement[] children = element.getChildren();
-				boolean specifiedContentType = false;
-				if (children != null && children.length > 0) {
-					// content types are specified
-					for (int i = 0; i < children.length; i++) {
-						if (children[i].getName().equals(TAG_CONTENT_TYPE)) {
-							// it's possible to have non-contentType childrent
-							specifiedContentType = true;
-							String contentType = children[i].getAttribute(ATT_ID);
-							addElementForContentType(map, contentType, element);
-						}
-					}
-				}
-				if (!specifiedContentType) {
-					// no content type association
-					addElementForContentType(map, UNKNOWN_CONTENT_TYPE, element);
-				}
-			} catch (Exception e) {
-				// if the provider throws any exception, just log and continue
-				Logger.logException(e);
-			}
-		}
-		return adapterFactoryProvider;
-	}
-
-	/**
-	 * We simply require an 'add' method, of what ever it is we are to read
-	 * into
-	 */
-	static void readRegistry(HashMap map) {
-		IExtensionRegistry registry = Platform.getExtensionRegistry();
-		IExtensionPoint point = registry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
-		if (point != null) {
-			IConfigurationElement[] elements = point.getConfigurationElements();
-			for (int i = 0; i < elements.length; i++) {
-				readElement(elements[i], map);
-			}
-		}
-	}
-
-	protected IConfigurationElement configElement = null;
-
-	//    protected final static String ADAPTER_CLASS = "adapterClass";
-	// //$NON-NLS-1$
-	//    protected final static String DOC_TYPE_ID = "docTypeId"; //$NON-NLS-1$
-	//    protected final static String MIME_TYPE_LIST = "mimeTypeList";
-	// //$NON-NLS-1$
-	//
-	/**
-	 * ContentTypeRegistryReader constructor comment.
-	 */
-	AdapterFactoryRegistryReader() {
-		super();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java
deleted file mode 100644
index 9194a57..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java
+++ /dev/null
@@ -1,348 +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.sse.ui.internal.provisional.style;
-
-import java.util.Collection;
-import java.util.HashMap;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextAttribute;
-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.RGB;
-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.internal.util.Debug;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-
-public abstract class AbstractLineStyleProvider {
-	private class PropertyChangeListener implements 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);
-		}
-	}
-
-	// protected IStructuredDocumentRegion currentStructuredDocumentRegion;
-	// Note: the var=x.class contructs were put into this method
-	// as a workaround for slow VAJava class lookups. They compiler
-	// assigns them to a variable in the JDK, but Class.forName("x")
-	// in VAJava. It is workaround specific for VAJava environment, so could
-	// be simplified in future.
-	static Class LineStyleProviderClass = LineStyleProvider.class;
-
-	private IStructuredDocument fDocument;
-	private Highlighter fHighlighter;
-	private boolean fInitialized;
-	private PropertyChangeListener fPreferenceListener = new PropertyChangeListener();
-
-	/** Contains all text attributes pretaining to this line style provider */
-	private HashMap fTextAttributes = null;
-
-	// we keep track of LogMessage to avoid writing hundreds of messages,
-	// but still give a hint that something is wrong with attributeProviders
-	// and/or regions.
-	// It's only written in the case of a program error, but there's no use
-	// adding
-	// salt to the wound.
-	// private boolean wroteOneLogMessage;
-	/**
-	 */
-	protected AbstractLineStyleProvider() {
-	}
-
-	/**
-	 * Looks up the colorKey in the preference store and adds the style
-	 * information to list of TextAttributes
-	 * 
-	 * @param colorKey
-	 */
-	protected void addTextAttribute(String colorKey) {
-		if (getColorPreferences() != null) {
-			String prefString = getColorPreferences().getString(colorKey);
-			String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
-			if (stylePrefs != null) {
-				RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
-				RGB background = ColorHelper.toRGB(stylePrefs[1]);
-				boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
-				getTextAttributes().put(colorKey, createTextAttribute(foreground, background, bold));
-			}
-		}
-	}
-
-	protected void commonInit(IStructuredDocument document, Highlighter highlighter) {
-
-		fDocument = document;
-		fHighlighter = highlighter;
-	}
-
-	/**
-	 * this version does "trim" regions to match request
-	 */
-	private StyleRange createStyleRange(ITextRegionCollection flatNode, ITextRegion region, TextAttribute attr, int startOffset, int length) {
-		int start = flatNode.getStartOffset(region);
-		if (start < startOffset)
-			start = startOffset;
-		int maxOffset = startOffset + length;
-		int end = flatNode.getEndOffset(region); // use get length directly
-		// instead of end-start?
-		if (end > maxOffset)
-			end = maxOffset;
-		StyleRange result = new StyleRange(start, end - start, attr.getForeground(), attr.getBackground(), attr.getStyle());
-		return result;
-
-	}
-
-	protected TextAttribute createTextAttribute(RGB foreground, RGB background, boolean bold) {
-		return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, bold ? SWT.BOLD : SWT.NORMAL);
-	}
-
-	abstract protected TextAttribute getAttributeFor(ITextRegion region);
-
-	abstract protected IPreferenceStore getColorPreferences();
-
-	protected IStructuredDocument getDocument() {
-		return fDocument;
-	}
-
-	/**
-	 */
-	protected Highlighter getHighlighter() {
-		return fHighlighter;
-	}
-
-	/**
-	 * Returns the hashtable containing all the text attributes for this line
-	 * style provider. Lazily creates a hashtable if one has not already been
-	 * created.
-	 * 
-	 * @return
-	 */
-	protected HashMap getTextAttributes() {
-		if (fTextAttributes == null) {
-			fTextAttributes = new HashMap();
-			loadColors();
-		}
-		return fTextAttributes;
-	}
-
-	protected void handlePropertyChange(PropertyChangeEvent event) {
-		// force a full update of the text viewer
-		fHighlighter.refreshDisplay();
-	}
-
-	public void init(IStructuredDocument structuredDocument, Highlighter highlighter) {
-
-		commonInit(structuredDocument, highlighter);
-
-		if (isInitialized())
-			return;
-
-		registerPreferenceManager();
-
-		setInitialized(true);
-	}
-
-	/**
-	 * Allowing the INodeAdapter to compare itself against the type allows it
-	 * to return true in more than one case.
-	 */
-	public boolean isAdapterForType(java.lang.Object type) {
-		return type == LineStyleProviderClass;
-	}
-
-	/**
-	 * Returns the initialized.
-	 * 
-	 * @return boolean
-	 */
-	public boolean isInitialized() {
-		return fInitialized;
-	}
-	
-	abstract protected void loadColors();
-
-	public boolean prepareRegions(ITypedRegion typedRegion, int lineRequestStart, int lineRequestLength, Collection holdResults) {
-		final int partitionStartOffset = typedRegion.getOffset();
-		final int partitionLength = typedRegion.getLength();
-		IStructuredDocumentRegion structuredDocumentRegion = getDocument().getRegionAtCharacterOffset(partitionStartOffset);
-		boolean handled = false;
-
-		handled = prepareTextRegions(structuredDocumentRegion, partitionStartOffset, partitionLength, holdResults);
-
-		return handled;
-	}
-
-	/**
-	 * @param region
-	 * @param start
-	 * @param length
-	 * @param holdResults
-	 * @return
-	 */
-	private boolean prepareTextRegion(ITextRegionCollection blockedRegion, int partitionStartOffset, int partitionLength, Collection holdResults) {
-		boolean handled = false;
-		final int partitionEndOffset = partitionStartOffset + partitionLength - 1;
-		ITextRegion region = null;
-		ITextRegionList regions = blockedRegion.getRegions();
-		int nRegions = regions.size();
-		StyleRange styleRange = null;
-		for (int i = 0; i < nRegions; i++) {
-			region = regions.get(i);
-			TextAttribute attr = null;
-			TextAttribute previousAttr = null;
-			if (blockedRegion.getStartOffset(region) > partitionEndOffset)
-				break;
-			if (blockedRegion.getEndOffset(region) <= partitionStartOffset)
-				continue;
-
-			if (region instanceof ITextRegionCollection) {
-				handled = prepareTextRegion((ITextRegionCollection) region, partitionStartOffset, partitionLength, holdResults);
-			} else {
-
-				attr = getAttributeFor(region);
-				if (attr != null) {
-					handled = true;
-					// if this region's attr is the same as previous one, then
-					// just adjust the previous style range
-					// instead of creating a new instance of one
-					// note: to use 'equals' in this case is important, since
-					// sometimes
-					// different instances of attributes are associated with a
-					// region, even the
-					// the attribute has the same values.
-					// TODO: this needs to be improved to handle readonly
-					// regions correctly
-					if ((styleRange != null) && (previousAttr != null) && (previousAttr.equals(attr))) {
-						styleRange.length += region.getLength();
-					} else {
-						styleRange = createStyleRange(blockedRegion, region, attr, partitionStartOffset, partitionLength);
-						holdResults.add(styleRange);
-						// technically speaking, we don't need to update
-						// previousAttr
-						// in the other case, because the other case is when
-						// it hasn't changed
-						previousAttr = attr;
-					}
-				} else {
-					previousAttr = null;
-				}
-			}
-		}
-		return handled;
-	}
-
-	private boolean prepareTextRegions(IStructuredDocumentRegion structuredDocumentRegion, int partitionStartOffset, int partitionLength, Collection holdResults) {
-		boolean handled = false;
-		final int partitionEndOffset = partitionStartOffset + partitionLength - 1;
-		while (structuredDocumentRegion != null && structuredDocumentRegion.getStartOffset() <= partitionEndOffset) {
-			ITextRegion region = null;
-			ITextRegionList regions = structuredDocumentRegion.getRegions();
-			int nRegions = regions.size();
-			StyleRange styleRange = null;
-			for (int i = 0; i < nRegions; i++) {
-				region = regions.get(i);
-				TextAttribute attr = null;
-				TextAttribute previousAttr = null;
-				if (structuredDocumentRegion.getStartOffset(region) > partitionEndOffset)
-					break;
-				if (structuredDocumentRegion.getEndOffset(region) <= partitionStartOffset)
-					continue;
-
-				if (region instanceof ITextRegionCollection) {
-					handled = prepareTextRegion((ITextRegionCollection) region, partitionStartOffset, partitionLength, holdResults);
-				} else {
-
-					attr = getAttributeFor(region);
-					if (attr != null) {
-						handled = true;
-						// if this region's attr is the same as previous one,
-						// then just adjust the previous style range
-						// instead of creating a new instance of one
-						// note: to use 'equals' in this case is important,
-						// since sometimes
-						// different instances of attributes are associated
-						// with a region, even the
-						// the attribute has the same values.
-						// TODO: this needs to be improved to handle readonly
-						// regions correctly
-						if ((styleRange != null) && (previousAttr != null) && (previousAttr.equals(attr))) {
-							styleRange.length += region.getLength();
-						} else {
-							styleRange = createStyleRange(structuredDocumentRegion, region, attr, partitionStartOffset, partitionLength);
-							holdResults.add(styleRange);
-							// technically speaking, we don't need to update
-							// previousAttr
-							// in the other case, because the other case is
-							// when it hasn't changed
-							previousAttr = attr;
-						}
-					} else {
-						previousAttr = null;
-					}
-				}
-
-				if (Debug.syntaxHighlighting && !handled) {
-					System.out.println("not handled in prepareRegions"); //$NON-NLS-1$
-				}
-			}
-			structuredDocumentRegion = structuredDocumentRegion.getNext();
-		}
-		return handled;
-	}
-
-	private void registerPreferenceManager() {
-		IPreferenceStore pref = getColorPreferences();
-		if (pref != null) {
-			pref.addPropertyChangeListener(fPreferenceListener);
-		}
-	}
-
-	public void release() {
-		unRegisterPreferenceManager();
-		if (fTextAttributes != null) {
-			fTextAttributes.clear();
-			fTextAttributes = null;
-		}
-	}
-
-	/**
-	 * Sets the initialized.
-	 * 
-	 * @param initialized
-	 *            The initialized to set
-	 */
-	private void setInitialized(boolean initialized) {
-		this.fInitialized = initialized;
-	}
-
-	private void unRegisterPreferenceManager() {
-		IPreferenceStore pref = getColorPreferences();
-		if (pref != null) {
-			pref.removePropertyChangeListener(fPreferenceListener);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/Highlighter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/Highlighter.java
deleted file mode 100644
index 60adbff..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/Highlighter.java
+++ /dev/null
@@ -1,906 +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.sse.ui.internal.provisional.style;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITextViewerExtension5;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.custom.LineStyleEvent;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-
-/**
- * This class is to directly mediate between the Structured Document data
- * structure and the text widget's text and events. It assumes there only the
- * model is interested in text events, and all other views will work from that
- * model. Changes to the text widgets input can cause changes in the model,
- * which in turn cause changes to the widget's display.
- * 
- */
-public class Highlighter implements IHighlighter {
-
-	/**
-	 * A utility class to do various color manipulations
-	 */
-	private class YUV_RGBConverter {
-		/**
-		 * This class "holds" the YUV values corresponding to RGB color
-		 */
-		private class YUV {
-
-			class NormalizedRGB {
-				double blue;
-				double green;
-				private final double maxRGB = 256.0;
-				double red;
-
-				public NormalizedRGB(RGB rgb) {
-					// first normalize to between 0 - 1
-					red = rgb.red / maxRGB;
-					green = rgb.green / maxRGB;
-					blue = rgb.blue / maxRGB;
-
-					red = gammaNormalized(red);
-					green = gammaNormalized(green);
-					blue = gammaNormalized(blue);
-
-				}
-			}
-
-			private NormalizedRGB normalizedRGB;
-
-			RGB originalRGB;
-			private double u = -1;
-			private double v = -1;
-			private double y = -1;
-
-			private YUV() {
-				super();
-			}
-
-			public YUV(double y, double u, double v) {
-				this();
-				this.y = y;
-				this.u = u;
-				this.v = v;
-			}
-
-			public YUV(RGB rgb) {
-				this();
-				originalRGB = rgb;
-				normalizedRGB = new NormalizedRGB(rgb);
-				// force calculations
-				getY();
-				getV();
-				getU();
-			}
-
-			/**
-			 * normalize to "average" gamma 2.2222 or 1/0.45
-			 */
-			double gammaNormalized(double colorComponent) {
-				if (colorComponent < 0.018) {
-					return colorComponent * 0.45;
-				}
-				else {
-					return 1.099 * Math.pow(colorComponent, 0.45) - 0.099;
-				}
-			}
-
-			/**
-			 * @return RGB based on original RGB and current YUV values;
-			 */
-			public RGB getRGB() {
-				RGB result = null;
-				double r = getY() + 1.14 * getV();
-				double g = getY() - 0.395 * getU() - 0.58 * getV();
-				double b = getY() + 2.032 * getU();
-
-				int red = (int) (inverseGammaNormalized(r) * 256);
-				int green = (int) (inverseGammaNormalized(g) * 256);
-				int blue = (int) (inverseGammaNormalized(b) * 256);
-				if (red < 0)
-					red = 0;
-				else if (red > 255)
-					red = 255;
-				if (green < 0)
-					green = 0;
-				else if (green > 255)
-					green = 255;
-				if (blue < 0)
-					blue = 0;
-				else if (blue > 255)
-					blue = 255;
-
-				result = new RGB(red, green, blue);
-				return result;
-			}
-
-			public double getU() {
-				if (u == -1) {
-					u = 0.4949 * (normalizedRGB.blue - getY());
-				}
-				return u;
-
-			}
-
-			public double getV() {
-				if (v == -1) {
-					v = 0.877 * (normalizedRGB.red - getY());
-				}
-				return v;
-			}
-
-			public double getY() {
-				if (y == -1) {
-					y = 0.299 * normalizedRGB.red + 0.587 * normalizedRGB.green + 0.114 * normalizedRGB.blue;
-				}
-				return y;
-			}
-
-			double inverseGammaNormalized(double colorComponent) {
-				if (colorComponent < 0.018) {
-					return colorComponent * .222;
-				}
-				else {
-					return Math.pow(((.9099 * colorComponent + 0.09)), 2.22);
-				}
-			}
-
-		}
-
-		public YUV_RGBConverter() {
-			super();
-		}
-
-		public double calculateYComponent(Color targetColor) {
-			return new YUV(targetColor.getRGB()).getY();
-		}
-
-		public RGB transformRGB(RGB originalRGB, double scaleFactor, double target) {
-			RGB transformedRGB = null;
-			// CCIR601 yuv = new CCIR601(originalRGB);
-			YUV yuv = new YUV(originalRGB);
-			double y = yuv.getY();
-			// zero is black, one is white
-			if (y < target) {
-				// is "dark" make lighter
-				y = y + ((target - y) * scaleFactor);
-			}
-			else {
-				// is "light" make darker
-				y = y - ((y - target) * scaleFactor);
-			}
-			// yuv.setY(y);
-			YUV newYUV = new YUV(y, yuv.getU(), yuv.getV());
-			// CCIR601 newYUV = new CCIR601(y, yuv.getCb601(),
-			// yuv.getCr601());
-			transformedRGB = newYUV.getRGB();
-			return transformedRGB;
-		}
-
-		public RGB transformRGBToGrey(RGB originalRGB, double scaleFactor, double target) {
-			RGB transformedRGB = null;
-			// we left the "full" API method signature, but this
-			// version does not take into account originalRGB, though
-			// it might someday.
-			// for now, we'll simply make the new RGB grey, either a little
-			// lighter, or a little darker than background.
-			double y = 0;
-			double mid = 0.5;
-			// zero is black, one is white
-			if (target < mid) {
-				// is "dark" make lighter
-				y = target + scaleFactor;
-			}
-			else {
-				// is "light" make darker
-				y = target - scaleFactor;
-			}
-			int c = (int) Math.round(y * 255);
-			// just to gaurd against mis-use, or scale's values greater
-			// than mid point (and possibly rounding error)
-			if (c > 255)
-				c = 255;
-			if (c < 0)
-				c = 0;
-			transformedRGB = new RGB(c, c, c);
-			return transformedRGB;
-		}
-	}
-
-	private final boolean DEBUG = false;
-	private final StyleRange[] EMPTY_STYLE_RANGE = new StyleRange[0];
-	private static final String LINE_STYLE_PROVIDER_EXTENDED_ID = "linestyleprovider"; //$NON-NLS-1$
-	private static final int MAX_NUMBER_STYLES = 500;
-	private static final int LEFT_STYLES_SIZE = 200;
-	private static final int RIGHT_STYLES_SIZE = 200;
-	private static final int MIDDLE_STYLES_SIZE = 1;
-
-	private IPropertyChangeListener fForegroundScaleListener = new IPropertyChangeListener() {
-		public void propertyChange(PropertyChangeEvent event) {
-			if (EditorPreferenceNames.READ_ONLY_FOREGROUND_SCALE.equals(event.getProperty())) {
-				IPreferenceStore editorStore = SSEUIPlugin.getDefault().getPreferenceStore();
-				readOnlyForegroundScaleFactor = editorStore.getInt(EditorPreferenceNames.READ_ONLY_FOREGROUND_SCALE);
-				disposeColorTable();
-				refreshDisplay();
-			}
-		}
-	};
-	private List fHoldStyleResults;
-	private String fPartitioning = IDocumentExtension3.DEFAULT_PARTITIONING;
-
-	private int fSavedLength = -1;
-	private int fSavedOffset = -1;
-	private StyleRange[] fSavedRanges = null;
-
-	private IStructuredDocument fStructuredDocument;
-	private Map fTableOfProviders;
-
-	private Map fExtendedProviders;
-
-	protected final LineStyleProvider NOOP_PROVIDER = new LineStyleProviderForNoOp();
-
-	private double readOnlyBackgroundScaleFactor = 10;
-	private Hashtable readOnlyColorTable;
-	double readOnlyForegroundScaleFactor = 30;
-
-	private YUV_RGBConverter rgbConverter;
-	private ITextViewer textViewer;
-	private StyledText textWidget;
-
-	public Highlighter() {
-		super();
-		
-		// in the 'limitSize' method, we make this strong assumption, so, will check here, 
-		// so if tweaked in future, we'll get a quick reminder. 
-		if (LEFT_STYLES_SIZE + MIDDLE_STYLES_SIZE + RIGHT_STYLES_SIZE > MAX_NUMBER_STYLES) {
-			throw new IllegalStateException("Highligher constants are not defined correctly");
-		}
-	}
-
-	protected void addEmptyRange(int start, int length, Collection holdResults) {
-		StyleRange result = new StyleRange();
-		result.start = start;
-		result.length = length;
-		holdResults.add(result);
-	}
-
-	/**
-	 * Registers a given line style provider for a particular partition type.
-	 * If there is already a line style provider registered for this type, the
-	 * new line style provider is registered instead of the old one.
-	 * 
-	 * @param partitionType
-	 *            the partition type under which to register
-	 * @param the
-	 *            line style provider to register, or <code>null</code> to
-	 *            remove an existing one
-	 */
-	public void addProvider(String partitionType, LineStyleProvider provider) {
-		getTableOfProviders().put(partitionType, provider);
-	}
-
-	/**
-	 * Adjust the style ranges' start and length so that they refer to the
-	 * textviewer widget's range instead of the textviewer's document range.
-	 * 
-	 * @param ranges
-	 * @param adjustment
-	 */
-	protected void adjust(StyleRange[] ranges, int adjustment) {
-		ITextViewer viewer = getTextViewer();
-
-		if (adjustment != 0) {
-			// just use the adjustment value
-			// convert document regions back to widget regions
-			for (int i = 0; i < ranges.length; i++) {
-				// just adjust the range using the given adjustment
-				ranges[i].start += adjustment;
-			}
-		}
-		else if (viewer instanceof ITextViewerExtension5) {
-			// use ITextViewerExtension5
-			ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
-
-			// convert document regions back to widget regions
-			for (int i = 0; i < ranges.length; i++) {
-				// get document range, taking into account folding
-				// regions in viewer
-				IRegion region = extension.modelRange2WidgetRange(new Region(ranges[i].start, ranges[i].length));
-				if (region != null) {
-					ranges[i].start = region.getOffset();
-					ranges[i].length = region.getLength();
-				} // else what happens if region is not found?!
-			}
-		}
-	}
-
-
-	/**
-	 * @deprecated - Read Only areas have unchanged background colors
-	 */
-	void adjustBackground(StyleRange styleRange) {
-		RGB oldRGB = null;
-		Color oldColor = styleRange.background;
-		if (oldColor == null) {
-			oldColor = getTextWidget().getBackground();
-		}
-		oldRGB = oldColor.getRGB();
-		Color newColor = getCachedColorFor(oldRGB);
-		if (newColor == null) {
-			double target = getRGBConverter().calculateYComponent(oldColor);
-			// if background is "light" make it darker, and vice versa
-			if (target < 0.5)
-				target = 1.0;
-			else
-				target = 0.0;
-			RGB newRGB = getRGBConverter().transformRGB(oldRGB, readOnlyBackgroundScaleFactor / 100.0, target);
-
-			cacheColor(oldRGB, newRGB);
-			newColor = getCachedColorFor(oldRGB);
-		}
-		styleRange.background = newColor;
-	}
-
-	private void adjustForeground(StyleRange styleRange) {
-		RGB oldRGB = null;
-		// Color oldColor = styleRange.foreground;
-		Color oldColor = styleRange.background;
-		if (oldColor == null) {
-			// oldRGB = getTextWidget().getForeground().getRGB();
-			oldColor = getTextWidget().getBackground();
-			oldRGB = oldColor.getRGB();
-		}
-		else {
-			oldRGB = oldColor.getRGB();
-		}
-		Color newColor = getCachedColorFor(oldRGB);
-		if (newColor == null) {
-			// make text "closer to" background lumanence
-			double target = getRGBConverter().calculateYComponent(oldColor);
-			RGB newRGB = getRGBConverter().transformRGBToGrey(oldRGB, readOnlyForegroundScaleFactor / 100.0, target);
-
-			// save conversion, so calculations only need to be done once
-			cacheColor(oldRGB, newRGB);
-			newColor = getCachedColorFor(oldRGB);
-		}
-		styleRange.foreground = newColor;
-	}
-
-	/**
-	 * Cache read-only color.
-	 * 
-	 * @param oldRGB
-	 * @param newColor
-	 */
-	private void cacheColor(RGB oldRGB, RGB newColor) {
-		if (readOnlyColorTable == null) {
-			readOnlyColorTable = new Hashtable();
-		}
-		readOnlyColorTable.put(oldRGB, newColor);
-	}
-
-	/**
-	 * @param result
-	 * @return
-	 */
-	private StyleRange[] convertReadOnlyRegions(StyleRange[] result, int start, int length) {
-		IStructuredDocument structuredDocument = getDocument();
-
-		/**
-		 * (dmw) For client/provider simplicity (and consistent look and feel)
-		 * we'll handle readonly regions in one spot, here in the Highlighter.
-		 * Currently it is a fair assumption that each readonly region will be
-		 * on an ITextRegion boundary, so we combine consecutive styles when
-		 * found to be equivalent. Plus, for now, we'll just adjust
-		 * foreground. Eventually will use a "dimming" algrorithm to adjust
-		 * color's satuation/brightness.
-		 */
-		if (structuredDocument.containsReadOnly(start, length)) {
-			// something is read-only in the line, so go through each style,
-			// and adjust
-			for (int i = 0; i < result.length; i++) {
-				StyleRange styleRange = result[i];
-				if (structuredDocument.containsReadOnly(styleRange.start, styleRange.length)) {
-					adjustForeground(styleRange);
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Clear out the readOnlyColorTable
-	 */
-	void disposeColorTable() {
-		if (readOnlyColorTable != null) {
-			readOnlyColorTable.clear();
-		}
-		readOnlyColorTable = null;
-	}
-
-	/**
-	 * This method is just to get existing read-only colors.
-	 */
-	private Color getCachedColorFor(RGB oldRGB) {
-		Color result = null;
-
-		if (readOnlyColorTable != null) {
-			RGB readOnlyRGB = (RGB) readOnlyColorTable.get(oldRGB);
-			result = EditorUtility.getColor(readOnlyRGB);
-		}
-
-		return result;
-	}
-
-	protected IStructuredDocument getDocument() {
-		return fStructuredDocument;
-	}
-
-	/**
-	 * Adjust the given widget offset and length so that they are the
-	 * textviewer document's offset and length, taking into account what is
-	 * actually visible in the document.
-	 * 
-	 * @param offset
-	 * @param length
-	 * @return a region containing the offset and length within the
-	 *         textviewer's document or null if the offset is not within the
-	 *         document
-	 */
-	private IRegion getDocumentRangeFromWidgetRange(int offset, int length) {
-		IRegion styleRegion = null;
-		ITextViewer viewer = getTextViewer();
-		if (viewer instanceof ITextViewerExtension5) {
-			// get document range, taking into account folding regions in
-			// viewer
-			ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
-			styleRegion = extension.widgetRange2ModelRange(new Region(offset, length));
-		}
-		else {
-			// get document range, taking into account viewer visible region
-			// get visible region in viewer
-			IRegion vr = null;
-			if (viewer != null)
-				vr = viewer.getVisibleRegion();
-			else
-				vr = new Region(0, getDocument().getLength());
-
-			// if offset is not within visible region, then we don't really
-			// care
-			if (offset <= vr.getLength()) {
-				// Adjust the offset to be within visible region
-				styleRegion = new Region(offset + vr.getOffset(), length);
-			}
-		}
-		return styleRegion;
-	}
-
-
-	private Map getExtendedProviders() {
-		if (fExtendedProviders == null) {
-			fExtendedProviders = new HashMap(3);
-		}
-		return fExtendedProviders;
-	}
-
-	/**
-	 * Method getProviderFor.
-	 * 
-	 * @param typedRegion
-	 * @return LineStyleProvider
-	 */
-	private LineStyleProvider getProviderFor(ITypedRegion typedRegion) {
-		String type = typedRegion.getType();
-		LineStyleProvider result = (LineStyleProvider) fTableOfProviders.get(type);
-		if (result == null) {
-			// NOT YET FINALIZED - DO NOT CONSIDER AS API
-			synchronized (getExtendedProviders()) {
-				if (!getExtendedProviders().containsKey(type)) {
-					LineStyleProvider provider = (LineStyleProvider) ExtendedConfigurationBuilder.getInstance().getConfiguration(LINE_STYLE_PROVIDER_EXTENDED_ID, type);
-					getExtendedProviders().put(type, provider);
-					if (provider != null) {
-						provider.init(getDocument(), this);
-					}
-					result = provider;
-				}
-				else {
-					result = (LineStyleProvider) getExtendedProviders().get(type);
-				}
-			}
-		}
-		if (result == null) {
-			result = NOOP_PROVIDER;
-		}
-		return result;
-	}
-
-	private YUV_RGBConverter getRGBConverter() {
-		if (rgbConverter == null) {
-			rgbConverter = new YUV_RGBConverter();
-		}
-		return rgbConverter;
-	}
-
-	private Map getTableOfProviders() {
-		if (fTableOfProviders == null) {
-			fTableOfProviders = new HashMap();
-		}
-		return fTableOfProviders;
-	}
-
-	/**
-	 * Returns the textViewer.
-	 * 
-	 * @return ITextViewer
-	 */
-	public ITextViewer getTextViewer() {
-		return textViewer;
-	}
-
-	/**
-	 * @return
-	 */
-	protected StyledText getTextWidget() {
-		return textWidget;
-	}
-
-	/**
-	 * Installs highlighter support on the given text viewer.
-	 * 
-	 * @param textViewer
-	 *            the text viewer on which content assist will work
-	 */
-	public void install(ITextViewer newTextViewer) {
-		this.textViewer = newTextViewer;
-
-		IPreferenceStore editorStore = SSEUIPlugin.getDefault().getPreferenceStore();
-		editorStore.addPropertyChangeListener(fForegroundScaleListener);
-		readOnlyForegroundScaleFactor = editorStore.getInt(EditorPreferenceNames.READ_ONLY_FOREGROUND_SCALE);
-
-		if (textWidget != null) {
-			textWidget.removeLineStyleListener(this);
-		}
-		textWidget = newTextViewer.getTextWidget();
-		if (textWidget != null) {
-			textWidget.addLineStyleListener(this);
-		}
-
-		refreshDisplay();
-	}
-
-	public StyleRange[] lineGetStyle(int eventLineOffset, int eventLineLength) {
-		StyleRange[] eventStyles = EMPTY_STYLE_RANGE;
-		try {
-			if (getDocument() == null || eventLineLength == 0) {
-				// getDocument() == null
-				// during initialization, this is sometimes called before our
-				// structured
-				// is set, in which case we set styles to be the empty style
-				// range
-				// (event.styles can not be null)
-
-				// eventLineLength == 0
-				// we sometimes get odd requests from the very last CRLF in
-				// the
-				// document
-				// it has no length, and there is no node for it!
-				eventStyles = EMPTY_STYLE_RANGE;
-			}
-			else {
-				/*
-				 * LineStyleProviders work using absolute document offsets. To
-				 * support visible regions, adjust the requested range up to
-				 * the full document offsets.
-				 */
-				IRegion styleRegion = getDocumentRangeFromWidgetRange(eventLineOffset, eventLineLength);
-				if (styleRegion != null) {
-					int start = styleRegion.getOffset();
-					int length = styleRegion.getLength();
-
-					ITypedRegion[] partitions = TextUtilities.computePartitioning(getDocument(), fPartitioning, start, length, false);
-					eventStyles = prepareStyleRangesArray(partitions, start, length);
-
-					/*
-					 * If there is a subtext offset, the style ranges must be
-					 * adjusted to the expected offsets just check if
-					 * eventLineOffset is different than start then adjust,
-					 * otherwise u can leave it alone unless there is special
-					 * handling for itextviewerextension5?
-					 */
-					if (start != eventLineOffset) {
-						int offset = 0;
-						// figure out visible region to use for adjustment
-						// only adjust if need to
-						if (!(getTextViewer() instanceof ITextViewerExtension5)) {
-							IRegion vr = getTextViewer().getVisibleRegion();
-							if (vr != null) {
-								offset = vr.getOffset();
-							}
-						}
-						adjust(eventStyles, -offset);
-					}
-
-					eventStyles = limitSize(eventStyles);
-					
-					// for debugging only
-					if (DEBUG) {
-						if (!valid(eventStyles, eventLineOffset, eventLineLength)) {
-							Logger.log(Logger.WARNING, "Highlighter::lineGetStyle found invalid styles at offset " + eventLineOffset); //$NON-NLS-1$
-						}
-					}
-				}
-
-			}
-
-		}
-		catch (Exception e) {
-			// if ANY exception occurs during highlighting,
-			// just return "no highlighting"
-			eventStyles = EMPTY_STYLE_RANGE;
-			if (Debug.syntaxHighlighting) {
-				System.out.println("Exception during highlighting!"); //$NON-NLS-1$
-			}
-		}
-
-		return eventStyles;
-	}
-
-	/**
-	 * This method is to centralize the logic in limiting the overall number of style ranges
-	 * that make it to the styled text widget. 
-	 * 
-	 * Too many styles sent to StyledText results in apparent, but not real, 
-	 * hangs of Eclipse Display thread. See  
-	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=108806
-	 * 
-	 * @param eventStyles
-	 * @return
-	 */
-	 private StyleRange[] limitSize(StyleRange[] eventStyles) {
-		
-		// quick return with same object if not modification needed
-		if (eventStyles.length < MAX_NUMBER_STYLES) {
-			return eventStyles;
-		}
-		else {
-			// we could just take the easy way out and truncate, but will 
-			// be much better appearing if both the start of the line and the 
-			// end of the line are displayed with styles. Since these are both
-			// the parts of the line a user is likely to look at. The middle of the 
-			// line will still be "plain". Presumably, the user would re-format the 
-			// file to avoid long lines, so unlikely to see the middle. 
-			StyleRange[] newRanges = new StyleRange[LEFT_STYLES_SIZE + RIGHT_STYLES_SIZE + MIDDLE_STYLES_SIZE]; 
-			System.arraycopy(eventStyles, 0, newRanges, 0, LEFT_STYLES_SIZE);
-			//
-			// do end, before we do middle
-			System.arraycopy(eventStyles, eventStyles.length-RIGHT_STYLES_SIZE, newRanges, LEFT_STYLES_SIZE + MIDDLE_STYLES_SIZE, RIGHT_STYLES_SIZE);
-			//
-			// technically, we should compute the exact middle as one big style range, 
-			// with default colors and styles, so if someone does actually type or work with 
-			// documnet as is, will still be correct. 
-			//
-			StyleRange allBlank = new StyleRange();
-			StyleRange lastKnown = newRanges[LEFT_STYLES_SIZE - 1];
-			allBlank.start = lastKnown.start + lastKnown.length;
-			StyleRange nextKnown = newRanges[LEFT_STYLES_SIZE + MIDDLE_STYLES_SIZE + 1];
-			allBlank.length = nextKnown.start - allBlank.start;
-			newRanges[LEFT_STYLES_SIZE] = allBlank;
-			return newRanges;
-		}
-	}
-
-	/**
-	 * A passthrough method that extracts relevant data from the
-	 * LineStyleEvent and passes it along. This method was separated for
-	 * performance testing purposes.
-	 * 
-	 * @see org.eclipse.swt.custom.LineStyleListener#lineGetStyle(LineStyleEvent)
-	 */
-	public void lineGetStyle(LineStyleEvent event) {
-		int offset = event.lineOffset;
-		int length = event.lineText.length();
-
-		/*
-		 * For some reason, we are sometimes asked for the same style range
-		 * over and over again. This was found to happen during 'revert' of a
-		 * file with one line in it that is 40K long! So, while we don't know
-		 * root cause, caching the styled ranges in case the exact same
-		 * request is made multiple times seems like cheap insurance.
-		 */
-		if (offset == fSavedOffset && length == fSavedLength && fSavedRanges != null) {
-			event.styles = fSavedRanges;
-		}
-		else {
-			// need to assign this array here, or else the field won't get
-			// updated
-			event.styles = lineGetStyle(offset, length);
-			// now saved "cached data" for repeated requests which are exaclty
-			// same
-			fSavedOffset = offset;
-			fSavedLength = length;
-			fSavedRanges = event.styles;
-		}
-	}
-
-	/**
-	 * Note: its very important this method never return null, which is why
-	 * the final null check is in a finally clause
-	 */
-
-	protected StyleRange[] prepareStyleRangesArray(ITypedRegion[] partitions, int start, int length) {
-
-		StyleRange[] result = EMPTY_STYLE_RANGE;
-
-		if (fHoldStyleResults == null) {
-			fHoldStyleResults = new ArrayList(partitions.length);
-		}
-		else {
-			fHoldStyleResults.clear();
-		}
-
-		// TODO: make some of these instance variables to prevent creation on
-		// stack
-		LineStyleProvider currentLineStyleProvider = null;
-		boolean handled = false;
-		for (int i = 0; i < partitions.length; i++) {
-			ITypedRegion currentPartition = partitions[i];
-			currentLineStyleProvider = getProviderFor(currentPartition);
-			currentLineStyleProvider.init(getDocument(), this);
-			handled = currentLineStyleProvider.prepareRegions(currentPartition, currentPartition.getOffset(), currentPartition.getLength(), fHoldStyleResults);
-			if (Debug.syntaxHighlighting && !handled) {
-				System.out.println("Did not handle highlighting in Highlighter inner while"); //$NON-NLS-1$
-			}
-		}
-
-		int resultSize = fHoldStyleResults.size();
-		if (resultSize > 0) {
-			result = (StyleRange[]) fHoldStyleResults.toArray(new StyleRange[fHoldStyleResults.size()]);
-		}
-		else {
-			result = EMPTY_STYLE_RANGE;
-		}
-		result = convertReadOnlyRegions(result, start, length);
-		return result;
-	}
-
-	public void refreshDisplay() {
-		if (textWidget != null && !textWidget.isDisposed())
-			textWidget.redraw();
-	}
-
-	/**
-	 */
-	public void refreshDisplay(int start, int length) {
-		if (textWidget != null && !textWidget.isDisposed())
-			textWidget.redrawRange(start, length, true);
-	}
-
-	public void removeProvider(String partitionType) {
-		getTableOfProviders().remove(partitionType);
-	}
-
-	public void setDocument(IStructuredDocument structuredDocument) {
-		fStructuredDocument = structuredDocument;
-	}
-
-	public void setDocumentPartitioning(String partitioning) {
-		if (partitioning != null) {
-			fPartitioning = partitioning;
-		}
-		else {
-			fPartitioning = IDocumentExtension3.DEFAULT_PARTITIONING;
-		}
-	}
-
-	/**
-	 * Uninstalls highlighter support from the text viewer it has previously
-	 * be installed on.
-	 */
-	public void uninstall() {
-		if (textWidget != null && !textWidget.isDisposed()) {
-			textWidget.removeLineStyleListener(this);
-		}
-		textWidget = null;
-
-		Collection providers = getTableOfProviders().values();
-		Iterator iterator = providers.iterator();
-		while (iterator.hasNext()) {
-			LineStyleProvider lineStyleProvider = (LineStyleProvider) iterator.next();
-			lineStyleProvider.release();
-			// this remove probably isn't strictly needed, since
-			// typically highlighter instance as a whole will go
-			// away ... but in case that ever changes, this seems like
-			// a better style.
-			iterator.remove();
-		}
-
-		synchronized (getExtendedProviders()) {
-			providers = new ArrayList(getExtendedProviders().values());
-			getExtendedProviders().clear();
-		}
-		iterator = providers.iterator();
-		while (iterator.hasNext()) {
-			LineStyleProvider lineStyleProvider = (LineStyleProvider) iterator.next();
-			if (lineStyleProvider != null) {
-				lineStyleProvider.release();
-				iterator.remove();
-			}
-		}
-
-		IPreferenceStore editorStore = SSEUIPlugin.getDefault().getPreferenceStore();
-		editorStore.removePropertyChangeListener(fForegroundScaleListener);
-		disposeColorTable();
-
-		// clear out cached variables (d282894)
-		fSavedOffset = -1;
-		fSavedLength = -1;
-		fSavedRanges = null;
-	}
-
-	/**
-	 * Purely a debugging aide.
-	 */
-	private boolean valid(StyleRange[] eventStyles, int startOffset, int lineLength) {
-		boolean result = false;
-		if (eventStyles != null) {
-			if (eventStyles.length > 0) {
-				StyleRange first = eventStyles[0];
-				StyleRange last = eventStyles[eventStyles.length - 1];
-				if (startOffset > first.start) {
-					result = false;
-				}
-				else {
-					int lineEndOffset = startOffset + lineLength;
-					int lastOffset = last.start + last.length;
-					if (lastOffset > lineEndOffset) {
-						result = false;
-					}
-					else {
-						result = true;
-					}
-				}
-			}
-			else {
-				// a zero length array is ok
-				result = true;
-			}
-		}
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/IHighlighter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/IHighlighter.java
deleted file mode 100644
index 112ff1d..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/IHighlighter.java
+++ /dev/null
@@ -1,34 +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.sse.ui.internal.provisional.style;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.swt.custom.LineStyleListener;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * @author davidw
- * 
- */
-public interface IHighlighter extends LineStyleListener {
-	void addProvider(String partitionType, LineStyleProvider provider);
-
-	void install(ITextViewer viewer);
-
-	void removeProvider(String partitionType);
-
-	void setDocument(IStructuredDocument structuredDocument);
-	
-	void uninstall();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProvider.java
deleted file mode 100644
index 0e0cf46..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProvider.java
+++ /dev/null
@@ -1,52 +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.sse.ui.internal.provisional.style;
-
-import java.util.Collection;
-
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-public interface LineStyleProvider {
-
-	/**
-	 * Initializes this provider for the given Highlighter and document. This
-	 * method will be called at least once before prepareRegions is called.
-	 * 
-	 * @param document
-	 * @param highlighter
-	 */
-	void init(IStructuredDocument document, Highlighter highlighter);
-
-	/**
-	 * Optionally appends StyleRanges to the styleRanges Collection, in order,
-	 * and only covering the given range within the document.
-	 * 
-	 * @param currentRegion -
-	 *            the current document partition
-	 * @param start
-	 * @param length
-	 * @param styleRanges
-	 * @return whether this LineStyleProvider handled the request; handling
-	 *         includes not adding StyleRanges if that is still the correct
-	 *         behavior
-	 */
-	boolean prepareRegions(ITypedRegion currentRegion, int start, int length, Collection styleRanges);
-
-	/**
-	 * Instructs this provider to free up any "resources" it might be holding
-	 * on to (such as listening for preference changes). It is only called
-	 * once in the lifetime of this provider.
-	 */
-	void release();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProviderForNoOp.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProviderForNoOp.java
deleted file mode 100644
index b9c51d7..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProviderForNoOp.java
+++ /dev/null
@@ -1,48 +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.sse.ui.internal.provisional.style;
-
-
-
-import java.util.Collection;
-
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * This class can be used by default, if no attribute provider is found for a
- * certain region type. Its probably an error in a factory somewhere if an
- * adapter is not found, but this class allows the logic to proceed basically
- * simply providing default colored syntax highlighting.
- * 
- * Not to be subclassed.
- */
-final public class LineStyleProviderForNoOp implements LineStyleProvider {
-
-	public void init(IStructuredDocument document, Highlighter highlighter) {
-		// nothing to do
-	}
-	
-	/**
-	 * @see org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider#prepareRegions(org.eclipse.jface.text.ITypedRegion,
-	 *      int, int, java.util.Collection)
-	 */
-	public boolean prepareRegions(ITypedRegion currentRegion, int start, int length, Collection holdResults) {
-		// add nothing, but say handled.
-		return true;
-	}
-
-	public void release() {
-		// nothing to do
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java
deleted file mode 100644
index fae0606..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java
+++ /dev/null
@@ -1,486 +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.sse.ui.internal.reconcile;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcileResult;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.ITemporaryAnnotation;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.StructuredMarkerAnnotation;
-
-
-/**
- * A base ReconcilingStrategy. 
- * Subclasses must implement createReconcileSteps().
- * This class should not know about IStructuredDocument, only IDocument.
- * 
- * @author pavery
- */
-public abstract class AbstractStructuredTextReconcilingStrategy implements IReconcilingStrategy, IReconcilingStrategyExtension, IReleasable {
-
-    /** debug flag */
-    protected static final boolean DEBUG;
-    static {
-        String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerjob"); //$NON-NLS-1$
-        DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-    }
-    
-	// these limits are safetys for "runaway" validation cases
-	// should be used to safeguard potentially dangerous loops or potentially
-	// long annotations
-	// (since the painter seems to affect performance when painting long
-	// annotations)
-	public static final int ANNOTATION_LENGTH_LIMIT = 25;
-	public static final int ELEMENT_ERROR_LIMIT = 25;
-    
-	private IDocument fDocument = null;
-//	private IReconcileStep fFirstStep = null;
-	private IProgressMonitor fProgressMonitor = null;
-	private ISourceViewer fSourceViewer = null;
-    private Comparator fComparator;
-
-	// list of "validator" annotations
-	// for gray/un-gray capability
-	private HashSet fMarkerAnnotations = null;
-	
-	/**
-	 * Creates a new strategy. The editor parameter is for access to the
-	 * annotation model.
-	 * 
-	 * @param editor
-	 */
-	public AbstractStructuredTextReconcilingStrategy(ISourceViewer sourceViewer) {
-		fSourceViewer = sourceViewer;
-		init();
-	}
-
-	/**
-	 * This is where we add results to the annotationModel, doing any special
-	 * "extra" processing.
-	 */
-	protected void addResultToAnnotationModel(IReconcileResult result) {
-		if (!(result instanceof TemporaryAnnotation))
-			return;
-		// can be null when closing the editor
-		if (getAnnotationModel() != null) {
-			TemporaryAnnotation tempAnnotation = (TemporaryAnnotation) result;
-			
-			StructuredMarkerAnnotation sma = getCorrespondingMarkerAnnotation(tempAnnotation);
-			if(sma != null) {
-				// un-gray out the marker annotation
-				sma.setGrayed(false);
-			}
-			
-			getAnnotationModel().addAnnotation(tempAnnotation, tempAnnotation.getPosition());
-		}
-	}
-
-	/**
-	 * @param object
-	 * @return if this strategy is responisble for adding this type of key
-	 */
-	protected boolean canHandlePartition(String partition) {
-//		String[] haystack = getPartitionTypes();
-//		for (int i = 0; i < haystack.length; i++) {
-//			if (haystack[i].equals(partition))
-//				return true;
-//		}
-//		return false;
-		return false;
-	}
-
-//	/**
-//	 * @param step
-//	 * @return
-//	 */
-//	protected boolean containsStep(IReconcileStep step) {
-//		if (fFirstStep instanceof StructuredReconcileStep)
-//			return ((StructuredReconcileStep) fFirstStep).isSiblingStep(step);
-//		return false;
-//	}
-
-	/**
-	 * This is where you should create the steps for this strategy
-	 */
-	abstract public void createReconcileSteps();
-
-	/**
-	 * Remove ALL temporary annotations that this strategy can handle.
-	 */
-	protected TemporaryAnnotation[] getAllAnnotationsToRemove() {
-		List removals = new ArrayList();
-		IAnnotationModel annotationModel = getAnnotationModel();
-		if (annotationModel != null) {
-			Iterator i = annotationModel.getAnnotationIterator();
-			while (i.hasNext()) {
-				Object obj = i.next();
-				if (!(obj instanceof ITemporaryAnnotation))
-					continue;
-
-				ITemporaryAnnotation annotation = (ITemporaryAnnotation) obj;
-				ReconcileAnnotationKey key = (ReconcileAnnotationKey) annotation.getKey();
-				// then if this strategy knows how to add/remove this
-				// partition type
-				if (canHandlePartition(key.getPartitionType()) /*&& containsStep(key.getStep())*/)
-					removals.add(annotation);
-			}
-		}
-		return (TemporaryAnnotation[]) removals.toArray(new TemporaryAnnotation[removals.size()]);
-	}
-
-	protected IAnnotationModel getAnnotationModel() {
-		IAnnotationModel model = null;
-		if (fSourceViewer != null) {
-			model = fSourceViewer.getAnnotationModel();
-		}
-		return model;
-	}
-
-	protected TemporaryAnnotation[] getAnnotationsToRemove(DirtyRegion dr) {
-		
-		List remove = new ArrayList();
-		IAnnotationModel annotationModel = getAnnotationModel();
-		// can be null when closing the editor
-		if (getAnnotationModel() != null) {
-			
-			// clear validator annotations
-			getMarkerAnnotations().clear();
-			
-			Iterator i = annotationModel.getAnnotationIterator();
-			while (i.hasNext()) {
-				
-				Object obj = i.next();
-				
-				// check if it's a validator marker annotation
-				// if it is save it for comparision later (to "gray" icons)
-				if(obj instanceof StructuredMarkerAnnotation) {
-					StructuredMarkerAnnotation sma = (StructuredMarkerAnnotation)obj;
-					
-					if(sma.getAnnotationType() == TemporaryAnnotation.ANNOT_ERROR || sma.getAnnotationType() == TemporaryAnnotation.ANNOT_WARNING)
-						fMarkerAnnotations.add(sma);
-				}
-				
-				if (!(obj instanceof TemporaryAnnotation))
-					continue;
-
-				TemporaryAnnotation annotation = (TemporaryAnnotation) obj;
-				ReconcileAnnotationKey key = (ReconcileAnnotationKey) annotation.getKey();
-				
-				// then if this strategy knows how to add/remove this
-				// partition type
-				if (canHandlePartition(key.getPartitionType()) /*&& containsStep(key.getStep())*/) {
-					if (key.getScope() == ReconcileAnnotationKey.PARTIAL && annotation.getPosition().overlapsWith(dr.getOffset(), dr.getLength())) {
-						remove.add(annotation);
-					}
-					else if (key.getScope() == ReconcileAnnotationKey.TOTAL) {
-						remove.add(annotation);
-					}
-				}
-			}
-		}
-		return (TemporaryAnnotation[]) remove.toArray(new TemporaryAnnotation[remove.size()]);
-	}
-
-
-	/**
-	 * Gets partition types from all steps in this strategy.
-	 * 
-	 * @return parition types from all steps
-	 */
-//	public String[] getPartitionTypes() {
-//		if (fFirstStep instanceof StructuredReconcileStep)
-//			return ((StructuredReconcileStep) fFirstStep).getPartitionTypes();
-//		return new String[0];
-//	}
-
-	public void init() {
-		createReconcileSteps();
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension#initialReconcile()
-	 */
-	public void initialReconcile() {
-		// do nothing
-	}
-
-	/**
-	 * @return
-	 */
-	protected boolean isCanceled() {
-		if (DEBUG && (fProgressMonitor != null && fProgressMonitor.isCanceled()))
-			System.out.println("** STRATEGY CANCELED **:" + this.getClass().getName()); //$NON-NLS-1$
-		return fProgressMonitor != null && fProgressMonitor.isCanceled();
-	}
-
-	/**
-	 * Process the results from the reconcile steps in this strategy.
-	 * 
-	 * @param results
-	 */
-	private void process(final IReconcileResult[] results) {
-		if (DEBUG)
-			System.out.println("[trace reconciler] > STARTING PROCESS METHOD with (" + results.length + ") results"); //$NON-NLS-1$ //$NON-NLS-2$
-
-		if (results == null)
-			return;
-
-		for (int i = 0; i<results.length && i<ELEMENT_ERROR_LIMIT && !isCanceled(); i++) {
-
-			if (isCanceled()) {
-                if(DEBUG)
-				    System.out.println("[trace reconciler] >** PROCESS (adding) WAS CANCELLED **"); //$NON-NLS-1$
-				return;
-			}
-			addResultToAnnotationModel(results[i]);
-		}
-        
-		if (DEBUG) {
-			StringBuffer traceString = new StringBuffer();
-			for (int j = 0; j < results.length; j++)
-				traceString.append("\n (+) :" + results[j] + ":\n"); //$NON-NLS-1$ //$NON-NLS-2$
-			System.out.println("[trace reconciler] > PROCESSING (" + results.length + ") results in AbstractStructuredTextReconcilingStrategy " + traceString); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.reconciler.DirtyRegion,
-	 *      org.eclipse.jface.text.IRegion)
-	 */
-	public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
-		// not used
-		// we only have validator strategy now
-		
-//		// external files may be null
-//		if (isCanceled() || fFirstStep == null)
-//			return;
-//
-//        TemporaryAnnotation[] annotationsToRemove = new TemporaryAnnotation[0];
-//        IReconcileResult[] annotationsToAdd = new IReconcileResult[0];
-//        StructuredReconcileStep structuredStep = (StructuredReconcileStep) fFirstStep;
-//        
-//        annotationsToRemove = getAnnotationsToRemove(dirtyRegion);
-//        annotationsToAdd = structuredStep.reconcile(dirtyRegion, subRegion);
-//        
-//        smartProcess(annotationsToRemove, annotationsToAdd);
-	}
-    
-	/**
-	 * @param partition
-	 * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.IRegion)
-	 */
-	public void reconcile(IRegion partition) {
-		// not used, we use:
-        // reconcile(DirtyRegion dirtyRegion, IRegion subRegion)
-	}
-
-	/**
-	 * Calls release() on all the steps in this strategy. Currently done in
-	 * StructuredRegionProcessor.SourceWidgetDisposeListener#widgetDisposed(...)
-	 */
-	public void release() {
-		// release steps (each step calls release on the next)
-		//if (fFirstStep != null && fFirstStep instanceof IReleasable)
-		//	((IReleasable) fFirstStep).release();
-		// we don't to null out the steps, in case
-		// it's reconfigured later
-	}
-
-	private void removeAnnotations(TemporaryAnnotation[] annotationsToRemove) {
-		
-		IAnnotationModel annotationModel = getAnnotationModel();
-		// can be null when closing the editor
-		if (annotationModel != null) {
-			for (int i = 0; i < annotationsToRemove.length; i++) {
-				if (isCanceled()) {
-                    if(DEBUG)
-					    System.out.println("[trace reconciler] >** REMOVAL WAS CANCELLED **"); //$NON-NLS-1$
-					return;
-				}
-				StructuredMarkerAnnotation sma = getCorrespondingMarkerAnnotation(annotationsToRemove[i]);
-				if(sma != null) {
-					// gray out the marker annotation
-					sma.setGrayed(true);
-				}
-				// remove the temp one
-				annotationModel.removeAnnotation(annotationsToRemove[i]);
-				
-			}
-		}
-        
-		if (DEBUG) {
-			StringBuffer traceString = new StringBuffer();
-			for (int i = 0; i < annotationsToRemove.length; i++)
-				traceString.append("\n (-) :" + annotationsToRemove[i] + ":\n"); //$NON-NLS-1$ //$NON-NLS-2$
-			System.out.println("[trace reconciler] > REMOVED (" + annotationsToRemove.length + ") annotations in AbstractStructuredTextReconcilingStrategy :" + traceString); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-
-    private StructuredMarkerAnnotation getCorrespondingMarkerAnnotation(TemporaryAnnotation tempAnnotation) {
-		
-		Iterator it = getMarkerAnnotations().iterator();
-		while (it.hasNext()) {
-			StructuredMarkerAnnotation markerAnnotation = (StructuredMarkerAnnotation) it.next();
-			String message = ""; //$NON-NLS-1$
-			try {
-				message = (String) markerAnnotation.getMarker().getAttribute(IMarker.MESSAGE);
-			} 
-			catch (CoreException e) {
-				if(DEBUG)
-					Logger.logException(e);
-			}
-			// it would be nice to check line number here...
-			if(message != null && message.equals(tempAnnotation.getText()))
-				return markerAnnotation;
-		}
-		return null;
-	}
-
-	private void removeAllAnnotations() {
-        removeAnnotations(getAllAnnotationsToRemove());
-    }
-
-	/**
-	 * Set the document for this strategy.
-	 * 
-	 * @param document
-	 * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument)
-	 */
-	public void setDocument(IDocument document) {
-
-		// remove all old annotations since it's a new document
-	    removeAllAnnotations();
-
-		if (document == null)
-			release();
-		
-//		if (getFirstStep() != null)
-//			getFirstStep().setInputModel(new DocumentAdapter(document));
-		
-		fDocument = document;
-	}
-
-	public IDocument getDocument() {
-		return fDocument;
-	}
-	
-	/**
-	 * @param monitor
-	 * @see org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension#setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public void setProgressMonitor(IProgressMonitor monitor) {
-//		fProgressMonitor = monitor;
-//		if (fFirstStep != null)
-//			fFirstStep.setProgressMonitor(fProgressMonitor);
-	}
-
-	/**
-	 * Check if the annotation is already there, if it is, no need to 
-     * remove or add again. This will avoid a lot of "flickering" behavior.
-	 * 
-	 * @param annotationsToRemove
-	 * @param annotationsToAdd
-	 */
-	protected void smartProcess(TemporaryAnnotation[] annotationsToRemove, IReconcileResult[] annotationsToAdd) {
-        
-        // pa_TODO: investigate a better algorithm, 
-        // also see if this is a bad performance hit.
-        
-        Comparator comp = getAnnotationComparator();
-        List sortedRemovals = Arrays.asList(annotationsToRemove);
-	    Collections.sort(sortedRemovals, comp);
-        
-        List sortedAdditions = Arrays.asList(annotationsToAdd);
-        Collections.sort(sortedAdditions, comp);
-        
-        List filteredRemovals = new ArrayList(sortedRemovals);
-        List filteredAdditions = new ArrayList(sortedAdditions);
-        
-        boolean ignore = false;
-        int lastFoundAdded = 0;
-        for(int i=0; i<sortedRemovals.size(); i++) {
-            TemporaryAnnotation removal = (TemporaryAnnotation)sortedRemovals.get(i);       
-            for(int j=lastFoundAdded; j<sortedAdditions.size(); j++) {             
-                TemporaryAnnotation addition = (TemporaryAnnotation)sortedAdditions.get(j);
-                // quick position check here
-                if(removal.getPosition().equals(addition.getPosition())) {
-                    lastFoundAdded = j;
-                    // remove performs TemporaryAnnotation.equals()
-                    // which checks text as well
-                    filteredAdditions.remove(addition);
-                    ignore = true;
-                    if(DEBUG)
-                        System.out.println(" ~ smart process ignoring: " + removal.getPosition().getOffset()); //$NON-NLS-1$
-                    break;
-                }
-            }
-            if(ignore) {
-                filteredRemovals.remove(removal);
-            }
-            ignore = false;
-        }
-        
-        removeAnnotations((TemporaryAnnotation[])filteredRemovals.toArray(new TemporaryAnnotation[filteredRemovals.size()]));
-        process((IReconcileResult[])filteredAdditions.toArray(new IReconcileResult[filteredAdditions.size()]));
-	}
-    
-    private Comparator getAnnotationComparator() {
-        if(fComparator == null) {
-            fComparator = new Comparator( ) {
-                public int compare(Object arg0, Object arg1) {
-                    TemporaryAnnotation ta1 = (TemporaryAnnotation)arg0;
-                    TemporaryAnnotation ta2 = (TemporaryAnnotation)arg1;
-                    return ta1.getPosition().getOffset() - ta2.getPosition().getOffset();
-                }
-            };
-        }
-        return fComparator;
-    }
-	
-	public boolean isTotalScope() {
-		return false;
-	}
-
-	public HashSet getMarkerAnnotations() {
-		if(fMarkerAnnotations == null)
-			 fMarkerAnnotations = new HashSet();
-		return fMarkerAnnotations;
-	}
-
-//	public IReconcileStep getFirstStep() {
-//		return fFirstStep;
-//	}
-//
-//	public void setFirstStep(IReconcileStep firstStep) {
-//		fFirstStep = firstStep;
-//	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java
deleted file mode 100644
index aca9770..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java
+++ /dev/null
@@ -1,429 +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.sse.ui.internal.reconcile;
-
-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.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-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.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconciler;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-/**
- * This job holds a queue of updates from the editor (DirtyRegions) to
- * process. When a new request comes in, the current run is canceled, the new
- * request is added to the queue, then the job is re-scheduled.
- * 
- * @author pavery
- */
-public class DirtyRegionProcessor extends Job implements IReconciler {
-	/** debug flag */
-	protected static final boolean DEBUG;
-
-	private static final long UPDATE_DELAY = 750;
-	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerjob"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-	}
-
-	private long fDelay;
-
-	/** local queue of dirty regions (created here) to be reconciled */
-	private List fDirtyRegionQueue = Collections.synchronizedList(new ArrayList());
-
-	/** document that this reconciler works on */
-	private IDocument fDocument = null;
-
-	/**
-	 * set true after first install to prevent duplicate work done in the
-	 * install method (since install gets called multiple times)
-	 */
-	private boolean fIsInstalled = false;
-
-	/**
-	 * The partitioning this reconciler uses.
-	 */
-	private String fPartitioning;
-
-	/** the text viewer */
-	private ITextViewer fViewer;
-
-	/**
-	 * Creates a new StructuredRegionProcessor
-	 */
-	public DirtyRegionProcessor() {
-		
-		// init job stuff
-		super(SSEUIMessages.proc_dirty_regions_0); //$NON-NLS-1$
-		setPriority(Job.LONG);
-		setSystem(true);
-
-		// init reconciler stuff
-		setDelay(UPDATE_DELAY);
-	}
-
-	/**
-	 * Adds the given resource to the set of resources that need refreshing.
-	 * Synchronized in order to protect the collection during add.
-	 * 
-	 * @param resource
-	 */
-	private synchronized void addRequest(DirtyRegion dr) {
-        
-		List drq = getDirtyRegionQueue();
-		// if we already have a request which contains the new request,
-		// discare the new request
-		int size = drq.size();
-		for (int i = 0; i < size; i++) {
-			if (contains((DirtyRegion) drq.get(i), dr))
-				return;
-		}
-		// if new request is contains any existing requests,
-		// remove those
-		for (Iterator it = drq.iterator(); it.hasNext();) {
-			if (contains(dr, (DirtyRegion) it.next()))
-				it.remove();
-		}
-		drq.add(dr);
-	}
-
-	/**
-	 * @param dirtyRegion
-	 * @return
-	 */
-	protected ITypedRegion[] computePartitioning(DirtyRegion dirtyRegion) {       
-        int drOffset = dirtyRegion.getOffset();
-        int drLength = dirtyRegion.getLength();
-        
-        return computePartitioning(drOffset, drLength);
-	}
-
-	protected ITypedRegion[] computePartitioning(int drOffset, int drLength) {
-		IDocument doc = getDocument();
-		int docLength = doc.getLength();
-		
-		ITypedRegion[] tr = new ITypedRegion[0];
-		
-		if(drOffset > docLength) {
-            drOffset = docLength;
-            drLength = 0;
-        }
-        else if(drOffset + drLength > docLength) {
-            drLength = docLength - drOffset;
-        }
-            
-		try {
-			// dirty region may span multiple partitions
-            tr = TextUtilities.computePartitioning(doc, getDocumentPartitioning(), drOffset, drLength, true);
-		}
-		catch (BadLocationException e) {
-            String info = "dr: ["+ drOffset+":"+ drLength + "] doc: [" + docLength + "] "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			Logger.logException(info, e);
-			tr = new ITypedRegion[0];
-		}
-		return tr;
-	}
-
-	/**
-	 * @return if the root is parent of possible, return true, otherwise
-	 *         return false
-	 */
-	protected boolean contains(DirtyRegion root, DirtyRegion possible) {
-
-		int rootStart = root.getOffset();
-		int rootEnd = rootStart + root.getLength();
-		int possStart = possible.getOffset();
-		int possEnd = possStart + possible.getLength();
-		if (rootStart <= possStart && rootEnd >= possEnd)
-			return true;
-		return false;
-	}
-
-	protected DirtyRegion createDirtyRegion(int offset, int length, String type) {
-		DirtyRegion durty = null;
-		IDocument doc = getDocument();
-
-		if (doc != null) {
-			// safety for BLE
-			int docLen = doc.getLength();
-            if(offset > docLen) {
-                offset = docLen;
-                length = 0;
-            }
-            else if (offset + length >= docLen)
-				length = docLen - offset;
-			try {
-				durty = new DirtyRegion(offset, length, type, doc.get(offset, length));
-			}
-			catch (BadLocationException e) {
-                String info = "dr: ["+ offset+":"+ length + "] doc: [" + docLen + "] "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-                Logger.logException(info, e);
-			}
-		}
-		return durty;
-	}
-
-	protected DirtyRegion createDirtyRegion(ITypedRegion tr, String type) {
-		return createDirtyRegion(tr.getOffset(), tr.getLength(), type);
-	}
-
-	/**
-	 * Delay between processing of DirtyRegions.
-	 * 
-	 * @return
-	 */
-	protected long getDelay() {
-		return fDelay;
-	}
-
-	protected List getDirtyRegionQueue() {
-		return fDirtyRegionQueue;
-	}
-
-	/**
-	 * The IDocument on which this reconciler operates
-	 * 
-	 * @return
-	 */
-	protected IDocument getDocument() {
-		return fDocument;
-	}
-
-
-	public String getDocumentPartitioning() {
-		if (fPartitioning == null)
-			return IDocumentExtension3.DEFAULT_PARTITIONING;
-		return fPartitioning;
-	}
-
-	/**
-	 * Utility method to get partitions of a dirty region
-	 * 
-	 * @param dirtyRegion
-	 * @return
-	 */
-	protected String[] getPartitions(DirtyRegion dirtyRegion) {
-        int drOffset = dirtyRegion.getOffset();
-        int drLength = dirtyRegion.getLength();
-        return getPartitions(drOffset, drLength);
-	}
-
-	protected String[] getPartitions(int drOffset, int drLength) {
-		
-		ITypedRegion[] regions = new ITypedRegion[0];
-		int docLength = getDocument().getLength();
-        
-        if(drOffset > docLength) {
-            drOffset = docLength;
-            drLength = 0;
-        }
-        else if(drOffset + drLength > docLength) {
-            drLength = docLength - drOffset;
-        }
-            
-		try {
-			regions = TextUtilities.computePartitioning(getDocument(), getDocumentPartitioning(), drOffset, drLength, true);
-		}
-		catch (BadLocationException e) {
-			Logger.logException(e);
-			regions = new ITypedRegion[0];
-		}
-		String[] partitions = new String[regions.length];
-		for (int i = 0; i < regions.length; i++)
-			partitions[i] = regions[i].getType();
-		return partitions;
-	}
-	
-	/**
-	 * contentType is actually partitionType
-	 * @see IReconciler#getReconcilingStrategy(String)
-	 */
-	public IReconcilingStrategy getReconcilingStrategy(String contentType) {
-		// we don't use this, we only have a validator strategy
-		return null;
-	}
-
-	/**
-	 * This method also synchronized because it accesses the fRequests queue
-	 * 
-	 * @return an array of the currently requested Nodes to refresh
-	 */
-	private synchronized DirtyRegion[] getRequests() {
-		DirtyRegion[] toRefresh = (DirtyRegion[]) fDirtyRegionQueue.toArray(new DirtyRegion[fDirtyRegionQueue.size()]);
-		fDirtyRegionQueue.clear();
-		return toRefresh;
-	}
-
-	/**
-	 * Gets a strategy that is made to handle the given dirtyRegion.
-	 * 
-	 * @param dirtyRegion
-	 * @return a strategy that is made to handle the given dirtyRegion, or the
-	 *         default strategy for this reconciler if there isn't one
-	 */
-	protected IReconcilingStrategy getStrategy(DirtyRegion dirtyRegion) {
-		String[] partitions = getPartitions(dirtyRegion);
-		// for now just grab first partition type in dirty region
-		IReconcilingStrategy rs = null;
-		if (partitions.length > 0)
-			rs = getReconcilingStrategy(partitions[0]);
-		return rs;
-	}
-
-	/**
-	 * Returns the text viewer this reconciler is installed on.
-	 * 
-	 * @return the text viewer this reconciler is installed on
-	 */
-	protected ITextViewer getTextViewer() {
-		return fViewer;
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.reconciler.IReconciler#install(ITextViewer)
-	 */
-	public void install(ITextViewer textViewer) {
-		// we might be called multiple times with the same viewe.r,
-		// maybe after being uninstalled as well, so track separately
-		if (!isInstalled()) {
-			fViewer = textViewer;
-			setInstalled(true);
-		}
-	}
-
-	/**
-	 * The viewer has been set on this Reconciler.
-	 * 
-	 * @return true if the viewer has been set on this Reconciler, false
-	 *         otherwise.
-	 */
-	public boolean isInstalled() {
-		return fIsInstalled;
-	}
-
-	/**
-	 * Subclasses should implement for specific handling of dirty regions.
-	 * 
-	 * @param dr
-	 */
-	protected void process(DirtyRegion dr) {
-		// subclasses should implement
-	}
-
-	/**
-	 * Invoke dirty region processing.
-	 * 
-	 * @param node
-	 */
-	public final void processDirtyRegion(DirtyRegion dr) {
-		if (dr == null)
-			return;
-        
-		cancel();
-		addRequest(dr);
-		schedule(getDelay());
-
-		if (DEBUG) {
-			System.out.println("added request for: [" + dr.getText() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
-			System.out.println("queue size is now: " + getDirtyRegionQueue().size()); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Reinitializes listeners and sets new document on all strategies.
-	 * 
-	 * @see org.eclipse.jface.text.reconciler.AbstractReconciler#reconcilerDocumentChanged(IDocument)
-	 */
-	protected void reconcilerDocumentChanged(IDocument document) {
-		setDocument(document);
-//		setDocumentOnAllStrategies(document);
-	}
-
-	protected IStatus run(IProgressMonitor monitor) {
-		IStatus status = Status.OK_STATUS;
-		try {
-			DirtyRegion[] toRefresh = getRequests();
-			for (int i = 0; i < toRefresh.length; i++) {
-				if (monitor.isCanceled())
-					throw new OperationCanceledException();
-				process(toRefresh[i]);
-			}
-		}
-		catch(Exception e) {
-		    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=103676
-			// stop errors from popping up a dialog
-			// from the job manager
-			
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=106052
-			// don't log OperationCanceledException
-			if(!(e instanceof OperationCanceledException))
-				Logger.logException("problem with as-you-type validation", e); //$NON-NLS-1$
-		}
-		finally {
-			monitor.done();
-		}
-		return status;
-	}
-
-	protected void setDelay(long delay) {
-		fDelay = delay;
-	}
-
-	public void setDocument(IDocument doc) {
-		fDocument = doc;
-	}
-
-	/**
-	 * Sets the document partitioning for this reconciler.
-	 * 
-	 * @param partitioning
-	 *            the document partitioning for this reconciler
-	 */
-	public void setDocumentPartitioning(String partitioning) {
-		fPartitioning = partitioning;
-	}
-
-	/**
-	 * @param isInstalled
-	 *            The isInstalled to set.
-	 */
-	public void setInstalled(boolean isInstalled) {
-		fIsInstalled = isInstalled;
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.reconciler.IReconciler#uninstall()
-	 */
-	public void uninstall() {
-		if (isInstalled()) {
-			setInstalled(false);
-		}
-		setDocument(null);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentAdapter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentAdapter.java
deleted file mode 100644
index 4a09d27..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentAdapter.java
+++ /dev/null
@@ -1,43 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.reconciler.IReconcilableModel;
-
-/**
- * Adapts an <code>IDocument</code> to a <code>IReconcilableModel</code>.
- * 
- */
-public class DocumentAdapter implements IReconcilableModel {
-
-	private IDocument fDocument;
-
-	/**
-	 * Creates a text model adapter for the given document.
-	 * 
-	 * @param document
-	 */
-	public DocumentAdapter(IDocument document) {
-		fDocument = document;
-	}
-
-	/**
-	 * Returns this model's document.
-	 * 
-	 * @return the model's input document
-	 */
-	public IDocument getDocument() {
-		return fDocument;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java
deleted file mode 100644
index 9e80850..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java
+++ /dev/null
@@ -1,364 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.reconcile;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorBuilder;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorMetaData;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy;
-
-/**
- * Adds to DirtyRegionProcessor Job:
- * 
- * - IDocumentListener
- * - ValidatorStrategy
- * - Text viewer(dispose, input changed) listeners.
- * - default and validator strategies
- * - DirtyRegion processing logic.
- */
-public class DocumentRegionProcessor extends DirtyRegionProcessor implements IDocumentListener{
-
-	/**
-	 * Reconclies the entire document when the document in the viewer is
-	 * changed. This happens when the document is initially opened, as well as
-	 * after a save-as.
-	 * 
-	 * Also see processPostModelEvent(...) for similar behavior when document
-	 * for the model is changed.
-	 */
-	private class SourceTextInputListener implements ITextInputListener {
-
-		public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
-			// do nothing
-		}
-
-		public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
-			handleInputDocumentChanged(oldInput, newInput);
-		}
-	}
-
-	/** for initital reconcile when document is opened */
-	private SourceTextInputListener fTextInputListener = null;
-
-	/**
-	 * The strategy that runs validators contributed via
-	 * <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code>
-	 * extension point
-	 */
-	private ValidatorStrategy fValidatorStrategy;
-	
-	private final String SSE_EDITOR_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
-
-	/**
-	 * so we can tell if a partition changed after the last edit
-	 */
-	private String[] fLastPartitions;
-
-	/**
-	 * @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#install(org.eclipse.jface.text.ITextViewer)
-	 */
-	public void install(ITextViewer textViewer) {
-
-		super.install(textViewer);
-		fTextInputListener = new SourceTextInputListener();
-		textViewer.addTextInputListener(fTextInputListener);
-	}
-	
-	/**
-	 * @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#uninstall()
-	 */
-	public void uninstall() {
-		if (isInstalled()) {
-
-			cancel();
-
-			// removes document listeners
-			reconcilerDocumentChanged(null);
-
-			// removes widget listener
-			getTextViewer().removeTextInputListener(fTextInputListener);
-
-			IReconcilingStrategy validatorStrategy = getValidatorStrategy();
-			
-			if(validatorStrategy != null) {
-				if(validatorStrategy instanceof IReleasable)
-					((IReleasable)validatorStrategy).release();
-			}
-		}
-		super.uninstall();
-	}
-	
-	/**
-	 * 
-	 * @param oldInput
-	 * @param newInput
-	 */
-	public void handleInputDocumentChanged(IDocument oldInput, IDocument newInput) {
-		// don't bother if reconciler not installed
-		if (isInstalled()) {
-
-			reconcilerDocumentChanged(newInput);
-			setDocument(newInput);
-			setEntireDocumentDirty(newInput);
-		}
-	}
-	
-	public void setDocument(IDocument doc) {
-		super.setDocument(doc);
-		IReconcilingStrategy validatorStrategy = getValidatorStrategy();
-		if(validatorStrategy != null) {
-			validatorStrategy.setDocument(doc);
-		}
-	}
-	
-	/**
-	 * Reinitializes listeners and sets new document onall strategies.
-	 * 
-	 * @see org.eclipse.jface.text.reconciler.AbstractReconciler#reconcilerDocumentChanged(IDocument)
-	 */
-	protected void reconcilerDocumentChanged(IDocument newDocument) {
-
-		IDocument currentDoc = getDocument();
-
-		// unhook old document listener
-		if (currentDoc != null)
-			currentDoc.removeDocumentListener(this);
-		// hook up new document listener
-		if (newDocument != null)
-			newDocument.addDocumentListener(this);
-
-		// sets document on all strategies
-		super.reconcilerDocumentChanged(newDocument);
-	}
-	
-	/**
-	 * @param dirtyRegion
-	 */
-	protected void process(DirtyRegion dirtyRegion) {
-		if (!isInstalled())
-			return;
-
-		ITypedRegion[] unfiltered = computePartitioning(dirtyRegion);
-
-		// remove duplicate typed regions
-		// that are handled by the same "total scope" strategy
-		ITypedRegion[] filtered = filterTotalScopeRegions(unfiltered);
-
-		DirtyRegion dirty = null;
-		for (int i = 0; i < filtered.length; i++) {
-
-			dirty = createDirtyRegion(filtered[i], DirtyRegion.INSERT);
-
-			// validator (extension) for this partition
-			if (getValidatorStrategy() != null)
-				getValidatorStrategy().reconcile(filtered[i], dirty);
-		}
-	}
-	/**
-	 * Removes multiple "total-scope" regions (and leaves one) for a each
-	 * partitionType. This improves performance by preventing unnecessary full
-	 * document validations.
-	 * 
-	 * @param unfiltered
-	 * @return
-	 */
-	protected ITypedRegion[] filterTotalScopeRegions(ITypedRegion[] unfiltered) {
-		IReconcilingStrategy s = null;
-		// ensure there is only one typed region in the list
-		// for regions handled by "total scope" strategies
-		HashMap totalScopeRegions = new HashMap();
-		HashMap partialScopeRegions = new HashMap();
-		List allRegions = new ArrayList();
-		for (int i = 0; i < unfiltered.length; i++) {
-
-			String partitionType = unfiltered[i].getType();
-
-			// short circuit loop
-			if (totalScopeRegions.containsKey(partitionType) || partialScopeRegions.containsKey(partitionType))
-				continue;
-
-			s = getReconcilingStrategy(partitionType);
-
-			// might be the validator strategy
-			if (s == null) {
-				ValidatorStrategy validatorStrategy = getValidatorStrategy();
-				if (validatorStrategy != null) {
-					if (validatorStrategy.canValidatePartition(partitionType))
-						s = validatorStrategy;
-				}
-			}
-
-			if (s instanceof AbstractStructuredTextReconcilingStrategy) {
-				// only allow one dirty region for a strategy
-				// that has "total scope"
-				if (((AbstractStructuredTextReconcilingStrategy) s).isTotalScope())
-					totalScopeRegions.put(partitionType, unfiltered[i]);
-				else
-					partialScopeRegions.put(partitionType, unfiltered[i]);
-			}
-			else
-				partialScopeRegions.put(partitionType, unfiltered[i]);
-		}
-		allRegions.addAll(totalScopeRegions.values());
-		allRegions.addAll(partialScopeRegions.values());
-		ITypedRegion[] filtered = (ITypedRegion[]) allRegions.toArray(new ITypedRegion[allRegions.size()]);
-
-		if (DEBUG)
-			System.out.println("filtered out this many 'total-scope' regions: " + (unfiltered.length - filtered.length)); //$NON-NLS-1$
-
-		return filtered;
-	}
-	
-	/**
-	 * @return Returns the fValidatorStrategy.
-	 */
-	public ValidatorStrategy getValidatorStrategy() {
-		if (fValidatorStrategy == null) {
-			ValidatorStrategy validatorStrategy = null;
-			
-			if (getTextViewer() instanceof ISourceViewer) {
-				ISourceViewer viewer = (ISourceViewer)getTextViewer();
-				String contentTypeId = null;
-				
-				IDocument doc = viewer.getDocument();
-				contentTypeId = getContentType(doc);
-			
-				if (contentTypeId != null) {
-					
-					validatorStrategy = new ValidatorStrategy(viewer, contentTypeId);
-					ValidatorBuilder vBuilder = new ValidatorBuilder();
-					ValidatorMetaData[] vmds = vBuilder.getValidatorMetaData(SSE_EDITOR_ID);
-					for (int i = 0; i < vmds.length; i++) {
-						if (vmds[i].canHandleContentType(contentTypeId))
-							validatorStrategy.addValidatorMetaData(vmds[i]);
-					}
-				}
-			}
-			fValidatorStrategy = validatorStrategy;
-		}
-		return fValidatorStrategy;
-	}
-
-	protected String getContentType(IDocument doc) {
-		
-		if(doc == null)
-			return null;
-		
-		String contentTypeId = null;
-		
-		// pa_TODO it would be nice to be able to get filename from IDocument...
-		// because it seems that getting content type from input stream
-		// isn't all that accurate (eg. w/ a javascript file)
-		
-		//IContentType ct = Platform.getContentTypeManager().findContentTypeFor("test.js");
-		IContentType ct = null;
-		try {
-			IContentDescription desc = Platform.getContentTypeManager().getDescriptionFor(new ByteArrayInputStream(doc.get().getBytes()), null, IContentDescription.ALL);
-			if(desc != null) {
-				ct  = desc.getContentType();
-				if(ct != null) 
-					contentTypeId = ct.getId();
-			}
-		}
-		catch (IOException e) {
-			// just bail
-		}
-		return contentTypeId;
-	}
-
-	public void documentAboutToBeChanged(DocumentEvent event) {
-		// save partition type (to see if it changes in documentChanged())
-		fLastPartitions = getPartitions(event.getOffset(), event.getLength());			
-	}
-
-	public void documentChanged(DocumentEvent event) {
-		if(partitionsChanged(event)) {
-			// pa_TODO
-			// this is a simple way to ensure old
-			// annotations are removed when partition changes
-			
-			// it might be a performance hit though
-			setEntireDocumentDirty(getDocument());
-		}
-		else {
-			DirtyRegion dr = null;
-			if(event.getLength() == 0) {
-				// it's an insert
-				// we use text length though
-				// so that the new region gets validated...
-				dr = createDirtyRegion(event.getOffset(), 0, DirtyRegion.INSERT);
-			}
-			else {
-				if("".equals(event.getText())) { //$NON-NLS-1$
-					// it's a delete
-					dr =createDirtyRegion(event.getOffset(), event.getLength(), DirtyRegion.REMOVE);
-				}
-				else {
-					// it's a replace
-					dr = createDirtyRegion(event.getOffset(), event.getLength(), DirtyRegion.INSERT);	
-				}
-			}
-			processDirtyRegion(dr);
-		}
-	}
-	
-	/**
-	 * Checks previous partitions from the span of the event
-	 * w/ the new partitions from the span of the event.
-	 * If partitions changed, return true, else return false
-	 * 
-	 * @param event
-	 * @return
-	 */
-	private boolean partitionsChanged(DocumentEvent event) {
-		boolean changed = false;
-		String[] newPartitions = getPartitions(event.getOffset(), event.getLength());
-		if(fLastPartitions != null) {
-			if(fLastPartitions.length != newPartitions.length) {
-				changed = true;
-			}
-			else {
-				for(int i=0; i<fLastPartitions.length; i++) {
-					if(!fLastPartitions[i].equals(newPartitions[i])) {
-						changed = true;
-						break;
-					}
-				}	
-			}
-		}
-		return changed;
-	}
-	
-	/**
-	 * Basically means process the entire document.
-	 * @param document
-	 */
-	protected void setEntireDocumentDirty(IDocument document) {
-
-		// make the entire document dirty
-		// this also happens on a "save as"
-		if (document != null && isInstalled()) {
-
-			// since we're marking the entire doc dirty
-			getDirtyRegionQueue().clear();
-			DirtyRegion entireDocument = createDirtyRegion(0, document.getLength(), DirtyRegion.INSERT);
-			processDirtyRegion(entireDocument);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IReconcileAnnotationKey.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IReconcileAnnotationKey.java
deleted file mode 100644
index 052df0a..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IReconcileAnnotationKey.java
+++ /dev/null
@@ -1,35 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-
-/**
- * Defines an annotation key that the
- * <code>AbstractStructuredTextReconcilingStrategy</code> knows how to
- * remove appropriately.
- * 
- * @deprecated not API, this will probably just become an abstract class
- * 
- * @author pavery
- */
-public interface IReconcileAnnotationKey {
-	static final int PARTIAL = 1;
-	static final int TOTAL = 0;
-
-	String getPartitionType();
-
-	//int getScope();
-
-	IReconcileStep getStep();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcileStep.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcileStep.java
deleted file mode 100644
index 3abb5f9..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcileStep.java
+++ /dev/null
@@ -1,66 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcileResult;
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-
-/**
- * @author pavery
- * @deprecated still working out API (or if anything here should be API)
- * 
- * Interface for a step in StructuredRegionProcessor framework.
- */
-public interface IStructuredReconcileStep extends IReconcileStep {
-	/**
-	 * Partitions for which this step can add/remove annotions
-	 * 
-	 * @return an array of the partitions for which this step can add/remove
-	 *         annotions
-	 */
-	String[] getPartitionTypes();
-
-	/**
-	 * Returns the scope for which this step adds annotations.
-	 * 
-	 * @return the scope for which this step adds annotations
-	 */
-	//int getScope();
-
-	/**
-	 * Tells you if the step is equal to this step or any of the sibling
-	 * steps.
-	 * 
-	 * @return
-	 */
-	boolean isSiblingStep(IReconcileStep step);
-
-	/**
-	 * Adds awareness that the Reconciler is reconciling the entire document
-	 * this call.
-	 * 
-	 * @param dirtyRegion
-	 * @param subRegion
-	 * @param refreshAll
-	 * @return
-	 */
-	IReconcileResult[] reconcile(DirtyRegion dirtyRegion, IRegion subRegion, boolean refreshAll);
-
-	/**
-	 * Used to reset the state of the Strategy. For example: any flags that
-	 * need to be reset after a long running operation like processAll().
-	 */
-	void reset();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcilingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcilingStrategy.java
deleted file mode 100644
index 8b44151..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcilingStrategy.java
+++ /dev/null
@@ -1,43 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-
-
-/**
- * Interface for structured reconciling strategies.
- * 
- * @deprecated doesn't need to be API and might go away
- * 
- * @author pavery
- */
-public interface IStructuredReconcilingStrategy extends IReconcilingStrategy {
-	/**
-	 * Adds awareness that the reconciler is processing the entire document
-	 * via refreshAll flag.
-	 * 
-	 * @param dirtyRegion
-	 * @param subRegion
-	 * @param refreshAll
-	 */
-	public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion, boolean refreshAll);
-
-	/**
-	 * Used to reset the state of the Strategy. For example: any flags that
-	 * need to be reset after a long running operation like processAll().
-	 */
-	public void reset();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/ReconcileAnnotationKey.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/ReconcileAnnotationKey.java
deleted file mode 100644
index fa89e2d..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/ReconcileAnnotationKey.java
+++ /dev/null
@@ -1,56 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-
-
-/**
- * Implementation of <code>IReconcileAnnotationKey</code> note: clients
- * should use the method StructuredReconcileStep#createKey(String
- * partitionType, int scope)
- * 
- * @author pavery
- */
-public class ReconcileAnnotationKey {
-    
-    public static final int PARTIAL = 1;
-    public static final int TOTAL = 0;
-    
-	private String fPartitionType = null;
-
-	private IReconcileStep fReconcileStep = null;
-	private int fScope;
-
-	public ReconcileAnnotationKey(IReconcileStep step, String partitionType, int scope) {
-		fReconcileStep = step;
-		fPartitionType = partitionType;
-		fScope = scope;
-	}
-
-	public String getPartitionType() {
-		return fPartitionType;
-	}
-
-	public int getScope() {
-		return fScope;
-	}
-
-	public IReconcileStep getStep() {
-		return fReconcileStep;
-	}
-
-	public String toString() {
-		return this.getClass() + "\r\nid: " + fPartitionType; //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java
deleted file mode 100644
index 430313c..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java
+++ /dev/null
@@ -1,193 +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.sse.ui.internal.reconcile;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-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.TextUtilities;
-import org.eclipse.jface.text.reconciler.AbstractReconcileStep;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcilableModel;
-import org.eclipse.jface.text.reconciler.IReconcileResult;
-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.IStructuredPartitionTypes;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-/**
- * ReconcileStep that knows about the annotation that it adds to the
- * AnnotationModel. It knows how to create an annotation key (for smart
- * removal later) It knows the partition types on which it can operate. It
- * knows the scope on which it operates (for short circuiting) It knows if the
- * Reconciler is reconciling the entire document.
- * 
- * Clients must subclass this class.
- * 
- * @author pavery
- */
-public abstract class StructuredReconcileStep extends AbstractReconcileStep implements IReleasable {
-
-	/** debug flag */
-	protected static final boolean DEBUG;
-	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerjob"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-	}
-
-	protected final IReconcileResult[] EMPTY_RECONCILE_RESULT_SET = new IReconcileResult[0];
-	
-	/**
-	 * It's possible for a partial step to get called on the same area twice
-	 * (as w/ a full document reconcile) this list keeps track of area already
-	 * covered. Should be reset() after the "batch" of reconciling is
-	 * finished.
-	 */
-	private HashSet fPartitionTypes = null;
-
-	public StructuredReconcileStep() {
-		super();
-		fPartitionTypes = new HashSet();
-	}
-
-	public ReconcileAnnotationKey createKey(IStructuredDocumentRegion sdRegion, int scope) {
-
-		ITypedRegion tr = getPartition(sdRegion);
-		String partitionType = (tr != null) ? tr.getType() : IStructuredPartitionTypes.UNKNOWN_PARTITION;
-		return createKey(partitionType, scope);
-	}
-
-	/**
-	 * @param sdRegion
-	 * @return
-	 */
-	protected ITypedRegion getPartition(IStructuredDocumentRegion sdRegion) {
-		ITypedRegion tr = null;
-		if (!sdRegion.isDeleted())
-			tr = getPartition(sdRegion.getParentDocument(), sdRegion.getStartOffset());
-		return tr;
-	}
-
-	private ITypedRegion getPartition(IDocument doc, int offset) {
-		ITypedRegion tr = null;
-		// not sure why document would ever be null, but put in this 
-		// guard for 
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=86069
-		if (doc != null) {
-			try {
-				tr = TextUtilities.getPartition(doc, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, offset, false);
-			} catch (BadLocationException e) {
-				if (DEBUG)
-					Logger.logException("problem getting partition at: " + offset, e); //$NON-NLS-1$
-			}
-		}
-		return tr;
-	}
-
-	/**
-	 * Clients should use this method to create annotation keys as it
-	 * registers the key for removal later.
-	 * 
-	 * @param partitionType
-	 * @param scope
-	 * @return
-	 */
-	public ReconcileAnnotationKey createKey(String partitionType, int scope) {
-		fPartitionTypes.add(partitionType);
-		return new ReconcileAnnotationKey(this, partitionType, scope);
-	}
-
-	protected IDocument getDocument() {
-		IDocument doc = null;
-		IReconcilableModel rModel = getModel();
-		if (rModel instanceof DocumentAdapter) {
-			doc = ((DocumentAdapter) rModel).getDocument();
-		}
-		return doc;
-	}
-
-	public IReconcilableModel getModel() {
-		return getInputModel();
-	}
-
-	public String getPartitionType(IDocument doc, int offset) {
-		ITypedRegion tr = getPartition(doc, offset);
-		return (tr != null) ? tr.getType() : IStructuredPartitionTypes.UNKNOWN_PARTITION;
-	}
-
-	public String[] getPartitionTypes() {
-		// using hash set to automatically get rid of dupes
-		HashSet tempResults = new HashSet();
-		// add these partition types
-		tempResults.addAll(fPartitionTypes);
-		return (String[]) tempResults.toArray(new String[tempResults.size()]);
-	}
-
-	protected IStructuredDocument getStructuredDocument() {
-		IStructuredDocument sDoc = null;
-		IDocument doc = getDocument();
-		if (doc instanceof IStructuredDocument)
-			sDoc = (IStructuredDocument) getDocument();
-		return sDoc;
-	}
-
-	/**
-	 * Removes duplicates.
-	 * 
-	 * @param results1
-	 * @param results2
-	 * @return
-	 */
-	protected IReconcileResult[] merge(IReconcileResult[] results1, IReconcileResult[] results2) {
-		if (results1 == null)
-			return results2;
-		if (results2 == null)
-			return results1;
-
-		List results = new ArrayList();
-		results.addAll(Arrays.asList(results1));
-		for (int i = 0; i < results2.length; i++) {
-			results.add(results2[i]);
-		}
-		return (IReconcileResult[]) results.toArray(new IReconcileResult[results.size()]);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.reconciler.AbstractReconcileStep#reconcileModel(org.eclipse.jface.text.reconciler.DirtyRegion,
-	 *      org.eclipse.jface.text.IRegion)
-	 */
-	protected IReconcileResult[] reconcileModel(DirtyRegion dirtyRegion, IRegion subRegion) {
-		return EMPTY_RECONCILE_RESULT_SET;
-	}
-
-	/**
-	 * Release resources used by the step here as needed. Be sure to call
-	 * super.release() when you override this method as to propagate the
-	 * release through all steps.
-	 */
-	public void release() {
-		// 
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java
deleted file mode 100644
index 92420c2..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java
+++ /dev/null
@@ -1,301 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-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.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-/**
- * An IStructuredModel aware Region Processor.
- * Adds ModelLifecycle listener.  ModelLifecycle listener notifies
- * us that some reinitialization needs to take place.
- * 
- * Model aware "process()"
- * Implements a DOM based "contains()" method using IStructuredModel.
- * 
- */
-public class StructuredRegionProcessor extends DocumentRegionProcessor implements IModelLifecycleListener {
-
-	protected void process(DirtyRegion dirtyRegion) {
-		
-		if(getDocument() == null)
-			return;
-		
-		// use structured model to determine area to process
-		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
-		try {
-			if(sModel != null) {
-				
-				int start = dirtyRegion.getOffset();
-				IndexedRegion ir = sModel.getIndexedRegion(start);
-				
-				if(ir != null) {
-					
-					int end = ir.getEndOffset();
-					
-					ITypedRegion[] unfiltered = computePartitioning(start, end);
-					// remove duplicate typed regions (partitions)
-					// that are handled by the same "total scope" strategy
-					ITypedRegion[] filtered = filterTotalScopeRegions(unfiltered);
-					
-					// iterate dirty partitions
-					for (int i = 0; i < filtered.length; i++) {
-						process(filtered[i]);
-					}
-				}
-			}
-		}
-		finally {
-			if(sModel != null) 
-				sModel.releaseFromRead();
-		}
-	}
-	
-	private void process(ITypedRegion partition) {
-		
-		IStructuredDocumentRegion[] sdRegions = ((IStructuredDocument)getDocument()).getStructuredDocumentRegions(partition.getOffset(), partition.getLength());
-		Position coverage = getNodeCoverage(sdRegions);
-		DirtyRegion nodeDirtyRegion = createDirtyRegion(coverage.offset, coverage.length, DirtyRegion.INSERT);
-		// we only run extension point strategy now
-		if (getValidatorStrategy() != null)
-			getValidatorStrategy().reconcile(partition, nodeDirtyRegion);
-	}
-
-	/**
-	 * Expands coverage based on DOM.
-	 * 
-	 * @return node coverage as a position
-	 */
-	protected Position getNodeCoverage(IStructuredDocumentRegion[] sdRegions) {
-		int start = -1;
-		int end = -1;
-		for (int i = 0; i < sdRegions.length; i++) {
-		    if(!sdRegions[i].isDeleted()) {
-    			IndexedRegion corresponding = getCorrespondingNode(sdRegions[i]);
-                if(corresponding != null) {
-        			if (start == -1 || start > corresponding.getStartOffset())
-        				start = corresponding.getStartOffset();
-        			if (end == -1 || end < corresponding.getEndOffset())
-        				end = corresponding.getEndOffset();
-                }
-            }
-		}
-		return new Position(start, end-start);
-	}
-
-	/**
-	 * Returns the corresponding node for the StructuredDocumentRegion.
-	 * 
-	 * @param sdRegion
-	 * @return the corresponding node for sdRegion
-	 */
-	protected IndexedRegion getCorrespondingNode(IStructuredDocumentRegion sdRegion) {
-		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
-        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.DirtyRegionProcessor#contains(org.eclipse.jface.text.reconciler.DirtyRegion,
-	 *      org.eclipse.jface.text.reconciler.DirtyRegion)
-	 */
-	protected boolean contains(DirtyRegion root, DirtyRegion possible) {
-
-		// this method is a performance hit
-		// look for alternatives
-
-		boolean contains = false;
-		IStructuredModel sModel = getStructuredModelForRead(getDocument());
-		try {
-			if(sModel != null) {
-				IndexedRegion rootRegion = sModel.getIndexedRegion(root.getOffset());
-				IndexedRegion possRegion = sModel.getIndexedRegion(possible.getOffset());
-				if (rootRegion != null && possRegion != null) {
-					int rootStart = rootRegion.getStartOffset();
-					int rootEnd = rootRegion.getEndOffset();
-					int possStart = possRegion.getStartOffset();
-					int possEnd = possRegion.getEndOffset();
-	
-					if (rootStart <= possStart && rootEnd >= possEnd)
-						contains = true;
-	
-					if (DEBUG)
-						System.out.println("checking if [" + rootStart + ":" + rootEnd + "] contains [" + possStart + ":" + possEnd + "] ... " + contains); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-				}
-			}
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-		return contains;
-	}
-
-	/**
-	 * Remember to release model after use!!
-	 * 
-	 * @return
-	 */
-	public IStructuredModel getStructuredModelForRead(IDocument doc) {
-
-		IStructuredModel sModel = null;
-		if (doc != null)
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
-		return sModel;
-	}
-
-
-	/**
-	 * @param document
-	 */
-	private void hookUpModelLifecycleListener(IDocument document) {
-		IStructuredModel sModel = getStructuredModelForRead(document);
-		try {
-			if (sModel != null) {
-				sModel.addModelLifecycleListener(this);
-			}
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-	}
-
-	/**
-	 * @see org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener#processPostModelEvent(org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent)
-	 */
-	public void processPostModelEvent(ModelLifecycleEvent event) {
-
-		// if underlying StructuredDocument changed, need to reconnect it
-		// here...
-		// ex. file is modified outside the workbench
-		if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED) {
-
-			// check that it's this model that changed
-			IStructuredModel thisModel = getStructuredModelForRead(getDocument());
-			try {
-				if (thisModel != null && event.getModel().equals(thisModel)) {
-
-					IStructuredDocument sDoc = event.getModel().getStructuredDocument();
-
-					if (DEBUG) {
-						System.out.println("======================================================"); //$NON-NLS-1$
-						System.out.println("StructuredRegionProcessor: DOCUMENT MODEL CHANGED TO: "); //$NON-NLS-1$
-						System.out.println(sDoc.get());
-						System.out.println("======================================================"); //$NON-NLS-1$
-					}
-					setDocument(sDoc);
-					// propagate document change
-					// setDocumentOnAllStrategies(sDoc);
-					// ensure that the document is re-reconciled
-					setEntireDocumentDirty(sDoc);
-				}
-			}
-			finally {
-				if (thisModel != null)
-					thisModel.releaseFromRead();
-			}
-		}
-	}
-
-	/**
-	 * @see org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener#processPreModelEvent(org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent)
-	 */
-	public void processPreModelEvent(ModelLifecycleEvent event) {
-
-		if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED) {
-
-			getDirtyRegionQueue().clear();
-			// note: old annotations are removed via the strategies on
-			// AbstractStructuredTextReconcilingStrategy#setDocument(...)
-		}
-	}
-
-	/**
-	 * Reinitializes listeners and sets new document onall strategies.
-	 * 
-	 * @see org.eclipse.jface.text.reconciler.AbstractReconciler#reconcilerDocumentChanged(IDocument)
-	 */
-	protected void reconcilerDocumentChanged(IDocument newDocument) {
-
-		IDocument currentDoc = getDocument();
-
-		// unhook old lifecycle listner
-		unhookModelLifecycleListener(currentDoc);
-		// add new lifecycle listener
-		if (newDocument != null)
-			hookUpModelLifecycleListener(newDocument);
-
-		// hooks up new document listener
-		// sets document on all strategies
-		super.reconcilerDocumentChanged(newDocument);
-	}
-
-	/**
-	 * @param document
-	 */
-	private void unhookModelLifecycleListener(IDocument document) {
-		IStructuredModel sModel = getStructuredModelForRead(document);
-		try {
-			if (sModel != null)
-				sModel.removeModelLifecycleListener(this);
-
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-	}
-
-	public void uninstall() {
-		
-		// removes model listeners
-		unhookModelLifecycleListener(getDocument());
-		super.uninstall();
-	}
-	
-	/**
-	 * We already know content type from when we created the model, so just use that.
-	 */
-	protected String getContentType(IDocument doc) {
-
-		String contentTypeId = null;
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
-			if (sModel != null) {
-				contentTypeId = sModel.getContentTypeIdentifier();
-			}
-		} finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-		return contentTypeId;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredTextReconcilingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredTextReconcilingStrategy.java
deleted file mode 100644
index ca4b90b..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredTextReconcilingStrategy.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.reconcile;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.ISourceViewer;
-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.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.ui.internal.StructuredMarkerAnnotation;
-
-/**
- * Uses IStructuredModel nodes to check "overlaps()" when getting annotations to remove.
- */
-public abstract class StructuredTextReconcilingStrategy extends AbstractStructuredTextReconcilingStrategy {
-	
-
-	public StructuredTextReconcilingStrategy(ISourceViewer sourceViewer) {
-		super(sourceViewer);
-	}
-
-	protected TemporaryAnnotation[] getAnnotationsToRemove(DirtyRegion dr) {
-		IDocument doc = getDocument();
-		IStructuredDocument sDoc = null;
-		
-		if(doc instanceof IStructuredDocument)
-			sDoc = (IStructuredDocument)doc;
-		
-		// if there's no structured document
-		// do regular IDocument remove in super
-		if(sDoc == null)
-			return super.getAnnotationsToRemove(dr);
-			
-		IStructuredDocumentRegion[] sdRegions = sDoc.getStructuredDocumentRegions(dr.getOffset(), dr.getLength());
-		List remove = new ArrayList();
-		IAnnotationModel annotationModel = getAnnotationModel();
-		// can be null when closing the editor
-		if (getAnnotationModel() != null) {
-			
-			// clear validator annotations
-			getMarkerAnnotations().clear();
-			
-			Iterator i = annotationModel.getAnnotationIterator();
-			while (i.hasNext()) {
-				
-				Object obj = i.next();
-				
-				// check if it's a validator marker annotation
-				// if it is save it for comparision later (to "gray" icons)
-				if(obj instanceof StructuredMarkerAnnotation) {
-					StructuredMarkerAnnotation sma = (StructuredMarkerAnnotation)obj;
-					if(sma.getAnnotationType() == TemporaryAnnotation.ANNOT_ERROR || sma.getAnnotationType() == TemporaryAnnotation.ANNOT_WARNING)
-						getMarkerAnnotations().add(sma);
-				}
-				
-				if (!(obj instanceof TemporaryAnnotation))
-					continue;
-
-				TemporaryAnnotation annotation = (TemporaryAnnotation) obj;
-				ReconcileAnnotationKey key = (ReconcileAnnotationKey) annotation.getKey();
-				
-				// then if this strategy knows how to add/remove this
-				// partition type
-				if (canHandlePartition(key.getPartitionType()) /*&& containsStep(key.getStep())*/) {
-					if (key.getScope() == ReconcileAnnotationKey.PARTIAL && overlaps(annotation.getPosition(), sdRegions)) {
-						remove.add(annotation);
-					}
-					else if (key.getScope() == ReconcileAnnotationKey.TOTAL) {
-						remove.add(annotation);
-					}
-				}
-			}
-		}
-		return (TemporaryAnnotation[]) remove.toArray(new TemporaryAnnotation[remove.size()]);
-	}
-
-	/**
-	 * Checks if this position overlaps any of the StructuredDocument regions'
-	 * correstponding IndexedRegion.
-	 * 
-	 * @param pos
-	 * @param dr
-	 * @return true if the position overlaps any of the regions, otherwise
-	 *         false.
-	 */
-	protected boolean overlaps(Position pos, IStructuredDocumentRegion[] sdRegions) {
-		int start = -1;
-		int end = -1;
-		for (int i = 0; i < sdRegions.length; i++) {
-		    if(!sdRegions[i].isDeleted()) {
-    			IndexedRegion corresponding = getCorrespondingNode(sdRegions[i]);
-                if(corresponding != null) {
-        			if (start == -1 || start > corresponding.getStartOffset())
-        				start = corresponding.getStartOffset();
-        			if (end == -1 || end < corresponding.getEndOffset())
-        				end = corresponding.getEndOffset();
-                }
-            }
-		}
-		return pos.overlapsWith(start, end - start);
-	}
-
-	/**
-	 * Returns the corresponding node for the StructuredDocumentRegion.
-	 * 
-	 * @param sdRegion
-	 * @return the corresponding node for sdRegion
-	 */
-	protected IndexedRegion getCorrespondingNode(IStructuredDocumentRegion sdRegion) {
-		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
-        IndexedRegion indexedRegion = null;
-        try {
-            if (sModel != null) 
-                indexedRegion = sModel.getIndexedRegion(sdRegion.getStart());    
-        } finally {
-            if (sModel != null)
-                sModel.releaseFromRead();
-        }
-        return indexedRegion;
-    }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java
deleted file mode 100644
index 97b9dff..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java
+++ /dev/null
@@ -1,232 +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.sse.ui.internal.reconcile;
-
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.reconciler.IReconcileResult;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationAccessExtension;
-import org.eclipse.jface.text.source.IAnnotationPresentation;
-import org.eclipse.jface.text.source.ImageUtilities;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.texteditor.AnnotationPreference;
-import org.eclipse.ui.texteditor.AnnotationPreferenceLookup;
-import org.eclipse.wst.sse.ui.internal.ITemporaryAnnotation;
-
-
-/**
- * An implementation of ITemporaryAnnotation @
- * @author pavery
- */
-public class TemporaryAnnotation extends Annotation implements ITemporaryAnnotation, IReconcileResult, IAnnotationPresentation {
-	// remember to change these if it changes in the extension point
-	// may need a different home for them in the future, but they're here for
-	// now
-	public final static String ANNOT_ERROR = "org.eclipse.wst.sse.ui.temp.error"; //$NON-NLS-1$
-	public final static String ANNOT_INFO = "org.eclipse.wst.sse.ui.temp.info"; //$NON-NLS-1$
-
-	// pa_TODO what should the ID be for this?
-	public final static String ANNOT_UNKNOWN = Annotation.TYPE_UNKNOWN;
-	public final static String ANNOT_WARNING = "org.eclipse.wst.sse.ui.temp.warning"; //$NON-NLS-1$
-
-	public final static String ANNOT_BREAKPOINT = "org.eclipse.wst.sse.ui.breakpoint"; //$NON-NLS-1$
-    
-    // copied from CompilationUnitDocumentProvider.ProblemAnnotation
-    //XXX: To be fully correct these constants should be non-static
-
-    private static final int INFO_LAYER;
-
-    private static final int WARNING_LAYER;
-
-    private static final int ERROR_LAYER;
-
-    static {
-        AnnotationPreferenceLookup lookup= EditorsUI.getAnnotationPreferenceLookup();
-        INFO_LAYER= computeLayer("org.eclipse.wst.sse.ui.temp.info", lookup); //$NON-NLS-1$
-        WARNING_LAYER= computeLayer("org.eclipse.wst.sse.ui.temp.warning", lookup); //$NON-NLS-1$
-        ERROR_LAYER= computeLayer("org.eclipse.wst.sse.ui.temp.error", lookup); //$NON-NLS-1$
-    }
-    
-    private static int computeLayer(String annotationType, AnnotationPreferenceLookup lookup) {
-        Annotation annotation= new Annotation(annotationType, false, null);
-        AnnotationPreference preference= lookup.getAnnotationPreference(annotation);
-        if (preference != null)
-            return preference.getPresentationLayer() + 1;
-        else
-            return IAnnotationAccessExtension.DEFAULT_LAYER + 1;
-    }
-    
-    
-	private Object fAdditionalFixInfo = null;
-
-	private Object fKey = null;
-	private Position fPosition = null;
-
-	private int fProblemID;
-
-    private int fLayer = DEFAULT_LAYER;
-    
-    private Image fImage = null;
-
-	public TemporaryAnnotation(Position p, String type, String message, ReconcileAnnotationKey key) {
-		super();
-		fPosition = p;
-		setType(type);
-		fKey = key;
-		setText(message);
-        initLayer();
-        initImage();
-	}
-
-	public TemporaryAnnotation(Position p, String type, String message, ReconcileAnnotationKey key, int problemId) {
-		super();
-		fPosition = p;
-		fKey = key;
-		setType(type);
-		setText(message);
-		fProblemID = problemId;
-        initLayer();
-        initImage();
-	}
-
-    private void initLayer() {
-        
-        String type = getType();
-        if(type.equals(ANNOT_ERROR)) {
-            fLayer = ERROR_LAYER;
-        }
-        else if(type.equals(ANNOT_WARNING)) {
-            fLayer = WARNING_LAYER;
-        }
-        else if(type.equals(ANNOT_INFO)) {
-            fLayer = INFO_LAYER;
-        }
-    }
-    
-    private void initImage() {
-        // later we can add support for quick fix images.
-        String type = getType();
-        if(type.equals(ANNOT_ERROR)) {
-            fImage = null;
-        }
-        else if(type.equals(ANNOT_WARNING)) {
-            fImage = null;
-        }
-        else if(type.equals(ANNOT_INFO)) {
-            fImage = null;
-        }
-    }
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.Object#equals(java.lang.Object)
-	 */
-	public boolean equals(Object obj) {
-		// this check doesn't take into consideration that annotation
-		// positions that change from a text edit before it
-		// we should be checking if the annotation is still on the same line,
-		// and the distance from the start of the line is the same
-		if (obj instanceof TemporaryAnnotation) {
-
-			TemporaryAnnotation ta = (TemporaryAnnotation) obj;
-
-            boolean samePosition = ta.getPosition().equals(this.getPosition());
-            boolean sameText = false;
-
-            if(ta.getText() != null && this.getText() != null && ta.getText().equals(this.getText()))
-                sameText = true;
-            else if(ta.getText( )== null && this.getText() == null)
-                sameText = true;
-            
-			return  sameText && samePosition;
-		}
-		return super.equals(obj);
-	}
-
-	/**
-	 * Additional info required to fix this problem.
-	 * 
-	 * @return an Object that contains additional info on how to fix this
-	 *         problem, or null if there is none
-	 */
-	public Object getAdditionalFixInfo() {
-		return fAdditionalFixInfo;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.ITemporaryAnnotation#getDescription()
-	 */
-	public String getDescription() {
-		return getText();
-	}
-
-	public Object getKey() {
-		return fKey;
-	}
-
-	public Position getPosition() {
-		return fPosition;
-	}
-
-	/**
-	 * @return Returns the problemID.
-	 */
-	public int getProblemID() {
-		return fProblemID;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.source.Annotation#isPersistent()
-	 */
-	public boolean isPersistent() {
-		return false;
-	}
-
-	/**
-	 * Sets additional information useful to fixing this problem.
-	 * 
-	 * @param an
-	 *            Object that contains additional info on how to fix this
-	 *            problem
-	 */
-	public void setAdditionalFixInfo(Object info) {
-		fAdditionalFixInfo = info;
-	}
-
-    public int getLayer() {
-        return fLayer;
-    }
-    
-    /*
-     * @see Annotation#paint
-     */
-    public void paint(GC gc, Canvas canvas, Rectangle r) {
-        //initializeImages();
-        if (fImage != null)
-            ImageUtilities.drawImage(fImage, gc, canvas, r, SWT.CENTER, SWT.TOP);
-    }
-    
-	public String toString() {
-		return "" + fPosition.getOffset() + ':' + fPosition.getLength() + ": " + getText(); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/AnnotationInfo.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/AnnotationInfo.java
deleted file mode 100644
index 609420e..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/AnnotationInfo.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.reconcile.validator;
-
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * Holds info to create a TemporaryAnnotation.
- *
- * @since 1.0
- */
-public class AnnotationInfo {
-	
-	public static final int NO_PROBLEM_ID = -1;
-	private	IMessage fMessage = null;
-	private Object fAdditionalFixInfo = null;
-	private int fProblemId = NO_PROBLEM_ID;
-	
-	public AnnotationInfo(IMessage message) {
-		fMessage = message;
-		
-	}
-	public AnnotationInfo(IMessage message, int problemId, Object additionalFixInfo) {
-		this(message);
-		fProblemId = problemId;
-		fAdditionalFixInfo = additionalFixInfo;
-	}
-	
-	public final IMessage getMessage() {
-		return fMessage;
-	}
-	
-	public final Object getAdditionalFixInfo() {
-		return fAdditionalFixInfo;
-	}
-	
-	public final int getProblemId() {
-		return fProblemId;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ISourceValidator.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ISourceValidator.java
deleted file mode 100644
index 1e09976..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ISourceValidator.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.reconcile.validator;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-
-/**
- * Interface to allow for "partial document" as you type validation.
- *
- */
-public interface ISourceValidator {
-	
-	/**
-	 * As you type validation is getting "hooked up" to this IDocument.
-	 * This is the instance of IDocument that the validator should
-	 * operate on for each validate call.
-	 * 
-	 * @param document
-	 */
-	void connect(IDocument document);
-	
-	/**
-	 * The same IDocument passed in from the connect() method.
-	 * This indicates that as you type validation is "shutting down"
-	 * for this IDocument.
-	 * 
-	 * @param document
-	 */
-	void disconnect(IDocument document);
-	
-	/**
-	 * Like IValidator#validate(IValidationContext helper, IReporter reporter)
-	 * except passes the dirty region, so document validation can be better
-	 * optimized.
-	 * 
-	 * @param dirtyRegion
-	 * @param helper
-	 * @param reporter
-	 */
-	void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalHelper.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalHelper.java
deleted file mode 100644
index 7b3ce34..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalHelper.java
+++ /dev/null
@@ -1,57 +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.sse.ui.internal.reconcile.validator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-
-
-
-public class IncrementalHelper implements IValidationContext {
-	private IProject fProject;
-
-	private String fURI = null;
-	
-	public IncrementalHelper(IDocument sourceDocument, IProject project) {
-		super();
-		fProject = project;
-	}
-
-	public String getPortableName(IResource resource) {
-		return resource.getProjectRelativePath().toString();
-	}
-
-	public IProject getProject() {
-		return fProject;
-	}
-
-	public Object loadModel(String symbolicName) {
-		return null;
-	}
-
-	public Object loadModel(String symbolicName, Object[] parms) {
-		return null;
-	}
-
-	void setURI(String uri) {
-		fURI = uri;
-	}
-	
-	public String[] getURIs() {
-		if(fURI != null)
-			return new String[]{fURI};
-		return new String[0];
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalReporter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalReporter.java
deleted file mode 100644
index f67dae7..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalReporter.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.sse.ui.internal.reconcile.validator;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-
-
-/**
- * Right now we'll only use one reporter per validator.
- */
-public class IncrementalReporter implements IReporter {
-	private IProgressMonitor fProgressMonitor;
-	private HashMap messages = new HashMap();
-
-	public IncrementalReporter(IProgressMonitor progressMonitor) {
-		super();
-		fProgressMonitor = progressMonitor;
-	}
-
-	public void addMessage(IValidator validator, IMessage message) {
-		AnnotationInfo info = new AnnotationInfo(message);
-		addAnnotationInfo(validator, info);
-	}
-
-	public final void addAnnotationInfo(IValidator validator, AnnotationInfo info) {
-		Object existingValue = messages.get(validator);
-		if (existingValue != null) {
-			((HashSet) existingValue).add(info);
-		}
-		else {
-			HashSet newValue = new HashSet(1);
-			newValue.add(info);
-			messages.put(validator, newValue);
-		}
-	}
-
-	public void displaySubtask(IValidator validator, IMessage message) {
-		if ((message == null) || (message.equals(""))) { //$NON-NLS-1$
-			return;
-		}
-		if (fProgressMonitor != null) {
-			fProgressMonitor.subTask(message.getText(validator.getClass().getClassLoader()));
-		}
-	}
-
-	public List getMessages() {
-		List result = new ArrayList();
-		// messages is a list of:
-		// validators => HashSet(AnnotationInfo1, AnnotationInfo2, ...)
-		// (one HashSet per validator...)
-		Object[] lists = messages.values().toArray();
-		for (int i = 0; i < lists.length; i++) {
-			Iterator it = ((HashSet)lists[i]).iterator();
-			while (it.hasNext()) {
-				AnnotationInfo info = (AnnotationInfo) it.next();
-				result.add(info.getMessage());
-			}
-		}
-		return result;
-	}
-	
-	public AnnotationInfo[] getAnnotationInfo() {
-		List result = new ArrayList();
-		Object[] infos = messages.values().toArray();
-		for (int i = 0; i < infos.length; i++) {
-			result.addAll((HashSet)infos[i]);
-		}
-		return (AnnotationInfo[])result.toArray(new AnnotationInfo[result.size()]);
-	}
-
-	public boolean isCancelled() {
-		if (fProgressMonitor == null)
-			return false;
-		return fProgressMonitor.isCanceled();
-	}
-
-	public void removeAllMessages(IValidator validator) {
-		Object o = messages.get(validator);
-		if(o != null && o instanceof HashSet) {
-			((HashSet)o).clear();
-		}
-	}
-
-	public void removeAllMessages(IValidator validator, Object object) {
-		removeAllMessages(validator);
-	}
-
-	// group names are unsupported
-	public void removeMessageSubset(IValidator validator, Object obj, String groupName) {
-		removeAllMessages(validator);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java
deleted file mode 100644
index afee08d..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java
+++ /dev/null
@@ -1,352 +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.sse.ui.internal.reconcile.validator;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcilableModel;
-import org.eclipse.jface.text.reconciler.IReconcileResult;
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter;
-import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredReconcileStep;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-
-
-/**
- * A reconcile step for an IValidator for reconcile. Used the reconcile
- * framework to create TemporaryAnnotations from the validator messages.
- * 
- * @author pavery
- */
-public class ReconcileStepForValidator extends StructuredReconcileStep {
-
-	/** debug flag */
-	protected static final boolean DEBUG;
-	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerjob"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-	}
-
-	private final IReconcileResult[] EMPTY_RECONCILE_RESULT_SET = new IReconcileResult[0];
-	private IncrementalHelper fHelper = null;
-	private IncrementalReporter fReporter = null;
-	private int fScope = -1;
-	private IValidator fValidator = null;
-
-
-	public ReconcileStepForValidator(IValidator v, int scope) {
-		super();
-
-		if (v == null)
-			throw new IllegalArgumentException("validator cannot be null"); //$NON-NLS-1$
-
-		fValidator = v;
-		fScope = scope;
-	}
-
-	public ReconcileStepForValidator(IValidator v, IReconcileStep step, int scope) {
-//		super(step);
-		fValidator = v;
-		fScope = scope;
-	}
-
-	/**
-	 * Converts a map of IValidatorForReconcile to List to annotations based
-	 * on those messages
-	 * 
-	 * @param messages
-	 * @return
-	 */
-//	protected IReconcileResult[] createAnnotations(List messageList) {
-//		List annotations = new ArrayList();
-//		for (int i = 0; i < messageList.size(); i++) {
-//			IMessage validationMessage = (IMessage) messageList.get(i);
-//
-//			int offset = validationMessage.getOffset();
-//
-//			if (offset < 0)
-//				continue;
-//
-//			String messageText = null;
-//			try {
-//				messageText = validationMessage.getText(validationMessage.getClass().getClassLoader());
-//			}
-//			catch (Exception t) {
-//				Logger.logException("exception reporting message from validator", t); //$NON-NLS-1$
-//				continue;
-//			}
-//			
-//			String type = getSeverity(validationMessage);
-//			// this position seems like it would be possibly be the wrong
-//			// length
-//			int length = validationMessage.getLength();
-//			if (length >= 0) {
-//				Position p = new Position(offset, length);
-//				ReconcileAnnotationKey key = createKey(getPartitionType(getDocument(), offset), getScope());
-//				annotations.add(new TemporaryAnnotation(p, type, messageText, key));
-//			}
-//		}
-//
-//		return (IReconcileResult[]) annotations.toArray(new IReconcileResult[annotations.size()]);
-//	}
-
-	/**
-	 * Converts a map of IValidatorForReconcile to List to annotations based
-	 * on those messages
-	 * 
-	 * @param messages
-	 * @return
-	 */
-	protected IReconcileResult[] createAnnotations(AnnotationInfo[] infos) {
-		
-	
-		List annotations = new ArrayList();
-		for (int i = 0; i < infos.length; i++) {
-			
-			AnnotationInfo info = infos[i];
-			
-			IMessage validationMessage = info.getMessage();
-			int offset = validationMessage.getOffset();
-			if (offset < 0)
-				continue;
-
-			String messageText = null;
-			try {
-				messageText = validationMessage.getText(validationMessage.getClass().getClassLoader());
-			}
-			catch (Exception t) {
-				Logger.logException("exception reporting message from validator", t); //$NON-NLS-1$
-				continue;
-			}
-			String type = getSeverity(validationMessage);
-			// this position seems like it would be possibly be the wrong
-			// length
-			int length = validationMessage.getLength();
-			if (length >= 0) {
-
-				Position p = new Position(offset, length);
-				ReconcileAnnotationKey key = createKey(getPartitionType(getDocument(), offset), getScope());
-				
-				if(info.getProblemId() == AnnotationInfo.NO_PROBLEM_ID) {
-					// create an annotation w/ no fix info
-					annotations.add(new TemporaryAnnotation(p, type, messageText, key));
-				}
-				else {
-					// create an annotation w/ problem ID and fix info
-					TemporaryAnnotation annotation = new TemporaryAnnotation(p, type, messageText, key, info.getProblemId());
-					annotation.setAdditionalFixInfo(info.getAdditionalFixInfo());
-					annotations.add(annotation);
-				}
-			}
-		}
-		return (IReconcileResult[]) annotations.toArray(new IReconcileResult[annotations.size()]);
-	}
-
-	private String getSeverity(IMessage validationMessage) {
-		String type = TemporaryAnnotation.ANNOT_INFO;
-		switch (validationMessage.getSeverity()) {
-			case IMessage.HIGH_SEVERITY :
-				type = TemporaryAnnotation.ANNOT_ERROR;
-				break;
-			case IMessage.NORMAL_SEVERITY :
-				type = TemporaryAnnotation.ANNOT_WARNING;
-				break;
-			case IMessage.LOW_SEVERITY :
-				type = TemporaryAnnotation.ANNOT_WARNING;
-				break;
-			case IMessage.ERROR_AND_WARNING :
-				type = TemporaryAnnotation.ANNOT_WARNING;
-				break;
-		}
-		return type;
-	}
-	
-	private IFile getFile() {
-		IStructuredModel model = null;
-		IFile file = null;
-		try {
-			model = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
-			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 && !basePath.toFile().exists()) {
-					file = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
-				}
-			}
-		}
-		finally {
-			if (model != null) {
-				model.releaseFromRead();
-			}
-		}
-		return file;
-	}
-
-	private IncrementalHelper getHelper(IProject project) {
-		if (fHelper == null)
-			fHelper = new IncrementalHelper(getStructuredDocument(), project);
-		return fHelper;
-	}
-
-	private IncrementalReporter getReporter() {
-		if (fReporter == null)
-			fReporter = new IncrementalReporter(getProgressMonitor());
-		return fReporter;
-	}
-
-	/**
-	 * If this validator is partial or total
-	 * @return
-	 */
-	public int getScope() {
-		return fScope;
-	}
-
-	public void initialReconcile() {
-		// do nothing
-	}
-
-	protected IReconcileResult[] reconcileModel(DirtyRegion dirtyRegion, IRegion subRegion) {
-		if (DEBUG)
-			System.out.println("[trace reconciler] > reconciling model in VALIDATOR step w/ dirty region: [" + dirtyRegion.getText() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
-
-		IReconcileResult[] results = EMPTY_RECONCILE_RESULT_SET;
-		if (dirtyRegion != null) {
-			try {
-				if(fValidator instanceof ISourceValidator) {
-					results = validate(dirtyRegion, subRegion);
-				}
-				else {
-					results = validate();
-				}
-			}
-			catch (Exception ex) {
-				Logger.logException("EXEPTION IN RECONCILE STEP FOR VALIDATOR", ex); //$NON-NLS-1$
-			}
-		}
-
-		if (DEBUG)
-			System.out.println("[trace reconciler] > VALIDATOR step done"); //$NON-NLS-1$
-
-		return results;
-	}
-
-	public String toString() {
-		StringBuffer debugString = new StringBuffer("ValidatorStep: "); //$NON-NLS-1$
-		if (fValidator != null)
-			debugString.append(fValidator.getClass().toString());
-		return debugString.toString();
-	}
-	
-	protected IReconcileResult[] validate() {
-		IReconcileResult[] results = EMPTY_RECONCILE_RESULT_SET;
-
-		IFile file = getFile();
-
-		if (file != null) {
-			try {
-				IProject project = file.getProject();
-				IncrementalHelper helper = getHelper(project);
-				IncrementalReporter reporter = getReporter();
-
-				helper.setURI(file.getFullPath().toString());
-
-				fValidator.validate(helper, reporter);
-
-				//results = createAnnotations(reporter.getMessages());
-				results = createAnnotations(reporter.getAnnotationInfo());
-				reporter.removeAllMessages(fValidator);
-
-			}
-			catch (Exception e) {
-				Logger.logException(e);
-			}
-		}
-		return results;
-	}
-	
-	public void setInputModel(IReconcilableModel inputModel) {
-		if(inputModel instanceof DocumentAdapter) {
-			IDocument document = ((DocumentAdapter)inputModel).getDocument();
-			if(document != null) {
-				if(fValidator instanceof ISourceValidator) {
-					// notify that document connecting
-					((ISourceValidator)fValidator).connect(document);
-				}
-			}
-		}
-		super.setInputModel(inputModel);
-	}
-	
-	public void release() {
-		if(fValidator instanceof ISourceValidator) {
-			IDocument document = getDocument();
-			if(document != null) {
-				// notify that document disconnecting
-				((ISourceValidator)fValidator).disconnect(document);
-			}
-		}
-		super.release();
-	}
-	
-	protected IReconcileResult[] validate(DirtyRegion dirtyRegion, IRegion subRegion) {
- 		IReconcileResult[] results = EMPTY_RECONCILE_RESULT_SET;
- 
- 		IFile file = getFile();
-		try {
-			IProject project = null;
-			if (file != null)
-				project = file.getProject();
- 
-			IncrementalHelper helper = getHelper(project);
-
-			if (file != null)
-				helper.setURI(file.getFullPath().toString());
- 
-			if(fValidator instanceof ISourceValidator) {
-				IncrementalReporter reporter = getReporter();
-				((ISourceValidator)fValidator).validate(dirtyRegion, helper, reporter);
-				//results = createAnnotations(reporter.getMessages());
-				results = createAnnotations(reporter.getAnnotationInfo());
-				reporter.removeAllMessages(fValidator);
-			}
-
-		} catch (Exception e) {
-			Logger.logException(e);
- 		}
- 		return results;
- 	}
-	
-	
-	
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorBuilder.java
deleted file mode 100644
index 411f084..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorBuilder.java
+++ /dev/null
@@ -1,139 +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.sse.ui.internal.reconcile.validator;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.extension.RegistryReader;
-
-
-/**
- * Based off of TransferBuilder. Reads the extension point for
- * <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code>
- */
-public class ValidatorBuilder extends RegistryReader {
-    
-	public static final String ATT_CLASS = "class"; //$NON-NLS-1$
-	public static final String ATT_ID = "id"; //$NON-NLS-1$
-	public static final String ATT_SCOPE = "scope"; //$NON-NLS-1$
-
-	public static final ValidatorMetaData[] EMTPY_VMD_ARRAY = new ValidatorMetaData[0];
-
-	// extension point ID
-	public static final String PL_SOURCE_VALIDATION = "sourcevalidation"; //$NON-NLS-1$
-
-	public static final String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
-	public static final String TAG_CONTENT_TYPE_IDENTIFIER = "contentTypeIdentifier"; //$NON-NLS-1$
-	public static final String TAG_PARTITION_TYPE = "partitionType"; //$NON-NLS-1$
-
-	public static final String TAG_VALIDATOR = "validator"; //$NON-NLS-1$
-
-	public static final String TRACE_FILTER = "reconcile_validator"; //$NON-NLS-1$
-
-	public static final String TRUE = "true"; //$NON-NLS-1$
-	private String fCurrentCTID;
-	private ValidatorMetaData fCurrentVMD = null;
-	private List fVmds = new ArrayList();
-	protected String targetContributionTag;
-	protected String targetID;
-
-    private final String UNKNOWN = "???"; //$NON-NLS-1$
-    
-	/**
-	 * Returns the name of the part ID attribute that is expected in the
-	 * target extension.
-	 * 
-	 * @param element
-	 * @return String
-	 */
-	protected String getID(IConfigurationElement element) {
-		String value = element.getAttribute(ATT_ID);
-		return value != null ? value : UNKNOWN; //$NON-NLS-1$
-	}
-
-	protected String getValidatorClass(IConfigurationElement element) {
-		String value = element.getAttribute(ATT_CLASS);
-		return value != null ? value : UNKNOWN; //$NON-NLS-1$
-	}
-
-	/**
-	 * @param editorId
-	 * @return Transfer[]
-	 */
-	public ValidatorMetaData[] getValidatorMetaData(String editorId) {
-		readContributions(editorId, TAG_VALIDATOR, PL_SOURCE_VALIDATION);
-		return (ValidatorMetaData[]) fVmds.toArray(new ValidatorMetaData[fVmds.size()]);
-	}
-
-	protected String getValidatorScope(IConfigurationElement element) {
-		String value = element.getAttribute(ATT_SCOPE);
-		return value != null ? value : UNKNOWN; //$NON-NLS-1$
-	}
-
-	/**
-	 * Reads the contributions from the registry for the provided workbench
-	 * part and the provided extension point ID.
-	 * 
-	 * @param id
-	 * @param tag
-	 * @param extensionPoint
-	 */
-	protected void readContributions(String id, String tag, String extensionPoint) {
-		targetID = id;
-		targetContributionTag = tag;
-		IExtensionRegistry registry = Platform.getExtensionRegistry();
-		readRegistry(registry, PLUGIN_ID, extensionPoint);
-	}
-
-	protected boolean readElement(IConfigurationElement element) {
-		String tag = element.getName();
-		//ie. targetContributionTag == validator
-		if (tag.equals(targetContributionTag)) {
-			String vId = getID(element);
-			String vClass = getValidatorClass(element);
-			String vScope = getValidatorScope(element);
-
-			if (vId == null) {
-				// This is not of interest to us - don't go deeper
-				return true;
-			}
-			// start building a VMD
-			fCurrentVMD = new ValidatorMetaData(element, vId, vClass, vScope);
-			fVmds.add(fCurrentVMD);
-
-			if (Logger.isTracing(ValidatorBuilder.TRACE_FILTER))
-				System.out.println("added reconcile validator: " + vId + ":" + vClass + ":" + vScope); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		} else if (tag.equals(TAG_CONTENT_TYPE_IDENTIFIER)) {
-			// add to current VMD
-			fCurrentCTID = getID(element);
-			fCurrentVMD.addContentTypeId(fCurrentCTID);
-		} else if (tag.equals(TAG_PARTITION_TYPE)) {
-			// add to current VMD
-			String partitionType = getID(element);
-			fCurrentVMD.addParitionType(fCurrentCTID, partitionType);
-
-			return true;
-		} else {
-			return false;
-		}
-
-		readElementChildren(element);
-		return true;
-	}
-}
-
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java
deleted file mode 100644
index 370be75..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java
+++ /dev/null
@@ -1,217 +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.sse.ui.internal.reconcile.validator;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Object that holds information relevant to the creation of a validator for
- * the reconciling framework.
- * 
- * @author pavery
- */
-public class ValidatorMetaData {
-	private String fClass = null;
-	private IConfigurationElement fConfigurationElement = null;
-	private String fId = null;
-    private String fScope;
-
-	// a hash map of content type Ids (String) that points to lists of
-	// partition types (List of Strings)
-	// contentTypeId -> List(paritionType, paritionType, partitionType, ...)
-	// contentTypeId2 -> List(partitionType, partitionType, ...)
-	// ...
-	private HashMap fMatrix = null;
-
-	public ValidatorMetaData(IConfigurationElement element, String vId, String vClass, String vScope) {
-		fId = vId;
-		fClass = vClass;
-		fConfigurationElement = element;
-		fScope = vScope;
-		fMatrix = new HashMap();
-	}
-
-    /**
-     * TODO: This exact method is also in ValidatorStrategy. Should be in a common place.
-     * 
-     * @param contentTypeId
-     * @return
-     */
-    private String[] calculateParentContentTypeIds(String contentTypeId) {
-
-        Set parentTypes = new HashSet();
-        
-        IContentTypeManager ctManager = Platform.getContentTypeManager();    
-        IContentType ct = ctManager.getContentType(contentTypeId);
-        String id = contentTypeId;
-
-        while(ct != null && id != null) {
-            
-            parentTypes.add(id);
-            ct = ctManager.getContentType(id);
-            if(ct != null) {
-                IContentType baseType = ct.getBaseType();
-                id = (baseType != null) ? baseType.getId() : null;
-            }
-        }
-        return (String[])parentTypes.toArray(new String[parentTypes.size()]);
-    }
-    
-	public void addContentTypeId(String contentTypeId) {
-		if (!fMatrix.containsKey(contentTypeId))
-			fMatrix.put(contentTypeId, new ArrayList());
-	}
-
-	public void addParitionType(String contentTypeId, String partitionType) {
-		if (!fMatrix.containsKey(contentTypeId))
-			fMatrix.put(contentTypeId, new ArrayList());
-
-		List partitionList = (List) fMatrix.get(contentTypeId);
-		partitionList.add(partitionType);
-	}
-
-	public boolean canHandleContentType(String contentType) {
-        // need to iterate hierarchy
-        String[] contentHierarchy = calculateParentContentTypeIds(contentType);
-        for (int i = 0; i < contentHierarchy.length; i++) {
-            if(fMatrix.containsKey(contentHierarchy[i]))
-                return true;
-        }
-        return false;
-	}
-
-	public boolean canHandleParitionType(String contentTypeIds[], String paritionType) {
-        for(int i=0; i<contentTypeIds.length; i++) {
-    		if (fMatrix.containsKey(contentTypeIds[i])) {
-    			List partitions = (List) fMatrix.get(contentTypeIds[i]);
-    			for (int j = 0; j < partitions.size(); j++) {
-    				if (paritionType.equals(partitions.get(j)))
-    					return true;
-    			}
-    		}
-        }
-		return false;
-	}
-
-	/**
-	 * @param element
-	 * @param classAttribute
-	 * @return Object
-	 * @throws CoreException
-	 */
-	Object createExecutableExtension(final IConfigurationElement element, final String classAttribute) throws CoreException {
-		Object obj = null;
-		obj = element.createExecutableExtension(classAttribute);
-		return obj;
-	}
-
-	/**
-	 * Creates an extension. If the extension plugin has not been loaded a
-	 * busy cursor will be activated during the duration of the load.
-	 * 
-	 * @param element
-	 * @param classAttribute
-	 * @return Object
-	 * @throws CoreException
-	 */
-	public Object createExtension() {
-		// If plugin has been loaded create extension.
-		// Otherwise, show busy cursor then create extension.
-		final IConfigurationElement element = getConfigurationElement();
-		final Object[] result = new Object[1];
-		String pluginId = element.getDeclaringExtension().getNamespace();
-		Bundle bundle = Platform.getBundle(pluginId);
-		if (bundle.getState() == Bundle.ACTIVE) {
-			try {
-				return createExecutableExtension(element, "class"); //$NON-NLS-1$
-			} catch (CoreException e) {
-				handleCreateExecutableException(result, e);
-			}
-		} else {
-			BusyIndicator.showWhile(null, new Runnable() {
-				public void run() {
-					try {
-						result[0] = createExecutableExtension(element, "class"); //$NON-NLS-1$
-					} catch (Exception e) {
-						handleCreateExecutableException(result, e);
-					}
-				}
-			});
-		}
-		return result[0];
-	}
-
-	/**
-	 * @return a validator instance based on this ValidatorMetaData instance
-	 */
-	public IValidator createValidator() {
-		Object obj = null;
-		obj = createExtension();
-		if (obj == null) {
-			return null;
-		}
-		return (obj instanceof IValidator) ? (IValidator) obj : null;
-	}
-
-	public IConfigurationElement getConfigurationElement() {
-		return fConfigurationElement;
-	}
-
-	public String getValidatorClass() {
-		return fClass;
-	}
-
-	public String getValidatorId() {
-		return fId;
-	}
-
-	/**
-	 * @param result
-	 * @param e
-	 */
-	void handleCreateExecutableException(Object[] result, Throwable e) {
-		Logger.logException(e);
-		e.printStackTrace();
-		result[0] = null;
-	}
-
-    public int getValidatorScope() {
-        return fScope.equalsIgnoreCase("total") ? ReconcileAnnotationKey.TOTAL : ReconcileAnnotationKey.PARTIAL; //$NON-NLS-1$
-    }
-    
-	/**
-	 * @see java.lang.Object#toString()
-	 */
-	public String toString() {
-		StringBuffer debugString = new StringBuffer("ValidatorMetaData:"); //$NON-NLS-1$
-		if (fId != null)
-			debugString.append(" [id:" + fId + "]"); //$NON-NLS-1$ //$NON-NLS-2$
-		return debugString.toString();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
deleted file mode 100644
index e36b5f3..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
+++ /dev/null
@@ -1,227 +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.sse.ui.internal.reconcile.validator;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.reconciler.DirtyRegion;
-import org.eclipse.jface.text.reconciler.IReconcileResult;
-import org.eclipse.jface.text.reconciler.IReconcileStep;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredReconcileStep;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredTextReconcilingStrategy;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-
-
-/**
- * Special validator strategy. Runs validator steps contributed via the
- * <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code> extension point
- * 
- * @author pavery
- */
-public class ValidatorStrategy extends StructuredTextReconcilingStrategy {
-	
-    private String[] fContentTypeIds = null;
-    /** validator id (as declared in ext point) -> ReconcileStepForValidator **/
-	private HashMap fVidToVStepMap = null;
-	private List fMetaData = null;
-
-	public ValidatorStrategy(ISourceViewer sourceViewer, String contentType) {
-		super(sourceViewer);
-		fMetaData = new ArrayList();
-		fContentTypeIds = calculateParentContentTypeIds(contentType);
-		fVidToVStepMap = new HashMap();
-	}
-
-	/**
-     * The content type passed in should be the most specific one.   
-     * TODO: This exact method is also in ValidatorMetaData. Should be in a common place.
-     * 
-     * @param contentType
-     * @return
-     */
-    private String[] calculateParentContentTypeIds(String contentTypeId) {
-
-        Set parentTypes = new HashSet();
-        
-        IContentTypeManager ctManager = Platform.getContentTypeManager();    
-        IContentType ct = ctManager.getContentType(contentTypeId);
-        String id = contentTypeId;
-
-        while(ct != null && id != null) {
-            
-            parentTypes.add(id);
-            ct = ctManager.getContentType(id);
-            if(ct != null) {
-                IContentType baseType = ct.getBaseType();
-                id = (baseType != null) ? baseType.getId() : null;
-            }
-        }
-        return (String[])parentTypes.toArray(new String[parentTypes.size()]);
-    }
-
-    public void addValidatorMetaData(ValidatorMetaData vmd) {
-		fMetaData.add(vmd);
-	}
-
-    /**
-     * 
-     * @param partitionType
-     * @return true if the strategy contains at least one ValidatorMetaData
-     *          that says it can handle the partition type (for a given content type) 
-     */
-	public boolean canValidatePartition(String partitionType) {
-		ValidatorMetaData vmd = null;
-		for (int i = 0; i < fMetaData.size(); i++) {
-			vmd = (ValidatorMetaData) fMetaData.get(i);
-			if (vmd.canHandleParitionType(getContentTypeIds(), partitionType))
-				return true;
-		}
-		return false;
-	}
-	
-	protected boolean canHandlePartition(String partition) {
-		return canValidatePartition(partition);
-	}
-
-	/*
-	 * so that removal will work properly
-	 * 
-	 * @see org.eclipse.wst.sse.ui.reconcile.AbstractStructuredTextReconcilingStrategy#containsStep(org.eclipse.jface.text.reconciler.IReconcileStep)
-	 */
-	protected boolean containsStep(IReconcileStep step) {
-		return step != null ? fVidToVStepMap.values().contains(step) : false;
-	}
-
-	/**
-	 * @see org.eclipse.wst.sse.ui.internal.provisional.reconcile.AbstractStructuredTextReconcilingStrategy#createReconcileSteps()
-	 */
-	public void createReconcileSteps() {
-		// do nothing, steps are created
-	}
-
-	public String[] getContentTypeIds() {
-		return fContentTypeIds;
-	}
-
-	/*
-	 * so that removal will work properly
-	 * 
-	 * @see org.eclipse.wst.sse.ui.reconcile.AbstractStructuredTextReconcilingStrategy#getPartitionTypes()
-	 */
-	public String[] getPartitionTypes() {
-		List partitionTypes = new ArrayList();
-		Iterator keys = fVidToVStepMap.keySet().iterator();
-		String key = null;
-		while (keys.hasNext()) {
-			key = (String) keys.next();
-			StructuredReconcileStep step = (StructuredReconcileStep) fVidToVStepMap.get(key);
-			partitionTypes.addAll(Arrays.asList(step.getPartitionTypes()));
-		}
-		return (String[]) partitionTypes.toArray(new String[partitionTypes.size()]);
-	}
-	/**
-	 * @param tr Partition of the region to reconcile.
-	 * @param dr Dirty region representation of the typed region
-	 */
-	public void reconcile(ITypedRegion tr, DirtyRegion dr) {
-		
-		if(isCanceled())
-			return;
-		
-		IDocument doc = getDocument();
-		// for external files, this can be null
-		if (doc == null) 
-			return;
-			
-		String partitionType = tr.getType();
-		if (canValidatePartition(partitionType)) {
-			ValidatorMetaData vmd = null;
-
-			// IReconcileResult[]
-			ArrayList annotationsToAdd = new ArrayList();
-            // loop all of the relevant validator meta data
-            // to find new annotations
-			for (int i = 0; i < fMetaData.size() && !isCanceled(); i++) {
-				vmd = (ValidatorMetaData) fMetaData.get(i);
-				if (vmd.canHandleParitionType(getContentTypeIds(), partitionType)) {
-					// get step for partition type
-					Object o = fVidToVStepMap.get(vmd.getValidatorId());
-					ReconcileStepForValidator validatorStep = null;
-					if (o != null) {
-						validatorStep = (ReconcileStepForValidator) o;
-					} else {
-						// if doesn't exist, create one
-						IValidator validator = vmd.createValidator();
-						validatorStep = new ReconcileStepForValidator(validator, vmd.getValidatorScope());
-						validatorStep.setInputModel(new DocumentAdapter(doc));
-
-						fVidToVStepMap.put(vmd.getValidatorId(), validatorStep);
-					}
-					annotationsToAdd.addAll(Arrays.asList(validatorStep.reconcile(dr, dr)));
-				}
-			}
-            
-            TemporaryAnnotation[] annotationsToRemove= getAnnotationsToRemove(dr);   
-            if (annotationsToRemove.length + annotationsToAdd.size() > 0)
-                smartProcess(annotationsToRemove, (IReconcileResult[]) annotationsToAdd.toArray(new IReconcileResult[annotationsToAdd.size()]));
-  
-		}
-	}
-
-    /**
-	 * @see org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument)
-	 */
-	public void setDocument(IDocument document) {
-		
-		super.setDocument(document);
-		
-		// validator steps are in "fVIdToVStepMap" (as opposed to fFirstStep >
-		// next step etc...)
-		Iterator it = fVidToVStepMap.values().iterator();
-		IReconcileStep step = null;
-		while (it.hasNext()) {
-			step = (IReconcileStep) it.next();
-			step.setInputModel(new DocumentAdapter(document));
-		}
-	}
-	
-	public void release() {
-		super.release();
-		Iterator it = fVidToVStepMap.values().iterator();
-		IReconcileStep step = null;
-		while (it.hasNext()) {
-			step = (IReconcileStep) it.next();
-			if(step instanceof IReleasable)
-				((IReleasable)step).release();
-		}
-	}
-	
-	public boolean isTotalScope() {
-		return true;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchLabelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchLabelProvider.java
deleted file mode 100644
index 3c3d540..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchLabelProvider.java
+++ /dev/null
@@ -1,75 +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.sse.ui.internal.search;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-
-
-
-/**
- * Basic label provider that just provides an image and default text.
- * 
- * @author pavery
- */
-public class BasicSearchLabelProvider implements ILabelProvider {
-
-	public void addListener(ILabelProviderListener listener) {
-		// do nothing
-	}
-
-	public void dispose() {
-		// do nothing
-	}
-
-	public Image getImage(Object element) {
-		return EditorPluginImageHelper.getInstance().getImage(EditorPluginImages.IMG_OBJ_OCC_MATCH);
-	}
-
-	public String getText(Object element) {
-
-		StringBuffer text = new StringBuffer();
-		if (element instanceof Match) {
-			Match m = (Match) element;
-
-			IMarker marker = (IMarker) m.getElement();
-			if (marker.exists()) {
-				String resultText = ""; //$NON-NLS-1$
-				try {
-					resultText = (String) marker.getAttribute(IMarker.MESSAGE);
-				} catch (CoreException e) {
-					Logger.logException(e);
-				}
-				text.append(resultText);
-			}
-		} else {
-			text.append(element.toString());
-		}
-		return text.toString();
-	}
-
-	public boolean isLabelProperty(Object element, String property) {
-		return false;
-	}
-
-	public void removeListener(ILabelProviderListener listener) {
-		// do nothing
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchQuery.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchQuery.java
deleted file mode 100644
index b16fbde..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchQuery.java
+++ /dev/null
@@ -1,212 +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.sse.ui.internal.search;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-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.IWorkspaceRunnable;
-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.Status;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.search.ui.ISearchQuery;
-import org.eclipse.search.ui.ISearchResult;
-import org.eclipse.search.ui.NewSearchUI;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.ui.texteditor.MarkerUtilities;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-/**
- * @author pavery
- */
-public class BasicSearchQuery implements ISearchQuery {
-
-	/** attribute to identify markers added by find occurrences */
-	public static final String ATTR_OCCURRENCES_MARKER = "occurrences_marker"; //$NON-NLS-1$
-
-	private static int LINE_LENGTH_LIMIT = 200;
-
-	/** the file we're searching * */
-	private IFile fFile = null;
-	/** occurrence search matches * */
-	private List fMatches = null;
-
-	public BasicSearchQuery(IFile file) {
-		this.fFile = file;
-		this.fMatches = new ArrayList();
-	}
-
-	public void addMatch(IDocument document, int matchStart, int matchEnd) {
-
-		try {
-			int lineNumber = document.getLineOfOffset(matchStart);
-			int lineStart = document.getLineOffset(lineNumber);
-			int lineLength = document.getLineLength(lineNumber);
-
-			String searchResultString = document.get().substring(lineStart, lineStart + lineLength).trim();
-
-			// create search marker (so annotations show up in editor)
-			IMarker marker = createSearchMarker(matchStart, matchEnd, lineNumber, searchResultString);
-
-			addMatch(new Match(marker, Match.UNIT_CHARACTER, matchStart, matchStart + matchEnd));
-
-		} catch (BadLocationException e) {
-			Logger.logException(e);
-		}
-	}
-
-	private void addMatch(Match match) {
-		if (match != null)
-			this.fMatches.add(match);
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.ISearchQuery#canRerun()
-	 */
-	public boolean canRerun() {
-		return false;
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.ISearchQuery#canRunInBackground()
-	 */
-	public boolean canRunInBackground() {
-		return true;
-	}
-
-	public void clearMatches() {
-		this.fMatches.clear();
-	}
-
-	protected IMarker createSearchMarker(int matchStart, int matchEnd, int lineNumber, String searchResultString) {
-
-		IMarker marker = null;
-		try {
-			if (getFile() != null) {
-
-				marker = getFile().createMarker(NewSearchUI.SEARCH_MARKER);
-				HashMap attributes = new HashMap(6);
-
-				MarkerUtilities.setCharStart(attributes, matchStart);
-				MarkerUtilities.setCharEnd(attributes, matchEnd);
-				MarkerUtilities.setLineNumber(attributes, lineNumber);
-
-				// this might be bad if line of text is VERY long?
-				if (searchResultString.length() > LINE_LENGTH_LIMIT)
-					searchResultString = searchResultString.substring(0, LINE_LENGTH_LIMIT) + "..."; //$NON-NLS-1$
-				MarkerUtilities.setMessage(attributes, searchResultString);
-
-				// so we can remove them later
-				attributes.put(ATTR_OCCURRENCES_MARKER, new Boolean(true));
-
-				marker.setAttributes(attributes);
-			}
-		} catch (CoreException e) {
-			Logger.logException(e);
-		}
-		return marker;
-	}
-
-	private void deleteOccurrencesMarkers() {
-
-		final List removals = new ArrayList();
-		try {
-			// clear all old find occurrences markers
-			IMarker[] searchMarkers = fFile.findMarkers(NewSearchUI.SEARCH_MARKER, false, IResource.DEPTH_ZERO);
-			for (int i = 0; i < searchMarkers.length; i++) {
-				Object o = searchMarkers[i].getAttribute(BasicSearchQuery.ATTR_OCCURRENCES_MARKER);
-				if (o != null && ((Boolean) o).booleanValue() == true)
-					removals.add(searchMarkers[i]);
-
-			}
-
-			if (removals.size() > 0) {
-				IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
-					public void run(IProgressMonitor monitor) throws CoreException {
-						for (int i = 0; i < removals.size(); i++)
-							((IMarker) removals.get(i)).delete();
-					}
-				};
-				ResourcesPlugin.getWorkspace().run(runnable, null);
-			}
-		} catch (CoreException e) {
-			Logger.logException(e);
-		}
-	}
-
-	/**
-	 * The acutal work of the query. Will be run in a background Job
-	 * automatically if canRunInBackground(..) returns true.
-	 * 
-	 * @return
-	 */
-	protected IStatus doQuery() {
-		return Status.OK_STATUS;
-	}
-
-	/*
-	 * public to avoid synthetic method access from inner class
-	 */
-	public IFile getFile() {
-		return this.fFile;
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.ISearchQuery#getLabel()
-	 */
-	public String getLabel() {
-		return ""; //$NON-NLS-1$
-	}
-
-	public Match[] getMatches() {
-		// get rid of the old markers
-		if(fFile.exists()) {
-			deleteOccurrencesMarkers();
-			doQuery();
-		}
-		return (Match[]) this.fMatches.toArray(new Match[this.fMatches.size()]);
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.ISearchQuery#getSearchResult()
-	 */
-	public ISearchResult getSearchResult() {
-		return null;
-	}
-
-	/**
-	 * used in search result display labels
-	 * 
-	 * @return
-	 */
-	protected String getSearchText() {
-		return ""; //$NON-NLS-1$
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.ISearchQuery#run(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public IStatus run(IProgressMonitor monitor) {
-		// defer to "get(...)"
-		return Status.OK_STATUS;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesActionDelegate.java
deleted file mode 100644
index f8bb41c..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesActionDelegate.java
+++ /dev/null
@@ -1,147 +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.sse.ui.internal.search;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-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.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-
-/**
- * Performs the appropriate FindOccurrencesProcessor action call based on
- * selection. Clients can add processors for different partitions via
- * <code>getProcessors</code>
- * 
- */
-abstract public class FindOccurrencesActionDelegate 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(SSEUIMessages.FindOccurrences_label);
-		}
-	}
-
-	public void runWithEvent(IAction action, Event event) {
-		run(action);
-	}
-
-	public void run(IAction action) {
-		boolean okay = false;
-		if (fEditor instanceof ITextEditor) {
-			ITextEditor textEditor = (ITextEditor) fEditor;
-			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$
-			PlatformStatusLineUtil.displayErrorMessage(errorMessage);
-			PlatformStatusLineUtil.addOneTimeClearListener();
-		}
-	}
-
-	public void init(IViewPart view) {
-		// do nothing
-	}
-
-	public void selectionChanged(IAction action, ISelection selection) {
-		// clear status message
-		PlatformStatusLineUtil.clearStatusLine();
-	}
-
-	/**
-	 * 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 action = null;
-		while (it.hasNext()) {
-			action = (FindOccurrencesProcessor) it.next();
-			// we just choose the first action that can handle the partition
-			if (action.enabledForParitition(partition))
-				return action;
-		}
-		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;
-	}
-
-	abstract protected List getProcessors();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesProcessor.java
deleted file mode 100644
index 0c9d09f..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesProcessor.java
+++ /dev/null
@@ -1,121 +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.sse.ui.internal.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.search.ui.NewSearchUI;
-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;
-
-/**
- * <p>
- * Finds occurrences of a specified region type w/ region text in an
- * IStructuredDocument. Clients must implement getPartitionTypes() and
- * getRegionTypes() to indicate which partition types and region types it can
- * operate on.
- * </p>
- * 
- * <p>
- * Clients should override <code>getSearchQuery()</code> in order to provide
- * their own type of "search" (eg. searching for XML start tags, searching for
- * Java elements, etc...)
- * </p>
- * 
- */
-abstract public class 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);
-
-						// first of all activate the view
-						NewSearchUI.activateSearchResultView();
-
-						if (matchText != null && type != null) {
-							ISearchQuery searchQuery = getSearchQuery(file, structuredDocument, matchText, type, textSelection);
-							if (searchQuery != null) {
-								if (searchQuery.canRunInBackground())
-									NewSearchUI.runQueryInBackground(searchQuery);
-								else
-									NewSearchUI.runQueryInForeground(null, searchQuery);
-							}
-							findOccurrences = true;
-						}
-					}
-				}
-			}
-		}
-		return findOccurrences;
-	}
-
-	/**
-	 * @param regionType
-	 * @return <code>true</code> if this action can operate on this region
-	 *         type (ITextRegion), otherwise false.
-	 */
-	private boolean enabledForRegionType(String regionType) {
-
-		String[] accept = getRegionTypes();
-		for (int i = 0; i < accept.length; i++) {
-			if (regionType.equals(accept[i]))
-				return true;
-		}
-		return false;
-	}
-
-	/**
-	 * Clients should override this to enable find occurrences on certain
-	 * partition(s).
-	 */
-	abstract protected String[] getPartitionTypes();
-
-	/**
-	 * Clients should override this to enable find occurrences on different
-	 * region type(s).
-	 */
-	abstract protected String[] getRegionTypes();
-
-	/**
-	 * Clients should override to provide their own search for the file.
-	 */
-	protected ISearchQuery getSearchQuery(IFile file, IStructuredDocument document, String regionText, String regionType, ITextSelection textSelection) {
-		return new OccurrencesSearchQuery(file, document, regionText, regionType);
-	}
-
-	/**
-	 * @param partitionType
-	 * @return <code>true</code> if this action can operate on this type of
-	 *         partition, otherwise <code>false</code>.
-	 */
-	public boolean enabledForParitition(String partitionType) {
-		String[] accept = getPartitionTypes();
-		for (int i = 0; i < accept.length; i++) {
-			if (partitionType.equals(accept[i]))
-				return true;
-		}
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesContentProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesContentProvider.java
deleted file mode 100644
index 11251fd..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesContentProvider.java
+++ /dev/null
@@ -1,89 +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.sse.ui.internal.search;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * @author pavery
- */
-public class OccurrencesContentProvider implements IStructuredContentProvider {
-
-	protected final Object[] EMPTY_ARRAY = new Object[0];
-	private OccurrencesSearchResult fResult = null;
-	private TableViewer fTableViewer = null;
-
-	public void clear() {
-		if (this.fResult != null)
-			this.fResult.clearMatches();
-		if (this.fTableViewer != null)
-			this.fTableViewer.refresh();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
-	 */
-	public void dispose() {
-		// do nothing
-	}
-
-	public void elementsChanged(Object[] updatedElements) {
-
-		//TODO: copied from JavaSearchTableContentProvider
-		int addCount = 0;
-		int removeCount = 0;
-		for (int i = 0; i < updatedElements.length; i++) {
-			if (this.fResult.getMatchCount(updatedElements[i]) > 0) {
-				if (this.fTableViewer.testFindItem(updatedElements[i]) != null)
-					this.fTableViewer.refresh(updatedElements[i]);
-				else
-					this.fTableViewer.add(updatedElements[i]);
-				addCount++;
-			} else {
-				this.fTableViewer.remove(updatedElements[i]);
-				removeCount++;
-			}
-		}
-	}
-
-
-	/**
-	 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
-	 */
-	public Object[] getElements(Object inputElement) {
-
-		this.fResult = (OccurrencesSearchResult) inputElement;
-		return this.fResult.getMatches();
-	}
-
-	/**
-	 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
-	 *      java.lang.Object, java.lang.Object)
-	 */
-	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
-		if (viewer instanceof TableViewer)
-			this.fTableViewer = (TableViewer) viewer;
-		this.fResult = (OccurrencesSearchResult) newInput;
-	}
-
-	public void refresh() {
-
-		if (this.fTableViewer != null)
-			this.fTableViewer.refresh();
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchQuery.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchQuery.java
deleted file mode 100644
index 1cd9035..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchQuery.java
+++ /dev/null
@@ -1,179 +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.sse.ui.internal.search;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.IFile;
-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.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.search.ui.ISearchResult;
-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.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Basic ISearchQuery that finds matches of region type and region text.
- * 
- * @author pavery
- */
-public class OccurrencesSearchQuery extends BasicSearchQuery {
-
-	/**
-	 * We need a runnable so that the search markers show up in the live
-	 * document.
-	 */
-	private class FindRegions implements IWorkspaceRunnable {
-
-		private IStructuredDocument fFindRegionsDocument = null;
-		private String fMatchName = null;
-		private String fMatchRegionType = null;
-
-		public FindRegions(IStructuredDocument document, String matchText, String matchRegionType) {
-
-			this.fFindRegionsDocument = document;
-			this.fMatchName = matchText;
-			this.fMatchRegionType = matchRegionType;
-		}
-
-		private void findOccurrences(IProgressMonitor monitor) {
-
-			if (!isCanceled(monitor)) {
-
-				int matchStart = -1;
-				int matchEnd = -1;
-				String findRegionText = ""; //$NON-NLS-1$
-
-				ITextRegion r = null;
-				ITextRegionList regions = null;
-				IStructuredDocumentRegion current = this.fFindRegionsDocument.getFirstStructuredDocumentRegion();
-
-				// this is the main loop that iterates the document
-				while (current != null && !isCanceled(monitor)) {
-					regions = current.getRegions();
-					for (int i = 0; i < regions.size() && !isCanceled(monitor); i++) {
-
-						r = regions.get(i);
-
-						// maybe this is the equals check where some valid
-						// matches are failing (like searching on end tag)
-						if (r.getType().equals(this.fMatchRegionType) && current.getText(r).equals(this.fMatchName)) {
-
-							findRegionText = current.getText(r);
-
-							// region found
-							matchStart = current.getStartOffset(r);
-							matchEnd = matchStart + findRegionText.trim().length();
-
-							addMatch(this.fFindRegionsDocument, matchStart, matchEnd);
-						}
-					}
-					current = current.getNext();
-				}
-			}
-		}
-
-		private boolean isCanceled(IProgressMonitor monitor) {
-			return monitor != null && monitor.isCanceled();
-		}
-
-		public void run(IProgressMonitor monitor) throws CoreException {
-
-			try {
-				findOccurrences(monitor);
-			} catch (Exception e) {
-				Logger.logException(e);
-			}
-		}
-	}
-
-	// end inner class FindRegions
-
-
-	private IStructuredDocument fDocument = null;
-	private String fRegionText = null;
-	private String fRegionType = null;
-
-	public OccurrencesSearchQuery(IFile file, IStructuredDocument document, String regionText, String regionType) {
-		super(file);
-		this.fDocument = document;
-		this.fRegionText = regionText;
-		this.fRegionType = regionType;
-	}
-
-	public boolean canRerun() {
-		return false;
-	}
-
-	public boolean canRunInBackground() {
-		// pa_TODO investigate what is required to do this safely
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery#doQuery()
-	 */
-	protected IStatus doQuery() {
-
-		clearMatches();
-
-		IStatus status = Status.OK_STATUS;
-		FindRegions findRegions = new FindRegions(this.fDocument, this.fRegionText, this.fRegionType);
-		try {
-			ResourcesPlugin.getWorkspace().run(findRegions, null);
-		} catch (CoreException e) {
-			status = new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.OK, "", null); //$NON-NLS-1$
-		}
-		return status;
-	}
-
-	private String getFilename() {
-		String filename = SSEUIMessages.OccurrencesSearchQuery_2; //$NON-NLS-1$ "file"
-		if (getFile() != null)
-			filename = getFile().getName().toString();
-		return filename;
-	}
-
-	public String getLabel() {
-		String label = SSEUIMessages.OccurrencesSearchQuery_0; //$NON-NLS-1$
-		String[] args = {getSearchText(), getOccurrencesCountText(), getFilename()};
-		return MessageFormat.format(label, args);
-	}
-
-	/**
-	 * @return
-	 */
-	private String getOccurrencesCountText() {
-		String count = ""; //$NON-NLS-1$
-		// pa_TODO dynamically change count
-		return count;
-	}
-
-	public ISearchResult getSearchResult() {
-		return new OccurrencesSearchResult(this);
-	}
-
-	protected String getSearchText() {
-		return this.fRegionText;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchResult.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchResult.java
deleted file mode 100644
index 2f7f712..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchResult.java
+++ /dev/null
@@ -1,127 +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.sse.ui.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.search.ui.ISearchQuery;
-import org.eclipse.search.ui.text.AbstractTextSearchResult;
-import org.eclipse.search.ui.text.IEditorMatchAdapter;
-import org.eclipse.search.ui.text.IFileMatchAdapter;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-
-
-/**
- * @author pavery
- */
-public class OccurrencesSearchResult extends AbstractTextSearchResult implements IEditorMatchAdapter, IFileMatchAdapter {
-
-	private ISearchQuery fQuery = null;
-	private final Match[] NO_MATCHES = new Match[0];
-
-	public OccurrencesSearchResult(ISearchQuery query) {
-		this.fQuery = query;
-	}
-
-	public void clearMatches() {
-		if (getQuery() instanceof OccurrencesSearchQuery)
-			((OccurrencesSearchQuery) getQuery()).clearMatches();
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.text.IEditorMatchAdapter#computeContainedMatches(org.eclipse.search.ui.text.AbstractTextSearchResult,
-	 *      org.eclipse.ui.IEditorPart)
-	 */
-	public Match[] computeContainedMatches(AbstractTextSearchResult result, IEditorPart editor) {
-
-		IEditorInput editorInput = editor.getEditorInput();
-		if (editorInput instanceof IFileEditorInput) {
-			IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
-			return computeContainedMatches(result, fileEditorInput.getFile());
-		}
-		return this.NO_MATCHES;
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.text.IFileMatchAdapter#computeContainedMatches(org.eclipse.search.ui.text.AbstractTextSearchResult,
-	 *      org.eclipse.core.resources.IFile)
-	 */
-	public Match[] computeContainedMatches(AbstractTextSearchResult result, IFile file) {
-		return getMatches();
-	}
-
-	public IEditorMatchAdapter getEditorMatchAdapter() {
-		return this;
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.text.IFileMatchAdapter#getFile(java.lang.Object)
-	 */
-	public IFile getFile(Object element) {
-		// return the file for the match
-		IFile file = null;
-		//System.out.println("get file for:"+element);
-		if (element instanceof IMarker) {
-			IResource r = ((IMarker) element).getResource();
-			if (r instanceof IFile) {
-				file = (IFile) r;
-			}
-		}
-		return file;
-	}
-
-	public IFileMatchAdapter getFileMatchAdapter() {
-		return this;
-	}
-
-	public ImageDescriptor getImageDescriptor() {
-		return EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_OBJ_OCC_MATCH);
-	}
-
-	/**
-	 * This label shows up in the search history
-	 */
-	public String getLabel() {
-		return getQuery().getLabel();
-	}
-
-	public Match[] getMatches() {
-		// ensure that query is done running
-		return ((OccurrencesSearchQuery) getQuery()).getMatches();
-	}
-
-	public ISearchQuery getQuery() {
-		return this.fQuery;
-	}
-
-	public String getTooltip() {
-		return getLabel();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.search.ui.text.IEditorMatchAdapter#isShownInEditor(org.eclipse.search.ui.text.Match,
-	 *      org.eclipse.ui.IEditorPart)
-	 */
-	public boolean isShownInEditor(Match match, IEditorPart editor) {
-		return true;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchViewPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchViewPage.java
deleted file mode 100644
index 2d54131..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchViewPage.java
+++ /dev/null
@@ -1,140 +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.sse.ui.internal.search;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.search.ui.text.AbstractTextSearchViewPage;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-/**
- * Base page for Occurrences in file search results.
- * 
- * @author pavery
- */
-public class OccurrencesSearchViewPage extends AbstractTextSearchViewPage {
-
-	private OccurrencesContentProvider fContentProvider = null;
-
-	public OccurrencesSearchViewPage() {
-		super(AbstractTextSearchViewPage.FLAG_LAYOUT_FLAT);
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#clear()
-	 */
-	protected void clear() {
-		if (this.fContentProvider != null)
-			this.fContentProvider.clear();
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTableViewer(org.eclipse.jface.viewers.TableViewer)
-	 */
-	protected void configureTableViewer(TableViewer viewer) {
-
-		// pa_TODO need sorter?
-		viewer.setLabelProvider(new BasicSearchLabelProvider());
-		this.fContentProvider = new OccurrencesContentProvider();
-		viewer.setContentProvider(this.fContentProvider);
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTreeViewer(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	protected void configureTreeViewer(TreeViewer viewer) {
-		// not supported at the moment
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#elementsChanged(java.lang.Object[])
-	 */
-	protected void elementsChanged(Object[] objects) {
-		if (this.fContentProvider != null) {
-			this.fContentProvider.elementsChanged(objects);
-		}
-	}
-
-	public void forceRefresh() {
-		this.fContentProvider.refresh();
-	}
-
-	private IWorkbenchPage getActivePage() {
-
-		IWorkbench workbench = PlatformUI.getWorkbench();
-		IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
-		if (window == null)
-			return null;
-		return workbench.getActiveWorkbenchWindow().getActivePage();
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#getDisplayedMatches(java.lang.Object)
-	 */
-	public Match[] getDisplayedMatches(Object element) {
-		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=2640
-		// we only ever show one at a time, the element passed in is the match
-		// super was returning null
-		return new Match[]{(Match) element};
-	}
-
-	private void show(IMarker marker) {
-
-		IResource resource = marker.getResource();
-		if (resource == null || !resource.exists())
-			return;
-
-		IWorkbenchPage activePage = getActivePage();
-		try {
-			if (activePage != null) {
-
-				// open editor if needed
-				IDE.openEditor(getActivePage(), marker);
-
-				IEditorPart editor = activePage.getActiveEditor();
-				if (editor != null) {
-					IGotoMarker gotoMarker = (IGotoMarker) editor.getAdapter(IGotoMarker.class);
-					if (gotoMarker != null)
-						gotoMarker.gotoMarker(marker);
-				}
-
-			}
-		} catch (PartInitException e) {
-			// possible exception trying to open editor
-			Logger.logException(e);
-		}
-	}
-
-	/**
-	 * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#showMatch(org.eclipse.search.ui.text.Match,
-	 *      int, int)
-	 */
-	protected void showMatch(Match match, int currentOffset, int currentLength) throws PartInitException {
-		Object o = match.getElement();
-		if (o instanceof IMarker) {
-			show((IMarker) o);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/SelectionHistory.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/SelectionHistory.java
deleted file mode 100644
index a235234..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/SelectionHistory.java
+++ /dev/null
@@ -1,117 +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.sse.ui.internal.selection;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-public class SelectionHistory {
-	private ITextEditor fEditor;
-	private List fHistory;
-	private List fHistoryActions;
-	private int fSelectionChangeListenerCounter;
-	private ISelectionChangedListener fSelectionListener;
-
-	public SelectionHistory(ITextEditor editor) {
-		Assert.isNotNull(editor);
-		fEditor = editor;
-		fHistory = new ArrayList(3);
-		fSelectionListener = new ISelectionChangedListener() {
-			public void selectionChanged(SelectionChangedEvent event) {
-				if (fSelectionChangeListenerCounter == 0)
-					flush();
-			}
-		};
-		fEditor.getSelectionProvider().addSelectionChangedListener(fSelectionListener);
-	}
-
-	public void dispose() {
-		fEditor.getSelectionProvider().removeSelectionChangedListener(fSelectionListener);
-		fEditor = null;
-		if (fHistory != null && !fHistory.isEmpty()) {
-			fHistory.clear();
-		}
-		if (fHistoryActions != null && !fHistoryActions.isEmpty()) {
-			fHistoryActions.clear();
-		}
-	}
-
-	public void flush() {
-		if (fHistory.isEmpty())
-			return;
-		fHistory.clear();
-		updateHistoryAction();
-	}
-
-	public IRegion getLast() {
-		if (isEmpty())
-			return null;
-		int size = fHistory.size();
-		IRegion result = (IRegion) fHistory.remove(size - 1);
-		updateHistoryAction();
-		return result;
-	}
-
-	public void ignoreSelectionChanges() {
-		fSelectionChangeListenerCounter++;
-	}
-
-	public boolean isEmpty() {
-		return fHistory.isEmpty();
-	}
-
-	public void listenToSelectionChanges() {
-		fSelectionChangeListenerCounter--;
-	}
-
-	public void remember(IRegion region) {
-		fHistory.add(region);
-		updateHistoryAction();
-	}
-
-	public void setHistoryAction(IAction action) {
-		Assert.isNotNull(action);
-		
-		if (fHistoryActions == null)
-			fHistoryActions = new ArrayList();
-		if (!fHistoryActions.contains(action))
-			fHistoryActions.add(action);
-		
-		// update action
-		if (fHistory != null && !fHistory.isEmpty())
-			action.setEnabled(true);
-		else
-			action.setEnabled(false);
-	}
-
-	private void updateHistoryAction() {
-		if (fHistoryActions != null && !fHistoryActions.isEmpty()) {
-			boolean enabled = false;
-			if (fHistory != null && !fHistory.isEmpty())
-				enabled = true;
-
-			Iterator iter = fHistoryActions.iterator();
-			while (iter.hasNext()) {
-				((IAction)iter.next()).setEnabled(enabled);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java
deleted file mode 100644
index 1c39cbb..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java
+++ /dev/null
@@ -1,110 +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.sse.ui.internal.selection;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.util.Assert;
-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.StructuredModelManager;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.w3c.dom.Node;
-
-/**
- * @deprecated use StructuredSelectActionDelegate instead
- */
-
-public abstract class StructureSelectAction extends Action {
-	protected StructuredTextEditor fEditor = null;
-	protected SelectionHistory fHistory;
-	protected IStructuredModel fModel = null;
-	protected StructuredTextViewer fViewer = null;
-
-	public StructureSelectAction(StructuredTextEditor editor) {
-		super();
-
-		Assert.isNotNull(editor);
-		fEditor = editor;
-		fHistory = (SelectionHistory) editor.getAdapter(SelectionHistory.class);
-		fViewer = editor.getTextViewer();
-		fModel = editor.getModel();
-		Assert.isNotNull(fViewer);
-	}
-
-	abstract protected IndexedRegion getCursorIndexedRegion();
-
-	protected IndexedRegion getIndexedRegion(int offset) {
-		IndexedRegion indexedRegion = null;
-
-		int lastOffset = offset;
-		IDocument document = fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput());
-		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-		if (model != null) {
-			try {
-				indexedRegion = model.getIndexedRegion(lastOffset);
-				while (indexedRegion == null && lastOffset >= 0) {
-					lastOffset--;
-					indexedRegion = model.getIndexedRegion(lastOffset);
-				}
-			}
-			finally {
-				model.releaseFromRead();
-			}
-		}
-
-		return indexedRegion;
-	}
-
-	abstract protected Region getNewSelectionRegion(Node node, Region region);
-
-	public void run() {
-		Region currentRegion = new Region(fViewer.getSelectedRange().x, fViewer.getSelectedRange().y);
-		if (currentRegion.getLength() == fViewer.getDocument().getLength())
-			return;
-
-		IndexedRegion cursorIndexedRegion = getCursorIndexedRegion();
-		if (cursorIndexedRegion instanceof Node) {
-			Node cursorNode = (Node) cursorIndexedRegion;
-
-			// use parent node for empty text node
-			if (cursorNode.getNodeType() == Node.TEXT_NODE && cursorNode.getNodeValue().trim().length() == 0) {
-				cursorNode = cursorNode.getParentNode();
-
-				if (cursorNode instanceof IndexedRegion)
-					cursorIndexedRegion = (IndexedRegion) cursorNode;
-			}
-
-			Region cursorNodeRegion = new Region(cursorIndexedRegion.getStartOffset(), cursorIndexedRegion.getEndOffset() - cursorIndexedRegion.getStartOffset());
-
-			Region newRegion = null;
-			if (cursorNodeRegion.getOffset() >= currentRegion.getOffset() && cursorNodeRegion.getOffset() <= currentRegion.getOffset() + currentRegion.getLength() && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentRegion.getOffset() && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentRegion.getOffset() + currentRegion.getLength())
-				newRegion = getNewSelectionRegion(cursorNode, currentRegion);
-			else
-				newRegion = cursorNodeRegion;
-
-			if (newRegion != null) {
-				fHistory.remember(currentRegion);
-				try {
-					fHistory.ignoreSelectionChanges();
-					fEditor.selectAndReveal(newRegion.getOffset(), newRegion.getLength());
-				}
-				finally {
-					fHistory.listenToSelectionChanges();
-				}
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectHistoryAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectHistoryAction.java
deleted file mode 100644
index c697450..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectHistoryAction.java
+++ /dev/null
@@ -1,56 +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.sse.ui.internal.selection;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.w3c.dom.Node;
-
-public class StructureSelectHistoryAction extends StructureSelectAction implements IUpdate {
-	public StructureSelectHistoryAction(StructuredTextEditor editor) {
-		super(editor);
-		setText(SSEUIMessages.StructureSelectHistory_label); //$NON-NLS-1$
-		setToolTipText(SSEUIMessages.StructureSelectHistory_tooltip); //$NON-NLS-1$
-		setDescription(SSEUIMessages.StructureSelectHistory_description); //$NON-NLS-1$
-
-		update();
-	}
-
-	protected IndexedRegion getCursorIndexedRegion() {
-		return null;
-	}
-
-	protected Region getNewSelectionRegion(Node node, Region region) {
-		return null;
-	}
-
-	public void run() {
-		IRegion old = fHistory.getLast();
-		if (old != null) {
-			try {
-				fHistory.ignoreSelectionChanges();
-				fEditor.selectAndReveal(old.getOffset(), old.getLength());
-			} finally {
-				fHistory.listenToSelectionChanges();
-			}
-		}
-	}
-
-	public void update() {
-		setEnabled(!fHistory.isEmpty());
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectActionDelegate.java
deleted file mode 100644
index 22eba08..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectActionDelegate.java
+++ /dev/null
@@ -1,124 +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.sse.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-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.texteditor.ITextEditor;
-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.StructuredModelManager;
-
-abstract public class StructuredSelectActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
-	private IEditorPart fEditor;
-	private SelectionHistory fHistory;
-
-	public void dispose() {
-		fEditor = null;
-		fHistory = null;
-	}
-
-	public void init(IViewPart view) {
-		// do nothing
-	}
-
-	public void runWithEvent(IAction action, Event event) {
-		run(action);
-	}
-
-	public void run(IAction action) {
-		if (fEditor instanceof ITextEditor) {
-			ITextEditor textEditor = (ITextEditor) fEditor;
-
-			ISelection selection = textEditor.getSelectionProvider().getSelection();
-			IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
-			// determine current text selection
-			if (selection instanceof ITextSelection && document != null) {
-				ITextSelection textSelection = (ITextSelection) selection;
-
-				if (textSelection.getLength() < document.getLength()) {
-					// get current indexed region
-					IndexedRegion cursorIndexedRegion = getCursorIndexedRegion(document, textSelection);
-
-					// determine new selection based on current indexed region
-					Region newSelectionRegion = getNewSelectionRegion(cursorIndexedRegion, textSelection);
-
-					// select new selection
-					if (newSelectionRegion != null) {
-						fHistory.remember(new Region(textSelection.getOffset(), textSelection.getLength()));
-						try {
-							fHistory.ignoreSelectionChanges();
-							textEditor.selectAndReveal(newSelectionRegion.getOffset(), newSelectionRegion.getLength());
-						}
-						finally {
-							fHistory.listenToSelectionChanges();
-						}
-					}
-				}
-			}
-		}
-	}
-
-	public void selectionChanged(IAction action, ISelection selection) {
-		// do nothing
-	}
-
-	public void setActiveEditor(IAction action, IEditorPart targetEditor) {
-		fEditor = targetEditor;
-		if (fEditor != null)
-			fHistory = (SelectionHistory) fEditor.getAdapter(SelectionHistory.class);
-		else
-			fHistory = null;
-	}
-	
-	abstract protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection);
-	
-	abstract protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection);
-	
-	/**
-	 * This method will probably be removed and replaced by using new selection provider
-	 * @param document
-	 * @param offset
-	 * @return
-	 */
-	protected IndexedRegion getIndexedRegion(IDocument document, int offset) {
-		IndexedRegion indexedRegion = null;
-
-		int lastOffset = offset;
-		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-		if (model != null) {
-			try {
-				indexedRegion = model.getIndexedRegion(lastOffset);
-				while (indexedRegion == null && lastOffset >= 0) {
-					lastOffset--;
-					indexedRegion = model.getIndexedRegion(lastOffset);
-				}
-			}
-			finally {
-				model.releaseFromRead();
-			}
-		}
-
-		return indexedRegion;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectHistoryActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectHistoryActionDelegate.java
deleted file mode 100644
index 47dc5c8..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectHistoryActionDelegate.java
+++ /dev/null
@@ -1,83 +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.sse.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IRegion;
-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.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-/**
- * Selection history action delegate. Keeps track of selection within editor.
- */
-public class StructuredSelectHistoryActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
-	private IEditorPart fEditor;
-	private SelectionHistory fHistory;
-
-	public void dispose() {
-		fEditor = null;
-		fHistory = null;
-	}
-
-	public void init(IAction action) {
-		if (action != null) {
-			action.setText(SSEUIMessages.StructureSelectHistory_label);
-			action.setToolTipText(SSEUIMessages.StructureSelectHistory_tooltip);
-			action.setDescription(SSEUIMessages.StructureSelectHistory_description);
-		}
-	}
-
-	public void init(IViewPart view) {
-		// do nothing
-	}
-
-	public void run(IAction action) {
-		IRegion old = fHistory.getLast();
-		if (old != null) {
-			try {
-				fHistory.ignoreSelectionChanges();
-				if (fEditor instanceof ITextEditor)
-					((ITextEditor) fEditor).selectAndReveal(old.getOffset(), old.getLength());
-			}
-			finally {
-				fHistory.listenToSelectionChanges();
-			}
-		}
-	}
-
-	public void runWithEvent(IAction action, Event event) {
-		run(action);
-	}
-
-	public void selectionChanged(IAction action, ISelection selection) {
-		// do nothing
-	}
-
-	public void setActiveEditor(IAction action, IEditorPart targetEditor) {
-		fEditor = targetEditor;
-		if (fEditor != null)
-			fHistory = (SelectionHistory) fEditor.getAdapter(SelectionHistory.class);
-		else
-			fHistory = null;
-		if (fHistory != null) {
-			fHistory.setHistoryAction(action);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java
deleted file mode 100644
index b3ffc99..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java
+++ /dev/null
@@ -1,206 +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.sse.ui.internal.taginfo;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.texteditor.AnnotationPreference;
-import org.eclipse.ui.texteditor.ChainedPreferenceStore;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.sse.ui.internal.ITemporaryAnnotation;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Hover help that displays annotations shown in text of editor. Currently,
- * this text hover is used in conjunction with AbstractTextHoverProcessor.
- * 
- * @author amywu
- */
-public class AnnotationHoverProcessor implements ITextHover {
-	private final static String LIST_BEGIN = "<ul>"; //$NON-NLS-1$
-	private final static String LIST_ELEMENT = "<li>"; //$NON-NLS-1$
-	private final static String PARAGRAPH_END = "</p>"; //$NON-NLS-1$
-
-	private final static String PARAGRAPH_START = "<p>"; //$NON-NLS-1$
-	protected IPreferenceStore fPreferenceStore = null;
-
-	/**
-	 * 
-	 */
-	public AnnotationHoverProcessor() {
-		super();
-	}
-
-	/**
-	 * Formats a msg to a proper html message
-	 * 
-	 * @param msg -
-	 *            assumes msg is neither null nor empty string
-	 * @return
-	 */
-	protected String formatMessage(String msg) {
-		StringBuffer buf = new StringBuffer();
-		buf.append(PARAGRAPH_START);
-		buf.append(StringUtils.convertToHTMLContent(msg));
-		buf.append(PARAGRAPH_END);
-		return buf.toString();
-	}
-
-	/**
-	 * Formats multiple messages into proper html message
-	 * 
-	 * @param messages
-	 * @return
-	 */
-	protected String formatMessages(List messages) {
-		StringBuffer buffer = new StringBuffer();
-		buffer.append(PARAGRAPH_START);
-		buffer.append(SSEUIMessages.Multiple_errors); //$NON-NLS-1$
-		buffer.append(LIST_BEGIN);
-
-		Iterator e = messages.iterator();
-		while (e.hasNext()) {
-			buffer.append(LIST_ELEMENT);
-			buffer.append(StringUtils.convertToHTMLContent((String) e.next()));
-		}
-		buffer.append(PARAGRAPH_END);
-		return buffer.toString();
-	}
-
-	/**
-	 * Returns the annotation preference for the given annotation. (copied
-	 * from org.eclipse.jdt.internal.ui.text.java.hover.AnnotationHover)
-	 * 
-	 * @param annotation
-	 *            the annotation
-	 * @return the annotation preference or <code>null</code> if none
-	 */
-	private AnnotationPreference getAnnotationPreference(Annotation annotation) {
-
-		if (annotation.isMarkedDeleted())
-			return null;
-		return EditorsUI.getAnnotationPreferenceLookup().getAnnotationPreference(annotation);
-	}
-
-
-	public String getHoverInfo(ITextViewer viewer, IRegion hoverRegion) {
-		IAnnotationModel model = ((SourceViewer) viewer).getAnnotationModel();
-		if (model != null) {
-			List messages = new ArrayList();
-			Iterator e = model.getAnnotationIterator();
-			while (e.hasNext()) {
-				Annotation a = (Annotation) e.next();
-				if (!isAnnotationValid(a))
-					continue;
-
-				Position p = model.getPosition(a);
-				// check if this is an annotation in the region we are
-				// concerned with
-				if (p.overlapsWith(hoverRegion.getOffset(), hoverRegion.getLength())) {
-					String msg = a.getText();
-					if ((msg != null) && msg.trim().length() > 0) {
-						// it is possible for temporary annotations to
-						// duplicate other annotations so make sure not to add
-						// dups
-						if (a instanceof ITemporaryAnnotation) {
-							boolean duplicated = false;
-							int j = 0;
-							while (j < messages.size() && !duplicated) {
-								duplicated = messages.get(j).equals(msg);
-								++j;
-							}
-							if (!duplicated) {
-								messages.add(msg);
-							}
-						}
-						else {
-							messages.add(msg);
-						}
-					}
-				}
-			}
-			if (messages.size() > 1) {
-				return formatMessages(messages);
-			}
-			else if (messages.size() > 0) {
-				return formatMessage(messages.get(0).toString());
-			}
-		}
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer,
-	 *      int)
-	 */
-	public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
-		IAnnotationModel model = ((SourceViewer) textViewer).getAnnotationModel();
-		Region hoverRegion = null;
-
-		if (model != null) {
-			Iterator e = model.getAnnotationIterator();
-			while (e.hasNext()) {
-				Annotation a = (Annotation) e.next();
-				if (!isAnnotationValid(a))
-					continue;
-				Position p = model.getPosition(a);
-				if (p.includes(offset)) {
-					// find the smallest region containing offset
-					if ((hoverRegion == null) || (hoverRegion.getLength() > p.getLength())) {
-						hoverRegion = new Region(p.getOffset(), p.getLength());
-					}
-				}
-			}
-		}
-		return hoverRegion;
-	}
-
-	/**
-	 * Retreives the preference store If no preference store is currently
-	 * stored, retreive the appropriate preference store
-	 */
-	protected IPreferenceStore getPreferenceStore() {
-		if (fPreferenceStore == null) {
-			IPreferenceStore sseEditorPrefs = SSEUIPlugin.getDefault().getPreferenceStore();
-			IPreferenceStore baseEditorPrefs = EditorsUI.getPreferenceStore();
-			fPreferenceStore = new ChainedPreferenceStore(new IPreferenceStore[]{sseEditorPrefs, baseEditorPrefs});
-		}
-		return fPreferenceStore;
-	}
-
-	protected boolean isAnnotationValid(Annotation a) {
-		AnnotationPreference preference = getAnnotationPreference(a);
-		if (preference == null)
-			return false;
-		String textPreferenceKey = preference.getTextPreferenceKey();
-		String highlightPreferenceKey = preference.getHighlightPreferenceKey();
-		if (textPreferenceKey == null || !(getPreferenceStore().getBoolean(textPreferenceKey)) || highlightPreferenceKey == null || getPreferenceStore().getBoolean(highlightPreferenceKey))
-			return false;
-		return true;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java
deleted file mode 100644
index 227d229..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java
+++ /dev/null
@@ -1,118 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.sse.ui.internal.taginfo;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-/**
- * Provides the best hover help documentation (by using other hover help
- * processors) Priority of hover help processors is: ProblemHoverProcessor,
- * TagInfoProcessor, AnnotationHoverProcessor
- */
-public class BestMatchHover implements ITextHover {
-	private ITextHover fBestMatchHover; // current best match text hover
-	private ITextHover fTagInfoHover; // documentation/information hover
-	private List fTextHovers; // list of text hovers to consider in best
-								// match
-
-	public BestMatchHover(ITextHover infotaghover) {
-		fTagInfoHover = infotaghover;
-	}
-
-	/**
-	 * Create a list of text hovers applicable to this best match hover
-	 * processor
-	 * 
-	 * @return List of ITextHover - in abstract class this is empty list
-	 */
-	private List createTextHoversList() {
-		List hoverList = new ArrayList();
-		// if currently debugging, then add the debug hover to the list of
-		// best match
-		if (Logger.isTracing(DebugInfoHoverProcessor.TRACEFILTER)) {
-			hoverList.add(new DebugInfoHoverProcessor());
-		}
-
-		hoverList.add(new ProblemAnnotationHoverProcessor());
-		if (fTagInfoHover != null) {
-			hoverList.add(fTagInfoHover);
-		}
-		hoverList.add(new AnnotationHoverProcessor());
-		return hoverList;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer,
-	 *      org.eclipse.jface.text.IRegion)
-	 */
-	public String getHoverInfo(ITextViewer viewer, IRegion hoverRegion) {
-		String displayText = null;
-
-		// already have a best match hover picked out from getHoverRegion call
-		if (fBestMatchHover != null) {
-			displayText = fBestMatchHover.getHoverInfo(viewer, hoverRegion);
-		}
-		// either had no best match hover or best match hover returned null
-		if (displayText == null) {
-			// go through list of text hovers and return first display string
-			Iterator i = getTextHovers().iterator();
-			while ((i.hasNext()) && (displayText == null)) {
-				ITextHover hover = (ITextHover) i.next();
-				displayText = hover.getHoverInfo(viewer, hoverRegion);
-			}
-		}
-		return displayText;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer,
-	 *      int)
-	 */
-	public IRegion getHoverRegion(ITextViewer viewer, int offset) {
-		IRegion hoverRegion = null;
-
-		// go through list of text hovers and return first hover region
-		ITextHover hover = null;
-		Iterator i = getTextHovers().iterator();
-		while ((i.hasNext()) && (hoverRegion == null)) {
-			hover = (ITextHover) i.next();
-			hoverRegion = hover.getHoverRegion(viewer, offset);
-		}
-
-		// store the text hover processor that found region
-		if (hoverRegion != null)
-			fBestMatchHover = hover;
-		else
-			fBestMatchHover = null;
-
-		return hoverRegion;
-	}
-
-	private List getTextHovers() {
-		if (fTextHovers == null) {
-			fTextHovers = createTextHoversList();
-		}
-		return fTextHovers;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/DebugInfoHoverProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/DebugInfoHoverProcessor.java
deleted file mode 100644
index e96ee19..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/DebugInfoHoverProcessor.java
+++ /dev/null
@@ -1,91 +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.sse.ui.internal.taginfo;
-
-
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITypedRegion;
-
-/**
- * Provides debug hover help
- * 
- * @author amywu
- * @see org.eclipse.jface.text.ITextHover
- */
-public class DebugInfoHoverProcessor implements ITextHover {
-	public static final String TRACEFILTER = "debuginfohover"; //$NON-NLS-1$
-	protected IPreferenceStore fPreferenceStore = null;
-
-	public DebugInfoHoverProcessor() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer,
-	 *      org.eclipse.jface.text.IRegion)
-	 */
-	public String getHoverInfo(ITextViewer viewer, IRegion hoverRegion) {
-		String displayText = null;
-		if ((hoverRegion == null) || (viewer == null) || (viewer.getDocument() == null)) {
-			displayText = null;
-		} else {
-			int offset = hoverRegion.getOffset();
-
-			ITypedRegion region;
-			try {
-				region = viewer.getDocument().getPartition(offset);
-				if (region != null) {
-					displayText = region.getType();
-				} else {
-					displayText = "Null Region was returned?!"; //$NON-NLS-1$
-				}
-			} catch (BadLocationException e) {
-				displayText = "BadLocationException Occurred!?"; //$NON-NLS-1$
-			}
-
-		}
-		return displayText;
-	}
-
-	/**
-	 * Returns the region to hover the text over based on the offset.
-	 * 
-	 * @param textViewer
-	 * @param offset
-	 * 
-	 * @return IRegion region to hover over if offset is not over invalid
-	 *         whitespace. otherwise, returns <code>null</code>
-	 * 
-	 * @see ITextHover#getHoverRegion(ITextViewer, int)
-	 */
-	public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
-		ITypedRegion region = null;
-		if ((textViewer == null) || (textViewer.getDocument() == null)) {
-			region = null;
-		} else {
-
-			try {
-				region = textViewer.getDocument().getPartition(offset);
-			} catch (BadLocationException e) {
-				region = null;
-			}
-		}
-		return region;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/ProblemAnnotationHoverProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/ProblemAnnotationHoverProcessor.java
deleted file mode 100644
index d9a4c03..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/ProblemAnnotationHoverProcessor.java
+++ /dev/null
@@ -1,51 +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.sse.ui.internal.taginfo;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess;
-
-/**
- * Hover help that displays problem annotations when shown in text of editor.
- * 
- * @author amywu
- */
-public class ProblemAnnotationHoverProcessor extends AnnotationHoverProcessor {
-
-	// these strings are derived from the annotationTypes extension in
-	// org.eclipse.ui.editors plugin
-	// if those strings change, then these strings need to change as well
-	final private String ANNOTATION_ERROR = "org.eclipse.wst.sse.ui.temp.error"; //$NON-NLS-1$
-	final private String ANNOTATION_WARNING = "org.eclipse.wst.sse.ui.temp.warning"; //$NON-NLS-1$
-	private DefaultMarkerAnnotationAccess fAnnotationAccess = new DefaultMarkerAnnotationAccess();
-
-	/**
-	 *  
-	 */
-	public ProblemAnnotationHoverProcessor() {
-		super();
-	}
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.taginfo.AnnotationHoverProcessor#isAnnotationValid(org.eclipse.jface.text.source.Annotation)
-	 */
-	protected boolean isAnnotationValid(Annotation a) {
-		String type = a.getType();
-		if (fAnnotationAccess.isSubtype(type, ANNOTATION_ERROR) || fAnnotationAccess.isSubtype(type, ANNOTATION_WARNING))
-			return super.isAnnotationValid(a);
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/TextHoverManager.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/TextHoverManager.java
deleted file mode 100644
index 67d3d07..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/TextHoverManager.java
+++ /dev/null
@@ -1,243 +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.sse.ui.internal.taginfo;
-
-import java.util.HashMap;
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-
-/**
- * Manages text hovers for Structured Text editors
- * 
- * @author amywu
- */
-public class TextHoverManager {
-	/**
-	 * Contains description of a text hover
-	 */
-	public class TextHoverDescriptor {
-		private String fDescription;
-		private boolean fEnabled;
-		private String fId;
-		private String fLabel;
-		private String fModifierString;
-
-		/**
-		 * @param id
-		 * @param label
-		 * @param desc
-		 */
-		public TextHoverDescriptor(String id, String label, String desc) {
-			fId = id;
-			fLabel = label;
-			fDescription = desc;
-		}
-
-		/**
-		 * @param id
-		 * @param label
-		 * @param desc
-		 * @param enabled
-		 * @param modifierString
-		 */
-		public TextHoverDescriptor(String id, String label, String desc, boolean enabled, String modifierString) {
-			fId = id;
-			fLabel = label;
-			fDescription = desc;
-			fEnabled = enabled;
-			fModifierString = modifierString;
-		}
-
-		/**
-		 * @return Returns the fDescription.
-		 */
-		public String getDescription() {
-			return fDescription;
-		}
-
-		/**
-		 * @return Returns the fId.
-		 */
-		public String getId() {
-			return fId;
-		}
-
-		/**
-		 * @return Returns the fLabel
-		 */
-		public String getLabel() {
-			return fLabel;
-		}
-
-		/**
-		 * @return Returns the fModifierString.
-		 */
-		public String getModifierString() {
-			return fModifierString;
-		}
-
-		/**
-		 * @return Returns the fEnabled.
-		 */
-		public boolean isEnabled() {
-			return fEnabled;
-		}
-
-		/**
-		 * @param enabled
-		 *            The fEnabled to set.
-		 */
-		public void setEnabled(boolean enabled) {
-			fEnabled = enabled;
-		}
-
-		/**
-		 * @param modifierString
-		 *            The fModifierString to set.
-		 */
-		public void setModifierString(String modifierString) {
-			fModifierString = modifierString;
-		}
-	}
-
-	public static final String ANNOTATION_HOVER = "annotationHover"; //$NON-NLS-1$
-
-	// list of different types of Source editor hovers
-	public static final String COMBINATION_HOVER = "combinationHover"; //$NON-NLS-1$
-	// hover descriptions are in .properties file with the key in the form of
-	// "[id]_desc"
-	private static final String DESCRIPTION_KEY = "_desc"; //$NON-NLS-1$
-	public static final String DOCUMENTATION_HOVER = "documentationHover"; //$NON-NLS-1$
-	public static final String HOVER_ATTRIBUTE_SEPARATOR = "|"; //$NON-NLS-1$
-	public static final String HOVER_SEPARATOR = ";"; //$NON-NLS-1$
-
-	// hover labels are in .properties file with the key in the form of
-	// "[id]_label"
-	private static final String LABEL_KEY = "_label"; //$NON-NLS-1$
-
-	public static final String NO_MODIFIER = "0"; //$NON-NLS-1$
-	public static final String PROBLEM_HOVER = "problemHover"; //$NON-NLS-1$
-	public static final String[] TEXT_HOVER_IDS = new String[]{COMBINATION_HOVER, PROBLEM_HOVER, DOCUMENTATION_HOVER, ANNOTATION_HOVER};
-	/**
-	 * Current list of Structured Text editor text hovers
-	 */
-	private TextHoverDescriptor[] fTextHovers;
-
-	public TextHoverManager() {
-		super();
-	}
-
-	/**
-	 * Create a best match hover with the give text hover as the documentation
-	 * hover
-	 * 
-	 * @param infoHover
-	 * @return ITextHover
-	 */
-	public ITextHover createBestMatchHover(ITextHover infoHover) {
-		return new BestMatchHover(infoHover);
-	}
-
-	/**
-	 * Generate a list of text hover descriptors from the given delimited
-	 * string
-	 * 
-	 * @param textHoverStrings
-	 * @return
-	 */
-	public TextHoverDescriptor[] generateTextHoverDescriptors(String textHoverStrings) {
-		StringTokenizer st = new StringTokenizer(textHoverStrings, HOVER_SEPARATOR);
-
-		// read from preference and load id-descriptor mapping to a hash table
-		HashMap idToModifier = new HashMap(st.countTokens());
-		while (st.hasMoreTokens()) {
-			String textHoverString = st.nextToken();
-			StringTokenizer st2 = new StringTokenizer(textHoverString, HOVER_ATTRIBUTE_SEPARATOR);
-			if (st2.countTokens() == 3) {
-				String id = st2.nextToken();
-				boolean enabled = Boolean.valueOf(st2.nextToken()).booleanValue();
-				String modifierString = st2.nextToken();
-				if (modifierString.equals(NO_MODIFIER))
-					modifierString = ""; //$NON-NLS-1$
-
-				String label = null;
-				String description = null;
-				try {
-					label = SSEUIMessages.getResourceBundle().getString(id + LABEL_KEY);
-					description = SSEUIMessages.getResourceBundle().getString(id + DESCRIPTION_KEY);
-				}
-				catch (Exception e) {
-					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-				}
-				TextHoverDescriptor descriptor = new TextHoverDescriptor(id, label, description, enabled, modifierString);
-				// should check to see if ids appear more than once
-				idToModifier.put(id, descriptor);
-			}
-		}
-
-		// go through all defined text hovers and match with their preference
-		TextHoverDescriptor[] descriptors = new TextHoverDescriptor[TEXT_HOVER_IDS.length];
-		for (int i = 0; i < TEXT_HOVER_IDS.length; i++) {
-			TextHoverDescriptor desc = (TextHoverDescriptor) idToModifier.get(TEXT_HOVER_IDS[i]);
-			if (desc != null) {
-				descriptors[i] = desc;
-			}
-			else {
-				String label = null;
-				String description = null;
-				try {
-					label = SSEUIMessages.getResourceBundle().getString(TEXT_HOVER_IDS[i] + LABEL_KEY);
-					description = SSEUIMessages.getResourceBundle().getString(TEXT_HOVER_IDS[i] + DESCRIPTION_KEY);
-				}
-				catch (Exception e) {
-					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-				}
-				descriptors[i] = new TextHoverDescriptor(TEXT_HOVER_IDS[i], label, description);
-			}
-		}
-		return descriptors;
-	}
-
-	private IPreferenceStore getPreferenceStore() {
-		return SSEUIPlugin.getDefault().getPreferenceStore();
-	}
-
-
-	/**
-	 * Returns the text hovers for Structured Text editor. If fTextHover has
-	 * not been initialied, it will be initialized.
-	 * 
-	 * @return Returns the fTextHovers.
-	 */
-	public TextHoverDescriptor[] getTextHovers() {
-		if (fTextHovers == null) {
-			String textHoverStrings = getPreferenceStore().getString(EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS);
-			fTextHovers = generateTextHoverDescriptors(textHoverStrings);
-		}
-		return fTextHovers;
-	}
-
-	/**
-	 * Sets fTextHovers to null so that next time getTextHovers is called,
-	 * fTextHovers will be populated with the latest preferences.
-	 */
-	public void resetTextHovers() {
-		fTextHovers = null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/DocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/DocumentRegionEdgeMatcher.java
deleted file mode 100644
index 48d20e1..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/DocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,118 +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.sse.ui.internal.text;
-
-import java.util.Arrays;
-import java.util.List;
-
-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;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-
-/**
- * Matches the start and ending characters of IStructuredDocumentRegions with
- * the given allowed types. Note that Eclipse R3M8 only paints single
- * character-wide matches and this isn't true pair matching behavior. See RFE
- * #56836 at https://bugs.eclipse.org/bugs/show_bug.cgi?id=56836.
- */
-public class DocumentRegionEdgeMatcher implements ICharacterPairMatcher {
-
-	public static final String ID = "characterpairmatcher"; //$NON-NLS-1$
-
-	protected int fAnchor;
-
-	protected ICharacterPairMatcher fNextMatcher;
-
-	protected List fRegionTypes;
-
-	public DocumentRegionEdgeMatcher(String[] validContexts, ICharacterPairMatcher nextMatcher) {
-		fRegionTypes = Arrays.asList(validContexts);
-		fNextMatcher = nextMatcher;
-	}
-
-	/*
-	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#clear()
-	 */
-	public void clear() {
-		if (fNextMatcher != null)
-			fNextMatcher.clear();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#dispose()
-	 */
-	public void dispose() {
-		if (fNextMatcher != null)
-			fNextMatcher.dispose();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.source.ICharacterPairMatcher#getAnchor()
-	 */
-	public int getAnchor() {
-		if (fAnchor < 0 && fNextMatcher != null)
-			return fNextMatcher.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) {
-		if(offset < 0 || offset >= document.getLength())
-			return null;
-		
-		IRegion match = null;
-		if (!fRegionTypes.isEmpty() && document instanceof IStructuredDocument) {
-			IStructuredDocumentRegion docRegion = ((IStructuredDocument) document).getRegionAtCharacterOffset(offset);
-			if (docRegion != null) {
-				// look at the previous document region first since its end ==
-				// this one's start
-				if (docRegion.getPrevious() != null && docRegion.getPrevious().getEndOffset() == offset && fRegionTypes.contains(docRegion.getPrevious().getType())) {
-					fAnchor = ICharacterPairMatcher.RIGHT;
-					match = new Region(docRegion.getPrevious().getStartOffset(), 1);
-				}
-				// check for offset in the last text region for a match to
-				// document region start offset
-				else if (fRegionTypes.contains(docRegion.getType()) && docRegion.getStartOffset(docRegion.getLastRegion()) <= offset && offset <= docRegion.getEndOffset(docRegion.getLastRegion())) {
-					fAnchor = ICharacterPairMatcher.RIGHT;
-					match = new Region(docRegion.getStartOffset(), 1);
-				}
-				// check for offset in the first text region for a match to
-				// document region end offset
-				else if (fRegionTypes.contains(docRegion.getType())) {
-					if (docRegion.getStartOffset(docRegion.getFirstRegion()) <= offset && offset <= docRegion.getEndOffset(docRegion.getFirstRegion())) {
-						fAnchor = ICharacterPairMatcher.LEFT;
-						match = new Region(docRegion.getEndOffset() - 1, 1);
-					}
-				}
-			}
-		}
-		if (match == null && fNextMatcher != null) {
-			fAnchor = -1;
-			match = fNextMatcher.match(document, offset);
-		}
-		return match;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java
deleted file mode 100644
index 9b19440..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java
+++ /dev/null
@@ -1,643 +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
- *     
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.ui;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-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.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.MarkerAnnotation;
-import org.eclipse.ui.texteditor.MarkerUtilities;
-import org.eclipse.ui.texteditor.StatusLineContributionItem;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.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.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.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.util.Utilities;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-/**
- * @author nsd A Status Line contribution intended to display the selected
- *         offsets in an editor. Double-clicking shows information about
- *         partitions and the Structured Document regions.
- */
-public class OffsetStatusLineContributionItem extends StatusLineContributionItem {
-
-	class InformationDialog extends Dialog {
-
-		IDocument fDocument = fTextEditor.getDocumentProvider().getDocument(fTextEditor.getEditorInput());
-
-		public InformationDialog(Shell parentShell) {
-			super(parentShell);
-			setShellStyle(getShellStyle() | SWT.RESIZE);
-		}
-
-		private void createAnnotationContents(Composite annotationsTabComposite) {
-			annotationsTabComposite.setLayout(new GridLayout());
-			annotationsTabComposite.setLayoutData(new GridData());
-
-			Composite annotationsComposite = new Composite(annotationsTabComposite, SWT.NONE);
-			annotationsComposite.setLayout(new GridLayout(2, false));
-			annotationsComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
-			final TableViewer annotationsTable = new TableViewer(annotationsComposite, SWT.FULL_SELECTION);
-			GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
-			gd.horizontalSpan = 2;
-			annotationsTable.getControl().setLayoutData(gd);
-			annotationsTable.setContentProvider(new ArrayContentProvider());
-			annotationsTable.getTable().setHeaderVisible(true);
-			annotationsTable.getTable().setLinesVisible(true);
-			String[] columns = new String[]{"Line", "Owner", "Type", "Message"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			annotationsTable.setLabelProvider(new ITableLabelProvider() {
-				public void addListener(ILabelProviderListener listener) {
-				}
-
-				public void dispose() {
-				}
-
-				public Image getColumnImage(Object element, int columnIndex) {
-					return null;
-				}
-
-				public String getColumnText(Object element, int columnIndex) {
-					Annotation annotation = (Annotation) element;
-					String text = null;
-					switch (columnIndex) {
-						case 0 :
-							text = (annotation instanceof MarkerAnnotation) ? Integer.toString(MarkerUtilities.getLineNumber(((MarkerAnnotation) annotation).getMarker())) : "-1"; //$NON-NLS-1$
-							break;
-						case 1 :
-							text = (annotation instanceof MarkerAnnotation) ? ((MarkerAnnotation) annotation).getMarker().getAttribute("owner", "n/a") : "?"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-							break;
-						case 2 :
-							text = (annotation instanceof MarkerAnnotation) ? MarkerUtilities.getMarkerType(((MarkerAnnotation) annotation).getMarker()) : "?"; //$NON-NLS-1$
-							break;
-						case 3 :
-							text = annotation.getText();
-							break;
-					}
-					if (text == null)
-						text = ""; //$NON-NLS-1$
-					return text;
-				}
-
-				public boolean isLabelProperty(Object element, String property) {
-					return false;
-				}
-
-				public void removeListener(ILabelProviderListener listener) {
-				}
-			});
-
-			TableLayout tlayout = new TableLayout();
-			CellEditor[] cellEditors = new CellEditor[columns.length];
-			int columnWidths[] = new int[]{Display.getCurrent().getBounds().width / 14, Display.getCurrent().getBounds().width / 7, Display.getCurrent().getBounds().width / 7, Display.getCurrent().getBounds().width / 7};
-			for (int i = 0; i < columns.length; i++) {
-				tlayout.addColumnData(new ColumnWeightData(1));
-				TableColumn tc = new TableColumn(annotationsTable.getTable(), SWT.NONE);
-				tc.setText(columns[i]);
-				tc.setResizable(true);
-				tc.setWidth(columnWidths[i]);
-			}
-			annotationsTable.setCellEditors(cellEditors);
-			annotationsTable.setColumnProperties(columns);
-			// textSelection.getOffset(), textSelection.getLength()
-			List matchingAnnotations = new ArrayList(0);
-			Iterator iterator = fTextEditor.getDocumentProvider().getAnnotationModel(fTextEditor.getEditorInput()).getAnnotationIterator();
-			while (iterator.hasNext()) {
-				Annotation element = (Annotation) iterator.next();
-				if (true) {
-					matchingAnnotations.add(element);
-				}
-			}
-			annotationsTable.setInput(matchingAnnotations);
-
-			final PropertySheetPage propertySheet = new PropertySheetPage();
-			propertySheet.createControl(annotationsComposite);
-			gd = new GridData(SWT.FILL, SWT.FILL, true, true);
-			gd.horizontalSpan = 2;
-			propertySheet.getControl().setLayoutData(gd);
-			propertySheet.setPropertySourceProvider(new IPropertySourceProvider() {
-				public IPropertySource getPropertySource(Object object) {
-					if (object instanceof MarkerAnnotation) {
-						IPropertySource markerAnnotationPropertySource = new MarkerAnnotationPropertySource(((MarkerAnnotation) object));
-						return markerAnnotationPropertySource;
-					}
-					return null;
-				}
-			});
-
-			annotationsTable.addSelectionChangedListener(new ISelectionChangedListener() {
-				public void selectionChanged(SelectionChangedEvent event) {
-					propertySheet.selectionChanged(null, event.getSelection());
-				}
-			});
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
-		 */
-		protected Control createDialogArea(Composite parent) {
-			ISelection sel = fTextEditor.getSelectionProvider().getSelection();
-			ITextSelection textSelection = (ITextSelection) sel;
-			parent.getShell().setText(SSEUIMessages.OffsetStatusLineContributionItem_0 + textSelection.getOffset() + "-" + (textSelection.getOffset() + textSelection.getLength())); //$NON-NLS-1$ //$NON-NLS-2$
-			Composite composite = (Composite) super.createDialogArea(parent);
-
-			TabFolder tabfolder = new TabFolder(composite, SWT.NONE);
-			tabfolder.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-			TabItem partitionTab = new TabItem(tabfolder, SWT.BORDER);
-			partitionTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_2); //$NON-NLS-1$
-			Composite partitions = new Composite(tabfolder, SWT.NONE);
-			partitionTab.setControl(partitions);
-			createPartitionContents(partitions);
-
-			// only create the ITextRegions tab for IStructuredDocuments
-			if (fDocument instanceof IStructuredDocument) {
-				TabItem regionTab = new TabItem(tabfolder, SWT.BORDER);
-				regionTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_3); //$NON-NLS-1$
-				SashForm regions = new SashForm(tabfolder, SWT.NONE);
-				regions.setOrientation(SWT.HORIZONTAL);
-				regionTab.setControl(regions);
-				createRegionsContents(regions);
-			}
-
-			TabItem annotationsTab = new TabItem(tabfolder, SWT.BORDER);
-			annotationsTab.setText("Annotations"); //$NON-NLS-1$
-			Composite annotations = new Composite(tabfolder, SWT.NONE);
-			annotationsTab.setControl(annotations);
-			createAnnotationContents(annotations);
-
-			return composite;
-		}
-
-		/**
-		 * @param area
-		 */
-		private void createPartitionContents(Composite area) {
-			area.setLayout(new GridLayout());
-			area.setLayoutData(new GridData());
-
-			Composite partioningComposite = new Composite(area, SWT.NONE);
-			partioningComposite.setLayout(new GridLayout(2, false));
-			partioningComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
-			Text documentTypeLabel = new Text(partioningComposite, SWT.SINGLE | SWT.READ_ONLY);
-			GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-			gd.horizontalSpan = 2;
-			documentTypeLabel.setLayoutData(gd);
-			documentTypeLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_6 + fDocument.getClass().getName()); //$NON-NLS-1$
-
-			Text documentProviderLabel = new Text(partioningComposite, SWT.SINGLE | SWT.READ_ONLY);
-			gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-			gd.horizontalSpan = 2;
-			documentProviderLabel.setLayoutData(gd);
-			documentProviderLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_7 + fTextEditor.getDocumentProvider().getClass().getName()); //$NON-NLS-1$
-
-			Text editorInputLabel = new Text(partioningComposite, SWT.SINGLE | SWT.READ_ONLY);
-			gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-			gd.horizontalSpan = 2;
-			editorInputLabel.setLayoutData(gd);
-			editorInputLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_12 + fTextEditor.getEditorInput().getClass().getName()); //$NON-NLS-1$
-
-			IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-			if (model != null) {
-				Text modelContentTypeLabel = new Text(partioningComposite, SWT.SINGLE | SWT.READ_ONLY);
-				gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-				gd.horizontalSpan = 2;
-				modelContentTypeLabel.setLayoutData(gd);
-				modelContentTypeLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_4 + model.getContentTypeIdentifier()); //$NON-NLS-1$
-
-				Text modelHandlerContentTypeLabel = new Text(partioningComposite, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
-				gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-				gd.horizontalSpan = 2;
-				modelHandlerContentTypeLabel.setLayoutData(gd);
-				modelHandlerContentTypeLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_5 + model.getModelHandler() + " (" + model.getModelHandler().getAssociatedContentTypeId() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-				Label blankRow = new Label(partioningComposite, SWT.NONE);
-				gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-				gd.horizontalSpan = 2;
-				blankRow.setLayoutData(gd);
-			}
-			if (model != null) {
-				model.releaseFromRead();
-			}
-
-			Text label = new Text(partioningComposite, SWT.SINGLE | SWT.READ_ONLY);
-			label.setText(SSEUIMessages.OffsetStatusLineContributionItem_8); //$NON-NLS-1$
-			label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
-			final Combo partitioningCombo = new Combo(partioningComposite, SWT.READ_ONLY);
-			partitioningCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-
-			final Text partitionerInstanceLabel = new Text(partioningComposite, SWT.SINGLE | SWT.READ_ONLY);
-			gd = new GridData(SWT.FILL, SWT.FILL, true, false);
-			gd.horizontalSpan = 2;
-			partitionerInstanceLabel.setLayoutData(gd);
-
-			final TableViewer fPartitionTable = new TableViewer(partioningComposite, SWT.FULL_SELECTION);
-			gd = new GridData(SWT.FILL, SWT.FILL, true, true);
-			gd.horizontalSpan = 2;
-			fPartitionTable.getControl().setLayoutData(gd);
-			fPartitionTable.setContentProvider(new ArrayContentProvider());
-			fPartitionTable.getTable().setHeaderVisible(true);
-			fPartitionTable.getTable().setLinesVisible(true);
-			String[] columns = new String[]{SSEUIMessages.OffsetStatusLineContributionItem_9, SSEUIMessages.OffsetStatusLineContributionItem_10, SSEUIMessages.OffsetStatusLineContributionItem_11}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			fPartitionTable.setLabelProvider(new ITableLabelProvider() {
-
-				public void addListener(ILabelProviderListener listener) {
-				}
-
-				public void dispose() {
-				}
-
-				public Image getColumnImage(Object element, int columnIndex) {
-					return null;
-				}
-
-				public String getColumnText(Object element, int columnIndex) {
-					ITypedRegion partition = (ITypedRegion) element;
-					String text = null;
-					switch (columnIndex) {
-						case 0 :
-							text = Integer.toString(partition.getOffset());
-							break;
-						case 1 :
-							text = Integer.toString(partition.getLength());
-							break;
-						case 2 :
-							text = partition.getType();
-							break;
-					}
-					if (text == null)
-						text = ""; //$NON-NLS-1$
-					return text;
-				}
-
-				public boolean isLabelProperty(Object element, String property) {
-					return false;
-				}
-
-				public void removeListener(ILabelProviderListener listener) {
-				}
-			});
-			TableLayout tlayout = new TableLayout();
-			CellEditor[] cellEditors = new CellEditor[columns.length];
-			int columnWidths[] = new int[]{Display.getCurrent().getBounds().width / 14, Display.getCurrent().getBounds().width / 14, Display.getCurrent().getBounds().width / 5};
-			for (int i = 0; i < columns.length; i++) {
-				tlayout.addColumnData(new ColumnWeightData(1));
-				TableColumn tc = new TableColumn(fPartitionTable.getTable(), SWT.NONE);
-				tc.setText(columns[i]);
-				tc.setResizable(true);
-				tc.setWidth(columnWidths[i]);
-			}
-			fPartitionTable.setCellEditors(cellEditors);
-			fPartitionTable.setColumnProperties(columns);
-			final String[] partitionings = (fDocument instanceof IDocumentExtension3) ? ((IDocumentExtension3) fDocument).getPartitionings() : new String[]{IDocumentExtension3.DEFAULT_PARTITIONING};
-			partitioningCombo.setItems(partitionings);
-			partitioningCombo.addSelectionListener(new SelectionAdapter() {
-				public void widgetSelected(SelectionEvent e) {
-					ISelection sel = fTextEditor.getSelectionProvider().getSelection();
-					ITextSelection textSelection = (ITextSelection) sel;
-					try {
-						String partitionerText = fDocument instanceof IDocumentExtension3 ? ((IDocumentExtension3) fDocument).getDocumentPartitioner(partitioningCombo.getItem(partitioningCombo.getSelectionIndex())).toString() : ("" + fDocument.getDocumentPartitioner()); //$NON-NLS-1$
-						partitionerInstanceLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_13 + partitionerText); //$NON-NLS-1$
-						fPartitionTable.setInput(TextUtilities.computePartitioning(fDocument, partitioningCombo.getItem(partitioningCombo.getSelectionIndex()), textSelection.getOffset(), textSelection.getLength(), true));
-					}
-					catch (BadLocationException e1) {
-						fPartitionTable.setInput(new ITypedRegion[0]);
-					}
-				}
-			});
-			try {
-				String selectedPartitioning = partitioningCombo.getItem(0);
-				if (Utilities.contains(partitionings, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING)) {
-					selectedPartitioning = IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING;
-					for (int i = 0; i < partitionings.length; i++) {
-						if (partitionings[i].equals(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING)) {
-							partitioningCombo.select(i);
-						}
-					}
-				}
-				else {
-					partitioningCombo.select(0);
-				}
-				ISelection sel = fTextEditor.getSelectionProvider().getSelection();
-				ITextSelection textSelection = (ITextSelection) sel;
-				fPartitionTable.setInput(TextUtilities.computePartitioning(fDocument, selectedPartitioning, textSelection.getOffset(), textSelection.getLength(), true));
-				String partitionerText = fDocument instanceof IDocumentExtension3 ? ((IDocumentExtension3) fDocument).getDocumentPartitioner(partitioningCombo.getItem(partitioningCombo.getSelectionIndex())).toString() : ("" + fDocument.getDocumentPartitioner()); //$NON-NLS-1$
-				partitionerInstanceLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_13 + partitionerText); //$NON-NLS-1$
-			}
-			catch (BadLocationException e1) {
-				fPartitionTable.setInput(new ITypedRegion[0]);
-			}
-			partitioningCombo.setFocus();
-		}
-
-		/**
-		 * @param composite
-		 * @return
-		 */
-		private Composite createRegionsContents(SashForm sashForm) {
-			ISelection sel = fTextEditor.getSelectionProvider().getSelection();
-			final ITextSelection textSelection = (ITextSelection) sel;
-			final List documentRegions = new ArrayList();
-			if (fDocument instanceof IStructuredDocument) {
-				IStructuredDocument structuredDocument = (IStructuredDocument) fDocument;
-				int pos = textSelection.getOffset();
-				int end = textSelection.getOffset() + textSelection.getLength();
-				IStructuredDocumentRegion docRegion = structuredDocument.getRegionAtCharacterOffset(pos);
-				IStructuredDocumentRegion endRegion = structuredDocument.getRegionAtCharacterOffset(end);
-				if (pos < end) {
-					while (docRegion != endRegion) {
-						documentRegions.add(docRegion);
-						docRegion = docRegion.getNext();
-					}
-				}
-				documentRegions.add(docRegion);
-			}
-
-			final TreeViewer tree = new TreeViewer(sashForm, SWT.V_SCROLL | SWT.H_SCROLL);
-			final String START = SSEUIMessages.OffsetStatusLineContributionItem_15; //$NON-NLS-1$
-			final String LENGTH = SSEUIMessages.OffsetStatusLineContributionItem_16; //$NON-NLS-1$
-			final String TEXTLENGTH = SSEUIMessages.OffsetStatusLineContributionItem_17; //$NON-NLS-1$
-			final String CONTEXT = SSEUIMessages.OffsetStatusLineContributionItem_18; //$NON-NLS-1$
-			tree.setContentProvider(new ITreeContentProvider() {
-				public void dispose() {
-				}
-
-				public Object[] getChildren(Object parentElement) {
-					List children = new ArrayList(0);
-					if (parentElement instanceof ITextSelection) {
-						children.addAll(documentRegions);
-					}
-					if (parentElement instanceof ITextRegionCollection) {
-						children.add(((ITextRegionCollection) parentElement).getRegions().toArray());
-					}
-					if (parentElement instanceof ITextRegion) {
-						children.add(new Pair(CONTEXT, ((ITextRegion) parentElement).getType()));
-						children.add(new Pair(START, Integer.toString(((ITextRegion) parentElement).getStart())));
-						children.add(new Pair(TEXTLENGTH, Integer.toString(((ITextRegion) parentElement).getTextLength())));
-						children.add(new Pair(LENGTH, Integer.toString(((ITextRegion) parentElement).getLength())));
-					}
-					if (parentElement instanceof ITextRegionList) {
-						children.add(Arrays.asList(((ITextRegionList) parentElement).toArray()));
-					}
-					if (parentElement instanceof Collection) {
-						children.addAll((Collection) parentElement);
-					}
-					if (parentElement instanceof Object[]) {
-						children.addAll(Arrays.asList((Object[]) parentElement));
-					}
-					return children.toArray();
-				}
-
-				public Object[] getElements(Object inputElement) {
-					return new Object[]{textSelection};
-				}
-
-				public Object getParent(Object element) {
-					if (element instanceof IStructuredDocumentRegion)
-						return ((IStructuredDocumentRegion) element).getParentDocument();
-					if (element instanceof ITextRegionContainer) {
-						return ((ITextRegionContainer) element).getParent();
-					}
-					return null;
-				}
-
-				public boolean hasChildren(Object element) {
-					return !(element instanceof Pair);
-				}
-
-				public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-				}
-			});
-			tree.setLabelProvider(new LabelProvider() {
-				public String getText(Object element) {
-					if (element instanceof Pair)
-						return ((Pair) element).fKey.toString().toLowerCase() + ": " + ((Pair) element).fValue; //$NON-NLS-1$
-					if (element instanceof IStructuredDocumentRegion) {
-						IStructuredDocumentRegion documentRegion = (IStructuredDocumentRegion) element;
-						int packageNameLength = documentRegion.getClass().getPackage().getName().length();
-						if (packageNameLength > 0)
-							packageNameLength++;
-						String name = documentRegion.getClass().getName().substring(packageNameLength);
-						String text = "[" + documentRegion.getStartOffset() + "-" + documentRegion.getEndOffset() + "] " + name + "@" + element.hashCode() + " " + documentRegion.getType(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-						return text;
-					}
-					if (element instanceof ITextRegion) {
-						ITextRegion textRegion = (ITextRegion) element;
-						int packageNameLength = textRegion.getClass().getPackage().getName().length();
-						if (packageNameLength > 0)
-							packageNameLength++;
-						String name = textRegion.getClass().getName().substring(packageNameLength);
-						String text = "[" + textRegion.getStart() + "-" + textRegion.getEnd() + "] " + name + "@" + element.hashCode() + " " + textRegion.getType(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-						return text;
-					}
-					return super.getText(element);
-				}
-			});
-			tree.setInput(fDocument);
-			final Text displayText = new Text(sashForm, SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY | SWT.BORDER);
-			displayText.setBackground(sashForm.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
-			tree.addSelectionChangedListener(new ISelectionChangedListener() {
-				public void selectionChanged(SelectionChangedEvent event) {
-					if (event.getSelection() instanceof IStructuredSelection) {
-						Object o = ((IStructuredSelection) event.getSelection()).getFirstElement();
-						if (o instanceof Pair)
-							displayText.setText(((Pair) o).fValue.toString());
-						else if (o instanceof ITextSelection) {
-							ITextSelection text = (ITextSelection) o;
-							try {
-								displayText.setText(fDocument.get(text.getOffset(), text.getLength()));
-							}
-							catch (BadLocationException e) {
-								displayText.setText(""); //$NON-NLS-1$
-							}
-						}
-						else
-							displayText.setText("" + o); //$NON-NLS-1$
-					}
-				}
-			});
-			sashForm.setWeights(new int[]{3, 2});
-			return sashForm;
-		}
-	}
-
-	class MarkerAnnotationPropertySource implements IPropertySource {
-		MarkerAnnotation fMarkerAnnotation = null;
-		IPropertyDescriptor[] fDescriptors = null;
-
-		public MarkerAnnotationPropertySource(MarkerAnnotation markerAnnotation) {
-			super();
-			fMarkerAnnotation = markerAnnotation;
-		}
-
-		public Object getEditableValue() {
-			return null;
-		}
-
-		public IPropertyDescriptor[] getPropertyDescriptors() {
-			if (fDescriptors == null) {
-				try {
-					Map attrs = fMarkerAnnotation.getMarker().getAttributes();
-					Object[] keys = attrs.keySet().toArray();
-					fDescriptors = new IPropertyDescriptor[keys.length];
-					for (int i = 0; i < keys.length; i++) {
-						TextPropertyDescriptor descriptor = new TextPropertyDescriptor(keys[i].toString(), keys[i].toString());
-						fDescriptors[i] = descriptor;
-					}
-				}
-				catch (CoreException e) {
-					e.printStackTrace();
-				}
-			}
-			return fDescriptors;
-		}
-
-		public Object getPropertyValue(Object id) {
-			return fMarkerAnnotation.getMarker().getAttribute(id.toString(), ""); //$NON-NLS-1$
-		}
-
-		public boolean isPropertySet(Object id) {
-			return fMarkerAnnotation.getMarker().getAttribute(id.toString(), null) != null;
-		}
-
-		public void resetPropertyValue(Object id) {
-			try {
-				fMarkerAnnotation.getMarker().getAttributes().remove(id);
-			}
-			catch (CoreException e) {
-				e.printStackTrace();
-			}
-		}
-
-		public void setPropertyValue(Object id, Object value) {
-			try {
-				fMarkerAnnotation.getMarker().setAttribute(id.toString(), value);
-			}
-			catch (CoreException e) {
-				e.printStackTrace();
-			}
-		}
-	}
-
-	static class Pair {
-		Object fKey;
-		String fValue;
-
-		public Pair(Object key, String value) {
-			fKey = key;
-			fValue = value;
-		}
-	}
-
-	class ShowPartitionAction extends Action {
-		public ShowPartitionAction() {
-			super();
-		}
-
-		public void run() {
-			/**
-			 * TODO: Provide a more useful control, maybe a table where the
-			 * selection shows you the partition's text in a StyledText pane
-			 * beneath it.
-			 */
-			super.run();
-			new InformationDialog(((Control) fTextEditor.getAdapter(Control.class)).getShell()).open();
-		}
-	}
-
-	IAction fShowPartitionAction = new ShowPartitionAction();
-
-	ITextEditor fTextEditor = null;
-
-	/**
-	 * @param id
-	 */
-	public OffsetStatusLineContributionItem(String id) {
-		super(id);
-	}
-
-	/**
-	 * @param id
-	 * @param visible
-	 * @param widthInChars
-	 */
-	public OffsetStatusLineContributionItem(String id, boolean visible, int widthInChars) {
-		super(id, visible, widthInChars);
-	}
-
-	public void setActiveEditor(ITextEditor textEditor) {
-		fTextEditor = textEditor;
-		setActionHandler(fShowPartitionAction);
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/StructuredTextAnnotationImageProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/StructuredTextAnnotationImageProvider.java
deleted file mode 100644
index b835eda..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/StructuredTextAnnotationImageProvider.java
+++ /dev/null
@@ -1,56 +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.sse.ui.internal.ui;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.texteditor.IAnnotationImageProvider;
-
-/**
- * Image provider for structured text editor annotations.
- * 
- * @author pavery
- */
-public class StructuredTextAnnotationImageProvider implements IAnnotationImageProvider {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptor(java.lang.String)
-	 */
-	public ImageDescriptor getImageDescriptor(String imageDescritporId) {
-		return null;
-	}
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptorId(org.eclipse.jface.text.source.Annotation)
-	 */
-	public String getImageDescriptorId(Annotation annotation) {
-        return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getManagedImage(org.eclipse.jface.text.source.Annotation)
-	 */
-	public Image getManagedImage(Annotation annotation) {
-		// future return different types of managed images as JDT does
-		// eg. overlay icon images, "grayed" images, quick fixable, etc...
-		return null;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Assert.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Assert.java
deleted file mode 100644
index d42a5b2..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Assert.java
+++ /dev/null
@@ -1,120 +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.sse.ui.internal.util;
-
-
-/**
- * <code>Assert</code> is useful for for embedding runtime sanity checks in
- * code. The predicate methods all test a condition and throw some type of
- * unchecked exception if the condition does not hold.
- * <p>
- * Assertion failure exceptions, like most runtime exceptions, are thrown when
- * something is misbehaving. Assertion failures are invariably unspecified
- * behavior; consequently, clients should never rely on these being thrown
- * (and certainly should not being catching them specifically).
- * </p>
- */
-public final class Assert {
-
-	/**
-	 * <code>AssertionFailedException</code> is a runtime exception thrown
-	 * by some of the methods in <code>Assert</code>.
-	 * <p>
-	 * This class is not declared public to prevent some misuses; programs
-	 * that catch or otherwise depend on assertion failures are susceptible to
-	 * unexpected breakage when assertions in the code are added or removed.
-	 * </p>
-	 */
-	class AssertionFailedException extends RuntimeException {
-		/**
-		 * Comment for <code>serialVersionUID</code>
-		 */
-		private static final long serialVersionUID = 1L;
-
-		/**
-		 * Constructs a new exception.
-		 */
-		public AssertionFailedException() {
-			super();
-		}
-
-		/**
-		 * Constructs a new exception with the given message.
-		 */
-		public AssertionFailedException(String detail) {
-			super(detail);
-		}
-	}
-
-	/**
-	 * Asserts that an argument is legal. If the given boolean is not
-	 * <code>true</code>, an <code>IllegalArgumentException</code> is
-	 * thrown. The given message is included in that exception, to aid
-	 * debugging.
-	 * 
-	 * @param expression
-	 *            the outcode of the check
-	 * @param message
-	 *            the message to include in the exception
-	 * @return <code>true</code> if the check passes (does not return if the
-	 *         check fails)
-	 * @exception IllegalArgumentException
-	 *                if the legality test failed
-	 */
-	public static boolean isLegal(boolean expression, String message) {
-		if (!expression)
-			throw new IllegalArgumentException(message);
-		return expression;
-	}
-
-	/**
-	 * Asserts that the given object is not <code>null</code>. If this is
-	 * not the case, some kind of unchecked exception is thrown. The given
-	 * message is included in that exception, to aid debugging.
-	 * 
-	 * @param object
-	 *            the value to test
-	 * @param message
-	 *            the message to include in the exception
-	 * @exception IllegalArgumentException
-	 *                if the object is <code>null</code>
-	 */
-	public static void isNotNull(Object object, String message) {
-		if (object == null) {
-			throw new Assert().new AssertionFailedException(message);
-		}
-	}
-
-	/**
-	 * Asserts that the given boolean is <code>true</code>. If this is not
-	 * the case, some kind of unchecked exception is thrown. The given message
-	 * is included in that exception, to aid debugging.
-	 * 
-	 * @param expression
-	 *            the outcode of the check
-	 * @param message
-	 *            the message to include in the exception
-	 * @return <code>true</code> if the check passes (does not return if the
-	 *         check fails)
-	 */
-	public static boolean isTrue(boolean expression, String message) {
-		if (!expression) {
-			throw new Assert().new AssertionFailedException(message);
-		}
-		return expression;
-	}
-
-	/* This class is not intended to be instantiated. */
-	private Assert() {
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/EditorUtility.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/EditorUtility.java
deleted file mode 100644
index c476a49..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/EditorUtility.java
+++ /dev/null
@@ -1,142 +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.sse.ui.internal.util;
-
-
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * Helpful methods to be used with the Source Editor
- */
-public class EditorUtility {
-
-	/**
-	 * Appends to modifier string of the given SWT modifier bit to the given
-	 * modifierString.
-	 * 
-	 * @param modifierString
-	 *            the modifier string
-	 * @param modifier
-	 *            an int with SWT modifier bit
-	 * @return the concatenated modifier string
-	 */
-	private static String appendModifierString(String modifierString, int modifier) {
-		if (modifierString == null)
-			modifierString = ""; //$NON-NLS-1$
-		String newModifierString = Action.findModifierString(modifier);
-		if (modifierString.length() == 0)
-			return newModifierString;
-		return modifierString + " + " + newModifierString; //$NON-NLS-1$
-	}
-
-	/**
-	 * Computes the state mask for the given modifier string.
-	 * 
-	 * @param modifiers
-	 *            the string with the modifiers, separated by '+', '-', ';',
-	 *            ',' or '.'
-	 * @return the state mask or -1 if the input is invalid
-	 */
-	public static int computeStateMask(String modifiers) {
-		if (modifiers == null)
-			return -1;
-
-		if (modifiers.length() == 0)
-			return SWT.NONE;
-
-		int stateMask = 0;
-		StringTokenizer modifierTokenizer = new StringTokenizer(modifiers, ",;.:+-* "); //$NON-NLS-1$
-		while (modifierTokenizer.hasMoreTokens()) {
-			int modifier = EditorUtility.findLocalizedModifier(modifierTokenizer.nextToken());
-			if (modifier == 0 || (stateMask & modifier) == modifier)
-				return -1;
-			stateMask = stateMask | modifier;
-		}
-		return stateMask;
-	}
-
-	/**
-	 * Maps the localized modifier name to a code in the same manner as
-	 * #findModifier.
-	 * 
-	 * @return the SWT modifier bit, or <code>0</code> if no match was found
-	 * @see findModifier
-	 */
-	public static int findLocalizedModifier(String token) {
-		if (token == null)
-			return 0;
-
-		if (token.equalsIgnoreCase(Action.findModifierString(SWT.CTRL)))
-			return SWT.CTRL;
-		if (token.equalsIgnoreCase(Action.findModifierString(SWT.SHIFT)))
-			return SWT.SHIFT;
-		if (token.equalsIgnoreCase(Action.findModifierString(SWT.ALT)))
-			return SWT.ALT;
-		if (token.equalsIgnoreCase(Action.findModifierString(SWT.COMMAND)))
-			return SWT.COMMAND;
-
-		return 0;
-	}
-
-	/**
-	 * Temporary method to help migrate from using StructuredTextColors to
-	 * using base ColorRegistry. Instead of using symbolic names in the color
-	 * registry, we are currently mapping the rgb.toString value to
-	 * corresponding color.
-	 * 
-	 * @param rgb
-	 * @return Color
-	 */
-	public static Color getColor(RGB rgb) {
-		if (rgb == null)
-			return null;
-
-		// get the color from the platform color registry
-		Color color = JFaceResources.getColorRegistry().get(rgb.toString());
-
-		// if the platform color registry does not have this color yet, add to
-		// the registry
-		if (color == null) {
-			JFaceResources.getColorRegistry().put(rgb.toString(), rgb);
-			color = JFaceResources.getColorRegistry().get(rgb.toString());
-		}
-		return color;
-	}
-
-	/**
-	 * Returns the modifier string for the given SWT modifier modifier bits.
-	 * 
-	 * @param stateMask
-	 *            the SWT modifier bits
-	 * @return the modifier string
-	 */
-	public static String getModifierString(int stateMask) {
-		String modifierString = ""; //$NON-NLS-1$
-		if ((stateMask & SWT.CTRL) == SWT.CTRL)
-			modifierString = appendModifierString(modifierString, SWT.CTRL);
-		if ((stateMask & SWT.ALT) == SWT.ALT)
-			modifierString = appendModifierString(modifierString, SWT.ALT);
-		if ((stateMask & SWT.SHIFT) == SWT.SHIFT)
-			modifierString = appendModifierString(modifierString, SWT.SHIFT);
-		if ((stateMask & SWT.COMMAND) == SWT.COMMAND)
-			modifierString = appendModifierString(modifierString, SWT.COMMAND);
-
-		return modifierString;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PlatformStatusLineUtil.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PlatformStatusLineUtil.java
deleted file mode 100644
index 83344e4..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PlatformStatusLineUtil.java
+++ /dev/null
@@ -1,171 +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.sse.ui.internal.util;
-
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.custom.VerifyKeyListener;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * Utility to display (and/or clear) messages on the status line.
- * 
- * @author pavery
- */
-public class PlatformStatusLineUtil {
-
-	private static class ClearErrorMessage implements Runnable {
-		public void run() {
-			displayMessage(null);
-		}
-	}
-
-	/**
-	 * Used to clear message on focus loss, change of selection, key type,
-	 * etc...
-	 */
-	private static class OneTimeListener extends FocusAdapter implements VerifyKeyListener, SelectionListener, MouseListener {
-
-		private Runnable fRunner = null;
-		private StyledText fStyledText;
-
-		public OneTimeListener(StyledText target, Runnable r) {
-			fStyledText = target;
-			fRunner = r;
-			fStyledText.addVerifyKeyListener(this);
-			fStyledText.addFocusListener(this);
-			fStyledText.addSelectionListener(this);
-			fStyledText.addMouseListener(this);
-		}
-
-		public void focusLost(FocusEvent e) {
-			unhookAndRun();
-		}
-
-		public void mouseDoubleClick(MouseEvent e) {
-			unhookAndRun();
-		}
-
-		public void mouseDown(MouseEvent e) {
-			unhookAndRun();
-		}
-
-		public void mouseUp(MouseEvent e) {
-			//
-		}
-
-		private void unhookAndRun() {
-			fStyledText.removeVerifyKeyListener(this);
-			fStyledText.removeFocusListener(this);
-			fStyledText.removeSelectionListener(this);
-			fStyledText.removeMouseListener(this);
-			fStyledText.getDisplay().asyncExec(fRunner);
-		}
-
-		public void verifyKey(VerifyEvent event) {
-			unhookAndRun();
-		}
-
-		public void widgetDefaultSelected(SelectionEvent e) {
-			unhookAndRun();
-		}
-
-		public void widgetSelected(SelectionEvent e) {
-			unhookAndRun();
-		}
-	}
-
-	/**
-	 * Status line will be cleared w/ key type, or selection change
-	 * 
-	 * @param widget
-	 */
-	public static void addOneTimeClearListener() {
-		IEditorPart editor = getActiveEditor();
-		boolean added = false;
-		if (editor != null) {
-			Control control = (Control) editor.getAdapter(Control.class);
-			if (control instanceof StyledText) {
-				addOneTimeClearListener(((StyledText) control));
-				added = true;
-			}
-		}
-		if (!added) {
-			// clear the error message immediately
-			displayMessage(null);
-		}
-	}
-
-	private static void addOneTimeClearListener(StyledText widget) {
-		new OneTimeListener(widget, new ClearErrorMessage());
-	}
-
-	/**
-	 * Clears the status line immediately
-	 */
-	public static void clearStatusLine() {
-		displayMessage(null);
-	}
-
-	/**
-	 * Display a message on the status line (with a beep)
-	 * 
-	 * @param msg
-	 */
-	public static void displayErrorMessage(String msg) {
-		displayMessage(msg);
-		PlatformUI.getWorkbench().getDisplay().beep();
-	}
-
-	/**
-	 * Display a message on the status line (no beep)
-	 * 
-	 * @param msg
-	 */
-	public static void displayMessage(String msg) {
-		IEditorPart editor = getActiveEditor();
-		if (editor != null) {
-			editor.getEditorSite().getActionBars().getStatusLineManager().setErrorMessage(msg);
-		}
-
-	}
-
-	private static IEditorPart getActiveEditor() {
-		IEditorPart editor = null;
-		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-		if (window == null) {
-			window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-		}
-		if (window != null) {
-			IWorkbenchPage page = window.getActivePage();
-			if (page != null)
-				editor = page.getActiveEditor();
-		}
-		return editor;
-	}
-
-	private PlatformStatusLineUtil() {
-		// force use of singleton
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/RegistryReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/RegistryReader.java
deleted file mode 100644
index b68597e..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/RegistryReader.java
+++ /dev/null
@@ -1,175 +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.sse.ui.internal.util;
-
-
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-/**
- * Template implementation of a registry reader that creates objects
- * representing registry contents. Typically, an extension contains one
- * element, but this reader handles multiple elements per extension.
- * 
- * To start reading the extensions from the registry for an extension point,
- * call the method <code>readRegistry</code>.
- * 
- * To read children of an IConfigurationElement, call the method
- * <code>readElementChildren</code> from your implementation of the method
- * <code>readElement</code>, as it will not be done by default.
- */
-public abstract class RegistryReader {
-
-
-	protected static final String TAG_DESCRIPTION = "description"; //$NON-NLS-1$
-
-	/**
-	 * The constructor.
-	 */
-	protected RegistryReader() {
-	}
-
-	/**
-	 * This method extracts description as a subelement of the given element.
-	 * 
-	 * @return description string if defined, or empty string if not.
-	 */
-	protected String getDescription(IConfigurationElement config) {
-		IConfigurationElement[] children = config.getChildren(TAG_DESCRIPTION);
-		if (children.length >= 1) {
-			return children[0].getValue();
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	/**
-	 * Logs the error in the workbench log using the provided text and the
-	 * information in the configuration element.
-	 */
-	protected void logError(IConfigurationElement element, String text) {
-		IExtension extension = element.getDeclaringExtension();
-		StringBuffer buf = new StringBuffer();
-		buf.append("Plugin " + extension.getNamespace() + ", extension " + extension.getExtensionPointUniqueIdentifier()); //$NON-NLS-2$//$NON-NLS-1$
-		buf.append("\n" + text); //$NON-NLS-1$
-		Logger.log(Logger.ERROR, buf.toString());
-	}
-
-	/**
-	 * Logs a very common registry error when a required attribute is missing.
-	 */
-	protected void logMissingAttribute(IConfigurationElement element, String attributeName) {
-		logError(element, "Required attribute '" + attributeName + "' not defined"); //$NON-NLS-2$//$NON-NLS-1$
-	}
-
-	/**
-	 * Logs a registry error when the configuration element is unknown.
-	 */
-	protected void logUnknownElement(IConfigurationElement element) {
-		logError(element, "Unknown extension tag found: " + element.getName()); //$NON-NLS-1$
-	}
-
-	/**
-	 * Apply a reproducable order to the list of extensions provided, such
-	 * that the order will not change as extensions are added or removed.
-	 */
-	protected IExtension[] orderExtensions(IExtension[] extensions) {
-		// By default, the order is based on plugin id sorted
-		// in ascending order. The order for a plugin providing
-		// more than one extension for an extension point is
-		// dependent in the order listed in the XML file.
-		Sorter sorter = new Sorter() {
-			public boolean compare(Object extension1, Object extension2) {
-				String s1 = ((IExtension) extension1).getNamespace().toUpperCase();
-				String s2 = ((IExtension) extension2).getNamespace().toUpperCase();
-				//Return true if elementTwo is 'greater than' elementOne
-				return s2.compareTo(s1) > 0;
-			}
-		};
-
-		Object[] sorted = sorter.sort(extensions);
-		IExtension[] sortedExtension = new IExtension[sorted.length];
-		System.arraycopy(sorted, 0, sortedExtension, 0, sorted.length);
-		return sortedExtension;
-	}
-
-	/**
-	 * Implement this method to read element's attributes. If children should
-	 * also be read, then implementor is responsible for calling
-	 * <code>readElementChildren</code>. Implementor is also responsible
-	 * for logging missing attributes.
-	 * 
-	 * @return true if element was recognized, false if not.
-	 */
-	protected abstract boolean readElement(IConfigurationElement element);
-
-	/**
-	 * Read the element's children. This is called by the subclass'
-	 * readElement method when it wants to read the children of the element.
-	 */
-	protected void readElementChildren(IConfigurationElement element) {
-		readElements(element.getChildren());
-	}
-
-	/**
-	 * Read each element one at a time by calling the subclass implementation
-	 * of <code>readElement</code>.
-	 * 
-	 * Logs an error if the element was not recognized.
-	 */
-	protected void readElements(IConfigurationElement[] elements) {
-		for (int i = 0; i < elements.length; i++) {
-			if (!readElement(elements[i]))
-				logUnknownElement(elements[i]);
-		}
-	}
-
-	/**
-	 * Read one extension by looping through its configuration elements.
-	 */
-	protected void readExtension(IExtension extension) {
-		readElements(extension.getConfigurationElements());
-	}
-
-	/**
-	 * @deprecated use readRegistry(IExtensionRegistry registry, String pluginId, String extensionPoint)
-	 */
-	protected void readRegistry(IPluginRegistry registry, String pluginId, String extensionPoint) {
-		IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPoint);
-		if (point != null) {
-			IExtension[] extensions = point.getExtensions();
-			extensions = orderExtensions(extensions);
-			for (int i = 0; i < extensions.length; i++)
-				readExtension(extensions[i]);
-		}
-	}
-	
-	/**
-	 * Start the registry reading process using the supplied plugin ID and
-	 * extension point.
-	 */
-	protected void readRegistry(IExtensionRegistry registry, String pluginId, String extensionPoint) {
-		IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPoint);
-		if (point != null) {
-			IExtension[] extensions = point.getExtensions();
-			extensions = orderExtensions(extensions);
-			for (int i = 0; i < extensions.length; i++)
-				readExtension(extensions[i]);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Sorter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Sorter.java
deleted file mode 100644
index 6cee01a..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Sorter.java
+++ /dev/null
@@ -1,77 +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.sse.ui.internal.util;
-
-
-
-/**
- * The SortOperation takes a collection of objects and returns a sorted
- * collection of these objects. Concrete instances of this class provide the
- * criteria for the sorting of the objects based on the type of the objects.
- */
-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
-	 * method with the particular implementation of the 'greater than' concept
-	 * for the objects being sorted.
-	 */
-	public abstract boolean compare(Object elementOne, Object elementTwo);
-
-	/**
-	 * Sort the objects in sorted collection and return that collection.
-	 */
-	private Object[] quickSort(Object[] sortedCollection, int left, int right) {
-		int originalLeft = left;
-		int originalRight = right;
-		Object mid = sortedCollection[(left + right) / 2];
-
-		do {
-			while (compare(sortedCollection[left], mid))
-				left++;
-			while (compare(mid, sortedCollection[right]))
-				right--;
-			if (left <= right) {
-				Object tmp = sortedCollection[left];
-				sortedCollection[left] = sortedCollection[right];
-				sortedCollection[right] = tmp;
-				left++;
-				right--;
-			}
-		} while (left <= right);
-
-		if (originalLeft < right)
-			sortedCollection = quickSort(sortedCollection, originalLeft, right);
-		if (left < originalRight)
-			sortedCollection = quickSort(sortedCollection, left, originalRight);
-
-		return sortedCollection;
-	}
-
-	/**
-	 * Return a new sorted collection from this unsorted collection. Sort
-	 * using quick sort.
-	 */
-	public Object[] sort(Object[] unSortedCollection) {
-		int size = unSortedCollection.length;
-		Object[] sortedCollection = new Object[size];
-
-		//copy the array so can return a new sorted collection
-		System.arraycopy(unSortedCollection, 0, sortedCollection, 0, size);
-		if (size > 1)
-			quickSort(sortedCollection, 0, size - 1);
-
-		return sortedCollection;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/CaretEvent.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/CaretEvent.java
deleted file mode 100644
index 6c8fa1a..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/CaretEvent.java
+++ /dev/null
@@ -1,52 +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.sse.ui.internal.view.events;
-
-/**
- * @deprecated - use base selection notification
- * 
- * Simply holds data to be passed to CaretEventListeners
- */
-public class CaretEvent extends java.util.EventObject {
-
-	/**
-	 * Comment for <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-	// initialize to impossible location
-	int fPosition = -1;
-
-	/**
-	 * doesnt't make sense to have a CaretEvent without the Caret postion, so
-	 * use other constructor
-	 */
-	protected CaretEvent(Object source) {
-		super(source);
-	}
-
-	/**
-	 * This is the preferred constructor.
-	 */
-	public CaretEvent(Object source, int position) {
-		super(source);
-		setPosition(position);
-	}
-
-	public int getPosition() {
-		return fPosition;
-	}
-
-	void setPosition(int newPosition) {
-		fPosition = newPosition;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ICaretListener.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ICaretListener.java
deleted file mode 100644
index 90b19ec..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ICaretListener.java
+++ /dev/null
@@ -1,20 +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.sse.ui.internal.view.events;
-
-/**
- * @deprecated - use base selection notification
- */
-public interface ICaretListener extends java.util.EventListener {
-	public void caretMoved(CaretEvent event);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/INodeSelectionListener.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/INodeSelectionListener.java
deleted file mode 100644
index fc5c0ed..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/INodeSelectionListener.java
+++ /dev/null
@@ -1,22 +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.sse.ui.internal.view.events;
-
-
-/**
- * @deprecated - use base selection notification
- */
-
-public interface INodeSelectionListener {
-	void nodeSelectionChanged(NodeSelectionChangedEvent event);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ITextSelectionListener.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ITextSelectionListener.java
deleted file mode 100644
index 4683bbb..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ITextSelectionListener.java
+++ /dev/null
@@ -1,20 +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.sse.ui.internal.view.events;
-
-/**
- * @deprecated - use base selection notification
- */
-public interface ITextSelectionListener {
-	void textSelectionChanged(TextSelectionChangedEvent event);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/NodeSelectionChangedEvent.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/NodeSelectionChangedEvent.java
deleted file mode 100644
index 2940a7f..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/NodeSelectionChangedEvent.java
+++ /dev/null
@@ -1,43 +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.sse.ui.internal.view.events;
-
-import java.util.List;
-
-/**
- * @deprecated - use base selection notification
- */
-public class NodeSelectionChangedEvent extends java.util.EventObject {
-	/**
-	 * Comment for <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-
-	int fCaretPosition;
-
-	List fSelectedNodes;
-
-	public NodeSelectionChangedEvent(Object source, List selectedNodes, int caretPosition) {
-		super(source);
-		fSelectedNodes = selectedNodes;
-		fCaretPosition = caretPosition;
-	}
-
-	public int getCaretPosition() {
-		return fCaretPosition;
-	}
-
-	public List getSelectedNodes() {
-		return fSelectedNodes;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/TextSelectionChangedEvent.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/TextSelectionChangedEvent.java
deleted file mode 100644
index 09dbf4c..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/TextSelectionChangedEvent.java
+++ /dev/null
@@ -1,41 +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.sse.ui.internal.view.events;
-
-/**
- * @deprecated - use base selection notification
- */
-public class TextSelectionChangedEvent extends java.util.EventObject {
-	/**
-	 * Comment for <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-
-	int fTextSelectionEnd;
-
-	int fTextSelectionStart;
-
-	public TextSelectionChangedEvent(Object source, int textSelectionStart, int textSelectionEnd) {
-		super(source);
-		fTextSelectionStart = textSelectionStart;
-		fTextSelectionEnd = textSelectionEnd;
-	}
-
-	public int getTextSelectionEnd() {
-		return fTextSelectionEnd;
-	}
-
-	public int getTextSelectionStart() {
-		return fTextSelectionStart;
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/ContentOutlineConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/ContentOutlineConfiguration.java
deleted file mode 100644
index 07f0d62..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/ContentOutlineConfiguration.java
+++ /dev/null
@@ -1,307 +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.sse.ui.views.contentoutline;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.TransferDragSourceListener;
-import org.eclipse.jface.util.TransferDropTargetListener;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-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;
-
-/**
- * Basic Configuration class for Outline Pages
- * 
- * @since 1.0
- */
-public abstract class ContentOutlineConfiguration {
-	/**
-	 * Add a collapse action to help with navigation.
-	 */
-	private class CollapseTreeAction extends Action {
-		private TreeViewer fTreeViewer = null;
-
-		public CollapseTreeAction(TreeViewer viewer) {
-			super(SSEUIMessages.ContentOutlineConfiguration_0, AS_PUSH_BUTTON); //$NON-NLS-1$
-			setImageDescriptor(COLLAPSE_E);
-			setDisabledImageDescriptor(COLLAPSE_D);
-			setToolTipText(getText());
-			fTreeViewer = viewer;
-		}
-
-		public void run() {
-			super.run();
-			fTreeViewer.collapseAll();
-		}
-	}
-
-	/**
-	 * Toggles whether incoming selection notification affects us
-	 */
-	private class ToggleLinkAction extends PropertyChangeUpdateAction {
-		public ToggleLinkAction(IPreferenceStore store, String preference) {
-			super(SSEUIMessages.ContentOutlineConfiguration_1, store, preference, true); //$NON-NLS-1$
-			setToolTipText(getText());
-			setDisabledImageDescriptor(SYNCED_D);
-			setImageDescriptor(SYNCED_E);
-			update();
-		}
-
-		public void update() {
-			super.update();
-			setLinkWithEditor(isChecked());
-		}
-	}
-
-	ImageDescriptor COLLAPSE_D = EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_DLCL_COLLAPSEALL);
-	ImageDescriptor COLLAPSE_E = EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_ELCL_COLLAPSEALL);
-
-	private boolean fIsLinkWithEditor = false;
-
-	private ILabelProvider fLabelProvider;
-	private IContributionItem[] fMenuContributions = null;
-	private IContributionItem[] fToolbarContributions = null;
-	private final String OUTLINE_LINK_PREF = "outline-link-editor"; //$NON-NLS-1$
-	ImageDescriptor SYNCED_D = EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_DLCL_SYNCED);
-	ImageDescriptor SYNCED_E = EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_ELCL_SYNCED);
-
-	/**
-	 * Create new instance of ContentOutlineConfiguration
-	 */
-	public ContentOutlineConfiguration() {
-		// Must have empty constructor to createExecutableExtension
-		super();
-	}
-
-	/**
-	 * Creates the contributions for the view's local menu. Subclasses should
-	 * merge their contributions with these.
-	 * 
-	 * @param viewer
-	 *            the TreeViewer associated with this configuration
-	 * @return menu contributions
-	 */
-	protected IContributionItem[] createMenuContributions(TreeViewer viewer) {
-		IContributionItem toggleLinkItem = new PropertyChangeUpdateActionContributionItem(new ToggleLinkAction(getPreferenceStore(), OUTLINE_LINK_PREF));
-		IContributionItem[] items = new IContributionItem[]{toggleLinkItem};
-		return items;
-	}
-
-	/**
-	 * Creates the toolbar contributions. Subclasses should merge their
-	 * contributions with these.
-	 * 
-	 * @param viewer
-	 *            the TreeViewer associated with this configuration
-	 * @return toolbar contributions
-	 */
-	protected IContributionItem[] createToolbarContributions(TreeViewer viewer) {
-		IContributionItem collapseAllItem = new ActionContributionItem(new CollapseTreeAction(viewer));
-		IContributionItem[] items = new IContributionItem[]{collapseAllItem};
-		return items;
-	}
-
-	/**
-	 * Returns the ContentProvider to use with the given viewer.
-	 * 
-	 * @param viewer
-	 *            the TreeViewer associated with this configuration
-	 * @return the IContentProvider to use with this viewer
-	 */
-	public abstract IContentProvider getContentProvider(TreeViewer viewer);
-
-	/**
-	 * Returns an array of KeyListeners to attach to the given viewer's
-	 * control or null.
-	 * 
-	 * @param viewer
-	 *            the TreeViewer associated with this configuration
-	 * @return an array of KeyListeners to attach to the TreeViewer's Control,
-	 *         or null. The listeners should adhere to the KeyEvent.doit field
-	 *         to ensure proper behaviors. Ordering of the event notifications
-	 *         is dependent on the Control in the TreeViewer.
-	 */
-	public KeyListener[] getKeyListeners(TreeViewer viewer) {
-		return null;
-	}
-
-	/**
-	 * Returns the LabelProvider for the items within the given viewer.
-	 * 
-	 * @param viewer
-	 *            the TreeViewer associated with this configuration
-	 * @return the ILabelProvider for items within the viewer
-	 */
-	public ILabelProvider getLabelProvider(TreeViewer viewer) {
-		if (fLabelProvider == null)
-			fLabelProvider = new LabelProvider();
-		return fLabelProvider;
-	}
-
-	/**
-	 * Returns the menu contribution items for the local menu in the outline.
-	 * 
-	 * @param viewer
-	 *            the TreeViewer associated with this configuration
-	 * @return IContributionItem[] for the local menu
-	 */
-	public final IContributionItem[] getMenuContributions(TreeViewer viewer) {
-		if (fMenuContributions == null) {
-			fMenuContributions = createMenuContributions(viewer);
-		}
-		return fMenuContributions;
-	}
-
-	/**
-	 * Returns the menu listener to notify when the given viewer's context
-	 * menu is about to be shown or null.
-	 * 
-	 * @param viewer
-	 *            the TreeViewer associated with this configuration
-	 * @return the IMenuListener to notify when the viewer's context menu is
-	 *         about to be shown, or null
-	 */
-	public IMenuListener getMenuListener(TreeViewer viewer) {
-		return null;
-	}
-
-	/**
-	 * Returns the PreferenceStore to use for this configuration.
-	 * 
-	 * @return the preference store in which to remember preferences (such as
-	 *         the link-with-editor toggle state)
-	 */
-	protected IPreferenceStore getPreferenceStore() {
-		return SSEUIPlugin.getInstance().getPreferenceStore();
-	}
-
-	/**
-	 * Returns the (filtered) selection from the given selection.
-	 * 
-	 * @param selection
-	 *            model selection
-	 * @param viewer
-	 *            the TreeViewer associated with this configuration
-	 * @return The (filtered) selection from this event. Uses include mapping
-	 *         model selection onto elements provided by the content provider.
-	 *         Should only return elements that will be shown in the Tree
-	 *         Control.
-	 */
-	public ISelection getSelection(TreeViewer viewer, ISelection selection) {
-		return selection;
-	}
-
-	/**
-	 * Returns contribution items for the local toolbar in the outline.
-	 * 
-	 * @param viewer
-	 *            the TreeViewer associated with this configuration
-	 * @return IContributionItem[] for the local toolbar
-	 */
-	public final IContributionItem[] getToolbarContributions(TreeViewer viewer) {
-		if (fToolbarContributions == null) {
-			fToolbarContributions = createToolbarContributions(viewer);
-		}
-		return fToolbarContributions;
-	}
-
-	/**
-	 * Adopted since you can't easily removeDragSupport from
-	 * StructuredViewers.
-	 * 
-	 * @param treeViewer
-	 *            the TreeViewer associated with this configuration
-	 * @return an array of TransferDragSourceListeners
-	 */
-	public TransferDragSourceListener[] getTransferDragSourceListeners(TreeViewer treeViewer) {
-		return new TransferDragSourceListener[0];
-	}
-
-	/**
-	 * Adopted since you can't easily removeDropSupport from
-	 * StructuredViewers.
-	 * 
-	 * @param treeViewer
-	 *            the TreeViewer associated with this configuration
-	 * @return an array of TransferDropTargetListeners
-	 */
-	public TransferDropTargetListener[] getTransferDropTargetListeners(TreeViewer treeViewer) {
-		return new TransferDropTargetListener[0];
-	}
-
-	/**
-	 * Returns true if node selection changes affect selection in the
-	 * TreeViewer.
-	 * 
-	 * @param treeViewer
-	 *            the TreeViewer associated with this configuration
-	 * @return true if outline is currently linked to selection in editor,
-	 *         false otherwise
-	 */
-	public boolean isLinkedWithEditor(TreeViewer treeViewer) {
-		return fIsLinkWithEditor;
-	}
-
-	/**
-	 * Sets whether or not outline view should be linked with selection in
-	 * editor.
-	 * 
-	 * @param isLinkWithEditor
-	 *            The isLinkWithEditor to set.
-	 */
-	void setLinkWithEditor(boolean isLinkWithEditor) {
-		fIsLinkWithEditor = isLinkWithEditor;
-	}
-
-	/**
-	 * General hook for resource releasing and listener removal when
-	 * configurations change or the viewer is disposed of. This implementation
-	 * stops of any remaining PropertyChangeUpdateActionContributionItem from
-	 * preference listening.
-	 * 
-	 * @param viewer
-	 *            the TreeViewer associated with this configuration
-	 */
-	public void unconfigure(TreeViewer viewer) {
-		if (fToolbarContributions != null) {
-			for (int i = 0; i < fToolbarContributions.length; i++) {
-				if (fToolbarContributions[i] instanceof PropertyChangeUpdateActionContributionItem) {
-					((PropertyChangeUpdateActionContributionItem) fToolbarContributions[i]).disconnect();
-				}
-			}
-			fToolbarContributions = null;
-		}
-		if (fMenuContributions != null) {
-			for (int i = 0; i < fMenuContributions.length; i++) {
-				if (fMenuContributions[i] instanceof PropertyChangeUpdateActionContributionItem) {
-					((PropertyChangeUpdateActionContributionItem) fMenuContributions[i]).disconnect();
-				}
-			}
-			fMenuContributions = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/IPropertySourceExtension.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/IPropertySourceExtension.java
deleted file mode 100644
index d74eee9..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/IPropertySourceExtension.java
+++ /dev/null
@@ -1,41 +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.sse.ui.views.properties;
-
-/**
- * Declares that this IPropertySource might support outright removal of a
- * property
- * 
- * @since 1.0
- */
-public interface IPropertySourceExtension {
-
-	/**
-	 * Returns true if the property matching the given name can be removed,
-	 * false otherwise.
-	 * 
-	 * @param name
-	 *            the name of the property
-	 * @return whether the property matching this name can be removed
-	 */
-	boolean isPropertyRemovable(Object name);
-
-	/**
-	 * Removes the property with the given displayed name. If no such property
-	 * exists, nothing is done.
-	 * 
-	 * @param name
-	 *            the displayed name of the property
-	 */
-	void removeProperty(Object name);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/PropertySheetConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/PropertySheetConfiguration.java
deleted file mode 100644
index f89e38d..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/PropertySheetConfiguration.java
+++ /dev/null
@@ -1,104 +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.sse.ui.views.properties;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-
-
-/**
- * Configuration class for Property Sheet Pages. Not finalized.
- * 
- * @since 1.0
- */
-public abstract class PropertySheetConfiguration {
-	/**
-	 * Create new instance of PropertySheetConfiguration
-	 */
-	public PropertySheetConfiguration() {
-		// Must have empty constructor to createExecutableExtension
-		super();
-	}
-
-	/**
-	 * Adds contribution menu items to the given menuManager, toolbarManager,
-	 * statusLineManager.
-	 * 
-	 * @param menuManager
-	 *            the local menu manager of the property sheet
-	 * @param toolBarManager
-	 *            the local toolbar manager of the property sheet
-	 * @param statusLineManager
-	 *            the status line manager of the property sheet
-	 */
-	public void addContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
-		// do nothing
-	}
-
-	/**
-	 * Allows for filteration of selection before being sent to the viewer.
-	 * 
-	 * @param selectingPart
-	 *            may be null
-	 * @param selection
-	 *            model selection
-	 * @return the (filtered) selection to be sent to the viewer
-	 */
-	public ISelection getInputSelection(IWorkbenchPart selectingPart, ISelection selection) {
-		ISelection preferredSelection = selection;
-		if (selection instanceof IStructuredSelection) {
-			// don't support more than one selected node
-			if (((IStructuredSelection) selection).size() > 1)
-				preferredSelection = StructuredSelection.EMPTY;
-		}
-		return preferredSelection;
-	}
-
-	/**
-	 * Returns the correct IPropertySourceProvider.
-	 * 
-	 * @param page
-	 *            the page to be configured by this configuration
-	 * @return the IPropertySourceProvider for the given page
-	 */
-	public abstract IPropertySourceProvider getPropertySourceProvider(IPropertySheetPage page);
-
-	/**
-	 * Removes contribution menu items from the given menuManager,
-	 * toolbarManager, statusLineManager.
-	 * 
-	 * @param menuManager
-	 *            the local menu manager of the property sheet
-	 * @param toolBarManager
-	 *            the local toolbar manager of the property sheet
-	 * @param statusLineManager
-	 *            the status line manager of the property sheet
-	 */
-	public void removeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
-		// do nothing
-	}
-
-	/**
-	 * General hook for resource releasing and listener removal when
-	 * configurations change.
-	 */
-	public void unconfigure() {
-	}
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/testToc.xml b/bundles/org.eclipse.wst.sse.ui/testToc.xml
deleted file mode 100644
index 6142b90..0000000
--- a/bundles/org.eclipse.wst.sse.ui/testToc.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc
-	label="Test TOC"
-	topic="html/toc.html">
-	<link toc="toc.xml" />
-</toc>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/toc.xml b/bundles/org.eclipse.wst.sse.ui/toc.xml
deleted file mode 100644
index a5c0bb6..0000000
--- a/bundles/org.eclipse.wst.sse.ui/toc.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc label="Sample Table of Contents">
-	<topic
-		label="Main Topic"
-		href="html/maintopic.html">
-		<topic
-			label="Sub Topic"
-			href="html/subtopic.html" />
-	</topic>
-	<topic label="Main Topic 2" />
-</toc>
diff --git a/bundles/org.eclipse.wst.xml.core/.classpath b/bundles/org.eclipse.wst.xml.core/.classpath
deleted file mode 100644
index 9ca79ee..0000000
--- a/bundles/org.eclipse.wst.xml.core/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src-contentmodel"/>
-	<classpathentry kind="src" path="src-validation"/>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="src-catalog"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="src" path="src-emfModelSynch"/>
-	<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 3a79625..0000000
--- a/bundles/org.eclipse.wst.xml.core/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-bin
-temp.folder
-build.xml
-xmlmodel.jar
-org.eclipse.wst.xml.core_1.0.0.jar
-@dot
-src.zip
diff --git a/bundles/org.eclipse.wst.xml.core/.options b/bundles/org.eclipse.wst.xml.core/.options
deleted file mode 100644
index e80df84..0000000
--- a/bundles/org.eclipse.wst.xml.core/.options
+++ /dev/null
@@ -1,2 +0,0 @@
-org.eclipse.wst.xml.core/debug=true
-org.eclipse.wst.xml.core/debug/tracefilter=
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 ea2cecb..0000000
--- a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,69 +0,0 @@
-#Sat Oct 01 03:53:23 EDT 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-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.assertIdentifier=warning
-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.emptyStatement=ignore
-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=ignore
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-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.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.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=ignore
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-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.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 2535c48..0000000
--- a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jul 05 01:42:27 EDT 2005
-eclipse.preferences.version=1
-internal.default.compliance=default
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 42fb716..0000000
--- a/bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Fri May 27 23:56:32 EDT 2005
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-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.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 ff50a31..0000000
--- a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex
+++ /dev/null
@@ -1,256 +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
- *******************************************************************************/
-/*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
-
-
-%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}* "<\?xml" {S}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}
-	
-}	
-	
-<ST_XMLDecl> 
-{
-	"version" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}
-	"encoding" {BeginAttribeValue} {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). 
-	"\?>"    {yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd;}
-}	
-
-	
-
-<QuotedAttributeValue>
-{
-	\"                      { yybegin(DQ_STRING); string.setLength(0); }
-	\'			{ yybegin(SQ_STRING); string.setLength(0); }
-	// in this state, anything other than a space character can start an undelimited string
-	{S}*.           { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}
-
-}	
-
-
-<DQ_STRING>
-{
-
-	\"                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	'<'			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<SQ_STRING>
-{
-
-	\'                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"%>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	'<'			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<UnDelimitedString>
-{
-
-	{S}                     { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	'<'	
-	{ yypushback(1);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
-	\'			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	
-	\"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	
-	.			{ 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)
-<YYINITIAL, ST_XMLDecl, QuotedAttributeValue>
-{
-// this is the fallback (match "anything") rule  (for this scanner, input is ignored, and position advanced, if not recognized)
-.|\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 fda94fb..0000000
--- a/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,70 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.xml.core; singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.wst.xml.core.internal.XMLCorePlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.xml.core.internal,
- org.eclipse.wst.xml.core.internal.catalog,
- org.eclipse.wst.xml.core.internal.catalog.provisional,
- org.eclipse.wst.xml.core.internal.cleanup,
- org.eclipse.wst.xml.core.internal.commentelement,
- org.eclipse.wst.xml.core.internal.commentelement.impl,
- org.eclipse.wst.xml.core.internal.commentelement.util,
- org.eclipse.wst.xml.core.internal.contentmodel,
- org.eclipse.wst.xml.core.internal.contentmodel.annotation,
- org.eclipse.wst.xml.core.internal.contentmodel.basic,
- org.eclipse.wst.xml.core.internal.contentmodel.factory,
- org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation,
- org.eclipse.wst.xml.core.internal.contentmodel.internal.modelqueryimpl,
- org.eclipse.wst.xml.core.internal.contentmodel.internal.util,
- org.eclipse.wst.xml.core.internal.contentmodel.modelquery,
- org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension,
- org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl,
- org.eclipse.wst.xml.core.internal.contentmodel.util,
- org.eclipse.wst.xml.core.internal.contenttype,
- org.eclipse.wst.xml.core.internal.document,
- org.eclipse.wst.xml.core.internal.encoding,
- org.eclipse.wst.xml.core.internal.modelhandler,
- org.eclipse.wst.xml.core.internal.modelquery,
- org.eclipse.wst.xml.core.internal.parser,
- org.eclipse.wst.xml.core.internal.parser.regions,
- org.eclipse.wst.xml.core.internal.preferences,
- org.eclipse.wst.xml.core.internal.propagate,
- org.eclipse.wst.xml.core.internal.provisional,
- org.eclipse.wst.xml.core.internal.provisional.contentmodel,
- org.eclipse.wst.xml.core.internal.provisional.contenttype,
- org.eclipse.wst.xml.core.internal.provisional.document,
- org.eclipse.wst.xml.core.internal.provisional.format,
- org.eclipse.wst.xml.core.internal.provisional.text,
- org.eclipse.wst.xml.core.internal.regions,
- org.eclipse.wst.xml.core.internal.ssemodelquery,
- org.eclipse.wst.xml.core.internal.tasks,
- org.eclipse.wst.xml.core.internal.text,
- org.eclipse.wst.xml.core.internal.text.rules,
- org.eclipse.wst.xml.core.internal.validate,
- org.eclipse.wst.xml.core.internal.validation,
- org.eclipse.wst.xml.core.internal.validation.core,
- org.eclipse.wst.xml.core.internal.validation.core.logging,
- org.w3c.dom,
- org.w3c.dom.ranges,
- org.w3c.dom.traversal,
- org.eclipse.wst.xml.core.internal.emf2xml
- 
-Require-Bundle: org.apache.xerces;visibility:=reexport,
- org.eclipse.wst.sse.core,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.core.filebuffers,
- org.eclipse.text,
- org.eclipse.wst.common.uriresolver,
- org.eclipse.wst.validation,
- org.eclipse.jem.util;resolution:=optional,
- org.eclipse.emf.ecore.edit;resolution:=optional,
- org.eclipse.wst.common.emf;resolution:=optional,
- org.eclipse.emf.ecore.xmi;resolution:=optional,
- org.eclipse.wst.common.emfworkbench.integration;resolution:=optional
- 
-Eclipse-AutoStart: true; exceptions="org.eclipse.wst.xml.core.internal.contenttype"
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/about.html b/bundles/org.eclipse.wst.xml.core/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/bundles/org.eclipse.wst.xml.core/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>February 24, 2005</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.</p>
-
-</body>
-</html>
\ 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 8b7f886..0000000
--- a/bundles/org.eclipse.wst.xml.core/build.properties
+++ /dev/null
@@ -1,35 +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
-#     
-###############################################################################
-bin.includes = plugin.xml,\
-               .options,\
-               extensions.xml,\
-               plugin.properties,\
-               META-INF/,\
-               .,\
-               about.html,\
-               schema/
-bin.excludes = bin/**,\
-               @dot/**,\
-               temp.folder/**
-src.includes = extensions.xml,\
-               component.xml,\
-               build.properties,\
-               schema/,\
-               DevTimeSupport/
-source.. = src-catalog,\
-           src-contentmodel/,\
-           src-validation/,\
-           src/,\
-           src-emfModelSynch/
-
-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 e1cdf41..0000000
--- a/bundles/org.eclipse.wst.xml.core/plugin.properties
+++ /dev/null
@@ -1,25 +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
-#     
-###############################################################################
-providerName=Eclipse.org
-pluginName=Structured Source XML Model
-nlFeatureName=Structured Source XML Model NL Support
-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
-XML_Catalog_Contributor_Extension_Point.name=XML Catalog Contributor Extension Point
-XSL_Content_Type_Extension_Element.name=XSL
-XMI_Content_Type=XMI
\ 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 d721dbe..0000000
--- a/bundles/org.eclipse.wst.xml.core/plugin.xml
+++ /dev/null
@@ -1,165 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-	<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"
-			contentTypeIds="org.eclipse.core.runtime.xml" />
-	</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.provisional.format.FormatProcessorXML"
-			contentTypeId="org.eclipse.core.runtime.xml">
-		</processor>
-	</extension>
-
-	<extension point="org.eclipse.core.runtime.contentTypes">
-		<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>
-	</extension>
-
-	<extension point="org.eclipse.core.runtime.contentTypes">
-		<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>
-
-	<!--  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>
-	</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>
-       <uiContextSensitiveClass
-          key="ValidateEditContext"
-          className="org.eclipse.wst.common.internal.emfworkbench.validateedit.ValidateEditHeadlessContext"
-          context="Headless">
-      </uiContextSensitiveClass>
-  </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 c90597b..0000000
--- a/bundles/org.eclipse.wst.xml.core/schema/catalogContributions.exsd
+++ /dev/null
@@ -1,286 +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.uriresolver.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;property 
-                  name=&quot;webURL&quot;
-                  value=&quot;http://schemas.xmlsoap.org/wsdl/&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/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 a946840..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 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 plugin 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 13c6d25..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright (c) 2002 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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) 
-  {         
-    if (path.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)
-      //
-		URL resolvedURL;
-		try
-		{
-			resolvedURL = Platform.resolve(new URL(path));
-			return resolvedURL.toString();
-		} catch (IOException e)
-		{
-			return path;
-		}
-      
-    }
-    // this is the typical case, where the resource is located relative
-    // to the plugin that declares the extension point
-    try {
-    	URL resolvedURL = Platform.resolve(platformURL);
-    	URL absoluteURL = new URL(resolvedURL, path);
-    	return absoluteURL.toString();
-    } catch (IOException e) {
-    	return path;
-    }
-     
-  }
-  
-  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 61e6631..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java
+++ /dev/null
@@ -1,143 +0,0 @@
-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 acb37c3..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEntry.java
+++ /dev/null
@@ -1,61 +0,0 @@
-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 a860bb2..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 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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 2bd4837..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java
+++ /dev/null
@@ -1,187 +0,0 @@
-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.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;
-      baseURIStack.push(xmlCatalog.getBase());
-    }
-
-    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);    
-      }
-
-	  // 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$
-	        catalogEntry.setURI(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); 
-        catalogEntry.setURI(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 58f943b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- */
-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();
-
-	// protected boolean isPluginEnvironment = false;
-
-	public CatalogSet() {
-		super();
-	}
-
-	public Catalog lookupOrCreateCatalog(String id, String uri) {
-		Catalog catalog = getCatalog(id, uri);
-		if (catalog == null) {
-			boolean ok = true;
-			catalog = new Catalog(this, id, uri);
-			try {
-				catalog.load();
-			}
-			catch (Exception e) {
-				ok = false;
-				// 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$
-			}
-			if (ok) {
-				uriResourceMap.put(uri, catalog);
-			}
-		}
-		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);
-	}
-
-	public String getCatalogPersistenceLocation(String id) {
-		return (String) catalogPersistenceLocations.get(id);
-	}
-	/*
-	 * public boolean isPluginEnvironment() { return isPluginEnvironment; }
-	 * 
-	 * public void setPluginEnvironment(boolean isPluginEnvironment) {
-	 * this.isPluginEnvironment = isPluginEnvironment; }
-	 */
-}
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 e477628..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java
+++ /dev/null
@@ -1,228 +0,0 @@
-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
-  {
-    visitCatalog(xmlCatalog);
-    OutputStream outputStream = getOutputStream(uri, true);
-    serialize(outputStream);
-  }
-
-  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, boolean overwrite) throws FileNotFoundException, IOException
-  {
-    String filePath = removeProtocol(uri);
-    File file = new File(filePath);
-    if (file.exists() && overwrite)
-    {
-      file.delete();
-    }
-    File parent = file.getParentFile();
-    if (!parent.exists())
-    {
-      parent.mkdirs();
-    }
-    try
-    {
-      file.createNewFile();
-    }
-    catch (IOException e)
-    {
-      Logger.logException(e);
-    }
-    OutputStream stream = new FileOutputStream(filePath);
-    return stream;
-  }
-  
-  protected static String removeProtocol(String uri)
-  {
-    String result = uri;  
-    String protocol_pattenrn = ":"; //$NON-NLS-1$
-    if (uri != null)
-    {
-      int index = uri.indexOf(protocol_pattenrn);
-      if (index > 2)
-      {
-        result = result.substring(index + protocol_pattenrn.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 ad0ddc9..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/NextCatalog.java
+++ /dev/null
@@ -1,41 +0,0 @@
-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
-{
-  String location;
-
-  public NextCatalog()
-  {
-    super(ICatalogElement.TYPE_NEXT_CATALOG);
-  }
-    
-  public String getCatalogLocation()
-  {
-    return location;
-  }
-
-  public ICatalog getReferencedCatalog()
-  {
-    return ((Catalog)ownerCatalog).getCatalogSet().lookupOrCreateCatalog(getId(), getAbsolutePath(location));  
-  }
-
-  public void setCatalogLocation(String uri)
-  {
-    location = uri;
-  }
-  
-  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 06e8941..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java
+++ /dev/null
@@ -1,71 +0,0 @@
-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 268a8f7..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 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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 2d865af..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 IBM Corporation and others.
- * All righorg.eclipse.wst.xml.uriresolver and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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 bb87d0a..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogElement.java
+++ /dev/null
@@ -1,71 +0,0 @@
-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 3e90cb8..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java
+++ /dev/null
@@ -1,59 +0,0 @@
-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 244e557..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 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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 ad76e8c..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 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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 c33a140..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/INextCatalog.java
+++ /dev/null
@@ -1,41 +0,0 @@
-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 c3230ae..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 a85cbde..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 429bacd..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 cdef962..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 74ad25b..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 477aaec..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 bd780c5..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 1e00265..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 d0248d9..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 260d07c..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 eca84b8..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 af1e1e3..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 46d9b33..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 df00d0e..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 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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 e9968a8..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 5c94ac8..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 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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 java.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 9913ae2..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 60b2603..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 69e51df..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 6e6df24..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 933fcb8..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 9bdf866..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 af0fcc3..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 8335e1f..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 cafef41..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNamedNodeMapImpl.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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();
-  }
-
-  /**
-   * 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 5c63598..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 bc9b6b9..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 39b540b..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 c509802..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 3f2db44..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 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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 87e2b78..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - Initial API and implementation
-*   Jens Lukowski/Innoopract - initial renaming/restructuring
-* 
-*/
-package org.eclipse.wst.xml.core.internal.contentmodel.factory;
-
-import java.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 7eab4f2..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) 2005 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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 11279e9..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 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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 e2d455b..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 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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 896acd6..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 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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 fe1634b..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 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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 6870419..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 59bcfc7..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 93e43a1..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionDescriptor.java
+++ /dev/null
@@ -1,54 +0,0 @@
-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 81136f0..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionManagerImpl.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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.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)
-  {
-    String contentTypeId = getContentTypeId(element);
-    String parentNamespace = element.getNamespaceURI();
-
-	List modelQueryExtensions = modelQueryExtensionRegistry.getApplicableExtensions(contentTypeId, parentNamespace);
-	
-    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();
-          }
-        }
-      }
-    }
-  }
-  
-  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 63261d3..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, 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.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 f027bf7..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 0cb9bd5..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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;
-  }
-}
\ No newline at end of file
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 8696df4..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 8c4a7b6..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManager.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2002 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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$
-
-	/**
-	 * 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 b236092..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 7a23418..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 c8d93d1..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 3b0c0d3..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 098f4f3..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 9fa1000..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 e9cc02e..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 e92e668..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtension.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public abstract class ModelQueryExtension
-{  
-  protected static final String[] EMPTY_STRING_ARRAY = {};
-  
-  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;
-  }
-  
-  public boolean isApplicableChildElement(Node parentNode, String namespace, String name)
-  {
-    return true;
-  }
-}
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 2cdf950..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtensionManager.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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);
-}
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 6618e12..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 5b0ddb4..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 1f90805..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentManagerImpl.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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);
-  }         
-
-       
-  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))
-    {
-      resolvedURI = lookupOrCreateResolvedURI(publicId, 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;         
-    int x = 1;
-    x++;
-    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 10b9de2..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 29d93f3..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 c813dac..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 1ff4182..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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);
-    }  
-    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 0331531..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 646629a..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 b55003a..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDescriptionBuilder.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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.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;
-
-  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)
-  {
-    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$
-    }
-
-    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);
-      }
-    }
-    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 961878a..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 4843d1e..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 68f78a7..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 841de74..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 8b6dda7..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 f07e8dd..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java
+++ /dev/null
@@ -1,692 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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))
-          ; // 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 2bc784f..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 e16579c..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 bf0710b..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 03aca74..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 601b8ba..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 f14a5b7..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceAttributeVisitor.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - Initial API and implementation
-*   Jens Lukowski/Innoopract - initial renaming/restructuring
-* 
-*/
-package org.eclipse.wst.xml.core.internal.contentmodel.util;
-
-import java.util.StringTokenizer;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-
-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();
-    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 (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());
-        }
-      }
-      else if (unprefixedName != null)
-      {
-        if (unprefixedName.equals("xmlns")) //$NON-NLS-1$
-        {
-          visitXMLNamespaceAttribute(attr, "", attr.getValue()); //$NON-NLS-1$
-        }
-      }      
-    }
-  }      
-}
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 d1cbde8..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 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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 617f11e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceTable.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - 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)
-  {                     
-    //DOMExtension domExtension = DOMExtensionProviderRegistry.getInstance().getDOMExtension(document);
-    //if (domExtension != null)
-    //{                          
-    //  addNamespaceInfoList(domExtension.getImplictNamespaceInfoList(), true);
-    // }
-  }   
-
-  private NamespaceTable()
-  {        
-  }  
-
-  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 6f144d5..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java
+++ /dev/null
@@ -1,343 +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.emf2xml;
-
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EObject;
-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.document.ElementImpl;
-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 {
-
-
-
-	public EMF2DOMSSEAdapter(TranslatorResource resource, Document document, EMF2DOMRenderer renderer, Translator translator) {
-		super(resource, document, renderer, translator);
-	}
-
-
-	public EMF2DOMSSEAdapter(Notifier object, Node node, EMF2DOMRenderer renderer, Translator translator) {
-		super(object, node, renderer, translator);
-	}
-
-
-	public EMF2DOMSSEAdapter(Node node, EMF2DOMRenderer renderer, Translator translator) {
-		super(node, renderer, translator);
-	}
-
-	/*
-	 * 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());
-			}
-		}
-	}
-
-
-	/*
-	 * 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;
-			}
-			org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError("DOM Change: " + notifType); //$NON-NLS-1$
-			org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError("\tnotifier      : " + notifier); //$NON-NLS-1$
-			org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError("\tchangedFeature: " + changedFeature); //$NON-NLS-1$
-			org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError("\toldValue      : " + oldValue); //$NON-NLS-1$
-			org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError("\tnewValue      : " + newValue); //$NON-NLS-1$
-		}
-	}
-
-	protected String getNewlineString(Node node) {
-		// we should always have XMLNode, and Flatmodel,
-		// 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 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 (org.eclipse.jface.text.BadLocationException ex) {
-			org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ex);
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	protected IDOMNode getXMLNode() {
-		return (IDOMNode) getNode();
-	}
-
-	/**
-	 * @see com.ibm.etools.emf2xml.impl.EMF2DOMAdapterImpl#primAddDOMAdapter(Node, EMF2DOMAdapter)
-	 */
-	protected void primAddDOMAdapter(Node aNode, EMF2DOMAdapter anAdapter) {
-		((IDOMNode) aNode).addAdapter((EMF2DOMSSEAdapter) anAdapter);
-	}
-
-	protected EMF2DOMAdapter primGetExistingAdapter(Node aNode) {
-		return (EMF2DOMAdapter) ((IDOMNode) aNode).getExistingAdapter(EMF2DOMAdapter.ADAPTER_CLASS);
-
-	}
-
-	protected void removeDOMAdapter(Node aNode, EMF2DOMAdapter anAdapter) {
-		((IDOMNode) aNode).removeAdapter((EMF2DOMSSEAdapter) anAdapter);
-	}
-
-	protected void setEmptyTag(Element element) {
-		((ElementImpl) element).setEmptyTag(true);
-	}
-
-	protected boolean isEmptyTag(Element parent) {
-		return ((ElementImpl) parent).isEmptyTag();
-	}
-
-	protected IDOMModel getXMLModel() {
-		if (getNode() != null)
-			return ((IDOMNode) getNode()).getModel();
-		return null;
-	}
-
-	public void updateDOM() {
-		if (!isNotificationEnabled())
-			return;
-		try {
-			disableUndoManagementIfNecessary();
-			primUpdateDOM();
-		} finally {
-			enableUndoManagement();
-		}
-	}
-
-	protected void preUpdateDOMFeature(Translator map, Node node, EObject mofObject) {
-		super.preUpdateDOMFeature(map, node, mofObject);
-		disableUndoManagementIfNecessary();
-	}
-
-	protected void disableUndoManagementIfNecessary() {
-		IDOMModel model = getXMLModel();
-		if (model != null && model.getUndoManager() != null)
-			model.disableUndoManagement();
-	}
-
-	protected void postUpdateDOMFeature(Translator map, Node node, EObject mofObject) {
-		enableUndoManagement();
-	}
-
-	protected void enableUndoManagement() {
-		IDOMModel model = getXMLModel();
-		if (model != null && model.getUndoManager() != null)
-			model.enableUndoManagement();
-	}
-
-	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())
-			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 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;
-	}
-
-	/**
-	 * @see com.ibm.etools.emf2xml.impl.AbstractEMF2DOMAdapterImpl#reorderDOMChild(Node, Node, Node,
-	 *      Translator)
-	 */
-	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);
-	}
-
-	/**
-	 * 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);
-	}
-
-	/*
-	 * Do nothing for SED, we will tolerate anything they add
-	 */
-	protected void handleInvalidMultiNodes(String nodeName) {
-		//Do nothing
-	}
-
-	/*
-	 * Do nothing for SED, we will tolerate anything they add
-	 */
-	protected void handleFeatureValueConversionException(FeatureValueConversionException ex) {
-		//Do nothing
-	}
-
-
-
-}
\ No newline at end of file
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 d7e6d05..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java
+++ /dev/null
@@ -1,509 +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.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.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.runtime.CoreException;
-import org.eclipse.emf.ecore.EObject;
-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.logger.proxy.Logger;
-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.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.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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 {
-
-	/** The XML DOM model */
-	protected IDOMModel xmlModel;
-
-	/** Used internally; the unique id for the xml model */
-	protected String xmlModelId;
-
-	private IModelManager modelManager;
-
-	protected Object aboutToChangeNode = null;
-
-	protected boolean xmlModelReverted = false;
-
-	protected boolean isBatchChanges = false;
-
-	private boolean isSaving = false;
-
-	public EMF2DOMSSERenderer() {
-		super();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.ibm.etools.emf2xml.impl.EMF2DOMRenderer#managesDOMAdapters()
-	 */
-	protected boolean managesDOMAdapters() {
-		return false;
-	}
-
-	protected EMF2DOMAdapter createRootDOMAdapter() {
-		return new EMF2DOMSSEAdapter(getResource(), document, this, getResource().getRootTranslator());
-	}
-
-	public void deRegisterAsModelStateListener() {
-		if (xmlModel != null)
-			xmlModel.removeModelStateListener(this);
-	}
-
-	public void deRegisterAsModelLifecycleListener() {
-		if (xmlModel != null)
-			xmlModel.removeModelLifecycleListener(this);
-	}
-
-	/**
-	 * Return the DOM model for this resource.
-	 */
-	public IDOMModel getXMLModel() {
-		return xmlModel;
-	}
-
-	public String getXMLModelId() {
-		return xmlModelId;
-	}
-
-	public boolean isModified() {
-		return (getXMLModel() != null && getXMLModel().isDirty());
-	}
-
-	public void modelAboutToBeChanged(IStructuredModel model) {
-		if (model.getStructuredDocument() != null)
-			aboutToChangeNode = model.getStructuredDocument().getFirstStructuredDocumentRegion();
-	}
-
-	public void modelChanged(IStructuredModel model) {
-		if (isBatchChanges)
-			return;
-		try {
-			if (aboutToChangeNode != null && model.getStructuredDocument() != null && model.getStructuredDocument().getFirstStructuredDocumentRegion() != aboutToChangeNode) {
-				modelAccessForWrite();
-				try {
-					xmlModelReverted = true;
-					resource.unload();
-				} finally {
-					if (getXMLModel() != null)
-						getXMLModel().releaseFromEdit();
-				}
-			}
-		} finally {
-			aboutToChangeNode = null;
-		}
-	}
-
-	public void accessForRead() {
-		if (!resource.isNew()) {
-			String id = getModelManagerId();
-			getModelManager().getExistingModelForRead(id);
-		}
-	}
-
-	public void accessForWrite() {
-		modelAccessForWrite();
-	}
-
-	private void modelAccessForWrite() {
-		String id = getModelManagerId();
-		getModelManager().getExistingModelForEdit(id);
-	}
-
-	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);
-			ResourceSetWorkbenchEditSynchronizer synchronizer = (ResourceSetWorkbenchEditSynchronizer) ((ProjectResourceSet) resource.getResourceSet()).getSynchronizer();
-			IFile aFile = WorkbenchResourceHelper.getFile(resource);
-			synchronizer.preSave(aFile);
-		}
-		if (isDirty) 
-			resource.setModified(true);
-	}
-
-	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();
-	}
-
-	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;
-	}
-
-	/**
-	 * Insert the method's description here. Creation date: (9/7/2001 10:49:53 AM)
-	 */
-	public void registerAsModelStateListener() {
-		this.xmlModel.addModelStateListener(this);
-	}
-
-	public void registerAsModelLifecycleListener() {
-		this.xmlModel.addModelLifecycleListener(this);
-	}
-
-	/**
-	 * 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;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.ibm.etools.emf2xml.Renderer#doSave(java.io.OutputStream, java.util.Map)
-	 */
-	public void doSave(OutputStream outputStream, Map options) throws IOException {
-
-		try {
-			isSaving = true;
-			if (null != outputStream) {
-				throw new RuntimeException(UIResourceHandler.getString("EMF2DOMSedRenderer_UI_0", new Object[]{this.getClass().getName()}));} //$NON-NLS-1$
-			createDOMTreeIfNecessary();
-			ResourceSetWorkbenchEditSynchronizer synchronizer = (ResourceSetWorkbenchEditSynchronizer) ((ProjectResourceSet) resource.getResourceSet()).getSynchronizer();
-			IFile aFile = WorkbenchResourceHelper.getFile(resource);
-			try {
-				synchronizer.preSave(aFile);
-				xmlModel.save(aFile);
-			} catch (CoreException ex) {
-				synchronizer.removeFromRecentlySavedList(aFile);
-				Logger.getLogger().logError(ex);
-			}
-			cacheSynchronizationStamp();
-		} finally {
-			isSaving = false;
-		}
-	}
-
-	/**
-	 * @see com.ibm.etools.common.mof2dom.XMLDOMResource#wasReverted()
-	 */
-	public boolean wasReverted() {
-		return xmlModelReverted;
-	}
-
-	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;
-	}
-
-	public void releaseFromRead() {
-		if (xmlModel != null)
-			xmlModel.releaseFromRead();
-	}
-
-	public void releaseFromWrite() {
-		if (xmlModel != null)
-			xmlModel.releaseFromEdit();
-	}
-
-	protected ResourceSet getResourceSet() {
-		return resource == null ? null : resource.getResourceSet();
-	}
-
-	public boolean isShared() {
-		if (getResourceSet() == null || xmlModel == null)
-			return false;
-		return xmlModel.isShared();
-	}
-
-	public boolean isSharedForWrite() {
-		if (getResourceSet() == null || xmlModel == null)
-			return false;
-		return xmlModel.isSharedForEdit();
-	}
-
-	/**
-	 * 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) {
-				org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e1);
-			} finally {
-				if (null != is) {
-					is.close();
-				}
-			}
-			initializeXMLModel(file, true);
-		} catch (java.io.IOException ex) {
-			org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(UIResourceHandler.getString("Unexpected_IO_exception_occurred_creating_xml_document_1_EXC_"));//$NON-NLS-1$
-			org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ex);
-		}
-	}
-
-	protected void createDOMTreeIfNecessary() {
-		if (needsToCreateDOM)
-			createDOMTree();
-	}
-
-	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 {
-			if (forWrite) {
-				setXMLModel((IDOMModel) getModelManager().getModelForEdit(file));
-			}
-			else {
-				setXMLModel((IDOMModel) getModelManager().getModelForRead(file));
-			}
-			setXMLModelId(getXMLModel().getId());
-			needsToCreateDOM = false;
-		} catch (CoreException e) {
-			org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e);
-			return null;
-		}
-		String id = getModelManager().calculateId(file);
-		syncReferenceCounts(id, forWrite);
-		if (xmlModel != null)
-			document = xmlModel.getDocument();
-		return xmlModel;
-	}
-
-	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);
-	}
-
-	protected void loadDocument(InputStream in, Map options) throws IOException {
-		if (null != in) {
-			throw new RuntimeException(UIResourceHandler.getString("EMF2DOMSedRenderer_UI_1", new Object[]{this.getClass().getName()}));} //$NON-NLS-1$
-		IFile file = WorkbenchResourceHelper.getFile(resource);
-		initializeXMLModel(file, (resource.getWriteCount() != 0));
-		cacheSynchronizationStamp();
-	}
-
-	private void cacheSynchronizationStamp() {
-		IFile file = WorkbenchResourceHelper.getFile(resource);
-		if (file != null) {
-			if (xmlModel != null)
-				xmlModel.resetSynchronizationStamp(file);
-		}
-	}
-
-	public void setBatchMode(boolean isBatch) {
-		if (isBatch) {
-			isBatchChanges = true;
-			getXMLModel().aboutToChangeModel();
-			setRootNodeAdapterNotificationEnabled(false);
-		}
-		else {
-			getXMLModel().changedModel();
-			setRootNodeAdapterNotificationEnabled(true);
-			isBatchChanges = false;
-		}
-	}
-	public boolean isBatchMode() {
-		return isBatchChanges;
-	}
-
-	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);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.ibm.etools.emf2xml.impl.EMF2DOMRenderer#getExistingDOMAdapter(org.w3c.dom.Node)
-	 */
-	public EMF2DOMAdapter getExistingDOMAdapter(Node node) {
-		IDOMNode xNode = (IDOMNode) node;
-		return (EMF2DOMSSEAdapter) xNode.getAdapterFor(EMF2DOMAdapter.ADAPTER_CLASS);
-	}
-
-	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);
-		}
-	}
-
-	public boolean useStreamsForIO() {
-		return false;
-	}
-
-	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);
-			}
-		}
-	}
-
-	public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	public void modelReinitialized(IStructuredModel structuredModel) {
-		// TODO Auto-generated method stub
-		
-	}
-}
\ No newline at end of file
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 bd52799..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERendererFactory.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
- *******************************************************************************/
-
-/*
- * Created on Oct 10, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-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
- * 
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public class EMF2DOMSSERendererFactory extends RendererFactory {
-
-	public static final EMF2DOMSSERendererFactory INSTANCE = new EMF2DOMSSERendererFactory();
-
-	public EMF2DOMSSERendererFactory() {
-		//Default constructor
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.ibm.etools.emf2xml.RendererFactory#createRenderer()
-	 */
-	public Renderer createRenderer() {
-		return new EMF2DOMSSERenderer();
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/UIResourceHandler.java b/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/UIResourceHandler.java
deleted file mode 100644
index 8823f39..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/UIResourceHandler.java
+++ /dev/null
@@ -1,61 +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.emf2xml;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class UIResourceHandler {
-
-	private static ResourceBundle fgResourceBundle;
-
-	/**
-	 * Returns the resource bundle used by all classes in this Project
-	 */
-	public static ResourceBundle getResourceBundle() {
-		try {
-			return ResourceBundle.getBundle("emftosed");//$NON-NLS-1$
-		} catch (MissingResourceException e) {
-			// does nothing - this method will return null and
-			// getString(String, String) will return the key
-			// it was called with
-		}
-		return null;
-	}
-
-	public static String getString(String key) {
-		if (fgResourceBundle == null) {
-			fgResourceBundle = getResourceBundle();
-		}
-
-		if (fgResourceBundle != null) {
-			try {
-				return fgResourceBundle.getString(key);
-			} catch (MissingResourceException e) {
-				return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
-			}
-		}
-		return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
-
-	}
-
-	public static String getString(String key, Object[] args) {
-
-		try {
-			return MessageFormat.format(getString(key), args);
-		} catch (IllegalArgumentException e) {
-			return getString(key);
-		}
-
-	}
-}
\ 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 acce777..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.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
- *******************************************************************************/
-
-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 java.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.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 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)
-        {
-          location = URIResolverPlugin.createResolver().resolve(baseURI, rootElementNamespace, location);    
-          location = URIResolverPlugin.createResolver().resolvePhysicalLocation(baseURI, rootElementNamespace, 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;
-  }
-}
\ No newline at end of file
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 6457db9..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java
+++ /dev/null
@@ -1,156 +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
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.validation;
-
-import org.apache.xerces.xni.XMLLocator;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
-
-
-/**
- * A validation information object specific to XML validators.
- * 
- * @author Lawrence Mandel, IBM
- */
-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;
-  
-  /**
-   * 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;
-}
-
-}
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 77c6683..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java
+++ /dev/null
@@ -1,35 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - 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;
-
-	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 7294d9c..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, 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.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 a8bc261..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
+++ /dev/null
@@ -1,534 +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 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.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.apache.xerces.impl.XMLErrorReporter;
-import org.apache.xerces.parsers.StandardParserConfiguration;
-import org.apache.xerces.xni.NamespaceContext;
-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.osgi.util.NLS;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.validation.core.LazyURLInputStream;
-import org.eclipse.wst.xml.core.internal.validation.core.logging.LoggerFactory;
-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;
-
-/**
- * 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 MyEntityResolver entityResolver = null;
-  protected Hashtable ingoredErrorKeyTable = new Hashtable();
-
-  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$
-  
-  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);
-  }
-
-  /**
-   * 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());
-      StandardParserConfiguration configuration = new MyStandardParserConfiguration(valinfo);
-      reader = new org.apache.xerces.parsers.SAXParser(configuration)
-      {
-        public void startDocument(org.apache.xerces.xni.XMLLocator theLocator, java.lang.String encoding, NamespaceContext nscontext, org.apache.xerces.xni.Augmentations augs) 
-        {
-          valinfo.setXMLLocator(theLocator);
-          super.startDocument(theLocator, encoding, nscontext, augs); 
-        }
-      };
-
-      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$
-      
-      // 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)
-    { 
-      //TODO: log error message;
-      //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);  
-  }
-
-  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);
-      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)
-  {
-    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);      
-    }
-    catch (SAXParseException saxParseException)
-    {
-      // These errors are caught by the error handler.
-      //addValidationMessage(valinfo, saxParseException);
-    }                 
-    catch (IOException ioException)
-    {
-      addValidationMessage(valinfo, ioException);
-    }                 
-    catch (Exception exception)
-    {  
-    	LoggerFactory.getLoggerInstance().logError(exception.getLocalizedMessage(), exception);
-    }
-     
-    
-    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;
-    
-    
-    /**
-     * 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
-      {
-        return _internalResolveEntity(uriResolver, rid);
-      }
-      catch(IOException e)
-      {
-        //e.printStackTrace();   
-      }      
-      return null;
-    }
-  }
-  
-  // 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);
-        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)
-      {       	
-        if(severity == WARNING)
-        {
-          valinfo.addWarning(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), exception.getSystemId());
-        }
-        else
-        {
-          valinfo.addError(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), 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 StandardParserConfiguration that creates an error reporter which can ignore
-   * DTD error messages for DTD's with no elements defined.
-   */
-
-  protected class MyStandardParserConfiguration extends StandardParserConfiguration
-  {
-  	XMLValidationInfo valinfo = null;
-    List reportedExceptions = new ArrayList(); 
-  	
-  	/**
-  	 * Constructor.
-  	 * 
-  	 * @param valinfo The XMLValidationInfo object to use.
-  	 */
-  	public MyStandardParserConfiguration(XMLValidationInfo valinfo)
-  	{
-  	  this.valinfo = valinfo;
-  	}
-
-    /* (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);
-		      }
-		    }
-		};
-    }
-  }
-}
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/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 807ea9a..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java
+++ /dev/null
@@ -1,195 +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
- *******************************************************************************/
-
-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;
-  }
-                                     
-}
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 c80e023..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, 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.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 0b49920..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, 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.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 e346947..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, 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.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 22b8335..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, 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.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 9a49c5d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/LoggerFactory.java
+++ /dev/null
@@ -1,100 +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
- *******************************************************************************/
-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
- */
-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/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 35e7142..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties
+++ /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
-###############################################################################
-!-- 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..."
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 9056605..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, 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;
-
-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 6454928..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, 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;
-
-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 172f867..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, 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;
-
-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 47770a0..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, 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;
-
-import java.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 f2b8a31..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java
+++ /dev/null
@@ -1,82 +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;
-
-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;
-import org.osgi.framework.BundleContext;
-
-
-/**
- * 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 = new CatalogSet();
-	   
-
-	/**
-	 * Returns the shared instance.
-	 */
-	public static XMLCorePlugin getDefault() {
-		return plugin;
-	}
-
-	/**
-	 * @deprecated use ResourcesPlugin.getWorkspace();
-	 */
-	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 void start(BundleContext context) throws Exception 
-	{
-		super.start(context);
-	    catalogSet.putCatalogPersistenceLocation(DEFAULT_CATALOG_ID, getPluginStateLocation(Catalog.DEFAULT_CATALOG_FILE));
-	    catalogSet.putCatalogPersistenceLocation(SYSTEM_CATALOG_ID, getPluginStateLocation(Catalog.SYSTEM_CATALOG_FILE));
-	    catalogSet.putCatalogPersistenceLocation(USER_CATALOG_ID, getPluginStateLocation(Catalog.USER_CATALOG_FILE));
-	}
-	
-	public ICatalog getDefaultXMLCatalog()
-	{
-	    return catalogSet.lookupOrCreateCatalog(DEFAULT_CATALOG_ID, getPluginStateLocation(Catalog.DEFAULT_CATALOG_FILE));
-	}
-
-}
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 c99da79..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, 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
-#     
-###############################################################################
-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
\ No newline at end of file
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 97bf41c..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, 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.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.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-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 FormatProcessorXML();
-	}
-
-	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 aaac354..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, 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.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.internal.util.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 ebe7fec..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, 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.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 4095a5c..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, 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.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 3d8d4bf..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java
+++ /dev/null
@@ -1,110 +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.commentelement;
-
-
-
-import org.eclipse.core.runtime.IPluginDescriptor;
-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();
-	}
-
-	/**
-	 * @deprecated this should not be needed by anyone
-	 */
-	public IPluginDescriptor getHandlerPluginDescriptor() {
-		return fConfiguration.getHandlerPluginDescriptor();
-	}
-
-	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 03d7f3a..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, 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.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 d4b8391..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, 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.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 1fe62da..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java
+++ /dev/null
@@ -1,230 +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.commentelement.impl;
-
-
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPluginDescriptor;
-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;
-	}
-
-	/**
-	 * @deprecated this should not be needed by anyone
-	 */
-	public IPluginDescriptor getHandlerPluginDescriptor() {
-		return fElement.getDeclaringExtension().getDeclaringPluginDescriptor();
-	}
-
-	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 8fc50b5..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, 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.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 1351c42..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, 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.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) {
-		super();
-		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 33d9cb1..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, 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.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 2c00760..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, 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;
-
-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 d9ae470..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, 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;
-
-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 cb9617f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ContentDescriberForXML.java
+++ /dev/null
@@ -1,269 +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;
-
-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 boolean restrictedMode = true;
-	private XMLResourceEncodingDetector fResourceEncodingDetector;
-
-	private IResourceCharsetDetector getDetector() {
-		if (fResourceEncodingDetector == null) {
-			fResourceEncodingDetector = new XMLResourceEncodingDetector();
-		}
-		return fResourceEncodingDetector;
-	}
-
-	/*
-	 * (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 = getDetector().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 9a002b7..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, 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 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 bc47024..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, 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;
-
-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 20ab286..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, 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;
-
-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 3eab68b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java
+++ /dev/null
@@ -1,1033 +0,0 @@
-/* The following code was generated by JFlex 1.4 on 7/5/05 1:19 AM */
-
-/*******************************************************************************
- * 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
- *******************************************************************************/
-/*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
- * on 7/5/05 1:19 AM from the specification file
- * <tt>D:/builds/Workspaces/PureHeadWTP_M7/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 = 
-    "\11\0\1\6\1\11\2\0\1\10\22\0\1\6\1\0\1\32\2\0"+
-    "\1\34\1\0\1\33\24\0\1\12\1\7\1\31\1\13\3\0\1\26"+
-    "\1\27\1\20\1\0\1\30\1\0\1\23\2\0\1\16\1\15\1\25"+
-    "\1\24\2\0\1\21\1\22\2\0\1\17\1\0\1\14\12\0\1\26"+
-    "\1\27\1\20\1\0\1\30\1\0\1\23\2\0\1\16\1\15\1\25"+
-    "\1\24\2\0\1\21\1\22\2\0\1\17\1\0\1\14\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\11\1\2\2\1\1\1\3\1\4\1\5\1\6"+
-    "\1\5\1\7\1\5\1\7\1\5\1\10\2\11\1\12"+
-    "\1\13\4\0\1\14\3\0\1\15\1\0\1\16\1\17"+
-    "\11\0\1\20\4\0\1\21\1\0\1\22";
-
-  private static int [] zzUnpackAction() {
-    int [] result = new int[62];
-    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 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;
-
-  /** 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 < 148) {
-      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.
-   */
-  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 = zzPushbackPos = 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;
-            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 8: 
-                case 9: zzIsFinal = true; zzState = 11; break zzForNext;
-                case 10: zzIsFinal = true; zzState = 12; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 7; break zzForNext;
-              }
-
-            case 2:
-              switch (zzInput) {
-                case 11: zzIsFinal = true; zzState = 13; break zzForNext;
-                case 15: zzIsFinal = true; zzState = 14; break zzForNext;
-                case 16: zzIsFinal = true; zzState = 15; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 7; break zzForNext;
-              }
-
-            case 3:
-              switch (zzInput) {
-                case 6: 
-                case 8: zzIsFinal = true; zzState = 17; break zzForNext;
-                case 9: zzIsFinal = true; zzState = 18; break zzForNext;
-                case 26: zzIsFinal = true; zzNoLookAhead = true; zzState = 19; break zzForNext;
-                case 27: zzIsFinal = true; zzNoLookAhead = true; zzState = 20; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 16; break zzForNext;
-              }
-
-            case 4:
-              switch (zzInput) {
-                case 8: 
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 22; break zzForNext;
-                case 11: zzIsFinal = true; zzState = 23; break zzForNext;
-                case 26: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
-                case 27: zzIsFinal = true; zzState = 25; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 21; break zzForNext;
-              }
-
-            case 5:
-              switch (zzInput) {
-                case 8: 
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 22; break zzForNext;
-                case 27: zzIsFinal = true; zzState = 26; break zzForNext;
-                case 28: zzIsFinal = true; zzState = 27; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 21; break zzForNext;
-              }
-
-            case 6:
-              switch (zzInput) {
-                case 11: zzIsFinal = true; zzState = 27; break zzForNext;
-                case 6: 
-                case 8: 
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 28; break zzForNext;
-                case 26: zzIsFinal = true; zzNoLookAhead = true; zzState = 29; break zzForNext;
-                case 27: zzIsFinal = true; zzState = 30; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 21; break zzForNext;
-              }
-
-            case 8:
-              switch (zzInput) {
-                case 2: zzIsFinal = true; zzNoLookAhead = true; zzState = 31; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 9:
-              switch (zzInput) {
-                case 1: zzIsFinal = true; zzNoLookAhead = true; zzState = 32; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 10:
-              switch (zzInput) {
-                case 4: zzState = 33; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 11:
-              switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: zzState = 34; break zzForNext;
-                case 10: zzState = 35; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 12:
-              switch (zzInput) {
-                case 11: zzState = 36; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 13:
-              switch (zzInput) {
-                case 25: zzIsFinal = true; zzNoLookAhead = true; zzState = 37; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 14:
-              switch (zzInput) {
-                case 16: zzState = 38; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 15:
-              switch (zzInput) {
-                case 21: zzState = 39; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 17:
-              switch (zzInput) {
-                case 6: 
-                case 8: zzIsFinal = true; zzState = 17; break zzForNext;
-                case 9: zzState = 40; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 16; break zzForNext;
-              }
-
-            case 18:
-              switch (zzInput) {
-                case 6: 
-                case 8: zzIsFinal = true; zzState = 17; break zzForNext;
-                case 9: zzState = 40; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 16; break zzForNext;
-              }
-
-            case 23:
-              switch (zzInput) {
-                case 25: zzIsFinal = true; zzNoLookAhead = true; zzState = 41; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 25:
-              switch (zzInput) {
-                case 10: zzState = 42; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 26:
-              switch (zzInput) {
-                case 10: zzState = 42; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 27:
-              switch (zzInput) {
-                case 25: zzIsFinal = true; zzNoLookAhead = true; zzState = 43; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 30:
-              switch (zzInput) {
-                case 10: zzState = 42; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 33:
-              switch (zzInput) {
-                case 5: zzIsFinal = true; zzNoLookAhead = true; zzState = 44; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 34:
-              switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: zzState = 34; break zzForNext;
-                case 10: zzState = 35; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 35:
-              switch (zzInput) {
-                case 11: zzState = 36; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 36:
-              switch (zzInput) {
-                case 12: zzState = 45; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 38:
-              switch (zzInput) {
-                case 17: zzState = 46; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 39:
-              switch (zzInput) {
-                case 22: zzState = 47; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 40:
-              switch (zzInput) {
-                case 6: 
-                case 8: zzIsFinal = true; zzState = 17; break zzForNext;
-                case 9: zzState = 40; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 16; break zzForNext;
-              }
-
-            case 42:
-              switch (zzInput) {
-                case 27: zzIsFinal = true; zzNoLookAhead = true; zzState = 22; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 45:
-              switch (zzInput) {
-                case 13: zzState = 48; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 46:
-              switch (zzInput) {
-                case 18: zzState = 49; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 47:
-              switch (zzInput) {
-                case 20: zzState = 50; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 48:
-              switch (zzInput) {
-                case 14: zzState = 51; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 49:
-              switch (zzInput) {
-                case 19: zzState = 52; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 50:
-              switch (zzInput) {
-                case 23: zzState = 53; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 51:
-              switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: zzIsFinal = true; zzState = 54; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 52:
-              switch (zzInput) {
-                case 20: zzState = 55; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 53:
-              switch (zzInput) {
-                case 19: zzState = 56; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 54:
-              switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: zzIsFinal = true; zzState = 54; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 55:
-              switch (zzInput) {
-                case 21: zzState = 57; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 56:
-              switch (zzInput) {
-                case 21: zzState = 58; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 57:
-              switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: zzState = 57; break zzForNext;
-                case 7: zzIsFinal = true; zzState = 59; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 58:
-              switch (zzInput) {
-                case 24: zzState = 60; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 59:
-              switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: zzIsFinal = true; zzState = 59; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 60:
-              switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: zzState = 60; break zzForNext;
-                case 7: zzIsFinal = true; zzState = 61; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 61:
-              switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: zzIsFinal = true; zzState = 61; 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 10: 
-          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;}
-          }
-        case 19: break;
-        case 15: 
-          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}
-          }
-        case 20: break;
-        case 4: 
-          { yybegin(SQ_STRING); string.setLength(0);
-          }
-        case 21: break;
-        case 5: 
-          { string.append( yytext() );
-          }
-        case 22: break;
-        case 1: 
-          { if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}
-          }
-        case 23: break;
-        case 11: 
-          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;}
-          }
-        case 24: break;
-        case 6: 
-          { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
-          }
-        case 25: break;
-        case 8: 
-          { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;
-          }
-        case 26: break;
-        case 9: 
-          { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;
-          }
-        case 27: break;
-        case 7: 
-          { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;
-          }
-        case 28: break;
-        case 13: 
-          { yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
-          }
-        case 29: break;
-        case 16: 
-          { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}
-          }
-        case 30: break;
-        case 2: 
-          { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);
-          }
-        case 31: break;
-        case 18: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;
-          }
-        case 32: break;
-        case 17: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;
-          }
-        case 33: break;
-        case 14: 
-          { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
-          }
-        case 34: break;
-        case 3: 
-          { yybegin(DQ_STRING); string.setLength(0);
-          }
-        case 35: break;
-        case 12: 
-          { yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd;
-          }
-        case 36: 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 3ebd28b..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, 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 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 3a49524..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLResourceEncodingDetector.java
+++ /dev/null
@@ -1,144 +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;
-
-import java.io.IOException;
-
-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) {
-			canHandleAsUnicodeStream = true;
-			String enc = "UTF-16BE"; //$NON-NLS-1$
-			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
-		}
-		else if (tokenType == EncodingParserConstants.UTF16LE) {
-			canHandleAsUnicodeStream = true;
-			String enc = "UTF-16"; //$NON-NLS-1$
-			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
-		}
-		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 ab29bca..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java
+++ /dev/null
@@ -1,746 +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.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.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.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;
-
-
-/**
- * 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);
-		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();
-		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() {
-		return true;
-	}
-
-	/**
-	 * 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 (!ignoreCase())
-			return this.name.equals(name);
-		return this.name.equalsIgnoreCase(name);
-	}
-
-	/**
-	 * 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 13e3136..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java
+++ /dev/null
@@ -1,140 +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.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;
-
-
-/**
- * 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);
-		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 b10f6dd..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, 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.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 0b8e234..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, 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.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 988bb57..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java
+++ /dev/null
@@ -1,197 +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.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;
-
-
-/**
- * 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);
-		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 3501ed2..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, 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.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 06058a5..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentFragmentImpl.java
+++ /dev/null
@@ -1,74 +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.DocumentFragment;
-import org.w3c.dom.Node;
-
-
-/**
- * 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);
-		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 af96f24..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java
+++ /dev/null
@@ -1,1149 +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;
-
-
-
-// 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.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.ranges.Range;
-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 {
-
-	/**
-	 * 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?
-	 * 
-	 * @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 {
-		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)) {
-			return element;
-		}
-		else {
-			throw new DOMException(DOMException.INVALID_CHARACTER_ERR, new String());
-		}
-	}
-
-	/**
-	 * 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;
-	}
-
-	/**
-	 */
-	public TreeWalker createTreeWalker(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) {
-		// not suppoerted
-		return null;
-	}
-
-	private DocumentType findDoctype(Node node) {
-		for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
-			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) {
-		for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
-			if (child.getNodeType() != ELEMENT_NODE)
-				continue;
-			ElementImpl element = (ElementImpl) child;
-			if (element.isCommentTag()) {
-				Element docElement = findDocumentElement(docName, element, firstFound);
-				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);
-		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();
-	}
-
-	/**
-	 */
-//	protected DocumentTypeAdapter getDocumentTypeAdapter() {
-//		// be sure to release since possibly changing
-//		if (this.documentTypeAdapter != null) {
-//			this.documentTypeAdapter.release();
-//		}
-//		this.documentTypeAdapter = (DocumentTypeAdapter) getAdapterFor(DocumentTypeAdapter.class);
-//		if (this.documentTypeAdapter == null) {
-//			// add default adapter
-//			this.documentTypeAdapter = new DocumentTypeAdapterImpl(this);
-//			addAdapter(this.documentTypeAdapter);
-//		}
-//		return this.documentTypeAdapter;
-//	}
-
-	/**
-	 */
-	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;
-		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 1e5ff4c..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, 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.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 4f6d8b3..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, 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.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 c92f25f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeImpl.java
+++ /dev/null
@@ -1,222 +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.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;
-
-
-/**
- * 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);
-		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 27a62c5..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java
+++ /dev/null
@@ -1,1458 +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.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.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);
-		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;
-	}
-
-	/**
-	 */
-	public void setAttributeNS(String uri, String name, String value) throws DOMException {
-		if (name == null)
-			return;
-
-		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
-		}
-
-		Attr attr = getAttributeNodeNS(uri, name);
-		if (attr != null) {
-			attr.setValue(value); // change value
-			return;
-		}
-
-		// new attribute
-		Document doc = getOwnerDocument();
-		if (doc == null)
-			return;
-		attr = doc.createAttributeNS(uri, name);
-		if (attr == null)
-			return;
-		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 47558fb..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java
+++ /dev/null
@@ -1,241 +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.Entity;
-import org.w3c.dom.Node;
-
-/**
- * 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);
-		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 366ecc0..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityReferenceImpl.java
+++ /dev/null
@@ -1,89 +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.EntityReference;
-import org.w3c.dom.Node;
-
-/**
- * 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);
-		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 a8166ed..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, 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;
-
-
-
-/**
- * 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 01c7bbb..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, 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;
-
-
-
-/**
- * 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 e36d4a1..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, 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.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 64296b7..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, 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.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 698b534..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeImpl.java
+++ /dev/null
@@ -1,925 +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.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 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;
-
-	/**
-	 * 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 Object getUserData(String key) {
-		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 Object setUserData(String key, Object data, UserDataHandler handler) {
-		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$
-	};
-
-
-}
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 e048949..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NotationImpl.java
+++ /dev/null
@@ -1,138 +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.Notation;
-
-/**
- * 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);
-		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 2e6f804..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ProcessingInstructionImpl.java
+++ /dev/null
@@ -1,227 +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.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;
-
-
-/**
- * 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);
-		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 24abe9e..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, 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.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 d453a10..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ReadOnlyController.java
+++ /dev/null
@@ -1,334 +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.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.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;
-		}
-		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;
-		}
-		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 d739a36..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, 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.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 5252318..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, 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.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 8c0222c..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, 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.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 54469b1..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, 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;
-
-
-
-
-/**
- */
-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 37e39ff..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, 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.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 036800f..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, 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.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 55d8f98..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, 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.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 255604c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TextImpl.java
+++ /dev/null
@@ -1,1176 +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.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;
-
-
-/**
- * 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);
-		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 b5708a6..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, 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.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 bc6779b..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, 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.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 cd59f14..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifierImpl.java
+++ /dev/null
@@ -1,465 +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.Iterator;
-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;
-
-		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();
-		for (int i = 0; i < count; i++) {
-			NotifyEvent event = (NotifyEvent) this.events.elementAt(i);
-			if (event == null)
-				continue; // error
-			if (event.discarded)
-				continue;
-			if (!doingNewModel && fOptimizeDeferred) {
-				// check redundant events (no need to check if doing NewModel,
-				// since
-				// shouldn't be redunancies)
-				if (event.type == INodeNotifier.ADD) {
-					for (int n = i + 1; n < count; n++) {
-						NotifyEvent next = (NotifyEvent) this.events.elementAt(n);
-						if (next == null)
-							continue; // error
-						if (next.type == INodeNotifier.REMOVE && next.oldValue == event.newValue) {
-							// Added then removed later, discard both
-							event.discarded = true;
-							next.discarded = true;
-							if (Debug.debugNotifyDeferred) {
-								event.reason = event.reason + ADDED_THEN_REMOVED + "(see " + n + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-								next.reason = next.reason + ADDED_THEN_REMOVED + "(see " + i + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-							}
-							break;
-						}
-					}
-					if (event.discarded)
-						continue;
-					if (fOptimizeDeferredAccordingToParentAdded) {
-						for (int p = 0; p < i; p++) {
-							NotifyEvent prev = (NotifyEvent) this.events.elementAt(p);
-							if (prev == null)
-								continue; // error
-							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 " + p + ")"; //$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 " + p + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-								}
-								break;
-							}
-						}
-						if (event.discarded)
-							continue;
-					}
-				} else if (event.type == INodeNotifier.REMOVE) {
-					if (fOptimizeDeferredAccordingToParentRemoved) {
-						for (int n = i + 1; n < count; n++) {
-							NotifyEvent next = (NotifyEvent) this.events.elementAt(n);
-							if (next == null)
-								continue; // error
-							if (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 " + n + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-									}
-									break;
-								}
-							}
-						}
-						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;
-	}
-
-	/**
-	 */
-	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 51032e1..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, 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.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 1cbbc25..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, 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.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 cf328de..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, 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.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 2c80b01..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentLoader.java
+++ /dev/null
@@ -1,78 +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.encoding;
-
-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() {
-		return ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(ContentTypeIdForXML.ContentTypeID_XML);
-	}
-
-	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/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 d4216e7..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/EmbeddedXML.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.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("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 d777a2a..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, 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.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 9729bb9..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, 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.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 12e3609..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, 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.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 25b5c08..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForXML.java
+++ /dev/null
@@ -1,217 +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.modelquery;
-
-
-
-import java.io.File;
-
-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.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.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());
-				String baseLocation = null;
-				String modelBaseLocation = model.getBaseLocation();
-				if (modelBaseLocation != null) {
-					File file = new Path(modelBaseLocation).toFile();
-					if (file.exists()) {
-						baseLocation = file.getAbsolutePath();
-					}
-					else {
-						IPath basePath = new Path(modelBaseLocation);
-						IPath derivedPath = null;
-						if (basePath.segmentCount() > 1)
-							derivedPath = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath).getLocation();
-						else
-							derivedPath = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(basePath);
-						if (derivedPath != null) {
-							baseLocation = derivedPath.toString();
-						}
-					}
-				}
-				if (org.eclipse.wst.sse.core.internal.util.Debug.displayInfo)
-					System.out.println("----------------ModelQueryAdapterFactoryForXML... baseLocation : " + baseLocation); //$NON-NLS-1$
-
-				CMDocumentCache cmDocumentCache = new CMDocumentCache();
-				ModelQuery modelQuery = null;
-				URIResolver idResolver = null;
-
-				if (org.eclipse.wst.sse.core.internal.util.Debug.displayInfo)
-					System.out.println("********XMLModelQueryImpl"); //$NON-NLS-1$
-				org.eclipse.wst.sse.core.internal.util.URIResolver resolver = model.getResolver();
-				if (baseLocation != null || resolver != null) {
-					idResolver = new XMLCatalogIdResolver(baseLocation, resolver);
-				}
-				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) {
-			baseLocation = baseFile.getLocation().toString();
-		}
-		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 fd7572f..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, 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.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 367d43b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java
+++ /dev/null
@@ -1,92 +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.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.Assert;
-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.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
-			Assert.isNotNull(base, "Base location is expected to be non 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");
-		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 fd3087f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryAssociationProvider.java
+++ /dev/null
@@ -1,55 +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.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
- */
-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 2992a79..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, 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.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 280206c..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, 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;
-
-
-
-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 2cdc7e7..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, 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;
-
-
-
-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 5f08934..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, 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;
-
-
-
-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 955df30..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XML10Names.java
+++ /dev/null
@@ -1,592 +0,0 @@
-/* The following code was generated by JFlex 1.4 on 7/5/05 1:40 AM */
-
-/*******************************************************************************
- * 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;
-
-
-
-
-/**
- * This class is a scanner generated by 
- * <a href="http://www.jflex.de/">JFlex</a> 1.4
- * on 7/5/05 1:40 AM from the specification file
- * <tt>D:/builds/Workspaces/PureHeadWTP_M7/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/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 = 
-    "\11\0\1\1\1\2\2\0\1\1\22\0\1\1\14\0\1\0\2\0"+
-    "\12\0\1\3\6\0\32\3\4\0\1\3\1\0\32\3\74\0\1\0"+
-    "\10\0\27\3\1\0\37\3\1\0\72\3\2\0\13\3\2\0\10\3"+
-    "\1\0\65\3\1\0\104\3\11\0\44\3\3\0\2\3\4\0\36\3"+
-    "\70\0\131\3\22\0\7\3\16\0\2\0\56\0\106\0\32\0\2\0"+
-    "\44\0\1\3\1\0\3\3\1\0\1\3\1\0\24\3\1\0\54\3"+
-    "\1\0\7\3\3\0\1\3\1\0\1\3\1\0\1\3\1\0\1\3"+
-    "\1\0\22\3\15\0\14\3\1\0\102\3\1\0\14\3\1\0\44\3"+
-    "\1\0\4\0\11\0\65\3\2\0\2\3\2\0\2\3\3\0\34\3"+
-    "\2\0\10\3\2\0\2\3\67\0\46\3\2\0\1\3\7\0\46\3"+
-    "\12\0\21\0\1\0\27\0\1\0\3\0\1\0\1\0\1\0\2\0"+
-    "\1\0\1\0\13\0\33\3\5\0\3\3\56\0\32\3\5\0\1\0"+
-    "\12\3\10\0\15\0\12\0\6\0\1\0\107\3\2\0\5\3\1\0"+
-    "\17\3\1\0\4\3\1\0\1\3\17\0\2\3\2\0\1\0\4\0"+
-    "\2\0\12\0\u0207\0\3\0\1\0\65\3\2\0\1\0\1\3\20\0"+
-    "\3\0\4\0\3\0\12\3\2\0\2\0\12\0\21\0\3\0\1\0"+
-    "\10\3\2\0\2\3\2\0\26\3\1\0\7\3\1\0\1\3\3\0"+
-    "\4\3\2\0\1\0\1\0\7\0\2\0\2\0\2\0\3\0\11\0"+
-    "\1\0\4\0\2\3\1\0\3\3\2\0\2\0\12\0\2\3\20\0"+
-    "\1\0\2\0\6\3\4\0\2\3\2\0\26\3\1\0\7\3\1\0"+
-    "\2\3\1\0\2\3\1\0\2\3\2\0\1\0\1\0\5\0\4\0"+
-    "\2\0\2\0\3\0\13\0\4\3\1\0\1\3\7\0\12\0\2\0"+
-    "\3\3\14\0\3\0\1\0\7\3\1\0\1\3\1\0\3\3\1\0"+
-    "\26\3\1\0\7\3\1\0\2\3\1\0\5\3\2\0\1\0\1\3"+
-    "\10\0\1\0\3\0\1\0\3\0\22\0\1\3\5\0\12\0\21\0"+
-    "\3\0\1\0\10\3\2\0\2\3\2\0\26\3\1\0\7\3\1\0"+
-    "\2\3\2\0\4\3\2\0\1\0\1\3\6\0\3\0\2\0\2\0"+
-    "\3\0\10\0\2\0\4\0\2\3\1\0\3\3\4\0\12\0\22\0"+
-    "\2\0\1\0\6\3\3\0\3\3\1\0\4\3\3\0\2\3\1\0"+
-    "\1\3\1\0\2\3\3\0\2\3\3\0\3\3\3\0\10\3\1\0"+
-    "\3\3\4\0\5\0\3\0\3\0\1\0\4\0\11\0\1\0\17\0"+
-    "\11\0\21\0\3\0\1\0\10\3\1\0\3\3\1\0\27\3\1\0"+
-    "\12\3\1\0\5\3\4\0\7\0\1\0\3\0\1\0\4\0\7\0"+
-    "\2\0\11\0\2\3\4\0\12\0\22\0\2\0\1\0\10\3\1\0"+
-    "\3\3\1\0\27\3\1\0\12\3\1\0\5\3\4\0\7\0\1\0"+
-    "\3\0\1\0\4\0\7\0\2\0\7\0\1\3\1\0\2\3\4\0"+
-    "\12\0\22\0\2\0\1\0\10\3\1\0\3\3\1\0\27\3\1\0"+
-    "\20\3\4\0\6\0\2\0\3\0\1\0\4\0\11\0\1\0\10\0"+
-    "\2\3\4\0\12\0\221\0\56\3\1\0\1\3\1\0\2\3\7\0"+
-    "\5\0\6\3\1\0\10\0\1\0\12\0\47\0\2\3\1\0\1\3"+
-    "\2\0\2\3\1\0\1\3\2\0\1\3\6\0\4\3\1\0\7\3"+
-    "\1\0\3\3\1\0\1\3\1\0\1\3\2\0\2\3\1\0\2\3"+
-    "\1\0\1\3\1\0\2\3\6\0\1\0\2\0\1\3\2\0\5\3"+
-    "\1\0\1\0\1\0\6\0\2\0\12\0\76\0\2\0\6\0\12\0"+
-    "\13\0\1\0\1\0\1\0\1\0\1\0\4\0\2\0\10\3\1\0"+
-    "\41\3\7\0\24\0\1\0\6\0\4\0\6\0\1\0\1\0\1\0"+
-    "\25\0\3\0\7\0\1\0\1\0\346\0\46\3\12\0\47\3\11\0"+
-    "\1\3\1\0\2\3\1\0\3\3\1\0\1\3\1\0\2\3\1\0"+
-    "\5\3\51\0\1\3\1\0\1\3\1\0\1\3\13\0\1\3\1\0"+
-    "\1\3\1\0\1\3\3\0\2\3\3\0\1\3\5\0\3\3\1\0"+
-    "\1\3\1\0\1\3\1\0\1\3\1\0\1\3\3\0\2\3\3\0"+
-    "\2\3\1\0\1\3\50\0\1\3\11\0\1\3\2\0\1\3\2\0"+
-    "\2\3\7\0\2\3\1\0\1\3\1\0\7\3\50\0\1\3\4\0"+
-    "\1\3\10\0\1\3\u0c06\0\234\3\4\0\132\3\6\0\26\3\2\0"+
-    "\6\3\2\0\46\3\2\0\6\3\2\0\10\3\1\0\1\3\1\0"+
-    "\1\3\1\0\1\3\1\0\37\3\2\0\65\3\1\0\7\3\1\0"+
-    "\1\3\3\0\3\3\1\0\7\3\3\0\4\3\2\0\6\3\4\0"+
-    "\15\3\5\0\3\3\1\0\7\3\323\0\15\0\4\0\1\0\104\0"+
-    "\1\3\3\0\2\3\2\0\1\3\121\0\3\3\u0e82\0\1\0\1\0"+
-    "\1\3\31\0\11\3\6\0\1\0\5\0\13\0\124\3\4\0\2\0"+
-    "\2\0\2\0\2\0\132\3\1\0\3\0\6\0\50\3\u1cd3\0\u51a6\3"+
-    "\u0c5a\0\u2ba4\3\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\4\1";
-
-  private static int [] zzUnpackAction() {
-    int [] result = new int[7];
-    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\0\20\0\24\0\30";
-
-  private static int [] zzUnpackRowMap() {
-    int [] result = new int[7];
-    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, 1, -1, 2, -1, -1, -1, -1, 2, 3, 
-    4, 2, 2, 3, 4, 5, -1, 4, 4, 6, 
-    5, 5, 4, 5, 6, 6, -1, 6, 
-  };
-
-  /* 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\5\1";
-
-  private static int [] zzUnpackAttribute() {
-    int [] result = new int[7];
-    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: */
-
-	/**
-	 * 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 < 1226) {
-      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;
-          }
-        case 3: break;
-        case 2: 
-          { return true;
-          }
-        case 4: break;
-        default: 
-          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
-            zzAtEOF = true;
-              { {return false;} }
-          } 
-          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 69fc6d5..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java
+++ /dev/null
@@ -1,621 +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;
-
-
-
-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,
-		// we can't afford to interrupt the flow of control. or backwards
-		// typing can result!
-		// 
-		// 
-		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, e.getMessage());
-		}
-	}
-
-	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;
-	}
-
-	/**
-	 * 
-	 * @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 b186ef8..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, 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;
-
-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 304c81d..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, 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;
-
-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 795fbab..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java
+++ /dev/null
@@ -1,1881 +0,0 @@
-/* The following code was generated by JFlex 1.2.2 on 1/27/05 4:48 PM */
-
-/*******************************************************************************
- * 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;
-
-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.internal.util.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 1/27/05 4:48 PM 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\51"+
-    "\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\54\1\1\1\43\1\2\1\4\1\16"+
-    "\1\32\1\55\1\30\1\31\1\35\1\52\1\34\1\34\1\40\1\34"+
-    "\1\34\1\26\1\25\1\42\1\41\1\45\1\34\1\36\1\37\1\33"+
-    "\1\53\2\34\1\23\1\44\1\34\1\27\1\0\1\20\1\0\1\10"+
-    "\1\0\1\47\1\55\1\56\1\50\1\35\1\52\1\34\1\34\1\40"+
-    "\2\34\1\26\1\25\1\42\1\41\1\45\1\34\1\36\1\37\1\46"+
-    "\1\53\1\34\1\34\1\24\1\44\1\34\1\0\1\0\72\0\1\60"+
-    "\10\0\27\57\1\0\37\57\1\0\72\57\2\0\13\57\2\0\10\57"+
-    "\1\0\65\57\1\0\104\57\11\0\44\57\3\0\2\57\4\0\36\57"+
-    "\70\0\131\57\22\0\7\57\16\0\2\60\56\0\106\60\32\0\2\60"+
-    "\44\0\1\57\1\60\3\57\1\0\1\57\1\0\24\57\1\0\54\57"+
-    "\1\0\7\57\3\0\1\57\1\0\1\57\1\0\1\57\1\0\1\57"+
-    "\1\0\22\57\15\0\14\57\1\0\102\57\1\0\14\57\1\0\44\57"+
-    "\1\0\4\60\11\0\65\57\2\0\2\57\2\0\2\57\3\0\34\57"+
-    "\2\0\10\57\2\0\2\57\67\0\46\57\2\0\1\57\7\0\46\57"+
-    "\12\0\21\60\1\0\27\60\1\0\3\60\1\0\1\60\1\0\2\60"+
-    "\1\0\1\60\13\0\33\57\5\0\3\57\56\0\32\57\5\0\1\60"+
-    "\12\57\10\60\15\0\12\60\6\0\1\60\107\57\2\0\5\57\1\0"+
-    "\17\57\1\0\4\57\1\0\1\57\17\60\2\57\2\60\1\0\4\60"+
-    "\2\0\12\60\u0207\0\3\60\1\0\65\57\2\0\1\60\1\57\20\60"+
-    "\3\0\4\60\3\0\12\57\2\60\2\0\12\60\21\0\3\60\1\0"+
-    "\10\57\2\0\2\57\2\0\26\57\1\0\7\57\1\0\1\57\3\0"+
-    "\4\57\2\0\1\60\1\0\7\60\2\0\2\60\2\0\3\60\11\0"+
-    "\1\60\4\0\2\57\1\0\3\57\2\60\2\0\12\60\2\57\20\0"+
-    "\1\60\2\0\6\57\4\0\2\57\2\0\26\57\1\0\7\57\1\0"+
-    "\2\57\1\0\2\57\1\0\2\57\2\0\1\60\1\0\5\60\4\0"+
-    "\2\60\2\0\3\60\13\0\4\57\1\0\1\57\7\0\12\60\2\60"+
-    "\3\57\14\0\3\60\1\0\7\57\1\0\1\57\1\0\3\57\1\0"+
-    "\26\57\1\0\7\57\1\0\2\57\1\0\5\57\2\0\1\60\1\57"+
-    "\10\60\1\0\3\60\1\0\3\60\22\0\1\57\5\0\12\60\21\0"+
-    "\3\60\1\0\10\57\2\0\2\57\2\0\26\57\1\0\7\57\1\0"+
-    "\2\57\2\0\4\57\2\0\1\60\1\57\6\60\3\0\2\60\2\0"+
-    "\3\60\10\0\2\60\4\0\2\57\1\0\3\57\4\0\12\60\22\0"+
-    "\2\60\1\0\6\57\3\0\3\57\1\0\4\57\3\0\2\57\1\0"+
-    "\1\57\1\0\2\57\3\0\2\57\3\0\3\57\3\0\10\57\1\0"+
-    "\3\57\4\0\5\60\3\0\3\60\1\0\4\60\11\0\1\60\17\0"+
-    "\11\60\21\0\3\60\1\0\10\57\1\0\3\57\1\0\27\57\1\0"+
-    "\12\57\1\0\5\57\4\0\7\60\1\0\3\60\1\0\4\60\7\0"+
-    "\2\60\11\0\2\57\4\0\12\60\22\0\2\60\1\0\10\57\1\0"+
-    "\3\57\1\0\27\57\1\0\12\57\1\0\5\57\4\0\7\60\1\0"+
-    "\3\60\1\0\4\60\7\0\2\60\7\0\1\57\1\0\2\57\4\0"+
-    "\12\60\22\0\2\60\1\0\10\57\1\0\3\57\1\0\27\57\1\0"+
-    "\20\57\4\0\6\60\2\0\3\60\1\0\4\60\11\0\1\60\10\0"+
-    "\2\57\4\0\12\60\221\0\56\57\1\0\1\57\1\60\2\57\7\60"+
-    "\5\0\6\57\1\60\10\60\1\0\12\60\47\0\2\57\1\0\1\57"+
-    "\2\0\2\57\1\0\1\57\2\0\1\57\6\0\4\57\1\0\7\57"+
-    "\1\0\3\57\1\0\1\57\1\0\1\57\2\0\2\57\1\0\2\57"+
-    "\1\0\1\57\1\60\2\57\6\60\1\0\2\60\1\57\2\0\5\57"+
-    "\1\0\1\60\1\0\6\60\2\0\12\60\76\0\2\60\6\0\12\60"+
-    "\13\0\1\60\1\0\1\60\1\0\1\60\4\0\2\60\10\57\1\0"+
-    "\41\57\7\0\24\60\1\0\6\60\4\0\6\60\1\0\1\60\1\0"+
-    "\25\60\3\0\7\60\1\0\1\60\346\0\46\57\12\0\47\57\11\0"+
-    "\1\57\1\0\2\57\1\0\3\57\1\0\1\57\1\0\2\57\1\0"+
-    "\5\57\51\0\1\57\1\0\1\57\1\0\1\57\13\0\1\57\1\0"+
-    "\1\57\1\0\1\57\3\0\2\57\3\0\1\57\5\0\3\57\1\0"+
-    "\1\57\1\0\1\57\1\0\1\57\1\0\1\57\3\0\2\57\3\0"+
-    "\2\57\1\0\1\57\50\0\1\57\11\0\1\57\2\0\1\57\2\0"+
-    "\2\57\7\0\2\57\1\0\1\57\1\0\7\57\50\0\1\57\4\0"+
-    "\1\57\10\0\1\57\u0c06\0\234\57\4\0\132\57\6\0\26\57\2\0"+
-    "\6\57\2\0\46\57\2\0\6\57\2\0\10\57\1\0\1\57\1\0"+
-    "\1\57\1\0\1\57\1\0\37\57\2\0\65\57\1\0\7\57\1\0"+
-    "\1\57\3\0\3\57\1\0\7\57\3\0\4\57\2\0\6\57\4\0"+
-    "\15\57\5\0\3\57\1\0\7\57\323\0\15\60\4\0\1\60\104\0"+
-    "\1\57\3\0\2\57\2\0\1\57\121\0\3\57\u0e82\0\1\60\1\0"+
-    "\1\57\31\0\11\57\6\60\1\0\5\60\13\0\124\57\4\0\2\60"+
-    "\2\0\2\60\2\0\132\57\1\0\3\60\6\0\50\57\u1cd3\0\u51a6\57"+
-    "\u0c5a\0\u2ba4\57\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,    49,    98,   147,   196,   245,   294,   343,   392,   441, 
-      490,   539,   588,   637,   686,   735,   784,   833,   882,   931, 
-      980,  1029,  1078,  1127,  1176,  1225,  1274,  1323,  1372,  1421, 
-     1470,  1519,  1568,  1617,  1666,  1715,  1764,  1715,  1764,  1813, 
-     1715,  1715,  1764,  1862,  1911,  1960,  2009,  2058,  2107,  2156, 
-     1715,  1764,  2205,  2254,  2303,  1715,  2352,  2352,  2401,  2450, 
-     2499,  2205,  1715,  2548,  2597,  1715,  2646,  2695,  2744,  2793, 
-     2842,  2891,  1715,  2940,  2989,  3038,  3087,  1715,  3136,  3185, 
-     3234,  3283,  3332,  1715,  3381,  3430,  3479,  3528,  3577,  3626, 
-     3675,  3724,  3724,  3773,  3822,  3871,  3920,  3920,  3969,  4018, 
-     4067,  4116,  4116,  4165,  4214,  4263,  4312,  1715,  4361,  4361, 
-     4410,  4459,  4508,  4557,  1715,  1715,  1764,  1715,  1715,  4606, 
-     4655,  4704,  4753,  4802,  4851,  4900,  4949,  1715,  4998,  5047, 
-     1715,  1715,  2352,  5096,  2450,  1715,  5145,  2499,  2548,  2646, 
-     2695,  5194,  2744,  1715,  5243,  2793,  1715,  3136,  5292,  3234, 
-     1715,  5341,  3283,  4606,  5390,  5439,  5488,  3528,  1715,  5537, 
-     5586,  3724,  5635,  3773,  1715,  5684,  5733,  5782,  5782,  5831, 
-     5880,  3871,  3724,  3920,  5929,  3969,  1715,  5978,  4018,  4067, 
-     3920,  4116,  6027,  4165,  1715,  6076,  6125,  6174,  6174,  6223, 
-     6272,  6321,  4361,  6370,  4410,  1715,  6419,  6468,  6517,  6517, 
-     6566,  6615,  6664,  6713,  6762,  6811,  6860,  1715,  6909,  6958, 
-     1715,  1715,  1715,  2009,  7007,  7056,  7105,  7154,  7203,  7252, 
-     5684,  7301,  7301,  6076,  7350,  7350,  7399,  6419,  7448,  7448, 
-     7497,  1715,  7546,  7595,  1715,  7644,  7693,  7742,  7791,  7840, 
-     7889,  7938,  5831,  6223,  7987,  6566,  8036,  8085,  8134,  8183, 
-     8232,  8281,  8330,  8379,  8428,  8477,  8526,  8575,  8624,  8673, 
-     8722,  1715,  1715,  8771,  8820,  8869,  8918,  1715,  1715,  1715, 
-     8967,  9016,  9065,  9114,  9163,  1715,  4263,  4508
-  };
-
-  /** 
-   * 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\41\40\1\44"+
-    "\1\45\57\44\1\46\1\47\16\46\1\50\1\46\1\51"+
-    "\36\46\1\52\1\53\57\52\1\46\1\47\5\46\1\54"+
-    "\12\46\1\51\37\46\1\47\2\46\1\55\1\56\2\46"+
-    "\1\57\3\46\1\56\5\46\1\56\2\60\2\57\1\46"+
-    "\10\57\1\61\2\57\1\46\5\57\1\46\2\57\1\46"+
-    "\3\57\2\46\1\47\2\46\1\55\1\62\6\46\1\62"+
-    "\5\46\1\62\36\46\1\63\1\64\2\63\1\65\15\63"+
-    "\1\51\36\63\1\46\1\47\2\46\1\66\1\56\2\46"+
-    "\1\67\3\46\1\56\5\46\1\56\4\67\1\46\13\67"+
-    "\1\46\5\67\1\46\2\67\1\46\3\67\2\46\1\47"+
-    "\2\46\1\66\1\56\2\46\1\67\3\46\1\56\5\46"+
-    "\1\56\4\67\1\46\13\67\1\70\5\67\1\46\2\67"+
-    "\1\46\3\67\1\46\1\71\1\47\1\46\1\72\1\73"+
-    "\1\56\3\71\1\74\1\71\1\75\1\56\5\71\1\56"+
-    "\36\71\1\46\1\47\2\46\1\76\15\46\1\51\37\46"+
-    "\1\47\1\77\1\100\1\46\1\56\2\46\1\101\3\46"+
-    "\1\56\5\46\1\56\4\101\1\46\13\101\1\46\5\101"+
-    "\1\46\2\101\1\46\3\101\2\46\1\47\1\77\1\100"+
-    "\1\46\1\56\2\46\1\101\3\46\1\56\5\46\1\56"+
-    "\4\101\1\46\13\101\1\102\5\101\1\46\2\101\1\46"+
-    "\3\101\1\46\1\103\1\47\1\77\1\104\1\103\1\56"+
-    "\3\103\1\105\1\103\1\106\1\56\5\103\1\56\36\103"+
-    "\1\46\1\47\3\46\1\56\6\46\1\56\5\46\1\56"+
-    "\36\46\1\107\1\110\1\111\1\112\4\107\1\113\12\107"+
-    "\4\114\1\107\13\114\1\107\5\114\1\107\2\114\1\107"+
-    "\3\114\1\107\1\46\1\110\1\111\1\112\1\46\1\56"+
-    "\2\46\1\115\3\46\1\56\5\46\1\56\4\115\1\46"+
-    "\13\115\1\46\5\115\1\46\2\115\1\46\3\115\2\46"+
-    "\1\110\1\111\1\112\1\46\1\56\2\46\1\115\3\46"+
-    "\1\56\5\46\1\56\4\115\1\46\13\115\1\116\5\115"+
-    "\1\46\2\115\1\46\3\115\1\46\1\117\1\110\1\111"+
-    "\1\120\1\117\1\56\3\117\1\121\1\117\1\122\1\56"+
-    "\5\117\1\56\36\117\1\46\1\123\1\124\2\46\1\56"+
-    "\6\46\1\56\5\46\1\56\6\46\1\125\1\126\2\46"+
-    "\1\127\11\46\1\126\1\125\11\46\1\47\1\124\2\46"+
-    "\1\56\6\46\1\56\5\46\1\56\4\46\1\130\32\46"+
-    "\1\47\1\124\2\46\1\56\2\46\1\131\3\46\1\56"+
-    "\5\46\1\56\4\131\1\130\13\131\1\46\5\131\1\46"+
-    "\2\131\1\46\3\131\2\46\1\47\1\124\2\46\1\56"+
-    "\6\46\1\56\5\46\1\56\4\46\1\130\7\46\1\132"+
-    "\5\46\1\133\13\46\1\134\1\47\1\124\1\135\1\134"+
-    "\1\56\3\134\1\136\1\134\1\137\1\56\5\134\1\56"+
-    "\4\134\1\140\31\134\1\141\1\47\1\124\1\142\1\141"+
-    "\1\56\3\141\1\143\1\141\1\144\1\56\5\141\1\56"+
-    "\4\141\1\145\31\141\1\146\1\47\1\124\1\147\1\146"+
-    "\1\56\3\146\1\150\1\146\1\151\1\56\5\146\1\56"+
-    "\36\146\1\152\1\153\1\154\56\152\1\155\1\47\1\124"+
-    "\1\156\1\155\1\56\3\155\1\157\1\155\1\160\1\56"+
-    "\5\155\1\56\36\155\1\161\1\162\1\163\56\161\1\164"+
-    "\1\165\57\164\1\40\1\0\10\40\1\0\4\40\1\0"+
-    "\41\40\3\0\1\166\1\167\14\0\1\170\44\0\1\171"+
-    "\2\0\1\172\3\0\1\171\5\0\1\171\4\172\1\0"+
-    "\13\172\1\0\5\172\1\173\2\172\1\0\3\172\6\0"+
-    "\1\171\2\0\1\174\3\0\1\171\5\0\1\171\4\174"+
-    "\1\0\13\174\1\0\5\174\1\0\2\174\1\0\3\174"+
-    "\103\0\1\175\57\0\1\176\47\0\1\177\53\0\1\200"+
-    "\63\0\1\56\6\0\1\56\5\0\1\56\44\0\3\57"+
-    "\4\0\1\57\5\0\4\57\1\0\13\57\1\0\5\57"+
-    "\1\0\2\57\1\0\4\57\6\0\3\57\4\0\1\57"+
-    "\5\0\2\57\1\201\1\57\1\0\13\57\1\0\5\57"+
-    "\1\0\2\57\1\0\4\57\6\0\3\57\4\0\1\57"+
-    "\5\0\2\57\1\202\1\57\1\0\13\57\1\0\5\57"+
-    "\1\0\2\57\1\0\4\57\5\0\1\62\6\0\1\62"+
-    "\5\0\1\62\40\0\1\203\60\0\1\204\64\0\3\67"+
-    "\4\0\1\67\5\0\4\67\1\0\13\67\1\0\5\67"+
-    "\1\0\2\67\1\0\4\67\1\71\2\0\1\205\1\71"+
-    "\1\0\3\71\1\0\1\71\2\0\5\71\1\0\37\71"+
-    "\1\0\1\204\1\205\1\71\1\0\3\71\1\0\1\71"+
-    "\2\0\5\71\1\0\36\71\1\74\1\0\1\206\1\207"+
-    "\1\74\1\206\3\74\1\210\1\74\2\206\5\74\1\206"+
-    "\36\74\1\75\1\0\1\211\1\212\1\75\1\211\3\75"+
-    "\1\211\1\75\1\210\1\211\5\75\1\211\36\75\2\0"+
-    "\1\77\1\213\63\0\3\101\4\0\1\101\5\0\4\101"+
-    "\1\0\13\101\1\0\5\101\1\0\2\101\1\0\4\101"+
-    "\1\103\2\0\1\214\1\103\1\0\3\103\1\0\1\103"+
-    "\2\0\5\103\1\0\37\103\1\0\1\77\1\215\1\103"+
-    "\1\0\3\103\1\0\1\103\2\0\5\103\1\0\36\103"+
-    "\1\105\1\0\1\216\1\217\1\105\1\216\3\105\1\220"+
-    "\1\105\2\216\5\105\1\216\36\105\1\106\1\0\1\221"+
-    "\1\222\1\106\1\221\3\106\1\221\1\106\1\220\1\221"+
-    "\5\106\1\221\36\106\1\107\3\0\17\107\4\0\1\107"+
-    "\13\0\1\107\5\0\1\107\2\0\1\107\3\0\1\107"+
-    "\3\0\1\166\15\0\1\170\41\0\1\223\56\0\1\107"+
-    "\3\0\2\107\3\113\4\107\1\113\5\107\4\114\1\107"+
-    "\13\114\1\107\5\114\1\107\2\114\1\107\3\114\1\113"+
-    "\6\0\3\114\4\0\1\114\5\0\4\114\1\0\13\114"+
-    "\1\0\5\114\1\0\2\114\1\0\4\114\6\0\3\115"+
-    "\4\0\1\115\5\0\4\115\1\0\13\115\1\0\5\115"+
-    "\1\0\2\115\1\0\4\115\1\117\2\0\1\224\1\117"+
-    "\1\0\3\117\1\0\1\117\2\0\5\117\1\0\37\117"+
-    "\1\0\1\223\1\224\1\117\1\0\3\117\1\0\1\117"+
-    "\2\0\5\117\1\0\36\117\1\121\1\0\1\225\1\226"+
-    "\1\121\1\225\3\121\1\227\1\121\2\225\5\121\1\225"+
-    "\36\121\1\122\1\0\1\230\1\231\1\122\1\230\3\122"+
-    "\1\230\1\122\1\227\1\230\5\122\1\230\36\122\3\0"+
-    "\1\166\15\0\1\232\100\0\1\233\52\0\1\234\12\0"+
-    "\1\234\40\0\1\235\32\0\20\236\1\237\40\236\6\0"+
-    "\3\131\4\0\1\131\5\0\4\131\1\0\13\131\1\0"+
-    "\5\131\1\0\2\131\1\0\4\131\44\0\1\240\67\0"+
-    "\1\241\5\0\1\134\2\0\1\242\1\134\1\0\3\134"+
-    "\1\0\1\134\2\0\5\134\1\0\36\134\1\136\1\0"+
-    "\1\243\1\244\1\136\1\243\3\136\1\245\1\136\2\243"+
-    "\5\136\1\243\36\136\1\246\1\0\1\247\1\250\1\251"+
-    "\1\247\3\251\1\247\1\246\1\252\1\253\3\251\1\246"+
-    "\1\251\1\253\4\251\1\246\27\251\2\246\1\140\2\236"+
-    "\1\254\1\140\1\236\3\140\1\236\1\140\2\236\3\140"+
-    "\1\255\1\140\1\236\36\140\1\141\2\0\1\256\1\141"+
-    "\1\0\3\141\1\0\1\141\2\0\5\141\1\0\36\141"+
-    "\1\143\2\257\1\260\1\143\1\257\3\143\1\261\1\143"+
-    "\2\257\5\143\1\257\36\143\1\144\2\262\1\263\1\144"+
-    "\1\262\3\144\1\262\1\144\1\261\1\262\5\144\1\262"+
-    "\36\144\1\145\2\236\1\264\1\145\1\236\3\145\1\236"+
-    "\1\145\2\236\3\145\1\265\1\145\1\236\36\145\1\146"+
-    "\2\0\1\266\1\146\1\0\3\146\1\0\1\146\2\0"+
-    "\5\146\1\0\36\146\1\150\1\0\1\267\1\270\1\150"+
-    "\1\267\3\150\1\271\1\150\2\267\5\150\1\267\36\150"+
-    "\1\272\1\0\1\273\1\274\1\275\1\273\3\275\1\273"+
-    "\1\272\1\276\1\277\3\275\1\272\1\275\1\277\4\275"+
-    "\1\272\27\275\2\272\2\152\1\0\60\152\1\0\16\152"+
-    "\1\300\37\152\1\155\2\0\1\301\1\155\1\0\3\155"+
-    "\1\0\1\155\2\0\5\155\1\0\36\155\1\157\1\0"+
-    "\1\302\1\303\1\157\1\302\3\157\1\304\1\157\2\302"+
-    "\5\157\1\302\36\157\1\305\1\0\1\306\1\307\1\310"+
-    "\1\306\3\310\1\306\1\305\1\311\1\312\3\310\1\305"+
-    "\1\310\1\312\4\310\1\305\27\310\2\305\2\161\1\0"+
-    "\60\161\1\0\16\161\1\313\37\161\7\0\1\314\17\0"+
-    "\1\315\36\0\1\171\2\0\1\40\3\0\1\171\5\0"+
-    "\1\171\4\40\1\0\13\40\1\0\5\40\1\0\2\40"+
-    "\1\0\3\40\1\0\1\316\1\0\3\316\1\317\3\172"+
-    "\1\316\1\0\1\316\1\317\1\172\1\316\1\0\2\316"+
-    "\1\317\4\172\1\316\13\172\1\316\5\172\1\316\2\172"+
-    "\1\320\4\172\15\0\1\321\6\0\1\322\34\0\1\316"+
-    "\1\0\3\316\1\317\3\174\1\316\1\0\1\316\1\317"+
-    "\1\174\1\316\1\0\2\316\1\317\4\174\1\316\13\174"+
-    "\1\316\5\174\1\316\2\174\1\323\4\174\27\0\1\315"+
-    "\33\0\1\324\60\0\1\325\64\0\3\57\4\0\1\57"+
-    "\5\0\3\57\1\326\1\0\13\57\1\0\5\57\1\0"+
-    "\2\57\1\0\4\57\6\0\3\57\4\0\1\57\5\0"+
-    "\4\57\1\0\13\57\1\0\1\57\1\327\3\57\1\0"+
-    "\2\57\1\0\4\57\1\206\1\0\7\206\1\210\47\206"+
-    "\1\211\1\0\11\211\1\210\45\211\1\216\1\0\7\216"+
-    "\1\220\47\216\1\221\1\0\11\221\1\220\45\221\1\225"+
-    "\1\0\7\225\1\227\47\225\1\230\1\0\11\230\1\227"+
-    "\45\230\30\0\1\330\25\0\1\330\35\0\1\331\12\0"+
-    "\1\331\47\0\1\332\62\0\1\333\76\0\1\334\3\0"+
-    "\1\243\1\0\7\243\1\245\47\243\1\246\1\0\1\247"+
-    "\1\335\1\246\1\247\3\246\1\247\1\246\1\245\1\247"+
-    "\5\246\1\247\36\246\1\247\1\0\11\247\1\245\45\247"+
-    "\1\246\1\0\1\247\1\335\1\246\1\247\3\246\1\247"+
-    "\1\246\1\336\1\247\5\246\1\247\36\246\13\0\1\337"+
-    "\45\0\1\247\1\0\11\247\1\336\45\247\11\257\1\261"+
-    "\47\257\13\262\1\261\45\262\1\267\1\0\7\267\1\271"+
-    "\47\267\1\272\1\0\1\273\1\340\1\272\1\273\3\272"+
-    "\1\273\1\272\1\271\1\273\5\272\1\273\36\272\1\273"+
-    "\1\0\11\273\1\271\45\273\1\272\1\0\1\273\1\340"+
-    "\1\272\1\273\3\272\1\273\1\272\1\341\1\273\5\272"+
-    "\1\273\36\272\13\0\1\342\45\0\1\273\1\0\11\273"+
-    "\1\341\45\273\2\152\1\0\24\152\1\343\31\152\1\302"+
-    "\1\0\7\302\1\304\47\302\1\305\1\0\1\306\1\344"+
-    "\1\305\1\306\3\305\1\306\1\305\1\304\1\306\5\305"+
-    "\1\306\36\305\1\306\1\0\11\306\1\304\45\306\1\305"+
-    "\1\0\1\306\1\344\1\305\1\306\3\305\1\306\1\305"+
-    "\1\345\1\306\5\305\1\306\36\305\13\0\1\346\45\0"+
-    "\1\306\1\0\11\306\1\345\45\306\2\161\1\0\24\161"+
-    "\1\347\31\161\7\0\1\350\101\0\1\351\30\0\1\316"+
-    "\1\0\10\316\1\0\4\316\1\0\34\316\1\0\5\316"+
-    "\1\0\3\316\1\317\4\316\1\0\1\316\1\317\2\316"+
-    "\1\0\2\316\1\317\31\316\1\352\4\316\15\0\1\321"+
-    "\36\0\1\353\21\0\1\354\12\0\3\354\2\0\1\354"+
-    "\11\0\2\354\1\0\1\354\2\0\2\354\10\0\3\57"+
-    "\4\0\1\57\5\0\4\57\1\0\11\57\1\355\1\57"+
-    "\1\0\5\57\1\0\2\57\1\0\4\57\33\0\1\356"+
-    "\12\0\1\356\40\0\1\357\57\0\1\360\66\0\1\361"+
-    "\12\0\1\361\40\0\1\362\35\0\2\363\1\0\3\363"+
-    "\2\0\1\252\4\363\1\0\6\363\1\0\27\363\5\0"+
-    "\2\364\1\0\3\364\2\0\1\276\4\364\1\0\6\364"+
-    "\1\0\27\364\2\0\2\152\1\0\25\152\1\365\30\152"+
-    "\3\0\2\366\1\0\3\366\2\0\1\311\4\366\1\0"+
-    "\6\366\1\0\27\366\2\0\2\161\1\0\25\161\1\367"+
-    "\30\161\31\0\1\370\103\0\1\352\21\0\1\354\12\0"+
-    "\3\354\2\0\1\354\11\0\2\354\1\0\1\354\1\0"+
-    "\1\353\2\354\10\0\3\57\4\0\1\57\5\0\4\57"+
-    "\1\0\6\57\1\371\4\57\1\0\5\57\1\0\2\57"+
-    "\1\0\4\57\44\0\1\372\54\0\1\373\55\0\1\374"+
-    "\60\0\1\375\63\0\1\376\20\0\2\152\1\0\26\152"+
-    "\1\377\27\152\2\161\1\0\26\161\1\u0100\27\161\32\0"+
-    "\1\u0101\34\0\3\57\4\0\1\57\5\0\4\57\1\0"+
-    "\3\57\1\u0102\7\57\1\0\2\57\1\u0102\2\57\1\0"+
-    "\2\57\1\0\4\57\45\0\1\u0103\52\0\1\u0104\63\0"+
-    "\1\u0105\43\0\1\u0106\63\0\1\u0107\25\0\1\u0107\2\0"+
-    "\2\152\1\0\27\152\1\u0108\26\152\2\161\1\0\27\161"+
-    "\1\u0109\26\161\33\0\1\u010a\32\0\1\u010b\3\57\3\0"+
-    "\1\u010b\1\57\4\0\1\u010b\4\57\1\0\13\57\1\0"+
-    "\5\57\1\0\2\57\1\0\4\57\35\0\1\u010c\56\0"+
-    "\1\u010d\12\0\1\u010d\45\0\1\u010e\12\0\1\u010e\12\0"+
-    "\2\152\1\0\30\152\1\u010f\25\152\2\161\1\0\30\161"+
-    "\1\u0110\25\161\32\0\1\u0111\33\0\1\u010b\6\0\1\u010b"+
-    "\5\0\1\u010b\36\0\2\152\1\0\27\152\1\u0112\26\152"+
-    "\2\161\1\0\27\161\1\u0113\26\161\27\0\1\u0114\31\0"+
-    "\2\152\1\0\24\152\1\u0115\31\152\2\161\1\0\24\161"+
-    "\1\u0116\31\161";
-
-  /** 
-   * 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,  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,  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,  0,  0,  0,  0,  0,  0,  1,  0,  0, 
-     1,  0,  1,  0,  1,  0,  1,  9,  0,  1,  9,  0,  1,  0,  0,  0, 
-     0,  0,  0,  0,  1,  0,  1,  0,  1,  0,  0,  0,  0,  0,  1,  1, 
-     0,  1,  0,  0,  0,  9,  9,  1,  1,  0,  1,  9,  9,  9,  1,  1, 
-     0,  1,  1,  9,  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[9212];
-    int i = 0;  /* index in packed string  */
-    int j = 0;  /* index in unpacked array */
-    while (i < 3220) {
-      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 275: 
-        case 276: 
-        case 277: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nCDATA start");//$NON-NLS-1$
-	fStateStack.push(yystate());
-	yybegin(ST_CDATA_TEXT);
-	return XML_CDATA_OPEN;
- }
-        case 279: break;
-        case 269: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("element");//$NON-NLS-1$
-	yybegin(ST_XML_ELEMENT_DECLARATION);
-	return XML_ELEMENT_DECLARATION;
- }
-        case 280: break;
-        case 268: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attlist");//$NON-NLS-1$
-	yybegin(ST_XML_ATTLIST_DECLARATION);
-	return XML_ATTLIST_DECLARATION;
- }
-        case 281: break;
-        case 267: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_DECLARATION);
-	return XML_DOCTYPE_DECLARATION;
- }
-        case 282: break;
-        case 262: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype external id");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_ID_PUBLIC);
-	return XML_DOCTYPE_EXTERNAL_ID_PUBLIC;
- }
-        case 283: break;
-        case 261: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype external id");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
-	return XML_DOCTYPE_EXTERNAL_ID_SYSTEM;
- }
-        case 284: break;
-        case 257: 
-        case 266: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction target");//$NON-NLS-1$
-        yybegin(ST_DHTML_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
- }
-        case 285: break;
-        case 234: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nCharRef");//$NON-NLS-1$
-	return XML_CHAR_REFERENCE;
- }
-        case 286: break;
-        case 231: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\ncomment start");//$NON-NLS-1$
-	yybegin(ST_XML_COMMENT);
-	return XML_COMMENT_OPEN;
- }
-        case 287: break;
-        case 213: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction target");//$NON-NLS-1$
-        yybegin(ST_XML_PI_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
- }
-        case 288: break;
-        case 212: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("comment end");//$NON-NLS-1$
-	yybegin(YYINITIAL);
-	return XML_COMMENT_CLOSE;
- }
-        case 289: break;
-        case 211: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("CDATA end");//$NON-NLS-1$
-	yybegin(fStateStack.pop());
-	return XML_CDATA_CLOSE;
- }
-        case 290: break;
-        case 210: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nPEReference");//$NON-NLS-1$
-	return XML_PE_REFERENCE;
- }
-        case 291: break;
-        case 207: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nEntityRef");//$NON-NLS-1$
-	return XML_ENTITY_REFERENCE;
- }
-        case 292: break;
-        case 158: 
-        case 172: 
-        case 180: 
-          { 
-	return XML_DOCTYPE_INTERNAL_SUBSET;
- }
-        case 293: break;
-        case 146: 
-          { 
-        yybegin(YYINITIAL);
-	if(Debug.debugTokenizer)
-		dump("empty tag close");//$NON-NLS-1$
-        return XML_EMPTY_TAG_CLOSE;
- }
-        case 294: break;
-        case 131: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction end");//$NON-NLS-1$
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 295: break;
-        case 130: 
-          { 
-		// ended with nothing inside
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 296: break;
-        case 127: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("processing instruction end");//$NON-NLS-1$
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 297: break;
-        case 119: 
-          { 
-	fStateStack.push(yystate());
-	if(Debug.debugTokenizer)
-		dump("\ndeclaration start");//$NON-NLS-1$
-        yybegin(ST_XML_DECLARATION);
-	return XML_DECLARATION_OPEN;
- }
-        case 298: break;
-        case 118: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nprocessing instruction start");//$NON-NLS-1$
-	yybegin(ST_PI);
-        return XML_PI_OPEN;
- }
-        case 299: break;
-        case 62: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction end");//$NON-NLS-1$
-        yybegin(YYINITIAL);
-        return XML_PI_CLOSE;
- }
-        case 300: break;
-        case 56: 
-        case 58: 
-        case 59: 
-        case 60: 
-        case 135: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction attribute value");//$NON-NLS-1$
-        yybegin(ST_XML_PI_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 301: break;
-        case 55: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction '='");//$NON-NLS-1$
-        yybegin(ST_XML_PI_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
- }
-        case 302: break;
-        case 54: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("XML processing instruction attribute name");//$NON-NLS-1$
-        yybegin(ST_XML_PI_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
- }
-        case 303: break;
-        case 50: 
-        case 51: 
-        case 52: 
-          { 
-	// block scan until close is found
-	return doScan("?>", false, XML_PI_CONTENT, ST_XML_PI_TAG_CLOSE, ST_XML_PI_TAG_CLOSE);
- }
-        case 304: break;
-        case 49: 
-          { 
-        yybegin(ST_PI_CONTENT);
-        return WHITE_SPACE;
- }
-        case 305: break;
-        case 46: 
-        case 47: 
-        case 48: 
-        case 128: 
-        case 129: 
-        case 214: 
-        case 236: 
-        case 248: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("processing instruction target");//$NON-NLS-1$
-        yybegin(ST_PI_WS);
-        return XML_TAG_NAME;
- }
-        case 306: break;
-        case 41: 
-        case 42: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("comment content");//$NON-NLS-1$
-	return scanXMLCommentText();
- }
-        case 307: break;
-        case 40: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("LINE FEED");//$NON-NLS-1$
-	return WHITE_SPACE;
- }
-        case 308: break;
-        case 0: 
-        case 31: 
-        case 121: 
-        case 123: 
-        case 205: 
-        case 206: 
-        case 233: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nXML content");//$NON-NLS-1$
-	return XML_CONTENT;
- }
-        case 309: 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 310: break;
-        case 16: 
-        case 70: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("inappropriate tag name");//$NON-NLS-1$
-	yybegin(YYINITIAL);
-        return XML_CONTENT;
- }
-        case 311: break;
-        case 27: 
-        case 105: 
-        case 106: 
-        case 191: 
-        case 226: 
-        case 244: 
-        case 254: 
-        case 263: 
-        case 270: 
-        case 273: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("elementdecl contentspec");//$NON-NLS-1$
-	return XML_ELEMENT_DECL_CONTENT;
- }
-        case 312: break;
-        case 29: 
-        case 112: 
-        case 113: 
-        case 202: 
-        case 230: 
-        case 246: 
-        case 255: 
-        case 264: 
-        case 271: 
-        case 274: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attlist contentspec");//$NON-NLS-1$
-	return XML_ATTLIST_DECL_CONTENT;
- }
-        case 313: break;
-        case 32: 
-        case 71: 
-        case 82: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nstart tag open");//$NON-NLS-1$
-        yybegin(ST_XML_TAG_NAME);
-        return XML_TAG_OPEN;
- }
-        case 314: break;
-        case 33: 
-        case 34: 
-        case 37: 
-        case 38: 
-        case 39: 
-        case 43: 
-        case 44: 
-        case 53: 
-        case 57: 
-        case 61: 
-        case 63: 
-        case 67: 
-        case 73: 
-        case 79: 
-        case 84: 
-        case 85: 
-        case 86: 
-        case 87: 
-        case 89: 
-        case 90: 
-        case 92: 
-        case 97: 
-        case 102: 
-        case 109: 
-          { 
-	if (Debug.debugTokenizer)
-		System.out.println("!!!unexpected!!!: \"" + yytext() + "\":" + //$NON-NLS-2$//$NON-NLS-1$
-			yychar + "-" + (yychar + yylength()));//$NON-NLS-1$
-	return UNDEFINED;
- }
-        case 315: 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 316: break;
-        case 64: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction attribute name");//$NON-NLS-1$
-        yybegin(ST_DHTML_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
- }
-        case 317: break;
-        case 65: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction '='");//$NON-NLS-1$
-        yybegin(ST_DHTML_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
- }
-        case 318: break;
-        case 66: 
-        case 68: 
-        case 69: 
-        case 143: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("DHTML processing instruction attribute value");//$NON-NLS-1$
-        yybegin(ST_DHTML_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 319: break;
-        case 72: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("tag close");//$NON-NLS-1$
-	if(isBlockMarker()) {
-        	yybegin(ST_BLOCK_TAG_SCAN);
-	}
-	else
-        	yybegin(YYINITIAL);
-        return XML_TAG_CLOSE;
- }
-        case 320: break;
-        case 74: 
-        case 75: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("tag name");//$NON-NLS-1$
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return XML_TAG_NAME;
- }
-        case 321: break;
-        case 76: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attr name");//$NON-NLS-1$
-        yybegin(ST_XML_EQUALS);
-        return XML_TAG_ATTRIBUTE_NAME;
- }
-        case 322: break;
-        case 77: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("equals");//$NON-NLS-1$
-        yybegin(ST_XML_ATTRIBUTE_VALUE);
-        return XML_TAG_ATTRIBUTE_EQUALS;
- }
-        case 323: break;
-        case 78: 
-        case 80: 
-        case 81: 
-        case 150: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attr value");//$NON-NLS-1$
-        yybegin(ST_XML_ATTRIBUTE_NAME);
-        return XML_TAG_ATTRIBUTE_VALUE;
- }
-        case 324: break;
-        case 83: 
-          { 
-	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 325: break;
-        case 88: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype type");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_EXTERNAL_ID);
-	return XML_DOCTYPE_NAME;
- }
-        case 326: break;
-        case 91: 
-        case 93: 
-        case 94: 
-        case 95: 
-        case 164: 
-        case 165: 
-        case 168: 
-        case 169: 
-        case 221: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype public reference");//$NON-NLS-1$
-	yybegin(ST_XML_DOCTYPE_ID_SYSTEM);
-	return XML_DOCTYPE_EXTERNAL_ID_PUBREF;
- }
-        case 327: break;
-        case 96: 
-        case 98: 
-        case 99: 
-        case 100: 
-        case 176: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("doctype system reference");//$NON-NLS-1$
-	yybegin(ST_XML_DECLARATION_CLOSE);
-	return XML_DOCTYPE_EXTERNAL_ID_SYSREF;
- }
-        case 328: break;
-        case 101: 
-        case 103: 
-        case 104: 
-        case 184: 
-        case 185: 
-        case 188: 
-        case 189: 
-        case 224: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("elementdecl name");//$NON-NLS-1$
-	yybegin(ST_XML_ELEMENT_DECLARATION_CONTENT);
-	return XML_ELEMENT_DECL_NAME;
- }
-        case 329: break;
-        case 107: 
-          { 
-	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 330: break;
-        case 108: 
-        case 110: 
-        case 111: 
-        case 195: 
-        case 196: 
-        case 199: 
-        case 200: 
-        case 228: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("attlist name");//$NON-NLS-1$
-	yybegin(ST_XML_ATTLIST_DECLARATION_CONTENT);
-	return XML_ATTLIST_DECL_NAME;
- }
-        case 331: break;
-        case 114: 
-          { 
-	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 332: break;
-        case 117: 
-          { 
-	if(Debug.debugTokenizer)
-		dump("\nend tag open");//$NON-NLS-1$
-        yybegin(ST_XML_TAG_NAME);
-        return XML_END_TAG_OPEN;
- }
-        case 333: break;
-        case 115: 
-        case 116: 
-          { 
-		return doBlockTagScan();
-	 }
-        case 334: 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 cb0f3c9..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, 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.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 5ae7dea..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, 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.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 0a7b3a5..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, 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.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/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 624f98b..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, 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.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 34778bb..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, 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.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 3258301..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionUpdateRule.java
+++ /dev/null
@@ -1,205 +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.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.
-			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.
-			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 1c2f164..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, 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.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 8fd618f..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, 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.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 d9904e7..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagOpenRegion.java
+++ /dev/null
@@ -1,94 +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.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;
-	private int fTextLength;
-
-
-	public TagOpenRegion() {
-		super();
-	}
-
-	public TagOpenRegion(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) {
-		// 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 5780c8a..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, 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.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 35faebb..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, 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.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 6ccb570..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, 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.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 03a9951..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, 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.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 9bceeaa..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, 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.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 583d642..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLParserRegionFactory.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.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_TAG_CLOSE) {
-			newRegion = new TagCloseRegion(start);
-		}
-		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 7211076..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java
+++ /dev/null
@@ -1,51 +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.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);
-		
-		// 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$
-	}
-}
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 74d0f7f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java
+++ /dev/null
@@ -1,144 +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.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 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>
-	 */
-	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$
-}
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 992d60e..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, 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.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 711716c..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, 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.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 3c77349..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, 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.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 2740e0f..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, 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.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 1f53cfb..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/NameValidator.java
+++ /dev/null
@@ -1,60 +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;
-
-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.
- * 
- * @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 d47f940..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocType.java
+++ /dev/null
@@ -1,21 +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.provisional.contentmodel;
-
-
-public interface CMDocType {
-	public final static String CHTML_DOC_TYPE = "CHTML";//$NON-NLS-1$
-	public final static String HTML_DOC_TYPE = "HTML";//$NON-NLS-1$
-	public final static String JSP11_DOC_TYPE = "JSP11";//$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 63e9b1a..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, 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.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 1c905c1..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, 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.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 2184758..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, 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.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 51e77fb..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, 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.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 aa798f5..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, 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.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 33c97c3..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, 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.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.ranges.DocumentRange;
-import org.w3c.dom.traversal.DocumentTraversal;
-
-/**
- * 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 IDOMNode, Document, DocumentRange, DocumentTraversal {
-
-	/**
-	 * 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
-	 * 
-	 * 
-	 */
-	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 3afee60..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, 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.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 c1a6feb..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, 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.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 68ffb44..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 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this 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 2c16d40..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 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this 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 f0af9da..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, 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.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 c73891c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMNode.java
+++ /dev/null
@@ -1,283 +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.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;
-import org.w3c.dom.TypeInfo;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * 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 Object setUserData(String key, Object data, UserDataHandler handler);
-	
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
-	 */
-	public TypeInfo getSchemaTypeInfo();
-	
-	/**
-	 * 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 3c88c76..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, 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.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 e6576cf..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, 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.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 da0e1de..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.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.provisional.format;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-
-public class CommentNodeFormatter extends NodeFormatter {
-
-	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 aee80a1..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/DocumentNodeFormatter.java
+++ /dev/null
@@ -1,53 +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.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());
-
-				// 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 7c21b67..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java
+++ /dev/null
@@ -1,364 +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.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.internal.util.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.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.NamedNodeMap;
-import org.w3c.dom.Node;
-
-
-public class ElementNodeFormatter extends DocumentNodeFormatter {
-	static protected final char DOUBLE_QUOTE = '"';//$NON-NLS-1$
-	static protected final String DOUBLE_QUOTES = "\"\"";//$NON-NLS-1$
-	static protected final char EQUAL_CHAR = '='; // equal sign$NON-NLS-1$
-	static protected final String PRESERVE = "preserve";//$NON-NLS-1$
-	static protected final String PRESERVE_QUOTED = "\"preserve\"";//$NON-NLS-1$
-	static protected final char SINGLE_QUOTE = '\'';//$NON-NLS-1$
-	static protected final String XML_SPACE = "xml:space";//$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)) {
-				// 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();
-
-			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);
-				}
-			}
-
-			// 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) {
-		String singleIndent = getFormatPreferences().getIndent();
-		String lineIndent = formatContraints.getCurrentIndent();
-		String attrIndent = lineIndent + singleIndent;
-		boolean splitMultiAttrs = ((IStructuredFormatPreferencesXML) fFormatPreferences).getSplitMultiAttrs();
-		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 = getFormatPreferences().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;
-			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) {
-						ModelQueryAdapter adapter = (ModelQueryAdapter) ((IDOMDocument) node.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
-						CMElementDeclaration elementDeclaration = (CMElementDeclaration) adapter.getModelQuery().getCMNode(node);
-						if (elementDeclaration == null)
-							// CMElementDeclaration not found, default to
-							// PRESERVE
-							formatContraints.setClearAllBlankLines(false);
-						else {
-							CMAttributeDeclaration attributeDeclaration = (CMAttributeDeclaration) elementDeclaration.getAttributes().getNamedItem(XML_SPACE);
-							if (attributeDeclaration == null)
-								// CMAttributeDeclaration not found, default
-								// to PRESERVE
-								formatContraints.setClearAllBlankLines(false);
-							else {
-								String defaultValue = attributeDeclaration.getAttrType().getImpliedValue();
-
-								if (defaultValue.compareTo(PRESERVE) == 0)
-									formatContraints.setClearAllBlankLines(false);
-								else
-									formatContraints.setClearAllBlankLines(getFormatPreferences().getClearAllBlankLines());
-							}
-						}
-					}
-					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.setClearAllBlankLines(false);
-						else
-							formatContraints.setClearAllBlankLines(getFormatPreferences().getClearAllBlankLines());
-					}
-				}
-
-				if (splitMultiAttrs && attrLength > 1) {
-					stringBuffer.append(lineDelimiter + attrIndent);
-					stringBuffer.append(flatNode.getText(nameRegion));
-					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);
-							currentAvailableLineWidth = getFormatPreferences().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);
-							currentAvailableLineWidth = getFormatPreferences().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 />
-						stringBuffer.append(SPACE_CHAR);
-				}
-			}
-
-			replace(structuredDocument, offset, length, stringBuffer.toString());
-		}
-	}
-
-	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 + 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 61be949..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/FormatProcessorXML.java
+++ /dev/null
@@ -1,109 +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.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.document.CDATASectionImpl;
-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));
-				((IStructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
-				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 : {
-				if (node instanceof CDATASectionImpl)
-					formatter = new NodeFormatter();
-				else
-					formatter = new TextNodeFormatter();
-				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;
-			}
-			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/IStructuredFormatPreferencesXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/IStructuredFormatPreferencesXML.java
deleted file mode 100644
index 5af2338..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/IStructuredFormatPreferencesXML.java
+++ /dev/null
@@ -1,21 +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.provisional.format;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatPreferences;
-
-public interface IStructuredFormatPreferencesXML extends IStructuredFormatPreferences {
-	boolean getSplitMultiAttrs();
-
-	void setSplitMultiAttrs(boolean splitMultiAttrs);
-}
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 cca4e8f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java
+++ /dev/null
@@ -1,822 +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.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.internal.util.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 CR = "\r"; //$NON-NLS-1$
-	static protected final String CRLF = "\r\n"; //$NON-NLS-1$
-	static protected final String DELIMITERS = " \t\n\r\f"; //$NON-NLS-1$
-	static protected final String EMPTY_STRING = ""; //$NON-NLS-1$
-	static protected final String FF = "\f"; //$NON-NLS-1$
-	static protected final String LF = "\n"; //$NON-NLS-1$
-	static protected final String SPACE = " "; //$NON-NLS-1$
-	static protected final char SPACE_CHAR = ' '; //$NON-NLS-1$
-	static protected final String TAB = "\t"; //$NON-NLS-1$
-	static protected final char TAB_CHAR = '\t'; //$NON-NLS-1$
-	protected IStructuredFormatContraints fFormatContraints = null;
-	protected IStructuredFormatPreferences fFormatPreferences = null;
-	protected IProgressMonitor fProgressMonitor = null;
-
-	protected 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 boolean firstStructuredDocumentRegionContainsLineDelimiters(IDOMNode node) {
-		boolean result = false;
-
-		if (node != null) {
-			IStructuredDocumentRegion firstStructuredDocumentRegion = node.getFirstStructuredDocumentRegion();
-			if (firstStructuredDocumentRegion != null && firstStructuredDocumentRegion.getText() != 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) {
-		if (node != null) {
-			IDOMNode nextSibling = (IDOMNode) node.getNextSibling();
-			IStructuredDocument doc = node.getModel().getStructuredDocument();
-			int line = doc.getLineOfOffset(node.getEndOffset());
-			String lineDelimiter = doc.getLineDelimiter();
-			try {
-				lineDelimiter = doc.getLineDelimiter(line);
-				if (lineDelimiter == null)
-					lineDelimiter = ""; //$NON-NLS-1$
-			}
-			catch (BadLocationException e) {
-				// log for now, unless we find reason not to
-				Logger.log(Logger.INFO, e.getMessage());
-			}
-
-			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 {
-							// append indentation
-							insertAfterNode(lastChild, lineDelimiter + lineIndent);
-						}
-					}
-				}
-			}
-		}
-	}
-
-	protected void formatIndentationBeforeNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		if (node != null) {
-			IDOMNode previousSibling = (IDOMNode) node.getPreviousSibling();
-			IStructuredDocument doc = node.getModel().getStructuredDocument();
-			int line = doc.getLineOfOffset(node.getStartOffset());
-			String lineDelimiter = doc.getLineDelimiter();
-			try {
-				if (line > 0) {
-					lineDelimiter = doc.getLineDelimiter(line - 1);
-					if (lineDelimiter == null)
-						lineDelimiter = ""; //$NON-NLS-1$
-				}
-			}
-			catch (BadLocationException e) {
-				// log for now, unless we find reason not to
-				Logger.log(Logger.INFO, e.getMessage());
-			}
-			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);
-							}
-						}
-					}
-				}
-			}
-		}
-	}
-
-	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) {
-		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 String getCompressedNodeText(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		return compressSpaces(getNodeText(node), formatContraints);
-	}
-
-	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));
-				((IStructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
-				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 : {
-				if (node instanceof CDATASectionImpl)
-					formatter = new NodeFormatter();
-				else
-					formatter = new TextNodeFormatter();
-				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;
-			}
-			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 084c689..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/StructuredFormatPreferencesXML.java
+++ /dev/null
@@ -1,27 +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.provisional.format;
-
-import org.eclipse.wst.sse.core.internal.format.StructuredFormatPreferences;
-
-public class StructuredFormatPreferencesXML extends StructuredFormatPreferences implements IStructuredFormatPreferencesXML {
-	private boolean fSplitMultiAttrs;
-
-	public boolean getSplitMultiAttrs() {
-		return fSplitMultiAttrs;
-	}
-
-	public void setSplitMultiAttrs(boolean splitMultiAttrs) {
-		fSplitMultiAttrs = splitMultiAttrs;
-	}
-}
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 0d9433f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/TextNodeFormatter.java
+++ /dev/null
@@ -1,200 +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.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.internal.util.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 {
-	protected void formatNode(IDOMNode node, IStructuredFormatContraints formatContraints) {
-		if (node != null) {
-			IStructuredDocument doc = node.getModel().getStructuredDocument();
-			int line = doc.getLineOfOffset(node.getStartOffset());
-			String lineDelimiter = doc.getLineDelimiter();
-			try {
-				lineDelimiter = doc.getLineDelimiter(line);
-				if (lineDelimiter == null)
-					lineDelimiter = ""; //$NON-NLS-1$
-			} catch (BadLocationException e) {
-				// log for now, unless we find reason not to
-				Logger.log(Logger.INFO, e.getMessage());
-			}
-			int lineWidth = getFormatPreferences().getLineWidth();
-			IDOMNode parentNode = (IDOMNode) node.getParentNode();
-			String nodeIndentation = formatContraints.getCurrentIndent();
-
-			// compute current available line width
-			int currentAvailableLineWidth = 0;
-			try {
-				int nodeNameOffset = node.getStartOffset();
-				int lineOffset = node.getStructuredDocument().getLineInformationOfOffset(nodeNameOffset).getOffset();
-				String text = node.getStructuredDocument().get(lineOffset, nodeNameOffset - lineOffset);
-				int usedWidth = getIndentationLength(text);
-				currentAvailableLineWidth = getFormatPreferences().getLineWidth() - usedWidth;
-			} catch (BadLocationException e) {
-				// log for now, unless we find reason not to
-				Logger.log(Logger.INFO, e.getMessage());
-			}
-
-			String compressedText = getCompressedNodeText(node, formatContraints);
-
-			if (((compressedText.length() <= (currentAvailableLineWidth - node.getParentNode().getNodeName().length() - 3) && !StringUtils.containsLineDelimiter(compressedText)) && (!nodeHasSiblings(node) || (!StringUtils.containsLineDelimiter(node.getNodeValue()) && node.getNextSibling() != null && node.getNextSibling().getNodeType() == Node.COMMENT_NODE && !StringUtils.containsLineDelimiter(node.getNextSibling().getNodeValue()))) && !firstStructuredDocumentRegionContainsLineDelimiters((IDOMNode) node.getParentNode())) || node.getStartStructuredDocumentRegion().getStartOffset() == 0) {
-				// 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);
-
-					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);
-			} else {
-				// not enough space, need to reflow text
-
-				currentAvailableLineWidth = lineWidth - getIndentationLength(nodeIndentation);
-				List vector = reflowText(compressedText, currentAvailableLineWidth);
-				int vectorSize = vector.size();
-				String reflowedText = new String();
-
-				for (int i = 0; i < vectorSize; i++) {
-					if (((String) vector.get(i)).trim().length() > 0)
-						reflowedText = reflowedText + lineDelimiter + nodeIndentation + (String) vector.get(i);
-					else
-						reflowedText = reflowedText + lineDelimiter;
-				}
-
-				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
-
-						if (node.getNextSibling().getNodeType() == Node.COMMENT_NODE) {
-							// add indentation to end if
-							// currentTextEndsWithLineDelimiter
-							// or followed by multiLineComment
-
-							String nodeText = getNodeText(node);
-							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 = node.getNextSibling().getNodeValue();
-							boolean multiLineComment = StringUtils.containsLineDelimiter(nodeValue);
-
-							if (currentTextEndsWithLineDelimiter || multiLineComment) {
-								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);
-			}
-
-		}
-	}
-
-	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;
-	}
-}
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 7391845..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/text/IXMLPartitions.java
+++ /dev/null
@@ -1,32 +0,0 @@
-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.
- * 
- * @plannedfor 1.0
- */
-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 e379894..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, 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.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 fc5465c..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, 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.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 26b00e6..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, 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.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 7557efc..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, 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.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 4a10d61..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, 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.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 c5cc404..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, 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.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 bd8a9b8..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, 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.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.provisional.text.IXMLPartitions;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-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 adef45a..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/AbstractPropagatingValidator.java
+++ /dev/null
@@ -1,43 +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.validate;
-
-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);
-
-
-		Propagator.propagateToChildElements(getPropagatee(), (Node) node);
-	}
-
-}
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 e58d1a6..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/Propagator.java
+++ /dev/null
@@ -1,51 +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.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;
-
-
-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 7210fe5..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/ValidationComponent.java
+++ /dev/null
@@ -1,50 +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.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;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/COPYRIGHT.html b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/COPYRIGHT.html
deleted file mode 100644
index 1d48a66..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/COPYRIGHT.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>W3C IPR SOFTWARE NOTICE</title>
-<style type="text/css">
-<!--
-html, body { background: #fff; color: #000; } /* body for Windows IE3 */
--->
-</style>
-</head>
-<body>
-<h1>W3C SOFTWARE NOTICE AND LICENSE</h1>
-<h3>Copyright &copy; 2004 <a href="http://www.w3.org/">World Wide Web
-Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
-Institute of Technology</a>, <a href="http://www.ercim.org/">European
-Research Consortium for Informatics and Mathematics</a>, <a
-	href="http://www.keio.ac.jp/">Keio University</a>). All Rights
-Reserved.</h3>
-<p>The DOM bindings are published under the W3C Software Copyright
-Notice and License. The software license requires "Notice of any changes
-or modifications to the W3C files, including the date changes were
-made." Consequently, modified versions of the DOM bindings must document
-that they do not conform to the W3C standard; in the case of the IDL
-definitions, the pragma prefix can no longer be 'w3c.org'; in the case
-of the Java language binding, the package names can no longer be in the
-'org.w3c' package.</p>
-<p><b>Note:</b> The original version of the W3C Software Copyright
-Notice and License could be found at <a
-	href='http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231'>http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231</a>
-</p>
-<p>This work (and included software, documentation such as READMEs, or
-other related items) is being provided by the copyright holders under
-the following license. By obtaining, using and/or copying this work, you
-(the licensee) agree that you have read, understood, and will comply
-with the following terms and conditions.</p>
-
-<p>Permission to copy, modify, and distribute this software and its
-documentation, with or without modification,&nbsp;for any purpose and
-without fee or royalty is hereby granted, provided that you include the
-following on ALL copies of the software and documentation or portions
-thereof, including modifications:</p>
-<ol>
-	<li>The full text of this NOTICE in a location viewable to users of the
-	redistributed or derivative work.</li>
-
-	<li>Any pre-existing intellectual property disclaimers, notices, or
-	terms and conditions. If none exist, the <a
-		href="http://www.w3.org/Consortium/Legal/2002/copyright-software-short-notice-20021231.html">W3C
-	Software Short Notice</a> should be included (hypertext is preferred,
-	text is permitted) within the body of any redistributed or derivative
-	code.</li>
-
-	<li>Notice of any changes or modifications to the files, including the
-	date changes were made. (We recommend you provide URIs to the location
-	from which the code is derived.)</li>
-</ol>
-
-<p>THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
-HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
-INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS
-FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR
-DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
-TRADEMARKS OR OTHER RIGHTS.</p>
-
-<p>COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT,
-SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE
-OR DOCUMENTATION.</p>
-
-<p>The name and trademarks of copyright holders may NOT be used in
-advertising or publicity pertaining to the software without specific,
-written prior permission. Title to copyright in this software and any
-associated documentation will at all times remain with copyright
-holders.</p>
-</body>
-</html>
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/DOMConfiguration.java b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/DOMConfiguration.java
deleted file mode 100644
index 7cce160..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/DOMConfiguration.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- *  The <code>DOMConfiguration</code> interface represents the configuration 
- * of a document and maintains a table of recognized parameters. Using the 
- * configuration, it is possible to change 
- * <code>Document.normalizeDocument()</code> behavior, such as replacing the 
- * <code>CDATASection</code> nodes with <code>Text</code> nodes or 
- * specifying the type of the schema that must be used when the validation 
- * of the <code>Document</code> is requested. <code>DOMConfiguration</code> 
- * objects are also used in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>DOM Level 3 Load and Save</a>]
- *  in the <code>DOMParser</code> and <code>DOMSerializer</code> interfaces. 
- * <p> The parameter names used by the <code>DOMConfiguration</code> object 
- * are defined throughout the DOM Level 3 specifications. Names are 
- * case-insensitive. To avoid possible conflicts, as a convention, names 
- * referring to parameters defined outside the DOM specification should be 
- * made unique. Because parameters are exposed as properties in the , names 
- * are recommended to follow the section 5.16 Identifiers of [Unicode] with the addition of the character '-' (HYPHEN-MINUS) but it is not 
- * enforced by the DOM implementation. DOM Level 3 Core Implementations are 
- * required to recognize all parameters defined in this specification. Some 
- * parameter values may also be required to be supported by the 
- * implementation. Refer to the definition of the parameter to know if a 
- * value must be supported or not. 
- * <p ><b>Note:</b>  Parameters are similar to features and properties used in 
- * SAX2 [<a href='http://www.saxproject.org/'>SAX</a>]. 
- * <p> The following list of parameters defined in the DOM: 
- * <dl>
- * <dt>
- * <code>"canonical-form"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Canonicalize the document according to the rules specified in [<a href='http://www.w3.org/TR/2001/REC-xml-c14n-20010315'>Canonical XML</a>], 
- * such as removing the <code>DocumentType</code> node (if any) from the 
- * tree, or removing superfluous namespace declarations from each element. 
- * Note that this is limited to what can be represented in the DOM; in 
- * particular, there is no way to specify the order of the attributes in the 
- * DOM. In addition,  Setting this parameter to <code>true</code> will also 
- * set the state of the parameters listed below. Later changes to the state 
- * of one of those parameters will revert "canonical-form" back to 
- * <code>false</code>. Parameters set to <code>false</code>: "entities", "
- * normalize-characters", "cdata-sections". Parameters set to 
- * <code>true</code>: "namespaces", "namespace-declarations", "well-formed", 
- * "element-content-whitespace". Other parameters are not changed unless 
- * explicitly specified in the description of the parameters.</dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Do not canonicalize the document.</dd>
- * </dl></dd>
- * <dt><code>"cdata-sections"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Keep <code>CDATASection</code> nodes in the document.</dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>]Transform <code>CDATASection</code> nodes in the document into 
- * <code>Text</code> nodes. The new <code>Text</code> node is then combined 
- * with any adjacent <code>Text</code> node.</dd>
- * </dl></dd>
- * <dt>
- * <code>"check-character-normalization"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Check if the characters in the document are <a href='http://www.w3.org/TR/2004/REC-xml11-20040204/#dt-fullnorm'>fully 
- * normalized</a>, as defined in appendix B of [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]. When a 
- * sequence of characters is encountered that fails normalization checking, 
- * an error with the <code>DOMError.type</code> equals to 
- * "check-character-normalization-failure" is issued. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Do not check if characters are normalized.</dd>
- * </dl></dd>
- * <dt><code>"comments"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Keep <code>Comment</code> nodes in the document.</dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>]Discard <code>Comment</code> nodes in the document.</dd>
- * </dl></dd>
- * <dt>
- * <code>"datatype-normalization"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Expose schema normalized values in the tree, such as <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-nv'>XML 
- * Schema normalized values</a> in the case of XML Schema. Since this parameter requires to have schema 
- * information, the "validate" parameter will also be set to 
- * <code>true</code>. Having this parameter activated when "validate" is 
- * <code>false</code> has no effect and no schema-normalization will happen. 
- * <p ><b>Note:</b>  Since the document contains the result of the XML 1.0 
- * processing, this parameter does not apply to attribute value 
- * normalization as defined in section 3.3.3 of [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] and is only 
- * meant for schema languages other than Document Type Definition (DTD). </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Do not perform schema normalization on the tree. </dd>
- * </dl></dd>
- * <dt>
- * <code>"element-content-whitespace"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Keep all whitespaces in the document.</dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>optional</em>] Discard all <code>Text</code> nodes that contain whitespaces in element 
- * content, as described in <a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204#infoitem.character'>
- * [element content whitespace]</a>. The implementation is expected to use the attribute 
- * <code>Text.isElementContentWhitespace</code> to determine if a 
- * <code>Text</code> node should be discarded or not.</dd>
- * </dl></dd>
- * <dt><code>"entities"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Keep <code>EntityReference</code> nodes in the document.</dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] Remove all <code>EntityReference</code> nodes from the document, 
- * putting the entity expansions directly in their place. <code>Text</code> 
- * nodes are normalized, as defined in <code>Node.normalize</code>. Only <a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#infoitem.rse'>
- * unexpanded entity references</a> are kept in the document. </dd>
- * </dl>
- * <p ><b>Note:</b>  This parameter does not affect <code>Entity</code> nodes. </dd>
- * <dt>
- * <code>"error-handler"</code></dt>
- * <dd>[<em>required</em>] Contains a <code>DOMErrorHandler</code> object. If an error is 
- * encountered in the document, the implementation will call back the 
- * <code>DOMErrorHandler</code> registered using this parameter. The 
- * implementation may provide a default <code>DOMErrorHandler</code> object. 
- *  When called, <code>DOMError.relatedData</code> will contain the closest 
- * node to where the error occurred. If the implementation is unable to 
- * determine the node where the error occurs, 
- * <code>DOMError.relatedData</code> will contain the <code>Document</code> 
- * node. Mutations to the document from within an error handler will result 
- * in implementation dependent behavior. </dd>
- * <dt><code>"infoset"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>]Keep in the document the information defined in the XML Information Set [<a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204/'>XML Information Set</a>]
- * .This forces the following parameters to <code>false</code>: "
- * validate-if-schema", "entities", "datatype-normalization", "cdata-sections
- * ".This forces the following parameters to <code>true</code>: "
- * namespace-declarations", "well-formed", "element-content-whitespace", "
- * comments", "namespaces".Other parameters are not changed unless 
- * explicitly specified in the description of the parameters. Note that 
- * querying this parameter with <code>getParameter</code> returns 
- * <code>true</code> only if the individual parameters specified above are 
- * appropriately set.</dd>
- * <dt><code>false</code></dt>
- * <dd>Setting <code>infoset</code> to 
- * <code>false</code> has no effect.</dd>
- * </dl></dd>
- * <dt><code>"namespaces"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Perform the namespace processing as defined in . </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>optional</em>] Do not perform the namespace processing. </dd>
- * </dl></dd>
- * <dt>
- * <code>"namespace-declarations"</code></dt>
- * <dd> This parameter has no effect if the 
- * parameter "namespaces" is set to <code>false</code>. 
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Include namespace declaration attributes, specified or defaulted from 
- * the schema, in the document. See also the sections "Declaring Namespaces" 
- * in [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- *  and [<a href='http://www.w3.org/TR/2004/REC-xml-names11-20040204/'>XML Namespaces 1.1</a>]
- * .</dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>]Discard all namespace declaration attributes. The namespace prefixes (
- * <code>Node.prefix</code>) are retained even if this parameter is set to 
- * <code>false</code>.</dd>
- * </dl></dd>
- * <dt><code>"normalize-characters"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] <a href='http://www.w3.org/TR/2004/REC-xml11-20040204/#dt-fullnorm'>Fully 
- * normalized</a> the characters in the document as defined in appendix B of [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]. </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Do not perform character normalization.</dd>
- * </dl></dd>
- * <dt><code>"schema-location"</code></dt>
- * <dd>[<em>optional</em>] Represent a <code>DOMString</code> object containing a list of URIs, 
- * separated by whitespaces (characters matching the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-S'>nonterminal 
- * production S</a> defined in section 2.3 [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]), that 
- * represents the schemas against which validation should occur, i.e. the 
- * current schema. The types of schemas referenced in this list must match 
- * the type specified with <code>schema-type</code>, otherwise the behavior 
- * of an implementation is undefined.  The schemas specified using this 
- * property take precedence to the schema information specified in the 
- * document itself. For namespace aware schema, if a schema specified using 
- * this property and a schema specified in the document instance (i.e. using 
- * the <code>schemaLocation</code> attribute) in a schema document (i.e. 
- * using schema <code>import</code> mechanisms) share the same 
- * <code>targetNamespace</code>, the schema specified by the user using this 
- * property will be used. If two schemas specified using this property share 
- * the same <code>targetNamespace</code> or have no namespace, the behavior 
- * is implementation dependent.  If no location has been provided, this 
- * parameter is <code>null</code>. 
- * <p ><b>Note:</b>  The <code>"schema-location"</code> parameter is ignored 
- * unless the "schema-type" parameter value is set. It is strongly 
- * recommended that <code>Document.documentURI</code> will be set so that an 
- * implementation can successfully resolve any external entities referenced. </dd>
- * <dt>
- * <code>"schema-type"</code></dt>
- * <dd>[<em>optional</em>] Represent a <code>DOMString</code> object containing an absolute URI 
- * and representing the type of the schema language used to validate a 
- * document against. Note that no lexical checking is done on the absolute 
- * URI.  If this parameter is not set, a default value may be provided by 
- * the implementation, based on the schema languages supported and on the 
- * schema language used at load time. If no value is provided, this 
- * parameter is <code>null</code>. 
- * <p ><b>Note:</b>  For XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , applications must use the value 
- * <code>"http://www.w3.org/2001/XMLSchema"</code>. For XML DTD [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], 
- * applications must use the value 
- * <code>"http://www.w3.org/TR/REC-xml"</code>. Other schema languages are 
- * outside the scope of the W3C and therefore should recommend an absolute 
- * URI in order to use this method. </dd>
- * <dt><code>"split-cdata-sections"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Split CDATA sections containing the CDATA section termination marker 
- * ']]&gt;'. When a CDATA section is split a warning is issued with a 
- * <code>DOMError.type</code> equals to 
- * <code>"cdata-sections-splitted"</code> and 
- * <code>DOMError.relatedData</code> equals to the first 
- * <code>CDATASection</code> node in document order resulting from the split.</dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>]Signal an error if a <code>CDATASection</code> contains an 
- * unrepresentable character.</dd>
- * </dl></dd>
- * <dt><code>"validate"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Require the validation against a schema (i.e. XML schema, DTD, any 
- * other type or representation of schema) of the document as it is being 
- * normalized as defined by [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. If 
- * validation errors are found, or no schema was found, the error handler is 
- * notified. Schema-normalized values will not be exposed according to the 
- * schema in used unless the parameter "datatype-normalization" is 
- * <code>true</code>.  This parameter will reevaluate: 
- * <ul>
- * <li> Attribute nodes with 
- * <code>Attr.specified</code> equals to <code>false</code>, as specified in 
- * the description of the <code>Attr</code> interface; 
- * </li>
- * <li> The value of the 
- * attribute <code>Text.isElementContentWhitespace</code> for all 
- * <code>Text</code> nodes; 
- * </li>
- * <li> The value of the attribute 
- * <code>Attr.isId</code> for all <code>Attr</code> nodes; 
- * </li>
- * <li> The attributes 
- * <code>Element.schemaTypeInfo</code> and <code>Attr.schemaTypeInfo</code>. 
- * </li>
- * </ul>
- * <p ><b>Note:</b>  "validate-if-schema" and "validate" are mutually 
- * exclusive, setting one of them to <code>true</code> will set the other 
- * one to <code>false</code>. Applications should also consider setting the 
- * parameter "well-formed" to <code>true</code>, which is the default for 
- * that option, when validating the document. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Do not accomplish schema processing, including the internal subset 
- * processing. Default attribute values information are kept. Note that 
- * validation might still happen if "validate-if-schema" is <code>true</code>
- * . </dd>
- * </dl></dd>
- * <dt><code>"validate-if-schema"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>]Enable validation only if a declaration for the document element can be 
- * found in a schema (independently of where it is found, i.e. XML schema, 
- * DTD, or any other type or representation of schema). If validation is 
- * enabled, this parameter has the same behavior as the parameter "validate" 
- * set to <code>true</code>. 
- * <p ><b>Note:</b>  "validate-if-schema" and "validate" are mutually 
- * exclusive, setting one of them to <code>true</code> will set the other 
- * one to <code>false</code>. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) No schema processing should be performed if the document has a schema, 
- * including internal subset processing. Default attribute values 
- * information are kept. Note that validation must still happen if "validate
- * " is <code>true</code>. </dd>
- * </dl></dd>
- * <dt><code>"well-formed"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Check if all nodes are XML well formed according to the XML version in 
- * use in <code>Document.xmlVersion</code>: 
- * <ul>
- * <li> check if the attribute 
- * <code>Node.nodeName</code> contains invalid characters according to its 
- * node type and generate a <code>DOMError</code> of type 
- * <code>"wf-invalid-character-in-node-name"</code>, with a 
- * <code>DOMError.SEVERITY_ERROR</code> severity, if necessary; 
- * </li>
- * <li> check if 
- * the text content inside <code>Attr</code>, <code>Element</code>, 
- * <code>Comment</code>, <code>Text</code>, <code>CDATASection</code> nodes 
- * for invalid characters and generate a <code>DOMError</code> of type 
- * <code>"wf-invalid-character"</code>, with a 
- * <code>DOMError.SEVERITY_ERROR</code> severity, if necessary; 
- * </li>
- * <li> check if 
- * the data inside <code>ProcessingInstruction</code> nodes for invalid 
- * characters and generate a <code>DOMError</code> of type 
- * <code>"wf-invalid-character"</code>, with a 
- * <code>DOMError.SEVERITY_ERROR</code> severity, if necessary; 
- * </li>
- * </ul></dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>optional</em>] Do not check for XML well-formedness. </dd>
- * </dl></dd>
- * </dl>
- * <p> The resolution of the system identifiers associated with entities is 
- * done using <code>Document.documentURI</code>. However, when the feature 
- * "LS" defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>DOM Level 3 Load and Save</a>]
- *  is supported by the DOM implementation, the parameter 
- * "resource-resolver" can also be used on <code>DOMConfiguration</code> 
- * objects attached to <code>Document</code> nodes. If this parameter is 
- * set, <code>Document.normalizeDocument()</code> will invoke the resource 
- * resolver instead of using <code>Document.documentURI</code>. 
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMConfiguration {
-    /**
-     * Set the value of a parameter.
-     * @param name The name of the parameter to set.
-     * @param value  The new value or <code>null</code> if the user wishes to 
-     *   unset the parameter. While the type of the value parameter is 
-     *   defined as <code>DOMUserData</code>, the object type must match the 
-     *   type defined by the definition of the parameter. For example, if 
-     *   the parameter is "error-handler", the value must be of type 
-     *   <code>DOMErrorHandler</code>. 
-     * @exception DOMException
-     *    NOT_FOUND_ERR: Raised when the parameter name is not recognized. 
-     *   <br> NOT_SUPPORTED_ERR: Raised when the parameter name is recognized 
-     *   but the requested value cannot be set. 
-     *   <br> TYPE_MISMATCH_ERR: Raised if the value type for this parameter 
-     *   name is incompatible with the expected value type. 
-     */
-    public void setParameter(String name, 
-                             Object value)
-                             throws DOMException;
-
-    /**
-     *  Return the value of a parameter if known. 
-     * @param name  The name of the parameter. 
-     * @return  The current object associated with the specified parameter or 
-     *   <code>null</code> if no object has been associated or if the 
-     *   parameter is not supported. 
-     * @exception DOMException
-     *    NOT_FOUND_ERR: Raised when the parameter name is not recognized. 
-     */
-    public Object getParameter(String name)
-                               throws DOMException;
-
-    /**
-     * Check if setting a parameter to a specific value is supported.
-     * @param name The name of the parameter to check.
-     * @param value  An object. if <code>null</code>, the returned value is 
-     *   <code>true</code>. 
-     * @return  <code>true</code> if the parameter could be successfully set 
-     *   to the specified value, or <code>false</code> if the parameter is 
-     *   not recognized or the requested value is not supported. This does 
-     *   not change the current value of the parameter itself. 
-     */
-    public boolean canSetParameter(String name, 
-                                   Object value);
-
-    /**
-     *  The list of the parameters supported by this 
-     * <code>DOMConfiguration</code> object and for which at least one value 
-     * can be set by the application. Note that this list can also contain 
-     * parameter names defined outside this specification. 
-     */
-    public DOMStringList getParameterNames();
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/DOMStringList.java b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/DOMStringList.java
deleted file mode 100644
index e6c348a..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/DOMStringList.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- *  The <code>DOMStringList</code> interface provides the abstraction of an 
- * ordered collection of <code>DOMString</code> values, without defining or 
- * constraining how this collection is implemented. The items in the 
- * <code>DOMStringList</code> are accessible via an integral index, starting 
- * from 0. 
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMStringList {
-    /**
-     *  Returns the <code>index</code>th item in the collection. If 
-     * <code>index</code> is greater than or equal to the number of 
-     * <code>DOMString</code>s in the list, this returns <code>null</code>. 
-     * @param index Index into the collection.
-     * @return  The <code>DOMString</code> at the <code>index</code>th 
-     *   position in the <code>DOMStringList</code>, or <code>null</code> if 
-     *   that is not a valid index. 
-     */
-    public String item(int index);
-
-    /**
-     * The number of <code>DOMString</code>s in the list. The range of valid 
-     * child node indices is 0 to <code>length-1</code> inclusive.
-     */
-    public int getLength();
-
-    /**
-     *  Test if a string is part of this <code>DOMStringList</code>. 
-     * @param str  The string to look for. 
-     * @return  <code>true</code> if the string has been found, 
-     *   <code>false</code> otherwise. 
-     */
-    public boolean contains(String str);
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/TypeInfo.java b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/TypeInfo.java
deleted file mode 100644
index 054f990..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/TypeInfo.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- *  The <code>TypeInfo</code> interface represents a type referenced from 
- * <code>Element</code> or <code>Attr</code> nodes, specified in the schemas 
- * associated with the document. The type is a pair of a namespace URI and 
- * name properties, and depends on the document's schema. 
- * <p> If the document's schema is an XML DTD [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], the values 
- * are computed as follows: 
- * <ul>
- * <li> If this type is referenced from an 
- * <code>Attr</code> node, <code>typeNamespace</code> is 
- * <code>"http://www.w3.org/TR/REC-xml"</code> and <code>typeName</code> 
- * represents the <b>[attribute type]</b> property in the [<a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204/'>XML Information Set</a>]
- * . If there is no declaration for the attribute, <code>typeNamespace</code>
- *  and <code>typeName</code> are <code>null</code>. 
- * </li>
- * <li> If this type is 
- * referenced from an <code>Element</code> node, <code>typeNamespace</code> 
- * and <code>typeName</code> are <code>null</code>. 
- * </li>
- * </ul>
- * <p> If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , the values are computed as follows using the post-schema-validation 
- * infoset contributions (also called PSVI contributions): 
- * <ul>
- * <li> If the <b>[validity]</b> property exists AND is <em>"invalid"</em> or <em>"notKnown"</em>: the {target namespace} and {name} properties of the declared type if 
- * available, otherwise <code>null</code>. 
- * <p ><b>Note:</b>  At the time of writing, the XML Schema specification does 
- * not require exposing the declared type. Thus, DOM implementations might 
- * choose not to provide type information if validity is not valid. 
- * </li>
- * <li> If the <b>[validity]</b> property exists and is <em>"valid"</em>: 
- * <ol>
- * <li> If <b>[member type definition]</b> exists: 
- * <ol>
- * <li>If {name} is not absent, then expose {name} and {target 
- * namespace} properties of the <b>[member type definition]</b> property;
- * </li>
- * <li>Otherwise, expose the namespace and local name of the 
- * corresponding anonymous type name.
- * </li>
- * </ol>
- * </li>
- * <li> If the <b>[type definition]</b> property exists: 
- * <ol>
- * <li>If {name} is not absent, then expose {name} and {target 
- * namespace} properties of the <b>[type definition]</b> property;
- * </li>
- * <li>Otherwise, expose the namespace and local name of the 
- * corresponding anonymous type name.
- * </li>
- * </ol> 
- * </li>
- * <li> If the <b>[member type definition anonymous]</b> exists: 
- * <ol>
- * <li>If it is false, then expose <b>[member type definition name]</b> and <b>[member type definition namespace]</b> properties;
- * </li>
- * <li>Otherwise, expose the namespace and local name of the 
- * corresponding anonymous type name.
- * </li>
- * </ol> 
- * </li>
- * <li> If the <b>[type definition anonymous]</b> exists: 
- * <ol>
- * <li>If it is false, then expose <b>[type definition name]</b> and <b>[type definition namespace]</b> properties;
- * </li>
- * <li>Otherwise, expose the namespace and local name of the 
- * corresponding anonymous type name.
- * </li>
- * </ol> 
- * </li>
- * </ol>
- * </li>
- * </ul>
- * <p ><b>Note:</b>  Other schema languages are outside the scope of the W3C 
- * and therefore should define how to represent their type systems using 
- * <code>TypeInfo</code>. 
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface TypeInfo {
-    /**
-     *  The name of a type declared for the associated element or attribute, 
-     * or <code>null</code> if unknown. 
-     */
-    public String getTypeName();
-
-    /**
-     *  The namespace of the type declared for the associated element or 
-     * attribute or <code>null</code> if the element does not have 
-     * declaration or if no namespace information is available. 
-     */
-    public String getTypeNamespace();
-
-    // DerivationMethods
-    /**
-     *  If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
-     * , this constant represents the derivation by <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-typeRestriction'>
-     * restriction</a> if complex types are involved, or a <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-restriction'>
-     * restriction</a> if simple types are involved. 
-     * <br>  The reference type definition is derived by restriction from the 
-     * other type definition if the other type definition is the same as the 
-     * reference type definition, or if the other type definition can be 
-     * reached recursively following the {base type definition} property 
-     * from the reference type definition, and all the <em>derivation methods</em> involved are restriction. 
-     */
-    public static final int DERIVATION_RESTRICTION    = 0x00000001;
-    /**
-     *  If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
-     * , this constant represents the derivation by <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-typeExtension'>
-     * extension</a>. 
-     * <br>  The reference type definition is derived by extension from the 
-     * other type definition if the other type definition can be reached 
-     * recursively following the {base type definition} property from the 
-     * reference type definition, and at least one of the <em>derivation methods</em> involved is an extension. 
-     */
-    public static final int DERIVATION_EXTENSION      = 0x00000002;
-    /**
-     *  If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
-     * , this constant represents the <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-union'>
-     * union</a> if simple types are involved. 
-     * <br> The reference type definition is derived by union from the other 
-     * type definition if there exists two type definitions T1 and T2 such 
-     * as the reference type definition is derived from T1 by 
-     * <code>DERIVATION_RESTRICTION</code> or 
-     * <code>DERIVATION_EXTENSION</code>, T2 is derived from the other type 
-     * definition by <code>DERIVATION_RESTRICTION</code>, T1 has {variety} <em>union</em>, and one of the {member type definitions} is T2. Note that T1 could be 
-     * the same as the reference type definition, and T2 could be the same 
-     * as the other type definition. 
-     */
-    public static final int DERIVATION_UNION          = 0x00000004;
-    /**
-     *  If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
-     * , this constant represents the <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-list'>list</a>. 
-     * <br> The reference type definition is derived by list from the other 
-     * type definition if there exists two type definitions T1 and T2 such 
-     * as the reference type definition is derived from T1 by 
-     * <code>DERIVATION_RESTRICTION</code> or 
-     * <code>DERIVATION_EXTENSION</code>, T2 is derived from the other type 
-     * definition by <code>DERIVATION_RESTRICTION</code>, T1 has {variety} <em>list</em>, and T2 is the {item type definition}. Note that T1 could be the same as 
-     * the reference type definition, and T2 could be the same as the other 
-     * type definition. 
-     */
-    public static final int DERIVATION_LIST           = 0x00000008;
-
-    /**
-     *  This method returns if there is a derivation between the reference 
-     * type definition, i.e. the <code>TypeInfo</code> on which the method 
-     * is being called, and the other type definition, i.e. the one passed 
-     * as parameters. 
-     * @param typeNamespaceArg  the namespace of the other type definition. 
-     * @param typeNameArg  the name of the other type definition. 
-     * @param derivationMethod  the type of derivation and conditions applied 
-     *   between two types, as described in the list of constants provided 
-     *   in this interface. 
-     * @return  If the document's schema is a DTD or no schema is associated 
-     *   with the document, this method will always return <code>false</code>
-     *   .  If the document's schema is an XML Schema, the method will 
-     *   <code>true</code> if the reference type definition is derived from 
-     *   the other type definition according to the derivation parameter. If 
-     *   the value of the parameter is <code>0</code> (no bit is set to 
-     *   <code>1</code> for the <code>derivationMethod</code> parameter), 
-     *   the method will return <code>true</code> if the other type 
-     *   definition can be reached by recursing any combination of {base 
-     *   type definition}, {item type definition}, or {member type 
-     *   definitions} from the reference type definition. 
-     */
-    public boolean isDerivedFrom(String typeNamespaceArg, 
-                                 String typeNameArg, 
-                                 int derivationMethod);
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/UserDataHandler.java b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/UserDataHandler.java
deleted file mode 100644
index a16ea73..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/UserDataHandler.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * When associating an object to a key on a node using 
- * <code>Node.setUserData()</code> the application can provide a handler 
- * that gets called when the node the object is associated to is being 
- * cloned, imported, or renamed. This can be used by the application to 
- * implement various behaviors regarding the data it associates to the DOM 
- * nodes. This interface defines that handler. 
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface UserDataHandler {
-    // OperationType
-    /**
-     * The node is cloned, using <code>Node.cloneNode()</code>.
-     */
-    public static final short NODE_CLONED               = 1;
-    /**
-     * The node is imported, using <code>Document.importNode()</code>.
-     */
-    public static final short NODE_IMPORTED             = 2;
-    /**
-     * The node is deleted.
-     * <p ><b>Note:</b> This may not be supported or may not be reliable in 
-     * certain environments, such as Java, where the implementation has no 
-     * real control over when objects are actually deleted.
-     */
-    public static final short NODE_DELETED              = 3;
-    /**
-     * The node is renamed, using <code>Document.renameNode()</code>.
-     */
-    public static final short NODE_RENAMED              = 4;
-    /**
-     * The node is adopted, using <code>Document.adoptNode()</code>.
-     */
-    public static final short NODE_ADOPTED              = 5;
-
-    /**
-     * This method is called whenever the node for which this handler is 
-     * registered is imported or cloned.
-     * <br> DOM applications must not raise exceptions in a 
-     * <code>UserDataHandler</code>. The effect of throwing exceptions from 
-     * the handler is DOM implementation dependent. 
-     * @param operation Specifies the type of operation that is being 
-     *   performed on the node.
-     * @param key Specifies the key for which this handler is being called. 
-     * @param data Specifies the data for which this handler is being called. 
-     * @param src Specifies the node being cloned, adopted, imported, or 
-     *   renamed. This is <code>null</code> when the node is being deleted.
-     * @param dst Specifies the node newly created if any, or 
-     *   <code>null</code>.
-     */
-    public void handle(short operation, 
-                       String key, 
-                       Object data, 
-                       Node src, 
-                       Node dst);
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/package.html b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/package.html
deleted file mode 100644
index cbc3338..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/package.html
+++ /dev/null
@@ -1,4 +0,0 @@
-<html>
-This package contains unmodified sources provided by 
- http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.zip
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/COPYRIGHT.html b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/COPYRIGHT.html
deleted file mode 100644
index 26049b7..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/COPYRIGHT.html
+++ /dev/null
@@ -1,100 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
-                      "http://www.w3.org/TR/REC-html40/loose.dtd">
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-    <title>W3C IPR SOFTWARE NOTICE</title>
-  </head>
-  <body bgcolor="#FFFFFF" text="#000000">
-    <h1>
-      W3C IPR SOFTWARE NOTICE
-    </h1>
-    <h3>
-      Copyright &copy; 2000 <loc href="http://www.w3.org/">World Wide Web
-      Consortium</loc>, (<loc href="http://www.lcs.mit.edu/">Massachusetts
-      Institute of Technology</loc>, <loc href="http://www.inria.fr/">Institut
-      National de Recherche en Informatique et en Automatique</loc>, <loc
-      href="http://www.keio.ac.jp/">Keio University</loc>). All Rights
-      Reserved.
-    </h3>
-    <p>
-      The DOM bindings are published under the W3C Software Copyright Notice
-      and License. The software license requires "Notice of any changes or
-      modifications to the W3C files, including the date changes were made."
-      Consequently, modified versions of the DOM bindings must document that
-      they do not conform to the W3C standard; in the case of the IDL binding,
-      the pragma prefix can no longer be 'w3c.org'; in the case of the Java
-      binding, the package names can no longer be in the 'org.w3c' package.
-    </p>
-    <p>
-      <b>Note:</b> The original version of the W3C Software Copyright Notice
-      and License could be found at <a
-      href='http://www.w3.org/Consortium/Legal/copyright-software-19980720'>http://www.w3.org/Consortium/Legal/copyright-software-19980720</a>
-    </p>
-    <h3>
-      Copyright &copy; 1994-2000 <a href="http://www.w3.org/">World Wide Web
-      Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
-      Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
-      National de Recherche en Informatique et en Automatique</a>, <a
-      href="http://www.keio.ac.jp/">Keio University</a>). All Rights
-      Reserved. http://www.w3.org/Consortium/Legal/
-    </h3>
-    <p>
-      This W3C work (including software, documents, or other related items) is
-      being provided by the copyright holders under the following license. By
-      obtaining, using and/or copying this work, you (the licensee) agree that
-      you have read, understood, and will comply with the following terms and
-      conditions:
-    </p>
-    <p>
-      Permission to use, copy, and modify this software and its documentation,
-      with or without modification,&nbsp; for any purpose and without fee or
-      royalty is hereby granted, provided that you include the following on ALL
-      copies of the software and documentation or portions thereof, including
-      modifications, that you make:
-    </p>
-    <ol>
-      <li>
-	The full text of this NOTICE in a location viewable to users of the
-	redistributed or derivative work.
-      </li>
-      <li>
-	Any pre-existing intellectual property disclaimers, notices, or terms
-	and conditions. If none exist, a short notice of the following form
-	(hypertext is preferred, text is permitted) should be used within the
-	body of any redistributed or derivative code: "Copyright &copy;
-	[$date-of-software] <a href="http://www.w3.org/">World Wide Web
-	Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
-	Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
-	National de Recherche en Informatique et en Automatique</a>, <a
-	href="http://www.keio.ac.jp/">Keio University</a>).  All Rights
-	Reserved. http://www.w3.org/Consortium/Legal/"
-      </li>
-      <li>
-	Notice of any changes or modifications to the W3C files, including the
-	date changes were made. (We recommend you provide URIs to the location
-	from which the code is derived.)
-      </li>
-    </ol>
-    <p>
-      THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
-      HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
-      INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS
-      FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR
-      DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
-      TRADEMARKS OR OTHER RIGHTS.
-    </p>
-    <p>
-      COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
-      CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
-      DOCUMENTATION.
-    </p>
-    <p>
-      The name and trademarks of copyright holders may NOT be used in
-      advertising or publicity pertaining to the software without specific,
-      written prior permission. Title to copyright in this software and any
-      associated documentation will at all times remain with copyright
-      holders.
-    </p>
-  </body>
-</html>
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/DocumentRange.java b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/DocumentRange.java
deleted file mode 100644
index b72a1c1..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/DocumentRange.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.ranges;
-
-/**
- * <p>
- * See also the <a
- * href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document
- * Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * 
- * @since DOM Level 2
- */
-public interface DocumentRange {
-	/**
-	 * This interface can be obtained from the object implementing the
-	 * <code>Document</code> interface using binding-specific casting
-	 * methods.
-	 * 
-	 * @return The initial state of the Range returned from this method is
-	 *         such that both of its boundary-points are positioned at the
-	 *         beginning of the corresponding Document, before any content.
-	 *         The Range returned can only be used to select content
-	 *         associated with this Document, or with DocumentFragments and
-	 *         Attrs for which this Document is the <code>ownerDocument</code>.
-	 */
-	public Range createRange();
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/Range.java b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/Range.java
deleted file mode 100644
index 170fc60..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/Range.java
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.ranges;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DOMException;
-
-/**
- * <p>
- * See also the <a
- * href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document
- * Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * 
- * @since DOM Level 2
- */
-public interface Range {
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	// CompareHow
-	/**
-	 * Compare start boundary-point of <code>sourceRange</code> to start
-	 * boundary-point of Range on which <code>compareBoundaryPoints</code>
-	 * is invoked.
-	 */
-	public static final short START_TO_START = 0;
-	/**
-	 * Compare start boundary-point of <code>sourceRange</code> to end
-	 * boundary-point of Range on which <code>compareBoundaryPoints</code>
-	 * is invoked.
-	 */
-	public static final short START_TO_END = 1;
-	/**
-	 * Compare end boundary-point of <code>sourceRange</code> to end
-	 * boundary-point of Range on which <code>compareBoundaryPoints</code>
-	 * is invoked.
-	 */
-	public static final short END_TO_END = 2;
-	/**
-	 * Compare end boundary-point of <code>sourceRange</code> to start
-	 * boundary-point of Range on which <code>compareBoundaryPoints</code>
-	 * is invoked.
-	 */
-	public static final short END_TO_START = 3;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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 DOMException, RangeException;
-
-	/**
-	 * 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 DOMException, RangeException;
-
-	/**
-	 * 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;
-
-	/**
-	 * Returns the contents of a Range as a string. This string contains only
-	 * the data characters, not any markup.
-	 * 
-	 * @return The contents of the Range.
-	 * @exception DOMException
-	 *                INVALID_STATE_ERR: Raised if <code>detach()</code> has
-	 *                already been invoked on this object.
-	 */
-	public String toString() throws DOMException;
-
-	/**
-	 * 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;
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/RangeException.java b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/RangeException.java
deleted file mode 100644
index 7cfff1d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/RangeException.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.ranges;
-
-/**
- * Range operations may throw a <code>RangeException</code> as specified in
- * their method descriptions.
- * <p>
- * See also the <a
- * href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document
- * Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * 
- * @since DOM Level 2
- */
-public class RangeException extends RuntimeException {
-	/**
-	 * Default <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
-	public RangeException(short code, String message) {
-		super(message);
-		this.code = code;
-	}
-
-	public short code;
-	// RangeExceptionCode
-	/**
-	 * If the boundary-points of a Range do not meet specific requirements.
-	 */
-	public static final short BAD_BOUNDARYPOINTS_ERR = 1;
-	/**
-	 * If the container of an boundary-point of a Range is being set to either
-	 * a node of an invalid type or a node with an ancestor of an invalid
-	 * type.
-	 */
-	public static final short INVALID_NODE_TYPE_ERR = 2;
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/package.html b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/package.html
deleted file mode 100644
index d8fbae6..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/ranges/package.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<html>
-This package contains unmodified sources provided by http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113/java-binding.zip
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/COPYRIGHT.html b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/COPYRIGHT.html
deleted file mode 100644
index 26049b7..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/COPYRIGHT.html
+++ /dev/null
@@ -1,100 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
-                      "http://www.w3.org/TR/REC-html40/loose.dtd">
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-    <title>W3C IPR SOFTWARE NOTICE</title>
-  </head>
-  <body bgcolor="#FFFFFF" text="#000000">
-    <h1>
-      W3C IPR SOFTWARE NOTICE
-    </h1>
-    <h3>
-      Copyright &copy; 2000 <loc href="http://www.w3.org/">World Wide Web
-      Consortium</loc>, (<loc href="http://www.lcs.mit.edu/">Massachusetts
-      Institute of Technology</loc>, <loc href="http://www.inria.fr/">Institut
-      National de Recherche en Informatique et en Automatique</loc>, <loc
-      href="http://www.keio.ac.jp/">Keio University</loc>). All Rights
-      Reserved.
-    </h3>
-    <p>
-      The DOM bindings are published under the W3C Software Copyright Notice
-      and License. The software license requires "Notice of any changes or
-      modifications to the W3C files, including the date changes were made."
-      Consequently, modified versions of the DOM bindings must document that
-      they do not conform to the W3C standard; in the case of the IDL binding,
-      the pragma prefix can no longer be 'w3c.org'; in the case of the Java
-      binding, the package names can no longer be in the 'org.w3c' package.
-    </p>
-    <p>
-      <b>Note:</b> The original version of the W3C Software Copyright Notice
-      and License could be found at <a
-      href='http://www.w3.org/Consortium/Legal/copyright-software-19980720'>http://www.w3.org/Consortium/Legal/copyright-software-19980720</a>
-    </p>
-    <h3>
-      Copyright &copy; 1994-2000 <a href="http://www.w3.org/">World Wide Web
-      Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
-      Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
-      National de Recherche en Informatique et en Automatique</a>, <a
-      href="http://www.keio.ac.jp/">Keio University</a>). All Rights
-      Reserved. http://www.w3.org/Consortium/Legal/
-    </h3>
-    <p>
-      This W3C work (including software, documents, or other related items) is
-      being provided by the copyright holders under the following license. By
-      obtaining, using and/or copying this work, you (the licensee) agree that
-      you have read, understood, and will comply with the following terms and
-      conditions:
-    </p>
-    <p>
-      Permission to use, copy, and modify this software and its documentation,
-      with or without modification,&nbsp; for any purpose and without fee or
-      royalty is hereby granted, provided that you include the following on ALL
-      copies of the software and documentation or portions thereof, including
-      modifications, that you make:
-    </p>
-    <ol>
-      <li>
-	The full text of this NOTICE in a location viewable to users of the
-	redistributed or derivative work.
-      </li>
-      <li>
-	Any pre-existing intellectual property disclaimers, notices, or terms
-	and conditions. If none exist, a short notice of the following form
-	(hypertext is preferred, text is permitted) should be used within the
-	body of any redistributed or derivative code: "Copyright &copy;
-	[$date-of-software] <a href="http://www.w3.org/">World Wide Web
-	Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
-	Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
-	National de Recherche en Informatique et en Automatique</a>, <a
-	href="http://www.keio.ac.jp/">Keio University</a>).  All Rights
-	Reserved. http://www.w3.org/Consortium/Legal/"
-      </li>
-      <li>
-	Notice of any changes or modifications to the W3C files, including the
-	date changes were made. (We recommend you provide URIs to the location
-	from which the code is derived.)
-      </li>
-    </ol>
-    <p>
-      THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
-      HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
-      INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS
-      FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR
-      DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
-      TRADEMARKS OR OTHER RIGHTS.
-    </p>
-    <p>
-      COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
-      CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
-      DOCUMENTATION.
-    </p>
-    <p>
-      The name and trademarks of copyright holders may NOT be used in
-      advertising or publicity pertaining to the software without specific,
-      written prior permission. Title to copyright in this software and any
-      associated documentation will at all times remain with copyright
-      holders.
-    </p>
-  </body>
-</html>
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/DocumentTraversal.java b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/DocumentTraversal.java
deleted file mode 100644
index b56d0fc..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/DocumentTraversal.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.traversal;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * <code>DocumentTraversal</code> contains methods that create iterators and
- * tree-walkers to traverse a node and its children in document order (depth
- * first, pre-order traversal, which is equivalent to the order in which the
- * start tags occur in the text representation of the document). In DOMs which
- * support the Traversal feature, <code>DocumentTraversal</code> will be
- * implemented by the same objects that implement the Document interface.
- * <p>
- * See also the <a
- * href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document
- * Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * 
- * @since DOM Level 2
- */
-public interface DocumentTraversal {
-	/**
-	 * Create a new <code>NodeIterator</code> over the subtree rooted at the
-	 * specified node.
-	 * 
-	 * @param rootThe
-	 *            node which will be iterated together with its children. The
-	 *            iterator is initially positioned just before this node. The
-	 *            <code>whatToShow</code> flags and the filter, if any, are
-	 *            not considered when setting this position. The root must not
-	 *            be <code>null</code>.
-	 * @param whatToShowThis
-	 *            flag specifies which node types may appear in the logical
-	 *            view of the tree presented by the iterator. See the
-	 *            description of <code>NodeFilter</code> for the set of
-	 *            possible <code>SHOW_</code> values.These flags can be
-	 *            combined using <code>OR</code>.
-	 * @param filterThe
-	 *            <code>NodeFilter</code> to be used with this
-	 *            <code>TreeWalker</code>, or <code>null</code> to
-	 *            indicate no filter.
-	 * @param entityReferenceExpansionThe
-	 *            value of this flag determines whether entity reference nodes
-	 *            are expanded.
-	 * @return The newly created <code>NodeIterator</code>.
-	 * @exception DOMException
-	 *                NOT_SUPPORTED_ERR: Raised if the specified
-	 *                <code>root</code> is <code>null</code>.
-	 */
-	public NodeIterator createNodeIterator(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) throws DOMException;
-
-	/**
-	 * Create a new <code>TreeWalker</code> over the subtree rooted at the
-	 * specified node.
-	 * 
-	 * @param rootThe
-	 *            node which will serve as the <code>root</code> for the
-	 *            <code>TreeWalker</code>. The <code>whatToShow</code>
-	 *            flags and the <code>NodeFilter</code> are not considered
-	 *            when setting this value; any node type will be accepted as
-	 *            the <code>root</code>. The <code>currentNode</code> of
-	 *            the <code>TreeWalker</code> is initialized to this node,
-	 *            whether or not it is visible. The <code>root</code>
-	 *            functions as a stopping point for traversal methods that
-	 *            look upward in the document structure, such as
-	 *            <code>parentNode</code> and nextNode. The
-	 *            <code>root</code> must not be <code>null</code>.
-	 * @param whatToShowThis
-	 *            flag specifies which node types may appear in the logical
-	 *            view of the tree presented by the tree-walker. See the
-	 *            description of <code>NodeFilter</code> for the set of
-	 *            possible SHOW_ values.These flags can be combined using
-	 *            <code>OR</code>.
-	 * @param filterThe
-	 *            <code>NodeFilter</code> to be used with this
-	 *            <code>TreeWalker</code>, or <code>null</code> to
-	 *            indicate no filter.
-	 * @param entityReferenceExpansionIf
-	 *            this flag is false, the contents of
-	 *            <code>EntityReference</code> nodes are not presented in
-	 *            the logical view.
-	 * @return The newly created <code>TreeWalker</code>.
-	 * @exception DOMException
-	 *                NOT_SUPPORTED_ERR: Raised if the specified
-	 *                <code>root</code> is <code>null</code>.
-	 */
-	public TreeWalker createTreeWalker(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) throws DOMException;
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/NodeFilter.java b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/NodeFilter.java
deleted file mode 100644
index 5badf1d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/NodeFilter.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.traversal;
-
-import org.w3c.dom.Node;
-
-/**
- * Filters are objects that know how to "filter out" nodes. If a
- * <code>NodeIterator</code> or <code>TreeWalker</code> is given a
- * <code>NodeFilter</code>, it applies the filter before it returns the
- * next node. If the filter says to accept the node, the traversal logic
- * returns it; otherwise, traversal looks for the next node and pretends that
- * the node that was rejected was not there.
- * <p>
- * The DOM does not provide any filters. <code>NodeFilter</code> is just an
- * interface that users can implement to provide their own filters.
- * <p>
- * <code>NodeFilters</code> do not need to know how to traverse from node to
- * node, nor do they need to know anything about the data structure that is
- * being traversed. This makes it very easy to write filters, since the only
- * thing they have to know how to do is evaluate a single node. One filter may
- * be used with a number of different kinds of traversals, encouraging code
- * reuse.
- * <p>
- * See also the <a
- * href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document
- * Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * 
- * @since DOM Level 2
- */
-public interface NodeFilter {
-	// Constants returned by acceptNode
-	/**
-	 * Accept the node. Navigation methods defined for
-	 * <code>NodeIterator</code> or <code>TreeWalker</code> will return
-	 * this node.
-	 */
-	public static final short FILTER_ACCEPT = 1;
-	/**
-	 * Reject the node. Navigation methods defined for
-	 * <code>NodeIterator</code> or <code>TreeWalker</code> will not
-	 * return this node. For <code>TreeWalker</code>, the children of this
-	 * node will also be rejected. <code>NodeIterators</code> treat this as
-	 * a synonym for <code>FILTER_SKIP</code>.
-	 */
-	public static final short FILTER_REJECT = 2;
-	/**
-	 * Skip this single node. Navigation methods defined for
-	 * <code>NodeIterator</code> or <code>TreeWalker</code> will not
-	 * return this node. For both <code>NodeIterator</code> and
-	 * <code>TreeWalker</code>, the children of this node will still be
-	 * considered.
-	 */
-	public static final short FILTER_SKIP = 3;
-
-	// Constants for whatToShow
-	/**
-	 * Show all <code>Nodes</code>.
-	 */
-	public static final int SHOW_ALL = 0xFFFFFFFF;
-	/**
-	 * Show <code>Element</code> nodes.
-	 */
-	public static final int SHOW_ELEMENT = 0x00000001;
-	/**
-	 * Show <code>Attr</code> nodes. This is meaningful only when creating
-	 * an iterator or tree-walker with an attribute node as its
-	 * <code>root</code>; in this case, it means that the attribute node
-	 * will appear in the first position of the iteration or traversal. Since
-	 * attributes are never children of other nodes, they do not appear when
-	 * traversing over the document tree.
-	 */
-	public static final int SHOW_ATTRIBUTE = 0x00000002;
-	/**
-	 * Show <code>Text</code> nodes.
-	 */
-	public static final int SHOW_TEXT = 0x00000004;
-	/**
-	 * Show <code>CDATASection</code> nodes.
-	 */
-	public static final int SHOW_CDATA_SECTION = 0x00000008;
-	/**
-	 * Show <code>EntityReference</code> nodes.
-	 */
-	public static final int SHOW_ENTITY_REFERENCE = 0x00000010;
-	/**
-	 * Show <code>Entity</code> nodes. This is meaningful only when creating
-	 * an iterator or tree-walker with an<code> Entity</code> node as its
-	 * <code>root</code>; in this case, it means that the
-	 * <code>Entity</code> node will appear in the first position of the
-	 * traversal. Since entities are not part of the document tree, they do
-	 * not appear when traversing over the document tree.
-	 */
-	public static final int SHOW_ENTITY = 0x00000020;
-	/**
-	 * Show <code>ProcessingInstruction</code> nodes.
-	 */
-	public static final int SHOW_PROCESSING_INSTRUCTION = 0x00000040;
-	/**
-	 * Show <code>Comment</code> nodes.
-	 */
-	public static final int SHOW_COMMENT = 0x00000080;
-	/**
-	 * Show <code>Document</code> nodes.
-	 */
-	public static final int SHOW_DOCUMENT = 0x00000100;
-	/**
-	 * Show <code>DocumentType</code> nodes.
-	 */
-	public static final int SHOW_DOCUMENT_TYPE = 0x00000200;
-	/**
-	 * Show <code>DocumentFragment</code> nodes.
-	 */
-	public static final int SHOW_DOCUMENT_FRAGMENT = 0x00000400;
-	/**
-	 * Show <code>Notation</code> nodes. This is meaningful only when
-	 * creating an iterator or tree-walker with a <code>Notation</code> node
-	 * as its <code>root</code>; in this case, it means that the
-	 * <code>Notation</code> node will appear in the first position of the
-	 * traversal. Since notations are not part of the document tree, they do
-	 * not appear when traversing over the document tree.
-	 */
-	public static final int SHOW_NOTATION = 0x00000800;
-
-	/**
-	 * Test whether a specified node is visible in the logical view of a
-	 * <code>TreeWalker</code> or <code>NodeIterator</code>. This
-	 * function will be called by the implementation of
-	 * <code>TreeWalker</code> and <code>NodeIterator</code>; it is not
-	 * normally called directly from user code. (Though you could do so if you
-	 * wanted to use the same filter to guide your own application logic.)
-	 * 
-	 * @param nThe
-	 *            node to check to see if it passes the filter or not.
-	 * @return a constant to determine whether the node is accepted, rejected,
-	 *         or skipped, as defined above.
-	 */
-	public short acceptNode(Node n);
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/NodeIterator.java b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/NodeIterator.java
deleted file mode 100644
index 8616e70..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/NodeIterator.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.traversal;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * <code>Iterators</code> are used to step through a set of nodes, e.g. the
- * set of nodes in a <code>NodeList</code>, the document subtree governed
- * by a particular <code>Node</code>, the results of a query, or any other
- * set of nodes. The set of nodes to be iterated is determined by the
- * implementation of the <code>NodeIterator</code>. DOM Level 2 specifies a
- * single <code>NodeIterator</code> implementation for document-order
- * traversal of a document subtree. Instances of these iterators are created
- * by calling <code>DocumentTraversal</code>
- * <code>.createNodeIterator()</code>.
- * <p>
- * See also the <a
- * href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document
- * Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * 
- * @since DOM Level 2
- */
-public interface NodeIterator {
-	/**
-	 * The root node of the <code>NodeIterator</code>, as specified when it
-	 * was created.
-	 */
-	public Node getRoot();
-
-	/**
-	 * 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();
-
-	/**
-	 * The <code>NodeFilter</code> used to screen nodes.
-	 */
-	public NodeFilter getFilter();
-
-	/**
-	 * 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();
-
-	/**
-	 * 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;
-
-	/**
-	 * 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;
-
-	/**
-	 * 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();
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/TreeWalker.java b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/TreeWalker.java
deleted file mode 100644
index 0ec2e62..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/TreeWalker.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.traversal;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * <code>TreeWalker</code> objects are used to navigate a document tree or
- * subtree using the view of the document defined by their
- * <code>whatToShow</code> flags and filter (if any). Any function which
- * performs navigation using a <code>TreeWalker</code> will automatically
- * support any view defined by a <code>TreeWalker</code>.
- * <p>
- * Omitting nodes from the logical view of a subtree can result in a structure
- * that is substantially different from the same subtree in the complete,
- * unfiltered document. Nodes that are siblings in the <code>TreeWalker</code>
- * view may be children of different, widely separated nodes in the original
- * view. For instance, consider a <code>NodeFilter</code> that skips all
- * nodes except for Text nodes and the root node of a document. In the logical
- * view that results, all text nodes will be siblings and appear as direct
- * children of the root node, no matter how deeply nested the structure of the
- * original document.
- * <p>
- * See also the <a
- * href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document
- * Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * 
- * @since DOM Level 2
- */
-public interface TreeWalker {
-	/**
-	 * The <code>root</code> node of the <code>TreeWalker</code>, as
-	 * specified when it was created.
-	 */
-	public Node getRoot();
-
-	/**
-	 * This attribute determines which node types are presented via the
-	 * <code>TreeWalker</code>. 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();
-
-	/**
-	 * The filter used to screen nodes.
-	 */
-	public NodeFilter getFilter();
-
-	/**
-	 * The value of this flag determines whether the children of entity
-	 * reference nodes are visible to the <code>TreeWalker</code>. If
-	 * false, they and their descendants will be rejected. Note that this
-	 * rejection takes precedence over <code>whatToShow</code> and the
-	 * filter, if any. <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
-	 * <code>TreeWalker</code>. 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();
-
-	/**
-	 * The node at which the <code>TreeWalker</code> is currently
-	 * positioned. <br>
-	 * Alterations to the DOM tree may cause the current node to no longer be
-	 * accepted by the <code>TreeWalker</code>'s associated filter.
-	 * <code>currentNode</code> may also be explicitly set to any node,
-	 * whether or not it is within the subtree specified by the
-	 * <code>root</code> node or would be accepted by the filter and
-	 * <code>whatToShow</code> flags. Further traversal occurs relative to
-	 * <code>currentNode</code> even if it is not part of the current view,
-	 * by applying the filters in the requested direction; if no traversal is
-	 * possible, <code>currentNode</code> is not changed.
-	 * 
-	 * @exception DOMException
-	 *                NOT_SUPPORTED_ERR: Raised if an attempt is made to set
-	 *                <code>currentNode</code> to <code>null</code>.
-	 */
-	public Node getCurrentNode();
-
-	public void setCurrentNode(Node currentNode) throws DOMException;
-
-	/**
-	 * Moves to and returns the closest visible ancestor node of the current
-	 * node. If the search for <code>parentNode</code> attempts to step
-	 * upward from the <code>TreeWalker</code>'s <code>root</code> node,
-	 * or if it fails to find a visible ancestor node, this method retains the
-	 * current position and returns <code>null</code>.
-	 * 
-	 * @return The new parent node, or <code>null</code> if the current node
-	 *         has no parent in the <code>TreeWalker</code>'s logical view.
-	 */
-	public Node parentNode();
-
-	/**
-	 * Moves the <code>TreeWalker</code> to the first visible child of the
-	 * current node, and returns the new node. If the current node has no
-	 * visible children, returns <code>null</code>, and retains the current
-	 * node.
-	 * 
-	 * @return The new node, or <code>null</code> if the current node has no
-	 *         visible children in the <code>TreeWalker</code>'s logical
-	 *         view.
-	 */
-	public Node firstChild();
-
-	/**
-	 * Moves the <code>TreeWalker</code> to the last visible child of the
-	 * current node, and returns the new node. If the current node has no
-	 * visible children, returns <code>null</code>, and retains the current
-	 * node.
-	 * 
-	 * @return The new node, or <code>null</code> if the current node has no
-	 *         children in the <code>TreeWalker</code>'s logical view.
-	 */
-	public Node lastChild();
-
-	/**
-	 * Moves the <code>TreeWalker</code> to the previous sibling of the
-	 * current node, and returns the new node. If the current node has no
-	 * visible previous sibling, returns <code>null</code>, and retains the
-	 * current node.
-	 * 
-	 * @return The new node, or <code>null</code> if the current node has no
-	 *         previous sibling. in the <code>TreeWalker</code>'s logical
-	 *         view.
-	 */
-	public Node previousSibling();
-
-	/**
-	 * Moves the <code>TreeWalker</code> to the next sibling of the current
-	 * node, and returns the new node. If the current node has no visible next
-	 * sibling, returns <code>null</code>, and retains the current node.
-	 * 
-	 * @return The new node, or <code>null</code> if the current node has no
-	 *         next sibling. in the <code>TreeWalker</code>'s logical view.
-	 */
-	public Node nextSibling();
-
-	/**
-	 * Moves the <code>TreeWalker</code> to the previous visible node in
-	 * document order relative to the current node, and returns the new node.
-	 * If the current node has no previous node, or if the search for
-	 * <code>previousNode</code> attempts to step upward from the
-	 * <code>TreeWalker</code>'s <code>root</code> node, returns
-	 * <code>null</code>, and retains the current node.
-	 * 
-	 * @return The new node, or <code>null</code> if the current node has no
-	 *         previous node in the <code>TreeWalker</code>'s logical view.
-	 */
-	public Node previousNode();
-
-	/**
-	 * Moves the <code>TreeWalker</code> to the next visible node in
-	 * document order relative to the current node, and returns the new node.
-	 * If the current node has no next node, or if the search for nextNode
-	 * attempts to step upward from the <code>TreeWalker</code>'s
-	 * <code>root</code> node, returns <code>null</code>, and retains the
-	 * current node.
-	 * 
-	 * @return The new node, or <code>null</code> if the current node has no
-	 *         next node in the <code>TreeWalker</code>'s logical view.
-	 */
-	public Node nextNode();
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/package.html b/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/package.html
deleted file mode 100644
index d8fbae6..0000000
--- a/bundles/org.eclipse.wst.xml.core/src/org/w3c/dom/traversal/package.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<html>
-This package contains unmodified sources provided by http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113/java-binding.zip
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/.classpath b/bundles/org.eclipse.wst.xml.ui/.classpath
deleted file mode 100644
index 24be42b..0000000
--- a/bundles/org.eclipse.wst.xml.ui/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="src-validation"/>
-	<classpathentry kind="src" path="src-multipage"/>
-	<classpathentry kind="src" path="src-wizards"/>
-	<classpathentry kind="src" path="src-catalog"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xml.ui/.cvsignore b/bundles/org.eclipse.wst.xml.ui/.cvsignore
deleted file mode 100644
index 7e19fc0..0000000
--- a/bundles/org.eclipse.wst.xml.ui/.cvsignore
+++ /dev/null
@@ -1,9 +0,0 @@
-bin
-temp.folder
-build.xml
-xmleditor.jar
-org.eclipse.wst.xml.ui_1.0.0.jar
-org.eclipse.wst.xml.ui_1.0.0.zip
-xmleditorsrc.zip
-@dot
-src.zip
diff --git a/bundles/org.eclipse.wst.xml.ui/.options b/bundles/org.eclipse.wst.xml.ui/.options
deleted file mode 100644
index 5acae8f..0000000
--- a/bundles/org.eclipse.wst.xml.ui/.options
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.wst.xml.ui/projectionperf=false
diff --git a/bundles/org.eclipse.wst.xml.ui/.project b/bundles/org.eclipse.wst.xml.ui/.project
deleted file mode 100644
index 50dc4a8..0000000
--- a/bundles/org.eclipse.wst.xml.ui/.project
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.xml.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.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 6e0c0a1..0000000
--- a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,69 +0,0 @@
-#Sat Oct 01 01:37:56 EDT 2005
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-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.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-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.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
-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=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-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.missingSerialVersion=warning
-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=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-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.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.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index f4d5786..0000000
--- a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sat Oct 01 01:37:56 EDT 2005
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 42fb716..0000000
--- a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Fri May 27 23:56:32 EDT 2005
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=1
-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.xml.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index a2bcfb9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,57 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.xml.ui; singleton:=true
-Bundle-Version: 1.0.1.qualifier
-Bundle-Activator: org.eclipse.wst.xml.ui.internal.XMLUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.xml.ui,
- org.eclipse.wst.xml.ui.internal,
- org.eclipse.wst.xml.ui.internal.actions,
- org.eclipse.wst.xml.ui.internal.autoedit,
- org.eclipse.wst.xml.ui.internal.catalog,
- org.eclipse.wst.xml.ui.internal.contentassist,
- org.eclipse.wst.xml.ui.internal.contentoutline,
- org.eclipse.wst.xml.ui.internal.correction,
- org.eclipse.wst.xml.ui.internal.dialogs,
- org.eclipse.wst.xml.ui.internal.dnd,
- org.eclipse.wst.xml.ui.internal.doubleclick,
- org.eclipse.wst.xml.ui.internal.editor,
- org.eclipse.wst.xml.ui.internal.hyperlink,
- org.eclipse.wst.xml.ui.internal.nsedit,
- org.eclipse.wst.xml.ui.internal.preferences,
- org.eclipse.wst.xml.ui.internal.projection,
- org.eclipse.wst.xml.ui.internal.properties,
- org.eclipse.wst.xml.ui.internal.provisional,
- org.eclipse.wst.xml.ui.internal.registry,
- org.eclipse.wst.xml.ui.internal.search,
-  org.eclipse.wst.xml.ui.internal.selection,
- org.eclipse.wst.xml.ui.internal.style,
- org.eclipse.wst.xml.ui.internal.tabletree,
- org.eclipse.wst.xml.ui.internal.taginfo,
- org.eclipse.wst.xml.ui.internal.templates,
- org.eclipse.wst.xml.ui.internal.text,
- org.eclipse.wst.xml.ui.internal.util,
- org.eclipse.wst.xml.ui.internal.validation,
- org.eclipse.wst.xml.ui.internal.validation.core,
- org.eclipse.wst.xml.ui.internal.validation.core.errorinfo,
- org.eclipse.wst.xml.ui.internal.wizards,
- org.eclipse.wst.xml.ui.internal.wizards.icons,
- org.eclipse.wst.xml.ui.views.contentoutline,
- org.eclipse.wst.xml.ui.views.properties
-Require-Bundle: org.eclipse.ui.ide,
- org.eclipse.ui.views,
- org.eclipse.jface.text,
- org.eclipse.ui.workbench.texteditor,
- org.eclipse.ui.editors,
- org.eclipse.wst.sse.ui,
- org.eclipse.wst.sse.core,
- org.eclipse.ui,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.wst.common.uriresolver,
- org.eclipse.wst.xml.core,
- org.eclipse.wst.common.ui,
- org.eclipse.wst.validation
-Eclipse-AutoStart: true
diff --git a/bundles/org.eclipse.wst.xml.ui/README.txt b/bundles/org.eclipse.wst.xml.ui/README.txt
deleted file mode 100644
index d5cec24..0000000
--- a/bundles/org.eclipse.wst.xml.ui/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-The XML specific implementation of the sse editor.
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/about.html b/bundles/org.eclipse.wst.xml.ui/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/bundles/org.eclipse.wst.xml.ui/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>February 24, 2005</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.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/build.properties b/bundles/org.eclipse.wst.xml.ui/build.properties
deleted file mode 100644
index f12bc55..0000000
--- a/bundles/org.eclipse.wst.xml.ui/build.properties
+++ /dev/null
@@ -1,32 +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
-#     
-###############################################################################
-bin.includes = plugin.xml,\
-               xml.jar,\
-               icons/,\
-               plugin.properties,\
-               templates/,\
-               xmleditor.jar,\
-               examples/,\
-               META-INF/,\
-               .,\
-               .options,\
-               about.html
-bin.excludes = bin/**,\
-               @dot/**,\
-               temp.folder/**
-source.. = src/,\
-           src-multipage/,\
-           src-wizards/,\
-           src-catalog/,\
-           src-validation
-src.includes = build.properties
diff --git a/bundles/org.eclipse.wst.xml.ui/examples/EditingAndValidatingXML.zip b/bundles/org.eclipse.wst.xml.ui/examples/EditingAndValidatingXML.zip
deleted file mode 100644
index 106f50d..0000000
--- a/bundles/org.eclipse.wst.xml.ui/examples/EditingAndValidatingXML.zip
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/XMLFile.gif b/bundles/org.eclipse.wst.xml.ui/icons/XMLFile.gif
deleted file mode 100644
index 14eb1be..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/XMLFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse.gif
deleted file mode 100644
index ce74721..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse_all.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse_all.gif
deleted file mode 100644
index 7dc0de5..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse_all.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainoff.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainoff.gif
deleted file mode 100644
index 4bdceb8..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainoff.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainon.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainon.gif
deleted file mode 100644
index e823d57..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainon.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand.gif
deleted file mode 100644
index bc37b7a..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand_all.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand_all.gif
deleted file mode 100644
index 492c14f..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand_all.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/new_xml.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/new_xml.gif
deleted file mode 100644
index e1cfdf7..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/new_xml.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/rldgrmr.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/rldgrmr.gif
deleted file mode 100644
index 49325dd..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/rldgrmr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/validate.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/validate.gif
deleted file mode 100644
index 561d146..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/validate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse.gif
deleted file mode 100644
index b75bc19..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse_all.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse_all.gif
deleted file mode 100644
index a2d80a9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse_all.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainoff.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainoff.gif
deleted file mode 100644
index c1ab04c..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainoff.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainon.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainon.gif
deleted file mode 100644
index 082f9c0..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainon.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand.gif
deleted file mode 100644
index b2f4530..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand_all.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand_all.gif
deleted file mode 100644
index 0205b29..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand_all.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/new_xml.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/new_xml.gif
deleted file mode 100644
index 9dfb62d..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/new_xml.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/rldgrmr.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/rldgrmr.gif
deleted file mode 100644
index 049cac6..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/rldgrmr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/validate.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/validate.gif
deleted file mode 100644
index 2b347ac..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/etool16/validate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/XSDFile.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/XSDFile.gif
deleted file mode 100644
index cc0eeb7..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/XSDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/add_correction.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/add_correction.gif
deleted file mode 100644
index 252d7eb..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/add_correction.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/att_req_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/att_req_obj.gif
deleted file mode 100644
index a8c66d5..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/att_req_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/attribute_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/attribute_obj.gif
deleted file mode 100644
index 79d49d0..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/attribute_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/cdatasection.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/cdatasection.gif
deleted file mode 100644
index 6b0872c..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/cdatasection.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/choice.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/choice.gif
deleted file mode 100644
index d13ba2e..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/choice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/comment_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/comment_obj.gif
deleted file mode 100644
index 28c2ccb..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/comment_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/correction_change.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/correction_change.gif
deleted file mode 100644
index af83c52..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/correction_change.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/doctype.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/doctype.gif
deleted file mode 100644
index 3300f82..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/doctype.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/dtdfile.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/dtdfile.gif
deleted file mode 100644
index 3c0acad..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/dtdfile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/element_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/element_obj.gif
deleted file mode 100644
index 3567815..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/element_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity.gif
deleted file mode 100644
index 61fd3d4..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity_reference.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity_reference.gif
deleted file mode 100644
index 3af9149..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity_reference.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/enum.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/enum.gif
deleted file mode 100644
index 5c0a481..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/enum.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/error-overlay.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/error-overlay.gif
deleted file mode 100644
index 119dccc..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/error-overlay.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/localvariable_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/localvariable_obj.gif
deleted file mode 100644
index 3244b26..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/localvariable_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/notation.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/notation.gif
deleted file mode 100644
index 57ad089..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/notation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/occurone_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/occurone_obj.gif
deleted file mode 100644
index 7bb65c9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/occurone_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/proinst_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/proinst_obj.gif
deleted file mode 100644
index 74436d8..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/proinst_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic-deemphasized.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic-deemphasized.gif
deleted file mode 100644
index 73f47e8..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic-deemphasized.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic-emphasized.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic-emphasized.gif
deleted file mode 100644
index bd1ba54..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic-emphasized.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic.gif
deleted file mode 100644
index 65f516e..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-macro.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-macro.gif
deleted file mode 100644
index 5d1f81b..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-macro.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/text.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/text.gif
deleted file mode 100644
index efa7a38..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/text.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/txtext.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/txtext.gif
deleted file mode 100644
index b226e41..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/txtext.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/warning_obj.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/warning_obj.gif
deleted file mode 100644
index 1e5f5eb..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/warning_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/error_ovr.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/error_ovr.gif
deleted file mode 100644
index 119dccc..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/error_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/stale_error_ovr.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/stale_error_ovr.gif
deleted file mode 100644
index 5b0471b..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/stale_error_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/warn_ovr.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/warn_ovr.gif
deleted file mode 100644
index c350704..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/warn_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/view16/attibute.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/view16/attibute.gif
deleted file mode 100644
index 79d49d0..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/full/view16/attibute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wiz.gif b/bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wiz.gif
deleted file mode 100644
index dc96b10..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wizbanner.gif b/bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wizbanner.gif
deleted file mode 100644
index 9a0ff30..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wizbanner.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/sourceEditor.gif b/bundles/org.eclipse.wst.xml.ui/icons/sourceEditor.gif
deleted file mode 100644
index 75ebdb8..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/xmldoc.gif b/bundles/org.eclipse.wst.xml.ui/icons/xmldoc.gif
deleted file mode 100644
index 14eb1be..0000000
--- a/bundles/org.eclipse.wst.xml.ui/icons/xmldoc.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/plugin.properties b/bundles/org.eclipse.wst.xml.ui/plugin.properties
deleted file mode 100644
index 3281929..0000000
--- a/bundles/org.eclipse.wst.xml.ui/plugin.properties
+++ /dev/null
@@ -1,71 +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
-#     
-###############################################################################
-providerName=Eclipse.org
-pluginName=XML UI Plugin
-nlFeatureName=XML UI Plugin NL Support
-XML_Files.name=XML Files
-XML_Source.name=XML Source
-XML_Templates.name=XML Templates
-XML_Styles.name=XML Styles
-XML_Editor.name=XML Editor
-###############################################################################
-_UI_WIZARD_NEW_XML=XML
-genMenuLabel=&Generate
-_UI_ACTION_CREATE_XML=&XML File...
-_UI_CREATE_NEW_XML_FILE=Create a new XML file.
-XMLExample.name=Editing and validating XML files
-XMLExampleProjectCreationWizard.description=Create a project containing XML sample files
-XMLExampleProjectCreationWizard.projectname=XMLExamples
-XMLExampleProjectCreationWizard.pagetitle=XML sample files for editing and validating
-XMLExampleProjectCreationWizard.pagedescription=Create a project containing XML sample files.
-XMLExampleProjectCreationWizard.label=&Project Name:
-###############################################################################
-All_XML_context_type_Extension_Element.name=All XML
-XML_New_context_type_Extension_Element.name=New XML
-XML_Tag_context_type_Extension_Element.name=XML Tag
-XML_Attribute_context_type_Extension_Element.name=XML Attribute
-XML_Attribute_value_context_type_Extension_Element.name=XML Attribute value
-###############################################################################
-AddTask.label=Add &Task...
-AddTask.tooltip=Add Task...
-AddBookmark.label=Add Boo&kmark...
-AddBookmark.tooltip=Add Bookmark...
-SelectRuler.label=Select Ruler
-###############################################################################
-XML_Catalog_File_Type_Extension_Point.name=XML Catalog file type extension point
-_UI_PREF_XML_CATALOG=XML Catalog
-_UI_PREF_DTD_FILES=DTD Files
-_UI_PREF_XSD_FILES=XSD Files
-_UI_PREF_TAGLIB_DEF_FILES=Taglib Definition Files
-###############################################################################
-_UI_XML_VALIDATOR                   = XML Validator
-_UI_REF_FILE_SHOW_DETAILS           = Show Details...
-_UI_MENU_VALIDATE_XML               = Validate XML File
-##
-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
diff --git a/bundles/org.eclipse.wst.xml.ui/plugin.xml b/bundles/org.eclipse.wst.xml.ui/plugin.xml
deleted file mode 100644
index 6415561..0000000
--- a/bundles/org.eclipse.wst.xml.ui/plugin.xml
+++ /dev/null
@@ -1,582 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-	<extension-point id="catalogFileType" name="%XML_Catalog_File_Type_Extension_Point.name" schema="schema/catalogFileType.exsd"/>
-
-	<extension point="org.eclipse.ui.preferencePages">
-		<page
-			name="%_UI_PREF_XML_CATALOG"
-			category="org.eclipse.wst.sse.ui.internal.provisional.preferences"
-			class="org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogPreferencePage"
-			id="org.eclipse.wst.xml.core.ui.XMLCatalogPreferencePage">
-		</page>
-	</extension>
-	<extension point="org.eclipse.wst.xml.ui.catalogFileType">
-		<fileType
-			extensions="dtd, ent, mod"
-			description="%_UI_PREF_DTD_FILES"
-			id="org.eclipse.wst.xml.core.ui.catalogFileType.dtd">
-		</fileType>
-		<fileType
-			extensions="xsd"
-			description="%_UI_PREF_XSD_FILES"
-			id="org.eclipse.wst.xml.core.ui.catalogFileType.xsd">
-		</fileType>
-		<fileType
-			extensions="tld"
-			description="%_UI_PREF_TAGLIB_DEF_FILES"
-			id="org.eclipse.wst.xml.core.ui.catalogFileType.tld">
-		</fileType>
-	</extension>
-	
-	<!--The org.eclipse.wst.xml.core.xmlsource content type is only for
-		handling some special cases of ill-formed xml in a reasonable
-		manner, and should not be emulated by clients. The two content
-		types are often used interchangeably by the XML component, but
-		please use org.eclipse.core.runtime.xml instead. -->
-	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
-		<sourceViewerConfiguration
-			class="org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML"
-			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
-		<contentOutlineConfiguration
-			class="org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration"
-			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
-		<propertySheetConfiguration
-			class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
-			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
-		<provisionalConfiguration
-			type="sourceeditingtexttools"
-			class="org.eclipse.wst.xml.ui.internal.provisional.XMLSourceEditingTextTools"
-			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
-		<provisionalConfiguration
-			type="characterpairmatcher"
-			class="org.eclipse.wst.xml.ui.internal.text.XMLDocumentRegionEdgeMatcher"
-			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
-		<provisionalConfiguration
-			type="structuredtextfoldingprovider"
-			class="org.eclipse.wst.xml.ui.internal.projection.StructuredTextFoldingProviderXML"
-			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
-		<provisionalConfiguration
-			type="correctionassistant"
-			class="org.eclipse.wst.xml.ui.internal.correction.CorrectionAssistantProviderXML"
-			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
-		<provisionalDefinition
-			type="preferencepages"
-			value="org.eclipse.wst.sse.ui.preferences.xml, org.eclipse.wst.sse.ui.preferences.xml.source, org.eclipse.wst.sse.ui.preferences.xml.templates, org.eclipse.wst.sse.ui.preferences.xml.colors"
-			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
-	</extension>
-
-	<extension
-		point="org.eclipse.core.filebuffers.annotationModelCreation">
-		<factory
-			contentTypeId="org.eclipse.core.runtime.xml"
-			class="org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModelFactory" />
-	</extension>
-	<extension
-		point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
-		<adapterFactoryDescription
-			class="org.eclipse.wst.xml.ui.internal.registry.AdapterFactoryProviderForXML">
-			<contentType id="org.eclipse.core.runtime.xml" />
-		</adapterFactoryDescription>
-	</extension>
-	<extension point="org.eclipse.ui.preferencePages">
-		<!-- XML PREFERENCE PAGES -->
-		<page
-			name="%XML_Files.name"
-			category="org.eclipse.wst.sse.ui.internal.provisional.preferences"
-			class="org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage"
-			id="org.eclipse.wst.sse.ui.preferences.xml">
-		</page>
-		<page
-			name="%XML_Source.name"
-			category="org.eclipse.wst.sse.ui.preferences.xml"
-			class="org.eclipse.wst.xml.ui.internal.preferences.XMLSourcePreferencePage"
-			id="org.eclipse.wst.sse.ui.preferences.xml.source">
-		</page>
-		<page
-			name="%XML_Templates.name"
-			category="org.eclipse.wst.sse.ui.preferences.xml"
-			class="org.eclipse.wst.xml.ui.internal.preferences.XMLTemplatePreferencePage"
-			id="org.eclipse.wst.sse.ui.preferences.xml.templates">
-		</page>
-		<page
-			name="%XML_Styles.name"
-			category="org.eclipse.wst.sse.ui.preferences.xml"
-			class="org.eclipse.wst.xml.ui.internal.preferences.XMLColorPage"
-			id="org.eclipse.wst.sse.ui.preferences.xml.colors">
-		</page>
-	</extension>
-	<!-- Editor actionsets -->
-	<extension point="org.eclipse.ui.actionSetPartAssociations">
-		<actionSetPartAssociation
-			targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
-			<part id="org.eclipse.core.runtime.xml.source"></part>
-			<part id="org.eclipse.core.runtime.xml.source2"></part>
-		</actionSetPartAssociation>
-		<actionSetPartAssociation
-			targetID="org.eclipse.ui.NavigateActionSet">
-			<part id="org.eclipse.core.runtime.xml.source"></part>
-			<part id="org.eclipse.core.runtime.xml.source2"></part>
-		</actionSetPartAssociation>
-	</extension>
-
-	<!-- Templates -->
-	<extension point="org.eclipse.ui.editors.templates">
-		<contextType
-			name="%All_XML_context_type_Extension_Element.name"
-			class="org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeXML"
-			id="xml_all">
-		</contextType>
-		<contextType
-			name="%XML_New_context_type_Extension_Element.name"
-			class="org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeXML"
-			id="xml_new">
-		</contextType>
-		<contextType
-			name="%XML_Tag_context_type_Extension_Element.name"
-			class="org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeXML"
-			id="xml_tag">
-		</contextType>
-		<contextType
-			name="%XML_Attribute_context_type_Extension_Element.name"
-			class="org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeXML"
-			id="xml_attribute">
-		</contextType>
-		<contextType
-			name="%XML_Attribute_value_context_type_Extension_Element.name"
-			class="org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeXML"
-			id="xml_attribute_value">
-		</contextType>
-		<include
-			file="templates/xmldefault-templates.xml"
-			translations="$nl$/templates/xmldefault-templates.properties">
-		</include>
-	</extension>
-
-	<extension point="org.eclipse.ui.editors">
-		<editor
-			name="%XML_Editor.name"
-			icon="icons/xmldoc.gif"
-			default="true"
-			contributorClass="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorActionBarContributor"
-			class="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart"
-			id="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart">
-			<contentTypeBinding
-				contentTypeId="org.eclipse.core.runtime.xml" />
-			<contentTypeBinding
-				contentTypeId="org.eclipse.wst.xml.core.xmlsource" />
-
-		</editor>
-	</extension>
-
-	<!-- Editor actionsets -->
-	<extension point="org.eclipse.ui.actionSetPartAssociations">
-		<actionSetPartAssociation
-			targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
-			<part
-				id="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart">
-			</part>
-		</actionSetPartAssociation>
-		<actionSetPartAssociation
-			targetID="org.eclipse.ui.NavigateActionSet">
-			<part
-				id="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart">
-			</part>
-		</actionSetPartAssociation>
-	</extension>
-
-
-
-	<!-- ================================================== -->
-	<!-- Contribute a 'New Wizard' for XML files            -->
-	<!-- ================================================== -->
-	<extension point="org.eclipse.ui.newWizards">
-		<category
-			name="%_UI_WIZARD_NEW_XML"
-			id="org.eclipse.wst.XMLCategory">
-		</category>
-		<wizard
-			name="%_UI_WIZARD_NEW_XML"
-			icon="icons/XMLFile.gif"
-			category="org.eclipse.wst.XMLCategory"
-			class="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard"
-			id="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard">
-			<description>%_UI_CREATE_NEW_XML_FILE</description>
-			<selection class="org.eclipse.core.resources.IResource">
-			</selection>
-		</wizard>
-	</extension>
-
-	<!-- =============================================================================== -->
-	<!-- Allow the 'New XML' wizard to be accessed via the 'Generate' menu on a XSD file -->
-	<!-- =============================================================================== -->
-	<extension point="org.eclipse.ui.popupMenus">
-		<objectContribution
-			objectClass="org.eclipse.core.resources.IFile"
-			nameFilter="*.xsd"
-			id="org.eclipse.wst.xmlwizard.createXMLFromXSD">
-			<menu
-				label="%genMenuLabel"
-				path="additions"
-				id="generateXMLArtifacts">
-				<separator name="xml" />
-			</menu>
-			<action
-				label="%_UI_ACTION_CREATE_XML"
-				class="org.eclipse.wst.xml.ui.internal.wizards.XMLImportActionDelegate"
-				menubarPath="generateXMLArtifacts/xml"
-				enablesFor="1"
-				id="org.eclipse.wst.xmlwizard.createXMLFromXSDAction">
-			</action>
-		</objectContribution>
-	</extension>
-
-	<!-- =============================================================================== -->
-	<!-- Allow the 'New XML' wizard to be accessed via the 'Generate' menu on a DTD file -->
-	<!-- =============================================================================== -->
-	<extension point="org.eclipse.ui.popupMenus">
-		<objectContribution
-			objectClass="org.eclipse.core.resources.IFile"
-			nameFilter="*.dtd"
-			id="org.eclipse.wst.xmlwizard.createXMLFromDTD">
-			<menu
-				label="%genMenuLabel"
-				path="additions"
-				id="generateXMLArtifacts">
-				<separator name="xml" />
-			</menu>
-			<action
-				label="%_UI_ACTION_CREATE_XML"
-				class="org.eclipse.wst.xml.ui.internal.wizards.XMLImportActionDelegate"
-				menubarPath="generateXMLArtifacts/xml"
-				enablesFor="1"
-				id="org.eclipse.wst.xmlwizard.createXMLFromDTDAction">
-			</action>
-		</objectContribution>
-	</extension>
-
-	<!-- =============================================================================== -->
-	<!-- Contribute a New->Example... entry for Editing and Validating XML files         -->
-	<!-- =============================================================================== -->
-
-	<!-- define the XMLSamples project wizard -->
-	<extension point="org.eclipse.ui.newWizards">
-		<category
-			name="%_UI_WIZARD_NEW_XML"
-			parentCategory="org.eclipse.ui.Examples"
-			id="org.eclipse.wst.xml.examples">
-		</category>
-		<wizard
-			name="%XMLExample.name"
-			class="org.eclipse.wst.xml.ui.internal.wizards.ExampleProjectCreationWizard"
-			category="org.eclipse.ui.Examples/org.eclipse.wst.xml.examples"
-			id="org.eclipse.wst.xml.ui.XMLExampleProjectCreationWizard"
-			project="true"
-			icon="icons/newSampleProject_wiz.gif">
-			<description>
-				%XMLExampleProjectCreationWizard.description
-			</description>
-		</wizard>
-	</extension>
-
-	<!-- configure the XMLSamples project wizard -->
-	<extension
-		point="org.eclipse.wst.common.ui.exampleProjectCreationWizard"
-		id="XMLExampleProjectCreationWizardExtension">
-		<wizard
-			id="org.eclipse.wst.xml.ui.XMLExampleProjectCreationWizard"
-			banner="icons/newSampleProject_wizbanner.gif">
-			<projectsetup
-				pagetitle="%XMLExampleProjectCreationWizard.pagetitle"
-				name="%XMLExampleProjectCreationWizard.projectname"
-				label="%XMLExampleProjectCreationWizard.label"
-				pagedescription="%XMLExampleProjectCreationWizard.pagedescription"
-				open="readme.html">
-				<import
-					dest=""
-					src="examples/EditingAndValidatingXML.zip" />
-			</projectsetup>
-		</wizard>
-	</extension>
-
-	<!-- initialize xml ui preferences -->
-	<extension point="org.eclipse.core.runtime.preferences">
-		<initializer
-			class="org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceInitializer" />
-	</extension>
-
-	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
-		<validator
-			scope="total"
-			class="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML"
-			id="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML">
-			<contentTypeIdentifier id="org.eclipse.core.runtime.xml">
-				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT">
-				</partitionType>
-			</contentTypeIdentifier>
-		</validator>
-	</extension>
-	
-	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
-		<validator
-			scope="partial"
-			class="org.eclipse.wst.xml.ui.internal.validation.MarkupValidator"
-			id="org.eclipse.wst.xml.ui.internal.validation.sourcemarkupvalidator">
-			<contentTypeIdentifier id="org.eclipse.core.runtime.xml">
-				<partitionType id="org.eclipse.wst.sse.ST_DEFAULT">
-				</partitionType>
-				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT">
-				</partitionType>
-			</contentTypeIdentifier>
-		</validator>
-	</extension>
-	
-	<!--======================================================================================-->
-	<!-- Document provider for ExternalFileEditorInput                                        -->
-	<!--======================================================================================-->
-	<extension point="org.eclipse.ui.editors.documentProviders">
-		<provider
-			inputTypes="org.eclipse.wst.xml.ui.internal.hyperlink.ExternalFileEditorInput"
-			class="org.eclipse.ui.editors.text.TextFileDocumentProvider"
-			id="org.eclipse.wst.xml.ui.internal.ExternalFileDocumentProvider">
-		</provider>
-	</extension>
-
-
-	<extension point="org.eclipse.ui.popupMenus">
-		<viewerContribution
-			targetID="org.eclipse.core.runtime.xml.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>
-
-	<!-- ====================================================== -->
-	<!-- Define Assign Validate action on .xml file             -->
-	<!-- ====================================================== -->
-	<extension point="org.eclipse.ui.popupMenus">
-		<objectContribution
-			objectClass="org.eclipse.core.resources.IFile"
-			nameFilter="*.xml"
-			id="org.eclipse.wst.xml.validation.xmlaction">
-			<visibility>
-				<not>
-					<or>
-						<objectState
-							name="projectNature"
-							value="org.eclipse.jst.j2ee.ejb.EJBNature" />
-						<objectState
-							name="projectNature"
-							value="org.eclipse.jst.j2ee.EARNature" />
-					</or>
-				</not>
-			</visibility>
-			<action
-				label="%_UI_MENU_VALIDATE_XML"
-				class="org.eclipse.wst.xml.ui.internal.validation.ValidateXMLFileActionDelegate"
-				enablesFor="1"
-				id="org.eclipse.wst.xml.ui.internal.validation.ValidateXMLFileActionDelegate">
-			</action>
-		</objectContribution>
-	</extension>
-	<!-- ====================================================== -->
-	<!-- Define Validate action on .tld file             -->
-	<!-- ====================================================== -->
-	<extension point="org.eclipse.ui.popupMenus">
-		<objectContribution
-			objectClass="org.eclipse.core.resources.IFile"
-			nameFilter="*.tld"
-			id="org.eclipse.wst.xml.validation.xmlaction">
-			<action
-				label="%_UI_MENU_VALIDATE_XML"
-				class="org.eclipse.wst.xml.ui.internal.validation.ValidateXMLFileActionDelegate"
-				enablesFor="1"
-				id="org.eclipse.wst.xml.ui.internal.validation.ValidateXMLFileActionDelegate">
-			</action>
-		</objectContribution>
-	</extension>
-
-
-	<!-- ====================================================== -->
-	<!-- An extension for creating nested validation messages.  -->
-	<!-- This extension should be moved when the referenced     -->
-	<!-- files dialog is moved to another plugin.               -->
-	<!-- ====================================================== -->
-	<extension point="org.eclipse.ui.popupMenus">
-		<objectContribution
-			objectClass="org.eclipse.core.resources.IMarker"
-			id="org.eclipse.wst.xml.validation.internal.core.nestederrorlist"
-			nameFilter="*">
-			<filter
-				name="done"
-				value="true">
-			</filter>
-			<filter
-				name="type"
-				value="org.eclipse.wst.validation.problemmarker">
-			</filter>
-			<action
-				label="%_UI_REF_FILE_SHOW_DETAILS"
-				class="org.eclipse.wst.xml.ui.internal.validation.core.errorinfo.ReferencedFileErrorActionDelegate"
-				id="org.eclipse.wst.xml.ui.internal.validation.core.errorinfo.ReferencedFileErrorActionDelegate">
-			</action>
-		</objectContribution>
-	</extension>
-
-	<!-- ====================================================== -->
-	<!-- Register the XML validator with the validation 		-->
-	<!-- framework. 										    -->
-	<!-- ====================================================== -->
-
-	<extension
-		id="xmlValidator"
-		name="%_UI_XML_VALIDATOR"
-		point="org.eclipse.wst.validation.validator">
-		<validator>
-			<!-- There is a custom XML validator for EJBs -->
-			<projectNature
-				include="false"
-				id="org.eclipse.jst.j2ee.ejb.EJBNature">
-			</projectNature>
-			<!-- There is a custom XML validator for EARs -->
-			<projectNature
-				include="false"
-				id="org.eclipse.jst.j2ee.EARNature">
-			</projectNature>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				caseSensitive="false"
-				nameFilter="*.xml">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				caseSensitive="false"
-				nameFilter="*.gph">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				caseSensitive="false"
-				nameFilter="*.wdo-connections">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				caseSensitive="false"
-				nameFilter="*.tld" />
-			<helper
-				class="org.eclipse.wst.xml.core.internal.validation.core.Helper">
-			</helper>
-			<run
-				class="org.eclipse.wst.xml.ui.internal.validation.Validator">
-			</run>
-		</validator>
-	</extension>
-
-	<extension point="org.eclipse.ui.editorActions">
-		<editorContribution
-			id="org.eclipse.core.runtime.xml.source.editorActions"
-			targetID="org.eclipse.core.runtime.xml.source">
-			<action
-				id="CleanupDocument"
-				label="%CleanupDocument_label"
-				definitionId="org.eclipse.wst.sse.ui.cleanup.document"
-				tooltip="%CleanupDocument_tooltip"
-				class="org.eclipse.wst.xml.ui.internal.actions.CleanupActionXMLDelegate"
-				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.xml.ui.internal.search.XMLFindOccurrencesActionDelegate"
-				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.core.runtime.xml.source"
-            id="org.eclipse.core.runtime.xml.source.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>
-</plugin>
diff --git a/bundles/org.eclipse.wst.xml.ui/schema/catalogFileType.exsd b/bundles/org.eclipse.wst.xml.ui/schema/catalogFileType.exsd
deleted file mode 100644
index 3629659..0000000
--- a/bundles/org.eclipse.wst.xml.ui/schema/catalogFileType.exsd
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.ui">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.xml.ui" id="catalogFileType" name="XML Catalog file type extension point"/>
-      </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="fileType" 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="fileType">
-      <complexType>
-         <attribute name="extensions" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="description" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="id" 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.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/AdvancedOptionsDialog.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/AdvancedOptionsDialog.java
deleted file mode 100644
index 068e243..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/AdvancedOptionsDialog.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - Initial API and implementation
-*   Jens Lukowski/Innoopract - initial renaming/restructuring
-* 
-*/
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-import java.io.ByteArrayInputStream;
-
-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.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.window.Window;
-import org.eclipse.osgi.util.NLS;
-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.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.SaveAsDialog;
-import org.eclipse.wst.common.ui.internal.dialogs.SelectSingleFileDialog;
-import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-public class AdvancedOptionsDialog extends Dialog 
-{
-  protected ICatalog workingUserCatalog;
-
-  public AdvancedOptionsDialog(Shell parentShell, ICatalog workingUserCatalog) 
-  {
-    super(parentShell);
-    setShellStyle(getShellStyle() | SWT.RESIZE);   
-    this.workingUserCatalog = workingUserCatalog;
-  }
-
-
-  protected void createButtonsForButtonBar(Composite parent) 
-  {
-    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-  }
-
-
-  protected Control createDialogArea(Composite parent) 
-  {
-    Composite dialogArea = (Composite)super.createDialogArea(parent);
-//    WorkbenchHelp.setHelp(dialogArea, new ControlContextComputer(dialogArea, XMLBuilderContextIds.XMLP_PROJECT_DIALOG));
-          
-    Composite composite = new Composite(dialogArea, SWT.NONE);
-    composite.setLayout(new GridLayout());
-    composite.setLayoutData(new GridData(GridData.FILL_BOTH));  
-
-    Label label = new Label(composite, SWT.NONE);
-    label.setText(XMLCatalogMessages.UI_LABEL_DIALOG_DESCRIPTION);
-                                         
-    Composite buttonComposite = new Composite(composite, SWT.NONE);
-    GridLayout gridLayout = new GridLayout();
-    gridLayout.numColumns = 3;
-    buttonComposite.setLayout(gridLayout);     
-    buttonComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-   
-    Composite placeHolder = new Composite(buttonComposite, SWT.NONE);
-    placeHolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-    
-    Composite buttonGroup = new Composite(buttonComposite, SWT.NONE);
-    gridLayout = new GridLayout();
-    gridLayout.numColumns = 2;
-    gridLayout.makeColumnsEqualWidth = true;
-    buttonGroup.setLayout(gridLayout); 
-    buttonGroup.setLayoutData(createGridData());
-
-    Button importButton = new Button(buttonGroup, SWT.PUSH | SWT.CENTER);
-    importButton.setText("  " + XMLCatalogMessages.UI_BUTTON_IMPORT + "  "); //$NON-NLS-1$ //$NON-NLS-2$
-
-    Button exportButton = new Button(buttonGroup, SWT.PUSH | SWT.CENTER);
-    exportButton.setText("  " + XMLCatalogMessages.UI_BUTTON_EXPORT + "  "); //$NON-NLS-1$ //$NON-NLS-2$
-
-    placeHolder = new Composite(buttonComposite, SWT.NONE);
-    placeHolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-    // add importButton listener
-    SelectionListener importButtonSelectionListener = new SelectionAdapter()
-    {
-      public void widgetSelected(SelectionEvent e)
-      {                                                                 
-        invokeImportDialog();              
-      }     
-    }; 
-    importButton.addSelectionListener(importButtonSelectionListener);
-        
-    // add exportButton listener
-    SelectionListener exportButtonSelectionListener = new SelectionAdapter()
-    {
-      public void widgetSelected(SelectionEvent e)
-      {                                                                 
-        invokeExportDialog();              
-      }     
-    }; 
-    exportButton.addSelectionListener(exportButtonSelectionListener);
-
-    return dialogArea;
-  }
-       
-  protected GridData createGridData()
-  {
-    GridData gd = new GridData(GridData.CENTER);
-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_CENTER;
-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
-    return gd;
-  }
- 
-                                      
-  protected void invokeImportDialog()
-  {                          
-    SelectSingleFileDialog dialog = new SelectSingleFileDialog(getShell(), null, true); 
-    String[] extensions = {".xmlcatalog", ".xml"}; //$NON-NLS-1$ //$NON-NLS-2$
-    dialog.addFilterExtensions(extensions);   
-    dialog.create();   
-    dialog.getShell().setText(XMLCatalogMessages.UI_LABEL_IMPORT_DIALOG_TITLE);
-    dialog.setTitle(XMLCatalogMessages.UI_LABEL_IMPORT_DIALOG_HEADING);
-    dialog.setMessage(XMLCatalogMessages.UI_LABEL_IMPORT_DIALOG_MESSAGE);
-    dialog.setBlockOnOpen(true);
-    int rc = dialog.open();                        
-    if (rc == Window.OK)
-    {             
-      IFile file = dialog.getFile();
-      if (file != null)
-      {
-        String fileName = file.getLocation().toFile().toURI().toString();
-        try
-        {
-            CatalogSet tempResourceSet = new CatalogSet(); 
-            ICatalog newCatalog = tempResourceSet.lookupOrCreateCatalog("temp", fileName);       //$NON-NLS-1$
-  		      workingUserCatalog.addEntriesFromCatalog(newCatalog); 
-        }
-        catch (Exception e)
-        {
-          //TODO... give error message
-        }   
-      }
-      close();
-    }
-  }
-  
-
-  protected void invokeExportDialog()
-  {                                                          
-    IPath originalFilePath = null;
-    IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
-    if (projects.length > 0)
-    {
-      originalFilePath = projects[0].getFullPath().append(".xmlcatalog"); //$NON-NLS-1$
-    }
-                                         
-    SaveAsDialog dialog = new SaveAsDialog(getShell());
-    if (originalFilePath != null)
-    {
-	    IFile originalFile = ResourcesPlugin.getWorkspace().getRoot().getFile(originalFilePath);   
-      dialog.setOriginalFile(originalFile); 
-    }
-    dialog.create();    
-
-    dialog.getShell().setText(XMLCatalogMessages.UI_LABEL_EXPORT_DIALOG_TITLE);
-    dialog.setTitle(XMLCatalogMessages.UI_LABEL_EXPORT_DIALOG_HEADING);
-    dialog.setMessage(XMLCatalogMessages.UI_LABEL_EXPORT_DIALOG_MESSAGE);
-
-    dialog.setBlockOnOpen(true);
-    int rc = dialog.open();                        
-    if (rc == Window.OK)
-    { 
-      IPath path = dialog.getResult();
-      if (path != null)
-      {                   
-        IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-		String fileName = file.getLocation().toFile().toURI().toString();
-        
-        // here we save the catalog entries to the selected file      
-        try
-        {         
-          createFileIfRequired(file); 
-          workingUserCatalog.setLocation(fileName);
-          workingUserCatalog.save();
-        }
-        catch (Exception ex)
-        {                                                                    
-          try
-          {  
-            String title = XMLCatalogMessages.UI_LABEL_CATALOG_SAVE_ERROR;    
-            String briefMessage = XMLCatalogMessages.UI_LABEL_CATALOG_COULD_NOT_BE_SAVED;     
-            String reason = file.isReadOnly() ?
-            		NLS.bind(XMLCatalogMessages.UI_LABEL_FILE_IS_READ_ONLY, fileName) : 
-            			NLS.bind(XMLCatalogMessages.ERROR_SAVING_FILE, fileName);
-            String details = NLS.bind(XMLCatalogMessages.ERROR_SAVING_FILE, fileName);
-                                                               
-            ErrorDialog.openError(Display.getCurrent().getActiveShell(), title, briefMessage, createStatus(reason, details));
-          }
-          catch (Exception ex2)
-          {
-          }
-        } 
-        close();
-      }
-    }
-  }
-  
-  // TODO... This was copied from WindowUtility.  Is there an easier way to create a status object?
-  // If not, we should open an eclipse bug or add a similar utility to baseExtensionsUI.
-  //
-  private static IStatus createStatus(String reason, String msg)
-  {
-	String pluginId = XMLUIPlugin.getDefault().getBundle().getSymbolicName();    
-	MultiStatus multiStatus = new MultiStatus(pluginId, 0, reason, null);
-	Status status = new Status(IStatus.ERROR, pluginId, 0, msg, null);
-	multiStatus.add(status);
-	return multiStatus;
-  }   
-  
-
-  protected void createFileIfRequired(IFile file)
-  {
-    try
-    {                                
-      if (file != null && !file.exists())
-      {
-        ByteArrayInputStream inputStream = new ByteArrayInputStream(new byte[0]);      
-	      file.create(inputStream, true, null);
-        //createEmptyXMLCatalog(file);
-      }
-    }
-    catch (Exception e)
-    {
-    }
-  } 
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/CatalogFileTypeRegistryReader.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/CatalogFileTypeRegistryReader.java
deleted file mode 100644
index ce4a8d8..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/CatalogFileTypeRegistryReader.java
+++ /dev/null
@@ -1,89 +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.ui.internal.catalog;
-
-import java.util.Collection;
-import java.util.HashMap;
-
-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.ui.internal.XMLUIPlugin;
-
-public class CatalogFileTypeRegistryReader {
-	private static CatalogFileTypeRegistryReader _instance;
-
-	static final String ATT_DESCRIPTION = "description"; //$NON-NLS-1$
-
-	static final String ATT_EXTENSIONS = "extensions"; //$NON-NLS-1$
-
-	static final String ATT_ICON = "icon"; //$NON-NLS-1$
-
-	static final String ATT_ID = "id"; //$NON-NLS-1$
-
-	static final String EXTENSION_POINT_ID = "catalogFileType"; //$NON-NLS-1$
-
-	static final String TAG_NAME = "fileType"; //$NON-NLS-1$
-
-	private static CatalogFileTypeRegistryReader getInstance() {
-		if (_instance == null)
-			_instance = new CatalogFileTypeRegistryReader();
-		return _instance;
-	}
-
-	public static Collection getXMLCatalogFileTypes() {
-		return getInstance().hashMap.values();
-	}
-
-	private HashMap hashMap;
-
-	public CatalogFileTypeRegistryReader() {
-		this.hashMap = new HashMap();
-		readRegistry();
-	}
-
-	private void readElement(IConfigurationElement element) {
-		if (element.getName().equals(TAG_NAME)) {
-			String id = element.getAttribute(ATT_ID);
-			if (id != null) {
-				XMLCatalogFileType fileType = (XMLCatalogFileType) hashMap.get(id);
-				if (fileType == null) {
-					fileType = new XMLCatalogFileType();
-					hashMap.put(id, fileType);
-				}
-
-				if (fileType.description == null) {
-					String description = element.getAttribute(ATT_DESCRIPTION);
-					fileType.description = description;
-				}
-
-				fileType.addExtensions(element.getAttribute(ATT_EXTENSIONS));
-			}
-		}
-	}
-
-	private void readRegistry() {
-		readRegistry(EXTENSION_POINT_ID);
-	}
-
-	private void readRegistry(String extensionPointId) {
-		IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry();
-		IExtensionPoint point = pluginRegistry.getExtensionPoint(XMLUIPlugin.ID, extensionPointId);
-		if (point != null) {
-			IConfigurationElement[] elements = point.getConfigurationElements();
-			for (int i = 0; i < elements.length; i++) {
-				readElement(elements[i]);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/EditCatalogEntryDialog.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/EditCatalogEntryDialog.java
deleted file mode 100644
index de0af20..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/EditCatalogEntryDialog.java
+++ /dev/null
@@ -1,950 +0,0 @@
-/*
- * Copyright (c) 2002 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.common.ui.internal.dialogs.SelectSingleFileDialog;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-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;
-
-public class EditCatalogEntryDialog extends Dialog {
-	protected static Image borwseImage = ImageFactory.INSTANCE.getImage("icons/obj16/file_expand.gif"); //$NON-NLS-1$
-	protected static Image catalogEntryToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/catalogEntry.gif"); //$NON-NLS-1$
-	protected static Image nextCatalogToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/nextCatalog.gif"); //$NON-NLS-1$
-
-	protected class CatalogEntryPage extends CatalogElementPage {
-
-		protected Button browseButton;
-
-		protected ICatalogEntry catalogEntry;
-
-		protected Button checkboxButton;
-
-		protected Label errorMessageLabel;
-
-		protected Text keyField;
-
-		protected Combo keyTypeCombo;
-
-		protected Text resourceLocationField;
-
-		protected Combo resourceTypeCombo;
-
-		protected Text webAddressField;
-
-		protected void computeErrorMessage() {
-			errorMessage = null;
-
-			if (errorMessage == null) {
-				String fileName = resourceLocationField.getText();
-				if (fileName.trim().length() > 0) {
-					if (fileName.indexOf("..") != -1 || fileName.indexOf("./") != -1 || fileName.indexOf("/.") != -1 || fileName.indexOf(".\\") != -1 || fileName.indexOf("\\.") != -1) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-						errorMessage = XMLCatalogMessages.UI_WARNING_URI_MUST_NOT_HAVE_DOTS;
-					}
-
-					String uri = fileName;
-					if (!URIHelper.hasProtocol(uri)) {
-						uri = URIHelper.isAbsolute(uri) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
-					}
-
-					if (errorMessage == null && !URIHelper.isReadableURI(uri, false)) {
-						errorMessage = XMLCatalogMessages.UI_WARNING_URI_NOT_FOUND_COLON + fileName;
-					}
-				}
-				else {
-					// this an error that is not actaully
-					// reported ... OK is just disabled
-					errorMessage = "";  //$NON-NLS-1$
-				}
-			}
-
-			if (errorMessage == null && checkboxButton.getSelection() && webAddressField.getText().trim().length() == 0) {
-				// this an error that is not actaully
-				// reported ... OK is just disabled
-				errorMessage = "";  //$NON-NLS-1$
-			}
-
-			if (errorMessage == null && keyField.getText().trim().length() == 0) {
-				// this an error that is not actaully
-				// reported ... OK is just disabled
-				errorMessage = "";  //$NON-NLS-1$
-			}
-		}
-
-		protected Control createCatalogEntryPanel(Composite parent) {
-
-			ModifyListener modifyListener = new ModifyListener() {
-				public void modifyText(ModifyEvent e) {
-					if (e.widget == resourceLocationField) {
-						if (keyField.getText().length() == 0) {
-							String uri = resourceLocationField.getText();
-							if (uri.endsWith("xsd") && !URIHelper.hasProtocol(uri)) { //$NON-NLS-1$
-								uri = URIHelper.isAbsolute(uri) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
-								String namespaceURI = XMLQuickScan.getTargetNamespaceURIForSchema(uri);
-								if (namespaceURI != null) {
-									keyField.setText(namespaceURI);
-								}
-							}
-						}
-					}
-					updateWidgets(e.widget);
-				}
-			};
-
-
-			Composite composite = new Composite(parent, SWT.NONE);
-			GridData gd = new GridData(GridData.FILL_BOTH);
-			composite.setLayoutData(gd);
-
-			GridLayout layout = new GridLayout();
-			composite.setLayout(layout);
-
-			Composite group = new Composite(composite, SWT.NONE);
-			gd = new GridData(GridData.FILL_HORIZONTAL);
-			group.setLayoutData(gd);
-
-			layout = new GridLayout(3, false);
-			group.setLayout(layout);
-
-			Label resourceLocationLabel = new Label(group, SWT.NONE);
-			resourceLocationLabel.setText(XMLCatalogMessages.UI_LABEL_URI_COLON);
-
-			resourceLocationField = new Text(group, SWT.SINGLE | SWT.BORDER);
-			gd = new GridData();
-			gd.horizontalAlignment = SWT.FILL;
-			gd.grabExcessHorizontalSpace = true;
-			resourceLocationField.setLayoutData(gd);
-			resourceLocationField.setText(getDisplayValue(getEntry().getURI()));
-			// WorkbenchHelp.setHelp(resourceLocationField,
-			// XMLBuilderContextIds.XMLP_ENTRY_URI);
-			resourceLocationField.addModifyListener(modifyListener);
-
-
-			browseButton = createBrowseButton(group);
-			// WorkbenchHelp.setHelp(browseButton,
-			// XMLBuilderContextIds.XMLP_ENTRY_BROWSE);
-			browseButton.addSelectionListener(new DropDownSelectionListener(resourceLocationField));
-
-			// Key Type
-			//
-			Label keyTypeLabel = new Label(group, SWT.NONE);
-			keyTypeLabel.setText(XMLCatalogMessages.UI_KEY_TYPE_COLON);
-
-			keyTypeCombo = new Combo(group, SWT.NONE);
-			gd = new GridData();
-			gd.horizontalAlignment = SWT.FILL;
-			gd.grabExcessHorizontalSpace = true;
-			keyTypeCombo.setLayoutData(gd);
-			updateKeyTypeCombo(getEntry().getEntryType());
-			keyTypeCombo.addModifyListener(modifyListener);
-			// WorkbenchHelp.setHelp(keyTypeCombo,
-			// XMLBuilderContextIds.XMLP_ENTRY_KEY_TYPE);
-
-			// a placeholder to fill the 3rd column
-			Button placeHolder = new Button(group, SWT.NONE);
-			placeHolder.setVisible(false);
-
-			// Key
-			// 
-			Label keyValueLabel = new Label(group, SWT.NONE);
-			keyValueLabel.setText(XMLCatalogMessages.UI_LABEL_KEY_COLON);
-			keyField = new Text(group, SWT.SINGLE | SWT.BORDER);
-			// WorkbenchHelp.setHelp(keyField,
-			// XMLBuilderContextIds.XMLP_ENTRY_KEY);
-			keyField.setLayoutData(gd);
-			keyField.setText(getDisplayValue(getEntry().getKey()));
-			keyField.addModifyListener(modifyListener);
-
-			Composite group2 = new Composite(composite, SWT.NONE);
-			gd = new GridData(GridData.FILL_HORIZONTAL);
-			group2.setLayoutData(gd);
-
-			layout = new GridLayout();
-			group2.setLayout(layout);
-
-			// checkbox -- note parent is dialogArea
-			//
-			checkboxButton = new Button(group2, SWT.CHECK);
-			// WorkbenchHelp.setHelp(checkboxButton,
-			// XMLBuilderContextIds.XMLP_ENTRY_SPECIFY_ALTERNATIVE);
-			checkboxButton.setText(XMLCatalogMessages.UI_LABEL_SPECIFY_ALTERNATIVE_WEB_URL);
-			checkboxButton.setLayoutData(new GridData());
-			checkboxButton.setSelection(getEntry().getAttributeValue(ICatalogEntry.ATTR_WEB_URL) != null);
-			SelectionListener buttonListener = new SelectionListener() {
-				public void widgetDefaultSelected(SelectionEvent event) {
-					// no impl
-				}
-
-				public void widgetSelected(SelectionEvent event) {
-					if (event.widget == checkboxButton) {
-						updateWidgets(checkboxButton);
-					}
-				}
-			};
-			checkboxButton.addSelectionListener(buttonListener);
-
-			// Web Address field
-			//
-
-			ModifyListener webAddressFieldListener = new ModifyListener() {
-				public void modifyText(ModifyEvent e) {
-					computeErrorMessage();
-					updateErrorMessageLabel(errorMessageLabel);
-					updateOKButtonState();
-				}
-			};
-
-			webAddressField = new Text(group2, SWT.SINGLE | SWT.BORDER);
-			// WorkbenchHelp.setHelp(webAddressField,
-			// XMLBuilderContextIds.XMLP_ENTRY_WEB_ADDRESS);
-			webAddressField.setLayoutData(gd);
-			webAddressField.setText(getDisplayValue(getEntry().getAttributeValue(ICatalogEntry.ATTR_WEB_URL)));
-			webAddressField.setEnabled(false);
-			webAddressField.addModifyListener(webAddressFieldListener);
-
-
-			errorMessageLabel = new Label(group2, SWT.NONE);
-			Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
-			errorMessageLabel.setForeground(color);
-			errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-			updateWidgets(null);
-
-			return composite;
-		}
-
-		public Control createControl(Composite parent) {
-
-			fControl = createCatalogEntryPanel(parent);
-
-			return fControl;
-		}
-
-
-		public ICatalogElement getData() {
-			return getEntry();
-		}
-
-		protected ICatalogEntry getEntry() {
-			if (catalogEntry == null) {
-				if (fCatalogElement != null && fCatalogElement.getType() == ICatalogElement.TYPE_ENTRY) {
-					catalogEntry = (ICatalogEntry) fCatalogElement;
-				}
-				else {
-					if (catalog != null) {
-						catalogEntry = (ICatalogEntry) catalog.createCatalogElement(ICatalogElement.TYPE_ENTRY);
-					}
-				}
-			}
-			return catalogEntry;
-		}
-
-		protected int getKeyType() {
-			switch (keyTypeCombo.getSelectionIndex()) {
-				case 0 :
-					if ("schema".equals(keyTypeCombo.getData("keyType"))) { //$NON-NLS-1$ //$NON-NLS-2$
-						return ICatalogEntry.ENTRY_TYPE_URI; // xsd namespace is URI type key
-					}
-					return ICatalogEntry.ENTRY_TYPE_PUBLIC;
-				case 1 :
-					return ICatalogEntry.ENTRY_TYPE_SYSTEM;
-				case 2 :
-					return ICatalogEntry.ENTRY_TYPE_URI;
-				default :
-					return ICatalogEntry.ENTRY_TYPE_PUBLIC;
-			}
-		}
-
-		public void saveData() {
-			String uri = resourceLocationField.getText();
-			if (!URIHelper.hasProtocol(uri)) {
-				uri = URIHelper.isAbsolute(uri) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
-			}
-			getEntry().setURI(uri);
-			getEntry().setKey(keyField.getText());
-			getEntry().setEntryType(getKeyType());
-			getEntry().setAttributeValue(ICatalogEntry.ATTR_WEB_URL, checkboxButton.getSelection() ? webAddressField.getText() : null);
-		}
-
-		protected void updateKeyTypeCombo(int type) {
-			keyTypeCombo.removeAll();
-			for (Iterator i = CatalogFileTypeRegistryReader.getXMLCatalogFileTypes().iterator(); i.hasNext();) {
-				XMLCatalogFileType theFileType = (XMLCatalogFileType) i.next();
-				if (theFileType.extensions != null) {
-					for (Iterator j = theFileType.extensions.iterator(); j.hasNext();) {
-						String extension = (String) j.next();
-						if (resourceLocationField.getText().endsWith(extension)) {
-							if (theFileType.description.equals("XSD Files")) { //$NON-NLS-1$
-								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC);
-								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM);
-								keyTypeCombo.setData("keyType", "schema"); //$NON-NLS-1$ //$NON-NLS-2$
-							}
-							else if (theFileType.description.equals("DTD Files")) { //$NON-NLS-1$
-								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC);
-								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM);
-								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
-							}
-							else {
-								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
-							}
-						}
-
-					}
-
-				}
-			}
-			if (keyTypeCombo.getItemCount() == 0) {
-				keyTypeCombo.add(XMLCatalogMessages.
-						UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC);
-				keyTypeCombo.add(XMLCatalogMessages.
-						UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM);
-				keyTypeCombo.add(XMLCatalogMessages.
-						UI_KEY_TYPE_DESCRIPTION_URI);
-			}
-		
-			switch (type) {
-				case ICatalogEntry.ENTRY_TYPE_PUBLIC :
-					keyTypeCombo.select(0);
-					break;
-				case ICatalogEntry.ENTRY_TYPE_SYSTEM :
-					keyTypeCombo.select(1);
-					break;
-				case ICatalogEntry.ENTRY_TYPE_URI: // handle XML Schema, where namespace name is mapped to URI situation
-					if ("schema".equals(keyTypeCombo.getData("keyType"))) { //$NON-NLS-1$ //$NON-NLS-2$
-						keyTypeCombo.select(0); // namespace name as URI key type
-					}
-					else {
-						keyTypeCombo.select(2); // URI key type
-					}
-					break;
-				default :
-					if (keyTypeCombo.getItemCount() > 0) {
-						keyTypeCombo.select(0);
-					}
-					break;
-			}
-
-		}
-
-		protected void updateWebAddressWidgets(int keyType) {
-			boolean isPublicKeyType = (keyType == ICatalogEntry.ENTRY_TYPE_PUBLIC);
-			checkboxButton.setEnabled(isPublicKeyType);
-			webAddressField.setEnabled(isPublicKeyType && checkboxButton.getSelection());
-		}
-
-		protected void updateWidgets(Widget widget) {
-			if (widget != keyTypeCombo) {
-				updateKeyTypeCombo(getKeyType());
-			}
-			updateWebAddressWidgets(getKeyType());
-			computeErrorMessage();
-			updateErrorMessageLabel(errorMessageLabel);
-			updateOKButtonState();
-		}
-
-	}
-
-	protected abstract class CatalogElementPage {
-
-		Control fControl;
-
-		public CatalogElementPage() {
-			super();
-
-		}
-
-		public abstract Control createControl(Composite parent);
-
-		public Control getControl() {
-			return fControl;
-		}
-
-		public abstract ICatalogElement getData();
-
-		public abstract void saveData();
-	}
-
-	protected class FilterableSelectSingleFileDialog extends SelectSingleFileDialog implements SelectionListener {
-		protected Combo filterControl;
-
-		public FilterableSelectSingleFileDialog(Shell parentShell) {
-			super(parentShell, null, true);
-			setFilters(null);
-		}
-
-		public void createAndOpen() {
-			this.create();
-			getShell().setText(XMLCatalogMessages.UI_LABEL_SELECT_FILE);
-			setBlockOnOpen(true);
-			open();
-		}
-
-		public void createFilterControl(Composite composite) {
-			Label label = new Label(composite, SWT.NONE);
-			label.setText(XMLCatalogMessages.UI_LABEL_SELECT_FILE_FILTER_CONTROL);
-
-			filterControl = new Combo(composite, SWT.NONE);
-			GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-			filterControl.setLayoutData(gd);
-
-			filterControl.setText(XMLCatalogMessages.UI_TEXT_SELECT_FILE_FILTER_CONTROL);
-
-			filterControl.add(XMLCatalogMessages.UI_TEXT_SELECT_FILE_FILTER_CONTROL);
-
-			for (Iterator i = CatalogFileTypeRegistryReader.getXMLCatalogFileTypes().iterator(); i.hasNext();) {
-				XMLCatalogFileType fileType = (XMLCatalogFileType) i.next();
-				if (fileType.description != null) {
-					filterControl.add(fileType.description);
-				}
-			}
-
-			filterControl.addSelectionListener(this);
-		}
-
-		protected void setFilters(XMLCatalogFileType fileType) {
-			if (fileType == null) {
-				// compute all the supported file extensions
-				List list = new ArrayList();
-				for (Iterator i = CatalogFileTypeRegistryReader.getXMLCatalogFileTypes().iterator(); i.hasNext();) {
-					XMLCatalogFileType theFileType = (XMLCatalogFileType) i.next();
-					if (theFileType.extensions != null) {
-						list.addAll(theFileType.extensions);
-					}
-				}
-				// Any files are now supported with Resource URI
-				// selectSingleFileView.setFilterExtensions(createStringArray(list));
-			}
-			else {
-				if (fileType.extensions != null) {
-					selectSingleFileView.setFilterExtensions(createStringArray(fileType.extensions));
-				}
-			}
-		}
-
-		public void widgetDefaultSelected(SelectionEvent e) {
-			// do nothing
-		}
-
-		public void widgetSelected(SelectionEvent e) {
-			String text = filterControl.getText();
-			XMLCatalogFileType fileType = getMatchingFileType(text);
-			setFilters(fileType);
-		}
-	}
-
-	protected class NextCatalogPage extends CatalogElementPage {
-		protected Button browseButton;
-
-		protected Text catalogLocationField;
-
-		protected INextCatalog nextCatalog;
-
-		protected Label errorMessageLabel;
-
-		protected void computeErrorMessage() {
-			errorMessage = null;
-
-			if (errorMessage == null) {
-				String fileName = catalogLocationField.getText();
-				if (fileName.trim().length() > 0) {
-					if (fileName.indexOf("..") != -1 || fileName.indexOf("./") != -1 || fileName.indexOf("/.") != -1 || fileName.indexOf(".\\") != -1 || fileName.indexOf("\\.") != -1) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-						errorMessage = XMLCatalogMessages.UI_WARNING_URI_MUST_NOT_HAVE_DOTS;
-					}
-
-					String uri = fileName;
-					if (!URIHelper.hasProtocol(uri)) {
-						uri = URIHelper.isAbsolute(uri) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
-					}
-
-					if (errorMessage == null && !URIHelper.isReadableURI(uri, false)) {
-						errorMessage = XMLCatalogMessages.UI_WARNING_URI_NOT_FOUND_COLON + fileName;
-					}
-				}
-				else {
-					// this an error that is not actually 
-					// reported ... OK is just disabled
-					errorMessage = ""; //$NON-NLS-1$
-				}
-			}
-
-		}
-
-		public Control createControl(Composite parent) {
-			fControl = createNextCatalogPanel(parent);
-			return fControl;
-		}
-
-		protected Control createNextCatalogPanel(Composite parent) {
-			ModifyListener modifyListener = new ModifyListener() {
-				public void modifyText(ModifyEvent e) {
-					updateWidgets(e.widget);
-				}
-			};
-
-			Composite composite = new Composite(parent, SWT.NONE);
-			GridData gd = new GridData(GridData.FILL_BOTH);
-			composite.setLayoutData(gd);
-
-			GridLayout layout = new GridLayout();
-			composite.setLayout(layout);
-
-			Composite group = new Composite(composite, SWT.NONE);
-			gd = new GridData(GridData.FILL_HORIZONTAL);
-			group.setLayoutData(gd);
-
-			layout = new GridLayout(2, false);
-			group.setLayout(layout);
-
-			Label resourceLocationLabel = new Label(group, SWT.NONE);
-			resourceLocationLabel.setText(XMLCatalogMessages.UI_LABEL_CATALOG_URI_COLON);
-
-			// filler
-			new Label(group, SWT.NONE);
-
-			catalogLocationField = new Text(group, SWT.SINGLE | SWT.BORDER);
-			catalogLocationField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-			catalogLocationField.setText(getDisplayValue(getNextCatalog().getCatalogLocation()));
-			// WorkbenchHelp.setHelp(resourceLocationField,
-			// XMLBuilderContextIds.XMLP_ENTRY_URI);
-			catalogLocationField.addModifyListener(modifyListener);
-
-			browseButton = createBrowseButton(group);
-			browseButton.addSelectionListener(new DropDownSelectionListener(catalogLocationField));
-
-			errorMessageLabel = new Label(group, SWT.NONE);
-			Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
-			errorMessageLabel.setForeground(color);
-			errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-			updateWidgets(null);
-			return composite;
-		}
-
-		public ICatalogElement getData() {
-			return getNextCatalog();
-		}
-
-		protected INextCatalog getNextCatalog() {
-			if (nextCatalog == null) {
-				if (fCatalogElement != null && fCatalogElement.getType() == ICatalogElement.TYPE_NEXT_CATALOG) {
-					nextCatalog = (INextCatalog) fCatalogElement;
-				}
-				else {
-					if (catalog != null) {
-						nextCatalog = (INextCatalog) catalog.createCatalogElement(ICatalogElement.TYPE_NEXT_CATALOG);
-					}
-				}
-			}
-			return nextCatalog;
-		}
-
-		public void saveData() {
-			String uri = catalogLocationField.getText();
-			if (!URIHelper.hasProtocol(uri)) {
-				uri = URIHelper.isAbsolute(uri) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
-			}
-			getNextCatalog().setCatalogLocation(uri);
-		}
-
-		protected void updateWidgets(Widget widget) {
-			computeErrorMessage();
-			updateErrorMessageLabel(errorMessageLabel);
-			updateOKButtonState();
-		}
-	}
-
-	protected class ToolBarItemSelectionChangeListener implements SelectionListener {
-		public void widgetDefaultSelected(SelectionEvent e) {
-			// TODO Auto-generated method stub
-
-		}
-
-		public void widgetSelected(SelectionEvent e) {
-			Object selection = e.getSource();
-			if (selection instanceof ToolItem) {
-				if (!showPage((CatalogElementPage) ((ToolItem) selection).getData())) {
-					// Page flipping wasn't successful
-					// handleError();
-				}
-			}
-		}
-
-	}
-
-	public static String[] createStringArray(List list) {
-		String[] stringArray = new String[list.size()];
-		for (int i = 0; i < stringArray.length; i++) {
-			stringArray[i] = (String) list.get(i);
-		}
-		return stringArray;
-	}
-
-	public static String removeLeadingSlash(String uri) {
-		// remove leading slash from the value to avoid the whole leading
-		// slash
-		// ambiguity problem
-		//       
-		if (uri != null) {
-			while (uri.startsWith("/") || uri.startsWith("\\")) { //$NON-NLS-1$ //$NON-NLS-2$
-				uri = uri.substring(1);
-			}
-		}
-		return uri;
-	}
-
-	protected ICatalog catalog;
-
-	protected ICatalogElement fCatalogElement;
-
-	protected String errorMessage;
-
-	protected Button okButton;
-
-	protected PageBook pageContainer;
-
-	protected CatalogElementPage selectedPage;
-
-	// protected TreeViewer treeViewer;
-
-	protected ToolBar toolBar;
-
-	public EditCatalogEntryDialog(Shell parentShell, ICatalog aCatalog) {
-		super(parentShell);
-		setShellStyle(getShellStyle() | SWT.RESIZE);
-		this.catalog = aCatalog;
-	}
-
-	public EditCatalogEntryDialog(Shell parentShell, ICatalogElement catalogElement) {
-		super(parentShell);
-		setShellStyle(getShellStyle() | SWT.RESIZE);
-		this.fCatalogElement = catalogElement;
-		// TODO EB: fix his
-		// entry.setURI(URIHelper.removePlatformResourceProtocol(entry.getURI()));
-	}
-
-	protected void buttonPressed(int buttonId) {
-		if (buttonId == IDialogConstants.OK_ID) {
-			selectedPage.saveData();
-		}
-		super.buttonPressed(buttonId);
-	}
-
-
-
-	protected void createButtonsForButtonBar(Composite parent) {
-		okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-		okButton.setEnabled(false);
-		createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-		updateOKButtonState();
-	}
-
-	protected void createCatalogEntryButton() {
-		CatalogElementPage page = new CatalogEntryPage();
-		page.createControl(pageContainer);
-		ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
-		toolItem.setImage(catalogEntryToolBarImage);
-		toolItem.setText(XMLCatalogMessages.EditCatalogEntryDialog_catalogEntryLabel);
-		toolItem.setData(page);
-		toolItem.addSelectionListener(new ToolBarItemSelectionChangeListener());
-	}
-
-	protected Control createDialogArea(Composite parent) {
-		Composite dialogAreaComposite = (Composite) super.createDialogArea(parent);
-		GridLayout layout = new GridLayout();
-		layout.marginHeight = 0;
-		layout.marginWidth = 0;
-		dialogAreaComposite.setLayout(layout);
-		GridData gd = new GridData(GridData.FILL_BOTH);
-		gd.widthHint = 500;
-		gd.heightHint = 250;
-		dialogAreaComposite.setLayoutData(gd);
-		createMainComponent(dialogAreaComposite);
-		return this.dialogArea;
-	}
-
-	protected Composite createMainComponent(Composite composite) {
-		if (fCatalogElement != null) // "edit" action
-		{
-			Composite composite1 = new Composite(composite, SWT.NONE);
-			GridData data = new GridData(GridData.FILL_BOTH);
-			composite1.setLayoutData(data);
-			GridLayout layout = new GridLayout();
-			composite1.setLayout(layout);
-
-			pageContainer = new PageBook(composite1, SWT.NONE);
-			pageContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-			if (fCatalogElement.getType() == ICatalogElement.TYPE_ENTRY) {
-				CatalogElementPage entryPage = new CatalogEntryPage();
-				entryPage.createControl(pageContainer);
-				showPage(entryPage);
-			}
-			else if (fCatalogElement.getType() == ICatalogElement.TYPE_NEXT_CATALOG) {
-				CatalogElementPage nextCatalogPage = new NextCatalogPage();
-				nextCatalogPage.createControl(pageContainer);
-				showPage(nextCatalogPage);
-			}
-
-			return composite1;
-		}
-		return createMainComponentWithToolbar(composite);
-		
-	}
-
-	protected Composite createMainComponentWithToolbar(Composite composite) {
-
-		FormLayout formLayout = new FormLayout();
-		formLayout.marginHeight = 5;
-		formLayout.marginWidth = 5;
-		composite.setLayout(formLayout);
-
-		Label label = new Label(composite, SWT.NONE);
-		FormData data = new FormData();
-		data.top = new FormAttachment(0, 0);
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(100, 0);
-		label.setLayoutData(data);
-
-		toolBar = new ToolBar(composite, SWT.BORDER | SWT.FLAT | SWT.VERTICAL);
-
-		data = new FormData();
-		data.top = new FormAttachment(label, 0);
-		data.left = new FormAttachment(0, 0);
-		data.bottom = new FormAttachment(100, 0);
-		// data.height = 250;
-		// data.width = 50;
-		toolBar.setLayoutData(data);
-
-		Composite composite1 = new Composite(composite, SWT.BORDER);
-		data = new FormData();
-		data.top = new FormAttachment(label, 0);
-		data.left = new FormAttachment(toolBar, 0, SWT.DEFAULT);
-		data.right = new FormAttachment(100, 0);
-		data.bottom = new FormAttachment(100, 0);
-		composite1.setLayoutData(data);
-		GridLayout layout = new GridLayout();
-		layout.marginHeight = 0;
-		layout.marginWidth = 0;
-		composite1.setLayout(layout);
-
-		// createPageBookPanel(composite1);
-		pageContainer = new PageBook(composite1, SWT.NONE);
-		pageContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-		// add pages for each type of catalog element
-		createCatalogEntryButton();
-		createNextCatalogButton();
-		if (toolBar.getItemCount() > 0) {
-			ToolItem item = toolBar.getItem(0);
-			showPage((CatalogElementPage) (item.getData()));
-		}
-		return composite1;
-	}
-
-	protected void createNextCatalogButton() {
-		CatalogElementPage page = new NextCatalogPage();
-		page.createControl(pageContainer);
-		ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
-		toolItem.setImage(nextCatalogToolBarImage);
-		toolItem.setText(XMLCatalogMessages.EditCatalogEntryDialog_nextCatalogLabel);
-		toolItem.setData(page);
-		toolItem.addSelectionListener(new ToolBarItemSelectionChangeListener());
-
-	}
-
-	protected ICatalogElement getCatalogElement() {
-		return fCatalogElement;
-	}
-
-	protected String getDisplayValue(String string) {
-		return string != null ? string : ""; //$NON-NLS-1$
-	}
-
-	protected XMLCatalogFileType getMatchingFileType(String description) {
-		XMLCatalogFileType fileType = null;
-		for (Iterator i = CatalogFileTypeRegistryReader.getXMLCatalogFileTypes().iterator(); i.hasNext();) {
-			XMLCatalogFileType theFileType = (XMLCatalogFileType) i.next();
-			if (theFileType.description != null && theFileType.description.equals(description)) {
-				fileType = theFileType;
-			}
-		}
-		return fileType;
-	}
-
-	protected boolean showPage(CatalogElementPage page) {
-		if (pageContainer.isDisposed()) {
-			return false;
-		}
-		selectedPage = page;
-		pageContainer.setVisible(true);
-		pageContainer.showPage(selectedPage.getControl());
-		fCatalogElement = selectedPage.getData();
-		return true;
-	}
-
-	protected void updateErrorMessageLabel(Label errorMessageLabel) {
-		errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
-	}
-
-	protected void updateOKButtonState() {
-		if (okButton != null) {
-			okButton.setEnabled(errorMessage == null);
-		}
-	}
-
-	protected Button createBrowseButton(Composite composite) {
-		Button browseButton = new Button(composite, SWT.FLAT);
-		// browseButton.setText(XMLCatalogMessages.
-		// UI_BUTTON_BROWSE"));
-		browseButton.setImage(borwseImage);
-		Rectangle r = borwseImage.getBounds();
-		GridData gd = new GridData();
-		int IMAGE_WIDTH_MARGIN = 6;
-		int IMAGE_HEIGHT_MARGIN = 6;
-		gd.heightHint = r.height + IMAGE_HEIGHT_MARGIN;
-		gd.widthHint = r.width + IMAGE_WIDTH_MARGIN;
-		browseButton.setLayoutData(gd);
-
-		return browseButton;
-
-	}
-
-	class DropDownSelectionListener extends SelectionAdapter {
-		private Menu menu = null;
-		private Control control;
-
-		public DropDownSelectionListener(Control aControl) {
-			super();
-			this.control = aControl;
-		}
-
-		public void widgetSelected(SelectionEvent event) {
-			// Create the menu if it has not already been created
-			if (menu == null) {
-				// Lazy create the menu.
-				menu = new Menu(getShell());
-				MenuItem menuItem = new MenuItem(menu, SWT.NONE);
-				menuItem.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_WORKSPACE);
-				/*
-				 * Add a menu selection listener so that the menu is hidden
-				 * when the user selects an item from the drop down menu.
-				 */
-				menuItem.addSelectionListener(new SelectionAdapter() {
-					public void widgetSelected(SelectionEvent e) {
-						setMenuVisible(false);
-						invokeWorkspaceFileSelectionDialog();
-					}
-				});
-
-				menuItem = new MenuItem(menu, SWT.NONE);
-				menuItem.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_FILE_SYSTEM);
-				/*
-				 * Add a menu selection listener so that the menu is hidden
-				 * when the user selects an item from the drop down menu.
-				 */
-				menuItem.addSelectionListener(new SelectionAdapter() {
-					public void widgetSelected(SelectionEvent e) {
-						setMenuVisible(false);
-						invokeFileSelectionDialog();
-					}
-				});
-
-			}
-
-			// Position the menu below and vertically aligned with the the
-			// drop down tool button.
-			Button button = (Button) event.widget;
-
-			// set location
-			Point ptBrowse = button.getLocation();
-			Rectangle rcBrowse = button.getBounds();
-			ptBrowse.y += rcBrowse.height;
-			ptBrowse = button.getParent().toDisplay(ptBrowse);
-			menu.setLocation(ptBrowse.x, ptBrowse.y);
-
-			setMenuVisible(true);
-
-		}
-
-		void setMenuVisible(boolean visible) {
-			menu.setVisible(visible);
-			// this.visible = visible;
-		}
-
-		void invokeWorkspaceFileSelectionDialog() {
-			FilterableSelectSingleFileDialog dialog = new FilterableSelectSingleFileDialog(getShell());
-			dialog.createAndOpen();
-
-			IFile file = dialog.getFile();
-			if (file != null) {
-				// remove leading slash from the value to avoid the
-				// whole leading slash ambiguity problem
-				//                    
-				String uri = file.getFullPath().toString();
-				while (uri.startsWith("/") || uri.startsWith("\\")) { //$NON-NLS-1$ //$NON-NLS-2$
-					uri = uri.substring(1);
-				}
-				if (control instanceof Text) {
-					((Text) control).setText(uri);
-				}
-
-			}
-		}
-
-		void invokeFileSelectionDialog() {
-			FileDialog dialog = new FileDialog(getShell(), SWT.SINGLE);
-			String file = dialog.open();
-			if (control instanceof Text && file != null) {
-				((Text) control).setText(file);
-			}
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ElementNodePage.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ElementNodePage.java
deleted file mode 100644
index 77a9c40..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ElementNodePage.java
+++ /dev/null
@@ -1,27 +0,0 @@
-
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
-
-
-public abstract class ElementNodePage {
-	
-	Control fControl;
-	
-	public ElementNodePage() {
-		super();
-		
-	}
-	
-	public abstract Control createControl(Composite parent);
-	
-	public Control getControl(){
-		return fControl;
-	}
-	
-	public abstract void saveData();
-	
-	public abstract ICatalogElement getData();
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ImageFactory.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ImageFactory.java
deleted file mode 100644
index 46cc060..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ImageFactory.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
-* Copyright (c) 2002, 2005 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - Initial API and implementation
-*   Jens Lukowski/Innoopract - initial renaming/restructuring
-* 
-*/
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-import java.util.Hashtable;
-
-import org.eclipse.jface.resource.CompositeImageDescriptor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-public class ImageFactory
-{                                
-  public static final int TOP_LEFT = 1;
-  public static final int TOP_RIGHT = 2;
-  public static final int BOTTOM_LEFT = 3;
-  public static final int BOTTOM_RIGHT = 4;     
-
-  protected static final int[][] OVERLAY_COORDINATE = {{0,0},{0,2},{2,0},{2,2}};
-  
-  protected static ImageFactory INSTANCE = new ImageFactory();
-
-  protected Hashtable compositeImageTable = new Hashtable();
-
-  public ImageFactory()
-  {
-	  super();
-  }
-  
-	public Image getImage(String iconName)
-	{
-	  ImageRegistry imageRegistry = XMLUIPlugin.getDefault().getImageRegistry();
-    
-	  if (imageRegistry.get(iconName) != null)
-	  {
-		return imageRegistry.get(iconName);
-	  }
-	  else
-	  {
-		imageRegistry.put(iconName, ImageDescriptor.createFromFile(getClass(), iconName));
-		return imageRegistry.get(iconName);
-	  }
-	}
-
-  public Image createCompositeImage(Image base, Image overlay, int overlayPosition)
-  {                                                   
-    String key = base + "*" + overlay + "*" + overlayPosition; //$NON-NLS-1$ //$NON-NLS-2$
-    Image result = (Image)compositeImageTable.get(key);
-    if (result == null)
-    {
-      ImageDescriptor overlays[][] = new ImageDescriptor[3][3]; 
-      int[] coord = OVERLAY_COORDINATE[overlayPosition];
-      overlays[coord[1]][coord[0]] = new ImageBasedImageDescriptor(overlay);
-      OverlayIcon icon = new OverlayIcon(new ImageBasedImageDescriptor(base), overlays, new Point(16, 16));
-      result = icon.createImage();
-      compositeImageTable.put(key, result);
-    }
-    return result;
-  }  
-
-
-  public static ImageDescriptor createImageDescriptorWrapper(Image image)
-  {
-    return new ImageBasedImageDescriptor(image);
-  }
-
-  /**
-   * An OverlayIcon consists of a main icon and several adornments.
-   */
-   class OverlayIcon extends CompositeImageDescriptor {
-
-      static final int DEFAULT_WIDTH = 22;
-
-      static final int DEFAULT_HEIGHT = 16;
-
-      private Point fSize = null;
-
-      private ImageDescriptor fBase;
-
-      private ImageDescriptor fOverlays[][];
-
-      public OverlayIcon(ImageDescriptor base, ImageDescriptor[][] overlays,
-              Point size) {
-          fBase = base;
-          fOverlays = overlays;
-          fSize = size;
-      }
-
-      protected void drawBottomLeft(ImageDescriptor[] overlays) {
-          if (overlays == null)
-              return;
-          int length = overlays.length;
-          int x = 0;
-          for (int i = 0; i < 3; i++) {
-              if (i < length && overlays[i] != null) {
-                  ImageData id = overlays[i].getImageData();
-                  drawImage(id, x, getSize().y - id.height);
-                  x += id.width;
-              }
-          }
-      }
-
-      protected void drawBottomRight(ImageDescriptor[] overlays) {
-          if (overlays == null)
-              return;
-          int length = overlays.length;
-          int x = getSize().x;
-          for (int i = 2; i >= 0; i--) {
-              if (i < length && overlays[i] != null) {
-                  ImageData id = overlays[i].getImageData();
-                  x -= id.width;
-                  drawImage(id, x, getSize().y - id.height);
-              }
-          }
-      }
-
-      /**
-       * @see CompositeImageDescriptor#drawCompositeImage(int, int)
-       */
-      protected void drawCompositeImage(int width, int height) {
-          ImageData bg;
-          if (fBase == null || (bg = fBase.getImageData()) == null)
-              bg = DEFAULT_IMAGE_DATA;
-          drawImage(bg, 0, 0);
-
-          if (fOverlays != null) {
-              if (fOverlays.length > 0)
-                  drawTopRight(fOverlays[0]);
-
-              if (fOverlays.length > 1)
-                  drawBottomRight(fOverlays[1]);
-
-              if (fOverlays.length > 2)
-                  drawBottomLeft(fOverlays[2]);
-
-              if (fOverlays.length > 3)
-                  drawTopLeft(fOverlays[3]);
-          }
-      }
-
-      protected void drawTopLeft(ImageDescriptor[] overlays) {
-          if (overlays == null)
-              return;
-          int length = overlays.length;
-          int x = 0;
-          for (int i = 0; i < 3; i++) {
-              if (i < length && overlays[i] != null) {
-                  ImageData id = overlays[i].getImageData();
-                  drawImage(id, x, 0);
-                  x += id.width;
-              }
-          }
-      }
-
-      protected void drawTopRight(ImageDescriptor[] overlays) {
-          if (overlays == null)
-              return;
-          int length = overlays.length;
-          int x = getSize().x;
-          for (int i = 2; i >= 0; i--) {
-              if (i < length && overlays[i] != null) {
-                  ImageData id = overlays[i].getImageData();
-                  x -= id.width;
-                  drawImage(id, x, 0);
-              }
-          }
-      }
-
-      /**
-       * @see CompositeImageDescriptor#getSize()
-       */
-      protected Point getSize() {
-          return fSize;
-      }
-  }
-
-   static class ImageBasedImageDescriptor extends ImageDescriptor
-  {
-    protected Image image;
-
-    public ImageBasedImageDescriptor(Image image)
-    {
-      this.image = image;
-    }                    
-
-    public ImageData getImageData()
-    {
-      return image.getImageData();
-    }
-  }  
-}
-
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntriesView.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntriesView.java
deleted file mode 100644
index 5d0be8c..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntriesView.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
-* Copyright (c) 2002, 2005 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - Initial API and implementation
-*   Jens Lukowski/Innoopract - initial renaming/restructuring
-* 
-*/
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-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.Shell;
-import org.eclipse.wst.xml.core.internal.catalog.Catalog;
-import org.eclipse.wst.xml.core.internal.catalog.CatalogElement;
-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.ui.internal.XMLUIPlugin;
-
-
-
-public class XMLCatalogEntriesView extends Composite
-{
-  protected Button newButton;
-  protected Button editButton;
-  protected Button deleteButton;
-  protected XMLCatalogTreeViewer tableViewer;
-  protected ICatalog workingUserCatalog;
-  protected ICatalog systemCatalog;
-  //protected boolean isPageEnabled = true;
-
-  public XMLCatalogEntriesView(Composite parent, ICatalog workingUserCatalog, ICatalog systemCatalog)
-  {
-    super(parent, SWT.NONE);
-    this.workingUserCatalog = workingUserCatalog;
-    this.systemCatalog = systemCatalog;
-
-    GridLayout gridLayout = new GridLayout();
-    this.setLayout(gridLayout);
-
-    tableViewer = createTableViewer(this);
-    tableViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
-    tableViewer.setInput("dummy"); //$NON-NLS-1$
-    tableViewer.expandToLevel(2);
-    tableViewer.reveal(XMLCatalogTreeViewer.USER_SPECIFIED_ENTRIES_OBJECT);
-
-    ISelectionChangedListener listener = new ISelectionChangedListener()
-    {
-      public void selectionChanged(SelectionChangedEvent event)
-      {
-        updateWidgetEnabledState();
-      }
-    };
-    tableViewer.addSelectionChangedListener(listener);
-
-    createButtons(this);
-  }
-
-  public static String removeLeadingSlash(String uri)
-  {
-    // remove leading slash from the value to avoid the whole leading slash ambiguity problem
-    //       
-    if (uri != null)
-    {
-      while (uri.startsWith("/") || uri.startsWith("\\")) //$NON-NLS-1$ //$NON-NLS-2$
-      {
-        uri = uri.substring(1);
-      }
-    }
-    return uri;
-  }
-
-  protected XMLCatalogTreeViewer createTableViewer(Composite parent)
-  {
-    String headings[] = new String[2];
-    headings[0] = XMLCatalogMessages.UI_LABEL_KEY;
-    headings[1] = XMLCatalogMessages.UI_LABEL_URI;
-
-    XMLCatalogTreeViewer theTableViewer = new XMLCatalogTreeViewer(parent, workingUserCatalog, systemCatalog);
-    return theTableViewer;
-  }
-
-  protected void createButtons(Composite parent)
-  {
-    Composite composite = new Composite(parent, SWT.NONE);
-    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-    GridLayout gridLayout = new GridLayout();
-    gridLayout.numColumns = 7;
-    gridLayout.makeColumnsEqualWidth = true;
-    composite.setLayout(gridLayout);
-
-    GridData gd = new GridData();
-    gd.horizontalAlignment = GridData.FILL;
-    gd.grabExcessHorizontalSpace = true;
-    gd.horizontalSpan = 4;
-
-    Button hiddenButton = new Button(composite, SWT.NONE);
-    hiddenButton.setLayoutData(gd);
-    hiddenButton.setVisible(false);
-    hiddenButton.setEnabled(false);
-
-    SelectionListener selectionListener = new SelectionAdapter()
-    {
-      public void widgetSelected(SelectionEvent e)
-      {
-        if (e.widget == newButton)
-        {
-          performNew();
-        }
-        else if (e.widget == editButton)
-        {
-          performEdit();
-        }
-        else if (e.widget == deleteButton)
-        {
-          performDelete();
-        }
-      }
-    };
-
-    // add the "New..." button
-    //
-    gd = new GridData();
-    gd.horizontalAlignment = GridData.FILL;
-    gd.grabExcessHorizontalSpace = true;
-
-    newButton = new Button(composite, SWT.NONE);
-    newButton.setText(XMLCatalogMessages.UI_BUTTON_NEW);
-    //WorkbenchHelp.setHelp(newButton, XMLBuilderContextIds.XMLP_MAPPING_NEW);
-    newButton.setLayoutData(gd);
-    newButton.addSelectionListener(selectionListener);
-
-    // add the "Edit..." button
-    //
-    gd = new GridData();
-    gd.horizontalAlignment = GridData.FILL;
-    gd.grabExcessHorizontalSpace = true;
-    editButton = new Button(composite, SWT.NONE);
-    editButton.setText(XMLCatalogMessages.UI_BUTTON_EDIT);
-    //WorkbenchHelp.setHelp(editButton, XMLBuilderContextIds.XMLP_MAPPING_EDIT);
-    editButton.setLayoutData(gd);
-    editButton.addSelectionListener(selectionListener);
-
-    // add the "Delete" button
-    //
-    gd = new GridData();
-    gd.horizontalAlignment = GridData.FILL;
-    gd.grabExcessHorizontalSpace = true;
-    deleteButton = new Button(composite, SWT.NONE);
-    deleteButton.setText(XMLCatalogMessages.UI_BUTTON_DELETE);
-    //WorkbenchHelp.setHelp(deleteButton, XMLBuilderContextIds.XMLP_MAPPING_DELETE);
-    deleteButton.setLayoutData(gd);
-    deleteButton.addSelectionListener(selectionListener);
-
-    // a cruddy hack so that the PreferenceDialog doesn't close every time we press 'enter'
-    //
-    getShell().setDefaultButton(hiddenButton);
-    updateWidgetEnabledState();
-  }
-
-  public void refresh()
-  {
-    tableViewer.refresh();//XMLCatalogTreeViewer.USER_SPECIFIED_ENTRIES_OBJECT);
-  }
-
-  protected EditCatalogEntryDialog invokeDialog(String title, ICatalogElement entry)
-  {
-    Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-	EditCatalogEntryDialog dialog = new EditCatalogEntryDialog(shell, entry);
-    dialog.create();
-    dialog.getShell().setText(title);
-    dialog.setBlockOnOpen(true);
-    dialog.open();
-    return dialog;
-  }
-  
-  protected EditCatalogEntryDialog invokeDialog(String title, ICatalog catalog)
-  {
-    Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-	EditCatalogEntryDialog dialog = new EditCatalogEntryDialog(shell, catalog);
-    dialog.create();
-    dialog.getShell().setText(title);
-    dialog.setBlockOnOpen(true);
-    dialog.open();
-    return dialog;
-  }
-  
-
-  protected void performNew()
-  {
-
-	//ICatalogEntry newEntry = (ICatalogEntry)workingUserCatalog.createCatalogElement(ICatalogElement.TYPE_ENTRY);
-    EditCatalogEntryDialog dialog = invokeDialog(XMLCatalogMessages.UI_LABEL_NEW_DIALOG_TITLE, workingUserCatalog);
-    ICatalogElement element = dialog.getCatalogElement();
-	if (dialog.getReturnCode() == Window.OK)
-    {
-      workingUserCatalog.addCatalogElement(element);
-      tableViewer.setSelection(new StructuredSelection(element), true);
-	  tableViewer.refresh();
-    }
-  }
-
-  protected void performEdit()
-  {
-    ISelection selection = tableViewer.getSelection();
-    Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
-
-    if (selectedObject instanceof ICatalogElement)
-    {
-		ICatalogElement oldEntry = (ICatalogElement) selectedObject;
-		ICatalogElement newEntry = (ICatalogElement)((CatalogElement)oldEntry).clone();
-
-      EditCatalogEntryDialog dialog = invokeDialog(XMLCatalogMessages.UI_LABEL_EDIT_DIALOG_TITLE, newEntry);
-      if (dialog.getReturnCode() == Window.OK)
-      {
-        // delete the old value if the 'mapFrom' has changed
-        //
-        workingUserCatalog.removeCatalogElement(oldEntry);
-
-        // update the new mapping
-        //
-        workingUserCatalog.addCatalogElement(newEntry);
-        tableViewer.setSelection(new StructuredSelection(newEntry));
-      }
-    }
-  }
-
-  protected void performDelete()
-  {
-    ISelection selection = tableViewer.getSelection();
-    Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
-
-    if (selectedObject instanceof ICatalogElement)
-    {
-	  ICatalogElement catalogElement = (ICatalogElement) selectedObject;
-      workingUserCatalog.removeCatalogElement(catalogElement);
-    }
-  }
-
-  protected void updateWidgetEnabledState()
-  {
-	  boolean isEditable = false;
-	  ISelection selection = tableViewer.getSelection();
-	  Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
-	  
-	  if (selectedObject instanceof ICatalogElement)
-	  {
-		  ICatalogElement[] elements = ((Catalog)workingUserCatalog).getCatalogElements();
-		  //dw List entriesList = new ArrayList(elements.length);
-		  for (int i = 0; i < elements.length; i++)
-		  {
-			  ICatalogElement element = elements[i];
-			  isEditable = selectedObject.equals(element);
-			  if(isEditable) break;  
-		  }
-	  }
-	  
-	  //if (isPageEnabled)
-	  {
-		  editButton.setEnabled(isEditable);
-		  deleteButton.setEnabled(isEditable);
-	  }
-  }
-
-/*
-  public void setPageEnabled(boolean enabled)
-  {
-    isPageEnabled = enabled;
-
-    tableViewer.getControl().setEnabled(isPageEnabled);
-
-    newButton.setEnabled(isPageEnabled);
-    editButton.setEnabled(isPageEnabled);
-    deleteButton.setEnabled(isPageEnabled);
-  }
-*/
-  public void updatePage()
-  {
-    refresh();
-    updateWidgetEnabledState();
-  }
-
-  public Viewer getViewer()
-  {
-    return tableViewer;
-  }
-  
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntryDetailsView.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntryDetailsView.java
deleted file mode 100644
index 6c5fbc6..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntryDetailsView.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-* Copyright (c) 2002, 2005 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - Initial API and implementation
-*   Jens Lukowski/Innoopract - initial renaming/restructuring
-* 
-*/
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-
-
-
-                       
-public class XMLCatalogEntryDetailsView
-{                      
-  protected Text detailsText;
-  protected ScrollBar verticalScroll, horizontalScroll;
-
-  public XMLCatalogEntryDetailsView(Composite parent) 
-  {
-    Color color = parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND); 
-                
-	detailsText = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
-
-	GridData data = new GridData(GridData.FILL_BOTH);	
-	data.heightHint = 65;
-	detailsText.setLayoutData(data);
-
-    verticalScroll = detailsText.getVerticalBar();
-    //verticalScroll.setVisible(false);
-    horizontalScroll = detailsText.getHorizontalBar();
-    detailsText.setEditable(false);
-    detailsText.setBackground(color);
-  }
-
-  public void setCatalogElement(ICatalogEntry entry)
-  {                       
-    String value = getDisplayValue(entry != null ? entry.getURI() : ""); //$NON-NLS-1$
-    String line1 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_COLON + "\t\t" + value; //$NON-NLS-1$
-    
-    value = entry != null ? getKeyTypeValue(entry) : ""; //$NON-NLS-1$
-    String line2 = XMLCatalogMessages.UI_KEY_TYPE_DETAILS_COLON + "\t" + value; //$NON-NLS-1$
-
-    value = getDisplayValue(entry != null ? entry.getKey() : ""); //$NON-NLS-1$
-    String line3 = XMLCatalogMessages.UI_LABEL_DETAILS_KEY_COLON + "\t\t" + value; //$NON-NLS-1$
-
-    String entireString = "\n" + line1 + "\n" + line2 + "\n" + line3; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-    detailsText.setText(entireString);
-  }  
-  
-  public void setCatalogElement(INextCatalog nextCatalog)
-  {                       
-    String value = getDisplayValue(nextCatalog != null ? nextCatalog.getCatalogLocation() : ""); //$NON-NLS-1$
-    String line1 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_COLON + "\t\t" + value; //$NON-NLS-1$
-    
-    String entireString = "\n" + line1; //$NON-NLS-1$
-    detailsText.setText(entireString);
-  }  
-
-  protected String getDisplayValue(String string)
-  {
-    return string != null ? string : ""; //$NON-NLS-1$
-  }      
-
-  protected String getKeyTypeValue(ICatalogEntry entry)
-  {
-    String result = null; 
-    if (entry.getURI() != null && entry.getURI().endsWith("xsd"))     //$NON-NLS-1$
-    {             
-      result = (entry.getEntryType() == ICatalogEntry.ENTRY_TYPE_URI) ?                       
-               XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC :
-               XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM;
-    } 
-    else
-    {                                             
-      switch (entry.getEntryType()) {
-			case ICatalogEntry.ENTRY_TYPE_PUBLIC:
-				result = XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC;
-				break;
-			case ICatalogEntry.ENTRY_TYPE_SYSTEM:
-				result = XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM;
-				break;
-			default:
-				result = XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI;
-				break;
-			}
-
-    }
-    return result;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogFileType.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogFileType.java
deleted file mode 100644
index 61fe779..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogFileType.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - Initial API and implementation
-*   Jens Lukowski/Innoopract - initial renaming/restructuring
-* 
-*/
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.swt.graphics.Image;
-
-
-public class XMLCatalogFileType 
-{
-  public String description;
-  public List extensions = new ArrayList();
-  public String iconFileName;
-  public Image icon; 
-    
-  public void addExtensions(String contributedExtensions)
-  {
-	List list = parseExtensions(contributedExtensions);
-	for (Iterator i = list.iterator(); i.hasNext(); )
-	{
-	  String extension = (String)i.next();
-	  if (!extensions.contains(extension))
-	  {
-		extensions.add(extension);
-	  }
-	}
-  }  
-  
-  protected List parseExtensions(String string)
-  {
-	List list = new ArrayList();
-	for (StringTokenizer st = new StringTokenizer(string, ", "); st.hasMoreTokens(); ) //$NON-NLS-1$
-	{
-	  String token = st.nextToken();
-	  if (token != null)
-	  {          	
-		list.add(token); 
-	  }        	  	 
-	}  
-	return list;
-  } 
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java
deleted file mode 100644
index b1ff199..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java
+++ /dev/null
@@ -1,128 +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.ui.internal.catalog;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML Editor
- * 
- * @plannedfor 1.0
- */
-public class XMLCatalogMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.xml.ui.internal.catalog.XMLCatalogResources";//$NON-NLS-1$
-	
-	public static String UI_WIZARD_SCHEMA_AND_NAME_SPACE_INFO;
-	public static String UI_LABEL_NAME_SPACE_PREFIX;
-    public static String UI_LABEL_NAME_SPACE_URI;
-	public static String UI_LABEL_XSD_LOCATION;
-	public static String UI_LABEL_DOCTYPE_INFORMATION;
-	public static String UI_LABEL_SYSTEM_ID;
-	public static String UI_LABEL_PUBLIC_ID;
-	public static String UI_LABEL_SELECT_FILE;
-	public static String UI_LABEL_KEY;
-	public static String UI_LABEL_KEY_COLON;
-	public static String UI_LABEL_DETAILS_KEY_COLON;
-	public static String UI_LABEL_URI;
-	public static String UI_LABEL_URI_COLON;
-	public static String UI_LABEL_CATALOG_URI_COLON;
-	public static String UI_LABEL_DETAILS_URI_COLON;
-	public static String UI_KEY_TYPE_COLON;
-	public static String UI_KEY_TYPE_DETAILS_COLON;
-	public static String UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC;
-	public static String UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM;
-	public static String UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC;
-	public static String UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM;
-	public static String UI_KEY_TYPE_DESCRIPTION_URI;
-	public static String UI_LABEL_SPECIFY_ALTERNATIVE_WEB_URL;
-	public static String UI_WARNING_URI_MUST_NOT_HAVE_DOTS;
-
-	public static String UI_WARNING_URI_NOT_FOUND_COLON;
-	public static String UI_WARNING_URI_NOT_FOUND_LONG;
-	public static String UI_WARNING_INVALID_FILE;
-	public static String UI_WARNING_INVALID_FILE_LONG;
-	public static String UI_WARNING_NO_ELEMENT;
-	public static String UI_WARNING_NO_ELEMENT_DTD_LONG;
-	public static String UI_WARNING_NO_ELEMENT_XSD_LONG;
-
-
-	//NewModelWizard
-	public static String UI_INVALID_GRAMMAR_ERROR;
-	public static String UI_BUTTON_BROWSE;
-
-	//XMLCatalogIdMappingPage
-	public static String UI_LABEL_MAP_TO;
-	public static String UI_LABEL_MAP_FROM ;
-	public static String UI_BUTTON_NEW;
-	public static String UI_BUTTON_EDIT;
-	public static String UI_BUTTON_DELETE;
-	public static String UI_LABEL_NEW_DIALOG_TITLE;
-	public static String UI_LABEL_EDIT_DIALOG_TITLE;
-
-
-	// XMLCatalogPreferencePage
-	public static String UI_LABEL_USER_ENTRIES;
-	public static String UI_LABEL_USER_ENTRIES_TOOL_TIP;
-	public static String UI_LABEL_SYSTEM_ENTRIES;
-	public static String UI_LABEL_SYSTEM_ENTRIES_TOOL_TIP;
-	public static String UI_BUTTON_CHANGE;
-	public static String UI_LABEL_SELECT_PROJECT;
-	public static String UI_LABEL_SPECIFY_PROJECT_DESCRIPTION;
-	public static String UI_WARNING_NO_PROJECTS_CREATED;
-	public static String UI_WARNING_PROJECT_NOT_SPECIFIED ;
-	public static String UI_WARNING_PROJECT_DOES_NOT_EXIST ;
-	public static String UI_LABEL_PROJECT_TO_USE ;
-	public static String UI_LABEL_CATALOG_SAVE_ERROR;
-	public static String UI_LABEL_CATALOG_COULD_NOT_BE_SAVED;
-	public static String UI_LABEL_ADVANCED;
-	public static String UI_LABEL_ADVANCED_XML_CATALOG_PREFS;   
-	public static String UI_LABEL_SPECIFY_PERSISTENCE_FILE;
-	public static String UI_LABEL_SAVE_CATALOG_DIALOG_TITLE;
-	public static String UI_LABEL_SAVE_CATALOG_DIALOG_DESC;   
-	public static String UI_LABEL_BROWSE_CATALOG_FILE_TITLE;
-	public static String UI_LABEL_BROWSE_CATALOG_FILE_DESC;   
-	public static String UI_LABEL_DETAILS;
-	public static String UI_LABEL_USER_SPECIFIED_ENTRIES;
-	public static String UI_LABEL_PLUGIN_SPECIFIED_ENTRIES;
-
-	// AdvancedOptionsDialog
-	public static String UI_BUTTON_IMPORT;
-	public static String UI_BUTTON_EXPORT;
-	                                   
-	public static String UI_LABEL_IMPORT_DIALOG_TITLE;
-	public static String UI_LABEL_IMPORT_DIALOG_HEADING;
-	public static String UI_LABEL_IMPORT_DIALOG_MESSAGE;
-
-	public static String UI_LABEL_EXPORT_DIALOG_TITLE;
-	public static String UI_LABEL_EXPORT_DIALOG_HEADING;
-	public static String UI_LABEL_EXPORT_DIALOG_MESSAGE;
-	public static String ERROR_SAVING_FILE;
-	public static String UI_LABEL_FILE_IS_READ_ONLY;
-	public static String UI_LABEL_DIALOG_DESCRIPTION;
-
-	public static String EditCatalogEntryDialog_catalogEntryLabel;
-	public static String EditCatalogEntryDialog_nextCatalogLabel;
-	public static String UI_BUTTON_MENU_BROWSE_WORKSPACE;
-	public static String UI_BUTTON_MENU_BROWSE_FILE_SYSTEM;
-	public static String UI_LABEL_SELECT_FILE_FILTER_CONTROL;
-	public static String UI_TEXT_SELECT_FILE_FILTER_CONTROL;
-	
-	
-
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, XMLCatalogMessages.class);
-	}
-	
-	private XMLCatalogMessages() {
-		// cannot create new instance
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java
deleted file mode 100644
index f474f57..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 2002, 2005 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
-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.ICatalogEvent;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogListener;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-
-public class XMLCatalogPreferencePage extends PreferencePage implements
-        IWorkbenchPreferencePage, ICatalogListener
-{
-
-    protected XMLCatalogEntriesView catalogEntriesView;
-
-    protected ICatalog workingUserCatalog;
-
-    protected ICatalog systemCatalog;
-
-    protected ICatalog userCatalog;
-
-    protected ICatalog defaultCatalog;
-
-    protected Button advancedButton;
-
-    public XMLCatalogPreferencePage()
-    {
-        defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
-        INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
-        for (int i = 0; i < nextCatalogs.length; i++)
-        {
-            INextCatalog catalog = nextCatalogs[i];
-            ICatalog referencedCatalog = catalog.getReferencedCatalog();
-            if (referencedCatalog != null)
-            {
-                if (XMLCorePlugin.SYSTEM_CATALOG_ID
-                        .equals(referencedCatalog.getId()))
-                {
-                    systemCatalog = referencedCatalog;
-                } else if (XMLCorePlugin.USER_CATALOG_ID
-                        .equals(referencedCatalog.getId()))
-                {
-                    userCatalog = referencedCatalog;
-                }
-            }
-        }
-    }
-
-    public void dispose()
-    {
-        super.dispose();
-        workingUserCatalog.removeListener(this);
-    }
-
-    /**
-     * Refresh the view in responce to an event sent by the Catalog
-     */
-    public void catalogChanged(ICatalogEvent event)
-    {
-        catalogEntriesView.updatePage();
-    }
-
-    /**
-     * Creates preference page controls on demand.
-     * 
-     * @param parent
-     *            the parent for the preference page
-     */
-    protected Control createContents(Composite parent)
-    {
-        // we create a working copy of the 'User Settings' for the Catalog
-        // that we can modify
-        CatalogSet tempCatalogSet = new CatalogSet(); 
-        workingUserCatalog = tempCatalogSet.lookupOrCreateCatalog("working", ""); //$NON-NLS-1$ //$NON-NLS-2$
-        
-        // TODO: add entries from the nested catalogs as well
-        workingUserCatalog.addEntriesFromCatalog(userCatalog);
-        workingUserCatalog.addListener(this);
-        noDefaultAndApplyButton();
-        Composite composite = new Composite(parent, SWT.NULL);
-        // WorkbenchHelp.setHelp(composite, new
-        // ControlContextComputer(composite,
-        // XMLBuilderContextIds.XMLP_CATALOG_PAGE));
-        composite.setLayout(new GridLayout());
-        composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-        createCatalogEntriesView(composite);
-        createCatalogDetailsView(composite);
-        createAdvancedButton(composite);
-        // catalogEntriesView.updatePage();
-        return composite;
-    }
-
-    protected void createAdvancedButton(Composite composite)
-    {
-        Composite panel = new Composite(composite, SWT.NONE);
-        GridLayout gridLayout = new GridLayout();
-        gridLayout.numColumns = 3;
-        panel.setLayout(gridLayout);
-        panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        // TODO... is there a better way to expand the page width?
-        // This invisible label is created to force the width of the page to be
-        // wide enough to show
-        // the rather long uri and key fields of a catalog entry.
-        Label widthFudger = new Label(panel, SWT.NONE);
-        String widthFudgerString = ""; //$NON-NLS-1$
-        for (int i = 0; i < 55; i++)
-        {
-            widthFudgerString += "x"; //$NON-NLS-1$
-        }
-        widthFudger.setText(widthFudgerString);
-        widthFudger.setVisible(false);
-        Composite placeHolder = new Composite(panel, SWT.NONE);
-        placeHolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        advancedButton = new Button(panel, SWT.NONE);
-        advancedButton.setText(XMLCatalogMessages.UI_LABEL_ADVANCED);
-        SelectionListener selectionListener = new SelectionAdapter()
-        {
-            public void widgetSelected(SelectionEvent e)
-            {
-                AdvancedOptionsDialog dialog = new AdvancedOptionsDialog(
-                        getShell(), workingUserCatalog);
-                dialog.create();
-                dialog
-                        .getShell()
-                        .setText(
-                                XMLCatalogMessages.UI_LABEL_ADVANCED_XML_CATALOG_PREFS);
-                dialog.setBlockOnOpen(true);
-                dialog.open();
-            }
-        };
-        advancedButton.addSelectionListener(selectionListener);
-    }
-
-    public boolean isSameFileName(String a, String b)
-    {
-        boolean result = false;
-        if (a == null && b == null)
-        {
-            result = true;
-        } else if (a != null && b != null)
-        {
-            result = a.equals(b);
-        }
-        return result;
-    }
-
-    protected void createCatalogEntriesView(Composite parent)
-    {
-        Group group = new Group(parent, SWT.NONE);
-        group.setLayout(new GridLayout());
-        group.setLayoutData(new GridData(GridData.FILL_BOTH));
-        group.setText(XMLCatalogMessages.UI_LABEL_USER_ENTRIES);
-        group.setToolTipText(XMLCatalogMessages.UI_LABEL_USER_ENTRIES_TOOL_TIP);
-        // WorkbenchHelp.setHelp(userEntriesGroup, new
-        // ControlContextComputer(userEntriesGroup,
-        // XMLBuilderContextIds.XMLP_CATALOG_USER_GROUP));
-        catalogEntriesView = new XMLCatalogEntriesView(group,
-                workingUserCatalog, systemCatalog);
-        catalogEntriesView.setLayoutData(new GridData(GridData.FILL_BOTH));
-    }
-
-    protected void createCatalogDetailsView(Composite parent)
-    {
-        Group detailsGroup = new Group(parent, SWT.NONE);
-        detailsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        detailsGroup.setLayout(new GridLayout());
-        detailsGroup.setText(XMLCatalogMessages.UI_LABEL_DETAILS);
-        final XMLCatalogEntryDetailsView detailsView = new XMLCatalogEntryDetailsView(
-                detailsGroup);
-        ISelectionChangedListener listener = new ISelectionChangedListener()
-        {
-            public void selectionChanged(SelectionChangedEvent event)
-            {
-                ISelection selection = event.getSelection();
-                Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection)
-                        .getFirstElement()
-                        : null;
-                if (selectedObject instanceof ICatalogEntry)
-                {
-                    ICatalogEntry entry = (ICatalogEntry) selectedObject;
-                    detailsView.setCatalogElement(entry);
-                } else if (selectedObject instanceof INextCatalog)
-                {
-                	INextCatalog entry = (INextCatalog) selectedObject;
-                    detailsView.setCatalogElement(entry);
-                }
-                
-            }
-        };
-        catalogEntriesView.getViewer().addSelectionChangedListener(listener);
-    }
-
-    /**
-     * Do anything necessary because the OK button has been pressed.
-     * 
-     * @return whether it is okay to close the preference page
-     */
-    public boolean performOk()
-    {
-        return storeValues();
-    }
-
-    /**
-     * @see IWorkbenchPreferencePage
-     */
-    public void init(IWorkbench workbench)
-    {
-    }
-
-    /**
-     * Stores the values of the controls back to the preference store.
-     */
-    private boolean storeValues()
-    {
-       //dw  Object fileObject = null;
-        try
-        {
-            // update the userCatalog so that its the same as the working
-            // catalog
-            userCatalog.clear();
-            // TODO add entries from the nested catalogs?
-            userCatalog.addEntriesFromCatalog(workingUserCatalog);
-            // now save the userCatalog
-            userCatalog.save();
-        } catch (Exception e)
-        {
-        }
-        return true;
-    }
-    
-	
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties
deleted file mode 100644
index 08e7ac9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties
+++ /dev/null
@@ -1,104 +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
-###############################################################################
-UI_WIZARD_SCHEMA_AND_NAME_SPACE_INFO = Schema and Namespace Information
-UI_LABEL_NAME_SPACE_PREFIX           = Namespace prefix:
-UI_LABEL_NAME_SPACE_URI              = Namespace URI:
-UI_LABEL_XSD_LOCATION                = Schema location:
-UI_LABEL_DOCTYPE_INFORMATION         = Document type information
-UI_LABEL_SYSTEM_ID                   = &System ID:
-UI_LABEL_PUBLIC_ID                   = &Public ID:
-UI_LABEL_SELECT_FILE                 = Select File
-UI_LABEL_KEY                         = Key
-UI_LABEL_KEY_COLON                   = &Key:
-UI_LABEL_DETAILS_KEY_COLON           = Key:
-UI_LABEL_URI                         = URI
-UI_LABEL_URI_COLON                   = &URI:  
-UI_LABEL_CATALOG_URI_COLON		      = URI of another XML Catalog file:
-UI_LABEL_DETAILS_URI_COLON           = URI:   
-UI_KEY_TYPE_COLON                    = Key &Type:
-UI_KEY_TYPE_DETAILS_COLON            = Key Type:
-UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC   = Namespace Name
-UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM   = Schema Location
-UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC   = Public ID
-UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM   = System ID
-UI_KEY_TYPE_DESCRIPTION_URI   		  = URI
-UI_LABEL_SPECIFY_ALTERNATIVE_WEB_URL = Specify &alternative web address
-UI_WARNING_URI_MUST_NOT_HAVE_DOTS    = URI must not included '.' or '..'
-
-UI_WARNING_URI_NOT_FOUND_COLON       = The specified resource can't be located :
-UI_WARNING_URI_NOT_FOUND_LONG        = The specified file cannot be found. It may have been moved to a different location. If the file is located remotely, a network connection cannot be established to the remote location. 
-UI_WARNING_INVALID_FILE              = The specified file is invalid.
-UI_WARNING_INVALID_FILE_LONG         = The specified file is invalid. A proper XML file cannot be generated from it. Open the DTD or XML schema file, edit it as necessary, validate it and try again.
-UI_WARNING_NO_ELEMENT                = The specified file must contain at least one element declaration.
-UI_WARNING_NO_ELEMENT_DTD_LONG       = The specified file must contain at least one element declaration that can be used as the root element in the generated XML file.
-UI_WARNING_NO_ELEMENT_XSD_LONG       = The specified file must contain at least one global element declaration that can be used as the root element in the generated XML file.
-
-
-!NewModelWizard
-UI_INVALID_GRAMMAR_ERROR             = Invalid Grammar
-UI_BUTTON_BROWSE                     = &Browse...
-
-!XMLCatalogIdMappingPage
-UI_LABEL_MAP_TO                      = Map to:
-UI_LABEL_MAP_FROM                    = Map from:
-UI_BUTTON_NEW                        = &Add...
-UI_BUTTON_EDIT                       = &Edit...
-UI_BUTTON_DELETE                     = &Delete
-UI_LABEL_NEW_DIALOG_TITLE            = Add XML Catalog Entry
-UI_LABEL_EDIT_DIALOG_TITLE           = Edit XML Catalog Entry
-
-
-!XMLCatalogPreferencePage
-UI_LABEL_USER_ENTRIES                = XML Catalog Entries
-UI_LABEL_USER_ENTRIES_TOOL_TIP       = XML Catalog entries that have been specified by the user
-UI_LABEL_SYSTEM_ENTRIES              = Plug-in specified entries
-UI_LABEL_SYSTEM_ENTRIES_TOOL_TIP     = XML Catalog entries that have been specified by a plug-in
-UI_BUTTON_CHANGE                     = Change...
-UI_LABEL_SELECT_PROJECT              = Select Project
-UI_LABEL_SPECIFY_PROJECT_DESCRIPTION = Specify the project to persist the XML Catalog information
-UI_WARNING_NO_PROJECTS_CREATED       = No projects have been created yet.
-UI_WARNING_PROJECT_NOT_SPECIFIED     = A project name has not been specified.
-UI_WARNING_PROJECT_DOES_NOT_EXIST    = The specified project does not exist.
-UI_LABEL_PROJECT_TO_USE              = Project to use to persist XML Catalog User Entries: 
-UI_LABEL_CATALOG_SAVE_ERROR          = XML Catalog Save Error
-UI_LABEL_CATALOG_COULD_NOT_BE_SAVED  = The XML Catalog entry could not be saved.
-UI_LABEL_ADVANCED                    = &Advanced...
-UI_LABEL_ADVANCED_XML_CATALOG_PREFS  = Advanced XML Catalog Preferences   
-UI_LABEL_SPECIFY_PERSISTENCE_FILE    = &Specify a file to use to persist the XML Catalog information.
-UI_LABEL_SAVE_CATALOG_DIALOG_TITLE   = Save Changes
-UI_LABEL_SAVE_CATALOG_DIALOG_DESC    = You have made unsaved changes to the current XML Catalog settings. Do you wish to save your changes before loading the new XML Catalog settings?   
-UI_LABEL_BROWSE_CATALOG_FILE_TITLE   = Select Folder
-UI_LABEL_BROWSE_CATALOG_FILE_DESC    = Select the folder that contains the '.xmlcatalog' file.   
-UI_LABEL_DETAILS                     = Details
-UI_LABEL_USER_SPECIFIED_ENTRIES      = User Specified Entries
-UI_LABEL_PLUGIN_SPECIFIED_ENTRIES    = Plugin Specified Entries
-
-!AdvancedOptionsDialog
-UI_LABEL_DIALOG_DESCRIPTION          = Use the buttons below to import or export XML Catalog settings.
-UI_BUTTON_IMPORT                     = Import...
-UI_BUTTON_EXPORT                     = Export...
-                                   
-UI_LABEL_IMPORT_DIALOG_TITLE         = Import XML Catalog Settings
-UI_LABEL_IMPORT_DIALOG_HEADING       = Specify XML Catalog File
-UI_LABEL_IMPORT_DIALOG_MESSAGE       = Specify the file that will used to load the XML Catalog Settings
-
-UI_LABEL_EXPORT_DIALOG_TITLE         = Export XML Catalog Settings
-UI_LABEL_EXPORT_DIALOG_HEADING       = Specify XML Catalog File
-UI_LABEL_EXPORT_DIALOG_MESSAGE       = Specify the file that will used to save the XML Catalog Setting
-ERROR_SAVING_FILE					 = Error saving file %1
-UI_LABEL_FILE_IS_READ_ONLY           = File %1 is read only
-
-EditCatalogEntryDialog_catalogEntryLabel=Catalog Entry
-EditCatalogEntryDialog_nextCatalogLabel=Next Catalog
-UI_BUTTON_MENU_BROWSE_WORKSPACE=Workspace...
-UI_BUTTON_MENU_BROWSE_FILE_SYSTEM=File System...
-UI_LABEL_SELECT_FILE_FILTER_CONTROL=Files of type:
-UI_TEXT_SELECT_FILE_FILTER_CONTROL=All Supported Files
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java
deleted file mode 100644
index ff39ae2..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Copyright (c) 2002, 2005 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-import java.text.Collator;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-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;
-
-
-public class XMLCatalogTreeViewer extends TreeViewer {
-	protected static Image xmlCatalogImage = ImageFactory.INSTANCE.getImage("icons/obj16/xmlcatalog_obj.gif"); //$NON-NLS-1$
-	protected static Image errorImage = ImageFactory.INSTANCE.getImage("icons/ovr16/error-overlay.gif"); //$NON-NLS-1$
-	protected static Image entryImage = ImageFactory.INSTANCE.getImage("icons/obj16/entry_obj.gif"); //$NON-NLS-1$
-	protected static Image nextCatalogImage = ImageFactory.INSTANCE.getImage("icons/obj16/nextCatalog_obj.gif"); //$NON-NLS-1$
-
-	protected static String ERROR_STATE_KEY = "errorstatekey"; //$NON-NLS-1$
-
-	protected ICatalog fWorkingUserCatalog;
-	protected ICatalog fSystemCatalog;
-
-	public static String USER_SPECIFIED_ENTRIES_OBJECT = XMLCatalogMessages.UI_LABEL_USER_SPECIFIED_ENTRIES;
-	public static String PLUGIN_SPECIFIED_ENTRIES_OBJECT = XMLCatalogMessages.UI_LABEL_PLUGIN_SPECIFIED_ENTRIES;
-
-	public XMLCatalogTreeViewer(Composite parent, ICatalog workingUserCatalog, ICatalog systemCatalog) {
-		super(parent, SWT.NONE);
-		this.fWorkingUserCatalog = workingUserCatalog;
-		this.fSystemCatalog = systemCatalog;
-
-		setContentProvider(new CatalogEntryContentProvider());
-		setLabelProvider(new CatalogEntryLabelProvider());
-	}
-
-	public void setFilterExtensions(String[] extensions) {
-		resetFilters();
-		addFilter(new XMLCatalogTableViewerFilter(extensions));
-	}
-
-	public class CatalogEntryLabelProvider extends LabelProvider {
-		protected HashMap imageTable = new HashMap();
-
-		public String getText(Object object) {
-			String result = null;
-			if (object instanceof ICatalogEntry) {
-				ICatalogEntry catalogEntry = (ICatalogEntry) object;
-				result = catalogEntry.getKey();
-				// result = URIHelper.removePlatformResourceProtocol(result);
-			}
-			else if (object instanceof INextCatalog) {
-				INextCatalog nextCatalog = (INextCatalog) object;
-				result = nextCatalog.getCatalogLocation();
-			}
-			return result != null ? result : object.toString();
-		}
-
-		public Image getImage(Object object) {
-			Image result = null;
-			Image base = null;
-			if (object instanceof String) {
-				result = xmlCatalogImage;
-			}
-			else if (object instanceof ICatalogEntry) {
-				ICatalogEntry catalogEntry = (ICatalogEntry) object;
-				String uri = catalogEntry.getURI();
-				IEditorRegistry er = PlatformUI.getWorkbench().getEditorRegistry();
-				ImageDescriptor imageDescriptor = er.getImageDescriptor(uri);
-				Image image = (Image) imageTable.get(imageDescriptor);
-				if (image == null) {
-					image = imageDescriptor.createImage();
-					imageTable.put(imageDescriptor, image);
-				}
-				base = image;
-
-				if (base != null) {
-					if (URIHelper.isReadableURI(uri, false)) {
-						result = base;
-					}
-					else {
-						result = ImageFactory.INSTANCE.createCompositeImage(base, errorImage, ImageFactory.BOTTOM_LEFT);
-					}
-				}
-			}
-			else if (object instanceof INextCatalog) {
-				// TODO: add image to the imageTable and add error overlay if
-				// next catalog URI is not readable
-				result = nextCatalogImage;
-			}
-			return result;
-		}
-	}
-
-
-	public class CatalogEntryContentProvider implements ITreeContentProvider {
-		protected Object[] roots;
-
-		public CatalogEntryContentProvider() {
-			roots = new Object[2];
-			roots[0] = USER_SPECIFIED_ENTRIES_OBJECT;
-			roots[1] = PLUGIN_SPECIFIED_ENTRIES_OBJECT;
-		}
-
-		public boolean isRoot(Object object) {
-			return object instanceof String || object instanceof INextCatalog;
-		}
-
-		public Object[] getElements(Object element) {
-			return roots;
-		}
-
-		public Object[] getChildren(Object parentElement) {
-			Object[] result = new Object[0];
-			if (parentElement == roots[0]) {
-				result = getChildrenHelper(fWorkingUserCatalog);
-			}
-			else if (parentElement == roots[1]) {
-				result = getChildrenHelper(fSystemCatalog);
-			}
-			else if (parentElement instanceof INextCatalog) {
-				ICatalog nextCatalog = ((INextCatalog) parentElement).getReferencedCatalog();
-				result = getChildrenHelper(nextCatalog);
-			}
-			return result;
-		}
-
-		protected Object[] getChildrenHelper(ICatalog catalog) {
-			// TODO add entries from the nested catalogs
-
-			ICatalogEntry[] entries = catalog.getCatalogEntries();
-			if (entries.length > 0) {
-				Comparator comparator = new Comparator() {
-					public int compare(Object o1, Object o2) {
-						int result = 0;
-						if (o1 instanceof ICatalogEntry && o2 instanceof ICatalogEntry) {
-							ICatalogEntry entry1 = (ICatalogEntry) o1;
-							ICatalogEntry entry2 = (ICatalogEntry) o2;
-							result = Collator.getInstance().compare(entry1.getKey(), entry2.getKey());
-						}
-						return result;
-					}
-				};
-				Arrays.sort(entries, comparator);
-			}
-			Vector result = new Vector();
-			result.addAll(Arrays.asList(entries));
-			INextCatalog[] nextCatalogs = catalog.getNextCatalogs();
-			List nextCatalogsList = Arrays.asList(nextCatalogs);
-			result.addAll(nextCatalogsList);
-
-			return  result.toArray(new ICatalogElement[result.size()]);
-		}
-
-		public Object getParent(Object element) {
-			return (element instanceof String) ? null : USER_SPECIFIED_ENTRIES_OBJECT;
-		}
-
-		public boolean hasChildren(Object element) {
-			return isRoot(element) ? getChildren(element).length > 0 : false;
-		}
-
-		public void dispose() {
-			// nothing to dispose
-		}
-
-		public void inputChanged(Viewer viewer, Object old, Object newobj) {
-			// ISSUE: seems we should do something here
-		}
-
-		public boolean isDeleted(Object object) {
-			return false;
-		}
-	}
-
-
-	public void menuAboutToShow(IMenuManager menuManager) {
-		Action action = new Action("hello") { //$NON-NLS-1$
-			public void run() {
-				System.out.println("run!"); //$NON-NLS-1$
-			}
-		};
-		menuManager.add(action);
-	}
-
-
-	class XMLCatalogTableViewerFilter extends ViewerFilter {
-		protected String[] extensions;
-
-		public XMLCatalogTableViewerFilter(String[] extensions1) {
-			this.extensions = extensions1;
-		}
-
-		public boolean isFilterProperty(Object element, Object property) {
-			return false;
-		}
-
-		public boolean select(Viewer viewer, Object parent, Object element) {
-			boolean result = false;
-			if (element instanceof ICatalogEntry) {
-				ICatalogEntry catalogEntry = (ICatalogEntry) element;
-				for (int i = 0; i < extensions.length; i++) {
-					if (catalogEntry.getURI().endsWith(extensions[i])) {
-						result = true;
-						break;
-					}
-				}
-			}
-			return result;
-		}
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLQuickScan.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLQuickScan.java
deleted file mode 100644
index d574006..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLQuickScan.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-* Copyright (c) 2002, 2005 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - Initial API and implementation
-*   Jens Lukowski/Innoopract - initial renaming/restructuring
-* 
-*/
-package org.eclipse.wst.xml.ui.internal.catalog;
-
-import java.io.InputStream;
-import java.net.URL;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- *
- */
-public class XMLQuickScan
-{
-  public static String getTargetNamespaceURIForSchema(String uri)
-  {
-    String result = null;
-    try
-    {
-      URL url = new URL(uri);
-      InputStream inputStream = url.openStream();
-      result = XMLQuickScan.getTargetNamespaceURIForSchema(inputStream);
-    }
-    catch (Exception e)
-    {
-    }
-    return result;
-  }
-
-  public static String getTargetNamespaceURIForSchema(InputStream input)
-  {
-    TargetNamespaceURIContentHandler handler = new TargetNamespaceURIContentHandler();
-    ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader();
-    try
-    {
-      Thread.currentThread().setContextClassLoader(XMLQuickScan.class.getClassLoader());
-      SAXParserFactory factory = SAXParserFactory.newInstance();
-      factory.setNamespaceAware(true);
-	  SAXParser parser = factory.newSAXParser();
-	  parser.parse(new InputSource(input), handler);
-    }
-    catch (Exception e)
-    {
-    }
-    finally
-    {
-      Thread.currentThread().setContextClassLoader(prevClassLoader);
-    }
-    return handler.targetNamespaceURI;
-  }
-
-  protected static class TargetNamespaceURIContentHandler extends DefaultHandler
-  {
-    public String targetNamespaceURI;
-
-    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
-    {
-      if (localName.equals("schema")) //$NON-NLS-1$
-      {
-        int nAttributes = attributes.getLength();
-        for (int i = 0; i < nAttributes; i++)
-        {
-          if (attributes.getLocalName(i).equals("targetNamespace")) //$NON-NLS-1$
-          {
-            targetNamespaceURI = attributes.getValue(i);
-            break;
-          }
-        }
-      }
-      // todo there's a nice way to do this I'm sure    
-      // here I intentially cause an exception... 
-      String x = null;
-      x.length();
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/catalogEntry.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/catalogEntry.gif
deleted file mode 100644
index d65b280..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/catalogEntry.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/nextCatalog.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/nextCatalog.gif
deleted file mode 100644
index 3a934b9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/nextCatalog.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/entry_obj.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/entry_obj.gif
deleted file mode 100644
index 9a0ff30..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/entry_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_expand.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_expand.gif
deleted file mode 100644
index 85f9baa..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_expand.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_obj.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_obj.gif
deleted file mode 100644
index 061161a..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/nextCatalog_obj.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/nextCatalog_obj.gif
deleted file mode 100644
index d4bfe79..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/nextCatalog_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/xmlcatalog_obj.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/xmlcatalog_obj.gif
deleted file mode 100644
index a61441f..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/xmlcatalog_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/ovr16/error-overlay.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/ovr16/error-overlay.gif
deleted file mode 100644
index 119dccc..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/ovr16/error-overlay.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/DOMPropertyDescriptorFactory.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/DOMPropertyDescriptorFactory.java
deleted file mode 100644
index 754d9bb..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/DOMPropertyDescriptorFactory.java
+++ /dev/null
@@ -1,133 +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
- ****************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-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.properties.EnumeratedStringPropertyDescriptor;
-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;
-
-
-public class DOMPropertyDescriptorFactory {
-
-	protected static final String HACK = "hack"; //$NON-NLS-1$
-
-	public DOMPropertyDescriptorFactory() {
-	}
-
-	public IPropertyDescriptor createAttributePropertyDescriptor(Attr attr) {
-		IPropertyDescriptor result = null;
-
-		String attributeName = attr.getName();
-
-		ModelQuery mq = ModelQueryUtil.getModelQuery(attr.getOwnerDocument());
-
-		if (mq != null) {
-			CMAttributeDeclaration ad = mq.getCMAttributeDeclaration(attr);
-			if (ad != null) {
-				String[] valuesArray = mq.getPossibleDataTypeValues(attr.getOwnerElement(), ad);
-				if (valuesArray != null && valuesArray.length > 0) {
-					result = new EnumeratedStringPropertyDescriptor(attributeName, attributeName, valuesArray);
-				}
-			}
-		}
-
-		if (result == null) {
-			result = createDefaultPropertyDescriptor(attributeName);
-		}
-		return result;
-	}
-
-	public IPropertyDescriptor createCDATASectionPropertyDescriptor(CDATASection cdataSection) {
-		return createDefaultPropertyDescriptor(HACK);
-	}
-
-	public IPropertyDescriptor createCommentPropertyDescriptor(Comment comment) {
-		return createDefaultPropertyDescriptor(HACK);
-	}
-
-	protected IPropertyDescriptor createDefaultPropertyDescriptor(String attributeName) {
-		TextPropertyDescriptor descriptor = new TextPropertyDescriptor(attributeName, attributeName);
-		return descriptor;
-	}
-
-	public IPropertyDescriptor createDocumentTypePropertyDescriptor(DocumentType documentType) {
-		return null; // new TextPropertyDescriptor(HACK, HACK);
-	}
-
-	public IPropertyDescriptor createElementPropertyDescriptor(Element element) {
-		return createDefaultPropertyDescriptor(HACK);
-	}
-
-	public IPropertyDescriptor createEntityReferencePropertyDescriptor(EntityReference entityReference) {
-		return createDefaultPropertyDescriptor(HACK);
-	}
-
-	public IPropertyDescriptor createProcessingInstructionPropertyDescriptor(ProcessingInstruction pi) {
-		return createDefaultPropertyDescriptor(HACK);
-	}
-
-	public IPropertyDescriptor createPropertyDescriptor(Object object) {
-		IPropertyDescriptor result = null;
-		if (object instanceof Node) {
-			Node node = (Node) object;
-			int nodeType = node.getNodeType();
-			switch (nodeType) {
-				case Node.ATTRIBUTE_NODE : {
-					result = createAttributePropertyDescriptor((Attr) node);
-					break;
-				}
-				case Node.CDATA_SECTION_NODE : {
-					result = createCDATASectionPropertyDescriptor((CDATASection) node);
-					break;
-				}
-				case Node.COMMENT_NODE : {
-					result = createCommentPropertyDescriptor((Comment) node);
-					break;
-				}
-				case Node.DOCUMENT_TYPE_NODE : {
-					result = createDocumentTypePropertyDescriptor((DocumentType) node);
-					break;
-				}
-				case Node.ELEMENT_NODE : {
-					result = createElementPropertyDescriptor((Element) node);
-					break;
-				}
-				case Node.ENTITY_REFERENCE_NODE : {
-					result = createEntityReferencePropertyDescriptor((EntityReference) node);
-					break;
-				}
-				case Node.PROCESSING_INSTRUCTION_NODE : {
-					result = createProcessingInstructionPropertyDescriptor((ProcessingInstruction) node);
-					break;
-				}
-				case Node.TEXT_NODE : {
-					result = createTextPropertyDescriptor((Text) node);
-					break;
-				}
-			}
-		}
-		return result;
-	}
-
-	public IPropertyDescriptor createTextPropertyDescriptor(Text text) {
-		return createDefaultPropertyDescriptor(HACK);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewer.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewer.java
deleted file mode 100644
index 8569407..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewer.java
+++ /dev/null
@@ -1,23 +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
- ****************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.widgets.Control;
-
-public interface IDesignViewer {
-	public Control getControl();
-
-	String getTitle();
-
-	void setDocument(IDocument document);
-	
-	ISelectionProvider getSelectionProvider();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewerActionBarContributor.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewerActionBarContributor.java
deleted file mode 100644
index c6a45f5..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewerActionBarContributor.java
+++ /dev/null
@@ -1,19 +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
- ****************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-
-
-public interface IDesignViewerActionBarContributor extends ISourceViewerActionBarContributor {
-	public void initViewerSpecificContributions(IActionBars bars);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourceEditorActionBarContributor.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourceEditorActionBarContributor.java
deleted file mode 100644
index f30e1ee..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourceEditorActionBarContributor.java
+++ /dev/null
@@ -1,210 +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
- ****************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder;
-import org.eclipse.wst.sse.ui.internal.IExtendedContributor;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-
-
-public class SourceEditorActionBarContributor extends MultiPageEditorActionBarContributor implements IExtendedContributor {
-
-	protected IEditorActionBarContributor designViewerActionBarContributor = null;
-	protected IEditorActionBarContributor sourceViewerActionContributor = null;
-	protected XMLMultiPageEditorPart multiPageEditor = null;
-
-	// EditorExtension
-	private static final String EDITOR_ID = "org.eclipse.wst.xml.ui.XMLMultiPageEditorPart"; //$NON-NLS-1$
-	private IExtendedContributor extendedContributor;
-
-	public SourceEditorActionBarContributor() {
-		super();
-
-		sourceViewerActionContributor = new SourcePageActionContributor();
-
-		// Read action extensions.
-		ExtendedEditorActionBuilder builder = new ExtendedEditorActionBuilder();
-		extendedContributor = builder.readActionExtensions(EDITOR_ID);
-	}
-
-	public void init(IActionBars actionBars) {
-		super.init(actionBars);
-
-		if (actionBars != null) {
-			initDesignViewerActionBarContributor(actionBars);
-			initSourceViewerActionContributor(actionBars);
-		}
-	}
-
-	protected void initDesignViewerActionBarContributor(IActionBars actionBars) {
-		if (designViewerActionBarContributor != null)
-			designViewerActionBarContributor.init(actionBars, getPage());
-	}
-
-	protected void initSourceViewerActionContributor(IActionBars actionBars) {
-		if (sourceViewerActionContributor != null)
-			sourceViewerActionContributor.init(actionBars, getPage());
-	}
-
-	public void dispose() {
-		super.dispose();
-
-		if (designViewerActionBarContributor != null)
-			designViewerActionBarContributor.dispose();
-
-		if (sourceViewerActionContributor != null)
-			sourceViewerActionContributor.dispose();
-
-		if (extendedContributor != null)
-			extendedContributor.dispose();
-	}
-
-	/**
-	 * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToMenu(IMenuManager)
-	 */
-	public final void contributeToMenu(IMenuManager menu) {
-		super.contributeToMenu(menu);
-
-		addToMenu(menu);
-
-		if (extendedContributor != null)
-			extendedContributor.contributeToMenu(menu);
-	}
-
-	protected void addToMenu(IMenuManager menu) {
-	}
-
-	/**
-	 * @see IExtendedContributor#contributeToPopupMenu(IMenuManager)
-	 */
-	public final void contributeToPopupMenu(IMenuManager menu) {
-
-		addToPopupMenu(menu);
-
-		if (extendedContributor != null)
-			extendedContributor.contributeToPopupMenu(menu);
-	}
-
-	protected void addToPopupMenu(IMenuManager menu) {
-	}
-
-	/**
-	 * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(IToolBarManager)
-	 */
-	public final void contributeToToolBar(IToolBarManager toolBarManager) {
-		super.contributeToToolBar(toolBarManager);
-
-		addToToolBar(toolBarManager);
-
-		if (extendedContributor != null)
-			extendedContributor.contributeToToolBar(toolBarManager);
-	}
-
-	protected void addToToolBar(IToolBarManager toolBarManager) {
-	}
-
-	/**
-	 * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToStatusLine(IStatusLineManager)
-	 */
-	public final void contributeToStatusLine(IStatusLineManager manager) {
-		super.contributeToStatusLine(manager);
-
-		addToStatusLine(manager);
-
-		if (extendedContributor != null)
-			extendedContributor.contributeToStatusLine(manager);
-	}
-
-	protected void addToStatusLine(IStatusLineManager manager) {
-	}
-
-	/**
-	 * @see IExtendedContributor#updateToolbarActions()
-	 */
-	public void updateToolbarActions() {
-		if (extendedContributor != null)
-			extendedContributor.updateToolbarActions();
-	}
-
-	public void setActiveEditor(IEditorPart targetEditor) {
-		// save multiPageEditor before calling
-		// super.setActiveEditor(targetEditor)
-		// super.setActiveEditor will call setActivePage(IEditorPart
-		// activeEditor)
-		// multiPageEditor is needed in setActivePage(IEditorPart
-		// activeEditor)
-		if (targetEditor instanceof XMLMultiPageEditorPart)
-			multiPageEditor = (XMLMultiPageEditorPart) targetEditor;
-
-		super.setActiveEditor(targetEditor);
-
-		updateToolbarActions();
-
-		if (extendedContributor != null)
-			extendedContributor.setActiveEditor(targetEditor);
-	}
-
-	public void setActivePage(IEditorPart activeEditor) {
-		// This contributor is designed for StructuredTextMultiPageEditorPart.
-		// To safe-guard this from problems caused by unexpected usage by
-		// other editors, the following
-		// check is added.
-		if (multiPageEditor != null) {
-			if (activeEditor != null && activeEditor instanceof StructuredTextEditor)
-				activateSourcePage(activeEditor);
-			else
-				activateDesignPage(activeEditor);
-		}
-
-		updateToolbarActions();
-
-		IActionBars actionBars = getActionBars();
-		if (actionBars != null) {
-			// update menu bar and tool bar
-			actionBars.updateActionBars();
-		}
-	}
-
-	protected void activateDesignPage(IEditorPart activeEditor) {
-		if (designViewerActionBarContributor != null && designViewerActionBarContributor instanceof IDesignViewerActionBarContributor) {
-			designViewerActionBarContributor.setActiveEditor(multiPageEditor);
-		}
-
-		if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor) {
-			// if design page is not really an IEditorPart, activeEditor ==
-			// null, so pass in multiPageEditor instead (d282414)
-			if (activeEditor == null) {
-				sourceViewerActionContributor.setActiveEditor(multiPageEditor);
-			} else {
-				sourceViewerActionContributor.setActiveEditor(activeEditor);
-			}
-			((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(false);
-		}
-	}
-
-	protected void activateSourcePage(IEditorPart activeEditor) {
-		if (designViewerActionBarContributor != null && designViewerActionBarContributor instanceof IDesignViewerActionBarContributor) {
-			designViewerActionBarContributor.setActiveEditor(multiPageEditor);
-		}
-
-		if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor) {
-			sourceViewerActionContributor.setActiveEditor(activeEditor);
-			((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(true);
-		}
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourcePageActionContributor.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourcePageActionContributor.java
deleted file mode 100644
index c283c27..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourcePageActionContributor.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.wst.xml.ui.internal.actions.ActionContributorXML;
-
-
-/**
- * SourcePageActionContributor
- * 
- * This class is for multi page editor's source page contributor.
- * 
- * Use XMLEditorActionContributor for single page editor.
- */
-public class SourcePageActionContributor extends ActionContributorXML {
-
-	private IActionBars fBars;
-
-	/**
-	 * This method calls:
-	 * <ul>
-	 * <li><code>contributeToMenu</code> with <code>bars</code>' menu
-	 * manager</li>
-	 * <li><code>contributeToToolBar</code> with <code>bars</code>' tool
-	 * bar manager</li>
-	 * <li><code>contributeToStatusLine</code> with <code>bars</code>'
-	 * status line manager</li>
-	 * </ul>
-	 * The given action bars are also remembered and made accessible via
-	 * <code>getActionBars</code>.
-	 * 
-	 * @param bars
-	 *            the action bars
-	 *  
-	 */
-	public void init(IActionBars bars) {
-		fBars = bars;
-		contributeToMenu(bars.getMenuManager());
-		contributeToToolBar(bars.getToolBarManager());
-		contributeToStatusLine(bars.getStatusLineManager());
-	}
-
-	/**
-	 * Returns this contributor's action bars.
-	 * 
-	 * @return the action bars
-	 */
-	public IActionBars getActionBars() {
-		return fBars;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java
deleted file mode 100644
index 8a0d26b..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java
+++ /dev/null
@@ -1,431 +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
- *******************************************************************************/
-
-
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMWriter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.DOMException;
-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.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-
-/**
- * This performs the work of taking a DOM tree and converting it to a
- * displayable 'UI' tree.
- * 
- * For example : - white space text nodes are ommited from the 'UI' tree -
- * adjacent Text and EntityReference nodes are combined into a single 'UI'
- * node - Elements with 'text only' children are diplayed without children
- *  
- */
-public class TreeContentHelper {
-
-	public static final int HIDE_WHITE_SPACE_TEXT_NODES = 8;
-	public static final int COMBINE_ADJACENT_TEXT_AND_ENTITY_REFERENCES = 16;
-	public static final int HIDE_ELEMENT_CHILD_TEXT_NODES = 32;
-
-	protected int style = HIDE_WHITE_SPACE_TEXT_NODES | COMBINE_ADJACENT_TEXT_AND_ENTITY_REFERENCES | HIDE_ELEMENT_CHILD_TEXT_NODES;
-
-	/**
-	 *  
-	 */
-	public boolean hasStyleFlag(int flag) {
-		return (style & flag) != 0;
-	}
-
-	/**
-	 *  
-	 */
-	public Object[] getChildren(Object element) {
-		Object[] result = null;
-
-		if (element instanceof Node) {
-			Node node = (Node) element;
-			List list = new ArrayList();
-			boolean textContentOnly = true;
-
-			NamedNodeMap map = node.getAttributes();
-			if (map != null) {
-				int length = map.getLength();
-				for (int i = 0; i < length; i++) {
-					list.add(map.item(i));
-					textContentOnly = false;
-				}
-			}
-
-			Node prevIncludedNode = null;
-			for (Node childNode = node.getFirstChild(); childNode != null; childNode = childNode.getNextSibling()) {
-				int childNodeType = childNode.getNodeType();
-				boolean includeNode = true;
-
-				if (includeNode && hasStyleFlag(HIDE_WHITE_SPACE_TEXT_NODES)) {
-					if (isIgnorableText(childNode)) {
-						// filter out the ignorable text node
-						includeNode = false;
-					}
-				}
-
-				if (includeNode && hasStyleFlag(COMBINE_ADJACENT_TEXT_AND_ENTITY_REFERENCES)) {
-					if (isTextOrEntityReferenceNode(childNode) && prevIncludedNode != null && isTextOrEntityReferenceNode(prevIncludedNode)) {
-						// we only show the first of a list of adjacent text
-						// or entity reference node in the tree
-						// so we filter out this subsequent one
-						includeNode = false;
-					}
-				}
-
-				if (hasStyleFlag(HIDE_ELEMENT_CHILD_TEXT_NODES)) {
-					if (childNodeType != Node.TEXT_NODE && childNodeType != Node.ENTITY_REFERENCE_NODE) {
-						textContentOnly = false;
-					}
-				}
-
-				if (includeNode) {
-					list.add(childNode);
-					prevIncludedNode = childNode;
-				}
-			}
-
-			if (hasStyleFlag(HIDE_ELEMENT_CHILD_TEXT_NODES) && textContentOnly) {
-				result = new Object[0];
-			} else {
-				result = list.toArray();
-			}
-		}
-		return result;
-	}
-
-	/**
-	 *  
-	 */
-	protected boolean isTextOrEntityReferenceNode(Node node) {
-		return node.getNodeType() == Node.TEXT_NODE || node.getNodeType() == Node.ENTITY_REFERENCE_NODE;
-	}
-
-	/**
-	 *  
-	 */
-	public boolean isIgnorableText(Node node) {
-		boolean result = false;
-		if (node.getNodeType() == Node.TEXT_NODE) {
-			String data = ((Text) node).getData();
-			result = (data == null || data.trim().length() == 0);
-		}
-		return result;
-	}
-
-	/**
-	 *  
-	 */
-	public boolean isCombinedTextNode(Node node) {
-		boolean result = false;
-		if (node.getNodeType() == Node.TEXT_NODE) {
-			Node nextNode = node.getNextSibling();
-			if (nextNode != null) {
-				if (nextNode.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
-					result = true;
-				}
-			}
-		} else if (node.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
-			result = true;
-		}
-		return result;
-	}
-
-	/**
-	 *  
-	 */
-	public List getCombinedTextNodeList(Node theNode) {
-		List list = new Vector();
-		boolean prevIsEntity = false;
-		for (Node node = theNode; node != null; node = node.getNextSibling()) {
-			int nodeType = node.getNodeType();
-			if (nodeType == Node.ENTITY_REFERENCE_NODE) {
-				prevIsEntity = true;
-				list.add(node);
-			} else if (nodeType == Node.TEXT_NODE && (prevIsEntity || node == theNode)) {
-				prevIsEntity = false;
-				list.add(node);
-			} else {
-				break;
-			}
-		}
-		return list;
-	}
-
-	/**
-	 * If the element is has 'text only' content this method will return the
-	 * list of elements that compose the text only content
-	 */
-	public List getElementTextContent(Element element) {
-		List result = null;
-		if (!element.hasAttributes()) {
-			for (Node node = element.getFirstChild(); node != null; node = node.getNextSibling()) {
-				if (node.getNodeType() == Node.TEXT_NODE || node.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
-					if (result == null) {
-						result = new Vector();
-					}
-					result.add(node);
-				} else {
-					result = null;
-					break;
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 *  
-	 */
-	public String getNodeValue(Node node) {
-		String result = null;
-		int nodeType = node.getNodeType();
-		switch (nodeType) {
-			case Node.ATTRIBUTE_NODE : {
-				result = ((Attr) node).getValue();
-				break;
-			}
-			case Node.CDATA_SECTION_NODE :
-			// drop thru
-			case Node.COMMENT_NODE : {
-				result = ((CharacterData) node).getData();
-				break;
-			}
-			case Node.DOCUMENT_TYPE_NODE : {
-				result = getDocumentTypeValue((DocumentType) node);
-				break;
-			}
-			case Node.ELEMENT_NODE : {
-				result = getElementNodeValue((Element) node);
-				break;
-			}
-			case Node.ENTITY_REFERENCE_NODE :
-			// drop thru
-			case Node.TEXT_NODE : {
-				result = getTextNodeValue(node);
-				break;
-			}
-			case Node.PROCESSING_INSTRUCTION_NODE : {
-				result = ((ProcessingInstruction) node).getData();
-				break;
-			}
-		}
-		return result;
-	}
-
-	/**
-	 *  
-	 */
-	public void setNodeValue(Node node, String value) {
-		int nodeType = node.getNodeType();
-		try {
-			switch (nodeType) {
-				case Node.ATTRIBUTE_NODE : {
-					((Attr) node).setValue(value);
-					break;
-				}
-				case Node.CDATA_SECTION_NODE :
-				// drop thru
-				case Node.COMMENT_NODE : {
-					((CharacterData) node).setData(value);
-					break;
-				}
-				case Node.ELEMENT_NODE : {
-					setElementNodeValue((Element) node, value);
-					break;
-				}
-				case Node.ENTITY_REFERENCE_NODE :
-				// drop thru
-				case Node.TEXT_NODE : {
-					setTextNodeValue(node, value);
-					break;
-				}
-				case Node.PROCESSING_INSTRUCTION_NODE : {
-					((ProcessingInstruction) node).setData(value);
-					break;
-				}
-			}
-		} catch (DOMException e) {
-			Display d = getDisplay();
-			if (d != null)
-				d.beep();
-		}
-	}
-
-	private Display getDisplay() {
-
-		return PlatformUI.getWorkbench().getDisplay();
-	}
-
-
-	/**
-	 *  
-	 */
-	protected String getDocumentTypeValue(DocumentType documentType) {
-		return DOMWriter.getDocumentTypeData(documentType);
-	}
-
-	/**
-	 *  
-	 */
-	protected String getElementNodeValue(Element element) {
-		String result = null;
-		List list = getElementTextContent(element);
-		if (list != null) {
-			result = getValueForTextContent(list);
-		}
-		return result;
-	}
-
-	/**
-	 *  
-	 */
-	protected void setElementNodeValue(Element element, String value) {
-		List list = getElementTextContent(element);
-		if (list != null) {
-			setValueForTextContent(list, value);
-		} else {
-			Document document = element.getOwnerDocument();
-			Text text = document.createTextNode(value);
-			element.appendChild(text);
-		}
-	}
-
-	/**
-	 *  
-	 */
-	protected String getTextNodeValue(Node node) {
-		String result = null;
-		List list = null;
-		if (isCombinedTextNode(node)) {
-			list = getCombinedTextNodeList(node);
-		} else {
-			list = new Vector();
-			list.add(node);
-		}
-		result = getValueForTextContent(list);
-		return result;
-	}
-
-	/**
-	 *  
-	 */
-	protected void setTextNodeValue(Node node, String value) {
-		List list = null;
-		if (isCombinedTextNode(node)) {
-			list = getCombinedTextNodeList(node);
-		} else {
-			list = new Vector();
-			list.add(node);
-		}
-		setValueForTextContent(list, value);
-	}
-
-	public Text getEffectiveTextNodeForCombinedNodeList(List list) {
-		Text result = null;
-		for (Iterator i = list.iterator(); i.hasNext();) {
-			Node node = (Node) i.next();
-			if (node.getNodeType() == Node.TEXT_NODE) {
-				result = (Text) node;
-				break;
-			}
-		}
-		return result;
-	}
-
-	/**
-	 *  
-	 */
-	protected String getValueForTextContent(List list) {
-		String result = null;
-		if (list.size() > 0) {
-			IDOMNode first = (IDOMNode) list.get(0);
-			IDOMNode last = (IDOMNode) list.get(list.size() - 1);
-			IDOMModel model = first.getModel();
-			int start = first.getStartOffset();
-			int end = last.getEndOffset();
-			try {
-				result = model.getStructuredDocument().get(start, end - start);
-			} catch (Exception e) {
-			}
-		}
-
-		// we trim the content so that it looks nice when viewed
-		// we need to be carfull to preserve the 'trimmed' text when the value
-		// is set (see setValueForTextContent)
-		if (result != null) {
-			result = result.trim();
-		}
-		return result;
-	}
-
-	/**
-	 *  
-	 */
-	protected void setValueForTextContent(List list, String value) {
-		//String oldValue = getValueForTextContent();
-		// we worry about preserving trimmed text
-		if (list.size() > 0) {
-			IDOMNode first = (IDOMNode) list.get(0);
-			IDOMNode last = (IDOMNode) list.get(list.size() - 1);
-			int start = first.getStartOffset();
-			int end = last.getEndOffset();
-			first.getModel().getStructuredDocument().replaceText(this, start, end - start, value);
-		}
-	}
-
-	/**
-	 *  
-	 */
-	public boolean isEditable(Node node) {
-		int nodeType = node.getNodeType();
-		boolean result = false;
-		switch (nodeType) {
-			case Node.ATTRIBUTE_NODE :
-			// drop thru
-			case Node.CDATA_SECTION_NODE :
-			// drop thru
-			case Node.COMMENT_NODE :
-			// drop thru
-			case Node.ENTITY_REFERENCE_NODE :
-			// drop thru
-			case Node.TEXT_NODE :
-			// drop thru
-			case Node.PROCESSING_INSTRUCTION_NODE : {
-				result = true;
-				break;
-			}
-			case Node.ELEMENT_NODE : {
-				result = getElementTextContent((Element) node) != null || node.getChildNodes().getLength() == 0;
-				break;
-			}
-		}
-		return result;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeExtension.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeExtension.java
deleted file mode 100644
index b622a2c..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeExtension.java
+++ /dev/null
@@ -1,539 +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
- ****************************************************************************/
-
-
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ICellEditorListener;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.PlatformUI;
-
-
-public class TreeExtension implements PaintListener {
-
-	protected Tree fTree;
-	protected EditManager editManager;
-	protected String[] fColumnProperties;
-	protected ICellModifier cellModifier;
-	protected int columnPosition = 300;
-	protected int columnHitWidth = 5;
-	protected Color tableLineColor;
-	protected int controlWidth;
-	protected DelayedDrawTimer delayedDrawTimer;
-	private boolean fisUnsupportedInput = false;
-
-	public TreeExtension(Tree tree) {
-		this.fTree = tree;
-		InternalMouseListener listener = new InternalMouseListener();
-		tree.addMouseMoveListener(listener);
-		tree.addMouseListener(listener);
-		tree.addPaintListener(this);
-		editManager = new EditManager(tree);
-		delayedDrawTimer = new DelayedDrawTimer(tree);
-
-		tableLineColor = tree.getDisplay().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW);
-	}
-
-	public void dispose() {
-		tableLineColor.dispose();
-	}
-
-	public void setCellModifier(ICellModifier modifier) {
-		cellModifier = modifier;
-	}
-
-	public void resetCachedData() {
-		// todo: sure seems we should reset something?
-	}
-
-	public ICellModifier getCellModifier() {
-		return cellModifier;
-	}
-
-	public List getItemList() {
-		List list = new Vector();
-		getItemListHelper(fTree.getItems(), list);
-		return list;
-	}
-
-	protected void getItemListHelper(TreeItem[] items, List list) {
-		for (int i = 0; i < items.length; i++) {
-			TreeItem item = items[i];
-			list.add(item);
-			getItemListHelper(item.getItems(), list);
-		}
-	}
-
-	protected TreeItem getTreeItemOnRow(int px, int py) {
-		TreeItem result = null;
-		List list = getItemList();
-		for (Iterator i = list.iterator(); i.hasNext();) {
-			TreeItem item = (TreeItem) i.next();
-			Rectangle r = item.getBounds();
-			if (r != null && px >= r.x && py >= r.y && py <= r.y + r.height) {
-				result = item;
-			}
-		}
-		return result;
-	}
-
-	protected class InternalMouseListener extends MouseAdapter implements MouseMoveListener {
-		protected int columnDragged = -1;
-		protected boolean isDown = false;
-		protected int prevX = -1;
-		protected Cursor cursor = null;
-
-		public void mouseMove(MouseEvent e) {
-			if (e.x > columnPosition - columnHitWidth && e.x < columnPosition + columnHitWidth) {
-				if (cursor == null) {
-					cursor = new Cursor(fTree.getDisplay(), SWT.CURSOR_SIZEWE);
-					fTree.setCursor(cursor);
-				}
-			}
-			else {
-				if (cursor != null) {
-					fTree.setCursor(null);
-					cursor.dispose();
-					cursor = null;
-				}
-			}
-
-			if (columnDragged != -1) {
-				// using the delay timer will make redraws less flickery
-				if (e.x > 20) {
-					columnPosition = e.x;
-					delayedDrawTimer.reset(20);
-				}
-			}
-		}
-
-		public void mouseDown(MouseEvent e) {
-			// here we handle the column resizing by detect if the user has
-			// click on a column separator
-			//
-			columnDragged = -1;
-			editManager.deactivateCellEditor();
-
-			if (e.x > columnPosition - columnHitWidth && e.x < columnPosition + columnHitWidth) {
-				columnDragged = 0;
-			}
-
-			// here we handle selecting tree items when any thing on the 'row'
-			// is clicked
-			//
-			TreeItem item = fTree.getItem(new Point(e.x, e.y));
-			if (item == null) {
-				item = getTreeItemOnRow(e.x, e.y);
-				if (item != null) {
-					TreeItem[] items = new TreeItem[1];
-					items[0] = item;
-					fTree.setSelection(items);
-				}
-			}
-		}
-
-		public void mouseUp(MouseEvent e) {
-			columnDragged = -1;
-		}
-	}
-
-	public String[] getColumnProperties() {
-		return fColumnProperties;
-	}
-
-	public void setColumnProperties(String[] columnProperties) {
-		this.fColumnProperties = columnProperties;
-	}
-
-	public void paintControl(PaintEvent event) {
-		GC gc = event.gc;
-		Rectangle treeBounds = fTree.getBounds();
-
-		controlWidth = treeBounds.width;
-		Color bg = fTree.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
-		Color bg2 = fTree.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
-
-		gc.setBackground(bg2);
-
-		// // This next part causes problems on LINUX, so let's not do it
-		// there
-		// if (B2BHacks.IS_UNIX == false) {
-		// TreeItem[] selectedItems = tree.getSelection();
-		// if (selectedItems.length > 0) {
-		// for (int i = 0; i < selectedItems.length; i++) {
-		// TreeItem item = selectedItems[i];
-		// Rectangle bounds = item.getBounds();
-		// if (bounds != null) {
-		// gc.fillRectangle(bounds.x + bounds.width, bounds.y, controlWidth,
-		// bounds.height);
-		// }
-		// }
-		// }
-		// }
-		//
-		if (!fisUnsupportedInput) {
-			TreeItem[] items = fTree.getItems();
-			if (items.length > 0) {
-				gc.setForeground(tableLineColor);
-				gc.setBackground(bg);
-
-				gc.fillRectangle(columnPosition, treeBounds.x, treeBounds.width, treeBounds.height);
-
-				Rectangle itemBounds = items[0].getBounds();
-				int height = computeTreeItemHeight();
-
-				if (itemBounds != null) {
-					int startY = itemBounds.y < treeBounds.y ? itemBounds.y : treeBounds.y + ((treeBounds.y - itemBounds.y) % height);
-
-					for (int i = startY; i < treeBounds.height; i += height) {
-						if (i >= treeBounds.y) {
-							gc.drawLine(0, i, treeBounds.width, i);
-						}
-					}
-				}
-				gc.drawLine(columnPosition, 0, columnPosition, treeBounds.height);
-				paintItems(gc, items, treeBounds);
-
-			}
-			else {
-				addEmptyTreeMessage(gc);
-			}
-		}
-		else {
-			addUnableToPopulateTreeMessage(gc);
-		}
-	}
-
-	protected int computeTreeItemHeight() {
-		int result = -1;
-
-		// On GTK tree.getItemHeight() seems to lie to us. It reports that the
-		// tree item occupies a few pixles less
-		// vertical space than it should. This which foils our code that draw
-		// the 'row' lines since we assume that
-		// lines should be drawn at 'itemHeight' increments. In the case of
-		// LINUX we don't trust getItemHeight()
-		// to compute the increment... instead we compute the value based on
-		// distance between two TreeItems.
-		// if (B2BHacks.IS_UNIX) {
-		// TreeItem[] items = tree.getItems();
-		// Rectangle itemBounds = items[0].getBounds();
-		//
-		// if (items[0].getExpanded()) {
-		// TreeItem[] children = items[0].getItems();
-		// if (children.length > 0) {
-		// result = children[0].getBounds().y - itemBounds.y;
-		// }
-		// }
-		// else if (items.length > 1) {
-		// result = items[1].getBounds().y - itemBounds.y;
-		// }
-		// }
-
-		result = result != -1 ? result : fTree.getItemHeight();
-		return result;
-	}
-
-	protected void addEmptyTreeMessage(GC gc) {
-		// nothing to add here
-	}
-
-	private void addUnableToPopulateTreeMessage(GC gc) {
-		// here we print a message when the document cannot be displayed just
-		// to give the
-		// user a visual cue
-		// so that they know how to proceed to edit the blank view
-		gc.setForeground(fTree.getDisplay().getSystemColor(SWT.COLOR_BLACK));
-		gc.setBackground(fTree.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
-		gc.drawString(XMLEditorMessages.TreeExtension_0, 10, 10);
-	}
-
-	void setIsUnsupportedInput(boolean isUnsupported) {
-		fisUnsupportedInput = isUnsupported;
-	}
-
-	public void paintItems(GC gc, TreeItem[] items, Rectangle treeBounds) {
-		if (items != null) {
-			for (int i = 0; i < items.length; i++) {
-				TreeItem item = items[i];
-				if (item != null) {
-					Rectangle bounds = item.getBounds();
-					if (bounds != null) {
-						if (treeBounds.intersects(bounds)) {
-							paintItem(gc, item, bounds);
-						}
-					}
-
-					// defect 241039
-					//
-					if (item.getExpanded()) {
-						paintItems(gc, item.getItems(), treeBounds);
-					}
-				}
-			}
-		}
-	}
-
-	protected void paintItem(GC gc, TreeItem item, Rectangle bounds) {
-		// nothing to paint
-	}
-
-	public interface ICellEditorProvider {
-		CellEditor getCellEditor(Object o, int col);
-	}
-
-	/**
-	 * This class is used to improve drawing during a column resize.
-	 */
-	public class DelayedDrawTimer implements Runnable {
-		protected Control control;
-
-		public DelayedDrawTimer(Control control1) {
-			this.control = control1;
-		}
-
-		public void reset(int milliseconds) {
-			getDisplay().timerExec(milliseconds, this);
-		}
-
-		public void run() {
-			control.redraw();
-		}
-	}
-
-	Display getDisplay() {
-
-		return PlatformUI.getWorkbench().getDisplay();
-	}
-
-	/**
-	 * EditManager
-	 */
-	public class EditManager {
-		protected Tree fTree1;
-		protected Control cellEditorHolder;
-		protected CellEditorState cellEditorState;
-
-		public EditManager(Tree tree) {
-			this.fTree1 = tree;
-			this.cellEditorHolder = new Composite(tree, SWT.NONE);
-
-			final Tree theTree = tree;
-
-			MouseAdapter theMouseAdapter = new MouseAdapter() {
-				public void mouseDown(MouseEvent e) {
-					deactivateCellEditor();
-
-					if (e.x > columnPosition + columnHitWidth) {
-						TreeItem[] items = theTree.getSelection();
-						// No edit if more than one row is selected.
-						if (items.length == 1) {
-							Rectangle bounds = items[0].getBounds();
-							if (bounds != null && e.y >= bounds.y && e.y <= bounds.y + bounds.height) {
-								int columnToEdit = 1;
-								activateCellEditor(items[0], columnToEdit);
-							}
-						}
-					}
-				}
-			};
-
-			SelectionListener selectionListener = new SelectionListener() {
-				public void widgetDefaultSelected(SelectionEvent e) {
-					applyCellEditorValue();
-				}
-
-				public void widgetSelected(SelectionEvent e) {
-					applyCellEditorValue();
-				}
-			};
-
-			KeyListener keyListener = new KeyAdapter() {
-				public void keyPressed(KeyEvent e) {
-					if (e.character == SWT.CR) {
-						deactivateCellEditor();
-						TreeItem[] items = theTree.getSelection();
-						if (items.length == 1) {
-							activateCellEditor(items[0], 1);
-						}
-					}
-				}
-			};
-
-			tree.addMouseListener(theMouseAdapter);
-			tree.addKeyListener(keyListener);
-			ScrollBar hBar = tree.getHorizontalBar();
-			if (hBar != null)
-				hBar.addSelectionListener(selectionListener);
-			ScrollBar vBar = tree.getVerticalBar();
-			if (vBar != null)
-				vBar.addSelectionListener(selectionListener);
-		}
-
-		public boolean isCellEditorActive() {
-			return cellEditorState != null;
-		}
-
-		public void applyCellEditorValue() {
-			if (cellEditorState != null && cellModifier != null) {
-				TreeItem treeItem = cellEditorState.fTreeItem;
-
-				// The area below the cell editor needs to be explicity
-				// repainted on Linux
-				//
-				// Rectangle r = B2BHacks.IS_UNIX ? treeItem.getBounds() :
-				// null;
-
-				Object value = cellEditorState.fCellEditor.getValue();
-				String property = cellEditorState.fProperty;
-
-				deactivateCellEditor();
-
-				cellModifier.modify(treeItem, property, value);
-
-				// if (r != null) {
-				// tree.redraw(r.x, r.y, tree.getBounds().width, r.height,
-				// false);
-				// }
-			}
-		}
-
-		public void deactivateCellEditor() {
-			// Clean up any previous editor control
-			if (cellEditorState != null) {
-				cellEditorState.deactivate();
-				cellEditorState = null;
-			}
-		}
-
-		public void activateCellEditor(TreeItem treeItem, int column) {
-			if (cellModifier instanceof ICellEditorProvider) {
-				ICellEditorProvider cellEditorProvider = (ICellEditorProvider) cellModifier;
-				Object data = treeItem.getData();
-				if (fColumnProperties.length > column) {
-					String property = fColumnProperties[column];
-					if (cellModifier.canModify(data, property)) {
-						CellEditor newCellEditor = cellEditorProvider.getCellEditor(data, column);
-						if (newCellEditor != null) {
-							// The control that will be the editor must be a
-							// child of the columnPosition
-							Control control = newCellEditor.getControl();
-							if (control != null) {
-								cellEditorState = new CellEditorState(newCellEditor, control, treeItem, column, property);
-								cellEditorState.activate();
-							}
-						}
-					}
-				}
-			}
-		}
-
-		/**
-		 * this class holds the state that is need on a per cell editor
-		 * invocation basis
-		 */
-		public class CellEditorState implements ICellEditorListener, FocusListener {
-			public CellEditor fCellEditor;
-			public Control fControl;
-			public TreeItem fTreeItem;
-			public int fColumnNumber;
-			public String fProperty;
-
-			public CellEditorState(CellEditor cellEditor, Control control, TreeItem treeItem, int columnNumber, String property) {
-				this.fCellEditor = cellEditor;
-				this.fControl = control;
-				this.fTreeItem = treeItem;
-				this.fColumnNumber = columnNumber;
-				this.fProperty = property;
-			}
-
-			public void activate() {
-				Object element = fTreeItem.getData();
-				String value = cellModifier.getValue(element, fProperty).toString();
-				if (fControl instanceof Text) {
-					Text text = (Text) fControl;
-					int requiredSize = value.length() + 100;
-					if (text.getTextLimit() < requiredSize) {
-						text.setTextLimit(requiredSize);
-					}
-				}
-				Rectangle r = fTreeItem.getBounds();
-				if (r != null) {
-					fControl.setBounds(columnPosition + 5, r.y + 1, fTree1.getClientArea().width - (columnPosition + 5), r.height - 1);
-					fControl.setVisible(true);
-					fCellEditor.setValue(value);
-					fCellEditor.addListener(this);
-					fCellEditor.setFocus();
-					fControl.addFocusListener(this);
-				}
-			}
-
-			public void deactivate() {
-				fCellEditor.removeListener(this);
-				fControl.removeFocusListener(this);
-				fCellEditor.deactivate();
-				fTree1.forceFocus();
-			}
-
-			// ICellEditorListener methods
-			//
-			public void applyEditorValue() {
-				applyCellEditorValue();
-			}
-
-			public void cancelEditor() {
-				deactivateCellEditor();
-			}
-
-			public void editorValueChanged(boolean oldValidState, boolean newValidState) {
-				// nothing, for now
-			}
-
-			// FocusListener methods
-			//
-			public void focusGained(FocusEvent e) {
-				// do nothing
-			}
-
-			public void focusLost(FocusEvent e) {
-				applyCellEditorValue();
-			}
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/ViewerExpandCollapseAction.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/ViewerExpandCollapseAction.java
deleted file mode 100644
index 785ddfa..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/ViewerExpandCollapseAction.java
+++ /dev/null
@@ -1,63 +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
- ****************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class ViewerExpandCollapseAction extends Action {
-
-	protected boolean isExpandAction;
-	protected AbstractTreeViewer viewer = null;
-
-	public ViewerExpandCollapseAction(boolean isExpandAction) {
-		this.isExpandAction = isExpandAction;
-		if (isExpandAction) {
-			ImageDescriptor e_imageDescriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_ETOOL_EXPANDALL);
-			ImageDescriptor d_imageDescriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_DTOOL_EXPANDALL);
-
-			setImageDescriptor(e_imageDescriptor);
-			setDisabledImageDescriptor(d_imageDescriptor);
-			setToolTipText(XMLUIMessages._UI_INFO_EXPAND_ALL); //$NON-NLS-1$
-		} else {
-			ImageDescriptor e_imageDescriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_ETOOL_COLLAPSEALL);
-			ImageDescriptor d_imageDescriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_DTOOL_COLLAPSEALL);
-
-			setImageDescriptor(e_imageDescriptor);
-			setDisabledImageDescriptor(d_imageDescriptor);
-			setToolTipText(XMLUIMessages._UI_INFO_COLLAPSE_ALL); //$NON-NLS-1$
-		}
-	}
-
-	public void setViewer(AbstractTreeViewer viewer) {
-		this.viewer = viewer;
-	}
-
-	public void run() {
-		if (viewer != null) {
-			// temporarily set the visibility to false
-			// this has a HUGE performance benefit
-			boolean isVisible = viewer.getControl().getVisible();
-			viewer.getControl().setVisible(false);
-
-			if (isExpandAction) {
-				viewer.expandAll();
-			} else {
-				viewer.collapseAll();
-			}
-
-			// restore the previous visibility state
-			// 
-			viewer.getControl().setVisible(isVisible);
-		}
-	}
-}
-
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorActionDefinitionIds.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorActionDefinitionIds.java
deleted file mode 100644
index f7568ca..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorActionDefinitionIds.java
+++ /dev/null
@@ -1,32 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-
-
-/**
- * Defines the definitions ids for the XML editor actions.
- * 
- * @deprecated Use org.eclipse.wst.sse.ui.edit.util.ActionDefinitionIds instead
- */
-public interface XMLEditorActionDefinitionIds {
-	public final static String CLEANUP_DOCUMENT = "org.eclipse.wst.sse.ui.edit.ui.cleanup.document";//$NON-NLS-1$
-	public final static String FORMAT_DOCUMENT = "org.eclipse.wst.sse.ui.edit.ui.format.document";//$NON-NLS-1$
-	public final static String FORMAT_ACTIVE_ELEMENTS = "org.eclipse.wst.sse.ui.edit.ui.format.active.elements";//$NON-NLS-1$
-	public final static String OPEN_FILE = "org.eclipse.wst.sse.ui.edit.ui.open.file.from.source";//$NON-NLS-1$
-	//	public final static String INFORMATION =
-	// "org.eclipse.wst.sse.ui.edit.ui.show.tooltip.information";//$NON-NLS-1$
-	public final static String INFORMATION = "org.eclipse.jdt.ui.edit.text.java.show.javadoc";//$NON-NLS-1$
-	public final static String ADD_BREAKPOINTS = "org.eclipse.wst.sse.ui.edit.ui.add.breakpoints";//$NON-NLS-1$
-	public final static String MANAGE_BREAKPOINTS = "org.eclipse.wst.sse.ui.edit.ui.manage.breakpoints";//$NON-NLS-1$
-	public final static String ENABLE_BREAKPOINTS = "org.eclipse.wst.sse.ui.edit.ui.enable.breakpoints";//$NON-NLS-1$
-	public final static String DISABLE_BREAKPOINTS = "org.eclipse.wst.sse.ui.edit.ui.disable.breakpoints";//$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorMessages.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorMessages.java
deleted file mode 100644
index 36d0be8..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorMessages.java
+++ /dev/null
@@ -1,50 +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.ui.internal.tabletree;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML Editor
- * 
- * @plannedfor 1.0
- */
-public class XMLEditorMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.xml.ui.internal.tabletree.XMLEditorResources";//$NON-NLS-1$
-
-	public static String XMLTableTreeViewer_0;
-	public static String XMLMultiPageEditorPart_0;
-	public static String XMLTreeExtension_0;
-	public static String XMLTreeExtension_1;
-	public static String XMLTreeExtension_3;
-	public static String XMLTreeExtension_4;
-	public static String XMLTableTreeActionBarContributor_0;
-	public static String XMLTableTreeActionBarContributor_1;
-	public static String XMLTableTreeActionBarContributor_2;
-	public static String XMLTableTreeActionBarContributor_3;
-	public static String XMLTableTreeActionBarContributor_4;
-	public static String XMLTableTreeActionBarContributor_5;
-	public static String XMLTableTreeActionBarContributor_6;
-	public static String XMLTableTreeActionBarContributor_7;
-	public static String XMLTableTreeActionBarContributor_8;
-	public static String An_error_has_occurred_when1_ERROR_;
-	public static String Resource__does_not_exist;
-	public static String Editor_could_not_be_open;
-	public static String TreeExtension_0;
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, XMLEditorMessages.class);
-	}
-	
-	private XMLEditorMessages() {
-		// cannot create new instance
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginHOLD_OLD.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginHOLD_OLD.java
deleted file mode 100644
index 6fa19db..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginHOLD_OLD.java
+++ /dev/null
@@ -1,51 +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
- ****************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-
-
-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;
-
-/**
- * @deprecated This plugin has combined with the org.eclipse.wst.xml.ui plugin.
- *             Use XMLUIPlugin instead.
- */
-public class XMLEditorPluginHOLD_OLD extends AbstractUIPlugin {
-
-	public final static String PLUGIN_ID = "org.eclipse.wst.xml.ui.internal.XMLEditorPluginHOLD_OLD"; //$NON-NLS-1$
-	protected static XMLEditorPluginHOLD_OLD instance = null;
-
-	/**
-	 * XMLUIPlugin constructor comment.
-	 */
-	public XMLEditorPluginHOLD_OLD() {
-		super();
-		instance = this;
-
-		// reference the preference store so
-		// initializeDefaultPreferences(IPreferenceStore preferenceStore) is
-		// called
-		getPreferenceStore();
-	}
-
-	public static XMLEditorPluginHOLD_OLD getDefault() {
-		return instance;
-	}
-
-	public synchronized static XMLEditorPluginHOLD_OLD getInstance() {
-		return instance;
-	}
-
-	public AdapterFactoryRegistry getAdapterFactoryRegistry() {
-		return AdapterFactoryRegistryImpl.getInstance();
-
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImageHelper.java
deleted file mode 100644
index 4b5f8d3..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImageHelper.java
+++ /dev/null
@@ -1,152 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-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.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-/**
- * 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 XMLEditorPluginImageHelper {
-	private final String PLUGINID = XMLUIPlugin.ID;
-	private static XMLEditorPluginImageHelper instance = null;
-
-	//	 save a descriptor for each image
-	private HashMap fImageDescRegistry = null;
-
-	/**
-	 * Gets the instance.
-	 * 
-	 * @return Returns a XMLEditorPluginImageHelper
-	 */
-	public synchronized static XMLEditorPluginImageHelper getInstance() {
-		if (instance == null)
-			instance = new XMLEditorPluginImageHelper();
-		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 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;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImages.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImages.java
deleted file mode 100644
index eb8f84b..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImages.java
+++ /dev/null
@@ -1,27 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-/**
- * Bundle of most images used by the XML Editor plug-in.
- */
-public class XMLEditorPluginImages {
-	public static final String IMG_DTOOL_COLLAPSE = "icons/full/dtool16/collapse.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL_COLLAPSE = "icons/full/etool16/collapse.gif"; //$NON-NLS-1$
-	public static final String IMG_DTOOL_COLLAPSEALL = "icons/full/dtool16/collapse_all.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL_COLLAPSEALL = "icons/full/etool16/collapse_all.gif"; //$NON-NLS-1$
-	public static final String IMG_DTOOL_EXPAND = "icons/full/dtool16/expand.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL_EXPAND = "icons/full/etool16/expand.gif"; //$NON-NLS-1$
-	public static final String IMG_DTOOL_EXPANDALL = "icons/full/dtool16/expand_all.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL_EXPANDALL = "icons/full/etool16/expand_all.gif"; //$NON-NLS-1$
-	public static final String IMG_DTOOL_NEW_XML = "icons/full/dtool16/new_xml.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL_NEW_XML = "icons/full/etool16/new_xml.gif"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorResources.properties b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorResources.properties
deleted file mode 100644
index d22d022..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorResources.properties
+++ /dev/null
@@ -1,30 +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
-###############################################################################
-XMLTableTreeViewer_0=Design
-XMLMultiPageEditorPart_0=Source
-XMLTreeExtension_0=Structure
-XMLTreeExtension_1=Value
-XMLTreeExtension_3=The document is empty.
-XMLTreeExtension_4=Right mouse click here to insert content.
-XMLTableTreeActionBarContributor_0=&XML
-XMLTableTreeActionBarContributor_1=&Expand All
-XMLTableTreeActionBarContributor_2=&Collapse All
-XMLTableTreeActionBarContributor_3=Turn Grammar Constraints Off
-XMLTableTreeActionBarContributor_4=&Turn Grammar Constraints Off
-XMLTableTreeActionBarContributor_5=Turn Grammar Constraints On
-XMLTableTreeActionBarContributor_6=&Turn Grammar Constraints On
-XMLTableTreeActionBarContributor_7=Reload Dependencies
-XMLTableTreeActionBarContributor_8=&Reload Dependencies
-##
-An_error_has_occurred_when1_ERROR_=An error has occurred when initializing the input for the the editor's source page.
-Resource__does_not_exist=Resource {0} does not exist.
-Editor_could_not_be_open=Editor could not be open on {0}
-TreeExtension_0=Cannot display document contents.
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorActionBarContributor.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorActionBarContributor.java
deleted file mode 100644
index 4683c54..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorActionBarContributor.java
+++ /dev/null
@@ -1,88 +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
- ****************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-
-
-public class XMLMultiPageEditorActionBarContributor extends SourceEditorActionBarContributor {
-
-	private boolean needsMultiInit = true;
-
-	public XMLMultiPageEditorActionBarContributor() {
-		super();
-	}
-
-	protected void initDesignViewerActionBarContributor(IActionBars actionBars) {
-		super.initDesignViewerActionBarContributor(actionBars);
-
-		if (designViewerActionBarContributor != null)
-			if (designViewerActionBarContributor instanceof IDesignViewerActionBarContributor)
-				((IDesignViewerActionBarContributor) designViewerActionBarContributor).initViewerSpecificContributions(actionBars);
-	}
-
-	protected void activateDesignPage(IEditorPart activeEditor) {
-		if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor) {
-			// if design page is not really an IEditorPart, activeEditor ==
-			// null, so pass in multiPageEditor instead (d282414)
-			if (activeEditor == null) {
-				sourceViewerActionContributor.setActiveEditor(multiPageEditor);
-			} else {
-				sourceViewerActionContributor.setActiveEditor(activeEditor);
-			}
-			((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(false);
-		}
-
-		if (designViewerActionBarContributor != null && designViewerActionBarContributor instanceof IDesignViewerActionBarContributor) {
-			designViewerActionBarContributor.setActiveEditor(multiPageEditor);
-			((IDesignViewerActionBarContributor) designViewerActionBarContributor).setViewerSpecificContributionsEnabled(true);
-		}
-	}
-
-	protected void activateSourcePage(IEditorPart activeEditor) {
-		if (designViewerActionBarContributor != null && designViewerActionBarContributor instanceof IDesignViewerActionBarContributor) {
-			designViewerActionBarContributor.setActiveEditor(multiPageEditor);
-			((IDesignViewerActionBarContributor) designViewerActionBarContributor).setViewerSpecificContributionsEnabled(false);
-		}
-
-		if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor) {
-			sourceViewerActionContributor.setActiveEditor(activeEditor);
-			((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(true);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.part.EditorActionBarContributor#init(org.eclipse.ui.IActionBars)
-	 */
-	public void init(IActionBars actionBars) {
-		super.init(actionBars);
-		needsMultiInit = true;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(org.eclipse.ui.IEditorPart)
-	 */
-	public void setActiveEditor(IEditorPart targetEditor) {
-		if (needsMultiInit) {
-			designViewerActionBarContributor = new XMLTableTreeActionBarContributor();
-			initDesignViewerActionBarContributor(getActionBars());
-			needsMultiInit = false;
-		}
-		super.setActiveEditor(targetEditor);
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java
deleted file mode 100644
index 3f46783..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java
+++ /dev/null
@@ -1,772 +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
- ****************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IPartService;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.ui.part.MultiPageSelectionProvider;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.wst.common.ui.provisional.editors.PostMultiPageEditorSite;
-import org.eclipse.wst.common.ui.provisional.editors.PostMultiPageSelectionProvider;
-import org.eclipse.wst.common.ui.provisional.editors.PostSelectionMultiPageEditorPart;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLPreferenceNames;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-public class XMLMultiPageEditorPart extends PostSelectionMultiPageEditorPart {
-
-	/**
-	 * Internal part activation listener, copied from AbstractTextEditor
-	 */
-	class ActivationListener implements IPartListener, IWindowListener {
-
-		/** Cache of the active workbench part. */
-		private IWorkbenchPart fActivePart;
-		/** Indicates whether activation handling is currently be done. */
-		private boolean fIsHandlingActivation = false;
-		/**
-		 * The part service.
-		 * 
-		 * @since 3.1
-		 */
-		private IPartService fPartService;
-
-		/**
-		 * Creates this activation listener.
-		 * 
-		 * @param partService
-		 *            the part service on which to add the part listener
-		 * @since 3.1
-		 */
-		public ActivationListener(IPartService partService) {
-			fPartService = partService;
-			fPartService.addPartListener(this);
-			PlatformUI.getWorkbench().addWindowListener(this);
-		}
-
-		/**
-		 * Disposes this activation listener.
-		 * 
-		 * @since 3.1
-		 */
-		public void dispose() {
-			fPartService.removePartListener(this);
-			PlatformUI.getWorkbench().removeWindowListener(this);
-			fPartService = null;
-		}
-
-		/*
-		 * @see IPartListener#partActivated(org.eclipse.ui.IWorkbenchPart)
-		 */
-		public void partActivated(IWorkbenchPart part) {
-			fActivePart = part;
-			handleActivation();
-		}
-
-		/*
-		 * @see IPartListener#partBroughtToTop(org.eclipse.ui.IWorkbenchPart)
-		 */
-		public void partBroughtToTop(IWorkbenchPart part) {
-			// do nothing
-		}
-
-		/*
-		 * @see IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
-		 */
-		public void partClosed(IWorkbenchPart part) {
-			// do nothing
-		}
-
-		/*
-		 * @see IPartListener#partDeactivated(org.eclipse.ui.IWorkbenchPart)
-		 */
-		public void partDeactivated(IWorkbenchPart part) {
-			fActivePart = null;
-		}
-
-		/*
-		 * @see IPartListener#partOpened(org.eclipse.ui.IWorkbenchPart)
-		 */
-		public void partOpened(IWorkbenchPart part) {
-			// do nothing
-		}
-
-		/**
-		 * Handles the activation triggering a element state check in the
-		 * editor.
-		 */
-		void handleActivation() {
-			if (fIsHandlingActivation || getTextEditor() == null)
-				return;
-
-			if (fActivePart == XMLMultiPageEditorPart.this) {
-				fIsHandlingActivation = true;
-				try {
-					getTextEditor().safelySanityCheckState(getEditorInput());
-				}
-				finally {
-					fIsHandlingActivation = false;
-				}
-			}
-		}
-
-		/*
-		 * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
-		 * @since 3.1
-		 */
-		public void windowActivated(IWorkbenchWindow window) {
-			if (window == getEditorSite().getWorkbenchWindow()) {
-				/*
-				 * Workaround for problem described in
-				 * http://dev.eclipse.org/bugs/show_bug.cgi?id=11731 Will be
-				 * removed when SWT has solved the problem.
-				 */
-				window.getShell().getDisplay().asyncExec(new Runnable() {
-					public void run() {
-						handleActivation();
-					}
-				});
-			}
-		}
-
-		/*
-		 * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
-		 * @since 3.1
-		 */
-		public void windowDeactivated(IWorkbenchWindow window) {
-			// do nothing
-		}
-
-		/*
-		 * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
-		 * @since 3.1
-		 */
-		public void windowClosed(IWorkbenchWindow window) {
-			// do nothing
-		}
-
-		/*
-		 * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
-		 * @since 3.1
-		 */
-		public void windowOpened(IWorkbenchWindow window) {
-			// do nothing
-		}
-	}
-
-	/**
-	 * Listens for selection from the source page, applying it to the design
-	 * viewer.
-	 */
-	private class TextEditorPostSelectionAdapter extends UIJob implements ISelectionChangedListener {
-		boolean forcePostSelection = false;
-		ISelection selection = null;
-
-		public TextEditorPostSelectionAdapter() {
-			super(getTitle());
-			setUser(true);
-		}
-
-		public IStatus runInUIThread(IProgressMonitor monitor) {
-			if (selection != null) {
-				fDesignViewer.getSelectionProvider().setSelection(selection);
-			}
-			return Status.OK_STATUS;
-		}
-
-		public void selectionChanged(SelectionChangedEvent event) {
-			if (fDesignViewer != null && ((getActivePage() != fDesignPageIndex) || !XMLMultiPageEditorPart.this.equals(getSite().getPage().getActivePart()))) {
-				if (forcePostSelection) {
-					selection = event.getSelection();
-					schedule(200);
-				}
-				else {
-					fDesignViewer.getSelectionProvider().setSelection(event.getSelection());
-				}
-			}
-		}
-	}
-
-	/**
-	 * Internal IPropertyListener
-	 */
-	class PropertyListener implements IPropertyListener {
-		public void propertyChanged(Object source, int propId) {
-			switch (propId) {
-				// had to implement input changed "listener" so that
-				// StructuredTextEditor could tell it containing editor that
-				// the input has change, when a 'resource moved' event is
-				// found.
-				case IEditorPart.PROP_INPUT :
-				case IEditorPart.PROP_DIRTY : {
-					if (source == getTextEditor()) {
-						if (getTextEditor().getEditorInput() != getEditorInput()) {
-							setInput(getTextEditor().getEditorInput());
-							/*
-							 * title should always change when input changes.
-							 * create runnable for following post call
-							 */
-							Runnable runnable = new Runnable() {
-								public void run() {
-									_firePropertyChange(IWorkbenchPart.PROP_TITLE);
-								}
-							};
-							/*
-							 * Update is just to post things on the display
-							 * queue (thread). We have to do this to get the
-							 * dirty property to get updated after other
-							 * things on the queue are executed.
-							 */
-							((Control) getTextEditor().getAdapter(Control.class)).getDisplay().asyncExec(runnable);
-						}
-					}
-					break;
-				}
-				case IWorkbenchPart.PROP_TITLE : {
-					// update the input if the title is changed
-					if (source == getTextEditor()) {
-						if (getTextEditor().getEditorInput() != getEditorInput()) {
-							setInput(getTextEditor().getEditorInput());
-						}
-					}
-					break;
-				}
-				default : {
-					// propagate changes. Is this needed? Answer: Yes.
-					if (source == getTextEditor()) {
-						_firePropertyChange(propId);
-					}
-					break;
-				}
-			}
-
-		}
-	}
-
-	class TextInputListener implements ITextInputListener {
-		public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
-			// do nothing
-		}
-
-		public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
-			if (fDesignViewer != null && newInput != null)
-				fDesignViewer.setDocument(newInput);
-		}
-	}
-
-	/** The design page index. */
-	private int fDesignPageIndex;
-
-	/** The design viewer */
-	IDesignViewer fDesignViewer;
-
-	private ActivationListener fActivationListener;
-
-	IPropertyListener fPropertyListener = null;
-
-	/** The source page index. */
-	int fSourcePageIndex;
-
-	/** The text editor. */
-	private StructuredTextEditor fTextEditor;
-
-	private TextEditorPostSelectionAdapter fTextEditorSelectionListener;
-
-	/**
-	 * StructuredTextMultiPageEditorPart constructor comment.
-	 */
-	public XMLMultiPageEditorPart() {
-		super();
-	}
-
-	/*
-	 * This method is just to make firePropertyChanged accessible from some
-	 * (anonomous) inner classes.
-	 */
-	void _firePropertyChange(int property) {
-		super.firePropertyChange(property);
-	}
-
-	/**
-	 * Adds the source page of the multi-page editor.
-	 */
-	private void addSourcePage() throws PartInitException {
-		fSourcePageIndex = addPage(fTextEditor, getEditorInput());
-		setPageText(fSourcePageIndex, XMLEditorMessages.XMLMultiPageEditorPart_0);
-		// the update's critical, to get viewer selection manager and
-		// highlighting to work
-		fTextEditor.update();
-
-		firePropertyChange(PROP_TITLE);
-
-		// Changes to the Text Viewer's document instance should also
-		// force an
-		// input refresh
-		fTextEditor.getTextViewer().addTextInputListener(new TextInputListener());
-	}
-
-	/**
-	 * Connects the design viewer with the viewer selection manager. Should be
-	 * done after createSourcePage() is done because we need to get the
-	 * ViewerSelectionManager from the TextEditor. setModel is also done here
-	 * because getModel() needs to reference the TextEditor.
-	 */
-	private void connectDesignPage() {
-		if (fDesignViewer != null) {
-			fDesignViewer.setDocument(getDocument());
-		}
-
-		/*
-		 * Connect selection from the Design page to the selection provider
-		 * for the XMLMultiPageEditorPart so that selection changes in the
-		 * Design page will propogate across the workbench
-		 */
-		if (fDesignViewer.getSelectionProvider() instanceof IPostSelectionProvider) {
-			((IPostSelectionProvider) fDesignViewer.getSelectionProvider()).addPostSelectionChangedListener(new ISelectionChangedListener() {
-				public void selectionChanged(SelectionChangedEvent event) {
-					((PostMultiPageSelectionProvider) getSite().getSelectionProvider()).firePostSelectionChanged(event);
-				}
-			});
-		}
-		fDesignViewer.getSelectionProvider().addSelectionChangedListener(new ISelectionChangedListener() {
-			public void selectionChanged(SelectionChangedEvent event) {
-				((MultiPageSelectionProvider) getSite().getSelectionProvider()).fireSelectionChanged(event);
-			}
-		});
-
-		/*
-		 * Connect selection from the Design page to the selection provider of
-		 * the Source page so that selection in the Design page will drive
-		 * selection in the Source page. Prefer post selection.
-		 */
-		if (fDesignViewer.getSelectionProvider() instanceof IPostSelectionProvider) {
-			((IPostSelectionProvider) fDesignViewer.getSelectionProvider()).addPostSelectionChangedListener(new ISelectionChangedListener() {
-				public void selectionChanged(SelectionChangedEvent event) {
-					/*
-					 * Only force selection update if source page is not
-					 * active
-					 */
-					if (getActivePage() != fSourcePageIndex) {
-						getTextEditor().getSelectionProvider().setSelection(event.getSelection());
-					}
-				}
-			});
-		}
-		else {
-			fDesignViewer.getSelectionProvider().addSelectionChangedListener(new ISelectionChangedListener() {
-				public void selectionChanged(SelectionChangedEvent event) {
-					/*
-					 * Only force selection update if source page is not
-					 * active
-					 */
-					if (getActivePage() != fSourcePageIndex) {
-						getTextEditor().getSelectionProvider().setSelection(event.getSelection());
-					}
-				}
-			});
-		}
-
-		/*
-		 * Handle double-click in the Design page by selecting the
-		 * corresponding amount of text in the Source page.
-		 */
-		fDesignViewer.getControl().addListener(SWT.MouseDoubleClick, new Listener() {
-			public void handleEvent(Event event) {
-				ISelection selection = fDesignViewer.getSelectionProvider().getSelection();
-				int start = -1;
-				int length = -1;
-				if (selection instanceof IStructuredSelection) {
-					/*
-					 * selection goes from the start of the first object to
-					 * the end of the last
-					 */
-					IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-					Object o = structuredSelection.getFirstElement();
-					Object o2 = null;
-					if (structuredSelection.size() > 1) {
-						o2 = structuredSelection.toArray()[structuredSelection.size() - 1];
-					}
-					else {
-						o2 = o;
-					}
-					if (o instanceof IndexedRegion) {
-						start = ((IndexedRegion) o).getStartOffset();
-						length = ((IndexedRegion) o2).getEndOffset() - start;
-					}
-					else if (o2 instanceof ITextRegion) {
-						start = ((ITextRegion) o).getStart();
-						length = ((ITextRegion) o2).getEnd() - start;
-					}
-				}
-				else if (selection instanceof ITextSelection) {
-					start = ((ITextSelection) selection).getOffset();
-					length = ((ITextSelection) selection).getLength();
-				}
-				if (start > -1 && length > -1) {
-					getTextEditor().selectAndReveal(start, length);
-				}
-			}
-		});
-
-		/*
-		 * Connect selection from the Source page to the selection provider of
-		 * the Design page so that selection in the Source page will drive
-		 * selection in the Design page. Prefer post selection.
-		 */
-		ISelectionProvider provider = getTextEditor().getSelectionProvider();
-		if (fTextEditorSelectionListener == null) {
-			fTextEditorSelectionListener = new TextEditorPostSelectionAdapter();
-		}
-		if (provider instanceof IPostSelectionProvider) {
-			fTextEditorSelectionListener.forcePostSelection = false;
-			((IPostSelectionProvider) provider).addPostSelectionChangedListener(fTextEditorSelectionListener);
-		}
-		else {
-			fTextEditorSelectionListener.forcePostSelection = true;
-			provider.addSelectionChangedListener(fTextEditorSelectionListener);
-		}
-	}
-
-	/**
-	 * Create and Add the Design Page using a registered factory
-	 * 
-	 */
-	private void createAndAddDesignPage() {
-		IDesignViewer designViewer = createDesignPage();
-
-		fDesignViewer = designViewer;
-		// note: By adding the design page as a Control instead of an
-		// IEditorPart, page switches will indicate
-		// a "null" active editor when the design page is made active
-		fDesignPageIndex = addPage(designViewer.getControl());
-		setPageText(fDesignPageIndex, designViewer.getTitle());
-	}
-
-	protected IDesignViewer createDesignPage() {
-		XMLTableTreeViewer tableTreeViewer = new XMLTableTreeViewer(getContainer());
-		// Set the default infopop for XML design viewer.
-		XMLUIPlugin.getInstance().getWorkbench().getHelpSystem().setHelp(tableTreeViewer.getControl(), XMLTableTreeHelpContextIds.XML_DESIGN_VIEW_HELPID);
-		return tableTreeViewer;
-	}
-
-	/**
-	 * Creates the pages of this multi-page editor.
-	 * <p>
-	 * Subclasses of <code>MultiPageEditor</code> must implement this
-	 * method.
-	 * </p>
-	 */
-	protected void createPages() {
-		try {
-			// source page MUST be created before design page, now
-			createSourcePage();
-
-			createAndAddDesignPage();
-			addSourcePage();
-			connectDesignPage();
-
-			int activePageIndex = getPreferenceStore().getInt(IXMLPreferenceNames.LAST_ACTIVE_PAGE);
-			if (activePageIndex >= 0 && activePageIndex < getPageCount()) {
-				setActivePage(activePageIndex);
-			}
-			else {
-				setActivePage(fSourcePageIndex);
-			}
-		}
-		catch (PartInitException e) {
-			Logger.logException(e);
-			throw new RuntimeException(e);
-		}
-	}
-
-	/**
-	 * @see org.eclipse.ui.part.MultiPageEditorPart#createSite(org.eclipse.ui.IEditorPart)
-	 */
-	protected IEditorSite createSite(IEditorPart editor) {
-		IEditorSite site = null;
-		if (editor == fTextEditor) {
-			site = new PostMultiPageEditorSite(this, editor) {
-				/**
-				 * @see org.eclipse.ui.part.MultiPageEditorSite#getActionBarContributor()
-				 */
-				public IEditorActionBarContributor getActionBarContributor() {
-					IEditorActionBarContributor contributor = super.getActionBarContributor();
-					IEditorActionBarContributor multiContributor = XMLMultiPageEditorPart.this.getEditorSite().getActionBarContributor();
-					if (multiContributor instanceof XMLMultiPageEditorActionBarContributor) {
-						contributor = ((XMLMultiPageEditorActionBarContributor) multiContributor).sourceViewerActionContributor;
-					}
-					return contributor;
-				}
-
-				public String getId() {
-					// sets this id so nested editor is considered xml source
-					// page
-					return ContentTypeIdForXML.ContentTypeID_XML + ".source"; //$NON-NLS-1$;
-				}
-			};
-		}
-		else {
-			site = super.createSite(editor);
-		}
-		return site;
-	}
-
-	/**
-	 * Creates the source page of the multi-page editor.
-	 */
-	protected void createSourcePage() throws PartInitException {
-		fTextEditor = createTextEditor();
-		fTextEditor.setEditorPart(this);
-
-		if (fPropertyListener == null) {
-			fPropertyListener = new PropertyListener();
-		}
-		fTextEditor.addPropertyListener(fPropertyListener);
-	}
-
-	/**
-	 * Method createTextEditor.
-	 * 
-	 * @return StructuredTextEditor
-	 */
-	private StructuredTextEditor createTextEditor() {
-		return new StructuredTextEditor();
-	}
-
-	private void disconnectDesignPage() {
-		if (fDesignViewer != null) {
-			fDesignViewer.setDocument(null);
-		}
-	}
-
-	public void dispose() {
-		Logger.trace("Source Editor", "XMLMultiPageEditorPart::dispose entry"); //$NON-NLS-1$ //$NON-NLS-2$
-
-		disconnectDesignPage();
-
-		if (fActivationListener != null) {
-			fActivationListener.dispose();
-			fActivationListener = null;
-		}
-
-		if (fTextEditor != null && fPropertyListener != null) {
-			fTextEditor.removePropertyListener(fPropertyListener);
-		}
-
-		// moved to last when added window ... seems like
-		// we'd be in danger of losing some data, like site,
-		// or something.
-		super.dispose();
-
-		Logger.trace("Source Editor", "StructuredTextMultiPageEditorPart::dispose exit"); //$NON-NLS-1$ //$NON-NLS-2$
-
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public void doSave(IProgressMonitor monitor) {
-		fTextEditor.doSave(monitor);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.ISaveablePart#doSaveAs()
-	 */
-	public void doSaveAs() {
-		fTextEditor.doSaveAs();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-	 */
-	public Object getAdapter(Class key) {
-		Object result = null;
-		if (key == IDesignViewer.class) {
-			result = fDesignViewer;
-
-		}
-		else if (key.equals(IGotoMarker.class)) {
-			result = new IGotoMarker() {
-				public void gotoMarker(IMarker marker) {
-					XMLMultiPageEditorPart.this.gotoMarker(marker);
-				}
-			};
-		}
-		else {
-			// DMW: I'm bullet-proofing this because
-			// its been reported (on IBM WSAD 4.03 version) a null pointer
-			// sometimes
-			// happens here on startup, when an editor has been left
-			// open when workbench shutdown.
-			if (fTextEditor != null) {
-				result = fTextEditor.getAdapter(key);
-			}
-		}
-		return result;
-	}
-
-	private IDocument getDocument() {
-		IDocument document = null;
-		if (fTextEditor != null)
-			document = fTextEditor.getDocumentProvider().getDocument(fTextEditor.getEditorInput());
-		return document;
-	}
-
-	private IPreferenceStore getPreferenceStore() {
-		return XMLUIPlugin.getDefault().getPreferenceStore();
-	}
-	
-	StructuredTextEditor getTextEditor() {
-		return fTextEditor;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.IWorkbenchPart#getTitle()
-	 */
-	public String getTitle() {
-		String title = null;
-		if (getTextEditor() == null) {
-			if (getEditorInput() != null) {
-				title = getEditorInput().getName();
-			}
-		}
-		else {
-			title = getTextEditor().getTitle();
-		}
-		if (title == null) {
-			title = getPartName();
-		}
-		return title;
-	}
-
-	void gotoMarker(IMarker marker) {
-		setActivePage(fSourcePageIndex);
-		IDE.gotoMarker(fTextEditor, marker);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite,
-	 *      org.eclipse.ui.IEditorInput)
-	 */
-	public void init(IEditorSite site, IEditorInput input) throws PartInitException {
-		try {
-			super.init(site, input);
-			// we want to listen for our own activation
-			fActivationListener = new ActivationListener(site.getWorkbenchWindow().getPartService());
-		}
-		catch (Exception e) {
-			Logger.logException("exception initializing " + getClass().getName(), e); //$NON-NLS-1$
-		}
-		setPartName(input.getName());
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.ISaveablePart#isSaveAsAllowed()
-	 */
-	public boolean isSaveAsAllowed() {
-		return fTextEditor != null && fTextEditor.isSaveAsAllowed();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.ISaveablePart#isSaveOnCloseNeeded()
-	 */
-	public boolean isSaveOnCloseNeeded() {
-		// overriding super class since it does a lowly isDirty!
-		if (fTextEditor != null)
-			return fTextEditor.isSaveOnCloseNeeded();
-		return isDirty();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.part.MultiPageEditorPart#pageChange(int)
-	 */
-	protected void pageChange(int newPageIndex) {
-		super.pageChange(newPageIndex);
-		saveLastActivePageIndex(newPageIndex);
-
-		if (newPageIndex == fDesignPageIndex) {
-			ISelectionProvider selectionProvider = fDesignViewer.getSelectionProvider();
-			if (selectionProvider != null) {
-				SelectionChangedEvent event = new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection());
-				((MultiPageSelectionProvider) getSite().getSelectionProvider()).fireSelectionChanged(event);
-				((PostMultiPageSelectionProvider) getSite().getSelectionProvider()).firePostSelectionChanged(event);
-			}
-		}
-	}
-
-	private void saveLastActivePageIndex(int newPageIndex) {
-		// save the last active page index to preference manager
-		getPreferenceStore().setValue(IXMLPreferenceNames.LAST_ACTIVE_PAGE, newPageIndex);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.part.EditorPart#setInput(org.eclipse.ui.IEditorInput)
-	 */
-	protected void setInput(IEditorInput input) {
-		// If driven from the Source page, it's "model" may not be up to date
-		// with the input just yet. We'll rely on later notification from the
-		// TextViewer to set us straight
-		super.setInput(input);
-		if (fDesignViewer != null)
-			fDesignViewer.setDocument(getDocument());
-		setPartName(input.getName());
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeActionBarContributor.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeActionBarContributor.java
deleted file mode 100644
index 855c7a2..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeActionBarContributor.java
+++ /dev/null
@@ -1,319 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionManager;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.CMDocumentLoader;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.InferredGrammarBuildingCMDocumentLoader;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-import org.w3c.dom.Document;
-
-/**
- *  
- */
-public class XMLTableTreeActionBarContributor implements IDesignViewerActionBarContributor {
-
-	protected IEditorPart editorPart;
-	protected final static String DESIGN_VIEWER_SEPARATOR_1_ID = "sed.tabletree.separator.1"; //$NON-NLS-1$
-	protected final static String DESIGN_VIEWER_SEPARATOR_2_ID = "sed.tabletree.separator.2"; //$NON-NLS-1$
-	protected final static String VALIDATE_XML_ID = "sed.tabletree.validateXML"; //$NON-NLS-1$
-	protected final static String RELOAD_GRAMMAR_ID = "sed.tabletree.reloadGrammar"; //$NON-NLS-1$
-	protected final static String TOGGLE_EDIT_MODE_ID = "sed.tabletree.toggleEditMode"; //$NON-NLS-1$
-	protected final static String EXPAND_ALL_ID = "sed.tabletree.expandAll"; //$NON-NLS-1$
-	protected final static String COLLAPSE_ALL_ID = "sed.tabletree.collapseAll"; //$NON-NLS-1$
-
-	protected ToggleEditModeAction toggleAction;
-	protected ReloadGrammarAction reloadGrammarAction;
-	//	protected ValidateXMLAction validateXMLAction;
-	protected ViewerExpandCollapseAction expandAction;
-	protected ViewerExpandCollapseAction collapseAction;
-	protected ViewerExpandCollapseAction xmlMenuExpandAction;
-	protected ViewerExpandCollapseAction xmlMenuCollapseAction;
-
-	public XMLTableTreeActionBarContributor() {
-	}
-
-	protected void removeContributions(IContributionManager manager) {
-		try {
-			doRemove(manager, DESIGN_VIEWER_SEPARATOR_1_ID);
-			doRemove(manager, DESIGN_VIEWER_SEPARATOR_2_ID);
-			doRemove(manager, VALIDATE_XML_ID);
-			doRemove(manager, RELOAD_GRAMMAR_ID);
-			doRemove(manager, TOGGLE_EDIT_MODE_ID);
-			doRemove(manager, EXPAND_ALL_ID);
-			doRemove(manager, COLLAPSE_ALL_ID);
-		} catch (Exception e) {
-		}
-	}
-
-	protected void doRemove(IContributionManager manager, String id) {
-		try {
-			if (manager.find(id) != null) {
-				manager.remove(id);
-			}
-		} catch (Exception e) {
-		}
-	}
-
-	public void init(IActionBars bars, IWorkbenchPage page) {
-		init(bars);
-	}
-
-	public void init(IActionBars bars) {
-		IToolBarManager tbm = bars.getToolBarManager();
-
-		IMenuManager xmlMenu = bars.getMenuManager().findMenuUsingPath("org.eclipse.core.runtime.xml.design.xmlmenu"); //$NON-NLS-1$
-
-		if (xmlMenu == null) {
-			xmlMenu = new MenuManager(XMLEditorMessages.XMLTableTreeActionBarContributor_0, "org.eclipse.core.runtime.xml.design.xmlmenu"); //$NON-NLS-1$
-			bars.getMenuManager().insertBefore(IWorkbenchActionConstants.M_WINDOW, xmlMenu);
-		} else {
-			removeContributions(xmlMenu);
-		}
-
-		tbm.add(new Separator("DESIGN_VIEWER_SEPARATOR_1_ID")); //$NON-NLS-1$
-
-		// ValidateXMLAction
-		//                        
-		// ugly hack ... we don't contribute the generic XML validator if we
-		// already
-		// have a DAD validator contribution (in the case of the DAD editor).
-		// This hack will be removed when defect 212448 is fixed.
-		//
-		//		if (tbm.find("validate.dad.validateDAD") == null) {
-		//			validateXMLAction = new ValidateXMLAction();
-		//			tbm.add(validateXMLAction);
-		//			xmlMenu.add(validateXMLAction);
-		//		}
-
-		// ToggleEditModeAction
-		//           
-		toggleAction = new ToggleEditModeAction();
-		toggleAction.setId(TOGGLE_EDIT_MODE_ID);
-		xmlMenu.add(toggleAction);
-		tbm.add(toggleAction);
-
-		// ReloadGrammarAction
-		//
-		reloadGrammarAction = new ReloadGrammarAction();
-		reloadGrammarAction.setId(RELOAD_GRAMMAR_ID);
-		tbm.add(reloadGrammarAction);
-		xmlMenu.add(reloadGrammarAction);
-
-		xmlMenu.add(new Separator());
-
-		// ExpandCollapseAction
-		//
-		xmlMenuExpandAction = new ViewerExpandCollapseAction(true);
-		xmlMenuExpandAction.setId(EXPAND_ALL_ID);
-		xmlMenuExpandAction.setText(XMLEditorMessages.XMLTableTreeActionBarContributor_1); //$NON-NLS-1$
-		xmlMenu.add(xmlMenuExpandAction);
-
-		xmlMenuCollapseAction = new ViewerExpandCollapseAction(false);
-		xmlMenuCollapseAction.setId(COLLAPSE_ALL_ID);
-		xmlMenuCollapseAction.setId(EXPAND_ALL_ID);
-		xmlMenuCollapseAction.setText(XMLEditorMessages.XMLTableTreeActionBarContributor_2); //$NON-NLS-1$
-		xmlMenu.add(xmlMenuCollapseAction);
-	}
-
-	protected void addActionWithId(IMenuManager menuManager, Action action, String id) {
-		action.setId(id);
-		menuManager.add(action);
-	}
-
-	public void initViewerSpecificContributions(IActionBars bars) {
-		IToolBarManager tbm = bars.getToolBarManager();
-		tbm.add(new Separator(DESIGN_VIEWER_SEPARATOR_2_ID));
-
-		expandAction = new ViewerExpandCollapseAction(true);
-		expandAction.setId(EXPAND_ALL_ID);
-		tbm.add(expandAction);
-
-		collapseAction = new ViewerExpandCollapseAction(false);
-		collapseAction.setId(COLLAPSE_ALL_ID);
-		tbm.add(collapseAction);
-	}
-
-	public void setViewerSpecificContributionsEnabled(boolean enabled) {
-		if (expandAction != null) {
-			expandAction.setEnabled(enabled);
-			xmlMenuExpandAction.setEnabled(enabled);
-		}
-
-		if (collapseAction != null) {
-			collapseAction.setEnabled(enabled);
-			xmlMenuCollapseAction.setEnabled(enabled);
-		}
-	}
-
-	public void setActiveEditor(IEditorPart targetEditor) {
-		editorPart = targetEditor;
-
-		IStructuredModel model = getModelForEditorPart(targetEditor);
-		reloadGrammarAction.setModel(model);
-		toggleAction.setModelQuery(ModelQueryUtil.getModelQuery(model));
-
-		XMLTableTreeViewer tableTreeViewer = getTableTreeViewerForEditorPart(editorPart);
-		if (tableTreeViewer != null) {
-			expandAction.setViewer(tableTreeViewer);
-			collapseAction.setViewer(tableTreeViewer);
-
-			xmlMenuExpandAction.setViewer(tableTreeViewer);
-			xmlMenuCollapseAction.setViewer(tableTreeViewer);
-		}
-
-		if (editorPart instanceof XMLMultiPageEditorPart) {
-			IWorkbenchPartSite site = editorPart.getSite();
-			if (site instanceof IEditorSite) {
-				ITextEditor textEditor = ((XMLMultiPageEditorPart) editorPart).getTextEditor();
-				IActionBars actionBars = ((IEditorSite) site).getActionBars();
-				actionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, getAction(textEditor, ITextEditorActionConstants.UNDO));
-				actionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, getAction(textEditor, ITextEditorActionConstants.REDO));
-			}
-		}
-
-		// TODO... uncomment this and investigate NPE
-		//
-		// add the cut/copy/paste for text fields
-		// ActionHandlerPlugin.connectPart(editorPart);
-	}
-
-	protected final IAction getAction(ITextEditor editor, String actionId) {
-		return (editor == null ? null : editor.getAction(actionId));
-	}
-
-	protected IStructuredModel getModelForEditorPart(IEditorPart targetEditor) {
-		IStructuredModel result = null;
-		if (editorPart instanceof XMLMultiPageEditorPart) {
-			StructuredTextEditor textEditor = ((XMLMultiPageEditorPart) targetEditor).getTextEditor();
-			result = (textEditor != null) ? textEditor.getModel() : null;
-		}
-		return result;
-	}
-
-	protected XMLTableTreeViewer getTableTreeViewerForEditorPart(IEditorPart targetEditor) {
-		XMLTableTreeViewer result = null;
-		Object object = targetEditor.getAdapter(IDesignViewer.class);
-		if (object instanceof XMLTableTreeViewer) {
-			result = (XMLTableTreeViewer) object;
-		}
-		return result;
-	}
-
-	/**
-	 *  
-	 */
-	public class ToggleEditModeAction extends Action {
-		protected ImageDescriptor onImage = SharedXMLEditorPluginImageHelper.getImageDescriptor(SharedXMLEditorPluginImageHelper.IMG_ETOOL_CONSTRAINON);
-		protected ImageDescriptor offImage = SharedXMLEditorPluginImageHelper.getImageDescriptor(SharedXMLEditorPluginImageHelper.IMG_ETOOL_CONSTRAINOFF);
-		protected ModelQuery modelQuery;
-
-		public ToggleEditModeAction() {
-			setAppearanceForEditMode(ModelQuery.EDIT_MODE_CONSTRAINED_STRICT);
-		}
-
-		public void run() {
-			if (modelQuery != null) {
-				int newState = getNextState(modelQuery.getEditMode());
-				modelQuery.setEditMode(newState);
-				setAppearanceForEditMode(newState);
-			}
-		}
-
-		public void setModelQuery(ModelQuery newModelQuery) {
-			modelQuery = newModelQuery;
-			if (modelQuery != null) {
-				setAppearanceForEditMode(modelQuery.getEditMode());
-			}
-		}
-
-		public void setAppearanceForEditMode(int editMode) {
-			if (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) {
-				setToolTipText(XMLEditorMessages.XMLTableTreeActionBarContributor_3); //$NON-NLS-1$
-				setText(XMLEditorMessages.XMLTableTreeActionBarContributor_4); //$NON-NLS-1$
-				setImageDescriptor(onImage);
-			} else {
-				setToolTipText(XMLEditorMessages.XMLTableTreeActionBarContributor_5); //$NON-NLS-1$
-				setText(XMLEditorMessages.XMLTableTreeActionBarContributor_6); //$NON-NLS-1$
-				setImageDescriptor(offImage);
-			}
-		}
-
-		public int getNextState(int editMode) {
-			int result = -1;
-			if (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) {
-				result = ModelQuery.EDIT_MODE_UNCONSTRAINED;
-			} else {
-				result = ModelQuery.EDIT_MODE_CONSTRAINED_STRICT;
-			}
-			return result;
-		}
-	}
-
-	/**
-	 *  
-	 */
-	public class ReloadGrammarAction extends Action {
-		protected IStructuredModel model;
-
-		public ReloadGrammarAction() {
-			setDisabledImageDescriptor(SharedXMLEditorPluginImageHelper.getImageDescriptor(SharedXMLEditorPluginImageHelper.IMG_DTOOL_RLDGRMR));
-			setImageDescriptor(SharedXMLEditorPluginImageHelper.getImageDescriptor(SharedXMLEditorPluginImageHelper.IMG_ETOOL_RLDGRMR));
-			setToolTipText(XMLEditorMessages.XMLTableTreeActionBarContributor_7); //$NON-NLS-1$
-			setText(XMLEditorMessages.XMLTableTreeActionBarContributor_8); //$NON-NLS-1$
-		}
-
-		public void setModel(IStructuredModel newModel) {
-			this.model = newModel;
-		}
-
-		public void run() {
-			if (model != null) {
-				ModelQuery modelQuery = ModelQueryUtil.getModelQuery(model);
-				Document document = ((IDOMModel) model).getDocument();
-				if (modelQuery != null && modelQuery.getCMDocumentManager() != null) {
-					modelQuery.getCMDocumentManager().getCMDocumentCache().clear();
-					// TODO... need to figure out how to access the
-					// DOMObserver via ModelQuery
-					//  ...why?
-					CMDocumentLoader loader = new InferredGrammarBuildingCMDocumentLoader(document, modelQuery);
-					loader.loadCMDocuments();
-				}
-			}
-		}
-	}
-
-	/**
-	 * @see org.eclipse.ui.IEditorActionBarContributor#dispose()
-	 */
-	public void dispose() {
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java
deleted file mode 100644
index cafcd60..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java
+++ /dev/null
@@ -1,314 +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
- ****************************************************************************/
-
-
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapterFactory;
-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.modelquery.CMDocumentManagerListener;
-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.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-
-public class XMLTableTreeContentProvider implements ITreeContentProvider, ITableLabelProvider, ILabelProvider, CMDocumentManagerListener {
-
-	protected CMDocumentManager documentManager;
-
-	StructuredViewer fViewer = null;
-
-	private TreeContentHelper treeContentHelper = new TreeContentHelper();
-
-	public XMLTableTreeContentProvider() {
-		super();
-	}
-
-	//
-	// ILabelProvider stuff
-	//
-	public void addListener(ILabelProviderListener listener) {
-		// since we always return 'false' for "isLabelProperty",
-		// not need to listen. Maybe that should change some day?
-	}
-
-	// CMDocumentManagerListener
-	//
-	public void cacheCleared(CMDocumentCache cache) {
-		doDelayedRefreshForViewers();
-	}
-
-	public void cacheUpdated(CMDocumentCache cache, final String uri, int oldStatus, int newStatus, CMDocument cmDocument) {
-		if (newStatus == CMDocumentCache.STATUS_LOADED || newStatus == CMDocumentCache.STATUS_ERROR) {
-			doDelayedRefreshForViewers();
-		}
-	}
-
-	public void dispose() {
-	}
-
-	private void doDelayedRefreshForViewers() {
-		if (fViewer != null && !fViewer.getControl().isDisposed()) {
-			fViewer.getControl().getDisplay().asyncExec(new Runnable() {
-				public void run() {
-					if (fViewer != null && !fViewer.getControl().isDisposed()) {
-						fViewer.refresh(true);
-					}
-				}
-			});
-		}
-	}
-
-	public Object[] getChildren(Object element) {
-		if (element instanceof INodeNotifier)
-			((INodeNotifier) element).getAdapterFor(IJFaceNodeAdapter.class);
-		return treeContentHelper.getChildren(element);
-	}
-
-	public Image getColumnImage(Object object, int columnIndex) {
-		return (columnIndex == 0) ? getImage(object) : null;
-	}
-
-	//
-	// ITableLabelProvider stuff
-	//
-	public String getColumnText(Object object, int column) {
-		String result = null;
-		if (column == 0) {
-			result = getText(object);
-		}
-		else if (column == 1 && object instanceof Node) {
-			result = treeContentHelper.getNodeValue((Node) object);
-		}
-		return result != null ? result : ""; //$NON-NLS-1$
-	}
-
-	public Object[] getElements(Object element) {
-		return getChildren(element);
-	}
-
-	public Image getImage(Object object) {
-		if (object instanceof INodeNotifier)
-			((INodeNotifier) object).getAdapterFor(IJFaceNodeAdapter.class);
-
-		Image image = null;
-		if (object instanceof Node) {
-			Node node = (Node) object;
-			switch (node.getNodeType()) {
-				case Node.ATTRIBUTE_NODE : {
-					image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE);
-					break;
-				}
-				case Node.CDATA_SECTION_NODE : {
-					image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_CDATASECTION);
-					break;
-				}
-				case Node.COMMENT_NODE : {
-					image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_COMMENT);
-					break;
-				}
-				case Node.DOCUMENT_TYPE_NODE : {
-					image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_DOCTYPE);
-					break;
-				}
-				case Node.ELEMENT_NODE : {
-					image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ELEMENT);
-					break;
-				}
-				case Node.PROCESSING_INSTRUCTION_NODE : {
-					image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_PROCESSINGINSTRUCTION);
-					break;
-				}
-				case Node.TEXT_NODE : {
-					image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_TXTEXT);
-					break;
-				}
-				case Node.ENTITY_REFERENCE_NODE : {
-					image = image = SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ENTITY_REFERENCE);
-					break;
-				}
-			}
-
-			// if (image != null) {
-			// Image markerOverlayImage =
-			// overlayIconManager.getOverlayImageForObject(node);
-			// if (markerOverlayImage != null) {
-			// image = imageFactory.createCompositeImage(image,
-			// markerOverlayImage, ImageFactory.BOTTOM_LEFT);
-			// }
-			// }
-		}
-		return image;
-	}
-
-	public Object getParent(Object o) {
-		if (o instanceof INodeNotifier)
-			((INodeNotifier) o).getAdapterFor(IJFaceNodeAdapter.class);
-
-		Object result = null;
-		if (o instanceof Node) {
-			Node node = (Node) o;
-			if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
-				result = ((Attr) node).getOwnerElement();
-			}
-			else {
-				result = node.getParentNode();
-			}
-		}
-		return result;
-	}
-
-	public Element getRootElement(Document document) {
-		Element rootElement = null;
-
-		for (Node childNode = document.getFirstChild(); childNode != null; childNode = childNode.getNextSibling()) {
-			if (childNode.getNodeType() == Node.ELEMENT_NODE) {
-				rootElement = (Element) childNode;
-				break;
-			}
-		}
-		return rootElement;
-	}
-
-	public String getText(Object object) {
-		if (object instanceof INodeNotifier)
-			((INodeNotifier) object).getAdapterFor(IJFaceNodeAdapter.class);
-
-		String result = null;
-		if (object instanceof Node) {
-			Node node = (Node) object;
-			switch (node.getNodeType()) {
-				case Node.ATTRIBUTE_NODE : {
-					result = node.getNodeName();
-					break;
-				}
-				case Node.DOCUMENT_TYPE_NODE : {
-					result = "DOCTYPE"; //$NON-NLS-1$
-					break;
-				}
-				case Node.ELEMENT_NODE : {
-					result = node.getNodeName();
-					break;
-				}
-				case Node.PROCESSING_INSTRUCTION_NODE : {
-					result = ((ProcessingInstruction) node).getTarget();
-					break;
-				}
-			}
-		}
-		return result != null ? result : ""; //$NON-NLS-1$
-	}
-
-	public boolean hasChildren(Object element) {
-		return getChildren(element).length > 0;
-	}
-
-	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-		// remove our listeners to the old state
-		if (oldInput != null) {
-			Document domDoc = (Document) oldInput;
-			ModelQuery mq = ModelQueryUtil.getModelQuery(domDoc);
-			if (mq != null) {
-				documentManager = mq.getCMDocumentManager();
-				if (documentManager != null) {
-					documentManager.removeListener(this);
-				}
-			}
-		}
-
-		if (oldInput != null && oldInput instanceof IDOMNode) {
-			IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IDOMNode) oldInput).getModel().getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
-			if (factory != null) {
-				factory.removeListener(viewer);
-			}
-		}
-
-		if (viewer instanceof StructuredViewer) {
-			fViewer = null;
-		}
-		else {
-			fViewer = (StructuredViewer) viewer;
-		}
-
-		if (newInput != null && newInput instanceof IDOMNode) {
-			IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IDOMNode) newInput).getModel().getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
-			if (factory != null) {
-				factory.addListener(viewer);
-			}
-		}
-
-		if (newInput != null) {
-			Document domDoc = (Document) newInput;
-			ModelQuery mq = ModelQueryUtil.getModelQuery(domDoc);
-
-			if (mq != null) {
-				documentManager = mq.getCMDocumentManager();
-				if (documentManager != null) {
-					documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_ASYNC_LOAD, true);
-					documentManager.addListener(this);
-				}
-			}
-		}
-	}
-
-	public boolean isDeleted(Object element) {
-		return element != null;
-	}
-
-	// the following methods handle filtering aspects of the viewer
-	//
-	//
-	public boolean isIgnorableText(Node node) {
-		boolean result = false;
-		try {
-			if (node.getNodeType() == Node.TEXT_NODE) {
-				String data = ((Text) node).getData();
-				result = (data == null || data.trim().length() == 0);
-			}
-		}
-		catch (Exception e) {
-			Logger.logException(e);
-		}
-		return result;
-	}
-
-	public boolean isLabelProperty(Object object, String property) {
-		return false;
-	}
-
-	public void propertyChanged(CMDocumentManager cmDocumentManager, String propertyName) {
-		if (cmDocumentManager.getPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD)) {
-			doDelayedRefreshForViewers();
-		}
-	}
-
-	public void removeListener(ILabelProviderListener listener) {
-		// since we always return 'false' for "isLabelProperty",
-		// not need to listen. Maybe that should change some day?
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeHelpContextIds.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeHelpContextIds.java
deleted file mode 100644
index 4c9a381..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeHelpContextIds.java
+++ /dev/null
@@ -1,31 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-
-
-/**
- * Help context ids for the TableTree view.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented or extended.
- * </p>
- *  
- */
-public interface XMLTableTreeHelpContextIds {
-	// org.eclipse.wst.xml.ui.
-	public static final String PREFIX = XMLUIPlugin.ID + "."; //$NON-NLS-1$
-
-	// XML Design View
-	public static final String XML_DESIGN_VIEW_HELPID = PREFIX + "xmlm3000"; //$NON-NLS-1$
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreePropertyDescriptorFactory.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreePropertyDescriptorFactory.java
deleted file mode 100644
index cffc2be..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreePropertyDescriptorFactory.java
+++ /dev/null
@@ -1,116 +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
- ****************************************************************************/
-
-
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import java.util.List;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-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.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.ui.internal.properties.EnumeratedStringPropertyDescriptor;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-public class XMLTableTreePropertyDescriptorFactory extends DOMPropertyDescriptorFactory {
-
-	protected TreeContentHelper treeContentHelper = new TreeContentHelper();
-
-	public XMLTableTreePropertyDescriptorFactory() {
-		super();
-	}
-
-	protected IPropertyDescriptor createPropertyDescriptorHelper(String name, Element element, CMNode cmNode) {
-		IPropertyDescriptor result = null;
-
-		ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
-		String[] valuesArray = null;
-		if (mq != null) {
-			valuesArray = mq.getPossibleDataTypeValues(element, cmNode);
-		}
-		if (valuesArray != null && valuesArray.length > 0) {
-			result = new EnumeratedStringPropertyDescriptor(name, name, valuesArray);
-		}
-		else {
-			result = createDefaultPropertyDescriptor(name);
-		}
-
-		return result;
-	}
-
-	public IPropertyDescriptor createTextPropertyDescriptor(Text text) {
-		IPropertyDescriptor result = null;
-		Node parentNode = text.getParentNode();
-		if (parentNode != null && parentNode.getNodeType() == Node.ELEMENT_NODE) {
-			Element parentElement = (Element) parentNode;
-			ModelQuery mq = ModelQueryUtil.getModelQuery(text.getOwnerDocument());
-			CMElementDeclaration ed = null;
-			if (mq != null) {
-				ed = mq.getCMElementDeclaration(parentElement);
-			}
-			if (ed != null) {
-				result = createPropertyDescriptorHelper(HACK, parentElement, ed);
-			}
-			else {
-				result = createDefaultPropertyDescriptor(parentElement.getNodeName());
-			}
-		}
-
-		if (result == null) {
-			result = new TextPropertyDescriptor(HACK, HACK);
-		}
-
-		return result;
-	}
-
-	public IPropertyDescriptor createAttributePropertyDescriptor(Attr attr) {
-		IPropertyDescriptor result = null;
-
-		String attributeName = attr.getName();
-		ModelQuery mq = ModelQueryUtil.getModelQuery(attr.getOwnerDocument());
-
-		CMAttributeDeclaration ad = null;
-		if (mq != null) {
-			ad = mq.getCMAttributeDeclaration(attr);
-		}
-		if (ad != null) {
-			result = createPropertyDescriptorHelper(attributeName, attr.getOwnerElement(), ad);
-		}
-
-		if (result == null) {
-			result = new TextPropertyDescriptor(attributeName, attributeName);
-		}
-
-		return result;
-	}
-
-	public IPropertyDescriptor createElementPropertyDescriptor(Element element) {
-		IPropertyDescriptor result = null;
-		List list = treeContentHelper.getElementTextContent(element);
-		if (list != null) {
-			Text text = treeContentHelper.getEffectiveTextNodeForCombinedNodeList(list);
-			if (text != null) {
-				result = createTextPropertyDescriptor(text);
-			}
-		}
-
-		if (result == null) {
-			result = new TextPropertyDescriptor(HACK, HACK);
-		}
-		return result;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java
deleted file mode 100644
index dd2d027..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java
+++ /dev/null
@@ -1,152 +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
- ****************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.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.actions.NodeAction;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.eclipse.wst.xml.ui.internal.dnd.XMLDragAndDropManager;
-import org.w3c.dom.Document;
-
-public class XMLTableTreeViewer extends TreeViewer implements IDesignViewer {
-
-	class NodeActionMenuListener implements IMenuListener {
-		public void menuAboutToShow(IMenuManager menuManager) {
-			// used to disable NodeSelection listening while running
-			// NodeAction
-			XMLNodeActionManager nodeActionManager = new XMLNodeActionManager(((IDOMDocument) getInput()).getModel(), XMLTableTreeViewer.this) {
-				public void beginNodeAction(NodeAction action) {
-					super.beginNodeAction(action);
-				}
-
-				public void endNodeAction(NodeAction action) {
-					super.endNodeAction(action);
-				}
-			};
-			nodeActionManager.fillContextMenu(menuManager, getSelection());
-		}
-	}
-
-	protected CellEditor cellEditor;
-
-	int count = 0;
-
-	protected XMLTreeExtension treeExtension;
-
-	public XMLTableTreeViewer(Composite parent) {
-		super(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
-
-		// set up providers
-		this.treeExtension = new XMLTreeExtension(getTree());
-
-		XMLTableTreeContentProvider provider = new XMLTableTreeContentProvider();
-		setContentProvider(provider);
-		setLabelProvider(provider);
-
-		createContextMenu();
-
-		XMLDragAndDropManager.addDragAndDropSupport(this);
-	}
-
-	/**
-	 * This creates a context menu for the viewer and adds a listener as well
-	 * registering the menu for extension.
-	 */
-	protected void createContextMenu() {
-		MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$
-		contextMenu.add(new Separator("additions")); //$NON-NLS-1$
-		contextMenu.setRemoveAllWhenShown(true);
-		contextMenu.addMenuListener(new NodeActionMenuListener());
-		Menu menu = contextMenu.createContextMenu(getControl());
-		getControl().setMenu(menu);
-	}
-
-	protected void doRefresh(Object o, boolean fromDelayed) {
-		treeExtension.resetCachedData();
-		super.refresh(o);
-	}
-
-	public ISelectionProvider getSelectionProvider() {
-		return this;
-	}
-
-	public String getTitle() {
-		return XMLEditorMessages.XMLTableTreeViewer_0;
-	}
-
-	protected void handleDispose(DisposeEvent event) {
-		super.handleDispose(event);
-		treeExtension.dispose();
-		setDocument(null);
-	}
-
-	public void refresh() {
-		treeExtension.resetCachedData();
-		super.refresh();
-	}
-
-	public void refresh(Object o) {
-		treeExtension.resetCachedData();
-		super.refresh(o);
-	}
-	
-	public void refresh(boolean updateLabels) {
-		treeExtension.resetCachedData();
-		super.refresh(updateLabels);
-		getControl().redraw();
-	}
-	
-	public void refresh(Object element, boolean updateLabels) {
-		treeExtension.resetCachedData();
-		super.refresh(element, updateLabels);
-		getControl().redraw();
-	}
-
-	public void setDocument(IDocument document) {
-		/*
-		 * let the text editor to be the one that manages the model's lifetime
-		 */
-		IStructuredModel model = null;
-		try {
-			model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-
-			if (model != null && model instanceof IDOMModel) {
-				Document domDoc = null;
-				domDoc = ((IDOMModel) model).getDocument();
-				setInput(domDoc);
-				treeExtension.setIsUnsupportedInput(false);
-			}
-			else {
-				treeExtension.setIsUnsupportedInput(true);
-			}
-		}
-		finally {
-			if (model != null) {
-				model.releaseFromRead();
-			}
-		}
-
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java
deleted file mode 100644
index 2775fae..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java
+++ /dev/null
@@ -1,167 +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
- ****************************************************************************/
-package org.eclipse.wst.xml.ui.internal.tabletree;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-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.CMDescriptionBuilder;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class XMLTreeExtension extends TreeExtension {
-
-	public final static String STRUCTURE_PROPERTY = XMLEditorMessages.XMLTreeExtension_0;
-	public final static String VALUE_PROPERTY = XMLEditorMessages.XMLTreeExtension_1;
-
-	protected Composite control;
-	protected MyCellModifier modifier;
-	protected XMLTableTreePropertyDescriptorFactory propertyDescriptorFactory;
-	protected CMDescriptionBuilder decriptionBuilder = new CMDescriptionBuilder();
-	protected TreeContentHelper treeContentHelper = new TreeContentHelper();
-
-	protected Color f1, f2, b1, b2;
-	protected boolean cachedDataIsValid = true;
-
-	public XMLTreeExtension(Tree tree) {
-		super(tree);
-		control = tree;
-		modifier = new MyCellModifier();
-		setCellModifier(modifier);
-		String[] properties = {STRUCTURE_PROPERTY, VALUE_PROPERTY};
-		setColumnProperties(properties);
-
-		f1 = tree.getDisplay().getSystemColor(SWT.COLOR_BLACK);
-		Color background = tree.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
-
-		int r = Math.abs(background.getRed() - 125);
-		int g = Math.abs(background.getGreen() - 85);
-		int b = Math.abs(background.getBlue() - 105);
-
-		f2 = new Color(tree.getDisplay(), r, g, b);
-		b1 = tree.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
-		b2 = background;
-
-		propertyDescriptorFactory = new XMLTableTreePropertyDescriptorFactory();
-	}
-
-	public void dispose() {
-		super.dispose();
-		f2.dispose();
-	}
-
-	public void resetCachedData() {
-		cachedDataIsValid = false;
-	}
-
-	public void paintItems(GC gc, TreeItem[] items, Rectangle treeBounds) {
-		super.paintItems(gc, items, treeBounds);
-		cachedDataIsValid = true;
-	}
-
-	protected Object[] computeTreeExtensionData(Object object) {
-		Color color = f1;
-		String string = ""; //$NON-NLS-1$
-		if (string.length() == 0) {
-			string = (String) modifier.getValue(object, VALUE_PROPERTY);
-			color = f1;
-		}
-		if (string.length() == 0 && object instanceof Element) {
-			string = getElementValueHelper((Element) object);
-			color = f2;
-		}
-		Object[] data = new Object[2];
-		data[0] = string;
-		data[1] = color;
-		return data;
-	}
-
-	protected void paintItem(GC gc, TreeItem item, Rectangle bounds) {
-		super.paintItem(gc, item, bounds);
-		Object[] data = computeTreeExtensionData(item.getData());
-		if (data != null && data.length == 2) {
-			gc.setClipping(columnPosition, bounds.y + 1, controlWidth, bounds.height);
-			gc.setForeground((Color) data[1]);
-			gc.drawString((String) data[0], columnPosition + 5, bounds.y + 1);
-			gc.setClipping((Rectangle) null);
-		}
-	}
-
-	protected void addEmptyTreeMessage(GC gc) {
-		// here we print a message when the document is empty just to give the
-		// user a visual cue
-		// so that they know how to proceed to edit the blank view
-		gc.setForeground(fTree.getDisplay().getSystemColor(SWT.COLOR_BLACK));
-		gc.setBackground(fTree.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
-		gc.drawString(XMLEditorMessages.XMLTreeExtension_3, 10, 10);
-		gc.drawString(XMLEditorMessages.XMLTreeExtension_4, 10, 10 + gc.getFontMetrics().getHeight());
-	}
-
-	public String getElementValueHelper(Element element) {
-		String result = null;
-
-		ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
-		if (result == null && mq != null) {
-			CMElementDeclaration ed = mq.getCMElementDeclaration(element);
-			if (ed != null && !Boolean.TRUE.equals(ed.getProperty("isInferred"))) { //$NON-NLS-1$
-				result = decriptionBuilder.buildDescription(ed);
-			}
-		}
-		return result != null ? result : ""; //$NON-NLS-1$
-	}
-
-	/**
-	 * 
-	 */
-	public class MyCellModifier implements ICellModifier, TreeExtension.ICellEditorProvider {
-		public boolean canModify(Object element, String property) {
-			boolean result = false;
-			if (element instanceof Node) {
-				Node node = (Node) element;
-				result = property == VALUE_PROPERTY && treeContentHelper.isEditable(node);
-			}
-			return result;
-		}
-
-		public Object getValue(Object object, String property) {
-			String result = null;
-			if (object instanceof Node) {
-				result = treeContentHelper.getNodeValue((Node) object);
-			}
-			return (result != null) ? result : ""; //$NON-NLS-1$
-		}
-
-		public void modify(Object element, String property, Object value) {
-			// enableNodeSelectionListener(false);
-			Item item = (Item) element;
-			String oldValue = treeContentHelper.getNodeValue((Node) item.getData());
-			String newValue = value.toString();
-			if (newValue != null && !newValue.equals(oldValue)) {
-				treeContentHelper.setNodeValue((Node) item.getData(), value.toString());
-			}
-			// enableNodeSelectionListener(true);
-		}
-
-		public CellEditor getCellEditor(Object o, int col) {
-			IPropertyDescriptor pd = propertyDescriptorFactory.createPropertyDescriptor(o);
-			return pd != null ? pd.createPropertyEditor(control) : null;
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateAction.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateAction.java
deleted file mode 100644
index 6cd89e8..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateAction.java
+++ /dev/null
@@ -1,180 +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
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.validation;
-
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IFile;
-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.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.xml.core.internal.validation.XMLValidationReport;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.ui.internal.Logger;
-
-                
-/**
- * This class managers the 'UI' related details of validation
- * Here's a quick overview of the details : 
- *   - manages Marker creation based on the results of the validation
- *   - (optionally) displays dialog to summarize the results of validation
- * 
- * @author Craig Salter, IBM
- * @author Lawrence Mandel, IBM
- */
-public class ValidateAction extends org.eclipse.wst.xml.ui.internal.validation.core.ValidateAction
-{ 
-  //dw private static final String _UI_MESSAGE_LIMITE_EXCEEDED = "_UI_MESSAGE_LIMITE_EXCEEDED";
-  
-  private InputStream inputStream;
-  
-
-  /**
-   * Constructor.
-   * 
-   * @param file The file to validate.
-   * @param showDialog Whether to display a dialog after validation.
-   */
-  public ValidateAction(IFile file, boolean showDialog)
-  {   
-    super(file, showDialog);
-  }  
-
-  /*
-   * Store additional information in the message parameters
-   * 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
-   */
-  protected void addInfoToMessage(ValidationMessage validationMessage, IMessage message)
-  { 
-    if (inputStream != null)
-    {
-      XMLMessageInfoHelper messageInfoHelper = new XMLMessageInfoHelper();
-      String[] messageInfo = messageInfoHelper.createMessageInfo(validationMessage.getKey(), 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]);
-    }  
-  }
-  
-  protected void validate(final IFile file)
-  {      
-    final XMLValidationOutcome valoutcome = new XMLValidationOutcome();
-    IPath path = file.getLocation();
-    final String uri = createURIForFilePath(path.toString());
-
-    IWorkspaceRunnable op = new IWorkspaceRunnable() 
-    {
-      public void run(IProgressMonitor progressMonitor) throws CoreException 
-      {         
-        XMLValidator validator = XMLValidator.getInstance();
-
-        clearMarkers(file);
-        XMLValidationReport valreport = null;
-        if (inputStream != null)
-        {
-          valreport = validator.validate(uri, inputStream);
-        }
-        else
-        {
-          valreport = validator.validate(uri);
-        }
-        
-        valoutcome.isValid = valreport.isValid();
-        if(valreport.getValidationMessages().length == 0)
-        {
-          valoutcome.hasMessages = false;
-        }
-        else
-        {
-          valoutcome.hasMessages = true;
-        }
-        valoutcome.isGrammarEncountered = valreport.isGrammarEncountered();
-        createMarkers(file, valreport.getValidationMessages());
-        
-        file.setSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME, valreport.getNestedMessages());
-      }
-    };    
-
-    
-    try
-    {
-      ResourcesPlugin.getWorkspace().run(op, null);
-//      String internalErrorMessage = null;
-//      if (validator.getInternalError() != null)
-//      {
-//        internalErrorMessage =  XMLValidatePlugin.getString("_UI_VALIDATION_INTERNAL_ERROR");
-//        internalErrorMessage += " : " + validator.getInternalError();
-//      }
-                 
-      if (showDialog)
-      {
-        // The file is invalid.
-        if (!valoutcome.isValid)
-        {
-          String title = XMLValidationUIMessages._UI_VALIDATION_FAILED;
-          String message = XMLValidationUIMessages._UI_THE_XML_FILE_IS_NOT_VALID;
-          openErrorDialog(title, message);
-        }
-        else
-        {
-          // The file is valid however warnings were issued.
-          if(valoutcome.hasMessages)
-          {
-            String title = XMLValidationUIMessages._UI_VALIDATION_SUCEEDED;
-            String message = valoutcome.isGrammarEncountered ?
-            			XMLValidationUIMessages._UI_THE_XML_FILE_IS_VALID_WITH_WARNINGS : 
-            				XMLValidationUIMessages._UI_THE_XML_FILE_IS_WELL_FORMED_WITH_WARNINGS + 
-            				XMLValidationUIMessages._UI_NO_GRAMMAR_WARNING;                             
-            
-            openWarningDialog(title, message);
-          }
-          // The file is valid with no warnings.
-          else
-          {
-            String title = XMLValidationUIMessages._UI_VALIDATION_SUCEEDED;
-            String message = valoutcome.isGrammarEncountered ?
-            			XMLValidationUIMessages._UI_THE_XML_FILE_IS_VALID : 
-            				XMLValidationUIMessages._UI_THE_XML_FILE_IS_WELL_FORMED + 
-            				XMLValidationUIMessages._UI_NO_GRAMMAR_WARNING;                             
-            
-            openValidDialog(title, message);
-          }
-        }
-      }
-    }
-
-    catch (CoreException e)
-    {
-      Logger.logException(e);
-    }                           
-  } 
-  
-  /**
-   * An XML specific validation outcome that includes whether a grammar 
-   * was encountered.
-   * 
-   * @author Lawrence Mandel, IBM
-   */
-  protected class XMLValidationOutcome extends ValidationOutcome
-  {
-    public boolean isGrammarEncountered = false;
-  }
-  public void setInputStream(InputStream inputStream)
-  { this.inputStream = inputStream;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateXMLFileActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateXMLFileActionDelegate.java
deleted file mode 100644
index 4bd2d95..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/ValidateXMLFileActionDelegate.java
+++ /dev/null
@@ -1,95 +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.ui.internal.validation;
-                                       
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IActionDelegate;
-
-/**
- * A delegate to invoke XML validation from the context menu's Validate XML option.
- * 
- * @author Craig Saler, IBM
- * @author Lawrence Mandel, IBM
- */
-public class ValidateXMLFileActionDelegate implements IActionDelegate
-{
-  protected ISelection selection;
-
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
-   */
-  public void run(IAction action)
-  {
-    IFile fileResource = null;
-    try
- {
-      // CS.. for now the following line tests to ensure the user has xerces jars installed
-      // so that we can perform some 'fail fast' behaviour
-      //
-      Class theClass = Class.forName("org.apache.xerces.xni.parser.XMLParserConfiguration", true, this.getClass().getClassLoader()); //$NON-NLS-1$
-      if (theClass == null)
-      {
-       throw(new Exception("Missing Xerces jars in plugin's 'jars' folder"));        //$NON-NLS-1$
-      }
-        
-    if (!selection.isEmpty() && selection instanceof IStructuredSelection)
-    {
-      IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-      Object element = structuredSelection.getFirstElement();
-
-      if (element instanceof IFile)
-      {
-        fileResource = (IFile) element;
-      }
-      else
-      {
-        return;
-      }
-    }
-          
-    if (fileResource != null)
-    {            
-      //IProject project = fileResource.getProject();
-      //URIResolver resolver = (URIResolver) project.getAdapter(URIResolver.class);
- // if (resolver == null)
-  // resolver = new ProjectResolver(project);
-  //resolver.setFileBaseLocation(fileResource.getLocation().toString());
-  //return resolver;
-      ValidateAction validateAction = new ValidateAction(fileResource, true);
-      validateAction.setValidator(new Validator());
-      validateAction.run();
-    }
- }
-    catch (Exception e)
- {
-      // CS... here's where we need to pop up a dialog to tell the user that xerces is not available
-      //
-      String xercesLine1 = XMLValidationUIMessages.ValidateXMLFileActionDelegate_2;
-      String xercesLine2 = XMLValidationUIMessages.ValidateXMLFileActionDelegate_3;
-      String xercesLine3 = XMLValidationUIMessages.ValidateXMLFileActionDelegate_4;
-      MessageDialog.openError(Display.getDefault().getActiveShell(), XMLValidationUIMessages.ValidateXMLFileActionDelegate_5, xercesLine1 + xercesLine2 + xercesLine3);
- }
-  }
-
-  /* (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)
-  {
-    this.selection = selection;
-  }   
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/Validator.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/Validator.java
deleted file mode 100644
index c31ef45..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/Validator.java
+++ /dev/null
@@ -1,206 +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
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.validation;
-
-
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Locale;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.IRuleGroup;
-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.ui.internal.XMLUIMessages;
-
-/**
- * A validator to plug the XML validator into the validation framework.
- * 
- * @author Craig Salter, IBM
- * @author Lawrence Mandel, IBM
- */
-public class Validator implements IValidator
-{
-	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();
-		}
-	}
-	
-  private final String GET_FILE = "getFile"; //$NON-NLS-1$
-  public final String GET_PROJECT_FILES = "getAllFiles"; //$NON-NLS-1$
-
-	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.
-   * 
-   * @param file The file to validate.
-   */
-  public void validate(IFile file)
-  {
-    ValidateAction validateAction = new ValidateAction(file, false);
-    validateAction.setValidator(this);
-    validateAction.run();	
-  }
-  public void validate(IFile file, InputStream inputStream, IReporter reporter)
-  {
-    ValidateAction validateAction = new ValidateAction(file, false);
-    validateAction.setValidator(this);
-    if (inputStream != null)
-    {
-      validateAction.setInputStream(inputStream);
-      validateAction.setReporter(reporter);
-    }
-    validateAction.run(); 
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wtp.validation.core.IValidator#validate(org.eclipse.wtp.validation.core.IHelper, org.eclipse.wtp.validation.core.IReporter, org.eclipse.wtp.validation.core.IFileDelta[])
-   */
-  public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
-	 String[] fileURIs = helper.getURIs();
-     if (fileURIs != null && fileURIs.length > 0) 
-    {
-      for (int i = 0; i < fileURIs.length; i++) 
-      {
-        String fileName = fileURIs[i];
-        if (fileName != null)
-        {          
-          Object []parms = {fileName};
-
-          IFile file = (IFile) helper.loadModel(GET_FILE, parms);
-          if (file != null && shouldValidate(file)) 
-          { //the helper might not have the file stored in it. could have an InputStream
-            if (helper.loadModel("inputStream") instanceof InputStream) //$NON-NLS-1$
-            {
-              validate(file, (InputStream)helper.loadModel("inputStream"), reporter); //do we need the fileName?  what is int ruleGroup? //$NON-NLS-1$
-            }
-            else
-            {
-              //if (((Helper)helper).isInJavaBuildPath(file) &&
-              //    !((WorkbenchContext)helper).isInJavaSourcePath(file))
-              //{
-              //  continue;
-              //}
-              validateIfNeeded(file, helper, reporter);
-            }
-          }
-        }
-      }
-    }
-    else 
-    {
-      Object []parms = {this.getClass().getName()};
-      Collection files = (Collection) helper.loadModel(GET_PROJECT_FILES, parms);
-      Iterator iter = files.iterator();
-      while (iter.hasNext()) 
-      {
-        IFile file = (IFile) iter.next();
-        validateIfNeeded(file, helper, reporter);
-      }
-    }
-  }
-  
-  /**
-   * Validate the given file and use the reporter for the validation messages.
-   * 
-   * @param file The file to validate.
-   * @param reporter The reporter to report the validation messages.
-   * @param ruleGroup
-   */
-  public void validate(IFile file, IReporter reporter, int ruleGroup)
-  {  
-    ValidateAction validateAction = new ValidateAction(file, false);
-    validateAction.setValidator(this);
-    validateAction.run();  
-  }
-  
-  /**
-   * Validate the given file if validation is required.
-   * 
-   * @param file The file to validate.
-   * @param helper An aid for the validation.
-   * @param reporter The reporter to report the validation messages.
-   */
-  protected void validateIfNeeded(IFile file, IValidationContext helper, IReporter reporter)
-  {
-    Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(XMLUIMessages.MESSAGE_XML_VALIDATION_MESSAGE_UI_, new String[]{file.getFullPath().toString()}));
-    reporter.displaySubtask(this, message);
-
-    Integer ruleGroupInt = (Integer)helper.loadModel(IRuleGroup.PASS_LEVEL, null); // pass in a "null" so that loadModel doesn't attempt to cast the result into a RefObject
-    int ruleGroup = (ruleGroupInt == null) ? IRuleGroup.PASS_FULL : ruleGroupInt.intValue();
-
-    validate(file, reporter, ruleGroup);
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wtp.validation.core.IValidator#cleanup(org.eclipse.wtp.validation.core.IReporter)
-   */
-  public void cleanup(IReporter reporter)
-  {
-	// Nothing to do.
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLMessageInfoHelper.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLMessageInfoHelper.java
deleted file mode 100644
index c08b6dc..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLMessageInfoHelper.java
+++ /dev/null
@@ -1,93 +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.ui.internal.validation;
-
-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.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$
-	}
-    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.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidationUIMessages.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidationUIMessages.java
deleted file mode 100644
index bdd6994..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidationUIMessages.java
+++ /dev/null
@@ -1,55 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- * 
- */
-package org.eclipse.wst.xml.ui.internal.validation;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML Validation
- */
-public class XMLValidationUIMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.xml.ui.internal.validation.xmlvalidation"; //$NON-NLS-1$
-
-	private XMLValidationUIMessages() {
-		// cannot create new instance
-	}
-
-	static {
-		// initialize resource bundle
-		NLS.initializeMessages(BUNDLE_NAME, XMLValidationUIMessages.class);
-	}
-	public static String _UI_VALIDATION_INTERNAL_ERROR;
-	public static String _UI_VALIDATION_FAILED;
-	public static String _UI_VALIDATION_SUCEEDED;
-	public static String _UI_THE_XML_FILE_IS_NOT_VALID;
-	public static String _UI_THE_XML_FILE_IS_VALID;
-	public static String _UI_THE_XML_FILE_IS_VALID_WITH_WARNINGS;
-	public static String _UI_THE_XML_FILE_IS_WELL_FORMED;
-	public static String _UI_THE_XML_FILE_IS_WELL_FORMED_WITH_WARNINGS;
-	public static String _UI_NO_GRAMMAR_WARNING;
-	public static String _UI_MESSAGE_LIMITE_EXCEEDED;
-	public static String _UI_REF_FILE_ERROR_DESCRIPTION;
-	public static String _UI_REF_FILE_ERROR_MESSAGE;
-	public static String _UI_REF_FILE_ERROR_DETAILS;
-	public static String _UI_DETAILS_INFORMATION_UNAVAILABLE;
-	public static String _UI_DETAILS_INFO_REVALIDATE_TO_REGENERATE;
-	public static String _UI_SAVE_DIRTY_FILE_MESSAGE;
-	public static String _UI_SAVE_DIRTY_FILE_TITLE;
-	public static String ValidateXMLFileActionDelegate_2;
-	public static String ValidateXMLFileActionDelegate_3;
-	public static String ValidateXMLFileActionDelegate_4;
-	public static String ValidateXMLFileActionDelegate_5;
-	public static String TaskListTableViewer_0;
-	public static String TaskListTableViewer_1;
-	public static String TaskListTableViewer_2;
-	public static String TaskListTableViewer_3;
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidator.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidator.java
deleted file mode 100644
index 0f67568..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidator.java
+++ /dev/null
@@ -1,73 +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
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.validation;
-
-import java.io.InputStream;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.xml.core.internal.validation.XMLValidationReport;
-
-/**
- * An XML validator specific to Eclipse. This validator will wrap the internal
- * XML validator an provide automatic URI resolver support.
- * Using this class is equivalent to using the internal XML validator and registering
- * the URI resolver.
- * 
- * @author Lawrence Mandel, IBM
- */
-public class XMLValidator
-{
-  private static XMLValidator instance = null;
-  private org.eclipse.wst.xml.core.internal.validation.XMLValidator validator = 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 and set the URI resolver.
-   */
-  protected XMLValidator()
-  {
-    validator = new org.eclipse.wst.xml.core.internal.validation.XMLValidator();
-    validator.setURIResolver(URIResolverPlugin.createResolver());
-  }
-  /**
-   * Validate the file at the given URI.
-   * 
-   * @param uri The URI of the file to validate.
-   */
-  public XMLValidationReport validate(String uri)
-  {
-    return validator.validate(uri);
-  }
-  /**
-   * Validate the InputStream
-   * 
-   * @param uri The URI of the file to validate.
-   * @param inputStream The input stream to validate.
-   */
-  public XMLValidationReport validate(String uri, InputStream inputStream)
-  {
-    return validator.validate(uri, inputStream);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/ValidateAction.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/ValidateAction.java
deleted file mode 100644
index 449ee12..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/ValidateAction.java
+++ /dev/null
@@ -1,431 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.validation.core;
-
-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.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.validation.internal.operations.LocalizedMessage;
-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.IValidator;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.logging.ILogger;
-import org.eclipse.wst.xml.core.internal.validation.core.logging.LoggerFactory;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.validation.XMLValidationUIMessages;
-
-/**
- * A general validate action class that can be extended by validators. This class
- * provides methods to run the action, add markers to a file and will handle
- * showing a dialog with the results of validation (if requested) and prompt to
- * save dirty files (if requested.)
- */
-public abstract class ValidateAction extends Action
-{
-  // 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 REFERENCED_FILE_ERROR = "referencedFileError"; //$NON-NLS-1$
-
-  private static final String GROUP_NAME = "groupName"; //$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$
-  
-  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$
-
-  protected boolean showDialog = true;
-
-  protected IFile file = null;
-
-  protected IReporter reporter;
-
-  protected IValidator validator;
-
-  /**
-   * Constructor.
-   * 
-   * @param file
-   *          The file to validate.
-   * @param showDialog
-   *          Whether or not to show a dialog when validation is complete.
-   */
-  public ValidateAction(IFile file, boolean showDialog)
-  {
-    this.showDialog = showDialog;
-    this.file = file;
-  }
-
-  /**
-   * Validate the specified file.
-   * 
-   * @param file
-   *          The file to validate.
-   */
-  protected abstract void validate(final IFile file);
-
-  protected void addInfoToMessage (ValidationMessage v, IMessage m)
-  { // This method is overidden by subclasses
-  }
-  
-  /**
-   * 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)
-  {
-    if (!fileIsOK(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(getValidationFrameworkSeverity(IMarker.SEVERITY_WARNING), validationMessage
-            .getMessage(), iFile);
-      }
-      else
-      { 
-        message = new LocalizedMessage(getValidationFrameworkSeverity(IMarker.SEVERITY_ERROR), 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);
-      }
-
-      getOrCreateReporter().addMessage(getValidator(), message);
-
-      
-    }
-    try
-    {
-      IMarker[] markers = iFile.findMarkers(null, true, IResource.DEPTH_INFINITE);
-      for (int i = 0; i < markers.length; i++)
-      {
-        IMarker marker = markers[i];
-        String groupName = null;
-        try
-        {
-          groupName = (String) marker.getAttribute(GROUP_NAME);
-        }
-        catch (Exception e)
-        {
-        }
-
-        if (groupName != null && groupName.startsWith(REFERENCED_FILE_ERROR))
-        {
-
-          marker.setAttribute(IMarker.DONE, true);
-        }
-      }
-    }
-    catch (CoreException e)
-    {
-      e.printStackTrace();
-    }
-
-  }
-
-  public void clearMarkers(IFile iFile)
-  {
-    if (fileIsOK(iFile))
-    {
-      getOrCreateReporter().removeAllMessages(getValidator(), iFile);
-    }
-  }
-
-  public void run()
-  {
-  	try
-  	{
-  		// CS... a temporary test to avoid performing validation in the absence of xerces 
-  		//
-  		//dw Class theClass = 
-  		Class.forName("org.apache.xerces.xni.parser.XMLParserConfiguration", true, this.getClass().getClassLoader()); //$NON-NLS-1$
-  		  		
-  		if (fileIsOK(file))
-  		{
-  			// Check if the editor is dirty for this file. If so, prompt the user to
-  			// save before validating.
-  			if(showDialog)
-  			{
-  				checkIfFileDirty(file);
-  			}
-  			try
-  			{
-  				validate(file);
-  			}
-  			catch (Exception e)
-  			{
-  				ILogger logger = LoggerFactory.getLoggerInstance();
-  				logger.logError("", e); //$NON-NLS-1$
-  				//      e.printStackTrace();
-  			}
-  		}
-  	}
-  	catch (Exception e)
-  	{		
-  	}
-  }
-
-  /**
-   * Test whether the file given is OK to use. A file is OK to use if 1. It is
-   * not null 2. It exists. 3. The project containing the file is accessible.
-   * 
-   * @param file The file to check.
-   * @return True if the file is OK to use, false otherwise.
-   */
-  protected boolean fileIsOK(IFile file)
-  {
-    if (file != null && file.exists() && file.getProject().isAccessible())
-    {
-      return true;
-    }
-    return false;
-  }
-
-  /**
-   * Check if the file is dirty. A file is dirty if there is an open editor for
-   * the file that contains changes that haven't been saved.
-   * 
-   * @param file The file to check to see if it is dirty.
-   */
-  protected void checkIfFileDirty(IFile file)
-  {
-    IEditorPart[] dirtyEditors = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow()
-        .getActivePage().getDirtyEditors();
-    int numeditors = dirtyEditors.length;
-    for (int i = 0; i < numeditors; i++)
-    {
-      IEditorInput editorInput = dirtyEditors[i].getEditorInput();
-      if (editorInput instanceof FileEditorInput)
-      {
-        FileEditorInput fileEditorInput = (FileEditorInput) editorInput;
-        if (fileEditorInput.getFile().equals(file))
-        {
-          String message = XMLValidationUIMessages._UI_SAVE_DIRTY_FILE_MESSAGE;
-          String title = XMLValidationUIMessages._UI_SAVE_DIRTY_FILE_TITLE;
-          if (MessageDialog.openQuestion(Display.getDefault().getActiveShell(), title, message))
-          {
-            dirtyEditors[i].doSave(null);
-          }
-          // There can only be one open editor/file so we can break.
-          break;
-        }
-      }
-    }
-  }
-
-  /**
-   * Gets the reporter.
-   * 
-   * @return Returns a IReporter
-   */
-  public IReporter getReporter()
-  {
-    return reporter;
-  }
-
-  /**
-   * Sets the reporter.
-   * 
-   * @param reporter
-   *          The reporter to set
-   */
-  public void setReporter(IReporter reporter)
-  {
-    this.reporter = reporter;
-  }
-
-  /**
-   * Gets the validator.
-   * 
-   * @return Returns a IValidator
-   */
-  public IValidator getValidator()
-  {
-    return validator;
-  }
-
-  /**
-   * Sets the validator.
-   * 
-   * @param validator
-   *          The validator to set
-   */
-  public void setValidator(IValidator validator)
-  {
-    this.validator = validator;
-  }
-
-  protected IReporter getOrCreateReporter()
-  {
-    if (reporter == null)
-    { 
-      reporter = new WorkbenchReporter(file.getProject(), new NullProgressMonitor());
-    }
-    return reporter;
-  }
-
-  /**
-   * Originally from *validation.Helper
-   * 
-   * @param severity
-   *          The severity given.
-   * @return The validation framework severity corresponding to the error.
-   */
-  protected 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;
-  }
-  
-  /**
-   * Open an error dialog with the given title and message. Show the problems view
-   * if it is not already visible.
-   * 
-   * @param title The title of the error dialog.
-   * @param message The message in the error dialog.
-   */
-  protected void openErrorDialog(String title, String message)
-  {
-    showProblemsView();
-    MessageDialog.openError(Display.getDefault().getActiveShell(), title, message);
-  }
-  
-  /**
-   * Open an warning dialog with the given title and message. Show the problems view
-   * if it is not already visible.
-   * 
-   * @param title The title of the warning dialog.
-   * @param message The message in the warning dialog.
-   */
-  protected void openWarningDialog(String title, String message)
-  {
-    showProblemsView();
-    MessageDialog.openWarning(Display.getDefault().getActiveShell(), title, message);
-  }
-  
-  /**
-   * Open a valid dialog with the given title and message. 
-   * 
-   * @param title The title of the valid dialog.
-   * @param message The message in the valid dialog.
-   */
-  protected void openValidDialog(String title, String message)
-  {
-    MessageDialog.openInformation(Display.getDefault().getActiveShell(), title, message);
-  }
-  
-  /**
-   * Show the problems view if it is not already visible.
-   */
-  protected void showProblemsView()
-  {
-    IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-    IWorkbenchPage page = dw.getActivePage();
-    IWorkbenchPart activePart = page.getActivePart();
-    try
-    {
-      if (page != null)
-      {
-        page.showView(IPageLayout.ID_PROBLEM_VIEW);
-      }
-    }
-    catch (PartInitException e)
-    {
-    	Logger.logException(e);
-    }
-    page.activate(activePart);
-  }
-  
-  /**
-   * Format a file name into a correct URI.
-   * 
-   * @param filename The file name to format.
-   * @return The formatted URI.
-   */
-  protected 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;
-  }
-  
-  /**
-   * The validation outcome class holds the results from validating
-   * a file.
-   * 
-   * @author Lawrence Mandel, IBM
-   */
-  protected class ValidationOutcome
-  {
-    public boolean isValid = true;
-
-    public boolean hasMessages = false;
-
-    public ValidationOutcome()
-    {
-    }
-  }
-}
-
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorActionDelegate.java
deleted file mode 100644
index 96457cd..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorActionDelegate.java
+++ /dev/null
@@ -1,160 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.validation.core.errorinfo;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.ActionDelegate;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.ui.internal.validation.XMLValidationUIMessages;
-
-public class ReferencedFileErrorActionDelegate extends ActionDelegate implements IObjectActionDelegate
-{
-  protected IMarker selectedMarker;
-
-  /**
-   * 
-   */
-  public ReferencedFileErrorActionDelegate()
-  {
-    super();
-  }
-
-  public void run(IAction action)
-  {
-    if (selectedMarker != null)
-    {
-      try
-      {
-      	
-        Map map = (Map) selectedMarker.getResource().getSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME);
-        if (map == null)
-        {
-			String infoUnavailable = XMLValidationUIMessages._UI_DETAILS_INFORMATION_UNAVAILABLE;
-			String revalidateToRegenerateErrors = XMLValidationUIMessages._UI_DETAILS_INFO_REVALIDATE_TO_REGENERATE;
-        	MessageDialog.openInformation(Display.getCurrent().getActiveShell(), infoUnavailable, revalidateToRegenerateErrors);
-        }
-        else
-        {
-          String uri = null;
-
-          String groupName = (String) selectedMarker.getAttribute("groupName"); //$NON-NLS-1$
-          if (groupName.startsWith("referencedFileError")) //$NON-NLS-1$
-          {
-            int index1 = groupName.indexOf("("); //$NON-NLS-1$
-            int index2 = groupName.lastIndexOf(")"); //$NON-NLS-1$
-            if (index1 != -1 && index2 > index1)
-            {
-              uri = groupName.substring(index1 + 1, index2);
-            }
-          }
-
-          if (uri != null)
-          {
-            List list = Collections.EMPTY_LIST;
-
-            ValidationMessage message = (ValidationMessage) map.get(uri);
-            if (message != null)
-            {
-              list = message.getNestedMessages();
-            }
-
-            String validatedFileURI = selectedMarker.getResource().getLocation().toOSString();//URIHelper.normalize(selectedMarker.getResource().getLocation().toOSString());
-            validatedFileURI = "file:/" + validatedFileURI; //$NON-NLS-1$
-
-            ReferencedFileErrorDialog dialog = new ReferencedFileErrorDialog(Display.getCurrent().getActiveShell(), list, validatedFileURI, uri);
-            dialog.createAndOpen();
-          }
-        }
-      }
-      catch (CoreException e)
-      {
-    	// Do nothing.
-      }
-    }
-  }
-
-  public void selectionChanged(IAction action, ISelection selection)
-  {
-    super.selectionChanged(action, selection);
-    selectedMarker = null;
-    if (selection instanceof IStructuredSelection)
-    {
-      try
-      {
-        Object first = ((IStructuredSelection) selection).getFirstElement();
-        
-        IMarker marker = (IMarker)first;
-        selectedMarker = marker;
-//        String groupName = (String) marker.getAttribute("groupName");
-//        if (groupName.startsWith("referencedFileError"))
-//        {
-//          selectedMarker = marker;
-//        }
-      }
-      catch (Exception e)
-      {
-    	// Do nothing.
-      }
-    }
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
-   */
-  public void setActivePart(IAction action, IWorkbenchPart targetPart)
-  {
-   //dw int i = 0;
-  }
-}
-
-/*
-	private static void printMap(Map map)
-	{
-		for (Iterator i = map.keySet().iterator(); i.hasNext();)
-		{
-			String key = (String) i.next();
-			System.out.println("entry : " + key + " = " + map.get(key));
-		}
-	}
-  
-	private void printErrorMap(Map map)
-	{
-		for (Iterator i = map.keySet().iterator(); i.hasNext();)
-		{
-			String key = (String) i.next();
-			ErrorMessage message = (ErrorMessage) map.get(key);
-			if (message != null)
-			{
-				printErrorMessage(message);
-			}
-		}
-	}
-  
-	private void printErrorMessage(ErrorMessage errorMessage)
-	{
-		System.out.println(errorMessage.getText());
-		for (Iterator i = errorMessage.getNestedErrors().iterator(); i.hasNext();)
-		{
-			printErrorMessage((ErrorMessage) i.next());
-		}
-	}
- */
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorDialog.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorDialog.java
deleted file mode 100644
index d8e37c4..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorDialog.java
+++ /dev/null
@@ -1,285 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.validation.core.errorinfo;
-
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseMoveListener;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.ui.internal.validation.XMLValidationUIMessages;
-
-
-public class ReferencedFileErrorDialog extends Dialog
-{
-  protected TaskListTableViewer tableViewer;
-  protected List errorList;
-  protected String markedUpDetailsMessage;
-  protected String contextFile;
-  protected String referencedFile;
-  protected StyledText styledText;
-  protected Text fullFileNameField;
-
-  public ReferencedFileErrorDialog(Shell parentShell, List errorList, String contextFile, String referencedFile)
-  {
-    super(parentShell);
-
-    int styleBits = getShellStyle() | SWT.RESIZE;
-    styleBits &= ~SWT.APPLICATION_MODAL;
-
-    setShellStyle(styleBits);
-    this.errorList = errorList;
-
-    this.referencedFile = referencedFile;
-    this.contextFile = contextFile;
-    this.markedUpDetailsMessage = getMarkedUpDetailsMessage();
-  }
-
-  public int createAndOpen()
-  {
-    create();
-    getShell().setText(XMLValidationUIMessages._UI_REF_FILE_ERROR_DETAILS);
-	
-    setBlockOnOpen(false);
-    return open();
-  }
-
-
-  protected Control createButtonBar(Composite parent)
-  {
-    Composite composite = new Composite(parent, SWT.NONE);
-    composite.setLayout(new GridLayout(2, false));
-    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-    fullFileNameField = new Text(composite, SWT.NONE);
-    fullFileNameField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-    fullFileNameField.setBackground(parent.getBackground());
-    fullFileNameField.setEditable(false);
-
-    super.createButtonBar(composite);
-
-    return composite;
-  }
-
-  protected Control createDialogArea(Composite parent)
-  {
-    Composite dialogArea = (Composite) super.createDialogArea(parent);
-    dialogArea.setLayout(new GridLayout());
-
-    Composite c = new Composite(dialogArea, SWT.NONE);
-    c.setLayout(new GridLayout());
-    c.setLayoutData(createGridData(true, -1, 200));
-
-    styledText = new StyledText(c, SWT.MULTI | SWT.WRAP);
-    styledText.setBackground(c.getBackground());
-    setStyledText(styledText, markedUpDetailsMessage);
-    styledText.setEditable(false);
-    styledText.setLayoutData(createGridData(false, 650, -1));
-
-    MouseListener mouseListener = new MouseListener();
-    styledText.addMouseMoveListener(mouseListener);
-
-    tableViewer = new TaskListTableViewer(c, 10);
-    tableViewer.setInput(errorList);
-    tableViewer.addSelectionChangedListener(new InternalSelectionListener());
-    tableViewer.getControl().setLayoutData(createGridData(true, 700, -1));
-    return dialogArea;
-  }
-
-  String getFullURI(int offset)
-  {
-    String uri = ""; //$NON-NLS-1$
-    int index = getIndex(offset);
-    if (index != -1)
-    {
-      if (index == 0 || index == 2 || index == 3)
-      {
-        uri = referencedFile;
-      }
-      else
-      {
-        uri = contextFile;
-      }
-    }
-    return uri;
-  }
-
-  private int getIndex(int offset)
-  {
-    int result = -1;
-    StyleRange[] range = styledText.getStyleRanges();
-    for (int i = 0; i < range.length; i++)
-    {
-      int l = range[i].start;
-      int r = l + range[i].length;
-      if (l <= offset && r >= offset)
-      {
-        result = i;
-        break;
-      }
-    }
-    return result;
-  }
-
-  class MouseListener implements MouseMoveListener
-  {
-    public void mouseMove(MouseEvent event)
-    {
-      String toolTipText = ""; //$NON-NLS-1$
-      try
-      {
-
-        int offset = styledText.getOffsetAtLocation(new Point(event.x, event.y));
-        toolTipText = getFullURI(offset);
-
-      }
-      catch (Exception e)
-      {
-    	// Do nothing.
-      }
-      styledText.setToolTipText(toolTipText);
-      if (toolTipText != null && toolTipText.length() > 0)
-      {
-        fullFileNameField.setText(toolTipText);
-      }
-    }
-  }
-
-  private String getMarkedUpDetailsMessage()
-  {
-	String detailsMessage = "";  	 //$NON-NLS-1$
-    // TODO... need to move '_UI_REF_FILE_ERROR_DESCRIPTION' to this plugin's properties file
-    //			
-      String string = XMLValidationUIMessages._UI_REF_FILE_ERROR_DESCRIPTION;
-      // TODO... need to edit the properties file to remove "'" characters from the string
-      // I'm using these characters to markup the bold font. It's safer if I add these programtically.
-      //
-	  string = removePattern(string, "'"); //$NON-NLS-1$
-
-      String c = "'" + getLastSegment(contextFile) + "'"; //$NON-NLS-1$ //$NON-NLS-2$
-      String r = "'" + getLastSegment(referencedFile) + "'"; //$NON-NLS-1$ //$NON-NLS-2$
-
-      detailsMessage = NLS.bind(string, new Object[] { r, c, r, c });    
-    return detailsMessage;
-  }
-
-  private String removePattern(String string, String pattern)
-  {
-  	while (true)
-  	{
-  		int index = string.indexOf(pattern);
-  		if (index != -1)
-  		{
-  			string = string.substring(0, index) + string.substring(index + pattern.length());
-  		}
-  		else
-  		{
-  			break;
-  		}
-  	}
-  	return string;  	
-  }
-
-  private void setStyledText(StyledText styledText, String text)
-  {
-    String visibleMessage = ""; //$NON-NLS-1$
-    for (StringTokenizer st = new StringTokenizer(markedUpDetailsMessage, "'", false); st.hasMoreTokens();) //$NON-NLS-1$
-    {
-      String token = st.nextToken();
-      visibleMessage += token;
-    }
-
-    styledText.setText(visibleMessage);
-   //dw Font font = styledText.getFont();
-
-    boolean inQuote = false;
-    int position = 0;
-    for (StringTokenizer st = new StringTokenizer(markedUpDetailsMessage, "'", true); st.hasMoreTokens();) //$NON-NLS-1$
-    {
-      String token = st.nextToken();
-
-      if (token.equals("'")) //$NON-NLS-1$
-      {
-        inQuote = !inQuote;
-      }
-      else
-      {
-        if (inQuote)
-        {
-          try
-          {
-
-            StyleRange style = new StyleRange(position, token.length(), styledText.getForeground(), styledText.getBackground(), SWT.BOLD);
-            styledText.setStyleRange(style);
-          }
-          catch (Exception e)
-          {
-            e.printStackTrace();
-          }
-        }
-        position = position + token.length();
-      }
-    }
-  }
-
-  private static GridData createGridData(boolean fillBoth, int w, int h)
-  {
-    GridData gd = new GridData(fillBoth ? GridData.FILL_BOTH : GridData.FILL_HORIZONTAL);
-    gd.widthHint = w;
-    gd.heightHint = h;
-    return gd;
-  }
-  
-  private static String getLastSegment(String uri)
-  {
-    String result = uri;
-    int index = Math.max(uri.lastIndexOf("/"), uri.lastIndexOf("\\")); //$NON-NLS-1$ //$NON-NLS-2$
-    if (index != -1)
-    {
-      result = uri.substring(index + 1);
-    }
-    return result;
-  }
-
-  protected class InternalSelectionListener implements ISelectionChangedListener
-  {
-    public void selectionChanged(SelectionChangedEvent event)
-    {
-      ISelection selection = event.getSelection();
-      if (selection instanceof StructuredSelection)
-      {
-        ValidationMessage validationMessage = (ValidationMessage) ((StructuredSelection) selection).getFirstElement();
-        if (validationMessage != null)
-        {
-          String uristring = validationMessage.getUri();
-          ReferencedFileErrorUtility.openEditorAndGotoError(uristring, validationMessage.getLineNumber(), validationMessage.getColumnNumber());
-        }
-      }
-    }
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorUtility.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorUtility.java
deleted file mode 100644
index b30df8c..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorUtility.java
+++ /dev/null
@@ -1,131 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.validation.core.errorinfo;
-
-import java.net.URL;
-
-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.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.wst.xml.core.internal.validation.core.logging.LoggerFactory;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-
-public class ReferencedFileErrorUtility
-{
-  public static void openEditorAndGotoError(String uristring, final int line, final int column)
-  {
-    if (uristring != null)
-    {
-      try
-      {
-        URL uri = new URL(uristring);
-        if (uri != null)
-        {
-          if ("file".equals(uri.getProtocol())) //$NON-NLS-1$
-          {
-            String pathString = uri.getPath();
-            IPath path = new Path(pathString);
-            String device = path.getDevice();
-            if (device != null && device.startsWith("/")) //$NON-NLS-1$
-            {
-              path = path.setDevice(device.substring(1));
-            }
-            IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
-            if (file != null && file.exists())
-            {
-              //WorkbenchUtility.openEditor(file);
-              // Open the editor for this file.
-              final IFile iFile = file;
-              IWorkbench workbench = XMLUIPlugin.getInstance().getWorkbench();
-              final IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-
-              Display.getDefault().asyncExec
-              (new Runnable()
-              {
-                public void run()
-                {
-                  try
-                  {
-                  	IEditorDescriptor descriptor = XMLUIPlugin.getInstance().getWorkbench().getEditorRegistry().getDefaultEditor(iFile.getName());
-                  	String editorId;
-                  	if(descriptor != null)
-                  	{
-                  	  editorId = descriptor.getId();
-                  	}
-                  	else
-                  	{
-                  	  editorId = XMLUIPlugin.getInstance().getWorkbench().getEditorRegistry().getDefaultEditor(iFile.getName() + ".txt").getId(); //$NON-NLS-1$
-                  	}
-                    workbenchWindow.getActivePage().openEditor(new FileEditorInput(iFile), editorId);
-                  }
-                  catch (PartInitException ex)
-                  {
-                    LoggerFactory.getLoggerInstance().logError("Exception encountered when attempting to open file: " + iFile + "\n\n", ex); //$NON-NLS-1$ //$NON-NLS-2$
-                  	//B2BGUIPlugin.getPlugin().getMsgLogger().write("Exception encountered when attempting to open file: " + iFile + "\n\n" + ex);
-                  }
-                }
-              });
-                
-              Runnable runnable = new Runnable()
-              {
-                public void run()
-                {
-                  //IEditorPart editorPart = WorkbenchUtility.getActiveEditor();
-                  IEditorPart editorPart = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-                  gotoError(editorPart, line, column);
-                }
-              };
-              Display.getCurrent().asyncExec(runnable);
-            }
-          }
-        }
-      }
-      catch (Exception e)
-      {
-    	// Do nothing.
-      }
-    }
-  }
-
-  static void gotoError(IEditorPart editorPart, int line, int column)
-  {
-    if (editorPart != null)
-    {
-      TextEditor textEditor = (TextEditor) editorPart.getAdapter(TextEditor.class);
-      if (textEditor != null)
-      {
-        try
-        {
-          IDocumentProvider dp = textEditor.getDocumentProvider();
-          IDocument document = (dp != null) ? dp.getDocument(textEditor.getEditorInput()) : null;
-          textEditor.selectAndReveal(document.getLineOffset(line - 1) + column - 1, 0);
-        }
-        catch (BadLocationException x)
-        {
-          // marker refers to invalid text position -> do nothing
-        }
-      }
-    }
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/TaskListTableViewer.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/TaskListTableViewer.java
deleted file mode 100644
index 55a5610..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/TaskListTableViewer.java
+++ /dev/null
@@ -1,182 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.validation.core.errorinfo;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.validation.XMLValidationUIMessages;
-
-
-
-public class TaskListTableViewer extends TableViewer
-{	
-  protected static final int COLUMN_ICON = 0;
-  protected static final int COLUMN_DESCRIPTION = 1;
-  protected static final int COLUMN_RESOURCE = 3;
-  protected static final int COLUMN_LOCATION = 2;
-
-  protected static final String LABEL_ICON = ""; //$NON-NLS-1$
-  protected static final String LABEL_DESCRIPTION = XMLValidationUIMessages.TaskListTableViewer_0;
-  protected static final String LABEL_RESOURCE = XMLValidationUIMessages.TaskListTableViewer_1;
-  protected static final String LABEL_LOCATION = XMLValidationUIMessages.TaskListTableViewer_2;
-
-  protected int visibleRows = -1;
-
-  protected int getColumnWidth(int column)
-  {
-    int result = 0;
-    switch (column)
-    {
-      case COLUMN_ICON :
-        {
-          result = 1;
-          break;
-        }
-      case COLUMN_DESCRIPTION :
-        {
-          result = 20;
-          break;
-        }
-      case COLUMN_RESOURCE :
-        {
-          result = 3;
-          break;
-        }
-      case COLUMN_LOCATION :
-        {
-          result = 3;
-          break;
-        }
-    }
-    return result;
-  }
-
-  public TaskListTableViewer(Composite parent, int visibleRows)
-  {
-    this(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER, visibleRows);
-  }
-
-  public TaskListTableViewer(Composite parent, int style, int visibleRows)
-  {
-    super(new Table(parent, style));
-    getTable().setLinesVisible(true);
-
-    Provider provider = new Provider();
-    setContentProvider(provider);
-    setLabelProvider(provider);
-
-    String[] columnPropertiesArray = { LABEL_ICON, LABEL_DESCRIPTION, LABEL_LOCATION };
-    setColumnProperties(columnPropertiesArray);
-
-    Table table = getTable();
-    table.setHeaderVisible(true);
-    table.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-    TableLayout layout = new TableLayout();
-
-    for (int i = 0; i < columnPropertiesArray.length; i++)
-    {
-      TableColumn column = new TableColumn(table, i);
-      column.setText(columnPropertiesArray[i]);
-      column.setAlignment(SWT.LEFT);
-      layout.addColumnData(new ColumnWeightData(getColumnWidth(i), true));
-    }
-
-    table.setLayout(layout);
-   
-    this.visibleRows = visibleRows;
-  }
-
-  /**
-  	* NamespaceInfoTableLabelProvider
-  	*/
-  protected class Provider extends LabelProvider implements ITableLabelProvider, IStructuredContentProvider
-  {
-    Viewer viewer;
-    Image errorImage; 
-    Image warnImage;
-    
-    public Provider()
-    {
-      errorImage = XMLUIPlugin.getInstance().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
-       
-      warnImage = XMLUIPlugin.getInstance().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
-    }
-
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-    {
-      this.viewer = viewer;
-    }
-
-    public Object[] getElements(Object inputElement)
-    {
-      List list = (List) viewer.getInput();
-      return list != null ? list.toArray() : null;
-    }
-
-    public Image getColumnImage(Object object, int columnIndex)
-    {
-	  ValidationMessage validationMessage = (ValidationMessage) object;    	
-      Image result = null; 
-      if (columnIndex == 0)
-      {
-      	int severity = validationMessage.getSeverity();
-      	if (severity == IMessage.HIGH_SEVERITY || 
-      	    severity == IMessage.NORMAL_SEVERITY)      	    
-      	{
-			result = errorImage;
-      	} 
-      	else
-      	{
-      	  result = warnImage;
-      	}
-      }
-      return result;
-    }
-
-    public String getColumnText(Object object, int column)
-    {
-      ValidationMessage errorMessage = (ValidationMessage) object;
-      String result = ""; //$NON-NLS-1$
-      switch (column)
-      {
-        case COLUMN_DESCRIPTION :
-          {
-            result = errorMessage.getMessage();
-            break;
-          }
-        case COLUMN_LOCATION :
-          {
-            result = XMLValidationUIMessages.TaskListTableViewer_3 + errorMessage.getLineNumber();
-            break;
-          }
-      }
-      return result;
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/xmlvalidation.properties b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/xmlvalidation.properties
deleted file mode 100644
index 3cdd57d..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/xmlvalidation.properties
+++ /dev/null
@@ -1,49 +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
-###############################################################################
-### Constants for strings  
-providerName=Eclipse.org
-pluginName=XML Validator
-nlFeatureName=XML Validator NL Support
-    
-_UI_VALIDATION_INTERNAL_ERROR                    = Internal Error 
-_UI_VALIDATION_FAILED                            = Validation Failed
-_UI_VALIDATION_SUCEEDED                          = Validation Succeeded
-_UI_THE_XML_FILE_IS_NOT_VALID                    = The XML file is not valid.  See the Problems view for a list of the validation errors.
-_UI_THE_XML_FILE_IS_VALID                        = The XML file is valid. 
-_UI_THE_XML_FILE_IS_VALID_WITH_WARNINGS          = The XML file is valid however warnings have been issued. See the Problems view for the warning messages. 
-_UI_THE_XML_FILE_IS_WELL_FORMED                  = The XML file is well formed. 
-_UI_THE_XML_FILE_IS_WELL_FORMED_WITH_WARNINGS    = The XML file is well formed however warnings have been issued. See the Problems view for the warning messages. 
-_UI_NO_GRAMMAR_WARNING                           = Warning : No grammar constraints detected for the document.
-_UI_MESSAGE_LIMITE_EXCEEDED                      = The XML file is not valid.  The message limit for the Problems view has been exceeded.  To see all the messages increase the limit and validate again.
-
-#
-# Referenced File Dialog Related Message
-#
-_UI_REF_FILE_ERROR_DESCRIPTION      = The errors below were detected when validating the file "{0}" via the file "{1}".  In most cases these errors can be detected by validating "{2}" directly.  However it is possible that errors will only occur when {2} is validated in the context of {3}.
-_UI_REF_FILE_ERROR_MESSAGE          = Referenced file contains errors ({0}).  For more information, right click on the message and select "Show Details..."
-_UI_REF_FILE_ERROR_DETAILS          = Referenced File Error Details
-
-_UI_DETAILS_INFORMATION_UNAVAILABLE       = Details Information Unavailable
-_UI_DETAILS_INFO_REVALIDATE_TO_REGENERATE = Details information currently unavailable.  Please revalidate the file to regenerate the error details.
-
-#
-# Dirty File Dialog Related Messages
-#
-_UI_SAVE_DIRTY_FILE_MESSAGE         = An open editor contains changes to this file that have not been saved. Do you want to save the file before running validation? (If you do not save the file the previously saved version will be validated.)
-_UI_SAVE_DIRTY_FILE_TITLE           = Save file?
-ValidateXMLFileActionDelegate_2=Required files xercesImpl.jar and xmlParserAPIs.jar cannot be found.\n\n
-ValidateXMLFileActionDelegate_3=Download Xerces 2.6.2 and place xercesImpl.jar and xmlParserAPIs.jar in a folder entitled jars in the org.eclipse.wst.xml.validation plugin.\n\n
-ValidateXMLFileActionDelegate_4=For more information see www.eclipse.org/webtools/wst/components/xml/xercesInfo.xml.
-ValidateXMLFileActionDelegate_5=Missing Xerces
-TaskListTableViewer_0=Description
-TaskListTableViewer_1=Resource
-TaskListTableViewer_2=Location
-TaskListTableViewer_3=line 
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationOperation.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationOperation.java
deleted file mode 100644
index af75245..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationOperation.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - Initial API and implementation
-*   Jens Lukowski/Innoopract - initial renaming/restructuring
-* 
-*/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-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.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-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.SubProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.ui.dialogs.IOverwriteQuery;
-import org.eclipse.ui.wizards.datatransfer.ImportOperation;
-import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.osgi.framework.Bundle;
-
-public class ExampleProjectCreationOperation implements IRunnableWithProgress {
-
-	private IResource elementToOpen;
-
-	private IOverwriteQuery overwriteQuery;
-
-	private ExampleProjectCreationWizardPage[] pages;
-
-	/**
-	 * Constructor for ExampleProjectCreationOperation
-	 */
-	public ExampleProjectCreationOperation(ExampleProjectCreationWizardPage[] myPages, IOverwriteQuery myOverwriteQuery) {
-		elementToOpen = null;
-		pages = myPages;
-		overwriteQuery = myOverwriteQuery;
-	}
-
-	private IProject configNewProject(IWorkspaceRoot root, String name, String[] natureIds, IProject[] referencedProjects, IProgressMonitor monitor) throws InvocationTargetException {
-		try {
-			IProject project = root.getProject(name);
-			if (!project.exists()) {
-				project.create(null);
-			}
-			if (!project.isOpen()) {
-				project.open(null);
-			}
-			IProjectDescription desc = project.getDescription();
-			desc.setLocation(null);
-			desc.setNatureIds(natureIds);
-			desc.setReferencedProjects(referencedProjects);
-
-			project.setDescription(desc, new SubProgressMonitor(monitor, 1));
-
-			return project;
-		}
-		catch (CoreException e) {
-			throw new InvocationTargetException(e);
-		}
-	}
-
-	private void createProject(IWorkspaceRoot root, ExampleProjectCreationWizardPage page, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
-		IConfigurationElement desc = page.getConfigurationElement();
-
-		IConfigurationElement[] imports = desc.getChildren("import"); //$NON-NLS-1$
-		IConfigurationElement[] natures = desc.getChildren("nature"); //$NON-NLS-1$
-		IConfigurationElement[] references = desc.getChildren("references"); //$NON-NLS-1$
-		int nImports = (imports == null) ? 0 : imports.length;
-		int nNatures = (natures == null) ? 0 : natures.length;
-		int nReferences = (references == null) ? 0 : references.length;
-
-		monitor.beginTask(XMLWizardsMessages.ExampleProjectCreationOperation_op_desc_proj, nImports + 1);
-
-		String name = page.getProjectName();
-
-		String[] natureIds = new String[nNatures];
-		for (int i = 0; i < nNatures; i++) {
-			natureIds[i] = natures[i].getAttribute("id"); //$NON-NLS-1$
-		}
-		IProject[] referencedProjects = new IProject[nReferences];
-		for (int i = 0; i < nReferences; i++) {
-			referencedProjects[i] = root.getProject(references[i].getAttribute("id")); //$NON-NLS-1$
-		}
-
-		IProject proj = configNewProject(root, name, natureIds, referencedProjects, monitor);
-
-		for (int i = 0; i < nImports; i++) {
-			doImports(proj, imports[i], new SubProgressMonitor(monitor, 1));
-		}
-
-		String open = desc.getAttribute("open"); //$NON-NLS-1$
-		if (open != null && open.length() > 0) {
-			IResource fileToOpen = proj.findMember(new Path(open));
-			if (fileToOpen != null) {
-				elementToOpen = fileToOpen;
-			}
-		}
-
-	}
-
-	private void doImports(IProject project, IConfigurationElement curr, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
-		try {
-			IPath destPath;
-			String name = curr.getAttribute("dest"); //$NON-NLS-1$
-			if (name == null || name.length() == 0) {
-				destPath = project.getFullPath();
-			}
-			else {
-				IFolder folder = project.getFolder(name);
-				if (!folder.exists()) {
-					folder.create(true, true, null);
-				}
-				destPath = folder.getFullPath();
-			}
-			String importPath = curr.getAttribute("src"); //$NON-NLS-1$
-			if (importPath == null) {
-				importPath = ""; //$NON-NLS-1$
-				Logger.log(Logger.ERROR, "projectsetup descriptor: import missing"); //$NON-NLS-1$
-				return;
-			}
-
-			ZipFile zipFile = getZipFileFromPluginDir(importPath, getContributingPlugin(curr));
-			importFilesFromZip(zipFile, destPath, new SubProgressMonitor(monitor, 1));
-		}
-		catch (CoreException e) {
-			throw new InvocationTargetException(e);
-		}
-	}
-
-	private String getContributingPlugin(IConfigurationElement configurationElement) {
-		Object parent = configurationElement;
-		while (parent != null) {
-			if (parent instanceof IExtension)
-				return ((IExtension) parent).getNamespace();
-			parent = ((IConfigurationElement) parent).getParent();
-		}
-		return null;
-	}
-
-	public IResource getElementToOpen() {
-		return elementToOpen;
-	}
-
-	private ZipFile getZipFileFromPluginDir(String pluginRelativePath, String symbolicName) throws CoreException {
-		try {
-			Bundle bundle = Platform.getBundle(symbolicName);
-			URL starterURL = new URL(bundle.getEntry("/"), pluginRelativePath); //$NON-NLS-1$
-			return new ZipFile(Platform.asLocalURL(starterURL).getFile());
-		}
-		catch (IOException e) {
-			String message = pluginRelativePath + ": " + e.getMessage(); //$NON-NLS-1$
-			Status status = new Status(IStatus.ERROR, XMLUIPlugin.ID, IStatus.ERROR, message, e);
-			throw new CoreException(status);
-		}
-	}
-
-	private void importFilesFromZip(ZipFile srcZipFile, IPath destPath, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
-		ZipFileStructureProvider structureProvider = new ZipFileStructureProvider(srcZipFile);
-		ImportOperation op = new ImportOperation(destPath, structureProvider.getRoot(), structureProvider, overwriteQuery);
-		op.run(monitor);
-	}
-
-	/*
-	 * @see IRunnableWithProgress#run(IProgressMonitor)
-	 */
-	public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
-		if (monitor == null) {
-			monitor = new NullProgressMonitor();
-		}
-		try {
-			monitor.beginTask(XMLWizardsMessages.ExampleProjectCreationOperation_op_desc, pages.length);
-			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-
-			for (int i = 0; i < pages.length; i++) {
-				createProject(root, pages[i], new SubProgressMonitor(monitor, 1));
-			}
-		}
-		finally {
-			monitor.done();
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizard.java
deleted file mode 100644
index fcd0fd3..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizard.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (c) 2002 IBM Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
-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.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
-import org.eclipse.ui.dialogs.IOverwriteQuery;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
-import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-public class ExampleProjectCreationWizard extends Wizard implements INewWizard, IExecutableExtension {
-
-	private class ImportOverwriteQuery implements IOverwriteQuery {
-
-		private int openDialog(final String file) {
-			final int[] result = {IDialogConstants.CANCEL_ID};
-			getShell().getDisplay().syncExec(new Runnable() {
-				public void run() {
-					String title = XMLWizardsMessages.ExampleProjectCreationWizard_overwritequery_title;
-					String msg = NLS.bind(XMLWizardsMessages.ExampleProjectCreationWizard_overwritequery_message, file);
-					String[] options = {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.CANCEL_LABEL};
-					MessageDialog dialog = new MessageDialog(getShell(), title, null, msg, MessageDialog.QUESTION, options, 0);
-					result[0] = dialog.open();
-				}
-			});
-			return result[0];
-		}
-
-		public String queryOverwrite(String file) {
-			String[] returnCodes = {YES, NO, ALL, CANCEL};
-			int returnVal = openDialog(file);
-			return returnVal < 0 ? CANCEL : returnCodes[returnVal];
-		}
-	}
-
-	private IConfigurationElement wizardConfigElement;
-	private IConfigurationElement exampleConfigElement;
-
-	private String EXAMPLE_WIZARD_XP_ID = "org.eclipse.wst.common.ui.exampleProjectCreationWizard"; //$NON-NLS-1$
-
-	private ExampleProjectCreationWizardPage[] pages;
-
-	private final String WEB_BROWSER_ID = "org.eclipse.ui.browser.editor"; //$NON-NLS-1$
-
-	public ExampleProjectCreationWizard() {
-		super();
-		setDialogSettings(XMLUIPlugin.getDefault().getDialogSettings());
-		setWindowTitle(XMLWizardsMessages.ExampleProjectCreationWizard_title);
-		setNeedsProgressMonitor(true);
-	}
-
-	/*
-	 * @see Wizard#addPages
-	 */
-	public void addPages() {
-		super.addPages();
-
-		if (exampleConfigElement == null)
-			return;
-		IConfigurationElement[] children = exampleConfigElement.getChildren("projectsetup"); //$NON-NLS-1$
-		if (children == null || children.length == 0) {
-			Logger.log(Logger.ERROR, "descriptor must contain one ore more projectsetup tags"); //$NON-NLS-1$
-			return;
-		}
-
-		pages = new ExampleProjectCreationWizardPage[children.length];
-
-		for (int i = 0; i < children.length; i++) {
-			pages[i] = new ExampleProjectCreationWizardPage(i, children[i]);
-			addPage(pages[i]);
-		}
-	}
-	
-    public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
-		if (exampleConfigElement != null) {
-			String banner = exampleConfigElement.getAttribute("banner"); //$NON-NLS-1$
-			if (banner != null) {
-				URL imageURL = Platform.find(Platform.getBundle(exampleConfigElement.getDeclaringExtension().getNamespace()), new Path(banner));
-				ImageDescriptor desc = ImageDescriptor.createFromURL(imageURL);
-				setDefaultPageImageDescriptor(desc);
-			}
-		}
-    }
-
-	protected IConfigurationElement[] getExtendedConfigurationElements() {
-		IExtensionRegistry registry = Platform.getExtensionRegistry();
-		IExtensionPoint exampleWizardXP = registry.getExtensionPoint(EXAMPLE_WIZARD_XP_ID);
-		if (exampleWizardXP == null) {
-			return new IConfigurationElement[0];
-		}
-		IExtension extension = exampleWizardXP.getExtension(getWizardExtensionId());
-		if (extension != null) {
-			return extension.getConfigurationElements();
-		}
-		IConfigurationElement[] exampleWizardCEs = exampleWizardXP.getConfigurationElements();
-		return exampleWizardCEs;
-	}
-
-	private void handleException(Throwable target) {
-		String title = XMLWizardsMessages.ExampleProjectCreationWizard_op_error_title;
-		String message = XMLWizardsMessages.ExampleProjectCreationWizard_op_error_message;
-		if (target instanceof CoreException) {
-			IStatus status = ((CoreException) target).getStatus();
-			ErrorDialog.openError(getShell(), title, message, status);
-			Logger.logException(status.getMessage(), status.getException());
-		}
-		else {
-			MessageDialog.openError(getShell(), title, target.getMessage());
-			Logger.logException(target);
-		}
-	}
-	
-	private void openResource(final IResource resource) {
-		if (resource.getType() != IResource.FILE) {
-			return;
-		}
-		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-		if (window == null) {
-			return;
-		}
-		final IWorkbenchPage activePage = window.getActivePage();
-		if (activePage != null) {
-			final Display display = getShell().getDisplay();
-			display.asyncExec(new Runnable() {
-				public void run() {
-					try {
-						IDE.openEditor(activePage, (IFile) resource, WEB_BROWSER_ID, true);
-					}
-					catch (PartInitException e) {
-						Logger.logException(e);
-					}
-				}
-			});
-			BasicNewResourceWizard.selectAndReveal(resource, activePage.getWorkbenchWindow());
-		}
-	}
-
-	/*
-	 * @see Wizard#performFinish
-	 */
-	public boolean performFinish() {
-		ExampleProjectCreationOperation runnable = new ExampleProjectCreationOperation(pages, new ImportOverwriteQuery());
-
-		IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(runnable);
-		try {
-			getContainer().run(false, true, op);
-		}
-		catch (InvocationTargetException e) {
-			handleException(e.getTargetException());
-			return false;
-		}
-		catch (InterruptedException e) {
-			return false;
-		}
-		BasicNewProjectResourceWizard.updatePerspective(wizardConfigElement);
-		IResource res = runnable.getElementToOpen();
-		if (res != null) {
-			openResource(res);
-		}
-		return true;
-	}
-
-	/**
-	 * Stores the configuration element for the wizard. The config element
-	 * will be used in <code>performFinish</code> to set the result
-	 * perspective.
-	 */
-	public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) {
-		wizardConfigElement = cfig;
-		String title = wizardConfigElement.getAttribute("name"); //$NON-NLS-1$
-		if (title != null) {
-			setWindowTitle(title);
-		}
-		String wizardId = getWizardExtensionId(); //$NON-NLS-1$
-		IConfigurationElement[] exampleWizardCEs = getExtendedConfigurationElements();
-		for (int i = 0; i < exampleWizardCEs.length; i++) {
-			IConfigurationElement element = exampleWizardCEs[i];
-			String extWizardId = element.getAttribute("id"); //$NON-NLS-1$
-			if (wizardId != null && extWizardId != null && wizardId.equals(extWizardId)) {
-				exampleConfigElement = element;
-			}
-		}
-		// initializeDefaultPageImageDescriptor();
-	}
-
-	public String getWizardExtensionId() {
-		return wizardConfigElement.getAttribute("id"); //$NON-NLS-1$
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizardPage.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizardPage.java
deleted file mode 100644
index ce562a6..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizardPage.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
-* Copyright (c) 2002 IBM Corporation and others.
-* All rights reserved.   This program and the accompanying materials
-* are made available under the terms of the Common Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/cpl-v10.html
-* 
-* Contributors:
-*   IBM - Initial API and implementation
-*   Jens Lukowski/Innoopract - initial renaming/restructuring
-* 
-*/
-
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
-
-public class ExampleProjectCreationWizardPage extends WizardNewProjectCreationPage {
-
-	private IConfigurationElement configurationElement;
-
-	public ExampleProjectCreationWizardPage(int pageNumber, IConfigurationElement elem) {
-
-		super("page" + pageNumber); //$NON-NLS-1$
-		configurationElement = elem;
-
-		String name = getAttribute(elem, "name"); //$NON-NLS-1$
-		setInitialProjectName(calculateInitialProjectName(name));
-
-		setDescription(getAttribute(configurationElement, "pagedescription")); //$NON-NLS-1$
-		setTitle(getAttribute(configurationElement, "pagetitle")); //$NON-NLS-1$
-
-	}
-
-	/*
-	 * Set the default project name that is to appear on the initialPage page
-	 * of this wizard.
-	 */
-	protected String calculateInitialProjectName(String projectName) {
-		IProject projectHandle = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
-		if (!projectHandle.exists()) {
-			return projectName;
-		}
-		// Change the name until it doesn't exists. Try 9 times and then
-		// give up.
-		for (int i = 1; i < 10; i++) {
-			projectHandle = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName + i);
-			if (!projectHandle.exists()) {
-				return projectName + i;
-			}
-		}
-		return projectName + "9"; //$NON-NLS-1$
-
-	}
-
-	private String getAttribute(IConfigurationElement elem, String tag) {
-		String res = elem.getAttribute(tag);
-		if (res == null) {
-			return '!' + tag + '!';
-		}
-		return res;
-	}
-
-
-
-	/**
-	 * Returns the configuration element of this page.
-	 * 
-	 * @return Returns a IConfigurationElement
-	 */
-	public IConfigurationElement getConfigurationElement() {
-		return configurationElement;
-	}
-
-	/**
-	 * @see org.eclipse.ui.dialogs.WizardNewProjectCreationPage#validatePage()
-	 */
-	protected boolean validatePage() {
-		if (!super.validatePage())
-			return false;
-
-		String projectName = getProjectName();
-		if (projectName == null)
-			return false;
-
-		IWizard wizard = getWizard();
-		if (wizard instanceof ExampleProjectCreationWizard) {
-			IWizardPage[] pages = wizard.getPages();
-			for (int i = 0; i < pages.length; i++) {
-				if ((pages[i] != this) && (pages[i] instanceof ExampleProjectCreationWizardPage)) {
-					if (projectName.equals(((ExampleProjectCreationWizardPage) pages[i]).getProjectName())) {
-						setErrorMessage(XMLWizardsMessages.ExampleProjectCreationWizardPage_error_alreadyexists);
-						return false;
-					}
-				}
-			}
-		}
-
-		return true;
-	}
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/IXMLWizardHelpContextIds.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/IXMLWizardHelpContextIds.java
deleted file mode 100644
index e342efa..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/IXMLWizardHelpContextIds.java
+++ /dev/null
@@ -1,48 +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.ui.internal.wizards;
-
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-/**
- * Help context ids for the xml wizard.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- */
-interface IXMLWizardHelpContextIds {
-	// org.eclipse.wst.xml.ui.
-	public static final String PREFIX = XMLUIPlugin.ID + "."; //$NON-NLS-1$
-	// Create XML file from a DTD file radio
-	public static final String XML_NEWWIZARD_CREATEXML1_HELPID = PREFIX + "xmlc0101"; //$NON-NLS-1$
-	// Create XML file from an XML schema file radio button
-	public static final String XML_NEWWIZARD_CREATEXML2_HELPID = PREFIX + "xmlc0102"; //$NON-NLS-1$
-	// Create XML file from scratch radio button
-	public static final String XML_NEWWIZARD_CREATEXML3_HELPID = PREFIX + "xmlc0103"; //$NON-NLS-1$
-	// Select Source file page
-	public static final String XML_NEWWIZARD_SELECTSOURCE_HELPID = PREFIX + "xmlc0500"; //$NON-NLS-1$
-	// Root element for both DTD and XML schema
-	public static final String XML_NEWWIZARD_SELECTROOTELEMENT_HELPID = PREFIX + "xmlc0410"; //$NON-NLS-1$
-	// Create Optional Attributes
-	public static final String XML_NEWWIZARD_SELECTROOTELEMENT1_HELPID = PREFIX + "xmlc0441"; //$NON-NLS-1$
-	// Create Optional Elements
-	public static final String XML_NEWWIZARD_SELECTROOTELEMENT2_HELPID = PREFIX + "xmlc0442"; //$NON-NLS-1$
-	// Create first choice of required choice
-	public static final String XML_NEWWIZARD_SELECTROOTELEMENT3_HELPID = PREFIX + "xmlc0443"; //$NON-NLS-1$
-	// Fill elements and attribute with data
-	public static final String XML_NEWWIZARD_SELECTROOTELEMENT4_HELPID = PREFIX + "xmlc0444"; //$NON-NLS-1$
-	// System ID for DTD
-	public static final String XML_NEWWIZARD_SELECTROOTELEMENT5_HELPID = PREFIX + "xmlc0210"; //$NON-NLS-1$
-	// Public ID for DTD
-	public static final String XML_NEWWIZARD_SELECTROOTELEMENT6_HELPID = PREFIX + "xmlc0220"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NamespaceInfoContentBuilder.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NamespaceInfoContentBuilder.java
deleted file mode 100644
index 5817c01..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NamespaceInfoContentBuilder.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import java.util.Hashtable;
-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.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.ContentBuilder;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-
-public class NamespaceInfoContentBuilder extends ContentBuilder
-  {      
-    protected int count = 1;   
-    public List list = new Vector();
-    protected Hashtable table = new Hashtable();   
-
-    public NamespaceInfoContentBuilder()
-    {
-      super();
-    }
-   
-    public void visitCMElementDeclaration(CMElementDeclaration ed)
-    {                      
-      if (ed.getProperty("http://org.eclipse.wst/cm/properties/definitionInfo") != null) //$NON-NLS-1$
-      {
-        super.visitCMElementDeclaration(ed);
-      }
-    }
-
-    protected void createAnyElementNode(CMAnyElement anyElement)
-    {
-      String uri = anyElement.getNamespaceURI();
-      if (uri != null && !uri.startsWith("##")) //$NON-NLS-1$
-      {
-        if (table.get(uri) == null)
-        {
-          NamespaceInfo info = new NamespaceInfo();
-          info.uri = uri;     
-          info.prefix = "p" + count++; //$NON-NLS-1$
-          table.put(uri, info); 
-          list.add(info);
-        }
-      }
-    }
-  }                         
-
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java
deleted file mode 100644
index f0ae26b..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java
+++ /dev/null
@@ -1,327 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-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.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-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.Event;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-
-public class NewModelWizard extends Wizard implements INewWizard
-{
-  
-  protected IStructuredSelection fSelection;
-  protected IWorkbench fWorkbench;
-  protected String fCurrentDirectory;
-
-  public NewModelWizard()
-  {
-	  super();
-  }
-
-  public void init(IWorkbench workbench, IStructuredSelection selection)
-  {
-    this.fWorkbench = workbench;
-    this.fSelection = selection;
-  }
-
-  public boolean performFinish()
-  {
-    boolean result = true;
-    WizardPage currentPage = (WizardPage)getContainer().getCurrentPage();
-    if (currentPage != null)
-    {
-      result = currentPage.isPageComplete();
-    }
-    return result;
-  }
-
-  /**
-   * showFileDialog
-   */
-  public FileDialog showFileDialog(Shell shell, String defaultDirectory, String defaultFile, String [] filterExtensions)
-  {
-    FileDialog fileDialog = new FileDialog(shell, SWT.OPEN);
-
-    // Get the last visit directory if we haven't defined a particular one here.
-    if (defaultDirectory == null || defaultDirectory.length() == 0)
-    {
-      //defaultDirectory = Locate.instance(this).getLastSelectedDirectory(getResourcePath());
-    }
-
-    if (defaultDirectory != null && defaultDirectory.length() != 0)
-    {
-      fileDialog.setFilterPath(defaultDirectory);
-    }
-
-    fileDialog.setFileName(defaultFile);
-    fileDialog.setFilterExtensions(filterExtensions);
-
-    fileDialog.open();
-
-    return fileDialog;
-  }
-
-
-  public void setCurrentDirectory(String currentDirectory1)
-  {
-    this.fCurrentDirectory = currentDirectory1;
-  }
-
-
-  public void createWorkbenchResource(IContainer container, String fileName)
-  {
-    IPath path = container.getFullPath();
-    path = path.append(fileName);
-    IFile file = container.getWorkspace().getRoot().getFile(path);
-    if (!file.exists())
-    {
-      try
-      {
-        file.create(null, true, null);
-      }
-      catch (CoreException e)
-      {
-        //XMLBuilderPlugin.getPlugin().getMsgLogger().write("Encountered exception creating file: " + e.getMessage());
-      }
-    }
-  }
-
-  /**
-   * StartPage
-   */
-  public class StartPage extends WizardPage implements Listener
-  {
-    protected int selectedButton;
-    protected String[] radioButtonLabel;
-    protected Button[] radioButton;
-
-    public StartPage(String pageName, String[] radioButtonLabel)
-    {
-      super(pageName);
-      this.radioButtonLabel = radioButtonLabel;
-      radioButton = new Button[radioButtonLabel.length];
-    }
-
-    public Button getRadioButtonAtIndex(int i)
-    {
-      Button result = null;
-      if (i >= 0 && i < radioButton.length)
-      {
-        result = radioButton[i];
-      }
-      return result;
-    }
-
-    public int getSelectedRadioButtonIndex()
-    {
-      int result = -1;
-      for (int i = 0; i < radioButton.length; i++)
-      {
-        if (radioButton[i].getSelection())
-        {
-          result = i;
-        }
-      }
-      return result;
-    }
-
-    public void createControl(Composite parent)
-    {
-      Composite base = new Composite(parent, SWT.NONE);
-      base.setLayout(new GridLayout());
-
-      //radio buttons' container	
-      Composite radioButtonsGroup = new Composite(base, SWT.NONE);
-      GridLayout layout = new GridLayout();
-      layout.numColumns = 1;
-      layout.makeColumnsEqualWidth = true;
-      layout.marginWidth = 0;                
-
-      radioButtonsGroup.setLayout(layout);
-      GridData gd = new GridData(GridData.FILL_BOTH);
-      gd.heightHint = 300;
-      gd.widthHint = 400;
-      radioButtonsGroup.setLayoutData(gd);
-
-      for (int i = 0; i < radioButtonLabel.length; i++)
-      {
-        radioButton[i] = new Button(radioButtonsGroup, SWT.RADIO);
-        radioButton[i].setText(radioButtonLabel[i]);
-        radioButton[i].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        //radioButton[i].addListener(SWT.Modify, this);
-      }
-      setControl(base);
-      setPageComplete(isPageComplete());
-    }
-
-    public void handleEvent(Event event)
-    {
-      if (event.type == SWT.Modify)
-      {
-        setPageComplete(isPageComplete());
-      }
-    }
-  }
-
-
-  /**
-   *  NewFilePage
-   */
-  public class NewFilePage extends WizardNewFileCreationPage
-  {
-    public String defaultName = "NewFile"; //$NON-NLS-1$
-    public String defaultFileExtension = ".txt"; //$NON-NLS-1$
-    public String[] filterExtensions = { "*.txt"}; //$NON-NLS-1$
-	private List fValidExtensions = null;
-
-    public NewFilePage(IStructuredSelection selection)
-    {
-      super("", selection); //$NON-NLS-1$
-    }
-
-    protected String computeDefaultFileName()
-    {
-      int count = 0;
-      String fileName = defaultName + defaultFileExtension;
-      IPath containerFullPath = getContainerFullPath();
-      if (containerFullPath != null)
-      {
-        while (true)
-        {
-          IPath path = containerFullPath.append(fileName);
-          if (ResourcesPlugin.getWorkspace().getRoot().exists(path))
-          {
-            count++;
-            fileName = defaultName + count + defaultFileExtension;
-          }
-          else
-          {
-            break;
-          }
-        }
-      }
-      return fileName;
-    }
-
-    // returns true if file of specified name exists in any case for selected container
-    protected String existsFileAnyCase(String fileName)
-    {
-      if ( (getContainerFullPath() != null) && (getContainerFullPath().isEmpty() == false)
-            && (fileName.compareTo("") != 0)) //$NON-NLS-1$
-      {
-        //look through all resources at the specified container - compare in upper case
-        IResource parent = ResourcesPlugin.getWorkspace().getRoot().findMember(getContainerFullPath());
-        if (parent instanceof IContainer)
-        {
-          IContainer container = (IContainer) parent;
-          try
-          {
-            IResource[] members = container.members();
-            String enteredFileUpper = fileName.toUpperCase();
-            for (int i=0; i<members.length; i++)
-            {
-              String resourceUpperName = members[i].getName().toUpperCase();
-              if (resourceUpperName.equals(enteredFileUpper))
-              {  
-                return members[i].getName();    
-              }
-            }
-          }
-          catch (CoreException e)
-          {
-          }
-        }
-      }
-      return null;
-    }
-
-
-    protected boolean validatePage() {
-		String fullFileName = getFileName();
-		String fileExtension = (new Path(fullFileName)).getFileExtension();
-		if (fileExtension != null && (!getValidExtensions().contains(fileExtension))) {
-			setErrorMessage(XMLWizardsMessages._ERROR_BAD_FILENAME_EXTENSION);
-			return false;
-		}
-		// no fileExtension, let's check for this file with an .xml
-		// extension
-		fullFileName += ".xml"; //$NON-NLS-1$
-		if ((getContainerFullPath() != null) && (getContainerFullPath().isEmpty() == false) && (getFileName().compareTo("") != 0)) //$NON-NLS-1$
-		{
-			Path fullPath = new Path(getContainerFullPath().toString() + '/' + fullFileName);
-			IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(fullPath);
-			if (resource != null) {
-				setErrorMessage(XMLWizardsMessages._ERROR_FILE_ALREADY_EXISTS);
-				return false;
-			}
-		}
-
-		// check for file should be case insensitive
-		String sameName = existsFileAnyCase(fullFileName);
-		if (sameName != null) {
-			//ISSUE: is qualitifedFileName not needed, or is it supposed to be used in error message?
-			//String qualifiedFileName = getContainerFullPath().toString() + '/' + fullFileName;
-			setErrorMessage(XMLWizardsMessages._ERROR_FILE_ALREADY_EXISTS + " " + sameName); //$NON-NLS-1$
-			return false;
-		}
-
-		return super.validatePage();
-	}
-
-    public void createControl(Composite parent)
-    {
-      // inherit default container and name specification widgets
-      super.createControl(parent);
-      this.setFileName(computeDefaultFileName());
-      setPageComplete(validatePage());
-    }
-	
-	/**
-	 * Get list of valid extensions for XML Content type
-	 * 
-	 * @return List
-	 */
-	List getValidExtensions() {
-		if (fValidExtensions == null) {
-			IContentType type = Platform.getContentTypeManager().getContentType(ContentTypeIdForXML.ContentTypeID_XML);
-			fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
-		}
-		return fValidExtensions;
-	}
-  }
-}
-
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLGenerator.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLGenerator.java
deleted file mode 100644
index 02e16c1..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLGenerator.java
+++ /dev/null
@@ -1,382 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.util.Assert;
-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.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-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.ContentModelManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.ContentBuilder;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilderImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMWriter;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class NewXMLGenerator {
-
-	protected String grammarURI;
-	protected CMDocument cmDocument;
-	protected int buildPolicy;
-	protected String rootElementName;
-
-	protected ICatalogEntry xmlCatalogEntry;
-
-	// info for dtd
-	protected String publicId;
-	protected String systemId;
-	protected String defaultSystemId;
-
-	// info for xsd
-	public List namespaceInfoList;
-
-	public NewXMLGenerator() {
-		super();
-	}
-
-	public NewXMLGenerator(String grammarURI, CMDocument cmDocument) {
-		this.grammarURI = grammarURI;
-		this.cmDocument = cmDocument;
-	}
-
-
-	public static CMDocument createCMDocument(String uri, String[] errorInfo) {
-		String title = null;
-		String message = null;
-		List errorList = new Vector();
-		CMDocument cmDocument = null;
-
-		if (URIHelper.isReadableURI(uri, true)) {
-			uri = URIHelper.normalize(uri, null, null);
-			cmDocument = ContentModelManager.getInstance().createCMDocument(uri, null);
-
-			if (uri.endsWith(".dtd")) { //$NON-NLS-1$
-				if (errorList.size() > 0) {
-					title = XMLWizardsMessages._UI_INVALID_GRAMMAR_ERROR;
-					message = XMLWizardsMessages._UI_LABEL_ERROR_DTD_INVALID_INFO;
-				}
-			}
-			else // ".xsd"
-			{
-				// To be consistent with the schema editor validation
-				XMLSchemaValidationChecker validator = new XMLSchemaValidationChecker();
-				if (!validator.isValid(uri)) {
-					title = XMLWizardsMessages._UI_INVALID_GRAMMAR_ERROR;
-					message = XMLWizardsMessages._UI_LABEL_ERROR_SCHEMA_INVALID_INFO;
-				}
-				else if (cmDocument != null) {
-					int globalElementCount = cmDocument.getElements().getLength();
-					if (globalElementCount == 0) {
-						title = XMLWizardsMessages._UI_WARNING_TITLE_NO_ROOT_ELEMENTS;
-						message = XMLWizardsMessages._UI_WARNING_MSG_NO_ROOT_ELEMENTS;
-					}
-				}
-			}
-		}
-		else {
-			title = XMLWizardsMessages._UI_WARNING_TITLE_NO_ROOT_ELEMENTS;
-			message = XMLWizardsMessages._UI_WARNING_URI_NOT_FOUND_COLON + " " + uri; //$NON-NLS-1$
-		}
-		errorInfo[0] = title;
-		errorInfo[1] = message;
-
-		return cmDocument;
-	}
-
-
-	public void createEmptyXMLDocument(IFile newFile) throws Exception {
-		ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-		String charSet = getUserPreferredCharset();
-
-		PrintWriter writer = new PrintWriter(new OutputStreamWriter(outputStream, charSet));
-		writer.println("<?xml version=\"1.0\" encoding=\"" + charSet + "\"?>"); //$NON-NLS-1$ //$NON-NLS-2$
-		writer.flush();
-		outputStream.close();
-
-		ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
-		newFile.setContents(inputStream, true, true, null);
-		inputStream.close();
-	}
-
-	private String getUserPreferredCharset() {
-		Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
-		String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-		return charSet;
-	}
-
-	public void createXMLDocument(String xmlFileName) throws Exception {
-		IContentType contentType = Platform.getContentTypeManager().findContentTypeFor(xmlFileName);
-		String charset = null;
-		if (contentType != null) {
-			charset = contentType.getDefaultCharset();
-		}
-		ByteArrayOutputStream outputStream = createXMLDocument(xmlFileName, charset);
-
-		File file = new File(xmlFileName);
-		FileOutputStream fos = new FileOutputStream(file);
-		outputStream.writeTo(fos);
-		fos.close();
-	}
-
-
-	public void createXMLDocument(IFile newFile, String xmlFileName) throws Exception {
-		String charset = newFile.getCharset();
-		ByteArrayOutputStream outputStream = createXMLDocument(xmlFileName, charset);
-
-		ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
-		newFile.setContents(inputStream, true, true, null);
-		inputStream.close();
-	}
-
-
-	public ByteArrayOutputStream createXMLDocument(String xmlFileName, String charset) throws Exception {
-		if (charset == null) {
-			charset = getUserPreferredCharset();
-			if (charset == null) {
-				charset = "UTF-8"; //$NON-NLS-1$
-			}
-		}
-		CMDocument cmDocument = getCMDocument();
-
-		Assert.isNotNull(cmDocument);
-		Assert.isNotNull(getRootElementName());
-
-		// create the xml model
-		CMNamedNodeMap nameNodeMap = cmDocument.getElements();
-		CMElementDeclaration cmElementDeclaration = (CMElementDeclaration) nameNodeMap.getNamedItem(getRootElementName());
-
-		Document xmlDocument = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
-		DOMContentBuilderImpl contentBuilder = new DOMContentBuilderImpl(xmlDocument);
-        
-        // this 'uglyTempHack' flag is required in order to supress the creation a default encoding 
-        // we'll handle this later in the domWriter.print() method used below
-        //
-        contentBuilder.supressCreationOfDoctypeAndXMLDeclaration = true;
-		contentBuilder.setBuildPolicy(buildPolicy);
-		contentBuilder.setExternalCMDocumentSupport(new MyExternalCMDocumentSupport(namespaceInfoList, xmlFileName));
-		contentBuilder.createDefaultRootContent(cmDocument, cmElementDeclaration, namespaceInfoList);
-
-		ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-		OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, charset);
-            
-		DOMWriter domWriter = new DOMWriter(outputStreamWriter);
-        
-        // TODO... instead of relying on file extensions, we need to keep track of the grammar type
-        // better yet we should reate an SSE document so that we can format it nicely before saving
-        // then we won't need the DOMWriter at all
-        //
-		domWriter.print(xmlDocument, charset, cmDocument.getNodeName(), getNonWhitespaceString(getPublicId()), getNonWhitespaceString(getSystemId())); 
-		outputStream.flush();
-		outputStream.close();
-
-		return outputStream;
-	}
-
-
-	public void createNamespaceInfoList() {
-		List result = new Vector();
-	    if (cmDocument != null) {
-			result = (List) cmDocument.getProperty("http://org.eclipse.wst/cm/properties/namespaceInfo"); //$NON-NLS-1$
-			if (result != null) {
-				int size = result.size();
-				for (int i = 0; i < size; i++) {
-					NamespaceInfo info = (NamespaceInfo) result.get(i);
-					if (i == 0) {
-						String locationInfo = null;
-						if (xmlCatalogEntry != null) {
-							if (xmlCatalogEntry.getEntryType() == ICatalogEntry.ENTRY_TYPE_PUBLIC) {
-								locationInfo = xmlCatalogEntry.getAttributeValue(ICatalogEntry.ATTR_WEB_URL);
-							}
-							else {
-								locationInfo = xmlCatalogEntry.getKey();
-							}
-						}
-						if (locationInfo == null) {
-							locationInfo = defaultSystemId;
-						}
-						info.locationHint = locationInfo;
-						info.setProperty("locationHint-readOnly", "true"); //$NON-NLS-1$ //$NON-NLS-2$
-					}
-					info.setProperty("uri-readOnly", "true"); //$NON-NLS-1$ //$NON-NLS-2$
-					info.setProperty("unremovable", "true"); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-			}
-
-			NamespaceInfoContentBuilder builder = new NamespaceInfoContentBuilder();
-			builder.setBuildPolicy(ContentBuilder.BUILD_ONLY_REQUIRED_CONTENT);
-			builder.visitCMNode(cmDocument);
-			result.addAll(builder.list);
-		}
-		namespaceInfoList = result;
-	}
-
-
-	public boolean isMissingNamespaceLocation() {
-		boolean result = false;
-		for (Iterator i = namespaceInfoList.iterator(); i.hasNext();) {
-			NamespaceInfo info = (NamespaceInfo) i.next();
-			if (info.locationHint == null) {
-				result = true;
-				break;
-			}
-		}
-		return result;
-	}
-
-
-	public String[] getNamespaceInfoErrors() {
-		String[] errorList = null;
-
-		if (namespaceInfoList != null && isMissingNamespaceLocation()) {
-			String title = XMLWizardsMessages._UI_LABEL_NO_LOCATION_HINT;
-			String message = XMLWizardsMessages._UI_WARNING_MSG_NO_LOCATION_HINT_1 + " " + XMLWizardsMessages._UI_WARNING_MSG_NO_LOCATION_HINT_2 + "\n\n" + XMLWizardsMessages._UI_WARNING_MSG_NO_LOCATION_HINT_3; //$NON-NLS-1$ //$NON-NLS-2$
-
-			errorList = new String[2];
-			errorList[0] = title;
-			errorList[1] = message;
-		}
-
-		return errorList;
-	}
-
-
-	public void setXMLCatalogEntry(ICatalogEntry catalogEntry) {
-		xmlCatalogEntry = catalogEntry;
-	}
-
-	public ICatalogEntry getXMLCatalogEntry() {
-		return xmlCatalogEntry;
-	}
-
-
-	public void setBuildPolicy(int policy) {
-		buildPolicy = policy;
-	}
-
-
-	public void setDefaultSystemId(String sysId) {
-		defaultSystemId = sysId;
-	}
-
-	public String getDefaultSystemId() {
-		return defaultSystemId;
-	}
-
-	public void setSystemId(String sysId) {
-		systemId = sysId;
-	}
-
-	public String getSystemId() {
-		return systemId;
-	}
-
-	public void setPublicId(String pubId) {
-		publicId = pubId;
-	}
-
-	public String getPublicId() {
-		return publicId;
-	}
-
-	public void setGrammarURI(String gramURI) {
-		grammarURI = gramURI;
-	}
-
-	public String getGrammarURI() {
-		return grammarURI;
-	}
-
-	public void setCMDocument(CMDocument cmDoc) {
-		cmDocument = cmDoc;
-	}
-
-	public CMDocument getCMDocument() {
-		return cmDocument;
-	}
-
-	public void setRootElementName(String rootName) {
-		rootElementName = rootName;
-	}
-
-	public String getRootElementName() {
-		return rootElementName;
-	}
-
-
-	protected class MyExternalCMDocumentSupport implements DOMContentBuilderImpl.ExternalCMDocumentSupport {
-		protected List namespaceInfoList1;
-		protected URIResolver idResolver;
-		protected String resourceLocation;
-
-		protected MyExternalCMDocumentSupport(List namespaceInfoListParam, String resourceLocation) {
-			this.namespaceInfoList1 = namespaceInfoListParam;
-			this.resourceLocation = resourceLocation;
-			idResolver = URIResolverPlugin.createResolver();
-		}
-
-		public CMDocument getCMDocument(Element element, String namespaceURI) {
-			CMDocument result = null;
-			if (namespaceURI != null && namespaceURI.trim().length() > 0) {
-				String locationHint = null;
-				for (Iterator i = namespaceInfoList1.iterator(); i.hasNext();) {
-					NamespaceInfo info = (NamespaceInfo) i.next();
-					if (namespaceURI.equals(info.uri)) {
-						locationHint = info.locationHint;
-						break;
-					}
-				}
-				if (locationHint != null) {
-					grammarURI = idResolver.resolve(resourceLocation, locationHint, locationHint);
-					result = ContentModelManager.getInstance().createCMDocument(getGrammarURI(), null);
-				}
-			}
-			else {
-				result = cmDocument;
-			}
-			return result;
-		}
-	}
-
-	public static String getNonWhitespaceString(String string) {
-		String result = null;
-		if (string != null) {
-			if (string.trim().length() > 0) {
-				result = string;
-			}
-		}
-		return result;
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java
deleted file mode 100644
index f645262..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java
+++ /dev/null
@@ -1,829 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import java.text.Collator;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-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.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-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.util.DOMContentBuilder;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.dialogs.NamespaceInfoErrorHelper;
-import org.eclipse.wst.xml.ui.internal.dialogs.SelectFileOrXMLCatalogIdPanel;
-import org.eclipse.wst.xml.ui.internal.nsedit.CommonEditNamespacesDialog;
-
-public class NewXMLWizard extends NewModelWizard {
-	protected static final int CREATE_FROM_DTD = 0;
-	protected static final int CREATE_FROM_XSD = 1;
-	protected static final int CREATE_FROM_SCRATCH = 2;
-
-	protected static final String[] createFromRadioButtonLabel = {XMLWizardsMessages._UI_RADIO_XML_FROM_DTD, XMLWizardsMessages._UI_RADIO_XML_FROM_SCHEMA, XMLWizardsMessages._UI_RADIO_XML_FROM_SCRATCH};
-
-	protected static final String[] filePageFilterExtensions = {".xml"}; //$NON-NLS-1$
-	protected static final String[] browseXSDFilterExtensions = {".xsd"}; //$NON-NLS-1$
-	protected static final String[] browseDTDFilterExtensions = {".dtd"}; //$NON-NLS-1$
-
-	protected NewFilePage newFilePage;
-	protected StartPage startPage;
-	protected SelectGrammarFilePage selectGrammarFilePage;
-	protected SelectRootElementPage selectRootElementPage;
-
-	protected String cmDocumentErrorMessage;
-
-	protected NewXMLGenerator generator;
-
-
-	public NewXMLWizard() {
-		setWindowTitle(XMLWizardsMessages._UI_WIZARD_CREATE_XML_HEADING);
-		setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XMLWizard.class, "icons/generatexml_wiz.gif")); //$NON-NLS-1$
-		generator = new NewXMLGenerator();
-	}
-
-
-	public NewXMLWizard(IFile file, CMDocument cmDocument) {
-		this();
-
-		generator.setGrammarURI(URIHelper.getPlatformURI(file));
-		generator.setCMDocument(cmDocument);
-	}
-
-
-	public static void showDialog(Shell shell, IFile file, IStructuredSelection structuredSelection) {
-		String[] errorInfo = new String[2];
-		CMDocument cmDocument = NewXMLGenerator.createCMDocument(file.getLocation().toOSString(), errorInfo);
-		if (errorInfo[0] == null) {
-			NewXMLWizard wizard = new NewXMLWizard(file, cmDocument);
-			wizard.init(PlatformUI.getWorkbench(), structuredSelection);
-			wizard.setNeedsProgressMonitor(true);
-			WizardDialog dialog = new WizardDialog(shell, wizard);
-			dialog.create();
-			dialog.getShell().setText(XMLWizardsMessages._UI_DIALOG_NEW_TITLE);
-			dialog.setBlockOnOpen(true);
-			dialog.open();
-		}
-		else {
-			MessageDialog.openInformation(shell, errorInfo[0], errorInfo[1]);
-		}
-	}
-
-
-	public void addPages() {
-		String grammarURI = generator.getGrammarURI();
-
-		if (grammarURI == null) {
-			// start page
-			startPage = new StartPage("StartPage", createFromRadioButtonLabel) //$NON-NLS-1$
-			{
-				public void createControl(Composite parent) {
-					super.createControl(parent);
-				}
-
-				public void setVisible(boolean visible) {
-					super.setVisible(visible);
-					getRadioButtonAtIndex(getCreateMode()).setSelection(true);
-					getRadioButtonAtIndex(getCreateMode()).setFocus();
-
-					// Set the help context for each button
-					PlatformUI.getWorkbench().getHelpSystem().setHelp(startPage.getRadioButtonAtIndex(0), IXMLWizardHelpContextIds.XML_NEWWIZARD_CREATEXML1_HELPID);
-					PlatformUI.getWorkbench().getHelpSystem().setHelp(startPage.getRadioButtonAtIndex(1), IXMLWizardHelpContextIds.XML_NEWWIZARD_CREATEXML2_HELPID);
-					PlatformUI.getWorkbench().getHelpSystem().setHelp(startPage.getRadioButtonAtIndex(2), IXMLWizardHelpContextIds.XML_NEWWIZARD_CREATEXML3_HELPID);
-				}
-			};
-
-
-			startPage.setTitle(XMLWizardsMessages._UI_WIZARD_CREATE_XML_HEADING);
-			startPage.setDescription(XMLWizardsMessages._UI_WIZARD_CREATE_XML_EXPL);
-			addPage(startPage);
-		}
-
-		// new file page
-		newFilePage = new NewFilePage(fSelection);
-		newFilePage.setTitle(XMLWizardsMessages._UI_WIZARD_CREATE_XML_FILE_HEADING);
-		newFilePage.setDescription(XMLWizardsMessages._UI_WIZARD_CREATE_XML_FILE_EXPL);
-		newFilePage.defaultName = (grammarURI != null) ? URIHelper.removeFileExtension(URIHelper.getLastSegment(grammarURI)) : "NewFile"; //$NON-NLS-1$
-		newFilePage.defaultFileExtension = ".xml"; //$NON-NLS-1$
-		newFilePage.filterExtensions = filePageFilterExtensions;
-		addPage(newFilePage);
-
-		// selectGrammarFilePage
-		selectGrammarFilePage = new SelectGrammarFilePage();
-		addPage(selectGrammarFilePage);
-
-		// select root element page
-		selectRootElementPage = new SelectRootElementPage();
-		selectRootElementPage.setTitle(XMLWizardsMessages._UI_WIZARD_SELECT_ROOT_HEADING);
-		selectRootElementPage.setDescription(XMLWizardsMessages._UI_WIZARD_SELECT_ROOT_EXPL);
-		addPage(selectRootElementPage);
-	}
-
-
-	public IWizardPage getStartingPage() {
-		WizardPage result = null;
-		if (startPage != null) {
-			result = startPage;
-		}
-		else {
-			result = newFilePage;
-		}
-		return result;
-	}
-
-
-	public int getCreateMode() {
-		String grammarURI = generator.getGrammarURI();
-
-		int result = CREATE_FROM_SCRATCH;
-		if (grammarURI != null) {
-			if (grammarURI.endsWith(".dtd")) //$NON-NLS-1$
-			{
-				result = CREATE_FROM_DTD;
-			}
-			else if (grammarURI.endsWith(".xsd")) //$NON-NLS-1$
-			{
-				result = CREATE_FROM_XSD;
-			}
-		}
-		else if (startPage != null) {
-			int selectedIndex = startPage.getSelectedRadioButtonIndex();
-			if (selectedIndex != -1) {
-				result = selectedIndex;
-			}
-		}
-		return result;
-	}
-
-
-	public IWizardPage getNextPage(IWizardPage currentPage) {
-		WizardPage nextPage = null;
-		if (currentPage == startPage) {
-			nextPage = newFilePage;
-		}
-		else if (currentPage == newFilePage) {
-			if (getCreateMode() == CREATE_FROM_SCRATCH) {
-				nextPage = null;
-			}
-			else if (generator.getGrammarURI() == null) {
-				nextPage = selectGrammarFilePage;
-			}
-			else {
-				nextPage = selectRootElementPage;
-			}
-		}
-		else if (currentPage == selectGrammarFilePage) {
-			nextPage = selectRootElementPage;
-		}
-		return nextPage;
-	}
-
-
-	public boolean canFinish() {
-		boolean result = false;
-
-		IWizardPage currentPage = getContainer().getCurrentPage();
-
-		if ((startPage != null && startPage.getSelectedRadioButtonIndex() == CREATE_FROM_SCRATCH && currentPage == newFilePage) || (currentPage == selectRootElementPage)) {
-			result = currentPage.isPageComplete();
-		}
-		return result;
-	}
-
-
-	public boolean performFinish() {
-		boolean result = true;
-		super.performFinish();
-		String fileName = null;
-		try {
-
-			String[] namespaceErrors = generator.getNamespaceInfoErrors();
-			if (namespaceErrors != null) {
-				String title = namespaceErrors[0];
-				String message = namespaceErrors[1];
-				result = MessageDialog.openQuestion(getShell(), title, message);
-			}
-
-			if (result) {
-				fileName = newFilePage.getFileName();
-				if ((new Path(fileName)).getFileExtension() == null) {
-					newFilePage.setFileName(fileName.concat(".xml")); //$NON-NLS-1$
-				}
-
-				IFile newFile = newFilePage.createNewFile();
-				String xmlFileName = newFile.getLocation().toOSString();
-
-				if (getContainer().getCurrentPage() == selectRootElementPage) {
-
-					generator.createXMLDocument(newFile, xmlFileName);
-				}
-				else {
-					generator.createEmptyXMLDocument(newFile);
-				}
-
-				newFile.refreshLocal(1, null);
-
-				IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-				BasicNewResourceWizard.selectAndReveal(newFile, workbenchWindow);
-				openEditor(newFile);
-			}
-		}
-		catch (Exception e) {
-			Logger.logException("Exception completing New XML wizard " + fileName, e); //$NON-NLS-1$
-		}
-		return result;
-	}
-
-	public void openEditor(IFile file) {
-		// Open editor on new file.
-		String editorId = null;
-		try {
-			IEditorDescriptor editor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(file.getLocation().toOSString(), file.getContentDescription().getContentType());
-			if (editor != null) {
-				editorId = editor.getId();
-			}
-		}
-		catch (CoreException e1) {
-			// editor id could not be retrieved, so we can not open editor
-			return;
-		}
-		IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-		try {
-			if (dw != null) {
-				IWorkbenchPage page = dw.getActivePage();
-				if (page != null)
-					page.openEditor(new FileEditorInput(file), editorId, true);
-			}
-		}
-		catch (PartInitException e) {
-			// editor can not open for some reason
-			return;
-		}
-
-	}
-
-
-	protected String getDefaultSystemId() {
-		String relativePath = "platform:/resource/" + newFilePage.getContainerFullPath().toString() + "/dummy"; //$NON-NLS-1$ //$NON-NLS-2$
-		return URIHelper.getRelativeURI(generator.getGrammarURI(), relativePath);
-	}
-
-
-	/**
-	 * SelectGrammarFilePage
-	 */
-	class SelectGrammarFilePage extends WizardPage {
-		protected SelectFileOrXMLCatalogIdPanel panel;
-
-		SelectGrammarFilePage() {
-			super("SelectGrammarFilePage"); //$NON-NLS-1$
-		}
-
-		public void createControl(Composite parent) {
-			Composite composite = new Composite(parent, SWT.NONE);
-			PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTSOURCE_HELPID);
-			composite.setLayout(new GridLayout());
-			composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-			setControl(composite);
-
-			panel = new SelectFileOrXMLCatalogIdPanel(composite);
-			panel.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-			SelectFileOrXMLCatalogIdPanel.Listener listener = new SelectFileOrXMLCatalogIdPanel.Listener() {
-				public void completionStateChanged() {
-					updateErrorMessage();
-				}
-			};
-			panel.setListener(listener);
-		}
-
-		public void setVisible(boolean visible) {
-			super.setVisible(visible);
-			if (visible) {
-				if (getCreateMode() == CREATE_FROM_DTD) {
-					setTitle(XMLWizardsMessages._UI_WIZARD_SELECT_DTD_FILE_TITLE);
-					setDescription(XMLWizardsMessages._UI_WIZARD_SELECT_DTD_FILE_DESC);
-					panel.setFilterExtensions(browseDTDFilterExtensions);
-				}
-				else {
-					setTitle(XMLWizardsMessages._UI_WIZARD_SELECT_XSD_FILE_TITLE);
-					setDescription(XMLWizardsMessages._UI_WIZARD_SELECT_XSD_FILE_DESC);
-					panel.setFilterExtensions(browseXSDFilterExtensions);
-				}
-				generator.setGrammarURI(null);
-				generator.setCMDocument(null);
-				cmDocumentErrorMessage = null;
-			}
-			panel.setVisibleHelper(visible);
-		}
-
-		public String getURI() {
-			String uri = panel.getXMLCatalogURI();
-			if (uri == null) {
-				IFile file = panel.getFile();
-				if (file != null) {
-					uri = URIHelper.getPlatformURI(file);
-				}
-			}
-			return uri;
-		}
-
-		public boolean isPageComplete() {
-			return getURI() != null && getErrorMessage() == null;
-		}
-
-		public String getXMLCatalogId() {
-			return panel.getXMLCatalogId();
-		}
-
-		public ICatalogEntry getXMLCatalogEntry() {
-			return panel.getXMLCatalogEntry();
-		}
-
-		public String computeErrorMessage() {
-			String errorMessage = null;
-			String uri = getURI();
-			if (uri != null) {
-				if (!URIHelper.isReadableURI(uri, false)) {
-					errorMessage = XMLWizardsMessages._UI_LABEL_ERROR_CATALOG_ENTRY_INVALID;
-				}
-			}
-			return errorMessage;
-		}
-
-
-		public void updateErrorMessage() {
-			String errorMessage = computeErrorMessage();
-			setErrorMessage(errorMessage);
-			setPageComplete(isPageComplete());
-		}
-	}
-
-
-	/**
-	 * SelectRootElementPage
-	 */
-	class SelectRootElementPage extends WizardPage implements SelectionListener {
-		protected Combo combo;
-		protected Button[] radioButton;
-		protected PageBook pageBook;
-		protected XSDOptionsPanel xsdOptionsPanel;
-		protected DTDOptionsPanel dtdOptionsPanel;
-
-
-		SelectRootElementPage() {
-			super("SelectRootElementPage"); //$NON-NLS-1$
-		}
-
-		public void createControl(Composite parent) {
-			// container group
-			Composite containerGroup = new Composite(parent, SWT.NONE);
-			PlatformUI.getWorkbench().getHelpSystem().setHelp(containerGroup, IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT_HELPID);
-			containerGroup.setLayout(new GridLayout());
-			containerGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-			setControl(containerGroup);
-
-			// select root element
-			Label containerLabel = new Label(containerGroup, SWT.NONE);
-			containerLabel.setText(XMLWizardsMessages._UI_LABEL_ROOT_ELEMENT);
-			combo = new Combo(containerGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
-			combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-			combo.addSelectionListener(this);
-
-			// Options
-			{
-				Group group = new Group(containerGroup, SWT.NONE);
-				group.setText(XMLWizardsMessages._UI_WIZARD_CONTENT_OPTIONS);
-
-				GridLayout layout = new GridLayout();
-				layout.numColumns = 1;
-				layout.makeColumnsEqualWidth = true;
-				layout.marginWidth = 0;
-				group.setLayout(layout);
-				group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-				radioButton = new Button[4];
-
-				radioButton[0] = new Button(group, SWT.CHECK);
-				radioButton[0].setText(XMLWizardsMessages._UI_WIZARD_CREATE_OPTIONAL_ATTRIBUTES);
-				radioButton[0].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-				radioButton[0].setSelection(false);
-				PlatformUI.getWorkbench().getHelpSystem().setHelp(radioButton[0], IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT1_HELPID);
-
-				radioButton[1] = new Button(group, SWT.CHECK);
-				radioButton[1].setText(XMLWizardsMessages._UI_WIZARD_CREATE_OPTIONAL_ELEMENTS);
-				radioButton[1].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-				radioButton[1].setSelection(false);
-				PlatformUI.getWorkbench().getHelpSystem().setHelp(radioButton[1], IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT2_HELPID);
-
-				radioButton[2] = new Button(group, SWT.CHECK);
-				radioButton[2].setText(XMLWizardsMessages._UI_WIZARD_CREATE_FIRST_CHOICE);
-				radioButton[2].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-				radioButton[2].setSelection(true);
-				PlatformUI.getWorkbench().getHelpSystem().setHelp(radioButton[2], IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT3_HELPID);
-
-				radioButton[3] = new Button(group, SWT.CHECK);
-				radioButton[3].setText(XMLWizardsMessages._UI_WIZARD_FILL_ELEMENTS_AND_ATTRIBUTES);
-				radioButton[3].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-				radioButton[3].setSelection(true);
-				PlatformUI.getWorkbench().getHelpSystem().setHelp(radioButton[3], IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT4_HELPID);
-				/*
-				 * radioButton = new Button[2];
-				 * 
-				 * radioButton[0] = new Button(group, SWT.RADIO);
-				 * radioButton[0].setText(XMLWizardsMessages.getString("_UI_WIZARD_CREATE_REQUIRED"));
-				 * radioButton[0].setLayoutData(new
-				 * GridData(GridData.FILL_HORIZONTAL));
-				 * radioButton[0].setSelection(true);
-				 * WorkbenchHelp.setHelp(radioButton[0],
-				 * XMLBuilderContextIds.XMLC_CREATE_REQUIRED_ONLY);
-				 * 
-				 * radioButton[1] = new Button(group, SWT.RADIO);
-				 * radioButton[1].setText(XMLWizardsMessages.getString("_UI_WIZARD_CREATE_OPTIONAL"));
-				 * radioButton[1].setLayoutData(new
-				 * GridData(GridData.FILL_HORIZONTAL));
-				 * WorkbenchHelp.setHelp(radioButton[1],
-				 * XMLBuilderContextIds.XMLC_CREATE_REQUIRED_AND_OPTION);
-				 */
-			}
-
-			// add the grammar specific generation options
-			//
-			{
-				pageBook = new PageBook(containerGroup, SWT.NONE);
-				pageBook.setLayoutData(new GridData(GridData.FILL_BOTH));
-				xsdOptionsPanel = new XSDOptionsPanel(this, pageBook);
-				dtdOptionsPanel = new DTDOptionsPanel(this, pageBook);
-				pageBook.showPage(xsdOptionsPanel);
-			}
-		}
-
-		public void widgetSelected(SelectionEvent event) {
-			int index = combo.getSelectionIndex();
-			String rootElementName = (index != -1) ? combo.getItem(index) : null;
-			generator.setRootElementName(rootElementName);
-		}
-
-		public void widgetDefaultSelected(SelectionEvent event) {
-			// do nothing
-		}
-
-		public void setVisible(boolean visible) {
-			super.setVisible(visible);
-
-			if (visible) {
-				try {
-					if (generator.getGrammarURI() == null) {
-						generator.setGrammarURI(selectGrammarFilePage.getURI());
-						generator.setXMLCatalogEntry(selectGrammarFilePage.getXMLCatalogEntry());
-					}
-					Assert.isNotNull(generator.getGrammarURI());
-
-					if (generator.getCMDocument() == null) {
-						final String[] errorInfo = new String[2];
-						final CMDocument[] cmdocs = new CMDocument[1];
-						Runnable r = new Runnable() {
-							public void run() {
-								cmdocs[0] = NewXMLGenerator.createCMDocument(generator.getGrammarURI(), errorInfo);
-							}
-						};
-						org.eclipse.swt.custom.BusyIndicator.showWhile(Display.getCurrent(), r);
-
-						generator.setCMDocument(cmdocs[0]);
-						cmDocumentErrorMessage = errorInfo[1];
-					}
-
-					if (generator.getCMDocument() != null && cmDocumentErrorMessage == null) {
-						CMNamedNodeMap nameNodeMap = generator.getCMDocument().getElements();
-						Vector nameNodeVector = new Vector();
-
-						for (int i = 0; i < nameNodeMap.getLength(); i++) {
-							CMElementDeclaration cmElementDeclaration = (CMElementDeclaration) nameNodeMap.item(i);
-							Object value = cmElementDeclaration.getProperty("Abstract"); //$NON-NLS-1$
-							if (value != Boolean.TRUE) {
-								nameNodeVector.add(cmElementDeclaration.getElementName());
-							}
-						}
-
-						Object[] nameNodeArray = nameNodeVector.toArray();
-						if (nameNodeArray.length > 0) {
-							Arrays.sort(nameNodeArray, Collator.getInstance());
-						}
-
-						String defaultRootName = (String) (generator.getCMDocument()).getProperty("http://org.eclipse.wst/cm/properties/defaultRootName"); //$NON-NLS-1$
-						int defaultRootIndex = -1;
-						combo.removeAll();
-
-
-						for (int i = 0; i < nameNodeArray.length; i++) {
-							String elementName = (String) nameNodeArray[i];
-
-							combo.add(elementName);
-							if (defaultRootName != null && defaultRootName.equals(elementName)) {
-								defaultRootIndex = i;
-							}
-						}
-
-						if (nameNodeArray.length > 0) {
-							defaultRootIndex = defaultRootIndex != -1 ? defaultRootIndex : 0;
-							combo.select(defaultRootIndex);
-							generator.setRootElementName(combo.getItem(defaultRootIndex));
-						}
-					}
-
-					if (generator.getGrammarURI().endsWith("xsd")) //$NON-NLS-1$
-					{
-						pageBook.showPage(xsdOptionsPanel);
-						generator.setDefaultSystemId(getDefaultSystemId());
-						generator.createNamespaceInfoList();
-
-						// Provide default namespace prefix if none
-						for (int i = 0; i < generator.namespaceInfoList.size(); i++) {
-							NamespaceInfo nsinfo = (NamespaceInfo) generator.namespaceInfoList.get(i);
-							if ((nsinfo.prefix == null || nsinfo.prefix.trim().length() == 0) && (nsinfo.uri != null && nsinfo.uri.trim().length() != 0)) {
-								nsinfo.prefix = getDefaultPrefix(generator.namespaceInfoList);
-							}
-						}
-						xsdOptionsPanel.setNamespaceInfoList(generator.namespaceInfoList);
-					}
-					else if (generator.getGrammarURI().endsWith("dtd")) //$NON-NLS-1$
-					{
-						pageBook.showPage(dtdOptionsPanel);
-						dtdOptionsPanel.update();
-					}
-				}
-				catch (Exception e) {
-					// XMLBuilderPlugin.getPlugin().getMsgLogger().writeCurrentThread();
-				}
-
-				/*
-				 * String errorMessage = computeErrorMessage(); if
-				 * (errorMessage == null) super.setVisible(visible);
-				 */
-
-				updateErrorMessage();
-			}
-		}
-
-		private String getDefaultPrefix(List nsInfoList) {
-			String defaultPrefix = "p"; //$NON-NLS-1$
-			if (nsInfoList == null)
-				return defaultPrefix;
-
-			Vector v = new Vector();
-			for (int i = 0; i < nsInfoList.size(); i++) {
-				NamespaceInfo nsinfo = (NamespaceInfo) nsInfoList.get(i);
-				if (nsinfo.prefix != null)
-					v.addElement(nsinfo.prefix);
-			}
-
-			if (v.contains(defaultPrefix)) {
-				String s = defaultPrefix;
-				for (int j = 0; v.contains(s); j++) {
-					s = defaultPrefix + Integer.toString(j);
-				}
-				return s;
-			}
-			return defaultPrefix;
-		}
-
-		public boolean isPageComplete() {
-			boolean complete = (generator.getRootElementName() != null && generator.getRootElementName().length() > 0) && getErrorMessage() == null;
-
-			if (complete) {
-				/*
-				 * int buildPolicy = radioButton[0].getSelection() ?
-				 * DOMContentBuilder.BUILD_ONLY_REQUIRED_CONTENT :
-				 * DOMContentBuilder.BUILD_ALL_CONTENT;
-				 */
-				int buildPolicy = 0;
-				if (radioButton[0].getSelection())
-					buildPolicy = buildPolicy | DOMContentBuilder.BUILD_OPTIONAL_ATTRIBUTES;
-				if (radioButton[1].getSelection())
-					buildPolicy = buildPolicy | DOMContentBuilder.BUILD_OPTIONAL_ELEMENTS;
-				if (radioButton[2].getSelection())
-					buildPolicy = buildPolicy | DOMContentBuilder.BUILD_FIRST_CHOICE | DOMContentBuilder.BUILD_FIRST_SUBSTITUTION;
-				if (radioButton[3].getSelection())
-					buildPolicy = buildPolicy | DOMContentBuilder.BUILD_TEXT_NODES;
-
-				generator.setBuildPolicy(buildPolicy);
-			}
-
-			return complete;
-		}
-
-		public String computeErrorMessage() {
-			String errorMessage = null;
-
-			if (cmDocumentErrorMessage != null) {
-				errorMessage = cmDocumentErrorMessage;
-			}
-			else if (generator.getRootElementName() == null || generator.getRootElementName().length() == 0) {
-				errorMessage = XMLWizardsMessages._ERROR_ROOT_ELEMENT_MUST_BE_SPECIFIED;
-			}
-
-			return errorMessage;
-		}
-
-
-		public void updateErrorMessage() {
-			String errorMessage = computeErrorMessage();
-			if (errorMessage == null) {
-				if (xsdOptionsPanel.isVisible()) {
-
-					errorMessage = xsdOptionsPanel.computeErrorMessage();
-				}
-				else if (dtdOptionsPanel.isVisible()) {
-					errorMessage = dtdOptionsPanel.computeErrorMessage();
-				}
-			}
-			setErrorMessage(errorMessage);
-			setPageComplete(isPageComplete());
-		}
-	}
-
-	// //////////////End SelectRootElementPage
-
-
-
-	public static GridLayout createOptionsPanelLayout() {
-		GridLayout gridLayout = new GridLayout();
-		gridLayout.marginWidth = 0;
-		gridLayout.horizontalSpacing = 0;
-		return gridLayout;
-	}
-
-
-
-	/**
-	 * 
-	 */
-	class XSDOptionsPanel extends Composite {
-		protected String errorMessage = null;
-		protected SelectRootElementPage parentPage;
-		protected CommonEditNamespacesDialog editNamespaces;
-
-		public XSDOptionsPanel(SelectRootElementPage parentPage, Composite parent) {
-			super(parent, SWT.NONE);
-			this.parentPage = parentPage;
-
-			setLayout(createOptionsPanelLayout());
-			setLayoutData(new GridData(GridData.FILL_BOTH));
-
-			Composite co = new Composite(this, SWT.NONE);
-			co.setLayout(new GridLayout());
-
-			if (newFilePage != null && newFilePage.getContainerFullPath() != null) {
-				// todo... this is a nasty mess. I need to revist this code.
-				//
-				String resourceURI = "platform:/resource" + newFilePage.getContainerFullPath().toString() + "/dummy"; //$NON-NLS-1$ //$NON-NLS-2$
-				String resolvedPath = URIHelper.normalize(resourceURI, null, null);
-				if (resolvedPath.startsWith("file:/")) //$NON-NLS-1$
-				{
-					resolvedPath = resolvedPath.substring(6);
-				}
-				// end nasty messs
-				String tableTitle = XMLWizardsMessages._UI_LABEL_NAMESPACE_INFORMATION;
-				editNamespaces = new CommonEditNamespacesDialog(co, new Path(resolvedPath), tableTitle, true, true);
-			}
-		}
-
-		public void setNamespaceInfoList(List list) {
-			editNamespaces.setNamespaceInfoList(list);
-			editNamespaces.updateErrorMessage(list);
-		}
-
-		public void updateErrorMessage(List namespaceInfoList) {
-			NamespaceInfoErrorHelper helper = new NamespaceInfoErrorHelper();
-			errorMessage = helper.computeErrorMessage(namespaceInfoList, null);
-			parentPage.updateErrorMessage();
-		}
-
-
-		public String computeErrorMessage() {
-			return errorMessage;
-		}
-	}
-
-
-	/**
-	 * 
-	 */
-	public class DTDOptionsPanel extends Composite implements ModifyListener {
-		protected Group group;
-		protected Text systemIdField;
-		protected Text publicIdField;
-		protected SelectRootElementPage parentPage;
-
-		public DTDOptionsPanel(SelectRootElementPage parentPage, Composite parent) {
-			super(parent, SWT.NONE);
-			this.parentPage = parentPage;
-			setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-			setLayout(createOptionsPanelLayout());
-			Group group = new Group(this, SWT.NONE);
-			group.setText(XMLWizardsMessages._UI_LABEL_DOCTYPE_INFORMATION);
-
-			GridLayout layout = new GridLayout();
-			layout.numColumns = 2;
-			group.setLayout(layout);
-			group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-			Label publicIdLabel = new Label(group, SWT.NONE);
-			publicIdLabel.setText(XMLWizardsMessages._UI_LABEL_PUBLIC_ID);
-			publicIdField = new Text(group, SWT.SINGLE | SWT.BORDER);
-			publicIdField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-			publicIdField.addModifyListener(this);
-			PlatformUI.getWorkbench().getHelpSystem().setHelp(publicIdField, IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT5_HELPID);
-
-			Label systemIdLabel = new Label(group, SWT.NONE);
-			systemIdLabel.setText(XMLWizardsMessages._UI_LABEL_SYSTEM_ID);
-			systemIdField = new Text(group, SWT.SINGLE | SWT.BORDER);
-			systemIdField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-			systemIdField.addModifyListener(this);
-			PlatformUI.getWorkbench().getHelpSystem().setHelp(systemIdField, IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT6_HELPID);
-		}
-
-		public void update() {
-			String thePublicId = null;
-			String theSystemId = null;
-			ICatalogEntry xmlCatalogEntry = generator.getXMLCatalogEntry();
-
-			if (xmlCatalogEntry != null) {
-				if (xmlCatalogEntry.getEntryType() == ICatalogEntry.ENTRY_TYPE_PUBLIC) {
-					thePublicId = xmlCatalogEntry.getKey();
-					theSystemId = xmlCatalogEntry.getAttributeValue(ICatalogEntry.ATTR_WEB_URL);
-					if (theSystemId == null) {
-						theSystemId = generator.getGrammarURI().startsWith("http:") ? generator.getGrammarURI() : URIHelper.getLastSegment(generator.getGrammarURI()); //$NON-NLS-1$
-					}
-				}
-				else {
-					theSystemId = xmlCatalogEntry.getKey();
-				}
-			}
-			else {
-				theSystemId = getDefaultSystemId();
-			}
-
-			publicIdField.setText(thePublicId != null ? thePublicId : ""); //$NON-NLS-1$
-			systemIdField.setText(theSystemId != null ? theSystemId : ""); //$NON-NLS-1$
-		}
-
-		public void modifyText(ModifyEvent e) {
-			generator.setSystemId(systemIdField.getText());
-			generator.setPublicId(publicIdField.getText());
-			parentPage.updateErrorMessage();
-		}
-
-		public String computeErrorMessage() {
-			return null;
-		}
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLImportActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLImportActionDelegate.java
deleted file mode 100644
index 932dd24..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLImportActionDelegate.java
+++ /dev/null
@@ -1,86 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-// TODO cs... rename this class NewXMLActionDelegate
-// we need to re-add pre-validation using the validation framework API's
-// since we also need to add validation to the 'New XML' case, this prevalidation
-// function should really go into the NewWizard somewhere
-//
-public class XMLImportActionDelegate implements IActionDelegate
-{ 
-  /**
-   * Checks the current selection and runs the separate browser
-   * to show the content of the Readme file. This code shows how
-   * to launch separate browsers that are not VA/Base desktop parts.
-   *
-   * @param action  the action that was performed
-   */
-  public void run(IAction action)
-  {
-    IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-    ISelection selection = workbenchWindow.getSelectionService().getSelection();
-    Object selectedObject = getSelection(selection);
-
-    if (selectedObject instanceof IFile && selection instanceof IStructuredSelection)
-    {
-      IFile file = (IFile)selectedObject;
-      IStructuredSelection structuredSelection = (IStructuredSelection)selection;    
-      try
-      {
-        NewXMLWizard.showDialog(workbenchWindow.getShell(), file, structuredSelection);
-      }
-      catch (Exception e)
-      {
-        //XMLCorePlugin.getDefault().getLog().log();
-      }    
-    }
-  }
-
-  /**
-   * unused
-   */
-  public void selectionChanged(IAction action, ISelection selection)
-  {
-    // unused
-  }
-
-  // scammed from WindowUtility
-  //
-  public static Object getSelection(ISelection selection)
-  {
-    if (selection == null)
-    {
-      return null;
-    } // end of if ()
-
-    Object result = null;
-    if (selection instanceof IStructuredSelection)
-    {
-       IStructuredSelection es= (IStructuredSelection)selection;
-       Iterator i= es.iterator();
-       if (i.hasNext())
-       {
-         result= i.next();
-       }
-    }			
-    return result;
-  }  
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLSchemaValidationChecker.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLSchemaValidationChecker.java
deleted file mode 100644
index aec4a35..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLSchemaValidationChecker.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-public class XMLSchemaValidationChecker {
-	public boolean isValid(IFile ifile) {
-		String xsdFileName = ifile.getLocation().toString();
-		return isValid(xsdFileName);
-	}
-	/**
-	 * Should this be implemented as a Validator and simply called as such with
-	 * a reporter that only checks the results for severity = error?  Or should
-	 * the Xerces requirement be broken using a plug-in extension?
-	 */
-
-	public boolean isValid(String xsdFileName) {
-//		DOMASBuilderImpl builder = new DOMASBuilderImpl();
-//		DOMErrorHandler errorHandler = new DOMErrorHandler();
-//		builder.setErrorHandler(errorHandler);
-		try {
-			//String uri = 
-				URIHelper.getURIForFilePath(xsdFileName);
-//			ASModel model = builder.parseASURI(uri);
-//			if (errorHandler.hasError())
-//				return false;
-		}
-		catch (Exception e) // invalid schema
-			{
-			return false;
-		}
-
-		return true;
-	}
-
-	// inner class
-	class DOMErrorHandler implements ErrorHandler {
-		private boolean hasError = false;
-
-		public boolean hasError() {
-			return hasError;
-		}
-
-		public void error(SAXParseException err) {
-			hasError = true;
-		}
-		public void fatalError(SAXParseException exception) throws SAXException {
-			hasError = true;
-		}
-		public void warning(SAXParseException exception) throws SAXException {
-			// not an error
-		}
-	} // end DOMErrorHandlerImpl
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizard.java
deleted file mode 100644
index 10cafe6..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizard.java
+++ /dev/null
@@ -1,43 +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
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.wizards;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-public class XMLWizard
-{
-  protected static XMLWizard instance = new XMLWizard();
-
-  public synchronized static XMLWizard getInstance() {
-    return instance;
-  }
-  
-  public XMLWizard()
-  {
-    instance = this;
-
-  }
-  
-  public ImageDescriptor getImageDescriptor(String name)
-  {
-    try {
-      URL url= new URL(Platform.getBundle("org.eclipse.wst.xml.ui").getEntry("/"), name); //$NON-NLS-1$ //$NON-NLS-2$
-      return ImageDescriptor.createFromURL(url);
-    }
-    catch (MalformedURLException e) {
-      return ImageDescriptor.getMissingImageDescriptor();
-    }
-  } 
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizardsMessages.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizardsMessages.java
deleted file mode 100644
index 066d1b6..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizardsMessages.java
+++ /dev/null
@@ -1,83 +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.ui.internal.wizards;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML Wizards
- * 
- * @plannedfor 1.0
- */
-public class XMLWizardsMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.xml.ui.internal.wizards.wizardResource";//$NON-NLS-1$
-
-	public static String _UI_DIALOG_NEW_TITLE;
-	public static String _UI_DIALOG_TITLE_INVALID_GRAMMAR;
-	public static String _UI_DIALOG_MESSAGE_INVALID_GRAMMAR;
-	public static String _UI_RADIO_XML_FROM_DTD;
-	public static String _UI_RADIO_XML_FROM_SCHEMA;
-	public static String _UI_RADIO_XML_FROM_SCRATCH;
-	public static String _UI_WIZARD_CREATE_XML_HEADING;
-	public static String _UI_WIZARD_CREATE_XML_EXPL;
-	public static String _UI_WIZARD_CREATE_XML_FILE_HEADING;
-	public static String _UI_WIZARD_CREATE_XML_FILE_EXPL;
-	public static String _UI_WIZARD_SELECT_DTD_FILE_DESC;
-	public static String _UI_WIZARD_SELECT_DTD_FILE_TITLE;
-	public static String _UI_WIZARD_SELECT_XSD_FILE_DESC;
-	public static String _UI_WIZARD_SELECT_XSD_FILE_TITLE;
-	public static String _UI_WIZARD_SELECT_ROOT_HEADING;
-	public static String _UI_WIZARD_SELECT_ROOT_EXPL;
-	public static String _UI_LABEL_ROOT_ELEMENT;
-	public static String _UI_WARNING_TITLE_NO_ROOT_ELEMENTS;
-	public static String _UI_WARNING_MSG_NO_ROOT_ELEMENTS;
-	public static String _UI_LABEL_NO_LOCATION_HINT;
-	public static String _UI_WARNING_MSG_NO_LOCATION_HINT_1;
-	public static String _UI_WARNING_MSG_NO_LOCATION_HINT_2;
-	public static String _UI_WARNING_MSG_NO_LOCATION_HINT_3;
-	public static String _UI_WIZARD_CONTENT_OPTIONS;
-	public static String _UI_WIZARD_CREATE_REQUIRED;// commented out
-	public static String _UI_WIZARD_CREATE_OPTIONAL;// commented out
-	public static String _UI_WIZARD_CREATE_OPTIONAL_ATTRIBUTES;
-	public static String _UI_WIZARD_CREATE_OPTIONAL_ELEMENTS;
-	public static String _UI_WIZARD_CREATE_FIRST_CHOICE;
-	public static String _UI_WIZARD_FILL_ELEMENTS_AND_ATTRIBUTES;
-	public static String _UI_LABEL_DOCTYPE_INFORMATION;
-	public static String _UI_LABEL_SYSTEM_ID;
-	public static String _UI_LABEL_PUBLIC_ID;
-	public static String _UI_WARNING_URI_NOT_FOUND_COLON;
-	public static String _UI_INVALID_GRAMMAR_ERROR;
-	public static String _ERROR_BAD_FILENAME_EXTENSION;
-	public static String _ERROR_FILE_ALREADY_EXISTS;
-	public static String _ERROR_ROOT_ELEMENT_MUST_BE_SPECIFIED;
-	public static String _UI_LABEL_ERROR_SCHEMA_INVALID_INFO;
-	public static String _UI_LABEL_ERROR_DTD_INVALID_INFO;
-	public static String _UI_LABEL_ERROR_CATALOG_ENTRY_INVALID;
-	public static String _UI_LABEL_NAMESPACE_INFORMATION;
-	public static String Validation_Plugins_Unavailable;
-	public static String Validation_cannot_be_performed;
-	public static String ExampleProjectCreationOperation_op_desc;
-	public static String ExampleProjectCreationOperation_op_desc_proj;
-	public static String ExampleProjectCreationWizard_title;
-	public static String ExampleProjectCreationWizard_op_error_title;
-	public static String ExampleProjectCreationWizard_op_error_message;
-	public static String ExampleProjectCreationWizard_overwritequery_title;
-	public static String ExampleProjectCreationWizard_overwritequery_message;
-	public static String ExampleProjectCreationWizardPage_error_alreadyexists;
-	
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, XMLWizardsMessages.class);
-	}
-
-	private XMLWizardsMessages() {
-		// cannot create new instance
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/icons/generatexml_wiz.gif b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/icons/generatexml_wiz.gif
deleted file mode 100644
index 2e4f667..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/icons/generatexml_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties
deleted file mode 100644
index b4e5252..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties
+++ /dev/null
@@ -1,80 +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
-###############################################################################
-! Properties file for component: XML Tools -  New XML Wizard
-! Packaged for translation in:  xml.zip
-
-!XMLImportActionDelegate
-_UI_DIALOG_NEW_TITLE        = New
-_UI_DIALOG_TITLE_INVALID_GRAMMAR = Invalid Grammar
-_UI_DIALOG_MESSAGE_INVALID_GRAMMAR = The grammar file contains errors. If you proceed, an incorrect result file will be generated. Do you want to continue?
-
-!NewXMLBWizard
-_UI_RADIO_XML_FROM_DTD                = Create XML file from a &DTD file
-_UI_RADIO_XML_FROM_SCHEMA             = Create XML file from an &XML schema file
-_UI_RADIO_XML_FROM_SCRATCH            = Create XML file from &scratch
-_UI_WIZARD_CREATE_XML_HEADING         = Create XML File
-_UI_WIZARD_CREATE_XML_EXPL            = Select how you would like to create your XML file.
-_UI_WIZARD_CREATE_XML_FILE_HEADING    = XML File Name
-_UI_WIZARD_CREATE_XML_FILE_EXPL       = Specify a name for the new XML file.
-_UI_WIZARD_SELECT_DTD_FILE_DESC       = Select the DTD file to create the XML file.
-_UI_WIZARD_SELECT_DTD_FILE_TITLE      = Select DTD File
-_UI_WIZARD_SELECT_XSD_FILE_DESC       = Select the schema file to create the XML file.
-_UI_WIZARD_SELECT_XSD_FILE_TITLE      = Select XML Schema File
-_UI_WIZARD_SELECT_ROOT_HEADING        = Select Root Element
-_UI_WIZARD_SELECT_ROOT_EXPL           = Select the root element of the XML file.
-_UI_LABEL_ROOT_ELEMENT                = Root element:
-_UI_WARNING_TITLE_NO_ROOT_ELEMENTS    = No Root Elements
-_UI_WARNING_MSG_NO_ROOT_ELEMENTS      = No root element exists since the schema provided has no global elements.
-_UI_LABEL_NO_LOCATION_HINT            = Unspecified Namespace Location
-_UI_WARNING_MSG_NO_LOCATION_HINT_1    = You have not specified a location hint for one or more namespace entries.
-_UI_WARNING_MSG_NO_LOCATION_HINT_2    = Elements from these namespaces will not be generated. This may lead to an invalid generated document.
-_UI_WARNING_MSG_NO_LOCATION_HINT_3    = Click Yes to continue, Click No to go back and specify the location hints.
-_UI_WIZARD_CONTENT_OPTIONS            = Content options
-
-_UI_WIZARD_CREATE_REQUIRED            = &Create required content only
-_UI_WIZARD_CREATE_OPTIONAL            = Create required and &optional content
-
-_UI_WIZARD_CREATE_OPTIONAL_ATTRIBUTES = Create optional &attributes
-_UI_WIZARD_CREATE_OPTIONAL_ELEMENTS   = Create optional e&lements
-_UI_WIZARD_CREATE_FIRST_CHOICE        = Create first choice of required &choice
-_UI_WIZARD_FILL_ELEMENTS_AND_ATTRIBUTES = Fill elements and attributes with &data
-
-_UI_LABEL_DOCTYPE_INFORMATION         = Document type information
-_UI_LABEL_SYSTEM_ID                   = &System ID:
-_UI_LABEL_PUBLIC_ID                   = &Public ID:
-
-_UI_WARNING_URI_NOT_FOUND_COLON       = The specified resource cannot be located :
-
-!NewModelWizard
-_UI_INVALID_GRAMMAR_ERROR             = Invalid Grammar
-
-!NewModelWizard
-_ERROR_BAD_FILENAME_EXTENSION         = The specified file name must have a recognized extension (e.g. '.xml').
-_ERROR_FILE_ALREADY_EXISTS            = The same file already exists.
-_ERROR_ROOT_ELEMENT_MUST_BE_SPECIFIED = A root element must be specified.
-_UI_LABEL_ERROR_SCHEMA_INVALID_INFO   = The schema file contains errors. Open it in the XML schema editor for details.
-_UI_LABEL_ERROR_DTD_INVALID_INFO      = The DTD file contains errors. Open it in the DTD editor for details.
-
-_UI_LABEL_ERROR_CATALOG_ENTRY_INVALID = The selected catalog entry specifies a URI that can not be located.
-
-_UI_LABEL_NAMESPACE_INFORMATION=Namespace Information
-Validation_Plugins_Unavailable=Validation Plugins Unavailable
-Validation_cannot_be_performed=Validation cannot be performed because the validation plugins were disabled or not found.  The generated file may be invalid.  Do you wish to continue?
-#
-# ExampleProject
-ExampleProjectCreationOperation_op_desc=Creating example projects...
-ExampleProjectCreationOperation_op_desc_proj=Configuring project...
-ExampleProjectCreationWizard_title=New Example Project
-ExampleProjectCreationWizard_op_error_title=Project Creation Failed
-ExampleProjectCreationWizard_op_error_message=Project could not be created.
-ExampleProjectCreationWizard_overwritequery_title=Overwrite
-ExampleProjectCreationWizard_overwritequery_message=Do you want to overwrite {0}?
-ExampleProjectCreationWizardPage_error_alreadyexists=Project already exists.
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
deleted file mode 100644
index 5ce7c87..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
+++ /dev/null
@@ -1,257 +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.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextHover;
-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.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
-import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
-import org.eclipse.wst.xml.ui.internal.autoedit.AutoEditStrategyForTabs;
-import org.eclipse.wst.xml.ui.internal.autoedit.StructuredAutoEditStrategyXML;
-import org.eclipse.wst.xml.ui.internal.contentassist.NoRegionContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.doubleclick.XMLDoubleClickStrategy;
-import org.eclipse.wst.xml.ui.internal.hyperlink.XMLHyperlinkDetector;
-import org.eclipse.wst.xml.ui.internal.style.LineStyleProviderForXML;
-import org.eclipse.wst.xml.ui.internal.taginfo.XMLInformationProvider;
-import org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor;
-
-/**
- * Configuration for a source viewer which shows XML 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 StructuredTextViewerConfigurationXML 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 fLineStyleProviderForXML;
-
-	/**
-	 * Create new instance of StructuredTextViewerConfigurationXML
-	 */
-	public StructuredTextViewerConfigurationXML() {
-		// 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]);
-		}
-
-		if (contentType == IXMLPartitions.XML_DEFAULT) {
-			allStrategies.add(new StructuredAutoEditStrategyXML());
-		}
-
-		// be sure this is last, so it can modify any results form previous
-		// commands that might on on same partiion type.
-		// 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();
-			fConfiguredContentTypes = new String[xmlTypes.length + 2];
-			fConfiguredContentTypes[0] = IStructuredPartitionTypes.DEFAULT_PARTITION;
-			fConfiguredContentTypes[1] = IStructuredPartitionTypes.UNKNOWN_PARTITION;
-			int index = 0;
-			System.arraycopy(xmlTypes, 0, fConfiguredContentTypes, index += 2, xmlTypes.length);
-		}
-		return fConfiguredContentTypes;
-	}
-
-	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
-		IContentAssistProcessor[] processors = null;
-
-		if ((partitionType == IStructuredPartitionTypes.DEFAULT_PARTITION) || (partitionType == IXMLPartitions.XML_DEFAULT)) {
-			processors = new IContentAssistProcessor[]{new XMLContentAssistProcessor()};
-		}
-		else if (partitionType == IStructuredPartitionTypes.UNKNOWN_PARTITION) {
-			processors = new IContentAssistProcessor[]{new NoRegionContentAssistProcessor()};
-		}
-
-		return processors;
-	}
-
-	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
-		final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);
-
-		formatter.setMasterStrategy(new StructuredFormattingStrategy(new FormatProcessorXML()));
-
-		return formatter;
-	}
-
-	public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
-
-		ITextDoubleClickStrategy doubleClickStrategy = null;
-		if (contentType.compareTo(IXMLPartitions.XML_DEFAULT) == 0)
-			doubleClickStrategy = new XMLDoubleClickStrategy();
-		else
-			doubleClickStrategy = super.getDoubleClickStrategy(sourceViewer, contentType);
-		return doubleClickStrategy;
-	}
-
-	public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
-		if (sourceViewer == null || !fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED))
-			return null;
-
-		List allDetectors = new ArrayList(0);
-		allDetectors.add(new XMLHyperlinkDetector());
-
-		IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer);
-		for (int m = 0; m < superDetectors.length; m++) {
-			IHyperlinkDetector detector = superDetectors[m];
-			if (!allDetectors.contains(detector)) {
-				allDetectors.add(detector);
-			}
-		}
-		return (IHyperlinkDetector[]) allDetectors.toArray(new IHyperlinkDetector[0]);
-	}
-
-	public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
-		Vector vector = new Vector();
-
-		// prefix[0] is either '\t' or ' ' x tabWidth, depending on preference
-		Preferences preferences = XMLCorePlugin.getDefault().getPluginPreferences();
-		int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
-		String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
-		boolean useSpaces = XMLCorePreferenceNames.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()]);
-	}
-
-	protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
-		IInformationProvider provider = null;
-		if ((partitionType == IStructuredPartitionTypes.DEFAULT_PARTITION) || (partitionType == IXMLPartitions.XML_DEFAULT)) {
-			provider = new XMLInformationProvider();
-		}
-		return provider;
-	}
-
-	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
-		LineStyleProvider[] providers = null;
-
-		if (partitionType == IXMLPartitions.XML_DEFAULT || partitionType == IXMLPartitions.XML_CDATA || partitionType == IXMLPartitions.XML_COMMENT || partitionType == IXMLPartitions.XML_DECLARATION || partitionType == IXMLPartitions.XML_PI) {
-			providers = new LineStyleProvider[]{getLineStyleProviderForXML()};
-		}
-
-		return providers;
-	}
-
-	private LineStyleProvider getLineStyleProviderForXML() {
-		if (fLineStyleProviderForXML == null)
-			fLineStyleProviderForXML = new LineStyleProviderForXML();
-		return fLineStyleProviderForXML;
-	}
-
-	public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
-		ITextHover textHover = null;
-
-		// look for appropriate text hover processor to return based on
-		// content type and state mask
-		if ((contentType == IStructuredPartitionTypes.DEFAULT_PARTITION) || (contentType == IXMLPartitions.XML_DEFAULT)) {
-			// check which of xml's text hover is handling stateMask
-			TextHoverManager manager = SSEUIPlugin.getDefault().getTextHoverManager();
-			TextHoverManager.TextHoverDescriptor[] hoverDescs = manager.getTextHovers();
-			int i = 0;
-			while (i < hoverDescs.length && textHover == null) {
-				if (hoverDescs[i].isEnabled() && EditorUtility.computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
-					String hoverType = hoverDescs[i].getId();
-					if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType))
-						textHover = manager.createBestMatchHover(new XMLTagInfoHoverProcessor());
-					else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType))
-						textHover = new XMLTagInfoHoverProcessor();
-				}
-				i++;
-			}
-		}
-
-		// no appropriate text hovers found, try super
-		if (textHover == null)
-			textHover = super.getTextHover(sourceViewer, contentType, stateMask);
-
-		return textHover;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserver.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserver.java
deleted file mode 100644
index ff36fda..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserver.java
+++ /dev/null
@@ -1,184 +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.ui.internal;
-
-
-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.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.ui.internal.SSEUIMessages;
-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.modelqueryimpl.CMDocumentLoader;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.InferredGrammarBuildingCMDocumentLoader;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This class is used to observe changes in the DOM and perform
- * occasional'scans' to deduce information. We use a delay timer mechanism to
- * ensure scans are made every couple of seconds to avoid performance
- * problems. Currently this class is used to keep track of referenced grammar
- * uri's within the document ensure that they are loaded by the
- * CMDocumentManager. We might want to generalize this class to perform other
- * suplimental information gathering that is suitable for 'time delayed'
- * computation (error hints etc.).
- */
-// TODO: Where should this class go?
-public class DOMObserver {
-
-
-	// An abstract adapter that ensures that the children of a new Node are
-	// also adapted
-	//
-	abstract class DocumentAdapter implements INodeAdapter {
-		public DocumentAdapter(Document document) {
-			((INodeNotifier) document).addAdapter(this);
-			adapt(document.getDocumentElement());
-		}
-
-		public void adapt(Element element) {
-			if (element != null) {
-				if (((INodeNotifier) element).getExistingAdapter(this) == null) {
-					((INodeNotifier) element).addAdapter(this);
-
-					for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) {
-						if (child.getNodeType() == Node.ELEMENT_NODE) {
-							adapt((Element) child);
-						}
-					}
-				}
-			}
-		}
-
-		public boolean isAdapterForType(Object type) {
-			return type == this;
-		}
-
-		abstract public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index);
-	}
-
-	/**
-	 * This class listens to the changes in the CMDocument and triggers a
-	 * CMDocument load
-	 */
-	class MyDocumentAdapter extends DocumentAdapter {
-		MyDocumentAdapter(Document document) {
-			super(document);
-		}
-
-		public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index) {
-			switch (eventType) {
-				case INodeNotifier.ADD : {
-					if (newValue instanceof Element) {
-						// System.out.println("ADD (to " +
-						// ((Node)notifier).getNodeName() + ") " +
-						// ((Element)newValue).getNodeName() + " old " +
-						// oldValue);
-						adapt((Element) newValue);
-					}
-					break;
-				}
-				// case INodeNotifier.REMOVE:
-				case INodeNotifier.CHANGE :
-				case INodeNotifier.STRUCTURE_CHANGED :
-				case INodeNotifier.CONTENT_CHANGED : {
-					Node node = (Node) notifier;
-					if (node.getNodeType() == Node.ELEMENT_NODE) {
-						switch (eventType) {
-							case INodeNotifier.CHANGE :
-							case INodeNotifier.STRUCTURE_CHANGED : {
-								// structure change
-								invokeDelayedCMDocumentLoad();
-								break;
-							}
-							case INodeNotifier.CONTENT_CHANGED : {
-								// some content changed
-								break;
-							}
-						}
-					}
-					else if (node.getNodeType() == Node.DOCUMENT_NODE) {
-						invokeDelayedCMDocumentLoad();
-					}
-					break;
-				}
-			}
-		}
-	}
-
-	/**
-	 * Intentionally left visible to the user
-	 */
-	class TimerJob extends Job {
-		public TimerJob() {
-			super(SSEUIMessages.LoadingReferencedGrammars);
-			setPriority(Job.SHORT);
-		}
-
-		public IStatus run(IProgressMonitor monitor) {
-			monitor.beginTask("", IProgressMonitor.UNKNOWN);  //$NON-NLS-1$
-			invokeCMDocumentLoad();
-			monitor.done();
-			return Status.OK_STATUS;
-		}
-	}
-
-	private Job timer = new TimerJob();
-	protected Document fDocument;
-	protected boolean isGrammarInferenceEnabled;
-
-	public DOMObserver(IStructuredModel model) {
-		fDocument = (model instanceof IDOMModel) ? ((IDOMModel) model).getDocument() : null;
-
-		if (fDocument != null) {
-			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fDocument);
-			if (modelQuery != null && modelQuery.getCMDocumentManager() != null) {
-				CMDocumentManager cmDocumentManager = modelQuery.getCMDocumentManager();
-				cmDocumentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD, false);
-			}
-		}
-	}
-
-	public void init() {
-		// CS: we seem to expose an XSD initialization problem when we do this
-		// immediately
-		// very nasty... I need to revist this problem with Ed Merks
-		//
-		// invokeCMDocumentLoad();
-		invokeDelayedCMDocumentLoad();
-	}
-
-	public void invokeCMDocumentLoad() {
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fDocument);
-		if (modelQuery != null && modelQuery.getCMDocumentManager() != null) {
-			CMDocumentLoader loader = isGrammarInferenceEnabled ? new InferredGrammarBuildingCMDocumentLoader(fDocument, modelQuery) : new CMDocumentLoader(fDocument, modelQuery);
-			loader.loadCMDocuments();
-		}
-	}
-
-	public void invokeDelayedCMDocumentLoad() {
-		timer.schedule(2000);
-	}
-
-	public void setGrammarInferenceEnabled(boolean isEnabled) {
-		isGrammarInferenceEnabled = isEnabled;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/Logger.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/Logger.java
deleted file mode 100644
index e427490..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/Logger.java
+++ /dev/null
@@ -1,159 +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.ui.internal;
-
-
-
-import java.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.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.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java
deleted file mode 100644
index 0c470f9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java
+++ /dev/null
@@ -1,308 +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.ui.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by XML UI
- * 
- * @plannedfor 1.0
- */
-public class XMLUIMessages extends NLS {
-	private static final String BUNDLE_NAME = "org.eclipse.wst.xml.ui.internal.XMLUIPluginResources";//$NON-NLS-1$
-	private static ResourceBundle fResourceBundle;
-
-	public static String Sample_XML_doc;
-	public static String Comment_Delimiters_UI_;
-	public static String Comment_Content_UI_;
-	public static String Tag_Delimiters_UI_;
-	public static String Tag_Names_UI_;
-	public static String Attribute_Names_UI_;
-	public static String Attribute_Values_UI_;
-	public static String Declaration_Delimiters_UI_;
-	public static String Content_UI_;
-	public static String CDATA_Delimiters_UI_;
-	public static String CDATA_Content_UI_;
-	public static String Processing_Instruction_Del_UI_;
-	public static String Processing_Instruction_Con_UI__UI_;
-	public static String DOCTYPE_Name_UI_;
-	public static String DOCTYPE_SYSTEM_PUBLIC_Keyw_UI_;
-	public static String DOCTYPE_Public_Reference_UI_;
-	public static String DOCTYPE_System_Reference_UI_;
-	public static String DELETE;
-	public static String ADD_PROCESSING_INSTRUCTION;
-	public static String _UI_MENU_ADD_AFTER;
-	public static String _UI_MENU_ADD_ATTRIBUTE;
-	public static String _UI_MENU_ADD_BEFORE;
-	public static String _UI_MENU_ADD_CHILD;
-	public static String _UI_MENU_REMOVE;
-	public static String _UI_MENU_REPLACE_WITH;
-	public static String _UI_MENU_EDIT_DOCTYPE;
-	public static String _UI_LABEL_UNDO_REPLACE_DESCRIPTION;
-	public static String _UI_LABEL_EDIT_DOCTYPE;
-	public static String _UI_INFO_EXPAND_ALL;
-	public static String _UI_INFO_COLLAPSE_ALL;
-	public static String _UI_MENU_ADD_DTD_INFORMATION;
-	public static String _UI_MENU_ADD_SCHEMA_INFORMATION;
-	public static String _UI_MENU_EDIT_PROCESSING_INSTRUCTION;
-	public static String _UI_MENU_EDIT_NAMESPACES;
-	public static String _UI_MENU_ADD_DTD_INFORMATION_TITLE;
-	public static String _UI_MENU_EDIT_PROCESSING_INSTRUCTION_TITLE;
-	public static String _UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE;
-	public static String _UI_MENU_NEW_ATTRIBUTE;
-	public static String _UI_MENU_NEW_ATTRIBUTE_TITLE;
-	public static String _UI_MENU_EDIT_ATTRIBUTE;
-	public static String _UI_MENU_EDIT_ATTRIBUTE_TITLE;
-	public static String _UI_MENU_NEW_ELEMENT;
-	public static String _UI_MENU_NEW_ELEMENT_TITLE;
-	public static String _UI_MENU_RENAME;
-	public static String _UI_MENU_RENAME_TITLE;
-	public static String _UI_LABEL_ELEMENT_NAME;
-	public static String _UI_MENU_ADD_COMMENT;
-	public static String _UI_MENU_ADD_PROCESSING_INSTRUCTION;
-	public static String _UI_MENU_ADD_CDATA_SECTION;
-	public static String _UI_MENU_ADD_PCDATA;
-	public static String _UI_MENU_COMMENT;
-	public static String _UI_MENU_PROCESSING_INSTRUCTION;
-	public static String _UI_MENU_CDATA_SECTION;
-	public static String _UI_MENU_PCDATA;
-	public static String _UI_MENU_ADD;
-	public static String _UI_COMMENT_VALUE;
-	public static String _UI_PI_TARGET_VALUE;
-	public static String _UI_PI_DATA_VALUE;
-	public static String _UI_LABEL_ROOT_ELEMENT_VALUE;
-	public static String _UI_LABEL_TARGET_COLON;
-	public static String _UI_LABEL_DATA_COLON;
-	public static String _UI_LABEL_ROOT_ELEMENT_NAME_COLON;
-	public static String _UI_LABEL_PUBLIC_ID_COLON;
-	public static String _UI_LABEL_SYSTEM_ID_COLON;
-	public static String _UI_LABEL_BROWSE;
-	public static String _UI_LABEL_SELECT_XML_CATALOG_ENTRY;
-	public static String _UI_LABEL_SPECIFY_SYSTEM_ID;
-	public static String _UI_LABEL_SELECT_FILE;
-	public static String _UI_LABEL_KEY;
-	public static String _UI_LABEL_URI;
-	public static String _UI_LABEL_XML_CATALOG_COLON;
-	public static String _UI_LABEL_NAMESPACE_NAME;
-	public static String _UI_LABEL_LOCATION_HINT;
-	public static String _UI_LABEL_PREFIX;
-	public static String _UI_LABEL_NAMESPACE_NAME_COLON;
-	public static String _UI_LABEL_LOCATION_HINT_COLON;
-	public static String _UI_LABEL_PREFIX_COLON;
-	public static String _UI_NO_NAMESPACE_NAME;
-	public static String _UI_NO_PREFIX;
-	public static String _UI_LABEL_XML_SCHEMA_INFORMATION;
-	public static String _UI_LABEL_NAME_COLON;
-	public static String _UI_LABEL_VALUE_COLON;
-	public static String _UI_BUTTON_DELETE;
-	public static String _UI_BUTTON_NEW;
-	public static String _UI_BUTTON_EDIT;
-	public static String _UI_LABEL_NEW_NAMESPACE_INFORMATION;
-	public static String _UI_RADIO_BUTTON_SELECT_FROM_WORKSPACE;
-	public static String _UI_RADIO_BUTTON_SELECT_FROM_CATALOG;
-	public static String _UI_WARNING_MORE_THAN_ONE_NS_WITH_NAME;
-	public static String _UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_NAME;
-	public static String _UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_PREFIX;
-	public static String _UI_WARNING_MORE_THAN_ONE_NS_WITH_PREFIX;
-	public static String _UI_WARNING_SCHEMA_CAN_NOT_BE_LOCATED;
-	public static String _UI_WARNING_LOCATION_HINT_NOT_SPECIFIED;
-	public static String _UI_WARNING_NAMESPACE_NAME_NOT_SPECIFIED;
-	public static String _UI_WARNING_PREFIX_NOT_SPECIFIED;
-	public static String _UI_WARNING_ROOT_ELEMENT_MUST_BE_SPECIFIED;
-	public static String _UI_WARNING_SYSTEM_ID_MUST_BE_SPECIFIED;
-	public static String _UI_INVALID_NAME;
-	public static String _UI_ENTER_REQ_PREFIX_AND_NAMESPACE;
-	public static String _UI_SELECT_REGISTERED_NAMESPACES;
-	public static String _UI_SPECIFY_NEW_NAMESPACE;
-	public static String _UI_SELECT_NAMESPACE_TO_ADD;
-	public static String _UI_ADD_NAMESPACE_DECLARATIONS;
-	public static String _UI_NAMESPACE_DECLARATIONS;
-	public static String _UI_TARGET_NAMESPACE;
-	public static String _ERROR_XML_ATTRIBUTE_ALREADY_EXISTS;
-	public static String error_message_goes_here;
-	public static String SurroundWithNewElementQuickAssistProposal_0;
-	public static String SurroundWithNewElementQuickAssistProposal_1;
-	public static String RenameInFileQuickAssistProposal_0;
-	public static String RenameInFileQuickAssistProposal_1;
-	public static String InsertRequiredAttrsQuickAssistProposal_0;
-	public static String InsertRequiredAttrsQuickAssistProposal_1;
-	public static String EncodingSettings_0;
-	public static String EncodingSettings_1;
-	public static String DragNodeCommand_0;
-	public static String DragNodeCommand_1;
-	public static String CommonEditNamespacesDialog_0;
-	public static String JFaceNodeAdapter_1;
-	public static String QuickFixProcessorXML_0;
-	public static String QuickFixProcessorXML_1;
-	public static String QuickFixProcessorXML_2;
-	public static String QuickFixProcessorXML_3;
-	public static String QuickFixProcessorXML_4;
-	public static String QuickFixProcessorXML_5;
-	public static String QuickFixProcessorXML_6;
-	public static String QuickFixProcessorXML_7;
-	public static String QuickFixProcessorXML_8;
-	public static String QuickFixProcessorXML_9;
-	public static String QuickFixProcessorXML_10;
-	public static String QuickFixProcessorXML_11;
-	public static String QuickFixProcessorXML_12;
-	public static String QuickFixProcessorXML_13;
-	public static String QuickFixProcessorXML_14;
-	public static String QuickFixProcessorXML_15;
-	public static String XMLPropertySourceAdapter_0;
-	public static String WorkbenchDefaultEncodingSettings_0;
-	public static String refreshoutline_0;
-	public static String Creating_files_encoding;
-	public static String End_tag_has_attributes;
-	public static String Attribute__is_missing_a_value;
-	public static String Attribute__has_no_value;
-	public static String Missing_end_tag_;
-	public static String ReconcileStepForMarkup_0;
-	public static String ReconcileStepForMarkup_1;
-	public static String ReconcileStepForMarkup_2;
-	public static String ReconcileStepForMarkup_3;
-	public static String ReconcileStepForMarkup_4;
-	public static String ReconcileStepForMarkup_5;
-	public static String ReconcileStepForMarkup_6;
-	public static String End_with_;
-	public static String SEVERE_internal_error_occu_UI_;
-	public static String No_known_attribute__UI_;
-	public static String Content_Assist_not_availab_UI_;
-	public static String Element__is_unknown;
-	public static String Comment__;
-	public static String Close_with__;
-	public static String End_with__;
-	public static String Close_with___;
-	public static String Close_with____;
-	public static String _Has_no_available_child;
-	public static String No_known_child_tag;
-	public static String __Has_no_known_child;
-	public static String No_known_child_tag_names;
-	public static String The_document_element__;
-	public static String No_definition_for_in;
-	public static String No_definition_for;
-	public static String No_content_model_for;
-	public static String No_content_model_found_UI_;
-	public static String Cleanup_UI_;
-	public static String Compress_empty_element_tags_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 Creating_files;
-	public static String Encoding_desc;
-	public static String Encoding;
-	public static String Creating_or_saving_files;
-	public static String End_of_line_code_desc;
-	public static String End_of_line_code;
-	public static String EOL_Windows;
-	public static String EOL_Unix;
-	public static String EOL_Mac;
-	public static String EOL_NoTranslation;
-	public static String Content_assist_UI_;
-	public static String Automatically_make_suggest_UI_;
-	public static String Prompt_when_these_characte_UI_;
-	public static String Formatting_UI_;
-	public static String Line_width__UI_;
-	public static String Split_multiple_attributes;
-	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 Grammar_Constraints;
-	public static String Use_inferred_grammar_in_absence_of;
-	public static String Suggestion_Strategy;
-	public static String Suggestion_Strategy_Lax;
-	public static String Suggestion_Strategy_Strict;
-	public static String Element____1;
-	public static String Content_Model____2;
-	public static String Attribute____3;
-	public static String Data_Type____4;
-	public static String Enumerated_Values____5;
-	public static String FormatMenu_label;
-	public static String SourceMenu_label;
-	public static String Comment_label; // Resource bundle
-	public static String Comment_tooltip; // Resource bundle
-	public static String Comment_description; // Resource bundle
-	public static String Uncomment_label; // Resource bundle
-	public static String Uncomment_tooltip; // Resource bundle
-	public static String Uncomment_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 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 ShowTooltipDesc_label; // Resource bundle
-	public static String ShowTooltipDesc_tooltip; // Resource bundle
-	public static String ShowTooltipDesc_description; // Resource bundle
-	public static String ContentAssistProposals_label; // Resource bundle
-	public static String ContentAssistProposals_tooltip; // Resource bundle
-	public static String ContentAssistProposals_description; // Resourcebundle
-	public static String QuickFix_label; // Resource bundle
-	public static String QuickFix_tooltip; // Resource bundle
-	public static String QuickFix_description; // Resource bundle
-	public static String FormatDocument_label; // Resource bundle
-	public static String FormatDocument_tooltip; // Resource bundle
-	public static String FormatDocument_description; // Resource bundle
-	public static String FormatActiveElements_label; // Resource bundle
-	public static String FormatActiveElements_tooltip; // Resource bundle
-	public static String FormatActiveElements_description; // Resource bundle
-	public static String OpenFileFromSource_label; // Resource bundle
-	public static String OpenFileFromSource_tooltip; // Resource bundle
-	public static String OpenFileFromSource_description; // Resource bundle
-	public static String XMLContentOutlineConfiguration_0;
-	public static String StructureSelectEnclosing_label;
-	public static String StructureSelectEnclosing_tooltip;
-	public static String StructureSelectEnclosing_description;
-	public static String StructureSelectNext_label;
-	public static String StructureSelectNext_tooltip;
-	public static String StructureSelectNext_description;
-	public static String StructureSelectPrevious_label;
-	public static String StructureSelectPrevious_tooltip;
-	public static String StructureSelectPrevious_description;
-	public static String MESSAGE_XML_VALIDATION_MESSAGE_UI_;
-
-
-	static {
-		// load message values from bundle file
-		NLS.initializeMessages(BUNDLE_NAME, XMLUIMessages.class);
-	}
-
-	private XMLUIMessages() {
-		// cannot create new instance
-	}
-
-	public static ResourceBundle getResourceBundle() {
-		try {
-			if (fResourceBundle == null)
-				fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
-		}
-		catch (MissingResourceException x) {
-			fResourceBundle = null;
-		}
-		return fResourceBundle;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPlugin.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPlugin.java
deleted file mode 100644
index 491d881..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPlugin.java
+++ /dev/null
@@ -1,116 +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.ui.internal;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.swt.graphics.Image;
-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;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-import org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeIdsXML;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class XMLUIPlugin extends AbstractUIPlugin {
-	public final static String ID = "org.eclipse.wst.xml.ui"; //$NON-NLS-1$
-
-	protected static XMLUIPlugin instance = null;
-
-	public static XMLUIPlugin getDefault() {
-		return instance;
-	}
-
-	public synchronized static XMLUIPlugin getInstance() {
-		return instance;
-	}
-
-	/**
-	 * The template context type registry for the xml editor.
-	 */
-	private ContextTypeRegistry fContextTypeRegistry;
-
-	/**
-	 * The template store for the xml editor.
-	 * 
-	 */
-	private TemplateStore fTemplateStore;
-
-	public XMLUIPlugin() {
-		super();
-		instance = this;
-	}
-
-	public AdapterFactoryRegistry getAdapterFactoryRegistry() {
-		return AdapterFactoryRegistryImpl.getInstance();
-
-	}
-
-	/**
-	 * Returns the template store for the xml editor templates.
-	 * 
-	 * @return the template store for the xml editor templates
-	 */
-	public TemplateStore getTemplateStore() {
-		if (fTemplateStore == null) {
-			fTemplateStore = new ContributionTemplateStore(
-					getTemplateContextRegistry(), getPreferenceStore(),
-					XMLUIPreferenceNames.TEMPLATES_KEY);
-
-			try {
-				fTemplateStore.load();
-			} catch (IOException e) {
-				Logger.logException(e);
-			}
-		}
-		return fTemplateStore;
-	}
-
-	/**
-	 * Returns the template context type registry for the xml plugin.
-	 * 
-	 * @return the template context type registry for the xml plugin
-	 */
-	public ContextTypeRegistry getTemplateContextRegistry() {
-		if (fContextTypeRegistry == null) {
-			ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
-			registry.addContextType(TemplateContextTypeIdsXML.ALL);
-			registry.addContextType(TemplateContextTypeIdsXML.NEW);
-			registry.addContextType(TemplateContextTypeIdsXML.TAG);
-			registry.addContextType(TemplateContextTypeIdsXML.ATTRIBUTE);
-			registry.addContextType(TemplateContextTypeIdsXML.ATTRIBUTE_VALUE);
-
-			fContextTypeRegistry = registry;
-		}
-
-		return fContextTypeRegistry;
-	}
-	/**
-	   * Get an image from the registry. 
-	   * 
-	   * *This method is used by the referencingfile dialog and should be 
-	   *  removed when the dialog is moved to anothercomponent.
-	   * 
-	   * @param imageName The name of the image.
-	   * @return The image registered for the given name.
-	   */
-	public Image getImage(String imageName){
-	    return getWorkbench().getSharedImages().getImage(imageName);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties
deleted file mode 100644
index fed4031..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties
+++ /dev/null
@@ -1,316 +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
-#
-###############################################################################
-## The following line is a sample XML document.  Please translate only the following parts:
-## begin color definitions
-## Normal text content.
-Sample_XML_doc=<?xml version=\"1.0\"?>\n<?customProcessingInstruction\n\tXML processor specific\n\tcontent ?>\n<!DOCTYPE colors\n\tPUBLIC \"//IBM/XML/COLORS/\" \"colors.dtd\">\n<colors>\n\t<!-- begin color definitions -->\n\t<color name=\"plaintext\" foreground=\"#000000\"\n\t\tbackground=\"#D4D0C8\" />\n\t<color name=\"bold\" foreground=\"#000000\"\n\t\tbackground=\"#B3ACA0\" />\n\t<![CDATA[<123456789>]]>\n\tNormal text content.\n\t<color name=\"inverse\" foreground=\"#F0F0F0\"\n\t\tbackground=\"#D4D0C8\" />\n\n</colors>\n
-Comment_Delimiters_UI_=Comment Delimiters
-Comment_Content_UI_=Comment Content
-Tag_Delimiters_UI_=Tag Delimiters
-Tag_Names_UI_=Tag Names
-Attribute_Names_UI_=Attribute Names
-Attribute_Values_UI_=Attribute Values
-Declaration_Delimiters_UI_=Declaration Delimiters
-Content_UI_=Content
-## on the following 2 lines, do not translate CDATA
-CDATA_Delimiters_UI_=CDATA Delimiters
-CDATA_Content_UI_=CDATA Content
-Processing_Instruction_Del_UI_=Processing Instruction Delimiters
-Processing_Instruction_Con_UI__UI_=Processing Instruction Content
-## on the following line solely translate:  Name
-DOCTYPE_Name_UI_=DOCTYPE Name
-## on the following line solely translate:  Keyword
-DOCTYPE_SYSTEM_PUBLIC_Keyw_UI_=DOCTYPE SYSTEM/PUBLIC Keyword
-## on the following line solely translate:  Public Reference
-DOCTYPE_Public_Reference_UI_=DOCTYPE Public Reference
-## on the following line solely translate:  System Reference
-DOCTYPE_System_Reference_UI_=DOCTYPE System Reference
-# XML Common UI
-# Constants for strings
-
-DELETE=Remove
-ADD_PROCESSING_INSTRUCTION=Add Processing Instruction
-
-_UI_MENU_ADD_AFTER=Add &After
-_UI_MENU_ADD_ATTRIBUTE=Add A&ttribute
-_UI_MENU_ADD_BEFORE=Add &Before
-_UI_MENU_ADD_CHILD=Add &Child
-_UI_MENU_REMOVE=Re&move
-_UI_MENU_REPLACE_WITH=Re&place With
-_UI_MENU_EDIT_DOCTYPE=Edit DOCTYPE...
-_UI_LABEL_UNDO_REPLACE_DESCRIPTION=Replace
-_UI_LABEL_EDIT_DOCTYPE=Edit DOCTYPE
-_UI_INFO_EXPAND_ALL=Expand All
-_UI_INFO_COLLAPSE_ALL=Collapse All
-
-_UI_MENU_ADD_DTD_INFORMATION=Add DTD Information...
-_UI_MENU_ADD_SCHEMA_INFORMATION=Add Schema Information...
-_UI_MENU_EDIT_PROCESSING_INSTRUCTION=Edit Process&ing Instruction...
-_UI_MENU_EDIT_NAMESPACES=Edit &Namespaces...
-
-_UI_MENU_ADD_DTD_INFORMATION_TITLE=Add DTD Information
-_UI_MENU_EDIT_PROCESSING_INSTRUCTION_TITLE=Edit Processing Instruction
-_UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE=Edit Schema Information
-
-_UI_MENU_NEW_ATTRIBUTE=&New Attribute...
-_UI_MENU_NEW_ATTRIBUTE_TITLE=New Attribute
-_UI_MENU_EDIT_ATTRIBUTE=Edit Attribute...
-_UI_MENU_EDIT_ATTRIBUTE_TITLE=Edit Attribute
-_UI_MENU_NEW_ELEMENT=New &Element...
-_UI_MENU_NEW_ELEMENT_TITLE=New Element
-_UI_MENU_RENAME=R&ename
-_UI_MENU_RENAME_TITLE=Rename
-_UI_LABEL_ELEMENT_NAME=Element name:
-
-_UI_MENU_ADD_COMMENT=Add Comment
-_UI_MENU_ADD_PROCESSING_INSTRUCTION=Add Processing Instruction
-_UI_MENU_ADD_CDATA_SECTION=Add CDATA Section
-_UI_MENU_ADD_PCDATA=Add #PCDATA;
-
-_UI_MENU_COMMENT=C&omment
-_UI_MENU_PROCESSING_INSTRUCTION=P&rocessing Instruction
-_UI_MENU_CDATA_SECTION=CDATA Section
-_UI_MENU_PCDATA=#PC&DATA;
-
-_UI_MENU_ADD=Add
-
-_UI_COMMENT_VALUE=comment
-_UI_PI_TARGET_VALUE=target
-_UI_PI_DATA_VALUE=data
-_UI_LABEL_ROOT_ELEMENT_VALUE=RootElement
-
-_UI_LABEL_TARGET_COLON=Target:
-_UI_LABEL_DATA_COLON=Data:
-_UI_LABEL_ROOT_ELEMENT_NAME_COLON=Root element name:
-_UI_LABEL_PUBLIC_ID_COLON=Public ID:
-_UI_LABEL_SYSTEM_ID_COLON=System ID:
-_UI_LABEL_BROWSE=Browse...
-_UI_LABEL_SELECT_XML_CATALOG_ENTRY=Select XML Catalog Entry
-_UI_LABEL_SPECIFY_SYSTEM_ID=Specify System ID
-_UI_LABEL_SELECT_FILE=Select File
-
-_UI_LABEL_KEY=Key
-_UI_LABEL_URI=URI:
-_UI_LABEL_XML_CATALOG_COLON=XML Catalog
-_UI_LABEL_NAMESPACE_NAME=Namespace Name
-_UI_LABEL_LOCATION_HINT=Location Hint
-_UI_LABEL_PREFIX=Prefix
-_UI_LABEL_NAMESPACE_NAME_COLON=Namespace Name:
-_UI_LABEL_LOCATION_HINT_COLON=Location Hint:
-_UI_LABEL_PREFIX_COLON=Prefix:
-_UI_NO_NAMESPACE_NAME=<no namespace name>
-_UI_NO_PREFIX=<no prefix>
-
-_UI_LABEL_XML_SCHEMA_INFORMATION=XML Schema Information
-
-_UI_LABEL_NAME_COLON=Name:
-_UI_LABEL_VALUE_COLON=Value:
-
-_UI_BUTTON_DELETE=Delete
-_UI_BUTTON_NEW=New...
-_UI_BUTTON_EDIT=Edit...
-
-_UI_LABEL_NEW_NAMESPACE_INFORMATION=New Namespace Information
-
-# SelectFileOrXMLCatalogIdPanel.java
-
-_UI_RADIO_BUTTON_SELECT_FROM_WORKSPACE=Select file from workbench
-_UI_RADIO_BUTTON_SELECT_FROM_CATALOG=Select XML Catalog entry
-
-_UI_WARNING_MORE_THAN_ONE_NS_WITH_NAME=More than one namespace has been specified with the namespace name :
-_UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_NAME=More than one schema has been specified without a namespace name
-_UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_PREFIX=More than one namespace has been specificed without a prefix
-_UI_WARNING_MORE_THAN_ONE_NS_WITH_PREFIX=More than one namespace has been specified with the prefix :
-_UI_WARNING_SCHEMA_CAN_NOT_BE_LOCATED=The specified schema can not be located :
-_UI_WARNING_LOCATION_HINT_NOT_SPECIFIED=A location hint has not been specified for the namespace with name
-_UI_WARNING_NAMESPACE_NAME_NOT_SPECIFIED=A name must be specified for the namespace with prefix :
-_UI_WARNING_PREFIX_NOT_SPECIFIED=A prefix must be specified for the namespace named :
-_UI_WARNING_ROOT_ELEMENT_MUST_BE_SPECIFIED=A root element name must be specified.
-_UI_WARNING_SYSTEM_ID_MUST_BE_SPECIFIED=A system ID must be specified.
-
-_UI_INVALID_NAME=Invalid name
-
-# String used for editing namespaces (org.eclipse.wst.xml.ui.nsedit)
-_UI_ENTER_REQ_PREFIX_AND_NAMESPACE=Enter the required prefix and namespace URI for the namespace declaration.
-_UI_SELECT_REGISTERED_NAMESPACES=Select From Registered Namespaces
-_UI_SPECIFY_NEW_NAMESPACE=Specify New Namespace
-_UI_SELECT_NAMESPACE_TO_ADD=Select the namespace declarations to add.
-_UI_ADD_NAMESPACE_DECLARATIONS=Add Namespace Declarations
-_UI_NAMESPACE_DECLARATIONS=Namespace Declarations
-_UI_TARGET_NAMESPACE=Target Namespace
-
-_ERROR_XML_ATTRIBUTE_ALREADY_EXISTS=The element already has an attribute with this name.
-
-#
-error_message_goes_here=error message goes here
-SurroundWithNewElementQuickAssistProposal_0=Surround with new element
-SurroundWithNewElementQuickAssistProposal_1=Surround with new element
-RenameInFileQuickAssistProposal_0=Link all references for a rename in file (does not change references in other files)
-RenameInFileQuickAssistProposal_1=Rename in file
-InsertRequiredAttrsQuickAssistProposal_0=Insert required attributes
-InsertRequiredAttrsQuickAssistProposal_1=Insert required attributes
-EncodingSettings_0=IANA:
-EncodingSettings_1=Encoding:
-DragNodeCommand_0=Move
-DragNodeCommand_1=Copy
-CommonEditNamespacesDialog_0=Add...
-JFaceNodeAdapter_1=Refresh Property Sheet
-QuickFixProcessorXML_0=Remove empty tag
-QuickFixProcessorXML_1=Change to empty-element tag
-QuickFixProcessorXML_2=Remove this tag
-QuickFixProcessorXML_3=Insert end tag before first child element
-QuickFixProcessorXML_4=Insert end tag at end of element
-QuickFixProcessorXML_5=Remove attributes in end tag
-QuickFixProcessorXML_6=Insert default attribute value
-QuickFixProcessorXML_7=Remove this attribute
-QuickFixProcessorXML_8=Remove spaces before tag name
-QuickFixProcessorXML_9=Remove spaces before processing instruction
-QuickFixProcessorXML_10=Remove namespace in processing instruction
-QuickFixProcessorXML_11=Remove this element
-QuickFixProcessorXML_12=Remove this attribute value
-QuickFixProcessorXML_13=Insert required attribute
-QuickFixProcessorXML_14=Quote attribute value
-QuickFixProcessorXML_15=Insert closing bracket
-XMLPropertySourceAdapter_0=Attributes
-
-WorkbenchDefaultEncodingSettings_0=Use workbench encoding
-refreshoutline_0=Refreshing Outline
-Creating_files_encoding=Creating files encoding preference
-# ReconcileStepForMarkup
-End_tag_has_attributes=End tag has attributes
-Attribute__is_missing_a_value=Attribute \"{0}\" is missing a value
-Attribute__has_no_value=Attribute \"{0}\"  has no value
-Missing_end_tag_=Missing end tag \"{0}\"
-ReconcileStepForMarkup_0=Missing closing quote
-ReconcileStepForMarkup_1=Missing quotes for attribute value
-ReconcileStepForMarkup_2=A tagname cannot start with a space
-ReconcileStepForMarkup_3=Empty tags are not allowed
-ReconcileStepForMarkup_4=Namespaces are not allowed in a Processing Instruction target
-ReconcileStepForMarkup_5=Spaces are not allowed before a Processing Instruction
-ReconcileStepForMarkup_6=Tag missing closing bracket '>'
-# Content Assist
-End_with_=End with {0}>
-SEVERE_internal_error_occu_UI_=SEVERE internal error occurred
-No_known_attribute__UI_=No known attribute
-Content_Assist_not_availab_UI_=Content Assist not available at the current location
-Element__is_unknown=Element <{0}> is unknown.
-Comment__=comment {0}
-Close_with__=Close with {0}
-End_with__=End with \"</{0}>\"
-Close_with___=Close with \"{0}\"
-Close_with____=Close with \"></{0}>\"
-_Has_no_available_child={0} has no available child tags.
-No_known_child_tag=No known child tag names of <{0}> begin with \"{1}\".
-__Has_no_known_child=<{0}> has no known child tags.
-No_known_child_tag_names=No known child tag names of <{0}> begin with \"{1}\"
-The_document_element__=The document element <{0}> is already present.
-No_definition_for_in=No definition was found for element <{0}> in {1}
-No_definition_for=No definition was found for element <{0}>
-No_content_model_for=No content model found for {0}.
-No_content_model_found_UI_=No content model found
-## The following strings are for the XML Cleanup dialog
-Cleanup_UI_=Cleanup
-Compress_empty_element_tags_UI_=&Compress empty element tags
-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
-## XML Files preference page
-Creating_files=Creating files
-Encoding_desc=The following encoding will apply:
-Encoding=En&coding:
-Creating_or_saving_files=Creating or saving files
-End_of_line_code_desc=The following line delimiter will apply:
-End_of_line_code=&Line delimiter:
-EOL_Windows=Windows
-EOL_Unix=UNIX
-EOL_Mac=Mac
-EOL_NoTranslation=No translation
-## XML Source preference page
-Content_assist_UI_=Content assist
-Automatically_make_suggest_UI_=Automatically ma&ke suggestions
-Prompt_when_these_characte_UI_=P&rompt when these characters are inserted:
-Formatting_UI_=Formatting
-Line_width__UI_=Line &width:
-Split_multiple_attributes=Split &multiple attributes each on a new line
-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
-Grammar_Constraints=Grammar Constraints
-Use_inferred_grammar_in_absence_of=Use inferred grammar in absence of DTD/Schema
-Suggestion_Strategy=&Suggestion strategy:
-Suggestion_Strategy_Lax=Lax
-Suggestion_Strategy_Strict=Strict
-## tag info
-Element____1=Element :
-Content_Model____2=Content Model :
-Attribute____3=Attribute :
-Data_Type____4=Data Type :
-Enumerated_Values____5=Enumerated Values :
-## copied from sse.ui
-FormatMenu_label=F&ormat
-SourceMenu_label=&Source
-Comment_label=Co&mment
-Comment_tooltip=Comment
-Comment_description=Comment
-Uncomment_label=&Uncomment
-Uncomment_tooltip=Uncomment
-Uncomment_description=Uncomment
-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
-CleanupDocument_label=Cleanup Document...
-CleanupDocument_tooltip=Cleanup Document
-CleanupDocument_description=Cleanup Document
-FindOccurrences_label=Occurrences in File
-ShowTooltipDesc_label=Show &Tooltip Description
-ShowTooltipDesc_tooltip=Displays the hover help for the selected element
-ShowTooltipDesc_description=Displays the hover help for the selected element
-ContentAssistProposals_label=Con&tent Assist
-ContentAssistProposals_tooltip=Content Assist
-ContentAssistProposals_description=Content Assist
-QuickFix_label=&Quick Fix
-QuickFix_tooltip=Quick Fix
-QuickFix_description=Quick Fix
-FormatDocument_label=&Document
-FormatDocument_tooltip=Format Document
-FormatDocument_description=Format Document
-FormatActiveElements_label=Act&ive Elements
-FormatActiveElements_tooltip=Format Active Elements
-FormatActiveElements_description=Format Active Elements
-OpenFileFromSource_label=Op&en Selection
-OpenFileFromSource_tooltip=Open an editor on the selected link
-OpenFileFromSource_description=Open an editor on the selected link
-XMLContentOutlineConfiguration_0=Show Attributes
-StructureSelectEnclosing_label=Enclosing Element
-StructureSelectEnclosing_tooltip=Expand selection to include enclosing element
-StructureSelectEnclosing_description=Expand selection to include enclosing element
-StructureSelectNext_label=Next Element
-StructureSelectNext_tooltip=Expand selection to include next sibling
-StructureSelectNext_description=Expand selection to include next sibling
-StructureSelectPrevious_label=Previous Element
-StructureSelectPrevious_tooltip=Expand selection to include previous sibling
-StructureSelectPrevious_description=Expand selection to include previous sibling
-MESSAGE_XML_VALIDATION_MESSAGE_UI_=XML Validator validating {0}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractCommentActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractCommentActionXMLDelegate.java
deleted file mode 100644
index 13eee15..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractCommentActionXMLDelegate.java
+++ /dev/null
@@ -1,115 +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.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-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.xml.ui.internal.Logger;
-
-/**
- * Abstract comment action delegate for XML editors
- */
-abstract public class AbstractCommentActionXMLDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
-	static final String CLOSE_COMMENT = "-->"; //$NON-NLS-1$
-	static final String OPEN_COMMENT = "<!--"; //$NON-NLS-1$
-
-	IEditorPart fEditor;
-
-	public void setActiveEditor(IAction action, IEditorPart targetEditor) {
-		fEditor = targetEditor;
-	}
-
-	public void dispose() {
-		// nulling out just in case
-		fEditor = null;
-	}
-
-	public void runWithEvent(IAction action, Event event) {
-		run(action);
-	}
-
-	public void run(IAction action) {
-		if (fEditor instanceof ITextEditor) {
-			ITextEditor textEditor = (ITextEditor) fEditor;
-			IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
-			if (document != null) {
-				// get current text selection
-				ITextSelection textSelection = getCurrentSelection();
-				if (textSelection.isEmpty())
-					return;
-
-				processAction(document, textSelection);
-			}
-		}
-	}
-
-	public void init(IViewPart view) {
-		// do nothing
-	}
-
-	public void selectionChanged(IAction action, ISelection selection) {
-		// do nothing
-	}
-
-	private ITextSelection getCurrentSelection() {
-		if (fEditor instanceof ITextEditor) {
-			ISelectionProvider provider = ((ITextEditor) fEditor).getSelectionProvider();
-			if (provider != null) {
-				ISelection selection = provider.getSelection();
-				if (selection instanceof ITextSelection)
-					return (ITextSelection) selection;
-			}
-		}
-		return TextSelection.emptySelection();
-	}
-
-	abstract void processAction(IDocument document, ITextSelection textSelection);
-
-	void removeOpenCloseComments(IDocument document, int offset, int length) {
-		try {
-			int adjusted_length = length;
-
-			// remove open comments
-			String string = document.get(offset, length);
-			int index = string.lastIndexOf(OPEN_COMMENT);
-			while (index != -1) {
-				document.replace(offset + index, OPEN_COMMENT.length(), ""); //$NON-NLS-1$
-				index = string.lastIndexOf(OPEN_COMMENT, index - 1);
-				adjusted_length -= OPEN_COMMENT.length();
-			}
-
-			// remove close comments
-			string = document.get(offset, adjusted_length);
-			index = string.lastIndexOf(CLOSE_COMMENT);
-			while (index != -1) {
-				document.replace(offset + index, CLOSE_COMMENT.length(), ""); //$NON-NLS-1$
-				index = string.lastIndexOf(CLOSE_COMMENT, index - 1);
-			}
-		}
-		catch (BadLocationException e) {
-			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractNodeActionManager.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractNodeActionManager.java
deleted file mode 100644
index 10bb371..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractNodeActionManager.java
+++ /dev/null
@@ -1,667 +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.ui.internal.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-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.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDescriptionBuilder;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilder;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilderImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.CMImageUtil;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-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;
-import org.w3c.dom.ProcessingInstruction;
-
-public abstract class AbstractNodeActionManager extends BaseNodeActionManager {
-
-
-	/**
-	 * AddNodeAction
-	 */
-	public class AddNodeAction extends NodeAction {
-		protected CMNode cmnode;
-		protected String description;
-		protected int index;
-		protected int nodeType;
-		protected Node parent;
-		protected String undoDescription;
-
-
-		public AddNodeAction(CMNode cmnode, Node parent, int index) {
-			this.cmnode = cmnode;
-			this.parent = parent;
-			this.index = index;
-
-			String text = getLabel(parent, cmnode);
-			setText(text);
-			description = text;
-			undoDescription = XMLUIMessages._UI_MENU_ADD + " " + text; //$NON-NLS-1$ //$NON-NLS-2$
-			ImageDescriptor descriptor = CMImageUtil.getImageDescriptor(cmnode);
-			if (descriptor == null) {
-				descriptor = imageDescriptorCache.getImageDescriptor(cmnode);
-			}
-			setImageDescriptor(descriptor);
-		}
-
-
-		public AddNodeAction(int nodeType, Node parent, int index) {
-			this.nodeType = nodeType;
-			this.index = index;
-			this.parent = parent;
-
-			switch (nodeType) {
-				case Node.COMMENT_NODE : {
-					description = XMLUIMessages._UI_MENU_COMMENT; //$NON-NLS-1$
-					undoDescription = XMLUIMessages._UI_MENU_ADD_COMMENT; //$NON-NLS-1$
-					break;
-				}
-				case Node.PROCESSING_INSTRUCTION_NODE : {
-					description = XMLUIMessages._UI_MENU_PROCESSING_INSTRUCTION; //$NON-NLS-1$
-					undoDescription = XMLUIMessages._UI_MENU_ADD_PROCESSING_INSTRUCTION; //$NON-NLS-1$
-					break;
-				}
-				case Node.CDATA_SECTION_NODE : {
-					description = XMLUIMessages._UI_MENU_CDATA_SECTION; //$NON-NLS-1$
-					undoDescription = XMLUIMessages._UI_MENU_ADD_CDATA_SECTION; //$NON-NLS-1$
-					break;
-				}
-				case Node.TEXT_NODE : {
-					description = XMLUIMessages._UI_MENU_PCDATA; //$NON-NLS-1$
-					undoDescription = XMLUIMessages._UI_MENU_ADD_PCDATA; //$NON-NLS-1$
-					break;
-				}
-			}
-			setText(description);
-			setImageDescriptor(imageDescriptorCache.getImageDescriptor(new Integer(nodeType)));
-		}
-
-
-		protected void addNodeForCMNode() {
-			if (parent != null) {
-				insert(parent, cmnode, index);
-			}
-		}
-
-
-		protected void addNodeForNodeType() {
-			Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
-			Node newChildNode = null;
-			boolean format = true;
-			switch (nodeType) {
-				case Node.COMMENT_NODE : {
-					newChildNode = document.createComment(XMLUIMessages._UI_COMMENT_VALUE); //$NON-NLS-1$
-					break;
-				}
-				case Node.PROCESSING_INSTRUCTION_NODE : {
-					newChildNode = document.createProcessingInstruction(XMLUIMessages._UI_PI_TARGET_VALUE, XMLUIMessages._UI_PI_DATA_VALUE); //$NON-NLS-1$ //$NON-NLS-2$
-					break;
-				}
-				case Node.CDATA_SECTION_NODE : {
-					newChildNode = document.createCDATASection(""); //$NON-NLS-1$
-					break;
-				}
-				case Node.TEXT_NODE : {
-					format = false;
-					newChildNode = document.createTextNode(parent.getNodeName());
-					break;
-				}
-			}
-
-			if (newChildNode != null) {
-				List list = new Vector(1);
-				list.add(newChildNode);
-				insertNodesAtIndex(parent, list, index, format);
-			}
-		}
-
-
-		public String getUndoDescription() {
-			return undoDescription;
-		}
-
-
-		public void run() {
-			beginNodeAction(this);
-			if (cmnode != null) {
-				addNodeForCMNode();
-			} else {
-				addNodeForNodeType();
-			}
-			endNodeAction(this);
-		}
-	}
-
-
-	/**
-	 * DeleteAction
-	 */
-	public class DeleteAction extends NodeAction {
-		protected List list;
-
-		public DeleteAction(List list) {
-			setText(XMLUIMessages._UI_MENU_REMOVE); //$NON-NLS-1$
-			this.list = list;
-		}
-
-		public DeleteAction(Node node) {
-			setText(XMLUIMessages._UI_MENU_REMOVE); //$NON-NLS-1$
-			list = new Vector();
-			list.add(node);
-		}
-
-		public String getUndoDescription() {
-			return XMLUIMessages.DELETE; //$NON-NLS-1$
-		}
-
-		public void run() {
-			beginNodeAction(this);
-
-			for (Iterator i = list.iterator(); i.hasNext();) {
-				Node node = (Node) i.next();
-				if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
-					Attr attr = (Attr) node;
-					attr.getOwnerElement().removeAttributeNode(attr);
-				} else {
-					Node parent = node.getParentNode();
-					if (parent != null) {
-						Node previousSibling = node.getPreviousSibling();
-						if (previousSibling != null && isWhitespaceTextNode(previousSibling)) {
-							parent.removeChild(previousSibling);
-						}
-						parent.removeChild(node);
-					}
-				}
-			}
-
-			endNodeAction(this);
-		}
-	}
-
-
-	class ImageDescriptorCache {
-		protected ImageDescriptor attributeImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
-		protected ImageDescriptor attributeReqImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ATT_REQ_OBJ);
-		protected ImageDescriptor cdataSectionImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_CDATASECTION);
-		protected ImageDescriptor commentImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_COMMENT);
-		protected ImageDescriptor elementImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ELEMENT);
-		protected ImageDescriptor piImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_PROCESSINGINSTRUCTION);
-		protected ImageDescriptor textImage = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_TXTEXT);
-
-		public ImageDescriptor getImageDescriptor(Object object) {
-			ImageDescriptor result = null;
-			if (object instanceof CMNode) {
-				CMNode cmnode = (CMNode) object;
-				switch (cmnode.getNodeType()) {
-					case CMNode.ATTRIBUTE_DECLARATION : {
-						result = CMImageUtil.getImageDescriptor(cmnode);
-						if (result == null)
-							if (((CMAttributeDeclaration) cmnode).getUsage() == CMAttributeDeclaration.REQUIRED)
-								result = attributeReqImage;
-							else
-								result = attributeImage;
-						break;
-					}
-					case CMNode.DATA_TYPE : {
-						result = textImage;
-						break;
-					}
-					case CMNode.ELEMENT_DECLARATION : {
-						result = CMImageUtil.getImageDescriptor(cmnode);
-						if (result == null)
-							result = elementImage;
-						break;
-					}
-					case CMNode.GROUP : {
-						result = elementImage;
-						break;
-					}
-				}
-			} else if (object instanceof Integer) {
-				Integer integer = (Integer) object;
-				switch (integer.intValue()) {
-					case Node.COMMENT_NODE : {
-						result = commentImage;
-						break;
-					}
-					case Node.PROCESSING_INSTRUCTION_NODE : {
-						result = piImage;
-						break;
-					}
-					case Node.CDATA_SECTION_NODE : {
-						result = cdataSectionImage;
-						break;
-					}
-					case Node.TEXT_NODE : {
-						result = textImage;
-						break;
-					}
-				}
-			}
-			return result;
-		}
-	}
-
-	// TODO... remove this class. I'm pretty sure it is no longer used by
-	// anyone.
-	/**
-	 * @depracated
-	 */
-	public class InsertAction extends NodeAction {
-		protected String description;
-		protected int index;
-		protected int nodeType;
-		protected Node parent;
-
-		public InsertAction(int nodeType, Node parent, int index) {
-			this.nodeType = nodeType;
-			this.index = index;
-			this.parent = parent;
-			switch (nodeType) {
-				case Node.COMMENT_NODE : {
-					description = XMLUIMessages._UI_MENU_COMMENT; //$NON-NLS-1$
-					break;
-				}
-				case Node.PROCESSING_INSTRUCTION_NODE : {
-					description = XMLUIMessages._UI_MENU_PROCESSING_INSTRUCTION; //$NON-NLS-1$
-					break;
-				}
-				case Node.CDATA_SECTION_NODE : {
-					description = XMLUIMessages._UI_MENU_CDATA_SECTION; //$NON-NLS-1$
-					break;
-				}
-				case Node.TEXT_NODE : {
-					description = XMLUIMessages._UI_MENU_PCDATA; //$NON-NLS-1$
-					break;
-				}
-			}
-			setText(description);
-			setImageDescriptor(imageDescriptorCache.getImageDescriptor(new Integer(nodeType)));
-		}
-
-		public InsertAction(int nodeType, Node parent, int index, String title) {
-			this.nodeType = nodeType;
-			this.index = index;
-			this.parent = parent;
-			description = title;
-			setText(description);
-			setImageDescriptor(imageDescriptorCache.getImageDescriptor(new Integer(nodeType)));
-		}
-
-		public String getUndoDescription() {
-			return XMLUIMessages._UI_MENU_ADD + " " + description; //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		public void run() {
-			beginNodeAction(this);
-
-			Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
-			Node newChildNode = null;
-			boolean format = true;
-			switch (nodeType) {
-				case Node.COMMENT_NODE : {
-					newChildNode = document.createComment(XMLUIMessages._UI_COMMENT_VALUE); //$NON-NLS-1$
-					break;
-				}
-				case Node.PROCESSING_INSTRUCTION_NODE : {
-					newChildNode = document.createProcessingInstruction(XMLUIMessages._UI_PI_TARGET_VALUE, XMLUIMessages._UI_PI_DATA_VALUE); //$NON-NLS-1$ //$NON-NLS-2$
-					break;
-				}
-				case Node.CDATA_SECTION_NODE : {
-					newChildNode = document.createCDATASection(""); //$NON-NLS-1$
-					break;
-				}
-				case Node.TEXT_NODE : {
-					format = false;
-					newChildNode = document.createTextNode(parent.getNodeName());
-					break;
-				}
-			}
-
-			if (newChildNode != null) {
-				List list = new Vector(1);
-				list.add(newChildNode);
-				insertNodesAtIndex(parent, list, index, format);
-			}
-
-			endNodeAction(this);
-		}
-	}
-
-
-	/**
-	 * ReplaceNodeAction
-	 */
-	public class ReplaceNodeAction extends NodeAction {
-		protected CMNode cmnode;
-		protected String description;
-		protected int endIndex;
-		protected Node parent;
-		protected int startIndex;
-
-
-		public ReplaceNodeAction(Node parent, CMNode cmnode, int startIndex, int endIndex) {
-			this.parent = parent;
-			this.cmnode = cmnode;
-			this.startIndex = startIndex;
-			this.endIndex = endIndex;
-
-			setText(getLabel(parent, cmnode));
-			setImageDescriptor(imageDescriptorCache.getImageDescriptor(cmnode));
-		}
-
-		public String getUndoDescription() {
-			String result = XMLUIMessages._UI_LABEL_UNDO_REPLACE_DESCRIPTION; //$NON-NLS-1$
-			result += " " + getLabel(parent, cmnode); //$NON-NLS-1$
-			return result;
-		}
-
-		public void run() {
-			beginNodeAction(this);
-
-			if (parent != null && cmnode != null) {
-				remove(parent, startIndex, endIndex);
-				insert(parent, cmnode, startIndex);
-			}
-			endNodeAction(this);
-		}
-	}
-
-	protected ImageDescriptorCache imageDescriptorCache = new ImageDescriptorCache();
-	protected Viewer fViewer;
-
-	public AbstractNodeActionManager(IStructuredModel model, ModelQuery modelQuery, Viewer viewer) {
-		super(model, modelQuery);
-		this.fViewer = viewer;
-	}
-
-
-	public void beginNodeAction(NodeAction action) {
-		fModel.beginRecording(action, action.getUndoDescription());
-	}
-
-
-	protected Action createAddAttributeAction(Element parent, CMAttributeDeclaration ad) {
-		Action action = null;
-		if (ad == null) {
-			action = new EditAttributeAction(this, parent, null, XMLUIMessages._UI_MENU_NEW_ATTRIBUTE, XMLUIMessages._UI_MENU_NEW_ATTRIBUTE_TITLE); //$NON-NLS-1$ //$NON-NLS-2$
-		} else {
-			action = new AddNodeAction(ad, parent, -1);
-		}
-		return action;
-	}
-
-
-	protected Action createAddCDataSectionAction(Node parent, int index) {
-		return new AddNodeAction(Node.CDATA_SECTION_NODE, parent, index);
-	}
-
-
-	protected Action createAddCommentAction(Node parent, int index) {
-		return new AddNodeAction(Node.COMMENT_NODE, parent, index);
-	}
-
-
-	protected Action createAddDoctypeAction(Document document, int index) {
-		return new EditDoctypeAction(fModel, document, fModel.getBaseLocation(), XMLUIMessages._UI_MENU_ADD_DTD_INFORMATION); //$NON-NLS-1$
-	}
-
-
-	protected Action createAddElementAction(Node parent, CMElementDeclaration ed, int index) {
-		Action action = null;
-		if (ed == null) {
-			action = new EditElementAction(this, parent, index, XMLUIMessages._UI_MENU_NEW_ELEMENT, XMLUIMessages._UI_MENU_NEW_ELEMENT_TITLE); //$NON-NLS-1$ //$NON-NLS-2$
-		} else {
-			action = new AddNodeAction(ed, parent, index);
-		}
-		return action;
-	}
-
-
-	protected Action createAddPCDataAction(Node parent, CMDataType dataType, int index) {
-		Action action = null;
-		if (dataType == null) {
-			action = new AddNodeAction(Node.TEXT_NODE, parent, index);
-		} else {
-			action = new AddNodeAction(dataType, parent, index);
-		}
-		return action;
-	}
-
-
-	protected Action createAddProcessingInstructionAction(Node parent, int index) {
-		Node refChild = getRefChildNodeAtIndex(parent, index);
-		Action action = new EditProcessingInstructionAction(this, parent, refChild, XMLUIMessages._UI_MENU_ADD_PROCESSING_INSTRUCTION, XMLUIMessages.ADD_PROCESSING_INSTRUCTION); //$NON-NLS-1$ //$NON-NLS-2$
-		action.setImageDescriptor(imageDescriptorCache.getImageDescriptor(new Integer(Node.PROCESSING_INSTRUCTION_NODE)));
-		return action;
-	}
-
-
-	protected Action createAddSchemaInfoAction(Element element) {
-		return new EditSchemaInfoAction(this, element.getOwnerDocument(), fModel.getBaseLocation(), XMLUIMessages._UI_MENU_ADD_SCHEMA_INFORMATION); //$NON-NLS-1$
-	}
-
-
-	protected Action createDeleteAction(List selection) {
-		DeleteAction deleteAction = new DeleteAction(selection);
-		deleteAction.setEnabled(selection.size() > 0);
-		return deleteAction;
-	}
-
-
-	public DOMContentBuilder createDOMContentBuilder(Document document) {
-		DOMContentBuilderImpl builder = new DOMContentBuilderImpl(document);
-		return builder;
-	}
-
-
-	protected Action createEditAttributeAction(Attr attr, CMAttributeDeclaration ad) {
-		return new EditAttributeAction(this, attr.getOwnerElement(), attr, XMLUIMessages._UI_MENU_EDIT_ATTRIBUTE, XMLUIMessages._UI_MENU_EDIT_ATTRIBUTE_TITLE); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-
-	protected Action createEditDoctypeAction(DocumentType doctype) {
-		return new EditDoctypeAction(fModel, doctype, fModel.getBaseLocation(), XMLUIMessages._UI_MENU_EDIT_DOCTYPE); //$NON-NLS-1$
-	}
-
-
-	protected Action createEditProcessingInstructionAction(ProcessingInstruction pi) {
-		return new EditProcessingInstructionAction(this, pi, XMLUIMessages._UI_MENU_EDIT_PROCESSING_INSTRUCTION, XMLUIMessages._UI_MENU_EDIT_PROCESSING_INSTRUCTION_TITLE); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-
-	protected Action createEditSchemaInfoAction(Element element) {
-		return new EditSchemaInfoAction(this, element.getOwnerDocument(), fModel.getBaseLocation(), XMLUIMessages._UI_MENU_EDIT_NAMESPACES); //$NON-NLS-1$
-	}
-
-
-	protected Action createRenameAction(Node node) {
-		Action result = null;
-		if (node instanceof Element) {
-			result = new EditElementAction(this, (Element) node, XMLUIMessages._UI_MENU_RENAME, XMLUIMessages._UI_MENU_RENAME_TITLE); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		return result;
-	}
-
-
-	protected Action createReplaceAction(Node parent, CMNode cmnode, int startIndex, int endIndex) {
-		return new ReplaceNodeAction(parent, cmnode, startIndex, endIndex);
-	}
-
-	public void endNodeAction(NodeAction action) {
-		fModel.endRecording(action);
-	}
-
-
-
-	public void fillContextMenu(IMenuManager menuManager, ISelection selection) {
-		try {
-			List selectionList = new ArrayList();
-			if (selection instanceof IStructuredSelection) {
-				IStructuredSelection es = (IStructuredSelection) selection;
-				for (Iterator i = es.iterator(); i.hasNext();) {
-					selectionList.add(i.next());
-				}
-			}
-
-			contributeActions(menuManager, selectionList);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-
-	/**
-	 *  
-	 */
-	public String getLabel(Node parent, CMNode cmnode) {
-		String result = "?" + cmnode + "?"; //$NON-NLS-1$ //$NON-NLS-2$
-		if (cmnode != null) {
-			result = (String) cmnode.getProperty("description"); //$NON-NLS-1$
-			if (result == null) {
-				if (cmnode.getNodeType() == CMNode.GROUP) {
-					CMDescriptionBuilder descriptionBuilder = new CMDescriptionBuilder();
-					result = descriptionBuilder.buildDescription(cmnode);
-				} else {
-					result = DOMNamespaceHelper.computeName(cmnode, parent, null);
-				}
-			}
-		}
-		return result;
-	}
-
-
-	public IStructuredModel getModel() {
-		return fModel;
-	}
-
-
-	public Shell getWorkbenchWindowShell() {
-		return XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-	}
-
-
-	public void insert(Node parent, CMNode cmnode, int index) {
-		Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
-		DOMContentBuilder builder = createDOMContentBuilder(document);
-		builder.setBuildPolicy(DOMContentBuilder.BUILD_ONLY_REQUIRED_CONTENT);
-		builder.build(parent, cmnode);
-		insertNodesAtIndex(parent, builder.getResult(), index);
-	}
-
-
-	public void insertNodesAtIndex(Node parent, List list, int index) {
-		insertNodesAtIndex(parent, list, index, true);
-	}
-
-
-	public void insertNodesAtIndex(Node parent, List list, int index, boolean format) {
-		NodeList nodeList = parent.getChildNodes();
-		if (index == -1) {
-			index = nodeList.getLength();
-		}
-		Node refChild = (index < nodeList.getLength()) ? nodeList.item(index) : null;
-
-		// here we consider the case where the previous node is a 'white
-		// space' Text node
-		// we should really do the insert before this node
-		//
-		int prevIndex = index - 1;
-		Node prevChild = (prevIndex < nodeList.getLength()) ? nodeList.item(prevIndex) : null;
-		if (isWhitespaceTextNode(prevChild)) {
-			refChild = prevChild;
-		}
-
-		for (Iterator i = list.iterator(); i.hasNext();) {
-			Node newNode = (Node) i.next();
-
-			if (newNode.getNodeType() == Node.ATTRIBUTE_NODE) {
-				Element parentElement = (Element) parent;
-				parentElement.setAttributeNode((Attr) newNode);
-			} else {
-				parent.insertBefore(newNode, refChild);
-			}
-		}
-
-		boolean formatDeep = false;
-		for (Iterator i = list.iterator(); i.hasNext();) {
-			Node newNode = (Node) i.next();
-			if (newNode.getNodeType() == Node.ELEMENT_NODE) {
-				formatDeep = true;
-			}
-
-			if (format) {
-				reformat(newNode, formatDeep);
-			}
-		}
-
-		setViewerSelection(list);
-	}
-
-
-	/**
-	 * This method is abstract since currently, the sed editor is required to
-	 * perform formating and we don't want to create a dependency on the sed
-	 * editor.
-	 */
-	public abstract void reformat(Node parent, boolean deep);
-
-
-	public void remove(Node parent, int startIndex, int endIndex) {
-		NodeList nodeList = parent.getChildNodes();
-		for (int i = endIndex; i >= startIndex; i--) {
-			Node node = nodeList.item(i);
-			if (node != null) {
-				parent.removeChild(node);
-			}
-		}
-	}
-
-
-	public void setViewerSelection(List list) {
-		if (fViewer != null) {
-			fViewer.setSelection(new StructuredSelection(list), true);
-		}
-	}
-
-
-	public void setViewerSelection(Node node) {
-		if (fViewer != null) {
-			fViewer.setSelection(new StructuredSelection(node), true);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ActionContributorXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ActionContributorXML.java
deleted file mode 100644
index 6aaa8b1..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ActionContributorXML.java
+++ /dev/null
@@ -1,204 +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.ui.internal.actions;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-import org.eclipse.wst.sse.ui.internal.actions.ActionContributor;
-import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds;
-import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * XMLEditorActionContributor
- * 
- * 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 ActionContributorXML extends ActionContributor {
-	private static final String[] EDITOR_IDS = {"org.eclipse.core.runtime.xml.source", "org.eclipse.core.runtime.xml.source2", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-	protected RetargetTextEditorAction fCleanupDocument = null;
-	protected RetargetTextEditorAction fComment = null;
-	// tooltip
-	// action
-	protected RetargetTextEditorAction fContentAssist = null;
-	// action
-	protected RetargetTextEditorAction fFindOccurrences = null;
-	protected RetargetTextEditorAction fFormatActiveElements = null;
-	protected RetargetTextEditorAction fFormatDocument = null;
-	protected MenuManager fFormatMenu = null;
-	protected RetargetTextEditorAction fOpenFileAction = null; // open file
-	protected RetargetTextEditorAction fQuickFix = null;
-
-	protected RetargetTextEditorAction fShowTooltipAction = null; // show
-	protected RetargetTextEditorAction fUncomment = null;
-
-	public ActionContributorXML() {
-		super();
-
-		ResourceBundle resourceBundle = XMLUIMessages.getResourceBundle();
-
-		// edit commands
-		fShowTooltipAction = new RetargetTextEditorAction(resourceBundle, "");	//$NON-NLS-1$
-		fShowTooltipAction.setActionDefinitionId(ActionDefinitionIds.INFORMATION);
-
-		fContentAssist = new RetargetTextEditorAction(resourceBundle, "");	//$NON-NLS-1$
-		fContentAssist.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
-
-		fQuickFix = new RetargetTextEditorAction(resourceBundle, "");	//$NON-NLS-1$
-		fQuickFix.setActionDefinitionId(ActionDefinitionIds.QUICK_FIX);
-
-		// source commands
-		fCleanupDocument = new RetargetTextEditorAction(resourceBundle, "");	//$NON-NLS-1$
-		fCleanupDocument.setActionDefinitionId(ActionDefinitionIds.CLEANUP_DOCUMENT);
-
-		fFormatDocument = new RetargetTextEditorAction(resourceBundle, "");	//$NON-NLS-1$
-		fFormatDocument.setActionDefinitionId(ActionDefinitionIds.FORMAT_DOCUMENT);
-
-		fFormatActiveElements = new RetargetTextEditorAction(resourceBundle, "");	//$NON-NLS-1$
-		fFormatActiveElements.setActionDefinitionId(ActionDefinitionIds.FORMAT_ACTIVE_ELEMENTS);
-
-		fFormatMenu = new MenuManager(XMLUIMessages.FormatMenu_label);
-		fFormatMenu.add(fFormatDocument);
-		fFormatMenu.add(fFormatActiveElements);
-
-		// navigate commands
-		fOpenFileAction = new RetargetTextEditorAction(resourceBundle, "");	//$NON-NLS-1$
-		fOpenFileAction.setActionDefinitionId(ActionDefinitionIds.OPEN_FILE);
-
-		fFindOccurrences = new RetargetTextEditorAction(resourceBundle, "");	//$NON-NLS-1$
-		fFindOccurrences.setActionDefinitionId(ActionDefinitionIds.FIND_OCCURRENCES);
-	}
-
-	protected void addToMenu(IMenuManager menu) {
-		// edit commands
-		IMenuManager editMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
-		if (editMenu != null) {
-			editMenu.add(fCommandsSeparator);
-			editMenu.add(fToggleInsertModeAction);
-			editMenu.add(fCommandsSeparator);
-			editMenu.add(fExpandSelectionToMenu);
-			editMenu.add(fCommandsSeparator);
-			editMenu.add(fShowTooltipAction);
-			editMenu.add(fContentAssist);
-			editMenu.add(fQuickFix);
-			editMenu.add(fMenuAdditionsGroupMarker);
-		}
-
-		// source commands
-		String sourceMenuLabel = XMLUIMessages.SourceMenu_label;
-		String sourceMenuId = "sourceMenuId"; //$NON-NLS-1$
-		IMenuManager sourceMenu = new MenuManager(sourceMenuLabel, sourceMenuId);
-		menu.insertAfter(IWorkbenchActionConstants.M_EDIT, sourceMenu);
-		if (sourceMenu != null) {
-			sourceMenu.add(fCommandsSeparator);
-			sourceMenu.add(fToggleComment);
-			sourceMenu.add(fAddBlockComment);
-			sourceMenu.add(fRemoveBlockComment);
-			sourceMenu.add(fShiftRight);
-			sourceMenu.add(fShiftLeft);
-			sourceMenu.add(fCleanupDocument);
-			sourceMenu.add(fFormatMenu);
-			sourceMenu.add(fCommandsSeparator);
-			sourceMenu.add(fFindOccurrences);
-		}
-
-		// navigate commands
-		IMenuManager navigateMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE);
-		if (navigateMenu != null) {
-			navigateMenu.appendToGroup(IWorkbenchActionConstants.OPEN_EXT, fCommandsSeparator);
-			navigateMenu.appendToGroup(IWorkbenchActionConstants.OPEN_EXT, fOpenFileAction);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.edit.util.ActionContributor#getExtensionIDs()
-	 */
-	protected String[] getExtensionIDs() {
-		return EDITOR_IDS;
-	}
-
-	/**
-	 * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(IEditorPart)
-	 */
-	public void setActiveEditor(IEditorPart activeEditor) {
-		if (getActiveEditorPart() == activeEditor)
-			return;
-		super.setActiveEditor(activeEditor);
-
-		IActionBars actionBars = getActionBars();
-		if (actionBars != null) {
-			IStatusLineManager statusLineManager = actionBars.getStatusLineManager();
-			if (statusLineManager != null) {
-				statusLineManager.setMessage(null);
-				statusLineManager.setErrorMessage(null);
-			}
-		}
-
-		ITextEditor textEditor = getTextEditor(activeEditor);
-
-		fShowTooltipAction.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_INFORMATION));
-		fContentAssist.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS));
-		fQuickFix.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_QUICK_FIX));
-
-		fCleanupDocument.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT));
-		fFormatDocument.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT));
-		fFormatActiveElements.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS));
-		fCleanupDocument.setEnabled(textEditor != null && textEditor.isEditable());
-		fFormatDocument.setEnabled(textEditor != null && textEditor.isEditable());
-		fFormatActiveElements.setEnabled(textEditor != null && textEditor.isEditable());
-
-		fOpenFileAction.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE));
-
-		fFindOccurrences.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_FIND_OCCURRENCES));
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.ISourceViewerActionBarContributor#setViewerSpecificContributionsEnabled(boolean)
-	 */
-	public void setViewerSpecificContributionsEnabled(boolean enabled) {
-		super.setViewerSpecificContributionsEnabled(enabled);
-
-		fShowTooltipAction.setEnabled(enabled);
-		fContentAssist.setEnabled(enabled);
-		fQuickFix.setEnabled(enabled);
-		// cleanup and format document actions do not rely on source viewer
-		// being enabled
-		//		fCleanupDocument.setEnabled(enabled);
-		//		fFormatDocument.setEnabled(enabled);
-
-		fFormatActiveElements.setEnabled(enabled);
-		fOpenFileAction.setEnabled(enabled);
-		fFindOccurrences.setEnabled(enabled);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AddBlockCommentActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AddBlockCommentActionXMLDelegate.java
deleted file mode 100644
index b483aa0..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AddBlockCommentActionXMLDelegate.java
+++ /dev/null
@@ -1,82 +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.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-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.StructuredModelManager;
-import org.eclipse.wst.xml.core.internal.document.CommentImpl;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * Add block comment action delegate for XML editor
- */
-public class AddBlockCommentActionXMLDelegate extends AbstractCommentActionXMLDelegate {
-
-	public void init(IAction action) {
-		if (action != null) {
-			action.setText(XMLUIMessages.AddBlockComment_label);
-			action.setToolTipText(XMLUIMessages.AddBlockComment_tooltip);
-			action.setDescription(XMLUIMessages.AddBlockComment_description);
-		}
-	}
-
-	void processAction(IDocument document, ITextSelection textSelection) {
-		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
-		if (model != null) {
-			try {
-				IndexedRegion selectionStartIndexedRegion = model.getIndexedRegion(textSelection.getOffset());
-				IndexedRegion selectionEndIndexedRegion = model.getIndexedRegion(textSelection.getOffset() + textSelection.getLength());
-
-				if (selectionStartIndexedRegion == null)
-					return;
-				if (selectionEndIndexedRegion == null && textSelection.getLength() > 0) {
-					selectionEndIndexedRegion = model.getIndexedRegion(textSelection.getOffset() + textSelection.getLength() - 1);
-				}
-				if (selectionEndIndexedRegion == null)
-					return;
-
-				int openCommentOffset = selectionStartIndexedRegion.getStartOffset();
-				int closeCommentOffset = selectionEndIndexedRegion.getEndOffset() + OPEN_COMMENT.length();
-
-
-				if (textSelection.getLength() == 0 && selectionStartIndexedRegion instanceof CommentImpl)
-					return;
-
-				model.beginRecording(this, XMLUIMessages.AddBlockComment_tooltip);
-				model.aboutToChangeModel();
-
-				try {
-					document.replace(openCommentOffset, 0, OPEN_COMMENT);
-					document.replace(closeCommentOffset, 0, CLOSE_COMMENT);
-					removeOpenCloseComments(document, openCommentOffset + OPEN_COMMENT.length(), closeCommentOffset - openCommentOffset - CLOSE_COMMENT.length());
-				}
-				catch (BadLocationException e) {
-					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-				}
-				finally {
-					model.changedModel();
-					model.endRecording(this);
-				}
-			}
-			finally {
-				model.releaseFromEdit();
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/BaseNodeActionManager.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/BaseNodeActionManager.java
deleted file mode 100644
index 9eef9a0..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/BaseNodeActionManager.java
+++ /dev/null
@@ -1,514 +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.ui.internal.actions;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-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.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-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;
-import org.w3c.dom.ProcessingInstruction;
-
-public abstract class BaseNodeActionManager {
-
-
-	/**
-	 * MyMenuManager
-	 */
-	public static class MyMenuManager extends MenuManager {
-		protected String title;
-
-		public MyMenuManager(String s) {
-			super(s);
-			title = s;
-		}
-
-		public boolean isEnabled() {
-			return !isEmpty();
-		}
-
-		public String toString() {
-			return title;
-		}
-	}
-
-	public static DocumentType getDoctype(Node node) {
-		Document document = (node.getNodeType() == Node.DOCUMENT_NODE) ? (Document) node : node.getOwnerDocument();
-		return document.getDoctype();
-	}
-
-	protected MenuBuilder menuBuilder = new MenuBuilder();
-	protected IStructuredModel fModel;
-	protected ModelQuery modelQuery;
-
-	protected BaseNodeActionManager(IStructuredModel model, ModelQuery modelQuery) {
-		this.fModel = model;
-		this.modelQuery = modelQuery;
-	}
-
-
-	protected void addActionHelper(IMenuManager menu, List modelQueryActionList) {
-		List actionList = new Vector();
-		for (Iterator i = modelQueryActionList.iterator(); i.hasNext();) {
-			ModelQueryAction action = (ModelQueryAction) i.next();
-			if (action.getCMNode() != null) {
-				int cmNodeType = action.getCMNode().getNodeType();
-				if (action.getKind() == ModelQueryAction.INSERT) {
-					switch (cmNodeType) {
-						case CMNode.ATTRIBUTE_DECLARATION : {
-							actionList.add(createAddAttributeAction((Element) action.getParent(), (CMAttributeDeclaration) action.getCMNode()));
-							break;
-						}
-						case CMNode.ELEMENT_DECLARATION : {
-							actionList.add(createAddElementAction(action.getParent(), (CMElementDeclaration) action.getCMNode(), action.getStartIndex()));
-							break;
-						}
-					}
-				} else if (action.getKind() == ModelQueryAction.REPLACE) {
-					if (action.getParent() != null && action.getCMNode() != null) {
-						actionList.add(createReplaceAction(action.getParent(), action.getCMNode(), action.getStartIndex(), action.getEndIndex()));
-					}
-				}
-			}
-		}
-		menuBuilder.populateMenu(menu, actionList, false);
-	}
-
-	protected void contributeAction(IMenuManager menu, Action action) {
-		if (action != null) {
-			menu.add(action);
-		}
-	}
-
-
-	public void contributeActions(IMenuManager menu, List selection) {
-		int editMode = modelQuery.getEditMode();
-		int ic = ModelQuery.INCLUDE_CHILD_NODES;
-		int vc = (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) ? ModelQuery.VALIDITY_STRICT : ModelQuery.VALIDITY_NONE;
-
-		List implicitlySelectedNodeList = null;
-
-		if (selection.size() > 0) {
-			implicitlySelectedNodeList = getSelectedNodes(selection, true);
-
-			// contribute delete actions
-			contributeDeleteActions(menu, implicitlySelectedNodeList, ic, vc);
-		}
-
-		if (selection.size() == 1) {
-			Node node = (Node) selection.get(0);
-
-			// contribute edit actions
-			contributeEditActions(menu, node);
-
-			// contribute add child actions
-			contributeAddChildActions(menu, node, ic, vc);
-
-			// contribute add before actions
-			contributeAddSiblingActions(menu, node, ic, vc);
-		}
-
-		if (selection.size() > 0) {
-			// contribute replace actions
-			contributeReplaceActions(menu, implicitlySelectedNodeList, ic, vc);
-		}
-
-		if (selection.size() == 0) {
-			Document document = ((IDOMModel) fModel).getDocument();
-			contributeAddDocumentChildActions(menu, document, ic, vc);
-			contributeEditGrammarInformationActions(menu, document);
-		}
-	}
-
-
-	protected void contributeAddChildActions(IMenuManager menu, Node node, int ic, int vc) {
-		int nodeType = node.getNodeType();
-
-		if (nodeType == Node.ELEMENT_NODE) {
-			// 'Add Child...' and 'Add Attribute...' actions
-			//
-			Element element = (Element) node;
-
-			IMenuManager addAttributeMenu = new MyMenuManager(XMLUIMessages._UI_MENU_ADD_ATTRIBUTE); //$NON-NLS-1$
-			IMenuManager addChildMenu = new MyMenuManager(XMLUIMessages._UI_MENU_ADD_CHILD); //$NON-NLS-1$
-			menu.add(addAttributeMenu);
-			menu.add(addChildMenu);
-
-			CMElementDeclaration ed = modelQuery.getCMElementDeclaration(element);
-			if (ed != null) {
-				// add insert attribute actions
-				//
-				List modelQueryActionList = new ArrayList();
-				modelQuery.getInsertActions(element, ed, -1, ModelQuery.INCLUDE_ATTRIBUTES, vc, modelQueryActionList);
-				addActionHelper(addAttributeMenu, modelQueryActionList);
-
-				// add insert child node actions
-				//
-				modelQueryActionList = new ArrayList();
-				modelQuery.getInsertActions(element, ed, -1, ic, vc, modelQueryActionList);
-				addActionHelper(addChildMenu, modelQueryActionList);
-			}
-
-			// add PI and COMMENT
-			contributePIAndCommentActions(addChildMenu, element, ed, -1);
-
-			// add PCDATA, CDATA_SECTION
-			contributeTextNodeActions(addChildMenu, element, ed, -1);
-
-			// add NEW ELEMENT
-			contributeUnconstrainedAddElementAction(addChildMenu, element, ed, -1);
-
-			// add ATTRIBUTE
-			contributeUnconstrainedAttributeActions(addAttributeMenu, element, ed);
-		}
-	}
-
-
-	protected void contributeAddDocumentChildActions(IMenuManager menu, Document document, int ic, int vc) {
-		IMenuManager addChildMenu = new MyMenuManager(XMLUIMessages._UI_MENU_ADD_CHILD); //$NON-NLS-1$
-		menu.add(addChildMenu);
-
-		// add PI and COMMENT
-		contributePIAndCommentActions(addChildMenu, document, -1);
-
-		// add NEW ELEMENT
-		contributeUnconstrainedAddElementAction(addChildMenu, document, -1);
-	}
-
-
-	protected void contributeAddSiblingActions(IMenuManager menu, Node node, int ic, int vc) {
-		IMenuManager addBeforeMenu = new MyMenuManager(XMLUIMessages._UI_MENU_ADD_BEFORE); //$NON-NLS-1$
-		IMenuManager addAfterMenu = new MyMenuManager(XMLUIMessages._UI_MENU_ADD_AFTER); //$NON-NLS-1$
-		menu.add(addBeforeMenu);
-		menu.add(addAfterMenu);
-
-		Node parentNode = node.getParentNode();
-		if (parentNode != null) {
-			int index = getIndex(parentNode, node);
-			if (parentNode.getNodeType() == Node.ELEMENT_NODE) {
-				Element parentElement = (Element) parentNode;
-				CMElementDeclaration parentED = modelQuery.getCMElementDeclaration(parentElement);
-				if (parentED != null) {
-					// 'Add Before...' and 'Add After...' actions
-					//
-					List modelQueryActionList = new ArrayList();
-					modelQuery.getInsertActions(parentElement, parentED, index, ic, vc, modelQueryActionList);
-					addActionHelper(addBeforeMenu, modelQueryActionList);
-
-					modelQueryActionList = new ArrayList();
-					modelQuery.getInsertActions(parentElement, parentED, index + 1, ic, vc, modelQueryActionList);
-					addActionHelper(addAfterMenu, modelQueryActionList);
-				}
-
-				// add COMMENT and PI before and after
-				contributePIAndCommentActions(addBeforeMenu, parentElement, parentED, index);
-				contributePIAndCommentActions(addAfterMenu, parentElement, parentED, index + 1);
-
-				// add PCDATA, CDATA_SECTION before and after
-				contributeTextNodeActions(addBeforeMenu, parentElement, parentED, index);
-				contributeTextNodeActions(addAfterMenu, parentElement, parentED, index + 1);
-
-				// add NEW ELEMENT before and after
-				contributeUnconstrainedAddElementAction(addBeforeMenu, parentElement, parentED, index);
-				contributeUnconstrainedAddElementAction(addAfterMenu, parentElement, parentED, index + 1);
-			} else if (parentNode.getNodeType() == Node.DOCUMENT_NODE) {
-				Document document = (Document) parentNode;
-				CMDocument cmDocument = modelQuery.getCorrespondingCMDocument(parentNode);
-				if (cmDocument != null) {
-					// add possible root element insertions
-					//        
-					List modelQueryActionList = new ArrayList();
-					modelQuery.getInsertActions(document, cmDocument, index, ic, vc, modelQueryActionList);
-					addActionHelper(addAfterMenu, modelQueryActionList);
-
-					modelQueryActionList = new ArrayList();
-					modelQuery.getInsertActions(document, cmDocument, index + 1, ic, vc, modelQueryActionList);
-					addActionHelper(addAfterMenu, modelQueryActionList);
-				}
-
-				// add COMMENT and PI before and after
-				contributePIAndCommentActions(addBeforeMenu, document, index);
-				contributePIAndCommentActions(addAfterMenu, document, index + 1);
-
-				// add ELEMENT before and after
-				contributeUnconstrainedAddElementAction(addBeforeMenu, document, index);
-				contributeUnconstrainedAddElementAction(addAfterMenu, document, index + 1);
-			}
-		}
-	}
-
-	protected void contributeDeleteActions(IMenuManager menu, List list, int ic, int vc) {
-		boolean canRemove = modelQuery.canRemove(list, vc);
-
-
-		// a delete action with an empty list will produce a disabled menu
-		// item
-		//
-		List resultList = canRemove ? list : Collections.EMPTY_LIST;
-		contributeAction(menu, createDeleteAction(resultList));
-	}
-
-
-	protected void contributeEditActions(IMenuManager menu, Node node) {
-		contributeEditGrammarInformationActions(menu, node);
-
-		if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
-			contributeAction(menu, createEditProcessingInstructionAction((ProcessingInstruction) node));
-		} else if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
-			contributeAction(menu, createEditAttributeAction((Attr) node, null));
-		}
-	}
-
-
-	protected void contributeEditGrammarInformationActions(IMenuManager menu, Node node) {
-		Document document = node.getNodeType() == Node.DOCUMENT_NODE ? (Document) node : node.getOwnerDocument();
-
-		DocumentType doctype = getDoctype(node);
-		if (doctype == null) {
-			contributeAction(menu, createAddDoctypeAction(document, -1));
-		}
-
-		if (node.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
-			contributeAction(menu, createEditDoctypeAction((DocumentType) node));
-		}
-
-		if (doctype == null && getRootElement(document) != null) {
-			contributeAction(menu, createEditSchemaInfoAction(getRootElement(document)));
-		}
-	}
-
-	protected void contributePIAndCommentActions(IMenuManager menu, Document document, int index) {
-		// test to make sure that the index isn't before the XML declaration
-		// 
-		contributeAction(menu, createAddCommentAction(document, index));
-		contributeAction(menu, createAddProcessingInstructionAction(document, index));
-	}
-
-
-	protected void contributePIAndCommentActions(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd, int index) {
-		if (parentEd == null || isCommentAllowed(parentEd)) {
-			contributeAction(menu, createAddCommentAction(parentElement, index));
-			contributeAction(menu, createAddProcessingInstructionAction(parentElement, index));
-		}
-	}
-
-
-	protected void contributeReplaceActions(IMenuManager menu, List selectedNodeList, int ic, int vc) {
-		// 'Replace With...' actions
-		//                                                                                                                   
-		IMenuManager replaceWithMenu = new MyMenuManager(XMLUIMessages._UI_MENU_REPLACE_WITH); //$NON-NLS-1$
-		menu.add(replaceWithMenu);
-
-		if (modelQuery.getEditMode() == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT && selectedNodeList.size() > 0) {
-			Node node = (Node) selectedNodeList.get(0);
-			Node parentNode = node.getParentNode();
-			if (parentNode != null && parentNode.getNodeType() == Node.ELEMENT_NODE) {
-				Element parentElement = (Element) parentNode;
-				CMElementDeclaration parentED = modelQuery.getCMElementDeclaration(parentElement);
-				if (parentED != null) {
-					List replaceActionList = new Vector();
-					modelQuery.getReplaceActions(parentElement, parentED, selectedNodeList, ic, vc, replaceActionList);
-					addActionHelper(replaceWithMenu, replaceActionList);
-				}
-			}
-		}
-	}
-
-	protected void contributeTextNodeActions(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd, int index) {
-		if (parentEd == null || isTextAllowed(parentEd)) {
-			CMDataType dataType = parentEd != null ? parentEd.getDataType() : null;
-			contributeAction(menu, createAddPCDataAction(parentElement, dataType, index));
-			contributeAction(menu, createAddCDataSectionAction(parentElement, index));
-		}
-	}
-
-
-	protected void contributeUnconstrainedAddElementAction(IMenuManager menu, Document document, int index) {
-		if (isUnconstrainedActionAllowed()) {
-			if (getRootElement(document) == null) {
-				int xmlDeclarationIndex = -1;
-				int doctypeIndex = -1;
-				NodeList nodeList = document.getChildNodes();
-				int nodeListLength = nodeList.getLength();
-				for (int i = 0; i < nodeListLength; i++) {
-					Node node = nodeList.item(i);
-					int nodeType = node.getNodeType();
-					if (nodeType == Node.DOCUMENT_TYPE_NODE) {
-						doctypeIndex = i;
-						break;
-					} else if (nodeType == Node.PROCESSING_INSTRUCTION_NODE) {
-						ProcessingInstruction pi = (ProcessingInstruction) node;
-						if (pi.getTarget().equalsIgnoreCase("xml") && xmlDeclarationIndex == -1) { //$NON-NLS-1$
-							xmlDeclarationIndex = i;
-						}
-					}
-				}
-
-				if ((xmlDeclarationIndex == -1 || index > xmlDeclarationIndex) && (doctypeIndex == -1 || index > doctypeIndex)) {
-					contributeAction(menu, createAddElementAction(document, null, index));
-				}
-			}
-		}
-	}
-
-
-	protected void contributeUnconstrainedAddElementAction(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd, int index) {
-		if (isUnconstrainedActionAllowed()) {
-			if (parentEd == null || parentEd.getProperty("isInferred") == Boolean.TRUE || (modelQuery.getEditMode() != ModelQuery.EDIT_MODE_CONSTRAINED_STRICT && isElementAllowed(parentEd))) { //$NON-NLS-1$
-				contributeAction(menu, createAddElementAction(parentElement, null, index));
-			}
-		}
-	}
-
-
-	protected void contributeUnconstrainedAttributeActions(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd) {
-		if (isUnconstrainedActionAllowed()) {
-			if (parentEd == null || parentEd.getProperty("isInferred") == Boolean.TRUE || modelQuery.getEditMode() != ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) { //$NON-NLS-1$
-				contributeAction(menu, createAddAttributeAction(parentElement, null));
-			}
-		}
-	}
-
-	abstract protected Action createAddAttributeAction(Element parent, CMAttributeDeclaration ad);
-
-	abstract protected Action createAddCDataSectionAction(Node parent, int index);
-
-	abstract protected Action createAddCommentAction(Node parent, int index);
-
-	abstract protected Action createAddDoctypeAction(Document parent, int index);
-
-	abstract protected Action createAddElementAction(Node parent, CMElementDeclaration ed, int index);
-
-	abstract protected Action createAddPCDataAction(Node parent, CMDataType dataType, int index);
-
-	abstract protected Action createAddProcessingInstructionAction(Node parent, int index);
-
-	abstract protected Action createAddSchemaInfoAction(Element element);
-
-	abstract protected Action createDeleteAction(List selection);
-
-	abstract protected Action createEditAttributeAction(Attr attribute, CMAttributeDeclaration ad);
-
-	abstract protected Action createEditDoctypeAction(DocumentType doctype);
-
-	abstract protected Action createEditProcessingInstructionAction(ProcessingInstruction pi);
-
-	abstract protected Action createEditSchemaInfoAction(Element element);
-
-	abstract protected Action createRenameAction(Node node);
-
-	abstract protected Action createReplaceAction(Node parent, CMNode cmnode, int startIndex, int endIndex);
-
-
-	public 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;
-	}
-
-
-	public Node getRefChildNodeAtIndex(Node parent, int index) {
-		NodeList nodeList = parent.getChildNodes();
-		Node refChild = (index >= 0 && index < nodeList.getLength()) ? nodeList.item(index) : null;
-		return refChild;
-	}
-
-
-	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;
-	}
-
-
-	protected List getSelectedNodes(List list, boolean includeTextNodes) {
-		List result = new ArrayList(0);
-		for (Iterator i = list.iterator(); i.hasNext();) {
-			Object object = i.next();
-			if (object instanceof Node) {
-				Node node = (Node) object;
-				if (node.getNodeType() == Node.TEXT_NODE) {
-					if (includeTextNodes) {
-						result.add(object);
-					}
-				} else {
-					result.add(node);
-				}
-			}
-		}
-		return result;
-	}
-
-
-	protected boolean isCommentAllowed(CMElementDeclaration parentEd) {
-		int contentType = parentEd.getContentType();
-		return contentType == CMElementDeclaration.ELEMENT || contentType == CMElementDeclaration.MIXED || contentType == CMElementDeclaration.PCDATA || contentType == CMElementDeclaration.ANY;
-	}
-
-
-	protected boolean isElementAllowed(CMElementDeclaration parentEd) {
-		int contentType = parentEd.getContentType();
-		return contentType == CMElementDeclaration.ELEMENT || contentType == CMElementDeclaration.MIXED || contentType == CMElementDeclaration.ANY;
-	}
-
-
-	protected boolean isTextAllowed(CMElementDeclaration parentEd) {
-		int contentType = parentEd.getContentType();
-		return contentType == CMElementDeclaration.MIXED || contentType == CMElementDeclaration.PCDATA || contentType == CMElementDeclaration.ANY;
-	}
-
-
-	protected boolean isUnconstrainedActionAllowed() {
-		return true;
-	}
-
-
-	protected boolean isWhitespaceTextNode(Node node) {
-		return (node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue().trim().length() == 0);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupActionXMLDelegate.java
deleted file mode 100644
index cc7a56a..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupActionXMLDelegate.java
+++ /dev/null
@@ -1,136 +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.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.Dialog;
-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.sse.core.internal.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.xml.core.internal.cleanup.CleanupProcessorXML;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * Cleanup action delegate for CSS editor
- */
-public class CleanupActionXMLDelegate 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(XMLUIMessages.CleanupDocument_label);
-			action.setToolTipText(XMLUIMessages.CleanupDocument_tooltip);
-			action.setDescription(XMLUIMessages.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;
-			Dialog cleanupDialog = new CleanupDialogXML(editor.getSite().getShell());
-			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 CleanupProcessorXML();
-
-		return fCleanupProcessor;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupDialogXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupDialogXML.java
deleted file mode 100644
index 3e170a0..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupDialogXML.java
+++ /dev/null
@@ -1,197 +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.ui.internal.actions;
-
-import org.eclipse.core.runtime.Preferences;
-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.GridLayout;
-import org.eclipse.swt.widgets.Button;
-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.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-
-public class CleanupDialogXML extends Dialog implements SelectionListener {
-	protected Button fCheckBoxCompressEmptyElementTags;
-	protected Button fCheckBoxConvertEOLCodes;
-	protected Button fCheckBoxFormatSource;
-	protected Button fCheckBoxInsertMissingTags;
-	protected Button fCheckBoxInsertRequiredAttrs;
-	protected Button fCheckBoxQuoteAttrValues;
-	protected IStructuredModel fModel = null;
-	protected Preferences fPreferences = null;
-	protected Button fRadioButtonAttrNameCaseAsis;
-	protected Button fRadioButtonAttrNameCaseLower;
-	protected Button fRadioButtonAttrNameCaseUpper;
-	protected Button fRadioButtonConvertEOLMac;
-	protected Button fRadioButtonConvertEOLUnix;
-	protected Button fRadioButtonConvertEOLWindows;
-
-	protected Button fRadioButtonTagNameCaseAsis;
-	protected Button fRadioButtonTagNameCaseLower;
-	protected Button fRadioButtonTagNameCaseUpper;
-
-	public CleanupDialogXML(Shell shell) {
-
-		super(shell);
-	}
-
-	public Control createDialogArea(Composite parent) {
-
-		getShell().setText(XMLUIMessages.Cleanup_UI_);
-		Composite composite = new Composite(parent, SWT.NULL);
-		createDialogAreaInComposite(composite);
-		initializeOptions();
-		return composite;
-	}
-
-	protected void createDialogAreaInComposite(Composite composite) {
-
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.CLEANUP_XML_HELPID); // use
-		// XML
-		// 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(XMLUIMessages.Insert_required_attributes_UI_);
-		fCheckBoxInsertRequiredAttrs.addSelectionListener(this);
-
-		// Insert missing begin/end tags
-		fCheckBoxInsertMissingTags = new Button(composite, SWT.CHECK);
-		fCheckBoxInsertMissingTags.setText(XMLUIMessages.Insert_missing_tags_UI_);
-		fCheckBoxInsertMissingTags.addSelectionListener(this);
-
-		// Quote attribute values
-		fCheckBoxQuoteAttrValues = new Button(composite, SWT.CHECK);
-		fCheckBoxQuoteAttrValues.setText(XMLUIMessages.Quote_attribute_values_UI_);
-		fCheckBoxQuoteAttrValues.addSelectionListener(this);
-
-		// Format source
-		fCheckBoxFormatSource = new Button(composite, SWT.CHECK);
-		fCheckBoxFormatSource.setText(XMLUIMessages.Format_source_UI_);
-		fCheckBoxFormatSource.addSelectionListener(this);
-
-		// Convert EOL code
-		fCheckBoxConvertEOLCodes = new Button(composite, SWT.CHECK);
-		fCheckBoxConvertEOLCodes.setText(XMLUIMessages.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(XMLUIMessages.EOL_Windows_UI);
-		fRadioButtonConvertEOLWindows.addSelectionListener(this);
-		fRadioButtonConvertEOLUnix = new Button(EOLCodes, SWT.RADIO);
-		fRadioButtonConvertEOLUnix.setText(XMLUIMessages.EOL_Unix_UI);
-		fRadioButtonConvertEOLUnix.addSelectionListener(this);
-		fRadioButtonConvertEOLMac = new Button(EOLCodes, SWT.RADIO);
-		fRadioButtonConvertEOLMac.setText(XMLUIMessages.EOL_Mac_UI);
-		fRadioButtonConvertEOLMac.addSelectionListener(this);
-	}
-
-	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);
-		}
-	}
-
-	protected Preferences getModelPreferences() {
-		return XMLCorePlugin.getDefault().getPluginPreferences();
-	}
-
-	protected void initializeOptions() {
-
-		fCheckBoxCompressEmptyElementTags.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
-		fCheckBoxInsertRequiredAttrs.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
-		fCheckBoxInsertMissingTags.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.INSERT_MISSING_TAGS));
-		fCheckBoxQuoteAttrValues.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.QUOTE_ATTR_VALUES));
-		fCheckBoxFormatSource.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.FORMAT_SOURCE));
-		fCheckBoxConvertEOLCodes.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.CONVERT_EOL_CODES));
-		String EOLCode = getModelPreferences().getString(XMLCorePreferenceNames.CLEANUP_EOL_CODE);
-		if (EOLCode.compareTo(CommonEncodingPreferenceNames.LF) == 0)
-			fRadioButtonConvertEOLUnix.setSelection(true);
-		else if (EOLCode.compareTo(CommonEncodingPreferenceNames.CR) == 0)
-			fRadioButtonConvertEOLMac.setSelection(true);
-		else
-			fRadioButtonConvertEOLWindows.setSelection(true);
-		enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
-	}
-
-	protected void okPressed() {
-
-		storeOptions();
-		super.okPressed();
-	}
-
-	public void setModel(IStructuredModel model) {
-
-		fModel = model;
-	}
-
-	protected void storeOptions() {
-
-		getModelPreferences().setValue(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS, fCheckBoxCompressEmptyElementTags.getSelection());
-		getModelPreferences().setValue(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, fCheckBoxInsertRequiredAttrs.getSelection());
-		getModelPreferences().setValue(XMLCorePreferenceNames.INSERT_MISSING_TAGS, fCheckBoxInsertMissingTags.getSelection());
-		getModelPreferences().setValue(XMLCorePreferenceNames.QUOTE_ATTR_VALUES, fCheckBoxQuoteAttrValues.getSelection());
-		getModelPreferences().setValue(XMLCorePreferenceNames.FORMAT_SOURCE, fCheckBoxFormatSource.getSelection());
-		getModelPreferences().setValue(XMLCorePreferenceNames.CONVERT_EOL_CODES, fCheckBoxConvertEOLCodes.getSelection());
-		if (fRadioButtonConvertEOLUnix.getSelection()) {
-			getModelPreferences().setValue(XMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.LF);
-		} else if (fRadioButtonConvertEOLMac.getSelection()) {
-			getModelPreferences().setValue(XMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CR);
-		} else {
-			getModelPreferences().setValue(XMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CRLF);
-		}
-		// explicitly save plugin preferences so values are stored
-		XMLCorePlugin.getDefault().savePluginPreferences();
-	}
-
-	public void widgetDefaultSelected(SelectionEvent e) {
-
-		widgetSelected(e);
-	}
-
-	public void widgetSelected(SelectionEvent e) {
-
-		getButton(OK).setEnabled((fRadioButtonTagNameCaseLower != null && (fRadioButtonTagNameCaseLower.getSelection() || fRadioButtonTagNameCaseUpper.getSelection())) || (fRadioButtonAttrNameCaseLower != null && (fRadioButtonAttrNameCaseLower.getSelection() || fRadioButtonAttrNameCaseUpper.getSelection())) || fCheckBoxInsertMissingTags.getSelection() || fCheckBoxQuoteAttrValues.getSelection() || fCheckBoxFormatSource.getSelection() || fCheckBoxConvertEOLCodes.getSelection() || (fRadioButtonConvertEOLUnix != null && (fRadioButtonConvertEOLUnix.getSelection() || fRadioButtonConvertEOLMac.getSelection() || fRadioButtonConvertEOLWindows.getSelection())));
-		if (e.widget == fCheckBoxConvertEOLCodes)
-			enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditAttributeAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditAttributeAction.java
deleted file mode 100644
index 5e3a984..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditAttributeAction.java
+++ /dev/null
@@ -1,80 +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.ui.internal.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditAttributeDialog;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class EditAttributeAction extends NodeAction {
-	protected static ImageDescriptor imageDescriptor;
-
-	public static ImageDescriptor createImageDescriptor() {
-		if (imageDescriptor == null) {
-			imageDescriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
-		}
-		return imageDescriptor;
-	}
-
-	protected Attr attr;
-	protected AbstractNodeActionManager manager;
-	protected Element ownerElement;
-	protected String title;
-
-	public EditAttributeAction(AbstractNodeActionManager manager, Element ownerElement, Attr attr, String actionLabel, String title) {
-		this.manager = manager;
-		this.ownerElement = ownerElement;
-		this.attr = attr;
-		this.title = title;
-		setText(actionLabel);
-		// assume if attr is null then this is an 'Add' that requires action
-		// an icons... otherwise this is an edit
-		if (attr == null) {
-			setImageDescriptor(createImageDescriptor());
-		}
-	}
-
-	public String getUndoDescription() {
-		return title;
-	}
-
-	public void run() {
-		manager.beginNodeAction(this);
-		Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-		EditAttributeDialog dialog = new EditAttributeDialog(shell, ownerElement, attr);
-		dialog.create();
-		dialog.getShell().setText(title);
-		dialog.setBlockOnOpen(true);
-		dialog.open();
-
-		if (dialog.getReturnCode() == Window.OK) {
-			if (attr != null) {
-				ownerElement.removeAttributeNode(attr);
-			}
-			Document document = ownerElement.getOwnerDocument();
-			Attr newAttribute = document.createAttribute(dialog.getAttributeName());
-			newAttribute.setValue(dialog.getAttributeValue());
-			ownerElement.setAttributeNode(newAttribute);
-			manager.setViewerSelection(newAttribute);
-		}
-		manager.endNodeAction(this);
-	}
-}
-
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditDoctypeAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditDoctypeAction.java
deleted file mode 100644
index 0a7c2bf..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditDoctypeAction.java
+++ /dev/null
@@ -1,187 +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.ui.internal.actions;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditDoctypeDialog;
-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;
-
-/**
- * EditDoctypeAction
- */
-public class EditDoctypeAction extends Action {
-	protected DocumentType doctype;
-	protected Document document;
-	protected IStructuredModel model;
-	protected String resourceLocation;
-	protected String title;
-
-	/**
-	 * This constructor is used to create a new doctype.
-	 */
-	public EditDoctypeAction(IStructuredModel model, Document document, String resourceLocation, String title) {
-		setText(title);
-		this.model = model;
-		this.document = document;
-		this.resourceLocation = resourceLocation;
-		this.title = title;
-	}
-
-	/**
-	 * This constructor is used to edit an exisitng doctype.
-	 */
-	public EditDoctypeAction(IStructuredModel model, DocumentType doctype, String resourceLocation, String title) {
-		setText(title);
-		this.model = model;
-		this.doctype = doctype;
-		this.resourceLocation = resourceLocation;
-		this.title = title;
-	}
-
-
-	protected DocumentType createDoctype(EditDoctypeDialog dialog, Document document) {
-		DocumentType result = null;
-		if (document instanceof DocumentImpl) {
-			IDOMDocument documentImpl = (IDOMDocument) document;
-			IDOMDocumentType doctypeImpl = (IDOMDocumentType) documentImpl.createDoctype(dialog.getName());
-			doctypeImpl.setPublicId(dialog.getPublicId());
-			doctypeImpl.setSystemId(dialog.getSystemId());
-			result = doctypeImpl;
-		}
-		return result;
-	}
-
-	private Display getDisplay() {
-
-		return PlatformUI.getWorkbench().getDisplay();
-	}
-
-
-	protected String getRootElementName(Document document) {
-		Element rootElement = null;
-		NodeList nodeList = document.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;
-			}
-		}
-		return rootElement != null ? rootElement.getNodeName() : XMLUIMessages._UI_LABEL_ROOT_ELEMENT_VALUE; //$NON-NLS-1$
-	}
-
-	public String getUndoDescription() {
-		return title;
-	}
-
-
-	protected void insertDoctype(DocumentType doctype, Document document) {
-		Node refChild = null;
-		NodeList nodeList = document.getChildNodes();
-		int nodeListLength = nodeList.getLength();
-		for (int i = 0; i < nodeListLength; i++) {
-			Node childNode = nodeList.item(i);
-			if (childNode.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE || childNode.getNodeType() == Node.COMMENT_NODE) {
-				// continue on to the nextNode
-			} else {
-				refChild = childNode;
-				break;
-			}
-		}
-
-		document.insertBefore(doctype, refChild);
-		//manager.reformat(doctype, false);
-	}
-
-	public void run() {
-		model.beginRecording(this, getUndoDescription());
-		//Shell shell =
-		// XMLCommonUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-		Shell shell = getDisplay().getActiveShell();
-		EditDoctypeDialog dialog = showEditDoctypeDialog(shell);
-
-		if (dialog.getReturnCode() == Window.OK) {
-			if (doctype != null) {
-				updateDoctype(dialog, doctype);
-			} else if (document != null) {
-				DocumentType doctype = createDoctype(dialog, document);
-				if (doctype != null) {
-					insertDoctype(doctype, document);
-				}
-			}
-		}
-		model.endRecording(this);
-	}
-
-	protected EditDoctypeDialog showEditDoctypeDialog(Shell shell) {
-		EditDoctypeDialog dialog = null;
-
-		if (doctype != null) {
-			dialog = new EditDoctypeDialog(shell, doctype);
-			if (title == null) {
-				title = XMLUIMessages._UI_LABEL_EDIT_DOCTYPE; //$NON-NLS-1$
-			}
-		} else if (document != null) {
-			String rootElementName = getRootElementName(document);
-			dialog = new EditDoctypeDialog(shell, rootElementName, "", rootElementName + ".dtd"); //$NON-NLS-1$ //$NON-NLS-2$
-			if (title == null) {
-				title = XMLUIMessages._UI_MENU_ADD_DTD_INFORMATION_TITLE; //$NON-NLS-1$
-			}
-		}
-
-		dialog.setComputeSystemId(doctype == null || doctype.getSystemId() == null || doctype.getSystemId().trim().length() == 0);
-
-		dialog.setErrorChecking(false);//!model.getType().equals(IStructuredModel.HTML));
-		dialog.create();
-		dialog.getShell().setText(title);
-		dialog.setBlockOnOpen(true);
-		dialog.setResourceLocation(new Path(resourceLocation));
-		dialog.open();
-
-		return dialog;
-	}
-
-
-	protected void updateDoctype(EditDoctypeDialog dialog, DocumentType doctype) {
-		if (doctype instanceof IDOMDocumentType) {
-			IDOMDocumentType doctypeImpl = (IDOMDocumentType) doctype;
-			if (doctypeImpl.getName().equals(dialog.getName())) {
-				doctypeImpl.setPublicId(dialog.getPublicId());
-				doctypeImpl.setSystemId(dialog.getSystemId());
-			} else {
-				// we need to create a new one and remove the old
-				//                  
-				Document document = doctype.getOwnerDocument();
-				DocumentType newDoctype = createDoctype(dialog, document);
-				document.insertBefore(newDoctype, doctype);
-				document.removeChild(doctype);
-				//manager.reformat(newDoctype, false);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditElementAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditElementAction.java
deleted file mode 100644
index 9084fa9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditElementAction.java
+++ /dev/null
@@ -1,117 +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.ui.internal.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-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.IDOMModel;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditElementDialog;
-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.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class EditElementAction extends NodeAction {
-
-	protected static ImageDescriptor imageDescriptor;
-
-	public static ImageDescriptor createImageDescriptor() {
-		if (imageDescriptor == null) {
-			imageDescriptor = XMLEditorPluginImageHelper.getInstance().getImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ELEMENT);
-		}
-		return imageDescriptor;
-	}
-
-	protected Element element;
-	protected int insertionIndex = -1;
-	protected AbstractNodeActionManager manager;
-	protected Node parent;
-	protected String title;
-
-	public EditElementAction(AbstractNodeActionManager manager, Element element, String actionLabel, String dialogTitle) {
-		this(manager, element.getParentNode(), -1, element, actionLabel, dialogTitle);
-	}
-
-	protected EditElementAction(AbstractNodeActionManager manager, Node parent, int index, Element element, String actionLabel, String title) {
-		this.manager = manager;
-		this.parent = parent;
-		this.insertionIndex = index;
-		this.element = element;
-		this.title = title;
-		setText(actionLabel);
-		if (element == null) {
-			setImageDescriptor(createImageDescriptor());
-		}
-	}
-
-	public EditElementAction(AbstractNodeActionManager manager, Node parent, int index, String actionLabel, String title) {
-		this(manager, parent, index, null, actionLabel, title);
-	}
-
-	public String getUndoDescription() {
-		return title;
-	}
-
-	public void run() {
-		manager.beginNodeAction(this);
-		Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-		EditElementDialog dialog = new EditElementDialog(shell, element);
-		dialog.create();
-		dialog.getShell().setText(title);
-		dialog.setBlockOnOpen(true);
-		dialog.open();
-
-		if (dialog.getReturnCode() == Window.OK) {
-			Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
-			if (element != null) {
-				// here we need to do a rename... which seems to be quite hard
-				// to do :-(
-				if (element instanceof IDOMElement) {
-					IDOMElement elementImpl = (IDOMElement) element;
-					IDOMModel model = elementImpl.getModel();
-					String oldName = elementImpl.getNodeName();
-					String newName = dialog.getElementName();
-					setStructuredDocumentRegionElementName(model, elementImpl.getStartStructuredDocumentRegion(), oldName, newName);
-					setStructuredDocumentRegionElementName(model, elementImpl.getEndStructuredDocumentRegion(), oldName, newName);
-				}
-			} else {
-				Element newElement = document.createElement(dialog.getElementName());
-				NodeList nodeList = parent.getChildNodes();
-				int nodeListLength = nodeList.getLength();
-				Node refChild = insertionIndex < nodeListLength && insertionIndex >= 0 ? nodeList.item(insertionIndex) : null;
-				parent.insertBefore(newElement, refChild);
-				manager.reformat(newElement, false);
-				manager.setViewerSelection(newElement);
-			}
-		}
-		manager.endNodeAction(this);
-	}
-
-	protected void setStructuredDocumentRegionElementName(IDOMModel model, IStructuredDocumentRegion flatNode, String oldName, String newName) {
-		if (flatNode != null) {
-			String string = flatNode.getText();
-			int index = string.indexOf(oldName);
-			if (index != -1) {
-				index += flatNode.getStart();
-				model.getStructuredDocument().replaceText(this, index, oldName.length(), newName);
-			}
-		}
-	}
-}
-
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditProcessingInstructionAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditProcessingInstructionAction.java
deleted file mode 100644
index cf1cc1d..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditProcessingInstructionAction.java
+++ /dev/null
@@ -1,94 +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.ui.internal.actions;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditProcessingInstructionDialog;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-
-/**
- * EditProcessingInstructionAction
- */
-public class EditProcessingInstructionAction extends NodeAction {
-	protected Node childRef;
-	protected AbstractNodeActionManager manager;
-	protected Node parent;
-	protected ProcessingInstruction pi;
-	protected String title;
-
-	/**
-	 * This constructor is used to add a new ProcessingInstruction
-	 */
-	public EditProcessingInstructionAction(AbstractNodeActionManager manager, Node parent, Node childRef, String actionLabel, String title) {
-		setText(actionLabel);
-		this.manager = manager;
-		this.parent = parent;
-		this.childRef = childRef;
-		this.title = title;
-	}
-
-	/**
-	 * This constructor is used to edit a ProcessingInstruction
-	 */
-	public EditProcessingInstructionAction(AbstractNodeActionManager manager, ProcessingInstruction pi, String actionLabel, String title) {
-		setText(actionLabel);
-		this.manager = manager;
-		this.pi = pi;
-		this.parent = pi.getParentNode();
-		this.title = title;
-	}
-
-	public String getUndoDescription() {
-		return title;
-	}
-
-	public void run() {
-		manager.beginNodeAction(this);
-		Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-
-		EditProcessingInstructionDialog dialog = null;
-		if (pi != null) {
-			dialog = new EditProcessingInstructionDialog(shell, pi);
-		} else {
-			dialog = new EditProcessingInstructionDialog(shell, XMLUIMessages._UI_PI_TARGET_VALUE, XMLUIMessages._UI_PI_DATA_VALUE); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		dialog.create();
-		dialog.getShell().setText(title);
-		dialog.setBlockOnOpen(true);
-		dialog.open();
-
-		if (dialog.getReturnCode() == Window.OK) {
-			if (pi != null) {
-				childRef = pi;
-			}
-
-			Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
-			Node newNode = document.createProcessingInstruction(dialog.getTarget(), dialog.getData());
-			parent.insertBefore(newNode, childRef);
-
-			if (pi != null) {
-				parent.removeChild(pi);
-			}
-
-			manager.reformat(newNode, false);
-			manager.setViewerSelection(newNode);
-		}
-		manager.endNodeAction(this);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditSchemaInfoAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditSchemaInfoAction.java
deleted file mode 100644
index 391931b..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditSchemaInfoAction.java
+++ /dev/null
@@ -1,164 +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.ui.internal.actions;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditSchemaInfoDialog;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * EditDoctypeAction
- */
-public class EditSchemaInfoAction extends NodeAction {
-	protected AbstractNodeActionManager manager;
-	protected DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
-	protected Node node;
-	protected String resourceLocation;
-	protected String title;
-
-	public EditSchemaInfoAction(AbstractNodeActionManager manager, Node node, String resourceLocation, String title) {
-		this.manager = manager;
-		this.node = node;
-		setText(title);
-		this.resourceLocation = resourceLocation;
-		this.title = title;
-	}
-
-	protected Map createPrefixMapping(List oldList, List newList) {
-		Map map = new Hashtable();
-
-		Hashtable oldURIToPrefixTable = new Hashtable();
-		for (Iterator i = oldList.iterator(); i.hasNext();) {
-			NamespaceInfo oldInfo = (NamespaceInfo) i.next();
-			oldURIToPrefixTable.put(oldInfo.uri, oldInfo);
-		}
-
-		for (Iterator i = newList.iterator(); i.hasNext();) {
-			NamespaceInfo newInfo = (NamespaceInfo) i.next();
-			NamespaceInfo oldInfo = (NamespaceInfo) oldURIToPrefixTable.get(newInfo.uri != null ? newInfo.uri : ""); //$NON-NLS-1$
-
-
-			// if oldInfo is non null ... there's a matching URI in the old
-			// set
-			// we can use its prefix to detemine out mapping
-			//
-			// if oldInfo is null ... we use the 'oldCopy' we stashed away
-			// assuming that the user changed the URI and the prefix
-			if (oldInfo == null) {
-				oldInfo = (NamespaceInfo) newInfo.getProperty("oldCopy"); //$NON-NLS-1$
-			}
-
-			if (oldInfo != null) {
-				String newPrefix = newInfo.prefix != null ? newInfo.prefix : ""; //$NON-NLS-1$
-				String oldPrefix = oldInfo.prefix != null ? oldInfo.prefix : ""; //$NON-NLS-1$
-				if (!oldPrefix.equals(newPrefix)) {
-					map.put(oldPrefix, newPrefix);
-				}
-			}
-		}
-		return map;
-	}
-
-	public Element getElement(Node node) {
-		Element result = null;
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			result = (Element) node;
-		} else if (node.getNodeType() == Node.DOCUMENT_NODE) {
-			result = getRootElement((Document) node);
-		}
-		return result;
-	}
-
-
-	public Element getRootElement(Document document) {
-		Element rootElement = null;
-		NodeList nodeList = document.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;
-			}
-		}
-		return rootElement;
-	}
-
-	public String getUndoDescription() {
-		return title;
-	}
-
-	public void run() {
-		manager.beginNodeAction(this);
-
-		// todo... change constructor to take an element
-		Element element = getElement(node);
-		if (element != null) {
-			Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-			EditSchemaInfoDialog dialog = new EditSchemaInfoDialog(shell, new Path(resourceLocation));
-
-			List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
-			List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
-
-			// here we store a copy of the old info for each NamespaceInfo
-			// this info will be used in createPrefixMapping() to figure out
-			// how to update the document
-			// in response to these changes
-			for (Iterator i = namespaceInfoList.iterator(); i.hasNext();) {
-				NamespaceInfo info = (NamespaceInfo) i.next();
-				NamespaceInfo oldCopy = new NamespaceInfo(info);
-				info.setProperty("oldCopy", oldCopy); //$NON-NLS-1$
-			}
-
-			dialog.setNamespaceInfoList(namespaceInfoList);
-			dialog.create();
-			//dialog.getShell().setSize(500, 300);
-			dialog.getShell().setText(XMLUIMessages._UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE); //$NON-NLS-1$
-			dialog.setBlockOnOpen(true);
-			dialog.open();
-
-			if (dialog.getReturnCode() == Window.OK) {
-				List newInfoList = dialog.getNamespaceInfoList();
-				namespaceInfoManager.removeNamespaceInfo(element);
-				namespaceInfoManager.addNamespaceInfo(element, newInfoList, true);
-
-				// see if we need to rename any prefixes
-				Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
-				if (prefixMapping.size() > 0) {
-					try {
-						manager.getModel().aboutToChangeModel();
-						ReplacePrefixAction replacePrefixAction = new ReplacePrefixAction(manager, element, prefixMapping);
-						replacePrefixAction.run();
-					} finally {
-						manager.getModel().changedModel();
-					}
-				}
-			}
-		}
-		manager.endNodeAction(this);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/MenuBuilder.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/MenuBuilder.java
deleted file mode 100644
index b3291e8..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/MenuBuilder.java
+++ /dev/null
@@ -1,145 +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.ui.internal.actions;
-
-import java.text.Collator;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-
-
-public class MenuBuilder {
-
-
-	protected Comparator comparator = new Comparator() {
-
-		public int compare(Object o1, Object o2) {
-			return Collator.getInstance().compare(getSortKey(o1), getSortKey(o2));
-		}
-
-		protected String getSortKey(Object o) {
-			String result = ""; //$NON-NLS-1$
-			if (o instanceof IAction) {
-				IAction action = (IAction) o;
-				result = action.getText();
-			}
-			//else if (o instanceof MenuData)
-			//{
-			//  result = "z" + ((MenuData)o).name;
-			//}
-			return result;
-		}
-	};
-
-
-	protected void createAlphebeticalGrouping(IMenuManager menu, List actionList) {
-		Object[] array = actionList.toArray();
-		if (array.length > 0) {
-			Arrays.sort(array, comparator);
-		}
-
-		int groupSize = 15;
-		int minGroupSize = 5;
-		int numberOfGroups = (array.length / groupSize) + ((array.length % groupSize > minGroupSize) ? 1 : 0);
-
-		for (int i = 0; i < numberOfGroups; i++) {
-			boolean isLastGroup = (i == (numberOfGroups - 1));
-			int firstIndex = i * groupSize;
-			int lastIndex = isLastGroup ? array.length - 1 : i * groupSize + groupSize - 1;
-			Action firstAction = (Action) array[firstIndex];
-			Action lastAction = (Action) array[lastIndex];
-			MenuManager submenu = new MenuManager(firstAction.getText() + " - " + lastAction.getText()); //$NON-NLS-1$
-			menu.add(submenu);
-			for (int j = firstIndex; j <= lastIndex; j++) {
-				submenu.add((Action) array[j]);
-			}
-		}
-	}
-
-
-	public void populateMenu(IMenuManager menu, List actionList, boolean createTiered) {
-		// sort the actions
-		if (actionList.size() < 25) {
-			Object[] array = actionList.toArray();
-			if (array.length > 0) {
-				Arrays.sort(array, comparator);
-			}
-			for (int i = 0; i < array.length; i++) {
-				menu.add((Action) array[i]);
-			}
-		} else {
-			createAlphebeticalGrouping(menu, actionList);
-		}
-	}
-
-	/*
-	 * protected void createPropertyGrouping(IMenuManager menu, List
-	 * actionList) { MenuDataTable menuDataTable = new MenuDataTable();
-	 * 
-	 * for (Iterator i = actionList.iterator(); i.hasNext(); ) { String
-	 * groupName = null; Action action = (Action)i.next(); if (action
-	 * instanceof NodeAction) { groupName =
-	 * ((NodeAction)action).getGroupName(); } if (groupName == null) {
-	 * groupName = ""; } MenuData menuData =
-	 * menuDataTable.lookupOrCreate(groupName, "");
-	 * menuData.childList.add(action); } populateMenu(menu,
-	 * menuDataTable.getRoot()); }
-	 * 
-	 * 
-	 * protected void populateMenu(MenuManager menuManager, MenuData menuData) {
-	 * for (Iterator i = menuData.childList.iterator(); i.hasNext(); ) {
-	 * Object o = i.next(); if (o instanceof Action) {
-	 * menuManager.add((Action)o); } else if (o instanceof MenuData) {
-	 * MenuData childMenuData = (MenuData)o; MenuManager childMenuManager =
-	 * new MenuManager(childMenuData.name); menuManager.add(childMenuManager);
-	 * populateMenu(childMenuManager, childMenuData); } } }
-	 * 
-	 * 
-	 * public MenuDataTable { protected Hashtable table = new Hashtable();
-	 * protected MenuData root;
-	 * 
-	 * public MenuDataTable() { root = lookupOrCreateMenuData(null, null); }
-	 * 
-	 * protected MenuData lookupMenuData(String name) { String key = name !=
-	 * null ? name : ""; return (MenuData)menuDataTable.get(key); }
-	 * 
-	 * protected MenuData lookupOrCreateMenuData(String name, String
-	 * parentName) { String key = name != null ? name : ""; MenuData menuData =
-	 * (MenuData)menuDataTable.get(key); if (menuData == null) { menuData =
-	 * new MenuData(name, parentName); menuDataTable.put(key, menuData); }
-	 * return menuData; }
-	 * 
-	 * public MenuData getRoot() { return root; } }
-	 * 
-	 * 
-	 * protected class MenuData { public String name; public String
-	 * parentName; public List childList = new Vector();
-	 * 
-	 * MenuData(String name, String parentName) { this.name = name;
-	 * this.parentName = parentName; }
-	 * 
-	 * protected void sort() { Object[] array = childList.toArray(); if
-	 * (array.length > 0 ) { Arrays.sort(array, comparator); } childList =
-	 * Arrays.asList(array);
-	 * 
-	 * for (Iterator i = childList.iterator(); i.hasNext(); ) { Object o =
-	 * i.next(); if (o instanceof MenuData) { ((MenuData)o).sort(); } } } }
-	 */
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/NodeAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/NodeAction.java
deleted file mode 100644
index 64c4728..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/NodeAction.java
+++ /dev/null
@@ -1,26 +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.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-
-public abstract class NodeAction extends Action {
-
-	public String getSortKey() {
-		return null;
-	}
-
-	public abstract String getUndoDescription();
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/RemoveBlockCommentActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/RemoveBlockCommentActionXMLDelegate.java
deleted file mode 100644
index 8ac71d9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/RemoveBlockCommentActionXMLDelegate.java
+++ /dev/null
@@ -1,86 +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.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-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.StructuredModelManager;
-import org.eclipse.wst.xml.core.internal.document.CommentImpl;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * Remove block comment action delegate for XML editor
- */
-public class RemoveBlockCommentActionXMLDelegate extends AbstractCommentActionXMLDelegate {
-
-	void processAction(IDocument document, ITextSelection textSelection) {
-		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
-		if (model != null) {
-			try {
-				IndexedRegion selectionStartIndexedRegion = model.getIndexedRegion(textSelection.getOffset());
-				IndexedRegion selectionEndIndexedRegion = model.getIndexedRegion(textSelection.getOffset() + textSelection.getLength());
-
-				if (selectionStartIndexedRegion == null || selectionEndIndexedRegion == null)
-					return;
-
-				int openCommentOffset = selectionStartIndexedRegion.getStartOffset();
-				int closeCommentOffset = selectionEndIndexedRegion.getEndOffset() - OPEN_COMMENT.length() - CLOSE_COMMENT.length();
-
-				model.beginRecording(this, XMLUIMessages.RemoveBlockComment_tooltip);
-				model.aboutToChangeModel();
-
-				try {
-					if (textSelection.getLength() == 0) {
-						if (selectionStartIndexedRegion instanceof CommentImpl) {
-							document.replace(openCommentOffset, OPEN_COMMENT.length(), ""); //$NON-NLS-1$
-							document.replace(closeCommentOffset, CLOSE_COMMENT.length(), ""); //$NON-NLS-1$
-						}
-					}
-					else {
-						if (selectionStartIndexedRegion instanceof CommentImpl) {
-							document.replace(openCommentOffset, OPEN_COMMENT.length(), ""); //$NON-NLS-1$
-						}
-
-						if (selectionEndIndexedRegion instanceof CommentImpl) {
-							document.replace(closeCommentOffset, CLOSE_COMMENT.length(), ""); //$NON-NLS-1$
-						}
-					}
-					removeOpenCloseComments(document, openCommentOffset + OPEN_COMMENT.length(), closeCommentOffset - openCommentOffset - CLOSE_COMMENT.length());
-				}
-				catch (BadLocationException e) {
-					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-				}
-				finally {
-					model.changedModel();
-					model.endRecording(this);
-				}
-			}
-			finally {
-				model.releaseFromEdit();
-			}
-		}
-	}
-
-	public void init(IAction action) {
-		if (action != null) {
-			action.setText(XMLUIMessages.RemoveBlockComment_label);
-			action.setToolTipText(XMLUIMessages.RemoveBlockComment_tooltip);
-			action.setDescription(XMLUIMessages.RemoveBlockComment_description);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ReplacePrefixAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ReplacePrefixAction.java
deleted file mode 100644
index 46430e9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ReplacePrefixAction.java
+++ /dev/null
@@ -1,79 +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.ui.internal.actions;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMVisitor;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-
-public class ReplacePrefixAction extends NodeAction {
-
-	class NodeCollectingDOMVisitor extends DOMVisitor {
-		public List list = new Vector();
-
-		protected boolean isPrefixChangedNeeded(Node node) {
-			String key = node.getPrefix() != null ? node.getPrefix() : ""; //$NON-NLS-1$
-			return prefixMapping.get(key) != null;
-		}
-
-		public void visitAttr(Attr attr) {
-			/*
-			 * if (isPrefixChangedNeeded(element)) { list.add(attr); }
-			 */
-		}
-
-		protected void visitElement(Element element) {
-			super.visitElement(element);
-			if (isPrefixChangedNeeded(element)) {
-				list.add(element);
-			}
-		}
-	}
-
-	protected static ImageDescriptor imageDescriptor;
-	protected Element element;
-	protected AbstractNodeActionManager manager;
-	protected Map prefixMapping;
-
-	public ReplacePrefixAction(AbstractNodeActionManager manager, Element element, Map prefixMapping) {
-		this.manager = manager;
-		this.element = element;
-		this.prefixMapping = prefixMapping;
-	}
-
-	public String getUndoDescription() {
-		return ""; //$NON-NLS-1$
-	}
-
-	public void run() {
-		NodeCollectingDOMVisitor visitor = new NodeCollectingDOMVisitor();
-		visitor.visitNode(element);
-		for (Iterator i = visitor.list.iterator(); i.hasNext();) {
-			Node node = (Node) i.next();
-			String key = node.getPrefix() != null ? node.getPrefix() : ""; //$NON-NLS-1$
-			String newPrefix = (String) prefixMapping.get(key);
-			if (newPrefix != null) {
-				node.setPrefix(newPrefix);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ToggleCommentActionXMLDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ToggleCommentActionXMLDelegate.java
deleted file mode 100644
index 017e616..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ToggleCommentActionXMLDelegate.java
+++ /dev/null
@@ -1,170 +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.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * Toggle comment action delegate for XML editor
- */
-public class ToggleCommentActionXMLDelegate extends AbstractCommentActionXMLDelegate {
-	public void init(IAction action) {
-		if (action != null) {
-			action.setText(XMLUIMessages.ToggleComment_label);
-			action.setToolTipText(XMLUIMessages.ToggleComment_tooltip);
-			action.setDescription(XMLUIMessages.ToggleComment_description);
-		}
-	}
-
-	void processAction(IDocument document, ITextSelection textSelection) {
-		// get text selection lines info
-		int selectionStartLine = textSelection.getStartLine();
-		int selectionEndLine = textSelection.getEndLine();
-		try {
-			int selectionEndLineOffset = document.getLineOffset(selectionEndLine);
-			int selectionEndOffset = textSelection.getOffset() + textSelection.getLength();
-
-			// adjust selection end line
-			if (selectionEndLine > selectionStartLine && selectionEndLineOffset == selectionEndOffset)
-				selectionEndLine--;
-
-		}
-		catch (BadLocationException e) {
-			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-		}
-
-		// save the selection position since it will be changing
-		Position selectionPosition = null;
-		boolean updateStartOffset = false;
-		try {
-			selectionPosition = new Position(textSelection.getOffset(), textSelection.getLength());
-			document.addPosition(selectionPosition);
-
-			// extra check if commenting from beginning of line
-			int selectionStartLineOffset = document.getLineOffset(selectionStartLine);
-			if (textSelection.getLength() > 0 && selectionStartLineOffset == textSelection.getOffset() && !isCommentLine(document, selectionStartLine))
-				updateStartOffset = true;
-		}
-		catch (BadLocationException e) {
-			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-		}
-
-		processAction(document, selectionStartLine, selectionEndLine);
-
-		updateCurrentSelection(selectionPosition, document, updateStartOffset);
-	}
-
-	private void processAction(IDocument document, int selectionStartLine, int selectionEndLine) {
-		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
-		if (model != null) {
-			try {
-				model.beginRecording(this, XMLUIMessages.ToggleComment_tooltip);
-				model.aboutToChangeModel();
-
-				for (int i = selectionStartLine; i <= selectionEndLine; i++) {
-					try {
-						if (document.getLineLength(i) > 0) {
-							if (isCommentLine(document, i)) {
-								int lineOffset = document.getLineOffset(i);
-								IRegion region = document.getLineInformation(i);
-								String string = document.get(region.getOffset(), region.getLength());
-								int openCommentOffset = lineOffset + string.indexOf(OPEN_COMMENT);
-								int closeCommentOffset = lineOffset + string.indexOf(CLOSE_COMMENT) - OPEN_COMMENT.length();
-								uncomment(document, openCommentOffset, closeCommentOffset);
-							}
-							else {
-								int openCommentOffset = document.getLineOffset(i);
-								int lineDelimiterLength = document.getLineDelimiter(i) == null ? 0 : document.getLineDelimiter(i).length();
-								int closeCommentOffset = openCommentOffset + document.getLineLength(i) - lineDelimiterLength + OPEN_COMMENT.length();
-								comment(document, openCommentOffset, closeCommentOffset);
-							}
-						}
-					}
-					catch (BadLocationException e) {
-						Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-					}
-				}
-			}
-			finally {
-				model.changedModel();
-				model.endRecording(this);
-				model.releaseFromEdit();
-			}
-		}
-	}
-
-	private boolean isCommentLine(IDocument document, int line) {
-		boolean isComment = false;
-
-		try {
-			IRegion region = document.getLineInformation(line);
-			String string = document.get(region.getOffset(), region.getLength()).trim();
-			isComment = string.length() >= OPEN_COMMENT.length() + CLOSE_COMMENT.length() && string.startsWith(OPEN_COMMENT) && string.endsWith(CLOSE_COMMENT);
-		}
-		catch (BadLocationException e) {
-			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-		}
-		return isComment;
-	}
-
-	private void comment(IDocument document, int openCommentOffset, int closeCommentOffset) {
-		try {
-			document.replace(openCommentOffset, 0, OPEN_COMMENT);
-			document.replace(closeCommentOffset, 0, CLOSE_COMMENT);
-			removeOpenCloseComments(document, openCommentOffset + OPEN_COMMENT.length(), closeCommentOffset - openCommentOffset - CLOSE_COMMENT.length());
-		}
-		catch (BadLocationException e) {
-			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-		}
-	}
-
-	private void uncomment(IDocument document, int openCommentOffset, int closeCommentOffset) {
-		try {
-			document.replace(openCommentOffset, OPEN_COMMENT.length(), ""); //$NON-NLS-1$
-			document.replace(closeCommentOffset, CLOSE_COMMENT.length(), ""); //$NON-NLS-1$
-		}
-		catch (BadLocationException e) {
-			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-		}
-	}
-
-	private void updateCurrentSelection(Position selectionPosition, IDocument document, boolean updateStartOffset) {
-		if (fEditor instanceof ITextEditor) {
-			// update the selection if text selection changed
-			if (selectionPosition != null) {
-				ITextSelection selection = null;
-				if (updateStartOffset)
-					selection = new TextSelection(document, selectionPosition.getOffset() - OPEN_COMMENT.length(), selectionPosition.getLength() + OPEN_COMMENT.length());
-				else
-					selection = new TextSelection(document, selectionPosition.getOffset(), selectionPosition.getLength());
-				ISelectionProvider provider = ((ITextEditor) fEditor).getSelectionProvider();
-				if (provider != null) {
-					provider.setSelection(selection);
-				}
-				document.removePosition(selectionPosition);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/AutoEditStrategyForTabs.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/AutoEditStrategyForTabs.java
deleted file mode 100644
index f7dd714..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/AutoEditStrategyForTabs.java
+++ /dev/null
@@ -1,187 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.xml.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.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.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 boolean
-	 */
-	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 int
-	 */
-	private int getIndentationWidth() {
-		int width = -1;
-
-		Preferences preferences = XMLCorePlugin.getDefault().getPluginPreferences();
-		if (XMLCorePreferenceNames.SPACE.equals(preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR)))
-			width = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
-
-		return width;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java
deleted file mode 100644
index e0056c6..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.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.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.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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.eclipse.wst.xml.ui.internal.Logger;
-import org.w3c.dom.Node;
-
-/**
- * Automatically inserts closing comment tag or end tag when appropriate.
- */
-public class StructuredAutoEditStrategyXML 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) {
-					smartInsertForComment(command, document, model);
-					smartInsertForEndTag(command, document, model);
-				}
-			}
-		}
-		finally {
-			if (model != null)
-				model.releaseFromRead();
-		}
-	}
-
-	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 smartInsertForComment(DocumentCommand command, IDocument document, IStructuredModel model) {
-		try {
-			if (command.text.equals("-") && document.getLength() >= 3 && document.get(command.offset - 3, 3).equals("<!-")) { //$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);
-		}
-
-	}
-
-	private void smartInsertForEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
-		try {
-			if (command.text.equals("/") && document.getLength() >= 1 && document.get(command.offset - 1, 1).equals("<")) { //$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();
-					if (endTagStructuredDocumentRegion == null) {
-						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);
-		}
-	}
-
-	/**
-	 * 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.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java
deleted file mode 100644
index 033c0d1..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java
+++ /dev/null
@@ -1,2306 +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.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-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.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.encoding.ContentTypeEncodingPreferences;
-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.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.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-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.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.CMEntityDeclaration;
-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.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.document.AttrImpl;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-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.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.CMImageUtil;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-import org.eclipse.wst.xml.ui.internal.taginfo.MarkupTagInfoProvider;
-import org.w3c.dom.Attr;
-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;
-
-abstract public class AbstractContentAssistProcessor implements IContentAssistProcessor, IReleasable {
-	/**
-	 * 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 class DOMJSPRegionContextsPrivateCopy {
-		private static final String JSP_CLOSE = "JSP_CLOSE"; //$NON-NLS-1$
-		private static final String JSP_COMMENT_CLOSE = "JSP_COMMENT_CLOSE"; //$NON-NLS-1$
-
-		private static final String JSP_COMMENT_OPEN = "JSP_COMMENT_OPEN"; //$NON-NLS-1$
-		private static final String JSP_DECLARATION_OPEN = "JSP_DECLARATION_OPEN"; //$NON-NLS-1$
-		private static final String JSP_DIRECTIVE_CLOSE = "JSP_DIRECTIVE_CLOSE"; //$NON-NLS-1$
-		private static final String JSP_DIRECTIVE_NAME = "JSP_DIRECTIVE_NAME"; //$NON-NLS-1$
-
-		private static final String JSP_DIRECTIVE_OPEN = "JSP_DIRECTIVE_OPEN"; //$NON-NLS-1$
-		private static final String JSP_EXPRESSION_OPEN = "JSP_EXPRESSION_OPEN"; //$NON-NLS-1$
-
-		private static final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
-
-		private static final String JSP_SCRIPTLET_OPEN = "JSP_SCRIPTLET_OPEN"; //$NON-NLS-1$
-
-	}
-
-	protected static final String INTERNALERROR = XMLUIMessages.SEVERE_internal_error_occu_UI_;
-	protected static final String UNKNOWN_ATTR = XMLUIMessages.No_known_attribute__UI_;
-	protected static final String UNKNOWN_CONTEXT = XMLUIMessages.Content_Assist_not_availab_UI_;
-	protected char completionProposalAutoActivationCharacters[] = null;
-	protected char contextInformationAutoActivationCharacters[] = null;
-	private AttributeContextInformationProvider fAttributeInfoProvider = null;
-	private AttributeContextInformationPresenter fContextInformationPresenter = null;
-
-	protected String fErrorMessage = null;
-	protected XMLContentModelGenerator fGenerator;
-	// protected IResource resource = null;
-	protected MarkupTagInfoProvider fInfoProvider = null;
-	protected ITextViewer fTextViewer = null;
-
-	private final boolean showValues = true;
-
-	public AbstractContentAssistProcessor() {
-		init();
-	}
-
-	protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
-		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-		IStructuredDocumentRegion sdRegion = contentAssistRequest.getDocumentRegion();
-		// retrieve the list of attributes
-		CMElementDeclaration elementDecl = getCMElementDeclaration(node);
-		if (elementDecl != null) {
-			CMNamedNodeMap attributes = elementDecl.getAttributes();
-			String matchString = contentAssistRequest.getMatchString();
-
-			// check whether an attribute really exists for the replacement
-			// offsets AND if it possesses a value
-			boolean attrAtLocationHasValue = false;
-			NamedNodeMap attrs = node.getAttributes();
-			for (int i = 0; i < attrs.getLength(); i++) {
-				AttrImpl existingAttr = (AttrImpl) attrs.item(i);
-				ITextRegion name = existingAttr.getNameRegion();
-
-				if (sdRegion.getStartOffset(name) <= contentAssistRequest.getReplacementBeginPosition() && sdRegion.getStartOffset(name) + name.getLength() >= contentAssistRequest.getReplacementBeginPosition() + contentAssistRequest.getReplacementLength() && existingAttr.getValueRegion() != null) {
-					attrAtLocationHasValue = true;
-					break;
-				}
-			}
-
-			// only add proposals for the attributes whose names begin with
-			// the matchstring
-			if (attributes != null) {
-				for (int i = 0; i < attributes.getLength(); i++) {
-					CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attributes.item(i);
-					// CMVC 246618
-					int isRequired = 0;
-					if (attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED) {
-						isRequired = XMLRelevanceConstants.R_REQUIRED;
-					}
-
-					boolean showAttribute = true;
-					showAttribute = showAttribute && beginsWith(getRequiredName(node, attrDecl), matchString.trim());
-					AttrImpl attr = (AttrImpl) node.getAttributes().getNamedItem(getRequiredName(node, attrDecl));
-					ITextRegion nameRegion = attr != null ? attr.getNameRegion() : null;
-					// nameRegion.getEndOffset() + 1 is required to allow for
-					// matches against the full name of an existing Attr
-					showAttribute = showAttribute && ((attr == null) || (nameRegion != null && sdRegion.getStartOffset(nameRegion) <= contentAssistRequest.getReplacementBeginPosition() && sdRegion.getStartOffset(nameRegion) + nameRegion.getLength() >= contentAssistRequest.getReplacementBeginPosition() + contentAssistRequest.getReplacementLength()));
-					if (showAttribute) {
-						Image attrImage = CMImageUtil.getImage(attrDecl);
-						if (attrImage == null) {
-							if (isRequired > 0) {
-								attrImage = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATT_REQ_OBJ);
-							}
-							else {
-								attrImage = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
-							}
-						}
-
-						String proposedText = null;
-						String proposedInfo = getAdditionalInfo(elementDecl, attrDecl);
-						CustomCompletionProposal proposal = null;
-						// attribute is at this location and already exists
-						if (attrAtLocationHasValue) {
-							// only propose the name
-							proposedText = getRequiredName(node, attrDecl);
-							proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), proposedText.length(), attrImage, proposedText, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_NAME + isRequired, true); // CMVC
-							// 269884
-						}
-						// no attribute exists or is elsewhere, generate
-						// minimally
-						else {
-							Attr existingAttrNode = (Attr) node.getAttributes().getNamedItem(getRequiredName(node, attrDecl));
-							String value = null;
-							if (existingAttrNode != null)
-								value = existingAttrNode.getNodeValue();
-							if (value != null && value.length() > 0)
-								proposedText = getRequiredName(node, attrDecl);
-							else {
-								proposedText = getRequiredText(node, attrDecl);
-							}
-							proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), attrDecl.getNodeName().length() + 2, attrImage,
-							// if the value isn't empty (no empty set of
-										// quotes), show it
-										(showValues && proposedText.indexOf("\"\"") < 0) ? proposedText : getRequiredName(node, attrDecl), //$NON-NLS-1$
-										null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_NAME + isRequired);
-						}
-						contentAssistRequest.addProposal(proposal);
-					}
-				}
-			}
-		}
-		else {
-			setErrorMessage(NLS.bind(XMLUIMessages.Element__is_unknown, (new Object[]{node.getNodeName()})));
-		}
-	}
-
-	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
-		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
-		// Find the attribute region and name for which this position should
-		// have a value proposed
-		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;
-		}
-
-		// the name region is REQUIRED to do anything useful
-		if (nameRegion != null) {
-			// Retrieve the declaration
-			CMElementDeclaration elementDecl = getCMElementDeclaration(node);
-
-			// String attributeName = nameRegion.getText();
-			String attributeName = open.getText(nameRegion);
-
-			CMAttributeDeclaration attrDecl = null;
-
-			// No CMElementDeclaration means no attribute metadata, but
-			// retrieve the
-			// declaration for the attribute otherwise
-			if (elementDecl != null) {
-				CMNamedNodeMap attributes = elementDecl.getAttributes();
-				String noprefixName = DOMNamespaceHelper.getUnprefixedName(attributeName);
-				if (attributes != null) {
-					attrDecl = (CMAttributeDeclaration) attributes.getNamedItem(noprefixName);
-					if (attrDecl == null) {
-						attrDecl = (CMAttributeDeclaration) attributes.getNamedItem(attributeName);
-					}
-				}
-				if (attrDecl == null) {
-					setErrorMessage(UNKNOWN_ATTR, attributeName);
-				}
-			}
-
-			String currentValue = node.getAttributes().getNamedItem(attributeName).getNodeValue();
-			String proposedInfo = null;
-			Image image = CMImageUtil.getImage(attrDecl);
-			if (image == null) {
-				if (attrDecl != null && attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED) {
-					image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATT_REQ_OBJ);
-				}
-				else {
-					image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
-				}
-			}
-
-			if (attrDecl != null && attrDecl.getAttrType() != null) {
-				// attribute is known, prompt with values from the declaration
-				proposedInfo = getAdditionalInfo(elementDecl, attrDecl);
-				List possibleValues = getPossibleDataTypeValues(node, attrDecl);
-				if (possibleValues.size() > 0) {
-					// ENUMERATED VALUES
-					String matchString = contentAssistRequest.getMatchString();
-					if (matchString == null)
-						matchString = ""; //$NON-NLS-1$
-					if (matchString.length() > 0 && (matchString.startsWith("\"") || matchString.startsWith("'"))) //$NON-NLS-2$//$NON-NLS-1$
-						matchString = matchString.substring(1);
-					boolean currentValid = false;
-
-					// d210858, if the region's a container, don't suggest the
-					// enumerated values as they probably won't help
-					boolean existingComplicatedValue = contentAssistRequest.getRegion() != null && contentAssistRequest.getRegion() instanceof ITextRegionContainer;
-					if (!existingComplicatedValue) {
-						for (Iterator j = possibleValues.iterator(); j.hasNext();) {
-							String possibleValue = (String) j.next();
-							currentValid = currentValid || possibleValue.equals(currentValue);
-							if (matchString.length() == 0 || possibleValue.startsWith(matchString)) {
-								CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + possibleValue + "\"", //$NON-NLS-2$//$NON-NLS-1$
-											contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), possibleValue.length() + 1, image, possibleValue, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
-								contentAssistRequest.addProposal(proposal);
-							}
-						}
-					}
-				}
-				else if ((attrDecl.getUsage() == CMAttributeDeclaration.FIXED || attrDecl.getAttrType().getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED) && attrDecl.getAttrType().getImpliedValue() != null) {
-					// FIXED values
-					String value = attrDecl.getAttrType().getImpliedValue();
-					if (value != null && value.length() > 0) {
-						CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + value + "\"", //$NON-NLS-2$//$NON-NLS-1$
-									contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), value.length() + 1, image, value, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
-						contentAssistRequest.addProposal(proposal);
-						if (currentValue.length() > 0 && !value.equals(currentValue)) {
-							proposal = new CustomCompletionProposal("\"" + currentValue + "\"", //$NON-NLS-2$//$NON-NLS-1$
-										contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), currentValue.length() + 1, image, currentValue, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
-							contentAssistRequest.addProposal(proposal);
-						}
-					}
-				}
-			}
-			else {
-				// unknown attribute, so supply nice empty values
-				proposedInfo = getAdditionalInfo(null, elementDecl);
-				CustomCompletionProposal proposal = null;
-				if (currentValue != null && currentValue.length() > 0) {
-					proposal = new CustomCompletionProposal("\"" + currentValue + "\"", //$NON-NLS-2$//$NON-NLS-1$
-								contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 1, image, "\"" + currentValue + "\"", //$NON-NLS-2$//$NON-NLS-1$
-								null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
-					contentAssistRequest.addProposal(proposal);
-				}
-			}
-		}
-		else
-			setErrorMessage(UNKNOWN_CONTEXT);
-	}
-
-	protected void addCommentProposal(ContentAssistRequest contentAssistRequest) {
-		contentAssistRequest.addProposal(new CustomCompletionProposal("<!--  -->", //$NON-NLS-1$
-					contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 5, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_COMMENT), NLS.bind(XMLUIMessages.Comment__, (new Object[]{" <!--  -->"})), //$NON-NLS-1$
-					null, null, XMLRelevanceConstants.R_COMMENT));
-	}
-
-	/**
-	 * Add all of the element declarations int the CMContent object into one
-	 * big list.
-	 */
-	protected void addContent(List contentList, CMContent content) {
-		if (content == null)
-			return;
-		if (content instanceof CMGroup) {
-			CMNodeList children = ((CMGroup) content).getChildNodes();
-			if (children == null)
-				return;
-			for (int i = 0; i < children.getLength(); i++) {
-				CMNode child = children.item(i);
-				if (child.getNodeType() == CMNode.ELEMENT_DECLARATION) {
-					contentList.add(child);
-				}
-				else {
-					if (child.getNodeType() == CMNode.GROUP) {
-						addContent(contentList, (CMContent) child);
-					}
-					else {
-						throw new IllegalArgumentException("Unknown content child: " + child); //$NON-NLS-1$
-					}
-				}
-			}
-		}
-		else {
-			contentList.add(content);
-		}
-	}
-
-	protected void addDocTypeProposal(ContentAssistRequest contentAssistRequest) {
-		// 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();
-
-		String proposedText = "<!DOCTYPE " + rootname + " PUBLIC \"//UNKNOWN/\" \"unknown.dtd\">"; //$NON-NLS-1$ //$NON-NLS-2$
-		ICompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 10, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DOCTYPE), "<!DOCTYPE ... >", //$NON-NLS-1$
-					null, null, XMLRelevanceConstants.R_DOCTYPE);
-		// TODO provide special documentation on doc type
-		contentAssistRequest.addProposal(proposal);
-	}
-
-	/**
-	 * Add the proposals for a completely empty document
-	 */
-	protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
-		addXMLProposal(contentAssistRequest);
-	}
-
-	/**
-	 * Add the proposals for the name in an end tag
-	 */
-	protected void addEndTagNameProposals(ContentAssistRequest contentAssistRequest) {
-
-		if (contentAssistRequest.getStartOffset() + contentAssistRequest.getRegion().getTextLength() < contentAssistRequest.getReplacementBeginPosition()) {
-			CustomCompletionProposal proposal = new CustomCompletionProposal(">", //$NON-NLS-1$
-						contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 1, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC), NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" '>'"})), //$NON-NLS-1$
-						null, null, XMLRelevanceConstants.R_END_TAG_NAME);
-			contentAssistRequest.addProposal(proposal);
-		}
-		else {
-			IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
-			Node aNode = contentAssistRequest.getNode();
-			String matchString = contentAssistRequest.getMatchString();
-			if (matchString.startsWith("</")) //$NON-NLS-1$
-				matchString = matchString.substring(2);
-			while (aNode != null) {
-				if (aNode.getNodeType() == Node.ELEMENT_NODE) {
-					if (aNode.getNodeName().startsWith(matchString)) {
-						IDOMNode aXMLNode = (IDOMNode) aNode;
-						CMElementDeclaration ed = modelQuery.getCMElementDeclaration((Element) aNode);
-						if ((aXMLNode.getEndStructuredDocumentRegion() == null) && (ed == null || (ed.getContentType() != CMElementDeclaration.EMPTY))) {
-							String proposedText = aNode.getNodeName();
-							String proposedInfo = (ed != null) ? getAdditionalInfo(null, ed) : null;
-							if (node.getNodeType() == Node.TEXT_NODE && !contentAssistRequest.getDocumentRegion().isEnded())
-								proposedText += ">"; //$NON-NLS-1$
-							CustomCompletionProposal proposal = null;
-							// double check to see if the region acted upon is
-							// a tag name; replace it if so
-							Image image = CMImageUtil.getImage(ed);
-							if (image == null) {
-								image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
-							}
-							if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_NAME) {
-								proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getStartOffset(), contentAssistRequest.getRegion().getTextLength(), proposedText.length(), image, proposedText, null, proposedInfo, XMLRelevanceConstants.R_END_TAG_NAME);
-							}
-							else {
-								proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), proposedText.length(), image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{"'" + proposedText + "'"})), //$NON-NLS-1$ //$NON-NLS-2$
-											null, proposedInfo, XMLRelevanceConstants.R_END_TAG_NAME);
-							}
-							contentAssistRequest.addProposal(proposal);
-						}
-					}
-				}
-				aNode = aNode.getParentNode();
-			}
-		}
-	}
-
-	/**
-	 * Prompt for end tags to a non-empty Node that hasn't ended Handles these
-	 * cases: <br>
-	 * <tagOpen>| <br>
-	 * <tagOpen>< |<br>
-	 * <tagOpen></ |
-	 * 
-	 * @param contentAssistRequest
-	 */
-	protected void addEndTagProposals(ContentAssistRequest contentAssistRequest) {
-		IDOMNode node = (IDOMNode) contentAssistRequest.getParent();
-
-		if (isCommentNode(node)) {
-			// loop and find non comment node parent
-			while (node != null && isCommentNode(node)) {
-				node = (IDOMNode) node.getParentNode();
-			}
-		}
-		
-		// node is already closed
-		if(node.isClosed()) {
-			// loop and find non comment unclose node parent
-			while (node != null && node.isClosed()) {
-				node = (IDOMNode) node.getParentNode();
-			}
-		}
-		// there were no unclosed tags
-		if(node == null)
-			return;
-		
-		// data to create a CustomCompletionProposal
-		String replaceText = node.getNodeName() + ">"; //$NON-NLS-1$
-		int replaceBegin = contentAssistRequest.getReplacementBeginPosition();
-		int replaceLength = contentAssistRequest.getReplacementLength();
-		int cursorOffset = node.getNodeName().length() + 1;
-		String displayString = ""; //$NON-NLS-1$
-		String proposedInfo = ""; //$NON-NLS-1$
-		Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
-
-		setErrorMessage(null);
-		boolean addProposal = false;
-
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			// fix for CMVC 261790
-			// ////////////////////////////////////////////////////////////////////////////////////
-			IStructuredDocument sDoc = (IStructuredDocument) fTextViewer.getDocument();
-			IStructuredDocumentRegion xmlEndTagOpen = sDoc.getRegionAtCharacterOffset(contentAssistRequest.getReplacementBeginPosition());
-			// skip backward to "<", "</", or the (unclosed) start tag, null
-			// if not found
-			String type = ""; //$NON-NLS-1$
-			while (xmlEndTagOpen != null && (type = xmlEndTagOpen.getType()) != DOMRegionContext.XML_END_TAG_OPEN && type != DOMRegionContext.XML_TAG_CLOSE && !needsEndTag(xmlEndTagOpen) && type != DOMRegionContext.XML_TAG_OPEN) {
-				xmlEndTagOpen = xmlEndTagOpen.getPrevious();
-			}
-
-			if (xmlEndTagOpen == null)
-				return;
-
-			node = (IDOMNode) node.getModel().getIndexedRegion(xmlEndTagOpen.getStartOffset());
-			node = (IDOMNode) node.getParentNode();
-			
-			if (isStartTag(xmlEndTagOpen)) {
-				// this is the case for a start tag w/out end tag
-				// eg:
-				// <p>
-				// <% String test = "test"; %>
-				// |
-				if (needsEndTag(xmlEndTagOpen)) {
-					String tagName = getTagName(xmlEndTagOpen);
-					xmlEndTagOpen.getTextEndOffset();
-					replaceLength = 0;
-					replaceText = "</" + tagName + ">"; //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
-					// replaceText = "</" + node.getNodeName() + ">";
-					// //$NON-NLS-1$ $NON-NLS-2$
-					cursorOffset = tagName.length() + 3;
-					displayString = NLS.bind(XMLUIMessages.End_with__, (new Object[]{tagName}));
-					addProposal = true;
-				}
-			}
-			else if (type == DOMRegionContext.XML_END_TAG_OPEN) {
-				// this is the case for: <tag> </ |
-				// possibly <tag> </ |<anotherTag>
-				// should only be replacing white space...
-				replaceLength = (replaceBegin > xmlEndTagOpen.getTextEndOffset()) ? replaceBegin - xmlEndTagOpen.getTextEndOffset() : 0;
-				replaceText = node.getNodeName() + ">"; //$NON-NLS-1$
-				cursorOffset = replaceText.length();
-				replaceBegin = xmlEndTagOpen.getTextEndOffset();
-				displayString = NLS.bind(XMLUIMessages.End_with_, (new Object[]{node.getNodeName()}));
-				addProposal = true;
-			}
-			else if (type == DOMRegionContext.XML_TAG_OPEN) {
-				// this is the case for: <tag> < |
-				replaceText = "/" + node.getNodeName() + ">"; //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
-				cursorOffset = replaceText.length();
-				// replaceText = "/" + node.getNodeName() + ">"; //$NON-NLS-1$
-				// $NON-NLS-2$
-				// should only be replacing white space...
-				replaceLength = (replaceBegin > xmlEndTagOpen.getTextEndOffset()) ? replaceBegin - xmlEndTagOpen.getTextEndOffset() : 0;
-				replaceBegin = xmlEndTagOpen.getTextEndOffset();
-				displayString = NLS.bind(XMLUIMessages.End_with_,  (new Object[]{"/" + node.getNodeName()})); //$NON-NLS-1$
-				addProposal = true;
-			}
-		}
-		// fix for CMVC 261790
-		// ////////////////////////////////////////////////////////////////////////////////////
-		// fix for CMVC 263163, sometimes the node is not null, but
-		// getNodeValue() is null, put in a null check
-		else if (node.getNodeValue() != null && node.getNodeValue().indexOf("</") != -1) { //$NON-NLS-1$
-			// the case where "</" is started, but the nodes comes in as a
-			// text node (instead of element)
-			// like this: <tag> </|
-			Node parent = node.getParentNode();
-			if (parent != null && parent.getNodeType() != Node.DOCUMENT_NODE) {
-				replaceText = parent.getNodeName() + ">"; //$NON-NLS-1$
-				cursorOffset = replaceText.length();
-				displayString = NLS.bind(XMLUIMessages.End_with__, (new Object[]{parent.getNodeName()}));
-				setErrorMessage(null);
-				addProposal = true;
-			}
-		}
-		// end fix for CMVC 261790
-		// ////////////////////////////////////////////////////////////////////////////////////
-		else if (node.getNodeType() == Node.DOCUMENT_NODE) {
-			setErrorMessage(UNKNOWN_CONTEXT);
-		}
-		if (addProposal == true) {
-			CustomCompletionProposal proposal = new CustomCompletionProposal(replaceText, replaceBegin, replaceLength, cursorOffset, image, displayString, null, proposedInfo, XMLRelevanceConstants.R_END_TAG);
-			contentAssistRequest.addProposal(proposal);
-		}
-	}
-
-	protected void addEntityProposals(ContentAssistRequest contentAssistRequest, int documentPosition, ITextRegion completionRegion, IDOMNode treeNode) {
-		ICompletionProposal[] eps = computeEntityReferenceProposals(documentPosition, completionRegion, treeNode);
-		for (int i = 0; eps != null && i < eps.length; i++)
-			contentAssistRequest.addProposal(eps[i]);
-	}
-
-	protected void addEntityProposals(Vector proposals, Properties map, String key, int nodeOffset, IStructuredDocumentRegion sdRegion, ITextRegion completionRegion) {
-		if (map == null)
-			return;
-		String entityName = ""; //$NON-NLS-1$
-		String entityValue = ""; //$NON-NLS-1$
-		Image entityIcon = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENTITY_REFERENCE);
-		String replacementText = ""; //$NON-NLS-1$
-		String displayString = ""; //$NON-NLS-1$
-		Enumeration keys = map.keys();
-
-		while (keys != null && keys.hasMoreElements()) {
-			entityName = (String) keys.nextElement();
-			entityValue = map.getProperty(entityName);
-			// filter based on partial entity string...
-			if (entityName.toLowerCase().startsWith(key.toLowerCase()) || key.trim().equals("")) //$NON-NLS-1$
-			{
-				// figure out selection...if text is selected, add it to
-				// selection length
-				int selectionLength = nodeOffset;
-				if (fTextViewer != null) {
-					selectionLength += fTextViewer.getSelectedRange().y;
-				}
-				// create a new proposal for entity string...
-				replacementText = "&" + entityName + ";"; //$NON-NLS-1$ //$NON-NLS-2$ 
-				displayString = "&" + entityName + "; (" + entityValue + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-				ICompletionProposal cp = new CustomCompletionProposal(replacementText, sdRegion.getStartOffset(completionRegion), selectionLength, replacementText.length(), entityIcon, displayString, null, null, XMLRelevanceConstants.R_ENTITY);
-				if (cp != null) {
-					proposals.add(cp);
-				}
-			}
-		}
-	}
-
-	protected void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest) {
-		CustomCompletionProposal proposal = new CustomCompletionProposal("<![CDATA[]]>", //$NON-NLS-1$
-					contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 9, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_CDATASECTION), "CDATA Section", //$NON-NLS-1$
-					null, null, XMLRelevanceConstants.R_CDATA);
-		contentAssistRequest.addProposal(proposal);
-
-		proposal = new CustomCompletionProposal(nodeName, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), nodeName.length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TXTEXT), "#PCDATA", //$NON-NLS-1$
-					null, null, XMLRelevanceConstants.R_CDATA);
-		contentAssistRequest.addProposal(proposal);
-	}
-
-	protected void addStartDocumentProposals(ContentAssistRequest contentAssistRequest) {
-		Node aNode = contentAssistRequest.getNode();
-		boolean xmlpiFound = false;
-		Document owningDocument = aNode.getOwnerDocument();
-		// ==> // int xmlpiNodePosition = -1;
-
-		// make sure xmlpi is root element
-		// don't want doctype proposal if XMLPI isn't first element...
-		// CMVC 242943
-		// CMVC 245532
-		Node first = owningDocument.getFirstChild();
-		boolean xmlpiIsFirstElement = (first != null && first.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE);
-		boolean insertDoctype = xmlpiIsFirstElement;
-
-		for (Node child = owningDocument.getFirstChild(); child != null; child = child.getNextSibling()) {
-			boolean xmlpi = (child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE && child.getNodeName().equals("xml")); //$NON-NLS-1$
-			xmlpiFound = xmlpiFound || xmlpi;
-			if (xmlpiFound) {
-				if (child instanceof IDOMNode) {
-					// ==> // int xmlpiNodePosition =
-					// ((XMLNode)child).getEndOffset();
-				}
-				// skip white space and text
-				while ((child = child.getNextSibling()) != null && (child.getNodeType() == Node.TEXT_NODE)) {
-				}
-				// check if theres a node inbetween XMLPI and cursor position
-				if (child != null && child instanceof IDOMNode) {
-					// CMVC 257486
-					if (contentAssistRequest.getReplacementBeginPosition() >= ((IDOMNode) child).getEndOffset() || !xmlpiIsFirstElement) {
-						insertDoctype = false;
-					}
-				}
-				break;
-			}
-		}
-
-		if (!xmlpiFound) {
-			addXMLProposal(contentAssistRequest);
-		}
-		else if (owningDocument.getDoctype() == null && isCursorAfterXMLPI(contentAssistRequest) && insertDoctype) {
-			addDocTypeProposal(contentAssistRequest);
-		}
-	}
-
-	/**
-	 * Close an unclosed start tag
-	 */
-	protected void addTagCloseProposals(ContentAssistRequest contentAssistRequest) {
-		IDOMNode node = (IDOMNode) contentAssistRequest.getParent();
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-
-			CMElementDeclaration elementDecl = getCMElementDeclaration(node);
-			String proposedInfo = (elementDecl != null) ? getAdditionalInfo(null, elementDecl) : null;
-			int contentType = (elementDecl != null) ? elementDecl.getContentType() : CMElementDeclaration.ANY;
-			// if it's XML and content doesn't HAVE to be element, add "/>"
-			// proposal.
-			boolean endWithSlashBracket = (getXML(node) && contentType != CMElementDeclaration.ELEMENT);
-
-			Image image = CMImageUtil.getImage(elementDecl);
-			if (image == null) {
-				image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
-			}
-
-			// is the start tag ended properly?
-			if (contentAssistRequest.getDocumentRegion() == node.getFirstStructuredDocumentRegion() && !(node.getFirstStructuredDocumentRegion()).isEnded()) {
-				setErrorMessage(null);
-				// Is this supposed to be an empty tag? Note that if we can't
-				// tell, we assume it's not.
-				if (elementDecl != null && elementDecl.getContentType() == CMElementDeclaration.EMPTY) {
-					// prompt with a self-closing end character if needed
-					CustomCompletionProposal proposal = new CustomCompletionProposal(getContentGenerator().getStartTagClose(node, elementDecl), contentAssistRequest.getReplacementBeginPosition(),
-					// this is one of the few times to ignore the length --
-								// always insert
-								// contentAssistRequest.getReplacementLength(),
-								0, getContentGenerator().getStartTagClose(node, elementDecl).length(), image, NLS.bind(XMLUIMessages.Close_with___, (new Object[]{getContentGenerator().getStartTagClose(node, elementDecl)})),
-								null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
-					contentAssistRequest.addProposal(proposal);
-				}
-				else {
-					// prompt with a close for the start tag
-					CustomCompletionProposal proposal = new CustomCompletionProposal(">", //$NON-NLS-1$
-								contentAssistRequest.getReplacementBeginPosition(),
-								// this is one of the few times to ignore the
-								// length -- always insert
-								// contentAssistRequest.getReplacementLength(),
-								0, 1, image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" '>'"})), //$NON-NLS-1$
-								null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
-					contentAssistRequest.addProposal(proposal);
-
-					// prompt with the closer for the start tag and an end tag
-					// if one is not present
-					if (node.getEndStructuredDocumentRegion() == null) {
-						// FIX FOR CMVC 247482
-						// make sure tag name is actually what it thinks it
-						// is...(eg. <%@ vs. <jsp:directive)
-						IStructuredDocumentRegion sdr = contentAssistRequest.getDocumentRegion();
-						String openingTagText = (sdr != null) ? sdr.getFullText() : ""; //$NON-NLS-1$
-						if (openingTagText != null && openingTagText.indexOf(node.getNodeName()) != -1) {
-							proposal = new CustomCompletionProposal("></" + node.getNodeName() + ">", //$NON-NLS-2$//$NON-NLS-1$
-										contentAssistRequest.getReplacementBeginPosition(),
-										// this is one of the few times to
-										// ignore the length -- always insert
-										// contentAssistRequest.getReplacementLength(),
-										0, 1, image, NLS.bind(XMLUIMessages.Close_with____, (new Object[]{node.getNodeName()})),
-										null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
-							contentAssistRequest.addProposal(proposal);
-						}
-					}
-					// prompt with slash bracket "/>" incase if it's a self
-					// ending tag
-					if (endWithSlashBracket) {
-						proposal = new CustomCompletionProposal("/>", //$NON-NLS-1$
-									contentAssistRequest.getReplacementBeginPosition(),
-									// this is one of the few times to ignore
-									// the length -- always insert
-									// contentAssistRequest.getReplacementLength(),
-									0, 2, image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" \"/>\""})), //$NON-NLS-1$
-									null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG + 1); // +1
-						// to
-						// bring
-						// to
-						// top
-						// of
-						// list
-						contentAssistRequest.addProposal(proposal);
-					}
-				}
-			}
-			else if (contentAssistRequest.getDocumentRegion() == node.getLastStructuredDocumentRegion() && !node.getLastStructuredDocumentRegion().isEnded()) {
-				setErrorMessage(null);
-				// prompt with a closing end character for the end tag
-				CustomCompletionProposal proposal = new CustomCompletionProposal(">", //$NON-NLS-1$
-							contentAssistRequest.getReplacementBeginPosition(),
-							// this is one of the few times to ignore the
-							// length -- always insert
-							// contentAssistRequest.getReplacementLength(),
-							0, 1, image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" '>'"})), //$NON-NLS-1$
-							null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
-				contentAssistRequest.addProposal(proposal);
-			}
-		}
-		else if (node.getNodeType() == Node.DOCUMENT_NODE) {
-			setErrorMessage(UNKNOWN_CONTEXT);
-		}
-	}
-
-	protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
-		List cmnodes = null;
-		Node parent = contentAssistRequest.getParent();
-		String error = null;
-
-		// CMVC #242943 shouldn't have proposals before XMLPI
-		// (nsd) This is only valid at the document element level
-		// only valid if it's XML (check added 2/17/2004)
-		if (parent != null && parent.getNodeType() == Node.DOCUMENT_NODE && ((IDOMDocument) parent).isXMLType() && !isCursorAfterXMLPI(contentAssistRequest)) {
-			return;
-		}
-		// only want proposals if cursor is after doctype...
-		if (!isCursorAfterDoctype(contentAssistRequest))
-			return;
-
-		// CMVC 248081
-		// fix for meta-info comment nodes.. they currently "hide" other
-		// proposals because the don't
-		// have a content model (so can't propose any children..)
-		if (parent != null && parent instanceof IDOMNode && isCommentNode((IDOMNode) parent)) {
-			// loop and find non comment node?
-			while (parent != null && isCommentNode((IDOMNode) parent)) {
-				parent = parent.getParentNode();
-			}
-		}
-
-		if (parent.getNodeType() == Node.ELEMENT_NODE) {
-			CMElementDeclaration parentDecl = getCMElementDeclaration(parent);
-			if (parentDecl != null) {
-				// XSD-specific ability - no filtering
-				CMDataType childType = parentDecl.getDataType();
-				if (childType != null) {
-					String[] childStrings = childType.getEnumeratedValues();
-					if (childStrings != null) {
-						// the content string is the sole valid child...so
-						// replace the rest
-						int begin = contentAssistRequest.getReplacementBeginPosition();
-						int length = contentAssistRequest.getReplacementLength();
-						if (parent instanceof IDOMNode) {
-							if (((IDOMNode) parent).getLastStructuredDocumentRegion() != ((IDOMNode) parent).getFirstStructuredDocumentRegion()) {
-								begin = ((IDOMNode) parent).getFirstStructuredDocumentRegion().getEndOffset();
-								length = ((IDOMNode) parent).getLastStructuredDocumentRegion().getStartOffset() - begin;
-							}
-						}
-						String proposedInfo = getAdditionalInfo(parentDecl, childType);
-						for (int i = 0; i < childStrings.length; i++) {
-							CustomCompletionProposal textProposal = new CustomCompletionProposal(childStrings[i], begin, length, childStrings[i].length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENUM), childStrings[i], null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
-							contentAssistRequest.addProposal(textProposal);
-						}
-					}
-				}
-			}
-			if (parentDecl != null && parentDecl.getContentType() == CMElementDeclaration.PCDATA) {
-				addPCDATAProposal(parentDecl.getNodeName(), contentAssistRequest);
-			}
-			else {
-				// retrieve the list of all possible children within this parent context
-				cmnodes = getAvailableChildElementDeclarations((Element)parent, childPosition, ModelQueryAction.INSERT);
-                
-                // retrieve the list of the possible children within this parent context and at this index
-                List strictCMNodeSuggestions = null;
-                if (XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_STRICT.equals(XMLUIPlugin.getInstance().getPreferenceStore().getString(XMLUIPreferenceNames.SUGGESTION_STRATEGY))) 
-                { 
-                  strictCMNodeSuggestions = getValidChildElementDeclarations((Element)parent, childPosition, ModelQueryAction.INSERT);                
-                }
- 				Iterator nodeIterator = cmnodes.iterator();
-				if (!nodeIterator.hasNext()) {
-					if (getCMElementDeclaration(parent) != null)
-						error = NLS.bind(XMLUIMessages._Has_no_available_child, (new Object[]{parent.getNodeName()}));
-					else
-						error = NLS.bind(XMLUIMessages.Element__is_unknown, (new Object[]{parent.getNodeName()}));
-				}
-				String matchString = contentAssistRequest.getMatchString();
-				// chop off any leading <'s and whitespace from the
-				// matchstring
-				while ((matchString.length() > 0) && (Character.isWhitespace(matchString.charAt(0)) || beginsWith(matchString, "<"))) //$NON-NLS-1$
-					//$NON-NLS-1$
-					matchString = matchString.substring(1);
-				while (nodeIterator.hasNext()) {
-					Object o = nodeIterator.next();
-					if (o instanceof CMElementDeclaration) {
-						CMElementDeclaration elementDecl = (CMElementDeclaration) o;
-						// only add proposals for the child element's that
-						// begin with the matchstring
-						String tagname = getRequiredName(parent, elementDecl);
-                        boolean isStrictCMNodeSuggestion = strictCMNodeSuggestions != null ? strictCMNodeSuggestions.contains(elementDecl) : false;
-                        
-                        Image image = CMImageUtil.getImage(elementDecl);
-  
-						if (image == null) {
-                            if (strictCMNodeSuggestions != null) {
-                                image = isStrictCMNodeSuggestion ?                                 
-							            XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC_EMPHASIZED) :
-                                        XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC_DEEMPHASIZED);                                                                                        
-                            }
-                            else {
-                                image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
-                            }
-                              
-						}
-						// Account for the &lt; and &gt;. If attributes were
-						// added, the cursor will be placed
-						// at the offset before of the first character of the
-						// first attribute name.
-						int markupAdjustment = getContentGenerator().getMinimalStartTagLength(parent, elementDecl);
-						if (beginsWith(tagname, matchString)) {
-							String proposedText = getRequiredText(parent, elementDecl);
-							String proposedInfo = getAdditionalInfo(parentDecl, elementDecl);
-                            int relevance = isStrictCMNodeSuggestion ? XMLRelevanceConstants.R_STRICTLY_VALID_TAG_INSERTION : XMLRelevanceConstants.R_TAG_INSERTION; 
-							CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), markupAdjustment, image, tagname, null, proposedInfo, relevance);
-							contentAssistRequest.addProposal(proposal);
-						}
-					}
-				}
-				if (contentAssistRequest.getProposals().size() == 0) {
-					if (error != null)
-						setErrorMessage(error);
-					else if (contentAssistRequest.getMatchString() != null && contentAssistRequest.getMatchString().length() > 0)
-						setErrorMessage(NLS.bind(XMLUIMessages.No_known_child_tag, (new Object[]{parent.getNodeName(), contentAssistRequest.getMatchString()})));
-					//$NON-NLS-1$ = "No known child tag names of <{0}> begin with \"{1}\"."
-					else
-						setErrorMessage(NLS.bind(XMLUIMessages.__Has_no_known_child, (new Object[]{parent.getNodeName()})));
-				}
-			}
-		}
-		else if (parent.getNodeType() == Node.DOCUMENT_NODE) {
-			// Can only prompt with elements if the cursor position is past
-			// the XML processing
-			// instruction and DOCTYPE declaration
-			boolean xmlpiFound = false;
-			boolean doctypeFound = false;
-			int minimumOffset = -1;
-
-			for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
-
-				boolean xmlpi = (child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE && child.getNodeName().equals("xml")); //$NON-NLS-1$
-				boolean doctype = child.getNodeType() == Node.DOCUMENT_TYPE_NODE;
-				if (xmlpi || doctype && minimumOffset < 0)
-					minimumOffset = ((IDOMNode) child).getFirstStructuredDocumentRegion().getStartOffset() + ((IDOMNode) child).getFirstStructuredDocumentRegion().getTextLength();
-				xmlpiFound = xmlpiFound || xmlpi;
-				doctypeFound = doctypeFound || doctype;
-			}
-			if (!xmlpiFound && contentAssistRequest.getReplacementBeginPosition() < minimumOffset) {
-				addXMLProposal(contentAssistRequest);
-			}
-
-			if (contentAssistRequest.getReplacementBeginPosition() >= minimumOffset) {
-				List childDecls = getAvailableRootChildren((Document) parent, childPosition);
-				for (int i = 0; i < childDecls.size(); i++) {
-					CMElementDeclaration ed = (CMElementDeclaration) childDecls.get(i);
-					if (ed != null) {
-						Image image = CMImageUtil.getImage(ed);
-						if (image == null) {
-							image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
-						}
-						String proposedText = getRequiredText(parent, ed);
-						String tagname = getRequiredName(parent, ed);
-						// account for the &lt; and &gt;
-						int markupAdjustment = getContentGenerator().getMinimalStartTagLength(parent, 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);
-					}
-				}
-			}
-		}
-	}
-
-	protected void addTagNameProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
-		List cmnodes = null;
-		Node parent = contentAssistRequest.getParent();
-		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-		String error = null;
-		String matchString = contentAssistRequest.getMatchString();
-		if (parent.getNodeType() == Node.ELEMENT_NODE) {
-			// retrieve the list of children
-			//validActions = getAvailableChildrenAtIndex((Element) parent, childPosition);
-			cmnodes = getAvailableChildElementDeclarations((Element)parent, childPosition, ModelQueryAction.INSERT);
-			Iterator nodeIterator = cmnodes.iterator();
-			// chop off any leading <'s and whitespace from the matchstring
-			while ((matchString.length() > 0) && (Character.isWhitespace(matchString.charAt(0)) || beginsWith(matchString, "<"))) //$NON-NLS-1$
-				//$NON-NLS-1$
-				matchString = matchString.substring(1);
-			if (!nodeIterator.hasNext())
-				error = NLS.bind(XMLUIMessages.__Has_no_known_child, (new Object[]{parent.getNodeName()}));
-			while (nodeIterator.hasNext()) {
-				CMNode elementDecl = (CMNode) nodeIterator.next();
-				if (elementDecl != null) {
-					// only add proposals for the child element's that begin
-					// with the matchstring
-					String proposedText = null;
-					int cursorAdjustment = 0;
-
-					// do a check to see if partial attributes of partial tag
-					// names are in list
-					if ((node != null && node.getAttributes() != null && node.getAttributes().getLength() > 0 && attributeInList(node, parent, elementDecl)) || ((node.getNodeType() != Node.TEXT_NODE) && node.getFirstStructuredDocumentRegion().isEnded())) {
-
-						proposedText = getRequiredName(parent, elementDecl);
-						cursorAdjustment = proposedText.length();
-					}
-					else {
-						proposedText = getRequiredName(parent, elementDecl);
-						cursorAdjustment = proposedText.length();
-						if (elementDecl instanceof CMElementDeclaration) {
-							CMElementDeclaration ed = (CMElementDeclaration) elementDecl;
-							if (ed.getContentType() == CMElementDeclaration.EMPTY) {
-								proposedText += getContentGenerator().getStartTagClose(parent, ed);
-								cursorAdjustment = proposedText.length();
-							}
-							else {
-								cursorAdjustment = proposedText.length() + 1;
-								proposedText += "></" + getRequiredName(parent, elementDecl) + ">"; //$NON-NLS-2$//$NON-NLS-1$
-							}
-						}
-					}
-					if (beginsWith(proposedText, matchString)) {
-						Image image = CMImageUtil.getImage(elementDecl);
-						if (image == null) {
-							image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
-						}
-						String proposedInfo = getAdditionalInfo(getCMElementDeclaration(parent), elementDecl);
-						CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), cursorAdjustment, image, getRequiredName(parent, elementDecl), null, proposedInfo, XMLRelevanceConstants.R_TAG_NAME);
-						contentAssistRequest.addProposal(proposal);
-					}
-				}
-			}
-			if (contentAssistRequest.getProposals().size() == 0) {
-				if (error != null)
-					setErrorMessage(error);
-				else if (contentAssistRequest.getMatchString() != null && contentAssistRequest.getMatchString().length() > 0)
-					setErrorMessage(NLS.bind(XMLUIMessages.No_known_child_tag_names, (new Object[]{parent.getNodeName(), contentAssistRequest.getMatchString()})));
-				//$NON-NLS-1$ = "No known child tag names of <{0}> begin with \"{1}\""
-				else
-					setErrorMessage(NLS.bind(XMLUIMessages.__Has_no_known_child, (new Object[]{parent.getNodeName()})));
-			}
-		}
-		else if (parent.getNodeType() == Node.DOCUMENT_NODE) {
-			List childElements = getAvailableRootChildren((Document) parent, childPosition);
-			for (int i = 0; i < childElements.size(); i++) {
-				CMNode ed = (CMNode) childElements.get(i);
-				if (ed == null)
-					continue;
-				String proposedText = null;
-				int cursorAdjustment = 0;
-				proposedText = getRequiredName(parent, ed);
-				if (!beginsWith(proposedText, matchString))
-					continue;
-				if ((node != null && node.getAttributes() != null && node.getAttributes().getLength() > 0) || ((node.getNodeType() != Node.TEXT_NODE) && node.getFirstStructuredDocumentRegion().isEnded())) {
-					cursorAdjustment = proposedText.length();
-				}
-				else {
-					cursorAdjustment = proposedText.length();
-					if (ed instanceof CMElementDeclaration) {
-						CMElementDeclaration elementDecl = (CMElementDeclaration) ed;
-						if (elementDecl.getContentType() == CMElementDeclaration.EMPTY) {
-							proposedText += getContentGenerator().getStartTagClose(parent, elementDecl);
-							cursorAdjustment = proposedText.length();
-						}
-						else {
-							cursorAdjustment = proposedText.length() + 1;
-							proposedText += "></" + getRequiredName(parent, elementDecl) + ">"; //$NON-NLS-2$//$NON-NLS-1$
-						}
-					}
-				}
-				String proposedInfo = getAdditionalInfo(null, ed);
-				Image image = CMImageUtil.getImage(ed);
-				if (image == null) {
-					image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
-				}
-				CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), cursorAdjustment, image, getRequiredName(parent, ed), null, proposedInfo, XMLRelevanceConstants.R_TAG_NAME);
-				contentAssistRequest.addProposal(proposal);
-			}
-		}
-	}
-
-	protected void addXMLProposal(ContentAssistRequest contentAssistRequest) {
-		String proposedText = "<?xml version=\"1.0\" encoding=\"" + ContentTypeEncodingPreferences.getUserPreferredCharsetName(ContentTypeIdForXML.ContentTypeID_XML) + "\"?>"; //$NON-NLS-2$//$NON-NLS-1$
-		ICompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), proposedText.length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_PROCESSINGINSTRUCTION), proposedText, null, null, XMLRelevanceConstants.R_XML_DECLARATION);
-		// TODO add special XML proposal info
-		contentAssistRequest.addProposal(proposal);
-	}
-
-	/**
-	 * This method determines if any of the attributes in the proposed XMLNode
-	 * node, are possible values of attributes from possible Elements at this
-	 * point in the document according to the Content Model.
-	 * 
-	 * @param node
-	 *            the element with attributes that you would like to test if
-	 *            are possible for possible Elements at this point
-	 * @param cmnode
-	 *            possible element at this point in the document (depending on
-	 *            what 'node' is) true if any attributes of 'node' match any
-	 *            possible attributes from 'cmnodes' list.
-	 */
-	protected boolean attributeInList(IDOMNode node, Node parent, CMNode cmnode) {
-		if (node == null || parent == null || cmnode == null)
-			return false;
-		String elementMatchString = node.getNodeName();
-		String cmnodeName = getRequiredName(parent, cmnode);// cmnode.getNodeName();
-		if (node instanceof Element) {
-			NamedNodeMap map = ((Element) node).getAttributes();
-			String attrMatchString = ""; //$NON-NLS-1$
-			CMNamedNodeMap cmattrMap = null;
-			// iterate attribute possibilities for partially started node
-			for (int i = 0; map != null && i < map.getLength(); i++) {
-				attrMatchString = map.item(i).getNodeName();
-				// filter on whatever user typed for element name already
-				if (beginsWith(cmnodeName, elementMatchString)) {
-					if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION) {
-						cmattrMap = ((CMElementDeclaration) cmnode).getAttributes();
-						// iterate possible attributes from a cmnode in
-						// proposal list
-						for (int k = 0; cmattrMap != null && k < cmattrMap.getLength(); k++) {
-							// check if name matches
-							if (cmattrMap.item(k).getNodeName().equals(attrMatchString)) {
-								return true;
-							}
-						}
-					}
-				}
-			}
-		}
-		return false;
-	}
-
-	protected boolean beginsWith(String aString, String prefix) {
-		if (aString == null || prefix == null)
-			return true;
-		// (pa) 221190 matching independent of case to be consistant with Java
-		// editor CA
-		return aString.toLowerCase().startsWith(prefix.toLowerCase());
-	}
-
-	protected ContentAssistRequest computeAttributeProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
-		ContentAssistRequest contentAssistRequest = null;
-		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-		if (documentPosition < sdRegion.getStartOffset(completionRegion)) {
-			// setup to insert new attributes
-			contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
-		}
-		else {
-			// Setup to replace an existing attribute name
-			contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
-		}
-		addAttributeNameProposals(contentAssistRequest);
-		contentAssistRequest.setReplacementBeginPosition(documentPosition);
-		contentAssistRequest.setReplacementLength(0);
-		if (node.getFirstStructuredDocumentRegion() != null && (!node.getFirstStructuredDocumentRegion().isEnded())) {
-			addTagCloseProposals(contentAssistRequest);
-		}
-		return contentAssistRequest;
-	}
-
-	protected ContentAssistRequest computeAttributeValueProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
-		ContentAssistRequest contentAssistRequest = null;
-		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-		if (documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength() && sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength() != sdRegion.getStartOffset(completionRegion) + completionRegion.getLength()) {
-			// setup to add a new attribute at the documentPosition
-			IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
-			contentAssistRequest = newContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
-			addAttributeNameProposals(contentAssistRequest);
-			if (actualNode.getFirstStructuredDocumentRegion() != null && !actualNode.getFirstStructuredDocumentRegion().isEnded()) {
-				addTagCloseProposals(contentAssistRequest);
-			}
-		}
-		else {
-			// setup to replace the existing value
-			if (!nodeAtOffset.getFirstStructuredDocumentRegion().isEnded() && documentPosition < sdRegion.getStartOffset(completionRegion)) {
-				// if the IStructuredDocumentRegion isn't closed and the
-				// cursor is in front of the value, add
-				contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
-				addAttributeNameProposals(contentAssistRequest);
-			}
-			else {
-				contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
-				addAttributeValueProposals(contentAssistRequest);
-			}
-		}
-		return contentAssistRequest;
-	}
-
-	protected ContentAssistRequest computeCompletionProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
-		ContentAssistRequest contentAssistRequest = null;
-		String regionType = completionRegion.getType();
-		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-
-		// Handle the most common and best supported cases
-		if (xmlnode.getNodeType() == Node.ELEMENT_NODE || xmlnode.getNodeType() == Node.DOCUMENT_NODE) {
-			if (regionType == DOMRegionContext.XML_TAG_OPEN) {
-				contentAssistRequest = computeTagOpenProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_NAME) {
-				contentAssistRequest = computeTagNameProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-				contentAssistRequest = computeAttributeProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
-				contentAssistRequest = computeEqualsProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE && documentPosition == sdRegion.getTextEndOffset() && (sdRegion.getText(completionRegion).endsWith("\"") || sdRegion.getText(completionRegion).endsWith("\'"))) //$NON-NLS-1$ //$NON-NLS-2$
-			{
-				// this is for when the cursor is at the end of the closing
-				// quote for an attribute..
-				IDOMNode actualNode = (IDOMNode) xmlnode.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
-				contentAssistRequest = newContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
-				addTagCloseProposals(contentAssistRequest);
-			}
-			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-				contentAssistRequest = computeAttributeValueProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
-			}
-			else if ((regionType == DOMRegionContext.XML_TAG_CLOSE) || (regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) || (regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_CLOSE))) {
-				contentAssistRequest = computeTagCloseProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
-			}
-			else if (regionType == DOMRegionContext.XML_END_TAG_OPEN) {
-				contentAssistRequest = computeEndTagOpenProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
-			}
-			else if (regionType == DOMRegionContext.XML_CONTENT || regionType == DOMRegionContext.XML_CHAR_REFERENCE || regionType == DOMRegionContext.XML_ENTITY_REFERENCE || regionType == DOMRegionContext.XML_PE_REFERENCE) {
-				contentAssistRequest = computeContentProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
-			}
-
-			// These ITextRegion types begin DOM Elements as well and although
-			// internally harder to assist,
-			// text insertions directly before them can be made
-			else if (documentPosition == sdRegion.getStartOffset(completionRegion) && (regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_COMMENT_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DECLARATION_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_EXPRESSION_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_SCRIPTLET_OPEN) || regionType == DOMRegionContext.XML_DECLARATION_OPEN || regionType == DOMRegionContext.XML_PI_OPEN || regionType == DOMRegionContext.XML_COMMENT_OPEN || regionType == DOMRegionContext.XML_CDATA_OPEN)) {
-				contentAssistRequest = newContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
-				addTagInsertionProposals(contentAssistRequest, getElementPositionForModelQuery(treeNode));
-				addStartDocumentProposals(contentAssistRequest);
-			}
-		}
-		// Not a Document or Element? (odd cases go here for now)
-		else if (isCloseRegion(completionRegion)) {
-			contentAssistRequest = newContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion) + completionRegion.getLength(), 0, matchString);
-			addStartDocumentProposals(contentAssistRequest);
-			if (documentPosition >= sdRegion.getTextEndOffset(completionRegion))
-				addTagInsertionProposals(contentAssistRequest, getElementPositionForModelQuery(treeNode) + 1);
-		}
-		else if (documentPosition == sdRegion.getStartOffset(completionRegion) && (regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_COMMENT_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DECLARATION_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_EXPRESSION_OPEN) || regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_SCRIPTLET_OPEN) || regionType == DOMRegionContext.XML_DECLARATION_OPEN || regionType == DOMRegionContext.XML_PI_OPEN || regionType == DOMRegionContext.XML_COMMENT_OPEN || regionType == DOMRegionContext.XML_CDATA_OPEN)) {
-			contentAssistRequest = newContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
-			addTagInsertionProposals(contentAssistRequest, getElementPositionForModelQuery(treeNode));
-			addStartDocumentProposals(contentAssistRequest);
-		}
-		return contentAssistRequest;
-	}
-
-	/**
-	 * CONTENT ASSIST STARTS HERE
-	 * 
-	 * 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 textViewer
-	 * @param documentPosition -
-	 *            the cursor location within the document
-	 * 
-	 * an array of ICompletionProposals
-	 */
-	public ICompletionProposal[] computeCompletionProposals(ITextViewer textViewer, int documentPosition) {
-
-		setErrorMessage(null);
-
-		fTextViewer = textViewer;
-
-		IndexedRegion treeNode = ContentAssistUtils.getNodeAt((StructuredTextViewer) textViewer, documentPosition);
-
-		Node node = (Node) treeNode;
-		while (node != null && node.getNodeType() == Node.TEXT_NODE && node.getParentNode() != null)
-			node = node.getParentNode();
-		IDOMNode xmlnode = (IDOMNode) node;
-
-		ContentAssistRequest contentAssistRequest = null;
-
-		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-		ITextRegion completionRegion = getCompletionRegion(documentPosition, node);
-
-		String matchString = getMatchString(sdRegion, completionRegion, documentPosition);
-
-		// Handle empty Documents
-		if (completionRegion == null) {
-			if (((treeNode == null) || ((Node) treeNode).getNodeType() == Node.DOCUMENT_NODE) && completionRegion == null && (xmlnode == null || xmlnode.getChildNodes() == null || xmlnode.getChildNodes().getLength() == 0)) {
-				IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(textViewer.getDocument());
-				try {
-					if (sModel != null) {
-						IDOMDocument docNode = ((IDOMModel) sModel).getDocument();
-						contentAssistRequest = newContentAssistRequest(docNode, docNode, sdRegion, completionRegion, documentPosition, 0, null);
-						addEmptyDocumentProposals(contentAssistRequest);
-					}
-				}
-				finally {
-					if (sModel != null)
-						sModel.releaseFromRead();
-				}
-				if (contentAssistRequest == null) {
-					Logger.logException(new IllegalStateException("problem getting model")); //$NON-NLS-1$
-					return new ICompletionProposal[0];
-				}
-				return contentAssistRequest.getCompletionProposals();
-			}
-			// MASSIVE ERROR CONDITION
-			Logger.logException(new IllegalStateException("completion region was null")); //$NON-NLS-1$
-			setErrorMessage(INTERNALERROR);
-			contentAssistRequest = newContentAssistRequest((Node) treeNode, node.getParentNode(), sdRegion, completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
-			return contentAssistRequest.getCompletionProposals();
-		}
-
-
-		// catch documents where no region can be determined
-		if (xmlnode.getNodeType() == Node.DOCUMENT_NODE && (completionRegion == null || xmlnode.getChildNodes() == null || xmlnode.getChildNodes().getLength() == 0)) {
-			contentAssistRequest = computeStartDocumentProposals(documentPosition, matchString, completionRegion, (IDOMNode) treeNode, xmlnode);
-			return contentAssistRequest.getCompletionProposals();
-		}
-
-		// compute normal proposals
-		contentAssistRequest = computeCompletionProposals(documentPosition, matchString, completionRegion, (IDOMNode) treeNode, xmlnode);
-		if (contentAssistRequest == null) {
-			contentAssistRequest = newContentAssistRequest((Node) treeNode, node.getParentNode(), sdRegion, completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
-			if (Debug.displayWarnings)
-				System.out.println(UNKNOWN_CONTEXT + " " + completionRegion.getType() + "@" + documentPosition); //$NON-NLS-2$//$NON-NLS-1$
-			setErrorMessage(UNKNOWN_CONTEXT);
-		}
-
-		if (contentAssistRequest.getProposals().size() == 0)
-			setErrorMessage(UNKNOWN_CONTEXT);
-
-		return contentAssistRequest.getCompletionProposals();
-	}
-
-	protected ContentAssistRequest computeContentProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
-		ContentAssistRequest contentAssistRequest = null;
-
-		// setup to add children at the content node's position
-		contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, getStructuredDocumentRegion(documentPosition), completionRegion, documentPosition, 0, matchString);
-		if (node != null && node.getNodeType() == Node.DOCUMENT_NODE && ((Document) node).getDoctype() == null)
-			addStartDocumentProposals(contentAssistRequest);
-		addTagInsertionProposals(contentAssistRequest, getElementPositionForModelQuery(nodeAtOffset));
-		if (node.getNodeType() != Node.DOCUMENT_NODE) {
-			addEndTagProposals(contentAssistRequest);
-		}
-		// entities?
-		addEntityProposals(contentAssistRequest, documentPosition, completionRegion, node);
-		// addEntityProposals(contentAssistRequest);
-		return contentAssistRequest;
-	}
-
-	/**
-	 * 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 an array of context information objects or
-	 *            <code>null</code> if no context could be found
-	 */
-	public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
-		if (fAttributeInfoProvider == null)
-			fAttributeInfoProvider = new AttributeContextInformationProvider((IStructuredDocument) viewer.getDocument(), (AttributeContextInformationPresenter) getContextInformationValidator());
-		return fAttributeInfoProvider.getAttributeInformation(documentOffset);
-	}
-
-	protected ContentAssistRequest computeEndTagOpenProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
-		ContentAssistRequest contentAssistRequest = null;
-		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-		int completionRegionStart = sdRegion.getStartOffset(completionRegion);
-		int completionRegionLength = completionRegion.getLength();
-		IStructuredDocumentRegion sdRegionAtCompletionOffset = node.getStructuredDocument().getRegionAtCharacterOffset(completionRegionStart + completionRegionLength);
-		ITextRegion regionAtEndOfCompletion = sdRegionAtCompletionOffset.getRegionAtCharacterOffset(completionRegionStart + completionRegionLength);
-
-		if (documentPosition != completionRegionStart && regionAtEndOfCompletion != null && regionAtEndOfCompletion.getType() == DOMRegionContext.XML_TAG_NAME) {
-			ITextRegion nameRegion = regionAtEndOfCompletion;
-			contentAssistRequest = newContentAssistRequest(nodeAtOffset, nodeAtOffset.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(nameRegion), nameRegion.getTextLength(), matchString);
-		}
-		else {
-			if (nodeAtOffset.getFirstStructuredDocumentRegion() == sdRegion) {
-				// abnormal case, this unmatched end tag will be a sibling
-				contentAssistRequest = newContentAssistRequest(nodeAtOffset, nodeAtOffset.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
-			}
-			else {
-				// normal case, this end tag is the parent
-				contentAssistRequest = newContentAssistRequest(nodeAtOffset, nodeAtOffset, sdRegion, completionRegion, documentPosition, 0, matchString);
-			}
-		}
-		// if (documentPosition >= sdRegion.getStartOffset(completionRegion) +
-		// completionRegion.getTextLength())
-		addEndTagProposals(contentAssistRequest);
-		// else
-		if (completionRegionStart == documentPosition) {
-			// positioned at start of end tag
-			addTagInsertionProposals(contentAssistRequest, node.getChildNodes().getLength());
-		}
-		return contentAssistRequest;
-	}
-
-	/**
-	 * return all possible EntityReferenceProposals (according to current
-	 * position in doc)
-	 */
-	protected ICompletionProposal[] computeEntityReferenceProposals(int documentPosition, ITextRegion completionRegion, IDOMNode treeNode) {
-		// only handle XML content for now
-		Vector proposals = new Vector(); // ICompletionProposals
-		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-		if (completionRegion != null && completionRegion.getType() == DOMRegionContext.XML_CONTENT) {
-			int nodeOffset = documentPosition - sdRegion.getStartOffset(completionRegion);
-			String regionText = sdRegion.getFullText(completionRegion);
-
-			// if directly to the right of a &, region will be null, need to
-			// move to
-			// the previous region...there might be a better way to do this
-			if (regionText != null && regionText.trim().equals("") && documentPosition > 0) { //$NON-NLS-1$
-				IStructuredDocumentRegion prev = treeNode.getStructuredDocument().getRegionAtCharacterOffset(documentPosition - 1);
-				if (prev != null && prev.getFullText().trim().equals("&")) { //$NON-NLS-1$		
-					completionRegion = prev;
-					regionText = prev.getFullText();
-					nodeOffset = 1;
-				}
-			}
-
-			// string must start w/ &
-			if (regionText != null && regionText.startsWith("&")) { //$NON-NLS-1$						 		
-				String key = (nodeOffset > 0) ? regionText.substring(1, nodeOffset) : ""; //$NON-NLS-1$
-
-				// get entity proposals, passing in the appropriate start
-				// string
-				ModelQuery mq = ModelQueryUtil.getModelQuery(((Node) treeNode).getOwnerDocument());
-				if (mq != null) {
-					CMDocument xmlDoc = mq.getCorrespondingCMDocument(treeNode);
-					CMNamedNodeMap cmmap = null;
-					Properties entities = null;
-					if (xmlDoc != null) {
-						cmmap = xmlDoc.getEntities();
-					}
-					if (cmmap != null) {
-						entities = mapToProperties(cmmap);
-					}
-					else // 224787 in absence of content model, just use
-					// minimal 5 entities
-					{
-						entities = new Properties();
-						entities.put("quot", "\""); //$NON-NLS-1$ //$NON-NLS-2$
-						entities.put("apos", "'"); //$NON-NLS-1$ //$NON-NLS-2$
-						entities.put("amp", "&"); //$NON-NLS-1$ //$NON-NLS-2$
-						entities.put("lt", "<"); //$NON-NLS-1$ //$NON-NLS-2$
-						entities.put("gt", ">"); //$NON-NLS-1$ //$NON-NLS-2$	
-						entities.put("nbsp", " "); //$NON-NLS-1$ //$NON-NLS-2$									
-					}
-					addEntityProposals(proposals, entities, key, nodeOffset, sdRegion, completionRegion); //$NON-NLS-1$
-				}
-			}
-		}
-		return (ICompletionProposal[]) ((proposals.size() > 0) ? proposals.toArray(new ICompletionProposal[proposals.size()]) : null);
-	}
-
-	protected ContentAssistRequest computeEqualsProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
-		ContentAssistRequest contentAssistRequest = null;
-		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-		ITextRegion valueRegion = node.getStartStructuredDocumentRegion().getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) + completionRegion.getLength());
-		if (valueRegion != null && valueRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE && sdRegion.getStartOffset(valueRegion) <= documentPosition) {
-			// replace the adjacent attribute value
-			contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, valueRegion, sdRegion.getStartOffset(valueRegion), valueRegion.getTextLength(), matchString);
-		}
-		else {
-			// append an attribute value after the '='
-			contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
-		}
-		addAttributeValueProposals(contentAssistRequest);
-		return contentAssistRequest;
-	}
-
-	protected ContentAssistRequest computeStartDocumentProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
-		// setup for a non-empty document, but one that hasn't been formally
-		// started
-		ContentAssistRequest contentAssistRequest = null;
-		contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, getStructuredDocumentRegion(documentPosition), completionRegion, documentPosition, 0, matchString);
-		addStartDocumentProposals(contentAssistRequest);
-		return contentAssistRequest;
-	}
-
-	protected ContentAssistRequest computeTagCloseProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
-		ContentAssistRequest contentAssistRequest = null;
-		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-
-		if ((node.getNodeType() == Node.DOCUMENT_NODE) || (documentPosition >= sdRegion.getEndOffset())) {
-			// this is a content request as the documentPosition is AFTER the
-			// end of the closing region
-			if (node == nodeAtOffset && node.getParentNode() != null)
-				node = (IDOMNode) node.getParentNode();
-			contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
-			addTagInsertionProposals(contentAssistRequest, getElementPositionForModelQuery(nodeAtOffset));
-			if (node.getNodeType() != Node.DOCUMENT_NODE && node.getEndStructuredDocumentRegion() == null) {
-				addEndTagProposals(contentAssistRequest);
-			}
-		}
-		else {
-			// at the start of the tag's close or within it
-			ITextRegion closeRegion = sdRegion.getLastRegion();
-			boolean insideTag = !sdRegion.isEnded() || documentPosition <= sdRegion.getStartOffset(closeRegion);
-			if (insideTag) {
-				// this is a request for completions within a tag
-				contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
-				if (node.getNodeType() != Node.DOCUMENT_NODE && node.getEndStructuredDocumentRegion() != null) {
-					addTagCloseProposals(contentAssistRequest);
-				}
-				if (sdRegion == nodeAtOffset.getFirstStructuredDocumentRegion()) {
-					contentAssistRequest.setReplacementBeginPosition(documentPosition);
-					contentAssistRequest.setReplacementLength(0);
-					addAttributeNameProposals(contentAssistRequest);
-				}
-			}
-		}
-		return contentAssistRequest;
-	}
-
-	protected ContentAssistRequest computeTagNameProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
-		ContentAssistRequest contentAssistRequest = null;
-		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-
-		if (sdRegion != nodeAtOffset.getFirstStructuredDocumentRegion()) {
-			// completing the *first* tag in "<tagname1 |<tagname2"
-			IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
-			if (actualNode != null) {
-				if (actualNode.getFirstStructuredDocumentRegion() == sdRegion) {
-					// start tag
-					if (documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getLength()) {
-						// it's attributes
-						contentAssistRequest = newContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition - matchString.length(), matchString.length(), matchString);
-						if (node.getStructuredDocument().getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) - 1).getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) - 1).getType() == DOMRegionContext.XML_TAG_OPEN)
-							addAttributeNameProposals(contentAssistRequest);
-						addTagCloseProposals(contentAssistRequest);
-					}
-					else {
-						// it's name
-						contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, documentPosition - matchString.length(), matchString.length(), matchString);
-						addTagNameProposals(contentAssistRequest, getElementPositionForModelQuery(actualNode));
-					}
-				}
-				else {
-					if (documentPosition >= sdRegion.getStartOffset(completionRegion) + completionRegion.getLength()) {
-						// insert name
-						contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
-					}
-					else {
-						// replace name
-						contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
-					}
-					addEndTagNameProposals(contentAssistRequest);
-				}
-			}
-		}
-		else {
-			if (documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) {
-				// unclosed tag with only a name; should prompt for attributes
-				// and a close instead
-				contentAssistRequest = newContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition - matchString.length(), matchString.length(), matchString);
-				addAttributeNameProposals(contentAssistRequest);
-				addTagCloseProposals(contentAssistRequest);
-			}
-			else {
-				if (sdRegion.getRegions().get(0).getType() != DOMRegionContext.XML_END_TAG_OPEN) {
-					contentAssistRequest = newContentAssistRequest(node, node.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
-					addTagNameProposals(contentAssistRequest, getElementPositionForModelQuery(nodeAtOffset));
-				}
-				else {
-					IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(documentPosition);
-					if (actualNode != null) {
-						if (documentPosition >= sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) {
-							contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
-						}
-						else {
-							contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
-						}
-						addEndTagNameProposals(contentAssistRequest);
-					}
-				}
-			}
-		}
-		return contentAssistRequest;
-	}
-
-	protected ContentAssistRequest computeTagOpenProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
-		ContentAssistRequest contentAssistRequest = null;
-		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-		if (sdRegion != nodeAtOffset.getFirstStructuredDocumentRegion()) {
-			// completing the *first* XML_TAG_OPEN in "<<tagname"
-			IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
-			if (actualNode != null) {
-				contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
-				addTagNameProposals(contentAssistRequest, getElementPositionForModelQuery(actualNode));
-				addEndTagProposals(contentAssistRequest); // (pa) 220850
-			}
-		}
-		else {
-			if (documentPosition == sdRegion.getStartOffset(completionRegion)) {
-				if (node.getNodeType() == Node.ELEMENT_NODE) {
-					// at the start of an existing tag, right before the '<'
-					contentAssistRequest = newContentAssistRequest(nodeAtOffset, node.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
-					addTagInsertionProposals(contentAssistRequest, getElementPositionForModelQuery(nodeAtOffset));
-					addEndTagProposals(contentAssistRequest);
-				}
-				else if (node.getNodeType() == Node.DOCUMENT_NODE) {
-					// at the opening of the VERY first tag with a '<'
-					contentAssistRequest = newContentAssistRequest(nodeAtOffset, node.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
-					addStartDocumentProposals(contentAssistRequest);
-				}
-			}
-			else {
-				// within the white space
-				ITextRegion name = getNameRegion(node.getStartStructuredDocumentRegion());
-				// (pa) ITextRegion refactor
-				// if (name != null && name.containsOffset(documentPosition))
-				// {
-				if (name != null && (sdRegion.getStartOffset(name) <= documentPosition && sdRegion.getEndOffset(name) >= documentPosition)) {
-					// replace the existing name
-					contentAssistRequest = newContentAssistRequest(node, node.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(name), name.getTextLength(), matchString);
-				}
-				else {
-					// insert a valid new name, or possibly an end tag
-					contentAssistRequest = newContentAssistRequest(nodeAtOffset, ((Node) nodeAtOffset).getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
-					addEndTagProposals(contentAssistRequest);
-					contentAssistRequest.setReplacementBeginPosition(documentPosition);
-					contentAssistRequest.setReplacementLength(0);
-				}
-				addTagNameProposals(contentAssistRequest, getElementPositionForModelQuery(nodeAtOffset));
-			}
-		}
-		return contentAssistRequest;
-	}
-
-	/**
-	 * Retreives cmnode's documentation to display in the completion
-	 * proposal's additional info. If no documentation exists for cmnode, try
-	 * displaying parentOrOwner's documentation
-	 * 
-	 * String any documentation information to display for cmnode.
-	 * <code>null</code> if there is nothing to display.
-	 */
-	protected String getAdditionalInfo(CMNode parentOrOwner, CMNode cmnode) {
-		String addlInfo = null;
-
-		if (cmnode == null) {
-			if (Debug.displayWarnings) {
-				new IllegalArgumentException("Null declaration!").printStackTrace(); //$NON-NLS-1$
-			}
-			return null;
-		}
-
-		addlInfo = getInfoProvider().getInfo(cmnode);
-		if (addlInfo == null && parentOrOwner != null)
-			addlInfo = getInfoProvider().getInfo(parentOrOwner);
-		return addlInfo;
-	}
-
-	// returns a list of ModelQueryActions
-	protected List getAvailableChildrenAtIndex(Element parent, int index, int validityChecking) {
-		List list = new ArrayList();
-		CMElementDeclaration parentDecl = getCMElementDeclaration(parent);
-		if (parentDecl != null) {
-			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(parent.getOwnerDocument());
-			// taken from ActionManagers
-			// int editMode = modelQuery.getEditMode();
-			int editMode = ModelQuery.EDIT_MODE_UNCONSTRAINED;
-			int ic = (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) ? ModelQuery.INCLUDE_CHILD_NODES | ModelQuery.INCLUDE_SEQUENCE_GROUPS : ModelQuery.INCLUDE_CHILD_NODES;
-			modelQuery.getInsertActions(parent, parentDecl, index, ic, validityChecking, list);
-		}
-		return list;
-	}
-
-	// returns a list of CMElementDeclarations
-	protected List getAvailableRootChildren(Document document, int childIndex) {
-		List list = null;
-
-		// extract the valid 'root' node name from the DocumentType Node
-		DocumentType docType = document.getDoctype();
-		String rootName = null;
-		if (docType != null) {
-			rootName = docType.getNodeName();
-		}
-		if (rootName == null)
-			return new ArrayList(0);
-
-		for (Node child = document.getFirstChild(); child != null; child = child.getNextSibling()) {
-			// make sure the "root" Element isn't already present
-			// is it required to be an Element?
-			if (child.getNodeType() == Node.ELEMENT_NODE && stringsEqual(child.getNodeName(), rootName)) {
-				// if the node is missing either the start or end tag, don't
-				// count it as present
-				if (child instanceof IDOMNode && (((IDOMNode) child).getStartStructuredDocumentRegion() == null || ((IDOMNode) child).getEndStructuredDocumentRegion() == null))
-					continue;
-				if (Debug.displayInfo)
-					System.out.println(rootName + " already present!"); //$NON-NLS-1$
-				setErrorMessage(NLS.bind(XMLUIMessages.The_document_element__, (new Object[]{rootName})));
-				return new ArrayList(0);
-			}
-		}
-
-		list = new ArrayList(1);
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
-		if (modelQuery != null) {
-			CMDocument cmdoc = modelQuery.getCorrespondingCMDocument(document);
-			if (cmdoc != null) {
-				if (rootName != null) {
-					CMElementDeclaration rootDecl = (CMElementDeclaration) cmdoc.getElements().getNamedItem(rootName);
-					if (rootDecl != null) {
-						list.add(rootDecl);
-					}
-					else {
-						// supply the given document name anyway, even if it
-						// is an error
-						list.add(new SimpleCMElementDeclaration(rootName));
-						if (Debug.displayInfo || Debug.displayWarnings)
-							System.out.println("No definition found for " + rootName + " in " + docType.getPublicId() + "/" + docType.getSystemId()); //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-						String location = "" + (docType.getPublicId() != null ? docType.getPublicId() + "/" : "") + (docType.getSystemId() != null ? docType.getSystemId() : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-						//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-						//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-						if (location.length() > 0)
-							setErrorMessage(NLS.bind(XMLUIMessages.No_definition_for_in, (new Object[]{rootName, location})));
-						else
-							setErrorMessage(NLS.bind(XMLUIMessages.No_definition_for, (new Object[]{rootName})));
-					}
-				}
-			}
-			else {
-				if (Debug.displayInfo || Debug.displayWarnings)
-					System.out.println("No content model found."); //$NON-NLS-1$
-				//$NON-NLS-1$
-				//$NON-NLS-1$
-				String location = "" + (docType.getPublicId() != null ? docType.getPublicId() + "/" : "") + (docType.getSystemId() != null ? docType.getSystemId() : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-				//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-				//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-				if (location.length() > 0)
-					setErrorMessage(NLS.bind(XMLUIMessages.No_content_model_for, (new Object[]{location})));
-				else
-					setErrorMessage(XMLUIMessages.No_content_model_found_UI_);
-			}
-		}
-
-		return list;
-	}
-
-	protected 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;
-	}
-
-	/**
-	 * Returns the characters which when entered by the user should
-	 * automatically trigger the presentation of possible completions.
-	 * 
-	 * the auto activation characters for completion proposal or
-	 * <code>null</code> if no auto activation is desired
-	 */
-	public char[] getCompletionProposalAutoActivationCharacters() {
-		return completionProposalAutoActivationCharacters;
-	}
-
-	protected ITextRegion getCompletionRegion(int offset, IStructuredDocumentRegion sdRegion) {
-		ITextRegion region = sdRegion.getRegionAtCharacterOffset(offset);
-		if (region == null)
-			return null;
-
-		if (sdRegion.getStartOffset(region) == offset) {
-			// The offset is at the beginning of the region
-			if ((sdRegion.getStartOffset(region) == sdRegion.getStartOffset()) && (sdRegion.getPrevious() != null) && (!sdRegion.getPrevious().isEnded())) {
-				// Is the region also the start of the node? If so, the
-				// previous IStructuredDocumentRegion is
-				// where to look for a useful region.
-				region = sdRegion.getPrevious().getRegionAtCharacterOffset(offset - 1);
-			}
-			else {
-				// Is there no separating whitespace from the previous region?
-				// If not,
-				// then that region is the important one
-				ITextRegion previousRegion = sdRegion.getRegionAtCharacterOffset(offset - 1);
-				if ((previousRegion != null) && (previousRegion != region) && (previousRegion.getTextLength() == previousRegion.getLength())) {
-					region = previousRegion;
-				}
-			}
-		}
-		else {
-			// The offset is NOT at the beginning of the region
-			if (offset > sdRegion.getStartOffset(region) + region.getTextLength()) {
-				// Is the offset within the whitespace after the text in this
-				// region?
-				// If so, use the next region
-				ITextRegion nextRegion = sdRegion.getRegionAtCharacterOffset(sdRegion.getStartOffset(region) + region.getLength());
-				if (nextRegion != null)
-					region = nextRegion;
-			}
-			else {
-				// Is the offset within the important text for this region?
-				// If so, then we've already got the right one.
-			}
-		}
-
-		// valid WHITE_SPACE region handler (#179924)
-		if (region != null && region.getType() == DOMRegionContext.WHITE_SPACE) {
-			ITextRegion previousRegion = sdRegion.getRegionAtCharacterOffset(sdRegion.getStartOffset(region) - 1);
-			if (previousRegion != null)
-				region = previousRegion;
-		}
-
-		return region;
-	}
-
-	/**
-	 * Return the region whose content's require completion. This is something
-	 * of a misnomer as sometimes the user wants to be prompted for contents
-	 * of a non-existant ITextRegion, such as for enumerated attribute values
-	 * following an '=' sign.
-	 */
-	protected ITextRegion getCompletionRegion(int documentPosition, Node domnode) {
-		if (domnode == null)
-			return null;
-
-		ITextRegion region = null;
-		int offset = documentPosition;
-		IStructuredDocumentRegion flatNode = null;
-		IDOMNode node = (IDOMNode) domnode;
-
-		if (node.getNodeType() == Node.DOCUMENT_NODE) {
-			if (node.getStructuredDocument().getLength() == 0)
-				return null;
-			ITextRegion result = node.getStructuredDocument().getRegionAtCharacterOffset(offset).getRegionAtCharacterOffset(offset);
-			while (result == null) {
-				offset--;
-				result = node.getStructuredDocument().getRegionAtCharacterOffset(offset).getRegionAtCharacterOffset(offset);
-			}
-			return result;
-		}
-
-		IStructuredDocumentRegion startTag = node.getStartStructuredDocumentRegion();
-		IStructuredDocumentRegion endTag = node.getEndStructuredDocumentRegion();
-
-		// Determine if the offset is within the start
-		// IStructuredDocumentRegion, end IStructuredDocumentRegion, or
-		// somewhere within the Node's XML content.
-		if ((startTag != null) && (startTag.getStartOffset() <= offset) && (offset < startTag.getStartOffset() + startTag.getLength()))
-			flatNode = startTag;
-		else if ((endTag != null) && (endTag.getStartOffset() <= offset) && (offset < endTag.getStartOffset() + endTag.getLength()))
-			flatNode = endTag;
-
-		if (flatNode != null) {
-			// the offset is definitely within the start or end tag, continue
-			// on and find the region
-			region = getCompletionRegion(offset, flatNode);
-		}
-		else {
-			// the docPosition is neither within the start nor the end, so it
-			// must be content
-			flatNode = node.getStructuredDocument().getRegionAtCharacterOffset(offset);
-			// (pa) ITextRegion refactor
-			// if (flatNode.contains(documentPosition)) {
-			if (flatNode.getStartOffset() <= documentPosition && flatNode.getEndOffset() >= documentPosition) {
-				// we're interesting in completing/extending the previous
-				// IStructuredDocumentRegion if the current
-				// IStructuredDocumentRegion isn't plain content or if it's
-				// preceded by an orphan '<'
-				if ((offset == flatNode.getStartOffset()) && (flatNode.getPrevious() != null) && (flatNode.getRegionAtCharacterOffset(documentPosition) != null && flatNode.getRegionAtCharacterOffset(documentPosition).getType() != DOMRegionContext.XML_CONTENT || flatNode.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_TAG_OPEN || flatNode.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN)) {
-					// Is the region also the start of the node? If so, the
-					// previous IStructuredDocumentRegion is
-					// where to look for a useful region.
-					region = flatNode.getPrevious().getLastRegion();
-				}
-				else if (flatNode.getEndOffset() == documentPosition) {
-					region = flatNode.getLastRegion();
-				}
-				else
-					region = flatNode.getFirstRegion();
-			}
-			else {
-				// catch end of document positions where the docPosition isn't
-				// in a IStructuredDocumentRegion
-				region = flatNode.getLastRegion();
-			}
-		}
-
-		return region;
-	}
-
-	/**
-	 * Provided by default. Subclasses may override with their own
-	 * implementations.
-	 * 
-	 * @see AbstractContentAssistProcessor#getContentGenerator()
-	 */
-	public XMLContentModelGenerator getContentGenerator() {
-		if (fGenerator == null)
-			fGenerator = new XMLContentModelGenerator();
-		return fGenerator;
-	}
-
-	/**
-	 * Returns the characters which when entered by the user should
-	 * automatically trigger the presentation of context information.
-	 * 
-	 * the auto activation characters for presenting context information or
-	 * <code>null</code> if no auto activation is desired
-	 */
-	public char[] getContextInformationAutoActivationCharacters() {
-		return contextInformationAutoActivationCharacters;
-	}
-
-	/**
-	 * 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
-	 */
-	public IContextInformationValidator getContextInformationValidator() {
-		if (fContextInformationPresenter == null)
-			fContextInformationPresenter = new AttributeContextInformationPresenter();
-		return fContextInformationPresenter;
-	}
-
-	protected int getElementPosition(Node child) {
-		Node parent = child.getParentNode();
-		if (parent == null)
-			return 0;
-
-		NodeList children = parent.getChildNodes();
-		if (children == null)
-			return 0;
-		int count = 0;
-
-		for (int i = 0; i < children.getLength(); i++) {
-			if (children.item(i) == child)
-				return count;
-			else
-				// if (children.item(i).getNodeType() == Node.ELEMENT_NODE)
-				count++;
-		}
-		return 0;
-	}
-
-	private int getElementPositionForModelQuery(Node child) {
-		return getElementPosition(child);
-		// return -1;
-	}
-
-	/**
-	 * Return the reason why computeProposals was not able to find any
-	 * completions.
-	 * 
-	 * an error message or null if no error occurred
-	 */
-	public String getErrorMessage() {
-		return fErrorMessage;
-	}
-
-	/**
-	 * @param iResource
-	 */
-	// public void initialize(IResource iResource) {
-	// this.resource = iResource;
-	// }
-	/**
-	 * Gets the infoProvider.
-	 * 
-	 * fInfoProvider and if fInfoProvider was <code>null</code> create a new
-	 * instance
-	 */
-	public MarkupTagInfoProvider getInfoProvider() {
-		if (fInfoProvider == null) {
-			fInfoProvider = new MarkupTagInfoProvider();
-		}
-		return fInfoProvider;
-	}
-
-	protected String getMatchString(IStructuredDocumentRegion parent, ITextRegion aRegion, int offset) {
-		if (aRegion == null || isCloseRegion(aRegion))
-			return ""; //$NON-NLS-1$
-		String matchString = null;
-		String regionType = aRegion.getType();
-		if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS || regionType == DOMRegionContext.XML_TAG_OPEN || (offset > parent.getStartOffset(aRegion) + aRegion.getTextLength())) {
-			matchString = ""; //$NON-NLS-1$
-		}
-		else if (regionType == DOMRegionContext.XML_CONTENT) {
-			matchString = ""; //$NON-NLS-1$
-		}
-		else {
-			if (parent.getText(aRegion).length() > 0 && parent.getStartOffset(aRegion) < offset)
-				matchString = parent.getText(aRegion).substring(0, offset - parent.getStartOffset(aRegion));
-			else
-				matchString = ""; //$NON-NLS-1$
-		}
-		return matchString;
-	}
-
-	protected ITextRegion getNameRegion(IStructuredDocumentRegion flatNode) {
-		if (flatNode == null)
-			return null;
-		Iterator regionList = flatNode.getRegions().iterator();
-		while (regionList.hasNext()) {
-			ITextRegion region = (ITextRegion) regionList.next();
-			if (isNameRegion(region))
-				return region;
-		}
-		return null;
-	}
-
-	/**
-	 * Retrieves all of the possible valid values for this attribute
-	 * declaration
-	 */
-	protected List getPossibleDataTypeValues(Node node, CMAttributeDeclaration ad) {
-		List list = null;
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			Element element = (Element) node;
-			String[] dataTypeValues = null;
-			// The ModelQuery may not be available if the corresponding
-			// adapter
-			// is absent
-			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
-			if (modelQuery != null) {
-				dataTypeValues = modelQuery.getPossibleDataTypeValues(element, ad);
-			}
-			else {
-				if (ad.getAttrType() != null)
-					dataTypeValues = ad.getAttrType().getEnumeratedValues();
-			}
-			if (dataTypeValues != null) {
-				list = new ArrayList(dataTypeValues.length);
-				for (int i = 0; i < dataTypeValues.length; i++) {
-					list.add(dataTypeValues[i]);
-				}
-			}
-		}
-		if (list == null) {
-			list = new ArrayList(0);
-		}
-		return list;
-	}
-
-	protected String getRequiredName(Node parentOrOwner, CMNode cmnode) {
-		if (cmnode == null || parentOrOwner == null) {
-			if (Debug.displayWarnings) {
-				new IllegalArgumentException("Null declaration!").printStackTrace(); //$NON-NLS-1$
-			}
-			return ""; //$NON-NLS-1$
-		}
-		return getContentGenerator().getRequiredName(parentOrOwner, cmnode);
-	}
-
-	protected String getRequiredText(Node parentOrOwner, CMAttributeDeclaration attrDecl) {
-		if (attrDecl == null) {
-			if (Debug.displayWarnings) {
-				new IllegalArgumentException("Null attribute declaration!").printStackTrace(); //$NON-NLS-1$
-			}
-			return ""; //$NON-NLS-1$
-		}
-		StringBuffer buff = new StringBuffer();
-		getContentGenerator().generateRequiredAttribute(parentOrOwner, attrDecl, buff);
-		return buff.toString();
-	}
-
-	protected String getRequiredText(Node parentOrOwner, CMElementDeclaration elementDecl) {
-		if (elementDecl == null) {
-			if (Debug.displayWarnings) {
-				new IllegalArgumentException("Null attribute declaration!").printStackTrace(); //$NON-NLS-1$
-			}
-			return ""; //$NON-NLS-1$
-		}
-		StringBuffer buff = new StringBuffer();
-		getContentGenerator().generateTag(parentOrOwner, elementDecl, buff);
-		return buff.toString();
-	}
-
-	/**
-	 * StructuredTextViewer must be set before using this.
-	 */
-	public IStructuredDocumentRegion getStructuredDocumentRegion(int pos) {
-		// (pa) ITextRegion refactor defect 245190
-		// return
-		// (IStructuredDocumentRegion)ContentAssistUtils.getNodeAt((StructuredTextViewer)fTextViewer,
-		// pos);
-		return ContentAssistUtils.getStructuredDocumentRegion((StructuredTextViewer) fTextViewer, pos);
-	}
-
-	private String getTagName(IStructuredDocumentRegion sdRegion) {
-		ITextRegionList regions = sdRegion.getRegions();
-		ITextRegion region = null;
-		String name = ""; //$NON-NLS-1$
-		for (int i = 0; i < regions.size(); i++) {
-			region = regions.get(i);
-			if (region.getType() == DOMRegionContext.XML_TAG_NAME) {
-				name = sdRegion.getText(region);
-				break;
-			}
-		}
-		return name;
-	}
-
-    // returns a list of CMNodes that are available within this parent context
-    // Given the grammar shown below and a snippet of XML code (where the '|' indicated the cursor position) 
-    // the list would return all of the element declarations that are potential child elements of Foo. 
-    //
-    // grammar : Foo -> (A, B, C)   
-    // snippet : <Foo><A>|
-    // result  : {A, B, C}
-    // 
-    // TODO cs... do we need to pass in the 'kindOfAction'?  Seems to me we could assume it's always an insert.
-	protected List getAvailableChildElementDeclarations(Element parent, int childPosition, int kindOfAction) 
-    {
-        List modelQueryActions =  getAvailableChildrenAtIndex(parent, childPosition, ModelQuery.VALIDITY_NONE); 
-		Iterator iterator = modelQueryActions.iterator();
-		List cmnodes = new Vector();
-		while (iterator.hasNext()) {
-			ModelQueryAction action = (ModelQueryAction) iterator.next();
-			if (childPosition < 0 || (action.getStartIndex() <= childPosition && childPosition <= action.getEndIndex()) && action.getKind() == kindOfAction) {
-				CMNode actionCMNode = action.getCMNode();
-				if (actionCMNode != null && !cmnodes.contains(actionCMNode))
-					cmnodes.add(actionCMNode);
-			}
-		}
-		return cmnodes;
-	}
-
-    // returns a list of CMNodes that can be validly inserted at this childPosition 
-    // Given the grammar shown below and a snippet of XML code (where the '|' indicated the cursor position) 
-    // the list would return only the element declarations can be inserted while maintaing validity of the content. 
-    //
-    // grammar : Foo -> (A, B, C)   
-    // snippet : <Foo><A>|
-    // result  : {B}
-    //    
-    protected List getValidChildElementDeclarations(Element parent, int childPosition, int kindOfAction) 
-    {
-        List modelQueryActions =  getAvailableChildrenAtIndex(parent, childPosition, ModelQuery.VALIDITY_STRICT); 
-        Iterator iterator = modelQueryActions.iterator();
-        List cmnodes = new Vector();
-        while (iterator.hasNext()) {
-            ModelQueryAction action = (ModelQueryAction) iterator.next();      
-            if (childPosition < 0 || (action.getStartIndex() <= childPosition && childPosition <= action.getEndIndex()) && action.getKind() == kindOfAction) {
-                CMNode actionCMNode = action.getCMNode();
-                if (actionCMNode != null && !cmnodes.contains(actionCMNode))
-                    cmnodes.add(actionCMNode);
-            }           
-        }
-        return cmnodes;
-    }
-
-	/**
-	 * Similar to the call in HTMLContentAssistProcessor. Pass in a node, it
-	 * tells you if the document is XML type.
-	 * 
-	 * @param node
-	 * 
-	 */
-	protected boolean getXML(Node node) {
-		if (node == null)
-			return false;
-
-		Document doc = null;
-		doc = (node.getNodeType() != Node.DOCUMENT_NODE) ? node.getOwnerDocument() : ((Document) node);
-
-		return (doc instanceof IDOMDocument) && ((IDOMDocument) doc).isXMLType();
-	}
-
-	// Initialize local settings
-	protected void init() {
-		// implement in subclasses
-	}
-
-	protected boolean isCloseRegion(ITextRegion region) {
-		String type = region.getType();
-		return ((type == DOMRegionContext.XML_PI_CLOSE) || (type == DOMRegionContext.XML_TAG_CLOSE) || (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE) || (type == DOMRegionContext.XML_CDATA_CLOSE) || (type == DOMRegionContext.XML_COMMENT_CLOSE) || (type == DOMRegionContext.XML_ATTLIST_DECL_CLOSE) || (type == DOMRegionContext.XML_ELEMENT_DECL_CLOSE) || (type == DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE) || (type == DOMJSPRegionContextsPrivateCopy.JSP_CLOSE) || (type == DOMJSPRegionContextsPrivateCopy.JSP_COMMENT_CLOSE) || (type.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_CLOSE)) || (type == DOMRegionContext.XML_DECLARATION_CLOSE));
-	}
-
-	/*
-	 * This is to determine if a tag is a special meta-info comment tag that
-	 * shows up as an ELEMENT
-	 */
-	private boolean isCommentNode(IDOMNode node) {
-		return (node != null && node instanceof IDOMElement && ((IDOMElement) node).isCommentTag());
-	}
-
-	/**
-	 * Checks if cursor position is after doctype tag...
-	 * 
-	 * @param car
-	 * 
-	 */
-	protected boolean isCursorAfterDoctype(ContentAssistRequest car) {
-		Node aNode = car.getNode();
-		Document parent = aNode.getOwnerDocument();
-		int xmldoctypeNodePosition = -1;
-		boolean isAfterDoctype = true;
-
-		if (parent == null)
-			return true; // blank document case
-
-		for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
-			if (child instanceof IDOMNode) {
-				if (child.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
-					xmldoctypeNodePosition = ((IDOMNode) child).getEndOffset();
-					isAfterDoctype = (car.getReplacementBeginPosition() >= xmldoctypeNodePosition);
-					break;
-				}
-			}
-		}
-		return isAfterDoctype;
-	}
-
-	/**
-	 * This method can check if the cursor is after the XMLPI
-	 * 
-	 * @param car
-	 * 
-	 */
-	protected boolean isCursorAfterXMLPI(ContentAssistRequest car) {
-		Node aNode = car.getNode();
-		boolean xmlpiFound = false;
-		Document parent = aNode.getOwnerDocument();
-		int xmlpiNodePosition = -1;
-		boolean isAfterXMLPI = false;
-
-		if (parent == null)
-			return true; // blank document case
-
-		for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
-			boolean xmlpi = (child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE && child.getNodeName().equals("xml")); //$NON-NLS-1$
-			xmlpiFound = xmlpiFound || xmlpi;
-			if (xmlpiFound) {
-				if (child instanceof IDOMNode) {
-					xmlpiNodePosition = ((IDOMNode) child).getEndOffset();
-					isAfterXMLPI = (car.getReplacementBeginPosition() >= xmlpiNodePosition);
-				}
-				break;
-			}
-		}
-		return isAfterXMLPI;
-	}
-
-	protected boolean isNameRegion(ITextRegion region) {
-		String type = region.getType();
-		return ((type == DOMRegionContext.XML_TAG_NAME) || (type == DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_NAME) || (type == DOMRegionContext.XML_ELEMENT_DECL_NAME) || (type == DOMRegionContext.XML_DOCTYPE_NAME) || (type == DOMRegionContext.XML_ATTLIST_DECL_NAME) || (type == DOMJSPRegionContextsPrivateCopy.JSP_ROOT_TAG_NAME) || type.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_NAME));
-	}
-
-	protected boolean isQuote(String string) {
-		String trimmed = string.trim();
-		if (trimmed.length() > 0) {
-			return trimmed.charAt(0) == '\'' || trimmed.charAt(0) == '"';
-		}
-		return false;
-	}
-
-	private boolean isSelfClosed(IStructuredDocumentRegion startTag) {
-		ITextRegionList regions = startTag.getRegions();
-		return regions.get(regions.size() - 1).getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE;
-	}
-
-	private boolean isStartTag(IStructuredDocumentRegion sdRegion) {
-		boolean result = false;
-		if (sdRegion.getRegions().size() > 0) {
-			ITextRegion r = sdRegion.getRegions().get(0);
-			result = r.getType() == DOMRegionContext.XML_TAG_OPEN && sdRegion.isEnded();
-		}
-		return result;
-	}
-
-	protected Properties mapToProperties(CMNamedNodeMap map) {
-		Properties p = new Properties();
-		for (int i = 0; i < map.getLength(); i++) {
-			CMEntityDeclaration decl = (CMEntityDeclaration) map.item(i);
-			p.put(decl.getName(), decl.getValue());
-		}
-		return p;
-	}
-
-	/**
-	 * Gets the corresponding XMLNode, and checks if it's closed.
-	 * 
-	 * @param startTag
-	 * 
-	 */
-	private boolean needsEndTag(IStructuredDocumentRegion startTag) {
-		boolean result = false;
-		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fTextViewer.getDocument());
-		try {
-			if (sModel != null) {
-				IDOMNode xmlNode = (IDOMNode) sModel.getIndexedRegion(startTag.getStart());
-				if (!isStartTag(startTag))
-					result = false;
-				else if (isSelfClosed(startTag))
-					result = false;
-				else if (!xmlNode.isContainer())
-					result = false;
-				else
-					result = xmlNode.getEndStructuredDocumentRegion() == null;
-			}
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-		return result;
-	}
-
-	protected ContentAssistRequest newContentAssistRequest(Node node, Node possibleParent, IStructuredDocumentRegion documentRegion, ITextRegion completionRegion, int begin, int length, String filter) {
-		return new ContentAssistRequest(node, possibleParent, documentRegion, completionRegion, begin, length, filter);
-	}
-
-	public void release() {
-		fGenerator = null;
-	}
-
-	/**
-	 * Set the reason why computeProposals was not able to find any
-	 * completions.
-	 */
-	public void setErrorMessage(String errorMessage) {
-		fErrorMessage = errorMessage;
-	}
-
-	/**
-	 * Set the reason why computeProposals was not able to find any
-	 * completions.
-	 */
-	protected void setErrorMessage(String errorMessage, String append) {
-		setErrorMessage(errorMessage + append);
-	}
-
-	/**
-	 * Set the reason why computeProposals was not able to find any
-	 * completions.
-	 */
-	protected void setErrorMessage(String errorMessage, String prepend, String append) {
-		setErrorMessage(prepend + errorMessage + append);
-	}
-
-	protected boolean stringsEqual(String a, String b) {
-		// (pa) 221190 matching independent of case to be consistant with Java
-		// editor CA
-		return a.equalsIgnoreCase(b);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentModelGenerator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentModelGenerator.java
deleted file mode 100644
index e97ac6c..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentModelGenerator.java
+++ /dev/null
@@ -1,86 +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.ui.internal.contentassist;
-
-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.util.DOMNamespaceHelper;
-import org.w3c.dom.Node;
-
-
-public abstract class AbstractContentModelGenerator {
-
-	public static boolean generateChildren = false;
-
-	public AbstractContentModelGenerator() {
-		super();
-	}
-
-	public abstract void generateAttribute(CMAttributeDeclaration attrDecl, StringBuffer buffer);
-
-	protected void generateAttributes(CMElementDeclaration elementDecl, StringBuffer buffer) {
-		CMNamedNodeMap attributes = elementDecl.getAttributes();
-		if (attributes == null)
-			return;
-		for (int i = 0; i < attributes.getLength(); i++) {
-			generateAttribute((CMAttributeDeclaration) attributes.item(i), buffer);
-		}
-		return;
-	}
-
-	protected abstract void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer);
-
-	public void generateRequiredChildren(Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
-		if (generateChildren) {
-		}
-		return;
-	}
-
-	protected abstract void generateStartTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer);
-
-	public void generateTag(Node parent, CMElementDeclaration elementDecl, StringBuffer buffer) {
-		if (elementDecl == null || buffer == null)
-			return;
-
-		String tagName = getRequiredName(parent, elementDecl);
-
-		generateStartTag(tagName, parent, elementDecl, buffer);
-		generateRequiredChildren(parent, elementDecl, buffer);
-		generateEndTag(tagName, parent, elementDecl, buffer);
-		return;
-	}
-
-	public abstract int getMinimalStartTagLength(Node node, CMElementDeclaration elementDecl);
-
-	public String getRequiredName(Node ownerNode, CMNode cmnode) {
-		if (ownerNode != null) {
-			return DOMNamespaceHelper.computeName(cmnode, ownerNode, null);
-		}
-		return cmnode.getNodeName();
-	}
-
-	public abstract String getStartTagClose(Node parentNode, CMElementDeclaration elementDecl);
-
-	protected boolean requiresAttributes(CMElementDeclaration ed) {
-		CMNamedNodeMap attributes = ed.getAttributes();
-		if (attributes == null)
-			return false;
-		for (int i = 0; i < attributes.getLength(); i++) {
-			if (((CMAttributeDeclaration) attributes.item(i)).getUsage() == CMAttributeDeclaration.REQUIRED)
-				return true;
-		}
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformation.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformation.java
deleted file mode 100644
index 1987b65..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformation.java
+++ /dev/null
@@ -1,113 +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.ui.internal.contentassist;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-
-
-/**
- * Implementation of IContextInformation. Adds knowledge about the information
- * display string such as required attributes for this context.
- * 
- * @author pavery
- */
-public class AttributeContextInformation implements IContextInformation {
-	private HashMap fAttr2RangeMap;
-	/** The name of the context */
-	private String fContextDisplayString;
-	/** The image to be displayed */
-	private Image fImage;
-	/** The information to be displayed */
-	private String fInformationDisplayString;
-	private int fPosition;
-
-	/**
-	 * Creates a new context information with an image.
-	 * 
-	 * @param image
-	 *            the image to display when presenting the context information
-	 * @param contextDisplayString
-	 *            the string to be used when presenting the context
-	 * @param informationDisplayString
-	 *            the string to be displayed when presenting the context
-	 *            information, may not be <code>null</code>
-	 */
-	public AttributeContextInformation(Image image, String contextDisplayString, String informationDisplayString, HashMap attr2RangeMap) {
-		Assert.isNotNull(informationDisplayString, "illegal argument: informationDisplayString can not be null"); //$NON-NLS-1$
-
-		fImage = image;
-		fContextDisplayString = contextDisplayString;
-		fInformationDisplayString = informationDisplayString;
-		fAttr2RangeMap = attr2RangeMap;
-	}
-
-	/**
-	 * Creates a new context information without an image.
-	 * 
-	 * @param contextDisplayString
-	 *            the string to be used when presenting the context
-	 * @param informationDisplayString
-	 *            the string to be displayed when presenting the context
-	 *            information
-	 */
-	public AttributeContextInformation(String contextDisplayString, String informationDisplayString, HashMap attr2RangeMap) {
-		this(null, contextDisplayString, informationDisplayString, attr2RangeMap);
-	}
-
-	/**
-	 * Maps (String -> Position). The attribute name to the Text position.
-	 * 
-	 * 
-	 */
-	public HashMap getAttr2RangeMap() {
-		return fAttr2RangeMap;
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.contentassist.IContextInformation#getContextDisplayString()
-	 */
-	public String getContextDisplayString() {
-		if (fContextDisplayString != null)
-			return fContextDisplayString;
-		return fInformationDisplayString;
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.contentassist.IContextInformationExtension#getContextInformationPosition()
-	 */
-	public int getContextInformationPosition() {
-		return fPosition;
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.contentassist.IContextInformation#getImage()
-	 */
-	public Image getImage() {
-		return fImage;
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.contentassist.IContextInformation#getInformationDisplayString()
-	 */
-	public String getInformationDisplayString() {
-		return fInformationDisplayString;
-	}
-
-	public void setContextInformationPosition(int position) {
-		fPosition = position;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationPresenter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationPresenter.java
deleted file mode 100644
index f9cfdd1..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationPresenter.java
+++ /dev/null
@@ -1,120 +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.ui.internal.contentassist;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Position;
-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;
-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.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- * Responsible for the presentation of the context info popup. This includes
- * text style, and when the window should close.
- * 
- * @author pavery
- */
-public class AttributeContextInformationPresenter implements IContextInformationPresenter, IContextInformationValidator {
-	private int fDocumentPosition = -1;
-
-	private IContextInformation fInfo = null;
-	private ContextInfoModelUtil fModelUtil = null;
-	private ITextViewer fViewer = null;
-
-	public AttributeContextInformationPresenter() {
-		super();
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#install(org.eclipse.jface.text.contentassist.IContextInformation,
-	 *      org.eclipse.jface.text.ITextViewer, int)
-	 */
-	public void install(IContextInformation info, ITextViewer viewer, int documentPosition) {
-		fInfo = info;
-		fViewer = viewer;
-		fDocumentPosition = documentPosition;
-		fModelUtil = new ContextInfoModelUtil((IStructuredDocument) fViewer.getDocument());
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#isContextInformationValid(int)
-	 */
-	public boolean isContextInformationValid(int documentPosition) {
-		// determine whether or not this context info should still be
-		// showing...
-		// if cursor still within the element it's valid...
-		boolean result = false;
-		if (fModelUtil != null) {
-			IStructuredDocumentRegion startRegion = fModelUtil.getXMLNode(fDocumentPosition).getStartStructuredDocumentRegion();
-			int start = startRegion.getStartOffset();
-			int end = startRegion.getEndOffset();
-			result = documentPosition < end && documentPosition > start + 1;
-		}
-		return result;
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.contentassist.IContextInformationPresenter#updatePresentation(int,
-	 *      org.eclipse.jface.text.TextPresentation)
-	 */
-	public boolean updatePresentation(int documentPosition, TextPresentation presentation) {
-		presentation.clear();
-
-		if (!(fInfo instanceof AttributeContextInformation))
-			return false;
-
-		// iterate existing attributes from current node
-		IDOMNode xmlNode = fModelUtil.getXMLNode(documentPosition);
-		IStructuredDocumentRegion sdRegion = xmlNode.getFirstStructuredDocumentRegion();
-		ITextRegionList regions = sdRegion.getRegions();
-		ITextRegion r = null;
-		String attrName = ""; //$NON-NLS-1$
-		Object temp = null;
-		Position p = null;
-		HashMap map = ((AttributeContextInformation) fInfo).getAttr2RangeMap();
-
-		// so we can add ranges in order
-		StyleRange[] sorted = new StyleRange[fInfo.getInformationDisplayString().length()];
-		for (int i = 0; i < regions.size(); i++) {
-			r = regions.get(i);
-			if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-				attrName = sdRegion.getText(r);
-				temp = map.get(attrName);
-				if (temp != null) {
-					p = (Position) temp;
-					sorted[p.offset] = new StyleRange(p.offset, p.length, null, null, SWT.BOLD);
-				}
-			}
-		}
-		// style ranges need to be added in order
-		StyleRange sr = null;
-		for (int i = 0; i < sorted.length; i++) {
-			sr = sorted[i];
-			if (sr != null)
-				presentation.addStyleRange(sr);
-		}
-		return true;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationProvider.java
deleted file mode 100644
index 8634ec4..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationProvider.java
+++ /dev/null
@@ -1,208 +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.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.contentassist.ContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-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.ITextRegionList;
-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.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.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- * Calculates attribute context information based on a StructuedDocument and
- * document position.
- * 
- * @author pavery
- */
-class AttributeContextInformationProvider {
-	private final IContextInformation[] EMPTY_CONTEXT_INFO = new IContextInformation[0];
-	private Comparator fComparator;
-
-	private IStructuredDocument fDocument = null;
-	private ContextInfoModelUtil fModelUtil = null;
-
-	public AttributeContextInformationProvider(IStructuredDocument doc, AttributeContextInformationPresenter presenter) {
-		fDocument = doc;
-		fModelUtil = new ContextInfoModelUtil(fDocument);
-	}
-
-	/**
-	 * @param sdRegion
-	 
-	 */
-	private boolean canProposeInfo(IStructuredDocumentRegion sdRegion) {
-		if (sdRegion != null && isEndTag(sdRegion))
-			return false;
-		else
-			return true;
-	}
-
-	public IContextInformation[] getAttributeInformation(int offset) {
-		/*
-		 * need to take care of special cases w/ ambiguous regions <tag>|
-		 * </tag> also end tags..
-		 */
-		IContextInformation[] results = EMPTY_CONTEXT_INFO;
-
-		IStructuredDocumentRegion sdRegion = fModelUtil.getDocument().getRegionAtCharacterOffset(offset);
-		if (!canProposeInfo(sdRegion))
-			return EMPTY_CONTEXT_INFO;
-
-		IDOMNode node = fModelUtil.getXMLNode(offset);
-		if (node != null) {
-			switch (node.getNodeType()) {
-				case Node.ELEMENT_NODE :
-					results = getInfoForElement(node);
-					break;
-			// future...
-			//			case Node.TEXT_NODE :
-			//				results = getInfoForText(node);
-			//				break;
-			}
-		}
-		return results;
-	}
-
-	/**
-	 * Returns a comparator that compares CMAttributeDeclaration names.
-	 * 
-	  the comparator
-	 */
-	private Comparator getCMAttributeComparator() {
-		if (fComparator == null)
-			fComparator = new Comparator() {
-				public int compare(Object o1, Object o2) {
-					return ((CMAttributeDeclaration) o1).getAttrName().compareTo(((CMAttributeDeclaration) o2).getAttrName());
-				}
-			};
-		return fComparator;
-	}
-
-	/**
-	 * @param node
-	 
-	 */
-	private IContextInformation[] getInfoForElement(IDOMNode node) {
-		IContextInformation[] results = EMPTY_CONTEXT_INFO;
-		CMElementDeclaration decl = fModelUtil.getModelQuery().getCMElementDeclaration((Element) node);
-		if (decl != null) {
-			CMNamedNodeMap attributes = decl.getAttributes();
-
-			String attrContextString = node.getNodeName();
-			StringBuffer attrInfo = new StringBuffer(" "); //$NON-NLS-1$
-			String name = ""; //$NON-NLS-1$
-			HashMap attrPosMap = new HashMap();
-			int pos = 0;
-			int length = 0;
-			int numPerLine = 8;
-
-			CMAttributeDeclaration[] sortedAttrs = getSortedAttributes(attributes);
-
-			for (int i = 0; i < sortedAttrs.length; i++) {
-				name = sortedAttrs[i].getAttrName();
-				length = name.length();
-				pos = attrInfo.length();
-
-				attrInfo.append(name);
-
-				if (sortedAttrs[i].getUsage() == CMAttributeDeclaration.REQUIRED) {
-					attrInfo.append("*"); //$NON-NLS-1$
-					length++;
-				}
-				if (i < attributes.getLength() - 1) {
-					attrInfo.append(" "); //$NON-NLS-1$
-					if (i != 0 && i % numPerLine == 0)
-						attrInfo.append("\n "); //$NON-NLS-1$
-				}
-				attrPosMap.put(name, new Position(pos, length));
-			}
-			if (!attrInfo.toString().trim().equals("")) //$NON-NLS-1$
-				return new IContextInformation[]{new AttributeContextInformation(attrContextString, attrInfo.toString(), attrPosMap)};
-		}
-		return results;
-	}
-
-	/**
-	 * @param node
-	 
-	 */
-	 IContextInformation[] getInfoForText(IDOMNode node) {
-		Node parent = node.getParentNode();
-		String contextString = node.getNodeName();
-		StringBuffer info = new StringBuffer(" "); //$NON-NLS-1$
-		if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
-			CMElementDeclaration decl = fModelUtil.getModelQuery().getCMElementDeclaration((Element) parent);
-			CMContent content = decl.getContent();
-			if (content instanceof CMGroup) {
-				CMGroup cmGroup = (CMGroup) content;
-				CMNodeList children = cmGroup.getChildNodes();
-				CMNode cmNode = null;
-				for (int i = 0; i < children.getLength(); i++) {
-					cmNode = children.item(i);
-					contextString = cmNode.getNodeName();
-					if (contextString != null) {
-						info.append("<" + cmNode.getNodeName() + ">"); //$NON-NLS-1$ //$NON-NLS-2$
-						if (i < children.getLength() - 1)
-							info.append(" "); //$NON-NLS-1$
-					}
-				}
-			}
-		}
-		if (!info.toString().trim().equals("")) //$NON-NLS-1$
-			return new IContextInformation[]{new ContextInformation(contextString, info.toString())};
-		else
-			return EMPTY_CONTEXT_INFO;
-	}
-
-	/**
-	 * Returns sorted array of CMAttributeDeclarations.
-	 * 
-	 * @param attributes
-	 
-	 */
-	private CMAttributeDeclaration[] getSortedAttributes(CMNamedNodeMap attributes) {
-		List sorted = new ArrayList();
-		for (int i = 0; i < attributes.getLength(); i++)
-			sorted.add(attributes.item(i));
-		Collections.sort(sorted, getCMAttributeComparator());
-		return (CMAttributeDeclaration[]) sorted.toArray(new CMAttributeDeclaration[sorted.size()]);
-	}
-
-	/**
-	 * @param sdRegion
-	 
-	 */
-	private boolean isEndTag(IStructuredDocumentRegion sdRegion) {
-		ITextRegionList regions = sdRegion.getRegions();
-		return regions.get(0).getType() == DOMRegionContext.XML_END_TAG_OPEN;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContentAssistRequest.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContentAssistRequest.java
deleted file mode 100644
index 5675ab1..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContentAssistRequest.java
+++ /dev/null
@@ -1,256 +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.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-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.util.StringUtils;
-import org.w3c.dom.Node;
-
-
-public class ContentAssistRequest {
-	protected IStructuredDocumentRegion documentRegion = null;
-	protected List macros = new ArrayList();
-	protected String matchString;
-	protected Node node = null;
-	protected Node parent = null;
-	protected List proposals = new ArrayList();
-	protected ITextRegion region = null;
-	protected int replacementBeginPosition;
-	protected int replacementLength;
-
-	//	private Boolean separate = null; // (pa) not used
-	//	private Boolean sort = null; // (pa) not used
-	/**
-	 * XMLContentAssistRequest constructor comment.
-	 */
-	public ContentAssistRequest(Node node, Node parent, IStructuredDocumentRegion documentRegion, ITextRegion completionRegion, int begin, int length, String filter) {
-		super();
-		setNode(node);
-		setParent(parent);
-		setDocumentRegion(documentRegion);
-		setRegion(completionRegion);
-		setMatchString(filter);
-		setReplacementBeginPosition(begin);
-		setReplacementLength(length);
-	}
-
-	public void addMacro(ICompletionProposal newProposal) {
-		macros.add(newProposal);
-	}
-
-	public void addProposal(ICompletionProposal newProposal) {
-		proposals.add(newProposal);
-	}
-
-	public ICompletionProposal[] getCompletionProposals() {
-		ICompletionProposal results[] = null;
-		if (getProposals().size() > 0 || getMacros().size() > 0) {
-			List allProposals = new ArrayList();
-			if (!shouldSeparate()) {
-				allProposals.addAll(getProposals());
-				// should be empty, as all macros should have gone into the
-				// proposal list
-				allProposals.addAll(getMacros());
-				allProposals = sortProposals(allProposals);
-			} else {
-				allProposals.addAll(sortProposals(getProposals()));
-				allProposals.addAll(sortProposals(getMacros()));
-			}
-
-			results = new ICompletionProposal[allProposals.size()];
-			for (int i = 0; i < allProposals.size(); i++) {
-				results[i] = (ICompletionProposal) allProposals.get(i);
-			}
-		}
-		return results;
-	}
-
-
-	public IStructuredDocumentRegion getDocumentRegion() {
-		return documentRegion;
-	}
-
-	/**
-	 * 
-	 * @return java.util.List
-	 */
-	public java.util.List getMacros() {
-		return macros;
-	}
-
-	/**
-	 * 
-	 * @return java.lang.String
-	 */
-	public java.lang.String getMatchString() {
-		return matchString;
-	}
-
-	/**
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	public org.w3c.dom.Node getNode() {
-		return node;
-	}
-
-	/**
-	 * 
-	 * @return org.w3c.dom.Node
-	 */
-	public org.w3c.dom.Node getParent() {
-		return parent;
-	}
-
-	/**
-	 * 
-	 * @return java.util.List
-	 */
-	public java.util.List getProposals() {
-		return proposals;
-	}
-
-	public ITextRegion getRegion() {
-		return region;
-	}
-
-	/**
-	 * 
-	 * @return int
-	 */
-	public int getReplacementBeginPosition() {
-		return replacementBeginPosition;
-	}
-
-	/**
-	 * @return int
-	 */
-	public int getReplacementLength() {
-		return replacementLength;
-	}
-
-	public int getStartOffset() {
-		if (getDocumentRegion() != null && getRegion() != null)
-			return ((ITextRegionCollection) getDocumentRegion()).getStartOffset(getRegion());
-		return -1;
-	}
-
-	public String getText() {
-		if (getDocumentRegion() != null && getRegion() != null)
-			return ((ITextRegionCollection) getDocumentRegion()).getText(getRegion());
-		return ""; //$NON-NLS-1$
-	}
-
-	public int getTextEndOffset() {
-		if (getDocumentRegion() != null && getRegion() != null)
-			return ((ITextRegionCollection) getDocumentRegion()).getTextEndOffset(getRegion());
-		return -1;
-	}
-
-	/**
-	 * @param region
-	 */
-	public void setDocumentRegion(IStructuredDocumentRegion region) {
-		documentRegion = region;
-	}
-
-	/**
-	 * 
-	 * @param newMatchString
-	 *            java.lang.String
-	 */
-	public void setMatchString(java.lang.String newMatchString) {
-		matchString = newMatchString;
-	}
-
-	/**
-	 * 
-	 * @param newNode
-	 *            org.w3c.dom.Node
-	 */
-	public void setNode(org.w3c.dom.Node newNode) {
-		node = newNode;
-	}
-
-	/**
-	 * 
-	 * @param newParent
-	 *            org.w3c.dom.Node
-	 */
-	public void setParent(org.w3c.dom.Node newParent) {
-		parent = newParent;
-	}
-
-	/**
-	 * 
-	 * @param newRegion
-	 */
-	public void setRegion(ITextRegion newRegion) {
-		region = newRegion;
-	}
-
-	/**
-	 * 
-	 * @param newReplacementBeginPosition
-	 *            int
-	 */
-	public void setReplacementBeginPosition(int newReplacementBeginPosition) {
-		replacementBeginPosition = newReplacementBeginPosition;
-	}
-
-
-	public void setReplacementLength(int newReplacementLength) {
-		replacementLength = newReplacementLength;
-	}
-
-	public boolean shouldSeparate() {
-		/*
-		 * if (separate == null) { PreferenceManager manager =
-		 * getPreferenceManager(); if(manager == null) { separate =
-		 * Boolean.FALSE; } else { Element caSettings =
-		 * manager.getElement(PreferenceNames.CONTENT_ASSIST); separate = new
-		 * Boolean(caSettings.getAttribute(PreferenceNames.SEPARATE).equals(PreferenceNames.TRUE)); } }
-		 * return separate.booleanValue();
-		 */
-		return false;
-	}
-
-	protected List sortProposals(List proposalsIn) {
-		Collections.sort(proposalsIn, new ProposalComparator());
-		return proposalsIn;
-
-	}
-
-	/**
-	 * 
-	 * @return java.lang.String
-	 */
-	public java.lang.String toString() {
-		return "Node: " + getNode() //$NON-NLS-1$
-					+ "\nParent: " + getParent() //$NON-NLS-1$
-					+ "\nStructuredDocumentRegion: " + StringUtils.escape(getDocumentRegion().toString()) //$NON-NLS-1$
-					+ "\nRegion: " + getRegion() //$NON-NLS-1$
-					+ "\nMatch string: '" + StringUtils.escape(getMatchString()) + "'" //$NON-NLS-2$//$NON-NLS-1$
-					+ "\nOffsets: [" + getReplacementBeginPosition() + "-" + (getReplacementBeginPosition() + getReplacementLength()) + "]\n"; //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java
deleted file mode 100644
index 2c27e61..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java
+++ /dev/null
@@ -1,65 +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.ui.internal.contentassist;
-
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-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.IDOMNode;
-
-
-/**
- * @author pavery
- */
-public class ContextInfoModelUtil {
-	IStructuredDocument fDocument = null;
-
-	ContextInfoModelUtil(IStructuredDocument doc) {
-		fDocument = doc;
-	}
-
-	public IStructuredDocument getDocument() {
-		return fDocument;
-	}
-
-	public ModelQuery getModelQuery() {
-		ModelQuery mq = null;
-
-		IStructuredModel xmlModel = null;
-		try {
-			xmlModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
-			mq = ModelQueryUtil.getModelQuery(xmlModel);
-		}
-		finally {
-			if (xmlModel != null) {
-				xmlModel.releaseFromRead();
-			}
-		}
-		return mq;
-	}
-
-	public IDOMNode getXMLNode(int offset) {
-		IStructuredModel xmlModel = null;
-		IDOMNode xmlNode = null;
-		try {
-			xmlModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
-			xmlNode = (IDOMNode) xmlModel.getIndexedRegion(offset);
-		}
-		finally {
-			xmlModel.releaseFromRead();
-		}
-		return xmlNode;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/CustomTemplateProposal.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/CustomTemplateProposal.java
deleted file mode 100644
index 79097c7..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/CustomTemplateProposal.java
+++ /dev/null
@@ -1,40 +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.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.internal.util.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.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java
deleted file mode 100644
index eaac54e..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java
+++ /dev/null
@@ -1,262 +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.ui.internal.contentassist;
-
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITypedRegion;
-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.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-/**
- * ContentAssistProcessor to handle special cases in content assist where the
- * partitioner cannot determine a partition type at the current cursor
- * position (usually at EOF).
- * 
- * @author pavery
- */
-public class NoRegionContentAssistProcessor implements IContentAssistProcessor, IReleasable {
-
-	private static final boolean DEBUG = false;
-	protected char completionProposalAutoActivationCharacters[] = null;
-	protected char contextInformationAutoActivationCharacters[] = null;
-
-	private final ICompletionProposal[] EMPTY_PROPOSAL_SET = new ICompletionProposal[0];
-	protected String fErrorMessage = null;
-	private HashMap fNameToProcessorMap = null;
-	private HashMap fPartitionToProcessorMap = null;
-
-	public NoRegionContentAssistProcessor() {
-		super();
-		fPartitionToProcessorMap = new HashMap();
-		fNameToProcessorMap = new HashMap();
-		initNameToProcessorMap();
-		initPartitionToProcessorMap();
-
-	}
-
-	protected void addPartitionProcessor(String key, IContentAssistProcessor processor) {
-		addProcessor(fPartitionToProcessorMap, key, processor);
-	}
-
-	protected void addNameProcessor(String key, IContentAssistProcessor processor) {
-		addProcessor(fNameToProcessorMap, key, processor);
-	}
-
-	protected IContentAssistProcessor getPartitionProcessor(String key) {
-		return (IContentAssistProcessor) fPartitionToProcessorMap.get(key);
-	}
-
-	/**
-	 * Ensures release if it's a duplicate partition type.
-	 * 
-	 * @param map
-	 * @param key
-	 * @param processor
-	 */
-	private void addProcessor(HashMap map, String key, IContentAssistProcessor processor) {
-		Object o = map.remove(key);
-		if (o != null) {
-			if (o instanceof IReleasable) {
-				((IReleasable) o).release();
-			}
-		}
-		map.put(key, processor);
-	}
-
-	/**
-	 * Figures out what the correct ICompletionProposalProcessor is and
-	 * computesCompletionProposals on that.
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer,
-	 *      int)
-	 */
-	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
-		IContentAssistProcessor p = null;
-		ICompletionProposal[] results = EMPTY_PROPOSAL_SET;
-
-		p = guessContentAssistProcessor(viewer, documentOffset);
-		if (p != null)
-			results = p.computeCompletionProposals(viewer, documentOffset);
-
-		return (results != null) ? results : EMPTY_PROPOSAL_SET;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer,
-	 *      int)
-	 */
-	public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
-		// get context info from processor that we end up using...
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
-	 */
-	public char[] getCompletionProposalAutoActivationCharacters() {
-		return completionProposalAutoActivationCharacters;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
-	 */
-	public char[] getContextInformationAutoActivationCharacters() {
-		return contextInformationAutoActivationCharacters;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
-	 */
-	public IContextInformationValidator getContextInformationValidator() {
-		// return the validator for the content assist processor that we
-		// used...
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
-	 */
-	public String getErrorMessage() {
-		return fErrorMessage;
-	}
-
-	/**
-	 * Gives you the document partition type (String) for the given
-	 * StructuredTextViewer and documentPosition.
-	 * 
-	 * @param viewer
-	 * @param documentPosition
-	 * @return String
-	 */
-	protected String getPartitionType(StructuredTextViewer viewer, int documentPosition) {
-		IDocument document = viewer.getDocument();
-		String partitionType = null;
-		ITypedRegion partition = null;
-		try {
-			partition = document.getPartition(documentPosition);
-			partitionType = partition.getType();
-		}
-		catch (BadLocationException e) {
-			partitionType = null;
-		}
-		return partitionType;
-	}
-
-	/**
-	 * Guesses a ContentAssistProcessor based on the TextViewer and
-	 * documentOffset.
-	 * 
-	 * @param viewer
-	 * @param documentOffset
-	 */
-	protected IContentAssistProcessor guessContentAssistProcessor(ITextViewer viewer, int documentOffset) {
-		// mapping logic here...
-		// look @ previous region
-		// look @ previous doc partition type
-		// look @ page language
-		IContentAssistProcessor p = null;
-		IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion((StructuredTextViewer) viewer, documentOffset);
-		if (sdRegion != null) {
-			String currentRegionType = sdRegion.getType();
-			// System.out.println("current region type is >> " +
-			// currentRegionType);
-			if (currentRegionType == DOMRegionContext.UNDEFINED) {
-				IStructuredDocumentRegion sdPrev = sdRegion.getPrevious();
-				if (sdPrev != null) {
-					if (DEBUG) {
-						String prevRegionType = sdPrev.getType();
-						System.out.println("previous region type is >> " + prevRegionType); //$NON-NLS-1$
-					}
-				}
-			}
-		}
-		// working w/ viewer & document partition
-		if (p == null && viewer.getDocument().getLength() > 0) {
-			String prevPartitionType = getPartitionType((StructuredTextViewer) viewer, documentOffset - 1);
-			// System.out.println("previous partition type is > " +
-			// prevPartitionType);
-			p = (IContentAssistProcessor) fPartitionToProcessorMap.get(prevPartitionType);
-		}
-		return p;
-	}
-
-	/**
-	 * Inits map for extra ContentAssistProcessors (useBean, get/setProperty)
-	 */
-	protected void initNameToProcessorMap() {
-		// nothing to do in this case
-	}
-
-	/**
-	 * Adds all relevent ContentAssistProcessors to the partition to processor
-	 * map (just XML here)
-	 */
-	protected void initPartitionToProcessorMap() {
-		XMLContentAssistProcessor xmlProcessor = new XMLContentAssistProcessor();
-		addProcessor(fPartitionToProcessorMap, IXMLPartitions.XML_DEFAULT, xmlProcessor);
-	}
-
-	public void release() {
-		releasePartitionToProcessorMap();
-		releaseNameToProcessorMap();
-	}
-
-	protected void releaseMap(HashMap map) {
-		if (map != null && !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;
-		}
-	}
-
-	protected void releaseNameToProcessorMap() {
-		releaseMap(fNameToProcessorMap);
-	}
-
-	protected void releasePartitionToProcessorMap() {
-		releaseMap(fPartitionToProcessorMap);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NonValidatingModelQueryAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NonValidatingModelQueryAction.java
deleted file mode 100644
index c124016..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NonValidatingModelQueryAction.java
+++ /dev/null
@@ -1,159 +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.ui.internal.contentassist;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public class NonValidatingModelQueryAction implements org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction {
-
-	protected CMNode cmnode = null;
-	protected int endIndex = 0;
-	protected int kind = INSERT;
-	protected int startIndex = 0;
-	protected Object userData = null;
-
-	/**
-	 * NonValidatingModelQueryAction constructor comment.
-	 */
-	protected NonValidatingModelQueryAction() {
-		super();
-	}
-
-	/**
-	 * NonValidatingModelQueryAction constructor comment.
-	 */
-	public NonValidatingModelQueryAction(CMNode newChild, int newKind, int newStart, int newEnd, Object newUserData) {
-		super();
-		cmnode = newChild;
-		kind = newKind;
-		startIndex = newStart;
-		endIndex = newEnd;
-		userData = newUserData;
-	}
-
-	/**
-	 * getCMNode method comment.
-	 */
-	public org.eclipse.wst.xml.core.internal.contentmodel.CMNode getCMNode() {
-		return cmnode;
-	}
-
-	/**
-	 * 
-	 * @return int
-	 */
-	public int getEndIndex() {
-		return endIndex;
-	}
-
-	/**
-	 * 
-	 * @return int
-	 */
-	public int getKind() {
-		return kind;
-	}
-
-	/**
-	 * getParent method comment.
-	 */
-	public org.w3c.dom.Node getParent() {
-		return null;
-	}
-
-	/**
-	 * 
-	 * @return int
-	 */
-	public int getStartIndex() {
-		return startIndex;
-	}
-
-	/**
-	 * getUserData method comment.
-	 */
-	public Object getUserData() {
-		return null;
-	}
-
-	/**
-	 * performAction method comment.
-	 */
-	public void performAction() {
-	}
-
-	/**
-	 * setCMNode method comment.
-	 */
-	protected void setCMNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode newNode) {
-		cmnode = newNode;
-	}
-
-	/**
-	 * 
-	 * @param newEndIndex
-	 *            int
-	 */
-	protected void setEndIndex(int newEndIndex) {
-		endIndex = newEndIndex;
-	}
-
-	/**
-	 * 
-	 * @param newKind
-	 *            int
-	 */
-	protected void setKind(int newKind) {
-		kind = newKind;
-	}
-
-	/**
-	 * 
-	 * @param newStartIndex
-	 *            int
-	 */
-	protected void setStartIndex(int newStartIndex) {
-		startIndex = newStartIndex;
-	}
-
-	/**
-	 * setUserData method comment.
-	 */
-	public void setUserData(Object object) {
-	}
-
-	/**
-	 * 
-	 * @return java.lang.String
-	 */
-	public String toString() {
-		String actionName = null;
-		switch (kind) {
-			case INSERT :
-				actionName = "INSERT";//$NON-NLS-1$
-				break;
-			case REMOVE :
-				actionName = "REMOVE";//$NON-NLS-1$
-				break;
-			case REPLACE :
-				actionName = "REPLACE";//$NON-NLS-1$
-				break;
-			default :
-				actionName = "UNKNOWN ACTION ";//$NON-NLS-1$
-		}
-		String nodeName = (cmnode != null) ? getCMNode().getNodeName() : "(unknown)";//$NON-NLS-1$
-		return actionName + "=" + nodeName + "(" + startIndex + "..." + endIndex + ")";//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ProposalComparator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ProposalComparator.java
deleted file mode 100644
index 28356d3..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ProposalComparator.java
+++ /dev/null
@@ -1,48 +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.ui.internal.contentassist;
-
-
-
-import java.util.Comparator;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
-
-
-public class ProposalComparator implements Comparator {
-
-
-	public int compare(Object o1, Object o2) {
-		int relevance = 0;
-		if (o1 instanceof IRelevanceCompletionProposal && o2 instanceof IRelevanceCompletionProposal) {
-			// sort based on relevance
-			IRelevanceCompletionProposal cp1 = (IRelevanceCompletionProposal) o1;
-			IRelevanceCompletionProposal cp2 = (IRelevanceCompletionProposal) o2;
-
-			relevance = cp2.getRelevance() - cp1.getRelevance();
-
-			// if same relevance, secondary sort (lexigraphically)
-			if (relevance == 0 && o1 instanceof ICompletionProposal && o2 instanceof ICompletionProposal) {
-				String displayString1 = ((ICompletionProposal) o1).getDisplayString();
-				String displayString2 = ((ICompletionProposal) o2).getDisplayString();
-				if (displayString1 != null && displayString2 != null)
-					//relevance = displayString1.compareTo(displayString2);
-					// // this didn't mix caps w/ lowercase
-					relevance = java.text.Collator.getInstance().compare(displayString1, displayString2);
-			}
-		}
-		// otherwise if it's not ISEDRelevanceCompletionProposal, don't sort
-		return relevance;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SimpleCMElementDeclaration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SimpleCMElementDeclaration.java
deleted file mode 100644
index 137d6a6..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SimpleCMElementDeclaration.java
+++ /dev/null
@@ -1,170 +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.ui.internal.contentassist;
-
-
-
-public class SimpleCMElementDeclaration implements org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration {
-
-	String fNodeName;
-
-	/**
-	 * SimpleCMELementDeclaration constructor comment.
-	 */
-	public SimpleCMElementDeclaration() {
-		super();
-	}
-
-	public SimpleCMElementDeclaration(String nodeName) {
-		super();
-		setNodeName(nodeName);
-	}
-
-	/**
-	 * getAttributes method
-	 * 
-	 * @return CMNamedNodeMap
-	 * 
-	 * Returns CMNamedNodeMap of AttributeDeclaration
-	 */
-	public org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap getAttributes() {
-		return null;
-	}
-
-	/**
-	 * getCMContent method
-	 * 
-	 * @return CMContent
-	 * 
-	 * Returns the root node of this element's content model. This can be an
-	 * CMElementDeclaration or a CMGroup
-	 */
-	public org.eclipse.wst.xml.core.internal.contentmodel.CMContent getContent() {
-		return null;
-	}
-
-	/**
-	 * getContentType method
-	 * 
-	 * @return int
-	 * 
-	 * Returns one of : ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA.
-	 */
-	public int getContentType() {
-		return 0;
-	}
-
-	/**
-	 * getDataType method
-	 * 
-	 * @return java.lang.String
-	 */
-	public org.eclipse.wst.xml.core.internal.contentmodel.CMDataType getDataType() {
-		return null;
-	}
-
-	/**
-	 * getElementName method
-	 * 
-	 * @return java.lang.String
-	 */
-	public String getElementName() {
-		return null;
-	}
-
-	/**
-	 * getLocalElements method
-	 * 
-	 * @return CMNamedNodeMap
-	 * 
-	 * Returns a list of locally defined elements.
-	 */
-	public org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap getLocalElements() {
-		return null;
-	}
-
-	/**
-	 * getMaxOccur method
-	 * 
-	 * @return int
-	 * 
-	 * If -1, it's UNBOUNDED.
-	 */
-	public int getMaxOccur() {
-		return 0;
-	}
-
-	/**
-	 * getMinOccur method
-	 * 
-	 * @return int
-	 * 
-	 * If 0, it's OPTIONAL. If 1, it's REQUIRED.
-	 */
-	public int getMinOccur() {
-		return 0;
-	}
-
-	/**
-	 * 
-	 * @return java.lang.String
-	 */
-	public java.lang.String getNodeName() {
-		return fNodeName;
-	}
-
-	/**
-	 * getNodeType method
-	 * 
-	 * @return int
-	 * 
-	 * Returns one of :
-	 *  
-	 */
-	public int getNodeType() {
-		return 0;
-	}
-
-	/**
-	 * getProperty method
-	 * 
-	 * @return java.lang.Object
-	 * 
-	 * Returns the object property desciped by the propertyName
-	 *  
-	 */
-	public Object getProperty(String propertyName) {
-		return null;
-	}
-
-	/**
-	 * 
-	 * @param newNodeName
-	 *            java.lang.String
-	 */
-	public void setNodeName(java.lang.String newNodeName) {
-		fNodeName = newNodeName;
-	}
-
-	/**
-	 * supports method
-	 * 
-	 * @return boolean
-	 * 
-	 * Returns true if the CMNode supports a specified property
-	 *  
-	 */
-	public boolean supports(String propertyName) {
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SourceEditorImageHelper.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SourceEditorImageHelper.java
deleted file mode 100644
index 3cbd698..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SourceEditorImageHelper.java
+++ /dev/null
@@ -1,48 +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.ui.internal.contentassist;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-
-/**
- * @deprecated use internal XMLEditorPluginImageHelper or external
- *             SharedXMLEditorPluginImageHelper instead
- */
-public class SourceEditorImageHelper {
-
-	public SourceEditorImageHelper() {
-		super();
-	}
-
-	public Image createImage(String resource) {
-		ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(XMLUIPlugin.ID, resource);
-		Image image = desc.createImage();
-		JFaceResources.getImageRegistry().put(resource, image);
-		return image;
-	}
-
-	public Image getImage(String resource) {
-		Image image = JFaceResources.getImageRegistry().get(resource);
-		if (image == null) {
-			image = createImage(resource);
-		}
-		return image;
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistProcessor.java
deleted file mode 100644
index 01068ba..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistProcessor.java
+++ /dev/null
@@ -1,145 +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.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-import org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeIdsXML;
-
-public class XMLContentAssistProcessor extends AbstractContentAssistProcessor implements IPropertyChangeListener {
-
-	protected IPreferenceStore fPreferenceStore = null;
-	protected IResource fResource = null;
-	private XMLTemplateCompletionProcessor fTemplateProcessor = null;
-	private List fTemplateContexts = new ArrayList();
-
-	public XMLContentAssistProcessor() {
-		super();
-	}
-	
-	protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
-		addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.ATTRIBUTE);
-		super.addAttributeNameProposals(contentAssistRequest);
-	}
-	
-	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
-		addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.ATTRIBUTE_VALUE);
-		super.addAttributeValueProposals(contentAssistRequest);
-	}
-	
-	protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
-		addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.NEW);
-		super.addEmptyDocumentProposals(contentAssistRequest);
-	}
-	
-	protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
-		addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.TAG);
-		super.addTagInsertionProposals(contentAssistRequest, childPosition);
-	}
-	
-	/**
-	 * Adds templates to the list of proposals
-	 * 
-	 * @param contentAssistRequest
-	 * @param context
-	 */
-	private void addTemplates(ContentAssistRequest contentAssistRequest, String context) {
-		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, contentAssistRequest.getReplacementBeginPosition());
-				for (int i = 0; i < proposals.length; ++i) {
-					if (useProposalList)
-						contentAssistRequest.addProposal(proposals[i]);
-					else
-						contentAssistRequest.addMacro(proposals[i]);
-				}
-			}
-		}
-	}
-	
-	protected ContentAssistRequest computeCompletionProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
-		ContentAssistRequest request = super.computeCompletionProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
-		addTemplates(request, TemplateContextTypeIdsXML.ALL);
-		return request;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.wst.xml.ui.contentassist.AbstractContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int)
-	 */
-	public ICompletionProposal[] computeCompletionProposals(ITextViewer textViewer, int documentPosition) {
-		fTemplateContexts.clear();
-		return super.computeCompletionProposals(textViewer, documentPosition);
-	}
-
-	protected IPreferenceStore getPreferenceStore() {
-		if (fPreferenceStore == null)
-			fPreferenceStore = XMLUIPlugin.getDefault().getPreferenceStore();
-		return fPreferenceStore;
-	}
-
-	private XMLTemplateCompletionProcessor getTemplateCompletionProcessor() {
-		if (fTemplateProcessor == null) {
-			fTemplateProcessor = new XMLTemplateCompletionProcessor();
-		}
-		return fTemplateProcessor;
-	}
-
-	protected void init() {
-		getPreferenceStore().addPropertyChangeListener(this);
-		reinit();
-	}
-
-	public void propertyChange(PropertyChangeEvent event) {
-		String property = event.getProperty();
-
-		if (property.compareTo(XMLUIPreferenceNames.AUTO_PROPOSE) == 0 || property.compareTo(XMLUIPreferenceNames.AUTO_PROPOSE_CODE) == 0) {
-			reinit();
-		}
-	}
-
-	protected void reinit() {
-		String key = XMLUIPreferenceNames.AUTO_PROPOSE;
-		boolean doAuto = getPreferenceStore().getBoolean(key);
-		if (doAuto) {
-			key = XMLUIPreferenceNames.AUTO_PROPOSE_CODE;
-			completionProposalAutoActivationCharacters = getPreferenceStore().getString(key).toCharArray();
-		} else {
-			completionProposalAutoActivationCharacters = null;
-		}
-	}
-
-	public void release() {
-		super.release();
-		getPreferenceStore().removePropertyChangeListener(this);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistUtilities.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistUtilities.java
deleted file mode 100644
index 7c10986..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistUtilities.java
+++ /dev/null
@@ -1,490 +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.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.osgi.util.NLS;
-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.util.ScriptLanguageKeys;
-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.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.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * @author pavery
- */
-public class XMLContentAssistUtilities extends ContentAssistUtils {
-	
-    /**
-     * 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 class DOMJSPRegionContextsPrivateCopy {
-		private static final String JSP_CLOSE = "JSP_CLOSE"; //$NON-NLS-1$
-		private static final String JSP_DECLARATION_OPEN = "JSP_DECLARATION_OPEN"; //$NON-NLS-1$
-		private static final String JSP_SCRIPTLET_OPEN = "JSP_SCRIPTLET_OPEN"; //$NON-NLS-1$
-		private static final String JSP_EXPRESSION_OPEN = "JSP_EXPRESSION_OPEN"; //$NON-NLS-1$
-
-	}
-
-
-	public static final String CONTENT = "Content"; //$NON-NLS-1$
-	public static final String CONTENT_SCRIPT_TYPE = "Content-Script-Type"; //$NON-NLS-1$
-	public static final String HEAD = "HEAD"; //$NON-NLS-1$
-	public static final String HTML = "HTML"; //$NON-NLS-1$
-	public static final String HTTP_EQUIV = "HTTP-EQUIV"; //$NON-NLS-1$
-	public static final String META = "META"; //$NON-NLS-1$
-
-	/**
-	 * A convenience method for getting the closing proposal given the
-	 * contents (IndexedRegion) of a tag that is started, but possibly not
-	 * ended
-	 * 
-	 * @param viewer
-	 *            the text viewer
-	 * @param documentPosition
-	 *            the cursor position in the viewer
-	 * @param indexedNode
-	 *            the contents of the tag that is started but possibly not
-	 *            ended
-	 * @param parentTagName
-	 *            the tag on which you are checkin for an ending tag
-	 * @param imagePath
-	 *            content assist image relative path 
-	 * @return ICompletionProposal
-	 */
-	public static ICompletionProposal computeJSPEndTagProposal(ITextViewer viewer, int documentPosition, IndexedRegion indexedNode, String parentTagName, String imagePath) {
-		ICompletionProposal p = null;
-
-		// check if tag is closed
-		boolean hasEndTag = true;
-		boolean isJSPTag = false;
-		IDOMNode xnode = null;
-		String tagName = ""; //$NON-NLS-1$
-		if (indexedNode instanceof IDOMNode) {
-			xnode = ((IDOMNode) indexedNode);
-			// it's ended already...
-			if (xnode.getEndStructuredDocumentRegion() != null)
-				return null;
-			IDOMNode openNode = null;
-			if (!xnode.getNodeName().equalsIgnoreCase(parentTagName))
-				openNode = (IDOMNode) xnode.getParentNode();
-			if (openNode != null) {
-				if (openNode instanceof IDOMElement) {
-					isJSPTag = ((IDOMElement) openNode).isJSPTag();
-				}
-				tagName = openNode.getNodeName();
-				hasEndTag = (openNode.getEndStructuredDocumentRegion() != null);
-			}
-		}
-
-		// it's closed, don't add close tag proposal
-		if (!hasEndTag && !isJSPTag) {
-
-			// create appropriate close tag text
-			String proposedText = proposedText = "</" + tagName; //$NON-NLS-1$
-			String viewerText = viewer.getTextWidget().getText();
-			if (viewerText.length() >= documentPosition && viewerText.length() >= 2 && documentPosition >= 2) {
-				String last2chars = viewerText.substring(documentPosition - 2, documentPosition);
-				if (last2chars.endsWith("</")) //$NON-NLS-1$
-					proposedText = tagName;
-				else if (last2chars.endsWith("<")) //$NON-NLS-1$
-					proposedText = "/" + tagName; //$NON-NLS-1$
-			}
-
-			// create proposal
-			p = new CustomCompletionProposal(proposedText + ">", //$NON-NLS-1$
-						documentPosition, 0, proposedText.length() + 1, XMLEditorPluginImageHelper.getInstance().getImage(imagePath), //$NON-NLS-1$
-						NLS.bind(XMLUIMessages.End_with_, (new Object[]{proposedText})),
-						null, null, XMLRelevanceConstants.R_END_TAG);
-		}
-		else if (!hasEndTag && isJSPTag) {
-
-			// create appropriate close tag text
-			String proposedText = proposedText = "%"; //$NON-NLS-1$
-			String viewerText = viewer.getTextWidget().getText();
-
-			// TODO (pa) make it smarter to add "%>" or just ">" if % is
-			// already there...
-			if (viewerText.length() >= documentPosition && viewerText.length() >= 2) {
-				String last2chars = viewerText.substring(documentPosition - 2, documentPosition);
-				String lastchar = viewerText.substring(documentPosition - 1, documentPosition);
-				if (lastchar.equals("%")) //$NON-NLS-1$
-				{
-					if (last2chars.endsWith("<%")) //$NON-NLS-1$
-						proposedText = "%"; //$NON-NLS-1$
-					else
-						proposedText = ""; //$NON-NLS-1$
-				}
-			}
-
-			// create proposal
-			p = new CustomCompletionProposal(proposedText + ">", //$NON-NLS-1$
-						documentPosition, 0, proposedText.length() + 1, XMLEditorPluginImageHelper.getInstance().getImage(imagePath), //$NON-NLS-1$
-						NLS.bind(XMLUIMessages.End_with_, (new Object[]{proposedText})),
-						null, null, XMLRelevanceConstants.R_END_TAG);
-		}
-
-		return p;
-	}
-
-
-	/**
-	 * A convenience method for getting the closing proposal given the
-	 * contents (IndexedRegion) of a tag that is started, but possibly not
-	 * ended
-	 * 
-	 * @param viewer
-	 *            the text viewer
-	 * @param documentPosition
-	 *            the cursor position in the viewer
-	 * @param indexedNode
-	 *            the contents of the tag that is started but possibly not
-	 *            ended
-	 * @param parentTagName
-	 *            the tag on which you are checkin for an ending tag
-	 * @param imagePath
-	 *            content assist relative image path
-	 * @return ICompletionProposal
-	 */
-	public static ICompletionProposal computeXMLEndTagProposal(ITextViewer viewer, int documentPosition, IndexedRegion indexedNode, String parentTagName, String imagePath) {
-		ICompletionProposal p = null;
-
-		// check if tag is closed
-		boolean hasEndTag = true;
-		IDOMNode xnode = null;
-		String tagName = ""; //$NON-NLS-1$
-		if (indexedNode instanceof IDOMNode) {
-			xnode = ((IDOMNode) indexedNode);
-			// it's ended already...
-			if (xnode.getEndStructuredDocumentRegion() != null)
-				return null;
-			IDOMNode styleNode = null;
-			if (!xnode.getNodeName().equalsIgnoreCase(parentTagName))
-				styleNode = (IDOMNode) xnode.getParentNode();
-			if (styleNode != null) {
-				tagName = styleNode.getNodeName();
-				hasEndTag = (styleNode.getEndStructuredDocumentRegion() != null);
-			}
-		}
-
-		// it's closed, don't add close tag proposal
-		if (!hasEndTag) {
-
-			// create appropriate close tag text
-			String proposedText = proposedText = "</" + tagName; //$NON-NLS-1$
-			String viewerText = viewer.getTextWidget().getText();
-			if (viewerText.length() >= documentPosition && viewerText.length() >= 2 && documentPosition >= 2) {
-				String last2chars = viewerText.substring(documentPosition - 2, documentPosition);
-				if (last2chars.endsWith("</")) //$NON-NLS-1$
-					proposedText = tagName;
-				else if (last2chars.endsWith("<")) //$NON-NLS-1$
-					proposedText = "/" + tagName; //$NON-NLS-1$
-			}
-
-			// create proposal
-			p = new CustomCompletionProposal(proposedText + ">", //$NON-NLS-1$
-						documentPosition, 0, proposedText.length() + 1, XMLEditorPluginImageHelper.getInstance().getImage(imagePath), //$NON-NLS-1$
-						NLS.bind(XMLUIMessages.End_with_, (new Object[]{proposedText})),
-						null, null, XMLRelevanceConstants.R_END_TAG);
-		}
-		return p;
-	}
-
-	private static String getMetaScriptType(Document doc) {
-		// Can not just do a Document.getElementsByTagName(String) as this
-		// needs
-		// to be relatively fast.
-		List metas = new ArrayList();
-		// check for META tags under the Document
-		Node html = null;
-		Node head = null;
-		Node child = null;
-		// ----------------------------------------------------------------------
-		// (pa) 20021217
-		// cmvc defect 235554
-		// performance enhancement: using child.getNextSibling() rather than
-		// nodeList(item) for O(n) vs. O(n*n)
-		// ----------------------------------------------------------------------
-
-		for (child = doc.getFirstChild(); child != null; child = child.getNextSibling()) {
-			if (child.getNodeType() != Node.ELEMENT_NODE)
-				continue;
-			if (child.getNodeName().equalsIgnoreCase(META))
-				metas.add(child);
-			else if (child.getNodeName().equalsIgnoreCase(HTML))
-				html = child;
-		}
-		// NodeList children = doc.getChildNodes();
-		// for(int i = 0; i < children.getLength(); i++) {
-		// child = children.item(i);
-		// if(child.getNodeType() != Node.ELEMENT_NODE)
-		// continue;
-		// if(child.getNodeName().equalsIgnoreCase(META))
-		// metas.add(child);
-		// else if(child.getNodeName().equalsIgnoreCase(HTML))
-		// html = child;
-		// }
-
-		// check for META tags under HEAD
-		if (html != null) {
-			for (child = html.getFirstChild(); child != null && head == null; child = child.getNextSibling()) {
-				if (child.getNodeType() != Node.ELEMENT_NODE)
-					continue;
-				if (child.getNodeName().equalsIgnoreCase(HEAD))
-					head = child;
-			}
-			// children = html.getChildNodes();
-			// for(int i = 0; i < children.getLength() && head == null; i++) {
-			// child = children.item(i);
-			// if(child.getNodeType() != Node.ELEMENT_NODE)
-			// continue;
-			// if(child.getNodeName().equalsIgnoreCase(HEAD))
-			// head = child;
-			// }
-		}
-
-		if (head != null) {
-			for (head.getFirstChild(); child != null; child = child.getNextSibling()) {
-				if (child.getNodeType() != Node.ELEMENT_NODE)
-					continue;
-				if (child.getNodeName().equalsIgnoreCase(META))
-					metas.add(child);
-			}
-			// children = head.getChildNodes();
-			// for(int i = 0 ; i < children.getLength(); i++) {
-			// child = children.item(i);
-			// if(child.getNodeType() != Node.ELEMENT_NODE)
-			// continue;
-			// if(child.getNodeName().equalsIgnoreCase(META))
-			// metas.add(child);
-			// }
-		}
-
-		return getMetaScriptType(metas);
-	}
-
-	private static String getMetaScriptType(List metaNodeList) {
-		Node meta = null;
-		NamedNodeMap attributes = null;
-		boolean httpEquiv = false;
-		String contentScriptType = null;
-
-		for (int i = metaNodeList.size() - 1; i >= 0; i--) {
-			meta = (Node) metaNodeList.get(i);
-			attributes = meta.getAttributes();
-			httpEquiv = false;
-			contentScriptType = null;
-			for (int j = 0; j < attributes.getLength(); j++) {
-				if (attributes.item(j).getNodeName().equalsIgnoreCase(HTTP_EQUIV)) {
-					httpEquiv = attributes.item(j).getNodeValue().equalsIgnoreCase(CONTENT_SCRIPT_TYPE);
-				}
-				else if (attributes.item(j).getNodeName().equalsIgnoreCase(CONTENT)) {
-					contentScriptType = attributes.item(j).getNodeValue();
-				}
-			}
-			if (httpEquiv && contentScriptType != null)
-				return contentScriptType;
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the scripting language the scriptNode is in Currently returns
-	 * javascript unless some unknown type or language is specified. Then the
-	 * unknown type/language is returned
-	 * 
-	 * @param scriptNode
-	 */
-	public static String getScriptLanguage(Node scriptNode) {
-		Node attr = null;
-
-		boolean specified = false;
-		// try to find a scripting adapter for 'type'
-		if ((scriptNode == null) || (scriptNode.getAttributes() == null))
-			return null;
-
-		attr = scriptNode.getAttributes().getNamedItem("type");//$NON-NLS-1$
-		if (attr != null) {
-			specified = true;
-			String type = attr.getNodeValue();
-			return lookupScriptType(type);
-		}
-		// now try to find a scripting adapter for 'language' (deprecated by
-		// HTML specifications)
-		attr = scriptNode.getAttributes().getNamedItem("language");//$NON-NLS-1$
-		if (attr != null) {
-			specified = true;
-			String language = attr.getNodeValue();
-			return lookupScriptLanguage(language);
-		}
-		// check if one is specified by a META tag at the root level or inside
-		// of HEAD
-		String type = null;
-		if (!specified)
-			type = getMetaScriptType(scriptNode.getOwnerDocument());
-		if (type != null) {
-			specified = true;
-			return lookupScriptType(type);
-		}
-		// return default
-		if (!specified)
-			return ScriptLanguageKeys.JAVASCRIPT;
-		return null;
-	}
-
-	/**
-	 * Tells you if the flatnode is the %> delimiter
-	 * 
-	 * 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".
-	 */
-	public static boolean isJSPCloseDelimiter(IStructuredDocumentRegion fn) {
-		if (fn == null)
-			return false;
-		return isJSPCloseDelimiter(fn.getType());
-	}
-
-	/**
-	 * 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".
-	 */
-	public static boolean isJSPCloseDelimiter(String type) {
-		if (type == null)
-			return false;
-		return (type.equals(DOMJSPRegionContextsPrivateCopy.JSP_CLOSE) || type.equals(DOMRegionContext.XML_TAG_CLOSE));
-	}
-
-	/**
-	 * Tells you if the flatnode is the JSP region <%%>, <%=%>, <%!%>
-	 * 
-	 * 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".
-	 */
-	public static boolean isJSPDelimiter(IStructuredDocumentRegion fn) {
-		boolean isDelimiter = false;
-		String type = fn.getType();
-		if (type != null) {
-			isDelimiter = isJSPDelimiter(type);
-		}
-		return isDelimiter;
-	}
-
-	/**
-	 * 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".
-	 */
-	public static boolean isJSPDelimiter(String type) {
-		if (type == null)
-			return false;
-		return (isJSPOpenDelimiter(type) || isJSPCloseDelimiter(type));
-	}
-
-	/**
-	 * Tells you if the flatnode is <%, <%=, or <%! 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".
-	 */
-	public static boolean isJSPOpenDelimiter(IStructuredDocumentRegion fn) {
-		if (fn == null)
-			return false;
-		return isJSPOpenDelimiter(fn.getType());
-	}
-
-    /**
-	 * 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".
-	 */
-	public static boolean isJSPOpenDelimiter(String type) {
-		if (type == null)
-			return false;
-		return (type.equals(DOMJSPRegionContextsPrivateCopy.JSP_SCRIPTLET_OPEN) || type.equals(DOMJSPRegionContextsPrivateCopy.JSP_DECLARATION_OPEN) || type.equals(DOMJSPRegionContextsPrivateCopy.JSP_EXPRESSION_OPEN));
-	}
-
-	/**
-	 * Tells you if the flatnode is the <jsp:scriptlet>, <jsp:expression>, or
-	 * <jsp:declaration>tag
-	 * 
-	 * 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".
-	 */
-	public static boolean isXMLJSPDelimiter(IStructuredDocumentRegion fn) {
-		boolean isDelimiter = false;
-		if (fn != null && fn instanceof ITextRegionContainer) {
-			Object[] regions = ((ITextRegionContainer) fn).getRegions().toArray();
-			ITextRegion temp = null;
-			String regionText = ""; //$NON-NLS-1$
-			for (int i = 0; i < regions.length; i++) {
-				temp = (ITextRegion) regions[i];
-				if (temp.getType() == DOMRegionContext.XML_TAG_NAME) {
-					regionText = fn.getText(temp);
-					if (regionText.equalsIgnoreCase("jsp:scriptlet") || regionText.equalsIgnoreCase("jsp:expression") || regionText.equalsIgnoreCase("jsp:declaration")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-						isDelimiter = true;
-				}
-			}
-		}
-		return isDelimiter;
-	}
-
-	/**
-	 * Returns "javascript" if language attribute is some form of javascript,
-	 * "java" if language attribute is some form of java. Otherwise, just
-	 * returns type.
-	 * 
-	 * @param language
-	 */
-	public static String lookupScriptLanguage(String language) {
-		for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS.length; i++) {
-			if (ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS[i].equalsIgnoreCase(language))
-				return ScriptLanguageKeys.JAVASCRIPT;
-		}
-		for (int i = 0; i < ScriptLanguageKeys.JAVA_LANGUAGE_KEYS.length; i++) {
-			if (ScriptLanguageKeys.JAVA_LANGUAGE_KEYS[i].equalsIgnoreCase(language))
-				return ScriptLanguageKeys.JAVA;
-		}
-		return language;
-	}
-
-	/**
-	 * Returns "javascript" if type (used in <script type="xxx"> is actually
-	 * javascript type. Otherwise, just returns type
-	 * 
-	 * @param type
-	 */
-	public static String lookupScriptType(String type) {
-		for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS.length; i++)
-			if (ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS[i].equalsIgnoreCase(type))
-				return ScriptLanguageKeys.JAVASCRIPT;
-		return type;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentModelGenerator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentModelGenerator.java
deleted file mode 100644
index c3c87f3..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentModelGenerator.java
+++ /dev/null
@@ -1,135 +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.ui.internal.contentassist;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-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.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-
-public class XMLContentModelGenerator extends AbstractContentModelGenerator {
-
-	/**
-	 * 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 class DOMJSPRegionContextsPrivateCopy {
-		private static final String JSP_DIRECTIVE_OPEN = "JSP_DIRECTIVE_OPEN"; //$NON-NLS-1$
-	}
-
-	/**
-	 * XMLContentModelGenerator constructor comment.
-	 */
-	public XMLContentModelGenerator() {
-		super();
-	}
-
-	public void generateAttribute(CMAttributeDeclaration attrDecl, StringBuffer buffer) {
-		if (attrDecl == null || buffer == null)
-			return;
-		int usage = attrDecl.getUsage();
-		if (usage == CMAttributeDeclaration.REQUIRED) {
-			buffer.append(" "); //$NON-NLS-1$
-			generateRequiredAttribute(null, attrDecl, buffer); // todo pass
-			// ownerNode as
-			// 1st param
-		}
-		return;
-	}
-
-	protected void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
-		if (elementDecl == null)
-			return;
-		if (elementDecl.getContentType() != CMElementDeclaration.EMPTY)
-			buffer.append("</" + tagName + ">");//$NON-NLS-2$//$NON-NLS-1$
-		return;
-	}
-
-	public void generateRequiredAttribute(Node ownerNode, CMAttributeDeclaration attrDecl, StringBuffer buffer) {
-		if (attrDecl == null || buffer == null)
-			return;
-
-		// attribute name
-		String attributeName = getRequiredName(ownerNode, attrDecl);
-		CMDataType attrType = attrDecl.getAttrType();
-		// = sign
-		buffer.append(attributeName + "=\""); //$NON-NLS-1$
-		// attribute value
-		if (attrType != null) {
-			// insert any value that is implied
-			if (attrType.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE && attrType.getImpliedValue() != null) {
-				buffer.append(attrType.getImpliedValue());
-			}
-			// otherwise, if an enumerated list of values exists, use the
-			// first value
-			else if (attrType.getEnumeratedValues() != null && attrType.getEnumeratedValues().length > 0) {
-				buffer.append(attrType.getEnumeratedValues()[0]);
-			}
-		}
-		buffer.append("\""); //$NON-NLS-1$
-		return;
-	}
-
-	protected void generateStartTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
-		if (elementDecl == null || buffer == null)
-			return;
-		buffer.append("<" + tagName);//$NON-NLS-1$
-		generateAttributes(elementDecl, buffer);
-		buffer.append(getStartTagClose(parentNode, elementDecl));
-		return;
-	}
-
-	public int getMinimalStartTagLength(Node node, CMElementDeclaration elementDecl) {
-		if (elementDecl == null)
-			return 0;
-		if (requiresAttributes(elementDecl)) {
-			return getRequiredName(node, elementDecl).length() + 2; // < +
-			// name +
-			// space
-		}
-		else {
-			return 1 + getRequiredName(node, elementDecl).length() + getStartTagClose(node, elementDecl).length(); // < +
-			// name
-			// +
-			// appropriate
-			// close
-		}
-	}
-
-	protected String getOtherClose(Node notATagNode) {
-		if (notATagNode instanceof IDOMNode) {
-			IStructuredDocumentRegion node = ((IDOMNode) notATagNode).getStartStructuredDocumentRegion();
-			if (node != null && node.getNumberOfRegions() > 1 && node.getRegions().get(0).getType().equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_OPEN)) {
-				return "%>"; //$NON-NLS-1$
-			}
-		}
-		return null;
-	}
-
-	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.getContentType() == CMElementDeclaration.EMPTY)
-			return "/>"; //$NON-NLS-1$
-		return ">"; //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLRelevanceConstants.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLRelevanceConstants.java
deleted file mode 100644
index 1ac3554..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLRelevanceConstants.java
+++ /dev/null
@@ -1,52 +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.ui.internal.contentassist;
-
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceConstants;
-
-
-
-/**
- * some relevance constants for content assist higher relevance means it shows
- * up higher on the list
- */
-public interface XMLRelevanceConstants extends IRelevanceConstants {
-
-	int R_CDATA = 400;
-	int R_CLOSE_TAG = 1500;
-
-	int R_COMMENT = 100;
-
-	// moved this above macros
-	int R_DOCTYPE = 600;
-	int R_END_TAG = 1400;
-	int R_END_TAG_NAME = 1100;
-	int R_ENTITY = 1000;
-	int R_JSP = 500;
-
-	int R_JSP_ATTRIBUTE_VALUE = 700;
-
-	// (pa) make these the same relevance so proposals are same order for V501
-	int R_MACRO = 500;
-
-	// add this onto "required" attrs, elements, etc to bubble them up on
-	// sorting...
-	// CMVC 246618
-	int R_REQUIRED = 10;
-	int R_TAG_INSERTION = 500;
-    int R_STRICTLY_VALID_TAG_INSERTION = 600;
-	int R_TAG_NAME = 1200;
-	int R_XML_ATTRIBUTE_NAME = 900;
-	int R_XML_ATTRIBUTE_VALUE = 800;
-	int R_XML_DECLARATION = 1300;
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplateCompletionProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplateCompletionProcessor.java
deleted file mode 100644
index a789a47..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplateCompletionProcessor.java
+++ /dev/null
@@ -1,80 +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.ui.internal.contentassist;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-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.persistence.TemplateStore;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-
-/**
- * Completion processor for XML Templates. Most of the work is already done
- * by the XML Content Assist processor, so by the time the
- * XMLTemplateCompletionProcessor is asked for content assist proposals, the
- * XML content assist processor has already set the context type for
- * templates.
- */
-class XMLTemplateCompletionProcessor extends TemplateCompletionProcessor {
-	private String fContextTypeId = 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 XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_MACRO);
-	}
-
-	private ContextTypeRegistry getTemplateContextRegistry() {
-		return XMLUIPlugin.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 XMLUIPlugin.getDefault().getTemplateStore();
-	}
-
-	void setContextType(String contextTypeId) {
-		fContextTypeId = contextTypeId;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/BufferedStructureUpdater.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/BufferedStructureUpdater.java
deleted file mode 100644
index 1669ddb..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/BufferedStructureUpdater.java
+++ /dev/null
@@ -1,51 +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.ui.internal.contentoutline;
-
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.w3c.dom.Node;
-
-
-/**
- * Can handle multiple subsequent calls to processNode(..) by buffering them
- * w/ a RefreshStructureJob. Only one refresh is performed (on the UI Thread)
- * on the minimal affected area of the tree at the end of the batch of updates
- * (after the last update is processed).
- * 
- * @author pavery
- */
-class BufferedStructureUpdater {
-
-	private RefreshStructureJob fRefreshJob = null;
-
-	/**
-	 * @param structuredViewer
-	 *            the viewer we are updating
-	 * @param node
-	 *            the specific node that changed
-	 */
-	public synchronized void processNode(StructuredViewer structuredViewer, Node node) {
-		// refresh on structural and "unknown" changes
-		// it would be nice to not refresh the viewer if it's not visible
-		// but only refresh when it's brought back to the front
-		if (structuredViewer.getControl() != null) {
-			getRefreshJob().refresh(structuredViewer, node);
-		}
-	}
-
-	private synchronized RefreshStructureJob getRefreshJob() {
-		if (fRefreshJob == null)
-			fRefreshJob = new RefreshStructureJob();
-		return fRefreshJob;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java
deleted file mode 100644
index 286b385..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java
+++ /dev/null
@@ -1,243 +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.ui.internal.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.graphics.Image;
-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.editor.CMImageUtil;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.w3c.dom.Node;
-
-/**
- * Adapts a DOM node to a JFace viewer.
- */
-public class JFaceNodeAdapter implements IJFaceNodeAdapter {
-
-	final static Class ADAPTER_KEY = IJFaceNodeAdapter.class;
-
-	/**
-	 * debug .option
-	 */
-	private static final boolean DEBUG = getDebugValue();
-
-	private static boolean getDebugValue() {
-		String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/outline"); //$NON-NLS-1$
-		boolean result = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-		return result;
-	}
-
-	JFaceNodeAdapterFactory fAdapterFactory;
-	private BufferedStructureUpdater fUpdater = null;
-
-	public JFaceNodeAdapter(JFaceNodeAdapterFactory adapterFactory) {
-		super();
-		this.fAdapterFactory = adapterFactory;
-	}
-
-	protected Image createImage(Object object) {
-		Image image = null;
-		Node node = (Node) object;
-		switch (node.getNodeType()) {
-			case Node.ELEMENT_NODE : {
-				image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ELEMENT);
-				break;
-			}
-			case Node.ATTRIBUTE_NODE : {
-				image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
-				break;
-			}
-			case Node.TEXT_NODE : { // actually, TEXT should never be seen in
-				// the tree
-				image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ELEMENT);
-				break;
-			}
-			case Node.CDATA_SECTION_NODE : {
-				image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_CDATASECTION);
-				break;
-			}
-			case Node.ENTITY_REFERENCE_NODE :
-			case Node.ENTITY_NODE : {
-				image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ENTITY);
-				break;
-			}
-			case Node.PROCESSING_INSTRUCTION_NODE : {
-				image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_PROCESSINGINSTRUCTION);
-				break;
-			}
-			case Node.COMMENT_NODE : {
-				image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_COMMENT);
-				break;
-			}
-			case Node.DOCUMENT_TYPE_NODE : {
-				image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_DOCTYPE);
-				break;
-			}
-			case Node.NOTATION_NODE : {
-				image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_NOTATION);
-				break;
-			}
-			default : {
-				image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ELEMENT);
-				break;
-			}
-		}
-		return image;
-	}
-
-	protected Image createXMLImageDescriptor(String imageResourceName) {
-		return XMLEditorPluginImageHelper.getInstance().getImage(imageResourceName);
-	}
-
-	public Object[] getChildren(Object object) {
-
-		// (pa) 20021217
-		// cmvc defect 235554
-		// performance enhancement: using child.getNextSibling() rather than
-		// nodeList(item) for O(n) vs. O(n*n)
-		//
-		Node node = (Node) object;
-		ArrayList v = new ArrayList();
-		for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
-			Node n = child;
-			if (n.getNodeType() != Node.TEXT_NODE)
-				v.add(n);
-		}
-		return v.toArray();
-	}
-
-	/**
-	 * Returns an enumeration with the elements belonging to the passed
-	 * element. These are the top level items in a list, tree, table, etc...
-	 */
-	public Object[] getElements(Object node) {
-		return getChildren(node);
-	}
-
-	/**
-	 * Fetches the label image specific to this object instance.
-	 */
-	public Image getLabelImage(Object node) {
-		Image image = CMImageUtil.getImage(CMImageUtil.getDeclaration((Node) node));
-		if (image == null && JFaceResources.getImageRegistry() != null) {
-			ImageRegistry imageRegistry = JFaceResources.getImageRegistry();
-			String nodeName = getNodeName(node);
-			image = imageRegistry.get(nodeName);
-			if (image == null) {
-				image = createImage(node);
-				if (image != null)
-					imageRegistry.put(nodeName, image);
-			}
-		}
-		return image;
-	}
-
-	/**
-	 * Fetches the label text specific to this object instance.
-	 */
-	public String getLabelText(Object node) {
-		return getNodeName(node);
-	}
-
-	private String getNodeName(Object object) {
-		StringBuffer nodeName = new StringBuffer();
-		Node node = (Node) object;
-		nodeName.append(node.getNodeName());
-
-		if (node.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
-			nodeName.insert(0, "DOCTYPE:"); //$NON-NLS-1$
-		}
-		return nodeName.toString();
-	}
-
-	public Object getParent(Object object) {
-		Node node = (Node) object;
-		return node.getParentNode();
-	}
-
-	private BufferedStructureUpdater getStructureUpdater() {
-		if (fUpdater == null) {
-			fUpdater = new BufferedStructureUpdater();
-		}
-		return fUpdater;
-	}
-
-	public boolean hasChildren(Object object) {
-		// (pa) 20021217
-		// cmvc defect 235554 > use child.getNextSibling() instead of
-		// nodeList(item) for O(n) vs. O(n*n)
-		Node node = (Node) object;
-		for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
-			if (child.getNodeType() != Node.TEXT_NODE)
-				return true;
-		}
-		return false;
-	}
-
-	/**
-	 * Allowing the INodeAdapter to compare itself against the type allows it
-	 * to return true in more than one case.
-	 */
-	public boolean isAdapterForType(Object type) {
-		if (type == null) {
-			return false;
-		}
-		return type.equals(ADAPTER_KEY);
-	}
-
-	/**
-	 * Called by the object being adapter (the notifier) when something has
-	 * changed.
-	 */
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		// future_TODO: the 'uijobs' used in this method were added to solve
-		// threading problems when the dom
-		// is updated in the background while the editor is open. They may be
-		// a bit overkill and not that useful.
-		// (That is, may be be worthy of job manager management). If they are
-		// found to be important enough to leave in,
-		// there's probably some optimization that can be done.
-		Collection listeners = fAdapterFactory.getListeners();
-		Iterator iterator = listeners.iterator();
-
-		while (iterator.hasNext()) {
-			Object listener = iterator.next();
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90637
-			// if (notifier instanceof Node && (listener instanceof
-			// StructuredViewer) && (eventType ==
-			// INodeNotifier.STRUCTURE_CHANGED || (eventType ==
-			// INodeNotifier.CHANGE && changedFeature == null))) {
-			if (notifier instanceof Node && (listener instanceof StructuredViewer) && (eventType == INodeNotifier.STRUCTURE_CHANGED || (eventType == INodeNotifier.CHANGE))) {
-				if (DEBUG) {
-					System.out.println("JFaceNodeAdapter notified on event type > " + eventType); //$NON-NLS-1$
-				}
-
-				// refresh on structural and "unknown" changes
-				StructuredViewer structuredViewer = (StructuredViewer) listener;
-				// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5230
-				if (structuredViewer.getControl() != null) {
-					getStructureUpdater().processNode(structuredViewer, (Node) notifier);
-				}
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapterFactory.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapterFactory.java
deleted file mode 100644
index 8ee8b42..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapterFactory.java
+++ /dev/null
@@ -1,173 +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.ui.internal.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-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.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.progress.UIJob;
-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.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapterFactory;
-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.modelquery.CMDocumentManagerListener;
-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.ssemodelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-
-/**
- * An adapter factory to create JFaceNodeAdapters. Use this adapter factory
- * with a JFaceAdapterContentProvider to display DOM nodes in a tree.
- */
-public class JFaceNodeAdapterFactory extends AbstractAdapterFactory implements IJFaceNodeAdapterFactory {
-	public class CMDocumentManagerListenerImpl implements CMDocumentManagerListener {
-		private static final int UPDATE_DELAY = 200;
-
-		public void cacheCleared(CMDocumentCache cache) {
-			// nothing to do
-		}
-
-		public void cacheUpdated(CMDocumentCache cache, final String uri, int oldStatus, int newStatus, CMDocument cmDocument) {
-			if (newStatus == CMDocumentCache.STATUS_LOADED || newStatus == CMDocumentCache.STATUS_ERROR) {
-				refreshViewers();
-			}
-		}
-
-		public void propertyChanged(CMDocumentManager cmDocumentManager, String propertyName) {
-			if (cmDocumentManager.getPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD)) {
-				refreshViewers();
-			}
-		}
-
-		private void refreshViewers() {
-			Object[] listeners = getListeners().toArray();
-			for (int i = 0; i < listeners.length; i++) {
-				if (listeners[i] instanceof StructuredViewer) {
-					final StructuredViewer viewer = (StructuredViewer) listeners[i];
-					Job refresh = new UIJob(XMLUIMessages.refreshoutline_0) {
-						public IStatus runInUIThread(IProgressMonitor monitor) {
-							Control refreshControl = viewer.getControl();
-							if (refreshControl != null && !refreshControl.isDisposed()) {
-								viewer.refresh(true);
-							}
-							return Status.OK_STATUS;
-						}
-					};
-					refresh.setSystem(true);
-					refresh.setPriority(Job.SHORT);
-					refresh.schedule(UPDATE_DELAY);
-				}
-				else if (listeners[i] instanceof Viewer) {
-					final Viewer viewer = (Viewer) listeners[i];
-					Job refresh = new UIJob(XMLUIMessages.refreshoutline_0) {
-						public IStatus runInUIThread(IProgressMonitor monitor) {
-							Control refreshControl = viewer.getControl();
-							if (refreshControl != null && !refreshControl.isDisposed()) {
-								viewer.refresh();
-							}
-							return Status.OK_STATUS;
-						}
-					};
-					refresh.setSystem(true);
-					refresh.setPriority(Job.SHORT);
-					refresh.schedule(UPDATE_DELAY);
-				}
-			}
-		}
-	}
-
-	private CMDocumentManager cmDocumentManager;
-	private CMDocumentManagerListenerImpl fCMDocumentManagerListener = null;
-	/**
-	 * This keeps track of all the listeners.
-	 */
-	private Set fListeners = new HashSet();
-
-	protected INodeAdapter singletonAdapter;
-
-	public JFaceNodeAdapterFactory() {
-		this(IJFaceNodeAdapter.class, true);
-	}
-
-	public JFaceNodeAdapterFactory(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-	public synchronized void addListener(Object listener) {
-		fListeners.add(listener);
-	}
-
-	public INodeAdapterFactory copy() {
-		return new JFaceNodeAdapterFactory(getAdapterKey(), isShouldRegisterAdapter());
-	}
-
-	/**
-	 * Create a new JFace adapter for the DOM node passed in
-	 */
-	protected INodeAdapter createAdapter(INodeNotifier node) {
-		if (singletonAdapter == null) {
-			// create the JFaceNodeAdapter
-			singletonAdapter = new JFaceNodeAdapter(this);
-			initAdapter(singletonAdapter, node);
-		}
-		return singletonAdapter;
-	}
-
-
-	/**
-	 * returns "copy" so no one can modify our list. It is a shallow copy.
-	 */
-	public synchronized Collection getListeners() {
-		return new ArrayList(fListeners);
-	}
-
-	protected void initAdapter(INodeAdapter adapter, INodeNotifier node) {
-		// register for CMDocumentManager events
-		ModelQueryAdapter mqadapter = (ModelQueryAdapter) node.getAdapterFor(ModelQueryAdapter.class);
-		if (mqadapter != null) {
-			ModelQuery mquery = mqadapter.getModelQuery();
-			if (mquery != null && mquery.getCMDocumentManager() != null) {
-				cmDocumentManager = mquery.getCMDocumentManager();
-				fCMDocumentManagerListener = new CMDocumentManagerListenerImpl();
-				cmDocumentManager.addListener(fCMDocumentManagerListener);
-			}
-		}
-	}
-
-	public void release() {
-		// deregister from CMDocumentManager events
-		if (cmDocumentManager != null && fCMDocumentManagerListener != null) {
-			cmDocumentManager.removeListener(fCMDocumentManagerListener);
-		}
-		fListeners.clear();
-	}
-
-	public synchronized void removeListener(Object listener) {
-		fListeners.remove(listener);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeContentProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeContentProvider.java
deleted file mode 100644
index 7327b15..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeContentProvider.java
+++ /dev/null
@@ -1,114 +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.ui.internal.contentoutline;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-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.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapterFactory;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-
-/**
- * An ITreeContentProvider for a TreeViewers used to display DOM nodes. This
- * content provider takes an adapter factory to create JFace adapters for the
- * nodes in the tree.
- */
-public class JFaceNodeContentProvider implements ITreeContentProvider {
-
-	public JFaceNodeContentProvider() {
-		super();
-	}
-
-	/**
-	 * The visual part that is using this content provider is about to be
-	 * disposed. Deallocate all allocated SWT resources.
-	 */
-	public void dispose() {
-	}
-
-	/**
-	 * Returns the JFace adapter for the specified object.
-	 * 
-	 * @param adaptable
-	 *            java.lang.Object The object to get the adapter for
-	 */
-	protected IJFaceNodeAdapter getAdapter(Object adaptable) {
-		if (adaptable instanceof INodeNotifier) {
-			INodeAdapter adapter = ((INodeNotifier) adaptable).getAdapterFor(IJFaceNodeAdapter.class);
-			if (adapter instanceof IJFaceNodeAdapter)
-				return (IJFaceNodeAdapter) adapter;
-		}
-		return null;
-	}
-
-	public Object[] getChildren(Object object) {
-		IJFaceNodeAdapter adapter = getAdapter(object);
-
-		if (adapter != null)
-			return adapter.getChildren(object);
-
-		return new Object[0];
-	}
-
-	public Object[] getElements(Object object) {
-		// The root is usually an instance of an XMLStructuredModel in
-		// which case we want to extract the document.
-		Object topNode = object;
-		if (object instanceof IDOMModel)
-			topNode = ((IDOMModel) object).getDocument();
-
-		IJFaceNodeAdapter adapter = getAdapter(topNode);
-
-		if (adapter != null)
-			return adapter.getElements(topNode);
-
-		return new Object[0];
-	}
-
-	public Object getParent(Object object) {
-		IJFaceNodeAdapter adapter = getAdapter(object);
-
-		if (adapter != null)
-			return adapter.getParent(object);
-
-		return null;
-	}
-
-	public boolean hasChildren(Object object) {
-		IJFaceNodeAdapter adapter = getAdapter(object);
-
-		if (adapter != null)
-			return adapter.hasChildren(object);
-
-		return false;
-	}
-
-	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-		if (oldInput != null && oldInput instanceof IStructuredModel) {
-			IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IStructuredModel) oldInput).getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
-			if (factory != null) {
-				factory.removeListener(viewer);
-			}
-		}
-		if (newInput != null && newInput instanceof IStructuredModel) {
-			IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IStructuredModel) newInput).getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
-			if (factory != null) {
-				factory.addListener(viewer);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeLabelProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeLabelProvider.java
deleted file mode 100644
index 7472df9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeLabelProvider.java
+++ /dev/null
@@ -1,74 +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.ui.internal.contentoutline;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-
-/**
- * A label provider backed by JFaceNodeAdapters.
- */
-public class JFaceNodeLabelProvider extends LabelProvider {
-	/**
-	 * JFaceNodeLabelProvider constructor comment.
-	 */
-	public JFaceNodeLabelProvider() {
-		super();
-	}
-
-	/**
-	 * Returns the JFace adapter for the specified object.
-	 * 
-	 * @param adaptable
-	 *            java.lang.Object The object to get the adapter for
-	 */
-	protected IJFaceNodeAdapter getAdapter(Object adaptable) {
-		if (adaptable instanceof INodeNotifier) {
-			INodeAdapter adapter = ((INodeNotifier) adaptable).getAdapterFor(IJFaceNodeAdapter.class);
-			if (adapter instanceof IJFaceNodeAdapter)
-				return (IJFaceNodeAdapter) adapter;
-		}
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
-	 */
-	public Image getImage(Object element) {
-		return getAdapter(element).getLabelImage(element);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
-	 */
-	public String getText(Object element) {
-		return getAdapter(element).getLabelText(element);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object,
-	 *      java.lang.String)
-	 */
-	public boolean isLabelProperty(Object element, String property) {
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java
deleted file mode 100644
index 46788a2..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java
+++ /dev/null
@@ -1,217 +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.ui.internal.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * This job holds a queue of updates (affected nodes) for multiple structured
- * viewers. When a new request comes in, the current run is cancelled, the new
- * request is added to the queue, then the job is re-scheduled. Support for
- * multiple structured viewers is required because refresh updates are usually
- * triggered by model changes, and the model may be visible in more than one
- * viewer.
- * 
- * @author pavery
- */
-class RefreshStructureJob extends Job {
-
-	/** debug flag */
-	static final boolean DEBUG;
-	private static final long UPDATE_DELAY = 200;
-	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/outline"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-	}
-	/** List of refresh requests (Nodes) */
-	private final List fRequests;
-	/** the structured viewers */
-	List fViewers = new ArrayList(3);
-
-	public RefreshStructureJob() {
-		super(XMLUIMessages.refreshoutline_0); //$NON-NLS-1$
-		setPriority(Job.LONG);
-		setSystem(true);
-		fRequests = new ArrayList(1);
-	}
-
-	private synchronized void addRequest(Node node) {
-		// if we already have a request which contains the new request,
-		// discare the new request
-		int size = fRequests.size();
-		for (int i = 0; i < size; i++) {
-			if (contains((Node) fRequests.get(i), node))
-				return;
-		}
-		// if new request is contains any existing requests,
-		// remove those
-		for (Iterator it = fRequests.iterator(); it.hasNext();) {
-			if (contains(node, (Node) it.next()))
-				it.remove();
-		}
-		fRequests.add(node);
-	}
-
-	private synchronized void addViewer(StructuredViewer viewer) {
-		if (!fViewers.contains(viewer)) {
-			fViewers.add(viewer);
-		}
-	}
-
-	/**
-	 * @return if the root is parent of possible, return true, otherwise
-	 *         return false
-	 */
-	private boolean contains(Node root, Node possible) {
-		if (DEBUG) {
-			System.out.println("=============================================================================================================="); //$NON-NLS-1$
-			System.out.println("recursive call w/ root: " + root.getNodeName() + " and possible: " + possible); //$NON-NLS-1$ //$NON-NLS-2$
-			System.out.println("--------------------------------------------------------------------------------------------------------------"); //$NON-NLS-1$
-		}
-
-		// the following checks are important
-		// #document node will break the algorithm otherwise
-
-		// can't contain the parent if it's null
-		if (root == null) {
-			if (DEBUG)
-				System.out.println("returning false: root is null"); //$NON-NLS-1$
-			return false;
-		}
-		// nothing can be parent of Document node
-		if (possible instanceof Document) {
-			if (DEBUG)
-				System.out.println("returning false: possible is Document node"); //$NON-NLS-1$
-			return false;
-		}
-		// document contains everything
-		if (root instanceof Document) {
-			if (DEBUG)
-				System.out.println("returning true: root is Document node"); //$NON-NLS-1$
-			return true;
-		}
-
-		// depth first
-		Node current = root;
-		// loop siblings
-		while (current != null) {
-			if (DEBUG)
-				System.out.println("   -> iterating sibling (" + current.getNodeName() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
-			// found it
-			if (possible.equals(current)) {
-				if (DEBUG)
-					System.out.println("   !!! found: " + possible.getNodeName() + " in subtree for: " + root.getNodeName()); //$NON-NLS-1$ //$NON-NLS-2$
-				return true;
-			}
-			// drop one level deeper if necessary
-			if (current.getFirstChild() != null) {
-				return contains(current.getFirstChild(), possible);
-			}
-			current = current.getNextSibling();
-		}
-		// never found it
-		return false;
-	}
-
-	/**
-	 * Refresh must be on UI thread because it's on a SWT widget.
-	 * 
-	 * @param node
-	 */
-	private void doRefresh(final Node node) {
-		final Display display = PlatformUI.getWorkbench().getDisplay();
-		display.asyncExec(new Runnable() {
-			public void run() {
-
-				if (DEBUG)
-					System.out.println("refresh on: [" + node.getNodeName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
-
-				StructuredViewer[] viewers = (StructuredViewer[]) fViewers.toArray(new StructuredViewer[0]);
-				fViewers.clear();
-
-				for (int i = 0; i < viewers.length; i++) {
-					if (!viewers[i].getControl().isDisposed()) {
-						if (node instanceof Document) {
-							viewers[i].refresh();
-						}
-						else {
-							viewers[i].refresh(node, true);
-						}
-					}
-					else {
-						if (DEBUG)
-							System.out.println("   !!! skipped refreshing disposed viewer: " + viewers[i]); //$NON-NLS-1$
-					}
-				}
-			}
-		});
-	}
-
-	/**
-	 * This method also synchronized because it accesses the fRequests queue
-	 * 
-	 * @return an array of the currently requested Nodes to refresh
-	 */
-	private synchronized Node[] getRequests() {
-		Node[] toRefresh = (Node[]) fRequests.toArray(new Node[fRequests.size()]);
-		fRequests.clear();
-		return toRefresh;
-	}
-
-	/**
-	 * Invoke a refresh on the viewer on the given node.
-	 * 
-	 * @param node
-	 */
-	public void refresh(StructuredViewer viewer, Node node) {
-		if (node == null)
-			return;
-
-		cancel();
-		addRequest(node);
-		addViewer(viewer);
-		schedule(UPDATE_DELAY);
-	}
-
-	protected IStatus run(IProgressMonitor monitor) {
-		IStatus status = Status.OK_STATUS;
-		try {
-			Node[] toRefresh = getRequests();
-			for (int i = 0; i < toRefresh.length; i++) {
-				if (monitor.isCanceled())
-					throw new OperationCanceledException();
-				doRefresh(toRefresh[i]);
-			}
-		}
-		finally {
-			monitor.done();
-		}
-		return status;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/XMLNodeActionManager.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/XMLNodeActionManager.java
deleted file mode 100644
index 4b3b00f..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/XMLNodeActionManager.java
+++ /dev/null
@@ -1,52 +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.ui.internal.contentoutline;
-
-import org.eclipse.jface.viewers.Viewer;
-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.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.wst.xml.ui.internal.actions.AbstractNodeActionManager;
-import org.w3c.dom.Node;
-
-
-public class XMLNodeActionManager extends AbstractNodeActionManager {
-	public XMLNodeActionManager(IStructuredModel model, Viewer viewer) {
-		super(model, ModelQueryUtil.getModelQuery(model), viewer);
-	}
-
-	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 FormatProcessorXML();
-			formatProcessor.formatNode(newElement);
-		} finally {
-			// tell the model that we are done with the big model change
-			fModel.changedModel();
-		}
-	}
-
-	public void setModel(IStructuredModel newModel) {
-		fModel = newModel;
-		setModelQuery(ModelQueryUtil.getModelQuery(newModel));
-	}
-
-	protected void setModelQuery(ModelQuery newModelQuery) {
-		modelQuery = newModelQuery;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionAssistantProviderXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionAssistantProviderXML.java
deleted file mode 100644
index 2638e27..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionAssistantProviderXML.java
+++ /dev/null
@@ -1,48 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *   IBM - Initial API and implementation
- *   Jens Lukowski/Innoopract - initial renaming/restructuring
- * 
- */
-package org.eclipse.wst.xml.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.sse.ui.internal.correction.CorrectionAssistantProvider;
-import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
-
-/**
- * Correction assistant for XML
- */
-public class CorrectionAssistantProviderXML 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, IXMLPartitions.XML_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.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionProcessorXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionProcessorXML.java
deleted file mode 100644
index 3234825..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionProcessorXML.java
+++ /dev/null
@@ -1,42 +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.ui.internal.correction;
-
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.sse.ui.internal.correction.IQuickAssistProcessor;
-import org.eclipse.wst.sse.ui.internal.correction.IQuickFixProcessor;
-import org.eclipse.wst.sse.ui.internal.correction.StructuredCorrectionProcessor;
-
-
-public class CorrectionProcessorXML extends StructuredCorrectionProcessor {
-	protected IQuickAssistProcessor fQuickAssistProcessor;
-	protected IQuickFixProcessor fQuickFixProcessor;
-
-	public CorrectionProcessorXML(ISourceViewer sourceViewer) {
-		super(sourceViewer);
-	}
-
-	protected IQuickAssistProcessor getQuickAssistProcessor() {
-		if (fQuickAssistProcessor == null)
-			fQuickAssistProcessor = new QuickAssistProcessorXML();
-
-		return fQuickAssistProcessor;
-	}
-
-	protected IQuickFixProcessor getQuickFixProcessor() {
-		if (fQuickFixProcessor == null)
-			fQuickFixProcessor = new QuickFixProcessorXML();
-
-		return fQuickFixProcessor;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/InsertRequiredAttrsQuickAssistProposal.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/InsertRequiredAttrsQuickAssistProposal.java
deleted file mode 100644
index 3ea211f..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/InsertRequiredAttrsQuickAssistProposal.java
+++ /dev/null
@@ -1,179 +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.ui.internal.correction;
-
-import java.util.List;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-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.ICompletionProposalExtension2;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MultiTextEdit;
-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.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-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.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-public class InsertRequiredAttrsQuickAssistProposal implements ICompletionProposal, ICompletionProposalExtension2 {
-	private final List fRequiredAttrs;
-
-	/**
-	 * @param requiredAttrs
-	 */
-	public InsertRequiredAttrsQuickAssistProposal(List requiredAttrs) {
-		fRequiredAttrs = requiredAttrs;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#apply(org.eclipse.jface.text.IDocument)
-	 */
-	public void apply(IDocument document) {
-		// not implemented?
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#apply(org.eclipse.jface.text.ITextViewer,
-	 *      char, int, int)
-	 */
-	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
-		IDOMNode node = (IDOMNode) ContentAssistUtils.getNodeAt((StructuredTextViewer) viewer, offset);
-		IStructuredDocumentRegion startStructuredDocumentRegion = node.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 = 0; i < fRequiredAttrs.size(); i++) {
-				CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) fRequiredAttrs.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(viewer.getDocument());
-		}
-		catch (BadLocationException e) {
-			// log, for now, unless we find there's reasons why we get some
-			// here.
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
-	 */
-	public String getAdditionalProposalInfo() {
-		return XMLUIMessages.InsertRequiredAttrsQuickAssistProposal_0; //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getContextInformation()
-	 */
-	public IContextInformation getContextInformation() {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
-	 */
-	public String getDisplayString() {
-		return XMLUIMessages.InsertRequiredAttrsQuickAssistProposal_1; //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage()
-	 */
-	public Image getImage() {
-		// return JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_LOCAL);
-		return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ADD_CORRECTION);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(org.eclipse.jface.text.IDocument)
-	 */
-	public Point getSelection(IDocument document) {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#selected(org.eclipse.jface.text.ITextViewer,
-	 *      boolean)
-	 */
-	public void selected(ITextViewer viewer, boolean smartToggle) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#unselected(org.eclipse.jface.text.ITextViewer)
-	 */
-	public void unselected(ITextViewer viewer) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#validate(org.eclipse.jface.text.IDocument,
-	 *      int, org.eclipse.jface.text.DocumentEvent)
-	 */
-	public boolean validate(IDocument document, int offset, DocumentEvent event) {
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/ProblemIDsXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/ProblemIDsXML.java
deleted file mode 100644
index 4d0008b..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/ProblemIDsXML.java
+++ /dev/null
@@ -1,31 +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.ui.internal.correction;
-
-public interface ProblemIDsXML {
-	int AttrsInEndTag = 3;
-	int AttrValueNotQuoted = 13;
-	int EmptyTag = 1;
-	int InvalidAttrValue = 11;
-	int MissingAttrValue = 4;
-	int MissingClosingBracket = 14;
-	int MissingEndTag = 2;
-	int MissingRequiredAttr = 12;
-	int NamespaceInPI = 8;
-	int NoAttrValue = 5;
-	int SpacesBeforePI = 7;
-	int SpacesBeforeTagName = 6;
-	int Unclassified = 0;
-	int UnknownAttr = 10;
-	int UnknownElement = 9;
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickAssistProcessorXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickAssistProcessorXML.java
deleted file mode 100644
index 51fd960..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickAssistProcessorXML.java
+++ /dev/null
@@ -1,169 +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.ui.internal.correction;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-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.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.correction.IQuickAssistProcessor;
-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.IDOMNode;
-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;
-
-
-public class QuickAssistProcessorXML implements IQuickAssistProcessor {
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.correction.IQuickAssistProcessor#canAssist(org.eclipse.wst.sse.core.text.IStructuredDocument,
-	 *      int)
-	 */
-	public boolean canAssist(StructuredTextViewer viewer, int offset) {
-		return true;
-	}
-
-	/**
-	 * @param proposals
-	 * @param viewer
-	 * @param offset
-	 */
-	protected void getInsertRequiredAttrs(ArrayList proposals, StructuredTextViewer viewer, int offset) {
-		IDOMNode node = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, offset);
-		if (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
-			IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
-			if (startStructuredDocumentRegion != null && startStructuredDocumentRegion.containsOffset(offset)) {
-				IDOMNode cursorNode = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, offset);
-				List requiredAttrs = getRequiredAttrs(cursorNode);
-				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)
-						proposals.add(new InsertRequiredAttrsQuickAssistProposal(insertAttrs));
-				}
-			}
-		}
-	}
-
-	/**
-	 * @param proposals
-	 * @param viewer
-	 * @param offset
-	 */
-	protected void getLocalRenameQuickAssistProposal(ArrayList proposals, StructuredTextViewer viewer, int offset) {
-		IDOMNode node = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, offset);
-		IStructuredDocumentRegion startStructuredDocumentRegion = node == null ? null : node.getStartStructuredDocumentRegion();
-		IStructuredDocumentRegion endStructuredDocumentRegion = node == null ? null : node.getEndStructuredDocumentRegion();
-
-		ITextRegion region = null;
-		int regionTextEndOffset = 0;
-		if (startStructuredDocumentRegion != null && startStructuredDocumentRegion.containsOffset(offset)) {
-			region = startStructuredDocumentRegion.getRegionAtCharacterOffset(offset);
-			regionTextEndOffset = startStructuredDocumentRegion.getTextEndOffset(region);
-		} else if (endStructuredDocumentRegion != null && endStructuredDocumentRegion.containsOffset(offset)) {
-			region = endStructuredDocumentRegion.getRegionAtCharacterOffset(offset);
-			regionTextEndOffset = endStructuredDocumentRegion.getTextEndOffset(region);
-		}
-
-		if (region != null && (region.getType() == DOMRegionContext.XML_TAG_NAME || region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) && offset <= regionTextEndOffset)
-			proposals.add(new RenameInFileQuickAssistProposal());
-	}
-
-	protected ModelQuery getModelQuery(Node node) {
-		if (node.getNodeType() == Node.DOCUMENT_NODE) {
-			return ModelQueryUtil.getModelQuery((Document) node);
-		} else {
-			return ModelQueryUtil.getModelQuery(node.getOwnerDocument());
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.correction.IQuickAssistProcessor#getProposals(org.eclipse.wst.sse.core.text.IStructuredDocument,
-	 *      int)
-	 */
-	public ICompletionProposal[] getProposals(StructuredTextViewer viewer, int offset) throws CoreException {
-		ArrayList proposals = new ArrayList();
-
-		getLocalRenameQuickAssistProposal(proposals, viewer, offset);
-		getSurroundWithNewElementQuickAssistProposal(proposals, viewer, offset);
-		getInsertRequiredAttrs(proposals, viewer, offset);
-
-		return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
-	}
-
-	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;
-	}
-
-	/**
-	 * @param proposals
-	 * @param viewer
-	 * @param offset
-	 */
-	protected void getSurroundWithNewElementQuickAssistProposal(ArrayList proposals, StructuredTextViewer viewer, int offset) {
-		IDOMNode node = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, offset);
-		if (node != null)
-			proposals.add(new SurroundWithNewElementQuickAssistProposal());
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickFixProcessorXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickFixProcessorXML.java
deleted file mode 100644
index 6e65a97..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickFixProcessorXML.java
+++ /dev/null
@@ -1,147 +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.ui.internal.correction;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.internal.correction.IQuickFixProcessor;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-public class QuickFixProcessorXML implements IQuickFixProcessor {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.correction.IQuickFixProcessor#canFix(int)
-	 */
-	public boolean canFix(Annotation annotation) {
-		boolean result = false;
-
-		if (annotation instanceof TemporaryAnnotation) {
-			TemporaryAnnotation tempAnnotation = (TemporaryAnnotation) annotation;
-			int problemID = tempAnnotation.getProblemID();
-			switch (problemID) {
-				case ProblemIDsXML.EmptyTag :
-				case ProblemIDsXML.MissingEndTag :
-				case ProblemIDsXML.AttrsInEndTag :
-				case ProblemIDsXML.MissingAttrValue :
-				case ProblemIDsXML.NoAttrValue :
-				case ProblemIDsXML.SpacesBeforeTagName :
-				case ProblemIDsXML.SpacesBeforePI :
-				case ProblemIDsXML.NamespaceInPI :
-				case ProblemIDsXML.UnknownElement :
-				case ProblemIDsXML.UnknownAttr :
-				case ProblemIDsXML.InvalidAttrValue :
-				case ProblemIDsXML.MissingRequiredAttr :
-				case ProblemIDsXML.AttrValueNotQuoted :
-				case ProblemIDsXML.MissingClosingBracket :
-					result = true;
-			}
-		}
-
-		return result;
-	}
-
-	public Image getImage() {
-		//return
-		// JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
-		return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_CORRECTION_CHANGE);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.correction.IQuickFixProcessor#getProposals(org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation)
-	 */
-	public ICompletionProposal[] getProposals(Annotation annotation) throws CoreException {
-		ArrayList proposals = new ArrayList();
-
-		if (annotation instanceof TemporaryAnnotation) {
-			TemporaryAnnotation tempAnnotation = (TemporaryAnnotation) annotation;
-			int problemID = tempAnnotation.getProblemID();
-			switch (problemID) {
-				case ProblemIDsXML.EmptyTag :
-					proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_0, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					break;
-				case ProblemIDsXML.MissingEndTag :
-					String tagName = (String) ((Object[]) tempAnnotation.getAdditionalFixInfo())[0];
-					String tagClose = (String) ((Object[]) tempAnnotation.getAdditionalFixInfo())[1];
-					int tagCloseOffset = ((Integer) ((Object[]) tempAnnotation.getAdditionalFixInfo())[2]).intValue();
-					int startTagEndOffset = ((Integer) ((Object[]) tempAnnotation.getAdditionalFixInfo())[3]).intValue();
-					int firstChildStartOffset = ((Integer) ((Object[]) tempAnnotation.getAdditionalFixInfo())[4]).intValue();
-					int endOffset = ((Integer) ((Object[]) tempAnnotation.getAdditionalFixInfo())[5]).intValue();
-					proposals.add(new CompletionProposal(tagClose, tagCloseOffset, 0, 0, getImage(), XMLUIMessages.QuickFixProcessorXML_1, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), startTagEndOffset - tempAnnotation.getPosition().getOffset(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_2, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					proposals.add(new CompletionProposal("</" + tagName + ">", firstChildStartOffset, 0, 0, getImage(), XMLUIMessages.QuickFixProcessorXML_3, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-					proposals.add(new CompletionProposal("</" + tagName + ">", endOffset, 0, 0, getImage(), XMLUIMessages.QuickFixProcessorXML_4, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-					break;
-				case ProblemIDsXML.AttrsInEndTag :
-					proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_5, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					break;
-				case ProblemIDsXML.MissingAttrValue :
-					String defaultAttrValue = (String) ((Object[]) tempAnnotation.getAdditionalFixInfo())[0];
-					int insertOffset = ((Integer) ((Object[]) tempAnnotation.getAdditionalFixInfo())[1]).intValue();
-					proposals.add(new CompletionProposal("\"" + defaultAttrValue + "\"", tempAnnotation.getPosition().getOffset() + tempAnnotation.getPosition().getLength() + insertOffset, 0, defaultAttrValue.length() + 2, getImage(), XMLUIMessages.QuickFixProcessorXML_6, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-					proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_7, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					break;
-				case ProblemIDsXML.NoAttrValue :
-					defaultAttrValue = (String) tempAnnotation.getAdditionalFixInfo();
-					proposals.add(new CompletionProposal("=\"" + defaultAttrValue + "\"", tempAnnotation.getPosition().getOffset() + tempAnnotation.getPosition().getLength(), 0, defaultAttrValue.length() + 3, getImage(), XMLUIMessages.QuickFixProcessorXML_6, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-					proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_7, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					break;
-				case ProblemIDsXML.SpacesBeforeTagName :
-					proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_8, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					break;
-				case ProblemIDsXML.SpacesBeforePI :
-					proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_9, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					break;
-				case ProblemIDsXML.NamespaceInPI :
-					proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_10, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					break;
-				case ProblemIDsXML.UnknownElement :
-					proposals.add(new RemoveUnknownElementQuickFixProposal(tempAnnotation.getAdditionalFixInfo(), getImage(), XMLUIMessages.QuickFixProcessorXML_11)); //$NON-NLS-1$
-					proposals.add(new RenameInFileQuickAssistProposal());
-					break;
-				case ProblemIDsXML.UnknownAttr :
-					proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_7, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					proposals.add(new RenameInFileQuickAssistProposal());
-					break;
-				case ProblemIDsXML.InvalidAttrValue :
-					proposals.add(new CompletionProposal("", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_12, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					break;
-				case ProblemIDsXML.MissingRequiredAttr :
-					String requiredAttr = (String) ((Object[]) tempAnnotation.getAdditionalFixInfo())[0];
-					insertOffset = ((Integer) ((Object[]) tempAnnotation.getAdditionalFixInfo())[1]).intValue();
-					proposals.add(new CompletionProposal(requiredAttr, tempAnnotation.getPosition().getOffset() + insertOffset, 0, requiredAttr.length(), getImage(), XMLUIMessages.QuickFixProcessorXML_13, null, "")); //$NON-NLS-1$ //$NON-NLS-2$
-					break;
-				case ProblemIDsXML.AttrValueNotQuoted :
-					String attrValue = (String) tempAnnotation.getAdditionalFixInfo();
-					proposals.add(new CompletionProposal("\"" + attrValue + "\"", tempAnnotation.getPosition().getOffset(), tempAnnotation.getPosition().getLength(), attrValue.length() + 2, getImage(), XMLUIMessages.QuickFixProcessorXML_14, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-					break;
-				case ProblemIDsXML.MissingClosingBracket :
-					proposals.add(new CompletionProposal(">", tempAnnotation.getPosition().getOffset() + tempAnnotation.getPosition().getLength(), 0, 1, getImage(), XMLUIMessages.QuickFixProcessorXML_15, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-					break;
-			}
-		}
-
-		return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RemoveUnknownElementQuickFixProposal.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RemoveUnknownElementQuickFixProposal.java
deleted file mode 100644
index 7dac576..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RemoveUnknownElementQuickFixProposal.java
+++ /dev/null
@@ -1,161 +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.ui.internal.correction;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-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.ICompletionProposalExtension2;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.text.edits.DeleteEdit;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class RemoveUnknownElementQuickFixProposal implements ICompletionProposal, ICompletionProposalExtension2 {
-	private Object fAdditionalFixInfo = null;
-	private String fDisplayString;
-	private Image fImage;
-	private Point fSelection; // initialized by apply()
-
-	public RemoveUnknownElementQuickFixProposal(Object additionalFixInfo, Image image, String displayString) {
-		fAdditionalFixInfo = additionalFixInfo;
-		fImage = image;
-		fDisplayString = displayString;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#apply(org.eclipse.jface.text.IDocument)
-	 */
-	public void apply(IDocument document) {
-		// not implemented?
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#apply(org.eclipse.jface.text.ITextViewer,
-	 *      char, int, int)
-	 */
-	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
-		int startTagOffset = ((Integer) ((Object[]) fAdditionalFixInfo)[0]).intValue();
-		int startTagLength = ((Integer) ((Object[]) fAdditionalFixInfo)[1]).intValue();
-		int endTagOffset = ((Integer) ((Object[]) fAdditionalFixInfo)[2]).intValue();
-		int endTagLength = ((Integer) ((Object[]) fAdditionalFixInfo)[3]).intValue();
-
-		MultiTextEdit multiTextEdit = new MultiTextEdit();
-		if (endTagOffset != -1) {
-			multiTextEdit.addChild(new DeleteEdit(endTagOffset, endTagLength));
-			fSelection = new Point(endTagOffset, 0);
-		}
-		if (startTagOffset != -1) {
-			multiTextEdit.addChild(new DeleteEdit(startTagOffset, startTagLength));
-			fSelection = new Point(startTagOffset, 0);
-		}
-
-		try {
-			multiTextEdit.apply(viewer.getDocument());
-		}
-		catch (MalformedTreeException e) {
-			// log for now, unless find reasons not to.
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-		catch (BadLocationException e) {
-			// log for now, unless find reasons not to.
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
-	 */
-	public String getAdditionalProposalInfo() {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getContextInformation()
-	 */
-	public IContextInformation getContextInformation() {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
-	 */
-	public String getDisplayString() {
-		if (fDisplayString == null)
-			fDisplayString = XMLUIMessages.QuickFixProcessorXML_11; //$NON-NLS-1$
-
-		return fDisplayString;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage()
-	 */
-	public Image getImage() {
-		return fImage;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(org.eclipse.jface.text.IDocument)
-	 */
-	public Point getSelection(IDocument document) {
-		return fSelection;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#selected(org.eclipse.jface.text.ITextViewer,
-	 *      boolean)
-	 */
-	public void selected(ITextViewer viewer, boolean smartToggle) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#unselected(org.eclipse.jface.text.ITextViewer)
-	 */
-	public void unselected(ITextViewer viewer) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#validate(org.eclipse.jface.text.IDocument,
-	 *      int, org.eclipse.jface.text.DocumentEvent)
-	 */
-	public boolean validate(IDocument document, int offset, DocumentEvent event) {
-		return false;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RenameInFileQuickAssistProposal.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RenameInFileQuickAssistProposal.java
deleted file mode 100644
index e2d8f6d..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RenameInFileQuickAssistProposal.java
+++ /dev/null
@@ -1,183 +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.ui.internal.correction;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.link.LinkedModeModel;
-import org.eclipse.jface.text.link.LinkedModeUI;
-import org.eclipse.jface.text.link.LinkedPosition;
-import org.eclipse.jface.text.link.LinkedPositionGroup;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.texteditor.link.EditorLinkedModeUI;
-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.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-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.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-public class RenameInFileQuickAssistProposal implements ICompletionProposal, ICompletionProposalExtension2 {
-	protected IRegion fSelectedRegion; // initialized by apply()
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#apply(org.eclipse.jface.text.IDocument)
-	 */
-	public void apply(IDocument document) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#apply(org.eclipse.jface.text.ITextViewer,
-	 *      char, int, int)
-	 */
-	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
-		IDocument document = viewer.getDocument();
-		LinkedPositionGroup group = new LinkedPositionGroup();
-		try {
-			if (viewer instanceof StructuredTextViewer) {
-				IDOMNode node = (IDOMNode) ContentAssistUtils.getNodeAt((StructuredTextViewer) viewer, offset);
-				IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
-				ITextRegion region = (startStructuredDocumentRegion == null) ? null : startStructuredDocumentRegion.getRegionAtCharacterOffset(offset);
-				if (region != null) {
-					group.addPosition(new LinkedPosition(document, startStructuredDocumentRegion.getStartOffset() + region.getStart(), region.getTextLength(), 0));
-
-					if (region.getType() == DOMRegionContext.XML_TAG_NAME && node.getEndStructuredDocumentRegion() != null) {
-						region = node.getEndStructuredDocumentRegion().getRegions().get(1);
-						if (region != null)
-							group.addPosition(new LinkedPosition(document, node.getEndStructuredDocumentRegion().getStartOffset() + region.getStart(), region.getTextLength(), 1));
-					}
-				} else {
-					IStructuredDocumentRegion endStructuredDocumentRegion = node.getEndStructuredDocumentRegion();
-					region = (endStructuredDocumentRegion == null) ? null : endStructuredDocumentRegion.getRegionAtCharacterOffset(offset);
-					if (region != null) {
-						if (region.getType() == DOMRegionContext.XML_TAG_NAME && node.getStartStructuredDocumentRegion() != null) {
-							ITextRegion startTagNameRegion = node.getStartStructuredDocumentRegion().getRegions().get(1);
-							if (region != null) {
-								group.addPosition(new LinkedPosition(document, node.getStartStructuredDocumentRegion().getStartOffset() + startTagNameRegion.getStart(), startTagNameRegion.getTextLength(), 0));
-								group.addPosition(new LinkedPosition(document, endStructuredDocumentRegion.getStartOffset() + region.getStart(), region.getTextLength(), 1));
-							}
-						} else
-							group.addPosition(new LinkedPosition(document, endStructuredDocumentRegion.getStartOffset() + region.getStart(), region.getTextLength(), 0));
-					}
-				}
-
-				// TODO CompletionProposalPopup#insertProposal() calls
-				// IRewriteTarget.beginCompoundChange()
-				//      which disables redraw in ITextViewer. Workaround for now.
-				((StructuredTextViewer) viewer).setRedraw(true);
-			}
-
-			LinkedModeModel linkedModeModel = new LinkedModeModel();
-			linkedModeModel.addGroup(group);
-			linkedModeModel.forceInstall();
-
-			LinkedModeUI ui = new EditorLinkedModeUI(linkedModeModel, viewer);
-			ui.setExitPosition(viewer, offset, 0, LinkedPositionGroup.NO_STOP);
-			ui.enter();
-
-			fSelectedRegion = ui.getSelectedRegion();
-		} catch (BadLocationException e) {
-			// log for now, unless find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
-	 */
-	public String getAdditionalProposalInfo() {
-		return XMLUIMessages.RenameInFileQuickAssistProposal_0; //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getContextInformation()
-	 */
-	public IContextInformation getContextInformation() {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
-	 */
-	public String getDisplayString() {
-		return XMLUIMessages.RenameInFileQuickAssistProposal_1; //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage()
-	 */
-	public Image getImage() {
-		// return JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_LOCAL);
-		return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_LOCAL_VARIABLE);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(org.eclipse.jface.text.IDocument)
-	 */
-	public Point getSelection(IDocument document) {
-		return new Point(fSelectedRegion.getOffset(), fSelectedRegion.getLength());
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#selected(org.eclipse.jface.text.ITextViewer,
-	 *      boolean)
-	 */
-	public void selected(ITextViewer viewer, boolean smartToggle) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#unselected(org.eclipse.jface.text.ITextViewer)
-	 */
-	public void unselected(ITextViewer viewer) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#validate(org.eclipse.jface.text.IDocument,
-	 *      int, org.eclipse.jface.text.DocumentEvent)
-	 */
-	public boolean validate(IDocument document, int offset, DocumentEvent event) {
-		return false;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/SurroundWithNewElementQuickAssistProposal.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/SurroundWithNewElementQuickAssistProposal.java
deleted file mode 100644
index 1208222..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/SurroundWithNewElementQuickAssistProposal.java
+++ /dev/null
@@ -1,109 +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.ui.internal.correction;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.w3c.dom.Node;
-
-public class SurroundWithNewElementQuickAssistProposal extends RenameInFileQuickAssistProposal {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#apply(org.eclipse.jface.text.ITextViewer,
-	 *      char, int, int)
-	 */
-	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
-		try {
-			int startTagOffset = offset;
-			int endTagOffset = offset + viewer.getSelectedRange().y;
-
-			// surround the node if no selection
-			if (startTagOffset == endTagOffset) {
-				IDOMNode cursorNode = (IDOMNode) ContentAssistUtils.getNodeAt((StructuredTextViewer) viewer, offset);
-				// use parent node if text node is empty
-				if (cursorNode.getNodeType() == Node.TEXT_NODE && cursorNode.getNodeValue().trim().length() == 0)
-					cursorNode = (IDOMNode) cursorNode.getParentNode();
-
-				startTagOffset = cursorNode.getStartOffset();
-				endTagOffset = cursorNode.getEndOffset();
-			}
-
-			// insert new element
-			MultiTextEdit multiTextEdit = new MultiTextEdit();
-			// element tag name cannot be DBCS, do not translate "<element>"
-			// and "</element>"
-			multiTextEdit.addChild(new InsertEdit(startTagOffset, "<element>")); //$NON-NLS-1$
-			multiTextEdit.addChild(new InsertEdit(endTagOffset, "</element>")); //$NON-NLS-1$
-			multiTextEdit.apply(viewer.getDocument());
-
-			// get new element node
-			IDOMNode newElementNode = (IDOMNode) ContentAssistUtils.getNodeAt((StructuredTextViewer) viewer, startTagOffset);
-
-			// format new element
-			IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
-			formatProcessor.formatNode(newElementNode);
-
-			// rename new element
-			super.apply(viewer, trigger, stateMask, newElementNode.getStartOffset() + 1);
-		} catch (MalformedTreeException e) {
-			// log for now, unless find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		} catch (BadLocationException e) {
-			// log for now, unless find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
-	 */
-	public String getAdditionalProposalInfo() {
-		return XMLUIMessages.SurroundWithNewElementQuickAssistProposal_0; //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
-	 */
-	public String getDisplayString() {
-		return XMLUIMessages.SurroundWithNewElementQuickAssistProposal_1; //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage()
-	 */
-	public Image getImage() {
-		// return JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_LOCAL);
-		return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ADD_CORRECTION);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditAttributeDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditAttributeDialog.java
deleted file mode 100644
index bb44a52..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditAttributeDialog.java
+++ /dev/null
@@ -1,170 +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.ui.internal.dialogs;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Color;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonUIContextIds;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-public class EditAttributeDialog extends Dialog implements ModifyListener {
-	protected Attr attribute;
-	protected String attributeName;
-	protected Text attributeNameField;
-	protected String attributeValue;
-	protected Text attributeValueField;
-	protected Label errorMessageLabel;
-	protected Button okButton;
-	protected Element ownerElement;
-
-	public EditAttributeDialog(Shell parentShell, Element ownerElement, Attr attribute) {
-		super(parentShell);
-		setShellStyle(getShellStyle() | SWT.RESIZE);
-		this.ownerElement = ownerElement;
-		this.attribute = attribute;
-	}
-
-	protected void buttonPressed(int buttonId) {
-		if (buttonId == IDialogConstants.OK_ID) {
-			attributeName = getModelValue(attributeNameField.getText());
-			attributeValue = attributeValueField.getText();
-		}
-		super.buttonPressed(buttonId);
-	}
-
-	protected void createButtonsForButtonBar(Composite parent) {
-		okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-		createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-	}
-
-	protected Control createContents(Composite parent) {
-		Control control = super.createContents(parent);
-		attributeNameField.forceFocus();
-		attributeNameField.selectAll();
-		updateErrorMessage();
-		return control;
-	}
-
-
-	protected Control createDialogArea(Composite parent) {
-		Composite dialogArea = (Composite) super.createDialogArea(parent);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogArea, XMLCommonUIContextIds.XCUI_ATTRIBUTE_DIALOG);
-
-		Composite composite = new Composite(dialogArea, SWT.NONE);
-		GridLayout layout = new GridLayout();
-		layout.numColumns = 2;
-		layout.marginWidth = 0;
-		composite.setLayout(layout);
-
-		//
-		// Style convenience constants
-		composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-		Label attributeNameLabel = new Label(composite, SWT.NONE);
-		attributeNameLabel.setText(XMLUIMessages._UI_LABEL_NAME_COLON); //$NON-NLS-1$
-
-		attributeNameField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.widthHint = 300;
-		attributeNameField.setLayoutData(gd);
-		attributeNameField.setText(getDisplayValue(attribute != null ? attribute.getName() : "")); //$NON-NLS-1$
-		attributeNameField.addModifyListener(this);
-
-		Label attributeValueLabel = new Label(composite, SWT.NONE);
-		attributeValueLabel.setText(XMLUIMessages._UI_LABEL_VALUE_COLON); //$NON-NLS-1$
-
-		String value = attribute != null ? attribute.getValue() : ""; //$NON-NLS-1$
-		int style = SWT.SINGLE | SWT.BORDER;
-		if (value.indexOf("\n") != -1) { //$NON-NLS-1$
-			style = SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL;
-		}
-
-		attributeValueField = new Text(composite, style);
-		gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.widthHint = 300;
-		attributeValueField.setLayoutData(gd);
-		attributeValueField.setText(getDisplayValue(attribute != null ? attribute.getValue() : "")); //$NON-NLS-1$
-
-		// error message
-		errorMessageLabel = new Label(composite, SWT.WRAP);
-		errorMessageLabel.setText(XMLUIMessages.error_message_goes_here); //$NON-NLS-1$
-		gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.widthHint = 200;
-		gd.heightHint = Math.max(30, errorMessageLabel.computeSize(0, 0, false).y * 2);
-		gd.horizontalSpan = 2;
-		errorMessageLabel.setLayoutData(gd);
-		Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
-		errorMessageLabel.setForeground(color);
-
-		return dialogArea;
-	}
-
-	public String getAttributeName() {
-		return attributeName;
-	}
-
-	public String getAttributeValue() {
-		return attributeValue;
-	}
-
-	protected String getDisplayValue(String string) {
-		return string != null ? string : ""; //$NON-NLS-1$
-	}
-
-	protected String getModelValue(String string) {
-		String result = null;
-		if (string != null && string.trim().length() > 0) {
-			result = string;
-		}
-		return result;
-	}
-
-	public void modifyText(ModifyEvent e) {
-		updateErrorMessage();
-	}
-
-	protected void updateErrorMessage() {
-		String errorMessage = null;
-		String name = attributeNameField.getText().trim();
-		if (name.length() > 0) {
-			Attr matchingAttribute = ownerElement.getAttributeNode(name);
-			if (matchingAttribute != null && matchingAttribute != attribute) {
-				errorMessage = XMLUIMessages._ERROR_XML_ATTRIBUTE_ALREADY_EXISTS; //$NON-NLS-1$
-			} else {
-				// TODO get checkName from Model
-				//errorMessage = ValidateHelper.checkXMLName(name);
-			}
-		} else {
-			errorMessage = ""; //$NON-NLS-1$
-		}
-
-		errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
-		errorMessageLabel.getParent().layout();
-		okButton.setEnabled(errorMessage == null);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditDoctypeDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditDoctypeDialog.java
deleted file mode 100644
index 3f67ed5..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditDoctypeDialog.java
+++ /dev/null
@@ -1,234 +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.ui.internal.dialogs;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonUIContextIds;
-import org.w3c.dom.DocumentType;
-
-public class EditDoctypeDialog extends Dialog {
-	protected boolean computeSystemId;
-	protected String[] doctypeData;
-	protected boolean errorChecking;
-	protected Label errorMessageLabel;
-	protected Button okButton;
-	protected Button publicIdBrowseButton;
-	protected Text publicIdField;
-	protected IPath resourceLocation;
-	protected Text rootElementNameField;
-	protected Button systemIdBrowseButton;
-	protected Text systemIdField;
-
-	public EditDoctypeDialog(Shell parentShell, DocumentType doctype) {
-		this(parentShell, doctype.getName(), doctype.getPublicId(), doctype.getSystemId());
-	}
-
-	public EditDoctypeDialog(Shell parentShell, String name, String publicId, String systemId) {
-		super(parentShell);
-		setShellStyle(getShellStyle() | SWT.RESIZE);
-		doctypeData = new String[3];
-		doctypeData[0] = name;
-		doctypeData[1] = publicId;
-		doctypeData[2] = systemId;
-	}
-
-	protected void buttonPressed(int buttonId) {
-		doctypeData[0] = getModelValue(rootElementNameField.getText());
-		doctypeData[1] = getModelValue(publicIdField.getText());
-		doctypeData[2] = getModelValue(systemIdField.getText());
-		super.buttonPressed(buttonId);
-	}
-
-	protected void createButtonsForButtonBar(Composite parent) {
-		okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-		createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-	}
-
-
-	protected Control createContents(Composite parent) {
-		Control control = super.createContents(parent);
-		updateErrorMessage();
-		return control;
-	}
-
-	protected Control createDialogArea(Composite parent) {
-		Composite dialogControl = (Composite) super.createDialogArea(parent);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogControl, XMLCommonUIContextIds.XCUI_DOCTYPE_DIALOG);
-
-		Composite composite = new Composite(dialogControl, SWT.NONE);
-		GridLayout layout = new GridLayout();
-		layout.numColumns = 3;
-		layout.marginWidth = 0;
-		composite.setLayout(layout);
-		composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-
-		ModifyListener modifyListener = new ModifyListener() {
-			public void modifyText(ModifyEvent e) {
-				if (e.widget == systemIdField) {
-					computeSystemId = false;
-				}
-				updateErrorMessage();
-			}
-		};
-
-		// row 1
-		//
-		Label rootElementNameLabel = new Label(composite, SWT.NONE);
-		rootElementNameLabel.setText(XMLUIMessages._UI_LABEL_ROOT_ELEMENT_NAME_COLON); //$NON-NLS-1$
-
-		rootElementNameField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(rootElementNameField, XMLCommonUIContextIds.XCUI_DOCTYPE_ROOT);
-		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.widthHint = 200;
-		rootElementNameField.setLayoutData(gd);
-		rootElementNameField.setText(getDisplayValue(doctypeData[0]));
-		rootElementNameField.addModifyListener(modifyListener);
-
-		Label placeHolder = new Label(composite, SWT.NONE);
-		placeHolder.setLayoutData(new GridData());
-
-		// row 2
-		//
-		Label publicIdLabel = new Label(composite, SWT.NONE);
-		publicIdLabel.setText(XMLUIMessages._UI_LABEL_PUBLIC_ID_COLON); //$NON-NLS-1$
-
-		publicIdField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(publicIdField, XMLCommonUIContextIds.XCUI_DOCTYPE_PUBLIC);
-		publicIdField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		publicIdField.setText(getDisplayValue(doctypeData[1]));
-
-		SelectionListener selectionListener = new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				EditEntityHelper helper = new EditEntityHelper();
-				if (e.widget == publicIdBrowseButton) {
-					helper.performBrowseForPublicId(getShell(), publicIdField, computeSystemId ? systemIdField : null);
-				}
-				else if (e.widget == systemIdBrowseButton) {
-					helper.performBrowseForSystemId(getShell(), systemIdField, resourceLocation);
-				}
-			}
-		};
-
-		publicIdBrowseButton = new Button(composite, SWT.NONE);
-		publicIdBrowseButton.setText(XMLUIMessages._UI_LABEL_BROWSE); //$NON-NLS-1$
-		publicIdBrowseButton.addSelectionListener(selectionListener);
-
-		// row 3
-		Label systemIdLabel = new Label(composite, SWT.NONE);
-		systemIdLabel.setText(XMLUIMessages._UI_LABEL_SYSTEM_ID_COLON); //$NON-NLS-1$
-
-		systemIdField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(systemIdField, XMLCommonUIContextIds.XCUI_DOCTYPE_SYSTEM);
-		systemIdField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		systemIdField.setText(getDisplayValue(doctypeData[2]));
-		systemIdField.addModifyListener(modifyListener);
-
-
-		systemIdBrowseButton = new Button(composite, SWT.NONE);
-		systemIdBrowseButton.setText(XMLUIMessages._UI_LABEL_BROWSE); //$NON-NLS-1$
-		systemIdBrowseButton.addSelectionListener(selectionListener);
-
-		// error message
-		errorMessageLabel = new Label(dialogControl, SWT.NONE);
-		errorMessageLabel.setText(""); //$NON-NLS-1$
-		errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
-		errorMessageLabel.setForeground(color);
-
-		return dialogControl;
-	}
-
-
-	protected Label createMessageArea(Composite composite) {
-		Label label = new Label(composite, SWT.NONE);
-		// label.setText(message);
-		return label;
-	}
-
-
-	protected String getDisplayValue(String string) {
-		return string != null ? string : ""; //$NON-NLS-1$
-	}
-
-	public boolean getErrorChecking() {
-		return errorChecking;
-	}
-
-
-	protected String getModelValue(String string) {
-		String result = null;
-		if (string != null && string.trim().length() > 0) {
-			result = string;
-		}
-		return result;
-	}
-
-	public String getName() {
-		return doctypeData[0];
-	}
-
-	public String getPublicId() {
-		return doctypeData[1];
-	}
-
-	public String getSystemId() {
-		return doctypeData[2];
-	}
-
-	public void setComputeSystemId(boolean computeSystemId) {
-		this.computeSystemId = computeSystemId;
-	}
-
-	public void setErrorChecking(boolean errorChecking) {
-		this.errorChecking = errorChecking;
-	}
-
-	public void setResourceLocation(IPath path) {
-		resourceLocation = path;
-	}
-
-	public void updateErrorMessage() {
-		if (errorChecking) {
-			String errorMessage = null;
-			if (getModelValue(systemIdField.getText()) == null) {
-				errorMessage = XMLUIMessages._UI_WARNING_SYSTEM_ID_MUST_BE_SPECIFIED; //$NON-NLS-1$
-			}
-			else if (getModelValue(rootElementNameField.getText()) == null) {
-				errorMessage = XMLUIMessages._UI_WARNING_ROOT_ELEMENT_MUST_BE_SPECIFIED; //$NON-NLS-1$
-			}
-
-			errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
-			okButton.setEnabled(errorMessage == null);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditElementDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditElementDialog.java
deleted file mode 100644
index 4e6098a..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditElementDialog.java
+++ /dev/null
@@ -1,143 +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.ui.internal.dialogs;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Color;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonUIContextIds;
-import org.w3c.dom.Element;
-
-public class EditElementDialog extends Dialog implements ModifyListener {
-	protected Element element;
-	protected String elementName;
-	protected Text elementNameField;
-	protected Label errorMessageLabel;
-	protected Button okButton;
-
-	public EditElementDialog(Shell parentShell, Element element) {
-		super(parentShell);
-		setShellStyle(getShellStyle() | SWT.RESIZE);
-		this.element = element;
-	}
-
-	protected void buttonPressed(int buttonId) {
-		if (buttonId == IDialogConstants.OK_ID) {
-			elementName = getModelValue(elementNameField.getText());
-		}
-		super.buttonPressed(buttonId);
-	}
-
-
-	protected void createButtonsForButtonBar(Composite parent) {
-		okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-		createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-	}
-
-	protected Control createContents(Composite parent) {
-		Control control = super.createContents(parent);
-		elementNameField.forceFocus();
-		elementNameField.selectAll();
-		updateErrorMessage();
-		return control;
-	}
-
-
-	protected Control createDialogArea(Composite parent) {
-		Composite dialogArea = (Composite) super.createDialogArea(parent);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogArea, XMLCommonUIContextIds.XCUI_ELEMENT_DIALOG);
-
-		Composite composite = new Composite(dialogArea, SWT.NONE);
-		GridLayout layout = new GridLayout();
-		layout.numColumns = 2;
-		layout.marginWidth = 0;
-		composite.setLayout(layout);
-		composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-		Label elementNameLabel = new Label(composite, SWT.NONE);
-		elementNameLabel.setText(XMLUIMessages._UI_LABEL_ELEMENT_NAME); //$NON-NLS-1$
-
-		elementNameField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.widthHint = 200;
-		elementNameField.setLayoutData(gd);
-		elementNameField.setText(getDisplayValue(element != null ? element.getNodeName() : "")); //$NON-NLS-1$
-		elementNameField.addModifyListener(this);
-
-		// error message
-		errorMessageLabel = new Label(composite, SWT.NONE);
-		errorMessageLabel.setText(XMLUIMessages.error_message_goes_here); //$NON-NLS-1$
-		gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.horizontalSpan = 2;
-		errorMessageLabel.setLayoutData(gd);
-		Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
-		errorMessageLabel.setForeground(color);
-
-		return dialogArea;
-	}
-
-	protected String getDisplayValue(String string) {
-		return string != null ? string : ""; //$NON-NLS-1$
-	}
-
-	public String getElementName() {
-		return elementName;
-	}
-
-	protected String getModelValue(String string) {
-		String result = null;
-		if (string != null && string.trim().length() > 0) {
-			result = string;
-		}
-		return result;
-	}
-
-	public void modifyText(ModifyEvent e) {
-		updateErrorMessage();
-	}
-
-	protected void updateErrorMessage() {
-		String errorMessage = null;
-		String name = elementNameField.getText();
-		//		String name = elementNameField.getText().trim();
-		if (name.length() > 0) {
-			// TODO use checkName from model level
-			//errorMessage = ValidateHelper.checkXMLName(name);
-			if (!NameValidator.isValid(name)) {
-				errorMessage = XMLUIMessages._UI_INVALID_NAME;
-			}
-		} else {
-			errorMessage = ""; //$NON-NLS-1$
-		}
-
-		errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
-		okButton.setEnabled(errorMessage == null);
-	}
-}
-
-
-
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditEntityHelper.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditEntityHelper.java
deleted file mode 100644
index 4fbec45..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditEntityHelper.java
+++ /dev/null
@@ -1,71 +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.ui.internal.dialogs;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class EditEntityHelper {
-
-	public void performBrowseForPublicId(Shell parentShell, Text publicIdField) {
-		performBrowseForPublicId(parentShell, publicIdField, null);
-	}
-
-	public void performBrowseForPublicId(Shell parentShell, Text publicIdField, Text systemIdField) {
-		String[] extensions = {"dtd", "txt"}; //$NON-NLS-1$ //$NON-NLS-2$
-		SelectXMLCatalogIdDialog dialog = new SelectXMLCatalogIdDialog(parentShell, extensions);
-		dialog.create();
-		dialog.getShell().setText(XMLUIMessages._UI_LABEL_SELECT_XML_CATALOG_ENTRY); //$NON-NLS-1$
-		dialog.setBlockOnOpen(true);
-		dialog.open();
-		if (dialog.getReturnCode() == Window.OK) {
-			String id = dialog.getId();
-			if (id != null) {
-				publicIdField.setText(id);
-				if (systemIdField != null && dialog.getSystemId() != null) {
-					systemIdField.setText(dialog.getSystemId());
-				}
-			}
-		}
-	}
-
-	public void performBrowseForSystemId(Shell parentShell, Text systemIdField, IPath resourceLocation) {
-		String[] extensions = {"dtd"}; //$NON-NLS-1$
-		SelectFileOrXMLCatalogIdDialog dialog = new SelectFileOrXMLCatalogIdDialog(parentShell, extensions, ICatalogEntry.ENTRY_TYPE_SYSTEM);
-		dialog.create();
-		dialog.getShell().setText(XMLUIMessages._UI_LABEL_SPECIFY_SYSTEM_ID); //$NON-NLS-1$
-		dialog.setBlockOnOpen(true);
-		dialog.open();
-		if (dialog.getReturnCode() == Window.OK) {
-			String id = dialog.getId();
-			IFile file = dialog.getFile();
-			if (id != null) {
-				systemIdField.setText(id);
-			} else if (file != null) {
-				String uri = null;
-				if (resourceLocation != null) {
-					uri = URIHelper.getRelativeURI(file.getLocation(), resourceLocation);
-				} else {
-					uri = file.getLocation().toOSString();
-				}
-				systemIdField.setText(uri);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java
deleted file mode 100644
index 36ec170..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java
+++ /dev/null
@@ -1,255 +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.ui.internal.dialogs;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-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.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.ContentModelManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonUIContextIds;
-
-public class EditNamespaceInfoDialog extends Dialog {
-
-	public static EditNamespaceInfoDialog invokeDialog(Shell shell, String title, NamespaceInfo info, IPath resourceLocation) {
-		EditNamespaceInfoDialog dialog = new EditNamespaceInfoDialog(shell, info);
-		dialog.create();
-		dialog.getShell().setText(title);
-		dialog.setBlockOnOpen(true);
-		dialog.setResourceLocation(resourceLocation);
-		dialog.open();
-		return dialog;
-	}
-
-	protected Button browseButton;
-	protected String errorMessage;
-
-	protected Label errorMessageLabel;
-	protected NamespaceInfo fInfo;
-	protected Text locationHintField;
-
-	protected Button okButton;
-	protected Text prefixField;
-	protected IPath resourceLocation;
-	protected Text uriField;
-
-	public EditNamespaceInfoDialog(Shell parentShell, NamespaceInfo info) {
-		super(parentShell);
-		setShellStyle(getShellStyle() | SWT.RESIZE);
-		this.fInfo = info;
-	}
-
-	protected void buttonPressed(int buttonId) {
-		if (buttonId == IDialogConstants.OK_ID) {
-			fInfo.uri = uriField.getText();
-			fInfo.prefix = prefixField.getText();
-			fInfo.locationHint = locationHintField.getText();
-		}
-		super.buttonPressed(buttonId);
-	}
-
-	protected void computeErrorMessage() {
-		errorMessage = null;
-	}
-
-	protected void createButtonsForButtonBar(Composite parent) {
-		okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-		okButton.setEnabled(false);
-		createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-		updateWidgets();
-	}
-
-	protected Control createDialogArea(Composite parent) {
-		Composite dialogsubArea = (Composite) super.createDialogArea(parent);
-               PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogsubArea, XMLCommonUIContextIds.XCUI_NAMESPACE_DIALOG);
-
-		Composite composite = new Composite(dialogsubArea, SWT.NONE);
-		GridLayout layout = new GridLayout();
-		layout.numColumns = 3;
-		layout.marginWidth = 0;
-		composite.setLayout(layout);
-
-		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.widthHint = 350;
-		composite.setLayoutData(gd);
-
-		ModifyListener modifyListener = new ModifyListener() {
-			public void modifyText(ModifyEvent e) {
-				updateWidgets();
-			}
-		};
-
-
-		// row 1
-		//
-		Label uriLabel = new Label(composite, SWT.NONE);
-		uriLabel.setText(XMLUIMessages._UI_LABEL_NAMESPACE_NAME_COLON); //$NON-NLS-1$
-
-		uriField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-		gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.grabExcessHorizontalSpace = true;
-		uriField.setLayoutData(gd);
-		uriField.setText(getDisplayValue(fInfo.uri));
-		uriField.addModifyListener(modifyListener);
-		uriField.setEnabled(fInfo.getProperty("uri-readOnly") == null); //$NON-NLS-1$
-
-		// never read
-               Label placeHolder1 = new Label(composite, SWT.NONE);
-               placeHolder1.setText("");
-
-		// row 2
-		//
-		Label prefixLabel = new Label(composite, SWT.NONE);
-		prefixLabel.setText(XMLUIMessages._UI_LABEL_PREFIX_COLON); //$NON-NLS-1$
-
-		prefixField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-		gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.grabExcessHorizontalSpace = true;
-		prefixField.setLayoutData(gd);
-		prefixField.setText(getDisplayValue(fInfo.prefix));
-		prefixField.addModifyListener(modifyListener);
-		prefixField.setEnabled(fInfo.getProperty("prefix-readOnly") == null); //$NON-NLS-1$
-
-		// never read
-                Label placeHolder2 = new Label(composite, SWT.NONE);
-                placeHolder2.setText("");
-
-		// row 3
-		//
-		Label locationHintLabel = new Label(composite, SWT.NONE);
-		locationHintLabel.setText(XMLUIMessages._UI_LABEL_LOCATION_HINT_COLON); //$NON-NLS-1$
-
-		locationHintField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-		gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.grabExcessHorizontalSpace = true;
-		locationHintField.setLayoutData(gd);
-		locationHintField.setText(getDisplayValue(fInfo.locationHint));
-		locationHintField.addModifyListener(modifyListener);
-		locationHintField.setEnabled(fInfo.getProperty("locationHint-readOnly") == null); //$NON-NLS-1$
-
-		SelectionListener selectionListener = new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				performBrowse();
-			}
-		};
-
-		browseButton = new Button(composite, SWT.NONE);
-		browseButton.setText(XMLUIMessages._UI_LABEL_BROWSE); //$NON-NLS-1$
-		browseButton.addSelectionListener(selectionListener);
-		browseButton.setEnabled(locationHintField.getEnabled());
-
-		// error message
-		errorMessageLabel = new Label(dialogsubArea, SWT.NONE);
-		errorMessageLabel.setText(XMLUIMessages.error_message_goes_here); //$NON-NLS-1$
-		errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
-		errorMessageLabel.setForeground(color);
-
-		return dialogsubArea;
-	}
-
-	protected String getDisplayValue(String string) {
-		return string != null ? string : ""; //$NON-NLS-1$
-	}
-
-	protected void performBrowse() {
-		String[] extensions = {".xsd"}; //$NON-NLS-1$
-		SelectFileOrXMLCatalogIdDialog dialog = new SelectFileOrXMLCatalogIdDialog(getShell(), extensions);
-		dialog.create();
-		dialog.getShell().setText(XMLUIMessages._UI_LABEL_SELECT_FILE); //$NON-NLS-1$
-		dialog.setBlockOnOpen(true);
-		dialog.open();
-
-		if (dialog.getReturnCode() == Window.OK) {
-			String grammarURI = null;
-			IFile file = dialog.getFile();
-			String id = dialog.getId();
-			if (file != null) {
-				String uri = null;
-				if (resourceLocation != null) {
-					uri = URIHelper.getRelativeURI(file.getLocation(), resourceLocation);
-					grammarURI = file.getLocation().toOSString();
-				}
-				else {
-					uri = file.getLocation().toOSString();
-					grammarURI = uri;
-				}
-				locationHintField.setText(uri);
-			}
-			else if (id != null) {
-				locationHintField.setText(id);
-				URIResolver resolver = URIResolverPlugin.createResolver();
-				grammarURI = resolver.resolve(null, id, id);
-			}
-
-
-			CMDocument document = ContentModelManager.getInstance().createCMDocument(grammarURI, "xsd"); //$NON-NLS-1$
-			List namespaceInfoList = (List) document.getProperty("http://org.eclipse.wst/cm/properties/namespaceInfo"); //$NON-NLS-1$
-			NamespaceInfo info = (NamespaceInfo) namespaceInfoList.get(0);
-			if (uriField.getText().trim().length() == 0 && info.uri != null) {
-				uriField.setText(info.uri);
-			}
-			if (prefixField.getText().trim().length() == 0 && info.prefix != null) {
-				prefixField.setText(info.prefix);
-			}
-		}
-	}
-
-	public void setResourceLocation(IPath path) {
-		resourceLocation = path;
-	}
-
-	protected void updateErrorMessageLabel() {
-		errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
-	}
-
-	protected void updateOKButtonState() {
-		if (okButton != null) {
-			if (uriField.getText().trim().length() == 0 && prefixField.getText().trim().length() == 0 && locationHintField.getText().trim().length() == 0)
-				okButton.setEnabled(false);
-			else
-				okButton.setEnabled(errorMessage == null);
-		}
-	}
-
-	protected void updateWidgets() {
-		computeErrorMessage();
-		updateErrorMessageLabel();
-		updateOKButtonState();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditProcessingInstructionDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditProcessingInstructionDialog.java
deleted file mode 100644
index 4b3fe66..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditProcessingInstructionDialog.java
+++ /dev/null
@@ -1,119 +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.ui.internal.dialogs;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonUIContextIds;
-import org.w3c.dom.ProcessingInstruction;
-
-public class EditProcessingInstructionDialog extends Dialog {
-	protected String data;
-	protected Text dataField;
-	protected String target;
-	protected Text targetField;
-
-	public EditProcessingInstructionDialog(Shell parentShell, ProcessingInstruction pi) {
-		this(parentShell, pi.getTarget(), pi.getData());
-	}
-
-	public EditProcessingInstructionDialog(Shell parentShell, String target, String data) {
-		super(parentShell);
-		setShellStyle(getShellStyle() | SWT.RESIZE);
-		this.target = target;
-		this.data = data;
-	}
-
-	protected void buttonPressed(int buttonId) {
-		target = getModelValue(targetField.getText());
-		data = getModelValue(dataField.getText());
-		super.buttonPressed(buttonId);
-	}
- 
-	protected void createButtonsForButtonBar(Composite parent) {
-		createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-		createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-	}
-
-	protected Control createDialogArea(Composite parent) {
-		Composite dialogArea1 = (Composite) super.createDialogArea(parent);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogArea1, XMLCommonUIContextIds.XCUI_PROCESSING_DIALOG);
-
-		Composite composite = new Composite(dialogArea1, SWT.NONE);
-		GridLayout layout = new GridLayout();
-		layout.numColumns = 2;
-		layout.marginWidth = 0;
-		composite.setLayout(layout);
-		composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-
-		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.widthHint = 250;
-
-		Label targetLabel = new Label(composite, SWT.NONE);
-		targetLabel.setText(XMLUIMessages._UI_LABEL_TARGET_COLON); //$NON-NLS-1$
-
-		targetField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-		targetField.setLayoutData(gd);
-		targetField.setText(getDisplayValue(target));
-
-		Label dataLabel = new Label(composite, SWT.NONE);
-		dataLabel.setText(XMLUIMessages._UI_LABEL_DATA_COLON); //$NON-NLS-1$
-
-		dataField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-		dataField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		dataField.setText(getDisplayValue(data));
-
-		return dialogArea1;
-	}
-
-	protected Label createMessageArea(Composite composite) {
-		Label label = new Label(composite, SWT.NONE);
-		//label.setText(message);
-		return label;
-	}
-
-	public String getData() {
-		return data;
-	}
-
-	protected String getDisplayValue(String string) {
-		return string != null ? string : ""; //$NON-NLS-1$
-	}
-
-	protected String getModelValue(String string) {
-		String result = null;
-		if (string != null && string.trim().length() > 0) {
-			result = string;
-		}
-		return result;
-	}
-
-
-	public String getTarget() {
-		return target;
-	}
-}
-
-
-
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditSchemaInfoDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditSchemaInfoDialog.java
deleted file mode 100644
index 01aefdc..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditSchemaInfoDialog.java
+++ /dev/null
@@ -1,80 +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.ui.internal.dialogs;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.nsedit.CommonEditNamespacesDialog;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonUIContextIds;
-
-public class EditSchemaInfoDialog extends Dialog implements UpdateListener {
-	// protected NamespaceInfoTable namespaceInfoTable;
-	protected Label errorMessageLabel;
-	protected List namespaceInfoList;
-	protected IPath resourceLocation;
-
-	public EditSchemaInfoDialog(Shell parentShell, IPath resourceLocation) {
-		super(parentShell);
-		setShellStyle(getShellStyle() | SWT.RESIZE);
-		this.resourceLocation = resourceLocation;
-	}
-
-	protected void createButtonsForButtonBar(Composite parent) {
-		createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-		createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-	}
-
-	protected Control createDialogArea(Composite parent) {
-		Composite dialogArea = (Composite) super.createDialogArea(parent);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogArea, XMLCommonUIContextIds.XCUI_SCHEMA_INFO_DIALOG);
-		
-		CommonEditNamespacesDialog editNamespacesControl = new CommonEditNamespacesDialog(dialogArea, resourceLocation, XMLUIMessages._UI_NAMESPACE_DECLARATIONS, false, true); //$NON-NLS-1$
-		editNamespacesControl.setNamespaceInfoList(namespaceInfoList);
-
-		editNamespacesControl.updateErrorMessage(namespaceInfoList);
-
-		return dialogArea;
-	}
-
-	protected Control getDialogArea(Composite parent) {
-		return super.createDialogArea(parent);
-	}
-
-	public List getNamespaceInfoList() {
-		return namespaceInfoList;
-	}
-
-	public void setNamespaceInfoList(List list) {
-		namespaceInfoList = list;
-	}
-
-	public void updateErrorMessage(List namespaceInfoList) {
-		NamespaceInfoErrorHelper helper = new NamespaceInfoErrorHelper();
-		String errorMessage = helper.computeErrorMessage(namespaceInfoList, null);
-		errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
-	}
-
-	public void updateOccured(Object object, Object arg) {
-		updateErrorMessage((List) arg);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoErrorHelper.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoErrorHelper.java
deleted file mode 100644
index ae360c3..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoErrorHelper.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.ui.internal.dialogs;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class NamespaceInfoErrorHelper {
-
-	protected List errorList;
-
-	public NamespaceInfoErrorHelper() {
-	}
-
-	public String computeErrorMessage(List namespaceInfoList, URIResolver idResolver) {
-		String result = null;
-		Hashtable prefixTable = new Hashtable();
-		Hashtable uriTable = new Hashtable();
-		for (Iterator iterator = namespaceInfoList.iterator(); iterator.hasNext();) {
-			NamespaceInfo nsInfo = (NamespaceInfo) iterator.next();
-			nsInfo.normalize();
-
-			String urikey = nsInfo.uri != null ? nsInfo.uri : ""; //$NON-NLS-1$
-			NamespaceInfo nsInfo2 = null;
-			if ((nsInfo2 = (NamespaceInfo) uriTable.get(urikey)) != null) {
-				if (nsInfo.uri != null && nsInfo.uri.equals(nsInfo2.uri)) {
-					result = XMLUIMessages._UI_WARNING_MORE_THAN_ONE_NS_WITH_NAME + "'" + nsInfo.uri + "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-				} else {
-					result = XMLUIMessages._UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_NAME; //$NON-NLS-1$
-				}
-				break;
-			} else {
-				uriTable.put(urikey, nsInfo);
-			}
-
-			if (nsInfo.uri != null) {
-				String key = nsInfo.prefix != null ? nsInfo.prefix : ""; //$NON-NLS-1$
-				if (prefixTable.get(key) != null) {
-					if (nsInfo.prefix != null) {
-						result = XMLUIMessages._UI_WARNING_MORE_THAN_ONE_NS_WITH_PREFIX + "'" + nsInfo.prefix + "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-						break;
-					} else {
-						result = XMLUIMessages._UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_PREFIX; //$NON-NLS-1$
-						break;
-					}
-				} else {
-					prefixTable.put(key, nsInfo);
-				}
-
-				if (nsInfo.locationHint != null && idResolver != null) {
-					String grammarURI = idResolver.resolve(null, nsInfo.locationHint, nsInfo.locationHint);
-					if (!URIHelper.isReadableURI(grammarURI, false)) {
-						result = XMLUIMessages._UI_WARNING_SCHEMA_CAN_NOT_BE_LOCATED + " '" + nsInfo.locationHint + "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-						break;
-					}
-				}
-				if (idResolver != null && nsInfo.locationHint == null && !nsInfo.uri.equals(DOMNamespaceInfoManager.XSI_URI)) {
-					result = XMLUIMessages._UI_WARNING_LOCATION_HINT_NOT_SPECIFIED + " '" + nsInfo.uri + "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					break;
-				}
-			} else {
-				if (nsInfo.prefix != null) {
-					result = XMLUIMessages._UI_WARNING_NAMESPACE_NAME_NOT_SPECIFIED + " '" + nsInfo.prefix + "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					break;
-				}
-			}
-		}
-		// additional tests
-		if (result == null) {
-			for (Iterator iterator = namespaceInfoList.iterator(); iterator.hasNext();) {
-				NamespaceInfo nsInfo = (NamespaceInfo) iterator.next();
-				nsInfo.normalize();
-				if (nsInfo.uri != null && nsInfo.isPrefixRequired && nsInfo.prefix == null) {
-					result = XMLUIMessages._UI_WARNING_PREFIX_NOT_SPECIFIED + " '" + nsInfo.uri + "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					break;
-				}
-			}
-		}
-
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoTable.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoTable.java
deleted file mode 100644
index e2830e5..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoTable.java
+++ /dev/null
@@ -1,391 +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.ui.internal.dialogs;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-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.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-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.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-public class NamespaceInfoTable extends Composite {
-
-	/**
-	 * NamespaceInfoTableLabelProvider
-	 */
-	protected class NamespaceInfoTableLabelProvider implements ITableLabelProvider, IStructuredContentProvider {
-
-		public void addListener(ILabelProviderListener listener) {
-		}
-
-		public void dispose() {
-		}
-
-		public Image getColumnImage(Object object, int columnIndex) {
-			return null;
-		}
-
-		public String getColumnText(Object object, int column) {
-			NamespaceInfo info = (NamespaceInfo) object;
-			String result = null;
-			switch (column) {
-				case 0 : {
-					result = info.uri;
-					break;
-				}
-				case 1 : {
-					result = info.prefix;
-					break;
-				}
-				case 2 : {
-					result = info.locationHint;
-					break;
-				}
-			}
-			result = result != null ? result : ""; //$NON-NLS-1$
-			if (result.equals("")) { //$NON-NLS-1$
-				switch (column) {
-					case 0 : {
-						result = XMLUIMessages._UI_NO_NAMESPACE_NAME; //$NON-NLS-1$
-						break;
-					}
-					case 1 : {
-						result = XMLUIMessages._UI_NO_PREFIX; //$NON-NLS-1$
-						break;
-					}
-				}
-			}
-			return result;
-		}
-
-		 String getDefaultPrefix() {
-			String defaultPrefix = "p"; //$NON-NLS-1$
-			if (namespaceInfoList == null)
-				return defaultPrefix;
-			Vector v = new Vector();
-			for (int i = 0; i < namespaceInfoList.size(); i++) {
-				NamespaceInfo nsinfo = (NamespaceInfo) namespaceInfoList.get(i);
-				if (nsinfo.prefix != null)
-					v.addElement(nsinfo.prefix);
-			}
-			if (v.contains(defaultPrefix)) {
-				String s = defaultPrefix;
-				for (int j = 0; v.contains(s); j++) {
-					s = defaultPrefix + Integer.toString(j);
-				}
-				return s;
-			} else
-				return defaultPrefix;
-		}
-
-		public Object[] getElements(Object inputElement) {
-			return namespaceInfoList.toArray();
-		}
-
-		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-		}
-
-		public boolean isDeleted(Object element) {
-			return false;
-		}
-
-		public boolean isLabelProperty(Object object, Object property) {
-			return false;
-		}
-
-		public boolean isLabelProperty(Object element, String property) {
-			return false;
-		}
-
-		public void removeListener(ILabelProviderListener listener) {
-		}
-	}
-
-	protected static final String LOCATION_HINT = XMLUIMessages._UI_LABEL_LOCATION_HINT; //$NON-NLS-1$
-	protected static final String NAMESPACE_URI = XMLUIMessages._UI_LABEL_NAMESPACE_NAME; //$NON-NLS-1$
-	protected static final String PREFIX = XMLUIMessages._UI_LABEL_PREFIX; //$NON-NLS-1$
-	protected Button deleteButton;
-	protected boolean dummyRowsRemoved = false;
-	protected Button editButton;
-	protected List namespaceInfoList = new Vector();
-	protected Button newButton;
-	protected NamespaceInfoTableLabelProvider provider;
-	protected IPath resourceLocation;
-	protected TableViewer tableViewer;
-	protected UpdateListener updateListener;
-	protected int visibleRows = -1;
-
-	public NamespaceInfoTable(Composite parent) {
-		this(parent, -1, -1, -1);
-	}
-
-	public NamespaceInfoTable(Composite parent, int visibleRows) {
-		this(parent, -1, -1, visibleRows);
-	}
-
-	public NamespaceInfoTable(Composite parent, int widthHint, int heightHint) {
-		this(parent, widthHint, heightHint, -1);
-	}
-
-	public NamespaceInfoTable(Composite parent, int widthHint, int heightHint, int visibleRows) {
-		super(parent, SWT.NONE);
-		setLayout(createGridLayout());
-		setLayoutData(new GridData(GridData.FILL_BOTH));
-		Group namespaceInfoGroup = new Group(this, SWT.NONE);
-		namespaceInfoGroup.setText(XMLUIMessages._UI_LABEL_XML_SCHEMA_INFORMATION); //$NON-NLS-1$
-		namespaceInfoGroup.setLayout(new GridLayout());
-		GridData gd = new GridData(GridData.FILL_BOTH);
-		if (widthHint != -1) {
-			gd.widthHint = widthHint;
-		}
-		if (heightHint != -1) {
-			gd.heightHint = heightHint;
-		}
-		namespaceInfoGroup.setLayoutData(gd);
-		//WorkbenchHelp.setHelp(namespaceInfoGroup, new
-		// ControlContextComputer(namespaceInfoGroup,
-		// XMLBuilderContextIds.XMLC_NAMESPACE_GROUP));
-		String[] titleArray = {NAMESPACE_URI, PREFIX, LOCATION_HINT};
-		tableViewer = new TableViewer(namespaceInfoGroup, SWT.FULL_SELECTION);
-		provider = new NamespaceInfoTableLabelProvider();
-		tableViewer.setContentProvider(provider);
-		tableViewer.setLabelProvider(provider);
-		tableViewer.setColumnProperties(titleArray);
-		Table table = tableViewer.getTable();
-		table.setHeaderVisible(true);
-		table.setLayoutData(new GridData(GridData.FILL_BOTH));
-		int[] widthArray = {50, 20, 30};
-		TableLayout layout = new TableLayout();
-		for (int i = 0; i < titleArray.length; i++) {
-			TableColumn column = new TableColumn(table, i);
-			column.setText(titleArray[i]);
-			column.setAlignment(SWT.LEFT);
-			layout.addColumnData(new ColumnWeightData(widthArray[i], true));
-		}
-		this.visibleRows = visibleRows;
-		for (int i = 0; i < visibleRows; i++) {
-			TableItem item = new TableItem(table, SWT.NONE);
-			item.setText("#######"); //$NON-NLS-1$
-		}
-		table.setLayout(layout);
-		CellEditor[] cellEditors = new CellEditor[titleArray.length];
-		cellEditors[1] = new TextCellEditor(table);
-		cellEditors[2] = new TextCellEditor(table);
-		tableViewer.setCellEditors(cellEditors);
-		MouseAdapter mouseAdapter = new MouseAdapter() {
-			public void mouseDoubleClick(MouseEvent e) {
-				if (tableViewer.getTable().getItem(new Point(e.x, e.y)) != null) {
-					performEdit();
-				}
-			}
-		};
-		table.addMouseListener(mouseAdapter);
-		createButtons(namespaceInfoGroup);
-		ISelectionChangedListener selectionChangedListener = new ISelectionChangedListener() {
-			public void selectionChanged(SelectionChangedEvent event) {
-				updateButtonEnabledState();
-			}
-		};
-		tableViewer.addSelectionChangedListener(selectionChangedListener);
-	}
-
-	protected void createButtons(Composite parent) {
-		Composite composite = new Composite(parent, SWT.NONE);
-		composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		GridLayout gridLayout = new GridLayout();
-		gridLayout.numColumns = 2;
-		gridLayout.marginHeight = 0;
-		gridLayout.marginWidth = 0;
-		composite.setLayout(gridLayout);
-		Button hiddenButton = new Button(composite, SWT.NONE);
-		hiddenButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		hiddenButton.setVisible(false);
-		hiddenButton.setEnabled(false);
-		SelectionListener selectionListener = new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				if (e.widget == newButton) {
-					performNew();
-				} else if (e.widget == editButton) {
-					performEdit();
-				} else if (e.widget == deleteButton) {
-					performDelete();
-				}
-			}
-		};
-		// create a composite to hold the three buttons
-		Composite buttonComposite = new Composite(composite, SWT.NONE);
-		buttonComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		GridLayout buttonGridLayout = new GridLayout();
-		buttonGridLayout.numColumns = 3;
-		buttonGridLayout.makeColumnsEqualWidth = true;
-		buttonComposite.setLayout(buttonGridLayout);
-		// add the New button
-		//
-		newButton = new Button(buttonComposite, SWT.NONE);
-		newButton.setText(XMLUIMessages._UI_BUTTON_NEW); //$NON-NLS-1$
-		newButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		newButton.addSelectionListener(selectionListener);
-		// add the Edit button
-		//
-		editButton = new Button(buttonComposite, SWT.NONE);
-		editButton.setText(XMLUIMessages._UI_BUTTON_EDIT); //$NON-NLS-1$
-		editButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		editButton.addSelectionListener(selectionListener);
-		// add the Delete button
-		//
-		deleteButton = new Button(buttonComposite, SWT.NONE);
-		deleteButton.setText(XMLUIMessages._UI_BUTTON_DELETE); //$NON-NLS-1$
-		deleteButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		deleteButton.addSelectionListener(selectionListener);
-	}
-
-	public GridLayout createGridLayout() {
-		GridLayout gridLayout = new GridLayout();
-		gridLayout.marginWidth = 0;
-		gridLayout.horizontalSpacing = 0;
-		return gridLayout;
-	}
-
-	public List getNamespaceInfoList() {
-		return namespaceInfoList;
-	}
-
-	protected NamespaceInfo getTargetNamespaceInfo() {
-		return (namespaceInfoList != null && namespaceInfoList.size() > 0) ? (NamespaceInfo) namespaceInfoList.get(0) : null;
-	}
-
-	protected EditNamespaceInfoDialog invokeDialog(String title, NamespaceInfo info) {
-		Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-		EditNamespaceInfoDialog dialog = new EditNamespaceInfoDialog(shell, info);
-		dialog.create();
-		dialog.getShell().setText(title);
-		dialog.setBlockOnOpen(true);
-		dialog.setResourceLocation(resourceLocation);
-		dialog.open();
-		return dialog;
-	}
-
-	protected void performDelayedUpdate() {
-		Runnable delayedUpdate = new Runnable() {
-			public void run() {
-				update();
-			}
-		};
-		getDisplay().asyncExec(delayedUpdate);
-		if (updateListener != null) {
-			updateListener.updateOccured(this, namespaceInfoList);
-		}
-	}
-
-	public void performDelete() {
-		ISelection selection = tableViewer.getSelection();
-		Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
-		if (selectedObject != null) {
-			namespaceInfoList.remove(selectedObject);
-			performDelayedUpdate();
-		}
-	}
-
-	public void performEdit() {
-		ISelection selection = tableViewer.getSelection();
-		Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
-		if (selectedObject instanceof NamespaceInfo) {
-			invokeDialog(XMLUIMessages._UI_LABEL_NEW_NAMESPACE_INFORMATION, (NamespaceInfo) selectedObject); //$NON-NLS-1$
-			performDelayedUpdate();
-		}
-	}
-
-	public void performNew() {
-		NamespaceInfo info = new NamespaceInfo();
-		EditNamespaceInfoDialog dialog = invokeDialog(XMLUIMessages._UI_LABEL_NEW_NAMESPACE_INFORMATION, info); //$NON-NLS-1$
-		if (dialog.getReturnCode() == Window.OK) {
-			namespaceInfoList.add(info);
-			performDelayedUpdate();
-		}
-	}
-
-	public void setNamespaceInfoList(List namespaceInfoList) {
-		this.namespaceInfoList = namespaceInfoList;
-		update();
-	}
-
-	public void setResourceLocation(IPath resourceLocation) {
-		this.resourceLocation = resourceLocation;
-	}
-
-	public void setUpdateListener(UpdateListener updateListener) {
-		this.updateListener = updateListener;
-	}
-
-	public void update() {
-		updateHelper(namespaceInfoList);
-	}
-
-	public void updateButtonEnabledState() {
-		ISelection selection = tableViewer.getSelection();
-		Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
-		NamespaceInfo info = (NamespaceInfo) selectedObject;
-		editButton.setEnabled(info != null);
-		deleteButton.setEnabled(info != null && info.getProperty("unremovable") == null); //$NON-NLS-1$
-	}
-
-	public void updateHelper(List namespaceInfoList) {
-		if (visibleRows != -1 && !dummyRowsRemoved) {
-			dummyRowsRemoved = true;
-			tableViewer.getTable().removeAll();
-		}
-		ISelection selection = tableViewer.getSelection();
-		tableViewer.setInput(namespaceInfoList);
-		if (selection.isEmpty()) {
-			if (namespaceInfoList.size() > 0) {
-				tableViewer.setSelection(new StructuredSelection(namespaceInfoList.get(0)));
-			}
-		} else {
-			tableViewer.setSelection(selection);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdDialog.java
deleted file mode 100644
index edfc968..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdDialog.java
+++ /dev/null
@@ -1,87 +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.ui.internal.dialogs;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-public class SelectFileOrXMLCatalogIdDialog extends Dialog {
-	protected int catalogEntryType;
-	protected String[] extensions;
-	protected IFile file;
-	protected String id;
-	protected Button okButton;
-	protected SelectFileOrXMLCatalogIdPanel panel;
-
-	public SelectFileOrXMLCatalogIdDialog(Shell parentShell, String[] extensions) {
-		this(parentShell, extensions, 0);
-	}
-
-	public SelectFileOrXMLCatalogIdDialog(Shell parentShell, String[] extensions, int catalogEntryType) {
-		super(parentShell);
-		setShellStyle(getShellStyle() | SWT.RESIZE);
-		this.extensions = extensions;
-		this.catalogEntryType = catalogEntryType;
-	}
-
-
-	protected void buttonPressed(int buttonId) {
-		if (buttonId == IDialogConstants.OK_ID) {
-			file = panel.getFile();
-			id = panel.getXMLCatalogId();
-		}
-		super.buttonPressed(buttonId);
-	}
-
-	protected void createButtonsForButtonBar(Composite parent) {
-		okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-		okButton.setEnabled(false);
-		createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-	}
-
-	protected Control createDialogArea(Composite parent) {
-		Composite dialogArea = (Composite) super.createDialogArea(parent);
-
-		panel = new SelectFileOrXMLCatalogIdPanel(dialogArea);
-		panel.setCatalogEntryType(catalogEntryType);
-		panel.setFilterExtensions(extensions);
-		panel.setVisibleHelper(true);
-		SelectFileOrXMLCatalogIdPanel.Listener listener = new SelectFileOrXMLCatalogIdPanel.Listener() {
-			public void completionStateChanged() {
-				updateButtonState();
-			}
-		};
-		panel.setListener(listener);
-
-		return dialogArea;
-	}
-
-	public IFile getFile() {
-		return file;
-	}
-
-	public String getId() {
-		return id;
-	}
-
-	protected void updateButtonState() {
-		okButton.setEnabled(panel.getFile() != null || panel.getXMLCatalogId() != null);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdPanel.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdPanel.java
deleted file mode 100644
index dd354ec..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,180 +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.ui.internal.dialogs;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-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.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView;
-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.ICatalogEntry;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-
-public class SelectFileOrXMLCatalogIdPanel extends Composite implements SelectionListener {
-
-	/**
-	 * TODO: Change the name of this interface; "Listener" is used by SWT.
-	 */
-	public interface Listener {
-		void completionStateChanged();
-	}
-
-	protected class MySelectSingleFileView extends SelectSingleFileView implements SelectSingleFileView.Listener {
-		protected Control control;
-
-		public MySelectSingleFileView(Composite parent) {
-			super(null, true);
-			//String[] ext = {".dtd"};
-			//addFilterExtensions(ext);
-			control = createControl(parent);
-			control.setLayoutData(new GridData(GridData.FILL_BOTH));
-			MySelectSingleFileView.this.setListener(this);
-		}
-
-		public Control getControl() {
-			return control;
-		}
-
-		public void setControlComplete(boolean isComplete) {
-			updateCompletionStateChange();
-		}
-
-		public void setVisibleHelper(boolean isVisible) {
-			super.setVisibleHelper(isVisible);
-		}
-	}
-
-	protected Listener listener;
-	protected PageBook pageBook;
-
-	protected Button[] radioButton;
-	protected MySelectSingleFileView selectSingleFileView;
-	protected SelectXMLCatalogIdPanel selectXMLCatalogIdPanel;
-
-	public SelectFileOrXMLCatalogIdPanel(Composite parent) {
-		super(parent, SWT.NONE);
-
-		// container group
-		setLayout(new GridLayout());
-		GridData gd = new GridData(GridData.FILL_BOTH);
-		gd.heightHint = 400;
-		gd.widthHint = 400;
-		setLayoutData(gd);
-
-		radioButton = new Button[2];
-		radioButton[0] = new Button(this, SWT.RADIO);
-		radioButton[0].setText(XMLUIMessages._UI_RADIO_BUTTON_SELECT_FROM_WORKSPACE); //$NON-NLS-1$
-		radioButton[0].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		radioButton[0].setSelection(true);
-		radioButton[0].addSelectionListener(this);
-
-		radioButton[1] = new Button(this, SWT.RADIO);
-		radioButton[1].setText(XMLUIMessages._UI_RADIO_BUTTON_SELECT_FROM_CATALOG); //$NON-NLS-1$
-		radioButton[1].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		radioButton[1].addSelectionListener(this);
-
-		pageBook = new PageBook(this, SWT.NONE);
-		pageBook.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-		selectSingleFileView = new MySelectSingleFileView(pageBook);
-
-		ICatalog xmlCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
-		selectXMLCatalogIdPanel = new SelectXMLCatalogIdPanel(pageBook, xmlCatalog);
-		selectXMLCatalogIdPanel.getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
-			public void selectionChanged(SelectionChangedEvent event) {
-				updateCompletionStateChange();
-			}
-		});
-		pageBook.showPage(selectSingleFileView.getControl());
-	}
-
-	public IFile getFile() {
-		IFile result = null;
-		if (radioButton[0].getSelection()) {
-			result = selectSingleFileView.getFile();
-		}
-		return result;
-	}
-
-	public ICatalogEntry getXMLCatalogEntry() {
-		ICatalogEntry result = null;
-		if (radioButton[1].getSelection()) {
-			result = selectXMLCatalogIdPanel.getXMLCatalogEntry();
-		}
-		return result;
-	}
-
-	public String getXMLCatalogId() {
-		String result = null;
-		if (radioButton[1].getSelection()) {
-			result = selectXMLCatalogIdPanel.getId();
-		}
-		return result;
-	}
-
-	public String getXMLCatalogURI() {
-		String result = null;
-		if (radioButton[1].getSelection()) {
-			result = selectXMLCatalogIdPanel.getURI();
-		}
-		return result;
-	}
-
-	public void setCatalogEntryType(int catalogEntryType) {
-		selectXMLCatalogIdPanel.setCatalogEntryType(catalogEntryType);
-	}
-
-	public void setFilterExtensions(String[] filterExtensions) {
-		selectSingleFileView.resetFilters();
-		selectSingleFileView.addFilterExtensions(filterExtensions);
-
-		selectXMLCatalogIdPanel.getTableViewer().setFilterExtensions(filterExtensions);
-	}
-
-	public void setListener(Listener listener) {
-		this.listener = listener;
-	}
-
-	public void setVisibleHelper(boolean isVisible) {
-		selectSingleFileView.setVisibleHelper(isVisible);
-	}
-
-	public void updateCompletionStateChange() {
-		if (listener != null) {
-			listener.completionStateChanged();
-		}
-	}
-
-	public void widgetDefaultSelected(SelectionEvent e) {
-	}
-
-	public void widgetSelected(SelectionEvent e) {
-		if (e.widget == radioButton[0]) {
-			pageBook.showPage(selectSingleFileView.getControl());
-		} else {
-			pageBook.showPage(selectXMLCatalogIdPanel);
-		}
-		updateCompletionStateChange();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdDialog.java
deleted file mode 100644
index 9bea443..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdDialog.java
+++ /dev/null
@@ -1,112 +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.ui.internal.dialogs;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-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.wst.xml.core.internal.XMLCorePlugin;
-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.ui.internal.util.XMLCommonUIContextIds;
-
-
-
-
-public class SelectXMLCatalogIdDialog extends Dialog {
-	protected String[] extensions;
-	protected Button okButton;
-	protected SelectXMLCatalogIdPanel panel;
-	protected String publicId;
-	protected String systemId;
-
-	public SelectXMLCatalogIdDialog(Shell parentShell, String[] extensions) {
-		super(parentShell);
-		setShellStyle(getShellStyle() | SWT.RESIZE);
-		this.extensions = extensions;
-	}
-
-
-	protected void buttonPressed(int buttonId) {
-		if (buttonId == IDialogConstants.OK_ID) {
-			ISelection selection = panel.getTableViewer().getSelection();
-			Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
-
-			if (selectedObject instanceof ICatalogEntry) {
-				ICatalogEntry mappingInfo = (ICatalogEntry) selectedObject;
-				publicId = mappingInfo.getKey();
-				systemId = computeDefaultSystemId(mappingInfo);
-			}
-		}
-		super.buttonPressed(buttonId);
-	}
-
-	protected String computeDefaultSystemId(ICatalogEntry mappingInfo) {
-		String result = mappingInfo.getAttributeValue(ICatalogEntry.ATTR_WEB_URL);
-		if (result == null && mappingInfo.getURI() != null) {
-			int index = mappingInfo.getURI().lastIndexOf("/"); //$NON-NLS-1$
-			String lastSegment = index != -1 ? mappingInfo.getURI().substring(index + 1) : mappingInfo.getURI();
-			result = lastSegment;
-		}
-		return result;
-	}
-
-	protected void createButtonsForButtonBar(Composite parent) {
-		okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-		okButton.setEnabled(false);
-		createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-	}
-
-	protected Control createDialogArea(Composite parent) {
-		Composite dialogArea = (Composite) super.createDialogArea(parent);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(dialogArea, XMLCommonUIContextIds.XCUI_CATALOG_DIALOG);
-
-		ICatalog xmlCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
-		panel = new SelectXMLCatalogIdPanel(dialogArea, xmlCatalog);
-
-		ISelectionChangedListener listener = new ISelectionChangedListener() {
-			public void selectionChanged(SelectionChangedEvent event) {
-				updateButtonState();
-			}
-		};
-		panel.getTableViewer().setFilterExtensions(extensions);
-		panel.getTableViewer().addSelectionChangedListener(listener);
-		return dialogArea;
-	}
-
-
-
-	public String getId() {
-		return publicId;
-	}
-
-	public String getSystemId() {
-		return systemId;
-	}
-
-	protected void updateButtonState() {
-		ISelection selection = panel.getTableViewer().getSelection();
-		okButton.setEnabled(!selection.isEmpty());
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdPanel.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdPanel.java
deleted file mode 100644
index 80ed9bd..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,150 +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.ui.internal.dialogs;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-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.Label;
-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.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-
-public class SelectXMLCatalogIdPanel extends Composite {
-	protected int catalogEntryType;
-	protected boolean doTableSizeHack = false;
-
-	protected XMLCatalogTableViewer tableViewer;
-	protected ICatalog fXmlCatalog;
-
-	public SelectXMLCatalogIdPanel(Composite parent, ICatalog xmlCatalog) {
-		super(parent, SWT.NONE);
-		this.fXmlCatalog = xmlCatalog;
-
-		GridLayout gridLayout = new GridLayout();
-		this.setLayout(gridLayout);
-		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.heightHint = 200;
-		gd.widthHint = 700;
-		this.setLayoutData(gd);
-
-		Label label = new Label(this, SWT.NONE);
-		label.setText(XMLUIMessages._UI_LABEL_XML_CATALOG_COLON); //$NON-NLS-1$
-
-		tableViewer = createTableViewer(this);
-		tableViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
-		tableViewer.setInput("dummy"); //$NON-NLS-1$
-	}
-
-	protected XMLCatalogTableViewer createTableViewer(Composite parent) {
-		String headings[] = new String[2];
-		headings[0] = XMLUIMessages._UI_LABEL_KEY; //$NON-NLS-1$
-		headings[1] = XMLUIMessages._UI_LABEL_URI; //$NON-NLS-1$
-
-		XMLCatalogTableViewer theTableViewer = new XMLCatalogTableViewer(parent, headings) {
-
-			protected void addXMLCatalogEntries(List list, ICatalogEntry[] entries) {
-				for (int i=0; i < entries.length; i++) {
-					ICatalogEntry entry = entries[i];
-					if (catalogEntryType == 0) {
-						list.add(entry);
-					} else if (catalogEntryType == entry.getEntryType()) {
-						list.add(entry);
-					}
-				}
-			}
-
-			public Collection getXMLCatalogEntries() {
-				List result = null;
-
-				if (fXmlCatalog == null || doTableSizeHack) {
-					// this lets us create a table with an initial height of
-					// 10 rows
-					// otherwise we get stuck with 0 row heigh table... that's
-					// too small
-					doTableSizeHack = false;
-					result = new Vector();
-					for (int i = 0; i < 6; i++) {
-						result.add(""); //$NON-NLS-1$
-					}
-				} else {
-					result = new Vector();
-					 INextCatalog[] nextCatalogs = fXmlCatalog.getNextCatalogs();
-				        for (int i = 0; i < nextCatalogs.length; i++)
-				        {
-				            INextCatalog catalog = nextCatalogs[i];
-				            ICatalog referencedCatalog = catalog.getReferencedCatalog();
-				            if (referencedCatalog != null)
-				            {
-				                if (XMLCorePlugin.SYSTEM_CATALOG_ID
-				                        .equals(referencedCatalog.getId()))
-				                {
-				                    ICatalog systemCatalog = referencedCatalog;
-				                    addXMLCatalogEntries(result, systemCatalog.getCatalogEntries());
-				                    
-				                } else if (XMLCorePlugin.USER_CATALOG_ID
-				                        .equals(referencedCatalog.getId()))
-				                {
-				                	ICatalog userCatalog = referencedCatalog;
-				                    addXMLCatalogEntries(result, userCatalog.getCatalogEntries());
-				   				 
-				                }
-				            }
-				        }
-				}
-				return result;
-			}
-		};
-		return theTableViewer;
-	}
-
-
-	public String getId() {
-		ICatalogEntry entry = getXMLCatalogEntry();
-		return entry != null ? entry.getKey() : null;
-	}
-
-	public XMLCatalogTableViewer getTableViewer() {
-		return tableViewer;
-	}
-
-	public String getURI() {
-		ICatalogEntry entry = getXMLCatalogEntry();
-		return entry != null ? entry.getURI() : null;
-	}
-
-	public ICatalogEntry getXMLCatalogEntry() {
-		ICatalogEntry result = null;
-		ISelection selection = tableViewer.getSelection();
-		Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
-		if (selectedObject instanceof ICatalogEntry) {
-			result = (ICatalogEntry) selectedObject;
-		}
-		return result;
-	}
-
-	public void setCatalogEntryType(int catalogEntryType) {
-		this.catalogEntryType = catalogEntryType;
-		tableViewer.refresh();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/UpdateListener.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/UpdateListener.java
deleted file mode 100644
index 37970cf..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/UpdateListener.java
+++ /dev/null
@@ -1,20 +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.ui.internal.dialogs;
-
-public interface UpdateListener {
-
-	public void updateOccured(Object object, Object arg);
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/XMLCatalogTableViewer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/XMLCatalogTableViewer.java
deleted file mode 100644
index b64b7b4..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/XMLCatalogTableViewer.java
+++ /dev/null
@@ -1,198 +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.ui.internal.dialogs;
-
-import java.text.Collator;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-
-public class XMLCatalogTableViewer extends TableViewer {
-
-
-	public class CatalogEntryContentProvider implements IStructuredContentProvider {
-
-		public void dispose() {
-		}
-
-		public Object[] getElements(Object element) {
-			Object[] array = getXMLCatalogEntries().toArray();
-			Comparator comparator = new Comparator() {
-				public int compare(Object o1, Object o2) {
-					int result = 0;
-					if (o1 instanceof ICatalogEntry && o2 instanceof ICatalogEntry) {
-						ICatalogEntry mappingInfo1 = (ICatalogEntry) o1;
-						ICatalogEntry mappingInfo2 = (ICatalogEntry) o2;
-						result = Collator.getInstance().compare(mappingInfo1.getKey(), mappingInfo2.getKey());
-					}
-					return result;
-				}
-			};
-			Arrays.sort(array, comparator);
-			return array;
-		}
-
-		public void inputChanged(Viewer viewer, Object old, Object newobj) {
-		}
-
-		public boolean isDeleted(Object object) {
-			return false;
-		}
-	}
-
-	public class CatalogEntryLabelProvider extends LabelProvider implements ITableLabelProvider {
-
-		public Image getColumnImage(Object object, int columnIndex) {
-			Image result = null;
-			if (columnIndex == 0) {
-				Image base = null;
-				if (object instanceof ICatalogEntry) {
-					ICatalogEntry catalogEntry = (ICatalogEntry) object;
-					String uri = catalogEntry.getURI();
-					if (uri.endsWith("dtd")) { //$NON-NLS-1$
-						base = dtdFileImage;
-					} else if (uri.endsWith("xsd")) { //$NON-NLS-1$
-						base = xsdFileImage;
-					} else {
-						base = unknownFileImage;
-					}
-
-					if (base != null) {
-						if (URIHelper.isReadableURI(uri, false)) {
-							result = base;
-						} else {
-							//TODO... SSE port
-							result = base;//imageFactory.createCompositeImage(base,
-							// errorImage,
-							// ImageFactory.BOTTOM_LEFT);
-						}
-					}
-				}
-			}
-			return result;
-		}
-
-		public String getColumnText(Object object, int columnIndex) {
-			String result = null;
-			if (object instanceof ICatalogEntry) {
-				ICatalogEntry catalogEntry = (ICatalogEntry) object;
-				result = columnIndex == 0 ? catalogEntry.getKey() : catalogEntry.getURI();
-				result = URIHelper.removePlatformResourceProtocol(result);
-			}
-			return result != null ? result : ""; //$NON-NLS-1$
-		}
-	}
-
-
-	class XMLCatalogTableViewerFilter extends ViewerFilter {
-		protected String[] extensions;
-
-		public XMLCatalogTableViewerFilter(String[] extensions) {
-			this.extensions = extensions;
-		}
-
-		public boolean isFilterProperty(Object element, Object property) {
-			return false;
-		}
-
-		public boolean select(Viewer viewer, Object parent, Object element) {
-			boolean result = false;
-			if (element instanceof ICatalogEntry) {
-				ICatalogEntry catalogEntry = (ICatalogEntry) element;
-				for (int i = 0; i < extensions.length; i++) {
-					if (catalogEntry.getURI().endsWith(extensions[i])) {
-						result = true;
-						break;
-					}
-				}
-			}
-			return result;
-		}
-	}
-
-	protected static Image dtdFileImage = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DTDFILE);
-
-	protected static String ERROR_STATE_KEY = "errorstatekey"; //$NON-NLS-1$
-	protected static Image errorImage = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OVR_ERROR);
-
-	protected static Image unknownFileImage = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TXTEXT);
-	protected static Image xsdFileImage = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_XSDFILE);
-
-	//protected ImageFactory imageFactory = new ImageFactory();
-
-	public XMLCatalogTableViewer(Composite parent, String[] columnProperties) {
-		super(parent, SWT.FULL_SELECTION);
-
-		Table table = getTable();
-		table.setLinesVisible(true);
-		table.setHeaderVisible(true);
-		table.setLinesVisible(true);
-
-		TableLayout layout = new TableLayout();
-		for (int i = 0; i < columnProperties.length; i++) {
-			TableColumn column = new TableColumn(table, i);
-			column.setText(columnProperties[i]);
-			column.setAlignment(SWT.LEFT);
-			layout.addColumnData(new ColumnWeightData(50, true));
-		}
-		table.setLayout(layout);
-		table.setLinesVisible(false);
-
-		setColumnProperties(columnProperties);
-
-		setContentProvider(new CatalogEntryContentProvider());
-		setLabelProvider(new CatalogEntryLabelProvider());
-	}
-
-	public Collection getXMLCatalogEntries() {
-		return null;
-	}
-
-
-	public void menuAboutToShow(IMenuManager menuManager) {
-		Action action = new Action("hello") { //$NON-NLS-1$
-			public void run() {
-				System.out.println("run!"); //$NON-NLS-1$
-			}
-		};
-		menuManager.add(action);
-	}
-
-	public void setFilterExtensions(String[] extensions) {
-		resetFilters();
-		addFilter(new XMLCatalogTableViewerFilter(extensions));
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java
deleted file mode 100644
index e24391f..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java
+++ /dev/null
@@ -1,265 +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.ui.internal.dnd;
-
-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.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class DragNodeCommand extends DefaultDragAndDropCommand {
-	private List fSelections;
-	private TreeViewer fTreeViewer;
-	
-	public DragNodeCommand(Object target, float location, int operations, int operation, Collection sources, TreeViewer treeViewer) {
-		super(target, location, operations, operation, sources);
-		fTreeViewer = treeViewer;
-		fSelections = new ArrayList();
-	}
-
-	private void beginModelChange(Node node, boolean batchUpdate) {
-		IStructuredModel structuredModel = getStructuredModel(node);
-		if (structuredModel != null) {
-			String undoDesc = new String();
-			if (getOperation() == DND.DROP_MOVE) {
-				undoDesc = XMLUIMessages.DragNodeCommand_0;
-			} else if (getOperation() == DND.DROP_COPY) {
-				undoDesc = XMLUIMessages.DragNodeCommand_1;
-			}
-			
-			structuredModel.beginRecording(this, undoDesc);
-			if (batchUpdate) {
-				//  structuredModel.aboutToChangeModel();
-			}
-		}
-	}
-
-	public boolean canExecute() {
-		return executeHelper(true);
-	}
-
-	private boolean doModify(Node source, Node parentNode, Node refChild, boolean testOnly) {
-		boolean result = false;
-		if (source.getNodeType() == Node.ATTRIBUTE_NODE) {
-			Attr sourceAttribute = (Attr) source;
-			Element sourceAttributeOwnerElement = sourceAttribute.getOwnerElement();
-			if (parentNode.getNodeType() == Node.ELEMENT_NODE && sourceAttributeOwnerElement != parentNode) {
-				result = true;
-				if (!testOnly) {
-					try {
-						if(getOperation() == DND.DROP_MOVE) {
-							Element targetElement = (Element) parentNode;
-							sourceAttributeOwnerElement.removeAttributeNode(sourceAttribute);
-							targetElement.getAttributes().setNamedItem(sourceAttribute);
-							fSelections.add(sourceAttribute);
-						}
-						else if (getOperation() == DND.DROP_COPY) {
-							Attr cloneAttribute = (Attr) sourceAttribute.cloneNode(false);						
-							Element targetElement = (Element) parentNode;
-							targetElement.getAttributes().setNamedItem(cloneAttribute);
-							fSelections.add(cloneAttribute);
-						}
-					}
-					catch (Exception e) {
-					}
-				}
-			}
-		}
-		else {
-			if ((parentNode.getNodeType() == Node.ELEMENT_NODE || parentNode.getNodeType() == Node.DOCUMENT_NODE) && 
-				!(refChild instanceof Attr)) {
-				result = true;
-
-				if (!testOnly) {
-					if (isAncestor(source, parentNode)) {
-						//System.out.println("can not perform this drag drop operation.... todo... pop up dialog");
-					}
-					else {
-						// defect 221055 this test is required or else the node will
-						// be removed from the tree and the insert will fail
-						if (source != refChild) {
-							if(getOperation() == DND.DROP_MOVE) {
-								source.getParentNode().removeChild(source);
-								parentNode.insertBefore(source, refChild);
-								fSelections.add(source);
-							}
-							else if (getOperation() == DND.DROP_COPY) {
-								Node nodeClone = source.cloneNode(true);
-								parentNode.insertBefore(nodeClone, refChild);
-								fSelections.add(nodeClone);
-							}
-						}
-					}
-				}
-			}
-		}
-		return result;
-	}
-	
-	private void endModelChange(Node node, boolean batchUpdate) {
-		IStructuredModel structuredModel = getStructuredModel(node);
-		if (structuredModel != null) {
-			structuredModel.endRecording(this);
-			if (batchUpdate) {
-				//  structuredModel.changedModel();
-			}
-		}
-	}
-
-	public void execute() {
-		executeHelper(false);
-		
-		// Make our selection if the treeViewer != null
-		if (fTreeViewer != null) {
-			StructuredSelection structuredSelection = new StructuredSelection(fSelections);
-			fTreeViewer.setSelection(structuredSelection);
-		}
-	}
-
-	private boolean executeHelper(boolean testOnly) {
-		boolean result = true;
-		if (target instanceof Node) {
-			Node targetNode = (Node) target;
-			Node parentNode = getParentForDropPosition(targetNode);
-			Node refChild = getRefChild(targetNode);
-
-			Vector sourcesList = new Vector();
-			sourcesList.addAll(sources);
-
-			removeMemberDescendants(sourcesList);
-			boolean performBatchUpdate = sourcesList.size() > 5;
-
-			if (!testOnly) {
-				beginModelChange(targetNode, performBatchUpdate);
-			}
-			for (Iterator i = sourcesList.iterator(); i.hasNext();) {
-				Object source = i.next();
-				if (source instanceof Node) {
-					if (!(refChild == null && targetNode instanceof Attr)) {
-						result = doModify((Node) source, parentNode, refChild, testOnly);
-					} else {
-						result = false;
-					}
-					if (!result) {
-						break;
-					}
-				}
-			}
-			if (!testOnly) {
-				endModelChange(targetNode, performBatchUpdate);
-			}
-		} else {
-			result = false;
-		}
-		return result;
-	}
-
-
-	public int getFeedback() {
-		int result = DND.FEEDBACK_SELECT;
-		if (location > 0.75) {
-			result = DND.FEEDBACK_INSERT_AFTER;
-		} else if (location < 0.25) {
-			result = DND.FEEDBACK_INSERT_BEFORE;
-		}
-		return result;
-	}
-
-	private Node getParentForDropPosition(Node node) {
-		Node result = null;
-
-		int feedback = getFeedback();
-		if (feedback == DND.FEEDBACK_SELECT) {
-			result = node;
-		} else {
-			result = getParentOrOwner(node);
-		}
-		return result;
-	}
-
-
-	private Node getParentOrOwner(Node node) {
-		return (node.getNodeType() == Node.ATTRIBUTE_NODE) ? ((Attr) node).getOwnerElement() : node.getParentNode();
-	}
-
-
-	private Node getRefChild(Node node) {
-		Node result = null;
-
-		int feedback = getFeedback();
-
-		if (feedback == DND.FEEDBACK_INSERT_BEFORE) {
-			result = node;
-		} else if (feedback == DND.FEEDBACK_INSERT_AFTER) {
-			result = node.getNextSibling();
-		}
-		return result;
-	}
-
-	private IStructuredModel getStructuredModel (Node node) {
-		IStructuredModel result = null;
-		if (node instanceof IDOMNode) {
-			result = ((IDOMNode) node).getModel();
-		}
-		return result;
-	}
-
-	// returns true if a is an ancestore of b
-	//
-	private boolean isAncestor(Node a, Node b) {
-		boolean result = false;
-		for (Node parent = b; parent != null; parent = parent.getParentNode()) {
-			if (parent == a) {
-				result = true;
-				break;
-			}
-		}
-		return result;
-	}
-
-
-	/**
-	 * This method removes members of the list that have ancestors that are
-	 * also members of the list.
-	 */
-	private void removeMemberDescendants(List list) {
-		Hashtable table = new Hashtable();
-		for (Iterator i = list.iterator(); i.hasNext();) {
-			Object node = i.next();
-			table.put(node, node);
-		}
-
-		for (int i = list.size() - 1; i >= 0; i--) {
-			Node node = (Node) list.get(i);
-			for (Node parent = getParentOrOwner(node); parent != null; parent = getParentOrOwner(parent)) {
-				if (table.get(parent) != null) {
-					list.remove(i);
-					break;
-				}
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/XMLDragAndDropManager.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/XMLDragAndDropManager.java
deleted file mode 100644
index aca6ee6..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/XMLDragAndDropManager.java
+++ /dev/null
@@ -1,54 +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.ui.internal.dnd;
-
-import java.util.Collection;
-
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.wst.common.ui.internal.dnd.DragAndDropCommand;
-import org.eclipse.wst.common.ui.internal.dnd.DragAndDropManager;
-import org.eclipse.wst.common.ui.internal.dnd.ObjectTransfer;
-import org.eclipse.wst.common.ui.internal.dnd.ViewerDragAdapter;
-import org.eclipse.wst.common.ui.internal.dnd.ViewerDropAdapter;
-import org.w3c.dom.Node;
-
-public class XMLDragAndDropManager implements DragAndDropManager {
-	private TreeViewer fViewer;
-	
-	public static void addDragAndDropSupport(TreeViewer viewer) {
-		int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
-		Transfer[] transfers = new Transfer[]{ObjectTransfer.getInstance()};
-		viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
-		viewer.addDropSupport(dndOperations, transfers, new ViewerDropAdapter(viewer, new XMLDragAndDropManager(viewer)));
-	}
-
-	public XMLDragAndDropManager() {
-		super();
-	}
-	
-	public XMLDragAndDropManager(TreeViewer viewer) {
-		fViewer = viewer;
-	}
-
-	public DragAndDropCommand createCommand(Object target, float location, int operations, int operation, Collection source) {
-		DragAndDropCommand result = null;
-		if (target instanceof Node) {
-			result = new DragNodeCommand(target, location, operations, operation, source, fViewer);
-		}
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java
deleted file mode 100644
index 645c98e..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java
+++ /dev/null
@@ -1,285 +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.ui.internal.doubleclick;
-
-import org.eclipse.jface.text.DefaultTextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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.StructuredTextViewer;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Node;
-
-
-public class XMLDoubleClickStrategy extends DefaultTextDoubleClickStrategy {
-	protected static final char DOUBLE_QUOTE = '\"';
-	protected static final char SINGLE_QUOTE = '\'';
-	protected static final char SPACE = ' ';
-	protected int fCaretPosition = -1;
-	protected int fDoubleClickCount = 0;
-	protected Node fNode = null;
-	protected IStructuredDocumentRegion fStructuredDocumentRegion = null;
-	protected String fStructuredDocumentRegionText = ""; //$NON-NLS-1$
-	protected IStructuredModel fStructuredModel = null;
-	protected StructuredTextViewer fStructuredTextViewer;
-	protected ITextRegion fTextRegion = null;
-
-	public void doubleClicked(ITextViewer textViewer) {
-		if (textViewer instanceof StructuredTextViewer) {
-			fStructuredTextViewer = (StructuredTextViewer) textViewer;
-			try {
-				fStructuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(fStructuredTextViewer.getDocument());
-
-				if (fStructuredModel != null) {
-					int caretPosition = textViewer.getSelectedRange().x;
-					if (caretPosition < 0)
-						return;
-
-					fNode = (Node) fStructuredModel.getIndexedRegion(caretPosition);
-					if (fNode == null)
-						return;
-
-					updateDoubleClickCount(caretPosition);
-					updateStructuredDocumentRegion();
-					updateTextRegion();
-
-					if (fNode.getNodeType() == Node.TEXT_NODE)
-						processTextDoubleClicked();
-					else
-						processElementDoubleClicked();
-				}
-			} finally {
-				if (fStructuredModel != null)
-					fStructuredModel.releaseFromRead();
-			}
-		}
-	}
-
-	protected Point getWord(String string, int cursor) {
-		if (string == null)
-			return null;
-
-		int wordStart = 0;
-		int wordEnd = string.length();
-
-		wordStart = string.lastIndexOf(SPACE, cursor - 1);
-		int temp = string.lastIndexOf(SINGLE_QUOTE, cursor - 1);
-		wordStart = Math.max(wordStart, temp);
-		temp = string.lastIndexOf(DOUBLE_QUOTE, cursor - 1);
-		wordStart = Math.max(wordStart, temp);
-		if (wordStart == -1)
-			wordStart = cursor;
-		else
-			wordStart++;
-
-		wordEnd = string.indexOf(SPACE, cursor);
-		if (wordEnd == -1)
-			wordEnd = string.length();
-		temp = string.indexOf(SINGLE_QUOTE, cursor);
-		if (temp == -1)
-			temp = string.length();
-		wordEnd = Math.min(wordEnd, temp);
-		temp = string.indexOf(DOUBLE_QUOTE, cursor);
-		if (temp == -1)
-			temp = string.length();
-		wordEnd = Math.min(wordEnd, temp);
-		if (wordEnd == string.length())
-			wordEnd = cursor;
-
-		if ((wordStart == wordEnd) && !isQuoted(string)) {
-			wordStart = 0;
-			wordEnd = string.length();
-		}
-
-		return new Point(wordStart, wordEnd);
-	}
-
-	protected 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 == SINGLE_QUOTE) && (lastChar == SINGLE_QUOTE)) || ((firstChar == DOUBLE_QUOTE) && (lastChar == DOUBLE_QUOTE)));
-	}
-
-	protected void processElementAttrEqualsDoubleClicked2Times() {
-		int prevRegionOffset = fStructuredDocumentRegion.getStartOffset(fTextRegion) - 1;
-		ITextRegion prevRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(prevRegionOffset);
-		int nextRegionOffset = fStructuredDocumentRegion.getEndOffset(fTextRegion);
-		ITextRegion nextRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(nextRegionOffset);
-
-		if ((prevRegion != null) && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) && (nextRegion != null) && (nextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
-			fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(prevRegion), nextRegion.getTextEnd() - prevRegion.getStart());
-		}
-	}
-
-	protected void processElementAttrNameDoubleClicked2Times() {
-		int nextRegionOffset = fStructuredDocumentRegion.getEndOffset(fTextRegion);
-		ITextRegion nextRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(nextRegionOffset);
-
-		if (nextRegion != null) {
-			nextRegionOffset = fStructuredDocumentRegion.getEndOffset(nextRegion);
-			nextRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(nextRegionOffset);
-			if ((nextRegion != null) && (nextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), nextRegion.getTextEnd() - fTextRegion.getStart());
-			} else {
-				// attribute has no value
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
-				fDoubleClickCount = 0;
-			}
-		}
-	}
-
-	protected void processElementAttrValueDoubleClicked() {
-		String regionText = fStructuredDocumentRegion.getText(fTextRegion);
-
-		if (fDoubleClickCount == 1) {
-			Point word = getWord(regionText, fCaretPosition - fStructuredDocumentRegion.getStartOffset(fTextRegion));
-			if (word.x == word.y) { // no word found; select whole region
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), regionText.length());
-				fDoubleClickCount++;
-			} else
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion) + word.x, word.y - word.x);
-		} else if (fDoubleClickCount == 2) {
-			if (isQuoted(regionText)) {
-				// ==> // Point word = getWord(regionText, fCaretPosition -
-				// fStructuredDocumentRegion.getStartOffset(fTextRegion));
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), regionText.length());
-			} else
-				processElementAttrValueDoubleClicked2Times();
-		} else if (fDoubleClickCount == 3) {
-			if (isQuoted(regionText))
-				processElementAttrValueDoubleClicked2Times();
-			else {
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
-				fDoubleClickCount = 0;
-			}
-		} else { // fDoubleClickCount == 4
-			fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
-			fDoubleClickCount = 0;
-		}
-	}
-
-	protected void processElementAttrValueDoubleClicked2Times() {
-		int prevRegionOffset = fStructuredDocumentRegion.getStartOffset(fTextRegion) - 1;
-		ITextRegion prevRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(prevRegionOffset);
-
-		if (prevRegion != null) {
-			prevRegionOffset = fStructuredDocumentRegion.getStartOffset(prevRegion) - 1;
-			prevRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(prevRegionOffset);
-			if ((prevRegion != null) && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)) {
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(prevRegion), fTextRegion.getTextEnd() - prevRegion.getStart());
-			}
-		}
-	}
-
-	protected void processElementDoubleClicked() {
-		if (fTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
-			processElementAttrValueDoubleClicked(); // special handling for
-		// XML_TAG_ATTRIBUTE_VALUE
-		else {
-			if (fDoubleClickCount == 1) {
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart() + fTextRegion.getStart(), fTextRegion.getTextLength());
-			} else if (fDoubleClickCount == 2) {
-				if (fTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
-					processElementAttrNameDoubleClicked2Times();
-				else if (fTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS)
-					processElementAttrEqualsDoubleClicked2Times();
-				else {
-					fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
-					fDoubleClickCount = 0;
-				}
-			} else { // fDoubleClickCount == 3
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
-				fDoubleClickCount = 0;
-			}
-		}
-	}
-
-	protected void processTextDoubleClicked() {
-		if (fDoubleClickCount == 1) {
-			super.doubleClicked(fStructuredTextViewer);
-
-			Point selectedRange = fStructuredTextViewer.getSelectedRange();
-			if ((selectedRange.x == fStructuredDocumentRegion.getStartOffset(fTextRegion)) && (selectedRange.y == fTextRegion.getTextLength()))
-				// only one word in region, skip one level of double click
-				// selection
-				fDoubleClickCount++;
-		} else if (fDoubleClickCount == 2) {
-			if (fTextRegion.getType() == DOMRegionContext.UNDEFINED) {
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
-				fDoubleClickCount = 0;
-			} else {
-				if (isQuoted(fStructuredDocumentRegion.getFullText(fTextRegion)))
-					fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion) + 1, fTextRegion.getTextLength() - 2);
-				else
-					fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), fTextRegion.getTextLength());
-			}
-		} else {
-			if ((fDoubleClickCount == 3) && isQuoted(fStructuredDocumentRegion.getFullText(fTextRegion)))
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), fTextRegion.getTextLength());
-			else {
-				if ((fDoubleClickCount == 3) && isQuoted(fStructuredDocumentRegionText))
-					fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart() + 1, fStructuredDocumentRegion.getLength() - 2);
-				else {
-					fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
-					fDoubleClickCount = 0;
-				}
-			}
-		}
-	}
-
-	public void setModel(IStructuredModel structuredModel) {
-		fStructuredModel = structuredModel;
-	}
-
-	protected void updateDoubleClickCount(int caretPosition) {
-		if (fCaretPosition == caretPosition) {
-			if (fStructuredDocumentRegion != null)
-				fDoubleClickCount++;
-			else
-				fDoubleClickCount = 1;
-		} else {
-			fCaretPosition = caretPosition;
-			fDoubleClickCount = 1;
-		}
-	}
-
-	protected void updateStructuredDocumentRegion() {
-		fStructuredDocumentRegion = fStructuredModel.getStructuredDocument().getRegionAtCharacterOffset(fCaretPosition);
-		if (fStructuredDocumentRegion != null)
-			fStructuredDocumentRegionText = fStructuredDocumentRegion.getText();
-		else
-			fStructuredDocumentRegionText = ""; //$NON-NLS-1$
-	}
-
-	protected void updateTextRegion() {
-		if (fStructuredDocumentRegion != null) {
-			fTextRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(fCaretPosition);
-			// if fTextRegion is null, it means we are at just past the last
-			// fStructuredDocumentRegion,
-			// at the very end of the document, so we'll use the last text
-			// region in the document
-			if (fTextRegion == null) {
-				fTextRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(fCaretPosition - 1);
-			}
-		} else
-			fTextRegion = null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/CMImageUtil.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/CMImageUtil.java
deleted file mode 100644
index c90bc44..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/CMImageUtil.java
+++ /dev/null
@@ -1,96 +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
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.editor;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-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.ui.internal.XMLUIPlugin;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author nsd
- */
-public class CMImageUtil {
-
-	public static CMNode getDeclaration(Node node) {
-		CMNode decl = null;
-		ModelQuery mq = null;
-		switch (node.getNodeType()) {
-		case Node.ATTRIBUTE_NODE: {
-			mq = ModelQueryUtil.getModelQuery(((Attr) node).getOwnerDocument());
-			decl = mq.getCMAttributeDeclaration((Attr) node);
-		}
-		case Node.ELEMENT_NODE: {
-			mq = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
-			decl = mq.getCMElementDeclaration((Element) node);
-		}
-		}
-		return decl;
-	}
-
-	public static Image getImage(CMNode cmnode) {
-		if (cmnode == null)
-			return null;
-		Image image = null;
-		ImageDescriptor descriptor = getImageDescriptor(cmnode);
-		if (descriptor != null) {
-			image = descriptor.createImage(false);
-		}
-		return image;
-	}
-
-	public static ImageDescriptor getImageDescriptor(CMNode cmnode) {
-		if (cmnode == null)
-			return null;
-		// cache CM-specified images with the XML UI plugin
-		String imageURLString = (String) cmnode.getProperty("small-icon"); //$NON-NLS-1$
-		ImageDescriptor descriptor = null;
-		if (imageURLString != null && imageURLString.length() > 0) {
-			descriptor = XMLUIPlugin.getInstance().getImageRegistry()
-					.getDescriptor(imageURLString);
-			if (descriptor == null) {
-				try {
-					URL imageURL = new URL(imageURLString);
-					URLConnection connection = imageURL.openConnection();
-					connection.setUseCaches(false);
-					ImageData data = new ImageData(connection.getInputStream());
-					descriptor = ImageDescriptor.createFromImageData(data);
-					XMLUIPlugin.getInstance().getImageRegistry().put(
-							imageURLString, descriptor);
-				} catch (MalformedURLException e) {
-					descriptor = null;
-				} catch (IOException e) {
-					descriptor = null;
-				}
-			}
-		}
-		return descriptor;
-	}
-
-	/**
-	 * 
-	 */
-	private CMImageUtil() {
-		super();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index 9fbec68..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,45 +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.ui.internal.editor;
-
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-/**
- * Help context ids for the XML Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- * 
- */
-public interface IHelpContextIds {
-	// org.eclipse.wst.xml.ui.
-	public static final String PREFIX = XMLUIPlugin.ID + "."; //$NON-NLS-1$
-
-	// figured out on the fly
-	// // XML Source page editor
-	// public static final String XML_SOURCEVIEW_HELPID =
-	// ContentTypeIdForXML.ContentTypeID_XML +"_source_HelpId"; //$NON-NLS-1$
-
-	// XML Files Preference page
-	public static final String XML_PREFWEBX_FILES_HELPID = PREFIX + "webx0060"; //$NON-NLS-1$
-	// XML Source Preference page
-	public static final String XML_PREFWEBX_SOURCE_HELPID = PREFIX + "webx0061"; //$NON-NLS-1$
-	// XML Styles Preference page
-	public static final String XML_PREFWEBX_STYLES_HELPID = PREFIX + "webx0062"; //$NON-NLS-1$
-	// XML Templates Preference page
-	public static final String XML_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0063"; //$NON-NLS-1$
-
-	// XML Cleanup dialog
-	public static final String CLEANUP_XML_HELPID = PREFIX + "xmlm1200"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImageHelper.java
deleted file mode 100644
index 32338df..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImageHelper.java
+++ /dev/null
@@ -1,155 +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.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.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-
-/**
- * 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 XMLEditorPluginImageHelper {
-	private static XMLEditorPluginImageHelper instance = null;
-
-	/**
-	 * Gets the instance.
-	 * 
-	 * @return Returns a XMLEditorPluginImageHelper
-	 */
-	public synchronized static XMLEditorPluginImageHelper getInstance() {
-		if (instance == null)
-			instance = new XMLEditorPluginImageHelper();
-		return instance;
-	}
-
-	//	 save a descriptor for each image
-	private HashMap fImageDescRegistry = null;
-	private final String PLUGINID = XMLUIPlugin.ID;
-
-	/**
-	 * 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;
-	}
-
-	/**
-	 * 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 JFaceResources.getImageRegistry();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImages.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImages.java
deleted file mode 100644
index fbb4ad7..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImages.java
+++ /dev/null
@@ -1,55 +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.ui.internal.editor;
-
-/**
- * Bundle of most images used by the XML Source Editor plug-in.
- */
-public class XMLEditorPluginImages {
-
-	public static final String IMG_DTOOL_CONSTRAINOFF = "icons/full/dtool16/constrainoff.gif"; //$NON-NLS-1$
-	public static final String IMG_DTOOL_CONSTRAINON = "icons/full/dtool16/constrainon.gif"; //$NON-NLS-1$
-	public static final String IMG_DTOOL_RLDGRMR = "icons/full/dtool16/rldgrmr.gif"; //$NON-NLS-1$
-	public static final String IMG_DTOOL_VALIDATE = "icons/full/dtool16/validate.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL_CONSTRAINOFF = "icons/full/etool16/constrainoff.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL_CONSTRAINON = "icons/full/etool16/constrainon.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL_RLDGRMR = "icons/full/etool16/rldgrmr.gif"; //$NON-NLS-1$
-	public static final String IMG_ETOOL_VALIDATE = "icons/full/etool16/validate.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_ADD_CORRECTION = "icons/full/obj16/add_correction.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_ATT_REQ_OBJ = "icons/full/obj16/att_req_obj.gif"; //$NON-NLS-1$
-
-	public static final String IMG_OBJ_ATTRIBUTE = "icons/full/obj16/attribute_obj.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_CDATASECTION = "icons/full/obj16/cdatasection.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_COMMENT = "icons/full/obj16/comment_obj.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_CORRECTION_CHANGE = "icons/full/obj16/correction_change.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_DOCTYPE = "icons/full/obj16/doctype.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_DTDFILE = "icons/full/obj16/dtdfile.gif"; //$NON-NLS-1$	
-	public static final String IMG_OBJ_ELEMENT = "icons/full/obj16/element_obj.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_ENTITY = "icons/full/obj16/entity.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_ENTITY_REFERENCE = "icons/full/obj16/entity_reference.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_ENUM = "icons/full/obj16/enum.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_LOCAL_VARIABLE = "icons/full/obj16/localvariable_obj.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_NOTATION = "icons/full/obj16/notation.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_PROCESSINGINSTRUCTION = "icons/full/obj16/proinst_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_GENERIC_DEEMPHASIZED = "icons/full/obj16/tag-generic-deemphasized.gif"; //$NON-NLS-1$    
-    public static final String IMG_OBJ_TAG_GENERIC_EMPHASIZED = "icons/full/obj16/tag-generic-emphasized.gif"; //$NON-NLS-1$        
-	public static final String IMG_OBJ_TAG_MACRO = "icons/full/obj16/tag-macro.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_TXTEXT = "icons/full/obj16/text.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_WARNING_OBJ = "icons/full/obj16/warning_obj.gif"; //$NON-NLS-1$
-	public static final String IMG_OBJ_XSDFILE = "icons/full/obj16/XSDFile.gif"; //$NON-NLS-1$
-
-	public static final String IMG_OVR_ERROR = "icons/full/ovr16/error_ovr.gif"; //$NON-NLS-1$
-	public static final String IMG_OVR_STALE_ERROR = "icons/full/ovr16/stale_error_ovr.gif"; //$NON-NLS-1$
-	public static final String IMG_OVR_WARN = "icons/full/ovr16/warn_ovr.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileEditorInput.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileEditorInput.java
deleted file mode 100644
index 18e86fb..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileEditorInput.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package org.eclipse.wst.xml.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.
-	 */
-	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.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java
deleted file mode 100644
index f96a072..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.eclipse.wst.xml.ui.internal.hyperlink;
-
-import java.io.File;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-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.xml.ui.internal.Logger;
-
-/**
- * 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() {
-		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.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java
deleted file mode 100644
index 23fe9cb..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.eclipse.wst.xml.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.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.xml.ui.internal.Logger;
-
-/**
- * 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() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
-	 */
-	public String getHyperlinkText() {
-		// 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).setHighlightRange(fHighlightRange.getOffset(), fHighlightRange.getLength(), true);
-				}
-			}
-			catch (PartInitException pie) {
-				Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
-			}
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java
deleted file mode 100644
index e4976bf..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java
+++ /dev/null
@@ -1,503 +0,0 @@
-package org.eclipse.wst.xml.ui.internal.hyperlink;
-
-import java.io.File;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-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.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.util.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;
-
-/**
- * Detects hyperlinks in XML tags. Includes detection in DOCTYPE and attribute
- * values. Resolves references to schemas, dtds, etc using the Common URI
- * Resolver.
- * 
- */
-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.jst.jsp.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 && file.exists()) {
-					// 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 = ++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.exists();
-		}
-		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.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesControl.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesControl.java
deleted file mode 100644
index e45bc98..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesControl.java
+++ /dev/null
@@ -1,265 +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.ui.internal.nsedit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-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.Label;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.dialogs.SelectFileOrXMLCatalogIdDialog;
-
-public class CommonAddNamespacesControl extends Composite implements SelectionListener {
-
-	class EditNamespaceControl extends Composite {
-		protected Button browseButton;
-		Text locationHintField;
-		Text prefixField;
-		Text uriField;
-
-		//protected NamespaceInfo info;
-
-		public EditNamespaceControl(Composite parent) {
-			super(parent, SWT.NONE); //BORDER);
-			setLayout(new GridLayout());
-			setLayoutData(new GridData(GridData.FILL_BOTH));
-
-			Label label = new Label(this, SWT.NONE);
-			label.setText(XMLUIMessages._UI_ENTER_REQ_PREFIX_AND_NAMESPACE); //$NON-NLS-1$
-
-			Composite composite = new Composite(this, SWT.NONE);
-			GridLayout layout = new GridLayout();
-			layout.numColumns = 3;
-			layout.marginWidth = 0;
-			layout.verticalSpacing = 1;
-			composite.setLayout(layout);
-
-			GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-			gd.widthHint = 350;
-			composite.setLayoutData(gd);
-
-			// row 1
-			//
-			Label prefixLabel = new Label(composite, SWT.NONE);
-			prefixLabel.setText(XMLUIMessages._UI_LABEL_PREFIX_COLON); //$NON-NLS-1$
-
-			prefixField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-			prefixField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-			//prefixField.setText(getDisplayValue(info.prefix));
-			//prefixField.addModifyListener(modifyListener);
-			//prefixField.setEnabled(info.getProperty("prefix-readOnly") ==
-			// null);
-			new Label(composite, SWT.NONE);
-
-			// row 2
-			//
-			Label uriLabel = new Label(composite, SWT.NONE);
-			uriLabel.setText(XMLUIMessages._UI_LABEL_NAMESPACE_NAME_COLON); //$NON-NLS-1$
-
-			uriField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-			uriField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-			//uriField.setText(getDisplayValue(info.uri));
-			//uriField.addModifyListener(modifyListener);
-			//uriField.setEnabled(info.getProperty("uri-readOnly") == null);
-
-			new Label(composite, SWT.NONE);
-
-			// row 3
-			//
-			Label locationHintLabel = new Label(composite, SWT.NONE);
-			locationHintLabel.setText(XMLUIMessages._UI_LABEL_LOCATION_HINT_COLON); //$NON-NLS-1$
-
-			locationHintField = new Text(composite, SWT.SINGLE | SWT.BORDER);
-			locationHintField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-			//locationHintField.setText(getDisplayValue(info.locationHint));
-			//locationHintField.addModifyListener(modifyListener);
-			//locationHintField.setEnabled(info.getProperty("locationHint-readOnly")
-			// == null);
-
-			SelectionListener selectionListener = new SelectionAdapter() {
-				public void widgetSelected(SelectionEvent e) {
-					performBrowse();
-				}
-			};
-
-			browseButton = new Button(composite, SWT.NONE);
-			browseButton.setText(XMLUIMessages._UI_LABEL_BROWSE); //$NON-NLS-1$
-			browseButton.addSelectionListener(selectionListener);
-			browseButton.setEnabled(locationHintField.getEnabled());
-		}
-
-		protected void performBrowse() {
-			String[] extensions = {".xsd"}; //$NON-NLS-1$
-			SelectFileOrXMLCatalogIdDialog dialog = new SelectFileOrXMLCatalogIdDialog(getShell(), extensions);
-			dialog.create();
-			dialog.getShell().setText(XMLUIMessages._UI_LABEL_SELECT_FILE); //$NON-NLS-1$
-			dialog.setBlockOnOpen(true);
-			dialog.open();
-
-			if (dialog.getReturnCode() == Window.OK) {
-				//String grammarURI = null;
-				IFile file = dialog.getFile();
-				String id = dialog.getId();
-				if (file != null) {
-					String uri = null;
-					if (resourceLocation != null) {
-						uri = URIHelper.getRelativeURI(file.getLocation(), resourceLocation);
-						//grammarURI = file.getLocation().toOSString();
-					} else {
-						uri = file.getLocation().toOSString();
-						//grammarURI = uri;
-					}
-					locationHintField.setText(uri);
-				} else if (id != null) {
-					locationHintField.setText(id);
-					//URIResolver resolver = 
-						URIResolverPlugin.createResolver();
-					//grammarURI = resolver.resolve(null, id, id);
-				}
-
-				try {
-					//TODO CMDocument document =
-					// CMDocumentBuilderRegistry.getInstance().buildCMDocument(grammarURI);
-					//				 List namespaceInfoList =
-					// (List)document.getProperty("http://org.eclipse.wst/cm/properties/namespaceInfo");
-					//				 NamespaceInfo info =
-					// (NamespaceInfo)namespaceInfoList.get(0);
-					//				 if (uriField.getText().trim().length() == 0 && info.uri
-					// != null)
-					//				 {
-					//					 uriField.setText(info.uri);
-					//				 }
-					//				 if (prefixField.getText().trim().length() == 0 &&
-					// info.prefix != null)
-					//				 {
-					//					 prefixField.setText(info.prefix);
-					//				 }
-				} catch (Exception e) {
-				}
-			}
-		}
-	}
-
-	protected Button deleteButton;
-	protected Button editButton;
-	protected EditNamespaceControl editNamespaceControl;
-	protected int heightHint = 250;
-	protected List namespaceInfoList = new ArrayList();
-	protected Button newButton;
-	protected PageBook pageBook;
-	protected Button radio1;
-	protected Button radio2;
-	protected IPath resourceLocation;
-	protected Composite tableSection;
-	protected CommonNamespaceInfoTable tableViewer;
-	protected int widthHint = 500;
-
-
-	public CommonAddNamespacesControl(Composite parent, int style, IPath resourceLocation) {
-		super(parent, style);
-		this.resourceLocation = resourceLocation;
-		GridData gd = new GridData(GridData.FILL_BOTH);
-		if (widthHint != -1) {
-			gd.widthHint = widthHint;
-		}
-		if (heightHint != -1) {
-			gd.heightHint = heightHint;
-		}
-		setLayoutData(gd);
-		setLayout(new GridLayout());
-
-		radio1 = new Button(this, SWT.RADIO);
-		radio1.setText(XMLUIMessages._UI_SELECT_REGISTERED_NAMESPACES); //$NON-NLS-1$
-		radio1.addSelectionListener(this);
-
-		radio2 = new Button(this, SWT.RADIO);
-		radio2.setText(XMLUIMessages._UI_SPECIFY_NEW_NAMESPACE); //$NON-NLS-1$
-		radio2.addSelectionListener(this);
-
-		Label separator = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL);
-		separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		//Group namespaceInfoGroup = new Group(this, SWT.NONE);
-		//namespaceInfoGroup.setText("Namespace Declarations");
-		// //XMLCommonUIPlugin.getInstance().getString("_UI_LABEL_XML_SCHEMA_INFORMATION"));
-		//namespaceInfoGroup.setLayout(new GridLayout(2, false));
-		//namespaceInfoGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
-		pageBook = new PageBook(this, SWT.NONE);
-		pageBook.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-		tableSection = new Composite(pageBook, SWT.NONE);
-		tableSection.setLayout(new GridLayout());
-		Label label = new Label(tableSection, SWT.NONE);
-		label.setText(XMLUIMessages._UI_SELECT_NAMESPACE_TO_ADD); //$NON-NLS-1$
-
-		tableViewer = new CommonNamespaceInfoTable(tableSection, SWT.CHECK, 6);
-		editNamespaceControl = new EditNamespaceControl(pageBook);
-		pageBook.showPage(tableSection);
-
-		tableViewer.setInput(namespaceInfoList);
-	}
-
-
-
-	public List getNamespaceInfoList() {
-		List list = new ArrayList();
-		if (radio1.getSelection()) {
-			TableItem[] items = tableViewer.getTable().getItems();
-			for (int i = 0; i < items.length; i++) {
-				TableItem item = items[i];
-				if (item.getChecked()) {
-					list.add(item.getData());
-				}
-			}
-		} else {
-			NamespaceInfo info = new NamespaceInfo();
-			info.prefix = editNamespaceControl.prefixField.getText();
-			info.uri = editNamespaceControl.uriField.getText();
-			info.locationHint = editNamespaceControl.locationHintField.getText();
-			list.add(info);
-		}
-		return list;
-	}
-
-	public void setNamespaceInfoList(List list) {
-		namespaceInfoList = list;
-		tableViewer.setInput(namespaceInfoList);
-	}
-
-	public void widgetDefaultSelected(SelectionEvent e) {
-	}
-
-	public void widgetSelected(SelectionEvent e) {
-		if (e.widget == radio1) {
-			pageBook.showPage(tableSection);
-		} else if (e.widget == radio2) {
-			pageBook.showPage(editNamespaceControl);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesDialog.java
deleted file mode 100644
index b084aea..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesDialog.java
+++ /dev/null
@@ -1,210 +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.ui.internal.nsedit;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-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.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-
-
-
-public class CommonAddNamespacesDialog extends Dialog {
-	protected CommonAddNamespacesControl addNamespacesControl;
-	protected List existingNamespaces;
-	protected List namespaceInfoList;
-	protected Button okButton;
-	protected HashMap preferredPrefixTable = new HashMap();
-	protected IPath resourceLocation;
-	protected String title;
-
-	public CommonAddNamespacesDialog(Shell parentShell, String title, IPath resourceLocation, List existingNamespaces) {
-		super(parentShell);
-		this.resourceLocation = resourceLocation;
-		setShellStyle(getShellStyle() | SWT.RESIZE);
-		this.title = title;
-		this.existingNamespaces = existingNamespaces;
-		preferredPrefixTable.put("http://schemas.xmlsoap.org/wsdl/", "wsdl"); //$NON-NLS-1$ //$NON-NLS-2$
-		preferredPrefixTable.put("http://schemas.xmlsoap.org/wsdl/soap/", "soap"); //$NON-NLS-1$ //$NON-NLS-2$
-		preferredPrefixTable.put("http://schemas.xmlsoap.org/wsdl/http/", "http"); //$NON-NLS-1$ //$NON-NLS-2$
-		preferredPrefixTable.put("http://schemas.xmlsoap.org/wsdl/mime/", "mime"); //$NON-NLS-1$ //$NON-NLS-2$
-		preferredPrefixTable.put("http://schemas.xmlsoap.org/soap/encoding/", "soapenc"); //$NON-NLS-1$ //$NON-NLS-2$
-		preferredPrefixTable.put("http://schemas.xmlsoap.org/soap/envelope/", "soapenv"); //$NON-NLS-1$ //$NON-NLS-2$
-		preferredPrefixTable.put("http://www.w3.org/2001/XMLSchema-instance", "xsi"); //$NON-NLS-1$ //$NON-NLS-2$
-		preferredPrefixTable.put("http://www.w3.org/2001/XMLSchema", "xsd"); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	protected void addBuiltInNamespaces(List list) {
-		String xsiNamespace = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
-		String xsdNamespace = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$
-		if (!isAlreadyDeclared(xsiNamespace)) {
-			list.add(new NamespaceInfo("http://www.w3.org/2001/XMLSchema-instance", "xsi", null)); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		if (!isAlreadyDeclared(xsdNamespace)) {
-			list.add(new NamespaceInfo("http://www.w3.org/2001/XMLSchema", "xsd", null)); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-
-	protected void addCatalogMapToList(ICatalog catalog, List list) {
-		ICatalogEntry[] entries = catalog.getCatalogEntries();
-		for ( int i = 0; i < entries.length; i++) {
-			ICatalogEntry entry = entries[i];
-			if (entry.getEntryType() == ICatalogEntry.ENTRY_TYPE_PUBLIC && entry.getURI().endsWith(".xsd")) { //$NON-NLS-1$
-				if (!isAlreadyDeclared(entry.getKey())) {
-					NamespaceInfo namespaceInfo = new NamespaceInfo(entry.getKey(), "xx", null); //$NON-NLS-1$
-					list.add(namespaceInfo);
-				}
-			}
-		}
-	}
-
-	protected void buttonPressed(int buttonId) {
-		if (buttonId == IDialogConstants.OK_ID) {
-			namespaceInfoList = addNamespacesControl.getNamespaceInfoList();
-		}
-		super.buttonPressed(buttonId);
-	}
-
-	public void computeAddablePrefixes(List addableList, List exisitingList) {
-		HashMap map = new HashMap();
-		for (Iterator i = exisitingList.iterator(); i.hasNext();) {
-			NamespaceInfo info = (NamespaceInfo) i.next();
-			if (info.prefix != null) {
-				map.put(info.prefix, info);
-			}
-		}
-		for (Iterator i = addableList.iterator(); i.hasNext();) {
-			NamespaceInfo info = (NamespaceInfo) i.next();
-			if (info.uri != null) {
-				String prefix = (String) preferredPrefixTable.get(info.uri);
-				info.prefix = getUniquePrefix(map, prefix, info.uri);
-				map.put(info.prefix, info);
-			}
-		}
-	}
-
-	public int createAndOpen() {
-		create();
-		getShell().setText(title);
-		Rectangle r = getShell().getBounds();
-		getShell().setBounds(r.x + 80, r.y + 80, r.width, r.height);
-		setBlockOnOpen(true);
-		return open();
-	}
-
-	protected void createButtonsForButtonBar(Composite parent) {
-		okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-		createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-	}
-
-	protected Control createContents(Composite parent) {
-		Control control = super.createContents(parent);
-		return control;
-	}
-
-
-
-	protected Control createDialogArea(Composite parent) {
-		Composite dialogArea = (Composite) super.createDialogArea(parent);
-		addNamespacesControl = new CommonAddNamespacesControl(dialogArea, SWT.NONE, resourceLocation);
-		List list = new ArrayList();
-
-		addBuiltInNamespaces(list);
-		ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
-		INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
-        for (int i = 0; i < nextCatalogs.length; i++)
-        {
-            INextCatalog catalog = nextCatalogs[i];
-            ICatalog referencedCatalog = catalog.getReferencedCatalog();
-            if (referencedCatalog != null)
-            {
-                if (XMLCorePlugin.USER_CATALOG_ID
-                        .equals(referencedCatalog.getId()))
-                {
-                	ICatalog userCatalog = referencedCatalog;
-                	addCatalogMapToList(userCatalog, list);
-
-                } else if (XMLCorePlugin.SYSTEM_CATALOG_ID
-                        .equals(referencedCatalog.getId()))
-                {
-                	ICatalog systemCatalog = referencedCatalog;
-            		addCatalogMapToList(systemCatalog, list);
-                }
-            }
-        }
-	
-		computeAddablePrefixes(list, existingNamespaces);
-
-		addNamespacesControl.setNamespaceInfoList(list);
-		return dialogArea;
-	}
-
-	public List getNamespaceInfoList() {
-		return namespaceInfoList;
-	}
-
-	protected String getPreferredPrefix(String namespaceURI) {
-		return (String) preferredPrefixTable.get(namespaceURI);
-	}
-
-	private String getUniquePrefix(HashMap prefixMap, String prefix, String uri) {
-		if (prefix == null) {
-			int lastIndex = uri.lastIndexOf('/');
-			if (lastIndex == uri.length() - 1) {
-				uri = uri.substring(0, lastIndex);
-				lastIndex = uri.lastIndexOf('/');
-			}
-			prefix = uri.substring(lastIndex + 1);
-			if (prefix.length() > 20 || prefix.indexOf(':') != -1) {
-				prefix = null;
-			}
-		}
-		if (prefix == null) {
-			prefix = "p"; //$NON-NLS-1$
-		}
-		if (prefixMap.get(prefix) != null) {
-			String base = prefix;
-			for (int count = 0; prefixMap.get(prefix) != null; count++) {
-				prefix = base + count;
-			}
-		}
-		return prefix;
-	}
-
-	protected boolean isAlreadyDeclared(String namespaceURI) {
-		boolean result = false;
-		for (Iterator i = existingNamespaces.iterator(); i.hasNext();) {
-			NamespaceInfo namespaceInfo = (NamespaceInfo) i.next();
-			if (namespaceURI.equals(namespaceInfo.uri)) {
-				result = true;
-				break;
-			}
-		}
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesDialog.java
deleted file mode 100644
index dc0d9c3..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesDialog.java
+++ /dev/null
@@ -1,319 +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.ui.internal.nsedit;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-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.graphics.Color;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditNamespaceInfoDialog;
-import org.eclipse.wst.xml.ui.internal.dialogs.NamespaceInfoErrorHelper;
-
-public class CommonEditNamespacesDialog {
-	protected Composite commonComposite;
-	protected Button deleteButton;
-	protected Button editButton;
-
-	protected Label errorMessageLabel;
-	protected int heightHint = 250;
-	protected List namespaceInfoList = new ArrayList();
-
-	protected Button newButton;
-	protected IPath resourceLocation;
-
-	private boolean showLocationText = false;
-	protected String tableLabel = ""; //$NON-NLS-1$
-	protected CommonNamespaceInfoTable tableViewer;
-
-	protected Composite topComposite;
-	protected boolean useGroup;
-	protected int widthHint = 500;
-
-	public CommonEditNamespacesDialog(Composite parent, IPath resourceLocation, String stringTableLabel) {
-		this(parent, resourceLocation, stringTableLabel, false, false);
-	}
-
-	public CommonEditNamespacesDialog(Composite parent, IPath resourceLocation, String stringTableLabel, boolean useGroup, boolean showLocText) {
-		this.resourceLocation = resourceLocation;
-		tableLabel = stringTableLabel;
-		this.useGroup = useGroup;
-		showLocationText = showLocText;
-
-		GridData gd = new GridData(GridData.FILL_BOTH);
-		if (widthHint != -1) {
-			gd.widthHint = widthHint;
-		}
-		if (heightHint != -1) {
-			gd.heightHint = heightHint;
-		}
-
-		// Set GridData and GridLayout for the parent Composite
-		parent.setLayoutData(gd);
-		parent.setLayout(new GridLayout());
-
-		// Create the top Composite
-		topComposite = new Composite(parent, SWT.NONE);
-		GridData topData = new GridData(GridData.FILL_HORIZONTAL);
-		topData.heightHint = 0;
-		topComposite.setLayoutData(topData);
-		topComposite.setLayout(new GridLayout());
-
-		// Create the 'common'/middle Composite
-		if (useGroup) {
-			commonComposite = new Group(parent, SWT.NONE);
-		} else {
-			commonComposite = new Composite(parent, SWT.NONE);
-		}
-		commonComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-		commonComposite.setLayout(new GridLayout(3, false));
-
-		// Add the error Message Label
-		errorMessageLabel = new Label(parent, SWT.NONE);
-		errorMessageLabel.setLayoutData(createHorizontalFill());
-		Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
-		errorMessageLabel.setForeground(color);
-
-		createControlArea();
-	}
-
-
-	protected void createButtons(Composite parent) {
-		Composite composite = new Composite(parent, SWT.NONE);
-		composite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-		GridLayout gridLayout = new GridLayout();
-		gridLayout.numColumns = 1;
-		gridLayout.marginHeight = 0;
-		gridLayout.marginWidth = 0;
-		composite.setLayout(gridLayout);
-
-		SelectionListener selectionListener = new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				if (e.widget == newButton) {
-					performNew();
-				} else if (e.widget == editButton) {
-					performEdit();
-				} else if (e.widget == deleteButton) {
-					performDelete();
-				}
-			}
-		};
-
-		// create a composite to hold the three buttons
-		Composite buttonComposite = new Composite(composite, SWT.NONE);
-		buttonComposite.setLayoutData(createHorizontalFill());
-		GridLayout buttonGridLayout = new GridLayout();
-		//buttonGridLayout.numColumns = 3;
-		//buttonGridLayout.makeColumnsEqualWidth = true;
-		buttonComposite.setLayout(buttonGridLayout);
-
-		// add the New button
-		//
-		newButton = new Button(buttonComposite, SWT.NONE);
-		//newButton.setText(" " +
-		// XMLCommonUIPlugin.getInstance().getString("_UI_BUTTON_NEW") + " ");
-		newButton.setText("   " + XMLUIMessages.CommonEditNamespacesDialog_0 + "   "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		newButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); //ViewUtility.createHorizontalFill());
-		newButton.addSelectionListener(selectionListener);
-
-		// add the Edit button
-		//
-		//gd = new GridData();
-		//gd.horizontalAlignment = gd.FILL;
-		//gd.grabExcessHorizontalSpace = true;
-
-		editButton = new Button(buttonComposite, SWT.NONE);
-		editButton.setText(XMLUIMessages._UI_BUTTON_EDIT); //$NON-NLS-1$
-		editButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); //ViewUtility.createHorizontalFill());
-		editButton.addSelectionListener(selectionListener);
-
-		// add the Delete button
-		//
-		//gd = new GridData();
-		//gd.horizontalAlignment = gd.FILL;
-		//gd.grabExcessHorizontalSpace = true;
-
-		deleteButton = new Button(buttonComposite, SWT.NONE);
-		deleteButton.setText(XMLUIMessages._UI_BUTTON_DELETE); //$NON-NLS-1$
-		deleteButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); //ViewUtility.createHorizontalFill());
-		deleteButton.addSelectionListener(selectionListener);
-	}
-
-	private void createControlArea() {
-		if (useGroup) {
-			((Group) commonComposite).setText(tableLabel);
-		} else {
-			Label label = new Label(commonComposite, SWT.NONE);
-			label.setText(tableLabel);
-			label.setLayoutData(createGridData(false, 3));
-		}
-
-		tableViewer = new CommonNamespaceInfoTable(commonComposite, 6, showLocationText);
-		tableViewer.getControl().setLayoutData(createGridData(true, 2));
-		createButtons(commonComposite);
-
-		tableViewer.setInput(namespaceInfoList);
-		updateButtonEnabledState();
-		ISelectionChangedListener selectionChangedListener = new ISelectionChangedListener() {
-			public void selectionChanged(SelectionChangedEvent event) {
-				updateButtonEnabledState();
-			}
-		};
-		tableViewer.addSelectionChangedListener(selectionChangedListener);
-	}
-
-	protected GridData createGridData(boolean both, int span) {
-		GridData gd = new GridData(both ? GridData.FILL_BOTH : GridData.FILL_HORIZONTAL);
-		gd.horizontalSpan = 2;
-		return gd;
-	}
-
-	private GridData createHorizontalFill() {
-		GridData gd = new GridData();
-		gd.horizontalAlignment = GridData.FILL;
-		gd.grabExcessHorizontalSpace = true;
-		return gd;
-	}
-
-
-
-	public NamespaceInfo getNamespaceInfo(String namespace) {
-		NamespaceInfo result = null;
-		for (Iterator i = namespaceInfoList.iterator(); i.hasNext();) {
-			NamespaceInfo info = (NamespaceInfo) i.next();
-			if (info.uri != null && info.uri.equals(namespace)) {
-				result = info;
-				break;
-			}
-		}
-		return result;
-	}
-
-	protected Object getSelection(ISelection selection) {
-		if (selection == null) {
-			return null;
-		} // end of if ()
-
-		Object result = null;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection es = (IStructuredSelection) selection;
-			Iterator i = es.iterator();
-			if (i.hasNext()) {
-				result = i.next();
-			}
-		}
-		return result;
-	}
-
-	/*
-	 * Use the returned Composite to add content above the 'common contents'.
-	 * Note: The GridData for the returned Composite has a heightHint = 0.
-	 * This means when using the returned Composite, the GridData must be
-	 * reset, else the Composite and it's contents will not appear.
-	 */
-	protected Composite getTopComposite() {
-		return topComposite;
-	}
-
-	protected EditNamespaceInfoDialog invokeDialog(String title, NamespaceInfo info) {
-		Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-		EditNamespaceInfoDialog dialog = new EditNamespaceInfoDialog(shell, info);
-		dialog.create();
-		dialog.getShell().setText(title);
-		dialog.setBlockOnOpen(true);
-		dialog.setResourceLocation(resourceLocation);
-		dialog.open();
-		return dialog;
-	}
-
-	protected void performDelayedUpdate() {
-		tableViewer.refresh();
-		/*
-		 * Runnable delayedUpdate = new Runnable() { public void run() {
-		 * tableViewer.refresh(); } };
-		 * Display.getCurrent().asyncExec(delayedUpdate);
-		 */
-		//if (updateListener != null)
-		//{
-		//  updateListener.updateOccured(this, namespaceInfoList);
-		//}
-	}
-
-	public void performDelete() {
-		ISelection selection = tableViewer.getSelection();
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			namespaceInfoList.removeAll(structuredSelection.toList());
-			updateErrorMessage(namespaceInfoList);
-			performDelayedUpdate();
-		}
-	}
-
-	public void performEdit() {
-		Object selection = getSelection(tableViewer.getSelection());
-		if (selection != null) {
-			invokeDialog(XMLUIMessages._UI_LABEL_NEW_NAMESPACE_INFORMATION, (NamespaceInfo) selection); //$NON-NLS-1$
-			updateErrorMessage(namespaceInfoList);
-			performDelayedUpdate();
-		}
-	}
-
-	public void performNew() {
-		Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-		CommonAddNamespacesDialog dialog = new CommonAddNamespacesDialog(shell, XMLUIMessages._UI_ADD_NAMESPACE_DECLARATIONS, resourceLocation, namespaceInfoList); //$NON-NLS-1$
-		dialog.createAndOpen();
-		if (dialog.getReturnCode() == Window.OK) {
-			namespaceInfoList.addAll(dialog.getNamespaceInfoList());
-			updateErrorMessage(namespaceInfoList);
-			performDelayedUpdate();
-		}
-	}
-
-	public void setNamespaceInfoList(List list) {
-		namespaceInfoList = list;
-		tableViewer.setInput(namespaceInfoList);
-	}
-
-	public void updateButtonEnabledState() {
-		Object selection = getSelection(tableViewer.getSelection());
-		NamespaceInfo info = (NamespaceInfo) selection;
-		editButton.setEnabled(info != null);
-		deleteButton.setEnabled(info != null && info.getProperty("unremovable") == null); //$NON-NLS-1$
-	}
-
-	public void updateErrorMessage(List namespaceInfoList) {
-		NamespaceInfoErrorHelper helper = new NamespaceInfoErrorHelper();
-		String errorMessage = helper.computeErrorMessage(namespaceInfoList, null);
-		errorMessageLabel.setText(errorMessage != null ? errorMessage : ""); //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesTargetFieldDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesTargetFieldDialog.java
deleted file mode 100644
index fbae406..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesTargetFieldDialog.java
+++ /dev/null
@@ -1,104 +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.ui.internal.nsedit;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/*
- * This class is an extension of CommonEditNamespacesDialog. This class adds
- * the target namespaces dialog field.
- */
-public class CommonEditNamespacesTargetFieldDialog extends CommonEditNamespacesDialog {
-
-	class TargetNamespaceModifyListener implements ModifyListener {
-		public void modifyText(ModifyEvent e) {
-			String oldTargetNamespace = targetNamespace;
-			targetNamespace = targetNamespaceField.getText();
-			updateTargetNamespaceAndNamespaceInfo(oldTargetNamespace, targetNamespace);
-		}
-	}
-
-	protected String targetNamespace;
-	protected Text targetNamespaceField;
-
-	public CommonEditNamespacesTargetFieldDialog(Composite parent, IPath resourceLocation1) {
-		super(parent, resourceLocation1, XMLUIMessages._UI_NAMESPACE_DECLARATIONS); //$NON-NLS-1$
-
-		Composite targetComp = getTopComposite();
-		targetComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-		GridData gd = new GridData(GridData.FILL_BOTH);
-		Label targetNamespaceLabel = new Label(targetComp, SWT.NONE);
-		targetNamespaceLabel.setLayoutData(gd);
-		targetNamespaceLabel.setText(XMLUIMessages._UI_TARGET_NAMESPACE); //$NON-NLS-1$
-
-		targetNamespaceField = new Text(targetComp, SWT.BORDER);
-		targetNamespaceField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		targetNamespaceField.addModifyListener(new TargetNamespaceModifyListener());
-
-		// createControlArea();
-	}
-
-	public String getTargetNamespace() {
-		return targetNamespace;
-	}
-
-	public void performEdit() {
-		Object selection = getSelection(tableViewer.getSelection());
-		if (selection != null) {
-			boolean editTargetNamespace = false;
-			NamespaceInfo nsInfo = (NamespaceInfo) selection;
-			if (getTargetNamespace().equals(nsInfo.uri)) {
-				editTargetNamespace = true;
-			}
-
-			invokeDialog(XMLUIMessages._UI_LABEL_NEW_NAMESPACE_INFORMATION, nsInfo); //$NON-NLS-1$
-			updateErrorMessage(namespaceInfoList);
-			performDelayedUpdate();
-
-			if (editTargetNamespace) {
-				targetNamespaceField.setText(nsInfo.uri);
-			}
-		}
-	}
-
-	public void setTargetNamespace(String theTargetNamespace) {
-		targetNamespace = theTargetNamespace != null ? theTargetNamespace : ""; //$NON-NLS-1$
-		targetNamespaceField.setText(targetNamespace);
-		// updateTargetNamespaceAndNamespaceInfo(targetNamespace);
-	}
-
-	void updateTargetNamespaceAndNamespaceInfo(String oldTargetNamespace, String newTargetNamespace) {
-		NamespaceInfo info = getNamespaceInfo(newTargetNamespace);
-		if (info == null) {
-			info = getNamespaceInfo(oldTargetNamespace);
-			if (info == null) {
-				info = new NamespaceInfo(newTargetNamespace, "tns", null); //$NON-NLS-1$
-				namespaceInfoList.add(info);
-			}
-			else {
-				info.uri = targetNamespace;
-			}
-		}
-		tableViewer.refresh();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonNamespaceInfoTable.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonNamespaceInfoTable.java
deleted file mode 100644
index ebb373a..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonNamespaceInfoTable.java
+++ /dev/null
@@ -1,340 +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.ui.internal.nsedit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class CommonNamespaceInfoTable extends TableViewer {
-
-	/**
-	 * NamespaceInfoTableLabelProvider
-	 */
-	protected class Provider extends LabelProvider implements ITableLabelProvider, IStructuredContentProvider {
-		Viewer viewer;
-
-		public Image getColumnImage(Object object, int columnIndex) {
-			Image result = null;
-			int columnCode = getColumnCode(columnIndex);
-			if (columnCode == COLUMN_LOCATION_HINT) {
-				NamespaceInfo info = (NamespaceInfo) object;
-				if (info.locationHint == null || info.locationHint.trim().equals("")) { //$NON-NLS-1$
-					// Comment this out until we solve the alignment/(space
-					// for image being allocated
-					// to prefix column) ......
-					//          result =
-					// XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_WARNING_OBJ);
-				}
-			}
-
-			return result;
-		}
-
-		public String getColumnText(Object object, int column) {
-			NamespaceInfo info = (NamespaceInfo) object;
-			String result = null;
-			int columnCode = getColumnCode(column);
-			switch (columnCode) {
-				case COLUMN_PREFIX : {
-					result = info.prefix;
-					break;
-				}
-				case COLUMN_NAMESPACE_URI : {
-					result = info.uri;
-					break;
-				}
-				case COLUMN_CHECKBOX : {
-					result = ""; //info.locationHint; //$NON-NLS-1$
-					break;
-				}
-				case COLUMN_LOCATION_HINT : {
-					result = info.locationHint;
-					break;
-				}
-			}
-			result = result != null ? result : ""; //$NON-NLS-1$
-			if (result.equals("")) { //$NON-NLS-1$
-				switch (columnCode) {
-					case COLUMN_PREFIX : {
-						result = XMLUIMessages._UI_NO_PREFIX; //$NON-NLS-1$
-						break;
-					}
-					case COLUMN_NAMESPACE_URI : {
-						result = XMLUIMessages._UI_NO_NAMESPACE_NAME; //$NON-NLS-1$
-						break;
-					}
-				}
-			}
-			return result;
-		}
-
-		public Object[] getElements(Object inputElement) {
-			List list = (List) viewer.getInput();
-			return list != null ? list.toArray() : null;
-		}
-
-		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-			this.viewer = viewer;
-		}
-	}
-
-	class TableItemChecker extends MouseAdapter {
-		public void mouseDown(MouseEvent e) {
-			TableItem item = getTable().getItem(new Point(e.x, e.y));
-			if (item != null) {
-				Object obj = item.getData();
-				if (obj != null) {
-					NamespaceInfo info = (NamespaceInfo) obj;
-					TableColumn col = getTable().getColumn(0);
-					if (e.x < col.getWidth()) // if the point falls within the
-					// Select column then perform
-					// check/uncheck
-					{
-						String currentState = (String) info.getProperty("checked"); //$NON-NLS-1$
-						System.out.println("currentState" + currentState); //$NON-NLS-1$
-						if (currentState == null || currentState.equals("false")) //$NON-NLS-1$
-						{
-							info.setProperty("checked", "true"); //$NON-NLS-1$ //$NON-NLS-2$
-						} else {
-							info.setProperty("checked", "false"); //$NON-NLS-1$ //$NON-NLS-2$
-						}
-						refresh();
-					}
-				}
-			}
-		}
-	}
-
-	protected static final int COLUMN_CHECKBOX = 1;
-	protected static final int COLUMN_LOCATION_HINT = 4;
-	protected static final int COLUMN_NAMESPACE_URI = 2;
-	protected static final int COLUMN_PREFIX = 3;
-
-	protected static final String LABEL_CHECKBOX = ""; //$NON-NLS-1$
-	protected static final String LABEL_LOCATION_HINT = XMLUIMessages._UI_LABEL_LOCATION_HINT; //$NON-NLS-1$
-	protected static final String LABEL_NAMESPACE_URI = XMLUIMessages._UI_LABEL_NAMESPACE_NAME; //$NON-NLS-1$
-	protected static final String LABEL_PREFIX = XMLUIMessages._UI_LABEL_PREFIX; //$NON-NLS-1$
-	protected List checkedList = new ArrayList();
-
-	//protected List namespaceInfoList = new ArrayList();
-	protected int[] columnIndexMap;
-	protected boolean showCheckBoxes = true;
-	private boolean showLocationText = false;
-
-	private Table table;
-	protected int visibleRows = -1;
-
-	public CommonNamespaceInfoTable(Composite parent, int visibleRows) {
-		this(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER, visibleRows, false);
-	}
-
-	//protected CellEditor getCellEditor(int column)
-	// {
-	//  return (column == COLUMN_CHECKBOX) ? checkBoxCellEditor :
-	// textCellEditor;
-	// }
-
-	public CommonNamespaceInfoTable(Composite parent, int visibleRows, boolean showLocationText) {
-		this(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER, visibleRows, showLocationText);
-	}
-
-	public CommonNamespaceInfoTable(Composite parent, int style, int visibleRows) {
-		this(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER | style, visibleRows, false);
-	}
-
-	public CommonNamespaceInfoTable(Composite parent, int style, int visibleRows, boolean showLocationText) {
-		super(new Table(parent, style));
-		getTable().setLinesVisible(true);
-		this.showCheckBoxes = (style & SWT.CHECK) != 0;
-		columnIndexMap = createColumnIndexMap();
-		this.showLocationText = showLocationText;
-
-		Provider provider = new Provider();
-		setContentProvider(provider);
-		setLabelProvider(provider);
-
-		String[] columnPropertiesArray = createColumnPropertiesArray();
-		setColumnProperties(columnPropertiesArray);
-
-		table = getTable();
-		table.setHeaderVisible(true);
-		table.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-		TableLayout layout = new TableLayout();
-
-		for (int i = 0; i < columnPropertiesArray.length; i++) {
-			TableColumn column = new TableColumn(table, i);
-			if ((columnPropertiesArray[i]).equals(LABEL_LOCATION_HINT)) {
-				if (showLocationText) {
-					column.setText(columnPropertiesArray[i]);
-				} else {
-					// Comment this out until we solve the alignment/(space
-					// for image being allocated
-					// to prefix column) ......
-					//          	column.setImage(XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TXTEXT));
-				}
-			} else {
-				column.setText(columnPropertiesArray[i]);
-			}
-			column.setAlignment(SWT.LEFT);
-			layout.addColumnData(new ColumnWeightData(getColumnWidth(i), true));
-		}
-		table.setLayout(layout);
-
-		this.visibleRows = visibleRows;
-		//for (int i = 0; i < visibleRows; i++)
-		// {
-		//  TableItem item = new TableItem(table, SWT.NONE);
-		//  item.setText("#######");
-		//}
-		//checkBoxCellEditor = new NamespaceInfoCheckboxCellEditor(table);
-		//textCellEditor = new TextCellEditor(table);
-
-		/*
-		 * CellEditor[] cellEditors = new
-		 * CellEditor[columnPropertiesArray.length]; for (int i = 0; i <
-		 * columnPropertiesArray.length; i++) { cellEditors[i] =
-		 * getCellEditor(i); } setCellEditors(cellEditors);
-		 */
-		//if (showCheckBoxes)
-		//{
-		//  getTable().addMouseListener(new TableItemChecker());
-		//}
-	}
-
-	//protected CellEditor checkBoxCellEditor;
-	//protected CellEditor textCellEditor;
-
-	protected int[] createColumnIndexMap() {
-		int[] result = new int[showCheckBoxes ? 4 : 3];
-		int i = 0;
-		if (showCheckBoxes) {
-			result[i++] = COLUMN_CHECKBOX;
-		}
-		result[i++] = COLUMN_PREFIX;
-		result[i++] = COLUMN_NAMESPACE_URI;
-		if (!showCheckBoxes) {
-			result[i++] = COLUMN_LOCATION_HINT;
-		}
-		return result;
-	}
-
-	protected String[] createColumnPropertiesArray() {
-		String[] result = new String[3];
-		int i = 0;
-		if (showCheckBoxes) {
-			result[i++] = LABEL_CHECKBOX;
-		}
-		result[i++] = LABEL_PREFIX;
-		result[i++] = LABEL_NAMESPACE_URI;
-		if (!showCheckBoxes) {
-			result[i++] = LABEL_LOCATION_HINT;
-		}
-		return result;
-	}
-
-	protected int getColumnCode(int column) {
-		int result = 0;
-		if (column < columnIndexMap.length) {
-			result = columnIndexMap[column];
-		}
-		return result;
-	}
-
-	protected int getColumnWidth(int column) {
-		int result = 0;
-		switch (getColumnCode(column)) {
-			case COLUMN_PREFIX : {
-				result = 5;
-				break;
-			}
-			case COLUMN_NAMESPACE_URI : {
-				// Size columns differently when location hint text label is
-				// displayed
-				if (showLocationText) {
-					result = 10;
-				} else {
-					result = 20;
-				}
-				break;
-			}
-			case COLUMN_CHECKBOX : {
-				result = 1; //info.locationHint;
-				break;
-			}
-			case COLUMN_LOCATION_HINT : {
-				// Size columns differently when location hint text label is
-				// displayed
-				if (showLocationText) {
-					result = 10;
-				} else {
-					result = 2;
-				}
-				break;
-			}
-		}
-		return result;
-	}
-	/*
-	 * protected class NamespaceInfoCellModifier implements ICellModifier {
-	 * public NamespaceInfoCellModifier() { }
-	 * 
-	 * public boolean canModify(Object element, String property) { if
-	 * (property.equals(LABEL_CHECKBOX)) { return true; } else if
-	 * (property.equals(LABEL_PREFIX)) { return true; } return false; }
-	 * 
-	 * public Object getValue(Object element, String property) { int column =
-	 * 0; if (property.equals(LABEL_CHECKBOX)) { column = 0; } else if
-	 * (property.equals(LABEL_PREFIX)) { column = 1; } else if
-	 * (property.equals(LABEL_NAMESPACE_URI)) { column = 2; }
-	 * 
-	 * //if (element instanceof TableElement) //{ // return
-	 * provider.getColumnText(element, column); //} //else //{ // return null; // }
-	 * return "hello"; }
-	 * 
-	 * public void modify(Object element, String property, Object value) { } }
-	 * 
-	 * protected class NamespaceInfoCheckboxCellEditor extends
-	 * CheckboxCellEditor implements MouseListener { public
-	 * NamespaceInfoCheckboxCellEditor(Composite parent) { super(parent); }
-	 * 
-	 * protected void doSetValue(Object value) { }
-	 * 
-	 * public void activate() { super.activate(); deactivate();
-	 * Display.getCurrent().getFocusControl().redraw(); }
-	 * 
-	 * public void mouseDown(MouseEvent e) { if (getTable().getItem(new
-	 * Point(e.x, e.y)) != null) { } } public void mouseDoubleClick(MouseEvent
-	 * e) { } public void mouseUp(MouseEvent e) { } }
-	 */
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EncodingSettings.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EncodingSettings.java
deleted file mode 100644
index 54e4f39..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EncodingSettings.java
+++ /dev/null
@@ -1,356 +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.ui.internal.preferences;
-
-import java.util.Vector;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-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.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * EncodingSettings is a composite that can be used to display the set of
- * encoding values that are available to the user. The list of encoding values
- * is based off the SupportedJavaEncoding class. As the user selects an
- * encoding from the combo box, the readonly field below it changes to show
- * the IANA tag for that particular encoding description. The labels for the
- * widgets are configurable and the initial value to display to the user can
- * be set using the setIANATag(). The currently selected entry's IANA tag can
- * be retrieved with getIANATag(). Entries displayed to the user can be added
- * and removed.
- */
-public class EncodingSettings extends Composite {
-
-	private class ComboListener implements ModifyListener {
-		public void modifyText(ModifyEvent e) {
-			int i = encodingCombo.getSelectionIndex();
-			if (i >= 0 && i < ianaVector.size())
-				ianaText.setText((String) (ianaVector.elementAt(encodingCombo.getSelectionIndex())));
-		}
-	}
-
-	private static String ENCODING_LABEL = XMLUIMessages.EncodingSettings_1; //$NON-NLS-1$
-
-	private static String IANA_LABEL = XMLUIMessages.EncodingSettings_0; //$NON-NLS-1$
-
-	private ModifyListener comboListener = new ComboListener();
-	protected Combo encodingCombo;
-	protected Label encodingLabel, ianaLabel;
-	protected Text ianaText;
-	protected Vector ianaVector;
-
-	/**
-	 * Method EncodingSettings.
-	 * 
-	 * @param parent
-	 */
-	public EncodingSettings(Composite parent) {
-		super(parent, SWT.NONE);
-		init(IANA_LABEL, ENCODING_LABEL);
-	}
-
-	/**
-	 * Method EncodingSettings.
-	 * 
-	 * @param parent
-	 * @param encodingLabel -
-	 *            text label to use beside the locale sensitive description of
-	 *            the currently selected encoding
-	 */
-	public EncodingSettings(Composite parent, String encodingLabel) {
-		super(parent, SWT.NONE);
-		init(IANA_LABEL, encodingLabel);
-	}
-
-	/**
-	 * Method EncodingSettings.
-	 * 
-	 * @param parent
-	 * @param ianaLabel =
-	 *            text label to use beside the display only IANA field
-	 * @param encodingLabel -
-	 *            text label to use beside the locale sensitive description of
-	 *            the currently selected encoding
-	 */
-	public EncodingSettings(Composite parent, String ianaLabel, String encodingLabel) {
-		super(parent, SWT.NONE);
-		init(ianaLabel, encodingLabel);
-	}
-
-	/**
-	 * Method addEntry. Add an entry to the end of the Encoding Combobox
-	 * 
-	 * @param description -
-	 *            encoding description to display
-	 * @param ianaTag -
-	 *            IANA tag for the description
-	 */
-	public void addEntry(String description, String ianaTag) {
-		encodingCombo.add(description);
-		ianaVector.add(ianaTag);
-	}
-
-	/**
-	 * Method addEntry. Add an entry to the Encoding Combobox at index index
-	 * 
-	 * @param description -
-	 *            encoding description to display
-	 * @param ianaTag -
-	 *            IANA tag for the description
-	 * @param index -
-	 *            index into the combo to add to
-	 */
-	public void addEntry(String description, String ianaTag, int index) {
-		if (index == ianaVector.size()) {
-			// just add to the end
-			addEntry(description, ianaTag);
-			return;
-		}
-
-		if (0 <= index && index < ianaVector.size()) {
-			encodingCombo.add(description, index);
-			ianaVector.add(index, ianaTag);
-		}
-	}
-
-	protected Combo createComboBox(Composite parent, boolean isReadOnly) {
-		int style = isReadOnly == true ? SWT.READ_ONLY : SWT.DROP_DOWN;
-
-		Combo combo = new Combo(parent, style);
-
-		GridData data = new GridData();
-		data.horizontalAlignment = GridData.FILL;
-		data.grabExcessHorizontalSpace = true;
-		combo.setLayoutData(data);
-		return combo;
-	}
-
-	/**
-	 * Helper method for creating labels.
-	 */
-	protected Label createLabel(Composite parent, String text) {
-		Label label = new Label(parent, SWT.LEFT);
-		label.setText(text);
-
-		GridData data = new GridData();
-		data.horizontalAlignment = GridData.FILL;
-		label.setLayoutData(data);
-		return label;
-	}
-
-	protected Text createTextField(Composite parent, int width) {
-		Text text = new Text(parent, SWT.SINGLE | SWT.READ_ONLY);
-
-		GridData data = new GridData();
-		data.horizontalAlignment = GridData.FILL;
-		data.grabExcessHorizontalSpace = true;
-		data.widthHint = width;
-		text.setLayoutData(data);
-
-		return text;
-	}
-
-	/**
-	 * @see org.eclipse.swt.widgets.Widget#dispose()
-	 */
-	public void dispose() {
-		encodingCombo.removeModifyListener(comboListener);
-		super.dispose();
-	}
-
-	private void fillCombo() {
-		try {
-			String[] ianaTags = CommonCharsetNames.getCommonCharsetNames();
-			int totalNum = ianaTags.length;
-			for (int i = 0; i < totalNum; i++) {
-				String iana = ianaTags[i];
-				String enc = CommonCharsetNames.getDisplayString(iana);
-
-				if (enc != null) {
-					encodingCombo.add(enc);
-				} else {
-					Logger.log(Logger.WARNING, "CommonCharsetNames.getDisplayString(" + iana + ") returned null"); //$NON-NLS-1$ //$NON-NLS-2$
-					encodingCombo.add(iana);
-				}
-				ianaVector.add(iana);
-			}
-		} catch (Exception e) {
-			//e.printStackTrace();
-			//MessageDialog.openError(getShell(), "Resource exception",
-			// "Unable to obtain encoding strings. Check resource file");
-			//XMLEncodingPlugin.getPlugin().getMsgLogger().write(e.toString());
-			//XMLEncodingPlugin.getPlugin().getMsgLogger().writeCurrentThread();
-			Logger.log(Logger.ERROR, "Exception", e); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * <code>getEncoding</code> Get the descriptive encoding name that was
-	 * selected.
-	 * 
-	 * @return a <code>String</code> value
-	 */
-	public String getEncoding() {
-		return encodingCombo.getText();
-	}
-
-	/**
-	 * Method getEncodingCombo. Returns the combo used to display the encoding
-	 * descriptions.
-	 * 
-	 * @return Combo
-	 */
-	public Combo getEncodingCombo() {
-		return encodingCombo;
-	}
-
-	/**
-	 * <code>getIANATag</code> Get the IANA tag equivalent of the selected
-	 * descriptive encoding name
-	 * 
-	 * @return a <code>String</code> value
-	 */
-	public String getIANATag() {
-		int i = encodingCombo.getSelectionIndex();
-		if (i >= 0) {
-			return (String) (ianaVector.elementAt(i));
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	protected void init(String ianaLabelStr, String encodingLabelStr) {
-		GridLayout layout = new GridLayout();
-		layout.numColumns = 2;
-		setLayout(layout);
-		GridData data = new GridData();
-		data.verticalAlignment = GridData.FILL;
-		data.horizontalAlignment = GridData.FILL;
-		data.grabExcessHorizontalSpace = true;
-		setLayoutData(data);
-
-		encodingLabel = createLabel(this, encodingLabelStr);
-		encodingCombo = createComboBox(this, true);
-		ianaLabel = createLabel(this, ianaLabelStr);
-		ianaText = createTextField(this, 20);
-		ianaVector = new Vector();
-
-		fillCombo();
-		resetToDefaultEncoding();
-		encodingCombo.addModifyListener(comboListener);
-	}
-
-	/**
-	 * <code>isEncodingInList</code> Checks whether the encoding name is in
-	 * the combo
-	 * 
-	 * @param enc
-	 *            a <code>string</code> value. The encoding name.
-	 * @return a <code>boolean</code> value. TRUE if encoding is in list.
-	 *         FALSE if encoding is not in list.
-	 */
-	public boolean isEncodingInList(String enc) {
-		int i = encodingCombo.indexOf(enc);
-		if (i >= 0) {
-			return true;
-		}
-		return false;
-	}
-
-	/**
-	 * <code>isIANATagInList</code> Checks whether the IANA tag is in the
-	 * combo
-	 * 
-	 * @param ianaTag
-	 *            a <code>string</code> value. The IANA tag.
-	 * @return a <code>boolean</code> value. TRUE if tag is in list. FALSE
-	 *         if tag is not in list.
-	 */
-	public boolean isIANATagInList(String ianaTag) {
-		int i = ianaVector.indexOf(ianaTag);
-		if (i >= 0) {
-			return true;
-		}
-		return false;
-	}
-
-	/**
-	 * Method removeEntry. Removes both the description and the IANA tag at
-	 * the specified index
-	 * 
-	 * @param index
-	 */
-	public void removeEntry(int index) {
-		if (0 <= index && index < ianaVector.size()) {
-			encodingCombo.remove(index);
-			ianaVector.remove(index);
-		}
-	}
-
-	/**
-	 * Method resetToDefaultEncoding. Reset the control to the default
-	 * encoding. Currently UTF-8
-	 */
-	public void resetToDefaultEncoding() {
-		String defaultIANATag = "UTF-8"; //$NON-NLS-1$
-		ianaText.setText(defaultIANATag);
-		setIANATag(defaultIANATag);
-	}
-
-	/**
-	 * Method setEnabled. Enable/disable the EncodingSettings composite.
-	 * 
-	 * @param enabled
-	 */
-	public void setEnabled(boolean enabled) {
-		encodingCombo.setEnabled(enabled);
-		encodingLabel.setEnabled(enabled);
-		ianaLabel.setEnabled(enabled);
-		ianaText.setEnabled(enabled);
-	}
-
-	/**
-	 * <code>setEncoding</code> Set the selection in the combo to the
-	 * descriptive encoding name.
-	 * 
-	 * @param enc
-	 *            a <code>string</code> value. Note this is not the IANA
-	 *            tag.
-	 */
-	public void setEncoding(String enc) {
-		encodingCombo.setText(enc);
-		encodingCombo.select(encodingCombo.indexOf(enc));
-	}
-
-	/**
-	 * <code>setIANATag</code> Set the IANA tag for the combo
-	 * 
-	 * @param ianaTag
-	 *            a <code>string</code> value. The IANA tag.
-	 */
-	public void setIANATag(String ianaTag) {
-		int i = ianaVector.indexOf(ianaTag);
-		if (i >= 0) {
-			encodingCombo.select(i);
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/WorkbenchDefaultEncodingSettings.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/WorkbenchDefaultEncodingSettings.java
deleted file mode 100644
index 7596b1a..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/WorkbenchDefaultEncodingSettings.java
+++ /dev/null
@@ -1,137 +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.ui.internal.preferences;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * WorkbenchDefaultEncodingSettings is an extension of EncodingSettings. This
- * composite contains EncodingSettings for users to select the encoding they
- * desire as well as a checkbox for users to select to use the default
- * workbench encoding instead.
- * 
- * @see org.eclipse.wst.xml.ui.internal.preferences.EncodingSettings
- */
-public class WorkbenchDefaultEncodingSettings extends Composite {
-
-	private final static int INDENT = 15;
-	private static final String WORKBENCH_DEFAULT = ""; //$NON-NLS-1$
-	private EncodingSettings fEncodingSettings;
-	private String fNonDefaultIANA = null;
-	private Button fUseDefaultButton;
-
-	public WorkbenchDefaultEncodingSettings(Composite parent) {
-		super(parent, SWT.NONE);
-		createControls();
-	}
-
-	private void createControls() {
-		GridLayout layout = new GridLayout();
-		layout.numColumns = 1;
-		layout.marginWidth = 0;
-		setLayout(layout);
-		GridData data = new GridData();
-		data.verticalAlignment = GridData.FILL;
-		data.horizontalAlignment = GridData.FILL;
-		data.grabExcessHorizontalSpace = true;
-		setLayoutData(data);
-
-		Composite defaultEncodingComposite = new Composite(this, SWT.NONE);
-		layout = new GridLayout();
-		layout.marginWidth = 0;
-		layout.marginHeight = 0;
-		data = new GridData(GridData.FILL_BOTH);
-		defaultEncodingComposite.setLayout(layout);
-		defaultEncodingComposite.setLayoutData(data);
-
-		fUseDefaultButton = new Button(defaultEncodingComposite, SWT.CHECK);
-		fUseDefaultButton.setText(XMLUIMessages.WorkbenchDefaultEncodingSettings_0); //$NON-NLS-1$
-
-		fUseDefaultButton.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				handleUseDefaultButtonSelected();
-			}
-		});
-
-		fEncodingSettings = new EncodingSettings(this);
-		((GridLayout) fEncodingSettings.getLayout()).marginWidth = 0;
-		((GridData) fEncodingSettings.getLayoutData()).horizontalIndent = INDENT;
-
-	}
-
-	private Combo getEncodingCombo() {
-		return fEncodingSettings.getEncodingCombo();
-	}
-
-	/**
-	 * <code>getIANATag</code> Get the IANA tag equivalent of the selected
-	 * descriptive encoding name. Returns empty string if using workbench
-	 * encoding.
-	 * 
-	 * @return a <code>String</code> value
-	 */
-	public String getIANATag() {
-		if (!isDefault())
-			return fEncodingSettings.getIANATag();
-		return WORKBENCH_DEFAULT;
-	}
-
-	private String getWorkbenchEncoding() {
-		return ResourcesPlugin.getEncoding();
-	}
-
-	void handleUseDefaultButtonSelected() {
-		if (fUseDefaultButton.getSelection()) {
-			fNonDefaultIANA = fEncodingSettings.getIANATag();
-			String workbenchValue = getWorkbenchEncoding();
-			workbenchValue = CommonCharsetNames.getIanaPreferredCharsetName(workbenchValue);
-			fEncodingSettings.setIANATag(workbenchValue);
-		} else if (fNonDefaultIANA != null) {
-			fEncodingSettings.setIANATag(fNonDefaultIANA);
-		}
-		getEncodingCombo().setEnabled(!fUseDefaultButton.getSelection());
-		fEncodingSettings.setEnabled(!fUseDefaultButton.getSelection());
-	}
-
-	private boolean isDefault() {
-		return fUseDefaultButton.getSelection();
-	}
-
-	/**
-	 * <code>setEncoding</code> Set the selection in the combo to the
-	 * descriptive encoding name. Selects use workbench encoding if ianaTag is
-	 * null or empty string.
-	 * 
-	 */
-	public void setIANATag(String ianaTag) {
-		if (ianaTag == null || ianaTag.equals(WORKBENCH_DEFAULT)) {
-			fUseDefaultButton.setSelection(true);
-			handleUseDefaultButtonSelected();
-		} else {
-			fUseDefaultButton.setSelection(false);
-			handleUseDefaultButtonSelected();
-			if (!isDefault())
-				fEncodingSettings.setIANATag(ianaTag);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLColorPage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLColorPage.java
deleted file mode 100644
index 3343b01..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLColorPage.java
+++ /dev/null
@@ -1,223 +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.ui.internal.preferences;
-
-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.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-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.AbstractColorPage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-public class XMLColorPage extends AbstractColorPage {
-
-	protected Control createContents(Composite parent) {
-		Composite pageComponent = createComposite(parent, 1);
-		((GridData) pageComponent.getLayoutData()).horizontalAlignment = GridData.HORIZONTAL_ALIGN_FILL;
-
-		super.createContents(pageComponent);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.XML_PREFWEBX_STYLES_HELPID);
-		return pageComponent;
-	}
-
-	/**
-	 * 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;
-	}
-
-	protected IPreferenceStore doGetPreferenceStore() {
-		return XMLUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	public String getSampleText() {
-		return XMLUIMessages.Sample_XML_doc; //$NON-NLS-1$ = "<?xml version=\"1.0\"?>\n<?customProcessingInstruction\n\tXML processor specific\n\tcontent ?>\n<!DOCTYPE colors\n\tPUBLIC \"//IBM/XML/COLORS/\" \"colors.dtd\">\n<colors>\n\t<!-- begin color definitions -->\n\t<color name=\"plaintext\" foreground=\"#000000\"\n\t\tbackground=\"#D4D0C8\"/>\n\t<color name=\"bold\" foreground=\"#000000\"\n\t\tbackground=\"#B3ACA0\">\n\t<![CDATA[<123456789>]]>\n\tNormal text content.\n\t<color name=\"inverse\" foreground=\"#F0F0F0\"\n\t\tbackground=\"#D4D0C8\"/>\n\n</colors>\n";
-	}
-
-	protected void initCommonContextStyleMap(Dictionary contextStyleMap) {
-
-		contextStyleMap.put(DOMRegionContext.XML_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
-		contextStyleMap.put(DOMRegionContext.XML_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
-		contextStyleMap.put(DOMRegionContext.XML_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
-
-		contextStyleMap.put(DOMRegionContext.XML_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
-		contextStyleMap.put(DOMRegionContext.XML_END_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
-		contextStyleMap.put(DOMRegionContext.XML_TAG_NAME, IStyleConstantsXML.TAG_NAME);
-		contextStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
-		contextStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
-		contextStyleMap.put(DOMRegionContext.XML_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
-		contextStyleMap.put(DOMRegionContext.XML_EMPTY_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
-
-		contextStyleMap.put(DOMRegionContext.XML_DECLARATION_OPEN, IStyleConstantsXML.DECL_BORDER);
-		contextStyleMap.put(DOMRegionContext.XML_DECLARATION_CLOSE, IStyleConstantsXML.DECL_BORDER);
-		contextStyleMap.put(DOMRegionContext.XML_ELEMENT_DECLARATION, IStyleConstantsXML.DECL_BORDER);
-		contextStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_CLOSE, IStyleConstantsXML.DECL_BORDER);
-
-		contextStyleMap.put(DOMRegionContext.XML_CONTENT, IStyleConstantsXML.XML_CONTENT);
-	}
-
-	protected void initCommonDescriptions(Dictionary descriptions) {
-
-		// create descriptions for hilighting types
-		descriptions.put(IStyleConstantsXML.COMMENT_BORDER, XMLUIMessages.Comment_Delimiters_UI_); //$NON-NLS-1$ = "Comment Delimiters"
-		descriptions.put(IStyleConstantsXML.COMMENT_TEXT, XMLUIMessages.Comment_Content_UI_); //$NON-NLS-1$ = "Comment Content"
-		descriptions.put(IStyleConstantsXML.TAG_BORDER, XMLUIMessages.Tag_Delimiters_UI_); //$NON-NLS-1$ = "Tag Delimiters"
-		descriptions.put(IStyleConstantsXML.TAG_NAME, XMLUIMessages.Tag_Names_UI_); //$NON-NLS-1$ = "Tag Names"
-		descriptions.put(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, XMLUIMessages.Attribute_Names_UI_); //$NON-NLS-1$ = "Attribute Names"
-		descriptions.put(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, XMLUIMessages.Attribute_Values_UI_); //$NON-NLS-1$ = "Attribute Values"
-		descriptions.put(IStyleConstantsXML.DECL_BORDER, XMLUIMessages.Declaration_Delimiters_UI_); //$NON-NLS-1$ = "Declaration Delimiters"
-		descriptions.put(IStyleConstantsXML.XML_CONTENT, XMLUIMessages.Content_UI_); //$NON-NLS-1$ = "Content"
-	}
-
-	protected void initCommonStyleList(ArrayList list) {
-
-		//list.add(IStyleConstantsXML.CDATA_BORDER);
-		//list.add(IStyleConstantsXML.CDATA_TEXT);
-		//list.add(IStyleConstantsXML.PI_BORDER);
-		//list.add(IStyleConstantsXML.PI_CONTENT);
-
-		list.add(IStyleConstantsXML.TAG_BORDER);
-		list.add(IStyleConstantsXML.TAG_NAME);
-		list.add(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
-		list.add(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
-		list.add(IStyleConstantsXML.COMMENT_BORDER);
-		list.add(IStyleConstantsXML.COMMENT_TEXT);
-		list.add(IStyleConstantsXML.DECL_BORDER);
-		list.add(IStyleConstantsXML.XML_CONTENT);
-	}
-
-	protected void initContextStyleMap(Dictionary contextStyleMap) {
-
-		initCommonContextStyleMap(contextStyleMap);
-		initDocTypeContextStyleMap(contextStyleMap);
-		contextStyleMap.put(DOMRegionContext.XML_CDATA_OPEN, IStyleConstantsXML.CDATA_BORDER);
-		contextStyleMap.put(DOMRegionContext.XML_CDATA_TEXT, IStyleConstantsXML.CDATA_TEXT);
-		contextStyleMap.put(DOMRegionContext.XML_CDATA_CLOSE, IStyleConstantsXML.CDATA_BORDER);
-
-		contextStyleMap.put(DOMRegionContext.XML_PI_OPEN, IStyleConstantsXML.PI_BORDER);
-		contextStyleMap.put(DOMRegionContext.XML_PI_CONTENT, IStyleConstantsXML.PI_CONTENT);
-		contextStyleMap.put(DOMRegionContext.XML_PI_CLOSE, IStyleConstantsXML.PI_BORDER);
-
-	}
-
-	protected void initDescriptions(Dictionary descriptions) {
-
-		initCommonDescriptions(descriptions);
-		initDocTypeDescriptions(descriptions);
-		descriptions.put(IStyleConstantsXML.CDATA_BORDER, XMLUIMessages.CDATA_Delimiters_UI_); //$NON-NLS-1$ = "CDATA Delimiters"
-		descriptions.put(IStyleConstantsXML.CDATA_TEXT, XMLUIMessages.CDATA_Content_UI_); //$NON-NLS-1$ = "CDATA Content"
-		descriptions.put(IStyleConstantsXML.PI_BORDER, XMLUIMessages.Processing_Instruction_Del_UI_); //$NON-NLS-1$ = "Processing Instruction Delimiters"
-		descriptions.put(IStyleConstantsXML.PI_CONTENT, XMLUIMessages.Processing_Instruction_Con_UI__UI_); //$NON-NLS-1$ = "Processing Instruction Content"
-	}
-
-	protected void initDocTypeContextStyleMap(Dictionary contextStyleMap) {
-
-		contextStyleMap.put(DOMRegionContext.XML_ELEMENT_DECL_NAME, IStyleConstantsXML.DOCTYPE_NAME);
-		contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION, IStyleConstantsXML.TAG_NAME);
-		contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE, IStyleConstantsXML.DECL_BORDER);
-
-		contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_NAME, IStyleConstantsXML.DOCTYPE_NAME);
-		contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBLIC, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
-		contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
-		contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSTEM, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
-		contextStyleMap.put(DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
-	}
-
-	protected void initDocTypeDescriptions(Dictionary descriptions) {
-
-		// create descriptions for hilighting types for DOCTYPE related items
-		descriptions.put(IStyleConstantsXML.DOCTYPE_NAME, XMLUIMessages.DOCTYPE_Name_UI_); //$NON-NLS-1$ = "DOCTYPE Name"
-		descriptions.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, XMLUIMessages.DOCTYPE_SYSTEM_PUBLIC_Keyw_UI_); //$NON-NLS-1$ = "DOCTYPE SYSTEM/PUBLIC Keyword"
-		descriptions.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, XMLUIMessages.DOCTYPE_Public_Reference_UI_); //$NON-NLS-1$ = "DOCTYPE Public Reference"
-		descriptions.put(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, XMLUIMessages.DOCTYPE_System_Reference_UI_); //$NON-NLS-1$ = "DOCTYPE System Reference"
-	}
-
-	protected void initDocTypeStyleList(ArrayList list) {
-
-		list.add(IStyleConstantsXML.DOCTYPE_NAME);
-		list.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
-		list.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
-		list.add(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
-	}
-
-	protected void initStyleList(ArrayList list) {
-		initCommonStyleList(list);
-		initDocTypeStyleList(list);
-		list.add(IStyleConstantsXML.CDATA_BORDER);
-		list.add(IStyleConstantsXML.CDATA_TEXT);
-		list.add(IStyleConstantsXML.PI_BORDER);
-		list.add(IStyleConstantsXML.PI_CONTENT);
-	}
-
-	public boolean performOk() {
-		// required since the superclass *removes* existing preferences before
-		// saving its own
-		super.performOk();
-
-		SSEUIPlugin.getDefault().savePluginPreferences();
-		return true;
-	}
-
-	protected void setupPicker(StyledTextColorPicker picker) {
-		IModelManager mmanager = StructuredModelManager.getModelManager();
-		picker.setParser(mmanager.createStructuredDocumentFor(ContentTypeIdForXML.ContentTypeID_XML).getParser());
-
-		Dictionary descriptions = new Hashtable();
-		initDescriptions(descriptions);
-
-		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.wst.sse.ui.preferences.ui.AbstractColorPage#savePreferences()
-	 */
-	protected void savePreferences() {
-		XMLUIPlugin.getDefault().savePluginPreferences();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java
deleted file mode 100644
index 3340219..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java
+++ /dev/null
@@ -1,195 +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.ui.internal.preferences;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.Preferences;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-
-public class XMLFilesPreferencePage extends AbstractPreferencePage {
-	protected EncodingSettings fEncodingSettings = null;
-
-	protected Combo fEndOfLineCode = null;
-	private Vector fEOLCodes = null;
-
-	protected Control createContents(Composite parent) {
-		Composite composite = (Composite) super.createContents(parent);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.XML_PREFWEBX_FILES_HELPID);
-		createContentsForCreatingOrSavingGroup(composite);
-		createContentsForCreatingGroup(composite);
-
-		setSize(composite);
-		loadPreferences();
-
-		return composite;
-	}
-
-	protected void createContentsForCreatingGroup(Composite parent) {
-		Group creatingGroup = createGroup(parent, 1);
-		creatingGroup.setText(XMLUIMessages.Creating_files);
-
-		createLabel(creatingGroup, XMLUIMessages.Encoding_desc);
-
-		fEncodingSettings = new EncodingSettings(creatingGroup, XMLUIMessages.Encoding);
-	}
-
-	protected void createContentsForCreatingOrSavingGroup(Composite parent) {
-		Group creatingOrSavingGroup = createGroup(parent, 2);
-		creatingOrSavingGroup.setText(XMLUIMessages.Creating_or_saving_files);
-
-		Label label = createLabel(creatingOrSavingGroup, XMLUIMessages.End_of_line_code_desc);
-		((GridData) label.getLayoutData()).horizontalSpan = 2;
-		((GridData) label.getLayoutData()).grabExcessHorizontalSpace = true;
-
-		createLabel(creatingOrSavingGroup, XMLUIMessages.End_of_line_code);
-		fEndOfLineCode = createDropDownBox(creatingOrSavingGroup);
-		populateLineDelimiters();
-	}
-
-	protected void doSavePreferenceStore() {
-		XMLCorePlugin.getDefault().savePluginPreferences(); // model
-	}
-
-	/**
-	 * Return the currently selected line delimiter preference
-	 * 
-	 * @return a line delimiter constant from CommonEncodingPreferenceNames
-	 */
-	private String getCurrentEOLCode() {
-		int i = fEndOfLineCode.getSelectionIndex();
-		if (i >= 0) {
-			return (String) (fEOLCodes.elementAt(i));
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractPreferencePage#getModelPreferences()
-	 */
-	protected Preferences getModelPreferences() {
-		return XMLCorePlugin.getDefault().getPluginPreferences();
-	}
-
-	protected void initializeValues() {
-		initializeValuesForCreatingOrSavingGroup();
-		initializeValuesForCreatingGroup();
-	}
-
-	protected void initializeValuesForCreatingGroup() {
-		String encoding = getModelPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-
-		fEncodingSettings.setIANATag(encoding);
-	}
-
-	protected void initializeValuesForCreatingOrSavingGroup() {
-		String endOfLineCode = getModelPreferences().getString(CommonEncodingPreferenceNames.END_OF_LINE_CODE);
-
-		if (endOfLineCode.length() > 0)
-			setCurrentEOLCode(endOfLineCode);
-		else
-			setCurrentEOLCode(CommonEncodingPreferenceNames.NO_TRANSLATION);
-	}
-
-	protected void performDefaults() {
-		performDefaultsForCreatingOrSavingGroup();
-		performDefaultsForCreatingGroup();
-
-		super.performDefaults();
-	}
-
-	protected void performDefaultsForCreatingGroup() {
-		String encoding = getModelPreferences().getDefaultString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-
-		fEncodingSettings.setIANATag(encoding);
-		//		fEncodingSettings.resetToDefaultEncoding();
-	}
-
-	protected void performDefaultsForCreatingOrSavingGroup() {
-		String endOfLineCode = getModelPreferences().getDefaultString(CommonEncodingPreferenceNames.END_OF_LINE_CODE);
-
-		if (endOfLineCode.length() > 0)
-			setCurrentEOLCode(endOfLineCode);
-		else
-			setCurrentEOLCode(CommonEncodingPreferenceNames.NO_TRANSLATION);
-	}
-
-	public boolean performOk() {
-		boolean result = super.performOk();
-
-		doSavePreferenceStore();
-
-		return result;
-	}
-
-	/**
-	 * Populates the vector containing the line delimiter to display string
-	 * mapping and the combobox displaying line delimiters
-	 */
-	private void populateLineDelimiters() {
-		fEOLCodes = new Vector();
-		fEndOfLineCode.add(XMLUIMessages.EOL_Unix);
-		fEOLCodes.add(CommonEncodingPreferenceNames.LF);
-
-		fEndOfLineCode.add(XMLUIMessages.EOL_Mac);
-		fEOLCodes.add(CommonEncodingPreferenceNames.CR);
-
-		fEndOfLineCode.add(XMLUIMessages.EOL_Windows);
-		fEOLCodes.add(CommonEncodingPreferenceNames.CRLF);
-
-		fEndOfLineCode.add(XMLUIMessages.EOL_NoTranslation);
-		fEOLCodes.add(CommonEncodingPreferenceNames.NO_TRANSLATION);
-	}
-
-	/**
-	 * Select the line delimiter in the eol combobox
-	 * 
-	 */
-	private void setCurrentEOLCode(String eolCode) {
-		// Clear the current selection.
-		fEndOfLineCode.clearSelection();
-		fEndOfLineCode.deselectAll();
-
-		int i = fEOLCodes.indexOf(eolCode);
-		if (i >= 0) {
-			fEndOfLineCode.select(i);
-		}
-	}
-
-	protected void storeValues() {
-		storeValuesForCreatingOrSavingGroup();
-		storeValuesForCreatingGroup();
-	}
-
-	protected void storeValuesForCreatingGroup() {
-		getModelPreferences().setValue(CommonEncodingPreferenceNames.OUTPUT_CODESET, fEncodingSettings.getIANATag());
-	}
-
-	protected void storeValuesForCreatingOrSavingGroup() {
-		String eolCode = getCurrentEOLCode();
-		getModelPreferences().setValue(CommonEncodingPreferenceNames.END_OF_LINE_CODE, eolCode);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSourcePreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSourcePreferencePage.java
deleted file mode 100644
index b611e44..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSourcePreferencePage.java
+++ /dev/null
@@ -1,353 +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.ui.internal.preferences;
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-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.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-
-public class XMLSourcePreferencePage extends AbstractPreferencePage implements ModifyListener, SelectionListener, IWorkbenchPreferencePage {
-	private final int MIN_INDENTATION_SIZE = 0;
-	private final int MAX_INDENTATION_SIZE = 16;
-
-	// Content Assist
-	protected Button fAutoPropose;
-	protected Label fAutoProposeLabel;
-	protected Text fAutoProposeText;
-	private Combo fSuggestionStrategyCombo;
-	private Vector fSuggestionStrategies = null;
-	protected Button fClearAllBlankLines;
-
-	// Formatting
-	protected Label fLineWidthLabel;
-	protected Text fLineWidthText;
-	protected Button fSplitMultiAttrs;
-	private Button fIndentUsingTabs;
-	private Button fIndentUsingSpaces;
-	private Spinner fIndentationSize;
-
-	// grammar constraints
-	protected Button fUseInferredGrammar;
-
-	protected Control createContents(Composite parent) {
-		Composite composite = (Composite) super.createContents(parent);
-		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.XML_PREFWEBX_SOURCE_HELPID);
-
-		createContentsForFormattingGroup(composite);
-		createContentsForContentAssistGroup(composite);
-		createContentsForGrammarConstraintsGroup(composite);
-		setSize(composite);
-		loadPreferences();
-
-		return composite;
-	}
-
-	protected void createContentsForContentAssistGroup(Composite parent) {
-		Group contentAssistGroup = createGroup(parent, 2);
-		contentAssistGroup.setText(XMLUIMessages.Content_assist_UI_);
-
-		fAutoPropose = createCheckBox(contentAssistGroup, XMLUIMessages.Automatically_make_suggest_UI_);
-		((GridData) fAutoPropose.getLayoutData()).horizontalSpan = 2;
-		fAutoPropose.addSelectionListener(this);
-
-		fAutoProposeLabel = createLabel(contentAssistGroup, XMLUIMessages.Prompt_when_these_characte_UI_);
-		fAutoProposeText = createTextField(contentAssistGroup);
-
-		createLabel(contentAssistGroup, XMLUIMessages.Suggestion_Strategy);
-		fSuggestionStrategyCombo = new Combo(contentAssistGroup, SWT.READ_ONLY);
-		fSuggestionStrategies = new Vector();
-		fSuggestionStrategyCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		fSuggestionStrategyCombo.add(XMLUIMessages.Suggestion_Strategy_Lax);
-		fSuggestionStrategies.add(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_LAX);
-		fSuggestionStrategyCombo.add(XMLUIMessages.Suggestion_Strategy_Strict);
-		fSuggestionStrategies.add(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_STRICT);
-	}
-
-	protected void createContentsForFormattingGroup(Composite parent) {
-		Group formattingGroup = createGroup(parent, 2);
-		formattingGroup.setText(XMLUIMessages.Formatting_UI_);
-
-		fLineWidthLabel = createLabel(formattingGroup, XMLUIMessages.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, XMLUIMessages.Split_multiple_attributes);
-		((GridData) fSplitMultiAttrs.getLayoutData()).horizontalSpan = 2;
-		fClearAllBlankLines = createCheckBox(formattingGroup, XMLUIMessages.Clear_all_blank_lines_UI_);
-		((GridData) fClearAllBlankLines.getLayoutData()).horizontalSpan = 2;
-
-		fIndentUsingTabs = createRadioButton(formattingGroup, XMLUIMessages.Indent_using_tabs);
-		((GridData) fIndentUsingTabs.getLayoutData()).horizontalSpan = 2;
-
-		fIndentUsingSpaces = createRadioButton(formattingGroup, XMLUIMessages.Indent_using_spaces);
-		((GridData) fIndentUsingSpaces.getLayoutData()).horizontalSpan = 2;
-
-		createLabel(formattingGroup, XMLUIMessages.Indentation_size);
-		fIndentationSize = new Spinner(formattingGroup, SWT.READ_ONLY | SWT.BORDER);
-		GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
-		fIndentationSize.setLayoutData(gd);
-		fIndentationSize.setToolTipText(XMLUIMessages.Indentation_size_tip);
-		fIndentationSize.setMinimum(MIN_INDENTATION_SIZE);
-		fIndentationSize.setMaximum(MAX_INDENTATION_SIZE);
-		fIndentationSize.setIncrement(1);
-		fIndentationSize.setPageIncrement(4);
-		fIndentationSize.addModifyListener(this);
-	}
-
-	protected void createContentsForGrammarConstraintsGroup(Composite parent) {
-		Group grammarConstraintsGroup = createGroup(parent, 1);
-		grammarConstraintsGroup.setText(XMLUIMessages.Grammar_Constraints);
-		grammarConstraintsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
-
-		fUseInferredGrammar = createCheckBox(grammarConstraintsGroup, XMLUIMessages.Use_inferred_grammar_in_absence_of);
-	}
-
-	protected IPreferenceStore doGetPreferenceStore() {
-		return XMLUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	protected void doSavePreferenceStore() {
-		XMLUIPlugin.getDefault().savePluginPreferences(); // editor
-		XMLCorePlugin.getDefault().savePluginPreferences(); // model
-	}
-
-	protected void enableValues() {
-		if (fAutoPropose != null) {
-			if (fAutoPropose.getSelection()) {
-				fAutoProposeLabel.setEnabled(true);
-				fAutoProposeText.setEnabled(true);
-			}
-			else {
-				fAutoProposeLabel.setEnabled(false);
-				fAutoProposeText.setEnabled(false);
-			}
-		}
-	}
-
-	protected Preferences getModelPreferences() {
-		return XMLCorePlugin.getDefault().getPluginPreferences();
-	}
-
-	/**
-	 * Return the currently selected suggestion strategy preference
-	 * 
-	 * @return a suggestion strategy constant from XMLUIPreferenceNames
-	 */
-	private String getCurrentSuggestionStrategy() {
-		int i = fSuggestionStrategyCombo.getSelectionIndex();
-		if (i >= 0) {
-			return (String) (fSuggestionStrategies.elementAt(i));
-		}
-		return ""; //$NON-NLS-1$
-	}
-
-	protected void initializeValues() {
-		initializeValuesForFormattingGroup();
-		initializeValuesForContentAssistGroup();
-		initializeValuesForGrammarConstraintsGroup();
-	}
-
-	protected void initializeValuesForContentAssistGroup() {
-		// Content Assist
-		fAutoPropose.setSelection(getPreferenceStore().getBoolean(XMLUIPreferenceNames.AUTO_PROPOSE));
-		fAutoProposeText.setText(getPreferenceStore().getString(XMLUIPreferenceNames.AUTO_PROPOSE_CODE));
-		String suggestionStrategy = getPreferenceStore().getString(XMLUIPreferenceNames.SUGGESTION_STRATEGY);
-		if (suggestionStrategy.length() > 0)
-			setCurrentSuggestionStrategy(suggestionStrategy);
-		else
-			setCurrentSuggestionStrategy(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_LAX);
-	}
-
-	protected void initializeValuesForFormattingGroup() {
-		// Formatting
-		fLineWidthText.setText(getModelPreferences().getString(XMLCorePreferenceNames.LINE_WIDTH));
-		fSplitMultiAttrs.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
-		fClearAllBlankLines.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
-		if (XMLCorePreferenceNames.TAB.equals(getModelPreferences().getString(XMLCorePreferenceNames.INDENTATION_CHAR))) {
-			fIndentUsingTabs.setSelection(true);
-			fIndentUsingSpaces.setSelection(false);
-		}
-		else {
-			fIndentUsingSpaces.setSelection(true);
-			fIndentUsingTabs.setSelection(false);
-		}
-
-		fIndentationSize.setSelection(getModelPreferences().getInt(XMLCorePreferenceNames.INDENTATION_SIZE));
-	}
-
-	protected void initializeValuesForGrammarConstraintsGroup() {
-		fUseInferredGrammar.setSelection(getPreferenceStore().getBoolean(XMLUIPreferenceNames.USE_INFERRED_GRAMMAR));
-	}
-
-	protected void performDefaults() {
-		performDefaultsForFormattingGroup();
-		performDefaultsForContentAssistGroup();
-		performDefaultsForGrammarConstraintsGroup();
-
-		validateValues();
-		enableValues();
-
-		super.performDefaults();
-	}
-
-	protected void performDefaultsForContentAssistGroup() {
-		// Content Assist
-		fAutoPropose.setSelection(getPreferenceStore().getDefaultBoolean(XMLUIPreferenceNames.AUTO_PROPOSE));
-		fAutoProposeText.setText(getPreferenceStore().getDefaultString(XMLUIPreferenceNames.AUTO_PROPOSE_CODE));
-		String suggestionStrategy = getPreferenceStore().getDefaultString(XMLUIPreferenceNames.SUGGESTION_STRATEGY);
-		if (suggestionStrategy.length() > 0)
-			setCurrentSuggestionStrategy(suggestionStrategy);
-		else
-			setCurrentSuggestionStrategy(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_LAX);
-	}
-
-	protected void performDefaultsForFormattingGroup() {
-		// Formatting
-		fLineWidthText.setText(getModelPreferences().getDefaultString(XMLCorePreferenceNames.LINE_WIDTH));
-		fSplitMultiAttrs.setSelection(getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
-		fClearAllBlankLines.setSelection(getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
-		if (XMLCorePreferenceNames.TAB.equals(getModelPreferences().getDefaultString(XMLCorePreferenceNames.INDENTATION_CHAR))) {
-			fIndentUsingTabs.setSelection(true);
-			fIndentUsingSpaces.setSelection(false);
-		}
-		else {
-			fIndentUsingSpaces.setSelection(true);
-			fIndentUsingTabs.setSelection(false);
-		}
-		fIndentationSize.setSelection(getModelPreferences().getDefaultInt(XMLCorePreferenceNames.INDENTATION_SIZE));
-	}
-
-	protected void performDefaultsForGrammarConstraintsGroup() {
-		fUseInferredGrammar.setSelection(getPreferenceStore().getDefaultBoolean(XMLUIPreferenceNames.USE_INFERRED_GRAMMAR));
-	}
-
-	public boolean performOk() {
-		boolean result = super.performOk();
-
-		doSavePreferenceStore();
-
-		return result;
-	}
-
-	/**
-	 * Set a suggestion strategy in suggestion strategy combo box
-	 * 
-	 * @param strategy
-	 */
-	private void setCurrentSuggestionStrategy(String strategy) {
-		// Clear the current selection.
-		fSuggestionStrategyCombo.clearSelection();
-		fSuggestionStrategyCombo.deselectAll();
-
-		int i = fSuggestionStrategies.indexOf(strategy);
-		if (i >= 0) {
-			fSuggestionStrategyCombo.select(i);
-		}
-	}
-
-	protected void storeValues() {
-		storeValuesForFormattingGroup();
-		storeValuesForContentAssistGroup();
-		storeValuesForGrammarConstraintsGroup();
-	}
-
-	protected void storeValuesForContentAssistGroup() {
-		// Content Assist
-		getPreferenceStore().setValue(XMLUIPreferenceNames.AUTO_PROPOSE, fAutoPropose.getSelection());
-		getPreferenceStore().setValue(XMLUIPreferenceNames.AUTO_PROPOSE_CODE, fAutoProposeText.getText());
-		getPreferenceStore().setValue(XMLUIPreferenceNames.SUGGESTION_STRATEGY, getCurrentSuggestionStrategy());
-	}
-
-	protected void storeValuesForFormattingGroup() {
-		// Formatting
-		getModelPreferences().setValue(XMLCorePreferenceNames.LINE_WIDTH, fLineWidthText.getText());
-		getModelPreferences().setValue(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS, fSplitMultiAttrs.getSelection());
-		getModelPreferences().setValue(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES, fClearAllBlankLines.getSelection());
-
-		if (fIndentUsingTabs.getSelection()) {
-			getModelPreferences().setValue(XMLCorePreferenceNames.INDENTATION_CHAR, XMLCorePreferenceNames.TAB);
-		}
-		else {
-			getModelPreferences().setValue(XMLCorePreferenceNames.INDENTATION_CHAR, XMLCorePreferenceNames.SPACE);
-		}
-		getModelPreferences().setValue(XMLCorePreferenceNames.INDENTATION_SIZE, fIndentationSize.getSelection());
-	}
-
-	protected void storeValuesForGrammarConstraintsGroup() {
-		getPreferenceStore().setValue(XMLUIPreferenceNames.USE_INFERRED_GRAMMAR, fUseInferredGrammar.getSelection());
-	}
-
-	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);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTemplatePreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTemplatePreferencePage.java
deleted file mode 100644
index fbc1cf3..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTemplatePreferencePage.java
+++ /dev/null
@@ -1,67 +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.ui.internal.preferences;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
-
-
-/**
- * Preference page for XML templates
- */
-public class XMLTemplatePreferencePage extends TemplatePreferencePage {
-
-	public XMLTemplatePreferencePage() {
-		XMLUIPlugin xmlEditorPlugin = XMLUIPlugin.getDefault();
-
-		setPreferenceStore(xmlEditorPlugin.getPreferenceStore());
-		setTemplateStore(xmlEditorPlugin.getTemplateStore());
-		setContextTypeRegistry(xmlEditorPlugin.getTemplateContextRegistry());
-	}
-
-	/*
-	 * (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.XML_PREFWEBX_TEMPLATES_HELPID);
-		return c;
-	}
-
-	/*
-	 * (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.IPreferencePage#performOk()
-	 */
-	public boolean performOk() {
-		boolean ok = super.performOk();
-		XMLUIPlugin.getDefault().savePluginPreferences();
-		return ok;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java
deleted file mode 100644
index fb6253a..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package org.eclipse.wst.xml.ui.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-/**
- * Sets default values for XML UI preferences
- */
-public class XMLUIPreferenceInitializer extends AbstractPreferenceInitializer {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
-	 */
-	public void initializeDefaultPreferences() {
-		IPreferenceStore store = XMLUIPlugin.getDefault().getPreferenceStore();
-		
-		store.setDefault(XMLUIPreferenceNames.AUTO_PROPOSE, true);
-		store.setDefault(XMLUIPreferenceNames.AUTO_PROPOSE_CODE, "<"); //$NON-NLS-1$
-        store.setDefault(XMLUIPreferenceNames.SUGGESTION_STRATEGY, XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_LAX);
-		store.setDefault(
-					XMLUIPreferenceNames.USE_INFERRED_GRAMMAR, true);
-
-		// XML Style Preferences
-		String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
-		String styleValue = ColorHelper.getColorString(127, 0, 127)
-				+ NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, styleValue);
-
-		styleValue = ColorHelper.getColorString(42, 0, 255) + NOBACKGROUNDBOLD;
-		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.getColorString(63, 95, 191) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.COMMENT_BORDER, styleValue);
-		store.setDefault(IStyleConstantsXML.COMMENT_TEXT, styleValue);
-
-		styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.DECL_BORDER, styleValue);
-
-		styleValue = ColorHelper.getColorString(0, 0, 128) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.DOCTYPE_NAME, styleValue);
-		store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF,
-				styleValue);
-
-		styleValue = ColorHelper.getColorString(128, 128, 128)
-				+ NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, styleValue);
-
-		styleValue = ColorHelper.getColorString(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.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.TAG_BORDER, styleValue);
-
-		styleValue = ColorHelper.getColorString(63, 127, 127)
-				+ NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.TAG_NAME, styleValue);
-
-		styleValue = ColorHelper.getColorString(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.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.CDATA_BORDER, styleValue);
-
-		styleValue = ColorHelper.getColorString(0, 0, 0) + NOBACKGROUNDBOLD;
-		store.setDefault(IStyleConstantsXML.CDATA_TEXT, styleValue);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceNames.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceNames.java
deleted file mode 100644
index 7269308..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceNames.java
+++ /dev/null
@@ -1,85 +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.ui.internal.preferences;
-
-/**
- * Preference keys for XML UI
- */
-public class XMLUIPreferenceNames {
-  
-    public final static String SUGGESTION_STRATEGY_VALUE_LAX = "Lax";	//$NON-NLS-1$
-    public final static String SUGGESTION_STRATEGY_VALUE_STRICT = "Strict";	  //$NON-NLS-1$
-	/**
-	 * 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$
-	}
-
-	/**
-	 * A named preference that controls whether or grammar should be inferred
-	 * or not.
-	 * <p>
-	 * Value is of type <code>Boolean</code>.
-	 * </p>
-	 */
-	public static final String USE_INFERRED_GRAMMAR = getUseInferredGrammarKey();
-
-	private static String getUseInferredGrammarKey() {
-		return "useInferredGrammar"; //$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 SUGGESTION_STRATEGY = getSuggestionStrategeyKey();
-
-    private static String getSuggestionStrategeyKey() {
-        return "suggestionStrategy";//$NON-NLS-1$
-    }    
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterFactoryXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterFactoryXML.java
deleted file mode 100644
index 70e8334..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterFactoryXML.java
+++ /dev/null
@@ -1,57 +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.ui.internal.projection;
-
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-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.INodeNotifier;
-import org.w3c.dom.Node;
-
-public class ProjectionModelNodeAdapterFactoryXML extends AbstractAdapterFactory {
-	private ProjectionViewer fProjectionViewer;
-
-	public ProjectionModelNodeAdapterFactoryXML() {
-		super(ProjectionModelNodeAdapterXML.class, true);
-	}
-
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		ProjectionModelNodeAdapterXML adapter = null;
-
-		// create adapter for every element tag
-		if ((fProjectionViewer != null) && (target instanceof Node) && ((Node) target).getNodeType() == Node.ELEMENT_NODE) {
-			adapter = new ProjectionModelNodeAdapterXML(this);
-			adapter.updateAdapter((Node) target);
-		}
-
-		return adapter;
-	}
-
-	ProjectionViewer getProjectionViewer() {
-		return fProjectionViewer;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.AbstractAdapterFactory#release()
-	 */
-	public void release() {
-		fProjectionViewer = null;
-
-		super.release();
-	}
-
-	void setProjectionViewer(ProjectionViewer viewer) {
-		fProjectionViewer = viewer;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterXML.java
deleted file mode 100644
index 8501a93..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterXML.java
+++ /dev/null
@@ -1,273 +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.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-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.IndexedRegion;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.w3c.dom.Node;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterXML implements INodeAdapter {
-
-	private class TagProjectionAnnotation extends ProjectionAnnotation {
-		private boolean fIsVisible = false; /* workaround for BUG85874 */
-		private Node fNode;
-
-		public TagProjectionAnnotation(Node node, boolean isCollapsed) {
-			super(isCollapsed);
-			fNode = node;
-		}
-
-		public Node getNode() {
-			return fNode;
-		}
-
-		public void setNode(Node node) {
-			fNode = node;
-		}
-		
-		/**
-		 * Does not paint hidden annotations. Annotations are hidden when they
-		 * only span one line.
-		 * 
-		 * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC,
-		 *      org.eclipse.swt.widgets.Canvas,
-		 *      org.eclipse.swt.graphics.Rectangle)
-		 */
-		public void paint(GC gc, Canvas canvas, Rectangle rectangle) {
-			/* workaround for BUG85874 */
-			/*
-			 * only need to check annotations that are expanded because hidden
-			 * annotations should never have been given the chance to
-			 * collapse.
-			 */
-			if (!isCollapsed()) {
-				// working with rectangle, so need the styledtext line height
-				int lineHeight = fAdapterFactory.getProjectionViewer().getTextWidget().getLineHeight();
-
-				// do not draw annotations that only span one line and mark
-				// them as not visible
-				if ((rectangle.height / lineHeight) <= 1) {
-					fIsVisible = false;
-					return;
-				}
-			}
-			fIsVisible = true;
-			super.paint(gc, canvas, rectangle);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.text.source.projection.ProjectionAnnotation#markCollapsed()
-		 */
-		public void markCollapsed() {
-			/* workaround for BUG85874 */
-			// do not mark collapsed if annotation is not visible
-			if (fIsVisible)
-				super.markCollapsed();
-		}
-	}
-
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.xml.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	ProjectionModelNodeAdapterFactoryXML fAdapterFactory;
-	private Map fTagAnnotations = new HashMap();
-
-	public ProjectionModelNodeAdapterXML(ProjectionModelNodeAdapterFactoryXML factory) {
-		fAdapterFactory = factory;
-	}
-
-	/**
-	 * Create a projection position from the given node. Able to get
-	 * projection position if node isNodeProjectable.
-	 * 
-	 * @param node
-	 * @return null if no projection position possible, a Position otherwise
-	 */
-	private Position createProjectionPosition(Node node) {
-		Position pos = null;
-		if (isNodeProjectable(node) && node instanceof IndexedRegion) {
-			IDocument document = fAdapterFactory.getProjectionViewer().getDocument();
-			if (document != null) {
-				IndexedRegion inode = (IndexedRegion) node;
-				int start = inode.getStartOffset();
-				int end = inode.getEndOffset();
-				if (start >= 0 && start < end) {
-					try {
-//						// region-based
-//						// extra line when collapsed, but no region increase when add newline
-//						pos = new Position(start, end - start);
-						
-//						// line-based
-//						// extra line when collapsed, but no region increase when add newline
-//						IRegion startLineRegion = document.getLineInformationOfOffset(start);
-//						IRegion endLineRegion = document.getLineInformationOfOffset(end);
-//						int startOffset = startLineRegion.getOffset();
-//						int endOffset = endLineRegion.getOffset() + endLineRegion.getLength();
-//						if (endOffset > startOffset) {
-//							pos = new Position(startOffset, endOffset - startOffset);
-//						}
-						
-						// line-based
-						// no extra line when collapsed, but region increase when add newline
-						int startLine = document.getLineOfOffset(start);
-						int endLine = document.getLineOfOffset(end);
-						if (endLine + 1 < document.getNumberOfLines()) {
-							int offset = document.getLineOffset(startLine);
-							int endOffset = document.getLineOffset(endLine + 1);
-							pos = new Position(offset, endOffset - offset);
-						}
-					} catch (BadLocationException x) {
-						Logger.log(Logger.WARNING_DEBUG, null, x);
-					}
-				}
-			}
-		}
-		return pos;
-	}
-
-	/**
-	 * Find TagProjectionAnnotation for node in the current list of projection
-	 * annotations for this adapter
-	 * 
-	 * @param node
-	 * @return TagProjectionAnnotation
-	 */
-	private TagProjectionAnnotation getExistingAnnotation(Node node) {
-		TagProjectionAnnotation anno = null;
-
-		if ((node != null) && (!fTagAnnotations.isEmpty())) {
-			Iterator it = fTagAnnotations.keySet().iterator();
-			while (it.hasNext() && anno == null) {
-				TagProjectionAnnotation a = (TagProjectionAnnotation) it.next();
-				Node n = a.getNode();
-				if (node.equals(n)) {
-					anno = a;
-				}
-			}
-		}
-		return anno;
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return type == ProjectionModelNodeAdapterXML.class;
-	}
-
-	/**
-	 * Returns true if node is a node type able to fold
-	 * 
-	 * @param node
-	 * @return boolean true if node is projectable, false otherwise
-	 */
-	private boolean isNodeProjectable(Node node) {
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			return true;
-		}
-		return false;
-	}
-
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		// check if folding is even enabled, if not, just ignore notifyChanged
-		// events
-		if (fAdapterFactory.getProjectionViewer() == null) {
-			return;
-		}
-
-		if ((eventType == INodeNotifier.STRUCTURE_CHANGED) && (notifier instanceof Node)) {
-			updateAdapter((Node) notifier);
-		}
-	}
-
-	/**
-	 * Update the projection annotation of all the nodes that are children of
-	 * node
-	 * 
-	 * @param node
-	 */
-	void updateAdapter(Node node) {
-		long start = System.currentTimeMillis();
-
-		Map additions = new HashMap();
-		Map projectionAnnotations = new HashMap();
-
-		// go through immediate child nodes and figure out projection
-		// model annotations
-		if (node != null) {
-			Node childNode = node.getFirstChild();
-			while (childNode != null) {
-				Position newPos = createProjectionPosition(childNode);
-				if (newPos != null) {
-					TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(childNode, false);
-					TagProjectionAnnotation existing = getExistingAnnotation(childNode);
-					if (existing == null) {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(newAnnotation, newPos);
-						// add to map containing annotations to add
-						additions.put(newAnnotation, newPos);
-					} else {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(existing, newPos);
-						// remove from map containing annotations to delete
-						fTagAnnotations.remove(existing);
-					}
-				}
-				childNode = childNode.getNextSibling();
-			}
-
-			// in the end, want to delete anything leftover in old list, add
-			// everything in additions, and update everything in
-			// projectionAnnotations
-			ProjectionAnnotation[] oldList = null;
-			if (!fTagAnnotations.isEmpty()) {
-				oldList = (ProjectionAnnotation[]) fTagAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-			ProjectionAnnotation[] modifyList = null;
-			if (!projectionAnnotations.isEmpty()) {
-				modifyList = (ProjectionAnnotation[]) projectionAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-			ProjectionViewer viewer = fAdapterFactory.getProjectionViewer();
-			ProjectionAnnotationModel annotationModel = viewer.getProjectionAnnotationModel();
-			annotationModel.modifyAnnotations(oldList, additions, modifyList);
-		}
-
-		// save new list of annotations
-		fTagAnnotations = projectionAnnotations;
-
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf) {
-			String nodeName = node != null ? node.getNodeName() : "null"; //$NON-NLS-1$
-			System.out.println("ProjectionModelNodeAdapterXML.updateAdapter (" + nodeName + "):" + (end - start)); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/StructuredTextFoldingProviderXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/StructuredTextFoldingProviderXML.java
deleted file mode 100644
index f54b49d..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/StructuredTextFoldingProviderXML.java
+++ /dev/null
@@ -1,214 +0,0 @@
-package org.eclipse.wst.xml.ui.internal.projection;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-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.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Updates the projection model of a structured model for XML.
- */
-public class StructuredTextFoldingProviderXML implements IStructuredTextFoldingProvider, IProjectionListener {
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.xml.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private IDocument fDocument;
-	private ProjectionViewer fViewer;
-
-	/**
-	 * Adds an adapter to node and its children
-	 * 
-	 * @param node
-	 * @param level
-	 */
-	private void addAdapterToNodeAndChildren(Node node, int level) {
-		if (node instanceof INodeNotifier) {
-			INodeNotifier notifier = (INodeNotifier) node;
-
-			// try and get the adapter for the current node and update the
-			// adapter with projection information
-			ProjectionModelNodeAdapterXML adapter = (ProjectionModelNodeAdapterXML) notifier.getExistingAdapter(ProjectionModelNodeAdapterXML.class);
-			if (adapter != null) {
-				adapter.updateAdapter(node);
-			}
-			else {
-				// just call getadapter so the adapter is created and
-				// automatically initialized
-				notifier.getAdapterFor(ProjectionModelNodeAdapterXML.class);
-			}
-
-			Node nextChild = node.getFirstChild();
-			while (nextChild != null) {
-				Node childNode = nextChild;
-				nextChild = childNode.getNextSibling();
-
-				addAdapterToNodeAndChildren(childNode, level + 1);
-			}
-		}
-	}
-
-	/**
-	 * Goes through every node and adds an adapter onto each for tracking
-	 * purposes
-	 */
-	private void addAllAdapters() {
-		long start = System.currentTimeMillis();
-
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-			if (sModel != null) {
-				int startOffset = 0;
-				IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
-				if (startNode instanceof Node) {
-					int level = 0;
-					Node nextSibling = (Node) startNode;
-					while (nextSibling != null) {
-						Node currentNode = nextSibling;
-						nextSibling = currentNode.getNextSibling();
-
-						addAdapterToNodeAndChildren(currentNode, level);
-					}
-				}
-			}
-		}
-		finally {
-			if (sModel != null) {
-				sModel.releaseFromRead();
-			}
-		}
-
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf)
-			System.out.println("StructuredTextFoldingProviderXML.addAllAdapters: " + (end - start)); //$NON-NLS-1$
-	}
-
-	/**
-	 * Get the ProjectionModelNodeAdapterFactoryXML to use with this provider.
-	 * 
-	 * @return ProjectionModelNodeAdapterFactoryXML
-	 */
-	private ProjectionModelNodeAdapterFactoryXML getAdapterFactory(boolean createIfNeeded) {
-		long start = System.currentTimeMillis();
-
-		ProjectionModelNodeAdapterFactoryXML factory = null;
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-			if (sModel != null) {
-				FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
-				// getting the projectionmodelnodeadapter for the first time
-				// so do some initializing
-				if (!factoryRegistry.contains(ProjectionModelNodeAdapterXML.class) && createIfNeeded) {
-					ProjectionModelNodeAdapterFactoryXML newFactory = new ProjectionModelNodeAdapterFactoryXML();
-
-					// add factory to factory registry
-					factoryRegistry.addFactory(newFactory);
-
-					// add factory to propogating adapter
-					IDOMModel domModel = (IDOMModel) sModel;
-					Document document = domModel.getDocument();
-					PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
-					if (propagatingAdapter != null) {
-						propagatingAdapter.addAdaptOnCreateFactory(newFactory);
-					}
-				}
-
-				// try and get the factory
-				factory = (ProjectionModelNodeAdapterFactoryXML) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterXML.class);
-			}
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-
-		long end = System.currentTimeMillis();
-		if (debugProjectionPerf)
-			System.out.println("StructuredTextFoldingProviderXML.getAdapterFactory: " + (end - start)); //$NON-NLS-1$
-		return factory;
-	}
-
-	/**
-	 * Initialize this provider with the correct document. Assumes projection
-	 * is enabled. (otherwise, only install would have been called)
-	 */
-	public void initialize() {
-		if (!isInstalled())
-			return;
-
-		// set projection viewer to null on old document's adapter factory
-		ProjectionModelNodeAdapterFactoryXML factory = getAdapterFactory(false);
-		if (factory != null) {
-			factory.setProjectionViewer(null);
-		}
-		// clear out all annotations
-		if (fViewer.getProjectionAnnotationModel() != null)
-			fViewer.getProjectionAnnotationModel().removeAllAnnotations();
-		
-		fDocument = fViewer.getDocument();
-
-		if (fDocument != null) {
-			// set projection viewer on new document's adapter factory
-			factory = getAdapterFactory(true);
-			if (factory != null) {
-				factory.setProjectionViewer(fViewer);
-			}
-
-			addAllAdapters();
-		}
-	}
-
-	/**
-	 * Associate a ProjectionViewer with this IStructuredTextFoldingProvider
-	 * 
-	 * @param viewer
-	 */
-	public void install(ProjectionViewer viewer) {
-		// uninstall before trying to install new viewer
-		if (isInstalled()) {
-			uninstall();
-		}
-		fViewer = viewer;
-		fViewer.addProjectionListener(this);
-	}
-
-	private boolean isInstalled() {
-		return fViewer != null;
-	}
-
-	public void projectionDisabled() {
-		ProjectionModelNodeAdapterFactoryXML factory = getAdapterFactory(false);
-		if (factory != null) {
-			factory.setProjectionViewer(null);
-		}
-
-		fDocument = null;
-	}
-
-	public void projectionEnabled() {
-		initialize();
-	}
-
-	/**
-	 * Disconnect this IStructuredTextFoldingProvider from projection viewer
-	 */
-	public void uninstall() {
-		if (isInstalled()) {
-			projectionDisabled();
-
-			fViewer.removeProjectionListener(this);
-			fViewer = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/EnumeratedStringPropertyDescriptor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/EnumeratedStringPropertyDescriptor.java
deleted file mode 100644
index e302240..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/EnumeratedStringPropertyDescriptor.java
+++ /dev/null
@@ -1,69 +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.ui.internal.properties;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-/**
- * This class should be used for properties which require a combo box cell
- * editor and whose values consist of a list of enumerated strings.
- */
-public class EnumeratedStringPropertyDescriptor extends PropertyDescriptor {
-	protected StringComboBoxCellEditor fEditor;
-	protected Composite fParent;
-
-	/**
-	 * The enumerated possible values for the described property
-	 */
-	protected String fValues[] = null;
-
-	public EnumeratedStringPropertyDescriptor(Object id, String newDisplayName, String[] valuesArray) {
-		super(id, newDisplayName);
-		setDescription((String) id);
-		fValues = valuesArray;
-	}
-
-	/**
-	 * Creates and returns a new cell editor for editing this property.
-	 * Returns <code>null</code> if the property is not editable.
-	 * 
-	 * @param parent
-	 *            the parent widget for the cell editor
-	 * @return the cell editor for this property, or <code>null</code> if
-	 *         this property cannot be edited
-	 */
-	public CellEditor createPropertyEditor(Composite parent) {
-		// Check to see if we already have a Cell Editor with a valid Control
-		// under the given parent.
-		// If any of that's not true, create and return a new Cell Editor
-		if (fEditor == null || fEditor.getControl() == null || fEditor.getControl().isDisposed() || parent != fParent)
-			fEditor = new StringComboBoxCellEditor(parent, fValues);
-		fParent = parent;
-		return fEditor;
-	}
-
-	public void updateValues(String newValues[]) {
-		if (Arrays.equals(fValues, newValues))
-			return;
-		fValues = newValues;
-		if (fEditor != null) {
-			fEditor.setItems(newValues);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/StringComboBoxCellEditor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/StringComboBoxCellEditor.java
deleted file mode 100644
index 05f4788..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/StringComboBoxCellEditor.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.ui.internal.properties;
-
-
-
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.sse.ui.internal.Logger;
-
-
-/**
- * An extended ComboBoxCellEditor that selects and returns Strings
- */
-
-public class StringComboBoxCellEditor extends ComboBoxCellEditor {
-	private boolean fSettingValue = false;
-
-	/**
-	 *  
-	 */
-	public StringComboBoxCellEditor() {
-		super();
-	}
-
-	/**
-	 * @param parent
-	 * @param items
-	 */
-	public StringComboBoxCellEditor(Composite parent, String[] items) {
-		super(parent, items);
-	}
-
-	/**
-	 * @param parent
-	 * @param items
-	 * @param style
-	 */
-	public StringComboBoxCellEditor(Composite parent, String[] items, int style) {
-		super(parent, items, style);
-	}
-
-	protected Object doGetValue() {
-		// otherwise limits to set of valid values
-		Object index = super.doGetValue();
-		int selection = -1;
-		if (index instanceof Integer)
-			selection = ((Integer) index).intValue();
-		if (selection >= 0)
-			return getItems()[selection];
-		else if (getControl() instanceof CCombo) {
-			// retrieve the actual text as the list of valid items doesn't
-			// contain the value
-			return ((CCombo) getControl()).getText();
-		}
-		return null;
-	}
-
-	protected void doSetValue(Object value) {
-		if (fSettingValue)
-			return;
-		fSettingValue = true;
-		if (value instanceof Integer) {
-			super.doSetValue(value);
-		} else {
-			String stringValue = value.toString();
-			int selection = -1;
-			for (int i = 0; i < getItems().length; i++)
-				if (getItems()[i].equals(stringValue))
-					selection = i;
-			if (selection >= 0)
-				super.doSetValue(new Integer(selection));
-			else {
-				super.doSetValue(new Integer(-1));
-				if (getControl() instanceof CCombo && !stringValue.equals(((CCombo) getControl()).getText())) {
-					// update the Text widget
-					((CCombo) getControl()).setText(stringValue);
-				}
-			}
-		}
-		fSettingValue = false;
-	}
-
-	public void setItems(String[] newItems) {
-		if (getControl() == null || getControl().isDisposed()) {
-			Logger.log(Logger.ERROR, "Attempted to update item list for disposed cell editor"); //$NON-NLS-1$
-			return;
-		}
-
-		// keep selection if possible
-		Object previousSelectedValue = getValue();
-		super.setItems(newItems);
-		if (previousSelectedValue != null && getControl() instanceof CCombo) {
-			for (int i = 0; i < newItems.length; i++) {
-				if (newItems[i].equals(previousSelectedValue))
-					setValue(previousSelectedValue);
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java
deleted file mode 100644
index 4e1325f..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java
+++ /dev/null
@@ -1,685 +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.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Stack;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySheetEntry;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySource2;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.views.properties.IPropertySourceExtension;
-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.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-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;
-
-/**
- * An IPropertySource implementation for a JFace viewer used to display
- * properties of DOM nodes.
- */
-public class XMLPropertySource implements IPropertySource, IPropertySourceExtension, IPropertySource2 {
-	protected final static String CATEGORY_ATTRIBUTES = XMLUIMessages.XMLPropertySourceAdapter_0; //$NON-NLS-1$
-
-	private static final boolean fSetExpertFilter = false;
-
-	// derive categories from CMDataTypes; disabled until display strings can
-	// be planned
-	private final static boolean fShouldDeriveCategories = false;
-
-	private final static boolean fSortEnumeratedValues = true;
-	private boolean fCaseSensitive = true;
-	private IPropertyDescriptor[] fDescriptors = null;
-	private Node fNode = null;
-
-	private Stack fValuesBeingSet = new Stack();
-
-	public XMLPropertySource(INodeNotifier target) {
-		super();
-		fNode = (Node) target;
-		if (fNode instanceof IDOMNode) {
-			Document ownerDocument = fNode.getOwnerDocument();
-			if (ownerDocument == null) {
-				// if ownerDocument is null, then it must be the Document Node
-				ownerDocument = (Document) fNode;
-			}
-			DocumentTypeAdapter adapter = (DocumentTypeAdapter) ((INodeNotifier) ownerDocument).getAdapterFor(DocumentTypeAdapter.class);
-			if (adapter != null)
-				fCaseSensitive = adapter.getTagNameCase() == DocumentTypeAdapter.STRICT_CASE;
-		}
-	}
-
-	private String[] _getValidFixedStrings(CMAttributeDeclaration attrDecl, CMDataType helper) {
-		String attributeName = attrDecl.getAttrName();
-		List values = new ArrayList(1);
-		String impliedValue = helper.getImpliedValue();
-		if (impliedValue != null)
-			values.add(impliedValue);
-		boolean checkIfCurrentValueIsIncluded = (fNode.getAttributes() != null && fNode.getAttributes().getNamedItem(attributeName) != null && fNode.getAttributes().getNamedItem(attributeName).getNodeValue() != null);
-		if (checkIfCurrentValueIsIncluded) {
-			String currentValue = null;
-			currentValue = fNode.getAttributes().getNamedItem(attributeName).getNodeValue();
-			if (!currentValue.equals(impliedValue))
-				values.add(currentValue);
-		}
-		String[] validStrings = new String[values.size()];
-		validStrings = (String[]) values.toArray(validStrings);
-		return validStrings;
-	}
-
-	private String[] _getValidStrings(CMAttributeDeclaration attrDecl, CMDataType valuesHelper) {
-		String attributeName = attrDecl.getAttrName();
-		List values = new ArrayList(1);
-		boolean currentValueKnown = false;
-		boolean checkIfCurrentValueIsKnown = (fNode.getAttributes() != null && fNode.getAttributes().getNamedItem(attributeName) != null && fNode.getAttributes().getNamedItem(attributeName).getNodeValue() != null);
-		String currentValue = null;
-		if (checkIfCurrentValueIsKnown)
-			currentValue = fNode.getAttributes().getNamedItem(attributeName).getNodeValue();
-
-		if (valuesHelper.getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED && valuesHelper.getImpliedValue() != null) {
-			// FIXED value
-			currentValueKnown = currentValue != null && valuesHelper.getImpliedValue().equals(currentValue);
-			values.add(valuesHelper.getImpliedValue());
-		}
-		else {
-			// ENUMERATED values
-			String[] valueStrings = null;
-			// valueStrings = valuesHelper.getEnumeratedValues();
-			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument());
-			if (modelQuery != null && fNode.getNodeType() == Node.ELEMENT_NODE) {
-				valueStrings = modelQuery.getPossibleDataTypeValues((Element) fNode, attrDecl);
-			}
-			else {
-				valueStrings = attrDecl.getAttrType().getEnumeratedValues();
-			}
-			if (valueStrings != null) {
-				for (int i = 0; i < valueStrings.length; i++) {
-					if (checkIfCurrentValueIsKnown && valueStrings[i].equals(currentValue))
-						currentValueKnown = true;
-					values.add(valueStrings[i]);
-				}
-			}
-		}
-		if (valuesHelper.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE && valuesHelper.getImpliedValue() != null) {
-			if (!values.contains(valuesHelper.getImpliedValue()))
-				values.add(valuesHelper.getImpliedValue());
-		}
-
-		if (checkIfCurrentValueIsKnown && !currentValueKnown && currentValue != null && currentValue.length() > 0)
-			values.add(currentValue);
-		String[] validStrings = new String[values.size()];
-		validStrings = (String[]) values.toArray(validStrings);
-		return validStrings;
-	}
-
-	private IPropertyDescriptor createDefaultPropertyDescriptor(String attributeName) {
-		return createDefaultPropertyDescriptor(attributeName, false);
-	}
-
-	private IPropertyDescriptor createDefaultPropertyDescriptor(String attributeName, boolean hideOnFilter) {
-		// The descriptor class used here is also used in
-		// updatePropertyDescriptors()
-		TextPropertyDescriptor descriptor = new TextPropertyDescriptor(attributeName, attributeName);
-		descriptor.setCategory(getCategory(null));
-		descriptor.setDescription(attributeName);
-		if (hideOnFilter && fSetExpertFilter)
-			descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
-		return descriptor;
-	}
-
-	/**
-	 * Creates a property descriptor for an attribute with ENUMERATED values -
-	 * if the value does not exist, an editable combo box is returned - if the
-	 * value exists but is not one in the enumerated list of value, a combo
-	 * box featuring the current and correct values is returned - if the value
-	 * exists and it is a valid value, a combo box featuring the correct
-	 * values with the current one visible is returned
-	 */
-	private IPropertyDescriptor createEnumeratedPropertyDescriptor(CMAttributeDeclaration attrDecl, CMDataType valuesHelper) {
-		// the displayName MUST be set
-		EnumeratedStringPropertyDescriptor descriptor = new EnumeratedStringPropertyDescriptor(attrDecl.getAttrName(), attrDecl.getAttrName(), _getValidStrings(attrDecl, valuesHelper));
-		descriptor.setCategory(getCategory(attrDecl));
-		descriptor.setDescription(attrDecl.getAttrName());
-		if (attrDecl.getUsage() != CMAttributeDeclaration.REQUIRED && fSetExpertFilter)
-			descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
-		return descriptor;
-	}
-
-	/**
-	 * Creates a property descriptor for an attribute with a FIXED value - if
-	 * the value does not exist, an editable combo box is returned - if the
-	 * value exists but is not the fixed/default value, a combo box featuring
-	 * the current and correct value is returned - if the value exists and it
-	 * is the fixed/default value, no cell editor is provided "locking" the
-	 * value in
-	 */
-	private IPropertyDescriptor createFixedPropertyDescriptor(CMAttributeDeclaration attrDecl, CMDataType helper) {
-		// the displayName MUST be set
-		EnumeratedStringPropertyDescriptor descriptor = new EnumeratedStringPropertyDescriptor(attrDecl.getNodeName(), attrDecl.getNodeName(), _getValidFixedStrings(attrDecl, helper));
-		descriptor.setCategory(getCategory(attrDecl));
-		descriptor.setDescription(attrDecl.getAttrName());
-		return descriptor;
-	}
-
-	protected IPropertyDescriptor createPropertyDescriptor(CMAttributeDeclaration attrDecl) {
-		IPropertyDescriptor descriptor = null;
-		CMDataType attrType = attrDecl.getAttrType();
-
-		if (attrType != null) {
-			// handle declarations that provide FIXED/ENUMERATED values
-			if (attrType.getEnumeratedValues() != null && attrType.getEnumeratedValues().length > 0) {
-				descriptor = createEnumeratedPropertyDescriptor(attrDecl, attrType);
-			}
-			else if ((attrDecl.getUsage() == CMAttributeDeclaration.FIXED || attrType.getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED) && attrType.getImpliedValue() != null) {
-				descriptor = createFixedPropertyDescriptor(attrDecl, attrType);
-			}
-			else {
-				// plain text
-				descriptor = createTextPropertyDescriptor(attrDecl);
-			}
-		}
-		else {
-			// no extra information given
-			descriptor = createTextPropertyDescriptor(attrDecl);
-		}
-		return descriptor;
-	}
-
-	/**
-	 * Returns the current collection of property descriptors.
-	 * 
-	 * @return all valid descriptors.
-	 */
-	private IPropertyDescriptor[] createPropertyDescriptors() {
-		CMNamedNodeMap attrMap = null;
-		CMElementDeclaration ed = getDeclaration();
-		if (ed != null) {
-			attrMap = ed.getAttributes();
-		}
-
-		List descriptorList = new ArrayList();
-		List names = new ArrayList();
-		IPropertyDescriptor descriptor;
-
-		CMAttributeDeclaration attrDecl = null;
-
-		// add descriptors for existing attributes
-		NamedNodeMap attributes = fNode.getAttributes();
-		if (attributes != null) {
-			for (int i = 0; i < attributes.getLength(); i++) {
-				Attr attr = (Attr) attributes.item(i);
-				// if metainfo is present for this attribute, use the
-				// CMAttributeDeclaration to derive a descriptor
-				if (attrMap != null) {
-					String attrName = attr.getName();
-					if (fCaseSensitive)
-						attrDecl = (CMAttributeDeclaration) attrMap.getNamedItem(attrName);
-					else {
-						attrDecl = null;
-						for (int j = 0; j < attrMap.getLength(); j++) {
-							if (!fCaseSensitive && attrMap.item(j).getNodeName().equalsIgnoreCase(attrName)) {
-								attrDecl = (CMAttributeDeclaration) attrMap.item(j);
-								break;
-							}
-						}
-					}
-				}
-				// be consistent: if there's metainfo, use *that* as the
-				// descriptor ID
-				if (attrDecl != null) {
-					descriptor = createPropertyDescriptor(attrDecl);
-					if (descriptor != null)
-						names.add(attrDecl.getNodeName());
-				}
-				else {
-					descriptor = createDefaultPropertyDescriptor(attr.getName());
-					if (descriptor != null)
-						names.add(attr.getName());
-				}
-				if (descriptor != null)
-					descriptorList.add(descriptor);
-			}
-		}
-
-		// add descriptors from the metainfo that are not yet listed
-		if (attrMap != null) {
-			for (int i = 0; i < attrMap.getLength(); i++) {
-				attrDecl = (CMAttributeDeclaration) attrMap.item(i);
-				if (!names.contains(attrDecl.getAttrName())) {
-					IPropertyDescriptor holdDescriptor = createPropertyDescriptor(attrDecl);
-					if (holdDescriptor != null) {
-						descriptorList.add(holdDescriptor);
-					}
-				}
-			}
-		}
-
-		IPropertyDescriptor[] descriptors = new IPropertyDescriptor[descriptorList.size()];
-		for (int i = 0; i < descriptors.length; i++)
-			descriptors[i] = (IPropertyDescriptor) descriptorList.get(i);
-		return descriptors;
-	}
-
-	private IPropertyDescriptor createTextPropertyDescriptor(CMAttributeDeclaration attrDecl) {
-		TextPropertyDescriptor descriptor = new TextPropertyDescriptor(attrDecl.getAttrName(), attrDecl.getAttrName());
-		descriptor.setCategory(getCategory(attrDecl));
-		descriptor.setDescription(attrDecl.getAttrName());
-		if (attrDecl.getUsage() != CMAttributeDeclaration.REQUIRED && fSetExpertFilter)
-			descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
-		return descriptor;
-	}
-
-	private String getCategory(CMAttributeDeclaration attrDecl) {
-		if (attrDecl != null) {
-			if (attrDecl.supports("category")) { //$NON-NLS-1$
-				return (String) attrDecl.getProperty("category"); //$NON-NLS-1$
-			}
-			if (fShouldDeriveCategories && attrDecl.getAttrType() != null && attrDecl.getAttrType().getNodeName() != null && attrDecl.getAttrType().getNodeName().length() > 0) {
-				return attrDecl.getAttrType().getDataTypeName();
-			}
-		}
-		return CATEGORY_ATTRIBUTES;
-	}
-
-	private CMElementDeclaration getDeclaration() {
-		if (fNode == null || fNode.getNodeType() != Node.ELEMENT_NODE)
-			return null;
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument());
-		if (modelQuery != null) {
-			return modelQuery.getCMElementDeclaration((Element) fNode);
-		}
-		return null;
-	}
-
-	private Display getDisplay() {
-
-		return PlatformUI.getWorkbench().getDisplay();
-	}
-
-	/**
-	 * Returns a value for this Node that can be editted in a property sheet.
-	 * 
-	 * @return a value that can be editted
-	 */
-	public Object getEditableValue() {
-		return null;
-	}
-
-	/**
-	 * Returns the current collection of property descriptors.
-	 * 
-	 * @return all valid descriptors.
-	 */
-	public final IPropertyDescriptor[] getPropertyDescriptors() {
-		if (fDescriptors == null || fDescriptors.length == 0) {
-			fDescriptors = createPropertyDescriptors();
-		}
-		else {
-			updatePropertyDescriptors();
-		}
-		return fDescriptors;
-	}
-
-	/**
-	 * Returns the current value for the named property.
-	 * 
-	 */
-	public Object getPropertyValue(Object nameObject) {
-		String name = nameObject.toString();
-		String returnedValue = null;
-		NamedNodeMap attrMap = fNode.getAttributes();
-		if (attrMap != null) {
-			Node attribute = attrMap.getNamedItem(name);
-			if (attribute != null) {
-				if (attribute instanceof IDOMNode)
-					returnedValue = ((IDOMNode) attribute).getValueSource();
-				else
-					returnedValue = attribute.getNodeValue();
-			}
-		}
-		if (returnedValue == null)
-			returnedValue = ""; //$NON-NLS-1$
-		return returnedValue;
-	}
-
-	private String[] getValidValues(CMAttributeDeclaration attrDecl) {
-		if (attrDecl == null)
-			return new String[0];
-
-		String[] validValues = null;
-		CMDataType attrType = attrDecl.getAttrType();
-		if (attrType != null) {
-			validValues = _getValidStrings(attrDecl, attrType);
-			if (fSortEnumeratedValues)
-				Arrays.sort(validValues);
-		}
-		if (validValues == null)
-			validValues = new String[0];
-		return validValues;
-	}
-
-	public boolean isPropertyRemovable(Object id) {
-		return true;
-	}
-
-	public boolean isPropertyResettable(Object id) {
-		boolean resettable = false;
-		String property = id.toString();
-		CMNamedNodeMap attrDecls = null;
-
-		CMElementDeclaration ed = getDeclaration();
-		if (ed != null) {
-			attrDecls = ed.getAttributes();
-		}
-
-		if (attrDecls != null) {
-			CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attrDecls.getNamedItem(property);
-			if (attrDecl != null) {
-				if (attrDecl.getAttrType() != null) {
-					CMDataType helper = attrDecl.getAttrType();
-					if (helper.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE && helper.getImpliedValue() != null) {
-						resettable = true;
-					}
-				}
-			}
-		}
-		return resettable;
-	}
-
-	/**
-	 * Returns whether the property value has changed from the default.
-	 * 
-	 * @return <code>true</code> if the value of the specified property has
-	 *         changed from its original default value; <code>false</code>
-	 *         otherwise.
-	 */
-	public boolean isPropertySet(Object propertyObject) {
-		String property = propertyObject.toString();
-
-		NamedNodeMap attrMap = fNode.getAttributes();
-		if (attrMap != null)
-			return attrMap.getNamedItem(property) != null;
-		return false;
-	}
-
-	/**
-	 * Remove the given attribute from the Node
-	 * 
-	 * @param propertyObject
-	 */
-	public void removeProperty(Object propertyObject) {
-		NamedNodeMap attrMap = fNode.getAttributes();
-		if (attrMap != null) {
-			Node attribute = attrMap.getNamedItem(propertyObject.toString());
-			if (attribute != null) {
-				try {
-					attrMap.removeNamedItem(propertyObject.toString());
-				}
-				catch (DOMException e) {
-					if (e.code != DOMException.INVALID_MODIFICATION_ERR) {
-						Logger.logException(e);
-					}
-				}
-			}
-		}
-	}
-
-	/**
-	 * Resets the specified property's value to its default value.
-	 * 
-	 */
-	public void resetPropertyValue(Object propertyObject) {
-		String property = propertyObject.toString();
-		CMNamedNodeMap attrDecls = null;
-
-		CMElementDeclaration ed = getDeclaration();
-		if (ed != null) {
-			attrDecls = ed.getAttributes();
-		}
-
-		NamedNodeMap attrMap = fNode.getAttributes();
-		if (attrDecls != null) {
-			CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attrDecls.getNamedItem(property);
-			String defValue = null;
-			if (attrDecl != null) {
-				if (attrDecl.getAttrType() != null) {
-					CMDataType helper = attrDecl.getAttrType();
-					if (helper.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE && helper.getImpliedValue() != null)
-						defValue = helper.getImpliedValue();
-				}
-			}
-			if (defValue != null && defValue.length() > 0) {
-				((Attr) attrMap.getNamedItem(property)).setValue(defValue);
-			}
-			else {
-				attrMap.removeNamedItem(property);
-			}
-		}
-		else {
-			attrMap.removeNamedItem(property);
-		}
-	}
-
-	/**
-	 * Sets the named property to the given value.
-	 * 
-	 */
-	public void setPropertyValue(Object nameObject, Object value) {
-		// Avoid cycling - can happen if a closing cell editor causes a
-		// refresh
-		// on the PropertySheet page and the setInput again asks the editor to
-		// close; besides, why apply the same value twice?
-		if (!fValuesBeingSet.isEmpty() && fValuesBeingSet.peek() == nameObject)
-			return;
-		fValuesBeingSet.push(nameObject);
-		String name = nameObject.toString();
-		String valueString = null;
-		if (value != null)
-			valueString = value.toString();
-		NamedNodeMap attrMap = fNode.getAttributes();
-		try {
-			if (attrMap != null) {
-				Attr attr = (Attr) attrMap.getNamedItem(name);
-				if (attr != null) {
-					// EXISTING VALUE
-					// potential out of control loop if updating the value
-					// triggers a viewer update, forcing the
-					// active cell editor to save its value and causing the
-					// loop to continue
-					if (attr.getValue() == null || !attr.getValue().equals(valueString)) {
-						if (attr instanceof IDOMNode)
-							((IDOMNode) attr).setValueSource(valueString);
-						else
-							attr.setValue(valueString);
-					}
-				}
-				else {
-					// NEW(?) value
-					if (value != null) { // never create an empty attribute
-						Attr newAttr = fNode.getOwnerDocument().createAttribute(name);
-						if (newAttr instanceof IDOMNode)
-							((IDOMNode) newAttr).setValueSource(valueString);
-						else
-							newAttr.setValue(valueString);
-						attrMap.setNamedItem(newAttr);
-					}
-				}
-			}
-			else {
-				if (fNode instanceof Element) {
-					((Element) fNode).setAttribute(name, valueString);
-				}
-			}
-		}
-		catch (DOMException e) {
-			Display d = getDisplay();
-			if (d != null)
-				d.beep();
-		}
-		fValuesBeingSet.pop();
-	}
-
-	protected void updatePropertyDescriptors() {
-		if (fDescriptors == null || fDescriptors.length == 0)
-			// Nothing to update
-			return;
-
-		// List of all names encountered in the tag and defined by the element
-		List declaredNames = new ArrayList();
-		// New descriptor list that will become fDescriptors after all
-		// processing is done
-		List descriptors = new ArrayList();
-		// Names of the descriptors in the above List
-		List descriptorNames = new ArrayList();
-
-		// Update any descriptors derived from the metainfo
-		CMElementDeclaration ed = getDeclaration();
-		CMNamedNodeMap attrMap = null;
-		if (ed != null) {
-			attrMap = ed.getAttributes();
-		}
-		// Update exiting descriptors; not added to the final list here
-		if (attrMap != null) {
-			// Update existing descriptor types based on metainfo
-			CMAttributeDeclaration attrDecl = null;
-			for (int i = 0; i < attrMap.getLength(); i++) {
-				attrDecl = (CMAttributeDeclaration) attrMap.item(i);
-				String attrName = attrDecl.getAttrName();
-				if (!declaredNames.contains(attrName)) {
-					declaredNames.add(attrName);
-				}
-				for (int j = 0; j < fDescriptors.length; j++) {
-					boolean sameName = (fCaseSensitive && fDescriptors[j].getId().equals(attrDecl.getNodeName())) || (!fCaseSensitive && attrDecl.getNodeName().equals(fDescriptors[j].getId().toString()));
-					if (sameName) {
-						String[] validValues = getValidValues(attrDecl);
-						// Update the descriptor for this
-						// CMAttributeDeclaration (only enumerated values get
-						// updated for now)
-						if (fDescriptors[j] instanceof EnumeratedStringPropertyDescriptor) {
-							((EnumeratedStringPropertyDescriptor) fDescriptors[j]).updateValues(validValues);
-						}
-						// Replace with better descriptor
-						else if (validValues != null && validValues.length > 0) {
-							fDescriptors[j] = createPropertyDescriptor(attrDecl);
-						}
-					}
-				}
-			}
-		}
-		else {
-			// Update existing descriptors based on not having any metainfo
-			for (int j = 0; j < fDescriptors.length; j++) {
-				// Replace with basic descriptor
-				if (!(fDescriptors[j] instanceof TextPropertyDescriptor)) {
-					fDescriptors[j] = createDefaultPropertyDescriptor((String) fDescriptors[j].getId());
-				}
-			}
-		}
-
-		NamedNodeMap attributes = fNode.getAttributes();
-
-		// Remove descriptors for attributes that aren't present AND aren't
-		// known through metainfo,
-		// do this by only reusing existing descriptors for attributes that
-		// are present or declared
-		for (int i = 0; i < fDescriptors.length; i++) {
-			if (fDescriptors[i] != null) {
-				String descriptorName = fDescriptors[i].getId().toString();
-				if ((declaredNames.contains(descriptorName) || (attributes.getNamedItem(descriptorName) != null)) && !descriptorNames.contains(descriptorName)) {
-					descriptorNames.add(descriptorName);
-					descriptors.add(fDescriptors[i]);
-				}
-			}
-		}
-
-		// Add descriptors for declared attributes that don't already have one
-		if (attrMap != null) {
-			// Update existing descriptor types based on metainfo
-			CMAttributeDeclaration attrDecl = null;
-			for (int i = 0; i < attrMap.getLength(); i++) {
-				attrDecl = (CMAttributeDeclaration) attrMap.item(i);
-				String attrName = attrDecl.getAttrName();
-				if (fCaseSensitive) {
-					if (!descriptorNames.contains(attrName)) {
-						IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl);
-						if (descriptor != null) {
-							descriptorNames.add(attrName);
-							descriptors.add(descriptor);
-						}
-					}
-				}
-				else {
-					boolean exists = false;
-					for (int j = 0; j < descriptorNames.size(); j++)
-						exists = (descriptorNames.get(j).toString().equalsIgnoreCase(attrName)) || exists;
-					if (!exists) {
-						descriptorNames.add(attrName);
-						IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl);
-						if (descriptor != null) {
-							descriptorNames.add(attrName);
-							descriptors.add(descriptor);
-						}
-					}
-				}
-			}
-		}
-
-		// Add descriptors for existing attributes that don't already have one
-		if (attributes != null) {
-			for (int i = 0; i < attributes.getLength(); i++) {
-				Attr attr = (Attr) attributes.item(i);
-				String attrName = attr.getName();
-				if (fCaseSensitive) {
-					if (!descriptorNames.contains(attrName)) {
-						descriptorNames.add(attrName);
-						descriptors.add(createDefaultPropertyDescriptor(attrName));
-					}
-				}
-				else {
-					boolean exists = false;
-					for (int j = 0; j < descriptorNames.size(); j++)
-						exists = (descriptorNames.get(j).toString().equalsIgnoreCase(attrName)) || exists;
-					if (!exists) {
-						descriptorNames.add(attrName);
-						descriptors.add(createDefaultPropertyDescriptor(attrName));
-					}
-				}
-			}
-		}
-
-		// Update fDescriptors
-		IPropertyDescriptor[] newDescriptors = new IPropertyDescriptor[descriptors.size()];
-		for (int i = 0; i < newDescriptors.length; i++)
-			newDescriptors[i] = (IPropertyDescriptor) descriptors.get(i);
-		fDescriptors = newDescriptors;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/IDOMSourceEditingTextTools.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/IDOMSourceEditingTextTools.java
deleted file mode 100644
index a018b08..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/IDOMSourceEditingTextTools.java
+++ /dev/null
@@ -1,68 +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.ui.internal.provisional;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.NodeLocation;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public interface IDOMSourceEditingTextTools extends ISourceEditingTextTools {
-	/**
-	 * Returns a W3C DOM document
-	 * 
-	 * @return Document object or <code>null</code> if corresponding
-	 *         document does not exist
-	 */
-	Document getDOMDocument();
-
-	/**
-	 * Returns the W3C DOM Node at the given offset
-	 * 
-	 * @param offset
-	 *            the offset within the IDocument
-	 * @return a Node at that location, if one is present
-	 * 
-	 * @throws BadLocationException
-	 *             for invalid offsets
-	 */
-	Node getNode(int offset) throws BadLocationException;
-
-	/**
-	 * Returns a NodeLocation object describing the position information of
-	 * the Node's start and end tags.
-	 * 
-	 * @param node
-	 * @return The NodeLocation for this Node, null for unsupported Node
-	 *         instances.
-	 */
-	NodeLocation getNodeLocation(Node node);
-
-	/**
-	 * Returns the current server-side page language for the Document of the
-	 * given Node.
-	 * 
-	 * @return The server-side page language for this nodem null for Nodes
-	 *         within unsupported Documents.
-	 */
-	String getPageLanguage(Node node);
-
-	/**
-	 * Returns start offset of given Node.
-	 * 
-	 * @param node
-	 *            w3c <code>Node</code> object to check
-	 * @return the start offset or -1 for unsupported Nodes
-	 */
-	int getStartOffset(Node node);
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/XMLSourceEditingTextTools.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/XMLSourceEditingTextTools.java
deleted file mode 100644
index 099ccc9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/XMLSourceEditingTextTools.java
+++ /dev/null
@@ -1,176 +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.ui.internal.provisional;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.ui.IEditorPart;
-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.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.NodeLocation;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Implements ISourceEditingTextTools interface
- */
-public class XMLSourceEditingTextTools implements IDOMSourceEditingTextTools, INodeAdapter {
-
-	protected class NodeLocationImpl implements NodeLocation {
-		private IDOMNode node;
-
-		public NodeLocationImpl(IDOMNode xmlnode) {
-			super();
-			node = xmlnode;
-		}
-
-		public int getEndTagEndOffset() {
-			if (node.getEndStructuredDocumentRegion() != null)
-				return node.getEndStructuredDocumentRegion().getEndOffset();
-			return -1;
-		}
-
-		public int getEndTagStartOffset() {
-			if (node.getEndStructuredDocumentRegion() != null)
-				return node.getEndStructuredDocumentRegion().getStartOffset();
-			return -1;
-		}
-
-		public int getStartTagEndOffset() {
-			if (node.getStartStructuredDocumentRegion() != null)
-				return node.getStartStructuredDocumentRegion().getEndOffset();
-			return -1;
-		}
-
-		public int getStartTagStartOffset() {
-			if (node.getStartStructuredDocumentRegion() != null)
-				return node.getStartStructuredDocumentRegion().getStartOffset();
-			return -1;
-		}
-	}
-
-	StructuredTextEditor fTextEditor = null;
-
-	public int getCaretOffset() {
-		StructuredTextViewer stv = fTextEditor.getTextViewer();
-		if (stv != null && stv.getTextWidget() != null && !stv.getTextWidget().isDisposed()) {
-			return stv.widgetOffset2ModelOffset(stv.getTextWidget().getCaretOffset());
-		}
-		return 0;
-	}
-
-	public IDocument getDocument() {
-		return fTextEditor.getDocumentProvider().getDocument(fTextEditor.getEditorInput());
-	}
-
-	public Document getDOMDocument() {
-		return (Document) fTextEditor.getModel().getAdapter(Document.class);
-	}
-
-	/*
-	 * If similar function is needed, composite it around the text editor's
-	 * instance. Removed also because it returns an alread-released model
-	 * 
-	 * public Document getDOMDocument(IMarker marker) { if (marker == null)
-	 * return null;
-	 * 
-	 * IResource res = marker.getResource(); if (res == null || !(res
-	 * instanceof IFile)) return null;
-	 * 
-	 * IModelManager mm = StructuredModelManager.getModelManager();
-	 * IStructuredModel model = null; try { model =
-	 * mm.getExistingModelForRead((IFile) res); if (model == null || !(model
-	 * instanceof IDOMModel)) return null;
-	 * 
-	 * return ((IDOMModel) model).getDocument(); } finally { if (model !=
-	 * null) model.releaseFromRead(); } }
-	 */
-
-	public IEditorPart getEditorPart() {
-		return fTextEditor.getEditorPart();
-	}
-
-	public Node getNode(int offset) throws BadLocationException {
-		Node node = null;
-		if (0 <= offset && offset <= getDocument().getLength()) {
-			node = (Node) fTextEditor.getModel().getIndexedRegion(offset);
-		}
-		else {
-			throw new BadLocationException();
-		}
-		return node;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.extensions.SourceEditingTextTools#getNodeLocation(org.w3c.dom.Node)
-	 */
-	public NodeLocation getNodeLocation(Node node) {
-		if (node.getNodeType() == Node.ELEMENT_NODE && node instanceof IDOMNode)
-			return new NodeLocationImpl((IDOMNode) node);
-		return null;
-	}
-
-	public String getPageLanguage(Node node) {
-		return ""; //$NON-NLS-1$
-	}
-
-	public ITextSelection getSelection() {
-		return (ITextSelection) fTextEditor.getSelectionProvider().getSelection();
-	}
-
-	/**
-	 * IExtendedMarkupEditor method
-	 */
-	// public List getSelectedNodes() {
-	// ViewerSelectionManager vsm = getViewerSelectionManager();
-	// return (vsm != null) ? vsm.getSelectedNodes() : null;
-	// }
-	public int getStartOffset(Node node) {
-		if (node == null || !(node instanceof IDOMText))
-			return -1;
-
-		IStructuredDocumentRegion fnode = ((IDOMText) node).getFirstStructuredDocumentRegion();
-		return fnode.getStartOffset();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.core.INodeAdapter#isAdapterForType(java.lang.Object)
-	 */
-	public boolean isAdapterForType(Object type) {
-		return ISourceEditingTextTools.class.equals(type);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.core.INodeAdapter#notifyChanged(org.eclipse.wst.sse.core.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) {
-	}
-
-	public void setTextEditor(StructuredTextEditor editor) {
-		fTextEditor = editor;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/registry/AdapterFactoryProviderForXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/registry/AdapterFactoryProviderForXML.java
deleted file mode 100644
index 09b9df1..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/registry/AdapterFactoryProviderForXML.java
+++ /dev/null
@@ -1,88 +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.ui.internal.registry;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-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.core.internal.util.Assert;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
-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.modelhandler.ModelHandlerForXML;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.ui.internal.DOMObserver;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
-
-/**
- *  
- */
-public class AdapterFactoryProviderForXML implements AdapterFactoryProvider {
-
-	/*
-	 * @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
-	 */
-	public void addAdapterFactories(IStructuredModel structuredModel) {
-
-		// add the normal content based factories to model's registry
-		addContentBasedFactories(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 JFaceNodeAdapterFactory();
-			factoryRegistry.addFactory(factory);
-		}
-
-		// cs... added for inferred grammar support
-		//
-		if (structuredModel != null) {
-			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(structuredModel);
-			if (modelQuery != null) {
-				CMDocumentManager documentManager = modelQuery.getCMDocumentManager();
-				if (documentManager != null) {
-					IPreferenceStore store = XMLUIPlugin.getDefault().getPreferenceStore();
-					boolean useInferredGrammar = (store != null) ? store.getBoolean(XMLUIPreferenceNames.USE_INFERRED_GRAMMAR) : true;
-
-					documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_ASYNC_LOAD, true);
-					documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD, false);
-					documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_USE_CACHED_RESOLVED_URI, true);
-					DOMObserver domObserver = new DOMObserver(structuredModel);
-					domObserver.setGrammarInferenceEnabled(useInferredGrammar);
-					domObserver.init();
-				}
-			}
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider#isFor(org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler)
-	 */
-	public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
-		return (contentTypeDescription instanceof ModelHandlerForXML);
-	}
-
-	public void reinitializeFactories(IStructuredModel structuredModel) {
-		// nothing to do, since no embedded type
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesActionDelegate.java
deleted file mode 100644
index 84f2ec9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesActionDelegate.java
+++ /dev/null
@@ -1,34 +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.ui.internal.search;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionDelegate;
-
-/**
- * Sets up FindOccurrencesActionDelegate for xml find occurrences processors
- */
-public class XMLFindOccurrencesActionDelegate extends FindOccurrencesActionDelegate {
-	private List fProcessors;
-
-	protected List getProcessors() {
-		if (fProcessors == null) {
-			fProcessors = new ArrayList();
-			XMLFindOccurrencesProcessor htmlProcessor = new XMLFindOccurrencesProcessor();
-			fProcessors.add(htmlProcessor);
-		}
-		return fProcessors;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesProcessor.java
deleted file mode 100644
index 9fac53e..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesProcessor.java
+++ /dev/null
@@ -1,31 +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.ui.internal.search;
-
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
-import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-/**
- * Configures a FindOccurrencesProcessor with XML partitions and regions
- */
-public class XMLFindOccurrencesProcessor extends FindOccurrencesProcessor {
-
-	protected String[] getPartitionTypes() {
-		return new String[]{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.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectEnclosingXMLActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectEnclosingXMLActionDelegate.java
deleted file mode 100644
index 4efac6b..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectEnclosingXMLActionDelegate.java
+++ /dev/null
@@ -1,70 +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.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.selection.StructuredSelectActionDelegate;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Node;
-
-public class StructuredSelectEnclosingXMLActionDelegate extends StructuredSelectActionDelegate {
-
-	protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
-		IndexedRegion indexedRegion = null;
-		
-		indexedRegion = getIndexedRegion(document, textSelection.getOffset());
-
-		return indexedRegion;
-	}
-
-	protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
-		Region newRegion = null;
-		if (indexedRegion instanceof Node) {
-			Node cursorNode = (Node) indexedRegion;
-
-			// use parent node for empty text node
-			if (cursorNode.getNodeType() == Node.TEXT_NODE && cursorNode.getNodeValue().trim().length() == 0) {
-				cursorNode = cursorNode.getParentNode();
-
-				if (cursorNode instanceof IndexedRegion)
-					indexedRegion = (IndexedRegion) cursorNode;
-			}
-
-			Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
-
-			if (cursorNodeRegion.getOffset() >= textSelection.getOffset() && cursorNodeRegion.getOffset() <= textSelection.getOffset() + textSelection.getLength() && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= textSelection.getOffset() && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= textSelection.getOffset() + textSelection.getLength()) {
-				Node newNode = cursorNode.getParentNode();
-
-				if (newNode instanceof IndexedRegion) {
-					IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
-					newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
-				}
-			}
-			else
-				newRegion = cursorNodeRegion;
-		}
-		return newRegion;
-	}
-
-	public void init(IAction action) {
-		if (action != null) {
-			action.setText(XMLUIMessages.StructureSelectEnclosing_label);
-			action.setToolTipText(XMLUIMessages.StructureSelectEnclosing_tooltip);
-			action.setDescription(XMLUIMessages.StructureSelectEnclosing_description);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectNextXMLActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectNextXMLActionDelegate.java
deleted file mode 100644
index 25b385d..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectNextXMLActionDelegate.java
+++ /dev/null
@@ -1,105 +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.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.selection.StructuredSelectActionDelegate;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Node;
-
-public class StructuredSelectNextXMLActionDelegate extends StructuredSelectActionDelegate {
-
-	protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
-		int offset = textSelection.getOffset() + textSelection.getLength() - 1;
-		if (offset < 0)
-			offset = 0;
-
-		IndexedRegion indexedRegion = null;
-
-		indexedRegion = getIndexedRegion(document, offset);
-
-		return indexedRegion;
-	}
-
-	protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
-		Region newRegion = null;
-		if (indexedRegion instanceof Node) {
-			Node cursorNode = (Node) indexedRegion;
-
-			// use parent node for empty text node
-			if (cursorNode.getNodeType() == Node.TEXT_NODE && cursorNode.getNodeValue().trim().length() == 0) {
-				cursorNode = cursorNode.getParentNode();
-
-				if (cursorNode instanceof IndexedRegion)
-					indexedRegion = (IndexedRegion) cursorNode;
-			}
-
-			Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
-			int currentOffset = textSelection.getOffset();
-			int currentEndOffset = currentOffset + textSelection.getLength();
-			if (cursorNodeRegion.getOffset() >= currentOffset && cursorNodeRegion.getOffset() <= currentEndOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset) {
-				newRegion = getNewSelectionRegion2(indexedRegion, textSelection);
-			}
-			else
-				newRegion = cursorNodeRegion;
-		}
-		return newRegion;
-	}
-
-	public void init(IAction action) {
-		if (action != null) {
-			action.setText(XMLUIMessages.StructureSelectNext_label);
-			action.setToolTipText(XMLUIMessages.StructureSelectNext_tooltip);
-			action.setDescription(XMLUIMessages.StructureSelectNext_description);
-		}
-	}
-
-	/**
-	 * This method was separated out from getNewSelectionRegion2 because the
-	 * code in here is allowed to be called recursively.
-	 * 
-	 * @param indexedRegion
-	 * @param textSelection
-	 * @return new region to select or null if none
-	 */
-	private Region getNewSelectionRegion2(IndexedRegion indexedRegion, ITextSelection textSelection) {
-		Region newRegion = null;
-		if (indexedRegion instanceof Node) {
-			Node node = (Node) indexedRegion;
-			Node newNode = node.getNextSibling();
-			if (newNode == null) {
-				newNode = node.getParentNode();
-
-				if (newNode instanceof IndexedRegion) {
-					IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
-					newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
-				}
-			}
-			else {
-				if (newNode instanceof IndexedRegion) {
-					IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
-					newRegion = new Region(textSelection.getOffset(), newIndexedRegion.getEndOffset() - textSelection.getOffset());
-
-					if (newNode.getNodeType() == Node.TEXT_NODE)
-						newRegion = getNewSelectionRegion2(newIndexedRegion, new TextSelection(newRegion.getOffset(), newRegion.getLength()));
-				}
-			}
-		}
-		return newRegion;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectPreviousXMLActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectPreviousXMLActionDelegate.java
deleted file mode 100644
index 52b2062..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectPreviousXMLActionDelegate.java
+++ /dev/null
@@ -1,85 +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.ui.internal.selection;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.selection.StructuredSelectActionDelegate;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.w3c.dom.Node;
-
-public class StructuredSelectPreviousXMLActionDelegate extends StructuredSelectActionDelegate {
-
-	protected IndexedRegion getCursorIndexedRegion(IDocument document, ITextSelection textSelection) {
-		IndexedRegion indexedRegion = null;
-
-		indexedRegion = getIndexedRegion(document, textSelection.getOffset());
-
-		return indexedRegion;
-	}
-
-	protected Region getNewSelectionRegion(IndexedRegion indexedRegion, ITextSelection textSelection) {
-		Region newRegion = null;
-		if (indexedRegion instanceof Node) {
-			Node cursorNode = (Node) indexedRegion;
-
-			// use parent node for empty text node
-			if (cursorNode.getNodeType() == Node.TEXT_NODE && cursorNode.getNodeValue().trim().length() == 0) {
-				cursorNode = cursorNode.getParentNode();
-
-				if (cursorNode instanceof IndexedRegion)
-					indexedRegion = (IndexedRegion) cursorNode;
-			}
-
-			Region cursorNodeRegion = new Region(indexedRegion.getStartOffset(), indexedRegion.getEndOffset() - indexedRegion.getStartOffset());
-
-			if (cursorNodeRegion.getOffset() >= textSelection.getOffset() && cursorNodeRegion.getOffset() <= textSelection.getOffset() + textSelection.getLength() && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= textSelection.getOffset() && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= textSelection.getOffset() + textSelection.getLength()) {
-				Node newNode = cursorNode.getPreviousSibling();
-				if (newNode == null) {
-					newNode = cursorNode.getParentNode();
-
-					if (newNode instanceof IndexedRegion) {
-						IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
-						newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
-					}
-				}
-				else {
-					if (newNode instanceof IndexedRegion) {
-						IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
-						newRegion = new Region(newIndexedRegion.getStartOffset(), textSelection.getOffset() + textSelection.getLength() - newIndexedRegion.getStartOffset());
-
-						if (newNode.getNodeType() == Node.TEXT_NODE)
-							newRegion = getNewSelectionRegion(newIndexedRegion, new TextSelection(newRegion.getOffset(), newRegion.getLength()));
-					}
-				}
-
-			}
-			else
-				newRegion = cursorNodeRegion;
-		}
-		return newRegion;
-	}
-
-	public void init(IAction action) {
-		if (action != null) {
-			action.setText(XMLUIMessages.StructureSelectPrevious_label);
-			action.setToolTipText(XMLUIMessages.StructureSelectPrevious_tooltip);
-			action.setDescription(XMLUIMessages.StructureSelectPrevious_description);
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/IStyleConstantsXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/IStyleConstantsXML.java
deleted file mode 100644
index c14086f..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/IStyleConstantsXML.java
+++ /dev/null
@@ -1,41 +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.ui.internal.style;
-
-/**
- * Contains the symbolic name of styles used by LineStyleProvider,
- * ColorManager, and any others who may be interested
- */
-public interface IStyleConstantsXML {
-	public static final String BACKGROUND = "background"; //$NON-NLS-1$
-	public static final String CDATA_BORDER = "cdataBorder";//$NON-NLS-1$
-	public static final String CDATA_TEXT = "cdataText";//$NON-NLS-1$
-	public static final String COMMENT_BORDER = "commentBorder";//$NON-NLS-1$
-	public static final String COMMENT_TEXT = "commentText";//$NON-NLS-1$
-	public static final String DECL_BORDER = "declBoder";//$NON-NLS-1$
-	public static final String DOCTYPE_EXTERNAL_ID = "doctypeExternalId";//$NON-NLS-1$
-	public static final String DOCTYPE_EXTERNAL_ID_PUBREF = "doctypeExternalPubref";//$NON-NLS-1$
-	public static final String DOCTYPE_EXTERNAL_ID_SYSREF = "doctypeExtrenalSysref";//$NON-NLS-1$
-	public static final String DOCTYPE_NAME = "doctypeName";//$NON-NLS-1$
-
-	public static final String FOREGROUND = "foreground"; //$NON-NLS-1$
-	public static final String PI_BORDER = "piBorder";//$NON-NLS-1$
-	public static final String PI_CONTENT = "piContent";//$NON-NLS-1$
-
-	public static final String TAG_ATTRIBUTE_EQUALS = "tagAttributeEquals"; //$NON-NLS-1$
-	public static final String TAG_ATTRIBUTE_NAME = "tagAttributeName";//$NON-NLS-1$
-	public static final String TAG_ATTRIBUTE_VALUE = "tagAttributeValue";//$NON-NLS-1$
-	public static final String TAG_BORDER = "tagBorder";//$NON-NLS-1$
-	public static final String TAG_NAME = "tagName";//$NON-NLS-1$
-	public static final String XML_CONTENT = "xmlContent";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/LineStyleProviderForXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/LineStyleProviderForXML.java
deleted file mode 100644
index a56a635..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/LineStyleProviderForXML.java
+++ /dev/null
@@ -1,170 +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.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.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.XMLUIPlugin;
-
-public class LineStyleProviderForXML extends AbstractLineStyleProvider implements LineStyleProvider {
-	public LineStyleProviderForXML() {
-		super();
-	}
-
-	protected TextAttribute getAttributeFor(ITextRegion region) {
-		/**
-		 * a method to centralize all the "format rules" for regions
-		 * specifically associated for how to "open" the region.
-		 */
-		// not sure why this is coming through null, but just to catch it
-		if (region == null) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_TEXT);
-		}
-		String type = region.getType();
-		if ((type == DOMRegionContext.XML_CONTENT) || (type == DOMRegionContext.XML_DOCTYPE_INTERNAL_SUBSET)) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
-		} else if ((type == DOMRegionContext.XML_TAG_OPEN) || (type == DOMRegionContext.XML_END_TAG_OPEN) || (type == DOMRegionContext.XML_TAG_CLOSE) || (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_BORDER);
-		} else if ((type == DOMRegionContext.XML_CDATA_OPEN) || (type == DOMRegionContext.XML_CDATA_CLOSE)) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_BORDER);
-		} else if (type == DOMRegionContext.XML_CDATA_TEXT) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_TEXT);
-		} else if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
-		} else if (type == DOMRegionContext.XML_DOCTYPE_DECLARATION) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_NAME);
-		} else if (type == DOMRegionContext.XML_TAG_NAME) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_NAME);
-		} else if ((type == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
-		} else if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
-		} else if ((type == DOMRegionContext.XML_COMMENT_OPEN) || (type == DOMRegionContext.XML_COMMENT_CLOSE)) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.COMMENT_BORDER);
-		} else if (type == DOMRegionContext.XML_COMMENT_TEXT) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.COMMENT_TEXT);
-		} else if (type == DOMRegionContext.XML_DOCTYPE_NAME) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DOCTYPE_NAME);
-		} else if (type == DOMRegionContext.XML_PI_CONTENT) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.PI_CONTENT);
-		} else if ((type == DOMRegionContext.XML_PI_OPEN) || (type == DOMRegionContext.XML_PI_CLOSE)) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.PI_BORDER);
-		} else if ((type == DOMRegionContext.XML_DECLARATION_OPEN) || (type == DOMRegionContext.XML_DECLARATION_CLOSE)) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DECL_BORDER);
-		} else if (type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
-		} else if (type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
-		} else if (type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBLIC || type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSTEM) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
-		} else if (type == DOMRegionContext.UNDEFINED) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_TEXT);
-		} else if (type == DOMRegionContext.WHITE_SPACE) {
-			// white space is normall not on its own ... but when it is, we'll
-			// treat as content
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
-		} else if ((type == DOMRegionContext.XML_CHAR_REFERENCE) || (type == DOMRegionContext.XML_ENTITY_REFERENCE) || (type == DOMRegionContext.XML_PE_REFERENCE)) {
-			// we may want to character and entity references to have it own
-			// color in future,
-			// but for now, we'll make attribute value
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
-		} else {
-			// default, return null to signal "not handled"
-			// in which case, other factories should be tried
-			return null;
-		}
-	}
-
-	protected IPreferenceStore getColorPreferences() {
-		return XMLUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	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;
-			}
-		}
-
-		if (styleKey != null) {
-			// overwrite style preference with new value
-			addTextAttribute(styleKey);
-			super.handlePropertyChange(event);
-		}
-	}
-
-	/**
-	 * Loads text attributes into map. Make sure map is cleared before calling
-	 * this.
-	 */
-	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);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java
deleted file mode 100644
index 860a4f9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java
+++ /dev/null
@@ -1,174 +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.ui.internal.taginfo;
-
-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.CMDocumentation;
-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.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDescriptionBuilder;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-/**
- * Provides basic tag information such as element/attribute name, data type,
- * and tag info/documentation for CMNodes. Uses HTML to enhance presentation.
- */
-public class MarkupTagInfoProvider {
-	protected final static String BOLD_END = "</b>"; //$NON-NLS-1$
-	protected final static String BOLD_START = "<b>"; //$NON-NLS-1$
-	protected final static String HEADING_END = "</h5>"; //$NON-NLS-1$
-	protected final static String HEADING_START = "<h5>"; //$NON-NLS-1$
-	protected final static String LIST_BEGIN = "<ul>"; //$NON-NLS-1$
-	protected final static String LIST_ELEMENT = "<li>"; //$NON-NLS-1$
-	protected final static String NEW_LINE = "<dl>"; //$NON-NLS-1$
-	protected final static String PARAGRAPH_END = "</p>"; //$NON-NLS-1$
-	protected final static String PARAGRAPH_START = "<p>"; //$NON-NLS-1$
-	protected final static String SPACE = " "; //$NON-NLS-1$
-
-	/**
-	 * Returns basic tag information for display given a CMNode
-	 *  
-	 * @return String
-	 */
-	public String getInfo(CMNode node) {
-		if (node == null)
-			return null;
-		StringBuffer sb = new StringBuffer();
-		// we assume that if there is tagInfo present, only display tagInfo
-		printTagInfo(sb, node);
-
-		// no tagInfo present, so try to display tag description
-		if (sb.length() == 0) {
-			printDescription(sb, node);
-		}
-
-		// no tag description present either, so display default info
-		if (sb.length() == 0) {
-			printDefaultInfo(node, sb);
-		}
-
-		return sb.toString();
-	}
-
-	/**
-	 * Adds dataType's data type information, including enumerated type values
-	 * to string buffer, sb
-	 * 
-	 */
-	protected void printDataTypeInfo(StringBuffer sb, CMDataType dataType) {
-		String dataTypeName = dataType.getNodeName();
-		if ((dataTypeName != null) && (dataTypeName.length() > 0)) {
-			sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Data_Type____4 + SPACE + BOLD_END);
-			sb.append(dataTypeName);
-			sb.append(PARAGRAPH_END);
-		}
-		String[] enumeratedValue = dataType.getEnumeratedValues();
-		if (enumeratedValue != null && enumeratedValue.length > 0) {
-			sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Enumerated_Values____5 + SPACE + BOLD_END);
-			sb.append(LIST_BEGIN);
-			for (int i = 0; i < enumeratedValue.length; i++) {
-				sb.append(LIST_ELEMENT + enumeratedValue[i]);
-			}
-			sb.append(PARAGRAPH_END);
-		}
-	}
-
-	/**
-	 * Adds the default info (element name, content model, data type) of
-	 * CMNode to the string buffer, sb
-	 * 
-	 */
-	protected void printDefaultInfo(CMNode node, StringBuffer sb) {
-		{
-
-			if (node.getNodeType() == CMNode.ELEMENT_DECLARATION) {
-				CMElementDeclaration ed = (CMElementDeclaration) node;
-				sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Element____1 + SPACE + BOLD_END);
-				sb.append(node.getNodeName());
-				sb.append(PARAGRAPH_END);
-				if (ed.getContentType() == CMElementDeclaration.PCDATA) {
-					CMDataType dataType = ed.getDataType();
-					if (dataType != null) {
-						printDataTypeInfo(sb, dataType);
-					}
-				} else {
-					CMDescriptionBuilder builder = new CMDescriptionBuilder();
-					String description = builder.buildDescription(node);
-					if ((description != null) && (description.length() > 0)) {
-						sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Content_Model____2 + SPACE + BOLD_END);
-						sb.append(description + PARAGRAPH_END);
-					}
-				}
-				printDocumentation(sb, node);
-			} else if (node.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
-				CMAttributeDeclaration ad = (CMAttributeDeclaration) node;
-				sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Attribute____3 + SPACE + BOLD_END);
-				sb.append(node.getNodeName());
-				sb.append(PARAGRAPH_END);
-				CMDataType dataType = ad.getAttrType();
-				if (dataType != null) {
-					printDataTypeInfo(sb, dataType);
-				}
-				printDocumentation(sb, node);
-			} else if (node.getNodeType() == CMNode.DATA_TYPE) {
-				sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Data_Type____4 + SPACE + BOLD_END);
-				sb.append(node.getNodeName());
-				sb.append(PARAGRAPH_END);
-				printDocumentation(sb, node);
-			}
-		}
-	}
-
-	/**
-	 * Adds the description property of the CMNode to the string buffer, sb
-	 * 
-	 */
-	protected void printDescription(StringBuffer sb, CMNode node) {
-		String tagInfo = (String) node.getProperty("description"); //$NON-NLS-1$
-		if (tagInfo != null) {
-			sb.append(PARAGRAPH_START + tagInfo.trim() + PARAGRAPH_END);
-		}
-	}
-
-	/**
-	 * Adds the tag documentation property of the CMNode to the string buffer,
-	 * sb
-	 * 
-	 */
-	protected void printDocumentation(StringBuffer sb, CMNode node) {
-		CMNodeList nodeList = (CMNodeList) node.getProperty("documentation"); //$NON-NLS-1$
-		if ((nodeList != null) && (nodeList.getLength() > 0)) {
-			sb.append(NEW_LINE);
-			for (int i = 0; i < nodeList.getLength(); i++) {
-				CMDocumentation documentation = (CMDocumentation) nodeList.item(i);
-				String doc = documentation.getValue();
-				if (doc != null) {
-					sb.append(PARAGRAPH_START + doc.trim() + PARAGRAPH_END);
-				}
-			}
-		}
-	}
-
-	/**
-	 * Adds the tag info property of the CMNode to the string buffer, sb
-	 * 
-	 */
-	protected void printTagInfo(StringBuffer sb, CMNode node) {
-		String tagInfo = (String) node.getProperty("tagInfo"); //$NON-NLS-1$
-		if (tagInfo != null) {
-			sb.append(PARAGRAPH_START + tagInfo.trim() + PARAGRAPH_END);
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLInformationProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLInformationProvider.java
deleted file mode 100644
index 3dfee20..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLInformationProvider.java
+++ /dev/null
@@ -1,66 +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.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 XML tags (Shows tooltip description)
- * 
- * @author amywu
- */
-public class XMLInformationProvider implements IInformationProvider, IInformationProviderExtension {
-
-	private ITextHover fTextHover = null;
-
-	public XMLInformationProvider() {
-		fTextHover = SSEUIPlugin.getDefault().getTextHoverManager().createBestMatchHover(new XMLTagInfoHoverProcessor());
-	}
-
-	/*
-	 * (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);
-	}
-
-	/*
-	 * (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);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLTagInfoHoverProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLTagInfoHoverProcessor.java
deleted file mode 100644
index bb2177d..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLTagInfoHoverProcessor.java
+++ /dev/null
@@ -1,334 +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.ui.internal.taginfo;
-
-
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-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.internal.util.Debug;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-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.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.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- * Provides hover help documentation for xml tags
- * 
- * @author amywu
- * @see org.eclipse.jface.text.ITextHover
- */
-public class XMLTagInfoHoverProcessor implements ITextHover {
-	protected MarkupTagInfoProvider fInfoProvider = null;
-
-	/**
-	 * Constructor for XMLTextHoverProcessor.
-	 */
-	public XMLTagInfoHoverProcessor() {
-	}
-
-	/**
-	 * Retreives documentation to display in the hover help popup.
-	 * 
-	 * @return String any documentation information to display
-	 *         <code>null</code> if there is nothing to display.
-	 *  
-	 */
-	protected String computeHoverHelp(ITextViewer textViewer, int documentPosition) {
-		String result = null;
-
-		IndexedRegion treeNode = ContentAssistUtils.getNodeAt((StructuredTextViewer) textViewer, documentPosition);
-		if (treeNode == null)
-			return null;
-		Node node = (Node) treeNode;
-
-		while (node != null && node.getNodeType() == Node.TEXT_NODE && node.getParentNode() != null)
-			node = node.getParentNode();
-		IDOMNode parentNode = (IDOMNode) node;
-
-		IStructuredDocumentRegion flatNode = ((IStructuredDocument) textViewer.getDocument()).getRegionAtCharacterOffset(documentPosition);
-		if (flatNode != null) {
-			ITextRegion region = flatNode.getRegionAtCharacterOffset(documentPosition);
-			if (region != null) {
-				result = computeRegionHelp(treeNode, parentNode, flatNode, region);
-			}
-		}
-
-		return result;
-	}
-
-	/**
-	 * Computes the hoverhelp based on region
-	 * 
-	 * @return String hoverhelp
-	 */
-	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 == DOMRegionContext.XML_TAG_NAME)
-			result = computeTagNameHelp((IDOMNode) treeNode, parentNode, flatNode, region);
-		else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
-			result = computeTagAttNameHelp((IDOMNode) treeNode, parentNode, flatNode, region);
-		else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
-			result = computeTagAttValueHelp((IDOMNode) treeNode, parentNode, flatNode, region);
-		return result;
-	}
-
-	/**
-	 * Computes the hover help for the attribute name
-	 */
-	protected String computeTagAttNameHelp(IDOMNode xmlnode, IDOMNode parentNode, IStructuredDocumentRegion flatNode, ITextRegion region) {
-		CMElementDeclaration elementDecl = getCMElementDeclaration(xmlnode);
-		String attName = flatNode.getText(region);
-		CMAttributeDeclaration attDecl = getCMAttributeDeclaration(elementDecl, attName);
-		return getAdditionalInfo(elementDecl, attDecl);
-	}
-
-	/**
-	 * Computes the hover help for the attribute value (this is the same as
-	 * the attribute name's help)
-	 */
-	protected String computeTagAttValueHelp(IDOMNode xmlnode, IDOMNode parentNode, IStructuredDocumentRegion flatNode, ITextRegion region) {
-		CMElementDeclaration elementDecl = getCMElementDeclaration(xmlnode);
-		ITextRegion attrNameRegion = getAttrNameRegion(xmlnode, region);
-
-		String attName = flatNode.getText(attrNameRegion);
-		CMAttributeDeclaration attDecl = getCMAttributeDeclaration(elementDecl, attName);
-		return getAdditionalInfo(elementDecl, attDecl);
-	}
-
-	/**
-	 * Computes the hover help for the tag name
-	 */
-	protected String computeTagNameHelp(IDOMNode xmlnode, IDOMNode parentNode, IStructuredDocumentRegion flatNode, ITextRegion region) {
-		CMElementDeclaration elementDecl = getCMElementDeclaration(xmlnode);
-		CMElementDeclaration pelementDecl = getCMElementDeclaration(parentNode);
-		return getAdditionalInfo(pelementDecl, elementDecl);
-	}
-
-	/**
-	 * Retreives cmnode's documentation to display in the hover help popup. If
-	 * no documentation exists for cmnode, try displaying parentOrOwner's
-	 * documentation
-	 * 
-	 * @return String any documentation information to display for cmnode.
-	 *         <code>null</code> if there is nothing to display.
-	 */
-	protected String getAdditionalInfo(CMNode parentOrOwner, CMNode cmnode) {
-		String addlInfo = null;
-
-		if (cmnode == null) {
-			if (Debug.displayWarnings) {
-				new IllegalArgumentException("Null declaration!").printStackTrace(); //$NON-NLS-1$
-			}
-			return null;
-		}
-
-		addlInfo = getInfoProvider().getInfo(cmnode);
-		if (addlInfo == null && parentOrOwner != null)
-			addlInfo = getInfoProvider().getInfo(parentOrOwner);
-		return addlInfo;
-	}
-
-	/**
-	 * Find the region of the attribute name for the given attribute value
-	 * region
-	 * 
-	 */
-	protected ITextRegion getAttrNameRegion(IDOMNode node, ITextRegion region) {
-		// Find the attribute name for which this position should have a value
-		IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
-		ITextRegionList openRegions = open.getRegions();
-		int i = openRegions.indexOf(region);
-		if (i < 0)
-			return null;
-		ITextRegion nameRegion = null;
-		while (i >= 0) {
-			nameRegion = openRegions.get(i--);
-			if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
-				break;
-		}
-		return nameRegion;
-	}
-
-	/**
-	 * Retreives CMAttributeDeclaration indicated by attribute name within
-	 * elementDecl
-	 */
-	protected CMAttributeDeclaration getCMAttributeDeclaration(CMElementDeclaration elementDecl, String attName) {
-		CMAttributeDeclaration attrDecl = null;
-
-		if (elementDecl != null) {
-			CMNamedNodeMap attributes = elementDecl.getAttributes();
-			String noprefixName = DOMNamespaceHelper.getUnprefixedName(attName);
-			if (attributes != null) {
-				attrDecl = (CMAttributeDeclaration) attributes.getNamedItem(noprefixName);
-				if (attrDecl == null) {
-					attrDecl = (CMAttributeDeclaration) attributes.getNamedItem(attName);
-				}
-			}
-		}
-		return attrDecl;
-	}
-
-	/**
-	 * Retreives CMElementDeclaration for given node
-	 * 
-	 * @return CMElementDeclaration - CMElementDeclaration of node or
-	 *         <code>null</code> if not possible
-	 */
-	protected 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;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer,
-	 *      org.eclipse.jface.text.IRegion)
-	 */
-	public String getHoverInfo(ITextViewer viewer, IRegion hoverRegion) {
-		if ((hoverRegion == null) || (viewer == null) || (viewer.getDocument() == null))
-			return null;
-
-		String displayText = null;
-		int documentOffset = hoverRegion.getOffset();
-		displayText = computeHoverHelp(viewer, documentOffset);
-
-		return displayText;
-	}
-
-	/**
-	 * Returns the region to hover the text over based on the offset.
-	 * 
-	 * @param textViewer
-	 * @param offset
-	 * 
-	 * @return IRegion region to hover over if offset is within tag name,
-	 *         attribute name, or attribute value and if offset is not over
-	 *         invalid whitespace. otherwise, returns <code>null</code>
-	 * 
-	 * @see ITextHover#getHoverRegion(ITextViewer, int)
-	 */
-	public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
-		if ((textViewer == null) || (textViewer.getDocument() == null))
-			return null;
-
-		IStructuredDocumentRegion flatNode = ((IStructuredDocument) textViewer.getDocument()).getRegionAtCharacterOffset(offset);
-		ITextRegion region = null;
-
-		if (flatNode != null) {
-			region = flatNode.getRegionAtCharacterOffset(offset);
-		}
-
-		if (region != null) {
-			// only supply hoverhelp for tag name, attribute name, or
-			// attribute value
-			String regionType = region.getType();
-			if ((regionType == DOMRegionContext.XML_TAG_NAME) || (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) || (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
-				try {
-					// check if we are at whitespace before or after line
-					IRegion line = textViewer.getDocument().getLineInformationOfOffset(offset);
-					if ((offset > (line.getOffset())) && (offset < (line.getOffset() + line.getLength()))) {
-						// check if we are in region's trailing whitespace
-						// (whitespace after relevant info)
-						if (offset < flatNode.getTextEndOffset(region)) {
-							return new Region(flatNode.getStartOffset(region), region.getTextLength());
-						}
-					}
-				} catch (BadLocationException e) {
-					Logger.logException(e);
-				}
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * @deprecated if enabled flag is false, dont call getHoverRegion in the
-	 *             first place if true, use getHoverRegion(ITextViewer, int)
-	 */
-	public IRegion getHoverRegion(ITextViewer textViewer, int offset, boolean enabled) {
-		if ((!enabled) || (textViewer == null) || (textViewer.getDocument() == null))
-			return null;
-
-		IStructuredDocumentRegion flatNode = ((IStructuredDocument) textViewer.getDocument()).getRegionAtCharacterOffset(offset);
-		ITextRegion region = null;
-
-		if (flatNode != null) {
-			region = flatNode.getRegionAtCharacterOffset(offset);
-		}
-
-		if (region != null) {
-			// only supply hoverhelp for tag name, attribute name, or
-			// attribute value
-			String regionType = region.getType();
-			if ((regionType == DOMRegionContext.XML_TAG_NAME) || (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) || (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
-				try {
-					// check if we are at whitespace before or after line
-					IRegion line = textViewer.getDocument().getLineInformationOfOffset(offset);
-					if ((offset > (line.getOffset())) && (offset < (line.getOffset() + line.getLength()))) {
-						// check if we are in region's trailing whitespace
-						// (whitespace after relevant info)
-						if (offset < flatNode.getTextEndOffset(region)) {
-							return new Region(flatNode.getStartOffset(region), region.getTextLength());
-						}
-					}
-				} catch (BadLocationException e) {
-					Logger.logException(e);
-				}
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Gets the infoProvider.
-	 * 
-	 * @return Returns fInfoProvider and if fInfoProvider was
-	 *         <code>null</code> set fInfoProvider to DefaultInfoProvider
-	 */
-	public MarkupTagInfoProvider getInfoProvider() {
-		if (fInfoProvider == null) {
-			fInfoProvider = new MarkupTagInfoProvider();
-		}
-		return fInfoProvider;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/EncodingTemplateVariableResolverXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/EncodingTemplateVariableResolverXML.java
deleted file mode 100644
index 079b042..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/EncodingTemplateVariableResolverXML.java
+++ /dev/null
@@ -1,38 +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.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.SimpleTemplateVariableResolver;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-
-public class EncodingTemplateVariableResolverXML extends SimpleTemplateVariableResolver {
-	private static final String ENCODING_TYPE = getEncodingType();
-
-	private static String getEncodingType() {
-		return "encoding"; //$NON-NLS-1$
-	}
-
-	/**
-	 * Creates a new encoding variable
-	 */
-	public EncodingTemplateVariableResolverXML() {
-		super(ENCODING_TYPE, XMLUIMessages.Creating_files_encoding);
-	}
-
-	protected String resolve(TemplateContext context) {
-		return XMLCorePlugin.getDefault().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeIdsXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeIdsXML.java
deleted file mode 100644
index 07b2f78..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeIdsXML.java
+++ /dev/null
@@ -1,50 +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.ui.internal.templates;
-
-public class TemplateContextTypeIdsXML {
-
-	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 getPrefix() {
-		return "xml"; //$NON-NLS-1$
-	}
-
-	private static String getTag() {
-		return getPrefix() + "_tag"; //$NON-NLS-1$
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeXML.java
deleted file mode 100644
index 43ccf20..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeXML.java
+++ /dev/null
@@ -1,35 +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.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContextType;
-
-/**
- * Base class for XML template context types. Templates of this context type
- * apply to any place within XML content type.
- */
-public class TemplateContextTypeXML extends TemplateContextType {
-
-	public TemplateContextTypeXML() {
-		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 EncodingTemplateVariableResolverXML());
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/text/XMLDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/text/XMLDocumentRegionEdgeMatcher.java
deleted file mode 100644
index 75b33d8..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/text/XMLDocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,25 +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.ui.internal.text;
-
-import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-
-public class XMLDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
-
-
-	public XMLDocumentRegionEdgeMatcher() {
-		super(new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_COMMENT_TEXT, DOMRegionContext.XML_CDATA_TEXT, DOMRegionContext.XML_PI_OPEN, DOMRegionContext.XML_PI_CONTENT}, null);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/SharedXMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/SharedXMLEditorPluginImageHelper.java
deleted file mode 100644
index f3d932c..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/SharedXMLEditorPluginImageHelper.java
+++ /dev/null
@@ -1,72 +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.ui.internal.util;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-
-
-public class SharedXMLEditorPluginImageHelper {
-	public static final String IMG_DTOOL_CONSTRAINOFF = XMLEditorPluginImages.IMG_DTOOL_CONSTRAINOFF;
-	public static final String IMG_DTOOL_CONSTRAINON = XMLEditorPluginImages.IMG_DTOOL_CONSTRAINON;
-	public static final String IMG_DTOOL_RLDGRMR = XMLEditorPluginImages.IMG_DTOOL_RLDGRMR;
-	public static final String IMG_DTOOL_VALIDATE = XMLEditorPluginImages.IMG_DTOOL_VALIDATE;
-	public static final String IMG_ETOOL_CONSTRAINOFF = XMLEditorPluginImages.IMG_ETOOL_CONSTRAINOFF;
-	public static final String IMG_ETOOL_CONSTRAINON = XMLEditorPluginImages.IMG_ETOOL_CONSTRAINON;
-	public static final String IMG_ETOOL_RLDGRMR = XMLEditorPluginImages.IMG_ETOOL_RLDGRMR;
-	public static final String IMG_ETOOL_VALIDATE = XMLEditorPluginImages.IMG_ETOOL_VALIDATE;
-	public static final String IMG_OBJ_ATTRIBUTE = XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE;
-	public static final String IMG_OBJ_CDATASECTION = XMLEditorPluginImages.IMG_OBJ_CDATASECTION;
-	public static final String IMG_OBJ_COMMENT = XMLEditorPluginImages.IMG_OBJ_COMMENT;
-	public static final String IMG_OBJ_DOCTYPE = XMLEditorPluginImages.IMG_OBJ_DOCTYPE;
-	public static final String IMG_OBJ_ELEMENT = XMLEditorPluginImages.IMG_OBJ_ELEMENT;
-	public static final String IMG_OBJ_ENTITY = XMLEditorPluginImages.IMG_OBJ_ENTITY;
-	public static final String IMG_OBJ_ENTITY_REFERENCE = XMLEditorPluginImages.IMG_OBJ_ENTITY_REFERENCE;
-	public static final String IMG_OBJ_NOTATION = XMLEditorPluginImages.IMG_OBJ_NOTATION;
-	public static final String IMG_OBJ_PROCESSINGINSTRUCTION = XMLEditorPluginImages.IMG_OBJ_PROCESSINGINSTRUCTION;
-	public static final String IMG_OBJ_TAG_GENERIC = XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC;
-	public static final String IMG_OBJ_TAG_MACRO = XMLEditorPluginImages.IMG_OBJ_TAG_MACRO;
-	public static final String IMG_OBJ_TXTEXT = XMLEditorPluginImages.IMG_OBJ_TXTEXT;
-
-	/**
-	 * Retrieves the specified image from the xml source editor plugin's image
-	 * registry. Note: The returned <code>Image</code> is managed by the
-	 * workbench; clients must <b>not </b> dispose of the returned image.
-	 * 
-	 * @param symbolicName
-	 *            the symbolic name of the image; there are constants declared
-	 *            in this class for build-in images that come with the xml
-	 *            source editor
-	 * @return the image, or <code>null</code> if not found
-	 */
-	public static Image getImage(String symbolicName) {
-		return XMLEditorPluginImageHelper.getInstance().getImage(symbolicName);
-	}
-
-	/**
-	 * Retrieves the image descriptor for specified image from the xml source
-	 * editor plugin's image registry. Unlike <code>Image</code>s, image
-	 * descriptors themselves do not need to be disposed.
-	 * 
-	 * @param symbolicName
-	 *            the symbolic name of the image; there are constants declared
-	 *            in this interface for build-in images that come with the xml
-	 *            source editor
-	 * @return the image descriptor, or <code>null</code> if not found
-	 */
-	public static ImageDescriptor getImageDescriptor(String symbolicName) {
-		return XMLEditorPluginImageHelper.getInstance().getImageDescriptor(symbolicName);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonResources.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonResources.java
deleted file mode 100644
index 83f41f7..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonResources.java
+++ /dev/null
@@ -1,93 +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.ui.internal.util;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-/**
- * @deprecated use XMLUIPlugin.getResourceString() instead
- */
-/**
- * This class exists temporarily until the properties files can be
- * re-organized and the various resource references can be updated
- */
-public class XMLCommonResources {
-	protected static XMLCommonResources instance;
-
-	public synchronized static XMLCommonResources getInstance() {
-		if (instance == null)
-			instance = new XMLCommonResources(XMLUIPlugin.getDefault());
-		return instance;
-	}
-
-	private XMLUIPlugin editorPlugin;
-
-	private ResourceBundle resourceBundle;
-
-	public XMLCommonResources(XMLUIPlugin editorPlugin) {
-		instance = this;
-		this.editorPlugin = editorPlugin;
-		try {
-			resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.xml.ui.internal.XMLUIPluginResources"); //$NON-NLS-1$
-		} catch (MissingResourceException exception) {
-			//TODO... log an error message
-			//B2BUtilPlugin.getPlugin().getMsgLogger().write(B2BUtilPlugin.getGUIString("_WARN_PLUGIN_PROPERTIES_MISSING")
-			// + descriptor.getLabel());
-			resourceBundle = null;
-		}
-	}
-
-	 ImageDescriptor _getImageDescriptor(String iconName) {
-		return AbstractUIPlugin.imageDescriptorFromPlugin(XMLUIPlugin.ID, iconName);
-	}
-
-
-	public ResourceBundle getResourceBundle() {
-		return resourceBundle;
-	}
-
-	/**
-	 * This gets the string resource.
-	 */
-	public String getString(String key) {
-		return getResourceBundle().getString(key);
-	}
-
-	/**
-	 * This gets the string resource and does one substitution.
-	 */
-	public String getString(String key, Object s1) {
-		return MessageFormat.format(getString(key), new Object[]{s1});
-	}
-
-	/**
-	 * This gets the string resource and does two substitutions.
-	 */
-	public String getString(String key, Object s1, Object s2) {
-		return MessageFormat.format(getString(key), new Object[]{s1, s2});
-	}
-
-	public IWorkbench getWorkbench() {
-		return editorPlugin.getWorkbench();
-	}
-	/*
-	 * public ImageFactory getImageFactory() { return imageFactory; }
-	 */
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonUIContextIds.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonUIContextIds.java
deleted file mode 100644
index 832cfca..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonUIContextIds.java
+++ /dev/null
@@ -1,51 +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.ui.internal.util;
-
-/**
- * Context help id constants.
- */
-public interface XMLCommonUIContextIds {
-	public static final String PLUGIN_NAME = "org.eclipse.wst.xml.ui"; //$NON-NLS-1$
-
-	/* CONTEXT_ID xcui0500 for Edit Attribute Instruction Dialog */
-	public static final String XCUI_ATTRIBUTE_DIALOG = PLUGIN_NAME + ".xcui0500"; //$NON-NLS-1$
-
-	/* CONTEXT_ID xcui0400 for Select XML Catalog ID Dialog */
-	public static final String XCUI_CATALOG_DIALOG = PLUGIN_NAME + ".xcui0400"; //$NON-NLS-1$
-
-	/* CONTEXT_IDs for XML Common UI use xcuixxx context IDs */
-
-	/* CONTEXT_ID xcui0010 for Edit Doctype Dialog */
-	public static final String XCUI_DOCTYPE_DIALOG = PLUGIN_NAME + ".xcui0010"; //$NON-NLS-1$
-	/* CONTEXT_ID xcui0030 for Public ID Text Edit */
-	public static final String XCUI_DOCTYPE_PUBLIC = PLUGIN_NAME + ".xcui0030"; //$NON-NLS-1$
-	/* CONTEXT_ID xcui0020 for Root Element Name Text Edit */
-	public static final String XCUI_DOCTYPE_ROOT = PLUGIN_NAME + ".xcui0020"; //$NON-NLS-1$
-	/* CONTEXT_ID xcui0040 for System ID Text Edit */
-	public static final String XCUI_DOCTYPE_SYSTEM = PLUGIN_NAME + ".xcui0050"; //$NON-NLS-1$
-
-	/* CONTEXT_ID xcui0300 for Edit Element Instruction Dialog */
-	public static final String XCUI_ELEMENT_DIALOG = PLUGIN_NAME + ".xcui0600"; //$NON-NLS-1$
-
-	/* CONTEXT_ID xcui0200 for Edit Namespace Dialog */
-	public static final String XCUI_NAMESPACE_DIALOG = PLUGIN_NAME + ".xcui0200"; //$NON-NLS-1$
-
-	/* CONTEXT_ID xcui0300 for Edit Processing Instruction Dialog */
-	public static final String XCUI_PROCESSING_DIALOG = PLUGIN_NAME + ".xcui0300"; //$NON-NLS-1$
-
-	/* CONTEXT_ID xcui0100 for Edit Schema Information Dialog */
-	public static final String XCUI_SCHEMA_INFO_DIALOG = PLUGIN_NAME + ".xcui0100"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java
deleted file mode 100644
index 27ae4eb..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java
+++ /dev/null
@@ -1,489 +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
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.validation;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-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.Path;
-import org.eclipse.jface.text.BadLocationException;
-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.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.validation.internal.core.IMessageAccess;
-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.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.IDOMText;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * A DelegatingReconcileValidator calls its delegate validator to get a list
- * of validation error IMessages. Using information in this IMessage the
- * DelegatingReconcileValidator updates the IMessage with an offset and length
- * to give a good range to be "squiggled" and adds the messages to the
- * IReporter
- * 
- * @author Mark Hutchinson
- * 
- */
-public abstract class DelegatingSourceValidator implements IValidator {
-	// the selection strategies:
-	protected static final String ALL_ATTRIBUTES = "ALL_ATTRIBUTES"; //$NON-NLS-1$
-	protected static final String ATTRIBUTE_NAME = "ATTRIBUTE_NAME"; //$NON-NLS-1$
-	protected static final String ATTRIBUTE_VALUE = "ATTRIBUTE_VALUE"; //$NON-NLS-1$
-	protected static final String START_TAG = "START_TAG"; //$NON-NLS-1$
-	protected static final String TEXT = "TEXT"; //$NON-NLS-1$
-	protected static final String FIRST_NON_WHITESPACE_TEXT = "FIRST_NON_WHITESPACE_TEXT"; //$NON-NLS-1$
-	protected static final String TEXT_ENTITY_REFERENCE = "TEXT_ENTITY_REFERENCE"; //$NON-NLS-1$
-	protected static final String VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE = "VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE"; //$NON-NLS-1$
-
-	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$
-
-	public DelegatingSourceValidator() {
-		super(); // constructor
-	}
-
-	public void cleanup(IReporter arg0) { // don't need to implement
-	}
-
-	// My Implementation of IHelper
-	class MyHelper implements IValidationContext {
-		InputStream inputStream;
-
-		IFile file;
-
-		public MyHelper(InputStream inputStream, IFile file) {
-			this.inputStream = inputStream;
-			this.file = file;
-		}
-
-		public int getBuildKind() {
-			return 0;
-		}
-
-		public Object loadModel(String symbolicName, Object[] parms) {
-			if (symbolicName.equals("getFile")) { //$NON-NLS-1$
-				return file;
-			}
-			return null;
-		}
-
-		public Object loadModel(String symbolicName) {
-			if (symbolicName.equals("inputStream")) { //$NON-NLS-1$
-				return inputStream;
-			}
-			return null;
-		}
-
-		public String[] getURIs() {
-			if (file != null)
-				return new String[]{file.getFullPath().toString()};
-			return new String[0];
-		}
-	}
-
-	// My Implementation of IReporter
-	class MyReporter implements IReporter {
-		List list = new ArrayList();
-
-		public MyReporter() {
-			super();
-		}
-
-		public void addMessage(IValidator origin, IMessage message) {
-			list.add(message);
-		}
-
-		public void displaySubtask(IValidator validator, IMessage message) {
-			/* do not need to implement */
-		}
-
-		public IMessageAccess getMessageAccess() {
-			return null;
-		}
-
-		public boolean isCancelled() {
-			return false;
-		}
-
-		public void removeAllMessages(IValidator origin, Object object) { // do
-			/* do not need to implement */
-		}
-
-		public void removeAllMessages(IValidator origin) {
-			/* do not need to implement */
-		}
-
-		public void removeMessageSubset(IValidator validator, Object obj, String groupName) {// do
-			/* do not need to implement */
-		}
-
-		public List getMessages() {
-			return list;
-		}
-	}
-
-	protected abstract IValidator getDelegateValidator();
-
-	/**
-	 * Calls a delegate validator getting and updates it's list of
-	 * ValidationMessages with a good squiggle offset and length.
-	 * 
-	 * @param helper
-	 *            loads an object.
-	 * @param reporter
-	 *            Is an instance of an IReporter interface, which is used for
-	 *            interaction with the user.
-	 */
-	public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
-		String[] delta = helper.getURIs();
-		if (delta.length > 0) {
-			// get the file, model and document:
-			IFile file = getFile(delta[0]);
-			IDOMModel xmlModel = getModelForResource(file);
-			try {
-				IDOMDocument document = xmlModel.getDocument();
-
-				// store the text in a byte array; make a full copy to ease
-				// any threading problems
-				byte[] byteArray = xmlModel.getStructuredDocument().get().getBytes();
-
-				IValidator validator = getDelegateValidator();
-				if (validator != null) {
-					// Validate the file:
-					IValidationContext vHelper = new MyHelper(new ByteArrayInputStream(byteArray), file);
-					MyReporter vReporter = new MyReporter();
-					validator.validate(vHelper, vReporter);
-					List messages = vReporter.list;
-
-					// set the offset and length
-					updateValidationMessages(messages, document, reporter);
-				}
-			}
-
-
-			finally {
-				if (xmlModel != null)
-					xmlModel.releaseFromRead();
-			}
-		}
-	}
-
-	/**
-	 * iterates through the messages and calculates a "better" offset and
-	 * length
-	 * 
-	 * @param messages -
-	 *            a List of IMessages
-	 * @param document -
-	 *            the document
-	 * @param reporter -
-	 *            the reporter the messages are to be added to
-	 */
-	protected void updateValidationMessages(List messages, IDOMDocument document, IReporter reporter) {
-		for (int i = 0; i < messages.size(); i++) {
-			IMessage message = (IMessage) messages.get(i);
-			try {
-				if (message.getAttribute(COLUMN_NUMBER_ATTRIBUTE) != null) {
-					int column = ((Integer) message.getAttribute(COLUMN_NUMBER_ATTRIBUTE)).intValue();
-					String selectionStrategy = (String) message.getAttribute(SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE);
-					String nameOrValue = (String) message.getAttribute(SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE);
-
-					// convert the line and Column numbers to an offset:
-					int start = document.getStructuredDocument().getLineOffset(message.getLineNumber() - 1) + column - 1;
-
-					// calculate the "better" start and end offset:
-					int[] result = computeStartEndLocation(start, message.getText(), selectionStrategy, nameOrValue, document);
-					if (result != null) {
-						message.setOffset(result[0]);
-						message.setLength(result[1] - result[0]);
-						reporter.addMessage(this, message);
-					}
-				}
-			}
-			catch (BadLocationException e) { // this exception should not
-				// occur - it is thrown if
-				// trying to convert an
-				// invalid line number to and
-				// offset
-			}
-
-		}
-	}
-
-	/**
-	 * @param delta
-	 *            the IFileDelta containing the file name to get
-	 * @return the IFile
-	 */
-	public IFile getFile(String delta) {
-		IResource res = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(delta));
-		return res instanceof IFile ? (IFile) res : null;
-	}
-
-	/**
-	 * 
-	 * @param file
-	 *            the file to get the model for
-	 * @return the file's XMLModel
-	 */
-	protected IDOMModel getModelForResource(IFile file) {
-		IStructuredModel model = null;
-		IModelManager manager = StructuredModelManager.getModelManager();
-
-		try {
-			model = manager.getModelForRead(file);
-			// TODO.. HTML validator tries again to get a model a 2nd way
-		}
-		catch (Exception e) {
-			// e.printStackTrace();
-		}
-
-		return model instanceof IDOMModel ? (IDOMModel) model : null;
-	}
-
-	/**
-	 * Calculates the "better" offsets.
-	 * 
-	 * @param startOffset -
-	 *            the offset given by Xerces
-	 * @param errorMessage -
-	 *            the Xerces error Message
-	 * @param selectionStrategy -
-	 *            the selectionStrategy
-	 * @param document -
-	 *            the document
-	 * @return int[] - position 0 has the start offset of the squiggle range,
-	 *         position 1 has the endOffset
-	 */
-	/*
-	 * The way the offsets is calculated is: - find the indexed region
-	 * (element) closest to the given offset - if we are between two elements,
-	 * the one on the left is the one we want - based on the selectionStrategy
-	 * choose the underlining strategy (eg START_TAG means underline the start
-	 * tag of that element) - use information from nameOrValue and the DOM to
-	 * get better offsets
-	 * 
-	 */
-	protected int[] computeStartEndLocation(int startOffset, String errorMessage, String selectionStrategy, String nameOrValue, IDOMDocument document) {
-		try {
-			int startEndPositions[] = new int[2];
-
-			IndexedRegion region = document.getModel().getIndexedRegion(startOffset);
-			IndexedRegion prevRegion = document.getModel().getIndexedRegion(startOffset - 1);
-
-			if (prevRegion != region) {
-				// if between two regions, the one onthe left is the one we
-				// are interested in
-				region = prevRegion;
-			}
-
-			// initialize start and end positions to be the start positions
-			// this means if the
-			// special case is not taken care of below the start and end
-			// offset are set to be
-			// the start of the region where the error was
-			if (region != null) {
-				startEndPositions[0] = region.getStartOffset();
-				startEndPositions[1] = startEndPositions[0];
-			}
-			else { // this will message will not get added to the IReporter
-				// since the length is 0
-				startEndPositions[0] = 0;
-				startEndPositions[1] = 0;
-			}
-			if (region instanceof Node) {
-				Node node = (Node) region;
-
-				if (START_TAG.equals(selectionStrategy)) {// then we want to
-					// underline the opening tag
-					if (node.getNodeType() == Node.ELEMENT_NODE) {
-						IDOMElement element = (IDOMElement) node;
-						startEndPositions[0] = element.getStartOffset() + 1;
-						startEndPositions[1] = startEndPositions[0] + element.getTagName().length();
-					}
-				}
-				else if (ATTRIBUTE_NAME.equals(selectionStrategy)) { // in
-					// underline the attribute's name
-					if (node.getNodeType() == Node.ELEMENT_NODE) {
-						IDOMElement element = (IDOMElement) node;
-						IDOMNode attributeNode = (IDOMNode) (element.getAttributeNode(nameOrValue));
-						if (attributeNode != null) {
-							startEndPositions[0] = attributeNode.getStartOffset();
-							startEndPositions[1] = attributeNode.getStartOffset() + nameOrValue.length();
-						}
-					}
-				}
-				else if (ATTRIBUTE_VALUE.equals(selectionStrategy)) {
-					// underline the attribute's value
-					if (node.getNodeType() == Node.ELEMENT_NODE) {
-						IDOMElement element = (IDOMElement) node;
-						IDOMAttr attributeNode = (IDOMAttr) (element.getAttributeNode(nameOrValue));
-						if (attributeNode != null) {
-							startEndPositions[0] = attributeNode.getValueRegionStartOffset();
-							startEndPositions[1] = startEndPositions[0] + attributeNode.getValueRegionText().length();
-						}
-					}
-				}
-				else if (ALL_ATTRIBUTES.equals(selectionStrategy)) {
-					// underline all attributes
-					if (node.getNodeType() == Node.ELEMENT_NODE) {
-						IDOMElement element = (IDOMElement) node;
-						NamedNodeMap attributes = element.getAttributes();
-						if (attributes != null) {
-							IDOMNode first = (IDOMNode) attributes.item(0);
-							IDOMNode last = (IDOMNode) attributes.item(attributes.getLength() - 1);
-							if (first != null && last != null) {
-								startEndPositions[0] = first.getStartOffset();
-								startEndPositions[1] = last.getEndOffset();
-							}
-						}
-					}
-				}
-				else if (TEXT.equals(selectionStrategy)) {
-					// underline the text between the tags
-					if (node.getNodeType() == Node.TEXT_NODE) {
-						IDOMText textNode = (IDOMText) node;
-						int start = textNode.getStartOffset();
-						String value = textNode.getNodeValue();
-						int index = 0;
-						char curChar = value.charAt(index);
-						// here we are finding start offset by skipping over
-						// whitespace:
-						while (curChar == '\n' || curChar == '\t' || curChar == '\r' || curChar == ' ') {
-							curChar = value.charAt(index);
-							index++;
-						}
-						if (index > 0) {
-							index--;
-
-						}
-						start = start + index;
-						startEndPositions[0] = start + index;
-						startEndPositions[1] = start + value.trim().length();
-					}
-					else if (node.getNodeType() == Node.ELEMENT_NODE) {
-						IDOMElement element = (IDOMElement) node;
-						Node child = element.getFirstChild();
-						if (child instanceof IDOMNode) {
-							IDOMNode xmlChild = ((IDOMNode) child);
-							startEndPositions[0] = xmlChild.getStartOffset();
-							startEndPositions[1] = xmlChild.getEndOffset();
-						}
-					}
-				}
-				else if (FIRST_NON_WHITESPACE_TEXT.equals(selectionStrategy)) {
-					// search through all child nodes and return range of
-					// first non-whitespace
-					// text node
-					if (node.getNodeType() == Node.ELEMENT_NODE) {
-						NodeList nodes = node.getChildNodes();
-						for (int i = 0; i < nodes.getLength(); i++) {
-							Node currentNode = nodes.item(i);
-							if (currentNode.getNodeType() == Node.TEXT_NODE) {
-								IDOMText textNode = (IDOMText) currentNode;
-								if (textNode.getNodeValue().trim().length() > 0) {
-									String value = textNode.getNodeValue();
-									int index = 0;
-									int start = textNode.getStartOffset();
-									char curChar = value.charAt(index);
-									// here we are finding start offset by
-									// skipping over whitespace:
-									while (curChar == '\n' || curChar == '\t' || curChar == '\r' || curChar == ' ') {
-										curChar = value.charAt(index);
-										index++;
-									}
-									if (index > 0) {
-										index--;
-
-									}
-									start = start + index;
-									startEndPositions[0] = start;
-									startEndPositions[1] = start + value.trim().length();
-									break;
-								}
-							}
-
-						}
-					}
-				}
-
-				else if (TEXT_ENTITY_REFERENCE.equals(selectionStrategy)) {
-					if (node.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
-						startEndPositions[0] = region.getStartOffset();
-						startEndPositions[1] = region.getEndOffset();
-					}
-					else if (node.getNodeType() == Node.ELEMENT_NODE) {
-						/*
-						 * In this case the undeclared entity might be in one
-						 * of the attribute values. Search through the
-						 * attributes to find the range of the undeclared
-						 * entity.
-						 */
-						String entity = "&" + nameOrValue + ";"; //$NON-NLS-1$ //$NON-NLS-2$
-						NamedNodeMap attributes = node.getAttributes();
-						for (int i = 0; i < attributes.getLength(); i++) {
-							IDOMAttr attr = (IDOMAttr) attributes.item(i);
-							String nodeValue = attr.getNodeValue();
-							int index = nodeValue.indexOf(entity);
-							if (index != -1) {
-								startEndPositions[0] = attr.getValueRegionStartOffset() + index + 1;
-								startEndPositions[1] = startEndPositions[0] + entity.length();
-							}
-						}
-					}
-
-				}
-				else if (VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE.equals(selectionStrategy)) {
-					if (node.getNodeType() == Node.ELEMENT_NODE) {
-						// here we will search through all attributes for the
-						// one with the
-						// with the value we want:
-						NamedNodeMap attributes = node.getAttributes();
-						for (int i = 0; i < attributes.getLength(); i++) {
-							IDOMAttr attr = (IDOMAttr) attributes.item(i);
-							String nodeValue = attr.getNodeValue().trim();
-							if (nodeValue.equals(nameOrValue)) {
-								startEndPositions[0] = attr.getValueRegionStartOffset() + 1;
-								startEndPositions[1] = startEndPositions[0] + nodeValue.length();
-								break;
-							}
-						}
-					}
-				}
-			}
-			return startEndPositions;
-		}
-//		catch (Exception e) { // e.printStackTrace();
-//		}
-		finally {}
-//		return null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidatorForXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidatorForXML.java
deleted file mode 100644
index 985e3dd..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidatorForXML.java
+++ /dev/null
@@ -1,39 +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
- *******************************************************************************/
-
-package org.eclipse.wst.xml.ui.internal.validation;
-
-import org.eclipse.wst.validation.internal.provisional.ValidationFactory;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.ui.internal.Logger;
-
-/**
- * @author Mark Hutchinson
- * 
- */
-public class DelegatingSourceValidatorForXML extends DelegatingSourceValidator {
-	private final static String VALIDATOR_CLASS = "org.eclipse.wst.xml.ui.internal.validation.Validator"; //$NON-NLS-1$
-
-	public DelegatingSourceValidatorForXML() {
-		super();
-	}
-
-	protected IValidator getDelegateValidator() {
-		IValidator result = null;
-		try {
-			result = ValidationFactory.instance.getValidator(VALIDATOR_CLASS);
-		}
-		catch (InstantiationException e) {
-			Logger.logException(e);
-		}
-		return result;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java
deleted file mode 100644
index 95e9390..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java
+++ /dev/null
@@ -1,645 +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.ui.internal.validation;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.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.reconcile.AbstractStructuredTextReconcilingStrategy;
-import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.AnnotationInfo;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.IncrementalReporter;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.LocalizedMessage;
-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.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.correction.ProblemIDsXML;
-import org.w3c.dom.Node;
-
-/**
- * Basic XML syntax checking step.
- * Only used as ISourceValidator at the momment
- * 
- * @author pavery
- */
-public class MarkupValidator implements IValidator, ISourceValidator {
-	private String DQUOTE = "\""; //$NON-NLS-1$
-
-	protected String SEVERITY_ATTR_MISSING_VALUE = TemporaryAnnotation.ANNOT_ERROR;
-	protected String SEVERITY_ATTR_NO_VALUE = TemporaryAnnotation.ANNOT_ERROR;
-	// severities for the problems discoverable by this reconciler; possibly
-	// user configurable later
-	protected String SEVERITY_GENERIC_ILLFORMED_SYNTAX = TemporaryAnnotation.ANNOT_WARNING;
-	protected String SEVERITY_STRUCTURE = TemporaryAnnotation.ANNOT_ERROR;
-	protected String SEVERITY_SYNTAX_ERROR = TemporaryAnnotation.ANNOT_ERROR;
-	// used for attribute quote checking
-	private String SQUOTE = "'"; //$NON-NLS-1$
-
-	private IDocument fDocument;
-
-	private void addAttributeError(String messageText, String attributeValueText, int start, int length, int problemId, IStructuredDocumentRegion sdRegion,  IReporter reporter) {
-        
-        if (sdRegion.isDeleted())
-            return;
-        
-        int lineNo = getLineNumber(start);
-        LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
-        message.setOffset(start);
-        message.setLength(length);
-        message.setLineNo(lineNo);
-        
-        AnnotationInfo info = new AnnotationInfo(message, problemId, attributeValueText);
-        ((IncrementalReporter)reporter).addAnnotationInfo(this, info);
-	}
-
-	private void checkAttributesInEndTag(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-        
-        if(structuredDocumentRegion.isDeleted())
-            return;
-        
-		ITextRegionList textRegions = structuredDocumentRegion.getRegions();
-		int errorCount = 0;
-		int start = structuredDocumentRegion.getEndOffset();
-		int end = structuredDocumentRegion.getEndOffset();
-		for (int i = 0; i < textRegions.size() && errorCount < AbstractStructuredTextReconcilingStrategy.ELEMENT_ERROR_LIMIT && !structuredDocumentRegion.isDeleted(); i++) {
-			ITextRegion textRegion = textRegions.get(i);
-			if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS || textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-				if (start > structuredDocumentRegion.getStartOffset(textRegion))
-					start = structuredDocumentRegion.getStartOffset(textRegion);
-				end = structuredDocumentRegion.getEndOffset(textRegion);
-				errorCount++;
-			}
-		}
-		// create one error for all attributes in the end tag
-		if (errorCount > 0) {
-			// Position p = new Position(start, end - start);
-			String messageText = XMLUIMessages.End_tag_has_attributes;
-			LocalizedMessage message = new LocalizedMessage(IMessage.NORMAL_SEVERITY, messageText);
-			message.setOffset(start);
-			message.setLength(end - start);
-			message.setLineNo(getLineNumber(start));
-			
-			AnnotationInfo info = new AnnotationInfo(message, ProblemIDsXML.AttrsInEndTag, null);
-			((IncrementalReporter)reporter).addAnnotationInfo(this, info);
-		}
-	}
-
-
-	private void checkClosingBracket(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-        
-        if(structuredDocumentRegion.isDeleted())
-            return;
-        
-		ITextRegionList regions = structuredDocumentRegion.getRegions();
-		ITextRegion r = null;
-		boolean closed = false;
-		for (int i = 0; i < regions.size()  && !structuredDocumentRegion.isDeleted(); i++) {
-			r = regions.get(i);
-			if (r.getType() == DOMRegionContext.XML_TAG_CLOSE || r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE)
-				closed = true;
-		}
-		if (!closed) {
-
-			String messageText = XMLUIMessages.ReconcileStepForMarkup_6;
-
-			int start = structuredDocumentRegion.getStartOffset();
-			int length = structuredDocumentRegion.getText().trim().length();
-			int lineNo = getLineNumber(start);
-			
-			LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
-			message.setOffset(start);
-			message.setLength(length);
-			message.setLineNo(lineNo);
-			
-			AnnotationInfo info = new AnnotationInfo(message, ProblemIDsXML.MissingClosingBracket, null);
-			((IncrementalReporter)reporter).addAnnotationInfo(this, info);
-		}
-	}
-
-	private void checkEmptyTag(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-        
-        if(structuredDocumentRegion.isDeleted())
-            return;
-        
-		// navigate to name
-		ITextRegionList regions = structuredDocumentRegion.getRegions();
-		if (regions.size() == 2) {
-			// missing name region
-			if (regions.get(0).getType() == DOMRegionContext.XML_TAG_OPEN && regions.get(1).getType() == DOMRegionContext.XML_TAG_CLOSE) {
-				String messageText = XMLUIMessages.ReconcileStepForMarkup_3;
-				int start = structuredDocumentRegion.getStartOffset();
-				int length = structuredDocumentRegion.getLength();
-				int lineNo = getLineNumber(start);
-				
-				LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
-				message.setOffset(start);
-				message.setLength(length);
-				message.setLineNo(lineNo);
-				
-				AnnotationInfo info = new AnnotationInfo(message, ProblemIDsXML.EmptyTag, null);
-				((IncrementalReporter)reporter).addAnnotationInfo(this, info);
-			}
-		}
-	}
-
-	private int getLineNumber(int start) {
-		int lineNo = -1;
-		try {
-			lineNo = getDocument().getLineOfOffset(start);
-		}
-		catch (BadLocationException e) {
-			Logger.logException(e);
-		}
-		return lineNo;
-	}
-
-	private void checkForAttributeValue(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-        
-        if(structuredDocumentRegion.isDeleted())
-            return;
-        
-		// check for attributes without a value
-		// track the attribute/equals/value sequence using a state of 0, 1 ,2
-		// representing the name, =, and value, respectively
-		int attrState = 0;
-		ITextRegionList textRegions = structuredDocumentRegion.getRegions();
-		// ReconcileAnnotationKey key = createKey(structuredDocumentRegion, getScope());
-		
-		int errorCount = 0;
-		for (int i = 0; i < textRegions.size() && errorCount < AbstractStructuredTextReconcilingStrategy.ELEMENT_ERROR_LIMIT; i++) {
-			ITextRegion textRegion = textRegions.get(i);
-			if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || isTagCloseTextRegion(textRegion)) {
-				// dangling name and '='
-				if (attrState == 2 && i >= 2) {
-					// create annotation
-					ITextRegion nameRegion = textRegions.get(i - 2);
-					Object[] args = {structuredDocumentRegion.getText(nameRegion)};
-					String messageText = NLS.bind(XMLUIMessages.Attribute__is_missing_a_value, args);
-					
-					int start = structuredDocumentRegion.getStartOffset(nameRegion);
-					int end = structuredDocumentRegion.getEndOffset();
-					int lineNo = getLineNumber(start);
-					int textLength = structuredDocumentRegion.getText(nameRegion).trim().length();
-					
-					LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
-					message.setOffset(start);
-					message.setLength(textLength);
-					message.setLineNo(lineNo);
-					
-					// quick fix info
-					ITextRegion equalsRegion = textRegions.get(i - 2 + 1);
-					int insertOffset = structuredDocumentRegion.getTextEndOffset(equalsRegion) - end;
-					Object[] additionalFixInfo = {structuredDocumentRegion.getText(nameRegion), new Integer(insertOffset)};
-					
-					AnnotationInfo info = new AnnotationInfo(message, ProblemIDsXML.MissingAttrValue, additionalFixInfo);
-					
-					((IncrementalReporter)reporter).addAnnotationInfo(this, info);
-					
-					// annotation.setAdditionalFixInfo(additionalFixInfo);
-					//results.add(annotation);
-					errorCount++;
-				}
-				// name but no '=' (XML only)
-				else if (attrState == 1 && i >= 1) {
-					// create annotation
-					ITextRegion previousRegion = textRegions.get(i - 1);
-					Object[] args = {structuredDocumentRegion.getText(previousRegion)};
-					String messageText = NLS.bind(XMLUIMessages.Attribute__has_no_value, args);
-					int start = structuredDocumentRegion.getStartOffset(previousRegion);
-					int textLength = structuredDocumentRegion.getText(previousRegion).trim().length();
-					int lineNo = getLineNumber(start);
-					
-					LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
-					message.setOffset(start);
-					message.setLength(textLength);
-					message.setLineNo(lineNo);
-					
-					AnnotationInfo info = new AnnotationInfo(message, ProblemIDsXML.NoAttrValue, structuredDocumentRegion.getText(previousRegion));
-			
-					((IncrementalReporter)reporter).addAnnotationInfo(this, info);
-					
-					errorCount++;
-				}
-				attrState = 1;
-			} else if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
-				attrState = 2;
-			} else if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-				attrState = 0;
-			}
-		}
-
-	}
-
-	private void checkForSpaceBeforeName(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-        
-        if(structuredDocumentRegion.isDeleted())
-            return;
-        
-		String sdRegionText = structuredDocumentRegion.getFullText();
-		if (sdRegionText.startsWith(" ")) { //$NON-NLS-1$
-			IStructuredDocumentRegion prev = structuredDocumentRegion.getPrevious();
-			if (prev != null) {
-				// this is possibly the case of "< tag"
-				if (prev.getRegions().size() == 1 && isStartTag(prev)) {
-					// add the error for preceding space in tag name
-					String messageText = XMLUIMessages.ReconcileStepForMarkup_2;
-					int start = structuredDocumentRegion.getStartOffset();
-					// find length of whitespace
-					int length = sdRegionText.trim().equals("") ? sdRegionText.length() : sdRegionText.indexOf(sdRegionText.trim()); //$NON-NLS-1$
-					
-					LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
-					message.setOffset(start);
-					message.setLength(length);
-					message.setLineNo(getLineNumber(start));
-					
-					AnnotationInfo info = new AnnotationInfo(message, ProblemIDsXML.SpacesBeforeTagName, null);
-					((IncrementalReporter)reporter).addAnnotationInfo(this, info);
-				}
-			}
-		}
-	}
-
-	private void checkNoNamespaceInPI(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-        
-        if(structuredDocumentRegion.isDeleted())
-            return;
-        
-		// navigate to name
-		ITextRegionList regions = structuredDocumentRegion.getRegions();
-		ITextRegion r = null;
-		int errorCount = 0;
-		for (int i = 0; i < regions.size() && errorCount < AbstractStructuredTextReconcilingStrategy.ELEMENT_ERROR_LIMIT && !structuredDocumentRegion.isDeleted(); i++) {
-			r = regions.get(i);
-			if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
-				String piText = structuredDocumentRegion.getText(r);
-				int index = piText.indexOf(":"); //$NON-NLS-1$
-				if (index != -1) {
-					String messageText = XMLUIMessages.ReconcileStepForMarkup_4;
-					int start = structuredDocumentRegion.getStartOffset(r) + index;
-					int length = piText.trim().length() - index;
-					
-					LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
-					message.setOffset(start);
-					message.setLength(length);
-					message.setLineNo(getLineNumber(start));
-					
-					AnnotationInfo info = new AnnotationInfo(message, ProblemIDsXML.NamespaceInPI, null);
-					((IncrementalReporter)reporter).addAnnotationInfo(this, info);
-
-					errorCount++;
-				}
-			}
-		}
-	}
-
-	private void checkQuotesForAttributeValues(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-		ITextRegionList regions = structuredDocumentRegion.getRegions();
-		ITextRegion r = null;
-		String attrValueText = ""; //$NON-NLS-1$
-		int errorCount = 0;
-		for (int i = 0; i < regions.size() && errorCount < AbstractStructuredTextReconcilingStrategy.ELEMENT_ERROR_LIMIT; i++) {
-			r = regions.get(i);
-			if (r.getType() != DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
-				continue;
-
-			attrValueText = structuredDocumentRegion.getText(r);
-			// attribute value includes quotes in the string
-			// split up attribute value on quotes
-			StringTokenizer st = new StringTokenizer(attrValueText, "\"'", true); //$NON-NLS-1$
-			int size = st.countTokens();
-			// get the pieces of the attribute value
-			String one = "", two = ""; //$NON-NLS-1$ //$NON-NLS-2$
-			if (size > 0)
-				one = st.nextToken();
-			if (size > 1)
-				two = st.nextToken();
-			if (size > 2) {
-				// should be handled by parsing...
-				// as in we can't have an attribute value like: <element
-				// attr="a"b"c"/>
-				// and <element attr='a"b"c' /> is legal
-				continue;
-			}
-
-
-			if (size == 1) {
-				if (one.equals(DQUOTE) || one.equals(SQUOTE)) {
-					// missing closing quote
-					String message = XMLUIMessages.ReconcileStepForMarkup_0;
-					addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.Unclassified, structuredDocumentRegion, reporter);
-					errorCount++;
-				} else {
-					// missing both
-					String message = XMLUIMessages.ReconcileStepForMarkup_1;
-					addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.AttrValueNotQuoted, structuredDocumentRegion, reporter);
-					errorCount++;
-				}
-			} else if (size == 2) {
-				if (one.equals(SQUOTE) && !two.equals(SQUOTE) || one.equals(DQUOTE) && !two.equals(DQUOTE)) {
-					// missing closing quote
-					String message = XMLUIMessages.ReconcileStepForMarkup_0;
-					addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.Unclassified, structuredDocumentRegion, reporter);
-					errorCount++;
-				}
-			}
-		}
-		// end of region for loop
-	}
-
-	private void checkStartEndTagPairs(IStructuredDocumentRegion sdRegion, IReporter reporter) {
-        
-        if(sdRegion.isDeleted())
-            return;
-        
-		// check start/end tag pairs
-		IDOMNode xmlNode = getXMLNode(sdRegion);
-        
-        if(xmlNode == null)
-            return;
-        
-		boolean selfClosed = false;
-		String tagName = null;
-		int length = 0;
-
-		if (xmlNode.isContainer()) {
-			IStructuredDocumentRegion endRegion = xmlNode.getEndStructuredDocumentRegion();
-			if (endRegion == null) {
-                IStructuredDocumentRegion startRegion = xmlNode.getStartStructuredDocumentRegion();
-                if(!startRegion.isDeleted()) {
-    				// analyze the tag (check self closing)
-    				ITextRegionList regions = startRegion.getRegions();
-    				ITextRegion r = null;
-    				for (int i = 0; i < regions.size(); i++) {
-    					r = regions.get(i);
-    					if (r.getType() == DOMRegionContext.XML_TAG_OPEN || r.getType() == DOMRegionContext.XML_TAG_CLOSE) {
-    						length++;
-    					} else if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
-    						tagName = sdRegion.getText(r);
-    						length += tagName.length();
-    					} else if (r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-    						selfClosed = true;
-    					}
-    				}
-    
-    				if (!selfClosed && tagName != null) {
-    					Object[] args = {tagName};
-    					String messageText = NLS.bind(XMLUIMessages.Missing_end_tag_, args);
-    
-    					int start = sdRegion.getStart();
-    					int lineNumber = getLineNumber(start);
-    					
-    					//SEVERITY_STRUCTURE == IMessage.HIGH_SEVERITY
-    					IMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
-    					message.setOffset(start);
-    					message.setLength(length);
-    					message.setLineNo(lineNumber);
-    					
-    					if(reporter instanceof IncrementalReporter) {
-    						
-        					Object[] additionalFixInfo = getStartEndFixInfo(xmlNode, tagName, r);
-        					
-        					AnnotationInfo info = new AnnotationInfo(message, ProblemIDsXML.MissingEndTag, additionalFixInfo);
-        					//annotation.setAdditionalFixInfo(additionalFixInfo);
-        					((IncrementalReporter)reporter).addAnnotationInfo(this, info);
-    					}
-    					else {
-    						reporter.addMessage(this, message);
-    					}
-    				}
-    			}
-            }
-
-		}
-	}
-
-	private Object[] getStartEndFixInfo(IDOMNode xmlNode, String tagName, ITextRegion r) {
-		// quick fix info
-		String tagClose = "/>"; //$NON-NLS-1$
-		int tagCloseOffset = xmlNode.getFirstStructuredDocumentRegion().getEndOffset();
-		if (r != null && r.getType() == DOMRegionContext.XML_TAG_CLOSE) {
-			tagClose = "/"; //$NON-NLS-1$
-			tagCloseOffset--;
-		}
-		IDOMNode firstChild = (IDOMNode) xmlNode.getFirstChild();
-		while (firstChild != null && firstChild.getNodeType() == Node.TEXT_NODE) {
-			firstChild = (IDOMNode) firstChild.getNextSibling();
-		}
-		int endOffset = xmlNode.getEndOffset();
-		int firstChildStartOffset = firstChild == null ? endOffset : firstChild.getStartOffset();
-		Object[] additionalFixInfo = {tagName, tagClose, new Integer(tagCloseOffset), new Integer(xmlNode.getFirstStructuredDocumentRegion().getEndOffset()), // startTagEndOffset
-					new Integer(firstChildStartOffset), // firstChildStartOffset
-					new Integer(endOffset)}; // endOffset
-		return additionalFixInfo;
-	}
-
-	private void checkStartingSpaceForPI(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-        
-        if(structuredDocumentRegion.isDeleted())
-            return;
-        
-		IStructuredDocumentRegion prev = structuredDocumentRegion.getPrevious();
-		if (prev != null && !prev.isDeleted()) {
-			String prevText = prev.getFullText();
-			if (prev.getType() == DOMRegionContext.XML_CONTENT && prevText.endsWith(" ")) { //$NON-NLS-1$
-				String messageText = XMLUIMessages.ReconcileStepForMarkup_5;
-				int start = prev.getStartOffset();
-				int length = prev.getLength();
-				
-				LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
-				message.setOffset(start);
-				message.setLength(length);
-				message.setLineNo(getLineNumber(start));
-				
-				AnnotationInfo info = new AnnotationInfo(message, ProblemIDsXML.SpacesBeforePI, null);
-				((IncrementalReporter)reporter).addAnnotationInfo(this, info);
-				
-//				Position p = new Position(start, length);
-//				
-//				ReconcileAnnotationKey key = createKey(structuredDocumentRegion, getScope());
-//				TemporaryAnnotation annotation = new TemporaryAnnotation(p, SEVERITY_SYNTAX_ERROR, message, key, ProblemIDsXML.SpacesBeforePI);
-//				results.add(annotation);
-			}
-		}
-	}
-
-	public int getScope() {
-		return ReconcileAnnotationKey.PARTIAL;
-	}
-
-	private IDOMNode getXMLNode(IStructuredDocumentRegion sdRegion) {
-        
-        if(sdRegion == null)
-            return null;
-        
-		IStructuredModel xModel = null;
-		IDOMNode xmlNode = null;
-		// get/release models should always be in a try/finally block
-		try {
-			xModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
-			// xModel is sometime null, when closing editor, for example
-			if (xModel != null) {
-				xmlNode = (IDOMNode) xModel.getIndexedRegion(sdRegion.getStart());
-			}
-		} finally {
-			if (xModel != null) {
-				xModel.releaseFromRead();
-			}
-		}
-		return xmlNode;
-	}
-
-	/**
-	 * Determines whether the IStructuredDocumentRegion is a XML "end tag"
-	 * since they're not allowed to have attribute ITextRegions
-	 * 
-	 * @param structuredDocumentRegion
-	 */
-	private boolean isEndTag(IStructuredDocumentRegion structuredDocumentRegion) {
-		if (structuredDocumentRegion == null || structuredDocumentRegion.isDeleted())
-			return false;
-		return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN;
-	}
-
-	/**
-	 * Determines if the IStructuredDocumentRegion is an XML Processing
-	 * Instruction
-	 * 
-	 * @param structuredDocumentRegion
-	 * 
-	 */
-	private boolean isPI(IStructuredDocumentRegion structuredDocumentRegion) {
-        if (structuredDocumentRegion == null || structuredDocumentRegion.isDeleted())
-            return false;
-		return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_PI_OPEN;
-	}
-
-	/**
-	 * Determines whether the IStructuredDocumentRegion is a XML "start tag"
-	 * since they need to be checked for proper XML attribute region sequences
-	 * 
-	 * @param structuredDocumentRegion
-	 * 
-	 */
-	private boolean isStartTag(IStructuredDocumentRegion structuredDocumentRegion) {
-		if (structuredDocumentRegion == null || structuredDocumentRegion.isDeleted())
-			return false;
-		return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN;
-	}
-
-	// Because we check the "proper" closing separately from attribute
-	// sequencing, we need to know what's
-	// an appropriate close.
-	private boolean isTagCloseTextRegion(ITextRegion textRegion) {
-		return textRegion.getType() == DOMRegionContext.XML_TAG_CLOSE || textRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE;
-	}
-
-	/**
-	 * Determines if the IStructuredDocumentRegion is XML Content
-	 * 
-	 * @param structuredDocumentRegion
-	 * 
-	 */
-	private boolean isXMLContent(IStructuredDocumentRegion structuredDocumentRegion) {
-        if(structuredDocumentRegion == null || structuredDocumentRegion.isDeleted())
-            return false;
-		return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_CONTENT;
-	}
-
-	private void setDocument(IDocument doc){
-		fDocument = doc;
-	}
-	private IDocument getDocument() {
-		return fDocument;
-	}
-	
-	public void connect(IDocument document) {
-		setDocument(document);
-	}
-
-	public void disconnect(IDocument document) {
-		// nothing to do	
-	}
-
-	public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
-		if(getDocument() == null)
-			return;
-		if(!(reporter instanceof IncrementalReporter))
-			return;
-		if(!(getDocument() instanceof IStructuredDocument))
-			return;
-
-		// remove old messages
-		reporter.removeAllMessages(this);
-		
-		IStructuredDocumentRegion[] regions = ((IStructuredDocument)fDocument).getStructuredDocumentRegions(dirtyRegion.getOffset(), dirtyRegion.getLength());
-		for (int i = 0; i < regions.length; i++) {
-			validate(regions[i], reporter);
-		}
-	}
-	
-	public void validate(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
-		if (structuredDocumentRegion == null)
-			return;
-		
-		if (isStartTag(structuredDocumentRegion)) {
-			// check for attributes without a value
-			checkForAttributeValue(structuredDocumentRegion, reporter);
-			// check if started tag is ended
-			checkStartEndTagPairs(structuredDocumentRegion, reporter);		
-			// check empty tag <>
-			checkEmptyTag(structuredDocumentRegion, reporter);
-			// check that each attribute has quotes
-			checkQuotesForAttributeValues(structuredDocumentRegion, reporter);
-			// check that the closing '>' is there
-			checkClosingBracket(structuredDocumentRegion, reporter);
-		} else if (isEndTag(structuredDocumentRegion)) {
-			checkAttributesInEndTag(structuredDocumentRegion, reporter);
-			// check that the closing '>' is there
-			checkClosingBracket(structuredDocumentRegion, reporter);
-		} else if (isPI(structuredDocumentRegion)) {
-			// check validity of processing instruction
-			checkStartingSpaceForPI(structuredDocumentRegion, reporter);
-			checkNoNamespaceInPI(structuredDocumentRegion, reporter);
-		} else if (isXMLContent(structuredDocumentRegion)) {
-			checkForSpaceBeforeName(structuredDocumentRegion, reporter);
-		}
-	}
-
-	public void cleanup(IReporter reporter) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
-		// TODO Auto-generated method stub
-		
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java
deleted file mode 100644
index 2f19d61..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java
+++ /dev/null
@@ -1,475 +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.ui.views.contentoutline;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.TransferDragSourceListener;
-import org.eclipse.jface.util.TransferDropTargetListener;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.wst.common.ui.internal.dnd.ObjectTransfer;
-import org.eclipse.wst.common.ui.internal.dnd.ViewerDragAdapter;
-import org.eclipse.wst.common.ui.internal.dnd.ViewerDropAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-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.sse.ui.views.contentoutline.ContentOutlineConfiguration;
-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.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeContentProvider;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.eclipse.wst.xml.ui.internal.dnd.XMLDragAndDropManager;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Outline Configuration for generic XML support, expects that the viewer's
- * input will be the DOM Model.
- * 
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
- * @since 1.0
- */
-public class XMLContentOutlineConfiguration extends ContentOutlineConfiguration {
-	private class ActionManagerMenuListener implements IMenuListener, IReleasable {
-		private XMLNodeActionManager fActionManager;
-		private TreeViewer fTreeViewer;
-
-		public ActionManagerMenuListener(TreeViewer viewer) {
-			fTreeViewer = viewer;
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.action.IMenuListener#menuAboutToShow(org.eclipse.jface.action.IMenuManager)
-		 */
-		public void menuAboutToShow(IMenuManager manager) {
-			if (fActionManager == null) {
-				fActionManager = createNodeActionManager(fTreeViewer);
-			}
-			fActionManager.fillContextMenu(manager, fTreeViewer.getSelection());
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.ui.internal.IReleasable#release()
-		 */
-		public void release() {
-			fTreeViewer = null;
-			if (fActionManager != null) {
-				fActionManager.setModel(null);
-			}
-		}
-	}
-
-	private class AttributeShowingLabelProvider extends JFaceNodeLabelProvider {
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
-		 */
-		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();
-		}
-	}
-
-	/**
-	 * Toggle action for whether or not to display element's first attribute
-	 */
-	private class ToggleShowAttributeAction extends PropertyChangeUpdateAction {
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88444
-		private TreeViewer fTreeViewer;
-
-		public ToggleShowAttributeAction(IPreferenceStore store, String preference, TreeViewer treeViewer) {
-			super(XMLUIMessages.XMLContentOutlineConfiguration_0, store, preference, true);
-			setToolTipText(getText());
-			// images needed
-			// setDisabledImageDescriptor(SYNCED_D);
-			// (nsd) temporarily re-use Properties view image
-			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();
-			fShowAttributes = isChecked();
-
-			// notify the configuration of the change
-			enableShowAttributes(fShowAttributes, fTreeViewer);
-
-			// refresh the outline view
-			fTreeViewer.refresh(true);
-		}
-	}
-
-	private IContentProvider fContentProvider = null;
-
-	private ActionManagerMenuListener fContextMenuFiller = null;
-
-	private ILabelProvider fLabelProvider = null;
-
-	boolean fShowAttributes = false;
-
-	private TransferDragSourceListener[] fTransferDragSourceListeners;
-	private TransferDropTargetListener[] fTransferDropTargetListeners;
-
-	/*
-	 * Preference key for Show Attributes
-	 */
-	private final String OUTLINE_SHOW_ATTRIBUTE_PREF = "outline-show-attribute-editor"; //$NON-NLS-1$
-
-	/**
-	 * Create new instance of XMLContentOutlineConfiguration
-	 */
-	public XMLContentOutlineConfiguration() {
-		// Must have empty constructor to createExecutableExtension
-		super();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#createMenuContributions(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	protected IContributionItem[] createMenuContributions(TreeViewer viewer) {
-		IContributionItem[] items;
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88444
-		IContributionItem showAttributeItem = new PropertyChangeUpdateActionContributionItem(new ToggleShowAttributeAction(getPreferenceStore(), OUTLINE_SHOW_ATTRIBUTE_PREF, viewer));
-		items = super.createMenuContributions(viewer);
-		if (items == null) {
-			items = new IContributionItem[]{showAttributeItem};
-		}
-		else {
-			IContributionItem[] combinedItems = new IContributionItem[items.length + 1];
-			System.arraycopy(items, 0, combinedItems, 0, items.length);
-			combinedItems[items.length] = showAttributeItem;
-			items = combinedItems;
-		}
-		return items;
-	}
-
-	/**
-	 * Returns the NodeActionManager to use for the given treeViewer.
-	 * <p>
-	 * Not API. May be removed in the future.
-	 * </p>
-	 * 
-	 * @param treeViewer
-	 *            the TreeViewer associated with this configuration
-	 * @return a node action manager for use with this tree viewer
-	 */
-	protected XMLNodeActionManager createNodeActionManager(TreeViewer treeViewer) {
-		return new XMLNodeActionManager((IStructuredModel) treeViewer.getInput(), treeViewer);
-	}
-
-	/**
-	 * Notifies this configuration that the flag that indicates whether or not
-	 * to show attribute values in the tree viewer has changed. The tree
-	 * viewer is automatically refreshed afterwards to update the labels.
-	 * 
-	 * Clients should not call this method, but rather should react to it.
-	 * 
-	 * @param showAttributes
-	 *            flag indicating whether or not to show attribute values in
-	 *            the tree viewer
-	 * @param treeViewer
-	 *            the TreeViewer associated with this configuration
-	 */
-	protected void enableShowAttributes(boolean showAttributes, TreeViewer treeViewer) {
-		// nothing by default
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getContentProvider(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public IContentProvider getContentProvider(TreeViewer viewer) {
-		if (fContentProvider == null) {
-			fContentProvider = new JFaceNodeContentProvider();
-		}
-		return fContentProvider;
-	}
-
-	private Object getFilteredNode(Object object) {
-		if (object instanceof Node) {
-			Node node = (Node) object;
-
-			// replace attribute node in selection with its parent
-			if (node.getNodeType() == Node.ATTRIBUTE_NODE)
-				node = ((Attr) node).getOwnerElement();
-			// replace TextNode in selection with its parent
-			else if (node.getNodeType() == Node.TEXT_NODE)
-				node = node.getParentNode();
-			return node;
-		}
-		return object;
-	}
-
-	private Object[] getFilteredNodes(Object[] filteredNodes) {
-		for (int i = 0; i < filteredNodes.length; i++) {
-			filteredNodes[i] = getFilteredNode(filteredNodes[i]);
-		}
-		return filteredNodes;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getLabelProvider(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public ILabelProvider getLabelProvider(TreeViewer viewer) {
-		if (fLabelProvider == null) {
-			fLabelProvider = new AttributeShowingLabelProvider();
-		}
-		return fLabelProvider;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getMenuListener(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public IMenuListener getMenuListener(TreeViewer viewer) {
-		if (fContextMenuFiller == null) {
-			fContextMenuFiller = new ActionManagerMenuListener(viewer);
-		}
-		return fContextMenuFiller;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getPreferenceStore()
-	 */
-	protected IPreferenceStore getPreferenceStore() {
-		return XMLUIPlugin.getDefault().getPreferenceStore();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getSelection(org.eclipse.jface.viewers.TreeViewer,
-	 *      org.eclipse.jface.viewers.ISelection)
-	 */
-	public ISelection getSelection(TreeViewer viewer, ISelection selection) {
-		ISelection filteredSelection = selection;
-		if (selection instanceof IStructuredSelection) {
-			Object[] filteredNodes = getFilteredNodes(((IStructuredSelection) selection).toArray());
-			filteredSelection = new StructuredSelection(filteredNodes);
-		}
-		return filteredSelection;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDragSourceListeners(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public TransferDragSourceListener[] getTransferDragSourceListeners(TreeViewer treeViewer) {
-		if (fTransferDragSourceListeners == null) {
-			// emulate the XMLDragAndDropManager
-			final ViewerDragAdapter dragAdapter = new ViewerDragAdapter(treeViewer);
-			fTransferDragSourceListeners = new TransferDragSourceListener[]{new TransferDragSourceListener() {
-				public void dragFinished(DragSourceEvent event) {
-					dragAdapter.dragFinished(event);
-				}
-
-				public void dragSetData(DragSourceEvent event) {
-					dragAdapter.dragSetData(event);
-				}
-
-				public void dragStart(DragSourceEvent event) {
-					dragAdapter.dragStart(event);
-				}
-
-				public Transfer getTransfer() {
-					return ObjectTransfer.getInstance();
-				}
-			}};
-		}
-
-		return fTransferDragSourceListeners;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDropTargetListeners(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public TransferDropTargetListener[] getTransferDropTargetListeners(TreeViewer treeViewer) {
-		if (fTransferDropTargetListeners == null) {
-			// emulate the XMLDragAnDropManager
-			final ViewerDropAdapter dropAdapter = new ViewerDropAdapter(treeViewer, new XMLDragAndDropManager());
-			fTransferDropTargetListeners = new TransferDropTargetListener[]{new TransferDropTargetListener() {
-				public void dragEnter(DropTargetEvent event) {
-					dropAdapter.dragEnter(event);
-				}
-
-				public void dragLeave(DropTargetEvent event) {
-					dropAdapter.dragLeave(event);
-				}
-
-				public void dragOperationChanged(DropTargetEvent event) {
-					dropAdapter.dragOperationChanged(event);
-				}
-
-				public void dragOver(DropTargetEvent event) {
-					dropAdapter.dragOver(event);
-				}
-
-				public void drop(DropTargetEvent event) {
-					dropAdapter.drop(event);
-				}
-
-				public void dropAccept(DropTargetEvent event) {
-					dropAdapter.dropAccept(event);
-				}
-
-				public Transfer getTransfer() {
-					return ObjectTransfer.getInstance();
-				}
-
-				public boolean isEnabled(DropTargetEvent event) {
-					return getTransfer().isSupportedType(event.currentDataType);
-				}
-			}};
-		}
-		return fTransferDropTargetListeners;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#unconfigure(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public void unconfigure(TreeViewer viewer) {
-		super.unconfigure(viewer);
-		fTransferDragSourceListeners = null;
-		fTransferDropTargetListeners = null;
-		if (fContextMenuFiller != null) {
-			fContextMenuFiller.release();
-			fContextMenuFiller = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java
deleted file mode 100644
index b578055..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java
+++ /dev/null
@@ -1,257 +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.ui.views.properties;
-
-import java.util.HashSet;
-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.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.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.core.internal.contentmodel.CMDocument;
-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.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.properties.XMLPropertySource;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Configuration for property sheet page which shows XML content.
- * 
- * @see org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration
- * @since 1.0
- */
-public class XMLPropertySheetConfiguration extends PropertySheetConfiguration {
-	private class CMDocumentManagerListenerImpl implements CMDocumentManagerListener {
-		public void cacheCleared(CMDocumentCache cache) {
-			// nothing to do
-		}
-
-		public void cacheUpdated(CMDocumentCache cache, final String uri, int oldStatus, int newStatus, CMDocument cmDocument) {
-			if (newStatus == CMDocumentCache.STATUS_LOADED || newStatus == CMDocumentCache.STATUS_ERROR) {
-				refreshPages();
-			}
-		}
-
-		public void propertyChanged(CMDocumentManager cmDocumentManager, String propertyName) {
-			if (cmDocumentManager.getPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD)) {
-				refreshPages();
-			}
-		}
-
-		private void refreshPages() {
-			getPropertiesRefreshJob().addPropertySheetPage(fPropertySheetPage);
-			getPropertiesRefreshJob().schedule(PropertiesRefreshJob.UPDATE_DELAY);
-		}
-	}
-
-	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 class XMLPropertySheetRefreshAdapter 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 XMLPropertySourceProvider implements IPropertySourceProvider {
-		private IPropertySource fPropertySource = null;
-		private INodeNotifier fSource = null;
-
-		public IPropertySource getPropertySource(Object object) {
-			if (fSource != null && object.equals(fSource)) {
-				return fPropertySource;
-			}
-
-			if (object instanceof IDOMNode) {
-				fSource = (INodeNotifier) object;
-				fPropertySource = (IPropertySource) fSource.getAdapterFor(IPropertySource.class);
-				if (fPropertySource == null) {
-					fPropertySource = new XMLPropertySource((INodeNotifier) object);
-				}
-			}
-			else {
-				fSource = null;
-				fPropertySource = null;
-			}
-			return fPropertySource;
-		}
-	}
-
-	private CMDocumentManagerListenerImpl fCMDocumentManagerListener = new CMDocumentManagerListenerImpl();
-	private PropertiesRefreshJob fPropertiesRefreshJob = null;
-	IPropertySheetPage fPropertySheetPage = null;
-	private IPropertySourceProvider fPropertySourceProvider = null;
-	private INodeAdapter fRefreshAdapter = new XMLPropertySheetRefreshAdapter();
-	private CMDocumentManager[] fSelectedCMDocumentManagers = new CMDocumentManager[0];
-	private INodeNotifier[] fSelectedNotifiers = new INodeNotifier[0];
-
-
-	/**
-	 * Create new instance of XMLPropertySheetConfiguration
-	 */
-	public XMLPropertySheetConfiguration() {
-		// Must have empty constructor to createExecutableExtension
-		super();
-	}
-
-	public ISelection getInputSelection(IWorkbenchPart selectingPart, ISelection selection) {
-		if (fSelectedNotifiers != null) {
-			for (int i = 0; i < fSelectedNotifiers.length; i++) {
-				fSelectedNotifiers[i].removeAdapter(fRefreshAdapter);
-			}
-			fSelectedNotifiers = null;
-		}
-		for (int i = 0; i < fSelectedCMDocumentManagers.length; i++) {
-			fSelectedCMDocumentManagers[i].removeListener(fCMDocumentManagerListener);
-		}
-
-		ISelection preferredSelection = selection;
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSel = (IStructuredSelection) selection;
-
-			/*
-			 * On Attr nodes, select the owner Element. On Text nodes, select
-			 * the parent Element.
-			 */
-			Object[] selectedObjects = new Object[structuredSel.size()];
-			System.arraycopy(structuredSel.toArray(), 0, selectedObjects, 0, selectedObjects.length);
-			for (int i = 0; i < selectedObjects.length; i++) {
-				Object inode = selectedObjects[i];
-				if (inode instanceof Node) {
-					Node node = (Node) inode;
-					// replace Attribute Node with its owner
-					Node parentNode = node.getParentNode();
-					if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
-						Element ownerElement = ((Attr) node).getOwnerElement();
-						selectedObjects[i] = ownerElement;
-					}
-					// replace Text Node with its parent
-					else if ((node.getNodeType() == Node.TEXT_NODE || (node.getNodeType() == Node.CDATA_SECTION_NODE)) && parentNode != null) {
-						selectedObjects[i] = parentNode;
-					}
-				}
-			}
-
-			if (selectedObjects.length > 0) {
-				Set managers = new HashSet(1);
-				Set selectedNotifiers = new HashSet(1);
-
-				for (int i = 0; i < selectedObjects.length; i++) {
-					if (selectedObjects[i] instanceof Node) {
-						ModelQuery query = ModelQueryUtil.getModelQuery(((Node) selectedObjects[i]).getOwnerDocument());
-						if (query != null) {
-							CMDocumentManager mgr = query.getCMDocumentManager();
-							if (mgr != null) {
-								managers.add(mgr);
-								mgr.addListener(fCMDocumentManagerListener);
-							}
-						}
-					}
-					/*
-					 * Add UI refresh adapters and remember notifiers for
-					 * later removal
-					 */
-					if (selectedObjects[i] instanceof INodeNotifier) {
-						selectedNotifiers.add(selectedObjects[i]);
-						((INodeNotifier) selectedObjects[i]).addAdapter(fRefreshAdapter);
-					}
-				}
-				fSelectedCMDocumentManagers = (CMDocumentManager[]) managers.toArray(new CMDocumentManager[managers.size()]);
-				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) {
-			fPropertySheetPage = page;
-			fPropertySourceProvider = new XMLPropertySourceProvider();
-		}
-		return fPropertySourceProvider;
-	}
-
-
-	public void unconfigure() {
-		super.unconfigure();
-		for (int i = 0; i < fSelectedCMDocumentManagers.length; i++) {
-			fSelectedCMDocumentManagers[i].removeListener(fCMDocumentManagerListener);
-		}
-		fPropertySheetPage = null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.properties b/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.properties
deleted file mode 100644
index 731aef7..0000000
--- a/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.properties
+++ /dev/null
@@ -1,18 +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
-#     
-###############################################################################
-Templates.comment.name=comment
-Templates.comment.desc=xml comment
-Templates.xmldeclaration.name=xml declaration
-Templates.xmldeclaration.desc=xml declaration
-Templates.xslpi.name=XSL processing instruction
-Templates.xslpi.desc=XSL processing instruction
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.xml b/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.xml
deleted file mode 100644
index 027d206..0000000
--- a/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<templates>
-<template name="%Templates.xmldeclaration.name" description="%Templates.xmldeclaration.desc" id="org.eclipse.wst.xml.ui.internal.templates.xmldeclaration" context="xml_new" enabled="true">&lt;?xml version="1.0" encoding="${encoding}"?&gt;</template>
-<template name="%Templates.comment.name" description="%Templates.comment.desc" id="org.eclipse.wst.xml.ui.internal.templates.comment" context="xml_tag" enabled="true">&lt;!-- ${cursor} --&gt;</template>
-<template name="%Templates.xslpi.name" description="%Templates.xslpi.desc" id="org.eclipse.wst.xml.ui.internal.templates.xslpi" context="xml_tag" enabled="true">&lt;?xml-stylesheet type="text/xsl" href="${cursor}"?&gt;</template>
-
-</templates>
diff --git a/bundles/org.eclipse.wst.xsd.core/.classpath b/bundles/org.eclipse.wst.xsd.core/.classpath
deleted file mode 100644
index b23b03f..0000000
--- a/bundles/org.eclipse.wst.xsd.core/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src-contentmodel/"/>
-	<classpathentry kind="src" path="src-validation/"/>
-	<classpathentry kind="src" path="src/"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xsd.core/.cvsignore b/bundles/org.eclipse.wst.xsd.core/.cvsignore
deleted file mode 100644
index 26e7574..0000000
--- a/bundles/org.eclipse.wst.xsd.core/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-temp.folder
-build.xml
-@dot
-src.zip
diff --git a/bundles/org.eclipse.wst.xsd.core/.project b/bundles/org.eclipse.wst.xsd.core/.project
deleted file mode 100644
index a95f8ef..0000000
--- a/bundles/org.eclipse.wst.xsd.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.xsd.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.xsd.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 6cdb4d2..0000000
--- a/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,57 +0,0 @@
-#Mon Jan 30 18:54:33 EST 2006
-eclipse.preferences.version=1
-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.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=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-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=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-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=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-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=ignore
-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.unusedLocal=warning
-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=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 390939c..0000000
--- a/bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %_UI_PLUGIN_NAME
-Bundle-SymbolicName: org.eclipse.wst.xsd.core; singleton:=true
-Bundle-Version: 1.0.1.qualifier
-Bundle-Activator: org.eclipse.wst.xsd.core.internal.XSDCorePlugin
-Bundle-Vendor: Eclipse.org
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.xsd.contentmodel.internal,
- org.eclipse.wst.xsd.contentmodel.internal.util,
- org.eclipse.wst.xsd.core.internal,
- org.eclipse.wst.xsd.core.internal.validation
-Require-Bundle: org.eclipse.core.runtime.compatibility,
- org.eclipse.emf.ecore,
- org.eclipse.wst.common.uriresolver,
- org.eclipse.xsd,
- org.eclipse.wst.xml.core,
- org.eclipse.wst.sse.core,
- org.eclipse.core.resources,
- org.eclipse.wst.validation,
- org.apache.xerces
-Eclipse-AutoStart: true
-Plugin-Class: org.eclipse.wst.xsd.core.internal.XSDCorePlugin
-
diff --git a/bundles/org.eclipse.wst.xsd.core/about.html b/bundles/org.eclipse.wst.xsd.core/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/bundles/org.eclipse.wst.xsd.core/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>February 24, 2005</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.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.core/build.properties b/bundles/org.eclipse.wst.xsd.core/build.properties
deleted file mode 100644
index ba1ba95..0000000
--- a/bundles/org.eclipse.wst.xsd.core/build.properties
+++ /dev/null
@@ -1,22 +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
-#     
-###############################################################################
-bin.includes = META-INF/,\
-               plugin.xml,\
-               plugin.properties,\
-               .,\
-               about.html
-jars.compile.order = .
-src.includes = build.properties
-output.. = bin/
-source.. = src-contentmodel/,\
-           src-validation/,\
-           src/
diff --git a/bundles/org.eclipse.wst.xsd.core/plugin.properties b/bundles/org.eclipse.wst.xsd.core/plugin.properties
deleted file mode 100644
index 35666bf..0000000
--- a/bundles/org.eclipse.wst.xsd.core/plugin.properties
+++ /dev/null
@@ -1,36 +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
-###############################################################################
-! Properties file for component: XML Schema Validator
-
-!
-! Plugin
-!
-_UI_PLUGIN_NAME                           = XSD Core Plugin
-XSD_Content_Type=XSD
-
-!
-! XSDEditor Menu bar contributor
-!
-
-_UI_MENU_VALIDATE_XML                     = &Validate XML Schema
-
-!
-! Validate Schema 
-!
-_UI_DIALOG_XML_SCHEMA_INVALID_TITLE       = Validation Failed
-_UI_DIALOG_XML_SCHEMA_VALID_TITLE         = Validation Succeeded
-_UI_DIALOG_XML_SCHEMA_VALID_TEXT          = The XML schema file is valid.
-_UI_DIALOG_XML_SCHEMA_VALID_WITH_WARNINGS = The XML schema file is valid however warnings have been issued. See the Problems view for the warning messages.
-_UI_DIALOG_XML_SCHEMA_INVALID_TEXT        = The XML schema file is not valid. See the Problems view for the error messages.
-_UI_DIALOG_XML_SCHEMA_LIMITE_EXCEEDED     = The XML schema file is not valid.  The message limit for the Problems view has been exceeded.  To see all the messages increase the limit and validate again.
-
-
-_UI_XML_SCHEMA_VALIDATOR                  = XML Schema Validator
diff --git a/bundles/org.eclipse.wst.xsd.core/plugin.xml b/bundles/org.eclipse.wst.xsd.core/plugin.xml
deleted file mode 100644
index d0e75f7..0000000
--- a/bundles/org.eclipse.wst.xsd.core/plugin.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-	<extension point="org.eclipse.core.runtime.contentTypes">
-		<content-type
-			priority="high"
-			name="%XSD_Content_Type"
-			id="xsdsource"
-			base-type="org.eclipse.core.runtime.xml"
-			default-charset="UTF-8"
-			file-extensions="xsd" />
-	</extension>
-
-	<extension point="org.eclipse.wst.xml.core.documentFactories">
-		<factory
-			type="xsd"
-			class="org.eclipse.wst.xsd.contentmodel.internal.CMDocumentFactoryXSD">
-		</factory>
-	</extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMDocumentFactoryXSD.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMDocumentFactoryXSD.java
deleted file mode 100644
index 8c189d7..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMDocumentFactoryXSD.java
+++ /dev/null
@@ -1,45 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.contentmodel.internal;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.factory.CMDocumentFactory;
-
-/**
- *  This builder handles building .dtd / .xsd grammar files
- */
-public class CMDocumentFactoryXSD implements CMDocumentFactory
-{
-  public static final String XSD_FILE_TYPE = "XSD";
-
-  public CMDocumentFactoryXSD() 
-  {  
-    // here we call init on the XSD and DTD packages to avoid strange initialization bugs
-    //
-    org.eclipse.xsd.impl.XSDPackageImpl.init();
-    org.eclipse.xsd.impl.XSDPackageImpl.eINSTANCE.getXSDFactory();  
-  }
-
- 
-  public CMDocument createCMDocument(String uri)
-  {                  	
-    CMDocument result = null;
-    try
-    {                                
-        result = XSDImpl.buildCMDocument(uri);     
-    }
-    catch (Exception e)
-    {
-    	e.printStackTrace();
-    }
-    return result;  
-  } 
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMNodeImpl.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMNodeImpl.java
deleted file mode 100644
index 3f8a653..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMNodeImpl.java
+++ /dev/null
@@ -1,41 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.contentmodel.internal;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-public abstract class CMNodeImpl extends AdapterImpl implements CMNode
-{
-  protected static final String PROPERTY_DOCUMENTATION = "documentation";
-  protected static final String PROPERTY_DOCUMENTATION_SOURCE = "documentationSource";
-  protected static final String PROPERTY_DOCUMENTATION_LANGUAGE = "documentationLanguage";
-  protected static final String PROPERTY_MOF_NOTIFIER = "key";
-  protected static final String PROPERTY_DEFINITION_INFO = "http://org.eclipse.wst/cm/properties/definitionInfo";
-  protected static final String PROPERTY_DEFINITION = "http://org.eclipse.wst/cm/properties/definition";
-
-  public abstract Object getKey();
-
-  public boolean supports(String propertyName)
-  {
-    return propertyName.equals(PROPERTY_MOF_NOTIFIER);
-  }
-
-  public Object getProperty(String propertyName)
-  {
-    return null;
-  }
-
-  public void setProperty(String propertyName, Object object)
-  {
-	  //no propertyes supported? 
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDCMManager.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDCMManager.java
deleted file mode 100644
index 796f45c..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDCMManager.java
+++ /dev/null
@@ -1,38 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.contentmodel.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Plugin;
-
-public class XSDCMManager extends Plugin 
-{
-  private static XSDCMManager instance;
-  
-  public XSDCMManager() 
-  {
-    super();
-  }
-  
-  public static XSDCMManager getInstance() {
-    if (instance == null) {
-      instance = new XSDCMManager();
-    }
-    return instance;
-  }
-
-
-  public void startup() throws CoreException 
-  {
-    XSDTypeUtil.initialize();
-    //ContentModelManager.getInstance().setInferredGrammarFactory(new InferredGrammarFactoryImpl());
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
deleted file mode 100644
index f0ac88f..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
+++ /dev/null
@@ -1,2844 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.contentmodel.internal;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.resource.impl.URIConverterImpl;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-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.CMDocumentation;
-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.CMNamespace;
-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.annotation.AnnotationMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMAttributeDeclarationImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMDataTypeImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMDocumentImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMEntityDeclarationImpl;
-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.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xsd.contentmodel.internal.util.XSDSchemaLocatorAdapterFactory;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDAttributeUseCategory;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDConstraint;
-import org.eclipse.xsd.XSDContentTypeCategory;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDForm;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.eclipse.xsd.util.XSDResourceImpl;
-import org.eclipse.xsd.util.XSDSwitch;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * Utility class to build cmnodes from XML Schema nodes. The XML Schema model is
- * found in the org.eclipse.xsd plugin.
- * 
- * TODO: getNamespaceURI()currently always returns '##any'.
- */
-public class XSDImpl
-{
-  /*
-   * properties common to all cmnodes the following properties defined in
-   * CMNodeImpl class: PROPERTY_DOCUMENTATION PROPERTY_DOCUMENTATION_SOURCE
-   * PROPERTY_DOCUMENTATION_LANGUAGE PROPERTY_MOF_NOTIFIER
-   * PROPERTY_DEFINITION_INFO PROPERTY_DEFINITION
-   * 
-   * the following properties defined in this class, XSDImpl:
-   * PROPERTY_CMDOCUMENT PROPERTY_USES_LOCAL_ELEMENT_DECLARATIONS
-   * PROPERTY_IS_NAME_SPACE_AWARE PROPERTY_NS_PREFIX_QUALIFICATION
-   * PROPERTY_NILLABLE PROPERTY_SPEC
-   */
-  public static final String PROPERTY_CMDOCUMENT = "CMDocument";
-  public static final String PROPERTY_USES_LOCAL_ELEMENT_DECLARATIONS = "http://org.eclipse.wst/cm/properties/usesLocalElementDeclarations";
-  public static final String PROPERTY_IS_NAME_SPACE_AWARE = "http://org.eclipse.wst/cm/properties/isNameSpaceAware";
-  public static final String PROPERTY_NS_PREFIX_QUALIFICATION = "http://org.eclipse.wst/cm/properties/nsPrefixQualification";
-  public static final String PROPERTY_NILLABLE = "http://org.eclipse.wst/cm/properties/nillable";
-  public static final String PROPERTY_SPEC = "spec";
-  /*
-   * properties common to all CMDocument nodes: PROPERTY_TARGET_NAMESPACE_URI
-   * PROPERTY_IMPORTED_NAMESPACE_INFO PROPERTY_NAMESPACE_INFO
-   * PROPERTY_ELEMENT_FORM_DEFAULT PROPERTY_ANNOTATION_MAP
-   */
-  public static final String PROPERTY_TARGET_NAMESPACE_URI = "http://org.eclipse.wst/cm/properties/targetNamespaceURI";
-  public static final String PROPERTY_IMPORTED_NAMESPACE_INFO = "http://org.eclipse.wst/cm/properties/importedNamespaceInfo";
-  public static final String PROPERTY_NAMESPACE_INFO = "http://org.eclipse.wst/cm/properties/namespaceInfo";
-  public static final String PROPERTY_ELEMENT_FORM_DEFAULT = "http://org.eclipse.wst/cm/properties/elementFormDefault";
-  public static final String PROPERTY_ANNOTATION_MAP = "annotationMap";
-  /*
-   * properties common to all CMElementDeclaration nodes: PROPERTY_XSITYPES
-   * PROPERTY_DERIVED_ELEMENT_DECLARATION PROPERTY_SUBSTITUTION_GROUP
-   * PROPERTY_ABSTRACT
-   */
-  public static final String PROPERTY_XSITYPES = "XSITypes";
-  public static final String PROPERTY_DERIVED_ELEMENT_DECLARATION = "DerivedElementDeclaration";
-  public static final String PROPERTY_SUBSTITUTION_GROUP = "SubstitutionGroup";
-  public static final String PROPERTY_ABSTRACT = "Abstract";
-  /**
-   * Definition info for element declarations.
-   */
-  public static final String DEFINITION_INFO_GLOBAL = "global";
-  public static final String DEFINITION_INFO_LOCAL = "local";
-  public static final String XML_LANG_ATTRIBUTE = "xml:lang";
-  public static final String PLATFORM_PROTOCOL = "platform:";
-  protected static XSDAdapterFactoryImpl xsdAdapterFactoryImpl = new XSDAdapterFactoryImpl();
-  protected static XSIDocument xsiDocument = new XSIDocument();
-
-  /**
-   * Given uri for an XML Schema document, parse the document and build
-   * corresponding CMDocument node.
-   * 
-   * @param uri -
-   *          the uri for an XML Schema document
-   * @param grammarErrorChecking -
-   *          grammar error checking flag
-   * @param errorList -
-   *          the resulting error list
-   * @return the corresponding CMDocument node.
-   * @deprecated -- use buildCMDocument(String uri)
-   */
-  public static CMDocument buildCMDocument(String uri, int grammarErrorChecking, List errorList)
-  {
-    return buildCMDocument(uri);
-  }
-
-  /**
-   * Given uri for an XML Schema document, parse the document and build
-   * corresponding CMDocument node.
-   * 
-   * @param uri -
-   *          the uri for an XML Schema document
-   * @return the corresponding CMDocument node.
-   */
-  public static CMDocument buildCMDocument(String uri)
-  {
-    CMDocument cmDocument = null;
-    XSDSchema xsdSchema = buildXSDModel(uri);
-    if (xsdSchema != null)
-    {
-      cmDocument = (CMDocument) getAdapter(xsdSchema);
-    }
-    return cmDocument;
-  }
-
-  /**
-   * Given uri for an XML Schema document, parse the document and build
-   * corresponding CMDocument node.
-   * 
-   * @param uri -
-   *          the uri for an XML Schema document
-   * @return the corresponding CMDocument node.
-   */
-  public static XSDSchema buildXSDModel(String uriString)
-  {
-    XSDSchema xsdSchema = null;
- 
-    try
-    {
-      // if XML Schema for Schema is requested, get it through schema model 
-      if (uriString.endsWith("2001/XMLSchema.xsd"))
-      {
-      	xsdSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);			
-      }
-      else
-      { 	
-        ResourceSet resourceSet = new ResourceSetImpl();
-        //resourceSet.getAdapterFactories().add(new XSDSchemaLocationResolverAdapterFactory());
-        resourceSet.getAdapterFactories().add(new XSDSchemaLocatorAdapterFactory());
-          
-        URI uri = createURI(uriString);   
-        
-        // CS : bug 113537 ensure we perform physical resolution before opening a stream for the resource
-        //
-        String physicalLocation = URIResolverPlugin.createResolver().resolvePhysicalLocation("", "", uriString);       
-        InputStream inputStream = resourceSet.getURIConverter().createInputStream(URI.createURI(physicalLocation));
-        XSDResourceImpl resource = (XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd"));
-        resource.setURI(uri);
-        resource.load(inputStream, null);         
-        xsdSchema = resource.getSchema();      
-      }
-    }
-    catch (Exception e)
-    {
-    }
-    return xsdSchema;
-  }
-  
-  // TODO ... looks like we can remove this class?
-  //
-  static class InternalURIConverter extends URIConverterImpl
-  {
-    protected InputStream createURLInputStream(URI uri) throws IOException
-    {
-      if ("http".equals(uri.scheme()))
-      {
-        String theURI = uri.toString();
-        String mapped = URIResolverPlugin.createResolver().resolve(theURI, theURI, theURI);
-        if (mapped != null)
-        {
-          uri = createURI(mapped);
-        }
-      }
-      return super.createURLInputStream(uri);
-    }
-  }
-
-  /**
-   * Returns an appropriate URI based on a uri string.
-   * 
-   * @param uriString -
-   *          a uri string.
-   * @return an appropriate URI based on a uri string.
-   */
-  public static URI createURI(String uriString)
-  {
-    if (hasProtocol(uriString))
-      return URI.createURI(uriString);
-    else
-      return URI.createFileURI(uriString);
-  }
-
-  private static boolean hasProtocol(String uri)
-  {
-    boolean result = false;
-    if (uri != null)
-    {
-      int index = uri.indexOf(":");
-      if (index != -1 && index > 2) // assume protocol with be length 3 so that
-                                    // the'C' in 'C:/' is not interpreted as a
-                                    // protocol
-      {
-        result = true;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Returns true if string begins with platform protocol.
-   * 
-   * @param uriString -
-   *          a uri string.
-   * @return true if string begins with platform protocol.
-   */
-  public static boolean withPlatformProtocol(String uriString)
-  {
-    return uriString.startsWith(PLATFORM_PROTOCOL);
-  }
-
-  /**
-   * Returns the value of the 'Min Occurs' attribute. The default value is "1".
-   * 
-   * @param component -
-   *          a concrete component.
-   * @return the value of the 'Min Occurs' attribute.
-   */
-  public static int getMinOccurs(XSDConcreteComponent component)
-  {
-    int minOccur = 1;
-    if (component != null)
-    {
-      Object o = component.getContainer();
-      if (o instanceof XSDParticle)
-      {
-        if (((XSDParticle) o).isSetMinOccurs())
-        {
-          try
-          {
-            minOccur = ((XSDParticle) o).getMinOccurs();
-          }
-          catch (Exception e)
-          {
-            minOccur = 1;
-          }
-        }
-      }
-    }
-    return minOccur;
-  }
-
-  /**
-   * Returns the value of the 'Max Occurs' attribute. The default value is "1".
-   * 
-   * @param component -
-   *          a concrete component.
-   * @return the value of the 'Max Occurs' attribute.
-   */
-  public static int getMaxOccurs(XSDConcreteComponent component)
-  {
-    int maxOccur = 1;
-    if (component != null)
-    {
-      Object o = component.getContainer();
-      if (o instanceof XSDParticle)
-      {
-        if (((XSDParticle) o).isSetMaxOccurs())
-        {
-          try
-          {
-            maxOccur = ((XSDParticle) o).getMaxOccurs();
-          }
-          catch (Exception e)
-          {
-            maxOccur = 1;
-          }
-        }
-      }
-    }
-    return maxOccur;
-  }
-
-  /**
-   * Returns the enumerated values for the given type.
-   * 
-   * @param type -
-   *          a type definition.
-   * @return the enumerated values for the given type.
-   */
-  public static String[] getEnumeratedValuesForType(XSDTypeDefinition type)
-  {
-    List result = new ArrayList();
-    if (type instanceof XSDSimpleTypeDefinition)
-    {
-      List enumerationFacets = ((XSDSimpleTypeDefinition) type).getEnumerationFacets();
-      for (Iterator i = enumerationFacets.iterator(); i.hasNext();)
-      {
-        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) i.next();
-        List values = enumFacet.getValue();
-        for (Iterator j = values.iterator(); j.hasNext();)
-        {
-          Object o = j.next();
-          if (o != null)
-          {
-            result.add(o.toString());
-          }  
-        }
-      }
-    }
-    String[] array = new String[result.size()];
-    result.toArray(array);
-    return array;
-  }
-
-  /**
-   * Return a list of documentation elements from the given annotation. Working
-   * with documentation elements requires dropping down into the DOM model.
-   * 
-   * @param annotation -
-   *          an XSDAnnotation node.
-   * @return a list of documentation elements.
-   */
-  public static CMNodeList getDocumentations(XSDAnnotation annotation)
-  {
-    CMNodeListImpl documentations = new CMNodeListImpl();
-    if (annotation != null)
-    {
-      List documentationsElements = annotation.getUserInformation();
-      for (Iterator i = documentationsElements.iterator(); i.hasNext();)
-      {
-        documentations.getList().add(new DocumentationImpl((Element) i.next()));
-      }
-    }
-    return documentations;
-  }
-
-  /**
-   * Adapted from public static List findTypesDerivedFrom(XSDSchema schema,
-   * String namespace, String localName) in class XSDSchemaQueryTools found in
-   * org.eclipse.xsd plugin.
-   * 
-   * Find typeDefinitions that derive from a given type.
-   * 
-   * @param type
-   *          the type derived from
-   * @return List of any XSDTypeDefinitions found
-   */
-  public static List findTypesDerivedFrom(XSDTypeDefinition type)
-  {
-    ArrayList typesDerivedFrom = new ArrayList();
-    if (type != null)
-    {
-      XSDSchema schema = type.getSchema();
-      String localName = type.getName();
-      if ((null != schema) && (null != localName))
-      {
-        String namespace = schema.getTargetNamespace();
-        // A handy convenience method quickly gets all
-        // typeDefinitions within our schema; note that
-        // whether or not this returns types in included,
-        // imported, or redefined schemas is subject to change
-        List typedefs = schema.getTypeDefinitions();
-        for (Iterator iter = typedefs.iterator(); iter.hasNext();)
-        {
-          XSDTypeDefinition typedef = (XSDTypeDefinition) iter.next();
-          if (typedef instanceof XSDComplexTypeDefinition)
-          {
-            // Walk the baseTypes from this typedef seeing if any
-            // of them match the requested one
-            if (isTypeDerivedFrom(typedef, namespace, localName))
-            {
-              // We found it, return the original one and continue
-              typesDerivedFrom.add(typedef);
-              continue;
-            }
-          }
-        }
-      }
-    }
-    return typesDerivedFrom;
-  }
-
-  /**
-   * Adapted from protected static boolean isTypeDerivedFrom(XSDTypeDefinition
-   * typedef, String namespace, String localName) in class XSDSchemaQueryTools
-   * found in org.eclipse.xsd plugin.
-   * 
-   * Recursive worker method to find typeDefinitions that derive from a named
-   * type.
-   * 
-   * @see #findTypesDerivedFrom(XSDSchema, String, String)
-   * @param typeDef
-   *          to see if it's derived from
-   * @param namespace
-   *          for the type derived from
-   * @param localName
-   *          for the type derived from
-   * @return true if it is; false otherwise
-   */
-  protected static boolean isTypeDerivedFrom(XSDTypeDefinition typedef, String namespace, String localName)
-  {
-    // Walk the baseTypes from this typedef seeing if any
-    // of them match the requested one
-    XSDTypeDefinition baseType = typedef.getBaseType();
-    // As this convenience method if our parameters match
-    if (baseType.hasNameAndTargetNamespace(localName, namespace))
-    {
-      return true;
-    }
-    XSDTypeDefinition rootType = typedef.getRootType();
-    if (rootType == baseType)
-    {
-      // If we've hit the root, we aren't derived from it
-      return false;
-    }
-    else
-    {
-      // Otherwise continue to traverse upwards
-      return isTypeDerivedFrom(baseType, namespace, localName);
-    }
-  }
-
-  /**
-   * Returns the corresponding cmnode of the specified XML Schema node.
-   * 
-   * @param target -
-   *          an XML Schema node
-   * @return the corresponding cmnode.
-   */
-  public static CMNode getAdapter(Notifier o)
-  {
-    return (CMNode) xsdAdapterFactoryImpl.adapt(o);
-  }
-
-  /**
-   * Adapted from public String getPrefix(String ns, boolean withColon) in class
-   * TypesHelper found in org.eclipse.wst.xsd.editor plugin.
-   * 
-   * @param schema -
-   *          the relevant schema
-   * @param ns -
-   *          the relevant namespace
-   */
-  public static String getPrefix(XSDSchema schema, String ns)
-  {
-    String key = "";
-    if ((schema != null) && (ns != null))
-    {
-      Map map = schema.getQNamePrefixToNamespaceMap();
-      Iterator iter = map.keySet().iterator();
-      while (iter.hasNext())
-      {
-        Object keyObj = iter.next();
-        Object value = map.get(keyObj);
-        if (value != null && value.toString().equals(ns))
-        {
-          if (keyObj != null)
-          {
-            key = keyObj.toString();
-          }
-          else
-          {
-            key = "";
-          }
-          break;
-        }
-      }
-    }
-    return key;
-  }
-  /**
-   * The Factory for the XSD adapter model. It provides a create method for each
-   * non-abstract class of the model.
-   */
-  public static class XSDAdapterFactoryImpl extends AdapterFactoryImpl
-  {
-    public Adapter createAdapter(Notifier target)
-    {
-      XSDSwitch xsdSwitch = new XSDSwitch()
-      {
-        public Object caseXSDWildcard(XSDWildcard object)
-        {
-          return new XSDWildcardAdapter(object);
-        }
-
-        public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
-        {
-          return new XSDModelGroupDefinitionAdapter(object);
-        }
-
-        public Object caseXSDAttributeUse(XSDAttributeUse object)
-        {
-          return new XSDAttributeUseAdapter(object);
-        }
-
-        public Object caseXSDElementDeclaration(XSDElementDeclaration object)
-        {
-          return new XSDElementDeclarationAdapter(object);
-        }
-
-        public Object caseXSDModelGroup(XSDModelGroup object)
-        {
-          return new XSDModelGroupAdapter(object);
-        }
-
-        public Object caseXSDSchema(XSDSchema object)
-        {
-          return new XSDSchemaAdapter(object);
-        }
-      };
-      Object o = xsdSwitch.doSwitch((EObject) target);
-      Adapter result = null;
-      if (o instanceof Adapter)
-      {
-        result = (Adapter) o;
-      }
-      else
-      {
-        Thread.dumpStack();
-      }
-      return result;
-    }
-
-    public Adapter adapt(Notifier target)
-    {
-      return adapt(target, this);
-    }
-  }
-  /**
-   * XSDBaseAdapter -- an abstract base node in the model. All other model nodes
-   * are derived from it.
-   */
-  public static abstract class XSDBaseAdapter extends CMNodeImpl
-  {
-    protected CMNodeListImpl documentation = new CMNodeListImpl();
-
-    /**
-     * Returns the name of the node. The default value is an empty string value.
-     * All derived classes must override this method if they do not want the
-     * default value.
-     * 
-     * @return the name of the node.
-     */
-    public String getNodeName()
-    {
-      return "";
-    }
-
-    /**
-     * Returns true of the given factory is the factory for this XSD adapter
-     * model.
-     * 
-     * @param type -
-     *          a factory
-     * @return true if the type is the adapter factory for this model.
-     */
-    public boolean isAdapterForType(Object type)
-    {
-      return type == xsdAdapterFactoryImpl;
-    }
-
-    /**
-     * Returns true if the property is supported for this class.
-     * 
-     * @param propertyName -
-     *          name of a property
-     * @return true if the property is supported.
-     */
-    public boolean supports(String propertyName)
-    {
-      return propertyName.equals(PROPERTY_NS_PREFIX_QUALIFICATION) || propertyName.equals(PROPERTY_NILLABLE) || propertyName.equals(PROPERTY_USES_LOCAL_ELEMENT_DECLARATIONS)
-          || propertyName.equals(PROPERTY_DOCUMENTATION) || propertyName.equals(PROPERTY_DOCUMENTATION_SOURCE) || propertyName.equals(PROPERTY_DOCUMENTATION_LANGUAGE)
-          || propertyName.equals(PROPERTY_MOF_NOTIFIER) || propertyName.equals(PROPERTY_DEFINITION_INFO) || propertyName.equals(PROPERTY_DEFINITION) || propertyName.equals(PROPERTY_CMDOCUMENT)
-          || propertyName.equals(PROPERTY_IS_NAME_SPACE_AWARE) || propertyName.equals(PROPERTY_SPEC) || super.supports(propertyName);
-    }
-
-    /**
-     * Returns the value of the 'Nillable' attribute. This represents the
-     * nillable infoset property. The default value is false. All derived
-     * classes must override this method if they do not want the default value.
-     * 
-     * @return the value of the 'Nillable' attribute.
-     */
-    public boolean isNillable()
-    {
-      return false;
-    }
-
-    /**
-     * Returns the cmdocument that is the owner of this cmnode. The default
-     * value is null; All derived classes must override this method if they do
-     * not want the default value.
-     * 
-     * @return the cmdocument corresponding to this cmnode.
-     */
-    public CMDocument getCMDocument()
-    {
-      return null;
-    }
-
-    /**
-     * Return a list of documentation elements. The default value is an empty
-     * CMNodeList; All derived classes must override this method if they do not
-     * want the default value.
-     * 
-     * @return a list of documentation elements.
-     */
-    protected CMNodeList getDocumentation()
-    {
-      return documentation;
-    }
-
-    /**
-     * Returns the property value for the property name. Returns null if the
-     * property is not supported.
-     * 
-     * @param propertyName -
-     *          name of a property
-     * @return the property value for the property name.
-     */
-    public Object getProperty(String propertyName)
-    {
-      Object result = null;
-      if (propertyName.equals(PROPERTY_CMDOCUMENT))
-      {
-        result = getCMDocument();
-      }
-      else if (propertyName.equals(PROPERTY_DOCUMENTATION))
-      {
-        result = getDocumentation();
-      }
-      else if (propertyName.equals(PROPERTY_USES_LOCAL_ELEMENT_DECLARATIONS))
-      {
-        result = Boolean.TRUE;
-      }
-      else if (propertyName.equals(PROPERTY_IS_NAME_SPACE_AWARE))
-      {
-        result = Boolean.TRUE;
-      }
-      else if (propertyName.equals(PROPERTY_NS_PREFIX_QUALIFICATION))
-      {
-        result = getNSPrefixQualification();
-      }
-      else if (propertyName.equals(PROPERTY_NILLABLE))
-      {
-        result = isNillable() ? xsiDocument.nilAttribute : null;
-      }
-      else if (propertyName.equals(PROPERTY_MOF_NOTIFIER))
-      {
-        result = getKey();
-      }
-      else if (propertyName.equals(PROPERTY_SPEC))
-      {
-        result = getSpec();
-      }
-      else
-      {
-        result = super.getProperty(propertyName);
-        {
-          CMDocument cmDocument = getCMDocument();
-          if (cmDocument instanceof XSDSchemaAdapter)
-          {
-            AnnotationMap map = ((XSDSchemaAdapter) cmDocument).annotationMap;
-            if (map != null)
-            {
-              String spec = getSpec();
-              if (spec != null)
-              {
-                result = map.getProperty(getSpec(), propertyName);
-              }
-            }
-          }
-        }
-      }
-      return result;
-    }
-       
-
-
-    /*
-     * Returns the value of the form [attribute] which affects the target
-     * namespace of locally scoped features. The default value is null. All
-     * derived classes must override this method if they do not want the default
-     * value. @return the value of the form [attribute].
-     */
-    public Object getNSPrefixQualification()
-    {
-      return null;
-    }
-
-    /**
-     * Returns a general XPath expression for the node.
-     * 
-     * @return a general XPath expression for the node.
-     */
-    public String getSpec()
-    {
-      return "//" + getNodeName();
-    }
-  }
-  /**
-   * XSDSchemaAdapter implements CMDocument. A representation of the model
-   * object 'Schema'.
-   */
-  public static class XSDSchemaAdapter extends XSDBaseAdapter implements CMDocument
-  {
-    protected XSDSchema xsdSchema;
-    protected CMNamedNodeMapImpl namedNodeMap;
-    protected CMNamedNodeMapImpl entityNodeMap;
-    protected AnnotationMap annotationMap = new AnnotationMap();
-    protected Hashtable substitutionGroupTable;
-
-    /**
-     * Constructor.
-     * 
-     * @param xsdSchema -
-     *          the schema node.
-     */
-    public XSDSchemaAdapter(XSDSchema xsdSchema)
-    {
-      this.xsdSchema = xsdSchema;
-    }
-
-    /**
-     * Returns the key for this cmnode which is the corresponding XML Schema
-     * node.
-     * 
-     * @return the key for this cmnode.
-     */
-    public Object getKey()
-    {
-      return xsdSchema;
-    }
-
-    /**
-     * Returns the filename.
-     * 
-     * @return the filename.
-     */
-    public String getNodeName()
-    {
-      // See buildCMDocument() above.
-      return xsdSchema.getSchemaLocation();
-    }
-
-    /**
-     * Returns true if the property is supported for this class.
-     * 
-     * @param propertyName -
-     *          name of a property
-     * @return true if the property is supported.
-     */
-    public boolean supports(String propertyName)
-    {
-      return propertyName.equals(PROPERTY_TARGET_NAMESPACE_URI) || propertyName.equals(PROPERTY_IMPORTED_NAMESPACE_INFO) || propertyName.equals(PROPERTY_NAMESPACE_INFO)
-          || propertyName.equals(PROPERTY_ELEMENT_FORM_DEFAULT) || propertyName.equals(PROPERTY_ANNOTATION_MAP) || super.supports(propertyName);
-    }
-
-    /**
-     * Returns true if a prefix is globally required for elements.
-     * 
-     * @param xsdSchema -
-     *          the corresponding schema node.
-     * @return true if a prefix is globally required for elements.
-     */
-    protected boolean isPrefixRequired(XSDSchema xsdSchema)
-    {
-      boolean result = true;
-      if (xsdSchema.isSetElementFormDefault())
-        result = !(xsdSchema.getElementFormDefault().getValue() == XSDForm.QUALIFIED);
-      return result;
-    }
-
-    /**
-     * Returns the property value for the property name. Returns null if the
-     * property is not supported.
-     * 
-     * @param propertyName -
-     *          name of a property
-     * @return the property value for the property name.
-     */
-    public Object getProperty(String propertyName)
-    {
-      Object result = null;
-      if (propertyName.equals(PROPERTY_TARGET_NAMESPACE_URI))
-      {
-        result = xsdSchema.getTargetNamespace();
-      }
-      else if (propertyName.equals(PROPERTY_IMPORTED_NAMESPACE_INFO))
-      {
-        List list = new Vector();
-        getImportedNamespaceInfo(xsdSchema, list);
-        result = list;
-      }
-      else if (propertyName.equals(PROPERTY_NAMESPACE_INFO))
-      {
-        List list = new Vector();
-        NamespaceInfo info = new NamespaceInfo();
-        info.uri = xsdSchema.getTargetNamespace();
-        info.prefix = getPrefix(xsdSchema, info.uri);
-        info.locationHint = null; // note that this locationHint info is null
-                                  // for the root xsd file
-        info.isPrefixRequired = isPrefixRequired(xsdSchema);
-        list.add(info);
-        getImportedNamespaceInfo(xsdSchema, list);
-        result = list;
-      }
-      else if (propertyName.equals(PROPERTY_ELEMENT_FORM_DEFAULT))
-      {
-        result = xsdSchema.getElementFormDefault().getName();
-      }
-      else if (propertyName.equals(PROPERTY_ANNOTATION_MAP))
-      {
-        result = annotationMap;
-      }
-      else if (propertyName.equals("allElements"))
-      {
-        result = getAllElements();
-      }  
-      else if (propertyName.startsWith("getElementForType#"))
-      {
-        int index = propertyName.indexOf("#");
-        String typeName = propertyName.substring(index + 1, propertyName.length());
-        //
-        //
-        XSDTypeDefinition td = xsdSchema.resolveTypeDefinition(typeName);
-        if (td != null)
-        {
-          LocalElementVisitor localElementVisitor = new LocalElementVisitor();
-          localElementVisitor.visitTypeDefinition(td);
-          result = localElementVisitor.getCMNamedNodeMap();
-        }
-      }
-      else
-      {
-        result = super.getProperty(propertyName);
-      }
-      return result;
-    }
-
-    /**
-     * Gather information on namespaces used in external references.
-     * 
-     * @param theXSDSchema -
-     *          the corresponding schema node
-     * @param list -
-     *          the list of imported namespaces.
-     */
-    public void getImportedNamespaceInfo(XSDSchema theXSDSchema, List list)
-    {
-      for (Iterator iterator = theXSDSchema.getContents().iterator(); iterator.hasNext();)
-      {
-        XSDSchemaContent content = (XSDSchemaContent) iterator.next();
-        if (content instanceof XSDImport)
-        {
-          XSDImport xImport = (XSDImport) content;
-          XSDSchema importedXSDSchema = xImport.getResolvedSchema();
-          NamespaceInfo info = new NamespaceInfo();
-          info.uri = xImport.getNamespace();
-          info.prefix = getPrefix(importedXSDSchema, info.uri);
-          info.locationHint = xImport.getSchemaLocation();
-          if (importedXSDSchema != null)
-          {
-            info.isPrefixRequired = isPrefixRequired(importedXSDSchema);
-          }
-          list.add(info);
-        }
-      }
-    }
-
-    /**
-     * Returns set of named (top-level) element declarations for this schema
-     * node.
-     * 
-     * @return a set of named (top-level) element declarations.
-     */
-    public CMNamedNodeMap getElements()
-    {
-      if (namedNodeMap == null)
-      {
-        namedNodeMap = new CMNamedNodeMapImpl();
-        
-        // Note that if we call xsdSchema.getElementDeclarations()
-        // we get 'more' elements than we really want since we also
-        // get 'imported' elements.  Below we test to ensure the elements
-        // actually have the same target namespace as the schema.
-        String targetNamespace = xsdSchema.getTargetNamespace();
-        for (Iterator i = xsdSchema.getElementDeclarations().iterator(); i.hasNext();)
-        {
-          XSDElementDeclaration ed = (XSDElementDeclaration) i.next();
-          if (targetNamespace != null ? targetNamespace.equals(ed.getTargetNamespace()) : ed.getTargetNamespace() == null)
-          {
-            XSDElementDeclarationAdapter adapter = (XSDElementDeclarationAdapter) getAdapter(ed);
-            namedNodeMap.getHashtable().put(adapter.getNodeName(), adapter);
-          }
-        }
-      }
-      return namedNodeMap;
-    }
-
-    /**
-     * Returns the built-in entity declarations.
-     * 
-     * @return the built-in entity declarations.
-     */
-    public CMNamedNodeMap getEntities()
-    {
-      if (entityNodeMap == null)
-      {
-        entityNodeMap = new CMNamedNodeMapImpl();
-        // add the built in entity declarations
-        entityNodeMap.getHashtable().put("amp", new CMEntityDeclarationImpl("amp", "&"));
-        entityNodeMap.getHashtable().put("lt", new CMEntityDeclarationImpl("lt", "<"));
-        entityNodeMap.getHashtable().put("gt", new CMEntityDeclarationImpl("gt", ">"));
-        entityNodeMap.getHashtable().put("quot", new CMEntityDeclarationImpl("quot", "\""));
-        entityNodeMap.getHashtable().put("apos", new CMEntityDeclarationImpl("apos", "'"));
-      }
-      return entityNodeMap;
-    }
-
-    /**
-     * Returns the type of the node. The types are defined in CMNode class
-     * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
-     * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
-     * DOCUMENTATION).
-     * 
-     * @return the type of this node.
-     */
-    public int getNodeType()
-    {
-      return DOCUMENT;
-    }
-
-    /*
-     * Returns null. !!! Why are we not implementing this???? @return null.
-     */
-    public CMNamespace getNamespace()
-    {
-      return null;
-    }
-
-    /**
-     * Returns this.
-     * 
-     * @return this.
-     */
-    public CMDocument getCMDocument()
-    {
-      return this;
-    }
-    
-    public CMNamedNodeMap getAllElements()
-    {
-      CMNamedNodeMapImpl map = new CMNamedNodeMapImpl();
-      for (Iterator i = getElements().iterator(); i.hasNext(); )
-      {
-        CMElementDeclaration ed = (CMElementDeclaration)i.next();
-        map.put(ed);           
-        addLocalElementDefinitions(map, ed);              
-      }     
-      return map;
-    }
-    
-    protected void addLocalElementDefinitions(CMNamedNodeMapImpl map, CMElementDeclaration parentElementDeclaration)
-    {
-      CMNamedNodeMap localElementMap = parentElementDeclaration.getLocalElements();
-      for (Iterator i = localElementMap.iterator(); i.hasNext(); )
-      {
-        CMElementDeclaration ed = (CMElementDeclaration)i.next();
-        if (map.getNamedItem(ed.getNodeName()) == null)
-        {  
-          map.put(ed);        
-          addLocalElementDefinitions(map, ed);
-        }  
-      }               
-    }
-  }
-  /**
-   * XSDAttributeUseAdapter implements CMAttributeDeclaration. A representation
-   * of the model object 'Attribute Use'.
-   */
-  public static class XSDAttributeUseAdapter extends XSDBaseAdapter implements CMAttributeDeclaration
-  {
-    // provides access to the XML Schema node
-    protected XSDAttributeUse xsdAttributeUse;
-    // provides access to the type of the attribute
-    protected CMDataType dataType = new DataTypeImpl();
-
-    /**
-     * Constructor.
-     * 
-     * @param xsdAttributeUse -
-     *          the XML Schema node.
-     */
-    public XSDAttributeUseAdapter(XSDAttributeUse xsdAttributeUse)
-    {
-      this.xsdAttributeUse = xsdAttributeUse;
-    }
-
-    /**
-     * Returns the key for this cmnode which is the corresponding XML Schema
-     * node.
-     * 
-     * @return the key for this cmnode.
-     */
-    public Object getKey()
-    {
-      return xsdAttributeUse;
-    }
-
-    /**
-     * Returns a general XPath expression for the node.
-     * 
-     * @return a general XPath expression for the node.
-     */
-    public String getSpec()
-    {
-      return "//@" + getAttrName();
-    }
-
-    /**
-     * Returns the type of the node. The types are defined in CMNode class
-     * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
-     * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
-     * DOCUMENTATION).
-     * 
-     * @return the type of this node.
-     */
-    public int getNodeType()
-    {
-      return ATTRIBUTE_DECLARATION;
-    }
-
-    /**
-     * Returns the name of the node. Similar to getAttrName().
-     * 
-     * @return the name of the node.
-     */
-    public String getNodeName()
-    {
-      return getAttrName();
-    }
-
-    /**
-     * getEnumAttr method
-     * 
-     * @return java.util.Enumeration
-     * @deprecated -- to be replaced in future with additional CMDataType
-     *             methods (currently found on CMDataTypeHelper)
-     */
-    public Enumeration getEnumAttr()
-    {
-      return Collections.enumeration(Collections.EMPTY_LIST);
-    }
-
-    /**
-     * Returns the name of this attribute. Similar to getNodeName().
-     * 
-     * @return the name of this attribute.
-     */
-    public String getAttrName()
-    {
-      return xsdAttributeUse.getAttributeDeclaration().getName();
-    }
-
-    /**
-     * Returns the type of the attribute.
-     * 
-     * @return the type of the attribute.
-     */
-    public CMDataType getAttrType()
-    {
-      return dataType;
-    }
-
-    /**
-     * Returns the value of the default or fixed constraint.
-     * 
-     * @return the value of the default or fixed constraint.
-     */
-    public String getDefaultValue()
-    {
-      return dataType.getImpliedValue();
-    }
-
-    /**
-     * Returns the usage constraint for this attribute. The usages are defined
-     * in CMAttributeDeclaration class (OPTIONAL, REQUIRED, FIXED or
-     * PROHIBITED).
-     * 
-     * @return the usage constraint for this attribute.
-     */
-    public int getUsage()
-    {
-      int useKind = OPTIONAL;
-      switch (xsdAttributeUse.getUse().getValue())
-      {
-        case XSDAttributeUseCategory.OPTIONAL : {
-          useKind = OPTIONAL;
-          break;
-        }
-        case XSDAttributeUseCategory.PROHIBITED : {
-          useKind = PROHIBITED;
-          break;
-        }
-        case XSDAttributeUseCategory.REQUIRED : {
-          useKind = REQUIRED;
-          break;
-        }
-      }
-      return useKind;
-    }
-
-    /*
-     * Returns the value of the form [attribute] which affects the target
-     * namespace of locally scoped features. If the form is not set on this
-     * attribute, then see if there is a globally defined default. @return the
-     * value of the form [attribute].
-     */
-    public Object getNSPrefixQualification()
-    {
-      String form = null;
-      if (xsdAttributeUse.getContent() != xsdAttributeUse.getAttributeDeclaration())
-      {
-      	form =  "qualified";
-      }	
-      else if (xsdAttributeUse.getContent().isSetForm())
-      {
-        form = xsdAttributeUse.getContent().getForm().getName();
-      }
-      else
-      {
-        XSDSchema schema = xsdAttributeUse.getSchema();
-        if (schema != null)
-          form = schema.getAttributeFormDefault().getName();
-      }
-      return form;
-    }
-
-    /**
-     * Return a list of documentation elements.
-     * 
-     * @return a list of documentation elements.
-     */
-    protected CMNodeList getDocumentation()
-    {
-      XSDAnnotation annotation = xsdAttributeUse.getAttributeDeclaration().getAnnotation();
-      return getDocumentations(annotation);
-    }
-
-    /**
-     * Returns the cmdocument that is the owner of this cmnode.
-     * 
-     * @return the cmdocument corresponding to this cmnode.
-     */
-    public CMDocument getCMDocument()
-    {
-      return (CMDocument) getAdapter(xsdAttributeUse.getSchema());
-    }
-    /**
-     * XSDAttributeUseAdapter.DataTypeImpl An inner class to hold type
-     * information for this attribute.
-     */
-    public class DataTypeImpl implements CMDataType
-    {
-      /**
-       * Returns the type of the node. The types are defined in CMNode class
-       * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
-       * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
-       * DOCUMENTATION).
-       * 
-       * @return the type of this node.
-       */
-      public int getNodeType()
-      {
-        return CMNode.DATA_TYPE;
-      }
-
-      /**
-       * Returns the name of the attribute type. Same as getDataTypeName().
-       * 
-       * @return the name of the attribute type.
-       */
-      public String getNodeName()
-      {
-        return getDataTypeName();
-      }
-
-      /**
-       * Returns false. This class does not support any properties.
-       * 
-       * @param propertyName -
-       *          name of a property
-       * @return false.
-       */
-      public boolean supports(String propertyName)
-      {
-        return false;
-      }
-
-      /**
-       * Returns null. This class does not support any properties.
-       * 
-       * @param propertyName -
-       *          name of a property
-       * @return null.
-       */
-      public Object getProperty(String propertyName)
-      {
-        return null;
-      }
-
-      /**
-       * Returns the name of the attribute type. Same as getNodeName().
-       * 
-       * @return the name of the attribute type.
-       */
-      public String getDataTypeName()
-      {
-        XSDSimpleTypeDefinition sc = xsdAttributeUse.getAttributeDeclaration().getTypeDefinition();
-        String typeName = sc.getName();
-        return typeName != null ? typeName : "string";
-      }
-
-      /**
-       * Returns the kind of constraint: none, default or fixed. The kinds are
-       * defined in CMDataType class (IMPLIED_VALUE_NONE, IMPLIED_VALUE_FIXED or
-       * IMPLIED_VALUE_DEFAULT).
-       * 
-       * @return the kind of constraint: none, default or fixed.
-       */
-      public int getImpliedValueKind()
-      {
-        int result = IMPLIED_VALUE_NONE;
-        if (xsdAttributeUse.isSetConstraint())
-        {
-          if (xsdAttributeUse.getConstraint().getValue() == XSDConstraint.DEFAULT)
-            result = IMPLIED_VALUE_DEFAULT;
-          else if (xsdAttributeUse.getConstraint().getValue() == XSDConstraint.FIXED)
-            result = IMPLIED_VALUE_FIXED;
-        }
-        return result;
-      }
-
-      /**
-       * Returns the value of the default or fixed constraint.
-       * 
-       * @return the value of the default or fixed constraint.
-       */
-      public String getImpliedValue()
-      {
-        String result = null;
-        if (xsdAttributeUse.isSetConstraint())
-        {
-          result = xsdAttributeUse.getLexicalValue();
-        }
-        return result;
-      }
-
-      /**
-       * Returns the enumerated values for the attribute type.
-       * 
-       * @return the enumerated values for the attribute type.
-       */
-      public String[] getEnumeratedValues()
-      {
-        return getEnumeratedValuesForType(getXSDType());
-      }
-
-      /**
-       * Generate a valid value for the attribute based on its type.
-       * 
-       * @return a valid value for the attribute based on its type.
-       */
-      public String generateInstanceValue()
-      {
-        XSDAttributeDeclaration attr = xsdAttributeUse.getAttributeDeclaration();
-        return XSDTypeUtil.getInstanceValue(attr.getResolvedAttributeDeclaration().getTypeDefinition());
-      }
-
-      /**
-       * Returns the corresponding XML Schema type definition.
-       * 
-       * @return the corresponding XML Schema type definition.
-       */
-      protected XSDTypeDefinition getXSDType()
-      {
-        XSDAttributeDeclaration attr = xsdAttributeUse.getAttributeDeclaration();
-        return attr.getResolvedAttributeDeclaration().getTypeDefinition();
-      }
-    }
-  }
-  /**
-   * ElementDeclarationBaseImpl implements CMElementDeclaration. This is the
-   * base class for XSDElementDeclaration and DerivedElementDeclarationImpl.
-   * 
-   * Abstract methods in this class are: public abstract Object getKey(); public
-   * abstract Object getNSPrefixQualification(); public abstract
-   * XSDElementDeclaration getXSDElementDeclaration(); public abstract
-   * XSDTypeDefinition getXSDType(); public abstract List getXSITypes(); public
-   * abstract CMElementDeclaration getDerivedElementDeclaration(String
-   * uriQualifiedTypeName); public abstract CMNode getDefinition(); public
-   * abstract String getDefinitionInfo(); public abstract CMNodeListImpl
-   * getSubstitutionGroup();
-   */
-  public static abstract class ElementDeclarationBaseImpl extends XSDBaseAdapter implements CMElementDeclaration
-  {
-    protected CMDataType dataType = new DataTypeImpl();
-    protected CMNamedNodeMap namedNodeMap;
-
-    /**
-     * Returns corresponding XML Schema element declaration.
-     * 
-     * @return corresponding XML Schema element declaration.
-     */
-    protected abstract XSDElementDeclaration getXSDElementDeclaration();
-
-    /**
-     * Returns corresponding XML Schema element declaration.
-     * 
-     * @return corresponding XML Schema element declaration.
-     */
-    protected abstract XSDElementDeclaration getResolvedXSDElementDeclaration();
-
-    /**
-     * Returns the type of the node. The types are defined in CMNode class
-     * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
-     * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
-     * DOCUMENTATION).
-     * 
-     * @return the type of this node.
-     */
-    public int getNodeType()
-    {
-      return ELEMENT_DECLARATION;
-    }
-
-    /**
-     * Returns the name of the node. The same as getElementName().
-     * 
-     * @return the name of the node.
-     */
-    public String getNodeName()
-    {
-      return getElementName();
-    }
-
-    /**
-     * Returns the name of this element. The same as getNodeName().
-     * 
-     * @return the name of this element.
-     */
-    public String getElementName()
-    {
-      String result = getResolvedXSDElementDeclaration().getName();
-      return result != null ? result : "";
-    }
-
-    /**
-     * Returns true if the property is supported for this class.
-     * 
-     * @param propertyName -
-     *          name of a property
-     * @return true if the property is supported.
-     */
-    public boolean supports(String propertyName)
-    {
-      return propertyName.equals(PROPERTY_XSITYPES) || propertyName.equals(PROPERTY_DERIVED_ELEMENT_DECLARATION) || propertyName.equals(PROPERTY_SUBSTITUTION_GROUP)
-          || propertyName.equals(PROPERTY_ABSTRACT) || super.supports(propertyName);
-    }
-
-    /**
-     * Returns the key for this cmnode which is the corresponding XML Schema
-     * node.
-     * 
-     * @return the key for this cmnode.
-     */
-    public abstract Object getKey();
-
-    /**
-     * Returns the set of attributes defined for this element.
-     * 
-     * @return the set of attributes defined for this element.
-     */
-    public CMNamedNodeMap getAttributes()
-    {
-      CMNamedNodeMapImpl map = new CMNamedNodeMapImpl();
-      XSDTypeDefinition td = getXSDType();
-      getAttributes(map, td);
-      addXSITypeAttribute(map);
-      return map;
-    }
-
-    /**
-     * Gather the set of attributes defined for this element.
-     * 
-     * @param map -
-     *          used for returning the set of attributes.
-     * @param xsdTypeDefinition -
-     *          the type definition for this element.
-     */
-    public void getAttributes(CMNamedNodeMapImpl map, XSDTypeDefinition xsdTypeDefinition)
-    {
-      if (xsdTypeDefinition instanceof XSDComplexTypeDefinition)
-      {
-        XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition) xsdTypeDefinition;
-        for (Iterator i = ctd.getAttributeUses().iterator(); i.hasNext();)
-        {
-          XSDAttributeUse xsdAttributeUse = (XSDAttributeUse) i.next();
-          XSDAttributeUseAdapter adapter = (XSDAttributeUseAdapter) getAdapter(xsdAttributeUse);
-          if (adapter != null && adapter.getNodeName() != null)
-          {
-            map.getHashtable().put(adapter.getNodeName(), adapter);
-          }
-        }
-      }
-    }
-
-    /**
-     * Returns the content for this element.
-     * 
-     * @return the content for this element.
-     */
-    public CMContent getContent()
-    {
-      CMContent result = null;
-      XSDTypeDefinition td = getXSDType();
-      if (td instanceof XSDComplexTypeDefinition)
-      {
-        DerivedChildVisitor dcv = new DerivedChildVisitor(td);
-        dcv.visitTypeDefinition(td);
-        CMNodeList nodeList = dcv.getChildNodeList();
-        if (nodeList.getLength() > 1)
-        {
-          result = new CMGroupImpl(nodeList, CMGroup.SEQUENCE);
-        }
-        else if (nodeList.getLength() > 0)
-        {
-          result = (CMContent) nodeList.item(0);
-        }
-      }
-      return result;
-    }
-
-    /**
-     * Returns the content type of this element. The content type is defined in
-     * CMElementDeclaration (ANY, EMPTY, ELEMENT, MIXED, PCDATA or CDATA).
-     * 
-     * @return the content type of this element.
-     */
-    public int getContentType()
-    {
-      int contentType = EMPTY;
-      XSDTypeDefinition td = getXSDType();
-      if (td instanceof XSDSimpleTypeDefinition)
-      {
-        String typeName = td.getName();
-        if (typeName != null && typeName.equals("anyType"))
-        {
-          contentType = ANY;
-        }
-        else
-        {
-          contentType = PCDATA;
-        }
-      }
-      else if (td instanceof XSDComplexTypeDefinition)
-      {
-        XSDContentTypeCategory category = ((XSDComplexTypeDefinition) td).getContentTypeCategory();
-        if (category != null)
-        {
-          switch (category.getValue())
-          {
-            case XSDContentTypeCategory.ELEMENT_ONLY :
-              contentType = ELEMENT;
-              break;
-            case XSDContentTypeCategory.EMPTY :
-              contentType = EMPTY;
-              break;
-            case XSDContentTypeCategory.MIXED :
-              contentType = MIXED;
-              break;
-            case XSDContentTypeCategory.SIMPLE :
-              contentType = PCDATA;
-              break;
-          }
-        }
-      }
-      return contentType;
-    }
-
-    /**
-     * Returns the name of the element type.
-     * 
-     * @return the name of the element type.
-     */
-    public CMDataType getDataType()
-    {
-      CMDataType result = null;
-      int contentType = getContentType();
-      boolean hasDataType = contentType == PCDATA || contentType == MIXED;
-      if (hasDataType)
-      {
-        result = dataType;
-      }
-      return result;
-    }
-
-    /**
-     * Returns the value of 'Min Occurs' attribute. The default value is "1".
-     * 
-     * @return the value of the 'Min Occurs' attribute.
-     */
-    public int getMinOccur()
-    {
-      return getMinOccurs(getXSDElementDeclaration());
-    }
-
-    /**
-     * Returns the value of the 'Max Occurs' attribute. The default value is
-     * "1".
-     * 
-     * @return the value of the 'Max Occurs' attribute.
-     */
-    public int getMaxOccur()
-    {
-      return getMaxOccurs(getXSDElementDeclaration());
-    }
-
-    /**
-     * Returns the referenced element declaration if this is an element
-     * reference. Otherwise it returns itself.
-     * 
-     * @return an element declaration.
-     */
-    protected abstract CMNode getDefinition();
-
-    /**
-     * Returns a string indicating whether the element declaration is global or
-     * local. Returns null if this is an element reference.
-     * 
-     * @return a string indicating whether the element declaration is global or
-     *         local.
-     */
-    protected abstract String getDefinitionInfo();
-
-    /**
-     * Returns the elements local to this element declaration.
-     * 
-     * @return the elements local to this element declaration.
-     */
-    public CMNamedNodeMap getLocalElements()
-    {
-      if (namedNodeMap == null)
-      {
-        LocalElementVisitor localElementVisitor = new LocalElementVisitor();
-        localElementVisitor.visitTypeDefinition(getXSDType());
-        namedNodeMap = localElementVisitor.getCMNamedNodeMap();
-      }
-      return namedNodeMap;
-    }
-
-    /**
-     * Returns the property value for the property name. Returns null if the
-     * property is not supported.
-     * 
-     * @param propertyName -
-     *          name of a property
-     * @return the property value for the property name.
-     */
-    public Object getProperty(String propertyName)
-    {
-      Object result = null;
-      if (propertyName.equals(PROPERTY_DEFINITION_INFO))
-      {
-        result = getDefinitionInfo();
-      }
-      else if (propertyName.equals(PROPERTY_DEFINITION))
-      {
-        result = getDefinition();
-      }
-      else if (propertyName.equals(PROPERTY_XSITYPES))
-      {
-        result = getXSITypes();
-      }
-      else if (propertyName.startsWith(PROPERTY_DERIVED_ELEMENT_DECLARATION))
-      {
-        int index = propertyName.indexOf("=");
-        if (index != -1)
-        {
-          String uriQualifiedTypeName = propertyName.substring(index + 1);
-          result = getDerivedElementDeclaration(uriQualifiedTypeName);
-        }
-      }
-      else if (propertyName.equals(PROPERTY_SUBSTITUTION_GROUP))
-      {
-        return getSubstitutionGroup();
-      }
-      else if (propertyName.equals(PROPERTY_ABSTRACT))
-      {
-        return getAbstract();
-      }
-      else
-      {
-        result = super.getProperty(propertyName);
-      }
-      return result;
-    }
-
-    /**
-     * Returns the value of the 'Nillable' attribute. This represents the
-     * nillable infoset property. The default value is false.
-     * 
-     * @return the value of the 'Nillable' attribute.
-     */
-    public boolean isNillable()
-    {
-      if (getXSDElementDeclaration().isSetNillable())
-        return getXSDElementDeclaration().isNillable();
-      else
-        return false;
-    }
-
-    /**
-     * Returns whether the element is 'Abstract'.
-     * 
-     * @return true if the element is 'Abstract'.
-     */
-    public Boolean getAbstract()
-    {
-      boolean result = getResolvedXSDElementDeclaration().isAbstract();
-      // TODO... how do we handle elements with abstract type's ?
-      return result ? Boolean.TRUE : Boolean.FALSE;
-    }
-
-    /**
-     * Returns a list of documentation elements.
-     * 
-     * @return a list of documentation elements.
-     */
-    protected CMNodeList getDocumentation()
-    {
-      XSDAnnotation annotation = getXSDElementDeclaration().getAnnotation();
-      return getDocumentations(annotation);
-    }
-
-    /**
-     * Returns the corresponding XML Schema type definition.
-     * 
-     * @return the corresponding XML Schema type definition.
-     */
-    protected abstract XSDTypeDefinition getXSDType();
-
-    /**
-     * Returns a list of type names.
-     * 
-     * @return a list of type names.
-     */
-    protected abstract List getXSITypes();
-
-    /**
-     * Return the element declaration corresponding to the given uri qualified
-     * type name.
-     * 
-     * @param uriQualifiedTypeName -
-     *          a uri qualified type name
-     * @return corresponding element declaration.
-     */
-    protected abstract CMElementDeclaration getDerivedElementDeclaration(String uriQualifiedTypeName);
-
-    /**
-     * Returns a list of documentation elements.
-     * 
-     * @return a list of documentation elements.
-     */
-    protected void addXSITypeAttribute(CMNamedNodeMapImpl map)
-    {
-      List list = getXSITypes();
-      int listSize = list.size();
-      if (listSize > 1)
-      {
-        CMDataType dataType = new CMDataTypeImpl("typeNames", (String) null);
-        CMAttributeDeclarationImpl attribute = new CMAttributeDeclarationImpl("type", CMAttributeDeclaration.OPTIONAL, dataType);
-        attribute.setCMDocument(xsiDocument);
-        attribute.setPrefixQualification(true);
-        attribute.setXSITypes(list);
-        map.getHashtable().put(attribute.getNodeName(), attribute);
-      }
-    }
-
-    /**
-     * Returns the cmdocument that is the owner of this cmnode.
-     * 
-     * @return the cmdocument corresponding to this cmnode.
-     */
-    public CMDocument getCMDocument()
-    {      
-      XSDSchema schema = getResolvedXSDElementDeclaration().getSchema();
-      if (schema == null)
-        return null;
-      else  
-        return (CMDocument) getAdapter(schema);
-    }
-
-    /**
-     * Returns the substitution group for this element. The group consists of:
-     * 1. the element declaration itself 2. and any element declaration that has
-     * a {substitution group affiliation} in the group
-     * 
-     * @return the substitution group for this element.
-     */
-    protected abstract CMNodeListImpl getSubstitutionGroup();
-    /*
-     * XSDElementDeclarationAdapter.DataTypeImpl An inner class to hold type
-     * information for this element.
-     */
-    public class DataTypeImpl implements CMDataType
-    {
-      /**
-       * Returns the type of the node. The types are defined in CMNode class
-       * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
-       * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
-       * DOCUMENTATION).
-       * 
-       * @return the type of this node.
-       */
-      public int getNodeType()
-      {
-        return CMNode.DATA_TYPE;
-      }
-
-      /**
-       * Returns the name of the element type. Same as getDataTypeName().
-       * 
-       * @return the name of the element type.
-       */
-      public String getNodeName()
-      {
-        return getDataTypeName();
-      }
-
-      /**
-       * Returns false. This class does not support any properties.
-       * 
-       * @param propertyName -
-       *          name of a property
-       * @return false.
-       */
-      public boolean supports(String propertyName)
-      {
-        return false;
-      }
-
-      /**
-       * Returns null. This class does not support any properties.
-       * 
-       * @param propertyName -
-       *          name of a property
-       * @return null.
-       */
-      public Object getProperty(String propertyName)
-      {
-        return null;
-      }
-
-      /**
-       * Returns the name of the element type. Same as getNodeName().
-       * 
-       * @return the name of the element type.
-       */
-      public String getDataTypeName()
-      {
-        String typeName = null;
-        XSDSimpleTypeDefinition std = getXSDType().getSimpleType();
-        if (std != null)
-          typeName = std.getName();
-        return typeName != null ? typeName : "string";
-      }
-
-      /**
-       * Returns the kind of constraint: none, default or fixed. The kinds are
-       * defined in CMDataType class (IMPLIED_VALUE_NONE, IMPLIED_VALUE_FIXED or
-       * IMPLIED_VALUE_DEFAULT).
-       * 
-       * @return the kind of constraint: none, default or fixed.
-       */
-      public int getImpliedValueKind()
-      {
-        int result = IMPLIED_VALUE_NONE;
-        if (getXSDElementDeclaration().isSetConstraint())
-        {
-          if (getXSDElementDeclaration().getConstraint().getValue() == XSDConstraint.DEFAULT)
-            result = IMPLIED_VALUE_DEFAULT;
-          else if (getXSDElementDeclaration().getConstraint().getValue() == XSDConstraint.FIXED)
-            result = IMPLIED_VALUE_FIXED;
-        }
-        return result;
-      }
-
-      /**
-       * Returns the value of the default or fixed constraint.
-       * 
-       * @return the value of the default or fixed constraint.
-       */
-      public String getImpliedValue()
-      {
-        String result = null;
-        if (getXSDElementDeclaration().isSetConstraint())
-        {
-          result = getXSDElementDeclaration().getLexicalValue();
-        }
-        return result;
-      }
-
-      /**
-       * Returns the enumerated values for the attribute type.
-       * 
-       * @return the enumerated values for the attribute type.
-       */
-      public String[] getEnumeratedValues()
-      {
-        return getEnumeratedValuesForType(getXSDType());
-      }
-
-      public String generateInstanceValue()
-      {
-        return XSDTypeUtil.getInstanceValue(getXSDType());
-      }
-
-      /**
-       * Returns the cmdocument that is the owner of this cmnode.
-       * 
-       * @return the cmdocument corresponding to this cmnode.
-       */
-      public CMDocument getCMDocument()
-      {
-        return (CMDocument) getAdapter(getXSDElementDeclaration().getSchema());
-      }
-    }
-  }
-  /**
-   * XSDElementDeclarationAdapter implements CMElementDeclaration. A
-   * representation of the model object 'Element Declaration'.
-   */
-  public static class XSDElementDeclarationAdapter extends ElementDeclarationBaseImpl
-  {
-    protected List derivedElementDeclarations = null;
-    protected List xsiTypes = null;
-    protected XSDElementDeclaration xsdElementDeclaration;
-    protected CMNodeListImpl substitutionGroup;
-
-    /**
-     * Constructor.
-     * 
-     * @param xsdElementDeclaration -
-     *          the XML Schema node.
-     */
-    public XSDElementDeclarationAdapter(XSDElementDeclaration xsdElementDeclaration)
-    {
-      this.xsdElementDeclaration = xsdElementDeclaration;
-    }
-
-    /**
-     * Returns corresponding XML Schema element declaration.
-     * 
-     * @return corresponding XML Schema element declaration.
-     */
-    protected XSDElementDeclaration getXSDElementDeclaration()
-    {
-      return xsdElementDeclaration;
-    }
-
-    /**
-     * Returns corresponding XML Schema element declaration.
-     * 
-     * @return corresponding XML Schema element declaration.
-     */
-    protected XSDElementDeclaration getResolvedXSDElementDeclaration()
-    {
-      return xsdElementDeclaration.getResolvedElementDeclaration();
-    }
-
-    /**
-     * Returns the key for this cmnode which is the corresponding XML Schema
-     * node.
-     * 
-     * @return the key for this cmnode.
-     */
-    public Object getKey()
-    {
-      return xsdElementDeclaration;
-    }
-
-    /**
-     * Returns the referenced element declaration if this is an element
-     * reference. Otherwise it returns itself.
-     * 
-     * @return an element declaration.
-     */
-    public CMNode getDefinition()
-    {
-      return getAdapter(xsdElementDeclaration.getResolvedElementDeclaration());
-    }
-
-    /**
-     * Returns a string indicating whether the element declaration is global or
-     * local. Returns null if this is an element reference.
-     * 
-     * @return a string indicating whether the element declaration is global or
-     *         local.
-     */
-    protected String getDefinitionInfo()
-    {
-      if (xsdElementDeclaration.isElementDeclarationReference())
-        return null;
-      else if (xsdElementDeclaration.isGlobal())
-        return DEFINITION_INFO_GLOBAL;
-      else
-        return DEFINITION_INFO_LOCAL;
-    }
-
-    public Object getNSPrefixQualification()
-    {
-      String form = null;
-      if (xsdElementDeclaration.isElementDeclarationReference())
-      {
-        form = "qualified";
-      }
-      else
-      {
-        if (xsdElementDeclaration.isSetForm())
-        {
-          form = xsdElementDeclaration.getForm().getName();
-        }
-        else
-        {
-          XSDSchema schema = xsdElementDeclaration.getSchema();
-          if (schema != null)
-            form = schema.getElementFormDefault().getName();
-        }
-      }
-      return form;
-    }
-
-    /**
-     * Returns the corresponding XML Schema type definition.
-     * 
-     * @return the corresponding XML Schema type definition.
-     */
-    protected XSDTypeDefinition getXSDType()
-    {
-      return xsdElementDeclaration.getResolvedElementDeclaration().getTypeDefinition();
-    }
-
-    /**
-     * Returns a list of type names.
-     * 
-     * @return a list of type names.
-     */
-    protected List getXSITypes()
-    {
-      if (xsiTypes == null)
-      {
-        computeDerivedTypeInfo();
-      }
-      return xsiTypes;
-    }
-
-    protected void computeDerivedTypeInfo()
-    {
-      xsiTypes = new Vector();
-      derivedElementDeclarations = new Vector();
-      computeDerivedTypeInfoHelper(getXSDType(), xsiTypes, derivedElementDeclarations);
-    }
-
-    protected void computeDerivedTypeInfoHelper(XSDTypeDefinition type, List typeNameList, List edList)
-    {
-      if (type instanceof XSDComplexTypeDefinition)
-      {
-        List derivedTypes = findTypesDerivedFrom(type);
-        ArrayList inclusiveDerivedTypes = new ArrayList();
-        inclusiveDerivedTypes.add(type);
-        if ((derivedTypes != null) && (derivedTypes.size() > 0))
-        {
-          inclusiveDerivedTypes.addAll(derivedTypes);
-        }
-        for (Iterator i = inclusiveDerivedTypes.iterator(); i.hasNext();)
-        {
-          XSDTypeDefinition derivedType = (XSDTypeDefinition) i.next();
-          XSDSchema schema = derivedType.getSchema();
-          if (schema != null)
-          {
-            String uri = schema.getTargetNamespace();
-            String name = derivedType.getName();
-            if (name != null)
-            {
-              name = uri != null ? ("[" + uri + "]" + name) : name;
-              typeNameList.add(name);
-              DerivedElementDeclarationImpl ed = new DerivedElementDeclarationImpl(this, derivedType, name);
-              edList.add(ed);
-            }
-          }
-        }
-      }
-    }
-
-    /**
-     * Return the element declaration corresponding to the given uri qualified
-     * type name.
-     * 
-     * @param uriQualifiedTypeName -
-     *          a uri qualified type name
-     * @return corresponding element declaration.
-     */
-    protected CMElementDeclaration getDerivedElementDeclaration(String uriQualifiedTypeName)
-    {
-      CMElementDeclaration result = null;
-      if (derivedElementDeclarations == null)
-      {
-        computeDerivedTypeInfo();
-      }
-      for (Iterator i = derivedElementDeclarations.iterator(); i.hasNext();)
-      {
-        DerivedElementDeclarationImpl ed = (DerivedElementDeclarationImpl) i.next();
-        if ((ed != null) && (ed.uriQualifiedTypeName != null))
-        {
-          if (ed.uriQualifiedTypeName.equals(uriQualifiedTypeName))
-          {
-            result = ed;
-            break;
-          }
-        }
-      }
-      return result;
-    }
-
-    /**
-     * Returns the substitution group for this element. The group consists of:
-     * 1. the element declaration itself 2. and any element declaration that has
-     * a {substitution group affiliation} in the group
-     * 
-     * @return the substitution group for this element.
-     */
-    protected CMNodeListImpl getSubstitutionGroup()
-    {
-      if (substitutionGroup == null)
-      {
-        substitutionGroup = new CMNodeListImpl();
-        List sgroup = getResolvedXSDElementDeclaration().getSubstitutionGroup();
-        for (Iterator i = sgroup.iterator(); i.hasNext();)
-        {
-          XSDElementDeclaration ed = (XSDElementDeclaration) i.next();  
-          substitutionGroup.add(getAdapter(ed));
-        }
-      }
-      return substitutionGroup;
-    }
-  }
-  /**
-   * DerivedElementDeclarationImpl extends ElementDeclarationBaseImpl
-   *  
-   */
-  public static class DerivedElementDeclarationImpl extends ElementDeclarationBaseImpl
-  {
-    protected XSDElementDeclarationAdapter owner;
-    protected XSDTypeDefinition xsdType;
-    public String uriQualifiedTypeName;
-
-    /**
-     * Constructor.
-     * 
-     * @param owner -
-     * @param xsdType -
-     * @param uriQualifiedTypeName -
-     */
-    public DerivedElementDeclarationImpl(XSDElementDeclarationAdapter owner, XSDTypeDefinition xsdType, String uriQualifiedTypeName)
-    {
-      this.owner = owner;
-      this.xsdType = xsdType;
-      this.uriQualifiedTypeName = uriQualifiedTypeName;
-    }
-
-    /**
-     * Returns corresponding XML Schema element declaration.
-     * 
-     * @return corresponding XML Schema element declaration.
-     */
-    protected XSDElementDeclaration getXSDElementDeclaration()
-    {
-      return (XSDElementDeclaration) owner.getKey();
-    }
-
-    /**
-     * Returns corresponding XML Schema element declaration.
-     * 
-     * @return corresponding XML Schema element declaration.
-     */
-    protected XSDElementDeclaration getResolvedXSDElementDeclaration()
-    {
-      return ((XSDElementDeclaration) owner.getKey()).getResolvedElementDeclaration();
-    }
-
-    /**
-     * Returns the key for this cmnode which is the corresponding XML Schema
-     * node.
-     * 
-     * @return the key for this cmnode.
-     */
-    public Object getKey()
-    {
-      return owner.getKey();
-    }
-
-    /**
-     * Returns the corresponding XML Schema type definition.
-     * 
-     * @return the corresponding XML Schema type definition.
-     */
-    protected XSDTypeDefinition getXSDType()
-    {
-      return xsdType;
-    }
-
-    /**
-     * Returns a list of type names.
-     * 
-     * @return a list of type names.
-     */
-    protected List getXSITypes()
-    {
-      return owner.getXSITypes();
-    }
-
-    /**
-     * Return the element declaration corresponding to the given uri qualified
-     * type name.
-     * 
-     * @param uriQualifiedTypeName -
-     *          a uri qualified type name
-     * @return corresponding element declaration.
-     */
-    protected CMElementDeclaration getDerivedElementDeclaration(String uriQualifiedTypeName)
-    {
-      return owner.getDerivedElementDeclaration(uriQualifiedTypeName);
-    }
-
-    /**
-     * Returns the referenced element declaration if this is an element
-     * reference. Otherwise it returns itself.
-     * 
-     * @return an element declaration.
-     */
-    protected CMNode getDefinition()
-    {
-      return this;
-    }
-
-    /**
-     * Returns a string indicating whether the element declaration is global or
-     * local. Returns null if this is an element reference.
-     * 
-     * @return a string indicating whether the element declaration is global or
-     *         local.
-     */
-    protected String getDefinitionInfo()
-    {
-      return owner.getDefinitionInfo();
-    }
-
-    /*
-     * Returns the value of the form [attribute] which affects the target
-     * namespace of locally scoped features. @return the value of the form
-     * [attribute].
-     */
-    public Object getNSPrefixQualification()
-    {
-      return owner.getNSPrefixQualification();
-    }
-
-    /**
-     * Returns the substitution group for this element. The group consists of:
-     * 1. the element declaration itself 2. and any element declaration that has
-     * a {substitution group affiliation} in the group
-     * 
-     * @return the substitution group for this element.
-     */
-    protected CMNodeListImpl getSubstitutionGroup()
-    {
-      return owner.getSubstitutionGroup();
-    }
-  }
-  /**
-   * XSDWildcardAdapter
-   */
-  public static class XSDWildcardAdapter extends XSDBaseAdapter implements CMAnyElement
-  {
-    protected XSDWildcard xsdWildcard;
-
-    public XSDWildcardAdapter(XSDWildcard xsdWildcard)
-    {
-      this.xsdWildcard = xsdWildcard;
-    }
-
-    /**
-     * Returns the key for this cmnode which is the corresponding XML Schema
-     * node.
-     * 
-     * @return the key for this cmnode.
-     */
-    public Object getKey()
-    {
-      return xsdWildcard;
-    }
-
-    /**
-     * Returns the type of the node. The types are defined in CMNode class
-     * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
-     * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
-     * DOCUMENTATION).
-     * 
-     * @return the type of this node.
-     */
-    public int getNodeType()
-    {
-      return ANY_ELEMENT;
-    }
-
-    /**
-     * Returns the name of the node. The default value is an empty string value.
-     * All derived classes must override this method if they do not want the
-     * default value.
-     * 
-     * @return the name of the node.
-     */
-    public String getNodeName()
-    {
-      return "any";
-    }
-
-    public String getNamespaceURI()
-    {
-      String uri = xsdWildcard.getElement().getAttribute("namespace");
-      return (uri != null || uri.length() == 0) ? uri : "##any";
-    }
-
-    /**
-     * Returns the value of 'Min Occurs' attribute. The default value is "1".
-     * 
-     * @return the value of the 'Min Occurs' attribute.
-     */
-    public int getMinOccur()
-    {
-      return getMinOccurs(xsdWildcard);
-    }
-
-    /**
-     * Returns the value of the 'Max Occurs' attribute. The default value is
-     * "1".
-     * 
-     * @return the value of the 'Max Occurs' attribute.
-     */
-    public int getMaxOccur()
-    {
-      return getMaxOccurs(xsdWildcard);
-    }
-
-    /**
-     * Returns the cmdocument that is the owner of this cmnode.
-     * 
-     * @return the cmdocument corresponding to this cmnode.
-     */
-    public CMDocument getCMDocument()
-    {
-      return (CMDocument) getAdapter(xsdWildcard.getSchema());
-    }
-
-    /**
-     * Returns a list of documentation elements.
-     * 
-     * @return a list of documentation elements.
-     */
-    protected CMNodeList getDocumentation()
-    {
-      XSDAnnotation annotation = xsdWildcard.getAnnotation();
-      return getDocumentations(annotation);
-    }
-  }
-  /**
-   * XSDModelGroupAdapter
-   */
-  public static class XSDModelGroupAdapter extends XSDBaseAdapter implements CMGroup
-  {
-    protected XSDModelGroup xsdModelGroup;
-
-    public XSDModelGroupAdapter()
-    {
-    }
-
-    public XSDModelGroupAdapter(XSDModelGroup xsdModelGroup)
-    {
-      this.xsdModelGroup = xsdModelGroup;
-    }
-
-    /**
-     * Returns the type of the node. The types are defined in CMNode class
-     * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
-     * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
-     * DOCUMENTATION).
-     * 
-     * @return the type of this node.
-     */
-    public int getNodeType()
-    {
-      return GROUP;
-    }
-
-    /**
-     * Returns the key for this cmnode which is the corresponding XML Schema
-     * node.
-     * 
-     * @return the key for this cmnode.
-     */
-    public Object getKey()
-    {
-      return xsdModelGroup;
-    }
-
-    /**
-     * Returns a list of the children of this group.
-     * 
-     * @return a list of the children of this group.
-     */
-    public CMNodeList getChildNodes()
-    {
-      CMNodeListImpl nodeList = new CMNodeListImpl();
-      if (xsdModelGroup != null)
-      {
-        for (Iterator i = xsdModelGroup.getParticles().iterator(); i.hasNext();)
-        {
-          XSDParticle particle = (XSDParticle) i.next();
-          XSDParticleContent content = particle.getContent();
-          CMNode adapter = getAdapter(content);
-          if (adapter != null)
-          {
-            nodeList.getList().add(adapter);
-          }
-        }
-      }
-      return nodeList;
-    }
-
-    /**
-     * Returns the name of the node. The default value is an empty string value.
-     * All derived classes must override this method if they do not want the
-     * default value.
-     * 
-     * @return the name of the node.
-     */
-    public String getNodeName()
-    {
-      CMDescriptionBuilder descriptionBuilder = new CMDescriptionBuilder();
-      return descriptionBuilder.buildDescription(this);
-    }
-
-    /**
-     * Returns the value of 'Min Occurs' attribute. The default value is "1".
-     * 
-     * @return the value of the 'Min Occurs' attribute.
-     */
-    public int getMinOccur()
-    {
-      return getMinOccurs(xsdModelGroup);
-    }
-
-    /**
-     * Returns the value of the 'Max Occurs' attribute. The default value is
-     * "1".
-     * 
-     * @return the value of the 'Max Occurs' attribute.
-     */
-    public int getMaxOccur()
-    {
-      return getMaxOccurs(xsdModelGroup);
-    }
-
-    /**
-     * Return operator of this group -- CHOICE, SEQUENCE or ALL value.
-     * 
-     * @return the operator of this group.
-     */
-    public int getOperator()
-    {
-      int result = 0;
-      //todo... handle ALONE case by checkig if child count == 1
-      if (xsdModelGroup != null)
-      {
-        switch (xsdModelGroup.getCompositor().getValue())
-        {
-          case XSDCompositor.CHOICE : {
-            result = CHOICE;
-            break;
-          }
-          case XSDCompositor.SEQUENCE : {
-            result = SEQUENCE;
-            break;
-          }
-          case XSDCompositor.ALL : {
-            result = ALL;
-            break;
-          }
-        }
-      }
-      return result;
-    }
-
-    /**
-     * Returns a list of documentation elements.
-     * 
-     * @return a list of documentation elements.
-     */
-    protected CMNodeList getDocumentation()
-    {
-      XSDAnnotation annotation = xsdModelGroup.getAnnotation();
-      return getDocumentations(annotation);
-    }
-
-    /**
-     * Returns the cmdocument that is the owner of this cmnode.
-     * 
-     * @return the cmdocument corresponding to this cmnode.
-     */
-    public CMDocument getCMDocument()
-    {
-      return (CMDocument) getAdapter(xsdModelGroup.getSchema());
-    }
-  }
-  /**
-   * XSDModelGroupDefinitionAdapter
-   */
-  public static class XSDModelGroupDefinitionAdapter extends XSDBaseAdapter implements CMGroup
-  {
-    protected XSDModelGroupDefinition xsdModelGroupDefinition;
-
-    public XSDModelGroupDefinitionAdapter(XSDModelGroupDefinition xsdModelGroupDefinition)
-    {
-      this.xsdModelGroupDefinition = xsdModelGroupDefinition;
-    }
-
-    /**
-     * Returns the type of the node. The types are defined in CMNode class
-     * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
-     * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
-     * DOCUMENTATION).
-     * 
-     * @return the type of this node.
-     */
-    public int getNodeType()
-    {
-      return GROUP;
-    }
-
-    /**
-     * Returns the key for this cmnode which is the corresponding XML Schema
-     * node.
-     * 
-     * @return the key for this cmnode.
-     */
-    public Object getKey()
-    {
-      return xsdModelGroupDefinition;
-    }
-
-    /**
-     * Returns a list of the children of this group.
-     * 
-     * @return a list of the children of this group.
-     */
-    public CMNodeList getChildNodes()
-    {
-      CMNodeListImpl nodeList = new CMNodeListImpl();
-      XSDModelGroup modelGroup = xsdModelGroupDefinition.getResolvedModelGroupDefinition().getModelGroup();
-      if (modelGroup != null)
-      {
-        CMNode adapter = getAdapter(modelGroup);
-        nodeList.add(adapter);
-      }
-      return nodeList;
-    }
-
-    /**
-     * Returns the name of the node. The default value is an empty string value.
-     * All derived classes must override this method if they do not want the
-     * default value.
-     * 
-     * @return the name of the node.
-     */
-    public String getNodeName()
-    {
-      CMDescriptionBuilder descriptionBuilder = new CMDescriptionBuilder();
-      return descriptionBuilder.buildDescription(this);
-    }
-
-    /**
-     * Returns the value of 'Min Occurs' attribute. The default value is "1".
-     * 
-     * @return the value of the 'Min Occurs' attribute.
-     */
-    public int getMinOccur()
-    {
-      return getMinOccurs(xsdModelGroupDefinition);
-    }
-
-    /**
-     * Returns the value of the 'Max Occurs' attribute. The default value is
-     * "1".
-     * 
-     * @return the value of the 'Max Occurs' attribute.
-     */
-    public int getMaxOccur()
-    {
-      return getMaxOccurs(xsdModelGroupDefinition);
-    }
-
-    /**
-     * Return operator of this group -- CHOICE, SEQUENCE or ALL value.
-     * 
-     * @return the operator of this group.
-     */
-    public int getOperator()
-    {
-      return XSDCompositor.SEQUENCE;
-    }
-
-    /**
-     * Returns a list of documentation elements.
-     * 
-     * @return a list of documentation elements.
-     */
-    protected CMNodeList getDocumentation()
-    {
-      XSDAnnotation annotation = xsdModelGroupDefinition.getAnnotation();
-      return getDocumentations(annotation);
-    }
-
-    /**
-     * Returns the cmdocument that is the owner of this cmnode.
-     * 
-     * @return the cmdocument corresponding to this cmnode.
-     */
-    public CMDocument getCMDocument()
-    {
-      return (CMDocument) getAdapter(xsdModelGroupDefinition.getSchema());
-    }
-  }
-  /**
-   * DocumentationImpl implements CMDocumentation. A representation of the
-   * documentation element part of the 'User Information' feature. Working with
-   * the documentation element requires dropping down into the DOM model.
-   */
-  public static class DocumentationImpl implements CMDocumentation
-  {
-    protected Element documentation;
-
-    /**
-     * Constructor.
-     * 
-     * @param documentation -
-     *          a documentation element.
-     */
-    public DocumentationImpl(Element documentation)
-    {
-      this.documentation = documentation;
-    }
-
-    /**
-     * Returns the type of the node. The types are defined in CMNode class
-     * (ANY_ELEMENT, ATTRIBUTE_DECLARATION, DATA_TYPE, DOCUMENT,
-     * ELEMENT_DECLARATION, ENTITY_DECLARATION, GROUP, NAME_SPACE or
-     * DOCUMENTATION).
-     * 
-     * @return the type of this node.
-     */
-    public int getNodeType()
-    {
-      return DOCUMENTATION;
-    }
-
-    /**
-     * Returns an empty string value.
-     * 
-     * @return an empty string value.
-     */
-    public String getNodeName()
-    {
-      return "";
-    }
-
-    /**
-     * Returns false. This class does not support any properties.
-     * 
-     * @param propertyName -
-     *          name of a property
-     * @return false.
-     */
-    public boolean supports(String propertyName)
-    {
-      return false;
-    }
-
-    /**
-     * Returns null. This class does not support any properties.
-     * 
-     * @param propertyName -
-     *          name of a property
-     * @return null.
-     */
-    public Object getProperty(String propertyName)
-    {
-      return null;
-    }
-
-    /**
-     * Returns the content of the documentation element.
-     * 
-     * @return the content of the documentation element.
-     */
-    public String getValue()
-    {
-      String content = "";
-      boolean contentFound = false;
-      NodeList nodes = documentation.getChildNodes();
-      for (int i = 0; i < nodes.getLength(); i++)
-      {
-        Node node = nodes.item(i);
-        if (node instanceof Text)
-        {
-          contentFound = true;
-          content += node.getNodeValue();
-        }
-      }
-      return contentFound ? content : null;
-    }
-
-    /**
-     * Returns the xml:lang attribute value of the documentation element.
-     * 
-     * @return the xml:lang attribute value of the documentation element.
-     */
-    public String getLanguage()
-    {
-      return documentation.hasAttributeNS(XSDConstants.XML_NAMESPACE_URI_1998, XML_LANG_ATTRIBUTE) ? documentation.getAttributeNS(XSDConstants.XML_NAMESPACE_URI_1998, XML_LANG_ATTRIBUTE) : null;
-    }
-
-    /**
-     * Returns the source attribute value of the documentation element.
-     * 
-     * @return the source attribute value of the documentation element.
-     */
-    public String getSource()
-    {
-      return documentation.hasAttributeNS(null, XSDConstants.SOURCE_ATTRIBUTE) ? documentation.getAttributeNS(null, XSDConstants.SOURCE_ATTRIBUTE) : null;
-    }
-  }
-  /**
-   * XSIDocument extends CMDocumentImpl. This class is used to hold those
-   * attributes that are for direct use in any XML documents. These attributes
-   * are in a different namespace, which has the namespace name
-   * http://www.w3.org/2001/XMLSchema-instance. Attributes in this namespace
-   * include: xsi:type xsi:nil xsi:schemaLocation xsi:noNamespaceSchemaLocation
-   */
-  public static class XSIDocument extends CMDocumentImpl
-  {
-    public CMAttributeDeclarationImpl nilAttribute;
-
-    /**
-     * Constructor. Creates the 'xsi:nil'
-     */
-    public XSIDocument()
-    {
-      super(XSDConstants.SCHEMA_INSTANCE_URI_2001);
-      // create the 'nill' attribute
-      String[] values = {"false", "true"};
-      nilAttribute = new CMAttributeDeclarationImpl("nil", CMAttributeDeclaration.REQUIRED, new CMDataTypeImpl("boolean", values));
-      nilAttribute.setPrefixQualification(true);
-      nilAttribute.setCMDocument(this);
-    }
-  }
-  /**
-   * Note this XSD model visitor differs from the XSD model visitor in
-   * org.eclipse.wst.xsd.editor plugin. In visitModelGroup method we call
-   * getParticles() instead of getContents(). This gathers all of the content of
-   * a derived type.
-   */
-  public static class XSDCMVisitor extends XSDVisitor
-  {
-    public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
-    {
-      XSDParticle ctd = type.getComplexType();
-      if (ctd != null)
-        visitParticle(ctd);
-    }
-
-    public void visitModelGroup(XSDModelGroup modelGroup)
-    {
-      if (modelGroup.getParticles() != null)
-      {
-        for (Iterator iterator = modelGroup.getParticles().iterator(); iterator.hasNext();)
-        {
-          XSDParticle particle = (XSDParticle) iterator.next();
-          visitParticle(particle);
-        }
-      }
-    }
-
-    public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
-    {
-      XSDModelGroup modelGroup = modelGroupDef.getResolvedModelGroupDefinition().getModelGroup();
-      if (modelGroup != null)
-      {
-        visitModelGroup(modelGroup);
-      }
-    }
-  }
-  /**
-   * A visitor class that walks the xsd model and computes the list of children
-   * that belong to the initially visited element type.
-   */
-  public static class DerivedChildVisitor extends XSDCMVisitor
-  {
-    protected CMNodeListImpl childNodeList = new CMNodeListImpl();
-    protected List baseTypeList = new Vector();
-    Object root;
-
-    DerivedChildVisitor(Object root)
-    {
-      this.root = root;
-    }
-
-    public CMNodeListImpl getChildNodeList()
-    {
-      return childNodeList;
-    }
-
-    public void visitWildcard(XSDWildcard wildcard)
-    {
-      childNodeList.getList().add(getAdapter(wildcard));
-    }
-
-    public void visitElementDeclaration(XSDElementDeclaration element)
-    {
-      childNodeList.getList().add(getAdapter(element));
-    }
-
-    public void visitModelGroup(XSDModelGroup modelGroup)
-    {
-      childNodeList.getList().add(getAdapter(modelGroup));
-    }
-
-    public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDefinition)
-    {
-      childNodeList.getList().add(getAdapter(modelGroupDefinition));
-    }
-  }
-  /**
-   * A visitor class that gathers all of the elements within a type definition.
-   */
-  public static class LocalElementVisitor extends XSDCMVisitor
-  {
-    protected CMNamedNodeMapImpl namedNodeMap = new CMNamedNodeMapImpl();
-    protected List baseTypeList = new Vector();
-
-    public void visitElementDeclaration(XSDElementDeclaration element)
-    {
-      XSDElementDeclarationAdapter adapter = (XSDElementDeclarationAdapter) getAdapter(element);
-      namedNodeMap.getHashtable().put(adapter.getNodeName(), adapter);
-    }
-
-    public CMNamedNodeMap getCMNamedNodeMap()
-    {
-      return namedNodeMap;
-    }
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDTypeUtil.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDTypeUtil.java
deleted file mode 100644
index 3946868..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDTypeUtil.java
+++ /dev/null
@@ -1,121 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.contentmodel.internal;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-/**
- * Helper class to generate valid values for built-in simple types.
- */
-
-public class XSDTypeUtil
-{
-  protected static Map defaultValue = new HashMap();
-
-  public static void initialize()
-  {
-    defaultValue.put("anySimpleType", null);
-    defaultValue.put("anyType", null);
-    defaultValue.put("anyURI", "http://tempuri.org");
-    defaultValue.put("base64Binary", "0");
-    defaultValue.put("boolean", "true");
-    defaultValue.put("byte", "0");
-    defaultValue.put("date", "2001-01-01");
-    defaultValue.put("dateTime", "2001-12-31T12:00:00");
-    defaultValue.put("decimal", "0.0");
-    defaultValue.put("double", "0.0");
-    defaultValue.put("duration", "P1D");
-    defaultValue.put("ENTITY", "entity");
-    defaultValue.put("ENTITIES", "entities");
-    defaultValue.put("float", "0.0");
-    defaultValue.put("gDay", "---01");
-    defaultValue.put("gMonth", "--01--");
-    defaultValue.put("gMonthDay", "--01-01");
-    defaultValue.put("gYear", "2001");
-    defaultValue.put("gYearMonth", "2001-01");
-    defaultValue.put("hexBinary", "0F00");
-    defaultValue.put("ID", null);
-    defaultValue.put("IDREF", null);
-    defaultValue.put("IDREFS", null);
-    defaultValue.put("int", "0");
-    defaultValue.put("integer", "0");
-    defaultValue.put("language", "EN");
-    defaultValue.put("long", "0");
-    defaultValue.put("Name", "Name");
-    defaultValue.put("NCName", "NCName");
-    defaultValue.put("negativeInteger", "-1");
-    defaultValue.put("NMTOKEN", "NMTOKEN");
-    defaultValue.put("NMTOKENS", "NMTOKENS");
-    defaultValue.put("nonNegativeInteger", "0");
-    defaultValue.put("nonPositiveInteger", "0");
-    defaultValue.put("normalizedString", null);
-    defaultValue.put("NOTATION", "NOTATION");
-    defaultValue.put("positiveInteger", "1");
-    defaultValue.put("QName", "QName");
-    defaultValue.put("short", "0");
-    defaultValue.put("string", null);
-    defaultValue.put("time", "12:00:00");
-    defaultValue.put("token", "token");
-    defaultValue.put("unsignedByte", "0");
-    defaultValue.put("unsignedInt", "0");
-    defaultValue.put("unsignedLong", "0");
-    defaultValue.put("unsignedShort", "0");
-  }
-
-
-  /*
-   * Returns true if the type is built-in.
-   * @param type - an XSDTypeDefinition object.
-   * @return true if the type is built-in.
-   */
-  public static boolean isBuiltIn(XSDTypeDefinition type)
-  { 
-    boolean result = false;
-    if (type instanceof XSDSimpleTypeDefinition)
-    {
-      String name = type.getName();
-      if (name != null)
-      {
-        return  defaultValue.containsKey(name); 
-      }
-    }
-    return result;
-  }
-
-
-  /**
-   * Returns a valid default value for the simple type.
-   * @param type - a simple built-in type.
-   * @return a valid default value for the simple type.
-   */
-  public static String getInstanceValue(XSDTypeDefinition type)
-  {
-    if (type != null)
-    {
-      if (isBuiltIn(type))
-      {
-        String nameID = type.getName();
-        return (String)defaultValue.get(nameID);
-      }
-      else
-      {
-        XSDTypeDefinition basetype = type.getBaseType();
-        if (basetype != type) return getInstanceValue(basetype);
-      }
-    }
-    return null;
-  }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDVisitor.java
deleted file mode 100644
index f40e1a4..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDVisitor.java
+++ /dev/null
@@ -1,190 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.contentmodel.internal;
-
-import java.util.Iterator;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDVisitor
-{
-  public XSDVisitor()
-  {
-  }
-  
-  protected XSDSchema schema;
-  
-  public void visitSchema(XSDSchema schema)
-  {
-    this.schema = schema;
-    for (Iterator iterator = schema.getAttributeDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDAttributeDeclaration attr = (XSDAttributeDeclaration) iterator.next();
-      visitAttributeDeclaration(attr);
-    }
-    for (Iterator iterator = schema.getTypeDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDTypeDefinition type = (XSDTypeDefinition) iterator.next();
-      visitTypeDefinition(type);
-    }
-    for (Iterator iterator = schema.getElementDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDElementDeclaration element = (XSDElementDeclaration) iterator.next();
-      visitElementDeclaration(element);
-    }
-    for (Iterator iterator = schema.getIdentityConstraintDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDIdentityConstraintDefinition identityConstraint = (XSDIdentityConstraintDefinition) iterator.next();
-      visitIdentityConstraintDefinition(identityConstraint);
-    }
-    for (Iterator iterator = schema.getModelGroupDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) iterator.next();
-      visitModelGroupDefinition(modelGroup);
-    }
-    for (Iterator iterator = schema.getAttributeGroupDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDAttributeGroupDefinition attributeGroup = (XSDAttributeGroupDefinition) iterator.next();
-      visitAttributeGroupDefinition(attributeGroup);
-    }
-    for (Iterator iterator = schema.getNotationDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDNotationDeclaration element = (XSDNotationDeclaration) iterator.next();
-      visitNotationDeclaration(element);
-    }
-    
-  }
-  
-  public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
-  {
-  }
-  
-  public void visitTypeDefinition(XSDTypeDefinition type)
-  {
-    if (type instanceof XSDSimpleTypeDefinition)
-    {
-      visitSimpleTypeDefinition((XSDSimpleTypeDefinition)type);
-    }
-    else if (type instanceof XSDComplexTypeDefinition)
-    {
-      visitComplexTypeDefinition((XSDComplexTypeDefinition)type);
-    }
-  }
-  
-  public void visitElementDeclaration(XSDElementDeclaration element)
-  {
-    if (element.isElementDeclarationReference())
-    {
-    }
-    else if (element.getAnonymousTypeDefinition() != null)
-    {
-      visitTypeDefinition(element.getAnonymousTypeDefinition());
-    }
-  }
-  
-  public void visitIdentityConstraintDefinition(XSDIdentityConstraintDefinition identityConstraint)
-  {
-  }
-  
-  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
-  {
-    if (!modelGroupDef.isModelGroupDefinitionReference())
-    {
-      if (modelGroupDef.getModelGroup() != null)
-      {
-        visitModelGroup(modelGroupDef.getModelGroup());
-      }
-    }
-  }
-  
-  public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
-  {
-  }
-  
-  public void visitNotationDeclaration(XSDNotationDeclaration notation)
-  {
-  }
-  
-  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
-  {
-  }
-  
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    if (type.getContentType() != null)
-    {
-      XSDComplexTypeContent complexContent = type.getContentType();
-      if (complexContent instanceof XSDSimpleTypeDefinition)
-      {
-        visitSimpleTypeDefinition((XSDSimpleTypeDefinition)complexContent);
-      }
-      else if (complexContent instanceof XSDParticle)
-      {
-        visitParticle((XSDParticle) complexContent);
-      }
-    }
-  }
-  
-  public void visitParticle(XSDParticle particle)
-  {
-    visitParticleContent(particle.getContent());
-  }
-  
-  public void visitParticleContent(XSDParticleContent particleContent)
-  {
-    if (particleContent instanceof XSDModelGroupDefinition)
-    {
-      visitModelGroupDefinition((XSDModelGroupDefinition) particleContent);
-    }
-    else if (particleContent instanceof XSDModelGroup)
-    {
-      visitModelGroup((XSDModelGroup)particleContent);
-    }
-    else if (particleContent instanceof XSDElementDeclaration)
-    {
-      visitElementDeclaration((XSDElementDeclaration)particleContent);
-    }
-    else if (particleContent instanceof XSDWildcard)
-    {
-      visitWildcard((XSDWildcard)particleContent);
-    }
-  }
-  
-  public void visitModelGroup(XSDModelGroup modelGroup)
-  {
-    if (modelGroup.getContents() != null)
-    {
-      for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
-      {
-        XSDParticle particle = (XSDParticle) iterator.next();
-        visitParticle(particle);
-      }
-    }
-  }
-  
-  public void visitWildcard(XSDWildcard wildcard)
-  {
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorAdapterFactory.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorAdapterFactory.java
deleted file mode 100644
index cba5df1..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorAdapterFactory.java
+++ /dev/null
@@ -1,31 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.contentmodel.internal.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.xsd.util.XSDSchemaLocator;
-
-public class XSDSchemaLocatorAdapterFactory extends AdapterFactoryImpl
-{
-    protected XSDSchemaLocatorImpl schemaLocator = new XSDSchemaLocatorImpl();
-
-    public boolean isFactoryForType(Object type)
-    {
-      return type == XSDSchemaLocator.class;
-    }
-
-    public Adapter adaptNew(Notifier target, Object type)
-    {
-      return schemaLocator;
-    }
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorImpl.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorImpl.java
deleted file mode 100644
index a8422b7..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorImpl.java
+++ /dev/null
@@ -1,75 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.contentmodel.internal.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDResourceImpl;
-import org.eclipse.xsd.util.XSDSchemaLocator;
-
-public class XSDSchemaLocatorImpl extends AdapterImpl implements XSDSchemaLocator
-{
-    /**
-     * @see org.eclipse.xsd.util.XSDSchemaLocator#locateSchema(org.eclipse.xsd.XSDSchema,
-     *      java.lang.String, java.lang.String, java.lang.String)
-     */
-    public XSDSchema locateSchema(XSDSchema xsdSchema, String namespaceURI, String rawSchemaLocationURI, String resolvedSchemaLocationURI)
-    {
-      XSDSchema result = null;
-      String baseLocation = xsdSchema.getSchemaLocation();      
-      String resolvedURI = URIResolverPlugin.createResolver().resolve(baseLocation, namespaceURI, rawSchemaLocationURI); 
-      if (resolvedURI == null) 
-      {
-        resolvedURI = resolvedSchemaLocationURI;       
-      }
-      try
-      {        
-        ResourceSet resourceSet = xsdSchema.eResource().getResourceSet();
-        URI uri = URI.createURI(resolvedURI);
-        Resource r = resourceSet.getResource(uri, false); 
-        XSDResourceImpl resolvedResource = null;
-        if (r instanceof XSDResourceImpl)
-        {
-          resolvedResource = (XSDResourceImpl)r;
-        }
-        else        
-        {  
-          String physicalLocation = URIResolverPlugin.createResolver().resolvePhysicalLocation(baseLocation, namespaceURI, resolvedURI);     
-          InputStream inputStream = resourceSet.getURIConverter().createInputStream(URI.createURI(physicalLocation));
-          resolvedResource = (XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd"));
-          resolvedResource.setURI(uri);
-          resolvedResource.load(inputStream, null);           
-        }
-
-        result = resolvedResource.getSchema();
-      }
-      catch (IOException exception)
-      {
-        // It is generally not an error to fail to resolve.
-        // If a resource is actually created, 
-        // which happens only when we can create an input stream,
-        // then it's an error if it's not a good schema
-      }
-      return result;
-    }
-
-    public boolean isAdatperForType(Object type)
-    {
-      return type == XSDSchemaLocator.class;
-    }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidator.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidator.java
deleted file mode 100644
index f16d9c0..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidator.java
+++ /dev/null
@@ -1,222 +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.xsd.core.internal.validation;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.xerces.impl.Constants;
-import org.apache.xerces.parsers.XMLGrammarPreparser;
-import org.apache.xerces.util.XMLGrammarPoolImpl;
-import org.apache.xerces.xni.XMLResourceIdentifier;
-import org.apache.xerces.xni.XNIException;
-import org.apache.xerces.xni.grammars.XMLGrammarDescription;
-import org.apache.xerces.xni.parser.XMLEntityResolver;
-import org.apache.xerces.xni.parser.XMLErrorHandler;
-import org.apache.xerces.xni.parser.XMLInputSource;
-import org.apache.xerces.xni.parser.XMLParseException;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.validation.XMLValidator;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-import org.w3c.dom.DOMError;
-
-/**
- * The XSDValidator will validate XSD files.
- */
-public class XSDValidator
-{
-  private URIResolver uriresolver = null;
-
-  public ValidationReport validate(String uri)
-  {
-    return validate(uri, null);
-  }
-  
-  /**
-   * Validate the XSD file specified by the URI.
-   * 
-   * @param uri
-   *          The URI of the XSD file to validate.
-   * @param inputStream An input stream representing the XSD file to validate.
-   */
-  public ValidationReport validate(String uri, InputStream inputStream)
-  {
-	ValidationInfo valinfo = new ValidationInfo(uri);
-	XSDErrorHandler errorHandler = new XSDErrorHandler(valinfo);
-	try
-	{
-	  XMLGrammarPreparser grammarPreparser = new XMLGrammarPreparser();
-	  grammarPreparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA,null/*schemaLoader*/);
-		  
-	  grammarPreparser.setProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY, new XMLGrammarPoolImpl());
-	  grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE, false);
-      grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true);
-      grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACE_PREFIXES_FEATURE, true);
-	  grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.VALIDATION_FEATURE, true);
-	  grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE, true);
-      grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_FULL_CHECKING, false);
-	  grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.EXTERNAL_GENERAL_ENTITIES_FEATURE, true);
-	  grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.EXTERNAL_PARAMETER_ENTITIES_FEATURE, true);
-	  grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ATTDEF_FEATURE, true);
-	      
-	  try
-	  {
-	    grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + "http://apache.org/xml/features/honour-all-schemaLocations", true);
-	  }
-      catch (Exception e)
-	  {
-	    // catch the exception and ignore
-	  }
-	      
-	  grammarPreparser.setErrorHandler(errorHandler);
-	  if (uriresolver != null)
-	  {
-	    XSDEntityResolver resolver = new XSDEntityResolver(uriresolver, uri);
-	    if (resolver != null)
-	    {
-	      grammarPreparser.setEntityResolver(resolver);
-	    }
-	  }
-
-	  try
-	  {
-	  	XMLInputSource is = new XMLInputSource(null, uri, uri, inputStream, null);
-	    grammarPreparser.getLoader(XMLGrammarDescription.XML_SCHEMA);
-		grammarPreparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA,is);
-	  }
-	  catch (Exception e)
-	  {
-	    //parser will return null pointer exception if the document is structurally invalid
-		//TODO: log error message
-		//System.out.println(e);
-      }
-	}
-	catch (Exception e)
-	{
-      // TODO: log error.
-	  //System.out.println(e);
-	}
-	return valinfo;
-  }
-
-  /**
-   * Set the URI resolver to use with XSD validation.
-   * 
-   * @param uriresolver
-   *          The URI resolver to use.
-   */
-  public void setURIResolver(URIResolver uriresolver)
-  {
-    this.uriresolver = uriresolver;
-  }
-
-  /**
-   * The XSDErrorHandler handle Xerces parsing errors and puts the errors
-   * into the given ValidationInfo object.
-   */
-  protected class XSDErrorHandler implements XMLErrorHandler
-  {
-	  
-    private final ValidationInfo valinfo;
-
-    public XSDErrorHandler(ValidationInfo valinfo)
-    {
-      this.valinfo = valinfo;
-    }
-    
-    /**
-     * Add a validation message with the given severity.
-     * 
-     * @param errorKey The Xerces error key.
-     * @param exception The exception that contains the information about the message.
-     * @param severity The severity of the validation message.
-     */
-    protected void addValidationMessage(String errorKey, XMLParseException exception, int severity)
-    { 
-      String systemId = exception.getExpandedSystemId();
-      if (systemId != null)
-      {
-        if (severity == DOMError.SEVERITY_WARNING)
-        {
-          valinfo.addWarning(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), systemId);
-        }
-        else
-        {
-          valinfo.addError(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), systemId, errorKey, null);
-        }
-      }
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.xerces.xni.parser.XMLErrorHandler#warning(java.lang.String, java.lang.String, org.apache.xerces.xni.parser.XMLParseException)
-     */
-    public void warning(String domain, String key, XMLParseException exception) throws XNIException
-	{
-    	addValidationMessage(key, exception, DOMError.SEVERITY_WARNING);
-	}
-
-    /* (non-Javadoc)
-     * @see org.apache.xerces.xni.parser.XMLErrorHandler#error(java.lang.String, java.lang.String, org.apache.xerces.xni.parser.XMLParseException)
-     */
-    public void error(String domain, String key, XMLParseException exception) throws XNIException
-    {
-    	addValidationMessage(key, exception, DOMError.SEVERITY_ERROR);
-	}
-
-    /* (non-Javadoc)
-     * @see org.apache.xerces.xni.parser.XMLErrorHandler#fatalError(java.lang.String, java.lang.String, org.apache.xerces.xni.parser.XMLParseException)
-     */
-    public void fatalError(String domain, String key, XMLParseException exception) throws XNIException
-	{
-    	addValidationMessage(key, exception, DOMError.SEVERITY_FATAL_ERROR);
-	}
-  }
-
-  /**
-   * The XSDEntityResolver wraps an idresolver to provide entity resolution to
-   * the XSD validator.
-   */
-  protected class XSDEntityResolver implements XMLEntityResolver
-  {
-    private URIResolver uriresolver = null;
-
-    /**
-     * Constructor.
-     * 
-     * @param idresolver
-     *          The idresolver this entity resolver wraps.
-     * @param baselocation The base location to resolve with.
-     */
-    public XSDEntityResolver(URIResolver uriresolver, String baselocation)
-    {
-      this.uriresolver = uriresolver;
-    }
-    
-    /* (non-Javadoc)
-     * @see org.apache.xerces.xni.parser.XMLEntityResolver#resolveEntity(org.apache.xerces.xni.XMLResourceIdentifier)
-     */
-    public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) throws XNIException, IOException
-    {
-      String literalSystemId = resourceIdentifier.getLiteralSystemId();
-      if(literalSystemId != null)
-      {
-    	resourceIdentifier.setLiteralSystemId(literalSystemId.replace('\\','/'));
-      }
-        // TODO cs: In revision 1.1 we explicitly opened a stream to ensure
-        // file I/O problems produced messages. I've remove this fudge for now
-        // since I can't seem to reproduce the problem it was intended to fix.
-        // I'm hoping the newer Xerces code base has fixed this problem and the fudge is defunct.
-        return XMLValidator._internalResolveEntity(uriresolver, resourceIdentifier);
-      
-    }
-  }   
-}
diff --git a/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/XSDCorePlugin.java b/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/XSDCorePlugin.java
deleted file mode 100644
index 7b30f26..0000000
--- a/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/XSDCorePlugin.java
+++ /dev/null
@@ -1,56 +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.xsd.core.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.xsd.contentmodel.internal.XSDCMManager;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class XSDCorePlugin extends Plugin {
-	//The shared instance.
-	private static XSDCorePlugin plugin;
-	
-	/**
-	 * The constructor.
-	 */
-	public XSDCorePlugin() {
-		super();
-		plugin = this;
-	}
-
-	/**
-	 * This method is called upon plug-in activation
-	 */
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-    XSDCMManager.getInstance().startup();
-	}
-
-	/**
-	 * This method is called when the plug-in is stopped
-	 */
-	public void stop(BundleContext context) throws Exception {
-		super.stop(context);
-		plugin = null;
-	}
-
-	/**
-	 * Returns the shared instance.
-	 */
-	public static XSDCorePlugin getDefault() {
-		return plugin;
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/.classpath b/bundles/org.eclipse.wst.xsd.ui/.classpath
deleted file mode 100644
index ed58bc2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="src-validation"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.xsd.ui/.cvsignore b/bundles/org.eclipse.wst.xsd.ui/.cvsignore
deleted file mode 100644
index 7b94482..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-bin
-xsdeditor.jar
-build.xml
-temp.folder
-org.eclipse.wst.xsd.ui_1.0.0.jar
-@dot
-src.zip
diff --git a/bundles/org.eclipse.wst.xsd.ui/.project b/bundles/org.eclipse.wst.xsd.ui/.project
deleted file mode 100644
index aab3824..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.xsd.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.xsd.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index efba9c0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,69 +0,0 @@
-#Fri Dec 10 00:29:03 EST 2004
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-eclipse.preferences.version=1
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.incompleteClasspath=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
diff --git a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 179abb3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Fri Dec 10 00:50:26 EST 2004
-compilers.p.unused-element-or-attribute=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unknown-class=0
-compilers.p.unknown-attribute=0
-compilers.p.no-required-att=0
-eclipse.preferences.version=1
-compilers.p.unresolved-import=0
-compilers.p.illegal-att-value=0
-compilers.use-project=true
diff --git a/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 91c80fe..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,64 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %_UI_PLUGIN_NAME
-Bundle-SymbolicName: org.eclipse.wst.xsd.ui; singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.core.internal.compatibility.PluginActivator
-Bundle-Vendor: Eclipse.org
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.xsd.ui.internal,
- org.eclipse.wst.xsd.ui.internal.actions,
- org.eclipse.wst.xsd.ui.internal.commands,
- org.eclipse.wst.xsd.ui.internal.dialogs.types.common,
- org.eclipse.wst.xsd.ui.internal.dialogs.types.xml,
- org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd,
- org.eclipse.wst.xsd.ui.internal.dnd,
- org.eclipse.wst.xsd.ui.internal.gef.util.editparts,
- org.eclipse.wst.xsd.ui.internal.gef.util.figures,
- org.eclipse.wst.xsd.ui.internal.graph,
- org.eclipse.wst.xsd.ui.internal.graph.editparts,
- org.eclipse.wst.xsd.ui.internal.graph.editpolicies,
- org.eclipse.wst.xsd.ui.internal.graph.figures,
- org.eclipse.wst.xsd.ui.internal.graph.model,
- org.eclipse.wst.xsd.ui.internal.icons,
- org.eclipse.wst.xsd.ui.internal.preferences,
- org.eclipse.wst.xsd.ui.internal.properties,
- org.eclipse.wst.xsd.ui.internal.properties.section,
- org.eclipse.wst.xsd.ui.internal.provider,
- org.eclipse.wst.xsd.ui.internal.refactor,
- org.eclipse.wst.xsd.ui.internal.refactor.actions,
- org.eclipse.wst.xsd.ui.internal.refactor.delete,
- org.eclipse.wst.xsd.ui.internal.refactor.rename,
- org.eclipse.wst.xsd.ui.internal.refactor.structure,
- org.eclipse.wst.xsd.ui.internal.text,
- org.eclipse.wst.xsd.ui.internal.util,
- org.eclipse.wst.xsd.ui.internal.validation,
- org.eclipse.wst.xsd.ui.internal.widgets,
- org.eclipse.wst.xsd.ui.internal.wizards
-Require-Bundle: org.eclipse.core.runtime.compatibility,
- org.eclipse.wst.common.uriresolver,
- org.eclipse.wst.sse.ui,
- org.eclipse.wst.sse.core,
- org.eclipse.wst.xml.core,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.common.ui,
- org.eclipse.jface.text,
- org.eclipse.xsd,
- org.eclipse.gef,
- org.eclipse.jface,
- org.eclipse.ui.editors,
- org.eclipse.ui.workbench.texteditor,
- org.eclipse.ui,
- org.eclipse.ui.views,
- org.eclipse.ui.ide,
- org.eclipse.core.resources,
- org.eclipse.wst.common.ui.properties,
- org.eclipse.xsd.edit,
- org.eclipse.emf.edit,
- org.eclipse.emf.edit.ui,
- org.eclipse.wst.validation,
- org.eclipse.ltk.core.refactoring,
- org.eclipse.ltk.ui.refactoring,
- org.eclipse.wst.xsd.core
-Eclipse-AutoStart: true
-Plugin-Class: org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin
diff --git a/bundles/org.eclipse.wst.xsd.ui/about.html b/bundles/org.eclipse.wst.xsd.ui/about.html
deleted file mode 100644
index 6f6b96c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
- 
-<p>February 24, 2005</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.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/build.properties b/bundles/org.eclipse.wst.xsd.ui/build.properties
deleted file mode 100644
index 607430b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/build.properties
+++ /dev/null
@@ -1,24 +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
-###############################################################################
-source.. = src/,\
-					   src-validation
-bin.includes = .,\
-               plugin.xml,\
-               icons/,\
-               image/,\
-               doc/,\
-               plugin.properties,\
-               samples/,\
-               w3c/,\
-               META-INF/,\
-               about.html
-src.includes = build.properties,\
-               component.xml
diff --git a/bundles/org.eclipse.wst.xsd.ui/component.xml b/bundles/org.eclipse.wst.xsd.ui/component.xml
deleted file mode 100644
index 294443a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/component.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model"
-	name="org.eclipse.wst.xsd">
-	<component-depends unrestricted="true"></component-depends>
-	<plugin	id="org.eclipse.wst.xsd.ui" fragment="false" />
-	<plugin	id="org.eclipse.wst.xsd.core" fragment="false" />
-</component>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/XSDFile.gif b/bundles/org.eclipse.wst.xsd.ui/icons/XSDFile.gif
deleted file mode 100644
index 3900f1b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/XSDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/annotationsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/annotationsheader.gif
deleted file mode 100644
index 9bfb682..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/annotationsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributegroupsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributegroupsheader.gif
deleted file mode 100644
index e618a25..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributegroupsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributesheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributesheader.gif
deleted file mode 100644
index 9254879..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributesheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/directivesheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/directivesheader.gif
deleted file mode 100644
index 6000cb8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/directivesheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/elementsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/elementsheader.gif
deleted file mode 100644
index 26f7206..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/elementsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/groupsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/groupsheader.gif
deleted file mode 100644
index c9745f0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/groupsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/notationsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/notationsheader.gif
deleted file mode 100644
index e05c645..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/notationsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_list_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_list_obj.gif
deleted file mode 100644
index 6e2cd93..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_list_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrict_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrict_obj.gif
deleted file mode 100644
index 1ebd546..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrict_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_union_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_union_obj.gif
deleted file mode 100644
index 0b01f8c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_union_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/typesheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/typesheader.gif
deleted file mode 100644
index 3267542..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/typesheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/attributeoverlay.gif b/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/attributeoverlay.gif
deleted file mode 100644
index 1931f92..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/attributeoverlay.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/textoverlay.gif b/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/textoverlay.gif
deleted file mode 100644
index d455c2b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/textoverlay.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/plugin.properties b/bundles/org.eclipse.wst.xsd.ui/plugin.properties
deleted file mode 100644
index 01944f1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/plugin.properties
+++ /dev/null
@@ -1,829 +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
-###############################################################################
-! Properties file for component: XMSCH - XML Tools -  XML Schema Editor
-! Packaged for translation in:  xml.zip
-
-!
-! Plugin
-!
-_UI_PLUGIN_NAME             = XML Schema Editor
-_UI_EDITOR_NAME             = XML Schema Editor
-
-_UI_ACTION_EXT_GENERATE      = &Generate
-_UI_ACTION_EXT_GENERATE_DDL  = &DDL...
-_UI_ACTION_EXT_GENERATE_DTD  = D&TD...
-_UI_ACTION_EXT_GENERATE_JAVA = &Java Beans...
-
-_UI_ACTION_EXT_GENERATE_XSD = &Generate XML Schema
-_UI_WIZARD_NAME_NEW_XSD     = XML Schema
-
-_UI_XML_TOOLS_PREFERENCE_PAGE  = XML
-_UI_XML_SCHEMA_PREFERENCE      = XML Schema Files
-
-_UI_WIZARD_NEW_XSD             = XML Schema
-_UI_CREATE_A_NEW_SCHEMA        = Create a new XML schema file
-
-! New property tabs
-_UI_LABEL_GENERAL       = General
-_UI_LABEL_OTHER         = Other
-_UI_LABEL_ATTRIBUTES    = Attributes
-_UI_LABEL_DOCUMENTATION = Documentation
-_UI_LABEL_FACETS        = Facets
-_UI_LABEL_ENUMERATIONS  = Enumerations
-_UI_LABEL_NAMESPACE     = Namespace
-
-_UI_LABEL_READ_ONLY     = read-only
-_UI_LABEL_KIND          = Kind:
-_UI_LABEL_VARIETY       = Variety:
-
-_UI_LABEL_APP_INFO      = App Info
-
-!
-! Schema File Window
-!
-_UI_LABEL_FILE_NAME              = File name:
-_UI_LABEL_VERSION                = Version:
-_UI_TOOLTIP_VERSION              = Convenient attribute to store version number
-_UI_LABEL_LANGUAGE               = Language:
-_UI_TOOLTIP_LANGUAGE             = Represents natural language identifiers
-_UI_GROUP_NAMESPACE              = Namespace
-_UI_LABEL_SCHEMA_PREFIX          = Prefix:
-_UI_TOOLTIP_SCHEMA_PREFIX        = The prefix associated with the current namespace.
-_UI_LABEL_TARGET_NAME_SPACE      = Target namespace:
-_UI_TOOLTIP_TARGET_NAME_SPACE    = The namespace for this schema.
-_UI_BUTTON_APPLY                 = Apply
-_UI_LABEL_ATTRIBUTE_FORM_DEFAULT = Attribute form default:
-_UI_TOOLTIP_ATTRIBUTE_FORM       = Indicates if all attributes in a schema must be qualified or not in the instance document
-_UI_LABEL_ELEMENT_FORM_DEFAULT   = Element form default:
-_UI_TOOLTIP_ELEMENT_FORM_DEFAULT = Indicates if all elements in a schema must be qualified or not in the instance document
-_UI_LABEL_BLOCK_DEFAULT          = Block default:
-_UI_TOOLTIP_BLOCK_DEFAULT        = Control derivations for every type and element in the schema
-_UI_LABEL_FINAL_DEFAULT          = Final default:
-_UI_TOOLTIP_FINAL_DEFAULT        = Control derivations for every type and element in the schema
-_UI_ACTION_DELETE_INCLUDE        = Delete
-_UI_ACTION_DELETE_NODES          = Delete Nodes
-! Note to translators: The following is the acronym for Uniform Resource Indicator
-_UI_LABEL_URI                    = URI:
-
-
-_UI_LABEL_ADD              = Add...
-_UI_LABEL_EDIT             = Edit...
-_UI_LABEL_PATTERNS         = Patterns
-_ERROR_FILE_ALREADY_EXISTS = The file name already exists: {0}
-
-!
-! Any Section
-!
-! Note to translators - translate only the word and
-_UI_LABEL_NAMESPACE_AND_PROCESS_CONTENTS = namespace and processContents
-
-!
-! minOccurs and maxOccurs section
-!
-! Note to translators - translate only the word and
-_UI_LABEL_MINOCCURS_AND_MAXOCCURS = minOccurs and maxOccurs
-
-!
-! Value Information Section
-!
-_UI_LABEL_VALUE_INFORMATION   = Value Information
-
-!
-! Notation window
-!
-_UI_NOTATION_NAME                = Name:
-_UI_NOTATION_PUBLIC              = Public:
-_UI_NOTATION_SYSTEM              = System:
-_UI_TOOLTIP_PUBLIC               = An optional public identifier
-_UI_TOOLTIP_SYSTEM               = An optional URI reference
-
-!
-! Complex Type Window
-!
-_UI_NAME                         = Name:
-_UI_ABSTRACT                     = Abstract:
-_UI_MIXED                        = Mixed:
-_UI_BLOCK                        = Block:
-_UI_FINAL                        = Final:
-
-_UI_CT_TOOLTIP_MIXED             = Indicates if type may contain mixed content
-_UI_CT_TOOLTIP_ABSTRACT          = When a complex type is declared abstract, it cannot be used in an instance document
-_UI_CT_TOOLTIP_FINAL             = You can use this to prevent further derivations
-_UI_CT_TOOLTIP_BLOCK             = You can use this to block any derivations
-
-!
-! SimpleContent and ComplexContent Window
-! 
-_UI_LABEL_DERIVED_BY            = Derived by:
-_UI_TOOLTIP_DERIVED_BY          = Derive by extension to inherit from a base type content model and add to it. Derive by restriction to restrict the content model of an existing type.
-
-!
-! Combo box items - no need to translate
-!
-_UI_COMBO_RESTRICTION           = restriction
-_UI_COMBO_EXTENSION             = extension
-
-!
-! Element & Element Ref Window
-!
-_UI_ELEMENT_NAME                 = Name:
-_UI_CHECKBOX_NILLABLE            = Nillable
-_UI_CHECKBOX_ABSTRACT            = Abstract
-_UI_SUBSTITUTION                 = Substitution group:
-_UI_MINIMUM                      = Minimum:
-_UI_MAXIMUM                      = Maximum:
-_UI_REFERENCE_NAME               = Reference name:
-
-_UI_TOOLTIP_ELEMENT_MINIMUM      = A non-negative integer that specifies the minimum number of times an element can occur.
-_UI_TOOLTIP_ELEMENT_MAXIMUM      = A non-negative integer or unbounded if there is no upper limit on the number of times the element can occur.
-_UI_TOOLTIP_ELEMENT_ABSTRACT     = When an element is declared abstract, a member of its equivalent class must appear in the instance document,
-_UI_TOOLTIP_ELEMENT_NIL          = If selected, an attribute can be included in the instance document to indicate that the element has a nil value.
-_UI_TOOLTIP_ELEMENT_SUBSTITUTION = Select the element that can be substituted by this element
-_UI_TOOLTIP_ELEMENT_FORM         = Indicates if the element is qualifed in the instance document
-_UI_TOOLTIP_ELEMENT_VALUE        = Provides a default or fixed value for the element.
-
-
-!
-! Attribute Window
-!    _UI_COMBO_BOX strings are used in code generation. 
-!    Probably don't need to be translated
-!
-_UI_COMBO_BOX_REQUIRED           = required
-_UI_COMBO_BOX_OPTIONAL           = optional
-_UI_COMBO_BOX_PROHIBITED         = prohibited
-
-_UI_FIXED                        = Fixed
-_UI_DEFAULT                      = Default
-_UI_ATTRIBUTE_NAME               = Attribute name:
-_UI_USAGE                        = Usage:
-_UI_FORM                         = Form qualification:
-_UI_VALUE                        = Value
-
-_UI_LABEL_OTHER_ATTRIBUTES       = Other Attributes
-
-_UI_TOOLTIP_ATTRIBUTE_USE        = Indicates if the attribute is required, optional, or prohibited
-_UI_TOOLTIP_ATTRIBUTE_FORM       = Indicates if the attribute is qualifed or not in the instance document
-_UI_TOOLTIP_ATTRIBUTE_VALUE      = Provides default or fixed value for the attribute. Default value only valid if Usage value is set to optional.
-
-_UI_PROCESS_CONTENTS             = Process contents:
-
-!
-! Annotation - Doc & AppInfo Window
-!
-_UI_COMMENT                      = Comment
-_UI_TOOLTIP_COMMENT              = Information useful to the user or application
-_UI_SOURCE                       = Source:
-_UI_TOOLTIP_SOURCE               = An optional URI reference to supplement the local information
-_UI_LANGUAGE                     = Language:
-_UI_TOOLTIP_LANGUAGE_ANNOTATION  = Indicate the language in which the annotation is expressed
-
-!
-! Group
-! 
-_UI_CONTENT_MODEL               = Content model
-_UI_SEQUENCE                    = Sequence
-_UI_CHOICE                      = Choice
-_UI_ALL                         = All
-
-
-!
-! Simple Type Related Facets  - appear as entries in a table - restriction on simple type
-!
-_UI_GROUP_FACETS                = Facets
-_UI_LENGTH                      = Length
-_UI_MINIMUM_LENGTH              = Minimum Length
-_UI_MAXIMUM_LENGTH              = Maximum Length
-_UI_MINIMUM_INCLUSIVE           = Minimum Inclusive
-_UI_MAXIMUM_INCLUSIVE           = Maximum Inclusive
-_UI_MINIMUM_EXCLUSIVE           = Minimum Exclusive
-_UI_MAXIMUM_EXCLUSIVE           = Maximum Exclusive
-_UI_TOTAL_DIGITS                = Total Digits
-_UI_FRACTION_DIGITS             = Fraction Digits
-_UI_WHITE_SPACE                 = White Space
-_UI_FACET_NAME                  = Name
-_UI_FACET_VALUE                 = Value
-_UI_FACET_FIXED                 = Fixed
-
-_UI_TOOLTIP_LENGTH              = The number of units of length. Must be a non-negative integer.
-_UI_TOOLTIP_MIN_LEN             = The minimum number of units of length. Must be a non-negative integer.
-_UI_TOOLTIP_MAX_LEN             = The maximum number of units of length. Must be a non-negative integer.
-_UI_TOOLTIP_MAX_INCLUSIVE       = The upper bound of the value space. The value is itself included.
-_UI_TOOLTIP_MAX_EXCLUSIVE       = The upper bound of the value space. The value is itself excluded.
-_UI_TOOLTIP_MIN_INCLUSIVE       = The lower bound of the value space. The value is itself included.
-_UI_TOOLTIP_MIN_EXCLUSIVE       = The lower bound of the value space. The value is itself excluded.
-_UI_TOOLTIP_TOTAL_DIGITS        = The maximum number of decimal digits. Must be a positive integer.
-_UI_TOOLTIP_FRACTION_DIGITS     = The maximum number of decimal digits in the fractional part. Must be a non-negative integer.
-_UI_TOOLTIP_WHITE_SPACE         = Indicates if white space should be preserved, replaced or collapsed. 
-
-_UI_TOOLTIP_PATTERN             = Constrains the value to match a specific pattern. The pattern must be a regular expression. 
-_UI_TOOLTIP_ENUM                = Constrains the value to a specified set of values. 
-
-!
-! Simple/Complex Type Selection 
-!
-_UI_LABEL_TYPE_INFORMATION          = Type information
-_UI_LABEL_BASE_TYPE                 = Base type
-_UI_LABEL_BASE_TYPE_WITH_COLON      = Base type:
-_UI_LABEL_SET_BASE_TYPE             = Set Base Type
-_UI_ACTION_SET_BASE_TYPE            = Set Base Type...
-_UI_RADIO_NONE                      = None
-_UI_RADIO_BUILT_IN_SIMPLE_TYPE      = Built-in simple type
-_UI_RADIO_USER_DEFINED_SIMPLE_TYPE  = User-defined simple type
-_UI_RADIO_USER_DEFINED_COMPLEX_TYPE = User-defined complex type
-_UI_LABEL_NEW_COMPLEX_TYPE          = New Complex Type
-_UI_LABEL_NEW_SIMPLE_TYPE           = New Simple Type
-_UI_LABEL_SET_TYPE				    = Set Type
-_UI_LABEL_SET_EXISTING_TYPE 		= Set Existing Type...
-_UI_NO_TYPE                         = **none**
-_UI_LABEL_COMPONENTS				= Components:
-_UI_LABEL_QUALIFIER					= Qualifier:
-
-_UI_LABEL_COMPONENT_NAME			   = Component Name:
-_UI_LABEL_MATCHING_COMPONENTS		   = Matching Components:
-_UI_LABEL_MATCHING_TYPES		   	   = Matching Types:
-_UI_LABEL_TYPE_NAME					   = Type Name:
-_UI_LABEL_SPECIFIED_FILE			   = Specified File
-_UI_LABEL_ENCLOSING_PROJECT			   = Enclosing Project
-_UI_LABEL_WORKSPACE					   = Workspace
-_UI_LABEL_CURRENT_RESOURCE			   = Current Resource
-_UI_LABEL_SEARCH_SCOPE				   = Search Scope
-_UI_LABEL_NARROW_SEARCH_SCOPE_RESOURCE = Use resource view to narrow search scope
-_UI_LABEL_AVAILABLE_TYPES			   = Available Types
-
-
-!
-! Combo-box value 
-! NOTE TO TRANSLATOR: Do not translate following line
-_UI_DEFAULT_ANONYMOUS               = **anonymous**
-
-!
-! Unique, Key and KeyRef window
-!
-_UI_REFERENCE_KEY                   = Reference key
-_UI_SELECTOR                        = Selector
-_UI_FIELDS                          = Fields
-
-_UI_TOOLTIP_SELECTOR_TEXT           = Specifies an XPath expression relative to instances of the current element
-_UI_TOOLTIP_FIELD_TEXT              = Specifies an XPath expression relative to each element selected by the selector
-
-_UI_ADD_BUTTON                      = Add>>
-_UI_REMOVE_BUTTON                   = <<Remove
-
-!
-! Include & Imports
-!
-_UI_LABEL_PREFIX                = Prefix:
-_UI_LABEL_NAMESPACE             = Namespace:
-
-_UI_SCHEMA_INCLUDE_DESC         = Select a schema file so that the definitions in the schema file will be available in the current schema. The target namespace of the included schema must be the same as the target namespace of the current schema.
-_UI_LABEL_SCHEMA_IMPORT_DESC    = Select a schema file from a different namespace so that its definitions can be referenced by the current schema. You must associate a prefix with the new namespace for use in the current schema.
-
-_UI_LABEL_SCHEMA_LOCATION        = Schema location:
-_UI_BUTTON_SELECT                = Select
-_UI_FILEDIALOG_SELECT_XML_SCHEMA = Select XML schema file
-_UI_FILEDIALOG_SELECT_XML_DESC   = Select an XML schema file from the Workbench projects
-_UI_FILEDIALOG_SELECT_XML_URL    = Select an XML schema file from HTTP
-
-_UI_LABEL_LOADING_XML_SCHEMA     = Loading XML Schema
-_UI_LABEL_FINISH_LOADING         = Finish Loading
-_UI_LABEL_NO_LOCATION_SPECIFIED  = No Location Specified
-
-!
-! XSD Editor
-!
-_UI_TAB_SOURCE                  = Source
-_UI_TAB_DESIGN                  = Design
-!  Note to translators: Graph is the graphic view of the XML schema
-_UI_TAB_GRAPH                   = Graph
-_UI_MENU_UNDO                   = &Undo @Ctrl+Z
-_UI_MENU_REDO                   = &Redo @Ctrl+Y
-
-!
-! Task List Related Message
-!
-_UI_REF_FILE_ERROR_DESCRIPTION      = The errors below were detected when validating the file "{0}" via the file "{1}".  In most cases these errors can be detected by validating "{2}" directly.  However it is possible that errors will only occur when {2} is validated in the context of {3}.
-_UI_REF_FILE_ERROR_PUSH_HELP        = Push the help button below to read more.
-_UI_REF_FILE_ERROR_MESSAGE          = Referenced file contains errors ({0}).  For more information, right click on the message and select "Show Details..."
-_UI_REF_FILE_SHOW_DETAILS           = Show Details...
-
-
-!
-! XSDEditor Menu bar contributor
-!
-_UI_MENU_GENERATE_JAVA              = Generate &Java Beans...
-_UI_MENU_GENERATE_DTD               = Generate &DTD...
-_UI_MENU_GENERATE_SAMPLE_XML        = Generate XM&L...
-_UI_MENU_XSD_EDITOR                 = &XSD
-_UI_MENU_VALIDATE_XML               = &Validate XML Schema
-_UI_MENU_VALIDATE_XML_TOOLTIP       = Validate the current state of the XML Schema
-_UI_MENU_GENERATE_JAVA_TOOLTIP      = Generate Java beans for the XML Schema
-_UI_MENU_GENERATE_DTD_TOOLTIP       = Generate a DTD from the XML Schema
-_UI_MENU_GENERATE_SAMPLE_XML_TOOLTIP = Generate an XML from the XML Schema
-_UI_MENU_RELOAD_DEPENDENCIES_TOOLTIP = Reload Dependencies
-_UI_MENU_RELOAD_DEPENDENCIES = &Reload Dependencies
-
-!
-! Preference Page
-!
-_UI_TEXT_INDENT_LABEL                 = Indentation
-_UI_TEXT_INDENT_SPACES_LABEL          = &Number of spaces: 
-_UI_TEXT_XSD_NAMESPACE_PREFIX         = XML schema language
-_UI_TEXT_XSD_DEFAULT_PREFIX           = XML schema language constructs &prefix:
-_UI_QUALIFY_XSD                       = &Qualify XML schema language constructs
-_UI_SEPARATE_DESIGN_AND_SOURCE_VIEW   = Separate Source, Design and Graph view
-_UI_COMBINED_DESIGN_AND_SOURCE_VIEW   = Combined Source or Graph view with Design view 
-_UI_LABEL_EDITOR_LAYOUT               = Editor Layout
-_UI_PREF_DESIGN_VIEW_LAYOUT           = Design View Location
-_UI_PREF_DESIGN_BOTTOM                = Below
-_UI_PREF_DESIGN_RIGHT                 = Right
-_UI_TEXT_XSD_DEFAULT_TARGET_NAMESPACE = Default Target Namespace:
-
-!
-! Content Outline View action
-! NOTE TO TRANSLATOR: Do not translate the word(s) following "Add" on each line in
-!   this section i.e. Annotation, Documentation, AppInfo  These words are XML Schema keywords.
-_UI_ACTION_DELETE                  = D&elete
-_UI_ACTION_ADD_ANNOTATION          = Add &Annotation
-_UI_ACTION_ADD_DOC                 = Add &Documentation
-_UI_ACTION_ADD_APP_INFO            = Add A&ppInfo
-_UI_ACTION_ADD_GLOBAL_ELEMENT      = Add Glob&al Element
-_UI_ACTION_ADD_KEY                 = Add &Key
-_UI_ACTION_ADD_KEY_REF             = Add Key Re&f
-_UI_ACTION_ADD_UNIQUE              = Add Uni&que
-_UI_ACTION_ADD_GROUP               = Add G&roup
-_UI_ADD_GROUP_REF                  = Add Gr&oup Ref
-_UI_ACTION_ADD_CONTENT_MODEL       = Add Content &Model
-_UI_ACTION_ADD_ELEMENT             = Add &Element
-_UI_ACTION_ADD_ELEMENT_REF         = Add E&lement Ref
-_UI_ACTION_ADD_SIMPLE_TYPE         = Add &Simple Type
-_UI_ACTION_ADD_PATTERN             = Add &Pattern
-_UI_ACTION_ADD_ENUM                = Add En&umeration
-_UI_ACTION_ADD_ENUMS               = Add Enu&merations...
-_UI_ACTION_ADD_COMPLEX_TYPE        = Add Complex &Type
-_UI_ACTION_ADD_COMPLEX_CONTENT     = Add Comple&x Content
-_UI_ACTION_ADD_SIMPLE_CONTENT      = Add Simple &Content
-_UI_ACTION_ADD_ATTRIBUTE           = Add Attri&bute
-_UI_ACTION_ADD_ATTRIBUTE_GROUP     = Add Attr&ibute Group
-_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF = Add A&ttribute Group Ref
-_UI_ACTION_ADD_INCLUDE             = Add In&clude
-_UI_ACTION_ADD_IMPORT              = Add &Import
-_UI_ACTION_ADD_REDEFINE            = Add Re&define
-_UI_ACTION_ADD_NOTATION            = Add &Notation
-_UI_ACTION_ADD_ANY_ELEMENT         = Add An&y
-_UI_ACTION_ADD_ANY_ATTRIBUTE       = Add &Any Attribute
-_UI_ACTION_ADD_GLOBAL_ATTRIBUTE    = Add &Global Attribute
-_UI_ACTION_ADD_ATTRIBUTE_REFERENCE = Add Attrib&ute Ref
-_UI_ACTION_ADD_RESTRICTION         = Add Re&striction
-_UI_ACTION_ADD_UNION               = Add U&nion
-_UI_ACTION_ADD_LIST                = Add &List
-_UI_ACTION_DELETE_GROUP_SCOPE      = D&elete
-_UI_ACTION_ADD_CHOICE              = Add &Choice
-_UI_ACTION_ADD_SEQUENCE            = Add Se&quence
-_UI_ACTION_ADD_ALL                 = Add &All
-_UI_ACTION_ADD_EXTENSION           = Add E&xtension
-_UI_ACTION_ADD_SELECTOR            = Add &Selector
-_UI_ACTION_ADD_FIELD               = Add &Field
-! NOTE TO TRANSLATOR: Translate Add and Node
-_UI_ACTION_ADD_SCHEMA_NODE         = Add &Schema Node
-! NOTE TO TRANSLATOR: TRANSLATE Add and Local
-_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE   = Add Local &Simple Type
-_UI_ACTION_ADD_LOCAL_COMPLEX_TYPE  = Add Local &Complex Type
-_UI_ACTION_BACK_TO_SCHEMA_VIEW     = Back To Schema
-_UI_HOVER_BACK_TO_SCHEMA_VIEW     = Back to schema
-
-_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL = Make Anonymous Type Global
-_UI_ACTION_OPEN_SCHEMA                = Open Schema
-
-_UI_ACTION_INSERT_BEFORE           = Insert Before
-_UI_ACTION_INSERT_AFTER            = Insert After
-
-_UI_OUTLINE_SORT                   = Sort alphabetically
-_UI_OUTLINE_DO_NOT_SORT            = Do not sort alphabetically
-
-_UI_OUTLINE_SHOW_COMPLEX_TYPE      = Show Complex Types Only
-_UI_OUTLINE_SHOW_SIMPLE_TYPE       = Show Simple Types Only
-_UI_OUTLINE_SHOW_ATTRIBUTE_GROUP   = Show Attribute Groups Only
-_UI_OUTLINE_SHOW_GROUP             = Show Groups Only
-_UI_OUTLINE_SHOW_GLOBAL_ELEMENT    = Show Global Elements Only
-_UI_OUTLINE_SHOW_REFERENCES        = Show Reference Content
-_UI_OUTLINE_SHOW_INHERITED         = Show Inherited Content
-
-_UI_ACTION_SET_MULTIPLICITY		   = Set Multiplicity
-
-!
-! New XML Schema Wizard
-!
-_UI_WIZARD_CREATE_XSD_MODEL_TITLE    = Create XML Schema
-
-! NOTE TO TRANSLATOR: Do not translate following line
-_UI_CREATEXSD                        = createXSD
-_UI_NEW_XML_SCHEMA_TITLE             = New XML Schema
-_UI_CREATE_A_NEW_XML_SCHEMA_DESC     = Create a new XML schema.
-
-! NOTE TO TRANSLATOR: Do not translate following line
-_UI_NEW_XML_SCHEMA_FILENAME          = NewXMLSchema.xsd
-
-!
-! XSD From RDB Schema Wizard
-!
-_UI_WIZARD_CREATE_XSD_FROM_RDB_TITLE = Create XSD from RDB Table
-
-
-!
-! Regular Expression Wizard
-!
-_UI_REGEX_WIZARD_CREATE_BUTTON = Create Regular Expression...
-_UI_TOOLTIP_REGEX_WIZARD_BUTTON = Launch the Regular Expression Wizard
-_UI_REGEX_WIZARD_TITLE = Regular Expression Wizard
-_UI_REGEX_WIZARD_COMPOSITION_PAGE_TITLE = Compose Regular Expression
-_UI_REGEX_WIZARD_COMPOSITION_PAGE_DESCRIPTION = To add a token, specify its contents and occurrence, then click Add.
-_UI_REGEX_WIZARD_INVALID_REGEX_ERROR_PREFIX = The current regular expression is not valid.  Reason:  
-_UI_REGEX_WIZARD_INVALID_TOKEN_ERROR_PREFIX = The current token is not valid.  Reason:  
-_UI_REGEX_WIZARD_INVALID_REGEX_ERROR = The current regular expression is not valid.
-_UI_REGEX_WIZARD_INVALID_TOKEN_ERROR = The current token is not valid.
-_UI_REGEX_WIZARD_INVALID_MIN_ERROR_SUFFIX = Invalid minimum range value.  The value must be a positive integer less than the maximum value.
-_UI_REGEX_WIZARD_MISSING_MIN_ERROR_SUFFIX = Invalid minimum range value.  A minimum range must be specified if a maximum range is specified.
-_UI_REGEX_WIZARD_INVALID_MAX_ERROR_SUFFIX = Invalid maximum range value.  The value must be a positive integer greater than the minimum value.
-_UI_REGEX_WIZARD_INVALID_REPEAT_ERROR_SUFFIX = Invalid repeat value.  The value must be a positive integer.
-_UI_REGEX_WIZARD_INVALID_SELECTION_ERROR = Nothing is currently selected.  Either make a selection or choose a different token. 
-_UI_REGEX_WIZARD_TOKEN_LABEL = Token contents:
-_UI_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX_LABEL = Auto escape
-_UI_REGEX_WIZARD_OCCURENCE_LABEL = Occurrence
-! Instructions for translators: The following label is used in a phrase to identify a range of values.
-! For example:  5 to 10.
-! The values are text fields that are initially blank so the user has to enter in values
-! For example:   _______ to ________
-_UI_REGEX_WIZARD_TO_LABEL = to
-_UI_REGEX_WIZARD_ADD_BUTTON_LABEL = Add 
-_UI_REGEX_WIZARD_CURRENT_REGEX_LABEL = Current regular expression:
-_UI_TOOLTIP_REGEX_WIZARD_TERMS = Content of new token
-_UI_TOOLTIP_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX = Insert escape characters to match metacharacter literals (e.g. converts \"*\" to \"\\*\")
-_UI_TOOLTIP_REGEX_WIZARD_ADD_BUTTON = Add this token to the regular expression
-_UI_TOOLTIP_REGEX_WIZARD_CURRENT_REGEX = The current regular expression
-_UI_TOOLTIP_REGEX_WIZARD_REPEAT = The number of times that the token must occur.
-_UI_TOOLTIP_REGEX_WIZARD_MIN = The minimum number of times that the token can occur.
-_UI_TOOLTIP_REGEX_WIZARD_MAX = The maximum number of times that the token can occur.
-_UI_TOOLTIP_REGEX_WIZARD_CARET_LABEL = The location where the new token will be inserted.
-_UI_REGEX_WIZARD_TESTING_PAGE_TITLE = Test Regular Expression
-_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION = To test the regular expression, enter sample text that you wish to match.  The success of the match will be indicated above.
-_UI_REGEX_WIZARD_REGEX_LABEL = Regular expression: 
-_UI_REGEX_WIZARD_SAMPLE_TEXT =  Sample text: 
-_UI_REGEX_WIZARD_MATCHES = The text matches the regular expression.
-_UI_REGEX_WIZARD_DOES_NOT_MATCH = The text does not match the regular expression.
-_UI_REGEX_WIZARD_TERM_ANY_CHAR = Any character
-_UI_REGEX_WIZARD_TERM_ALPHANUMERIC_CHAR = Alphanumeric character
-_UI_REGEX_WIZARD_TERM_WHITESPACE = Whitespace
-_UI_REGEX_WIZARD_TERM_DIGIT = Digit
-_UI_REGEX_WIZARD_TERM_UPPER = Upper case
-_UI_REGEX_WIZARD_TERM_LOWER = Lower case
-_UI_REGEX_WIZARD_TERM_SELECTION = Current selection
-_UI_REGEX_WIZARD_QUANTIFIER_SINGLE = Just once
-_UI_REGEX_WIZARD_QUANTIFIER_STAR = Zero or more
-_UI_REGEX_WIZARD_QUANTIFIER_PLUS = One or more
-_UI_REGEX_WIZARD_QUANTIFIER_OPTIONAL = Optional
-_UI_REGEX_WIZARD_QUANTIFIER_REPEAT = Repeat
-_UI_REGEX_WIZARD_QUANTIFIER_RANGE = Range
-
-!
-! Select Include File Wizard
-_UI_LABEL_INCLUDE_URL_FILE    = Select schema from:
-_UI_RADIO_URL                 = HTTP
-_UI_RADIO_FILE                = Workbench projects
-_UI_WIZARD_INCLUDE_FILE_TITLE = Include Another Schema
-_UI_WIZARD_INCLUDE_FILE_DESC  = Select another schema from workbench projects or from HTTP.
-_UI_LABEL_URL                 = URL:
-_UI_URL_START_WITH            = The URL must start with http://
-_UI_SPECIFY_URL               = Please specify a URL
-
-!
-! Enumerations Dialog
-_UI_ENUMERATIONS_DIALOG_TITLE = Add Enumerations
-_UI_LABEL_DELIMITER_CHAR      = &Delimiter characters:
-_UI_LABEL_PRESERVE_WHITESPACE = &Preserve leading and trailing whitespace
-
-_UI_ACTION_DELETE_ENUMERATION = Delete Enumeration
-
-!
-! Validate Schema 
-!
-_UI_DIALOG_XML_SCHEMA_INVALID_TITLE  = Validation Failed
-_UI_DIALOG_XML_SCHEMA_VALID_TITLE    = Validation Succeeded
-_UI_DIALOG_XML_SCHEMA_VALID_TEXT     = The XML schema file is valid.
-_UI_DIALOG_XML_SCHEMA_LIMITE_EXCEEDED  = The XML schema file is not valid.  The message limit for the Tasks view has been exceeded.  Please increase the limit and try again.
-
-!
-! Combo-box choices 
-!
-! NOTE TO TRANSLATOR: Do not translate following 10 lines
-_UI_COMBO_QUALIFIED             = qualified
-_UI_COMBO_UNQUALIFIED           = unqualified
-_UI_COMBO_EXTENSION             = extension
-_UI_COMBO_RESTRICTION           = restriction
-_UI_COMBO_ALL                   = all
-_UI_COMBO_TRUE                  = true
-_UI_COMBO_FALSE                 = false
-_UI_COMBO_LAX                   = lax
-_UI_COMBO_SKIP                  = skip
-_UI_COMBO_STRICT                = strict
-
-! Generate DTD - pass as title and description for wizard page
-_UI_GENERATE_DTD_TITLE          = Generate DTD
-_UI_GENERATE_DTD_DESCRIPTION    = Generate a DTD from the selected XML schema file.
-
-! Generate DDL - pass as title and description for wizard page
-_UI_GENERATE_DDL_TITLE          = Generate DDL
-_UI_GENERATE_DDL_DESCRIPTION    = Generate DDL from the selected XML schema file.
-
-_UI_XML_SCHEMA_VALIDATOR            = XML Schema Validator
-
-! Generation from the Schema model - pre-condition check
-_UI_DIALOG_TITLE_GRAMMAR_ERROR      = Invalid Grammar
-_UI_DIALOG_INFO_SCHEMA_INVALID      = The schema file contains errors. Open it in the XML Schema editor and validate it for details.
-_UI_DIALOG_TITLE_NO_GLOBAL_ELEMENTS = No Global Elements
-_UI_DIALOG_INFO_NO_GLOBAL_ELEMENTS  = The selected schema has no global elements. Global elements are required to generate anything from an XML schema.
-
-! Section title for other attributes
-_UI_SECTION_ADVANCED_ATTRIBUTES   = Advanced
-
-! For undo action menus
-! Note to Translators: For the following "Change" phrases,
-! maxOccurs, minOccurs, lang, xpath are keywords so please
-! do no translate them.  These are for the undo action menus.
-! For example, if the user makes a change in the name of an
-! element, then the undo action would be Undo Element Name Change
-_UI_NAMESPACE_CHANGE           = Namespace Change
-_UI_PROCESSCONTENTS_CHANGE     = Process Contents Change
-_UI_MAXOCCURS_CHANGE           = maxOccurs Change
-_UI_MINOCCURS_CHANGE           = minOccurs Change
-_UI_SOURCE_ATTRIBUTE_CHANGE    = Source Change
-_UI_COMMENT_CHANGE             = Comment Change
-_UI_PREFIX_CHANGE              = Prefix Change
-_UI_ATTRIBUTEGROUP_REF_CHANGE  = Attribute Group Reference Change
-_UI_ATTRIBUTEGROUP_NAME_CHANGE = Attribute Group Name Change
-_UI_ATTRIBUTE_FIXED_CHANGE     = Attribute Fixed Change
-_UI_ATTRIBUTE_DEFAULT_CHANGE   = Attribute Default Change
-_UI_ATTRIBUTE_NAME_CHANGE      = Attribute Name Change
-_UI_ATTRIBUTE_VALUE_CHANGE     = Attribute Value Change
-_UI_ATTRIBUTE_USE_CHANGE       = Attribute Use Change
-_UI_ATTRIBUTE_FORM_CHANGE      = Attribute Form Change
-_UI_COMPLEXTYPE_NAME_CHANGE    = Complex Type Name Change
-_UI_COMPLEXTYPE_ABSTRACT_CHANGE = Complex Type Abstract Change
-_UI_COMPLEXTYPE_MIXED_CHANGE   = Complex Type Mixed Change
-_UI_COMPLEXTYPE_BLOCK_CHANGE   = Complex Type Block Change
-_UI_COMPLEXTYPE_FINAL_CHANGE   = Complex Type Final Change
-_UI_DOCUMENTATION_SOURCE_CHANGE = Documentation Source Change
-_UI_DOCUMENTATION_LANG_CHANGE   = Documentation lang Change
-_UI_DOCUMENTATION_COMMENT_CHANGE = Documentation Comment Change
-_UI_ELEMENT_NAME_CHANGE          = Element Name Change
-_UI_ELEMENT_VALUE_CHANGE         = Element Value Change
-_UI_ELEMENT_TYPE_CHANGE          = Element Type Change
-_UI_ENUM_VALUE_CHANGE            = Enum Value Change
-_UI_FIELD_XPATH_CHANGE           = Field xpath Change
-_UI_GROUP_REF_CHANGE             = Group Reference Change
-_UI_GROUP_SCOPE_CHANGE           = Content Model Change
-_UI_GROUP_NAME_CHANGE            = Group Name Change
-_UI_IMPORT_CHANGE                = Import Change
-_UI_KEY_NAME_CHANGE              = Key Name Change
-_UI_KEYREF_NAME_CHANGE           = Key Reference Name Change
-! Note to translators
-! For the following item, Refer is the keyref attribute to refer to some other key
-_UI_KEYREF_REFER_CHANGE          = Key Reference Refer Change
-_UI_NOTATION_NAME_CHANGE         = Notation Name Change
-_UI_NOTATION_PUBLIC_CHANGE       = Notation Public Change
-_UI_NOTATION_SYSTEM_CHANGE       = Notation System Change
-_UI_PATTERN_VALUE_CHANGE         = Pattern Value Change
-_UI_SCHEMA_VERSION_CHANGE        = Schema Version Change
-_UI_SCHEMA_LANG_CHANGE           = Schema lang Change
-_UI_SELECTOR_XPATH_CHANGE        = Selector xpath Change
-_UI_TYPE_CHANGE                  = Type Change
-_UI_DERIVEDBY_CHANGE             = Derivation Change
-_UI_FACET_CHANGE                 = Facet Change
-_UI_SIMPLETYPE_NAME_CHANGE       = SimpleType Name Change
-_UI_UNIQUE_NAME_CHANGE           = Unique Name Change
-_UI_SCHEMA_ATTRIBUTEFORMDEFAULT_CHANGE = Attribute Form Default Change
-_UI_SCHEMA_ELEMENTFORMDEFAULT_CHANGE = Element Form Default Change
-_UI_SCHEMA_BLOCKDEFAULT_CHANGE   = Block Default Change
-_UI_SCHEMA_FINALDEFAULT_CHANGE   = Final Default Change
-_UI_ELEMENT_SUBSTITUTIONGROUP_CHANGE = Substitution Group Change
-_UI_ELEMENT_FORM_CHANGE          = Form Change
-_UI_ELEMENT_BLOCK_CHANGE         = Block Change
-_UI_ELEMENT_FINAL_CHANGE         = Final Change
-_UI_ELEMENT_ABSTRACT_CHANGE      = Abstract Change
-_UI_ELEMENT_NILLABLE_CHANGE      = Nillable Change
-_UI_TARGETNAMESPACE_CHANGE       = Target Namespace Change
-
-! Window Headings for Flat View
-_UI_PAGE_HEADING_ANYATTRIBUTE = Any Attribute
-_UI_PAGE_HEADING_ANYELEMENT   = Any Element
-_UI_PAGE_HEADING_APPINFO            = AppInfo
-_UI_PAGE_HEADING_ATTRIBUTEGROUP_REF = Attribute Group Reference
-_UI_PAGE_HEADING_ATTRIBUTEGROUP     = Attribute Group
-_UI_PAGE_HEADING_ATTRIBUTE_REF      = Attribute Reference
-_UI_PAGE_HEADING_ATTRIBUTE          = Attribute
-_UI_PAGE_HEADING_COMPLEXTYPE        = Complex Type
-_UI_PAGE_HEADING_DOCUMENTATION      = Documentation
-_UI_PAGE_HEADING_ELEMENT     = Element
-_UI_PAGE_HEADING_ELEMENT_REF = Element Reference
-_UI_PAGE_HEADING_ENUM        = Enumeration
-_UI_PAGE_HEADING_FIELD       = Field
-_UI_PAGE_HEADING_GROUP_REF   = Group Reference
-_UI_PAGE_HEADING_CONTENTMODEL  = Content Model
-_UI_PAGE_HEADING_GROUP         = Group
-_UI_PAGE_HEADING_IMPORT        = Import
-_UI_PAGE_HEADING_INCLUDE       = Include
-_UI_PAGE_HEADING_KEYREF        = Key Reference
-_UI_PAGE_HEADING_KEY           = Key
-_UI_PAGE_HEADING_NOTATION      = Notation
-_UI_PAGE_HEADING_PATTERN       = Pattern
-_UI_PAGE_HEADING_REDEFINE      = Redefine
-_UI_PAGE_HEADING_SCHEMA        = Schema
-_UI_PAGE_HEADING_SELECTOR      = Selector
-_UI_PAGE_HEADING_LIST          = List
-_UI_PAGE_HEADING_UNION         = Union
-_UI_PAGE_HEADING_SIMPLECONTENT = Simple Content
-_UI_PAGE_HEADING_COMPLEXCONTENT = Complex Content
-_UI_PAGE_HEADING_RESTRICTION   = Restriction
-_UI_PAGE_HEADING_EXTENSION     = Extension
-_UI_PAGE_HEADING_SIMPLETYPE    = Simple Type
-_UI_PAGE_HEADING_UNIQUE        = Unique
-_UI_PAGE_HEADING_REFERENCE     = reference
-
-!
-! Graph page
-!
-_UI_GRAPH_SIMPLE_TYPES         = Simple Types
-_UI_GRAPH_COMPLEX_TYPES        = Complex Types
-_UI_GRAPH_GROUPS               = Groups
-_UI_GRAPH_GLOBAL_ATTRIBUTES    = Global Attributes
-_UI_GRAPH_GLOBAL_ELEMENTS      = Global Elements
-_UI_GRAPH_XSDSCHEMA            = Schema
-_UI_GRAPH_XSDSCHEMA_NO_NAMESPACE = (no target namespace specified)
-_UI_GRAPH_XSDCOMPLEXTYPEDEFINITION = XSD Complex Type Definition:
-_UI_GRAPH_XSDMODELGROUP        = XSD Model Group
-_UI_GRAPH_XSDPARTICLE          = XSD Particle
-_UI_GRAPH_VIEW_NOT_AVAILABLE   = View is not available for selected object.
-_UI_GRAPH_UNKNOWN_OBJECT       = Unknown object
-
-! Additional Categories
-_UI_GRAPH_TYPES                = Types
-_UI_GRAPH_ELEMENTS             = Elements
-_UI_GRAPH_ATTRIBUTES           = Attributes
-_UI_GRAPH_ATTRIBUTE_GROUPS     = Attribute Groups
-_UI_GRAPH_NOTATIONS            = Notations
-_UI_GRAPH_IDENTITY_CONSTRAINTS = Identity Constraints
-_UI_GRAPH_ANNOTATIONS          = Annotations
-_UI_GRAPH_DIRECTIVES           = Directives
-
-! For Union MemberTypes Dialog
-_UI_LABEL_SELECT_MEMBERTYPES   = Select from the available types and add to the memberTypes list
-_UI_LABEL_MEMBERTYPES_CHANGE   = Member Types Change
-_UI_LABEL_MEMBERTYPES_VALUE    = Member Types Value:
-_UI_LABEL_MEMBERTYPES          = Member types:
-
-_UI_LABEL_VARIETY_CHANGE       = Variety Change
-
-_UI_LABEL_FIXEDORDEFAULT_VALUE = Fixed/Default Value
-
-_UI_LABEL_ITEM_TYPE_CHANGE     = Item Type Change
-
-_UI_LABEL_AVAILABLE_TYPES      = Available Types
-
-_UI_LABEL_INCLUDE_CHANGE       = Include Change
-
-_UI_LABEL_ITEM_TYPE            = Item type:
-_UI_LABEL_BASE_TYPE            = Base Type
-_UI_LABEL_TYPE                 = Type
-_UI_LABEL_MODEL_GROUP          = Model Group
-
-_UI_LABEL_ABSENT               = absent
-
-_UI_WARNING_RESET_ATTRGRP_REF  = Reset attribute group reference <{0}>
-_UI_WARNING_REMOVE_ATTRGRP_REF = Remove attribute group reference <{0}>
-_UI_WARNING_RESET_ATTR_REF     = Reset attribute reference <{0}>
-_UI_WARNING_REMOVE_ATTR_REF    = Remove attribute reference <{0}>
-
-!======================================================================================
-!
-! Here is the list of Error string that have message IDs - make sure they are unique
-!  Range for XSDEditor messageIDs: IWAX1001E - IWAX1200E
-!
-!======================================================================================
-! These three errors appear in the select include wizard
-! The name of the file will be substituted in
-_UI_DIFFERENT_NAME_SPACE  = {0} is in a different namespace 
-_UI_SAME_NAME_SPACE       = {0} is in the same namespace
-_UI_INCORRECT_XML_SCHEMA  = {0} is an invalid XML schema file
-
-_ERROR_SCHEMA_NOT_EXIST         = IWAX1003E does not exist.
-_ERROR_LABEL_INVALID_PREFIX     = IWAX1004E Invalid prefix. A prefix must not be empty or contain any space.
-
-! The name of the file will be substituted in
-_ERROR_SCHEMA_NAME_THE_SAME  = IWAX1005E {0} is the current schema. A schema cannot include itself. Reset to the last valid schema.
-
-_ERROR_XSD_GENERATION                = IWAX1006E Error generating XML schema
-_ERROR_NO_CONTAINER                  = IWAX1007E No folder selected
-_ERROR_NO_FILE_NAME                  = IWAX1008E No file name provided
-_ERROR_FILENAME_MUST_END_XSD         = IWAX1011E The file name must end in .xsd
-
-
-!
-! For schema that has too many errors, an extended message. 
-!
-_ERROR_DIALOG_XML_SCHEMA_INVALID_TEXT  = IWAX100d9E The XML schema file is not valid.  
-_ERROR_MORE_ERRORS                    = There are more errors in the schema than are displayed in the Tasks view.  Correct the first {0} errors and re-validate the schema file.
-
-! DDL Generation Failed Dialog
-_UI_DIALOG_DDL_GEN_FAILED_TITLE     = DDL Generation Failed
-_ERROR_DIALOG_DDL_NOT_GENEREATED    = IWAX1010E DDL has not been generated
-_UI_DIALOG_DDL_GEN_FAILED_REASON    = The selected schema has no global elements
-_UI_DIALOG_DDL_GEN_FAILED_REASON2   = None of the global elements in the schema have a complex type or they reference complex types that cannot be found.
-
-_EXC_OPEN_XSD = IWAX1011E Cannot open XML Schema editor
-
-_ERROR_LABEL_PREFIX_EXISTS     = IWAX1012E Prefix already exists
-
-_ERROR_REMOVE_LOCAL_SIMPLETYPE  = IWAX1013E Remove local simple type from extension
-
-_WARN_INVALID_TARGET_NAMESPACE = IWAX1014E The target namespace is not well-formed
-
-_ERROR_TARGET_NAMESPACE_AND_PREFIX = IWAX1015E A target namespace must be associated with a prefix
-
-
-_UI_CONTAINMENT = Containment
-_UI_INHERITANCE = Inheritance
-_UI_SUBSTITUTION_GROUPS = Substitution Groups
-_UI_ANONYMOUS = **anonymous**
-_UI_VALUE = Value
-_UI_ANY_ELEMENT = Any Element
-_UI_SORT = Sort
-
-_UI_ACTION_EDIT_NAMESPACES = Edit Namespaces...
-
-
-_UI_CreateChild_text = {0}
-_UI_CreateChild_text2 = {1} {0}
-_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
-_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
-_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
-
-!======================================================================================
-!
-! Used by org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView
-!
-!======================================================================================
-_UI_LABEL_SOURCE_FILES   = Workbench Files
-_UI_LABEL_SELECTED_FILES = Selected Files
-
-_UI_IMPORT_BUTTON          = Import Files...
-_UI_IMPORT_BUTTON_TOOL_TIP = Import files from file system
-
-
-!======================================================================================
-!
-! refactoring
-!
-!======================================================================================
-refactoringActionSet.label=Refactor
-refactoringActionSet.description=XSD Editor refactoring actions
-refactoring.menu.label=Refactor
-refactoring.renameAction.label=Re&name...
-context.text.editor.xsd.name=Editing XSD context
-command.xsd.refactor.rename.element.name=Rename XSD element
-command.xsd.refactor.rename.element.description=Rename XSD element
-command.xsd.refactor.makeElementGlobal.element.name=Make local element global
-command.xsd.refactor.makeElementGlobal.element.description=Promotes local element to global level and replaces its references
-command.xsd.refactor.makeTypeGlobal.element.name=Make anonymous type global
-command.xsd.refactor.makeTypeGlobal.element.description=Promotes anonymous type to global level and replaces its references
-
-! Copied from sse
-23concat_EXC_=Resource {0} does not exist.
-32concat_EXC_=Editor could not be open on {0}
-An_error_has_occurred_when1_ERROR_=An error has occurred when initializing the input for the the editor's source page.
-OpenFileFromSource.label=Op&en Selection
-OpenFileFromSource.tooltip=Open an editor on the selected link
-OpenFileFromSource.image=
-OpenFileFromSource.description=Open an editor on the selected link
-
-AddBookmark.label=Add Boo&kmark...
-SelectRuler.label=Select Ruler
-
-_ZERO_OR_MORE = Zero or More
-_ZERO_OR_ONE  = Zero or One
-_ONE_OR_MORE  = One or More
-
-# For translators, as in structured DOM tree
-_UI_LABEL_STRUCTURED           = Structured
-
-_UI_LABEL_MOVE   				       = Move
-_UI_LABEL_RENAME 				       = Rename
-_UI_LABEL_TARGETNAMESPACE_CHANGE       = Target Namespace Change
-_INFO_RESET_ATTRIBUTE_GROUP_REFERENCE  = Reset attribute group reference
-_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE = Remove attribute group reference
diff --git a/bundles/org.eclipse.wst.xsd.ui/plugin.xml b/bundles/org.eclipse.wst.xsd.ui/plugin.xml
deleted file mode 100644
index 564798d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/plugin.xml
+++ /dev/null
@@ -1,299 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
-	<extension point="org.eclipse.ui.editors">
-		<editor
-			name="%_UI_EDITOR_NAME"
-			default="true"
-			icon="icons/XSDFile.gif"
-			contributorClass="org.eclipse.wst.xsd.ui.internal.XSDActionBarContributor"
-			class="org.eclipse.wst.xsd.ui.internal.XSDEditor"
-			id="org.eclipse.wst.xsd.ui.XSDEditor">
-            <contentTypeBinding
-                contentTypeId="org.eclipse.wst.xsd.core.xsdsource" />
-                
-		</editor>
-	</extension>
-
-	<extension point="org.eclipse.ui.editorActions">
-        <editorContribution
-            targetID="org.eclipse.wst.xsd.core.xsdsource.source"
-            id="org.eclipse.wst.xsd.core.xsdsource.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.newWizards">
-		<wizard
-			id="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard"
-			name="%_UI_WIZARD_NEW_XSD"
-			class="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard"
-			category="org.eclipse.wst.XMLCategory"
-			icon="icons/XSDFile.gif">
-			<description>%_UI_CREATE_A_NEW_SCHEMA</description>
-			<selection class="org.eclipse.core.resources.IResource" />
-		</wizard>
-	</extension>
-
-	<extension point="org.eclipse.ui.preferencePages">
-		<page
-			name="%_UI_XML_SCHEMA_PREFERENCE"
-			category="org.eclipse.wst.sse.ui.internal.provisional.preferences"
-			class="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage"
-			id="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage">
-		</page>
-	</extension>
-	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
-		<provisionalDefinition
-			type="preferencepages"
-			value="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage"
-			target="org.eclipse.wst.xsd.ui.internal.XSDEditor.source" />
-		<sourceViewerConfiguration
-			class="org.eclipse.wst.xsd.ui.internal.StructuredTextViewerConfigurationXSD"
-			target="org.eclipse.wst.xsd.core.xsdsource" />
-		<contentOutlineConfiguration
-			class="org.eclipse.wst.xsd.ui.internal.XSDContentOutlineConfiguration"
-			target="org.eclipse.wst.xsd.core.xsdsource" />
-	</extension>
-
-	<!-- ==================================================== -->
-	<!-- Support help on the tags                             -->
-	<!-- ==================================================== -->
-	<!--   <extension
-		point="org.eclipse.wst.xml.core.internal.contentmodel.annotationFiles">
-		<annotationFile
-		location="/w3c/schemaForCodeAssist-annotations.xml"
-		publicId="http://www.w3.org/2001/XMLSchema">
-		</annotationFile>
-		</extension>
-	-->
-	<extension
-		point="org.eclipse.wst.common.ui.properties.propertyContributor">
-		<propertyContributor
-			contributorId="org.eclipse.wst.xsd.ui.internal.XSDEditor"
-			sectionDescriptorProvider="org.eclipse.wst.xsd.ui.internal.properties.section.XSDSectionDescriptorProvider"
-			labelProvider="org.eclipse.wst.xsd.ui.internal.properties.section.XSDSectionLabelProvider">
-			<propertyCategory category="general"></propertyCategory>
-			<propertyCategory category="namespace"></propertyCategory>
-			<propertyCategory category="other"></propertyCategory>
-			<propertyCategory category="attributes"></propertyCategory>
-			<propertyCategory category="enumerations">
-			</propertyCategory>
-			<propertyCategory category="documentation">
-			</propertyCategory>
-			<propertyCategory category="facets"></propertyCategory>
-		</propertyContributor>
-	</extension>
-	<extension
-		point="org.eclipse.wst.common.ui.properties.propertyTabs">
-		<propertyTabs
-			contributorId="org.eclipse.wst.xsd.ui.internal.XSDEditor">
-			<propertyTab
-				label="%_UI_LABEL_GENERAL"
-				category="general"
-				id="org.eclipse.wst.xmlwebservices.general">
-			</propertyTab>
-			<propertyTab
-				label="%_UI_LABEL_NAMESPACE"
-				category="namespace"
-				afterTab="org.eclipse.wst.xmlwebservices.general"
-				id="org.eclipse.wst.xmlwebservices.namespace">
-			</propertyTab>
-			<propertyTab
-				label="%_UI_LABEL_OTHER"
-				category="other"
-				id="org.eclipse.wst.xmlwebservices.other">
-			</propertyTab>
-			<propertyTab
-				label="%_UI_LABEL_ATTRIBUTES"
-				category="attributes"
-				id="org.eclipse.wst.xmlwebservices.attributes">
-			</propertyTab>
-			<propertyTab
-				label="%_UI_LABEL_ENUMERATIONS"
-				category="enumerations"
-				id="org.eclipse.wst.xmlwebservices.enumerations">
-			</propertyTab>
-			<propertyTab
-				label="%_UI_LABEL_DOCUMENTATION"
-				category="documentation"
-				id="org.eclipse.wst.xmlwebservices.documentation">
-			</propertyTab>
-			<propertyTab
-				label="%_UI_SECTION_ADVANCED_ATTRIBUTES"
-				category="facets"
-				id="org.eclipse.wst.xmlwebservices.facets">
-			</propertyTab>
-		</propertyTabs>
-	</extension>
-
-
-	<extension
-		point="org.eclipse.wst.xml.core.catalogContributions">
-		<catalogContribution id="default">
-		
-			<uri
-				name="http://www.w3.org/2001/XMLSchema"
-				uri="platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/XMLSchema.xsd" />
-			<system
-				systemId="http://www.w3.org/2001/xml.xsd"
-				uri="platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd"/>				
-		</catalogContribution>
-	</extension>
-
-
-	<!-- intialize xsd reconcile validator -->
-	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
-		<validator
-			scope="total"
-			class="org.eclipse.wst.xsd.ui.internal.validation.DelegatingSourceValidatorForXSD"
-			id="org.eclipse.wst.xsd.ui.internal.validation.DelegatingSourceValidatorForXSD">
-			<contentTypeIdentifier
-				id="org.eclipse.wst.xsd.core.xsdsource">
-				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT">
-				</partitionType>
-			</contentTypeIdentifier>
-		</validator>
-	</extension>
-
-	<extension point="org.eclipse.ui.contexts">
-		<context
-			id="org.eclipse.wst.xsd.ui.text.editor.context"
-			name="%context.text.editor.xsd.name"
-			parentId="org.eclipse.ui.textEditorScope" />
-	</extension>
-
-	<extension point="org.eclipse.ui.commands">
-		<command
-			name="%command.xsd.refactor.rename.element.name"
-			description="%command.xsd.refactor.rename.element.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.xsd.ui.refactor.rename.element">
-		</command>
-		<keyBinding
-			keySequence="Alt+Shift+R"
-			contextId="org.eclipse.wst.xsd.ui.text.editor.context"
-			commandId="org.eclipse.wst.xsd.ui.refactor.rename.element"
-			keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration">
-		</keyBinding>
-	</extension>
-
-	<extension point="org.eclipse.ui.commands">
-		<command
-			name="%command.xsd.refactor.makeElementGlobal.element.name"
-			description="%command.xsd.refactor.makeElementGlobal.element.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.xsd.ui.refactor.makeElementGlobal">
-		</command>
-	</extension>
-
-	<extension point="org.eclipse.ui.commands">
-		<command
-			name="%command.xsd.refactor.makeTypeGlobal.element.name"
-			description="%command.xsd.refactor.makeTypeGlobal.element.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal">
-		</command>
-	</extension>
-
-	<!-- this extension point is used to augment the ModelQuery to provide schema specific guided editing -->
-	<extension point="org.eclipse.wst.xml.core.modelQueryExtensions">
-		<modelQueryExtension
-			class="org.eclipse.wst.xsd.ui.internal.text.XSDModelQueryExtension"
-			contentType="org.eclipse.wst.xsd.core.xsdsource">
-		</modelQueryExtension>
-	</extension>
-
-	<!--extension
-		point="org.eclipse.ltk.core.refactoring.renameParticipants">
-		<renameParticipant
-		name="%xsd.resource.rename.participant.name"
-		class="org.eclipse.wst.xsd.ui.internal.refactor.rename.XSDResourceRenameParticipant"
-		id="org.eclipse.wst.xsd.ui.refactoring.XSDResourceRenameParticipant">
-		<enablement>
-		<with
-		variable="element">
-		<instanceof
-		value="org.eclipse.core.resources.IResource">
-		</instanceof>
-		</with>
-		</enablement>
-		</renameParticipant>
-		</extension-->
-
-	<!-- 
-		The following extension to the file context menu is temporary until resource 
-		navigator will provide allow to extend refactor menu        
-	-->
-	<!--
-		<extension point="org.eclipse.ui.popupMenus">
-		<objectContribution
-		objectClass="org.eclipse.core.resources.IFile"
-		nameFilter="*.xsd"
-		id="org.wst.xsd.ui.rename">
-		<menu id="refactorXSDResource" path="additions" label="%refactoring.menu.label">
-		<separator name="refactor"/>
-		</menu>
-		<action
-		label="%refactoring.renameAction.label"
-		menubarPath="refactorXSDResource/refactor"
-		class="org.eclipse.wst.xsd.ui.internal.refactor.actions.RenameResourceActionDelegate"
-		enablesFor="1"
-		id="org.eclipse.wst.xsd.ui.refactoring.actions.RenameResource">
-		</action>
-		</objectContribution>
-		</extension>
-	-->
-	
-	<!-- ====================================================== -->
-	<!-- Define Assign Validate action on .xsd file             -->
-	<!-- ====================================================== -->
-	<extension point="org.eclipse.ui.popupMenus">
-		<objectContribution
-			objectClass="org.eclipse.core.resources.IFile"
-			nameFilter="*.xsd"
-			id="org.eclipse.wst.xsd.validation.xsdvalidationaction">
-			<action
-				label="%_UI_MENU_VALIDATE_XML"
-				class="org.eclipse.wst.xsd.ui.internal.validation.ValidateSchemaActionDelegate"
-				enablesFor="1"
-				id="org.eclipse.wst.xsd.ui.internal.validation.ValidateSchemaActionDelegate">
-			</action>
-		</objectContribution>
-	</extension>
-
-	<!-- ====================================================== -->
-	<!-- Register the XSD validator with the validation 		-->
-	<!-- framework. 										    -->
-	<!-- ====================================================== -->
-	<extension
-		id="xsdValidator"
-		name="%_UI_XML_SCHEMA_VALIDATOR"
-		point="org.eclipse.wst.validation.validator">
-		<validator>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				caseSensitive="false"
-				nameFilter="*.xsd">
-			</filter>
-			<helper
-				class="org.eclipse.wst.xml.core.internal.validation.core.Helper">
-			</helper>
-			<run
-				class="org.eclipse.wst.xsd.ui.internal.validation.Validator">
-			</run>
-		</validator>
-	</extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java
deleted file mode 100644
index 92a2027..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor;
-
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
-
-public class Checks {
-	
-	public static RefactoringStatus checkName(String name) {
-		RefactoringStatus result= new RefactoringStatus();
-		if ("".equals(name)) //$NON-NLS-1$
-			return RefactoringStatus.createFatalErrorStatus("RefactoringMessages.Checks_Choose_name"); 
-		return result;
-	}
-	
-	public static boolean isAlreadyNamed(RefactoringComponent element, String name){
-		return name.equals(element.getName());
-	}
-	
-	public static RefactoringStatus checkComponentName(String name) {
-		RefactoringStatus result= new RefactoringStatus();
-		if (!NameValidator.isValid(name)) //$NON-NLS-1$
-			return RefactoringStatus.createFatalErrorStatus("RefactoringMessages.Checks_Choose_name"); 
-
-		return result;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/INameUpdating.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/INameUpdating.java
deleted file mode 100644
index 76adc4d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/INameUpdating.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Created on Feb 16, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.xsd.ui.internal.refactor;
-
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-
-/**
- * @author ebelisar
- */
-public interface INameUpdating {
-
-	public abstract void setNewElementName(String newName);
-	public abstract String getNewElementName();
-	public abstract String getCurrentElementName();
-    public abstract RefactoringStatus checkNewElementName(String newName);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IReferenceUpdating.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IReferenceUpdating.java
deleted file mode 100644
index 2b65694..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IReferenceUpdating.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor;
-
-public interface IReferenceUpdating {
-
-	/**
-	 * Checks if this refactoring object is capable of updating references to the renamed element.
-	 */
-	public boolean canEnableUpdateReferences();
-
-	/**
-	 * If <code>canUpdateReferences</code> returns <code>true</code>, then this method is used to
-	 * inform the refactoring object whether references should be updated.
-	 * This call can be ignored if  <code>canUpdateReferences</code> returns <code>false</code>.
-	 */	
-	public void setUpdateReferences(boolean update);
-
-	/**
-	 * If <code>canUpdateReferences</code> returns <code>true</code>, then this method is used to
-	 * ask the refactoring object whether references should be updated.
-	 * This call can be ignored if  <code>canUpdateReferences</code> returns <code>false</code>.
-	 */		
-	public boolean getUpdateReferences();
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringComponent.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringComponent.java
deleted file mode 100644
index 8f4dc58..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringComponent.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor;
-
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-
-public interface RefactoringComponent
-{
-	/**
-	 * @return the name of the component that is refactored.  E.g. "foo"
-	 */
-	public String getName();
-	
-	/**
-	 * @return the namespace of the component that is refactored.  E.g. "http://foo"
-	 */
-	public String getNamespaceURI();
-	
-	/**
-	 * The basic DOM element is used by the refactoring processor/participant to get 
-	 * access to the file location.
-	 * 
-	 * @return the Structured Source Editor XML DOM element object that underlines the 
-	 * combonent being refactore.
-	 * 
-	 * @see IDOMElement 
-	 */
-	public IDOMElement getElement();
-	
-	/** 
-	 * @return the qualified name of the type of the refactored component. 
-	 * 
-	 * <p>
-	 * A qualified name consists of a local name and a namespace.  
-	 * E.g. "complexType"-local name, "http://www.w3.org/2001/XMLSchema"-namespace
-	 * </p>
-	 * 
-	 * @see QualifiedName
-	 */
-	public QualifiedName getTypeQName();
-		
-	/** 
-	 * The model object may be required to be given to the refactored participants as is or 
-	 * other objects could be derived from it.
-	 * 
-	 * @return the principal object being refactored, such as an instance of WSDLElement or 
-	 * XSDNamedComponent
-	 */
-	public Object getModelObject();
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java
deleted file mode 100644
index 7b56d8d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class RefactoringMessages {
-
-	private static final String RESOURCE_BUNDLE= "org.eclipse.wst.xsd.ui.internal.refactor.messages";//$NON-NLS-1$
-
-	private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
-	private RefactoringMessages() {
-	}
-
-	public static String getString(String key) {
-		try {
-			return fgResourceBundle.getString(key);
-		} catch (MissingResourceException e) {
-			return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
-		}
-	}
-	
-	public static String[] getStrings(String keys[]) {
-		String[] result= new String[keys.length];
-		for (int i= 0; i < keys.length; i++) {
-			result[i]= getString(keys[i]);
-		}
-		return result;
-	}
-	
-	public static String getFormattedString(String key, Object arg) {
-		return getFormattedString(key, new Object[] { arg });
-	}
-	
-	public static String getFormattedString(String key, Object[] args) {
-		return MessageFormat.format(getString(key), args);	
-	}	
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Startup.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Startup.java
deleted file mode 100644
index 4a3fc53..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Startup.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor;
-
-
-import org.eclipse.ui.IStartup;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-
-public class Startup implements IStartup {
-
-	public void earlyStartup() {
-		XSDEditorPlugin.getPlugin();
-
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/TextChangeManager.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/TextChangeManager.java
deleted file mode 100644
index 69ff744..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/TextChangeManager.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ltk.core.refactoring.TextChange;
-import org.eclipse.ltk.core.refactoring.TextFileChange;
-
-/**
- * A <code>TextChangeManager</code> manages associations between <code>IFile</code> and <code>TextChange</code> objects.
- */
-public class TextChangeManager {
-	
-	private Map fMap= new HashMap(10); // IFile -> TextChange
-	
-	private final boolean fKeepExecutedTextEdits;
-	
-	public TextChangeManager() {
-		this(false);
-	}
-
-	public TextChangeManager(boolean keepExecutedTextEdits) {
-		fKeepExecutedTextEdits= keepExecutedTextEdits;
-	}
-	
-	/**
-	 * Adds an association between the given file and the passed
-	 * change to this manager.
-	 * 
-	 * @param file the file (key)
-	 * @param change the change associated with the file
-	 */
-	public void manage(IFile file, TextChange change) {
-		fMap.put(file, change);
-	}
-	
-	/**
-	 * Returns the <code>TextChange</code> associated with the given file.
-	 * If the manager does not already manage an association it creates a one.
-	 * 
-	 * @param file the file for which the text buffer change is requested
-	 * @return the text change associated with the given file. 
-	 */
-	public TextChange get(IFile file) {
-		TextChange result= (TextChange)fMap.get(file);
-		if (result == null) {
-			result= new TextFileChange(file.toString(), file);
-			result.setKeepPreviewEdits(fKeepExecutedTextEdits);
-			fMap.put(file, result);
-		}
-		return result;
-	}
-	
-	/**
-	 * Removes the <tt>TextChange</tt> managed under the given key
-	 * <code>unit<code>.
-	 * 
-	 * @param unit the key determining the <tt>TextChange</tt> to be removed.
-	 * @return the removed <tt>TextChange</tt>.
-	 */
-	public TextChange remove(IFile unit) {
-		return (TextChange)fMap.remove(unit);
-	}
-	
-	/**
-	 * Returns all text changes managed by this instance.
-	 * 
-	 * @return all text changes managed by this instance
-	 */
-	public TextChange[] getAllChanges(){
-		return (TextChange[])fMap.values().toArray(new TextChange[fMap.values().size()]);
-	}
-
-	/**
-	 * Returns all files managed by this instance.
-	 * 
-	 * @return all files managed by this instance
-	 */	
-	public IFile[] getAllCompilationUnits(){
-		return (IFile[]) fMap.keySet().toArray(new IFile[fMap.keySet().size()]);
-	}
-	
-	/**
-	 * Clears all associations between resources and text changes.
-	 */
-	public void clear() {
-		fMap.clear();
-	}
-
-	/**
-	 * Returns if any text changes are managed for the specified file.
-	 * 
-	 * @param file the file
-	 * @return <code>true</code> if any text changes are managed for the specified file and <code>false</code> otherwise
-	 */		
-	public boolean containsChangesIn(IFile file){
-		return fMap.containsKey(file);
-	}
-}
-
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/XMLRefactoringComponent.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/XMLRefactoringComponent.java
deleted file mode 100644
index 93eac43..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/XMLRefactoringComponent.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor;
-
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-
-public class XMLRefactoringComponent implements RefactoringComponent
-{
-	// The name of the component being refactored
-	String name;
-	
-	// The namespace in which component is defined, e.g. XML or WSDL target namespace
-	String targetNamespace;
-	
-	// Optional model object that is refactored
-	Object model;
-	
-	// SED DOM object that underlines the component being refactored
-	IDOMElement domElement;
-
-	public XMLRefactoringComponent(Object modelObject, IDOMElement domElement, String name, String namespace)
-	{
-		super();
-		this.model = modelObject;
-		this.domElement = domElement;
-		this.name = name;
-		this.targetNamespace = namespace;
-		
-		
-	}
-	
-	public XMLRefactoringComponent(IDOMElement domElement, String name, String namespace)
-	{
-		super();
-		this.domElement = domElement;
-		this.name = name;
-		this.targetNamespace = namespace;
-	}
-
-	public Object getModelObject()
-	{
-		return model;
-	}
-
-	public IDOMElement getElement()
-	{
-		return domElement;
-	}
-
-	public String getName()
-	{
-		
-		return name;
-	}
-
-	public String getNamespaceURI()
-	{
-		return targetNamespace;
-	}
-
-	
-	public QualifiedName getTypeQName()
-	{
-		return new QualifiedName(domElement.getNamespaceURI(), domElement.getLocalName());
-	}
-	
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
deleted file mode 100644
index 6216de7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeAnonymousTypeGlobalCommand;
-import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeTypeGlobalProcessor;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.w3c.dom.Node;
-
-public class MakeAnonymousTypeGlobalAction extends XSDSelectionDispatchAction {
-
-	private String fParentName;
-	private boolean isComplexType = true;
-	private XSDTypeDefinition fSelectedComponent;
-	
-	public MakeAnonymousTypeGlobalAction(ISelection selection, XSDSchema schema) {
-		super(selection, schema);
-		setText(RefactoringWizardMessages.MakeAnonymousTypeGlobalAction_text); //$NON-NLS-1$
-	}
-	
-	public boolean canRun() {
-
-		return fSelectedComponent != null;
-	}
-	
-
-	private String getNewDefaultName(){
-		if(fParentName != null && !"".equals(fParentName)){
-			if(isComplexType){
-				return fParentName + "ComplexType";
-			}
-			else{
-				return fParentName + "SimpleType";
-			}
-		}
-		else{
-			if(isComplexType){
-				return "NewComplexType";
-			}
-			else{
-				return "NewSimpleType";
-			}
-		}
-		
-	}
-	private boolean canEnable(XSDConcreteComponent xsdComponent){
-		if (xsdComponent instanceof XSDComplexTypeDefinition) {
-			fSelectedComponent = (XSDComplexTypeDefinition)xsdComponent;
-			isComplexType = true;
-			XSDComplexTypeDefinition typeDef = (XSDComplexTypeDefinition) xsdComponent;
-			XSDConcreteComponent parent = typeDef.getContainer();
-			if(parent instanceof XSDElementDeclaration){
-				fParentName = ((XSDElementDeclaration)parent).getName();
-				return true;
-			}
-		} 
-		else if (xsdComponent instanceof XSDSimpleTypeDefinition){
-			fSelectedComponent = (XSDSimpleTypeDefinition)xsdComponent;
-			isComplexType = false;
-			XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) xsdComponent;
-			XSDConcreteComponent parent = typeDef.getContainer();
-			if(parent instanceof XSDElementDeclaration){
-				fParentName = ((XSDElementDeclaration)parent).getName();
-				return true;
-			}
-			else if(parent instanceof XSDAttributeDeclaration){
-				fParentName = ((XSDAttributeDeclaration)parent).getName();
-				return true;
-			}
-			
-		}
-		return false;
-	}
-
-	protected boolean canEnable(Object selectedObject) {
-		
-		if (selectedObject instanceof XSDConcreteComponent) {
-			return canEnable((XSDConcreteComponent)selectedObject);
-		}
-		else if (selectedObject instanceof Node) {
-			Node node = (Node) selectedObject;
-			XSDConcreteComponent concreteComponent = getSchema().getCorrespondingComponent(node);
-			return canEnable(concreteComponent);
-		
-		}
-		return false;
-		
-	}
-
-	public void run1() {
-		
-		if(fSelectedComponent == null){
-			return;
-		}
-		
-		if(fSelectedComponent.getSchema() == null){
-			getSchema().updateElement(true);
-		}
-		MakeTypeGlobalProcessor processor = new MakeTypeGlobalProcessor(fSelectedComponent, getNewDefaultName());
-		RenameRefactoring refactoring = new RenameRefactoring(processor);
-		try {
-			RefactoringWizard wizard = new RenameRefactoringWizard(
-					refactoring,
-					RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle, // TODO: provide correct strings
-					RefactoringWizardMessages.RenameComponentWizard_inputPage_description, null);
-			RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(wizard);
-			op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle());
-			//triggerBuild();
-		} catch (InterruptedException e) {
-			// do nothing. User action got cancelled
-		}
-		
-	}
-	
-	public void run(){
-		if(fSelectedComponent == null){
-			return;
-		}
-		
-		if(fSelectedComponent.getSchema() == null){
-			getSchema().updateElement(true);
-		}
-		DocumentImpl doc = (DocumentImpl) fSelectedComponent.getElement().getOwnerDocument();
-		doc.getModel().beginRecording(
-						this,
-						RefactoringWizardMessages.MakeAnonymousTypeGlobalAction_text);
-		MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand(
-				fSelectedComponent, getNewDefaultName());
-		command.run();
-		doc.getModel().endRecording(this);
-	}
-	
-	
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java
deleted file mode 100644
index ea4de4e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeLocalElementGlobalCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Node;
-
-public class MakeLocalElementGlobalAction extends XSDSelectionDispatchAction {
-
-	XSDElementDeclaration fSelectedComponent;
-
-	public MakeLocalElementGlobalAction(ISelection selection, XSDSchema schema) {
-		super(selection, schema);
-        //TODO cs : fix up translation
-        setText("Make Global");
-		//setText(RefactoringMessages.getString("MakeLocalElementGlobalAction.text")); //$NON-NLS-1$
-	}
-	
-	public boolean canRun() {
-
-		return fSelectedComponent != null;
-	}
-
-	protected boolean canEnable(XSDConcreteComponent selectedObject) {
-
-		fSelectedComponent = null;
-		if (selectedObject instanceof XSDElementDeclaration) {
-			XSDElementDeclaration element = (XSDElementDeclaration) selectedObject;
-			if (!element.isElementDeclarationReference() && !element.isGlobal()) {
-				fSelectedComponent = element;
-			}
-		} 
-		return canRun();
-	}
-	
-	
-	protected boolean canEnable(Object selectedObject) {
-		
-		if (selectedObject instanceof XSDConcreteComponent) {
-			return canEnable((XSDConcreteComponent)selectedObject);
-		}
-		else if (selectedObject instanceof Node) {
-			Node node = (Node) selectedObject;
-			XSDConcreteComponent concreteComponent = getSchema()
-					.getCorrespondingComponent(node);
-			return canEnable(concreteComponent);
-		}
-		return false;
-		
-	}
-
-
-	public void run() {
-		DocumentImpl doc = (DocumentImpl) fSelectedComponent.getElement()
-				.getOwnerDocument();
-		doc.getModel().beginRecording(this, getText());
-		MakeLocalElementGlobalCommand command = new MakeLocalElementGlobalCommand(
-				fSelectedComponent);
-		command.run();
-		doc.getModel().endRecording(this);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java
deleted file mode 100644
index 6b1d8b8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java
+++ /dev/null
@@ -1,108 +0,0 @@
-
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
-
-
-
-/**
-* Renames a XML Schema element or workbench resource.
-* <p>
-* Action is applicable to selections containing elements of type
-* <code></code> or <code>IResource</code>.
-* 
-* <p>
-* This class may be instantiated; it is not intended to be subclassed.
-* </p>
-
-*/
-public class RenameAction extends SelectionDispatchAction  {
-
-	private SelectionDispatchAction renameComponentAction;
-	private SelectionDispatchAction renameResourceAction;
-	
-	
-	public RenameAction(ISelection selection) {
-		super(selection);
-		setText(RefactoringWizardMessages.RenameAction_text); 
-		renameResourceAction= new RenameResourceAction(selection);
-		renameResourceAction.setText(getText());
-		
-	}
-	public RenameAction(ISelection selection, Object model) {
-		super(selection);
-		setText(RefactoringWizardMessages.RenameAction_text);
-		renameComponentAction= new RenameComponentAction(selection, model);
-		renameComponentAction.setText(getText());
-		renameResourceAction= new RenameResourceAction(selection);
-		renameResourceAction.setText(getText());
-		
-	}
-	
-
-	
-	/*
-	 * @see ISelectionChangedListener#selectionChanged(SelectionChangedEvent)
-	 */
-	public void selectionChanged(SelectionChangedEvent event) {
-		renameComponentAction.selectionChanged(event);
-		if (renameResourceAction != null)
-			renameResourceAction.selectionChanged(event);
-		setEnabled(computeEnabledState());		
-	}
-
-	/*
-	 * @see SelectionDispatchAction#update(ISelection)
-	 */
-	public void update(ISelection selection) {
-		if(renameComponentAction != null){
-			renameComponentAction.update(selection);
-		}
-		if (renameResourceAction != null)
-			renameResourceAction.update(selection);
-		setEnabled(computeEnabledState());		
-	}
-	
-	private boolean computeEnabledState(){
-		if (renameResourceAction != null) {
-			return renameComponentAction.isEnabled() || renameResourceAction.isEnabled();
-		} else {
-			return renameComponentAction.isEnabled();
-		}
-	}
-	
-	public void run(IStructuredSelection selection) {
-		if (renameComponentAction != null && renameComponentAction.isEnabled())
-			renameComponentAction.run(selection);
-		if (renameResourceAction != null && renameResourceAction.isEnabled())
-			renameResourceAction.run(selection);
-	}
-
-	public void run(ITextSelection selection) {
-		if (renameComponentAction != null && renameComponentAction.canRun())
-			renameComponentAction.run(selection);
-		else
-			MessageDialog.openInformation(XSDEditorPlugin.getShell(), RefactoringWizardMessages.RenameAction_rename, RefactoringWizardMessages.RenameAction_unavailable);  
-	}
-	public void run(ISelection selection) {
-	    if(selection == null){
-	    	super.run();
-	    }
-	    else{
-	    	super.run(selection);
-	    }
-		
-	}
-	public final void setRenameComponentAction(
-			SelectionDispatchAction renameComponentAction)
-	{
-		this.renameComponentAction = renameComponentAction;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
deleted file mode 100644
index 7cbc3fe..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.ui.actions.GlobalBuildAction;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.XMLRefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameComponentProcessor;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.w3c.dom.Node;
-
-public class RenameComponentAction extends XSDSelectionDispatchAction {
-
-	private XSDNamedComponent selectedComponent;
-
-	public RenameComponentAction(ISelection selection,
-			Object aModel) {
-		super(selection, aModel);
-	
-	}
-
-	protected boolean canEnable(XSDConcreteComponent selectedObject) {
-
-		selectedComponent = null;
-		if (selectedObject instanceof XSDNamedComponent) {
-			selectedComponent = (XSDNamedComponent) selectedObject;
-
-			// if it's element reference, then this action is not appropriate
-			if (selectedComponent instanceof XSDElementDeclaration) {
-				XSDElementDeclaration element = (XSDElementDeclaration) selectedComponent;
-				if (element.isElementDeclarationReference()) {
-					selectedComponent = null;
-				}
-			}
-			if(selectedComponent instanceof XSDTypeDefinition){
-				XSDTypeDefinition type = (XSDTypeDefinition) selectedComponent;
-				XSDConcreteComponent parent = type.getContainer();
-				if (parent instanceof XSDElementDeclaration) {
-					XSDElementDeclaration element = (XSDElementDeclaration) parent;
-					if(element.getAnonymousTypeDefinition().equals(type)){
-						selectedComponent = null;
-					}
-				}
-				else if(parent instanceof XSDAttributeDeclaration) {
-					XSDAttributeDeclaration element = (XSDAttributeDeclaration) parent;
-					if(element.getAnonymousTypeDefinition().equals(type)){
-						selectedComponent = null;
-					}
-				}
-			}
-		}
-
-		return canRun();
-	}
-
-	protected boolean canEnable(Object selectedObject) {
-
-		if (selectedObject instanceof XSDConcreteComponent) {
-			return canEnable((XSDConcreteComponent) selectedObject);
-		} else if (selectedObject instanceof Node) {
-			Node node = (Node) selectedObject;
-			if (getSchema() != null) {
-				XSDConcreteComponent concreteComponent = getSchema()
-						.getCorrespondingComponent(node);
-				return canEnable(concreteComponent);
-			}
-		}
-		return false;
-
-	}
-
-	public boolean canRun() {
-
-		return selectedComponent != null;
-	}
-
-	public void run(ISelection selection) {
-		if (selectedComponent.getName() == null) {
-			selectedComponent.setName(new String());
-		}
-		if (selectedComponent.getSchema() == null) {
-			if (getSchema() != null) {
-				getSchema().updateElement(true);
-			}
-
-		}
-		RefactoringComponent component = new XMLRefactoringComponent(
-				selectedComponent,
-				(IDOMElement)selectedComponent.getElement(), 
-				selectedComponent.getName(),
-				selectedComponent.getTargetNamespace());
-		
-		RenameComponentProcessor processor = new RenameComponentProcessor(
-				component, selectedComponent.getName());
-		RenameRefactoring refactoring = new RenameRefactoring(processor);
-		try {
-			RefactoringWizard wizard = new RenameRefactoringWizard(
-					refactoring,
-					RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle, 
-					RefactoringWizardMessages
-							.RenameComponentWizard_inputPage_description, 
-					null);
-			RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(
-					wizard);
-			op.run(XSDEditorPlugin.getShell(), wizard
-					.getDefaultPageTitle());
-			triggerBuild();
-		} catch (InterruptedException e) {
-			// do nothing. User action got cancelled
-		}
-
-	}
-
-	public static void triggerBuild() {
-		if (ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding()) {
-			new GlobalBuildAction(XSDEditorPlugin.getPlugin().getWorkbench()
-					.getActiveWorkbenchWindow(),
-					IncrementalProjectBuilder.INCREMENTAL_BUILD).run();
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java
deleted file mode 100644
index 722e5e9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameResourceProcessor;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
-
-
-
-public class RenameResourceAction extends SelectionDispatchAction {
-
-
-
-	
-	public RenameResourceAction(ISelection selection)
-	{
-		super(selection);
-	}
-
-	public void selectionChanged(IStructuredSelection selection) {
-		IResource element= getResource(selection);
-		if (element == null) {
-			setEnabled(false);
-		} else {
-			RenameResourceProcessor processor= new RenameResourceProcessor(element);
-			setEnabled(processor.isApplicable());
-			
-		}
-	}
-
-	public void run(IStructuredSelection selection) {
-		IResource resource = getResource(selection);
-		RenameResourceProcessor processor= new RenameResourceProcessor(resource);
-
-			if(!processor.isApplicable())
-				return;
-			RenameRefactoring refactoring= new RenameRefactoring(processor);
-			try {
-				RefactoringWizard wizard = new RenameRefactoringWizard(
-						refactoring,
-						RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle, //TODO: provide correct strings
-						RefactoringWizardMessages.RenameComponentWizard_inputPage_description, 
-						null);
-				RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(wizard);
-				op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle());
-			} catch (InterruptedException e) {
-				// do nothing. User action got cancelled
-			}
-			
-	}
-	
-	private static IResource getResource(IStructuredSelection selection) {
-		if (selection.size() != 1)
-			return null;
-		Object first= selection.getFirstElement();
-		if (! (first instanceof IResource))
-			return null;
-		return (IResource)first;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java
deleted file mode 100644
index 073f55d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.core.resources.IFile;
-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;
-
-/**
- * @author ebelisar@ca.ibm.com
- */
-public class RenameResourceActionDelegate implements IObjectActionDelegate {
-	
-	private ISelection fCurrentSelection;
-
-	private IWorkbenchPart fPart;
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
-	 */
-	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
-		fPart = targetPart;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
-	 */
-	public void run(IAction action) {
-		if (fCurrentSelection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection= (IStructuredSelection) fCurrentSelection;
-			Object first= structuredSelection.getFirstElement();
-			if (first instanceof IFile) {
-				RenameResourceAction renameAction = new RenameResourceAction(structuredSelection);
-				renameAction.run(structuredSelection);
-			}
-		}
-
-	}
-	/* (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) {
-		fCurrentSelection= selection;
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameTargetNamespaceAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameTargetNamespaceAction.java
deleted file mode 100644
index e7dac64..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameTargetNamespaceAction.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.ui.actions.GlobalBuildAction;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameTargetNamespaceProcessor;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
-
-public class RenameTargetNamespaceAction extends XSDSelectionDispatchAction {
-
-	public RenameTargetNamespaceAction(ISelection selection,
-			Object aModel) {
-		super(selection, aModel);
-		setText(RefactoringWizardMessages.RenameTargetNamespace_text);
-
-	}
-
-
-	protected boolean canEnable(Object selectedObject) {
-
-		return getSchema() != null;
-
-	}
-	
-	public boolean canRun() {
-
-		return getSchema() != null;
-	}
-
-
-	public void run(ISelection selection) {
-
-		
-		RenameTargetNamespaceProcessor processor = new RenameTargetNamespaceProcessor(getSchema(), getSchema().getTargetNamespace());
-		RenameRefactoring refactoring = new RenameRefactoring(processor);
-		try {
-			RefactoringWizard wizard = new RenameRefactoringWizard(
-					refactoring,
-					RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle,//TODO: provide correct strings
-					RefactoringWizardMessages.RenameComponentWizard_inputPage_description, 
-					null);
-			RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(
-					wizard);
-			op.run(XSDEditorPlugin.getShell(), wizard
-					.getDefaultPageTitle());
-			triggerBuild();
-		} catch (InterruptedException e) {
-			// do nothing. User action got cancelled
-		}
-
-	}
-
-	public static void triggerBuild() {
-		if (ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding()) {
-			new GlobalBuildAction(XSDEditorPlugin.getPlugin().getWorkbench()
-					.getActiveWorkbenchWindow(),
-					IncrementalProjectBuilder.INCREMENTAL_BUILD).run();
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java
deleted file mode 100644
index 879eb31..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-
-
-
-/**
- * Action that dispatches the <code>IAction#run()</code> and the 
- * <code>ISelectionChangedListener#selectionChanged</code> 
- * according to the type of the selection. 
- * 
- * <ul>
- * 	<li>if selection is of type <code>ITextSelection</code> then
- * 	<code>run(ITextSelection)</code> and <code>selectionChanged(ITextSelection)</code>
- * 	is called.</li> 
- * 	<li>if selection is of type <code>IStructuredSelection</code> then
- * 	<code>run(IStructuredSelection)</code> and <code>
- * 	selectionChanged(IStructuredSelection)</code> is called.</li>
- * 	<li>default is to call <code>run(ISelection)</code> and <code>
- * 	selectionChanged(ISelection)</code>.</li>
- * </ul>
- * 
- * <p>
- * adapted from <code>org.eclipse.jdt.ui.actions.SelectionDispatchAction</code>
- * </p>
- *   
- * 
- */
-public abstract class SelectionDispatchAction extends Action implements ISelectionChangedListener {
-	
-	private ISelection selection;
-	
-	private Object model;
-	
-	protected SelectionDispatchAction(ISelection selection) {
-		Assert.isNotNull(selection);
-		this.selection = selection;
-		
-	}
-
-	/**
-	 * Returns the selection provided by the site owning this action.
-	 * 
-	 * @return the site's selection
-	 */	
-	public ISelection getSelection() {
-		return selection;
-	}
-	
-	/**
-	 * Updates the action's enablement state according to the given selection. This
-	 * default implementation calls one of the <code>selectionChanged</code>
-	 * methods depending on the type of the passed selection.
-	 * 
-	 * @param selection the selection this action is working on
-	 */
-	public void update(ISelection selection) {
-		dispatchSelectionChanged(selection);
-	}
-
-	/**
-	 * Notifies this action that the given structured selection has changed. This default
-	 * implementation calls <code>selectionChanged(ISelection selection)</code>.
-	 * 
-	 * @param selection the new selection
- 	 */
-	public void selectionChanged(IStructuredSelection selection) {
-		if (selection.size() == 1) {
-			Object object = selection.getFirstElement();
-			setEnabled(canEnable(object));
-		}
-		else{
-			setEnabled(false);
-		}
-	}
-	
-	protected boolean canEnable(Object selectedObject){
-		return false;
-	}
-
-	/**
-	 * Executes this actions with the given structured selection. This default implementation
-	 * calls <code>run(ISelection selection)</code>.
-	 */
-	public void run(IStructuredSelection selection) {
-		run((ISelection)selection);
-	}
-
-	
-	/**
-	 * Notifies this action that the given text selection has changed.  This default
-	 * implementation calls <code>selectionChanged(ISelection selection)</code>.
-	 * 
-	 * @param selection the new selection
- 	 */
-	public void selectionChanged(ITextSelection selection) {
-		selectionChanged((ISelection)selection);
-	}
-	
-	/**
-	 * Executes this actions with the given text selection. This default implementation
-	 * calls <code>run(ISelection selection)</code>.
-	 */
-	public void run(ITextSelection selection) {
-		run((ISelection)selection);
-	}
-	
-	/**
-	 * Notifies this action that the given selection has changed.  This default
-	 * implementation sets the action's enablement state to <code>false</code>.
-	 * 
-	 * @param selection the new selection
- 	 */
-	public void selectionChanged(ISelection selection) {
-		setEnabled(false);
-	}
-	
-	/**
-	 * Executes this actions with the given selection. This default implementation
-	 * does nothing.
-	 */
-	public void run(ISelection selection) {
-		System.out.println("SelectionDispatchAction.run");
-	}
-
-	/* (non-Javadoc)
-	 * Method declared on IAction.
-	 */
-	public void run() {
-		dispatchRun(getSelection());
-		
-	}
-	
-	/* (non-Javadoc)
-	 * Method declared on ISelectionChangedListener.
-	 */
-	public void selectionChanged(SelectionChangedEvent event) {
-		dispatchSelectionChanged(event.getSelection());
-	}
-
-	private void dispatchSelectionChanged(ISelection selection) {
-		if (selection instanceof IStructuredSelection) {
-			selectionChanged((IStructuredSelection)selection);
-		} else if (selection instanceof ITextSelection) {
-			selectionChanged((ITextSelection)selection);
-		} else {
-			selectionChanged(selection);
-		}
-	}
-
-	protected void dispatchRun(ISelection selection) {
-		if (selection instanceof IStructuredSelection) {
-			run((IStructuredSelection)selection);
-		}  else if (selection instanceof ITextSelection) {
-			run((ITextSelection)selection);
-		} else {
-			run(selection);
-		}
-	}
-
-	public final Object getModel()
-	{
-		return model;
-	}
-
-	public final void setModel(Object model)
-	{
-		this.model = model;
-	}
-	
-	public boolean canRun() {
-
-		return true;
-	}
-
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorActionGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorActionGroup.java
deleted file mode 100644
index 950fc6f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorActionGroup.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import java.util.ArrayList;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorActionGroup;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDRefactorActionGroup extends RefactorActionGroup {
-
-	private static final String MAKE_ELEMENT_GLOBAL = "org.eclipse.wst.xsd.ui.refactor.makeElementGlobal"; //$NON-NLS-1$
-
-	private static final String MAKE_TYPE_GLOBAL = "org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal"; //$NON-NLS-1$
-
-	private static final String RENAME_ELEMENT = "org.eclipse.wst.xsd.ui.refactor.rename.element"; //$NON-NLS-1$
-
-	private static final String RENAME_TARGET_NAMESPCE = "org.eclipse.wst.xsd.ui.refactor.renameTargetNamespace"; //$NON-NLS-1$
-
-	private SelectionDispatchAction fMakeLocalElementGlobal;
-
-	private SelectionDispatchAction fMakeLocalTypeGlobal;
-
-	public XSDRefactorActionGroup(ISelection selection,
-			XSDSchema schema) {
-		super(selection);
-		fEditorActions = new ArrayList();
-		fRenameAction = new RenameAction(selection, schema);
-		fRenameAction.setActionDefinitionId(RENAME_ELEMENT);
-		fEditorActions.add(fRenameAction);
-
-		fRenameTargetNamespace = new RenameTargetNamespaceAction(
-				selection, schema);
-		fRenameTargetNamespace.setActionDefinitionId(RENAME_TARGET_NAMESPCE);
-		fEditorActions.add(fRenameTargetNamespace);
-
-		fMakeLocalElementGlobal = new MakeLocalElementGlobalAction(
-				selection, schema);
-		fMakeLocalElementGlobal.setActionDefinitionId(MAKE_ELEMENT_GLOBAL);
-		fEditorActions.add(fMakeLocalElementGlobal);
-
-		fMakeLocalTypeGlobal = new MakeAnonymousTypeGlobalAction(
-				selection, schema);
-		fMakeLocalTypeGlobal.setActionDefinitionId(MAKE_TYPE_GLOBAL);
-		fEditorActions.add(fMakeLocalTypeGlobal);
-
-		initAction(fRenameAction, selection);
-		initAction(fRenameTargetNamespace, selection);
-		initAction(fMakeLocalElementGlobal, selection);
-		initAction(fMakeLocalTypeGlobal, selection);
-	}
-
-	public void dispose() {
-//		disposeAction(fRenameAction, selection);
-//		disposeAction(fMakeLocalElementGlobal, selection);
-//		disposeAction(fMakeLocalTypeGlobal, selection);
-//		disposeAction(fRenameTargetNamespace, selection);
-		super.dispose();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java
deleted file mode 100644
index 965fc4e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import java.io.IOException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorActionGroup;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorGroupActionDelegate;
-import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorGroupSubMenu;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDResourceImpl;
-
-public class XSDRefactorGroupActionDelegate extends RefactorGroupActionDelegate {
-
-	public XSDRefactorGroupActionDelegate() {
-		super();
-	}
-
-	/**
-	 * Fills the menu with applicable refactor sub-menues
-	 * @param menu The menu to fill
-	 */
-	protected void fillMenu(Menu menu) {
-		if (fSelection == null) {
-			return;
-		}
-		if (workbenchPart != null) {
-			IWorkbenchPartSite site = workbenchPart.getSite();
-			if (site == null)
-				return;
-	
-			IEditorPart editor = site.getPage().getActiveEditor();
-			if (editor != null) {
-				IEditorInput editorInput = editor.getEditorInput();
-				if(editorInput instanceof IFileEditorInput){
-					IFileEditorInput fileInput = (IFileEditorInput)editorInput;
-					XSDSchema schema = createXMLSchema(fileInput.getFile(), resourceSet);
-					RefactorActionGroup refactorMenuGroup = new XSDRefactorActionGroup(fSelection, schema);
-					RefactorGroupSubMenu subMenu = new RefactorGroupSubMenu(refactorMenuGroup);
-					subMenu.fill(menu, -1);
-				}
-				
-			}
-		
-		}
-	
-	}
-	
-	public static XSDSchema createXMLSchema(IFile file, ResourceSet set)  {
-		
-		URI uri = URI.createFileURI(file.getLocation().toString());
-		XSDSchema schema = XSDFactory.eINSTANCE.createXSDSchema();
-		// we need this model to be able to get locations
-		try {
-			IStructuredModel structuredModel = StructuredModelManager.getModelManager().getModelForEdit(file);
-			IDOMModel domModel = (IDOMModel) structuredModel;
-			Resource xsdResource = new XSDResourceImpl();
-			xsdResource.setURI(uri);
-			schema = XSDFactory.eINSTANCE.createXSDSchema();
-			xsdResource.getContents().add(schema);
-			schema.setElement(domModel.getDocument().getDocumentElement());
-			if(set != null){
-				set.getResources().add(xsdResource);
-			}
-		} catch (IOException e) {
-			// do nothing
-		} catch (CoreException e) {
-			// do nothing
-		}
-		return schema;
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDSelectionDispatchAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDSelectionDispatchAction.java
deleted file mode 100644
index 05c72d4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDSelectionDispatchAction.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDSelectionDispatchAction extends SelectionDispatchAction
-{
-
-	
-	
-	public XSDSelectionDispatchAction(ISelection selection, Object model)
-	{
-		super(selection);
-		setModel(model);
-	}
-
-	protected XSDSchema getSchema(){
-		Object model = getModel();
-		if(model instanceof XSDSchema)
-		{
-			return (XSDSchema) model;
-		}
-	
-		return null;
-	}
-
-	
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties
deleted file mode 100644
index 48483a1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-RefactorMenu.label=Refactor
-RefactorActionGroup.no_refactoring_available=<no refactoring available>
-
-RenameAction.rename=Rename
-RenameAction.unavailable=Operation unavailable on the current selection.\nSelect a ....
-RenameAction.text=Re&name...
-
-RenameInputWizardPage.new_name= &New name:
-RenameRefactoringWizard.internal_error= Internal error during name checking: {0}
-
-
-RenameXSDElementAction.exception=Unexpected exception occurred. See log for details
-RenameXSDElementAction.not_available=Operation unavailable on the current selection.\nSelect a XSD project, folder, resource, file, attribute declarations,  attribute group definitions, complex type definitions, element declarations, identity constraint definitions, model groups definitions, notation declarations, or simple type definitions.
-RenameXSDElementAction.name=Rename
-
-
-RenameSupport.dialog.title=Rename
-RenameSupport.not_available=Rename support not available
-
-RenameComponentWizard.defaultPageTitle=Rename wizard
-RenameComponentWizard.inputPage.description=Rename XML Schema component
-
-RenameInputWizardPage.update_references=Update references
-XSDComponentRenameChange.name=XML Schema component renaming in {0}: {1} to {2}
-XSDComponentRenameChange.Renaming=Renaming...
-ResourceRenameParticipant.compositeChangeName=XSD file rename references updating changes
-RenameResourceChange.rename_resource_reference_change=Renaming resource name references
-XSDRenameResourceChange.name=Resource rename: {0} to {1}
-RenameResourceRefactoring.Internal_Error=Internal error
-RenameResourceRefactoring.alread_exists=Resource already exist
-RenameResourceRefactoring.invalidName=Invalid resource name
-RenameResourceProcessor.name=Resource renaming
-MakeLocalElementGlobalAction.text=Make Local Element Global
-XSDComponentRenameParticipant.Component_Refactoring_updates=XML Schema refactoring changes
-WSDLComponentRenameParticipant.Component_Refactoring_updates=WSDL refactoring changes
-RenameComponentProcessor.Component_Refactoring_updates=Component name refactoring changes
-RenameComponentProcessor.Component_Refactoring_update_declatation=Update component declaration/definition
-RenameComponentProcessor.Component_Refactoring_update_reference=Update component reference
-XSDComponentRenameParticipant.xsd_component_rename_participant=XSD component rename participant
-WSDLComponentRenameParticipant.wsdl_component_rename_participant=WSDL component rename participant
-ResourceRenameParticipant.File_Rename_update_reference=File rename refactoring changes
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameArguments.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameArguments.java
deleted file mode 100644
index f90685d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameArguments.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.Map;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.wst.xsd.ui.internal.refactor.TextChangeManager;
-
-public class ComponentRenameArguments extends RenameArguments {
-	
-	TextChangeManager changeManager;
-	Map matches;
-	String qualifier;
-
-	public ComponentRenameArguments(String newName, boolean updateReferences) {
-		super(newName, updateReferences);
-	}
-
-	public TextChangeManager getChangeManager() {
-		return changeManager;
-	}
-
-	public void setChangeManager(TextChangeManager changeManager) {
-		this.changeManager = changeManager;
-	}
-
-	public Map getMatches() {
-		return matches;
-	}
-
-	public void setMatches(Map matches) {
-		this.matches = matches;
-	}
-
-	public String getQualifier() {
-		return qualifier;
-	}
-
-	public void setQualifier(String qualifier) {
-		this.qualifier = qualifier;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
deleted file mode 100644
index fea1823..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
+++ /dev/null
@@ -1,484 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.text.Collator;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-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.Assert;
-import org.eclipse.core.runtime.CoreException;
-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.core.runtime.SubProgressMonitor;
-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.TextFileChange;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.common.core.search.SearchEngine;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.core.search.scope.SelectionSearchScope;
-import org.eclipse.wst.common.core.search.scope.WorkspaceSearchScope;
-import org.eclipse.wst.common.core.search.util.CollectingSearchRequestor;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentReferencePattern;
-import org.eclipse.wst.xsd.ui.internal.refactor.Checks;
-import org.eclipse.wst.xsd.ui.internal.refactor.INameUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.IReferenceUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.TextChangeManager;
-import org.eclipse.wst.xsd.ui.internal.refactor.util.TextChangeCompatibility;
-
-
-
-public class RenameComponentProcessor extends RenameProcessor implements INameUpdating, IReferenceUpdating {
-	public static final String IDENTIFIER = "org.eclipse.wst.xml.refactor.renameComponentProcessor"; //$NON-NLS-1$
-
-	public static String quoteString(String value) {
-		value = value == null ? "" : value;
-
-		StringBuffer sb = new StringBuffer();
-		if (!value.startsWith("\"")) {
-			sb.append("\"");
-		}
-		sb.append(value);
-		if (!value.endsWith("\"")) {
-			sb.append("\"");
-		}
-		return sb.toString();
-	}
-
-	private TextChangeManager changeManager;
-
-	private String newName;
-
-	private RefactoringComponent selectedComponent;
-
-	private boolean updateReferences = true;
-
-	private Map references = new HashMap();
-
-	public RenameComponentProcessor(RefactoringComponent selectedComponent) {
-		this.selectedComponent = selectedComponent;
-	}
-
-	public RenameComponentProcessor(RefactoringComponent selectedComponent, String newName) {
-		this.newName = newName;
-		this.selectedComponent = selectedComponent;
-	}
-
-	private void addDeclarationUpdate(TextChangeManager manager) throws CoreException {
-		String fileStr = selectedComponent.getElement().getModel().getBaseLocation();
-		IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fileStr));
-		addDeclarationUpdate(manager, file);
-	}
-
-	final void addDeclarationUpdate(TextChangeManager manager, IFile file) throws CoreException {
-
-		String componentName = selectedComponent.getName();
-		String componentNamespace = selectedComponent.getNamespaceURI();
-		QualifiedName elementQName = new QualifiedName(componentNamespace, componentName);
-		QualifiedName typeQName = selectedComponent.getTypeQName();
-
-
-
-		SearchScope scope = new WorkspaceSearchScope();
-		if (file != null) {
-			scope = new SelectionSearchScope(new IResource[]{file});
-		}
-		CollectingSearchRequestor requestor = new CollectingSearchRequestor();
-		SearchPattern pattern = new XMLComponentDeclarationPattern(file, elementQName, typeQName);
-		SearchEngine searchEngine = new SearchEngine();
-		searchEngine.search(pattern, requestor, scope, new NullProgressMonitor());
-		List results = requestor.getResults();
-		for (Iterator iter = results.iterator(); iter.hasNext();) {
-			SearchMatch match = (SearchMatch) iter.next();
-			if (match != null) {
-				TextChange textChange = manager.get(match.getFile());
-				String newName = getNewElementName();
-				newName = quoteString(newName);
-
-				ReplaceEdit replaceEdit = new ReplaceEdit(match.getOffset(), match.getLength(), newName);
-				String editName = RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_update_declatation");;
-				TextChangeCompatibility.addTextEdit(textChange, editName, replaceEdit);
-			}
-		}
-	}
-
-	void addOccurrences(TextChangeManager manager, IProgressMonitor pm, RefactoringStatus status) throws CoreException {
-
-		String fileStr = selectedComponent.getElement().getModel().getBaseLocation();
-		IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fileStr));
-
-		String componentName = selectedComponent.getName();
-		String componentNamespace = selectedComponent.getNamespaceURI();
-		QualifiedName elementQName = new QualifiedName(componentNamespace, componentName);
-		QualifiedName typeQName = selectedComponent.getTypeQName();
-
-		SearchEngine searchEngine = new SearchEngine();
-
-		SortingSearchRequestor requestor = new SortingSearchRequestor();
-		SearchPattern pattern = new XMLComponentReferencePattern(file, elementQName, typeQName);
-		searchEngine.search(pattern, requestor, new WorkspaceSearchScope(), new NullProgressMonitor());
-		references = requestor.getResults();
-		// for (Iterator iter = references.iterator(); iter.hasNext();) {
-		// SearchMatch match = (SearchMatch) iter.next();
-
-		// TextChange textChange = manager.get(match.getFile());
-		// String newName = getNewElementName();
-		// if(match.getObject() instanceof Node){
-		// Node node = (Node)match.getObject();
-		// if(node instanceof IDOMAttr){
-		// IDOMAttr attr = (IDOMAttr)node;
-		// IDOMElement element = (IDOMElement)attr.getOwnerElement() ;
-		// newName = getNewQName(element, componentNamespace, newName);
-		// }
-		// newName = quoteString(newName);
-		// }
-		//				
-		// ReplaceEdit replaceEdit = new ReplaceEdit(match.getOffset(),
-		// match.getLength(), newName );
-		// String editName =
-		// RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_update_reference");
-		// TextChangeCompatibility.addTextEdit(textChange, editName,
-		// replaceEdit);
-
-		// }
-	}
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#canEnableTextUpdating()
-	 */
-	public boolean canEnableTextUpdating() {
-		return true;
-	}
-
-	public boolean canEnableUpdateReferences() {
-		return true;
-	}
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor,
-	 *      org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
-	 */
-	public RefactoringStatus checkFinalConditions(IProgressMonitor monitor, CheckConditionsContext context) throws CoreException, OperationCanceledException {
-		Assert.isNotNull(monitor);
-		Assert.isNotNull(context);
-		final RefactoringStatus status = new RefactoringStatus();
-		try {
-			monitor.beginTask("", 2); //$NON-NLS-1$
-			monitor.setTaskName("RefactoringMessages.RenameComponentRefactoring_checking");
-			status.merge(checkNewElementName(getNewElementName()));
-			monitor.worked(1);
-			monitor.setTaskName("RefactoringMessages.RenameComponentRefactoring_searching");
-			status.merge(createRenameChanges(new SubProgressMonitor(monitor, 1)));
-		}
-		finally {
-			monitor.done();
-		}
-		return status;
-	}
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {
-		// TODO add code to check initial conditions for component rename
-		Assert.isNotNull(pm);
-		try {
-			return new RefactoringStatus();
-		}
-		finally {
-			pm.done();
-		}
-
-	}
-
-	public final RefactoringStatus checkNewElementName(final String name) {
-		Assert.isNotNull(name);
-		final RefactoringStatus result = Checks.checkName(name);
-		result.merge(Checks.checkComponentName(name));
-		if (Checks.isAlreadyNamed(selectedComponent, name))
-			result.addFatalError("RefactoringMessages.RenameComponentRefactoring_another_name");
-		return result;
-	}
-
-	private Object[] computeDerivedElements() {
-
-		Object[] elements = getElements();
-		// Object[] results = new Object[elements.length];
-		// for(int i=0; i< elements.length; i++){
-		// RefactoringComponent component = (RefactoringComponent)elements[i];
-		// results[i] = component.getAdaptee();
-		//			
-		// }
-		return elements;
-
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
-		// don't create any change now, all the changes are in changeManger
-		// variable and will be combined in postCreateChange method
-		return null;
-	}
-
-	private TextChangeManager updateChangeManager(IProgressMonitor pm, RefactoringStatus status) throws CoreException {
-		TextChangeManager manager = getChangeManager();
-		System.out.println("addDeclarationUpate-------------------");
-		// only one declaration gets updated
-		addDeclarationUpdate(manager);
-		if (getUpdateReferences()) {
-			System.out.println("addOccurences--------------------------");
-			addOccurrences(manager, pm, status);
-		}
-		return manager;
-	}
-
-	private RefactoringStatus createRenameChanges(final IProgressMonitor monitor) throws CoreException {
-		Assert.isNotNull(monitor);
-		final RefactoringStatus status = new RefactoringStatus();
-		try {
-			monitor.beginTask("RefactoringMessages.RenameComponentRefactoring_searching", 1);
-			updateChangeManager(new SubProgressMonitor(monitor, 1), status);
-		}
-		finally {
-			monitor.done();
-		}
-		return status;
-	}
-
-	public TextChangeManager getChangeManager() {
-
-		if (changeManager == null) {
-			changeManager = new TextChangeManager(false);
-		}
-		return changeManager;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.xsd.internal.refactoring.rename.XSDRenameProcessor#getAffectedProjectNatures()
-	 */
-	protected String[] getAffectedProjectNatures() throws CoreException {
-		// TODO: find project natures of the files that are going to be
-		// refactored
-		return new String[]{"org.eclipse.jdt.core.javanature"};
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#getCurrentElementName()
-	 */
-	public String getCurrentElementName() {
-		//
-		return selectedComponent.getName();
-	}
-
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
-	 */
-	public Object[] getElements() {
-		Object model = selectedComponent.getModelObject();
-		if (model != null) {
-			return new Object[]{model};
-		}
-		return new Object[0];
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
-	 */
-	public String getIdentifier() {
-		return IDENTIFIER;
-	}
-
-	public String getNewElementName() {
-		return newName;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
-	 */
-	public String getProcessorName() {
-		return RefactoringMessages.getFormattedString("RenameComponentRefactoring.name", //$NON-NLS-1$
-					new String[]{selectedComponent.getNamespaceURI() + ":" + selectedComponent.getName(), newName});
-
-	}
-
-
-	public boolean getUpdateReferences() {
-		return updateReferences;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
-	 */
-	public boolean isApplicable() throws CoreException {
-		if (selectedComponent == null)
-			return false;
-		// TODO implement isApplicable logic for the named component,
-		// verify how it is different from other condition checks
-		// if (fNamedComponent.isAnonymous())
-		// return false;
-		// if (! Checks.isAvailable(fType))
-		// return false;
-		// if (isSpecialCase(fType))
-		// return false;
-		return true;
-	}
-
-	protected void loadDerivedParticipants(RefactoringStatus status, List result, Object[] derivedElements, ComponentRenameArguments arguments, String[] natures, SharableParticipants shared) throws CoreException {
-		if (derivedElements != null) {
-			for (int i = 0; i < derivedElements.length; i++) {
-				RenameParticipant[] participants = ParticipantManager.loadRenameParticipants(status, this, derivedElements[i], arguments, natures, shared);
-				result.addAll(Arrays.asList(participants));
-			}
-		}
-
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.xsd.internal.refactoring.rename.XSDRenameProcessor#loadDerivedParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus,
-	 *      java.util.List, java.lang.String[],
-	 *      org.eclipse.ltk.core.refactoring.participants.SharableParticipants)
-	 */
-	protected void loadDerivedParticipants(RefactoringStatus status, List result, String[] natures, SharableParticipants shared) throws CoreException {
-		ComponentRenameArguments arguments = new ComponentRenameArguments(getNewElementName(), getUpdateReferences());
-		arguments.setMatches(references);
-		arguments.setQualifier(selectedComponent.getNamespaceURI());
-		// pass in changeManger to the participants so that it can collect all
-		// changes/per files
-		arguments.setChangeManager(getChangeManager());
-		loadDerivedParticipants(status, result, computeDerivedElements(), arguments, natures, shared);
-	}
-
-	protected void loadElementParticipants(RefactoringStatus status, List result, RenameArguments arguments, String[] natures, SharableParticipants shared) throws CoreException {
-		Object[] elements = new Object[0];// getElements();
-		for (int i = 0; i < elements.length; i++) {
-			result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status, this, elements[i], arguments, natures, shared)));
-		}
-	}
-
-
-	public final RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException {
-		RenameArguments arguments = new RenameArguments(getNewElementName(), getUpdateReferences());
-		String[] natures = getAffectedProjectNatures();
-		List result = new ArrayList();
-		loadElementParticipants(status, result, arguments, natures, sharedParticipants);
-		loadDerivedParticipants(status, result, natures, sharedParticipants);
-		for (Iterator i = result.iterator(); i.hasNext();) {
-			Object o = i.next();
-			if (o instanceof XMLComponentRenameParticipant) {
-				XMLComponentRenameParticipant p = (XMLComponentRenameParticipant) o;
-				// getChangeManager()
-				p.setChangeManager(getChangeManager());
-			}
-		}
-
-		return (RefactoringParticipant[]) result.toArray(new RefactoringParticipant[result.size()]);
-	}
-
-	public void setNewElementName(String newName) {
-		Assert.isNotNull(newName);
-		this.newName = newName;
-	}
-
-	public void setUpdateReferences(boolean update) {
-		updateReferences = update;
-
-	}
-
-	public Change postCreateChange(Change[] participantChanges, IProgressMonitor pm) throws CoreException, OperationCanceledException {
-		Assert.isNotNull(pm);
-		try {
-			String changeName = RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_updates");
-			TextChange[] changes = changeManager.getAllChanges();
-			// System.out.println("all changes(" + getChangeManager() + ")" +
-			// changes.length);
-			// System.out.println("add cus " +
-			// changeManager.getAllCompilationUnits().length);
-			Comparator c = new Comparator() {
-				public int compare(Object o1, Object o2) {
-					TextFileChange c1 = (TextFileChange) o1;
-					TextFileChange c2 = (TextFileChange) o2;
-					return Collator.getInstance().compare(c1.getFile().getFullPath(), c2.getFile().getFullPath());
-				}
-			};
-			if (changes.length > 0) {
-				// Arrays.sort(changes, c);
-				CompositeChange compositeChange = new CompositeChange("!" + changeName, changes);
-				compositeChange.markAsSynthetic();
-				return compositeChange;
-			}
-			else {
-				return null;
-			}
-
-		}
-		finally {
-			pm.done();
-		}
-	}
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java
deleted file mode 100644
index f0a326e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package  org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Assert;
-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.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
-import org.eclipse.wst.xsd.ui.internal.refactor.INameUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-
-public class RenameResourceProcessor extends RenameProcessor implements INameUpdating {
-
-	private IResource fResource;
-	private String fNewElementName;
-		
-	public static final String IDENTIFIER= "org.eclipse.wst.ui.xsd.renameResourceProcessor"; //$NON-NLS-1$
-	
-	public RenameResourceProcessor(IResource resource) {
-		fResource= resource;
-		if (fResource != null) {
-			setNewElementName(fResource.getName());
-		}
-	}
-
-	//---- INameUpdating ---------------------------------------------------
-	
-	public void setNewElementName(String newName) {
-		Assert.isNotNull(newName);
-		fNewElementName= newName;
-	}
-
-	public String getNewElementName() {
-		return fNewElementName;
-	}
-	
-	//---- IRenameProcessor methods ---------------------------------------
-		
-	public String getIdentifier() {
-		return IDENTIFIER;
-	}
-	
-	public boolean isApplicable()  {
-		if (fResource == null)
-			return false;
-		if (! fResource.exists())
-			return false;
-		if (! fResource.isAccessible())	
-			return false;
-		return true;			
-	}
-	
-	public String getProcessorName() {
-		String message= RefactoringMessages.getFormattedString("RenameResourceProcessor.name", //$NON-NLS-1$
-				new String[]{getCurrentElementName(), getNewElementName()});
-		return message;
-	}
-	
-	public Object[] getElements() {
-		return new Object[] {fResource};
-	}
-	
-	public String getCurrentElementName() {
-		return fResource.getName();
-	}
-	
-	public String[] getAffectedProjectNatures() throws CoreException {
-		return new String[0];
-	}
-
-	public Object getNewElement() {
-		
-			
-		return ResourcesPlugin.getWorkspace().getRoot().findMember(createNewPath(getNewElementName()));
-	}
-
-	public boolean getUpdateReferences() {
-		return true;
-	}
-	
-	public RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants shared) throws CoreException {
-		Object[] elements= getElements();
-		String[] natures= getAffectedProjectNatures();
-		List result= new ArrayList();
-		RenameArguments arguments= new RenameArguments(getNewElementName(), getUpdateReferences());
-		for (int i= 0; i < elements.length; i++) {
-			result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status, 
-				this, elements[i],
-				arguments, natures, shared)));
-		}
-		return (RefactoringParticipant[])result.toArray(new RefactoringParticipant[result.size()]);
-	}
-	
-	//--- Condition checking --------------------------------------------
-
-	public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException {
-		return new RefactoringStatus();
-	}
-	
-	/* non java-doc
-	 * @see IRenameRefactoring#checkNewName()
-	 */
-	public RefactoringStatus checkNewElementName(String newName)  {
-		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
-		IContainer c= fResource.getParent();
-		if (c == null)
-			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameResourceRefactoring.Internal_Error")); //$NON-NLS-1$
-						
-		if (c.findMember(newName) != null)
-			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameResourceRefactoring.alread_exists")); //$NON-NLS-1$
-			
-		if (!c.getFullPath().isValidSegment(newName))
-			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameResourceRefactoring.invalidName")); //$NON-NLS-1$
-	
-		RefactoringStatus result= RefactoringStatus.create(c.getWorkspace().validateName(newName, fResource.getType()));
-		if (! result.hasFatalError())
-			result.merge(RefactoringStatus.create(c.getWorkspace().validatePath(createNewPath(newName), fResource.getType())));		
-		return result;		
-	}
-	
-	/* non java-doc
-	 * @see Refactoring#checkInput(IProgressMonitor)
-	 */
-	public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context)  {
-		pm.beginTask("", 1); //$NON-NLS-1$
-		try{
-			return new RefactoringStatus();
-		} finally{
-			pm.done();
-		}	
-	}
-
-	private String createNewPath(String newName){
-		return fResource.getFullPath().removeLastSegments(1).append(newName).toString();
-	}
-		
-	//--- changes 
-	
-	/* non java-doc 
-	 * @see IRefactoring#createChange(IProgressMonitor)
-	 */
-	public Change createChange(IProgressMonitor pm) {
-		pm.beginTask("", 1); //$NON-NLS-1$
-		try{
-			return new ResourceRenameChange(fResource, getNewElementName());
-		} finally{
-			pm.done();
-		}	
-	}
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameTargetNamespaceProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameTargetNamespaceProcessor.java
deleted file mode 100644
index 03fe81e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameTargetNamespaceProcessor.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-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.ParticipantManager;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
-import org.eclipse.wst.xsd.ui.internal.refactor.INameUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.IReferenceUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringComponent;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.TextChangeManager;
-import org.eclipse.xsd.XSDSchema;
-
-
-public class RenameTargetNamespaceProcessor extends RenameProcessor implements INameUpdating, IReferenceUpdating
-{
-	private String newNamespace;
-	private boolean updateReferences = true;
-	private TextChangeManager changeManager;
-	private XSDSchema model;
-
-
-	public static final String IDENTIFIER = "org.eclipse.wst.ui.xsd.renameComponentProcessor"; //$NON-NLS-1$
-
-	public RenameTargetNamespaceProcessor(XSDSchema model, String newName)
-	{
-		this.model = model;
-		this.newNamespace = newName;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#canEnableTextUpdating()
-	 */
-	public boolean canEnableTextUpdating()
-	{
-		return true;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#getCurrentElementName()
-	 */
-	public String getCurrentElementName()
-	{
-		//
-		return model.getTargetNamespace();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.xsd.internal.refactoring.rename.XSDRenameProcessor#getAffectedProjectNatures()
-	 */
-	protected String[] getAffectedProjectNatures() throws CoreException
-	{
-		// TODO: find project natures of the files that are going to be
-		// refactored
-		return new String[]{"org.eclipse.jdt.core.javanature"};
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.xsd.internal.refactoring.rename.XSDRenameProcessor#loadDerivedParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus,
-	 *      java.util.List, java.lang.String[],
-	 *      org.eclipse.ltk.core.refactoring.participants.SharableParticipants)
-	 */
-	protected void loadDerivedParticipants(RefactoringStatus status,
-			List result, String[] natures, SharableParticipants shared)
-			throws CoreException
-	{
-		String newCUName= getNewElementName(); //$NON-NLS-1$
-		RenameArguments arguments= new RenameArguments(newCUName, getUpdateReferences());
-		loadDerivedParticipants(status, result, 
-			computeDerivedElements(), arguments, 
-			 natures, shared);
-	}
-	
-	protected void loadDerivedParticipants(RefactoringStatus status, List result, Object[] derivedElements, 
-			RenameArguments arguments,  String[] natures, SharableParticipants shared) throws CoreException {
-		if (derivedElements != null) {
-			for (int i= 0; i < derivedElements.length; i++) {
-				RenameParticipant[] participants= ParticipantManager.loadRenameParticipants(status, 
-					this, derivedElements[i], 
-					arguments, natures, shared);
-				result.addAll(Arrays.asList(participants));
-			}
-		}
-		
-	}
-	
-	private Object[] computeDerivedElements() {
-
-		Object[] elements = getElements();
-		Object[] results = new Object[elements.length];
-		for(int i=0; i< elements.length; i++){
-			RefactoringComponent component = (RefactoringComponent)elements[i];
-			results[i] = component.getModelObject();
-			
-		}
-		return results;
-		
-	}
-	
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor,
-	 *      org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
-	 */
-	public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
-			CheckConditionsContext context) throws CoreException,
-			OperationCanceledException
-	{
-		try
-		{
-			RefactoringStatus result = new RefactoringStatus();
-			pm.beginTask("", 9); //$NON-NLS-1$
-			changeManager = createChangeManager(new SubProgressMonitor(pm, 1),
-					result);
-			return result;
-		} finally
-		{
-			pm.done();
-		}
-		
-
-	}
-
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
-			throws CoreException, OperationCanceledException
-	{
-		// TODO add code to check initial conditions for component rename
-		return new RefactoringStatus();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public Change createChange(IProgressMonitor pm) throws CoreException,
-			OperationCanceledException
-	{
-		try
-		{
-			String changeName = RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_updates");
-			return new CompositeChange(changeName, changeManager.getAllChanges());
-		} finally
-		{
-			pm.done();
-		}
-
-		// Change[] changes = ComponentRenameChange.createChangesFor(
-		// this.fNamedComponent, getNewElementName());
-		//
-		// if (changes.length > 0)
-		// {
-		// CompositeChange multiChange = null;
-		// multiChange = new CompositeChange(
-		// "XSD component rename participant changes", changes); //$NON-NLS-1$
-		// TODO: externalize string
-		// return multiChange;
-		// } else
-		// {
-		//
-		// return new ComponentRenameChange(
-		// fNamedComponent,
-		// fNamedComponent.getName(),
-		// getNewElementName(),
-		// fNamedComponent.getSchema());
-		// }
-		
-		
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
-	 */
-	public Object[] getElements()
-	{
-		return new Object[] { model };
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
-	 */
-	public String getIdentifier()
-	{
-		return IDENTIFIER;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
-	 */
-	public String getProcessorName()
-	{
-		return RefactoringMessages.getFormattedString(
-				"RenameComponentRefactoring.name", //$NON-NLS-1$
-				new String[]
-				{
-						getCurrentElementName(),
-						getNewElementName() });
-
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
-	 */
-	public boolean isApplicable() throws CoreException
-	{
-		if (getModel() == null)
-			return false;
-		// TODO implement isApplicable logic for the named component,
-		// verify how it is different from other condition checks
-		// if (fNamedComponent.isAnonymous())
-		// return false;
-		// if (! Checks.isAvailable(fType))
-		// return false;
-		// if (isSpecialCase(fType))
-		// return false;
-		return true;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#checkNewElementName(java.lang.String)
-	 */
-	public RefactoringStatus checkNewElementName(String newName)
-	{
-		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
-		// TODO: implement new name checking
-		// RefactoringStatus result = Checks.checkTypeName(newName);
-		// if (Checks.isAlreadyNamed(fType, newName))
-		// result.addFatalError(RefactoringCoreMessages.getString("RenameTypeRefactoring.choose_another_name"));
-		// //$NON-NLS-1$
-		return new RefactoringStatus();
-	}
-
-	public final RefactoringParticipant[] loadParticipants(
-			RefactoringStatus status, SharableParticipants sharedParticipants)
-			throws CoreException
-	{
-		RenameArguments arguments = new RenameArguments(getNewElementName(),
-				true);
-		String[] natures = getAffectedProjectNatures();
-		List result = new ArrayList();
-		loadElementParticipants(status, result, arguments, natures,
-				sharedParticipants);
-		loadDerivedParticipants(status, result, natures, sharedParticipants);
-		return (RefactoringParticipant[]) result
-				.toArray(new RefactoringParticipant[result.size()]);
-	}
-
-	protected void loadElementParticipants(RefactoringStatus status,
-			List result, RenameArguments arguments, String[] natures,
-			SharableParticipants shared) throws CoreException
-	{
-		Object[] elements = getElements();
-		for (int i = 0; i < elements.length; i++)
-		{
-			result.addAll(Arrays.asList(ParticipantManager
-					.loadRenameParticipants(status, this, elements[i],
-							arguments, natures, shared)));
-		}
-	}
-	
-	private TextChangeManager createChangeManager(IProgressMonitor pm,
-			RefactoringStatus status) throws CoreException
-	{
-		TextChangeManager manager = new TextChangeManager(false);
-		// only one declaration gets updated
-		addDeclarationUpdate(manager);
-		return manager;
-	}
-
-	private void addDeclarationUpdate(TextChangeManager manager)
-
-	{
-		String fileStr = getModel().getSchemaLocation();
-		URI uri = URI.createPlatformResourceURI(fileStr);
-		try
-		{
-			URL url = new URL(uri.toString());
-			url = Platform.resolve(url);
-			if(url != null){
-				IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-				IFile file = root.getFileForLocation(new Path(url.getFile()));
-				if(file != null ){
-					TextChange change = manager.get(file);
-					addDeclarationUpdate(change);
-				}
-			}
-		} catch (MalformedURLException e)
-		{
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (IOException e)
-		{
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		
-		
-	}
-	
-	
-
-	final void addDeclarationUpdate(TextChange change) 
-	{
-//		String editName = RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_update_declatation");;
-//	  
-//		NamedComponentRenamer renamer = new NamedComponentRenamer(
-//				selectedComponent.getElement(), newNamespace);
-//		renamer.renameComponent();
-//		List textEdits = renamer.getTextEdits();
-//		for (int j = 0; j < textEdits.size(); j++)
-//		{
-//			ReplaceEdit replaceEdit = (ReplaceEdit) textEdits
-//					.get(j);
-//			TextChangeCompatibility.addTextEdit(change,
-//					editName, replaceEdit);
-//		}
-	}
-
-	public void setNewElementName(String newName)
-	{
-		this.newNamespace = newName;
-	}
-
-	public String getNewElementName()
-	{
-		return newNamespace;
-	}
-
-	
-
-	public boolean canEnableUpdateReferences()
-	{
-		return true;
-	}
-
-	public boolean getUpdateReferences()
-	{
-		return updateReferences;
-	}
-
-	public void setUpdateReferences(boolean update)
-	{
-		updateReferences = update;
-		
-	}
-
-	public final TextChangeManager getChangeManager()
-	{
-		return changeManager;
-	}
-
-	public final XSDSchema getModel()
-	{
-		return model;
-	}
-	
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java
deleted file mode 100644
index ed6650c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-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.IProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-
-/**
- * Represents a change that renames a given resource
- */
-public class ResourceRenameChange extends Change {
-
-	/*
-	 * we cannot use handles because they became invalid when you rename the resource.
-	 * paths do not.
-	 */
-	private IPath fResourcePath;
-
-	private String fNewName;
-
-	/**
-	 * @param newName includes the extension
-	 */
-	public ResourceRenameChange(IResource resource, String newName) {
-		this(resource.getFullPath(), newName);
-	}
-
-	private ResourceRenameChange(IPath resourcePath, String newName) {
-		fResourcePath= resourcePath;
-		fNewName= newName;
-	}
-
-	private IResource getResource() {
-		return ResourcesPlugin.getWorkspace().getRoot().findMember(fResourcePath);
-	}
-
-	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
-		
-		// TODO: implement file validation, see JDTChange
-		return new RefactoringStatus();
-	}
-	
-	/*
-	 * to avoid the exception senders should check if a resource with the new name
-	 * already exists
-	 */
-	public Change perform(IProgressMonitor pm) throws CoreException {
-		try {
-			if (false)
-				throw new NullPointerException();
-			pm.beginTask(RefactoringMessages.getString("XSDRenameResourceChange.rename_resource"), 1); //$NON-NLS-1$
-
-			getResource().move(renamedResourcePath(fResourcePath, fNewName), getCoreRenameFlags(), pm);
-
-			String oldName= fResourcePath.lastSegment();
-			IPath newPath= renamedResourcePath(fResourcePath, fNewName);
-			return new ResourceRenameChange(newPath, oldName);
-		} finally {
-			pm.done();
-		}
-	}
-
-	private int getCoreRenameFlags() {
-		if (getResource().isLinked())
-			return IResource.SHALLOW;
-		else
-			return IResource.NONE;
-	}
-
-	/*
-	 * changes resource names /s/p/A.java renamed to B.java becomes /s/p/B.java
-	 */
-	public static IPath renamedResourcePath(IPath path, String newName) {
-		return path.removeLastSegments(1).append(newName);
-	}
-
-	public String getName() {
-		return RefactoringMessages.getFormattedString(
-			"XSDRenameResourceChange.name", new String[]{fResourcePath.toString(), //$NON-NLS-1$
-			renamedResourcePath(fResourcePath, fNewName).toString()});
-	}
-
-	public Object getModifiedElement() {
-		return getResource();
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public void initializeValidationData(IProgressMonitor pm) {
-		// TODO Auto-generated method stub
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java
deleted file mode 100644
index 78c9932..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-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.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-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.RenameParticipant;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.TextChangeManager;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * This rename participant creates text changes for the references of the XSD and WSDL files
- */
-public class ResourceRenameParticipant extends RenameParticipant {
-	
-	private IFile file = null;
-	private TextChangeManager changeManager;
-
-	
-	private static String XSD_CONTENT_TYPE_ID = "org.eclipse.wst.xsd.core.xsdsource";
-	private static String WSDL_CONTENT_TYPE_ID = "org.eclipse.wst.wsdl.wsdlsource";
-
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
-	 */
-	protected boolean initialize(Object element) {
-		if(element instanceof IFile) {
-			// check if file has XSD or WSDL content
-			IFile aFile = (IFile) element;
-			try {
-				IContentDescription description = aFile.getContentDescription();
-				IContentType contentType = description.getContentType();
-				if(contentType != null){
-					if(XSD_CONTENT_TYPE_ID.equals(contentType.getId()) ||
-							WSDL_CONTENT_TYPE_ID.equals(contentType.getId())){
-						file = aFile;
-						return true;
-					}
-				}
-			} catch (CoreException e) {
-				return false;
-			}
-		}
-		return false;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
-	 */
-	public String getName() {
-		return RefactoringMessages.getString("ResourceRenameParticipant.compositeChangeName");
-	}
-	
-	private IPath getNewFilePath() {
-		
-		IPath oldPath = file.getRawLocation();
-		IPath newPath = oldPath.removeLastSegments(1).append(getArguments().getNewName());
-		return newPath;
-	}
-
-	public RefactoringStatus checkConditions(IProgressMonitor pm,
-			CheckConditionsContext context) throws OperationCanceledException
-	{
-		RefactoringStatus result = new RefactoringStatus();
-		try
-		{
-			pm.beginTask("", 9); //$NON-NLS-1$
-			changeManager = createChangeManager(new SubProgressMonitor(pm, 1),
-					result);
-			
-		} catch(CoreException e){
-			result.addFatalError(e.toString());
-		}
-		finally
-		{
-			pm.done();
-		}
-		return result;
-
-	}
-	
-	
-
-	public Change createChange(IProgressMonitor pm) throws CoreException,
-			OperationCanceledException
-	{
-		try
-		{
-			String changeName = RefactoringMessages.getString("RenameResourceChange.rename_resource_reference_change");
-			TextChange[] changes =  changeManager.getAllChanges();
-			if(changes.length > 0){
-				return new CompositeChange(changeName, changes);
-			}
-			else{
-				return null;
-			}
-			
-		} finally
-		{
-			pm.done();
-		}
-
-	}
-	
-	
-	private TextChangeManager createChangeManager(IProgressMonitor pm,
-			RefactoringStatus status) throws CoreException
-	{
-		TextChangeManager manager = new TextChangeManager(false);
-		// only one declaration gets updated
-		//addDeclarationUpdate(manager);
-		if (getArguments().getUpdateReferences())
-			addOccurrences(manager, pm, status);
-		return manager;
-	}
-
-
-
-	void addOccurrences(TextChangeManager manager, IProgressMonitor pm,
-			RefactoringStatus status) throws CoreException
-	{
-//		
-//		Object[] occurrences = SearchTools.getFileDependencies(file);
-//		pm.beginTask("", occurrences.length); //$NON-NLS-1$
-//		
-//		for (int i = 0; i < occurrences.length; i++)
-//		{
-//			Object object = occurrences[i];
-//
-//			if (object instanceof SearchResultGroup)
-//			{
-//				SearchResultGroup searchResult = (SearchResultGroup) object;
-//				if (searchResult == null)
-//					continue;
-//				
-//				IFile referencingFile = (IFile)searchResult.getResource();
-//					
-//				resourceSet = new ResourceSetImpl();
-//				// for each result file create XSD model and get component from that model
-//				resourceSet.getAdapterFactories().add(
-//						new XSDSchemaLocationResolverAdapterFactory());
-//				URI uri = URI.createFileURI(referencingFile.getLocation().toPortableString());
-//				try
-//				{
-//					XSDSchema schema = XSDFactory.eINSTANCE.createXSDSchema();
-//					IStructuredModel structuredModel = StructuredModelManager.getModelManager().getModelForRead(referencingFile);
-//					IDOMModel domModel = (IDOMModel) structuredModel;
-//					Resource resource = new XSDResourceImpl();
-//					resource.setURI(uri);
-//					schema = XSDFactory.eINSTANCE.createXSDSchema();
-//					resource.getContents().add(schema);
-//					resourceSet.getResources().add(resource);
-//					schema.setElement(domModel.getDocument().getDocumentElement());
-//					// get target namespace 
-//					String stringPath = file.getLocation().toString();
-//					String targetNamespace = XMLQuickScan.getTargetNamespace(stringPath);
-//					targetNamespace = targetNamespace == null ? "" : targetNamespace;
-//
-//					List textEdits = new ArrayList();
-//					SearchMatch[] matches = searchResult.getSearchResults();
-//					
-//					for (int j = 0; j < matches.length; j++) {
-//						SearchMatch match = matches[j];
-//						
-//						FileReferenceRenamer renamer = new FileReferenceRenamer(
-//								match.getAttrValue(), targetNamespace, getNewFilePath().toString(), schema);
-//						renamer.visitSchema(schema);
-//					    textEdits.addAll(renamer.getTextEdits());
-//					}
-//					
-//					
-//					if(!textEdits.isEmpty()){
-//						TextChange textChange = manager.get(referencingFile);
-//						for (int j = 0; j < textEdits.size(); j++)
-//						{
-//							ReplaceEdit replaceEdit = (ReplaceEdit) textEdits
-//									.get(j);
-//							String editName = RefactoringMessages.getString("ResourceRenameParticipant.File_Rename_update_reference");
-//							TextChangeCompatibility.addTextEdit(textChange,
-//									editName, replaceEdit);
-//						}
-//					}
-//					
-//				} catch (Exception e)
-//				{
-//					e.printStackTrace();
-//				} finally
-//				{
-//
-//				}
-//			}
-//		}
-	}
-	
-	
-	public  class ReferenceLocationFinder
-	{
-		protected XSDNamedComponent component;
-		protected String name;
-		protected XSDSchema referencingSchema;
-		protected List results = new ArrayList();
-
-		public ReferenceLocationFinder(XSDNamedComponent component,
-				String name, XSDSchema referencingSchema)
-		{
-			this.component = component;
-			this.name = name;
-			this.referencingSchema = referencingSchema;
-		}
-
-		public void run()
-		{
-			
-			//XSDSwitch xsdSwitch = new XSDSwitch()
-//			{
-//				public Object caseXSDTypeDefinition(XSDTypeDefinition object)
-//				{
-//					GlobalTypeReferenceRenamer renamer = new GlobalTypeReferenceRenamer(
-//							object.getName(), object.getTargetNamespace(), name, referencingSchema);
-//					renamer.visitSchema(referencingSchema);
-//					results.addAll(renamer.getTextEdits());
-//					return null;
-//				}
-//
-//				public Object caseXSDElementDeclaration(
-//						XSDElementDeclaration object)
-//				{
-//					if (object.isGlobal())
-//					{
-//						GlobalElementRenamer renamer = new GlobalElementRenamer(
-//								object.getName(), object.getTargetNamespace(), name, referencingSchema);
-//						renamer.visitSchema(referencingSchema);
-//						results.addAll(renamer.getTextEdits());
-//					}
-//					return null;
-//				}
-//
-//				public Object caseXSDModelGroupDefinition(
-//						XSDModelGroupDefinition object)
-//				{
-//					GlobalGroupRenamer renamer = new GlobalGroupRenamer(
-//							object.getName(), object.getTargetNamespace(), name, referencingSchema);
-//					renamer.visitSchema(referencingSchema);
-//					return null;
-//				}
-//			};
-			//xsdSwitch.doSwitch(component);
-//			component.setName(name);
-//			try
-//			{
-//				referencingSchema.eResource().save(new HashMap());
-//			} catch (IOException e)
-//			{
-//				e.printStackTrace();
-//			}
-
-		}
-
-		public final List getResults()
-		{
-			return results;
-		}
-	}
-	
-	
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/SortingSearchRequestor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/SortingSearchRequestor.java
deleted file mode 100644
index 25179e7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/SortingSearchRequestor.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class SortingSearchRequestor extends SearchRequestor {
-	
-	public static String NONAMESPACE = "nonamespace";
-
-	
-		private Map fFound;
-
-		public SortingSearchRequestor() {
-			fFound= new HashMap();
-		}
-		
-
-		
-		/**
-		 * @return a List of {@link SearchMatch}es (sorted by namespace)
-		 */
-		public Map/* namespace - <SearchMatch>*/ getResults() {
-			return fFound;
-		}
-
-
-
-		/* (non-Javadoc)
-		 * @see org.eclipse.wst.common.core.search.internal.provisional.SearchRequestor#acceptSearchMatch(org.eclipse.wst.common.search.internal.provisional.SearchMatch)
-		 */
-		public void acceptSearchMatch(SearchMatch match) throws CoreException {
-
-			
-			if(match != null && match.getObject() instanceof Node){
-				Node node = (Node)match.getObject();
-				Element domElement = null;
-				switch (node.getNodeType()) {
-				case Node.ATTRIBUTE_NODE:
-					domElement = ((Attr)node).getOwnerElement();
-					break;
-				case Node.ELEMENT_NODE:
-					domElement = ((Element)node);
-					break;
-				default:
-					break;
-				}
-				String namespace = domElement.getNamespaceURI();
-				if(namespace == null || namespace.equals("")){
-					namespace = NONAMESPACE;
-				}
-				List matches = getMatches(namespace);
-				matches.add(match);			
-			}
-			
-		}
-		
-		private List getMatches(String namespace){
-			Object matches = fFound.get(namespace);
-			if(!(matches instanceof List)){
-				matches = new ArrayList();
-				fFound.put(namespace, matches);
-			}
-			return (List)matches;
-			
-		}
-		
-	
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XMLComponentRenameParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XMLComponentRenameParticipant.java
deleted file mode 100644
index cce160c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XMLComponentRenameParticipant.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-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.RenameParticipant;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.TextChangeManager;
-import org.eclipse.wst.xsd.ui.internal.refactor.util.TextChangeCompatibility;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Node;
-
-public class XMLComponentRenameParticipant extends RenameParticipant {
-	
-	protected SearchMatch match;
-
-	protected TextChangeManager changeManager;
-	protected List matches;
-
-    
-    
-	protected boolean initialize(Object element) {
-		
-		if(getArguments() instanceof ComponentRenameArguments){
-			// changeManger is passed in from the RenameComponentProcessor to collect all the changes
-			changeManager = ((ComponentRenameArguments)getArguments()).getChangeManager();
-		}
-		
-		return false;
-	}
-	
-	public String getName() {
-		return "XML Component Rename Participant";
-	}
-
-	public RefactoringStatus checkConditions(IProgressMonitor monitor,
-			CheckConditionsContext context) throws OperationCanceledException {
-		return null;
-	}
-	
-	public TextChangeManager getChangeManager(){
-		
-		if(changeManager == null){
-				changeManager = new TextChangeManager(false);
-		}
-		return changeManager;
-		
-	}
-	
-	private RefactoringStatus createRenameChanges(final IProgressMonitor monitor) throws CoreException {
-		Assert.isNotNull(monitor);
-		final RefactoringStatus status= new RefactoringStatus();
-		try {
-			monitor.beginTask("RefactoringMessages.RenameComponentRefactoring_searching", 1); 
-			createRenameChanges(new SubProgressMonitor(monitor, 1));
-			//updateChangeManager(new SubProgressMonitor(monitor, 1), status);
-		} finally {
-			monitor.done();
-		}
-		return status;
-	}
-
-	public Change createChange(IProgressMonitor pm) throws CoreException,
-			OperationCanceledException {
-		//System.out.println("createChange("  + getChangeManager() + ")" + matches.size());
-		for (Iterator iter = matches.iterator(); iter.hasNext();) {
-			SearchMatch match = (SearchMatch) iter.next();
-			TextChange textChange = getChangeManager().get(match.getFile());
-			String newName = getArguments().getNewName();
-			String qualifier = "";
-			if(getArguments() instanceof ComponentRenameArguments){
-				qualifier = ((ComponentRenameArguments)getArguments()).getQualifier();
-			}
-			if(match.getObject() instanceof Node){
-				Node node = (Node)match.getObject();
-				if(node instanceof IDOMAttr){
-					IDOMAttr attr = (IDOMAttr)node;
-					IDOMElement element = (IDOMElement)attr.getOwnerElement() ;
-					newName = getNewQName(element, qualifier, newName);
-				}
-				newName = RenameComponentProcessor.quoteString(newName);
-			}
-			
-			ReplaceEdit replaceEdit = new ReplaceEdit(match.getOffset(), match.getLength(), newName );
-			String editName = RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_update_reference");
-          //  System.out.println("textChange " + textChange + "/ replaceEdit " + replaceEdit);
-			TextChangeCompatibility.addTextEdit(textChange, editName, replaceEdit);
-   		}
-		// don't create any change now, all the changes are in changeManger variable and will be combined in RenameComponentProcessor.postCreateChange method
-		return null;
-	}
-	
-	private static String getNewQName(Node node, String targetNamespace, String newName) {
-		StringBuffer sb = new StringBuffer();
-		if (newName != null) {
-			String prefix = XSDConstants.lookupQualifier(node, targetNamespace);
-			if (prefix != null && prefix.length() > 0) {
-				sb.append(prefix);
-				sb.append(":");
-				sb.append(newName);
-			} else {
-				sb.append(newName);
-			}
-		} else {
-			sb.append(newName);
-		}
-
-		return sb.toString();
-	}
-
-  public void setChangeManager(TextChangeManager changeManager)
-  {
-    this.changeManager = changeManager;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDComponentRenameParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDComponentRenameParticipant.java
deleted file mode 100644
index c61fc01..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDComponentRenameParticipant.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.List;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDNamedComponent;
-
-/**
- * This participant takes case of renaming matches that are XSD components
- */
-public class XSDComponentRenameParticipant extends XMLComponentRenameParticipant {
-
-protected boolean initialize(Object element) {
-		super.initialize(element);
-		if(element instanceof XSDNamedComponent){
-			if(getArguments() instanceof ComponentRenameArguments){
-				matches = (List)((ComponentRenameArguments)getArguments()).getMatches().get(IXSDSearchConstants.XMLSCHEMA_NAMESPACE);
-			}
-			if(matches != null){
-				return true;
-			}
-		}
-		return false;
-	}
-
-	public String getName() {
-		
-		return "XSD component rename participant";
-	}
-
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/AbstractCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/AbstractCommand.java
deleted file mode 100644
index 3972831..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/AbstractCommand.java
+++ /dev/null
@@ -1,71 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.structure;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-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.format.FormatProcessorXML;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-public abstract class AbstractCommand 
-{
-  private XSDConcreteComponent parent;
-  private XSDConcreteComponent model;
-
-  protected AbstractCommand(XSDConcreteComponent parent)
-  {
-    this.parent = parent;
-  }
-  
-  public abstract void run();
-
-  protected XSDConcreteComponent getParent()
-  {
-    return parent;
-  }
-  
-  public XSDConcreteComponent getModelObject()
-  {
-    return model;
-  }
-  
-  protected void setModelObject(XSDConcreteComponent model)
-  {
-    this.model = model;
-  }
-  
-  // Establish part-whole relationship
-  protected abstract boolean adopt(XSDConcreteComponent model);
-
-  protected void formatChild(Element child)
-  {
-    if (child instanceof IDOMNode)
-    {
-      IDOMModel model = ((IDOMNode)child).getModel();
-      try
-      {
-        // tell the model that we are about to make a big model change
-        model.aboutToChangeModel();
-        
-        IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
-        formatProcessor.formatNode(child);
-      }
-      finally
-      {
-        // tell the model that we are done with the big model change
-        model.changedModel(); 
-      }
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeAnonymousTypeGlobalCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeAnonymousTypeGlobalCommand.java
deleted file mode 100644
index 95f96a4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeAnonymousTypeGlobalCommand.java
+++ /dev/null
@@ -1,84 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.structure;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public final class MakeAnonymousTypeGlobalCommand extends AbstractCommand {
-
-	String fNewName;
-
-	public MakeAnonymousTypeGlobalCommand(XSDConcreteComponent element,
-			String newName) {
-		super(element.getContainer());
-		setModelObject(element);
-		fNewName = newName;
-	}
-
-	public void run() {
-		XSDConcreteComponent model = getModelObject();
-		XSDConcreteComponent parent = model.getContainer();
-		XSDTypeDefinition globalTypeDef = null;
-		if (model instanceof XSDComplexTypeDefinition) {
-			if (parent instanceof XSDElementDeclaration) {
-				// clone typedef with it's content and set it global
-				globalTypeDef = (XSDComplexTypeDefinition) model
-						.cloneConcreteComponent(true, false);
-				globalTypeDef.setName(fNewName);
-				parent.getSchema().getContents().add(globalTypeDef);
-				((XSDElementDeclaration) parent)
-						.setTypeDefinition(globalTypeDef);
-			}
-		} else if (model instanceof XSDSimpleTypeDefinition) {
-
-			XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) model;
-			if (parent instanceof XSDElementDeclaration) {
-				// clone typedef with it's content and set it global
-				globalTypeDef = (XSDSimpleTypeDefinition) typeDef
-						.cloneConcreteComponent(true, false);
-				globalTypeDef.setName(fNewName);
-				parent.getSchema().getContents().add(globalTypeDef);
-				((XSDElementDeclaration) parent)
-						.setTypeDefinition(globalTypeDef);
-				formatChild(globalTypeDef.getElement());
-
-			} else if (parent instanceof XSDAttributeDeclaration) {
-				// clone typedef with it's content and set it global
-				globalTypeDef = (XSDSimpleTypeDefinition) typeDef
-						.cloneConcreteComponent(true, false);
-				globalTypeDef.setName(fNewName);
-				parent.getSchema().getContents().add(globalTypeDef);
-				((XSDAttributeDeclaration) parent)
-						.setTypeDefinition((XSDSimpleTypeDefinition) globalTypeDef);
-
-			}
-
-		}
-
-		formatChild(globalTypeDef.getElement());
-
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
-	 */
-	protected boolean adopt(XSDConcreteComponent model) {
-		// TODO Auto-generated method stub
-		return true;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeLocalElementGlobalCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeLocalElementGlobalCommand.java
deleted file mode 100644
index 28bc4ac..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeLocalElementGlobalCommand.java
+++ /dev/null
@@ -1,84 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.structure;
-
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public final class MakeLocalElementGlobalCommand extends AbstractCommand
-{
-	
-  public MakeLocalElementGlobalCommand
-    (XSDConcreteComponent element)
-  {
-    super(element.getContainer());
-    setModelObject(element);
-  }
-  
-  public void run()
-  {
-    
-   if(getModelObject() instanceof XSDElementDeclaration){
-   
-	   XSDElementDeclaration element = (XSDElementDeclaration)getModelObject();
- 	XSDConcreteComponent parent = getParent();
- 	XSDConcreteComponent container = parent.getContainer();
- 	
- 	// clone element with it's content and set it global
-	XSDConcreteComponent  elementDecl = ((XSDElementDeclaration)getModelObject()).cloneConcreteComponent(true, true);
- 	container.getSchema().getContents().add(elementDecl);
- 	
- 	// create local element and set it's reference to the global one
- 	XSDElementDeclaration elementRef = 
-	      XSDFactory.eINSTANCE.createXSDElementDeclaration();
-	elementRef.setValue(element.getValue());
-    elementRef.setResolvedElementDeclaration((XSDElementDeclaration)elementDecl); 
-    
-    // now set content models
- 	if(parent instanceof XSDComplexTypeContent){
- 		if(container instanceof XSDModelGroup){
- 			XSDModelGroup modelGroup = (XSDModelGroup)container;
- 			// disconnect parent from its container
- 			int index = modelGroup.getContents().indexOf(parent);
- 			 XSDParticle particle = 
- 			      XSDFactory.eINSTANCE.createXSDParticle();
- 		    particle.setContent(elementRef);
- 		    modelGroup.getContents().add(index, particle); 
- 		   
- 			modelGroup.getContents().remove(parent);
- 		    modelGroup.updateElement(true);
-  		    formatChild(modelGroup.getElement());
- 		}
- 	}
- 	else if(parent instanceof XSDTypeDefinition){
-		System.out.println("MakeLocalElementGlobalCommand.run: parent instanceof XSDTypeDefinition");
-		 		
- 	}
- 	
- 	container.getSchema().updateElement(true);
-    formatChild(elementDecl.getElement());
-  
-   }
-
-  }
-	/* (non-Javadoc)
-	 * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
-	 */
-	protected boolean adopt(XSDConcreteComponent model) {
-		// TODO Auto-generated method stub
-		return true;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java
deleted file mode 100644
index b737c45..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.refactor.structure;
-
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.text.Assert;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.TextChange;
-import org.eclipse.ltk.core.refactoring.TextFileChange;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-/**
- * @author ebelisar
- * 
- */
-public class MakeTypeGlobalChange extends Change {
-
-	private Map fChanges;
-
-	private String fNewName;
-
-	private XSDTypeDefinition fTypeComponent;
-
-	public MakeTypeGlobalChange(XSDTypeDefinition component, 
-			String newName) {
-		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
-
-		fTypeComponent = component;
-		fNewName = newName;
-	}
-
-	// public static Change[] createChangesFor(XSDNamedComponent component,
-	// String newName) {
-	// // TODO: P1 implement search of XSD files
-	// XSDSearchSupport support = XSDSearchSupport.getInstance();
-	// RefactorSearchRequestor requestor = new
-	// RefactorSearchRequestor(component, newName);
-	// support.searchRunnable(component, IXSDSearchConstants.WORKSPACE_SCOPE,
-	// requestor);
-	//
-	// return requestor.getChanges();
-	//
-	// }
-
-	protected Change createUndoChange() {
-		return new MakeTypeGlobalChange(fTypeComponent, getNewName());
-	}
-
-	protected void doRename(IProgressMonitor pm) throws CoreException {
-		// TODO P1 change temporary rename of XSD model components
-		performModify(getNewName());
-	}
-
-	public void performModify(final String value) {
-			DelayedRenameRunnable runnable = new DelayedRenameRunnable(
-					fTypeComponent, value);
-			// TODO: remove Display
-			//Display.getCurrent().asyncExec(runnable);
-	}
-
-	protected static class DelayedRenameRunnable implements Runnable {
-		protected XSDTypeDefinition component;
-
-		protected String name;
-
-		public DelayedRenameRunnable(XSDTypeDefinition component, String name) {
-			this.component = component;
-			this.name = name;
-		}
-
-		public void run() {
-			DocumentImpl doc = (DocumentImpl) component.getElement().getOwnerDocument();
-			doc.getModel().beginRecording(
-							this,
-							RefactoringMessages
-									.getString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"));
-			MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand(
-					component, name);
-			command.run();
-			doc.getModel().endRecording(this);
-		}
-	}
-
-	public TextChange getChange(IFile file) {
-		TextChange result = (TextChange) fChanges.get(file);
-		if (result == null) {
-			result = new TextFileChange(file.getName(), file);
-			fChanges.put(file, result);
-		}
-		return result;
-	}
-
-	public String getName() {
-		return RefactoringMessages
-				.getFormattedString(
-						"MakeTypeGlobalChange.name", new String[] {getNewName() }); //$NON-NLS-1$
-	}
-
-	public final Change perform(IProgressMonitor pm) throws CoreException {
-		try {
-			pm.beginTask(RefactoringMessages
-					.getString("XSDComponentRenameChange.Renaming"), 1); //$NON-NLS-1$
-			Change result = createUndoChange();
-			doRename(new SubProgressMonitor(pm, 1));
-			return result;
-		} finally {
-			pm.done();
-		}
-	}
-
-	/**
-	 * Gets the newName.
-	 * 
-	 * @return Returns a String
-	 */
-	protected String getNewName() {
-		return fNewName;
-	}
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.Change#getModifiedElement()
-	 */
-	public Object getModifiedElement() {
-		// TODO Auto-generated method stub
-		return fTypeComponent;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public void initializeValidationData(IProgressMonitor pm) {
-		// TODO Auto-generated method stub
-
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.Change#isValid(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
-			OperationCanceledException {
-		// TODO implement change validation
-		return new RefactoringStatus();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java
deleted file mode 100644
index 28f09f2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.structure;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
-import org.eclipse.wst.xsd.ui.internal.refactor.INameUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class MakeTypeGlobalProcessor extends RenameProcessor implements INameUpdating{
-	
-	private XSDTypeDefinition fTypeComponent;
-	private String fNewElementName;
-
-	public static final String IDENTIFIER= "org.eclipse.wst.ui.xsd.makeTypeGlobalProcessor"; //$NON-NLS-1$
-
-	//private QualifiedNameSearchResult fNameSearchResult;
-	
-	public MakeTypeGlobalProcessor(XSDTypeDefinition element, String newName) {
-		fTypeComponent= element;
-		fNewElementName = newName;
-		
-	}
-	
-	public XSDTypeDefinition getTypeComponent() {
-		return fTypeComponent;
-	}
-
-	
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#canEnableTextUpdating()
-	 */
-	public boolean canEnableTextUpdating() {
-		return true;
-	}
-
-	protected String[] getAffectedProjectNatures() throws CoreException {
-		//TODO: find project natures of the files that are going to be refactored
-		return new String[0];
-	}
-	
-	protected void loadDerivedParticipants(RefactoringStatus status,
-			List result, String[] natures, SharableParticipants shared)
-			throws CoreException {
-		// TODO: provide a way to load rename participants
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
-	 */
-	public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
-			CheckConditionsContext context) throws CoreException,
-			OperationCanceledException {
-		// TODO add code to check final conditions for component rename
-		return new RefactoringStatus();
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
-			throws CoreException, OperationCanceledException {
-//		 TODO add code to check initial conditions for component rename
-		return new RefactoringStatus();
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public Change createChange(IProgressMonitor pm) throws CoreException,
-			OperationCanceledException {
-		// TODO P1 add change creation
-//		Change[] changes = XSDComponentRenameChange.createChangesFor(this.fNamedComponent, getNewElementName());
-//		CompositeChange multiChange = null; 
-//			if(changes.length > 0)
-//				multiChange  = new CompositeChange("XSD component rename participant changes", changes); //$NON-NLS-1$ TODO: externalize string
-//		return multiChange;
-		
-//		computeNameMatches(pm);	
-//		Change[] changes = fNameSearchResult.getAllChanges();
-//		return new CompositeChange("XSD file rename participant changes", changes); //TODO: externalize string
-		pm.beginTask("", 1); //$NON-NLS-1$
-		try{
-			return new MakeTypeGlobalChange(fTypeComponent, getNewElementName());
-		} finally{
-			pm.done();
-		}	 
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
-	 */
-	public Object[] getElements() {
-		
-		return new Object[] {fTypeComponent};
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
-	 */
-	public String getIdentifier() {
-		return IDENTIFIER;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
-	 */
-	public String getProcessorName() {
-		return RefactoringMessages.getFormattedString(
-				"MakeLocalTypeGlobalRefactoring.name",  //$NON-NLS-1$
-				new String[]{getNewElementName()});
-
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
-	 */
-	public boolean isApplicable() throws CoreException {
-		if (fTypeComponent == null)
-			return false;
-		// TODO implement isApplicable logic for the named component, 
-		// verify how it is different from other condition checks
-//		if (fNamedComponent.isAnonymous())
-//			return false;
-//		if (! Checks.isAvailable(fType))
-//			return false;
-//		if (isSpecialCase(fType))
-//			return false;
-		return true;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#checkNewElementName(java.lang.String)
-	 */
-	public RefactoringStatus checkNewElementName(String newName){
-		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
-		// TODO: implement new name checking
-//		RefactoringStatus result = Checks.checkTypeName(newName);
-//		if (Checks.isAlreadyNamed(fType, newName))
-//			result.addFatalError(RefactoringCoreMessages.getString("RenameTypeRefactoring.choose_another_name"));	 //$NON-NLS-1$
-		return new RefactoringStatus();
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#getNewElement()
-	 */
-	public Object getNewElement() throws CoreException {
-		// TODO implement this method, it's used for updating selection on new element
-		return null;
-	}
-	
-//	private void computeNameMatches(IProgressMonitor pm) throws CoreException {
-//	
-//	    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
-//	    try {
-//			URL fileURL = Platform.resolve(new URL(fNamedComponent.getSchema().getSchemaLocation()));
-//			IFile file = workspaceRoot.getFileForLocation(new Path(fileURL.getPath()));
-//			if (fNameSearchResult == null)
-//				fNameSearchResult= new QualifiedNameSearchResult();
-//			QualifiedNameFinder.process(fNameSearchResult, getNamedComponent().getName(),  
-//				getNewElementName(), 
-//				"*.xsd", file.getProject(), pm);
-//		} catch (IOException e) {
-//			// TODO Auto-generated catch block
-//			e.printStackTrace();
-//		}
-//	}
-	
-	public final RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException {
-		RenameArguments arguments= new RenameArguments(getNewElementName(), true);
-		String[] natures= getAffectedProjectNatures();
-		List result= new ArrayList();
-		loadElementParticipants(status, result, arguments, natures, sharedParticipants);
-		loadDerivedParticipants(status, result, natures, sharedParticipants);
-		return (RefactoringParticipant[])result.toArray(new RefactoringParticipant[result.size()]);
-	}
-	
-	protected void loadElementParticipants(RefactoringStatus status, List result, RenameArguments arguments, String[] natures, SharableParticipants shared) throws CoreException {
-		Object[] elements= getElements();
-		for (int i= 0; i < elements.length; i++) {
-			result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status, 
-				this,  elements[i],
-				arguments, natures, shared)));
-		}
-	}
-	
-	
-	public void setNewElementName(String newName) {
-		
-		fNewElementName= newName;
-	}
-
-	public String getNewElementName() {
-		return fNewElementName;
-	}
-
-	public String getCurrentElementName() {
-		// TODO Auto-generated method stub
-		return fNewElementName;
-	}
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/LinkURLHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/LinkURLHelper.java
deleted file mode 100644
index 30274d4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/LinkURLHelper.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Created on Sep 21, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.xsd.ui.internal.refactor.util;
-
-
-
-
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import org.eclipse.wst.common.uriresolver.internal.URI;
-import org.eclipse.wst.sse.core.internal.util.PathHelper;
-
-
-/**
- * Hyperlink manager. Proved useful services like link conversion
- * An utility class to help other parsre modules to convert links
- */
-public class LinkURLHelper {
-
-	private static final String FILE_PROTOCOL_SEARCH_SIG = "file:/";//$NON-NLS-1$
-	private static final String FILE_PROTOCOL_SIG = "file:///";//$NON-NLS-1$
-	private static String RELATIVE_PATH_SIG = "..";//$NON-NLS-1$	
-	private static final String FORWARD_SLASH = "/";//$NON-NLS-1$	
-	private URL fBaseUrl = null; // base url. assumed to a absulute url
-	private String fBaseUrlString = null;
-	private URL fDocRoot = null;
-	private String fDocRootString = null;
-
-	public LinkURLHelper(String baseUrl) {
-		initialize(baseUrl, null);
-	}
-
-
-	public LinkURLHelper(String baseUrl, String docRoot) {
-		initialize(baseUrl, docRoot);
-	}
-
-	/**
-	 * Special adujust for file url
-	 */
-	public String adjustFileProtocolUrl(String url) {
-		if (url.startsWith(FILE_PROTOCOL_SEARCH_SIG)) {
-			url = FILE_PROTOCOL_SIG + url.substring(FILE_PROTOCOL_SEARCH_SIG.length());
-		}
-		return url;
-	}
-
-	private String convert(String url, URL baseUrl, String urlString) {
-		String absUrl = url;
-		if (baseUrl != null) {
-			try {
-				// do special thing file protocol
-				if (baseUrl.getProtocol().equalsIgnoreCase("file")) {//$NON-NLS-1$
-					// remove the fist
-					if (url.startsWith("/"))//$NON-NLS-1$
-						url = url.substring(1);
-					// empty string causes malformed exception	
-					String tempUrl = url;
-					if ("".equals(url))//$NON-NLS-1$
-						tempUrl = " ";//$NON-NLS-1$
-					URL newUrl = new URL(baseUrl, tempUrl);
-					// do extra math for file protocol to support ie based
-					absUrl = adjustFileProtocolUrl(newUrl.toString());
-				}
-				else {
-					URL newUrl = new URL(fBaseUrl, url);
-					absUrl = newUrl.toString();
-				}
-			}
-			catch (MalformedURLException me) {
-			}
-			// convert everything to forward slash
-			absUrl = PathHelper.switchToForwardSlashes(absUrl);
-		}
-		else {
-			// the given may be based on file
-			if (urlString != null) {
-				// swich the url to proper direction
-				url = PathHelper.removeLeadingSeparator(url);
-				File fle = new File(urlString, url);
-				absUrl = fle.getPath();
-
-			}
-			// convert everything to forward slash
-			absUrl = PathHelper.switchToForwardSlashes(absUrl);
-
-			// if the path ends with ".." we need to add a terminating slash or 
-			// else the link will not be resolved correctly.  (it will look like
-			// /url/path/to/somewhere/.. instead of /url/path/to/
-			if (absUrl.endsWith(FORWARD_SLASH + RELATIVE_PATH_SIG)) {
-				absUrl += FORWARD_SLASH;
-			}
-		}
-
-		// resolve relative path to absolute
-		absUrl = PathHelper.adjustPath(absUrl);
-		return absUrl;
-	}
-
-	private void initialize(String baseUrl, String docRoot) {
-		//
-		// Find out whether baes url is a url or file name
-		//
-		if ( URI.validScheme(baseUrl) ) {
-			try {
-				String temp = PathHelper.appendTrailingURLSlash(baseUrl);
-				fBaseUrl = new URL(temp);
-			}
-			catch (MalformedURLException mue) {
-				// it is a file based url
-				fBaseUrlString = baseUrl;
-			}
-		}
-		else {
-			// it is a file based url
-			fBaseUrlString = baseUrl;
-		}
-
-		// do the same for doc root
-		if (docRoot != null) {
-			if ( URI.validScheme(docRoot) ) {
-				try {
-					String temp = PathHelper.appendTrailingURLSlash(docRoot);
-					fDocRoot = new URL(temp);
-	
-				}
-				catch (MalformedURLException mue) {
-					// it is a file based url
-					fDocRootString = docRoot;
-				}
-			}
-			else {
-				// it is a file based url
-				fDocRootString = docRoot;
-			}
-		}
-	}
-
-	/**
-	 *  Convert the given url to a abolute url using the base url
-	 *  Input url can be of any othe following format
-	 * Absolute urls
-	 * --------------
-	 *  . http://www.foo.com/
-	 *  . http://www.foo.com
-	 *  . http://www.foo.com/folder
-	 *  . http://www.foo.com/folder/
-	 *  . http://www.foo.com/index.html
-	 *  . http://www.foo.com/folder/index.html
-	 *  . http://www.foo.com/folder/../index.html
-	 * Url relative  on document root
-	 * -------------------------
-	 *  . /
-	 *  . /folder
-	 *  . /index.html
-	 *  . /folder/index.html
-	 *  . /folder/../index.html
-	 * 
-	 * Self relative
-	 * -------------------------
-	 *  . index.html
-	 *  . ./index.html
-	 *  . ../index.html
-	 *  . folder/index.html
-	 *  . folder/../index.html
-	 *
-	 * file based url adds another dimension since it doesn't have a document root
-	 * So uses fDocRoot if provided
-	 */
-	public String toAbsolute(String url) {
-		String absUrl = url;
-
-		URL newUrl = null;
-		// try to see it is a absolute url
-		if ( URI.validScheme(url) ) {
-			try {
-				newUrl = new URL(url);
-			}
-			catch (MalformedURLException me) {
-			}
-		}
-		// if document root is provided
-		// do special case
-		if (newUrl == null) {
-			if (fDocRoot == null && fDocRootString == null) {
-				// try to check relative url
-				absUrl = convert(url, fBaseUrl, fBaseUrlString);
-			}
-			else {
-				// doc root is provided
-				// if the url is a doc root based use doc root
-
-				if (url.startsWith("/"))//$NON-NLS-1$
-					absUrl = convert(url, fDocRoot, fDocRootString);
-				else
-					absUrl = convert(url, fBaseUrl, fBaseUrlString);
-
-			}
-		}
-		return absUrl;
-	}
-
-	/**
-	 * Convert from an absolute url to relative url based on the given url
-	 * Both are assumed to be ablsute url
-	 */
-	public String toRelative(String url, String documentUrl) {
-		String output = url;
-		// assuming both urls are absolute
-		try {
-			URL inputUrl = new URL(url);
-			URL docUrl = new URL(documentUrl);
-			// filter out if the urls are not fro the same domain
-			if (!inputUrl.getProtocol().equals(docUrl.getProtocol()) || !inputUrl.getHost().equals(docUrl.getHost()) || inputUrl.getPort() != docUrl.getPort())
-				return output;
-			// both url are coming form the same place
-			// strip off the domain parts
-			String inputName = inputUrl.getFile();
-			String docName = docUrl.getFile();
-			output = PathHelper.convertToRelative(inputName, docName);
-		}
-		catch (MalformedURLException me) {
-			output = null;
-		}
-		return output;
-	}
-
-//	/*
-//	 */
-//	protected  String getScheme(String passedSpec) {
-//		if (passedSpec != null) {
-//	
-//			final String spec = passedSpec.trim();
-//			
-//			// protocol(scheme) java.net.URL can recognize is detemined
-//			// what URL.getURLStreamHandle(protocol) returns.
-//			// in Eclipse, only :
-//			//		valoader:
-//			//		file:
-//			//		jar:
-//			//		platform:
-//			//		doc:
-//			//		ftp:
-//			//		gopher:
-//			//		http:
-//			//		mailto:
-//			//		netdoc:
-//			//		systemresource:
-//			//		verbatim:
-//			// can recognize. Otherwise, it throws exception...
-//			// the following code comes from hpbcom/url.cpp, Url::parse_protocol()
-//			final int limit = spec.length();
-//			String newProtocol = null;
-//			for( int index = 0; index < limit; index++ ) {
-//				final char p = spec.charAt(index);
-//				if (p == '/') {
-//					break;
-//				}
-//				if (p == ':') {
-//					newProtocol = spec.substring(0, index);
-//					break;
-//				}
-//			}
-//			// copy end
-//		
-//			 			
-//			if (newProtocol != null && newProtocol.length() > 1 ) {
-//				for ( int i = 0; i < PROTOCOLS.length; i++ ){
-//					if (newProtocol.compareToIgnoreCase(PROTOCOLS[i]) == 0) {
-//						// matched;
-//						return newProtocol;
-//					}
-//				}
-//			}
-//		}
-//		//i don't know what is newProtocol. Ask URI class itself.
-//		//No, calling URI again is very slow. So, just give up
-//		//URI uri = new URI(spec);
-//		//return uri.getScheme();
-//		return null;//$NON-NLS-1$
-//	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/TextChangeCompatibility.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/TextChangeCompatibility.java
deleted file mode 100644
index 7f93a4f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/TextChangeCompatibility.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor.util;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.ltk.core.refactoring.TextChange;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.text.edits.TextEditGroup;
-
-/**
- * A utility class to provide compatibility with the old
- * text change API of adding text edits directly and auto
- * inserting them into the tree.
- */
-public class TextChangeCompatibility {
-
-	public static void addTextEdit(TextChange change, String name, TextEdit edit) {
-		Assert.isNotNull(change);
-		Assert.isNotNull(name);
-		Assert.isNotNull(edit);
-		TextEdit root= change.getEdit();
-		if (root == null) {
-			root= new MultiTextEdit();
-			change.setEdit(root);
-		}
-		insert(root, edit);
-		change.addTextEditGroup(new TextEditGroup(name, edit));
-	}
-	
-	public static void addTextEdit(TextChange change, String name, TextEdit[] edits) {
-		Assert.isNotNull(change);
-		Assert.isNotNull(name);
-		Assert.isNotNull(edits);
-		TextEdit root= change.getEdit();
-		if (root == null) {
-			root= new MultiTextEdit();
-			change.setEdit(root);
-		}
-		for (int i= 0; i < edits.length; i++) {
-			insert(root, edits[i]);
-		}
-		change.addTextEditGroup(new TextEditGroup(name, edits));
-	}
-	
-	public static void insert(TextEdit parent, TextEdit edit) {
-		if (!parent.hasChildren()) {
-			parent.addChild(edit);
-			return;
-		}
-		TextEdit[] children= parent.getChildren();
-		// First dive down to find the right parent.
-		for (int i= 0; i < children.length; i++) {
-			TextEdit child= children[i];
-			if (covers(child, edit)) {
-				insert(child, edit);
-				return;
-			}
-		}
-		// We have the right parent. Now check if some of the children have to
-		// be moved under the new edit since it is covering it.
-		for (int i= children.length - 1; i >= 0; i--) {
-			TextEdit child= children[i];
-			if (covers(edit, child)) {
-				parent.removeChild(i);
-				edit.addChild(child);
-			}
-		}
-		parent.addChild(edit);
-	}
-	
-	private static boolean covers(TextEdit thisEdit, TextEdit otherEdit) {
-		if (thisEdit.getLength() == 0)	// an insertion point can't cover anything
-			return false;
-		
-		int thisOffset= thisEdit.getOffset();
-		int thisEnd= thisEdit.getExclusiveEnd();	
-		if (otherEdit.getLength() == 0) {
-			int otherOffset= otherEdit.getOffset();
-			return thisOffset < otherOffset && otherOffset < thisEnd;
-		} else {
-			int otherOffset= otherEdit.getOffset();
-			int otherEnd= otherEdit.getExclusiveEnd();
-			return thisOffset <= otherOffset && otherEnd <= thisEnd;
-		}
-	}		
-	
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorActionGroup.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorActionGroup.java
deleted file mode 100644
index 303d1dc..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorActionGroup.java
+++ /dev/null
@@ -1,215 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.wizard;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.wst.xsd.ui.internal.refactor.actions.RenameAction;
-import org.eclipse.wst.xsd.ui.internal.refactor.actions.SelectionDispatchAction;
-
-/**
- * Action group that adds refactor actions (for example 'Rename', 'Move') to a
- * context menu and the global menu bar.
- * 
- */
-public abstract class RefactorActionGroup extends ActionGroup {
-	
-	private static class NoActionAvailable extends Action {
-		public NoActionAvailable() {
-			setEnabled(true);
-			setText(RefactoringWizardMessages.RefactorActionGroup_no_refactoring_available); 
-		}
-	}
-
-	/**
-	 * Pop-up menu: name of group for reorganize actions (value
-	 * <code>"group.reorganize"</code>).
-	 */
-	public static final String GROUP_REORGANIZE = IWorkbenchActionConstants.GROUP_REORGANIZE;
-
-	public static final String MENU_ID = "org.eclipse.wst.xsd.ui.refactoring.menu"; //$NON-NLS-1$
-
-	public static final String RENAME = "org.eclipse.wst.xsd.ui.refactoring.actions.Rename"; //$NON-NLS-1$
-
-
-	protected static void initAction(SelectionDispatchAction action,
-			ISelection selection) {
-
-		Assert.isNotNull(selection);
-		Assert.isNotNull(action);
-		action.update(selection);
-		//provider.addSelectionChangedListener(action);
-	}
-
-	protected List fEditorActions;
-
-	private String fGroupName = GROUP_REORGANIZE;
-	
-	private Action fNoActionAvailable = new NoActionAvailable();
-
-	protected RenameAction fRenameAction;
-
-	protected SelectionDispatchAction fRenameTargetNamespace;
-
-	protected ISelection selection;
-	
-	public RefactorActionGroup(ISelection selection) {
-			this.selection = selection;
-			
-	}
-
-	public int addAction(IAction action) {
-		if (action != null && action.isEnabled()) {
-			fEditorActions.add(action);
-			return 1;
-		}
-		return 0;
-	}
-
-	private void addRefactorSubmenu(IMenuManager menu) {
-
-		IMenuManager refactorSubmenu = new MenuManager(RefactoringWizardMessages.RefactorMenu_label, MENU_ID);
-		refactorSubmenu.addMenuListener(new IMenuListener() {
-				public void menuAboutToShow(IMenuManager manager) {
-					refactorMenuShown(manager);
-				}
-			});
-		refactorSubmenu.add(fNoActionAvailable);
-			if (menu.find(refactorSubmenu.getId()) == null) {
-				if (menu.find(fGroupName) == null) {
-					menu.add(refactorSubmenu);
-				} else {
-					menu.appendToGroup(fGroupName, refactorSubmenu);
-				}
-			}
-	}
-
-	protected void disposeAction(ISelectionChangedListener action,
-			ISelectionProvider provider) {
-		if (action != null)
-			provider.removeSelectionChangedListener(action);
-	}
-
-	/*
-	 * (non-Javadoc) Method declared in ActionGroup
-	 */
-	public void fillActionBars(IActionBars actionBars) {
-		super.fillActionBars(actionBars);
-		actionBars.setGlobalActionHandler(RENAME, fRenameAction);
-		retargetFileMenuActions(actionBars);
-	}
-
-	public void fillActions(List enabledActions) {
-		
-		if(selection != null && fEditorActions != null){
-			for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
-				Action action = (Action) iter.next();
-				if (action instanceof SelectionDispatchAction) {
-					SelectionDispatchAction selectionAction = (SelectionDispatchAction) action;
-					selectionAction.update(selection);
-				}
-
-			}
-			for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
-				Action action = (Action) iter.next();
-				if (action != null && action.isEnabled()) {
-					enabledActions.add(action);
-				}
-			}
-		}
-		
-	}
-
-	/*
-	 * (non-Javadoc) Method declared in ActionGroup
-	 */
-	public void fillContextMenu(IMenuManager menu) {
-		super.fillContextMenu(menu);
-		addRefactorSubmenu(menu);
-	}
-
-	private int fillRefactorMenu(IMenuManager refactorSubmenu) {
-		int added = 0;
-		refactorSubmenu.add(new Separator(GROUP_REORGANIZE));
-		for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
-			Action action = (Action) iter.next();
-			if (action != null && action.isEnabled()) {
-				fEditorActions.add(action);
-				return 1;
-			}
-		}
-		return added;
-	}
-
-	private void refactorMenuHidden(IMenuManager manager) {
-
-		for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
-			Action action = (Action) iter.next();
-			if (action instanceof SelectionDispatchAction) {
-				SelectionDispatchAction selectionAction = (SelectionDispatchAction) action;
-				selectionAction.update(selection);
-			}
-
-		}
-	}
-
-	private void refactorMenuShown(final IMenuManager refactorSubmenu) {
-		// we know that we have an MenuManager since we created it in
-		// addRefactorSubmenu.
-		Menu menu = ((MenuManager) refactorSubmenu).getMenu();
-		menu.addMenuListener(new MenuAdapter() {
-			public void menuHidden(MenuEvent e) {
-				refactorMenuHidden(refactorSubmenu);
-			}
-		});
-
-		for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
-			Action action = (Action) iter.next();
-			if (action instanceof SelectionDispatchAction) {
-				SelectionDispatchAction selectionAction = (SelectionDispatchAction) action;
-				selectionAction.update(selection);
-			}
-		}
-		refactorSubmenu.removeAll();
-		if (fillRefactorMenu(refactorSubmenu) == 0)
-			refactorSubmenu.add(fNoActionAvailable);
-	}
-
-	/**
-	 * Retargets the File actions with the corresponding refactoring actions.
-	 * 
-	 * @param actionBars
-	 *            the action bar to register the move and rename action with
-	 */
-	public void retargetFileMenuActions(IActionBars actionBars) {
-		actionBars.setGlobalActionHandler(ActionFactory.RENAME.getId(),
-				fRenameAction);
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupActionDelegate.java
deleted file mode 100644
index 983a838..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupActionDelegate.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor.wizard;
-
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-public abstract class RefactorGroupActionDelegate implements IObjectActionDelegate, IEditorActionDelegate, IMenuCreator {
-
-	protected ISelection fSelection;
-	private IAction fDelegateAction;
-	// whether to re-fill the menu (reset on selection change)
-	private boolean fFillMenu = true;
-	protected IWorkbenchPart workbenchPart; 
-	protected ResourceSet resourceSet = new ResourceSetImpl();
-	
-
-	public RefactorGroupActionDelegate() {
-
-	}
-	
-	/*
-	 * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
-	 */
-	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
-		workbenchPart = targetPart;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.action.IMenuCreator#dispose()
-	 */
-	public void dispose() {
-		// nothing to do
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
-	 */
-	public Menu getMenu(Control parent) {
-		// never called
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
-	 */
-	public Menu getMenu(Menu parent) {
-		//Create the new menu. The menu will get filled when it is about to be shown. see fillMenu(Menu).
-		Menu menu = new Menu(parent);
-		/**
-		 * Add listener to repopulate the menu each time
-		 * it is shown because MenuManager.update(boolean, boolean) 
-		 * doesn't dispose pulldown ActionContribution items for each popup menu.
-		 */
-		menu.addMenuListener(new MenuAdapter() {
-			public void menuShown(MenuEvent e) {
-				if (fFillMenu) {
-					Menu m = (Menu)e.widget;
-					MenuItem[] items = m.getItems();
-					for (int i=0; i < items.length; i++) {
-						items[i].dispose();
-					}
-					fillMenu(m);
-					fFillMenu = false;
-				}
-			}
-		});
-		return menu;
-	}
-
-	/*
-	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
-	 */
-	public void run(IAction action) {
-		// Never called because we become a menu.
-	}
-	
-	/*
-	 * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
-	 */
-	public void selectionChanged(IAction action, ISelection selection) {
-		fDelegateAction = action;
-		updateWith(selection);
-		
-	}
-
-    public void setActiveEditor(IAction action, IEditorPart targetEditor) {
-		workbenchPart = targetEditor;
-		fDelegateAction = action;
-		if (targetEditor != null && targetEditor.getEditorSite() != null && targetEditor.getEditorSite().getSelectionProvider() != null) {
-			updateWith(targetEditor.getEditorSite().getSelectionProvider().getSelection());
-		}
-		
-	}
-    
-	public void updateWith(ISelection selection) {
-		fSelection = selection;
-		if (fDelegateAction != null) {
-			boolean enable = false;
-			if (selection != null) {
-				if (selection instanceof ITextSelection) {
-					//if (((ITextSelection) selection).getLength() > 0) {
-						enable = true;
-					//}
-				}
-				else if(selection instanceof IStructuredSelection ){
-					enable = !selection.isEmpty();
-				}
-			}
-			// enable action
-			fDelegateAction.setEnabled(enable);
-			
-			// fill submenu
-			fFillMenu = true;
-			fDelegateAction.setMenuCreator(this);
-			
-			
-		}
-		
-	}
-	
-	
-    protected abstract void fillMenu(Menu menu);
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupSubMenu.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupSubMenu.java
deleted file mode 100644
index e402607..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupSubMenu.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.refactor.wizard;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.ui.actions.CompoundContributionItem;
-
-public class RefactorGroupSubMenu extends CompoundContributionItem {
-
-	RefactorActionGroup fRefactorMenuGroup;
-	
-
-	public RefactorGroupSubMenu(RefactorActionGroup refactorMenuGroup) {
-		super();
-		fRefactorMenuGroup = refactorMenuGroup;
-	}
-
-	public RefactorGroupSubMenu(String id) {
-		super(id);
-	}
-
-	protected IContributionItem[] getContributionItems() {
-		  ArrayList actionsList = new ArrayList();
-		  ArrayList contribList = new ArrayList();
-		  fRefactorMenuGroup.fillActions(actionsList);
-	         
-	        if (actionsList != null && !actionsList.isEmpty()) {
-	            for (Iterator iter = actionsList.iterator(); iter.hasNext();) {
-	     			IAction action = (IAction) iter.next();
-	     			contribList.add(new ActionContributionItem(action));
-	     		}
-	        } else {
-	            Action dummyAction = new Action(RefactoringWizardMessages.RefactorActionGroup_no_refactoring_available) {
-	                // dummy inner class; no methods
-	            };
-	            dummyAction.setEnabled(false);
-	            contribList.add(new ActionContributionItem(dummyAction));
-	        }
-	        return (IContributionItem[]) contribList.toArray(new IContributionItem[contribList.size()]);
-
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactoringWizardMessages.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactoringWizardMessages.java
deleted file mode 100644
index 03140c8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactoringWizardMessages.java
+++ /dev/null
@@ -1,70 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.wizard;
-
-import org.eclipse.osgi.util.NLS;
-
-public class RefactoringWizardMessages  extends NLS {
-
-	private static final String BUNDLE_NAME= "org.eclipse.wst.xsd.ui.internal.refactor.wizard.messages";//$NON-NLS-1$
-
-	public static String RefactorMenu_label;
-	public static String RefactorActionGroup_no_refactoring_available;
-
-	public static String RenameAction_rename;
-	public static String RenameAction_unavailable;
-	public static String RenameAction_text;
-
-	public static String RenameInputWizardPage_new_name;
-	public static String RenameRefactoringWizard_internal_error;
-	
-	public static String RenameTargetNamespace_text;
-
-	public static String RenameXSDElementAction_exception;
-	public static String RenameXSDElementAction_not_available;
-	public static String RenameXSDElementAction_name;
-
-	public static String RenameSupport_dialog_title;
-	public static String RenameSupport_not_available;
-
-	public static String RenameComponentWizard_defaultPageTitle;
-	public static String RenameComponentWizard_inputPage_description;
-
-	public static String RenameInputWizardPage_update_references;
-	public static String XSDComponentRenameChange_name;
-	public static String XSDComponentRenameChange_Renaming;
-	public static String ResourceRenameParticipant_compositeChangeName;
-	public static String RenameResourceChange_rename_resource_reference_change;
-	public static String XSDRenameResourceChange_name;
-	public static String RenameResourceRefactoring_Internal_Error;
-	public static String RenameResourceRefactoring_alread_exists;
-	public static String RenameResourceRefactoring_invalidName;
-	public static String RenameResourceProcessor_name;
-	public static String MakeAnonymousTypeGlobalAction_text; 
-	public static String MakeLocalElementGlobalAction_text;
-	public static String XSDComponentRenameParticipant_Component_Refactoring_updates;
-	public static String WSDLComponentRenameParticipant_Component_Refactoring_updates;
-	public static String RenameComponentProcessor_Component_Refactoring_updates;
-	public static String RenameComponentProcessor_Component_Refactoring_update_declatation;
-	public static String RenameComponentProcessor_Component_Refactoring_update_reference;
-	public static String XSDComponentRenameParticipant_xsd_component_rename_participant;
-	public static String WSDLComponentRenameParticipant_wsdl_component_rename_participant;
-	public static String ResourceRenameParticipant_File_Rename_update_reference;
-
-
-	private RefactoringWizardMessages() {
-		// Do not instantiate
-	}
-
-	static {
-		NLS.initializeMessages(BUNDLE_NAME, RefactoringWizardMessages.class);
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameInputWizardPage.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameInputWizardPage.java
deleted file mode 100644
index 5d4ccd4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameInputWizardPage.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.wizard;
-
-
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-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.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsd.ui.internal.refactor.IReferenceUpdating;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-
-/**
- * @author ebelisar
- *
- */
-public class RenameInputWizardPage  extends UserInputWizardPage{
-	private String fInitialValue;
-	private Text fTextField;
-	private Button fUpdateReferences;
-	/**
-	 * Creates a new text input page.
-	 * @param isLastUserPage <code>true</code> if this page is the wizard's last
-	 *  user input page. Otherwise <code>false</code>.
-	 */
-	public RenameInputWizardPage(String description, boolean isLastUserPage) {
-		this(description, isLastUserPage, ""); //$NON-NLS-1$
-	}
-	
-	/**
-	 * Creates a new text input page.
-	 * @param isLastUserPage <code>true</code> if this page is the wizard's last
-	 *  user input page. Otherwise <code>false</code>
-	 * @param initialValue the initial value
-	 */
-	public RenameInputWizardPage(String description, boolean isLastUserPage, String initialValue) {
-	    super("RenameInputWizardPage");
-		Assert.isNotNull(initialValue);
-		setDescription(description);
-		fInitialValue= initialValue;
-	}
-	
-	/**
-	 * Returns whether the initial input is valid. Typically it is not, because the 
-	 * user is required to provide some information e.g. a new type name etc.
-	 * 
-	 * @return <code>true</code> iff the input provided at initialization is valid
-	 */
-	protected boolean isInitialInputValid(){
-		return false;
-	}
-	
-	/**
-	 * Returns whether an empty string is a valid input. Typically it is not, because 
-	 * the user is required to provide some information e.g. a new type name etc.
-	 * 
-	 * @return <code>true</code> iff an empty string is valid
-	 */
-	protected boolean isEmptyInputValid(){
-		return false;
-	}
-	
-	/**
-	 * Returns the content of the text input field.
-	 * 
-	 * @return the content of the text input field. Returns <code>null</code> if
-	 * not text input field has been created
-	 */
-	protected String getText() {
-		if (fTextField == null)
-			return null;
-		return fTextField.getText();	
-	}
-	
-	/**
-	 * Sets the new text for the text field. Does nothing if the text field has not been created.
-	 * @param text the new value
-	 */
-	protected void setText(String text) {
-		if (fTextField == null)
-			return;
-		fTextField.setText(text);
-	}
-	
-	/**
-	 * Performs input validation. Returns a <code>RefactoringStatus</code> which
-	 * describes the result of input validation. <code>Null<code> is interpreted
-	 * as no error.
-	 */
-	protected RefactoringStatus validateTextField(String text){
-		return null;
-	}
-	
-	protected Text createTextInputField(Composite parent) {
-		return createTextInputField(parent, SWT.BORDER);
-	}
-	
-	protected Text createTextInputField(Composite parent, int style) {
-		fTextField= new Text(parent, style);
-		fTextField.addModifyListener(new ModifyListener() {
-			public void modifyText(ModifyEvent e) {
-				textModified(getText());
-			}
-		});
-		fTextField.setText(fInitialValue);
-		return fTextField;
-	}
-	
-	/**
-	 * Checks the page's state and issues a corresponding error message. The page validation
-	 * is computed by calling <code>validatePage</code>.
-	 */
-	protected void textModified(String text) {	
-		if (! isEmptyInputValid() && text.equals("")){ //$NON-NLS-1$
-			setPageComplete(false);
-			setErrorMessage(null);
-			restoreMessage();
-			return;
-		}
-		if ((! isInitialInputValid()) && text.equals(fInitialValue)){
-			setPageComplete(false);
-			setErrorMessage(null);
-			restoreMessage();
-			return;
-		}
-		
-		setPageComplete(validateTextField(text));
-		
-//		 TODO: enable preview in M4
-		getRefactoringWizard().setForcePreviewReview(false);
-		getContainer().updateButtons();
-	
-	}
-	
-	/**
-	 * Subclasses can override if they want to restore the message differently.
-	 * This implementation calls <code>setMessage(null)</code>, which clears the message 
-	 * thus exposing the description.
-	 */
-	protected void restoreMessage(){
-		setMessage(null);
-	}
-	
-	/* (non-Javadoc)
-	 * Method declared in IDialogPage
-	 */
-	public void dispose() {
-		fTextField= null;	
-	}
-	
-	/* (non-Javadoc)
-	 * Method declared in WizardPage
-	 */
-	public void setVisible(boolean visible) {
-		if (visible) {
-			textModified(getText());
-		}
-		super.setVisible(visible);
-		if (visible && fTextField != null) {
-			fTextField.setFocus();
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
-	 */
-	public void createControl(Composite parent) {
-		Composite superComposite= new Composite(parent, SWT.NONE);
-		setControl(superComposite);
-		initializeDialogUnits(superComposite);
-		
-		superComposite.setLayout(new GridLayout());
-		Composite composite= new Composite(superComposite, SWT.NONE);
-		composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));	
-		
-		GridLayout layout= new GridLayout();
-		layout.numColumns= 2;
-		layout.verticalSpacing= 8;
-		composite.setLayout(layout);
-		
-		
-		Label label= new Label(composite, SWT.NONE);
-		label.setText(getLabelText());
-		
-		Text text= createTextInputField(composite);
-		text.selectAll();
-		GridData gd= new GridData(GridData.FILL_HORIZONTAL);
-		gd.widthHint= convertWidthInCharsToPixels(25);
-		text.setLayoutData(gd);
-		
-		addOptionalUpdateReferencesCheckbox(superComposite);
-		gd= new GridData(GridData.FILL_HORIZONTAL);
-		text.setLayoutData(gd);
-		
-		getRefactoringWizard().setForcePreviewReview(false);
-		
-		Dialog.applyDialogFont(superComposite);
-		//WorkbenchHelp.setHelp(getControl(), fHelpContextID);
-
-	}
-	
-	private static Button createCheckbox(Composite parent, String title, boolean value) {
-		Button checkBox= new Button(parent, SWT.CHECK);
-		checkBox.setText(title);
-		checkBox.setSelection(value);
-		return checkBox;		
-	}
-	
-	private void addOptionalUpdateReferencesCheckbox(Composite result) {
-
-		final IReferenceUpdating ref= (IReferenceUpdating)getRefactoring().getAdapter(IReferenceUpdating.class);
-		if (ref == null || !ref.canEnableUpdateReferences())	
-			return;
-		String title= RefactoringMessages.getString("RenameInputWizardPage.update_references"); //$NON-NLS-1$
-		boolean defaultValue= true; 
-		fUpdateReferences= createCheckbox(result, title, defaultValue);
-		ref.setUpdateReferences(fUpdateReferences.getSelection());
-		fUpdateReferences.addSelectionListener(new SelectionAdapter(){
-			public void widgetSelected(SelectionEvent e) {
-    		ref.setUpdateReferences(fUpdateReferences.getSelection());
-			}
-		});				
-		fUpdateReferences.setEnabled(true);		
-	}
-	
-	protected String getLabelText() {
-		return RefactoringMessages.getString("RenameInputWizardPage.new_name"); //$NON-NLS-1$
-	}
-	
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameRefactoringWizard.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameRefactoringWizard.java
deleted file mode 100644
index 8200353..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameRefactoringWizard.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.refactor.wizard;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ltk.core.refactoring.Refactoring;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.wst.xsd.ui.internal.refactor.INameUpdating;
-
-public class RenameRefactoringWizard extends RefactoringWizard {
-	
-	private final String fInputPageDescription;
-
-	private final ImageDescriptor fInputPageImageDescriptor;
-	
-	public RenameRefactoringWizard(Refactoring refactoring, String defaultPageTitle, String inputPageDescription, 
-			ImageDescriptor inputPageImageDescriptor) {
-		super(refactoring, DIALOG_BASED_USER_INTERFACE);
-		setDefaultPageTitle(defaultPageTitle);
-    	fInputPageDescription= inputPageDescription;
-		fInputPageImageDescriptor= inputPageImageDescriptor;
-
-	}
-
-	/* non java-doc
-	 * @see RefactoringWizard#addUserInputPages
-	 */ 
-	protected void addUserInputPages() {
-		String initialSetting= getProcessor().getCurrentElementName();
-		RenameInputWizardPage inputPage= createInputPage(fInputPageDescription, initialSetting);
-		inputPage.setImageDescriptor(fInputPageImageDescriptor);
-		addPage(inputPage);
-	}
-
-	protected INameUpdating getProcessor() {
-		
-		return (INameUpdating)getRefactoring().getAdapter(INameUpdating.class);	
-	}
-	
-	
-	protected RenameInputWizardPage createInputPage(String message, String initialSetting) {
-		return new RenameInputWizardPage(message, true, initialSetting) {
-			protected RefactoringStatus validateTextField(String text) {
-				return validateNewName(text);
-			}	
-		};
-	}
-	
-	protected RefactoringStatus validateNewName(String newName) {
-		INameUpdating ref= getProcessor();
-		ref.setNewElementName(newName);
-//		try{
-			return ref.checkNewElementName(newName);
-//		} catch (CoreException e){
-//			//XXX: should log the exception
-//			String msg= e.getMessage() == null ? "": e.getMessage(); //$NON-NLS-1$
-//			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getFormattedString("RenameRefactoringWizard.internal_error", msg));//$NON-NLS-1$
-//		}	
-	}
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/messages.properties
deleted file mode 100644
index 7bcd71f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/messages.properties
+++ /dev/null
@@ -1,55 +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
-###############################################################################
-
-RefactorMenu_label=Refactor
-RefactorActionGroup_no_refactoring_available=<no refactoring available>
-
-RenameAction_rename=Rename
-RenameAction_unavailable=Operation unavailable on the current selection.\nSelect a ....
-RenameAction_text=Re&name...
-
-RenameInputWizardPage_new_name= &New name:
-RenameRefactoringWizard_internal_error= Internal error during name checking: {0}
-
-
-RenameXSDElementAction_exception=Unexpected exception occurred. See log for details
-RenameXSDElementAction_not_available=Operation unavailable on the current selection.\nSelect a XSD project, folder, resource, file, attribute declarations,  attribute group definitions, complex type definitions, element declarations, identity constraint definitions, model groups definitions, notation declarations, or simple type definitions.
-RenameXSDElementAction_name=Rename
-
-
-RenameSupport_dialog_title=Rename
-RenameSupport_not_available=Rename support not available
-
-RenameComponentWizard_defaultPageTitle=Rename wizard
-RenameComponentWizard_inputPage_description=Rename XML Schema component
-
-RenameInputWizardPage_update_references=Update references
-XSDComponentRenameChange_name=XML Schema component renaming in {0}: {1} to {2}
-XSDComponentRenameChange_Renaming=Renaming...
-ResourceRenameParticipant_compositeChangeName=XSD file rename references updating changes
-RenameResourceChange_rename_resource_reference_change=Renaming resource name references
-XSDRenameResourceChange_name=Resource rename: {0} to {1}
-RenameResourceRefactoring_Internal_Error=Internal error
-RenameResourceRefactoring_alread_exists=Resource already exist
-RenameResourceRefactoring_invalidName=Invalid resource name
-RenameResourceProcessor_name=Resource renaming
-MakeAnonymousTypeGlobalAction_text=Make Anonymous Type Global 
-MakeLocalElementGlobalAction_text=Make Local Element Global
-XSDComponentRenameParticipant_Component_Refactoring_updates=XML Schema refactoring changes
-WSDLComponentRenameParticipant_Component_Refactoring_updates=WSDL Schema refactoring changes
-RenameComponentProcessor_Component_Refactoring_updates=Component name refactoring changes
-RenameComponentProcessor_Component_Refactoring_update_declatation=Update component declaration/definition
-RenameComponentProcessor_Component_Refactoring_update_reference=Update component reference
-XSDComponentRenameParticipant_xsd_component_rename_participant=XSD component rename participant
-WSDLComponentRenameParticipant_wsdl_component_rename_participant=WSDL component rename participant
-ResourceRenameParticipant_File_Rename_update_reference=File rename refactoring changes
-
-RenameTargetNamespace_text=Rename Target Namespace
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java
deleted file mode 100644
index b65703a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.search;
-
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-// todo ... move
-public interface IXSDSearchConstants {
-	
-	public static final String XMLSCHEMA_NAMESPACE = "http://www.w3.org/2001/XMLSchema";
-	public static String XSD_CONTENT_TYPE_ID = "org.eclipse.wst.xsd.core.xsdsource";
-	
-    public static final QualifiedName   COMPLEX_TYPE_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "complexType");
-    public static final QualifiedName   SIMPLE_TYPE_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "simpleType");
-    public static final QualifiedName   ELEMENT_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "element");
-	public static final QualifiedName   ATTRIBUTE_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "attribute");
-	public static final QualifiedName   ATTRIBUTE_GROUP_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "attributeGroup");
-	public static final QualifiedName   GROUP_META_NAME =  new QualifiedName (XMLSCHEMA_NAMESPACE, "group");
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java
deleted file mode 100644
index 3fdc553..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.search;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.ComponentSearchContributor;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchPattern;
-
-public class XSDSearchContributor extends ComponentSearchContributor  {
- 
-	
-	protected void initializeReferences() {
-		references = new HashMap();
-		String ns = IXSDSearchConstants.XMLSCHEMA_NAMESPACE;
-
-		List patterns = new ArrayList();
-		patterns.add(new XMLSearchPattern( ns, "element", "ref"));
-		patterns.add(new XMLSearchPattern( ns, "element", "substitutionGroup"));
-		references.put(IXSDSearchConstants.ELEMENT_META_NAME, patterns);
-
-		patterns = new ArrayList();
-		patterns.add(new XMLSearchPattern( ns, "restriction", "base"));
-		patterns.add(new XMLSearchPattern( ns, "extension", "base"));
-		patterns.add(new XMLSearchPattern( ns, "element", "type"));
-		references.put(IXSDSearchConstants.COMPLEX_TYPE_META_NAME, patterns);
-
-		patterns = new ArrayList();
-		patterns.add(new XMLSearchPattern( ns, "restriction", "base"));
-		patterns.add(new XMLSearchPattern( ns, "extension", "base"));
-		patterns.add(new XMLSearchPattern( ns, "attribute", "type"));
-		patterns.add(new XMLSearchPattern( ns, "union", "memberTypes"));
-
-		references.put(IXSDSearchConstants.SIMPLE_TYPE_META_NAME, patterns);
-
-	}
-
-	protected void initializeDeclarations(){
-		
-		declarations = new HashMap();
-		String ns = IXSDSearchConstants.XMLSCHEMA_NAMESPACE;
-
-		SearchPattern pattern = new XMLSearchPattern( ns, "element", "name");
-		declarations.put(IXSDSearchConstants.ELEMENT_META_NAME, pattern);
-
-		pattern = new XMLSearchPattern(ns, "complexType", "name");
-		declarations.put(IXSDSearchConstants.COMPLEX_TYPE_META_NAME, pattern);
-
-		pattern = new XMLSearchPattern(ns, "simpleType", "name");
-		declarations.put(IXSDSearchConstants.SIMPLE_TYPE_META_NAME, pattern);
-
-		pattern = new XMLSearchPattern(ns, "attribute", "name");
-		declarations.put(IXSDSearchConstants.ATTRIBUTE_META_NAME, pattern);
-
-		pattern = new XMLSearchPattern(ns, "attributeGroup", "name");
-		declarations.put(IXSDSearchConstants.ATTRIBUTE_GROUP_META_NAME, pattern);
-
-		pattern = new XMLSearchPattern(ns, "group", "name");
-		declarations.put(IXSDSearchConstants.GROUP_META_NAME, pattern);
-
-	}
-
-	protected void initializeSupportedNamespaces() {
-		namespaces = new String[]{ IXSDSearchConstants.XMLSCHEMA_NAMESPACE};
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java
deleted file mode 100644
index ae0b1a6..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.search;
-
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.ComponentSearchContributor;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentSearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchParticipant;
-
-public class XSDSearchParticipant extends XMLSearchParticipant {
-
-	private static String ID = "org.eclipse.wst.xsd.search.XSDSearchParticipant";
-
-	public  boolean initialize(SearchPattern pattern, String[] contentTypes){
-		
-		super.initialize(pattern, contentTypes);
-		id = ID;
-		if(pattern instanceof XMLComponentSearchPattern ){
-			XMLComponentSearchPattern componentPattern = (XMLComponentSearchPattern)pattern;
-			String namespace = componentPattern.getMetaName().getNamespace();
-			if(IXSDSearchConstants.XMLSCHEMA_NAMESPACE.equals(namespace)){
-				return true;
-			}
-		}
-		return false;
-	}
-
-	
-	public ComponentSearchContributor getSearchContributor() {
-		
-		return new XSDSearchContributor();
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/ValidateAction.java b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/ValidateAction.java
deleted file mode 100644
index f6f85a1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/ValidateAction.java
+++ /dev/null
@@ -1,150 +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
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.validation;
-
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IFile;
-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.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-
-
-
-/**
- * This class manages the 'UI' related details of validation. Here's a quick
- * overview of the details : 
- * - manages Marker creation based on the results of the validation 
- * - (optionally) displays dialog to summarize the results of validation 
- * 
- * @author Lawrence Mandel, IBM
- * @author Keith Chong, IBM
- */
-public class ValidateAction extends org.eclipse.wst.xml.ui.internal.validation.core.ValidateAction
-{ 
-  // Property file strings.
-  private static final String _UI_DIALOG_XML_SCHEMA_INVALID_TEXT = "_UI_DIALOG_XML_SCHEMA_INVALID_TEXT";
-  private static final String _UI_DIALOG_XML_SCHEMA_INVALID_TITLE = "_UI_DIALOG_XML_SCHEMA_INVALID_TITLE";
-  private static final String _UI_DIALOG_XML_SCHEMA_VALID_TITLE = "_UI_DIALOG_XML_SCHEMA_VALID_TITLE";
-  private static final String _UI_DIALOG_XML_SCHEMA_VALID_TEXT = "_UI_DIALOG_XML_SCHEMA_VALID_TEXT";
-  private static final String _UI_DIALOG_XML_SCHEMA_VALID_WITH_WARNINGS = "_UI_DIALOG_XML_SCHEMA_VALID_WITH_WARNINGS";
-
-  private InputStream inputStream;
-  
-  /**
-   * Constructor.
-   * 
-   * @param file The file to validate.
-   * @param showDialog Whether or not to show a dialog when validation is complete.
-   */
-  public ValidateAction(IFile file, boolean showDialog)
-  {
-    super(file, showDialog);
-  }
-  
-  /*
-   * Store additional information in the message parameters
-   * 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
-   */
-  protected void addInfoToMessage (ValidationMessage validationMessage, IMessage message)
-  {   
-    if (inputStream != null)
-    {
-      XSDMessageInfoHelper messageInfoHelper = new XSDMessageInfoHelper();
-	  String[] messageInfo = messageInfoHelper.createMessageInfo(validationMessage.getMessage(), validationMessage.getKey());
-
-	  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]);
-    }  
-  }
-  
-  protected void validate(final IFile file)
-  {
-    final ValidationOutcome valoutcome = new ValidationOutcome();
-    IPath path = file.getLocation();
-    final String uri = createURIForFilePath(path.toString());
-    
-    IWorkspaceRunnable op = new IWorkspaceRunnable()
-    {
-
-      public void run(IProgressMonitor progressMonitor) throws CoreException
-      {
-        clearMarkers(file);
-        XSDValidator validator = XSDValidator.getInstance();
-        ValidationReport valreport = validator.validate(uri, inputStream);
-        valoutcome.isValid = valreport.isValid();
-        if(valreport.getValidationMessages().length == 0)
-        {
-          valoutcome.hasMessages = false;
-        }
-        else
-        {
-          valoutcome.hasMessages = true;
-        }
-        createMarkers(file, valreport.getValidationMessages());
-
-        file.setSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME, valreport.getNestedMessages());
-      }
-    };
-
-    try
-    {
-      ResourcesPlugin.getWorkspace().run(op, null);
-      String internalErrorMessage = null;
-
-      if (showDialog)
-      {
-        if (!valoutcome.isValid)
-        {
-          String message = XSDValidatorManager.getString(_UI_DIALOG_XML_SCHEMA_INVALID_TEXT);
-          String title = XSDValidatorManager.getString(_UI_DIALOG_XML_SCHEMA_INVALID_TITLE);
-          if (internalErrorMessage != null)
-          {
-            message = message + "\n" + internalErrorMessage;
-          }
-          openErrorDialog(title, message);
-        } 
-        else if (valoutcome.isValid && valoutcome.hasMessages)
-        {
-          String message = XSDValidatorManager.getString(_UI_DIALOG_XML_SCHEMA_VALID_WITH_WARNINGS);
-          String title = XSDValidatorManager.getString(_UI_DIALOG_XML_SCHEMA_VALID_TITLE);
-          openWarningDialog(title, message);
-        } 
-        else
-        {
-          String message = XSDValidatorManager.getString(_UI_DIALOG_XML_SCHEMA_VALID_TEXT);
-          String title = XSDValidatorManager.getString(_UI_DIALOG_XML_SCHEMA_VALID_TITLE);
-          //String message = validator.isGrammarEncountered() ?
-          //                 XSDValidatorManager.getString("_UI_THE_XML_FILE_IS_VALID") :
-          //                XSDValidatorManager.getString("_UI_THE_XML_FILE_IS_WELL_FORMED") +
-          //                 XSDValidatorManager.getString("_UI_NO_GRAMMAR_WARNING");
-          openValidDialog(title, message);
-        }
-      }
-    } 
-
-	catch (CoreException e)
-    {
-    }
-  }
-  public void setInputStream(InputStream inputStream)
-  { this.inputStream = inputStream;
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/ValidateSchemaActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/ValidateSchemaActionDelegate.java
deleted file mode 100644
index 5dce0fe..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/ValidateSchemaActionDelegate.java
+++ /dev/null
@@ -1,75 +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
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IActionDelegate;
-
-/**
- * Validate schema - from popup
- */
-public class ValidateSchemaActionDelegate
-       implements IActionDelegate
-{
-  protected ISelection selection;
-
-  public void run(IAction action)
-  {
-  	try {
-  		// CS.. for now the following line tests to ensure the user has xerces jars installed
-        // so that we can perform some 'fail fast' behaviour
-        //
-        Class theClass = Class.forName("org.apache.xerces.xni.parser.XMLParserConfiguration", true, this.getClass().getClassLoader());
-        if (theClass == null)
-        {
-         throw(new Exception("Missing Xerces jars in plugin's 'jars' folder"));       
-        }
-
-	    IFile fileResource = null;
-	    if (!selection.isEmpty() && selection instanceof IStructuredSelection)
-	    {
-	      IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-	      Object element = structuredSelection.getFirstElement();
-	
-	      if (element instanceof IFile)
-	      {
-	        fileResource = (IFile) element;
-	      }
-	      else
-	      {
-	        return;
-	      }
-	    }
-	    ValidateAction validateaction = new ValidateAction(fileResource, true);
-	    validateaction.setValidator(new Validator());
-	    validateaction.run();
-  	}
-  	catch (Exception e) {
-        // CS..here's where we need to pop up a dialog to tell the user that xerces is not available
-        //
-        String xercesLine1 = "Required files xercesImpl.jar and xmlParserAPIs.jar cannot be found.\n\n";
-        String xercesLine2 = "Download Xerces 2.6.2 and place xercesImpl.jar and xmlParserAPIs.jar in a folder entitled jars in the org.eclipse.wst.xml.validation plugin.\n\n";
-        String xercesLine3 = "For more information see www.eclipse.org/webtools/wst/components/xml/xercesInfo.xml.";
-        MessageDialog.openError(Display.getDefault().getActiveShell(), "Missing Xerces", xercesLine1 + xercesLine2 + xercesLine3);
-  	}
-  }
-
-  public void selectionChanged(IAction action, ISelection selection)
-  {
-    this.selection = selection;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/Validator.java b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/Validator.java
deleted file mode 100644
index b14ec14..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/Validator.java
+++ /dev/null
@@ -1,172 +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
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.validation;
-
-
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.IRuleGroup;
-import org.eclipse.wst.validation.internal.operations.ValidatorManager;
-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;
-
-
-public class Validator implements IValidator
-{
-  private final String GET_FILE = "getFile";
-  public final String GET_PROJECT_FILES = "getAllFiles";
-
-  public void validate(IFile file)
-  {
-    ValidateAction validateAction = new ValidateAction(file, false);
-    validateAction.setValidator(this);
-    validateAction.run();	
-  }
-  /**
-   * This is the method which performs the validation on the MOF model.
-   * <br><br>
-   * <code>helper</code> and <code>reporter</code> may not be null. <code>changedFiles</code> may be null, if a full
-   * build is desired.
-   * <br><br>
-   * <code>helper</code> returns the ifile for the given information in the IFileDelta array
-   * <br><br>
-   * <code>reporter</code> is an instance of an IReporter interface, which is used for interaction with the user.
-   * <br><br>
-   * <code>changedFiles</code> is an array of file names which have changed since the last validation. 
-   * If <code>changedFiles</code> is null, or if it is an empty array, then a full build
-   * is performed. Otherwise, validation on just the files listed in the Vector is performed.
-   */
-  public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
-	 String[] changedFiles = helper.getURIs();
-     if (changedFiles != null && changedFiles.length > 0) 
-    {
-      for (int i = 0; i < changedFiles.length; i++) 
-      {
-        String fileName = changedFiles[i];
-        if (fileName != null)
-        {
-          Object []parms = {fileName};
-
-          IFile file = (IFile) helper.loadModel(GET_FILE, parms);
-          if (file != null && shouldValidate(file)) 
-          {            
-            //the helper might not have the file stored in it. could have an InputStream          
-            if (helper.loadModel("inputStream") instanceof InputStream)
-            {
-              validate(file, (InputStream)helper.loadModel("inputStream"), reporter); //do we need the fileName?  what is int ruleGroup?
-            }                    
-            else
-            {  
-              //if (((Helper)helper).isInJavaBuildPath(file) &&
-              //    !((AWorkbenchHelper)helper).isInJavaSourcePath(file))
-              //{
-              //  continue;
-              //}
-              validateIfNeeded(file, helper, reporter);
-            }
-          }
-        }
-      }
-    }
-    else 
-    {
-      Object []parms = {this.getClass().getName()};
-      Collection files = (Collection) helper.loadModel(GET_PROJECT_FILES, parms);
-      Iterator iter = files.iterator();
-      while (iter.hasNext()) 
-      {
-        IFile file = (IFile) iter.next();
-        if(shouldValidate(file))
-        {
-          validateIfNeeded(file, helper, reporter);
-        }
-      }
-    }
-  }
-  
- 
-  private void validate(IFile file, InputStream inputStream, IReporter reporter)
-  {  
-    ValidateAction validateAction = new ValidateAction(file, false);
-    validateAction.setValidator(this);
-    if (inputStream != null)
-    {
-      validateAction.setInputStream(inputStream);
-      validateAction.setReporter(reporter);
-    }
-    validateAction.run();    
-  }
-  
-  protected void validateIfNeeded(IFile file, IValidationContext helper, IReporter reporter)
-  {
-    ValidatorManager mgr = ValidatorManager.getManager();
- 
-    Integer ruleGroupInt = (Integer)helper.loadModel(IRuleGroup.PASS_LEVEL, null); // pass in a "null" so that loadModel doesn't attempt to cast the result into a RefObject
-    int ruleGroup = (ruleGroupInt == null) ? IRuleGroup.PASS_FULL : ruleGroupInt.intValue();
-
-    Object stream = helper.loadModel("inputStream");
-    if (stream instanceof InputStream)
-    {
-      validate(file, (InputStream)stream, reporter);      
-    } 
-    else
-    {  
-      validate(file, null, reporter);
-    }  
-  }
-  
-  /**
-   * Unpacks the fileModelPair and returns an IFile object.
-   */
-  //protected IFile getFile(Object object)
-  //{
-  //  IFile result = null;
-  //  if (object instanceof List)
-  //  {
-  //    List fileModelPair = (List)object;
-  //    if (fileModelPair.size()>0)
-  //    {
-  //      Object file = fileModelPair.get(0);
-  //      if (file instanceof IFile)
-  //      {
-  ///        result = (IFile)file;
-  //      }
-  //    }
-  //  }
-  //  return result;
- // } 
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wtp.validation.core.IValidator#cleanup(org.eclipse.wtp.validation.core.IReporter)
-   */
-  public void cleanup(IReporter reporter)
-  {
-  }
-
-  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 && (resource.getType() & IResource.ROOT) == 0);
-	return true;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDMessageInfoHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDMessageInfoHelper.java
deleted file mode 100644
index 3c7307a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDMessageInfoHelper.java
+++ /dev/null
@@ -1,71 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.validation;
-
-
-/**
- * @author Mark Hutchinson
- * 
- * The XSDMessageInfoHelper creates a string with the
- */
-public class XSDMessageInfoHelper
-{
-  public XSDMessageInfoHelper()
-  { super();
-  }
-
-  public String[] createMessageInfo(String errorMessage, String errorKey)
-  { 
-    //Now map the error key to what we would want to underline:
-    String nameOrValue = "";
-    String selectionStrategy = "";
-    if (errorKey.equals("s4s-elt-invalid-content.1") || errorKey.equals("s4s-elt-must-match.1") || errorKey.equals("s4s-att-must-appear") || errorKey.equals("s4s-elt-invalid-content.2"))
-    { selectionStrategy = "START_TAG";
-    }
-    else if (errorKey.equals("s4s-att-not-allowed"))
-    { selectionStrategy = "ATTRIBUTE_NAME";
-      nameOrValue = getFirstStringBetweenSingleQuotes(errorMessage);
-    }
-    else if (errorKey.equals("s4s-att-invalid-value"))
-    { selectionStrategy = "ATTRIBUTE_VALUE";
-      nameOrValue = getFirstStringBetweenSingleQuotes(errorMessage);
-    }
-    else if (errorKey.equals("s4s-elt-character"))
-    { selectionStrategy = "TEXT";
-    }
-    else if (errorKey.equals("src-resolve.4.2") || errorKey.equals("src-resolve"))
-    { selectionStrategy = "VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE";
-      nameOrValue = getFirstStringBetweenSingleQuotes(errorMessage);
-    }
-    String messageInfo[] = new String[2];
-    messageInfo[0] = selectionStrategy;
-    messageInfo[1] = nameOrValue;
-    return messageInfo;    
-  }
-
-  /*
-   * Mark Hutchinson
-   * 
-   * This method is used to get the value between the first pair of single quotes
-   * It is used to extract information from the error Message (for example
-   * an attribute name)
-   */
-  private String getFirstStringBetweenSingleQuotes(String s)
-  {
-    int first = s.indexOf("'");
-    int second = s.indexOf("'", first + 1);
-    String betweenQuotes = null;
-    if (first != -1 && second != -1)
-    { betweenQuotes = s.substring(first + 1, second);
-    }
-    return betweenQuotes;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDValidator.java b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDValidator.java
deleted file mode 100644
index 899f21d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDValidator.java
+++ /dev/null
@@ -1,66 +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
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.validation;
-
-import java.io.InputStream;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-
-
-/**
- * An XSD validator specific to Eclipse. This validator will wrap the internal
- * XSD validator an provide automatic URI resolver support.
- * Using this class is equivalent to using the internal XSD validator and registering
- * the URI resolver.
- */
-public class XSDValidator
-{
-  private static XSDValidator instance = null;
-  private org.eclipse.wst.xsd.core.internal.validation.XSDValidator validator = null;
-  
-  /**
-   * Return the one and only instance of the XSD 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 XSD validator.
-   */
-  public static XSDValidator getInstance()
-  {
-    if(instance == null)
-    {
-      instance = new XSDValidator();
-    }
-    return instance;
-  }
-  /**
-   * Constructor. Create the XSD validator and set the URI resolver.
-   */
-  protected XSDValidator()
-  {
-    validator = new org.eclipse.wst.xsd.core.internal.validation.XSDValidator();
-    validator.setURIResolver(URIResolverPlugin.createResolver());
-  }
-  /**
-   * Validate the file at the given URI.
-   * 
-   * @param uri The URI of the file to validate.
-   */
-  /*public ValidationReport validate(String uri)
-  {
-    return validator.validate(uri);
-  }*/
-  public ValidationReport validate(String uri, InputStream inputStream)
-  {
-    return validator.validate(uri, inputStream);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDValidatorManager.java b/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDValidatorManager.java
deleted file mode 100644
index d19ad1c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-validation/org/eclipse/wst/xsd/ui/internal/validation/XSDValidatorManager.java
+++ /dev/null
@@ -1,173 +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
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.validation;
-
-import java.io.IOException;
-import java.net.URL;
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xsd.core.internal.XSDCorePlugin;
-
-public class XSDValidatorManager extends AbstractUIPlugin 
-{
-  protected static XSDValidatorManager plugin;
- 
-  public XSDValidatorManager(IPluginDescriptor descriptor) 
-  {
-    super(descriptor);
-    plugin = this;
-
-  }
-
-  /**
-   * Copy the w3c XMLSchema.dtd and datatypes.dtd into the plugin metadata directory
-   * for validation purposes
-   */
-  public void startup()
-  {
-    //ModelManagerPlugin plugin = (ModelManagerPlugin) Platform.getPlugin(ModelManagerPlugin.ID);
-    //modelManager = plugin.getModelManager();
-  }
-
-  //private static ModelManager modelManager;
-  //public static ModelManager getModelManager()
-  //{
-  //  return modelManager;
-  //}
-
-  /**
-   * Get the Install URL
-   */
-  public static URL getInstallURL()
-  {
-    return XSDCorePlugin.getDefault().getDescriptor().getInstallURL();
-  }
-
-  /**
-   * Return the plugin physical directory location
-   */
-  public static IPath getPluginLocation()
-  {
-    try 
-    {
-      IPath installPath = new Path(getInstallURL().toExternalForm()).removeTrailingSeparator();
-      String installStr = Platform.asLocalURL(new URL(installPath.toString())).getFile();
-      return new Path(installStr);
-    } 
-    catch (IOException e) 
-    {
-
-    }
-    return null;
-  }
-
-  /**
-   * Get the metadata directory for this plugin
-   */
-  //public static String getMetaDataDirectory()
-  //{
-  //  return getPlugin().getStateLocation().toOSString();
-  //}
-
-  /** 
-   *  Get the one xmlschema package.
-   */
-//   public XMLSchemaPackage getXMLSchemaPackage()
-//   {
-//     return xmlschemaPackage;
-//   }
-
-//   /** 
-//    *  Get the one xmlschema factory.
-//    */
-//   public XMLSchemaFactory getXMLSchemaFactory()
-//   {
-//     return (XMLSchemaFactory)xmlschemaPackage.getEFactoryInstance();
-//   }
-
-  /**
-   * Get the singleton instance.
-   */
-  public static XSDValidatorManager getInstance()
-  {
-    return plugin;
-  }
-
-
-  //public static Image getXSDImage(String iconName)
-  //{
-  //  return getPlugin().getImage(iconName);
-  //}
-
-  /**
-   * Get resource string
-   */
-  public static String getString(String key)
-  {
-    return XSDCorePlugin.getDefault().getDescriptor().getResourceBundle().getString(key);
-  }
-
-  /**
-   * Get resource string
-   */
-  public static String getString(String key, String arg0)
-  {
-    return MessageFormat.format(getString(key), new Object [] { arg0 });
-  }
-  
-  /**
-   * Get resource string
-   */
-  public static String getString(String key, String arg0, String arg1)
-  {
-    return MessageFormat.format(getString(key), new Object [] { arg0, arg1 });
-  }
-  public IWorkspace getWorkspace()
-  {
-    return ResourcesPlugin.getWorkspace();
-  }
-
-  //public static Shell getShell() 
-  //{	
-  //  return getPlugin().getWorkbench().getActiveWorkbenchWindow().getShell();
-  //}
-
-  /**
-   * Get the xml schema default namespace prefix
-   */
-  //public String getXMLSchemaPrefix()
-  //{
-  //  return getPreferenceStore().getString(CONST_XSD_DEFAULT_PREFIX_TEXT);
-  //}
-
-  /**
-   * Get the xml schema language qualification
-   */
-  //public boolean isQualifyXMLSchemaLanguage()
-  //{
-  //  return getPreferenceStore().getBoolean(CONST_XSD_LANGUAGE_QUALIFY);
-  //}
-  
-
-  
-  public static final String CONST_XSD_DEFAULT_PREFIX_TEXT = "org.eclipse.wst.xmlschema.xsdDefaultPrefixText";
-  public static final String CONST_XSD_LANGUAGE_QUALIFY = "org.eclipse.wst.xmlschema.xsdQualify";
-  
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/Logger.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/Logger.java
deleted file mode 100644
index 3ba5a01..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/Logger.java
+++ /dev/null
@@ -1,157 +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.xsd.ui.internal;
-
-import java.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.xsd.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.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/StructuredTextViewerConfigurationXSD.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/StructuredTextViewerConfigurationXSD.java
deleted file mode 100644
index 1b68b13..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/StructuredTextViewerConfigurationXSD.java
+++ /dev/null
@@ -1,43 +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
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
-
-/**
- * Configuration for editing XSD content type
- */
-public class StructuredTextViewerConfigurationXSD extends StructuredTextViewerConfigurationXML {
-	public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
-		if (sourceViewer == null || !fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED))
-			return null;
-
-		List allDetectors = new ArrayList(0);
-		// add XSD Hyperlink detector
-		allDetectors.add(new XSDHyperlinkDetector());
-
-		IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer);
-		for (int m = 0; m < superDetectors.length; m++) {
-			IHyperlinkDetector detector = superDetectors[m];
-			if (!allDetectors.contains(detector)) {
-				allDetectors.add(detector);
-			}
-		}
-		return (IHyperlinkDetector[]) allDetectors.toArray(new IHyperlinkDetector[0]);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDActionBarContributor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDActionBarContributor.java
deleted file mode 100644
index 3c90b21..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDActionBarContributor.java
+++ /dev/null
@@ -1,250 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.RetargetAction;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
-import org.eclipse.wst.xsd.ui.internal.actions.ISchemaEditorActionConstants;
-import org.eclipse.wst.xsd.ui.internal.actions.ReloadDependenciesAction;
-import org.eclipse.wst.xsd.ui.internal.actions.SourcePageActionContributor;
-import org.eclipse.wst.xsd.ui.internal.refactor.actions.RefactorActionGroup;
-
-public class XSDActionBarContributor extends MultiPageEditorActionBarContributor
-{
-  protected XSDEditor xsdEditor;
-  protected ITextEditor textEditor;
-  protected IEditorActionBarContributor sourceViewerActionContributor = null;
-  
-  protected ReloadDependenciesAction reloadDependenciesAction;
-  
-  protected List fPartListeners= new ArrayList();
-
-  protected RetargetAction retargetReloadDependenciesAction;
-  private RetargetTextEditorAction renameElementAction = null;
-  private IMenuManager refactorMenu = null;
- 
-  /**
-   * Constructor for XSDActionBarContributor.
-   */
-  public XSDActionBarContributor()
-  {
-    super();
-    
-    sourceViewerActionContributor = new SourcePageActionContributor();
-
-    // Reload Dependencies
-    reloadDependenciesAction = new ReloadDependenciesAction(XSDEditorPlugin.getXSDString("_UI_MENU_RELOAD_DEPENDENCIES"));
-    retargetReloadDependenciesAction = new RetargetAction(ISchemaEditorActionConstants.RETARGET_RELOAD_DEPENDENCIES_ACTION_ID, XSDEditorPlugin.getXSDString("_UI_MENU_RELOAD_DEPENDENCIES"));
-    retargetReloadDependenciesAction.setToolTipText(XSDEditorPlugin.getXSDString("_UI_MENU_RELOAD_DEPENDENCIES_TOOLTIP"));
-    retargetReloadDependenciesAction.setImageDescriptor(
-        ImageDescriptor.createFromFile(XSDEditorPlugin.getPlugin().getClass(), "icons/reloadgrammar.gif"));
-    fPartListeners.add(retargetReloadDependenciesAction);
-    
-    ResourceBundle bundle = Platform.getResourceBundle(XSDEditorPlugin.getPlugin().getBundle());
-	renameElementAction = new RetargetTextEditorAction(bundle, ISchemaEditorActionConstants.RETARGET_RENAME_ELEMENT_ACTION_ID + StructuredTextEditorActionConstants.DOT);
-	renameElementAction.setActionDefinitionId("org.eclipse.wst.xsd.ui.refactor.rename.element"); // TODO: add to contstants command id
-		
-	// the refactor menu, add the menu itself to add all refactor actions
-	refactorMenu = new MenuManager(XSDEditorPlugin.getXSDString("refactoring.menu.label"), RefactorActionGroup.MENU_ID); //TODO: externalize string
-	refactorMenu.add(this.renameElementAction);
-  }
-
-  protected void updateActions()
-  {
-    if (xsdEditor != null && xsdEditor.getCurrentPageType().equals(XSDEditorPlugin.GRAPH_PAGE))
-    {
-      IAction deleteAction = xsdEditor.getGraphViewer().getComponentViewer().getMenuListener().getDeleteAction();
-      getActionBars().setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction);
-
-      IAction printGraphAction = xsdEditor.getGraphViewer().getPrintGraphAction();
-      getActionBars().setGlobalActionHandler(ActionFactory.PRINT.getId(), printGraphAction);
-    }
-    else
-    {
-      getActionBars().setGlobalActionHandler(ActionFactory.DELETE.getId(), null);      
-      // always enable print regardless of whether we are on source or design
-      updateAction(ActionFactory.PRINT.getId(), ITextEditorActionConstants.PRINT, true);
-    }
-  }
-      
-  public void setActivePage(IEditorPart activeEditor)
-  {
-    updateActions();
-    
-    if (activeEditor != null && activeEditor instanceof StructuredTextEditor)
-    {
-      activateSourcePage(activeEditor, true);
-    }
-    else
-    {
-      activateSourcePage(xsdEditor, false);
-    }
-
-    IActionBars actionBars = getActionBars();
-    if (actionBars != null) {
-      // update menu bar and tool bar
-      actionBars.updateActionBars();
-    }
-    
-    updateAction(IWorkbenchActionConstants.UNDO, ITextEditorActionConstants.UNDO, true);
-    updateAction(IWorkbenchActionConstants.REDO, ITextEditorActionConstants.REDO, true);
-
-    getActionBars().updateActionBars();
-  }
-  
-  protected void activateSourcePage(IEditorPart activeEditor, boolean state)
-  {
-    if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor)
-    {
-      sourceViewerActionContributor.setActiveEditor(activeEditor);
-      ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(state);
-    }
-  }
-
-  protected void updateAction(String globalActionId, String textEditorActionId, boolean enable)
-  {
-    getActionBars().setGlobalActionHandler(globalActionId,
-                                      enable ? getAction(textEditor, textEditorActionId) :
-                                               null);
-  }
-
-  /**
-   * Returns the action registed with the given text editor.
-   * @return IAction or null if editor is null.
-   */
-  protected IAction getAction(ITextEditor editor, String actionID)
-  {
-    try
-    {
-      return (editor == null ? null : editor.getAction(actionID));
-    }
-    catch (Exception e)
-    {
-      return null;
-    }
-  }
-
-  public void addToMenu(IMenuManager menuManager)
-  {
-    MenuManager treeMenu = new MenuManager(XSDEditorPlugin.getXSDString("_UI_MENU_XSD_EDITOR"));
-    menuManager.insertAfter(IWorkbenchActionConstants.MB_ADDITIONS, treeMenu);
-
-    treeMenu.add(new Separator("group1"));
-//  Add retarget actions
-
-    treeMenu.add(retargetReloadDependenciesAction);
-
-    treeMenu.add(new Separator("group2"));
-  }
-
-
-public void addToToolBar(IToolBarManager toolBarManager)
-  {
-    toolBarManager.add(new Separator("XMLSchema.2"));
-//  Add retarget actions
-    toolBarManager.add(retargetReloadDependenciesAction);
-
-    toolBarManager.add(new Separator("XMLSchema.1"));
-
-    toolBarManager.add(new Separator());
-  }
-  
-  public void contributeToToolBar(IToolBarManager toolBarManager)
-  {
-    addToToolBar(toolBarManager);
-  }
-  
-  public void contributeToMenu(IMenuManager menuManager)
-  {
-    addToMenu(menuManager);
-  }
-  
-  /**
-   * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(IEditorPart)
-   */
-  public void setActiveEditor(IEditorPart targetEditor)
-  {
-    if (targetEditor instanceof XSDEditor)
-    {
-      xsdEditor = (XSDEditor) targetEditor;
-      reloadDependenciesAction.setEditor((XSDEditor)targetEditor);
-
-      textEditor = ((XSDEditor)targetEditor).getTextEditor();
-      if (textEditor != null)
-      {      
-         
-        renameElementAction.setAction(getAction(textEditor, ISchemaEditorActionConstants.RETARGET_RENAME_ELEMENT_ACTION_ID));
-        updateActions();  
-        getActionBars().updateActionBars();
-      }
-    }
-    super.setActiveEditor(targetEditor);
-    
-    updateAction(IWorkbenchActionConstants.UNDO, ITextEditorActionConstants.UNDO, true);
-    updateAction(IWorkbenchActionConstants.REDO, ITextEditorActionConstants.REDO, true);
-  }
-
-  public void init(IActionBars bars, IWorkbenchPage page)
-  {
-    Iterator e = fPartListeners.iterator();
-    while (e.hasNext())
-    {
-      page.addPartListener((RetargetAction) e.next());
-    }
-
-    // register actions that have a dynamic editor. 
-
-    bars.setGlobalActionHandler(ISchemaEditorActionConstants.RETARGET_RELOAD_DEPENDENCIES_ACTION_ID, reloadDependenciesAction);
-    
-    initSourceViewerActionContributor(bars);
-    
-    super.init(bars, page);
-  }
-  
-  protected void initSourceViewerActionContributor(IActionBars actionBars) {
-    if (sourceViewerActionContributor != null)
-      sourceViewerActionContributor.init(actionBars, getPage());
-  }
-
-  
-  public void dispose()
-  {
-    super.dispose();
-    
-    if (sourceViewerActionContributor != null)
-      sourceViewerActionContributor.dispose();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlineConfiguration.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlineConfiguration.java
deleted file mode 100644
index 09e105e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlineConfiguration.java
+++ /dev/null
@@ -1,354 +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
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
-import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateActionContributionItem;
-import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xsd.ui.internal.actions.OpenSchemaAction;
-import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDAdapterFactoryLabelProvider;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDContentProvider;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDModelAdapterFactoryImpl;
-import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Outline configuration for XSD
- */
-public class XSDContentOutlineConfiguration extends ContentOutlineConfiguration {
-	private XSDContentProvider fContentProvider;
-	private ILabelProvider fLabelProvider;
-	private KeyListener[] fKeyListeners = null;
-	private IMenuListener fMenuListener = null;
-	private XSDEditor fEditor = null;
-	private TreeViewer treeViewer;
-	protected SelectionManagerSelectionChangeListener selectionManagerSelectionChangeListener = new SelectionManagerSelectionChangeListener();
-	
-	public XSDContentOutlineConfiguration()
-	{
-		super();
-	}
-
-	public IContentProvider getContentProvider(TreeViewer viewer) {
-		if (fContentProvider == null) {
-			fContentProvider = new XSDContentProvider(XSDModelAdapterFactoryImpl.getInstance());
-		}
-		this.treeViewer = viewer;
-		getXSDEditor().getSelectionManager().addSelectionChangedListener(selectionManagerSelectionChangeListener);
-		return fContentProvider;
-	}
-
-	public ILabelProvider getLabelProvider(TreeViewer viewer) {
-		if (fLabelProvider == null) {
-			fLabelProvider = new XSDAdapterFactoryLabelProvider(XSDModelAdapterFactoryImpl.getInstance());
-		}
-		return fLabelProvider;
-	}
-
-	public IMenuListener getMenuListener(TreeViewer viewer) {
-		if (fMenuListener == null) {
-			// ISSUE: what happens if cannot get XSD Editor? (See
-			// getXSDEditor comment)
-			if (getXSDEditor() != null)
-				fMenuListener = new XSDMenuListener(getXSDEditor().getSelectionManager());
-		}
-		return fMenuListener;
-	}
-
-	public KeyListener[] getKeyListeners(TreeViewer viewer) {
-		if (fKeyListeners == null) {
-			final TreeViewer finalViewer = viewer;
-			KeyAdapter keyListener = new KeyAdapter() {
-				public void keyReleased(KeyEvent e) {
-					if (e.character == SWT.DEL) {
-						IMenuListener menuListener = getMenuListener(finalViewer);
-						if (menuListener instanceof XSDMenuListener)
-							((XSDMenuListener) menuListener).getDeleteAction().run();
-					}
-					else if (e.keyCode == SWT.F3) // open editor on any
-					// include/import/redefine
-					{
-						if (e.widget instanceof Tree) {
-							Tree tree = (Tree) e.widget;
-							TreeItem[] selection = tree.getSelection();
-							if (selection.length > 0) {
-								if (selection[0].getData() instanceof XSDSchemaDirective) {
-									XSDSchemaDirective comp = (XSDSchemaDirective) selection[0].getData();
-									OpenSchemaAction openSchema = new OpenSchemaAction(XSDEditorPlugin.getXSDString("_UI_ACTION_OPEN_SCHEMA"), comp);
-									openSchema.run();
-								}
-							}
-						}
-					}
-				}
-			};
-			fKeyListeners = new KeyListener[]{keyListener};
-		}
-
-		return fKeyListeners;
-	}
-
-	public ISelection getSelection(TreeViewer viewer, ISelection selection) {
-		ISelection sel = selection;
-
-		if (selection instanceof IStructuredSelection) {
-			List xsdSelections = new ArrayList();
-			for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();) {
-				Object domNode = i.next();
-				Object xsdNode = getXSDNode(domNode, viewer);
-				if (xsdNode != null) {
-					xsdSelections.add(xsdNode);
-				}
-			}
-
-			if (!xsdSelections.isEmpty()) {
-				sel = new StructuredSelection(xsdSelections);
-			}
-		}
-		return sel;
-	}
-
-	/**
-	 * Determines XSD node based on object (DOM node)
-	 * 
-	 * @param object
-	 * @return
-	 */
-	private Object getXSDNode(Object object, TreeViewer viewer) {
-		// get the element node
-		Element element = null;
-		if (object instanceof Node) {
-			Node node = (Node) object;
-			if (node != null) {
-				if (node.getNodeType() == Node.ELEMENT_NODE) {
-					element = (Element) node;
-				}
-				else if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
-					element = ((Attr) node).getOwnerElement();
-				}
-			}
-		}
-		Object o = element;
-		if (element != null) {
-			Object modelObject = getXSDSchema(viewer).getCorrespondingComponent(element);
-			if (modelObject != null) {
-				o = modelObject;
-			}
-		}
-		return o;
-	}
-
-	/**
-	 * Gets the xsd schema from treeviewer's input
-	 * 
-	 * @param model
-	 *            (of type Object but really should be IStructuredModel)
-	 * @return Definition
-	 */
-	private XSDSchema getXSDSchema(TreeViewer viewer) {
-		XSDSchema xsdSchema = null;
-		Object model = null;
-		if (viewer != null)
-			model = viewer.getInput();
-
-		if (model instanceof IDOMModel) {
-			IDOMDocument domDoc = ((IDOMModel) model).getDocument();
-			if (domDoc != null) {
-				XSDModelAdapter modelAdapter = (XSDModelAdapter) domDoc.getExistingAdapter(XSDModelAdapter.class);
-				/*
-				 * ISSUE: Didn't want to go through initializing schema if it
-				 * does not already exist, so just attempted to get existing
-				 * adapter. If doesn't exist, just don't bother working.
-				 */
-				if (modelAdapter != null)
-					xsdSchema = modelAdapter.getSchema();
-			}
-		}
-		return xsdSchema;
-	}
-
-	// ISSUE: There are some cases where outline comes up before editor
-	private XSDEditor getXSDEditor() {
-		if (fEditor == null) {
-			IWorkbench workbench = PlatformUI.getWorkbench();
-			if (workbench != null) {
-				IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
-				if (window != null) {
-					IWorkbenchPage page = window.getActivePage();
-					if (page != null) {
-						IEditorPart editor = page.getActiveEditor();
-						if (editor instanceof XSDEditor)
-							fEditor = (XSDEditor) editor;
-					}
-				}
-			}
-		}
-		return fEditor;
-	}
-
-	protected IContributionItem[] createMenuContributions(TreeViewer viewer) {
-       IContributionItem[] items = super.createMenuContributions(viewer);
-		
-	   referenceAction = new FilterAction(XSDEditorPlugin.getPlugin().getPreferenceStore(), "referenceContentAction", new ReferenceFilter("Reference Content"), XSDEditorPlugin.getXSDString("_UI_OUTLINE_SHOW_REFERENCES"), ImageDescriptor.createFromFile(XSDEditorPlugin.getPlugin().getClass(), "icons/XSDElementRef.gif"));
-       boolean initialRef = getXSDEditor().getXSDModelAdapterFactory().getShowReferences();
-       referenceAction.setChecked(initialRef);
-
-       inheritedAction = new FilterAction(XSDEditorPlugin.getPlugin().getPreferenceStore(), "inheritedContentAction", new ReferenceFilter("Inherited Content"), XSDEditorPlugin.getXSDString("_UI_OUTLINE_SHOW_INHERITED"), ImageDescriptor.createFromFile(XSDEditorPlugin.getPlugin().getClass(), "icons/XSDComplexContent.gif"));
-		
-	   IContributionItem toggleReferenceItem = new PropertyChangeUpdateActionContributionItem(referenceAction);
-	   IContributionItem toggleInheritedItem = new PropertyChangeUpdateActionContributionItem(inheritedAction);
-	    
-	   List list = new ArrayList();
-	   list.addAll(Arrays.asList(items));
-	   list.add(toggleReferenceItem);
-	   list.add(toggleInheritedItem);
-	   
-	   int length = list.size();
-	   IContributionItem[] newItems = new IContributionItem[length];
-	   int i = 0;
-	   for (Iterator iter = list.iterator(); iter.hasNext(); i++)
-	   {
-	     newItems[i] = (IContributionItem)iter.next();
-	   }
-	   
-	   return newItems;
-	}
-	
-	  // expose
-	  public TreeViewer getTreeViewer()
-	  {
-	    return treeViewer;
-	  }
-
-	  FilterAction referenceAction, inheritedAction;
-	  
-	  private void updateActions(Action current)
-	  {
-	    if (referenceAction.isChecked())
-	    {
-	      getXSDEditor().getXSDModelAdapterFactory().setShowReferences(true);
-	    }
-	    else
-	    {
-	      getXSDEditor().getXSDModelAdapterFactory().setShowReferences(false);
-	    }
-	    if (inheritedAction.isChecked())
-	    {
-	      getXSDEditor().getXSDModelAdapterFactory().setShowInherited(true);
-	    }
-	    else
-	    {
-	      getXSDEditor().getXSDModelAdapterFactory().setShowInherited(false);
-	    }
-	    getTreeViewer().refresh();
-	  }
-
-	  public class FilterAction extends PropertyChangeUpdateAction
-	  {
-	    ViewerFilter filter;
-
-	    public FilterAction(IPreferenceStore store, String preference, ViewerFilter filter, String label, ImageDescriptor image)
-	    {
-	      super(label, store, preference, true);
-	      setImageDescriptor(image);
-	      setUpdateFromPropertyChange(false);
-	      this.filter = filter;
-	      setChecked(false);
-	    }
-
-	    public void update()
-	    {
-	      super.update();
-	      updateActions(this);
-	    }
-	  }
-	  
-	  class ReferenceFilter extends ViewerFilter // Dummy filter
-	  {
-	    public ReferenceFilter(String elementTag)
-	    {
-	      this.elementTag = elementTag;
-	    }
-	    protected String elementTag;
-
-	    public boolean select(Viewer viewer, Object parentElement, Object element)
-	    {
-	      return true;
-	    }
-	  }
-	
-	  class SelectionManagerSelectionChangeListener implements ISelectionChangedListener
-	  {
-	    public void selectionChanged(SelectionChangedEvent event)
-	    {
-	      if (event.getSelectionProvider() != getTreeViewer())
-	      {
-	    	StructuredSelection selection = (StructuredSelection)event.getSelection();
-	    	if (selection.getFirstElement() instanceof XSDSchema)
-	    	{
-	    	   StructuredSelection s = (StructuredSelection)getTreeViewer().getSelection();
-	    	   if (!(s.getFirstElement() instanceof CategoryAdapter))
-	    	   {
-	    		 getTreeViewer().setSelection(event.getSelection(), true);
-	    	   }
-	    	}
-	    	else
-	    	{
-	          getTreeViewer().setSelection(event.getSelection(), true);
-	    	}
-	      }
-	    }
-	  }
-
-	  public void unconfigure(TreeViewer viewer) {
-		  super.unconfigure(viewer);
-		  getXSDEditor().getSelectionManager().removeSelectionChangedListener(selectionManagerSelectionChangeListener);
-	  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlinePage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlinePage.java
deleted file mode 100644
index f6ab990..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlinePage.java
+++ /dev/null
@@ -1,561 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-import org.eclipse.wst.xsd.ui.internal.actions.OpenSchemaAction;
-import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.w3c.dom.Element;
-
-/**
- * @deprecated Using SSE's ConfiguratbleContentOutlinePage 
- * instead via XSDContentOutlineCOnfiguration
- */
-public class XSDContentOutlinePage extends ContentOutlinePage implements ISelectionListener
-{
-  protected XSDEditor xsdEditor;
-  protected int level = 0;
-  protected Object model;
-  protected ITreeContentProvider contentProvider;
-  protected ILabelProvider labelProvider;
-  protected XSDSelectionManager selectionManager;
-  protected SelectionManagerSelectionChangeListener selectionManagerSelectionChangeListener = new SelectionManagerSelectionChangeListener();
-  protected TreeSelectionChangeListener treeSelectionChangeListener = new TreeSelectionChangeListener();
-  XSDEditor xsdTextEditor;
-  XSDMenuListener menuListener;
-  SelectionProvider fSelectionProvider = null;
-  
-  /**
-   *  
-   */
-  public XSDContentOutlinePage(XSDEditor xsdTextEditor)
-  {
-    super();
-    this.xsdTextEditor = xsdTextEditor;
-    fSelectionProvider = new SelectionProvider();
-  }
-
-  public void init(IPageSite pageSite)
-  {
-  	super.init(pageSite);
-  	getSite().getWorkbenchWindow().getSelectionService().addPostSelectionListener(this);
-  	getSite().setSelectionProvider(fSelectionProvider);
-  }
-  
-  public void dispose()
-  {
-  	super.dispose();
-  	getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(this);
-  }
-  
-  public void setModel(Object newModel)
-  {
-    model = newModel;
-  }
-
-  public void setContentProvider(ITreeContentProvider contentProvider)
-  {
-    this.contentProvider = contentProvider;
-  }
-
-  public void setLabelProvider(ILabelProvider labelProvider)
-  {
-    this.labelProvider = labelProvider;
-  }
-
-  // expose
-  public TreeViewer getTreeViewer()
-  {
-    return super.getTreeViewer();
-  }
-
-  public void createControl(Composite parent)
-  {
-    super.createControl(parent);
-    getTreeViewer().setContentProvider(contentProvider);
-    getTreeViewer().setLabelProvider(labelProvider);
-    getTreeViewer().setInput(model);
-//    getTreeViewer().addSelectionChangedListener(this);
-    MenuManager menuManager = new MenuManager("#popup");//$NON-NLS-1$
-    menuManager.setRemoveAllWhenShown(true);
-    Menu menu = menuManager.createContextMenu(getTreeViewer().getControl());
-    getTreeViewer().getControl().setMenu(menu);
-    menuListener = new XSDMenuListener(xsdTextEditor.getSelectionManager());
-//  menuListener.setSelectionProvider(getTreeViewer());
-    menuManager.addMenuListener(menuListener);
-    
-    // enable popupMenus extension
-    getSite().registerContextMenu("org.eclipse.wst.xsd.ui.popup.outline", menuManager, xsdTextEditor.getSelectionManager());
-
-    setSelectionManager(xsdTextEditor.getSelectionManager());
-    // cs... why are we doing this from the outline view?
-    //
-    //xsdTextEditor.getXSDEditor().getSelectionManager().setSelection(new
-    // StructuredSelection(xsdTextEditor.getXSDSchema()));
-    XSDKeyListener keyListener = new XSDKeyListener(getTreeViewer(), menuListener);
-    getTreeViewer().getControl().addKeyListener(keyListener);
-    // drill down from outline view
-    getTreeViewer().getControl().addMouseListener(new MouseAdapter()
-    {
-      public void mouseDoubleClick(MouseEvent e)
-      {
-        ISelection iSelection = getTreeViewer().getSelection();
-        if (iSelection instanceof StructuredSelection)
-        {
-          StructuredSelection selection = (StructuredSelection)iSelection;
-          Object obj = selection.getFirstElement();
-          if (obj instanceof XSDConcreteComponent)
-          {
-            XSDConcreteComponent comp = (XSDConcreteComponent)obj;
-            if (comp.getContainer() instanceof XSDSchema)
-            {
-              xsdTextEditor.getGraphViewer().setInput(obj);
-            }
-          }
-        }
-
-      }
-    });
-    
-    
-		getTreeViewer().addPostSelectionChangedListener(fSelectionProvider.getPostSelectionChangedListener());
-		getTreeViewer().addSelectionChangedListener(fSelectionProvider.getSelectionChangedListener());
-
-  }
-  class XSDKeyListener extends KeyAdapter
-  {
-    TreeViewer viewer;
-    XSDMenuListener menuListener;
-
-    public XSDKeyListener(TreeViewer viewer, XSDMenuListener menuListener)
-    {
-      super();
-      this.viewer = viewer;
-      this.menuListener = menuListener;
-    }
-
-    /**
-     * @see org.eclipse.swt.events.KeyAdapter#keyReleased(KeyEvent)
-     */
-    public void keyReleased(KeyEvent e)
-    {
-      if (e.character == SWT.DEL)
-      {
-        menuListener.getDeleteAction().run();
-      }
-      else if (e.keyCode == SWT.F3) // open editor on any
-                                    // include/import/redefine
-      {
-        if (e.widget instanceof Tree)
-        {
-          Tree tree = (Tree) e.widget;
-          TreeItem[] selection = tree.getSelection();
-          if (selection.length > 0)
-          {
-            if (selection[0].getData() instanceof XSDSchemaDirective)
-            {
-              XSDSchemaDirective comp = (XSDSchemaDirective) selection[0].getData();
-              OpenSchemaAction openSchema = new OpenSchemaAction(XSDEditorPlugin.getXSDString("_UI_ACTION_OPEN_SCHEMA"), comp);
-              openSchema.run();
-            }
-          }
-        }
-      }
-    }
-  }
-
-  public void setExpandToLevel(int i)
-  {
-    level = i;
-  }
-
-  public void setInput(Object value)
-  {
-    getTreeViewer().setInput(value);
-    getTreeViewer().expandToLevel(level);
-  }
-
-  public void selectionChanged(IWorkbenchPart part, ISelection selection)
-  {
-    if (selectionManager != null)
-    {
-      if (selection instanceof IStructuredSelection)
-      {
-        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-        Object o = structuredSelection.getFirstElement();
-        // TODO ...
-        // we need to implement a selectionManagerMapping extension point
-        // so that extensions can specify how they'd like to map view objects
-        // to selection objects
-        //                                        
-        if (o instanceof Element)
-        {
-          try
-          {
-            Object modelObject = xsdTextEditor.getXSDSchema().getCorrespondingComponent((Element) o);
-            if (modelObject != null)
-            {
-              o = modelObject;
-            }
-          }
-          catch (Exception e)
-          {
-          }
-        }
-        else if (o instanceof CategoryAdapter)
-        {
-          // todo... we need to ensure we eliminate the propagation 
-          // of 'view' specific objects into the SelectionManager.                     
-          // We need to do some work to ensure all views utilize the 'Category' model object  
-          // so we can get rid of this CategoryAdapter class.
-//           CategoryAdapter adapter = (CategoryAdapter) o;
-//           o = adapter.getXSDSchema();
-        }
-        if (o != null)
-        {
-    			if (getControl() != null && !getControl().isDisposed() && !getControl().isFocusControl() && getControl().isVisible()) {
-    				/*
-    				 * Do not allow selection from other parts to affect selection
-    				 * in the tree widget if it has focus. Selection events
-    				 * "bouncing" off of other parts are all that we can receive
-    				 * if we have focus (since we forward selection to the
-    				 * service), and only the user should affect selection if we
-    				 * have focus.
-    				 */
-            getTreeViewer().setSelection(new StructuredSelection(o), true);
-    			}
-          selectionManager.setSelection(new StructuredSelection(o), getTreeViewer());
-//        selectionManager.selectionChanged(new SelectionChangedEvent(getTreeViewer(),new StructuredSelection(o)));
-        }
-        else
-        {
-          // selectionManager.setSelection(new StructuredSelection(),
-          // getTreeViewer());
-        }
-      }
-    }
-  }
-  
-  public void setSelectionManager(XSDSelectionManager newSelectionManager)
-  {
-    TreeViewer treeViewer = getTreeViewer();
-    // disconnect from old one
-    if (selectionManager != null)
-    {
-      selectionManager.removeSelectionChangedListener(selectionManagerSelectionChangeListener);
-      treeViewer.removeSelectionChangedListener(treeSelectionChangeListener);
-    }
-    selectionManager = newSelectionManager;
-    // connect to new one
-    if (selectionManager != null)
-    {
-      selectionManager.addSelectionChangedListener(selectionManagerSelectionChangeListener);
-      treeViewer.addSelectionChangedListener(treeSelectionChangeListener);
-    }
-  }
-  
-  class SelectionManagerSelectionChangeListener implements ISelectionChangedListener
-  {
-    public void selectionChanged(SelectionChangedEvent event)
-    {
-      if (event.getSelectionProvider() != getTreeViewer())
-      {
-        getTreeViewer().setSelection(event.getSelection(), true);
-      }
-    }
-  }
-  class TreeSelectionChangeListener implements ISelectionChangedListener
-  {
-    public void selectionChanged(SelectionChangedEvent event)
-    {
-      if (selectionManager != null)
-      {
-        ISelection selection = event.getSelection();
-        if (selection instanceof IStructuredSelection)
-        {
-          IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-          Object o = structuredSelection.getFirstElement();
-          // TODO ...
-          // we need to implement a selectionManagerMapping extension point
-          // so that extensions can specify how they'd like to map view objects
-          // to selection objects
-          //                                        
-          if (o instanceof Element)
-          {
-            try
-            {
-              Object modelObject = xsdTextEditor.getXSDSchema().getCorrespondingComponent((Element) o);
-              if (modelObject != null)
-              {
-                o = modelObject;
-              }
-            }
-            catch (Exception e)
-            {
-            }
-          }
-          else if (o instanceof CategoryAdapter)
-          {
-            // todo... we need to ensure we eliminate the propagation 
-            // of 'view' specific objects into the SelectionManager.                     
-            // We need to do some work to ensure all views utilize the 'Category' model object  
-            // so we can get rid of this CategoryAdapter class.
-//             CategoryAdapter adapter = (CategoryAdapter) o;
-//             o = adapter.getXSDSchema();
-          }
-          if (o != null)
-          {
-            selectionManager.setSelection(new StructuredSelection(o), getTreeViewer());
-//          selectionManager.selectionChanged(new SelectionChangedEvent(getTreeViewer(),new StructuredSelection(o)));
-          }
-        }
-      }
-    }
-  }
-  FilterAction referenceAction, inheritedAction;
-
-  public void setActionBars(IActionBars actionBars)
-  {
-    super.setActionBars(actionBars);
-    // Uncomment to add sort action
-    //    SortAction sortAction = new SortAction();
-    //
-    //    actionBars.getToolBarManager().add(sortAction);
-    //    sortAction.setChecked(false);
-    referenceAction = new FilterAction(new ReferenceFilter("Reference Content"), XSDEditorPlugin.getXSDString("_UI_OUTLINE_SHOW_REFERENCES"), ImageDescriptor.createFromFile(XSDEditorPlugin
-        .getPlugin().getClass(), "icons/XSDElementRef.gif"));
-    boolean initialRef = xsdTextEditor.getXSDModelAdapterFactory().getShowReferences();
-    referenceAction.setChecked(initialRef);
-    inheritedAction = new FilterAction(new ReferenceFilter("Inherited Content"), XSDEditorPlugin.getXSDString("_UI_OUTLINE_SHOW_INHERITED"), ImageDescriptor.createFromFile(XSDEditorPlugin.getPlugin()
-        .getClass(), "icons/XSDComplexContent.gif"));
-    IMenuManager menu = actionBars.getMenuManager();
-    menu.add(referenceAction);
-    menu.add(inheritedAction);
-  }
-
-  private void updateActions(Action current)
-  {
-    if (referenceAction.isChecked())
-    {
-      xsdTextEditor.getXSDModelAdapterFactory().setShowReferences(true);
-    }
-    else
-    {
-      xsdTextEditor.getXSDModelAdapterFactory().setShowReferences(false);
-    }
-    if (inheritedAction.isChecked())
-    {
-      xsdTextEditor.getXSDModelAdapterFactory().setShowInherited(true);
-    }
-    else
-    {
-      xsdTextEditor.getXSDModelAdapterFactory().setShowInherited(false);
-    }
-  }
-  private Sorter sorter = new Sorter();
-  public class Sorter extends org.eclipse.jface.viewers.ViewerSorter
-  {
-  }
-  public class SortAction extends Action
-  {
-    public SortAction()
-    {
-      super("Sort", ImageDescriptor.createFromFile(XSDEditorPlugin.getPlugin().getClass(), "icons/sort.gif"));
-    }
-
-    public void run()
-    {
-      getTreeViewer().getControl().setVisible(false);
-      Object[] expandedElements = getTreeViewer().getExpandedElements();
-      getTreeViewer().setSorter(isChecked() ? sorter : null);
-      Object input = getTreeViewer().getInput();
-      getTreeViewer().setInput(input);
-      getTreeViewer().setExpandedElements(expandedElements);
-      getTreeViewer().getControl().setVisible(true);
-    }
-
-    public void setChecked(boolean checked)
-    {
-      super.setChecked(checked);
-      setToolTipText(checked ? XSDEditorPlugin.getXSDString("_UI_OUTLINE_DO_NOT_SORT") : XSDEditorPlugin.getXSDString("_UI_OUTLINE_SORT"));
-    }
-  }
-  public class FilterAction extends Action
-  {
-    ViewerFilter filter;
-
-    public FilterAction(ViewerFilter filter, String label, ImageDescriptor image)
-    {
-      super(label, image);
-      this.filter = filter;
-      setChecked(false);
-    }
-
-    public void run()
-    {
-      updateActions(this);
-      if (isChecked())
-      {
-        getTreeViewer().resetFilters();
-        getTreeViewer().addFilter(filter);
-      }
-      else
-      {
-        getTreeViewer().removeFilter(filter);
-      }
-    }
-  }
-  class ReferenceFilter extends ViewerFilter // Dummy filter
-  {
-    public ReferenceFilter(String elementTag)
-    {
-      this.elementTag = elementTag;
-    }
-    protected String elementTag;
-
-    public boolean select(Viewer viewer, Object parentElement, Object element)
-    {
-      return true;
-    }
-  }
-  
-	/**
-	 * Forwards post-selection from the tree viewer to the listeners while
-	 * acting as this page's selection provider.
-	 */
-	private class SelectionProvider implements IPostSelectionProvider {
-		private class PostSelectionChangedListener implements ISelectionChangedListener {
-			public void selectionChanged(SelectionChangedEvent event) {
-				if (!isFiringSelection()) {
-					fireSelectionChanged(event, postListeners);
-				}
-			}
-		}
-
-		private class SelectionChangedListener implements ISelectionChangedListener {
-			public void selectionChanged(SelectionChangedEvent event) {
-				if (!isFiringSelection()) {
-					fireSelectionChanged(event, listeners);
-				}
-			}
-		}
-
-		private boolean isFiringSelection = false;
-		private ListenerList listeners = new ListenerList();
-		private ListenerList postListeners = new ListenerList();
-		private ISelectionChangedListener postSelectionChangedListener = new PostSelectionChangedListener();
-		private ISelectionChangedListener selectionChangedListener = new SelectionChangedListener();
-
-		public void addPostSelectionChangedListener(ISelectionChangedListener listener) {
-			postListeners.add(listener);
-		}
-
-		public void addSelectionChangedListener(ISelectionChangedListener listener) {
-			listeners.add(listener);
-		}
-
-		public void fireSelectionChanged(final SelectionChangedEvent event, ListenerList listenerList) {
-			isFiringSelection = true;
-			Object[] listeners = listenerList.getListeners();
-			for (int i = 0; i < listeners.length; ++i) {
-				final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
-				Platform.run(new SafeRunnable() {
-					public void run() {
-						l.selectionChanged(event);
-					}
-				});
-			}
-			isFiringSelection = false;
-		}
-
-		public void fireSelectionChanged(final SelectionChangedEvent event) {
-			isFiringSelection = true;
-			Object[] listeners = postListeners.getListeners();
-			for (int i = 0; i < listeners.length; ++i) {
-				final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
-				Platform.run(new SafeRunnable() {
-					public void run() {
-						l.selectionChanged(event);
-					}
-				});
-			}
-			isFiringSelection = false;
-		}
-
-		public ISelectionChangedListener getPostSelectionChangedListener() {
-			return postSelectionChangedListener;
-		}
-
-		public ISelection getSelection() {
-			if (getTreeViewer() != null) {
-				return getTreeViewer().getSelection();
-			}
-			return StructuredSelection.EMPTY;
-		}
-
-		public ISelectionChangedListener getSelectionChangedListener() {
-			return selectionChangedListener;
-		}
-
-		public boolean isFiringSelection() {
-			return isFiringSelection;
-		}
-
-		public void removePostSelectionChangedListener(ISelectionChangedListener listener) {
-			postListeners.remove(listener);
-		}
-
-		public void removeSelectionChangedListener(ISelectionChangedListener listener) {
-			listeners.remove(listener);
-		};
-
-		public void setSelection(ISelection selection) {
-			if (isFiringSelection) {
-				getTreeViewer().setSelection(selection);
-			}
-		};
-	}
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditor.java
deleted file mode 100644
index c8ec401..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditor.java
+++ /dev/null
@@ -1,867 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal;
-
-import java.util.ArrayList;
-import java.util.EventObject;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.emf.common.command.BasicCommandStack;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStackListener;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.editors.text.ILocationProvider;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySheetPageContributor;
-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.events.IStructuredDocumentListener;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.contentoutline.ConfigurableContentOutlinePage;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphViewer;
-import org.eclipse.wst.xsd.ui.internal.properties.section.XSDTabbedPropertySheetPage;
-import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDAdapterFactoryLabelProvider;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDModelAdapterFactoryImpl;
-import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
-import org.eclipse.wst.xsd.ui.internal.util.OpenOnSelectionHelper;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-
-// public class XSDEditor extends StructuredTextMultiPageEditorPart
-public class XSDEditor extends XSDMultiPageEditorPart implements ITabbedPropertySheetPageContributor {
-	protected StructuredTextEditor textEditor;
-	IFile resourceFile;
-	XSDSelectionManager xsdSelectionManager;
-	XSDModelAdapter schemalNodeAdapter;
-
-	private IStructuredModel result;
-
-	/**
-	 * Listener on SSE's outline page's selections that converts DOM
-	 * selections into wsdl selections and notifies WSDL selection manager
-	 */
-	class OutlineTreeSelectionChangeListener implements ISelectionChangedListener, IDoubleClickListener {
-		public OutlineTreeSelectionChangeListener() {
-		}
-
-		private ISelection getXSDSelection(ISelection selection) {
-			ISelection sel = null;
-			if (selection instanceof IStructuredSelection) {
-				IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-				Object o = structuredSelection.getFirstElement();
-				if (o != null)
-					sel = new StructuredSelection(o);
-			}
-			return sel;
-		}
-
-		/**
-		 * Determines DOM node based on object (xsd node)
-		 * 
-		 * @param object
-		 * @return
-		 */
-		private Object getObjectForOtherModel(Object object) {
-			Node node = null;
-
-			if (object instanceof Node) {
-				node = (Node) object;
-			}
-			else if (object instanceof XSDComponent) {
-				node = ((XSDComponent) object).getElement();
-			}
-			else if (object instanceof CategoryAdapter) {
-				node = ((CategoryAdapter) object).getXSDSchema().getElement();
-			}
-
-			// the text editor can only accept sed nodes!
-			//
-			if (!(node instanceof IDOMNode)) {
-				node = null;
-			}
-			return node;
-		}
-
-		public void doubleClick(DoubleClickEvent event) {
-			/*
-			 * Selection in outline tree changed so set outline tree's
-			 * selection into editor's selection and say it came from outline
-			 * tree
-			 */
-			if (getSelectionManager() != null && getSelectionManager().enableNotify) {
-				ISelection selection = getXSDSelection(event.getSelection());
-				if (selection != null) {
-					getSelectionManager().setSelection(selection, fOutlinePage);
-				}
-
-				if (getTextEditor() != null && selection instanceof IStructuredSelection) {
-					int start = -1;
-					int length = 0;
-					Object o = ((IStructuredSelection) selection).getFirstElement();
-					if (o != null)
-						o = getObjectForOtherModel(o);
-					if (o instanceof IndexedRegion) {
-						start = ((IndexedRegion) o).getStartOffset();
-						length = ((IndexedRegion) o).getEndOffset() - start;
-					}
-					if (start > -1) {
-						getTextEditor().selectAndReveal(start, length);
-					}
-				}
-			}
-		}
-
-		public void selectionChanged(SelectionChangedEvent event) {
-			/*
-			 * Selection in outline tree changed so set outline tree's
-			 * selection into editor's selection and say it came from outline
-			 * tree
-			 */
-			if (getSelectionManager() != null) { // && getSelectionManager().enableNotify) {
-				
-				ISelection selection = getXSDSelection(event.getSelection());
-				if (selection != null) {
-					getSelectionManager().setSelection(selection, fOutlinePage);
-				}
-			}
-		}
-	}
-
-	/**
-	 * Listener on SSE's source editor's selections that converts DOM
-	 * selections into xsd selections and notifies XSD selection manager
-	 */
-	private class SourceEditorSelectionListener implements ISelectionChangedListener {
-		/**
-		 * Determines XSD node based on object (DOM node)
-		 * 
-		 * @param object
-		 * @return
-		 */
-		private Object getXSDNode(Object object) {
-			// get the element node
-			Element element = null;
-			if (object instanceof Node) {
-				Node node = (Node) object;
-				if (node != null) {
-					if (node.getNodeType() == Node.ELEMENT_NODE) {
-						element = (Element) node;
-					}
-					else if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
-						element = ((Attr) node).getOwnerElement();
-					}
-				}
-			}
-			Object o = element;
-			if (element != null) {
-				Object modelObject = getXSDSchema().getCorrespondingComponent(element);
-				if (modelObject != null) {
-					o = modelObject;
-				}
-			}
-			return o;
-		}
-
-		public void selectionChanged(SelectionChangedEvent event) {
-			ISelection selection = event.getSelection();
-			if (selection instanceof IStructuredSelection) {
-				List xsdSelections = new ArrayList();
-				for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();) {
-					Object domNode = i.next();
-					Object xsdNode = getXSDNode(domNode);
-					if (xsdNode != null) {
-						xsdSelections.add(xsdNode);
-					}
-				}
-
-				if (!xsdSelections.isEmpty()) {
-					StructuredSelection xsdSelection = new StructuredSelection(xsdSelections);
-					getSelectionManager().setSelection(xsdSelection, getTextEditor().getSelectionProvider());
-				}
-			}
-		}
-	}
-
-	/**
-	 * Listener on XSD's selection manager's selections that converts XSD
-	 * selections into DOM selections and notifies SSE's selection provider
-	 */
-	private class XSDSelectionManagerSelectionListener implements ISelectionChangedListener {
-		/**
-		 * Determines DOM node based on object (xsd node)
-		 * 
-		 * @param object
-		 * @return
-		 */
-		private Object getObjectForOtherModel(Object object) {
-			Node node = null;
-
-			if (object instanceof Node) {
-				node = (Node) object;
-			}
-			else if (object instanceof XSDComponent) {
-				node = ((XSDComponent) object).getElement();
-			}
-			else if (object instanceof CategoryAdapter) {
-				node = ((CategoryAdapter) object).getXSDSchema().getElement();
-			}
-
-			// the text editor can only accept sed nodes!
-			//
-			if (!(node instanceof IDOMNode)) {
-				node = null;
-			}
-			return node;
-		}
-
-		public void selectionChanged(SelectionChangedEvent event) {
-			// do not fire selection in source editor if selection event came
-			// from source editor
-			if (event.getSource() != getTextEditor().getSelectionProvider()) {
-				ISelection selection = event.getSelection();
-				if (selection instanceof IStructuredSelection) {
-					List otherModelObjectList = new ArrayList();
-					for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();) {
-						Object modelObject = i.next();
-						Object otherModelObject = getObjectForOtherModel(modelObject);
-						if (otherModelObject != null) {
-							otherModelObjectList.add(otherModelObject);
-						}
-					}
-					if (!otherModelObjectList.isEmpty()) {
-						StructuredSelection nodeSelection = new StructuredSelection(otherModelObjectList);
-						getTextEditor().getSelectionProvider().setSelection(nodeSelection);
-					}
-				}
-			}
-		}
-	}
-
-	public XSDEditor() {
-		super();
-		xsdSelectionManager = new XSDSelectionManager();
-	}
-
-	InternalPartListener partListener = new InternalPartListener(this);
-
-	// show outline view - defect 266116
-	public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
-		super.init(site, editorInput);
-		IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-		IWorkbenchPage page = dw.getActivePage();
-		getSite().getPage().addPartListener(partListener);
-		try {
-			if (page != null) {
-				// page.showView("org.eclipse.ui.views.ContentOutline");
-				page.showView("org.eclipse.ui.views.PropertySheet");
-			}
-		}
-		catch (PartInitException e) {
-			// e.printStackTrace();
-		}
-	}
-
-	// For team support
-	// protected PropertyDirtyChangeListener propertyChangeListener;
-
-	/**
-	 * Creates the pages of this multi-page editor.
-	 * <p>
-	 * Subclasses of <code>MultiPageEditor</code> must implement this
-	 * method.
-	 * </p>
-	 */
-	protected void createPages() {
-		try {
-			if (!loadFile())
-				return;
-
-			xsdModelAdapterFactory = XSDModelAdapterFactoryImpl.getInstance();
-			adapterFactoryLabelProvider = new XSDAdapterFactoryLabelProvider(xsdModelAdapterFactory);
-
-			// source page MUST be created before design page, now
-			createSourcePage();
-
-			addSourcePage();
-			buildXSDModel();
-
-			// comment this line out to hide the graph page
-			// 
-			createAndAddGraphPage();
-
-			int pageIndexToShow = getDefaultPageTypeIndex();
-			setActivePage(pageIndexToShow);
-
-			openOnSelectionHelper = new OpenOnSelectionHelper(textEditor, getXSDSchema());
-			// added selection listeners after setting selection to avoid
-			// navigation exception
-			ISelectionProvider provider = getTextEditor().getSelectionProvider();
-			fSourceEditorSelectionListener = new SourceEditorSelectionListener();
-			if (provider instanceof IPostSelectionProvider) {
-				((IPostSelectionProvider) provider).addPostSelectionChangedListener(fSourceEditorSelectionListener);
-			}
-			else {
-				provider.addSelectionChangedListener(fSourceEditorSelectionListener);
-			}
-			fXSDSelectionListener = new XSDSelectionManagerSelectionListener();
-			getSelectionManager().addSelectionChangedListener(fXSDSelectionListener);
-			
-			addCommandStackListener();
-
-			XSDEditorPlugin.getPlugin().getPreferenceStore().addPropertyChangeListener(preferenceStoreListener);
-		}
-		catch (PartInitException e) {
-			// log for now, unless we find reason not to
-			Logger.log(Logger.INFO, e.getMessage());
-		}
-	}
-
-
-	public void buildXSDModel() {
-		try {
-			Document document = ((IDOMModel) getModel()).getDocument();
-
-			boolean schemaNodeExists = document.getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "schema").getLength() == 1;
-
-			if (document.getChildNodes().getLength() == 0 || !schemaNodeExists) {
-				createDefaultSchemaNode(document);
-			}
-
-			if (document instanceof INodeNotifier) {
-				INodeNotifier notifier = (INodeNotifier) document;
-				schemalNodeAdapter = (XSDModelAdapter) notifier.getAdapterFor(XSDModelAdapter.class);
-				if (schemalNodeAdapter == null) {
-					schemalNodeAdapter = new XSDModelAdapter();
-					notifier.addAdapter(schemalNodeAdapter);
-					schemalNodeAdapter.createSchema(document.getDocumentElement());
-				}
-			}
-		}
-		catch (Exception e) {
-			// XSDEditorPlugin.getPlugin().getMsgLogger().write("Failed to
-			// create Model");
-			// XSDEditorPlugin.getPlugin().getMsgLogger().write(e);
-			// e.printStackTrace();
-		}
-
-
-
-		// XSDResourceFactoryImpl.validate(xsdSchema,
-		// input.getFile().getContents(true));
-	}
-
-	public String[] getPropertyCategories() {
-		return new String[]{"general", "namespace", "other", "attributes", "documentation", "facets"}; //$NON-NLS-1$
-	}
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySheetPageContributor#getContributorId()
-	 */
-	public String getContributorId() {
-		return "org.eclipse.wst.xsd.ui.internal.XSDEditor";
-		// return getSite().getId();
-	}
-
-	protected CommandStackListener commandStackListener;
-
-	protected void addCommandStackListener() {
-		if (commandStackListener == null) {
-			IStructuredTextUndoManager undoManager = getModel().getUndoManager();
-			commandStackListener = new CommandStackListener() {
-				/**
-				 * @see org.eclipse.emf.common.command.CommandStackListener#commandStackChanged(EventObject)
-				 */
-				public void commandStackChanged(EventObject event) {
-					Object obj = event.getSource();
-					if (obj instanceof BasicCommandStack) {
-						BasicCommandStack stack = (BasicCommandStack) obj;
-						Command recentCommand = stack.getMostRecentCommand();
-						Command redoCommand = stack.getRedoCommand();
-						Command undoCommand = stack.getUndoCommand();
-						if (recentCommand == redoCommand) {
-							// there must have been an undo reset info tasks
-							resetInformationTasks();
-						}
-					}
-				}
-			};
-
-			// TODO WTP Port
-			// undoManager.getCommandStack().addCommandStackListener(commandStackListener);
-
-		}
-	}
-
-	protected void pageChange(int arg) {
-		super.pageChange(arg);
-	}
-
-	protected void removeCommandStackListener() {
-		if (commandStackListener != null) {
-			IStructuredTextUndoManager undoManager = getModel().getUndoManager();
-			// TODO WTP Port
-			// undoManager.getCommandStack().removeCommandStackListener(commandStackListener);
-		}
-	}
-
-	// This is from the IValidateEditEditor interface
-	/*
-	 * public void undoChange() { StructuredTextUndoManager undoManager =
-	 * textEditor.getModel().getUndoManager(); undoManager.undo(); // Make the
-	 * editor clean textEditor.getModel().setDirtyState(false); }
-	 */
-
-	private class PreferenceStoreListener implements IPropertyChangeListener {
-		/**
-		 * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(PropertyChangeEvent)
-		 */
-		public void propertyChange(PropertyChangeEvent event) {
-		}
-	}
-
-	protected IPropertyChangeListener preferenceStoreListener = new PreferenceStoreListener();
-
-	protected int getDefaultPageTypeIndex() {
-		int pageIndex = sourcePageIndex;
-
-		if (XSDEditorPlugin.getPlugin().getDefaultPage().equals(XSDEditorPlugin.GRAPH_PAGE)) {
-			if (graphPageIndex != -1)
-				pageIndex = graphPageIndex;
-		}
-
-		return pageIndex;
-	}
-
-	int currentPage = -1;
-
-	public String getCurrentPageType() {
-		// should update pref. for valid pages
-		if (getActivePage() != -1) {
-			currentPage = getActivePage();
-		}
-		if (currentPage == graphPageIndex) {
-			return XSDEditorPlugin.GRAPH_PAGE;
-		}
-		else {
-			return XSDEditorPlugin.SOURCE_PAGE;
-		}
-	}
-
-	public Object getActivePart() {
-		return getSite().getWorkbenchWindow().getActivePage().getActivePart();
-	}
-
-	public void dispose() {
-		// some things in the configuration need to clean
-		// up after themselves
-		if (fOutlinePage != null) {
-			if (fOutlinePage instanceof ConfigurableContentOutlinePage && fOutlineListener != null) {
-				((ConfigurableContentOutlinePage) fOutlinePage).removeDoubleClickListener(fOutlineListener);
-			}
-			if (fOutlineListener != null) {
-				fOutlinePage.removeSelectionChangedListener(fOutlineListener);
-			}
-		}
-		ISelectionProvider provider = getTextEditor().getSelectionProvider();
-		if (provider instanceof IPostSelectionProvider) {
-			((IPostSelectionProvider) provider).removePostSelectionChangedListener(fSourceEditorSelectionListener);
-		}
-		else {
-			provider.removeSelectionChangedListener(fSourceEditorSelectionListener);
-		}
-		getSelectionManager().removeSelectionChangedListener(fXSDSelectionListener);
-		
-		// propertyChangeListener.dispose();
-		removeCommandStackListener();
-
-		XSDEditorPlugin.getPlugin().setDefaultPage(getCurrentPageType());
-		XSDEditorPlugin.getPlugin().getPreferenceStore().removePropertyChangeListener(preferenceStoreListener);
-
-		getSite().getPage().removePartListener(partListener);
-
-		// KB: Temporary solution for bug 99468
-		IStructuredModel myModel = textEditor.getModel();
-		if (myModel != null && myModel instanceof IStructuredDocumentListener)
-			myModel.getStructuredDocument().removeDocumentChangingListener((IStructuredDocumentListener) myModel);
-
-		textEditor = null;
-		resourceFile = null;
-		xsdSelectionManager = null;
-		schemalNodeAdapter = null;
-		result = null;
-		partListener = null;
-		commandStackListener = null;
-		preferenceStoreListener = null;
-		openOnSelectionHelper = null;
-		graphViewer = null;
-
-		super.dispose();
-
-		// release the schema model
-		//
-		if (schemalNodeAdapter != null) {
-			schemalNodeAdapter.clear();
-			schemalNodeAdapter = null;
-		}
-	}
-
-	protected boolean loadFile() {
-		Object input = getEditorInput();
-
-		if (input instanceof IFileEditorInput) {
-			resourceFile = ((IFileEditorInput) input).getFile();
-		}
-		else if (input instanceof ILocationProvider) {
-			IPath path = ((ILocationProvider) input).getPath(input);
-			String ext = path.getFileExtension();
-			if (ext != null && ext.equals("xsd")) {
-				return true;
-			}
-			return false;
-		}
-		else {
-			return false;
-		}
-		return true;
-	}
-
-	/**
-	 * Method openOnGlobalReference. The comp argument is a resolved xsd
-	 * schema object from another file. This is created and called from
-	 * another schema model to allow F3 navigation to open a new editor and
-	 * choose the referenced object within that editor context
-	 * 
-	 * @param comp
-	 */
-	public void openOnGlobalReference(XSDConcreteComponent comp) {
-		openOnSelectionHelper.openOnGlobalReference(comp);
-	}
-
-	protected OpenOnSelectionHelper openOnSelectionHelper;
-
-	public OpenOnSelectionHelper getOpenOnSelectionHelper() {
-		return openOnSelectionHelper;
-	}
-
-	/**
-	 * @see org.eclipse.wst.xsd.ui.internal.XSDMultiPageEditorPart#createTextEditor()
-	 */
-	protected StructuredTextEditor createTextEditor() {
-		textEditor = new StructuredTextEditor();
-		return textEditor;
-	}
-
-	/*
-	 * @see StructuredTextMultiPageEditorPart#createSourcePage()
-	 */
-	protected void createSourcePage() throws PartInitException {
-		super.createSourcePage();
-	}
-
-	int sourcePageIndex = -1;
-
-	/**
-	 * Adds the source page of the multi-page editor.
-	 */
-	protected void addSourcePage() throws PartInitException {
-
-		sourcePageIndex = addPage(textEditor, getEditorInput());
-		setPageText(sourcePageIndex, XSDEditorPlugin.getXSDString("_UI_TAB_SOURCE"));
-
-		// the update's critical, to get viewer selection manager and
-		// highlighting to work
-		textEditor.update();
-		firePropertyChange(PROP_TITLE);
-	}
-
-	int graphPageIndex = -1;
-	XSDGraphViewer graphViewer;
-
-	/**
-	 * Creates the graph page and adds it to the multi-page editor.
-	 */
-	protected void createAndAddGraphPage() throws PartInitException {
-		graphViewer = new XSDGraphViewer(this);
-		graphViewer.setSchema(getXSDSchema());
-		Control graphControl = graphViewer.createControl(getContainer());
-		graphPageIndex = addPage(graphControl);
-		setPageText(graphPageIndex, XSDEditorPlugin.getXSDString("_UI_TAB_GRAPH"));
-
-		// graphViewer.setViewerSelectionManager(textEditor.getViewerSelectionManager());
-		graphViewer.setSelectionManager(getSelectionManager());
-
-		// this forces the editor to initially select the top level schema
-		// object
-		//
-		if (getXSDSchema() != null) {
-			getSelectionManager().setSelection(new StructuredSelection(getXSDSchema()));
-		}
-	}
-
-	protected XSDModelAdapterFactoryImpl xsdModelAdapterFactory;
-	protected XSDAdapterFactoryLabelProvider adapterFactoryLabelProvider;
-	private IPropertySheetPage fPropertySheetPage;
-	private IContentOutlinePage fOutlinePage;
-	private OutlineTreeSelectionChangeListener fOutlineListener;
-	private SourceEditorSelectionListener fSourceEditorSelectionListener;
-	private XSDSelectionManagerSelectionListener fXSDSelectionListener;
-
-	/*
-	 * @see IAdaptable#getAdapter(Class)
-	 */
-	public Object getAdapter(Class key) {
-		Object result = null;
-		if (key == ISelectionProvider.class) {
-			result = xsdSelectionManager;
-		}
-		if (IPropertySheetPage.class.equals(key)) {
-			fPropertySheetPage = new XSDTabbedPropertySheetPage(this);
-
-			((XSDTabbedPropertySheetPage) fPropertySheetPage).setXSDModelAdapterFactory(xsdModelAdapterFactory);
-			((XSDTabbedPropertySheetPage) fPropertySheetPage).setSelectionManager(getSelectionManager());
-			((XSDTabbedPropertySheetPage) fPropertySheetPage).setXSDSchema(getXSDSchema());
-
-			return fPropertySheetPage;
-		}
-		else if (IContentOutlinePage.class.equals(key)) {
-			if (fOutlinePage == null || fOutlinePage.getControl() == null || fOutlinePage.getControl().isDisposed()) {
-				IContentOutlinePage page = (IContentOutlinePage) super.getAdapter(key);
-				if (page != null) {
-					fOutlineListener = new OutlineTreeSelectionChangeListener();
-					page.addSelectionChangedListener(fOutlineListener);
-					if (page instanceof ConfigurableContentOutlinePage) {
-						((ConfigurableContentOutlinePage) page).addDoubleClickListener(fOutlineListener);
-					}
-				}
-				fOutlinePage = page;
-				// XSDContentOutlinePage outlinePage = new
-				// XSDContentOutlinePage(this);
-				// XSDContentProvider xsdContentProvider = new
-				// XSDContentProvider(xsdModelAdapterFactory);
-				// xsdContentProvider.setXSDSchema(getXSDSchema());
-				// outlinePage.setContentProvider(xsdContentProvider);
-				// outlinePage.setLabelProvider(adapterFactoryLabelProvider);
-				// outlinePage.setModel(getXSDSchema().getDocument());
-				//
-				// fOutlinePage = outlinePage;
-			}
-			return fOutlinePage;
-		}
-		else {
-			result = super.getAdapter(key);
-		}
-		return result;
-	}
-
-
-	public XSDModelAdapterFactoryImpl getXSDModelAdapterFactory() {
-		return xsdModelAdapterFactory;
-	}
-
-	public XSDAdapterFactoryLabelProvider getLabelProvider() {
-		return adapterFactoryLabelProvider;
-	}
-
-
-	public XSDSelectionManager getSelectionManager() {
-		return xsdSelectionManager;
-	}
-
-	/**
-	 * @see org.eclipse.wst.xsd.ui.internal.XSDMultiPageEditorPart#doSaveAs()
-	 */
-	public void doSaveAs() {
-		super.doSaveAs();
-	}
-
-	public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor) {
-		super.doSave(monitor);
-	}
-
-	public void reparseSchema() {
-		// TODO cs : Are there no better ways to make the model
-		// reload it's dependencies? This seems rather extreme.
-		//
-		Document document = ((IDOMModel) getModel()).getDocument();
-		if (schemalNodeAdapter != null) {
-			schemalNodeAdapter.createSchema(document.getDocumentElement());
-		}
-	}
-
-	/**
-	 * Returns the xsdSchema.
-	 * 
-	 * @return XSDSchema
-	 */
-	public XSDSchema getXSDSchema() {
-		return schemalNodeAdapter != null ? schemalNodeAdapter.getSchema() : null;
-	}
-
-
-	/**
-	 * Returns the resourceFile.
-	 * 
-	 * @return IFile
-	 */
-	public IFile getFileResource() {
-		return resourceFile;
-	}
-
-	/**
-	 * Get the IDocument from the text viewer
-	 */
-	public IDocument getEditorIDocument() {
-		IDocument document = textEditor.getTextViewer().getDocument();
-		return document;
-	}
-
-	/**
-	 * Create ref integrity tasks in task list
-	 */
-	public void createTasksInTaskList(ArrayList messages) {
-		// DisplayErrorInTaskList tasks = new
-		// DisplayErrorInTaskList(getEditorIDocument(), getFileResource(),
-		// messages);
-		// tasks.run();
-	}
-
-	public void resetInformationTasks() {
-		// DisplayErrorInTaskList.removeInfoMarkers(getFileResource());
-	}
-
-	public XSDGraphViewer getGraphViewer() {
-		return graphViewer;
-	}
-
-	public IEditorPart getActiveEditorPage() {
-		return getActiveEditor();
-	}
-
-	public StructuredTextEditor getTextEditor() {
-		return textEditor;
-	}
-
-	class InternalPartListener implements IPartListener {
-		XSDEditor editor;
-
-		public InternalPartListener(XSDEditor editor) {
-			this.editor = editor;
-		}
-
-		public void partActivated(IWorkbenchPart part) {
-			if (part == editor) {
-				ISelection selection = getSelectionManager().getSelection();
-				if (selection != null) {
-					if (getCurrentPageType().equals(XSDEditorPlugin.GRAPH_PAGE)) {
-						getSelectionManager().selectionChanged(new SelectionChangedEvent(editor.getGraphViewer().getComponentViewer(), selection));
-					}
-					else if (getCurrentPageType().equals(XSDEditorPlugin.SOURCE_PAGE)) {
-						getSelectionManager().setSelection(selection);
-					}
-				}
-			}
-		}
-
-		public void partBroughtToTop(IWorkbenchPart part) {
-		}
-
-		public void partClosed(IWorkbenchPart part) {
-		}
-
-		public void partDeactivated(IWorkbenchPart part) {
-		}
-
-		public void partOpened(IWorkbenchPart part) {
-		}
-	}
-
-
-	/**
-	 * Method createDefaultSchemaNode. Should only be called to insert a
-	 * schema node into an empty document
-	 */
-	public void createDefaultSchemaNode(Document document) {
-		if (document.getChildNodes().getLength() == 0) {
-			// if it is a completely empty file, then add the encoding and
-			// version processing instruction
-			// TODO String encoding = EncodingHelper.getDefaultEncodingTag();
-			String encoding = "UTF-8";
-			ProcessingInstruction instr = document.createProcessingInstruction("xml", "version=\"1.0\" encoding=\"" + encoding + "\"");
-			document.appendChild(instr);
-		}
-
-		// Create a default schema tag now
-
-		// String defaultPrefixForTargetNamespace =
-		// getFileResource().getProjectRelativePath().removeFileExtension().lastSegment();
-		String defaultPrefixForTargetNamespace = "tns";
-		String prefixForSchemaNamespace = "";
-		String schemaNamespaceAttribute = "xmlns";
-		if (XSDEditorPlugin.getPlugin().isQualifyXMLSchemaLanguage()) {
-			// Added this if check before disallowing blank prefixes in the
-			// preferences...
-			// Can take this out. See also NewXSDWizard
-			if (XSDEditorPlugin.getPlugin().getXMLSchemaPrefix().trim().length() > 0) {
-				prefixForSchemaNamespace = XSDEditorPlugin.getPlugin().getXMLSchemaPrefix() + ":";
-				schemaNamespaceAttribute += ":" + XSDEditorPlugin.getPlugin().getXMLSchemaPrefix();
-			}
-		}
-
-		document.appendChild(document.createTextNode("\n"));
-		Element element = document.createElement(prefixForSchemaNamespace + XSDConstants.SCHEMA_ELEMENT_TAG);
-
-		element.setAttribute(schemaNamespaceAttribute, "http://www.w3.org/2001/XMLSchema");
-
-		String defaultTargetURI = XSDEditorPlugin.getPlugin().getXMLSchemaTargetNamespace();
-		element.setAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE, defaultTargetURI);
-		element.setAttribute("xmlns:" + defaultPrefixForTargetNamespace, defaultTargetURI);
-
-		document.appendChild(element);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorAdapter.java
deleted file mode 100644
index 7591376..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorAdapter.java
+++ /dev/null
@@ -1,27 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocument;
-
-public interface XSDEditorAdapter
-{
-  public IFile getFileResource();
-
-  public IDocument getEditorIDocument();
-
-  public void createTasksInTaskList(ArrayList messages);
-
-  public void resetInformationTasks();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorContextIds.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorContextIds.java
deleted file mode 100644
index 8f95f5c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorContextIds.java
+++ /dev/null
@@ -1,460 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal;
-
-/**
- * Context help id constants.
- */
-public interface XSDEditorContextIds 
-{
-  public static final String PLUGIN_NAME = "org.eclipse.wst.xsd.ui.internal";
-
-  /* CONTEXT_IDs New XSD Wizard uses the WizardNewFileCreationPage from org.eclipse.ui.dialogs */
- 
-  /* CONTEXT_IDs for XSDEditor follow the xsdexxx context IDs */
-
-  /* CONTEXT_ID xsde0010 for XSD Editor Design View */
-  public static final String XSDE_SCHEMA_DESIGN_VIEW      = PLUGIN_NAME + ".xsde0010";
-  /* no CONTEXT_ID for File Name Text Edit (not editable) */
-  /* CONTEXT_ID xsde0020 for Version Text Edit */
-  public static final String XSDE_SCHEMA_VERSION          = PLUGIN_NAME + ".xsde0020";
-  /* CONTEXT_ID xsde0030 for Language Text Edit */
-  public static final String XSDE_SCHEMA_LANGUAGE         = PLUGIN_NAME + ".xsde0030";
-  /* CONTEXT_ID xsde0040 for Namespace Group */
-  public static final String XSDE_SCHEMA_NAMESPACE_GROUP  = PLUGIN_NAME + ".xsde0040";
-  /* CONTEXT_ID xsde0050 for Prefix Text Edit */
-  public static final String XSDE_SCHEMA_PREFIX           = PLUGIN_NAME + ".xsde0050";
-  /* CONTEXT_ID xsde0060 for Target namespace Text Edit */
-  public static final String XSDE_SCHEMA_TARGET_NAMESPACE = PLUGIN_NAME + ".xsde0060";
-  /* CONTEXT_ID xsde0070 for Apply Push Button */
-  public static final String XSDE_SCHEMA_APPLY            = PLUGIN_NAME + ".xsde0070";
-  /* CONTEXT_ID xsde0080 for Attribute form default Combo Box */
-  public static final String XSDE_SCHEMA_ATTRIBUTE        = PLUGIN_NAME + ".xsde0080";
-  /* CONTEXT_ID xsde0090 for Element form default Combo Box */
-  public static final String XSDE_SCHEMA_ELEMENT          = PLUGIN_NAME + ".xsde0090";
-  /* CONTEXT_ID xsde0100 for Block default Combo Box */
-  public static final String XSDE_SCHEMA_BLOCK            = PLUGIN_NAME + ".xsde0100";
-  /* CONTEXT_ID xsde0110 for Final Default Combo Box */
-  public static final String XSDE_SCHEMA_FINAL            = PLUGIN_NAME + ".xsde0110";
-
-  
-  /* CONTEXT_ID xsde0200 for Annotations Comment Group - only used generically */
-  /* CONTEXT_ID      - used in Documentation Design View */
-  /* CONTEXT_ID      - used in App Info Design View */
-  public static final String XSDE_ANNOTATION_COMMENT_GROUP = PLUGIN_NAME + ".xsde0200";
-  /* CONTEXT_ID xsde0210 for Annotations Comment Group - only used generically */
-  /* CONTEXT_ID      - used in Documentation Design View */
-  /* CONTEXT_ID      - used in App Info Design View */
-  public static final String XSDE_ANNOTATION_COMMENT       = PLUGIN_NAME + ".xsde0210";
-  
-  /* CONTEXT_ID xsde0300 for Documentation Design View */
-  public static final String XSDE_DOCUMENTATION_DESIGN_VIEW   = PLUGIN_NAME + ".xsde0300";
-  /* CONTEXT_ID xsde0310 for Source Text Edit */
-  public static final String XSDE_DOCUMENTATION_SOURCE        = PLUGIN_NAME + ".xsde0310";
-  /* CONTEXT_ID xsde0320 for Language Text Edit */
-  public static final String XSDE_DOCUMENTATION_LANGUAGE      = PLUGIN_NAME + ".xsde0320";
-  /* CONTEXT_ID Comment Group is from Annotations Window xsde0200 */
-  /* CONTEXT_ID Comment Multi-line Edit is from Annotations Window xsd0210 */
-
-  /* CONTEXT_ID xsde0400 for App Info Design View */
-  public static final String XSDE_APP_INFO_DESIGN_VIEW = PLUGIN_NAME + ".xsde0400";
-  /* CONTEXT_ID xsde0410 for App Info Source Text Edit */
-  public static final String XSDE_APP_INFO_SOURCE = PLUGIN_NAME + ".xsde0410";
-  /* CONTEXT_ID Comment Group is from Annotations Window xsde0200 */
-  /* CONTEXT_ID Comment Multi-line Edit is from Annotations Window xsd0210 */
-
-  /* CONTEXT_ID xsde0500 for Complex Type Design View */
-  public static final String XSDE_COMPLEX_DESIGN_VIEW = PLUGIN_NAME + ".xsde0500";
-  /* CONTEXT_ID xsde0510 for Name Text Edit */
-  public static final String XSDE_COMPLEX_NAME        = PLUGIN_NAME + ".xsde0510";
-  /* CONTEXT_ID xsde0520 for Abstract Combo Box */
-  public static final String XSDE_COMPLEX_ABSTRACT    = PLUGIN_NAME + ".xsde0520";
-  /* CONTEXT_ID xsde0530 for Mixed Combo Box */
-  public static final String XSDE_COMPLEX_MIXED       = PLUGIN_NAME + ".xsde0530";
-  /* CONTEXT_ID xsde0540 for Block Combo Box */
-  public static final String XSDE_COMPLEX_BLOCK       = PLUGIN_NAME + ".xsde0540";
-  /* CONTEXT_ID xsde0550 for Final Combo Box */
-  public static final String XSDE_COMPLEX_FINAL       = PLUGIN_NAME + ".xsde0550";
-
-  /* CONTEXT_ID xsde0600 for Simple Type Design View */
-  public static final String XSDE_SIMPLE_DESIGN_VIEW = PLUGIN_NAME + ".xsde0600";
-  /* CONTEXT_ID xsde0610 for Name Text Edit */
-  public static final String XSDE_SIMPLE_NAME        = PLUGIN_NAME + ".xsde0610";
-
-  /* CONTEXT_ID for Global Element and Element Design Views are the same */
-  /* CONTEXT_ID xsde0700 for Element Design View */
-  public static final String XSDE_ELEMENT_DESIGN_VIEW = PLUGIN_NAME + ".xsde0700";
-  /* CONTEXT_ID xsde0710 for Element Name Text Edit */
-  public static final String XSDE_ELEMENT_NAME         = PLUGIN_NAME + ".xsde0710";
-  /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
-  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
-  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
-  /* CONTEXT_ID User-defined complex type Radio Button is from Type Helper xsde0940 */
-  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-  /* CONTEXT_ID xsde0720 for Abstract Check Box */
-  public static final String XSDE_ELEMENT_ABSTRACT     = PLUGIN_NAME + ".xsde0720";
-  /* CONTEXT_ID xsde0730 for Nillable Check Box */
-  public static final String XSDE_ELEMENT_NILLABLE     = PLUGIN_NAME + ".xsde0730";
-  /* CONTEXT_ID xsde0740 for Value Group */
-  public static final String XSDE_ELEMENT_VALUE        = PLUGIN_NAME + ".xsde0740";
-  /* CONTEXT_ID xsde0750 for Fixed Radio Button */
-  public static final String XSDE_ELEMENT_FIXED        = PLUGIN_NAME + ".xsde0750";
-  /* CONTEXT_ID xsde0760 for Default Radio Button */
-  public static final String XSDE_ELEMENT_DEFAULT      = PLUGIN_NAME + ".xsde0760";
-  /* CONTEXT_ID xsde0770 for Value Group */
-  public static final String XSDE_ELEMENT_VALUE_GROUP  = PLUGIN_NAME + ".xsde0770";
-  /* CONTEXT_ID xsde0780 for Minimum Text Edit */
-  public static final String XSDE_ELEMENT_MINIMUM      = PLUGIN_NAME + ".xsde0780";
-  /* CONTEXT_ID xsde0790 for Maximum Text Edit */
-  public static final String XSDE_ELEMENT_MAXIMUM      = PLUGIN_NAME + ".xsde0790";
-  /* CONTEXT_ID xsde0800 for Block Combo Box */
-  public static final String XSDE_ELEMENT_BLOCK        = PLUGIN_NAME + ".xsde0800";
-  /* CONTEXT_ID xsde0810 for Final Combo Box */
-  public static final String XSDE_ELEMENT_FINAL        = PLUGIN_NAME + ".xsde0810";
-  /* CONTEXT_ID xsde0820 for Substitution Group Combo Box */
-  public static final String XSDE_ELEMENT_SUBSTITUTION = PLUGIN_NAME + ".xsde0820";
-  /* CONTEXT_ID xsde0830 for Form Qualification Combo Box */                    
-  public static final String XSDE_ELEMENT_FORM         = PLUGIN_NAME + ".xsde0830";
-
-  /* CONTEXT_ID xsde0900 for Type Helper Group - only used generically */
-  /* CONTEXT_ID      - used in Global Element Design View */
-  /* CONTEXT_ID      - used in Global Attribute Design View */
-  /* CONTEXT_ID      - used in Simple Content Design View */
-  /* CONTEXT_ID      - used in Restriction Design View */
-  /* CONTEXT_ID      - used in List Design View */
-  /* CONTEXT_ID      - used in Union Design View */
-  public static final String XSDE_TYPE_HELPER_GROUP    = PLUGIN_NAME + ".xsde0900";
-  /* CONTEXT_ID xsde0910 for None Radio Button - only used generically */
-  /* CONTEXT_ID      - used in Simple Content Design View */
-  /* CONTEXT_ID      - used in Restriction Design View */
-  /* CONTEXT_ID      - used in List Design View */
-  /* CONTEXT_ID      - used in Union Design View */
-  public static final String XSDE_TYPE_HELPER_NONE     = PLUGIN_NAME + ".xsde0910";
-  /* CONTEXT_ID xsde0920 for Built-in simple type Radio Button - only used generically */
-  /* CONTEXT_ID      - used in Global Element Design View */
-  /* CONTEXT_ID      - used in Global Attribute Design View */
-  /* CONTEXT_ID      - used in Simple Content Design View */
-  /* CONTEXT_ID      - used in Restriction Design View */
-  /* CONTEXT_ID      - used in List Design View */
-  /* CONTEXT_ID      - used in Union Design View */
-  public static final String XSDE_TYPE_HELPER_BUILT_IN = PLUGIN_NAME + ".xsde0920";
-  /* CONTEXT_ID xsde0930 for User-defined simple type Radio Button - only used generically */
-  /* CONTEXT_ID      - used in Global Element Design View */
-  /* CONTEXT_ID      - used in Global Attribute Design View */
-  /* CONTEXT_ID      - used in Simple Content Design View */
-  /* CONTEXT_ID      - used in Restriction Design View */
-  /* CONTEXT_ID      - used in List Design View */
-  /* CONTEXT_ID      - used in Union Design View */
-  public static final String XSDE_TYPE_HELPER_USER_DEFINED_SIMPLE = PLUGIN_NAME + ".xsde0930";
-  /* CONTEXT_ID xsde0940 for User-defined complex type Radio Button - only used generically */
-  /* CONTEXT_ID      - used in Global Element Design View */
-  public static final String XSDE_TYPE_HELPER_USER_DEFINED_COMPLEX = PLUGIN_NAME + ".xsde0940";
-  /* CONTEXT_ID xsde0950 for Type information Combo Box - only used generically */
-  /* CONTEXT_ID      - used in Global Element Design View */
-  /* CONTEXT_ID      - used in Global Attribute Design View */
-  /* CONTEXT_ID      - used in Simple Content Design View */
-  /* CONTEXT_ID      - used in Restriction Design View */
-  /* CONTEXT_ID      - used in List Design View */
-  public static final String XSDE_TYPE_HELPER_TYPE = PLUGIN_NAME + ".xsde0950";
-
-  /* CONTEXT_ID xsde1000 for Attribute Design View */
-  public static final String XSDE_ATTRIBUTE_DESIGN_VIEW = PLUGIN_NAME + ".xsde1000";
-  /* CONTEXT_ID xsde1010 for Attribute Name Text Edit */
-  public static final String XSDE_ATTRIBUTE_NAME        = PLUGIN_NAME + ".xsde1010";
-  /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
-  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
-  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
-  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-  /* CONTEXT_ID xsde1020 for Value Group */
-  public static final String XSDE_ATTRIBUTE_VALUE_GROUP = PLUGIN_NAME + ".xsde1020";
-  /* CONTEXT_ID xsde1030 for Fixed Radio Button */
-  public static final String XSDE_ATTRIBUTE_FIXED       = PLUGIN_NAME + ".xsde1030";
-  /* CONTEXT_ID xsde1040 for Default Radio Button */
-  public static final String XSDE_ATTRIBUTE_DEFAULT     = PLUGIN_NAME + ".xsde1040";
-  /* CONTEXT_ID xsde1050 for Value Text Edit */
-  public static final String XSDE_ATTRIBUTE_VALUE       = PLUGIN_NAME + ".xsde1050";
-  /* CONTEXT_ID xsde1060 for Usage Combo Box */
-  public static final String XSDE_ATTRIBUTE_USAGE       = PLUGIN_NAME + ".xsde1060";
-  /* CONTEXT_ID xsde1070 for Form qualificaiton Combo Box */
-  public static final String XSDE_ATTRIBUTE_FORM        = PLUGIN_NAME + ".xsde1070";
-
-  /* CONTEXT_ID xsde1100 for Element Ref Window Design View */
-  public static final String XSDE_ELEMENT_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1100";
-  /* CONTEXT_ID xsde1110 for Reference Name Combo Box */
-  public static final String XSDE_ELEMENT_REF_REFERENCE   = PLUGIN_NAME + ".xsde1110";
-  /* CONTEXT_ID xsde1120 for Minimum Text Edit */
-  public static final String XSDE_ELEMENT_REF_MINIMUM     = PLUGIN_NAME + ".xsde1120";
-  /* CONTEXT_ID xsde1130 for Maximum Text Edit */
-  public static final String XSDE_ELEMENT_REF_MAXIMUM     = PLUGIN_NAME + ".xsde1130";
-  
-  /* CONTEXT_ID xsde1200 for Simple Content Design View - used generically */
-  /* CONTEXT_ID      - used in Simple Content Design View */ 
-  /* CONTEXT_ID      - used in Complex Content Design View */
-    public static final String XSDE_SIMPLE_CONTENT_DESIGN_VIEW = PLUGIN_NAME + ".xsde1200";
-  /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
-  /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
-  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
-  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
-  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-  /* CONTEXT_ID xsde1210 for Derived by Combo Box - used generically */
-  /* CONTEXT_ID      - used in Simple Content Design View */ 
-  /* CONTEXT_ID      - used in Complex Content Design View */
-  public static final String XSDE_SIMPLE_CONTENT_DERIVED = PLUGIN_NAME + ".xsde1210";
-
-  /* CONTEXT_ID xsde1300 for Restriction Design View */
-  public static final String XSDE_RESTRICTION_DESIGN_VIEW  = PLUGIN_NAME + ".xsde1300";
-  /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
-  /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
-  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
-  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
-  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-  /* CONTEXT_ID xsde1310 for Facets Group */
-  public static final String XSDE_RESTRICTION_FACETS_GROUP = PLUGIN_NAME + ".xsde1310";
-  /* CONTEXT_ID xsde1320 for Facets Table */
-  public static final String XSDE_RESTRICTION_FACETS       = PLUGIN_NAME + ".xsde1320";
-
-  /* CONTEXT_ID xsde1400 for List Design View */
-  public static final String XSDE_LIST_DESIGN_VIEW  = PLUGIN_NAME + ".xsde1400";
-  /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
-  /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
-  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
-  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
-  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-
-  /* CONTEXT_ID xsde1500 for Attribute Group Design View */
-  public static final String XSDE_ATTRIBUTE_GROUP_DESIGN_VIEW = PLUGIN_NAME + ".xsde1500";
-  /* CONTEXT_ID xsde1510 for Name Text Edit */
-  public static final String XSDE_ATTRIBUTE_GROUP_NAME = PLUGIN_NAME + ".xsde1510";
-
-  /* CONTEXT_ID for Global Attribute and Attribute Design Views are the same */
-  /* CONTEXT_ID xsde1600 for Attribute Group Reference Design View */
-  public static final String XSDE_ATTRIBUTE_GROUP_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1600";
-  /* CONTEXT_ID xsde1610 for Reference Name Combo Box */
-  public static final String XSDE_ATTRIBUTE_GROUP_REF_NAME = PLUGIN_NAME + ".xsde1610";
-
-  /* CONTEXT_ID xsde1700 for Attribute Reference Design View */
-  public static final String XSDE_ATTRIBUTE_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1700";
-  /* CONTEXT_ID xsde1710 for Reference Name Combo Box */
-  public static final String XSDE_ATTRIBUTE_REF_NAME = PLUGIN_NAME + ".xsde1710";
-
-  /* CONTEXT_ID xsde1800 for Pattern Design View */
-  public static final String XSDE_PATTERN_DESIGN_VIEW = PLUGIN_NAME + ".xsde1800";
-  /* CONTEXT_ID xsde1810 for Value Text Edit */
-  public static final String XSDE_PATTERN_VALUE   = PLUGIN_NAME + ".xsde1810";
-  /* CONTEXT_ID xsde1820 for Create Regular Expression Push Button */
-  public static final String XSDE_PATTERN_REGULAR = PLUGIN_NAME + ".xsde1820";
-
-  /* CONTEXT_ID xsde1900 for Enum Design View */
-  public static final String XSDE_ENUM_DESIGN_VIEW = PLUGIN_NAME + ".xsde1900";
-  /* CONTEXT_ID xsde1910 for Value Text Edit */
-  public static final String XSDE_ENUM_VALUE       = PLUGIN_NAME + ".xsde1910";
-  
-  /* CONTEXT_ID xsde2000 for Include Design Page */
-  public static final String XSDE_INCLUDE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2000";
-  /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
-  /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */ 
-  
-  /* CONTEXT_ID xsde2100 for Include Helper Select Push Button - used generically */
-  /* CONTEXT_ID      - used in Include Design View */
-  /* CONTEXT_ID      - used in Import Design View */
-  public static final String XSDE_INCLUDE_HELPER_SELECT = PLUGIN_NAME + ".xsde2100";
-
-  /* CONTEXT_ID xsde2200 for Import Design Page */
-  public static final String XSDE_IMPORT_DESIGN_VIEW = PLUGIN_NAME + ".xsde2200";
-  /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
-  /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */
-  /* CONTEXT_ID xsde2210 for Prefix Text Edit */
-  public static final String XSDE_IMPORT_PREFIX      = PLUGIN_NAME + ".xsde2210";
-  /* no CONTEXT_ID for Namespace Text Edit (not editable) */
-
-  /* CONTEXT_ID xsde2300 for Redefine Design View */
-  public static final String XSDE_REDEFINE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2300";
-  /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
-  /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */
-
-  /* CONTEXT_ID xsde2400 for Group Design View */
-  public static final String XSDE_GROUP_DESIGN_VIEW = PLUGIN_NAME + ".xsde2400";
-  /* CONTEXT_ID xsde2410 for Name Text Edit */
-  public static final String XSDE_GROUP_NAME        = PLUGIN_NAME + ".xsde2410";
-
-  /* CONTEXT_ID xsde2500 for Group Scope Design View */
-  public static final String XSDE_GROUP_SCOPE_DESIGN_VIEW   = PLUGIN_NAME + ".xsde2500";
-  /* CONTEXT_ID xsde2510 for Content model Group */
-  public static final String XSDE_GROUP_SCOPE_CONTENT_GROUP = PLUGIN_NAME + ".xsde2510";
-  /* CONTEXT_ID xsde2520 for Sequence Radio Button */
-  public static final String XSDE_GROUP_SCOPE_SEQUENCE = PLUGIN_NAME + ".xsde2520";
-  /* CONTEXT_ID xsde2530 for Choice Radio Button */
-  public static final String XSDE_GROUP_SCOPE_CHOICE   = PLUGIN_NAME + ".xsde2530";
-  /* CONTEXT_ID xsde2540 for All Radio Button */
-  public static final String XSDE_GROUP_SCOPE_ALL      = PLUGIN_NAME + ".xsde2540";
-  /* CONTEXT_ID xsde2550 for Minimum Text Edit */
-  public static final String XSDE_GROUP_SCOPE_MINIMUM  = PLUGIN_NAME + ".xsde2550";
-  /* CONTEXT_ID xsde2560 for Maximum Text Edit*/
-  public static final String XSDE_GROUP_SCOPE_MAXIMUM  = PLUGIN_NAME + ".xsde2560";
-
-  /* CONTEXT_ID xsde2600 for Group Ref Design View */
-  public static final String XSDE_GROUP_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde2600";
-  /* CONTEXT_ID xsde2610 for Reference name Combo Box */
-  public static final String XSDE_GROUP_REF_REFERENCE   = PLUGIN_NAME + ".xsde2610";
-  /* CONTEXT_ID xsde2620 for Minimum Text Edit */
-  public static final String XSDE_GROUP_REF_MINIMUM     = PLUGIN_NAME + ".xsde2620";
-  /* CONTEXT_ID xsde2630 for Maximum Text Edit */
-  public static final String XSDE_GROUP_REF_MAXIMUM     = PLUGIN_NAME + ".xsde2630";
-
-  /* CONTEXT_ID xsde2700 for Unique Design View */
-  public static final String XSDE_UNIQUE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2700";
-  /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
-  /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
-  /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
-  /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
-  /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
-  /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
-  /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
-  /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
-  
-  /* CONTEXT_ID xsde2800 for Unique Base Name Text Edit - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_NAME = PLUGIN_NAME + ".xsde2800";
-  /* CONTEXT_ID xsde2810 for Selector Group - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_SELECTOR_GROUP = PLUGIN_NAME + ".xsde2810";
-  /* CONTEXT_ID xsde2820 for Selector Multi-line Edit - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_SELECTOR       = PLUGIN_NAME + ".xsde2820";
-  /* CONTEXT_ID xsde2830 for Fields Group - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_FIELDS_GROUP   = PLUGIN_NAME + ".xsde2830";
-  /* CONTEXT_ID xsde2840 for Source Text Edit - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_SOURCE         = PLUGIN_NAME + ".xsde2840";
-  /* CONTEXT_ID xsde2850 for Add Push Button - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_ADD            = PLUGIN_NAME + ".xsde2850";
-  /* CONTEXT_ID xsde2860 for Remove Push Button - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_REMOVE         = PLUGIN_NAME + ".xsde2860";
-  /* CONTEXT_ID xsde2870 for Target List Box - used generically */
-  /* CONTEXT_ID      - used in Unique Design View */
-  /* CONTEXT_ID      - used in Key Design View */
-  /* CONTEXT_ID      - used in Key Ref Design View */
-  public static final String XSDE_UNIQUE_BASE_TARGET         = PLUGIN_NAME + ".xsde2870";
-
-  /* CONTEXT_ID xsde2900 for Key Design View */
-  public static final String XSDE_KEY_DESIGN_VIEW = PLUGIN_NAME + ".xsde2900";
-  /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
-  /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
-  /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
-  /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
-  /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
-  /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
-  /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
-  /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
-  /* CONTEXT_ID xsde2900 for Key Design View */
-  
-  /* CONTEXT_ID xsde2950 for Key Ref Design View */
-  public static final String XSDE_KEY_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde2950";
-  /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
-  /* CONTEXT_ID xsde2960 for Reference Key Combo Box */
-  public static final String XSDE_KEY_REF_REFERENCE = PLUGIN_NAME + ".xsde2960";
-  /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
-  /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
-  /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
-  /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
-  /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
-  /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
-  /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
-
-  /* CONTEXT_ID xsde3000 for Any Element Design View */
-  public static final String XSDE_ANY_ELEMENT_VIEW = PLUGIN_NAME + ".xsde3000";
-  /* CONTEXT_ID xsde3010 for Namespace Text Edit */
-  public static final String XSDE_ANY_ELEMENT_NAMESPACE = PLUGIN_NAME + ".xsde3010";
-  /* CONTEXT_ID xsde3020 for Process Contents Combo Box */
-  public static final String XSDE_ANY_ELEMENT_PROCESS   = PLUGIN_NAME + ".xsde3020";
-  /* CONTEXT_ID xsde3030 for Minimum Text Edit */
-  public static final String XSDE_ANY_ELEMENT_MINIMUM   = PLUGIN_NAME + ".xsde3030";
-  /* CONTEXT_ID xsde3040 for Maximum Text Edit */
-  public static final String XSDE_ANY_ELEMENT_MAXIMUM   = PLUGIN_NAME + ".xsde3040";
-
-  /* CONTEXT_ID xsde3100 for Any Attribute Design View */
-  public static final String XSDE_ANY_ATTRIBUTE_VIEW = PLUGIN_NAME + ".xsde3100";
-  /* CONTEXT_ID xsde3110 for Namespace Text Edit */
-  public static final String XSDE_ANY_ATTRIBUTE_NAMESPACE = PLUGIN_NAME + ".xsde3110";
-  /* CONTEXT_ID xsde3120 for Process Contents Combo Box */
-  public static final String XSDE_ANY_ATTRIBUTE_PROCESS   = PLUGIN_NAME + ".xsde3120";
-
-  /* no CONTEXT_ID for Union Design View - uses a generic interface */
-  /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
-  /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
-  /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
-  /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-
-  /* CONTEXT_ID xsde3200 for Notation Design View */
-  public static final String XSDE_NOTATION_VIEW = PLUGIN_NAME + ".xsde3200";
-
-  /* CONTEXT_ID xsde4000 for Source View */
-  public static final String XSDE_SOURCE_VIEW = PLUGIN_NAME + ".xsde4000";
-
-  /* CONTEXT_IDs for Regular Expression Wizard follow the xsdrxxx context IDs */
-  
-  /* CONTEXT_ID xsdr0010 for Compose Regular Expression Page */
-  public static final String XSDR_COMPOSITION_PAGE         = PLUGIN_NAME + ".xsdr0010";
-  /* CONTEXT_ID xsdr0015 for Token Contents Combo Box */
-  public static final String XSDR_COMPOSITION_TOKEN = PLUGIN_NAME + ".xsdr0015";
-  /* CONTEXT_ID xsdr0020 for Occurrece Group */
-  public static final String XSDR_COMPOSITION_OCCURRENCE_GROUP = PLUGIN_NAME + ".xsdr0020";
-  /* CONTEXT_ID xsdr0030 for Just once Radio Button */
-  public static final String XSDR_COMPOSITION_JUST_ONCE    = PLUGIN_NAME + ".xsdr0030";
-  /* CONTEXT_ID xsdr0040 for Zero or more Radio Button */
-  public static final String XSDR_COMPOSITION_ZERO_OR_MORE = PLUGIN_NAME + ".xsdr0040";
-  /* CONTEXT_ID xsdr0050 for One or more Radio Button */
-  public static final String XSDR_COMPOSITION_ONE_OR_MORE  = PLUGIN_NAME + ".xsdr0050";
-  /* CONTEXT_ID xsdr0060 for Optional Radio Button */
-  public static final String XSDR_COMPOSITION_OPTIONAL     = PLUGIN_NAME + ".xsdr0060";
-  /* CONTEXT_ID xsdr0070 for Repeat Radio Button */
-  public static final String XSDR_COMPOSITION_REPEAT       = PLUGIN_NAME + ".xsdr0070";
-  /* CONTEXT_ID xsdr0080 for Range Radio Button */
-  public static final String XSDR_COMPOSITION_RANGE        = PLUGIN_NAME + ".xsdr0080";
-  /* CONTEXT_ID xsdr0090 for Repeat Text Edit */
-  public static final String XSDR_COMPOSITION_REPEAT_TEXT  = PLUGIN_NAME + ".xsdr0090";
-  /* CONTEXT_ID xsdr0100 for Range Minimum Text Edit */
-  public static final String XSDR_COMPOSITION_RANGE_MIN    = PLUGIN_NAME + ".xsdr0100";
-  /* CONTEXT_ID xsdr0110 for Range Maximum Text Edit */
-  public static final String XSDR_COMPOSITION_RANGE_MAX    = PLUGIN_NAME + ".xsdr0110";
-  /* CONTEXT_ID xsdr0120 for Add Push Button */
-  public static final String XSDR_COMPOSITION_ADD          = PLUGIN_NAME + ".xsdr0120";
-  /* CONTEXT_ID xsdr0130 for Current Regular Expression Text Edit */
-  public static final String XSDR_COMPOSITION_CURRENT      = PLUGIN_NAME + ".xsdr0130";
-
-  /* CONTEXT_ID xsdr0200 for Test Regular Expression Page */
-  public static final String XSDR_TEST_PAGE   = PLUGIN_NAME + ".xsdr0200";
-  /* no CONTEXT_ID for Regular Expression Text Edit (not editable) */
-  /* CONTEXT_ID xsdr0210 for Sample Text Text Edit */
-  public static final String XSDR_TEST_SAMPLE = PLUGIN_NAME + ".xsdr0210";
-
-  /* CONTEXT_IDs for Preferences Page follows the xsdpxxx context IDs */
-  
-  /* CONTEXT_ID xsdp0010 for XML Schema Preferences Page */
-  public static final String XSDP_PREFERENCE_PAGE = PLUGIN_NAME + ".xsdp0010";
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorPlugin.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorPlugin.java
deleted file mode 100644
index 8c334f8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditorPlugin.java
+++ /dev/null
@@ -1,326 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-
-
-public class XSDEditorPlugin extends AbstractUIPlugin {
-	public final static String PLUGIN_ID = "org.eclipse.wst.xsd.ui";
-	public final static String XSD_EDITOR_ID = "org.eclipse.wst.xsd.ui.XSDEditor";
-
-	public final static String DEFAULT_TARGET_NAMESPACE = "http://www.example.org";
-
-	protected static XSDEditorPlugin plugin;
-
-	// protected XMLSchemaPackage xmlschemaPackage;
-	// KCPort private static MsgLogger myMsgLogger;
-
-	public XSDEditorPlugin(IPluginDescriptor descriptor) {
-		super(descriptor);
-		plugin = this;
-		// KCPort myMsgLogger = getMsgLogger();
-		// myMsgLogger.write(Level.CONFIG, new BuildInfo());
-		// myMsgLogger.write(Level.CONFIG, BuildInfo.getWSABuildLevel());
-	}
-
-	/**
-	 * Copy the w3c XMLSchema.dtd and datatypes.dtd into the plugin metadata
-	 * directory for validation purposes
-	 * 
-	 * @throws CoreException
-	 * 
-	 * ISSUE: should be removed.
-	 */
-	public void startup() throws CoreException {
-		super.startup();
-	}
-
-
-	/**
-	 * @deprecated use StructuredModelManager.getModelManager(); instead.
-	 */
-	public static IModelManager getModelManager() {
-		return StructuredModelManager.getModelManager();
-	}
-
-
-	/**
-	 * Get the Install URL
-	 */
-	public static URL getInstallURL() {
-		return getPlugin().getDescriptor().getInstallURL();
-	}
-
-	/**
-	 * Return the plugin physical directory location
-	 */
-	public static IPath getPluginLocation() {
-		try {
-			IPath installPath = new Path(getInstallURL().toExternalForm()).removeTrailingSeparator();
-			String installStr = Platform.asLocalURL(new URL(installPath.toString())).getFile();
-			return new Path(installStr);
-		}
-		catch (IOException e) {
-
-		}
-		return null;
-	}
-
-	/**
-	 * Get the metadata directory for this plugin
-	 */
-	public static String getMetaDataDirectory() {
-		return getPlugin().getStateLocation().toOSString();
-	}
-
-	/**
-	 * Get the one xmlschema package.
-	 */
-	// public XMLSchemaPackage getXMLSchemaPackage()
-	// {
-	// return xmlschemaPackage;
-	// }
-	// /**
-	// * Get the one xmlschema factory.
-	// */
-	// public XMLSchemaFactory getXMLSchemaFactory()
-	// {
-	// return (XMLSchemaFactory)xmlschemaPackage.getEFactoryInstance();
-	// }
-	/**
-	 * Get the singleton instance.
-	 */
-	public static XSDEditorPlugin getPlugin() {
-		return plugin;
-	}
-
-	public static Image getXSDImage(String iconName) {
-		return getPlugin().getImage(iconName);
-	}
-
-	public Image getImage(String iconName) {
-		ImageRegistry imageRegistry = getImageRegistry();
-
-		if (imageRegistry.get(iconName) != null) {
-			return imageRegistry.get(iconName);
-		}
-		else {
-			imageRegistry.put(iconName, ImageDescriptor.createFromFile(getClass(), iconName));
-			return imageRegistry.get(iconName);
-		}
-	}
-
-	public static String getXSDString(String key) {
-		return Platform.getResourceBundle(plugin.getBundle()).getString(key);
-	}
-
-	/**
-	 * This gets the string resource and does one substitution.
-	 */
-	public String getString(String key, Object s1) {
-		return MessageFormat.format(Platform.getResourceBundle(getBundle()).getString(key), new Object[]{s1});
-	}
-
-	// public IWorkspace getWorkspace()
-	// {
-	// return ResourcesPlugin.getWorkspace();
-	// }
-
-	public static Shell getShell() {
-		return getPlugin().getWorkbench().getActiveWorkbenchWindow().getShell();
-	}
-
-	/**
-	 * Get the xml schema default namespace prefix
-	 */
-	public String getXMLSchemaPrefix() {
-		return getPreferenceStore().getString(CONST_XSD_DEFAULT_PREFIX_TEXT);
-	}
-
-	/**
-	 * Get the xml schema default target namespace
-	 */
-	public String getXMLSchemaTargetNamespace() {
-		String targetNamespace = getPreferenceStore().getString(CONST_DEFAULT_TARGET_NAMESPACE);
-		if (!targetNamespace.endsWith("/")) {
-			targetNamespace = targetNamespace + "/";
-		}
-		return targetNamespace;
-	}
-
-	/**
-	 * Get the xml schema language qualification
-	 */
-	public boolean isQualifyXMLSchemaLanguage() {
-		return getPreferenceStore().getBoolean(CONST_XSD_LANGUAGE_QUALIFY);
-	}
-
-	/**
-	 * Method isCombinedDesignAndSourceView.
-	 * 
-	 * @return boolean if the editor should have a single page that is a
-	 *         combined design and source page
-	 */
-	public boolean isCombinedDesignAndSourceView() {
-		return COMBINED_LAYOUT.equals(getPreferenceStore().getString(EDITOR_LAYOUT));
-	}
-
-	public int getDesignLayout() {
-		if (TOP_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
-			return SWT.VERTICAL;
-		}
-		else if (BOTTOM_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
-			return SWT.VERTICAL;
-		}
-		else if (LEFT_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
-			return SWT.HORIZONTAL;
-		}
-		else if (RIGHT_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
-			return SWT.HORIZONTAL;
-		}
-		return SWT.HORIZONTAL;
-	}
-
-	public String getDesignLayoutPosition() {
-		if (TOP_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
-			return TOP_LAYOUT;
-		}
-		else if (BOTTOM_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
-			return BOTTOM_LAYOUT;
-		}
-		else if (LEFT_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
-			return LEFT_LAYOUT;
-		}
-		else if (RIGHT_LAYOUT.equals(getPreferenceStore().getString(DESIGN_LAYOUT))) {
-			return RIGHT_LAYOUT;
-		}
-		return RIGHT_LAYOUT;
-	}
-
-	/*---------------------------------------------------------------------------*/
-	/* the following methods are impls for the IPluginHelper interface */
-	/*---------------------------------------------------------------------------*/
-	// public void setMsgLoggerConfig(Hashtable msgLoggerConfig)
-	// {
-	// getMsgLogger().setMsgLoggerConfig(msgLoggerConfig);
-	// }
-	//
-	// public Hashtable getMsgLoggerConfig(Plugin plugin)
-	// {
-	// return (new PluginHelperImpl().getMsgLoggerConfig(plugin));
-	// }
-	//
-	// public Hashtable getMsgLoggerConfig()
-	// {
-	// return (getMsgLoggerConfig(this));
-	// }
-	//
-	// /**
-	// * XSDEditor and XSDModel use the same logger. See plugin.xml
-	// */
-	// public MsgLogger getMsgLogger()
-	// {
-	// if (myMsgLogger == null)
-	// {
-	// myMsgLogger = (MsgLogger) MsgLogger.getFactory().getLogger(new
-	// PluginHelperImpl().getMsgLoggerName(this), this);
-	// }
-	// return (myMsgLogger);
-	// }
-	public static final String CONST_XSD_DEFAULT_PREFIX_TEXT = "org.eclipse.wst.xmlschema.xsdDefaultPrefixText";
-	public static final String CONST_XSD_LANGUAGE_QUALIFY = "org.eclipse.wst.xmlschema.xsdQualify";
-	public static final String CONST_DEFAULT_TARGET_NAMESPACE = "org.eclipse.wst.xmlschema.defaultTargetnamespaceText";
-
-	// Preference to store which page should come up as the default page in
-	// the editor. This setting is based
-	// on the page that was left showing the last time the editor was closed.
-	public static String DEFAULT_PAGE = "org.eclipse.wst.xsd.ui.internal.defaultPage";
-	public static String DESIGN_PAGE = "org.eclipse.wst.xsd.ui.internal.designPage";
-	public static String SOURCE_PAGE = "org.eclipse.wst.xsd.ui.internal.sourcePage";
-	public static String GRAPH_PAGE = "org.eclipse.wst.xsd.ui.internal.graphPage";
-
-	public static String EDITOR_LAYOUT = "org.eclipse.wst.xsd.ui.internal.editorlayout";
-	public static String COMBINED_LAYOUT = "org.eclipse.wst.xsd.ui.internal.combined";
-	public static String SEPARATE_LAYOUT = "org.eclipse.wst.xsd.ui.internal.separate";
-
-	public static String DESIGN_LAYOUT = "org.eclipse.wst.xsd.ui.internal.designlayout";
-	public static String TOP_LAYOUT = "org.eclipse.wst.xsd.ui.internal.top";
-	public static String BOTTOM_LAYOUT = "org.eclipse.wst.xsd.ui.internal.bottom";
-	public static String LEFT_LAYOUT = "org.eclipse.wst.xsd.ui.internal.left";
-	public static String RIGHT_LAYOUT = "org.eclipse.wst.xsd.ui.internal.right";
-
-	/**
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeDefaultPreferences(IPreferenceStore)
-	 */
-	protected void initializeDefaultPreferences(IPreferenceStore store) {
-		super.initializeDefaultPreferences(store);
-
-		store.setDefault(CONST_XSD_DEFAULT_PREFIX_TEXT, "xsd");
-		store.setDefault(CONST_XSD_LANGUAGE_QUALIFY, false);
-
-		store.setDefault(DEFAULT_PAGE, DESIGN_PAGE);
-		store.setDefault(EDITOR_LAYOUT, COMBINED_LAYOUT);
-		store.setDefault(DESIGN_LAYOUT, RIGHT_LAYOUT);
-
-		store.setDefault(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE, DEFAULT_TARGET_NAMESPACE);
-	}
-
-	public void setDefaultPage(String page) {
-		getPreferenceStore().setValue(DEFAULT_PAGE, page);
-	}
-
-	/**
-	 * Method getDefaultPage.
-	 * 
-	 * @return String value of the string constant that is the default page
-	 *         the editor should turn to when first opened. Changes to the
-	 *         last visible page when the editor was closed
-	 */
-	public String getDefaultPage() {
-		return getPreferenceStore().getString(DEFAULT_PAGE);
-	}
-
-	protected URL baseURL;
-
-	public URL getBaseURL() {
-		return getDescriptor().getInstallURL();
-	}
-
-	public Image getIconImage(String object) {
-		try {
-			return ExtendedImageRegistry.getInstance().getImage(new URL(getBaseURL() + "icons/" + object + ".gif"));
-		}
-		catch (MalformedURLException exception) {
-			System.out.println("Failed to load image for '" + object + "'");
-		}
-		return null;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDHyperlink.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDHyperlink.java
deleted file mode 100644
index eb1f306..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDHyperlink.java
+++ /dev/null
@@ -1,86 +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
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal;
-
-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.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-/**
- * WSDL Hyperlink that knows how to open links from wsdl files
- */
-public class XSDHyperlink implements IHyperlink {
-	private IRegion fRegion;
-	private XSDConcreteComponent fComponent;
-
-	public XSDHyperlink(IRegion region, XSDConcreteComponent component) {
-		fRegion = region;
-		fComponent = component;
-	}
-
-	public IRegion getHyperlinkRegion() {
-		return fRegion;
-	}
-
-	public String getTypeLabel() {
-		return null;
-	}
-
-	public String getHyperlinkText() {
-		return null;
-	}
-
-	public void open() {
-		// if hyperlink points to schema already in editor, select the correct
-		// node
-		// if (fComponent.getRootContainer().equals(xsdSchema)) {
-		// Node element = fComponent.getElement();
-		// if (element instanceof IndexedRegion) {
-		// IndexedRegion indexNode = (IndexedRegion) element;
-		// textEditor.getTextViewer().setRangeIndication(indexNode.getStartOffset(),
-		// indexNode.getEndOffset() - indexNode.getStartOffset(), true);
-		// }
-		// }
-		// else {
-		if (fComponent.getSchema() != null) {
-			String schemaLocation = URIHelper.removePlatformResourceProtocol(fComponent.getSchema().getSchemaLocation());
-			IPath schemaPath = new Path(schemaLocation);
-			IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
-			if (schemaFile != null && schemaFile.exists()) {
-				IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-				if (workbenchWindow != null) {
-					IWorkbenchPage page = workbenchWindow.getActivePage();
-					try {
-						IEditorPart editorPart = IDE.openEditor(page, schemaFile, true);
-						if (editorPart instanceof XSDEditor) {
-							((XSDEditor) editorPart).openOnGlobalReference(fComponent);
-						}
-					}
-					catch (PartInitException pie) {
-						Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
-					}
-				}
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDHyperlinkDetector.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDHyperlinkDetector.java
deleted file mode 100644
index 133e612..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDHyperlinkDetector.java
+++ /dev/null
@@ -1,251 +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
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.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.xsd.ui.internal.text.XSDModelAdapter;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-/**
- * Detects hyperlinks for XSD files
- */
-public class XSDHyperlinkDetector implements IHyperlinkDetector {
-	/**
-	 * Gets the xsd schema from document
-	 * 
-	 * @param document
-	 * @return XSDSchema or null of one does not exist yet for document
-	 */
-	private XSDSchema getXSDSchema(IDocument document) {
-		XSDSchema schema = null;
-		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-		if (model != null) {
-			try {
-				if (model instanceof IDOMModel) {
-					IDOMDocument domDoc = ((IDOMModel) model).getDocument();
-					if (domDoc != null) {
-						XSDModelAdapter modelAdapter = (XSDModelAdapter) domDoc.getExistingAdapter(XSDModelAdapter.class);
-						/*
-						 * ISSUE: Didn't want to go through initializing
-						 * schema if it does not already exist, so just
-						 * attempted to get existing adapter. If doesn't
-						 * exist, just don't bother working.
-						 */
-						if (modelAdapter != null)
-							schema = modelAdapter.getSchema();
-					}
-				}
-			}
-			finally {
-				model.releaseFromRead();
-			}
-		}
-		return schema;
-	}
-
-	/**
-	 * 
-	 * @param xsdSchema
-	 *            cannot be null
-	 * @param node
-	 *            cannot be null
-	 * @return XSDConcreteComponent
-	 */
-	private XSDConcreteComponent getXSDComponent(XSDSchema xsdSchema, Node node) {
-		XSDConcreteComponent objectToReveal = null;
-
-		XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent((Node) node);
-		if (xsdComp instanceof XSDElementDeclaration) {
-			XSDElementDeclaration elementDecl = (XSDElementDeclaration) xsdComp;
-			if (elementDecl.isElementDeclarationReference()) {
-				objectToReveal = elementDecl.getResolvedElementDeclaration();
-			}
-			else {
-				XSDConcreteComponent typeDef = null;
-				if (elementDecl.getAnonymousTypeDefinition() == null) {
-					typeDef = elementDecl.getTypeDefinition();
-				}
-
-				XSDConcreteComponent subGroupAffiliation = elementDecl.getSubstitutionGroupAffiliation();
-
-				if (typeDef != null && subGroupAffiliation != null) {
-					// we have 2 things we can navigate to, if the
-					// cursor is anywhere on the substitution
-					// attribute
-					// then jump to that, otherwise just go to the
-					// typeDef.
-					if (node instanceof Attr && ((Attr) node).getLocalName().equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE)) {
-						objectToReveal = subGroupAffiliation;
-					}
-					else {
-						// try to reveal the type now. On success,
-						// then we return true.
-						// if we fail, set the substitution group
-						// as
-						// the object to reveal as a backup plan.
-						// ISSUE: how to set backup?
-						// if (revealObject(typeDef)) {
-						objectToReveal = typeDef;
-						// }
-						// else {
-						// objectToReveal = subGroupAffiliation;
-						// }
-					}
-				}
-				else {
-					// one or more of these is null. If the
-					// typeDef is
-					// non-null, use it. Otherwise
-					// try and use the substitution group
-					objectToReveal = typeDef != null ? typeDef : subGroupAffiliation;
-				}
-			}
-		}
-		else if (xsdComp instanceof XSDModelGroupDefinition) {
-			XSDModelGroupDefinition elementDecl = (XSDModelGroupDefinition) xsdComp;
-			if (elementDecl.isModelGroupDefinitionReference()) {
-				objectToReveal = elementDecl.getResolvedModelGroupDefinition();
-			}
-		}
-		else if (xsdComp instanceof XSDAttributeDeclaration) {
-			XSDAttributeDeclaration attrDecl = (XSDAttributeDeclaration) xsdComp;
-			if (attrDecl.isAttributeDeclarationReference()) {
-				objectToReveal = attrDecl.getResolvedAttributeDeclaration();
-			}
-			else if (attrDecl.getAnonymousTypeDefinition() == null) {
-				objectToReveal = attrDecl.getTypeDefinition();
-			}
-		}
-		else if (xsdComp instanceof XSDAttributeGroupDefinition) {
-			XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) xsdComp;
-			if (attrGroupDef.isAttributeGroupDefinitionReference()) {
-				objectToReveal = attrGroupDef.getResolvedAttributeGroupDefinition();
-			}
-		}
-		else if (xsdComp instanceof XSDIdentityConstraintDefinition) {
-			XSDIdentityConstraintDefinition idConstraintDef = (XSDIdentityConstraintDefinition) xsdComp;
-			if (idConstraintDef.getReferencedKey() != null) {
-				objectToReveal = idConstraintDef.getReferencedKey();
-			}
-		}
-		else if (xsdComp instanceof XSDSimpleTypeDefinition) {
-			XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) xsdComp;
-			objectToReveal = typeDef.getItemTypeDefinition();
-			if (objectToReveal == null) {
-				// if itemType attribute is not set, then check
-				// for memberType
-				List memberTypes = typeDef.getMemberTypeDefinitions();
-				if (memberTypes != null && memberTypes.size() > 0) {
-					objectToReveal = (XSDConcreteComponent) memberTypes.get(0);
-				}
-			}
-		}
-		else if (xsdComp instanceof XSDTypeDefinition) {
-			XSDTypeDefinition typeDef = (XSDTypeDefinition) xsdComp;
-			objectToReveal = typeDef.getBaseType();
-		}
-		else if (xsdComp instanceof XSDSchemaDirective) {
-			XSDSchemaDirective directive = (XSDSchemaDirective) xsdComp;
-			// String schemaLocation =
-			// URIHelper.removePlatformResourceProtocol(directive.getResolvedSchema().getSchemaLocation());
-			// openXSDEditor(schemaLocation);
-			// return false;
-			objectToReveal = directive.getResolvedSchema();
-		}
-		return objectToReveal;
-	}
-
-	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 node = getCurrentNode(document, region.getOffset());
-			if (node != null) {
-				XSDSchema xsdSchema = getXSDSchema(textViewer.getDocument());
-				if (xsdSchema != null) {
-					XSDConcreteComponent objectToReveal = getXSDComponent(xsdSchema, node);
-					// now reveal the object if this isn't null
-					if (objectToReveal != null) {
-						IRegion nodeRegion = region;
-						if (node instanceof IndexedRegion) {
-							IndexedRegion indexed = (IndexedRegion) node;
-							int start = indexed.getStartOffset();
-							int end = indexed.getEndOffset();
-							nodeRegion = new Region(start, end - start);
-						}
-						hyperlinks.add(new XSDHyperlink(nodeRegion, objectToReveal));
-					}
-				}
-			}
-		}
-
-		if (hyperlinks.size() == 0)
-			return null;
-		return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
-	}
-
-	/**
-	 * 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;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMenuListener.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMenuListener.java
deleted file mode 100644
index 61093be..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMenuListener.java
+++ /dev/null
@@ -1,1762 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.wst.xsd.ui.internal.actions.AddEnumsAction;
-import org.eclipse.wst.xsd.ui.internal.actions.AddModelGroupAction;
-import org.eclipse.wst.xsd.ui.internal.actions.BackAction;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateAnnotationAction;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateElementAction;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateGroupAction;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateIdentityConstraintsAction;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateLocalComplexTypeAction;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateLocalSimpleTypeAction;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateSimpleContentAction;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateSimpleTypeAction;
-import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-import org.eclipse.wst.xsd.ui.internal.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.actions.OpenSchemaAction;
-import org.eclipse.wst.xsd.ui.internal.actions.SetBaseTypeAction;
-import org.eclipse.wst.xsd.ui.internal.actions.SetMultiplicityAction;
-import org.eclipse.wst.xsd.ui.internal.actions.SetTypeAction;
-import org.eclipse.wst.xsd.ui.internal.actions.XSDEditNamespacesAction;
-import org.eclipse.wst.xsd.ui.internal.graph.model.Category;
-import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.refactor.actions.RefactorActionGroup;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class XSDMenuListener implements IMenuListener
-{
-  protected ISelectionProvider selectionProvider;
-  protected DeleteAction deleteAction;
-  protected CreateElementAction addComplexTypeAction;
-  protected XSDSchema xsdSchema;
-  protected boolean isReadOnly;
-  protected Object sourceContext;
-  private RefactorActionGroup fRefactorMenuGroup;
-
-  /**
-   * Constructor for XSDMenuListener.
-   */
-  public XSDMenuListener(ISelectionProvider selectionProvider)
-  {
-    super();
-    this.selectionProvider = selectionProvider;
-
-    deleteAction = new DeleteAction(XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE"), null, getXSDSchema());
-    deleteAction.setSelectionProvider(selectionProvider);
-    selectionProvider.addSelectionChangedListener(deleteAction);
-  }
-
-  public void setSourceContext(Object sourceContext)
-  {
-    this.sourceContext = sourceContext;
-  }
-
-  public void setSelectionProvider(ISelectionProvider selectionProvider)
-  {
-    this.selectionProvider = selectionProvider;
-  }
-
-  protected XSDSchema getXSDSchema()
-  {
-    return xsdSchema;
-  }
-
-  protected Object getSelectedElement()
-  {
-    ISelection selection = selectionProvider.getSelection();
-    if (selection.isEmpty())
-    {
-      return null;
-    }
-    return ((IStructuredSelection) selection).getFirstElement();
-  }
-  
-  protected boolean isSchemaReadOnly()
-  {
-	  XSDSchema editorSchema = ((XSDEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getXSDSchema();
-	  if (editorSchema == xsdSchema) {
-		  return false;
-	  }
-
-	  return true; 
-  }
-  
-  protected XSDSchema getCurrentSchemaInEditor()
-  {
-    return ((XSDEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getXSDSchema();
-  }
-    
-  protected void updateXSDSchema()
-  {
-    isReadOnly = false;
-
-    Object object = getSelectedElement();
-    if (object instanceof XSDConcreteComponent)
-    {
-      xsdSchema = ((XSDConcreteComponent) object).getSchema();
-      isReadOnly = isSchemaReadOnly();
-    }
-    else if (object instanceof Category)
-    {
-      Category cg = (Category) object;
-      xsdSchema = cg.getXSDSchema();
-    }
-    else if (object instanceof CategoryAdapter)
-    {
-      CategoryAdapter category = (CategoryAdapter) object;
-      xsdSchema = category.getXSDSchema();
-    }
-  }
-  
-  /*
-   * @see IMenuListener#menuAboutToShow(IMenuManager)
-   */
-  public void menuAboutToShow(IMenuManager manager)
-  {
-    isReadOnly = false;
-    updateXSDSchema();
-    if (xsdSchema == null)
-    {
-      manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
-      return;
-    }
-    
-    deleteAction.setXSDSchema(xsdSchema);
-    deleteAction.setEnabled(!isReadOnly);
-    
-    BackAction backAction = new BackAction(XSDEditorPlugin.getXSDString("_UI_ACTION_BACK_TO_SCHEMA_VIEW")); //$NON-NLS-1$
-    backAction.setXSDSchema(getCurrentSchemaInEditor());
-    backAction.setSelectionProvider(selectionProvider);
-    
-    Object selectedElementObj = getSelectedElement();
-    
-    if (selectedElementObj instanceof XSDSchema || selectedElementObj instanceof Category || selectedElementObj instanceof CategoryAdapter)
-    {
-      backAction.setEnabled(false);
-    }
-    manager.add(backAction);
-    manager.add(new Separator());
-//    if (undoAction == null && textEditor != null)
-//    {
-//      undoAction = textEditor.getAction(org.eclipse.ui.texteditor.ITextEditorActionConstants.UNDO);
-//      redoAction = textEditor.getAction(org.eclipse.ui.texteditor.ITextEditorActionConstants.REDO);
-//    }
-    //    Element selectedElement = getSelectedElement();
-
-    Element selectedElement = null;
-    
-    if (selectedElementObj instanceof Element)
-    {
-      selectedElement = (Element) selectedElementObj;
-    }
-    else if (selectedElementObj instanceof XSDConcreteComponent)
-    {
-      selectedElement = ((XSDConcreteComponent) selectedElementObj).getElement();
-    }
-    else if (selectedElementObj instanceof Category || selectedElementObj instanceof CategoryAdapter)
-    {
-      int groupType = -1;
-      if (selectedElementObj instanceof Category)
-      {
-        Category category = (Category) selectedElementObj;
-        groupType = category.getGroupType();
-      }
-      // todo... We need to ensure we eliminate the need for
-      // this case. The XSDMenuListener class should not have
-      // view dependant code. We need to do some work to ensure all
-      // views utilize the 'Category' model object
-      else if (selectedElementObj instanceof CategoryAdapter)
-      {
-        CategoryAdapter categoryAdapter = (CategoryAdapter) selectedElementObj;
-        groupType = categoryAdapter.getGroupType();
-      }
-      ArrayList attributes = null;
-      Element parent = getXSDSchema().getElement();
-      
-      if (parent == null)
-      {
-        return;
-      }
-      
-      Node relativeNode = null;
-      switch (groupType)
-      {
-        case Category.TYPES : {
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("ComplexType")));
-          Action action = addCreateElementAction(manager, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_COMPLEX_TYPE"), attributes, parent, relativeNode);
-          ((CreateElementAction) action).setIsGlobal(true);
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("SimpleType")));
-          Action action2 = addCreateSimpleTypeAction(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SIMPLE_TYPE"), attributes, parent, relativeNode);
-          ((CreateElementAction) action2).setIsGlobal(true);
-          break;
-        }
-        case Category.ELEMENTS : {
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.ELEMENT_ELEMENT_TAG, "GlobalElement")));
-          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-          Action action = addCreateElementAction(manager, XSDConstants.ELEMENT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ELEMENT"), attributes, parent, relativeNode);
-          ((CreateElementAction) action).setIsGlobal(true);
-          break;
-        }
-        case Category.GROUPS : {
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.GROUP_ELEMENT_TAG, "Group")));
-          CreateGroupAction groupAction = addCreateGroupAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GROUP"), attributes, parent, relativeNode);
-          groupAction.setIsGlobal(true);
-          break;
-        }
-        case Category.ATTRIBUTES : {
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.ATTRIBUTE_ELEMENT_TAG, "GlobalAttribute")));
-          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-          Action action = addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GLOBAL_ATTRIBUTE"), attributes, parent, relativeNode);
-          ((CreateElementAction) action).setIsGlobal(true);
-          break;
-        }
-        case Category.ATTRIBUTE_GROUPS : {
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, "AttributeGroup")));
-          Action action = addCreateElementAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP"), attributes, parent, relativeNode);
-          ((CreateElementAction) action).setIsGlobal(true);
-          break;
-        }
-        case Category.NOTATIONS : {
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.NOTATION_ELEMENT_TAG, "Notation")));
-          attributes.add(new DOMAttribute(XSDConstants.PUBLIC_ATTRIBUTE, ""));
-          Action action = addCreateElementAction(manager, XSDConstants.NOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_NOTATION"), attributes, parent, relativeNode);
-          ((CreateElementAction) action).setIsGlobal(true);
-          break;
-        }
-        case Category.DIRECTIVES : {
-          boolean b = true;
-          NodeList children = parent.getChildNodes();
-          int length = children.getLength();
-          Node effectiveRelativeNode = parent.getFirstChild();
-          for (int i = 0; i < length && b; i++)
-          {
-            Node child = children.item(i);
-            if (child != null && child instanceof Element)
-            {
-              if (XSDDOMHelper.inputEquals((Element) child, XSDConstants.INCLUDE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.IMPORT_ELEMENT_TAG, false)
-                  || XSDDOMHelper.inputEquals((Element) child, XSDConstants.REDEFINE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.ANNOTATION_ELEMENT_TAG, false))
-              {
-                effectiveRelativeNode = child;
-              }
-              else
-              {
-                b = false;
-              }
-            }
-          }
-          relativeNode = effectiveRelativeNode != null ? XSDDOMHelper.getNextElementNode(effectiveRelativeNode) : null;
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, ""));
-          Action action = addCreateElementAction(manager, XSDConstants.INCLUDE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_INCLUDE"), attributes, parent, relativeNode);
-          ((CreateElementAction) action).setIsGlobal(true);
-          action = addCreateElementAction(manager, XSDConstants.IMPORT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_IMPORT"), null, parent, relativeNode);
-          ((CreateElementAction) action).setIsGlobal(true);
-          action = addCreateElementAction(manager, XSDConstants.REDEFINE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_REDEFINE"), attributes, parent, relativeNode);
-          ((CreateElementAction) action).setIsGlobal(true);
-          break;
-        }
-        case Category.ANNOTATIONS : {
-          Action action = addCreateElementAction(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), null, parent, relativeNode);
-          ((CreateElementAction) action).setIsGlobal(true);
-          break;
-        }
-      }
-//      manager.add(new Separator());
-//      if (undoAction != null)
-//      {
-//        manager.add(undoAction);
-//        manager.add(redoAction);
-//      }
-      
-      // insertion point for popupMenus extension
-      manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));    
-
-      return;
-    }
-    if (selectedElement != null)
-    {
-      addContextItems(manager, selectedElement, null);
-      manager.add(new Separator());
-    }
-    
-    manager.add(new Separator());
-    if (deleteAction != null)
-    {
-      manager.add(deleteAction);
-    }
-    
-    // insertion point for popupMenus extension
-    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));    
-  }
-
-  protected String getBuiltInStringQName()
-  {
-    String stringName = "string";
-    if (getXSDSchema() != null)
-    {
-      String schemaForSchemaPrefix = getXSDSchema().getSchemaForSchemaQNamePrefix();
-      if (schemaForSchemaPrefix != null && schemaForSchemaPrefix.length() > 0)
-      {
-        String prefix = getXSDSchema().getSchemaForSchemaQNamePrefix();
-        if (prefix != null && prefix.length() > 0)
-        {
-          stringName = prefix + ":" + stringName;
-        }
-      }
-    }
-    return stringName;
-  }
-
-  /**
-   * Method addContextItems.
-   * 
-   * @param manager
-   * @param parent -
-   *          menu items should be context sensitive to this node
-   * @param relativeNode -
-   *          anything inserted, should be inserted before this node (which is a
-   *          child of the parent node. A value of null means add to the end
-   */
-  protected void addContextItems(IMenuManager manager, Element parent, Node relativeNode)
-  {
-    ArrayList attributes = null;
-    if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-    { //
-      addSchemaElementItems(manager, parent, relativeNode);
-      manager.add(new Separator());
-      boolean b = true;
-      NodeList children = parent.getChildNodes();
-      Node effectiveRelativeNode = parent.getFirstChild();
-      for (int i = 0; i < children.getLength() && b; i++)
-      {
-        Node child = children.item(i);
-        if (child != null && child instanceof Element)
-        {
-          if (XSDDOMHelper.inputEquals((Element) child, XSDConstants.INCLUDE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.IMPORT_ELEMENT_TAG, false)
-              || XSDDOMHelper.inputEquals((Element) child, XSDConstants.REDEFINE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.ANNOTATION_ELEMENT_TAG, false))
-          {
-            effectiveRelativeNode = child;
-          }
-          else
-          {
-            b = false;
-          }
-        }
-      }
-      relativeNode = effectiveRelativeNode != null ? effectiveRelativeNode.getNextSibling() : null;
-      attributes = new ArrayList();
-      attributes.add(new DOMAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, ""));
-      addCreateElementAction(manager, XSDConstants.INCLUDE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_INCLUDE"), attributes, parent, relativeNode);
-      addCreateElementAction(manager, XSDConstants.IMPORT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_IMPORT"), null, parent, relativeNode);
-      addCreateElementAction(manager, XSDConstants.REDEFINE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_REDEFINE"), attributes, parent, relativeNode);
-      attributes = null;
-      addCreateAnnotationAction(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), null, parent, relativeNode);
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false))
-    { //
-      addCreateElementAction(manager, XSDConstants.DOCUMENTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_DOC"), attributes, parent, null);
-      addCreateElementAction(manager, XSDConstants.APPINFO_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_APP_INFO"), attributes, parent, null);
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ELEMENT_ELEMENT_TAG, false))
-    {
-      XSDConcreteComponent concreteComponent = getXSDSchema().getCorrespondingComponent(parent);
-      Element parentNode = (Element) parent.getParentNode();
-      boolean isGlobalElement = false;
-      if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-      {
-        isGlobalElement = true;
-      }
-      boolean annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
-          parent.getFirstChild());
-      boolean simpleTypeExists = elementExists(XSDConstants.SIMPLETYPE_ELEMENT_TAG, parent);
-      boolean complexTypeExists = elementExists(XSDConstants.COMPLEXTYPE_ELEMENT_TAG, parent);
-      manager.add(new Separator());
-      if (annotationExists)
-      {
-        Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
-        if (!(simpleTypeExists || complexTypeExists) && annotationNode != null)
-        {
-          manager.add(new Separator());
-        }
-      }
-      else
-      {
-        if (concreteComponent != null)
-        {
-          AddModelGroupAction addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.SEQUENCE_LITERAL);
-          addModelGroupAction.setEnabled(!isReadOnly);
-          manager.add(addModelGroupAction);
-          
-          addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.CHOICE_LITERAL);
-          addModelGroupAction.setEnabled(!isReadOnly);
-          manager.add(addModelGroupAction);
-          
-          addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.ALL_LITERAL);
-          addModelGroupAction.setEnabled(!isReadOnly);
-          manager.add(addModelGroupAction);
-          
-          manager.add(new Separator());
-        }
-      }
-      XSDDOMHelper domHelper = new XSDDOMHelper();
-      Element anonymousType = (Element) domHelper.getChildNode(parent, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-      if (anonymousType != null)
-      {
-        manager.add(new Separator());
-        attributes = new ArrayList();
-        attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("ComplexType")));
-        addMoveAnonymousGlobal(manager, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"), attributes, anonymousType, null);
-        attributes = null;
-      }
-      anonymousType = (Element) domHelper.getChildNode(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-      if (anonymousType != null)
-      {
-        manager.add(new Separator());
-        attributes = new ArrayList();
-        attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("SimpleType")));
-        addMoveAnonymousGlobal(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"), attributes, anonymousType, null);
-        attributes = null;
-      }
-      
-      manager.add(new Separator());
-      MenuManager setTypeCascadeMenu = new MenuManager(XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"));
-      manager.add(setTypeCascadeMenu);
-
-      SetTypeAction setNewComplexTypeAction = new SetTypeAction(XSDEditorPlugin.getXSDString("_UI_LABEL_NEW_COMPLEX_TYPE"), ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDComplexType.gif"), concreteComponent);
-      setNewComplexTypeAction.setTypeKind(XSDConstants.COMPLEXTYPE_ELEMENT);
-      setNewComplexTypeAction.setEnabled(!isReadOnly);
-      setTypeCascadeMenu.add(setNewComplexTypeAction);
-
-      SetTypeAction setNewSimpleTypeAction = new SetTypeAction(XSDEditorPlugin.getXSDString("_UI_LABEL_NEW_SIMPLE_TYPE"), ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSimpleType.gif"), concreteComponent);
-      setNewSimpleTypeAction.setTypeKind(XSDConstants.SIMPLETYPE_ELEMENT);
-      setNewSimpleTypeAction.setEnabled(!isReadOnly);
-      setTypeCascadeMenu.add(setNewSimpleTypeAction);
-      
-      SetTypeAction setExistingTypeAction = new SetTypeAction(XSDEditorPlugin.getXSDString("_UI_LABEL_SET_EXISTING_TYPE"), concreteComponent);
-      setExistingTypeAction.setTypeKind(0);
-      setExistingTypeAction.setEnabled(!isReadOnly);
-      setTypeCascadeMenu.add(setExistingTypeAction);
-      manager.add(new Separator());
-
-      if (!isGlobalElement)
-      {
-        addMultiplicityMenu(concreteComponent, manager);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.SEQUENCE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals(parent, XSDConstants.CHOICE_ELEMENT_TAG, false))
-    { //
-      XSDConcreteComponent concreteComponent = getXSDSchema().getCorrespondingComponent(parent);
-      
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-      manager.add(new Separator());
-      addCreateElementAction(manager, XSDConstants.CHOICE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CHOICE"), attributes, parent, null);
-      addCreateElementAction(manager, XSDConstants.SEQUENCE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SEQUENCE"), attributes, parent, null);
-      addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, null);
-      manager.add(new Separator());
-      attributes = new ArrayList();
-      attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ELEMENT_ELEMENT_TAG, "Element", false)));
-      attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-      addCreateElementAction(manager, XSDConstants.ELEMENT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ELEMENT"), attributes, parent, null);
-      addCreateElementRefAction(manager, XSDConstants.ELEMENT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ELEMENT_REF"), parent, null);
-      manager.add(new Separator());
-      attributes = null;
-      addCreateElementAction(manager, XSDConstants.ANY_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ELEMENT"), attributes, parent, null);
-      
-      if (concreteComponent.getContainer() instanceof XSDParticle)
-      {
-        addMultiplicityMenu(concreteComponent, manager);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ALL_ELEMENT_TAG, false))
-    { //
-      XSDConcreteComponent concreteComponent = getXSDSchema().getCorrespondingComponent(parent);
-      
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-      manager.add(new Separator());
-      attributes = new ArrayList();
-      attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ELEMENT_ELEMENT_TAG, "Element", false)));
-      attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-      addCreateElementAction(manager, XSDConstants.ELEMENT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ELEMENT"), attributes, parent, null);
-      addCreateElementRefAction(manager, XSDConstants.ELEMENT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ELEMENT_REF"), parent, null);
-
-      if (concreteComponent.getContainer() instanceof XSDParticle)
-      {
-        addMultiplicityMenu(concreteComponent, manager);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false))
-    { //
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
-          parent.getFirstChild());
-      boolean anyAttributeExists = elementExists(XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, parent);
-      Node anyAttributeNode = null;
-      manager.add(new Separator());
-      if (anyAttributeExists)
-      {
-        anyAttributeNode = getFirstChildNodeIfExists(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false);
-        attributes = new ArrayList();
-        attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
-        attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-        addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, anyAttributeNode);
-        attributes = null;
-        addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, anyAttributeNode);
-        addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, anyAttributeNode);
-      }
-      else
-      {
-        attributes = new ArrayList();
-        attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
-        attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-        addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, parent.getLastChild());
-        attributes = null;
-        addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, parent.getLastChild());
-        addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, parent.getLastChild());
-      }
-      attributes = null;
-      addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, parent, null);
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.NOTATION_ELEMENT_TAG, false))
-    { //
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, null);
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-    { //
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-      boolean restrictionExists = elementExists(XSDConstants.RESTRICTION_ELEMENT_TAG, parent);
-      boolean unionExists = elementExists(XSDConstants.UNION_ELEMENT_TAG, parent);
-      boolean listExists = elementExists(XSDConstants.LIST_ELEMENT_TAG, parent);
-      if (!(restrictionExists || unionExists || listExists))
-      {
-        attributes = new ArrayList();
-        attributes.add(new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, getBuiltInStringQName()));
-        addCreateElementActionIfNotExist(manager, XSDConstants.RESTRICTION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_RESTRICTION"), attributes, parent, null);
-        attributes = null;
-        attributes = new ArrayList();
-        attributes.add(new DOMAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, getBuiltInStringQName()));
-        addCreateElementActionIfNotExist(manager, XSDConstants.UNION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_UNION"), attributes, parent, null);
-        attributes = null;
-        attributes = new ArrayList();
-        attributes.add(new DOMAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, getBuiltInStringQName()));
-        addCreateElementActionIfNotExist(manager, XSDConstants.LIST_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LIST"), attributes, parent, null);
-        attributes = null;
-      }
-      if (XSDDOMHelper.inputEquals(parent.getParentNode(), XSDConstants.ELEMENT_ELEMENT_TAG, false))
-      {
-        manager.add(new Separator());
-        attributes = new ArrayList();
-        attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("SimpleType")));
-        addMoveAnonymousGlobal(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"), attributes, parent, null);
-        attributes = null;
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.GROUP_ELEMENT_TAG, false))
-    { //
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-      addCreateElementActionIfNotExist(manager, XSDConstants.SEQUENCE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CONTENT_MODEL"), attributes, parent, null);
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
-    { //
-      boolean annotationExists = false;
-      boolean contentExists = false;
-      Node annotationNode = null;
-      NodeList children = parent.getChildNodes();
-      for (int i = 0; i < children.getLength(); i++)
-      {
-        Node child = children.item(i);
-        if (child != null && child instanceof Element)
-        {
-          if (XSDDOMHelper.inputEquals((Element) child, XSDConstants.ANNOTATION_ELEMENT_TAG, false))
-          {
-            annotationNode = child;
-            annotationExists = true;
-          }
-          else if (XSDDOMHelper.inputEquals((Element) child, XSDConstants.SEQUENCE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.ALL_ELEMENT_TAG, false)
-              || XSDDOMHelper.inputEquals((Element) child, XSDConstants.CHOICE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.GROUP_ELEMENT_TAG, true)
-              || XSDDOMHelper.inputEquals((Element) child, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals((Element) child, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-          {
-            contentExists = true;
-          }
-        }
-      }
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-      manager.add(new Separator());
-      addSetBaseTypeAction(manager, parent);
-      XSDConcreteComponent concreteComponent = getXSDSchema().getCorrespondingComponent(parent);
-      if (annotationExists)
-      {
-        if (!contentExists)
-        {
-          if (concreteComponent != null)
-          {
-            AddModelGroupAction addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.SEQUENCE_LITERAL);
-            addModelGroupAction.setEnabled(!isReadOnly);
-            manager.add(addModelGroupAction);
-            
-            addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.CHOICE_LITERAL);
-            addModelGroupAction.setEnabled(!isReadOnly);
-            manager.add(addModelGroupAction);
-            
-            addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.ALL_LITERAL);
-            addModelGroupAction.setEnabled(!isReadOnly);
-            manager.add(addModelGroupAction);
-
-          }
-          addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, annotationNode.getNextSibling());
-          attributes = null;
-        }
-      }
-      else
-      {
-        if (!contentExists)
-        {
-          if (concreteComponent != null)
-          {
-            AddModelGroupAction addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.SEQUENCE_LITERAL);
-            addModelGroupAction.setEnabled(!isReadOnly);
-            manager.add(addModelGroupAction);
-            
-            addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.CHOICE_LITERAL);
-            addModelGroupAction.setEnabled(!isReadOnly);
-            manager.add(addModelGroupAction);
-            
-            addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.ALL_LITERAL);
-            addModelGroupAction.setEnabled(!isReadOnly);
-            manager.add(addModelGroupAction);
-
-          }
-          addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, parent.getFirstChild());
-          attributes = null;
-        }
-      }
-      manager.add(new Separator());
-      if (XSDDOMHelper.inputEquals(parent.getParentNode(), XSDConstants.ELEMENT_ELEMENT_TAG, false))
-      {
-        manager.add(new Separator());
-        attributes = new ArrayList();
-        attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("ComplexType")));
-        addMoveAnonymousGlobal(manager, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"), attributes, parent, null);
-        attributes = null;
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-    { //
-      XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
-      Element derivedByNode = xsdDOMHelper.getDerivedByElement(parent);
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
-          parent.getFirstChild());
-      manager.add(new Separator());
-      if (derivedByNode == null)
-      {
-        TypesHelper typesHelper = new TypesHelper(getXSDSchema());
-        String firstType = "";
-        List listOfCT = typesHelper.getUserComplexTypeNamesList();
-        if (listOfCT.size() > 0)
-        {
-          firstType = (String) (listOfCT).get(0);
-        }
-        attributes = new ArrayList();
-        attributes.add(new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, firstType));
-        addCreateElementActionIfNotExist(manager, XSDConstants.RESTRICTION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_RESTRICTION"), attributes, parent, null);
-        addCreateElementActionIfNotExist(manager, XSDConstants.EXTENSION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_EXTENSION"), attributes, parent, null);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-    { //
-      XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
-      Element derivedByNode = xsdDOMHelper.getDerivedByElement(parent);
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
-          parent.getFirstChild());
-      manager.add(new Separator());
-      if (derivedByNode == null)
-      {
-        TypesHelper typesHelper = new TypesHelper(getXSDSchema());
-        String firstType = "";
-        List listOfCT = typesHelper.getUserComplexTypeNamesList();
-        if (listOfCT.size() > 0)
-        {
-          firstType = (String) (listOfCT).get(0);
-        }
-        attributes = new ArrayList();
-        attributes.add(new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, firstType));
-        addCreateElementActionIfNotExist(manager, XSDConstants.RESTRICTION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_RESTRICTION"), attributes, parent, null);
-        addCreateElementActionIfNotExist(manager, XSDConstants.EXTENSION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_EXTENSION"), attributes, parent, null);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
-    {
-      Element parentNode = (Element) parent.getParentNode();
-      // <simpleContent>
-      //    <restriction>
-      //      ...
-      if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-      {
-        boolean annotationExists = false;
-        boolean anyAttributeExists = false;
-        Node anyAttributeNode = null;
-        anyAttributeExists = elementExists(XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, parent);
-        annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent
-            .getFirstChild());
-        if (annotationExists)
-        {
-          getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
-        }
-
-        manager.add(new Separator());
-        if (anyAttributeExists)
-        {
-          anyAttributeNode = getFirstChildNodeIfExists(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false);
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
-          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, anyAttributeNode);
-          attributes = null;
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, anyAttributeNode);
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, anyAttributeNode);
-        }
-        else
-        {
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
-          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, parent.getLastChild());
-          attributes = null;
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, parent.getLastChild());
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, parent.getLastChild());
-        }
-        attributes = null;
-        addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, parent, parent.getLastChild());
-      }
-      // <simpleType>
-      //    <restriction>
-      //      ...
-      else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-      {
-        boolean annotationExists = false;
-        attributes = null;
-        annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent
-            .getFirstChild());
-        if (annotationExists)
-        {
-          Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
-          addCreateLocalSimpleTypeActionIfNotExist(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE"), attributes, parent, annotationNode
-              .getNextSibling());
-        }
-        else
-        {
-          addCreateLocalSimpleTypeActionIfNotExist(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE"), attributes, parent, parent
-              .getFirstChild());
-        }
-        manager.add(new Separator());
-        addCreateElementAction(manager, XSDConstants.PATTERN_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_PATTERN"), attributes, parent, null);
-        addCreateElementAction(manager, XSDConstants.ENUMERATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ENUM"), attributes, parent, null);
-        addEnumsAction(manager, XSDConstants.ENUMERATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ENUMS"), attributes, parent, null);
-      }
-      // <complexContent>
-      //    <restriction>
-      //      ...
-      else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-      {
-        boolean annotationExists = false;
-        boolean anyAttributeExists = false;
-        Node anyAttributeNode = null;
-        boolean sequenceExists = elementExists(XSDConstants.SEQUENCE_ELEMENT_TAG, parent);
-        boolean choiceExists = elementExists(XSDConstants.CHOICE_ELEMENT_TAG, parent);
-        boolean allExists = elementExists(XSDConstants.ALL_ELEMENT_TAG, parent);
-        boolean groupExists = elementExists(XSDConstants.GROUP_ELEMENT_TAG, parent);
-        anyAttributeExists = elementExists(XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, parent);
-        annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent
-            .getFirstChild());
-        manager.add(new Separator());
-        if (annotationExists)
-        {
-          if (!(sequenceExists || choiceExists || allExists || groupExists))
-          {
-            Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
-            addCreateElementActionIfNotExist(manager, XSDConstants.SEQUENCE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CONTENT_MODEL"), attributes, parent, annotationNode
-                .getNextSibling());
-            addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, annotationNode.getNextSibling());
-          }
-        }
-        else
-        {
-          if (!(sequenceExists || choiceExists || allExists || groupExists))
-          {
-            addCreateElementActionIfNotExist(manager, XSDConstants.SEQUENCE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CONTENT_MODEL"), attributes, parent, parent.getFirstChild());
-            addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, parent.getFirstChild());
-          }
-        }
-        manager.add(new Separator());
-        if (anyAttributeExists)
-        {
-          anyAttributeNode = getFirstChildNodeIfExists(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false);
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
-          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, anyAttributeNode);
-          attributes = null;
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, anyAttributeNode);
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, anyAttributeNode);
-        }
-        else
-        {
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
-          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, parent.getLastChild());
-          attributes = null;
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, parent.getLastChild());
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, parent.getLastChild());
-        }
-        attributes = null;
-        addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, parent, parent.getLastChild());
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.EXTENSION_ELEMENT_TAG, false))
-    {
-      Element parentNode = (Element) parent.getParentNode();
-      // <simpleContent>
-      //    <extension>
-      //      ...
-      if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-      {
-        boolean anyAttributeExists = false;
-        Node anyAttributeNode = null;
-        anyAttributeExists = elementExists(XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, parent);
-        addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent
-            .getFirstChild());
-        manager.add(new Separator());
-        if (anyAttributeExists)
-        {
-          anyAttributeNode = getFirstChildNodeIfExists(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false);
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
-          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, anyAttributeNode);
-          attributes = null;
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, anyAttributeNode);
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, anyAttributeNode);
-        }
-        else
-        {
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
-          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, parent.getLastChild());
-          attributes = null;
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, parent.getLastChild());
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, parent.getLastChild());
-        }
-        attributes = null;
-        addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, parent, parent.getLastChild());
-      }
-      // <complexContent>
-      //    <extension>
-      //      ...
-      else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-      {
-        boolean annotationExists = false;
-        boolean anyAttributeExists = false;
-        Node anyAttributeNode = null;
-        boolean sequenceExists = elementExists(XSDConstants.SEQUENCE_ELEMENT_TAG, parent);
-        boolean choiceExists = elementExists(XSDConstants.CHOICE_ELEMENT_TAG, parent);
-        boolean allExists = elementExists(XSDConstants.ALL_ELEMENT_TAG, parent);
-        boolean groupExists = elementExists(XSDConstants.GROUP_ELEMENT_TAG, parent);
-        anyAttributeExists = elementExists(XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, parent);
-        annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent
-            .getFirstChild());
-        manager.add(new Separator());
-        if (annotationExists)
-        {
-          if (!(sequenceExists || choiceExists || allExists || groupExists))
-          {
-            Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
-            addCreateElementActionIfNotExist(manager, XSDConstants.SEQUENCE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CONTENT_MODEL"), attributes, parent, annotationNode
-                .getNextSibling());
-            addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, annotationNode.getNextSibling());
-          }
-        }
-        else
-        {
-          if (!(sequenceExists || choiceExists || allExists || groupExists))
-          {
-            addCreateElementActionIfNotExist(manager, XSDConstants.SEQUENCE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CONTENT_MODEL"), attributes, parent, parent.getFirstChild());
-            addCreateElementRefAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ADD_GROUP_REF"), parent, parent.getFirstChild());
-          }
-        }
-        manager.add(new Separator());
-        if (anyAttributeExists)
-        {
-          anyAttributeNode = getFirstChildNodeIfExists(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false);
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
-          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, anyAttributeNode);
-          attributes = null;
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, anyAttributeNode);
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, anyAttributeNode);
-        }
-        else
-        {
-          attributes = new ArrayList();
-          attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
-          attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-          addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, parent.getLastChild());
-          attributes = null;
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, parent.getLastChild());
-          addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, parent.getLastChild());
-        }
-        attributes = null;
-        addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, parent, parent.getLastChild());
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.REDEFINE_ELEMENT_TAG, false))
-    { //
-      addCreateElementAction(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, null);
-      addCreateElementAction(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SIMPLE_TYPE"), attributes, parent, null);
-      addCreateElementAction(manager, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_COMPLEX_TYPE"), attributes, parent, null);
-      addCreateGroupAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GROUP"), attributes, parent, null);
-      addCreateElementAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP"), attributes, parent, null);
-      manager.add(new Separator());
-      addOpenSchemaAction(manager, XSDEditorPlugin.getXSDString("_UI_ACTION_OPEN_SCHEMA"), parent);
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.LIST_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
-          parent.getFirstChild());
-      manager.add(new Separator());
-      addCreateLocalSimpleTypeActionIfNotExist(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE"), attributes, parent, null);
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.UNION_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
-          parent.getFirstChild());
-      manager.add(new Separator());
-      addCreateLocalSimpleTypeAction(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE"), attributes, parent, null);
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.UNIQUE_ELEMENT_TAG, false))
-    {
-      boolean annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
-          parent.getFirstChild());
-      manager.add(new Separator());
-      attributes = new ArrayList();
-      attributes.add(new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, ""));
-      if (annotationExists)
-      {
-        Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
-        addCreateElementActionIfNotExist(manager, XSDConstants.SELECTOR_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SELECTOR"), attributes, parent, annotationNode.getNextSibling());
-      }
-      else
-      {
-        addCreateElementActionIfNotExist(manager, XSDConstants.SELECTOR_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SELECTOR"), attributes, parent, parent.getFirstChild());
-      }
-      attributes = new ArrayList();
-      attributes.add(new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, ""));
-      addCreateElementAction(manager, XSDConstants.FIELD_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_FIELD"), attributes, parent, null);
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.KEYREF_ELEMENT_TAG, false))
-    {
-      boolean annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
-          parent.getFirstChild());
-      manager.add(new Separator());
-      attributes = new ArrayList();
-      attributes.add(new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, ""));
-      if (annotationExists)
-      {
-        Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
-        addCreateElementActionIfNotExist(manager, XSDConstants.SELECTOR_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SELECTOR"), attributes, parent, annotationNode.getNextSibling());
-      }
-      else
-      {
-        addCreateElementActionIfNotExist(manager, XSDConstants.SELECTOR_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SELECTOR"), attributes, parent, parent.getFirstChild());
-      }
-      attributes = new ArrayList();
-      attributes.add(new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, ""));
-      addCreateElementAction(manager, XSDConstants.FIELD_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_FIELD"), attributes, parent, null);
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.KEY_ELEMENT_TAG, false))
-    {
-      boolean annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
-          parent.getFirstChild());
-      manager.add(new Separator());
-      attributes = new ArrayList();
-      attributes.add(new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, ""));
-      if (annotationExists)
-      {
-        Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
-        addCreateElementActionIfNotExist(manager, XSDConstants.SELECTOR_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SELECTOR"), attributes, parent, annotationNode.getNextSibling());
-      }
-      else
-      {
-        addCreateElementActionIfNotExist(manager, XSDConstants.SELECTOR_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SELECTOR"), attributes, parent, parent.getFirstChild());
-      }
-      attributes = new ArrayList();
-      attributes.add(new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, ""));
-      addCreateElementAction(manager, XSDConstants.FIELD_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_FIELD"), attributes, parent, null);
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.IMPORT_ELEMENT_TAG, false))
-    {
-      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-      manager.add(new Separator());
-      addOpenSchemaAction(manager, XSDEditorPlugin.getXSDString("_UI_ACTION_OPEN_SCHEMA"), parent);
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.SELECTOR_ELEMENT_TAG, false))
-    {
-      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.FIELD_ELEMENT_TAG, false))
-    {
-      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.INCLUDE_ELEMENT_TAG, false))
-    {
-      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-      manager.add(new Separator());
-      addOpenSchemaAction(manager, XSDEditorPlugin.getXSDString("_UI_ACTION_OPEN_SCHEMA"), parent);
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ANY_ELEMENT_TAG, false))
-    {
-      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-      // need to add adapters for the ANY element.  I'd rather not provide this menu
-      // and let users see that the graph view doesn't update
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false))
-    {
-      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
-    {
-      addCreateElementActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-      addCreateLocalSimpleTypeActionIfNotExist(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE"), attributes, parent, null);
-    }
-    // Facets all have optional annotation nodes
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.MINEXCLUSIVE_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.MININCLUSIVE_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.MAXEXCLUSIVE_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.MAXINCLUSIVE_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.TOTALDIGITS_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.FRACTIONDIGITS_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.LENGTH_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.MINLENGTH_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.MAXLENGTH_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ENUMERATION_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.WHITESPACE_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.PATTERN_ELEMENT_TAG, false))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
-    {
-      addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent, parent.getFirstChild());
-    }
-    else if (XSDDOMHelper.inputEquals(parent, XSDConstants.ELEMENT_ELEMENT_TAG, true))
-    {
-      XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)getXSDSchema().getCorrespondingComponent(parent);
-      if (xsdConcreteComponent instanceof XSDElementDeclaration)
-      {
-        XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)xsdConcreteComponent;
-        XSDElementDeclaration resolvedElementDeclaration = xsdElementDeclaration.getResolvedElementDeclaration();
-        if (resolvedElementDeclaration.getRootContainer() == xsdSchema)
-        {
-          parent = resolvedElementDeclaration.getElement(); 
-        
-          boolean annotationExists = addCreateAnnotationActionIfNotExist(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), attributes, parent,
-              parent.getFirstChild());
-          boolean simpleTypeExists = elementExists(XSDConstants.SIMPLETYPE_ELEMENT_TAG, parent);
-          boolean complexTypeExists = elementExists(XSDConstants.COMPLEXTYPE_ELEMENT_TAG, parent);
-          manager.add(new Separator());
-          if (annotationExists)
-          {
-            Node annotationNode = getFirstChildNodeIfExists(parent, XSDConstants.ANNOTATION_ELEMENT_TAG, false);
-            if (!(simpleTypeExists || complexTypeExists) && annotationNode != null)
-            {
-              manager.add(new Separator());
-            }
-          }
-          else
-          {
-            XSDConcreteComponent concreteComponent = getXSDSchema().getCorrespondingComponent(parent);
-            if (concreteComponent != null)
-            {
-              AddModelGroupAction addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.SEQUENCE_LITERAL);
-              addModelGroupAction.setEnabled(!isReadOnly);
-              manager.add(addModelGroupAction);
-              
-              addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.CHOICE_LITERAL);
-              addModelGroupAction.setEnabled(!isReadOnly);
-              manager.add(addModelGroupAction);
-              
-              addModelGroupAction = new AddModelGroupAction(concreteComponent, XSDCompositor.ALL_LITERAL);
-              addModelGroupAction.setEnabled(!isReadOnly);
-              manager.add(addModelGroupAction);
-              
-              manager.add(new Separator());
-            }
-          }
-          XSDDOMHelper domHelper = new XSDDOMHelper();
-          Element anonymousType = (Element) domHelper.getChildNode(parent, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-          if (anonymousType != null)
-          {
-            manager.add(new Separator());
-            attributes = new ArrayList();
-            attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("ComplexType")));
-            addMoveAnonymousGlobal(manager, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"), attributes, anonymousType, null);
-            attributes = null;
-          }
-          anonymousType = (Element) domHelper.getChildNode(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-          if (anonymousType != null)
-          {
-            manager.add(new Separator());
-            attributes = new ArrayList();
-            attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("SimpleType")));
-            addMoveAnonymousGlobal(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"), attributes, anonymousType, null);
-            attributes = null;
-          }
-        }
-        addMultiplicityMenu(xsdConcreteComponent, manager);
-      }
-    }
-   
-    XSDConcreteComponent concreteComponent = getXSDSchema().getCorrespondingComponent(parent);
-    if (concreteComponent instanceof XSDNamedComponent)
-    {
-      addRefactorMenuGroup(manager);
-    }
-  }
-
-  protected void addContextInsertItems(IMenuManager manager, Element parent, Element currentElement, Node relativeNode)
-  {
-    ArrayList attributes = null;
-    if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.INCLUDE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals(currentElement, XSDConstants.IMPORT_ELEMENT_TAG, false)
-        || XSDDOMHelper.inputEquals(currentElement, XSDConstants.REDEFINE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals(currentElement, XSDConstants.ANNOTATION_ELEMENT_TAG, false))
-    {
-      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-      {
-        attributes = new ArrayList();
-        attributes.add(new DOMAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, ""));
-        addCreateElementAction(manager, XSDConstants.INCLUDE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_INCLUDE"), attributes, parent, relativeNode);
-        addCreateElementAction(manager, XSDConstants.IMPORT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_IMPORT"), null, parent, relativeNode);
-        addCreateElementAction(manager, XSDConstants.REDEFINE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_REDEFINE"), attributes, parent, relativeNode);
-        attributes = null;
-        addCreateElementAction(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), null, parent, relativeNode);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-    {
-      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-      {
-        addSchemaElementItems(manager, parent, relativeNode);
-      }
-      else if (XSDDOMHelper.inputEquals(parent, XSDConstants.UNION_ELEMENT_TAG, false))
-      {
-        addCreateLocalSimpleTypeAction(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE"), attributes, parent, relativeNode);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
-    {
-      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-      {
-        addSchemaElementItems(manager, parent, relativeNode);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.GROUP_ELEMENT_TAG, false))
-    {
-      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-      {
-        addSchemaElementItems(manager, parent, relativeNode);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false))
-    {
-      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-      {
-        addSchemaElementItems(manager, parent, relativeNode);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.ELEMENT_ELEMENT_TAG, false))
-    {
-      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-      {
-        addSchemaElementItems(manager, parent, relativeNode);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
-    {
-      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-      {
-        addSchemaElementItems(manager, parent, relativeNode);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.NOTATION_ELEMENT_TAG, false))
-    {
-      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-      {
-        addSchemaElementItems(manager, parent, relativeNode);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.DOCUMENTATION_ELEMENT_TAG, false))
-    {
-      addCreateElementAction(manager, XSDConstants.DOCUMENTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_DOC"), attributes, parent, relativeNode);
-      addCreateElementAction(manager, XSDConstants.APPINFO_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_APP_INFO"), attributes, parent, relativeNode);
-    }
-    else if (XSDDOMHelper.inputEquals(currentElement, XSDConstants.APPINFO_ELEMENT_TAG, false))
-    {
-      addCreateElementAction(manager, XSDConstants.DOCUMENTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_DOC"), attributes, parent, relativeNode);
-      addCreateElementAction(manager, XSDConstants.APPINFO_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_APP_INFO"), attributes, parent, relativeNode);
-    }
-  }
-
-  protected String getNewGlobalName(String elementTag, String description)
-  {
-    return getNewGlobalName(elementTag, description, false);
-  }
-
-  protected String getNewGlobalTypeName(String description)
-  {
-    return getNewGlobalName(null, description, true);
-  }
-
-  protected String getNewGlobalName(String elementTag, String description, boolean isSimpleOrComplexType)
-  {  
-     return getNewName(getXSDSchema().getDocument(), elementTag, description, isSimpleOrComplexType);
-  }
-
-  // TODO.. .we need to rewrite this code to me model driven... not document driven
-  //
-  protected String getNewName(Node parentNode, String elementTag, String description, boolean isSimpleOrComplexType)
-  {
-    NodeList list = null;
-    NodeList typeList2 = null;
-    // if the global name is for a simple or complex type, we ignore the
-    // elementTag and populate 2 lists
-    // one to look for all simple types and the other to look for all complex
-    // types
-    if (isSimpleOrComplexType)
-    {
-      if (parentNode instanceof Document)
-      {
-        list = ((Document) parentNode).getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-        typeList2 = ((Document) parentNode).getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-      }
-      else if (parentNode instanceof Element)
-      {
-        list = ((Element) parentNode).getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-        typeList2 = ((Element) parentNode).getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-      }
-    }
-    else
-    {
-      if (parentNode instanceof Document)
-      {
-        list = ((Document) parentNode).getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, elementTag);
-      }
-      else if (parentNode instanceof Element)
-      {
-        list = ((Element) parentNode).getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, elementTag);
-      }
-    }
-    String name = "New" + description;
-    if (list == null || list.getLength() == 0 && (typeList2 != null && typeList2.getLength() == 0))
-    {
-      return name;
-    }
-    for (int i = 1; i < 100; i++)
-    {
-      boolean newName = false;
-      for (int j = 0; j < list.getLength(); j++)
-      {
-        String currName = ((Element) list.item(j)).getAttribute(XSDConstants.NAME_ATTRIBUTE);
-        if (currName == null || currName.length() == 0)
-        {
-          continue;
-        }
-        if (currName.equals(name))
-        {
-          name = "New" + description + String.valueOf(i);
-          newName = true;
-          break;
-        }
-      }
-      // if there is another type list and we haven't created a new name, then
-      // check the type list
-      if (typeList2 != null && !newName)
-      {
-        for (int j = 0; j < typeList2.getLength(); j++)
-        {
-          String currName = ((Element) typeList2.item(j)).getAttribute(XSDConstants.NAME_ATTRIBUTE);
-          if (currName == null || currName.length() == 0)
-          {
-            continue;
-          }
-          if (currName.equals(name))
-          {
-            name = "New" + description + String.valueOf(i);
-            break;
-          }
-        }
-      }
-    }
-    return name;
-  }
-
-  protected String getFirstGlobalElementTagName(String elementTag)
-  {
-    //XMLModel model = getXMLModel();
-    //if (model != null)
-    {
-      XSDSchema schema = getXSDSchema();
-      TypesHelper helper = new TypesHelper(schema);
-      String prefix = "";
-      if (schema != null)
-      {
-        prefix = helper.getPrefix(schema.getTargetNamespace(), true);
-      }
-      // get the schema node
-      NodeList slist = schema.getDocument().getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, XSDConstants.SCHEMA_ELEMENT_TAG);
-      Node schemaNode = null;
-      if (slist != null && slist.getLength() > 0)
-      {
-        schemaNode = slist.item(0);
-      }
-      NodeList list = null;
-      // get the schema's direct children - hence, globals
-      if (schemaNode != null)
-      {
-        list = schemaNode.getChildNodes();
-      }
-      String name = null;
-      if (list != null)
-      {
-        for (int i = 0; i < list.getLength(); i++)
-        {
-          if (list.item(i) instanceof Element)
-          {
-            if (list.item(i).getLocalName().equals(elementTag))
-            {
-              name = ((Element) list.item(i)).getAttribute(XSDConstants.NAME_ATTRIBUTE);
-              if (name != null && name.length() > 0)
-              {
-                return prefix + name;
-              }
-            }
-          }
-        }
-      }
-      if (elementTag.equals(XSDConstants.ELEMENT_ELEMENT_TAG))
-      {
-        return helper.getGlobalElement(schema);
-      }
-      else if (elementTag.equals(XSDConstants.ATTRIBUTE_ELEMENT_TAG))
-      {
-        return helper.getGlobalAttribute(schema);
-      }
-      else if (elementTag.equals(XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG))
-      {
-        return helper.getGlobalAttributeGroup(schema);
-      }
-      else if (elementTag.equals(XSDConstants.GROUP_ELEMENT_TAG))
-      {
-        return helper.getModelGroup(schema);
-      }
-    }
-    return null;
-  }
-
-  protected void addSchemaElementItems(IMenuManager manager, Element parent, Node relativeNode)
-  {
-    ArrayList attributes = null;
-    // Add Edit Namespaces menu action
-    XSDEditNamespacesAction nsAction = new XSDEditNamespacesAction(XSDEditorPlugin.getXSDString("_UI_ACTION_EDIT_NAMESPACES"), parent, relativeNode, getXSDSchema());
-    manager.add(nsAction);
-    manager.add(new Separator());
-    DOMAttribute nameAttribute = new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("ComplexType"));
-    attributes = new ArrayList();
-    attributes.add(nameAttribute);
-    Action action = addCreateElementAction(manager, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_COMPLEX_TYPE"), attributes, parent, relativeNode);
-    ((CreateElementAction) action).setIsGlobal(true);
-    attributes = new ArrayList();
-    attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalTypeName("SimpleType")));
-    action = addCreateElementAction(manager, XSDConstants.SIMPLETYPE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SIMPLE_TYPE"), attributes, parent, relativeNode);
-    ((CreateElementAction) action).setIsGlobal(true);
-    attributes = new ArrayList();
-    attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.ELEMENT_ELEMENT_TAG, "GlobalElement")));
-    attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-    action = addCreateElementAction(manager, XSDConstants.ELEMENT_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GLOBAL_ELEMENT"), attributes, parent, relativeNode);
-    ((CreateElementAction) action).setIsGlobal(true);
-    attributes = new ArrayList();
-    attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.ATTRIBUTE_ELEMENT_TAG, "GlobalAttribute")));
-    attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-    action = addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GLOBAL_ATTRIBUTE"), attributes, parent, relativeNode);
-    ((CreateElementAction) action).setIsGlobal(true);
-    attributes = new ArrayList();
-    attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, "AttributeGroup")));
-    action = addCreateElementAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP"), attributes, parent, relativeNode);
-    ((CreateElementAction) action).setIsGlobal(true);
-    attributes = new ArrayList();
-    attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.GROUP_ELEMENT_TAG, "Group")));
-    CreateGroupAction groupAction = addCreateGroupAction(manager, XSDConstants.GROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_GROUP"), attributes, parent, relativeNode);
-    groupAction.setIsGlobal(true);
-    attributes = new ArrayList();
-    attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE, getNewGlobalName(XSDConstants.NOTATION_ELEMENT_TAG, "Notation")));
-    attributes.add(new DOMAttribute(XSDConstants.PUBLIC_ATTRIBUTE, ""));
-    action = addCreateElementAction(manager, XSDConstants.NOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_NOTATION"), attributes, parent, relativeNode);
-    ((CreateElementAction) action).setIsGlobal(true);
-    action = addCreateElementAction(manager, XSDConstants.ANNOTATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANNOTATION"), null, parent, relativeNode);
-    ((CreateElementAction) action).setIsGlobal(true);
-  }
-
-  // returns whether element exists already
-  protected boolean addCreateElementActionIfNotExist(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    if (getFirstChildNodeIfExists(parent, elementTag, false) == null)
-    {
-      addCreateElementAction(manager, elementTag, label, attributes, parent, relativeNode);
-      return false;
-    }
-    return true;
-  }
-
-  protected Action addCreateElementAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    CreateElementAction action = new CreateElementAction(label);
-    action.setElementTag(elementTag);
-    action.setAttributes(attributes);
-    action.setParentNode(parent);
-    action.setRelativeNode(relativeNode);
-    action.setXSDSchema(getXSDSchema());
-    action.setSelectionProvider(selectionProvider);
-    action.setEnabled(!isReadOnly);
-    action.setSourceContext(sourceContext);
-    manager.add(action);
-    return action;
-  }
-
-  protected void addCreateElementAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode, boolean isEnabled)
-  {
-    Action action = addCreateElementAction(manager, elementTag, label, attributes, parent, relativeNode);
-    action.setEnabled(isEnabled);
-  }
-
-  protected void addCreateElementRefAction(IMenuManager manager, String elementTag, String label, Element parent, Node relativeNode)
-  {
-    ArrayList attributes = new ArrayList();
-    String ref = getFirstGlobalElementTagName(elementTag);
-    attributes.add(new DOMAttribute(XSDConstants.REF_ATTRIBUTE, ref));
-    Action action = addCreateElementAction(manager, elementTag, label, attributes, parent, relativeNode);
-    action.setEnabled(ref != null && !isReadOnly);
-  }
-
-  protected void addCreateSimpleContentAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    if (getFirstChildNodeIfExists(parent, elementTag, false) == null)
-    {
-      CreateSimpleContentAction action = new CreateSimpleContentAction(label, getXSDSchema());
-      action.setElementTag(elementTag);
-      action.setAttributes(attributes);
-      action.setParentNode(parent);
-      action.setRelativeNode(relativeNode);
-      action.setEnabled(!isReadOnly);
-      manager.add(action);
-    }
-  }
-
-  protected CreateGroupAction addCreateGroupAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    CreateGroupAction action = new CreateGroupAction(label, getXSDSchema());
-    action.setElementTag(elementTag);
-    action.setAttributes(attributes);
-    action.setParentNode(parent);
-    action.setRelativeNode(relativeNode);
-    action.setXSDSchema(getXSDSchema());
-    action.setSelectionProvider(selectionProvider);
-    action.setEnabled(!isReadOnly);
-    action.setSourceContext(sourceContext);
-    manager.add(action);
-    return action;
-  }
-
-  protected void addCreateIdentityConstraintsAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    CreateIdentityConstraintsAction action = new CreateIdentityConstraintsAction(label, getXSDSchema());
-    action.setElementTag(elementTag);
-    action.setAttributes(attributes);
-    action.setParentNode(parent);
-    action.setRelativeNode(relativeNode);
-    action.setXSDSchema(getXSDSchema());
-    action.setSelectionProvider(selectionProvider);
-    action.setEnabled(!isReadOnly);
-    manager.add(action);
-  }
-
-  protected void addEnumsAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    AddEnumsAction action = new AddEnumsAction(label);
-    action.setElementTag(elementTag);
-    action.setAttributes(attributes);
-    action.setParentNode(parent);
-    action.setRelativeNode(relativeNode);
-    action.setDescription(XSDEditorPlugin.getXSDString("_UI_ENUMERATIONS_DIALOG_TITLE"));
-    action.setEnabled(!isReadOnly);
-    manager.add(action);
-  }
-
-  protected Action addCreateSimpleTypeAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    CreateSimpleTypeAction action = new CreateSimpleTypeAction(label);
-    action.setElementTag(elementTag);
-    action.setAttributes(attributes);
-    action.setParentNode(parent);
-    action.setRelativeNode(relativeNode);
-    action.setXSDSchema(getXSDSchema());
-    action.setSelectionProvider(selectionProvider);
-    action.setEnabled(!isReadOnly);
-    action.setSourceContext(sourceContext);
-    manager.add(action);
-    return action;
-  }
-
-  protected boolean addCreateLocalSimpleTypeActionIfNotExist(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    if (getFirstChildNodeIfExists(parent, elementTag, false) == null)
-    {
-      addCreateLocalSimpleTypeAction(manager, elementTag, label, attributes, parent, relativeNode);
-      return false;
-    }
-    return true;
-  }
-
-  protected void addSetBaseTypeAction(IMenuManager manager, Element element)
-  {
-    SetBaseTypeAction action = new SetBaseTypeAction(XSDEditorPlugin.getXSDString("_UI_ACTION_SET_BASE_TYPE"));// +
-    // "...");
-    action.setComplexTypeElement(element);
-    action.setXSDSchema(getXSDSchema());
-    action.setEnabled(!isReadOnly);
-    manager.add(action);
-  }
-
-  protected void addCreateLocalSimpleTypeAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    CreateLocalSimpleTypeAction action = new CreateLocalSimpleTypeAction(label);
-    action.setElementTag(elementTag);
-    action.setAttributes(attributes);
-    action.setParentNode(parent);
-    action.setRelativeNode(relativeNode);
-    action.setXSDSchema(getXSDSchema());
-    action.setSelectionProvider(selectionProvider);
-    action.setEnabled(!isReadOnly);
-    manager.add(action);
-  }
-
-  protected boolean addCreateLocalComplexTypeActionIfNotExist(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    if (getFirstChildNodeIfExists(parent, elementTag, false) == null)
-    {
-      addCreateLocalComplexTypeAction(manager, elementTag, label, attributes, parent, relativeNode);
-      return false;
-    }
-    return true;
-  }
-
-  protected void addCreateLocalComplexTypeAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    CreateLocalComplexTypeAction action = new CreateLocalComplexTypeAction(label);
-    action.setElementTag(elementTag);
-    action.setAttributes(attributes);
-    action.setParentNode(parent);
-    action.setRelativeNode(relativeNode);
-    action.setXSDSchema(getXSDSchema());
-    action.setSelectionProvider(selectionProvider);
-    action.setEnabled(!isReadOnly);
-    manager.add(action);
-  }
-
-  protected boolean addCreateAnnotationActionIfNotExist(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    return false;
-  }
-
-  protected void addOpenSchemaAction(IMenuManager manager, String label, Element parent)
-  {
-    OpenSchemaAction openAction = new OpenSchemaAction(label, getXSDSchema().getCorrespondingComponent(parent));
-    manager.add(openAction);
-  }
-
-  protected void addMoveAnonymousGlobal(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-//    MakeAnonymousGlobal action = new MakeAnonymousGlobal(label, parent, getXSDSchema());
-//    action.setElementTag(elementTag);
-//    action.setAttributes(attributes);
-//    action.setParentNode(getXSDSchema().getElement());
-//    action.setRelativeNode(relativeNode);
-//    action.setEnabled(!isReadOnly);
-//    //manager.add(action);
-//    addRefactorMenuGroup(manager);
-//    fRefactorMenuGroup.addAction(action);
-  }
-  
-  protected void addRefactorMenuGroup(IMenuManager manager){
-	  	fRefactorMenuGroup = new RefactorActionGroup(selectionProvider, getXSDSchema());
-     	ActionContext context= new ActionContext(selectionProvider.getSelection());
-    	fRefactorMenuGroup.setContext(context);
-    	fRefactorMenuGroup.fillContextMenu(manager);
-    	fRefactorMenuGroup.setContext(null);
-  }
-
-  protected void addCreateAnnotationAction(IMenuManager manager, String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    CreateAnnotationAction action = new CreateAnnotationAction(label);
-    action.setElementTag(elementTag);
-    action.setAttributes(attributes);
-    action.setParentNode(parent);
-    action.setRelativeNode(relativeNode);
-    action.setEnabled(!isReadOnly);
-    manager.add(action);
-  }
-
-  protected Node getFirstChildNodeIfExists(Node parent, String elementTag, boolean isRef)
-  {
-    if (parent == null)
-      return null;
-    NodeList children = parent.getChildNodes();
-    Node targetNode = null;
-    for (int i = 0; i < children.getLength(); i++)
-    {
-      Node child = children.item(i);
-      if (child != null && child instanceof Element)
-      {
-        if (XSDDOMHelper.inputEquals((Element) child, elementTag, isRef))
-        {
-          targetNode = child;
-          break;
-        }
-      }
-    }
-    return targetNode;
-  }
-
-  protected boolean elementExists(String elementTag, Element parent)
-  {
-    if (!(parent.getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, elementTag).getLength() > 0))
-    {
-      return false;
-    }
-    return true;
-  }
-
-  /**
-   * Returns the deleteAction.
-   * 
-   * @return DeleteAction
-   */
-  public DeleteAction getDeleteAction()
-  {
-    return deleteAction;
-  }
-  
-  protected void addMultiplicityMenu(XSDConcreteComponent concreteComponent, IMenuManager manager)
-  {
-    SetMultiplicityAction oneMultiplicity = new SetMultiplicityAction(concreteComponent, "1");
-    oneMultiplicity.setMaxOccurs(1);
-    oneMultiplicity.setMinOccurs(1);
-    oneMultiplicity.setEnabled(!isReadOnly);
-    SetMultiplicityAction zeroOrMoreMultiplicity = new SetMultiplicityAction(concreteComponent, "0..* (" + XSDEditorPlugin.getXSDString("_ZERO_OR_MORE") + ")");
-    zeroOrMoreMultiplicity.setMaxOccurs(-1);
-    zeroOrMoreMultiplicity.setMinOccurs(0);
-    zeroOrMoreMultiplicity.setEnabled(!isReadOnly);
-    SetMultiplicityAction zeroOrOneMultiplicity = new SetMultiplicityAction(concreteComponent, "0..1 (" + XSDEditorPlugin.getXSDString("_ZERO_OR_ONE") + ")");
-    zeroOrOneMultiplicity.setMaxOccurs(1);
-    zeroOrOneMultiplicity.setMinOccurs(0);
-    zeroOrOneMultiplicity.setEnabled(!isReadOnly);
-    SetMultiplicityAction oneOrMoreMultiplicity = new SetMultiplicityAction(concreteComponent, "1..* (" + XSDEditorPlugin.getXSDString("_ONE_OR_MORE") + ")");
-    oneOrMoreMultiplicity.setMaxOccurs(-1);
-    oneOrMoreMultiplicity.setMinOccurs(1);
-    oneOrMoreMultiplicity.setEnabled(!isReadOnly);
-    
-    MenuManager multiplicityMenu = new MenuManager(XSDEditorPlugin.getXSDString("_UI_ACTION_SET_MULTIPLICITY"));
-    manager.add(multiplicityMenu);
-    multiplicityMenu.add(oneMultiplicity);
-    multiplicityMenu.add(zeroOrOneMultiplicity);
-    multiplicityMenu.add(zeroOrMoreMultiplicity);
-    multiplicityMenu.add(oneOrMoreMultiplicity);    
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMultiPageEditorPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMultiPageEditorPart.java
deleted file mode 100644
index 009efb1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDMultiPageEditorPart.java
+++ /dev/null
@@ -1,645 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.wst.common.ui.provisional.editors.PostMultiPageEditorSite;
-import org.eclipse.wst.common.ui.provisional.editors.PostSelectionMultiPageEditorPart;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.xml.core.internal.provisional.IXMLPreferenceNames;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.ui.internal.provisional.IDOMSourceEditingTextTools;
-import org.eclipse.wst.xml.ui.internal.tabletree.XMLEditorMessages;
-import org.w3c.dom.Document;
-
-public class XSDMultiPageEditorPart extends PostSelectionMultiPageEditorPart implements IPropertyListener
-{
-
-  /**
-   * 
-   */
-  public XSDMultiPageEditorPart()
-  {
-    super();
-  }
-  
-  /**
-   * Internal part activation listener
-   */
-  class PartListener extends ShellAdapter implements IPartListener {
-    private IWorkbenchPart fActivePart;
-    private boolean fIsHandlingActivation = false;
-
-    private void handleActivation() {
-
-      if (fIsHandlingActivation)
-        return;
-
-      if (fActivePart == XSDMultiPageEditorPart.this) {
-        fIsHandlingActivation = true;
-        try {
-          safelySanityCheckState();
-        }
-        finally {
-          fIsHandlingActivation = false;
-        }
-      }
-    }
-
-    /**
-     * @see IPartListener#partActivated(IWorkbenchPart)
-     */
-    public void partActivated(IWorkbenchPart part) {
-      fActivePart = part;
-      handleActivation();
-    }
-
-    /**
-     * @see IPartListener#partBroughtToTop(IWorkbenchPart)
-     */
-    public void partBroughtToTop(IWorkbenchPart part) {
-    }
-
-    /**
-     * @see IPartListener#partClosed(IWorkbenchPart)
-     */
-    public void partClosed(IWorkbenchPart part) {
-    }
-
-    /**
-     * @see IPartListener#partDeactivated(IWorkbenchPart)
-     */
-    public void partDeactivated(IWorkbenchPart part) {
-      fActivePart = null;
-    }
-
-    /**
-     * @see IPartListener#partOpened(IWorkbenchPart)
-     */
-    public void partOpened(IWorkbenchPart part) {
-    }
-
-    /*
-     * @see ShellListener#shellActivated(ShellEvent)
-     */
-    public void shellActivated(ShellEvent e) {
-      handleActivation();
-    }
-  }
-
-  class TextInputListener implements ITextInputListener {
-    public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
-    }
-
-    public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
-    }
-  }
-
-  /** The source page index. */
-  private int fSourcePageIndex;
-  /** The text editor. */
-  private StructuredTextEditor fTextEditor;
-
-  private PartListener partListener;
-
-
-  /*
-   * This method is just to make firePropertyChanged accessbible from some
-   * (anonomous) inner classes.
-   */
-  protected void _firePropertyChange(int property) {
-    super.firePropertyChange(property);
-  }
-
-  /**
-   * Adds the source page of the multi-page editor.
-   */
-  protected void addSourcePage() throws PartInitException {
-    try {
-      fSourcePageIndex = addPage(fTextEditor, getEditorInput());
-      setPageText(fSourcePageIndex, XSDEditorPlugin.getXSDString("_UI_TAB_SOURCE")); //$NON-NLS-1$
-      // the update's critical, to get viewer selection manager and
-      // highlighting to work
-      fTextEditor.update();
-  
-      firePropertyChange(PROP_TITLE);
-  
-      // Changes to the Text Viewer's document instance should also force an
-      // input refresh
-      fTextEditor.getTextViewer().addTextInputListener(new TextInputListener());
-    }
-    catch (PartInitException e) {
-      // dispose editor
-      dispose();
-
-		// log for now, unless we find reason not to
-		Logger.log(Logger.INFO, e.getMessage());
-    }
-  }
-
-
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.part.MultiPageEditorPart#createPages()
-   */
-  protected void createPages()
-  {
-    try
-    {
-      // source page MUST be created before design page, now
-      createSourcePage();
-      addSourcePage();
-      setActivePage();
-
-    // future_TODO: add a catch block here for any exception the design
-    // page throws and convert it into a more informative message.
-    }
-    catch (PartInitException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  /**
-   * @see org.eclipse.ui.part.MultiPageEditorPart#createSite(org.eclipse.ui.IEditorPart)
-   */
-  protected IEditorSite createSite(IEditorPart editor) {
-    IEditorSite site = null;
-    if (editor == fTextEditor) {
-			site = new PostMultiPageEditorSite(this, editor) {
-				public IEditorActionBarContributor getActionBarContributor() {
-					IEditorActionBarContributor contributor = super.getActionBarContributor();
-					XSDMultiPageEditorPart.this.getEditorSite().getActionBarContributor();
-					return contributor;
-				}
-				
-				public String getId() {
-					// sets this id so nested editor is considered xml source
-					// page
-					return ContentTypeIdForXML.ContentTypeID_XML + ".source"; //$NON-NLS-1$;
-				}
-			};
-		}
-    else {
-      site = super.createSite(editor);
-    }
-    return site;
-  }
-
-  /**
-   * Creates the source page of the multi-page editor.
-   */
-  protected void createSourcePage() throws PartInitException {
-    fTextEditor = createTextEditor();
-    fTextEditor.setEditorPart(this);
-
-    // Set the SourceViewerConfiguration now so the text editor won't use
-    // the default configuration first
-    // and switch to the StructuredTextViewerConfiguration later.
-    // DMW removed setSourceViewerConfiguration 3/26/2003 since added
-    // createPartControl to our text editor.
-    // fTextEditor.setSourceViewerConfiguration();
-    fTextEditor.addPropertyListener(this);
-  }
-
-  /**
-   * Method createTextEditor.
-   * 
-   * @return StructuredTextEditor
-   */
-  protected StructuredTextEditor createTextEditor() {
-    return new StructuredTextEditor();
-  }
-
-  public void dispose()
-  {
-    IWorkbenchWindow window = getSite().getWorkbenchWindow();
-    window.getPartService().removePartListener(partListener);
-    window.getShell().removeShellListener(partListener);
-
-    getSite().getPage().removePartListener(partListener);
-    if (fTextEditor != null) {
-      fTextEditor.removePropertyListener(this);
-    }
-    fTextEditor = null;
-
-    // moved to last when added window ... seems like
-    // we'd be in danger of losing some data, like site,
-    // or something.
-    super.dispose();
-  }
-
-  /*
-   * (non-Javadoc) Saves the contents of this editor. <p> Subclasses must
-   * override this method to implement the open-save-close lifecycle for an
-   * editor. For greater details, see <code> IEditorPart </code></p>
-   * 
-   * @see IEditorPart
-   */
-  public void doSave(IProgressMonitor monitor) {
-    fTextEditor.doSave(monitor);
-    //    // this is a temporary way to force validation.
-    //    // when the validator is a workbench builder, the following lines
-    // can be removed
-    //    if (fDesignViewer != null)
-    //      fDesignViewer.saveOccurred();
-
-  }
-
-  /*
-   * (non-Javadoc) Saves the contents of this editor to another object. <p>
-   * Subclasses must override this method to implement the open-save-close
-   * lifecycle for an editor. For greater details, see <code> IEditorPart
-   * </code></p>
-   * 
-   * @see IEditorPart
-   */
-  public void doSaveAs() {
-    fTextEditor.doSaveAs();
-    // 253619
-    // following used to be executed here, but is
-    // now called "back" from text editor (since
-    // mulitiple paths to the performSaveAs in StructuredTextEditor.
-    //doSaveAsForStructuredTextMulitPagePart();
-  }
-
-	private void editorInputIsAcceptable(IEditorInput input) throws PartInitException {
-		if (input instanceof IFileEditorInput) {
-			// verify that it can be opened
-			CoreException[] coreExceptionArray = new CoreException[1];
-			if (fileDoesNotExist((IFileEditorInput) input, coreExceptionArray)) {
-				CoreException coreException = coreExceptionArray[0];
-				if (coreException.getStatus().getCode() == IResourceStatus.FAILED_READ_LOCAL) {
-					// I'm assuming this is always 'does not exist'
-					// we'll refresh local go mimic behavior of default
-					// editor, where the
-					// troublesome file is refreshed (and will cause it to
-					// 'disappear' from Navigator.
-					try {
-						((IFileEditorInput) input).getFile().refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
-					} catch (CoreException ce) {
-						// very unlikely
-						Logger.logException(ce);
-					}
-					throw new PartInitException(NLS.bind(XMLEditorMessages.Resource__does_not_exist, (new Object[]{input.getName()})));
-				} else {
-					throw new PartInitException(NLS.bind(XMLEditorMessages.Editor_could_not_be_open, (new Object[]{input.getName()})));
-				}
-			}
-		} else if (input instanceof IStorageEditorInput) {
-			InputStream contents = null;
-			try {
-				contents = ((IStorageEditorInput) input).getStorage().getContents();
-			} catch (CoreException noStorageExc) {
-			}
-			if (contents == null) {
-				throw new PartInitException(NLS.bind(XMLEditorMessages.Editor_could_not_be_open, (new Object[]{input.getName()})));
-			} else {
-				try {
-					contents.close();
-				} catch (IOException e) {
-				}
-			}
-		}
-	}
-
-  //  void doSaveAsForStructuredTextMulitPagePart() {
-  //    setPageText(getActivePage(), fTextEditor.getTitle());
-  //    setInput(fTextEditor.getEditorInput());
-  //    if (fDesignViewer != null) {
-  //      //fDesignViewer.setEditorInput(fTextEditor.getEditorInput());
-  //      fDesignViewer.setModel(getModel());
-  //      fDesignViewer.saveAsOccurred();
-  //    }
-  //    // even though we've set title etc., several times already!
-  //    // only now is all prepared for it.
-  //    firePropertyChange(IWorkbenchPart.PROP_TITLE);
-  //    firePropertyChange(PROP_DIRTY);
-  //  }
-  /*
-   * (non-Javadoc) Initializes the editor part with a site and input. <p>
-   * Subclasses of <code> EditorPart </code> must implement this method.
-   * Within the implementation subclasses should verify that the input type
-   * is acceptable and then save the site and input. Here is sample code:
-   * </p><pre> if (!(input instanceof IFileEditorInput)) throw new
-   * PartInitException("Invalid Input: Must be IFileEditorInput");
-   * setSite(site); setInput(editorInput); </pre>
-   */
-  protected boolean fileDoesNotExist(IFileEditorInput input, Throwable[] coreException) {
-    boolean result = false;
-    InputStream inStream = null;
-    if ((!(input.exists())) || (!(input.getFile().exists()))) {
-      result = true;
-    }
-    else {
-      try {
-        inStream = input.getFile().getContents(true);
-      }
-      catch (CoreException e) {
-        // very likely to be file not found
-        result = true;
-        coreException[0] = e;
-      }
-      finally {
-        if (input != null) {
-          try {
-            if (inStream != null) {
-              inStream.close();
-            }
-          }
-          catch (IOException e) {
-
-          }
-        }
-      }
-    }
-    return result;
-  }
-
-  public Object getAdapter(Class key) {
-    Object result = null;
-
-      // DMW: I'm bullet-proofing this because
-      // its been reported (on 4.03 version) a null pointer sometimes
-      // happens here on startup, when an editor has been left
-      // open when workbench shutdown.
-      if (fTextEditor != null) {
-        result = fTextEditor.getAdapter(key);
-      }
-    return result;
-  }
-
-  public Document getDOMDocument() {
-    if (getTextEditor() == null)
-      return null;
-
-    ISourceEditingTextTools tools = (ISourceEditingTextTools) getAdapter(ISourceEditingTextTools.class);
-    if(tools != null && tools instanceof IDOMSourceEditingTextTools) {
-    	return ((IDOMSourceEditingTextTools)tools).getDOMDocument();
-    }
-    return null;
-  }
-
-  protected IStructuredModel getModel() {
-    IStructuredModel model = null;
-    if (fTextEditor != null)
-      model = fTextEditor.getModel();
-    return model;
-  }
-
-  protected IPreferenceStore getPreferenceStore() {
-    return XSDEditorPlugin.getPlugin().getPreferenceStore();
-  }
-
-  public StructuredTextEditor getTextEditor() {
-    return fTextEditor;
-  }
-
-  /*
-   * (non-Javadoc) Method declared on IWorkbenchPart.
-   */
-  public String getTitle() {
-    String title = null;
-    if (getTextEditor() == null) {
-      if (getEditorInput() != null) {
-        title = getEditorInput().getName();
-      }
-    }
-    else {
-      title = getTextEditor().getTitle();
-    }
-    if (title == null) {
-      title = getPartName();
-    }
-    return title;
-  }
-
-  /*
-   * (non-Javadoc) Sets the cursor and selection state for this editor to
-   * the passage defined by the given marker. <p> Subclasses may override.
-   * For greater details, see <code> IEditorPart </code></p>
-   * 
-   * @see IEditorPart
-   */
-  public void gotoMarker(IMarker marker) {
-    // (pa) 20020217 this was null when opening an editor that was
-    // already open
-    if (fTextEditor != null) {
-      IGotoMarker markerGotoer = (IGotoMarker) fTextEditor.getAdapter(IGotoMarker.class);
-      markerGotoer.gotoMarker(marker);
-    }
-  }
-
-  public void init(IEditorSite site, IEditorInput input) throws PartInitException {
-//    editorInputIsAcceptable(input);
-    try {
-      super.init(site, input);
-      if (partListener == null) {
-        partListener = new PartListener();
-      }
-      //getSite().getPage().addPartListener(partListner);
-      // we want to listen for our own activation
-      IWorkbenchWindow window = getSite().getWorkbenchWindow();
-      window.getPartService().addPartListener(partListener);
-      window.getShell().addShellListener(partListener);
-    }
-    catch (Exception e) {
-		// log for now, unless we find reason not to
-		Logger.log(Logger.INFO, e.getMessage());
-    }
-    setPartName(input.getName());
-  }
-
-  /*
-   * (non-Javadoc) Returns whether the "save as" operation is supported by
-   * this editor. <p> Subclasses must override this method to implement the
-   * open-save-close lifecycle for an editor. For greater details, see
-   * <code> IEditorPart </code></p>
-   * 
-   * @see IEditorPart
-   */
-  public boolean isSaveAsAllowed() {
-    return fTextEditor != null && fTextEditor.isSaveAsAllowed();
-  }
-
-  /*
-   * (non-Javadoc) Returns whether the contents of this editor should be
-   * saved when the editor is closed. <p> This method returns <code> true
-   * </code> if and only if the editor is dirty ( <code> isDirty </code> ).
-   * </p>
-   */
-  public boolean isSaveOnCloseNeeded() {
-    // overriding super class since it does a lowly isDirty!
-    if (fTextEditor != null)
-      return fTextEditor.isSaveOnCloseNeeded();
-    return isDirty();
-  }
-
-  /**
-   * Notifies this multi-page editor that the page with the given id has
-   * been activated. This method is called when the user selects a different
-   * tab.
-   * 
-   * @param newPageIndex
-   *            the index of the activated page
-   */
-  protected void pageChange(int newPageIndex) {
-    super.pageChange(newPageIndex);
-
-    saveLastActivePageIndex(newPageIndex);
-  }
-
-  /**
-   * Posts the update code "behind" the running operation.
-   */
-  protected void postOnDisplayQue(Runnable runnable) {
-    IWorkbench workbench = PlatformUI.getWorkbench();
-    IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
-    if (windows != null && windows.length > 0) {
-      Display display = windows[0].getShell().getDisplay();
-      display.asyncExec(runnable);
-    }
-    else
-      runnable.run();
-  }
-
-  /**
-   * Indicates that a property has changed.
-   * 
-   * @param source
-   *            the object whose property has changed
-   * @param propId
-   *            the id of the property which has changed; property ids are
-   *            generally defined as constants on the source class
-   */
-  public void propertyChanged(Object source, int propId) {
-    switch (propId) {
-      // had to implement input changed "listener" so that
-      // strucutedText could tell it containing editor that
-      // the input has change, when a 'resource moved' event is
-      // found.
-      case IEditorPart.PROP_INPUT :
-      case IEditorPart.PROP_DIRTY : {
-        if (source == fTextEditor) {
-          if (fTextEditor.getEditorInput() != getEditorInput()) {
-            setInput(fTextEditor.getEditorInput());
-            // title should always change when input changes.
-            // create runnable for following post call
-            Runnable runnable = new Runnable() {
-              public void run() {
-                _firePropertyChange(IWorkbenchPart.PROP_TITLE);
-              }
-            };
-            // Update is just to post things on the display queue
-            // (thread). We have to do this to get the dirty
-            // property to get updated after other things on the
-            // queue are executed.
-            postOnDisplayQue(runnable);
-          }
-        }
-        break;
-      }
-      case IWorkbenchPart.PROP_TITLE : {
-        // update the input if the title is changed
-        if (source == fTextEditor) {
-          if (fTextEditor.getEditorInput() != getEditorInput()) {
-            setInput(fTextEditor.getEditorInput());
-          }
-        }
-        break;
-      }
-      default : {
-        // propagate changes. Is this needed? Answer: Yes.
-        if (source == fTextEditor) {
-          firePropertyChange(propId);
-        }
-        break;
-      }
-    }
-
-  }
-
-  protected void safelySanityCheckState() {
-    // If we're called before editor is created, simply ignore since we
-    // delegate this function to our embedded TextEditor
-    if (getTextEditor() == null)
-      return;
-
-    getTextEditor().safelySanityCheckState(getEditorInput());
-
-  }
-
-  protected void saveLastActivePageIndex(int newPageIndex) {
-    // save the last active page index to preference manager
-    getPreferenceStore().setValue(IXMLPreferenceNames.LAST_ACTIVE_PAGE, newPageIndex);
-  }
-
-  /**
-   * Sets the currently active page.
-   */
-  protected void setActivePage() {
-    // retrieve the last active page index from preference manager
-    int activePageIndex = getPreferenceStore().getInt(IXMLPreferenceNames.LAST_ACTIVE_PAGE);
-
-    // We check this range since someone could hand edit the XML
-    // preference file to an invalid value ... which I know from
-    // experience :( ... if they do, we'll reset to default and continue
-    // rather than throw an assertion error in the setActivePage(int)
-    // method.
-    if (activePageIndex < 0 || activePageIndex >= getPageCount()) {
-      activePageIndex = fSourcePageIndex;
-    }
-    setActivePage(activePageIndex);
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.eclipse.ui.part.EditorPart#setInput(org.eclipse.ui.IEditorInput)
-   */
-  protected void setInput(IEditorInput input) {
-    // If driven from the Source page, it's "model" may not be up to date
-    // with the input just yet. We'll rely on later notification from the
-    // TextViewer to set us straight
-    super.setInput(input);
-    setPartName(input.getName());
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDSelectionManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDSelectionManager.java
deleted file mode 100644
index 22f0354..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDSelectionManager.java
+++ /dev/null
@@ -1,96 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-
-public class XSDSelectionManager implements ISelectionProvider, ISelectionChangedListener
-{
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
-   */
-  public void addSelectionChangedListener(ISelectionChangedListener listener)
-  {
-    listenerList.add(listener);
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
-   */
-  public ISelection getSelection()
-  {
-    return currentSelection;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
-   */
-  public void removeSelectionChangedListener(ISelectionChangedListener listener)
-  {
-    listenerList.remove(listener);
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
-   */
-  public void setSelection(ISelection selection)
-  {
-    setSelection(selection, this);
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
-   */
-  public void selectionChanged(SelectionChangedEvent event)
-  {
-    if (enableNotify)
-    {
-      setSelection(event.getSelection(), event.getSelectionProvider());
-    }
-  }
-
-  
-  protected List listenerList = new ArrayList();
-  protected ISelection currentSelection;
-  protected boolean enableNotify = true;
-
-  public void setSelection(ISelection selection, ISelectionProvider source)
-  {  
-//	  System.out.println("SelectionManager.setSelection() " + selection + ", " + source);
-    if (enableNotify)
-    {
-      currentSelection = selection;
-      enableNotify = false;
-      try
-      {
-        SelectionChangedEvent event = new SelectionChangedEvent(source, selection);
-        List copyOfListenerList = new ArrayList(listenerList);
-        for (Iterator i = copyOfListenerList.iterator(); i.hasNext(); )
-        {
-          ISelectionChangedListener listener = (ISelectionChangedListener)i.next();
-          listener.selectionChanged(event);
-        }
-      }
-      finally
-      {
-        enableNotify = true;
-      }
-    }
-  }      
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AbstractAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AbstractAction.java
deleted file mode 100644
index b421416..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AbstractAction.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class AbstractAction extends Action
-{
-  XSDConcreteComponent xsdConcreteComponent;
-
-  /**
-   * @param text
-   */
-  public AbstractAction(String text, XSDConcreteComponent xsdConcreteComponent)
-  {
-    super(text);
-    this.xsdConcreteComponent = xsdConcreteComponent;
-  }
-
-  /**
-   * @param text
-   * @param image
-   */
-  public AbstractAction(String text, ImageDescriptor image, XSDConcreteComponent xsdConcreteComponent)
-  {
-    super(text, image);
-    this.xsdConcreteComponent = xsdConcreteComponent;
-  }
-
-  /**
-   * @param text
-   * @param style
-   */
-  public AbstractAction(String text, int style)
-  {
-    super(text, style);
-  }
-  
-  public DocumentImpl getDocument()
-  {
-    return (DocumentImpl) xsdConcreteComponent.getElement().getOwnerDocument();
-  }
-    
-  public void beginRecording(String description)
-  {
-    getDocument().getModel().beginRecording(this, description);
-  }
-  
-  public void endRecording()
-  {
-    DocumentImpl doc = (DocumentImpl) getDocument();
-    
-    doc.getModel().endRecording(this);    
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddAttributeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddAttributeAction.java
deleted file mode 100644
index f1a9f3f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddAttributeAction.java
+++ /dev/null
@@ -1,40 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.xsd.ui.internal.commands.AddAttributeDeclarationCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class AddAttributeAction extends AbstractAction
-{
-  protected AddAttributeDeclarationCommand command;
-  
-  public AddAttributeAction(String text, XSDConcreteComponent parent)
-  {
-    super(text, parent);
-    command = new AddAttributeDeclarationCommand(parent);
-  }
-
-  public AddAttributeAction(String text, ImageDescriptor image, XSDConcreteComponent parent)
-  {
-    super(text, image, parent);
-    command = new AddAttributeDeclarationCommand(parent);
-  }
-
-  public void run()
-  {
-    beginRecording(getText());
-    command.run();
-    
-    endRecording();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddEnumsAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddEnumsAction.java
deleted file mode 100644
index ecc2f4b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddEnumsAction.java
+++ /dev/null
@@ -1,92 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xsd.ui.internal.widgets.EnumerationsDialog;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-/**
- * Pattern is scoped to Enum Type
- */
-public class AddEnumsAction extends CreateElementAction
-{
-  public AddEnumsAction(String label)
-  {
-  	super(label);
-  }
- 
-  public Element createAndAddNewChildElement(String token)
-  {
-    String prefix = parentNode.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-    Element childNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + elementTag);
-    if (getAttributes() != null)
-    {
-      List attributes = getAttributes();
-      for (int i = 0; i < attributes.size(); i++)
-      {
-        DOMAttribute attr = (DOMAttribute) attributes.get(i);
-        childNode.setAttribute(attr.getName(), attr.getValue());
-      }
-    }
-    if (getRelativeNode() == null)
-    {
-      parentNode.appendChild(childNode);
-    }
-    else
-    {
-      ((Element)parentNode).insertBefore(childNode,getRelativeNode());
-    }
-    childNode.setAttribute("value", token);
-    return childNode;
-  }    
-  
-  public void run()
-  {
-    Display display = Display.getCurrent();
-    // if it is null, get the default one
-    display = display == null ? Display.getDefault() : display;
-    Shell parentShell = display.getActiveShell();
-    EnumerationsDialog dialog = new EnumerationsDialog(parentShell);
-    dialog.setBlockOnOpen(true);
-    int result = dialog.open();
-
-    if (result == Window.OK) 
-    {
-      beginRecording(getDescription());
-
-      String text = dialog.getText();
-      String delimiter = dialog.getDelimiter();
-      StringTokenizer tokenizer = new StringTokenizer(text, delimiter);
-      while (tokenizer.hasMoreTokens()) 
-      {
-        String token = tokenizer.nextToken();
-        if (dialog.isPreserveWhitespace() == false) 
-        {
-          token = token.trim();
-        }
-
-        Element child = createAndAddNewChildElement(token);
-        formatChild(child);        
-      }
-      endRecording();
-    }
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddModelGroupAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddModelGroupAction.java
deleted file mode 100644
index fcfdc77..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddModelGroupAction.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.commands.AddModelGroupCommand;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-
-public class AddModelGroupAction extends Action
-{
-   protected AddModelGroupCommand command;
-   protected XSDConcreteComponent parent;
-  
-   public static String getLabel(XSDCompositor compositor)
-   {
-     String result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SEQUENCE"); //$NON-NLS-1$
-     if (compositor != null)
-     {
-       if (compositor == XSDCompositor.CHOICE_LITERAL)
-       {
-         result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CHOICE");  //$NON-NLS-1$
-       }
-       else if (compositor == XSDCompositor.ALL_LITERAL)
-       {
-         result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ALL");//$NON-NLS-1$
-       }  
-     }
-     return result;
-   }
-  
-   public AddModelGroupAction(XSDConcreteComponent parent, XSDCompositor compositor)
-   {
-     command = new AddModelGroupCommand(parent, compositor);
-     this.parent = parent;
-     setText(getLabel(compositor));     
-   }   
-   
-   public void run()
-   {
-     DocumentImpl doc = (DocumentImpl) parent.getElement().getOwnerDocument();
-     doc.getModel().beginRecording(this, getText());
-     command.run();
-     doc.getModel().endRecording(this);
-   }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddSchemaNodeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddSchemaNodeAction.java
deleted file mode 100644
index d890af0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/AddSchemaNodeAction.java
+++ /dev/null
@@ -1,61 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditor;
-
-
-public class AddSchemaNodeAction extends Action
-{
-  /**
-   * Constructor for AddSchemaNodeAction.
-   */
-  public AddSchemaNodeAction()
-  {
-    super();
-  }
-
-  /**
-   * Constructor for AddSchemaNodeAction.
-   * @param text
-   */
-  public AddSchemaNodeAction(String text)
-  {
-    super(text);
-  }
-
-  /**
-   * Constructor for AddSchemaNodeAction.
-   * @param text
-   * @param image
-   */
-  public AddSchemaNodeAction(String text, ImageDescriptor image)
-  {
-    super(text, image);
-  }
-
-  public void setEditor(XSDEditor editor)
-  {
-    this.editor = editor;
-  }
-  
-  protected XSDEditor editor;
-  
-  /**
-   * @see org.eclipse.jface.action.IAction#run()
-   */
-  public void run()
-  {
-    editor.createDefaultSchemaNode(editor.getDOMDocument());
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/BackAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/BackAction.java
deleted file mode 100644
index 0ab518d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/BackAction.java
+++ /dev/null
@@ -1,90 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphViewer;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * @author kchong
- *
- * <a href="mailto:kchong@ca.ibm.com">kchong@ca.ibm.com</a>
- *
- */
-public class BackAction extends Action
-{
-  ISelectionProvider selectionProvider;
-  XSDGraphViewer xsdGraphViewer;
-  XSDSchema xsdSchema;
-  
-  /**
-   * 
-   */
-  public BackAction()
-  {
-    super();
-  }
-
-  /**
-   * @param text
-   */
-  public BackAction(String text)
-  {
-    super(text);
-  }
-
-  public BackAction(String text, XSDGraphViewer viewer)
-  {
-    super(text);
-    xsdGraphViewer = viewer;
-  }
-  
-  /**
-   * @param text
-   * @param image
-   */
-  public BackAction(String text, ImageDescriptor image)
-  {
-    super(text, image);
-  }
-
-  /**
-   * @param text
-   * @param style
-   */
-  public BackAction(String text, int style)
-  {
-    super(text, style);
-  }
-
-  public void setSelectionProvider(ISelectionProvider selectionProvider)
-  {
-    this.selectionProvider = selectionProvider;
-  }
-
-  public void setXSDSchema(XSDSchema xsdSchema)
-  {
-    this.xsdSchema = xsdSchema;
-  }
-  
-  /*
-   * @see IAction#run()
-   */
-  public void run()
-  {
-    StructuredSelection selection = new StructuredSelection(xsdSchema);
-    selectionProvider.setSelection(selection);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAnnotationAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAnnotationAction.java
deleted file mode 100644
index 698d433..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAnnotationAction.java
+++ /dev/null
@@ -1,55 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class CreateAnnotationAction extends CreateElementAction
-{
-  XSDSchema xsdSchema;
-  Element documentationNode;
-
-  public CreateAnnotationAction()
-  {
-    super();
-  }
-
-  public CreateAnnotationAction(String text)
-  {
-    super(text);
-  }
-
-  public CreateAnnotationAction(String text, ImageDescriptor image)
-  {
-    super(text, image);
-  }
-
-  public Element createAndAddNewChildElement()
-  {
-    Element childNode = super.createAndAddNewChildElement();
-
-    String prefix = parentNode.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-    documentationNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.DOCUMENTATION_ELEMENT_TAG);
-    childNode.appendChild(documentationNode);
-
-    formatChild(childNode);
-    formatChild(documentationNode);
-    formatChild(childNode);
-    
-    return childNode;
-  }
-  
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAttributeAndRequired.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAttributeAndRequired.java
deleted file mode 100644
index 155577b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateAttributeAndRequired.java
+++ /dev/null
@@ -1,115 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-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.format.FormatProcessorXML;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-
-/*
- * Class which creates an Attribute and necessary Elements required before
- * an Attribute can be added.  For example, if we wish to add an Attribute
- * to a GlobalElement without a ComplexType, a ComplexType will be created.
- */
-public class CreateAttributeAndRequired extends Action {
-	String elementTag;
-	String label;
-	List attributes;
-	XSDSchema xsdSchema;
-	ISelectionProvider selectionProvider;
-	Object parent;
-	
-	public CreateAttributeAndRequired(String elementTag, String label, List attributes, XSDSchema xsdSchema, ISelectionProvider selProvider, Object parent) {
-		super(label);
-		
-		this.elementTag = elementTag;
-		this.label = label;
-		this.attributes = attributes;
-		this.xsdSchema = xsdSchema;
-		this.selectionProvider = selProvider;
-		this.parent = parent;
-	}
-
-	public void run() {
-		if (parent instanceof XSDElementDeclaration) {
-			XSDElementDeclaration ed = (XSDElementDeclaration) parent;
-			beginRecording(ed.getElement());
-	        ed.setTypeDefinition(null);
-	      	XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
-	        ed.setAnonymousTypeDefinition(td);
-			
-		    CreateElementAction action = new CreateElementAction(label);		    
-		    action.setElementTag(elementTag);
-		    action.setAttributes(attributes);
-		    action.setParentNode(td.getElement());
-		    action.setRelativeNode(null);
-		    action.setXSDSchema(xsdSchema);
-		    action.setSelectionProvider(selectionProvider);
-		    action.run();
-		    
-		    formatChild(td.getElement());
-        if (td.getAttributeContents().size() > 0)
-        {
-		      selectObject(td.getAttributeContents().get(0));
-        }
-		    endRecording(ed.getElement());
-		}
-	}
-
-	protected void beginRecording(Element element) {
-		((DocumentImpl) element.getOwnerDocument()).getModel().beginRecording(this, getText());
-	}
-	
-	protected void endRecording(Element element) {
-		((DocumentImpl) element.getOwnerDocument()).getModel().endRecording(this);
-	}
-	
-	public void selectObject(Object object) {
-	    if (selectionProvider != null)
-	    {
-	        selectionProvider.setSelection(new StructuredSelection(object));
-	    }
-	}
-	
-	  protected void formatChild(Element child)
-	  {
-	    if (child instanceof IDOMNode)
-	    {
-	      IDOMModel model = ((IDOMNode)child).getModel();
-	      try
-	      {
-	        // tell the model that we are about to make a big model change
-	        model.aboutToChangeModel();
-	        
-		      IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
-			    formatProcessor.formatNode(child);
-	      }
-	      finally
-	      {
-	        // tell the model that we are done with the big model change
-	        model.changedModel(); 
-	      }
-	    }
-	  }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java
deleted file mode 100644
index 0dacfb6..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java
+++ /dev/null
@@ -1,365 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-import java.util.List;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-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.format.FormatProcessorXML;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.ComplexTypeDefinitionEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.ElementDeclarationEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.ModelGroupDefinitionEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.TopLevelComponentEditPart;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-public class CreateElementAction extends Action
-{
-  protected String description;
-  protected Element parentNode;
-
-  protected ISelectionProvider selectionProvider;
-  protected XSDSchema xsdSchema;
-
-  protected Object sourceContext;
-
-  /**
-   * Constructor for CreateElementAction.
-   */
-  public CreateElementAction()
-  {
-    super();
-  }
-  /**
-   * Constructor for CreateElementAction.
-   * @param text
-   */
-  public CreateElementAction(String text)
-  {
-    super(text);
-  }
-  /**
-   * Constructor for CreateElementAction.
-   * @param text
-   * @param image
-   */
-  public CreateElementAction(String text, ImageDescriptor image)
-  {
-    super(text, image);
-  }
-
-  public void setXSDSchema(XSDSchema xsdSchema)
-  {
-    this.xsdSchema = xsdSchema;
-  }
-  
-  public void setSelectionProvider(ISelectionProvider selectionProvider)
-  {
-    this.selectionProvider = selectionProvider;
-  }
-
-  public void setSourceContext(Object sourceContext)
-  {
-    this.sourceContext = sourceContext;
-  }
-  
-  /**
-   * Gets the parentNode.
-   * @return Returns a Element
-   */
-  public Element getParentNode()
-  {
-    return parentNode;
-  }
-
-  /**
-   * Sets the parentNode.
-   * @param parentNode The parentNode to set
-   */
-  public void setParentNode(Element parentNode)
-  {
-    this.parentNode = parentNode;
-  }
-
-  boolean isGlobal = false;
-  
-  public void setIsGlobal(boolean isGlobal)
-  {
-    this.isGlobal = isGlobal;
-  }
-  
-  public boolean getIsGlobal()
-  {
-    return isGlobal;
-  }
-
-  protected Node relativeNode;
-  protected String elementTag;
-  public void setElementTag(String elementTag)
-  {
-    this.elementTag = elementTag;
-  }
-  
-  public DocumentImpl getDocument()
-  {
-    return (DocumentImpl) getParentNode().getOwnerDocument();
-  }
-    
-  public void beginRecording(String description)
-  {
-    getDocument().getModel().beginRecording(this, description);
-  }
-  
-  public void endRecording()
-  {
-    DocumentImpl doc = (DocumentImpl) getDocument();
-    
-    doc.getModel().endRecording(this);    
-  }
-  
-  public Element createAndAddNewChildElement()
-  {
-    String prefix = parentNode.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-    Element childNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + elementTag);
-    if (getAttributes() != null)
-    {
-      List attributes = getAttributes();
-      for (int i = 0; i < attributes.size(); i++)
-      {
-        DOMAttribute attr = (DOMAttribute) attributes.get(i);
-        childNode.setAttribute(attr.getName(), attr.getValue());
-      }
-    }
-    if (getRelativeNode() == null)
-    {
-      parentNode.appendChild(childNode);
-    }
-    else
-    {
-      ((Element)parentNode).insertBefore(childNode,getRelativeNode());
-    }
-    
-    if (isGlobal && getRelativeNode() == null)
-    {
-      Text textNode = getDocument().createTextNode("\n\n");
-      parentNode.appendChild(textNode);
-    }
-    else if (isGlobal && getRelativeNode() != null)
-    {
-      Text textNode = getDocument().createTextNode("\n\n");
-      parentNode.insertBefore(textNode, getRelativeNode());
-    }
-
-    formatChild(childNode);
-    
-    return childNode;
-  }    
-    
-  protected void formatChild(Element child)
-  {
-    if (child instanceof IDOMNode)
-    {
-      IDOMModel model = ((IDOMNode)child).getModel();
-      try
-      {
-        // tell the model that we are about to make a big model change
-        model.aboutToChangeModel();
-        
-	      IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
-		    formatProcessor.formatNode(child);
-      }
-      finally
-      {
-        // tell the model that we are done with the big model change
-        model.changedModel(); 
-      }
-    }
-  }
-  /*
-   * @see IAction#run()
-   */
-  public void run()
-  {
-    beginRecording(getDescription());
-    final Element child = createAndAddNewChildElement();
-    endRecording();
-
-    if (selectionProvider != null)
-    {
-      final XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(child);
-//      selectionProvider.setSelection(new StructuredSelection(comp));
-      
-    Runnable runnable = new Runnable()
-    {
-      public void run()
-      {
-        if (comp instanceof XSDAttributeDeclaration)
-        {
-          if (((XSDAttributeDeclaration)comp).getContainer() instanceof XSDAttributeUse)
-          {
-            if (comp.getContainer().getContainer() instanceof XSDAttributeGroupDefinition)
-            {
-              selectionProvider.setSelection(new StructuredSelection(comp.getContainer()));
-            }
-            else if (comp.getContainer().getContainer() instanceof XSDComplexTypeDefinition)
-            {
-              if (XSDDOMHelper.inputEquals((Element)child, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
-              {
-                selectionProvider.setSelection(new StructuredSelection(comp.getContainer()));
-              }
-              else
-              {
-                selectionProvider.setSelection(new StructuredSelection(comp));
-              }
-            }
-            else
-            {
-              selectionProvider.setSelection(new StructuredSelection(comp));
-            }
-          }
-          else
-          {
-            selectionProvider.setSelection(new StructuredSelection(comp));
-          }
-        }
-        else
-        {
-          selectionProvider.setSelection(new StructuredSelection(comp));
-        }
-        if (comp instanceof XSDNamedComponent)
-        {
-          if (sourceContext instanceof AbstractEditPartViewer)
-          {
-            AbstractEditPartViewer viewer = (AbstractEditPartViewer)sourceContext;
-          
-            Object obj = viewer.getSelectedEditParts().get(0);
-            
-            if (obj instanceof GraphicalEditPart)
-            {
-              if (obj instanceof ElementDeclarationEditPart)
-              {
-                XSDElementDeclaration elem = ((ElementDeclarationEditPart)obj).getXSDElementDeclaration();
-                if (!elem.isElementDeclarationReference())
-                {
-                  ((ElementDeclarationEditPart)obj).doEditName();
-                }
-              }
-              else if (obj instanceof ModelGroupDefinitionEditPart)
-              {
-                XSDModelGroupDefinition group = ((ModelGroupDefinitionEditPart)obj).getXSDModelGroupDefinition();
-                if (!group.isModelGroupDefinitionReference())
-                {
-                  ((ModelGroupDefinitionEditPart)obj).doEditName();
-                }
-              }
-              else if (obj instanceof ComplexTypeDefinitionEditPart)
-              {
-                XSDComplexTypeDefinition ct = ((ComplexTypeDefinitionEditPart)obj).getXSDComplexTypeDefinition();
-                if (ct.getName() != null)
-                {
-                  ((ComplexTypeDefinitionEditPart)obj).doEditName();
-                }
-              }
-              else if (obj instanceof TopLevelComponentEditPart)
-              {
-                ((TopLevelComponentEditPart)obj).doEditName();
-              }
-            }
-
-          }
-        }
-      }
-    };
-    Display.getDefault().timerExec(50,runnable);
-    }
-  }
-
-  /**
-   * Gets the relativeNode.
-   * @return Returns a Element
-   */
-  public Node getRelativeNode()
-  {
-    return relativeNode;
-  }
-
-  /**
-   * Sets the relativeNode.
-   * @param relativeNode The relativeNode to set
-   */
-  public void setRelativeNode(Node relativeNode)
-  {
-    this.relativeNode = relativeNode;
-  }
-
-  /**
-   * Gets the description.
-   * @return Returns a String
-   */
-  public String getDescription()
-  {
-    if (description == null)
-    {
-      return getText();
-    }
-    return description;
-  }
-
-  /**
-   * Sets the description.
-   * @param description The description to set
-   */
-  public void setDescription(String description)
-  {
-    this.description = description;
-  }
-
-  protected List attributes;
-  /**
-   * Gets the nameAttribute.
-   * @return Returns a String
-   */
-  public List getAttributes()
-  {
-    return attributes;
-  }
-
-  /**
-   * Sets the attributes.
-   * @param attributes The attributes to set
-   */
-  public void setAttributes(List attributes)
-  {
-    this.attributes = attributes;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateGroupAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateGroupAction.java
deleted file mode 100644
index f9eadae..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateGroupAction.java
+++ /dev/null
@@ -1,76 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class CreateGroupAction extends CreateElementAction
-{
-  XSDSchema xsdSchema;
-
-  /**
-   * Constructor for CreateGroupAction.
-   */
-  public CreateGroupAction()
-  {
-    super();
-  }
-  /**
-   * Constructor for CreateGroupAction.
-   * @param text
-   */
-  public CreateGroupAction(String text)
-  {
-    super(text);
-  }
-  /**
-   * Constructor for CreateGroupAction.
-   * @param text
-   * @param XSDSchema
-   */
-  public CreateGroupAction(String text, XSDSchema xsdSchema)
-  {
-    super(text);
-    this.xsdSchema = xsdSchema;
-  }
-  /**
-   * Constructor for CreateGroupAction.
-   * @param text
-   * @param image
-   */
-  public CreateGroupAction(String text, ImageDescriptor image)
-  {
-    super(text, image);
-  }
-
-  public Element createAndAddNewChildElement()
-  {
-    XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent(parentNode);
-    Element childNode = super.createAndAddNewChildElement();
-
-    String prefix = parentNode.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-    Element contentModelNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SEQUENCE_ELEMENT_TAG);
-    childNode.appendChild(contentModelNode);
-
-    formatChild(childNode);
-    
-    xsdComp.setElement(parentNode);
-    
-    return childNode;
-  }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateIdentityConstraintsAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateIdentityConstraintsAction.java
deleted file mode 100644
index ca933f3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateIdentityConstraintsAction.java
+++ /dev/null
@@ -1,74 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class CreateIdentityConstraintsAction extends CreateElementAction
-{
-  XSDSchema xsdSchema;
-
-  /**
-   * Constructor for CreateIdentityConstraintsAction.
-   */
-  public CreateIdentityConstraintsAction()
-  {
-    super();
-  }
-  /**
-   * Constructor for CreateIdentityConstraintsAction.
-   * @param text
-   */
-  public CreateIdentityConstraintsAction(String text)
-  {
-    super(text);
-  }
-  /**
-   * Constructor for CreateIdentityConstraintsAction.
-   * @param text
-   * @param XSDSchema
-   */
-  public CreateIdentityConstraintsAction(String text, XSDSchema xsdSchema)
-  {
-    super(text);
-    this.xsdSchema = xsdSchema;
-  }
-  /**
-   * Constructor for CreateIdentityConstraintsAction.
-   * @param text
-   * @param image
-   */
-  public CreateIdentityConstraintsAction(String text, ImageDescriptor image)
-  {
-    super(text, image);
-  }
-
-  public Element createAndAddNewChildElement()
-  {
-    Element childNode = super.createAndAddNewChildElement();
-
-    String prefix = parentNode.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-    Element selectorNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SELECTOR_ELEMENT_TAG);
-
-    DOMAttribute attr = new DOMAttribute(XSDConstants.XPATH_ATTRIBUTE, "");
-    selectorNode.setAttribute(attr.getName(), attr.getValue());
-
-    childNode.appendChild(selectorNode);
-
-    return childNode;
-  }
-	
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalComplexTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalComplexTypeAction.java
deleted file mode 100644
index e8b0cd0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalComplexTypeAction.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class CreateLocalComplexTypeAction extends CreateElementAction
-{
-  /**
-   * Constructor for CreateLocalComplexTypeAction.
-   */
-  public CreateLocalComplexTypeAction()
-  {
-    super();
-  }
-  /**
-   * Constructor for CreateLocalComplexTypeAction.
-   * @param text
-   */
-  public CreateLocalComplexTypeAction(String text)
-  {
-    super(text);
-  }
-  /**
-   * Constructor for CreateLocalComplexTypeAction.
-   * @param text
-   * @param image
-   */
-  public CreateLocalComplexTypeAction(String text, ImageDescriptor image)
-  {
-    super(text, image);
-  }
-
-  public Element createAndAddNewChildElement()
-  {  
-    XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent(parentNode);
-    
-    Element childNode = super.createAndAddNewChildElement();
-  
-    if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.ELEMENT_ELEMENT_TAG, false))  
-    {  
-      parentNode.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);  
-    }  
-                                                      
-    String prefix = parentNode.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-    childNode.appendChild(getDocument().createElement(prefix + XSDConstants.SEQUENCE_ELEMENT_TAG));
-    
-    formatChild(childNode);
-    
-    xsdComp.setElement(parentNode);
-
-    return childNode;
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalSimpleTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalSimpleTypeAction.java
deleted file mode 100644
index d2e1065..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateLocalSimpleTypeAction.java
+++ /dev/null
@@ -1,85 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class CreateLocalSimpleTypeAction extends CreateElementAction
-{
-  XSDSchema xsdSchema;
-
-  /**
-   * Constructor for CreateLocalSimpleTypeAction.
-   */
-  public CreateLocalSimpleTypeAction()
-  {
-    super();
-  }
-  /**
-   * Constructor for CreateLocalSimpleTypeAction.
-   * @param text
-   */
-  public CreateLocalSimpleTypeAction(String text)
-  {
-    super(text);
-  }
-
-  /**
-   * Constructor for CreateLocalSimpleTypeAction.
-   * @param text
-   * @param image
-   */
-  public CreateLocalSimpleTypeAction(String text, ImageDescriptor image)
-  {
-    super(text, image);
-  }
-
-  public Element createAndAddNewChildElement()
-  {
-    Element childNode = super.createAndAddNewChildElement();
-
-    if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.UNION_ELEMENT_TAG, false))
-    {
-//      parentNode.removeAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-    }
-    else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.LIST_ELEMENT_TAG, false))
-    {
-      parentNode.removeAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
-    }
-    else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
-    {
-      parentNode.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);
-    }
-    else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
-    {
-      Node parent = parentNode.getParentNode();
-      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-      {
-        parentNode.removeAttribute(XSDConstants.BASE_ATTRIBUTE);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.ELEMENT_ELEMENT_TAG, false))
-    {
-      parentNode.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);
-    }
-    
-    formatChild(childNode);
-    
-    return childNode;
-  }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleContentAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleContentAction.java
deleted file mode 100644
index d9d9eb7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleContentAction.java
+++ /dev/null
@@ -1,115 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-import java.util.List;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-/**
- * @version   1.0
- * @author
- */
-public class CreateSimpleContentAction extends CreateElementAction
-{
-  XSDSchema xsdSchema;
-  //IDocument document;
-
-  /**
-   * Constructor for CreateSimpleContentAction.
-   */
-  public CreateSimpleContentAction()
-  {
-    super();
-  }
-  /**
-   * Constructor for CreateSimpleContentAction.
-   * @param text
-   */
-  public CreateSimpleContentAction(String text)
-  {
-    super(text);
-  }
-  /**
-   * Constructor for CreateSimpleContentAction.
-   * @param text
-   * @param XSDSchema
-   */
-  public CreateSimpleContentAction(String text, XSDSchema xsdSchema)
-  {
-    super(text);
-    this.xsdSchema = xsdSchema;
-  }
-  /**
-   * Constructor for CreateSimpleContentAction.
-   * @param text
-   * @param image
-   */
-  public CreateSimpleContentAction(String text, ImageDescriptor image)
-  {
-    super(text, image);
-  }
-
-  public Element createAndAddNewChildElement()
-  {
-    Element childNode = super.createAndAddNewChildElement();
-
-    String prefix = parentNode.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-    Element derivedByNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + "restriction");
-    childNode.appendChild(derivedByNode);
-    Element sequence = null;
-
-    if (XSDDOMHelper.inputEquals(childNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-    {
-      sequence = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + "sequence");
-      derivedByNode.appendChild(sequence);
-    }
-
-    // now add the required base attribute for the derived by node
-    TypesHelper typesHelper = new TypesHelper(xsdSchema);
-    List listOfCT = typesHelper.getUserComplexTypeNamesList();
-    String firstType = "";
-    if (listOfCT.size() > 0)
-    {
-      firstType = (String)(listOfCT).get(0);
-    }
-    DOMAttribute attr = new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, firstType);
-    derivedByNode.setAttribute(attr.getName(), attr.getValue());
-
-    formatChild(derivedByNode);
-    if (sequence != null)
-    {
-      formatChild(sequence);
-      formatChild(derivedByNode);
-    }
-    formatChild(childNode);
-
-    
-    return childNode;
-  }
-
-  /*
-   * @see IAction#run()
-   */
-  public void run()
-  {
-    beginRecording(getDescription());
-
-    createAndAddNewChildElement();
-    endRecording();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleTypeAction.java
deleted file mode 100644
index 5e5c29c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/CreateSimpleTypeAction.java
+++ /dev/null
@@ -1,68 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-public class CreateSimpleTypeAction extends CreateElementAction
-{
-  /**
-   * 
-   */
-  public CreateSimpleTypeAction()
-  {
-    super();
-  }
-
-  /**
-   * @param text
-   */
-  public CreateSimpleTypeAction(String text)
-  {
-    super(text);
-  }
-  
-  public CreateSimpleTypeAction(String text, XSDSchema xsdSchema)
-  {
-    super(text);
-    this.xsdSchema = xsdSchema;
-  }
-
-  /**
-   * @param text
-   * @param image
-   */
-  public CreateSimpleTypeAction(String text, ImageDescriptor image)
-  {
-    super(text, image);
-  }
-  
-  public Element createAndAddNewChildElement()
-  {
-    XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent(parentNode);
-    Element childNode = super.createAndAddNewChildElement();
-
-    String prefix = parentNode.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-    Element contentModelNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.RESTRICTION_ELEMENT_TAG);
-    contentModelNode.setAttribute(XSDConstants.BASE_ATTRIBUTE, prefix + "string");
-    childNode.appendChild(contentModelNode);
-
-    formatChild(childNode);
-    
-    xsdComp.setElement(parentNode);
-    
-    return childNode;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java
deleted file mode 100644
index 5580b40..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java
+++ /dev/null
@@ -1,76 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-// TODO Remove this
-
-/**
- * @version 	1.0
- * @author
- */
-public class DOMAttribute
-{
-  /**
-   * Constructor for DOMAttribute.
-   */
-  public DOMAttribute()
-  {
-    super();
-  }
-  
-  /**
-   * Constructor for DOMAttribute.
-   */
-  public DOMAttribute(String name, String value)
-  {
-    super();
-    this.name = name;
-    this.value = value;
-  }
-  
-  protected String name, value;
-  /**
-   * Gets the value.
-   * @return Returns a String
-   */
-  public String getValue()
-  {
-    return value;
-  }
-
-  /**
-   * Sets the value.
-   * @param value The value to set
-   */
-  public void setValue(String value)
-  {
-    this.value = value;
-  }
-
-  /**
-   * Gets the name.
-   * @return Returns a String
-   */
-  public String getName()
-  {
-    return name;
-  }
-
-  /**
-   * Sets the name.
-   * @param name The name to set
-   */
-  public void setName(String name)
-  {
-    this.name = name;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DeleteAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DeleteAction.java
deleted file mode 100644
index d2e4c23..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/DeleteAction.java
+++ /dev/null
@@ -1,234 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.delete.BaseGlobalCleanup;
-import org.eclipse.wst.xsd.ui.internal.refactor.delete.GlobalAttributeCleanup;
-import org.eclipse.wst.xsd.ui.internal.refactor.delete.GlobalAttributeGroupCleanup;
-import org.eclipse.wst.xsd.ui.internal.refactor.delete.GlobalElementCleanup;
-import org.eclipse.wst.xsd.ui.internal.refactor.delete.GlobalGroupCleanup;
-import org.eclipse.wst.xsd.ui.internal.refactor.delete.GlobalSimpleOrComplexTypeCleanup;
-import org.eclipse.wst.xsd.ui.internal.refactor.delete.XSDExternalFileCleanup;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Node;
-
-
-public class DeleteAction extends SelectionListenerAction
-{
-  protected IEditorPart editor;
-  protected XSDSchema xsdSchema;
-  protected ISelectionProvider selectionProvider;
-  protected XSDConcreteComponent parentXSDComponent;
-  
-  /**
-   * Constructor for DeleteAction.
-   * @param text
-   */
-  public DeleteAction(String text, IEditorPart editor, XSDSchema xsdSchema)
-  {
-    super(text);
-    this.editor = editor;
-    this.xsdSchema = xsdSchema;
-  }
-  
-  public void setSelectionProvider(ISelectionProvider selectionProvider)
-  {
-    this.selectionProvider = selectionProvider;
-  }
-  
-  public IEditorPart getEditor()
-  {
-    return editor;
-  }
-  
-  public XSDSchema getSchema()
-  {
-    return xsdSchema;
-  }
-  
-  public void setXSDSchema(XSDSchema xsdSchema)
-  {
-    this.xsdSchema = xsdSchema;
-  }
-  
-  /*
-   * @see IAction#run()
-   */
-  public void run()
-  {
-    IStructuredSelection selection = getStructuredSelection();
-    
-    if (selection.isEmpty())
-    {
-      return;
-    }
-    
-    Iterator iter = selection.iterator();
-    DocumentImpl doc = null;
-    while (iter.hasNext())
-    {
-      Object obj = iter.next();
-      Node node = null;
-      if (obj instanceof Node)
-      {
-        node = (Node)obj;
-      }
-      else if (obj instanceof XSDConcreteComponent)
-      {
-        xsdSchema = ((XSDConcreteComponent)obj).getSchema();
-        
-        node = ((XSDConcreteComponent)obj).getElement();
-        if (node instanceof IDOMNode)
-        {
-          parentXSDComponent = ((XSDConcreteComponent)obj).getContainer();
-        
-          if (parentXSDComponent instanceof XSDParticle)
-          {
-            // need to get the modelGroup
-            parentXSDComponent = parentXSDComponent.getContainer();
-          }
-        }
-
-      }
-      if (!XSDDOMHelper.inputEquals(node, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-      {
-        if (node instanceof IDOMNode)
-        {
-          if (doc == null)
-          {
-            doc = (DocumentImpl) node.getOwnerDocument();
-            doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_NODES"));
-          }
-    
-          boolean refresh = cleanupReferences(node);
-          if (node != null)
-          {
-            XSDDOMHelper.removeNodeAndWhitespace(node);
-          }
-          
-          // Workaround to reset included elements in XSD model
-          if (refresh)
-          {
-  //          getEditor().reparseSchema();
-  //          getEditor().getGraphViewer().setSchema(getEditor().getXSDSchema());
-          }
-        }
-      }
-    }
-    
-    if (parentXSDComponent != null && selectionProvider != null)
-    {
-      selectionProvider.setSelection(new StructuredSelection(parentXSDComponent));
-    }
-    
-    if (doc != null)
-    {
-      doc.getModel().endRecording(this);
-    }
-  }
-
-  protected boolean cleanupReferences(Node deletedNode)
-  {
-    boolean refresh = false;
-    XSDConcreteComponent comp = getSchema().getCorrespondingComponent(deletedNode);
-    
-    if (comp instanceof XSDInclude ||
-        comp instanceof XSDImport ||
-        comp instanceof XSDRedefine)
-    {
-      XSDSchema referencedSchema = null;
-      if (comp instanceof XSDInclude)
-      {
-        referencedSchema = ((XSDInclude)comp).getIncorporatedSchema();
-        refresh = true;
-      }
-      else if (comp instanceof XSDRedefine)
-      {
-        referencedSchema = ((XSDRedefine)comp).getIncorporatedSchema();
-        refresh = true;
-      }
-      else if (comp instanceof XSDImport)
-      {
-        referencedSchema = ((XSDImport)comp).getResolvedSchema();
-        refresh = true;
-      }
-
-      if (referencedSchema != null)
-      {
-        XSDExternalFileCleanup cleanHelper = new XSDExternalFileCleanup(referencedSchema);
-        cleanHelper.visitSchema(getSchema());
-        // populate messages
-// TODO        getEditor().createTasksInTaskList(cleanHelper.getMessages());
-      }
-      if (comp instanceof XSDImport)
-      {
-        TypesHelper typesHelper = new TypesHelper(getSchema());
-        typesHelper.updateMapAfterDelete((XSDImport)comp);
-      }
-    }
-    else if (getSchema().equals(comp.getContainer()))
-    {
-      BaseGlobalCleanup cleanHelper = null;
-      // Only need to clean up references if the component being deleted is global scoped
-      if (comp instanceof XSDElementDeclaration)
-      {
-        cleanHelper = new GlobalElementCleanup(comp);
-      }
-      else if (comp instanceof XSDModelGroupDefinition)
-      {
-        cleanHelper = new GlobalGroupCleanup(comp);
-      }
-      else if (comp instanceof XSDTypeDefinition)
-      {
-        cleanHelper = new GlobalSimpleOrComplexTypeCleanup(comp);
-      }
-      else if (comp instanceof XSDAttributeDeclaration)
-      {
-        cleanHelper = new GlobalAttributeCleanup(comp);
-      }
-      else if (comp instanceof XSDAttributeGroupDefinition)
-      {
-        cleanHelper = new GlobalAttributeGroupCleanup(comp);
-      }
-      
-      
-      if (cleanHelper != null)
-      {
-        cleanHelper.visitSchema(getSchema());
-      }
-    }
-    return refresh;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/GraphRenameAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/GraphRenameAction.java
deleted file mode 100644
index cea3fd9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/GraphRenameAction.java
+++ /dev/null
@@ -1,34 +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.xsd.ui.internal.actions;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.commands.RenameCommand;
-import org.eclipse.xsd.XSDNamedComponent;
-
-
-public class GraphRenameAction extends Action
-{
-  protected RenameCommand command;
-  
-  public GraphRenameAction(XSDNamedComponent namedComponent, GraphicalEditPart editPart)
-  {
-    command = new RenameCommand(namedComponent, editPart);
-    setText(XSDEditorPlugin.getXSDString("_UI_LABEL_RENAME"));
-  }
-
-  public void run()
-  {
-    command.run();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ISchemaEditorActionConstants.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ISchemaEditorActionConstants.java
deleted file mode 100644
index 39836ff..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ISchemaEditorActionConstants.java
+++ /dev/null
@@ -1,22 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-public interface ISchemaEditorActionConstants
-{
-  public static final String RETARGET_VALIDATE_SCHEMA_ACTION_ID = "retargetValidateSchemaAction"; //$NON-NLS-1$
-  public static final String RETARGET_RELOAD_DEPENDENCIES_ACTION_ID = "retargetReloadDependenciesAction"; //$NON-NLS-1$
-  public static final String RETARGET_GENERATE_JAVA_ACTION_ID = "retargetGenerateJavaAction"; //$NON-NLS-1$
-  public static final String RETARGET_GENERATE_DTD_ACTION_ID = "retargetGenerateDtdAction"; //$NON-NLS-1$
-  public static final String RETARGET_GENERATE_XML_ACTION_ID = "retargetGenerateXMLAction"; //$NON-NLS-1$
-  public static final String RETARGET_RENAME_ELEMENT_ACTION_ID = "RenameElement"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MakeAnonymousGlobal.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MakeAnonymousGlobal.java
deleted file mode 100644
index 9a9638a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MakeAnonymousGlobal.java
+++ /dev/null
@@ -1,66 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class MakeAnonymousGlobal extends CreateElementAction
-{
-	XSDSchema xsdSchema;
-	Element type;
-	
-	public MakeAnonymousGlobal(String text, Element type, XSDSchema xsdSchema)
-	{
-		super(text);
-		this.xsdSchema = xsdSchema;
-		this.type = type;
-		isGlobal = true;
-	}
-
-	public Element createAndAddNewChildElement()
-	{
-		// create the new global type
-		Element childNode = super.createAndAddNewChildElement();
-    // add the anonymous type's children to the new global type
-		if (type.hasChildNodes())
-		{        
-			NodeList nodes = type.getChildNodes();
-			// use clones so we don't have a refresh problem
-			for (int i = 0; i < nodes.getLength(); i++)
-			{
-				Node node = nodes.item(i);       
-				childNode.appendChild(node.cloneNode(true));
-			}
-		}
-
-    // clean up the element whose type was anonymous
-    // and set its type attribute to the new global type
-		TypesHelper helper = new TypesHelper(xsdSchema);
-		String prefix = helper.getPrefix(xsdSchema.getTargetNamespace(), true);
-		helper = null;
-		
-		Element parentElementOfAnonymousType = (Element)type.getParentNode();
-
-		parentElementOfAnonymousType.removeChild(type);
-		parentElementOfAnonymousType.setAttribute(XSDConstants.TYPE_ATTRIBUTE, prefix + childNode.getAttribute(XSDConstants.NAME_ATTRIBUTE));
-
-		formatChild(childNode);
-		
-    return childNode;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ModelMessage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ModelMessage.java
deleted file mode 100644
index aa30618..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ModelMessage.java
+++ /dev/null
@@ -1,36 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.w3c.dom.Node;
-
-public class ModelMessage
-{
-  protected String message;
-  protected Node node;
-
-  public ModelMessage(String message, Node node)
-  {
-    this.message = message;
-    this.node = node;
-  }
-
-  public String getMessage()
-  {
-    return message;
-  }
-
-  public Node getNode()
-  {
-    return node;
-  }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MoveAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MoveAction.java
deleted file mode 100644
index e3606c9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/MoveAction.java
+++ /dev/null
@@ -1,183 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-public class MoveAction extends Action
-{
-  protected List selectedNodes;
-  protected Node parentNode;
-  protected Node refChild;
-
-  /**
-   * Constructor for DeleteAction.
-   * @param text
-   */
-  public MoveAction(Node parentNode, List selectedNodes, Node refChild)
-  {
-    this.parentNode = parentNode;
-    this.selectedNodes = selectedNodes;
-    this.refChild = refChild;
-  }    
-
-  public MoveAction(XSDConcreteComponent parentComponent, List selectedComponents, XSDConcreteComponent refChildComponent)
-  {
-    selectedNodes = new ArrayList(selectedComponents.size());
-    for (Iterator i = selectedComponents.iterator(); i.hasNext(); )
-    {
-      XSDConcreteComponent concreteComponent = (XSDConcreteComponent)i.next();
-      selectedNodes.add(concreteComponent.getElement());
-    }
-    parentNode = parentComponent.getElement();
-    refChild = refChildComponent != null ? refChildComponent.getElement() : null;
-  }
-                   
-  public boolean canMove()
-  {                           
-    // TODO... there are likely more restriction to consider here
-    boolean result = true;
-    for (Iterator i = selectedNodes.iterator(); i.hasNext(); )
-    {
-      Node child = (Node)i.next();
-      if (isDecendantOrSelf(child, parentNode)) 
-      {
-        result = false;
-        break;
-      }
-    }   
-    return result;
-  }           
-                  
-  protected boolean isDecendantOrSelf(Node potentialParent, Node node)
-  { 
-    boolean result = false;
-    while (node != null)
-    {
-      if (node == potentialParent)    
-      {
-        result = true;
-        break;
-      }           
-      node = node.getParentNode();
-    }
-    return result;
-  }
-
-
-  protected void beginRecording()
-  {
-    IDOMModel model = getModel();      
-    if (model != null)
-    {
-      model.beginRecording(this, XSDEditorPlugin.getXSDString("_UI_LABEL_MOVE"));
-    }
-  }
-  
-  protected void endRecording()
-  {
-    IDOMModel model = getModel();      
-    if (model != null)
-    {
-      model.endRecording(this);    
-    }
-  }
-
-  protected IDOMModel getModel()
-  {
-    IDOMModel model = null;
-    if (parentNode instanceof IDOMNode)
-    {                            
-      model = ((IDOMNode)parentNode).getModel();
-    }
-    return model;
-  }
-  
-
-     
-  /*
-   * @see IAction#run()
-   */
-  public void run()
-  {                            
-    beginRecording();
-    try
-    {
-      for (Iterator i = selectedNodes.iterator(); i.hasNext(); )
-      {
-        Node child = (Node)i.next();
-        repositionBefore(parentNode, child, refChild);
-      }   
-    }
-    catch (Exception e)
-    {         
-      e.printStackTrace();
-    }
-    endRecording();
-  }
-
-
-  public void repositionBefore(Node parent, Node child, Node refChild)
-  {   
-    // TODO... when the refChild (inserting as the last element) we need to
-    // special case the way we preserve indentation 
-    Node oldParent = child.getParentNode();
-    if (oldParent != null && refChild != child)
-    {  
-      // consider any indentation text node that preceeds the child
-      //      
-      Node textNode = isWhitespaceTextNode(child.getPreviousSibling()) ? child.getPreviousSibling() : null;
-
-      // remove the child
-      //
-      oldParent.removeChild(child);
-      
-      // Instead of inserting the child immediatlely infront of the refChild, we first check to see if there
-      // is an indentation text node preceeding the refChild.  If we find such a node, we perform the insertion
-      // so that the child is inserted before the indentation text node.
-      Node adjustedRefChild = refChild;
-      if (refChild != null && isWhitespaceTextNode(refChild.getPreviousSibling()))
-      {
-        adjustedRefChild = refChild.getPreviousSibling();
-      }
-          
-      // reposition the child and any indentation text node 
-      //
-      parent.insertBefore(child, adjustedRefChild);
-      if (textNode != null)
-      {
-        oldParent.removeChild(textNode);
-        parent.insertBefore(textNode, child);
-      }
-    }
-  }     
-    
-
-  protected static boolean isWhitespaceTextNode(Node node)
-  {
-    boolean result = false;
-    if (node != null && node.getNodeType() == Node.TEXT_NODE)
-    {
-      String data = ((Text)node).getData();
-      result = (data == null || data.trim().length() == 0);
-    }   
-    return result;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/OpenSchemaAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/OpenSchemaAction.java
deleted file mode 100644
index ce9216f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/OpenSchemaAction.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.ui.internal.util.OpenOnSelectionHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.impl.XSDImportImpl;
-
-
-public class OpenSchemaAction extends Action
-{
-  XSDConcreteComponent component;
-  public OpenSchemaAction(String label, XSDConcreteComponent component)
-  {
-    super(label);
-    this.component = component;
-  }
-
-  public void run()
-  {
-    if (component != null)
-    {
-      revealObject();
-    }
-  }
-
-  boolean lastResult = false;
-  protected boolean revealObject()
-  {
-    String schemaLocation = "";
-    XSDSchemaDirective dir;
-    if (component instanceof XSDSchemaDirective)
-    {
-      dir = (XSDSchemaDirective)component;
-      // force load of imported schema
-      if (dir instanceof XSDImportImpl)
-      {
-        ((XSDImportImpl)dir).importSchema();
-      }
-      if (dir.getResolvedSchema() != null)
-      {
-        schemaLocation = URIHelper.removePlatformResourceProtocol(dir.getResolvedSchema().getSchemaLocation());
-        if (schemaLocation != null)
-        {
-          OpenOnSelectionHelper.openXSDEditor(schemaLocation);
-        }
-      }
-    }
-    return lastResult;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ReloadDependenciesAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ReloadDependenciesAction.java
deleted file mode 100644
index 73e239f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/ReloadDependenciesAction.java
+++ /dev/null
@@ -1,58 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditor;
-
-
-public class ReloadDependenciesAction extends Action
-{
-  /**
-   * Constructor for ReloadDependenciesAction.
-   */
-  public ReloadDependenciesAction()
-  {
-    super();
-  }
-
-  /**
-   * Constructor for ReloadDependenciesAction.
-   * @param text
-   */
-  public ReloadDependenciesAction(String text)
-  {
-    super(text);
-  }
-
-  /**
-   * Constructor for ReloadDependenciesAction.
-   * @param text
-   * @param image
-   */
-  public ReloadDependenciesAction(String text, ImageDescriptor image)
-  {
-    super(text, image);
-  }
-
-  public void setEditor(XSDEditor editor)
-  {
-    this.editor = editor;
-  }
-  
-  protected XSDEditor editor;
-  
-  public void run()
-  {
-    editor.reparseSchema();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetBaseTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetBaseTypeAction.java
deleted file mode 100644
index 31d9753..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetBaseTypeAction.java
+++ /dev/null
@@ -1,383 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-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.format.FormatProcessorXML;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.wst.xsd.ui.internal.widgets.SetBaseTypeDialog;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class SetBaseTypeAction extends Action
-{
-  XSDSchema xsdSchema;
-  Element element;
-  String type = "";
-  String derivedByString = "";
-  XSDDOMHelper domHelper;
-  
-  /**
-   * Constructor for SetBaseTypeAction.
-   */
-  public SetBaseTypeAction()
-  {
-    super();
-    domHelper = new XSDDOMHelper();
-  }
-  /**
-   * Constructor for SetBaseTypeAction.
-   * @param arg0
-   */
-  public SetBaseTypeAction(String arg0)
-  {
-    super(arg0);
-    domHelper = new XSDDOMHelper();
-  }
-  /**
-   * Constructor for SetBaseTypeAction.
-   * @param arg0
-   * @param arg1
-   */
-  public SetBaseTypeAction(String arg0, ImageDescriptor arg1)
-  {
-    super(arg0, arg1);
-    domHelper = new XSDDOMHelper();
-  }
-  /**
-   * Constructor for SetBaseTypeAction.
-   * @param arg0
-   * @param arg1
-   */
-  public SetBaseTypeAction(String arg0, int arg1)
-  {
-    super(arg0, arg1);
-    domHelper = new XSDDOMHelper();
-  }
-
-  
-  public void setXSDSchema(XSDSchema schema)
-  {
-    this.xsdSchema = schema;    
-  }
-
-  public void setComplexTypeElement(Element element)
-  {
-    this.element = element;
-  }
-  
-  public void setType(String type)
-  {
-    this.type = type; 
-  }
-
-  public void setDerivedBy(String derivedByString)
-  {
-    this.derivedByString = derivedByString;
-  }
-
-  public void run()
-  {
-    Display display = Display.getCurrent();
-    // if it is null, get the default one
-    display = display == null ? Display.getDefault() : display;
-    Shell parentShell = display.getActiveShell();
-
-    SetBaseTypeDialog dialog = new SetBaseTypeDialog(parentShell, xsdSchema, element);
-    dialog.setBlockOnOpen(true);
-
-    Element contentModelElement = domHelper.getContentModelFromParent(element);    
-    if (contentModelElement != null)
-    {
-      // to set the current values to show in the dialog
-      if (XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false) ||
-          XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-      {
-        Element derivedByElement = domHelper.getDerivedByElementFromComplexType(element);
-        if (derivedByElement != null)
-        {
-          String currentBaseType = derivedByElement.getAttribute(XSDConstants.BASE_ATTRIBUTE);
-          dialog.setCurrentBaseType(currentBaseType);
-          dialog.setCurrentDerivedBy(derivedByElement.getLocalName());
-        }
-        else
-        {
-          dialog.setCurrentBaseType("");
-          dialog.setCurrentDerivedBy("");
-        }
-      }
-    }
-
-    int result = dialog.open();
-    
-    if (result == Window.OK) 
-    {
-      type = dialog.getBaseType();
-      derivedByString = dialog.getDerivedBy();
-      performAction();
-    }
-  }
-
-  XSDTypeDefinition newTypeDefinition = null;
-  public XSDTypeDefinition getXSDTypeDefinition()
-  {
-    return newTypeDefinition;
-  }
-
-  public void performAction()
-  {
-    TypesHelper helper = new TypesHelper(xsdSchema);
-
-    XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent(element);
-    
-    Element contentModelElement = domHelper.getContentModelFromParent(element);
-    boolean contentModelExists = true;
-    if (contentModelElement == null)
-    {
-      contentModelExists = false;
-    }
-
-//  get XSD component of the new type chosen
-    newTypeDefinition = null;
-    for (Iterator i = xsdSchema.getTypeDefinitions().iterator(); i.hasNext(); )
-    {
-      XSDTypeDefinition typeDef = (XSDTypeDefinition)i.next();
-      if (typeDef.getQName().equals(type))
-      {
-        newTypeDefinition = typeDef;
-        break;
-      }
-    }
-   
-    boolean needsComplexContent = false;
-    boolean needsSimpleContent = false;
-
-    if (helper.getBuiltInTypeNamesList().contains(type) ||
-       helper.getUserSimpleTypeNamesList().contains(type))
-//    if (newTypeDefinition instanceof XSDSimpleTypeDefinition)
-    {
-      needsSimpleContent = true; 
-    }        
-    else if (newTypeDefinition instanceof XSDComplexTypeDefinition)
-    {
-      needsComplexContent = true;
-//      XSDComplexTypeDefinition newCTObj = (XSDComplexTypeDefinition)newTypeDefinition;
-//      XSDContentTypeCategory category = newCTObj.getContentTypeCategory();
-    }
-    
-    beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_SET_BASE_TYPE"), element);
-    String prefix = element.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-
-    DOMAttribute attr = new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, type);
-    if (!contentModelExists) // if no content model exists, then add the new nodes
-    {
-      if (helper.getBuiltInTypeNamesList().contains(type) ||
-          helper.getUserSimpleTypeNamesList().contains(type))
-      {
-        updateModelAndDerivedByKind(prefix + XSDConstants.SIMPLECONTENT_ELEMENT_TAG, prefix + XSDConstants.EXTENSION_ELEMENT_TAG, attr);
-      }
-      else if (helper.getUserComplexTypeNamesList().contains(type))
-      {
-        if (derivedByString.equals("")) // default
-        {
-          derivedByString = XSDConstants.EXTENSION_ELEMENT_TAG;
-        }
-        Element derivedByElement = updateModelAndDerivedByKind(prefix + XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, prefix + derivedByString, attr);
-        Element newModelGroupElement = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SEQUENCE_ELEMENT_TAG);
-        derivedByElement.appendChild(newModelGroupElement);
-        formatChild(derivedByElement);
-      }
-    }
-    else  // else there is a content model
-    {
-      if (type.equals(""))  // the chosen type is blank, ie. there is no base type
-      {
-        Element derivedByElement = domHelper.getDerivedByElementFromComplexType(element);
-        Element sourceContentModelElement = domHelper.getContentModelFromParent(derivedByElement);
-        // Retain the content model if there is one from the complex or simple content derive by element
-        if (XSDDOMHelper.inputEquals(sourceContentModelElement, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
-            XSDDOMHelper.inputEquals(sourceContentModelElement, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
-            XSDDOMHelper.inputEquals(sourceContentModelElement, XSDConstants.ALL_ELEMENT_TAG, false))
-        {      
-          Element newNode = domHelper.cloneElement(element, sourceContentModelElement);
-          element.replaceChild(newNode, contentModelElement);
-          formatChild(element); 
-        }
-        else // otherwise just add the nodes
-        {
-          XSDDOMHelper.removeNodeAndWhitespace(contentModelElement);
-          Element newSequenceElement = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SEQUENCE_ELEMENT_TAG);
-          element.appendChild(newSequenceElement);
-          formatChild(newSequenceElement);
-        }
-      }           
-      else // a base type is specified
-      {
-        Element sequenceChoiceOrAllElement = null;  // copy the model to reposition it off of the new derived by element
-        if (XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
-            XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
-            XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.ALL_ELEMENT_TAG, false))
-        {
-           sequenceChoiceOrAllElement = domHelper.cloneElement(element, contentModelElement);
-        }
-
-        if (needsComplexContent)
-        {
-          if (!(XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false)))
-          {
-            domHelper.changeContentModel(element, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, sequenceChoiceOrAllElement);
-            contentModelElement = domHelper.getContentModelFromParent(element);
-          }          
-        }
-        if (needsSimpleContent)
-        {
-          if (!(XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false)))
-          {
-            // we don't want to append the element content to a simple content
-            sequenceChoiceOrAllElement = null;
-            domHelper.changeContentModel(element, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, sequenceChoiceOrAllElement);
-            contentModelElement = domHelper.getContentModelFromParent(element);
-          }
-        }
-
-        Element derivedByElement = domHelper.getDerivedByElementFromComplexType(element);        
-        if (derivedByElement == null)
-        {
-          if (derivedByString == null || (derivedByString != null && derivedByString.equals("")))
-          {
-            derivedByString = XSDConstants.EXTENSION_ELEMENT_TAG;  // since there is no derivedByElement
-          }
-          derivedByElement = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, derivedByString);
-          contentModelElement.appendChild(derivedByElement);
-          formatChild(contentModelElement);
-          if (sequenceChoiceOrAllElement != null)
-          {
-            derivedByElement.appendChild(sequenceChoiceOrAllElement);
-            formatChild(derivedByElement);
-          }
-        }
-        else
-        {
-          if (helper.getBuiltInTypeNamesList().contains(type) ||
-              helper.getUserSimpleTypeNamesList().contains(type))
-          {
-            derivedByString = XSDConstants.EXTENSION_ELEMENT_TAG;
-            Element aContentModelElement = domHelper.getContentModelFromParent(derivedByElement);
-            if (aContentModelElement != null)
-            {
-              XSDDOMHelper.removeNodeAndWhitespace(aContentModelElement);
-            }
-          }
-          domHelper.changeDerivedByType(contentModelElement, derivedByString, type);
-        }
-        derivedByElement.setAttribute(attr.getName(), attr.getValue());
-      }
-    }
-    
-    xsdComp.setElement(element);
-    endRecording(element);
-  }
-
-  private Element updateModelAndDerivedByKind(String modelType, String derivedByKind, DOMAttribute attr)
-  {
-    Element newContentModelElement = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, modelType);
-    element.appendChild(newContentModelElement);
-
-    Element newDerivedByElement = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, derivedByKind);
-    newContentModelElement.appendChild(newDerivedByElement);
-
-    newDerivedByElement.setAttribute(attr.getName(), attr.getValue());
-    
-    NodeList children = element.getChildNodes();
-    int length = children.getLength();
-    ArrayList nodesToRemove = new ArrayList();
-    for (int i = 0; i < length; i++)
-    {
-      Node node = children.item(i);
-      if (XSDDOMHelper.inputEquals(node, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false) ||
-          XSDDOMHelper.inputEquals(node, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true) ||
-          XSDDOMHelper.inputEquals(node, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true) ||
-          XSDDOMHelper.inputEquals(node, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false))
-      {
-        newDerivedByElement.appendChild(node.cloneNode(true));
-        nodesToRemove.add(node);
-      }
-    }
-    for (Iterator i = nodesToRemove.iterator(); i.hasNext(); )
-    {
-      XSDDOMHelper.removeNodeAndWhitespace((Node)i.next());
-    }
-    
-    formatChild(newContentModelElement);
-
-    return newDerivedByElement;
-  }
-
-  protected void formatChild(Element child)
-  {
-    if (child instanceof IDOMNode)
-    {
-      IDOMModel model = ((IDOMNode)child).getModel();
-      try
-      {
-        // tell the model that we are about to make a big model change
-        model.aboutToChangeModel();
-        
-        IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
-        formatProcessor.formatNode(child);
-      }
-      finally
-      {
-        // tell the model that we are done with the big model change
-        model.changedModel(); 
-      }
-    }
-
-  }
-
-  public DocumentImpl getDocument(Element element)
-  {
-    return (DocumentImpl) element.getOwnerDocument();
-  }
-
-  public void beginRecording(String description, Element element)
-  {
-    getDocument(element).getModel().beginRecording(this, description);
-  }
-  
-  public void endRecording(Element element)
-  {
-    DocumentImpl doc = (DocumentImpl) getDocument(element);
-    
-    doc.getModel().endRecording(this);    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetMultiplicityAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetMultiplicityAction.java
deleted file mode 100644
index 7de436d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetMultiplicityAction.java
+++ /dev/null
@@ -1,42 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.wst.xsd.ui.internal.commands.SetMultiplicityCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class SetMultiplicityAction extends AbstractAction
-{
-  SetMultiplicityCommand command;
-  
-  public SetMultiplicityAction(XSDConcreteComponent parent, String multiplicity)
-  {
-    super(multiplicity, parent);
-    command = new SetMultiplicityCommand(parent);
-  }
-  
-  public void setMaxOccurs(int i)
-  {
-    command.setMaxOccurs(i);
-  }
-
-  public void setMinOccurs(int i)
-  {
-    command.setMinOccurs(i);
-  }
-
-  public void run()
-  {
-    beginRecording(getText());
-    command.run();
-    endRecording();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetTypeAction.java
deleted file mode 100644
index b913398..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SetTypeAction.java
+++ /dev/null
@@ -1,47 +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.xsd.ui.internal.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.xsd.ui.internal.commands.SetTypeCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class SetTypeAction extends AbstractAction
-{
-  int typeKind;
-  SetTypeCommand command;
-  
-  public SetTypeAction(String text, ImageDescriptor image, XSDConcreteComponent xsdConcreteComponent)
-  {
-    super(text, image, xsdConcreteComponent);
-    command = new SetTypeCommand(xsdConcreteComponent);
-  }
-  
-  public SetTypeAction(String text, XSDConcreteComponent xsdConcreteComponent)
-  {
-    super(text, xsdConcreteComponent);
-    command = new SetTypeCommand(xsdConcreteComponent);
-  }
-  
-  public void setTypeKind(int type)
-  {
-    this.typeKind = type;
-    command.setTypeKind(type);
-  }
-  
-  public void run()
-  {
-    beginRecording(getText());
-    command.run();
-    endRecording();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SourcePageActionContributor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SourcePageActionContributor.java
deleted file mode 100644
index 8bc62ca..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/SourcePageActionContributor.java
+++ /dev/null
@@ -1,58 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.wst.xml.ui.internal.actions.ActionContributorXML;
-
-
-/**
- * SourcePageActionContributor
- * 
- * This class is for multi page editor's source page contributor.
- *
- * 
- */
-public class SourcePageActionContributor extends ActionContributorXML {
-
-	private IActionBars fBars;
-
-	/**
-	 * This method calls:
-	 * <ul>
-	 *  <li><code>contributeToMenu</code> with <code>bars</code>' menu manager</li>
-	 *  <li><code>contributeToToolBar</code> with <code>bars</code>' tool bar
-	 *    manager</li>
-	 *  <li><code>contributeToStatusLine</code> with <code>bars</code>' status line
-	 *    manager</li>
-	 * </ul>
-	 * The given action bars are also remembered and made accessible via 
-	 * <code>getActionBars</code>.
-	 * 
-	 * @param bars the action bars
-	 * 
-	 */
-	public void init(IActionBars bars) {
-		fBars = bars;
-		contributeToMenu(bars.getMenuManager());
-		contributeToToolBar(bars.getToolBarManager());
-		contributeToStatusLine(bars.getStatusLineManager());
-	}
-
-	/**
-	 * Returns this contributor's action bars.
-	 *
-	 * @return the action bars
-	 */
-	public IActionBars getActionBars() {
-		return fBars;
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java
deleted file mode 100644
index 736beca..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java
+++ /dev/null
@@ -1,223 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.actions;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.ui.internal.actions.ReplacePrefixAction;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonResources;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.SchemaPrefixChangeHandler;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.TargetNamespaceChangeHandler;
-import org.eclipse.wst.xsd.ui.internal.widgets.XSDEditSchemaInfoDialog;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class XSDEditNamespacesAction extends Action {
-	private Element element;
-	private String resourceLocation;
-	private XSDSchema xsdSchema;
-    private DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
-	
-	public XSDEditNamespacesAction(String label, Element element, Node node) {
-		super();
-		setText(label);
-		
-		this.element = element;
-		///////////////////// This needs to be changed....
-		this.resourceLocation = "dummy";		
-	}
-	
-	public XSDEditNamespacesAction(String label, Element element, Node node, XSDSchema schema) {
-		this (label, element, node);
-		xsdSchema = schema;
-	}
-	
-	public void run() {
-		if (element != null)
-		{   
-		      Shell shell = XMLCommonResources.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-		      String targetNamespace = null;
-		      if (xsdSchema != null) {
-		      	targetNamespace = xsdSchema.getTargetNamespace();
-		      }
-		      XSDEditSchemaInfoDialog dialog = new XSDEditSchemaInfoDialog(shell, new Path(resourceLocation), targetNamespace); 
-
-		      List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
-		      List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
-
-		      // here we store a copy of the old info for each NamespaceInfo
-		      // this info will be used in createPrefixMapping() to figure out how to update the document 
-		      // in response to these changes
-		      for (Iterator i = namespaceInfoList.iterator(); i.hasNext(); )
-		      {
-		        NamespaceInfo info = (NamespaceInfo)i.next();
-		        NamespaceInfo oldCopy = new NamespaceInfo(info);
-		        info.setProperty("oldCopy", oldCopy);
-		      }
-		                              
-		      dialog.setNamespaceInfoList(namespaceInfoList);   
-		      dialog.create();      
-		      //dialog.getShell().setSize(500, 300);
-		      dialog.getShell().setText(XMLCommonResources.getInstance().getString("_UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE"));
-		      dialog.setBlockOnOpen(true);                                 
-		      dialog.open();
-          String xsdPrefix = "";    
-
-		      if (dialog.getReturnCode() == Window.OK)
-		      {
-            Element xsdSchemaElement = xsdSchema.getElement();
-            DocumentImpl doc = (DocumentImpl) xsdSchemaElement.getOwnerDocument();
-            
-            List newInfoList = dialog.getNamespaceInfoList();
-
-		        // see if we need to rename any prefixes
-		        Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
-            
-            Map map2 = new Hashtable();
-            for (Iterator iter = newInfoList.iterator(); iter.hasNext(); )
-            {
-              NamespaceInfo ni = (NamespaceInfo)iter.next();
-              String pref = ni.prefix;
-              String uri = ni.uri;
-              if (pref == null) pref = "";
-              if (uri == null) uri = "";
-              if (XSDConstants.isSchemaForSchemaNamespace(uri))
-              {
-                xsdPrefix = pref;
-              }
-              map2.put(pref, uri);
-            }
-           
-		        if (map2.size() > 0)
-		        {
-		        	try {
-                
-                doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"));
-
-                if (xsdPrefix != null && xsdPrefix.length() == 0)
-                {
-                  xsdSchema.setSchemaForSchemaQNamePrefix(null);
-                }
-                else
-                {
-                  xsdSchema.setSchemaForSchemaQNamePrefix(xsdPrefix);
-                }
-
-                xsdSchema.setTargetNamespace(dialog.getTargetNamespace());
-                xsdSchema.update();
-                
-                SchemaPrefixChangeHandler spch = new SchemaPrefixChangeHandler(xsdSchema, xsdPrefix);
-                spch.resolve();
-                xsdSchema.update();
-                
-                xsdSchema.setIncrementalUpdate(false);
-                namespaceInfoManager.removeNamespaceInfo(element);
-                namespaceInfoManager.addNamespaceInfo(element, newInfoList, false);
-                xsdSchema.setIncrementalUpdate(true);
-
-                // don't need these any more?
-			          ReplacePrefixAction replacePrefixAction = new ReplacePrefixAction(null, element, prefixMapping);
-			          replacePrefixAction.run();
-                
-                TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, targetNamespace, dialog.getTargetNamespace());
-                targetNamespaceChangeHandler.resolve();
-				    	}
-              catch (Exception e)
-              { 
-//                e.printStackTrace();
-              }
-              finally
-              {
-                xsdSchema.update();
-                doc.getModel().endRecording(this);
-			     		}
-		        }
-		   }      
-          
-		}
-	}
-	
-	 protected Map createPrefixMapping(List oldList, List newList)
-	  {          
-	    Map map = new Hashtable();
-
-	    Hashtable oldURIToPrefixTable = new Hashtable();
-	    for (Iterator i = oldList.iterator(); i.hasNext(); )
-	    {    
-	      NamespaceInfo oldInfo = (NamespaceInfo)i.next();                    
-	      oldURIToPrefixTable.put(oldInfo.uri, oldInfo);
-	    }
-	    
-	    for (Iterator i = newList.iterator(); i.hasNext(); )
-	    {
-	      NamespaceInfo newInfo = (NamespaceInfo)i.next();
-	      NamespaceInfo oldInfo = (NamespaceInfo)oldURIToPrefixTable.get(newInfo.uri != null ? newInfo.uri : ""); 
-
-
-	      // if oldInfo is non null ... there's a matching URI in the old set
-	      // we can use its prefix to detemine out mapping
-	      //
-	      // if oldInfo is null ...  we use the 'oldCopy' we stashed away 
-	      // assuming that the user changed the URI and the prefix
-	      if (oldInfo == null)                                            
-	      {
-	        oldInfo = (NamespaceInfo)newInfo.getProperty("oldCopy");           
-	      } 
-
-	      if (oldInfo != null)
-	      {
-	        String newPrefix = newInfo.prefix != null ? newInfo.prefix : "";
-	        String oldPrefix = oldInfo.prefix != null ? oldInfo.prefix : "";
-	        if (!oldPrefix.equals(newPrefix))
-	        {
-	          map.put(oldPrefix, newPrefix);    
-	        }
-	      }      
-	    }        
-	    return map;
-	  }
-   
-//    private void updateAllNodes(Element element, String prefix)
-//    {
-//      element.setPrefix(prefix);
-//      NodeList list = element.getChildNodes();
-//      if (list != null)
-//      {
-//        for (int i=0; i < list.getLength(); i++)
-//        {
-//          Node child = list.item(i);
-//          if (child != null && child instanceof Element)
-//          {
-//            child.setPrefix(prefix);
-//            if (child.hasChildNodes())
-//            {
-//              updateAllNodes((Element)child, prefix);
-//            }
-//          }
-//        }
-//      }   
-//    }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AbstractCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AbstractCommand.java
deleted file mode 100644
index 3c0ae25..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AbstractCommand.java
+++ /dev/null
@@ -1,71 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.commands;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-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.format.FormatProcessorXML;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-public abstract class AbstractCommand 
-{
-  private XSDConcreteComponent parent;
-  private XSDConcreteComponent model;
-
-  protected AbstractCommand(XSDConcreteComponent parent)
-  {
-    this.parent = parent;
-  }
-  
-  public abstract void run();
-
-  protected XSDConcreteComponent getParent()
-  {
-    return parent;
-  }
-  
-  public XSDConcreteComponent getModelObject()
-  {
-    return model;
-  }
-  
-  protected void setModelObject(XSDConcreteComponent model)
-  {
-    this.model = model;
-  }
-  
-  // Establish part-whole relationship
-  protected abstract boolean adopt(XSDConcreteComponent model);
-
-  protected void formatChild(Element child)
-  {
-    if (child instanceof IDOMNode)
-    {
-      IDOMModel model = ((IDOMNode)child).getModel();
-      try
-      {
-        // tell the model that we are about to make a big model change
-        model.aboutToChangeModel();
-        
-        IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
-        formatProcessor.formatNode(child);
-      }
-      finally
-      {
-        // tell the model that we are done with the big model change
-        model.changedModel(); 
-      }
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddAttributeDeclarationCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddAttributeDeclarationCommand.java
deleted file mode 100644
index 0430149..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddAttributeDeclarationCommand.java
+++ /dev/null
@@ -1,140 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class AddAttributeDeclarationCommand extends AbstractCommand
-{
-  XSDAttributeDeclaration refAttribute = null;
-  /**
-   * @param parent
-   */
-  public AddAttributeDeclarationCommand(XSDConcreteComponent parent)
-  {
-    super(parent);
-  }
-
-  public AddAttributeDeclarationCommand(XSDConcreteComponent parent, XSDAttributeDeclaration ref)
-  {
-    super(parent);
-    this.refAttribute = ref;
-  }
-
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#run()
-   */
-  public void run()
-  {
-    XSDConcreteComponent parent = getParent();
-    if (parent instanceof XSDComplexTypeDefinition)
-    {
-      XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)parent;
-
-      XSDAttributeDeclaration attribute = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
-      attribute.setName(getNewName("Attribute")); //$NON-NLS-1$
-      attribute.setTypeDefinition(ct.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string")); //$NON-NLS-1$
-      
-      XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
-      attributeUse.setAttributeDeclaration(attribute);
-      attributeUse.setContent(attribute);
-      
-      if (ct.getAttributeContents() != null)
-      {
-        ct.getAttributeContents().add(attributeUse);
-        formatChild(attribute.getElement());
-      }
-    }
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
-   */
-  protected boolean adopt(XSDConcreteComponent model)
-  {
-    return false;
-  }
-  
-  ArrayList names;
-  
-  protected String getNewName(String description)
-  {
-    String candidateName = "New" + description; //$NON-NLS-1$
-    XSDConcreteComponent parent = getParent();
-    names = new ArrayList();
-    int i = 1;
-    if (parent instanceof XSDComplexTypeDefinition)
-    {
-      XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)parent;
-      walkUpInheritance(ct);
-
-      boolean ready = false;
-      while (!ready)
-      {
-        ready = true;
-        for (Iterator iter = names.iterator(); iter.hasNext(); )
-        {
-          String attrName = (String)iter.next();
-          if (candidateName.equals(attrName))
-          {
-            ready = false;
-            candidateName = "New" + description + String.valueOf(i); //$NON-NLS-1$
-            i++;
-          }
-        }
-      }
-    }
-    return candidateName;
-  }
-  
-  private void walkUpInheritance(XSDComplexTypeDefinition ct)
-  {
-    updateNames(ct);
-    XSDTypeDefinition typeDef = ct.getBaseTypeDefinition();
-    if (ct != ct.getRootType())
-    {
-      if (typeDef instanceof XSDComplexTypeDefinition)
-      {
-        XSDComplexTypeDefinition ct2 = (XSDComplexTypeDefinition)typeDef;
-        walkUpInheritance(ct2);
-      }
-    }
-  }
-
-  private void updateNames(XSDComplexTypeDefinition ct)
-  {
-    Iterator iter = ct.getAttributeContents().iterator();
-    while (iter.hasNext())
-    {
-      Object obj = iter.next();
-      if (obj instanceof XSDAttributeUse)
-      {
-        XSDAttributeUse use = (XSDAttributeUse)obj;
-        XSDAttributeDeclaration attr = use.getAttributeDeclaration();
-        String attrName = attr.getName();
-        if (attrName != null)
-        {
-          names.add(attrName);
-        }
-      }
-    }
-
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddComplexTypeDefinitionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddComplexTypeDefinitionCommand.java
deleted file mode 100644
index 72da36a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddComplexTypeDefinitionCommand.java
+++ /dev/null
@@ -1,53 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.commands;
-
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-
-public final class AddComplexTypeDefinitionCommand extends AbstractCommand
-{
-  private String name;
-  
-  public AddComplexTypeDefinitionCommand
-    (XSDConcreteComponent parent,
-     String name)
-  {
-    super(parent);
-    this.name = name; // this may be null for anonymous type
-  }
-	  
-  public void run()
-  {
-  	XSDComplexTypeDefinition typeDef = 
-      XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
-    typeDef.setName(name);
-    	
-    if (adopt(typeDef))
-      setModelObject(typeDef);
-  }
-  
-  protected boolean adopt(XSDConcreteComponent model)
-  {
-  	XSDConcreteComponent parent = getParent();
-    if (parent instanceof XSDSchema)
-      ((XSDSchema)parent).getTypeDefinitions().add(model);
-    else if (parent instanceof XSDElementDeclaration)
-      ((XSDElementDeclaration)parent).setAnonymousTypeDefinition((XSDComplexTypeDefinition)model);
-    else
-      return false; // invalid parent
-    
-    return true;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddElementDeclarationCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddElementDeclarationCommand.java
deleted file mode 100644
index fa087dd..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddElementDeclarationCommand.java
+++ /dev/null
@@ -1,53 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.commands;
-
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-
-public final class AddElementDeclarationCommand extends AbstractCommand
-{
-  private String name; // element name
-  
-  public AddElementDeclarationCommand
-    (XSDConcreteComponent parent,
-     String name)
-  {
-    super(parent);
-    this.name = name;
-  }
-  
-  public void run()
-  {
-    XSDElementDeclaration elementDecl = 
-      XSDFactory.eINSTANCE.createXSDElementDeclaration();
-    elementDecl.setName(name);
-
-    adopt(elementDecl);
-    setModelObject(elementDecl);
-  }
-
-  protected boolean adopt(XSDConcreteComponent model)
-  {
-  	XSDConcreteComponent parent = getParent();
-    if (parent instanceof XSDSchema)
-      ((XSDSchema)parent).getElementDeclarations().add(model);
-    else if (parent instanceof XSDParticle)
-      ((XSDParticle)parent).setContent((XSDElementDeclaration)model);
-    else
-      return false; // invalid parent
-    
-    return true;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddModelGroupCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddModelGroupCommand.java
deleted file mode 100644
index f5518e2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddModelGroupCommand.java
+++ /dev/null
@@ -1,103 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.commands;
-
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class AddModelGroupCommand extends AbstractCommand
-{
-  protected XSDCompositor compositor;
-
-  public AddModelGroupCommand(XSDConcreteComponent parent, XSDCompositor compositor)
-  {
-    super(parent);
-    this.compositor = compositor;
-  }
-
-  public void run()
-  {
-    XSDConcreteComponent parent = getParent();
-    XSDConcreteComponent owner = null;
-    if (parent instanceof XSDElementDeclaration)
-    {
-      XSDElementDeclaration ed = (XSDElementDeclaration)parent;      
-      if (ed.getTypeDefinition() != null) 
-      {
-        if (ed.getAnonymousTypeDefinition() == null)
-        {
-          ed.setTypeDefinition(null);
-          XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
-          ed.setAnonymousTypeDefinition(td);
-          owner = ed.getTypeDefinition();
-        }
-        else
-        {
-          XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
-          ed.setAnonymousTypeDefinition(td);
-          owner = td;        
-        }
-      }        
-      else if (ed.getAnonymousTypeDefinition() == null)
-      {
-        XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
-        ed.setAnonymousTypeDefinition(td);
-        owner = td;        
-      }
-      else if (ed.getAnonymousTypeDefinition() instanceof XSDComplexTypeDefinition)
-      {
-        owner = ed.getAnonymousTypeDefinition();
-      }
-      else if (ed.getAnonymousTypeDefinition() instanceof XSDSimpleTypeDefinition)
-      {
-        XSDComplexTypeDefinition td = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
-        ed.setAnonymousTypeDefinition(td);
-        owner = td;        
-      }
-    }
-    else if (parent instanceof XSDModelGroup)
-    {
-      ((XSDModelGroup) parent).getContents().add(createModelGroup());
-    }
-    else if (parent instanceof XSDComplexTypeDefinition)
-    {
-      owner = ((XSDComplexTypeDefinition)parent);
-    }
-    if (owner != null)
-    {
-      XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); 
-      XSDModelGroup modelGroup = createModelGroup();
-      particle.setContent(modelGroup);
-
-      XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition)owner;
-      ctd.setContent(particle);
-      formatChild(parent.getElement());
-    }  
-  }
-
-  protected boolean adopt(XSDConcreteComponent model)
-  {
-    return false;
-  }
-  
-  protected XSDModelGroup createModelGroup()
-  {
-    XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
-    modelGroup.setCompositor(compositor);
-    return modelGroup;
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddSimpleTypeDefinitionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddSimpleTypeDefinitionCommand.java
deleted file mode 100644
index b0c347b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/AddSimpleTypeDefinitionCommand.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.commands;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public final class AddSimpleTypeDefinitionCommand extends AbstractCommand
-{
-  private String name;
-  
-  public AddSimpleTypeDefinitionCommand
-    (XSDConcreteComponent parent,
-     String name)
-  {
-    super(parent);
-    this.name = name; // this may be null for anonymous type
-  }
-  
-  public void run()
-  {
-  	XSDSimpleTypeDefinition typeDef = 
-      XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
-  	typeDef.setName(name);
-  	
-    if (adopt(typeDef))
-      setModelObject(typeDef);
-  }
-  
-  protected boolean adopt(XSDConcreteComponent model)
-  {
-  	XSDConcreteComponent parent = getParent();
-    if (parent instanceof XSDSchema)
-      ((XSDSchema)parent).getTypeDefinitions().add(model);
-    else if (parent instanceof XSDElementDeclaration)
-      ((XSDElementDeclaration)parent).setAnonymousTypeDefinition((XSDSimpleTypeDefinition)model);
-    else if (parent instanceof XSDAttributeDeclaration)
-      ((XSDAttributeDeclaration)parent).setAnonymousTypeDefinition((XSDSimpleTypeDefinition)model);
-    else
-      return false; // invalid parent
-    
-    return true;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeAnonymousTypeGlobalCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeAnonymousTypeGlobalCommand.java
deleted file mode 100644
index 7562a18..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeAnonymousTypeGlobalCommand.java
+++ /dev/null
@@ -1,84 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.commands;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public final class MakeAnonymousTypeGlobalCommand extends AbstractCommand {
-
-	String fNewName;
-
-	public MakeAnonymousTypeGlobalCommand(XSDConcreteComponent element,
-			String newName) {
-		super(element.getContainer());
-		setModelObject(element);
-		fNewName = newName;
-	}
-
-	public void run() {
-		XSDConcreteComponent model = getModelObject();
-		XSDConcreteComponent parent = model.getContainer();
-		XSDTypeDefinition globalTypeDef = null;
-		if (model instanceof XSDComplexTypeDefinition) {
-			if (parent instanceof XSDElementDeclaration) {
-				// clone typedef with it's content and set it global
-				globalTypeDef = (XSDComplexTypeDefinition) model
-						.cloneConcreteComponent(true, false);
-				globalTypeDef.setName(fNewName);
-				parent.getSchema().getContents().add(globalTypeDef);
-				((XSDElementDeclaration) parent)
-						.setTypeDefinition(globalTypeDef);
-			}
-		} else if (model instanceof XSDSimpleTypeDefinition) {
-
-			XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) model;
-			if (parent instanceof XSDElementDeclaration) {
-				// clone typedef with it's content and set it global
-				globalTypeDef = (XSDSimpleTypeDefinition) typeDef
-						.cloneConcreteComponent(true, false);
-				globalTypeDef.setName(fNewName);
-				parent.getSchema().getContents().add(globalTypeDef);
-				((XSDElementDeclaration) parent)
-						.setTypeDefinition(globalTypeDef);
-				formatChild(globalTypeDef.getElement());
-
-			} else if (parent instanceof XSDAttributeDeclaration) {
-				// clone typedef with it's content and set it global
-				globalTypeDef = (XSDSimpleTypeDefinition) typeDef
-						.cloneConcreteComponent(true, false);
-				globalTypeDef.setName(fNewName);
-				parent.getSchema().getContents().add(globalTypeDef);
-				((XSDAttributeDeclaration) parent)
-						.setTypeDefinition((XSDSimpleTypeDefinition) globalTypeDef);
-
-			}
-
-		}
-
-		formatChild(globalTypeDef.getElement());
-
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
-	 */
-	protected boolean adopt(XSDConcreteComponent model) {
-		// TODO Auto-generated method stub
-		return true;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeLocalElementGlobalCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeLocalElementGlobalCommand.java
deleted file mode 100644
index 7303919..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/MakeLocalElementGlobalCommand.java
+++ /dev/null
@@ -1,84 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.commands;
-
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public final class MakeLocalElementGlobalCommand extends AbstractCommand
-{
-	
-  public MakeLocalElementGlobalCommand
-    (XSDConcreteComponent element)
-  {
-    super(element.getContainer());
-    setModelObject(element);
-  }
-  
-  public void run()
-  {
-    
-   if(getModelObject() instanceof XSDElementDeclaration){
-   
-	   XSDElementDeclaration element = (XSDElementDeclaration)getModelObject();
- 	XSDConcreteComponent parent = getParent();
- 	XSDConcreteComponent container = parent.getContainer();
- 	
- 	// clone element with it's content and set it global
-	XSDConcreteComponent  elementDecl = ((XSDElementDeclaration)getModelObject()).cloneConcreteComponent(true, true);
- 	container.getSchema().getContents().add(elementDecl);
- 	
- 	// create local element and set it's reference to the global one
- 	XSDElementDeclaration elementRef = 
-	      XSDFactory.eINSTANCE.createXSDElementDeclaration();
-	elementRef.setValue(element.getValue());
-    elementRef.setResolvedElementDeclaration((XSDElementDeclaration)elementDecl); 
-    
-    // now set content models
- 	if(parent instanceof XSDComplexTypeContent){
- 		if(container instanceof XSDModelGroup){
- 			XSDModelGroup modelGroup = (XSDModelGroup)container;
- 			// disconnect parent from its container
- 			int index = modelGroup.getContents().indexOf(parent);
- 			 XSDParticle particle = 
- 			      XSDFactory.eINSTANCE.createXSDParticle();
- 		    particle.setContent(elementRef);
- 		    modelGroup.getContents().add(index, particle); 
- 		   
- 			modelGroup.getContents().remove(parent);
- 		    modelGroup.updateElement(true);
-  		    formatChild(modelGroup.getElement());
- 		}
- 	}
- 	else if(parent instanceof XSDTypeDefinition){
-		System.out.println("MakeLocalElementGlobalCommand.run: parent instanceof XSDTypeDefinition");
-		 		
- 	}
- 	
- 	container.getSchema().updateElement(true);
-    formatChild(elementDecl.getElement());
-  
-   }
-
-  }
-	/* (non-Javadoc)
-	 * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
-	 */
-	protected boolean adopt(XSDConcreteComponent model) {
-		// TODO Auto-generated method stub
-		return true;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/RenameCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/RenameCommand.java
deleted file mode 100644
index 4ecd336..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/RenameCommand.java
+++ /dev/null
@@ -1,70 +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.xsd.ui.internal.commands;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.ComplexTypeDefinitionEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.ElementDeclarationEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.ModelGroupDefinitionEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.TopLevelComponentEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDNamedComponent;
-
-
-/**
- * @author kchong
- *
- * <a href="mailto:kchong@ca.ibm.com">kchong@ca.ibm.com</a>
- *
- */
-public class RenameCommand
-{
-  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
-  Label label = new Label();
-  XSDNamedComponent namedComponent;
-  GraphicalEditPart editPart;
-  
-  public RenameCommand(XSDNamedComponent namedComponent, GraphicalEditPart editPart)
-  {
-    this.namedComponent = namedComponent;
-    this.editPart = editPart;
-  }
-
-  public void run()
-  {
-    if (editPart instanceof ElementDeclarationEditPart)
-    {
-      ElementDeclarationEditPart elementDeclarationEditPart = (ElementDeclarationEditPart)editPart;
-      elementDeclarationEditPart.doEditName();
-    }
-    else if (editPart instanceof TopLevelComponentEditPart)
-    {
-      TopLevelComponentEditPart topLevelEditPart = (TopLevelComponentEditPart)editPart;
-      topLevelEditPart.doEditName();
-    }
-    else if (editPart instanceof ComplexTypeDefinitionEditPart)
-    {
-      ((ComplexTypeDefinitionEditPart)editPart).doEditName();
-    }
-    else if (editPart instanceof ModelGroupDefinitionEditPart)
-    {
-      ((ModelGroupDefinitionEditPart)editPart).doEditName();
-    }
-  }
-
-  protected boolean adopt(XSDConcreteComponent model)
-  {
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetMultiplicityCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetMultiplicityCommand.java
deleted file mode 100644
index 4c8c27d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetMultiplicityCommand.java
+++ /dev/null
@@ -1,66 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.commands;
-
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-
-public class SetMultiplicityCommand extends AbstractCommand
-{
-  int maxOccurs, minOccurs;
-
-  /**
-   * @param parent
-   */
-  public SetMultiplicityCommand(XSDConcreteComponent parent)
-  {
-    super(parent);
-  }
-  
-  public void setMaxOccurs(int i)
-  {
-    maxOccurs=i;
-  }
-
-  public void setMinOccurs(int i)
-  {
-    minOccurs=i;    
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#run()
-   */
-  public void run()
-  {
-    XSDConcreteComponent parent = getParent();
-    if (parent instanceof XSDParticleContent)
-    {
-      XSDParticleContent xsdParticleContent = (XSDParticleContent)parent;
-      XSDParticle xsdParticle = (XSDParticle)xsdParticleContent.getContainer();
-      if (maxOccurs < 0)
-      {
-        maxOccurs = XSDParticle.UNBOUNDED;
-      }
-      xsdParticle.setMaxOccurs(maxOccurs);
-      xsdParticle.setMinOccurs(minOccurs);
-    }
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
-   */
-  protected boolean adopt(XSDConcreteComponent model)
-  {
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetTypeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetTypeCommand.java
deleted file mode 100644
index ce76482..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/commands/SetTypeCommand.java
+++ /dev/null
@@ -1,103 +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.xsd.ui.internal.commands;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionDialog;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionProvider;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDSetTypeHelper;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class SetTypeCommand extends AbstractCommand
-{
-  protected int typeKind = XSDConstants.COMPLEXTYPE_ELEMENT;
-  
-  public SetTypeCommand(XSDConcreteComponent parent)
-  {
-    super(parent);
-  }
-  
-  public void setTypeKind(int type)
-  {
-    this.typeKind = type;
-  }
-
-  public void run()
-  {
-    XSDConcreteComponent parent = getParent();
-    if (parent instanceof XSDElementDeclaration)
-    {
-      XSDElementDeclaration element = (XSDElementDeclaration)parent;
-      XSDSchema schema = element.getSchema();
-      if (typeKind == XSDConstants.COMPLEXTYPE_ELEMENT)
-      {
-        AddModelGroupCommand sequenceCommand = new AddModelGroupCommand(element, XSDCompositor.SEQUENCE_LITERAL);
-        sequenceCommand.run();
-      }
-      else if (typeKind == XSDConstants.SIMPLETYPE_ELEMENT)
-      {
-        AddSimpleTypeDefinitionCommand stCommand = new AddSimpleTypeDefinitionCommand(element, null);
-        stCommand.run();
-        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)stCommand.getModelObject();
-        XSDSimpleTypeDefinition base = schema.resolveSimpleTypeDefinition(schema.getSchemaForSchemaNamespace(), "string");
-        st.setBaseTypeDefinition(base);
-      }
-      else
-      {
-          Shell shell = Display.getCurrent().getActiveShell();
-          IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
-          
-          XSDComponentSelectionProvider provider = new XSDComponentSelectionProvider(currentIFile, schema);
-          XSDComponentSelectionDialog dialog = new XSDComponentSelectionDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), provider);
-          provider.setDialog(dialog);
-          
-          dialog.setBlockOnOpen(true);
-          dialog.create();
-          
-          if (dialog.open() == Window.OK) {
-              XSDSetTypeHelper helper = new XSDSetTypeHelper(currentIFile, schema);
-              helper.setType(element.getElement(), "type", dialog.getSelection());
-          }
-      }
-      formatChild(element.getElement());
-    }
-
-  }
-  
-  private IEditorPart getActiveEditor()
-  {
-    IWorkbench workbench = XSDEditorPlugin.getPlugin().getWorkbench();
-    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-    IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-//    IEditorPart editorPart = part.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();
-
-    return editorPart;
-  }
-
-  protected boolean adopt(XSDConcreteComponent model)
-  {
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/ComponentSelectionDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/ComponentSelectionDialog.java
deleted file mode 100644
index 77ce6ad..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/ComponentSelectionDialog.java
+++ /dev/null
@@ -1,445 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs.types.common;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-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.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-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.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-
-public class ComponentSelectionDialog extends Dialog {
-    private Display display = Display.getCurrent();
-    private String dialogTitle;
-
-    protected IComponentSelectionProvider provider;
-    private List componentTreeViewerInput;
-    private List masterComponentList;
-    
-    // widgets
-    protected Composite topComposite;
-    protected Composite bottomComposite; 
-    private String filterTextLabel = "";
-    private String componentListLabel = XSDEditorPlugin.getXSDString("_UI_LABEL_COMPONENTS");
-    private Text textFilter;
-    protected TreeViewer componentTreeViewer;
-    private org.eclipse.swt.widgets.List qualifierList;
-    
-    protected Object componentSelection;
-    protected Object qualifierTextSelection;
-
-    public ComponentSelectionDialog(Shell shell, String dialogTitle, IComponentSelectionProvider provider) {
-        super(shell);
-        setShellStyle(getShellStyle() | SWT.RESIZE);
-        this.dialogTitle = dialogTitle;
-        this.provider = provider;
-        
-        componentTreeViewerInput = new ArrayList();
-        masterComponentList = new ArrayList();
-    }
-
-    /*
-     * This method should be called before createDialogArea(Composite)
-     */
-    public void setComponentTreeLabel(String string) {
-        componentListLabel = string;
-    }
-
-    /*
-     * This method should be called before createDialogArea(Composite)
-     */
-    public void setFilterLabel(String string) {
-        filterTextLabel = string;
-    }
-    
-    public void create() {
-        super.create();
-        setTextFilterFocus();
-    }
-    
-    protected void setTextFilterFocus() {
-        textFilter.setFocus();        
-    }
-
-    public Control createDialogArea(Composite parent) {
-        getShell().setText(dialogTitle);
-
-        Composite mainComposite = (Composite) super.createDialogArea(parent);
-        GridData gData = (GridData) mainComposite.getLayoutData();
-        gData.heightHint = 500;
-        gData.widthHint = 400;
-
-        // Subclasses may use this Composite to add desired widgets
-        //topComposite = new Composite(mainComposite, SWT.NONE);
-        //topComposite.setLayoutData(new GridData());
-        //topComposite.setLayout(new GridLayout());
-        
-        // do we need to introduce a method here to contain this
-        // so we can add different parent other than 'topComposite'
-        Composite filterLabelAndTree = new Composite(mainComposite, SWT.NONE);
-        GridLayout layout = new GridLayout();
-        layout.marginWidth = 0;
-        filterLabelAndTree.setLayoutData(new GridData(GridData.FILL_BOTH));
-        filterLabelAndTree.setLayout(layout);
-
-        // Create Text textFilter
-        Label filterLabel = new Label(filterLabelAndTree, SWT.NONE);
-        filterLabel.setText(filterTextLabel);// + "(? = any character, * = any string):"); // TODO: Externalize String
-
-        textFilter = new Text(filterLabelAndTree, SWT.SINGLE | SWT.BORDER);
-        textFilter.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));        
-        textFilter.addModifyListener(new TextFilterModifyAdapter());
-        GridData textFilterData = new GridData();
-        textFilterData.horizontalAlignment = GridData.FILL;
-        textFilterData.grabExcessHorizontalSpace = true;
-        textFilter.setLayoutData(textFilterData);
-
-        //textFilter.setSelection(0);
-        //textFilter.setf
-        
-        
-        // Create Component TreeViewer
-        createComponentTreeViewer(filterLabelAndTree);
-
-        // Create Qualifier List widget
-        Label qualifierLabel = new Label(mainComposite, SWT.NONE);
-        qualifierLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_QUALIFIER"));
-
-        qualifierList = new org.eclipse.swt.widgets.List(mainComposite, SWT.BORDER | SWT.SINGLE);
-        GridData data = new GridData();
-        data.horizontalAlignment = GridData.FILL;
-        data.grabExcessHorizontalSpace = true;
-        data.heightHint = 45;
-        qualifierList.setLayoutData(data);
-                
-        bottomComposite = new Composite(mainComposite, SWT.NONE);
-        bottomComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        bottomComposite.setLayout(new GridLayout());
-
-        // Populate the Component TreeViewer via the provider
-        // TODO: Is this the right way to set/get the ContentProvider?
-        componentTreeViewer.setContentProvider(new ComponentTreeContentProvider());
-        componentTreeViewer.setLabelProvider(provider.getLabelProvider());
-        componentTreeViewer.setSorter(new ViewerSorter());
-        componentTreeViewer.setInput(componentTreeViewerInput);
-        
-        populateMasterComponentList();
-        refreshTreeViewer("");
-
-        return mainComposite;
-    }
-
-    protected TreeViewer createTreeViewer(Composite comp, String title) {
-        Label label = new Label(comp, SWT.NONE);
-        label.setText(title);
-
-        TreeViewer treeViewer = new TreeViewer(new Tree(comp, SWT.SINGLE | SWT.BORDER));
-        Control treeWidget = treeViewer.getTree();
-        GridData gd = new GridData(GridData.FILL_BOTH);
-        treeWidget.setLayoutData(gd);
-
-        return treeViewer;
-    }
-    
-    /*
-     * Creates the Component TreeViewer.
-     */
-    private void createComponentTreeViewer(Composite base) {
-        componentTreeViewer = createTreeViewer(base, componentListLabel);    
-        
-        componentTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-            public void selectionChanged(SelectionChangedEvent event) {
-                IStructuredSelection structuredSelection = (IStructuredSelection) event.getSelection();
-                List qualifiers = provider.getQualifiers(structuredSelection.getFirstElement());
-                updateQualifierList(qualifiers);
-                updateCanFinish();
-            }
-        });
-    }
-    
-    private void updateQualifierList(List qualifiers) {
-        qualifierList.removeAll();
-        Iterator it = qualifiers.iterator();
-        while (it.hasNext()) {
-            qualifierList.add(it.next().toString());
-        }
-    }
-    
-    
-    /*
-     * Returns the processed filter text for the Text field.  Inserts a "."
-     * before each supported meta-character.
-     */
-    protected String getProcessedFilterString() {
-        return processFilterString(textFilter.getText());
-    }
-
-    /*
-     * If supported metacharacters are used in the filter string, we need to
-     * insert a "." before each metacharacter.
-     */
-    private String processFilterString(String inputString) {
-        if (!(inputString.equals(""))) {
-            inputString = insertString("*", ".", inputString);
-            inputString = insertString("?", ".", inputString);
-            inputString = inputString + ".*";
-        } else {
-            inputString = ".*";
-        }
-
-        return inputString.toLowerCase();
-    }
-    
-    /*
-     * Helper method to insert a "." before each metacharacter in the
-     * search/filter string.
-     */
-    private String insertString(String target, String newString, String string) {
-        StringBuffer stringBuffer = new StringBuffer(string);
-
-        int index = stringBuffer.indexOf(target);
-        while (index != -1) {
-            stringBuffer = stringBuffer.insert(index, newString);
-            index = stringBuffer.indexOf(target, index + newString.length() + target.length());
-        }
-
-        return stringBuffer.toString();
-    }
-
-    /*
-     * Listens to changes made in the text filter widget
-     */
-    private class TextFilterModifyAdapter implements ModifyListener {
-        public void modifyText(ModifyEvent e) {
-            if (e.widget == textFilter) {
-                if (delayedEvent != null) {
-                    delayedEvent.CANCEL = true;
-                }
-
-                delayedEvent = new DelayedEvent();
-                Display.getCurrent().timerExec(400, delayedEvent);
-            }
-        }
-    }
-
-    //TODO... do we really need one instance?
-    private DelayedEvent delayedEvent;
-
-    /*
-     * Update the component TreeViewer when the text filter is modified.
-     * Use a DelayedEvent so we don't update on every keystroke.
-     */
-    private class DelayedEvent implements Runnable {
-        public boolean CANCEL = false;
-
-        public void run() {
-            if (!CANCEL) {
-                refreshTreeViewer(getProcessedFilterString());
-                
-                // Select first match
-                if (componentTreeViewer.getTree().getItemCount() > 0) {
-                    TreeItem item = componentTreeViewer.getTree().getItems()[0];
-                    TreeItem items[] = new TreeItem[1];
-                    items[0] = item;
-                    componentTreeViewer.getTree().setSelection(items);
-                }
-                
-                // Update qualifierList
-                IStructuredSelection structuredSelection = (IStructuredSelection) componentTreeViewer.getSelection();
-                List qualifiers = provider.getQualifiers(structuredSelection.getFirstElement());
-                updateQualifierList(qualifiers);
-                
-                updateCanFinish();
-            }
-        }
-    }
-
-    class ComponentList implements IComponentList {
-        private Vector objectVector = new Vector();
-        private long currentChangeCounter = 0;
-        
-        public void addComponent(Object o) {
-            objectVector.add(o);
-            currentChangeCounter++;
-            doViewerUpdate();
-        }
-        
-        private void doViewerUpdate() {
-            // TODO: Investigate if we should also add a timer condition??
-            if (currentChangeCounter == 10) {
-                currentChangeCounter = 0;
-                fireUpdateList(this);
-            }
-        }
-
-        public int size() {
-            return objectVector.size();
-        }
-        
-        public List subList(int startIndex, int endIndex) {
-            return objectVector.subList(startIndex, endIndex);
-        }
-        
-        public Iterator iterator() {
-            return objectVector.iterator();
-        }
-    }
-
-    
-    // this method gets called from a non-ui thread so needs to call
-    // asyncExec to ensure the UI updates happen on the UI thread
-    //
-    protected void fireUpdateList(final ComponentList list) {    
-        Runnable runnable = new Runnable() {
-            public void run(){
-                // add new objects
-                int growingListSize = list.size();
-                int currentSize = masterComponentList.size();
-                if (growingListSize > currentSize) {
-                    masterComponentList.addAll(list.subList(currentSize, growingListSize));
-                }
-
-                refreshTreeViewer(getProcessedFilterString());
-            }
-        };
-        display.asyncExec(runnable);        
-    }
-
-    
-    /*
-     * Populate the Component TreeViewer with items.
-     */
-    protected void populateMasterComponentList() {
-        masterComponentList.clear();
-        
-        final ComponentList componentList = new ComponentList();
-        provider.getComponents(componentList, true);
-        
-        Job job = new Job("read components") {
-          protected IStatus run(IProgressMonitor monitor) {
-            try {
-              // this stuff gets executed on a non-UI thread
-              //
-              provider.getComponents(componentList, false);
-              
-              // Do a final update of our Input for the component tree viewer.
-              fireUpdateList(componentList);
-            }
-            catch (Exception e) {
-            }
-            return Status.OK_STATUS;
-          }          
-        };
-        job.schedule();
-    }
-    
-    protected void refreshTreeViewer(String filterText) {
-        componentTreeViewerInput.clear();
-        ILabelProvider labelProvider = provider.getLabelProvider();
-        Pattern regex = Pattern.compile(filterText);
-        Iterator it = masterComponentList.iterator();
-        while (it.hasNext()) {
-            Object item = it.next();
-            String itemString = labelProvider.getText(item);           
-            Matcher m = regex.matcher(itemString.toLowerCase());
-            if (itemString.toLowerCase().startsWith(filterText) || m.matches()) {
-                componentTreeViewerInput.add(item);
-            }
-        }
-        
-        componentTreeViewer.refresh();
-    }
-    
-    /*
-     * If there is a selection in the ComponentTreeViewer, enable OK
-     */
-    protected void updateCanFinish() {
-        IStructuredSelection selection = (IStructuredSelection) componentTreeViewer.getSelection();
-        if (selection.getFirstElement() != null) {
-            getButton(IDialogConstants.OK_ID).setEnabled(true);
-        }
-        else {
-            getButton(IDialogConstants.OK_ID).setEnabled(false);
-        }
-    }
-    
-    protected void okPressed() {
-        IStructuredSelection selection = (IStructuredSelection) componentTreeViewer.getSelection();
-        componentSelection = selection.getFirstElement();
-        int qualifierIndex = qualifierList.getSelectionIndex();
-        if (qualifierIndex < 0) {
-            qualifierIndex = 0;
-        }
-        qualifierTextSelection = qualifierList.getItem(qualifierIndex);
-        
-        super.okPressed();
-    }
-    
-    private class ComponentTreeContentProvider implements ITreeContentProvider {
-        public Object[] getChildren(Object parentElement) {
-            if (parentElement instanceof List) {
-                return ((List) parentElement).toArray();
-            }
-            return new Object[0];
-        }
-        
-        public Object[] getElements(Object inputElement) {
-            return getChildren(inputElement);
-        }
-        
-        public Object getParent(Object element) {
-            return null;
-        }
-        
-        public boolean hasChildren(Object element) {
-            if (getChildren(element).length > 0) {
-                return true;
-            }
-            return false;
-        }
-        
-        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-        }
-        
-        public void dispose() {
-        }
-    }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentList.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentList.java
deleted file mode 100644
index 5c5d46a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentList.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs.types.common;
-
-import java.util.Iterator;
-
-public interface IComponentList {
-   public void addComponent(Object o);
-   public Iterator iterator();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentSelectionProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentSelectionProvider.java
deleted file mode 100644
index de68271..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/common/IComponentSelectionProvider.java
+++ /dev/null
@@ -1,27 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs.types.common;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-
-public interface IComponentSelectionProvider {
-    
-    // warning ... this will get called on a non UI thread
-    void getComponents(IComponentList list, boolean quick);
-    
-	String getType(Object component);
-	ILabelProvider getLabelProvider();
-	List getQualifiers(Object component);
-	String getNameFieldTitle();
-	String getListTitle();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/ResourceView.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/ResourceView.java
deleted file mode 100644
index 2a61449..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/ResourceView.java
+++ /dev/null
@@ -1,141 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs.types.xml;
-
-public class ResourceView {
-/*
-	Label scopeComboLabel = new Label(topComposite, SWT.NONE);
-	scopeComboLabel.setText(searchScopeComboLabel);
-	scopeCombo = new Combo(topComposite, SWT.NONE);
-	initializeSearchScopeCombo();
-	
-	sashForm = new SashForm(topComposite,  SWT.VERTICAL);
-	GridData sashGD = new GridData(GridData.FILL_BOTH);
-	sashGD.grabExcessHorizontalSpace = true;
-	sashGD.grabExcessVerticalSpace = true;
-	sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
-	sashForm.setLayout(new GridLayout());
-	
-				int[] sashFormWeights = new int[2];
-			sashFormWeights[0] = 0;
-			sashFormWeights[1] = 7;
-			sashForm.setWeights(sashFormWeights);
-	
-	// Create PageBook for High Level TreeViewer
-			highLevelPageBook = new PageBook(sashForm, SWT.NONE);
-			GridData fileSystemPBData = new GridData();
-			fileSystemPBData.horizontalAlignment = SWT.FILL;
-			highLevelPageBook.setLayoutData(fileSystemPBData);
-			
-			blankHighLevelComposite = new Composite(highLevelPageBook, SWT.NONE);
-			highLevelComposite = new Composite(highLevelPageBook, SWT.NONE);
-			GridLayout fileSystemLayout = new GridLayout();
-			fileSystemLayout.marginWidth = 0;
-			highLevelComposite.setLayout(fileSystemLayout);
-			highLevelComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-			createHighLevelTreeViewer(highLevelComposite);
-			populateHighLevelTreeViewer();
-			
-			highLevelPageBook.showPage(blankHighLevelComposite);
-//////////////////////////////////////////////////////////////////////////////	//
-			
-		/*
-		 * Creates the High Level TreeViewer (Top TreeViewer).
-		 *
-		private void createHighLevelTreeViewer(Composite base) {
-			highLevelTreeViewer = createTreeViewer(highLevelComposite, "Resources");
-			initializeHighLevelTreeViewer();
-			String ext[] = new String[1];
-			ext[0] = "xsd";
-			addFilterExtensions(highLevelTreeViewer, ext, new IFile[0]); 
-			
-			initializeHighLevelTreeViewer();
-			populateHighLevelTreeViewer();
-		}
-        
-        
-          protected void showHighLevelView(boolean show) {
-        if (show) {
-            int[] sashFormWeights = new int[2];
-            sashFormWeights[0] = 4;
-            sashFormWeights[1] = 5;
-            sashForm.setWeights(sashFormWeights);
-
-            highLevelPageBook.showPage(highLevelComposite);
-            topComposite.layout(true, true);
-
-            showHighLevelView();
-        } else {
-            int[] sashFormWeights = new int[2];
-            sashFormWeights[0] = 0;
-            sashFormWeights[1] = 7;
-            sashForm.setWeights(sashFormWeights);
-
-            highLevelPageBook.showPage(blankHighLevelComposite);
-            topComposite.layout(true, true);
-
-            hideHighLevelView();
-        }
-    }
-    
-    protected void setFilter(TreeViewer treeViewer, ViewerFilter filter) {
-        treeViewer.getTree().setRedraw(false);
-        treeViewer.resetFilters();
-        treeViewer.addFilter(filter);
-        treeViewer.getTree().setRedraw(true);
-        treeViewer.getTree().redraw();
-    }
-    
-  // ///////////////////////////////////////////////////
-    // This is a convenience method that allows filtering of the given file
-    // exensions. It internally creates a ResourceFilter so that users of this
-    // class don't have to construct one.
-    // If the extensions provided don't have '.', one will be added.
-    protected void addFilterExtensions(TreeViewer treeViewer, String[] filterExtensions, IFile[] excludedFiles) {
-        // First add the '.' to the filterExtensions if they don't already have
-        // one
-        String[] correctedFilterExtensions = new String[filterExtensions.length];
-        for (int i = 0; i < filterExtensions.length; i++) {
-            // If the extension doesn't start with a '.', then add one.
-            if (filterExtensions[i].startsWith(".")) {
-                correctedFilterExtensions[i] = filterExtensions[i];
-            } else {
-                correctedFilterExtensions[i] = "." + filterExtensions[i];
-            }
-        }
-        ViewerFilter filter;
-        if (excludedFiles != null) {
-            filter = new SetTypeResourceFilter(correctedFilterExtensions, excludedFiles, null);
-        } else {
-            filter = new SetTypeResourceFilter(correctedFilterExtensions, null);
-        }
-        setFilter(treeViewer, filter);
-    }    
-    
-    
-  
-     * Creates a Generic TreeViewer object with the specified label and sets
-     * it's GridData value.
-  
-    protected TreeViewer createTreeViewer(Composite comp, String title) {
-        Label label = new Label(comp, SWT.NONE);
-        label.setText(title);
-
-        TreeViewer treeViewer = new TreeViewer(new Tree(comp, SWT.SINGLE | SWT.BORDER));
-        Control treeWidget = treeViewer.getTree();
-        GridData gd = new GridData(GridData.FILL_BOTH);
-        treeWidget.setLayoutData(gd);
-
-        return treeViewer;
-    }
-*/		
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentFinder.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentFinder.java
deleted file mode 100644
index d73adcb..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentFinder.java
+++ /dev/null
@@ -1,114 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs.types.xml;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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;
-
-/**
- * this thing parsers xml artifacts and picks out the specified components attributes
- * 
- */
-public class XMLComponentFinder {
-    public static final int ENCLOSING_PROJECT_SCOPE = 0;
-    public static final int ENTIRE_WORKSPACE_SCOPE = 1;
-
-    protected IFile currentIFile;
-	protected List validExtensions;			// List of extensions as String objects
-	protected List excludeFiles;			// List of files (full path) as String objects
-
-	public XMLComponentFinder() {
-		validExtensions = new ArrayList();
-		excludeFiles = new ArrayList();
-	}
-    
-    /*
-     * Takes in the IFile we are currently editing.
-     * The currentIFile must be set before the getEnclosingProjectFiles()
-     * method will return correctly.
-     */
-    public void setFile(IFile file) {
-        currentIFile = file;
-    }
-    
-    public void setValidExtensions(List newExtensions) {
-        validExtensions.clear();
-        validExtensions.addAll(newExtensions);
-    }
-
-    public void addExcludeFiles(List newExclude) {
-        excludeFiles.addAll(newExclude);
-    }
-
-    /*
-     * Returns a List of absolute file locations. For example
-     * "D:\files\....\file.xsd"
-     */
-    protected List getEnclosingProjectFiles() {
-        List files = new ArrayList();
-        
-        if (currentIFile != null) {
-            IProject project = currentIFile.getProject();
-            try {
-                traverseIContainer(project, validExtensions, excludeFiles, files);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-        
-        return files;
-    }
-
-    protected List getWorkspaceFiles() {
-        List files = new ArrayList();
-        IWorkspaceRoot iwr = ResourcesPlugin.getWorkspace().getRoot();
-        IProject[] projects = iwr.getProjects();
-
-        try {
-            for (int index = 0; index < projects.length; index++) {
-                traverseIContainer(projects[index], validExtensions, excludeFiles, files);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        return files;
-    }
-
-    /**
-     * Returns a List of absolute file locations. For example
-     * "D:\files\....\file.xsd"
-     */
-    protected void traverseIContainer(IContainer container, List extensions, List excludeFiles, List list) throws Exception {
-        IResource[] children = container.members();
-
-        for (int index = 0; index < children.length; index++) {
-            if (children[index] instanceof IFolder) {
-                traverseIContainer((IFolder) children[index], extensions, excludeFiles, list);
-            } else if (children[index] instanceof IFile) {
-                IFile file = (IFile) children[index];
-                String fileName = file.getLocation().toOSString();
-                String ext = file.getFileExtension();
-                if (extensions.contains(ext) && !excludeFiles.contains(fileName)) {
-                    list.add(file.getLocation());
-                }
-            }
-        }
-    }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionDialog.java
deleted file mode 100644
index d9a74d5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionDialog.java
+++ /dev/null
@@ -1,180 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs.types.xml;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-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.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.common.ComponentSelectionDialog;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.common.IComponentSelectionProvider;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentSelectionProvider.XMLComponentTreeObject;
-
-public class XMLComponentSelectionDialog extends ComponentSelectionDialog {
-
-    protected final static String DEFAULT_NAME_FIELD_TITLE = XSDEditorPlugin.getXSDString("_UI_LABEL_COMPONENT_NAME");
-    protected final static String DEFAULT_LIST_TITLE = XSDEditorPlugin.getXSDString("_UI_LABEL_MATCHING_COMPONENTS");
-	
-	public static final String SCOPE_SPECIFIED_FILE = XSDEditorPlugin.getXSDString("_UI_LABEL_SPECIFIED_FILE");
-
-	public static final String SCOPE_ENCLOSING_PROJECT = XSDEditorPlugin.getXSDString("_UI_LABEL_ENCLOSING_PROJECT");
-
-	public static final String SCOPE_WORKSPACE = XSDEditorPlugin.getXSDString("_UI_LABEL_WORKSPACE");
-
-	public static final String SCOPE_CURRENT_RESOURCE = XSDEditorPlugin.getXSDString("_UI_LABEL_CURRENT_RESOURCE");
-
-	private String currentSearchScope = SCOPE_CURRENT_RESOURCE;
-
-	protected Button chooseButton;
-	protected Button[] radioButton = new Button[3];
-
-	public XMLComponentSelectionDialog(Shell shell, String dialogTitle,
-			IComponentSelectionProvider provider) {
-		super(shell, dialogTitle, provider);
-	}
-
-public Control createDialogArea(Composite parent) {
-
-        setFilterLabel(provider.getNameFieldTitle() != null ? provider.getNameFieldTitle() : DEFAULT_NAME_FIELD_TITLE);         
-        setComponentTreeLabel(provider.getListTitle() != null ? provider.getListTitle() : DEFAULT_LIST_TITLE);
-        super.createDialogArea(parent);
-        
-        // We use the Composite topComposite to create additional widgets
-        GridLayout layout = new GridLayout();
-        layout.marginWidth = 0;
-        bottomComposite.setLayout(layout);
-        
-        
-        Group group = new Group(bottomComposite, SWT.NONE);
-        GridLayout gridLayout = new GridLayout(3, false);
-        //gridLayout.marginWidth = 0;
-        //gridLayout.marginLeft = 2;
-        group.setLayout(gridLayout);
-        group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        group.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_SEARCH_SCOPE"));
-        
-        ScopeChangeListener scopeChangeListener = new ScopeChangeListener();
-        radioButton[0] = new Button(group, SWT.RADIO);       
-        radioButton[0].setText(SCOPE_WORKSPACE);
-        
-        radioButton[1] = new Button(group, SWT.RADIO);
-        radioButton[1].setText(SCOPE_ENCLOSING_PROJECT);
-        
-        radioButton[2] = new Button(group, SWT.RADIO);
-        radioButton[2].setText(SCOPE_CURRENT_RESOURCE);
-        
-        //radioButton[3] = new Button(group, SWT.RADIO);
-        //radioButton[3].setText("Resource Set");
-
-        
-        for (int i = 0; i < radioButton.length; i++)
-        {          	
-          if (radioButton[i].getText().equals(currentSearchScope))
-          {
-          	radioButton[i].setSelection(true);
-          }	
-          radioButton[i].addSelectionListener(scopeChangeListener);        	
-        }
-        if (false){
-        Composite selectFileGroup = new Composite(group, SWT.NONE);
-        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-        gd.horizontalSpan = 2;
-        selectFileGroup.setLayoutData(gd);
-        GridLayout gridLayout3 = new GridLayout(2, false);       
-        gridLayout3.marginWidth = 0;    
-        gridLayout3.marginHeight = 0;
-        selectFileGroup.setLayout(gridLayout3);
-        Text t = new Text(selectFileGroup, SWT.BORDER | SWT.READ_ONLY);
-        t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        Button choose = new Button(selectFileGroup, SWT.NONE);
-        choose.setText("Choose...");
-        choose.addSelectionListener(scopeChangeListener);
-        }
-        
-        
-        Button check = new Button(group, SWT.CHECK);
-        check.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_NARROW_SEARCH_SCOPE_RESOURCE"));
-        GridData gd = new GridData();
-        gd.horizontalSpan = 3;
-        check.setLayoutData(gd);
-        check.setEnabled(false);
-
-        return parent;
-    }	/*
-		  * Returns the selected search scope.
-		  */
-	public String getSearchScope() {
-		return currentSearchScope;
-	}
-
-	public XMLComponentSpecification getSelection() {
-		XMLComponentTreeObject treeObject = (XMLComponentTreeObject) componentSelection;
-		List specs = treeObject.getXMLComponentSpecification();
-
-		int matchingIndex = 0;
-		for (int index = 0; index < specs.size(); index++) {
-			XMLComponentSpecification spec = (XMLComponentSpecification) specs
-					.get(index);
-			IPath path = new Path(spec.getFileLocation());
-			String specText = spec.getTargetNamespace() + " - "
-					+ path.lastSegment();
-			if (specText.equals(qualifierTextSelection)) {
-				matchingIndex = index;
-				break;
-			}
-		}
-
-		return (XMLComponentSpecification) specs.get(matchingIndex);
-	}
-
-	private class ScopeChangeListener extends SelectionAdapter {
-		public void widgetSelected(SelectionEvent e) {
-
-			if (e.widget instanceof Button) {
-				Button b = (Button) e.widget;
-				if ((b.getStyle() & SWT.RADIO) != 0) {
-					currentSearchScope = b.getText();
-					populateMasterComponentList();
-					refreshTreeViewer(getProcessedFilterString());
-
-					// Select the first matching component. Though we should be
-					// smarter here
-					// and determine if there was a selection before the scope
-					// switch (and if
-					// the component is still available.
-					Tree tree = componentTreeViewer.getTree();
-					TreeItem items[] = tree.getItems();
-					if (items.length > 0) {
-						TreeItem select[] = new TreeItem[1];
-						select[0] = items[0];
-						tree.setSelection(select);
-					}
-
-					updateCanFinish();
-				}				
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionProvider.java
deleted file mode 100644
index aef0a01..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSelectionProvider.java
+++ /dev/null
@@ -1,141 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs.types.xml;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.common.IComponentList;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.common.IComponentSelectionProvider;
-
-public abstract class XMLComponentSelectionProvider implements IComponentSelectionProvider {
-    public List getQualifiers(Object component) {
-        List qualifiers = new ArrayList();
-        if (component != null) {
-            XMLComponentTreeObject specification = (XMLComponentTreeObject) component;
-            Iterator it = specification.getXMLComponentSpecification().iterator();
-            while (it.hasNext()) {
-                XMLComponentSpecification spec = (XMLComponentSpecification) it.next();
-                qualifiers.add(createQualifierText(spec));
-            }
-        }
-        
-        return qualifiers;
-    }
-    
-    protected String createQualifierText(XMLComponentSpecification spec) {
-        IPath path = new Path(spec.getFileLocation());
-        return spec.getTargetNamespace() + " - " + path.lastSegment();        
-    }
-    
-    protected void addDataItemToTreeNode(IComponentList comps, XMLComponentSpecification dataItem) {
-        boolean foundMatch = false;
-        Iterator it = comps.iterator();
-        XMLComponentTreeObject containingTreeObject = null;
-
-        while (it.hasNext()) {
-            XMLComponentTreeObject treeObject = (XMLComponentTreeObject) it.next();
-            if (treeObject.getName().equals(dataItem.getAttributeInfo("name"))) {
-                // If the existing data item and the new data item have the same names
-                if (treeObject.getXMLComponentSpecification().size() > 0) {
-                    String existingPath = ((XMLComponentSpecification) treeObject.getXMLComponentSpecification().get(0)).getTagPath();
-                    if (existingPath.equals(dataItem.getTagPath())) {
-                        // If they are the same 'type' of items (according to the path value)
-                        containingTreeObject = treeObject;
-                        foundMatch = true;
-                        break;
-                    }
-                }
-            }
-        }
-        
-        if (!foundMatch) {
-            containingTreeObject = new XMLComponentTreeObject(dataItem);
-            comps.addComponent(containingTreeObject);
-        }
-        else {
-            // Only add to the tree object if the qualifier text differs than existing
-            // qualifier information contained in the tree object.
-            Iterator existingQualifiers = getQualifiers(containingTreeObject).iterator();
-            boolean alreadyExists = false;
-            while (existingQualifiers.hasNext()) {
-                String existingText = (String) existingQualifiers.next();
-                String newItemText = createQualifierText(dataItem);
-                if (existingText.equals(newItemText)) {
-                    alreadyExists = true;
-                    break;
-                }
-            }
-            
-            if (!alreadyExists) {
-                containingTreeObject.addXMLComponentSpecification(dataItem);
-            }
-        }
-    }
-    
-    protected String getNormalizedLocation(String location) {
-        try {
-            URL url = new URL(location);
-            URL resolvedURL = Platform.resolve(url);
-            location = resolvedURL.getPath();
-        }
-        catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        return location;
-    }
-
-    
-    /*
-     * Object used to hold components with the same name but different qualifiers.
-     * This object will contain a list of XMLComponentSpecifications (with the same
-     * names but different qualifiers).
-     */
-    public class XMLComponentTreeObject {
-        private String name;
-        private List xmlComponentSpecifications;
-        
-        public XMLComponentTreeObject(XMLComponentSpecification spec) {
-            xmlComponentSpecifications = new ArrayList();
-            xmlComponentSpecifications.add(spec);
-            name = (String) spec.getAttributeInfo("name");
-        }
-        
-        public String getName() {
-            return name;
-        }
-        
-        public void addXMLComponentSpecification(XMLComponentSpecification spec) {
-            xmlComponentSpecifications.add(spec);
-        }
-        
-        public List getXMLComponentSpecification() {
-            return xmlComponentSpecifications;
-        }
-    }
-
-    /*
-     * Used to provide labels to the ComponentSeletionDialog
-     */
-    public class XMLComponentSelectionLabelProvider extends LabelProvider {
-        public String getText(Object element) {
-            XMLComponentTreeObject specification = (XMLComponentTreeObject) element;
-            return specification.getName();
-        }        
-    }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSpecification.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSpecification.java
deleted file mode 100644
index 04c2546..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLComponentSpecification.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs.types.xml;
-
-import java.util.Hashtable;
-
-/*
- * Simple class which keeps track of attribute information.
- * This class is basically a Hashtable with convenience methods.
- */
-public class XMLComponentSpecification {
-    String tagPath;
-    Hashtable hashtable;
-    String targetNamespace;
-    String fileLocation;
-    
-    public XMLComponentSpecification(String path) {
-        this.tagPath = path;
-        hashtable = new Hashtable();
-    }
-    
-    public void addAttributeInfo(Object attribute, Object value) {
-        hashtable.put(attribute, value);
-    }
-    
-    public Object getAttributeInfo(Object attribute) {
-        return hashtable.get(attribute);
-    }
-    
-    public String getTagPath() {
-        return tagPath;
-    }
-    
-    public String getTargetNamespace() {
-        return targetNamespace;
-    }
-    
-    public void setTargetNamespace(String tns) {
-        targetNamespace = tns;
-    }
-    
-    public String getFileLocation() {
-        return fileLocation;
-    }
-    
-    public void setFileLocation(String location) {
-        fileLocation = location;
-    }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLQuickScan.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLQuickScan.java
deleted file mode 100644
index 30409c2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xml/XMLQuickScan.java
+++ /dev/null
@@ -1,130 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs.types.xml;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- *
- */
-public class XMLQuickScan {
-  
-	/*
-	 * Returns information about matches encountered
-     * based on the criteria provided. 
-	 */
-  public static List getTagInfo(String fullFilePath, List paths, List attributes) {
-    XSDGlobalElementTypeContentHandler handler = new XSDGlobalElementTypeContentHandler();
-    handler.stringTagPaths = paths;
-    handler.searchAttributes = attributes;
-    handler.fileLocation = fullFilePath;
-
-    ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader();
-    
-    try {
-        IPath path = new Path(fullFilePath);
-    	FileInputStream inputStream = new FileInputStream(new File(path.toOSString()));
-    	
-        
-//      SAXParser  sparser = SAXParserFactory.newInstance().newSAXParser();
-//      XMLReader reader = sparser.getXMLReader();
-        
-        // Line below is a hack to get XMLReader working
-        Thread.currentThread().setContextClassLoader(XMLQuickScan.class.getClassLoader());
-        
-    	XMLReader reader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
-    	reader.setContentHandler(handler);
-    	reader.parse(new InputSource(inputStream));
-    }
-    catch (Exception e) {
-    	e.printStackTrace();
-    }
-    finally {
-      Thread.currentThread().setContextClassLoader(prevClassLoader);
-    }
-    return handler.getSearchAttributeValues();
-  }
-  
-  public static class XSDGlobalElementTypeContentHandler extends DefaultHandler {
-  	protected List stringTagPaths;
-  	protected List searchAttributes;
-  	private List matchingTags = new ArrayList();
-  	private String targetNamespace = "";
-  	private String fileLocation;
-
-  	StringBuffer currentPath = new StringBuffer();
-  	
-    public void startElement(String uri, String localName, String qName, Attributes attributes)  throws SAXException {
-    	currentPath.append("/" + localName);
-    	
-    	// Search for targetNamespace if we haven't encountered it yet.
-    	if (targetNamespace.equals("")) {
-	        int nAttributes = attributes.getLength();
-	        for (int i = 0; i < nAttributes; i++)
-	        {
-	          if (attributes.getLocalName(i).equals("targetNamespace"))
-	          {
-	            targetNamespace = attributes.getValue(i);
-	            break;
-	          }
-	        }
-    	}
-    	
-    	// Search for the path
-    	for (int index = 0; index < stringTagPaths.size(); index++) {
-    		String path = (String) stringTagPaths.get(index);
-    		if (currentPath.length() == path.length() && currentPath.toString().equals(path)) {
-    			// Found a path match
-    			createTagInfo(attributes, (String[]) searchAttributes.get(index));
-    		}
-    	}
-    }
-    
-    public void endElement(String uri, String localName, String qName) throws SAXException {
-    	int slashIndex = currentPath.lastIndexOf("/");
-    	currentPath.delete(slashIndex, currentPath.length());
-    }
-    
-    /*
-     * Information about a tag is stored in a TagInfo class.
-     */
-    private void createTagInfo(Attributes attributes, String[] attributesToSearch) {
-    	XMLComponentSpecification spec = new XMLComponentSpecification(currentPath.toString());
-    	
-//    	tagInfo.addAttributeInfo("name", attributes.getValue("name"));
-    	for (int index = 0; index < attributesToSearch.length; index++) {
-    		String attrString = (String) attributesToSearch[index];
-    		String value = attributes.getValue(attrString);
-    		if (value != null) {
-    			spec.addAttributeInfo(attrString, value);
-    		}
-    	}
-    	spec.setTargetNamespace(targetNamespace);
-    	spec.setFileLocation(fileLocation);
-    	matchingTags.add(spec);
-    }
-        
-    public List getSearchAttributeValues() {
-    	return matchingTags;
-    }
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentFinder.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentFinder.java
deleted file mode 100644
index 7f9fc7d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentFinder.java
+++ /dev/null
@@ -1,70 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentFinder;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLQuickScan;
-
-public class XSDComponentFinder extends XMLComponentFinder {    
-    public XSDComponentFinder() {
-        validExtensions.add("xsd");
-    }
-    
-    public List getWorkbenchResourceComponents(int scope) {
-        List components = new ArrayList();
-        List filePaths = new ArrayList();
-        
-        // We don't want to search through the current file we're working on.
-        if (currentIFile != null) {
-            excludeFiles.add(currentIFile.getLocation().toOSString());
-        }
-        
-        // Find files matching the search criteria specified in List extensions and
-        // List excludeFiles.
-        switch (scope) {
-        case ENCLOSING_PROJECT_SCOPE:
-            filePaths = getEnclosingProjectFiles();
-            break;
-            
-        case ENTIRE_WORKSPACE_SCOPE:
-            filePaths = getWorkspaceFiles();
-            break;
-            
-        default:            
-            break;
-        }
-        
-        // Search for the components in each of the files specified in the path.
-        List paths = new ArrayList();
-        paths.add("/schema/complexType");
-        paths.add("/schema/simpleType");
-        
-        List attributes = new ArrayList();
-        String[] nameAttr = new String[1];
-        nameAttr[0] = "name";
-        attributes.add(nameAttr);
-        attributes.add(nameAttr);
-
-        Iterator pathsIterator = filePaths.iterator();
-        while (pathsIterator.hasNext()) {
-//           String stringPath = ((Path) pathsIterator.next()).toOSString();
-           String stringPath = ((Path) pathsIterator.next()).toString();
-           components.addAll(XMLQuickScan.getTagInfo(stringPath, paths, attributes));
-        }
-        
-        return components;
-    }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionDialog.java
deleted file mode 100644
index b66e13c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionDialog.java
+++ /dev/null
@@ -1,28 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd;
-
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.common.IComponentSelectionProvider;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentSelectionDialog;
-
-public class XSDComponentSelectionDialog extends XMLComponentSelectionDialog {
-
-	public static final int ELEMENT = 1;
-	public static final int TYPE = 2;
-	
-	public XSDComponentSelectionDialog(Shell shell, String dialogTitle,
-			IComponentSelectionProvider provider) {
-		super(shell, dialogTitle, provider);
-	}
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionProvider.java
deleted file mode 100644
index d1936d4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDComponentSelectionProvider.java
+++ /dev/null
@@ -1,346 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.common.IComponentList;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentFinder;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentSelectionProvider;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.impl.XSDImportImpl;
-import org.eclipse.xsd.util.XSDConstants;
-
-/*
- *
- */
-public class XSDComponentSelectionProvider extends XMLComponentSelectionProvider {
-    private XSDComponentFinder xsdComponentFinder;
-    private XSDComponentSelectionDialog dialog;
-    private XSDSchema schema;
-    private XSDComponentLabelProvider labelProvider;
-    
-    private boolean showComplexTypes = true;
-    
-    /*
-     * Takes in the IFile we are currently editing.
-     */
-    public XSDComponentSelectionProvider(IFile file, XSDSchema schema) {
-        xsdComponentFinder = new XSDComponentFinder();
-        xsdComponentFinder.setFile(file);
-        this.schema = schema;
-        labelProvider = new XSDComponentLabelProvider();
-    }
-    
-    public void setDialog(XSDComponentSelectionDialog dialog) {
-        this.dialog = dialog;
-    }
-    
-    public void showComplexTypes(boolean show) {
-        showComplexTypes = show;
-    }
-    
-    public String getType(Object element) {
-        return null;
-    }
-        
-    /*
-     * The return value is a List of XMLComponentTreeObjects.
-     * 
-     */
-	public void getComponents(IComponentList list, boolean quick) {
-	    if (quick) {
-            // Populate IComponentList list with components most easily accessible (fastest)
-            // Grab Built-In types
-            Iterator builtInIt = getBuiltInTypes().iterator();
-            while (builtInIt.hasNext()) {
-                XMLComponentSpecification tagItem = (XMLComponentSpecification) builtInIt.next();
-                addDataItemToTreeNode(list, tagItem);
-            }
-            
-            // Create current Schema's complex and simple types
-            createComplexTypes(list);
-            createSimpleTypes(list);
-        }
-        else {
-            getComponents(list);
-        }
-	}
-    
-    /*
-     * TODO: Need to revisit how we build up our treeObject list.... 
-     * And it's somewhat messy, clean this up.
-     */
-    private void getComponents(IComponentList list) {
-        List extensions = new ArrayList();
-        extensions.add("xsd");
-        
-        String scope = "";
-        if (dialog != null) {
-            scope = dialog.getSearchScope();
-        }
-        
-        List comps = new ArrayList();
-        if (scope.equals(XSDComponentSelectionDialog.SCOPE_ENCLOSING_PROJECT)) {
-            comps = xsdComponentFinder.getWorkbenchResourceComponents(XMLComponentFinder.ENCLOSING_PROJECT_SCOPE);
-        }
-        else if (scope.equals(XSDComponentSelectionDialog.SCOPE_WORKSPACE)) {
-            comps = xsdComponentFinder.getWorkbenchResourceComponents(XMLComponentFinder.ENTIRE_WORKSPACE_SCOPE);            
-        }
-        
-//      Group same item types together (simple/complex)
-        List complex = new ArrayList();
-        List simple = new ArrayList();
-        Iterator itemsIterator = comps.iterator();
-        while (itemsIterator.hasNext()) {
-            XMLComponentSpecification tagItem = (XMLComponentSpecification) itemsIterator.next();
-            if (tagItem.getTagPath().equals("/schema/complexType")) {
-                complex.add(tagItem);
-            }               
-            else if (tagItem.getTagPath().equals("/schema/simpleType")) {
-                simple.add(tagItem);
-            }
-        }
-        
-        Iterator complexIt = complex.iterator();
-        Iterator simpleIt = simple.iterator();
-        if (showComplexTypes) {
-            while (complexIt.hasNext()) {
-                XMLComponentSpecification item = (XMLComponentSpecification) complexIt.next();
-                addDataItemToTreeNode(list, item);
-            }
-        }
-        
-        while (simpleIt.hasNext()) {
-            XMLComponentSpecification item = (XMLComponentSpecification) simpleIt.next();
-            addDataItemToTreeNode(list, item);
-        }
-        
-        // Create from imports, includes, and redefines
-        createFromImport(list);
-        createFromInclude(list);
-        createFromRedefine(list);
-    }
-    
-////////////////////////////////////////////////////////////////////////////////    
-    private List getBuiltInTypes() {        
-        List items = new ArrayList();
-        for (int i = 0; i < XSDDOMHelper.dataType.length; i++) {
-          items.add(XSDDOMHelper.dataType[i][0]);
-        }
-        Iterator it = items.iterator();
-        
-        List builtInComponentSpecs = new ArrayList();
-        while (it.hasNext()) {
-            Object item = it.next();
-            String itemString = item.toString();
-            
-            XMLComponentSpecification builtInTypeItem = new XMLComponentSpecification("BUILT_IN_SIMPLE_TYPE");
-            builtInTypeItem.addAttributeInfo("name", itemString);
-            builtInTypeItem.setTargetNamespace(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
-//            String normalizedFile = getNormalizedLocation(schema.getSchemaLocation());
-//            builtInTypeItem.setFileLocation(normalizedFile);
-            builtInTypeItem.setFileLocation("Built-In");
-            
-            builtInComponentSpecs.add(builtInTypeItem);
-        }
-        
-        return builtInComponentSpecs;
-    }
-
-    private void createComplexTypes(IComponentList treeObjectList) {
-        TypesHelper typesHelper = new TypesHelper(schema);
-        List complexTypes = typesHelper.getUserComplexTypes();
-        createComplexSimpleTreeObject(treeObjectList, complexTypes, true);
-    }
-    
-    private void createSimpleTypes(IComponentList treeObjectList) {
-        TypesHelper typesHelper = new TypesHelper(schema);
-        List complexTypes = typesHelper.getUserSimpleTypes();
-        createComplexSimpleTreeObject(treeObjectList, complexTypes, true);
-    }
-
-    
-    private void createFromImport(IComponentList treeObjectList) {
-        Iterator imports = getXSDImports().iterator();
-        while (imports.hasNext()) {
-            XSDImport importItem = (XSDImport) imports.next();
-            if (importItem.getSchemaLocation() != null) {
-                ((XSDImportImpl) importItem).importSchema();
-                TypesHelper helper = new TypesHelper(importItem.getResolvedSchema());
-                
-                List types = helper.getUserComplexTypes();
-                types.addAll(helper.getUserSimpleTypes());
-                createComplexSimpleTreeObject(treeObjectList, types, false);
-            }
-        }
-    }
-    
-        private void createFromInclude(IComponentList treeObjectList) {
-        Iterator imports = getXSDIncludes().iterator();
-        while (imports.hasNext()) {
-            XSDInclude includeItem = (XSDInclude) imports.next();
-            if (includeItem.getSchemaLocation() != null) {
-                TypesHelper helper = new TypesHelper(includeItem.getResolvedSchema());  
-                
-                List types = helper.getUserComplexTypes();
-                types.addAll(helper.getUserSimpleTypes());
-                createComplexSimpleTreeObject(treeObjectList, types, false);
-            }
-        }
-    }
-    
-    private void createFromRedefine(IComponentList treeObjectList) {
-        Iterator redefines = getXSDRedefines().iterator();
-        while (redefines.hasNext()) {
-            XSDRedefine redefineItem = (XSDRedefine) redefines.next();
-            if (redefineItem.getSchemaLocation() != null) {
-                TypesHelper helper = new TypesHelper(redefineItem.getResolvedSchema());
-                
-                List types = helper.getUserComplexTypes();
-                types.addAll(helper.getUserSimpleTypes());
-                createComplexSimpleTreeObject(treeObjectList, types, false);
-            }
-        }
-    }
-    
-        protected List getXSDImports() {
-        List imports = new ArrayList();
-        
-        Iterator contents = schema.getContents().iterator();
-        while (contents.hasNext()) {
-            XSDSchemaContent content = (XSDSchemaContent) contents.next();
-            if (content instanceof XSDImport) {
-                imports.add(content);             
-            }
-        }
-        
-        return imports;
-    }
-    
-    protected List getXSDIncludes() {
-        List includes = new ArrayList();
-        
-        Iterator contents = schema.getContents().iterator();
-        while (contents.hasNext()) {
-            XSDSchemaContent content = (XSDSchemaContent) contents.next();
-            if (content instanceof XSDInclude) {
-                includes.add(content);            
-            }
-        }
-        
-        return includes;
-    }
-
-    protected List getXSDRedefines() {
-        List includes = new ArrayList();
-        
-        Iterator contents = schema.getContents().iterator();
-        while (contents.hasNext()) {
-            XSDSchemaContent content = (XSDSchemaContent) contents.next();
-            if (content instanceof XSDRedefine) {
-                includes.add(content);            
-            }
-        }
-        
-        return includes;
-    }
-
-    private void createComplexSimpleTreeObject(IComponentList treeObjectList, List complexTypes, boolean sameNS) {
-        boolean proceed = true;
-        
-        for (int i = 0; i < complexTypes.size(); i++) {
-            XSDNamedComponent item = (XSDNamedComponent) complexTypes.get(i); 
-        
-            if (sameNS) {
-                // We do this check because Types from Includes might show up.  However, we don't want to show them
-                String itemLocation = item.getSchema().getSchemaLocation();
-                String currentSchemaLocation = schema.getSchemaLocation();
-                if (itemLocation != null) {
-                    proceed = itemLocation.equals(currentSchemaLocation);
-                }
-                else {
-                    proceed = false;
-                }
-            }
-            
-            if (proceed) {
-                XMLComponentSpecification typeItem =  null;
-                if (showComplexTypes && item instanceof XSDComplexTypeDefinition) {
-                    typeItem = new XMLComponentSpecification("/schema/complexType");
-                    typeItem.addAttributeInfo("name", ((XSDComplexTypeDefinition) item).getName());
-                }
-                else if (item instanceof XSDSimpleTypeDefinition) {
-                    typeItem = new XMLComponentSpecification("/schema/simpleType");
-                    typeItem.addAttributeInfo("name", ((XSDSimpleTypeDefinition) item).getName());
-                }
-                
-                if (typeItem != null) {
-                    typeItem.setTargetNamespace(item.getTargetNamespace());
-                    String normalizedFile = getNormalizedLocation(schema.getSchemaLocation());
-                    typeItem.setFileLocation(normalizedFile);
-    
-                    addDataItemToTreeNode(treeObjectList, typeItem);
-                }
-            }
-        }
-    }
-
-    
-	public ILabelProvider getLabelProvider() {
-		return labelProvider;
-	}
-
-    
-    public class XSDComponentLabelProvider extends XMLComponentSelectionLabelProvider {
-        public Image getImage(Object element) {
-            XMLComponentTreeObject specification = (XMLComponentTreeObject) element;
-            XMLComponentSpecification spec = (XMLComponentSpecification) specification.getXMLComponentSpecification().get(0);
-            if (spec.getTagPath().equals("/schema/complexType")) {
-                return XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif");
-            }
-            else if (spec.getTagPath().equals("/schema/simpleType")) {
-                return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
-            }
-            else if (spec.getTagPath().equals("BUILT_IN_SIMPLE_TYPE")) {
-                return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
-            }
-    
-            return null;
-        }
-    }
-    
-    
-
-	public String getListTitle() {
-		return XSDEditorPlugin.getXSDString("_UI_LABEL_MATCHING_TYPES");
-	}
-
-	public String getNameFieldTitle() {
-		return XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE_NAME");
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDSetTypeHelper.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDSetTypeHelper.java
deleted file mode 100644
index a5b8e17..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dialogs/types/xsd/XSDSetTypeHelper.java
+++ /dev/null
@@ -1,358 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateElementAction;
-import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.refactor.delete.XSDExternalFileCleanup;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.util.XSDConstants;
-import org.eclipse.xsd.util.XSDParser;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class XSDSetTypeHelper {
-    private XSDSchema xsdSchema;
-    private IFile currentIFile;
-    
-    public XSDSetTypeHelper(IFile iFile, XSDSchema schema) {
-        currentIFile = iFile;
-        xsdSchema = schema;
-    }
-
-    public void setType(Element element, String property, XMLComponentSpecification spec) {
-        addImportIfNecessary(element, spec);        
-        String typeObject = getPrefixedTypeName(spec);
-        
-        // Get the previous type --> previousStringType
-        String previousStringType = "";
-        Attr attr = element.getAttributeNode(property);
-        if (attr != null) {
-            attr.getValue();
-        }
-
-        if (!XSDDOMHelper.inputEquals(element, XSDConstants.UNION_ELEMENT_TAG, false))
-        {
-            if (spec != null && spec.getTagPath().equals("**anonymous**"))
-            {
-              if (spec.getTagPath().equals("ANONYMOUS_SIMPLE_TYPE"))
-              {
-                if (!previousStringType.equals("**anonymous**"))
-                {
-                  updateElementToAnonymous(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-                }
-              }
-              else
-              {
-                if (!previousStringType.equals("**anonymous**"))
-                {
-                  updateElementToAnonymous(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-                }
-              }
-              // element.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);
-              element.removeAttribute(property);
-            }
-            else
-            {
-              XSDDOMHelper.updateElementToNotAnonymous(element);
-              //element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, typeObject.toString());
-              element.setAttribute(property, typeObject.toString());
-            }
-        }
-    }
-    
-    public void addImportIfNecessary(Element element, XMLComponentSpecification spec) {
-        
-        // Get the new type --> typeObject
-        if (spec != null) {
-            String itemType = spec.getTagPath();
-           
-            if (!itemType.equals("BUILT_IN_SIMPLE_TYPE")) {
-                // Do an actual import if needed
-                XSDParser parser = new XSDParser();
-                parser.parse(spec.getFileLocation());
-                XSDSchema schema = parser.getSchema();
-                String tns = schema.getTargetNamespace();
-                
-                boolean exists = false;
-                // Check if the type is defined in the 'current' file itself.
-                String currentFile = getNormalizedLocation(xsdSchema.getSchemaLocation());
-                IPath currentFilePath = new Path(currentFile);
-                if (currentFilePath.equals(new Path(spec.getFileLocation()))) {
-                    exists = true;
-                }
-
-                if (!exists) {
-                    if (tns.equals(xsdSchema.getTargetNamespace())) {
-                        // Check if the schema is in a redefine/include
-                        List existingList = getXSDIncludes();
-                        existingList.addAll(getXSDRedefines());
-                        Iterator it = existingList.iterator();
-                        while (it.hasNext()) {
-                            XSDSchemaDirective existingSchema = (XSDSchemaDirective) it.next();
-                            String normalizedFile = getNormalizedLocation(existingSchema.getResolvedSchema().getSchemaLocation());
-                            String normalizedSpec = spec.getFileLocation();
-                            
-                            if (normalizedFile.equals(normalizedSpec)) {
-                                // Found and existing one
-                                exists = true;
-                            }
-                        }                        
-                    }
-                    else {
-                        // Check if the schema is in a import
-                        List existingList = getXSDImports();
-                        Iterator it = existingList.iterator();
-                        while (it.hasNext()) {
-                            XSDSchemaDirective existingSchema = (XSDSchemaDirective) it.next();
-                            String normalizedFile = getNormalizedLocation(existingSchema.getResolvedSchema().getSchemaLocation());
-                            String normalizedSpec = spec.getFileLocation();
-
-                            if (normalizedFile.equals(normalizedSpec)) {
-                                // Found and existing one
-                                exists = true;
-                            }
-                        }                        
-                    }
-                }
-                
-                if (!exists) {
-                    doImport(spec.getFileLocation(), schema);
-                }
-            }
-        }
-    }
-    
-    /*
-     * Return the prefixed type name for the type described by the given
-     * XMLComponentSpecification object.
-     * If the type described is a Built-in type, do not add the prefix
-     */
-    public String getPrefixedTypeName(XMLComponentSpecification spec) {
-        String typeObject = (String) spec.getAttributeInfo("name");
-        
-        TypesHelper typesHelper = new TypesHelper(xsdSchema); // ???? Is this correct?
-        List prefixedNames = typesHelper.getPrefixedNames(spec.getTargetNamespace(), typeObject);
-        if (prefixedNames.size() > 0) {
-            // Grab the first prefixed name
-            typeObject = (String) prefixedNames.get(0);
-        }
-
-        return typeObject;
-    }
-    
-    private void updateElementToAnonymous(Element element, String xsdType) {
-        String prefix = element.getPrefix();
-        prefix = (prefix == null) ? "" : (prefix + ":");
-        XSDDOMHelper.updateElementToNotAnonymous(element);
-        Element childNode = null;
-        if (xsdType.equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG)) {
-            childNode = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-        }
-        else if (xsdType.equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG)) {
-            childNode = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-        }
-        
-        if (childNode != null) {
-            XSDDOMHelper helper = new XSDDOMHelper();
-            Node annotationNode = helper.getChildNode(element, XSDConstants.ANNOTATION_ELEMENT_TAG);
-            if (annotationNode == null) {
-                Node firstChild = element.getFirstChild();
-                element.insertBefore(childNode, firstChild);
-            } else {
-                Node nextSibling = annotationNode.getNextSibling();
-                element.insertBefore(childNode, nextSibling);
-            }
-            XSDDOMHelper.formatChild(childNode);
-        }
-    }
-
-    // TODO: We shouldn't need to pass in IPath externalSchemaPath.
-    private void doImport(String externalSchemaPath, XSDSchema externalSchema) {
-        // Determine schemaLocation
-        String locationAttribute = URIHelper.getRelativeURI(externalSchemaPath, currentIFile.getLocation().toOSString());
-        
-        boolean isInclude = false;
-        if (externalSchema.getTargetNamespace().equals(xsdSchema.getTargetNamespace())) {
-            isInclude = true;
-        }
-        
-        if (externalSchema != null) { // In case we have problems loading the file.... we should display an error message.
-                Element newElement;
-                if (isInclude) {                
-                    List attributes = new ArrayList();
-                    attributes.add(new DOMAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, locationAttribute));
-                    newElement = createElement(XSDConstants.INCLUDE_ELEMENT_TAG, attributes);
-                }
-                else if (!isInclude) {
-                    List attributes = new ArrayList();
-                    attributes.add(new DOMAttribute(XSDConstants.NAMESPACE_ATTRIBUTE, externalSchema.getTargetNamespace()));
-                    attributes.add(new DOMAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, locationAttribute));
-                    newElement = createElement(XSDConstants.IMPORT_ELEMENT_TAG, attributes);
-                    handleImportNS(newElement, externalSchema);
-                }
-        }
-    }
-
-    private void handleImportNS(Element importElement, XSDSchema externalSchema) {
-        String namespace = externalSchema.getTargetNamespace();
-        if (namespace == null) namespace = "";
-
-        XSDImport xsdImport = (XSDImport) xsdSchema.getCorrespondingComponent(importElement);
-        xsdImport.setResolvedSchema(externalSchema);
-        
-        java.util.Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-        
-//        System.out.println("changed Import Map is " + map.values());
-//        System.out.println("changed import Map keys are " + map.keySet());
-
-        // Referential integrity on old import
-        // How can we be sure that if the newlocation is the same as the oldlocation
-        // the file hasn't changed
-        
-        XSDSchema referencedSchema = xsdImport.getResolvedSchema();
-        if (referencedSchema != null)
-        {
-          XSDExternalFileCleanup cleanHelper = new XSDExternalFileCleanup(referencedSchema);
-          cleanHelper.visitSchema(xsdSchema);
-        }
-
-        Element schemaElement = xsdSchema.getElement();
-
-        // update the xmlns in the schema element first, and then update the import element next
-        // so that the last change will be in the import element.  This keeps the selection
-        // on the import element
-        TypesHelper helper = new TypesHelper(externalSchema);
-        String prefix = helper.getPrefix(namespace, false);
-        
-        if (map.containsKey(prefix))
-        {
-          prefix = null;
-        }
-
-        if (prefix == null || (prefix !=null && prefix.length() == 0))
-        {
-          StringBuffer newPrefix = new StringBuffer("pref");  //$NON-NLS-1$
-          int prefixExtension = 1;
-          while (map.containsKey(newPrefix.toString()) && prefixExtension < 100)
-          {
-            newPrefix = new StringBuffer("pref" + String.valueOf(prefixExtension));
-            prefixExtension++;
-          }
-          prefix = newPrefix.toString();
-        }
-
-        if (namespace.length() > 0)
-        {
-          // if ns already in map, use its corresponding prefix
-          if (map.containsValue(namespace))
-          {
-            TypesHelper typesHelper = new TypesHelper(xsdSchema);
-            prefix = typesHelper.getPrefix(namespace, false);
-          }
-          else // otherwise add to the map
-          {
-            schemaElement.setAttribute("xmlns:"+prefix, namespace);
-          }
-        }
-
-
-//        System.out.println("changed Import Map is " + map.values());
-//        System.out.println("changed import Map keys are " + map.keySet());
-    }
-    
-    private Element createElement(String elementTag, List attributes) {
-        Node relativeNode = XSDDOMHelper.getNextElementNode(xsdSchema.getElement().getFirstChild());
-        
-        CreateElementAction action = new CreateElementAction("");
-        action.setElementTag(elementTag);
-        action.setAttributes(attributes);
-        action.setParentNode(xsdSchema.getElement());
-        action.setRelativeNode(relativeNode);
-        action.setXSDSchema(xsdSchema);
-        return action.createAndAddNewChildElement();
-    }
-
-    private String getNormalizedLocation(String location) {
-        try {
-            URL url = new URL(location);
-            URL resolvedURL = Platform.resolve(url);
-            location = resolvedURL.getPath();
-        }
-        catch (Exception e) {
-            e.printStackTrace();
-        }
-        
-        return location; 
-      }
-    
-    private List getXSDImports() {
-        List imports = new ArrayList();
-        
-        Iterator contents = xsdSchema.getContents().iterator();
-        while (contents.hasNext()) {
-            XSDSchemaContent content = (XSDSchemaContent) contents.next();
-            if (content instanceof XSDImport) {
-                imports.add(content);             
-            }
-        }
-        
-        return imports;
-    }
-    
-    private List getXSDIncludes() {
-        List includes = new ArrayList();
-        
-        Iterator contents = xsdSchema.getContents().iterator();
-        while (contents.hasNext()) {
-            XSDSchemaContent content = (XSDSchemaContent) contents.next();
-            if (content instanceof XSDInclude) {
-                includes.add(content);            
-            }
-        }
-        
-        return includes;
-    }
-
-    private List getXSDRedefines() {
-        List includes = new ArrayList();
-        
-        Iterator contents = xsdSchema.getContents().iterator();
-        while (contents.hasNext()) {
-            XSDSchemaContent content = (XSDSchemaContent) contents.next();
-            if (content instanceof XSDRedefine) {
-                includes.add(content);            
-            }
-        }
-        
-        return includes;
-    }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/BaseDragNodesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/BaseDragNodesCommand.java
deleted file mode 100644
index d83fc47..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/BaseDragNodesCommand.java
+++ /dev/null
@@ -1,103 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dnd;
-
-import java.util.Collection;
-
-import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Node;
-
-
-public abstract class BaseDragNodesCommand extends DefaultDragAndDropCommand
-{
-  /**
-   * Constructor for BaseDragNodesCommand.
-   * @param target
-   * @param location
-   * @param operations
-   * @param operation
-   * @param sources
-   */
-  public BaseDragNodesCommand(
-    Object target,
-    float location,
-    int operations,
-    int operation,
-    Collection sources)
-  {
-    super(target, location, operations, operation, sources);
-  }
-
-  protected boolean isDirectSchemaChild(Node node)
-  {
-    Node parent = node.getParentNode();
-    if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false) &&
-        parent.getParentNode().equals(parent.getOwnerDocument()))
-    {
-      return true;
-    }
-    return false;
-  } 
-  
-  protected boolean isSiblingNodes(Node first, Node second)
-  {
-    if (first.getParentNode() != null)
-    {
-      return first.getParentNode().equals(second.getParentNode());
-    }
-    return false;
-  }
-  
-  protected void beginRecording()
-  {
-    if (target != null)
-    {
-      IDOMModel model = getModel((Node)target);
-      
-      if (model != null)
-      {
-        model.beginRecording(this, XSDEditorPlugin.getXSDString("_UI_LABEL_MOVE"));
-      }
-    }
-  }
-  
-  protected void endRecording()
-  {
-    if (target != null)
-    {
-      IDOMModel model = getModel((Node)target);
-      
-      if (model != null)
-      {
-        model.endRecording(this);
-      }
-    }
-  }
-  protected IDOMModel getModel(Node node)
-  {
-    Object object = node.getOwnerDocument();
-    if (object instanceof DocumentImpl)
-    {
-      return ((DocumentImpl) object).getModel();
-    }
-    return null;
-  }
-  
-  protected void moveNode(Node referenceNode, Node nodeToMove, boolean isBefore)
-  {
-    XSDDOMHelper.moveNode(referenceNode, nodeToMove, isBefore);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/DragNodesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/DragNodesCommand.java
deleted file mode 100644
index fa0d0b9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/DragNodesCommand.java
+++ /dev/null
@@ -1,77 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dnd;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.NodeFormatter;
-import org.w3c.dom.Node;
-
-public class DragNodesCommand extends BaseDragNodesCommand
-{
-  /**
-   * Constructor for DragNodesCommand.
-   * @param target
-   * @param location
-   * @param operations
-   * @param operation
-   * @param sources
-   */
-  public DragNodesCommand(
-    Object target,
-    float location,
-    int operations,
-    int operation,
-    Collection sources)
-  {
-    super(target, location, operations, operation, sources);
-  }
-
-  /**
-   * @see org.eclipse.wst.common.ui.internal.dnd.DragAndDropCommand#canExecute()
-   */
-  public boolean canExecute()
-  {
-    if (sources.size() > 0)
-    {
-      Node firstSource = (Node) sources.toArray()[0];
-      return isSiblingNodes((Node) target, firstSource);
-    }
-    return false;
-//    return isDirectSchemaChild((Node)target);
-  }
-
-  
-  /**
-   * @see org.eclipse.wst.common.ui.internal.dnd.DragAndDropCommand#execute()
-   */
-  public void execute()
-  {
-  	NodeFormatter formatProcessor = new NodeFormatter();
-    Node referenceNode = (Node) target;
-    Iterator iter = sources.iterator();
-    beginRecording();
-
-    while (iter.hasNext()) 
-    {
-      Node node = (Node) iter.next();
-      if (isSiblingNodes(referenceNode,node)) 
-      {
-        moveNode(referenceNode, node, !isAfter());
-        formatProcessor.format((IDOMNode)node);
-      }
-    }
-//    formatProcessor.format((XMLNode)referenceNode.getParentNode());
-    endRecording();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/XSDDragAndDropManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/XSDDragAndDropManager.java
deleted file mode 100644
index 7c52cc9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/dnd/XSDDragAndDropManager.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dnd;
-
-import java.util.Collection;
-
-import org.eclipse.wst.common.ui.internal.dnd.DragAndDropCommand;
-import org.eclipse.wst.common.ui.internal.dnd.DragAndDropManager;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Node;
-
-public class XSDDragAndDropManager implements DragAndDropManager
-{
-  /**
-   * Constructor for XSDDragAndDropManager.
-   */
-  public XSDDragAndDropManager()
-  {
-  }
-  
-  protected boolean isDirectSchemaChild(Node node)
-  {
-    Node parent = node.getParentNode();
-    if (XSDDOMHelper.inputEquals(parent, XSDConstants.SCHEMA_ELEMENT_TAG, false) &&
-        parent.getParentNode().equals(parent.getOwnerDocument()))
-    {
-      return true;
-    }
-    return false;
-  } 
-
-  /**
-   * @see org.eclipse.wst.common.ui.internal.dnd.DragAndDropManager#createCommand(Object, float, int, int, Collection)
-   */
-  public DragAndDropCommand createCommand(
-    Object target,
-    float location,
-    int operations,
-    int operation,
-    Collection source)
-  {
-    if (target instanceof Node) 
-    {
-      return new DragNodesCommand(target, location, operations, operation, source);
-    }
-    return null;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/editparts/AbstractComponentViewerRootEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/editparts/AbstractComponentViewerRootEditPart.java
deleted file mode 100644
index caef397..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/editparts/AbstractComponentViewerRootEditPart.java
+++ /dev/null
@@ -1,63 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.editparts;
-                                      
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ContainerLayout;
-              
-
-public abstract class AbstractComponentViewerRootEditPart extends AbstractGraphicalEditPart 
-{
-  protected final static String MESSAGE_PLACE_HOLDER = "MESSAGE_PLACE_HOLDER";
-  protected Object input;              
-
-  public void setInput(Object input)
-  {
-    this.input = input;
-    refreshChildren();
-  }
-
-  protected IFigure createFigure()
-  {
-    Panel panel = new Panel();
-    ContainerLayout layout = new ContainerLayout();
-    layout.setBorder(60);
-    panel.setLayoutManager(layout);
-    return panel;
-  }   
-           
-
-  protected List getModelChildren() 
-  {               
-    List list = new ArrayList();
-    if (input != null)
-    {
-      list.add(input);
-    }
-    else
-    {
-      list.add(MESSAGE_PLACE_HOLDER);
-    }
-    return list;
-  }         
-
-  protected abstract EditPart createChild(Object model);
-  
-  protected void createEditPolicies()
-  {  
-  }             
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectedEditPartFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectedEditPartFigure.java
deleted file mode 100644
index f25f677..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectedEditPartFigure.java
+++ /dev/null
@@ -1,138 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-           
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-
-              
-public class ConnectedEditPartFigure extends ContainerFigure implements IConnectedEditPartFigure
-{                 
-  protected EditPart editPart;
-  protected boolean childConnectionsEnabled = true;
-  protected List connectedFigures = new ArrayList();
-  protected int connectionType = RIGHT_CONNECTION;
-    
-  public ConnectedEditPartFigure(EditPart editPart)
-  {
-    this.editPart = editPart;    
-  }     
-
-  public void setChildConnectionsEnabled(boolean enabled)
-  {
-    childConnectionsEnabled = enabled;
-  }          
-
-  protected IConnectedEditPartFigure getParentGraphNodeFigure()
-  {
-    IConnectedEditPartFigure result = null;
-    for (EditPart parentEditPart = editPart.getParent(); parentEditPart != null; parentEditPart = parentEditPart.getParent())
-    {                                                              
-      IFigure figure = ((AbstractGraphicalEditPart)parentEditPart).getFigure();    
-      if (figure instanceof IConnectedEditPartFigure)
-      {                                                            
-        IConnectedEditPartFigure graphNodeFigure = (IConnectedEditPartFigure)figure;
-        if (graphNodeFigure.getConnectionFigure() != null)
-        {
-          result = graphNodeFigure;
-          break;
-        }
-      }          
-    }          
-    return result;
-  }
-
-  public void addNotify()                     
-  {           
-    super.addNotify();
-    if (getConnectionFigure() != null)
-    {
-      IConnectedEditPartFigure parentGraphNodeFigure = getParentGraphNodeFigure();
-      if (parentGraphNodeFigure != null)
-      {   
-        parentGraphNodeFigure.addConnectedFigure(this);
-      }   
-    }
-  }   
-
-  public void removeNotify()
-  {
-    super.removeNotify();
-    if (getConnectionFigure() != null)
-    {
-      IConnectedEditPartFigure parentGraphNodeFigure = getParentGraphNodeFigure();
-      if (parentGraphNodeFigure != null)
-      {   
-        parentGraphNodeFigure.removeConnectedFigure(this);
-      }   
-    }
-  }   
-
-  public void addConnectedFigure(IConnectedEditPartFigure figure)
-  {   
-    if (childConnectionsEnabled) 
-    {  
-      // this test is required since we sometimes receive the 'addNotify' call twice
-      //
-      if (!connectedFigures.contains(figure))
-      {
-        connectedFigures.add(figure);
-      }
-    }
-  }
-
-  public void removeConnectedFigure(IConnectedEditPartFigure figure)
-  {
-    if (childConnectionsEnabled) 
-    { 
-      connectedFigures.remove(figure);
-    }
-  }    
-                    
-  public IFigure getSelectionFigure()
-  {
-    return this;
-  }
-
-  public IFigure getConnectionFigure()
-  {
-    return this;
-  }
-
-  public List getConnectedFigures(int type)
-  {
-    List list = new ArrayList();
-    for (Iterator i = connectedFigures.iterator(); i.hasNext(); )
-    {           
-      IConnectedEditPartFigure figure = (IConnectedEditPartFigure)i.next();
-      //if (type == 0 || type == figure.getConnectionType())
-      {
-        list.add(figure);
-      }      
-    }
-    return list;
-  }                               
-
-  public int getConnectionType()
-  {
-    return connectionType;
-  }
-
-  public void setConnectionType(int type)
-  {
-    connectionType = type;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectionRenderingFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectionRenderingFigure.java
deleted file mode 100644
index 7192108..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectionRenderingFigure.java
+++ /dev/null
@@ -1,215 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-        
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-              
-
-public class ConnectionRenderingFigure extends RectangleFigure
-{               
-  protected boolean isOutlined = true;
-  protected IFigure primaryLayer;
-
-  public ConnectionRenderingFigure(IFigure primaryLayer)
-  {
-    setOpaque(false);                   
-    this.primaryLayer = primaryLayer;
-    //setFocusTraversable(false); 
-    //setEnabled(false); 
-  }
-           
-  protected boolean isMouseEventTarget()
-  {
-    return false;
-  }        
-
-  public boolean containsPoint(int x, int y)
-  {
-    return false;
-  }
-
-  protected void fillShape(Graphics graphics)
-  { 
-    graphics.setForegroundColor(ColorConstants.black);
-    drawLines(graphics, primaryLayer);
-  }
-
-  protected void outlineShape(Graphics graphics)
-  { 
-    if (isOutlined)
-    {
-      super.outlineShape(graphics);
-    }
-  } 
-
-  protected void drawLines(Graphics graphics, IFigure figure)
-  {      
-    if (figure instanceof IConnectedEditPartFigure)
-    {
-      IConnectedEditPartFigure graphNodeFigure = (IConnectedEditPartFigure)figure;         
-      List connectedFigures = graphNodeFigure.getConnectedFigures(IConnectedEditPartFigure.RIGHT_CONNECTION);
-      int connectedFiguresSize = connectedFigures.size();              
-
-      if (connectedFiguresSize > 0) 
-      {                                         
-        IConnectedEditPartFigure firstGraphNodeFigure = (IConnectedEditPartFigure)connectedFigures.get(0);
-        Rectangle r = graphNodeFigure.getConnectionFigure().getBounds();    
-          
-        int x1 = r.x + r.width;
-        int y1 = r.y + r.height/2;
-                                                                                   
-        int startOfChildBox = firstGraphNodeFigure.getConnectionFigure().getBounds().x;
-        int x2 = x1 + (startOfChildBox - x1) / 3;
-        int y2 = y1;
-      
-        if (connectedFiguresSize == 1)
-        {
-          graphics.drawLine(x1, y1, startOfChildBox, y2);   
-        }
-        else // (connectedFigures.length > 1)
-        { 
-          graphics.drawLine(x1, y1, x2, y2);
-
-          int minY = Integer.MAX_VALUE;
-          int maxY = -1;
-
-          for (Iterator i = connectedFigures.iterator(); i.hasNext(); )
-          {                                 
-            IConnectedEditPartFigure connectedFigure = (IConnectedEditPartFigure)i.next();
-            Rectangle childConnectionRectangle = connectedFigure.getConnectionFigure().getBounds();
-            int y = childConnectionRectangle.y + childConnectionRectangle.height / 2;
-            minY = Math.min(minY, y);
-            maxY = Math.max(maxY, y);
-            graphics.drawLine(x2, y, childConnectionRectangle.x, y);
-          }                   
-          graphics.drawLine(x2, minY, x2, maxY);
-        }                          
-      }                             
-    }            
-
-    //boolean visitChildren = true;
-    List children = figure.getChildren();
-    for (Iterator i = children.iterator(); i.hasNext(); )
-    {
-      IFigure child = (IFigure)i.next();
-      drawLines(graphics, child);
-    }
-  }    
-
-  // This method supports the preview connection line function related to drag and drop
-  //     
-  public PointList getConnectionPoints(GraphicalEditPart parentEditPart, GraphicalEditPart childRefEditPart, Rectangle draggedFigureBounds)
-  {           
-    PointList pointList = new PointList();                         
-    int[] data = new int[1];
-    Point a = getConnectionPoint(parentEditPart, childRefEditPart, data);
-    if (a != null)
-    {   
-      int draggedFigureBoundsY = draggedFigureBounds.y + draggedFigureBounds.height/2;
-
-      pointList.addPoint(a); 
-      //pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
-      
-      if (data[0] == 0) // insert between 2 items
-      {                                         
-        int x = a.x + (draggedFigureBounds.x - a.x)/2;
-        pointList.addPoint(new Point(x, a.y));
-        pointList.addPoint(new Point(x, draggedFigureBoundsY));        
-        pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
-      }
-      else // insert at first or last position
-      {
-        pointList.addPoint(new Point(a.x, draggedFigureBoundsY));   
-        pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
-      }
-    }       
-    return pointList;
-  }
-
-         
-  // This method supports the preview connection line function related to drag and drop
-  //     
-  protected Point getConnectionPoint(GraphicalEditPart parentEditPart, GraphicalEditPart childRefEditPart, int[] data)
-  {                      
-    Point point = null;     
-    List childList = parentEditPart.getChildren();         
-                                                                                                                                               
-    if (parentEditPart.getFigure() instanceof IConnectedEditPartFigure && childList.size() > 0)
-    {   
-      point = new Point();
-
-      GraphicalEditPart prev = null;    
-      GraphicalEditPart next = null;
-                               
-      for (Iterator i = childList.iterator(); i.hasNext(); )
-      {             
-        Object o = i.next();    
-        if (o instanceof GraphicalEditPart)
-        {
-          GraphicalEditPart childEditPart = (GraphicalEditPart)o;
-          if (childEditPart.getFigure() instanceof IConnectedEditPartFigure)
-          {
-            if (childEditPart == childRefEditPart)
-            {
-              next = childEditPart;
-              break;
-            }                                           
-            prev = childEditPart;
-          }
-        }
-      }                            
-                          
-
-      if (next != null && prev != null)
-      {                   
-        int ya = getConnectedEditPartConnectionBounds(prev).getCenter().y;
-        int yb = getConnectedEditPartConnectionBounds(next).getCenter().y;
-        point.y = ya + (yb - ya)/2;   
-        data[0] = 0;
-      }                               
-      else if (prev != null) // add it last
-      {
-        point.y = getConnectedEditPartConnectionBounds(prev).getCenter().y;
-        data[0] = 1;
-      }
-      else if (next != null) // add it first!
-      {                           
-        point.y = getConnectedEditPartConnectionBounds(next).getCenter().y;
-        data[0] = -1;
-      }
-          
-      if (next != null || prev != null)
-      {
-        GraphicalEditPart child = prev != null ? prev : next;
-        int startOfChildBox = getConnectedEditPartConnectionBounds(child).x;
-        Rectangle r = getConnectedEditPartConnectionBounds(parentEditPart);  
-        int x1 = r.x + r.width;
-        point.x = x1 + (startOfChildBox - x1) / 3;
-      }
-    }    
-    return point;
-  }
-
-  protected Rectangle getConnectedEditPartConnectionBounds(GraphicalEditPart editPart)
-  {
-    return ((IConnectedEditPartFigure)editPart.getFigure()).getConnectionFigure().getBounds();
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerFigure.java
deleted file mode 100644
index d7a77ac..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerFigure.java
+++ /dev/null
@@ -1,60 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-            
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.RectangleFigure;
-              
-public class ContainerFigure extends RectangleFigure implements IExpandable
-{               
-  protected boolean isOutlined = false;
-  protected boolean isExpanded = true;
-
-  public ContainerFigure()
-  {
-    setLayoutManager(new ContainerLayout());
-    setFill(false);
-  }
-
-  public void doLayout()
-  {
-	  layout();
-	  setValid(true);
-  }  
-          
-  public ContainerLayout getContainerLayout()
-  {
-    return (ContainerLayout)getLayoutManager();
-  }           
-
-  public void setOutlined(boolean isOutlined)
-  {
-    this.isOutlined = isOutlined;
-  }     
-
-  protected void outlineShape(Graphics graphics)
-  { 
-    if (isOutlined)
-    {
-      super.outlineShape(graphics);
-    }
-  }
-
-  public boolean isExpanded()
-  {
-    return isExpanded;
-  }
-  
-  public void setExpanded(boolean isExpanded)
-  {
-    this.isExpanded = isExpanded;
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerLayout.java
deleted file mode 100644
index 78480f9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerLayout.java
+++ /dev/null
@@ -1,217 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-                   
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-              
-
-public class ContainerLayout extends AbstractLayout
-{                                         
-  protected boolean isHorizontal;
-  protected int spacing = 0;
-  protected int border = 0; 
-
-  public ContainerLayout()
-  { 
-    this(true, 0); 
-  }             
-
-  public ContainerLayout(boolean isHorizontal, int spacing)
-  {
-    this.isHorizontal = isHorizontal;   
-    this.spacing = spacing;
-  }  
-
-  public void setHorizontal(boolean isHorizontal)
-  {
-    this.isHorizontal = isHorizontal;
-  }  
-
-  public void setSpacing(int spacing)
-  {
-    this.spacing = spacing;
-  }  
-
-  public void setBorder(int border)
-  {
-    this.border = border;
-  }  
-
-  protected int alignFigure(IFigure parent, IFigure child)
-  { 
-    return -1;
-  }
-
-  /**
-   * Calculates and returns the preferred size of the container 
-   * given as input.
-   * 
-   * @param figure  Figure whose preferred size is required.
-   * @return  The preferred size of the passed Figure.
-   */
-  protected Dimension calculatePreferredSizeHelper(IFigure parent)
-  { 
-    Dimension	preferred = new Dimension();
-  	List children = parent.getChildren();
-		                                        
-	  for (int i=0; i < children.size(); i++)
-    {
-		  IFigure child = (IFigure)children.get(i);      
-    
-      Dimension	childSize = child.getPreferredSize();
-	  
-      if (isHorizontal)
-      {
-		    preferred.width += childSize.width;
-		    preferred.height = Math.max(preferred.height, childSize.height);
-      }
-      else
-      {  
-        preferred.height += childSize.height;
-        preferred.width = Math.max(preferred.width, childSize.width);
-      }
-	  }   
-
-    int childrenSize = children.size();
-    if (childrenSize > 1)
-    {                      
-      if (isHorizontal)    
-      {
-        preferred.width += spacing * (childrenSize - 1);
-      }
-      else
-      {
-		    preferred.height += spacing * (childrenSize - 1);
-      } 
-    }
-                          
-    preferred.width += border * 2;
-    preferred.height += border * 2;
-	  preferred.width += parent.getInsets().getWidth();
-	  preferred.height += parent.getInsets().getHeight();       
-  
-  	return preferred;
-  }
-
-  protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
-  {    
-    Dimension	preferred = null;                                              
-                                  
-    // Here we ensure that an unexpanded container is given a size of (0,0)
-    //
-    if (parent instanceof IExpandable)
-    {
-      IExpandable expandableFigure = (IExpandable)parent;
-      if (!expandableFigure.isExpanded())
-      {
-        preferred = new Dimension(); 
-      }
-    }   
-    
-    if (preferred == null)
-    {
-	    preferred = calculatePreferredSizeHelper(parent);    
-    }
-    
-    return preferred;
-  }
-     
-
-  protected void adjustLayoutLocation(IFigure parent, Dimension dimension)
-  {     
-  }   
-
-  public void layout(IFigure parent)
-  {       
-  	List children = parent.getChildren();
- 
-    int rx = 0;
-    Dimension	dimension = new Dimension();                                          
-
-
-	  for (int i=0; i < children.size(); i++)
-    {
-		  IFigure child = (IFigure)children.get(i);
-		  Dimension	childSize = child.getPreferredSize();
-      if (isHorizontal)
-      {   
-        dimension.height = Math.max(dimension.height, childSize.height);
-        rx += childSize.width;
-      }
-      else
-      {
-        dimension.width = Math.max(dimension.width, childSize.width);
-      }
-    }
-
-	  //dimension.width += parent.getInsets().left;
-    //dimension.height += parent.getInsets().top;
-
-    if (isHorizontal)
-    {
-      dimension.height += border*2;
-    	dimension.width += border;
-    }
-    else
-    {
-      dimension.width += border*2;
-    	dimension.height += border;
-    }
-    adjustLayoutLocation(parent, dimension);    
-
-    for (int i=0; i < children.size(); i++)
-    {
-      IFigure child = (IFigure)children.get(i);
-	    Dimension	childSize = child.getPreferredSize();
-        
-      if (isHorizontal)
-      {   
-        int y = -1; 
-    
-        y = alignFigure(parent, child);
-    
-        if (y == -1)
-        {
-           y = (dimension.height - childSize.height) / 2;                                      
-        }                      
-                                                   
-        Rectangle rectangle = new Rectangle(dimension.width, y, childSize.width, childSize.height);
-        rectangle.translate(parent.getClientArea().getLocation());                           
-
-
-        child.setBounds(rectangle);                           
-	      dimension.width += childSize.width; 
-        dimension.width += spacing;       
-
-        if (child instanceof SpacingFigure)
-        {          
-          int availableHorizontalSpace = parent.getClientArea().width - rx;
-          dimension.width += availableHorizontalSpace;
-        }           
-      }
-      else
-      {
-        Rectangle rectangle = new Rectangle(0, dimension.height, childSize.width, childSize.height);
-	      rectangle.translate(parent.getClientArea().getLocation());                                  
-        
-
-        child.setBounds(rectangle);  
-        dimension.height += childSize.height;
-        dimension.height += spacing;
-      }
-	  }	      
-  }                                      
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/FillLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/FillLayout.java
deleted file mode 100644
index 9f3de7c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/FillLayout.java
+++ /dev/null
@@ -1,161 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-
-public class FillLayout extends AbstractLayout
-{         
-  protected boolean isHorizontal = false;                    
-  protected int spacing = 0;
-  public Dimension min;
-
-  public FillLayout(){}     
-  
-  public FillLayout(int spacing)
-  { 
-    this.spacing = spacing; 
-  }
-  
-  public void setHorizontal(boolean isHorizontal)
-  {
-   this.isHorizontal = isHorizontal;
-  }
-  
-  /**
-   * Calculates and returns the preferred size of the input container.
-   * This is the size of the largest child of the container, as all
-   * other children fit into this size.
-   *
-   * @param figure  Container figure for which preferred size is required.
-   * @return  The preferred size of the input figure.
-   */
-
-  protected Dimension calculatePreferredSize(IFigure figure, int width, int height)
-  {	                 
-    Dimension d = calculatePreferredClientAreaSize(figure);
-  	d.expand(figure.getInsets().getWidth(),
-  	         figure.getInsets().getHeight());
-  	d.union(getBorderPreferredSize(figure));
-  	return d;
-  } 
-  
-  protected Dimension calculatePreferredClientAreaSize(IFigure figure)
-  {
-    Dimension d = new Dimension();
-  	List children = figure.getChildren(); 
-  
-  
-  	for (Iterator i = children.iterator(); i.hasNext(); )
-    {
-  		IFigure child = (IFigure)i.next();
-      Dimension childSize = child.getPreferredSize();
-  
-      if (isHorizontal)
-      {
-        d.width += childSize.width;
-        d.height = Math.max(childSize.height, d.height);
-      }
-      else
-      {
-        d.height += childSize.height;
-        d.width = Math.max(childSize.width, d.width);
-      }
-  	}	 
-  
-                     
-    int childrenSize = children.size();       
-    if (childrenSize > 0)
-    {
-      if (isHorizontal)
-      {
-        d.width += spacing * (childrenSize - 1); 
-      }
-      else
-      {
-        d.height += spacing * (childrenSize - 1);  
-      }
-    }       
-      
-    if (min != null)
-    {
-      d.width = Math.max(d.width, min.width);
-      d.height = Math.max(d.height, min.height);
-    }
-    return d;
-  }
-  
-  /*
-   * Returns the minimum size required by the input container.
-   * This is the size of the largest child of the container, as all
-   * other children fit into this size.
-   */
-  public Dimension getMinimumSize(IFigure figure, int width, int height)
-  {
-  	Dimension d = new Dimension();
-  	List children = figure.getChildren();
-  	IFigure child;
-
-  	for (int i=0; i < children.size(); i++)
-    {
-  		child = (IFigure)children.get(i);
-  		d.union(child.getMinimumSize());
-  	}
-  	d.expand(figure.getInsets().getWidth(),
-  	         figure.getInsets().getHeight());
-  	return d;
-  }
-  
-  public Dimension getPreferredSize(IFigure figure, int width, int height)
-  {
-  	return calculatePreferredSize(figure, width, height);
-  }
-  
-  /*
-   * Lays out the children on top of each other with
-   * their sizes equal to that of the available
-   * paintable area of the input container figure.
-   */
-  public void layout(IFigure figure)
-  {                         
-    Dimension	preferredSize = calculatePreferredClientAreaSize(figure);
-  	Rectangle r = figure.getClientArea().getCopy();
-  	List children = figure.getChildren();
-
-    int nChildren = children.size();                                                          
-    int extraHorizontalSpace = r.width - preferredSize.width;
-
-  	for (Iterator i = children.iterator(); i.hasNext(); )
-    {
-  		IFigure child = (IFigure)i.next();
-      Dimension preferredChildSize = child.getPreferredSize();
-         
-      if (isHorizontal)
-      {                       
-        int w = preferredChildSize.width + (extraHorizontalSpace / nChildren);
-  		  child.setBounds(new Rectangle(r.x, r.y, w, Math.max(preferredSize.height, r.height)));
-        r.x += w + spacing;
-      }
-      else
-      {
-  		  child.setBounds(new Rectangle(r.x, r.y, Math.max(preferredSize.width, r.width), preferredChildSize.height));
-        r.y += preferredChildSize.height + spacing;
-      }
-  	}
-  }   
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedEditPartFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedEditPartFigure.java
deleted file mode 100644
index 4c778d7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedEditPartFigure.java
+++ /dev/null
@@ -1,30 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-            
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-
-public interface IConnectedEditPartFigure extends IConnectedFigure
-{                       
-  public static final int UP_CONNECTION = 1; 
-  public static final int DOWN_CONNECTION = 2;
-  public static final int LEFT_CONNECTION = 3;
-  public static final int RIGHT_CONNECTION = 4;
-
-  public IFigure getSelectionFigure();
-  public IFigure getConnectionFigure();
-  public List getConnectedFigures(int type);
-  public int getConnectionType();      
-  public void addConnectedFigure(IConnectedEditPartFigure figure);
-  public void removeConnectedFigure(IConnectedEditPartFigure figure);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedFigure.java
deleted file mode 100644
index 4a6d7de..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedFigure.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-            
-import org.eclipse.draw2d.IFigure;
-
-public interface IConnectedFigure extends IFigure
-{                       
-  public IFigure getConnectionFigure();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectionRenderingViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectionRenderingViewer.java
deleted file mode 100644
index 6ed611d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectionRenderingViewer.java
+++ /dev/null
@@ -1,16 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-
-public interface IConnectionRenderingViewer
-{        
-  public ConnectionRenderingFigure getConnectionRenderingFigure();
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IExpandable.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IExpandable.java
deleted file mode 100644
index 161581b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IExpandable.java
+++ /dev/null
@@ -1,19 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;  
-
-import org.eclipse.draw2d.IFigure;
-
-public interface IExpandable extends IFigure
-{
-  boolean isExpanded(); 
-  void setExpanded(boolean isExpanded);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/SpacingFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/SpacingFigure.java
deleted file mode 100644
index e245d69..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/SpacingFigure.java
+++ /dev/null
@@ -1,27 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-            
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-              
-public class SpacingFigure extends RectangleFigure
-{  
-  public SpacingFigure()
-  {
-    setFill(false);
-    setPreferredSize(new Dimension(0, 0));
-  }
-  
-  //protected void outlineShape(Graphics graphics)
-  //{ 
-  //}                                              
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/BaseGraphicalViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/BaseGraphicalViewer.java
deleted file mode 100644
index 9f1bbec..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/BaseGraphicalViewer.java
+++ /dev/null
@@ -1,199 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.gef.DefaultEditDomain;
-import org.eclipse.gef.EditDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.KeyHandler;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-import org.eclipse.gef.tools.SelectionTool;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.wst.xsd.ui.internal.XSDEditor;
-import org.eclipse.wst.xsd.ui.internal.XSDMenuListener;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ConnectionRenderingFigure;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.IConnectionRenderingViewer;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.CenterLayout;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-
-/**
- * @author ernest
- *
- * To change this generated comment go to 
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public abstract class BaseGraphicalViewer extends ScrollingGraphicalViewer implements IConnectionRenderingViewer
-{
-  protected FigureCanvasKeyboardHandler figureCanvasKeyboardHandler;
-
-  protected EditDomain editDomain;
-
-  protected boolean isInputEnabled = true;
-
-  protected boolean isSelectionEnabled = true;
-
-  protected ISelectionProvider menuSelectionProvider;
-
-  protected GraphContextMenuProvider menuProvider;
-
-  protected XSDEditor editor;
-
-  protected XSDConcreteComponent input;
-
-  protected ConnectionRenderingFigure connectionRenderingFigure;
-
-  public BaseGraphicalViewer(XSDEditor editor, ISelectionProvider selectionProvider)
-  {
-    super();
-    this.editor = editor;
-    menuSelectionProvider = selectionProvider;
-  }
-  
-  public ConnectionRenderingFigure getConnectionRenderingFigure()
-  {
-    return connectionRenderingFigure;
-  }
-
-  public void setInputEnabled(boolean enabled)
-  {
-    isInputEnabled = enabled;
-  }
-
-  public void setSelectionEnabled(boolean enabled)
-  {
-    isSelectionEnabled = enabled;
-  }
-
-  public XSDMenuListener getMenuListener()
-  {
-    return menuProvider.getMenuListener();
-  }
-
-  protected static Color white = null;
-  protected void hookControl()
-  {                     
-    super.hookControl();
-  
-    if (white == null)
-    {
-      white = new Color(getControl().getDisplay(), 255, 255, 255);
-    }
-    getControl().setBackground(white); 
-  
-    editDomain = new DefaultEditDomain(null);
-    ((DefaultEditDomain)editDomain).setDefaultTool(new SelectionTool());
-    editDomain.loadDefaultTool();
-    editDomain.addViewer(this);
-  
-    //jvh - gef port - moved this from below so it is available when adding context menu below
-    menuProvider = new GraphContextMenuProvider(this, menuSelectionProvider);
-    setContextMenu(menuProvider);
-  
-    // add context menu to the graph
-    MenuManager manager = new MenuManager();
-    manager.addMenuListener(getMenuListener());  //jvh - gef port
-    manager.setRemoveAllWhenShown(true);
-    Menu menu = manager.createContextMenu(getControl());
-    getControl().setMenu(menu);
-    
-    // enable popupMenus extension
-    //BUG 68938 eclipse bug fixed. Bug 112955 - Filter out menu contributions.
-    editor.getEditorSite().registerContextMenu("org.eclipse.wst.xsd.ui.popup.graph", manager, menuSelectionProvider, false);
-    
-//    KeyAdapter keyListener = new KeyAdapter()
-//    {
-//      /**
-//       * @see org.eclipse.swt.events.KeyAdapter#keyReleased(KeyEvent)
-//       */
-//      public void keyReleased(KeyEvent e)
-//      {
-//        if (e.character == SWT.DEL)
-//        {
-//          getMenuListener().getDeleteAction().run();
-//        }
-//      }
-//    };
-  
-    setKeyHandler(new XSDGraphicalViewerKeyHandler(this).setParent(new KeyHandler()));
-    
-//    getControl().addKeyListener(keyListener);
-
-    figureCanvasKeyboardHandler = new FigureCanvasKeyboardHandler(this);
-    getFigureCanvas().addKeyListener(figureCanvasKeyboardHandler);
-    
-  	getRootEditPart().activate();		
-                       
-  	ScalableRootEditPart graphicalRootEditPart = (ScalableRootEditPart)getRootEditPart();
-     
-    // set the layout for the primary layer so that the children are always centered
-    //
-    graphicalRootEditPart.getLayer(LayerConstants.PRIMARY_LAYER).setLayoutManager(new CenterLayout());
-  
-    // add the ConnectionRenderingFigure which is responsible for drawing all of the lines in the view
-    //                       
-    IFigure figure = graphicalRootEditPart.getLayer(LayerConstants.HANDLE_LAYER);
-    figure.setLayoutManager(new StackLayout());          
-    connectionRenderingFigure = new ConnectionRenderingFigure(graphicalRootEditPart.getLayer(LayerConstants.PRIMARY_LAYER));      
-    figure.add(connectionRenderingFigure);
-  
-    figure.validate();      
-  }
-
-  public XSDConcreteComponent getInput()
-  {
-    return input;
-  }
-
-  protected EditPart getEditPart(EditPart parent, Object object)
-  {
-    EditPart result = null;
-    for (Iterator i = parent.getChildren().iterator(); i.hasNext(); )
-    {
-      EditPart editPart = (EditPart)i.next();
-      if (editPart.getModel() == object)
-      {  
-        result = editPart;
-        break;
-      }
-    }             
-  
-    if (result == null)
-    { 
-      for (Iterator i = parent.getChildren().iterator(); i.hasNext(); )
-      {
-        EditPart editPart = getEditPart((EditPart)i.next(), object);
-        if (editPart != null)
-        {
-          result = editPart;
-          break;
-        }
-      }            
-    }
-  
-    return result;
-  }
-  
-  public abstract void setInput(XSDConcreteComponent comp);
-  
-  public abstract void setSelection(XSDConcreteComponent comp);
-  
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/FigureCanvasKeyboardHandler.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/FigureCanvasKeyboardHandler.java
deleted file mode 100644
index 012e15e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/FigureCanvasKeyboardHandler.java
+++ /dev/null
@@ -1,125 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.RangeModel;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.CategoryEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.TopLevelComponentEditPart;
-
-public class FigureCanvasKeyboardHandler extends KeyAdapter
-{
-  public static final int H_SCROLL_INCREMENT = 5;
-  public static final int V_SCROLL_INCREMENT = 30;
-
-  BaseGraphicalViewer viewer;
-  
-  /**
-   * Constructor for FigureCanvasKeyboardHandler.
-   */
-  public FigureCanvasKeyboardHandler(BaseGraphicalViewer viewer)
-  {
-    super();
-    this.viewer = viewer;
-  }
-
-  public void keyPressed(KeyEvent e)
-  {
-    Widget w = e.widget;
-    if (w instanceof FigureCanvas)
-    {
-      processKey(e.keyCode, (FigureCanvas)w);
-      update();
-    }
-  }
-
-  private void processKey(int keyCode, FigureCanvas figureCanvas)
-  {
-    switch (keyCode)
-    {
-      case SWT.ARROW_DOWN :
-        scrollVertical(figureCanvas, false);
-        break;
-      case SWT.ARROW_UP :
-        scrollVertical(figureCanvas, true);
-        break;
-      case SWT.ARROW_LEFT :
-        scrollHorizontal(figureCanvas, true);
-        break;
-      case SWT.ARROW_RIGHT :
-        scrollHorizontal(figureCanvas, false);
-        break;
-      case SWT.PAGE_UP :
-        scrollPage(figureCanvas, true);
-        break;
-      case SWT.PAGE_DOWN :
-        scrollPage(figureCanvas, false);
-        break;
-    }
-  }
-
-  private int verifyScrollBarOffset(RangeModel model, int value)
-  {
-    value = Math.max(model.getMinimum(), value);
-    return Math.min(model.getMaximum() - model.getExtent(), value);
-  }
-
-  private void scrollVertical(FigureCanvas figureCanvas, boolean up)
-  {
-    Point location = figureCanvas.getViewport().getViewLocation();
-    int vOffset = up ? -V_SCROLL_INCREMENT : V_SCROLL_INCREMENT;
-    int x = verifyScrollBarOffset(figureCanvas.getViewport().getHorizontalRangeModel(), location.x);
-    int y = verifyScrollBarOffset(figureCanvas.getViewport().getVerticalRangeModel(), location.y + vOffset);
-    figureCanvas.scrollSmoothTo(x, y);
-  }
-
-  private void scrollHorizontal(FigureCanvas figureCanvas, boolean left)
-  {
-    Point location = figureCanvas.getViewport().getViewLocation();
-    int hOffset = left ? -H_SCROLL_INCREMENT : H_SCROLL_INCREMENT;
-    int x = verifyScrollBarOffset(figureCanvas.getViewport().getHorizontalRangeModel(), location.x + hOffset);
-    int y = verifyScrollBarOffset(figureCanvas.getViewport().getVerticalRangeModel(), location.y);
-    figureCanvas.scrollSmoothTo(x, y);
-  }
-
-  private void scrollPage(FigureCanvas figureCanvas, boolean up)
-  {
-    Rectangle clientArea = figureCanvas.getClientArea();
-    int increment = up ? -clientArea.height : clientArea.height;
-    Point location = figureCanvas.getViewport().getViewLocation();
-    int x = verifyScrollBarOffset(figureCanvas.getViewport().getHorizontalRangeModel(), location.x);
-    int y = verifyScrollBarOffset(figureCanvas.getViewport().getVerticalRangeModel(), location.y + increment);
-    figureCanvas.scrollSmoothTo(x, y);
-  }
-  
-  private void update()
-  {
-    StructuredSelection s = (StructuredSelection)viewer.getSelection();
-    Object newSelectedEditPart = s.getFirstElement();
-
-    if (newSelectedEditPart instanceof TopLevelComponentEditPart)
-    {
-      TopLevelComponentEditPart topLevel = (TopLevelComponentEditPart) newSelectedEditPart;
-      CategoryEditPart categoryEP = (CategoryEditPart) topLevel.getParent();
-      categoryEP.scrollTo(topLevel);
-      viewer.reveal((TopLevelComponentEditPart)newSelectedEditPart);
-    }                           
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphContextMenuProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphContextMenuProvider.java
deleted file mode 100644
index dc539e2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphContextMenuProvider.java
+++ /dev/null
@@ -1,56 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-
-import org.eclipse.gef.ContextMenuProvider;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.wst.xsd.ui.internal.XSDMenuListener;
-
-
-public class GraphContextMenuProvider extends ContextMenuProvider
-{
-
-  XSDMenuListener xsdMenuListener;
-  
-  /**
-   * Constructor for GraphContextMenuProvider.
-   * @param selectionProvider
-   * @param editor
-   */
-  public GraphContextMenuProvider(
-    EditPartViewer viewer,
-    ISelectionProvider selectionProvider)
-  {
-    super(viewer);
-    this.viewer = viewer;
-    xsdMenuListener = new XSDMenuListener(selectionProvider);
-    xsdMenuListener.setSourceContext(viewer);
-  }
-
-  public XSDMenuListener getMenuListener()
-  {
-      return xsdMenuListener;
-  }
-
-  
-  /**
-   * @see org.eclipse.gef.ui.parts.ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager, org.eclipse.gef.EditPartViewer)
-   */
-  public void buildContextMenu(IMenuManager arg0)
-  {
-    xsdMenuListener.menuAboutToShow(arg0);
-  }
-  
-  protected EditPartViewer viewer;
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphicsConstants.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphicsConstants.java
deleted file mode 100644
index 691996d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphicsConstants.java
+++ /dev/null
@@ -1,36 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * A collection of color-related constants.
- */
-public interface GraphicsConstants 
-{                          
-  public final static Display display = Display.getDefault();
-  public final static Color categoryBorderColor     = new Color(null, 118, 134, 164);
-  public final static Color elementBorderColor      = new Color(null, 138, 154, 184);
-  public final static Color elementBackgroundColor  = new Color(null, 236, 242, 252);  
-  public final static Color elementLabelColor       = new Color(null,  80,  96, 144);
-  public final static Color readOnlyBorderColor     = new Color(null, 164, 164, 164); 
-
-  public final static Color readOnlyBackgroundColor = ColorConstants.white;
-
-  public final static Font  smallFont               = new Font(Display.getCurrent(), "Small Fonts", 6, SWT.NONE); 
-  public final static Font  medium                  = new Font(Display.getCurrent(), "Tahoma", 8, SWT.NONE); 
-  public final static Font  mediumBoldFont          = new Font(Display.getCurrent(), "Tahoma", 8, SWT.BOLD); 
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/LinkedGraphViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/LinkedGraphViewer.java
deleted file mode 100644
index 73e21aa..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/LinkedGraphViewer.java
+++ /dev/null
@@ -1,160 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-
-import java.util.Iterator;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.XSDEditor;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-
-
-public class LinkedGraphViewer
-{
-  
-  protected ISelectionProvider menuSelectionProvider;
-  protected XSDEditor editor;
-  protected BaseGraphicalViewer majorViewer, minorViewer;
-  
-  /**
-   * 
-   */
-  public LinkedGraphViewer(XSDEditor editor, ISelectionProvider selectionProvider)
-  {
-    menuSelectionProvider = selectionProvider;
-    this.editor = editor;
-  }
-
-  public void setMajorViewer(BaseGraphicalViewer majorViewer)
-  {
-    this.majorViewer = majorViewer;
-  }
-
-  public void setMinorViewer(BaseGraphicalViewer minorViewer)
-  {
-    this.minorViewer = minorViewer;
-  }
-  
-  protected Composite control;
-  protected SashForm sashForm;
-  
-  public Control createControl(Composite parent)
-  {
-    //control = new Composite(parent, SWT.DEFAULT);
-   
-    control = sashForm = new SashForm(parent, SWT.VERTICAL | SWT.BORDER);
-    sashForm.setLayoutData(ViewUtility.createFill());
-    
-    majorViewer.createControl(sashForm);
-    minorViewer.createControl(sashForm);
-//    control.setLayout(new GridLayout());
-//    control.setLayoutData(ViewUtility.createFill());
-    return control;
-  }
-  
-  public void addSelectionChangedListener(ISelectionChangedListener selectionListener)
-  {
-    if (majorViewer != null)
-    {
-      majorViewer.addSelectionChangedListener(selectionListener);
-      majorViewer.addSelectionChangedListener(majorViewerListener);
-    }
-    if (minorViewer != null)
-    {
-      minorViewer.addSelectionChangedListener(selectionListener);
-    }
-  }
-  
-  /**
-   * @return Composite
-   */
-  public Composite getControl()
-  {
-    return control;
-  }
-
-  /**
-   * 
-   */
-  protected XSDConcreteComponent getInput()
-  {
-    return majorViewer.getInput();
-  }
-
-  /**
-   * @param schema
-   */
-  protected void setInput(XSDConcreteComponent input)
-  {
-    majorViewer.setInput(input);
-    minorViewer.setInput(input);
-  }
-
-  /**
-   * @param component
-   */
-  public void setSelection(XSDConcreteComponent component)
-  {
-    majorViewer.setSelection(component);
-  }
-
-  protected MajorViewerSelectionChangedListener majorViewerListener = new MajorViewerSelectionChangedListener();
-  
-  private class MajorViewerSelectionChangedListener implements ISelectionChangedListener
-  {
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
-     */
-    public void selectionChanged(SelectionChangedEvent event)
-    {
-      ISelection editPartSelection = event.getSelection();
-      if (editPartSelection instanceof IStructuredSelection)
-      {
-        for (Iterator i = ((IStructuredSelection)editPartSelection).iterator(); i.hasNext(); )
-        {
-          EditPart editPart = (EditPart)i.next();
-          if (editPart != null)
-          {
-            Object model = editPart.getModel();
-            if (model instanceof XSDConcreteComponent)
-            {
-              Element element = ((XSDConcreteComponent)model).getElement();
-
-              // this test ensures that we don't attempt to select an element for an external schema
-              //
-              if (element instanceof IDOMNode)
-              {
-                // now update the minor viewer based on the selected component in the major viewer
-                minorViewer.setInput((XSDConcreteComponent)model);
-                minorViewer.setSelection((XSDConcreteComponent)model);
-              }
-            }
-          }
-        }
-      }                
-    }
-
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/PrintGraphAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/PrintGraphAction.java
deleted file mode 100644
index 53df913..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/PrintGraphAction.java
+++ /dev/null
@@ -1,84 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-             
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.printing.PrintDialog;
-import org.eclipse.swt.printing.Printer;
-import org.eclipse.swt.printing.PrinterData;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-
-
-public class PrintGraphAction extends Action
-{ 
-  protected XSDComponentViewer componentViewer;
-
-  public PrintGraphAction(XSDComponentViewer componentViewer)
-  {
-    super("Print");
-    this.componentViewer = componentViewer;
-  } 
-
-  public void run()
-  {
-    try
-    {
-      PrintDialog dialog = new PrintDialog(Display.getCurrent().getActiveShell());
-      PrinterData data = dialog.open();
-      Printer printer = new Printer(data);
-                                                   
-      Control control = componentViewer.getControl();
-      Display display = Display.getCurrent();
-      Image graphImage = new Image(display, control.getSize().x, control.getSize().y);
-      GC graphGC = new GC(control);
-      graphGC.copyArea(graphImage, 0, 0);
-        
-      ImageData graphImageData = graphImage.getImageData();
-      graphImageData.transparentPixel = -1;
-        
-      Point screenDPI = display.getDPI();
-      Point printerDPI = printer.getDPI();
-      int scaleFactor = printerDPI.x / screenDPI.x;
-      Rectangle trim = printer.computeTrim(0, 0, 0, 0);
-      if (printer.startJob("Print XML Schema Graph")) 
-      {
-        GC gc = new GC(printer);
-        if (printer.startPage()) 
-        {
-          gc.drawImage(
-            graphImage,
-            0,
-            0,
-            graphImageData.width,
-            graphImageData.height,
-            -trim.x,
-            -trim.y,
-            scaleFactor * graphImageData.width,
-            scaleFactor * graphImageData.height);
-          printer.endPage();
-        }
-        printer.endJob();
-      }
-      printer.dispose();
-      graphGC.dispose();
-    }    
-    catch (Exception e)
-    {
-      e.printStackTrace();
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDChildUtility.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDChildUtility.java
deleted file mode 100644
index 887889c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDChildUtility.java
+++ /dev/null
@@ -1,285 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDSwitch;
-              
-
-public class XSDChildUtility
-{              
-  static public List getModelChildren(Object model)
-  {                     
-    XSDChildVisitor visitor = new XSDChildVisitor(model);
-    visitor.visitXSDObject(model); 
-    return visitor.list;
-  }    
-   
-  static public List getImmediateDerivedTypes(XSDComplexTypeDefinition complexType)
-  {
-    ArrayList typesDerivedFrom = new ArrayList();
-
-    // A handy convenience method quickly gets all 
-    // typeDefinitions within our schema; note that 
-    // whether or not this returns types in included, 
-    // imported, or redefined schemas is subject to change
-    List typedefs = complexType.getSchema().getTypeDefinitions();
-
-    for (Iterator iter = typedefs.iterator(); iter.hasNext(); )
-    {
-      XSDTypeDefinition typedef = (XSDTypeDefinition)iter.next();
-      // Walk the baseTypes from this typedef seeing if any 
-      // of them match the requested one
-      if (complexType.equals(typedef.getBaseType()))
-      {
-        // We found it, return the original one and continue
-        typesDerivedFrom.add(typedef);
-      }
-    }
-    return typesDerivedFrom;
-  }
-  // TODO... use the XSDVisitor defined in xsdeditor.util instead
-  //          
-  public static class XSDChildVisitor extends XSDVisitor
-  {
-    Object root;
-    List list = new ArrayList();
-
-    public XSDChildVisitor(Object root)
-    {
-      this.root = root;
-    }                  
-
-    public void visitXSDModelGroup(XSDModelGroup xsdModelGroup)
-    {
-      if (xsdModelGroup != root)
-      {
-        list.add(xsdModelGroup);
-      }                         
-      else
-      {
-        super.visitXSDModelGroup(xsdModelGroup);
-      }
-    }
-
-    public void visitXSDModelGroupDefinition(XSDModelGroupDefinition xsdModelGroupDefinition)
-    {
-      if (xsdModelGroupDefinition != root)
-      {
-        list.add(xsdModelGroupDefinition);
-      }                         
-      else
-      {
-        super.visitXSDModelGroupDefinition(xsdModelGroupDefinition);
-      }
-    }
-
-    public void visitXSDElementDeclaration(XSDElementDeclaration xsdElementDeclaration)
-    {
-      if (xsdElementDeclaration != root)
-      {
-        list.add(xsdElementDeclaration);
-      }                         
-      else
-      {
-        super.visitXSDElementDeclaration(xsdElementDeclaration);
-      }
-    }
-
-    public void visitXSDComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition)
-    {
-      if (xsdComplexTypeDefinition != root)
-      {                                    
-        if (xsdComplexTypeDefinition.getName() != null || getModelChildren(xsdComplexTypeDefinition).size() > 0)
-        {
-          list.add(xsdComplexTypeDefinition);
-        }
-      }                         
-      else
-      {
-        super.visitXSDComplexTypeDefinition(xsdComplexTypeDefinition);
-      }
-    }    
-
-    public void visitXSDWildcard(XSDWildcard xsdWildCard)
-    {
-      if (xsdWildCard != root)
-      {                                    
-        list.add(xsdWildCard);        
-      }                         
-      else
-      {
-        super.visitXSDWildcard(xsdWildCard);
-      }
-    }
-  }
-               
-
-  public static class XSDVisitor
-  { 
-    int indent = 0;
-                 
-    public void visitXSDObject(Object object)
-    {           
-      if (object == null)
-        return;
-
-      XSDSwitch theSwitch = new XSDSwitch()
-      {   
-        public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object)
-        {
-          visitXSDComplexTypeDefinition(object);
-          return null;
-        } 
-
-        public Object caseXSDAttributeUse(XSDAttributeUse object)
-        {
-          visitXSDAttributeUse(object);
-          return null;
-        }
-
-        public Object caseXSDElementDeclaration(XSDElementDeclaration object)
-        {
-          visitXSDElementDeclaration(object);
-          return null;
-        }
-
-        public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
-        {
-          visitXSDModelGroupDefinition(object);
-          return super.caseXSDModelGroupDefinition(object);
-        }
-
-        public Object caseXSDModelGroup(XSDModelGroup object)
-        {
-          visitXSDModelGroup(object);
-          return super.caseXSDModelGroup(object);
-        }
-
-        public Object caseXSDParticle(XSDParticle object)
-        { 
-          visitXSDParticle(object);
-          return null;
-        } 
-
-        public Object caseXSDSchema(XSDSchema object)
-        { 
-          visitXSDSchema(object);
-          return null;
-        } 
-
-        public Object caseXSDWildcard(XSDWildcard object)
-        { 
-          visitXSDWildcard(object);
-          return null;
-        } 
-      };
-      theSwitch.doSwitch((EObject)object);
-    }
-         
-    public void visitXSDAttributeUse(XSDAttributeUse xsdAttributeUse)
-    {  
-//      printIndented("@" + xsdAttributeUse.getAttributeDeclaration().getName());
-    }
-
-    public void visitXSDSchema(XSDSchema xsdSchema)
-    {         
-//      printIndented("XSDSchema");
-      indent += 2;
-      for (Iterator iterator = xsdSchema.getElementDeclarations().iterator(); iterator.hasNext(); )
-      {
-        visitXSDObject(iterator.next());
-      }
-      indent -= 2;
-    }
-
-    public void visitXSDElementDeclaration(XSDElementDeclaration xsdElementDeclaration)
-    {      
-//      printIndented(xsdElementDeclaration.getName());
-      indent += 2;         
-      XSDTypeDefinition td = xsdElementDeclaration.getTypeDefinition();
-      if (td == null)
-      {
-        td = xsdElementDeclaration.getAnonymousTypeDefinition();
-      }                       
-      visitXSDObject(td);
-      indent -= 2;
-    }
-   
-    public void visitXSDComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition)
-    {
-//      printIndented("XSDComplexTypeDefinition : " + xsdComplexTypeDefinition.getContent());
-      indent += 2;
-      for (Iterator i = xsdComplexTypeDefinition.getAttributeUses().iterator(); i.hasNext(); )
-      {        
-        visitXSDObject((XSDAttributeUse)i.next());
-      }
-      visitXSDObject(xsdComplexTypeDefinition.getContent());
-      indent -= 2;
-    }
-
-    public void visitXSDModelGroup(XSDModelGroup xsdModelGroup)
-    {
-//      printIndented("XSDModelGroup");
-      indent += 2;
-      for (Iterator iterator = xsdModelGroup.getContents().iterator(); iterator.hasNext(); )
-      {
-        visitXSDObject(iterator.next());
-      } 
-      indent -= 2;
-    }     
-
-    public void visitXSDModelGroupDefinition(XSDModelGroupDefinition xsdModelGroupDefinition)
-    {
-//      printIndented("XSDModelGroupDefinition");
-      indent += 2;
-      visitXSDObject(xsdModelGroupDefinition.getResolvedModelGroupDefinition().getModelGroup());
-      indent -= 2;
-    }
-
-    public void visitXSDParticle(XSDParticle xsdParticle)
-    {
-//      printIndented("XSDParticle");
-      indent += 2;                 
-      if (xsdParticle.getContent() != null)
-        visitXSDObject(xsdParticle.getContent());
-      indent -= 2;
-    } 
-
-    public void visitXSDWildcard(XSDWildcard object)
-    { 
-//      printIndented("XSDWildcard");
-    }
-
-    public void printIndented(String string)
-    { 
-      //String spaces = "";
-      //for (int i = 0; i < indent; i++)
-      //{
-      //  spaces += " ";
-      //}               
-      //System.out.println(spaces + string);      
-    }
-  } 
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDComponentViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDComponentViewer.java
deleted file mode 100644
index a8a0525..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDComponentViewer.java
+++ /dev/null
@@ -1,104 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-             
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.xsd.ui.internal.XSDEditor;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.ComponentViewerRootEditPart;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-
-
-public class XSDComponentViewer extends BaseGraphicalViewer
-{               
-  protected ComponentViewerRootEditPart componentViewerRootEditPart;
-  public XSDComponentViewer(XSDEditor editor, ISelectionProvider menuSelectionProvider)
-  {
-    super(editor, menuSelectionProvider);       
-  }        
-
-  public void setInput(XSDConcreteComponent component)
-  {               
-    if (isInputEnabled)
-    {
-      input = null;         
-
-      if (component instanceof XSDElementDeclaration || 
-          component instanceof XSDSchema ||
-          component instanceof XSDModelGroup ||   
-          component instanceof XSDModelGroupDefinition ||
-          component instanceof XSDComplexTypeDefinition)
-      {            
-        input = component;
-      }
-      
-      componentViewerRootEditPart.setInput(input);
-      if (!(input instanceof XSDSchema))
-      {
-        editor.getGraphViewer().backButton.setEnabled(true);
-      }
-    }
-  }     
-
-  public void setSelection(XSDConcreteComponent component)
-  {                    
-    if (isSelectionEnabled)
-    {                      
-      //System.out.println("XSDComponentViewer.setSelection(" + component + ")");
-      List editPartList = new ArrayList();    
-      if (component instanceof XSDElementDeclaration || 
-          component instanceof XSDSchema ||
-          component instanceof XSDModelGroup ||        
-          component instanceof XSDModelGroupDefinition ||
-          component instanceof XSDComplexTypeDefinition)
-      {                     
-        if (component != null)
-        {
-          EditPart editPart = getEditPart(componentViewerRootEditPart, component);    
-          if (editPart != null)
-          { 
-            // TODO ... take a look at this to figure our why a newly added component
-            // seems to have the wrong bounds at this point... is this a layout issue?           
-            // As a temp hack I'm ignoring the selection of component with bounds (x, y) == (0, 0)
-            // Perhaps a delayed selection is required?
-            Rectangle bounds = ((GraphicalEditPart)editPart).getFigure().getBounds();
-            if (bounds.x > 0 || bounds.y > 0)
-            {
-              editPartList.add(editPart); 
-            }
-          } 
-        }    
-      }              
-      setSelection(new StructuredSelection(editPartList));
-    }
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.gef.ui.parts.AbstractEditPartViewer#hookControl()
-   */
-  protected void hookControl()
-  {
-    super.hookControl();
-    componentViewerRootEditPart = new ComponentViewerRootEditPart();
-    setContents(componentViewerRootEditPart);
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphUtil.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphUtil.java
deleted file mode 100644
index f66c279..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphUtil.java
+++ /dev/null
@@ -1,35 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-              
-
-public class XSDGraphUtil
-{                        
-  public static boolean isEditable(Object model)
-  {                    
-    boolean result = false;
-    if (model instanceof XSDConcreteComponent)
-    {
-      Element element = ((XSDConcreteComponent)model).getElement();
-      // this test ensures that we don't attempt to select an element for an external schema
-      //
-      if (element instanceof IDOMNode)
-      {
-         result = true;
-      }
-    }                      
-    return result;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphViewer.java
deleted file mode 100644
index 95bcd15..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphViewer.java
+++ /dev/null
@@ -1,460 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.ViewForm;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.xsd.ui.internal.XSDEditor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.XSDSelectionManager;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.TopLevelComponentEditPart;
-import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-public class XSDGraphViewer implements ISelectionChangedListener
-{
-  protected PageBook pageBook;
-  protected Control componentViewerControl;
-  protected Control inheritanceViewerControl;
-  protected Control subGroupsViewerControl;
-  protected XSDComponentViewer componentViewer;
-  protected XSDInheritanceViewer inheritanceViewer;
-  protected XSDSubstitutionGroupsViewer subGroupsViewer;
-  protected XSDSelectionManager xsdSelectionManager;
-  protected XSDSchema schema;
-  protected InternalSelectionProvider internalSelectionProvider = new InternalSelectionProvider();
-  protected XSDEditor editor;
-  protected PrintGraphAction printGraphAction;
-  protected SashForm sashForm;
-  protected ToolItem backButton;
-
-  public XSDGraphViewer(XSDEditor editor)
-  {
-    super();
-    this.editor = editor;
-  }
-
-  public void setSchema(XSDSchema schema)
-  {
-    this.schema = schema;
-  }
-  ToolBar graphToolBar; // the toolbar at the top of the graph view
-  ToolItem toolItem; // the view tool item
-  ViewForm form; // view form for holding all the views
-  Composite frameBar; // The composite that contains the toolbar
-  Composite c; // temporary blank page. Clean this up when all views completed
-  LinkedGraphViewer linkInheritanceViewer;
-
-  protected void createInheritanceViewer(Composite parent)
-  {
-    linkInheritanceViewer = new LinkedGraphViewer(editor, internalSelectionProvider);
-    BaseGraphicalViewer graphViewer = new XSDInheritanceViewer(editor, internalSelectionProvider);
-    linkInheritanceViewer.setMajorViewer(graphViewer);
-    graphViewer = new XSDComponentViewer(editor, editor.getSelectionManager());
-    linkInheritanceViewer.setMinorViewer(graphViewer);
-    linkInheritanceViewer.createControl(parent);
-  }
-  LinkedGraphViewer linkSubstitutionGroupViewer;
-
-  protected void createSubstitutionGroupViewer(Composite parent)
-  {
-    linkSubstitutionGroupViewer = new LinkedGraphViewer(editor, internalSelectionProvider);
-    BaseGraphicalViewer graphViewer = new XSDSubstitutionGroupsViewer(editor, internalSelectionProvider);
-    linkSubstitutionGroupViewer.setMajorViewer(graphViewer);
-    graphViewer = new XSDComponentViewer(editor, internalSelectionProvider);
-    linkSubstitutionGroupViewer.setMinorViewer(graphViewer);
-    linkSubstitutionGroupViewer.createControl(parent);
-  }
-  static private Color dividerColor;
-
-  public Control createControl(Composite parent)
-  {
-    pageBook = new PageBook(parent, 0);
-    
-    componentViewer = new XSDComponentViewer(editor, editor.getSelectionManager());
-    form = new ViewForm(pageBook, SWT.NONE);
-    frameBar = new Composite(form, SWT.NONE);
-    org.eclipse.swt.layout.GridLayout frameLayout = new org.eclipse.swt.layout.GridLayout();
-    frameLayout.marginWidth = 0;
-    frameLayout.marginHeight = 0;
-    frameBar.setLayout(frameLayout);
-    graphToolBar = new ToolBar(frameBar, SWT.FLAT);
-    graphToolBar.addTraverseListener(new TraverseListener()
-    {
-      public void keyTraversed(TraverseEvent e)
-      {
-        if (e.detail == SWT.TRAVERSE_MNEMONIC)
-          e.doit = false;
-      }
-    });
-    backButton = new ToolItem(graphToolBar, SWT.PUSH);
-    backButton.setImage(XSDEditorPlugin.getXSDImage("icons/back.gif")); //$NON-NLS-1$
-    backButton.setToolTipText(XSDEditorPlugin.getXSDString("_UI_HOVER_BACK_TO_SCHEMA_VIEW")); //$NON-NLS-1$
-    backButton.setEnabled(false);
-    backButton.addSelectionListener(new SelectionAdapter()
-    {
-      public void widgetSelected(SelectionEvent e)
-      {
-        editor.getGraphViewer().setInput(editor.getXSDSchema());
-        editor.getSelectionManager().setSelection(new StructuredSelection(editor.getXSDSchema()));
-      }
-    });
-    form.setTopLeft(frameBar);
-    componentViewerControl = componentViewer.createControl(form);
-    c = ViewUtility.createComposite(form, 1);
-    form.setContent(componentViewerControl);
-    form.setData("layout ratio", new Float(0.65));
-    if (dividerColor == null)
-    {
-      dividerColor = new Color(componentViewerControl.getDisplay(), 143, 141, 138);
-    }
-    pageBook.showPage(form);
-    componentViewer.addSelectionChangedListener(internalSelectionProvider);
-    printGraphAction = new PrintGraphAction(componentViewer);
-    return pageBook;
-  }
-
-  public Action getPrintGraphAction()
-  {
-    return printGraphAction;
-  }
-
-  public void updateDesignLayout(int newLayout)
-  {
-    sashForm.setOrientation(newLayout);
-    sashForm.layout();
-  }
-
-  public SashForm getSashForm()
-  {
-    return sashForm;
-  }
-
-  public void enableDesignView(boolean enable)
-  {
-  }
-
-  public XSDComponentViewer getComponentViewer()
-  {
-    return componentViewer;
-  }
-  
-  public void setBackButtonEnabled(boolean state)
-  {
-    backButton.setEnabled(state);
-  }
-
-  public void setInput(Object object)
-  {
-    if (object instanceof XSDConcreteComponent)
-    {
-      XSDConcreteComponent xsdComp = (XSDConcreteComponent) object;
-      if (xsdComp instanceof XSDSchema)
-      {
-        setBackButtonEnabled(false);
-      }
-      else
-      {
-        setBackButtonEnabled(true);
-      }
-      componentViewer.setInput(xsdComp);
-      componentViewer.setSelection(xsdComp);
-    }   
-  }
-
-  protected boolean isDeleted(XSDConcreteComponent component)
-  {
-    boolean result = false;
-    if (component != null && component.getElement() != null)
-    {
-      result = component.getElement().getParentNode() == null;
-    }
-    return result;
-  }
-
-  public void setSelectionManager(XSDSelectionManager newSelectionManager)
-  {
-    // disconnect from old one
-    if (xsdSelectionManager != null)
-    {
-      xsdSelectionManager.removeSelectionChangedListener(this);
-      internalSelectionProvider.removeSelectionChangedListener(xsdSelectionManager);
-    }
-    xsdSelectionManager = newSelectionManager;
-    // connect to new one
-    if (xsdSelectionManager != null)
-    {
-      xsdSelectionManager.addSelectionChangedListener(this);
-      internalSelectionProvider.addSelectionChangedListener(xsdSelectionManager);
-    }
-  }
-
-  // this method is called by the SelectionManager to notify the graph view
-  // that the editor selection has changed
-  //
-  public void selectionChanged(SelectionChangedEvent event)
-  {
-    // here we check the selection source to ensure that this selection came
-    // from a different view (not from the graph view)
-    if (event.getSource() != getComponentViewer())
-    { 
-      handleSelection(event, true);
-    }
-  }
-
-  protected XSDConcreteComponent getTopLevelComponent(XSDConcreteComponent component)
-  {
-    XSDConcreteComponent prev = component;
-    XSDConcreteComponent container = component;
-    while ( container != null && !(container instanceof XSDSchema))
-    {
-      prev = container;     
-      container = container.getContainer();
-    }
-    return container != null ? prev : null;
-  }
-  
-  // TODO.. we need to clean this method up and add comments to clarify what's going on
-  //
-  protected void handleSelection(SelectionChangedEvent event, boolean isSelectionRequired)
-  {
-    StructuredSelection s = (StructuredSelection)event.getSelection();
-    Object obj = s.getFirstElement();
-    if (obj instanceof XSDConcreteComponent)
-    {
-      XSDConcreteComponent selectedComponent = (XSDConcreteComponent)obj;
-      Object currentInput = getComponentViewer().getInput();
-      
-      // in this case we're looking at a top level view
-      // so if the selection is a 'non-top-level' component we need to do a set input
-      XSDSchema topLevelSchema = null;
-      if (currentInput instanceof XSDSchema)
-      {
-        if (selectedComponent instanceof XSDSchema || 
-            selectedComponent.getContainer() instanceof XSDSchema)
-        {
-          topLevelSchema = (XSDSchema)currentInput;
-        }
-      }
-      if (selectedComponent instanceof XSDSchemaDirective || 
-          selectedComponent instanceof XSDNotationDeclaration)      
-      {
-        topLevelSchema = selectedComponent.getSchema();
-      }
-      else if (selectedComponent instanceof XSDAttributeGroupContent ||
-               selectedComponent instanceof XSDWildcard)
-      {
-        if (selectedComponent.getContainer() instanceof XSDAttributeGroupDefinition)
-        {
-          topLevelSchema = selectedComponent.getSchema();
-        }
-      }
-      else if (selectedComponent instanceof XSDSimpleTypeDefinition)
-      {
-        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)selectedComponent;
-        EditPart editPart = componentViewer.getEditPart(componentViewer.getRootEditPart(), st);
-        if (editPart == null)
-        {
-          if (st.getContainer() == editor.getXSDSchema())
-          {
-            topLevelSchema = selectedComponent.getSchema();
-          }
-        }
-      }
-      
-      if (topLevelSchema != null)
-      {
-        setInput(topLevelSchema);
-        // TODO... this is not 'quite' right
-        // it should be possible to view in
-      }  
-      else
-      { 
-        EditPart editPart = getComponentViewer().getEditPart(getComponentViewer().getRootEditPart(), obj);
-        if (editPart == null)
-        {  
-          XSDConcreteComponent topLevelComponent = getTopLevelComponent(selectedComponent);
-          if (topLevelComponent != null)
-          {
-            setInput(topLevelComponent);  
-          }
-        }  
-      }  
-      // now we handle the selection
-      //
-      if (isSelectionRequired)
-      {  
-        EditPart editPart = getComponentViewer().getRootEditPart();        
-        EditPart newSelectedEditPart = getComponentViewer().getEditPart(editPart, obj);
-        if (newSelectedEditPart != null)
-        {
-          if (newSelectedEditPart instanceof TopLevelComponentEditPart)
-          {
-            ((TopLevelComponentEditPart)newSelectedEditPart).setScroll(true);
-          }
-          getComponentViewer().setSelection(new StructuredSelection(newSelectedEditPart));
-        }
-      }      
-    }
-    else if (obj instanceof CategoryAdapter)
-    {
-      setInput(((CategoryAdapter)obj).getXSDSchema());  
-    }
-  }
-
-  protected Element getElementNode(Node node)
-  {
-    while (!(node instanceof Element))
-    {
-      if (node instanceof Attr)
-      {
-        node = ((Attr) node).getOwnerElement();
-      }
-      else if (node instanceof Text)
-      {
-        Node sibling = node.getNextSibling();
-        if (sibling == null)
-        {
-          break;
-        }
-        node = sibling;
-      }
-      else
-      {
-        Node parent = node.getParentNode();
-        if (parent == null)
-        {
-          break;
-        }
-        node = node.getParentNode();
-      }
-    }
-    return node instanceof Element ? (Element) node : null;
-  }
-
-
-
-  // This class listens to the graph view and converts edit part selection
-  // events
-  // into XSD component selection events that can be 'fired' to the
-  // selectionManager
-  //
-  class InternalSelectionProvider implements ISelectionProvider, ISelectionChangedListener
-  {
-    protected List listenerList = new ArrayList();
-    protected ISelection selection = new StructuredSelection();
-
-    public void addSelectionChangedListener(ISelectionChangedListener listener)
-    {
-      listenerList.add(listener);
-    }
-
-    public void removeSelectionChangedListener(ISelectionChangedListener listener)
-    {
-      listenerList.remove(listener);
-    }
-
-    public ISelection getSelection()
-    {
-      return selection;
-    }
-
-    protected void notifyListeners(SelectionChangedEvent event)
-    {
-      for (Iterator i = listenerList.iterator(); i.hasNext();)
-      {
-        ISelectionChangedListener listener = (ISelectionChangedListener) i.next();
-        listener.selectionChanged(event);
-      }
-    }
-
-    public StructuredSelection convertSelectionFromEditPartToModel(ISelection editPartSelection)
-    {
-      List selectedModelObjectList = new ArrayList();
-      if (editPartSelection instanceof IStructuredSelection)
-      {
-        for (Iterator i = ((IStructuredSelection) editPartSelection).iterator(); i.hasNext();)
-        {
-          Object obj = i.next();
-          Object model = null;
-          if (obj instanceof EditPart)
-          {
-            EditPart editPart = (EditPart) obj;
-            model = editPart.getModel();
-            // Convert category to XSDSchema
-            // if (editPart instanceof CategoryEditPart)
-            // {
-            //   model = ((Category)((CategoryEditPart)editPart).getModel()).getXSDSchema();
-            // }
-          }
-          else if (obj instanceof XSDConcreteComponent)
-          {
-            //cs .. not sure why would we'd ever hit this case?
-            model = obj;
-          }
-          if (model != null)//&& model instanceof XSDConcreteComponent)
-          {
-            selectedModelObjectList.add(model);
-          }
-        }
-      }
-      return new StructuredSelection(selectedModelObjectList);
-    }
-
-    public void setSelection(ISelection selection)
-    {
-      this.selection = selection;
-    }
-
-    // This method gets called when an edit part in the graph view is selected
-    //
-    public void selectionChanged(SelectionChangedEvent event)
-    {
-      ISelection newSelection = convertSelectionFromEditPartToModel(event.getSelection());
-      this.selection = newSelection;
-      SelectionChangedEvent newEvent = new SelectionChangedEvent(getComponentViewer(), newSelection);
-      notifyListeners(newEvent);
-    }
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphicalViewerKeyHandler.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphicalViewerKeyHandler.java
deleted file mode 100644
index b6c8026..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDGraphicalViewerKeyHandler.java
+++ /dev/null
@@ -1,352 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.KeyHandler;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.ExpandableGraphNodeEditPart;
-
-
-public class XSDGraphicalViewerKeyHandler extends KeyHandler
-{
-    public XSDGraphicalViewerKeyHandler(GraphicalViewer viewer)
-    {
-      this.viewer = viewer;
-    }
-    
-    private WeakReference cachedNode;
-    int counter;
-    private GraphicalViewer viewer;
-
-    private boolean acceptConnection(KeyEvent event)
-    {
-      return event.character == '/'
-        || event.character == '?'
-        || event.character == '\\'
-        || event.character == '|';
-    }
-    private boolean acceptIntoContainer(KeyEvent event)
-    {
-      return (((event.stateMask & SWT.ALT) != 0)
-        && (event.keyCode == SWT.ARROW_RIGHT)) || (event.keyCode == SWT.ARROW_RIGHT);
-//      return (event.keyCode == SWT.ARROW_RIGHT);
-    }
-    private boolean acceptLeaveConnection(KeyEvent event)
-    {
-      int key = event.keyCode;
-      if (getFocus() instanceof ConnectionEditPart)
-        if ((key == SWT.ARROW_UP)
-          || (key == SWT.ARROW_RIGHT)
-          || (key == SWT.ARROW_DOWN)
-          || (key == SWT.ARROW_LEFT))
-          return true;
-      return false;
-    }
-    private boolean acceptLeaveContents(KeyEvent event)
-    {
-      int key = event.keyCode;
-      return getFocus() == getViewer().getContents()
-        && ((key == SWT.ARROW_UP)
-          || (key == SWT.ARROW_RIGHT)
-          || (key == SWT.ARROW_DOWN)
-          || (key == SWT.ARROW_LEFT));
-    }
-    private boolean acceptOutOf(KeyEvent event)
-    {
-      return (((event.stateMask & SWT.ALT) != 0) && (event.keyCode == SWT.ARROW_LEFT)) || (event.keyCode == SWT.ARROW_LEFT);
-//      return (event.keyCode == SWT.ARROW_LEFT);
-    }
-    private ConnectionEditPart findConnection(
-      GraphicalEditPart node,
-      ConnectionEditPart current,
-      boolean forward)
-    {
-      List connections = new ArrayList(node.getSourceConnections());
-      connections.addAll(node.getTargetConnections());
-      if (connections.isEmpty())
-        return null;
-      if (forward)
-        counter++;
-      else
-        counter--;
-      while (counter < 0)
-        counter += connections.size();
-      counter %= connections.size();
-      return (ConnectionEditPart) connections.get(counter % connections.size());
-    }
-    /*
-     * pStart is a point in absolute coordinates.
-     */
-    private GraphicalEditPart findSibling(
-      List siblings,
-      Point pStart,
-      int direction,
-      EditPart exclude)
-    {
-      GraphicalEditPart epCurrent;
-      GraphicalEditPart epFinal = null;
-      IFigure figure;
-      Point pCurrent;
-      int distance = Integer.MAX_VALUE;
-      Iterator iter = siblings.iterator();
-      while (iter.hasNext())
-      {
-        epCurrent = (GraphicalEditPart) iter.next();
-        if (epCurrent == exclude)
-          continue;
-        figure = epCurrent.getFigure();
-        pCurrent = getInterestingPoint(figure);
-        figure.translateToAbsolute(pCurrent);
-        if (pStart.getPosition(pCurrent) != direction)
-          continue;
-        int d = pCurrent.getDistanceOrthogonal(pStart);
-        if (d < distance)
-        {
-          distance = d;
-          epFinal = epCurrent;
-        }
-      }
-      return epFinal;
-    }
-    Point getInterestingPoint(IFigure figure)
-    {
-//      return figure.getBounds().getCenter();
-      return figure.getBounds().getTopLeft();
-    }
-    /**
-     * Returns the cached node.  It is possible that the node is not longer in the viewer but has
-     * not been garbage collected yet.
-     */
-    private GraphicalEditPart getCachedNode()
-    {
-      if (cachedNode == null)
-        return null;
-      if (cachedNode.isEnqueued())
-        return null;
-      return (GraphicalEditPart) cachedNode.get();
-    }
-    GraphicalEditPart getFocus()
-    {
-      return (GraphicalEditPart) getViewer().getFocusEditPart();
-    }
-    List getNavigationSiblings()
-    {
-      return getFocus().getParent().getChildren();
-    }
-    protected GraphicalViewer getViewer()
-    {
-      return viewer;
-    }
-    public boolean keyPressed(KeyEvent event)
-    {
-      if (event.character == ' ')
-      {
-        processSelect(event);
-        return true;
-      }
-      else if (acceptIntoContainer(event))
-      {
-        navigateIntoContainer(event);
-        return true;
-      }
-      else if (acceptOutOf(event))
-      {
-        navigateOut(event);
-        return true;
-      }
-      else if (acceptConnection(event))
-      {
-        navigateConnections(event);
-        return true;
-      }
-      else if (acceptLeaveConnection(event))
-      {
-        navigateOutOfConnection(event);
-        return true;
-      }
-      else if (acceptLeaveContents(event))
-      {
-        navigateIntoContainer(event);
-        return true;
-      }
-      switch (event.keyCode)
-      {
-        case SWT.ARROW_LEFT :
-          return navigateNextSibling(event, PositionConstants.WEST);
-        case SWT.ARROW_RIGHT :
-          return navigateNextSibling(event, PositionConstants.EAST);
-        case SWT.ARROW_UP :
-          return navigateNextSibling(event, PositionConstants.NORTH);
-        case SWT.ARROW_DOWN :
-          return navigateNextSibling(event, PositionConstants.SOUTH);
-        case SWT.HOME :
-          return navigateJumpSibling(event, PositionConstants.WEST);
-        case SWT.END :
-          return navigateJumpSibling(event, PositionConstants.EAST);
-        case SWT.PAGE_DOWN :
-          return navigateJumpSibling(event, PositionConstants.SOUTH);
-        case SWT.PAGE_UP :
-          return navigateJumpSibling(event, PositionConstants.NORTH);
-      }
-      return super.keyPressed(event);
-    }
-    private void navigateConnections(KeyEvent event)
-    {
-      GraphicalEditPart focus = getFocus();
-      ConnectionEditPart current = null;
-      GraphicalEditPart node = getCachedNode();
-      if (focus instanceof ConnectionEditPart)
-      {
-        current = (ConnectionEditPart) focus;
-        if (node == null
-          || (node != current.getSource() && node != current.getTarget()))
-        {
-          node = (GraphicalEditPart) current.getSource();
-          counter = 0;
-        }
-      }
-      else
-      {
-        node = focus;
-      }
-      setCachedNode(node);
-      boolean forward = event.character == '/' || event.character == '?';
-      ConnectionEditPart next = findConnection(node, current, forward);
-      navigateTo(next, event);
-    }
-    private void navigateIntoContainer(KeyEvent event)
-    {
-      GraphicalEditPart focus = getFocus();
-      List childList = focus.getChildren();
-
-      if (focus instanceof ExpandableGraphNodeEditPart)
-      {
-        if (!((ExpandableGraphNodeEditPart)focus).isExpanded())
-        {
-          ((ExpandableGraphNodeEditPart)focus).doPerformExpandOrCollapse();
-        }
-      }
-
-      Point tl = focus.getContentPane().getBounds().getTopLeft();
-      int minimum = Integer.MAX_VALUE;
-      int current;
-      GraphicalEditPart closestPart = null;
-      for (int i = 0; i < childList.size(); i++)
-      {
-        GraphicalEditPart ged = (GraphicalEditPart) childList.get(i);
-        Rectangle childBounds = ged.getFigure().getBounds();
-        current = (childBounds.x - tl.x) + (childBounds.y - tl.y);
-        if (current < minimum)
-        {
-          minimum = current;
-          closestPart = ged;
-        }
-      }
-      if (closestPart != null)
-        navigateTo(closestPart, event);
-    }
-    private boolean navigateJumpSibling(KeyEvent event, int direction)
-    {
-      return false;
-    }
-    private boolean navigateNextSibling(KeyEvent event, int direction)
-    {
-      GraphicalEditPart epStart = getFocus();
-      IFigure figure = epStart.getFigure();
-      Point pStart = getInterestingPoint(figure);
-      figure.translateToAbsolute(pStart);
-      EditPart next =
-        findSibling(getNavigationSiblings(), pStart, direction, epStart);
-      if (next == null)
-        return false;
-      navigateTo(next, event);
-      return true;
-    }
-    private void navigateOut(KeyEvent event)
-    {
-      if (getFocus() == null
-        || getFocus() == getViewer().getContents()
-        || getFocus().getParent() == getViewer().getContents())
-        return;
-
-      EditPart parent = getFocus().getParent();
-      if (((event.stateMask & SWT.ALT) != 0) && (event.keyCode == SWT.ARROW_LEFT))
-      {
-        if ((parent != null) && (parent instanceof ExpandableGraphNodeEditPart))
-        {
-          if (((ExpandableGraphNodeEditPart)parent).isExpanded())
-          {
-            ((ExpandableGraphNodeEditPart)parent).doPerformExpandOrCollapse();
-          }
-        }
-      }
-      navigateTo(parent, event);
-//      navigateTo(getFocus().getParent(), event);
-    }
-    private void navigateOutOfConnection(KeyEvent event)
-    {
-      GraphicalEditPart cached = getCachedNode();
-      ConnectionEditPart conn = (ConnectionEditPart) getFocus();
-      if (cached != null
-        && (cached == conn.getSource() || cached == conn.getTarget()))
-        navigateTo(cached, event);
-      else
-        navigateTo(conn.getSource(), event);
-    }
-    void navigateTo(EditPart part, KeyEvent event)
-    {
-      if (part == null)
-        return;
-      if ((event.stateMask & SWT.SHIFT) != 0)
-      {
-        getViewer().appendSelection(part);
-        getViewer().setFocus(part);
-      }
-      else if ((event.stateMask & SWT.CONTROL) != 0)
-        getViewer().setFocus(part);
-      else
-        getViewer().select(part);
-    }
-    private void processSelect(KeyEvent event)
-    {
-      EditPart part = getViewer().getFocusEditPart();
-      if ((event.stateMask & SWT.CONTROL) != 0
-        && part.getSelected() != EditPart.SELECTED_NONE)
-      {
-        getViewer().deselect(part);
-      }
-      else
-      {
-        getViewer().appendSelection(part);
-      }
-      getViewer().setFocus(part);
-    }
-    private void setCachedNode(GraphicalEditPart node)
-    {
-      if (node == null)
-        cachedNode = null;
-      else
-        cachedNode = new WeakReference(node);
-    }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDInheritanceViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDInheritanceViewer.java
deleted file mode 100644
index de95c0c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDInheritanceViewer.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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-             
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.xsd.ui.internal.XSDEditor;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.SubstitutionGroupViewerRootEditPart;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-
-
-public class XSDInheritanceViewer extends BaseGraphicalViewer
-{               
-  protected SubstitutionGroupViewerRootEditPart inheritanceViewerRootEditPart;
-  public XSDInheritanceViewer(XSDEditor editor, ISelectionProvider menuSelectionProvider)
-  {
-    super(editor, menuSelectionProvider);       
-  }        
-
-  public void setInput(XSDConcreteComponent component)
-  {               
-    if (isInputEnabled)
-    {
-      input = null;         
-
-      if (component instanceof XSDSchema ||
-          component instanceof XSDComplexTypeDefinition)
-      {            
-        input = component;
-      }
-      
-      inheritanceViewerRootEditPart.setInput(input);       
-    }
-  }     
-
-  public void setSelection(XSDConcreteComponent component)
-  {                    
-    if (isSelectionEnabled)
-    {                      
-      //System.out.println("XSDComponentViewer.setSelection(" + component + ")");
-      List editPartList = new ArrayList();    
-      if (component instanceof XSDElementDeclaration || 
-          component instanceof XSDSchema ||
-          component instanceof XSDModelGroup ||        
-          component instanceof XSDModelGroupDefinition ||
-          component instanceof XSDComplexTypeDefinition)
-      {                     
-        if (component != null)
-        {
-          EditPart editPart = getEditPart(inheritanceViewerRootEditPart, component);    
-          if (editPart != null)
-          { 
-            // TODO ... take a look at this to figure our why a newly added component
-            // seems to have the wrong bounds at this point... is this a layout issue?           
-            // As a temp hack I'm ignoring the selection of component with bounds (x, y) == (0, 0)
-            // Perhaps a delayed selection is required?
-            Rectangle bounds = ((GraphicalEditPart)editPart).getFigure().getBounds();
-            if (bounds.x > 0 || bounds.y > 0)
-            {
-              editPartList.add(editPart); 
-            }
-          } 
-        }    
-      }              
-      setSelection(new StructuredSelection(editPartList));
-    }
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.gef.ui.parts.AbstractEditPartViewer#hookControl()
-   */
-  protected void hookControl()
-  {
-    super.hookControl();
-    inheritanceViewerRootEditPart = new SubstitutionGroupViewerRootEditPart();
-    setContents(inheritanceViewerRootEditPart);
-  }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupChildUtility.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupChildUtility.java
deleted file mode 100644
index 9fa84bd..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupChildUtility.java
+++ /dev/null
@@ -1,46 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.xsd.XSDElementDeclaration;
-
-/**
- * @author ernest
- *
- * To change this generated comment go to 
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class XSDSubstitutionGroupChildUtility
-{
-
-  /**
-   * @param declaration
-   * @return List
-   */
-  public static List getModelChildren(XSDElementDeclaration declaration)
-  {
-    ArrayList children = new ArrayList();
-    List substitutionGroup = declaration.getSubstitutionGroup();
-    for (int i = 0, size = substitutionGroup.size(); i < size; i++)
-    {
-      XSDElementDeclaration element = (XSDElementDeclaration) substitutionGroup.get(i);
-      if (declaration.equals(element.getSubstitutionGroupAffiliation()))
-      {
-        children.add(element);
-      }
-    }
-    return children;
-    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupsViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupsViewer.java
deleted file mode 100644
index cd3074f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/XSDSubstitutionGroupsViewer.java
+++ /dev/null
@@ -1,98 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph;
-             
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.wst.xsd.ui.internal.XSDEditor;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.SubstitutionGroupViewerRootEditPart;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-
-
-public class XSDSubstitutionGroupsViewer extends BaseGraphicalViewer
-{               
-  protected SubstitutionGroupViewerRootEditPart subGroupViewerRootEditPart;
-  public XSDSubstitutionGroupsViewer(XSDEditor editor, ISelectionProvider menuSelectionProvider)
-  {
-    super(editor, menuSelectionProvider);       
-  }        
-
-  public void setInput(XSDConcreteComponent component)
-  {               
-    if (isInputEnabled)
-    {
-      input = null;         
-
-      if (component instanceof XSDElementDeclaration || 
-          component instanceof XSDSchema)
-      {            
-        input = component;
-      }
-      
-      subGroupViewerRootEditPart.setInput(input);       
-    }
-  }     
-
-  public void setSelection(XSDConcreteComponent component)
-  {                    
-    if (isSelectionEnabled)
-    {                      
-      //System.out.println("XSDComponentViewer.setSelection(" + component + ")");
-      List editPartList = new ArrayList();    
-      if (component instanceof XSDElementDeclaration || 
-          component instanceof XSDSchema ||
-          component instanceof XSDModelGroup ||        
-          component instanceof XSDModelGroupDefinition ||
-          component instanceof XSDComplexTypeDefinition)
-      {                     
-        if (component != null)
-        {
-          EditPart editPart = getEditPart(subGroupViewerRootEditPart, component);    
-          if (editPart != null)
-          { 
-            // TODO ... take a look at this to figure our why a newly added component
-            // seems to have the wrong bounds at this point... is this a layout issue?           
-            // As a temp hack I'm ignoring the selection of component with bounds (x, y) == (0, 0)
-            // Perhaps a delayed selection is required?
-            Rectangle bounds = ((GraphicalEditPart)editPart).getFigure().getBounds();
-            if (bounds.x > 0 || bounds.y > 0)
-            {
-              editPartList.add(editPart); 
-            }
-          } 
-        }    
-      }              
-      setSelection(new StructuredSelection(editPartList));
-    }
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.gef.ui.parts.AbstractEditPartViewer#hookControl()
-   */
-  protected void hookControl()
-  {
-    super.hookControl();
-    subGroupViewerRootEditPart = new SubstitutionGroupViewerRootEditPart();
-    setContents(subGroupViewerRootEditPart);
-  }
-
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/BaseEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/BaseEditPart.java
deleted file mode 100644
index f98da1a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/BaseEditPart.java
+++ /dev/null
@@ -1,86 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                                 
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.GraphicsConstants;
-import org.eclipse.wst.xsd.ui.internal.graph.model.ModelAdapterListener;
-import org.eclipse.wst.xsd.ui.internal.graph.model.XSDModelAdapterFactory;
-
-
-public abstract class BaseEditPart extends AbstractGraphicalEditPart implements ModelAdapterListener, GraphicsConstants, IFeedbackHandler
-{
-	protected boolean isSelected = false;
-	/**
-	 * Activates the <code>EditPart</code> by setting the
-	 * appropriate flags, and activating its children.
-	 * activation signals to the EditPart that is should start observing
-	 * it's model, and that is should support editing at this time.
-	 * An EditPart will have a parent prior to activiation.
-	 * @see #deactivate()
-	 */
-	public void activate() 
-  {
-		super.activate();         
-    XSDModelAdapterFactory.addModelAdapterListener(getModel(), this);  
-	}
-	/** 
-	 * Apart from the deactivation done in super, the source
-	 * and target connections are deactivated, and the visual
-	 * part of the this is removed.
-	 *
-	 * @see #activate() 
-	 */
-	public void deactivate() 
-  {
-    XSDModelAdapterFactory.removeModelAdapterListener(getModel(), this);  
-		super.deactivate();
-	}   
-    
-  protected void createEditPolicies() 
-  {
-  }  
-
-  protected EditPart createChild(Object model) 
-  {
-    return XSDEditPartFactory.getInstance().createEditPart(this, model);
-  } 
-
-  public void propertyChanged(Object object, String property)
-  {                                                                                                  
-    refresh(); 
-  }    
-
-  //public BaseGraphicalViewer getBaseGraphicalViewer()
-  //{
-  //  return (BaseGraphicalViewer)getViewer();
-  //}
-
-  public IFigure getSelectionFigure()
-  {
-    return getFigure();
-  }
-  
-  
-  public void addFeedback()
-  {
-    isSelected = true;
-    refreshVisuals();
-  }
-
-  public void removeFeedback()
-  {
-    isSelected = false;
-    refreshVisuals();
-  }  
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/CategoryEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/CategoryEditPart.java
deleted file mode 100644
index afffaad..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/CategoryEditPart.java
+++ /dev/null
@@ -1,187 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                           
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ScrollPane;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.ViewportLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.GraphicsConstants;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerLayout;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
-import org.eclipse.wst.xsd.ui.internal.graph.model.Category;
-
-
-public class CategoryEditPart extends BaseEditPart
-{
-  protected ScrollPane scrollpane;
-  protected Label label;
-  protected ContainerFigure outerPane, r;
-  protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
-
-  public int getType()
-  {
-    return ((Category)getModel()).getGroupType();
-  }
-
-  protected IFigure createFigure()
-  {           
-    outerPane = new ContainerFigure();    
-    outerPane.setBorder(new RoundedLineBorder(1, 6));
-    outerPane.setForegroundColor(categoryBorderColor);
-
-    r = new ContainerFigure();  
-    r.setOutline(false);
-    r.setMinimumSize(new Dimension(0, 0));
-    r.setFill(true);
-    r.setBackgroundColor(GraphicsConstants.elementBackgroundColor);
-    outerPane.add(r);
-    
-    int minHeight = 250;
-    switch (getType())
-    {
-    	case Category.DIRECTIVES :
-		case Category.NOTATIONS :
-		{
-			minHeight = 50;
-			break;	
-		}
-		case Category.ATTRIBUTES :
-		case Category.GROUPS :		  
-		{
-			minHeight = 100;
-			break;
-		}
-    }
-    
-	final int theMinHeight = minHeight;
-    FillLayout outerLayout = new FillLayout()
-    {
-      protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
-      {
-        Dimension d = super.calculatePreferredSize(parent, width, height);
-        d.union(new Dimension(100, theMinHeight));
-        return d;
-      }
-    };
-    //outerLayout.setHorizontal(false);
-    outerPane.setLayoutManager(outerLayout);
-    
-   
-    label = new Label();
-    label.setForegroundColor(ColorConstants.black);
-    label.setBorder(new MarginBorder(2, 4, 2, 4));
-    r.add(label); //Holder);
-
-    RectangleFigure line = new RectangleFigure();
-    line.setPreferredSize(20, 1);
-    outerPane.add(line);
-
-
-    scrollpane = new ScrollPane();
-    scrollpane.setForegroundColor(ColorConstants.black);
-    scrollpane.setVerticalScrollBarVisibility(ScrollPane.AUTOMATIC); //ScrollPane.ALWAYS);
-    outerPane.add(scrollpane);
-
-    ContainerFigure pane = new ContainerFigure();
-    pane.setBorder(new MarginBorder(5, 8, 5, 8));
-    ContainerLayout layout = new ContainerLayout();
-    layout.setHorizontal(false);
-    layout.setSpacing(0);
-    pane.setLayoutManager(layout);
-
-    Viewport viewport = new Viewport();
-    viewport.setContentsTracksHeight(true);
-    ViewportLayout viewportLayout = new ViewportLayout()
-    {
-      protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
-      {
-        Dimension d = super.calculatePreferredSize(parent, width, height);
-        d.height = Math.min(d.height, theMinHeight - 25); //getViewer().getControl().getBounds().height);
-        return d;
-      }
-    };
-    viewport.setLayoutManager(viewportLayout);
-
-    scrollpane.setViewport(viewport);
-    scrollpane.setContents(pane);
-
-    return outerPane;
-  }  
-
-  protected List getModelChildren() 
-  {            
-    return ((Category)getModel()).getChildren();
-  }  
-        
-  public void refreshVisuals()
-  {
-    outerPane.setBorder(new RoundedLineBorder(isSelected ? ColorConstants.black : categoryBorderColor, isSelected ? 1 : 1, 6));
-    outerPane.repaint();
-// Uncomment this for coloured titles
-//    r.setBackgroundColor(isSelected ? ColorConstants.blue : GraphicsConstants.elementBackgroundColor);
-//    label.setForegroundColor(isSelected ? ColorConstants.white : ColorConstants.black);
-//    r.repaint();
-//    outerPane.setForegroundColor(isSelected ? ColorConstants.black : elementBorderColor);
-    
-    Category category = (Category)getModel();
-    // temp hack --- added empty space to make the min width of groups bigger  
-    label.setText("  " + category.getName() + "                                                    ");
-  } 
-  
-  public ScrollPane getScrollPane()
-  {
-    return scrollpane;
-  }
-  
-  public IFigure getContentPane()
-  {
-    return scrollpane.getContents();
-  }  
-
-  public void scrollTo(AbstractGraphicalEditPart topLevel)
-  {
-    Rectangle topLevelBounds = topLevel.getFigure().getBounds();
-    Rectangle categoryBounds = getFigure().getBounds();
-    int scrollValue = scrollpane.getVerticalScrollBar().getValue();
-    int location = topLevelBounds.y + scrollValue - categoryBounds.y;
-    scrollpane.scrollVerticalTo(location - categoryBounds.height/2);
-  }
-
-  protected EditPart createChild(Object model)
-  {
-    EditPart editPart = new TopLevelComponentEditPart();
-    editPart.setModel(model);
-    editPart.setParent(this);
-    return editPart;
-  }
-  
-  protected void createEditPolicies()
-  { 
-    selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);   
-  }  
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeDefinitionEditPart.java
deleted file mode 100644
index 620cdc5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeDefinitionEditPart.java
+++ /dev/null
@@ -1,214 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                                      
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.CenteredIconFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-
-              
-
-public class ComplexTypeDefinitionEditPart extends GraphNodeEditPart
-{
-  protected ContainerFigure contentFigure;   
-  protected Label label;     
-  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
-  protected CenteredIconFigure centeredIconFigure;  
-  protected RectangleFigure preceedingSpace;  
-  protected ContainerFigure contentPane;
-
-  public XSDComplexTypeDefinition getXSDComplexTypeDefinition()
-  {         
-    return (XSDComplexTypeDefinition)getModel();
-  }  
-
-  protected boolean isConnectedEditPart()
-  {
-    return false;
-  } 
-
-  protected GraphNodeFigure createGraphNodeFigure()  
-  {
-    GraphNodeFigure figure = new GraphNodeFigure();
-
-    figure.getOutlinedArea().setBorder(new RoundedLineBorder(1, 6));
-    figure.getOutlinedArea().setFill(true);
-    figure.getOutlinedArea().setLayoutManager(new FillLayout(true));
-
-    figure.getInnerContentArea().getContainerLayout().setHorizontal(true);
-
-    preceedingSpace = new RectangleFigure();
-    preceedingSpace.setVisible(false);
-    figure.getInnerContentArea().add(preceedingSpace, 0);
-
-    contentPane = new ContainerFigure();
-    contentPane.getContainerLayout().setHorizontal(false); 
-    contentPane.getContainerLayout().setSpacing(5);   
-    contentPane.setBorder(new MarginBorder(5, 5, 5, 5));
-    figure.getInnerContentArea().add(contentPane);
-    
-    label = new Label();    
-    label.setBorder(new MarginBorder(0, 5, 5, 5));
-    figure.getIconArea().add(label);     
-    label.setFont(mediumBoldFont);
- 
-    figure.getInnerContentArea().getContainerLayout().setSpacing(5);   
-    figure.getInnerContentArea().setBorder(new MarginBorder(5, 5, 5, 5));
-    
-    return figure;
-  }      
-                                                                    
-  protected EditPart createChild(Object model) 
-  {   
-    EditPart editPart = null;                                     
-    if (model == getModel())
-    {
-      editPart = new ComplexTypeInheritedContentEditPart();
-      editPart.setModel(model);
-      editPart.setParent(this);
-    }
-    else
-    {
-      editPart = super.createChild(model);
-    }            
-    return editPart;
-  } 
-
-  protected List getModelChildren() 
-  {                           
-    List list = new ArrayList();
-
-    XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)getModel();
-
-    if (ct.getDerivationMethod().getName().equals("extension"))
-    {
-      list.add(getModel());
-    }  
-
-    list.addAll(XSDChildUtility.getModelChildren(getModel()));
-    return list;
-  }
-
-  public IFigure getContentPane()  
-  {
-    return contentPane;
-  }
-                        
-  protected void refreshVisuals()
-  { 
-    XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition)getModel();                   
-
-    String name = ctd.getName();
-    if (name == null)
-    {
-      try
-      {
-        if (label != null)
-        {
-          graphNodeFigure.getIconArea().remove(label);
-        }
-        label = null;
-      }
-      catch (Exception e)
-      {
-      }
-    }
-    else
-    {
-      if (label == null)
-      {
-        label = new Label();    
-        label.setBorder(new MarginBorder(0, 5, 5, 5));
-        ((GraphNodeFigure)getFigure()).getIconArea().add(label);     
-        label.setFont(mediumBoldFont);
-      }
-      graphNodeFigure.getIconArea().add(label);
-      label.setText(name);
-    }
-
-    // provides some room if we need to draw lines for the inherited
-    boolean includesInheritedContent = getModelChildren().contains(getModel());
-    preceedingSpace.setPreferredSize(includesInheritedContent ? new Dimension(10, 1) : new Dimension(0, 0));
-
-    if (XSDGraphUtil.isEditable(getModel()))
-    { 
-      graphNodeFigure.setForegroundColor(isSelected ? ColorConstants.black : elementBorderColor);
-      if (label != null)
-      label.setForegroundColor(elementBorderColor);
-    }
-    else
-    {
-      graphNodeFigure.setForegroundColor(isSelected ? ColorConstants.black : readOnlyBorderColor);
-      if (label != null)
-      label.setForegroundColor(readOnlyBorderColor);
-    }
-  }
-             
-  protected void performDirectEdit()
-  {  
-    ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, (XSDComplexTypeDefinition)getModel());   
-    simpleDirectEditPolicy.setDelegate(manager);
-    manager.show();
-  }    
-            
-
-  protected void createEditPolicies()
-  {  
-    super.createEditPolicies();
-  	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
-  } 
-       
-
-  public void performRequest(Request request)
-  {
-  	if (request.getType() == RequestConstants.REQ_DIRECT_EDIT ||
-        request.getType() == RequestConstants.REQ_OPEN)
-    {     
-      if (XSDGraphUtil.isEditable(getModel()))
-      {                 
-        LocationRequest locationRequest = (LocationRequest)request;
-        Point p = locationRequest.getLocation();
-        
-        if (label != null && hitTest(label, p))
-        {
-  		    performDirectEdit();
-        }
-      }
-    }
-  }
-  
-  public void doEditName()
-  {
-    performDirectEdit();
-  }
-} 
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeInheritedContentEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeInheritedContentEditPart.java
deleted file mode 100644
index 0295265..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeInheritedContentEditPart.java
+++ /dev/null
@@ -1,149 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-// This is a dashed box that displays the inherited content of a complex type
-//
-public class ComplexTypeInheritedContentEditPart extends BaseEditPart
-{
-  protected Label label;     
-  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
-  protected boolean isParentExpanded;
-               
-  public ComplexTypeInheritedContentEditPart()
-  {
-    super();
-  }   
-                 
-  public XSDComplexTypeDefinition getXSDComplexTypeDefinition()
-  {         
-    return (XSDComplexTypeDefinition)getModel();
-  }
-                  
-  protected IFigure createFigure()
-  {                            
-    ContainerFigure figure = new ContainerFigure();
-    figure.getContainerLayout().setHorizontal(false);
-    figure.getContainerLayout().setBorder(5);
-    figure.getContainerLayout().setSpacing(5);
-    figure.setBorder(new RoundedLineBorder(ColorConstants.gray, 1, 6, Graphics.LINE_DASH));
-    return figure;
-  }    
-           
-  protected List getModelChildren() 
-  {                                              
-    XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)getModel();
-
-    List list = new ArrayList();
-
-    if (ct.getDerivationMethod().getName().equals("extension") && !isParentExpanded)
-    {
-      XSDTypeDefinition type = ct.getBaseTypeDefinition();
-      Iterator iter = XSDChildUtility.getModelChildren(type).iterator();
-      boolean cont = true;
-      while (cont)
-      {
-        while (iter.hasNext())
-        {
-          list.add(0, iter.next());
-        }
-        
-        if (type instanceof XSDComplexTypeDefinition)
-        {
-          XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition)type;
-          type = ctd.getBaseTypeDefinition();
-                    
-					// defect 264957 - workbench hangs when modifying complex content
-					// Since we don't filter out the current complexType from
-					// the combobox, we can potentially have an endless loop
-					if (ctd == type)
-					{
-						cont = false;
-						break;
-					}
-
-          if (ctd.getDerivationMethod().getName().equals("extension"))
-          {
-            iter = XSDChildUtility.getModelChildren(type).iterator();
-          }
-          else
-          {
-            cont = false;
-          }
-        }
-        else
-        {
-          cont = false;
-        }
-      }
-    }
-    return list;
-  }
-
-  protected void refreshVisuals()
-  { 
-    List children = getModelChildren();
-    figure.setVisible(children.size() > 0);   
-    // todo set preferredSize to 0 ?
-  }
-
-  protected void performDirectEdit()
-  {
-    // Why are we allowing direct editing when the label is null?
-    // Should remove the policy
-    if (label != null)
-    {
-      ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, (XSDComplexTypeDefinition)getModel());   
-      simpleDirectEditPolicy.setDelegate(manager);
-      manager.show();
-    }
-  }    
-            
-
-  protected void createEditPolicies()
-  {  
-    super.createEditPolicies();
-    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
-  } 
-       
-
-  public void performRequest(Request request)
-  {
-    if (request.getType() == RequestConstants.REQ_DIRECT_EDIT)
-    {     
-      if (XSDGraphUtil.isEditable(getModel()))
-      {
-        performDirectEdit();
-      }
-    }
-  } 
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComponentViewerRootEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComponentViewerRootEditPart.java
deleted file mode 100644
index fa8d191..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComponentViewerRootEditPart.java
+++ /dev/null
@@ -1,76 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                                      
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerLayout;
-
-              
-
-public class ComponentViewerRootEditPart extends BaseEditPart
-{
-  protected final static String MESSAGE_PLACE_HOLDER = "MESSAGE_PLACE_HOLDER";
-  protected Object input;              
-
-  public void setInput(Object input)
-  {
-    this.input = input;
-    refreshChildren();
-  }
-
-  protected IFigure createFigure()
-  {
-    Panel panel = new Panel();
-    ContainerLayout layout = new ContainerLayout();
-    layout.setBorder(60);
-    panel.setLayoutManager(layout);
-    return panel;
-  }   
-           
-
-  protected List getModelChildren() 
-  {               
-    List list = new ArrayList();
-    if (input != null)
-    {
-      list.add(input);
-    }
-    else
-    {
-      list.add(MESSAGE_PLACE_HOLDER);
-    }
-    return list;
-  }         
-
-  protected EditPart createChild(Object model) 
-  { 
-    EditPart editPart = null;
-    if (model == MESSAGE_PLACE_HOLDER)
-    {
-      editPart = new MessageEditPart();
-      editPart.setModel(model);
-    }
-    else
-    {
-      editPart = super.createChild(model);
-    }
-    return editPart;
-  } 
-
-  protected void createEditPolicies()
-  {  
-  }             
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ElementDeclarationEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ElementDeclarationEditPart.java
deleted file mode 100644
index 249c88b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ElementDeclarationEditPart.java
+++ /dev/null
@@ -1,460 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                                   
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionDialog;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionProvider;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDSetTypeHelper;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.SpacingFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDSubstitutionGroupChildUtility;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDSubstitutionGroupsViewer;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComboBoxCellEditorManager;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ExpandableGraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.model.XSDModelAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.w3c.dom.Element;
-
-              
-
-public class ElementDeclarationEditPart extends ExpandableGraphNodeEditPart
-{
-  public Label label;  
-  protected Label contentIconLabel;
-  protected Label typeValueLabel;
-  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
-  protected boolean isContentIconLabelSelected = false;
-
-  protected final static String ELEMENT_TYPE_PLACE_HOLDER = "ELEMENT_TYPE_PLACE_HOLDER";
-
-  public XSDParticle getXSDParticle()
-  {
-    Object o = getXSDElementDeclaration().getContainer(); 
-    return (o instanceof XSDParticle) ? (XSDParticle)o : null;
-  }        
-
-  public XSDElementDeclaration getXSDElementDeclaration()
-  {         
-    return (XSDElementDeclaration)getModel();
-  }
-     
-  protected boolean isDefaultExpanded()
-  {
-    // hack to expand up to its content.  The previous test didn't appear to work
-    int depth = 0;
-    for (EditPart part = this; part != null; part = part.getParent())
-    {
-      depth++;
-    }      
-    return depth <= 3;
-  }
-                     
-  protected GraphNodeFigure createGraphNodeFigure()
-  {
-    ExpandableGraphNodeFigure figure = new ExpandableGraphNodeFigure();
-
-    figure.getOutlinedArea().setFill(true);
-    figure.getOutlinedArea().setLayoutManager(new FillLayout());
-
-    label = new Label();    
-    figure.getIconArea().add(label);     
-    label.setFont(mediumBoldFont);
-    
-    SpacingFigure spacingFigure = new SpacingFigure();
-    figure.getIconArea().add(spacingFigure);
-    
-    contentIconLabel = new Label();
-    //contentIcon.setBorder(new MarginBorder(2, 2, 2, 10));
-    figure.getIconArea().add(contentIconLabel);
-
-    // A sneaky null check.... getViewer() does a getRoot(), but getRoot() might be null
-    // same with getParent()
-    if (getParent() != null && getRoot() != null && getViewer() instanceof XSDSubstitutionGroupsViewer)
-    {
-      figure.getOuterContentArea().getContainerLayout().setSpacing(5);
-    }
-    else
-    {  
-      RectangleFigure line = new RectangleFigure();
-      line.setPreferredSize(20, 1);   
-      figure.getOutlinedArea().add(line, 1);
-
-      figure.getInnerContentArea().setLayoutManager(new FillLayout(2));
-      figure.getInnerContentArea().setBorder(new MarginBorder(2,2,2,1));
-
-      ContainerFigure labelGroup = new ContainerFigure();   
-      Label typeLabel = new Label("type");
-      labelGroup.add(typeLabel);
-      labelGroup.setBorder(new MarginBorder(0, 4, 0, 4));      
-
-      Label equalsLabel = new Label(" = ");
-      labelGroup.add(equalsLabel);
-
-      typeValueLabel = new Label();                         
-      labelGroup.add(typeValueLabel);
-      figure.getOutlinedArea().add(labelGroup, 2);
-    }
-    return figure;
-  }          
-
-  protected ExpandableGraphNodeFigure getExpandableGraphNodeFigure()
-  {
-    return (ExpandableGraphNodeFigure)graphNodeFigure;
-  }                                            
-                    
-  protected List getModelChildren() 
-  {
-    XSDTypeDefinition typeDef = getXSDElementDeclaration().getTypeDefinition();
-    
-    // Special case simple type.   Need to add it to the list as well
-    List list = new ArrayList();
-    if (typeDef instanceof XSDSimpleTypeDefinition)
-    {
-      list.add((XSDSimpleTypeDefinition)typeDef);
-      if (getExpandableGraphNodeFigure().isExpanded())
-      {
-        list.addAll(getModelChildrenHelper());
-      }
-      return list;
-    }
-    return getExpandableGraphNodeFigure().isExpanded() ? getModelChildrenHelper() : Collections.EMPTY_LIST;
-  }  
-                       
-  protected List getModelChildrenHelper()
-  {
-    if (getViewer() instanceof XSDSubstitutionGroupsViewer)
-    {
-      return XSDSubstitutionGroupChildUtility.getModelChildren(getXSDElementDeclaration().getResolvedElementDeclaration());
-    }
-    else
-    {
-      return XSDChildUtility.getModelChildren(getXSDElementDeclaration().getResolvedElementDeclaration());
-    }
-  }           
-                
-  protected void refreshContentIcon()
-  {
-    String iconName = null;
-    XSDTypeDefinition td = getXSDElementDeclaration().getResolvedElementDeclaration().getTypeDefinition();
-
-    if (td instanceof XSDComplexTypeDefinition)
-    {
-      XSDComplexTypeDefinition complexTypeDefinition = (XSDComplexTypeDefinition)td;
-      if (complexTypeDefinition.getAttributeUses().size() > 0)
-      {
-        iconName = "icons/XSDAttribute.gif";  
-      }  
-    }  
-    Image image = iconName != null ? XSDEditorPlugin.getXSDImage(iconName) : null;
-    contentIconLabel.setIcon(image);    
-  }
-
-  protected void refreshVisuals()
-  { 
-    String text = getXSDElementDeclaration().isElementDeclarationReference() ?
-                  getXSDElementDeclaration().getResolvedElementDeclaration().getQName(getXSDElementDeclaration().getSchema()) :
-                  getXSDElementDeclaration().getName();
-
-    label.setText(text);
-    
-    ContainerFigure rectangle = graphNodeFigure.getOutlinedArea();
-    if (XSDGraphUtil.isEditable(getXSDElementDeclaration()))
-    {
-      rectangle.setBorder(new LineBorder(isSelected ? ColorConstants.black : elementBorderColor, 2));
-      rectangle.setBackgroundColor(elementBackgroundColor);
-      rectangle.setForegroundColor(elementBorderColor);
-      
-      graphNodeFigure.getInnerContentArea().setForegroundColor(ColorConstants.black);
-      if (XSDGraphUtil.isEditable(getXSDElementDeclaration().getResolvedElementDeclaration()))
-      { 
-        // give label 'editable' colour
-        graphNodeFigure.getInnerContentArea().setForegroundColor(elementLabelColor);    
-      }
-      else
-      {   
-        // give label 'read only' colour
-        graphNodeFigure.getInnerContentArea().setForegroundColor(elementBorderColor);
-      }
-      label.setBackgroundColor(elementBackgroundColor);
-      label.setForegroundColor(elementLabelColor);
-    }
-    else
-    {
-      rectangle.setBorder(new LineBorder(isSelected ? ColorConstants.black : readOnlyBorderColor, 2));
-      rectangle.setBackgroundColor(readOnlyBackgroundColor);
-      rectangle.setForegroundColor(readOnlyBorderColor);
-      graphNodeFigure.getInnerContentArea().setForegroundColor(readOnlyBorderColor);     
-      label.setBackgroundColor(readOnlyBackgroundColor);
-    }
-                                                                                   
-    if (getXSDElementDeclaration().isElementDeclarationReference())
-    {
-      label.setIcon(XSDEditorPlugin.getXSDImage("icons/GraphViewElementRef.gif"));
-      label.setBorder(new MarginBorder(0, 0, 0, 4)); 
-    }
-    else
-    {                     
-      label.setIcon(null);
-      label.setBorder(new MarginBorder(0, 6, 0, 4));
-    }
-    
-    if (getXSDParticle() != null)
-    { 
-      refreshOccurenceLabel(getXSDParticle().getMinOccurs(), getXSDParticle().getMaxOccurs());
-    }                      
-     
-   
-    if (typeValueLabel != null)
-    {
-      XSDElementDeclaration ed = getXSDElementDeclaration();
-      if (ed.getElement() != null)
-      {
-        String type = ed.getElement().getAttribute("type");
-        if (type == null)
-        {
-          type = "";
-        }
-        if (!getXSDElementDeclaration().isElementDeclarationReference())
-				{   
-          typeValueLabel.setText(type.equals("") ? "<anonymous>" : type);
-				}
-        else // if it is a ref, we show the resolved type
-        {
-        	String resolvedType = "";
-        	if (ed.getResolvedElementDeclaration() != null)
-        	{
-        		if (ed.getResolvedElementDeclaration().getTypeDefinition() != null)
-        	  {
-        	    resolvedType = ed.getResolvedElementDeclaration().getTypeDefinition().getQName(ed.getSchema());
-              
-              // if null, it has an anonymous type that has no resolved type
-              if (resolvedType == null)
-              {
-                resolvedType = "<anonymous>";
-              }
-        	  }
-        	}
-          typeValueLabel.setText(resolvedType);
-				}
-      }
-    }
-    refreshContentIcon();
-  } 
- 
-                                                                        
-  public void performRequest(Request request)
-  {
-  	if (request.getType() == RequestConstants.REQ_DIRECT_EDIT ||
-        request.getType() == RequestConstants.REQ_OPEN)
-    {                                        
-      if (XSDGraphUtil.isEditable(getXSDElementDeclaration()))
-      {
-        if (request instanceof LocationRequest)
-        {
-          LocationRequest locationRequest = (LocationRequest)request;
-          Point p = locationRequest.getLocation();
-          isContentIconLabelSelected = false;
-          
-          if (hitTest(label, p))
-          {
-  		      performDirectEditForLabel();
-          }
-          else if (hitTest(typeValueLabel, p))
-          {                             
-   		      performDirectEditForTypeValueLabel();
-          }
-        }
-      }
-    }
-  } 
-         
-  private void performDirectEditForTypeValueLabel()
-  {
-		if (!getXSDElementDeclaration().isElementDeclarationReference())
-		{    
-//      TypeReferenceDirectEditManager manager = new TypeReferenceDirectEditManager(this, getXSDElementDeclaration(), typeValueLabel);   
-//      simpleDirectEditPolicy.setDelegate(manager);
-//      manager.show();
-//TODO remove TypeReferenceDirectEditManager since it is not used any longer
-            
-            Shell shell = Display.getCurrent().getActiveShell();
-            IWorkbench workbench = XSDEditorPlugin.getPlugin().getWorkbench();
-            IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-            IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-            IFile currentIFile = ((IFileEditorInput)editorPart.getEditorInput()).getFile();
-            
-            XSDSchema schema = getXSDElementDeclaration().getSchema();
-                
-            XSDComponentSelectionProvider provider = new XSDComponentSelectionProvider(currentIFile, schema);
-            XSDComponentSelectionDialog dialog = new XSDComponentSelectionDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), provider);
-            provider.setDialog(dialog);
-            
-            dialog.setBlockOnOpen(true);
-            dialog.create();
-
-            if (dialog.open() == Window.OK) {
-                Element element = getXSDElementDeclaration().getElement();
-                XSDSetTypeHelper helper = new XSDSetTypeHelper(currentIFile, schema);
-                helper.setType(element, "type", dialog.getSelection());
-            }        
-
-            
-		}
-		// just ignore type edit for element ref's
-  }                                                                
-
-                                                       
-  private void performDirectEditForLabel()
-  {    
-    if (getXSDElementDeclaration().isElementDeclarationReference())   
-    {
-      ComboBoxCellEditorManager manager = new ComboBoxCellEditorManager(this, label)
-      {
-         protected List computeComboContent()
-         {             
-           XSDSchema schema = getXSDElementDeclaration().getSchema();
-           List globalElementNameList = new ArrayList();
-           if (schema != null)
-           {
-             TypesHelper typesHelper = new TypesHelper(schema);
-             globalElementNameList = typesHelper.getGlobalElements();
-           }                                           
-           return globalElementNameList;
-         }
-
-         public void performModify(String value)
-         { 
-           getXSDElementDeclaration().getElement().setAttribute("ref", value);
-         }
-      };
-      simpleDirectEditPolicy.setDelegate(manager);
-      manager.show();
-    }
-    else
-    {
-      ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, getXSDElementDeclaration());   
-      simpleDirectEditPolicy.setDelegate(manager);
-      manager.show();
-    }
-  }                                
-  
-
-  protected void createEditPolicies()
-  {  
-    super.createEditPolicies();
-  	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
-  }
-  
-  
-  public void activate() 
-  {
-    super.activate();
-    if (getXSDParticle() != null)
-    {
-      XSDModelAdapterFactory.addModelAdapterListener(getXSDParticle(), this);
-    }
-  }
-  /** 
-   * Apart from the deactivation done in super, the source
-   * and target connections are deactivated, and the visual
-   * part of the this is removed.
-   *
-   * @see #activate() 
-   */
-  public void deactivate() 
-  {
-    if (getXSDParticle() != null)
-    {
-      XSDModelAdapterFactory.removeModelAdapterListener(getXSDParticle(), this);
-    }
-    super.deactivate();
-  }   
-
-  public boolean isContentIconLabelSelected()
-  {
-    return isContentIconLabelSelected;
-  }
-
-  protected void addChildVisual(EditPart childEditPart, int index)
-  {
-    IFigure child = ((GraphicalEditPart)childEditPart).getFigure();
-    if (childEditPart instanceof SimpleTypeDefinitionEditPart)
-    {
-      graphNodeFigure.getIconArea().add(child, index+ 1);
-      SpacingFigure spacingFigure = new SpacingFigure();
-      graphNodeFigure.getIconArea().add(spacingFigure, index+1);
-    }
-    else
-    {
-      getContentPane().add(child, index);
-    }
-  }
-  
-  protected void removeChildVisual(EditPart childEditPart)
-  {
-    IFigure child = ((GraphicalEditPart)childEditPart).getFigure();
-    if (childEditPart instanceof SimpleTypeDefinitionEditPart)
-    {
-      graphNodeFigure.getIconArea().remove(child);
-    }    
-    else
-    {
-      super.removeChildVisual(childEditPart);
-    }
-  }
-
-  public void doEditName()
-  {
-    ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, getXSDElementDeclaration());
-    simpleDirectEditPolicy.setDelegate(manager);
-    manager.show();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ExpandableGraphNodeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ExpandableGraphNodeEditPart.java
deleted file mode 100644
index 1ad4057..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ExpandableGraphNodeEditPart.java
+++ /dev/null
@@ -1,189 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                                        
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ActionEvent;
-import org.eclipse.draw2d.ActionListener;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.MouseEvent;
-import org.eclipse.draw2d.MouseListener;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ExpandableGraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
-
-                  
-
-public abstract class ExpandableGraphNodeEditPart extends RepeatableGraphNodeEditPart implements MouseListener, ActionListener
-{
-  protected boolean needToPerformDefaultExpansion = true;
-   
-  protected GraphNodeFigure createGraphNodeFigure()
-  {
-    return new ExpandableGraphNodeFigure();     
-  }
-
-  protected void addGraphNodeFigureListeners()
-  {                                                                    
-    getExpandableGraphNodeFigure().getInteractor().addMouseListener(this); 
-  }  
-            
-  protected ExpandableGraphNodeFigure getExpandableGraphNodeFigure()
-  {
-    return (ExpandableGraphNodeFigure)graphNodeFigure;
-  } 
-
-  public IFigure getContentPane()  
-  {
-    return getExpandableGraphNodeFigure().getOuterContentArea();
-  }
-    
-  protected boolean isDefaultExpanded()
-  {
-    return false;
-  }
-
-  protected boolean hasChildren()
-  {
-    return getModelChildrenHelper().size() > 0;
-  }         
-
-  protected abstract List getModelChildrenHelper();
-      
-
-  protected List getModelChildren() 
-  {                                                                             
-    return getExpandableGraphNodeFigure().isExpanded() ? getModelChildrenHelper() : Collections.EMPTY_LIST;
-  }  
-
-  protected void refreshChildren()
-  {    
-    if (needToPerformDefaultExpansion && isDefaultExpanded())
-    {
-      needToPerformDefaultExpansion = false;   
-      performExpandOrCollapseHelper();
-
-      super.refreshChildren();
-
-      EditPart root = getRoot();
-      if (root instanceof AbstractGraphicalEditPart)
-      {         
-        getContentPane().setVisible(true); 
-                    
-        IFigure rootFigure = ((AbstractGraphicalEditPart)root).getFigure();
-        invalidateAll(rootFigure);
-        rootFigure.validate();
-        rootFigure.repaint();
-      }     
-      getExpandableGraphNodeFigure().getInteractor().repaint();
-    } 
-    else
-    {
-      super.refreshChildren(); 
-    }   
-    getExpandableGraphNodeFigure().getInteractor().setVisible(hasChildren());
-  }
-
-
-  protected void performExpandOrCollapseHelper()
-  {
-    boolean isButtonExpanded = !getExpandableGraphNodeFigure().isExpanded();
-    getExpandableGraphNodeFigure().setExpanded(isButtonExpanded);
-  }
-
-  public void doPerformExpandOrCollapse()
-  {
-    performExpandOrCollapse();
-  }  
-  
-  public boolean isExpanded()
-  {
-    return getExpandableGraphNodeFigure().isExpanded();
-  }
-
-  protected void performExpandOrCollapse()
-  {
-    performExpandOrCollapseHelper();                              
-
-    boolean isButtonExpanded = getExpandableGraphNodeFigure().isExpanded();
-
-    refreshChildren();
-
-    EditPart root = getRoot();
-    if (root instanceof AbstractGraphicalEditPart)
-    {         
-      getContentPane().setVisible(isButtonExpanded); 
-                       
-      IFigure rootFigure = ((AbstractGraphicalEditPart)root).getFigure();
-      invalidateAll(rootFigure);
-      rootFigure.validate();
-      rootFigure.repaint();
-    }      
-    getExpandableGraphNodeFigure().getInteractor().repaint();
-  }
-
-  
-  protected void refreshOccurenceLabel(int min, int max)
-  {
-    super.refreshOccurenceLabel(min, max);
-
-    // TODO: revisit the 'hack' to understand why we need to do this 
-    // in order to get the view to layout propetly
-    //
-    IFigure thisFigure = getFigure();
-    invalidateAll(thisFigure);
-    thisFigure.validate();
-    thisFigure.repaint();
-  }
-
-  protected void invalidateAll(IFigure figure)
-  {
-    figure.invalidate();   
-    LayoutManager manager = figure.getLayoutManager();
-    if (manager != null)
-    {
-      manager.invalidate();
-    }
-    for (Iterator i = figure.getChildren().iterator(); i.hasNext(); )
-    {
-      IFigure child = (IFigure)i.next();
-      invalidateAll(child);
-    }
-  } 
-
-  
-  // implements MouseListener
-  // 
-  public void mouseDoubleClicked(MouseEvent me) 
-  {
-  }
-
-  public void mousePressed(MouseEvent me) 
-  {                             
-    me.consume();
-    needToPerformDefaultExpansion = false;
-    performExpandOrCollapse();  
-  }
-
-  public void mouseReleased(MouseEvent me) 
-  {
-  } 
-
-  public void actionPerformed(ActionEvent event) 
-  {                      
-    performExpandOrCollapse();
-  }   
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/GraphNodeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/GraphNodeEditPart.java
deleted file mode 100644
index ce6ad0a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/GraphNodeEditPart.java
+++ /dev/null
@@ -1,144 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                                        
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ConnectedEditPartFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.GraphNodeDragTracker;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
-
-              
-
-public abstract class GraphNodeEditPart extends BaseEditPart
-{
-  protected GraphNodeFigure graphNodeFigure;
-  protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
-                                 
-  protected boolean isConnectedEditPart()
-  {
-    return true;
-  }
-
-  protected IFigure createFigure()
-  {                           
-    IFigure result = graphNodeFigure = createGraphNodeFigure();    
-    addGraphNodeFigureListeners();
-
-    if (isConnectedEditPart())
-    {
-      ConnectedEditPartFigure connectedEditPartFigure = createConnectedEditPartFigure();                                    
-      connectedEditPartFigure.add(graphNodeFigure);
-      result = connectedEditPartFigure;
-    }
-    return result;
-  }       
-           
-  protected ConnectedEditPartFigure createConnectedEditPartFigure()
-  {
-    ConnectedEditPartFigure connectedEditPartFigure = new ConnectedEditPartFigure(this)
-    {
-      public IFigure getSelectionFigure()
-      {
-        return graphNodeFigure.getOutlinedArea();
-      }
-
-      public IFigure getConnectionFigure()
-      {
-        return graphNodeFigure.getConnectionFigure();
-      }
-    };
-    return connectedEditPartFigure;
-  }                                
-
-  protected abstract GraphNodeFigure createGraphNodeFigure();           
-  
-  protected void addGraphNodeFigureListeners()
-  {
-  }
- 
-  public IFigure getSelectionFigure()
-  {
-    return graphNodeFigure.getOutlinedArea();
-  }
-
-  public Rectangle getConnectionRectangle()
-  {
-    return graphNodeFigure.getConnectionRectangle();
-  }
-
-  protected void createEditPolicies()
-  { 
-    //installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new NonResizableEditPolicy());    
-    selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);   
-  }  
-
-  public DragTracker getDragTracker(Request request)
-  {
-    return new GraphNodeDragTracker((EditPart)this);
-  }   
-
- protected EditPart getApplicableEditPart(EditPart editPart, Point p)
-  {        
-    while (true)
-    {    
-      EditPart parent = null;
-      if (editPart instanceof GraphNodeEditPart)
-      {                                  
-        IFigure f = ((GraphNodeEditPart)editPart).getSelectionFigure();
-        if (!hitTest(f, p))
-        {                                 
-          parent = editPart.getParent();        
-        }             
-      }   
-
-      if (parent != null)
-      {
-        editPart = parent;
-      }                   
-      else
-      {
-        break;
-      }
-    }         
-    return editPart;
-  }
-
-  public EditPart getTargetEditPart(Request request)   
-  { 
-    EditPart editPart = null;
-    if (request.getType() == REQ_SELECTION)
-    {                                                                       
-      if (request instanceof LocationRequest)
-      {
-        LocationRequest locationRequest = (LocationRequest)request;
-        Point p = locationRequest.getLocation();
-        editPart = getApplicableEditPart(this, p);
-      }
-    }
-    return (editPart != null) ? editPart : super.getTargetEditPart(request);
-  }   
-
-  public boolean hitTest(IFigure target, Point location)
-  {
-    Rectangle b = target.getBounds().getCopy();
-    target.translateToAbsolute(b);  
-    return b.contains(location);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/IFeedbackHandler.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/IFeedbackHandler.java
deleted file mode 100644
index 24a0537..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/IFeedbackHandler.java
+++ /dev/null
@@ -1,17 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-
-public interface IFeedbackHandler
-{
-  public void addFeedback();
-  public void removeFeedback();
-}              
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/MessageEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/MessageEditPart.java
deleted file mode 100644
index bbb7f92..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/MessageEditPart.java
+++ /dev/null
@@ -1,38 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                          
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-
-              
-
-public class MessageEditPart extends BaseEditPart
-{
-  public MessageEditPart()
-  {
-  }   
-  
-  protected IFigure createFigure()
-  {                            
-    Label label = new Label(XSDEditorPlugin.getXSDString("_UI_GRAPH_VIEW_NOT_AVAILABLE"));         
-    return label;
-  }    
-
-  protected List getModelChildren() 
-  {                  
-    return Collections.EMPTY_LIST;
-  }   
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupDefinitionEditPart.java
deleted file mode 100644
index af5804a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupDefinitionEditPart.java
+++ /dev/null
@@ -1,204 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                                      
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComboBoxCellEditorManager;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.RepeatableGraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-
-              
-public class ModelGroupDefinitionEditPart extends RepeatableGraphNodeEditPart
-{
-  protected Label label;     
-  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
-
-  public XSDModelGroupDefinition getXSDModelGroupDefinition()
-  {
-    return (XSDModelGroupDefinition)getModel();
-  } 
-
-  protected boolean isConnectedEditPart()
-  {
-    return false;
-  }          
-
-  public XSDParticle getXSDParticle()
-  {                    
-    Object o = getXSDModelGroupDefinition().getContainer();
-    return (o instanceof XSDParticle) ? (XSDParticle)o : null;
-  }
-             
-  protected GraphNodeFigure createGraphNodeFigure()
-  {
-    RepeatableGraphNodeFigure figure = new RepeatableGraphNodeFigure();                                                        
-    figure.getOutlinedArea().setBorder(new RoundedLineBorder(1, 6));
-    figure.getInnerContentArea().setBorder(new MarginBorder(10, 0, 10, 0));
-
-    label = new Label();    
-    label.setFont(mediumBoldFont); 
-    figure.getIconArea().add(label);     
-
-
-    return figure;
-  }  
- 
-  public IFigure getContentPane()  
-  {
-    return graphNodeFigure.getInnerContentArea();
-  }
-           
-  protected List getModelChildren() 
-  {                                             
-    return XSDChildUtility.getModelChildren(getModel());  
-  }
-
-  protected void createEditPolicies()
-  {     
-    super.createEditPolicies();
-  	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
-  }             
-             
-  protected void refreshVisuals()
-  { 
-    super.refreshVisuals();                                                                
-  
-    if (getXSDModelGroupDefinition().isModelGroupDefinitionReference())
-    {
-      label.setText(getXSDModelGroupDefinition().getResolvedModelGroupDefinition().getQName());
-      label.setIcon(XSDEditorPlugin.getXSDImage("icons/GraphViewElementRef.gif"));
-      label.setBorder(new MarginBorder(0, 0, 0, 4)); 
-
-      // todo update occurence label
-      //
-    }
-    else
-    {               
-      label.setText(getXSDModelGroupDefinition().getName());      
-      label.setIcon(null);
-      label.setBorder(new MarginBorder(0, 6, 0, 4));
-    }
-                       
-    if (XSDGraphUtil.isEditable(getModel()))
-    { 
-      graphNodeFigure.getOutlinedArea().setForegroundColor(isSelected ? ColorConstants.black : elementBorderColor);
-      label.setForegroundColor(elementLabelColor);
-    }
-    else
-    {
-      graphNodeFigure.getOutlinedArea().setForegroundColor(readOnlyBackgroundColor);
-      label.setForegroundColor(readOnlyBackgroundColor);
-    }   
-
-    refreshOccurenceLabel(getXSDParticle());
-  }
- 
-
-  protected void performDirectEdit()
-  {              
-    if (getXSDModelGroupDefinition().isModelGroupDefinitionReference())
-    {
-      ComboBoxCellEditorManager manager = new ComboBoxCellEditorManager(this, label)
-      {
-         protected List computeComboContent()
-         {             
-           XSDSchema schema = getXSDModelGroupDefinition().getSchema();
-           List nameList = new ArrayList();
-           if (schema != null)
-           {
-             TypesHelper typesHelper = new TypesHelper(schema);
-             nameList = typesHelper.getModelGroups();
-           }                                           
-           return nameList;
-         }
-
-         public void performModify(String value)
-         {  
-           Display.getCurrent().asyncExec(new DelayedModelGroupRenameAction(getXSDModelGroupDefinition(), value));
-         }
-      };                                          
-      simpleDirectEditPolicy.setDelegate(manager);
-      manager.show();
-    }
-    else 
-    {
-      ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, getXSDModelGroupDefinition());           
-      simpleDirectEditPolicy.setDelegate(manager);
-      manager.show();
-    }
-  }  
-       
-
-  protected class DelayedModelGroupRenameAction implements Runnable
-  {
-     XSDModelGroupDefinition modelGroupDefinition;                                     
-     String value;
-
-     DelayedModelGroupRenameAction(XSDModelGroupDefinition modelGroupDefinition, String value)
-     {
-       this.modelGroupDefinition = modelGroupDefinition;
-       this.value = value;
-     }
-
-     public void run()
-     {
-       modelGroupDefinition.getElement().setAttribute("ref", value);
-     }
-  }
-    
-
-  public void performRequest(Request request)
-  {
-  	if (request.getType() == RequestConstants.REQ_DIRECT_EDIT)
-    {     
-      if (XSDGraphUtil.isEditable(getModel()))
-      {
-  		  performDirectEdit();
-      }
-    }
-  }    
- 
-  // TODO... I added this as a quick fix to makesure the title gets redrawn when the groupRef is changed
-  // we should probably fix the ModelListenerUtil to fire both call both 'change' methods for the ref property
-  //public void modelChildrenChanged()
-  //{   
-  //  super.modelChildrenChanged();                                              
-  //  refreshVisuals(); 
-  //} 
-
-  public void doEditName()
-  {
-    ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, getXSDModelGroupDefinition());           
-    simpleDirectEditPolicy.setDelegate(manager);
-    manager.show();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupEditPart.java
deleted file mode 100644
index b793eba..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ModelGroupEditPart.java
+++ /dev/null
@@ -1,187 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                          
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.DragAndDropEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.CenteredIconFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ExpandableGraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
-import org.eclipse.wst.xsd.ui.internal.graph.model.XSDModelAdapterFactory;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-
-              
-
-public class ModelGroupEditPart extends ExpandableGraphNodeEditPart
-{
-  protected CenteredIconFigure centeredIconFigure;
- 
-  protected static Color editableBackgroundColor = null;
-  protected static Color editableForegroundColor = null;
-  protected static Color nonEditableForegroundColor = null;
-
-  public XSDParticle getXSDParticle()
-  {                    
-    Object o = getXSDModelGroup().getContainer();
-    return (o instanceof XSDParticle) ? (XSDParticle)o : null;
-  }
-
-  public XSDModelGroup getXSDModelGroup()
-  {
-    return (XSDModelGroup)getModel();
-  }           
-
-  protected GraphNodeFigure createGraphNodeFigure()
-  {
-    ExpandableGraphNodeFigure figure = new ExpandableGraphNodeFigure();      
-
-    centeredIconFigure = new CenteredIconFigure();
-    centeredIconFigure.setPreferredSize(new Dimension(32, 20)); 
-    //centeredIconFigure.setBackgroundColor(new Color(Display.getCurrent(), 255, 0, 0)); 
-    figure.getIconArea().add(centeredIconFigure);   
-    //figure.getIconArea().setLayout(new CenterLayout());
-
-    ContainerFigure outlinedArea = figure.getOutlinedArea();                        
-    outlinedArea.setBorder(new RoundedLineBorder(1, 10));   
-    //outlinedArea.setPreferredSize(new Dimension(32, 20)); 
-                         
-    // set layout so that children are aligned vertically with some spacing
-    //
-    figure.getOuterContentArea().getContainerLayout().setHorizontal(false);  
-    figure.getOuterContentArea().getContainerLayout().setSpacing(10);
-
-    return figure;
-  }    
-
-  protected List getModelChildrenHelper()
-  {
-    return XSDChildUtility.getModelChildren(getXSDModelGroup());
-  }  
- 
-  protected void refreshVisuals()
-  {         
-    String iconName = "icons/XSDSequence.gif";    
-    switch (getXSDModelGroup().getCompositor().getValue())
-    {
-      case XSDCompositor.ALL   : { iconName = "icons/XSDAll.gif"; break; }
-      case XSDCompositor.CHOICE   : { iconName = "icons/XSDChoice.gif"; break; }
-      case XSDCompositor.SEQUENCE : { iconName = "icons/XSDSequence.gif"; break; }
-    }
-    centeredIconFigure.image = XSDEditorPlugin.getXSDImage(iconName);
-    centeredIconFigure.repaint();
-                                                          
-
-    ContainerFigure outlinedArea = graphNodeFigure.getOutlinedArea() ;    
-    if (XSDGraphUtil.isEditable(getXSDModelGroup()))
-    {
-      if (editableForegroundColor == null) 
-        editableForegroundColor = new Color(Display.getCurrent(), 120, 152, 184);
-
-      if (editableBackgroundColor == null) 
-        editableBackgroundColor = new Color(Display.getCurrent(), 232, 240, 248);
-       
-      outlinedArea.setForegroundColor(isSelected ? ColorConstants.black : editableForegroundColor);
-      outlinedArea.setBackgroundColor(editableBackgroundColor);
-    }
-    else
-    {                                          
-      if (nonEditableForegroundColor == null) 
-        nonEditableForegroundColor = new Color(Display.getCurrent(), 164, 164, 164);    
-        
-      outlinedArea.setForegroundColor(isSelected ? ColorConstants.black : nonEditableForegroundColor);
-      outlinedArea.setBackgroundColor(ColorConstants.white);
-    }  
-
-    refreshOccurenceLabel(getXSDParticle());
-  }        
-
-  protected boolean isChildLayoutHorizontal()
-  {
-    return false;
-  } 
-
-  protected boolean isDefaultExpanded()
-  {        
-    return isPossibleCycle() ? false : true;
-  }  
-                                                                                         
-  // This test ensures that we don't end up with an infinite default expansion (e.g. when a group contains a cyclic group ref)
-  // TODO... we probably need some more extensible 'OO' way of computing this information
-  protected boolean isPossibleCycle()
-  {        
-    boolean result = false;
-    if (getParent() instanceof ModelGroupDefinitionEditPart)
-    {                                                      
-      ModelGroupDefinitionEditPart group = (ModelGroupDefinitionEditPart)getParent();
-      for (EditPart parent = group.getParent(); parent != null; parent = parent.getParent())
-      {
-        if (parent.getModel() instanceof ElementDeclarationEditPart)
-        {
-          break;
-        }       
-        else 
-        {
-          if (parent.getModel() == group.getModel())
-          {
-            result = true;
-            break;
-          }
-        }
-      }      
-    }      
-    return result;
-  } 
-       
-  protected void createEditPolicies()
-  { 
-    super.createEditPolicies();
-    installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DragAndDropEditPolicy(getViewer(), selectionHandlesEditPolicy));      
-  }
-  
-  public void activate() 
-  {
-    super.activate();
-    if (getXSDParticle() != null)
-    {
-      XSDModelAdapterFactory.addModelAdapterListener(getXSDParticle(), this);
-    }
-  }
-  /** 
-   * Apart from the deactivation done in super, the source
-   * and target connections are deactivated, and the visual
-   * part of the this is removed.
-   *
-   * @see #activate() 
-   */
-  public void deactivate() 
-  {
-    if (getXSDParticle() != null)
-    {
-      XSDModelAdapterFactory.removeModelAdapterListener(getXSDParticle(), this);
-    }
-    super.deactivate();
-  }   
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RepeatableGraphNodeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RepeatableGraphNodeEditPart.java
deleted file mode 100644
index 6fdf7d6..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RepeatableGraphNodeEditPart.java
+++ /dev/null
@@ -1,72 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                                        
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.DragAndDropEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.RepeatableGraphNodeFigure;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-
-                  
-
-public class RepeatableGraphNodeEditPart extends GraphNodeEditPart
-{
-  protected RepeatableGraphNodeFigure getRepeatableGraphNodeFigure()
-  {
-    return (RepeatableGraphNodeFigure)graphNodeFigure;
-  }
-  
-  protected GraphNodeFigure createGraphNodeFigure()
-  {
-    return new RepeatableGraphNodeFigure();                                                        
-  }   
-      
-  protected void refreshOccurenceLabel(XSDParticle particle)
-  {  
-    if (particle != null)
-    { 
-      refreshOccurenceLabel(particle.getMinOccurs(), particle.getMaxOccurs());
-    }
-  }
-
-  protected void refreshOccurenceLabel(int min, int max)
-  {                     
-    if (min == 1 && max == 1)
-    {
-      getRepeatableGraphNodeFigure().getOccurenceLabel().setText("");
-    }
-    else
-    {
-      String maxString = max == -1 ? "*" : "" + max;
-      getRepeatableGraphNodeFigure().getOccurenceLabel().setText(min + ".." + maxString);
-    }
-    getRepeatableGraphNodeFigure().getOccurenceLabel().repaint();
-  }
-
-  protected void createEditPolicies()
-  { 
-    super.createEditPolicies();
-    
-    if (getModel() instanceof XSDElementDeclaration) {
-    	Object parent = ((XSDElementDeclaration) getModel()).eContainer();
-    	
-    	if (!(parent instanceof XSDSchema)) {
-    		installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DragAndDropEditPolicy(getViewer(), selectionHandlesEditPolicy));      
-    	}
-    }
-    else {
-    	installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DragAndDropEditPolicy(getViewer(), selectionHandlesEditPolicy));
-    }
-  }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootComplexTypeDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootComplexTypeDefinitionEditPart.java
deleted file mode 100644
index 853a2df..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootComplexTypeDefinitionEditPart.java
+++ /dev/null
@@ -1,121 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                                   
-import java.util.List;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDInheritanceViewer;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ExpandableGraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-
-              
-
-public class RootComplexTypeDefinitionEditPart extends ExpandableGraphNodeEditPart
-{                      
-  public Label label;  
-  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();                              
-        
-
-  protected GraphNodeFigure createGraphNodeFigure()
-  {
-    ExpandableGraphNodeFigure figure = new ExpandableGraphNodeFigure();
-    figure.getOutlinedArea().setBorder(new RoundedLineBorder(1, 6));
-    figure.getOutlinedArea().setLayoutManager(new FillLayout());
-    figure.getOutlinedArea().setFill(true);
-    
-    if (getViewer() instanceof XSDInheritanceViewer)
-    {
-      figure.getOuterContentArea().getContainerLayout().setSpacing(10);
-    }
-
-    label = new Label();       
-    label.setFont(mediumBoldFont);
-    label.setBorder(new MarginBorder(5, 8, 5, 8));  
-    figure.getIconArea().add(label);  
-
-    return figure;
-  }          
-   
-                                                                                   
-  protected void refreshVisuals()
-  { 
-    super.refreshVisuals();                                                                
-
-    XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition)getModel();                   
-    label.setText(ctd.getName() != null ? ctd.getName(): "");
-
-    if (XSDGraphUtil.isEditable(ctd))
-    { 
-      figure.setForegroundColor(elementBorderColor);
-      label.setForegroundColor(elementBorderColor);
-    }
-    else
-    {
-      figure.setForegroundColor(readOnlyBorderColor);
-      label.setForegroundColor(readOnlyBorderColor);
-    }
-  }
-
-
-  protected List getModelChildrenHelper()
-  {
-    XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)getModel();
-    if (getViewer() instanceof XSDInheritanceViewer)
-    {
-      return XSDChildUtility.getImmediateDerivedTypes(ct);
-    }
-    else
-    {
-      return XSDChildUtility.getModelChildren(getModel());
-    }
-  }     
-
-
-  protected void createEditPolicies()
-  {  
-    SelectionHandlesEditPolicyImpl policy = new SelectionHandlesEditPolicyImpl();
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, policy);     
-  	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
-  }  
-        
-
-  protected void performDirectEdit()
-  {                                  
-    ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, (XSDComplexTypeDefinition)getModel());     
-    simpleDirectEditPolicy.setDelegate(manager);
-    manager.show();
-  }    
-
-
-  public void performRequest(Request request)
-  {
-  	if (request.getType() == RequestConstants.REQ_DIRECT_EDIT)
-    {
-      if (XSDGraphUtil.isEditable(getModel()))
-      {
-  		  performDirectEdit();
-      }
-    }
-  } 
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootModelGroupDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootModelGroupDefinitionEditPart.java
deleted file mode 100644
index 35f4486..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/RootModelGroupDefinitionEditPart.java
+++ /dev/null
@@ -1,105 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                                   
-import java.util.List;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ExpandableGraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-              
-public class RootModelGroupDefinitionEditPart extends ExpandableGraphNodeEditPart
-{                      
-  public Label label;  
-  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();                              
-                     
-
-  protected GraphNodeFigure createGraphNodeFigure()
-  {
-    ExpandableGraphNodeFigure figure = new ExpandableGraphNodeFigure();
-    figure.getOutlinedArea().setBorder(new RoundedLineBorder(1, 6));
-    figure.getOutlinedArea().setLayoutManager(new FillLayout());
-    figure.getOutlinedArea().setFill(true);
-
-    label = new Label();       
-    label.setFont(mediumBoldFont);
-    label.setBorder(new MarginBorder(5, 8, 5, 8));  
-    figure.getIconArea().add(label);  
-
-    return figure;
-  }  
-                                                                          
-  protected void refreshVisuals()
-  { 
-    super.refreshVisuals();                                                                
-
-    XSDModelGroupDefinition mgd = (XSDModelGroupDefinition)getModel();                      
-    String name = mgd.getResolvedModelGroupDefinition().getName();                  
-    label.setText(name);
-
-    if (XSDGraphUtil.isEditable(getModel()))
-    { 
-      figure.setForegroundColor(elementBorderColor);
-      label.setForegroundColor(elementBorderColor);
-    }
-    else
-    {
-      figure.setForegroundColor(readOnlyBorderColor);
-      label.setForegroundColor(readOnlyBorderColor);
-    }
-  }  
-
-  protected List getModelChildrenHelper()
-  {
-    return XSDChildUtility.getModelChildren(getModel());
-  }   
-
-
-  protected void createEditPolicies()
-  {  
-    SelectionHandlesEditPolicyImpl policy = new SelectionHandlesEditPolicyImpl();
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, policy);     
-  	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
-  }  
-        
-
-  protected void performDirectEdit()
-  {                                  
-    ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, ((XSDModelGroupDefinition)getModel()).getResolvedModelGroupDefinition());           
-    simpleDirectEditPolicy.setDelegate(manager);
-    manager.show();
-  }    
-
-
-  public void performRequest(Request request)
-  {
-  	if (request.getType() == RequestConstants.REQ_DIRECT_EDIT)
-    {
-      if (XSDGraphUtil.isEditable(getModel()))
-      {
-  		  performDirectEdit();
-      }
-    }
-  } 
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaDirectiveEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaDirectiveEditPart.java
deleted file mode 100644
index c0697d5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaDirectiveEditPart.java
+++ /dev/null
@@ -1,60 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.CenteredIconFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
-import org.eclipse.xsd.XSDSchemaDirective;
-
-
-public class SchemaDirectiveEditPart extends BaseEditPart
-{
-  protected CenteredIconFigure centeredIconFigure;
-  protected Label label;
-  /**
-   * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
-   */
-  protected IFigure createFigure()
-  {
- 
-    ContainerFigure figure = new ContainerFigure();
-
-    figure.setLayoutManager(new FillLayout());
-    figure.setBorder(new RoundedLineBorder(1, 8));
-
-    ContainerFigure fig = new ContainerFigure();
-    fig.setLayoutManager(new FillLayout());
-    fig.setBorder(new MarginBorder(10, 0, 10, 0));
-    figure.add(fig);
-
-
-    label = new Label();    
-    label.setBorder(new MarginBorder(4, 2, 2, 10));
-    fig.add(label);        
-
-    return figure;
-  }  
- 
-  public void refreshVisuals()
-  {
-    XSDSchemaDirective directive = (XSDSchemaDirective)getModel();
-    String schemaLocation = directive.getSchemaLocation();
-    if (schemaLocation == null) schemaLocation = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED") + ")";
-    if (schemaLocation.equals("")) schemaLocation = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED") + ")";
-    label.setText("  " + directive.getElement().getLocalName() + " " + schemaLocation);
-  } 
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaEditPart.java
deleted file mode 100644
index ad1f64b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SchemaEditPart.java
+++ /dev/null
@@ -1,206 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.graph.GraphicsConstants;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.FillLayout;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.RoundedLineBorder;
-import org.eclipse.wst.xsd.ui.internal.graph.model.Category;
-import org.eclipse.wst.xsd.ui.internal.graph.model.XSDModelAdapterFactory;
-import org.eclipse.xsd.XSDSchema;
-
-public class SchemaEditPart extends BaseEditPart
-{
-  protected ContainerFigure containerFigure;
-  protected Label label;
-
-  //protected ContainerFigure childExpansionContainer;
-  public IFigure getContentPane()
-  {
-    return containerFigure;
-  }
-
-  protected IFigure createFigure()
-  {
-    ContainerFigure outer = new ContainerFigure();
-    outer.setBorder(new RoundedLineBorder(1, 6));
-    outer.setForegroundColor(categoryBorderColor);
-    FillLayout fillLayout = new FillLayout(4);
-    outer.setLayoutManager(fillLayout); 
-    //outer.getContainerLayout().setHorizontal(false);
-    
-    ContainerFigure r = new ContainerFigure();  
-    r.setOutline(false);
-    r.setMinimumSize(new Dimension(0, 0));
-    r.setFill(true);
-    r.setBackgroundColor(GraphicsConstants.elementBackgroundColor);
-    outer.add(r);
-    
-	final int theMinHeight = 200;
-    FillLayout outerLayout = new FillLayout()
-    {
-      protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
-      {
-        Dimension d = super.calculatePreferredSize(parent, width, height);
-        d.union(new Dimension(100, theMinHeight));
-        return d;
-      }
-    };
-    outerLayout.setHorizontal(false);
-    outer.setLayoutManager(outerLayout);
-    
-    label = new Label();
-    label.setForegroundColor(ColorConstants.black);
-    label.setBorder(new MarginBorder(2, 4, 2, 4));    
-    r.add(label);
-    
-    RectangleFigure line = new RectangleFigure();
-    line.setPreferredSize(20, 1);
-    outer.add(line);
-    
-    containerFigure = new ContainerFigure();
-    //containerFigure.setBackgroundColor(ColorConstants.red);
-    containerFigure.setBorder(new MarginBorder(4, 4, 4, 4));
-    fillLayout = new FillLayout(4);
-    containerFigure.setLayoutManager(fillLayout);
-    //containerFigure.setLayoutManager(new FillLayout(false));
-    /*
-     * FlowLayout layout1 = new FlowLayout(false); layout1.setMajorSpacing(0);
-     * layout1.setMinorSpacing(0); layout1.setStretchMinorAxis(true);
-     * containerFigure.setLayoutManager(layout1);
-     */
-    outer.add(containerFigure);
-    //childExpansionContainer = new ContainerFigure();
-    //childExpansionContainer.getContainerLayout().setHorizontal(false);
-    //childExpansionContainer.setOutlined(true);
-    return outer;
-  }
-
-  protected List getModelChildren()
-  {
-    List list = new ArrayList();
-    list.add(CategoryRowEditPart.DIRECTIVES_AND_NOTATIONS);
-    list.add(CategoryRowEditPart.ELEMENTS_AND_TYPES);
-    list.add(CategoryRowEditPart.MODEL_GROUPS_AND_ATTRIBUTES);      
-    return list;
-  }
-
-  protected EditPart createChild(Object model)
-  {
-    CategoryRowEditPart result = new CategoryRowEditPart();
-    result.setModel(model);
-    result.setParent(this);
-    result.setSchema((XSDSchema)getModel());
-    return result;
-  }
-  
-
-  protected void refreshVisuals()
-  {
-    super.refreshVisuals();
-    String targetNamespaceValue = ((XSDSchema)getModel()).getTargetNamespace();
-    if (targetNamespaceValue == null || targetNamespaceValue.length() == 0)
-    {
-      targetNamespaceValue = XSDEditorPlugin.getXSDString("_UI_GRAPH_XSDSCHEMA_NO_NAMESPACE");
-    }     
-    label.setText(XSDEditorPlugin.getXSDString("_UI_GRAPH_XSDSCHEMA") + " : " + targetNamespaceValue);
-  }
-}
-
-class CategoryRowEditPart extends BaseEditPart
-{  
-  public static final int[] ELEMENTS_AND_TYPES = {Category.ELEMENTS, Category.TYPES };
-  public static final int[] DIRECTIVES_AND_NOTATIONS =  {Category.DIRECTIVES, Category.NOTATIONS };
-  public static final int[] MODEL_GROUPS_AND_ATTRIBUTES = {Category.GROUPS, Category.ATTRIBUTES};//, Category.COMPLEX_TYPES };
-  
-  protected XSDSchema schema;
-  protected Figure contentPane;
-  
-  protected IFigure createFigure()
-  {
-    ContainerFigure containerFigure = new ContainerFigure();
-    //containerFigure.setBackgroundColor(ColorConstants.red);
-    containerFigure.setFill(true);
-    containerFigure.setBorder(new MarginBorder(4, 4, 4, 4));
-    org.eclipse.wst.xsd.ui.internal.gef.util.figures.FillLayout fillLayout = new org.eclipse.wst.xsd.ui.internal.gef.util.figures.FillLayout(4);
-    fillLayout.setHorizontal(true);
-    containerFigure.setLayoutManager(fillLayout);
-    //containerFigure.setLayoutManager(new FillLayout(4));
-    return containerFigure;
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#getContentPane()
-   */
-  public IFigure getContentPane()
-  {
-    return super.getContentPane();
-  }
-
-  public XSDSchema getSchema()
-  {
-    return schema;
-  }
-
-  public void setSchema(XSDSchema schema)
-  {
-    this.schema = schema;
-  }
-  
-
-  protected List getModelChildren()
-  {
-    List categoryList = (List) XSDModelAdapterFactory.getAdapter(schema).getProperty(schema, "groups");
-    return filterCategoryList(categoryList);
-  }
-  
-  protected List filterCategoryList(List list)
-  {
-    List result = new ArrayList();
-    int[] categoryTypes = (int[])getModel();
-    for (Iterator i = list.iterator(); i.hasNext(); )
-    {
-      Category category = (Category)i.next();
-      if (isMatching(categoryTypes, category))
-      {
-        result.add(category);
-      }
-    }
-    return result;
-  }
-  
-  private boolean isMatching(int[] categoryTypes, Category category)
-  {
-    boolean result = false;
-    for (int i = 0; i < categoryTypes.length; i++)
-    {
-      if (categoryTypes[i] == category.getGroupType())
-      {
-        result = true;
-        break;
-      }
-    }
-    return result;
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SimpleTypeDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SimpleTypeDefinitionEditPart.java
deleted file mode 100644
index df1afad..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SimpleTypeDefinitionEditPart.java
+++ /dev/null
@@ -1,69 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ImageFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
-
-public class SimpleTypeDefinitionEditPart extends BaseEditPart
-{
-  protected Label label;
-  protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
-
-  ImageFigure figure;
-  Image image;
-  
-  protected IFigure createFigure()
-  {
-    String iconName = "icons/XSDSimpleTypeForEditPart.gif";
-    image = XSDEditorPlugin.getXSDImage(iconName);
-  
-    figure = new ImageFigure(image);
-    return figure;
-  }
-
-  protected void refreshVisuals()
-  {
-    if (isSelected)
-    {
-      image = XSDEditorPlugin.getXSDImage("icons/XSDSimpleTypeForEditPart.gif");
-    }
-    else
-    {
-      image = XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
-    }
-    figure.setImage(image);
-    figure.repaint();
-  }
-  
-  protected boolean isConnectedEditPart()
-  {
-    return false;
-  }
-  
-  public void deactivate()
-  {
-    super.deactivate();
-    image = null;  // where do we dispose the image?
-  }
-  
-
-  protected void createEditPolicies()
-  { 
-    selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);   
-  }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SubstitutionGroupViewerRootEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SubstitutionGroupViewerRootEditPart.java
deleted file mode 100644
index 3899e8e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/SubstitutionGroupViewerRootEditPart.java
+++ /dev/null
@@ -1,76 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                                      
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerLayout;
-
-              
-
-public class SubstitutionGroupViewerRootEditPart extends BaseEditPart
-{
-  protected final static String MESSAGE_PLACE_HOLDER = "MESSAGE_PLACE_HOLDER";
-  protected Object input;              
-
-  public void setInput(Object input)
-  {
-    this.input = input;
-    refreshChildren();
-  }
-
-  protected IFigure createFigure()
-  {
-    Panel panel = new Panel();
-    ContainerLayout layout = new ContainerLayout();
-    layout.setBorder(60);
-    panel.setLayoutManager(layout);
-    return panel;
-  }   
-           
-
-  protected List getModelChildren() 
-  {               
-    List list = new ArrayList();
-    if (input != null)
-    {
-      list.add(input);
-    }
-    else
-    {
-      list.add(MESSAGE_PLACE_HOLDER);
-    }
-    return list;
-  }         
-
-  protected EditPart createChild(Object model) 
-  { 
-    EditPart editPart = null;
-    if (model == MESSAGE_PLACE_HOLDER)
-    {
-      editPart = new MessageEditPart();
-      editPart.setModel(model);
-    }
-    else
-    {
-      editPart = super.createChild(model);
-    }
-    return editPart;
-  } 
-
-  protected void createEditPolicies()
-  {  
-  }             
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TopLevelComponentEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TopLevelComponentEditPart.java
deleted file mode 100644
index 04b686a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TopLevelComponentEditPart.java
+++ /dev/null
@@ -1,319 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.gef.util.editparts.AbstractComponentViewerRootEditPart;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.FillLayout;
-import org.eclipse.wst.xsd.ui.internal.graph.GraphicsConstants;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDComponentViewer;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.ComponentNameDirectEditManager;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.model.ModelAdapter;
-import org.eclipse.wst.xsd.ui.internal.graph.model.XSDModelAdapterFactory;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-
-
-public class TopLevelComponentEditPart extends BaseEditPart implements IFeedbackHandler
-{
-  protected Label label;
-  //protected Label arrowLabel;
-  protected ContainerFigure labelHolder = new ContainerFigure();
-  protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
-  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
-  protected boolean isReadOnly;
-  protected boolean isSelected;
-  protected Font font;
-  
-  protected IFigure createFigure()
-  {
-    ContainerFigure typeGroup = new ContainerFigure();
-    typeGroup.getContainerLayout().setHorizontal(true);
-
-    //arrowLabel = new Label();
-    //arrowLabel.setIcon(XSDEditorPlugin.getPlugin().getImage("icons/forward.gif"));
-    //typeGroup.add(arrowLabel);
-
-    labelHolder = new ContainerFigure();
-    FillLayout fillLayout = new FillLayout();
-    labelHolder.setLayoutManager(fillLayout);
-    labelHolder.setFill(true);
-    typeGroup.add(labelHolder);
-
-    label = new Label();
-    label.setBorder(new MarginBorder(0, 2, 2, 1));
-    label.setForegroundColor(ColorConstants.black);
-    labelHolder.add(label);
-    
-    try
-	{
-      // evil hack to provide underlines
-      Object model = getModel();
-      
-      boolean isLinux = java.io.File.separator.equals("/");
-      if (model instanceof XSDComplexTypeDefinition ||
-          model instanceof XSDElementDeclaration ||
-          model instanceof XSDModelGroupDefinition)
-      {
-        if (!isLinux)
-        {
-          FontData oldData = GraphicsConstants.medium.getFontData()[0];
-          FontData fontData = new FontData(oldData.getName(), oldData.getHeight(), SWT.NONE);
-
-            // TODO... clean this awful code up... we seem to be leaking here too
-            // we can't call this directly since the methods are OS dependant
-            // fontData.data.lfUnderline = 1
-            // so instead we use reflection
-            Object data = fontData.getClass().getField("data").get(fontData);
-//            System.out.println("data" + data.getClass());
-            data.getClass().getField("lfUnderline").setByte(data, (byte)1);
-            font = new Font(Display.getCurrent(), fontData);
-            label.setFont(font);
-        }
-      }
-	}
-    catch (Exception e)
-	{
-
-	}
-    
-    return typeGroup;
-  }
-  
-  public void deactivate()
-  {
-	  super.deactivate();
-	  if (font != null)
-	  {
-		  font.dispose();
-		  font = null;
-	  }
-  }
-  
-  public void refreshVisuals()
-  {
-    ModelAdapter adapter = XSDModelAdapterFactory.getAdapter(getModel());
-    if (adapter != null)
-    {
-      // isReadOnly = Boolean.TRUE.equals(adapter.getProperty(getModel(), "isReadOnly"));
-      isReadOnly = !XSDGraphUtil.isEditable(getModel());
-      label.setForegroundColor(computeLabelColor());
-      label.setText((String)adapter.getProperty(getModel(), ModelAdapter.LABEL_PROPERTY));
-      Image image = (Image)adapter.getProperty(getModel(), ModelAdapter.IMAGE_PROPERTY);
-      if (image != null) label.setIcon(image);
-      //arrowLabel.setVisible(Boolean.TRUE.equals(adapter.getProperty(getModel(), "drillDown")));
-    }
-    else
-    {
-      label.setText(XSDEditorPlugin.getXSDString("_UI_GRAPH_UNKNOWN_OBJECT") + getModel().getClass().getName());
-      //arrowLabel.setVisible(false);
-    }
-
-    if (reselect)
-    {
-      getViewer().select(this);
-      setReselect(false);
-    }
-  }
-
-
-  public XSDNamedComponent getXSDNamedComponent()
-  {
-    return (XSDNamedComponent) getModel();
-  }
-
-  public List getModelChildren()
-  {
-    return Collections.EMPTY_LIST;
-  }
-  
-  protected void createEditPolicies()
-  { 
-    //installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new NonResizableEditPolicy());    
-    //selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
-    //installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);  
-  	
-    SelectionHandlesEditPolicyImpl policy = new SelectionHandlesEditPolicyImpl();
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, policy);
-
-    SelectionEditPolicy feedBackSelectionEditPolicy = new SelectionEditPolicy()
-    {
-      protected void hideSelection()
-      {
-        EditPart editPart = getHost();
-        if (editPart instanceof IFeedbackHandler)
-        {
-          ((IFeedbackHandler)editPart).removeFeedback();
-        }
-      }
-
-      protected void showSelection()
-      {
-        EditPart editPart = getHost();
-        if (editPart instanceof IFeedbackHandler)
-        {
-          ((IFeedbackHandler)editPart).addFeedback();
-        }
-      }
-    };
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, feedBackSelectionEditPolicy);
-
-    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
-  }  
-  
-  public Color computeLabelColor()
-  {
-    Color color = ColorConstants.black;
-    if (isSelected)
-    {
-      color = ColorConstants.white;
-    }
-    else if (isReadOnly)
-    {
-      color = ColorConstants.gray;
-    }
-    return color;
-  }
-
-
-  public void addFeedback()
-  {
-    isSelected = true;
-
-    labelHolder.setBackgroundColor(ColorConstants.black);
-    label.setForegroundColor(computeLabelColor());
-    labelHolder.setFill(true);
-    
-    if (doScroll)
-    {
-      CategoryEditPart categoryEP = (CategoryEditPart)getParent();
-      categoryEP.scrollTo(this);
-      setScroll(false);
-    }
-  }
-  
-  private boolean doScroll = false;
-  public void setScroll(boolean doScroll)
-  {
-    this.doScroll = doScroll;
-  }
-
-  public void removeFeedback()
-  {
-    isSelected = false;
-    labelHolder.setBackgroundColor(null);
-    label.setForegroundColor(computeLabelColor());
-    labelHolder.setFill(false);
-  }
-
-  public void performRequest(Request request)
-  {  
-    if (request.getType() == RequestConstants.REQ_DIRECT_EDIT ||
-        request.getType() == RequestConstants.REQ_OPEN)
-    {
-      
-      Object model = getModel();
-      if (model instanceof XSDComplexTypeDefinition ||
-          model instanceof XSDElementDeclaration ||
-          model instanceof XSDModelGroupDefinition)
-      {
-        if (request instanceof LocationRequest)
-        {
-          LocationRequest locationRequest = (LocationRequest)request;
-          Point p = locationRequest.getLocation();
-        
-          if (hitTest(labelHolder, p))
-          {
-            performDrillDownAction();
-          }              
-        }
-      }
-    }
-  }  
-
-  public boolean hitTest(IFigure target, Point location)
-  {
-    Rectangle b = target.getBounds().getCopy();
-    target.translateToAbsolute(b);  
-    return b.contains(location);
-  }  
-
-  protected void performDrillDownAction()
-  {                                                                                    
-    Runnable runnable = new Runnable()
-    {
-      public void run()
-      {
-        //((XSDComponentViewer)getViewer()).setInput((XSDConcreteComponent)getModel());
-        
-        EditPart editPart = ((AbstractEditPartViewer)getViewer()).getRootEditPart().getContents();
-        if (editPart instanceof AbstractComponentViewerRootEditPart)
-        {
-          AbstractComponentViewerRootEditPart rootEditPart = (AbstractComponentViewerRootEditPart)editPart;
-          rootEditPart.setInput((XSDConcreteComponent)getModel());
-        }
-        else if (editPart instanceof BaseEditPart)
-        {
-          ((XSDComponentViewer)getViewer()).setInput((XSDConcreteComponent)getModel());
-        }
-      }
-    };
-    Display.getCurrent().asyncExec(runnable);
-  }
-  
-  public void doEditName()
-  {
-    removeFeedback();
-    Object object = getModel();
-    if (object instanceof XSDNamedComponent)
-    {
-      ComponentNameDirectEditManager manager = new ComponentNameDirectEditManager(this, label, (XSDNamedComponent)object);
-      simpleDirectEditPolicy.setDelegate(manager);
-      manager.show();
-    }
-  }
-
-  
-  static boolean reselect = false;
-  
-  public void setReselect(boolean state)
-  {
-    reselect = state;
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TypeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TypeEditPart.java
deleted file mode 100644
index 37a83e1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TypeEditPart.java
+++ /dev/null
@@ -1,72 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SelectionHandlesEditPolicyImpl;
-import org.eclipse.wst.xsd.ui.internal.graph.editpolicies.SimpleDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class TypeEditPart extends BaseEditPart
-{
-  protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
-
-  protected IFigure createFigure()
-  {
-    ContainerFigure typeGroup = new ContainerFigure();
-//    typeGroup.setBorder(new SimpleRaisedBorder(1));
-//    typeGroup.setBorder(new LineBorder(1));
-//    typeGroup.setBorder(new RoundedLineBorder(1,5));
-
-    Label typeLabel = new Label("type");
-    typeLabel.setBorder(new MarginBorder(0,2,2,1));
-    typeGroup.add(typeLabel);
-
-    return typeGroup;
-  }    
-
-  protected void refreshVisuals()
-  {                 
-    super.refreshVisuals();
-  }
-
-  public XSDTypeDefinition getXSDTypeDefinition()
-  {         
-    return (XSDTypeDefinition)getModel();
-  }
-
-                    
-  public List getModelChildren() 
-  {                   
-    return Collections.EMPTY_LIST;
-  }  
-
-  protected void createEditPolicies()
-  {        
-    SelectionHandlesEditPolicyImpl policy = new SelectionHandlesEditPolicyImpl();
-    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, policy);      
-  } 
-  
-               
-  public void performRequest(Request request)
-  {
-    super.performRequest(request);
-  }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/WildcardEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/WildcardEditPart.java
deleted file mode 100644
index 53a86a1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/WildcardEditPart.java
+++ /dev/null
@@ -1,85 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                          
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDGraphUtil;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.GraphNodeFigure;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.RepeatableGraphNodeFigure;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDWildcard;
-              
-
-public class WildcardEditPart extends RepeatableGraphNodeEditPart
-{
-  protected Label label;
-
-                             
-  public XSDParticle getXSDParticle()
-  {                    
-    Object o = getXSDWildcard().getContainer();
-    return (o instanceof XSDParticle) ? (XSDParticle)o : null;
-  }
-
-
-  public XSDWildcard getXSDWildcard()
-  {
-    return (XSDWildcard)getModel();
-  }
-
-   
-  protected GraphNodeFigure createGraphNodeFigure()
-  {
-    RepeatableGraphNodeFigure figure = new RepeatableGraphNodeFigure();                                                        
-    figure.setConnected(true);
-    figure.getOutlinedArea().setFill(true);
-
-    label = new Label();    
-    label.setText(XSDEditorPlugin.getXSDString("_UI_ANY_ELEMENT")); 
-    label.setBorder(new MarginBorder(0, 6, 0, 4));
-    label.setFont(mediumBoldFont);        
-
-    figure.getIconArea().add(label);     
-
-    return figure;
-  }  
- 
-      
-  protected void refreshVisuals()
-  {     
-    ContainerFigure rectangle = graphNodeFigure.getOutlinedArea();
-    if (XSDGraphUtil.isEditable(getModel()))
-    {
-      rectangle.setBorder(new LineBorder(2));
-      rectangle.setBackgroundColor(elementBackgroundColor);
-      rectangle.setForegroundColor(isSelected ? ColorConstants.black : elementBorderColor);
-
-      label.setBackgroundColor(elementBackgroundColor);
-      label.setForegroundColor(elementLabelColor);
-    }
-    else
-    {            
-      rectangle.setBorder(new LineBorder(readOnlyBorderColor, 2));
-      rectangle.setBackgroundColor(readOnlyBackgroundColor);
-      rectangle.setForegroundColor(isSelected ? ColorConstants.black : readOnlyBorderColor);
-   
-      label.setBackgroundColor(readOnlyBackgroundColor);
-      label.setForegroundColor(readOnlyBorderColor);
-    } 
-
-    refreshOccurenceLabel(getXSDParticle());
-  }      
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/XSDEditPartFactory.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/XSDEditPartFactory.java
deleted file mode 100644
index 5d6ed1e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/XSDEditPartFactory.java
+++ /dev/null
@@ -1,102 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editparts;
-                              
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDInheritanceViewer;
-import org.eclipse.wst.xsd.ui.internal.graph.model.Category;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-
-
-public class XSDEditPartFactory implements EditPartFactory
-{   
-  protected static XSDEditPartFactory instance;
-                      
-  public static XSDEditPartFactory getInstance()
-  {
-    if (instance == null)
-    {               
-      instance = new XSDEditPartFactory();
-    }
-    return instance;
-  }
-  
-  public EditPart createEditPart(EditPart parent, Object model)
-  {
-    EditPart editPart = null;
-           
-    if (model instanceof Category)
-    {                                  
-      editPart = new CategoryEditPart();
-    }
-    else if (model instanceof XSDElementDeclaration)
-    {       
-      editPart = new ElementDeclarationEditPart();
-    }    
-    else if (model instanceof XSDComplexTypeDefinition)
-    {
-      if (parent.getViewer() instanceof XSDInheritanceViewer)
-      {
-        editPart = new RootComplexTypeDefinitionEditPart();
-      }
-      else
-      {
-        if (parent instanceof CategoryEditPart)
-          editPart = new RootComplexTypeDefinitionEditPart();
-        else
-          editPart = new ComplexTypeDefinitionEditPart();             
-      }
-    }      
-    else if (model instanceof XSDModelGroup)
-    {       
-      editPart = new ModelGroupEditPart();
-    }      
-    else if (model instanceof XSDModelGroupDefinition)
-    {       
-      if (parent instanceof CategoryEditPart)
-        editPart = new RootModelGroupDefinitionEditPart();
-      else
-        editPart = new ModelGroupDefinitionEditPart();
-    }  
-    else if (model instanceof XSDSchema)
-    {                                  
-      editPart = new SchemaEditPart();
-    }
-    else if (model instanceof XSDWildcard)
-    {                                  
-      editPart = new WildcardEditPart();
-    }
-    else if (model instanceof XSDSimpleTypeDefinition)
-    {
-      editPart = new SimpleTypeDefinitionEditPart();
-    }
-
-    if (editPart != null)   
-    {
-      editPart.setModel(model);
-      editPart.setParent(parent);
-    }
-    else
-    {      
-//      System.out.println("can't create editPart for " + model);
-//      Thread.dumpStack();
-    }
-    return editPart;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComboBoxCellEditorManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComboBoxCellEditorManager.java
deleted file mode 100644
index a7b2329..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComboBoxCellEditorManager.java
+++ /dev/null
@@ -1,203 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
-                                                  
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.jface.viewers.ICellEditorListener;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-
-public abstract class ComboBoxCellEditorManager extends DirectEditManager implements DirectEditPolicyDelegate
-{
-  protected Label label;                                 
-
-  public ComboBoxCellEditorManager(GraphicalEditPart source,	Label label)
-  {
-	  super(source, ComboBoxCellEditor.class, new InternalCellEditorLocator(label));
-    this.label = label;                        
-  }
-
-  protected void initCellEditor() 
-  {                                             
-  	String initialLabelText = label.getText();   
-
-    CCombo combo = (CCombo)getCellEditor().getControl();
-   	combo.setFont(label.getFont());
-    combo.setForeground(label.getForegroundColor());
-    combo.setBackground(label.getBackgroundColor());
-    /*
-	combo.addKeyListener(new KeyAdapter() {
-			// hook key pressed - see PR 14201  
-			public void keyPressed(KeyEvent keyEvent) {
-				if (keyEvent.character == 'z') { 
-					getCellEditor().applyEditorValue();
-				}
-			}
-		});
-*/
-  ICellEditorListener cellEditorListener = new ICellEditorListener()
-  {
-    public void cancelEditor()
-    {
-//      System.out.println("cancelEditor");
-    }
-    public void applyEditorValue()
-    {
-//      System.out.println("applyEditorValue");
-    }
-    public void editorValueChanged(boolean old, boolean newState)
-    {
-//      System.out.println("editorValueChanged");
-    }
-  };
-  getCellEditor().addListener(cellEditorListener);
-
-    String[] item = combo.getItems();
-    for (int i = 0; i < item.length; i++)
-    {
-      if (item[i].equals(initialLabelText))
-      {
-        getCellEditor().setValue(new Integer(i));
-        break;
-      }
-    } 	
-  }	 
-         
-  // hack... for some reason the ComboBoxCellEditor does't fire an editorValueChanged to set the dirty flag
-  // unless we overide this method to return true, the manager is not notified of changes made in the cell editor
-  protected boolean isDirty()
-  {
-	  return true;
-  }
-
-  protected CellEditor createCellEditorOn(Composite composite)
-  { 
-    boolean isLabelTextInList = false;                                       
-    List list = computeComboContent();
-    for (Iterator i = list.iterator(); i.hasNext(); )
-    {
-      String string = (String)i.next();
-      if (string.equals(label.getText()))
-      {                               
-         isLabelTextInList = true;
-         break;
-      }
-    } 
-         
-    if (!isLabelTextInList)
-    {
-      list.add(label.getText());
-    }
-                                               
-    List sortedList = computeSortedList(list);
-    String[] stringArray = new String[sortedList.size()];
-    for (int i = 0; i < stringArray.length; i++)
-    {
-      stringArray[i] = (String)sortedList.get(i);
-    }
-    return new ComboBoxCellEditor(composite, stringArray);
-	}                                                                 
-
-  protected List computeSortedList(List list)
-  {
-    return list;
-  }
-
-  protected abstract List computeComboContent(); 
-
-  protected abstract void performModify(String value);
-
-  public static class InternalCellEditorLocator implements CellEditorLocator
-  {
-    protected Label label;
-
-    public InternalCellEditorLocator(Label label)
-    {
-      this.label = label;
-    }                   
-
-    public void relocate(CellEditor celleditor) 
-    {
-      CCombo combo = (CCombo)celleditor.getControl();  
-	    Point pref = combo.computeSize(-1, -1);
-	    Rectangle rect = label.getTextBounds().getCopy();
-	    label.translateToAbsolute(rect);
-	    combo.setBounds(rect.x-4, rect.y-1, pref.x+1, pref.y+1);
-    }
-  } 
-   
-  // implements DirectEditPolicyDelegate
-  // 
-  public void performEdit(CellEditor cellEditor)
-  {   
-    CCombo combo = (CCombo)getCellEditor().getControl();
-    int index = combo.getSelectionIndex();              
-    if (index != -1)
-    {      
-      performModify(combo.getItem(index));
-    }  
-    else
-    {
-      String typedValue = combo.getText();	
-      if (combo.indexOf(typedValue) != -1)
-      {	      
-	    performModify(typedValue);
-      }      	
-      else
-      {
-      	String closeMatch = getCloseMatch(typedValue, combo.getItems());
-      	if (closeMatch != null)
-      	{
-		  performModify(closeMatch);      	
-      	}
-      	else
-      	{      	
-      	  Display.getCurrent().beep();
-      	}
-      }
-    }    	                                                
-  }
-  
-  protected String getCloseMatch(String value, String[] items)
-  {
-    int matchIndex = -1;
-
-    for (int i = 0; i < items.length; i++)
-    {
-    	String item = items[i];
-    	String a = getLocalName(value);
-    	String b = getLocalName(item);
-		  if (a.equalsIgnoreCase(b))
-		  { 
-			  matchIndex = i;
-			  break;				
-		  }	    	     
-    }  
-    return matchIndex != -1 ? items[matchIndex] : null;
-  }
-  
-  protected String getLocalName(String string)
-  {
-		int index = string.indexOf(":");
-	  return (index != -1) ? string.substring(index + 1) : string;  
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComponentNameDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComponentNameDirectEditManager.java
deleted file mode 100644
index 5f25abc..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/ComponentNameDirectEditManager.java
+++ /dev/null
@@ -1,105 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
-                                                  
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.TopLevelComponentEditPart;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalElementRenamer;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalGroupRenamer;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalSimpleOrComplexTypeRenamer;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDSwitch;
-
-
-
-public class ComponentNameDirectEditManager extends TextCellEditorManager
-{
-  protected XSDNamedComponent component;
-  protected static GraphicalEditPart mySource;
-
-  public ComponentNameDirectEditManager(GraphicalEditPart source,	Label label, XSDNamedComponent component)
-  {
-    super(source, label);  
-    this.component = component;
-    mySource = source;
-  }
-
-  public void performModify(final String value)
-  {
-    if (value.length() > 0)
-    {
-      DelayedRenameRunnable runnable = new DelayedRenameRunnable(component, value);
-      Display.getCurrent().asyncExec(runnable);
-    }
-  }      
-
-  protected static class DelayedRenameRunnable implements Runnable
-  {
-    protected XSDNamedComponent component;
-    protected String name;
-
-    public DelayedRenameRunnable(XSDNamedComponent component, String name)
-    {                                                               
-      this.component = component;
-      this.name = name;
-    }                                                              
-
-    public void run()
-    {                             
-      XSDSwitch xsdSwitch = new XSDSwitch()
-      {                   
-        public Object caseXSDTypeDefinition(XSDTypeDefinition object)
-        {
-          new GlobalSimpleOrComplexTypeRenamer(object, name).visitSchema(object.getSchema());
-          return null;
-        } 
-      
-        public Object caseXSDElementDeclaration(XSDElementDeclaration object)
-        {           
-          if (object.isGlobal())
-          {
-            new GlobalElementRenamer(object, name).visitSchema(object.getSchema());
-          }
-          return null;
-        }
-      
-        public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
-        {
-          new GlobalGroupRenamer(object, name).visitSchema(object.getSchema());
-          return null;
-        }
-      };
-      xsdSwitch.doSwitch(component); 
-      component.setName(name);
-      if (mySource instanceof TopLevelComponentEditPart)
-      {
-        ((TopLevelComponentEditPart)mySource).setReselect(true);        
-      }
-    }
-  }
-  
-  protected void bringDown()
-  {
-    super.bringDown();
-    if (mySource != null)
-    {
-      if (mySource instanceof TopLevelComponentEditPart)
-      {
-        ((TopLevelComponentEditPart)mySource).setReselect(true);        
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DirectEditPolicyDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DirectEditPolicyDelegate.java
deleted file mode 100644
index b5cce8b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DirectEditPolicyDelegate.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
-   
-import org.eclipse.jface.viewers.CellEditor;
-
-public interface DirectEditPolicyDelegate
-{       
-  public void performEdit(CellEditor cellEditor);  
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropCommand.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropCommand.java
deleted file mode 100644
index aa7a60d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropCommand.java
+++ /dev/null
@@ -1,161 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.wst.xsd.ui.internal.actions.MoveAction;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.IConnectionRenderingViewer;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.ComplexTypeDefinitionEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.GraphNodeEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.ModelGroupDefinitionEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.ModelGroupEditPart;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-
-public class DragAndDropCommand extends Command //AbstractCommand
-{ 
-  protected EditPartViewer viewer;    
-  protected ChangeBoundsRequest request;
-  protected GraphNodeEditPart childRefEditPart;    
-  public GraphNodeEditPart parentEditPart; 
-  public Point location;
-  protected MoveAction action;    
-  protected boolean canExecute;
-
-  public DragAndDropCommand(EditPartViewer viewer, ChangeBoundsRequest request)
-  {
-    this.viewer = viewer;                    
-    this.request = request;
-
-    location = request.getLocation();   
-    EditPart target = viewer.findObjectAt(location); 
-    if (viewer instanceof ScrollingGraphicalViewer)
-    {  
-      ScrollingGraphicalViewer sgv = (ScrollingGraphicalViewer)viewer;
-      Point p = ((FigureCanvas)sgv.getControl()).getViewport().getViewLocation();
-      location.y += p.y;
-      location.x += p.x;
-    }
-     
-    List list = request.getEditParts();
-    if (list.size() > 0)
-    {           
-      parentEditPart = getParentEditPart(target);
-      if (parentEditPart != null)
-      {                                          
-        for (Iterator i = parentEditPart.getChildren().iterator(); i.hasNext(); )
-        {
-          EditPart child = (EditPart)i.next();
-          if (child instanceof GraphNodeEditPart)
-          {
-            GraphNodeEditPart childGraphNodeEditPart = (GraphNodeEditPart)child;
-            Rectangle rectangle = childGraphNodeEditPart.getSelectionFigure().getBounds();
-     
-            if (location.y < rectangle.getCenter().y)
-            {                                    
-              childRefEditPart = childGraphNodeEditPart;   
-              break;
-            }
-          }
-        } 
-            
-        List editPartsList = request.getEditParts();
-        List concreteComponentList = new ArrayList(editPartsList.size());
-        for (Iterator i = editPartsList.iterator(); i.hasNext(); )
-        {                                                       
-          EditPart editPart = (EditPart)i.next();
-          concreteComponentList.add((XSDConcreteComponent)editPart.getModel());
-        } 
-        XSDConcreteComponent refComponent = childRefEditPart != null ? (XSDConcreteComponent)childRefEditPart.getModel() : null;
-
-        action = new MoveAction((XSDConcreteComponent)parentEditPart.getModel(), concreteComponentList, refComponent);
-        canExecute = action.canMove();                                            
-      }            
-    }     
-  }
-             
-  protected GraphNodeEditPart getParentEditPart(EditPart target)
-  {
-    GraphNodeEditPart result = null;    
-    while (target != null)
-    {                     
-      if (target instanceof ModelGroupEditPart)
-      {
-        result = (GraphNodeEditPart)target;
-        break;
-      }
-      else if (target instanceof ComplexTypeDefinitionEditPart ||
-               target instanceof ModelGroupDefinitionEditPart)
-      {
-        List list = target.getChildren();
-        for (Iterator i = list.iterator(); i.hasNext(); )
-        {
-          Object child = i.next();
-          if (child instanceof ModelGroupEditPart)
-          {
-            result = (GraphNodeEditPart)child;
-            break;
-          }
-        }   
-        if (result != null)
-        {
-          break;
-        }
-      }
-      target = target.getParent();
-    }
-    return result;
-  }
-
-  public void execute()
-  {           
-    if (canExecute)
-    { 
-      action.run(); 
-    }
-  }     
-  
-  public void redo()
-  {
-
-  }  
-  
-  public void undo()
-  {
-  }     
-  
-  public boolean canExecute()
-  { 
-    return canExecute;
-  } 
-
-  public PointList getConnectionPoints(Rectangle draggedFigureBounds)
-  {             
-    PointList pointList = null;      
-    if (parentEditPart != null && childRefEditPart != null && viewer instanceof IConnectionRenderingViewer)
-    {                                
-      pointList = ((IConnectionRenderingViewer)viewer).getConnectionRenderingFigure().getConnectionPoints(parentEditPart, childRefEditPart, draggedFigureBounds);      
-    }               
-    return pointList != null ? pointList : new PointList();
-  }                                                                  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropEditPolicy.java
deleted file mode 100644
index 18468c8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/DragAndDropEditPolicy.java
+++ /dev/null
@@ -1,47 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
-
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-
-public class DragAndDropEditPolicy extends org.eclipse.gef.editpolicies.GraphicalEditPolicy
-{ 
-  protected EditPartViewer viewer;    
-  protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
-
-  public DragAndDropEditPolicy(EditPartViewer viewer, SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy)
-  {
-    this.viewer = viewer;
-    this.selectionHandlesEditPolicy = selectionHandlesEditPolicy;
-  }
-
-  public boolean understandsRequest(Request req)
-  {
-	  return true;
-  }                           
-    
-  static int count2 = 0;
-  boolean theCommandResult = true;   
-  
-  public org.eclipse.gef.commands.Command getCommand(Request request)
-  {             
-    // this block is commented out to disable move for now
-    DragAndDropCommand command = null;                            
-    if (request instanceof ChangeBoundsRequest)
-    {
-      command = new DragAndDropCommand(viewer, (ChangeBoundsRequest)request);  
-      selectionHandlesEditPolicy.setDragAndDropCommand(command);
-    } 
-    return command;             
-  }                                                     
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/GraphNodeDragTracker.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/GraphNodeDragTracker.java
deleted file mode 100644
index 58fbaac..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/GraphNodeDragTracker.java
+++ /dev/null
@@ -1,34 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.tools.DragEditPartsTracker;
-
-                                   
-public class GraphNodeDragTracker extends DragEditPartsTracker 
-{                                     
-  protected EditPart editPart; 
-           
-  public GraphNodeDragTracker(EditPart editPart)
-  {
-    super(editPart);
-    this.editPart = editPart;
-  } 
-                                              
-  protected Command getCommand() 
-  { 
-	  Request request = getTargetRequest();
-    return editPart.getCommand(request); 
-  }
-} 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SelectionHandlesEditPolicyImpl.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SelectionHandlesEditPolicyImpl.java
deleted file mode 100644
index d09b53a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SelectionHandlesEditPolicyImpl.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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
-                                 
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Polyline;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.handles.MoveHandleLocator;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.IFeedbackHandler;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.BogusLayout;
-import org.eclipse.wst.xsd.ui.internal.graph.figures.ContainerFigure;
-
-
-
-
-
-public class SelectionHandlesEditPolicyImpl	extends SelectionHandlesEditPolicy
-{
-  protected IFigure feedback;
-  protected Rectangle originalLocation;
-  protected DragAndDropCommand dragAndDropCommand;
-
-  protected List createSelectionHandles()
-  {              
-    List list = new ArrayList();
-    EditPart editPart = getHost();
-     
-    if (editPart instanceof GraphicalEditPart)
-    {
-      GraphicalEditPart graphicalEditPart = (GraphicalEditPart)editPart;
-      IFigure figure = (graphicalEditPart instanceof BaseEditPart) ? 
-                          ((BaseEditPart)graphicalEditPart).getSelectionFigure() :
-                          graphicalEditPart.getFigure();
-   
-      Cursor cursorFigure = figure.getCursor();
-      MoveHandleLocator loc = new MoveHandleLocator(figure);    
-      MoveHandle moveHandle = new MoveHandle(graphicalEditPart, loc);     
-      moveHandle.setCursor(cursorFigure);
-      list.add(moveHandle);
-    }
-
-    return list;
-  }   
-  
-
-  public boolean understandsRequest(Request request)
-  {    
-    boolean result = false;
-
-	  if (REQ_MOVE.equals(request.getType()))
-    {  
-		  result = false; // return false to disable move for now 
-    }
-    else
-    {
-	    result = super.understandsRequest(request);
-    }
-    return result;
-  }
-  
-
-  public org.eclipse.gef.commands.Command getCommand(Request request) 
-  {                                          
-    return null;  
-  }   
-
-  public void setDragAndDropCommand(DragAndDropCommand dragAndDropCommand)
-  {
-    this.dragAndDropCommand = dragAndDropCommand;
-  }
-
-  protected org.eclipse.gef.commands.Command getMoveCommand(ChangeBoundsRequest request) 
-  {
-	  ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_MOVE_CHILDREN);
-	  req.setEditParts(getHost());
-	
-	  req.setMoveDelta(request.getMoveDelta());
-	  req.setSizeDelta(request.getSizeDelta());
-	  req.setLocation(request.getLocation());
-
-	  return getHost().getParent().getCommand(req);
-  } 
-
-  public void showSourceFeedback(Request request)
-  {  	
-	  if (REQ_MOVE.equals(request.getType()) ||
-		  REQ_ADD.equals(request.getType()))
-		  showChangeBoundsFeedback((ChangeBoundsRequest)request);
-  }
-
-  protected void showChangeBoundsFeedback(ChangeBoundsRequest request)
-  {
-  	IFigure p = getDragSourceFeedbackFigure();
-  	Rectangle r = originalLocation.getTranslated(request.getMoveDelta());
-  	Dimension resize = request.getSizeDelta();
-  	r.width += resize.width;
-  	r.height+= resize.height;
-  
-  	((GraphicalEditPart)getHost()).getFigure().translateToAbsolute(r);
-  	p.translateToRelative(r);
-                
-    Rectangle pBounds = r.getCopy();                            
-
-    if (dragAndDropCommand != null && dragAndDropCommand.canExecute())
-    {                     
-      int size = request.getEditParts().size();
-      if (size > 0 && request.getEditParts().get(size - 1) == getHost())
-      {         
-        PointList pointList = dragAndDropCommand.getConnectionPoints(r);
-        if (pointList != null && pointList.size() > 0)
-        {
-          polyLine.setPoints(pointList);
-          
-          Point firstPoint = pointList.getFirstPoint();
-          if (firstPoint != null)
-          {
-            pBounds = pBounds.getUnion(new Rectangle(firstPoint.x, firstPoint.y, 1, 1));
-          }
-        }
-      }
-    }
-    p.setBounds(pBounds);
-    ghostShape.setBounds(r);
-  	p.validate();
-  }        
-
-
-
-
-  protected IFigure getDragSourceFeedbackFigure() 
-  {
-    EditPart editPart = getHost(); 
-    if (feedback == null && editPart instanceof BaseEditPart)
-    {                                       
-      BaseEditPart baseEditPart = (BaseEditPart)editPart;
-		  originalLocation = new Rectangle(baseEditPart.getSelectionFigure().getBounds());
-		  feedback = createDragSourceFeedbackFigure(baseEditPart.getSelectionFigure());
-	  }
-	  return feedback;
-  }  
-    
-  Polyline polyLine;
-  RectangleFigure ghostShape;
-
-  protected IFigure createDragSourceFeedbackFigure(IFigure draggedFigure)
-  {
-		// Use a ghost rectangle for feedback  
-    ContainerFigure panel = new ContainerFigure(); 
-    panel.setLayoutManager(new BogusLayout());//new FreeformLayout());
-
-		ghostShape = new RectangleFigure();
-		FigureUtilities.makeGhostShape(ghostShape);
-		ghostShape.setLineStyle(Graphics.LINE_DASHDOT);
-		ghostShape.setForegroundColor(ColorConstants.white);
-    
-    Rectangle r = draggedFigure.getBounds();
-    panel.setOpaque(false);
-    panel.add(ghostShape);                 
-
-    polyLine = new Polyline();                         
-    //polyLine.setLineStyle(Graphics.LINE_DASHDOT);      
-    polyLine.setLineWidth(3);
-    panel.add(polyLine);
-
-    panel.setBounds(r);
-		ghostShape.setBounds(r);
-
-		addFeedback(panel);
-
-		return panel;
-	} 
-
-  public void deactivate()
-  {
-	  if (feedback != null)
-    {
-		  removeFeedback(feedback);
-		  feedback = null;
-	  }
-	  hideFocus();
-	  super.deactivate();
-  }
-
-  /**
-   * Erase feedback indicating that the receiver object is 
-   * being dragged.  This method is called when a drag is
-   * completed or cancelled on the receiver object.
-   * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
-   */
-  protected void eraseChangeBoundsFeedback(ChangeBoundsRequest request) 
-  {
-	  if (feedback != null) 
-    {		      
-		  removeFeedback(feedback);
-	  }
-	  feedback = null;
-	  originalLocation = null;
-  }
-
-  /**
-   * Erase feedback indicating that the receiver object is 
-   * being dragged.  This method is called when a drag is
-   * completed or cancelled on the receiver object.
-   * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
-   */
-  public void eraseSourceFeedback(Request request) 
-  {
-    if (REQ_MOVE.equals(request.getType()) ||  REQ_ADD.equals(request.getType()))
-    {
-		  eraseChangeBoundsFeedback((ChangeBoundsRequest)request);
-    }
-  }
-  
-  protected void hideSelection()
-  {
-    EditPart editPart = getHost();
-    if (editPart instanceof IFeedbackHandler)
-    {
-      ((IFeedbackHandler)editPart).removeFeedback();
-    }
-  }
-
-  protected void showSelection()
-  {
-    EditPart editPart = getHost();
-    if (editPart instanceof IFeedbackHandler)
-    {
-      ((IFeedbackHandler)editPart).addFeedback();
-    }
-  }  
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SimpleDirectEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SimpleDirectEditPolicy.java
deleted file mode 100644
index 531eef2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/SimpleDirectEditPolicy.java
+++ /dev/null
@@ -1,58 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.DirectEditPolicy;
-import org.eclipse.gef.requests.DirectEditRequest;
-                                   
-public class SimpleDirectEditPolicy extends DirectEditPolicy 
-{
-  protected DirectEditPolicyDelegate delegate;
-
-  public void setDelegate(DirectEditPolicyDelegate delegate)
-  {                                           
-    this.delegate = delegate;
-  }
-
-  protected org.eclipse.gef.commands.Command getDirectEditCommand(final DirectEditRequest request) 
-  { 
-  	return new Command() //AbstractCommand()
-    {
-      public void execute()
-      {                       
-        if (delegate != null)
-        {
-          delegate.performEdit(request.getCellEditor());
-        }  
-      }     
-  
-      public void redo()
-      {
-      }  
-  
-      public void undo()
-      {
-      }     
-  
-      public boolean canExecute()
-      {
-        return true;
-      }
-    };
-  }
-  
-  protected void showCurrentEditValue(DirectEditRequest request) 
-  {      
-  	//hack to prevent async layout from placing the cell editor twice.
-  	getHostFigure().getUpdateManager().performUpdate();
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TextCellEditorManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TextCellEditorManager.java
deleted file mode 100644
index 6409937..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TextCellEditorManager.java
+++ /dev/null
@@ -1,74 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
-                                                  
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Text;
-
-public abstract class TextCellEditorManager extends DirectEditManager implements DirectEditPolicyDelegate
-{
-  protected Label label;                                 
-
-  public TextCellEditorManager(GraphicalEditPart source,	Label label)
-  {
-	  super(source, TextCellEditor.class, new InternalCellEditorLocator(label));
-    this.label = label;     
-  }
-
-  protected void initCellEditor() 
-  {                                             
-  	String initialLabelText = label.getText();
-  	getCellEditor().setValue(initialLabelText);
-  	Text text = (Text)getCellEditor().getControl();
-  	text.setFont(label.getFont());
-    text.setForeground(label.getForegroundColor());
-    text.setBackground(label.getBackgroundColor());
-  	text.selectAll();
-  }	          
-
-  protected abstract void performModify(String value);
-    
-  public static class InternalCellEditorLocator implements CellEditorLocator
-  {
-    protected Label label;
-
-    public InternalCellEditorLocator(Label label)
-    {
-      this.label = label;
-    }                   
-
-    public void relocate(CellEditor celleditor) 
-    {
-      Text text = (Text)celleditor.getControl();  
-	    Point sel = text.getSelection();
-	    Point pref = text.computeSize(-1, -1);
-	    Rectangle rect = label.getTextBounds().getCopy();
-	    label.translateToAbsolute(rect);
-	    text.setBounds(rect.x-4, rect.y-1, pref.x+1, pref.y+1);	
-	    text.setSelection(0);
-	    text.setSelection(sel); 
-    }
-  }    
-
-  // implements DirectEditPolicyDelegate
-  // 
-  public void performEdit(CellEditor cellEditor)
-  {
-    performModify((String)cellEditor.getValue());
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TypeReferenceDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TypeReferenceDirectEditManager.java
deleted file mode 100644
index c62d1e9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editpolicies/TypeReferenceDirectEditManager.java
+++ /dev/null
@@ -1,118 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.editpolicies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.EditPart;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-
-
-public class TypeReferenceDirectEditManager extends ComboBoxCellEditorManager
-{
-  protected BaseEditPart editPart;                                                
-  protected XSDElementDeclaration ed;
-
-  
-  public TypeReferenceDirectEditManager(BaseEditPart source,	XSDElementDeclaration ed, Label label)
-  {
-    super(source, label);  
-    editPart = source;               
-    this.ed = ed;
-  }
-
-  protected List computeComboContent()
-  {             
-    XSDSchema schema = ed.getSchema();
-    List typeNameList = new ArrayList();
-    if (schema != null)
-    {         
-      TypesHelper typesHelper = new TypesHelper(schema);
-      typeNameList.addAll(typesHelper.getUserSimpleTypeNamesList());
-      typeNameList.addAll(typesHelper.getUserComplexTypeNamesList());               
-      typeNameList.addAll(typesHelper.getBuiltInTypeNamesList());
-    }                        
-    return typeNameList;
-  }
-    
-  public void performModify(String value)
-  {                                               
-    // we need to perform an asyncExec here since the 'host' editpart may be removed
-    // as a side effect of performing the action
-    DelayedRenameRunnable runnable = new DelayedRenameRunnable(editPart, ed, value);
-    Display.getCurrent().asyncExec(runnable);   
-  }  
-   
-
-  protected List computeSortedList(List list)
-  {
-    return TypesHelper.sortList(list);
-  }
-
-  protected static class DelayedRenameRunnable implements Runnable
-  {
-    protected BaseEditPart editPart;                                                
-    protected EditPart editPartParent;
-    protected XSDElementDeclaration ed;
-    protected String name;
-
-    public DelayedRenameRunnable(BaseEditPart editPart, XSDElementDeclaration ed, String name)
-    {                                                               
-      this.editPart = editPart;
-      editPartParent = editPart.getParent();
-      this.ed = ed;
-      this.name = name;
-    }                                                              
-
-    public void run()
-    {                             
-      //BaseGraphicalViewer viewer = editPart.getBaseGraphicalViewer();
-      //viewer.setInputEnabled(false);
-      //viewer.setSelectionEnabled(false);      
-      if (name.equals("<anonymous>"))
-      {          
-        try
-        {
-          ed.getResolvedElementDeclaration().getElement().removeAttribute("type");
-        }
-        catch (Exception e)
-        {
-        }
-      }
-      else
-      {
-        if (ed.getResolvedElementDeclaration().getAnonymousTypeDefinition() != null) // isSetAnonymousTypeDefinition())
-        {
-          if (!(name.equals("<anonymous>")))
-          {
-            ed.getResolvedElementDeclaration().getElement().setAttribute("type", name);
-            XSDDOMHelper.updateElementToNotAnonymous(ed.getResolvedElementDeclaration().getElement());
-//            ed.getResolvedElementDeclaration().setAnonymousTypeDefinition(null);
-            return;
-          }
-        }
-        ed.getResolvedElementDeclaration().getElement().setAttribute("type", name);
-      }
-      //viewer.setInputEnabled(true);
-      //viewer.setSelectionEnabled(true);
-      //viewer.setSelection(new StructuredSelection(editPartParent));
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/BogusLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/BogusLayout.java
deleted file mode 100644
index cfa8c75..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/BogusLayout.java
+++ /dev/null
@@ -1,61 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-
-
-/**
- * Figures using the StackLayout as their layout manager have
- * their children placed on top of one another. Order of 
- * placement is determined by the order in which the children
- * were added, first child added placed on the bottom.
- */
-public class BogusLayout
-	extends AbstractLayout
-{
-                             
-protected int spacing;
-
-public BogusLayout(){}
-
-protected Dimension calculatePreferredSize(IFigure figure, int w, int h)
-{	                 
-  Dimension d = new Dimension();
-  return d;
-} 
-
-/*
- * Returns the minimum size required by the input container.
- * This is the size of the largest child of the container, as all
- * other children fit into this size.
- */
-/*jvh - final
-public Dimension getMinimumSize(IFigure figure){
-	return new Dimension();
-}
-
-public Dimension getPreferredSize(IFigure figure){
-	return new Dimension();
-}            */
-
-/*
- * Lays out the children on top of each other with
- * their sizes equal to that of the available
- * paintable area of the input container figure.
- */
-public void layout(IFigure figure){   
- 
-} 
- 
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenterLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenterLayout.java
deleted file mode 100644
index a0087ab..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenterLayout.java
+++ /dev/null
@@ -1,117 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-
-/**
- * Figures using the StackLayout as their layout manager have
- * their children placed on top of one another. Order of 
- * placement is determined by the order in which the children
- * were added, first child added placed on the bottom.
- */
-public class CenterLayout
-	extends AbstractLayout
-{
-                             
-protected int spacing;
-
-public CenterLayout(){}
-public CenterLayout(int spacing){ this.spacing = spacing; }
-
-/**
- * Calculates and returns the preferred size of the input container.
- * This is the size of the largest child of the container, as all
- * other children fit into this size.
- *
- * @param figure  Container figure for which preferred size is required.
- * @return  The preferred size of the input figure.
- */
-protected Dimension calculatePreferredSize(IFigure figure, int w, int h){
-	Dimension d = calculatePreferredClientAreaSize(figure);
-	/*d.expand(figure.getInsets().getWidth(),
-	         figure.getInsets().getHeight()); */
-        d.expand(w,
-	         h);
-	d.union(getBorderPreferredSize(figure));
-	return d;
-}
-
-protected Dimension calculatePreferredClientAreaSize(IFigure figure){
-	Dimension d = new Dimension();
-	List children = figure.getChildren();
-	for (Iterator i = children.iterator(); i.hasNext(); )
-  {
-		IFigure child = (IFigure)i.next();
-    Dimension childSize = child.getPreferredSize();
-    d.height += childSize.height;
-    d.width = Math.max(childSize.width, d.width);
-	}	                    
-  int childrenSize = children.size();       
-  if (childrenSize > 0)
-  {
-    d.height += spacing * children.size() - 1;
-  }
-	return d;
-}
-
-/*
- * Returns the minimum size required by the input container.
- * This is the size of the largest child of the container, as all
- * other children fit into this size.
- */
-public Dimension getMinimumSize(IFigure figure, int wHint, int hHint){
-	Dimension d = new Dimension();
-	List children = figure.getChildren();
-	IFigure child;
-	for (int i=0; i < children.size(); i++){
-		child = (IFigure)children.get(i);
-		d.union(child.getMinimumSize());
-	}
-	d.expand(figure.getInsets().getWidth(),
-	         figure.getInsets().getHeight());
-	return d;
-}
-
-public Dimension getPreferredSize(IFigure figure, int wHint, int hHint){
-	return calculatePreferredSize(figure, wHint, hHint);
-}
-
-
-/*
- * Lays out the children on top of each other with
- * their sizes equal to that of the available
- * paintable area of the input container figure.
- */
-public void layout(IFigure figure){
-	Rectangle r = figure.getClientArea();
-	List children = figure.getChildren();
-  
-  Dimension preferredClientAreaSize = calculatePreferredClientAreaSize(figure);
-  int x = r.x + (r.width - preferredClientAreaSize.width) / 2;
-  int y = r.y + (r.height - preferredClientAreaSize.height) / 2;
-
-	for (Iterator i = children.iterator(); i.hasNext(); )
-  {
-		IFigure child = (IFigure)i.next();
-    Dimension childSize = child.getPreferredSize();
-		child.setBounds(new Rectangle(x, y, childSize.width, childSize.height));
-    y += childSize.height + spacing;
-	}
-}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenteredIconFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenteredIconFigure.java
deleted file mode 100644
index 3426bb0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/CenteredIconFigure.java
+++ /dev/null
@@ -1,39 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-            
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Image;
-              
-
-public class CenteredIconFigure extends ContainerFigure
-{                                                
-  public Image image;  
-                               
-  public CenteredIconFigure()
-  {
-    super();
-    setFill(true);   
-  }
-
-  protected void fillShape(Graphics g)
-  {    
-    super.fillShape(g);    
-    if (image != null)
-    {                         
-      Rectangle r = getBounds();                                                         
-      Dimension imageSize = new Dimension(16, 16);
-      g.drawImage(image, r.x + (r.width - imageSize.width)/2, r.y + (r.height - imageSize.height)/2);
-    }
-  }          
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ConnectionFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ConnectionFigure.java
deleted file mode 100644
index aaa05f1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ConnectionFigure.java
+++ /dev/null
@@ -1,210 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-       
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.wst.xsd.ui.internal.graph.editparts.GraphNodeEditPart;
-
-              
-
-public class ConnectionFigure extends RectangleFigure
-{               
-  protected boolean isOutlined = true;
-  protected IFigure xsdFigure;
-
-  public ConnectionFigure(IFigure xsdFigure)
-  {
-    setOpaque(false);                   
-    this.xsdFigure = xsdFigure;
-    //setFocusTraversable(false); 
-    //setEnabled(false); 
-  }
-           
-  protected boolean isMouseEventTarget()
-  {
-    return false;
-  }        
-
-  public boolean containsPoint(int x, int y){return false;}
-
-  protected void fillShape(Graphics graphics)
-  { 
-    graphics.setForegroundColor(ColorConstants.black);
-    drawLines(graphics, xsdFigure);
-  }
-
-  protected void drawLines(Graphics graphics, IFigure figure)
-  {
-    if (figure instanceof GraphNodeFigure)
-    {
-      GraphNodeFigure graphNodeFigure = (GraphNodeFigure)figure;         
-      if (graphNodeFigure.isConnected() && graphNodeFigure.isExpanded())
-      {
-        List childList = graphNodeFigure.getChildGraphNodeFigures();
-        if (childList.size() > 0)
-        {                                         
-          Rectangle r = graphNodeFigure.getConnectionRectangle();    
-          
-          int x1 = r.x + r.width;
-          int y1 = r.y + r.height/2;
-          
-          int startOfChildBox = ((GraphNodeFigure)childList.get(0)).getConnectionRectangle().x;
-
-          int x2 = x1 + (startOfChildBox - x1) / 3;
-          int y2 = y1;
-                    
-          if (childList.size() > 1)
-          {                                 
-            graphics.drawLine(x1, y1, x2, y2);
-          
-            int minY = Integer.MAX_VALUE;
-            int maxY = -1;
-          
-            for (Iterator i = childList.iterator(); i.hasNext(); )
-            {
-              GraphNodeFigure childGraphNodeFigure = (GraphNodeFigure)i.next();
-              Rectangle childConnectionRectangle = childGraphNodeFigure.getConnectionRectangle();
-              int y = childConnectionRectangle.y + childConnectionRectangle.height / 2;
-             
-              minY = Math.min(minY, y);
-              maxY = Math.max(maxY, y);             
-              graphics.drawLine(x2, y, childConnectionRectangle.x, y);            
-            }                   
-            graphics.drawLine(x2, minY, x2, maxY);
-          }
-          else
-          {
-            graphics.drawLine(x1, y1, startOfChildBox, y2);
-          }
-        }                            
-      }                             
-    }
-
-    //boolean visitChildren = true;
-    List children = figure.getChildren();
-    for (Iterator i = children.iterator(); i.hasNext(); )
-    {
-      IFigure child = (IFigure)i.next();
-      drawLines(graphics, child);
-    }
-  }    
-
-
-  // This method supports the preview connection line function related to drag and drop
-  //     
-  public PointList getConnectionPoints(GraphNodeEditPart parentEditPart, GraphNodeEditPart childRefEditPart, Rectangle draggedFigureBounds)
-  {           
-    PointList pointList = new PointList();                         
-    int[] data = new int[1];
-    Point a = getConnectionPoint(parentEditPart, childRefEditPart, data);
-    if (a != null)
-    {   
-      int draggedFigureBoundsY = draggedFigureBounds.y + draggedFigureBounds.height/2;
-
-      pointList.addPoint(a); 
-      //pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
-      
-      if (data[0] == 0) // insert between 2 items
-      {                                         
-        int x = a.x + (draggedFigureBounds.x - a.x)/2;
-        pointList.addPoint(new Point(x, a.y));
-        pointList.addPoint(new Point(x, draggedFigureBoundsY));        
-        pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
-      }
-      else // insert at first or last position
-      {
-        pointList.addPoint(new Point(a.x, draggedFigureBoundsY));   
-        pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
-      }
-    }       
-    return pointList;
-  }
-
-         
-  // This method supports the preview connection line function related to drag and drop
-  //     
-  protected Point getConnectionPoint(GraphNodeEditPart parentEditPart, GraphNodeEditPart childRefEditPart, int[] data)
-  {                      
-    Point point = null;     
-    List childList = parentEditPart.getChildren();         
-
-    //TreeNodeIconFigure icon = ((TreeNodeFigure)parent.getFigure()).treeNodeIconFigure;
-                                                                                                                                               
-    if (childList.size() > 0)
-    {   
-      point = new Point();
-
-      GraphNodeEditPart prev = null;    
-      GraphNodeEditPart next = null;
-                               
-      for (Iterator i = childList.iterator(); i.hasNext(); )
-      {             
-        Object o = i.next();    
-        if (o instanceof GraphNodeEditPart)
-        {
-          GraphNodeEditPart childEditPart = (GraphNodeEditPart)o;        
-          if (childEditPart == childRefEditPart)
-          {
-            next = childEditPart;
-            break;
-          }                                           
-          prev = childEditPart;
-        }
-      }                            
-
-      if (next != null && prev != null)
-      { 
-        int ya = prev.getConnectionRectangle().getCenter().y;
-        int yb = next.getConnectionRectangle().getCenter().y;
-        point.y = ya + (yb - ya)/2;   
-        data[0] = 0;
-      }                               
-      else if (prev != null) // add it last
-      {
-        point.y = prev.getConnectionRectangle().getCenter().y;
-        data[0] = 1;
-      }
-      else if (next != null) // add it first!
-      {                           
-        point.y = next.getConnectionRectangle().getCenter().y;
-        data[0] = -1;
-      }
-          
-      if (next != null || prev != null)
-      {
-        GraphNodeEditPart child = prev != null ? prev : next;
-        int startOfChildBox = child.getConnectionRectangle().x;
-        Rectangle r = parentEditPart.getConnectionRectangle();  
-        int x1 = r.x + r.width;
-        point.x = x1 + (startOfChildBox - x1) / 3;
-      }
-    }    
-    return point;
-  }
-         
-
-  protected void outlineShape(Graphics graphics)
-  { 
-    if (isOutlined)
-    {
-      super.outlineShape(graphics);
-    }
-  } 
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerFigure.java
deleted file mode 100644
index 8594005..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerFigure.java
+++ /dev/null
@@ -1,71 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-            
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.RectangleFigure;
-              
-public class ContainerFigure extends RectangleFigure
-{               
-  protected boolean isOutlined = false;
-
-  public ContainerFigure()
-  {
-    setLayoutManager(new ContainerLayout());
-    setFill(false);
-  }
-
-  public void doLayout()
-  {
-	  layout();
-	  setValid(true);
-  }  
-          
-  public ContainerLayout getContainerLayout()
-  {
-    return (ContainerLayout)getLayoutManager();
-  }           
-
-  public void setOutlined(boolean isOutlined)
-  {
-    this.isOutlined = isOutlined;
-  }     
-
-  protected void outlineShape(Graphics graphics)
-  { 
-    if (isOutlined)
-    {
-      super.outlineShape(graphics);
-    }
-  }
-  
-  
-  public void validate() 
-  {
-    if (isValid())
-    {
-      return;
-    }
-    super.validate();	
-    postLayout();
-  }
-
-
-  protected void postLayout()
-  {
-    LayoutManager layoutManager = getLayoutManager();
-    if (layoutManager instanceof PostLayoutManager)
-    {
-      ((PostLayoutManager)layoutManager).postLayout(this);    
-    }  
-  }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerLayout.java
deleted file mode 100644
index a30b6b8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ContainerLayout.java
+++ /dev/null
@@ -1,248 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.SpacingFigure;
-
-public class ContainerLayout extends AbstractLayout implements PostLayoutManager
-{                                         
-  protected boolean isHorizontal;
-  protected int spacing = 0;
-  protected int border = 0;
- 
-  public ContainerLayout()
-  { 
-    this(true, 0); 
-  }             
-
-  public ContainerLayout(boolean isHorizontal, int spacing)
-  {
-    this.isHorizontal = isHorizontal;   
-    this.spacing = spacing;
-  }  
-
-  public void setHorizontal(boolean isHorizontal)
-  {
-    this.isHorizontal = isHorizontal;
-  }  
-
-  public void setSpacing(int spacing)
-  {
-    this.spacing = spacing;
-  }  
-
-  public void setBorder(int border)
-  {
-    this.border = border;
-  }   
-
-  /**
-   * Calculates and returns the preferred size of the container 
-   * given as input.
-   * 
-   * @param figure  Figure whose preferred size is required.
-   * @return  The preferred size of the passed Figure.
-   */
-  protected Dimension calculatePreferredSize(IFigure parent, int w, int h)
-  { 
-    Dimension preferred = null;                                              
-                                  
-    // Here we ensure that an unexpanded container is given a size of (0,0)
-    //
-    if (parent instanceof GraphNodeContainerFigure)
-    {
-      GraphNodeContainerFigure graphNodeContainerFigure = (GraphNodeContainerFigure)parent;
-      if (!graphNodeContainerFigure.isExpanded())
-      {
-        preferred = new Dimension(); 
-      }
-    }   
-    
-    if (preferred == null)
-    {
-      preferred = new Dimension();
-      List children = parent.getChildren();
-                                            
-      for (int i=0; i < children.size(); i++)
-      {
-        IFigure child = (IFigure)children.get(i);      
-    
-        Dimension childSize = child.getPreferredSize();
-        /*
-        if (child instanceof Interactor)
-        {          
-          childSize.width = 9;
-          childSize.height = 9;
-        }*/  
-    
-        if (isHorizontal)
-        {
-          preferred.width += childSize.width;
-          preferred.height = Math.max(preferred.height, childSize.height);
-        }
-        else
-        {  
-          preferred.height += childSize.height;
-          preferred.width = Math.max(preferred.width, childSize.width);
-        }
-      }                                                 
-
-      int childrenSize = children.size();
-      if (childrenSize > 1)
-      {                      
-        if (isHorizontal)    
-        {
-          preferred.width += spacing * (childrenSize - 1);
-        }
-        else
-        {
-          preferred.height += spacing * (childrenSize - 1);
-        } 
-      }
-                            
-      preferred.width += border * 2;
-      preferred.height += border * 2;
-      preferred.width += parent.getInsets().getWidth();
-      preferred.height += parent.getInsets().getHeight();      
-    }
-    return preferred;
-  }
-
-                
-  protected int alignFigure(IFigure parent, IFigure child)
-  {         
-    int y = -1;                                                            
-    return y;
-  }
-
-  public void layout(IFigure parent)
-  {                        
-    List children = parent.getChildren();
-    Dimension preferred = new Dimension();
-
-    int rx = 0;
-    for (int i=0; i < children.size(); i++)
-    {
-      IFigure child = (IFigure)children.get(i);
-      Dimension childSize = child.getPreferredSize();
-      if (isHorizontal)
-      {   
-        preferred.height = Math.max(preferred.height, childSize.height);
-        rx += childSize.width;
-      }
-      else
-      {
-        preferred.width = Math.max(preferred.width, childSize.width);
-      }
-    }
-
-    if (isHorizontal)
-    {
-      preferred.height += border*2;
-      preferred.width += border;
-    }
-    else
-    {
-      preferred.width += border*2;
-      preferred.height += border;
-    }
-
-    int childrenSize = children.size(); 
-    for (int i=0; i < childrenSize; i++)
-    {
-      IFigure child = (IFigure)children.get(i);
-      Dimension childSize = child.getPreferredSize();
-      
-      if (isHorizontal)
-      {   
-        int y = alignFigure(parent, child);             
-
-      
-        if (y == -1)
-        {
-           y = (preferred.height - childSize.height) / 2;                                      
-        }      
-
-        Rectangle rectangle = new Rectangle(preferred.width, y, childSize.width, childSize.height);   
-        rectangle.translate(parent.getClientArea().getLocation());
-
-        child.setBounds(rectangle);         
-        preferred.width += childSize.width; 
-        preferred.width += spacing;   
-        
-        if (child instanceof SpacingFigure)
-        {          
-          int availableHorizontalSpace = parent.getClientArea().width - rx;
-          preferred.width += availableHorizontalSpace;
-        } 
-      }
-      else
-      {
-        Rectangle rectangle = new Rectangle(0, preferred.height, childSize.width, childSize.height);
-        rectangle.translate(parent.getClientArea().getLocation());
-        child.setBounds(rectangle);  
-        preferred.height += childSize.height;
-        preferred.height += spacing;
-      }
-    }     
-  }      
-  
-  public void postLayout(IFigure figure)
-  {       
-    // This method attempts to align a 'FloatableFigure' (e.g. an Element node) 
-    // with any content that it is connected to.  This way a chain of connected figures
-    // will be vertically aligned (e.g. element -> modelgroup -> element).  Any visible clipping of the
-    // figures in the graph is probably a result of a bug in this code that results in a 'FloatableFigure' being
-    // repositioned beyond the bounds of its parent.
-    //     
-    for (Iterator i = figure.getChildren().iterator(); i.hasNext();)
-    {
-      IFigure child = (IFigure)i.next();
-      if (child instanceof FloatableFigure)       
-      {        
-        FloatableFigure floatableFigure = (FloatableFigure)child;
-        GraphNodeFigure graphNodeFigure = floatableFigure.getGraphNodeFigure(); 
-        if (graphNodeFigure.isExpanded() && graphNodeFigure.getChildGraphNodeFigures().size() == 1)
-        {
-          GraphNodeFigure alignedChild = (GraphNodeFigure)graphNodeFigure.getChildGraphNodeFigures().get(0);      
-          Rectangle alignedChildBounds = alignedChild.getConnectionRectangle();                            
-          Rectangle childBounds = child.getBounds();
-        
-          int l = childBounds.y + childBounds.height/2;
-          int r = alignedChildBounds.y + alignedChildBounds.height/2;       
-          int delta = r - l;
-
-          fixUp(child, delta);
-        }          
-      }
-    }      
-  }      
-  
-  protected void fixUp(IFigure figure, int delta)
-  { 
-    Rectangle bounds = figure.getBounds();
-    bounds.y += delta;
-    figure.setBounds(bounds);
-      
-    for (Iterator i = figure.getChildren().iterator(); i.hasNext(); )
-    {
-      IFigure child = (IFigure)i.next();
-      fixUp(child, delta);
-    }                       
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ExpandableGraphNodeFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ExpandableGraphNodeFigure.java
deleted file mode 100644
index e339103..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/ExpandableGraphNodeFigure.java
+++ /dev/null
@@ -1,133 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-            
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-              
-
-//  ------------------------------------------------------------
-//  | ExpandableGraphNodeFigure                                |
-//  |                                                          |
-//  |   ----------------------------------   ---------------   |
-//  |   | verticalGroup                  |   |             |   |
-//  |   |                                |   |             |   |
-//  |   | -----------------------------  |   |             |   |
-//  |   | | horizontalGroup           |  |   |             |   |
-//  |   | |                           |  |   |             |   |
-//  |   | | ---------------------     |  |   |             |   |
-//  |   | | | outlinedArea      |     |  |   |             |   |
-//  |   | | | ----------------- |     |  |   |  outer      |   |
-//  |   | | | | iconArea      | |     |  |   |  Content    |   |
-//  |   | | | ----------------- | [+] |  |   |  Area       |   |
-//  |   | | | ----------------- |     |  |   |             |   |
-//  |   | | | | innerContent  | |     |  |   |             |   |
-//  |   | | | ----------------- |     |  |   |             |   |
-//  |   | | ---------------------     |  |   |             |   |
-//  |   | -----------------------------  |   |             |   |
-//  |   |                                |   |             |   |
-//  |   |   ------------------           |   |             |   |
-//  |   |   | occurenceArea  |           |   |             |   |
-//  |   |   ------------------           |   |             |   |
-//  |   ----------------------------------   ---------------   |
-//  ------------------------------------------------------------
-
-public class ExpandableGraphNodeFigure extends RepeatableGraphNodeFigure
-{                        
-  protected ContainerFigure horizontalGroup;
-  protected Interactor interactor; 
-  protected ContainerFigure outerContentArea;
-
-  public boolean isExpanded()
-  {
-    return interactor.isExpanded();
-  }   
-
-  public void setExpanded(boolean isExpanded)
-  {
-    interactor.setExpanded(isExpanded);
-  }
-  
-  public ExpandableGraphNodeFigure()
-  {
-    super();    
-    isConnected = true;
-  }      
-
-  protected void createFigure()
-  {   
-    createPreceedingSpace(this);           
-    createVerticalGroup(this);
-    createHorizontalGroup(verticalGroup);
-    createOutlinedArea(horizontalGroup);   
-    createInteractor(horizontalGroup);
-    createOccurenceArea(verticalGroup);   
-    createOuterContentArea(this);
-  }
-  
-  protected void createVerticalGroup(IFigure parent)
-  {
-    verticalGroup = new FloatableFigure(this);
-    verticalGroup.getContainerLayout().setHorizontal(false);
-    parent.add(verticalGroup);
-  }
-
-  protected void createHorizontalGroup(IFigure parent)
-  {
-    horizontalGroup = new ContainerFigure();
-    parent.add(horizontalGroup);
-  }                 
-
-  protected void createInteractor(IFigure parent)
-  {
-    interactor = new Interactor();
-    interactor.setForegroundColor(ColorConstants.black);
-    interactor.setBackgroundColor(ColorConstants.white); 
-    parent.add(interactor);
-  } 
-
-  protected void createOuterContentArea(IFigure parent)
-  {
-    // create a small space between the interactor and the contentArea
-    //
-    RectangleFigure space = new RectangleFigure();
-    space.setVisible(false);
-    space.setPreferredSize(new Dimension(5, 10));
-    parent.add(space);   
-      
-    outerContentArea = new GraphNodeContainerFigure(this);
-    outerContentArea.getContainerLayout().setHorizontal(false);
-    parent.add(outerContentArea);
-  }
-
-  public Interactor getInteractor()
-  {
-    return interactor;
-  } 
-
-  public ContainerFigure getOuterContentArea()
-  {
-    return outerContentArea;
-  }
-     
-  public IFigure getConnectionFigure()
-  {
-    return horizontalGroup;
-  }
-
-  public Rectangle getConnectionRectangle()
-  {
-    return horizontalGroup.getBounds();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FillLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FillLayout.java
deleted file mode 100644
index 221c147..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FillLayout.java
+++ /dev/null
@@ -1,160 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-
-/**
- * Figures using the StackLayout as their layout manager have
- * their children placed on top of one another. Order of 
- * placement is determined by the order in which the children
- * were added, first child added placed on the bottom.
- */
-public class FillLayout extends AbstractLayout
-{
-         
-protected boolean isHorizontal = false;                    
-protected int spacing = 0;
-public Dimension min;  
-
-public FillLayout(){}     
-public FillLayout(boolean dummy){} 
-
-public FillLayout(int spacing)
-{ 
-  this.spacing = spacing; 
-}
-
-public void setHorizontal(boolean isHorizontal)
-{
- this.isHorizontal = isHorizontal;
-}
-
-/**
- * Calculates and returns the preferred size of the input container.
- * This is the size of the largest child of the container, as all
- * other children fit into this size.
- *
- * @param figure  Container figure for which preferred size is required.
- * @return  The preferred size of the input figure.
- */
-protected Dimension calculatePreferredSize(IFigure figure, int w, int h)
-{	                 
-  Dimension d = calculatePreferredClientAreaSize(figure);
-	d.expand(figure.getInsets().getWidth(),
-	         figure.getInsets().getHeight());
-	//d.union(getBorderPreferredSize(figure));
-	return d;
-} 
-
-protected Dimension calculatePreferredClientAreaSize(IFigure figure)
-{
-  Dimension d = new Dimension();
-	List children = figure.getChildren(); 
-
-
-	for (Iterator i = children.iterator(); i.hasNext(); )
-  {
-		IFigure child = (IFigure)i.next();
-    Dimension childSize = child.getPreferredSize();
-
-    if (isHorizontal)
-    {
-      d.width += childSize.width;
-      d.height = Math.max(childSize.height, d.height);
-    }
-    else
-    {
-      d.height += childSize.height;
-      d.width = Math.max(childSize.width, d.width);
-    }
-	}	 
-
-                   
-  int childrenSize = children.size();       
-  if (childrenSize > 0)
-  {
-    if (isHorizontal)
-      d.width += spacing * (childrenSize - 1); 
-    else
-      d.height += spacing * (childrenSize - 1);
-  }       
-    
-  if (min != null)
-  {
-    d.width = Math.max(d.width, min.width);
-    d.height = Math.max(d.height, min.height);
-  }
-  return d;
-}
-
-/*
- * Returns the minimum size required by the input container.
- * This is the size of the largest child of the container, as all
- * other children fit into this size.
- */
-public Dimension getMinimumSize(IFigure figure, int w, int h)
-{
-	Dimension d = new Dimension();
-	List children = figure.getChildren();
-	IFigure child;
-	for (int i=0; i < children.size(); i++){
-		child = (IFigure)children.get(i);
-		d.union(child.getMinimumSize());
-	}
-	d.expand(figure.getInsets().getWidth(),
-	         figure.getInsets().getHeight());
-	return d;
-}
-
-public Dimension getPreferredSize(IFigure figure, int w, int h)
-{
-	return calculatePreferredSize(figure, w, h);
-}
-
-/*
- * Lays out the children on top of each other with
- * their sizes equal to that of the available
- * paintable area of the input container figure.
- */
-public void layout(IFigure figure){   
-                     
-  Dimension	preferredSize = calculatePreferredClientAreaSize(figure);
-	Rectangle r = figure.getClientArea().getCopy(); 
-
-	List children = figure.getChildren();
-                                        
-	for (Iterator i = children.iterator(); i.hasNext(); )
-  {
-		IFigure child = (IFigure)i.next();
-    Dimension childSize = child.getPreferredSize();
-
-    if (isHorizontal)
-    {
-		  child.setBounds(new Rectangle(r.x, r.y, childSize.width, Math.max(preferredSize.height, r.height)));
-      r.x += childSize.width + spacing;
-    }
-    else
-    {            
-		  child.setBounds(new Rectangle(r.x, r.y, Math.max(preferredSize.width, r.width), childSize.height));
-      r.y += childSize.height + spacing;
-    }
-	}
-}
-} 
- 
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FloatableFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FloatableFigure.java
deleted file mode 100644
index c224145..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/FloatableFigure.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-            
-              
-
-public class FloatableFigure extends ContainerFigure
-{               
-  public GraphNodeFigure graphNodeFigure;  
-
-  public FloatableFigure(GraphNodeFigure graphNodeFigure)
-  {                  
-    super();
-    this.graphNodeFigure = graphNodeFigure;
-  }   
-
-  public GraphNodeFigure getGraphNodeFigure()
-  {
-    return graphNodeFigure;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeContainerFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeContainerFigure.java
deleted file mode 100644
index c06a655..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeContainerFigure.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-            
-              
-
-public class GraphNodeContainerFigure extends ContainerFigure
-{               
-  public ExpandableGraphNodeFigure expandableGraphNodeFigure;  
-
-  public GraphNodeContainerFigure(ExpandableGraphNodeFigure expandableGraphNodeFigure)
-  {                  
-    super();
-    this.expandableGraphNodeFigure = expandableGraphNodeFigure;
-  }     
-
-  public boolean isExpanded()
-  {
-    return expandableGraphNodeFigure.isExpanded();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeFigure.java
deleted file mode 100644
index 3d9706d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/GraphNodeFigure.java
+++ /dev/null
@@ -1,184 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-            
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-              
-
-//  ------------------------------
-//  | GraphNodeFigure            |
-//  |                            |
-//  | -------------------------  |
-//  | | vertical group        |  |
-//  | | --------------------- |  |
-//  | | | outlined area     | |  |
-//  | | | ----------------- | |  |
-//  | | | | icon area     | | |  |
-//  | | | ----------------- | |  |
-//  | | | ----------------- | |  |
-//  | | | | inner content | | |  |
-//  | | | ----------------- | |  |
-//  | | --------------------- |  |
-//  | -------------------------  |
-//  ------------------------------
-
-public class GraphNodeFigure extends ContainerFigure
-{                        
-  protected ContainerFigure verticalGroup; 
-  protected ContainerFigure outlinedArea;
-  protected ContainerFigure iconArea;
-  protected ContainerFigure innerContentArea; 
-         
-  protected boolean isConnected;
-  protected boolean isIsolated;
-
-  protected List childGraphNodeFigures = new ArrayList();
-  protected GraphNodeFigure parentGraphNodeFigure; 
-
-  public GraphNodeFigure()
-  { 
-    isIsolated = false;
-    createFigure();
-  }      
-
-  public boolean isExpanded()
-  {
-    return true;
-  }    
-
-  public boolean isConnected()
-  {
-    return isConnected;
-  }                    
-
-  public void setConnected(boolean isConnected)
-  {
-    this.isConnected = isConnected;
-  }
-
-  public void setIsIsolated(boolean isIsolated)
-  {
-    this.isIsolated = isIsolated; 
-  }
-
-  public boolean getIsIsolated()
-  {
-    return isIsolated; 
-  }
-
-  protected void createFigure()
-  {
-    createVerticalGroup(this);
-    createOutlinedArea(verticalGroup); 
-  }
-
-  protected void createVerticalGroup(IFigure parent)
-  {
-    verticalGroup = new ContainerFigure();
-    verticalGroup.getContainerLayout().setHorizontal(false);
-    parent.add(verticalGroup);
-  }
-
-  protected void createOutlinedArea(IFigure parent)
-  { 
-    outlinedArea = new ContainerFigure();
-    outlinedArea.getContainerLayout().setHorizontal(false);
-    parent.add(outlinedArea);      
-     
-    iconArea = new ContainerFigure();
-    outlinedArea.add(iconArea);
-
-    innerContentArea = new ContainerFigure();
-    innerContentArea.getContainerLayout().setHorizontal(false);
-    outlinedArea.add(innerContentArea);  
-  }   
-
-  public ContainerFigure getIconArea()
-  {
-    return iconArea;
-  }
-
-  public ContainerFigure getOutlinedArea()
-  {
-    return outlinedArea;
-  }
-
-  public ContainerFigure getInnerContentArea()
-  {
-    return innerContentArea;
-  } 
-
-  public IFigure getConnectionFigure()
-  {
-    return outlinedArea;
-  }
-
-  public Rectangle getConnectionRectangle()
-  {
-    return outlinedArea.getBounds();
-  }
-
-  public List getChildGraphNodeFigures()
-  {
-    return childGraphNodeFigures;
-  }
-
-  public void addNotify()                     
-  {
-    super.addNotify();                 
-    if (isConnected())
-    {
-      parentGraphNodeFigure = computeParentGraphNodeFigure(this);
-      if (parentGraphNodeFigure != null)
-      {   
-        parentGraphNodeFigure.getChildGraphNodeFigures().add(this);
-      }   
-    }
-  } 
-
-  public void removeNotify()
-  {     
-    super.removeNotify();
-    if (parentGraphNodeFigure != null)
-    {   
-      parentGraphNodeFigure.getChildGraphNodeFigures().remove(this);
-    }  
-  }
-
-  public GraphNodeFigure getParentGraphNodeFigure()
-  {
-    return parentGraphNodeFigure;
-  }  
-
-  public GraphNodeFigure computeParentGraphNodeFigure(IFigure figure)
-  {                   
-    GraphNodeFigure result = null;
-    IFigure parent = figure != null ? figure.getParent() : null;
-    while (parent != null)
-    {
-      if (parent instanceof GraphNodeFigure)
-      {    
-        GraphNodeFigure parentGraphNodeFigure = (GraphNodeFigure)parent;
-        if (parentGraphNodeFigure.isConnected())
-        {
-          result = (GraphNodeFigure)parent;
-          break;
-        }
-      }
-      parent = parent.getParent();
-    }   
-    return result;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/Interactor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/Interactor.java
deleted file mode 100644
index 7a64b8f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/Interactor.java
+++ /dev/null
@@ -1,54 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-            
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * Interactor the +/- control commonly found in trees
- */
-public class Interactor extends RectangleFigure
-{
-  protected boolean isExpanded;
-
-  public Interactor()
-  {
-    super(); 
-    setPreferredSize(new Dimension(9, 9));               
-  }  
-
-  public void setExpanded(boolean isExpanded)
-  {                                         
-    this.isExpanded = isExpanded;
-  }
-
-  public boolean isExpanded()
-  {
-    return isExpanded;
-  }
-    
-  protected void fillShape(Graphics g)
-  {
-    super.fillShape(g);
-    Rectangle r = getBounds();                          
-    int mx = r.x + r.width / 2;
-    int my = r.y + r.height / 2;    
-    int s = 2;       
-    g.drawLine(r.x + s, my, r.x + r.width - s - 1, my); 
-    if (!isExpanded)
-    {
-      g.drawLine(mx, r.y + s, mx, r.y + r.height - s -1);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/LabelFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/LabelFigure.java
deleted file mode 100644
index 04c82b8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/LabelFigure.java
+++ /dev/null
@@ -1,88 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-            
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-              
-
-public class LabelFigure extends Figure
-{                                                
-  protected String text = "";  
-  protected boolean isShowEmptyLabel = true;
-  protected int left = 4; 
-  protected int right = 4; 
-  protected int textHeight;
-  protected int textWidth;
-                       
-  public LabelFigure()
-  {
-    setPreferredSize(new Dimension());
-  }  
-
-  protected void setLeft(int left)
-  {
-    this.left = left;
-  }
-
-  protected void setRight(int right)
-  {
-    this.right = right;
-  }
-
-  public void setShowEmptyLabel(boolean isShowEmptyLabel)
-  {
-    this.isShowEmptyLabel = isShowEmptyLabel;
-  }     
-       
-
-  public void setText(String s)
-  { 
-	  if (s == null)
-		  s = "";
-
-    if (!text.equals(s))
-    {
-	    text = s;
-      if (text.length() > 0 || isShowEmptyLabel)
-      {
-        textHeight = FigureUtilities.getFontMetrics(getFont()).getHeight();
-        textWidth = FigureUtilities.getTextWidth(text, getFont());
-        textWidth = Math.max(textWidth, FigureUtilities.getTextWidth("abcdefg", getFont()));
-        setPreferredSize(new Dimension(textWidth + left + right, textHeight));
-      } 
-      else
-      {
-        setPreferredSize(new Dimension());
-      } 
-    }   
-    //revalidate(); 
-    //repaint();
-  }
-
-
-  
-  protected void paintFigure(Graphics graphics)
-  //protected void fillShape(Graphics graphics)
-  {  
-    super.paintFigure(graphics);
-    //super.fillShape(graphics);
-    if (text.length() > 0)
-    {
-      Rectangle r = getBounds();
-		  graphics.setForegroundColor(getForegroundColor());
-      graphics.drawString(text, left + r.x, r.y);// + (r.width - textWidth)/2, r.y + (r.height - textHeight)/2);           
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/PostLayoutManager.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/PostLayoutManager.java
deleted file mode 100644
index 21a1f54..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/PostLayoutManager.java
+++ /dev/null
@@ -1,19 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-
-import org.eclipse.draw2d.IFigure;
-
-
-public interface PostLayoutManager
-{
-  public void postLayout(IFigure figure);                    
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RepeatableGraphNodeFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RepeatableGraphNodeFigure.java
deleted file mode 100644
index fd8d249..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RepeatableGraphNodeFigure.java
+++ /dev/null
@@ -1,85 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.wst.xsd.ui.internal.graph.GraphicsConstants;
-
-
-              
-
-//  ------------------------------
-//  | RepeatableGraphNodeFigure  |
-//  |                            |
-//  | -------------------------  |
-//  | | vertical group        |  |
-//  | | --------------------- |  |
-//  | | | outlined area     | |  |
-//  | | | ----------------- | |  |
-//  | | | | icon area     | | |  |
-//  | | | ----------------- | |  |
-//  | | | ----------------- | |  |
-//  | | | | inner content | | |  |
-//  | | | ----------------- | |  |
-//  | | --------------------- |  |
-//  | |                       |  |
-//  | | ------------------    |  |
-//  | | | occurence area |    |  |
-//  | | ------------------    |  |
-//  | -------------------------  |
-//  ------------------------------
-
-public class RepeatableGraphNodeFigure extends GraphNodeFigure
-{                            
-  protected ContainerFigure occurenceArea;  
-  protected LabelFigure occurenceLabel; 
-
-  public RepeatableGraphNodeFigure()
-  {    
-    super();          
-  }     
-
-  protected void createFigure()
-  {                  
-    createPreceedingSpace(this);
-    createVerticalGroup(this);
-    createOutlinedArea(verticalGroup); 
-    createOccurenceArea(verticalGroup);
-  }
-
-  protected void createOccurenceArea(IFigure parent)
-  {
-    occurenceArea = new ContainerFigure();   
-    occurenceLabel = new LabelFigure();
-    occurenceLabel.setForegroundColor(ColorConstants.black);
-    occurenceLabel.setShowEmptyLabel(false);
-    occurenceLabel.setFont(GraphicsConstants.medium); 
-    occurenceArea.add(occurenceLabel);               
-    parent.add(occurenceArea);
-  }
-                                 
-  protected void createPreceedingSpace(IFigure parent)
-  {
-    // create a small space
-    RectangleFigure space = new RectangleFigure();
-    space.setVisible(false);
-    space.setPreferredSize(new Dimension(10, 10));
-    parent.add(space);  
-  } 
-
-  public LabelFigure getOccurenceLabel()
-  {
-    return occurenceLabel;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RoundedLineBorder.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RoundedLineBorder.java
deleted file mode 100644
index 75dbff7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/figures/RoundedLineBorder.java
+++ /dev/null
@@ -1,67 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.figures;
-            
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.swt.graphics.Color;
-              
-
-public class RoundedLineBorder extends LineBorder
-{               
-  protected int arcLength;   
-  protected int lineStyle = Graphics.LINE_SOLID;
-
-  public RoundedLineBorder(Color c, int width, int arcLength)
-  {
-	  super(c, width);     
-    this.arcLength = arcLength;
-  }
-
-  public RoundedLineBorder(int width, int arcLength)
-  {
-	  super(width);     
-    this.arcLength = arcLength;
-  }
-  
-  public RoundedLineBorder(Color c, int width, int arcLength, int lineStyle)
-  {
-    super(c, width);
-    this.arcLength = arcLength;
-    this.lineStyle = lineStyle;
-  }
-
-  public RoundedLineBorder(int width, int arcLength, int lineStyle)
-  {
-    super(width);
-    this.arcLength = arcLength;
-    this.lineStyle = lineStyle;
-  }
-
-  public void paint(IFigure figure, Graphics graphics, Insets insets)
-  {
-      int rlbWidth = getWidth();
-	  tempRect.setBounds(getPaintRectangle(figure, insets));
-  	if (rlbWidth%2 == 1)
-    {
-		  tempRect.width--;
-		  tempRect.height--;
-	  }
-	  tempRect.shrink(rlbWidth/2,rlbWidth/2);
-	  graphics.setLineWidth(rlbWidth);
-    graphics.setLineStyle(lineStyle);
-	  if (getColor() != null)
-		  graphics.setForegroundColor(getColor());
-	  graphics.drawRoundRectangle(tempRect, arcLength, arcLength);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/Category.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/Category.java
deleted file mode 100644
index 31aa07b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/Category.java
+++ /dev/null
@@ -1,265 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.model;
-                                   
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class Category implements ModelAdapter
-{
-  public final static int ATTRIBUTES = 1;
-  public final static int ELEMENTS = 2;
-  public final static int TYPES = 3;
-  public final static int GROUPS = 5;
-  public final static int DIRECTIVES = 6;
-  public final static int NOTATIONS = 7;
-  public final static int ATTRIBUTE_GROUPS = 8;
-  public final static int IDENTITY_CONSTRAINTS = 9;
-  public final static int ANNOTATIONS = 10;
-
-  
-  protected XSDSchema schema;
-  protected int groupType;
-
-  //public void modelNameChanged();
-  public Category(XSDSchema schema, int groupType)
-  {
-    this.schema = schema;
-    this.groupType = groupType;
-  }       
-
-  public int getGroupType()
-  {
-    return groupType;
-  }   
-
-  public XSDSchema getXSDSchema()
-  {
-    return schema;
-  }
-
-  public String getName()
-  {
-    String name = "";
-    switch (groupType)
-    {
-      case ATTRIBUTES       : { name = XSDEditorPlugin.getXSDString("_UI_GRAPH_ATTRIBUTES"); break; }
-      case NOTATIONS        : { name = XSDEditorPlugin.getXSDString("_UI_GRAPH_NOTATIONS"); break; }
-      case ELEMENTS         : { name = XSDEditorPlugin.getXSDString("_UI_GRAPH_ELEMENTS"); break; }
-      case TYPES             : { name = XSDEditorPlugin.getXSDString("_UI_GRAPH_TYPES"); break; }    
-      case GROUPS           : { name = XSDEditorPlugin.getXSDString("_UI_GRAPH_GROUPS"); break; }      
-      case DIRECTIVES       : { name = XSDEditorPlugin.getXSDString("_UI_GRAPH_DIRECTIVES"); break; }
-    }      
-    return name;
-  }
-              
-  public List getChildren()
-  {                      
-    List list = Collections.EMPTY_LIST;
-    switch (groupType)
-    {
-      case ATTRIBUTES       : { list = getAttributeList(); break; }
-      case NOTATIONS        : { list = getNotations(); break; }
-      case ELEMENTS         : { list = getGlobalElements(); break; }
-      case TYPES            : { list = getTypes();  break; }
-      case GROUPS           : { list = getGroups(); break; }
-      case DIRECTIVES       : { list = getDirectives(); break; }
-    }      
-    return list;
-  }
-  
-  private boolean isSameNamespace(String ns1, String ns2)
-  {
-    if (ns1 == null) ns1 = "";
-    if (ns2 == null) ns2 = "";
-    
-    if (ns1.equals(ns2))
-    {
-      return true;
-    }
-    return false;
-  }
-  
-  protected List getGlobalElements()
-  {
-    List elements = schema.getElementDeclarations();
-    List list = new ArrayList();
-    for (Iterator i = elements.iterator(); i.hasNext(); )
-    {
-      XSDElementDeclaration elem = (XSDElementDeclaration)i.next();
-      if (isSameNamespace(elem.getTargetNamespace(),schema.getTargetNamespace()))
-      {
-        list.add(elem);
-      }
-    }                
-    return list;
-  }
-
-  protected List getTypes()
-  {
-    List allTypes = schema.getTypeDefinitions();
-    List list = new ArrayList();
-    for (Iterator i = allTypes.iterator(); i.hasNext(); )
-    {
-      XSDTypeDefinition td = (XSDTypeDefinition)i.next();
-      if (td instanceof XSDComplexTypeDefinition)
-      {
-        XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)td;
-        if (isSameNamespace(ct.getTargetNamespace(),schema.getTargetNamespace()))
-        {
-          list.add(ct);
-        }
-      }
-    }                
-
-//    List simpleTypes = schema.getTypeDefinitions();
-    for (Iterator i = allTypes.iterator(); i.hasNext(); )
-    {
-      XSDTypeDefinition td = (XSDTypeDefinition)i.next();
-      if (td instanceof XSDSimpleTypeDefinition)
-      {
-        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)td;
-        if (isSameNamespace(st.getTargetNamespace(),schema.getTargetNamespace()))
-        {
-          list.add(st);
-        }
-      }
-    }                
-    return list;
-  }
-  
-  protected List getGroups()
-  {
-    List groups = schema.getModelGroupDefinitions();
-    List list = new ArrayList();
-    for (Iterator i = groups.iterator(); i.hasNext(); )
-    {
-      XSDModelGroupDefinition group = (XSDModelGroupDefinition)i.next();
-      if (isSameNamespace(group.getTargetNamespace(),schema.getTargetNamespace()))
-      {
-        list.add(group);
-      }
-    }                
-    return list;
-  }
-  
-  protected List getDirectives()
-  {                 
-    List list = new ArrayList();
-    for (Iterator i = schema.getContents().iterator(); i.hasNext(); )
-    {
-      Object o = i.next();
-      if (o instanceof XSDSchemaDirective)
-      {
-        list.add(o);
-      }
-    } 
-    return list;
-  }
-
-  protected List getAttributeList()
-  {
-    List attributesList = new ArrayList();
-    for (Iterator iter = schema.getAttributeDeclarations().iterator(); iter.hasNext(); )
-    {
-      Object o = iter.next();
-      if (o instanceof XSDAttributeDeclaration)
-      {
-        XSDAttributeDeclaration attr = (XSDAttributeDeclaration)o;
-        if (attr != null)
-        {
-          if (attr.getTargetNamespace() != null)
-          {
-            if (!(attr.getTargetNamespace().equals("http://www.w3.org/2001/XMLSchema-instance")))
-            {
-              if (isSameNamespace(attr.getTargetNamespace(), schema.getTargetNamespace()))
-              {
-                attributesList.add(attr);
-              }
-            }
-          }
-          else
-          {
-            if (isSameNamespace(attr.getTargetNamespace(),schema.getTargetNamespace()))
-            {
-              attributesList.add(attr);
-            }
-          }
-        }
-      }
-    }
-    return attributesList;
-  }
-
-  protected List getNotations()
-  {
-    List notations = schema.getNotationDeclarations();
-    List list = new ArrayList();
-    for (Iterator i = notations.iterator(); i.hasNext(); )
-    {
-      XSDNotationDeclaration notation = (XSDNotationDeclaration)i.next();
-      if (isSameNamespace(notation.getTargetNamespace(),schema.getTargetNamespace()))
-      {
-        list.add(notation);
-      }
-    }                
-    return list;
-  }
-  
-  //
-  protected List listenerList = new ArrayList();
-                                                                                           
-  public void addListener(ModelAdapterListener l)
-  {
-    listenerList.add(l);
-  }  
-
-  public void removeListener(ModelAdapterListener l)
-  {
-    listenerList.remove(l);
-  } 
-
-  public Object getProperty(Object modelObject, String propertyName)
-  {
-    return null;
-  }
-
-  public void firePropertyChanged(Object modelObject, String propertyName)
-  {
-    List newList = new ArrayList();
-    newList.addAll(listenerList);
-    for (Iterator i = newList.iterator(); i.hasNext(); )
-    {
-      ModelAdapterListener l = (ModelAdapterListener)i.next();                  
-      try
-      {
-        l.propertyChanged(modelObject, propertyName);
-      }
-      catch (Exception e)
-      {
-      }
-    }
-  }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapter.java
deleted file mode 100644
index 3066987..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapter.java
+++ /dev/null
@@ -1,27 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.model;
-
-
-
-public interface ModelAdapter
-{               
-  public static final String CHILDREN_PROPERTY = "CHILDREN_PROPERTY";
-  public static final String LABEL_PROPERTY = "LABEL_PROPERTY";
-  public static final String IMAGE_PROPERTY = "IMAGE_PROPERTY";
-  public static final String DETAIL_PROPERTY = "DETAIL_PROPERTY";
-                                       
-  public void addListener(ModelAdapterListener l);
-  public void removeListener(ModelAdapterListener l);
-  public Object getProperty(Object modelObject, String propertyName); 
-  public void firePropertyChanged(Object modelObject, String propertyName);
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapterListener.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapterListener.java
deleted file mode 100644
index ff6e4db..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/ModelAdapterListener.java
+++ /dev/null
@@ -1,18 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.model;
-
-
-
-public interface ModelAdapterListener
-{                             
-  public void propertyChanged(Object object, String property);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/XSDModelAdapterFactory.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/XSDModelAdapterFactory.java
deleted file mode 100644
index 98f051a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/model/XSDModelAdapterFactory.java
+++ /dev/null
@@ -1,559 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.graph.model;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDAbstractAdapter;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDModelAdapterFactoryImpl;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDSwitch;
-
-
-
-
-public class XSDModelAdapterFactory
-{  
-  protected static XSDModelAdapterFactory instance;
-  protected static XSDAdapterFactoryImpl xsdAdapterFactoryImpl = new XSDAdapterFactoryImpl();
-                                              
-  public static XSDModelAdapterFactory getInstance()
-  {
-    if (instance == null)
-    {
-      instance = new XSDModelAdapterFactory();
-    }                                         
-    return instance;
-  }
-
-
-  public static ModelAdapter getAdapter(Object o)
-  {                             
-    ModelAdapter result = null;
-    if (o instanceof Notifier)
-    {                                
-      Notifier target = (Notifier)o;
-		  Adapter adapter = xsdAdapterFactoryImpl.adapt(target);
-      if (adapter instanceof XSDObjectAdapter)
-      {
-        result = (XSDObjectAdapter)adapter;
-      }
-    }                              
-    else if (o instanceof ModelAdapter)
-    {
-      result = (ModelAdapter)o;
-    }
-    return result;
-  }             
-    
-
-  public static XSDObjectAdapter getExisitingAdapter(Object xsdObject)
-  {  
-    XSDObjectAdapter result = null;
-    if (xsdObject instanceof Notifier)
-    {                                
-      Notifier target = (Notifier)xsdObject;
-		  Adapter adapter = EcoreUtil.getExistingAdapter(target,xsdAdapterFactoryImpl);
-      if (adapter instanceof XSDObjectAdapter)
-      {
-        result = (XSDObjectAdapter)adapter;
-      }
-    }
-    return result;
-  }
-   
-  //
-  //
-  //
-  public static class XSDAdapterFactoryImpl extends AdapterFactoryImpl
-  {
-    public Adapter createAdapter(Notifier target)
-    {
-      XSDSwitch xsdSwitch = new XSDSwitch()
-      {                   
-        public Object caseXSDElementDeclaration(XSDElementDeclaration object)
-        {
-          return new XSDElementDeclarationAdapter(object);
-        }
-        
-        public Object caseXSDParticle(XSDParticle object)
-        {
-          return new XSDParticleAdapter(object);
-        }
-
-        public Object caseXSDSchema(XSDSchema object) 
-        {
-          return new XSDSchemaAdapter(object);
-        }
-
-        public Object defaultCase(EObject object) 
-        {
-          return new XSDObjectAdapter();
-        }         
-      };
-      Object o = xsdSwitch.doSwitch((EObject)target);
-
-      Adapter result = null;
-      if (o instanceof Adapter)
-      {
-        result  = (Adapter)o;
-      }
-      else
-      {          
-//        System.out.println("did not create adapter for target : " + target);
-//        Thread.dumpStack();
-      }
-      return result;
-    }      
-                               
-
-    public Adapter adapt(Notifier target)
-    {
-      return adapt(target, this);
-    }
-  }
-    
-
- 
-  //
-  //
-  //
-  protected static class XSDObjectAdapter extends AdapterImpl implements ModelAdapter
-  {   
-    protected List listenerList = new ArrayList();
-    protected boolean isUpdating = false;
-                                  
-    public boolean isAdapterForType(Object type)
-    {
-      return type == xsdAdapterFactoryImpl;
-    }                                             
-                
-    public void addListener(ModelAdapterListener l)
-    {
-      listenerList.add(l);
-    }  
-
-    public void removeListener(ModelAdapterListener l)
-    {
-      listenerList.remove(l);
-    } 
-                
-    public Object getProperty(Object modelObject, String propertyName)
-    {
-      Object result = null;
-      if (ModelAdapter.LABEL_PROPERTY.equals(propertyName))
-      {
-      	result = "";
-      	// TODO... move this logic into each adapter
-      	//
-        if (modelObject instanceof XSDNamedComponent)
-        {
-      	  result = ((XSDNamedComponent)modelObject).getName();
-        }
-        else if (modelObject instanceof XSDSchemaDirective)
-        {
-       	  result = ((XSDSchemaDirective)modelObject).getSchemaLocation();
-          if (result == null) result = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED") + ")";
-          if (result.equals("")) result = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED") + ")";
-          return result;
-        }
-      }
-      else if ("drillDown".equals(propertyName))
-      {
-      	// TODO... move this logic into each adapter
-      	//   
-      	List list = XSDChildUtility.getModelChildren(modelObject);	
-      	result = list.size() > 0 ? Boolean.TRUE : Boolean.FALSE;      	   
-      }      
-      else if (ModelAdapter.IMAGE_PROPERTY.equals(propertyName))
-      {
-      	// result = XSDEditorPlugin.getDefault().getImage("icons/XSDElement.gif");
-        XSDModelAdapterFactoryImpl factory = XSDModelAdapterFactoryImpl.getInstance();
-        Adapter adapter = factory.createAdapter((Notifier)modelObject);
-        result = ((XSDAbstractAdapter)adapter).getImage(modelObject);
-      }	
-      return result;
-    }
-
-    public void firePropertyChanged(Object modelObject, String propertyName)
-    {
-      List newList = new ArrayList();
-      newList.addAll(listenerList);
-      for (Iterator i = newList.iterator(); i.hasNext(); )
-      {
-        ModelAdapterListener l = (ModelAdapterListener)i.next();                  
-        try
-        {
-          l.propertyChanged(modelObject, propertyName);
-        }
-        catch (Exception e)
-        {
-        }
-      }
-    }  
-
-    public void notifyChanged(Notification msg)
-    {        
-      firePropertyChanged(msg.getNotifier(), null);
-    }     
-  }
-       
-  protected static class XSDParticleAdapter extends XSDObjectAdapter implements ModelAdapterListener
-  {
-    protected XSDParticle particle;
-
-    public XSDParticleAdapter(XSDParticle particle)
-    {
-      this.particle = particle;
-    } 
-
-    public void notifyChanged(Notification msg)
-    {
-      XSDParticle xsdParticle = (XSDParticle)msg.getNotifier();
-      XSDParticleContent xsdParticleContent = xsdParticle.getContent();
-      XSDModelAdapterFactoryImpl factory = XSDModelAdapterFactoryImpl.getInstance();
-      if (xsdParticleContent != null)
-      {
-        if (xsdParticleContent instanceof XSDElementDeclaration)
-        {
-          firePropertyChanged((XSDElementDeclaration)xsdParticleContent, null);
-          factory.fireNotifyChanged(msg);
-        }
-        else if (xsdParticleContent instanceof XSDModelGroup)
-        {
-          firePropertyChanged((XSDModelGroup)xsdParticleContent, null);
-          factory.fireNotifyChanged(msg);
-        }
-        else if (xsdParticleContent instanceof XSDWildcard)
-        {
-          firePropertyChanged((XSDWildcard)xsdParticleContent, null);
-          factory.fireNotifyChanged(msg);
-        }
-      }
-    } 
-
-
-    public void propertyChanged(Object object, String property)
-    {
-      firePropertyChanged(object, property);
-    }
-  }                         
-     
-  //
-  //
-  //
-  protected static class XSDElementDeclarationAdapter extends XSDObjectAdapter implements ModelAdapterListener
-  {
-    protected XSDElementDeclaration ed;
-    protected XSDTypeDefinition typeDefinition;          
-
-    public XSDElementDeclarationAdapter(XSDElementDeclaration ed)
-    {
-      this.ed = ed;
-      updateTypeDefinition();
-    } 
-    
-    protected void updateTypeDefinition()
-    {
-      XSDTypeDefinition td = ed.getTypeDefinition();
-      td = (td instanceof XSDComplexTypeDefinition) ? td : null;
-      if (td != typeDefinition)
-      {                     
-        if (typeDefinition != null)
-        {
-          XSDObjectAdapter adapter = (XSDObjectAdapter)xsdAdapterFactoryImpl.adapt(typeDefinition);
-          adapter.removeListener(this);
-        }
-        typeDefinition = td;
-        if (typeDefinition != null)
-        {
-          XSDObjectAdapter adapter = (XSDObjectAdapter)xsdAdapterFactoryImpl.adapt(typeDefinition);
-          adapter.addListener(this);
-        }
-      }
-    } 
-
-
-    public void notifyChanged(Notification msg)
-    {
-      updateTypeDefinition();    
-      firePropertyChanged(msg.getNotifier(), null);                                                                          
-    } 
-
-
-    public void propertyChanged(Object object, String property)
-    {                         
-      // here we propagate typeDefinition changes to our listeners
-      firePropertyChanged(object, property);
-    }
-  }                         
-  
-
-  //
-  //
-  protected static class XSDSchemaAdapter extends XSDObjectAdapter
-  { 
-    protected XSDSchema schema;
-    protected List groups;            
-
-    public XSDSchemaAdapter(XSDSchema schema)
-    {
-      this.schema = schema;                         
-      groups = new ArrayList();                                       
-      groups.add(new Category(schema, Category.DIRECTIVES));
-      groups.add(new Category(schema, Category.ATTRIBUTES)); 
-      //groups.add(new Category(schema, Category.ATTRIBUTE_GROUPS));
-      groups.add(new Category(schema, Category.ELEMENTS));
-      groups.add(new Category(schema, Category.TYPES));
-      //groups.add(new Category(schema, Category.SIMPLE_TYPES));
-      groups.add(new Category(schema, Category.GROUPS));
-    }
-
-    public void notifyChanged(Notification msg)
-    {
-      super.notifyChanged(msg);
-      for (Iterator i = groups.iterator(); i.hasNext(); )
-      {
-        ModelAdapter group = (ModelAdapter)i.next();
-        group.firePropertyChanged(group, null);
-      }
-    }
-
-    public Object getProperty(Object modelObject, String propertyName)
-    {
-      Object result = null;
-      if ("groups".equals(propertyName))
-      { 
-        /*
-        List list = new ArrayList();
-        for (Iterator i = groups.iterator(); i.hasNext(); )
-        {
-          Category group = (Category)i.next();
-          if (group.getChildren().size() > 0)
-          {
-            list.add(group);
-          }
-        }
-        result = list;*/
-        result = groups;
-      }      
-      if (result == null)
-      {
-        result = super.getProperty(modelObject, propertyName);
-      }
-      return result;
-    }
-  }
-
-
-  public static void addModelAdapterListener(Object modelObject, ModelAdapterListener listener)
-  {                                                            
-    ModelAdapter modelAdapter = getModelAdapter(modelObject);
-    if (modelAdapter != null)
-    {
-      modelAdapter.addListener(listener);
-    }
-  }    
-
-
-  public static void removeModelAdapterListener(Object modelObject, ModelAdapterListener listener)
-  {                               
-    ModelAdapter modelAdapter = getModelAdapter(modelObject);
-    if (modelAdapter != null)
-    {
-      modelAdapter.removeListener(listener);
-    }
-  }   
-
-  protected static ModelAdapter getModelAdapter(Object modelObject)
-  {
-    ModelAdapter modelAdapter = null;                         
-    if (modelObject instanceof Notifier)
-    {
-      modelAdapter = (ModelAdapter)xsdAdapterFactoryImpl.adapt((Notifier)modelObject);
-    } 
-    else if (modelObject instanceof ModelAdapter)
-    {
-      modelAdapter = (ModelAdapter)modelObject;
-    } 
-    return modelAdapter;
-  }      
-}
-    
-
-
-// --------------------------------------------------------------------------------------------
-// todo... revist this stuff
-// --------------------------------------------------------------------------------------------
-
-  /*                   
-  public static void handleTypeChange(XSDTypeDefinition td, XSDSchema schema, int change)
-  {                                    
-    try
-    {
-      TypeFindingSchemaVisitor visitor = new TypeFindingSchemaVisitor(schema, td, change == Notification.ADD);
-      List list = visitor.findElementsUsingType(schema);          
-      
-      if (change == Notification.REMOVE)          
-      {
-        visitor.removeMatchingReferences();
-      }
-      else if (change == Notification.ADD)          
-      {
-        visitor.setMatchingReferences();
-      }
-      else
-      {
-        visitor.cleanUpTypeMismatches();        
-      }
-      
-      for (Iterator i = list.iterator(); i.hasNext(); )
-      {
-        Object o = i.next();  
-        XSDObjectAdapter adapter = getExisitingAdapter(o);
-        if (adapter != null)
-        { 
-          adapter.fireChildrenChangedNotification();
-        }
-      }          
-    }
-    catch (Exception e)
-    {
-      e.printStackTrace();
-    }
-  }
-          
-
-  protected static class TypeFindingSchemaVisitor extends org.eclipse.wst.xsd.utility.XSDVisitor
-  {                           
-    protected XSDTypeDefinition td;
-    protected List list = new ArrayList();   
-    protected XSDSchema schema;                            
-    protected boolean matchByName;
-
-    public TypeFindingSchemaVisitor(XSDSchema schema, XSDTypeDefinition td, boolean matchByName)
-    {
-      this.td = td;                                 
-      this.schema = schema;
-      this.matchByName = matchByName;
-    }
-
-    public void visitElementDeclaration(XSDElementDeclaration ed)
-    {                                  
-      if (ed.getTypeDefinition() == td)
-      {                
-        list.add(ed);        
-      }  
-      else if (matchByName)
-      {          
-        String[] name = getDOMName(ed);
-        if (name[0].equals(td.getTargetNamespace()) && name[1].equals(td.getName()))
-        {
-          list.add(ed);
-        }
-      }
-    } 
-
-    public List findElementsUsingType(XSDSchema schema)
-    {
-      if (td != null)
-      {
-        visitSchema(schema);
-      }    
-      return list;
-    }   
-
-    public List getMatchingTypeList()
-    {
-      return list;
-    } 
-
-    public String[] getDOMName(XSDElementDeclaration ed)
-    {      
-      String[] result = new String[2];
-      org.w3c.dom.Element domElement = ed.getElement();
-      String typeName = domElement.getAttribute("type");
-      if (typeName != null && !typeName.endsWith(td.getName()))
-      {             
-        int index = typeName.indexOf(":");                                      
-        String prefix = index == -1 ? "" : typeName.substring(0, index);   
-        result[0] = (String)schema.getQNamePrefixToNamespaceMap().get(prefix);
-        if (result[0] == null) result[0] = "";
-        if (result[1] == null) result[1] = "";
-        result[1] = index == -1 ? typeName : typeName.substring(index + 1);
-      }  
-      else
-      {
-        result[0] = "";
-        result[1] = "";
-      }
-      return result;
-    }
-    
-    
-    public void cleanUpTypeMismatches()
-    {
-      for (Iterator i = list.iterator(); i.hasNext(); )
-      {
-        XSDElementDeclaration ed = (XSDElementDeclaration)i.next();
-        XSDTypeDefinition candidateTd = ed.getTypeDefinition();
-        if (candidateTd != null && candidateTd.getName() != null)
-        {
-          String[] result = getDOMName(ed);
-          ed.setTypeDefinition((XSDTypeDefinition)schema.resolveComplexTypeDefinition(result[0], result[1]));         
-        }
-      }
-    }
-    
-    public void removeMatchingReferences()
-    {
-      for (Iterator i = list.iterator(); i.hasNext(); )
-      {
-        XSDElementDeclaration ed = (XSDElementDeclaration)i.next();
-        String[] result = getDOMName(ed);          
-        if (ed.getElement() != null)
-        {
-          // NOTE ... this forces the model to reset the ed's XSDTypeDefinition without causing the
-          // DOM element's 'type' attribute to be set to null
-          ed.elementAttributesChanged(ed.getElement());
-        }
-      }
-    }
-    
-    public void setMatchingReferences()
-    {
-      for (Iterator i = list.iterator(); i.hasNext(); )
-      {
-        XSDElementDeclaration ed = (XSDElementDeclaration)i.next();
-        ed.setTypeDefinition(td);
-      }
-    }    
-  } */   
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GenerateDtd.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GenerateDtd.gif
deleted file mode 100644
index ac58c1e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GenerateDtd.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GenerateJava.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GenerateJava.gif
deleted file mode 100644
index 2375c65..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GenerateJava.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GraphViewElementRef.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GraphViewElementRef.gif
deleted file mode 100644
index d535dac..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/GraphViewElementRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/NewXSD.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/NewXSD.gif
deleted file mode 100644
index 47f6730..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/NewXSD.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/RegexWizardArrow.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/RegexWizardArrow.gif
deleted file mode 100644
index 3d550a3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/RegexWizardArrow.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/ValidateXSD.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/ValidateXSD.gif
deleted file mode 100644
index 2b347ac..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/ValidateXSD.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAll.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAll.gif
deleted file mode 100644
index 6d74e80..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAll.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAnnotate.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAnnotate.gif
deleted file mode 100644
index d2108c0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAnnotate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAny.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAny.gif
deleted file mode 100644
index a39f93c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAny.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAnyAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAnyAttribute.gif
deleted file mode 100644
index 5280cc2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAnyAttribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAppInfo.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAppInfo.gif
deleted file mode 100644
index 2da001e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAppInfo.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttribute.gif
deleted file mode 100644
index 79d49d0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeGroup.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeGroup.gif
deleted file mode 100644
index 648462f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeGroup.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeGroupRef.gif
deleted file mode 100644
index a89fa8f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeRef.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeRef.gif
deleted file mode 100644
index 8365af2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDAttributeRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDChoice.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDChoice.gif
deleted file mode 100644
index 89ba825..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDChoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDComplexContent.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDComplexContent.gif
deleted file mode 100644
index 41c68dd..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDComplexContent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDComplexType.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDComplexType.gif
deleted file mode 100644
index 007f852..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDComplexType.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDDoc.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDDoc.gif
deleted file mode 100644
index d349a05..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDDoc.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDElement.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDElement.gif
deleted file mode 100644
index dd45f08..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDElement.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDElementRef.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDElementRef.gif
deleted file mode 100644
index 749acfc..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDElementRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDExtension.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDExtension.gif
deleted file mode 100644
index 0cfb807..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDExtension.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDField.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDField.gif
deleted file mode 100644
index 378e43e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDField.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDFile.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDFile.gif
deleted file mode 100644
index 3900f1b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGlobalAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGlobalAttribute.gif
deleted file mode 100644
index 79d49d0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGlobalAttribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGlobalElement.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGlobalElement.gif
deleted file mode 100644
index dd45f08..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGlobalElement.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGroup.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGroup.gif
deleted file mode 100644
index 555ef53..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGroup.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGroupRef.gif
deleted file mode 100644
index 3621342..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDImport.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDImport.gif
deleted file mode 100644
index 9e44ce5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDImport.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDInclude.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDInclude.gif
deleted file mode 100644
index b26c527..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDInclude.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDKey.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDKey.gif
deleted file mode 100644
index 04032a9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDKey.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDKeyRef.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDKeyRef.gif
deleted file mode 100644
index ee5829d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDKeyRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDNotation.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDNotation.gif
deleted file mode 100644
index ce9df98..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDNotation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDRedefine.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDRedefine.gif
deleted file mode 100644
index 56964c1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDRedefine.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSelector.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSelector.gif
deleted file mode 100644
index 2399a58..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSelector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSequence.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSequence.gif
deleted file mode 100644
index 8bf3f97..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleContent.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleContent.gif
deleted file mode 100644
index 7ef38df..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleContent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleEnum.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleEnum.gif
deleted file mode 100644
index 11d7958..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleEnum.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleList.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleList.gif
deleted file mode 100644
index d08e78f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleList.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimplePattern.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimplePattern.gif
deleted file mode 100644
index a113cf4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimplePattern.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleRestrict.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleRestrict.gif
deleted file mode 100644
index 38bc12e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleRestrict.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleType.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleType.gif
deleted file mode 100644
index 75f33c2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleType.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleTypeForEditPart.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleTypeForEditPart.gif
deleted file mode 100644
index 9aefeb2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleTypeForEditPart.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleUnion.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleUnion.gif
deleted file mode 100644
index 292adaf..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDSimpleUnion.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDUnique.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDUnique.gif
deleted file mode 100644
index 5a8a650..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/XSDUnique.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/back.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/back.gif
deleted file mode 100644
index 24d1a27..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/back.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/browsebutton.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/browsebutton.gif
deleted file mode 100644
index 13dae59..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/browsebutton.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/forward.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/forward.gif
deleted file mode 100644
index eab699e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/forward.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/generate_xml.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/generate_xml.gif
deleted file mode 100644
index f2e3635..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/generate_xml.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/regx_wiz.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/regx_wiz.gif
deleted file mode 100644
index 789d137..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/regx_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/reloadgrammar.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/reloadgrammar.gif
deleted file mode 100644
index c705db0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/reloadgrammar.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/sort.gif b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/sort.gif
deleted file mode 100644
index 3c65dc4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/icons/sort.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java
deleted file mode 100644
index 5f31f56..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java
+++ /dev/null
@@ -1,254 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-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.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-public class XSDPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, Listener 
-{
-  Text indentTextField;
-  String indentString;
-  Text schemaNsPrefixField;
-  Text defaultTargetNamespaceText;
-  Button qualifyXSDLanguage;
-
-  /**
-   * Creates preference page controls on demand.
-   *   @param parent  the parent for the preference page
-   */
-  protected Control createContents(Composite parent)
-  {
-    WorkbenchHelp.setHelp(parent, XSDEditorContextIds.XSDP_PREFERENCE_PAGE);
-
-    Group group = createGroup(parent, 2);   
-    group.setText(XSDEditorPlugin.getXSDString("_UI_TEXT_XSD_NAMESPACE_PREFIX"));
-
-    qualifyXSDLanguage = ViewUtility.createCheckBox(group, XSDEditorPlugin.getXSDString("_UI_QUALIFY_XSD"));
-    ViewUtility.createLabel(group, " ");
-
-    createLabel(group, XSDEditorPlugin.getXSDString("_UI_TEXT_XSD_DEFAULT_PREFIX"));
-    schemaNsPrefixField = createTextField(group);
-    schemaNsPrefixField.addKeyListener(new KeyAdapter()
-    {
-      public void keyPressed(KeyEvent e)
-      {
-        setValid(true);
-      }      
-    });
-    
-    createLabel(group, XSDEditorPlugin.getXSDString("_UI_TEXT_XSD_DEFAULT_TARGET_NAMESPACE"));
-    defaultTargetNamespaceText = createTextField(group);
-
-    initializeValues();
-
-    return new Composite(parent, SWT.NULL);
-  }
-
-  private Group createGroup(Composite parent, int numColumns) 
-  {
-    Group group = new Group(parent, SWT.NULL);
-
-    GridLayout layout = new GridLayout();
-    layout.numColumns = numColumns;
-    group.setLayout(layout);
-
-    GridData data = new GridData();
-    data.verticalAlignment = GridData.FILL;
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    group.setLayoutData(data);
-    
-    return group;
-  }
-
-  private Text createTextField(Composite parent) 
-  {
-     Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
-     GridData data = new GridData();
-     data.verticalAlignment = GridData.FILL;
-     data.horizontalAlignment = GridData.FILL;
-     data.grabExcessHorizontalSpace = true;
-     text.setLayoutData(data);
-
-     return text;
-  }
-
-  private Label createLabel(Composite parent, String text) 
-  {
-    Label label = new Label(parent, SWT.LEFT);
-    label.setText(text);
-    
-    GridData data = new GridData();
-    data.verticalAlignment = GridData.CENTER;
-    data.horizontalAlignment = GridData.FILL;
-    label.setLayoutData(data);
-    
-    return label;
-  }
-  
-  /**
-   * Does anything necessary because the default button has been pressed.
-   */
-  protected void performDefaults() 
-  {
-    super.performDefaults();
-    initializeDefaults();
-    checkValues();
-  }
-
-  /**
-   * Do anything necessary because the OK button has been pressed.
-   *  @return whether it is okay to close the preference page
-   */
-  public boolean performOk() 
-  {
-    if (checkValues())
-    {
-      storeValues();    
-      return true;
-    }
-    return false;
-  }
-
-  protected void performApply()
-  {
-    if (checkValues())
-    {
-      storeValues();    
-    }
-  }
-
-  /**
-   * Handles events generated by controls on this page.
-   *   @param e  the event to handle
-   */
-  public void handleEvent(Event e) 
-  {
-  }
-
-  /**
-   * @see IWorkbenchPreferencePage
-   */
-  public void init(IWorkbench workbench)
-  { 
-  }
-
-  /** 
-   * The indent is stored in the preference store associated with the XML Schema Model
-   */
-  public IPreferenceStore getPreferenceStore()
-  {
-    return XSDEditorPlugin.getPlugin().getPreferenceStore();
-  }
-
-  /**
-   * Initializes states of the controls using default values
-   * in the preference store.
-   */
-  private void initializeDefaults() 
-  {
-    schemaNsPrefixField.setText(getPreferenceStore().getDefaultString(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT));
-    qualifyXSDLanguage.setSelection(getPreferenceStore().getDefaultBoolean(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY));
-    defaultTargetNamespaceText.setText(getPreferenceStore().getString(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE));
-  }
-
-  /**
-   * Initializes states of the controls from the preference store.
-   */
-  private void initializeValues() 
-  {
-    IPreferenceStore store = getPreferenceStore();
-    schemaNsPrefixField.setText(store.getString(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT));
-    qualifyXSDLanguage.setSelection(store.getBoolean(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY));
-    defaultTargetNamespaceText.setText(store.getString(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE));
-  }
-
-  /**
-   * Stores the values of the controls back to the preference store.
-   */
-  private void storeValues() 
-  {
-    IPreferenceStore store = getPreferenceStore();
-
-    store.setValue(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT, getXMLSchemaPrefix());
-    store.setValue(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY, getQualify());
-    store.setValue(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE, getXMLSchemaTargetNamespace());
-
-    XSDEditorPlugin.getPlugin().savePluginPreferences();
-  }
-
-  public String getXMLSchemaPrefix()
-  {
-    String prefix = schemaNsPrefixField.getText();
-    if (prefix == null || prefix.equals("")) 
-    {
-      return "xsd";
-    }
-    return prefix;
-  }
-
-  public boolean getQualify()
-  {
-    return qualifyXSDLanguage.getSelection();
-  }
-  
-  /**
-   * Get the xml schema default target namespace
-   */
-  public String getXMLSchemaTargetNamespace()
-  {
-  	String targetNamespace = defaultTargetNamespaceText.getText();
-    if (targetNamespace == null || targetNamespace.equals("")) 
-    {
-      return XSDEditorPlugin.DEFAULT_TARGET_NAMESPACE;
-    }
-    return targetNamespace;
-  }
-  
-  public boolean checkValues()
-  {
-// KCPort TODO    String errorMessage = ValidateHelper.checkXMLName(schemaNsPrefixField.getText());
-	 String errorMessage = null;
-
-    if (errorMessage == null || errorMessage.length() == 0)
-    {
-      setErrorMessage(null);
-      setValid(true);
-      return true;
-    }
-    else
-    {
-      setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_LABEL_INVALID_PREFIX"));
-      setValid(false);
-      return false;
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyAttributePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyAttributePropertySource.java
deleted file mode 100644
index 0f4e7e7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyAttributePropertySource.java
+++ /dev/null
@@ -1,173 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-public class AnyAttributePropertySource extends BasePropertySource implements IPropertySource
-{
-  private String[] namespaceComboValues = {
-              "",
-              "##any",
-              "##other",
-              "##targetNamespace",
-              "##local"
-  };
-  
-  private String[] processContentsComboValues = {
-              "",
-              XSDEditorPlugin.getXSDString("_UI_COMBO_LAX"),
-              XSDEditorPlugin.getXSDString("_UI_COMBO_SKIP"),
-              XSDEditorPlugin.getXSDString("_UI_COMBO_STRICT")
-  };
-  public AnyAttributePropertySource()
-  {
-  }
-
-  public AnyAttributePropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-    
-  public AnyAttributePropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-
-    XSDComboBoxPropertyDescriptor namespaceDescriptor = new XSDComboBoxPropertyDescriptor(
-        XSDConstants.NAMESPACE_ATTRIBUTE,
-        XSDConstants.NAMESPACE_ATTRIBUTE,
-        namespaceComboValues);
-    list.add(namespaceDescriptor);
-    
-    XSDComboBoxPropertyDescriptor processContentsDescriptor = new XSDComboBoxPropertyDescriptor(
-        XSDConstants.PROCESSCONTENTS_ATTRIBUTE,
-        XSDConstants.PROCESSCONTENTS_ATTRIBUTE,
-        processContentsComboValues);
-    list.add(processContentsDescriptor);
-    
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      result = element.getAttribute((String) id);
-      if (result == null)
-      {
-        result = "";
-      }
-      return result;
-    }
-    return "";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-    {
-      value = "";
-    }
-    if (value instanceof String)
-    {
-      if (((String) id).equals(XSDConstants.NAMESPACE_ATTRIBUTE))
-      {
-        String namespace = (String)value;
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"), element);
-        if (namespace != null && namespace.length() > 0)
-        {
-          element.setAttribute(XSDConstants.NAMESPACE_ATTRIBUTE, namespace);
-        }
-        else
-        {
-          element.removeAttribute(XSDConstants.NAMESPACE_ATTRIBUTE);
-        }
-        endRecording(element);
-      }
-      else if (((String) id).equals(XSDConstants.PROCESSCONTENTS_ATTRIBUTE))
-      {
-        String processContents = (String)value;
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_PROCESSCONTENTS_CHANGE"), element);
-        if (processContents != null && processContents.length() > 0)
-        {
-          element.setAttribute(XSDConstants.PROCESSCONTENTS_ATTRIBUTE, processContents);
-        }
-        else
-        {
-          element.removeAttribute(XSDConstants.PROCESSCONTENTS_ATTRIBUTE);
-        }
-        endRecording(element);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-
-  }
-
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyContentPropertyDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyContentPropertyDescriptor.java
deleted file mode 100644
index 7904053..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyContentPropertyDescriptor.java
+++ /dev/null
@@ -1,154 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.DialogCellEditor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class AnyContentPropertyDescriptor extends PropertyDescriptor
-{
-  Element element;
-  /**
-   * @param id
-   * @param displayName
-   */
-  public AnyContentPropertyDescriptor(Object id, String displayName, Element element)
-  {
-    super(id, displayName);
-    this.element = element;
-  }
-  
-  public CellEditor createPropertyEditor(Composite parent)
-  {
-    CellEditor editor = new AnyContentDialogCellEditor(parent);
-    if (getValidator() != null)
-      editor.setValidator(getValidator());
-    return editor;
-  }
-
-  public class AnyContentDialogCellEditor extends DialogCellEditor {
-
-    /**
-     * Creates a new Font dialog cell editor parented under the given control.
-     * The cell editor value is <code>null</code> initially, and has no 
-     * validator.
-     *
-     * @param parent the parent control
-     */
-    protected AnyContentDialogCellEditor(Composite parent) {
-      super(parent);
-    }
-
-    /**
-     * @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(Control)
-     */
-    protected Object openDialogBox(Control cellEditorWindow)
-    {
-      Shell shell = Display.getCurrent().getActiveShell();
-      
-      AnyContentDialog dialog = new AnyContentDialog(shell);
-      dialog.setBlockOnOpen(true);
-      dialog.create();
-      
-      String value = (String)getValue();
-
-      int result = dialog.open();
-
-      if (result == Window.OK)
-      {
-        return dialog.getComment();
-      }
-      return value;
-    }
-
-  }
-
-  public class AnyContentDialog extends org.eclipse.jface.dialogs.Dialog
-  {
-    protected Text commentField;
-    protected Button okButton, cancelButton;
-    private String comment;
-    
-    public AnyContentDialog(Shell shell)
-    {
-      super(shell);
-    }
-
-    protected void configureShell(Shell shell)
-    {
-      super.configureShell(shell);
-    }
-
-    protected void buttonPressed(int buttonId)
-    {
-      if (buttonId == Dialog.OK)
-      {
-        comment = commentField.getText();
-      }
-      super.buttonPressed(buttonId);
-    }
-
-    public String getComment() { return comment; }
-
-    //
-    // Create the controls
-    //
-    public Control createDialogArea(Composite parent)
-    {
-      Composite client = (Composite)super.createDialogArea(parent);
-      getShell().setText(element.getLocalName());
-      
-      commentField = ViewUtility.createMultiTextField(client, 400, 200, true);
-      
-      WorkbenchHelp.setHelp(commentField, XSDEditorContextIds.XSDE_ANNOTATION_COMMENT);
-      commentField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_COMMENT")); //$NON-NLS-1$
-
-      String initialString = (String)getInitialContent();
-      commentField.setText(initialString);
-      return client;
-    }
-
-    private Object getInitialContent()
-    {
-      Object result = null;
-      if (element.hasChildNodes())
-       {
-        // if the element is Text
-        Node node = element.getFirstChild();
-        if (node instanceof CharacterData)
-         {
-          result = ((CharacterData)node).getData();
-        }
-      }
-      else
-       {
-        result = ""; //$NON-NLS-1$
-      }
-      return result;
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyElementPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyElementPropertySource.java
deleted file mode 100644
index 1b2e12b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AnyElementPropertySource.java
+++ /dev/null
@@ -1,226 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-public class AnyElementPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-
-  private String[] namespaceComboValues = {
-        "",
-        "##any",
-        "##other",
-        "##targetNamespace",
-        "##local"
-  };
-  
-  private String[] processContentsComboValues = {
-     "",
-     XSDEditorPlugin.getXSDString("_UI_COMBO_LAX"),
-     XSDEditorPlugin.getXSDString("_UI_COMBO_SKIP"),
-     XSDEditorPlugin.getXSDString("_UI_COMBO_STRICT")
-  };
-  
-  /**
-   * 
-   */
-  public AnyElementPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public AnyElementPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public AnyElementPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-
-    XSDComboBoxPropertyDescriptor namespaceDescriptor = new XSDComboBoxPropertyDescriptor(
-        XSDConstants.NAMESPACE_ATTRIBUTE,
-        XSDConstants.NAMESPACE_ATTRIBUTE,
-        namespaceComboValues);
-    list.add(namespaceDescriptor);
-    
-    XSDComboBoxPropertyDescriptor processContentsDescriptor = new XSDComboBoxPropertyDescriptor(
-        XSDConstants.PROCESSCONTENTS_ATTRIBUTE,
-        XSDConstants.PROCESSCONTENTS_ATTRIBUTE,
-        processContentsComboValues);
-    list.add(processContentsDescriptor);
-
-// These are moved to the tabbed properties general section     
-//    PropertyDescriptor minOccursDescriptor =
-//    new TextPropertyDescriptor(
-//        XSDConstants.MINOCCURS_ATTRIBUTE,
-//        XSDConstants.MINOCCURS_ATTRIBUTE);
-//    list.add(minOccursDescriptor);
-//    PropertyDescriptor maxOccursDescriptor =
-//    new TextPropertyDescriptor(
-//        XSDConstants.MAXOCCURS_ATTRIBUTE,
-//        XSDConstants.MAXOCCURS_ATTRIBUTE);
-//    list.add(maxOccursDescriptor);
-    
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      result = element.getAttribute((String) id);
-      if (result == null)
-      {
-        result = "";
-      }
-      return result;
-
-//      if (((String) id).equals(XSDConstants.NAMESPACE_ATTRIBUTE))
-//       {
-//      }
-//      else if (((String) id).equals(XSDConstants.PROCESSCONTENTS_ATTRIBUTE))
-//       {
-//      }      
-    }
-    return "";
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-     {
-      value = "";
-    }
-    if (value instanceof String)
-    {
-      if (((String) id).equals(XSDConstants.MAXOCCURS_ATTRIBUTE))
-      {
-        String max = (String)value;
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_MAXOCCURS_CHANGE"), element);
-        if (max.length() > 0)
-        {
-          element.setAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE, max);
-        }
-        else
-        {
-          element.removeAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-        }
-        endRecording(element);
-      }
-      else if (((String) id).equals(XSDConstants.MINOCCURS_ATTRIBUTE))
-      {
-        String min = (String)value;
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_MINOCCURS_CHANGE"), element);
-        if (min.length() > 0)
-        {
-          element.setAttribute(XSDConstants.MINOCCURS_ATTRIBUTE, min);
-        }
-        else
-        {
-          element.removeAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-        }
-        endRecording(element);
-      }
-      else if (((String) id).equals(XSDConstants.NAMESPACE_ATTRIBUTE))
-      {
-        String namespace = (String)value;
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"), element);
-        if (namespace.length() > 0)
-        {
-          element.setAttribute(XSDConstants.NAMESPACE_ATTRIBUTE, namespace);
-        }
-        else
-        {
-          element.removeAttribute(XSDConstants.NAMESPACE_ATTRIBUTE);
-        }
-        endRecording(element);
-      }
-      else if (((String) id).equals(XSDConstants.PROCESSCONTENTS_ATTRIBUTE))
-      {
-        String processContents = (String)value;
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_PROCESSCONTENTS_CHANGE"), element);
-        if (processContents.length() > 0)
-        {
-          element.setAttribute(XSDConstants.PROCESSCONTENTS_ATTRIBUTE, processContents);
-        }
-        else
-        {
-          element.removeAttribute(XSDConstants.PROCESSCONTENTS_ATTRIBUTE);
-        }
-        endRecording(element);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AppInfoPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AppInfoPropertySource.java
deleted file mode 100644
index b99c768..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AppInfoPropertySource.java
+++ /dev/null
@@ -1,216 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.Node;
-
-public class AppInfoPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  public static String CONTENT = "Content";
-
-  /**
-   * 
-   */
-  public AppInfoPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public AppInfoPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public AppInfoPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    PropertyDescriptor sourceDescriptor =
-      new TextPropertyDescriptor(
-        XSDConstants.SOURCE_ATTRIBUTE,
-        XSDConstants.SOURCE_ATTRIBUTE);
-    list.add(sourceDescriptor);
-    AnyContentPropertyDescriptor contentDescriptor =
-      new AnyContentPropertyDescriptor(
-        CONTENT,
-        CONTENT,
-        element);
-    list.add(contentDescriptor);
-
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      if (((String) id).equals(CONTENT))
-      {
-        try
-        {
-          if (element.hasChildNodes())
-          {
-            // if the element is Text
-            Node node = element.getFirstChild();
-            if (node instanceof CharacterData)
-            {
-              return ((CharacterData)node).getData();
-            }
-          }
-          else
-          {
-            return "";
-          }
-        }
-        catch (Exception e)
-        {
-            
-        }
-
-      }
-      else
-      {
-        result = element.getAttribute((String) id);
-      }
-    }
-    if (result == null)
-    {
-      result = "";
-    }
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value != null)
-    {
-      if (value instanceof String)
-      {
-        if (((String)id).equals(XSDConstants.SOURCE_ATTRIBUTE))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_SOURCE_ATTRIBUTE_CHANGE"), element);
-          if (((String)value).length() > 0)
-          {
-            element.setAttribute(XSDConstants.SOURCE_ATTRIBUTE, (String)value);
-          }
-          else
-          {
-            element.removeAttribute(XSDConstants.SOURCE_ATTRIBUTE);
-          }
-          endRecording(element);
-        }
-        else if (((String)id).equals(CONTENT))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_COMMENT_CHANGE"), element);
-          try
-          {
-            if (element.hasChildNodes())
-            {
-              // if the element is Text
-              Node node = element.getFirstChild();
-              if (node instanceof CharacterData)
-              {
-                ((CharacterData)node).setData((String)value);
-              }
-            }
-            else
-            {
-              if (((String)value).length() > 0)
-              {
-                Node childNode = element.getOwnerDocument().createTextNode((String)value);
-                element.appendChild(childNode);
-              }
-            }
-            endRecording(element);
-          }
-          catch (Exception e)
-          {
-            
-          }
-        }
-        else  // shouldn't be here
-        {
-          element.setAttribute((String) id, (String) value);
-        }
-      }
-      else if (value instanceof Integer)
-      {
-      }
-    }
-    else
-    {
-      element.removeAttribute((String) id);
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributeGroupRefPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributeGroupRefPropertySource.java
deleted file mode 100644
index 74ca702..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributeGroupRefPropertySource.java
+++ /dev/null
@@ -1,172 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class AttributeGroupRefPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  private String[] refComboValues = { "" };
-  /**
-   * 
-   */
-  public AttributeGroupRefPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public AttributeGroupRefPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public AttributeGroupRefPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  
-  public void setInput(Element element)
-  {
-    this.element = element;
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    java.util.List items = helper.getGlobalAttributes();
-      
-    if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
-    {
-      items = helper.getGlobalAttributes();
-//      WorkbenchHelp.setHelp(client, XSDEditorContextIds.XSDE_ATTRIBUTE_REF_DESIGN_VIEW);
-//      WorkbenchHelp.setHelp(refCombo, XSDEditorContextIds.XSDE_ATTRIBUTE_REF_NAME);      
-    }
-    else if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true))
-    {
-      items = helper.getGlobalAttributeGroups();
-//      WorkbenchHelp.setHelp(client, XSDEditorContextIds.XSDE_ATTRIBUTE_GROUP_REF_DESIGN_VIEW);
-//      WorkbenchHelp.setHelp(refCombo, XSDEditorContextIds.XSDE_ATTRIBUTE_GROUP_REF_NAME);
-    }
-    int size = items.size() + 1;
-    refComboValues = new String[size];
-    refComboValues[0] = "";
-    if (items != null)
-    {
-      for (int i = 0; i < items.size(); i++)
-      {
-        refComboValues[i + 1] = (String) items.get(i);
-      }
-    }
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    XSDComboBoxPropertyDescriptor refDescriptor =
-    new XSDComboBoxPropertyDescriptor(
-        XSDConstants.REF_ATTRIBUTE,
-        XSDConstants.REF_ATTRIBUTE,
-        refComboValues);
-    list.add(refDescriptor);
-
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      result = element.getAttribute((String) id);
-      if (result == null)
-      {
-        result = "";
-      }
-//      if (((String) id).equals(XSDConstants.REF_ATTRIBUTE))
-//      {
-//      }
-      return result;
-    }
-    return "";
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-     {
-      value = "";
-    }
-    if (value instanceof String)
-    {
-      if (((String) id).equals(XSDConstants.REF_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTEGROUP_REF_CHANGE"), element);
-        element.setAttribute(XSDConstants.REF_ATTRIBUTE, (String) value);
-        endRecording(element);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributePropertySource.java
deleted file mode 100644
index 0365346..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributePropertySource.java
+++ /dev/null
@@ -1,294 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalAttributeRenamer;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-public class AttributePropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  private String[] useComboValues =
-  {
-        "", //$NON-NLS-1$
-        "prohibited",   // XSDEditorPlugin.getXSDString("_UI_COMBO_BOX_PROHIBITED"), //$NON-NLS-1$ 
-        "optional",   // XSDEditorPlugin.getXSDString("_UI_COMBO_BOX_OPTIONAL"), //$NON-NLS-1$
-        "required"  // XSDEditorPlugin.getXSDString("_UI_COMBO_BOX_REQUIRED") //$NON-NLS-1$
-  };
-
-  protected String formComboValues[] =
-  {
-        "", //$NON-NLS-1$
-        XSDEditorPlugin.getXSDString("_UI_COMBO_UNQUALIFIED"), //$NON-NLS-1$
-        XSDEditorPlugin.getXSDString("_UI_COMBO_QUALIFIED") //$NON-NLS-1$
-  };
-  
-  
-  /**
-   * 
-   */
-  public AttributePropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public AttributePropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public AttributePropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    PropertyDescriptor nameDescriptor = new TextPropertyDescriptor(XSDConstants.NAME_ATTRIBUTE, XSDConstants.NAME_ATTRIBUTE);
-    list.add(nameDescriptor);
-//    nameDescriptor.setCategory(XSDEditorPlugin.getXSDString("_UI_LABEL_GENERAL"));
-    TypesPropertyDescriptor typeDescriptor = new TypesPropertyDescriptor(
-      XSDConstants.TYPE_ATTRIBUTE,
-      XSDConstants.TYPE_ATTRIBUTE,
-      element, xsdSchema);
-    list.add(typeDescriptor);
-//    typeDescriptor.setCategory(XSDEditorPlugin.getXSDString("_UI_LABEL_GENERAL"));
-
-    Attr fixedAttr = element.getAttributeNode(XSDConstants.FIXED_ATTRIBUTE);
-    Attr defaultAttr = element.getAttributeNode(XSDConstants.DEFAULT_ATTRIBUTE);
-    String str;
-    if (fixedAttr != null)
-     {
-      str = XSDConstants.FIXED_ATTRIBUTE;
-    }
-    else if (defaultAttr != null)
-     {
-      str = XSDConstants.DEFAULT_ATTRIBUTE;
-    }
-    else
-     {
-      str = XSDConstants.FIXED_ATTRIBUTE + "/" + XSDConstants.DEFAULT_ATTRIBUTE; //$NON-NLS-1$
-    }
-    
-    FixedOrDefaultTextPropertyDescriptor fixedOrDefaultDescriptor =
-    new FixedOrDefaultTextPropertyDescriptor(
-        str, 
-        str,
-        element);
-    list.add(fixedOrDefaultDescriptor);
-//    fixedOrDefaultDescriptor.setCategory(XSDEditorPlugin.getXSDString("_UI_LABEL_OTHER"));
-    
-    Object parentNode = element.getParentNode();
-    if (XSDDOMHelper.inputEquals(parentNode, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-    {
-    }
-    else
-    {
-      XSDComboBoxPropertyDescriptor useDescriptor =
-      new XSDComboBoxPropertyDescriptor(
-          XSDConstants.USE_ATTRIBUTE,
-          XSDConstants.USE_ATTRIBUTE,
-          useComboValues);
-      list.add(useDescriptor);
-//      useDescriptor.setCategory(XSDEditorPlugin.getXSDString("_UI_LABEL_OTHER"));
-      XSDComboBoxPropertyDescriptor formDescriptor =
-      new XSDComboBoxPropertyDescriptor(
-          XSDConstants.FORM_ATTRIBUTE,
-          XSDConstants.FORM_ATTRIBUTE,
-          formComboValues);
-      list.add(formDescriptor);
-//      formDescriptor.setCategory(XSDEditorPlugin.getXSDString("_UI_LABEL_OTHER"));
-    }
-    
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      result = element.getAttribute((String) id);
-      if (result == null)
-      {
-        result = ""; //$NON-NLS-1$
-      }
-      if (((String) id).equals(XSDConstants.TYPE_ATTRIBUTE))
-      {
-        if (result.equals("")) //$NON-NLS-1$
-        {
-          if (checkForAnonymousType(element))
-          {
-            return "**anonymous**"; //$NON-NLS-1$
-          }
-          else
-          {
-            return XSDEditorPlugin.getXSDString("_UI_NO_TYPE"); //$NON-NLS-1$ 
-          }
-        }
-        else
-         {
-          return result;
-        }
-      }
-      return result;
-    }
-    return ""; //$NON-NLS-1$
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-    {
-      value = ""; //$NON-NLS-1$
-    }
-    if (value instanceof String)
-    {
-      if (((String) id).equals(XSDConstants.TYPE_ATTRIBUTE))
-      {
-//        beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element);
-//        element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, (String)value);
-//        updateElementToNotAnonymous(element);
-//        endRecording(element);
-      }
-      else if (((String) id).equals(XSDConstants.NAME_ATTRIBUTE))
-      { 
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTE_NAME_CHANGE"), element); //$NON-NLS-1$
-        // now rename any references to this element
-        if (xsdSchema != null)
-         {
-          XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-          if (comp != null && comp instanceof XSDAttributeDeclaration && comp.getRootContainer().equals(xsdSchema))
-          {
-            XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)comp;
-            xsdAttributeDeclaration.setName((String)value);
-            GlobalAttributeRenamer renamer = new GlobalAttributeRenamer(xsdAttributeDeclaration, (String)value);
-            renamer.visitSchema(xsdSchema);
-          }
-        }
-        element.setAttribute(XSDConstants.NAME_ATTRIBUTE, (String)value);
-        endRecording(element);
-      }
-      else if (((String) id).equals(XSDConstants.FIXED_ATTRIBUTE) || ((String) id).equals(XSDConstants.DEFAULT_ATTRIBUTE))
-      {            
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTE_VALUE_CHANGE"), element); //$NON-NLS-1$
-        if (((String)value).equals("")) //$NON-NLS-1$
-         {
-          element.removeAttribute((String)id);
-        }
-        else
-        {  
-          element.setAttribute((String) id, (String) value);
-        }
-        endRecording(element);
-      }
-      else if (((String) id).equals(XSDConstants.USE_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTE_USE_CHANGE"), element); //$NON-NLS-1$
-        if (((String)value).equals("")) //$NON-NLS-1$
-        {
-          element.removeAttribute(XSDConstants.USE_ATTRIBUTE);
-        }
-        else
-        {  
-          element.setAttribute((String) id, (String)value);
-        }
-        endRecording(element);
-      }
-      else if (((String) id).equals(XSDConstants.FORM_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTE_FORM_CHANGE"), element); //$NON-NLS-1$
-        if (((String)value).equals("")) //$NON-NLS-1$
-        {
-          element.removeAttribute(XSDConstants.FORM_ATTRIBUTE);
-        }
-        else
-        {
-          element.setAttribute(XSDConstants.FORM_ATTRIBUTE, (String)value);
-        }
-        endRecording(element);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-  
-  boolean checkForAnonymousType(Element element)
-  {
-    NodeList list = element.getElementsByTagNameNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-    if (list.getLength() > 0)
-     {
-      return true;
-    }
-    return false;
-  }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributesTable.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributesTable.java
deleted file mode 100644
index f80e72e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/AttributesTable.java
+++ /dev/null
@@ -1,331 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-//import java.text.Collator;
-//import java.util.Comparator;
-//import java.util.List;
-//
-//import org.eclipse.jface.viewers.CellEditor;
-//import org.eclipse.jface.viewers.ColumnPixelData;
-//import org.eclipse.jface.viewers.ICellModifier;
-//import org.eclipse.jface.viewers.ILabelProvider;
-//import org.eclipse.jface.viewers.IStructuredContentProvider;
-//import org.eclipse.jface.viewers.ITableLabelProvider;
-//import org.eclipse.jface.viewers.LabelProvider;
-//import org.eclipse.jface.viewers.TableLayout;
-//import org.eclipse.jface.viewers.TableViewer;
-//import org.eclipse.jface.viewers.TextCellEditor;
-//import org.eclipse.jface.viewers.Viewer;
-//import org.eclipse.swt.SWT;
-//import org.eclipse.swt.events.MouseAdapter;
-//import org.eclipse.swt.events.MouseEvent;
-//import org.eclipse.swt.graphics.Image;
-//import org.eclipse.swt.widgets.Composite;
-//import org.eclipse.swt.widgets.Control;
-//import org.eclipse.swt.widgets.Table;
-//import org.eclipse.swt.widgets.TableColumn;
-//import org.eclipse.swt.widgets.TableItem;
-//import org.eclipse.ui.IEditorPart;
-//import org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor;
-//import org.eclipse.ui.views.properties.IPropertyDescriptor;
-//import org.eclipse.ui.views.properties.IPropertySource;
-//import org.w3c.dom.Element;
-
-public class AttributesTable // extends TableViewer implements ICellModifier
-{
-//	protected static final String PROPERTY = "property"; //$NON-NLS-1$
-//	protected static final String VALUE = "value"; //$NON-NLS-1$
-//
-//	protected IEditorPart editorPart;
-//	protected String[] columnProperties = {PROPERTY, VALUE};
-//	protected PropertyTableProvider tableProvider = new PropertyTableProvider(this);
-//	protected CellEditor cellEditor;
-//	//protected StringComboBoxCellEditor comboCellEditor;
-//	protected IPropertySource propertySource;
-//
-//	public AttributesTable(IEditorPart editorPart, Composite parent)
-//	{
-//		super(new Table(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.FLAT | SWT.H_SCROLL | SWT.V_SCROLL));   
-//				 this.editorPart = editorPart;               
-//		getTable().setLinesVisible(true);
-//		getTable().setHeaderVisible(true);  
-//    
-//		setContentProvider(tableProvider);
-//		setLabelProvider(tableProvider);
-//		setColumnProperties(columnProperties);
-//
-//		for (int i = 0; i < columnProperties.length; i++)
-//		{
-//			TableColumn column = new TableColumn(getTable(), SWT.NONE, i);
-//			column.setText(columnProperties[i]);
-//			column.setAlignment(SWT.LEFT);
-//		}      
-//
-////		TableLayout layout = new TableLayout(); 
-////		ColumnWeightData data = new ColumnWeightData(40, 40, true);
-////		layout.addColumnData(data);
-////    
-////		ColumnWeightData data2 = new ColumnWeightData(80, 80, true);
-////		layout.addColumnData(data2);                       
-//
-//		TableLayout layout = new TableLayout();
-//		layout.addColumnData(new ColumnPixelData(130,true));
-//		layout.addColumnData(new ColumnPixelData(130,true));
-//		getTable().setLayout(layout);
-//		
-//         
-//		cellEditor = new TextCellEditor(getTable());                            
-//		resetCellEditors();           
-//
-//		setCellModifier(this);    
-//	}  
-//
-//	public void setPropertySource(IPropertySource propertySource)
-//	{
-//		this.propertySource = propertySource;
-//	}
-//
-//  /* (non-Javadoc)
-//   * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
-//   */
-//  public boolean canModify(Object element, String property)
-//  {
-//		return property.equals(VALUE);
-//  }
-//  
-//  /* (non-Javadoc)
-//   * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
-//   */
-//  public Object getValue(Object element, String property)
-//  {
-//		int column = 0;
-//		if (property.equals(columnProperties[0]))
-//		{
-//			column = 0;
-//		}
-//		else if (property.equals(columnProperties[1]))
-//		{
-//			column = 1;
-//		}    
-//		return tableProvider.getColumnValue(element, column);
-// }
-//
-//  /* (non-Javadoc)
-//   * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
-//   */
-//  public void modify(Object element, String property, Object value)
-//  {
-//		TableItem item = (TableItem)element;
-//  	IPropertyDescriptor propertyDescriptor = (IPropertyDescriptor)item.getData();
-//              
-//	// if the new value is the same as the old value, the user has only clicked
-//	// on the cell in the course of 'browsing' ... so don't edit the value
-//	  Object oldValue = getValue(propertyDescriptor, property);       
-//	  if (value != null && !value.equals(oldValue)) 
-//	  {      
-//				 // we assume the value is empty that the attribute should be removed
-//				 // todo... we probably need to look at this in more detail
-//				 if (value instanceof String && ((String)value).length() == 0)
-//				 {
-//								value = null;
-//				 }
-//				 propertySource.setPropertyValue(propertyDescriptor.getId(), value);    
-//	  }                       
-//  }
-//
-//      
-//	protected void hookControl(Control control) {
-//	  // we need to hook up our own mouse listener first
-//				 // so that we can update the cellEditors before
-//				 // the 'internal' listener tries to get hold of them
-//			 Table tableControl = (Table)control;
-//				 tableControl.addMouseListener(new MouseAdapter() {
-//								public void mouseDown(MouseEvent e) {
-//								  System.out.println("Mouse down");
-//										   updateCellEditors();
-//								}
-//				 });
-//		  super.hookControl(control);
-//	}                                
-//
-//	protected void updateCellEditors()
-//	{
-//		CellEditor[] cellEditors = new CellEditor[2];
-//		cellEditors[0] = cellEditor;
-//		cellEditors[1] = cellEditor;
-//
-//		Element element = (Element)getInput();
-//              
-//		IPropertyDescriptor[] propertyDescriptors = propertySource.getPropertyDescriptors();
-//		int index = getTable().getSelectionIndex();
-//		if (index >= 0 && index < propertyDescriptors.length)
-//		{
-//			CellEditor[] oldCellEditors = getCellEditors();
-//			CellEditor oldCellEditor = (oldCellEditors.length > 1) ? oldCellEditors[1] : null;
-//			if (oldCellEditor != null && oldCellEditor != cellEditor)
-//			{
-//			 oldCellEditor.deactivate();
-//			 oldCellEditor.dispose();
-//			}
-//			cellEditors[1] = propertyDescriptors[index].createPropertyEditor(getTable());     
-//		}  
-//		setCellEditors(cellEditors);     
-//
-////		IPropertyDescriptor[] propertyDescriptors = propertySource.getPropertyDescriptors();
-////
-//// 		int index = getTable().getSelectionIndex();
-//// 		//cellEditor.dispose();
-////
-////		if (index >= 0 && index < propertyDescriptors.length)
-////		{
-////      cellEditor = propertyDescriptors[index].createPropertyEditor(getTable());
-////			Control control = cellEditor.getControl();
-////			if (control == null) {
-////				cellEditor.deactivate();
-////				cellEditor = null;
-////				return;
-////			}
-////			setCellEditors(new CellEditor[] {null, cellEditor});
-////			cellEditor.activate();
-////			cellEditor.setFocus();
-////		}
-//	}
-//                 
-//
-//	public String[] getStringArray(List list)
-//	{
-//		String[] result = new String[list.size()];
-//		for (int i = 0; i < result.length; i++)
-//		{
-//			result[i] = (String)list.get(i);
-//		}
-//		return result;
-//	}
-//                                   
-//	protected void resetCellEditors()
-//	{
-//			 CellEditor[] cellEditors = new CellEditor[2];
-//			 cellEditors[0] = null;
-//			 cellEditors[1] = cellEditor;
-//			 setCellEditors(cellEditors);  
-//	}
-//
-//
-//	class PropertyTableProvider extends LabelProvider implements ITableLabelProvider, IStructuredContentProvider
-//	{                  
-//		protected TableViewer viewer;
-//
-//		PropertyTableProvider(TableViewer viewer)
-//		{
-//			this.viewer = viewer;
-//		}
-//		
-//		public void inputChanged(Viewer viewer, Object oldInput, Object newInput)  
-//		{
-////		 resetCellEditors();                         
-////			if (newInput instanceof XMLElement)
-////			{      
-////					 propertySource = new ExtensiblePropertySource(editorPart, (XMLElement)newInput);
-////			} 
-////			if (newInput instanceof Element)
-////			{
-////				if (XSDDOMHelper.inputEquals(newInput, XSDConstants.ELEMENT_ELEMENT_TAG, false))
-////				{  
-////				  propertySource = new ElementPropertySource((Element)newInput, viewer);
-////				}
-////				else
-////				{  
-////  				 propertySource = new ReadOnlyPropertySource(editorPart, (Element)newInput);
-////				}
-////			}
-////			else
-////			{
-////						 propertySource = null;
-////			}          
-//		}
-//
-//		public Image getColumnImage(Object element, int columnIndex)
-//		{  
-//			return null;
-//		}      
-//
-//		public Object getColumnValue(Object o, int columnIndex)  
-//		{ 
-//			IPropertyDescriptor propertyDescriptor = (IPropertyDescriptor)o;
-//			if (columnIndex == 0)
-//			{
-//			  return propertyDescriptor.getId();
-//			}
-//			else
-//			{  
-//			  return propertySource.getPropertyValue(propertyDescriptor.getId());
-//			}
-//		}
-//		  
-//		public String getColumnText(Object o, int columnIndex)  
-//		{ 
-//			IPropertyDescriptor propertyDescriptor = (IPropertyDescriptor)o;
-//			// (columnIndex == 1 && propertyDescriptor instanceof XSDComboBoxPropertyDescriptor)
-//			if ((columnIndex == 1 && propertyDescriptor instanceof OptionsComboBoxPropertyDescriptor) ||
-//			   (columnIndex == 1 && propertyDescriptor instanceof ComboBoxPropertyDescriptor))
-//			{
-//			  ILabelProvider lp = propertyDescriptor.getLabelProvider();
-//			  if (lp != null)
-//		  	{
-//			    return lp.getText(propertyDescriptor.getId());
-//		  	}
-//			}
-//			
-//			Object id = propertyDescriptor.getId();
-//      String attribute = "";
-//		  if (id != null && attribute instanceof String)
-//      {
-//        attribute = (String)id;
-//      }
-//      Object value = propertySource.getPropertyValue(attribute);
-//      String attributeValue = "";
-//      if (value != null)
-//      {
-//        attributeValue = (String)value;
-//      }
-//
-//      return (columnIndex == 0) ? attribute : attributeValue;
-//			
-////			  return (columnIndex == 0) ? propertyDescriptor.getId().toString() : propertySource.getPropertyValue(propertyDescriptor.getId()).toString();
-//		}  
-//
-//		public Object[] getElements(Object o)
-//		{         
-//						Object[] result = propertySource.getPropertyDescriptors();
-//						// For some strange reson the ViewerSorter doesn't seem to be working for this table
-//						// As a workaround we sort them in this method before returning them to the viewer
-////						if (result.length > 0)
-////						{
-////									 Arrays.sort(result, new InternalComparator());
-////						}
-//						return result;
-//		}
-//	}
-//
-//	class InternalComparator implements Comparator
-//	{
-//			 public int compare(Object e1, Object e2) 
-//			 {
-//							IPropertyDescriptor p1 = (IPropertyDescriptor)e1;
-//							IPropertyDescriptor p2 = (IPropertyDescriptor)e2;
-//							String p1Name = p1.getDisplayName();
-//							String p2Name = p2.getDisplayName();
-//							return Collator.getInstance().compare(p1.getDisplayName(), p2.getDisplayName());
-//			 }         
-//	}
-//
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/BasePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/BasePropertySource.java
deleted file mode 100644
index dbea691..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/BasePropertySource.java
+++ /dev/null
@@ -1,126 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public abstract class BasePropertySource implements IPropertySource
-{
-	protected Element element;
-	protected Viewer viewer;
-	protected IPropertyDescriptor[] propertyDescriptors;
-	protected XSDSchema xsdSchema;
-	protected String [] trueFalseComboValues = {
-		"",
-		"false",
-		"true"
-	};
-
-  public BasePropertySource()
-  {
-    
-  }
-
-  public DocumentImpl getDocument(Element element)
-  {
-    return (DocumentImpl) element.getOwnerDocument();
-  }
-  
-  public void beginRecording(String description, Element element)
-  {
-    getDocument(element).getModel().beginRecording(this, description);
-  }
-  
-  public void endRecording(Element element)
-  {
-    DocumentImpl doc = (DocumentImpl) getDocument(element);
-    
-    doc.getModel().endRecording(this);    
-  }
-  
-  
-  public BasePropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    this.viewer = viewer;
-    this.xsdSchema = xsdSchema;
-  }
-  
-  public BasePropertySource(XSDSchema xsdSchema)
-  {
-    this.xsdSchema = xsdSchema;
-  }
-  
-  public void setViewer(Viewer viewer)
-  {
-    this.viewer = viewer;
-  }
-
-  public void setInput(Element element)
-  {
-    this.element = element;
-  }
-
-  protected XSDDOMHelper domHelper = new XSDDOMHelper();
-  /**
-   * Gets the domHelper.
-   * @return Returns a XSDDomHelper
-   */
-  public XSDDOMHelper getDomHelper()
-  {
-    return domHelper;
-  }
-  
-	protected boolean hasElementChildren(Node parentNode)
-	{
-		boolean hasChildrenElements = false;
-		if (parentNode != null && parentNode.hasChildNodes())
-		{
-			NodeList nodes = parentNode.getChildNodes();
-			for (int i = 0; i < nodes.getLength(); i++)
-			{
-				if (nodes.item(i) instanceof Element)
-				{
-					hasChildrenElements = true;
-					break;
-				}
-			}
-		}
-		return hasChildrenElements;
-	}
-  
-  protected boolean validateName(String name)
-  {
-    return NameValidator.isValid(name);
-  }
-
-  // TODO
-  protected boolean validateLanguage(String lang)
-  {
-    return true;
-  }
-  
-  // TODO  
-  protected boolean validatePrefix(String prefix)
-  {
-    return true;
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ComplexTypePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ComplexTypePropertySource.java
deleted file mode 100644
index 0e759c1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ComplexTypePropertySource.java
+++ /dev/null
@@ -1,341 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.actions.SetBaseTypeAction;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalSimpleOrComplexTypeRenamer;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class ComplexTypePropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  private String DERIVED_BY_ID = "derived by"; // XSDEditorPlugin.getXSDString("_UI_LABEL_DERIVED_BY");  //$NON-NLS-1$ 
-  private String BASE_TYPE_ID = "base type"; //  XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE");  //$NON-NLS-1$
-  
-  private String[] blockOrFinalComboValues = 
-  {
-    "",    	//$NON-NLS-1$
-    "#all",  //$NON-NLS-1$
-    "extension", //$NON-NLS-1$
-    "restriction" //$NON-NLS-1$
-  };
-  
-  /**
-   * 
-   */
-  public ComplexTypePropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public ComplexTypePropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public ComplexTypePropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    
-    XSDComboBoxPropertyDescriptor abstractDescriptor =
-    new XSDComboBoxPropertyDescriptor(
-        XSDConstants.ABSTRACT_ATTRIBUTE,
-        XSDConstants.ABSTRACT_ATTRIBUTE,
-        trueFalseComboValues);
-    list.add(abstractDescriptor);
-
-    XSDComboBoxPropertyDescriptor mixedDescriptor =
-    new XSDComboBoxPropertyDescriptor(
-        XSDConstants.MIXED_ATTRIBUTE,
-        XSDConstants.MIXED_ATTRIBUTE,
-        trueFalseComboValues);
-    list.add(mixedDescriptor);
-        
-    XSDComboBoxPropertyDescriptor blockDescriptor =
-    new XSDComboBoxPropertyDescriptor(
-        XSDConstants.BLOCK_ATTRIBUTE,
-        XSDConstants.BLOCK_ATTRIBUTE,
-        blockOrFinalComboValues);
-    list.add(blockDescriptor);
-    XSDComboBoxPropertyDescriptor finalDescriptor =
-    new XSDComboBoxPropertyDescriptor(
-        XSDConstants.FINAL_ATTRIBUTE,
-        XSDConstants.FINAL_ATTRIBUTE,
-        blockOrFinalComboValues);
-    list.add(finalDescriptor);
-    
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-
-  public void setInput(Element element)
-  {
-    this.element = element;
-    
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      String attributeName = (String)id;
-      result = element.getAttribute((String) id);
-      Element contentModelElement = getDomHelper().getContentModelFromParent(element);    
-      String baseType = getDomHelper().getBaseType(contentModelElement);
-      
-      if (result == null)
-      {
-        result = ""; //$NON-NLS-1$
-      }
-      
-      if (attributeName.equals(DERIVED_BY_ID))
-      {
-        return getDomHelper().getDerivedByName(contentModelElement);
-      }
-      else if (attributeName.equals(BASE_TYPE_ID))
-      {
-        if (baseType != null)
-        {
-          return baseType;
-        }
-        else
-        {
-          return ""; //$NON-NLS-1$
-        }
-      }
-      else if (attributeName.equals(XSDConstants.NAME_ATTRIBUTE))
-      {
-        String name = element.getAttribute(XSDConstants.NAME_ATTRIBUTE);
-        
-        boolean isAnonymousType = checkForAnonymousType(element);
-        if (isAnonymousType)
-        {
-          return "**anonymous**";  //$NON-NLS-1$
-        }
-        else
-        {
-          return name;
-        }
-      }
-        
-      return result;
-//      if (((String) id).equals(XSDConstants.ABSTRACT_ATTRIBUTE)
-//          || ((String) id).equals(XSDConstants.MIXED_ATTRIBUTE))
-//      {
-//      }
-//      else if (((String) id).equals(XSDConstants.BLOCK_ATTRIBUTE))
-//       {
-//      }
-//      else if (((String) id).equals(XSDConstants.FINAL_ATTRIBUTE))
-//      {
-//      }
-    }
-    return ""; //$NON-NLS-1$
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-    {
-      value = ""; //$NON-NLS-1$
-    }
-    if (value instanceof String)
-    {
-      String newValue = (String)value;
-      String attributeName = (String)id;
-      
-      if (attributeName.equals(XSDConstants.NAME_ATTRIBUTE))
-      {
-        if (validateName(newValue))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_COMPLEXTYPE_NAME_CHANGE"), element); //$NON-NLS-1$
-          if (newValue.length() > 0)
-          {
-            // now rename any references to this type
-            if (xsdSchema != null)
-            {
-              XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-              if (comp != null && comp instanceof XSDComplexTypeDefinition && comp.getContainer().equals(xsdSchema))
-              {
-//                XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)comp;
-//                ct.setName(newValue);
-                GlobalSimpleOrComplexTypeRenamer renamer = new GlobalSimpleOrComplexTypeRenamer((XSDNamedComponent)comp, newValue);
-                renamer.visitSchema(xsdSchema);
-              }
-            }
-            element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
-          }
-          else
-          {
-            element.removeAttribute(XSDConstants.NAME_ATTRIBUTE);
-          }
-          endRecording(element);
-        }
-      }
-      else if (attributeName.equals(DERIVED_BY_ID))
-      {
-        Element contentModelElement = getDomHelper().getContentModelFromParent(element);
-        String baseType = getDomHelper().getBaseType(contentModelElement);
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_DERIVEDBY_CHANGE"), element); //$NON-NLS-1$
-        getDomHelper().changeDerivedByType(contentModelElement, newValue, baseType);
-        endRecording(element);
-      }
-      else if (attributeName.equals(BASE_TYPE_ID))
-      {
-        String derivedBy = getDomHelper().getDerivedByName(element);
-        
-        SetBaseTypeAction setBaseTypeAction = new SetBaseTypeAction(XSDEditorPlugin.getXSDString("_UI_LABEL_SET_BASE_TYPE")); //$NON-NLS-1$
-        setBaseTypeAction.setXSDSchema(xsdSchema);
-        setBaseTypeAction.setComplexTypeElement(element);
-        setBaseTypeAction.setType(newValue);
-        setBaseTypeAction.setDerivedBy(derivedBy);
-        setBaseTypeAction.performAction();
-
-//        handleBaseTypeComboChange(newValue);
-        
-      }
-      else
-      {
-        if (attributeName.equals(XSDConstants.ABSTRACT_ATTRIBUTE))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_COMPLEXTYPE_ABSTRACT_CHANGE"), element); //$NON-NLS-1$
-        }
-        else if (attributeName.equals(XSDConstants.MIXED_ATTRIBUTE))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_COMPLEXTYPE_MIXED_CHANGE"), element); //$NON-NLS-1$
-        }
-        else if (attributeName.equals(XSDConstants.BLOCK_ATTRIBUTE))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_COMPLEXTYPE_BLOCK_CHANGE"), element); //$NON-NLS-1$
-        }
-        else if (attributeName.equals(XSDConstants.FINAL_ATTRIBUTE))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_COMPLEXTYPE_FINAL_CHANGE"), element); //$NON-NLS-1$
-        }
-        
-        if (newValue.length() > 0)
-        {
-          element.setAttribute((String) id,  (String)value);
-        }
-        else
-        {
-          element.removeAttribute((String) id);
-        }
-        endRecording(element);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-
-  boolean checkForAnonymousType(Element element)
-  {
-    Object parentElement = (Object)element.getParentNode();
-    boolean isAnonymous = false;
-    if (parentElement != null)
-    {
-      if (XSDDOMHelper.inputEquals(parentElement, XSDConstants.ELEMENT_ELEMENT_TAG, false))
-      {
-        isAnonymous = true; 
-      }
-    }
-    return isAnonymous;
-  }
-  
-  
-//  private void handleBaseTypeComboChange(String newType)
-//  {
-//    String tempChoice = newType;
-//    TypesHelper helper = new TypesHelper(xsdSchema);
-//    if (helper.getBuiltInTypeNamesList().contains(tempChoice) ||
-//        helper.getUserSimpleTypeNamesList().contains(tempChoice))
-//    {
-//      derivedByCombo.setText(XSDConstants.EXTENSION_ELEMENT_TAG);
-//      derivedByCombo.setEnabled(false);
-//    }
-//    else if (helper.getUserComplexTypeNamesList().contains(tempChoice))
-//     {
-//      Element contentModelElement = getDomHelper().getContentModelFromParent(element);    
-//      String derivedByString = getDomHelper().getDerivedByName(contentModelElement);
-//      derivedByCombo.setText(derivedByString);
-//      derivedByCombo.setEnabled(true); 
-//    }
-//    else
-//     {
-//      derivedByCombo.setText("");
-//      derivedByCombo.setEnabled(false); 
-//    }
-//  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DocumentationPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DocumentationPropertySource.java
deleted file mode 100644
index 06e9ef7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DocumentationPropertySource.java
+++ /dev/null
@@ -1,243 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.Node;
-
-
-public class DocumentationPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  public static String CONTENT = "Content";
-  
-  /**
-   * 
-   */
-  public DocumentationPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public DocumentationPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-
-  }
-  /**
-   * @param xsdSchema
-   */
-  public DocumentationPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    PropertyDescriptor languageDescriptor =
-    new TextPropertyDescriptor(
-        "xml:lang",
-        "xml:lang"
-        );
-    list.add(languageDescriptor);
-    PropertyDescriptor sourceDescriptor =
-    new TextPropertyDescriptor(
-        XSDConstants.SOURCE_ATTRIBUTE,
-        XSDConstants.SOURCE_ATTRIBUTE);
-    list.add(sourceDescriptor);
-    AnyContentPropertyDescriptor contentDescriptor =
-    new AnyContentPropertyDescriptor(
-        CONTENT,
-        CONTENT,
-        element);
-    list.add(contentDescriptor);
-
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-     {
-      if (((String) id).equals(CONTENT))
-       {
-        try
-        {
-          if (element.hasChildNodes())
-           {
-            // if the element is Text
-            Node node = element.getFirstChild();
-            if (node instanceof CharacterData)
-             {
-              return ((CharacterData)node).getData();
-            }
-          }
-          else
-           {
-            return "";
-          }
-        }
-        catch (Exception e)
-        {
-          
-        }
-
-      }
-      else
-       {
-        result = element.getAttribute((String) id);
-      }
-    }
-    if (result == null)
-     {
-      result = "";
-    }
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value != null)
-    {
-      if (value instanceof String)
-      {
-        String newValue = (String)value;
-        if (((String)id).equals("xml:lang"))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_DOCUMENTATION_LANG_CHANGE"), element);
-          if (newValue.length() > 0)
-          {
-            if (validateLanguage(newValue))
-            {
-              element.setAttribute("xml:lang", newValue);
-            }
-          }
-          else
-          {
-            // clearErrorMessage();
-            element.removeAttribute("xml:lang");
-          }
-          endRecording(element);
-        }
-        else if (((String)id).equals(XSDConstants.SOURCE_ATTRIBUTE))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_DOCUMENTATION_SOURCE_CHANGE"), element);
-          if (newValue.length() > 0)
-          {
-            element.setAttribute(XSDConstants.SOURCE_ATTRIBUTE, newValue);
-          }
-          else
-          {
-            element.removeAttribute(XSDConstants.SOURCE_ATTRIBUTE);
-          }
-          endRecording(element);
-        }
-        else if (((String)id).equals(CONTENT))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_DOCUMENTATION_COMMENT_CHANGE"), element);
-          try
-          {
-            if (element.hasChildNodes())
-            {
-              // if the element is Text
-              Node node = element.getFirstChild();
-              if (node instanceof CharacterData)
-              {
-                ((CharacterData)node).setData(newValue);
-              }
-            }
-            else
-            {
-              if (newValue.length() > 0)
-              {
-                Node childNode = element.getOwnerDocument().createTextNode(newValue);
-                element.appendChild(childNode);
-              }
-            }
-            endRecording(element);
-          }
-          catch (Exception e)
-          {
-            
-          }
-        }
-        else  // shouldn't be here
-        {
-          element.setAttribute((String) id, newValue);
-        }
-      }
-      else if (value instanceof Integer)
-      {
-      }
-    }
-    else
-    {
-      element.removeAttribute((String) id);
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
- 
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DynamicCellEditor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DynamicCellEditor.java
deleted file mode 100644
index b09526a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/DynamicCellEditor.java
+++ /dev/null
@@ -1,1174 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.ACC;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlEvent;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.accessibility.AccessibleTextAdapter;
-import org.eclipse.swt.accessibility.AccessibleTextEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.TypedListener;
-
-public class DynamicCellEditor extends Composite
-{
-	Text text;
-	List list;
-	int maxItemCount = 5;
-	Shell popup;
-	Button arrow;
-	boolean hasFocus;
-	
-  public DynamicCellEditor(Composite parent, int style) {
-	super (parent, checkStyle (style));
-	
-	style = getStyle();
-	
-	int textStyle = SWT.SINGLE;
-	if ((style & SWT.READ_ONLY) != 0) textStyle |= SWT.READ_ONLY;
-	if ((style & SWT.FLAT) != 0) textStyle |= SWT.FLAT;
-	text = new Text (this, textStyle);
-	
-	popup = new Shell (getShell (), SWT.NO_TRIM);
-	
-	int listStyle = SWT.SINGLE | SWT.V_SCROLL;
-	if ((style & SWT.FLAT) != 0) listStyle |= SWT.FLAT;
-	if ((style & SWT.RIGHT_TO_LEFT) != 0) listStyle |= SWT.RIGHT_TO_LEFT;
-	if ((style & SWT.LEFT_TO_RIGHT) != 0) listStyle |= SWT.LEFT_TO_RIGHT;
-	list = new List (popup, listStyle);
-	
-	int arrowStyle = SWT.ARROW | SWT.DOWN;
-	if ((style & SWT.FLAT) != 0) arrowStyle |= SWT.FLAT;
-	arrow = new Button (this, arrowStyle);
-
-	Listener listener = new Listener () {
-		public void handleEvent (Event event) {
-			if (popup == event.widget) {
-				popupEvent (event);
-				return;
-			}
-			if (text == event.widget) {
-				textEvent (event);
-				return;
-			}
-			if (list == event.widget) {
-				listEvent (event);
-				return;
-			}
-			if (arrow == event.widget) {
-				arrowEvent (event);
-				return;
-			}
-			if (DynamicCellEditor.this == event.widget) {
-				comboEvent (event);
-				return;
-			}
-
-		}
-	};
-	
-	int [] comboEvents = {SWT.Dispose, SWT.Move, SWT.Resize};
-	for (int i=0; i<comboEvents.length; i++) this.addListener (comboEvents [i], listener);
-	
-	int [] popupEvents = {SWT.Close, SWT.Paint, SWT.Deactivate};
-	for (int i=0; i<popupEvents.length; i++) popup.addListener (popupEvents [i], listener);
-	
-	int [] textEvents = {SWT.KeyDown, SWT.KeyUp, SWT.Modify, SWT.MouseDown, SWT.MouseUp, SWT.Traverse, SWT.FocusIn, SWT.FocusOut};
-	for (int i=0; i<textEvents.length; i++) text.addListener (textEvents [i], listener);
-	
-	int [] listEvents = {SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.FocusOut};
-	for (int i=0; i<listEvents.length; i++) list.addListener (listEvents [i], listener);
-	
-	int [] arrowEvents = {SWT.Selection, SWT.FocusIn, SWT.FocusOut};
-	for (int i=0; i<arrowEvents.length; i++) arrow.addListener (arrowEvents [i], listener);
-	
-	initAccessible();
-}
-static int checkStyle (int style) {
-	int mask = SWT.BORDER | SWT.READ_ONLY | SWT.FLAT | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
-	return style & mask;
-}
-/**
-* Adds an item.
-* <p>
-* The item is placed at the end of the list.
-* Indexing is zero based.
-*
-* @param string the new item
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
-*	when the string is null
-* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_ADDED)
-*	when the item cannot be added
-*/
-public void add (String string) {
-	checkWidget();
-	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-	list.add (string);
-}
-/**
-* Adds an item at an index.
-* <p>
-* The item is placed at an index in the list.
-* Indexing is zero based.
-*
-* This operation will fail when the index is
-* out of range.
-*
-* @param string the new item
-* @param index the index for the item
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
-*	when the string is null
-* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_ADDED)
-*	when the item cannot be added
-*/
-public void add (String string, int index) {
-	checkWidget();
-	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-	list.add (string, index);
-}
-/**	 
-* Adds the listener to receive events.
-* <p>
-*
-* @param listener the listener
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
-*	when listener is null
-*/
-public void addModifyListener (ModifyListener listener) {;
-	checkWidget();
-	if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-	TypedListener typedListener = new TypedListener (listener);
-	addListener (SWT.Modify, typedListener);
-}
-/**	 
-* Adds the listener to receive events.
-* <p>
-*
-* @param listener the listener
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
-*	when listener is null
-*/
-public void addSelectionListener(SelectionListener listener) {
-	checkWidget();
-	if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-	TypedListener typedListener = new TypedListener (listener);
-	addListener (SWT.Selection,typedListener);
-	addListener (SWT.DefaultSelection,typedListener);
-}
-void arrowEvent (Event event) {
-	switch (event.type) {
-		case SWT.FocusIn: {
-			if (hasFocus) return;
-			hasFocus = true;
-			if (getEditable ()) text.selectAll ();
-			Event e = new Event();
-			e.time = event.time;
-			notifyListeners(SWT.FocusIn, e);
-			break;
-		}
-		case SWT.FocusOut: {
-			event.display.asyncExec(new Runnable() {
-				public void run() {
-					if (DynamicCellEditor.this.isDisposed()) return;
-					Control focusControl = getDisplay().getFocusControl();
-					if (focusControl == list || focusControl == text) return;
-					hasFocus = false;
-					Event e = new Event();
-					notifyListeners(SWT.FocusOut, e);
-				}
-			});
-			break;
-		}
-		case SWT.Selection: {
-			dropDown (!isDropped ());
-			break;
-		}
-	}
-}
-/**
-* Clears the current selection.
-* <p>
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-*/
-public void clearSelection () {
-	checkWidget();
-	text.clearSelection ();
-	list.deselectAll ();
-}
-void comboEvent (Event event) {
-	switch (event.type) {
-		case SWT.Dispose:
-			if (popup != null && !popup.isDisposed ()) popup.dispose ();
-			popup = null;  
-			text = null;  
-			list = null;  
-			arrow = null;
-			break;
-		case SWT.Move:
-			dropDown(false);
-			break;
-		case SWT.Resize:
-			internalLayout();
-			break;
-	}
-}
-
-public Point computeSize (int wHint, int hHint, boolean changed) {
-	checkWidget();
-	int width = 0, height = 0;
-	Point textSize = text.computeSize (wHint, SWT.DEFAULT, changed);
-	Point arrowSize = arrow.computeSize(SWT.DEFAULT, SWT.DEFAULT, changed);
-	Point listSize = list.computeSize (wHint, SWT.DEFAULT, changed);
-	int borderWidth = getBorderWidth();
-	
-	height = Math.max (hHint, Math.max(textSize.y, arrowSize.y)  + 2*borderWidth);
-	width = Math.max (wHint, Math.max(textSize.x + arrowSize.x + 2*borderWidth, listSize.x + 2)  );
-	return new Point (width, height);
-}
-/**
-* Deselects an item.
-* <p>
-* If the item at an index is selected, it is
-* deselected.  If the item at an index is not
-* selected, it remains deselected.  Indices
-* that are out of range are ignored.  Indexing
-* is zero based.
-*
-* @param index the index of the item
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-*/
-public void deselect (int index) {
-	checkWidget();
-	list.deselect (index);
-}
-/**
-* Deselects all items.
-* <p>
-*
-* If an item is selected, it is deselected.
-* If an item is not selected, it remains unselected.
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-*/
-public void deselectAll () {
-	checkWidget();
-	list.deselectAll ();
-}
-void dropDown (boolean drop) {
-	if (drop == isDropped ()) return;
-	if (!drop) {
-		popup.setVisible (false);
-		text.setFocus();
-		return;
-	}
-
-	int index = list.getSelectionIndex ();
-	if (index != -1) list.setTopIndex (index);
-	Display display = getDisplay ();
-	Rectangle listRect = list.getBounds ();
-	Rectangle parentRect = display.map (getParent (), null, getBounds());
-	Point comboSize = getSize ();
-	Rectangle displayRect = getMonitor().getClientArea();
-	int width = Math.max (comboSize.x, listRect.width + 2);
-	int height = listRect.height + 2;
-	int x = parentRect.x;
-	int y = parentRect.y + comboSize.y;
-	if (y + height > displayRect.y + displayRect.height) y = parentRect.y - height;
-	popup.setBounds (x, y, width, height);
-	popup.setVisible (true);
-	list.setFocus();
-}
-public Control [] getChildren () {
-	checkWidget();
-	return new Control [0];
-}
-boolean getEditable () {
-	return text.getEditable ();
-}
-/**
-* Gets an item at an index.
-* <p>
-* Indexing is zero based.
-*
-* This operation will fail when the index is out
-* of range or an item could not be queried from
-* the OS.
-*
-* @param index the index of the item
-* @return the item
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_CANNOT_GET_ITEM)
-*	when the operation fails
-*/
-public String getItem (int index) {
-	checkWidget();
-	return list.getItem (index);
-}
-/**
-* Gets the number of items.
-* <p>
-* This operation will fail if the number of
-* items could not be queried from the OS.
-*
-* @return the number of items in the widget
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_CANNOT_GET_COUNT)
-*	when the operation fails
-*/
-public int getItemCount () {
-	checkWidget();
-	return list.getItemCount ();
-}
-/**
-* Gets the height of one item.
-* <p>
-* This operation will fail if the height of
-* one item could not be queried from the OS.
-*
-* @return the height of one item in the widget
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_CANNOT_GET_ITEM_HEIGHT)
-*	when the operation fails
-*/
-public int getItemHeight () {
-	checkWidget();
-	return list.getItemHeight ();
-}
-/**
-* Gets the items.
-* <p>
-* This operation will fail if the items cannot
-* be queried from the OS.
-*
-* @return the items in the widget
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_CANNOT_GET_ITEM)
-*	when the operation fails
-*/
-public String [] getItems () {
-	checkWidget();
-	return list.getItems ();
-}
-/**
-* Gets the selection.
-* <p>
-* @return a point representing the selection start and end
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-*/
-public Point getSelection () {
-	checkWidget();
-	return text.getSelection ();
-}
-/**
-* Gets the index of the selected item.
-* <p>
-* Indexing is zero based.
-* If no item is selected -1 is returned.
-*
-* @return the index of the selected item.
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-*/
-public int getSelectionIndex () {
-	checkWidget();
-	return list.getSelectionIndex ();
-}
-/**
-* Gets the widget text.
-* <p>
-* If the widget has no text, an empty string is returned.
-*
-* @return the widget text
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-*/
-public String getText () {
-	checkWidget();
-	return text.getText ();
-}
-/**
-* Gets the height of the combo's text field.
-* <p>
-* The operation will fail if the height cannot 
-* be queried from the OS.
-
-* @return the height of the combo's text field.
-* 
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_ERROR_CANNOT_GET_ITEM_HEIGHT)
-*	when the operation fails
-*/
-public int getTextHeight () {
-	checkWidget();
-	return text.getLineHeight();
-}
-/**
-* Gets the text limit.
-* <p>
-* @return the text limit
-* 
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-*/
-public int getTextLimit () {
-	checkWidget();
-	return text.getTextLimit ();
-}
-/**
-* Gets the index of an item.
-* <p>
-* The list is searched starting at 0 until an
-* item is found that is equal to the search item.
-* If no item is found, -1 is returned.  Indexing
-* is zero based.
-*
-* @param string the search item
-* @return the index of the item
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
-*	when string is null
-*/
-public int indexOf (String string) {
-	checkWidget();
-	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-	return list.indexOf (string);
-}
-/**
-* Gets the index of an item.
-* <p>
-* The widget is searched starting at start including
-* the end position until an item is found that
-* is equal to the search itenm.  If no item is
-* found, -1 is returned.  Indexing is zero based.
-*
-* @param string the search item
-* @param index the starting position
-* @return the index of the item
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
-*	when string is null
-*/
-public int indexOf (String string, int start) {
-	checkWidget();
-	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-	return list.indexOf (string, start);
-}
-
-void initAccessible() {
-	getAccessible().addAccessibleListener(new AccessibleAdapter() {
-		public void getHelp(AccessibleEvent e) {
-			e.result = getToolTipText();
-		}
-	});
-	
-	getAccessible().addAccessibleTextListener(new AccessibleTextAdapter() {
-		public void getCaretOffset(AccessibleTextEvent e) {
-			e.offset = text.getCaretPosition();
-		}
-	});
-	
-	getAccessible().addAccessibleControlListener(new AccessibleControlAdapter() {
-		public void getChildAtPoint(AccessibleControlEvent e) {
-			Point testPoint = toControl(new Point(e.x, e.y));
-			if (getBounds().contains(testPoint)) {
-				e.childID = ACC.CHILDID_SELF;
-			}
-		}
-		
-		public void getLocation(AccessibleControlEvent e) {
-			Rectangle location = getBounds();
-			Point pt = toDisplay(new Point(location.x, location.y));
-			e.x = pt.x;
-			e.y = pt.y;
-			e.width = location.width;
-			e.height = location.height;
-		}
-		
-		public void getChildCount(AccessibleControlEvent e) {
-			e.detail = 0;
-		}
-		
-		public void getRole(AccessibleControlEvent e) {
-			e.detail = ACC.ROLE_COMBOBOX;
-		}
-		
-		public void getState(AccessibleControlEvent e) {
-			e.detail = ACC.STATE_NORMAL;
-		}
-
-		public void getValue(AccessibleControlEvent e) {
-			e.result = getText();
-		}
-	});
-}
-boolean isDropped () {
-	return popup.getVisible ();
-}
-public boolean isFocusControl () {
-	checkWidget();
-	if (text.isFocusControl() || arrow.isFocusControl() || list.isFocusControl() || popup.isFocusControl()) {
-		return true;
-	} else {
-		return super.isFocusControl();
-	}
-}
-
-//public boolean isListVisible()
-//{
-//  checkWidget();
-//  return list.isVisible();
-//}
-
-void internalLayout () {
-	if (isDropped ()) dropDown (false);
-	
-	Rectangle rect = getClientArea();
-	int width = rect.width;
-	int height = rect.height;
-	Point arrowSize = arrow.computeSize(SWT.DEFAULT, height);
-	text.setBounds (0, 0, width - arrowSize.x, height);
-	arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
-	
-	Point size = getSize();
-	int itemCount = list.getItemCount();
-	itemCount = (itemCount == 0) ? maxItemCount : Math.min(maxItemCount, itemCount);
-	int itemHeight = list.getItemHeight () * itemCount;
-	Point listSize = list.computeSize (SWT.DEFAULT, itemHeight);
-	list.setBounds (1, 1, Math.max (size.x - 2, listSize.x), listSize.y);
-}
-void listEvent (Event event) {
-	switch (event.type) {
-		case SWT.FocusIn: {
-			if (hasFocus) return;
-			hasFocus = true;
-			if (getEditable ()) text.selectAll ();
-			Event e = new Event();
-			e.time = event.time;
-			notifyListeners(SWT.FocusIn, e);
-			break;
-		}
-		case SWT.FocusOut: {
-			event.display.asyncExec(new Runnable() {
-				public void run() {
-					if (DynamicCellEditor.this.isDisposed()) return;
-					Control focusControl = getDisplay().getFocusControl();
-					if (focusControl == text || focusControl == arrow || focusControl == list) return;
-					hasFocus = false;
-					Event e = new Event();
-					notifyListeners(SWT.FocusOut, e);
-				}
-			});
-			break;
-		}
-		case SWT.MouseUp: {
-			if (event.button != 1) return;
-			dropDown (false);
-			break;
-		}
-		case SWT.Selection: {
-			int index = list.getSelectionIndex ();
-			if (index == -1) return;
-			text.setText (list.getItem (index));
-			text.selectAll ();
-			list.setSelection(index);
-			Event e = new Event();
-			e.time = event.time;
-			e.stateMask = event.stateMask;
-			e.doit = event.doit;
-			notifyListeners(SWT.Selection, e);
-			event.doit = e.doit;
-			break;
-		}
-		case SWT.Traverse: {
-			switch (event.detail) {
-				case SWT.TRAVERSE_TAB_NEXT:
-				case SWT.TRAVERSE_RETURN:
-				case SWT.TRAVERSE_ESCAPE:
-				case SWT.TRAVERSE_ARROW_PREVIOUS:
-				case SWT.TRAVERSE_ARROW_NEXT:
-					event.doit = false;
-					break;
-			}
-			Event e = new Event();
-			e.time = event.time;
-			e.detail = event.detail;
-			e.doit = event.doit;
-			e.keyCode = event.keyCode;
-			notifyListeners(SWT.Traverse, e);
-			event.doit = e.doit;
-			break;
-		}
-		case SWT.KeyUp: {		
-			Event e = new Event();
-			e.time = event.time;
-			e.character = event.character;
-			e.keyCode = event.keyCode;
-			e.stateMask = event.stateMask;
-			notifyListeners(SWT.KeyUp, e);
-			break;
-		}
-		case SWT.KeyDown: {
-			if (event.character == SWT.ESC) { 
-				// escape key cancels popup list
-				dropDown (false);
-			}
-			if (event.character == SWT.CR || event.character == '\t') {
-				// Enter and Tab cause default selection
-				dropDown (false);
-				Event e = new Event();
-				e.time = event.time;
-				e.stateMask = event.stateMask;
-				notifyListeners(SWT.DefaultSelection, e);
-			}
-			//At this point the widget may have been disposed.
-			// If so, do not continue.
-			if (isDisposed()) break;
-			Event e = new Event();
-			e.time = event.time;
-			e.character = event.character;
-			e.keyCode = event.keyCode;
-			e.stateMask = event.stateMask;
-			notifyListeners(SWT.KeyDown, e);
-			break;
-			
-		}
-	}
-}
-void popupEvent(Event event) {
-	switch (event.type) {
-		case SWT.Paint:
-			// draw black rectangle around list
-			Rectangle listRect = list.getBounds();
-			Color black = getDisplay().getSystemColor(SWT.COLOR_BLACK);
-			event.gc.setForeground(black);
-			event.gc.drawRectangle(0, 0, listRect.width + 1, listRect.height + 1);
-			break;
-		case SWT.Close:
-			event.doit = false;
-			dropDown (false);
-			break;
-		case SWT.Deactivate:
-			dropDown (false);
-			break;
-	}
-}
-public void redraw () {
-	super.redraw();
-	text.redraw();
-	arrow.redraw();
-	if (popup.isVisible()) list.redraw();
-}
-public void redraw (int x, int y, int width, int height, boolean all) {
-	super.redraw(x, y, width, height, true);
-}
-
-/**
-* Removes an item at an index.
-* <p>
-* Indexing is zero based.
-*
-* This operation will fail when the index is out
-* of range or an item could not be removed from
-* the OS.
-*
-* @param index the index of the item
-* @return the selection state
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_REMOVED)
-*	when the operation fails
-*/
-public void remove (int index) {
-	checkWidget();
-	list.remove (index);
-}
-/**
-* Removes a range of items.
-* <p>
-* Indexing is zero based.  The range of items
-* is from the start index up to and including
-* the end index.
-*
-* This operation will fail when the index is out
-* of range or an item could not be removed from
-* the OS.
-*
-* @param start the start of the range
-* @param end the end of the range
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_REMOVED)
-*	when the operation fails
-*/
-public void remove (int start, int end) {
-	checkWidget();
-	list.remove (start, end);
-}
-/**
-* Removes an item.
-* <p>
-* This operation will fail when the item
-* could not be removed from the OS.
-*
-* @param string the search item
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
-*	when string is null
-* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_REMOVED)
-*	when the operation fails
-*/
-public void remove (String string) {
-	checkWidget();
-	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-	list.remove (string);
-}
-/**
-* Removes all items.
-* <p>
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-*/
-public void removeAll () {
-	checkWidget();
-	text.setText (""); //$NON-NLS-1$
-	list.removeAll ();
-}
-/**	 
-* Removes the listener.
-* <p>
-*
-* @param listener the listener
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
-*	when listener is null
-*/
-public void removeModifyListener (ModifyListener listener) {
-	checkWidget();
-	if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-	removeListener(SWT.Modify, listener);	
-}
-/**	 
-* Removes the listener.
-* <p>
-*
-* @param listener the listener
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
-*	when listener is null
-*/
-public void removeSelectionListener (SelectionListener listener) {
-	checkWidget();
-	if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-	removeListener(SWT.Selection, listener);
-	removeListener(SWT.DefaultSelection,listener);	
-}
-/**
-* Selects an item.
-* <p>
-* If the item at an index is not selected, it is
-* selected. Indices that are out of
-* range are ignored.  Indexing is zero based.
-*
-* @param index the index of the item
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-*/
-public void select (int index) {
-	checkWidget();
-	if (index == -1) {
-		list.deselectAll ();
-		text.setText (""); //$NON-NLS-1$
-		return;
-	}
-	if (0 <= index && index < list.getItemCount()) {
-		if (index != getSelectionIndex()) {
-			text.setText (list.getItem (index));
-			text.selectAll ();
-			list.select (index);
-			list.showSelection ();
-		}
-	}
-}
-public void setBackground (Color color) {
-	super.setBackground(color);
-	if (text != null) text.setBackground(color);
-	if (list != null) list.setBackground(color);
-	if (arrow != null) arrow.setBackground(color);
-}
-public boolean setFocus () {
-	checkWidget();
-	return text.setFocus ();
-}
-public void setFont (Font font) {
-	super.setFont (font);
-	text.setFont (font);
-	list.setFont (font);
-	internalLayout ();
-}
-public void setForeground (Color color) {
-	super.setForeground(color);
-	if (text != null) text.setForeground(color);
-	if (list != null) list.setForeground(color);
-	if (arrow != null) arrow.setForeground(color);
-}
-/**
-* Sets the text of an item; indexing is zero based.
-*
-* This operation will fail when the index is out
-* of range or an item could not be changed in
-* the OS.
-*
-* @param index the index for the item
-* @param string the item
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
-*	when items is null
-* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_MODIFIED)
-*	when the operation fails
-*/
-public void setItem (int index, String string) {
-	checkWidget();
-	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-	list.setItem (index, string);
-}
-/**
-* Sets all items.
-*
-* @param items the array of items
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
-*	when items is null
-* @exception org.eclipse.swt.SWTError(ERROR_ITEM_NOT_ADDED)
-*	when the operation fails
-*/
-public void setItems (String [] items) {
-	checkWidget();
-	if (items == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-	int style = getStyle();
-	if ((style & SWT.READ_ONLY) != 0) text.setText (""); //$NON-NLS-1$
-	list.setItems (items);
-}
-/**
-* Sets the new selection.
-*
-* @param selection point representing the start and the end of the new selection
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
-*	when selection is null
-*/
-public void setSelection (Point selection) {
-	checkWidget();
-	if (selection == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-	text.setSelection (selection.x, selection.y);
-}
-
-/**
-* Sets the widget text.
-*
-* @param string the widget text
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_NULL_ARGUMENT)
-*	when string is null
-*/
-public void setText (String string) {
-	checkWidget();
-	if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-	int index = list.indexOf (string);
-	if (index == -1) {
-		list.deselectAll ();
-		text.setText (string);
-		return;
-	}
-	text.setText (string);
-	text.selectAll ();
-	list.setSelection (index);
-	list.showSelection ();
-}
-/**
-* Sets the text limit.
-* 
-* @param limit new text limit
-*
-* @exception org.eclipse.swt.SWTError(ERROR_THREAD_INVALID_ACCESS)
-*	when called from the wrong thread
-* @exception org.eclipse.swt.SWTError(ERROR_WIDGET_DISPOSED)
-*	when the widget has been disposed
-* @exception org.eclipse.swt.SWTError(ERROR_CANNOT_BE_ZERO)
-*	when limit is 0
-*/
-public void setTextLimit (int limit) {
-	checkWidget();
-	text.setTextLimit (limit);
-}
-
-public void setToolTipText (String string) {
-	checkWidget();
-	super.setToolTipText(string);
-	arrow.setToolTipText (string);
-	text.setToolTipText (string);		
-}
-
-public void setVisible (boolean visible) {
-	super.setVisible(visible);
-	if (!visible) popup.setVisible(false);
-}
-
-void textEvent (Event event) {
-	switch (event.type) {
-		case SWT.FocusIn: {
-			if (hasFocus) return;
-			hasFocus = true;
-			if (getEditable ()) text.selectAll ();
-			Event e = new Event();
-			e.time = event.time;
-			notifyListeners(SWT.FocusIn, e);
-			break;
-		}
-		case SWT.FocusOut: {
-			event.display.asyncExec(new Runnable() {
-				public void run() {
-					if (DynamicCellEditor.this.isDisposed()) return;
-					Control focusControl = getDisplay().getFocusControl();
-					if (focusControl == list || focusControl == arrow) return;
-					hasFocus = false;
-					Event e = new Event();
-					notifyListeners(SWT.FocusOut, e);
-				}
-			});
-			break;
-		}
-		case SWT.KeyDown: {
-			
-			if (event.character == SWT.ESC) { // escape key cancels popup list
-				dropDown (false);
-			}
-			if (event.character == SWT.CR) {
-				dropDown (false);
-				Event e = new Event();
-				e.time = event.time;
-				e.stateMask = event.stateMask;
-				notifyListeners(SWT.DefaultSelection, e);
-			}
-			//At this point the widget may have been disposed.
-			// If so, do not continue.
-			if (isDisposed()) break;
-			
-			if (event.keyCode == SWT.ARROW_UP || event.keyCode == SWT.ARROW_DOWN) {
-				int oldIndex = getSelectionIndex ();
-				if (event.keyCode == SWT.ARROW_UP) {
-					select (Math.max (oldIndex - 1, 0));
-				} else {
-					select (Math.min (oldIndex + 1, getItemCount () - 1));
-				}
-		
-				if (oldIndex != getSelectionIndex ()) {
-					Event e = new Event();
-					e.time = event.time;
-					e.stateMask = event.stateMask;
-					notifyListeners(SWT.Selection, e);
-				}
-				//At this point the widget may have been disposed.
-				// If so, do not continue.
-				if (isDisposed()) break;
-			}
-			
-			// Further work : Need to add support for incremental search in 
-			// pop up list as characters typed in text widget
-						
-			Event e = new Event();
-			e.time = event.time;
-			e.character = event.character;
-			e.keyCode = event.keyCode;
-			e.stateMask = event.stateMask;
-			notifyListeners(SWT.KeyDown, e);
-			break;
-		}
-		case SWT.KeyUp: {
-			Event e = new Event();
-			e.time = event.time;
-			e.character = event.character;
-			e.keyCode = event.keyCode;
-			e.stateMask = event.stateMask;
-			notifyListeners(SWT.KeyUp, e);
-			break;
-		}
-		case SWT.Modify: {
-			list.deselectAll ();
-			Event e = new Event();
-			e.time = event.time;
-			notifyListeners(SWT.Modify, e);
-			break;
-		}
-		case SWT.MouseDown: {
-			if (event.button != 1) return;
-			if (text.getEditable ()) return;
-			boolean dropped = isDropped ();
-			text.selectAll ();
-			if (!dropped) setFocus ();
-			dropDown (!dropped);
-			break;
-		}
-		case SWT.MouseUp: {
-			if (event.button != 1) return;
-			if (text.getEditable ()) return;
-			text.selectAll ();
-			break;
-		}
-		case SWT.Traverse: {		
-			switch (event.detail) {
-				case SWT.TRAVERSE_RETURN:
-				case SWT.TRAVERSE_ARROW_PREVIOUS:
-				case SWT.TRAVERSE_ARROW_NEXT:
-					// The enter causes default selection and
-					// the arrow keys are used to manipulate the list contents so
-					// do not use them for traversal.
-					event.doit = false;
-					break;
-			}
-			
-			Event e = new Event();
-			e.time = event.time;
-			e.detail = event.detail;
-			e.doit = event.doit;
-			e.keyCode = event.keyCode;
-			notifyListeners(SWT.Traverse, e);
-			event.doit = e.doit;
-			break;
-		}
-	}
-}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ElementPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ElementPropertySource.java
deleted file mode 100644
index 65416ac..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ElementPropertySource.java
+++ /dev/null
@@ -1,545 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalElementRenamer;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class ElementPropertySource extends BasePropertySource implements IPropertySource
-{
-  private String[] blockComboValues =
-    { "", "#all", "extension", "restriction", "substitution" };
-  private String[] finalComboValues =
-    { "", "#all", "extension", "restriction" };
-  private String[] substitutionGroupComboValues = { "" };
-  private String[] formComboValues =
-  {
-      "",
-      XSDEditorPlugin.getXSDString("_UI_COMBO_UNQUALIFIED"),
-      XSDEditorPlugin.getXSDString("_UI_COMBO_QUALIFIED")
-  };
-
-  public ElementPropertySource()
-  {
-    super();
-  }
-
-  public ElementPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  
-  public ElementPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-
-  public void setInput(Element element)
-  {
-    this.element = element;
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    List globals = helper.getGlobalElements();
-    int size = globals.size() + 1;
-    substitutionGroupComboValues = new String[size];
-    substitutionGroupComboValues[0] = "";
-    if (globals != null)
-    {
-      for (int k = 0; k < globals.size(); k++)
-      {
-        substitutionGroupComboValues[k + 1] = (String) globals.get(k);
-      }
-    }
-  }
-
-  /*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-	 */
-  public Object getEditableValue()
-  {
-//    return element.getNodeName();
-    return null;
-  }
-
-  /*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-	 */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    Object parentNode = element.getParentNode();
-    boolean isGlobalElement = XSDDOMHelper.inputEquals(parentNode, XSDConstants.SCHEMA_ELEMENT_TAG, false);
-    
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-//  These have been moved to the general tab
-//    PropertyDescriptor nameDescriptor =
-//      new TextPropertyDescriptor(
-//        XSDConstants.NAME_ATTRIBUTE,
-//        XSDConstants.NAME_ATTRIBUTE);
-//    list.add(nameDescriptor);
-//    TypesPropertyDescriptor typeDescriptor = new TypesPropertyDescriptor(
-//        XSDConstants.TYPE_ATTRIBUTE,
-//        XSDConstants.TYPE_ATTRIBUTE,
-//        element, xsdSchema);
-//    list.add(typeDescriptor);
-    if (isGlobalElement)
-    {
-      XSDComboBoxPropertyDescriptor abstractDescriptor =
-        new XSDComboBoxPropertyDescriptor(
-          XSDConstants.ABSTRACT_ATTRIBUTE,
-          XSDConstants.ABSTRACT_ATTRIBUTE,
-          trueFalseComboValues);
-      list.add(abstractDescriptor);
-    }
-    if (!isGlobalElement)
-    {
-      PropertyDescriptor minOccursDescriptor =
-        new TextPropertyDescriptor(
-          XSDConstants.MINOCCURS_ATTRIBUTE,
-          XSDConstants.MINOCCURS_ATTRIBUTE);
-      list.add(minOccursDescriptor);
-    
-      PropertyDescriptor maxOccursDescriptor =
-        new TextPropertyDescriptor(
-          XSDConstants.MAXOCCURS_ATTRIBUTE,
-          XSDConstants.MAXOCCURS_ATTRIBUTE);
-      list.add(maxOccursDescriptor);
-    }
-    XSDComboBoxPropertyDescriptor nillableDescriptor =
-      new XSDComboBoxPropertyDescriptor(
-        XSDConstants.NILLABLE_ATTRIBUTE,
-        XSDConstants.NILLABLE_ATTRIBUTE,
-        trueFalseComboValues);
-    list.add(nillableDescriptor);
-    XSDComboBoxPropertyDescriptor blockDescriptor =
-      new XSDComboBoxPropertyDescriptor(
-        XSDConstants.BLOCK_ATTRIBUTE,
-        XSDConstants.BLOCK_ATTRIBUTE,
-        blockComboValues);
-    list.add(blockDescriptor);
-    if (isGlobalElement)
-    {      
-      XSDComboBoxPropertyDescriptor finalDescriptor =
-        new XSDComboBoxPropertyDescriptor(
-          XSDConstants.FINAL_ATTRIBUTE,
-          XSDConstants.FINAL_ATTRIBUTE,
-          finalComboValues);
-      list.add(finalDescriptor);
-      XSDComboBoxPropertyDescriptor substitutionGroupDescriptor =
-        new XSDComboBoxPropertyDescriptor(
-          XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE,
-          XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE,
-          substitutionGroupComboValues);
-      list.add(substitutionGroupDescriptor);
-    }
-    if (!isGlobalElement)
-    {
-      XSDComboBoxPropertyDescriptor formDescriptor =
-        new XSDComboBoxPropertyDescriptor(
-          XSDConstants.FORM_ATTRIBUTE,
-          XSDConstants.FORM_ATTRIBUTE,
-          formComboValues);
-      list.add(formDescriptor);
-    }
-
-    Attr fixedAttr = element.getAttributeNode(XSDConstants.FIXED_ATTRIBUTE);
-    Attr defaultAttr = element.getAttributeNode(XSDConstants.DEFAULT_ATTRIBUTE);
-    String str;
-    if (fixedAttr != null)
-    {
-      str = XSDConstants.FIXED_ATTRIBUTE;
-    }
-    else if (defaultAttr != null)
-    {
-      str = XSDConstants.DEFAULT_ATTRIBUTE;
-    }
-    else
-    {
-      str = XSDConstants.FIXED_ATTRIBUTE + "/" + XSDConstants.DEFAULT_ATTRIBUTE;
-    }
-    
-    FixedOrDefaultTextPropertyDescriptor fixedOrDefaultDescriptor =
-      new FixedOrDefaultTextPropertyDescriptor(
-        str, 
-        str,
-        element);
-    list.add(fixedOrDefaultDescriptor);
-
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-    //    return propertyDescriptors;
-  }
-
-  /*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-	 */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      String attributeName = (String)id;
-      result = element.getAttribute(attributeName);
-      if (result == null)
-      {
-        result = "";
-      }
-      if (attributeName.equals(XSDConstants.TYPE_ATTRIBUTE))
-      {
-        boolean isAnonymous = checkForAnonymousType(element);
-        if (isAnonymous)
-        {
-          return "**anonymous**";
-        }
-        if (result.equals(""))
-        {
-          result = XSDEditorPlugin.getXSDString("_UI_NO_TYPE");
-        }
-        return result;
-      }
-      else if (attributeName.equals(XSDConstants.MAXOCCURS_ATTRIBUTE) 
-        || attributeName.equals(XSDConstants.MINOCCURS_ATTRIBUTE)
-        || attributeName.equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE)
-        || attributeName.equals(XSDConstants.FORM_ATTRIBUTE)
-        || attributeName.equals(XSDConstants.ABSTRACT_ATTRIBUTE)
-        || attributeName.equals(XSDConstants.NILLABLE_ATTRIBUTE)
-        || attributeName.equals(XSDConstants.BLOCK_ATTRIBUTE)
-        || attributeName.equals(XSDConstants.FINAL_ATTRIBUTE)
-        || attributeName.equals(XSDConstants.FIXED_ATTRIBUTE) 
-        || attributeName.equals(XSDConstants.DEFAULT_ATTRIBUTE)
-        || attributeName.equals(XSDConstants.NAME_ATTRIBUTE))
-      {
-        return result;
-      }
-    }
-    return "";
-  }
-
-  /*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-	 */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-
-  /*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-	 */
-  public void resetPropertyValue(Object id)
-  {
-  }
-
-  /*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object,
-	 *      java.lang.Object)
-	 */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-    {
-      value = "";
-    }
-    if (value instanceof String)
-    {
-      String newValue = (String)value;
-      String attributeName = (String)id;
-      
-      if (attributeName.equals(XSDConstants.MAXOCCURS_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_MAXOCCURS_CHANGE"), element);
-      }
-      else if (attributeName.equals(XSDConstants.MINOCCURS_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_MINOCCURS_CHANGE"), element);      
-      }
-      else if (attributeName.equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_SUBSTITUTIONGROUP_CHANGE"), element);
-      }
-      else if (attributeName.equals(XSDConstants.FORM_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_FORM_CHANGE"), element);
-      }
-      else if (attributeName.equals(XSDConstants.ABSTRACT_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_ABSTRACT_CHANGE"), element);
-      }
-      else if (attributeName.equals(XSDConstants.NILLABLE_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_NILLABLE_CHANGE"), element);
-      }
-      else if (attributeName.equals(XSDConstants.BLOCK_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_BLOCK_CHANGE"), element);
-      }
-      else if (attributeName.equals(XSDConstants.FINAL_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_FINAL_CHANGE"), element);
-      }
-      else if (attributeName.equals(XSDConstants.FIXED_ATTRIBUTE) || attributeName.equals(XSDConstants.DEFAULT_ATTRIBUTE))
-      {  
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_VALUE_CHANGE"), element);
-      }
-      else if (attributeName.equals(XSDConstants.NAME_ATTRIBUTE))
-      {
-        if (validateName(newValue))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_NAME_CHANGE"), element);
-          // now rename any references to this element
-          if (xsdSchema != null)
-          {
-            XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-            if (comp != null && comp instanceof XSDElementDeclaration && comp.getContainer().equals(xsdSchema))
-            {
-              GlobalElementRenamer renamer = new GlobalElementRenamer((XSDNamedComponent)comp, newValue);
-              renamer.visitSchema(xsdSchema);
-            }
-          }
-        }
-      }
-      else if (attributeName.equals(XSDConstants.TYPE_ATTRIBUTE))
-      {
-        // put logic in descriptor/cell editor
-//          beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_TYPE_CHANGE"), element);
-      }
-    
-      if (newValue.length() > 0)
-      {
-        element.setAttribute((String) id, (String) value);
-      }
-      else
-      {
-        if (!attributeName.equals(XSDConstants.NAME_ATTRIBUTE))
-        {
-          element.removeAttribute((String) id);
-        }
-      }
-      endRecording(element);
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-
-  }
-
-  boolean checkForAnonymousType(Element element)
-  {
-    /* Using Ed's model to check
-     boolean isAnonymous = false;
-
-     XSDConcreteComponent component = getXSDSchema().getCorrespondingComponent(element);
-     if (component instanceof XSDElementDeclaration)
-     {
-     XSDElementDeclaration xsdElem = (XSDElementDeclaration)component;
-     isAnonymous = xsdElem.isSetAnonymousTypeDefinition();
-     }
-     return isAnonymous;
-     */
-
-    boolean isAnonymous = false;
-
-    Node aNode = getDomHelper().getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-    if (aNode != null)
-     {
-      return true;
-    }
-    aNode = getDomHelper().getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-    if (aNode != null)
-     {
-      isAnonymous = true;
-    }
-    return isAnonymous;
-  }
-  
-  
-//  void updateElementToAnonymous(Element element, String xsdType)
-//  {
-//    String prefix = element.getPrefix();
-//    prefix = (prefix == null) ? "" : (prefix + ":");
-//
-//    updateElementToNotAnonymous(element);
-//    boolean hasChildrenElements = hasElementChildren(element);
-//
-//    Element childNode = null;
-//    if (xsdType.equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
-//     {
-//      childNode = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-//    }
-//    else if (xsdType.equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG))
-//     {
-//      childNode = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-//    }
-//
-//    element.appendChild(childNode);
-//    formatChild(childNode, hasChildrenElements);    
-//
-//
-//    /* Using Ed's model to do the above
-//     XSDConcreteComponent component = getXSDSchema().getCorrespondingComponent(element);
-//     if (component instanceof XSDElementDeclaration)
-//     {
-//     XSDElementDeclaration xsdElem = (XSDElementDeclaration)component;
-//     XSDFactoryImpl factory = new XSDFactoryImpl();
-//     XSDComplexTypeDefinition complex = factory.createXSDComplexTypeDefinition();
-//     XSDSimpleTypeDefinition simple = factory.createXSDSimpleTypeDefinition();
-//
-//     Node child = element.getFirstChild();
-//     if (XSDDOMHelper.inputEquals(child, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false) ||
-//     XSDDOMHelper.inputEquals(child, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
-//     {
-//     element.removeChild(child);
-//     }
-//     
-//     FormatProcessor formatProcessor = new FormatProcessor();
-//     if (xsdType.equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
-//     {
-//     xsdElem.setAnonymousTypeDefinition(complex);
-//     Element elem = complex.getElement();
-//     formatProcessor.formatWithSiblingIndent((XMLNode)elem);
-//     }
-//     else if (xsdType.equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG))
-//     {
-//     xsdElem.setAnonymousTypeDefinition(simple);
-//     Element elem = simple.getElement();  
-//     formatProcessor.formatWithSiblingIndent((XMLNode)elem);
-//     }
-//     }
-//     component.updateElement();
-//     */
-//  }
-//
-//  boolean isSTAnonymous(Element element)
-//  {
-//    Node aNode = getDomHelper().getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-//    if (aNode != null)
-//     {
-//      if (XSDDOMHelper.inputEquals(aNode, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-//       {
-//        return true;
-//      }
-//    }
-//    return false;
-//  }  
-//
-//  boolean isCTAnonymous(Element element)
-//  {
-//    Node aNode = getDomHelper().getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-//    if (aNode != null)
-//     {
-//      if (XSDDOMHelper.inputEquals(aNode, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
-//       {
-//        return true;
-//      }
-//    }
-//    return false;
-//  }  
-//
-//  XSDTypeDefinition getAnonymousTypeDefinition(Element element)
-//  {
-//    Node typeDefinitionNode = getDomHelper().getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-//    if (typeDefinitionNode == null)
-//     {
-//      typeDefinitionNode = getDomHelper().getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-//    }
-//    if (typeDefinitionNode != null)
-//     {
-//      XSDConcreteComponent component = getXSDSchema().getCorrespondingComponent(typeDefinitionNode);
-//      if (component instanceof XSDTypeDefinition)
-//       {
-//        return (XSDTypeDefinition)component;
-//      }
-//    }
-//    return null;    
-//
-//    /*    XSDConcreteComponent component = getXSDSchema().getCorrespondingComponent(element);
-//     if (component instanceof XSDElementDeclaration)
-//     {
-//     XSDElementDeclaration xsdElem = (XSDElementDeclaration)component;
-//
-//     return xsdElem.getAnonymousTypeDefinition();
-//     }
-//     return null;
-//     */
-//  }
-//
-//  void updateElementToNotAnonymous(Element element)
-//  {
-//    NodeList children = element.getChildNodes();
-//    if (children != null)
-//     {
-//      for (int i = 0; i < children.getLength(); i++)
-//       {
-//        Node node = (Node)children.item(i);
-//        if (node instanceof Element)
-//         {
-//          if (node.getLocalName().equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG) ||
-//              node.getLocalName().equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
-//           {
-//            XSDDOMHelper.removeNodeAndWhitespace(node);
-//            i=0;
-//          }
-//        }
-//      }
-//    }
-//    /*    XSDConcreteComponent component = getXSDSchema().getCorrespondingComponent(element);
-//     if (component instanceof XSDElementDeclaration)
-//     {
-//     XSDElementDeclaration xsdElem = (XSDElementDeclaration)component;
-//     if (xsdElem.isSetAnonymousTypeDefinition())
-//     {
-//     xsdElem.unsetAnonymousTypeDefinition();
-//     xsdElem.setAnonymousTypeDefinition(null);
-//     }
-//     }
-//     component.updateElement();
-//     */
-//  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/EnumerationPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/EnumerationPropertySource.java
deleted file mode 100644
index 65124f7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/EnumerationPropertySource.java
+++ /dev/null
@@ -1,131 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-public class EnumerationPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  /**
-   * 
-   */
-  public EnumerationPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public EnumerationPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public EnumerationPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    PropertyDescriptor nameDescriptor =
-    new TextPropertyDescriptor(
-        XSDConstants.VALUE_ATTRIBUTE,
-        XSDConstants.VALUE_ATTRIBUTE);
-    list.add(nameDescriptor);
-
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-     {
-      result = element.getAttribute((String) id);
-    }
-    if (result == null)
-     {
-      result = "";
-    }
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value != null)
-    {
-      if (value instanceof String)
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ENUM_VALUE_CHANGE"), element);
-        element.setAttribute(XSDConstants.VALUE_ATTRIBUTE, (String)value);
-        endRecording(element);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/FixedOrDefaultTextPropertyDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/FixedOrDefaultTextPropertyDescriptor.java
deleted file mode 100644
index 1cdced0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/FixedOrDefaultTextPropertyDescriptor.java
+++ /dev/null
@@ -1,304 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.DialogCellEditor;
-import org.eclipse.jface.window.Window;
-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.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-
-public class FixedOrDefaultTextPropertyDescriptor extends PropertyDescriptor
-{
-  protected static String choice = "";
-  Element element;
-  /**
-   * @param id
-   * @param displayName
-   */
-  public FixedOrDefaultTextPropertyDescriptor(Object id, String displayName, Element element)
-  {
-    super(id, displayName);
-    this.element = element;
-  }
-  
-  public CellEditor createPropertyEditor(Composite parent)
-  {
-    CellEditor editor = new FixedOrDefaultTextCellEditor(parent);
-    if (getValidator() != null)
-      editor.setValidator(getValidator());
-    return editor;
-  }
-
-//    public void setChoice(String newChoice)
-//    {
-//      choice = newChoice;
-//    }
-
-  public Object getId()
-  {
-    Attr fixedAttr = element.getAttributeNode(XSDConstants.FIXED_ATTRIBUTE);
-    Attr defaultAttr = element.getAttributeNode(XSDConstants.DEFAULT_ATTRIBUTE);
-    if (fixedAttr != null)
-    {
-      choice = "fixed";
-    }
-    else if (defaultAttr != null) // what if both attributes were specified?  Use default...
-    {
-      choice = "default";
-    }
-    else
-    {
-      choice = "";
-    }
-
-    if (choice.equals("fixed"))
-     {
-      return "fixed";
-    }
-    else if (choice.equals("default"))
-     {
-      return "default";
-    }
-    else
-     {
-      return super.getId();
-    }
-  }
-  
-  public String getDisplayName()
-  {
-    Attr fixedAttr = element.getAttributeNode(XSDConstants.FIXED_ATTRIBUTE);
-    Attr defaultAttr = element.getAttributeNode(XSDConstants.DEFAULT_ATTRIBUTE);
-    if (fixedAttr != null)
-    {
-      choice = "fixed";
-    }
-    else if (defaultAttr != null) // what if both attributes were specified?  Use default...
-     {
-      choice = "default";
-    }
-    else
-    {
-      choice = "fixed/default";
-    }
-
-    if (choice.equals("fixed"))
-     {
-      return "fixed";
-    }
-    else if (choice.equals("default"))
-     {
-      return "default";
-    }
-    else
-     {
-      return super.getDisplayName();
-    }
-  }
-
-  class FixedOrDefaultTextCellEditor extends DialogCellEditor
-  {
-    public FixedOrDefaultTextCellEditor(Composite parent)
-    {
-      super(parent);
-    }
-
-    protected Object openDialogBox(Control cellEditorWindow)
-    {
-	    Shell shell = Display.getCurrent().getActiveShell();
-	    
-	    FixedOrDefaultDialog dialog = new FixedOrDefaultDialog(shell);
-
-	    dialog.setBlockOnOpen(true);
-	    dialog.create();
-	    
-	    int result = dialog.open();
-	    
-	    if (result == Window.OK)
-	    {
-	      dialog.getValue();
-          fireApplyEditorValue();
-	    }
-	    deactivate();
-        return null;
-	  }
-  }
-  
-  class FixedOrDefaultDialog extends Dialog implements SelectionListener
-  {
-    private int FIXED = 0;
-    private int DEFAULT = 1;
-    private int type;
-    protected Button fixedButton, defaultButton;
-    protected Text valueField;
-    protected String valueString = "";
-    
-    public FixedOrDefaultDialog(Shell shell)
-    {
-      super(shell);
-    }
-
-    protected void configureShell(Shell shell)
-    {
-      super.configureShell(shell);
-    }
-
-    protected void buttonPressed(int buttonId)
-    {
-      if (buttonId == Dialog.OK)
-      {
-        valueString = valueField.getText();
-        applyEditorValueAndDeactivate();
-      }
-      super.buttonPressed(buttonId);
-    }
-
-    public String getValue() { return valueString; }
-    public String getType() { return type == FIXED? "fixed" : "default"; }
-
-    //
-    // Create the controls
-    //
-    public Control createDialogArea(Composite parent)
-    {
-      Composite client = (Composite)super.createDialogArea(parent);
-      getShell().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_FIXEDORDEFAULT_VALUE"));
-
-      GridLayout gl = new GridLayout(1, true);
-//      gl.marginHeight = 0;
-//      gl.marginWidth = 0;
-//      gl.horizontalSpacing = 0;
-//      gl.verticalSpacing = 0;
-      client.setLayout(gl);
-
-      GridData gd = new GridData();
-      gd.grabExcessHorizontalSpace = true;
-      gd.grabExcessVerticalSpace = true;
-      gd.horizontalAlignment = GridData.FILL;
-      gd.verticalAlignment = GridData.FILL;
-      gd.horizontalIndent = 0;
-      client.setLayoutData(gd);
-      
-//      isTextReadOnly = false;
-
-      fixedButton = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_FIXED"));
-//    WorkbenchHelp.setHelp(fixedButton, XSDEditorContextIds.XSDE_ELEMENT_FIXED);
-      
-      defaultButton = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_DEFAULT"));
-//    WorkbenchHelp.setHelp(defaultButton, XSDEditorContextIds.XSDE_ELEMENT_DEFAULT);
-
-      valueField = ViewUtility.createTextField(client, 30);
-      
-//    WorkbenchHelp.setHelp(valueField, XSDEditorContextIds.XSDE_ELEMENT_VALUE);
-//    valueField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_VALUE"));
-
-      WorkbenchHelp.setHelp(fixedButton, XSDEditorContextIds.XSDE_ATTRIBUTE_FIXED);
-      WorkbenchHelp.setHelp(defaultButton, XSDEditorContextIds.XSDE_ATTRIBUTE_DEFAULT);
-      // WorkbenchHelp.setHelp(valueField, XSDEditorContextIds.XSDE_ATTRIBUTE_VALUE);
-      
-      Attr fixedAttr = element.getAttributeNode(XSDConstants.FIXED_ATTRIBUTE);
-      Attr defaultAttr = element.getAttributeNode(XSDConstants.DEFAULT_ATTRIBUTE);
-
-      if (fixedAttr != null)
-      {
-        fixedButton.setSelection(true);
-        defaultButton.setSelection(false);
-        choice = "fixed";
-        type = FIXED;
-        valueField.setText(element.getAttribute("fixed"));
-        valueField.setFocus();
-        valueField.selectAll();
-      }
-      if (defaultAttr != null) // what if both attributes were specified?  Use default...
-       {
-        fixedButton.setSelection(false);
-        defaultButton.setSelection(true);
-        choice = "default";
-        type = DEFAULT;
-        valueField.setText(element.getAttribute("default"));
-        valueField.setFocus();
-        valueField.selectAll();
-      }
-
-      fixedButton.addSelectionListener(this);
-      defaultButton.addSelectionListener(this);
-      return client;
-    }
-
-    void applyEditorValueAndDeactivate()
-    {
-      String value = valueField.getText();
-      if (value != null && value.length() > 0)
-      {
-        choice = type == FIXED? "fixed" : "default";
-      }
-      if (value != null && value.length() > 0)
-      {
-        if (choice.equals("fixed"))
-        {
-          element.removeAttribute(XSDConstants.DEFAULT_ATTRIBUTE);
-          element.setAttribute(XSDConstants.FIXED_ATTRIBUTE, value);
-        }
-        else if (choice.equals("default"))
-        {
-          element.removeAttribute(XSDConstants.FIXED_ATTRIBUTE);
-          element.setAttribute(XSDConstants.DEFAULT_ATTRIBUTE, value);
-        }
-      }
-      if (value.equals(""))
-      {
-        choice = "";
-        element.removeAttribute(XSDConstants.DEFAULT_ATTRIBUTE);
-        element.removeAttribute(XSDConstants.FIXED_ATTRIBUTE);
-      }
-    }
-
-    public void widgetSelected(SelectionEvent e)
-    {
-      if (e.widget == fixedButton && fixedButton.getSelection())
-      {
-        type = FIXED;
-        choice = "fixed";
-      }
-      else if (e.widget == defaultButton && defaultButton.getSelection())
-      {
-        type = DEFAULT;
-        choice = "default";
-      }
-    }
-
-  	public void widgetDefaultSelected(SelectionEvent e)
-    {
-    }
-
-  }
-  
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/GroupRefPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/GroupRefPropertySource.java
deleted file mode 100644
index 0067c48..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/GroupRefPropertySource.java
+++ /dev/null
@@ -1,226 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class GroupRefPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  private String[] refComboValues = { "" };
-  /**
-   * 
-   */
-  public GroupRefPropertySource()
-  {
-    super();
-  }
-  
-//  public void setReferenceComboContextHelp(String contextId)
-//  {
-//    WorkbenchHelp.setHelp(refCombo, contextId);
-//  }
-  
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public GroupRefPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public GroupRefPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  
-  public void setInput(Element element)
-  {
-    this.element = element;
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    java.util.List items = helper.getGlobalElements();
-    if (XSDDOMHelper.inputEquals(element, XSDConstants.GROUP_ELEMENT_TAG, true))
-    {
-      items = helper.getModelGroups();
-      // Need tooltip for Group Ref
-//        minimumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MINIMUM"));
-//        WorkbenchHelp.setHelp(minimumField, XSDEditorContextIds.XSDE_GROUP_REF_MINIMUM);
-//        maximumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MAXIMUM"));
-//        WorkbenchHelp.setHelp(maximumField, XSDEditorContextIds.XSDE_GROUP_REF_MAXIMUM);
-    }
-    else if (XSDDOMHelper.inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, true))
-    {
-      items = helper.getGlobalElements();
-//        minimumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MINIMUM"));
-//        WorkbenchHelp.setHelp(minimumField, XSDEditorContextIds.XSDE_ELEMENT_REF_MINIMUM);
-//        maximumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MAXIMUM"));
-//        WorkbenchHelp.setHelp(maximumField, XSDEditorContextIds.XSDE_ELEMENT_REF_MAXIMUM);
-    }
-    
-    int size = items.size() + 1;
-    refComboValues = new String[size];
-    refComboValues[0] = "";
-    if (items != null)
-     {
-      for (int i = 0; i < items.size(); i++)
-       {
-        refComboValues[i + 1] = (String) items.get(i);
-      }
-    }
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    XSDComboBoxPropertyDescriptor refDescriptor =
-    new XSDComboBoxPropertyDescriptor(
-        XSDConstants.REF_ATTRIBUTE,
-        XSDConstants.REF_ATTRIBUTE,
-        refComboValues);
-    list.add(refDescriptor);
-    
-    PropertyDescriptor minOccursDescriptor =
-    new TextPropertyDescriptor(
-        XSDConstants.MINOCCURS_ATTRIBUTE,
-        XSDConstants.MINOCCURS_ATTRIBUTE);
-    list.add(minOccursDescriptor);
-    PropertyDescriptor maxOccursDescriptor =
-    new TextPropertyDescriptor(
-        XSDConstants.MAXOCCURS_ATTRIBUTE,
-        XSDConstants.MAXOCCURS_ATTRIBUTE);
-    list.add(maxOccursDescriptor);
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      result = element.getAttribute((String) id);
-      if (result == null)
-      {
-        result = "";
-      }
-      return result;
-      
-//      if (((String) id).equals(XSDConstants.REF_ATTRIBUTE))
-//      {
-//        return result;
-//      }
-    }
-    return "";
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-    {
-      value = "";
-    }
-    if (value instanceof String)
-    {
-      String newValue = (String)value;
-      if (((String) id).equals(XSDConstants.MAXOCCURS_ATTRIBUTE))
-      {
-        String max = (String)value;
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_MAXOCCURS_CHANGE"), element);
-        if (max.length() > 0)
-        {
-          element.setAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE, max);
-        }
-        else
-        {
-          element.removeAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-        }
-        endRecording(element);
-      }
-      else if (((String) id).equals(XSDConstants.MINOCCURS_ATTRIBUTE))
-      {
-        String min = (String)value;
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_MINOCCURS_CHANGE"), element);
-        if (min.length() > 0)
-        {
-          element.setAttribute(XSDConstants.MINOCCURS_ATTRIBUTE, min);
-        }
-        else
-        {
-          element.removeAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-        }
-        endRecording(element);
-      }
-      else if (((String) id).equals(XSDConstants.REF_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_REF_CHANGE"), element);
-        element.setAttribute((String) id, newValue);
-        endRecording(element);
-      }
-    }
-//    Runnable delayedUpdate = new Runnable()
-//    {
-//      public void run()
-//      {
-        if (viewer != null)
-          viewer.refresh();
-//      }
-//    };
-//    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ImportPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ImportPropertySource.java
deleted file mode 100644
index cadd611..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ImportPropertySource.java
+++ /dev/null
@@ -1,310 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.delete.XSDExternalFileCleanup;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class ImportPropertySource
-  extends SchemaDirectiveHelperPropertySource
-  implements IPropertySource
-{
-  boolean isSetNamespace = false;
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public ImportPropertySource(Viewer viewer, XSDSchema xsdSchema, IFile currentIFile)
-  {
-    super(viewer, xsdSchema, false);
-    this.currentIFile = currentIFile;
-//     WorkbenchHelp.setHelp(controlsContainer, XSDEditorContextIds.XSDE_IMPORT_DESIGN_VIEW);
-//WorkbenchHelp.setHelp(selectButton, XSDEditorContextIds.XSDE_INCLUDE_HELPER_SELECT);
-//WorkbenchHelp.setHelp(prefixField, XSDEditorContextIds.XSDE_IMPORT_PREFIX);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public ImportPropertySource(XSDSchema xsdSchema, IFile currentIFile)
-  {
-    super(xsdSchema, false);
-    this.currentIFile = currentIFile;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    
-    SchemaLocationPropertyDescriptor schemaLocationDescriptor =
-    new SchemaLocationPropertyDescriptor(
-      XSDConstants.SCHEMALOCATION_ATTRIBUTE,
-      XSDConstants.SCHEMALOCATION_ATTRIBUTE
-      );
-    schemaLocationDescriptor.setHelpContextIds(XSDEditorContextIds.XSDE_INCLUDE_HELPER_SELECT);
-    list.add(schemaLocationDescriptor);
-    
-    if (isSetNamespace)
-    {
-      PropertyDescriptor prefixDescriptor = 
-      new TextPropertyDescriptor(
-        "Prefix",
-        "Prefix");
-      prefixDescriptor.setHelpContextIds(XSDEditorContextIds.XSDE_IMPORT_PREFIX);
-      list.add(prefixDescriptor);
-    }
-    else
-    {
-      PropertyDescriptor prefixDescriptor = 
-      new PropertyDescriptor(
-        "Prefix",
-        "Prefix");
-      prefixDescriptor.setHelpContextIds(XSDEditorContextIds.XSDE_IMPORT_PREFIX);
-      list.add(prefixDescriptor);
-    }
-
-    PropertyDescriptor namespaceDescriptor = 
-    new PropertyDescriptor(
-        XSDConstants.NAMESPACE_ATTRIBUTE,
-        XSDConstants.NAMESPACE_ATTRIBUTE);
-    list.add(namespaceDescriptor);  
-
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      result = element.getAttribute((String) id);
-      String attributeName = (String)id;
-      if (result == null)
-       {
-        result = "";
-      }
-
-      if (attributeName.equals("Prefix"))
-       {
-        TypesHelper helper = new TypesHelper(xsdSchema);
-        String aPrefix = helper.getPrefix(element.getAttribute(XSDConstants.NAMESPACE_ATTRIBUTE), false);
-        if (aPrefix != null && aPrefix.length() > 0)
-        {
-          return aPrefix;
-        }
-        return "";        
-      }
-      else
-       {
-        return result;
-      }
-    }
-    return "";
-    
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-     {
-      value = "";
-    }
-    if (value instanceof String)
-    {
-      String newValue = (String)value;
-      TypesHelper typesHelper = new TypesHelper(xsdSchema);
-      String namespace = element.getAttribute(XSDConstants.NAMESPACE_ATTRIBUTE);
-      String oldPrefixValue = typesHelper.getPrefix(namespace, false);
-      
-      String schemaLocation = element.getAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE);
-      if (((String) id).equals("Prefix"))
-      {
-        if (validatePrefix(newValue) &&  schemaLocation.length() > 0)
-        {
-          Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-
-          if (map.containsKey(newValue))
-          {
-//          setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_LABEL_PREFIX_EXISTS"));
-          }
-          else
-          {
-            beginRecording(XSDEditorPlugin.getXSDString("_UI_PREFIX_CHANGE"), element);
-            map.remove(oldPrefixValue);
-            map.put(newValue, namespace);
-            XSDSchemaHelper.updateElement(xsdSchema);
-
-            endRecording(element);  
-          }
-        }
-      }
-      else if (((String) id).equals(XSDConstants.SCHEMALOCATION_ATTRIBUTE))
-      { 
-        updateExternalModel((String)value, selectedIFile, selectedNamespace, selectedXSDSchema);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-  
-  public void setInput(Element element)
-  {
-    this.element = element;
-    String namespace = element.getAttribute(XSDConstants.NAMESPACE_ATTRIBUTE);
-    if (namespace != null && namespace.trim().length() > 0)
-    {
-      isSetNamespace = true;
-    }    
-    
-  }
-
-  protected void updateExternalModel(String newLocation, IFile newFile, String namespace, XSDSchema externalSchema)
-  {
-    if (xsdSchema == null) // in case we have a bad schema
-     {
-      return;
-    }
-    Element importElement = element;
-    if (namespace == null)
-    {
-      namespace = "";
-    }        
-    
-    XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-    if (comp instanceof XSDImport)
-    {
-      beginRecording(XSDEditorPlugin.getXSDString("_UI_IMPORT_CHANGE"), importElement);
-      java.util.Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-      
-      // Referential integrity on old import
-      // How can we be sure that if the newlocation is the same as the oldlocation
-      // the file hasn't changed
-      
-      XSDSchema referencedSchema = ((XSDSchemaDirective)comp).getResolvedSchema();
-      if (referencedSchema != null)
-      {
-        XSDExternalFileCleanup cleanHelper = new XSDExternalFileCleanup(referencedSchema);
-        cleanHelper.visitSchema(xsdSchema);
-      }
-
-      Element schemaElement = xsdSchema.getElement();
-
-      // update the xmlns in the schema element first, and then update the import element next
-      // so that the last change will be in the import element.  This keeps the selection
-      // on the import element
-      TypesHelper helper = new TypesHelper(externalSchema);
-      String prefix = helper.getPrefix(namespace, false);
-      
-      boolean prefixAlreadyExists = false;
-      if (map.containsKey(prefix))
-      {
-        prefixAlreadyExists = true;
-      }
-      
-      if (prefix == null || (prefix !=null && prefix.length() == 0) || prefixAlreadyExists)
-      {
-        prefix = "pref";
-
-        int prefixExtension = 1;
-        while (map.containsKey(prefix) && prefixExtension < 100)
-         {
-          prefix = prefix + String.valueOf(prefixExtension);
-          prefixExtension++;
-        }
-      }
-
-      if (namespace.length() > 0)
-       {
-        // if ns already in map, use its corresponding prefix
-        if (map.containsValue(namespace))
-         {
-          TypesHelper typesHelper = new TypesHelper(xsdSchema);
-          prefix = typesHelper.getPrefix(namespace, false);
-        }
-        else // otherwise add to the map
-        {
-          schemaElement.setAttribute("xmlns:"+prefix, namespace);
-        }
-      }
-
-      // Now update the import element's attributes
-      importElement.setAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, newLocation);
-      
-      if (!namespace.equals(""))
-       {
-        importElement.setAttribute(XSDConstants.NAMESPACE_ATTRIBUTE, namespace);
-      }
-      else
-       {
-        importElement.removeAttribute(XSDConstants.NAMESPACE_ATTRIBUTE);
-      }
-      
-      endRecording(importElement);
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/IncludePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/IncludePropertySource.java
deleted file mode 100644
index b5054ac..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/IncludePropertySource.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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.delete.XSDExternalFileCleanup;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class IncludePropertySource
-  extends SchemaDirectiveHelperPropertySource
-  implements IPropertySource
-{
-  /**
-   * 
-   */
-  public IncludePropertySource(IFile currentIFile)
-  {
-    super(true);
-    this.currentIFile = currentIFile;
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public IncludePropertySource(Viewer viewer, XSDSchema xsdSchema, IFile currentIFile)
-  {
-    super(viewer, xsdSchema, true);
-    this.currentIFile = currentIFile;
-  }
-  /**
-   * @param xsdSchema
-   */
-  public IncludePropertySource(XSDSchema xsdSchema, IFile currentIFile)
-  {
-    super(xsdSchema, true);
-    this.currentIFile = currentIFile;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    
-    SchemaLocationPropertyDescriptor schemaLocationDescriptor =
-    new SchemaLocationPropertyDescriptor(
-        XSDConstants.SCHEMALOCATION_ATTRIBUTE,
-        XSDConstants.SCHEMALOCATION_ATTRIBUTE);
-  
-    list.add(schemaLocationDescriptor);
-    
-
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-     {
-      result = element.getAttribute((String) id);
-      if (result == null)
-       {
-        result = "";
-      }
-      return result;
-    }
-    return "";
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-    {
-      value = "";
-    }
-    if (value instanceof String)
-    {
-      if (((String) id).equals(XSDConstants.SCHEMALOCATION_ATTRIBUTE))
-      { 
-        //element.setAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, (String)value);
-        updateExternalModel((String)value, selectedIFile, selectedNamespace, selectedXSDSchema);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-  }
-
-  protected void updateExternalModel(String newLocation, IFile newFile, String namespace, XSDSchema externalSchema)
-  {
-    Element includeElement = element;
-
-    String existingSchemaLocation = includeElement.getAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE);
-
-    beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_INCLUDE_CHANGE"), includeElement);
-    includeElement.setAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, newLocation);
-    
-    // If there is no existing schemaLocation, then just set it
-    if (existingSchemaLocation == null)
-    {
-      return;
-    }
-
-    XSDConcreteComponent includeComponent = xsdSchema.getCorrespondingComponent(includeElement);
-    if (includeComponent instanceof XSDInclude)
-     {
-      XSDInclude include = (XSDInclude) includeComponent;
-
-      XSDSchema referencedSchema = include.getResolvedSchema();
-      if (referencedSchema != null)
-      {
-        XSDExternalFileCleanup cleanHelper = new XSDExternalFileCleanup(referencedSchema);
-        cleanHelper.visitSchema(xsdSchema);
-        
-        xsdSchema.update();
-        include.updateElement();
-      }
-      
-    }
-    endRecording(includeElement);    
-  }
-
-  
-// Redefine's version
-//  protected void updateExternalModel(IFile newFile, String namespace, XSDSchema externalSchema)
-//  {
-//    Element redefineElement = (Element) getNode();
-//
-//    redefineElement.setAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, locationField.getText());
-//
-//    String existingSchemaLocation = redefineElement.getAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE);
-//
-//    // If there is no existing schemaLocation, then just set it and return
-//    if (existingSchemaLocation == null)
-//     {
-//      return;
-//    }
-//
-//    XSDConcreteComponent redefineComponent = getXSDSchema().getCorrespondingComponent(redefineElement);
-//    if (redefineComponent instanceof XSDRedefine)
-//     {
-//      XSDRedefine redefine = (XSDRedefine) redefineComponent;
-//      XSDExternalFileCleanup cleanup = new XSDExternalFileCleanup(redefine.getIncorporatedSchema());
-//      
-//      cleanup.visitSchema(getXSDSchema());
-//      if (getEditor() != null)
-//       {
-//// DisplayErrorInTaskList task = new DisplayErrorInTaskList(getEditor().getEditorIDocument(), getEditor().getFileResource(), cleanup.getMessages());
-//// task.run();
-//        
-//        // Workaround to reset included elements in XSD model
-//        getEditor().reparseSchema();
-//        getEditor().getGraphViewer().setSchema(getXSDSchema());
-//      }
-//    }
-//
-//    /* since we are reparsing, we don't need this
-//
-//     Iterator contents = getXSDSchema().getContents().iterator();
-//     while (contents.hasNext())
-//     {
-//     XSDSchemaContent content = (XSDSchemaContent)contents.next();
-//     if (content instanceof XSDSchemaDirective)
-//     {
-//     XSDSchemaDirective directive = (XSDSchemaDirective)content;
-//
-//     if (directive.getSchemaLocation().equals(oldSchemaLocation) && directive instanceof XSDRedefine)
-//     {
-//     directive.unsetSchemaLocation();
-//     directive.setSchemaLocation(locationField.getText());
-//     directive.unsetResolvedSchema();
-//     redefineElement.setAttribute(XSDConstants.SCHEMALOCATION_ATTRIBUTE, locationField.getText());
-//     getXSDSchema().updateDocument();
-//     XSDSchemaHelper.updateElement(directive);
-////          directive.updateElement();
-//     break;
-//     }
-//     }
-//     }
-//     */
-//  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/KeyrefPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/KeyrefPropertySource.java
deleted file mode 100644
index 19e95ce..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/KeyrefPropertySource.java
+++ /dev/null
@@ -1,208 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class KeyrefPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  private String[] refComboValues = { "" };
-  /**
-   * 
-   */
-  public KeyrefPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public KeyrefPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public KeyrefPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  
-  public void setInput(Element element)
-  {
-    this.element = element;
-    java.util.List items = new ArrayList();
-
-    
-    if (xsdSchema != null)
-    {
-      Iterator iter = xsdSchema.getIdentityConstraintDefinitions().iterator();
-      String name = element.getAttribute(XSDConstants.NAME_ATTRIBUTE);
-      while (iter.hasNext())
-      {
-        XSDIdentityConstraintDefinition constraint = (XSDIdentityConstraintDefinition)iter.next();
-        if (name != null && !name.equals(""))
-         {
-          if (constraint.getName() != null)
-           {
-            if (!name.equals(constraint.getQName(xsdSchema)))
-            {
-              items.add(constraint.getQName(xsdSchema));
-            }
-          }
-        }
-        else
-         {
-          if (constraint.getName() != null)
-          {
-            items.add(constraint.getQName(xsdSchema));
-          }
-        }
-      }
-    }   
-    
-    int size = items.size() + 1;
-    refComboValues = new String[size];
-    refComboValues[0] = "";
-    if (items != null)
-     {
-      for (int i = 0; i < items.size(); i++)
-       {
-        refComboValues[i + 1] = (String) items.get(i);
-      }
-    }
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-// This property is moved to the General Tab
-//    PropertyDescriptor nameDescriptor =
-//    new TextPropertyDescriptor(
-//        XSDConstants.NAME_ATTRIBUTE,
-//        XSDConstants.NAME_ATTRIBUTE);
-//    list.add(nameDescriptor);
-    
-    XSDComboBoxPropertyDescriptor refDescriptor =
-    new XSDComboBoxPropertyDescriptor(
-        XSDConstants.REFER_ATTRIBUTE,
-        XSDConstants.REFER_ATTRIBUTE,
-        refComboValues);
-    list.add(refDescriptor);
-    
-
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-
-    if (id instanceof String)
-     {
-      result = element.getAttribute((String) id);
-      if (result == null)
-       {
-        result = "";
-      }
-      return result;
-//      if (((String) id).equals(XSDConstants.REFER_ATTRIBUTE))
-//      {
-//        return result;
-//      }
-    }
-    return "";
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-    {
-      value = "";
-    }
-    if (value instanceof String)
-    {
-      String newValue = (String)value;
-      if (((String) id).equals(XSDConstants.NAME_ATTRIBUTE))
-      {  
-        if (validateName(newValue))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_KEYREF_NAME_CHANGE"), element);
-          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
-          endRecording(element);
-        }         
-      }
-      else if (((String) id).equals(XSDConstants.REFER_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_KEYREF_REFER_CHANGE"), element);
-        element.setAttribute((String) id, newValue);
-        endRecording(element);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ModelGroupPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ModelGroupPropertySource.java
deleted file mode 100644
index 228860c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ModelGroupPropertySource.java
+++ /dev/null
@@ -1,261 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class ModelGroupPropertySource  // all or sequence or choice
-  extends BasePropertySource
-  implements IPropertySource
-{
-  private String[] modelGroupComboValues = { "sequence", "choice", "all" };
-  /**
-   * 
-   */
-  public ModelGroupPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public ModelGroupPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public ModelGroupPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-
-    XSDComboBoxPropertyDescriptor modelGroupDescriptor =
-    new XSDComboBoxPropertyDescriptor(
-        "model group",
-        "model group",
-        modelGroupComboValues);
-    list.add(modelGroupDescriptor);
-    
-    PropertyDescriptor minOccursDescriptor =
-    new TextPropertyDescriptor(
-        XSDConstants.MINOCCURS_ATTRIBUTE,
-        XSDConstants.MINOCCURS_ATTRIBUTE);
-    list.add(minOccursDescriptor);
-    PropertyDescriptor maxOccursDescriptor =
-    new TextPropertyDescriptor(
-        XSDConstants.MAXOCCURS_ATTRIBUTE,
-        XSDConstants.MAXOCCURS_ATTRIBUTE);
-    list.add(maxOccursDescriptor);
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      result = element.getAttribute((String) id);
-      String attributeName = (String)id;
-      if (result == null)
-       {
-        result = "";
-      }
-      if (attributeName.equals("model group"))
-      {
-        result = element.getLocalName();
-        return result;
-      }
-    }
-    return "";
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    String property = (String)id;
-    if (value == null)
-    {
-      value = "";
-    }
-    if (value instanceof String)
-    {
-      String newValue = (String)value;
-      if (property.equals("model group"))
-       {
-        Element parent = (Element)element.getParentNode();
-        String prefix = element.getPrefix();
-        prefix = prefix == null ? "" : prefix + ":";
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_SCOPE_CHANGE"), parent);
-        changeContentModel(parent, newValue);
-        endRecording(parent);
-        XSDDOMHelper domHelper = new XSDDOMHelper();
-        setInput(domHelper.getContentModelFromParent(parent));
-      }
-      else if (property.equals(XSDConstants.MAXOCCURS_ATTRIBUTE))
-      {
-        String max = (String)value;
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_MAXOCCURS_CHANGE"), element);
-        if (max.length() > 0)
-        {
-          element.setAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE, max);
-        }
-        else
-         {
-          element.removeAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-        }
-        endRecording(element);
-      }
-      else if (((String) id).equals(XSDConstants.MINOCCURS_ATTRIBUTE))
-       {
-        String min = (String)value;
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_MINOCCURS_CHANGE"), element);
-        if (min.length() > 0)
-        {
-          element.setAttribute(XSDConstants.MINOCCURS_ATTRIBUTE, min);
-        }
-        else
-        {
-          element.removeAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-        }
-        endRecording(element);
-      }
-    }
-
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-
-  public void setInput(Element element)
-  {
-    super.setInput(element);
-    
-    if (element != null)
-    {
-      boolean parentIsSequence = false;
-      boolean parentIsChoice = false;
-     
-      Object parent = element.getParentNode();
-      
-      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SEQUENCE_ELEMENT_TAG, false))
-       {
-        parentIsSequence = true;
-      }
-      else if (XSDDOMHelper.inputEquals(parent, XSDConstants.CHOICE_ELEMENT_TAG, false))
-       {
-        parentIsChoice = true;
-      }
-      
-      if (parentIsChoice || parentIsSequence)
-      {
-        modelGroupComboValues = new String[2];
-        modelGroupComboValues[0] = XSDConstants.SEQUENCE_ELEMENT_TAG;
-        modelGroupComboValues[1] = XSDConstants.CHOICE_ELEMENT_TAG;
-      }
-      else
-      {
-        modelGroupComboValues = new String[3];
-        modelGroupComboValues[0] = XSDConstants.SEQUENCE_ELEMENT_TAG;
-        modelGroupComboValues[1] = XSDConstants.CHOICE_ELEMENT_TAG;
-        modelGroupComboValues[2] = XSDConstants.ALL_ELEMENT_TAG;
-      }
-    }      
-  }
-  
-  private void changeContentModel(Element parent, String contentModel)
-  {
-    Document doc = parent.getOwnerDocument();
-    XSDDOMHelper domHelper = new XSDDOMHelper();
-  
-    String prefix = parent.getPrefix();
-    prefix = prefix == null ? "" : prefix + ":";
-    
-    Element contentModelElement = domHelper.getContentModelFromParent(parent);
-  
-    if (contentModelElement.getLocalName().equals(contentModel))
-    {
-      return; // it's already the content model 
-    }
-  
-    Element newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + contentModel);
-  
-    if (contentModelElement.hasChildNodes())
-    {        
-      NodeList nodes = contentModelElement.getChildNodes();
-      // use clones so we don't have a refresh problem
-      for (int i = 0; i < nodes.getLength(); i++)
-      {
-        Node node = nodes.item(i);
-        newNode.appendChild(node.cloneNode(true)); 
-      }
-    }
-    parent.replaceChild(newNode, contentModelElement);
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NamePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NamePropertySource.java
deleted file mode 100644
index bbfb786..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NamePropertySource.java
+++ /dev/null
@@ -1,219 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalAttributeGroupRenamer;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalGroupRenamer;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class NamePropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  /**
-   * 
-   */
-  public NamePropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public NamePropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public NamePropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-
-// From attribute group    
-//    WorkbenchHelp.setHelp(client, XSDEditorContextIds.XSDE_ATTRIBUTE_GROUP_DESIGN_VIEW);
-//    WorkbenchHelp.setHelp(nameField, XSDEditorContextIds.XSDE_ATTRIBUTE_GROUP_NAME);
-
-// From unique
-//    WorkbenchHelp.setHelp(nameField, XSDEditorContextIds.XSDE_UNIQUE_BASE_NAME);
-
-// From key
-//    WorkbenchHelp.setHelp(nameField, XSDEditorContextIds.XSDE_UNIQUE_BASE_NAME);
-    
-// From group
-//     WorkbenchHelp.setHelp(controlsContainer, XSDEditorContextIds.XSDE_GROUP_DESIGN_VIEW);
-//     WorkbenchHelp.setHelp(nameField, XSDEditorContextIds.XSDE_GROUP_NAME);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    PropertyDescriptor nameDescriptor =
-    new TextPropertyDescriptor(
-        XSDConstants.NAME_ATTRIBUTE,
-        XSDConstants.NAME_ATTRIBUTE);
-    list.add(nameDescriptor);
-
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      result = element.getAttribute((String) id);
-    }
-    if (result == null)
-    {
-      result = "";
-    }
-    return result;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value != null)
-    {
-      if (value instanceof String)
-      {
-        String newValue = (String)value;
-        if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false))
-        {  
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTEGROUP_NAME_CHANGE"), element);
-
-          // now rename any references to this element
-          if (xsdSchema != null)
-          {
-            XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-            if (comp != null && comp instanceof XSDAttributeGroupDefinition && comp.getContainer().equals(xsdSchema))
-            {
-              GlobalAttributeGroupRenamer renamer = new GlobalAttributeGroupRenamer((XSDNamedComponent)comp, (String)value);
-              renamer.visitSchema(xsdSchema);
-            }
-          }
-          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, (String)value);
-          endRecording(element);
-        }
-        else if (XSDDOMHelper.inputEquals(element, XSDConstants.UNIQUE_ELEMENT_TAG, false))
-        {
-          if (validateName(newValue))
-           {
-            beginRecording(XSDEditorPlugin.getXSDString("_UI_UNIQUE_NAME_CHANGE"), element);
-            if (newValue.length() > 0)
-            {
-              element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
-            }
-            else
-            {
-              element.setAttribute(XSDConstants.NAME_ATTRIBUTE, "");
-            }
-            endRecording(element);
-          }
-        }
-        else if (XSDDOMHelper.inputEquals(element, XSDConstants.KEY_ELEMENT_TAG, false))
-        {
-          if (validateName(newValue))
-          {
-            beginRecording(XSDEditorPlugin.getXSDString("_UI_KEY_NAME_CHANGE"), element);
-            if (newValue.length() > 0)
-            {
-              element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
-            }
-            else
-            {
-              element.setAttribute(XSDConstants.NAME_ATTRIBUTE, "");
-            }
-            endRecording(element);
-          }
-        }
-        else if (XSDDOMHelper.inputEquals(element, XSDConstants.GROUP_ELEMENT_TAG, false))
-        {
-          if (validateName(newValue))
-           {
-            beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_NAME_CHANGE"), element);
-            // now rename any references to this element
-            if (xsdSchema != null)
-             {
-              XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-              if (comp != null && comp instanceof XSDModelGroupDefinition && comp.getContainer().equals(xsdSchema))
-              {
-                GlobalGroupRenamer renamer = new GlobalGroupRenamer((XSDNamedComponent)comp, newValue);
-                renamer.visitSchema(xsdSchema);
-              }
-            }
-            element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
-            endRecording(element);
-          }
-          
-        }
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NotationPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NotationPropertySource.java
deleted file mode 100644
index 573d83d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/NotationPropertySource.java
+++ /dev/null
@@ -1,186 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-public class NotationPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  /**
-   * 
-   */
-  public NotationPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public NotationPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public NotationPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-// Removed for tabbed properties
-//    PropertyDescriptor nameDescriptor =
-//    new TextPropertyDescriptor(
-//        XSDConstants.NAME_ATTRIBUTE,
-//        XSDConstants.NAME_ATTRIBUTE);
-//    list.add(nameDescriptor);
-
-    PropertyDescriptor publicDescriptor =
-    new TextPropertyDescriptor(
-        XSDConstants.PUBLIC_ATTRIBUTE,
-        XSDConstants.PUBLIC_ATTRIBUTE);
-    list.add(publicDescriptor);
-    
-    PropertyDescriptor systemDescriptor =
-    new TextPropertyDescriptor(
-        XSDConstants.SYSTEM_ATTRIBUTE,
-        XSDConstants.SYSTEM_ATTRIBUTE);
-    list.add(systemDescriptor);
-
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-    
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      result = element.getAttribute((String) id);
-    }
-    if (result == null)
-    {
-      result = "";
-    }
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-    {
-      value = "";
-    }
-    if (value instanceof String)
-    {
-      String newValue = (String)value;
-      if (((String)id).equals(XSDConstants.NAME_ATTRIBUTE))
-      {
-        if (validateName(newValue))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_NOTATION_NAME_CHANGE"), element);
-          if (newValue.length() > 0)
-          {
-            element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
-          }
-          else
-          {
-            element.setAttribute(XSDConstants.NAME_ATTRIBUTE, "");
-          }
-          endRecording(element);
-        }
-      }
-      else if (((String)id).equals(XSDConstants.PUBLIC_ATTRIBUTE))
-       {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_NOTATION_PUBLIC_CHANGE"), element);
-        if (newValue.length() > 0)
-        {
-          element.setAttribute(XSDConstants.PUBLIC_ATTRIBUTE, newValue);
-        }
-        else
-        {
-          element.setAttribute(XSDConstants.PUBLIC_ATTRIBUTE, "");
-        }
-        endRecording(element);
-      }
-      else if (((String)id).equals(XSDConstants.SYSTEM_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_NOTATION_SYSTEM_CHANGE"), element);
-        if (newValue.length() > 0)
-        {
-          element.setAttribute(XSDConstants.SYSTEM_ATTRIBUTE, newValue);
-        }
-        else
-        {
-          element.removeAttribute(XSDConstants.SYSTEM_ATTRIBUTE);
-        }
-        endRecording(element);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/OptionsTextCellEditor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/OptionsTextCellEditor.java
deleted file mode 100644
index d61142e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/OptionsTextCellEditor.java
+++ /dev/null
@@ -1,239 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-
-public abstract class OptionsTextCellEditor extends CellEditor implements SelectionListener, KeyListener
-{
-	private Composite fEditor;
-	protected Text fText;
-  protected boolean isTextReadOnly;
-	Button moreButton;
-	Shell dialog;
-
-	protected Object fValue;
-	int selection;
-	Object typeObject;
-		
-	private class ComboCellLayout extends Layout 
-	{
-		public void layout(Composite editor, boolean force)
-		{
-			Rectangle bounds= editor.getClientArea();
-			Point size= moreButton.computeSize(SWT.DEFAULT, bounds.height, force);
-			fText.setBounds(0, 0, bounds.width - size.x, bounds.height);
-			moreButton.setBounds(bounds.width - size.x, 0, size.x, size.y);
-		}
-		
-		public Point computeSize(Composite editor, int wHint, int hHint, boolean force)
-		{
-			if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
-			{
-				return new Point(wHint, hHint);
-			}
-			Point size= fText.computeSize(SWT.DEFAULT, SWT.DEFAULT, force);
-//			size.x += moreButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, force).x;
-			return size;
-		}
-	}
-
-/**
- * Creates a new combo box cell editor with the given choices.
- */
-	 public OptionsTextCellEditor(Composite parent)
-	 {
-		 super(parent);
-	 }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.CellEditor#createControl(org.eclipse.swt.widgets.Composite)
-   */
-	protected Control createControl(Composite parent)
-	{
-		fEditor = ViewUtility.createComposite(parent, 2);
-		fEditor.setLayout(new ComboCellLayout());
- 
-    if (isTextReadOnly)
-    {
-		  fText = new Text(fEditor, SWT.LEFT | SWT.READ_ONLY);
-    }
-    else
-    {
-      fText = new Text(fEditor, SWT.LEFT);
-    }
-//    fText.setEnabled(false);
-
-		fText.setBackground(parent.getBackground());
-		fText.setText("");
-    fText.addKeyListener(this);
-		fText.addFocusListener(new FocusAdapter()
-    {
-			public void focusLost(FocusEvent e)
-      {
-				if (!moreButton.isFocusControl())
-				{
-					OptionsTextCellEditor.this.focusLost();
-				}
-			}
-		});
-			
-		moreButton = ViewUtility.createPushButton(fEditor, "...");
-		moreButton.addSelectionListener(new SelectionAdapter()
-		{
-			public void widgetSelected(SelectionEvent e)
-			{
-				// System.out.println("More Button Clicked");
-				openDialog();
-			}
-		});
-    moreButton.addKeyListener(this);
-		moreButton.addFocusListener(new FocusAdapter() {
-			public void focusLost(FocusEvent e) {
-				if (!fText.isFocusControl() && (dialog==null || 
-								dialog.isDisposed() || 
-								(dialog!=null && !dialog.isFocusControl())))
-				{
-          // System.out.println("MoreButton focusLost");
-					OptionsTextCellEditor.this.focusLost();
-				}
-			}
-		});
-
-
-		setValueValid(true);
-
-		return fEditor;
-	}
-  
-  public void activate()
-  {
-    // System.out.println("Cell editor activated");
-    fText.setText(fValue == null ? "" : fValue.toString());
-  }
-
-	protected void focusLost() {
-		// System.out.println("CELLEDITOR FOCUS LOST");
-		if (isActivated()) {
-			applyEditorValueAndDeactivate();
-		}
-	}
-
-	void applyEditorValueAndDeactivate() {
-		//	must set the selection before getting value
-//		if (dialog != null  && !dialog.isDisposed())
-//		{
-//			dialog.close();
-//			dialog.dispose();
-//		}
-		fireApplyEditorValue();
-		deactivate();
-	}
-
-  public void keyPressed(KeyEvent e)
-  {
-    if (e.character == SWT.ESC)
-     { // Escape character
-      fireCancelEditor();
-    }
-    else if ((e.character == SWT.CR) || (e.character == SWT.LF))
-     { // Return key
-      applyEditorValueAndDeactivate();
-    }
-  }
-  
-  public void keyReleased(KeyEvent e)
-  {
-    
-  }
-  
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.viewers.CellEditor#doGetValue()
-   * Returns the cell editor's value.
-	 */
-	protected Object doGetValue() 
-	{
-		return fValue;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.viewers.CellEditor#doSetFocus()
-   * Set the focus to the cell editor's UI representation.
-   */
-	protected void doSetFocus()
-	{
-//		fButton.setFocus();
-//		System.out.println("doSetFocus() " + moreButton.setFocus());
-		fText.setFocus();
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.viewers.CellEditor#doSetValue(java.lang.Object)
-	 * Sets the value of the cell editor to the given value.
-   */
-	protected void doSetValue(Object value)
-	{
-		fValue = value;
-	}
-
-  protected Point getButtonAbsoluteLocation()
-  {
-    Rectangle buttonBounds = moreButton.getBounds();
-    int x = buttonBounds.x;
-    int y = buttonBounds.y;
-    Control c = moreButton;
-    while (c != null)
-     {
-      c = c.getParent();
-      if (c == null)
-        break;
-      x += c.getBounds().x;
-      y += c.getBounds().y;
-    }
-    x += buttonBounds.width + 5;
-    y += buttonBounds.height;
-    Point p = new Point(x,y);
-    return p;
-  }
-  
-  protected void cancel()
-  {
-    dialog.close();
-    dialog.dispose();
-  }
-
-	protected abstract void openDialog();	
-  
-	public void widgetSelected(SelectionEvent e)
-	{
-	}
-	public void widgetDefaultSelected(SelectionEvent e)
-  {
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/PatternPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/PatternPropertySource.java
deleted file mode 100644
index 38f166a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/PatternPropertySource.java
+++ /dev/null
@@ -1,272 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.DialogCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.wizards.RegexWizard;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-public class PatternPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  /**
-   * 
-   */
-  public PatternPropertySource()
-  {
-    super();
-//    expressionField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_PATTERN"));    
-//    WorkbenchHelp.setHelp(expressionField, XSDEditorContextIds.XSDE_PATTERN_VALUE);
-//    WorkbenchHelp.setHelp(activateWizardButton, XSDEditorContextIds.XSDE_PATTERN_REGULAR);
-//    activateWizardButton.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_BUTTON"));
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public PatternPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public PatternPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-
-    PatternTextPropertyDescriptor patternDescriptor =
-    new PatternTextPropertyDescriptor(
-        XSDConstants.VALUE_ATTRIBUTE, 
-        XSDConstants.VALUE_ATTRIBUTE);
-    list.add(patternDescriptor);
-    
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      result = element.getAttribute((String) id);
-    }
-    if (result == null)
-    {
-      result = "";
-    }
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-    {
-      value = "";
-    }
-    if (value instanceof String)
-    {
-      if (((String) id).equals(XSDConstants.VALUE_ATTRIBUTE))
-      { 
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_PATTERN_VALUE_CHANGE"), element);
-        element.setAttribute(XSDConstants.VALUE_ATTRIBUTE, (String)value);
-        endRecording(element);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-
-  public class PatternTextPropertyDescriptor extends PropertyDescriptor
-  {
-    /**
-     * @param id
-     * @param displayName
-     */
-    public PatternTextPropertyDescriptor(Object id, String displayName)
-    {
-      super(id, displayName);
-    }
-    
-    public CellEditor createPropertyEditor(Composite parent)
-    {
-      // CellEditor editor = new PatternTextCellEditor(parent);
-      CellEditor editor = new PatternDialogCellEditor(parent);
-      if (getValidator() != null)
-        editor.setValidator(getValidator());
-      return editor;
-    }
-  }   
-
-  public class PatternDialogCellEditor extends DialogCellEditor {
-
-    /**
-     * Creates a new Font dialog cell editor parented under the given control.
-     * The cell editor value is <code>null</code> initially, and has no 
-     * validator.
-     *
-     * @param parent the parent control
-     */
-    protected PatternDialogCellEditor(Composite parent) {
-      super(parent);
-    }
-
-    /**
-     * @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(Control)
-     */
-    protected Object openDialogBox(Control cellEditorWindow)
-    {
-      String initialValue = element.getAttribute(XSDConstants.VALUE_ATTRIBUTE);
-      if (initialValue == null)
-      {
-        initialValue = "";
-      }
-      RegexWizard wizard = new RegexWizard(initialValue);
-      Shell shell = Display.getCurrent().getActiveShell();
-      WizardDialog wizardDialog = new WizardDialog(shell, wizard);
-      wizardDialog.create();
-      
-      String value = (String)getValue();
-
-      int result = wizardDialog.open();
-
-      if (result == Window.OK)
-      {
-        return wizard.getPattern();
-      }
-      return value;
-    }
-
-  }
-  
-//  class PatternTextCellEditor extends OptionsTextCellEditor
-//  {
-//    protected Button fixedButton, defaultButton;
-//    
-//    public PatternTextCellEditor(Composite parent)
-//    {
-//      super(parent);
-//    }
-//
-//    protected Control createControl(Composite parent)
-//    {
-//      isTextReadOnly = false;
-//      return super.createControl(parent);
-//    }
-//
-//    protected void openDialog()
-//    {
-//      RegexWizard wizard = new RegexWizard(element.getAttribute(XSDConstants.VALUE_ATTRIBUTE));
-//      Shell shell = Display.getCurrent().getActiveShell();
-//      WizardDialog wizardDialog = new WizardDialog(shell, wizard);
-//      wizardDialog.create();
-//      
-//      dialog = wizardDialog.getShell();
-//      Display display = dialog.getDisplay();
-//      dialog.addShellListener(new ShellAdapter()
-//      {
-//        public void shellDeactivated(ShellEvent e)
-//        {
-//          cancel();
-//        }
-//      });
-//
-//      int result = wizardDialog.open();
-//
-//      if (result == Window.OK)
-//      {
-//        fText.setText(wizard.getPattern());
-//        applyEditorValueAndDeactivate();
-//      }
-//      
-//    }
-//
-//    protected void cancel()
-//    {
-//      super.cancel();
-//    }
-//
-//    void applyEditorValueAndDeactivate()
-//    {
-//      String value = fText.getText();
-//      doSetValue(value);
-//      fireApplyEditorValue();
-//      deactivate();
-//    }
-//    
-//    protected Object doGetValue()
-//    { 
-//      fValue = fText.getText();
-//      return fText.getText();
-//    }
-//
-//  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ReadOnlyPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ReadOnlyPropertySource.java
deleted file mode 100644
index 0f5cb7f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/ReadOnlyPropertySource.java
+++ /dev/null
@@ -1,76 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-public class ReadOnlyPropertySource implements IPropertySource
-{
-	protected Element element;
-
-	public ReadOnlyPropertySource(IEditorPart editPart, Element element)
-	{
-			this.element = element;
-	}
-
-	public Object getEditableValue()
-	{
-			return null;
-	}
-
-	public IPropertyDescriptor[] getPropertyDescriptors()
-	{
-			List list = new ArrayList();
-			NamedNodeMap map = element.getAttributes();
-			int mapLength = map.getLength();
-			for (int i = 0; i < mapLength; i++)
-			{
-					Attr attr = (Attr) map.item(i);
-					list.add(new PropertyDescriptor(attr.getName(), attr.getName()));
-			}
-			IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-			list.toArray(result);
-			return result;
-	}
-
-	public Object getPropertyValue(Object id)
-	{
-			Object result = null;
-			if (id instanceof String)
-			{
-					result = element.getAttribute((String) id);
-			}
-			return result != null ? result : "";
-	}
-
-	public boolean isPropertySet(Object id)
-	{
-			return false;
-	}
-
-	public void resetPropertyValue(Object id)
-	{
-	}
-
-	public void setPropertyValue(Object id, Object value)
-	{
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaDirectiveHelperPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaDirectiveHelperPropertySource.java
deleted file mode 100644
index 43780f8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaDirectiveHelperPropertySource.java
+++ /dev/null
@@ -1,191 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.DialogCellEditor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.navigator.ResourceNavigator;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.wizards.XSDSelectIncludeFileWizard;
-import org.eclipse.xsd.XSDSchema;
-
-public abstract class SchemaDirectiveHelperPropertySource
-  extends BasePropertySource
-{
-  protected IFile currentIFile;
-
-  IFile selectedIFile;
-  String selectedNamespace;
-  XSDSchema selectedXSDSchema;
-  boolean isInclude;
-  /**
-   * 
-   */
-  public SchemaDirectiveHelperPropertySource(boolean isInclude)
-  {
-    super();
-    this.isInclude = isInclude;
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public SchemaDirectiveHelperPropertySource(
-    Viewer viewer,
-    XSDSchema xsdSchema,
-    boolean isInclude)
-  {
-    super(viewer, xsdSchema);
-    this.isInclude = isInclude;
-  }
-  /**
-   * @param xsdSchema
-   */
-  public SchemaDirectiveHelperPropertySource(XSDSchema xsdSchema, boolean isInclude)
-  {
-    super(xsdSchema);
-    this.isInclude = isInclude;
-  }
-
-  
-  public class SchemaLocationPropertyDescriptor extends PropertyDescriptor
-  {
-    /**
-     * @param id
-     * @param displayName
-     */
-    public SchemaLocationPropertyDescriptor(Object id, String displayName)
-    {
-      super(id, displayName);
-    }
-    
-    public CellEditor createPropertyEditor(Composite parent)
-    {
-      CellEditor editor = new SchemaLocationDialogCellEditor(parent);
-      if (getValidator() != null)
-        editor.setValidator(getValidator());
-      return editor;
-    }
-  }
-
-  public class SchemaLocationDialogCellEditor extends DialogCellEditor {
-
-    /**
-     * Creates a new Font dialog cell editor parented under the given control.
-     * The cell editor value is <code>null</code> initially, and has no 
-     * validator.
-     *
-     * @param parent the parent control
-     */
-    protected SchemaLocationDialogCellEditor(Composite parent) {
-      super(parent);
-    }
-
-    /**
-     * @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(Control)
-     */
-    protected Object openDialogBox(Control cellEditorWindow)
-    {
-      Shell shell = Display.getCurrent().getActiveShell();
-      
-//      oldSchemaLocation = locationField.getText().trim();
-//      IFile currentIFile = ((IFileEditorInput)getIEditorPart().getEditorInput()).getFile();
-      ViewerFilter filter = new ResourceFilter(new String[] { ".xsd" }, 
-      new IFile[] { currentIFile },
-      null);
-//
-
-      IViewPart viewParts[] = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViews();
-      ResourceNavigator resourceNav = null;
-      for (int i = 0; i < viewParts.length; i++) 
-       {
-        if (viewParts[i] instanceof ResourceNavigator) 
-         {
-          resourceNav = (ResourceNavigator) viewParts[i];
-          break;
-        }
-      }
-      IStructuredSelection selection = StructuredSelection.EMPTY;
-      if (resourceNav != null)
-       {
-        selection = (IStructuredSelection)resourceNav.getViewSite().getSelectionProvider().getSelection();
-      }
-      
-      XSDSelectIncludeFileWizard fileSelectWizard = 
-      new XSDSelectIncludeFileWizard(xsdSchema, isInclude,
-          XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_SCHEMA"),
-          XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_DESC"),
-          filter,
-          selection);
-
-      WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
-      wizardDialog.create();
-      wizardDialog.setBlockOnOpen(true);
-      int result = wizardDialog.open();
-
-      
-      String value = (String)getValue();
-      // System.out.println("VALUE IS *** = " + value);
-      if (result == Window.OK)
-      {
-        selectedIFile = fileSelectWizard.getResultFile();
-        String schemaFileString = value;
-        if (selectedIFile != null) 
-         {
-          schemaFileString = URIHelper.getRelativeURI(selectedIFile.getLocation(), currentIFile.getLocation());
-        }
-        else
-         {
-          schemaFileString = fileSelectWizard.getURL();
-        }
-
-//        updateExternalModel(selectedIFile, fileSelectWizard.getNamespace(), fileSelectWizard.getExternalSchema());
-        selectedNamespace = fileSelectWizard.getNamespace();
-        selectedXSDSchema = fileSelectWizard.getExternalSchema();
-        
-        return schemaFileString;
-      }
-      return value;
-    }
-  }
-
-  public IFile getSelectedIFile()
-  {
-    return selectedIFile;
-  }
-  
-  public String getSelectedNamespace()
-  {
-    return selectedNamespace;
-  }
-  
-  public XSDSchema getSelectedXSDSchema()
-  {
-    return selectedXSDSchema;
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaPropertySource.java
deleted file mode 100644
index 2d8b402..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SchemaPropertySource.java
+++ /dev/null
@@ -1,520 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.TargetNamespaceChangeHandler;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaHelper;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class SchemaPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  private String oldPrefix = "";
-  private String oldNamespace = "";
-  
-  private String[] attributeFormDefaultComboValues =
-  { 
-    "",
-    XSDEditorPlugin.getXSDString("_UI_COMBO_UNQUALIFIED"),
-    XSDEditorPlugin.getXSDString("_UI_COMBO_QUALIFIED")
-  };
-  
-  private String[] elementFormDefaultComboValues =
-  {
-    "",
-    XSDEditorPlugin.getXSDString("_UI_COMBO_UNQUALIFIED"),
-    XSDEditorPlugin.getXSDString("_UI_COMBO_QUALIFIED")
-  };
-
-  private String[] blockDefaultComboValues =
-  {
-    "",
-    "#all",
-    "extension",
-    "restriction",
-    "substitution"
-  };
-
-  private String[] finalDefaultComboValues =
-  {
-    "",
-    "#all",
-    "extension",
-    "restriction"
-  };
-  
-  /**
-   * 
-   */
-  public SchemaPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public SchemaPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public SchemaPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-// These have been moved to the General tab    
-//    PropertyDescriptor prefixDescriptor = 
-//    new TextPropertyDescriptor(
-//        "prefix",
-//        "prefix");
-//    list.add(prefixDescriptor);
-//    prefixDescriptor.setCategory("Namespace");
-//
-//    PropertyDescriptor targetNamespaceDescriptor = 
-//    new TextPropertyDescriptor(
-//        XSDConstants.TARGETNAMESPACE_ATTRIBUTE,
-//        XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
-//    list.add(targetNamespaceDescriptor);
-//    targetNamespaceDescriptor.setCategory("Namespace");
-    
-    PropertyDescriptor versionDescriptor = 
-    new TextPropertyDescriptor(
-        XSDConstants.VERSION_ATTRIBUTE,
-        XSDConstants.VERSION_ATTRIBUTE);
-//    versionDescriptor.setDescription("Version attribute"); // XSDEditorPlugin.getXSDString("_UI_TOOLTIP_VERSION"));
-    list.add(versionDescriptor);
-    PropertyDescriptor xmlLangDescriptor = 
-    new TextPropertyDescriptor(
-        "xml:lang",
-        "xml:lang");
-    list.add(xmlLangDescriptor);
-    
-    XSDComboBoxPropertyDescriptor attributeFormDefaultDescriptor =
-    new XSDComboBoxPropertyDescriptor(
-        XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE,
-        XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE,
-        attributeFormDefaultComboValues);
-    list.add(attributeFormDefaultDescriptor);
-    
-    
-    XSDComboBoxPropertyDescriptor elementFormDefaultDescriptor =
-    new XSDComboBoxPropertyDescriptor(
-        XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE,
-        XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE,
-        elementFormDefaultComboValues);
-    list.add(elementFormDefaultDescriptor);
-    
-    XSDComboBoxPropertyDescriptor blockDefaultDescriptor =
-    new XSDComboBoxPropertyDescriptor(
-        XSDConstants.BLOCKDEFAULT_ATTRIBUTE,
-        XSDConstants.BLOCKDEFAULT_ATTRIBUTE,
-        blockDefaultComboValues);
-    list.add(blockDefaultDescriptor);
-    XSDComboBoxPropertyDescriptor finalDefaultDescriptor =
-    new XSDComboBoxPropertyDescriptor(
-        XSDConstants.FINALDEFAULT_ATTRIBUTE,
-        XSDConstants.FINALDEFAULT_ATTRIBUTE,
-        finalDefaultComboValues);
-    list.add(finalDefaultDescriptor);
-
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-    //    return propertyDescriptors;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      result = element.getAttribute((String) id);
-      String attributeName = (String)id;
-      if (result == null)
-      {
-        result = "";
-      }
-
-      if (attributeName.equals("prefix"))
-      {
-        TypesHelper helper = new TypesHelper(xsdSchema);
-        String aPrefix = helper.getPrefix(element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE), false);
-        // System.out.println("schema targetNS is " + xsdSchema.getTargetNamespace());
-        if (aPrefix != null && aPrefix.length() > 0)
-        {
-          return aPrefix;
-        }
-        return "";        
-      }
-      else
-      {
-        return result;
-      }
-    }
-    return "";
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-    {
-      value = "";
-    }
-    if (value instanceof String)
-    {
-      String newValue = (String)value;
-      String attributeName = (String)id;
-      if (attributeName.equals("prefix"))
-      {
-        updatePrefix(newValue); 
-      }
-      else if (attributeName.equals(XSDConstants.TARGETNAMESPACE_ATTRIBUTE))
-      {
-        updateTargetNamespace(newValue);
-      }
-      else if (attributeName.equals("xml:lang"))
-      {
-        validateLanguage(newValue);
-        // return;  // we will accept the value even though it does not conform
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_SCHEMA_LANG_CHANGE"), element);
-      }
-      else if (attributeName.equals(XSDConstants.VERSION_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_SCHEMA_VERSION_CHANGE"), element);
-      }
-      else if (attributeName.equals(XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_SCHEMA_ATTRIBUTEFORMDEFAULT_CHANGE"), element);
-      }
-      else if (attributeName.equals(XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_SCHEMA_ELEMENTFORMDEFAULT_CHANGE"), element); 
-      }
-      else if (attributeName.equals(XSDConstants.BLOCKDEFAULT_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_SCHEMA_BLOCKDEFAULT_CHANGE"), element); 
-      }
-      else if (attributeName.equals(XSDConstants.FINALDEFAULT_ATTRIBUTE))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_SCHEMA_FINALDEFAULT_CHANGE"), element);
-      }
-
-      if (!attributeName.equals("prefix") && !attributeName.equals(XSDConstants.TARGETNAMESPACE_ATTRIBUTE))
-      {        
-        if (newValue.equals(""))
-        {
-          element.removeAttribute(attributeName); 
-        }
-        else
-        {
-          element.setAttribute(attributeName, newValue);
-        }
-        endRecording(element);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-        viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-
-  public void setInput(Element element)
-  {
-    super.setInput(element);
-    
-    oldNamespace = "";
-    oldPrefix = "";
-    
-    if (element!= null)
-    {
-      String targetNamespace = element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
-      oldNamespace = targetNamespace;
-
-      TypesHelper helper = new TypesHelper(xsdSchema);
-      String aPrefix = helper.getPrefix(targetNamespace, false);
-      if (aPrefix != null && aPrefix.length() > 0)
-      {
-        oldPrefix = aPrefix;
-      }
-    }
-  }
-  
-  
-  private void updatePrefix(String newPrefix)
-  {
-    updateNamespaceInfo(newPrefix, oldNamespace);  
-  }
-  
-  private void updateTargetNamespace(String newTargetNamespace)
-  {
-    updateNamespaceInfo(oldPrefix, newTargetNamespace);
-  }
-  
-  private void updateNamespaceInfo(String newPrefix, String newTargetNamespace)
-  {
-//    System.out.println("\nold Prefix is " + oldPrefix);
-//    System.out.println("old NS is " + oldNamespace);
-//    System.out.println("new Prefix is " + newPrefix);
-//    System.out.println("new NS is " + newTargetNamespace);
-    
-    DocumentImpl doc = (DocumentImpl)element.getOwnerDocument();
-
-    String modelTargetNamespace = xsdSchema.getTargetNamespace();
-//    System.out.println("Model TargetNS is " + modelTargetNamespace);
-    if (modelTargetNamespace == null)
-    {
-      modelTargetNamespace = "";
-    }
-        
-    String targetNamespace = newTargetNamespace.trim(); 
-    String prefix = newPrefix.trim();
-
-    if (!validatePrefix(prefix) || !validateTargetNamespace(targetNamespace))
-    {
-      return;
-    }
-        
-    if (prefix.length() > 0 && targetNamespace.length() == 0)
-    {
-       // can't have blank targetnamespace and yet specify a prefix
-       return;
-    }
-
-    doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_LABEL_TARGETNAMESPACE_CHANGE"));
-    String xsdForXSDPrefix = xsdSchema.getSchemaForSchemaQNamePrefix();
-    Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-
-// For debugging
-//        System.out.println("1. SW Map is " + map.values());
-//        System.out.println("1. SW Map keys are " + map.keySet());
-
-    // Check if prefix is blank
-    // if it is, then make sure we have a prefix 
-    // for schema for schema
-    if (prefix.length() == 0)
-    {
-      // if prefix for schema for schema is blank
-      // then set it to value specified in preference
-      // and update ALL nodes with this prefix
-      if (xsdForXSDPrefix == null || (xsdForXSDPrefix != null && xsdForXSDPrefix.trim().length() == 0))
-      {
-        // get preference prefix
-        xsdForXSDPrefix = XSDEditorPlugin.getPlugin().getXMLSchemaPrefix();
-        // get a unique prefix by checking what's in the map
-
-        xsdForXSDPrefix = getUniqueSchemaForSchemaPrefix(xsdForXSDPrefix, map);
-        element.setAttribute("xmlns:" + xsdForXSDPrefix, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
-
-        updateAllNodes(element, xsdForXSDPrefix);
-            
-        // remove the old xmlns attribute for the schema for schema
-        if (element.getAttribute("xmlns") != null &&
-            element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
-        {
-          element.removeAttribute("xmlns");
-        }
-      }
-    }
-
-    if (targetNamespace.length() > 0 ||
-       (targetNamespace.length() == 0 && prefix.length() == 0))
-    {
-      // clean up the old prefix for this schema
-      if (oldPrefix != null && oldPrefix.length() > 0)
-      {
-        element.removeAttribute("xmlns:"+oldPrefix);
-//            element.setAttribute("xmlns:" + prefix, targetNamespace);
-//            java.util.Map prefixToNameSpaceMap = xsdSchema.getQNamePrefixToNamespaceMap();
-//            prefixToNameSpaceMap.remove(oldPrefix);
-      }
-      else // if no prefix
-      {
-        if (element.getAttribute("xmlns") != null)
-        {
-          if (!element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
-           {
-            element.removeAttribute("xmlns");
-          }
-        }
-      }
-    }
-
-    if (targetNamespace.length() > 0)
-    {
-      if (!modelTargetNamespace.equals(targetNamespace))
-      {
-        element.setAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE, targetNamespace);
-      }
-      // now set the new xmlns:prefix attribute
-      if (prefix.length() > 0)
-      {
-        element.setAttribute("xmlns:" + prefix, targetNamespace);
-      }
-      else
-      {
-        element.setAttribute("xmlns", targetNamespace);
-      }
-      // set the targetNamespace attribute
-    }
-    else // else targetNamespace is blank
-    {
-      if (prefix.length() == 0)
-      {
-        element.removeAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
-      }
-    }
-
-//    System.out.println("1.5 SW Map is " + map.values());
-//    System.out.println("1.5 SW Map keys are " + map.keySet());
-    
-    // do our own referential integrity
-    TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, oldNamespace, targetNamespace);
-    targetNamespaceChangeHandler.resolve();
-
-    oldPrefix = prefix;
-    oldNamespace = targetNamespace;
-    
-    XSDSchemaHelper.updateElement(xsdSchema);
-    
-    doc.getModel().endRecording(this);
-
-// For debugging
-        map = xsdSchema.getQNamePrefixToNamespaceMap();
-//        System.out.println("2. SW Map is " + map.values());
-//        System.out.println("2. SW Map keys are " + map.keySet());
-  }
-
-
-  private String getUniqueSchemaForSchemaPrefix(String xsdForXSDPrefix, Map map)
-  {
-    if (xsdForXSDPrefix == null || (xsdForXSDPrefix != null && xsdForXSDPrefix.trim().length() == 0))
-     {       
-      xsdForXSDPrefix = "xsd";
-    }
-    // ensure prefix is unique
-    int prefixExtension = 1;
-    while (map.containsKey(xsdForXSDPrefix) && prefixExtension < 100)
-     {
-      xsdForXSDPrefix = xsdForXSDPrefix + String.valueOf(prefixExtension);
-      prefixExtension++;
-    }
-    return xsdForXSDPrefix;
-  }
-
-  private void updateAllNodes(Element element, String prefix)
-  {
-    element.setPrefix(prefix);
-    NodeList list = element.getChildNodes();
-    if (list != null)
-    {
-      for (int i=0; i < list.getLength(); i++)
-      {
-        Node child = list.item(i);
-        if (child != null && child instanceof Element)
-        {
-          child.setPrefix(prefix);
-          if (child.hasChildNodes())
-          {
-            updateAllNodes((Element)child, prefix);
-          }
-        }
-      }
-    }   
-  }
-
-  protected boolean validateTargetNamespace(String ns)
-  {
-    // will allow blank namespace !!
-    if (ns.equals(""))
-     {
-      return true;
-    }
-    
-    String errorMessage = null;
-    try
-    {
-      URI testURI = new URI(ns);
-      testURI.isAbsolute();
-    }
-    catch (URISyntaxException e)
-    {
-      errorMessage = XSDEditorPlugin.getXSDString("_WARN_INVALID_TARGET_NAMESPACE");
-    }
-    
-    if (errorMessage == null || errorMessage.length() == 0)
-     {
-      return true;
-    }
-    return false;
-  }
-  
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertyDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertyDescriptor.java
deleted file mode 100644
index 1948146..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertyDescriptor.java
+++ /dev/null
@@ -1,209 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xsd.ui.internal.properties.section.SimpleContentBaseTypeOptionsDialog;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-
-public class SimpleContentPropertyDescriptor extends TypesPropertyDescriptor
-{
-  public SimpleContentPropertyDescriptor(Object id, String displayName, Element element, XSDSchema xsdSchema)
-  {
-    super(id, displayName, element, xsdSchema);
-  }
-  
-  public CellEditor createPropertyEditor(Composite parent)
-  {
-    // CellEditor editor = new SimpleContentBaseTypeOptionsTextCellEditor(parent);
-    CellEditor editor = new SimpleContentBaseTypeDialogCellEditor(parent);
-    if (getValidator() != null)
-      editor.setValidator(getValidator());
-    return editor;
-  }
-  
-  public class SimpleContentBaseTypeDialogCellEditor extends TypesDialogCellEditor
-  {
-
-    /**
-     * Creates a new Font dialog cell editor parented under the given control.
-     * The cell editor value is <code>null</code> initially, and has no 
-     * validator.
-     *
-     * @param parent the parent control
-     */
-    protected SimpleContentBaseTypeDialogCellEditor(Composite parent)
-    {
-      super(parent);
-    }
-
-    protected Object openDialogBox(Control cellEditorWindow)
-    {
-	    Shell shell = Display.getCurrent().getActiveShell();
-	    
-	    // SimpleContentBaseTypeOptionsDialog dialog = new SimpleContentBaseTypeOptionsDialog(shell);
-	    SimpleContentBaseTypeOptionsDialog dialog = new SimpleContentBaseTypeOptionsDialog(shell, element, property, xsdSchema);
-
-	    dialog.setBlockOnOpen(true);
-	    dialog.create();
-	    
-	    String value = (String)getValue();
-	
-	    int result = dialog.open();
-	
-	    if (result == Window.OK)
-	    {
-	      value = dialog.getType();
-	      return value;
-	    }
-	    deactivate();
-	    return value;
-	  }
-  }
-
-//  class SimpleContentBaseTypeOptionsDialog extends TypesDialog
-//  {
-//    public SimpleContentBaseTypeOptionsDialog(Shell shell)
-//    {
-//      super(shell);
-//      showAnonymous = false;
-//    }
-//
-////    protected void ok()
-////    {
-////      TableItem[] items = table.getItems();
-////      selection = table.getSelectionIndex();
-////      if (items != null && items.length > 0 && selection >= 0)
-////       {
-////        typeObject = items[selection].getData();
-////      }
-////      System.out.println("typeObject is " + typeObject);
-////
-////      doSetValue(typeObject);
-////      applyEditorValueAndDeactivate();
-////      dialog.close();
-////    }
-//    
-//    public void handleSetInput()
-//    {
-//      XSDDOMHelper domHelper = new XSDDOMHelper();
-//      typeSection.getSimpleType().setSelection(false);
-//      typeSection.getUserSimpleType().setSelection(false);
-//      typeSection.getUserComplexType().setSelection(false);
-//      showAnonymous = false;
-//      if (element != null)
-//      {
-//        String derivedBy = domHelper.getDerivedByName(element);
-//        String baseType = domHelper.getBaseType(element);
-//        boolean derivedByRestriction = true;
-//        
-//        if (XSDDOMHelper.inputEquals(element, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-//        {
-//          typeSection.getSimpleType().setEnabled(false);
-//          typeSection.getUserSimpleType().setEnabled(false);
-//          typeSection.getUserComplexType().setSelection(true);
-//
-//          previousType = 3;
-//        }
-//        else if (XSDDOMHelper.inputEquals(element, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-//        {
-//          typeSection.getSimpleType().setEnabled(false);
-//          typeSection.getUserSimpleType().setEnabled(false);
-//
-//          if (derivedBy.equals("restriction"))
-//          {
-//            typeSection.getSimpleType().setEnabled(false);
-//            typeSection.getUserSimpleType().setEnabled(false);
-//            typeSection.getUserComplexType().setEnabled(true);
-//          }
-//          else if (derivedBy.equals("extension"))
-//          {
-//            derivedByRestriction = false;
-//            typeSection.getSimpleType().setEnabled(true);
-//            typeSection.getUserSimpleType().setEnabled(true);
-//            typeSection.getUserComplexType().setEnabled(true);
-//          }
-//        }
-//          
-//        if (derivedBy != null)
-//        {
-//            if (baseType != null && !baseType.equals(""))
-//            {
-//              Element parent = (Element)element.getParentNode();
-//              XSDConcreteComponent component = null;
-//              if (parent != null)
-//              {
-//                component = xsdSchema.getCorrespondingComponent(parent);
-//              }
-//              XSDTypeDefinition baseTypeDefinition = null;
-//              if (component instanceof XSDComplexTypeDefinition)
-//              {
-//                XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition)component;
-//                baseTypeDefinition = complexType.getBaseTypeDefinition();
-//              }               
-//
-//              if (typeSection.getBuiltInTypeNamesList(xsdSchema).contains(baseType) && !derivedByRestriction)
-//              {
-//                typeSection.getSimpleType().setSelection(true);
-//                populateBuiltInType();
-//                int i = typeSection.getBuiltInTypeNamesList(xsdSchema).indexOf(baseType);
-//                table.setSelection(i);
-//                previousType = 1;
-//              }
-//              else if (baseTypeDefinition instanceof XSDSimpleTypeDefinition && !derivedByRestriction)
-//              {
-//                typeSection.getUserSimpleType().setSelection(true);
-//                populateUserSimpleType();
-//                int i = typeSection.getUserSimpleTypeNamesList(xsdSchema).indexOf(baseType);
-//                if (showAnonymous)
-//                 {
-//                  table.setSelection(i + 1);
-//                }
-//                else
-//                 {
-//                  table.setSelection(i);
-//                }
-//                previousType = 2;
-//              }
-//              else if (baseTypeDefinition instanceof XSDComplexTypeDefinition)
-//              {
-//                typeSection.getUserComplexType().setSelection(true);
-//                populateUserComplexType();
-//                int i = typeSection.getUserComplexTypeNamesList(xsdSchema).indexOf(baseType);
-//                if (showAnonymous)
-//                 {
-//                  table.setSelection(i + 1);
-//                }
-//                else
-//                 {
-//                  table.setSelection(i);
-//                }
-//                previousType = 3;
-//              }
-//            }
-//            else
-//            {
-//              typeSection.getUserComplexType().setSelection(true);
-//              populateUserComplexType();
-//              table.setSelection(0);
-//            }
-//          }
-//
-//      }
-//    }
-//  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertySource.java
deleted file mode 100644
index 6b33262..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleContentPropertySource.java
+++ /dev/null
@@ -1,226 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class SimpleContentPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  private String DERIVED_BY_ID = "derived by";  // XSDEditorPlugin.getXSDString("_UI_LABEL_DERIVED_BY"); //$NON-NLS-1$ 
-  private String BASE_TYPE_ID = "base";  // XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE"); //$NON-NLS-1$
-  
-  private String derivedByChoicesComboValues[] =
-  {
-     "",  //$NON-NLS-1$
-     XSDConstants.RESTRICTION_ELEMENT_TAG,
-     XSDConstants.EXTENSION_ELEMENT_TAG
-  };
-  
-  /**
-   * 
-   */
-  public SimpleContentPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public SimpleContentPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public SimpleContentPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    
-    SimpleContentPropertyDescriptor typeDescriptor = new SimpleContentPropertyDescriptor(
-        BASE_TYPE_ID,
-        BASE_TYPE_ID,
-        element, xsdSchema);
-    list.add(typeDescriptor);
-    XSDComboBoxPropertyDescriptor derivedByDescriptor =
-    new XSDComboBoxPropertyDescriptor(
-        DERIVED_BY_ID,
-        DERIVED_BY_ID,
-        derivedByChoicesComboValues);
-    list.add(derivedByDescriptor);
-    
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    if (id instanceof String)
-     {
-      if (((String) id).equals(DERIVED_BY_ID))
-      {
-        String derivedBy = getDomHelper().getDerivedByName(element);
-        if (derivedBy == null)
-         {
-          derivedBy = ""; //$NON-NLS-1$
-        }
-        return derivedBy;
-      }
-      else if (((String) id).equals(BASE_TYPE_ID))
-      {
-        String baseType = getDomHelper().getBaseType(element);
-        if (baseType == null)
-        {
-          baseType = ""; //$NON-NLS-1$
-        }
-        return baseType;
-      }
-    }
-    return ""; //$NON-NLS-1$
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value != null)
-    {
-      if (value instanceof String)
-      {
-        String origBaseType = getDomHelper().getBaseType(element);
-        String derivedBy = getDomHelper().getDerivedByName(element);
-        
-        if (((String) id).equals(BASE_TYPE_ID))
-        {            
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element); //$NON-NLS-1$        
-          getDomHelper().setDerivedByBaseType(element, derivedBy, (String)value);
-          endRecording(element);
-        }
-        else if (((String) id).equals(DERIVED_BY_ID))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_DERIVEDBY_CHANGE"), element); //$NON-NLS-1$
-          String newDerivedBy = (String)value;
-          if (newDerivedBy.equals(XSDConstants.RESTRICTION_ELEMENT_TAG))
-          {
-            String prefix = element.getPrefix();
-            String anyType = prefix == null? "anyType" : prefix + ":anyType";  //$NON-NLS-1$ $NON-NLS-2$
-            getDomHelper().changeDerivedByType(element, (String)value, anyType);
-          }
-          else
-          {
-            Element derivedByElem = getDomHelper().getDerivedByElement(element);
-            if (checkForAnonymousType(derivedByElem))
-            {            
-// KCPort
-//            ArrayList message = new ArrayList();
-//            ErrorMessage aTask = new ErrorMessage();
-//            Node aNode = getDomHelper().getChildNode(derivedByElem, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-////////////// shall we remove the node and its children??
-////            getDomHelper().removeNodeAndWhitespace(aNode);
-//////////////
-////            if (aNode instanceof Element)
-////            {
-////              Element st = (Element)aNode;
-////             if (st instanceof NodeImpl)
-////              {
-////                aTask.setNode((NodeImpl)st);
-////              }
-////            }
-//            if (derivedByElem instanceof NodeImpl)
-//            {
-//              aTask.setModelObject(derivedByElem);
-//            }
-//            aTask.setLocalizedMessage(XSDEditorPlugin.getXSDString("_ERROR_REMOVE_LOCAL_SIMPLETYPE"));
-//            message.add(aTask);
-//            if (getEditor() != null)
-//            {
-//              getEditor().createTasksInTaskList(message);
-//            }
-            }   
-            getDomHelper().changeDerivedByType(element, (String)value, origBaseType);
-          }
-
-          
-          endRecording(element);
-//        setInput(element);
-        }
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-  }
-
-  boolean checkForAnonymousType(Element element)
-  {
-    boolean isAnonymous = false;
-
-    Node aNode = getDomHelper().getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-    if (aNode != null)
-     {
-      return true;
-    }
-    return isAnonymous;
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleRestrictPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleRestrictPropertySource.java
deleted file mode 100644
index 4d07c0b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleRestrictPropertySource.java
+++ /dev/null
@@ -1,328 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDFacet;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.impl.XSDFactoryImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class SimpleRestrictPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  private String [] whiteSpaceComboChoices = { "", "preserve", "replace", "collapse" };
-  /**
-   * 
-   */
-  public SimpleRestrictPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public SimpleRestrictPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public SimpleRestrictPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    
-    SimpleContentPropertyDescriptor typeDescriptor = new SimpleContentPropertyDescriptor(
-        XSDConstants.BASE_ATTRIBUTE,
-        XSDConstants.BASE_ATTRIBUTE,
-        (Element)element.getParentNode(), xsdSchema);  // get the parent node!
-    list.add(typeDescriptor);
-    
-    Iterator facets = xsdSimpleType.getValidFacets().iterator();
-    
-    while(facets.hasNext())
-    {
-      String aValidFacet = (String)facets.next();
-      if (!(aValidFacet.equals(XSDConstants.PATTERN_ELEMENT_TAG) || aValidFacet.equals(XSDConstants.ENUMERATION_ELEMENT_TAG)))
-      {
-        if (aValidFacet.equals(XSDConstants.WHITESPACE_ELEMENT_TAG))
-        {
-          XSDComboBoxPropertyDescriptor whitespaceDescriptor = new XSDComboBoxPropertyDescriptor(
-              aValidFacet, aValidFacet, whiteSpaceComboChoices);
-          list.add(whitespaceDescriptor);
-        }
-        else
-        {  
-          list.add(new TextPropertyDescriptor(aValidFacet, aValidFacet));
-        }
-      }
-    }
-    
-    
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      if (((String) id).equals(XSDConstants.BASE_ATTRIBUTE))
-      {
-        String baseType = element.getAttribute(XSDConstants.BASE_ATTRIBUTE);
-        if (baseType == null)
-        {
-          baseType = "";
-        }
-        return baseType;
-      }
-      else
-      {
-        String aFacet = (String)id;
-        Iterator facets = xsdSimpleType.getFacets().iterator();
-        
-        while(facets.hasNext())
-        {
-          XSDFacet aValidFacet = (XSDFacet)facets.next();
-          if (aValidFacet.getFacetName().equals(aFacet))
-          {
-            result = aValidFacet.getLexicalValue();
-            if (result == null)
-            {
-              result = "";
-            }
-            return result;
-          }
-        }
-      }
-    }
-    return "";
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value != null)
-     {
-      if (value instanceof String)
-      {
-        String newValue = (String)value;
-        
-        if (((String) id).equals(XSDConstants.BASE_ATTRIBUTE))
-        {            
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element);        
-
-          Element parent = (Element)element.getParentNode();
-          if (XSDDOMHelper.inputEquals(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-          {
-//            updateElementToNotAnonymous(element);
-          }
-          getDomHelper().setSimpleContentType(element, newValue);
-          endRecording(element);
-        }
-        else
-        {
-          Element simpleTypeElement = xsdSimpleType.getElement();
-          XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
-          Element derivedByElement = xsdDOMHelper.getDerivedByElement(simpleTypeElement);
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_FACET_CHANGE"), simpleTypeElement);
-          String prefix = simpleTypeElement.getPrefix();
-          prefix = (prefix == null) ? "" : (prefix + ":");
-
-          String aFacet = (String)id;
-          XSDFactoryImpl factory = new XSDFactoryImpl();
-
-          Element childNodeElement = null;
-          DOMAttribute valueAttr = null;
-          XSDFacet facet = null;
-          if (aFacet.equals(XSDConstants.TOTALDIGITS_ELEMENT_TAG))
-          {
-            facet = xsdSimpleType.getTotalDigitsFacet();
-          }
-          else if (aFacet.equals(XSDConstants.FRACTIONDIGITS_ELEMENT_TAG))
-          {
-            facet = xsdSimpleType.getFractionDigitsFacet();
-          }
-          else if (aFacet.equals(XSDConstants.WHITESPACE_ELEMENT_TAG))
-          {
-            facet = xsdSimpleType.getWhiteSpaceFacet();
-          }
-          else if (aFacet.equals(XSDConstants.MAXEXCLUSIVE_ELEMENT_TAG))
-          {
-            facet = xsdSimpleType.getMaxExclusiveFacet();
-          }
-          else if (aFacet.equals(XSDConstants.MAXINCLUSIVE_ELEMENT_TAG))
-          {
-            facet = xsdSimpleType.getMaxInclusiveFacet();
-          }
-          else if (aFacet.equals(XSDConstants.MINEXCLUSIVE_ELEMENT_TAG))
-          {
-            facet = xsdSimpleType.getMinExclusiveFacet();
-          }
-          else if (aFacet.equals(XSDConstants.MININCLUSIVE_ELEMENT_TAG))
-          {
-            facet = xsdSimpleType.getMinInclusiveFacet();
-          }
-          else if (aFacet.equals(XSDConstants.LENGTH_ELEMENT_TAG))
-          {
-            facet = xsdSimpleType.getLengthFacet();
-          }
-          else if (aFacet.equals(XSDConstants.MAXLENGTH_ELEMENT_TAG))
-          {
-            facet = xsdSimpleType.getMaxLengthFacet();
-          }
-          else if (aFacet.equals(XSDConstants.MINLENGTH_ELEMENT_TAG))
-          {
-            facet = xsdSimpleType.getMinLengthFacet();
-          }
-          
-          if (facet != null)
-          {
-            facet.setLexicalValue(newValue);
-          }
-          else
-          {
-            facet = (XSDFacet)factory.createXSDTotalDigitsFacet();
-            childNodeElement = (derivedByElement.getOwnerDocument()).createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + aFacet);
-            valueAttr = new DOMAttribute(XSDConstants.VALUE_ATTRIBUTE, "");
-            childNodeElement.setAttribute(valueAttr.getName(), valueAttr.getValue());
-            valueAttr.setValue(newValue);
-            childNodeElement.setAttribute(valueAttr.getName(), valueAttr.getValue());  
-            element.appendChild(childNodeElement);
-          //formatChild(childNodeElement, hasChildrenElements);    
-          }
-          XSDSchemaHelper.updateElement(xsdSimpleType);
-          if (facet != null)
-          {
-            XSDSchemaHelper.updateElement(facet);
-          }
-        }
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-
-  }
-
-  protected boolean isAnonymous;
-  protected XSDSimpleTypeDefinition xsdSimpleType;
-
-  public void setInput(Element element)
-  {
-    this.element = element;
-    if (xsdSchema == null)
-    {
-      return;
-    }
-
-    isAnonymous = checkForAnonymousType(element);
-    
-    if (XSDDOMHelper.inputEquals(element, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
-    {
-      Element parent = (Element)element.getParentNode();
-      if (XSDDOMHelper.inputEquals(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-      {
-        XSDConcreteComponent component = null;
-        if (parent != null)
-        {
-          component = xsdSchema.getCorrespondingComponent(parent);
-        }
-        if (component instanceof XSDSimpleTypeDefinition)
-        {
-          xsdSimpleType = (XSDSimpleTypeDefinition)component;
-        }
-      }
-
-      XSDConcreteComponent xsdConcreteComponent = null;
-      if (element.getParentNode() != null)
-      {
-        xsdConcreteComponent = xsdSchema.getCorrespondingComponent(element.getParentNode());
-      }
-
-      if (xsdConcreteComponent instanceof XSDSimpleTypeDefinition)
-      {
-        xsdSimpleType = (XSDSimpleTypeDefinition)xsdConcreteComponent;
-      }
-    }
-  }
-
-  boolean checkForAnonymousType(Element element)
-  {
-    boolean isAnonymous = false;
-
-    Node aNode = getDomHelper().getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-    if (aNode != null)
-    {
-      return true;
-    }
-    return isAnonymous;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeListPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeListPropertySource.java
deleted file mode 100644
index b49ceb1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeListPropertySource.java
+++ /dev/null
@@ -1,144 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class SimpleTypeListPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  /**
-   * 
-   */
-  public SimpleTypeListPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public SimpleTypeListPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public SimpleTypeListPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    TypesPropertyDescriptor typeDescriptor = new TypesPropertyDescriptor(
-          XSDConstants.ITEMTYPE_ATTRIBUTE,
-          XSDConstants.ITEMTYPE_ATTRIBUTE,
-          element, xsdSchema);
-        
-    typeDescriptor.setLabelProvider(new LabelProvider()
-    {
-      public String getText(Object element)
-      {
-        return (String) element;
-      }
-    });
-    list.add(typeDescriptor);
-    
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      if (((String) id).equals(XSDConstants.ITEMTYPE_ATTRIBUTE))
-      {
-        result = element.getAttribute((String) id);
-        if (result == null)
-        {
-          result = "**anonymous**"; //$NON-NLS-1$
-        }
-        return result;
-      }
-    }
-    return ""; //$NON-NLS-1$
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value != null)
-     {
-      if (value instanceof String)
-      {
-        if (((String) id).equals(XSDConstants.ITEMTYPE_ATTRIBUTE))
-        { 
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_ITEM_TYPE_CHANGE"), element); //$NON-NLS-1$
-          element.setAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, (String)value);
-          endRecording(element);
-        }
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypePropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypePropertySource.java
deleted file mode 100644
index 99885fa..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypePropertySource.java
+++ /dev/null
@@ -1,183 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalSimpleOrComplexTypeRenamer;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Node;
-
-public class SimpleTypePropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  private boolean isAnonymous = false;
-  /**
-   * 
-   */
-  public SimpleTypePropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public SimpleTypePropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public SimpleTypePropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    Node parent = element.getParentNode();
-    if (XSDDOMHelper.inputEquals(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false) ||
-        XSDDOMHelper.inputEquals(parent, XSDConstants.ELEMENT_ELEMENT_TAG, false) ||
-        XSDDOMHelper.inputEquals(parent, XSDConstants.UNION_ELEMENT_TAG, false) ||
-        XSDDOMHelper.inputEquals(parent, XSDConstants.LIST_ELEMENT_TAG, false) ||
-        XSDDOMHelper.inputEquals(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
-    {
-      isAnonymous = true;
-    }
-
-    List list = new ArrayList();
-    if (!isAnonymous)
-    {
-      // Create a descriptor and set a category
-      PropertyDescriptor nameDescriptor =
-      new TextPropertyDescriptor(
-          XSDConstants.NAME_ATTRIBUTE,
-          XSDConstants.NAME_ATTRIBUTE);
-      list.add(nameDescriptor);
-    }
-    else
-    {
-      PropertyDescriptor readOnly = new PropertyDescriptor(XSDConstants.NAME_ATTRIBUTE, XSDConstants.NAME_ATTRIBUTE);
-      list.add(readOnly);
-    }
-
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-    {
-      result = element.getAttribute((String) id);
-      if (isAnonymous)
-      {
-        result = "**anonymous**";
-      }
-    }
-    if (result == null)
-     {
-      result = "";
-    }
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-    {
-      value = "";
-    }
-    if (value instanceof String)
-    {
-      String name = (String)value;
-      if (validateName(name))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_SIMPLETYPE_NAME_CHANGE"), element);
-        if (name != null && name.length() > 0)
-        {
-          // now rename any references to this type
-          if (xsdSchema != null)
-          {
-            XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-            if (comp != null && comp instanceof XSDSimpleTypeDefinition && comp.getContainer().equals(xsdSchema))
-            {
-//                ((XSDNamedComponent)comp).setName(name);
-              GlobalSimpleOrComplexTypeRenamer renamer = new GlobalSimpleOrComplexTypeRenamer((XSDNamedComponent)comp, name);
-              renamer.visitSchema(xsdSchema);
-            }
-          }
-          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, name);
-        }
-        else
-        {
-          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, "");
-        }
-        endRecording(element);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeUnionPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeUnionPropertySource.java
deleted file mode 100644
index 68584b4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/SimpleTypeUnionPropertySource.java
+++ /dev/null
@@ -1,493 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.DialogCellEditor;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-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.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.wst.xsd.ui.internal.widgets.TypeSection;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-public class SimpleTypeUnionPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  /**
-   * 
-   */
-  public SimpleTypeUnionPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public SimpleTypeUnionPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-  }
-  /**
-   * @param xsdSchema
-   */
-  public SimpleTypeUnionPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    SimpleUnionMemberTypesPropertyDescriptor typeDescriptor = new SimpleUnionMemberTypesPropertyDescriptor(
-        XSDConstants.MEMBERTYPES_ATTRIBUTE,
-        XSDConstants.MEMBERTYPES_ATTRIBUTE);
-    
-    typeDescriptor.setLabelProvider(new LabelProvider()
-        {
-      public String getText(Object element)
-      {
-        return (String) element;
-      }
-    });
-    list.add(typeDescriptor);
-    
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-     {
-      if (((String) id).equals(XSDConstants.MEMBERTYPES_ATTRIBUTE))
-       {
-        result = element.getAttribute((String) id);
-        if (result == null)
-        { 
-          result = ""; //$NON-NLS-1$
-        }
-        return result;
-      }
-    }
-    return ""; //$NON-NLS-1$
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value == null)
-    {
-      value = ""; //$NON-NLS-1$
-    }
-    
-    if (value instanceof String)
-    {
-      String newValue = (String)value;
-      if (((String) id).equals(XSDConstants.MEMBERTYPES_ATTRIBUTE))
-      { 
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_CHANGE"), element); //$NON-NLS-1$
-        if (newValue.length() > 0)
-        {
-          element.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, (String)value);
-        }
-        else
-        {
-          element.removeAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);  
-        }
-        endRecording(element);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-
-  
-  public class SimpleUnionMemberTypesPropertyDescriptor extends PropertyDescriptor
-  {
-    /**
-     * @param id
-     * @param displayName
-     */
-    public SimpleUnionMemberTypesPropertyDescriptor(Object id, String displayName)
-    {
-      super(id, displayName);
-    }
-    
-    public CellEditor createPropertyEditor(Composite parent)
-    {
-      CellEditor editor = new SimpleTypeUnionMemberTypesDialogCellEditor(parent);
-      if (getValidator() != null)
-        editor.setValidator(getValidator());
-      return editor;
-    }
-  }
-  
-  public class SimpleTypeUnionMemberTypesDialogCellEditor extends DialogCellEditor {
-
-    /**
-     * Creates a new Font dialog cell editor parented under the given control.
-     * The cell editor value is <code>null</code> initially, and has no 
-     * validator.
-     *
-     * @param parent the parent control
-     */
-    protected SimpleTypeUnionMemberTypesDialogCellEditor(Composite parent) {
-      super(parent);
-    }
-
-    /**
-     * @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(Control)
-     */
-    protected Object openDialogBox(Control cellEditorWindow)
-    {
-      Shell shell = Display.getCurrent().getActiveShell();
-      
-      SimpleContentUniontMemberTypesDialog dialog = new SimpleContentUniontMemberTypesDialog(shell);
-      dialog.setBlockOnOpen(true);
-      dialog.create();
-      
-      String value = (String)getValue();
-
-      int result = dialog.open();
-
-      if (result == Window.OK)
-       {
-        return dialog.getResult();
-      }
-      return value;
-    }
-
-  }
-
-  public class SimpleContentUniontMemberTypesDialog extends org.eclipse.jface.dialogs.Dialog implements SelectionListener
-  {
-    Table table;
-    TypeSection typeSection;
-    Button addButton, removeButton;
-    org.eclipse.swt.widgets.List memberTypesList;
-    
-    private String result;
-    
-    public SimpleContentUniontMemberTypesDialog(Shell shell)
-    {
-      super(shell);
-    }
-
-    protected void configureShell(Shell shell)
-    {
-      super.configureShell(shell);
-    }
-
-    protected void buttonPressed(int buttonId)
-    {
-      if (buttonId == Dialog.OK)
-      {
-        StringBuffer sb = new StringBuffer();
-        int length = memberTypesList.getItemCount();
-        for (int i=0 ; i < length; i++)
-        {
-          sb.append(memberTypesList.getItem(i));
-          if (i < length - 1)
-          {
-            sb.append(" "); //$NON-NLS-1$
-          }
-        }
-        result = sb.toString();
-      }
-      super.buttonPressed(buttonId);
-    }
-
-    public String getResult() { return result; }
-
-    //
-    // Create the controls
-    //
-    public Control createDialogArea(Composite parent)
-    {
-      Composite client = (Composite)super.createDialogArea(parent);
-      getShell().setText("Union " + XSDConstants.MEMBERTYPES_ATTRIBUTE); //$NON-NLS-1$ 
-      
-      Label instructions = new Label(client, SWT.LEFT | SWT.WRAP);
-      instructions.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_SELECT_MEMBERTYPES")); //$NON-NLS-1$
-      
-      Composite columnsComposite = new Composite(client, SWT.NONE);
-      GridLayout ccGL = new GridLayout();
-      ccGL.verticalSpacing = 0;
-      ccGL.horizontalSpacing = 0;
-      ccGL.marginHeight = 0;
-      ccGL.marginWidth = 0;
-      ccGL.makeColumnsEqualWidth = true;
-      ccGL.numColumns = 3;
-      columnsComposite.setLayout(ccGL);
-      
-      GridData ccGD = new GridData();
-      ccGD.grabExcessHorizontalSpace = true;
-      ccGD.horizontalAlignment = GridData.FILL;
-      columnsComposite.setLayoutData(ccGD);     
-                             
-      typeSection = new TypeSection(columnsComposite);
-      typeSection.setShowUserComplexType(false);
-
-      typeSection.createClient(columnsComposite);
-      typeSection.getSimpleType().setSelection(false);
-      typeSection.getSimpleType().addSelectionListener(this);
-      typeSection.getUserSimpleType().addSelectionListener(this);
-      
-      ViewUtility.createHorizontalFiller(columnsComposite, 1);
-      
-      Label memberListLabel = new Label(columnsComposite, SWT.LEFT);
-      memberListLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_VALUE")); //$NON-NLS-1$  
-      
-      Composite dataComposite = new Composite(client, SWT.NONE);
-      GridLayout dcGL = new GridLayout();
-      dcGL.verticalSpacing = 0;
-      dcGL.marginHeight = 0;
-      dcGL.marginWidth = 0;
-      dcGL.numColumns = 3;
-      dataComposite.setLayout(dcGL);
-      
-      GridData dcGD = new GridData();
-      dcGD.grabExcessHorizontalSpace = true;
-      dcGD.grabExcessVerticalSpace = true;
-      dataComposite.setLayoutData(dcGD);
-      
-      table = new Table(dataComposite,
-          SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); 
-      table.setHeaderVisible(false);
-      table.setLinesVisible(true);
-      GridData gd2 = new GridData();
-      gd2.grabExcessHorizontalSpace = true;
-      gd2.grabExcessVerticalSpace = true;
-      gd2.horizontalAlignment = GridData.FILL;
-      gd2.verticalAlignment = GridData.FILL;
-      gd2.heightHint = 200;
-      gd2.widthHint = 200;
-      table.setLayoutData(gd2);
-
-      // Fill table
-      handleSetInput();
-      table.getItemCount();
-
-      TableColumn tc = new TableColumn(table, SWT.LEFT);
-//      tc.setImage(XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"));
-      //tc.setText("Available types:");
-      tc.setWidth(200);
-      tc.setResizable(true);
-      
-      Composite buttonComposite = new Composite(dataComposite, SWT.NONE);
-      GridLayout bcGL = new GridLayout();
-      bcGL.numColumns = 1;
-      buttonComposite.setLayout(bcGL);
-      addButton = new Button(buttonComposite, SWT.PUSH);
-      addButton.setText(">"); //$NON-NLS-1$
-      addButton.addSelectionListener(this);
-      removeButton = new Button(buttonComposite, SWT.PUSH);
-      removeButton.setText("<"); //$NON-NLS-1$
-      removeButton.addSelectionListener(this);
-      
-      Composite listComposite = new Composite(dataComposite, SWT.NONE);
-      GridLayout mtGL = new GridLayout();
-      mtGL.numColumns = 1;
-      mtGL.marginHeight = 0;
-      mtGL.marginWidth = 0;
-      mtGL.horizontalSpacing = 0;
-      mtGL.verticalSpacing = 0;
-      listComposite.setLayout(mtGL);
-
-      GridData mtGD = new GridData();
-      mtGD.grabExcessHorizontalSpace = true;
-      mtGD.grabExcessVerticalSpace = true;
-      mtGD.verticalAlignment = GridData.FILL;
-      mtGD.horizontalAlignment = GridData.FILL;
-      listComposite.setLayoutData(mtGD);
-      
-      memberTypesList = new org.eclipse.swt.widgets.List(listComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
-      GridData mtlGD = new GridData();
-      mtlGD.grabExcessHorizontalSpace = true;
-      mtlGD.grabExcessVerticalSpace = true;
-      mtlGD.verticalAlignment = GridData.FILL;
-      mtlGD.horizontalAlignment = GridData.FILL;
-      mtlGD.heightHint = 200;
-      mtlGD.widthHint = 200;
-      memberTypesList.setLayoutData(mtlGD);
-      
-      initializeMemberListContent();
-      return client;
-    }
-
-    private void initializeMemberListContent()
-    {
-      String result = element.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-      if (result == null)
-      {
-        return;
-      }
-      StringTokenizer token = new StringTokenizer(result);
-      while (token.hasMoreTokens())
-      {
-        memberTypesList.add(token.nextToken());
-      }
-    }
-  
-    public void widgetSelected(SelectionEvent e)
-    {
-      if (e.widget == typeSection.getSimpleType() && typeSection.getSimpleType().getSelection())
-       {
-        populateBuiltInType();
-      }
-      else if (e.widget == typeSection.getUserSimpleType() && typeSection.getUserSimpleType().getSelection())
-       {
-        populateUserSimpleType(false);
-      }
-      else if (e.widget == addButton)
-      {
-        TableItem[] items = table.getItems();
-        int selection = table.getSelectionIndex();
-        if (items != null && items.length > 0 && selection >= 0)
-        {
-          String typeToAdd = items[selection].getData().toString();
-          if (memberTypesList.indexOf(typeToAdd) < 0)
-          {
-            memberTypesList.add(items[selection].getData().toString());
-          }
-        }
-      }
-      else if (e.widget == removeButton)
-      {
-        String[] typesToRemove = memberTypesList.getSelection();
-        for (int i=0; i < typesToRemove.length; i++)
-        {
-          memberTypesList.remove(typesToRemove[i]);
-        }
-      }
-    }
-    
-    public void widgetDefaultSelected(SelectionEvent e)
-    {
-    }
-    
-    public void handleSetInput()
-    {
-      populateBuiltInType();
-    }
-    
-    public void populateBuiltInType()
-    {
-      table.removeAll();
-      List items = getBuiltInTypeNamesList();
-      for (int i = 0; i < items.size(); i++)
-       {
-        TableItem item = new TableItem(table, SWT.NONE);
-        item.setText(items.get(i).toString());
-        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif")); //$NON-NLS-1$
-        item.setData(items.get(i));
-      }
-    }
-
-    public void populateUserSimpleType(boolean showAnonymous)
-    {
-      table.removeAll();
-      if (showAnonymous)
-       {
-        TableItem anonymousItem = new TableItem(table, SWT.NONE);
-        anonymousItem.setText("**anonymous**"); //$NON-NLS-1$
-        anonymousItem.setData("**anonymous**"); //$NON-NLS-1$
-      }
-      List items = getUserSimpleTypeNamesList();
-      for (int i = 0; i < items.size(); i++)
-       {
-        TableItem item = new TableItem(table, SWT.NONE);
-        item.setText(items.get(i).toString());
-        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif")); //$NON-NLS-1$
-        item.setData(items.get(i));
-      }
-    }
-    
-    public java.util.List getBuiltInTypeNamesList()
-    {
-      TypesHelper helper = new TypesHelper(xsdSchema);
-      return helper.getBuiltInTypeNamesList();
-    }
-
-    public java.util.List getUserSimpleTypeNamesList()
-    {
-      TypesHelper helper = new TypesHelper(xsdSchema);
-      return helper.getUserSimpleTypeNamesList();
-    }
-  }
-  
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/TypesPropertyDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/TypesPropertyDescriptor.java
deleted file mode 100644
index 60e238a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/TypesPropertyDescriptor.java
+++ /dev/null
@@ -1,1145 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.List;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.DialogCellEditor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
-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.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.wst.xsd.ui.internal.widgets.TypeSection;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class TypesPropertyDescriptor extends PropertyDescriptor
-{
-  Element element;
-  XSDSchema xsdSchema;
-  String property;
-  /**
-   * @param id
-   * @param displayName
-   */
-  public TypesPropertyDescriptor(Object id, String displayName, Element element, XSDSchema xsdSchema)
-  {
-    super(id, displayName);
-    this.property = (String)id;
-    this.element = element;
-    this.xsdSchema = xsdSchema;
-  }
-  
-  boolean showComplexTypes = true;
-
-  public CellEditor createPropertyEditor(Composite parent)
-  {
-    if (XSDDOMHelper.inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, false))
-    {
-      showComplexTypes = true;
-    }
-    else if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false) ||
-      XSDDOMHelper.inputEquals(element, XSDConstants.LIST_ELEMENT_TAG, false) ||
-      XSDDOMHelper.inputEquals(element, XSDConstants.UNION_ELEMENT_TAG, false))
-    {
-      showComplexTypes = false;
-    }
-    // CellEditor editor = new TypesOptionsTextCellEditor(parent);
-    CellEditor editor = new TypesDialogCellEditor(parent);
-    if (getValidator() != null)
-      editor.setValidator(getValidator());
-    return editor;
-  }
-
-  
-  public class TypesDialogCellEditor extends DialogCellEditor
-  {
-
-    /**
-     * Creates a new Font dialog cell editor parented under the given control.
-     * The cell editor value is <code>null</code> initially, and has no 
-     * validator.
-     *
-     * @param parent the parent control
-     */
-    protected TypesDialogCellEditor(Composite parent)
-    {
-      super(parent);
-    }
-
-    protected Object openDialogBox(Control cellEditorWindow)
-    {
-	    Shell shell = Display.getCurrent().getActiveShell();
-	    
-	    TypesDialog dialog = new TypesDialog(shell);
-
-	    dialog.setBlockOnOpen(true);
-	    dialog.create();
-	    
-	    String value = (String)getValue();
-	
-	    int result = dialog.open();
-	    
-	    if (result == Window.OK)
-	    {
-	      value = dialog.getType();
-        doSetValue(value);
-        fireApplyEditorValue();
-	    }
-	    deactivate();
-	    return null;
-	  }
-  }
-
-  public class TypesDialog extends org.eclipse.jface.dialogs.Dialog implements SelectionListener
-  {
-    String type;
-    Object typeObject;
-    Table table;
-
-    TypeSection typeSection;
-    boolean showAnonymous = true;
-    String previousStringType = "";
-    boolean isAnonymous;
-    int previousType;
-
-    
-    public TypesDialog(Shell shell)
-    {
-      super(shell);
-    }
-
-    protected void configureShell(Shell shell)
-    {
-      super.configureShell(shell);
-    }
-
-    protected void buttonPressed(int buttonId)
-    {
-      if (buttonId == Dialog.OK)
-      {
-        type = table.getItem(table.getSelectionIndex()).getText();
-        ok();
-      }
-      super.buttonPressed(buttonId);
-    }
-
-    public Object getTypeObject() { return typeObject; }
-    public String getType() { return type; }
-
-    //
-    // Create the controls
-    //
-    public Control createDialogArea(Composite parent)
-    {
-      Composite client = (Composite)super.createDialogArea(parent);
-      getShell().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_AVAILABLE_TYPES"));
-
-      typeObject = null;
-      
-      GridLayout gl = new GridLayout(1, true);
-      client.setLayout(gl);
-
-      GridData gd = new GridData();
-      gd.grabExcessHorizontalSpace = true;
-      gd.grabExcessVerticalSpace = true;
-      gd.horizontalAlignment = GridData.FILL;
-      gd.verticalAlignment = GridData.FILL;
-      gd.horizontalIndent = 0;
-      client.setLayoutData(gd);
-      
-      typeSection = new TypeSection(client);
-      typeSection.setShowUserComplexType(showComplexTypes);
-
-      typeSection.createClient(client);
-      typeSection.getSimpleType().setSelection(false);
-      typeSection.getSimpleType().addSelectionListener(this);
-      typeSection.getUserSimpleType().addSelectionListener(this);
-      if (showComplexTypes)
-      {
-        typeSection.getUserComplexType().addSelectionListener(this);
-      }
-
-      table = new Table(client,
-                        SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); 
-      table.setHeaderVisible(false);
-      table.setLinesVisible(true);
-      
-      GridData gd2 = new GridData();
-      gd2.grabExcessHorizontalSpace = true;
-      gd2.grabExcessVerticalSpace = true;
-      gd2.horizontalAlignment = GridData.FILL;
-      gd2.heightHint = 200;
-      table.setLayoutData(gd2);
-
-      TableColumn tableColumn = new TableColumn(table, SWT.LEFT);
-//      tableColumn.setImage(XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"));
-      tableColumn.setResizable(true);
-      tableColumn.setWidth(200);
-      
-
-      // Fill table and select input type
-      handleSetInput();
-
-      return client;
-    }
-    
-    public void widgetSelected(SelectionEvent e)
-    {
-      if (e.widget == typeSection.getSimpleType() && typeSection.getSimpleType().getSelection())
-      {
-        populateBuiltInType();
-      }
-      else if (e.widget == typeSection.getUserComplexType() && typeSection.getUserComplexType().getSelection())
-      {
-        populateUserComplexType();
-      }
-      else if (e.widget == typeSection.getUserSimpleType() && typeSection.getUserSimpleType().getSelection())
-      {
-        populateUserSimpleType();
-      }
-
-    }
-    
-  	public void widgetDefaultSelected(SelectionEvent e)
-    {
-    }
-
-    protected void ok()
-    {
-      TableItem[] items = table.getItems();
-      int selection = table.getSelectionIndex();
-      if (items != null && items.length > 0 && selection >= 0)
-      {
-        typeObject = items[selection].getData();
-      }
-//      System.out.println("typeObject is " + typeObject);
-
-//      beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_TYPE_CHANGE"), element);
-//      beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element);
-//      doSetValue(typeObject);
-//      applyEditorValueAndDeactivate();
-//      dialog.close();
-
-      if (!XSDDOMHelper.inputEquals(element, XSDConstants.UNION_ELEMENT_TAG, false))
-      {
-      if (typeObject.equals("**anonymous**"))
-      {
-        if (typeSection.getUserSimpleType().getSelection())
-        {
-          if (!previousStringType.equals("**anonymous**"))
-          {
-            updateElementToAnonymous(
-              element,
-              XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-          }
-        }
-        else
-        {
-          if (!previousStringType.equals("**anonymous**"))
-          {
-            updateElementToAnonymous(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-          }
-        }
-        // element.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);
-        element.removeAttribute(property);
-      }
-      else
-      {
-        updateElementToNotAnonymous(element);
-        //element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, typeObject.toString());
-        element.setAttribute(property, typeObject.toString());
-      }
-      }
-//      endRecording(element);
-
-      //implement dispose();
-//      table.removeAll();
-//      table.dispose();
-    }
-
-  	
-    public void handleSetInput()
-    {
-      table.removeAll();
-      isAnonymous = checkForAnonymousType(element);
-      // Attr attr = element.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
-      Attr attr = element.getAttributeNode(property);
-      if (attr != null)
-      {
-        String value = attr.getValue();
-        if (typeSection.getBuiltInTypeNamesList(xsdSchema).contains(value))
-        {
-          typeSection.getSimpleType().setSelection(true);
-          populateBuiltInType();
-          int i = typeSection.getBuiltInTypeNamesList(xsdSchema).indexOf(value);
-          table.setSelection(i);
-          previousType = 1;
-        }
-        else if (typeSection.getUserSimpleTypeNamesList(xsdSchema).contains(value))
-        {
-          typeSection.getUserSimpleType().setSelection(true);
-          populateUserSimpleType();
-          int i = typeSection.getUserSimpleTypeNamesList(xsdSchema).indexOf(value);
-          if (showAnonymous)
-          {
-            table.setSelection(i + 1);
-          }
-          else
-          {
-            table.setSelection(i);
-          }
-          previousType = 2;
-        }
-        else if (typeSection.getUserComplexTypeNamesList(xsdSchema).contains(value))
-        {
-          typeSection.getUserComplexType().setSelection(true);
-          populateUserComplexType();
-          int i = typeSection.getUserComplexTypeNamesList(xsdSchema).indexOf(value);
-          if (showAnonymous)
-           {
-            table.setSelection(i + 1);
-          }
-          else
-           {
-            table.setSelection(i);
-          }
-          previousType = 3;
-        }
-        else // if it is type="" for an empty list of simple types
-          {
-          typeSection.getUserSimpleType().setSelection(true);
-          populateUserSimpleType();
-          previousType = 2;
-        }
-      }
-      else
-      {
-        if (isAnonymous)
-        {
-          if (isSTAnonymous(element))
-          {
-            typeSection.getUserSimpleType().setSelection(true);
-            populateUserSimpleType();
-            previousType = 2;
-          }
-          else
-          {
-            typeSection.getUserComplexType().setSelection(true);
-            populateUserComplexType();
-            previousType = 3;
-          }
-          table.setSelection(0); // anonymous
-          //        typeSection.getTypeList().setText("**anonymous**");
-        }
-        else
-        {
-          typeSection.getSimpleType().setSelection(true);
-          populateBuiltInType();
-          table.setSelection(0);
-          
-          //        typeSection.getTypeList().setEnabled(true);
-          //        typeSection.getSimpleType().setSelection(true);
-          //        typeSection.populateBuiltInType(xsdSchema);
-          //        typeSection.getTypeList().setText(XSDEditorPlugin.getXSDString("_UI_NO_TYPE"));
-          previousType = 1;
-        }
-      }
-      if (table.getSelection() != null && table.getSelection().length > 0)
-      {
-        previousStringType = (table.getSelection()[0]).getText();
-      }
-    }
-    
-    public void populateBuiltInType()
-    {
-      table.removeAll();
-      List items = getBuiltInTypeNamesList();
-      for (int i = 0; i < items.size(); i++)
-      {
-        TableItem item = new TableItem(table, SWT.NONE);
-        item.setText(items.get(i).toString());
-        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
-        item.setData(items.get(i));
-      }
-    }
-
-    public void populateUserComplexType()
-    {
-      table.removeAll();
-      if (showAnonymous)
-      {
-        TableItem anonymousItem = new TableItem(table, SWT.NONE);
-        anonymousItem.setText("**anonymous**");
-        anonymousItem.setData("**anonymous**");
-      }
-      List items = getUserComplexTypeNamesList();
-      for (int i = 0; i < items.size(); i++)
-      {
-        TableItem item = new TableItem(table, SWT.NONE);
-//        System.out.println("item " + i + " is " + item);
-        item.setText(items.get(i).toString());
-        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif"));
-        item.setData(items.get(i));
-      }
-    }
-
-    public void populateUserSimpleType()
-    {
-      table.removeAll();
-      if (showAnonymous)
-       {
-        TableItem anonymousItem = new TableItem(table, SWT.NONE);
-        anonymousItem.setText("**anonymous**");
-        anonymousItem.setData("**anonymous**");
-      }
-      List items = getUserSimpleTypeNamesList();
-      for (int i = 0; i < items.size(); i++)
-       {
-        TableItem item = new TableItem(table, SWT.NONE);
-        item.setText(items.get(i).toString());
-        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
-        item.setData(items.get(i));
-      }
-    }
-
-    boolean checkForAnonymousType(Element element)
-    {
-      /*
-       * Using Ed's model to check boolean isAnonymous = false;
-       * 
-       * XSDConcreteComponent component =
-       * getXSDSchema().getCorrespondingComponent(element); if (component
-       * instanceof XSDElementDeclaration) { XSDElementDeclaration xsdElem =
-       * (XSDElementDeclaration)component; isAnonymous =
-       * xsdElem.isSetAnonymousTypeDefinition(); } return isAnonymous;
-       */
-      XSDDOMHelper helper = new XSDDOMHelper();
-      boolean isAnonymous = false;
-      Node aNode =
-      helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-      if (aNode != null)
-       {
-        return true;
-      }
-      aNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-      if (aNode != null)
-       {
-        isAnonymous = true;
-      }
-      return isAnonymous;
-    }
-
-    void updateElementToAnonymous(Element element, String xsdType)
-    {
-      String prefix = element.getPrefix();
-      prefix = (prefix == null) ? "" : (prefix + ":");
-      updateElementToNotAnonymous(element);
-      Element childNode = null;
-      if (xsdType.equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
-       {
-        childNode = element.getOwnerDocument().createElementNS(
-            XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001,
-            prefix + XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-      }
-      else if (xsdType.equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG))
-       {
-        childNode =
-        element.getOwnerDocument().createElementNS(
-            XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001,
-            prefix + XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-      }
-      element.appendChild(childNode);
-    }
-
-    boolean isSTAnonymous(Element element)
-    {
-      XSDDOMHelper helper = new XSDDOMHelper();
-      Node aNode =
-      helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-      if (aNode != null)
-       {
-        if (XSDDOMHelper
-            .inputEquals(aNode, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-         {
-          return true;
-        }
-      }
-      return false;
-    }
-
-    boolean isCTAnonymous(Element element)
-    {
-      XSDDOMHelper helper = new XSDDOMHelper();
-      Node aNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-      if (aNode != null)
-       {
-        if (XSDDOMHelper.inputEquals(aNode, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
-         {
-          return true;
-        }
-      }
-      return false;
-    }
-
-    XSDTypeDefinition getAnonymousTypeDefinition(Element element)
-    {
-      XSDDOMHelper helper = new XSDDOMHelper();
-      Node typeDefinitionNode =
-      helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-      if (typeDefinitionNode == null)
-       {
-        typeDefinitionNode =
-        helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-      }
-      if (typeDefinitionNode != null)
-       {
-        XSDConcreteComponent component =
-        xsdSchema.getCorrespondingComponent(typeDefinitionNode);
-        if (component instanceof XSDTypeDefinition)
-         {
-          return (XSDTypeDefinition) component;
-        }
-      }
-      return null;
-    }
-
-    void updateElementToNotAnonymous(Element element)
-    {
-      if (element != null)
-      {
-	      NodeList children = element.getChildNodes();
-	      if (children != null)
-	       {
-	        for (int i = 0; i < children.getLength(); i++)
-	         {
-	          Node node = (Node) children.item(i);
-	          if (node instanceof Element)
-	           {
-	            if (node.getLocalName().equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG)
-	                || node.getLocalName().equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
-	             {
-	              XSDDOMHelper.removeNodeAndWhitespace(node);
-	              i = 0;
-	            }
-	          }
-	        }
-	      }
-      }
-    }
-
-    public java.util.List getBuiltInTypeNamesList()
-    {
-      TypesHelper helper = new TypesHelper(xsdSchema);
-      return helper.getBuiltInTypeNamesList();
-    }
-
-    public java.util.List getUserSimpleTypeNamesList()
-    {
-      TypesHelper helper = new TypesHelper(xsdSchema);
-      return helper.getUserSimpleTypeNamesList();
-    }
-    
-    public java.util.List getUserComplexTypeNamesList()
-    {
-      TypesHelper helper = new TypesHelper(xsdSchema);
-      return helper.getUserComplexTypeNamesList();
-    }
-    
-	  protected boolean hasElementChildren(Node parentNode)
-	  {
-	    boolean hasChildrenElements = false;
-	    if (parentNode != null && parentNode.hasChildNodes())
-	    {
-	      NodeList nodes = parentNode.getChildNodes();
-	      for (int i = 0; i < nodes.getLength(); i++)
-	      {
-	        if (nodes.item(i) instanceof Element)
-	        {
-	          hasChildrenElements = true;
-	          break;
-	        }
-	      }
-	    }
-	    return hasChildrenElements;
-	  }
-
-  }
-
-  
-  
-  
-  
-  
-  
-  
-  class TypesOptionsTextCellEditor extends OptionsTextCellEditor
-  {
-    boolean showAnonymous = true;
-    
-    public TypesOptionsTextCellEditor(Composite parent)
-    {
-      super(parent);
-    }
-
-    protected Control createControl(Composite parent)
-    {
-      isTextReadOnly = true;
-      return super.createControl(parent);
-    }
-
-    Table table;
-    TypeSection typeSection;
-
-    protected void openDialog()
-    {
-      typeObject = null;
-      dialog = new Shell(XSDEditorPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.MODELESS);
-      Display display = dialog.getDisplay();
-      GridLayout gl = new GridLayout(1, true);
-      gl.marginHeight = 0;
-      gl.marginWidth = 0;
-      gl.horizontalSpacing = 0;
-      gl.verticalSpacing = 0;
-      dialog.setLayout(gl);
-      GridData gd = new GridData();
-      gd.grabExcessHorizontalSpace = true;
-      gd.grabExcessVerticalSpace = true;
-      gd.horizontalAlignment = GridData.FILL;
-      gd.verticalAlignment = GridData.FILL;
-      gd.horizontalIndent = 0;
-      dialog.setLayoutData(gd);
-
-      
-      
-      typeSection = new TypeSection(dialog);
-      typeSection.setShowUserComplexType(showComplexTypes);
-
-      typeSection.createClient(dialog);
-      typeSection.getSimpleType().setSelection(false);
-      typeSection.getSimpleType().addSelectionListener(this);
-      typeSection.getUserSimpleType().addSelectionListener(this);
-      if (showComplexTypes)
-      {
-        typeSection.getUserComplexType().addSelectionListener(this);
-      }
-
-      table = new Table(dialog,
-                        SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); 
-      table.setHeaderVisible(false);
-      table.setLinesVisible(true);
-      GridData gd2 = new GridData();
-      gd2.grabExcessHorizontalSpace = true;
-      gd2.grabExcessVerticalSpace = true;
-      gd2.horizontalAlignment = GridData.FILL;
-      gd2.verticalAlignment = GridData.FILL;
-      table.setLayoutData(gd2);
-
-      // Fill table and select input type
-      handleSetInput();
-
-      TableColumn tc = new TableColumn(table, SWT.LEFT);
-      tc.setImage(XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"));
-      tc.setResizable(false);
-
-      int MAX_ITEMS = 23;
-      Rectangle tableBounds = table.getBounds();
-      tableBounds.height = Math.min(tableBounds.height, table.getItemHeight()*MAX_ITEMS);
-      table.setBounds(tableBounds);
-      dialog.pack();
-      
-      dialog.addShellListener(new ShellAdapter()
-      {
-        public void shellDeactivated(ShellEvent e)
-        {
-          cancel();
-        }
-      });
-
-      Rectangle dialogBounds = dialog.getBounds();
-      Point buttonLocation = getButtonAbsoluteLocation();
-      dialogBounds.x = buttonLocation.x;
-      dialogBounds.y = buttonLocation.y;
-
-      if (dialogBounds.height > 200)
-      {        
-        dialogBounds.height = 200;
-      }
-      if (dialogBounds.height < 100)
-      {
-        dialogBounds.height = 200;
-      }
-      if (dialogBounds.width > 200)
-      {
-        dialogBounds.width = typeSection.getUserComplexType().getBounds().width + 30;
-      }
-      dialog.setBounds(dialogBounds);
-      tc.setWidth(dialogBounds.width);
-
-      table.addKeyListener(new KeyAdapter()
-      {
-        public void keyPressed(KeyEvent e)
-        {
-          char character = e.character;
-          if (character == SWT.CR || character == SWT.LF)
-            ok();
-          else if (character == SWT.ESC)
-            cancel();
-        }
-      });
-
-      table.addMouseListener(new MouseAdapter()
-      {
-        public void mouseDoubleClick(MouseEvent e)
-        {
-          ok();
-        }
-        public void mouseDown(MouseEvent e)
-        {
-          ok();
-        }
-      });
-
-      try
-      {
-        dialog.open();
-        table.setFocus();
-        table.showSelection();
-        
-        while (!dialog.isDisposed())
-        {
-          if (!display.readAndDispatch())
-          {
-            display.sleep();
-          }
-        }
-      }
-      finally
-      {
-        if (!dialog.isDisposed())
-          cancel();
-      }
-    }
-    
-    public void widgetSelected(SelectionEvent e)
-    {
-      if (e.widget == typeSection.getSimpleType() && typeSection.getSimpleType().getSelection())
-      {
-        populateBuiltInType();
-      }
-      else if (e.widget == typeSection.getUserComplexType() && typeSection.getUserComplexType().getSelection())
-      {
-        populateUserComplexType();
-      }
-      else if (e.widget == typeSection.getUserSimpleType() && typeSection.getUserSimpleType().getSelection())
-      {
-        populateUserSimpleType();
-      }
-    }
-    
-    protected void cancel()
-    {
-      super.cancel();
-      table.dispose();
-    }
-
-    protected void ok()
-    {
-      TableItem[] items = table.getItems();
-      selection = table.getSelectionIndex();
-      if (items != null && items.length > 0 && selection >= 0)
-      {
-        typeObject = items[selection].getData();
-      }
-//      System.out.println("typeObject is " + typeObject);
-
-//      beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_TYPE_CHANGE"), element);
-//      beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element);
-      doSetValue(typeObject);
-      applyEditorValueAndDeactivate();
-      dialog.close();
-
-      if (!XSDDOMHelper.inputEquals(element, XSDConstants.UNION_ELEMENT_TAG, false))
-      {
-      if (typeObject.equals("**anonymous**"))
-      {
-        if (typeSection.getUserSimpleType().getSelection())
-        {
-          if (!previousStringType.equals("**anonymous**"))
-          {
-            updateElementToAnonymous(
-              element,
-              XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-          }
-        }
-        else
-        {
-          if (!previousStringType.equals("**anonymous**"))
-          {
-            updateElementToAnonymous(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-          }
-        }
-        // element.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);
-        element.removeAttribute(property);
-      }
-      else
-      {
-        updateElementToNotAnonymous(element);
-        //element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, typeObject.toString());
-        element.setAttribute(property, typeObject.toString());
-      }
-      }
-//      endRecording(element);
-
-      //implement dispose();
-      table.removeAll();
-      table.dispose();
-    }
-
-    String previousStringType = "";
-    boolean isAnonymous;
-    int previousType;
-
-    public void handleSetInput()
-    {
-      table.removeAll();
-      isAnonymous = checkForAnonymousType(element);
-      // Attr attr = element.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
-      Attr attr = element.getAttributeNode(property);
-      if (attr != null)
-      {
-        String value = attr.getValue();
-        if (typeSection.getBuiltInTypeNamesList(xsdSchema).contains(value))
-        {
-          typeSection.getSimpleType().setSelection(true);
-          populateBuiltInType();
-          int i = typeSection.getBuiltInTypeNamesList(xsdSchema).indexOf(value);
-          table.setSelection(i);
-          previousType = 1;
-        }
-        else if (typeSection.getUserSimpleTypeNamesList(xsdSchema).contains(value))
-        {
-          typeSection.getUserSimpleType().setSelection(true);
-          populateUserSimpleType();
-          int i = typeSection.getUserSimpleTypeNamesList(xsdSchema).indexOf(value);
-          if (showAnonymous)
-          {
-            table.setSelection(i + 1);
-          }
-          else
-          {
-            table.setSelection(i);
-          }
-          previousType = 2;
-        }
-        else if (typeSection.getUserComplexTypeNamesList(xsdSchema).contains(value))
-        {
-          typeSection.getUserComplexType().setSelection(true);
-          populateUserComplexType();
-          int i = typeSection.getUserComplexTypeNamesList(xsdSchema).indexOf(value);
-          if (showAnonymous)
-           {
-            table.setSelection(i + 1);
-          }
-          else
-           {
-            table.setSelection(i);
-          }
-          previousType = 3;
-        }
-        else // if it is type="" for an empty list of simple types
-          {
-          typeSection.getUserSimpleType().setSelection(true);
-          populateUserSimpleType();
-          previousType = 2;
-        }
-      }
-      else
-      {
-        if (isAnonymous)
-        {
-          if (isSTAnonymous(element))
-          {
-            typeSection.getUserSimpleType().setSelection(true);
-            populateUserSimpleType();
-            previousType = 2;
-          }
-          else
-          {
-            typeSection.getUserComplexType().setSelection(true);
-            populateUserComplexType();
-            previousType = 3;
-          }
-          table.setSelection(0); // anonymous
-          //        typeSection.getTypeList().setText("**anonymous**");
-        }
-        else
-        {
-          typeSection.getSimpleType().setSelection(true);
-          populateBuiltInType();
-          table.setSelection(0);
-          
-          //        typeSection.getTypeList().setEnabled(true);
-          //        typeSection.getSimpleType().setSelection(true);
-          //        typeSection.populateBuiltInType(xsdSchema);
-          //        typeSection.getTypeList().setText(XSDEditorPlugin.getXSDString("_UI_NO_TYPE"));
-          previousType = 1;
-        }
-      }
-      if (table.getSelection() != null && table.getSelection().length > 0)
-      {
-        previousStringType = (table.getSelection()[0]).getText();
-      }
-    }
-    
-    public void populateBuiltInType()
-    {
-      table.removeAll();
-      List items = getBuiltInTypeNamesList();
-      for (int i = 0; i < items.size(); i++)
-      {
-        TableItem item = new TableItem(table, SWT.NONE);
-        item.setText(items.get(i).toString());
-        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
-        item.setData(items.get(i));
-      }
-    }
-
-    public void populateUserComplexType()
-    {
-      table.removeAll();
-      if (showAnonymous)
-      {
-        TableItem anonymousItem = new TableItem(table, SWT.NONE);
-        anonymousItem.setText("**anonymous**");
-        anonymousItem.setData("**anonymous**");
-      }
-      List items = getUserComplexTypeNamesList();
-      for (int i = 0; i < items.size(); i++)
-      {
-        TableItem item = new TableItem(table, SWT.NONE);
-//        System.out.println("item " + i + " is " + item);
-        item.setText(items.get(i).toString());
-        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif"));
-        item.setData(items.get(i));
-      }
-    }
-
-    public void populateUserSimpleType()
-    {
-      table.removeAll();
-      if (showAnonymous)
-       {
-        TableItem anonymousItem = new TableItem(table, SWT.NONE);
-        anonymousItem.setText("**anonymous**");
-        anonymousItem.setData("**anonymous**");
-      }
-      List items = getUserSimpleTypeNamesList();
-      for (int i = 0; i < items.size(); i++)
-       {
-        TableItem item = new TableItem(table, SWT.NONE);
-        item.setText(items.get(i).toString());
-        item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
-        item.setData(items.get(i));
-      }
-    }
-
-    boolean checkForAnonymousType(Element element)
-    {
-      /*
-       * Using Ed's model to check boolean isAnonymous = false;
-       * 
-       * XSDConcreteComponent component =
-       * getXSDSchema().getCorrespondingComponent(element); if (component
-       * instanceof XSDElementDeclaration) { XSDElementDeclaration xsdElem =
-       * (XSDElementDeclaration)component; isAnonymous =
-       * xsdElem.isSetAnonymousTypeDefinition(); } return isAnonymous;
-       */
-      XSDDOMHelper helper = new XSDDOMHelper();
-      boolean isAnonymous = false;
-      Node aNode =
-      helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-      if (aNode != null)
-       {
-        return true;
-      }
-      aNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-      if (aNode != null)
-       {
-        isAnonymous = true;
-      }
-      return isAnonymous;
-    }
-
-    void updateElementToAnonymous(Element element, String xsdType)
-    {
-      String prefix = element.getPrefix();
-      prefix = (prefix == null) ? "" : (prefix + ":");
-      updateElementToNotAnonymous(element);
-      Element childNode = null;
-      if (xsdType.equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
-       {
-        childNode = element.getOwnerDocument().createElementNS(
-            XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001,
-            prefix + XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-      }
-      else if (xsdType.equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG))
-       {
-        childNode =
-        element.getOwnerDocument().createElementNS(
-            XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001,
-            prefix + XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-      }
-      element.appendChild(childNode);
-    }
-
-    boolean isSTAnonymous(Element element)
-    {
-      XSDDOMHelper helper = new XSDDOMHelper();
-      Node aNode =
-      helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-      if (aNode != null)
-       {
-        if (XSDDOMHelper
-            .inputEquals(aNode, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-         {
-          return true;
-        }
-      }
-      return false;
-    }
-
-    boolean isCTAnonymous(Element element)
-    {
-      XSDDOMHelper helper = new XSDDOMHelper();
-      Node aNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-      if (aNode != null)
-       {
-        if (XSDDOMHelper.inputEquals(aNode, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
-         {
-          return true;
-        }
-      }
-      return false;
-    }
-
-    XSDTypeDefinition getAnonymousTypeDefinition(Element element)
-    {
-      XSDDOMHelper helper = new XSDDOMHelper();
-      Node typeDefinitionNode =
-      helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-      if (typeDefinitionNode == null)
-       {
-        typeDefinitionNode =
-        helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-      }
-      if (typeDefinitionNode != null)
-       {
-        XSDConcreteComponent component =
-        xsdSchema.getCorrespondingComponent(typeDefinitionNode);
-        if (component instanceof XSDTypeDefinition)
-         {
-          return (XSDTypeDefinition) component;
-        }
-      }
-      return null;
-    }
-
-    void updateElementToNotAnonymous(Element element)
-    {
-      NodeList children = element.getChildNodes();
-      if (children != null)
-       {
-        for (int i = 0; i < children.getLength(); i++)
-         {
-          Node node = (Node) children.item(i);
-          if (node instanceof Element)
-           {
-            if (node.getLocalName().equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG)
-                || node.getLocalName().equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
-             {
-              XSDDOMHelper.removeNodeAndWhitespace(node);
-              i = 0;
-            }
-          }
-        }
-      }
-    }
-
-    public java.util.List getBuiltInTypeNamesList()
-    {
-      TypesHelper helper = new TypesHelper(xsdSchema);
-      return helper.getBuiltInTypeNamesList();
-    }
-
-    public java.util.List getUserSimpleTypeNamesList()
-    {
-      TypesHelper helper = new TypesHelper(xsdSchema);
-      return helper.getUserSimpleTypeNamesList();
-    }
-    
-    public java.util.List getUserComplexTypeNamesList()
-    {
-      TypesHelper helper = new TypesHelper(xsdSchema);
-      return helper.getUserComplexTypeNamesList();
-    }
-    
-	  protected boolean hasElementChildren(Node parentNode)
-	  {
-	    boolean hasChildrenElements = false;
-	    if (parentNode != null && parentNode.hasChildNodes())
-	    {
-	      NodeList nodes = parentNode.getChildNodes();
-	      for (int i = 0; i < nodes.getLength(); i++)
-	      {
-	        if (nodes.item(i) instanceof Element)
-	        {
-	          hasChildrenElements = true;
-	          break;
-	        }
-	      }
-	    }
-	    return hasChildrenElements;
-	  }
-
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XPathPropertySource.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XPathPropertySource.java
deleted file mode 100644
index 9a5d893..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XPathPropertySource.java
+++ /dev/null
@@ -1,150 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-public class XPathPropertySource
-  extends BasePropertySource
-  implements IPropertySource
-{
-  /**
-   * 
-   */
-  public XPathPropertySource()
-  {
-    super();
-  }
-  /**
-   * @param viewer
-   * @param xsdSchema
-   */
-  public XPathPropertySource(Viewer viewer, XSDSchema xsdSchema)
-  {
-    super(viewer, xsdSchema);
-// From Field     
-// WorkbenchHelp.setHelp(comp, XSDEditorContextIds.XSDE_UNIQUE_BASE_FIELDS_GROUP);
-//    fieldField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_FIELD_TEXT"));
-//    WorkbenchHelp.setHelp(fieldField, XSDEditorContextIds.XSDE_UNIQUE_BASE_SOURCE);
-
-// From Selector
-// WorkbenchHelp.setHelp(comp, XSDEditorContextIds.XSDE_UNIQUE_BASE_SELECTOR_GROUP);
-// WorkbenchHelp.setHelp(selectorField, XSDEditorContextIds.XSDE_UNIQUE_BASE_SELECTOR);
-// selectorField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_SELECTOR_TEXT"));
-    
-  }
-  /**
-   * @param xsdSchema
-   */
-  public XPathPropertySource(XSDSchema xsdSchema)
-  {
-    super(xsdSchema);
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
-   */
-  public Object getEditableValue()
-  {
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
-   */
-  public IPropertyDescriptor[] getPropertyDescriptors()
-  {
-    List list = new ArrayList();
-    // Create a descriptor and set a category
-    PropertyDescriptor xpathDescriptor =
-    new TextPropertyDescriptor(
-        XSDConstants.XPATH_ATTRIBUTE,
-        XSDConstants.XPATH_ATTRIBUTE);
-    list.add(xpathDescriptor);
-
-    IPropertyDescriptor[] result = new IPropertyDescriptor[list.size()];
-    list.toArray(result);
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
-   */
-  public Object getPropertyValue(Object id)
-  {
-    Object result = null;
-    if (id instanceof String)
-     {
-      result = element.getAttribute((String) id);
-    }
-    if (result == null)
-     {
-      result = "";
-    }
-    return result;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
-   */
-  public boolean isPropertySet(Object id)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
-   */
-  public void resetPropertyValue(Object id)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
-   */
-  public void setPropertyValue(Object id, Object value)
-  {
-    if (value != null)
-     {
-      if (value instanceof String)
-      {
-        if (XSDDOMHelper.inputEquals(element, XSDConstants.FIELD_ELEMENT_TAG, false))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_FIELD_XPATH_CHANGE"), element);
-        }
-        else if (XSDDOMHelper.inputEquals(element, XSDConstants.SELECTOR_ELEMENT_TAG, false))
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_SELECTOR_XPATH_CHANGE"), element);
-        }
-        
-        element.setAttribute(XSDConstants.XPATH_ATTRIBUTE, (String)value);
-        endRecording(element);
-      }
-    }
-    Runnable delayedUpdate = new Runnable()
-    {
-      public void run()
-      {
-        if (viewer != null)
-          viewer.refresh();
-      }
-    };
-    Display.getCurrent().asyncExec(delayedUpdate);
-    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDComboBoxPropertyDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDComboBoxPropertyDescriptor.java
deleted file mode 100644
index b4d9cc2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDComboBoxPropertyDescriptor.java
+++ /dev/null
@@ -1,304 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import java.text.MessageFormat;
-
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.PopupList;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-
-public class XSDComboBoxPropertyDescriptor extends PropertyDescriptor
-{
-	private String[] values;
-	
-	public XSDComboBoxPropertyDescriptor(Object id, String displayName, String[] valuesArray) {
-		super(id, displayName);
-		values = valuesArray;
-	}
-	/**
-	 * The <code>ComboBoxPropertyDescriptor</code> implementation of this 
-	 * <code>IPropertyDescriptor</code> method creates and returns a new
-	 * <code>ComboBoxCellEditor</code>.
-	 * <p>
-	 * The editor is configured with the current validator if there is one.
-	 * </p>
-	 */
-	public CellEditor createPropertyEditor(Composite parent) {
-    CellEditor editor = new XSDComboBoxCellEditor(parent, values);
-    //CellEditor editor = new StringComboBoxCellEditor(parent, values);
-		if (getValidator() != null)
-			editor.setValidator(getValidator());
-		return editor;
-	}
-	
-	public class XSDComboBoxCellEditor extends CellEditor
-	{
-		DynamicCellEditor comboBox;
-
-		private String fSelection;
-		protected String[] fItems;
-		protected Object fValue;
-		int selection;
-		Object typeObject;
-		
-		public void createItems(String[] items)
-		{
-			fItems = items;
-		}
-
-		public String[] getComboBoxItems()
-		{
-			return fItems;
-		}
-
-	/**
-	 * Creates a new combo box cell editor with the given choices.
-	 */
-		 public XSDComboBoxCellEditor(Composite parent, String[] items)
-		 {
-			 super(parent);
-			 fSelection = "";
-			 setItems(items);
-//			 fText.setText("");
-		 }
-
-		public void activate() {
-      if (doGetValue() != null)
-      {
-//			  int i = ((Integer)doGetValue()).intValue();
-//			  if (i >= 0)
-//		  	{
-//		  	  comboBox.setText(fItems[i]);
-//		  	}
-        comboBox.setText((String)fValue);
-			}
-		}
-
-		public void deactivate() {
-		  super.deactivate();
-		}
-
-		public void setItems(String[] items) {
-			Assert.isNotNull(items);
-			this.fItems = items;
-			populateComboBoxItems();
-		}
-
-		private void populateComboBoxItems() {
-			if (comboBox != null && fItems != null) {
-				comboBox.removeAll();
-				for (int i = 0; i < fItems.length; i++)
-					comboBox.add(fItems[i], i);
-
-				setValueValid(true);
-				selection = 0;
-			}
-		}
-
-	/**
-	 * Creates the actual UI representation.
-	 */
-
-		protected Control createControl(Composite parent)
-		{
-			comboBox = new DynamicCellEditor(parent, SWT.READ_ONLY |SWT.NONE | SWT.NO_TRIM);
-			comboBox.addKeyListener(new KeyAdapter() {
-				// hook key pressed - see PR 14201  
-				public void keyPressed(KeyEvent e) {
-//					System.out.println("Key e " + e);
-					keyReleaseOccured(e);
-				}
-			});
-
-			comboBox.addSelectionListener(new SelectionAdapter() {
-				public void widgetDefaultSelected(SelectionEvent event) {
-				}
-		
-				public void widgetSelected(SelectionEvent event) {
-//				  System.out.println("combo selected");
-					selection = comboBox.getSelectionIndex();
-					if (!comboBox.isDropped()) // allows user to traverse list using keyboard without applying value
-					applyEditorValueAndDeactivate();
-				}
-			});
-
-			comboBox.addTraverseListener(new TraverseListener() {
-				public void keyTraversed(TraverseEvent e) {
-//				  System.out.println("TRAVERSE e " + e);
-					if (e.detail == SWT.TRAVERSE_ESCAPE || e.detail == SWT.TRAVERSE_RETURN) {
-						e.doit = false;
-					}
-				}
-			});
-			
-      
-			comboBox.addFocusListener(new FocusAdapter() {
-				public void focusLost(FocusEvent e) {
-					XSDComboBoxCellEditor.this.focusLost();
-				}
-				public void focusGained(FocusEvent e) {
-//				  System.out.println("focusGained");
-				}
-			});
-		  setValueValid(true);
-			return comboBox;
-		}
-
-		protected void focusLost() {
-//		  System.out.println("CELLEDITOR FOCUS LOST");
-			if (isActivated()) {
-				applyEditorValueAndDeactivate();
-			}
-		}
-		
-		protected void keyReleaseOccured(KeyEvent keyEvent) {
-			if (keyEvent.character == '\u001b') { // Escape character
-			  comboBox.setText(""); // clear text
-				fireCancelEditor();
-			} else if (keyEvent.character == '\r') { // Return key
-				//fireApplyEditorValue();
-				applyEditorValueAndDeactivate();
-				deactivate();
-			}
-		}
-
-		void applyEditorValueAndDeactivate() {
-			//	must set the selection before getting value
-			selection = comboBox.getSelectionIndex();
-			if (selection < 0)
-			{
-			  deactivate();
-			  return;
-			}
-			// Object newValue = new Integer(selection);
-      Object newValue = fItems[selection];
-			markDirty();
-			boolean isValid = isCorrect(newValue);
-			setValueValid(isValid);
-			if (!isValid) {
-				// try to insert the current value into the error message.
-				setErrorMessage(
-					MessageFormat.format(getErrorMessage(), new Object[] {fItems[selection]})); 
-			}
-			doSetValue(newValue);
-			fireApplyEditorValue();
-			deactivate();
-		}
-
-    protected Object doGetValue() {
-      return fValue;
-      // otherwise limits to set of valid values
-//      Object index = super.doGetValue();
-//      int selection = -1;
-//      if (index instanceof Integer)
-//        selection = ((Integer) index).intValue();
-//      if (selection >= 0)
-//        return fItems[selection];
-//      else if (getControl() instanceof CCombo) {
-//        // retrieve the actual text as the list of valid items doesn't contain the value
-//        return ((CCombo) getControl()).getText();
-//      }
-//      return null;
-    }
-    private boolean fSettingValue = false;
-    protected void doSetValue(Object value) {
-      if (fSettingValue)
-        return;
-      fSettingValue = true;
-      if (value instanceof Integer) {
-        //super.doSetValue(value);
-        fValue = value;
-      }
-      else {
-        String stringValue = value.toString();
-        int selection = -1;
-        for (int i = 0; i < fItems.length; i++)
-          if (fItems[i].equals(stringValue))
-            selection = i;
-        if (selection >= 0)
-          //super.doSetValue(new Integer(selection));
-          fValue = stringValue;
-        else {
-          // super.doSetValue(new Integer(-1));
-          // fValue = new Integer(-1);
-          fValue = stringValue;
-          if (getControl() instanceof CCombo && !stringValue.equals(((CCombo) getControl()).getText())) {
-            // update the Text widget
-            ((CCombo) getControl()).setText(stringValue);
-          }
-        }
-      }
-      fSettingValue = false;
-    }		
-		
-	/**
-		* Returns the cell editor's value.
-		*/
-//		protected Object doGetValue() 
-//		{
-//			return fValue;
-//		}
-
-	/**
-	 * Set the focus to the cell editor's UI representation.
-	 */
-		protected void doSetFocus()
-		{
-//			fButton.setFocus();
-//      System.out.println("doSetFocus() " + moreButton.setFocus());
-      comboBox.setFocus();
-		}
-
-	/**
-	 * Sets the value of the cell editor to the given value.
-	 */
-//		protected void doSetValue(Object value)
-//		{
-//			fValue = value;
-//		}
-
-		protected void fillPopupList(PopupList list) 
-		{
-			String[] labels= new String[fItems.length];
-			for (int i= 0; i < labels.length; i++)
-			{
-				String item= fItems[i];
-				labels[i]= item;
-//				System.out.println(fItems[i]);
-				if (fSelection == null && fValue != null && fValue.equals(item)) 
-				{
-					fSelection = item;
-				}
-			}
-
-			list.setItems(labels);
-			if (fSelection != null) 
-			{
-//				fText.setText(fSelection);
-				list.select(fSelection);
-			}	
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDPropertySourceProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDPropertySourceProvider.java
deleted file mode 100644
index 78e790b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/XSDPropertySourceProvider.java
+++ /dev/null
@@ -1,285 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties;
-
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class XSDPropertySourceProvider implements IPropertySourceProvider
-{
-  XSDSchema xsdSchema;
-  /**
-   * 
-   * @todo Generated comment
-   */
-  public XSDPropertySourceProvider()
-  {
-    super();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.ui.views.properties.IPropertySourceProvider#getPropertySource(java.lang.Object)
-   */
-  public IPropertySource getPropertySource(Object object)
-  {
-    if (object == null) return null;
-    
-    if (object instanceof XSDConcreteComponent)
-    {
-      XSDConcreteComponent component = (XSDConcreteComponent)object;
-      
-      xsdSchema = component.getSchema();
-      
-      if (component instanceof XSDElementDeclaration)
-      {
-        XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)component;
-        if (elementDeclaration.isElementDeclarationReference())
-        {
-          component = elementDeclaration.getResolvedElementDeclaration();
-        }
-      }
-      
-      Element input = component.getElement(); 
-      
-      BasePropertySource bps = (BasePropertySource)getXSDPropertySource(input);
-      if (bps == null) return null;
-      
-      bps.setInput(input);
-      return bps;
-    }
-    return null;
-  }
-  
-  boolean showParent = false;
-  
-  public IPropertySource getXSDPropertySource(Object object)
-  {
-    Element input = (Element)object;
-
-    showParent = false;
-  
-    if (inputEquals(input, XSDConstants.ELEMENT_ELEMENT_TAG, false))
-    {
-      return new ElementPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.ELEMENT_ELEMENT_TAG, true))
-    {
-      return new GroupRefPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
-              inputEquals(input, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
-              inputEquals(input, XSDConstants.ALL_ELEMENT_TAG, false))
-    {
-      return new ModelGroupPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
-    {
-      return new AttributePropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
-    {
-      return new AttributeGroupRefPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false))
-    {
-      return new NamePropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true))
-    {
-      return new AttributeGroupRefPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.NOTATION_ELEMENT_TAG, false))
-    {
-      return new NotationPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-    {
-      return new SimpleTypePropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.GROUP_ELEMENT_TAG, false))
-    {
-      return new NamePropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.GROUP_ELEMENT_TAG, true))
-    {
-      return new GroupRefPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.SCHEMA_ELEMENT_TAG, false))
-    {
-      return new SchemaPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
-    {
-      return new ComplexTypePropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.DOCUMENTATION_ELEMENT_TAG, false))
-    {
-      return new DocumentationPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.APPINFO_ELEMENT_TAG, false))
-    {
-      return new AppInfoPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-    {
-      if (input != null && input instanceof Element)
-      {
-        Element parent = (Element)input;
-        XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
-        Element derivedByNode = xsdDOMHelper.getDerivedByElement(parent);
-        if (derivedByNode != null)
-        {
-          if (inputEquals(derivedByNode, XSDConstants.RESTRICTION_ELEMENT_TAG, false) || 
-              inputEquals(derivedByNode, XSDConstants.EXTENSION_ELEMENT_TAG, false))
-          {
-            return new SimpleContentPropertySource(xsdSchema);
-          }
-        }
-        else
-        {
-          return null;
-        }
-      }
-    }
-    else if (inputEquals(input, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-    {
-      if (input != null && input instanceof Element)
-      {
-        Element parent = (Element)input;
-        XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
-        Element derivedByNode = xsdDOMHelper.getDerivedByElement(parent);
-        if (derivedByNode != null)
-        {
-          return new SimpleContentPropertySource(xsdSchema);
-        }
-        else
-        {
-          return null;
-        }
-      }
-    }
-    else if (inputEquals(input, XSDConstants.LIST_ELEMENT_TAG, false))
-    {
-      return new SimpleTypeListPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.UNION_ELEMENT_TAG, false))
-    {
-      return new SimpleTypeUnionPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
-    {
-      return createRestrictWindow(input, xsdSchema);
-    }
-    else if (XSDDOMHelper.isFacet(input))
-    {
-      if (input != null && input instanceof Element)
-      {
-        Node parent = ((Element)input).getParentNode();
-        if (inputEquals(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false))
-        {
-          return createRestrictWindow(input, xsdSchema);
-        } 
-      }
-    }
-    else if (inputEquals(input, XSDConstants.EXTENSION_ELEMENT_TAG, false))
-    {
-      if (input != null && input instanceof Element)
-      {
-        Node parent = ((Element)input).getParentNode();
-        if (inputEquals(parent, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false)
-            || inputEquals(parent, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-        {
-          showParent = true;
-          return new SimpleContentPropertySource(xsdSchema);
-        }
-      }
-    }
-    else if (inputEquals(input, XSDConstants.PATTERN_ELEMENT_TAG, false))
-    {
-      return new PatternPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.ENUMERATION_ELEMENT_TAG, false))
-    {
-      return new EnumerationPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.ANY_ELEMENT_TAG, false))
-    {
-      return new AnyElementPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false))
-    {
-      return new AnyAttributePropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.UNIQUE_ELEMENT_TAG, false))
-    {
-      return new NamePropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.KEYREF_ELEMENT_TAG, false))
-    {
-      return new KeyrefPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.SELECTOR_ELEMENT_TAG, false))
-    {
-      return new XPathPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.FIELD_ELEMENT_TAG, false))
-    {
-      return new XPathPropertySource(xsdSchema);
-    }
-    else if (inputEquals(input, XSDConstants.KEY_ELEMENT_TAG, false))
-    {
-      return new NamePropertySource(xsdSchema);
-    }
-    else
-    {
-      return null;
-    }
-    return null;
-  }
-
-  protected IPropertySource createRestrictWindow(Object input, XSDSchema xsdSchema)
-  {
-    // special case where SimpleType restriction is different than SimpleContent restriction
-
-    if (input != null && input instanceof Element)
-    {
-      Node parent = ((Element)input).getParentNode();
-      if (inputEquals(parent, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-      {
-        return new SimpleRestrictPropertySource(xsdSchema);
-      }
-      else if (inputEquals(parent, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-      {
-        return new SimpleRestrictPropertySource(xsdSchema);
-      }
-      else if (inputEquals(parent, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-      {
-        showParent = true;
-        return new SimpleContentPropertySource(xsdSchema);
-      }
-    }
-    return null;
-  }
-
-
-  protected boolean inputEquals(Object input, String tagname, boolean isRef)
-  {
-    return XSDDOMHelper.inputEquals(input, tagname, isRef);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSection.java
deleted file mode 100644
index 9f4bd90..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSection.java
+++ /dev/null
@@ -1,495 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetPage;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateElementAction;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class AbstractSection implements ISection, IPropertyChangeListener, Listener, SelectionListener
-{
-	private TabbedPropertySheetWidgetFactory factory;
-	protected IWorkbenchPart part;
-	protected ISelection selection;
-	protected Object input;
-  protected boolean doRefresh = true;
-	XSDSchema xsdSchema;
-  protected boolean isReadOnly = false;
-  private IStatusLineManager statusLine;
-  protected Composite composite;
-  protected int rightMarginSpace;
-  protected int tableMinimumWidth = 50;
- 
-  /**
-   * 
-   */
-  public AbstractSection()
-  {
-    super();
-  }
-  
-  public void createControls(Composite parent,	TabbedPropertySheetPage tabbedPropertySheetPage)
-  {
-    createControls(parent, tabbedPropertySheetPage.getWidgetFactory());
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-   */
-  public void createControls(Composite parent, TabbedPropertySheetWidgetFactory aFactory)
-  {
-		this.factory = aFactory;
-    GC gc = new GC(parent);
-    Point extent = gc.textExtent("  ...  ");
-    rightMarginSpace = extent.x;
-    gc.dispose();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#setInput(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public void setInput(IWorkbenchPart part, ISelection selection)
-  {
-		Assert.isTrue(selection instanceof IStructuredSelection);
-		this.part = part;
-		this.selection = selection;
-		Object input = ((IStructuredSelection)selection).getFirstElement();
-    this.input = input;
-    
-    if (input instanceof XSDConcreteComponent)
-    {
-      xsdSchema = ((XSDConcreteComponent)input).getSchema();
-      
-      Element element = ((XSDConcreteComponent)input).getElement();
-      if (element instanceof IDOMNode)
-      {
-        isReadOnly = false;
-      }
-      else
-      {
-        isReadOnly = true;
-      }
-    }
-    statusLine = getStatusLine();
-    clearErrorMessage();
-
-//		refresh();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#aboutToBeShown()
-   */
-  public void aboutToBeShown()
-  {
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#aboutToBeHidden()
-   */
-  public void aboutToBeHidden()
-  {
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#dispose()
-   */
-  public void dispose()
-  {
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#getMinimumHeight()
-   */
-  public int getMinimumHeight()
-  {
-    return SWT.DEFAULT;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-   */
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#refresh()
-   */
-  public void refresh()
-  {
-  }
-
-  public Object getInput()
-  {
-    if (input instanceof Element)
-    {
-      input = xsdSchema.getCorrespondingComponent((Element)input);
-    }
-    return input;
-  }
-  
-  public XSDSchema getSchema()
-  {
-    return xsdSchema;
-  }
-  
-	/**
-	 * Get the widget factory.
-	 * @return the widget factory.
-	 */
-	public TabbedPropertySheetWidgetFactory getWidgetFactory() {
-		return factory;
-	}
-
-	public void propertyChange(PropertyChangeEvent event)
-	{
-    refresh();
-	}
-
-	
-  public void doWidgetDefaultSelected(SelectionEvent e)
-  {}
-  
-  public void doWidgetSelected(SelectionEvent e)
-  {}
-  
-  /**
-   * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(SelectionEvent)
-   */
-  public void widgetDefaultSelected(SelectionEvent e)
-  {
-    if (isListenerEnabled() &&
-        getInput() != null &&
-        !isInDoHandle &&
-        !isReadOnly) 
-    {
-      isInDoHandle = true;
-      doWidgetDefaultSelected(e);
-      isInDoHandle = false;
-    }
-    
-  }
-
-  /**
-   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
-   */
-  public void widgetSelected(SelectionEvent e)
-  {
-    if (isListenerEnabled() &&
-        getInput() != null &&
-        !isInDoHandle &&
-        !isReadOnly) 
-    {
-      isInDoHandle = true;
-      doWidgetSelected(e);
-      isInDoHandle = false;
-    }
-    
-  }
-  
-  boolean listenerEnabled = true;
-  /**
-   * Get the value of listenerEnabled.
-   * @return value of listenerEnabled.
-   */
-  public boolean isListenerEnabled() 
-  {
-    return listenerEnabled;
-  }
-  
-  /**
-   * Set the value of listenerEnabled.
-   * @param v  Value to assign to listenerEnabled.
-   */
-  public void setListenerEnabled(boolean  v) 
-  {
-    this.listenerEnabled = v;
-  }
-
-  public void handleEvent(Event event)
-  {
-    if (isListenerEnabled() && !isInDoHandle && !isReadOnly) 
-    {
-      isInDoHandle = true;
-      startDelayedEvent(event);
-      isInDoHandle = false;
-    } // end of if ()
-  }
-  
-  public void doHandleEvent(Event event)
-  {
-    
-  }
-  
-  protected DelayedEvent delayedTask;
-  
-  protected void startDelayedEvent(Event e)
-  {
-    if (delayedTask == null ||
-      delayedTask.getEvent() == null)
-    {
-      delayedTask = new DelayedEvent();
-      delayedTask.setEvent(e);
-      Display.getDefault().timerExec(500,delayedTask);
-    }
-    else
-    {
-      Event delayedEvent = delayedTask.getEvent();
-      
-      if (e.widget == delayedEvent.widget &&
-        e.type == delayedEvent.type)
-      {
-        // same event, just different data, delay new event
-        delayedTask.setEvent(null);
-      }
-      delayedTask = new DelayedEvent();
-      delayedTask.setEvent(e);
-      Display.getDefault().timerExec(500,delayedTask);
-    }
-  }
-  
-  class DelayedEvent implements Runnable
-  {
-    protected Event event;
-    
-    /*
-     * @see Runnable#run()
-     */
-    public void run()
-    {
-      if (event != null)
-      {
-        isInDoHandle = true;
-        doHandleEvent(event);
-        isInDoHandle = false;
-        event = null;
-      }
-    }
-    
-    /**
-     * Gets the event.
-     * @return Returns a Event
-     */
-    public Event getEvent()
-    {
-      return event;
-    }
-
-    /**
-     * Sets the event.
-     * @param event The event to set
-     */
-    public void setEvent(Event event)
-    {
-      this.event = event;
-    }
-
-  }
-
-  boolean isInDoHandle;
-  /**
-   * Get the value of isInDoHandle.
-   * @return value of isInDoHandle.
-   */
-  public boolean isInDoHandle() 
-  {
-    return isInDoHandle;
-  }
-
-  
-  protected IEditorPart getActiveEditor()
-  {
-    IWorkbench workbench = XSDEditorPlugin.getPlugin().getWorkbench();
-    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-    IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-//    IEditorPart editorPart = part.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();
-
-    return editorPart;
-  }
-
-  static protected IStatusLineManager getStatusLineManager(IEditorPart editorPart)
-  { 
-    IStatusLineManager result = null;
-    try
-    {                       
-      EditorActionBarContributor contributor = (EditorActionBarContributor)editorPart.getEditorSite().getActionBarContributor();
-      result = contributor.getActionBars().getStatusLineManager();
-    }
-    catch (Exception e)
-    {
-    }  
-    return result;
-  }
-
-  protected XSDDOMHelper domHelper = new XSDDOMHelper();
-  /**
-   * Gets the domHelper.
-   * @return Returns a XSDDomHelper
-   */
-  public XSDDOMHelper getDomHelper()
-  {
-    return domHelper;
-  }
-  
-  public DocumentImpl getDocument(Element element)
-  {
-    return (DocumentImpl) element.getOwnerDocument();
-  }
-
-  public void beginRecording(String description, Element element)
-  {
-    getDocument(element).getModel().beginRecording(this, description);
-  }
-  
-  public void endRecording(Element element)
-  {
-    DocumentImpl doc = (DocumentImpl) getDocument(element);
-    
-    doc.getModel().endRecording(this);    
-  }
-
-  protected boolean validateName(String name)
-  {
-    try
-    {
-      return NameValidator.isValid(name);
-    }
-    catch (Exception e)
-    {
-      return false;
-    }
-  }
-
-  // TODO
-  protected boolean validateLanguage(String lang)
-  {
-    return true;
-  }
-
-  // TODO
-  protected boolean validatePrefix(String prefix)
-  {
-    return true;
-  }
-
-  
-  protected Action getNewElementAction(String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    CreateElementAction action = new CreateElementAction(label);
-    action.setElementTag(elementTag);
-    action.setAttributes(attributes);
-    action.setParentNode(parent);
-    action.setRelativeNode(relativeNode);
-    action.setXSDSchema(getSchema());
-    action.setSelectionProvider(null);
-    return action;
-  }
-
-  public void setErrorMessage(String message)
-  {
-    if (statusLine != null)
-    {
-      statusLine.setErrorMessage(message);
-      statusLine.update(true);
-    }
-  }
-
-  public void clearErrorMessage()
-  {
-    if (statusLine != null)
-    {
-      statusLine.setErrorMessage(null);
-      statusLine.update(false);
-    }
-  }
-
-  EditorActionBarContributor contributor;
-  protected IStatusLineManager getStatusLine()
-  {
-//    IWorkbench workbench = XSDEditorPlugin.getPlugin().getWorkbench();
-//    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-    IEditorPart editorPart = part.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();
-    
-    if (statusLine == null)
-    {
-      try
-      {                       
-        contributor = (EditorActionBarContributor)editorPart.getEditorSite().getActionBarContributor();
-        statusLine = contributor.getActionBars().getStatusLineManager();
-      }
-      catch (Exception e)
-      {
-      }  
-    }
-    return statusLine;
-  }
-  
-  /**
-   * Get the standard label width when labels for sections line up on the left
-   * hand side of the composite. We line up to a fixed position, but if a
-   * string is wider than the fixed position, then we use that widest string.
-   * 
-   * @param parent
-   *            The parent composite used to create a GC.
-   * @param labels
-   *            The list of labels.
-   * @return the standard label width.
-   */
-  protected int getStandardLabelWidth(Composite parent, String[] labels) {
-    int standardLabelWidth = 100;   // STANDARD_LABEL_WIDTH;
-    GC gc = new GC(parent);
-    int indent = gc.textExtent("XXX").x; //$NON-NLS-1$
-    for (int i = 0; i < labels.length; i++) {
-      int width = gc.textExtent(labels[i]).x;
-      if (width + indent > standardLabelWidth) {
-        standardLabelWidth = width + indent;
-      }
-    }
-    gc.dispose();
-    return standardLabelWidth;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSectionDescriptor.java
deleted file mode 100644
index 1cbcf10..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AbstractSectionDescriptor.java
+++ /dev/null
@@ -1,113 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITypeMapper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-public class AbstractSectionDescriptor implements ISectionDescriptor
-{
-  /**
-   * 
-   */
-  public AbstractSectionDescriptor()
-  {
-    super();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getFilter()
-   */
-  public ITypeMapper getFilter()
-  {
-    return null;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDConcreteComponent.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return null;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return null;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDConcreteComponent || object instanceof Element)
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getAfterSection()
-   */
-  public String getAfterSection()
-  {
-    return "";
-  }
-
-  protected boolean inputEquals(Object input, String tagname, boolean isRef)
-  {
-    return XSDDOMHelper.inputEquals(input, tagname, isRef);
-  }
-  
-  public int getEnablesFor()
-  {
-	return ENABLES_FOR_ANY;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSection.java
deleted file mode 100644
index e756ea7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSection.java
+++ /dev/null
@@ -1,592 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFacet;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.XSDXPathDefinition;
-import org.eclipse.xsd.impl.XSDFactoryImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class AnnotationSection extends AbstractSection
-{
-  DocumentationWorkbookPage documentationPage;
-  AppInfoWorkbookPage appInfoPage;
-  XSDWorkbook workbook;
-  XSDFactory factory;
-  
-  /**
-   * 
-   */
-  public AnnotationSection()
-  {
-    super();
-    factory = new XSDFactoryImpl();
-  }
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-	{
-      super.createControls(parent, factory);
-
-      workbook = new XSDWorkbook(parent, SWT.BOTTOM | SWT.FLAT);
-    
-      documentationPage = new DocumentationWorkbookPage(workbook);
-      appInfoPage = new AppInfoWorkbookPage(workbook);
-
-      documentationPage.activate();
-      appInfoPage.activate();
-      workbook.setSelectedPage(documentationPage);
-    }
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-    if (doRefresh)
-    {
-      if (documentationPage.getDocumentationText().isFocusControl() || appInfoPage.getAppInfoText().isFocusControl())
-      {
-        return;
-      }
-      
-      if (isReadOnly)
-      {
-        documentationPage.setEnabled(false);
-        appInfoPage.setEnabled(false);
-      }
-      else
-      {
-        documentationPage.setEnabled(true);
-        appInfoPage.setEnabled(true);
-      }
-      setListenerEnabled(false);
-	    Object input = getInput();
-	    if (input != null)
-	    {
-	      XSDAnnotation xsdAnnotation = getInputXSDAnnotation(false);
-        setInitialText(xsdAnnotation);
-      }
-      setListenerEnabled(true);
-	  }
-	}
-
-  
-  public void doHandleEvent(Event event)
-  {
-    Object input = getInput();
-    if (input != null)
-    {
-      XSDAnnotation xsdAnnotation = getInputXSDAnnotation(true);
-  
-      if (event.widget == documentationPage.getDocumentationText())
-      {
-        documentationPage.doHandleEvent(xsdAnnotation);
-      }
-      else if (event.widget == appInfoPage.getAppInfoText())
-      {
-        appInfoPage.doHandleEvent(xsdAnnotation);
-      }
-    }
-    
-  }
-  
-  protected XSDAnnotation getInputXSDAnnotation(boolean createIfNotExist)
-  {
-    XSDAnnotation xsdAnnotation = null;
-    
-    if (input instanceof XSDAttributeDeclaration)
-    {
-      XSDAttributeDeclaration xsdComp = (XSDAttributeDeclaration)input; 
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDAttributeGroupDefinition)
-    {
-      XSDAttributeGroupDefinition xsdComp = (XSDAttributeGroupDefinition)input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDElementDeclaration)
-    {
-      XSDElementDeclaration xsdComp = (XSDElementDeclaration)input; 
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDNotationDeclaration)
-    {
-      XSDNotationDeclaration xsdComp =(XSDNotationDeclaration)input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDXPathDefinition)
-    {
-      XSDXPathDefinition xsdComp = (XSDXPathDefinition)input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDModelGroup)
-    {
-      XSDModelGroup xsdComp = (XSDModelGroup)input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDModelGroupDefinition)
-    {
-      XSDModelGroupDefinition xsdComp = (XSDModelGroupDefinition)input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDIdentityConstraintDefinition)
-    {
-      XSDIdentityConstraintDefinition xsdComp = (XSDIdentityConstraintDefinition)input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDWildcard)
-    {
-      XSDWildcard xsdComp = (XSDWildcard)input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDSchema)
-    {
-      XSDSchema xsdComp = (XSDSchema)input;
-      List list = xsdComp.getAnnotations();
-      if (list.size() > 0)
-      {
-        xsdAnnotation = (XSDAnnotation)list.get(0);
-      }
-      else
-      {
-        if (createIfNotExist && xsdAnnotation == null)
-        {
-          xsdAnnotation = factory.createXSDAnnotation();
-          if (xsdComp.getContents() != null)
-          {
-            xsdComp.getContents().add(0, xsdAnnotation);
-          }
-        }
-      }
-      return xsdAnnotation;
-    }
-    else if (input instanceof XSDFacet)
-    {
-      XSDFacet xsdComp = (XSDFacet)input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDTypeDefinition)
-    {
-      XSDTypeDefinition xsdComp = (XSDTypeDefinition)input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDInclude)
-    {
-      XSDInclude xsdComp = (XSDInclude)input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDImport)
-    {
-      XSDImport xsdComp = (XSDImport)input;
-      xsdAnnotation = xsdComp.getAnnotation();
-      if (createIfNotExist && xsdAnnotation == null)
-      {
-        xsdAnnotation = factory.createXSDAnnotation();
-        xsdComp.setAnnotation(xsdAnnotation);
-      }
-    }
-    else if (input instanceof XSDRedefine)
-    {
-      XSDRedefine xsdComp = (XSDRedefine)input;
-      List list = xsdComp.getAnnotations();
-      if (list.size() > 0)
-      {
-        xsdAnnotation = (XSDAnnotation)list.get(0);
-      }
-      else
-      {
-        if (createIfNotExist && xsdAnnotation == null)
-        {
-// ?
-        }
-      }
-      return xsdAnnotation;
-    }
-    else if (input instanceof XSDAnnotation)
-    {
-      xsdAnnotation = (XSDAnnotation)input;
-    }
-    
-    if (createIfNotExist)
-    {
-      formatAnnotation(xsdAnnotation);
-    }
-
-    return xsdAnnotation;
-  }
-  
-  private void formatAnnotation(XSDAnnotation annotation)
-  {
-    Element element = annotation.getElement();
-    XSDDOMHelper.formatChild(element);
-  }
-  
-
-  public boolean shouldUseExtraSpace()
-  {
-    return true;
-  }
-
-  public void dispose()
-  {
-    factory = null;
-  }
-  
-  private void setInitialText(XSDAnnotation an)
-  {
-    if (documentationPage != null)
-    {
-      documentationPage.setText(""); //$NON-NLS-1$
-    }
-    if (appInfoPage != null)
-    {
-      appInfoPage.setText(""); //$NON-NLS-1$
-    }
-
-    if (an != null)
-    {
-      Element element = an.getElement();
-      try
-      {
-        if (element.hasChildNodes())
-         {
-          // if the element is Text
-          Element docElement = (Element)domHelper.getChildNode(element, XSDConstants.DOCUMENTATION_ELEMENT_TAG);
-          if (docElement != null)
-          {
-            Node node = docElement.getFirstChild();
-            if (node instanceof CharacterData)
-            {
-              documentationPage.setText( ((CharacterData)node).getData());
-            }
-          }
-          
-          Element appInfoElement = (Element)domHelper.getChildNode(element, XSDConstants.APPINFO_ELEMENT_TAG);
-          if (appInfoElement != null)
-          {
-            Node node = appInfoElement.getFirstChild();
-            if (node instanceof CharacterData)
-            {
-              appInfoPage.setText( ((CharacterData)node).getData());
-            }
-          }
-
-        }
-      }
-      catch (Exception e)
-      {
-        
-      }
-    }
-  }
-  
- 
-  class DocumentationWorkbookPage extends XSDWorkbookPage
-  {
-    Text documentationText;
-    Composite page1;
-    
-    public DocumentationWorkbookPage(XSDWorkbook workbook)
-    {
-      super(workbook);
-      this.getTabItem().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_DOCUMENTATION")); 
-    }
-
-    public void setText(String value)
-    {
-      documentationText.setText(value);
-    }
-    
-    public void setEnabled(boolean state)
-    {
-      page1.setEnabled(state);
-    }
-    
-    public String getText()
-    {
-      return documentationText.getText();
-    }
-    
-    public Text getDocumentationText()
-    {
-      return documentationText;
-    }
-    
-    public Control createControl (Composite parent)
-    {
-      page1 = getWidgetFactory().createFlatFormComposite(parent);
-      documentationText = getWidgetFactory().createText(page1, "", SWT.V_SCROLL | SWT.H_SCROLL); //$NON-NLS-1$
-      documentationText.addListener(SWT.Modify, AnnotationSection.this);
-
-      FormData data = new FormData();
-      data.left = new FormAttachment(0, 0);
-      data.right = new FormAttachment(100, 0);
-      data.top = new FormAttachment(0, 0);
-      data.bottom = new FormAttachment(100, 0);
-      documentationText.setLayoutData(data);
-                  
-      return page1;
-    }
-    
-    public void doHandleEvent(XSDAnnotation xsdAnnotation)
-    {
-      if (xsdAnnotation != null)
-      {
-        Element element = xsdAnnotation.getElement();
-        List documentationList = xsdAnnotation.getUserInformation();
-        Element documentationElement = null;
-        if (documentationList.size() > 0)
-        {
-          documentationElement = (Element)documentationList.get(0);
-        }
-        
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_DOCUMENTATION_COMMENT_CHANGE"), element); //$NON-NLS-1$
-        
-        if (documentationElement == null)
-        {
-          documentationElement = xsdAnnotation.createUserInformation(null);
-          element.appendChild(documentationElement);
-          XSDDOMHelper.formatChild(documentationElement);
-          // Defect in model....I create it but the model object doesn't appear to be updated
-          // Notice that it is fine for appinfo
-          xsdAnnotation.updateElement();
-          xsdAnnotation.setElement(element);
-        }
-        
-        String newValue = documentationText.getText();
-        if (documentationElement != null)
-        {
-          try
-          {
-            if (documentationElement.hasChildNodes())
-            {
-            // if the element is Text
-              Node node = documentationElement.getFirstChild();
-              if (node instanceof CharacterData)
-              {
-                ((CharacterData)node).setData(newValue);
-              }
-            }
-            else
-            {
-              if (newValue.length() > 0)
-              {
-                Node childNode = documentationElement.getOwnerDocument().createTextNode(newValue);
-                documentationElement.appendChild(childNode);
-              }
-            }
-          }
-          catch (Exception e)
-          {
-          
-          }
-        }
-        endRecording(element);
-      }    
-    }
-  }
-  
-  class AppInfoWorkbookPage extends XSDWorkbookPage
-  {
-    Text appInfoText;
-    Composite page2;
-    
-    public AppInfoWorkbookPage(XSDWorkbook workbook)
-    {
-      super(workbook);
-      this.getTabItem().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_APP_INFO"));
-    }
-    
-    public void setText(String value)
-    {
-      appInfoText.setText(value);
-    }
-
-    public String getText()
-    {
-      return appInfoText.getText();
-    }
-
-    public Text getAppInfoText()
-    {
-      return appInfoText;
-    }
-
-    public void setEnabled(boolean state)
-    {
-      page2.setEnabled(state);
-    }
-
-    public Control createControl (Composite parent)
-    {
-      page2 = getWidgetFactory().createFlatFormComposite(parent);
-      appInfoText = getWidgetFactory().createText(page2, "", SWT.V_SCROLL | SWT.H_SCROLL); //$NON-NLS-1$
-      appInfoText.addListener(SWT.Modify, AnnotationSection.this);
-      
-      FormData data = new FormData();
-      data.left = new FormAttachment(0, 0);
-      data.right = new FormAttachment(100, 0);
-      //data.top = new FormAttachment(documentationText, +ITabbedPropertyConstants.HSPACE);
-      data.top = new FormAttachment(0, 0);
-      data.bottom = new FormAttachment(100, 0);
-      appInfoText.setLayoutData(data);
-
-      return page2;
-    }
-    
-    public void doHandleEvent(XSDAnnotation xsdAnnotation)
-    {
-      if (xsdAnnotation != null)
-      {
-        Element element = xsdAnnotation.getElement();
-        List appInfoList = xsdAnnotation.getApplicationInformation();
-        
-        Element appInfoElement = null;
-        if (appInfoList.size() > 0)
-        {
-          appInfoElement = (Element)appInfoList.get(0);
-        }
-
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_COMMENT_CHANGE"), element); //$NON-NLS-1$
-        if (appInfoElement == null)
-        {
-          appInfoElement = xsdAnnotation.createApplicationInformation(null);
-          element.appendChild(appInfoElement);
-          XSDDOMHelper.formatChild(appInfoElement);
-        }
-        
-        String newValue = appInfoText.getText();
-        if (appInfoElement != null)
-        {
-          try
-          {
-            if (appInfoElement.hasChildNodes())
-            {
-              // if the element is Text
-              Node node = appInfoElement.getFirstChild();
-              if (node instanceof CharacterData)
-              {
-                ((CharacterData)node).setData(newValue);
-              }
-            }
-            else
-            {
-              if (newValue.length() > 0)
-              {
-                Node childNode = appInfoElement.getOwnerDocument().createTextNode(newValue);
-                appInfoElement.appendChild(childNode);
-              }
-            }
-          }
-          catch (Exception e)
-          {
-
-          }
-          endRecording(element);          
-        }
-      }    
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSectionDescriptor.java
deleted file mode 100644
index 93bd523..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AnnotationSectionDescriptor.java
+++ /dev/null
@@ -1,109 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFacet;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.XSDXPathDefinition;
-
-public class AnnotationSectionDescriptor extends AbstractSectionDescriptor
-{
-  /**
-   * 
-   */
-  public AnnotationSectionDescriptor()
-  {
-    super();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.xsdeditor.section.annotation";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDAnnotation.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new AnnotationSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.documentation";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDAttributeDeclaration ||
-          object instanceof XSDAttributeGroupDefinition ||
-          object instanceof XSDElementDeclaration ||
-          object instanceof XSDNotationDeclaration ||
-          object instanceof XSDXPathDefinition ||
-          object instanceof XSDModelGroup ||
-          object instanceof XSDModelGroupDefinition ||
-          object instanceof XSDIdentityConstraintDefinition ||
-          object instanceof XSDWildcard ||
-          object instanceof XSDSchema ||
-          object instanceof XSDFacet || 
-          object instanceof XSDTypeDefinition ||
-          object instanceof XSDAnnotation ||
-          object instanceof XSDSchemaDirective)
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewContentProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewContentProvider.java
deleted file mode 100644
index b5ffe41..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewContentProvider.java
+++ /dev/null
@@ -1,289 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.edit.provider.INotifyChangedListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDAbstractAdapter;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDAdapterFactoryLabelProvider;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDModelAdapterFactoryImpl;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-
-public class AttributesViewContentProvider implements ITreeContentProvider, ITableLabelProvider, ILabelProvider, INotifyChangedListener
-{
-  IEditorPart editorPart;
-
-  static XSDModelAdapterFactoryImpl xsdModelAdapterFactory = XSDModelAdapterFactoryImpl.getInstance();
-  static XSDAdapterFactoryLabelProvider adapterFactoryLabelProvider = new XSDAdapterFactoryLabelProvider(xsdModelAdapterFactory);  // XSDTextEditor.getLabelProvider();
-  
-  XSDAbstractAdapter elementAdapter;
-  XSDAbstractAdapter ctAdapter;
-  XSDComplexTypeDefinition ct;
-  
-  /**
-   * 
-   */
-  public AttributesViewContentProvider()
-  {
-    super();
-//    if (xsdModelAdapterFactory instanceof IChangeNotifier)
-//    {
-//      ((IChangeNotifier)xsdModelAdapterFactory).addListener(this);
-//    }
-
-  }
-  
-  Viewer attributesViewer;
-  public AttributesViewContentProvider(IEditorPart editorPart, Viewer viewer)
-  {
-    super();
-    this.editorPart = editorPart;
-    this.attributesViewer = viewer;
-  }
-  
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
-   */
-  public Object[] getChildren(Object inputElement)
-  {
-    List list = new ArrayList();
-    ct = null;
-    if (inputElement instanceof XSDElementDeclaration)
-    {
-      XSDElementDeclaration xsdElement = (XSDElementDeclaration)inputElement;
-      
-      if (elementAdapter != null)
-      {
-        elementAdapter.removeListener((INotifyChangedListener)this);
-      }
-      elementAdapter = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt(xsdElement, xsdModelAdapterFactory);
-      elementAdapter.addListener((INotifyChangedListener)this);
-
-      if (xsdElement.getAnonymousTypeDefinition() instanceof XSDComplexTypeDefinition)
-      {
-        ct = (XSDComplexTypeDefinition)xsdElement.getAnonymousTypeDefinition();
-      }
-      else
-      {
-        XSDTypeDefinition xsdType = xsdElement.getTypeDefinition();
-        if (xsdType instanceof XSDComplexTypeDefinition)
-        {
-          ct = (XSDComplexTypeDefinition)xsdType;
-        }
-      }
-    }
-    else if (inputElement instanceof XSDComplexTypeDefinition)
-    {
-      ct = (XSDComplexTypeDefinition)inputElement;
-    }
-
-    if (ct != null)
-    {
-      if (ctAdapter != null)
-      {
-        ctAdapter.removeListener((INotifyChangedListener)this);
-      }
-      ctAdapter = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt(ct, xsdModelAdapterFactory);
-      ctAdapter.addListener((INotifyChangedListener)this);
-      
-      XSDWildcard wildcard = ct.getAttributeWildcardContent();
-      if (wildcard != null)
-      {
-        list.add(wildcard);
-      }
-      
-      Iterator i = ct.getAttributeContents().iterator();
-      while (i.hasNext())
-      {
-        XSDAttributeGroupContent attributeGroupContent = (XSDAttributeGroupContent)i.next();
-        if (attributeGroupContent instanceof XSDAttributeGroupDefinition)
-        {
-          XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition)attributeGroupContent;
-          XSDAbstractAdapter a = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt(attributeGroupDefinition, xsdModelAdapterFactory);
-          a.removeListener((INotifyChangedListener)this);
- 	        a.addListener((INotifyChangedListener)this);
- 	        list.add(attributeGroupDefinition);
-        }
-        else if (attributeGroupContent instanceof XSDAttributeUse)
-        {
-          XSDAttributeUse attributeUse = (XSDAttributeUse)attributeGroupContent;
-          
-          XSDAttributeDeclaration attribute = attributeUse.getAttributeDeclaration();
-          
-          boolean isRef = XSDDOMHelper.isAttributeRef(ct.getElement(), attribute.getQName(), attribute.getTargetNamespace());
-         
-          if (isRef)
-          {
-            XSDAbstractAdapter a = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt(attributeUse, xsdModelAdapterFactory);            
-            a.removeListener((INotifyChangedListener)this);
-   	        a.addListener((INotifyChangedListener)this);
-            list.add(attributeUse);
-          }
-          else
-          {
-            XSDAbstractAdapter a = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt(attribute, xsdModelAdapterFactory);            
-            a.removeListener((INotifyChangedListener)this);
-   	        a.addListener((INotifyChangedListener)this);
-            list.add(attribute);
-          }
-        }
-      }
-    }
-    return list.toArray();
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
-   */
-  public Object getParent(Object element)
-  {
-    return null;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
-   */
-  public boolean hasChildren(Object element)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
-   */
-  public Image getColumnImage(Object element, int columnIndex)
-  {
-    if (element instanceof XSDConcreteComponent)
-    {
-	    return adapterFactoryLabelProvider.getImage((XSDConcreteComponent)element);
-    }
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
-   */
-  public String getColumnText(Object element, int columnIndex)
-  {
-    if (element instanceof XSDConcreteComponent)
-    {
-	    XSDAbstractAdapter a = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt((XSDConcreteComponent)element, xsdModelAdapterFactory);
-	    return a.getText((XSDConcreteComponent)element);
-    }
-    return ""; 
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
-   */
-  public Image getImage(Object element)
-  {
-    if (element instanceof XSDConcreteComponent)
-    {
-	    return adapterFactoryLabelProvider.getImage((XSDConcreteComponent)element);
-    }
-    return null;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
-   */
-  public String getText(Object element)
-  {
-    if (element instanceof XSDConcreteComponent)
-    {
-	    XSDAbstractAdapter a = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt((XSDConcreteComponent)element, xsdModelAdapterFactory);
-	    return a.getText((XSDConcreteComponent)element);
-    }
-    return ""; 
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
-   */
-  public Object[] getElements(Object inputElement)
-  {
-    return getChildren(inputElement);
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
-   */
-  public void dispose()
-  {
-    if (elementAdapter != null)
-    {
-      elementAdapter.removeListener(this);
-    }
-    if (ctAdapter != null)
-    {
-      ctAdapter.removeListener((INotifyChangedListener)this);
-    }
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
-   */
-  Viewer viewer;
-  public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-  {
-//    System.out.println("input changed " + oldInput + "\n" + newInput);
-    this.viewer = viewer;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
-   */
-  public void addListener(ILabelProviderListener listener)
-  {
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
-   */
-  public boolean isLabelProperty(Object element, String property)
-  {
-    return false;
-  }
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
-   */
-  public void removeListener(ILabelProviderListener listener)
-  {
-  }
-
-  public void notifyChanged(Notification notification)
-  {
-    if (attributesViewer != null && !attributesViewer.getControl().isDisposed())
-    {
-      if (attributesViewer instanceof StructuredViewer)
-      {
-        attributesViewer.refresh();
-      }
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSection.java
deleted file mode 100644
index 0c830ff..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSection.java
+++ /dev/null
@@ -1,419 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.edit.provider.INotifyChangedListener;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.XSDMenuListener;
-import org.eclipse.wst.xsd.ui.internal.actions.AddAttributeAction;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateAttributeAndRequired;
-import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-import org.eclipse.wst.xsd.ui.internal.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.properties.XSDPropertySourceProvider;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class AttributesViewSection extends AbstractSection implements ISelectionChangedListener
-{
-  AttributeTableTreeViewer viewer;
-  AttributesPropertySheetPage propertySheetPage;
-
-  /**
-   * 
-   */
-  public AttributesViewSection()
-  {
-    super();
-  }
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent,	TabbedPropertySheetWidgetFactory factory) {
-		super.createControls(parent, factory);
-		
-		composite =	getWidgetFactory().createFlatFormComposite(parent);
-    SashForm sashForm = new SashForm(composite, SWT.HORIZONTAL);
-
-    FormData data = new FormData();
-    data.top = new FormAttachment(0, 0);
-    data.left = new FormAttachment(0, 0);
-    data.right = new FormAttachment(100, 0);
-    data.bottom = new FormAttachment(100, 0);
-    sashForm.setLayoutData(data);
-    
-    viewer = new AttributeTableTreeViewer(sashForm);
-    propertySheetPage = new AttributesPropertySheetPage();
-    propertySheetPage.createControl(sashForm);
-
-		AttributesViewContentProvider provider = new AttributesViewContentProvider(getActiveEditor(), viewer); 
-		viewer.setContentProvider(provider);
-
-		viewer.setLabelProvider(provider);
-		viewer.addSelectionChangedListener(this);
-
-    propertySheetPage.setPropertySourceProvider(new XSDPropertySourceProvider());
-	}
-
-  public void setInput(IWorkbenchPart part, ISelection selection)
-  {
-    super.setInput(part, selection);
-    if (input instanceof XSDElementDeclaration)
-    {
-      XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)input;
-      if (elementDeclaration.isElementDeclarationReference())
-      {
-        input = elementDeclaration.getResolvedElementDeclaration();
-        
-        isReadOnly = (!(elementDeclaration.getResolvedElementDeclaration().getRootContainer() == xsdSchema));
-      }
-    }
-  }
-  
-	public void selectionChanged(SelectionChangedEvent event)
-	{
-	  propertySheetPage.selectionChanged(part, event.getSelection());
-	}
-	
-	public void selectionChanged(IWorkbenchPart part, ISelection selection)
-	{
-	}
-
-  public void aboutToBeShown()
-  {
-		refresh();
-  }
-	
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-    setListenerEnabled(false);
-	  if (viewer != null)
-	  {
-      viewer.setInput(getInput());
-      viewer.refresh();
-	  }
-    setListenerEnabled(true);
-	}
-	
-  public void dispose()
-  {
-//    if (propertySheetPage != null)
-//    {
-//      propertySheetPage.dispose();
-//      propertySheetPage = null;
-//    }
-//    if (viewer != null)
-//    {
-//      viewer = null;
-//    }
-  }
-
-  public boolean shouldUseExtraSpace()
-  {
-    return true;
-  }
-
-	
-	class AttributeTableTreeViewer extends TreeViewer // ExtendedTableTreeViewer
-	{
-	  public AttributeTableTreeViewer(Composite c)
-	  {
-	    super(c);
-	    
-	    MenuManager menuManager = new MenuManager("#popup");//$NON-NLS-1$
-	    menuManager.setRemoveAllWhenShown(true);
-	    Menu menu = menuManager.createContextMenu(getTree());
-	    getTree().setMenu(menu);
-
-	    XSDAttributeMenuListener menuListener = new XSDAttributeMenuListener(this);
-	    menuManager.addMenuListener(menuListener);
-
-	  }
-	  
-	  public class XSDAttributeMenuListener extends XSDMenuListener
-	  {
-	    public XSDAttributeMenuListener(TreeViewer viewer)
-	    {
-	      super(viewer);
-        selectionProvider = viewer;
-       
-	      deleteAction = new DeleteAction(XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE"), AttributesViewSection.this.getActiveEditor(), getXSDSchema());
-        deleteAction.setSelectionProvider(selectionProvider);
-        selectionProvider.addSelectionChangedListener(deleteAction);
-	    }
-	    
-	    protected XSDSchema getXSDSchema()
-	    {
-        return xsdSchema;
-//        return getSchema();
-//	      XSDConcreteComponent xsdInput = (XSDConcreteComponent)AttributesViewSection.this.getInput();
-//	      return xsdInput.getSchema();
-	    }
-	    
-	    protected Object getSelectedElement()
-	    {
-        XSDComponent xsdInput = (XSDComponent)AttributesViewSection.this.getInput();
-        
-        if (xsdInput instanceof XSDElementDeclaration)
-        {
-          XSDElementDeclaration xsdElement = (XSDElementDeclaration)xsdInput;
-          XSDTypeDefinition xsdType = xsdElement.getType();
-          if (xsdType instanceof XSDComplexTypeDefinition)
-          {
-            XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)xsdType;
-            return ct;
-          }
-          return xsdElement;
-        }
-        else if (xsdInput instanceof XSDComplexTypeDefinition)
-        {
-          return xsdInput;
-        }
-
-        return null;
-	    }
-      
-      public void menuAboutToShow(IMenuManager manager)
-      {
-        updateXSDSchema();
-        if (xsdSchema == null)
-        {
-          return;
-        }
-
-        Object selectedElementObj = getSelectedElement();
-        
-        Element selectedElement = null;
-
-        if (selectedElementObj instanceof XSDComplexTypeDefinition)
-        {
-          selectedElement = ((XSDComplexTypeDefinition)selectedElementObj).getElement();
-        }
-        
-        addContextItems(manager, selectedElement, null);
-
-        if (!selectionProvider.getSelection().isEmpty())
-        {
-          // Add context menu items for selected element
-//          addContextItems(manager, selectedElement, null);
-          
-          manager.add(new Separator());
-          if (deleteAction != null)
-          {
-            deleteAction.setXSDSchema(getXSDSchema());
-            manager.add(deleteAction);
-          }
-        }
-      }
-	    
-	    protected void addContextItems(IMenuManager manager, Element parent, Node relativeNode)
-	    {
-	      ArrayList attributes = null;
-	      if (XSDDOMHelper.inputEquals(parent, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
-	      { //
-	        boolean complexOrSimpleContentExists = false;
-	        boolean anyAttributeExists = false;
-	        Element contentNode = null;
-	        Node anyAttributeNode = null;
-	        NodeList children = parent.getChildNodes();
-	        
-	        for (int i=0; i < children.getLength(); i++)
-	        {
-	          Node child = children.item(i);
-	          if (child != null && child instanceof Element)
-	          {
-	            if (XSDDOMHelper.inputEquals((Element)child, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
-	                XSDDOMHelper.inputEquals((Element)child, XSDConstants.ALL_ELEMENT_TAG, false) ||
-	                XSDDOMHelper.inputEquals((Element)child, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
-	                XSDDOMHelper.inputEquals((Element)child, XSDConstants.GROUP_ELEMENT_TAG, true) ||
-	                XSDDOMHelper.inputEquals((Element)child, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false) ||
-	                XSDDOMHelper.inputEquals((Element)child, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-	            {
-	              contentNode = (Element)child;
-
-	              if (XSDDOMHelper.inputEquals((Element)child, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false) ||
-	                  XSDDOMHelper.inputEquals((Element)child, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-	              {
-	                complexOrSimpleContentExists = true;
-	              }
-	            } 
-	            else if (XSDDOMHelper.inputEquals((Element)child, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false))
-	            {
-	              anyAttributeExists = true;
-	              anyAttributeNode = child;
-	            }
-	          }
-	        }
-
-	        if (anyAttributeExists)
-	        {
-	          if (!complexOrSimpleContentExists)
-	          {
-	            attributes = new ArrayList();
-	            attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE,
-	                                            getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
-	            attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-	            addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, anyAttributeNode);
-	            attributes = null;
-//	   ARE ATTRIBUTE GROUPS ALLOWED ?
-//	            addCreateElementAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, "_UI_ACTION_ADD_ATTRIBUTE_GROUP", attributes, parent, anyAttributeNode);
-	            addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, anyAttributeNode);
-	            addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, anyAttributeNode);
-	          }
-	        }
-	        else
-	        {
-	          if (!complexOrSimpleContentExists)
-	          {
-	            attributes = new ArrayList();
-	            attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE,
-	                                            getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
-	            attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-	            addCreateElementAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), attributes, parent, parent.getLastChild());
-	            attributes = null;
-	            addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), parent, parent.getLastChild());
-	            addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), parent, parent.getLastChild());
-	            attributes = null;
-	            addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, parent, parent.getLastChild());
-	          }
-            else
-            {
-              // new model based add attribute action
-              XSDComplexTypeDefinition xsdCT = (XSDComplexTypeDefinition)getXSDSchema().getCorrespondingComponent(parent);
-              manager.add(new AddAttributeAction(XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"), xsdCT));
-
-              Element derivedByElement = domHelper.getDerivedByElement(contentNode);
-              if (derivedByElement != null)
-              {
-                attributes = null;
-                addCreateElementRefAction(manager, XSDConstants.ATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"), derivedByElement, derivedByElement.getLastChild());
-                addCreateElementRefAction(manager, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"), derivedByElement, derivedByElement.getLastChild());
-                attributes = null;
-                addCreateElementActionIfNotExist(manager, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"), attributes, derivedByElement, derivedByElement.getLastChild());
-              }
-            }
-	        }
-	      }
-	      else if (parent == null) {	      
-	      	XSDElementDeclaration ed = (XSDElementDeclaration)input;      
-	      
-	      	// Add Attribute
-	      	attributes = new ArrayList();
-	      	attributes.add(new DOMAttribute(XSDConstants.NAME_ATTRIBUTE,
-                                          getNewName(parent, XSDConstants.ATTRIBUTE_ELEMENT_TAG, "Attribute", false)));
-	      	attributes.add(new DOMAttribute(XSDConstants.TYPE_ATTRIBUTE, getBuiltInStringQName()));
-	      	manager.add(new CreateAttributeAndRequired(XSDConstants.ATTRIBUTE_ELEMENT_TAG,
-					   XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE"),
-					   attributes,
-					   getXSDSchema(),
-					   selectionProvider,
-					   ed));
-	      	
-	      	// Add Attribute Reference
-	      	attributes = null;
-	      	attributes = new ArrayList();
-	        String ref = getFirstGlobalElementTagName(XSDConstants.ATTRIBUTE_ELEMENT_TAG);
-	        attributes.add(new DOMAttribute(XSDConstants.REF_ATTRIBUTE, ref));
-	      
-	        Action action = new CreateAttributeAndRequired(XSDConstants.ATTRIBUTE_ELEMENT_TAG,
-					   XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_REFERENCE"),
-					   attributes,
-					   getXSDSchema(),
-					   selectionProvider,
-					   ed);
-	        manager.add(action);
-	        action.setEnabled(ref != null);
-
-	        // Add Attribute Group Reference
-	        attributes = null;
-	      	attributes = new ArrayList();
-	        ref = getFirstGlobalElementTagName(XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG);
-	        attributes.add(new DOMAttribute(XSDConstants.REF_ATTRIBUTE, ref));
-	        
-	        action = new CreateAttributeAndRequired(XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG,
-					   XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF"),
-					   attributes,
-					   getXSDSchema(),
-					   selectionProvider,
-					   ed);
-
-	      	manager.add(action);
-	      	action.setEnabled(ref != null);
-	      	
-	      	// Add Any Attribute
-	      	attributes = null;
-	      	if (getFirstChildNodeIfExists(parent, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false) == null)
-	        {
-	      		action = new CreateAttributeAndRequired(XSDConstants.ANYATTRIBUTE_ELEMENT_TAG,
-						   XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ANY_ATTRIBUTE"),
-						   attributes,
-						   getXSDSchema(),
-						   selectionProvider,
-						   ed);
-	      		manager.add(action);
-	         }
-	      }
-	    }
-	  }
-	}
-	
-	class AttributesPropertySheetPage extends PropertySheetPage implements INotifyChangedListener
-	{
-	  public AttributesPropertySheetPage()
-	  {
-	    super();
-	  }
-	  
-	  public void notifyChanged(Notification notification)
-	  {
-	    System.out.println("Notification");
-	  }
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSectionDescriptor.java
deleted file mode 100644
index 2156ff9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/AttributesViewSectionDescriptor.java
+++ /dev/null
@@ -1,101 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-
-public class AttributesViewSectionDescriptor extends AbstractSectionDescriptor
-{
-  /**
-   * 
-   */
-  public AttributesViewSectionDescriptor()
-  {
-    super();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.xsdeditor.section.attributes";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDElementDeclaration.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new AttributesViewSection();
-  }
-
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDElementDeclaration)
-      {
-// Remove this to fix bug 3870 Element references should have the same properties as elements 
-//        XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)object;
-//        if (elementDeclaration.isElementDeclarationReference())
-//        {
-//          return false;
-//        }
-        return true;
-      }
-      else if (object instanceof XSDComplexTypeDefinition)
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.attributes";
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getAfterSection()
-   */
-  public String getAfterSection()
-  {
-    return "";
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/CommonDirectivesSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/CommonDirectivesSection.java
deleted file mode 100644
index 6a89da7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/CommonDirectivesSection.java
+++ /dev/null
@@ -1,157 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDParser;
-
-public class CommonDirectivesSection extends AbstractSection
-{
-  Text schemaLocationText;
-  Button wizardButton;
-  StyledText errorText;
-  Color red;
-
-  // TODO: common up code with XSDSelectIncludeFileWizard
-  public void doHandleEvent(Event event)
-  {
-    errorText.setText("");
-    if (event.type == SWT.Modify)
-    {
-      if (event.widget == schemaLocationText)
-      {
-        String errorMessage = "";
-        boolean isValidSchemaLocation = true;
-        String xsdModelFile = schemaLocationText.getText();
-        String namespace = "";
-        XSDSchema externalSchema = null;
-        
-        if (xsdModelFile.length() == 0)
-        {
-          handleSchemaLocationChange(xsdModelFile, "", null);
-          return;
-        }
-
-        try
-        {
-          IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
-
-          URI newURI = URI.createURI(xsdModelFile);
-          String xsdFile = URIHelper.getRelativeURI(newURI.toString(), currentIFile.getFullPath().toString());
-          final String normalizedXSDFile = URIHelper.normalize(xsdFile, currentIFile.getLocation().toString(), "");
-          
-          XSDParser parser = new XSDParser();
-          parser.parse(normalizedXSDFile);
-          
-          externalSchema = parser.getSchema();
-
-          if (externalSchema != null)
-          {
-            String extNamespace = externalSchema.getTargetNamespace();
-            if (extNamespace == null) extNamespace = "";
-            namespace = extNamespace;
-            
-            if (externalSchema.getDiagnostics() != null &&
-                externalSchema.getDiagnostics().size() > 0)
-            {
-              isValidSchemaLocation = false;
-              errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_INCORRECT_XML_SCHEMA", xsdModelFile);
-            }  
-            else
-            {
-              String currentNameSpace = getSchema().getTargetNamespace();
-              if (input instanceof XSDInclude || input instanceof XSDRedefine)
-              {  
-                // Check the namespace to make sure they are the same as current file
-                if (extNamespace != null)
-                {
-                  if (currentNameSpace != null && !extNamespace.equals(currentNameSpace))
-                  {
-                    errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_DIFFERENT_NAME_SPACE", xsdModelFile);
-                    isValidSchemaLocation = false;
-                  }
-                }
-              }
-              else
-              {  
-                // Check the namespace to make sure they are different from the current file
-                if (extNamespace != null)
-                {
-                  if (currentNameSpace != null && extNamespace.equals(currentNameSpace))
-                  {
-                    errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_SAME_NAME_SPACE", xsdModelFile);
-                    isValidSchemaLocation = false;
-                  }
-                }
-              }
-            }
-          }
-          else
-          {
-            errorMessage = "Invalid file";
-            isValidSchemaLocation = false;
-          }
-        }
-        catch(Exception e)
-        {
-          errorMessage = "Invalid file";
-          isValidSchemaLocation = false;
-        }
-        finally
-        {
-          if (!isValidSchemaLocation)
-          {
-            errorText.setText(errorMessage);
-            int length = errorText.getText().length();
-            red = new Color(null, 255, 0, 0);
-            StyleRange style = new StyleRange(0, length, red, schemaLocationText.getBackground());
-            errorText.setStyleRange(style);
-          }
-          else
-          {
-            handleSchemaLocationChange(xsdModelFile, namespace, externalSchema);          
-          }
-        }
-      }
-    }
-  }
-  
-  protected void handleSchemaLocationChange(String schemaFileString, String namespace, XSDSchema externalSchema)
-  {
-    
-  }
-
-  
-  public void dispose()
-  {
-    super.dispose();
-    if (red != null)
-    {
-      red.dispose();
-      red = null;
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSection.java
deleted file mode 100644
index e5e9ca8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSection.java
+++ /dev/null
@@ -1,236 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.actions.SetBaseTypeAction;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xml.XMLComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionDialog;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionProvider;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDSetTypeHelper;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class ComplexTypeSection extends AbstractSection
-{
-  private String derivedByChoicesComboValues[] =
-  {
-        "",
-        XSDConstants.RESTRICTION_ELEMENT_TAG,
-        XSDConstants.EXTENSION_ELEMENT_TAG
-  };
-
-  /**
-   * 
-   */
-  public ComplexTypeSection()
-  {
-    super();
-  }
-
-	Text baseTypeCombo;
-	CCombo derivedByCombo;
-	Button button;
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-	{
-		super.createControls(parent, factory);
-		composite =	getWidgetFactory().createFlatFormComposite(parent);
-		FormData data;
-
-		String textBaseType = XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON");
-		String textDerivedType = XSDEditorPlugin.getXSDString("_UI_LABEL_DERIVED_BY");
-		GC gc = new GC(parent);
-		int xoffset = Math.max(100, gc.textExtent(textBaseType).x + 20); // adds 20 due to borders
-		xoffset = Math.max(xoffset, gc.textExtent(textDerivedType).x + 20); // adds 20 due to borders
-		gc.dispose();
-
-		baseTypeCombo = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-		CLabel baseTypeLabel = getWidgetFactory().createCLabel(composite, textBaseType); //$NON-NLS-1$ 
-
-    button = getWidgetFactory().createButton(composite, "", SWT.PUSH);
-    button.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
-    baseTypeCombo.setEditable(false);
-    baseTypeCombo.addListener(SWT.Modify, this);
-
-		data = new FormData();
-		data.left = new FormAttachment(0, xoffset);
-    data.right = new FormAttachment(button, 0);
-		baseTypeCombo.setLayoutData(data);
-
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(baseTypeCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(button, 0, SWT.CENTER);
-		baseTypeLabel.setLayoutData(data);
-
-    button.addSelectionListener(this);
-		data = new FormData();
-    data.left = new FormAttachment(100, -rightMarginSpace + 2);
-		data.right = new FormAttachment(100,0);
-    data.top = new FormAttachment(baseTypeCombo, 0, SWT.CENTER);
-		button.setLayoutData(data);
-		
-		derivedByCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-		data = new FormData();
-		data.left = new FormAttachment(0, xoffset);
-		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(baseTypeCombo, +ITabbedPropertyConstants.VSPACE);
-		derivedByCombo.setLayoutData(data);
-		derivedByCombo.setItems(derivedByChoicesComboValues);
-		derivedByCombo.addSelectionListener(this);
-
-		CLabel derivedByLabel = getWidgetFactory().createCLabel(composite, textDerivedType); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(derivedByCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(derivedByCombo, 0, SWT.CENTER);
-		derivedByLabel.setLayoutData(data);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-	  setListenerEnabled(false);
-    
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-
-	  Object input = getInput();
-	  baseTypeCombo.setText(""); //$NON-NLS-1$
-	  
-    if (input instanceof XSDComplexTypeDefinition)
-    {
-      XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition)input;
-      Element element = complexType.getElement();
-      Element contentModelElement = getDomHelper().getContentModelFromParent(element);    
-      String baseType = getDomHelper().getBaseType(contentModelElement);
-    
-      derivedByCombo.setText(getDomHelper().getDerivedByName(contentModelElement));
-
-      if (baseType != null)
-      {
-        baseTypeCombo.setText(baseType);
-      }
-    }	  
-	  
-	  setListenerEnabled(true);
-	}
-	
-  /**
-   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
-   */
-  public void widgetSelected(SelectionEvent e)
-  {
-    XSDComplexTypeDefinition xsdComplexType = (XSDComplexTypeDefinition)getInput();
-    Element ctElement = xsdComplexType.getElement();
-    if (e.widget == button)
-    {
-	    Shell shell = Display.getCurrent().getActiveShell();
-	    Element element = null;
-	    if (xsdComplexType.getContent() != null)
-	    {
-  	    element = ((XSDComplexTypeDefinition)getInput()).getContent().getElement();
-	    }
-	    
-//	    SimpleContentBaseTypeOptionsDialog dialog = new SimpleContentBaseTypeOptionsDialog(shell, element, BASE_TYPE_ID, ((XSDConcreteComponent)getInput()).getSchema());
-//	    dialog.setBlockOnOpen(true);
-//	    dialog.create();
-//	    int result = dialog.open();
-        
-        IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
-        
-        Object input = getInput();
-        XSDSchema schema = null;
-        if (input instanceof XSDConcreteComponent) {
-            schema = ((XSDConcreteComponent) input).getSchema();
-        }
-        
-        XSDComponentSelectionProvider provider = new XSDComponentSelectionProvider(currentIFile, schema);
-        XSDComponentSelectionDialog dialog = new XSDComponentSelectionDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), provider);
-        provider.setDialog(dialog);
-        dialog.setBlockOnOpen(true);
-        dialog.create();
-        int result = dialog.open();
-   
-	    if (result == Window.OK)
-	    {
-            XMLComponentSpecification spec = dialog.getSelection();            
-            XSDSetTypeHelper helper = new XSDSetTypeHelper(currentIFile, schema);
-            helper.addImportIfNecessary(element, spec);
-            
-            String typeString = helper.getPrefixedTypeName(spec);
-            String derivedBy = getDomHelper().getDerivedByName(element);
-            SetBaseTypeAction setBaseTypeAction = new SetBaseTypeAction(XSDEditorPlugin.getXSDString("_UI_LABEL_SET_BASE_TYPE")); //$NON-NLS-1$
-            setBaseTypeAction.setXSDSchema(xsdSchema);
-            setBaseTypeAction.setComplexTypeElement(ctElement);
-            setBaseTypeAction.setType(typeString);
-            setBaseTypeAction.setDerivedBy(derivedBy);
-            setBaseTypeAction.performAction();
-
-	    }
-
-//      refresh();
-    }
-    else if (e.widget == derivedByCombo)
-    {
-      Element contentModelElement = getDomHelper().getContentModelFromParent(ctElement);
-      String baseType = getDomHelper().getBaseType(contentModelElement);
-      beginRecording(XSDEditorPlugin.getXSDString("_UI_DERIVEDBY_CHANGE"), ctElement); //$NON-NLS-1$
-      if (contentModelElement != null)
-      {
-        getDomHelper().changeDerivedByType(contentModelElement, derivedByCombo.getText(), baseType);
-      }
-      endRecording(ctElement);
-    }
-  }
-
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-   */
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSectionDescriptor.java
deleted file mode 100644
index 56979a7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ComplexTypeSectionDescriptor.java
+++ /dev/null
@@ -1,82 +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
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-
-public class ComplexTypeSectionDescriptor extends AbstractSectionDescriptor
-{
-  /**
-   * 
-   */
-  public ComplexTypeSectionDescriptor()
-  {
-    super();
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDComplexTypeDefinition.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new ComplexTypeSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.general";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDComplexTypeDefinition)
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-  
-  public String getAfterSection()
-  {
-    return "org.eclipse.wst.xsdeditor.section.name";
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSection.java
deleted file mode 100644
index 266fb24..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSection.java
+++ /dev/null
@@ -1,424 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.actions.AddEnumsAction;
-import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class EnumerationsSection extends AbstractSection
-{
-  private EnumerationsTableViewer enumerationsTable;
-  private Button addButton;
-  private Button addManyButton;
-  private Button deleteButton;
-  
-  /**
-   * 
-   */
-  public EnumerationsSection()
-  {
-    super();
-  }
-  
-  public void widgetSelected(SelectionEvent e)
-  {
-    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
-    Element element = st.getElement();
-    if (e.widget == addButton || e.widget == addManyButton)
-    {
-      XSDDOMHelper helper = new XSDDOMHelper();
-      
-      int variety = st.getVariety().getValue();
-      Node varietyElement = null;
-      if (variety == XSDVariety.ATOMIC)
-      {
-        varietyElement = helper.getChildNode(element, XSDConstants.RESTRICTION_ELEMENT_TAG);
-      }
-      else if (variety == XSDVariety.UNION)
-      {
-        varietyElement = helper.getChildNode(element, XSDConstants.UNION_ELEMENT_TAG);
-      }
-      else if (variety == XSDVariety.LIST)
-      {
-        varietyElement = helper.getChildNode(element, XSDConstants.LIST_ELEMENT_TAG);
-      }
-            
-      if (varietyElement != null)
-      {
-        if (e.widget == addButton)
-        {
-          java.util.List attributes = new ArrayList();
-          
-          List enumList = st.getEnumerationFacets();
-          StringBuffer newName = new StringBuffer("value1"); //$NON-NLS-1$
-          int suffix = 1;
-          for (Iterator i = enumList.iterator(); i.hasNext(); )
-          {
-            XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)i.next();
-            String value = enumFacet.getLexicalValue();
-            if (value != null)
-            {
-              if (value.equals(newName.toString()))
-              {
-                suffix++;
-                newName = new StringBuffer("value" + String.valueOf(suffix)); //$NON-NLS-1$
-              }
-            }
-          }
-          attributes.add(new DOMAttribute(XSDConstants.VALUE_ATTRIBUTE, newName.toString()));
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ENUM"), element); //$NON-NLS-1$
-          Action action = getNewElementAction(XSDConstants.ENUMERATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ENUM"), attributes, (Element)varietyElement, null);
-          action.run();
-          st.setElement(element);
-
-          endRecording(element);
-          enumerationsTable.refresh();
-          int newItemIndex = enumerationsTable.getTable().getItemCount() - 1;
-          enumerationsTable.editElement(enumerationsTable.getElementAt(newItemIndex), 0);
-          attributes = null;
-        }
-        else if (e.widget == addManyButton)
-        {
-          AddEnumsAction action = new AddEnumsAction(XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ENUMS")); //$NON-NLS-1$
-          action.setElementTag(XSDConstants.ENUMERATION_ELEMENT_TAG);
-          action.setAttributes(null);
-          action.setParentNode((Element)varietyElement);
-          action.setRelativeNode(null);
-          action.setDescription(XSDEditorPlugin.getXSDString("_UI_ENUMERATIONS_DIALOG_TITLE")); //$NON-NLS-1$
-          action.run();
-          st.setElement(element);
-          enumerationsTable.refresh();
-        }
-      }
-    }
-    else if (e.widget == deleteButton)
-    {
-      StructuredSelection selection = (StructuredSelection)enumerationsTable.getSelection();
-      if (selection != null)
-      {
-        Iterator i = selection.iterator();
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_ENUMERATION"), element); //$NON-NLS-1$
-        while (i.hasNext())
-        {
-          Object obj = i.next();
-          if (obj != null)
-          {
-            if (obj instanceof XSDEnumerationFacet)
-            {
-              XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)obj;
-    
-              // I have to update using DOM
-              XSDDOMHelper.removeNodeAndWhitespace(enumFacet.getElement());            
-              
-            }
-          }
-        }
-        enumerationsTable.refresh();
-        st.setElement(element);
-        endRecording(element);
-      }
-    }
-    else if (e.widget == enumerationsTable.getTable())
-    {
-      StructuredSelection selection = (StructuredSelection)enumerationsTable.getSelection();
-      if (selection.getFirstElement() != null)
-      {
-        deleteButton.setEnabled(true);
-      }
-      else
-      {
-        deleteButton.setEnabled(false);
-      }
-    }
-
-  }
-
-  public void widgetDefaultSelected(SelectionEvent e)
-  {
-    
-  }
-  
-  /**
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-   */
-  public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-  {
-    super.createControls(parent, factory);
-
-    composite = getWidgetFactory().createFlatFormComposite(parent);
-    FormData data;
-
-    enumerationsTable = new EnumerationsTableViewer(getWidgetFactory().createTable(composite, SWT.MULTI | SWT.FULL_SELECTION));
-    enumerationsTable.setInput(getInput());
-    Table table = enumerationsTable.getTable();
-    table.addSelectionListener(this);
-    
-    addButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL"), SWT.PUSH); //$NON-NLS-1$
-    addManyButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL") + "...", SWT.PUSH); //$NON-NLS-1$
-    deleteButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_INCLUDE"), SWT.PUSH); //$NON-NLS-1$
-
-    FormData data2 = new FormData();
-    data2.top = new FormAttachment(0, 0);
-    data2.left = new FormAttachment(100, -100);
-    data2.right = new FormAttachment(100, 0);
-//    data2.width = 50;
-    addButton.setLayoutData(data2);
-    addButton.addSelectionListener(this);
-
-    data = new FormData();
-    data.left = new FormAttachment(addButton, 0, SWT.LEFT);
-    data.right = new FormAttachment(100, 0);
-    data.top = new FormAttachment(addButton, 0);
-    addManyButton.setLayoutData(data);
-    addManyButton.addSelectionListener(this);
-
-    data = new FormData();
-    data.left = new FormAttachment(addButton, 0, SWT.LEFT);
-    data.right = new FormAttachment(100, 0);
-    data.top = new FormAttachment(addManyButton, 0);
-    deleteButton.setLayoutData(data);
-    deleteButton.setEnabled(false);
-    deleteButton.addSelectionListener(this);
-
-    data = new FormData();
-    data.top = new FormAttachment(0, 0);
-    data.left = new FormAttachment(0, 0);
-    data.right = new FormAttachment(addButton, 0);
-    data.bottom = new FormAttachment(100, 0);
-    data.width = tableMinimumWidth;
-    table.setLayoutData(data);
-    table.addListener(SWT.Resize, this);
-  }
-  
-  /*
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-   */
-  public void refresh()
-  {
-    Object input = getInput();
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
-    
-    Iterator validFacets = st.getValidFacets().iterator();
-    
-    boolean isApplicable = false;
-    while (validFacets.hasNext())
-    {
-      String aValidFacet = (String)validFacets.next();
-      if (aValidFacet.equals(XSDConstants.ENUMERATION_ELEMENT_TAG))
-      {
-        isApplicable = true;
-      }
-    }
-    
-    if (isApplicable)  
-    {
-      addButton.setEnabled(true);
-      addManyButton.setEnabled(true);
-    }
-    else
-    {
-      addButton.setEnabled(false);
-      addManyButton.setEnabled(false);
-    }
-    enumerationsTable.setInput(input);
-  }
-
-  public void handleEvent(Event event)
-  {
-    Table table = enumerationsTable.getTable();
-    if (event.type == SWT.Resize && event.widget == table)
-    {
-      TableColumn tableColumn = table.getColumn(0);
-      tableColumn.setWidth(table.getSize().x);
-    }
-  }
-  
-  public void dispose()
-  {
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-   */
-  public boolean shouldUseExtraSpace()
-  {
-    return true;
-  }
-
-  
-  class EnumerationsTableViewer extends NavigableTableViewer implements ICellModifier
-  {
-    protected String[] columnProperties = {XSDConstants.ENUMERATION_ELEMENT_TAG};
-
-    protected CellEditor[] cellEditors;
-
-    Table table;
-    
-    public EnumerationsTableViewer(Table table)
-    {
-      super(table);
-      table = getTable();
-
-      table.setLinesVisible(true);
-      
-      setContentProvider(new EnumerationsTableContentProvider());
-      setLabelProvider(new EnumerationsTableLabelProvider());
-      setColumnProperties(columnProperties);
-
-      setCellModifier(this);
-
-      TableColumn column = new TableColumn(table, SWT.NONE, 0);
-      column.setText(columnProperties[0]);
-      column.setAlignment(SWT.LEFT);
-      column.setResizable(true);
- 
-      cellEditors = new CellEditor[1];
-
-      TableLayout layout = new TableLayout();
-      ColumnWeightData data = new ColumnWeightData(100);
-
-      layout.addColumnData(data);
-      cellEditors[0] = new TextCellEditor(table);
-
-      getTable().setLayout(layout);
-      setCellEditors(cellEditors);
-    }
-    
-    public boolean canModify(Object element, String property)
-    {
-      return true;
-    }
-
-    public void modify(Object element, String property, Object value)
-    {
-      if (element instanceof TableItem && (value != null))
-      {
-        TableItem item = (TableItem)element;
-        
-        Element simpleTypeElement = ((XSDSimpleTypeDefinition)getInput()).getElement();
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ENUM_VALUE_CHANGE"), simpleTypeElement); //$NON-NLS-1$
-        
-        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)item.getData();
-        enumFacet.setLexicalValue((String)value);
-        item.setData(enumFacet);
-        item.setText((String)value);
-        endRecording(simpleTypeElement);
-      }
-    }    
-
-    public Object getValue(Object element, String property)
-    {
-      if (element instanceof XSDEnumerationFacet)
-      {
-        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)element;
-        String value = enumFacet.getLexicalValue();
-        if (value == null) value = ""; //$NON-NLS-1$
-        return value;
-      }
-      return ""; //$NON-NLS-1$
-    }
-
-  }
-    
-  class EnumerationsTableContentProvider implements IStructuredContentProvider
-  {
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-    {
-    }
-
-    public java.lang.Object[] getElements(java.lang.Object inputElement)
-    {
-      java.util.List list = new ArrayList();
-      if (inputElement instanceof XSDSimpleTypeDefinition)
-      {
-        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)inputElement;
-        return st.getEnumerationFacets().toArray();
-      }
-      return list.toArray();
-    }
-
-    public void dispose()
-    {
-    }
-  }
-
-  class EnumerationsTableLabelProvider extends LabelProvider implements ITableLabelProvider
-  {
-    public EnumerationsTableLabelProvider()
-    {
-      
-    }
-    
-    public Image getColumnImage(Object element, int columnIndex)
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleEnum.gif");
-    }
-    
-    public String getColumnText(Object element, int columnIndex)
-    {
-      if (element instanceof XSDEnumerationFacet)
-      {
-        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)element;
-        String value = enumFacet.getLexicalValue();
-        if (value == null) value = "";
-        return value;
-      }
-      return "";
-    }
-
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSectionDescriptor.java
deleted file mode 100644
index 0af99b0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/EnumerationsSectionDescriptor.java
+++ /dev/null
@@ -1,87 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-
-public class EnumerationsSectionDescriptor extends AbstractSectionDescriptor
-{
-
-  /**
-   * 
-   */
-  public EnumerationsSectionDescriptor()
-  {
-    super();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.xsdeditor.section.enumerations";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDSimpleTypeDefinition.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new EnumerationsSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.enumerations";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDSimpleTypeDefinition)
-      {
-        return true;
-        // return false;  // turn off this tab
-      }
-    }
-    return false;
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetViewer.java
deleted file mode 100644
index 1c3faab..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetViewer.java
+++ /dev/null
@@ -1,492 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseTrackAdapter;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-import org.eclipse.wst.xsd.ui.internal.properties.XSDComboBoxPropertyDescriptor;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConstrainingFacet;
-import org.eclipse.xsd.XSDMaxExclusiveFacet;
-import org.eclipse.xsd.XSDMaxFacet;
-import org.eclipse.xsd.XSDMaxInclusiveFacet;
-import org.eclipse.xsd.XSDMinExclusiveFacet;
-import org.eclipse.xsd.XSDMinFacet;
-import org.eclipse.xsd.XSDMinInclusiveFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.impl.XSDFactoryImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class FacetViewer extends NavigableTableViewer implements ICellModifier
-{
-  public static final String FACET_NAME = XSDEditorPlugin.getXSDString("_UI_FACET_NAME");  // "Name";
-  public static final String FACET_VALUE = XSDEditorPlugin.getXSDString("_UI_FACET_VALUE"); // "Value";
-  public static final String FACET_OTHER = XSDEditorPlugin.getXSDString("_UI_FACET_FIXED"); // "Fixed";
-
-  protected FacetsTableLabelProvider facetsTableLabelProvider = new FacetsTableLabelProvider();
-  protected FacetsTableContentProvider facetsTableContentProvider = new FacetsTableContentProvider();
-  protected String[] columnProperties = {FACET_NAME, FACET_VALUE, FACET_OTHER};
-  protected CellEditor[] cellEditors;    // these cellEditors are used when non-whitespace facet is selected
-  protected CellEditor[] altCellEditors; // these cellEditors are used when whitespace facet is selected
-  
-  protected String [] whiteSpaceValues = new String[] {"", "preserve", "replace", "collapse" };
-  protected String [] trueFalseValues = new String [] {"", "false", "true" }; 
-  protected FacetsSection facetsSection;
-  /**
-   * @param parent
-   */
-  public FacetViewer(Composite parent, FacetsSection facetsSection)
-  {
-    super(new Table(parent, SWT.FULL_SELECTION | SWT.SINGLE));
-    this.facetsSection = facetsSection;
-    
-    getTable().setLinesVisible(true);
-    getTable().setHeaderVisible(true);
-
-    addSelectionChangedListener(new SelectionChangedListener());
-    getTable().addMouseTrackListener(new MyMouseTrackListener());
-    
-    setContentProvider(facetsTableContentProvider);
-    setLabelProvider(facetsTableLabelProvider);
-    setColumnProperties(columnProperties);
-
-    setCellModifier(this);
-
-    for (int i = 0; i < 3; i++)
-    {
-      TableColumn column = new TableColumn(getTable(), SWT.NONE, i);
-      column.setText(columnProperties[i]);
-      column.setAlignment(SWT.LEFT);
-      column.setResizable(true);
-    }
-    
-    cellEditors = new CellEditor[3];
-    altCellEditors = new CellEditor[3];
-
-    TableLayout layout = new TableLayout();
-    ColumnWeightData data = new ColumnWeightData(60, 120, true);
-    layout.addColumnData(data);
-    cellEditors[0] = null;
-
-    ColumnWeightData data2 = new ColumnWeightData(120, 100, true);
-    layout.addColumnData(data2);
-
-    cellEditors[1] = new TextCellEditor(getTable());
-    XSDComboBoxPropertyDescriptor pd = new XSDComboBoxPropertyDescriptor("combo", "whitespace", whiteSpaceValues);
-    altCellEditors[1] = pd.createPropertyEditor(getTable());
-
-    ColumnWeightData data3 = new ColumnWeightData(60, 80, true);
-    layout.addColumnData(data3);
-
-    XSDComboBoxPropertyDescriptor pd2 = new XSDComboBoxPropertyDescriptor("combo", "other", trueFalseValues);
-    cellEditors[2] = pd2.createPropertyEditor(getTable());
-    altCellEditors[2] = pd2.createPropertyEditor(getTable());
-
-    getTable().setLayout(layout);
-    setCellEditors(cellEditors);
-
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
-   */
-  public boolean canModify(Object element, String property)
-  {
-    return property.equals(FACET_VALUE) || property.equals(FACET_OTHER);
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
-   */
-  public Object getValue(Object element, String property)
-  {
-    int column = 0;
-    if (property.equals(columnProperties[0]))
-    {
-      column = 0;
-    }
-    else if (property.equals(columnProperties[1]))
-    {
-      column = 1;
-    }
-    else if (property.equals(columnProperties[2]))
-    {
-      column = 2;
-    }
-
-    return facetsTableLabelProvider.getColumnText(element, column);
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
-   */
-  public void modify(Object element, String property, Object value)
-  {
-    XSDSimpleTypeDefinition xsdSimpleType = (XSDSimpleTypeDefinition)getInput();
-    TableItem item = (TableItem)element;
-    if (item != null)
-    {
-      Object o = item.getData();
-      if (o != null)
-      {
-        if (o instanceof String)
-        {
-          String facet = (String)o;
-         
-          Element simpleTypeElement = xsdSimpleType.getElement();
-          XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
-          Element derivedByElement = xsdDOMHelper.getDerivedByElement(simpleTypeElement);
-
-          facetsSection.beginRecording(XSDEditorPlugin.getXSDString("_UI_FACET_CHANGE"), simpleTypeElement);
-
-          String prefix = simpleTypeElement.getPrefix();
-          prefix = (prefix == null) ? "" : (prefix + ":");
-          
-          Element childNodeElement = null;
-          DOMAttribute valueAttr = null;
-
-          XSDConstrainingFacet targetFacet = getXSDConstrainingFacet(facet);
-
-          String newValue = "";
-          if (value != null && value instanceof String)
-          {
-            newValue = (String)value;
-          }
-          
-          if (property.equals(columnProperties[1]))
-          {
-            if (targetFacet == null && newValue.length() > 0)
-            {
-              targetFacet = createFacet(facet);
-              childNodeElement = (derivedByElement.getOwnerDocument()).createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + facet);
-              valueAttr = new DOMAttribute(XSDConstants.VALUE_ATTRIBUTE, newValue);
-              childNodeElement.setAttribute(valueAttr.getName(), valueAttr.getValue());
-              // add and format child
-              derivedByElement.appendChild(childNodeElement);
-              targetFacet.setElement(childNodeElement);
-              XSDDOMHelper.formatChild(childNodeElement);
-
-//              XSDSchemaHelper.updateElement(xsdSimpleType);
-            }
-            if (targetFacet == null)
-            {
-              facetsSection.endRecording(simpleTypeElement);
-              return;
-            }
-
-            if (newValue.length() > 0)
-            {            
-              targetFacet.setLexicalValue(newValue);
-              
-              if (targetFacet instanceof XSDMaxFacet || targetFacet instanceof XSDMinFacet)
-              {
-                if (targetFacet instanceof XSDMaxFacet)
-                {
-                  if (targetFacet instanceof XSDMaxExclusiveFacet)
-                  {
-                    XSDMaxInclusiveFacet xsdMaxInclusiveFacet = xsdSimpleType.getMaxInclusiveFacet();
-                    if (xsdMaxInclusiveFacet != null)
-                    {
-                      Element xsdMaxInclusiveFacetElement = xsdMaxInclusiveFacet.getElement();
-                      XSDDOMHelper.removeNodeAndWhitespace(xsdMaxInclusiveFacetElement);
-                    }
-                  }
-                  else if (targetFacet instanceof XSDMaxInclusiveFacet)
-                  {
-                    XSDMaxExclusiveFacet xsdMaxExclusiveFacet = xsdSimpleType.getMaxExclusiveFacet();
-                    if (xsdMaxExclusiveFacet != null)
-                    {
-                      Element xsdMaxExclusiveFacetElement = xsdMaxExclusiveFacet.getElement();
-                      XSDDOMHelper.removeNodeAndWhitespace(xsdMaxExclusiveFacetElement);
-                    }
-                  }
-                }
-                else if (targetFacet instanceof XSDMinFacet)
-                {
-                  if (targetFacet instanceof XSDMinExclusiveFacet)
-                  {
-                    XSDMinInclusiveFacet xsdMinInclusiveFacet = xsdSimpleType.getMinInclusiveFacet();
-                    if (xsdMinInclusiveFacet != null)
-                    {
-                      Element xsdMinInclusiveFacetElement = xsdMinInclusiveFacet.getElement();
-                      XSDDOMHelper.removeNodeAndWhitespace(xsdMinInclusiveFacetElement);
-                    }
-                  }
-                  else if (targetFacet instanceof XSDMinInclusiveFacet)
-                  {
-                    XSDMinExclusiveFacet xsdMinExclusiveFacet = xsdSimpleType.getMinExclusiveFacet();
-                    if (xsdMinExclusiveFacet != null)
-                    {
-                      Element xsdMinExclusiveFacetElement = xsdMinExclusiveFacet.getElement();
-                      XSDDOMHelper.removeNodeAndWhitespace(xsdMinExclusiveFacetElement);
-                    }
-                  }
-                }
-              }
-            }
-            else // newValue.length == 0
-            {
-              Element targetFacetElement = targetFacet.getElement();
-              XSDDOMHelper.removeNodeAndWhitespace(targetFacetElement);
-            }
-          }
-          else if (property.equals(columnProperties[2]))
-          {
-            if (targetFacet != null)
-            {
-              if (newValue.length() > 0)
-              {            
-                targetFacet.getElement().setAttribute(XSDConstants.FIXED_ATTRIBUTE, newValue);
-              }
-              else
-              {
-                targetFacet.getElement().removeAttribute(XSDConstants.FIXED_ATTRIBUTE);
-              }
-            }
-          }
-          xsdSimpleType.setElement(simpleTypeElement);
-          //xsdSimpleType.updateElement();
-          facetsSection.endRecording(simpleTypeElement);
-          refresh();
-        }
-      }
-    }
-  }
-
-  
-  private XSDConstrainingFacet getXSDConstrainingFacet(String facetString)
-  {
-    XSDSimpleTypeDefinition xsdSimpleType = (XSDSimpleTypeDefinition)getInput();
-    List list = xsdSimpleType.getFacetContents();
-    if (list == null)
-    {
-      return null;
-    }
-    Iterator iter = list.iterator();
-    XSDConstrainingFacet targetFacet = null;
-    
-    while (iter.hasNext())
-    {
-      XSDConstrainingFacet xsdConstrainingFacet = (XSDConstrainingFacet)iter.next();
-      if (xsdConstrainingFacet.getFacetName().equals(facetString))
-      {
-        targetFacet = xsdConstrainingFacet;
-        break;
-      }
-    }
-    return targetFacet;
-  }
-
-  private XSDConstrainingFacet createFacet(String facet)
-  {
-    XSDFactoryImpl factory = new XSDFactoryImpl();
-    XSDConstrainingFacet xsdFacet = null;
-    if (facet.equals("length")) { xsdFacet = factory.createXSDLengthFacet(); }
-    else if (facet.equals("minLength")) { xsdFacet = factory.createXSDMinLengthFacet(); }
-    else if (facet.equals("maxLength")) { xsdFacet = factory.createXSDMaxLengthFacet(); }
-
-    else if (facet.equals("minInclusive")) { xsdFacet = factory.createXSDMinInclusiveFacet(); }
-    else if (facet.equals("minExclusive")) { xsdFacet = factory.createXSDMinExclusiveFacet(); }
-
-    else if (facet.equals("maxInclusive")) { xsdFacet = factory.createXSDMaxInclusiveFacet(); }
-    else if (facet.equals("maxExclusive")) { xsdFacet = factory.createXSDMaxExclusiveFacet(); }
-
-    else if (facet.equals("totalDigits")) { xsdFacet = factory.createXSDTotalDigitsFacet(); }
-    else if (facet.equals("fractionDigits")) { xsdFacet = factory.createXSDFractionDigitsFacet(); }
-
-    else if (facet.equals("whiteSpace"))   { xsdFacet = factory.createXSDWhiteSpaceFacet(); }
-
-    return xsdFacet;
-  }
-
- /**
-  * Get the tooltip for the facet
-  */
-  public String getToolTip(String facet)
-  {
-    String key = "";
-    if (facet.equals("length")) { key = "_UI_TOOLTIP_LENGTH"; }
-    else if (facet.equals("minLength")) { key = "_UI_TOOLTIP_MIN_LEN"; }
-    else if (facet.equals("maxLength")) { key = "_UI_TOOLTIP_MAX_LEN"; }
-
-    else if (facet.equals("minInclusive")) { key = "_UI_TOOLTIP_MIN_INCLUSIVE"; }
-    else if (facet.equals("minExclusive")) { key = "_UI_TOOLTIP_MIN_EXCLUSIVE"; }
-
-    else if (facet.equals("maxInclusive")) { key = "_UI_TOOLTIP_MAX_INCLUSIVE"; }
-    else if (facet.equals("maxExclusive")) { key = "_UI_TOOLTIP_MAX_EXCLUSIVE"; }
-
-    else if (facet.equals("totalDigits"))   { key = "_UI_TOOLTIP_TOTAL_DIGITS"; }
-    else if (facet.equals("fractionDigits")) { key = "_UI_TOOLTIP_FRACTION_DIGITS"; }
-
-    else if (facet.equals("whiteSpace"))   { key = "_UI_TOOLTIP_WHITE_SPACE"; }
-
-    return (key != null) ? XSDEditorPlugin.getXSDString(key) : "";
-  }
-  
-  /**
-   * This listener detects which row is selected and add a tool tip for that row
-   */
-  public class MyMouseTrackListener extends MouseTrackAdapter
-  {
-    public void mouseHover(MouseEvent e)
-    {
-      TableItem item = getTable().getItem(new Point(e.x, e.y));
-      if (item != null)
-      {
-        Object o = item.getData();
-        if (o != null)
-        {
-          String facetName = (String)o;
-          getTable().setToolTipText(getToolTip(facetName));
-        }
-      }
-    }
-  }
-
-  /**
-   * Based on the selection, detects if it is a white space or not, and add the
-   * corresponding cell editors
-   */
-  public class SelectionChangedListener implements ISelectionChangedListener
-  {
-    public void selectionChanged(SelectionChangedEvent event)
-    {
-      Object o = WindowUtility.getSelection(event.getSelection());
-      if (o != null)
-      {
-        String facet = (String)o;
-        if (facet.equals("whiteSpace"))
-        {
-          setCellEditors(altCellEditors);
-        }
-        else
-        {
-          setCellEditors(cellEditors);
-        }
-      }
-    }
-  }
-
-  
-  class FacetsTableContentProvider implements IStructuredContentProvider
-  {
-    protected String facet;
-    
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-    {
-    }
-
-    public java.lang.Object[] getElements(java.lang.Object inputElement)
-    {
-      Vector v = new Vector();
-      XSDSimpleTypeDefinition inputXSDSimpleType = (XSDSimpleTypeDefinition)inputElement;
-      XSDSimpleTypeDefinition base = inputXSDSimpleType.getBaseTypeDefinition();
-      
-      if (base != null)
-      {
-        Iterator validFacets = base.getValidFacets().iterator();
-        while (validFacets.hasNext())
-        {
-          String aValidFacet = (String)validFacets.next();
-          if (!(aValidFacet.equals("pattern") || aValidFacet.equals("enumeration")))
-          {
-            v.add(aValidFacet);
-          }
-        }
-      }
-      return v.toArray();
-    }
-
-    public void dispose()
-    {
-    }
-  }
-
-  class FacetsTableLabelProvider extends LabelProvider implements ITableLabelProvider
-  {
-    public Image getColumnImage(Object element, int columnIndex)
-    {
-      return null;
-    }
-    
-    public String getColumnText(Object element, int columnIndex)
-    {
-      if (element instanceof String)
-      {
-        String value = null;
-        XSDConstrainingFacet targetFacet = getXSDConstrainingFacet((String)element);
-        switch (columnIndex)
-        {
-          case 0:
-          {
-            value = (String)element;
-            break;
-          }
-          case 1:
-          {
-            if (targetFacet == null)
-            {
-              value = "";
-            }
-            else
-            {
-              value = targetFacet.getLexicalValue();
-            }
-
-            break;
-          }
-          case 2:
-          {
-            if (targetFacet == null)
-            {
-              value = "";
-            }
-            else
-            {
-              Element elem = targetFacet.getElement();
-              value = elem.getAttribute(XSDConstants.FIXED_ATTRIBUTE);
-              if (value == null) value = "";
-            }
-          }
-        }
-        return value; 
-      }
-      return "";
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSection.java
deleted file mode 100644
index 55d9587..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSection.java
+++ /dev/null
@@ -1,802 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.wst.xsd.ui.internal.wizards.RegexWizard;
-import org.eclipse.xsd.XSDPatternFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class FacetsSection extends AbstractSection
-{
-  IWorkbenchPart part;
-  ISelection selection;
-  FacetViewer facetViewer;
-  
-  XSDWorkbook workbook;
-  FacetsWorkbookPage facetsWorkbookPage;
-// If you want to add the enumerations tab to this facets tab
-//  EnumsWorkbookPage enumsWorkbookPage;
-  PatternsWorkbookPage patternsWorkbookPage;
-
-  /**
-   * 
-   */
-  public FacetsSection()
-  {
-    super();
-  }
-  
-  /**
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-   */
-  public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-  {
-    super.createControls(parent, factory);
-
-    workbook = new XSDWorkbook(parent, SWT.BOTTOM | SWT.FLAT);
-    
-    facetsWorkbookPage = new FacetsWorkbookPage(workbook, this);
-//    enumsWorkbookPage = new EnumsWorkbookPage(workbook);
-    patternsWorkbookPage = new PatternsWorkbookPage(workbook);
-    facetsWorkbookPage.activate();
-//    enumsWorkbookPage.activate();
-    patternsWorkbookPage.activate();
-    workbook.setSelectedPage(facetsWorkbookPage);
-  }
-  
-  public void selectionChanged(IWorkbenchPart part, ISelection selection)
-  {
-    this.part = part;
-    this.selection = selection;
-  }
-  
-
-  /*
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-   */
-  public void refresh()
-  {
-    Object input = getInput();
-    
-    if (isReadOnly)
-    {
-      facetViewer.getControl().getParent().setEnabled(false);      
-    }
-    else
-    {
-      facetViewer.getControl().getParent().setEnabled(true);
-    }
-
-    if (facetViewer != null)
-    {
-      facetViewer.setInput(input);
-    }
-    
-//    if (enumsWorkbookPage != null)
-//    {
-//      enumsWorkbookPage.setInput(input);
-//    }
-    
-    if (patternsWorkbookPage != null)
-    {
-      patternsWorkbookPage.setInput(input);
-    }
-  }
-
-  public void dispose()
-  {
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-   */
-  public boolean shouldUseExtraSpace()
-  {
-    return true;
-  }
-  
-
-  /* General Facets Page */
-  
-  class FacetsWorkbookPage extends XSDWorkbookPage
-  {
-    FacetsSection facetsSection;
-    Composite page1;
-    
-    public FacetsWorkbookPage(XSDWorkbook workbook, FacetsSection facetsSection)
-    {
-      super(workbook);
-      this.getTabItem().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_FACETS")); //$NON-NLS-1$
-      this.facetsSection = facetsSection;
-    }
-
-    public Control createControl (Composite parent)
-    {
-      page1 = getWidgetFactory().createFlatFormComposite(parent);
-
-      FormData data = new FormData();
-      data.left = new FormAttachment(0, 0);
-      data.right = new FormAttachment(100, 0);
-      data.top = new FormAttachment(0, 0);
-      data.bottom = new FormAttachment(100, 0);
-      
-      facetViewer = new FacetViewer(page1, facetsSection);
-      facetViewer.setInput(getInput());
-      facetViewer.getControl().setLayoutData(data);
-                  
-      return page1;
-    }
-  }
-
-  /* Enumerations Page */
-  
-//  class EnumsWorkbookPage extends XSDWorkbookPage implements SelectionListener
-//  {
-//    EnumerationsTableViewer enumerationsTable;
-//    Button addButton;
-//    Button deleteButton;
-//    
-//    public EnumsWorkbookPage(XSDWorkbook workbook)
-//    {
-//      super(workbook);
-//      this.getTabItem().setText("Enumerations");
-//    }
-//
-//    public Control createControl (Composite parent)
-//    {
-//      Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-//      FormData data;
-//      
-//      addButton = getWidgetFactory().createButton(composite, "Add", SWT.PUSH);
-//      deleteButton = getWidgetFactory().createButton(composite, "Delete", SWT.PUSH);
-//      enumerationsTable = new EnumerationsTableViewer(getWidgetFactory().createTable(composite, SWT.MULTI | SWT.FULL_SELECTION));
-//      
-//      enumerationsTable.setInput(getInput());
-//      Table table = enumerationsTable.getTable();
-//      table.addSelectionListener(this);
-//
-//      data = new FormData();
-//      data.left = new FormAttachment(deleteButton, 0, SWT.LEFT);
-//      data.right = new FormAttachment(100, 0);
-//      data.top = new FormAttachment(0, 0);
-//      data.bottom = new FormAttachment(deleteButton, 0); //-ITabbedPropertyConstants.VSPACE);
-//      addButton.setLayoutData(data);
-//      addButton.addSelectionListener(this);
-//      
-//      data = new FormData();
-//      data.left = new FormAttachment(table, +ITabbedPropertyConstants.HSPACE);
-//      data.right = new FormAttachment(100, 0);
-//      data.top = new FormAttachment(addButton, 0);
-////      data.bottom = new FormAttachment(deleteButton, +ITabbedPropertyConstants.VSPACE);
-//      deleteButton.setLayoutData(data);
-//      deleteButton.setEnabled(false);
-//      deleteButton.addSelectionListener(this);
-//      
-//      data = new FormData();
-//      data.left = new FormAttachment(0, 0);
-//      data.right = new FormAttachment(85, 0);
-//      data.top = new FormAttachment(0, 0);
-//      data.bottom = new FormAttachment(100, 0);
-//      table.setLayoutData(data);
-//      
-//      return composite;
-//    }
-//    
-//    public void setInput(Object input)
-//    {
-//      enumerationsTable.setInput(input);
-//    }
-//    
-//    public void widgetSelected(SelectionEvent e)
-//    {
-//      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
-//      Element element = st.getElement();
-//      if (e.widget == addButton)
-//      {
-//        XSDDOMHelper helper = new XSDDOMHelper();
-//
-//        int variety = st.getVariety().getValue();
-//        Node varietyElement = null;
-//        if (variety == XSDVariety.ATOMIC)
-//        {
-//          varietyElement = helper.getChildNode(element, XSDConstants.RESTRICTION_ELEMENT_TAG);
-//        }
-//        else if (variety == XSDVariety.UNION)
-//        {
-//          varietyElement = helper.getChildNode(element, XSDConstants.UNION_ELEMENT_TAG);
-//        }
-//        else if (variety == XSDVariety.LIST)
-//        {
-//          varietyElement = helper.getChildNode(element, XSDConstants.LIST_ELEMENT_TAG);
-//        }
-//              
-//        if (varietyElement != null)
-//        {
-//          java.util.List attributes = new ArrayList();
-//          attributes.add(new DOMAttribute(XSDConstants.VALUE_ATTRIBUTE, ""));
-//          beginRecording("Add Enumeration", element);
-//          Action action = getNewElementAction(XSDConstants.ENUMERATION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ENUM"), attributes, (Element)varietyElement, null);
-//          action.run();
-//          st.setElement(element);
-//
-//          endRecording(element);
-//          enumerationsTable.refresh();
-//          attributes = null;
-//        }
-//      }
-//      else if (e.widget == deleteButton)
-//      {
-//        StructuredSelection selection = (StructuredSelection)enumerationsTable.getSelection();
-//        if (selection != null)
-//        {
-//          Iterator i = selection.iterator();
-//          beginRecording("Delete Enumeration", element);
-//          while (i.hasNext())
-//          {
-//            Object obj = i.next();
-//            if (obj != null)
-//            {
-//              if (obj instanceof XSDEnumerationFacet)
-//              {
-//                XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)obj;
-//      
-//                // I have to update using DOM
-//                XSDDOMHelper.removeNodeAndWhitespace(enumFacet.getElement());            
-//                
-//              }
-//            }
-//          }
-//          enumerationsTable.refresh();
-//          st.setElement(element);
-//          endRecording(element);
-//        }
-//      }
-//      else if (e.widget == enumerationsTable.getTable())
-//      {
-//        StructuredSelection selection = (StructuredSelection)enumerationsTable.getSelection();
-//        if (selection.getFirstElement() != null)
-//        {
-//          deleteButton.setEnabled(true);
-//        }
-//        else
-//        {
-//          deleteButton.setEnabled(false);
-//        }
-//      }
-//      
-//    }
-//
-//    public void widgetDefaultSelected(SelectionEvent e)
-//    {
-//      
-//    }
-//  }
-//  
-//  class EnumerationsTableViewer extends NavigableTableViewer implements ICellModifier
-//  {
-//    protected String[] columnProperties = {"Enumeration"};
-//
-//    protected CellEditor[] cellEditors;
-//
-//    Table table;
-//    
-//    public EnumerationsTableViewer(Table table)
-//    {
-//      super(table);
-//      table = getTable();
-//      
-//      table.setLinesVisible(true);
-//      
-//      setContentProvider(new EnumerationsTableContentProvider());
-//      setLabelProvider(new EnumerationsTableLabelProvider());
-//      setColumnProperties(columnProperties);
-//
-//      setCellModifier(this);
-//
-//      TableColumn column = new TableColumn(table, SWT.NONE, 0);
-//      column.setText(columnProperties[0]);
-//      column.setAlignment(SWT.LEFT);
-// 
-//      cellEditors = new CellEditor[1];
-//
-//      TableLayout layout = new TableLayout();
-//      ColumnWeightData data = new ColumnWeightData(100);
-//      layout.addColumnData(data);
-//      cellEditors[0] = new TextCellEditor(table);
-//
-//      getTable().setLayout(layout);
-//      setCellEditors(cellEditors);
-//    }
-//    
-//    public boolean canModify(Object element, String property)
-//    {
-//      return true;
-//    }
-//
-//    public void modify(Object element, String property, Object value)
-//    {
-//      if (element instanceof TableItem && (value != null))
-//      {
-//        TableItem item = (TableItem)element;
-//        
-//        Element simpleTypeElement = ((XSDSimpleTypeDefinition)getInput()).getElement();
-//        FacetsSection.this.beginRecording(XSDEditorPlugin.getXSDString("_UI_ENUM_VALUE_CHANGE"), simpleTypeElement);
-//        
-//        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)item.getData();
-//        enumFacet.setLexicalValue((String)value);
-//        item.setData(enumFacet);
-//        item.setText((String)value);
-//        FacetsSection.this.endRecording(simpleTypeElement);
-//      }
-//    }    
-//
-//    public Object getValue(Object element, String property)
-//    {
-//      if (element instanceof XSDEnumerationFacet)
-//      {
-//        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)element;
-//        String value = enumFacet.getLexicalValue();
-//        if (value == null) value = "";
-//        return value;
-//      }
-//      return "";
-//    }
-//
-//  }
-//    
-//  class EnumerationsTableContentProvider implements IStructuredContentProvider
-//  {
-//    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-//    {
-//    }
-//
-//    public java.lang.Object[] getElements(java.lang.Object inputElement)
-//    {
-//      java.util.List list = new ArrayList();
-//      if (inputElement instanceof XSDSimpleTypeDefinition)
-//      {
-//        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)inputElement;
-//        return st.getEnumerationFacets().toArray();
-//      }
-//      return list.toArray();
-//    }
-//
-//    public void dispose()
-//    {
-//    }
-//  }
-//
-//  class EnumerationsTableLabelProvider extends LabelProvider implements ITableLabelProvider
-//  {
-//    public EnumerationsTableLabelProvider()
-//    {
-//      
-//    }
-//    
-//    public Image getColumnImage(Object element, int columnIndex)
-//    {
-//      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleEnum.gif");
-//    }
-//    
-//    public String getColumnText(Object element, int columnIndex)
-//    {
-//      if (element instanceof XSDEnumerationFacet)
-//      {
-//        XSDEnumerationFacet enum = (XSDEnumerationFacet)element;
-//        String value = enum.getLexicalValue();
-//        if (value == null) value = "";
-//        return value;
-//      }
-//      return "";
-//    }
-//
-//  }
-
-  /* Patterns Page */
-  
-  class PatternsWorkbookPage extends XSDWorkbookPage implements SelectionListener, Listener
-  {
-    PatternsTableViewer patternsTable;
-    Button addButton;
-    Button deleteButton;
-    Button editButton;
-    Composite composite;
-    
-    public PatternsWorkbookPage(XSDWorkbook workbook)
-    {
-      super(workbook);
-      this.getTabItem().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_PATTERNS")); //$NON-NLS-1$
-    }
-
-    public Control createControl (Composite parent)
-    {
-      composite = getWidgetFactory().createFlatFormComposite(parent);
-      FormData data;
-
-      patternsTable = new PatternsTableViewer(getWidgetFactory().createTable(composite, SWT.MULTI | SWT.FULL_SELECTION));
-      patternsTable.setInput(getInput());
-      Table table = patternsTable.getTable();
-      table.addSelectionListener(this);
-
-      addButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_ADD"), SWT.PUSH); //$NON-NLS-1$
-      editButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_EDIT"), SWT.PUSH); //$NON-NLS-1$
-      deleteButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_INCLUDE"), SWT.PUSH); //$NON-NLS-1$
-
-      data = new FormData();
-      data.left = new FormAttachment(100, -100);
-      data.right = new FormAttachment(100, 0);
-      data.top = new FormAttachment(0, 0);
-      addButton.setLayoutData(data);
-      addButton.addSelectionListener(this);
-
-      data = new FormData();
-      data.left = new FormAttachment(addButton, 0, SWT.LEFT);
-      data.right = new FormAttachment(100, 0);
-      data.top = new FormAttachment(addButton, 0);
-      editButton.setLayoutData(data);
-      editButton.setEnabled(false);
-      editButton.addSelectionListener(this);
-      
-      data = new FormData();
-      data.left = new FormAttachment(addButton, 0, SWT.LEFT);
-      data.right = new FormAttachment(100, 0);
-      data.top = new FormAttachment(editButton, 0);
-      deleteButton.setLayoutData(data);
-      deleteButton.setEnabled(false);
-      deleteButton.addSelectionListener(this);
-      
-      data = new FormData();
-      data.top = new FormAttachment(0, 0);
-      data.left = new FormAttachment(0, 0);
-      data.right = new FormAttachment(addButton, 0);
-      data.bottom = new FormAttachment(100, 0);
-      data.width = tableMinimumWidth;
-      table.setLayoutData(data);
-      table.addListener(SWT.Resize, this);
-      
-      return composite;
-    }
-    
-    public void handleEvent(Event event)
-    {
-      Table table = patternsTable.getTable();
-      if (event.type == SWT.Resize && event.widget == table)
-      {
-        TableColumn tableColumn = table.getColumn(0);
-        tableColumn.setWidth(table.getSize().x);
-      }
-    }
-
-    
-    public void setInput(Object input)
-    {
-      patternsTable.setInput(input);
-      if (isReadOnly)
-      {
-        composite.setEnabled(false);
-      }
-      else
-      {
-        composite.setEnabled(true);
-      }
-    }
-    
-    public void widgetSelected(SelectionEvent e)
-    {
-      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
-      Element element = st.getElement();
-
-      if (e.widget == addButton)
-      {
-        XSDDOMHelper helper = new XSDDOMHelper();
-        
-        int variety = st.getVariety().getValue();
-        Node varietyElement = null;
-        if (variety == XSDVariety.ATOMIC)
-        {
-          varietyElement = helper.getChildNode(element, XSDConstants.RESTRICTION_ELEMENT_TAG);
-        }
-        else if (variety == XSDVariety.UNION)
-        {
-          varietyElement = helper.getChildNode(element, XSDConstants.UNION_ELEMENT_TAG);
-        }
-        else if (variety == XSDVariety.LIST)
-        {
-          varietyElement = helper.getChildNode(element, XSDConstants.LIST_ELEMENT_TAG);
-        }
-              
-        if (varietyElement != null)
-        {
-          Shell shell = Display.getCurrent().getActiveShell();
-
-          String initialValue = ""; //$NON-NLS-1$
-          RegexWizard wizard = new RegexWizard(initialValue);
-
-          WizardDialog wizardDialog = new WizardDialog(shell, wizard);
-          wizardDialog.setBlockOnOpen(true);
-          wizardDialog.create();
-          
-          int result = wizardDialog.open();
-
-          if (result == Window.OK)
-          {
-            String newPattern = wizard.getPattern();
-            
-            java.util.List attributes = new ArrayList();
-            attributes.add(new DOMAttribute(XSDConstants.VALUE_ATTRIBUTE, newPattern));
-            beginRecording(XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_PATTERN"), element); //$NON-NLS-1$
-            Action action = getNewElementAction(XSDConstants.PATTERN_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_PATTERN"), attributes, (Element)varietyElement, null); //$NON-NLS-1$
-            action.run();
-            st.setElement(element);
-            endRecording(element);
-            patternsTable.refresh();
-            attributes = null;
-          }
-        }
-      }
-      else if (e.widget == deleteButton)
-      {
-        StructuredSelection selection = (StructuredSelection)patternsTable.getSelection();
-        if (selection != null)
-        {
-          Iterator i = selection.iterator();
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_INCLUDE"), element); // Reword ?
-          while (i.hasNext())
-          {
-            Object obj = i.next();
-            if (obj != null)
-            {
-              if (obj instanceof XSDPatternFacet)
-              {
-                XSDPatternFacet patternFacet = (XSDPatternFacet)obj;
-      
-                // I have to update using DOM
-                XSDDOMHelper.removeNodeAndWhitespace(patternFacet.getElement());            
-              }
-            }
-          }
-          st.setElement(element);
-          endRecording(element);
-          patternsTable.refresh();
-          if (patternsTable.getTable().getItemCount() == 0)
-          {
-            editButton.setEnabled(false);
-            deleteButton.setEnabled(false);
-          }
-        }
-      }
-      else if (e.widget == editButton)
-      {
-        StructuredSelection selection = (StructuredSelection)patternsTable.getSelection();
-        if (selection != null)
-        {
-          Object obj = selection.getFirstElement();
-          if (obj instanceof XSDPatternFacet)
-          {
-            XSDPatternFacet pattern = (XSDPatternFacet)obj;
-            String initialValue = pattern.getLexicalValue();
-            if (initialValue == null)
-            {
-              initialValue = ""; //$NON-NLS-1$
-            }
-
-            Shell shell = Display.getCurrent().getActiveShell();
-
-            RegexWizard wizard = new RegexWizard(initialValue);
-
-            WizardDialog wizardDialog = new WizardDialog(shell, wizard);
-            wizardDialog.setBlockOnOpen(true);
-            wizardDialog.create();
-            
-            int result = wizardDialog.open();
-
-            if (result == Window.OK)
-            {
-              String newPattern = wizard.getPattern();
-              beginRecording(XSDEditorPlugin.getXSDString("_UI_PATTERN_VALUE_CHANGE"), element); //$NON-NLS-1$
-              element.setAttribute(XSDConstants.VALUE_ATTRIBUTE, newPattern);
-              pattern.setLexicalValue(newPattern);
-              endRecording(element);
-              patternsTable.refresh();
-            }
-          }
-        }
-      }
-      else if (e.widget == patternsTable.getTable())
-      {
-        StructuredSelection selection = (StructuredSelection)patternsTable.getSelection();
-        if (selection.getFirstElement() != null)
-        {
-          editButton.setEnabled(true);
-          deleteButton.setEnabled(true);
-        }
-        else
-        {
-          editButton.setEnabled(false);
-          deleteButton.setEnabled(false);
-        }
-      }
-      
-    }
-
-    public void widgetDefaultSelected(SelectionEvent e)
-    {
-      
-    }
-  }
-
-  
-  class PatternsTableViewer extends NavigableTableViewer implements ICellModifier
-  {
-    protected String[] columnProperties = {"Pattern"};
-
-    protected CellEditor[] cellEditors;
-
-    Table table;
-    
-    public PatternsTableViewer(Table table)
-    {
-      super(table);
-      table = getTable();
-      
-      table.setLinesVisible(true);
-      
-      setContentProvider(new PatternsTableContentProvider());
-      setLabelProvider(new PatternsTableLabelProvider());
-      setColumnProperties(columnProperties);
-
-      setCellModifier(this);
-
-      TableColumn column = new TableColumn(table, SWT.NONE, 0);
-      column.setText(columnProperties[0]);
-      column.setAlignment(SWT.LEFT);
-      column.setResizable(true);
- 
-      cellEditors = new CellEditor[1];
-
-      TableLayout layout = new TableLayout();
-      ColumnWeightData data = new ColumnWeightData(100);
-      layout.addColumnData(data);
-      cellEditors[0] = new TextCellEditor(table);
-
-      getTable().setLayout(layout);
-      setCellEditors(cellEditors);
-    }
-    
-    public boolean canModify(Object element, String property)
-    {
-      return true;
-    }
-
-    public void modify(Object element, String property, Object value)
-    {
-      if (element instanceof TableItem && (value != null))
-      {
-        TableItem item = (TableItem)element;
-        
-        Element simpleTypeElement = ((XSDSimpleTypeDefinition)getInput()).getElement();
-        FacetsSection.this.beginRecording(XSDEditorPlugin.getXSDString("_UI_PATTERN_VALUE_CHANGE"), simpleTypeElement); //$NON-NLS-1$
-        
-        XSDPatternFacet patternFacet = (XSDPatternFacet)item.getData();
-        patternFacet.setLexicalValue((String)value);
-
-        item.setData(patternFacet);
-        item.setText((String)value);
-        FacetsSection.this.endRecording(simpleTypeElement);
-      }
-    }    
-
-    public Object getValue(Object element, String property)
-    {
-      if (element instanceof XSDPatternFacet)
-      {
-        XSDPatternFacet patternFacet = (XSDPatternFacet)element;
-        String value = patternFacet.getLexicalValue();
-        if (value == null) value = ""; //$NON-NLS-1$
-        return value;
-      }
-      return ""; //$NON-NLS-1$
-    }
-
-  }
-    
-  class PatternsTableContentProvider implements IStructuredContentProvider
-  {
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-    {
-    }
-
-    public java.lang.Object[] getElements(java.lang.Object inputElement)
-    {
-      java.util.List list = new ArrayList();
-      if (inputElement instanceof XSDSimpleTypeDefinition)
-      {
-        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)inputElement;
-        return st.getPatternFacets().toArray();
-      }
-      return list.toArray();
-    }
-
-    public void dispose()
-    {
-    }
-  }
-
-  class PatternsTableLabelProvider extends LabelProvider implements ITableLabelProvider
-  {
-    public PatternsTableLabelProvider()
-    {
-      
-    }
-    
-    public Image getColumnImage(Object element, int columnIndex)
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDSimplePattern.gif"); //$NON-NLS-1$
-    }
-    
-    public String getColumnText(Object element, int columnIndex)
-    {
-      if (element instanceof XSDPatternFacet)
-      {
-        XSDPatternFacet pattern = (XSDPatternFacet)element;
-        String value = pattern.getLexicalValue();
-        if (value == null) value = ""; //$NON-NLS-1$
-        return value;
-      }
-      return ""; //$NON-NLS-1$
-    }
-
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSectionDescriptor.java
deleted file mode 100644
index c188f7c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/FacetsSectionDescriptor.java
+++ /dev/null
@@ -1,87 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-
-public class FacetsSectionDescriptor extends AbstractSectionDescriptor
-{
-
-  /**
-   * 
-   */
-  public FacetsSectionDescriptor()
-  {
-    super();
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.xsdeditor.section.facets";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDSimpleTypeDefinition.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new FacetsSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.facets";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDSimpleTypeDefinition)
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSection.java
deleted file mode 100644
index 36b5918..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSection.java
+++ /dev/null
@@ -1,282 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class MinMaxSection extends AbstractSection
-{
-  CCombo minCombo;
-  CCombo maxCombo;
-
-  /**
-   * 
-   */
-  public MinMaxSection()
-  {
-    super();
-  }
-
-
-  public void doHandleEvent(Event event)
-	{
-    if (event.widget == minCombo)
-    {
-      updateMinAttribute();
-	  }
-	  else if (event.widget == maxCombo)
-	  {
-      updateMaxAttribute();
-	  }
-	}
-  
-  public void doWidgetSelected(SelectionEvent e)
-  {
-    if (e.widget == minCombo)
-    {
-      updateMinAttribute();
-    }
-    else if (e.widget == maxCombo)
-    {
-      updateMaxAttribute();
-    }
-  }
-
-  private void updateMinAttribute()
-  {
-    XSDParticle particle = null;
-    Object input = getInput();
-
-    if (input instanceof XSDParticleContent)
-    {
-      particle = getAssociatedParticle((XSDParticleContent)input);
-    }
-    if (particle != null)
-    {
-      Element element = particle.getElement();
-      String newValue = ""; //$NON-NLS-1$
-
-      newValue = minCombo.getText();
-      beginRecording(XSDEditorPlugin.getXSDString("_UI_MINOCCURS_CHANGE"), element); //$NON-NLS-1$        
-      if (newValue.length()==0)
-      {
-        particle.unsetMinOccurs();
-      }
-      try
-      {
-        if (newValue.equals("unbounded") || newValue.equals("*")) //$NON-NLS-1$
-        {
-          particle.setMinOccurs(XSDParticle.UNBOUNDED);
-        }
-        else
-        {
-          int val = Integer.parseInt(newValue);
-          particle.setMinOccurs(val);
-        }
-      }
-      catch (NumberFormatException e)
-      {
-      
-      }
-      finally
-      { 
-        endRecording(element);
-      }
-    }
-  }
-  
-  private void updateMaxAttribute()
-  {
-    XSDParticle particle = null;
-    Object input = getInput();
-
-    if (input instanceof XSDParticleContent)
-    {
-      particle = getAssociatedParticle((XSDParticleContent)input);
-    }
-    if (particle != null)
-    {
-      Element element = particle.getElement();
-      String newValue = "";
-      newValue = maxCombo.getText();
-      beginRecording(XSDEditorPlugin.getXSDString("_UI_MAXOCCURS_CHANGE"), element); //$NON-NLS-1$
-      if (newValue.length()==0)
-      {
-        particle.unsetMaxOccurs();
-      }
-      try
-      {
-        if (newValue.equals("unbounded") || newValue.equals("*")) //$NON-NLS-1$
-        {
-          particle.setMaxOccurs(XSDParticle.UNBOUNDED);
-        }
-        else
-        {
-          int val = Integer.parseInt(newValue);
-            particle.setMaxOccurs(val);
-        }
-      }
-      catch (NumberFormatException e)
-      {
-        
-      }
-      finally
-      {
-        endRecording(element);
-      }
-    }    
-  }
-  
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-
-	public void createControls(Composite parent,TabbedPropertySheetWidgetFactory factory)
-	{
-		super.createControls(parent, factory);
-		composite =	getWidgetFactory().createFlatFormComposite(parent);
-		FormData data;
-
-    minCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-    data = new FormData();
-    data.left = new FormAttachment(0, 100);
-    data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-    data.top = new FormAttachment(0, 0);
-    minCombo.setLayoutData(data);
-    minCombo.add("0"); //$NON-NLS-1$
-    minCombo.add("1"); //$NON-NLS-1$
-    minCombo.addListener(SWT.Modify, this);
-    minCombo.addSelectionListener(this);
-    
-		CLabel minLabel = getWidgetFactory().createCLabel(composite, XSDConstants.MINOCCURS_ATTRIBUTE + ":");
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(minCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(minCombo, 0, SWT.CENTER);
-		minLabel.setLayoutData(data);
-
-    maxCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-    data = new FormData();
-    data.left = new FormAttachment(0, 100);
-    data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-    data.top = new FormAttachment(minCombo, +ITabbedPropertyConstants.VSPACE);
-    maxCombo.setLayoutData(data);
-    maxCombo.add("0"); //$NON-NLS-1$
-    maxCombo.add("1"); //$NON-NLS-1$
-    maxCombo.add("unbounded"); //$NON-NLS-1$
-    maxCombo.addListener(SWT.Modify, this);
-    maxCombo.addSelectionListener(this);
-    
-		CLabel maxLabel = getWidgetFactory().createCLabel(composite, XSDConstants.MAXOCCURS_ATTRIBUTE + ":");
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(maxCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(maxCombo, 0, SWT.CENTER);
-		maxLabel.setLayoutData(data);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-    if (doRefresh)
-    {
-      if (isReadOnly)
-      {
-        composite.setEnabled(false);
-      }
-      else
-      {
-        composite.setEnabled(true);
-      }
-
-  	  setListenerEnabled(false);
-      boolean refreshMinText = true;
-      boolean refreshMaxText = true;
-      if (minCombo.isFocusControl())
-      {
-        refreshMinText = false;
-      }
-      if (maxCombo.isFocusControl())
-      {
-        refreshMaxText = false;
-      }
-      if (refreshMinText)
-      {
-        minCombo.setText(""); //$NON-NLS-1$
-      }
-      if (refreshMaxText)
-      {
-        maxCombo.setText(""); //$NON-NLS-1$
-      }
-  	  Object input = getInput();
-  	  if (input != null)
-  	  {
-  	    if (input instanceof XSDParticleContent)
-  	    {
-  		    XSDParticle particle = getAssociatedParticle((XSDParticleContent)input);
-  		    if (particle != null)
-  		    {
-  //  	      minText.setText(String.valueOf(particle.getMinOccurs()));
-  //	        maxText.setText(String.valueOf(particle.getMaxOccurs()));
-            Element element = particle.getElement();
-  		      if (element != null)
-  		      {
-  		        String min = element.getAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-  		        String max = element.getAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-  		        if (min != null && refreshMinText)
-  		        {
-  		          minCombo.setText(min);
-  		        }
-  		        if (max != null && refreshMaxText)
-  		        {
-  		          maxCombo.setText(max);
-  		        }
-  		      }
-  		    }
-  	    }
-  	  }
-  	  setListenerEnabled(true);
-    }
-	}
-	
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-
-  private XSDParticle getAssociatedParticle(XSDParticleContent particleContent)
-  {
-    XSDConcreteComponent xsdComp = particleContent.getContainer();
-    if (xsdComp instanceof XSDParticle)
-    {
-      return (XSDParticle)xsdComp;
-    }
-    return null;
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSectionDescriptor.java
deleted file mode 100644
index b82b234..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/MinMaxSectionDescriptor.java
+++ /dev/null
@@ -1,145 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDWildcard;
-
-public class MinMaxSectionDescriptor extends AbstractSectionDescriptor
-{
-  /**
-   * 
-   */
-  public MinMaxSectionDescriptor()
-  {
-    super();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.xsdeditor.section.minmax";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDElementDeclaration.class);
-    list.add(XSDModelGroup.class);
-    list.add(XSDWildcard.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new MinMaxSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.general";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-//      if (object instanceof XSDElementDeclaration)
-//      {
-//        Element element = ((XSDElementDeclaration)object).getElement();
-//        Object parentNode = element.getParentNode();
-//        // minOccurs and maxOccurs apply to non-global elements
-//        boolean isGlobalElement = XSDDOMHelper.inputEquals(parentNode, XSDConstants.SCHEMA_ELEMENT_TAG, false);
-//        return !isGlobalElement;
-//      }
-//      if (object instanceof XSDParticle)
-//      {
-//        XSDParticle particle = (XSDParticle)object;
-//        Element element = particle.getElement();
-//        if (inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, false))
-//        {
-//          return true;
-//        }
-//        else if (inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, true))
-//        {
-//          return false;
-//        }
-//        else
-//        {
-//          return true;
-//        }
-//      }
-      if (object instanceof XSDModelGroup)
-      {
-        return true;
-      }
-      else if (object instanceof XSDElementDeclaration)
-      {
-        XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)object;
-        if (xsdElementDeclaration.isGlobal())
-        {
-          return false;
-        }
-        else
-        {
-          return true;
-        }
-      }
-      else if (object instanceof XSDWildcard)
-      {
-        XSDWildcard wildcard = (XSDWildcard)object;
-        if (wildcard.getContainer() instanceof XSDComplexTypeDefinition ||
-            wildcard.getContainer() instanceof XSDAttributeGroupDefinition)
-        {
-          return false;
-        }
-        else
-        {
-          return true;
-        }
-      }
-    }
-    return false;
-  }
-  
-  public String getAfterSection()
-  {
-    return "org.eclipse.wst.wsdleditor.section.reference";
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSection.java
deleted file mode 100644
index bfc6f8a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSection.java
+++ /dev/null
@@ -1,144 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDModelGroup;
-import org.w3c.dom.Element;
-
-public class ModelGroupSection extends AbstractSection
-{
-  CCombo modelGroupCombo;
-  private String[] modelGroupComboValues = { "sequence", "choice", "all" }; //$NON-NLS-1$
-  
-  /**
-   * 
-   */
-  public ModelGroupSection()
-  {
-    super();
-  }
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-	{
-		super.createControls(parent, factory);
-		composite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data;
-
-		modelGroupCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(0, 0);
-		modelGroupCombo.setLayoutData(data);
-		modelGroupCombo.addSelectionListener(this);
-		modelGroupCombo.setItems(modelGroupComboValues);
-
-		CLabel cLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_KIND")); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(modelGroupCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(modelGroupCombo, 0, SWT.CENTER);
-		cLabel.setLayoutData(data);
-
-	}
- 	
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-	  setListenerEnabled(false);
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-	  Object input = getInput();
-	  if (input != null)
-	  {
-      if (input instanceof XSDModelGroup)
-	    {
-	      XSDModelGroup particle = (XSDModelGroup)input;
-	      String modelType = particle.getCompositor().getName();
-	      modelGroupCombo.setText(modelType);
-	    }
-	  }
-	  setListenerEnabled(true);
-	}
-
-  public void widgetSelected(SelectionEvent e)
-  {
-    if (e.widget == modelGroupCombo)
-    {
-      Object input = getInput();
-	    if (input instanceof XSDModelGroup)
-	    {
-	      XSDModelGroup particle = (XSDModelGroup)input;
-
-        Element element = particle.getElement();
-        Element parent = (Element)element.getParentNode();
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_SCOPE_CHANGE"), parent); //$NON-NLS-1$
-//        changeContentModel(parent, modelGroupCombo.getText());
-        particle.setCompositor(XSDCompositor.get(modelGroupCombo.getText()));      
-        endRecording(parent);
-        refresh();
-	    }
-    }
-  }
-
-//  private void changeContentModel(Element parent, String contentModel)
-//  {
-//    Document doc = parent.getOwnerDocument();
-//    XSDDOMHelper domHelper = getDomHelper();
-//  
-//    String prefix = parent.getPrefix();
-//    prefix = prefix == null ? "" : prefix + ":";
-//    
-//    Element contentModelElement = domHelper.getContentModelFromParent(parent);
-//  
-//    if (contentModelElement.getLocalName().equals(contentModel))
-//    {
-//      return; // it's already the content model 
-//    }
-//  
-//    Element newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + contentModel);
-//  
-//    if (contentModelElement.hasChildNodes())
-//    {        
-//      NodeList nodes = contentModelElement.getChildNodes();
-//      // use clones so we don't have a refresh problem
-//      for (int i = 0; i < nodes.getLength(); i++)
-//      {
-//        Node node = nodes.item(i);
-//        newNode.appendChild(node.cloneNode(true)); 
-//      }
-//    }
-//    parent.replaceChild(newNode, contentModelElement);
-//  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSectionDescriptor.java
deleted file mode 100644
index 2f91552..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ModelGroupSectionDescriptor.java
+++ /dev/null
@@ -1,84 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDModelGroup;
-
-public class ModelGroupSectionDescriptor extends AbstractSectionDescriptor
-{
-  /**
-   * 
-   */
-  public ModelGroupSectionDescriptor()
-  {
-    super();
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.xsdeditor.section.modelgroup";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDModelGroup.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new ModelGroupSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.general";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDModelGroup)
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSection.java
deleted file mode 100644
index 95ebbe3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSection.java
+++ /dev/null
@@ -1,434 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalAttributeGroupRenamer;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalAttributeRenamer;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalElementRenamer;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalGroupRenamer;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.GlobalSimpleOrComplexTypeRenamer;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class NameSection extends AbstractSection
-{
-  /**
-   * 
-   */
-  public NameSection()
-  {
-    super();
-  }
-  
-	Text nameText;
-
-	
-  public void doHandleEvent(Event event) 
-  {
-    if (event.widget == nameText)
-	  {
-			Object input = getInput();
-      String newValue = nameText.getText();
-	    if (input instanceof XSDNamedComponent)
-	    {
-	      XSDNamedComponent namedComponent = (XSDNamedComponent)input;
-	      if (newValue.length() > 0)
-	      {
-	        namedComponent.setName(newValue);
-          doReferentialIntegrityCheck(namedComponent, newValue);
-	      }
-	      else
-	      {
-          // TODO: Show error message
-	      }
-	    }
-//	    else if (input instanceof XSDParticle)
-//	    {
-//	      XSDParticle xsdParticle = (XSDParticle)input;
-//	      if (newValue.length() > 0)
-//	      {
-//	        doReferentialIntegrityCheck(xsdParticle, newValue);
-//	      }
-//	      else
-//	      {
-//	        // TODO: Show error message
-//	      }
-//	    }
-      else if (input instanceof XSDAttributeDeclaration)
-      {
-        XSDAttributeDeclaration attribute = (XSDAttributeDeclaration)input;
-	      if (newValue.length() > 0)
-	      {
-	        doReferentialIntegrityCheck(attribute, newValue);
-	        attribute.setName(newValue);
-	      }
-	      else
-	      {
-	        // TODO: Show error message
-	      }
-      }
-	    else if (input instanceof XSDAttributeUse)
-      {
-        XSDAttributeUse attributeUse = (XSDAttributeUse)input;
-        XSDAttributeDeclaration attribute = attributeUse.getAttributeDeclaration();
-	      if (newValue.length() > 0)
-	      {
-	        doReferentialIntegrityCheck(attribute, newValue);
-	        attribute.setName(newValue);
-	        attributeUse.setAttributeDeclaration(attribute);
-	      }
-	      else
-	      {
-          // TODO: Show error message
-	      }
-      }
-	  }
-	}
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-	{
-		super.createControls(parent, factory);
-		composite =	getWidgetFactory().createFlatFormComposite(parent);
-		FormData data;
-
-		nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		// data.right = new FormAttachment(95, 0);
-    data.right = new FormAttachment(100, -rightMarginSpace -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(0, 0);
-		nameText.setLayoutData(data);
-		nameText.addListener(SWT.Modify, this);
-
-		CLabel nameLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_NAME")); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(nameText, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(nameText, 0, SWT.CENTER);
-		nameLabel.setLayoutData(data);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-    if (nameText.isFocusControl())
-    {
-      return;
-    }
-    setListenerEnabled(false);
-    nameText.setEditable(true);
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-	  Object input = getInput();
-	  nameText.setText(""); //$NON-NLS-1$
-	  if (input != null)
-	  {
-	    if (input instanceof XSDComplexTypeDefinition || input instanceof XSDSimpleTypeDefinition)
-	    {
-	      XSDTypeDefinition type = (XSDTypeDefinition)input;
-	      
-	      Element element = type.getElement();
-        String name = element.getAttribute(XSDConstants.NAME_ATTRIBUTE);
-        if (name == null) name = "";
-        
-        boolean isAnonymousType = checkForAnonymousType(element);
-        if (isAnonymousType)
-        {
-          nameText.setText("**anonymous**"); //$NON-NLS-1$
-          nameText.setEditable(false);
-        }
-        else
-        {
-          nameText.setText(name);
-          nameText.setEditable(true);
-        }
-	    }
-	    else if (input instanceof XSDNamedComponent)
-	    {
-	      XSDNamedComponent namedComponent = (XSDNamedComponent)input;
-          String name = namedComponent.getName();
-	      if (name != null)
-	      {
-	        nameText.setText(name);
-	      }
-	    }
-      else if (input instanceof XSDAttributeDeclaration)
-      {
-        XSDAttributeDeclaration attribute = (XSDAttributeDeclaration)input;
-        //String name = attribute.getName();
-        Element element = attribute.getElement();
-        String name = element.getAttribute(XSDConstants.NAME_ATTRIBUTE);
-        if (name != null)
-	      {
-	        nameText.setText(name);
-	      }
-      }
-	    else if (input instanceof XSDAttributeUse)
-      {
-        XSDAttributeUse attributeUse = (XSDAttributeUse)input;
-        XSDAttributeDeclaration attribute = attributeUse.getAttributeDeclaration();
-        String name = attribute.getName();
-        if (name != null)
-	      {
-	        nameText.setText(name);
-	      }
-      }
-//	    else if (input instanceof Element)
-//	    {
-//	      String name = ((Element)input).getAttribute(XSDConstants.NAME_ATTRIBUTE);
-//	      if (name == null) name = "";
-//	      nameText.setText(name);
-//	    }
-	  }
-	  setListenerEnabled(true);
-	}
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-   */
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-
-	private void doReferentialIntegrityCheck(XSDComponent xsdComponent, String newValue)
-	{
-    Element element = xsdComponent.getElement();
-    if (XSDDOMHelper.inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, false))
-    {
-      if (validateName(newValue))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_NAME_CHANGE"), element); //$NON-NLS-1$
-        element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
-        if (xsdComponent instanceof XSDNamedComponent)
-        {
-          ((XSDNamedComponent)xsdComponent).setName(newValue);
-        }
-        
-        // now rename any references to this element
-       
-        if (xsdSchema != null)
-        {
-          XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-          if (comp != null && comp instanceof XSDElementDeclaration && comp.getContainer().equals(xsdSchema))
-          {
-            GlobalElementRenamer renamer = new GlobalElementRenamer((XSDNamedComponent)comp, newValue);
-            renamer.visitSchema(xsdSchema);
-          }
-        }        
-        endRecording(element);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
-    {
-      if (validateName(newValue))
-      {
-	      beginRecording(XSDEditorPlugin.getXSDString("_UI_COMPLEXTYPE_NAME_CHANGE"), element); //$NON-NLS-1$
-	      if (newValue.length() > 0)
-	      {
-	        // now rename any references to this type
-	        if (xsdSchema != null)
-	        {
-	          XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-	          if (comp != null && comp instanceof XSDComplexTypeDefinition && comp.getContainer().equals(xsdSchema))
-	          {
-	            GlobalSimpleOrComplexTypeRenamer renamer = new GlobalSimpleOrComplexTypeRenamer((XSDNamedComponent)comp, newValue);
-	            renamer.visitSchema(xsdSchema);
-	          }
-	        }
-	        element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
-	        ((XSDNamedComponent)xsdComponent).setName(newValue);
-	      }
-	      else
-	      {
-	        element.removeAttribute(XSDConstants.NAME_ATTRIBUTE);
-	      }
-      endRecording(element);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-    {
-      beginRecording(XSDEditorPlugin.getXSDString("_UI_SIMPLETYPE_NAME_CHANGE"), element);
-      if (validateName(newValue))
-      {
-        // now rename any references to this type
-        if (newValue.length() > 0)
-        {
-          if (xsdSchema != null)
-          {
-            XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-            if (comp != null && comp instanceof XSDSimpleTypeDefinition && comp.getContainer().equals(xsdSchema))
-            {
-              GlobalSimpleOrComplexTypeRenamer renamer = new GlobalSimpleOrComplexTypeRenamer((XSDNamedComponent)comp, newValue);
-              renamer.visitSchema(xsdSchema);
-            }
-          }
-//          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
-        }
-        else
-        {
-          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, "");
-        }
-      }
-      endRecording(element);
-
-    }
-    else if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
-    {  
-      beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTE_NAME_CHANGE"), element); //$NON-NLS-1$
-      // now rename any references to this element
-      if (xsdSchema != null)
-       {
-        XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-        if (comp != null && comp instanceof XSDAttributeDeclaration && comp.getContainer().equals(xsdSchema))
-        {
-          GlobalAttributeRenamer renamer = new GlobalAttributeRenamer((XSDNamedComponent)comp, newValue);
-          renamer.visitSchema(xsdSchema);
-        }
-      }
-      // element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
-      endRecording(element);
-    }
-    else if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false))
-    {  
-      beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTEGROUP_NAME_CHANGE"), element); //$NON-NLS-1$
-      ((XSDNamedComponent)xsdComponent).setName(newValue);
-      // now rename any references to this element
-      if (xsdSchema != null)
-      {
-        XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-        if (comp != null && comp instanceof XSDAttributeGroupDefinition && comp.getContainer().equals(xsdSchema))
-        {
-          GlobalAttributeGroupRenamer renamer = new GlobalAttributeGroupRenamer((XSDNamedComponent)comp, newValue);
-          renamer.visitSchema(xsdSchema);
-        }
-      }
-      endRecording(element);
-    }
-    else if (XSDDOMHelper.inputEquals(element, XSDConstants.UNIQUE_ELEMENT_TAG, false))
-    {
-      if (validateName(newValue))
-       {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_UNIQUE_NAME_CHANGE"), element); //$NON-NLS-1$
-        if (newValue.length() > 0)
-        {
-          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
-        }
-        else
-        {
-          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, ""); //$NON-NLS-1$
-        }
-        endRecording(element);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(element, XSDConstants.KEY_ELEMENT_TAG, false))
-    {
-      if (validateName(newValue))
-      {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_KEY_NAME_CHANGE"), element); //$NON-NLS-1$
-        if (newValue.length() > 0)
-        {
-          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
-        }
-        else
-        {
-          element.setAttribute(XSDConstants.NAME_ATTRIBUTE, ""); //$NON-NLS-1$
-        }
-        endRecording(element);
-      }
-    }
-    else if (XSDDOMHelper.inputEquals(element, XSDConstants.GROUP_ELEMENT_TAG, false))
-    {
-      if (validateName(newValue))
-       {
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_NAME_CHANGE"), element); //$NON-NLS-1$
-        // now rename any references to this element
-        if (xsdSchema != null)
-         {
-          XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-          if (comp != null && comp instanceof XSDModelGroupDefinition && comp.getContainer().equals(xsdSchema))
-          {
-            GlobalGroupRenamer renamer = new GlobalGroupRenamer((XSDNamedComponent)comp, newValue);
-            renamer.visitSchema(xsdSchema);
-          }
-        }
-        element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
-        endRecording(element);
-      }
-      
-    }
-    
-
-
-	}
-
-  boolean checkForAnonymousType(Element element)
-  {
-    Object parentElement = (Object)element.getParentNode();
-    boolean isAnonymous = false;
-    if (parentElement != null)
-    {
-      if (XSDDOMHelper.inputEquals(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
-      {
-        if (XSDDOMHelper.inputEquals(parentElement, XSDConstants.ELEMENT_ELEMENT_TAG, false))
-        {
-          isAnonymous = true; 
-        }
-      }
-      else if (XSDDOMHelper.inputEquals(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-      {
-        if (XSDDOMHelper.inputEquals(parentElement, XSDConstants.RESTRICTION_ELEMENT_TAG, false) ||
-            XSDDOMHelper.inputEquals(parentElement, XSDConstants.ELEMENT_ELEMENT_TAG, false) ||
-            XSDDOMHelper.inputEquals(parentElement, XSDConstants.UNION_ELEMENT_TAG, false) ||
-            XSDDOMHelper.inputEquals(parentElement, XSDConstants.LIST_ELEMENT_TAG, false) ||
-            XSDDOMHelper.inputEquals(parentElement, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
-        {
-          isAnonymous = true;
-        }
-      }
-    }
-    return isAnonymous;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSectionDescriptor.java
deleted file mode 100644
index e4349ea..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NameSectionDescriptor.java
+++ /dev/null
@@ -1,168 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class NameSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor
-{
-  /**
-   * 
-   */
-  public NameSectionDescriptor()
-  {
-    super();
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.xsdeditor.section.name";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDNamedComponent.class);
-    list.add(XSDAttributeUse.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new NameSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.general";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDNamedComponent)
-      {
-        XSDNamedComponent namedComponent = (XSDNamedComponent)object;
-        Element element = namedComponent.getElement();
-        
-        if (inputEquals(element, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false) ||
-            inputEquals(element, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-        {
-          return false;
-        }
-        
-        // don't want to show editable name section for ref's
-        // need to show ref section with a combobox
-        
-        if (namedComponent instanceof XSDElementDeclaration)
-        {
-          if (((XSDElementDeclaration)namedComponent).isElementDeclarationReference())
-          {
-            return false;
-          }
-          else
-          {
-            return true;
-          }
-        }
-        else if (namedComponent instanceof XSDAttributeDeclaration)
-        {
-          if (((XSDAttributeDeclaration)namedComponent).isAttributeDeclarationReference())
-          {
-            return false;
-          }
-          else
-          {
-            return true;
-          }
-        }
-
-        if (element != null)
-        {
-          if (inputEquals(element, element.getLocalName(), true))
-          {
-            return false;
-          }
-          else
-          {
-            return true;
-          }
-        }
-      }
-//      else if (object instanceof XSDParticle)
-//      {
-//        XSDParticle particle = (XSDParticle)object;
-//        Element element = particle.getElement();
-//        if (inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, false))
-//        {
-//          return true;
-//        }
-//        else if (inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, true))
-//        {
-//          return false;
-//        }
-//        else
-//        {
-//          return false;
-//        }
-//      }
-      else if (object instanceof XSDAttributeUse)
-      {
-        XSDAttributeUse attributeUse = (XSDAttributeUse)object;
-        Element element = attributeUse.getElement();
-        if (inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
-        {
-          return true;
-        }
-        else
-        {
-          return false;
-        }
-      }
-
-    }
-
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationDescriptor.java
deleted file mode 100644
index f86fe2d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationDescriptor.java
+++ /dev/null
@@ -1,87 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDImport;
-
-public class NamespaceAndSchemaLocationDescriptor extends AbstractSectionDescriptor
-{
-	  NamespaceAndSchemaLocationSection namespaceAndSchemaLocationSection;
-	  /**
-	   * 
-	   */
-	  public NamespaceAndSchemaLocationDescriptor()
-	  {
-	    super();
-	    namespaceAndSchemaLocationSection = new NamespaceAndSchemaLocationSection();
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	   */
-	  public String getId()
-	  {
-	    return "org.eclipse.wst.xsdeditor.section.namespaceAndSchemaLocationSection";
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	   */
-	  public List getInputTypes()
-	  {
-	    List list = new ArrayList();
-	    list.add(XSDConcreteComponent.class);
-	    return list;
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	   */
-	  public ISection getSectionClass()
-	  {
-	    return namespaceAndSchemaLocationSection;
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	   */
-	  public String getTargetTab()
-	  {
-	    return "org.eclipse.wst.xmlwebservices.general";
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-	   */
-	  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-	  {
-	    Object object = null;	    
-	    
-	    if (selection instanceof StructuredSelection)
-	    {
-	      StructuredSelection structuredSelection = (StructuredSelection)selection;
-	      object = structuredSelection.getFirstElement();
-	      if (object instanceof XSDImport) {
-		    return true;
-	      }
-	    }
-	    
-	    return false;
-	  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationSection.java
deleted file mode 100644
index 91a1924..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceAndSchemaLocationSection.java
+++ /dev/null
@@ -1,361 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.delete.XSDExternalFileCleanup;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaHelper;
-import org.eclipse.wst.xsd.ui.internal.wizards.XSDSelectIncludeFileWizard;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.impl.XSDImportImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class NamespaceAndSchemaLocationSection extends CommonDirectivesSection
-{
-	Text namespaceText, prefixText;
-  protected String oldPrefixValue;
-	  
-	public NamespaceAndSchemaLocationSection()
-  {
-		super();
-	}
-	
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-	{
-		super.createControls(parent, factory);
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
-		CLabel namespaceLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_NAMESPACE")); //$NON-NLS-1$
-    namespaceText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
-		namespaceText.setEditable(false);
-
-    FormData data = new FormData();
-    data.left = new FormAttachment(0, 0);
-    data.right = new FormAttachment(namespaceText, +ITabbedPropertyConstants.HSPACE);
-    data.top = new FormAttachment(namespaceText, 0, SWT.CENTER);
-    namespaceLabel.setLayoutData(data);
-    
-    data = new FormData();
-    data.left = new FormAttachment(0, 110);
-    data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-    data.top = new FormAttachment(0, 0);
-    namespaceText.setLayoutData(data);
-    
-		CLabel prefixLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_PREFIX")); //$NON-NLS-1$				
-		prefixText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
-		prefixText.setEditable(true);
-    prefixText.addListener(SWT.Modify, this);
-
-    data = new FormData();
-    data.left = new FormAttachment(0, 0);
-    data.right = new FormAttachment(prefixText, 0);
-    data.top = new FormAttachment(prefixText, 0, SWT.CENTER);
-    prefixLabel.setLayoutData(data);  
-    
-		data = new FormData();
-		data.left = new FormAttachment(0, 110);
-		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(namespaceText, +ITabbedPropertyConstants.VSPACE);
-		prefixText.setLayoutData(data);
-   
-		// Create Schema Location Label
-		CLabel schemaLocationLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_LOCATION")); //$NON-NLS-1$
-    schemaLocationText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
-
-		// Create Wizard Button
-		wizardButton = getWidgetFactory().createButton(composite, "", SWT.NONE); //$NON-NLS-1$
-    wizardButton.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
-		FormData buttonFormData = new FormData();
-		buttonFormData.left = new FormAttachment(100, -rightMarginSpace + 2);
-		buttonFormData.right = new FormAttachment(100, 0);
-		buttonFormData.top = new FormAttachment(schemaLocationText, 0, SWT.CENTER);
-		wizardButton.setLayoutData(buttonFormData);
-		wizardButton.addSelectionListener(this);
-		
-		// Create Schema Location Text
-		schemaLocationText.setEditable(true);
-		FormData schemaLocationData = new FormData();
-		schemaLocationData.left = new FormAttachment(0, 110);
-		schemaLocationData.right = new FormAttachment(wizardButton, 0);
-		schemaLocationData.top = new FormAttachment(prefixText, +ITabbedPropertyConstants.VSPACE);
-		schemaLocationText.setLayoutData(schemaLocationData);
-		schemaLocationText.addListener(SWT.Modify, this);
-    
-    data = new FormData();
-    data.left = new FormAttachment(0, 0);
-    data.right = new FormAttachment(schemaLocationText, 0);
-    data.top = new FormAttachment(schemaLocationText, 0, SWT.CENTER);
-    schemaLocationLabel.setLayoutData(data);
-    
-    // error text
-    errorText = new StyledText(composite, SWT.FLAT);
-    errorText.setEditable(false);
-    errorText.setEnabled(false);
-    errorText.setText("");
-    
-    data = new FormData();
-    data.left = new FormAttachment(schemaLocationText, 0, SWT.LEFT);
-    data.right = new FormAttachment(100, 0);
-    data.top = new FormAttachment(schemaLocationText, 0);
-    errorText.setLayoutData(data);
-  }
-	
-	public void widgetSelected(SelectionEvent event)
-  {
-		if (event.widget == wizardButton)
-    {
-      setListenerEnabled(false);
-			Shell shell = Display.getCurrent().getActiveShell();
-		    
-			IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
-			ViewerFilter filter = new ResourceFilter(new String[] { ".xsd" }, //$NON-NLS-1$ 
-		            new IFile[] { currentIFile },
-		            null);
-		      
-			XSDSelectIncludeFileWizard fileSelectWizard = 
-			   new XSDSelectIncludeFileWizard(xsdSchema, 
-                                        false,
-			                                  XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_SCHEMA"), //$NON-NLS-1$
-			                                  XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_DESC"), //$NON-NLS-1$
-			                                  filter,
-			                                  (IStructuredSelection) selection);
-
-			WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
-			wizardDialog.create();
-			wizardDialog.setBlockOnOpen(true);
-			int result = wizardDialog.open();
-			  
-		  String value = schemaLocationText.getText();
-      prefixText.removeListener(SWT.Modify, this);
-		  if (result == Window.OK)
-		  {
-        errorText.setText("");
-        IFile selectedIFile = fileSelectWizard.getResultFile();
-        String schemaFileString = value;
-        if (selectedIFile != null) 
-        {
-          schemaFileString = URIHelper.getRelativeURI(selectedIFile.getLocation(), currentIFile.getLocation());
-        }
-        else
-        {
-          schemaFileString = fileSelectWizard.getURL();
-        }
-
-        String namespace = fileSelectWizard.getNamespace();
-        if (namespace == null) namespace = "";
-
-        XSDSchema externalSchema = fileSelectWizard.getExternalSchema();
-        handleSchemaLocationChange(schemaFileString, namespace, externalSchema);
-		  }
-      setListenerEnabled(true);
-      prefixText.addListener(SWT.Modify, this);
-		}
-	}
-
-  protected void handleSchemaLocationChange(String schemaFileString, String namespace, XSDSchema externalSchema)
-  {
-    XSDConcreteComponent comp = (XSDConcreteComponent)getInput();
-    if (comp instanceof XSDImport)
-    {
-      XSDImport xsdImport = (XSDImport)comp;
-      Element importElement = comp.getElement();
-      
-      beginRecording(XSDEditorPlugin.getXSDString("_UI_IMPORT_CHANGE"), importElement);
-
-      xsdImport.setNamespace(namespace);
-      xsdImport.setSchemaLocation(schemaFileString);
-      xsdImport.setResolvedSchema(externalSchema);
-      
-      java.util.Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-      
-//      System.out.println("changed Import Map is " + map.values());
-//      System.out.println("changed import Map keys are " + map.keySet());
-
-      // Referential integrity on old import
-      // How can we be sure that if the newlocation is the same as the oldlocation
-      // the file hasn't changed
-      
-      XSDSchema referencedSchema = xsdImport.getResolvedSchema();
-      if (referencedSchema != null)
-      {
-        XSDExternalFileCleanup cleanHelper = new XSDExternalFileCleanup(referencedSchema);
-        cleanHelper.visitSchema(xsdSchema);
-      }
-
-      Element schemaElement = getSchema().getElement();
-
-      // update the xmlns in the schema element first, and then update the import element next
-      // so that the last change will be in the import element.  This keeps the selection
-      // on the import element
-      TypesHelper helper = new TypesHelper(externalSchema);
-      String prefix = helper.getPrefix(namespace, false);
-      
-      if (map.containsKey(prefix))
-      {
-        prefix = null;
-      }
-
-      if (prefix == null || (prefix !=null && prefix.length() == 0))
-      {
-        StringBuffer newPrefix = new StringBuffer("pref");  //$NON-NLS-1$
-        int prefixExtension = 1;
-        while (map.containsKey(newPrefix.toString()) && prefixExtension < 100)
-        {
-          newPrefix = new StringBuffer("pref" + String.valueOf(prefixExtension));
-          prefixExtension++;
-        }
-        prefix = newPrefix.toString();
-      }
-
-      if (namespace.length() > 0)
-      {
-        // if ns already in map, use its corresponding prefix
-        if (map.containsValue(namespace))
-        {
-          TypesHelper typesHelper = new TypesHelper(xsdSchema);
-          prefix = typesHelper.getPrefix(namespace, false);
-        }
-        else // otherwise add to the map
-        {
-          schemaElement.setAttribute("xmlns:"+prefix, namespace);
-        }
-        prefixText.setText(prefix);
-      }
-      else
-      {
-        prefixText.setText("");
-        namespaceText.setText("");
-      }
-        
-      endRecording(importElement);
-      
-//      System.out.println("changed Import Map is " + map.values());
-//      System.out.println("changed import Map keys are " + map.keySet());
-
-    }        
-    refresh();
-  }
-  
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-		if (doRefresh)
-		{
-      errorText.setText("");
-			setListenerEnabled(false);
-
-			Element element = null;
-			if (input instanceof XSDImport) { 
-				element = ((XSDImportImpl) input).getElement();
-				
-				String namespace = element.getAttribute("namespace"); //$NON-NLS-1$
-				String schemaLocation = element.getAttribute("schemaLocation"); //$NON-NLS-1$
-				
-				TypesHelper helper = new TypesHelper(xsdSchema);
-		        String prefix = helper.getPrefix(element.getAttribute(XSDConstants.NAMESPACE_ATTRIBUTE), false);
-
-				if (namespace == null) {
-					namespace = ""; //$NON-NLS-1$
-				}
-				if (prefix == null) {
-					prefix = ""; //$NON-NLS-1$
-				}
-				if (schemaLocation == null) {
-					schemaLocation = ""; //$NON-NLS-1$
-				}
-				
-				namespaceText.setText(namespace);
-				prefixText.setText(prefix);
-				schemaLocationText.setText(schemaLocation);
-        oldPrefixValue = prefixText.getText();
-			}
-
-			setListenerEnabled(true);
-		}
-	}
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-   */
-  public boolean shouldUseExtraSpace()
-  {
-    return true;
-  }
-
-  public void doHandleEvent(Event event)
-  {
-    super.doHandleEvent(event);
-    if (event.type == SWT.Modify)
-    {
-      if (event.widget == prefixText)
-      {
-        if (validatePrefix(prefixText.getText()) && schemaLocationText.getText().trim().length() > 0)
-        {
-          Element element = ((XSDConcreteComponent)getInput()).getElement();
-          Map map = getSchema().getQNamePrefixToNamespaceMap();
-
-          if (map.containsKey(prefixText.getText()))
-          {
-            setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_LABEL_PREFIX_EXISTS"));
-          }
-          else
-          {
-            beginRecording(XSDEditorPlugin.getXSDString("_UI_PREFIX_CHANGE"), element);
-            
-            Element schemaElement = getSchema().getElement();
-            schemaElement.removeAttribute("xmlns:"+oldPrefixValue);
-            schemaElement.setAttribute("xmlns:" + prefixText.getText(), namespaceText.getText());
-            XSDSchemaHelper.updateElement(getSchema());
-
-            clearErrorMessage();
-            oldPrefixValue = prefixText.getText();
-            endRecording(element);  
-
-//            System.out.println("Map is " + map.values());
-//            System.out.println("Map keys are " + map.keySet());
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSection.java
deleted file mode 100644
index f32b09c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSection.java
+++ /dev/null
@@ -1,192 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.Iterator;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDProcessContents;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class NamespaceProcessContentsSection extends AbstractSection
-{
-  CCombo namespaceCombo;
-  CCombo processContentsCombo;
-  
-  private String[] namespaceComboValues = {
-      "",               //$NON-NLS-1$
-      "##any",          //$NON-NLS-1$
-      "##other",        //$NON-NLS-1$
-      "##targetNamespace", //$NON-NLS-1$
-      "##local" //$NON-NLS-1$
-  };
-
-  /**
-   * 
-   */
-  public NamespaceProcessContentsSection()
-  {
-    super();
-  }
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent,TabbedPropertySheetWidgetFactory factory)
-	{
-		super.createControls(parent, factory);
-		Composite composite =	getWidgetFactory().createFlatFormComposite(parent);
-		FormData data;
-		
-
-		namespaceCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(0, 0);
-		namespaceCombo.setLayoutData(data);
-//		Iterator list = XSDNamespaceConstraintCategory.VALUES.iterator();
-//		while (list.hasNext())
-//		{
-//		  namespaceCombo.add(((XSDNamespaceConstraintCategory)list.next()).getName());
-//		}
-		namespaceCombo.setItems(namespaceComboValues);
-		namespaceCombo.addSelectionListener(this);
-
-		CLabel namespaceLabel = getWidgetFactory().createCLabel(composite, XSDConstants.NAMESPACE_ATTRIBUTE);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(namespaceCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(namespaceCombo, 0, SWT.CENTER);
-		namespaceLabel.setLayoutData(data);
-
-		processContentsCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(namespaceCombo, +ITabbedPropertyConstants.VSPACE);
-		processContentsCombo.setLayoutData(data);
-		Iterator list = XSDProcessContents.VALUES.iterator();
-		processContentsCombo.add(""); //$NON-NLS-1$
-		while (list.hasNext())
-		{
-		  processContentsCombo.add(((XSDProcessContents)list.next()).getName());
-		}
-		processContentsCombo.addSelectionListener(this);
-
-		CLabel processContentsLabel = getWidgetFactory().createCLabel(composite, XSDConstants.PROCESSCONTENTS_ATTRIBUTE);
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(processContentsCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(processContentsCombo, 0, SWT.CENTER);
-		processContentsLabel.setLayoutData(data);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-//	  namespaceCombo.removeSelectionListener(this);
-//	  processContentsCombo.removeSelectionListener(this);
-	  namespaceCombo.setText(""); //$NON-NLS-1$
-	  processContentsCombo.setText(""); //$NON-NLS-1$
-	  Object input = getInput();
-	  if (input != null)
-	  {
-	    if (input instanceof XSDWildcard)
-	    {
-	      XSDWildcard wildcard = (XSDWildcard)input;
-	      if (wildcard.isSetLexicalNamespaceConstraint())
-	      {
-	        namespaceCombo.setText(wildcard.getStringLexicalNamespaceConstraint());
-	      }
-	      else
-	      {
-	        namespaceCombo.setText("");
-	      }
-	      if (wildcard.isSetProcessContents())
-	      {
-	        XSDProcessContents pc = wildcard.getProcessContents();
-	        processContentsCombo.setText(pc.getName());
-	      }
-	    }
-	  }
-	}
-	
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-
-  public void widgetSelected(SelectionEvent e)
-  {
-    XSDConcreteComponent concreteComponent = (XSDConcreteComponent)getInput();
-    Element element = concreteComponent.getElement();
-    if (concreteComponent instanceof XSDWildcard)
-    {
-      XSDWildcard wildcard =  (XSDWildcard)concreteComponent;
-      if (e.widget == namespaceCombo)
-      {
-        String newValue = namespaceCombo.getText();
-        boolean removeAttribute = false;
-        if (newValue.length() == 0)
-        {
-          removeAttribute = true;
-        }
-
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"), element); //$NON-NLS-1$
-        if (removeAttribute)
-        {
-          wildcard.unsetLexicalNamespaceConstraint();
-        }
-        else
-        {
-          wildcard.setStringLexicalNamespaceConstraint(newValue);
-        }
-        endRecording(element);
-      }
-      else if (e.widget == processContentsCombo)
-      {
-        String newValue = processContentsCombo.getText();
-        boolean removeAttribute = false;
-        if (newValue.length() == 0)
-        {
-          removeAttribute = true;
-        }
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_PROCESSCONTENTS_CHANGE"), element); //$NON-NLS-1$
-        if (removeAttribute)
-        {
-          wildcard.unsetProcessContents();
-        }
-        else
-        {
-          wildcard.setProcessContents(XSDProcessContents.get(processContentsCombo.getItem(processContentsCombo.getSelectionIndex())));
-        }
-        endRecording(element);
-      }
-    }
-    refresh();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSectionDescriptor.java
deleted file mode 100644
index 87608c9..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceProcessContentsSectionDescriptor.java
+++ /dev/null
@@ -1,84 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDWildcard;
-
-public class NamespaceProcessContentsSectionDescriptor extends AbstractSectionDescriptor
-{
-  /**
-   * 
-   */
-  public NamespaceProcessContentsSectionDescriptor()
-  {
-    super();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.xsdeditor.section.namespaceprocesscontents";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDWildcard.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new NamespaceProcessContentsSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.general";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDWildcard)
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSection.java
deleted file mode 100644
index 468106e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSection.java
+++ /dev/null
@@ -1,430 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Map;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.actions.XSDEditNamespacesAction;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.TargetNamespaceChangeHandler;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaHelper;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class NamespaceSection extends AbstractSection
-{
-	  IWorkbenchPart part;
-	  Text prefixText;
-	  Text targetNamespaceText;
-    Button editButton;
-    StyledText errorText;
-    Color red;
-	  
-	  /**
-	   * 
-	   */
-	  public NamespaceSection()
-	  {
-	    super();
-	  }
-
-		/**
-		 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-		 */
-		public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-		{
-			super.createControls(parent, factory);
-			Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-      
-			// Create Prefix Label
-			CLabel prefixLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_PREFIX")); //$NON-NLS-1$
-
-      int leftCoordinate = getStandardLabelWidth(composite, 
-          new String[] {XSDEditorPlugin.getXSDString("_UI_LABEL_TARGET_NAME_SPACE"), XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_PREFIX")});
-      
-			// Create Prefix Text
-			prefixText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
-			FormData prefixTextData = new FormData();
-			// prefixTextData.left = new FormAttachment(0, 115);
-      prefixTextData.left = new FormAttachment(0, leftCoordinate);
-			prefixTextData.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-			prefixText.setLayoutData(prefixTextData);
-			prefixText.addListener(SWT.Modify, this);		    
-		    
-			FormData data = new FormData();
-			data.left = new FormAttachment(0, 0);
-			data.right = new FormAttachment(prefixText, -ITabbedPropertyConstants.HSPACE);
-      data.top = new FormAttachment(prefixText, 0, SWT.CENTER);
-			prefixLabel.setLayoutData(data);
-
-			// Create TargetNamespace Label
-			CLabel targetNamespaceLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_TARGET_NAME_SPACE")); //$NON-NLS-1$
-      
-      // Create TargetNamespace Text
-      targetNamespaceText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
-      
-			FormData tnsLabelData = new FormData();
-			tnsLabelData.left = new FormAttachment(0, 0);
-      tnsLabelData.right = new FormAttachment(targetNamespaceText, -ITabbedPropertyConstants.HSPACE); 
-			tnsLabelData.top = new FormAttachment(targetNamespaceText, 0, SWT.CENTER);
-			targetNamespaceLabel.setLayoutData(tnsLabelData);
-
-      FormData tnsTextData = new FormData();
-      // tnsTextData.left = new FormAttachment(0, 115);
-      tnsTextData.left = new FormAttachment(0, leftCoordinate);
-      tnsTextData.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-      tnsTextData.top = new FormAttachment(prefixText, +ITabbedPropertyConstants.VSPACE);
-      targetNamespaceText.setLayoutData(tnsTextData);
-      targetNamespaceText.addListener(SWT.Modify, this);
-      
-      // Advanced Button
-      editButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_SECTION_ADVANCED_ATTRIBUTES") + "...", SWT.PUSH);
-
-      FormData buttonFormData = new FormData();
-      buttonFormData.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-      buttonFormData.top = new FormAttachment(targetNamespaceText, +ITabbedPropertyConstants.VSPACE);
-      editButton.setLayoutData(buttonFormData);
-      editButton.addSelectionListener(this);
-
-      // error text
-      errorText = new StyledText(composite, SWT.FLAT);
-      errorText.setEditable(false);
-      errorText.setEnabled(false);
-      errorText.setText("");
-      
-      data = new FormData();
-      data.left = new FormAttachment(targetNamespaceText, 0, SWT.LEFT);
-      data.right = new FormAttachment(100, 0);
-      data.top = new FormAttachment(editButton, 0);
-      errorText.setLayoutData(data);
-    }
-
-		/*
-		 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-		 */
-		public void refresh()
-		{
-      if (doRefresh)
-      {
-        // hack...open bug against properties
-        if (prefixText.isDisposed() || targetNamespaceText.isDisposed())
-        {
-          return;
-        }
-        if (prefixText.isFocusControl() || targetNamespaceText.isFocusControl())
-        {
-          return;
-        }
-
-        setListenerEnabled(false);
-	    	 
-			  Element element = xsdSchema.getElement();
-	    	
-        if (element != null)
-        {
-  		    // Handle prefixText
-  			  TypesHelper helper = new TypesHelper(xsdSchema);
-    		  String aPrefix = helper.getPrefix(element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE), false);
-        
-          if (aPrefix != null && aPrefix.length() > 0)
-  	      {
-  	  	  	prefixText.setText(aPrefix);
-  	  	  }
-  	  	  else
-          {
-  			  	prefixText.setText(""); //$NON-NLS-1$
-  			  }
-  	    	 
-  				// Handle TargetNamespaceText
-  				String tns = element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
-  			  if (tns != null && tns.length() > 0)
-          {
-   	        targetNamespaceText.setText(tns);
-   	      }
-  			  else
-          {
-  				  targetNamespaceText.setText(""); //$NON-NLS-1$
-  			  }
-          errorText.setText("");
-        }
-				setListenerEnabled(true);
-			}
-		}
-		
-		public void doHandleEvent(Event event)
-		{
-          errorText.setText("");
-          String prefixValue = prefixText.getText();
-          String tnsValue = targetNamespaceText.getText();
-          if (tnsValue.trim().length() == 0)
-          {
-            if (prefixValue.trim().length() > 0)
-            {
-              errorText.setText(XSDEditorPlugin.getXSDString("_ERROR_TARGET_NAMESPACE_AND_PREFIX"));
-              int length = errorText.getText().length();
-              red = new Color(null, 255, 0, 0);
-              StyleRange style = new StyleRange(0, length, red, targetNamespaceText.getBackground());
-              errorText.setStyleRange(style);
-              return;
-            }
-          }
-
-		  if (event.widget == prefixText)
-		  {
-            updateNamespaceInfo(prefixValue, tnsValue);
-		  }
-		  else if (event.widget == targetNamespaceText)
-          {
-            updateNamespaceInfo(prefixValue, tnsValue);
-		  }
-		}
-		
-		public void doWidgetSelected(SelectionEvent e) {
-			if (e.widget == editButton) {
-				XSDEditNamespacesAction nsAction = new XSDEditNamespacesAction(XSDEditorPlugin.getXSDString("_UI_ACTION_EDIT_NAMESPACES"), xsdSchema.getElement(), null, xsdSchema); //$NON-NLS-1$ 
-				nsAction.run();
-				refresh();				
-			}			
-		}
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-	   */
-	  public boolean shouldUseExtraSpace()
-	  {
-	    return true;
-	  }
-
-	  private void updateNamespaceInfo(String newPrefix, String newTargetNamespace)
-	  {
-	    Element element = xsdSchema.getElement();
-	    DocumentImpl doc = (DocumentImpl)element.getOwnerDocument();
-
-	    String modelTargetNamespace = xsdSchema.getTargetNamespace();
-	    String oldNamespace = xsdSchema.getTargetNamespace();
-	    
-	    TypesHelper helper = new TypesHelper(xsdSchema);
-   		String oldPrefix = helper.getPrefix(element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE), false);
-	    
-	    if (modelTargetNamespace == null)
-	    {
-	      modelTargetNamespace = ""; //$NON-NLS-1$
-	    }
-	        
-	    String targetNamespace = newTargetNamespace.trim(); 
-	    String prefix = newPrefix.trim();
-
-	    if (!validatePrefix(prefix) || !validateTargetNamespace(targetNamespace))
-	    {
-	      return;
-	    }
-	        
-	    if (prefix.length() > 0 && targetNamespace.length() == 0)
-	    {
-	       // can't have blank targetnamespace and yet specify a prefix
-	       return;
-	    }
-
-	    doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_TARGETNAMESPACE_CHANGE")); //$NON-NLS-1$
-	    String xsdForXSDPrefix = xsdSchema.getSchemaForSchemaQNamePrefix();
-	    Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-
-//	 For debugging
-//	        System.out.println("1. SW Map is " + map.values());
-//	        System.out.println("1. SW Map keys are " + map.keySet());
-
-	    // Check if prefix is blank
-	    // if it is, then make sure we have a prefix 
-	    // for schema for schema
-	    if (prefix.length() == 0)
-	    {
-	      // if prefix for schema for schema is blank
-	      // then set it to value specified in preference
-	      // and update ALL nodes with this prefix
-	      if (xsdForXSDPrefix == null || (xsdForXSDPrefix != null && xsdForXSDPrefix.trim().length() == 0))
-	      {
-	        // get preference prefix
-	        xsdForXSDPrefix = XSDEditorPlugin.getPlugin().getXMLSchemaPrefix();
-	        // get a unique prefix by checking what's in the map
-
-	        xsdForXSDPrefix = getUniqueSchemaForSchemaPrefix(xsdForXSDPrefix, map);
-	        element.setAttribute("xmlns:" + xsdForXSDPrefix, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); //$NON-NLS-1$
-
-	        updateAllNodes(element, xsdForXSDPrefix);
-	            
-	        // remove the old xmlns attribute for the schema for schema
-	        if (element.getAttribute("xmlns") != null && //$NON-NLS-1$
-	            element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) //$NON-NLS-1$
-	        {
-	          element.removeAttribute("xmlns"); //$NON-NLS-1$
-	        }
-	      }
-	    }
-
-	    if (targetNamespace.length() > 0 ||
-	       (targetNamespace.length() == 0 && prefix.length() == 0))
-	    {
-	      // clean up the old prefix for this schema
-	      if (oldPrefix != null && oldPrefix.length() > 0)
-	      {
-	        element.removeAttribute("xmlns:"+oldPrefix); //$NON-NLS-1$
-//	            element.setAttribute("xmlns:" + prefix, targetNamespace);
-//	            java.util.Map prefixToNameSpaceMap = xsdSchema.getQNamePrefixToNamespaceMap();
-//	            prefixToNameSpaceMap.remove(oldPrefix);
-	      }
-	      else // if no prefix
-	      {
-	        if (element.getAttribute("xmlns") != null) //$NON-NLS-1$
-	        {
-	          if (!element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) //$NON-NLS-1$
-	           {
-	            element.removeAttribute("xmlns"); //$NON-NLS-1$
-	          }
-	        }
-	      }
-	    }
-
-	    if (targetNamespace.length() > 0)
-	    {
-	      if (!modelTargetNamespace.equals(targetNamespace))
-	      {
-	        element.setAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE, targetNamespace);
-	      }
-	      // now set the new xmlns:prefix attribute
-	      if (prefix.length() > 0)
-	      {
-	        element.setAttribute("xmlns:" + prefix, targetNamespace); //$NON-NLS-1$
-	      }
-	      else
-	      {
-	        element.setAttribute("xmlns", targetNamespace); //$NON-NLS-1$
-	      }
-	      // set the targetNamespace attribute
-	    }
-	    else // else targetNamespace is blank
-	    {
-	      if (prefix.length() == 0)
-	      {
-	        element.removeAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
-	      }
-	    }
-
-//	    System.out.println("1.5 SW Map is " + map.values());
-//	    System.out.println("1.5 SW Map keys are " + map.keySet());
-	    
-	    // do our own referential integrity
-	    TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, oldNamespace, targetNamespace);
-	    targetNamespaceChangeHandler.resolve();
-	    
-	    XSDSchemaHelper.updateElement(xsdSchema);
-	    
-	    doc.getModel().endRecording(this);
-
-//	 For debugging
-//	        map = xsdSchema.getQNamePrefixToNamespaceMap();
-//	        System.out.println("2. SW Map is " + map.values());
-//	        System.out.println("2. SW Map keys are " + map.keySet());
-	  }
-
-	  private String getUniqueSchemaForSchemaPrefix(String xsdForXSDPrefix, Map map)
-	  {
-	    if (xsdForXSDPrefix == null || (xsdForXSDPrefix != null && xsdForXSDPrefix.trim().length() == 0))
-	     {       
-	      xsdForXSDPrefix = "xsd"; //$NON-NLS-1$
-	    }
-	    // ensure prefix is unique
-	    int prefixExtension = 1;
-	    while (map.containsKey(xsdForXSDPrefix) && prefixExtension < 100)
-	     {
-	      xsdForXSDPrefix = xsdForXSDPrefix + String.valueOf(prefixExtension);
-	      prefixExtension++;
-	    }
-	    return xsdForXSDPrefix;
-	  }
-	  
-	  private void updateAllNodes(Element element, String prefix)
-	  {
-	    element.setPrefix(prefix);
-	    NodeList list = element.getChildNodes();
-	    if (list != null)
-	    {
-	      for (int i=0; i < list.getLength(); i++)
-	      {
-	        Node child = list.item(i);
-	        if (child != null && child instanceof Element)
-	        {
-	          child.setPrefix(prefix);
-	          if (child.hasChildNodes())
-	          {
-	            updateAllNodes((Element)child, prefix);
-	          }
-	        }
-	      }
-	    }   
-	  }
-	  
-	  private boolean validateTargetNamespace(String ns)
-	  {
-	    // will allow blank namespace !!
-	    if (ns.equals(""))
-	     {
-	      return true;
-	    }
-	    
-	    String errorMessage = null;
-      try
-      {
-        URI testURI = new URI(ns);
-        testURI.isAbsolute();
-      }
-      catch (URISyntaxException e)
-      {
-	      errorMessage = XSDEditorPlugin.getXSDString("_WARN_INVALID_TARGET_NAMESPACE"); //$NON-NLS-1$
-	    }
-	    
-	    if (errorMessage == null || errorMessage.length() == 0)
-	     {
-	      return true;
-	    }
-	    return false;
-	  }
-    
-    public void dispose()
-    {
-      super.dispose();
-      if (red != null)
-      {
-        red.dispose();
-        red = null;
-      }
-    }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSectionDescriptor.java
deleted file mode 100644
index 69f2d15..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/NamespaceSectionDescriptor.java
+++ /dev/null
@@ -1,86 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-
-public class NamespaceSectionDescriptor extends AbstractSectionDescriptor
-{
-	  NamespaceSection namespaceSection;
-	  /**
-	   * 
-	   */
-	  public NamespaceSectionDescriptor()
-	  {
-	    super();
-	    namespaceSection = new NamespaceSection();
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	   */
-	  public String getId()
-	  {
-	    return "org.eclipse.wst.xsdeditor.section.namespaceSection";
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	   */
-	  public List getInputTypes()
-	  {
-	    List list = new ArrayList();
-	    list.add(XSDConcreteComponent.class);
-	    return list;
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	   */
-	  public ISection getSectionClass()
-	  {
-	    return namespaceSection;
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	   */
-	  public String getTargetTab()
-	  {
-	    return "org.eclipse.wst.xmlwebservices.general";
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-	   */
-	  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-	  {
-	    Object object = null;
-	    if (selection instanceof StructuredSelection)
-	    {
-	      StructuredSelection structuredSelection = (StructuredSelection)selection;
-	      object = structuredSelection.getFirstElement();
-	      if (object instanceof XSDSchemaImpl) {
-	      	return true;
-	      }
-	    }
-	    
-	    return false;
-	  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSection.java
deleted file mode 100644
index 2b934bc..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSection.java
+++ /dev/null
@@ -1,108 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.properties.XSDPropertySourceProvider;
-import org.eclipse.xsd.XSDElementDeclaration;
-
-public class OtherAttributesSection extends AbstractSection
-{
-  PropertySheetPage propertySheetPage;
-  
-  /**
-   * 
-   */
-  public OtherAttributesSection()
-  {
-    super();
-  }
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-	{
-		super.createControls(parent, factory);
-		composite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data = new FormData();
-		data.left = new FormAttachment(0, 0);
-    data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		data.bottom = new FormAttachment(100, 0);
-
-    propertySheetPage = new PropertySheetPage();
-		propertySheetPage.createControl(composite);
-    propertySheetPage.setPropertySourceProvider(new XSDPropertySourceProvider());
-    propertySheetPage.getControl().setLayoutData(data);
-	}
-	
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-    if (doRefresh)
-    {
-      if (isReadOnly)
-      {
-        composite.setEnabled(false);
-      }
-      else
-      {
-        composite.setEnabled(true);
-      }
-    }
-    propertySheetPage.refresh();
-	}
-
-  public void dispose()
-  {
-    super.dispose();
-    if (propertySheetPage != null)
-    {
-      propertySheetPage.dispose();
-      propertySheetPage = null;
-    }
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-   */
-  public boolean shouldUseExtraSpace()
-  {
-    return true;
-  }
-  
-  public void setInput(IWorkbenchPart part, ISelection selection)
-  {
-    super.setInput(part, selection);
-    if (input instanceof XSDElementDeclaration)
-    {
-      XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)input;
-      if (elementDeclaration.isElementDeclarationReference())
-      {
-        input = elementDeclaration.getResolvedElementDeclaration();
-        
-        isReadOnly = (!(elementDeclaration.getResolvedElementDeclaration().getRootContainer() == xsdSchema));
-      }
-    }
-    // update property sheet because of new input change
-    propertySheetPage.selectionChanged(part, selection);
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSectionDescriptor.java
deleted file mode 100644
index ce3808b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/OtherAttributesSectionDescriptor.java
+++ /dev/null
@@ -1,143 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDIdentityConstraintCategory;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDPatternFacet;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class OtherAttributesSectionDescriptor extends AbstractSectionDescriptor
-{
-  /**
-   * 
-   */
-  public OtherAttributesSectionDescriptor()
-  {
-    super();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.xsdeditor.section.otherattributes";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDConcreteComponent.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new OtherAttributesSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.other";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDConcreteComponent)
-      {
-      	if (object instanceof XSDAttributeGroupDefinition ||
-      	    object instanceof XSDAttributeUse ||
-      	    object instanceof XSDAttributeDeclaration ||
-      	    object instanceof XSDEnumerationFacet ||
-      	    object instanceof XSDPatternFacet ||
-      	    object instanceof XSDSimpleTypeDefinition ||
-      	    object instanceof XSDAnnotation ||
-            object instanceof XSDWildcard ||
-            object instanceof XSDSchemaDirective)
-      	{
-     	    return false;
-      	}
-        else if (object instanceof XSDModelGroup)
-        {
-          return false;
-        }
-        else if (object instanceof XSDElementDeclaration)
-        {
-//        Remove this to fix bug 3870 Element references should have the same properties as elements 
-//          if (((XSDElementDeclaration)object).isElementDeclarationReference())
-//          {
-//            return false;
-//          }
-          return true;
-        }
-        else if (object instanceof XSDModelGroupDefinition)
-        {
-          if (((XSDModelGroupDefinition)object).isModelGroupDefinitionReference())
-          {
-            return false;
-          }
-          return false;
-        }
-        else if (object instanceof XSDIdentityConstraintDefinition)
-        {
-          XSDIdentityConstraintDefinition constraint = (XSDIdentityConstraintDefinition)object;
-          XSDIdentityConstraintCategory category = constraint.getIdentityConstraintCategory();
-          if (category.getValue() == XSDIdentityConstraintCategory.KEYREF)
-          {
-            return true;
-          }
-          else
-          {
-            return false;
-          }
-        }
-        return true;
-      }
-    }
-    return false;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSection.java
deleted file mode 100644
index 9a0255c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSection.java
+++ /dev/null
@@ -1,165 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.wizards.RegexWizard;
-import org.eclipse.xsd.XSDPatternFacet;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class PatternSection extends AbstractSection
-{
-  /**
-   * 
-   */
-  public PatternSection()
-  {
-    super();
-  }
-  
-  Text patternText;
-  Button button;
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-	{
-
-		super.createControls(parent, factory);
-		Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data;
-
-		patternText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-		CLabel nameLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_VALUE") + ":"); //$NON-NLS-1$
-    button = getWidgetFactory().createButton(composite, "", SWT.PUSH); //$NON-NLS-1$
-    button.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
-    
-    patternText.addListener(SWT.Modify, this);
-
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(patternText, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(button, 0, SWT.CENTER);
-		nameLabel.setLayoutData(data);
-
-    button.addSelectionListener(this);
-		data = new FormData();
-		data.left = new FormAttachment(100, -rightMarginSpace + 2);
-		data.right = new FormAttachment(100,0);
-		data.top = new FormAttachment(patternText, 0, SWT.CENTER);
-		button.setLayoutData(data);
-
-    data = new FormData();
-    data.left = new FormAttachment(0, 100);
-    data.right = new FormAttachment(button, 0);
-    patternText.setLayoutData(data);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-	  setListenerEnabled(false);
-	  Object input = getInput();
-	  patternText.setText(""); //$NON-NLS-1$
-	  if (input != null)
-	  {
-	    Element element = null;
-	    if (input instanceof XSDPatternFacet)
-	    {
-	      element = ((XSDPatternFacet)input).getElement();
-	    }
-	    if (element != null)
-	    {
-        String result = element.getAttribute(XSDConstants.VALUE_ATTRIBUTE);
-        if (result != null)
-        {
-          patternText.setText(result);
-        }
-	    }
-	  }
-	  setListenerEnabled(true);
-	}
-
-  /**
-   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
-   */
-  public void widgetSelected(SelectionEvent e)
-  {
-    if (e.widget == button)
-    {
-	    Shell shell = Display.getCurrent().getActiveShell();
-	    Element element = ((XSDPatternFacet)getInput()).getElement();
-
-      String initialValue = element.getAttribute(XSDConstants.VALUE_ATTRIBUTE);
-      if (initialValue == null)
-      {
-        initialValue = ""; //$NON-NLS-1$
-      }
-      RegexWizard wizard = new RegexWizard(initialValue);
-
-      WizardDialog wizardDialog = new WizardDialog(shell, wizard);
-      wizardDialog.setBlockOnOpen(true);
-      wizardDialog.create();
-      
-      int result = wizardDialog.open();
-
-      if (result == Window.OK)
-      {
-        String newPattern = wizard.getPattern();
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_PATTERN_VALUE_CHANGE"), element); //$NON-NLS-1$
-        element.setAttribute(XSDConstants.VALUE_ATTRIBUTE, newPattern);
-        ((XSDPatternFacet)getInput()).setLexicalValue(newPattern);
-        endRecording(element);
-      }
-
-      refresh();
-    }
-  }
-  
-  public void doHandleEvent(Event event)
-  {
-	  if (event.widget == patternText)
-	  {
-		  XSDPatternFacet pattern = (XSDPatternFacet)getInput();
-		  
-      String newValue = patternText.getText();
-      if (newValue.length() > 0)
-      {
-        pattern.setLexicalValue(newValue);
-      }
-	  }
-
-  }
-
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSectionDescriptor.java
deleted file mode 100644
index 68219c7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/PatternSectionDescriptor.java
+++ /dev/null
@@ -1,85 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDPatternFacet;
-
-public class PatternSectionDescriptor extends AbstractSectionDescriptor
-{
-  /**
-   * 
-   */
-  public PatternSectionDescriptor()
-  {
-    super();
-  }
-  
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.xsdeditor.section.pattern";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDPatternFacet.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new PatternSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.general";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDPatternFacet)
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSection.java
deleted file mode 100644
index 574d548..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSection.java
+++ /dev/null
@@ -1,288 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class ReferenceSection extends AbstractSection
-{
-  protected CCombo componentNameCombo; 
-  Button button;
-  IEditorPart editorPart;
-  CLabel refLabel;
-  
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-	{
-		super.createControls(parent, factory);
-		composite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data;
-
-    componentNameCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-    componentNameCombo.addSelectionListener(this);
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(0, 1);
-		componentNameCombo.setLayoutData(data);
-
-		refLabel = getWidgetFactory().createCLabel(composite, XSDConstants.REF_ATTRIBUTE + ":");  //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(componentNameCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(componentNameCombo, 0, SWT.CENTER);
-		refLabel.setLayoutData(data);
-	}
-
-  public void setInput(IWorkbenchPart part, ISelection selection)
-  {
-    super.setInput(part, selection);
-    
-    Object obj = getInput();
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    List items = new ArrayList();
-    if (obj instanceof XSDElementDeclaration)
-    {
-      XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)obj;
-      if (elementDeclaration.isElementDeclarationReference())
-      {
-        items = helper.getGlobalElements();
-//            minimumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MINIMUM"));
-//            WorkbenchHelp.setHelp(minimumField, XSDEditorContextIds.XSDE_ELEMENT_REF_MINIMUM);
-//            maximumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MAXIMUM"));
-//            WorkbenchHelp.setHelp(maximumField, XSDEditorContextIds.XSDE_ELEMENT_REF_MAXIMUM);
-      }
-    }
-    else if (obj instanceof XSDAttributeDeclaration)
-    {
-      items = helper.getGlobalAttributes();
-    }
-    else if (obj instanceof XSDModelGroupDefinition)
-    {
-      XSDModelGroupDefinition group = (XSDModelGroupDefinition)obj;
-      if (group.isModelGroupDefinitionReference())
-      {
-        items = helper.getModelGroups();
-          // Need tooltip for Group Ref
-//            minimumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MINIMUM"));
-//            WorkbenchHelp.setHelp(minimumField, XSDEditorContextIds.XSDE_GROUP_REF_MINIMUM);
-//            maximumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MAXIMUM"));
-//            WorkbenchHelp.setHelp(maximumField, XSDEditorContextIds.XSDE_GROUP_REF_MAXIMUM);
-      }
-    }
-    else if (obj instanceof XSDNamedComponent)
-    {
-      XSDNamedComponent namedComponent = (XSDNamedComponent)obj;
-      Element element = namedComponent.getElement();
-      if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true))
-      {
-        items = helper.getGlobalAttributeGroups();
-//      WorkbenchHelp.setHelp(client, XSDEditorContextIds.XSDE_ATTRIBUTE_GROUP_REF_DESIGN_VIEW);
-//      WorkbenchHelp.setHelp(refCombo, XSDEditorContextIds.XSDE_ATTRIBUTE_GROUP_REF_NAME);
-      }
-      else if (XSDDOMHelper.inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, true))
-      {
-        items = helper.getGlobalElements();
-//          minimumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MINIMUM"));
-//          WorkbenchHelp.setHelp(minimumField, XSDEditorContextIds.XSDE_ELEMENT_REF_MINIMUM);
-//          maximumField.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_ELEMENT_MAXIMUM"));
-//          WorkbenchHelp.setHelp(maximumField, XSDEditorContextIds.XSDE_ELEMENT_REF_MAXIMUM);
-      }
-    }
-    else if (obj instanceof XSDAttributeUse)
-    {
-      XSDAttributeUse attributeUse = (XSDAttributeUse)obj;
-      Element element = attributeUse.getElement();
-      if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
-      {
-        items = helper.getGlobalAttributes();
-//      WorkbenchHelp.setHelp(client, XSDEditorContextIds.XSDE_ATTRIBUTE_REF_DESIGN_VIEW);
-//      WorkbenchHelp.setHelp(refCombo, XSDEditorContextIds.XSDE_ATTRIBUTE_REF_NAME);      
-      }
-    }      
-    items.add(0, "");
-    int size = items.size();
-    String [] st = new String[size];
-    System.arraycopy(items.toArray(), 0, st, 0, size);
-    componentNameCombo.setItems(st);
-      
-    st = null;
-  }
-	
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-    if (doRefresh)
-    {
-  	  setListenerEnabled(false);  
-  //	  componentNameCombo.removeListener(SWT.Modify, this);
-  	  Object input = getInput();
-      if (isReadOnly)
-      {
-        composite.setEnabled(false);
-      }
-      else
-      {
-        composite.setEnabled(true);
-      }
-
-  	  if (input instanceof XSDNamedComponent)
-  	  {
-        XSDNamedComponent namedComponent = (XSDNamedComponent)getInput();
-        Element element = namedComponent.getElement();
-        if (element != null)
-        {
-          String attrValue = element.getAttribute(XSDConstants.REF_ATTRIBUTE);
-          if (attrValue == null)
-          {
-            attrValue = "";
-          }
-          componentNameCombo.setText(attrValue);
-        }
-  	  }
-      else if (input instanceof XSDParticleContent)
-      {
-        XSDParticleContent particle = (XSDParticleContent)input;
-        Element element = particle.getElement();
-        String attrValue = element.getAttribute(XSDConstants.REF_ATTRIBUTE);
-        if (attrValue == null)
-        {
-          attrValue = "";
-        }
-        componentNameCombo.setText(attrValue);
-      }
-  	  else if (input instanceof XSDAttributeUse)
-  	  {
-  	    XSDAttributeUse attributeUse = (XSDAttributeUse)getInput();
-  	    Element element = attributeUse.getElement();
-        String attrValue = element.getAttribute(XSDConstants.REF_ATTRIBUTE);
-        if (attrValue == null)
-        {
-          attrValue = "";
-        }
-        componentNameCombo.setText(attrValue);
-  	  }
-  	  
-      setListenerEnabled(true);
-  //    componentNameCombo.addListener(SWT.Modify, this);
-    }
-	}
-
-	
-  public void widgetSelected(SelectionEvent e)
-  {
-	  Object input = getInput();
-    if (e.widget == componentNameCombo)
-    {
-      String newValue = componentNameCombo.getText();
-		  if (input instanceof XSDNamedComponent)
-		  {
-	      XSDNamedComponent namedComponent = (XSDNamedComponent)getInput();
-	      Element element = namedComponent.getElement();
-	      
-	      if (namedComponent instanceof XSDElementDeclaration)
-	      {
-	        beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_REF_CHANGE"), element); //$NON-NLS-1$
-	        element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
-	        endRecording(element);
-	      }
-			  else if (namedComponent instanceof XSDAttributeDeclaration)
-			  {
-	        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTEGROUP_REF_CHANGE"), element); //$NON-NLS-1$
-	        element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
-	        endRecording(element);
-
-			  }
-	  	  else if (namedComponent instanceof XSDAttributeGroupDefinition)
-	  	  {
-	        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTEGROUP_REF_CHANGE"), element); //$NON-NLS-1$
-	        // element.setAttribute(XSDConstants.REF_ATTRIBUTE, (String) value);
-	        XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)namedComponent;
-	        Iterator iter = xsdSchema.getAttributeGroupDefinitions().iterator();
-	        while (iter.hasNext())
-	        {
-	          XSDAttributeGroupDefinition def = (XSDAttributeGroupDefinition)iter.next();
-	          if (def.getQName(xsdSchema).equals(componentNameCombo.getText()))
-	          {
-	            attrGroup.setResolvedAttributeGroupDefinition(def);
-	            attrGroup.setName(componentNameCombo.getText());
-	            break;
-	          }
-	        }  
-	        endRecording(element);
-	  	  }
-        else if (namedComponent instanceof XSDModelGroupDefinition)
-        {
-          beginRecording(XSDEditorPlugin.getXSDString("_UI_GROUP_REF_CHANGE"), element); //$NON-NLS-1$
-          element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
-          endRecording(element);
-        }
-		  }
-		  else if (input instanceof XSDAttributeUse)
-		  {
-		    XSDAttributeUse attributeUse = (XSDAttributeUse)getInput();
-		    Element element = attributeUse.getElement();
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ATTRIBUTE_USE_CHANGE"), element); //$NON-NLS-1$
-        Iterator iter = xsdSchema.getAttributeDeclarations().iterator();
-        while (iter.hasNext())
-        {
-          XSDAttributeDeclaration attr = (XSDAttributeDeclaration)iter.next();
-          if (attr.getQName(xsdSchema).equals(newValue))
-          {
-            attributeUse.setAttributeDeclaration(attr);
-            element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
-            break;
-          }
-        }  
-
-        endRecording(element);
-		  }
-    }
-  }
-  
-  public void setEditorPart(IEditorPart editorPart)
-  {
-    this.editorPart = editorPart;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSectionDescriptor.java
deleted file mode 100644
index 8c11abb..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ReferenceSectionDescriptor.java
+++ /dev/null
@@ -1,173 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class ReferenceSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor
-{
-  ReferenceSection referenceSection;
-  
-  /**
-   * 
-   */
-  public ReferenceSectionDescriptor()
-  {
-    super();
-    this.referenceSection = new ReferenceSection();
-  }
-
-
-  /**
-   * 
-   */
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.wsdleditor.section.reference";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDNamedComponent.class);
-    list.add(XSDElementDeclaration.class);
-    list.add(XSDModelGroupDefinition.class);
-    list.add(XSDAttributeDeclaration.class);
-    list.add(XSDAttributeUse.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return referenceSection;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.general";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    if (part != null)
-    {
-      referenceSection.setEditorPart(part.getSite()
-            .getWorkbenchWindow()
-              .getActivePage()
-                .getActiveEditor());
-    }
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDNamedComponent)
-      {
-        XSDNamedComponent namedComponent = (XSDNamedComponent)object;
-        Element element = namedComponent.getElement();
-        if (element == null)
-        {
-          return false;
-        }
-        if (inputEquals(element, element.getLocalName(), true))
-        {
-          return true;
-        }
-        else
-        {
-          return false;
-        }
-      }
-      else if (object instanceof XSDElementDeclaration)
-      {
-        XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)object;
-        if (elementDeclaration.isElementDeclarationReference())
-        {
-          return true;
-        }
-        else
-        {
-          return false;
-        }
-      }
-      else if (object instanceof XSDAttributeDeclaration)
-      {
-        XSDAttributeDeclaration attr = (XSDAttributeDeclaration)object;
-        if (attr.isAttributeDeclarationReference())
-        {
-          return true;
-        }
-        else
-        {
-          return false;
-        }
-      }
-      else if (object instanceof XSDModelGroupDefinition)
-      {
-        XSDModelGroupDefinition group = (XSDModelGroupDefinition)object;
-        if (group.isModelGroupDefinitionReference())
-        {
-          return true;
-        }
-        else
-        {
-          return false;
-        }
-      }
-      else if (object instanceof XSDAttributeUse)
-      {
-        XSDAttributeUse attributeUse = (XSDAttributeUse)object;
-        Element element = attributeUse.getElement();
-        if (inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
-        {
-          return true;
-        }
-        else
-        {
-          return false;
-        }
-      }
-      
-    }
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationDescriptor.java
deleted file mode 100644
index ca2200d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationDescriptor.java
+++ /dev/null
@@ -1,88 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-
-public class SchemaLocationDescriptor extends AbstractSectionDescriptor
-{
-	  SchemaLocationSection schemaLocationSection;
-	  /**
-	   * 
-	   */
-	  public SchemaLocationDescriptor()
-	  {
-	    super();
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-	   */
-	  public String getId()
-	  {
-	    return "org.eclipse.wst.xsdeditor.section.schemaLocationSection";
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-	   */
-	  public List getInputTypes()
-	  {
-	    List list = new ArrayList();
-	    list.add(XSDConcreteComponent.class);
-	    return list;
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-	   */
-	  public ISection getSectionClass()
-	  {
-	    return schemaLocationSection;
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-	   */
-	  public String getTargetTab()
-	  {
-	    return "org.eclipse.wst.xmlwebservices.general";
-	  }
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-	   */
-	  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-	  {
-	    Object object = null;	    
-	    
-	    if (selection instanceof StructuredSelection)
-	    {
-	      StructuredSelection structuredSelection = (StructuredSelection)selection;
-	      object = structuredSelection.getFirstElement();
-	      if (object instanceof XSDInclude || object instanceof XSDRedefine) {
-		    schemaLocationSection = new SchemaLocationSection();
-	      	return true;
-	      }
-	    }
-	    
-	    return false;
-	  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationSection.java
deleted file mode 100644
index 6f2d1df..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SchemaLocationSection.java
+++ /dev/null
@@ -1,207 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.wizards.XSDSelectIncludeFileWizard;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.impl.XSDIncludeImpl;
-import org.eclipse.xsd.impl.XSDRedefineImpl;
-import org.w3c.dom.Element;
-
-public class SchemaLocationSection extends CommonDirectivesSection
-{
-	  IWorkbenchPart part;
-	  
-	  /**
-	   * 
-	   */
-	  public SchemaLocationSection()
-	  {
-	    super();
-	  }
-
-		/**
-		 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-		 */
-		public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-		{
-			super.createControls(parent, factory);
-			Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
-      int leftCoordinate = getStandardLabelWidth(composite, 
-          new String[] {XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_LOCATION")});
-      
-			// Create Schema Location Label
-			CLabel schemaLocationLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_SCHEMA_LOCATION")); //$NON-NLS-1$
-			
-      // Create Schema Location Text
-      schemaLocationText = getWidgetFactory().createText(composite, "", SWT.NONE); //$NON-NLS-1$
-      
-			// Create Wizard Button
-			wizardButton = getWidgetFactory().createButton(composite, "", SWT.NONE); //$NON-NLS-1$
-      
-      wizardButton.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
-			FormData buttonFormData = new FormData();
-			buttonFormData.left = new FormAttachment(100, -rightMarginSpace + 2);
-			buttonFormData.right = new FormAttachment(100,0);
-			buttonFormData.top = new FormAttachment(schemaLocationText, 0, SWT.CENTER);
-			wizardButton.setLayoutData(buttonFormData);
-			wizardButton.addSelectionListener(this);
-			
-			schemaLocationText.setEditable(true);
-			FormData schemaLocationData = new FormData();
-      schemaLocationData.left = new FormAttachment(0, leftCoordinate);
-      schemaLocationData.right = new FormAttachment(wizardButton, 0);
-			schemaLocationText.setLayoutData(schemaLocationData);
-			schemaLocationText.addListener(SWT.Modify, this);		    
-
-			FormData data = new FormData();
-			data.left = new FormAttachment(0, 0);
-			data.right = new FormAttachment(schemaLocationText, -ITabbedPropertyConstants.HSPACE);
-			data.top = new FormAttachment(schemaLocationText, 0, SWT.CENTER);
-			schemaLocationLabel.setLayoutData(data);
-			
-      // error text
-      errorText = new StyledText(composite, SWT.FLAT);
-      errorText.setEditable(false);
-      errorText.setEnabled(false);
-      errorText.setText("");
-      
-      data = new FormData();
-      data.left = new FormAttachment(schemaLocationText, 0, SWT.LEFT);
-      data.right = new FormAttachment(100, 0);
-      data.top = new FormAttachment(schemaLocationText, 0);
-      errorText.setLayoutData(data);
-		}
-		
-		public void widgetSelected(SelectionEvent event)
-    {
-			if (event.widget == wizardButton)
-      {
-				Shell shell = Display.getCurrent().getActiveShell();
-			    
-				IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
-				ViewerFilter filter = new ResourceFilter(new String[] { ".xsd" },  //$NON-NLS-1$
-			            new IFile[] { currentIFile },
-			            null);
-			      
-			  XSDSelectIncludeFileWizard fileSelectWizard = 
-			      new XSDSelectIncludeFileWizard(xsdSchema, true,
-			          XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_SCHEMA"), //$NON-NLS-1$
-			          XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_DESC"), //$NON-NLS-1$
-			          filter,
-			          (IStructuredSelection) selection);
-
-			  WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
-			  wizardDialog.create();
-			  wizardDialog.setBlockOnOpen(true);
-			  int result = wizardDialog.open();
-				  
-	      String value = schemaLocationText.getText();
-	      if (result == Window.OK)
-	      {
-          errorText.setText("");
-	        IFile selectedIFile = fileSelectWizard.getResultFile();
-	        String schemaFileString = value;
-	        if (selectedIFile != null) 
-	        {
-	          schemaFileString = URIHelper.getRelativeURI(selectedIFile.getLocation(), currentIFile.getLocation());
-	        }
-	        else
-	        {
-	          schemaFileString = fileSelectWizard.getURL();
-	        }
-
-          handleSchemaLocationChange(schemaFileString, fileSelectWizard.getNamespace(), null);
-	        refresh();
-			  } 
-			}
-		}
-
-		/*
-		 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-		 */
-		public void refresh()
-		{
-			if (doRefresh)
-			{
-				setListenerEnabled(false);
-
-				Element element = null;
-				if (input instanceof XSDInclude)
-        { 
-					element = ((XSDIncludeImpl) input).getElement();
-				}
-				else if (input instanceof XSDRedefine)
-        {
-					element = ((XSDRedefineImpl) input).getElement();
-				}
-				
-				if (element != null)
-        {
-					String location = ""; //$NON-NLS-1$
-					location = element.getAttribute("schemaLocation"); //$NON-NLS-1$
-          if (location == null)
-          {
-            location = "";
-          }
-					schemaLocationText.setText(location);
-				}
-
-        setListenerEnabled(true);
-			}
-		}
-
-	  /* (non-Javadoc)
-	   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-	   */
-	  public boolean shouldUseExtraSpace()
-	  {
-	    return true;
-	  }
-    
-    protected void handleSchemaLocationChange(String schemaFileString, String namespace, XSDSchema externalSchema)
-    {
-      if (input instanceof XSDInclude)
-      {
-        Element element = ((XSDIncludeImpl) input).getElement();
-        element.setAttribute("schemaLocation", schemaFileString); //$NON-NLS-1$
-      }
-      else if (input instanceof XSDRedefine)
-      {
-        Element element = ((XSDRedefineImpl) input).getElement();
-        element.setAttribute("schemaLocation", schemaFileString); //$NON-NLS-1$
-      }
-    }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentBaseTypeOptionsDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentBaseTypeOptionsDialog.java
deleted file mode 100644
index 2aa1a50..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentBaseTypeOptionsDialog.java
+++ /dev/null
@@ -1,158 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class SimpleContentBaseTypeOptionsDialog extends TypesDialog
-{
-  /**
-   * @param parentShell
-   * @param element
-   * @param id
-   * @param xsdSchema
-   */
-  public SimpleContentBaseTypeOptionsDialog(Shell parentShell, Element element, Object id, XSDSchema xsdSchema)
-  {
-    super(parentShell, element, id, xsdSchema);
-    showAnonymous = false;
-  }
-  
-	protected void ok()
-	{
-		TableItem[] items = table.getItems();
-		int selection = table.getSelectionIndex();
-		if (items != null && items.length > 0 && selection >= 0)
-		 {
-		  typeObject = items[selection].getData();
-		}
-	}
-
-  
-  public void handleSetInput()
-  {
-    XSDDOMHelper domHelper = new XSDDOMHelper();
-    typeSection.getSimpleType().setSelection(false);
-    typeSection.getUserSimpleType().setSelection(false);
-    typeSection.getUserComplexType().setSelection(false);
-    showAnonymous = false;
-    if (element != null)
-    {
-      String derivedBy = domHelper.getDerivedByName(element);
-      String baseType = domHelper.getBaseType(element);
-      boolean derivedByRestriction = true;
-      
-      if (XSDDOMHelper.inputEquals(element, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-      {
-        typeSection.getSimpleType().setEnabled(false);
-        typeSection.getUserSimpleType().setEnabled(false);
-        typeSection.getUserComplexType().setSelection(true);
-
-        previousType = 3;
-      }
-      else if (XSDDOMHelper.inputEquals(element, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-      {
-        typeSection.getSimpleType().setEnabled(false);
-        typeSection.getUserSimpleType().setEnabled(false);
-
-        if (derivedBy.equals("restriction"))
-        {
-          typeSection.getSimpleType().setEnabled(false);
-          typeSection.getUserSimpleType().setEnabled(false);
-          typeSection.getUserComplexType().setEnabled(true);
-        }
-        else if (derivedBy.equals("extension"))
-        {
-          derivedByRestriction = false;
-          typeSection.getSimpleType().setEnabled(true);
-          typeSection.getUserSimpleType().setEnabled(true);
-          typeSection.getUserComplexType().setEnabled(true);
-        }
-      }
-        
-      if (derivedBy != null)
-      {
-          if (baseType != null && !baseType.equals(""))
-          {
-            Element parent = (Element)element.getParentNode();
-            XSDConcreteComponent component = null;
-            if (parent != null)
-            {
-              component = xsdSchema.getCorrespondingComponent(parent);
-            }
-            XSDTypeDefinition baseTypeDefinition = null;
-            if (component instanceof XSDComplexTypeDefinition)
-            {
-              XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition)component;
-              baseTypeDefinition = complexType.getBaseTypeDefinition();
-            }               
-
-            if (typeSection.getBuiltInTypeNamesList(xsdSchema).contains(baseType) && !derivedByRestriction)
-            {
-              typeSection.getSimpleType().setSelection(true);
-              populateBuiltInType();
-              int i = typeSection.getBuiltInTypeNamesList(xsdSchema).indexOf(baseType);
-              table.setSelection(i);
-              previousType = 1;
-            }
-            else if (baseTypeDefinition instanceof XSDSimpleTypeDefinition && !derivedByRestriction)
-            {
-              typeSection.getUserSimpleType().setSelection(true);
-              populateUserSimpleType();
-              int i = typeSection.getUserSimpleTypeNamesList(xsdSchema).indexOf(baseType);
-              if (showAnonymous)
-               {
-                table.setSelection(i + 1);
-              }
-              else
-               {
-                table.setSelection(i);
-              }
-              previousType = 2;
-            }
-            else if (baseTypeDefinition instanceof XSDComplexTypeDefinition)
-            {
-              typeSection.getUserComplexType().setSelection(true);
-              populateUserComplexType();
-              int i = typeSection.getUserComplexTypeNamesList(xsdSchema).indexOf(baseType);
-              if (showAnonymous)
-               {
-                table.setSelection(i + 1);
-              }
-              else
-               {
-                table.setSelection(i);
-              }
-              previousType = 3;
-            }
-          }
-          else
-          {
-            typeSection.getUserComplexType().setSelection(true);
-            populateUserComplexType();
-            table.setSelection(0);
-          }
-        }
-
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentUnionMemberTypesDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentUnionMemberTypesDialog.java
deleted file mode 100644
index c58a7aa..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleContentUnionMemberTypesDialog.java
+++ /dev/null
@@ -1,311 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.Iterator;
-import java.util.List;
-
-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.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.wst.xsd.ui.internal.widgets.TypeSection;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-public class SimpleContentUnionMemberTypesDialog extends Dialog implements SelectionListener
-{
-  XSDSimpleTypeDefinition simpleType;
-  /**
-   * @param parentShell
-   */
-  public SimpleContentUnionMemberTypesDialog(Shell parentShell, XSDSimpleTypeDefinition simpleType)
-  {
-    super(parentShell);
-    this.simpleType = simpleType;
-  }
-  
-  Table table;
-  TypeSection typeSection;
-  Button addButton, removeButton;
-  org.eclipse.swt.widgets.List memberTypesList;
-  
-  private String result;
-
-  protected void configureShell(Shell shell)
-  {
-    super.configureShell(shell);
-  }
-
-  protected void buttonPressed(int buttonId)
-  {
-    if (buttonId == Dialog.OK)
-    {
-      StringBuffer sb = new StringBuffer();
-      int length = memberTypesList.getItemCount();
-      for (int i=0 ; i < length; i++)
-      {
-        sb.append(memberTypesList.getItem(i));
-        if (i < length - 1)
-        {
-          sb.append(" ");
-        }
-      }
-      result = sb.toString();
-    }
-    super.buttonPressed(buttonId);
-  }
-
-  public String getResult() { return result; }
-
-  //
-  // Create the controls
-  //
-  public Control createDialogArea(Composite parent)
-  {
-    Composite client = (Composite)super.createDialogArea(parent);
-    getShell().setText("Union " + XSDConstants.MEMBERTYPES_ATTRIBUTE); 
-    
-    Label instructions = new Label(client, SWT.LEFT | SWT.WRAP);
-    instructions.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_SELECT_MEMBERTYPES"));
-    
-    Composite columnsComposite = new Composite(client, SWT.NONE);
-    GridLayout ccGL = new GridLayout();
-    ccGL.verticalSpacing = 0;
-    ccGL.horizontalSpacing = 0;
-    ccGL.marginHeight = 0;
-    ccGL.marginWidth = 0;
-    ccGL.makeColumnsEqualWidth = true;
-    ccGL.numColumns = 3;
-    columnsComposite.setLayout(ccGL);
-    
-    GridData ccGD = new GridData();
-    ccGD.grabExcessHorizontalSpace = true;
-    ccGD.horizontalAlignment = GridData.FILL;
-    columnsComposite.setLayoutData(ccGD);     
-                           
-    typeSection = new TypeSection(columnsComposite);
-    typeSection.setShowUserComplexType(false);
-
-    typeSection.createClient(columnsComposite);
-    typeSection.getSimpleType().setSelection(false);
-    typeSection.getSimpleType().addSelectionListener(this);
-    typeSection.getUserSimpleType().addSelectionListener(this);
-    
-    ViewUtility.createHorizontalFiller(columnsComposite, 1);
-    
-    Label memberListLabel = new Label(columnsComposite, SWT.LEFT);
-    memberListLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_VALUE"));
-    
-    Composite dataComposite = new Composite(client, SWT.NONE);
-    GridLayout dcGL = new GridLayout();
-    dcGL.verticalSpacing = 0;
-    dcGL.marginHeight = 0;
-    dcGL.marginWidth = 0;
-    dcGL.numColumns = 3;
-    dataComposite.setLayout(dcGL);
-    
-    GridData dcGD = new GridData();
-    dcGD.grabExcessHorizontalSpace = true;
-    dcGD.grabExcessVerticalSpace = true;
-    dataComposite.setLayoutData(dcGD);
-    
-    table = new Table(dataComposite,
-        SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); 
-    table.setHeaderVisible(false);
-    table.setLinesVisible(true);
-    GridData gd2 = new GridData();
-    gd2.grabExcessHorizontalSpace = true;
-    gd2.grabExcessVerticalSpace = true;
-    gd2.horizontalAlignment = GridData.FILL;
-    gd2.verticalAlignment = GridData.FILL;
-    gd2.heightHint = 200;
-    gd2.widthHint = 200;
-    table.setLayoutData(gd2);
-
-    // Fill table
-    handleSetInput();
-    table.getItemCount();
-
-    TableColumn tc = new TableColumn(table, SWT.LEFT);
-    tc.setWidth(200);
-    tc.setResizable(true);
-    
-    Composite buttonComposite = new Composite(dataComposite, SWT.NONE);
-    GridLayout bcGL = new GridLayout();
-    bcGL.numColumns = 1;
-    buttonComposite.setLayout(bcGL);
-    addButton = new Button(buttonComposite, SWT.PUSH);
-    addButton.setText(">");
-    addButton.addSelectionListener(this);
-    removeButton = new Button(buttonComposite, SWT.PUSH);
-    removeButton.setText("<");
-    removeButton.addSelectionListener(this);
-    
-    Composite listComposite = new Composite(dataComposite, SWT.NONE);
-    GridLayout mtGL = new GridLayout();
-    mtGL.numColumns = 1;
-    mtGL.marginHeight = 0;
-    mtGL.marginWidth = 0;
-    mtGL.horizontalSpacing = 0;
-    mtGL.verticalSpacing = 0;
-    listComposite.setLayout(mtGL);
-
-    GridData mtGD = new GridData();
-    mtGD.grabExcessHorizontalSpace = true;
-    mtGD.grabExcessVerticalSpace = true;
-    mtGD.verticalAlignment = GridData.FILL;
-    mtGD.horizontalAlignment = GridData.FILL;
-    listComposite.setLayoutData(mtGD);
-    
-    memberTypesList = new org.eclipse.swt.widgets.List(listComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
-    GridData mtlGD = new GridData();
-    mtlGD.grabExcessHorizontalSpace = true;
-    mtlGD.grabExcessVerticalSpace = true;
-    mtlGD.verticalAlignment = GridData.FILL;
-    mtlGD.horizontalAlignment = GridData.FILL;
-    mtlGD.heightHint = 200;
-    mtlGD.widthHint = 200;
-    memberTypesList.setLayoutData(mtlGD);
-    
-    initializeMemberListContent();
-    return client;
-  }
-
-  private void initializeMemberListContent()
-  {
-//    String result = element.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-//    if (result == null)
-//    {
-//      return;
-//    }
-//    StringTokenizer token = new StringTokenizer(result);
-//    while (token.hasMoreTokens())
-//    {
-//      memberTypesList.add(token.nextToken());
-//    }
-    XSDSchema schema = simpleType.getSchema();
-    for (Iterator i = simpleType.getMemberTypeDefinitions().iterator(); i.hasNext(); )
-    {
-      String name = ((XSDSimpleTypeDefinition)i.next()).getQName(schema);
-      if (name != null)
-      memberTypesList.add(name);
-    }
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-   */
-  public void widgetSelected(SelectionEvent e)
-  {
-    if (e.widget == typeSection.getSimpleType() && typeSection.getSimpleType().getSelection())
-     {
-      populateBuiltInType();
-    }
-    else if (e.widget == typeSection.getUserSimpleType() && typeSection.getUserSimpleType().getSelection())
-     {
-      populateUserSimpleType(false);
-    }
-    else if (e.widget == addButton)
-    {
-      TableItem[] items = table.getItems();
-      int selection = table.getSelectionIndex();
-      if (items != null && items.length > 0 && selection >= 0)
-      {
-        String typeToAdd = items[selection].getData().toString();
-        if (memberTypesList.indexOf(typeToAdd) < 0)
-        {
-          memberTypesList.add(items[selection].getData().toString());
-        }
-      }
-    }
-    else if (e.widget == removeButton)
-    {
-      String[] typesToRemove = memberTypesList.getSelection();
-      for (int i=0; i < typesToRemove.length; i++)
-      {
-        memberTypesList.remove(typesToRemove[i]);
-      }
-    }
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
-   */
-  public void widgetDefaultSelected(SelectionEvent e)
-  {
-  }
-  
-  public void handleSetInput()
-  {
-    populateBuiltInType();
-  }
-  
-  public void populateBuiltInType()
-  {
-    table.removeAll();
-    List items = getBuiltInTypeNamesList();
-    for (int i = 0; i < items.size(); i++)
-     {
-      TableItem item = new TableItem(table, SWT.NONE);
-      item.setText(items.get(i).toString());
-      item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
-      item.setData(items.get(i));
-    }
-  }
-
-  public void populateUserSimpleType(boolean showAnonymous)
-  {
-    table.removeAll();
-    if (showAnonymous)
-     {
-      TableItem anonymousItem = new TableItem(table, SWT.NONE);
-      anonymousItem.setText("**anonymous**");
-      anonymousItem.setData("**anonymous**");
-    }
-    List items = getUserSimpleTypeNamesList();
-    for (int i = 0; i < items.size(); i++)
-     {
-      TableItem item = new TableItem(table, SWT.NONE);
-      item.setText(items.get(i).toString());
-      item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
-      item.setData(items.get(i));
-    }
-  }
-  
-  public java.util.List getBuiltInTypeNamesList()
-  {
-    TypesHelper helper = new TypesHelper(simpleType.getSchema());
-    return helper.getBuiltInTypeNamesList();
-  }
-
-  public java.util.List getUserSimpleTypeNamesList()
-  {
-    TypesHelper helper = new TypesHelper(simpleType.getSchema());
-    return helper.getUserSimpleTypeNamesList();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSection.java
deleted file mode 100644
index c69a73a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSection.java
+++ /dev/null
@@ -1,570 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.actions.CreateElementAction;
-import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionDialog;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionProvider;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDSetTypeHelper;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class SimpleTypeSection extends AbstractSection
-{
-  CCombo varietyCombo;
-  Text typesText;
-  CLabel typesLabel;
-  Button button;
-
-  /**
-   * 
-   */
-  public SimpleTypeSection()
-  {
-    super();
-  }
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-	{
-		super.createControls(parent, factory);
-		composite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data;
-
-		varietyCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
-		CLabel label = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_VARIETY")); //$NON-NLS-1$
-    
-		List list = XSDVariety.VALUES;	
-		Iterator iter = list.iterator();
-		while (iter.hasNext())
-		{
-		  varietyCombo.add(((XSDVariety)iter.next()).getName());
-		}
-    varietyCombo.addSelectionListener(this);
-
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(0, 0);
-		varietyCombo.setLayoutData(data);
-
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(varietyCombo, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(varietyCombo, 0, SWT.CENTER);
-		label.setLayoutData(data);
-    
-    typesText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-    typesLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
-    button = getWidgetFactory().createButton(composite, "", SWT.PUSH); //$NON-NLS-1$
-    button.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
-    
-    typesText.addListener(SWT.Modify, this);
-
-    data = new FormData();
-    data.left = new FormAttachment(0, 100);
-    data.right = new FormAttachment(100, -rightMarginSpace - ITabbedPropertyConstants.HSPACE);
-    data.top = new FormAttachment(button, 0, SWT.CENTER);
-    typesText.setLayoutData(data);
-
-    data = new FormData();
-    data.left = new FormAttachment(0, 0);
-    data.right = new FormAttachment(typesText, -ITabbedPropertyConstants.HSPACE);
-    data.top = new FormAttachment(button, 0, SWT.CENTER);
-    typesLabel.setLayoutData(data);
-
-    button.addSelectionListener(this);
-    data = new FormData();
-    data.left = new FormAttachment(typesText, 0);
-    data.right = new FormAttachment(100,0);
-    data.top = new FormAttachment(varietyCombo, +ITabbedPropertyConstants.VSPACE);
-    button.setLayoutData(data);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-	  setListenerEnabled(false);
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-	  Object input = getInput();
-	  varietyCombo.setText(""); //$NON-NLS-1$
-    typesText.setText(""); //$NON-NLS-1$
-    typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
-	  if (input != null)
-	  {
-	    if (input instanceof XSDSimpleTypeDefinition)
-	    {
-	      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
-        
-        Element simpleTypeElement = st.getElement();
-        Element element = null;
-	      String variety = st.getVariety().getName();
-        
-        int intVariety = st.getVariety().getValue();
-        
-	      if (variety != null)
-	      {
-          varietyCombo.setText(variety);
-          if (intVariety == XSDVariety.ATOMIC)
-          {
-            element = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.RESTRICTION_ELEMENT_TAG);
-//            if (element == null)
-//            {
-//              element = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.EXTENSION_ELEMENT_TAG);
-//              if (element == null) return;
-//            }
-            
-            if (element == null)
-            {
-              varietyCombo.setText(XSDEditorPlugin.getXSDString("_UI_NO_TYPE")); // "Select a simple type variety"); //$NON-NLS-1$            
-            }
-            else
-            {
-              String result = element.getAttribute(XSDConstants.BASE_ATTRIBUTE);
-              if (result == null)
-              {
-                typesText.setText("**anonymous**"); //$NON-NLS-1$
-              }
-              else
-              {
-                typesText.setText(result);
-              }
-            }
-            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
-          }
-          else if (intVariety == XSDVariety.LIST)
-          {
-            element = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.LIST_ELEMENT_TAG);
-            if (element != null)
-            {
-              String result = element.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
-              if (result == null)
-              {
-                typesText.setText("**anonymous**"); //$NON-NLS-1$
-              }
-              else
-              {
-                typesText.setText(result);
-              }
-            }
-            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_ITEM_TYPE")); //$NON-NLS-1$
-          }
-          else if (intVariety == XSDVariety.UNION)
-          {
-            Element unionElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.UNION_ELEMENT_TAG);
-            if (unionElement != null)
-            {
-              String memberTypes = unionElement.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-              if (memberTypes != null)
-              {
-                typesText.setText(memberTypes);
-              }
-            }
-            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
-          }
-	      }
-	    }
-	  }
-	  setListenerEnabled(true);
-	}
-
-  /**
-   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
-   */
-  public void widgetSelected(SelectionEvent e)
-  {
-	  Object input = getInput();
-    if (e.widget == varietyCombo)
-    {
-  	  if (input != null)
-  	  {
-  	    if (input instanceof XSDSimpleTypeDefinition)
-  	    {
-  	      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
-          Element parent = st.getElement();
-          
-  	      String variety = varietyCombo.getText();
-  	      if (variety.equals(XSDVariety.ATOMIC_LITERAL.getName()))
-          {
-            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
-            st.setVariety(XSDVariety.ATOMIC_LITERAL);
-            addCreateElementActionIfNotExist(XSDConstants.RESTRICTION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_RESTRICTION"), parent, null); //$NON-NLS-1$
-          }
-  	      else if (variety.equals(XSDVariety.UNION_LITERAL.getName()))
-  	      {
-            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
-            st.setVariety(XSDVariety.UNION_LITERAL);
-            addCreateElementActionIfNotExist(XSDConstants.UNION_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_UNION"), parent, null); //$NON-NLS-1$
-          }
-  	      else if (variety.equals(XSDVariety.LIST_LITERAL.getName()))
-  	      {
-            typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_ITEM_TYPE")); //$NON-NLS-1$
-            st.setVariety(XSDVariety.LIST_LITERAL);
-            addCreateElementActionIfNotExist(XSDConstants.LIST_ELEMENT_TAG, XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_LIST"), parent, null); //$NON-NLS-1$
-          }
-  	    }
-  	  }
-    }
-    else if (e.widget == button)
-    {
-      Shell shell = Display.getCurrent().getActiveShell();
-      Element element = ((XSDConcreteComponent)input).getElement();
-      Dialog dialog = null;
-      String property = "";
-      Element secondaryElement = null;
-      
-      IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
-
-      XSDComponentSelectionProvider provider = new XSDComponentSelectionProvider(currentIFile, xsdSchema);
-      dialog = new XSDComponentSelectionDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), provider);
-      provider.setDialog((XSDComponentSelectionDialog) dialog);
-      
-      if (input instanceof XSDSimpleTypeDefinition)
-      {
-        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
-        Element simpleTypeElement = st.getElement();
-        if (st.getVariety() == XSDVariety.LIST_LITERAL)
-        {
-          Element listElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.LIST_ELEMENT_TAG);
-//          dialog = new TypesDialog(shell, listElement, XSDConstants.ITEMTYPE_ATTRIBUTE, xsdSchema);
-//          dialog.showComplexTypes = false;
-          provider.showComplexTypes(false);
-          
-          secondaryElement = listElement;
-          property = XSDConstants.ITEMTYPE_ATTRIBUTE;
-        }
-        else if (st.getVariety() == XSDVariety.ATOMIC_LITERAL)
-        {
-          Element derivedByElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.RESTRICTION_ELEMENT_TAG);
-          if (derivedByElement == null)
-          {
-            derivedByElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.EXTENSION_ELEMENT_TAG);
-            if (derivedByElement == null) return;
-          }
-          if (derivedByElement != null)
-          {
-//            dialog = new TypesDialog(shell, derivedByElement, XSDConstants.BASE_ATTRIBUTE, xsdSchema);
-//            dialog.showComplexTypes = false;
-              provider.showComplexTypes(false);
-
-              secondaryElement = derivedByElement;
-              property = XSDConstants.BASE_ATTRIBUTE;
-          }
-          else
-          {
-            return;
-          }
-        }
-        else if (st.getVariety() == XSDVariety.UNION_LITERAL)
-        {
-          SimpleContentUnionMemberTypesDialog unionDialog = new SimpleContentUnionMemberTypesDialog(shell, st);
-          unionDialog.setBlockOnOpen(true);
-          unionDialog.create();
-          
-          int result = unionDialog.open();
-          if (result == Window.OK)
-          {
-            String newValue = unionDialog.getResult();
-            beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_CHANGE"), element); //$NON-NLS-1$
-            Element unionElement = (Element)domHelper.getChildNode(element, XSDConstants.UNION_ELEMENT_TAG);
-            unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, newValue);
-
-            if (newValue.length() > 0)
-            {
-              unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, newValue);
-            }
-            else
-            {
-              unionElement.removeAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);  
-            }
-            endRecording(unionElement);
-            if (doRefresh)
-            {
-              refresh();
-            }
-          }
-          return;
-        }
-        else
-        {
-//          dialog = new TypesDialog(shell, element, "type", xsdSchema); //$NON-NLS-1$
-            property = "type";
-        }
-      }
-      else
-      {
-//        dialog = new TypesDialog(shell, element, "type", xsdSchema); //$NON-NLS-1$
-          property = "type";
-      }
-      beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element); //$NON-NLS-1$
-      dialog.setBlockOnOpen(true);
-      dialog.create();
-      int result = dialog.open();
-      
-      if (result == Window.OK)
-      {
-          if (secondaryElement == null) {
-              secondaryElement = element;
-          }
-          XSDSetTypeHelper helper = new XSDSetTypeHelper(currentIFile, xsdSchema);
-          helper.setType(secondaryElement, property, ((XSDComponentSelectionDialog) dialog).getSelection());          
-
-        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
-        st.setElement(element);
-        updateSimpleTypeFacets();
-      }
-      endRecording(element);
-    }
-    if (doRefresh)
-    {
-      refresh();
-    }
-  }
-
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-
-  
-  protected boolean addCreateElementActionIfNotExist(String elementTag, String label, Element parent, Node relativeNode)
-  {
-    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
-    List attributes = new ArrayList();
-    String reuseType = null;
-    
-    beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_VARIETY_CHANGE"), parent); //$NON-NLS-1$
-    if (elementTag.equals(XSDConstants.RESTRICTION_ELEMENT_TAG))
-    {
-      Element listNode = getFirstChildNodeIfExists(parent, XSDConstants.LIST_ELEMENT_TAG, false);
-      if (listNode != null)
-      {
-        reuseType = listNode.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
-        XSDDOMHelper.removeNodeAndWhitespace(listNode);
-      }
-
-      Element unionNode = getFirstChildNodeIfExists(parent, XSDConstants.UNION_ELEMENT_TAG, false);
-      if (unionNode != null)
-      {
-        String memberAttr = unionNode.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-        if (memberAttr != null)
-        {
-          StringTokenizer stringTokenizer = new StringTokenizer(memberAttr);
-          reuseType = stringTokenizer.nextToken();
-        }
-        XSDDOMHelper.removeNodeAndWhitespace(unionNode);
-      }
-
-      if (reuseType == null)
-      {
-        reuseType = getBuiltInStringQName();        
-      }
-      attributes.add(new DOMAttribute(XSDConstants.BASE_ATTRIBUTE, reuseType));
-      st.setItemTypeDefinition(null);
-    }
-    else if (elementTag.equals(XSDConstants.LIST_ELEMENT_TAG))
-    {
-      Element restrictionNode = getFirstChildNodeIfExists(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false);
-      if (restrictionNode != null)
-      {
-        reuseType = restrictionNode.getAttribute(XSDConstants.BASE_ATTRIBUTE);
-        XSDDOMHelper.removeNodeAndWhitespace(restrictionNode);
-      }
-      Element unionNode = getFirstChildNodeIfExists(parent, XSDConstants.UNION_ELEMENT_TAG, false);
-      if (unionNode != null)
-      {
-        String memberAttr = unionNode.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-        if (memberAttr != null)
-        {
-          StringTokenizer stringTokenizer = new StringTokenizer(memberAttr);
-          reuseType = stringTokenizer.nextToken();
-        }
-        XSDDOMHelper.removeNodeAndWhitespace(unionNode);
-      }
-      attributes.add(new DOMAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, reuseType));
-    }
-    else if (elementTag.equals(XSDConstants.UNION_ELEMENT_TAG))
-    {
-      Element listNode = getFirstChildNodeIfExists(parent, XSDConstants.LIST_ELEMENT_TAG, false);
-      if (listNode != null)
-      {
-        reuseType = listNode.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
-        XSDDOMHelper.removeNodeAndWhitespace(listNode);
-      }
-      Element restrictionNode = getFirstChildNodeIfExists(parent, XSDConstants.RESTRICTION_ELEMENT_TAG, false);
-      if (restrictionNode != null)
-      {
-        reuseType = restrictionNode.getAttribute(XSDConstants.BASE_ATTRIBUTE);
-        XSDDOMHelper.removeNodeAndWhitespace(restrictionNode);
-      }
-      attributes.add(new DOMAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, reuseType));
-      st.setItemTypeDefinition(null);
-    }
-    
-    if (getFirstChildNodeIfExists(parent, elementTag, false) == null)
-    {
-      Action action = addCreateElementAction(elementTag,label,attributes,parent,relativeNode);
-      action.run();
-    }
-
-    st.setElement(parent);
-//    st.updateElement();
-    endRecording(parent);
-    return true;
-  }
-
-  protected Action addCreateElementAction(String elementTag, String label, List attributes, Element parent, Node relativeNode)
-  {
-    CreateElementAction action = new CreateElementAction(label);
-    action.setElementTag(elementTag);
-    action.setAttributes(attributes);
-    action.setParentNode(parent);
-    action.setRelativeNode(relativeNode);
-    return action;
-  }
-
-  
-  protected Element getFirstChildNodeIfExists(Node parent, String elementTag, boolean isRef)
-  {
-    NodeList children = parent.getChildNodes();
-    Element targetNode = null;
-    for (int i=0; i < children.getLength(); i++)
-    {
-      Node child = children.item(i);
-      if (child != null && child instanceof Element)
-      {
-        if (XSDDOMHelper.inputEquals((Element)child, elementTag, isRef))
-        {
-          targetNode = (Element)child;
-          break;
-        }
-      }
-    }
-    return targetNode;
-  }
-
-  protected String getBuiltInStringQName()
-  {
-    String stringName = "string"; //$NON-NLS-1$
-    
-    if (getSchema() != null)
-    {
-      String schemaForSchemaPrefix = getSchema().getSchemaForSchemaQNamePrefix();
-      if (schemaForSchemaPrefix != null && schemaForSchemaPrefix.length() > 0)
-      {
-        String prefix = getSchema().getSchemaForSchemaQNamePrefix();
-        if (prefix != null && prefix.length() > 0)
-        {
-          stringName = prefix + ":" + stringName; //$NON-NLS-1$
-        }
-      }
-    }
-    return stringName;
-  }
-
-  private void updateSimpleTypeFacets()
-  {
-    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
-    Element simpleTypeElement = st.getElement();
-    Element derivedByElement = getDomHelper().getDerivedByElement(simpleTypeElement);
-    if (derivedByElement != null)
-    {
-      List nodesToRemove = new ArrayList();
-      NodeList childList = derivedByElement.getChildNodes();
-      int length = childList.getLength();
-      for (int i = 0; i < length; i++)
-      {
-        Node child = childList.item(i);
-        if (child instanceof Element)
-        {
-          Element elementChild = (Element)child;
-          if (!(elementChild.getLocalName().equals("pattern") || elementChild.getLocalName().equals("enumeration") || //$NON-NLS-1$
-               XSDDOMHelper.inputEquals(elementChild, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false) ||
-               XSDDOMHelper.inputEquals(elementChild, XSDConstants.ANNOTATION_ELEMENT_TAG, false) ||
-               XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false) ||
-               XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true) ||
-               XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false) ||
-               XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true) ||
-               XSDDOMHelper.inputEquals(elementChild, XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false)
-               ))
-          {
-            nodesToRemove.add(child);
-          }
-        }
-      }
-      Iterator iter = nodesToRemove.iterator();
-      while (iter.hasNext())
-      {
-        Element facetToRemove = (Element)iter.next();
-        String facetName = facetToRemove.getLocalName();
-        Iterator it = st.getValidFacets().iterator();
-        boolean doRemove = true;
-        while (it.hasNext())
-        {
-          String aValidFacet = (String)it.next();
-          if (aValidFacet.equals(facetName))
-          {
-            doRemove = false;
-            break;
-          }
-        }
-        if (doRemove)
-        {
-          XSDDOMHelper.removeNodeAndWhitespace(facetToRemove);
-        }
-      }
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSectionDescriptor.java
deleted file mode 100644
index bd02dee..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeSectionDescriptor.java
+++ /dev/null
@@ -1,91 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-
-public class SimpleTypeSectionDescriptor extends AbstractSectionDescriptor
-{
-
-  /**
-   * 
-   */
-  public SimpleTypeSectionDescriptor()
-  {
-    super();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.xsdeditor.section.simpletype";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDSimpleTypeDefinition.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new SimpleTypeSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.general";
-  }
-  
-  public String getAfterSection()
-  {
-    return "org.eclipse.wst.xsdeditor.section.name";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDSimpleTypeDefinition)
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSection.java
deleted file mode 100644
index a4496dc..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSection.java
+++ /dev/null
@@ -1,185 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class SimpleTypeUnionSection extends AbstractSection
-{
-  Text memberTypesText;
-  Button button;
-
-  /**
-   * 
-   */
-  public SimpleTypeUnionSection()
-  {
-    super();
-  }
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-	{
-		super.createControls(parent, factory);
-		composite = getWidgetFactory().createFlatFormComposite(parent);
-		FormData data;
-
-		memberTypesText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-		CLabel label = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
-    button = getWidgetFactory().createButton(composite, "...", SWT.PUSH); //$NON-NLS-1$
-    
-    memberTypesText.addListener(SWT.Modify, this);
-//    memberTypesText.addSelectionListener(this);
-
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(95, 0);
-		data.top = new FormAttachment(button, 0, SWT.CENTER);
-		memberTypesText.setLayoutData(data);
-
-
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(memberTypesText, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(button, 0, SWT.CENTER);
-		label.setLayoutData(data);
-
-    button.addSelectionListener(this);
-		data = new FormData();
-		data.left = new FormAttachment(memberTypesText, +ITabbedPropertyConstants.HSPACE);
-		data.right = new FormAttachment(100,0);
-		// data.top = new FormAttachment(typeCombo, 0, SWT.CENTER);
-		data.top = new FormAttachment(0,0);
-		button.setLayoutData(data);
-		
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-	  setListenerEnabled(false);
-	  Object input = getInput();
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-	  memberTypesText.setText(""); //$NON-NLS-1$
-	  if (input != null)
-	  {
-	    Element element = null;
-	    if (input instanceof XSDSimpleTypeDefinition)
-	    {
-	      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
-	      element = st.getElement();
-        Element unionElement = (Element)domHelper.getChildNode(element, XSDConstants.UNION_ELEMENT_TAG);
-        String memberTypes = unionElement.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-        if (memberTypes != null)
-        {
-          memberTypesText.setText(memberTypes);
-        }
-	      
-//        StringBuffer buf = new StringBuffer();	      
-//	      if (st.getMemberTypeDefinitions().size() > 0)
-//	      {
-//	        for (Iterator i = st.getMemberTypeDefinitions().iterator(); i.hasNext(); )
-//	        {
-//	          String name = ((XSDSimpleTypeDefinition)i.next()).getQName(getSchema());
-//	          if (name != null)
-//	          {
-//	            buf.append(name);
-//	            buf.append(" ");
-//	          }
-//	        }
-//	      }
-//	      memberTypesText.setText(buf.toString());
-	    }
-	  }
-	  setListenerEnabled(true);
-	}
-
-  /**
-   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
-   */
-  public void widgetSelected(SelectionEvent e)
-  {
-    if (e.widget == button)
-    {
-	    Shell shell = Display.getCurrent().getActiveShell();
-      
-	    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)getInput();
-	    Element element = st.getElement();
-      SimpleContentUnionMemberTypesDialog dialog = new SimpleContentUnionMemberTypesDialog(shell, st);
-      dialog.setBlockOnOpen(true);
-      dialog.create();
-      
-      int result = dialog.open();
-      if (result == Window.OK)
-      {
-        String newValue = dialog.getResult();
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_CHANGE"), element); //$NON-NLS-1$
-        Element unionElement = (Element)domHelper.getChildNode(element, XSDConstants.UNION_ELEMENT_TAG);
-        unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, newValue);
-
-        if (newValue.length() > 0)
-        {
-          unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, newValue);
-        }
-        else
-        {
-          unionElement.removeAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);  
-        }
-        endRecording(unionElement);
-
-      }
-
-      refresh();
-    }
-  }
-  
-  public void doHandleEvent(Event event)
-  {
-	  if (event.widget == memberTypesText)
-	  {
-	  }
-
-  }
-
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSectionDescriptor.java
deleted file mode 100644
index b1338ae..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/SimpleTypeUnionSectionDescriptor.java
+++ /dev/null
@@ -1,73 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class SimpleTypeUnionSectionDescriptor extends AbstractSectionDescriptor
-{
-  /**
-   * 
-   */
-  public SimpleTypeUnionSectionDescriptor()
-  {
-    super();
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.xsdeditor.section.simpletypeunion";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDSimpleTypeDefinition.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new SimpleTypeUnionSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.general";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TextChangeHelper.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TextChangeHelper.java
deleted file mode 100644
index 0df6ffa..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TextChangeHelper.java
+++ /dev/null
@@ -1,102 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-public abstract class TextChangeHelper implements Listener
-{
-	private boolean nonUserChange;
-
-	/**
-	 * Marks the start of a programmatic change to the widget contents.
-	 * Clients must call startNonUserChange() before directly setting 
-	 * the widget contents to avoid unwanted lifecycle events.
-	 * @throws IllegalArgumentException if a programmatic change is 
-	 * already in progress.
-	 */
-	public void startNonUserChange() {
-		if (nonUserChange)
-			throw new IllegalStateException("we already started a non user change");//$NON-NLS-1$
-		nonUserChange = true;
-	}
-
-	/**
-	 * Clients who call startNonUserChange() should call 
-	 * finishNonUserChange() as soon as possible after the change is done.
-	 * @throws IllegalArgumentException if no change is in progress.
-	 */
-	public void finishNonUserChange() {
-		if (!nonUserChange)
-			throw new IllegalStateException("we are not in a non user change");//$NON-NLS-1$
-		nonUserChange = false;
-	}
-
-	/**
-	 * Returns true if a programmatic change is in progress.
-	 */
-	public boolean isNonUserChange() {
-		return nonUserChange;
-	}
-
-	/**
-	 * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
-	 */
-	public void handleEvent(Event event) {
-		switch (event.type) {
-			case SWT.KeyDown :
-				if (event.character == SWT.CR)
-					textChanged((Control)event.widget);
-				break;
-			case SWT.FocusOut :
-				textChanged((Control)event.widget);
-				break;
-		}
-	}
-
-	/**
-	 * Abstract method notified when a text field has been changed.
-	 * @param control
-	 */
-	public abstract void textChanged(Control control);
-
-	/**
-	 * Registers this helper with the given control to listen for events
-	 * which indicate that a change is in progress (or done).
-	 */
-	public void startListeningTo(Control control) {
-		control.addListener(SWT.FocusOut, this);
-		control.addListener(SWT.Modify, this);
-	}
-
-	/**
-	 * Registers this helper with the given control to listen for the
-	 * Enter key.  When Enter is pressed, the change is considered done 
-	 * (this is only appropriate for single-line Text widgets).
-	 */
-	public void startListeningForEnter(Control control) {
-		// NOTE: KeyDown rather than KeyUp, because of similar usage in CCombo. 
-		control.addListener(SWT.KeyDown, this);
-	}
-
-	/**
-	 * Unregisters this helper from a control previously passed to
-	 * startListeningTo() and/or startListeningForEnter().
-	 */
-	public void stopListeningTo(Control control) {
-		control.removeListener(SWT.FocusOut, this);
-		control.removeListener(SWT.Modify, this);
-		control.removeListener(SWT.KeyDown, this);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesDialog.java
deleted file mode 100644
index 1454b4d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesDialog.java
+++ /dev/null
@@ -1,721 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-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.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.wst.xsd.ui.internal.widgets.TypeSection;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class TypesDialog extends Dialog implements SelectionListener, Listener
-{
-  XSDSchema xsdSchema;
-  String property;
-
-  /**
-   * @param parentShell
-   */
-  public TypesDialog(Shell parentShell, Element element, Object id, XSDSchema xsdSchema)
-  {
-    super(parentShell);
-    setShellStyle(getShellStyle() | SWT.RESIZE);
-    this.element = element;
-    this.property = (String)id;
-    this.element = element;
-    this.xsdSchema = xsdSchema;
-
-    if (XSDDOMHelper.inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, false))
-    {
-      showComplexTypes = true;
-    }
-    else if (XSDDOMHelper.inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false) ||
-      XSDDOMHelper.inputEquals(element, XSDConstants.LIST_ELEMENT_TAG, false) ||
-      XSDDOMHelper.inputEquals(element, XSDConstants.UNION_ELEMENT_TAG, false))
-    {
-      showComplexTypes = false;
-    }
-  }
-
-  String type;
-  Object typeObject;
-  Text textField;
-  Table table;
-  TableColumn tableColumn;
-  Element element;
-  
-  boolean showComplexTypes = true;
-  TypeSection typeSection;
-  boolean showAnonymous = true;
-  String previousStringType = "";
-  boolean isAnonymous;
-  int previousType;
-
-  protected void configureShell(Shell shell)
-  {
-    super.configureShell(shell);
-  }
-
-  protected void buttonPressed(int buttonId)
-  {
-    if (buttonId == Dialog.OK)
-    {
-      type = table.getItem(table.getSelectionIndex()).getText();
-      ok();
-    }
-    super.buttonPressed(buttonId);
-  }
-
-  public Object getTypeObject() { return typeObject; }
-  public String getType() { return type; }
-
-  //
-  // Create the controls
-  //
-  public Control createDialogArea(Composite parent)
-  {
-    Composite client = (Composite)super.createDialogArea(parent);
-    getShell().setText(XSDEditorPlugin.getXSDString("_UI_LABEL_AVAILABLE_TYPES"));
-
-    typeObject = null;
-    
-    GridLayout gl = new GridLayout(1, true);
-//    gl.marginHeight = 0;
-//    gl.marginWidth = 0;
-//    gl.horizontalSpacing = 0;
-//    gl.verticalSpacing = 0;
-    client.setLayout(gl);
-
-    GridData gd = new GridData();
-    gd.grabExcessHorizontalSpace = true;
-    gd.grabExcessVerticalSpace = true;
-    gd.horizontalAlignment = GridData.FILL;
-    gd.verticalAlignment = GridData.FILL;
-    gd.horizontalIndent = 0;
-    client.setLayoutData(gd);
-    
-    typeSection = new TypeSection(client);
-    typeSection.setShowUserComplexType(showComplexTypes);
-
-    typeSection.createClient(client);
-    typeSection.getSimpleType().setSelection(false);
-    typeSection.getSimpleType().addSelectionListener(this);
-    typeSection.getUserSimpleType().addSelectionListener(this);
-    if (showComplexTypes)
-    {
-      typeSection.getUserComplexType().addSelectionListener(this);
-    }
-
-    textField = ViewUtility.createTextField(client, 50);
-    textField.addListener(SWT.Modify, this);
-    ViewUtility.createVerticalFiller(client, 0);
-
-    table = new Table(client,
-                      SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); 
-    table.setHeaderVisible(false);
-    table.setLinesVisible(true);
-    table.addSelectionListener(this);
-    
-    GridData gd2 = new GridData();
-    gd2.grabExcessHorizontalSpace = true;
-    gd2.grabExcessVerticalSpace = true;
-    gd2.horizontalAlignment = GridData.FILL;
-    gd2.verticalAlignment = GridData.FILL;
-    gd2.heightHint = 200;
-    table.setLayoutData(gd2);
-    table.addListener(SWT.Resize, this);
-    
-    tableColumn = new TableColumn(table, SWT.LEFT);
-//    tableColumn.setImage(XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"));
-    tableColumn.setResizable(true);
-    tableColumn.setWidth(200);
-
-    // Fill table and select input type
-    handleSetInput();
-
-    return client;
-  }
-  
-  public void handleEvent(Event event)
-  {
-  	if (event.type == SWT.Resize && event.widget == table) {
-  		tableColumn.setWidth(table.getSize().x);
-  	}
-  	else if (event.type == SWT.Modify && event.widget == textField) {
-  		boolean showAll = false;
-  		String inputString = textField.getText();
-  		
-  		if (inputString.equals("")) {
-  			showAll = true;
-  		}
-  		else {
-  			inputString = insertString("*", ".", inputString);
-  			inputString = insertString("?", ".", inputString);
-  			inputString = inputString + ".*";
-  		}
-  		
-  		try {
-  			if (typeSection.getSimpleType().getSelection())
-  			{
-  				if (showAll) {
-  					populateBuiltInType();
-  				}
-  				else {
-  					populateBuiltInType(inputString);
-  				}
-  			}
-  			else if (typeSection.getUserComplexType().getSelection())
-  			{
-  				if (showAll) {
-  					populateUserComplexType();
-  				}
-  				else {
-  					populateUserComplexType(inputString);
-  				}
-  			}
-  			else if (typeSection.getUserSimpleType().getSelection())
-  			{
-  				if (showAll) {
-  					populateUserSimpleType();
-  				}
-  				else {
-  					populateUserSimpleType(inputString);
-  				}
-  			}
-  		}
-  		catch (Exception e) {
-  			// Do nothing
-  		}
-  	}
-  	
-  	setEnabledState();
-  }
-  
-  private void setEnabledState() {
-  	if (table.getSelectionIndex() != -1) {
-  		this.getButton(IDialogConstants.OK_ID).setEnabled(true);
-  	}
-  	else {
-  		this.getButton(IDialogConstants.OK_ID).setEnabled(false);
-  	}
-  }
-  
-  private String insertString(String target, String newString, String string) {
-  	StringBuffer stringBuffer = new StringBuffer(string);
-  	
-  	int index = stringBuffer.indexOf(target);
-  	while (index != -1) {
-  		stringBuffer = stringBuffer.insert(index, newString);
-  		index = stringBuffer.indexOf(target, index + newString.length() + target.length());
-  	}
-  	
-  	return stringBuffer.toString();
-  }
-  
-  public void widgetSelected(SelectionEvent e)
-  {
-    if (e.widget == typeSection.getSimpleType() && typeSection.getSimpleType().getSelection())
-    {
-    	if (textField.getText().equals("")) {
-    		populateBuiltInType();
-    	}
-    	else {
-    		populateBuiltInType(textField.getText());
-    	}
-    }
-    else if (e.widget == typeSection.getUserComplexType() && typeSection.getUserComplexType().getSelection())
-    {
-    	if (textField.getText().equals("")) {
-    		populateUserComplexType();
-    	}
-    	else {
-    		populateUserComplexType(textField.getText());
-    	}
-    }
-    else if (e.widget == typeSection.getUserSimpleType() && typeSection.getUserSimpleType().getSelection())
-    {
-    	if (textField.getText().equals("")) {
-    		populateUserSimpleType();
-    	}
-    	else {
-    		populateUserSimpleType(textField.getText());
-    	}
-    }
-    setEnabledState();
-  }
-  
-	public void widgetDefaultSelected(SelectionEvent e)
-  {
-  }
-
-  protected void ok()
-  {
-    TableItem[] items = table.getItems();
-    int selection = table.getSelectionIndex();
-    if (items != null && items.length > 0 && selection >= 0)
-    {
-      typeObject = items[selection].getData();
-    }
-//    System.out.println("typeObject is " + typeObject);
-
-//    beginRecording(XSDEditorPlugin.getXSDString("_UI_ELEMENT_TYPE_CHANGE"), element);
-//    beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"), element);
-//    doSetValue(typeObject);
-//    applyEditorValueAndDeactivate();
-//    dialog.close();
-
-    if (!XSDDOMHelper.inputEquals(element, XSDConstants.UNION_ELEMENT_TAG, false))
-    {
-	    if (typeObject.equals("**anonymous**"))
-	    {
-	      if (typeSection.getUserSimpleType().getSelection())
-	      {
-//	        if (!previousStringType.equals("**anonymous**"))
-	        {
-	          updateElementToAnonymous(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-	        }
-	      }
-	      else
-	      {
-//	        if (!previousStringType.equals("**anonymous**"))
-	        {
-	          updateElementToAnonymous(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-	        }
-	      }
-	      // element.removeAttribute(XSDConstants.TYPE_ATTRIBUTE);
-	      element.removeAttribute(property);
-	    }
-	    else
-	    {
-	      XSDDOMHelper.updateElementToNotAnonymous(element);
-	      //element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, typeObject.toString());
-	      element.setAttribute(property, typeObject.toString());
-	    }
-    }
-//    endRecording(element);
-
-    //implement dispose();
-//    table.removeAll();
-//    table.dispose();
-  }
-
-	
-  public void handleSetInput()
-  {
-    table.removeAll();
-    isAnonymous = checkForAnonymousType(element);
-    // Attr attr = element.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
-    Attr attr = element.getAttributeNode(property);
-    if (attr != null)
-    {
-      String value = attr.getValue();
-      if (typeSection.getBuiltInTypeNamesList(xsdSchema).contains(value))
-      {
-        typeSection.getSimpleType().setSelection(true);
-        populateBuiltInType();
-        int i = typeSection.getBuiltInTypeNamesList(xsdSchema).indexOf(value);
-        table.setSelection(i);
-        previousType = 1;
-      }
-      else if (typeSection.getUserSimpleTypeNamesList(xsdSchema).contains(value))
-      {
-        typeSection.getUserSimpleType().setSelection(true);
-        populateUserSimpleType();
-        int i = typeSection.getUserSimpleTypeNamesList(xsdSchema).indexOf(value);
-        if (showAnonymous)
-        {
-          table.setSelection(i + 1);
-        }
-        else
-        {
-          table.setSelection(i);
-        }
-        previousType = 2;
-      }
-      else if (typeSection.getUserComplexTypeNamesList(xsdSchema).contains(value))
-      {
-        typeSection.getUserComplexType().setSelection(true);
-        populateUserComplexType();
-        int i = typeSection.getUserComplexTypeNamesList(xsdSchema).indexOf(value);
-        if (showAnonymous)
-         {
-          table.setSelection(i + 1);
-        }
-        else
-         {
-          table.setSelection(i);
-        }
-        previousType = 3;
-      }
-      else // if it is type="" for an empty list of simple types
-        {
-        typeSection.getUserSimpleType().setSelection(true);
-        populateUserSimpleType();
-        previousType = 2;
-      }
-    }
-    else
-    {
-      if (isAnonymous)
-      {
-        if (isSTAnonymous(element))
-        {
-          typeSection.getUserSimpleType().setSelection(true);
-          populateUserSimpleType();
-          previousType = 2;
-        }
-        else
-        {
-          typeSection.getUserComplexType().setSelection(true);
-          populateUserComplexType();
-          previousType = 3;
-        }
-        table.setSelection(0); // anonymous
-        //        typeSection.getTypeList().setText("**anonymous**");
-      }
-      else
-      {
-        typeSection.getSimpleType().setSelection(true);
-        populateBuiltInType();
-        table.setSelection(0);
-        
-        //        typeSection.getTypeList().setEnabled(true);
-        //        typeSection.getSimpleType().setSelection(true);
-        //        typeSection.populateBuiltInType(xsdSchema);
-        //        typeSection.getTypeList().setText(XSDEditorPlugin.getXSDString("_UI_NO_TYPE"));
-        previousType = 1;
-      }
-    }
-    if (table.getSelection() != null && table.getSelection().length > 0)
-    {
-      previousStringType = (table.getSelection()[0]).getText();
-    }
-  }
-  
-  public void populateBuiltInType()
-  {
-    table.removeAll();
-    List items = getBuiltInTypeNamesList();
-    for (int i = 0; i < items.size(); i++)
-    {
-      TableItem item = new TableItem(table, SWT.NONE);
-      item.setText(items.get(i).toString());
-      item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
-      item.setData(items.get(i));
-    }
-  }
-
-  public void populateBuiltInType(String fragment)
-  {
-    table.removeAll();
-    List items = getBuiltInTypeNamesList();
-    fragment = fragment.toLowerCase();
-	Pattern regex = Pattern.compile(fragment);
-	
-    for (int i = 0; i < items.size(); i++)
-    {
-    	String itemString = items.get(i).toString().toLowerCase();
-    	Matcher m = regex.matcher(itemString);
-
-    	if (itemString.startsWith(fragment) || m.matches()) {
-    		TableItem item = new TableItem(table, SWT.NONE);
-    		item.setText(items.get(i).toString());
-    		item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
-    		item.setData(items.get(i));
-    	}
-    }
-    
-    table.select(0);
-  }
-
-  public void populateUserComplexType()
-  {
-    table.removeAll();
-    if (showAnonymous)
-    {
-      TableItem anonymousItem = new TableItem(table, SWT.NONE);
-      anonymousItem.setText("**anonymous**");
-      anonymousItem.setData("**anonymous**");
-    }
-    List items = getUserComplexTypeNamesList();
-    for (int i = 0; i < items.size(); i++)
-    {
-      TableItem item = new TableItem(table, SWT.NONE);
-//      System.out.println("item " + i + " is " + item);
-      item.setText(items.get(i).toString());
-      item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif"));
-      item.setData(items.get(i));
-    }
-  }
-  
-  public void populateUserComplexType(String fragment)
-  {
-    table.removeAll();
-    fragment = fragment.toLowerCase();
-    Pattern regex = java.util.regex.Pattern.compile(fragment);
-    
-    if (showAnonymous)
-    {
-    	Matcher m = regex.matcher("**anonymous**");
-    	if ("**anonymous**".startsWith(fragment) || m.matches()) {
-    		TableItem anonymousItem = new TableItem(table, SWT.NONE);
-    		anonymousItem.setText("**anonymous**");
-    		anonymousItem.setData("**anonymous**");
-    	}
-    }
-    List items = getUserComplexTypeNamesList();
-    for (int i = 0; i < items.size(); i++)
-    {
-    	String itemString = items.get(i).toString().toLowerCase();
-    	Matcher m = regex.matcher(itemString);
-    	
-    	if (itemString.startsWith(fragment) || m.matches()) {
-    		TableItem item = new TableItem(table, SWT.NONE);
-    		item.setText(items.get(i).toString());
-    		item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif"));
-    		item.setData(items.get(i));
-    	}
-    }
-    
-    table.select(0);
-  }
-
-  public void populateUserSimpleType()
-  {
-    table.removeAll();
-    if (showAnonymous)
-     {
-      TableItem anonymousItem = new TableItem(table, SWT.NONE);
-      anonymousItem.setText("**anonymous**");
-      anonymousItem.setData("**anonymous**");
-    }
-    List items = getUserSimpleTypeNamesList();
-    for (int i = 0; i < items.size(); i++)
-     {
-      TableItem item = new TableItem(table, SWT.NONE);
-      item.setText(items.get(i).toString());
-      item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
-      item.setData(items.get(i));
-    }
-  }
-
-  public void populateUserSimpleType(String fragment)
-  {
-    table.removeAll();
-    fragment = fragment.toLowerCase();
-    Pattern regex = java.util.regex.Pattern.compile(fragment);
-    
-    if (showAnonymous)
-     {
-    	Matcher m = regex.matcher("**anonymous**");
-    	if ("**anonymous**".startsWith(fragment) || m.matches())  {
-    		TableItem anonymousItem = new TableItem(table, SWT.NONE);
-    		anonymousItem.setText("**anonymous**");
-    		anonymousItem.setData("**anonymous**");
-    	}
-    }
-    List items = getUserSimpleTypeNamesList();
-    for (int i = 0; i < items.size(); i++)
-     {
-    	String itemString = items.get(i).toString().toLowerCase();
-    	Matcher m = regex.matcher(itemString);
-    	
-    	if (itemString.startsWith(fragment) || m.matches()) {
-    		TableItem item = new TableItem(table, SWT.NONE);
-    		item.setText(items.get(i).toString());
-    		item.setImage(XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"));
-    		item.setData(items.get(i));
-    	}
-    }
-    
-    table.select(0);
-  }
-  
-  boolean checkForAnonymousType(Element element)
-  {
-    /*
-     * Using Ed's model to check boolean isAnonymous = false;
-     * 
-     * XSDConcreteComponent component =
-     * getXSDSchema().getCorrespondingComponent(element); if (component
-     * instanceof XSDElementDeclaration) { XSDElementDeclaration xsdElem =
-     * (XSDElementDeclaration)component; isAnonymous =
-     * xsdElem.isSetAnonymousTypeDefinition(); } return isAnonymous;
-     */
-    XSDDOMHelper helper = new XSDDOMHelper();
-    boolean isAnonymous = false;
-    Node aNode =
-    helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-    if (aNode != null)
-     {
-      return true;
-    }
-    aNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-    if (aNode != null)
-     {
-      isAnonymous = true;
-    }
-    return isAnonymous;
-  }
-
-  void updateElementToAnonymous(Element element, String xsdType)
-  {
-    String prefix = element.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-    XSDDOMHelper.updateElementToNotAnonymous(element);
-    Element childNode = null;
-    if (xsdType.equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
-    {
-      childNode = element.getOwnerDocument().createElementNS(
-          XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001,
-          prefix + XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-    }
-    else if (xsdType.equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG))
-    {
-      childNode = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-      
-      Element restrictionNode = element.getOwnerDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + XSDConstants.RESTRICTION_ELEMENT_TAG);
-      restrictionNode.setAttribute(XSDConstants.BASE_ATTRIBUTE, prefix + "string");
-      childNode.appendChild(restrictionNode);      
-    }
-    if (childNode != null)
-    {
-      XSDDOMHelper helper = new XSDDOMHelper();
-      Node annotationNode = helper.getChildNode(element, XSDConstants.ANNOTATION_ELEMENT_TAG);
-      if (annotationNode == null)
-      {
-        Node firstChild = element.getFirstChild();
-        element.insertBefore(childNode, firstChild);
-      }
-      else
-      {
-        Node nextSibling = annotationNode.getNextSibling();
-        element.insertBefore(childNode, nextSibling);
-      }
-      XSDDOMHelper.formatChild(childNode);
-    }
-  }
-
-  boolean isSTAnonymous(Element element)
-  {
-    XSDDOMHelper helper = new XSDDOMHelper();
-    Node aNode = helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-    if (aNode != null)
-    {
-      if (XSDDOMHelper.inputEquals(aNode, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false))
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  boolean isCTAnonymous(Element element)
-  {
-    XSDDOMHelper helper = new XSDDOMHelper();
-    Node aNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-    if (aNode != null)
-     {
-      if (XSDDOMHelper.inputEquals(aNode, XSDConstants.COMPLEXTYPE_ELEMENT_TAG, false))
-       {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  XSDTypeDefinition getAnonymousTypeDefinition(Element element)
-  {
-    XSDDOMHelper helper = new XSDDOMHelper();
-    Node typeDefinitionNode =
-    helper.getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-    if (typeDefinitionNode == null)
-     {
-      typeDefinitionNode = helper.getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-    }
-    if (typeDefinitionNode != null)
-     {
-      XSDConcreteComponent component =
-      xsdSchema.getCorrespondingComponent(typeDefinitionNode);
-      if (component instanceof XSDTypeDefinition)
-       {
-        return (XSDTypeDefinition) component;
-      }
-    }
-    return null;
-  }
-  
-  public java.util.List getBuiltInTypeNamesList()
-  {
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    return helper.getBuiltInTypeNamesList();
-  }
-
-  public java.util.List getUserSimpleTypeNamesList()
-  {
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    return helper.getUserSimpleTypeNamesList();
-  }
-  
-  public java.util.List getUserComplexTypeNamesList()
-  {
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    return helper.getUserComplexTypeNamesList();
-  }
-  
-  protected boolean hasElementChildren(Node parentNode)
-  {
-    boolean hasChildrenElements = false;
-    if (parentNode != null && parentNode.hasChildNodes())
-    {
-      NodeList nodes = parentNode.getChildNodes();
-      for (int i = 0; i < nodes.getLength(); i++)
-      {
-        if (nodes.item(i) instanceof Element)
-        {
-          hasChildrenElements = true;
-          break;
-        }
-      }
-    }
-    return hasChildrenElements;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSection.java
deleted file mode 100644
index 3381d16..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSection.java
+++ /dev/null
@@ -1,359 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionDialog;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDComponentSelectionProvider;
-import org.eclipse.wst.xsd.ui.internal.dialogs.types.xsd.XSDSetTypeHelper;
-import org.eclipse.wst.xsd.ui.internal.widgets.TypeSection;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class TypesSection extends AbstractSection
-{
-  Text typeCombo;
-  Button button;
-
-  String type;
-  Object typeObject;
-  CLabel typeLabel;
-  Table table;
-  TypeSection typeSection;
-  boolean showAnonymous = true;
-  String previousStringType = "";
-  boolean isAnonymous;
-  int previousType;
-  boolean showComplexTypes = true;
-  
-  /**
-   * 
-   */
-  public TypesSection()
-  {
-    super();
-  }
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-	{
-		super.createControls(parent, factory);
-		composite = getWidgetFactory().createFlatFormComposite(parent);
-    
-		FormData data;
-
-		typeCombo = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-    typeCombo.setEditable(false);
-		typeCombo.addListener(SWT.Modify, this);
-    
-    button = getWidgetFactory().createButton(composite, "", SWT.PUSH); //$NON-NLS-1$
-    button.setImage(XSDEditorPlugin.getXSDImage("icons/browsebutton.gif")); //$NON-NLS-1$
-
-    typeLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE") + ":"); //$NON-NLS-1$
-
-    button.addSelectionListener(this);
-		FormData data2 = new FormData();
-		data2.left = new FormAttachment(100, -rightMarginSpace + 2);
-		data2.right = new FormAttachment(100,0);
-		data2.top = new FormAttachment(typeCombo, 0, SWT.CENTER);
-		button.setLayoutData(data2);
-
-    data = new FormData();
-    data.left = new FormAttachment(0, 100);
-    data.right = new FormAttachment(button, 0);
-    typeCombo.setLayoutData(data);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-	  Object input = getInput();
-    if (isReadOnly)
-    {
-      composite.setEnabled(false);
-    }
-    else
-    {
-      composite.setEnabled(true);
-    }
-	  typeCombo.setText(""); //$NON-NLS-1$
-	  if (input != null)
-	  {
-	    Element element = null;
-	    if (input instanceof XSDElementDeclaration)
-	    {
-        XSDElementDeclaration xsdElem = (XSDElementDeclaration)input;
-	      element = xsdElem.getElement();
-        XSDTypeDefinition typeDef = xsdElem.getTypeDefinition();
-        boolean isAnonymous = xsdElem.isAbstract();
-
-        if (isAnonymous)
-        {
-          typeCombo.setText("**anonymous**"); //$NON-NLS-1$
-        }
-        else
-        {
-          String typeName = ""; //$NON-NLS-1$
-          if (typeDef != null)
-          {
-            typeName = typeDef.getQName(getSchema());
-            if (typeName == null)
-            {
-              typeName = ""; //$NON-NLS-1$
-            }
-            typeCombo.setText(typeName);
-          }
-          else
-          {
-            typeCombo.setText(XSDEditorPlugin.getXSDString("_UI_NO_TYPE")); //$NON-NLS-1$
-          }
-        }
-	    }
-	    else if (input instanceof XSDAttributeDeclaration)
-	    {
-	      element = ((XSDAttributeDeclaration)input).getElement();
-	    }
-      else if (input instanceof XSDAttributeUse)
-      {
-        XSDAttributeUse attributeUse = (XSDAttributeUse)input;
-        XSDAttributeDeclaration attribute = attributeUse.getAttributeDeclaration();
-        element = attribute.getElement();
-      }
-	    else if (input instanceof Element)
-	    {
-	      element = (Element)input;
-	    }
-//      else if (input instanceof XSDSimpleTypeDefinition)
-//      {
-//	      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
-//	      Element simpleTypeElement = st.getElement();
-//        if (st.getVariety() == XSDVariety.LIST_LITERAL)
-//        {
-//	        element = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.LIST_ELEMENT_TAG);
-//          String result = element.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
-//          if (result == null)
-//          {
-//            typeCombo.setText("**anonymous**");
-//          }
-//          else
-//          {
-//            typeCombo.setText(result);
-//          }
-//          typeLabel.setText("Item Type:");
-//        }
-//        else if (st.getVariety() == XSDVariety.ATOMIC_LITERAL)
-//        {
-//          typeLabel.setText("Base Type:");
-//	        element = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.RESTRICTION_ELEMENT_TAG);
-//	        if (element == null)
-//	        {
-//	          element = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.EXTENSION_ELEMENT_TAG);
-//	          if (element == null) return;
-//	        }
-//
-//          String result = element.getAttribute(XSDConstants.BASE_ATTRIBUTE);
-//          if (result == null)
-//          {
-//            typeCombo.setText("");
-//          }
-//          else
-//          {
-//            typeCombo.setText(result);
-//          }
-//        }
-//        return;
-//      }
-      
-      typeLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE") + ":"); //$NON-NLS-1$
-	    if (element != null)
-	    {
-        boolean isAnonymous = checkForAnonymousType(element);
-        String result = element.getAttribute(XSDConstants.TYPE_ATTRIBUTE);
-	      if (isAnonymous)
-	      {
-	        typeCombo.setText("**anonymous**"); //$NON-NLS-1$
-	      }
-	      if (result != null && result.equals("")) //$NON-NLS-1$
-	      {
-	        typeCombo.setText(XSDEditorPlugin.getXSDString("_UI_NO_TYPE")); //$NON-NLS-1$
-	      }
-	      else if (result != null)
-	      {
-	        typeCombo.setText(result);
-	      }
-
-	    }
-	  }
-	}
-
-  /**
-   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
-   */
-  public void widgetSelected(SelectionEvent e)
-  {
-    if (e.widget == button)
-    {
-/*        
-	    Shell shell = Display.getCurrent().getActiveShell();
-	    Object input = getInput();
-	    Element element = ((XSDConcreteComponent)getInput()).getElement();
-	    TypesDialog dialog;
-
-//	    if (input instanceof XSDSimpleTypeDefinition)
-//	    {
-//	      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
-//	      Element simpleTypeElement = st.getElement();
-//	      if (st.getVariety() == XSDVariety.LIST_LITERAL)
-//	      {
-//	        Element listElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.LIST_ELEMENT_TAG);
-//	        dialog = new TypesDialog(shell, listElement, XSDConstants.ITEMTYPE_ATTRIBUTE, xsdSchema);
-//          dialog.showComplexTypes = false;
-//        }
-//        else if (st.getVariety() == XSDVariety.ATOMIC_LITERAL)
-//        {
-//          Element derivedByElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.RESTRICTION_ELEMENT_TAG);
-//          if (derivedByElement == null)
-//          {
-//            derivedByElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.EXTENSION_ELEMENT_TAG);
-//            if (derivedByElement == null) return;
-//          }
-//          if (derivedByElement != null)
-//          {
-//            dialog = new TypesDialog(shell, derivedByElement, XSDConstants.BASE_ATTRIBUTE, xsdSchema);
-//          }
-//          else
-//          {
-//            return;
-//          }
-//        }
-//        else
-//        {
-//          dialog = new TypesDialog(shell, element, "type", xsdSchema);
-//        }
-//	    }
-//	    else
-//	    {
-	      dialog = new TypesDialog(shell, element, "type", xsdSchema); //$NON-NLS-1$
-//	    }
-
-	    dialog.setBlockOnOpen(true);
-	    dialog.create();
-	    int result = dialog.open();
-	    
-	    if (result == Window.OK)
-	    {
-	      Object typeObject = dialog.getType();
-//		    if (input instanceof XSDSimpleTypeDefinition)
-//		    {
-//		      XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)input;
-//		      Element simpleTypeElement = st.getElement();
-//	        Element listElement = (Element)domHelper.getChildNode(simpleTypeElement, XSDConstants.LIST_ELEMENT_TAG);
-//
-//  	      beginRecording("ItemType Change", element);
-//          listElement.setAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, (String)typeObject);
-//          endRecording(element);
-//		    }
-	    }
-*/        
-        Shell shell = Display.getCurrent().getActiveShell();
-        IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
-        
-        Object input = getInput();
-        XSDSchema schema = null;
-        if (input instanceof XSDConcreteComponent) {
-            schema = ((XSDConcreteComponent) input).getSchema();
-        }
-        
-        XSDComponentSelectionProvider provider = new XSDComponentSelectionProvider(currentIFile, schema);
-        XSDComponentSelectionDialog dialog = new XSDComponentSelectionDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), provider);  // TODO: Externalize This
-        if (input instanceof XSDAttributeDeclaration)
-        {
-          provider.showComplexTypes(false);
-        }
-        provider.setDialog(dialog);
-        
-        dialog.setBlockOnOpen(true);
-        dialog.create();
-
-        if (dialog.open() == Window.OK) {
-            Element element = ((XSDConcreteComponent)getInput()).getElement();
-            XSDSetTypeHelper helper = new XSDSetTypeHelper(currentIFile, schema);
-            helper.setType(element, "type", dialog.getSelection());
-        }        
-
-//      refresh();
-    }
-  }
-
-  
-  
-  boolean checkForAnonymousType(Element element)
-  {
-    /* Using Ed's model to check
-     boolean isAnonymous = false;
-
-     XSDConcreteComponent component = getXSDSchema().getCorrespondingComponent(element);
-     if (component instanceof XSDElementDeclaration)
-     {
-     XSDElementDeclaration xsdElem = (XSDElementDeclaration)component;
-     isAnonymous = xsdElem.isSetAnonymousTypeDefinition();
-     }
-     return isAnonymous;
-     */
-
-    boolean isAnonymous = false;
-
-    Node aNode = getDomHelper().getChildNode(element, XSDConstants.SIMPLETYPE_ELEMENT_TAG);
-    if (aNode != null)
-     {
-      return true;
-    }
-    aNode = getDomHelper().getChildNode(element, XSDConstants.COMPLEXTYPE_ELEMENT_TAG);
-    if (aNode != null)
-     {
-      isAnonymous = true;
-    }
-    return isAnonymous;
-  }
-
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSectionDescriptor.java
deleted file mode 100644
index 3e9b8bf..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSectionDescriptor.java
+++ /dev/null
@@ -1,120 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class TypesSectionDescriptor extends AbstractSectionDescriptor
-{
-  /**
-   * 
-   */
-  public TypesSectionDescriptor()
-  {
-    super();
-  }
-
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
-   */
-  public String getId()
-  {
-    return "org.eclipse.wst.xsdeditor.section.types";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDElementDeclaration.class);
-    list.add(XSDAttributeDeclaration.class);
-    list.add(XSDAttributeUse.class);
-    list.add(XSDSimpleTypeDefinition.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new TypesSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.general";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDElementDeclaration)
-      {
-        XSDElementDeclaration elementDeclaration = (XSDElementDeclaration)object;
-        if (elementDeclaration.isElementDeclarationReference())
-        {
-          return false;
-        }
-        return true;
-      }
-      else if (object instanceof XSDAttributeDeclaration)
-      {
-        XSDAttributeDeclaration attr = (XSDAttributeDeclaration)object;
-        if (attr.isAttributeDeclarationReference())
-        {
-          return false;
-        }
-        return true;
-      }
-      else if (object instanceof XSDAttributeUse)
-      {
-        XSDAttributeUse attributeUse = (XSDAttributeUse)object;
-        Element element = attributeUse.getElement();
-        if (inputEquals(element, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false))
-        {
-          return true;
-        }
-        else
-        {
-          return false;
-        }
-      }
-    }
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSection.java
deleted file mode 100644
index d72ed50..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSection.java
+++ /dev/null
@@ -1,118 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class ValueSection extends AbstractSection
-{
-  Text valueText;
-  /**
-   * 
-   */
-  public ValueSection()
-  {
-    super();
-  }
-
-	/**
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
-	 */
-	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
-	{
-		super.createControls(parent, factory);
-		Composite composite =	getWidgetFactory().createFlatFormComposite(parent);
-		FormData data;
-
-		valueText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 100);
-		data.right = new FormAttachment(100, 0);
-		data.top = new FormAttachment(0, 0);
-		valueText.setLayoutData(data);
-		valueText.addListener(SWT.Modify, this);
-
-		CLabel valueLabel = getWidgetFactory().createCLabel(composite, XSDEditorPlugin.getXSDString("_UI_VALUE") + ":"); //$NON-NLS-1$
-		data = new FormData();
-		data.left = new FormAttachment(0, 0);
-		data.right = new FormAttachment(valueText, -ITabbedPropertyConstants.HSPACE);
-		data.top = new FormAttachment(valueText, 0, SWT.CENTER);
-		valueLabel.setLayoutData(data);
-		
-//		listener.startListeningForEnter(valueText);
-//		listener.startListeningTo(valueText);
-	}
-
-	/*
-	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
-	 */
-	public void refresh()
-	{
-	  setListenerEnabled(false);
-	  Object input = getInput();
-	  valueText.setText(""); //$NON-NLS-1$
-	  if (input != null)
-	  {
-	    if (input instanceof XSDEnumerationFacet)
-	    {
-	      XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)input;
-	      Element element = enumFacet.getElement();
-        String value = element.getAttribute(XSDConstants.VALUE_ATTRIBUTE);
-        
-        if (value != null)
-        {
-          valueText.setText(value);
-        }
-	    }
-	  }
-	  setListenerEnabled(true);
-	}
-	
-  public void doHandleEvent(Event event)
-  {
-    if (event.widget == valueText)
-    {
-      Object input = getInput();
-	    if (input instanceof XSDEnumerationFacet)
-	    {
-	      XSDEnumerationFacet enumFacet = (XSDEnumerationFacet)input;
-	      Element element = enumFacet.getElement();
-        
-        beginRecording(XSDEditorPlugin.getXSDString("_UI_ENUM_VALUE_CHANGE"), element); //$NON-NLS-1$
-        String value = valueText.getText();
-        element.setAttribute(XSDConstants.VALUE_ATTRIBUTE, value);
-        endRecording(element);
-	    }
-    }
-  }
-
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
-   */
-  public boolean shouldUseExtraSpace()
-  {
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSectionDescriptor.java
deleted file mode 100644
index e8f0b48..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/ValueSectionDescriptor.java
+++ /dev/null
@@ -1,82 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.xsd.XSDEnumerationFacet;
-
-public class ValueSectionDescriptor extends AbstractSectionDescriptor
-{
-  /**
-   * 
-   */
-  public ValueSectionDescriptor()
-  {
-    super();
-  }
-  
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
-   */
-  public List getInputTypes()
-  {
-    List list = new ArrayList();
-    list.add(XSDEnumerationFacet.class);
-    return list;
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
-   */
-  public ISection getSectionClass()
-  {
-    return new ValueSection();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
-   */
-  public String getTargetTab()
-  {
-    return "org.eclipse.wst.xmlwebservices.general";
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
-   */
-  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
-  {
-    Object object = null;
-    if (selection instanceof StructuredSelection)
-    {
-      StructuredSelection structuredSelection = (StructuredSelection)selection;
-      object = structuredSelection.getFirstElement();
-      if (object instanceof XSDEnumerationFacet)
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-  
-  public String getAfterSection()
-  {
-    return "org.eclipse.wst.xsdeditor.section.name";
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/WindowUtility.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/WindowUtility.java
deleted file mode 100644
index 9cc0e4d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/WindowUtility.java
+++ /dev/null
@@ -1,115 +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.xsd.ui.internal.properties.section;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-
-class WindowUtility
-{
-	public static Object getSelection(ISelection selection)
-	{
-		if (selection == null)
-		{
-			return null;
-		} // end of if ()
-
-		Object result = null;
-		if (selection instanceof IStructuredSelection)
-		{
-			 IStructuredSelection es= (IStructuredSelection)selection;
-			 Iterator i= es.iterator();
-			 if (i.hasNext())
-			 {
-				 result= i.next();
-			 }
-		}                     
-		return result;
-	}
-
-	public static List getSelectionList(ISelection selection)
-	{
-		List result = null;
-		if (selection != null)
-		{
-			if (selection instanceof IStructuredSelection)
-			{
-				IStructuredSelection es= (IStructuredSelection)selection;
-				result = new Vector();
-				for (Iterator i= es.iterator(); i.hasNext(); )
-				{
-					result.add(i.next());
-				}
-			}
-		}                     
-		return result;
-	} 
-
-	public static void openErrorCreatingFile(Shell shell, IResource resource)
-	{                   
-		 String title = null;
-		 String briefMessage = null;
-		 String reason = null;
-		 String details = null;
-
-//	KCPort TODO
-//		 title = B2BGUIPlugin.getInstance().getString("_UI_ERROR_CREATING_FILE_TITLE");
-//		 briefMessage = B2BGUIPlugin.getInstance().getString("_UI_ERROR_CREATING_FILE_SHORT_DESC", resource.getName());
-//		 details = B2BGUIPlugin.getInstance().getString("_UI_ERROR_CREATING_FILE_LONG_DESC", resource.getLocation().toOSString()); 
-//      
-//		 IResource parent = resource.getParent();     
-//		 if (parent != null) 
-//		 {                   
-//			 if (parent.isReadOnly())
-//			 {
-//				 reason = B2BGUIPlugin.getInstance().getString("_UI_PARENT_FOLDER_IS_READ_ONLY", parent.getName());     
-//			 }
-//			 else
-//			 {
-//				 // on windows the isReadOnly() = false for read only shared directory... so we give a hint
-//				 reason = B2BGUIPlugin.getInstance().getString("_UI_UNKNOWN_ERROR_WITH_HINT", parent.getName());  
-//			 }
-//		 } 
-//
-//		 if (reason == null)
-//		 {
-//			 reason = B2BGUIPlugin.getInstance().getString("_UI_UNKNOWN_ERROR");
-//		 }
-
-		 openError(shell, title, briefMessage, reason, details);
-	}      
-
-	public static void openError(Shell shell, String title, String briefMessage, String reason, String detailedMessage)
-	{
-		ErrorDialog.openError(shell, title, briefMessage, createStatus(reason, detailedMessage));                                  
-	}      
-
-	private static IStatus createStatus(String reason, String msg)
-	{
-// KCPort TODO
-//	  String pluginId = B2BGUIPlugin.getInstance().getDescriptor().getUniqueIdentifier();
-	  String pluginId = "";
-		MultiStatus multiStatus = new MultiStatus(pluginId, 0, reason, null);
-		Status status = new Status(IStatus.ERROR, pluginId, 0, msg, null);
-		multiStatus.add(status);
-		return multiStatus;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionDescriptorProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionDescriptorProvider.java
deleted file mode 100644
index 54acd8c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionDescriptorProvider.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptorProvider;
-
-
-public class XSDSectionDescriptorProvider implements ISectionDescriptorProvider
-{
-  /**
-   * 
-   */
-  public XSDSectionDescriptorProvider()
-  {
-    super();
-  }
-
-  /* (non-Javadoc)
-   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptorProvider#getSectionDescriptors()
-   */
-  public ISectionDescriptor[] getSectionDescriptors()
-  {
-    ISectionDescriptor[] descriptors = new ISectionDescriptor[18];
-    descriptors[0] = new NameSectionDescriptor();
-    descriptors[1] = new TypesSectionDescriptor();
-    descriptors[2] = new OtherAttributesSectionDescriptor();
-    descriptors[3] = new AttributesViewSectionDescriptor();
-    descriptors[4] = new ModelGroupSectionDescriptor();
-    descriptors[5] = new NamespaceProcessContentsSectionDescriptor();
-    descriptors[6] = new ReferenceSectionDescriptor();
-    descriptors[7] = new ComplexTypeSectionDescriptor();
-    descriptors[8] = new ValueSectionDescriptor();
-    descriptors[9] = new PatternSectionDescriptor();
-    descriptors[10] = new AnnotationSectionDescriptor();
-    descriptors[11] = new SimpleTypeSectionDescriptor();
-    descriptors[12] = new FacetsSectionDescriptor();
-    descriptors[13] = new EnumerationsSectionDescriptor();
-    descriptors[14] = new NamespaceSectionDescriptor();
-    descriptors[15] = new SchemaLocationDescriptor();
-    descriptors[16] = new NamespaceAndSchemaLocationDescriptor();
-    descriptors[17] = new MinMaxSectionDescriptor();
-    
-//  descriptors[18] = new SimpleTypeUnionSectionDescriptor();
-//  descriptors[19] = new FixedDefaultSectionDescriptor();    
-    return descriptors;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionLabelProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionLabelProvider.java
deleted file mode 100644
index 77bebed..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDSectionLabelProvider.java
+++ /dev/null
@@ -1,178 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.XSDEditor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.w3c.dom.Element;
-
-
-public class XSDSectionLabelProvider extends LabelProvider
-{
-  /**
-   * 
-   */
-  public XSDSectionLabelProvider()
-  {
-    super();
-  }
-
-	/**
-	 * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
-	 */
-	public Image getImage(Object object)
-	{
-		if (object == null || object.equals(StructuredSelection.EMPTY)) {
-			return null;
-		}
-    Image result = null;           
-    if (object instanceof StructuredSelection)
-    {
-      Object selected = ((StructuredSelection)object).getFirstElement();
-      
-      if (selected instanceof XSDConcreteComponent)
-      {
-        IWorkbench workbench = XSDEditorPlugin.getPlugin().getWorkbench();
-        IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-        IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-        if (editorPart instanceof XSDEditor)
-        {
-          return ((XSDEditor)editorPart).getLabelProvider().getImage((XSDConcreteComponent)selected);
-        }
-      }
-      
-//      selected  = typeMapper.remapObject(selected);
-//      ModelAdapter modelAdapter = adapterFactory.getAdapter(selected);
-//      if (modelAdapter != null)
-//      {
-//        result = (Image)modelAdapter.getProperty(selected, ModelAdapter.IMAGE_PROPERTY);     
-//      }
-    }
-    return result;
-	}
-
-	/**
-	 * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
-	 */
-	public String getText(Object object)
-	{
-		if (object == null || object.equals(StructuredSelection.EMPTY))
-    {
-			return "No items selected";
-		}
-    
-    String result = null;
-
-    boolean isReference = false;
-    Object selected = null;
-    if (object instanceof StructuredSelection)
-    {
-      selected = ((StructuredSelection)object).getFirstElement();
-      
-      if (selected instanceof XSDConcreteComponent)
-      {
-        if (selected instanceof XSDElementDeclaration)
-        {
-          XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)selected;
-          if (xsdElementDeclaration.isElementDeclarationReference())
-          {
-            isReference = true;
-          }
-        }
-        else if (selected instanceof XSDAttributeDeclaration)
-        {
-          if (((XSDAttributeDeclaration)selected).isAttributeDeclarationReference())
-          {
-            isReference = true;
-          }
-        }
-        else if (selected instanceof XSDModelGroupDefinition)
-        {
-          if (((XSDModelGroupDefinition)selected).isModelGroupDefinitionReference())
-          {
-            isReference = true;
-          }
-        }
-        StringBuffer sb = new StringBuffer();
-        Element element = ((XSDConcreteComponent)selected).getElement();
-        if (element != null)
-        {
-          sb.append(((XSDConcreteComponent)selected).getElement().getLocalName());
-          
-          if (isReference)
-          {
-            sb.append(" ");
-            sb.append(XSDEditorPlugin.getXSDString("_UI_PAGE_HEADING_REFERENCE"));
-          }
-          
-          if (!(element instanceof IDOMNode))
-          {
-            sb.append(" (" + XSDEditorPlugin.getXSDString("_UI_LABEL_READ_ONLY") + ")");   //$NON-NLS-1$
-          }
-          return sb.toString();
-        }
-        else
-        {
-          return "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_READ_ONLY") + ")";  //$NON-NLS-1$
-        }
-      }
-
-//      selected  = typeMapper.remapObject(selected);
-//      
-//       ModelAdapter modelAdapter = adapterFactory.getAdapter(selected);
-//       if (modelAdapter != null)
-//       {                       
-//         // result = (String)modelAdapter.getProperty(selected, ModelAdapter.LABEL_PROPERTY);
-//         result = ((WSDLElement)selected).getElement().getLocalName();
-//       }
-      if (object instanceof Element)
-      {
-        return ((Element)object).getLocalName();
-      }
-    }
-    else if (object instanceof TextSelection)
-    {
-    }
-    
-
-    return result;
-	}
-
-	/**
-	 * Determine if a multiple object selection has been passed to the 
-	 * label provider. If the objects is a IStructuredSelection, see if 
-	 * all the objects in the selection are the same and if so, we want
-	 * to provide labels for the common selected element.
-	 * @param objects a single object or a IStructuredSelection.
-	 * @param multiple first element in the array is true if there is multiple
-	 * unequal selected elements in a IStructuredSelection.
-	 * @return the object to get labels for.
-	 */
-	private Object getObject(Object objects, boolean multiple[]) {
-		Assert.isNotNull(objects);
-		Object object = null;
-		return object;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDTabbedPropertySheetPage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDTabbedPropertySheetPage.java
deleted file mode 100644
index 97810d0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDTabbedPropertySheetPage.java
+++ /dev/null
@@ -1,180 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.edit.provider.INotifyChangedListener;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySheetPageContributor;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetPage;
-import org.eclipse.wst.xsd.ui.internal.XSDSelectionManager;
-import org.eclipse.wst.xsd.ui.internal.graph.model.Category;
-import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.provider.XSDModelAdapterFactoryImpl;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-public class XSDTabbedPropertySheetPage extends TabbedPropertySheetPage
-  implements ISelectionChangedListener, INotifyChangedListener 
-{
-  XSDSchema xsdSchema;
-  private XSDSelectionManager selectionManager;
-  private XSDModelAdapterFactoryImpl adapterFactory;
-  /**
-   * @param tabbedPropertySheetPageContributor
-   */
-  public XSDTabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor)
-  {
-    super(tabbedPropertySheetPageContributor);
-  }
-  
-  public void init(IPageSite pageSite)
-  {
-  	super.init(pageSite);
-  	getSite().getWorkbenchWindow().getSelectionService().addPostSelectionListener(this);
-  }
-
-  public void setXSDSchema(XSDSchema xsdSchema)
-  {
-    this.xsdSchema = xsdSchema;
-  }
-  
-  public void setXSDModelAdapterFactory(XSDModelAdapterFactoryImpl adapterFactory) {
-    // disconnect from old one
-    if (adapterFactory != null) {
-      adapterFactory.removeListener(this);
-    }
-
-    this.adapterFactory = adapterFactory;
-
-    // connect to new one
-    if (adapterFactory != null) {
-      adapterFactory.addListener(this);
-    }
-  }
-  
-  public void setSelectionManager(XSDSelectionManager newSelectionManager)
-  { 
-    // disconnect from old one
-    if (selectionManager != null)
-    {                                                        
-      selectionManager.removeSelectionChangedListener(this);  
-    }
-
-    selectionManager = newSelectionManager;
-
-    // connect to new one
-    if (selectionManager != null)
-    {
-      selectionManager.addSelectionChangedListener(this);  
-    }
-  }    
-
-  public void selectionChanged(IWorkbenchPart part, ISelection selection)
-  {
-    // override for category
-    if (selection != null)
-    {
-      if (selection instanceof IStructuredSelection)
-      {
-        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-        if (structuredSelection.isEmpty())
-        {
-          return;
-        }
-        Object obj = structuredSelection.getFirstElement();
-        if (obj instanceof Element)
-        {
-          try
-          {
-            Object modelObject = xsdSchema.getCorrespondingComponent((Element) obj);
-            if (modelObject != null)
-            {
-              obj = modelObject;
-              selection = new StructuredSelection(obj);
-            }
-          }
-          catch (Exception e)
-          {
-          }
-        }
-        else if (obj instanceof Text)
-        {
-        	Node parent = ((Text)obj).getParentNode();
-          Object modelObject = xsdSchema.getCorrespondingComponent(parent);
-          if (modelObject != null)
-          {
-            obj = modelObject;
-            selection = new StructuredSelection(obj);
-          }
-        }
-        else if (obj instanceof CategoryAdapter)
-        {
-          selection = new StructuredSelection(((CategoryAdapter)obj).getXSDSchema());
-        }
-        else if (obj instanceof Category)
-        {
-          selection = new StructuredSelection(((Category)obj).getXSDSchema());
-        }
-        else if (obj instanceof ProcessingInstruction)
-        {
-        	selection = new StructuredSelection(xsdSchema);
-        }
-      }
-      else if (selection instanceof TextSelection)
-      {
-        return;
-      }
-    }
-    super.selectionChanged(part, selection);
-  }
-	
-  public void selectionChanged(SelectionChangedEvent event)
-  {
-    if (!event.getSelection().isEmpty())
-    {
-      selectionChanged(getSite().getWorkbenchWindow().getActivePage().getActivePart(), event.getSelection());
-      //super.selectionChanged(getSite().getWorkbenchWindow().getActivePage().getActivePart(), event.getSelection());
-    }
-  }
-  
-  public void dispose()
-  {
-    if (selectionManager != null)
-    {
-      selectionManager.removeSelectionChangedListener(this);
-    }
-    if (adapterFactory != null)
-    {
-      adapterFactory.removeListener(this);
-    }
-    getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(this);
-    super.dispose();
-  }
-  
-  public void notifyChanged(Notification notification)
-  {
-    if (getCurrentTab() != null)
-    {
-      refresh();
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbook.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbook.java
deleted file mode 100644
index 9c43704..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbook.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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Composite;
-
-public class XSDWorkbook {
-  private CTabFolder tabFolder;
-  private CTabItem selectedTab;
-/**
- * Workbook constructor comment.
- */
-public XSDWorkbook(Composite parent, int style) {
-  tabFolder = new CTabFolder(parent, style);
-
-  tabFolder.addSelectionListener(new SelectionAdapter() {
-    public void widgetSelected(SelectionEvent event) {
-      CTabItem newSelectedTab = (CTabItem) event.item;
-      if (selectedTab == newSelectedTab) // Do nothing if the selection did not change.
-        return;
-
-      if (selectedTab != null && (!selectedTab.isDisposed())) {
-        XSDWorkbookPage selectedPage = getWorkbookPage(selectedTab);
-        if (!selectedPage.deactivate()) {
-          // tabFolder.setSelection(new CTabItem[] {selectedTab});
-          tabFolder.setSelection(selectedTab);
-          return;
-        }
-      }
-
-      selectedTab = newSelectedTab;
-      XSDWorkbookPage newSelectedPage = getWorkbookPage(newSelectedTab);
-      if (newSelectedPage != null)
-      newSelectedPage.activate();
-
-    }
-  });
-
-}
-public XSDWorkbookPage getSelectedPage() {
-
-  int index = tabFolder.getSelectionIndex();
-  if (index == -1) // When can this be -1
-    return null;
-
-  CTabItem selectedItem = tabFolder.getItem(index);
-
-  return (XSDWorkbookPage)selectedItem.getData();
-}
-public CTabFolder getTabFolder() {
-
-  return tabFolder;
-
-}
-protected XSDWorkbookPage getWorkbookPage(CTabItem item) {
-
-  try {
-    return (XSDWorkbookPage) item.getData();
-  } catch (ClassCastException e) {
-    return null;
-  }
-}
-public XSDWorkbookPage[] getWorkbookPages() {
-
-  CTabItem[] tabItems = tabFolder.getItems();
-  int nItems = tabItems.length;
-  XSDWorkbookPage[] workbookPages = new XSDWorkbookPage[nItems];
-  for (int i = 0; i < nItems; i++)
-    workbookPages[i] = getWorkbookPage(tabItems[i]);
-  return workbookPages;
-}
-public void setSelectedPage (XSDWorkbookPage workbookPage)
-{
-  CTabItem newSelectedTab = workbookPage.getTabItem();
-
-  if (selectedTab == newSelectedTab)
-    return;
-
-  selectedTab = newSelectedTab;
-  workbookPage.activate();
-  // tabFolder.setSelection(new CTabItem[] {newSelectedTab});
-  tabFolder.setSelection(newSelectedTab);
-
-}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbookPage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbookPage.java
deleted file mode 100644
index f865afa..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/XSDWorkbookPage.java
+++ /dev/null
@@ -1,51 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.properties.section;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-public abstract class XSDWorkbookPage {
-  public CTabItem tabItem;
-/**
- * WorkbookPage constructor comment.
- */
-public XSDWorkbookPage(XSDWorkbook parent) {
-  CTabFolder folder = parent.getTabFolder();
-  tabItem = new CTabItem(folder,SWT.NONE);
-  tabItem.setData(this);
-}
-public void activate() {
-
-  if (tabItem.getControl() == null)
-    tabItem.setControl(createControl(tabItem.getParent()));
-      
-}
-protected abstract Control createControl (Composite parent);
-public boolean deactivate() {
-  return true;
-}
-public void dispose() {
-
-  if (tabItem == null)
-    return;
-
-  CTabItem oldItem = tabItem;
-  tabItem = null;
-  oldItem.dispose();
-}
-public CTabItem getTabItem() {
-  return tabItem;
-}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/CategoryAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/CategoryAdapter.java
deleted file mode 100644
index 3182e9a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/CategoryAdapter.java
+++ /dev/null
@@ -1,168 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.edit.provider.IChangeNotifier;
-import org.eclipse.emf.edit.provider.INotifyChangedListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.xsd.XSDSchema;
-
-
-public class CategoryAdapter // extends ItemProvider
-  implements ILabelProvider, IChangeNotifier, ITreeContentProvider
-{
-  
-  protected String text;
-
-  /**
-   * This is the image returned by {@link #getImage getImage(Object)}.
-   */
-  protected Image image;
-
-  /**
-   * This is the parent returned by {@link #getParent getParent(Object)}.
-   */
-  protected Object parent;
-
-  public CategoryAdapter(String label, Image image, Collection children, XSDSchema xsdSchema, int groupType)
-  {
-//    super(label, image, xsdSchema);
-    this.text = label;
-    this.image = image;
-    this.parent = xsdSchema;
-    this.xsdSchema = xsdSchema;
-    this.children = children;
-    this.groupType = groupType;
-  }
-  
-  public final static int ATTRIBUTES = 1;
-  public final static int ELEMENTS = 2;
-  public final static int TYPES = 3;
-  public final static int GROUPS = 5;
-  public final static int DIRECTIVES = 6;
-  public final static int NOTATIONS = 7;
-  public final static int ATTRIBUTE_GROUPS = 8;
-  public final static int IDENTITY_CONSTRAINTS = 9;
-  public final static int ANNOTATIONS = 10;
-                                 
-  protected int groupType;
-  Collection children;
-  XSDSchema xsdSchema;
-  
-  public XSDSchema getXSDSchema()
-  {
-    return xsdSchema;
-  }
-  
-  public int getGroupType()
-  {
-    return groupType;
-  }   
-
-//  public boolean hasChildren(Object o)
-//  {
-//    return !children.isEmpty();
-//  }
-
-//  public Collection getChildren(Object o)
-//  {
-//    return children;
-//  }
-  
-  public Image getImage(Object element)
-  {
-    return image;
-  }
-  
-  public String getText(Object object)
-  {
-    // return object.toString();
-    return text;
-  }
-  
-  public void addListener(ILabelProviderListener listener)
-  {
-    
-  }
-  
-  public boolean isLabelProperty(Object element, String property)
-  {
-    return false;
-  }
-
-  public void removeListener(ILabelProviderListener listener)
-  {
-    
-  }
-
-  public void fireNotifyChanged(Notification notification)
-  {
-    
-  }
-
-  /**
-   * This adds another listener.
-   */
-  public void addListener(INotifyChangedListener notifyChangedListener)
-  {
-    
-  }
-
-  /**
-   * This removes a listener.
-   */
-  public void removeListener(INotifyChangedListener notifyChangedListener)
-  {
-    
-  }
-
-  public void dispose()
-  {
-    
-  }
-  
-  public Object[] getElements(Object inputElement)
-  {
-    return getChildren(inputElement);
-  }
-
-  public Object[] getChildren(Object parentElement)
-  {
-    return children.toArray();
-  }
-  
-  public void setChildren(Collection list)
-  {
-    children = list;
-  }
-
-  public Object getParent(Object element)
-  {
-    return xsdSchema;
-  }
-  
-  public boolean hasChildren(Object element)
-  {
-    return true;
-  }
-
-  public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-  {
-    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAbstractAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAbstractAdapter.java
deleted file mode 100644
index 8233c5e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAbstractAdapter.java
+++ /dev/null
@@ -1,165 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.edit.provider.ChangeNotifier;
-import org.eclipse.emf.edit.provider.IChangeNotifier;
-import org.eclipse.emf.edit.provider.INotifyChangedListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-
-public class XSDAbstractAdapter extends AdapterImpl
-  implements ITreeContentProvider, ILabelProvider, IChangeNotifier
-{
-
-  protected AdapterFactory adapterFactory;
-  /**
-   * 
-   */
-  public XSDAbstractAdapter(AdapterFactory adapterFactory)
-  {
-    super();
-    this.adapterFactory = adapterFactory;
-  }
-  
-  /**
-   * The adapter factory is used as the type key.
-   * This returns true, only if this adapter was created by the given factory.
-   */
-  public boolean isAdapterForType(Object type)
-  {
-    return type == adapterFactory;
-  }
-
-  public Image getImage(Object element)
-  {
-    return null;
-  }
-  
-  public String getText(Object object)
-  {
-    return object.toString();
-  }
-  
-  public void addListener(ILabelProviderListener listener)
-  {
-    
-  }
-  
-  public boolean isLabelProperty(Object element, String property)
-  {
-    return false;
-  }
-
-  public void removeListener(ILabelProviderListener listener)
-  {
-    
-  }
-  
-  public Object[] getChildren(Object parentElement)
-  {
-    List list = new ArrayList();
-    return list.toArray();
-  }
-  
-  public boolean hasChildren(Object object)
-  {
-    return false;
-  }
-
-  public Object getParent(Object object)
-  {
-    return null;
-  }
-
-  public Object[] getElements(Object inputElement)
-  {
-    return getChildren(inputElement);
-  }
-
-  public void dispose()
-  {
-    
-  }
-  
-  public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-  {
-    
-  }
-
-  /**
-   * This is used to implement {@link IChangeNotifier}.
-   */
-  protected IChangeNotifier changeNotifier;
-
-  
-  public void notifyChanged(Notification msg)
-  {                        
-    if (msg.getEventType() != Notification.RESOLVE)
-    {        
-      fireNotifyChanged(msg);
-    }
-  }  
-
-  /**
-   * This calls {@link org.eclipse.emf.edit.provider.INotifyChangedListener#notifyChanged notifyChanged} for each listener.
-   */
-  public void fireNotifyChanged(Notification notification)
-  {
-    if (changeNotifier != null)
-    {
-      changeNotifier.fireNotifyChanged(notification);
-    }
-
-    if (adapterFactory instanceof IChangeNotifier)
-    {
-      IChangeNotifier changeNotifier = (IChangeNotifier)adapterFactory;
-      changeNotifier.fireNotifyChanged(notification);
-    }
-  }
-
-
-  /**
-   * This adds another listener.
-   */
-  public void addListener(INotifyChangedListener notifyChangedListener)
-  {
-    if (changeNotifier == null)
-    {
-      changeNotifier = new ChangeNotifier();
-    }
-    changeNotifier.addListener(notifyChangedListener);
-   
-  }
-
-  /**
-   * This removes a listener.
-   */
-  public void removeListener(INotifyChangedListener notifyChangedListener)
-  {
-    if (changeNotifier != null)
-    {
-      changeNotifier.removeListener(notifyChangedListener);
-    }
-   
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAdapterFactoryLabelProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAdapterFactoryLabelProvider.java
deleted file mode 100644
index 6cf228e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAdapterFactoryLabelProvider.java
+++ /dev/null
@@ -1,143 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.edit.provider.IChangeNotifier;
-import org.eclipse.emf.edit.provider.INotifyChangedListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-public class XSDAdapterFactoryLabelProvider implements ILabelProvider, INotifyChangedListener, ITableLabelProvider {
-	protected XSDModelAdapterFactoryImpl adapterFactory;
-	protected Collection labelProviderListeners;
-
-	/**
-	 * 
-	 */
-	public XSDAdapterFactoryLabelProvider(XSDModelAdapterFactoryImpl adapterFactory) {
-		this.adapterFactory = adapterFactory;
-		labelProviderListeners = new ArrayList();
-	}
-
-	/**
-	 * Return the wrapped AdapterFactory.
-	 */
-	public AdapterFactory getAdapterFactory() {
-		return adapterFactory;
-	}
-
-	/**
-	 * Set the wrapped AdapterFactory.
-	 */
-	public void setAdapterFactory(XSDModelAdapterFactoryImpl adapterFactory) {
-		if (this.adapterFactory instanceof IChangeNotifier) {
-			((IChangeNotifier) this.adapterFactory).removeListener(this);
-		}
-
-		if (adapterFactory instanceof IChangeNotifier) {
-			((IChangeNotifier) adapterFactory).addListener(this);
-		}
-
-		this.adapterFactory = adapterFactory;
-	}
-
-	/**
-	 * Since we won't ever generate these notifications, we can just ignore
-	 * this.
-	 */
-	public void addListener(ILabelProviderListener listener) {
-		labelProviderListeners.add(listener);
-	}
-
-	/**
-	 * Since we won't ever add listeners, we can just ignore this.
-	 */
-	public void removeListener(ILabelProviderListener listener) {
-		labelProviderListeners.remove(listener);
-	}
-
-	/**
-	 * This discards the content provider and removes this as a listener to
-	 * the {@link #adapterFactory}.
-	 */
-	public void dispose() {
-		if (this.adapterFactory instanceof IChangeNotifier) {
-			((IChangeNotifier) adapterFactory).removeListener(this);
-		}
-	}
-
-	/**
-	 * This always returns true right now.
-	 */
-	public boolean isLabelProperty(Object object, String id) {
-		return true;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
-	 */
-	public Image getImage(Object object) {
-		ILabelProvider labelProvider = (ILabelProvider) adapterFactory.adapt(object, ILabelProvider.class);
-
-		return labelProvider != null ? labelProvider.getImage(object) : null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
-	 */
-	public String getText(Object object) {
-		// Get the adapter from the factory.
-		//
-		ILabelProvider labelProvider = (ILabelProvider) adapterFactory.adapt(object, ILabelProvider.class);
-
-		return labelProvider != null ? labelProvider.getText(object) : object == null ? "" : object.toString();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.emf.edit.provider.INotifyChangedListener#notifyChanged(org.eclipse.emf.common.notify.Notification)
-	 */
-	public void notifyChanged(Notification notification) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object,
-	 *      int)
-	 */
-	public Image getColumnImage(Object element, int columnIndex) {
-		return getImage(element);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
-	 *      int)
-	 */
-	public String getColumnText(Object element, int columnIndex) {
-		return getText(element);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAnnotationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAnnotationAdapter.java
deleted file mode 100644
index b57a4c5..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAnnotationAdapter.java
+++ /dev/null
@@ -1,83 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDAnnotationAdapter extends XSDAbstractAdapter
-{
-  public XSDAnnotationAdapter(AdapterFactory adapterFactory)
-  {
-    super(adapterFactory);
-  }
-
-  public Image getImage(Object element)
-  {
-    return XSDEditorPlugin.getPlugin().getImage("icons/XSDAnnotate.gif");
-  }
-  
-  public String getText(Object object)
-  {
-    XSDAnnotation xsdAnnotation = ((XSDAnnotation)object);
-    String result = "";
-    List userInformation = xsdAnnotation.getUserInformation();
-    if (!userInformation.isEmpty())
-    {
-      Element element = (Element)userInformation.get(0);
-      if (element.hasAttribute(XSDConstants.SOURCE_ATTRIBUTE))
-      {
-        result = element.getAttribute(XSDConstants.SOURCE_ATTRIBUTE);
-      }
-      else
-      {
-        org.w3c.dom.Node text = element.getFirstChild(); 
-        while (text instanceof Element)
-        {
-          text = ((Element)text).getFirstChild();
-        }
-        if (text != null && text.getNodeValue() != null)
-        {
-          result = text.getNodeValue();
-          result = result.trim();
-          if (result.length() > 50)
-          {
-            result = result.substring(0, 50) + "...";
-          }
-        }
-      }
-    }
-
-    return result;
-  }
-  
-  public Object[] getChildren(Object parentElement)
-  {
-    return null;  
-  }
-  
-  public boolean hasChildren(Object object)
-  {
-    return true;
-  }
-
-  public Object getParent(Object object)
-  {
-    XSDAnnotation element = (XSDAnnotation)object;
-    return element.getContainer();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeDeclarationAdapter.java
deleted file mode 100644
index 330925f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeDeclarationAdapter.java
+++ /dev/null
@@ -1,113 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class XSDAttributeDeclarationAdapter extends XSDAbstractAdapter
-{
-
-  /**
-   * @param adapterFactory
-   */
-  public XSDAttributeDeclarationAdapter(AdapterFactory adapterFactory)
-  {
-    super(adapterFactory);
-  }
-
-  public Image getImage(Object object)
-  {
-    XSDAttributeDeclaration xsdAttributeDeclaration = ((XSDAttributeDeclaration)object);
-    XSDAttributeDeclaration resolvedAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration();
-    
-    if (resolvedAttributeDeclaration.getContainer() == null)
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif");
-    }
-    // if (xsdAttributeDeclaration.getResolvedAttributeDeclaration() == xsdAttributeDeclaration)
-    if (xsdAttributeDeclaration.isAttributeDeclarationReference())
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDAttributeRef.gif");
-    }
-    else
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif");
-    }
-    
-//    return 
-//    XSDEditorPlugin.getPlugin().getIconImage
-//     (resolvedAttributeDeclaration.getContainer() == null ?
-//        "full/obj16/XSDAttributeUnresolved" :
-//          xsdAttributeDeclaration.getResolvedAttributeDeclaration() == xsdAttributeDeclaration ?
-//          "full/obj16/XSDAttributeDeclaration" :
-//          "full/obj16/XSDAttributeUse");
-  }
-
-  public String getText(Object object)
-  {
-    XSDAttributeDeclaration xsdAttributeDeclaration = ((XSDAttributeDeclaration)object);
-    XSDAttributeDeclaration resolvedAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration();
-    String name =
-      xsdAttributeDeclaration != resolvedAttributeDeclaration ?
-        xsdAttributeDeclaration.getQName() :
-        xsdAttributeDeclaration.getName();
-
-    StringBuffer result = new StringBuffer();
-    if (name == null)
-    {
-      result.append("'absent'");
-    }
-    else
-    {
-      result.append(name);
-    }
-
-    if (resolvedAttributeDeclaration.getAnonymousTypeDefinition() == null && resolvedAttributeDeclaration.getTypeDefinition() != null)
-    {
-      result.append(" : ");
-      result.append(resolvedAttributeDeclaration.getTypeDefinition().getQName(xsdAttributeDeclaration));
-    }
-
-    return result.toString();
-  }
-
-  public Object[] getChildren(Object parentElement)
-  {
-    XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)parentElement;
-    List list = new ArrayList();
-    
-    XSDTypeDefinition type = xsdAttributeDeclaration.getAnonymousTypeDefinition();
-    if (type != null)
-    {
-      list.add(type);
-    }
-    return list.toArray();
-  }
-  
-  public boolean hasChildren(Object object)
-  {
-    return true;
-  }
-
-  public Object getParent(Object object)
-  {
-    XSDAttributeDeclaration element = (XSDAttributeDeclaration)object;
-    return element.getContainer();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeGroupDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeGroupDefinitionAdapter.java
deleted file mode 100644
index a45588e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeGroupDefinitionAdapter.java
+++ /dev/null
@@ -1,96 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-
-public class XSDAttributeGroupDefinitionAdapter extends XSDAbstractAdapter
-{
-
-  /**
-   * @param adapterFactory
-   */
-  public XSDAttributeGroupDefinitionAdapter(AdapterFactory adapterFactory)
-  {
-    super(adapterFactory);
-  }
-
-  public Image getImage(Object object)
-  {
-    XSDAttributeGroupDefinition xsdAttributeGroupDefinition = ((XSDAttributeGroupDefinition)object);
-
-    if (xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference())
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDAttributeGroupRef.gif");
-    }
-    else
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDAttributeGroup.gif");
-    }
-  }
-
-  public String getText(Object object)
-  {
-    XSDAttributeGroupDefinition xsdAttributeGroupDefinition = ((XSDAttributeGroupDefinition)object);
-    String result =  
-      xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference() ?
-        xsdAttributeGroupDefinition.getQName() :
-        xsdAttributeGroupDefinition.getName();
-    return result == null ? "'absent'" : result;
-  }
-
-  public Object[] getChildren(Object parentElement)
-  {
-    XSDAttributeGroupDefinition xsdAttributeGroup = (XSDAttributeGroupDefinition)parentElement;
-    List list = new ArrayList();
-    list.addAll(xsdAttributeGroup.getContents());   
-//    Iterator i = xsdAttributeGroup.getContents().iterator();
-//    while (i.hasNext())
-//    {
-//      XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)i.next();
-//      if (attrGroupContent instanceof XSDAttributeUse)
-//      {
-//        list.add(((XSDAttributeUse)attrGroupContent).getAttributeDeclaration());
-//      }
-//      else
-//      {
-//        list.add(attrGroupContent);
-//      }
-//    }
-    
-    XSDWildcard wildcard = xsdAttributeGroup.getAttributeWildcardContent();
-    if (wildcard != null)
-    {
-      list.add(wildcard);
-    }
-    return list.toArray();
-  }
-  
-  public boolean hasChildren(Object object)
-  {
-    return true;
-  }
-
-  public Object getParent(Object object)
-  {
-    XSDAttributeGroupDefinition element = (XSDAttributeGroupDefinition)object;
-    return element.getContainer();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeUseAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeUseAdapter.java
deleted file mode 100644
index 5c8c127..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDAttributeUseAdapter.java
+++ /dev/null
@@ -1,90 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-
-public class XSDAttributeUseAdapter extends XSDAbstractAdapter
-{
-
-  /**
-   * @param adapterFactory
-   */
-  public XSDAttributeUseAdapter(AdapterFactory adapterFactory)
-  {
-    super(adapterFactory);
-  }
-  
-  protected XSDAttributeDeclaration getDelegate(XSDAttributeUse xsdAttributeUse)
-  {
-    return xsdAttributeUse.getContent();
-  }
-  
-  /**
-   * This returns XSDAttributeUse.gif.
-   */
-  public Image getImage(Object object)
-  {
-    XSDAttributeUse xsdAttributeUse = ((XSDAttributeUse)object);
-    
-    XSDAttributeDeclaration xsdAttributeDeclaration = getDelegate(xsdAttributeUse);
-    if (xsdAttributeDeclaration.isAttributeDeclarationReference())
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDAttributeRef.gif");
-    }
-    else
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif");
-    }
-    //return XSDEditorPlugin.getPlugin().getIconImage("full/obj16/XSDAttributeUse");  
-    
-  }
-
-  public String getText(Object object)
-  {
-    return getText(object, true);
-  }
-
-  public String getText(Object object, boolean showType)
-  {
-    XSDAttributeUse xsdAttributeUse = ((XSDAttributeUse)object);
-    XSDAttributeDeclaration xsdAttributeDeclaration = getDelegate(xsdAttributeUse);
-    if (xsdAttributeDeclaration.isAttributeDeclarationReference())
-    {
-      return xsdAttributeDeclaration.getResolvedAttributeDeclaration().getName();
-    }
-    StringBuffer result  = new StringBuffer();
-    if (xsdAttributeDeclaration != null)
-    {
-      result.append(xsdAttributeDeclaration.getName());
-    }
-
-    if (xsdAttributeUse.isSetConstraint())
-    {
-      if (result.length() != 0)
-      {
-        result.append("  ");
-      }
-      result.append('<');
-      result.append(xsdAttributeUse.getConstraint());
-      result.append("=\"");
-      result.append(xsdAttributeUse.getLexicalValue());
-      result.append("\">");
-    }
-
-    return result.toString();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDComplexTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDComplexTypeDefinitionAdapter.java
deleted file mode 100644
index 38f7351..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDComplexTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,182 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDComplexTypeDefinitionAdapter extends XSDAbstractAdapter
-{
-
-  /**
-   * @param adapterFactory
-   */
-  public XSDComplexTypeDefinitionAdapter(AdapterFactory adapterFactory)
-  {
-    super(adapterFactory);
-  }
-
-  public Image getImage(Object object)
-  {
-    return XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif");
-//    XSDComplexTypeDefinition xsdComplexTypeDefinition = ((XSDComplexTypeDefinition)object);
-//    return 
-//      XSDEditorPlugin.getPlugin().getIconImage
-//        (xsdComplexTypeDefinition.getContainer() == null ?
-//          "full/obj16/XSDComplexTypeDefinitionUnresolved" :
-//          "full/obj16/XSDComplexTypeDefinition");
-  }
-  
-  public String getText(Object object)
-  {
-    return getText(object, true);
-  }
-  
-  public String getText(Object object, boolean showType)
-  {
-    XSDComplexTypeDefinition xsdComplexTypeDefinition = ((XSDComplexTypeDefinition)object);
-
-    StringBuffer result = new StringBuffer();
-    
-    result.append
-     (xsdComplexTypeDefinition.getName() == null ? 
-        // xsdComplexTypeDefinition.getAliasName() :
-        "local type" :
-        xsdComplexTypeDefinition.getName());
-
-    if (showType)
-    {
-      XSDTypeDefinition baseTypeDefinition = xsdComplexTypeDefinition.getBaseTypeDefinition();
-      if (baseTypeDefinition != null && 
-            baseTypeDefinition != xsdComplexTypeDefinition.getContent() &&
-            baseTypeDefinition.getName() != null &&
-            !XSDConstants.isURType(baseTypeDefinition))
-      {
-        result.append(" : ");
-        result.append(baseTypeDefinition.getQName(xsdComplexTypeDefinition));
-      }
-    }
-
-    return result.toString();
-  }
-
-  public Object[] getChildren(Object parentElement)
-  {
-    XSDComplexTypeDefinition xsdComplexTypeDefinition = (XSDComplexTypeDefinition)parentElement;
-    List list = new ArrayList();
-    
-    if (xsdComplexTypeDefinition.getContent() != null)
-    {
-      XSDComplexTypeContent xsdComplexTypeContent = xsdComplexTypeDefinition.getContent();
-      if (xsdComplexTypeContent instanceof XSDParticle)
-      {
-        list.add(((XSDParticle)xsdComplexTypeContent).getContent());
-      }
-    }
-    
-//    if (((XSDModelAdapterFactoryImpl)adapterFactory).getShowInherited())
-//    {
-//      if (xsdComplexTypeDefinition.getSyntheticParticle() != null)
-//      {
-//        XSDTypeDefinition type = xsdComplexTypeDefinition.getBaseTypeDefinition();
-//        list.addAll(XSDChildUtility.getModelChildren(type));
-//      }
-//      if (xsdComplexTypeDefinition.getSyntheticWildcard() != null)
-//      {
-//        list.add(xsdComplexTypeDefinition.getSyntheticWildcard());
-//      }
-//    }
-    
-//    List attributes = xsdComplexTypeDefinition.getAttributeContents();
-//    if (attributes.size() > 0)
-//    {
-//      list.addAll(attributes);
-//    }
-
-//  list = new ArrayList();
-    if (((XSDModelAdapterFactoryImpl)adapterFactory).getShowInherited())
-    {
-      if (xsdComplexTypeDefinition.getDerivationMethod().getName().equals("extension"))
-      {
-        XSDTypeDefinition type = xsdComplexTypeDefinition.getBaseTypeDefinition();
-        Iterator iter = XSDChildUtility.getModelChildren(type).iterator();
-        boolean cont = true;
-        while (cont)
-        {
-          while (iter.hasNext())
-          {
-            list.add(0, iter.next());
-          }
-          
-          if (type instanceof XSDComplexTypeDefinition)
-          {
-            XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition)type;
-            type = ctd.getBaseTypeDefinition();
-                      
-            // defect 264957 - workbench hangs when modifying complex content
-            // Since we don't filter out the current complexType from
-            // the combobox, we can potentially have an endless loop
-            if (ctd == type)
-            {
-              cont = false;
-              break;
-            }
-
-            if (ctd.getDerivationMethod().getName().equals("extension"))
-            {
-              iter = XSDChildUtility.getModelChildren(type).iterator();
-            }
-            else
-            {
-              cont = false;
-            }
-          }
-          else
-          {
-            cont = false;
-          }
-        }
-
-      }
-
-          
-//          list.addAll(XSDChildUtility.getModelChildren(baseType));
-      }
-
-//    list.addAll(XSDChildUtility.getModelChildren(xsdComplexTypeDefinition));
-
-    return list.toArray();
- 
-  }
-  
-  public boolean hasChildren(Object object)
-  {
-    return true;
-  }
-
-  public Object getParent(Object object)
-  {
-    XSDComplexTypeDefinition element = (XSDComplexTypeDefinition)object;
-    return element.getContainer();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDContentProvider.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDContentProvider.java
deleted file mode 100644
index 984e099..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDContentProvider.java
+++ /dev/null
@@ -1,228 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.edit.provider.IChangeNotifier;
-import org.eclipse.emf.edit.provider.INotifyChangedListener;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.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.xsd.ui.internal.text.XSDModelAdapter;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDWildcard;
-import org.w3c.dom.Node;
-
-public class XSDContentProvider implements ITreeContentProvider, INotifyChangedListener
-{
-  XSDModelAdapterFactoryImpl xsdModelAdapterFactory;
-
-  public XSDContentProvider(XSDModelAdapterFactoryImpl xsdModelAdapterFactoryImpl)
-  {
-    this.xsdModelAdapterFactory = xsdModelAdapterFactoryImpl;
-    
-    if (xsdModelAdapterFactory instanceof IChangeNotifier)
-    {
-      ((IChangeNotifier)xsdModelAdapterFactory).addListener(this);
-    }
-  }
-  
-  /*
-   * @see ITreeContentProvider#getChildren(Object)
-   */
-  public Object[] getChildren(Object parentElement)
-  {
-    XSDConcreteComponent xsdComp = null;
-    List list = null;
-    
-    // root/input is structuredmodel
-    if (parentElement instanceof IDOMModel) {
-		IDOMDocument domDoc = ((IDOMModel) parentElement).getDocument();
-		if (domDoc != null) {
-			XSDModelAdapter modelAdapter = (XSDModelAdapter) domDoc.getExistingAdapter(XSDModelAdapter.class);
-			/*
-			 * ISSUE: Didn't want to go through initializing
-			 * schema if it does not already exist, so just
-			 * attempted to get existing adapter. If doesn't
-			 * exist, just don't bother working.
-			 */
-			if (modelAdapter != null)
-				xsdComp = modelAdapter.getSchema();
-			if (xsdComp != null) {
-		      xsdModelAdapterFactory.adapt(xsdComp, xsdModelAdapterFactory);
-
-		      list = new ArrayList();
-		      list.add(xsdComp);
-		      return list.toArray();
-			}
-		}
-    }
-    else if (parentElement instanceof XSDConcreteComponent)
-    {
-      xsdComp = (XSDConcreteComponent)parentElement;
-      list = new ArrayList();
-    }
-    else if (parentElement instanceof ITreeItemContentProvider)
-    {
-      return ((ITreeItemContentProvider)parentElement).getChildren(parentElement).toArray();
-    }
-    else if (parentElement instanceof ITreeContentProvider)
-    {
-      return ((ITreeContentProvider)parentElement).getChildren(parentElement);
-    }
-    
-    if (xsdComp != null)
-    {
-      XSDAbstractAdapter a = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt(xsdComp, xsdModelAdapterFactory);
-      
-      if (xsdComp instanceof XSDElementDeclaration || xsdComp instanceof XSDModelGroup || xsdComp instanceof XSDWildcard)
-      {
-        xsdModelAdapterFactory.adapt(((XSDParticleContent)xsdComp).getContainer(), xsdModelAdapterFactory);
-      }
-
-      if (a != null)
-      {
- 	    Object [] obj = a.getChildren(xsdComp);
- 	    if (obj != null)
- 	    {
- 	      list = Arrays.asList(obj);
- 	    }
- 	  }
-    }
-    
-    list =  list != null ? list : Collections.EMPTY_LIST;
-    return list.toArray();
-  }
-
-  /*
-   * @see ITreeContentProvider#getParent(Object)
-   */
-  public Object getParent(Object element)
-  {
-    if (element instanceof Node)
-    {
-      return ((Node)element).getParentNode();
-    }
-    else if (element instanceof XSDConcreteComponent)
-    {
-      return ((XSDConcreteComponent)element).getContainer();
-    }
-    return null;
-  }
-
-  /*
-   * @see ITreeContentProvider#hasChildren(Object)
-   */
-  public boolean hasChildren(Object element)
-  {
-    Object[] children = getChildren(element);
-    return children != null && children.length > 0;   
-  }
-
-  /*
-   * @see IStructuredContentProvider#getElements(Object)
-   */
-  public Object[] getElements(Object inputElement)
-  {
-    return getChildren(inputElement);
-  }
-
-  public void notifyChanged(Notification notification)
-  {
-    if (viewer != null)
-    {
-      if (viewer instanceof StructuredViewer)
-      {
-        if (notification.getFeature() instanceof EAttribute)
-        {
-          ((StructuredViewer)viewer).update(notification.getNotifier(), null);
-        }
-        else
-        {
-          ((StructuredViewer)viewer).refresh(notification.getNotifier());
-        }
-      }
-      else
-      {
-        viewer.refresh();
-      }
-    }
-
-  }
-
-  /*
-   * @see IContentProvider#dispose()
-   */
-  public void dispose()
-  {
-    viewer = null;
-    xsdModelAdapterFactory.removeListener(this);
-  }
-  
-  protected Viewer viewer = null;
-
-  /*
-   * @see IContentProvider#inputChanged(Viewer, Object, Object)
-   */
-  public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-  {
-    this.viewer = viewer;
-  }
-  
-	/**
-	 * Gets the xsd schema from document
-	 * 
-	 * @param document
-	 * @return XSDSchema or null of one does not exist yet for document
-	 */
-	private XSDSchema getXSDSchema(IDocument document) {
-		XSDSchema schema = null;
-		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-		if (model != null) {
-			try {
-				if (model instanceof IDOMModel) {
-					IDOMDocument domDoc = ((IDOMModel) model).getDocument();
-					if (domDoc != null) {
-						XSDModelAdapter modelAdapter = (XSDModelAdapter) domDoc.getExistingAdapter(XSDModelAdapter.class);
-						/*
-						 * ISSUE: Didn't want to go through initializing
-						 * schema if it does not already exist, so just
-						 * attempted to get existing adapter. If doesn't
-						 * exist, just don't bother working.
-						 */
-						if (modelAdapter != null)
-							schema = modelAdapter.getSchema();
-					}
-				}
-			}
-			finally {
-				model.releaseFromRead();
-			}
-		}
-		return schema;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDElementDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDElementDeclarationAdapter.java
deleted file mode 100644
index f273ccf..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDElementDeclarationAdapter.java
+++ /dev/null
@@ -1,183 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class XSDElementDeclarationAdapter extends XSDAbstractAdapter
-{
-
-  /**
-   * @param adapterFactory
-   */
-  public XSDElementDeclarationAdapter(AdapterFactory adapterFactory)
-  {
-    super(adapterFactory);
-  }
-
-  public Image getImage(Object element)
-  {
-    XSDElementDeclaration xsdElementDeclaration = ((XSDElementDeclaration)element);
-    
-    if (!xsdElementDeclaration.isElementDeclarationReference())
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDElement.gif");
-    }
-    else
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDElementRef.gif");
-    }
-  }
-  
-  public String getText(Object object)
-  {
-    XSDElementDeclaration xsdElementDeclaration = ((XSDElementDeclaration)object);
-    XSDElementDeclaration resolvedElementDeclaration = xsdElementDeclaration.getResolvedElementDeclaration();
-    String name = 
-      xsdElementDeclaration != resolvedElementDeclaration ?
-        xsdElementDeclaration.getQName() :
-        xsdElementDeclaration.getName();
-
-    StringBuffer result = new StringBuffer();
-    if (name == null)
-    {
-      result.append("'absent'");
-    }
-    else
-    {
-      result.append(name);
-    }
-    
-    if (!xsdElementDeclaration.isGlobal())
-    {
-      Element element = xsdElementDeclaration.getElement();
-      boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-      boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-
-      if (hasMinOccurs || hasMaxOccurs)
-      {
-	      result.append(" ["); 
-		    if (hasMinOccurs)
-	      {
-	        int min = ((XSDParticle)xsdElementDeclaration.getContainer()).getMinOccurs();
-	  	    if (min == XSDParticle.UNBOUNDED)
-	  	    {
-	  	      result.append("*");
-	  	    }
-	  	    else
-	  	    {
-	  	      result.append(String.valueOf(min));
-	  	    }
-	      }
-        else // print default
-        {
-          int min = ((XSDParticle)xsdElementDeclaration.getContainer()).getMinOccurs();
-          result.append(String.valueOf(min));
-        }
-	      if (hasMaxOccurs)
-	      {
-	        int max = ((XSDParticle)xsdElementDeclaration.getContainer()).getMaxOccurs();
-	  	    result.append("..");
-	  	    if (max == XSDParticle.UNBOUNDED)
-	  	    {
-	  	      result.append("*");
-	  	    }
-	  	    else
-	  	    {
-	  	      result.append(String.valueOf(max));
-	  	    }
-	      }
-        else // print default
-        {
-          result.append("..");
-          int max = ((XSDParticle)xsdElementDeclaration.getContainer()).getMaxOccurs();
-          result.append(String.valueOf(max));
-         
-        }
-	      result.append("]");
-      }
-    }
-    
-    if (resolvedElementDeclaration.getAnonymousTypeDefinition() == null && resolvedElementDeclaration.getTypeDefinition() != null)
-    {
-      result.append(" : ");
-      result.append(resolvedElementDeclaration.getTypeDefinition().getQName(xsdElementDeclaration));
-    }
-
-    return result.toString();
-  }
-  
-  public Object[] getChildren(Object parentElement)
-  {
-    XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)parentElement;
-    List list = new ArrayList();
-    XSDTypeDefinition type = null;
-    if (xsdElementDeclaration.isElementDeclarationReference())
-    {
-      if (((XSDModelAdapterFactoryImpl)adapterFactory).getShowReferences())
-      {
-        type = xsdElementDeclaration.getResolvedElementDeclaration().getTypeDefinition();
-      }
-    }
-    else
-    {
-      type = xsdElementDeclaration.getAnonymousTypeDefinition();
-      if (type == null)
-      {
-        if (((XSDModelAdapterFactoryImpl)adapterFactory).getShowReferences())
-        {
-          type = xsdElementDeclaration.getTypeDefinition();
-        }
-      }
-    }
-
-    if (type != null && type instanceof XSDComplexTypeDefinition)
-    {
-      XSDComplexTypeDefinition ctType = (XSDComplexTypeDefinition)type;
-      if (ctType != null)
-      {
-        list.add(ctType);
-      }
-    }
-
-//    if (xsdElementDeclaration.getIdentityConstraintDefinitions() != null)
-//    {
-//      list.addAll(xsdElementDeclaration.getIdentityConstraintDefinitions());
-//    }
-    
-//    return XSDChildUtility.getModelChildren(xsdElementDeclaration.getResolvedElementDeclaration()).toArray();
-    return list.toArray();
-  
-  }
-  
-  public boolean hasChildren(Object object)
-  {
-    return true;
-  }
-
-  public Object getParent(Object object)
-  {
-    XSDElementDeclaration element = (XSDElementDeclaration)object;
-    return element.getContainer();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelAdapterFactoryImpl.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelAdapterFactoryImpl.java
deleted file mode 100644
index 4b64fce..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelAdapterFactoryImpl.java
+++ /dev/null
@@ -1,359 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.provider.ChangeNotifier;
-import org.eclipse.emf.edit.provider.Disposable;
-import org.eclipse.emf.edit.provider.IChangeNotifier;
-import org.eclipse.emf.edit.provider.IDisposable;
-import org.eclipse.emf.edit.provider.INotifyChangedListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.xsd.XSDAnnotation;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDAdapterFactory;
-import org.eclipse.xsd.util.XSDSwitch;
-
-public class XSDModelAdapterFactoryImpl extends XSDAdapterFactory
-  implements IChangeNotifier, IDisposable
-{
-  static XSDModelAdapterFactoryImpl instance;
-  
-  public static XSDModelAdapterFactoryImpl getInstance()
-  {
-    if (instance == null)
-    {
-      instance = new XSDModelAdapterFactoryImpl();
-    }                                         
-    return instance;
-  }
-  
-  protected IChangeNotifier changeNotifier = new ChangeNotifier();
-  
-  protected Disposable disposable = new Disposable();
-  
-  protected Collection supportedTypes = new ArrayList();
-  
-  protected boolean showReferences = false;
-  protected boolean showInherited = false;
-  
-  /**
-   * 
-   */
-  public XSDModelAdapterFactoryImpl()
-  {
-    super();
-    supportedTypes.add(ILabelProvider.class);
-  }
-
-  public void setShowReferences(boolean b)
-  {
-    showReferences = b;
-  }
-  
-  public boolean getShowReferences()
-  {
-    return showReferences;
-  }
-  
-  public void setShowInherited(boolean b)
-  {
-    showInherited= b;
-  }
-  
-  public boolean getShowInherited()
-  {
-    return showInherited;
-  }
-  
-  protected XSDSwitch modelSwitch = new XSDSwitch()
-  {
-      public Object caseXSDAnnotation(XSDAnnotation object)
-      {
-        return createXSDAnnotationAdapter();
-      }
-      public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration object)
-      {
-        return createXSDAttributeDeclarationAdapter();
-      }
-      public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition object)
-      {
-        return createXSDAttributeGroupDefinitionAdapter();
-      }
-      public Object caseXSDAttributeUse(XSDAttributeUse object)
-      {
-        return createXSDAttributeUseAdapter();
-      }
-      public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object)
-      {
-        return createXSDComplexTypeDefinitionAdapter();
-      }
-      public Object caseXSDElementDeclaration(XSDElementDeclaration object)
-      {
-        return createXSDElementDeclarationAdapter();
-      }
-      public Object caseXSDModelGroup(XSDModelGroup object)
-      {
-        return createXSDModelGroupAdapter();
-      }
-      public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
-      {
-        return createXSDModelGroupDefinitionAdapter();
-      }
-      public Object caseXSDNotationDeclaration(XSDNotationDeclaration object)
-      {
-        return createXSDNotationDeclarationAdapter();
-      }
-      public Object caseXSDParticle(XSDParticle object)
-      {
-        return createXSDParticleAdapter();
-      }
-//      public Object caseXSDParticleContent(XSDParticleContent object)
-//      {
-//        return createXSDParticleContentAdapter();
-//      }
-      public Object caseXSDSchema(XSDSchema object)
-      {
-        return createXSDSchemaAdapter();
-      }
-      public Object caseXSDImport(XSDImport object)
-      {
-        // return createXSDImportAdapter();
-        return createXSDSchemaDirectiveAdapter();
-      }
-      public Object caseXSDInclude(XSDInclude object)
-      {
-        // return createXSDIncludeAdapter();
-        return createXSDSchemaDirectiveAdapter();
-      }
-      public Object caseXSDRedefine(XSDRedefine object)
-      {
-        // return createXSDRedefineAdapter();
-        return createXSDSchemaDirectiveAdapter();
-      }
-      public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object)
-      {
-        return createXSDSimpleTypeDefinitionAdapter();
-      
-      }
-      public Object caseXSDWildcard(XSDWildcard object)
-      {
-        return createXSDWildcardAdapter();
-      }
-      public Object defaultCase(EObject object)
-      {
-        return createEObjectAdapter();
-      }
-  };
-
-  public Adapter createAdapter(Notifier target)
-  {
-    Adapter adapter = null;
-    if (target instanceof EObject)
-    {
-      adapter = (Adapter)modelSwitch.doSwitch((EObject)target);
-    }
-    return adapter;
-  }
-
-  /* create adapters */
-  
-  public Adapter createXSDAnnotationAdapter()
-  {
-    return new XSDAnnotationAdapter(this);
-  }
-
-  public Adapter createXSDAttributeDeclarationAdapter()
-  {
-    return new XSDAttributeDeclarationAdapter(this);
-  }
-
-  public Adapter createXSDAttributeGroupDefinitionAdapter()
-  {
-    return new XSDAttributeGroupDefinitionAdapter(this);
-  }
-
-  public Adapter createXSDAttributeUseAdapter()
-  {
-    return new XSDAttributeUseAdapter(this);
-  }
-
-  public Adapter createXSDComplexTypeDefinitionAdapter()
-  {
-	return new XSDComplexTypeDefinitionAdapter(this); 
-  }
-
-  public Adapter createXSDElementDeclarationAdapter()
-  {
-    return new XSDElementDeclarationAdapter(this);
-  }
-
-  public Adapter createXSDModelGroupAdapter()
-  {
-    return new XSDModelGroupAdapter(this);
-  }
-
-
-  public Adapter createXSDModelGroupDefinitionAdapter()
-  {
-    return new XSDModelGroupDefinitionAdapter(this);
-  }
-
-  public Adapter createXSDNotationDeclarationAdapter()
-  {
-    return new XSDNotationDeclarationAdapter(this);
-  }
-
-  public Adapter createXSDWildcardAdapter()
-  {
-    return new XSDWildcardAdapter(this);
-  }
-  
-  public Adapter createXSDParticleAdapter()
-  {
-    return new XSDParticleAdapter(this);
-  }
-//
-//  protected XSDParticleContentAdapter xsdParticleContentAdapter;
-//  public Adapter createXSDParticleContentAdapter()
-//  {
-//    if (xsdParticleContentAdapter == null)
-//    {
-//      xsdParticleContentAdapter = new XSDParticleContentAdapter(this);
-//    }
-//    return xsdParticleContentAdapter;
-//  }
-
-  public Adapter createXSDSchemaAdapter()
-  {
-    return new XSDSchemaAdapter(this);
-  }
-  
-  public Adapter createXSDSchemaDirectiveAdapter()
-  {
-    return new XSDSchemaDirectiveAdapter(this);
-  }
-
-  public Adapter createXSDSimpleTypeDefinitionAdapter()
-  {
-    return new XSDSimpleTypeDefinitionAdapter(this);
-  }
-
-  public Adapter createEObjectAdapter()
-  {
-    return null;
-  }
-
-  public boolean isFactoryForType(Object type)
-  {
-    return super.isFactoryForType(type) || supportedTypes.contains(type);
-  }
-
-  /**
-   * This implementation substitutes the factory itself as the key for the adapter.
-   */
-  public Adapter adapt(Notifier notifier, Object type)
-  {
-    return super.adapt(notifier, this);
-  }
-
-  public Object adapt(Object object, Object type)
-  {
-    // This is a kludge to deal with enumerators, which crash the doSwitch.
-    //
-    if (object instanceof EObject && ((EObject)object).eClass() == null)
-    {
-      return null;
-    }
-
-    if (isFactoryForType(type))
-    {
-      Object adapter = super.adapt(object, type);
-      if (!(type instanceof Class) || (((Class)type).isInstance(adapter)))
-      {
-        return adapter;
-      }
-    }
-
-    return null;
-  }
-
-  public Adapter adaptNew(Notifier object, Object type)
-  {
-    Adapter result = super.adaptNew(object, type);
-    disposable.add(result);
-    return result;
-  }
-
-  /**
-   * This adds a listener.
-   */
-  public void addListener(INotifyChangedListener notifyChangedListener)
-  {
-    changeNotifier.addListener(notifyChangedListener);
-  }
-
-  /**
-   * This removes a listener.
-   */
-  public void removeListener(INotifyChangedListener notifyChangedListener)
-  {
-    changeNotifier.removeListener(notifyChangedListener);
-  }
-
-  /**
-   * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
-   */
-  public void fireNotifyChanged(Notification notification)
-  {
-    Display display = Display.getDefault();
-    if (display != null)
-    {
-      if (display.getThread() == Thread.currentThread ())
-      {
-        changeNotifier.fireNotifyChanged(notification);
-      }
-    }
-
-//    if (parentAdapterFactory != null)
-//    {
-//      parentAdapterFactory.fireNotifyChanged(notification);
-//    }
-  }
-
-  public void dispose()
-  {
-    instance = null;
-    disposable.dispose();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupAdapter.java
deleted file mode 100644
index c8535b6..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupAdapter.java
+++ /dev/null
@@ -1,162 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.graph.XSDChildUtility;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class XSDModelGroupAdapter extends XSDAbstractAdapter
-{
-
-  /**
-   * @param adapterFactory
-   */
-  public XSDModelGroupAdapter(AdapterFactory adapterFactory)
-  {
-    super(adapterFactory);
-  }
-
-  public Image getImage(Object element)
-  {
-    XSDModelGroup xsdModelGroup = ((XSDModelGroup)element);
-    if (XSDCompositor.CHOICE_LITERAL == xsdModelGroup.getCompositor())
-    {
-      // return XSDEditorPlugin.getPlugin().getIconImage("full/obj16/XSDModelGroupChoice");
-      return XSDEditorPlugin.getXSDImage("icons/XSDChoice.gif");
-    }
-    else if (XSDCompositor.ALL_LITERAL == xsdModelGroup.getCompositor())
-    {
-      // return XSDEditorPlugin.getPlugin().getIconImage("full/obj16/XSDModelGroupAll");
-      return XSDEditorPlugin.getXSDImage("icons/XSDAll.gif");
-    }
-    else 
-    {
-      // return XSDEditorPlugin.getPlugin().getIconImage("full/obj16/XSDModelGroupSequence");
-      return XSDEditorPlugin.getXSDImage("icons/XSDSequence.gif");
-    }
-  }
-  
-  public String getText(Object object)
-  {
-    XSDModelGroup xsdModelGroup = ((XSDModelGroup)object);
-    
-    StringBuffer result = new StringBuffer();
-    String name = xsdModelGroup.getCompositor().getName();
-    if (name != null)
-    {
-      result.append(name);
-    }
-    
-    Element element = xsdModelGroup.getElement();
-    
-    if (element != null)
-    {
-      boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-      boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-      
-      if (hasMinOccurs || hasMaxOccurs)
-      {
-        XSDConcreteComponent comp = xsdModelGroup.getContainer();
-        boolean isParticle = (comp instanceof XSDParticle);
-        if (isParticle)
-        {
-          result.append(" [");
-        }
-  	    if (hasMinOccurs)
-  	    {
-          if (isParticle)
-          {
-  	        int min = ((XSDParticle)comp).getMinOccurs();
-  		      if (min == XSDParticle.UNBOUNDED)
-  		      {
-  		        result.append("*");
-            } 
-  		      else
-  		      {
-  		        result.append(String.valueOf(min));
-            }
-  		    }
-  	    }
-        else // print default
-        {
-          if (isParticle)
-          {
-            int min = ((XSDParticle)comp).getMinOccurs();
-            result.append(String.valueOf(min));
-          }
-        }
-  	    if (hasMaxOccurs)
-  	    {
-          if (isParticle)
-          {
-    	      int max = ((XSDParticle)comp).getMaxOccurs();
-  		      result.append("..");
-  		      if (max == XSDParticle.UNBOUNDED)
-  		      {
-  		        result.append("*");
-  		      }
-  		      else
-  		      {
-  		        result.append(String.valueOf(max));
-            }
-  		    }
-  	    }
-        else // print default
-        {
-          if (isParticle)
-          {
-            result.append("..");
-            int max = ((XSDParticle)comp).getMaxOccurs();
-            result.append(String.valueOf(max));
-          }
-        }
-        if (isParticle)
-        {
-    	    result.append("]");
-        }
-      }
-    }
-    return result.toString();
-  }
-  
-  public Object[] getChildren(Object parentElement)
-  {
-    XSDModelGroup xsdModelGroup = (XSDModelGroup)parentElement;
-    List list = new ArrayList();
-    // list.addAll(xsdModelGroup.getContents());
-    list.addAll(XSDChildUtility.getModelChildren(xsdModelGroup));
-    return list.toArray();
-  }
-  
-  public boolean hasChildren(Object object)
-  {
-    return true;
-  }
-
-  public Object getParent(Object object)
-  {
-    XSDModelGroup element = (XSDModelGroup)object;
-    return element.getContainer();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupDefinitionAdapter.java
deleted file mode 100644
index 93e551c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDModelGroupDefinitionAdapter.java
+++ /dev/null
@@ -1,95 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-
-public class XSDModelGroupDefinitionAdapter extends XSDAbstractAdapter
-{
-
-  /**
-   * @param adapterFactory
-   */
-  public XSDModelGroupDefinitionAdapter(AdapterFactory adapterFactory)
-  {
-    super(adapterFactory);
-  }
-
-  public Image getImage(Object object)
-  {
-    XSDModelGroupDefinition xsdModelGroupDefinition = ((XSDModelGroupDefinition)object);
-
-    if (xsdModelGroupDefinition.isModelGroupDefinitionReference())
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDGroupRef.gif");
-    }
-    else
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDGroup.gif");
-    }
-  }
-  
-  public String getText(Object object)
-  {
-    XSDModelGroupDefinition xsdModelGroupDefinition = ((XSDModelGroupDefinition)object);
-    String result = 
-      xsdModelGroupDefinition.isModelGroupDefinitionReference() ?
-        xsdModelGroupDefinition.getQName() :
-        xsdModelGroupDefinition.getName();
-    return result == null ? "'absent'" : result;
-  }
-  
-  boolean hasChildren = false;
-  
-  public Object[] getChildren(Object parentElement)
-  {
-    XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition)parentElement;
-    List list = new ArrayList();
-    if (xsdModelGroupDefinition.isModelGroupDefinitionReference())
-    {
-      if (((XSDModelAdapterFactoryImpl)adapterFactory).getShowReferences())
-      {
-        list.add(xsdModelGroupDefinition.getResolvedModelGroupDefinition().getModelGroup());
-        hasChildren = true;
-      }
-    }
-    else
-    {
-      if (xsdModelGroupDefinition.getModelGroup() != null)
-      {
-        list.add(xsdModelGroupDefinition.getModelGroup());
-        hasChildren = true;
-      }
-    }
-    
-    return list.toArray();
- 
-  }
-  
-  public boolean hasChildren(Object object)
-  {
-    return hasChildren;
-  }
-
-  public Object getParent(Object object)
-  {
-    XSDModelGroupDefinition element = (XSDModelGroupDefinition)object;
-    return element.getContainer();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDNotationDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDNotationDeclarationAdapter.java
deleted file mode 100644
index 3c89274..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDNotationDeclarationAdapter.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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDNotationDeclaration;
-
-
-public class XSDNotationDeclarationAdapter extends XSDAbstractAdapter
-{
-
-  /**
-   * @param adapterFactory
-   */
-  public XSDNotationDeclarationAdapter(AdapterFactory adapterFactory)
-  {
-    super(adapterFactory);
-  }
-  
-  public Image getImage(Object object)
-  {
-    // return XSDEditorPlugin.getPlugin().getIconImage("full/obj16/XSDNotationDeclaration");
-    return XSDEditorPlugin.getXSDImage("icons/XSDNotation.gif");
-  }
-
-  public String getText(Object object)
-  {
-    XSDNotationDeclaration xsdNotationDeclaration = ((XSDNotationDeclaration)object);
-    String result = xsdNotationDeclaration.getName();
-    return result == null ? "" : result;
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDParticleAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDParticleAdapter.java
deleted file mode 100644
index c37e8a7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDParticleAdapter.java
+++ /dev/null
@@ -1,61 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationWrapper;
-import org.eclipse.wst.xsd.ui.internal.graph.model.XSDModelAdapterFactory;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDWildcard;
-
-
-public class XSDParticleAdapter extends XSDAbstractAdapter
-{
-
-  /**
-   * @param adapterFactory
-   */
-  public XSDParticleAdapter(AdapterFactory adapterFactory)
-  {
-    super(adapterFactory);
-  }
-
-  // hack to notify outline and graph view of minOccurs and maxOccurs changes
-  public void notifyChanged(Notification msg) 
-  {
-    XSDParticle xsdParticle = (XSDParticle)msg.getNotifier();
-    XSDParticleContent xsdParticleContent = xsdParticle.getContent();
-    if (xsdParticleContent != null)
-    {
-      if (xsdParticleContent instanceof XSDElementDeclaration)
-      {
-        fireNotifyChanged(new NotificationWrapper((XSDElementDeclaration)xsdParticleContent, msg));
-        XSDModelAdapterFactory.getAdapter(xsdParticleContent).firePropertyChanged(xsdParticleContent, null);
-      }
-      else if (xsdParticleContent instanceof XSDModelGroup)
-      {
-        fireNotifyChanged(new NotificationWrapper((XSDModelGroup)xsdParticleContent, msg));
-        XSDModelAdapterFactory.getAdapter(xsdParticleContent).firePropertyChanged(xsdParticleContent, null);
-      }
-      else if (xsdParticleContent instanceof XSDWildcard)
-      {
-        fireNotifyChanged(new NotificationWrapper((XSDWildcard)xsdParticleContent, msg));
-        XSDModelAdapterFactory.getAdapter(xsdParticleContent).firePropertyChanged(xsdParticleContent, null);
-      }
-    }
-    // super.notifyChanged(msg);
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaAdapter.java
deleted file mode 100644
index 4836bc7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaAdapter.java
+++ /dev/null
@@ -1,379 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.NotificationImpl;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDPackage;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class XSDSchemaAdapter extends XSDAbstractAdapter {
-	protected XSDPackage xsdPackage;
-
-	/**
-	 * @param adapterFactory
-	 */
-	public XSDSchemaAdapter(AdapterFactory adapterFactory) {
-		super(adapterFactory);
-		xsdPackage = XSDPackage.eINSTANCE;
-	}
-
-	public Image getImage(Object element) {
-		return XSDEditorPlugin.getXSDImage("icons/XSDFile.gif");
-	}
-
-	public String getText(Object element) {
-		XSDSchema xsdSchema = (XSDSchema) element;
-		String result = xsdSchema.getSchemaLocation();
-		if (result == null) {
-			return "";
-		}
-		else {
-			return URI.createURI(result).lastSegment();
-		}
-	}
-
-	List children;
-	private CategoryAdapter fDirectivesCategory;
-	private CategoryAdapter fElementsCategory;
-	private CategoryAdapter fAttributesCategory;
-	private CategoryAdapter fAttributeGroupsCategory;
-	private CategoryAdapter fTypesCategory;
-	private CategoryAdapter fGroupsCategory;
-	private CategoryAdapter fNotationsCategory;
-
-	/**
-	 * Create all the category adapters
-	 * 
-	 * @param xsdSchema
-	 */
-	private void createCategoryAdapters(XSDSchema xsdSchema) {
-		List directivesList = getDirectives(xsdSchema);
-		List elementsList = getGlobalElements(xsdSchema);
-		List attributeGroupList = getAttributeGroupList(xsdSchema);
-		List attributesList = getAttributeList(xsdSchema);
-		List groups = getGroups(xsdSchema);
-		List notations = getNotations(xsdSchema);
-		List types = getComplexTypes(xsdSchema);
-		types.addAll(getSimpleTypes(xsdSchema));
-
-		fDirectivesCategory = new CategoryAdapter( // XSDEditPlugin.getString("_UI_Elements_label"),
-					XSDEditorPlugin.getXSDString("_UI_GRAPH_DIRECTIVES"), XSDEditorPlugin.getPlugin().getIconImage("obj16/directivesheader"), directivesList, xsdSchema, CategoryAdapter.DIRECTIVES);
-		fElementsCategory = new CategoryAdapter( // XSDEditPlugin.getString("_UI_Elements_label"),
-					XSDEditorPlugin.getXSDString("_UI_GRAPH_ELEMENTS"), XSDEditorPlugin.getPlugin().getIconImage("obj16/elementsheader"), elementsList, xsdSchema, CategoryAdapter.ELEMENTS);
-		fAttributesCategory = new CategoryAdapter( // XSDEditPlugin.getString("_UI_Attributes_label"),
-					XSDEditorPlugin.getXSDString("_UI_GRAPH_ATTRIBUTES"), XSDEditorPlugin.getPlugin().getIconImage("obj16/attributesheader"), attributesList, xsdSchema, CategoryAdapter.ATTRIBUTES);
-		fAttributeGroupsCategory = new CategoryAdapter(// XSDEditPlugin.getString("_UI_AttributeGroups_label"),
-					XSDEditorPlugin.getXSDString("_UI_GRAPH_ATTRIBUTE_GROUPS"), XSDEditorPlugin.getPlugin().getIconImage("obj16/attributegroupsheader"), attributeGroupList, xsdSchema, CategoryAdapter.ATTRIBUTE_GROUPS);
-		fTypesCategory = new CategoryAdapter( // XSDEditPlugin.getString("_UI_Types_label"),
-					XSDEditorPlugin.getXSDString("_UI_GRAPH_TYPES"), XSDEditorPlugin.getPlugin().getIconImage("obj16/typesheader"), types, xsdSchema, CategoryAdapter.TYPES);
-		fGroupsCategory = new CategoryAdapter( // XSDEditPlugin.getString("_UI_ModelGroups_label"),
-					XSDEditorPlugin.getXSDString("_UI_GRAPH_GROUPS"), XSDEditorPlugin.getPlugin().getIconImage("obj16/groupsheader"), groups, xsdSchema, CategoryAdapter.GROUPS);
-		fNotationsCategory = new CategoryAdapter( // XSDEditPlugin.getString("_UI_Notations_label"),
-					XSDEditorPlugin.getXSDString("_UI_GRAPH_NOTATIONS"), XSDEditorPlugin.getPlugin().getIconImage("obj16/notationsheader"), notations, xsdSchema, CategoryAdapter.NOTATIONS);
-	}
-
-	public void setTarget(Notifier newTarget) {
-		super.setTarget(newTarget);
-
-		XSDSchema xsdSchema = ((XSDSchema) newTarget);
-		createCategoryAdapters(xsdSchema);
-	}
-
-	public Object[] getChildren(Object parentElement) {
-		XSDSchema xsdSchema = ((XSDSchema) parentElement);
-
-		children = new ArrayList();
-
-		// just set categoryadapters' children if category adapters are
-		// already created
-		if (fDirectivesCategory != null) {
-			List directivesList = getDirectives(xsdSchema);
-			List elementsList = getGlobalElements(xsdSchema);
-			List attributeGroupList = getAttributeGroupList(xsdSchema);
-			List attributesList = getAttributeList(xsdSchema);
-			List groups = getGroups(xsdSchema);
-			List notations = getNotations(xsdSchema);
-			List types = getComplexTypes(xsdSchema);
-			types.addAll(getSimpleTypes(xsdSchema));
-
-			fDirectivesCategory.setChildren(directivesList);
-			fElementsCategory.setChildren(elementsList);
-			fAttributesCategory.setChildren(attributesList);
-			fAttributeGroupsCategory.setChildren(attributeGroupList);
-			fTypesCategory.setChildren(types);
-			fGroupsCategory.setChildren(groups);
-			fNotationsCategory.setChildren(notations);
-
-			// children.add
-			// (new CategoryAdapter
-			// ( //XSDEditPlugin.getString("_UI_IdentityConstraints_label"),
-			// "Identity Constraints",
-			// XSDEditorPlugin.getPlugin().getIconImage("full/obj16/XSDIdentityConstraintDefinitionKey"),
-			// xsdSchema.getIdentityConstraintDefinitions(), xsdSchema,
-			// CategoryAdapter.IDENTITY_CONSTRAINTS));
-			// children.add
-			// (new CategoryAdapter
-			// ( // XSDEditPlugin.getString("_UI_Annotations_label"),
-			// "Annotations",
-			// XSDEditorPlugin.getPlugin().getIconImage("obj16/annotationsheader"),
-			// xsdSchema.getAnnotations(), xsdSchema,
-			// CategoryAdapter.ANNOTATIONS));
-		}
-		else {
-			createCategoryAdapters(xsdSchema);
-		}
-
-		children.add(fDirectivesCategory);
-		children.add(fElementsCategory);
-		children.add(fAttributesCategory);
-		children.add(fAttributeGroupsCategory);
-		children.add(fTypesCategory);
-		children.add(fGroupsCategory);
-		children.add(fNotationsCategory);
-
-		return children.toArray();
-	}
-
-	public boolean hasChildren(Object object) {
-		return true;
-	}
-
-	public Object getParent(Object object) {
-		return null;
-	}
-
-	public void notifyChanged(final Notification msg) {
-		class CategoryNotification extends NotificationImpl {
-			protected Object category;
-
-			public CategoryNotification(Object category) {
-				super(msg.getEventType(), msg.getOldValue(), msg.getNewValue(), msg.getPosition());
-				this.category = category;
-			}
-
-			public Object getNotifier() {
-				return category;
-			}
-
-			public Object getFeature() {
-				return msg.getFeature();
-			}
-		}
-
-		if (children == null) {
-			getChildren(target);
-		}
-
-		if (msg.getFeature() == xsdPackage.getXSDSchema_Contents()) {
-			CategoryAdapter adapter = (CategoryAdapter) children.get(0);
-			XSDSchema xsdSchema = adapter.getXSDSchema();
-			adapter.setChildren(getDirectives(xsdSchema));
-			this.fireNotifyChanged(new CategoryNotification(adapter));
-			return;
-		}
-		else if (msg.getFeature() == xsdPackage.getXSDSchema_ElementDeclarations()) {
-			CategoryAdapter adapter = (CategoryAdapter) children.get(1);
-			XSDSchema xsdSchema = adapter.getXSDSchema();
-			adapter.setChildren(getGlobalElements(xsdSchema));
-			this.fireNotifyChanged(new CategoryNotification(adapter));
-			return;
-		}
-		else if (msg.getFeature() == xsdPackage.getXSDSchema_AttributeDeclarations()) {
-			CategoryAdapter adapter = (CategoryAdapter) children.get(2);
-			XSDSchema xsdSchema = adapter.getXSDSchema();
-			adapter.setChildren(getAttributeList(xsdSchema));
-			this.fireNotifyChanged(new CategoryNotification(adapter));
-			return;
-		}
-		else if (msg.getFeature() == xsdPackage.getXSDSchema_AttributeGroupDefinitions()) {
-			CategoryAdapter adapter = (CategoryAdapter) children.get(3);
-			XSDSchema xsdSchema = adapter.getXSDSchema();
-			adapter.setChildren(getAttributeGroupList(xsdSchema));
-			this.fireNotifyChanged(new CategoryNotification(adapter));
-			return;
-		}
-		else if (msg.getFeature() == xsdPackage.getXSDSchema_TypeDefinitions()) {
-			CategoryAdapter adapter = (CategoryAdapter) children.get(4);
-			XSDSchema xsdSchema = adapter.getXSDSchema();
-			List types = getComplexTypes(xsdSchema);
-			types.addAll(getSimpleTypes(xsdSchema));
-
-			adapter.setChildren(types);
-			this.fireNotifyChanged(new CategoryNotification(adapter));
-			return;
-		}
-		else if (msg.getFeature() == xsdPackage.getXSDSchema_ModelGroupDefinitions()) {
-			CategoryAdapter adapter = (CategoryAdapter) children.get(5);
-			XSDSchema xsdSchema = adapter.getXSDSchema();
-			adapter.setChildren(getGroups(xsdSchema));
-			this.fireNotifyChanged(new CategoryNotification(adapter));
-			return;
-		}
-		else if (msg.getFeature() == xsdPackage.getXSDSchema_NotationDeclarations()) {
-			CategoryAdapter adapter = (CategoryAdapter) children.get(6);
-			XSDSchema xsdSchema = adapter.getXSDSchema();
-			adapter.setChildren(getNotations(xsdSchema));
-			this.fireNotifyChanged(new CategoryNotification(adapter));
-			return;
-		}
-		// else if (msg.getFeature() ==
-		// xsdPackage.getXSDSchema_IdentityConstraintDefinitions())
-		// {
-		// this.fireNotifyChanged(new CategoryNotification(children.get(7)));
-		// return;
-		// }
-		else if (msg.getFeature() == xsdPackage.getXSDSchema_Annotations()) {
-			// this.fireNotifyChanged(new
-			// CategoryNotification(children.get(7)));
-			return;
-		}
-		else if (msg.getFeature() == xsdPackage.getXSDSchema_SchemaLocation()) {
-			this.fireNotifyChanged(msg);
-			return;
-		}
-
-		super.notifyChanged(msg);
-	}
-
-	protected List getDirectives(XSDSchema schema) {
-		List list = new ArrayList();
-		for (Iterator i = schema.getContents().iterator(); i.hasNext();) {
-			Object o = i.next();
-			if (o instanceof XSDSchemaDirective) {
-				list.add(o);
-			}
-		}
-		return list;
-	}
-
-	protected List getAttributeGroupList(XSDSchema xsdSchema) {
-		List attributeGroupList = new ArrayList();
-		for (Iterator i = xsdSchema.getAttributeGroupDefinitions().iterator(); i.hasNext();) {
-			XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) i.next();
-			if (attrGroup.getRootContainer() == xsdSchema) {
-				attributeGroupList.add(attrGroup);
-			}
-		}
-		return attributeGroupList;
-	}
-
-	protected List getAttributeList(XSDSchema xsdSchema) {
-		List attributesList = new ArrayList();
-		for (Iterator iter = xsdSchema.getAttributeDeclarations().iterator(); iter.hasNext();) {
-			Object o = iter.next();
-			if (o instanceof XSDAttributeDeclaration) {
-				XSDAttributeDeclaration attr = (XSDAttributeDeclaration) o;
-				if (attr != null) {
-					if (attr.getTargetNamespace() != null) {
-						if (!(attr.getTargetNamespace().equals("http://www.w3.org/2001/XMLSchema-instance"))) {
-							if (attr.getRootContainer() == xsdSchema) {
-								attributesList.add(attr);
-							}
-						}
-					}
-					else {
-						if (attr.getRootContainer() == xsdSchema) {
-							attributesList.add(attr);
-						}
-					}
-				}
-			}
-		}
-		return attributesList;
-	}
-
-	protected List getGlobalElements(XSDSchema schema) {
-		List elements = schema.getElementDeclarations();
-		List list = new ArrayList();
-		for (Iterator i = elements.iterator(); i.hasNext();) {
-			XSDElementDeclaration elem = (XSDElementDeclaration) i.next();
-			if (elem.getRootContainer() == schema) {
-				list.add(elem);
-			}
-		}
-		return list;
-	}
-
-	protected List getComplexTypes(XSDSchema schema) {
-		List allTypes = schema.getTypeDefinitions();
-		List list = new ArrayList();
-		for (Iterator i = allTypes.iterator(); i.hasNext();) {
-			XSDTypeDefinition td = (XSDTypeDefinition) i.next();
-			if (td instanceof XSDComplexTypeDefinition) {
-				XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition) td;
-				if (ct.getRootContainer() == schema) {
-					list.add(ct);
-				}
-			}
-		}
-		return list;
-	}
-
-	protected List getSimpleTypes(XSDSchema schema) {
-		List allTypes = schema.getTypeDefinitions();
-		List list = new ArrayList();
-		for (Iterator i = allTypes.iterator(); i.hasNext();) {
-			XSDTypeDefinition td = (XSDTypeDefinition) i.next();
-			if (td instanceof XSDSimpleTypeDefinition) {
-				XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) td;
-				if (st.getRootContainer() == schema) {
-					list.add(st);
-				}
-			}
-		}
-		return list;
-	}
-
-	protected List getGroups(XSDSchema schema) {
-		List groups = schema.getModelGroupDefinitions();
-		List list = new ArrayList();
-		for (Iterator i = groups.iterator(); i.hasNext();) {
-			XSDModelGroupDefinition group = (XSDModelGroupDefinition) i.next();
-			if (group.getRootContainer() == schema) {
-				list.add(group);
-			}
-		}
-		return list;
-	}
-
-	protected List getNotations(XSDSchema schema) {
-		List notations = schema.getNotationDeclarations();
-		List list = new ArrayList();
-		for (Iterator i = notations.iterator(); i.hasNext();) {
-			XSDNotationDeclaration notation = (XSDNotationDeclaration) i.next();
-			if (notation.getRootContainer() == schema) {
-				list.add(notation);
-			}
-		}
-		return list;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaDirectiveAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaDirectiveAdapter.java
deleted file mode 100644
index 47cf912..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSchemaDirectiveAdapter.java
+++ /dev/null
@@ -1,102 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchemaDirective;
-
-public class XSDSchemaDirectiveAdapter extends XSDAbstractAdapter
-{
-
-  /**
-   * @param adapterFactory
-   */
-  public XSDSchemaDirectiveAdapter(AdapterFactory adapterFactory)
-  {
-    super(adapterFactory);
-  }
-
-  
-  public Image getImage(Object object)
-  {
-    if (object instanceof XSDImport)
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDImport.gif");
-    }
-    else if (object instanceof XSDInclude)
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDInclude.gif");
-    }
-    else if (object instanceof XSDRedefine)
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDRedefine.gif");
-    }
-    return null;
-  }
-
-  public String getText(Object object)
-  {
-    XSDSchemaDirective directive = (XSDSchemaDirective)object;
-    String result = directive.getSchemaLocation();
-    if (result == null) result = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED") + ")";
-    if (result.equals("")) result = "(" + XSDEditorPlugin.getXSDString("_UI_LABEL_NO_LOCATION_SPECIFIED")+ ")";
-    return result;
-    
-//    XSDImport xsdImport = ((XSDImport)object);
-//    String result = xsdImport.getSchemaLocation();
-//    return result == null ? "" : result;
-    
-//    XSDInclude xsdInclude = ((XSDInclude)object);
-//    String result = xsdInclude.getSchemaLocation();
-//    return result == null ? "" : result;
-    
-//    XSDRedefine xsdRedefine = ((XSDRedefine)object);
-//    String result = xsdRedefine.getSchemaLocation();
-//    return result == null ? "" : result;
-
-
-  }
-
-  public Object[] getChildren(Object parentElement)
-  {
-    List list = new ArrayList();
-    if (parentElement instanceof XSDRedefine)
-    {
-      XSDRedefine redefine = (XSDRedefine)parentElement;
-      list = redefine.getContents();
-      if (list == null)
-      {
-        list = new ArrayList();
-      }
-    }
-    return list.toArray();
-  }
-  
-  public boolean hasChildren(Object object)
-  {
-    return false;
-  }
-
-  public Object getParent(Object object)
-  {
-    return null;
-    
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSimpleTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSimpleTypeDefinitionAdapter.java
deleted file mode 100644
index 299bd3f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDSimpleTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,188 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class XSDSimpleTypeDefinitionAdapter extends XSDAbstractAdapter
-{
-
-  /**
-   * @param adapterFactory
-   */
-  public XSDSimpleTypeDefinitionAdapter(AdapterFactory adapterFactory)
-  {
-    super(adapterFactory);
-  }
-
-  public Image getImage(Object object)
-  {
-    XSDSimpleTypeDefinition xsdSimpleTypeDefinition = ((XSDSimpleTypeDefinition)object);
-    
-    if (xsdSimpleTypeDefinition.getContainer() == null)
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
-    }
-    
-    if (XSDVariety.LIST_LITERAL == xsdSimpleTypeDefinition.getVariety())
-    {
-      // return XSDEditorPlugin.getXSDImage("icons/XSDSimpleList.gif");
-      return XSDEditorPlugin.getPlugin().getIconImage("obj16/smpl_list_obj");
-    }
-    else if (XSDVariety.UNION_LITERAL == xsdSimpleTypeDefinition.getVariety())
-    {
-      //return XSDEditorPlugin.getXSDImage("icons/XSDSimpleUnion.gif");
-      return XSDEditorPlugin.getPlugin().getIconImage("obj16/smpl_union_obj");
-    }
-    else if (XSDVariety.ATOMIC_LITERAL == xsdSimpleTypeDefinition.getVariety())
-    {
-      // return XSDEditorPlugin.getXSDImage("icons/XSDSimpleRestrict.gif");
-      Element stElement = xsdSimpleTypeDefinition.getElement();
-      XSDDOMHelper domHelper = new XSDDOMHelper();
-      if (domHelper.getChildNode(stElement, XSDConstants.RESTRICTION_ELEMENT_TAG) != null)
-      {
-        return XSDEditorPlugin.getPlugin().getIconImage("obj16/smpl_restrict_obj");
-      }
-      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
-    }
-    else if (xsdSimpleTypeDefinition.isSetVariety())
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
-    }
-    else
-    {
-      return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
-    }
-    
-//    return 
-//      XSDEditorPlugin.getPlugin().getIconImage
-//        (xsdSimpleTypeDefinition.getContainer() == null ?
-//           "full/obj16/XSDSimpleTypeDefinitionUnresolved" :
-//           XSDVariety.LIST_LITERAL == xsdSimpleTypeDefinition.getVariety() ? 
-//             "full/obj16/XSDSimpleTypeDefinitionList" :  
-//              XSDVariety.UNION_LITERAL == xsdSimpleTypeDefinition.getVariety() ? 
-//                "full/obj16/XSDSimpleTypeDefinitionUnion" :
-//                  xsdSimpleTypeDefinition.isSetVariety() ?
-//                    "full/obj16/XSDSimpleTypeDefinitionAtomic"  :
-//                    "full/obj16/XSDSimpleTypeDefinition");
-  }
-  
-  public String getText(Object object)
-  {
-    return getText(object, true);
-  }
- 
-  public String getText(Object object, boolean showType)
-  {
-    XSDSimpleTypeDefinition xsdSimpleTypeDefinition = ((XSDSimpleTypeDefinition)object);
-
-    StringBuffer result = new StringBuffer();
-
-    result.append
-      (xsdSimpleTypeDefinition.getName() == null ? 
-         // xsdSimpleTypeDefinition.getAliasName() :
-         "local type" :
-         xsdSimpleTypeDefinition.getName());
-
-    if (showType)
-    {
-      XSDSimpleTypeDefinition baseTypeDefinition = xsdSimpleTypeDefinition.getBaseTypeDefinition();
-      if (baseTypeDefinition != null && XSDVariety.ATOMIC_LITERAL == xsdSimpleTypeDefinition.getVariety())
-      {
-        if (baseTypeDefinition.getName() != null && 
-              !xsdSimpleTypeDefinition.getContents().contains(baseTypeDefinition) &&
-              !XSDConstants.isAnySimpleType(baseTypeDefinition)) 
-        {
-          result.append(" : ");
-          result.append(baseTypeDefinition.getQName(xsdSimpleTypeDefinition));
-        }
-      }
-      else
-      {
-        XSDSimpleTypeDefinition itemTypeDefinition = xsdSimpleTypeDefinition.getItemTypeDefinition();
-        if (itemTypeDefinition != null)
-        {
-          if (itemTypeDefinition.getName() != null) 
-          {
-            result.append(" : ");
-            result.append(itemTypeDefinition.getQName(xsdSimpleTypeDefinition));
-          }
-        }
-        else 
-        {
-          List memberTypeDefinitions = xsdSimpleTypeDefinition.getMemberTypeDefinitions();
-          if (!memberTypeDefinitions.isEmpty())
-          {
-            boolean first = true;
-            for (Iterator members = memberTypeDefinitions.iterator(); members.hasNext(); )
-            {
-              XSDSimpleTypeDefinition memberTypeDefinition = (XSDSimpleTypeDefinition)members.next();
-              if (memberTypeDefinition.getName() != null) 
-              {
-                if (first)
-                {
-                  result.append(" : ");
-                  first = false;
-                }
-                else
-                {
-                  result.append(" | ");
-                }
-                result.append(memberTypeDefinition.getQName(xsdSimpleTypeDefinition));
-              }
-              else
-              {
-                break;
-              }
-            }
-          } 
-          else if (result.length() == 0)
-          {
-            result.append("'absent'");
-          }
-        }
-      }
-    }
-
-    return result.toString();
-  }
-
-  public Object[] getChildren(Object parentElement)
-  {
-    List list = new ArrayList();
-    return list.toArray();
-  
-  }
-  
-  public boolean hasChildren(Object object)
-  {
-    return true;
-  }
-
-  public Object getParent(Object object)
-  {
-    XSDSimpleTypeDefinition element = (XSDSimpleTypeDefinition)object;
-    return element.getContainer();
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDWildcardAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDWildcardAdapter.java
deleted file mode 100644
index b219f6b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDWildcardAdapter.java
+++ /dev/null
@@ -1,112 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.provider;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class XSDWildcardAdapter extends XSDAbstractAdapter
-{
-
-  /**
-   * @param adapterFactory
-   */
-  public XSDWildcardAdapter(AdapterFactory adapterFactory)
-  {
-    super(adapterFactory);
-  }
-
-  public Image getImage(Object object)
-  {
-    XSDWildcard xsdWildcard = (XSDWildcard)object;
-    return XSDEditorPlugin.getXSDImage
-      (xsdWildcard.eContainer() instanceof XSDParticle ?
-        "icons/XSDAny.gif" :
-        "icons/XSDAnyAttribute.gif");
-  }
-  
-  public String getText(Object object)
-  {
-    XSDWildcard xsdWildcard = ((XSDWildcard)object);
-    
-    StringBuffer result = new StringBuffer();
-    Element element = xsdWildcard.getElement();
-    
-    if (element != null)
-    {
-      result.append(element.getNodeName());
-      boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-      boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-      
-      if (hasMinOccurs || hasMaxOccurs)
-      {
-        result.append(" [");   //$NON-NLS-1$
-        if (hasMinOccurs)
-        {
-          
-          int min = ((XSDParticle)xsdWildcard.getContainer()).getMinOccurs();
-          if (min == XSDParticle.UNBOUNDED)
-          {
-            result.append("*");
-          }
-          else
-          {
-            result.append(String.valueOf(min));
-          }
-        }
-        else // print default
-        {
-          int min = ((XSDParticle)xsdWildcard.getContainer()).getMinOccurs();
-          result.append(String.valueOf(min));
-        }
-        if (hasMaxOccurs)
-        {
-          int max = ((XSDParticle)xsdWildcard.getContainer()).getMaxOccurs();
-          result.append("..");
-          if (max == XSDParticle.UNBOUNDED)
-          {
-            result.append("*");
-          }
-          else
-          {
-            result.append(String.valueOf(max));
-          }
-        }
-        else // print default
-        {
-          result.append("..");
-          int max = ((XSDParticle)xsdWildcard.getContainer()).getMaxOccurs();
-          result.append(String.valueOf(max));
-        }
-        result.append("]");
-      }
-    }
-    return result.toString();
-
-  }
-
-  public boolean hasChildren(Object object)
-  {
-    return false;
-  }
-
-  public Object getParent(Object object)
-  {
-    XSDWildcard xsdWildcard = (XSDWildcard)object;
-    return xsdWildcard.getContainer();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java
deleted file mode 100644
index 7b56d8d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java
+++ /dev/null
@@ -1,49 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class RefactoringMessages {
-
-	private static final String RESOURCE_BUNDLE= "org.eclipse.wst.xsd.ui.internal.refactor.messages";//$NON-NLS-1$
-
-	private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
-	private RefactoringMessages() {
-	}
-
-	public static String getString(String key) {
-		try {
-			return fgResourceBundle.getString(key);
-		} catch (MissingResourceException e) {
-			return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
-		}
-	}
-	
-	public static String[] getStrings(String keys[]) {
-		String[] result= new String[keys.length];
-		for (int i= 0; i < keys.length; i++) {
-			result[i]= getString(keys[i]);
-		}
-		return result;
-	}
-	
-	public static String getFormattedString(String key, Object arg) {
-		return getFormattedString(key, new Object[] { arg });
-	}
-	
-	public static String getFormattedString(String key, Object[] args) {
-		return MessageFormat.format(getString(key), args);	
-	}	
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/XSDVisitor.java
deleted file mode 100644
index 24bda3f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/XSDVisitor.java
+++ /dev/null
@@ -1,217 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor;
-
-import java.util.Iterator;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDVisitor
-{
-  public XSDVisitor()
-  {
-  }
-  
-  protected XSDSchema schema;
-  
-  public void visitSchema(XSDSchema schema)
-  {
-    this.schema = schema;
-    for (Iterator iterator = schema.getAttributeDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDAttributeDeclaration attr = (XSDAttributeDeclaration) iterator.next();
-      visitAttributeDeclaration(attr);
-    }
-    for (Iterator iterator = schema.getTypeDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDTypeDefinition type = (XSDTypeDefinition) iterator.next();
-      visitTypeDefinition(type);
-    }
-    for (Iterator iterator = schema.getElementDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDElementDeclaration element = (XSDElementDeclaration) iterator.next();
-      visitElementDeclaration(element);
-    }
-    for (Iterator iterator = schema.getIdentityConstraintDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDIdentityConstraintDefinition identityConstraint = (XSDIdentityConstraintDefinition) iterator.next();
-      visitIdentityConstraintDefinition(identityConstraint);
-    }
-    for (Iterator iterator = schema.getModelGroupDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) iterator.next();
-      visitModelGroupDefinition(modelGroup);
-    }
-    for (Iterator iterator = schema.getAttributeGroupDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDAttributeGroupDefinition attributeGroup = (XSDAttributeGroupDefinition) iterator.next();
-      visitAttributeGroupDefinition(attributeGroup);
-    }
-    for (Iterator iterator = schema.getNotationDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDNotationDeclaration element = (XSDNotationDeclaration) iterator.next();
-      visitNotationDeclaration(element);
-    }
-    
-  }
-  
-  public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
-  {
-  }
-  
-  public void visitTypeDefinition(XSDTypeDefinition type)
-  {
-    if (type instanceof XSDSimpleTypeDefinition)
-    {
-      visitSimpleTypeDefinition((XSDSimpleTypeDefinition)type);
-    }
-    else if (type instanceof XSDComplexTypeDefinition)
-    {
-      visitComplexTypeDefinition((XSDComplexTypeDefinition)type);
-    }
-  }
-  
-  public void visitElementDeclaration(XSDElementDeclaration element)
-  {
-    if (element.isElementDeclarationReference())
-    {
-    }
-    else if (element.getAnonymousTypeDefinition() != null)
-    {
-      visitTypeDefinition(element.getAnonymousTypeDefinition());
-    }
-  }
-  
-  public void visitIdentityConstraintDefinition(XSDIdentityConstraintDefinition identityConstraint)
-  {
-  }
-  
-  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
-  {
-    if (!modelGroupDef.isModelGroupDefinitionReference())
-    {
-      if (modelGroupDef.getModelGroup() != null)
-      {
-        visitModelGroup(modelGroupDef.getModelGroup());
-      }
-    }
-  }
-  
-  public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
-  {
-    if (attributeGroup.getAttributeUses() != null)
-    {
-      for (Iterator iter = attributeGroup.getAttributeUses().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeUse attrUse = (XSDAttributeUse)iter.next();
-        visitAttributeDeclaration(attrUse.getContent());
-      }
-    }
-  }
-  
-  public void visitNotationDeclaration(XSDNotationDeclaration notation)
-  {
-  }
-  
-  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
-  {
-  }
-  
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    if (type.getContentType() != null)
-    {
-      XSDComplexTypeContent complexContent = (XSDComplexTypeContent) type.getContentType();
-      if (complexContent instanceof XSDSimpleTypeDefinition)
-      {
-        visitSimpleTypeDefinition((XSDSimpleTypeDefinition)complexContent);
-      }
-      else if (complexContent instanceof XSDParticle)
-      {
-        visitParticle((XSDParticle) complexContent);
-      }
-    }
-    
-    if (type.getAttributeContents() != null)
-    {
-      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)iter.next();
-        if (attrGroupContent instanceof XSDAttributeUse)
-        {
-          XSDAttributeUse attrUse = (XSDAttributeUse)attrGroupContent;
-          visitAttributeDeclaration(attrUse.getContent());
-        }
-        else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
-        {
-          visitAttributeGroupDefinition((XSDAttributeGroupDefinition)attrGroupContent);
-        }
-      }
-    }
-  }
-  
-  public void visitParticle(XSDParticle particle)
-  {
-    visitParticleContent(particle.getContent());
-  }
-  
-  public void visitParticleContent(XSDParticleContent particleContent)
-  {
-    if (particleContent instanceof XSDModelGroupDefinition)
-    {
-      visitModelGroupDefinition((XSDModelGroupDefinition) particleContent);
-    }
-    else if (particleContent instanceof XSDModelGroup)
-    {
-      visitModelGroup((XSDModelGroup)particleContent);
-    }
-    else if (particleContent instanceof XSDElementDeclaration)
-    {
-      visitElementDeclaration((XSDElementDeclaration)particleContent);
-    }
-    else if (particleContent instanceof XSDWildcard)
-    {
-      visitWildcard((XSDWildcard)particleContent);
-    }
-  }
-  
-  public void visitModelGroup(XSDModelGroup modelGroup)
-  {
-    if (modelGroup.getContents() != null)
-    {
-      for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
-      {
-        XSDParticle particle = (XSDParticle) iterator.next();
-        visitParticle(particle);
-      }
-    }
-  }
-  
-  public void visitWildcard(XSDWildcard wildcard)
-  {
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
deleted file mode 100644
index 6404b3d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
+++ /dev/null
@@ -1,162 +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.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.commands.MakeAnonymousTypeGlobalCommand;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameRefactoringWizard;
-import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeTypeGlobalProcessor;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.w3c.dom.Node;
-
-public class MakeAnonymousTypeGlobalAction extends SelectionDispatchAction {
-
-	private String fParentName;
-	private boolean isComplexType = true;
-	private XSDTypeDefinition fSelectedComponent;
-	
-	public MakeAnonymousTypeGlobalAction(ISelectionProvider selectionProvider, XSDSchema schema) {
-		super(selectionProvider);
-		setText(XSDEditorPlugin.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL")); //$NON-NLS-1$
-		setSchema(schema);
-	}
-	
-	public boolean canRun() {
-
-		return fSelectedComponent != null;
-	}
-	
-
-	private String getNewDefaultName(){
-		if(fParentName != null && !"".equals(fParentName)){
-			if(isComplexType){
-				return fParentName + "ComplexType";
-			}
-			else{
-				return fParentName + "SimpleType";
-			}
-		}
-		else{
-			if(isComplexType){
-				return "NewComplexType";
-			}
-			else{
-				return "NewSimpleType";
-			}
-		}
-		
-	}
-	private boolean canEnable(XSDConcreteComponent xsdComponent){
-		if (xsdComponent instanceof XSDComplexTypeDefinition) {
-			fSelectedComponent = (XSDComplexTypeDefinition)xsdComponent;
-			isComplexType = true;
-			XSDComplexTypeDefinition typeDef = (XSDComplexTypeDefinition) xsdComponent;
-			XSDConcreteComponent parent = typeDef.getContainer();
-			if(parent instanceof XSDElementDeclaration){
-				fParentName = ((XSDElementDeclaration)parent).getName();
-				return true;
-			}
-		} 
-		else if (xsdComponent instanceof XSDSimpleTypeDefinition){
-			fSelectedComponent = (XSDSimpleTypeDefinition)xsdComponent;
-			isComplexType = false;
-			XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) xsdComponent;
-			XSDConcreteComponent parent = typeDef.getContainer();
-			if(parent instanceof XSDElementDeclaration){
-				fParentName = ((XSDElementDeclaration)parent).getName();
-				return true;
-			}
-			else if(parent instanceof XSDAttributeDeclaration){
-				fParentName = ((XSDAttributeDeclaration)parent).getName();
-				return true;
-			}
-			
-		}
-		return false;
-	}
-
-	protected boolean canEnable(Object selectedObject) {
-		
-		if (selectedObject instanceof XSDConcreteComponent) {
-			return canEnable((XSDConcreteComponent)selectedObject);
-		}
-		else if (selectedObject instanceof Node) {
-			Node node = (Node) selectedObject;
-			XSDSchema xsdSchema = getSchema();
-			if (xsdSchema != null)
-			{
-			  XSDConcreteComponent concreteComponent = xsdSchema.getCorrespondingComponent(node);
-		  	return canEnable(concreteComponent);
-			}
-		}
-		return false;
-		
-	}
-
-	public void run1() {
-		
-		if(fSelectedComponent == null){
-			return;
-		}
-		
-		if(fSelectedComponent.getSchema() == null){
-			getSchema().updateElement(true);
-		}
-		MakeTypeGlobalProcessor processor = new MakeTypeGlobalProcessor(fSelectedComponent, getNewDefaultName());
-		RenameRefactoring refactoring = new RenameRefactoring(processor);
-		try {
-			RefactoringWizard wizard = new RenameRefactoringWizard(
-					refactoring,
-					RefactoringMessages.getString("RenameComponentWizard.defaultPageTitle"), //$NON-NLS-1$ TODO: provide correct strings
-					RefactoringMessages.getString("RenameComponentWizard.inputPage.description"), //$NON-NLS-1$
-					null);
-			RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(wizard);
-			op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle());
-			op.getInitialConditionCheckingStatus();
-			//triggerBuild();
-		} catch (InterruptedException e) {
-			// do nothing. User action got cancelled
-		}
-		
-	}
-	
-	public void run(){
-		if(fSelectedComponent == null){
-			return;
-		}
-		
-		if(fSelectedComponent.getSchema() == null){
-			getSchema().updateElement(true);
-		}
-		DocumentImpl doc = (DocumentImpl) fSelectedComponent.getElement().getOwnerDocument();
-		doc.getModel().beginRecording(
-						this,
-						XSDEditorPlugin
-								.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"));
-		MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand(
-				fSelectedComponent, getNewDefaultName());
-		command.run();
-		doc.getModel().endRecording(this);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java
deleted file mode 100644
index ced71d7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java
+++ /dev/null
@@ -1,79 +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.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.commands.MakeLocalElementGlobalCommand;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Node;
-
-public class MakeLocalElementGlobalAction extends SelectionDispatchAction {
-
-	XSDElementDeclaration fSelectedComponent;
-
-	public MakeLocalElementGlobalAction(ISelectionProvider selectionProvider, XSDSchema schema) {
-		super(selectionProvider);
-		setText(RefactoringMessages.getString("MakeLocalElementGlobalAction.text")); //$NON-NLS-1$
-		setSchema(schema);
-	}
-	
-	public boolean canRun() {
-
-		return fSelectedComponent != null;
-	}
-
-	protected boolean canEnable(XSDConcreteComponent selectedObject) {
-
-		fSelectedComponent = null;
-		if (selectedObject instanceof XSDElementDeclaration) {
-			XSDElementDeclaration element = (XSDElementDeclaration) selectedObject;
-			if (!element.isElementDeclarationReference() && !element.isGlobal()) {
-				fSelectedComponent = element;
-			}
-		} 
-		return canRun();
-	}
-	
-	
-	protected boolean canEnable(Object selectedObject) {
-		
-		if (selectedObject instanceof XSDConcreteComponent) {
-			return canEnable((XSDConcreteComponent)selectedObject);
-		}
-		else if (selectedObject instanceof Node) {
-			Node node = (Node) selectedObject;
-			XSDSchema xsdSchema = getSchema();
-			if (xsdSchema != null)
-			{
-			  XSDConcreteComponent concreteComponent = xsdSchema.getCorrespondingComponent(node);
-		  	return canEnable(concreteComponent);
-			}
-		}
-		return false;
-		
-	}
-
-
-	public void run() {
-		DocumentImpl doc = (DocumentImpl) fSelectedComponent.getElement()
-				.getOwnerDocument();
-		doc.getModel().beginRecording(this, getText());
-		MakeLocalElementGlobalCommand command = new MakeLocalElementGlobalCommand(
-				fSelectedComponent);
-		command.run();
-		doc.getModel().endRecording(this);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RefactorActionGroup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RefactorActionGroup.java
deleted file mode 100644
index f260bb4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RefactorActionGroup.java
+++ /dev/null
@@ -1,261 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * Action group that adds refactor actions (for example 'Rename', 'Move') to a
- * context menu and the global menu bar.
- * 
- */
-public class RefactorActionGroup extends ActionGroup {
-
-	public static final String MENU_ID = "org.eclipse.wst.xsd.ui.refactoring.menu"; //$NON-NLS-1$
-
-	public static final String GROUP_REORG = "reorgGroup"; //$NON-NLS-1$
-
-	public static final String RENAME_ELEMENT = "org.eclipse.wst.xsd.ui.refactor.rename.element"; //$NON-NLS-1$
-
-	public static final String MAKE_ELEMENT_GLOBAL = "org.eclipse.wst.xsd.ui.refactor.makeElementGlobal"; //$NON-NLS-1$
-	
-	public static final String MAKE_TYPE_GLOBAL = "org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal"; //$NON-NLS-1$
-
-	public static final String RENAME = "org.eclipse.wst.xsd.ui.refactoring.actions.Rename"; //$NON-NLS-1$
-
-	/**
-	 * Pop-up menu: name of group for reorganize actions (value
-	 * <code>"group.reorganize"</code>).
-	 */
-	public static final String GROUP_REORGANIZE = IWorkbenchActionConstants.GROUP_REORGANIZE;
-
-	/**
-	 * 
-	 * @deprecated
-	 * 
-	 */
-	private ISelectionProvider fSelectionProvider;
-
-	private String fGroupName = GROUP_REORGANIZE;
-
-	private SelectionDispatchAction fRenameAction;
-
-	private SelectionDispatchAction fMakeLocalElementGlobal;
-	
-	private SelectionDispatchAction fMakeLocalTypeGlobal;
-
-	private List fEditorActions;
-
-	private IMenuManager fRefactorSubmenu;
-
-	private static class NoActionAvailable extends Action {
-		public NoActionAvailable() {
-			setEnabled(true);
-			setText(RefactoringMessages
-					.getString("RefactorActionGroup.no_refactoring_available")); //$NON-NLS-1$
-		}
-	}
-
-	private Action fNoActionAvailable = new NoActionAvailable();
-	
-	public RefactorActionGroup(ISelectionProvider selectionProvider,
-			XSDSchema schema, String groupName) {
-		this(selectionProvider, schema);
-		fGroupName = groupName;
-	}
-	
-	public RefactorActionGroup(ISelectionProvider selectionProvider,
-			XSDSchema schema) {
-		fSelectionProvider = selectionProvider;
-		fEditorActions = new ArrayList();
-		fRenameAction = new RenameAction(selectionProvider, schema);
-		fRenameAction.setActionDefinitionId(RENAME_ELEMENT);
-		fEditorActions.add(fRenameAction);
-
-		fMakeLocalElementGlobal = new MakeLocalElementGlobalAction(
-				selectionProvider, schema);
-		fMakeLocalElementGlobal.setActionDefinitionId(MAKE_ELEMENT_GLOBAL);
-		fEditorActions.add(fMakeLocalElementGlobal);
-		
-		fMakeLocalTypeGlobal = new MakeAnonymousTypeGlobalAction(
-				selectionProvider, schema);
-		fMakeLocalTypeGlobal.setActionDefinitionId(MAKE_TYPE_GLOBAL);
-		fEditorActions.add(fMakeLocalTypeGlobal);
-
-		initAction(fRenameAction, fSelectionProvider);
-		initAction(fMakeLocalElementGlobal, fSelectionProvider);
-		initAction(fMakeLocalTypeGlobal, fSelectionProvider);
-	}
-
-	private static void initAction(SelectionDispatchAction action,
-			ISelectionProvider provider) {
-
-		Assert.isNotNull(provider);
-		Assert.isNotNull(action);
-		action.update(provider.getSelection());
-		provider.addSelectionChangedListener(action);
-	}
-
-	/*
-	 * (non-Javadoc) Method declared in ActionGroup
-	 */
-	public void fillActionBars(IActionBars actionBars) {
-		super.fillActionBars(actionBars);
-		actionBars.setGlobalActionHandler(RENAME, fRenameAction);
-		retargetFileMenuActions(actionBars);
-	}
-
-	/**
-	 * Retargets the File actions with the corresponding refactoring actions.
-	 * 
-	 * @param actionBars
-	 *            the action bar to register the move and rename action with
-	 */
-	public void retargetFileMenuActions(IActionBars actionBars) {
-		actionBars.setGlobalActionHandler(ActionFactory.RENAME.getId(),
-				fRenameAction);
-	}
-
-	/*
-	 * (non-Javadoc) Method declared in ActionGroup
-	 */
-	public void fillContextMenu(IMenuManager menu) {
-		super.fillContextMenu(menu);
-		addRefactorSubmenu(menu);
-	}
-
-	/*
-	 * @see ActionGroup#dispose()
-	 */
-	public void dispose() {
-		disposeAction(fRenameAction, fSelectionProvider);
-		disposeAction(fMakeLocalElementGlobal, fSelectionProvider);
-		super.dispose();
-	}
-
-	private void disposeAction(ISelectionChangedListener action,
-			ISelectionProvider provider) {
-		if (action != null)
-			provider.removeSelectionChangedListener(action);
-	}
-
-	private void addRefactorSubmenu(IMenuManager menu) {
-
-		String menuText = RefactoringMessages.getString("RefactorMenu.label"); //$NON-NLS-1$
-
-		fRefactorSubmenu = new MenuManager(menuText, MENU_ID);
-		//if (fEditor != null) {
-			fRefactorSubmenu.addMenuListener(new IMenuListener() {
-				public void menuAboutToShow(IMenuManager manager) {
-					refactorMenuShown(manager);
-				}
-			});
-			fRefactorSubmenu.add(fNoActionAvailable);
-			if (menu.find(fRefactorSubmenu.getId()) == null) {
-				if (menu.find(fGroupName) == null) {
-					menu.add(fRefactorSubmenu);
-				} else {
-					menu.appendToGroup(fGroupName, fRefactorSubmenu);
-				}
-			}
-//		} else {
-//			if (fillRefactorMenu(fRefactorSubmenu) > 0)
-//				menu.appendToGroup(fGroupName, fRefactorSubmenu);
-//		}
-	}
-
-	private int fillRefactorMenu(IMenuManager refactorSubmenu) {
-		int added = 0;
-		refactorSubmenu.add(new Separator(GROUP_REORG));
-		for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
-			Action action = (Action) iter.next();
-			added += addAction(refactorSubmenu, action);
-		}
-		return added;
-	}
-
-	private int addAction(IMenuManager menu, IAction action) {
-		if (action != null && action.isEnabled()) {
-			menu.add(action);
-			return 1;
-		}
-		return 0;
-	}
-
-	public int addAction(IAction action) {
-		if (action != null && action.isEnabled()) {
-			fEditorActions.add(action);
-			return 1;
-		}
-		return 0;
-	}
-
-	private void refactorMenuShown(final IMenuManager refactorSubmenu) {
-		// we know that we have an MenuManager since we created it in
-		// addRefactorSubmenu.
-		Menu menu = ((MenuManager) refactorSubmenu).getMenu();
-		menu.addMenuListener(new MenuAdapter() {
-			public void menuHidden(MenuEvent e) {
-				refactorMenuHidden(refactorSubmenu);
-			}
-		});
-//		ISelection selection = (ISelection) fEditor.getSelectionManager()
-//				.getSelection();
-		ISelection selection = fSelectionProvider.getSelection();
-		for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
-			Action action = (Action) iter.next();
-			if (action instanceof SelectionDispatchAction) {
-				SelectionDispatchAction selectionAction = (SelectionDispatchAction) action;
-				selectionAction.update(selection);
-			}
-		}
-		refactorSubmenu.removeAll();
-		if (fillRefactorMenu(refactorSubmenu) == 0)
-			refactorSubmenu.add(fNoActionAvailable);
-	}
-
-	private void refactorMenuHidden(IMenuManager manager) {
-//		ISelection selection = (ISelection) fEditor.getSelectionManager()
-//				.getSelection();
-		ISelection selection = fSelectionProvider.getSelection();
-		for (Iterator iter = fEditorActions.iterator(); iter.hasNext();) {
-			Action action = (Action) iter.next();
-			if (action instanceof SelectionDispatchAction) {
-				SelectionDispatchAction selectionAction = (SelectionDispatchAction) action;
-				selectionAction.update(selection);
-			}
-
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java
deleted file mode 100644
index c9c6178..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java
+++ /dev/null
@@ -1,104 +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.xsd.ui.internal.refactor.actions;
-
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.xsd.XSDSchema;
-
-
-/**
-* Renames a XML Schema element or workbench resource.
-* <p>
-* Action is applicable to selections containing elements of type
-* <code></code> or <code>IResource</code>.
-* 
-* <p>
-* This class may be instantiated; it is not intended to be subclassed.
-* </p>
-
-*/
-public class RenameAction extends SelectionDispatchAction  {
-
-	private RenameComponentAction fRenameXSDElement;
-	private RenameResourceAction fRenameResource;
-	
-	
-	public RenameAction(ISelectionProvider selectionProvider, XSDSchema schema) {
-		super(selectionProvider);
-		setText(RefactoringMessages.getString("RenameAction.text")); //$NON-NLS-1$
-		fRenameXSDElement= new RenameComponentAction(selectionProvider, schema);
-		fRenameXSDElement.setText(getText());
-		fRenameResource= new RenameResourceAction(selectionProvider);
-		fRenameResource.setText(getText());
-		
-	}
-	
-	/*
-	 * @see ISelectionChangedListener#selectionChanged(SelectionChangedEvent)
-	 */
-	public void selectionChanged(SelectionChangedEvent event) {
-		fRenameXSDElement.selectionChanged(event);
-		if (fRenameResource != null)
-			fRenameResource.selectionChanged(event);
-		setEnabled(computeEnabledState());		
-	}
-
-	/*
-	 * @see SelectionDispatchAction#update(ISelection)
-	 */
-	public void update(ISelection selection) {
-		if(fRenameXSDElement != null){
-			fRenameXSDElement.update(selection);
-		}
-		if (fRenameResource != null)
-			fRenameResource.update(selection);
-		setEnabled(computeEnabledState());		
-	}
-	
-	private boolean computeEnabledState(){
-		if (fRenameResource != null) {
-			return fRenameXSDElement.isEnabled() || fRenameResource.isEnabled();
-		} else {
-			return fRenameXSDElement.isEnabled();
-		}
-	}
-	
-	public void run(IStructuredSelection selection) {
-		if (fRenameXSDElement.isEnabled())
-			fRenameXSDElement.run(selection);
-		if (fRenameResource != null && fRenameResource.isEnabled())
-			fRenameResource.run(selection);
-	}
-
-	public void run(ITextSelection selection) {
-		if (fRenameXSDElement.canRun())
-			fRenameXSDElement.run(selection);
-		else
-			MessageDialog.openInformation(XSDEditorPlugin.getShell(), RefactoringMessages.getString("RenameAction.rename"), RefactoringMessages.getString("RenameAction.unavailable"));  //$NON-NLS-1$ //$NON-NLS-2$
-	}
-	public void run(ISelection selection) {
-	    if(selection == null){
-	    	super.run();
-	    }
-	    else{
-	    	super.run(selection);
-	    }
-		
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
deleted file mode 100644
index 01527c0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
+++ /dev/null
@@ -1,139 +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.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.ui.actions.GlobalBuildAction;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameComponentProcessor;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameRefactoringWizard;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.w3c.dom.Node;
-
-public class RenameComponentAction extends SelectionDispatchAction {
-
-	private XSDNamedComponent fSelectedComponent;
-
-	public RenameComponentAction(ISelectionProvider selectionProvider,
-			XSDSchema schema) {
-		super(selectionProvider);
-		setSchema(schema);
-	}
-
-	protected boolean canEnable(XSDConcreteComponent selectedObject) {
-
-		fSelectedComponent = null;
-		if (selectedObject instanceof XSDNamedComponent) {
-			fSelectedComponent = (XSDNamedComponent) selectedObject;
-
-			// if it's element reference, then this action is not appropriate
-			if (fSelectedComponent instanceof XSDElementDeclaration) {
-				XSDElementDeclaration element = (XSDElementDeclaration) fSelectedComponent;
-				if (element.isElementDeclarationReference()) {
-					fSelectedComponent = null;
-				}
-			}
-			if(fSelectedComponent instanceof XSDTypeDefinition){
-				XSDTypeDefinition type = (XSDTypeDefinition) fSelectedComponent;
-				XSDConcreteComponent parent = type.getContainer();
-				if (parent instanceof XSDElementDeclaration) {
-					XSDElementDeclaration element = (XSDElementDeclaration) parent;
-					if(element.getAnonymousTypeDefinition().equals(type)){
-						fSelectedComponent = null;
-					}
-				}
-				else if(parent instanceof XSDAttributeDeclaration) {
-					XSDAttributeDeclaration element = (XSDAttributeDeclaration) parent;
-					if(element.getAnonymousTypeDefinition().equals(type)){
-						fSelectedComponent = null;
-					}
-				}
-			}
-		}
-
-		return canRun();
-	}
-
-	protected boolean canEnable(Object selectedObject) {
-
-		if (selectedObject instanceof XSDConcreteComponent) {
-			return canEnable((XSDConcreteComponent) selectedObject);
-		} else if (selectedObject instanceof Node) {
-			Node node = (Node) selectedObject;
-			if (getSchema() != null) {
-				XSDConcreteComponent concreteComponent = getSchema()
-						.getCorrespondingComponent(node);
-				return canEnable(concreteComponent);
-			}
-		}
-		return false;
-
-	}
-
-	public boolean canRun() {
-
-		return fSelectedComponent != null;
-	}
-
-	public void run(ISelection selection) {
-		if (fSelectedComponent.getName() == null) {
-			fSelectedComponent.setName(new String());
-		}
-		if (fSelectedComponent.getSchema() == null) {
-			if (getSchema() != null) {
-				getSchema().updateElement(true);
-			}
-
-		}
-		RenameComponentProcessor processor = new RenameComponentProcessor(
-				fSelectedComponent, fSelectedComponent.getName());
-		RenameRefactoring refactoring = new RenameRefactoring(processor);
-		try {
-			RefactoringWizard wizard = new RenameRefactoringWizard(
-					refactoring,
-					RefactoringMessages
-							.getString("RenameComponentWizard.defaultPageTitle"), //$NON-NLS-1$ TODO: provide correct strings
-					RefactoringMessages
-							.getString("RenameComponentWizard.inputPage.description"), //$NON-NLS-1$
-					null);
-			RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(
-					wizard);
-			op.run(XSDEditorPlugin.getShell(), wizard
-					.getDefaultPageTitle());
-			op.getInitialConditionCheckingStatus();
-			triggerBuild();
-		} catch (InterruptedException e) {
-			// do nothing. User action got cancelled
-		}
-
-	}
-
-	public static void triggerBuild() {
-		if (ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding()) {
-			new GlobalBuildAction(XSDEditorPlugin.getPlugin().getWorkbench()
-					.getActiveWorkbenchWindow(),
-					IncrementalProjectBuilder.INCREMENTAL_BUILD).run();
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java
deleted file mode 100644
index cfa535b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java
+++ /dev/null
@@ -1,75 +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.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameRefactoringWizard;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameResourceProcessor;
-
-
-
-public class RenameResourceAction extends SelectionDispatchAction {
-
-
-	public RenameResourceAction(ISelectionProvider selectionProvider) {
-		super(selectionProvider);
-	}
-	
-	public void selectionChanged(IStructuredSelection selection) {
-		IResource element= getResource(selection);
-		if (element == null) {
-			setEnabled(false);
-		} else {
-			RenameResourceProcessor processor= new RenameResourceProcessor(element);
-			setEnabled(processor.isApplicable());
-			
-		}
-	}
-
-	public void run(IStructuredSelection selection) {
-		IResource resource = getResource(selection);
-		RenameResourceProcessor processor= new RenameResourceProcessor(resource);
-
-			if(!processor.isApplicable())
-				return;
-			RenameRefactoring refactoring= new RenameRefactoring(processor);
-			try {
-				RefactoringWizard wizard = new RenameRefactoringWizard(
-						refactoring,
-						RefactoringMessages.getString("RenameComponentWizard.defaultPageTitle"), //$NON-NLS-1$ TODO: provide correct strings
-						RefactoringMessages.getString("RenameComponentWizard.inputPage.description"), //$NON-NLS-1$
-						null);
-				RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(wizard);
-				op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle());
-				op.getInitialConditionCheckingStatus();
-			} catch (InterruptedException e) {
-				// do nothing. User action got cancelled
-			}
-			
-	}
-	
-	private static IResource getResource(IStructuredSelection selection) {
-		if (selection.size() != 1)
-			return null;
-		Object first= selection.getFirstElement();
-		if (! (first instanceof IResource))
-			return null;
-		return (IResource)first;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java
deleted file mode 100644
index f008e13..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java
+++ /dev/null
@@ -1,56 +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.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.core.resources.IFile;
-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;
-
-/**
- * @author ebelisar@ca.ibm.com
- */
-public class RenameResourceActionDelegate implements IObjectActionDelegate {
-	
-	private ISelection fCurrentSelection;
-
-	private IWorkbenchPart fPart;
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
-	 */
-	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
-		fPart = targetPart;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
-	 */
-	public void run(IAction action) {
-		if (fCurrentSelection instanceof IStructuredSelection) {
-			IStructuredSelection structuredSelection= (IStructuredSelection) fCurrentSelection;
-			Object first= structuredSelection.getFirstElement();
-			if (first instanceof IFile) {
-				RenameResourceAction renameAction = new RenameResourceAction(fPart.getSite().getSelectionProvider());
-				renameAction.run(structuredSelection);
-			}
-		}
-
-	}
-	/* (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) {
-		fCurrentSelection= selection;
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java
deleted file mode 100644
index abe853d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java
+++ /dev/null
@@ -1,199 +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.xsd.ui.internal.refactor.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.xsd.XSDSchema;
-
-
-
-/**
- * Action that dispatches the <code>IAction#run()</code> and the 
- * <code>ISelectionChangedListener#selectionChanged</code> 
- * according to the type of the selection. 
- * 
- * <ul>
- * 	<li>if selection is of type <code>ITextSelection</code> then
- * 	<code>run(ITextSelection)</code> and <code>selectionChanged(ITextSelection)</code>
- * 	is called.</li> 
- * 	<li>if selection is of type <code>IStructuredSelection</code> then
- * 	<code>run(IStructuredSelection)</code> and <code>
- * 	selectionChanged(IStructuredSelection)</code> is called.</li>
- * 	<li>default is to call <code>run(ISelection)</code> and <code>
- * 	selectionChanged(ISelection)</code>.</li>
- * </ul>
- * 
- * <p>
- * adapted from <code>org.eclipse.jdt.ui.actions.SelectionDispatchAction</code>
- * </p>
- *   
- * 
- */
-public abstract class SelectionDispatchAction extends Action implements ISelectionChangedListener {
-	
-	private ISelectionProvider fSelectionProvider;
-	
-	private XSDSchema fSchema;
-	
-	protected SelectionDispatchAction(ISelectionProvider selectionProvider) {
-		Assert.isNotNull(selectionProvider);
-		fSelectionProvider = selectionProvider;
-	}
-
-	/**
-	 * Returns the selection provided by the site owning this action.
-	 * 
-	 * @return the site's selection
-	 */	
-	public ISelection getSelection() {
-		if (getSelectionProvider() != null)
-			return getSelectionProvider().getSelection();
-		else
-			return null;
-	}
-
-	/**
-	 * Returns the selection provider managed by the site owning this action.
-	 * 
-	 * @return the site's selection provider	
-	 */
-	public ISelectionProvider getSelectionProvider() {
-		return fSelectionProvider;
-	}
-
-	/**
-	 * Updates the action's enablement state according to the given selection. This
-	 * default implementation calls one of the <code>selectionChanged</code>
-	 * methods depending on the type of the passed selection.
-	 * 
-	 * @param selection the selection this action is working on
-	 */
-	public void update(ISelection selection) {
-		dispatchSelectionChanged(selection);
-	}
-
-	/**
-	 * Notifies this action that the given structured selection has changed. This default
-	 * implementation calls <code>selectionChanged(ISelection selection)</code>.
-	 * 
-	 * @param selection the new selection
- 	 */
-	public void selectionChanged(IStructuredSelection selection) {
-		if (selection.size() == 1) {
-			Object object = selection.getFirstElement();
-			setEnabled(canEnable(object));
-		}
-		else{
-			setEnabled(false);
-		}
-	}
-	
-	protected boolean canEnable(Object selectedObject){
-		return false;
-	}
-
-	/**
-	 * Executes this actions with the given structured selection. This default implementation
-	 * calls <code>run(ISelection selection)</code>.
-	 */
-	public void run(IStructuredSelection selection) {
-		run((ISelection)selection);
-	}
-
-	
-	/**
-	 * Notifies this action that the given text selection has changed.  This default
-	 * implementation calls <code>selectionChanged(ISelection selection)</code>.
-	 * 
-	 * @param selection the new selection
- 	 */
-	public void selectionChanged(ITextSelection selection) {
-		selectionChanged((ISelection)selection);
-	}
-	
-	/**
-	 * Executes this actions with the given text selection. This default implementation
-	 * calls <code>run(ISelection selection)</code>.
-	 */
-	public void run(ITextSelection selection) {
-		run((ISelection)selection);
-	}
-	
-	/**
-	 * Notifies this action that the given selection has changed.  This default
-	 * implementation sets the action's enablement state to <code>false</code>.
-	 * 
-	 * @param selection the new selection
- 	 */
-	public void selectionChanged(ISelection selection) {
-		setEnabled(false);
-	}
-	
-	/**
-	 * Executes this actions with the given selection. This default implementation
-	 * does nothing.
-	 */
-	public void run(ISelection selection) {
-		System.out.println("SelectionDispatchAction.run");
-	}
-
-	/* (non-Javadoc)
-	 * Method declared on IAction.
-	 */
-	public void run() {
-		dispatchRun(getSelection());
-		
-	}
-	
-	/* (non-Javadoc)
-	 * Method declared on ISelectionChangedListener.
-	 */
-	public void selectionChanged(SelectionChangedEvent event) {
-		dispatchSelectionChanged(event.getSelection());
-	}
-
-	private void dispatchSelectionChanged(ISelection selection) {
-		if (selection instanceof IStructuredSelection) {
-			selectionChanged((IStructuredSelection)selection);
-		} else if (selection instanceof ITextSelection) {
-			selectionChanged((ITextSelection)selection);
-		} else {
-			selectionChanged(selection);
-		}
-	}
-
-	protected void dispatchRun(ISelection selection) {
-		if (selection instanceof IStructuredSelection) {
-			run((IStructuredSelection)selection);
-		}  else if (selection instanceof ITextSelection) {
-			run((ITextSelection)selection);
-		} else {
-			run(selection);
-		}
-	}
-
-	public XSDSchema getSchema() {
-		return fSchema;
-	}
-
-	public void setSchema(XSDSchema schema) {
-		fSchema = schema;
-	}
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseCleanup.java
deleted file mode 100644
index f45a1e2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseCleanup.java
+++ /dev/null
@@ -1,107 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.delete;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-
-public abstract class BaseCleanup extends XSDVisitor
-{
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitSchema(XSDSchema)
-   */
-  public void visitSchema(XSDSchema schema)
-  {
-    super.visitSchema(schema);
-    
-    // now remove all children that were queued up for removal
-    
-    for (Iterator iter = childrenToRemove.iterator(); iter.hasNext(); )
-    {
-      Element domElement = (Element) iter.next();
-      XSDDOMHelper.removeNodeAndWhitespace(domElement);
-//      domElement.getParentNode().removeChild(domElement);
-    }
-  }
-
-
-  protected ArrayList messages = new ArrayList();
-
-  public ArrayList getMessages()
-  {
-  	return messages;
-  }
-  
-
-  protected void addMessage(String msg, XSDConcreteComponent component)
-  {
-////    ErrorMessage message = new ErrorMessage();
-//    
-//    XSDConcreteComponent currComp = component;
-//    while (!(currComp instanceof XSDSchemaContent) && currComp.getContainer() != null)
-//    {
-//      currComp = currComp.getContainer();
-//    }
-//
-//    Element domElement = currComp.getElement();
-//    Node parent = domElement;
-//    while (!(parent instanceof NodeImpl) && parent != null)
-//    {
-//      parent = parent.getParentNode();
-//    }
-//    if (parent instanceof NodeImpl)
-//    {
-//      // message.setModelObject(currComp.getElement());
-//			message.setTargetObject(currComp.getElement());
-//    }
-//    message.setLocalizedMessage(msg);
-//  ???
-//    addMessage(message);
-  }
-    
-
-// // protected void addMessage(ErrorMessage message)
-//	protected void addMessage(Message message)
-//  {
-//    messages.add(message);
-//  }
-  
-
-  protected ArrayList childrenToRemove = new ArrayList();
-  
-
-  protected String getNamedComponentName(XSDConcreteComponent concrete)
-  {
-    String name = null;
-    if (concrete instanceof XSDNamedComponent)
-    {
-      name = ((XSDNamedComponent)concrete).getName();
-    }
-    
-    XSDConcreteComponent comp = concrete;
-    while (comp != null && name == null)
-    {
-      comp = comp.getContainer();
-      if (comp instanceof XSDNamedComponent)
-      {
-        name = ((XSDNamedComponent)comp).getName();
-      }
-    }
-    return name != null ? name : "";
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseGlobalCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseGlobalCleanup.java
deleted file mode 100644
index 6503971..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseGlobalCleanup.java
+++ /dev/null
@@ -1,29 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.delete;
-
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDNamedComponent;
-
-public class BaseGlobalCleanup extends BaseCleanup
-{
-  public BaseGlobalCleanup(XSDConcreteComponent deletedItem)
-  {
-    this.deletedItem = deletedItem;
-  }
-  
-  protected XSDConcreteComponent deletedItem;
-  
-  protected String getDeletedQName()
-  {
-    return ((XSDNamedComponent)deletedItem).getQName();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeCleanup.java
deleted file mode 100644
index 2ff9b55..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeCleanup.java
+++ /dev/null
@@ -1,104 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.delete;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class GlobalAttributeCleanup extends BaseGlobalCleanup
-{
-  /**
-   * Constructor for GlobalAttributeCleanup.
-   * @param deletedItem
-   */
-  public GlobalAttributeCleanup(XSDConcreteComponent deletedItem)
-  {
-    super(deletedItem);
-  }
-  
-  protected String replacementName = null;
-  
-  protected String getReplacementElementName()
-  {
-    if (replacementName == null)
-    {
-      TypesHelper helper = new TypesHelper(schema);
-      
-      List elements = helper.getGlobalAttributes();
-      
-      String deletedName = getDeletedQName();
-      for (Iterator i = elements.iterator(); i.hasNext();)
-      {
-        String name = (String) i.next();
-        if (!name.equals(deletedName))
-        {
-          replacementName = name;
-          break;
-        }
-      }
-    }
-    return replacementName;
-  }
-
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
-   */
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    super.visitComplexTypeDefinition(type);
-    if (type.getAttributeContents() != null)
-    {
-      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
-        if (attrGroupContent instanceof XSDAttributeUse)
-        {
-          XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
-          XSDAttributeDeclaration attrDecl = attrUse.getContent();
-          
-          // now is this a reference?
-          if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
-          {
-            if (deletedItem.equals(attrDecl.getResolvedAttributeDeclaration()))
-            {
-              if (getReplacementElementName() != null)
-              {
-				String msg = XSDEditorPlugin.getPlugin().getString("_UI_WARNING_RESET_ATTR_REF", getReplacementElementName()); 
-                addMessage(msg, attrUse);
-                attrUse.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getReplacementElementName());
-              }
-              else
-              {
-                String name = getNamedComponentName(type);
-				String msg = XSDEditorPlugin.getPlugin().getString("_UI_WARNING_REMOVE_ATTR_REF", name);
-                addMessage(msg, attrUse.getContainer());
-                
-                childrenToRemove.add(attrDecl.getElement());
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-
-
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java
deleted file mode 100644
index f858427..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java
+++ /dev/null
@@ -1,100 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.delete;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class GlobalAttributeGroupCleanup extends BaseGlobalCleanup
-{
-  /**
-   * Constructor for GlobalAttributeGroupCleanup.
-   * @param deletedItem
-   */
-  public GlobalAttributeGroupCleanup(XSDConcreteComponent deletedItem)
-  {
-    super(deletedItem);
-  }
-  
-  
-  protected String replacementName = null;
-  
-  protected String getReplacementElementName()
-  {
-    if (replacementName == null)
-    {
-      TypesHelper helper = new TypesHelper(schema);
-      
-      List elements = helper.getGlobalAttributeGroups();
-      
-      String deletedName = getDeletedQName();
-      for (Iterator i = elements.iterator(); i.hasNext();)
-      {
-        String name = (String) i.next();
-        if (!name.equals(deletedName))
-        {
-          replacementName = name;
-          break;
-        }
-      }
-    }
-    return replacementName;
-  }
-
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
-   */
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    super.visitComplexTypeDefinition(type);
-    if (type.getAttributeContents() != null)
-    {
-      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
-
-        if (attrGroupContent instanceof XSDAttributeGroupDefinition)
-        {
-          XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) attrGroupContent;
-          
-          if (deletedItem.equals(attrGroupDef.getResolvedAttributeGroupDefinition()))
-          {
-            if (getReplacementElementName() != null)
-            {
-			  String msg = XSDEditorPlugin.getXSDString("_INFO_RESET_ATTRIBUTE_GROUP_REFERENCE") + " <" + getReplacementElementName() + ">";
-              addMessage(msg, attrGroupDef);
-              attrGroupDef.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getReplacementElementName());
-            }
-            else
-            {
-              // remove the attribute group reference
-              String name = getNamedComponentName(type);
-			  String msg = XSDEditorPlugin.getXSDString("_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE") + " <" + name + ">";  
-              addMessage(msg, attrGroupDef.getContainer());
-              
-              childrenToRemove.add(attrGroupDef.getElement());
-            }
-          }
-        }
-      }
-    }
-    
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalElementCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalElementCleanup.java
deleted file mode 100644
index 9719e39..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalElementCleanup.java
+++ /dev/null
@@ -1,84 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.delete;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class GlobalElementCleanup extends BaseGlobalCleanup
-{
-    
-  /**
-   * Constructor for GlobalElementCleanup.
-   * @param deletedItem
-   */
-  public GlobalElementCleanup(XSDConcreteComponent deletedItem)
-  {
-    super(deletedItem);
-  }
-
-  protected String replacementName = null;
-  
-  protected String getReplacementElementName()
-  {
-    if (replacementName == null)
-    {
-      TypesHelper helper = new TypesHelper(schema);
-      
-      List elements = helper.getGlobalElements();
-      
-      String deletedName = getDeletedQName();
-      for (Iterator i = elements.iterator(); i.hasNext();)
-      {
-        String name = (String) i.next();
-        if (!name.equals(deletedName))
-        {
-          replacementName = name;
-          break;
-        }
-      }
-    }
-    return replacementName;
-  }
-  
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitElementDeclaration(XSDElementDeclaration)
-   */
-  public void visitElementDeclaration(XSDElementDeclaration element)
-  {
-    if (element.isElementDeclarationReference())
-    {
-      if (deletedItem.equals(element.getResolvedElementDeclaration()))
-      {
-        if (getReplacementElementName() != null)
-        {
-          // KCPort String msg = XSDPlugin.getSchemaString("_INFO_RESET_ELEMENT_REFERENCE") + " <" + getReplacementElementName() + ">";
-					String msg = "_INFO_RESET_ELEMENT_REFERENCE" + " <" + getReplacementElementName() + ">";
-          addMessage(msg, element);
-          element.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getReplacementElementName());
-        }
-        else
-        {
-          // KCPort  String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ELEMENT_REFERENCE") + " <" + getNamedComponentName(element.getContainer()) + ">";
-					String msg = "_INFO_REMOVE_ELEMENT_REFERENCE" + " <" + getNamedComponentName(element.getContainer()) + ">";
-          addMessage(msg, element.getContainer());
-          childrenToRemove.add(element.getElement());
-        }
-      }
-    }
-    super.visitElementDeclaration(element);
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalGroupCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalGroupCleanup.java
deleted file mode 100644
index 9486ff2..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalGroupCleanup.java
+++ /dev/null
@@ -1,84 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.delete;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class GlobalGroupCleanup extends BaseGlobalCleanup
-{
-  /**
-   * Constructor for GlobalGroupCleanup.
-   * @param deletedItem
-   */
-  public GlobalGroupCleanup(XSDConcreteComponent deletedItem)
-  {
-    super(deletedItem);
-  }
-
-  protected String replacementName = null;
-  
-  protected String getReplacementElementName()
-  {
-    if (replacementName == null)
-    {
-      TypesHelper helper = new TypesHelper(schema);
-      
-      List elements = helper.getModelGroups();
-      
-      String deletedName = getDeletedQName();
-      for (Iterator i = elements.iterator(); i.hasNext();)
-      {
-        String name = (String) i.next();
-        if (!name.equals(deletedName))
-        {
-          replacementName = name;
-          break;
-        }
-      }
-    }
-    return replacementName;
-  }
-
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitModelGroupDefinition(XSDModelGroupDefinition)
-   */
-  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroup)
-  {
-    super.visitModelGroupDefinition(modelGroup);
-    if (modelGroup.isModelGroupDefinitionReference())
-    {
-      if (deletedItem.equals(modelGroup.getResolvedModelGroupDefinition()))
-      {
-        if (getReplacementElementName() != null)
-        {
-          // KCPort String msg = XSDPlugin.getSchemaString("_INFO_RESET_GROUP_REFERENCE") + " <" + getReplacementElementName() + ">";
-					String msg = "_INFO_RESET_GROUP_REFERENCE" + " <" + getReplacementElementName() + ">";
-          addMessage(msg, modelGroup);
-          modelGroup.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getReplacementElementName());
-        }
-        else
-        {
-          String name = getNamedComponentName(modelGroup);
-          // KCPort String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_GROUP_REFERENCE") + " <" + name + ">";
-					String msg = "_INFO_REMOVE_GROUP_REFERENCE" + " <" + name + ">";
-          addMessage(msg, modelGroup.getContainer());
-          childrenToRemove.add(modelGroup.getElement());
-        }
-      }
-    }      
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalSimpleOrComplexTypeCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalSimpleOrComplexTypeCleanup.java
deleted file mode 100644
index ed4132c..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalSimpleOrComplexTypeCleanup.java
+++ /dev/null
@@ -1,143 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.delete;
-
-import java.text.MessageFormat;
-import java.util.Iterator;
-
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class GlobalSimpleOrComplexTypeCleanup extends BaseGlobalCleanup
-{
-  /**
-   * Constructor for GlobalSimpleOrComplexTypeCleanup.
-   * @param deletedItem
-   */
-  public GlobalSimpleOrComplexTypeCleanup(XSDConcreteComponent deletedItem)
-  {
-    super(deletedItem);
-  }
-
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitElementDeclaration(XSDElementDeclaration)
-   */
-  public void visitElementDeclaration(XSDElementDeclaration element)
-  {
-    if (!element.isElementDeclarationReference() &&
-        deletedItem.equals(element.getTypeDefinition()))
-    {
-      resetTypeToString(element.getElement());
-      
-      String msg = "";
-      if (element.isGlobal())
-      {
-        String pattern = XSDEditorPlugin.getXSDString("_INFO_RESET_GLOBAL_ELEMENT");
-        Object args[] = {element.getName()};
-        msg = MessageFormat.format(pattern, args);
-      }
-      else
-      {
-        msg = XSDEditorPlugin.getXSDString("_INFO_RESET_ELEMENT");
-        msg += "<" + element.getName() + "> " + XSDEditorPlugin.getXSDString("_UI_TO_TYPE_STRING");
-      }
-      addMessage(msg, element);
-    }
-
-
-    super.visitElementDeclaration(element);
-  }
-
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
-   */
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    super.visitComplexTypeDefinition(type);
-    if (type.getAttributeContents() != null)
-    {
-      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
-        if (attrGroupContent instanceof XSDAttributeUse)
-        {
-          XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
-          XSDAttributeDeclaration attrDecl = attrUse.getContent();
-          
-          // now is this a reference?
-          if (attrDecl != null &&
-              !attrDecl.isAttributeDeclarationReference() &&
-              deletedItem.equals(attrDecl.getTypeDefinition()))
-          {
-              resetTypeToString(attrDecl.getElement());
-              // reset the type of the attribute decl to string
-              String msg = XSDEditorPlugin.getXSDString("_INFO_RESET_ATTRIBUTE") +
-                          " <" + attrDecl.getName() + "> " +
-                          XSDEditorPlugin.getXSDString("_UI_TO_TYPE_STRING");
-              addMessage(msg, attrDecl);
-              resetTypeToString(attrDecl.getElement());
-          }
-        }
-      }
-    }
-    XSDTypeDefinition base = type.getBaseTypeDefinition();
-    if (base != null && base == deletedItem)
-    {
-      String msg = XSDEditorPlugin.getXSDString("_INFO_RESET_COMPLEX_TYPE") +
-              " <" + getNamedComponentName(type) + "> " +
-              XSDEditorPlugin.getXSDString("_UI_DERIVATION");
-
-      addMessage(msg, type);
-      
-      type.setBaseTypeDefinition(null);
-
-      java.util.List listOfCT = schema.getTypeDefinitions();
-      XSDTypeDefinition typeDefinition = null;
-      if (listOfCT.size() > 0)
-      {
-        for (Iterator iter = listOfCT.iterator(); iter.hasNext(); )
-        {
-          typeDefinition = (XSDTypeDefinition)iter.next();
-          if (typeDefinition != deletedItem)
-          {
-            type.setBaseTypeDefinition(typeDefinition);
-          }
-        }
-      }
-    }
-  }
-
-  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
-  {
-    if (type.getBaseTypeDefinition() == deletedItem)
-    {
-      type.setBaseTypeDefinition(schema.resolveSimpleTypeDefinition(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string"));
-    }
-  }
-
-  protected void resetTypeToString(Element element)
-  {
-    String prefix = element.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-    
-    element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, prefix + "string"); 
-  }
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/XSDExternalFileCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/XSDExternalFileCleanup.java
deleted file mode 100644
index aa40416..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/XSDExternalFileCleanup.java
+++ /dev/null
@@ -1,299 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.delete;
-
-import java.text.MessageFormat;
-import java.util.Iterator;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDExternalFileCleanup extends BaseCleanup
-{
-  /**
-   * Constructor for XSDExternalFileCleanup.
-   */
-  public XSDExternalFileCleanup(String oldFilename)
-  {
-    super();
-    this.oldFilename = oldFilename;
-  }
-  
-  protected XSDSchema deletedSchema;
-  public XSDExternalFileCleanup(XSDSchema deletedSchema)
-  {
-    this.deletedSchema = deletedSchema;
-  }
-
-  protected String oldFilename;
-  
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitElementDeclaration(XSDElementDeclaration)
-   */
-  public void visitElementDeclaration(XSDElementDeclaration element)
-  {
-    boolean addMessage = true;
-    String schemaLocation = element.getSchema().getSchemaLocation();
-    if (schemaLocation!= null)
-    {
-      if (!schemaLocation.equals(schema.getSchemaLocation()))
-      {
-        addMessage = false;
-      }
-    }
-    if (element.isElementDeclarationReference())
-    {
-      if (isFromDeletedSchema(element.getResolvedElementDeclaration()))
-      {
-        if (addMessage)
-        {
-          // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ELEMENT_REFERENCE") + " <" + getNamedComponentName(element.getContainer()) + ">";
-					String msg = "_INFO_REMOVE_ELEMENT_REFERENCE" + " <" + getNamedComponentName(element.getContainer()) + ">";
-          addMessage(msg, element.getContainer());
-        }
-        childrenToRemove.add(element.getElement());
-//        Element domElement = element.getElement();
-//        domElement.getParentNode().removeChild(domElement);     
-      }
-    }
-    else if (removeType(element))
-    {
-      String msg = "";
-      if (element.isGlobal())
-      {
-      	// String pattern = XSDPlugin.getSchemaString("_INFO_RESET_GLOBAL_ELEMENT");
-				String pattern = "_INFO_RESET_GLOBAL_ELEMENT";
-        Object args[] = {element.getName()};
-        msg = MessageFormat.format(pattern, args);
-      }
-      else
-      {
-      	// msg = XSDPlugin.getSchemaString("_INFO_RESET_ELEMENT");
-				msg = "_INFO_RESET_ELEMENT";
-      	// msg += "<" + element.getName() + "> " + XSDPlugin.getSchemaString("_UI_TO_TYPE_STRING");
-				msg += "<" + element.getName() + "> " + "_UI_TO_TYPE_STRING";
-      }
-      if (addMessage)
-      {
-        addMessage(msg, element);
-      }
-    }
-
-
-    super.visitElementDeclaration(element);
-  }
-
-  protected void resetTypeToString(Element element)
-  {
-    String prefix = element.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-    
-    element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, prefix + "string"); 
-  }
-  
-  protected boolean removeType(XSDElementDeclaration element)
-  {
-  	if (removeType(element.getTypeDefinition()))
-  	{
-      resetTypeToString(element.getElement());
-  	  return true;
-  	}
-  	return false;
-  }
-  
-  protected boolean isFromDeletedSchema(XSDConcreteComponent component)
-  {
-    if (component == null)
-    {
-      return false;
-    }
-    XSDConcreteComponent root = component.getRootContainer();
-
-    boolean isFromDeletedSchema = false;
-    if (deletedSchema.getContents() != null)
-    {
-      Iterator contents = deletedSchema.getContents().iterator();
-      while (contents.hasNext())
-      {
-        XSDSchemaContent content = (XSDSchemaContent)contents.next();
-        if (content instanceof XSDSchemaDirective)
-        {
-          XSDSchema aSchema = ((XSDSchemaDirective)content).getResolvedSchema();
-          if (root != null && root.equals(aSchema))
-          {
-            isFromDeletedSchema = true;
-          }
-        }
-      }
-    }
-    if (root != null && root.equals(deletedSchema))
-    {
-      isFromDeletedSchema = true;
-    }
-    return isFromDeletedSchema;
-  }
-      
-  /**
-   * Remove the type from the element if it belongs to the external file
-   */
-  protected boolean removeType(XSDTypeDefinition typeDef)
-  {
-    if (typeDef == null)
-    {
-      return false;
-    }
-    return isFromDeletedSchema(typeDef);
-  }
-
-  /**
-   * @see org.eclipse.wst.xsd.utility.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
-   */
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    super.visitComplexTypeDefinition(type);
-    if (type.getAttributeContents() != null)
-    {
-      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
-        if (attrGroupContent instanceof XSDAttributeUse)
-        {
-          XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
-          XSDAttributeDeclaration attrDecl = attrUse.getContent();
-          
-          // now is this a reference?
-          if (attrDecl.isAttributeDeclarationReference())
-          {
-            if (isFromDeletedSchema(attrDecl.getResolvedAttributeDeclaration()))
-            {
-              String name = getNamedComponentName(type);
-              // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ATTRIBUTE_REFERENCE") +
-							String msg = "_INFO_REMOVE_ATTRIBUTE_REFERENCE" +
-                       " <" + name + ">";
-              addMessage(msg, attrDecl.getContainer());
-              
-              childrenToRemove.add(attrDecl.getElement());
-            }
-          }
-          // otherwise check the type of the attribute and see if it is from the deleted schema
-          else
-          {
-            if (removeType(attrDecl.getTypeDefinition()))
-            {
-              // reset the type of the attribute decl to string
-              // String msg = XSDPlugin.getSchemaString("_INFO_RESET_ATTRIBUTE") +
-							String msg = "_INFO_RESET_ATTRIBUTE" +
-                          " <" + attrDecl.getName() + "> " +
-                          // XSDPlugin.getSchemaString("_UI_TO_TYPE_STRING");
-							            "_UI_TO_TYPE_STRING";
-              addMessage(msg, attrDecl);
-              resetTypeToString(attrDecl.getElement());
-
-            }
-          }
-        }
-        else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
-        {
-          XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) attrGroupContent;
-          
-          if (isFromDeletedSchema(attrGroupDef.getResolvedAttributeGroupDefinition()))
-          {
-          	// remove the attribute group reference
-            String name = getNamedComponentName(type);
-            // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE") + " <" + name + ">";
-						String msg = "_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE" + " <" + name + ">";
-
-            addMessage(msg, attrGroupDef.getContainer());
-            
-            childrenToRemove.add(attrGroupDef.getElement());
-          }
-        }
-      }
-    }
-
-    // For the complex type with simple content case, see the visitComplexTypeDefinition method
-    XSDTypeDefinition base = type.getBaseTypeDefinition();
-    if (base instanceof XSDSimpleTypeDefinition)
-    {
-      XSDSimpleTypeDefinition baseType = (XSDSimpleTypeDefinition)base;
-      if (isFromDeletedSchema(baseType))
-      {
-        // String msg = XSDPlugin.getSchemaString("_INFO_RESET_COMPLEX_TYPE") +
-				String msg = "_INFO_RESET_COMPLEX_TYPE" +
-                " <" + getNamedComponentName(type) + "> " +
-                // XSDPlugin.getSchemaString("_UI_DERIVATION");
-				        "_UI_DERIVATION";
-        addMessage(msg, type);
-      
-        type.setBaseTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition("string"));
-      }
-    }
-  }
-
-  /**
-   * @see org.eclipse.wst.xsd.utility.XSDVisitor#visitModelGroupDefinition(XSDModelGroupDefinition)
-   */
-  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroup)
-  {
-    super.visitModelGroupDefinition(modelGroup);
-    if (modelGroup.isModelGroupDefinitionReference())
-    {
-      if (isFromDeletedSchema(modelGroup.getResolvedModelGroupDefinition()))
-      {
-        String name = getNamedComponentName(modelGroup);
-        // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_GROUP_REFERENCE") + " <" + name + ">";
-				String msg = "_INFO_REMOVE_GROUP_REFERENCE" + " <" + name + ">";
-        addMessage(msg, modelGroup.getContainer());
-        childrenToRemove.add(modelGroup.getElement());
-      }
-    }      
-  }
-
-  /**
-   * @see org.eclipse.wst.xsd.utility.XSDVisitor#visitSimpleTypeDefinition(XSDSimpleTypeDefinition)
-   */
-  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
-  {
-    super.visitSimpleTypeDefinition(type);
-    XSDSimpleTypeDefinition baseType = type.getBaseTypeDefinition();
-    if (isFromDeletedSchema(baseType))
-    {
-      // String msg = XSDPlugin.getSchemaString("_INFO_RESET_SIMPLE_TYPE") +
-			String msg = "_INFO_RESET_SIMPLE_TYPE" +
-              " <" + getNamedComponentName(type) + "> " +
-              // XSDPlugin.getSchemaString("_UI_DERIVATION");
-			        "_UI_DERIVATION";
-      addMessage(msg, type);
-      
-
-    // This will set the simple Type base to string 
-    // For the complex type with simple content case, see the visitComplexTypeDefinition method
-
-      type.getFacetContents().clear();
-      type.getFacets().clear();
-      type.setBaseTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition("string"));
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties
deleted file mode 100644
index 5432863..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties
+++ /dev/null
@@ -1,33 +0,0 @@
-RefactorMenu.label=Refactor
-RefactorActionGroup.no_refactoring_available=<no refactoring available>
-
-RenameAction.rename=Rename
-RenameAction.unavailable=Operation unavailable on the current selection.\nSelect a ....
-RenameAction.text=Re&name...
-
-RenameInputWizardPage.new_name= &New name:
-RenameRefactoringWizard.internal_error= Internal error during name checking: {0}
-
-
-RenameXSDElementAction.exception=Unexpected exception occurred. See log for details
-RenameXSDElementAction.not_available=Operation unavailable on the current selection.\nSelect a XSD project, folder, resource, file, attribute declarations,  attribute group definitions, complex type definitions, element declarations, identity constraint definitions, model groups definitions, notation declarations, or simple type definitions.
-RenameXSDElementAction.name=Rename
-
-
-RenameSupport.dialog.title=Rename
-RenameSupport.not_available=Rename support not available
-
-RenameComponentWizard.defaultPageTitle=Rename wizard
-RenameComponentWizard.inputPage.description=Rename XML Schema component
-
-RenameInputWizardPage.update_references=Update references
-XSDComponentRenameChange.name=XML Schema component renaming: {0} to {1}
-XSDComponentRenameChange.Renaming=Renaming...
-XSDResourceRenameParticipant.compositeChangeName=XSD file rename references updating changes
-XSDRenameResourceChange.rename_resource=Renaming resource name references
-XSDRenameResourceChange.name=Resource rename: {0} to {1}
-RenameResourceRefactoring.Internal_Error=Internal error
-RenameResourceRefactoring.alread_exists=Resource already exist
-RenameResourceRefactoring.invalidName=Invalid resource name
-RenameResourceProcessor.name=Resource renaming
-MakeLocalElementGlobalAction.text=Make Local Element Global
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseCleanup.java
deleted file mode 100644
index 3a3da3b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseCleanup.java
+++ /dev/null
@@ -1,105 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-
-public abstract class BaseCleanup extends XSDVisitor
-{
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitSchema(XSDSchema)
-   */
-  public void visitSchema(XSDSchema schema)
-  {
-    super.visitSchema(schema);
-    
-    // now remove all children that were queued up for removal
-    
-    for (Iterator iter = childrenToRemove.iterator(); iter.hasNext(); )
-    {
-      Element domElement = (Element) iter.next();
-      XSDDOMHelper.removeNodeAndWhitespace(domElement);
-//      domElement.getParentNode().removeChild(domElement);
-    }
-  }
-
-
-  protected ArrayList messages = new ArrayList();
-
-  public ArrayList getMessages()
-  {
-  	return messages;
-  }
-  
-
-  protected void addMessage(String msg, XSDConcreteComponent component)
-  {
-////    ErrorMessage message = new ErrorMessage();
-//    
-//    XSDConcreteComponent currComp = component;
-//    while (!(currComp instanceof XSDSchemaContent) && currComp.getContainer() != null)
-//    {
-//      currComp = currComp.getContainer();
-//    }
-//
-//    Element domElement = currComp.getElement();
-//    Node parent = domElement;
-//    while (!(parent instanceof NodeImpl) && parent != null)
-//    {
-//      parent = parent.getParentNode();
-//    }
-//    if (parent instanceof NodeImpl)
-//    {
-//      // message.setModelObject(currComp.getElement());
-//			message.setTargetObject(currComp.getElement());
-//    }
-//    message.setLocalizedMessage(msg);
-//  ???
-//    addMessage(message);
-  }
-    
-
-// // protected void addMessage(ErrorMessage message)
-//	protected void addMessage(Message message)
-//  {
-//    messages.add(message);
-//  }
-  
-
-  protected ArrayList childrenToRemove = new ArrayList();
-  
-
-  protected String getNamedComponentName(XSDConcreteComponent concrete)
-  {
-    String name = null;
-    if (concrete instanceof XSDNamedComponent)
-    {
-      name = ((XSDNamedComponent)concrete).getName();
-    }
-    
-    XSDConcreteComponent comp = concrete;
-    while (comp != null && name == null)
-    {
-      comp = comp.getContainer();
-      if (comp instanceof XSDNamedComponent)
-      {
-        name = ((XSDNamedComponent)comp).getName();
-      }
-    }
-    return name != null ? name : "";
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseRenamer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseRenamer.java
deleted file mode 100644
index 1a789e8..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseRenamer.java
+++ /dev/null
@@ -1,61 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-/**
- * Base class for rename helpers of various named root components.  This is to be used when
- * the user renames a global element, group, attribute, attribute group, complex/simple type etc
- */
-public abstract class BaseRenamer extends XSDVisitor
-{
-
-  
-  /**
-   * Method BaseRenamer.
-   * @param globalComponent - this is the component (who's parent is the schema) that has been renamed
-   */
-  public BaseRenamer(XSDNamedComponent globalComponent, String newName)
-  {
-    this.globalComponent = globalComponent;
-    this.newName = newName;
-  }
-  
-  public String getNewQName()
-  {
-    String qName = null;
-    if (newName != null)
-    {
-      qName = XSDConstants.lookupQualifier(globalComponent.getElement(), globalComponent.getTargetNamespace());
-      if (qName != null && qName.length() > 0)
-      {
-        qName += ":" + newName;
-      }
-      else
-      {
-        qName = newName; 
-      }
-    }
-    else
-    {
-      qName = newName;
-    }
-    
-    return qName;
-  }
-  
-  protected String newName;
-  protected XSDNamedComponent globalComponent;
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameChange.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameChange.java
deleted file mode 100644
index 678c77f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameChange.java
+++ /dev/null
@@ -1,193 +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.xsd.ui.internal.refactor.rename;
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.text.Assert;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.TextChange;
-import org.eclipse.ltk.core.refactoring.TextFileChange;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDSwitch;
-
-
-/**
- * @author ebelisar
- *
- */
-public class ComponentRenameChange extends Change {
-	
-	private Map fChanges;
-	private String fNewName;
-
-	private String fOldName;
-
-	private XSDNamedComponent fNamedComponent;
-
-	public ComponentRenameChange(XSDNamedComponent component, String oldName, String newName) {
-		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
-		Assert.isNotNull(oldName, "old name"); //$NON-NLS-1$
-
-		fNamedComponent = component;
-		fOldName= oldName;
-		fNewName= newName;
-	}
-	
-//	public static Change[] createChangesFor(XSDNamedComponent component, String newName) {
-//		// TODO: P1 implement search of XSD files	
-//		XSDSearchSupport support = XSDSearchSupport.getInstance();
-//		RefactorSearchRequestor requestor = new RefactorSearchRequestor(component, newName);
-//		support.searchRunnable(component, IXSDSearchConstants.WORKSPACE_SCOPE, requestor);
-//
-//		return requestor.getChanges();
-//
-//	}
-
-	protected Change createUndoChange() {
-		return new ComponentRenameChange(fNamedComponent, getNewName(), getOldName());
-	}
-	
-	protected void doRename(IProgressMonitor pm) throws CoreException {
-		// TODO P1 change temporary rename of XSD model components 
-		performModify(getNewName());
-	}
-	
-	public void performModify(final String value)
-	  {
-	    if (value.length() > 0)
-	    {
-	      DelayedRenameRunnable runnable = new DelayedRenameRunnable(fNamedComponent, value);
-	      Display.getCurrent().asyncExec(runnable);
-	    }
-	  }      
-
-	  protected static class DelayedRenameRunnable implements Runnable
-	  {
-	    protected XSDNamedComponent component;
-	    protected String name;
-
-	    public DelayedRenameRunnable(XSDNamedComponent component, String name)
-	    {                                                               
-	      this.component = component;
-	      this.name = name;
-	    }                                                              
-
-	    public void run()
-	    {                      
-	      component.updateElement(true);
-	      XSDSwitch xsdSwitch = new XSDSwitch()
-	      {                   
-	        public Object caseXSDTypeDefinition(XSDTypeDefinition object)
-	        {
-	          new GlobalSimpleOrComplexTypeRenamer(object, name).visitSchema(object.getSchema());
-	          return null;
-	        } 
-	      
-	        public Object caseXSDElementDeclaration(XSDElementDeclaration object)
-	        {           
-	          if (object.isGlobal())
-	          {
-	            new GlobalElementRenamer(object, name).visitSchema(object.getSchema());
-	          }
-	          return null;
-	        }
-	      
-	        public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
-	        {
-	          new GlobalGroupRenamer(object, name).visitSchema(object.getSchema());
-	          return null;
-	        }
-	      };
-	      xsdSwitch.doSwitch(component); 
-	      component.setName(name);
-	     
-	    }
-	  }
-	
-	public TextChange getChange(IFile file) {
-		TextChange result= (TextChange)fChanges.get(file);
-		if (result == null) {
-			result= new TextFileChange(file.getName(), file);
-			fChanges.put(file, result);
-		}
-		return result;
-	}
-	
-	public String getName() {
-		return RefactoringMessages.getFormattedString("XSDComponentRenameChange.name", new String[]{getOldName(), getNewName()}); //$NON-NLS-1$
-	}
-
-	public final Change perform(IProgressMonitor pm) throws CoreException {
-		try {
-			pm.beginTask(RefactoringMessages.getString("XSDComponentRenameChange.Renaming"), 1); //$NON-NLS-1$
-			Change result= createUndoChange();
-			doRename(new SubProgressMonitor(pm, 1));
-			return result;
-		} finally {
-			pm.done();
-		}
-	}
-
-	/**
-	 * Gets the newName.
-	 * 
-	 * @return Returns a String
-	 */
-	protected String getNewName() {
-		return fNewName;
-	}
-
-	/**
-	 * Gets the oldName
-	 * 
-	 * @return Returns a String
-	 */
-	protected String getOldName() {
-		return fOldName;
-	}
-
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.Change#getModifiedElement()
-	 */
-	public Object getModifiedElement() {
-		// TODO Auto-generated method stub
-		return fNamedComponent;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public void initializeValidationData(IProgressMonitor pm) {
-		// TODO Auto-generated method stub
-
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.Change#isValid(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
-			OperationCanceledException {
-		// TODO implement change validation
-		return new RefactoringStatus();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeGroupRenamer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeGroupRenamer.java
deleted file mode 100644
index d01ec4f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeGroupRenamer.java
+++ /dev/null
@@ -1,57 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.Iterator;
-
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class GlobalAttributeGroupRenamer extends BaseRenamer
-{
-  /**
-   * Constructor for GlobalAttributeGroupRenamer.
-   * @param globalComponent
-   */
-  public GlobalAttributeGroupRenamer(XSDNamedComponent globalComponent, String newName)
-  {
-    super(globalComponent, newName);
-  }
-
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
-   */
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    super.visitComplexTypeDefinition(type);
-    if (type.getAttributeContents() != null)
-    {
-      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
-
-        if (attrGroupContent instanceof XSDAttributeGroupDefinition)
-        {
-          XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) attrGroupContent;
-          
-          if (globalComponent.equals(attrGroupDef.getResolvedAttributeGroupDefinition()))
-          {
-            attrGroupDef.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getNewQName());
-          }
-        }
-      }
-    }
-    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeRenamer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeRenamer.java
deleted file mode 100644
index d1b3e68..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeRenamer.java
+++ /dev/null
@@ -1,66 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.Iterator;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class GlobalAttributeRenamer extends BaseRenamer
-{
-  /**
-   * Constructor for GlobalAttributeRenamer.
-   * @param globalComponent
-   */
-  public GlobalAttributeRenamer(XSDNamedComponent globalComponent, String newName)
-  {
-    super(globalComponent, newName);
-  }
-  
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
-   */
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    super.visitComplexTypeDefinition(type);
-    if (type.getAttributeContents() != null)
-    {
-      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
-        if (attrGroupContent instanceof XSDAttributeUse)
-        {
-          XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
-          XSDAttributeDeclaration attrDecl = attrUse.getContent();
-          
-          // now is this a reference?
-          if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
-          {
-            if (globalComponent.equals(attrDecl.getResolvedAttributeDeclaration()))
-            {
-              attrDecl.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getNewQName());           
-            }
-          }
-        }
-      }
-    }
-  }
-
-
-  
-
-  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalElementRenamer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalElementRenamer.java
deleted file mode 100644
index 869d775..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalElementRenamer.java
+++ /dev/null
@@ -1,41 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class GlobalElementRenamer extends BaseRenamer
-{
-  /**
-   * Constructor for GlobalElementRenamer.
-   * @param globalComponent
-   */
-  public GlobalElementRenamer(XSDNamedComponent globalComponent, String newName)
-  {
-    super(globalComponent, newName);
-  }
-  
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitElementDeclaration(XSDElementDeclaration)
-   */
-  public void visitElementDeclaration(XSDElementDeclaration element)
-  {
-    super.visitElementDeclaration(element);
-    if (element.isElementDeclarationReference() &&
-        globalComponent.equals(element.getResolvedElementDeclaration()))
-    {
-      element.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getNewQName());
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalGroupRenamer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalGroupRenamer.java
deleted file mode 100644
index b29b8e4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalGroupRenamer.java
+++ /dev/null
@@ -1,43 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class GlobalGroupRenamer extends BaseRenamer
-{
-
-  /**
-   * Constructor for GlobalGroupRenamer.
-   * @param globalComponent
-   */
-  public GlobalGroupRenamer(XSDNamedComponent globalComponent, String newName)
-  {
-    super(globalComponent, newName);
-  }
-
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitModelGroupDefinition(XSDModelGroupDefinition)
-   */
-  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroup)
-  {
-    super.visitModelGroupDefinition(modelGroup);
-    if (modelGroup.isModelGroupDefinitionReference())
-    {
-      if (globalComponent.equals(modelGroup.getResolvedModelGroupDefinition()))
-      {
-        modelGroup.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getNewQName());
-      }
-    }      
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalSimpleOrComplexTypeRenamer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalSimpleOrComplexTypeRenamer.java
deleted file mode 100644
index 63e4a67..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalSimpleOrComplexTypeRenamer.java
+++ /dev/null
@@ -1,91 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class GlobalSimpleOrComplexTypeRenamer extends BaseRenamer
-{
-  /**
-   * Constructor for GlobalSimpleOrComplexTypeRenamer.
-   * @param globalComponent
-   */
-  public GlobalSimpleOrComplexTypeRenamer(XSDNamedComponent globalComponent, String newName)
-  {
-    super(globalComponent, newName);
-  }
-  
-  
-  /**
-   * 
-   */
-  public void visitElementDeclaration(XSDElementDeclaration element)
-  {
-    if (!element.isElementDeclarationReference() &&
-        globalComponent.equals(element.getTypeDefinition()))
-    {
-      element.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName());
-    }
-
-    super.visitElementDeclaration(element);
-  }
-
-
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
-   */
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    super.visitComplexTypeDefinition(type);
-    if (type.getAttributeContents() != null)
-    {
-      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
-        if (attrGroupContent instanceof XSDAttributeUse)
-        {
-          XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
-          XSDAttributeDeclaration attrDecl = attrUse.getContent();
-          
-          // now is this a reference?
-          if (!attrDecl.isAttributeDeclarationReference() &&
-              globalComponent.equals(attrDecl.getTypeDefinition()))
-          {
-            attrDecl.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName());
-          }
-        }
-      }
-    }
-
-    XSDTypeDefinition base = type.getBaseTypeDefinition();
-    if (base.equals(globalComponent))
-    {
-      XSDDOMHelper helper = new XSDDOMHelper();
-      Element derivedByNode = helper.getDerivedByElementFromComplexType(type.getElement());
-      if (derivedByNode != null)
-      {
-        derivedByNode.setAttribute(XSDConstants.BASE_ATTRIBUTE, getNewQName());
-      }
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/INameUpdating.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/INameUpdating.java
deleted file mode 100644
index 7aa495e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/INameUpdating.java
+++ /dev/null
@@ -1,32 +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.xsd.ui.internal.refactor.rename;
-
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-
-/**
- * @author ebelisar
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public interface INameUpdating {
-	//---- INameUpdating ---------------------------------------------------
-	public abstract void setNewElementName(String newName);
-
-	public abstract String getNewElementName();
-
-	public abstract String getCurrentElementName();
-
-	/* non java-doc
-	 * @see IRenameRefactoring#checkNewName()
-	 */public abstract RefactoringStatus checkNewElementName(String newName);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
deleted file mode 100644
index 7d1cf38..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
+++ /dev/null
@@ -1,227 +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.xsd.ui.internal.refactor.rename;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.xsd.XSDNamedComponent;
-
-public class RenameComponentProcessor extends RenameProcessor  implements INameUpdating{
-	
-	private XSDNamedComponent fNamedComponent;
-	private String fNewElementName;
-
-	public static final String IDENTIFIER= "org.eclipse.wst.ui.xsd.renameComponentProcessor"; //$NON-NLS-1$
-
-	//private QualifiedNameSearchResult fNameSearchResult;
-	
-	public RenameComponentProcessor(XSDNamedComponent element, String newName) {
-		fNamedComponent= element;
-		fNewElementName = newName;
-		
-	}
-	
-	public XSDNamedComponent getNamedComponent() {
-		return fNamedComponent;
-	}
-
-	
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#canEnableTextUpdating()
-	 */
-	public boolean canEnableTextUpdating() {
-		return true;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#getCurrentElementName()
-	 */
-	public String getCurrentElementName() {
-		
-		return fNamedComponent.getName();
-	}
-
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.wst.xsd.internal.refactoring.rename.XSDRenameProcessor#getAffectedProjectNatures()
-	 */
-	protected String[] getAffectedProjectNatures() throws CoreException {
-		//TODO: find project natures of the files that are going to be refactored
-		return new String[0];
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.wst.xsd.internal.refactoring.rename.XSDRenameProcessor#loadDerivedParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus, java.util.List, java.lang.String[], org.eclipse.ltk.core.refactoring.participants.SharableParticipants)
-	 */
-	protected void loadDerivedParticipants(RefactoringStatus status,
-			List result, String[] natures, SharableParticipants shared)
-			throws CoreException {
-		// TODO: provide a way to load rename participants
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
-	 */
-	public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
-			CheckConditionsContext context) throws CoreException,
-			OperationCanceledException {
-		// TODO add code to check final conditions for component rename
-		return new RefactoringStatus();
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
-			throws CoreException, OperationCanceledException {
-//		 TODO add code to check initial conditions for component rename
-		return new RefactoringStatus();
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public Change createChange(IProgressMonitor pm) throws CoreException,
-			OperationCanceledException {
-		// TODO P1 add change creation
-//		Change[] changes = XSDComponentRenameChange.createChangesFor(this.fNamedComponent, getNewElementName());
-//		CompositeChange multiChange = null; 
-//			if(changes.length > 0)
-//				multiChange  = new CompositeChange("XSD component rename participant changes", changes); //$NON-NLS-1$ TODO: externalize string
-//		return multiChange;
-		
-//		computeNameMatches(pm);	
-//		Change[] changes = fNameSearchResult.getAllChanges();
-//		return new CompositeChange("XSD file rename participant changes", changes); //TODO: externalize string
-		pm.beginTask("", 1); //$NON-NLS-1$
-		try{
-			return new ComponentRenameChange(fNamedComponent, fNamedComponent.getName(), getNewElementName());
-		} finally{
-			pm.done();
-		}	 
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
-	 */
-	public Object[] getElements() {
-		
-		return new Object[] {fNamedComponent};
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
-	 */
-	public String getIdentifier() {
-		return IDENTIFIER;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
-	 */
-	public String getProcessorName() {
-		return RefactoringMessages.getFormattedString(
-				"RenameComponentRefactoring.name",  //$NON-NLS-1$
-				new String[]{fNamedComponent.getTargetNamespace() + ":" + fNamedComponent.getName(), getNewElementName()});
-
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
-	 */
-	public boolean isApplicable() throws CoreException {
-		if (fNamedComponent == null)
-			return false;
-		// TODO implement isApplicable logic for the named component, 
-		// verify how it is different from other condition checks
-//		if (fNamedComponent.isAnonymous())
-//			return false;
-//		if (! Checks.isAvailable(fType))
-//			return false;
-//		if (isSpecialCase(fType))
-//			return false;
-		return true;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#checkNewElementName(java.lang.String)
-	 */
-	public RefactoringStatus checkNewElementName(String newName){
-		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
-		// TODO: implement new name checking
-//		RefactoringStatus result = Checks.checkTypeName(newName);
-//		if (Checks.isAlreadyNamed(fType, newName))
-//			result.addFatalError(RefactoringCoreMessages.getString("RenameTypeRefactoring.choose_another_name"));	 //$NON-NLS-1$
-		return new RefactoringStatus();
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#getNewElement()
-	 */
-	public Object getNewElement() throws CoreException {
-		// TODO implement this method, it's used for updating selection on new element
-		return null;
-	}
-	
-//	private void computeNameMatches(IProgressMonitor pm) throws CoreException {
-//	
-//	    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
-//	    try {
-//			URL fileURL = Platform.resolve(new URL(fNamedComponent.getSchema().getSchemaLocation()));
-//			IFile file = workspaceRoot.getFileForLocation(new Path(fileURL.getPath()));
-//			if (fNameSearchResult == null)
-//				fNameSearchResult= new QualifiedNameSearchResult();
-//			QualifiedNameFinder.process(fNameSearchResult, getNamedComponent().getName(),  
-//				getNewElementName(), 
-//				"*.xsd", file.getProject(), pm);
-//		} catch (IOException e) {
-//			// TODO Auto-generated catch block
-//			e.printStackTrace();
-//		}
-//	}
-	
-	public final RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException {
-		RenameArguments arguments= new RenameArguments(getNewElementName(), true);
-		String[] natures= getAffectedProjectNatures();
-		List result= new ArrayList();
-		loadElementParticipants(status, result, arguments, natures, sharedParticipants);
-		loadDerivedParticipants(status, result, natures, sharedParticipants);
-		return (RefactoringParticipant[])result.toArray(new RefactoringParticipant[result.size()]);
-	}
-	
-	protected void loadElementParticipants(RefactoringStatus status, List result, RenameArguments arguments, String[] natures, SharableParticipants shared) throws CoreException {
-		Object[] elements= getElements();
-		for (int i= 0; i < elements.length; i++) {
-			result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status, 
-				this,  elements[i],
-				arguments, natures, shared)));
-		}
-	}
-	
-	
-	public void setNewElementName(String newName) {
-		
-		fNewElementName= newName;
-	}
-
-	public String getNewElementName() {
-		return fNewElementName;
-	}
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameInputWizardPage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameInputWizardPage.java
deleted file mode 100644
index c072b5e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameInputWizardPage.java
+++ /dev/null
@@ -1,253 +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.xsd.ui.internal.refactor.rename;
-
-
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-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.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-
-/**
- * @author ebelisar
- *
- */
-public class RenameInputWizardPage  extends UserInputWizardPage{
-	private String fInitialValue;
-	private Text fTextField;
-	private Button fUpdateReferences;
-	/**
-	 * Creates a new text input page.
-	 * @param isLastUserPage <code>true</code> if this page is the wizard's last
-	 *  user input page. Otherwise <code>false</code>.
-	 */
-	public RenameInputWizardPage(String description, boolean isLastUserPage) {
-		this(description, isLastUserPage, ""); //$NON-NLS-1$
-	}
-	
-	/**
-	 * Creates a new text input page.
-	 * @param isLastUserPage <code>true</code> if this page is the wizard's last
-	 *  user input page. Otherwise <code>false</code>
-	 * @param initialValue the initial value
-	 */
-	public RenameInputWizardPage(String description, boolean isLastUserPage, String initialValue) {
-	    super("RenameInputWizardPage");
-		Assert.isNotNull(initialValue);
-		setDescription(description);
-		fInitialValue= initialValue;
-	}
-	
-	/**
-	 * Returns whether the initial input is valid. Typically it is not, because the 
-	 * user is required to provide some information e.g. a new type name etc.
-	 * 
-	 * @return <code>true</code> iff the input provided at initialization is valid
-	 */
-	protected boolean isInitialInputValid(){
-		return false;
-	}
-	
-	/**
-	 * Returns whether an empty string is a valid input. Typically it is not, because 
-	 * the user is required to provide some information e.g. a new type name etc.
-	 * 
-	 * @return <code>true</code> iff an empty string is valid
-	 */
-	protected boolean isEmptyInputValid(){
-		return false;
-	}
-	
-	/**
-	 * Returns the content of the text input field.
-	 * 
-	 * @return the content of the text input field. Returns <code>null</code> if
-	 * not text input field has been created
-	 */
-	protected String getText() {
-		if (fTextField == null)
-			return null;
-		return fTextField.getText();	
-	}
-	
-	/**
-	 * Sets the new text for the text field. Does nothing if the text field has not been created.
-	 * @param text the new value
-	 */
-	protected void setText(String text) {
-		if (fTextField == null)
-			return;
-		fTextField.setText(text);
-	}
-	
-	/**
-	 * Performs input validation. Returns a <code>RefactoringStatus</code> which
-	 * describes the result of input validation. <code>Null<code> is interpreted
-	 * as no error.
-	 */
-	protected RefactoringStatus validateTextField(String text){
-		return null;
-	}
-	
-	protected Text createTextInputField(Composite parent) {
-		return createTextInputField(parent, SWT.BORDER);
-	}
-	
-	protected Text createTextInputField(Composite parent, int style) {
-		fTextField= new Text(parent, style);
-		fTextField.addModifyListener(new ModifyListener() {
-			public void modifyText(ModifyEvent e) {
-				textModified(getText());
-			}
-		});
-		fTextField.setText(fInitialValue);
-		return fTextField;
-	}
-	
-	/**
-	 * Checks the page's state and issues a corresponding error message. The page validation
-	 * is computed by calling <code>validatePage</code>.
-	 */
-	protected void textModified(String text) {	
-		if (! isEmptyInputValid() && text.equals("")){ //$NON-NLS-1$
-			setPageComplete(false);
-			setErrorMessage(null);
-			restoreMessage();
-			return;
-		}
-		if ((! isInitialInputValid()) && text.equals(fInitialValue)){
-			setPageComplete(false);
-			setErrorMessage(null);
-			restoreMessage();
-			return;
-		}
-		
-		setPageComplete(validateTextField(text));
-		
-//		 TODO: enable preview in M4
-		getRefactoringWizard().setForcePreviewReview(false);
-		getContainer().updateButtons();
-	
-	}
-	
-	/**
-	 * Subclasses can override if they want to restore the message differently.
-	 * This implementation calls <code>setMessage(null)</code>, which clears the message 
-	 * thus exposing the description.
-	 */
-	protected void restoreMessage(){
-		setMessage(null);
-	}
-	
-	/* (non-Javadoc)
-	 * Method declared in IDialogPage
-	 */
-	public void dispose() {
-		fTextField= null;	
-	}
-	
-	/* (non-Javadoc)
-	 * Method declared in WizardPage
-	 */
-	public void setVisible(boolean visible) {
-		if (visible) {
-			textModified(getText());
-		}
-		super.setVisible(visible);
-		if (visible && fTextField != null) {
-			fTextField.setFocus();
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
-	 */
-	public void createControl(Composite parent) {
-		Composite superComposite= new Composite(parent, SWT.NONE);
-		setControl(superComposite);
-		initializeDialogUnits(superComposite);
-		
-		superComposite.setLayout(new GridLayout());
-		Composite composite= new Composite(superComposite, SWT.NONE);
-		composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));	
-		
-		GridLayout layout= new GridLayout();
-		layout.numColumns= 2;
-		layout.verticalSpacing= 8;
-		composite.setLayout(layout);
-		
-		
-		Label label= new Label(composite, SWT.NONE);
-		label.setText(getLabelText());
-		
-		Text text= createTextInputField(composite);
-		text.selectAll();
-		GridData gd= new GridData(GridData.FILL_HORIZONTAL);
-		gd.widthHint= convertWidthInCharsToPixels(25);
-		text.setLayoutData(gd);
-		
-		addOptionalUpdateReferencesCheckbox(superComposite);
-		gd= new GridData(GridData.FILL_HORIZONTAL);
-		text.setLayoutData(gd);
-		
-		// TODO: enable preview in M4
-		getRefactoringWizard().setForcePreviewReview(false);
-		
-		Dialog.applyDialogFont(superComposite);
-		//WorkbenchHelp.setHelp(getControl(), fHelpContextID);
-
-	}
-	
-	private static Button createCheckbox(Composite parent, String title, boolean value) {
-		Button checkBox= new Button(parent, SWT.CHECK);
-		checkBox.setText(title);
-		checkBox.setSelection(value);
-		return checkBox;		
-	}
-	
-	private void addOptionalUpdateReferencesCheckbox(Composite result) {
-//		 TODO: enable update reference optioin in M4
-//		final IReferenceUpdating ref= (IReferenceUpdating)getRefactoring().getAdapter(IReferenceUpdating.class);
-//		if (ref == null || !ref.canEnableUpdateReferences())	
-//			return;
-		String title= RefactoringMessages.getString("RenameInputWizardPage.update_references"); //$NON-NLS-1$
-		boolean defaultValue= true; 
-		fUpdateReferences= createCheckbox(result, title, defaultValue);
-//		ref.setUpdateReferences(fUpdateReferences.getSelection());
-		fUpdateReferences.addSelectionListener(new SelectionAdapter(){
-			public void widgetSelected(SelectionEvent e) {
-//		ref.setUpdateReferences(fUpdateReferences.getSelection());
-			}
-		});		
-		
-		fUpdateReferences.setEnabled(false);
-		
-	}
-	
-	protected String getLabelText() {
-		return RefactoringMessages.getString("RenameInputWizardPage.new_name"); //$NON-NLS-1$
-	}
-	
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameRefactoringWizard.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameRefactoringWizard.java
deleted file mode 100644
index 4a31f2e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameRefactoringWizard.java
+++ /dev/null
@@ -1,70 +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.xsd.ui.internal.refactor.rename;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ltk.core.refactoring.Refactoring;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-
-public class RenameRefactoringWizard extends RefactoringWizard {
-	
-	private final String fInputPageDescription;
-
-	private final ImageDescriptor fInputPageImageDescriptor;
-	
-	public RenameRefactoringWizard(Refactoring refactoring, String defaultPageTitle, String inputPageDescription, 
-			ImageDescriptor inputPageImageDescriptor) {
-		super(refactoring, DIALOG_BASED_USER_INTERFACE);
-		setDefaultPageTitle(defaultPageTitle);
-    	fInputPageDescription= inputPageDescription;
-		fInputPageImageDescriptor= inputPageImageDescriptor;
-
-	}
-
-	/* non java-doc
-	 * @see RefactoringWizard#addUserInputPages
-	 */ 
-	protected void addUserInputPages() {
-		String initialSetting= getProcessor().getCurrentElementName();
-		RenameInputWizardPage inputPage= createInputPage(fInputPageDescription, initialSetting);
-		inputPage.setImageDescriptor(fInputPageImageDescriptor);
-		addPage(inputPage);
-	}
-
-	protected INameUpdating getProcessor() {
-		
-		return (INameUpdating)getRefactoring().getAdapter(INameUpdating.class);	
-	}
-	
-	
-	protected RenameInputWizardPage createInputPage(String message, String initialSetting) {
-		return new RenameInputWizardPage(message, true, initialSetting) {
-			protected RefactoringStatus validateTextField(String text) {
-				return validateNewName(text);
-			}	
-		};
-	}
-	
-	protected RefactoringStatus validateNewName(String newName) {
-		INameUpdating ref= getProcessor();
-		ref.setNewElementName(newName);
-//		try{
-			return ref.checkNewElementName(newName);
-//		} catch (CoreException e){
-//			//XXX: should log the exception
-//			String msg= e.getMessage() == null ? "": e.getMessage(); //$NON-NLS-1$
-//			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getFormattedString("RenameRefactoringWizard.internal_error", msg));//$NON-NLS-1$
-//		}	
-	}
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java
deleted file mode 100644
index fd326c4..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java
+++ /dev/null
@@ -1,170 +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.xsd.ui.internal.refactor.rename;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-
-public class RenameResourceProcessor extends RenameProcessor implements INameUpdating {
-
-	private IResource fResource;
-	private String fNewElementName;
-		
-	public static final String IDENTIFIER= "org.eclipse.wst.ui.xsd.renameResourceProcessor"; //$NON-NLS-1$
-	
-	public RenameResourceProcessor(IResource resource) {
-		fResource= resource;
-		if (fResource != null) {
-			setNewElementName(fResource.getName());
-		}
-	}
-
-	//---- INameUpdating ---------------------------------------------------
-	
-	public void setNewElementName(String newName) {
-		Assert.isNotNull(newName);
-		fNewElementName= newName;
-	}
-
-	public String getNewElementName() {
-		return fNewElementName;
-	}
-	
-	//---- IRenameProcessor methods ---------------------------------------
-		
-	public String getIdentifier() {
-		return IDENTIFIER;
-	}
-	
-	public boolean isApplicable()  {
-		if (fResource == null)
-			return false;
-		if (! fResource.exists())
-			return false;
-		if (! fResource.isAccessible())	
-			return false;
-		return true;			
-	}
-	
-	public String getProcessorName() {
-		String message= RefactoringMessages.getFormattedString("RenameResourceProcessor.name", //$NON-NLS-1$
-				new String[]{getCurrentElementName(), getNewElementName()});
-		return message;
-	}
-	
-	public Object[] getElements() {
-		return new Object[] {fResource};
-	}
-	
-	public String getCurrentElementName() {
-		return fResource.getName();
-	}
-	
-	public String[] getAffectedProjectNatures() throws CoreException {
-		return new String[0];
-	}
-
-	public Object getNewElement() {
-		return ResourcesPlugin.getWorkspace().getRoot().findMember(createNewPath(getNewElementName()));
-	}
-
-	public boolean getUpdateReferences() {
-		return true;
-	}
-	
-	public RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants shared) throws CoreException {
-		Object[] elements= getElements();
-		String[] natures= getAffectedProjectNatures();
-		List result= new ArrayList();
-		RenameArguments arguments= new RenameArguments(getNewElementName(), getUpdateReferences());
-		for (int i= 0; i < elements.length; i++) {
-			result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status, 
-				this, elements[i],
-				arguments, natures, shared)));
-		}
-		return (RefactoringParticipant[])result.toArray(new RefactoringParticipant[result.size()]);
-	}
-	
-	//--- Condition checking --------------------------------------------
-
-	public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException {
-		return new RefactoringStatus();
-	}
-	
-	/* non java-doc
-	 * @see IRenameRefactoring#checkNewName()
-	 */
-	public RefactoringStatus checkNewElementName(String newName)  {
-		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
-		IContainer c= fResource.getParent();
-		if (c == null)
-			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameResourceRefactoring.Internal_Error")); //$NON-NLS-1$
-						
-		if (c.findMember(newName) != null)
-			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameResourceRefactoring.alread_exists")); //$NON-NLS-1$
-			
-		if (!c.getFullPath().isValidSegment(newName))
-			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameResourceRefactoring.invalidName")); //$NON-NLS-1$
-	
-		RefactoringStatus result= RefactoringStatus.create(c.getWorkspace().validateName(newName, fResource.getType()));
-		if (! result.hasFatalError())
-			result.merge(RefactoringStatus.create(c.getWorkspace().validatePath(createNewPath(newName), fResource.getType())));		
-		return result;		
-	}
-	
-	/* non java-doc
-	 * @see Refactoring#checkInput(IProgressMonitor)
-	 */
-	public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context)  {
-		pm.beginTask("", 1); //$NON-NLS-1$
-		try{
-			return new RefactoringStatus();
-		} finally{
-			pm.done();
-		}	
-	}
-
-	private String createNewPath(String newName){
-		return fResource.getFullPath().removeLastSegments(1).append(newName).toString();
-	}
-		
-	//--- changes 
-	
-	/* non java-doc 
-	 * @see IRefactoring#createChange(IProgressMonitor)
-	 */
-	public Change createChange(IProgressMonitor pm) {
-		pm.beginTask("", 1); //$NON-NLS-1$
-		try{
-			return new ResourceRenameChange(fResource, getNewElementName());
-		} finally{
-			pm.done();
-		}	
-	}
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameSupport.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameSupport.java
deleted file mode 100644
index a923f3f..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameSupport.java
+++ /dev/null
@@ -1,205 +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.xsd.ui.internal.refactor.rename;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.RefactoringStatusEntry;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.actions.GlobalBuildAction;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.xsd.XSDNamedComponent;
-
-
-
-/**
- * Central access point to execute rename refactorings.
- * <p>
- * Note: this class is not intended to be subclassed.
- * </p>
- */
-public class RenameSupport {
-
-	private RenameRefactoring fRefactoring;
-	private RefactoringStatus fPreCheckStatus;
-	
-	/**
-	 * Executes some light weight precondition checking. If the returned status
-	 * is an error then the refactoring can't be executed at all. However,
-	 * returning an OK status doesn't guarantee that the refactoring can be
-	 * executed. It may still fail while performing the exhaustive precondition
-	 * checking done inside the methods <code>openDialog</code> or
-	 * <code>perform</code>.
-	 * 
-	 * The method is mainly used to determine enable/disablement of actions.
-	 * 
-	 * @return the result of the light weight precondition checking.
-	 * 
-	 * @throws CoreException if an unexpected exception occurs while performing the checking.
-	 * 
-	 * @see #openDialog(Shell)
-	 * @see #perform(Shell, IRunnableContext)
-	 */
-	public IStatus preCheck() throws CoreException {
-		ensureChecked();
-		if (fPreCheckStatus.hasFatalError())
-			return asStatus(fPreCheckStatus.getEntryMatchingSeverity(RefactoringStatus.FATAL));
-		else
-			return new Status(IStatus.OK, XSDEditorPlugin.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
-	}
-
-	/**
-	 * Opens the refactoring dialog for this rename support. 
-	 * 
-	 * @param parent a shell used as a parent for the refactoring dialog.
-	 * @throws CoreException if an unexpected exception occurs while opening the
-	 * dialog.
-	 */
-	public void openDialog(Shell parent) throws CoreException {
-		ensureChecked();
-		if (fPreCheckStatus.hasFatalError()) {
-			showInformation(parent, fPreCheckStatus);
-			return; 
-		}
-		try {
-			RefactoringWizard wizard = new RenameRefactoringWizard(
-					fRefactoring,
-					RefactoringMessages.getString("RenameComponentWizard.defaultPageTitle"), //$NON-NLS-1$ TODO: provide correct strings
-					RefactoringMessages.getString("RenameComponentWizard.inputPage.description"), //$NON-NLS-1$
-					null);
-			RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(wizard);
-			int result= op.run(parent, wizard.getDefaultPageTitle());
-			op.getInitialConditionCheckingStatus();
-			if (result == IDialogConstants.CANCEL_ID || result == RefactoringWizardOpenOperation.INITIAL_CONDITION_CHECKING_FAILED)
-				triggerBuild();
-		} catch (InterruptedException e) {
-			// do nothing. User action got cancelled
-		}
-	
-	}
-	
-	public void triggerBuild() {
-		if (ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding()) {
-			new GlobalBuildAction(XSDEditorPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow(), IncrementalProjectBuilder.INCREMENTAL_BUILD).run();
-		}
-	}
-	
-	/**
-	 * Executes the rename refactoring without showing a dialog to gather
-	 * additional user input (for example the new name of the <tt>IJavaElement</tt>).
-	 * Only an error dialog is shown (if necessary) to present the result
-	 * of the refactoring's full precondition checking.
-	 * <p>
-	 * The method has to be called from within the UI thread. 
-	 * </p>
-	 * 
-	 * @param parent a shell used as a parent for the error dialog.
-	 * @param context a {@link IRunnableContext} to execute the operation.
-	 * 
-	 * @throws InterruptedException if the operation has been cancelled by the
-	 * user.
-	 * @throws InvocationTargetException if an error occurred while executing the
-	 * operation.
-	 * 
-	 * @see #openDialog(Shell)
-	 * @see IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
-	 */
-	public void perform(Shell parent, IRunnableContext context) throws InterruptedException, InvocationTargetException {
-		try {
-			ensureChecked();
-			if (fPreCheckStatus.hasFatalError()) {
-				showInformation(parent, fPreCheckStatus);
-				return; 
-			}
-		} catch (CoreException e){
-			throw new InvocationTargetException(e);
-		}
-	}
-	
-
-
-	
-	private RenameSupport(RenameComponentProcessor processor, String newName) throws CoreException {
-		fRefactoring= new RenameRefactoring(processor);
-		
-	}
-
-	
-	/**
-	 * Creates a new rename support for the given {@link IPackageFragment}.
-	 * 
-	 * @param fragment the {@link IPackageFragment} to be renamed.
-	 * @param newName the package fragment's new name. <code>null</code> is a
-	 * valid value indicating that no new name is provided.
-	 * @param flags flags controlling additional parameters. Valid flags are
-	 * <code>UPDATE_REFERENCES</code>, and <code>UPDATE_TEXTUAL_MATCHES</code>,
-	 * or their bitwise OR, or <code>NONE</code>.
-	 * @return the {@link RenameSupport}.
-	 * @throws CoreException if an unexpected error occurred while creating
-	 * the {@link RenameSupport}.
-	 */
-	public static RenameSupport create(XSDNamedComponent component, String newName) throws CoreException {
-		RenameComponentProcessor processor= new RenameComponentProcessor(component, newName);
-		return new RenameSupport(processor, newName);
-	}
-	
-	
-	private void ensureChecked() throws CoreException {
-		if (fPreCheckStatus == null) {
-			if (!fRefactoring.isApplicable()) {
-				fPreCheckStatus= RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("RenameSupport.not_available")); //$NON-NLS-1$
-			} else {
-				fPreCheckStatus= new RefactoringStatus();
-			}
-		}
-	}
-	
-	private void showInformation(Shell parent, RefactoringStatus status) {
-		String message= status.getMessageMatchingSeverity(RefactoringStatus.FATAL);
-		MessageDialog.openInformation(parent, RefactoringMessages.getString("RenameSupport.dialog.title"), message); //$NON-NLS-1$
-	}
-	
-	private static IStatus asStatus(RefactoringStatusEntry entry) {
-		int statusSeverity= IStatus.ERROR;
-		switch (entry.getSeverity()) {
-			case RefactoringStatus.OK :
-				statusSeverity= IStatus.OK;
-				break;
-			case RefactoringStatus.INFO :
-				statusSeverity= IStatus.INFO;
-				break;
-			case RefactoringStatus.WARNING :
-			case RefactoringStatus.ERROR :
-				statusSeverity= IStatus.WARNING;
-				break;
-		}
-		String pluginId= entry.getPluginId();
-		int code= entry.getCode();
-		if (pluginId == null) {
-			pluginId= XSDEditorPlugin.PLUGIN_ID;
-			code= IStatus.ERROR;
-		}
-		return new Status(statusSeverity, pluginId, code, entry.getMessage(), null);
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java
deleted file mode 100644
index c232e2b..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java
+++ /dev/null
@@ -1,107 +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.xsd.ui.internal.refactor.rename;
-
-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.IProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-
-/**
- * Represents a change that renames a given resource
- */
-public class ResourceRenameChange extends Change {
-
-	/*
-	 * we cannot use handles because they became invalid when you rename the resource.
-	 * paths do not.
-	 */
-	private IPath fResourcePath;
-
-	private String fNewName;
-
-	/**
-	 * @param newName includes the extension
-	 */
-	public ResourceRenameChange(IResource resource, String newName) {
-		this(resource.getFullPath(), newName);
-	}
-
-	private ResourceRenameChange(IPath resourcePath, String newName) {
-		fResourcePath= resourcePath;
-		fNewName= newName;
-	}
-
-	private IResource getResource() {
-		return ResourcesPlugin.getWorkspace().getRoot().findMember(fResourcePath);
-	}
-
-	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
-		
-		// TODO: implement file validation, see JDTChange
-		return new RefactoringStatus();
-	}
-	
-	/*
-	 * to avoid the exception senders should check if a resource with the new name
-	 * already exists
-	 */
-	public Change perform(IProgressMonitor pm) throws CoreException {
-		try {
-			if (false)
-				throw new NullPointerException();
-			pm.beginTask(RefactoringMessages.getString("XSDRenameResourceChange.rename_resource"), 1); //$NON-NLS-1$
-
-			getResource().move(renamedResourcePath(fResourcePath, fNewName), getCoreRenameFlags(), pm);
-
-			String oldName= fResourcePath.lastSegment();
-			IPath newPath= renamedResourcePath(fResourcePath, fNewName);
-			return new ResourceRenameChange(newPath, oldName);
-		} finally {
-			pm.done();
-		}
-	}
-
-	private int getCoreRenameFlags() {
-		if (getResource().isLinked())
-			return IResource.SHALLOW;
-		else
-			return IResource.NONE;
-	}
-
-	/*
-	 * changes resource names /s/p/A.java renamed to B.java becomes /s/p/B.java
-	 */
-	public static IPath renamedResourcePath(IPath path, String newName) {
-		return path.removeLastSegments(1).append(newName);
-	}
-
-	public String getName() {
-		return RefactoringMessages.getFormattedString(
-			"XSDRenameResourceChange.name", new String[]{fResourcePath.toString(), //$NON-NLS-1$
-			renamedResourcePath(fResourcePath, fNewName).toString()});
-	}
-
-	public Object getModifiedElement() {
-		return getResource();
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public void initializeValidationData(IProgressMonitor pm) {
-		// TODO Auto-generated method stub
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java
deleted file mode 100644
index e469981..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java
+++ /dev/null
@@ -1,83 +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.xsd.ui.internal.refactor.rename;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-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.xsd.ui.internal.refactor.RefactoringMessages;
-
-/**
- * @author ebelisar
- */
-public class ResourceRenameParticipant extends RenameParticipant {
-	
-	private IFile fFile = null;
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
-	 */
-	protected boolean initialize(Object element) {
-		if(element instanceof IFile) {
-			this.fFile = (IFile) element;
-			return true;
-		}
-		return false;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
-	 */
-	public String getName() {
-		String name = ""; //$NON-NLS-1$
-		if(this.fFile != null) {
-			name = fFile.getName();
-		}
-		return name;
-	}
-
-	/* (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) throws OperationCanceledException {
-		// TODO add check for file content type
-		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,
-			OperationCanceledException {
-		//computeQualifiedNameMatches(pm);	
-		//Change[] changes = fQualifiedNameSearchResult.getAllChanges();
-		return new CompositeChange(RefactoringMessages.getString("XSDResourceRenameParticipant.compositeChangeName"));
-		
-	}
-	
-//	private void computeQualifiedNameMatches(IProgressMonitor pm) throws CoreException {
-//		IPath fragment= fFile.getFullPath();
-//		if (fQualifiedNameSearchResult == null)
-//			fQualifiedNameSearchResult= new QualifiedNameSearchResult();
-//		QualifiedNameFinder.process(fQualifiedNameSearchResult, fFile.getName(),  
-//			getArguments().getNewName(), 
-//			"*.xsd", fFile.getProject(), pm);
-//	}
-	
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/SchemaPrefixChangeHandler.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/SchemaPrefixChangeHandler.java
deleted file mode 100644
index 35e90a3..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/SchemaPrefixChangeHandler.java
+++ /dev/null
@@ -1,211 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class SchemaPrefixChangeHandler
-{
-  String newPrefix;
-  XSDSchema xsdSchema;
-
-  public SchemaPrefixChangeHandler(XSDSchema xsdSchema, String newPrefix)
-  {
-    this.xsdSchema = xsdSchema;
-    this.newPrefix= newPrefix;
-  }
-  
-  public void resolve()
-  {
-    XSDSchemaPrefixRenamer xsdSchemaPrefixRenamer = new XSDSchemaPrefixRenamer();
-    xsdSchemaPrefixRenamer.visitSchema(xsdSchema);
-  }
-
-  public String getNewQName(XSDTypeDefinition comp, String value, String newXSDPrefix)
-  {
-    String qName = null;
-    if (value != null)
-    {
-      qName = newXSDPrefix;
-      if (qName != null && qName.length() > 0)
-      {
-        qName += ":" + value;
-      }
-      else
-      {
-        qName = value; 
-      }
-    }
-    else
-    {
-      qName = value;
-    }
-    
-    return qName;
-  }
-
-  
-  class XSDSchemaPrefixRenamer extends XSDVisitor
-  {
-    public XSDSchemaPrefixRenamer()
-    {
-      super();
-    }
-    
-    public void visitElementDeclaration(XSDElementDeclaration element)
-    {
-      super.visitElementDeclaration(element);
-      XSDTypeDefinition type = element.getType();
-      if (type != null)
-      {
-        String ns = type.getTargetNamespace();
-        if (ns == null) ns = "";
-//        if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
-        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))        
-        {
-          Element domElement = element.getElement();
-          if (domElement != null && domElement instanceof IDOMNode)
-          {
-            Attr typeAttr = domElement.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
-            if (typeAttr != null)
-            {
-              element.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName(type, type.getName(), newPrefix));            
-            }
-          }
-        }
-      }
-    }
-    
-    public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition simpleType)
-    {
-      super.visitSimpleTypeDefinition(simpleType);
-      XSDTypeDefinition baseType = simpleType.getBaseTypeDefinition();
-      
-      if (baseType != null)
-      {
-        String ns = baseType.getTargetNamespace();
-        if (ns == null) ns = "";
-//        if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
-//        System.out.println(xsdSchema.getSchemaForSchemaNamespace());
-        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
-        {
-          XSDDOMHelper domHelper = new XSDDOMHelper();
-          Element derivedBy = domHelper.getDerivedByElement(simpleType.getElement());
-          if (derivedBy != null && derivedBy instanceof IDOMNode)
-          {
-            Attr typeAttr = derivedBy.getAttributeNode(XSDConstants.BASE_ATTRIBUTE);
-            if (typeAttr != null)
-            {
-              derivedBy.setAttribute(XSDConstants.BASE_ATTRIBUTE, getNewQName(baseType, baseType.getName(), newPrefix));
-            }
-          }
-        }
-      }
-      
-      XSDSimpleTypeDefinition itemType = simpleType.getItemTypeDefinition();
-      if (itemType != null)
-      {
-        String ns = itemType.getTargetNamespace();
-        if (ns == null) ns = "";
-        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
-        {
-          XSDDOMHelper domHelper = new XSDDOMHelper();
-          Node listNode = domHelper.getChildNode(simpleType.getElement(), XSDConstants.LIST_ELEMENT_TAG);
-          if (listNode != null && listNode instanceof Element)
-          {
-            Element listElement = (Element)listNode;          
-            if (listElement instanceof IDOMNode)
-            {
-              Attr typeAttr = listElement.getAttributeNode(XSDConstants.ITEMTYPE_ATTRIBUTE);
-              if (typeAttr != null)
-              {
-                listElement.setAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, getNewQName(itemType, itemType.getName(), newPrefix));
-              }
-            }
-          }
-        }
-      }
-      
-      List memberTypes = simpleType.getMemberTypeDefinitions();
-      if (memberTypes.size() > 0)
-      {
-        XSDDOMHelper domHelper = new XSDDOMHelper();
-        Node unionNode = domHelper.getChildNode(simpleType.getElement(), XSDConstants.UNION_ELEMENT_TAG);
-        if (unionNode != null && unionNode instanceof Element)
-        {
-          Element unionElement = (Element)unionNode;          
-          if (unionElement instanceof IDOMNode)
-          {
-            StringBuffer sb = new StringBuffer("");
-            for (Iterator i = memberTypes.iterator(); i.hasNext(); )
-            {
-              XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)i.next();
-              String ns = st.getTargetNamespace();
-              if (ns == null) ns = "";
-              if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
-              {
-                sb.append(getNewQName(st, st.getName(), newPrefix));                
-              }
-              else
-              {
-                sb.append(st.getQName(xsdSchema));
-              }
-              if (i.hasNext())
-              {
-                sb.append(" ");
-              }
-            }
-            unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, sb.toString());
-          }
-        }
-      }
-    }
-
-    public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
-    {
-      super.visitAttributeDeclaration(attr);
-      XSDTypeDefinition type = attr.getType();
-      if (type != null)
-      {
-        String ns = type.getTargetNamespace();
-        if (ns == null) ns = "";
-//        if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
-        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
-        {
-          Element domElement = attr.getElement();
-          if (domElement != null && domElement instanceof IDOMNode)
-          {
-            Attr typeAttr = domElement.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
-            if (typeAttr != null)
-            {
-              attr.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName(type, type.getName(), newPrefix));            
-            }
-          }
-        }
-      }
-    }
-  }    
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/TargetNamespaceChangeHandler.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/TargetNamespaceChangeHandler.java
deleted file mode 100644
index ef996b1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/TargetNamespaceChangeHandler.java
+++ /dev/null
@@ -1,154 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-
-public class TargetNamespaceChangeHandler
-{
-  String newNS;
-  String oldNS;
-  XSDSchema xsdSchema;
-
-  public TargetNamespaceChangeHandler(XSDSchema xsdSchema, String oldNS, String newNS)
-  {
-    this.xsdSchema = xsdSchema;
-    this.oldNS= oldNS;
-    this.newNS= newNS;
-  }
-  
-  public void resolve()
-  {
-    ElementReferenceRenamer elementReferenceRenamer = new ElementReferenceRenamer();
-    elementReferenceRenamer.visitSchema(xsdSchema);
-    AttributeReferenceRenamer attributeReferenceRenamer = new AttributeReferenceRenamer();
-    attributeReferenceRenamer.visitSchema(xsdSchema);
-  }
-
-  class ElementReferenceRenamer extends XSDVisitor
-  {
-    public ElementReferenceRenamer()
-    {
-      super();
-    }
-    
-    public void visitElementDeclaration(XSDElementDeclaration element)
-    {
-      super.visitElementDeclaration(element);
-      if (element.isElementDeclarationReference())
-      {
-      	if (element.getResolvedElementDeclaration().getTargetNamespace() != null)
-      	{
-      	  if (element.getResolvedElementDeclaration().getTargetNamespace().equals(oldNS))
-          {
-            // set the resolved element's declaration to new ns
-            // this is defect 237518 - target namespace rename creates a new namespace
-            element.getResolvedElementDeclaration().setTargetNamespace(newNS);
-          }
-        }
-        else
-        {
-        	if (oldNS == null || (oldNS != null && oldNS.equals("")))
-        	{
-						element.getResolvedElementDeclaration().setTargetNamespace(newNS);
-        	}
-        }
-      }
-    }
-  }
-  
-  // Similar to defect 237518 but for attributes
-  class AttributeReferenceRenamer extends XSDVisitor
-  {
-    public AttributeReferenceRenamer()
-    {
-      super();
-    }
-    
-    public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-    {
-      super.visitComplexTypeDefinition(type);
-      if (type.getAttributeContents() != null)
-      {
-        for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-        {
-          XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
-          if (attrGroupContent instanceof XSDAttributeUse)
-          {
-            XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
-            XSDAttributeDeclaration attrDecl = attrUse.getContent();
-            
-            if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
-            {
-							if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace() != null)
-							{
-                if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace().equals(oldNS))
-                {
-                  attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
-                }
-              }
-              else
-              {
-								if (oldNS == null || (oldNS != null && oldNS.equals("")))
-								{
-									attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
-								}
-              }
-            }
-          }
-        }
-      }
-    }
-  
-    public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
-    {
-      super.visitAttributeGroupDefinition(attributeGroup);
-      EList list = attributeGroup.getAttributeUses();
-      if (list != null)
-      {
-        for (Iterator iter = list.iterator(); iter.hasNext(); )
-        {
-          XSDAttributeUse attrUse = (XSDAttributeUse)iter.next();
-          XSDAttributeDeclaration attrDecl = attrUse.getContent();
-
-          if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
-          {
-						if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace() != null)
-						{
-              if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace().equals(oldNS))
-              {
-                attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
-              }
-            }
-            else
-            {
-							if (oldNS == null || (oldNS != null && oldNS.equals("")))
-							{
-								attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
-							}
-            }
-          }
-        }
-      }
-    }
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDExternalFileCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDExternalFileCleanup.java
deleted file mode 100644
index e96619e..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDExternalFileCleanup.java
+++ /dev/null
@@ -1,298 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.text.MessageFormat;
-import java.util.Iterator;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDExternalFileCleanup extends BaseCleanup
-{
-  /**
-   * Constructor for XSDExternalFileCleanup.
-   */
-  public XSDExternalFileCleanup(String oldFilename)
-  {
-    super();
-    this.oldFilename = oldFilename;
-  }
-  
-  protected XSDSchema deletedSchema;
-  public XSDExternalFileCleanup(XSDSchema deletedSchema)
-  {
-    this.deletedSchema = deletedSchema;
-  }
-
-  protected String oldFilename;
-  
-  /**
-   * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitElementDeclaration(XSDElementDeclaration)
-   */
-  public void visitElementDeclaration(XSDElementDeclaration element)
-  {
-    boolean addMessage = true;
-    String schemaLocation = element.getSchema().getSchemaLocation();
-    if (schemaLocation!= null)
-    {
-      if (!schemaLocation.equals(schema.getSchemaLocation()))
-      {
-        addMessage = false;
-      }
-    }
-    if (element.isElementDeclarationReference())
-    {
-      if (isFromDeletedSchema(element.getResolvedElementDeclaration()))
-      {
-        if (addMessage)
-        {
-          // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ELEMENT_REFERENCE") + " <" + getNamedComponentName(element.getContainer()) + ">";
-					String msg = "_INFO_REMOVE_ELEMENT_REFERENCE" + " <" + getNamedComponentName(element.getContainer()) + ">";
-          addMessage(msg, element.getContainer());
-        }
-        childrenToRemove.add(element.getElement());
-//        Element domElement = element.getElement();
-//        domElement.getParentNode().removeChild(domElement);     
-      }
-    }
-    else if (removeType(element))
-    {
-      String msg = "";
-      if (element.isGlobal())
-      {
-      	// String pattern = XSDPlugin.getSchemaString("_INFO_RESET_GLOBAL_ELEMENT");
-				String pattern = "_INFO_RESET_GLOBAL_ELEMENT";
-        Object args[] = {element.getName()};
-        msg = MessageFormat.format(pattern, args);
-      }
-      else
-      {
-      	// msg = XSDPlugin.getSchemaString("_INFO_RESET_ELEMENT");
-				msg = "_INFO_RESET_ELEMENT";
-      	// msg += "<" + element.getName() + "> " + XSDPlugin.getSchemaString("_UI_TO_TYPE_STRING");
-				msg += "<" + element.getName() + "> " + "_UI_TO_TYPE_STRING";
-      }
-      if (addMessage)
-      {
-        addMessage(msg, element);
-      }
-    }
-
-
-    super.visitElementDeclaration(element);
-  }
-
-  protected void resetTypeToString(Element element)
-  {
-    String prefix = element.getPrefix();
-    prefix = (prefix == null) ? "" : (prefix + ":");
-    
-    element.setAttribute(XSDConstants.TYPE_ATTRIBUTE, prefix + "string"); 
-  }
-  
-  protected boolean removeType(XSDElementDeclaration element)
-  {
-  	if (removeType(element.getTypeDefinition()))
-  	{
-      resetTypeToString(element.getElement());
-  	  return true;
-  	}
-  	return false;
-  }
-  
-  protected boolean isFromDeletedSchema(XSDConcreteComponent component)
-  {
-    if (component == null)
-    {
-      return false;
-    }
-    XSDConcreteComponent root = component.getRootContainer();
-
-    boolean isFromDeletedSchema = false;
-    if (deletedSchema.getContents() != null)
-    {
-      Iterator contents = deletedSchema.getContents().iterator();
-      while (contents.hasNext())
-      {
-        XSDSchemaContent content = (XSDSchemaContent)contents.next();
-        if (content instanceof XSDSchemaDirective)
-        {
-          XSDSchema aSchema = ((XSDSchemaDirective)content).getResolvedSchema();
-          if (root != null && root.equals(aSchema))
-          {
-            isFromDeletedSchema = true;
-          }
-        }
-      }
-    }
-    if (root != null && root.equals(deletedSchema))
-    {
-      isFromDeletedSchema = true;
-    }
-    return isFromDeletedSchema;
-  }
-      
-  /**
-   * Remove the type from the element if it belongs to the external file
-   */
-  protected boolean removeType(XSDTypeDefinition typeDef)
-  {
-    if (typeDef == null)
-    {
-      return false;
-    }
-    return isFromDeletedSchema(typeDef);
-  }
-
-  /**
-   * @see org.eclipse.wst.xsd.utility.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
-   */
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    super.visitComplexTypeDefinition(type);
-    if (type.getAttributeContents() != null)
-    {
-      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
-        if (attrGroupContent instanceof XSDAttributeUse)
-        {
-          XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
-          XSDAttributeDeclaration attrDecl = attrUse.getContent();
-          
-          // now is this a reference?
-          if (attrDecl.isAttributeDeclarationReference())
-          {
-            if (isFromDeletedSchema(attrDecl.getResolvedAttributeDeclaration()))
-            {
-              String name = getNamedComponentName(type);
-              // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ATTRIBUTE_REFERENCE") +
-							String msg = "_INFO_REMOVE_ATTRIBUTE_REFERENCE" +
-                       " <" + name + ">";
-              addMessage(msg, attrDecl.getContainer());
-              
-              childrenToRemove.add(attrDecl.getElement());
-            }
-          }
-          // otherwise check the type of the attribute and see if it is from the deleted schema
-          else
-          {
-            if (removeType(attrDecl.getTypeDefinition()))
-            {
-              // reset the type of the attribute decl to string
-              // String msg = XSDPlugin.getSchemaString("_INFO_RESET_ATTRIBUTE") +
-							String msg = "_INFO_RESET_ATTRIBUTE" +
-                          " <" + attrDecl.getName() + "> " +
-                          // XSDPlugin.getSchemaString("_UI_TO_TYPE_STRING");
-							            "_UI_TO_TYPE_STRING";
-              addMessage(msg, attrDecl);
-              resetTypeToString(attrDecl.getElement());
-
-            }
-          }
-        }
-        else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
-        {
-          XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) attrGroupContent;
-          
-          if (isFromDeletedSchema(attrGroupDef.getResolvedAttributeGroupDefinition()))
-          {
-          	// remove the attribute group reference
-            String name = getNamedComponentName(type);
-            // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE") + " <" + name + ">";
-						String msg = "_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE" + " <" + name + ">";
-
-            addMessage(msg, attrGroupDef.getContainer());
-            
-            childrenToRemove.add(attrGroupDef.getElement());
-          }
-        }
-      }
-    }
-
-    // For the complex type with simple content case, see the visitComplexTypeDefinition method
-    XSDTypeDefinition base = type.getBaseTypeDefinition();
-    if (base instanceof XSDSimpleTypeDefinition)
-    {
-      XSDSimpleTypeDefinition baseType = (XSDSimpleTypeDefinition)base;
-      if (isFromDeletedSchema(baseType))
-      {
-        // String msg = XSDPlugin.getSchemaString("_INFO_RESET_COMPLEX_TYPE") +
-				String msg = "_INFO_RESET_COMPLEX_TYPE" +
-                " <" + getNamedComponentName(type) + "> " +
-                // XSDPlugin.getSchemaString("_UI_DERIVATION");
-				        "_UI_DERIVATION";
-        addMessage(msg, type);
-      
-        type.setBaseTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition("string"));
-      }
-    }
-  }
-
-  /**
-   * @see org.eclipse.wst.xsd.utility.XSDVisitor#visitModelGroupDefinition(XSDModelGroupDefinition)
-   */
-  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroup)
-  {
-    super.visitModelGroupDefinition(modelGroup);
-    if (modelGroup.isModelGroupDefinitionReference())
-    {
-      if (isFromDeletedSchema(modelGroup.getResolvedModelGroupDefinition()))
-      {
-        String name = getNamedComponentName(modelGroup);
-        // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_GROUP_REFERENCE") + " <" + name + ">";
-				String msg = "_INFO_REMOVE_GROUP_REFERENCE" + " <" + name + ">";
-        addMessage(msg, modelGroup.getContainer());
-        childrenToRemove.add(modelGroup.getElement());
-      }
-    }      
-  }
-
-  /**
-   * @see org.eclipse.wst.xsd.utility.XSDVisitor#visitSimpleTypeDefinition(XSDSimpleTypeDefinition)
-   */
-  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
-  {
-    super.visitSimpleTypeDefinition(type);
-    XSDSimpleTypeDefinition baseType = type.getBaseTypeDefinition();
-    if (isFromDeletedSchema(baseType))
-    {
-      // String msg = XSDPlugin.getSchemaString("_INFO_RESET_SIMPLE_TYPE") +
-			String msg = "_INFO_RESET_SIMPLE_TYPE" +
-              " <" + getNamedComponentName(type) + "> " +
-              // XSDPlugin.getSchemaString("_UI_DERIVATION");
-			        "_UI_DERIVATION";
-      addMessage(msg, type);
-      
-
-    // This will set the simple Type base to string 
-    // For the complex type with simple content case, see the visitComplexTypeDefinition method
-
-      type.getFacetContents().clear();
-      type.getFacets().clear();
-      type.setBaseTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition("string"));
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDVisitor.java
deleted file mode 100644
index 4acf32d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDVisitor.java
+++ /dev/null
@@ -1,216 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.refactor.rename;
-
-import java.util.Iterator;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDVisitor
-{
-  public XSDVisitor()
-  {
-  }
-  
-  protected XSDSchema schema;
-  
-  public void visitSchema(XSDSchema schema)
-  {
-    this.schema = schema;
-    for (Iterator iterator = schema.getAttributeDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDAttributeDeclaration attr = (XSDAttributeDeclaration) iterator.next();
-      visitAttributeDeclaration(attr);
-    }
-    for (Iterator iterator = schema.getTypeDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDTypeDefinition type = (XSDTypeDefinition) iterator.next();
-      visitTypeDefinition(type);
-    }
-    for (Iterator iterator = schema.getElementDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDElementDeclaration element = (XSDElementDeclaration) iterator.next();
-      visitElementDeclaration(element);
-    }
-    for (Iterator iterator = schema.getIdentityConstraintDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDIdentityConstraintDefinition identityConstraint = (XSDIdentityConstraintDefinition) iterator.next();
-      visitIdentityConstraintDefinition(identityConstraint);
-    }
-    for (Iterator iterator = schema.getModelGroupDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) iterator.next();
-      visitModelGroupDefinition(modelGroup);
-    }
-    for (Iterator iterator = schema.getAttributeGroupDefinitions().iterator(); iterator.hasNext();)
-    {
-      XSDAttributeGroupDefinition attributeGroup = (XSDAttributeGroupDefinition) iterator.next();
-      visitAttributeGroupDefinition(attributeGroup);
-    }
-    for (Iterator iterator = schema.getNotationDeclarations().iterator(); iterator.hasNext();)
-    {
-      XSDNotationDeclaration element = (XSDNotationDeclaration) iterator.next();
-      visitNotationDeclaration(element);
-    }
-    
-  }
-  
-  public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
-  {
-  }
-  
-  public void visitTypeDefinition(XSDTypeDefinition type)
-  {
-    if (type instanceof XSDSimpleTypeDefinition)
-    {
-      visitSimpleTypeDefinition((XSDSimpleTypeDefinition)type);
-    }
-    else if (type instanceof XSDComplexTypeDefinition)
-    {
-      visitComplexTypeDefinition((XSDComplexTypeDefinition)type);
-    }
-  }
-  
-  public void visitElementDeclaration(XSDElementDeclaration element)
-  {
-    if (element.isElementDeclarationReference())
-    {
-    }
-    else if (element.getAnonymousTypeDefinition() != null)
-    {
-      visitTypeDefinition(element.getAnonymousTypeDefinition());
-    }
-  }
-  
-  public void visitIdentityConstraintDefinition(XSDIdentityConstraintDefinition identityConstraint)
-  {
-  }
-  
-  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
-  {
-    if (!modelGroupDef.isModelGroupDefinitionReference())
-    {
-      if (modelGroupDef.getModelGroup() != null)
-      {
-        visitModelGroup(modelGroupDef.getModelGroup());
-      }
-    }
-  }
-  
-  public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
-  {
-    if (attributeGroup.getAttributeUses() != null)
-    {
-      for (Iterator iter = attributeGroup.getAttributeUses().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeUse attrUse = (XSDAttributeUse)iter.next();
-        visitAttributeDeclaration(attrUse.getContent());
-      }
-    }
-  }
-  
-  public void visitNotationDeclaration(XSDNotationDeclaration notation)
-  {
-  }
-  
-  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
-  {
-  }
-  
-  public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
-  {
-    if (type.getContentType() != null)
-    {
-      XSDComplexTypeContent complexContent = (XSDComplexTypeContent) type.getContentType();
-      if (complexContent instanceof XSDSimpleTypeDefinition)
-      {
-        visitSimpleTypeDefinition((XSDSimpleTypeDefinition)complexContent);
-      }
-      else if (complexContent instanceof XSDParticle)
-      {
-        visitParticle((XSDParticle) complexContent);
-      }
-    }
-    
-    if (type.getAttributeContents() != null)
-    {
-      for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
-      {
-        XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)iter.next();
-        if (attrGroupContent instanceof XSDAttributeUse)
-        {
-          XSDAttributeUse attrUse = (XSDAttributeUse)attrGroupContent;
-          visitAttributeDeclaration(attrUse.getContent());
-        }
-        else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
-        {
-          visitAttributeGroupDefinition((XSDAttributeGroupDefinition)attrGroupContent);
-        }
-      }
-    }
-  }
-  
-  public void visitParticle(XSDParticle particle)
-  {
-    visitParticleContent(particle.getContent());
-  }
-  
-  public void visitParticleContent(XSDParticleContent particleContent)
-  {
-    if (particleContent instanceof XSDModelGroupDefinition)
-    {
-      visitModelGroupDefinition((XSDModelGroupDefinition) particleContent);
-    }
-    else if (particleContent instanceof XSDModelGroup)
-    {
-      visitModelGroup((XSDModelGroup)particleContent);
-    }
-    else if (particleContent instanceof XSDElementDeclaration)
-    {
-      visitElementDeclaration((XSDElementDeclaration)particleContent);
-    }
-    else if (particleContent instanceof XSDWildcard)
-    {
-      visitWildcard((XSDWildcard)particleContent);
-    }
-  }
-  
-  public void visitModelGroup(XSDModelGroup modelGroup)
-  {
-    if (modelGroup.getContents() != null)
-    {
-      for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
-      {
-        XSDParticle particle = (XSDParticle) iterator.next();
-        visitParticle(particle);
-      }
-    }
-  }
-  
-  public void visitWildcard(XSDWildcard wildcard)
-  {
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java
deleted file mode 100644
index 80a6ac0..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java
+++ /dev/null
@@ -1,171 +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.xsd.ui.internal.refactor.structure;
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.text.Assert;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.TextChange;
-import org.eclipse.ltk.core.refactoring.TextFileChange;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.commands.MakeAnonymousTypeGlobalCommand;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-/**
- * @author ebelisar
- * 
- */
-public class MakeTypeGlobalChange extends Change {
-
-	private Map fChanges;
-
-	private String fNewName;
-
-	private XSDTypeDefinition fTypeComponent;
-
-	public MakeTypeGlobalChange(XSDTypeDefinition component, 
-			String newName) {
-		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
-
-		fTypeComponent = component;
-		fNewName = newName;
-	}
-
-	// public static Change[] createChangesFor(XSDNamedComponent component,
-	// String newName) {
-	// // TODO: P1 implement search of XSD files
-	// XSDSearchSupport support = XSDSearchSupport.getInstance();
-	// RefactorSearchRequestor requestor = new
-	// RefactorSearchRequestor(component, newName);
-	// support.searchRunnable(component, IXSDSearchConstants.WORKSPACE_SCOPE,
-	// requestor);
-	//
-	// return requestor.getChanges();
-	//
-	// }
-
-	protected Change createUndoChange() {
-		return new MakeTypeGlobalChange(fTypeComponent, getNewName());
-	}
-
-	protected void doRename(IProgressMonitor pm) throws CoreException {
-		// TODO P1 change temporary rename of XSD model components
-		performModify(getNewName());
-	}
-
-	public void performModify(final String value) {
-			DelayedRenameRunnable runnable = new DelayedRenameRunnable(
-					fTypeComponent, value);
-			Display.getCurrent().asyncExec(runnable);
-	}
-
-	protected static class DelayedRenameRunnable implements Runnable {
-		protected XSDTypeDefinition component;
-
-		protected String name;
-
-		public DelayedRenameRunnable(XSDTypeDefinition component, String name) {
-			this.component = component;
-			this.name = name;
-		}
-
-		public void run() {
-			DocumentImpl doc = (DocumentImpl) component.getElement().getOwnerDocument();
-			doc.getModel().beginRecording(
-							this,
-							XSDEditorPlugin
-									.getXSDString("_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL"));
-			MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand(
-					component, name);
-			command.run();
-			doc.getModel().endRecording(this);
-		}
-	}
-
-	public TextChange getChange(IFile file) {
-		TextChange result = (TextChange) fChanges.get(file);
-		if (result == null) {
-			result = new TextFileChange(file.getName(), file);
-			fChanges.put(file, result);
-		}
-		return result;
-	}
-
-	public String getName() {
-		return RefactoringMessages
-				.getFormattedString(
-						"MakeTypeGlobalChange.name", new String[] {getNewName() }); //$NON-NLS-1$
-	}
-
-	public final Change perform(IProgressMonitor pm) throws CoreException {
-		try {
-			pm.beginTask(RefactoringMessages
-					.getString("XSDComponentRenameChange.Renaming"), 1); //$NON-NLS-1$
-			Change result = createUndoChange();
-			doRename(new SubProgressMonitor(pm, 1));
-			return result;
-		} finally {
-			pm.done();
-		}
-	}
-
-	/**
-	 * Gets the newName.
-	 * 
-	 * @return Returns a String
-	 */
-	protected String getNewName() {
-		return fNewName;
-	}
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.Change#getModifiedElement()
-	 */
-	public Object getModifiedElement() {
-		// TODO Auto-generated method stub
-		return fTypeComponent;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public void initializeValidationData(IProgressMonitor pm) {
-		// TODO Auto-generated method stub
-
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ltk.core.refactoring.Change#isValid(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
-			OperationCanceledException {
-		// TODO implement change validation
-		return new RefactoringStatus();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java
deleted file mode 100644
index d94fd26..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java
+++ /dev/null
@@ -1,219 +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.xsd.ui.internal.refactor.structure;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
-import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
-import org.eclipse.wst.xsd.ui.internal.refactor.rename.INameUpdating;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public class MakeTypeGlobalProcessor extends RenameProcessor implements INameUpdating{
-	
-	private XSDTypeDefinition fTypeComponent;
-	private String fNewElementName;
-
-	public static final String IDENTIFIER= "org.eclipse.wst.ui.xsd.makeTypeGlobalProcessor"; //$NON-NLS-1$
-
-	//private QualifiedNameSearchResult fNameSearchResult;
-	
-	public MakeTypeGlobalProcessor(XSDTypeDefinition element, String newName) {
-		fTypeComponent= element;
-		fNewElementName = newName;
-		
-	}
-	
-	public XSDTypeDefinition getTypeComponent() {
-		return fTypeComponent;
-	}
-
-	
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating#canEnableTextUpdating()
-	 */
-	public boolean canEnableTextUpdating() {
-		return true;
-	}
-
-	protected String[] getAffectedProjectNatures() throws CoreException {
-		//TODO: find project natures of the files that are going to be refactored
-		return new String[0];
-	}
-	
-	protected void loadDerivedParticipants(RefactoringStatus status,
-			List result, String[] natures, SharableParticipants shared)
-			throws CoreException {
-		// TODO: provide a way to load rename participants
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
-	 */
-	public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
-			CheckConditionsContext context) throws CoreException,
-			OperationCanceledException {
-		// TODO add code to check final conditions for component rename
-		return new RefactoringStatus();
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
-			throws CoreException, OperationCanceledException {
-//		 TODO add code to check initial conditions for component rename
-		return new RefactoringStatus();
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public Change createChange(IProgressMonitor pm) throws CoreException,
-			OperationCanceledException {
-		// TODO P1 add change creation
-//		Change[] changes = XSDComponentRenameChange.createChangesFor(this.fNamedComponent, getNewElementName());
-//		CompositeChange multiChange = null; 
-//			if(changes.length > 0)
-//				multiChange  = new CompositeChange("XSD component rename participant changes", changes); //$NON-NLS-1$ TODO: externalize string
-//		return multiChange;
-		
-//		computeNameMatches(pm);	
-//		Change[] changes = fNameSearchResult.getAllChanges();
-//		return new CompositeChange("XSD file rename participant changes", changes); //TODO: externalize string
-		pm.beginTask("", 1); //$NON-NLS-1$
-		try{
-			return new MakeTypeGlobalChange(fTypeComponent, getNewElementName());
-		} finally{
-			pm.done();
-		}	 
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
-	 */
-	public Object[] getElements() {
-		
-		return new Object[] {fTypeComponent};
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
-	 */
-	public String getIdentifier() {
-		return IDENTIFIER;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
-	 */
-	public String getProcessorName() {
-		return RefactoringMessages.getFormattedString(
-				"MakeLocalTypeGlobalRefactoring.name",  //$NON-NLS-1$
-				new String[]{getNewElementName()});
-
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
-	 */
-	public boolean isApplicable() throws CoreException {
-		if (fTypeComponent == null)
-			return false;
-		// TODO implement isApplicable logic for the named component, 
-		// verify how it is different from other condition checks
-//		if (fNamedComponent.isAnonymous())
-//			return false;
-//		if (! Checks.isAvailable(fType))
-//			return false;
-//		if (isSpecialCase(fType))
-//			return false;
-		return true;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#checkNewElementName(java.lang.String)
-	 */
-	public RefactoringStatus checkNewElementName(String newName){
-		Assert.isNotNull(newName, "new name"); //$NON-NLS-1$
-		// TODO: implement new name checking
-//		RefactoringStatus result = Checks.checkTypeName(newName);
-//		if (Checks.isAlreadyNamed(fType, newName))
-//			result.addFatalError(RefactoringCoreMessages.getString("RenameTypeRefactoring.choose_another_name"));	 //$NON-NLS-1$
-		return new RefactoringStatus();
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.jdt.internal.corext.refactoring.tagging.INameUpdating#getNewElement()
-	 */
-	public Object getNewElement() throws CoreException {
-		// TODO implement this method, it's used for updating selection on new element
-		return null;
-	}
-	
-//	private void computeNameMatches(IProgressMonitor pm) throws CoreException {
-//	
-//	    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
-//	    try {
-//			URL fileURL = Platform.resolve(new URL(fNamedComponent.getSchema().getSchemaLocation()));
-//			IFile file = workspaceRoot.getFileForLocation(new Path(fileURL.getPath()));
-//			if (fNameSearchResult == null)
-//				fNameSearchResult= new QualifiedNameSearchResult();
-//			QualifiedNameFinder.process(fNameSearchResult, getNamedComponent().getName(),  
-//				getNewElementName(), 
-//				"*.xsd", file.getProject(), pm);
-//		} catch (IOException e) {
-//			// TODO Auto-generated catch block
-//			e.printStackTrace();
-//		}
-//	}
-	
-	public final RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException {
-		RenameArguments arguments= new RenameArguments(getNewElementName(), true);
-		String[] natures= getAffectedProjectNatures();
-		List result= new ArrayList();
-		loadElementParticipants(status, result, arguments, natures, sharedParticipants);
-		loadDerivedParticipants(status, result, natures, sharedParticipants);
-		return (RefactoringParticipant[])result.toArray(new RefactoringParticipant[result.size()]);
-	}
-	
-	protected void loadElementParticipants(RefactoringStatus status, List result, RenameArguments arguments, String[] natures, SharableParticipants shared) throws CoreException {
-		Object[] elements= getElements();
-		for (int i= 0; i < elements.length; i++) {
-			result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status, 
-				this,  elements[i],
-				arguments, natures, shared)));
-		}
-	}
-	
-	
-	public void setNewElementName(String newName) {
-		
-		fNewElementName= newName;
-	}
-
-	public String getNewElementName() {
-		return fNewElementName;
-	}
-
-	public String getCurrentElementName() {
-		// TODO Auto-generated method stub
-		return fNewElementName;
-	}
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java
deleted file mode 100644
index 199ad94..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java
+++ /dev/null
@@ -1,103 +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.xsd.ui.internal.text;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-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.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaLocationResolverAdapterFactory;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDResourceImpl;
-import org.w3c.dom.Element;
-
-public class XSDModelAdapter implements INodeAdapter
-{
-  protected ResourceSet resourceSet;
-  protected XSDSchema schema;
-
-  public XSDSchema getSchema()
-  {
-    return schema;
-  }
-
-  public void setSchema(XSDSchema schema)
-  {
-    this.schema = schema;
-  }
-  
-  public void clear()
-  {
-    schema = null;
-    resourceSet = null;
-  }
-
-  public boolean isAdapterForType(Object type)
-  {
-    return type == XSDModelAdapter.class;
-  }
-
-  public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos)
-  {
-  }
-
-  public XSDSchema createSchema(Element element)
-  {     
-    try
-    {
-      IDOMNode domNode = (IDOMNode)element;
-      String baseLocation = domNode.getModel().getBaseLocation();
-//      System.out.println("XSDSchemalNodeAdapter.baseLocation=" + baseLocation);
-           
-      schema = XSDFactory.eINSTANCE.createXSDSchema();
-      
-      // Force the loading of the "meta" schema for schema instance instance.
-      //
-      String schemaForSchemaNamespace = element.getNamespaceURI();
-      XSDSchemaImpl.getSchemaForSchema(schemaForSchemaNamespace);      
-      
-      resourceSet = XSDSchemaImpl.createResourceSet();
-      resourceSet.getAdapterFactories().add(new XSDSchemaLocationResolverAdapterFactory());                
-      
-      // TODO... gotta pester SSE folks to provide 'useful' baseLocations
-      // 
-      URI uri = null;
-      if (baseLocation.startsWith("/"))
-      {
-        uri = URI.createPlatformResourceURI(baseLocation);
-      }
-      else
-      {
-        uri = URI.createFileURI(baseLocation);
-      }  
-      //System.out.println("uri=" + uri.toString());
-      Resource resource = new XSDResourceImpl();
-      resource.setURI(uri);
-      schema = XSDFactory.eINSTANCE.createXSDSchema(); 
-      resource.getContents().add(schema);
-      resourceSet.getResources().add(resource);    
-      schema.setElement(element);
-      
-      // attach an adapter to keep the XSD model and DOM in sync
-      //
-      new XSDModelReconcileAdapter(element.getOwnerDocument(), schema);
-    }
-    catch (Exception ex)
-    {
-      ex.printStackTrace();
-    }
-    return schema;
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java
deleted file mode 100644
index bf76f7a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java
+++ /dev/null
@@ -1,204 +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.xsd.ui.internal.text;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class XSDModelQueryExtension extends ModelQueryExtension
-{  
-  public XSDModelQueryExtension()
-  {
-  }
-  
-  public String[] getAttributeValues(Element e, String namespace, String name)
-  {
-    List list = new ArrayList();
-
-    String currentElementName = e.getLocalName();
-    Node parentNode = e.getParentNode();
-    String parentName = parentNode != null ? parentNode.getLocalName() : "";
-    
-    if (checkName(name, "type") && XSDConstants.isSchemaForSchemaNamespace(namespace))
-    {      
-      if (checkName(currentElementName, "attribute"))
-      {
-        list = getTypesHelper(e).getBuiltInTypeNamesList();
-        list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
-      }
-      else if (checkName(currentElementName, "element"))
-      {
-        list = getTypesHelper(e).getBuiltInTypeNamesList2();
-        list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
-        list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
-      }
-    }
-    else if (checkName(name, "blockDefault") ||
-             checkName(name, "finalDefault"))      
-    {    
-       list.add("#all");
-       list.add("substitution");
-       list.add("extension");
-       list.add("restriction");
-    }  
-    else if (checkName(name, "namespace"))
-    {
-      if (checkName(currentElementName, "any") || 
-          checkName(currentElementName, "anyAttribute"))
-      {
-        list.add("##any");
-        list.add("##other");
-        list.add("##targetNamespace");
-        list.add("##local");
-      }
-    }
-    else if (checkName(name, "maxOccurs"))
-    {
-      list.add("1");
-      list.add("unbounded");
-    }
-    else if (checkName(name, "minOccurs"))
-    {
-      list.add("0");
-      list.add("1");
-    }    
-    else if (checkName(name, "itemType"))
-    {
-      if (checkName(currentElementName, "list"))
-      {
-        if (checkName(parentName, "simpleType"))
-        {
-          list = getTypesHelper(e).getBuiltInTypeNamesList();
-          list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
-        }
-      }
-    }
-    else if (checkName(name, "memberTypes"))
-    {
-      if (checkName(currentElementName, "union"))
-      {
-        if (checkName(parentName, "simpleType"))
-        {
-          list = getTypesHelper(e).getBuiltInTypeNamesList();
-          list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
-        }
-      }
-    }
-    else if (checkName(name, "base"))
-    {
-      if (checkName(currentElementName, "restriction"))
-      {
-        if (checkName(parentName, "simpleType"))
-        {
-          list = getTypesHelper(e).getBuiltInTypeNamesList();
-          list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
-        }
-        else if (checkName(parentName, "simpleContent"))
-        {
-          list = getTypesHelper(e).getBuiltInTypeNamesList();
-          list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
-        }
-        else if (checkName(parentName, "complexContent"))
-        {
-          list = getTypesHelper(e).getBuiltInTypeNamesList();
-          list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
-        }
-      }
-      else if (checkName(currentElementName, "extension"))
-      {
-        if (checkName(parentName, "simpleContent"))
-        {
-          list = getTypesHelper(e).getBuiltInTypeNamesList();
-          list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
-        }
-        else if (checkName(parentName, "complexContent"))
-        {
-          list = getTypesHelper(e).getBuiltInTypeNamesList();
-          list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
-        }
-      }
-    }
-    else if (checkName(name, "ref"))
-    {
-      if (checkName(currentElementName, "element"))
-      {
-        list = getTypesHelper(e).getGlobalElements();
-      }
-      else if (checkName(currentElementName, "attribute"))
-      {
-        list = getTypesHelper(e).getGlobalAttributes();
-      }
-      else if (checkName(currentElementName, "attributeGroup"))
-      {
-        list = getTypesHelper(e).getGlobalAttributeGroups();
-      }
-      else if (checkName(currentElementName, "group"))
-      {
-        list = getTypesHelper(e).getModelGroups();
-      }
-    }
-    else if (checkName(name, "substitutionGroup"))
-    {
-      if (checkName(currentElementName, "element"))
-      {
-        list = getTypesHelper(e).getGlobalElements();
-      }
-    }
-        
-    String[] result = new String[list.size()];
-    list.toArray(result);
-    return result;
-  } 
-  
-  protected XSDSchema lookupOrCreateSchemaForElement(Element element)
-  {            
-    XSDSchema result = null;
-    Document document = element.getOwnerDocument();
-    if (document instanceof INodeNotifier)
-    {
-      INodeNotifier notifier = (INodeNotifier)document;
-      XSDModelAdapter adapter = (XSDModelAdapter)notifier.getAdapterFor(XSDModelAdapter.class);
-      if (adapter == null)
-      {
-        adapter = new XSDModelAdapter();       
-        notifier.addAdapter(adapter);        
-        adapter.createSchema(document.getDocumentElement()); 
-      } 
-      result = adapter.getSchema();
-    }    
-    return result;
-  }   
-  
-  protected TypesHelper getTypesHelper(Element element)
-  {
-    XSDSchema schema = lookupOrCreateSchemaForElement(element);
-    return new TypesHelper(schema);  
-  }
-
-  
-  protected boolean checkName(String localName, String token)
-  {
-    if (localName != null && localName.trim().equals(token))
-    {
-      return true;
-    }
-    return false;
-  }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java
deleted file mode 100644
index 76b5908..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java
+++ /dev/null
@@ -1,303 +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.xsd.ui.internal.text;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class XSDModelReconcileAdapter extends DocumentAdapter
-{
-    INodeNotifier currentNotifier;
-    int currentEventType;
-    XSDSchema schema;
-    
-    public XSDModelReconcileAdapter(Document document, XSDSchema schema)
-    {
-      super(document);
-      this.schema = schema;
-    }
-        
-    boolean handlingNotifyChanged = false;
-
-    public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index)
-    {
-      if (!handlingNotifyChanged)
-      {
-        handlingNotifyChanged = true;
-        try
-        {
-          // delay handle events only in the source view
-          //if (getCurrentPageType() == XSDEditorPlugin.SOURCE_PAGE &&
-          //    !(getActivePart() instanceof PropertySheet) && 
-          //    !(getActivePart() instanceof org.eclipse.ui.views.contentoutline.ContentOutline)) {
-          //  startDelayedEvent(notifier, eventType, feature, oldValue, newValue, index);
-          //}
-          //else // all other views, just handle the events right away
-          {
-            handleNotifyChange(notifier, eventType, feature, oldValue, newValue, index);
-          }
-        }
-        catch (Exception e)
-        {
-//          XSDEditorPlugin.getPlugin().getMsgLogger().write(e);
-        }
-        handlingNotifyChanged = false;
-      }
-    }
-
-    public void handleNotifyChange(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index)
-    {
-//      System.out.println(eventType + " : HandleNotifyChange " + notifier.hashCode() + " notifier " + notifier);
-      switch (eventType)
-      {
-        case INodeNotifier.ADD:
-        {
-          if (newValue instanceof Element)
-          {
-            adapt((Element)newValue);
-//  Add     updateParentForDerivation(node, listener);
-          }
-          break;
-        }
-        case INodeNotifier.REMOVE:
-        {
-          Node node = (Node)notifier;
-          XSDConcreteComponent listener = schema.getCorrespondingComponent(node);
-         
-          if (listener instanceof XSDSchema)
-          {
-            // we want to reset the schema's external elements when the directive is deleted
-            if (feature instanceof Element)
-            {
-              Element elem = (Element)feature;
-              if (XSDDOMHelper.inputEquals(elem, XSDConstants.INCLUDE_ELEMENT_TAG, false) ||
-                  XSDDOMHelper.inputEquals(elem, XSDConstants.IMPORT_ELEMENT_TAG, false) ||
-                  XSDDOMHelper.inputEquals(elem, XSDConstants.REDEFINE_ELEMENT_TAG, false))
-              {
-                schema.reset();
-                schema.update();
-              }
-            }
-          }          
-        }
-        case INodeNotifier.CHANGE:
-        {
-          Node node = (Node)notifier;
-          XSDConcreteComponent listener = schema.getCorrespondingComponent(node);
-          if (node.getNodeType() == Node.ELEMENT_NODE)
-          {
-            listener.elementAttributesChanged((Element)node);
-            listener.elementChanged((Element)node);
-          }
-          else if (node.getNodeType() == Node.DOCUMENT_NODE)
-          {
-            listener.elementAttributesChanged(((Document)node).getDocumentElement());
-            listener.elementChanged(((Document)node).getDocumentElement());
-          }
-          break;
-        }
-        case INodeNotifier.STRUCTURE_CHANGED:
-        case INodeNotifier.CONTENT_CHANGED:
-        {
-          Node node = (Node)notifier;
-          XSDConcreteComponent listener = schema.getCorrespondingComponent(node);
-          if (node.getNodeType() == Node.ELEMENT_NODE)
-          {
-            listener.elementContentsChanged((Element)node);
-            break;
-          }
-          else if (node.getNodeType() == Node.DOCUMENT_NODE)
-          {
-            Element docElement = ((Document)node).getDocumentElement();
-            // Need to add check if doc element is being edited in the source
-            if (docElement != null)
-            {
-              String prefix = docElement.getPrefix();
-              String xmlnsString = prefix == null? "xmlns" : "xmlns:" + prefix;
-              Attr attr = docElement.getAttributeNode(xmlnsString);
-              boolean doParse = false;
-              if (attr != null)
-              {
-                if (attr.getValue().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001) && docElement.getLocalName().equals("schema"))
-                {
-                  // We have a viable schema so parse it
-                  doParse = true;
-                }
-              }
-              
-              if (doParse)
-              {
-                adapt(docElement);
-                schema.setElement(docElement);
-              }
-            }
-          }
-          break;
-        }
-      }
-    }
-
-    protected DelayedEvent delayedTask;
-    protected void startDelayedEvent(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index)
-    {
-//      System.out.println("start delayed event");
-      // check if there is already a delayed task for the same notifier and eventType
-//      if (delayedTask != null)
-//      {
-//        Notifier aNotifier = delayedTask.getNotifier();
-//        int anEventType = delayedTask.getEventType();
-//        if (notifier == aNotifier && anEventType == eventType)
-//        {
-//          // same event, just different data, delay new event
-//          delayedTask.setCancel(true);
-//        }
-//      }
-
-      delayedTask = new DelayedEvent();
-
-      delayedTask.setNotifier(notifier);
-      delayedTask.setEventType(eventType);
-      delayedTask.setFeature(feature);
-      delayedTask.setOldValue(oldValue);
-      delayedTask.setNewValue(newValue);
-      delayedTask.setIndex(index);
-
-      Display.getDefault().timerExec(400,delayedTask);
-    }
-
-    class DelayedEvent implements Runnable
-    {
-      INodeNotifier notifier;
-      int eventType;
-      Object feature;
-      Object oldValue;
-      Object newValue;
-      int index;
-      boolean cancelEvent = false;
-
-      /*
-       * @see Runnable#run()
-       */
-      public void run()
-      {
-        if (!cancelEvent)
-        {
-          handleNotifyChange(notifier, eventType, feature, oldValue, newValue, index);
-          if (delayedTask == this)
-          {
-            delayedTask = null;
-          }
-        }
-      }
-      
-      public void setCancel(boolean flag)
-      {
-        cancelEvent = flag;
-      }
-
-      public void setNotifier(INodeNotifier notifier)
-      {
-        this.notifier = notifier;
-      }
-    
-      public void setEventType(int eventType)
-      {
-        this.eventType = eventType;
-      }
-
-      public void setFeature(Object feature)
-      {
-        this.feature = feature;
-      }
-
-      public void setOldValue(Object oldValue)
-      {
-        this.oldValue = oldValue;     
-      }
-
-      public void setNewValue(Object newValue)
-      {
-        this.newValue = newValue;
-      }
-
-      public void setIndex(int index)
-      {
-        this.index = index;     
-      }
-
-      public INodeNotifier getNotifier()
-      {
-        return notifier;
-      }
-
-      public int getEventType()
-      {
-        return eventType;
-      }
-
-      public Object getNewValue()
-      {
-        return newValue;
-      }
-
-      public Object getOldValue()
-      {
-        return oldValue;
-      }
-
-    }
-}
-
-
-abstract class DocumentAdapter implements INodeAdapter
-{
-  Document document;
-  
-  public DocumentAdapter(Document document)
-  {
-    this.document = document;
-    ((INodeNotifier)document).addAdapter(this);
-    adapt(document.getDocumentElement());
-  }
-
-  public void adapt(Element element)
-  {
-    if (((INodeNotifier)element).getExistingAdapter(this) == null)
-    {
-      ((INodeNotifier)element).addAdapter(this);
-
-      for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling())
-      {
-        if (child.getNodeType() == Node.ELEMENT_NODE)
-        {
-          adapt((Element)child);
-        }
-      }
-    }
-  }
-
-  public boolean isAdapterForType(Object type)
-  {
-    return type == this;
-  }
-
-  abstract public void notifyChanged
-    (INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index);
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/OpenOnSelectionHelper.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/OpenOnSelectionHelper.java
deleted file mode 100644
index 549dcd1..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/OpenOnSelectionHelper.java
+++ /dev/null
@@ -1,329 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.util;
-
-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.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditor;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-
-public class OpenOnSelectionHelper
-{
-  
-  protected StructuredTextEditor textEditor;
-  protected XSDSchema xsdSchema;
-
- 
-  public OpenOnSelectionHelper(StructuredTextEditor textEditor, XSDSchema xsdSchema)
-  {
-  	this.textEditor = textEditor;
-  	this.xsdSchema = xsdSchema;
-  }
-  
-
-  boolean lastResult;
-  
-  public static void openXSDEditor(String schemaLocation)
-  {
-		IPath schemaPath = new Path(schemaLocation);
-		
-		final IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
-	
-		Display.getDefault().syncExec(new Runnable()
-		{
-			/**
-			 * @see java.lang.Runnable#run()
-			 */
-			public void run()
-			{
-				final IWorkbenchWindow workbenchWindow = XSDEditorPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow();
-				if (workbenchWindow != null)
-				{
-					try
-					{
-					  workbenchWindow.getActivePage().openEditor(new FileEditorInput(schemaFile), XSDEditorPlugin.XSD_EDITOR_ID);
-					}
-					catch (PartInitException initEx)
-					{
-					  initEx.printStackTrace();
-//						XSDEditorPlugin.getPlugin().getMsgLogger().write(initEx);
-					}
-					catch(Exception e)
-					{
-					  e.printStackTrace();
-					}
-				}          
-			}
-		});
-  }
-  
-  protected boolean revealObject(final XSDConcreteComponent component)
-  {
-    if (component.getRootContainer().equals(xsdSchema))
-    {
-      Node element = component.getElement();
-      if (element instanceof IndexedRegion)
-      {
-        IndexedRegion indexNode = (IndexedRegion) element;
-        textEditor.getTextViewer().setRangeIndication(indexNode.getStartOffset(), indexNode.getEndOffset() - indexNode.getStartOffset(), true);
-        return true;
-      }
-      return false;
-    }
-    else
-    {
-      lastResult = false;
-      if (component.getSchema() != null)
-      {
-				String schemaLocation = URIHelper.removePlatformResourceProtocol(component.getSchema().getSchemaLocation());
-        IPath schemaPath = new Path(schemaLocation);
-				final IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
-        Display.getDefault().syncExec(new Runnable()
-        {
-	        /**
-	         * @see java.lang.Runnable#run()
-	         */
-	        public void run()
-	        {
-		        final IWorkbenchWindow workbenchWindow = XSDEditorPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow();
-		        if (workbenchWindow != null)
-		        {
-							try
-							{
-							  // IEditorPart editorPart = workbenchWindow.getActivePage().openEditor(new FileEditorInput(schemaFile), textEditor.getXSDEditor().getEditorSite().getId());
-								IEditorPart editorPart = workbenchWindow.getActivePage().openEditor(new FileEditorInput(schemaFile), XSDEditorPlugin.getPlugin().PLUGIN_ID);
-								if (editorPart instanceof XSDEditor)
-								{
-									((XSDEditor)editorPart).openOnGlobalReference(component);
-									lastResult = true;
-								}
-							}
-							catch (PartInitException initEx)
-							{
-//								XSDEditorPlugin.getPlugin().getMsgLogger().write(initEx);
-							}
-						}          
-					}
-				});
-      }
-      return lastResult;
-    }
-  }
-  
-  public void openOnGlobalReference(XSDConcreteComponent comp)
-  {
-    XSDSchema schema = xsdSchema;
-    String name = null;
-    if (comp instanceof XSDNamedComponent)
-    {
-      name = ((XSDNamedComponent) comp).getName();
-    }
-    
-    if (schema == null || name == null)
-    {
-      return;
-    }
-
-    List objects = null;    
-    if (comp instanceof XSDElementDeclaration)
-    {
-      objects = schema.getElementDeclarations();
-    }
-    else if (comp instanceof XSDTypeDefinition)
-    {
-      objects = schema.getTypeDefinitions();
-    }
-
-    if (objects != null)
-    {
-      for (Iterator iter = objects.iterator(); iter.hasNext();)
-      {
-        XSDNamedComponent namedComp = (XSDNamedComponent) iter.next();
-        
-        if (namedComp.getName().equals(name))
-        {
-          revealObject(namedComp);
-        }
-      }
-    }
-  }
-  
-  public boolean openOnSelection()
-  {
-    List selectedNodes = null;
-    ISelection selection = textEditor.getSelectionProvider().getSelection();
-    if (selection instanceof IStructuredSelection) {
-      selectedNodes = ((IStructuredSelection) selection).toList();
-    }
-
-    if (selectedNodes != null && !selectedNodes.isEmpty())
-    {
-      for (Iterator i = selectedNodes.iterator(); i.hasNext();)
-      {
-        Object obj = i.next();
-        if (xsdSchema != null)
-        {
-          XSDConcreteComponent xsdComp = xsdSchema.getCorrespondingComponent((Node)obj);
-          XSDConcreteComponent objectToReveal = null;
-
-          if (xsdComp instanceof XSDElementDeclaration)
-          {
-            XSDElementDeclaration elementDecl = (XSDElementDeclaration) xsdComp;
-            if (elementDecl.isElementDeclarationReference())
-            {
-              objectToReveal = elementDecl.getResolvedElementDeclaration();
-            }
-            else
-            {
-              XSDConcreteComponent typeDef = null;
-              if (elementDecl.getAnonymousTypeDefinition() == null)
-              {
-                typeDef = elementDecl.getTypeDefinition();
-              }
-              
-              XSDConcreteComponent subGroupAffiliation = elementDecl.getSubstitutionGroupAffiliation();
-              
-              if (typeDef != null && subGroupAffiliation != null)
-              {
-                // we have 2 things we can navigate to, if the cursor is anywhere on the substitution attribute
-                // then jump to that, otherwise just go to the typeDef.
-                if (obj instanceof Attr && ((Attr)obj).getLocalName().equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE))
-                {
-                  objectToReveal = subGroupAffiliation;
-                }
-                else
-                {
-                  // try to reveal the type now.  On success, then we return true.
-                  // if we fail, set the substitution group as the object to reveal as a backup plan.
-                  if (revealObject(typeDef))
-                  {
-                    return true;
-                  }
-                  else
-                  {
-                    objectToReveal = subGroupAffiliation;
-                  }
-                }
-              }
-              else
-              {
-                // one or more of these is null.  If the typeDef is non-null, use it.  Otherwise
-                // try and use the substitution group
-                objectToReveal = typeDef != null ? typeDef : subGroupAffiliation;
-              }
-            }
-          }
-          else if (xsdComp instanceof XSDModelGroupDefinition)
-          {
-            XSDModelGroupDefinition elementDecl = (XSDModelGroupDefinition) xsdComp;
-            if (elementDecl.isModelGroupDefinitionReference())
-            {
-              objectToReveal = elementDecl.getResolvedModelGroupDefinition();
-            }
-          }
-          else if (xsdComp instanceof XSDAttributeDeclaration)
-          {
-            XSDAttributeDeclaration attrDecl = (XSDAttributeDeclaration) xsdComp;
-            if (attrDecl.isAttributeDeclarationReference())
-            {
-              objectToReveal = attrDecl.getResolvedAttributeDeclaration();
-            }
-            else if (attrDecl.getAnonymousTypeDefinition() == null)
-            {
-              objectToReveal = attrDecl.getTypeDefinition();
-            }              
-          }
-          else if (xsdComp instanceof XSDAttributeGroupDefinition)
-          {
-            XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) xsdComp;
-            if (attrGroupDef.isAttributeGroupDefinitionReference())
-            {
-              objectToReveal = attrGroupDef.getResolvedAttributeGroupDefinition();
-            }
-          }
-          else if (xsdComp instanceof XSDIdentityConstraintDefinition)
-          {
-            XSDIdentityConstraintDefinition idConstraintDef = (XSDIdentityConstraintDefinition) xsdComp;
-            if (idConstraintDef.getReferencedKey() != null)
-            {
-              objectToReveal = idConstraintDef.getReferencedKey();
-            }
-          }
-          else if (xsdComp instanceof XSDSimpleTypeDefinition)
-          {
-            XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition) xsdComp;
-            objectToReveal = typeDef.getItemTypeDefinition();
-            if (objectToReveal == null)
-            {
-              // if itemType attribute is not set, then check for memberType
-              List memberTypes = typeDef.getMemberTypeDefinitions();
-              if (memberTypes != null && memberTypes.size() > 0)
-              {
-                objectToReveal = (XSDConcreteComponent)memberTypes.get(0);
-              }              
-            }
-          }
-          else if (xsdComp instanceof XSDTypeDefinition)
-          {
-            XSDTypeDefinition typeDef = (XSDTypeDefinition) xsdComp;
-            objectToReveal = typeDef.getBaseType();
-          }
-          else if (xsdComp instanceof XSDSchemaDirective)
-          {
-          	XSDSchemaDirective directive = (XSDSchemaDirective) xsdComp;
-//						String schemaLocation = URIHelper.removePlatformResourceProtocol(directive.getResolvedSchema().getSchemaLocation());
-//						openXSDEditor(schemaLocation);
-//						return false;
-            objectToReveal = directive.getResolvedSchema();						          	          	
-          }
-
-          // now reveal the object if this isn't null
-          if (objectToReveal != null)
-          {
-            return revealObject(objectToReveal);
-          }
-        }
-      }
-    }
-    return false;
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java
deleted file mode 100644
index 2cd1353..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java
+++ /dev/null
@@ -1,83 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-public abstract class SelectionAdapter implements ISelectionProvider
-{
-  protected List listenerList = new ArrayList();
-  protected ISelection selection = new StructuredSelection();
-  protected ISelectionProvider eventSource;
-
-  public void setEventSource(ISelectionProvider eventSource)
-  {
-    this.eventSource = eventSource;
-  }
-
-  public void addSelectionChangedListener(ISelectionChangedListener listener) 
-  {
-    listenerList.add(listener);
-  }
-
-  public void removeSelectionChangedListener(ISelectionChangedListener listener) 
-  {
-    listenerList.remove(listener);
-  }                    
-
-  public ISelection getSelection() 
-  {
-    return selection;
-  }    
-  
-  /**
-   * This method should be specialized to return the correct object that corresponds to the 'other' model
-   */
-  abstract protected Object getObjectForOtherModel(Object object);
-
-    
-  public void setSelection(ISelection modelSelection)  
-  { 
-    List otherModelObjectList = new ArrayList();
-    if (modelSelection instanceof IStructuredSelection)
-    {
-      for (Iterator i = ((IStructuredSelection)modelSelection).iterator(); i.hasNext(); )
-      {
-        Object modelObject = i.next(); 
-        Object otherModelObject = getObjectForOtherModel(modelObject);       
-        if (otherModelObject != null)
-        { 
-          otherModelObjectList.add(otherModelObject);
-        }
-      }
-    }                
-      
-    StructuredSelection nodeSelection = new StructuredSelection(otherModelObjectList);
-    selection = nodeSelection;
-    SelectionChangedEvent event = new SelectionChangedEvent(eventSource != null ? eventSource : this, nodeSelection);
-
-    for (Iterator i = listenerList.iterator(); i.hasNext(); )
-    {
-      ISelectionChangedListener listener = (ISelectionChangedListener)i.next();
-      listener.selectionChanged(event);
-    }
-  }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java
deleted file mode 100644
index 006cfd6..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java
+++ /dev/null
@@ -1,714 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.impl.XSDImportImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class TypesHelper
-{
-  XSDSchema xsdSchema;
-  Vector list = new Vector();
-
-  public TypesHelper(XSDSchema xsdSchema)
-  {
-    this.xsdSchema = xsdSchema;
-  }
-
-  public void updateExternalImportGlobals()
-  {
-    if (xsdSchema != null)
-    {
-      Iterator contents = xsdSchema.getContents().iterator();
-      while (contents.hasNext())
-      {
-        XSDSchemaContent content = (XSDSchemaContent) contents.next();
-        if (content instanceof XSDImportImpl)
-        {
-          XSDImportImpl anImport = (XSDImportImpl) content;
-          try
-          {
-            if (anImport.getSchemaLocation() != null)
-            {
-              anImport.importSchema();
-            }
-          }
-          catch (Exception e)
-          {
-            
-          }
-        }
-      }
-    }
-  }
-
-
-  private Vector addExternalImportedGlobalElements(Vector items)
-  {
-    if (xsdSchema != null)
-    {
-      Iterator contents = xsdSchema.getContents().iterator();
-      while (contents.hasNext())
-      {
-        XSDSchemaContent content = (XSDSchemaContent) contents.next();
-        if (content instanceof XSDImportImpl)
-        {
-          XSDImportImpl anImport = (XSDImportImpl) content;
-
-          XSDSchema impSchema = anImport.getResolvedSchema();
-
-          try
-          {
-            if (impSchema == null)
-            {
-              impSchema = anImport.importSchema();
-            }
-          }
-          catch (Exception e)
-          {
-            
-          }
-
-          if (impSchema != null)
-          {
-            Iterator i = impSchema.getElementDeclarations().iterator();
-            while (i.hasNext())
-            {
-              XSDElementDeclaration anElement = (XSDElementDeclaration) i.next();
-              if (anElement.getName() != null)
-              {
-                items.addAll(getPrefixedNames(anElement.getTargetNamespace(), anElement.getName()));
-              }
-            }
-          }
-        }
-      }
-    }
-    return items;
-  }
-
-  private Vector addExternalImportedAttributes(Vector items)
-  {
-    if (xsdSchema != null)
-    {
-      Iterator contents = xsdSchema.getContents().iterator();
-      while (contents.hasNext())
-      {
-        XSDSchemaContent content = (XSDSchemaContent) contents.next();
-        if (content instanceof XSDImportImpl)
-        {
-          XSDImportImpl anImport = (XSDImportImpl) content;
-
-          XSDSchema impSchema = anImport.getResolvedSchema();
-
-          try
-          {
-            if (impSchema == null)
-            {
-              impSchema = anImport.importSchema();
-            }
-          }
-          catch (Exception e)
-          {
-            
-          }
-
-          if (impSchema != null)
-          {
-            Iterator i = impSchema.getAttributeDeclarations().iterator();
-            while (i.hasNext())
-            {
-              XSDAttributeDeclaration attrib = (XSDAttributeDeclaration) i.next();
-              if (attrib.getName() != null)
-              {
-                items.addAll(getPrefixedNames(attrib.getTargetNamespace(), attrib.getName()));
-              }
-            }
-          }
-        }
-      }
-    }
-    return items;
-  }
-
-  private Vector addExternalImportedAttributeGroups(Vector items)
-  {
-    if (xsdSchema != null)
-    {
-      Iterator contents = xsdSchema.getContents().iterator();
-      while (contents.hasNext())
-      {
-        XSDSchemaContent content = (XSDSchemaContent) contents.next();
-        if (content instanceof XSDImportImpl)
-        {
-          XSDImportImpl anImport = (XSDImportImpl) content;
-
-          XSDSchema impSchema = anImport.getResolvedSchema();
-
-          try
-          {
-            if (impSchema == null)
-            {
-              impSchema = anImport.importSchema();
-            }
-          }
-          catch (Exception e)
-          {
-            
-          }
-
-          if (impSchema != null)
-          {
-            Iterator i = impSchema.getAttributeGroupDefinitions().iterator();
-            while (i.hasNext())
-            {
-              XSDAttributeGroupDefinition attrib = (XSDAttributeGroupDefinition) i.next();
-              if (attrib.getName() != null)
-              {
-                items.addAll(getPrefixedNames(attrib.getTargetNamespace(), attrib.getName()));
-              }
-            }
-          }
-        }
-      }
-    }
-    return items;
-  }
-
-  private Vector addExternalImportedGroups(Vector items)
-  {
-    if (xsdSchema != null)
-    {
-      Iterator contents = xsdSchema.getContents().iterator();
-      while (contents.hasNext())
-      {
-        XSDSchemaContent content = (XSDSchemaContent) contents.next();
-        if (content instanceof XSDImportImpl)
-        {
-          XSDImportImpl anImport = (XSDImportImpl) content;
-
-          XSDSchema impSchema = anImport.getResolvedSchema();
-
-          try
-          {
-            if (impSchema == null)
-            {
-              impSchema = anImport.importSchema();
-            }
-          }
-          catch (Exception e)
-          {
-          }
-
-          if (impSchema != null)
-          {
-            Iterator i = impSchema.getModelGroupDefinitions().iterator();
-            while (i.hasNext())
-            {
-              XSDModelGroupDefinition aGroup = (XSDModelGroupDefinition) i.next();
-              if (aGroup.getName() != null)
-              {
-                items.addAll(getPrefixedNames(aGroup.getTargetNamespace(), aGroup.getName()));
-              }
-            }
-          }
-        }
-      }
-    }
-    return items;
-  }
-
-  public java.util.List getBuiltInTypeNamesList()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      String xsdForXSDPrefix = xsdSchema.getSchemaForSchemaQNamePrefix();
-      if (xsdForXSDPrefix != null && xsdForXSDPrefix.length() > 0)
-      {
-        xsdForXSDPrefix = xsdForXSDPrefix + ":";
-      }
-      else
-      {
-        xsdForXSDPrefix = "";
-      }
-
-      for (int i = 0; i < XSDDOMHelper.dataType.length; i++)
-      {
-        items.add(xsdForXSDPrefix + XSDDOMHelper.dataType[i][0]);
-      }
-    }
-    return items;
-  }
-  
-  public java.util.List getBuiltInTypeNamesList2()
-  {
-    List result = new ArrayList();
-    if (xsdSchema != null)
-    {
-      List prefixes = getPrefixesForNamespace(xsdSchema.getSchemaForSchemaNamespace());
-      for (int i = 0; i < XSDDOMHelper.dataType.length; i++)
-      {
-        for (Iterator j = prefixes.iterator(); j.hasNext();)
-        {
-          String prefix = (String) j.next();
-          String localName = XSDDOMHelper.dataType[i][0]; 
-          String prefixedName = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName; 
-          result.add(prefixedName);
-        }
-      }
-    }
-    return result;
-  }
-
-  public java.util.List getUserSimpleTypeNamesList()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      Iterator i = xsdSchema.getTypeDefinitions().iterator();
-      while (i.hasNext())
-      {
-        XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
-        if (typeDefinition instanceof XSDSimpleTypeDefinition)
-        {
-          items.addAll(getPrefixedNames(typeDefinition.getTargetNamespace(), typeDefinition.getName()));
-          //System.out.println(typeDefinition.getQName(xsdSchema));
-          //items.add(typeDefinition.getQName(xsdSchema));
-        }
-      }
-      items.add(getPrefix(xsdSchema.getSchemaForSchemaNamespace(), true) + "anyType");
-      
-      //      items = addExternalImportedUserSimpleTypes(items);
-      items = (Vector) sortList(items);
-    }
-    return items;
-  }
-
-  public java.util.List getUserComplexTypeNamesList()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      Iterator i = xsdSchema.getTypeDefinitions().iterator();
-      while (i.hasNext())
-      {
-        XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
-        if (typeDefinition instanceof XSDComplexTypeDefinition)
-        {
-			    items.addAll(getPrefixedNames(typeDefinition.getTargetNamespace(), typeDefinition.getName()));         
-        }
-      }
-      items = (Vector) sortList(items);
-    }
-    return items;
-  }
-  
-  public java.util.List getUserSimpleTypes()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      Iterator i = xsdSchema.getTypeDefinitions().iterator();
-      while (i.hasNext())
-      {
-        XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
-        if (typeDefinition instanceof XSDSimpleTypeDefinition)
-        {
-          items.add(typeDefinition);
-          //System.out.println(typeDefinition.getQName(xsdSchema));
-          //items.add(typeDefinition.getQName(xsdSchema));
-        }
-      }
-      // We need to add the anyType
-//      items.add(getPrefix(xsdSchema.getSchemaForSchemaNamespace(), true) + "anyType");
-      
-      //      items = addExternalImportedUserSimpleTypes(items);
-      //items = (Vector) sortList(items);
-    }
-    return items;
-  }
-
-  public String getPrefix(String ns, boolean withColon)
-  {
-    String key = "";
-
-    if (xsdSchema != null)
-    {
-      Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-      Iterator iter = map.keySet().iterator();
-      while (iter.hasNext())
-      {
-        Object keyObj = iter.next();
-        Object value = map.get(keyObj);
-        if (value != null && value.toString().equals(ns))
-        {
-          if (keyObj != null)
-          {
-            key = keyObj.toString();
-          }
-          else
-          {
-            key = "";
-          }
-          break;
-        }
-      }
-      if (!key.equals(""))
-      {
-        if (withColon)
-        {
-          key = key + ":";
-        }
-      }
-    }
-    return key;
-  }
-
-  public java.util.List getUserComplexTypes()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      Iterator i = xsdSchema.getTypeDefinitions().iterator();
-      while (i.hasNext())
-      {
-        XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
-        if (typeDefinition instanceof XSDComplexTypeDefinition)
-        {
-			    items.add(typeDefinition);         
-        }
-      }
-    }
-    return items;
-  }
-  
-  public java.util.List getGlobalElements()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      if (xsdSchema.getElementDeclarations() != null)
-      {
-        Iterator i = xsdSchema.getElementDeclarations().iterator();
-        while (i.hasNext())
-        {
-          XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) i.next();
-          String name = elementDeclaration.getQName(xsdSchema);
-          if (name != null)
-          {
-            items.add(name);
-          }
-        }
-      }
-      //      items = addExternalImportedGlobalElements(items);
-      items = (Vector) sortList(items);
-    }
-    return items;
-  }
-
-  public String getGlobalElement(XSDSchema relativeComponent)
-  {
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      if (xsdSchema.getElementDeclarations() != null)
-      {
-        Iterator i = xsdSchema.getElementDeclarations().iterator();
-        while (i.hasNext()) // just get the first one
-        {
-          XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) i.next();
-          if (elementDeclaration.getQName(relativeComponent) != null)
-          {
-            return elementDeclaration.getQName(relativeComponent);
-          }
-        }
-      }
-
-      Vector items = new Vector();
-      items = addExternalImportedGlobalElements(items);
-      if (items != null && items.size() > 0)
-      {
-        return items.get(0).toString();
-      }
-    }
-    return null; // for disabling menu
-  }
-
-  public java.util.List getGlobalAttributes()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      if (xsdSchema.getAttributeDeclarations() != null)
-      {
-        Iterator i = xsdSchema.getAttributeDeclarations().iterator();
-        while (i.hasNext())
-        {
-          XSDAttributeDeclaration attributeDeclaration = (XSDAttributeDeclaration) i.next();
-          if (attributeDeclaration.getTargetNamespace() == null || (attributeDeclaration.getTargetNamespace() != null && !attributeDeclaration.getTargetNamespace().equals(XSDConstants.SCHEMA_INSTANCE_URI_2001)))
-          {
-            String name = attributeDeclaration.getQName(xsdSchema);
-            if (name != null)
-            {
-              items.add(name);
-            }
-          }
-        }
-      }
-      //      items = addExternalImportedAttributes(items);
-      items = (Vector) sortList(items);
-    }
-    return items;
-  }
-
-  public String getGlobalAttribute(XSDSchema relativeComponent)
-  {
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      if (xsdSchema.getAttributeDeclarations() != null)
-      {
-        Iterator i = xsdSchema.getAttributeDeclarations().iterator();
-        while (i.hasNext()) // just get the first one
-        {
-          XSDAttributeDeclaration attributeDeclaration = (XSDAttributeDeclaration) i.next();
-          // Filter out attributes from the schema namespace
-          if (!(attributeDeclaration.getTargetNamespace().equals(XSDConstants.SCHEMA_INSTANCE_URI_2001)))
-          {
-            if (attributeDeclaration.getQName(relativeComponent) != null)
-            {
-              return attributeDeclaration.getQName(relativeComponent);
-            }
-          }
-        }
-      }
-
-      Vector items = new Vector();
-      items = addExternalImportedAttributes(items);
-      if (items != null && items.size() > 0)
-      {
-        return items.get(0).toString();
-      }
-    }
-    return null; // for disabling menu
-  }
-
-  public java.util.List getGlobalAttributeGroups()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      if (xsdSchema.getAttributeGroupDefinitions() != null)
-      {
-        Iterator i = xsdSchema.getAttributeGroupDefinitions().iterator();
-        while (i.hasNext())
-        {
-          XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) i.next();
-          String name = attributeGroupDefinition.getQName(xsdSchema);
-          if (name != null)
-          {
-            items.add(name);
-          }
-        }
-      }
-      //      items = addExternalImportedAttributeGroups(items);
-      items = (Vector) sortList(items);
-    }
-    return items;
-  }
-
-  public String getGlobalAttributeGroup(XSDSchema relativeComponent)
-  {
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      if (xsdSchema.getAttributeGroupDefinitions() != null)
-      {
-        Iterator i = xsdSchema.getAttributeGroupDefinitions().iterator();
-        while (i.hasNext()) // just get the first one
-        {
-          XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) i.next();
-          if (attributeGroupDefinition.getQName(relativeComponent) != null)
-          {
-            return attributeGroupDefinition.getQName(relativeComponent);
-          }
-        }
-      }
-
-      Vector items = new Vector();
-      items = addExternalImportedAttributeGroups(items);
-      if (items != null && items.size() > 0)
-      {
-        return items.get(0).toString();
-      }
-    }
-    return null; // for disabling menu
-  }
-
-  public java.util.List getModelGroups()
-  {
-    Vector items = new Vector();
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      if (xsdSchema.getModelGroupDefinitions() != null)
-      {
-        Iterator i = xsdSchema.getModelGroupDefinitions().iterator();
-        while (i.hasNext())
-        {
-          XSDModelGroupDefinition modelGroupDefinition = (XSDModelGroupDefinition) i.next();
-          String name = modelGroupDefinition.getQName(xsdSchema);
-          if (name != null)
-          {
-            items.add(name);
-          }
-        }
-      }
-      //      items = addExternalImportedGroups(items);
-      items = (Vector) sortList(items);
-    }
-    return items;
-  }
-
-  public static java.util.List sortList(java.util.List types)
-  {
-    try
-    {
-      java.util.Collections.sort(types); // performance?  n*log(n)
-    }
-    catch (Exception e)
-    {
-//      XSDEditorPlugin.getPlugin().getMsgLogger().write("Sort failed");
-    }
-    return types;
-  }
-
-  public String getModelGroup(XSDSchema relativeComponent)
-  {
-    if (xsdSchema != null)
-    {
-      updateExternalImportGlobals();
-      if (xsdSchema.getModelGroupDefinitions() != null)
-      {
-        Iterator i = xsdSchema.getModelGroupDefinitions().iterator();
-        while (i.hasNext()) // just get the first one
-        {
-          XSDModelGroupDefinition modelGroupDefinition = (XSDModelGroupDefinition) i.next();
-          if (modelGroupDefinition.getQName(relativeComponent) != null)
-          {
-            return modelGroupDefinition.getQName(relativeComponent);
-          }
-        }
-      }
-
-      Vector items = new Vector();
-      items = addExternalImportedGroups(items);
-      if (items != null && items.size() > 0)
-      {
-        return items.get(0).toString();
-      }
-    }
-    return null; // for disabling menu
-  }
-
-  public void updateMapAfterDelete(XSDImport deletedNode)
-  {
-    String ns = deletedNode.getNamespace();
-    if (ns != null)
-    {
-      String prefix = getPrefix(ns, false);
-      if (prefix != null)
-      {
-        prefix = prefix.trim();
-      }
-      String xmlnsAttr = (prefix == "") ? "xmlns" : "xmlns:" + prefix;
-
-      if (prefix == "")
-      {
-        prefix = null;
-      }
-
-      if (xsdSchema != null)
-      {
-        Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-        map.remove(prefix);
-        Element schemaElement = xsdSchema.getElement();
-        schemaElement.removeAttribute(xmlnsAttr);
-      }
-    }
-  }
-
-  public List getPrefixedNames(String namespace, String localName)
-  {
-    List list = new ArrayList();
-    if (namespace == null)
-    {
-      namespace = "";    			
-    }
-    if (xsdSchema != null && localName != null)
-    {
-      List prefixes = getPrefixesForNamespace(namespace);
-      for (Iterator i = prefixes.iterator(); i.hasNext(); )
-      {
-      	String prefix = (String)i.next();
-      	if (prefix == null) prefix = "";
-        String prefixedName = prefix.length() > 0 ? prefix + ":" + localName : localName;
-        list.add(prefixedName);               
-      }
-      if (prefixes.size() == 0)
-      {
-        list.add(localName);
-      }
-    }
-    return list;
-  }
-  
-  protected List getPrefixesForNamespace(String namespace)
-  {
-    List list = new ArrayList();
-    Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-    for (Iterator iter = map.keySet().iterator(); iter.hasNext();)
-    {
-      String prefix = (String) iter.next();
-      Object value = map.get(prefix);
-      if (value != null && value.toString().equals(namespace))
-      {
-       list.add(prefix);
-      }
-    }
-    return list;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java
deleted file mode 100644
index 3e71a8a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java
+++ /dev/null
@@ -1,429 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.util;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-
-public class ViewUtility
-{
-  private static Font font;
-
-  public static Font getFont()
-  {
-    if (font == null)
-    {              
-      font = new Font(Display.getCurrent(), "ms sans serif", 8, SWT.NORMAL);  
-    }
-    return font;
-  }
-
-  public static void setFont(Font newFont)
-  {
-    font = newFont;
-  }
-
-  public static void setComposite(Composite comp)
-  {
-    // deprecated.  Remove later
-  }
-  public static Composite createComposite(Composite parent, int numColumns)
-  {
-    Composite composite = new Composite(parent, SWT.NONE);
-
-    composite.setFont(getFont());
-
-    GridLayout layout = new GridLayout();
-    layout.numColumns = numColumns;
-    composite.setLayout(layout);
-
-    GridData data = new GridData();
-    data.verticalAlignment = GridData.FILL;
-    data.horizontalAlignment = GridData.FILL;
-    composite.setLayoutData(data);
-    return composite;
-  }
-
-  public static Composite createComposite(Composite parent, int numColumns, boolean horizontalFill)
-  {
-    if (!horizontalFill)
-    {
-      createComposite(parent, numColumns);
-    }
-
-    Composite composite = new Composite(parent, SWT.NONE);
-
-    composite.setFont(getFont());
-
-    GridLayout layout = new GridLayout();
-    layout.numColumns = numColumns;
-    composite.setLayout(layout);
-
-    GridData data = new GridData();
-    data.verticalAlignment = GridData.FILL;
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    composite.setLayoutData(data);
-
-    return composite;
-  }
-
-  public static Composite createComposite(Composite parent, int numColumns, boolean horizontalFill, boolean verticalFill)
-  {
-    if (!horizontalFill && !verticalFill)
-    {
-      createComposite(parent, numColumns);
-    }
-
-    Composite composite = new Composite(parent, SWT.NONE);
-
-    composite.setFont(getFont());
-
-    GridLayout layout = new GridLayout();
-    layout.numColumns = numColumns;
-    composite.setLayout(layout);
-
-    GridData data = new GridData();
-    data.verticalAlignment = GridData.FILL;
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    data.grabExcessVerticalSpace = true;
-    composite.setLayoutData(data);
-
-    return composite;
-  }
-
-  public static Label createHorizontalFiller(Composite parent, int horizontalSpan) 
-  {
-    Label label = new Label(parent, SWT.LEFT);
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.horizontalSpan = horizontalSpan;
-    label.setLayoutData(data);
-    return label;
-  }
-
-  /**
-   * Helper method for creating labels.
-   */
-  public static Label createLabel(Composite parent, String text) 
-  {
-    Label label = new Label(parent, SWT.LEFT);
-    label.setText(text);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    label.setLayoutData(data);
-    return label;
-  }
-
-	public Label createLabel(Composite parent, int style, String text)
-	{
-		Label label = new Label(parent, style);
-//		setColor(label);
-		label.setText(text);
-
-		GridData data = new GridData();
-		data.horizontalAlignment = GridData.FILL;
-		label.setLayoutData(data);
-		return label;
-	}
-  
-  public static Label createLabel(Composite parent, String text, int alignment)
-  {
-    Label label = new Label(parent, SWT.LEFT);
-    label.setText(text);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.verticalAlignment = alignment;
-    label.setLayoutData(data);
-    return label;
-  }
-
-  /**
-   * Helper method for creating buttons.
-   */
-  public static Button createPushButton(Composite parent, String label) 
-  {
-    Button button = new Button(parent, SWT.PUSH);
-    button.setText(label);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    button.setLayoutData(data);
-
-    return button;
-  }
-
-  public static Table createTable(Composite parent)
-  {
-    Table table = new Table(parent, SWT.SINGLE | SWT.BORDER);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    table.setLayoutData(data);
-
-    return table;
-  }
-
-  /**
-   * Create radio button
-   */
-  public static Button createRadioButton(Composite parent, String label)
-  {
-    Button button = new Button(parent, SWT.RADIO);
-    button.setText(label);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    button.setLayoutData(data);
-
-    return button;
-  }
-
-  /**
-   * Helper method for creating check box
-   */
-  public static Button createCheckBox(Composite parent, String label) 
-  {
-    Button button = new Button(parent, SWT.CHECK);
-    button.setText(label);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    button.setLayoutData(data);
-    return button;
-  }
-
-  public static Combo createComboBox(Composite parent)
-  {
-    return createComboBox(parent, true);
-  }
-
-  public static Combo createComboBox(Composite parent, boolean isReadOnly)
-  {
-    int style = isReadOnly == true ? SWT.READ_ONLY : SWT.DROP_DOWN;
-
-    Combo combo = new Combo(parent, style);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    combo.setLayoutData(data);
-    return combo;
-  }
-
-  public static List createListBox(Composite parent, int width, boolean isMultiSelect)
-  {
-    int style = isMultiSelect ? SWT.MULTI : SWT.SINGLE;
-    List list = new List(parent, style | SWT.BORDER);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    data.widthHint = width;
-    list.setLayoutData(data);
-
-    return list;
-  }
-
-  public static List createListBox(Composite parent, int style)
-  {
-    List list = new List(parent, style);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.verticalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    data.grabExcessVerticalSpace = true;
-    list.setLayoutData(data);
-
-    return list;
-  }
-
-	public Text createTextField(Composite parent)
-	{
-		Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
-		GridData data = new GridData();
-		data.horizontalAlignment = GridData.FILL;
-		data.verticalAlignment = GridData.FILL;
-		data.grabExcessHorizontalSpace = true;
-		text.setLayoutData(data);
-//		text.addKeyListener(keyboardHandler);
-		return text;
-	}
-  
-  public static Text createTextField(Composite parent, int width)
-  {
-    Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    data.widthHint = width;
-    text.setLayoutData(data);
-
-    return text;
-  }
-
-  /**
-   * <code>createWrappedMultiTextField</code> creates a wrapped multitext field
-   *
-   * @param parent a <code>Composite</code> value
-   * @param width an <code>int</code> value
-   * @param numLines an <code>int</code> value representing number of characters in height
-   * @param verticalFill a <code>boolean</code> value
-   * @return a <code>Text</code> value
-   */
-  public static Text createWrappedMultiTextField(Composite parent, int width, int numLines, boolean verticalFill)
-  {
-    Text text = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    if (verticalFill)
-    {
-      data.verticalAlignment = GridData.FILL;
-      data.grabExcessVerticalSpace = true;
-    }      
-    data.widthHint = width;
-    FontData[] fontData = getFont().getFontData();
-    // hack for now where on Windows, only 1 fontdata exists
-    data.heightHint = numLines * fontData[0].getHeight();
-    text.setLayoutData(data);
-
-    return text;
-  }
-
-  public static Text createMultiTextField(Composite parent, int width, int height, boolean verticalFill)
-  {
-    Text text = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    if (verticalFill)
-    {
-      data.verticalAlignment = GridData.FILL;
-      data.grabExcessVerticalSpace = true;
-    }      
-    data.widthHint = width;
-    data.heightHint = height;
-    text.setLayoutData(data);
-
-    return text;
-  }
-
-  public static Group createGroup(Composite parent, int numColumns, String text, boolean verticalFill) 
-  {
-    Group group = new Group(parent, SWT.SHADOW_ETCHED_IN);
-    group.setText(text);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    if (verticalFill)
-    {
-      data.verticalAlignment = GridData.FILL;
-      data.grabExcessVerticalSpace = true;
-    }      
-    group.setLayoutData(data);
-
-    GridLayout layout = new GridLayout();
-    layout.numColumns = numColumns;
-    group.setLayout(layout);
-    return group;
-  }
-
- public static Group createGroup(Composite parent, int numColumns, String text, boolean verticalFill, int alignment) 
-  {
-    Group group = new Group(parent, SWT.SHADOW_ETCHED_IN);
-    group.setText(text);
-
-    GridData data = new GridData();
-    data.horizontalAlignment = GridData.FILL;
-    data.grabExcessHorizontalSpace = true;
-    data.verticalAlignment = alignment;
-    if (verticalFill)
-    {
-      data.verticalAlignment = GridData.FILL;
-      data.grabExcessVerticalSpace = true;
-    }      
-    group.setLayoutData(data);
-
-    GridLayout layout = new GridLayout();
-    layout.numColumns = numColumns;
-    group.setLayout(layout);
-    return group;
-  }
-
-  public static Label createVerticalFiller(Composite parent, int verticalSpan) 
-  {
-    Label label = new Label(parent, SWT.LEFT);
-    label.setFont(getFont());
-
-    GridData data = new GridData();
-    data.verticalAlignment = GridData.FILL;
-    data.verticalSpan = verticalSpan;
-    label.setLayoutData(data);
-
-    return label;
-  }
-
-  /**
-   * Creates a grid data object that occupies vertical and horizontal
-   * space.
-   */
-  static public GridData createFill()
-  {
-    GridData gd= new GridData();
-    gd.horizontalAlignment= GridData.FILL;
-    gd.grabExcessHorizontalSpace= true;
-    gd.verticalAlignment= GridData.FILL;
-    gd.grabExcessVerticalSpace= true;
-    return gd;
-  }
-  /**
-   * Creates a grid data object that occupies horizontal space.
-   */
-  static public GridData createHorizontalFill()
-  {
-    GridData gd= new GridData();
-    gd.horizontalAlignment= GridData.FILL;
-    gd.grabExcessHorizontalSpace= true;
-    return gd;
-  }
-  /**
-   * Creates a grid data object that occupies vertical space.
-   */
-  static public GridData createVerticalFill()
-  {
-    GridData gd= new GridData();
-    gd.verticalAlignment= GridData.FILL;
-    gd.grabExcessVerticalSpace= true;
-    return gd;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java
deleted file mode 100644
index 8d18a11..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java
+++ /dev/null
@@ -1,1136 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.util;
-
-import java.util.ArrayList;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-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.format.FormatProcessorXML;
-import org.eclipse.xsd.util.XSDConstants;
-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;
-
-public class XSDDOMHelper
-{
-  public static final int LENGTH_FACET        =  1;
-  public static final int MIN_LENGTH_FACET    =  2;
-  public static final int MAX_LENGTH_FACET    =  3;
-  public static final int PATTERN_FACET       =  4;
-  public static final int ENUM_FACET          =  5;
-  public static final int WHITE_SPACE_FACET   =  6;
-
-  public static final int MAX_INCLUSIVE_FACET =  7;
-  public static final int MAX_EXCLUSIVE_FACET =  8;
-  public static final int MIN_INCLUSIVE_FACET =  9;
-  public static final int MIN_EXCLUSIVE_FACET =  10;
-
-  public static final int TOTAL_DIGITS_FACET     = 11;
-  public static final int FRACTION_DIGITS_FACET  = 12;
-
-  public static final int N_FACETS            = 13;
-
-  public static String[][] dataType =
-  {
-    //
-    // Table format:
-    // Type
-    //  Length, MinLength, MaxLength, Pattern, Enumeration,whiteSpace
-    //  MaxInclusive, MaxExclusive, MinInclusive, MinExclusive, TotalDigits, FractionDigits
-    //
-
-    // 0
-    { "anySimpleType",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-    // 1
-    { "anyType",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-
-    // 2
-    { "anyURI",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 3
-    { "base64Binary",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 4
-    { "boolean",
-        "N", "N", "N", "Y", "N", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 5
-    { "byte",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-    // 6
-    { "date",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "N", "N",
-    },
-
-    // 7
-    { "dateTime",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "N", "N",
-    },
-
-    // 8
-    { "decimal",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-
-    // 9
-    { "double",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "N", "N",
-    },
-
-    // 10
-    { "duration",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "N", "N",
-    },
-
-    // 11
-    { "ENTITY",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 12
-    { "ENTITIES",
-        "Y", "Y", "Y", "N", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 13
-    { "float",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "N", "N",
-    },
-
-    // 14
-    { "gDay",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "N", "N",
-    },
-
-    // 15
-    { "gMonth",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "N", "N",
-    },
-
-    // 16
-    { "gMonthDay",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "N", "N",
-    },
-
-    // 17
-    { "gYear",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "N", "N",
-    },
-
-    // 18
-    { "gYearMonth",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "N", "N",
-    },
-
-    // 19
-    { "hexBinary",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 20
-    { "ID",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 21
-    { "IDREF",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 22
-    { "IDREFS",
-        "Y", "Y", "Y", "N", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 23
-    { "int",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-    // 24
-    { "integer",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-    // 25
-    { "language",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 26
-    { "long",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-    // 27
-    { "Name",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-
-    // 28
-    { "NCName",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 29
-    { "negativeInteger",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-    // 30
-    { "NMTOKEN",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 31
-    { "NMTOKENS",
-        "Y", "Y", "Y", "N", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 32
-    { "nonNegativeInteger",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-    // 33
-    { "nonPositiveInteger",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-    // 34
-    { "normalizedString",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-
-    },
-
-    // 35
-    { "NOTATION",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-
-    },
-
-    // 36
-    { "positiveInteger",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-    // 37
-    { "QName",
-        "N", "N", "N", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 38
-    { "short",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-    // 39
-    { "string",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 40
-    { "time",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "N", "N",
-    },
-
-    // 41
-    { "token",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-        "N", "N", "N", "N", "N", "N",
-    },
-
-    // 42
-    { "unsignedByte",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-    // 43
-    { "unsignedInt",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-    // 44
-    { "unsignedLong",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-    // 45
-    { "unsignedShort",
-        "N", "N", "N", "Y", "Y", "Y",
-        "Y", "Y", "Y", "Y", "Y", "Y",
-    },
-
-  };
-
-  public static String XMLSchemaURI = "http://www.w3.org/2001/XMLSchema";
-
-  /**
-   * Constructor for XSDDOMHelper.
-   */
-  public XSDDOMHelper()
-  {
-    super();
-  }
-
-  public Node getChildNode(Element parent, String childName)
-  {
-/*    NodeList nodeList = parent.getElementsByTagNameNS(XMLSchemaURI, childName);
-    if (nodeList.getLength() > 0)
-      return nodeList.item(0);
-    return null;
-*/
-    NodeList list = null;
-    if (parent != null)
-    {
-      list = parent.getChildNodes();
-    }
-
-    if (list != null)
-    {
-      // Performance issue perhaps?
-      for (int i = 0; i < list.getLength(); i++)
-      {
-        if (list.item(i) instanceof Element)
-        {
-          if (list.item(i).getLocalName().equals(childName))
-          {
-            return list.item(i);
-          }
-        }
-      }
-    }
-    return null;
-  }
-
-  public static String SIMPLE_TYPE = "Simple";
-  public static String USER_SIMPLE_TYPE = "simpleType";
-  public static String USER_COMPLEX_TYPE = "complexType";
-/*
-  public void setElementType(Element element, String type)
-  {
-    Document doc = element.getOwnerDocument();
-    if (type.equals(SIMPLE_TYPE))
-    {
-      removeChild(element, USER_SIMPLE_TYPE);
-      removeChild(element, USER_COMPLEX_TYPE);
-      element.setAttribute("type","xsd:string");
-      return;
-    }
-    else if (type.equals(USER_SIMPLE_TYPE))
-    {
-      removeChild(element, USER_COMPLEX_TYPE);
-    }
-    else
-    {
-      removeChild(element, USER_SIMPLE_TYPE);
-    }
-    element.removeAttribute("type");
-    element.appendChild(doc.createElement("xsd:"+type));
-  }
-
-  public String getElementType(Element element)
-  {
-    String tagName = element.getLocalName();
-
-    if (tagName.equals(XSDConstants.ELEMENT_ELEMENT_TAG) ||
-        tagName.equals(XSDConstants.ATTRIBUTE_ELEMENT_TAG))
-    {
-      if (element.hasAttribute("type"))
-      {
-        return SIMPLE_TYPE;
-      }
-      NodeList nodes = element.getElementsByTagNameNS(XMLSchemaURI, USER_SIMPLE_TYPE);
-      if (nodes.getLength() > 0)
-      {
-        return USER_SIMPLE_TYPE;
-      }
-      nodes = element.getElementsByTagNameNS(XMLSchemaURI, USER_COMPLEX_TYPE);
-      if (nodes.getLength() > 0)
-      {
-        return USER_COMPLEX_TYPE;
-      }
-    }
-    return "";
-  }
-*/
-  public void removeDerivedByElement(Element element)
-  {
-    removeChild(element, XSDConstants.RESTRICTION_ELEMENT_TAG);
-    removeChild(element, XSDConstants.EXTENSION_ELEMENT_TAG);
-  }
-
-  public String getBaseType(Element element) // for SimpleContent and ComplexContent
-  {
-    Node restrictionChild = getChildNode(element, "restriction");
-    Node extensionChild = getChildNode(element, "extension");
-    String baseType = "";
-    if (restrictionChild != null)
-    {
-      if (restrictionChild instanceof Element)
-      {
-        baseType = ((Element)restrictionChild).getAttribute("base");
-//        String prefix = element.getPrefix();
-//        if (prefix != null && prefix.length() > 0)
-//        {
-//          baseType = baseType.substring(baseType.indexOf(prefix) + prefix.length() + 1);
-//        }
-      }
-    }
-    else if (extensionChild != null) // should be one or the other
-    {
-      if (extensionChild instanceof Element)
-      {
-        baseType = ((Element)extensionChild).getAttribute("base");
-//        String prefix = element.getPrefix();
-//        if (prefix != null && prefix.length() > 0)
-//        {
-//          baseType = baseType.substring(baseType.indexOf(prefix) + prefix.length() + 1);
-//        }
-      }
-    }
-    return baseType;
-  }
-
-  public void setDerivedByBaseType(Element element, String derivedByType, String type)
-  {
-    Document doc = element.getOwnerDocument();
-
-    Element derivedByElement = getDerivedByElement(element);
-    if (derivedByElement != null)
-    {
-      derivedByElement.setAttribute("base", type);
-    }
-    else  // there really should be one already...base is required.
-    {
-      Element newElement = doc.createElement(derivedByType);
-      newElement.setAttribute("base", type);
-      element.appendChild(newElement);
-    }
-  }
-
-  public void changeDerivedByType(Element element, String derivedByType, String type)
-  {
-    Document doc = element.getOwnerDocument();
-
-    String prefix = element.getPrefix();
-    prefix = prefix == null ? "" : prefix + ":";
-
-    Element derivedByElement = getDerivedByElement(element);
-    
-    if (derivedByElement != null && derivedByElement.getLocalName().equals(derivedByType))
-    {
-    	return; // it's already the derived by type
-    }
-    Element newNode;
-  	if (derivedByType.equals("restriction"))
-  	{
-    	newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.RESTRICTION_ELEMENT_TAG);
-    }
-    else
-    {
-    	newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.EXTENSION_ELEMENT_TAG);
-    }
-	
-    newNode.setAttribute("base", type);
-
-    if (derivedByElement != null)
-    {
-      if (derivedByElement.hasChildNodes())
-      {        
-        NodeList nodes = derivedByElement.getChildNodes();
-        // use clones so we don't have a refresh problem
-        for (int i = 0; i < nodes.getLength(); i++)
-        {
-          Node node = nodes.item(i);       
-          newNode.appendChild(node.cloneNode(true));
-        }
-      }
-	  element.replaceChild(newNode, derivedByElement);
-    }
-    else 
-	{
-		Element parent = (Element) element.getParentNode();				// get back to complexType
-        NodeList nodes = parent.getChildNodes();
-		ArrayList nodeSaveList = new ArrayList();
-		
-		// save children. (nodes turns out to be the same object as parent;
-		// deleting them from parent will delete them from nodes.)
-        for (int i = 0; i < nodes.getLength(); i++)			
-        {
-          Node node = nodes.item(i);      
-		  nodeSaveList.add(node);
-        }
-
-        // remove children so we can surround them by complexContent
-        for (int i = 0; i < nodeSaveList.size(); i++)			
-        {
-          Node node = (Node) nodeSaveList.get(i);      
-          parent.removeChild(node);
-        }
-		
-		// build a complexContent element
-		Element complexContent = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.COMPLEXCONTENT_ELEMENT_TAG);
-		parent.appendChild(complexContent);					// insert into complexType
-		complexContent.appendChild(newNode);				// insert derivation type
-        for (int i = 0; i < nodeSaveList.size(); i++)			// insert children previously of complexType
-        {
-          Node node = (Node) nodeSaveList.get(i);       
-          newNode.appendChild(node.cloneNode(true));
-        }
-		
-		parent.appendChild(complexContent);
-		formatChild(complexContent);
-    }
-  }
-
-  public void setSimpleContentType(Element element, String type)
-  {
-    String contentTypeName = element.getLocalName();
-
-    if (contentTypeName.equals(XSDConstants.UNION_ELEMENT_TAG))
-    {
-      element.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, type);
-    }
-    else if (contentTypeName.equals(XSDConstants.LIST_ELEMENT_TAG))
-    {
-      element.setAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, type);
-    }
-    else if (contentTypeName.equals(XSDConstants.RESTRICTION_ELEMENT_TAG))
-    {
-      element.setAttribute(XSDConstants.BASE_ATTRIBUTE, type);
-    }
-  }
-
-  public void removeSimpleTypeContent(Element element)
-  {
-    String contentTypeName = element.getLocalName();
-    if (contentTypeName.equals(XSDConstants.UNION_ELEMENT_TAG))
-    {
-      element.removeAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-    }
-    else if (contentTypeName.equals(XSDConstants.LIST_ELEMENT_TAG))
-    {
-      element.removeAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
-    }
-    else if (contentTypeName.equals(XSDConstants.RESTRICTION_ELEMENT_TAG))
-    {
-      element.removeAttribute(XSDConstants.BASE_ATTRIBUTE);
-    }
-  }
-
-  public String getDerivedByName(Element element)
-  {
-    Node restrictionChild = getChildNode(element, "restriction");
-    Node extensionChild = getChildNode(element, "extension");
-    if (restrictionChild != null)
-    {
-      return "restriction";
-    }
-    if (extensionChild != null)
-    {
-      return "extension";
-    }
-    return "";
-  }
-
-  /**
-   * Get the derived by node given the complexContent or simpleContent node
-   */
-  public Element getDerivedByElement(Element element)
-  {
-    Node restrictionChild = getChildNode(element, "restriction");
-    Node extensionChild = getChildNode(element, "extension");
-    if (restrictionChild != null)
-    {
-      if (restrictionChild instanceof Element)
-      {
-        return (Element)restrictionChild;
-      }
-    }
-    
-    if (extensionChild != null)
-    {
-      if (extensionChild instanceof Element)
-      {
-        return (Element)extensionChild;
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Get the derived by node given the ComplexType node
-   * Returns the first one, if say, the INVALID schema has more than one
-   */
-  public Element getDerivedByElementFromComplexType(Element element)
-  {
-    NodeList nl = element.getChildNodes();
-    int j = 0;
-    for (j = 0; j < nl.getLength(); j++)
-    {
-      Node aNode = nl.item(j);
-      if (inputEquals(aNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-      {
-        break; 
-      }
-      else if (inputEquals(aNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-      {
-        break;
-      }
-    }
-    Element derivedByNode = getDerivedByElement((Element)nl.item(j));
-    return derivedByNode;
-  }
-
-  /**
-   * Get the content model given the ComplexType node
-   * Returns the first one, if say, the INVALID schema has more than one
-   */
-  public Element getContentModelFromParent(Element element)
-  {
-    NodeList nl = element.getChildNodes();
-    int j = 0;
-    boolean modelExists = false;
-    int length = nl.getLength();
-    for (j = 0; j < length; j++)
-    {
-      Node aNode = nl.item(j);
-      if (inputEquals(aNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
-      {
-        modelExists = true;
-        break; 
-      }
-      else if (inputEquals(aNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
-      {
-        modelExists = true;
-        break;
-      }
-      else if (inputEquals(aNode, XSDConstants.SEQUENCE_ELEMENT_TAG, false))
-      {
-        modelExists = true;
-        break;
-      }
-      else if (inputEquals(aNode, XSDConstants.CHOICE_ELEMENT_TAG, false))
-      {
-        modelExists = true;
-        break;
-      }
-      else if (inputEquals(aNode, XSDConstants.ALL_ELEMENT_TAG, false))
-      {
-        modelExists = true;
-        break;
-      }
-    }
-    if (!modelExists)
-    {
-      return null;
-    }
-
-    Element derivedByNode = (Element)nl.item(j);
-    return derivedByNode;
-  }
-
-  /**
-   * 
-   */
-  public void changeContentModel(Element complexTypeElement, String contentModel, Element sequenceChoiceOrAllElement)
-  {
-    Document doc = complexTypeElement.getOwnerDocument();
-
-    String prefix = complexTypeElement.getPrefix();
-    prefix = prefix == null ? "" : prefix + ":";
-    
-    Element contentModelElement = getContentModelFromParent(complexTypeElement);
-
-    if (contentModelElement.getLocalName().equals(contentModel))
-    {
-      return; // it's already the content model 
-    }
-    Element newNode;
-    newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + contentModel);
-
-    if (contentModelElement.hasChildNodes())
-    {        
-      NodeList nodes = contentModelElement.getChildNodes();
-      // use clones so we don't have a refresh problem
-      for (int i = 0; i < nodes.getLength(); i++)
-      {
-        Node node = nodes.item(i);
-        if (node instanceof Element)
-        {
-          if (node.getLocalName().equals(XSDConstants.ANNOTATION_ELEMENT_TAG))
-          {
-            if (!(XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
-                XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
-                XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.ALL_ELEMENT_TAG, false)))
-            {
-              newNode.appendChild(node.cloneNode(true));
-            }
-          }
-          else if (node.getLocalName().equals(XSDConstants.RESTRICTION_ELEMENT_TAG) ||
-                    node.getLocalName().equals(XSDConstants.EXTENSION_ELEMENT_TAG))
-          {
-            newNode.appendChild(node.cloneNode(true));
-            if (sequenceChoiceOrAllElement != null)
-            {
-              node.appendChild(sequenceChoiceOrAllElement);
-            }
-          }
-          else
-          {
-            removeNodeAndWhitespace(node);
-          }
-        }
-        else
-        {
-          newNode.appendChild(node.cloneNode(true)); 
-        }
-      }
-    }
-    complexTypeElement.replaceChild(newNode, contentModelElement);
-  }
-
-  public Element cloneElement(Element parent, Element sourceNode)
-  {
-    Document doc = parent.getOwnerDocument();
-    String prefix = parent.getPrefix();
-    prefix = prefix == null ? "" : prefix + ":";
-    
-    Element newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + sourceNode.getLocalName());
-
-    if (sourceNode.hasChildNodes())
-    {        
-      NodeList nodes = sourceNode.getChildNodes();
-      // use clones so we don't have a refresh problem
-      for (int i = 0; i < nodes.getLength(); i++)
-      {
-        Node node = nodes.item(i);
-        newNode.appendChild(node.cloneNode(true));
-      }
-    }
-    return newNode;
-//    parent.replaceChild(newNode, sourceNode);
-  }
-
-  public boolean hasElementChildren(Element parentNode)
-  {
-    boolean hasChildrenElements = false;
-    if (parentNode != null && parentNode.hasChildNodes())
-    {
-      NodeList nodes = parentNode.getChildNodes();
-      for (int i = 0; i < nodes.getLength(); i++)
-      {
-        if (nodes.item(i) instanceof Element)
-        {
-          hasChildrenElements = true;
-          break;
-        }
-      }
-    }
-    return hasChildrenElements;
-  }
-
-  public void removeChild(Element node, String childName)
-  {
-    Node child = getChildNode(node,childName);
-    if (child != null)
-    {
-      node.removeChild(child);
-    }
-  }
-
-  public static boolean isFacet(Object obj)
-  {
-    if (XSDDOMHelper.inputEquals(obj, XSDConstants.LENGTH_ELEMENT_TAG, false) ||
-        XSDDOMHelper.inputEquals(obj, XSDConstants.MINLENGTH_ELEMENT_TAG, false) ||
-        XSDDOMHelper.inputEquals(obj, XSDConstants.MAXLENGTH_ELEMENT_TAG, false) ||
-        XSDDOMHelper.inputEquals(obj, XSDConstants.WHITESPACE_ELEMENT_TAG, false) ||
-        XSDDOMHelper.inputEquals(obj, XSDConstants.MAXINCLUSIVE_ELEMENT_TAG, false) ||
-        XSDDOMHelper.inputEquals(obj, XSDConstants.MAXEXCLUSIVE_ELEMENT_TAG, false) ||
-        XSDDOMHelper.inputEquals(obj, XSDConstants.MININCLUSIVE_ELEMENT_TAG, false) ||
-        XSDDOMHelper.inputEquals(obj, XSDConstants.MINEXCLUSIVE_ELEMENT_TAG, false) ||
-        XSDDOMHelper.inputEquals(obj, XSDConstants.TOTALDIGITS_ELEMENT_TAG, false) ||
-        XSDDOMHelper.inputEquals(obj, XSDConstants.FRACTIONDIGITS_ELEMENT_TAG, false))
-    {
-      return true;
-    }
-    return false;
-  }
-
-  public static void removeNodeAndWhitespace(Node node)
-  {
-    Node parentNode = node.getParentNode();
-    
-    Node nextElement = getNextElementNode(node);
-    Node previousElement = getPreviousElementNode(node);
-
-    Node nextSibling = node.getNextSibling();
-    if (nextSibling instanceof Text)
-    {
-      parentNode.removeChild(nextSibling);
-    }
-
-    if (parentNode != null)
-    {
-		  parentNode.removeChild(node);
-    }
-
-    if (nextElement != null)
-    {
-			formatChild(nextElement);
-    }
-
-		if (previousElement != null)
-		{
-			formatChild(previousElement);
-		}
-  }
-
-	public static void formatChild(Node child)
-	{
-    if (child instanceof IDOMNode)
-    {
-      IDOMModel model = ((IDOMNode)child).getModel();
-      try
-      {
-        // tell the model that we are about to make a big model change
-        model.aboutToChangeModel();
-        
-	      IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
-		    formatProcessor.formatNode(child);
-      }
-      finally
-      {
-        // tell the model that we are done with the big model change
-        model.changedModel(); 
-      }
-    }
-  }
-  
-  public static Node getLastElementNode(Node parent)
-  {
-    Node lastChild = parent.getLastChild();
-    
-    while (!(lastChild instanceof Element) && lastChild != null)
-    {
-      lastChild = lastChild.getPreviousSibling();
-    }
-    return lastChild;
-  }
-
-  public static Node getNextElementNode(Node node)
-  {
-    Node next = node.getNextSibling();
-    
-    while (!(next instanceof Element) && next != null)
-    {
-      next = next.getNextSibling();
-    }
-    if (next instanceof Text)
-    {
-    	return null;
-    }
-    return next;
-  }
-
-	public static Node getPreviousElementNode(Node node)
-	{
-		Node previous = node.getPreviousSibling();
-    
-		while (!(previous instanceof Element) && previous != null)
-		{
-			previous = previous.getPreviousSibling();
-		}
-    if (previous instanceof Text)
-    {
-      return null;
-    }
-    return previous;
-	}
-
-  public static void moveNode(Node referenceNode, Node nodeToMove, boolean isBefore)
-  {
-    // this assumes that the referenceNode and node to move have the same parent
-    Node parent = referenceNode.getParentNode();
-
-    // Get reference nodes next and previous text strings
-    String referenceNodeNextString = "";
-    String referenceNodePreviousString = "";
-    if (referenceNode != null)
-    {
-      Node referenceNodeNextSibling = referenceNode.getNextSibling();
-      Node referenceNodePreviousSibling = referenceNode.getPreviousSibling();
-      if (referenceNodeNextSibling instanceof Text)
-      {
-        referenceNodeNextString = ((Text)referenceNodeNextSibling).getData();
-      }
-      if (referenceNodePreviousSibling instanceof Text)
-      {
-        referenceNodePreviousString = ((Text)referenceNodePreviousSibling).getData();
-      }
-    }
-    // Get the dragged node's next and previous text strings
-    Node nodeToMoveNextSibling = nodeToMove.getNextSibling();
-    Node nodeToMovePreviousSibling = nodeToMove.getPreviousSibling();
-    Node nodeToMoveNextText = null;
-    String nodeToMoveNextString = "";
-    String nodeToMovePreviousString = "";
-    if (nodeToMoveNextSibling instanceof Text)
-    {
-      nodeToMoveNextText = (Text)nodeToMoveNextSibling;
-      nodeToMoveNextString = ((Text)nodeToMoveNextSibling).getData();
-    }
-    if (nodeToMovePreviousSibling instanceof Text)
-    {
-      nodeToMovePreviousString = ((Text)nodeToMovePreviousSibling).getData();
-    }
-
-    // Get the last element's next and previous text strings
-    Node lastElement = getLastElementNode(parent);
-    Node lastElementNextSibling = lastElement.getNextSibling();
-    Node lastElementPreviousSibling = lastElement.getPreviousSibling();
-    String lastElementNextString = "";
-    String lastElementPreviousString = "";		
-    if (lastElementNextSibling instanceof Text)
-    {
-      lastElementNextString = ((Text)lastElementNextSibling).getData();
-    }
-    if (lastElementPreviousSibling instanceof Text)
-    {
-      lastElementPreviousString = ((Text)lastElementPreviousSibling).getData();
-    }
-
-    boolean isLastElement = false; // whether the last element is dragged/moved
-    if (lastElement == nodeToMove)
-    {
-      isLastElement = true;
-    }
-		
-    // defect 221056 this test is required or else the node will
-    // be removed from the tree and the insert will fail
-    if (referenceNode != nodeToMove)
-    {
-      parent.removeChild(nodeToMove);
-      if (referenceNode != null)
-      {
-        if (!isBefore)
-        {
-          referenceNode = getNextElementNode(referenceNode);
-//        referenceNode = referenceNode.getNextSibling();
-        }
-      }
-
-      if (referenceNode != null)
-      {
-        insertBefore(nodeToMove, referenceNode);
-      }
-      else
-      {
-        parent.appendChild(nodeToMove);
-      }
-
-      Node newLastElement = getLastElementNode(parent);
-      if (referenceNode != null)
-      {
-        if (referenceNode != newLastElement) 
-        {
-          if (!isLastElement)
-          {
-            setTextData(referenceNode, nodeToMoveNextString, nodeToMovePreviousString);
-          }
-        }
-        setTextData(nodeToMove, referenceNodeNextString, referenceNodePreviousString);
-      }
-      // Remove the empty space left by the dragged node
-      if (nodeToMoveNextText != null)
-      {
-    	  parent.removeChild(nodeToMoveNextText);
-      }
-      // special case for the last element
-      if ((newLastElement == nodeToMove) || isLastElement)
-      {
-        setTextData(newLastElement, lastElementNextString, lastElementPreviousString);
-      }
-    }
-  }
-
-  public static void setTextData(Node target, String nextText, String previousText)
-  {
-    Node parent = target.getParentNode();
-    Node nextSibling = target.getNextSibling();
-    Node previousSibling = target.getPreviousSibling();
-    if (nextSibling instanceof Text)
-    {
-      ((Text)nextSibling).setData(nextText);	
-    }
-    if (nextSibling == null || nextSibling instanceof Element)
-    {
-      Text textNode = parent.getOwnerDocument().createTextNode("");
-      textNode.setData(nextText);
-      if (nextSibling != null)
-      {
-        parent.insertBefore(textNode, nextSibling);
-      }
-      else
-      {
-        parent.insertBefore(textNode, getNextElementNode(target));
-      }
-    }				
-
-    if (previousSibling instanceof Text)
-    {
-      ((Text)previousSibling).setData(previousText);
-    }
-    if (previousSibling == null || previousSibling instanceof Element)
-    {
-      Text textNode = parent.getOwnerDocument().createTextNode("");
-      textNode.setData(previousText);
-      parent.insertBefore(textNode, target);
-    }				
-  }
-
-  public static void insertBefore(Node nodeToInsert, Node referenceNode)
-  {
-    // this assumes that the referenceNode and node to move have the same parent
-    Node parent = referenceNode.getParentNode();
-    parent.insertBefore(nodeToInsert, referenceNode);
-  }
-
-  public static boolean inputEquals(Object input, String tagname, boolean isRef)
-  {
-    if (input instanceof Element)
-    {
-      Element element = (Element) input;
-      if (element.getLocalName().equals(tagname))
-      {
-        boolean refPresent = element.hasAttribute("ref");
-
-        return refPresent == isRef;
-      }
-    }
-    return false;
-  }
-
-  public static void updateElementToNotAnonymous(Element element)
-  {
-    if (element != null)
-    {
-      NodeList children = element.getChildNodes();
-      if (children != null)
-      {
-        for (int i = 0; i < children.getLength(); i++)
-        {
-          Node node = (Node)children.item(i);
-          if (node instanceof Element)
-          {
-            if (node.getLocalName().equals(XSDConstants.SIMPLETYPE_ELEMENT_TAG) ||
-                node.getLocalName().equals(XSDConstants.COMPLEXTYPE_ELEMENT_TAG))
-            {
-              XSDDOMHelper.removeNodeAndWhitespace(node);
-              i=0;
-            }
-          }
-        }
-      }
-    }
-  }
-  
-  public static boolean isAttributeRef(Element ct, String attrName, String ns)
-  {
-    NodeList list = ct.getChildNodes();
-    int length = list.getLength();
-    for (int i = 0; i < length; i++)
-    {
-      if (list.item(i) instanceof Element)
-      {
-        Element aChild = (Element)list.item(i);
-        if (aChild.getLocalName().equals(XSDConstants.ATTRIBUTE_ELEMENT_TAG))
-        {
-          if (aChild.hasAttribute(XSDConstants.REF_ATTRIBUTE))
-          {
-            String refValue = aChild.getAttribute(XSDConstants.REF_ATTRIBUTE);
-            if (refValue.equals(attrName))
-            {
-              return true;
-            }
-          }
-        }
-      }
-      
-    }
-    
-    return false;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaHelper.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaHelper.java
deleted file mode 100644
index a57e619..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaHelper.java
+++ /dev/null
@@ -1,72 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-// TODO: KC remove this
-
-public class XSDSchemaHelper
-{
-  /**
-   * Constructor for XSDSchemaHelper.
-   */
-  public XSDSchemaHelper()
-  {
-    super();
-  }
-  
-  public static void updateElement(XSDConcreteComponent concreteComp)
-  {
-    try
-    {
-      concreteComp.updateElement();
-    }
-    catch (Exception e)
-    {
-      for (Iterator containments = concreteComp.eClass().getEAllReferences().iterator(); containments.hasNext(); )
-      {
-        EReference eReference = (EReference)containments.next();
-        if (eReference.isContainment())
-        {
-          if (eReference.isMany())
-          {
-            for (Iterator objects = ((Collection)concreteComp.eGet(eReference)).iterator(); objects.hasNext(); )
-            {
-              XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)objects.next();
-              try
-              {
-                xsdConcreteComponent.updateElement();
-              }
-              catch (Exception ex) {}
-            }
-          }
-          else
-          {
-            XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)concreteComp.eGet(eReference);
-            if (xsdConcreteComponent != null)
-            {
-              try
-              {
-                xsdConcreteComponent.updateElement();
-              }
-              catch (Exception ex) {}
-            }
-          }
-        }
-      }
-    }
-  }    
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java
deleted file mode 100644
index 3c8ca3d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java
+++ /dev/null
@@ -1,31 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.xsd.util.XSDSchemaLocationResolver;
-
-public class XSDSchemaLocationResolverAdapterFactory extends AdapterFactoryImpl
-{
-    protected XSDSchemaLocationResolverImpl schemaLocator = new XSDSchemaLocationResolverImpl();
-
-    public boolean isFactoryForType(Object type)
-    {
-      return type == XSDSchemaLocationResolver.class;
-    }
-
-    public Adapter adaptNew(Notifier target, Object type)
-    {
-      return schemaLocator;
-    }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java
deleted file mode 100644
index 71e5f88..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java
+++ /dev/null
@@ -1,39 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.util;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDSchemaLocationResolver;
-import org.eclipse.xsd.util.XSDSchemaLocator;
-
-public class XSDSchemaLocationResolverImpl extends AdapterImpl implements XSDSchemaLocationResolver
-{
-    public String resolveSchemaLocation(XSDSchema xsdSchema, String namespaceURI, String schemaLocationURI)
-    {
-      String baseLocation = xsdSchema.getSchemaLocation();      
-      String result = URIResolverPlugin.createResolver().resolve(baseLocation, namespaceURI, schemaLocationURI);
-      if (result == null) {
-      	result = namespaceURI;
-      }
-      if (result == null) {
-      	result = "";
-      }
-
-      return result;
-    }
-
-    public boolean isAdatperForType(Object type)
-    {
-      return type == XSDSchemaLocator.class;
-    }  
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java
deleted file mode 100644
index 240b0bd..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java
+++ /dev/null
@@ -1,40 +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.xsd.ui.internal.validation;
-
-import org.eclipse.wst.validation.internal.provisional.ValidationFactory;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidator;
-
-/**
- * This performs the as-you-type validation
- * @author Mark Hutchinson
- *
- */
-public class DelegatingSourceValidatorForXSD extends DelegatingSourceValidator
-{                                                
-  final private static String VALIDATOR_CLASS = "org.eclipse.wst.xsd.ui.internal.validation.Validator"; 
-
-  public DelegatingSourceValidatorForXSD()
-  { super();
-  }
-  
-  protected IValidator getDelegateValidator()
-  {
-    try
-    { return ValidationFactory.instance.getValidator(VALIDATOR_CLASS);
-    }
-    catch (Exception e)
-    { //
-    }
-    return null;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java
deleted file mode 100644
index eba2c64..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java
+++ /dev/null
@@ -1,106 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.widgets;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-
-/**
- * Dialog to help define a list of enumerations
- * for a join. This might be replaced once we know how to
- * initiate a drag tracker
- */
-
-public class EnumerationsDialog extends org.eclipse.jface.dialogs.Dialog
-{
-  public EnumerationsDialog(Shell shell)
-  {
-    super(shell);
-  }
-
-  protected void configureShell(Shell shell)
-  {
-    super.configureShell(shell);
-    shell.setText(XSDEditorPlugin.getXSDString("_UI_ENUMERATIONS_DIALOG_TITLE"));
-  }
-
-  protected void buttonPressed(int buttonId)
-  {
-    if (buttonId == Dialog.OK)
-    {
-      text = textField.getText();
-      delimiter = delimiterField.getText();
-      isPreserve = preserveWhitespace.getSelection();
-    }
-    super.buttonPressed(buttonId);
-  }
-
-  private String text, delimiter;
-  private boolean isPreserve;
-  public String getText() { return text; }
-  public String getDelimiter() { return delimiter; }
-  public boolean isPreserveWhitespace() { return isPreserve; }
-
-  private Text textField;
-  private Button preserveWhitespace;
-  private Combo delimiterField;
-  //
-  // Create the controls
-  //
-  public Control createDialogArea(Composite parent)
-  {
-    Control[] tabOrder = new Control[3];
-  	int tabIndex = 0;
-    Composite client = (Composite)super.createDialogArea(parent);
-    GridLayout layout = (GridLayout)client.getLayout();
-    layout.numColumns = 2;
-    client.setLayout(layout); 
-
-    textField = ViewUtility.createWrappedMultiTextField(client, 400, 20, true);
-    GridData gd = (GridData) textField.getLayoutData();
-    gd.horizontalSpan = 2;
-    tabOrder[tabIndex++] = textField;
-
-    ViewUtility.createLabel(client, XSDEditorPlugin.getXSDString("_UI_LABEL_DELIMITER_CHAR"));
-    delimiterField = ViewUtility.createComboBox(client, false);
-    gd = (GridData) delimiterField.getLayoutData();
-    gd.grabExcessHorizontalSpace = false;
-    gd.horizontalAlignment = GridData.BEGINNING;
-    gd.widthHint = 30;
-    tabOrder[tabIndex++] = delimiterField;
-
-    // add default delimiters
-    delimiterField.add(":");
-    delimiterField.add(",");
-    delimiterField.add(" ");
-    // set the current one to be ','
-    delimiterField.setText(",");
-
-    preserveWhitespace = ViewUtility.createCheckBox(client, XSDEditorPlugin.getXSDString("_UI_LABEL_PRESERVE_WHITESPACE"));
-    gd = (GridData) preserveWhitespace.getLayoutData();
-    gd.horizontalSpan = 2;
-    tabOrder[tabIndex++] = preserveWhitespace;
-    
-    client.setTabList(tabOrder);
-
-    return client;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/SetBaseTypeDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/SetBaseTypeDialog.java
deleted file mode 100644
index 21c32ab..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/SetBaseTypeDialog.java
+++ /dev/null
@@ -1,178 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.widgets;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-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.Shell;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-
-public class SetBaseTypeDialog extends Dialog implements SelectionListener
-{
-  protected Combo baseTypeCombo;
-  protected Combo derivedByCombo;
-  protected XSDSchema xsdSchema;
-  protected Element element;  // the complex type element
-  private String type = "";
-  private String derivedByString = "";
-  
-  /**
-   * Constructor for SetBaseTypeDialog.
-   * @param arg0
-   */
-  public SetBaseTypeDialog(Shell arg0, XSDSchema xsdSchema, Element element)
-  {
-    super(arg0);
-    this.xsdSchema = xsdSchema;
-    this.element = element;
-  }
-
-  protected void configureShell(Shell shell)
-  {
-    super.configureShell(shell);
-    shell.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_SET_BASE_TYPE"));
-  }
-
-
-  protected void buttonPressed(int buttonId)
-  {
-    if (buttonId == Dialog.OK)
-    {
-      type = baseTypeCombo.getText();
-      derivedByString = derivedByCombo.getText();
-    }
-    super.buttonPressed(buttonId);
-  }
-  
-  public String getBaseType()
-  {
-    return type;
-  }
-
-  public String getDerivedBy()
-  {
-    return derivedByString;
-  }
-  
-  public void setCurrentBaseType(String type)
-  {
-    this.type = type;
-  }
-  
-  public void setCurrentDerivedBy(String derivedByString)
-  {
-    this.derivedByString = derivedByString;
-  }
-
-  //
-  // Create the controls
-  //
-  public Control createDialogArea(Composite parent)
-  {
-    Composite nameComposite = (Composite)super.createDialogArea(parent);
-    GridLayout layout = (GridLayout)nameComposite.getLayout();
-    layout.numColumns = 2;
-    nameComposite.setLayout(layout); 
-
-    ViewUtility.createLabel(nameComposite, XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON"));
-    baseTypeCombo = ViewUtility.createComboBox(nameComposite, true); // readonly
-    baseTypeCombo.addSelectionListener(this);
-    
-    ViewUtility.createLabel(nameComposite, XSDEditorPlugin.getXSDString("_UI_LABEL_DERIVED_BY")); 
-    derivedByCombo = ViewUtility.createComboBox(nameComposite, true); // readonly
-
-    derivedByCombo.add(XSDConstants.EXTENSION_ELEMENT_TAG);
-    derivedByCombo.add(XSDConstants.RESTRICTION_ELEMENT_TAG);
-    derivedByCombo.setText(derivedByString);
-    initializeBaseTypeCombo();
-
-    if (type.equals(""))
-    {
-      derivedByCombo.setText("");
-      derivedByCombo.setEnabled(false);
-    }
-        
-    return nameComposite;
-  }
-
-  private void initializeBaseTypeCombo()
-  {
-    ArrayList list = new ArrayList();
-    TypesHelper helper = new TypesHelper(xsdSchema);
-
-    String prefix = helper.getPrefix(xsdSchema.getTargetNamespace(), true);
-
-    list.add("");
-    list.addAll(helper.getBuiltInTypeNamesList());
-    list.addAll(helper.getUserSimpleTypeNamesList());
-    list.addAll(helper.getUserComplexTypeNamesList());
-
-    // remove the current CT from the list
-    list.remove(prefix + element.getAttribute("name"));
-
-    baseTypeCombo.removeAll();
-    for (int i = 0; i < list.size(); i++)
-    {
-      baseTypeCombo.add(list.get(i).toString());
-    }
-    baseTypeCombo.setText(type);
-    handleBaseTypeComboChange();
-  }
-  
-  private void handleBaseTypeComboChange()
-  {
-    String tempChoice = baseTypeCombo.getText();
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    if (helper.getBuiltInTypeNamesList().contains(tempChoice) ||
-        helper.getUserSimpleTypeNamesList().contains(tempChoice))
-    {
-      derivedByCombo.setText(XSDConstants.EXTENSION_ELEMENT_TAG);
-      derivedByCombo.setEnabled(false);
-    }
-    else if (helper.getUserComplexTypeNamesList().contains(tempChoice))
-    {
-      derivedByCombo.setEnabled(true); 
-    }
-    else
-    {
-      derivedByCombo.setText("");
-      derivedByCombo.setEnabled(false); 
-    }
-  }
-
-  public void widgetSelected(SelectionEvent e)
-  {
-    if (e.widget == baseTypeCombo)
-    {
-      handleBaseTypeComboChange();
-    }
-    
-  }
-
-  public void widgetDefaultSelected(SelectionEvent e)
-  {
-    
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java
deleted file mode 100644
index e5b6bdc..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java
+++ /dev/null
@@ -1,335 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.widgets;
-
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDSchema;
-
-public class TypeSection
-{
-  /**
-   * Constructor for TypeSection.
-   * @param parent
-   */
-  public TypeSection(Composite parent)
-  {
-  }
-
-  protected Button  simpleType;
-  protected Button  userSimpleType;
-  protected Button  userComplexType;
-  protected Button  noneRadio;
-  protected Combo   typeList;
-  protected Combo   derivedByCombo;
-  protected boolean showUserComplexType = true;
-  protected boolean showUserSimpleType  = true;
-  protected boolean showNone            = false;
-  protected boolean showDerivedBy       = false;
-  protected String  derivedByChoices[]  = { "restriction", "extension" };
-  public final int  NONE                = 1;
-  public final int  BUILT_IN            = 2;
-  public final int  SIMPLE              = 3;
-  public final int  COMPLEX             = 4;
-
-  String            sectionTitle        = XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE_INFORMATION");
-  String            currentObjectUuid   = "";
-
-  /*
-   * @see FlatPageSection#createClient(Composite, WidgetFactory)
-   */
-  public Composite createClient(Composite parent)
-  {
-    Composite client = new Composite(parent, SWT.NONE);
-    GridLayout gl = new GridLayout(1, true);
-    gl.verticalSpacing = 0;
-    client.setLayout(gl);
-
-    if (showNone)
-    {
-      noneRadio = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_NONE"));
-      WorkbenchHelp.setHelp(noneRadio, XSDEditorContextIds.XSDE_TYPE_HELPER_NONE);
-    }
-
-    simpleType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_BUILT_IN_SIMPLE_TYPE"));
-    WorkbenchHelp.setHelp(simpleType, XSDEditorContextIds.XSDE_TYPE_HELPER_BUILT_IN);
-
-    if (showUserSimpleType)
-    {
-      userSimpleType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_USER_DEFINED_SIMPLE_TYPE"));
-      WorkbenchHelp.setHelp(userSimpleType, XSDEditorContextIds.XSDE_TYPE_HELPER_USER_DEFINED_SIMPLE);
-    }
-
-    if (showUserComplexType)
-    {
-      userComplexType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_USER_DEFINED_COMPLEX_TYPE"));
-      WorkbenchHelp.setHelp(userComplexType, XSDEditorContextIds.XSDE_TYPE_HELPER_USER_DEFINED_COMPLEX);
-    }
-
-    //	  typeList = utility.createComboBox(client);
-    //	  WorkbenchHelp.setHelp(typeList, XSDEditorContextIds.XSDE_TYPE_HELPER_TYPE);
-    //    utility.createHeadingLabel(client, "Type",null);
-
-    if (showDerivedBy)
-    {
-      Composite derivedByComposite = ViewUtility.createComposite(client, 2);
-      ViewUtility.createLabel(derivedByComposite, XSDEditorPlugin.getXSDString("_UI_LABEL_DERIVED_BY"));
-      derivedByCombo = ViewUtility.createComboBox(derivedByComposite);
-      populateDerivedByCombo();
-      WorkbenchHelp.setHelp(derivedByCombo, XSDEditorContextIds.XSDE_SIMPLE_CONTENT_DERIVED);
-      derivedByCombo.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_DERIVED_BY"));
-    }
-    // Set the default selection
-    if (showNone)
-    {
-      //		noneRadio.setSelection(true);
-      //		typeList.setEnabled(false);
-    }
-    else
-    {
-      simpleType.setSelection(true);
-    }
-    return client;
-  }
-
-  public void setIsDerivedBy(boolean derive)
-  {
-    if (derive)
-    {
-      sectionTitle = XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE");
-    }
-    else
-    {
-      sectionTitle = XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE_INFORMATION");
-    }
-    //	setHeaderText(sectionTitle);
-  }
-
-  /**
-   * Set to true if called by Complex Type & Simple Type
-   */
-  public void setShowDerivedBy(boolean derive)
-  {
-    showDerivedBy = derive;
-  }
-
-  /**
-   * Gets the derivedByField
-   * @return Returns a Button
-   */
-  public Combo getDerivedByCombo()
-  {
-    return derivedByCombo;
-  }
-
-  /**
-   * Gets the noneRadio.
-   * @return Returns a Button
-   */
-  public Button getNoneRadio()
-  {
-    return noneRadio;
-  }
-
-  /**
-   * Gets the simpleType.
-   * @return Returns a Button
-   */
-  public Button getSimpleType()
-  {
-    return simpleType;
-  }
-
-  /**
-   * Gets the userComplexType.
-   * @return Returns a Button
-   */
-  public Button getUserComplexType()
-  {
-    return userComplexType;
-  }
-
-  /**
-   * Gets the userSimpleType.
-   * @return Returns a Button
-   */
-  public Button getUserSimpleType()
-  {
-    return userSimpleType;
-  }
-
-  /**
-   * Gets the typeList.
-   * @return Returns a CCombo
-   */
-  public Combo getTypeList()
-  {
-    return typeList;
-  }
-
-  /**
-   * Populate combo box with built-in simple types
-   */
-  public void populateBuiltInType(XSDSchema xsdSchema)
-  {
-    getTypeList().removeAll();
-    List items = getBuiltInTypeNamesList(xsdSchema);
-    for (int i = 0; i < items.size(); i++)
-    {
-      getTypeList().add(items.get(i).toString());
-    }
-  }
-
-  public java.util.List getBuiltInTypeNamesList(XSDSchema xsdSchema)
-  {
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    return helper.getBuiltInTypeNamesList();
-  }
-
-  /**
-   * Populate combo box with user defined complex types
-   */
-  public void populateUserComplexType(XSDSchema xsdSchema, boolean showAnonymous)
-  {
-    getTypeList().removeAll();
-    if (showAnonymous)
-    {
-      getTypeList().add(XSDEditorPlugin.getXSDString("_UI_ANONYMOUS"));
-    }
-
-    List items = getUserComplexTypeNamesList(xsdSchema);
-    for (int i = 0; i < items.size(); i++)
-    {
-      getTypeList().add(items.get(i).toString());
-    }
-  }
-
-  public java.util.List getUserComplexTypeNamesList(XSDSchema xsdSchema)
-  {
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    return helper.getUserComplexTypeNamesList();
-  }
-
-  public void populateUserSimpleType(XSDSchema xsdSchema, boolean showAnonymous)
-  {
-    getTypeList().removeAll();
-    if (showAnonymous)
-    {
-      getTypeList().add(XSDEditorPlugin.getXSDString("_UI_ANONYMOUS"));
-    }
-    List items = getUserSimpleTypeNamesList(xsdSchema);
-    for (int i = 0; i < items.size(); i++)
-    {
-      getTypeList().add(items.get(i).toString());
-    }
-  }
-
-  /**
-   * Populate combo box with user defined simple types
-   */
-  public void populateUserSimpleType(XSDSchema xsdSchema)
-  {
-    getTypeList().removeAll();
-    List items = getUserSimpleTypeNamesList(xsdSchema);
-    for (int i = 0; i < items.size(); i++)
-    {
-      getTypeList().add(items.get(i).toString());
-    }
-  }
-
-  public java.util.List getUserSimpleTypeNamesList(XSDSchema xsdSchema)
-  {
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    return helper.getUserSimpleTypeNamesList();
-  }
-
-  public String getPrefix(String ns, XSDSchema xsdSchema)
-  {
-    TypesHelper helper = new TypesHelper(xsdSchema);
-    String key = helper.getPrefix(ns, true);
-    return key;
-  }
-
-  /**
-   * Populate combo box with derived by choices
-   */
-  protected void populateDerivedByCombo()
-  {
-    for (int i = 0; i < derivedByChoices.length; i++)
-    {
-      getDerivedByCombo().add(derivedByChoices[i]);
-    }
-  }
-
-  /**
-   * Gets the showUserComplexType.
-   * @return Returns a boolean
-   */
-  public boolean getShowUserComplexType()
-  {
-    return showUserComplexType;
-  }
-
-  /**
-   * Gets the showUserSimpleType.
-   * @return Returns a boolean
-   */
-  public boolean getShowUserSimpleType()
-  {
-    return showUserSimpleType;
-  }
-
-  /**
-   * Gets the showNone.
-   * @return Returns a boolean
-   */
-  public boolean getShowNone()
-  {
-    return showNone;
-  }
-
-  /**
-   * Sets the showUserComplexType.
-   * @param showUserComplexType The showUserComplexType to set
-   */
-  public void setShowUserComplexType(boolean showUserComplexType)
-  {
-    this.showUserComplexType = showUserComplexType;
-  }
-
-  /**
-   * Sets the showUserSimpleType.
-   * @param showUserSimpleType The showUserSimpleType to set
-   */
-  public void setShowUserSimpleType(boolean showUserSimpleType)
-  {
-    this.showUserSimpleType = showUserSimpleType;
-  }
-
-  /**
-   * Sets the showNone
-   * @param showUserSimpleType The showNone to set
-   */
-  public void setShowNone(boolean showNone)
-  {
-    this.showNone = showNone;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java
deleted file mode 100644
index cf4d9df..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java
+++ /dev/null
@@ -1,84 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.widgets;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.IDialogConstants;
-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.Shell;
-import org.eclipse.wst.xml.ui.internal.dialogs.EditSchemaInfoDialog;
-import org.eclipse.wst.xml.ui.internal.nsedit.CommonEditNamespacesTargetFieldDialog;
-
-public class XSDEditSchemaInfoDialog extends EditSchemaInfoDialog {
-	String targetNamespace;
-	CommonEditNamespacesTargetFieldDialog editNamespacesControl;
-	
-	public XSDEditSchemaInfoDialog(Shell parentShell, IPath resourceLocation, String targetNamespace) {
-		super(parentShell, resourceLocation);
-		this.targetNamespace = targetNamespace;
-	}
-/*
-	// in super
-	protected CommonEditNamespacesDialog createCommonEditNamespacesDialog(Composite dialogArea)
-	{
-	  return new CommonEditNamespacesDialog(dialogArea, resourceLocation, XMLUIPlugin.getResourceString("%_UI_NAMESPACE_DECLARATIONS"), false, true); //$NON-NLS-1$				
-	}
-	
-	// in super
-	protected Control createDialogArea(Composite parent) {
-		Composite dialogArea = (Composite) super.createDialogArea(parent);
-		CommonEditNamespacesDialog editNamespacesControl = createCommonEditNamespacesDialog(dialogArea); 
-		editNamespacesControl.setNamespaceInfoList(namespaceInfoList);
-		editNamespacesControl.updateErrorMessage(namespaceInfoList);
-		return dialogArea;
-	}
-	
-	// in this
-	protected CommonEditNamespacesDialog createCommonEditNamespacesDialog(Composite dialogArea)
-	{
-	  return new CommonEditNamespacesTargetFieldDialog(dialogArea, resourceLocation); //$NON-NLS-1$				
-	}	*/
-	
-	// this is copy of ....
-    protected Control __internalCreateDialogArea(Composite parent) {
-        // create a composite with standard margins and spacing
-        Composite composite = new Composite(parent, SWT.NONE);
-        GridLayout layout = new GridLayout();
-        layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
-        layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
-        layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
-        layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
-        composite.setLayout(layout);
-        composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-        applyDialogFont(composite);
-        return composite;
-    }	
-	
-	protected Control createDialogArea(Composite parent) {
-		Composite dialogArea = (Composite) __internalCreateDialogArea(parent);
-		editNamespacesControl = new CommonEditNamespacesTargetFieldDialog(dialogArea, resourceLocation); //$NON-NLS-1$
-		if (targetNamespace != null)
-		{	
-			editNamespacesControl.setTargetNamespace(targetNamespace);
-		}
-		editNamespacesControl.setNamespaceInfoList(namespaceInfoList);
-		editNamespacesControl.updateErrorMessage(namespaceInfoList);
-		return dialogArea;
-	}	
-	
-	public String getTargetNamespace() {
-		return editNamespacesControl.getTargetNamespace();
-	}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java
deleted file mode 100644
index cdb003a..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java
+++ /dev/null
@@ -1,161 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import java.io.ByteArrayInputStream;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-
-
-public class NewXSDWizard extends Wizard implements INewWizard {
-	private XSDNewFilePage newFilePage;
-	private IStructuredSelection selection;
-	private IWorkbench workbench;
-
-	public NewXSDWizard() {
-	}
-
-	public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
-		this.selection = aSelection;
-		this.workbench = aWorkbench;
-
-		this.setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/NewXSD.gif"));
-		this.setWindowTitle(XSDEditorPlugin.getXSDString("_UI_WIZARD_CREATE_XSD_MODEL_TITLE"));
-	}
-
-	public void addPages() {
-		newFilePage = new XSDNewFilePage(selection);
-		addPage(newFilePage);
-	}
-
-	public boolean performFinish() {
-		IFile file = newFilePage.createNewFile();
-
-		//
-		// Get the xsd schema name from the full path name
-		// e.g. f:/b2b/po.xsd => schema name = po
-		//
-		IPath iPath = file.getFullPath().removeFileExtension();
-		// String schemaName = iPath.lastSegment();
-		String schemaName = iPath.lastSegment();
-		String schemaPrefix = "tns";
-		String prefixForSchemaNamespace = "";
-		String schemaNamespaceAttribute = "xmlns";
-		if (XSDEditorPlugin.getPlugin().isQualifyXMLSchemaLanguage()) {
-			// Added this if check before disallowing blank prefixes in the
-			// preferences...
-			// Can take this out. See also XSDEditor
-			if (XSDEditorPlugin.getPlugin().getXMLSchemaPrefix().trim().length() > 0) {
-				prefixForSchemaNamespace = XSDEditorPlugin.getPlugin().getXMLSchemaPrefix() + ":";
-				schemaNamespaceAttribute += ":" + XSDEditorPlugin.getPlugin().getXMLSchemaPrefix();
-			}
-		}
-
-		Preferences preference = XMLCorePlugin.getDefault().getPluginPreferences();
-		String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-		if (charSet == null || charSet.trim().equals("")) {
-			charSet = "UTF-8";
-		}
-
-		String newContents = "<?xml version=\"1.0\" encoding=\"" + charSet + "\"?>\n";
-
-		String defaultTargetURI = XSDEditorPlugin.getPlugin().getXMLSchemaTargetNamespace();
-		newContents += "<" + prefixForSchemaNamespace + "schema " + schemaNamespaceAttribute + "=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"" + defaultTargetURI + schemaName + "\" xmlns:" + schemaPrefix + "=\"" + defaultTargetURI + schemaName + "\">\n</" + prefixForSchemaNamespace + "schema>";
-
-		try {
-			byte[] bytes = newContents.getBytes(charSet);
-			ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
-
-			file.setContents(inputStream, true, false, null);
-			inputStream.close();
-		}
-		catch (Exception e) {
-			// XSDEditorPlugin.getPlugin().getMsgLogger().write("Error writing
-			// default content:\n" + newContents);
-			// XSDEditorPlugin.getPlugin().getMsgLogger().write(e);
-		}
-
-		if (file != null) {
-			revealSelection(new StructuredSelection(file));
-		}
-
-		openEditor(file);
-
-		return true;
-	}
-
-	private void revealSelection(final ISelection selection) {
-		if (selection != null) {
-			IWorkbench workbench2;
-			if (workbench == null)
-			{
-			  workbench2 = XSDEditorPlugin.getPlugin().getWorkbench();
-			}
-			else
-			{
-			  workbench2 = workbench;
-			}
-			final IWorkbenchWindow workbenchWindow = workbench2.getActiveWorkbenchWindow();
-			final IWorkbenchPart focusPart = workbenchWindow.getActivePage().getActivePart();
-			if (focusPart instanceof ISetSelectionTarget) {
-				Display.getCurrent().asyncExec(new Runnable() {
-					public void run() {
-						((ISetSelectionTarget) focusPart).selectReveal(selection);
-					}
-				});
-			}
-		}
-	}
-
-	public void openEditor(final IFile iFile) {
-		if (iFile != null) {
-			IWorkbench workbench2;
-			if (workbench == null)
-			{
-			  workbench2 = XSDEditorPlugin.getPlugin().getWorkbench();
-			}
-			else
-			{
-			  workbench2 = workbench;
-			}
-			final IWorkbenchWindow workbenchWindow = workbench2.getActiveWorkbenchWindow();
-
-			Display.getDefault().asyncExec(new Runnable() {
-				public void run() {
-					try {
-						workbenchWindow.getActivePage().openEditor(new FileEditorInput(iFile), XSDEditorPlugin.XSD_EDITOR_ID);
-					}
-					catch (PartInitException ex) {
-					}
-				}
-			});
-		}
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java
deleted file mode 100644
index e7923d6..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java
+++ /dev/null
@@ -1,958 +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
- *******************************************************************************/
-// Based on version 1.12 of original xsdeditor
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDPatternFacet;
-
-
-
-/*
--other regex features (eg case sensitivity, ^ or $, |, etc etc)
--smarter model
--better keyboard navigation
--update list of tokens 
-*/
-
-public class RegexCompositionPage extends WizardPage
-{
-  private static final boolean debug = false;
-
-  /* The text representation of our pattern. */
-  private StyledText value; 
-
-  /* The StyleRange used to color code the current parse error. */
-  private StyleRange currentError;
-
-  /* The regex terms we can form tokens from. */
-  private Combo terms;
-
-  /* The checkbox for activating auto-escape mode. */  
-  private Button escapeCheckbox;
-  
-  /* On/off status of auto-escape mode. */ 
-  private boolean autoEscapeStatus;
-
-  /* The Add Token button. */
-  private Button add;
-
-
-  // The following controls are used in the occurrence selection group
-
-  private Text repeatValue;
-
-  private Text rangeMinValue;
-  private Text rangeMaxValue;
-  private Label rangeToLabel;  
-
-  private Button singleRadio;
-  private Button starRadio;
-  private Button plusRadio;
-  private Button optionalRadio; 
-  private Button repeatRadio;
-  private Button rangeRadio;
-
-  
-  // The following variables used as part of the model. 
-
-  /* Our pattern. */
-  private XSDPatternFacet pattern;
-
-  /* Model used to store the current token. */
-  private RegexNode node;    
-
-  /* The flags passed to the new RegularExpression object.  Default value includes:
-      X = XMLSchema mode    */
-  private String regexFlags = "X";
-      
-
-  /* Is the current regex token valid? */
-  private boolean isValidToken;
-
-  /* The label used to indicate the value's caret position when it looses focus. */
-  private Label caretLabel;
-
-  /* The pixel offsets needed to align the label icon with the caret location.
-     These are dependent on the icon used. */
-  private static final int CARET_LABEL_X_OFFSET = -3;
-  private static final int CARET_LABEL_Y_OFFSET = 19;
-
-  
-  /* Enumerated constants for specifying the type of an error message. */
-  private static final int TOKEN = 0;
-  private static final int SELECTION = 1;
-  private static final int PARSE = 2;
-  
-  private static final int NUM_ERROR_MESSAGE_TYPES = 3;
-  
-  /* The current error message for each type of error.  A value of null indicates no message. 
-     The array is indexed according to the above constants.
-  */
-  private String[] currentErrorMessages;
-
-
-  public RegexCompositionPage(XSDPatternFacet pattern)
-  {
-    super(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_COMPOSITION_PAGE_TITLE"));
-    this.pattern = pattern;
-
-    setTitle(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_COMPOSITION_PAGE_TITLE"));
-    setDescription(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_COMPOSITION_PAGE_DESCRIPTION"));
-  }
-
-  public void createControl(Composite parent)
-  {
-    // Set up our model and validator
-    node = new RegexNode();
-        
-    isValidToken = true;
-
-    currentErrorMessages = new String[NUM_ERROR_MESSAGE_TYPES];
-
-    // The main composite
-    Composite composite= new Composite(parent, SWT.NONE);
-    WorkbenchHelp.setHelp(composite, XSDEditorContextIds.XSDR_COMPOSITION_PAGE);
-    composite.setLayout(new GridLayout());
-
-
-    // The composite for the token combo box, label, and auto-escape checkbox
-    Composite tokenComposite = new Composite (composite, SWT.NONE);
-    GridLayout tokenCompositeLayout = new GridLayout();
-    tokenCompositeLayout.numColumns = 3;
-    tokenCompositeLayout.marginWidth = 0;
-    tokenComposite.setLayout(tokenCompositeLayout);
-
-
-    new Label(tokenComposite, SWT.LEFT).setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TOKEN_LABEL"));
-    
-    terms = new Combo(tokenComposite, SWT.DROP_DOWN);
-    WorkbenchHelp.setHelp(terms, XSDEditorContextIds.XSDR_COMPOSITION_TOKEN);
-    for (int i = 0; i < RegexNode.getNumRegexTerms(); i++)
-    {
-      terms.add(RegexNode.getRegexTermText(i));
-    }
-    terms.addListener(SWT.Modify, new ComboListener());
-    terms.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_TERMS"));
-
-    escapeCheckbox = new Button(tokenComposite, SWT.CHECK);
-    escapeCheckbox.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX_LABEL"));
-    escapeCheckbox.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX")); 
-    escapeCheckbox.addSelectionListener(new CheckboxListener());
-    autoEscapeStatus = false;
-    
-    tokenComposite.pack();
-
-
-    // Set up the composites pertaining to the selection of occurrence quantifiers
-
-    Group occurrenceSelectionArea = new Group(composite, SWT.NONE);
-    occurrenceSelectionArea.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_OCCURENCE_LABEL"));
-    WorkbenchHelp.setHelp(occurrenceSelectionArea, XSDEditorContextIds.XSDR_COMPOSITION_OCCURRENCE_GROUP);
-    GridLayout selectionAreaLayout = new GridLayout();
-    selectionAreaLayout.numColumns = 2;
-    occurrenceSelectionArea.setLayout(selectionAreaLayout);
-
-    // Listener used for all of the text fields
-    TextListener textListener = new TextListener();
-    
-
-    // Add the radio buttons
-    RadioSelectListener radioSelectListener = new RadioSelectListener();
-
-    singleRadio = addOccurenceRadioButton(RegexNode.SINGLE, occurrenceSelectionArea, radioSelectListener);
-    WorkbenchHelp.setHelp(singleRadio, XSDEditorContextIds.XSDR_COMPOSITION_JUST_ONCE);
-    ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
-
-    starRadio = addOccurenceRadioButton(RegexNode.STAR, occurrenceSelectionArea, radioSelectListener);
-    WorkbenchHelp.setHelp(starRadio, XSDEditorContextIds.XSDR_COMPOSITION_ZERO_OR_MORE);
-    ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
-
-    plusRadio = addOccurenceRadioButton(RegexNode.PLUS, occurrenceSelectionArea, radioSelectListener);
-    WorkbenchHelp.setHelp(plusRadio, XSDEditorContextIds.XSDR_COMPOSITION_ONE_OR_MORE);
-    ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
-
-    optionalRadio = addOccurenceRadioButton(RegexNode.OPTIONAL, occurrenceSelectionArea, radioSelectListener);
-    WorkbenchHelp.setHelp(optionalRadio, XSDEditorContextIds.XSDR_COMPOSITION_OPTIONAL);
-    ViewUtility.createHorizontalFiller(occurrenceSelectionArea, 1);
-
-    repeatRadio = addOccurenceRadioButton(RegexNode.REPEAT, occurrenceSelectionArea, radioSelectListener);
-    WorkbenchHelp.setHelp(repeatRadio, XSDEditorContextIds.XSDR_COMPOSITION_REPEAT);
-
-    // Add text field for specifying number of repeats
-    Composite repeatWidgets = new Composite(occurrenceSelectionArea, SWT.NONE);
-    RowLayout repeatWidgetsLayout = new RowLayout();
-    repeatWidgetsLayout.marginTop = 0;
-    repeatWidgetsLayout.marginBottom = 0;
-    repeatWidgetsLayout.marginLeft = 0;
-    repeatWidgetsLayout.marginRight = 0;
-    repeatWidgets.setLayout(repeatWidgetsLayout);        
-    
-    repeatValue = new Text(repeatWidgets, SWT.SINGLE | SWT.BORDER);
-    repeatValue.addListener(SWT.Modify, textListener);
-    WorkbenchHelp.setHelp(repeatValue, XSDEditorContextIds.XSDR_COMPOSITION_REPEAT_TEXT);
-    repeatValue.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_REPEAT"));
-    setEnabledStatus(RegexNode.REPEAT, false);
-    
-    repeatWidgets.pack();
-    
-    rangeRadio = addOccurenceRadioButton(RegexNode.RANGE, occurrenceSelectionArea, radioSelectListener);
-    WorkbenchHelp.setHelp(rangeRadio, XSDEditorContextIds.XSDR_COMPOSITION_RANGE);
-
-    // Add text fields and labels for specifying the range    
-    Composite rangeWidgets = new Composite(occurrenceSelectionArea, SWT.NONE);
-    RowLayout rangeWidgetsLayout = new RowLayout();
-    rangeWidgetsLayout.marginTop = 0;
-    rangeWidgetsLayout.marginBottom = 0;
-    rangeWidgetsLayout.marginLeft = 0;
-    rangeWidgetsLayout.marginRight = 0;
-    rangeWidgets.setLayout(rangeWidgetsLayout);
-    
-    rangeMinValue = new Text(rangeWidgets, SWT.SINGLE | SWT.BORDER);
-    rangeMinValue.addListener(SWT.Modify, textListener);
-    WorkbenchHelp.setHelp(rangeMinValue, XSDEditorContextIds.XSDR_COMPOSITION_RANGE_MIN);
-    rangeMinValue.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_MIN"));
-    
-    rangeToLabel = new Label(rangeWidgets, SWT.NONE);
-    rangeToLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TO_LABEL"));
-    
-    rangeMaxValue = new Text(rangeWidgets, SWT.SINGLE | SWT.BORDER);
-    rangeMaxValue.addListener(SWT.Modify, textListener);
-    rangeMaxValue.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_MAX"));
-    WorkbenchHelp.setHelp(rangeMaxValue, XSDEditorContextIds.XSDR_COMPOSITION_RANGE_MAX);
-
-    setEnabledStatus(RegexNode.RANGE, false);
-    rangeWidgets.pack();
-    
-    singleRadio.setSelection(true);
-    
-    occurrenceSelectionArea.pack();
-
-    // The add button
-    add = new Button(composite, SWT.PUSH);
-    add.addSelectionListener(new ButtonSelectListener());
-    add.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL"));
-    WorkbenchHelp.setHelp(add, XSDEditorContextIds.XSDR_COMPOSITION_ADD);
-    add.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_ADD_BUTTON"));
-
-    
-    Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
-    separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-    
-    // Our main text box
-
-    Label valueLabel= new Label(composite, SWT.LEFT);
-    valueLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_CURRENT_REGEX_LABEL"));
-    
-    value = new StyledText(composite, SWT.SINGLE | SWT.BORDER);
-    value.addListener(SWT.Modify, textListener);
-    value.addListener(SWT.Selection, textListener);
-    WorkbenchHelp.setHelp(value, XSDEditorContextIds.XSDR_COMPOSITION_CURRENT);
-    value.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_CURRENT_REGEX"));
-    value.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-    value.setFocus();
-
-    // StyleRange used for highlighting parse errors
-    currentError = new StyleRange();
-    currentError.length = 1;
-    currentError.foreground = parent.getDisplay().getSystemColor(SWT.COLOR_RED);
-
-    // The caret label
-    caretLabel = new Label(composite, SWT.LEFT);
-    caretLabel.setImage(XSDEditorPlugin.getXSDImage("icons/RegexWizardArrow.gif"));
-    caretLabel.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_REGEX_WIZARD_CARET_LABEL"));
-    setShowCaretLabel(true);
-
-    value.addFocusListener(new TextFocusListener());
-
-    terms.select(0);
-
-
-    setControl(composite);
-  }
-
-
-  public void setVisible(boolean visible)
-  {
-    super.setVisible(visible);
-
-    value.setText(pattern.getLexicalValue());
-    value.setCaretOffset(value.getCharCount());
-  }
-
-  public void dispose()
-  {
-    super.dispose();
-  }
-
-
-  /**
-   * Sets the visible status of caretLabel to status.  If status is true, then we also update the position
-   * of caretLabel in one of two ways.  If there is no active selection in value, we set caretLabel's
-   * position to correspond with the position of the actual caret.  Alternatively, if there is an active selection
-   * in value, we set caretLabel's position to the beginning of the selection.
-   *
-   * @param The new visibility status of caretLabel.
-   */
-  private void setShowCaretLabel(boolean status)
-  {
-    if (status)
-    {
-  
-      int offset;
-      
-      if (value.getSelectionText().equals(""))
-      {
-        offset = value.getCaretOffset();
-      }
-      else
-      {
-        offset = value.getSelection().x;
-      }
-  
-      Point p = value.getLocationAtOffset(offset);
-      
-      p.x += value.getLocation().x;
-      p.y = value.getLocation().y;
-      
-      // Place the label under value, and make sure it is aligned with the caret.
-      // The offsets are dependent on the icon used.
-      p.x += CARET_LABEL_X_OFFSET;
-      p.y += CARET_LABEL_Y_OFFSET;
-  
-      if (debug)
-      {
-        System.out.println("POINT: " + p);
-      }
-      
-      caretLabel.setLocation(p);
-      caretLabel.setVisible(true);
-    }
-    else
-    {
-      caretLabel.setVisible(false);
-    }
-  }
-
-
-  /**
-   * Adds a new radio button to Composite c with SelectionListener l.  The text of the button is the String associated with
-   * quantifier.
-   *
-   * @param quantifier The desired quantifier, as enumerated in RegexNode.
-   * @param c The Composite to add the buttons to (normally occurrenceRadioButtons).
-   * @param l The SelectionListener (normally radioSelectionListener).
-   * @return The newly created button.
-   */
-  private Button addOccurenceRadioButton(int quantifier, Composite c, SelectionListener l)
-  {
-    Button result = new Button(c, SWT.RADIO);
-    result.setText(RegexNode.getQuantifierText(quantifier));
-    result.addSelectionListener(l);
-    return result;
-  }
-
-
-  /**
-   * Validates the regex in value.  If the regex is valid, clears the Wizard's error message.  If it's not valid,
-   *  sets the Wizard's error message accordingly.
-   *
-   * @return Whether the regex is valid.
-   */
-  private boolean validateRegex()
-  {
-
-    boolean isValid;
-    try
-    {
-      // We validate the regex by checking whether we get a ParseException.
-      // By default, we assume that it's valid unless we determine otherwise.
-      isValid = true;
-      displayRegexErrorMessage(null);
-      value.setStyleRange(null);
-
-      Pattern.compile(value.getText());
-    }
-    catch (PatternSyntaxException pe)
-    {
-      isValid = false;
-      displayRegexErrorMessage(pe.getMessage());
-
-      // An off-by-one bug in the xerces regex parser will sometimes return a location for the parseError that
-      //  is off the end of the string.  If this is the case, then we want to highlight the last character.
-      if (pe.getIndex() >= value.getText().length())
-      {
-        currentError.start = value.getText().length() - 1;
-      }
-      else
-      {
-        currentError.start = pe.getIndex();
-      }
-
-      if (debug)
-      {
-        System.out.println("Parse Error location: " + pe.getIndex());
-        System.out.println("currentError.start: " + currentError.start);
-      }
-
-      value.setStyleRange(currentError);
-
-    }
-
-    // Another bug in the xerces parser will sometimes throw a RuntimeException instead of a ParseException.
-    //  When we get a RuntimeException, we aren't provided with the additional information we need to highlight
-    //  the parse error.  So, we merely report that there is an error.
-    catch (RuntimeException re)
-    {
-      displayRegexErrorMessage("");
-      value.setStyleRange(null);
-      isValid = false;
-    }
-    
-    setPageComplete(isValid);    
-    return isValid;
-  }
-
-  
-  /**
-   * Manages the display of error messages.
-   * Sets the error message for type to errorMessage.  If errorMessage != null, then we set the Wizard's error message
-   * to errorMessage.  If errorMessage == null, then we check whether we have a pending message of another type.
-   * If we do, then it is displayed as the Wizard's error message.  If we don't, then the Wizard's error message field
-   * is cleared.
-   *
-   * @param errorMessage The text of the new error message.  A value of null indicates that the error message should
-   *  be cleared.
-   * @param type The error type, one of PARSE, TOKEN, or SELECTION.
-   */ 
-  private void displayErrorMessage(String errorMessage, int type)
-  {
-    String messageToDisplay = null;
-
-
-    currentErrorMessages[type] = errorMessage;
-
-    messageToDisplay = errorMessage;
-
-    for (int i = 0; i < NUM_ERROR_MESSAGE_TYPES; i++)
-    {
-      if (messageToDisplay != null)
-      {
-        break;
-      }
-      messageToDisplay = currentErrorMessages[i];
-    }
-
-    setErrorMessage(messageToDisplay);
-  }
-
-
-  /**
-   * Sets the Wizard's error message to message, preceded by a standard prefix.
-   *
-   * @param message The new error message (or null to clear it).
-   */
-  private void displayRegexErrorMessage (String errorMessage)
-  {
-    if (errorMessage == null)
-    {
-      displayErrorMessage(null, PARSE);
-    }
-    else
-    {
-    	if (errorMessage.trim().equals("")) // when there is no error message available.
-    	{
-        displayErrorMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_REGEX_ERROR"),
-                           PARSE);
-      }
-      else
-      {
-        displayErrorMessage(errorMessage, PARSE);
-      }
-    }
-  }
-
-
-  /**
-   * Updates the token status.  Sets isValidToken to status && the status of the other error type.
-   * If status is true, we clear the wizard's error message for this type; if it is false, we set it to errorMessage.
-   *
-   * @param status The new isValidToken value.
-   * @param errorMessage The new error message.
-   * @param type The type of the error (either TOKEN or SELECTION).
-   */
-  private void setTokenStatus (boolean status, String errorMessage, int type)
-  {
-    boolean otherTypeStatus =     (type == TOKEN) ? 
-                                  currentErrorMessages[SELECTION] == null :
-                                  currentErrorMessages[TOKEN] == null;
-    
-    isValidToken = status && otherTypeStatus;
-    add.setEnabled(isValidToken);
-
-    if (status)
-    {
-      displayErrorMessage(null, type);
-    }
-    else
-    {
-    	if (errorMessage != null && errorMessage.trim().equals("")) // when there is no error message available.
-    	{
-        displayErrorMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_TOKEN_ERROR"),
-                           type);
-      }
-      else
-      {
-        displayErrorMessage(errorMessage, type);
-      }
-    }
-  }
-
-  
-  /**
-   * Updates the token status.  Sets isValidToken to status && the status of the other error type.
-   * Also clears the wizard's error message for this type.
-   * Usually used to set isValidToken to true.
-   *
-   * @param status The new isValidToken value.
-   * @param type The type of the error (either TOKEN or SELECTION).
-   */
-  private void setTokenStatus(boolean status, int type)
-  {
-    setTokenStatus(status, null, type);
-  }
-
-
-
-  /**
-   * Sets the enabled status of the text fields and labels associated with the specified quantifier.
-   * If status is true, then fields and labels associated with other quantifiers are disabled.
-   * @param quantifier The quantifier whose elements' enabled status we wish to change
-   *   (as enumerated in RegexNode).
-   * @param status The new status of the elements.  If true, then all elements associated with other buttons
-   *               are disabled.
-   */    
-  private void setEnabledStatus(int quantifier, boolean status)
-  {
-    switch (quantifier)
-    {
-    
-    case RegexNode.REPEAT:
-      repeatValue.setEnabled(status);
-      if (status)
-      {
-        rangeMinValue.setEnabled(false);
-        rangeMaxValue.setEnabled(false);
-        rangeToLabel.setEnabled(false);
-      }
-      break;
-
-    case RegexNode.RANGE:
-      rangeMinValue.setEnabled(status);
-      rangeMaxValue.setEnabled(status);
-      rangeToLabel.setEnabled(status);
-      if (status)
-      {
-        repeatValue.setEnabled(false);
-      }
-      break;
-
-    }
-  }
-
-  /**
-   * Checks to see if there is a selection in value.  If there is not, we set the Wizard's error message accordingly.
-   * If there is, we update the contents of node.  If "Current Selection" is not the current token, then
-   * we clear the Selection error message.
-   */
-  private void updateCurrentSelectionStatus()
-  {
-    if (terms.getSelectionIndex() == RegexNode.SELECTION)
-    {
-      String selection = value.getSelectionText();
-      if (selection.equals(""))
-      {
-        setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_SELECTION_ERROR"), SELECTION);
-      }
-      else
-      {
-        setTokenStatus(true, SELECTION);
-        node.setContents(selection);
-        node.setHasParens(true);
-      }
-    }
-    else
-    {
-      setTokenStatus(true, SELECTION);
-    }
-  }
-
-  /**
-   * Updates the enabled status of the auto-escape checkbox.  If status is true, we enable the checkbox, and
-   * set its selection status and node's auto-escape status to the value of autoEscapeStatus.  If status is
-   * false, then we disable and deselect the checkbox, and set node's status to false.
-   *
-   * @param status The new enabled status.
-   */
-  private void setEscapeCheckboxEnabledStatus(boolean status)
-  {
-    if (status)
-    {
-      escapeCheckbox.setEnabled(true);
-      escapeCheckbox.setSelection(autoEscapeStatus);
-      node.setAutoEscapeStatus(autoEscapeStatus);
-    }
-    else
-    {
-      escapeCheckbox.setEnabled(false);
-      escapeCheckbox.setSelection(false);
-      node.setAutoEscapeStatus(false);
-    }
-  }
-
-
-  /**
-   * Returns the current regex flags.
-   */
-  String getFlags()
-  {
-    return regexFlags;
-  }
-
-  /**
-   * Returns the current XSDPattern model.
-   */
-  XSDPatternFacet getPattern()
-  {
-    return pattern;
-  }
-
-
-  /**
-   * Returns a string consisting of the values of min, max, and repeat stored in node.
-   * Used for debugging purposes only.
-   */  
-  private String getAllFieldValues()
-  {
-      String result = "";
-      result += "Min: " + node.getMin() + "\n";
-      result += "Max: " + node.getMax() + "\n";
-      result += "Repeat: " + node.getRepeat() + "\n";
-      result += "\n";
-      return result;
-  }
-  
-
-  /* Listener for the add button. */
-  class ButtonSelectListener implements SelectionListener
-  {
-    public void widgetDefaultSelected(SelectionEvent e)
-    {
-    }
-
-    // Precondition: isValidToken == true  
-    public void widgetSelected(SelectionEvent e)
-    {
-      if (!isValidToken) // should never happen
-      {
-        System.out.println("Attempted to add an invalid token.");
-        System.out.println(node.toString());
-        System.out.println(getAllFieldValues());
-        return;
-      }
-
-      // Whether there is anything selected in value.
-      boolean isActiveSelection = value.getSelectionCount() != 0;
-      
-      value.insert(node.toString());
-
-      if (terms.getSelectionIndex() == RegexNode.SELECTION)
-      {
-        updateCurrentSelectionStatus();
-      }
-
-      // If nothing is selected, then we need to advance the caret location.
-      if (!isActiveSelection)
-      {
-        value.setCaretOffset(value.getCaretOffset() + node.toString().length());
-      }
-
-      value.setFocus();
-
-    }
-
-  }
- 
-
-  /* Listener for the terms combo box. */
-  class ComboListener implements Listener
-  {
-    public void handleEvent(Event e)
-    {
-      
-      updateCurrentSelectionStatus();
-
-      // If the user has typed in a token
-      if (terms.getSelectionIndex() == -1)
-      {
-        setEscapeCheckboxEnabledStatus(true);
-        node.setContents(terms.getText());
-        node.setHasParens(true);
-        
-
-        if (debug)
-        {
-          System.out.println(terms.getText());
-        }
-
-      }
-      else if (terms.getSelectionIndex() == RegexNode.SELECTION)
-      {
-        setEscapeCheckboxEnabledStatus(false);
-      }
-      else
-      {
-        node.setContents(RegexNode.getRegexTermValue(terms.getSelectionIndex()));
-        node.setHasParens(false);
-        setEscapeCheckboxEnabledStatus(false);
-      }
-    }
-  }
-
-
-  /* Listener for enabling/disabling caretLabel. */
-  class TextFocusListener implements FocusListener
-  {
-    public void focusGained(FocusEvent e)
-    {
-      setShowCaretLabel(false);
-    }
-    public void focusLost(FocusEvent e)
-    {
-      setShowCaretLabel(true);
-    }
-  }
-
-
-
-  /* Listener for the text fields. */
-  class TextListener implements Listener
-  {
-    public void handleEvent (Event e)
-    {
-
-      if (debug)
-      {
-        System.out.println("Inside TextListener handler");
-        System.out.println(e);
-        System.out.println(getAllFieldValues());
-      }
-
-
-      if ( (e.widget == value) && (e.type == SWT.Modify) )
-      {
-        pattern.setLexicalValue(value.getText());
-        validateRegex();
-      }
-
-      else if (e.widget == value && e.type == SWT.Selection)
-      {
-        if (terms.getSelectionIndex() == RegexNode.SELECTION)
-        {
-          updateCurrentSelectionStatus();
-        }
-      }
-
-      else if (e.widget == rangeMinValue)
-      {
-        boolean isValid = node.setMin(rangeMinValue.getText());
-
-        if (isValid)
-        {
-          setTokenStatus(true, null, TOKEN);
-        }
-        else
-        {
-          setTokenStatus(false,  XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MIN_ERROR_SUFFIX"), TOKEN);
-        }
-      }
-
-      else if (e.widget == rangeMaxValue)
-      {
-        boolean isValid = node.setMax(rangeMaxValue.getText());
-
-        if (node.getMin() == RegexNode.EMPTY)
-        {
-          setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_MISSING_MIN_ERROR_SUFFIX"), TOKEN);
-        }
-        else if (isValid)
-        {
-          setTokenStatus(true, null, TOKEN);
-        }
-        else
-        {
-          setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MAX_ERROR_SUFFIX"), TOKEN);
-        }
-      }
-
-      else  // (e.widget == repeatValue)
-      {
-        boolean isValid = node.setRepeat(repeatValue.getText());
-        if (isValid)
-        {
-          setTokenStatus(true, null, TOKEN);
-        }
-        else
-        {
-          setTokenStatus(false, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_REPEAT_ERROR_SUFFIX"), TOKEN);
-        }
-      }
-    }
-  }
-
-  /* Listener for the auto-escape checkbox. */
-  class CheckboxListener implements SelectionListener
-  {
-    public void widgetDefaultSelected(SelectionEvent e)
-    {
-    }
-
-    public void widgetSelected(SelectionEvent e)
-    {
-      boolean newStatus = !autoEscapeStatus;
-      node.setAutoEscapeStatus(newStatus);
-      autoEscapeStatus = newStatus;
-      
-      if (debug)
-      {
-        System.out.println("AutoEscape Status: " + node.getAutoEscapeStatus());
-      }
-    }
-
-  }
-
-
-  /* Listener for the radio buttons. */
-  class RadioSelectListener implements SelectionListener
-  {
-    public void widgetDefaultSelected(SelectionEvent e)
-    {
-    }
-
-    public void widgetSelected(SelectionEvent e)
-    {
-      if (debug)
-      {
-        System.out.println(getAllFieldValues());
-      }
-
-
-      int currentQuantifier = getQuantifier(e);
-
-      node.setQuantifier(currentQuantifier);
-
-      switch (currentQuantifier)
-      {
-      case RegexNode.SINGLE:                     
-      case RegexNode.STAR:
-      case RegexNode.PLUS:
-      case RegexNode.OPTIONAL:
-        setEnabledStatus(RegexNode.REPEAT, false);
-        setEnabledStatus(RegexNode.RANGE, false);
-        setTokenStatus(true, TOKEN);
-        break; 
-
-      case RegexNode.REPEAT:
-        setEnabledStatus(RegexNode.REPEAT, true);
-        setTokenStatus(node.hasValidRepeat(), XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_REPEAT_ERROR_SUFFIX"), TOKEN);
-        repeatValue.setFocus();
-        break;
-
-      case RegexNode.RANGE:
-        setEnabledStatus(RegexNode.RANGE, true);
-        String error = (node.hasValidMin()) ? 
-                            XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MAX_ERROR_SUFFIX") : 
-                            XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_INVALID_MIN_ERROR_SUFFIX");
-
-        setTokenStatus( node.hasValidMin() && node.hasValidMax(), error, TOKEN);
-        rangeMinValue.setFocus();
-        break;
-      }
-    }
-
-    private int getQuantifier(SelectionEvent e)
-    {
-
-      if (e.widget == singleRadio)
-      {
-        return RegexNode.SINGLE;
-      }
-      
-      else if (e.widget == starRadio)
-      {
-        return RegexNode.STAR;
-      }
-      
-      else if (e.widget == plusRadio)
-      {
-        return RegexNode.PLUS;
-      }
-      
-      else if (e.widget == optionalRadio)
-      {
-        return RegexNode.OPTIONAL;
-      }
-      
-      else if (e.widget == repeatRadio)
-      {
-        return RegexNode.REPEAT;
-      }
-      
-      else if (e.widget == rangeRadio)
-      {
-        return RegexNode.RANGE;
-      }
-      
-      else // can't get here
-      { 
-        return RegexNode.EMPTY;
-      }
-    } 
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java
deleted file mode 100644
index 2844709..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java
+++ /dev/null
@@ -1,421 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-
-
-class RegexNode
-{
-  private String contents;
-  private int min;
-  private int max;
-  private int repeat;
-  private int quantifier;
-  private boolean hasParens;
-  private boolean autoEscapeStatus;
-
-  
-  /* Quantifiers. */
-  public static final int SINGLE = 0;    
-  public static final int STAR = 1;
-  public static final int PLUS = 2;
-  public static final int OPTIONAL = 3;
-  public static final int REPEAT = 4; 
-  public static final int RANGE = 5;
-
-  /* Regex quantifiers.  First column is the on-screen textual representation, second column is the 
-   on-screen regex representation.  The two are concatenated together to form the on-screen
-   representation.
-   Indexing of this array must correspond to the values of the quantifier constants above.
-  */
-  private static final String[][] regexQuantifiers =
-  { 
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_SINGLE"),   ""  },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_STAR"),     "*" },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_PLUS"),     "+" },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_OPTIONAL"), "?" },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_REPEAT"),   ""  },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_RANGE"),    ""  },
-  };
-
-
-  /* Regex tokens.  First column is the on-screen representation, second column is the regex representation. 
-     More tokens can be added, but it is assumed that "Current Selection" is the last element in the array.
-     If this is not the case, then the value of the SELECTION constant below will need to be changed 
-     accordingly.
-     Also note that because these are java Strings, backslashes must be escaped (this is only relevant to the
-     second column of the array).
-   */
-  private static final String[][] regexTerms =
-  { 
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_ANY_CHAR"),   "."     },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_ALPHANUMERIC_CHAR"),   "\\w"     },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_WHITESPACE"), "\\s"   },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_DIGIT"),      "\\d"   },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_UPPER"),      "[A-Z]" },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_LOWER"),      "[a-z]" },
-    { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_SELECTION"),  ""      },
-  };
-
-  /* Token enumerated constants. */
-
-  // SELECTION must correspond to the index in regexTerms of "Current Selection".  This is assumed to be
-  //  the last element.
-  public static final int SELECTION = regexTerms.length - 1;
-
-  public static final int EMPTY = -1;
-
-  /* 
-  The metacharacters recognized by XML Schema.
-  Note that the double backslash ("\\") actually represents an escaped single backslash character ("\").
-  */ 
-  private static final String metacharacters = ".\\?*+{}()[]";
-
-
-  public static String getRegexTermText(int i)
-  {
-    if (i == SELECTION)
-    {
-      return regexTerms[i][0];
-    }
-    else
-    {
-      return regexTerms[i][0] + " ( " + regexTerms[i][1] + " )";
-    }
-  }
-
-  public static String getRegexTermValue(int i)
-  {
-    if (i == SELECTION) // shouldn't happen
-    {
-      return "";
-    }
-    else
-    {
-      return regexTerms[i][1];
-    }
-  }
-
-  public static int getNumRegexTerms()
-  {
-    return regexTerms.length;
-  }
-
-  public static String getQuantifierText(int i)
-  {
-    String result = regexQuantifiers[i][0];
-    
-    if (!regexQuantifiers[i][1].equals(""))
-    {
-      result += " ( ";
-      result += regexQuantifiers[i][1];
-      result += " )";
-    }
-
-    return result;
-  }
-
-  public RegexNode()
-  {
-    this.contents = "";
-    this.quantifier = SINGLE;
-    this.min = EMPTY;
-    this.max = EMPTY;
-    this.repeat = EMPTY;
-    this.hasParens = false;
-
-  }
-
-  
-  public String getContents()
-  {
-    return contents;
-  }
-  
-  public void setContents(String contents)
-  {
-    this.contents = contents;
-  }
-
-
-  public int getQuantifier()
-  {
-    return quantifier;
-  }
-
-  public void setQuantifier(int quantifier)
-  {
-    this.quantifier = quantifier;
-  }
-
-
-  public int getMin()
-  {
-    return min;
-  }
-
-  public void setMin(int min)
-  {
-    this.min = min;
-  }
-
-  /**
-   * Sets this.min to the integer representation of min iff min is a valid value (i.e. greater than 0).
-   * Sets this.min to EMPTY if it is not.
-   *
-   * @param min The new min value
-   * @returns Whether min was a valid value
-   */  
-  public boolean setMin(String min)
-  {
-    this.min = convertToInt(min);
-
-    // min > max is an invalid case, unless max is EMPTY (since EMPTY == -1).
-    if ( (this.max != EMPTY) && (this.min > this.max) )
-    {
-      return false;
-    }
-    
-    return (this.min >= 0);
-  }
-
-  
-  public int getMax()
-  {
-    return max;
-  }
-  
-  public void setMax(int max)
-  {
-    this.max = max;
-  }
-
-  /**
-   * Sets this.max to the integer representation of max iff max is a valid value (i.e. greater than 0).
-   * Sets this.max to EMPTY if it is not.
-   *
-   * @param max The new max value
-   * @returns Whether max was a valid value, or (whether max == the empty string && min has a valid value)
-   */ 
-  public boolean setMax(String max)
-  {
-    this.max = convertToInt(max);
-
-    // The empty string is a valid max value iff min has a valid value.
-    // This is due to the fact that {n,} means "at least n times" in regex parlance.
-    if (max.equals("") && this.min != EMPTY)
-    {
-      return true;
-    }
-    
-    else if (this.max < this.min)
-    {
-      return false;
-    }
-    
-    else
-    {
-      return (this.max >= 0);
-    }
-  }
-
-
- 
-  public int getRepeat()
-  {
-    return repeat;
-  }
-
-  public void setRepeat(int repeat)
-  {
-    this.repeat = repeat;
-  }
-
-  /**
-   * Sets this.repeat to the integer representation of repeat iff repeat is a valid value (i.e. greater than 0).
-   * Sets this.repeat to EMPTY if it is not.
-   *
-   * @param repeat The new repeat value
-   * @returns Whether repeat was a valid value
-   */
-  public boolean setRepeat(String repeat)
-  {
-    this.repeat = convertToInt(repeat);
-    return (this.repeat >= 0);
-  }
-
-
-
-  /**
-   * Returns the integer representation of s.  If s is less than zero, or if s is not an int
-   * (i.e. if Integer.parseInt would throw a NumberFormatException), then returns EMPTY.
-   *
-   * @param s The String to convert.
-   * @returns The integer representation of s.
-   */
-  private int convertToInt(String s)
-  {
-    int result;
-    try
-    {
-      result = Integer.parseInt(s);
-      if (result < 0)
-      {
-        result = EMPTY;
-      }
-    }
-    catch (NumberFormatException e)
-    {
-      result = EMPTY;
-    }
-
-    return result;
-  }
-
-
-  public boolean getHasParens()
-  {
-    return hasParens;
-  }
-
-  public void setHasParens(boolean status)
-  {
-    this.hasParens = status;
-  }
-
-  public boolean getAutoEscapeStatus()
-  {
-    return autoEscapeStatus;
-  }
-
-  public void setAutoEscapeStatus(boolean status)
-  {
-    this.autoEscapeStatus = status;
-  }
-
-  /**
-   * Returns an escaped version of s.  In other words, each occurrence of a metacharacter ( .\?*+{}()[] )
-   * is replaced by that character preceded by a backslash.
-   *
-   * @param s The String to escape.
-   * @returns An escaped version of s.
-   */
-  private String addEscapeCharacters(String s)
-  {
-    StringBuffer result = new StringBuffer("");
-
-    for (int i = 0; i < s.length(); i++)
-    {
-      char currentChar = s.charAt(i);
-
-      if (isMetachar(currentChar))
-      {
-        result.append("\\"); // Note that this is an escaped backslash, not a double backslash.
-      }
-      result.append(currentChar);
-
-    }
-
-    return result.toString();
-  }
-
-  /**
-   * Checks whether c is a metacharacter as defined in the static variable metacharacters.
-   *
-   * @param c The character to check.
-   * @returns Whether c is a metacharacter.
-   */
-  private boolean isMetachar(char c)
-  {
-    return metacharacters.indexOf(c) != -1;
-  }
-  
-
-  public boolean hasValidMin()
-  {
-    return (min != EMPTY);
-  }
-
-  public boolean hasValidMax()
-  {
-    return(max != EMPTY);
-  }
-
-  public boolean hasValidRepeat()
-  {
-    return(repeat != EMPTY);
-  }
-
-  public String toString()
-  {
-    String result = "";
-    
-    if (hasParens)
-    {
-      result += "(";
-    }
-    
-    if (autoEscapeStatus)
-    {
-       result += addEscapeCharacters(contents);
-    }
-    else 
-    {
-      result += contents;
-    }
-
-
-    if (hasParens)
-    {
-      result += ")";
-    }
-    
-    switch (quantifier)
-    {
-      case STAR:
-        result += "*";
-        break;
-      
-      case PLUS:
-        result += "+";
-        break;
-      
-      case OPTIONAL:
-        result += "?";
-        break;
-      
-      case REPEAT:
-        result += "{" + repeat + "}";
-        break;
-      
-      case RANGE:
-        result += "{" + min + ",";
-        if (max == EMPTY)
-        {
-          result += "";
-        }
-        else
-        {
-          result += max;
-        }       
-        result += "}";
-        break;
-      
-      // SINGLE is a fall through           
-
-    }
-    return result;
-
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java
deleted file mode 100644
index 9abe271..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java
+++ /dev/null
@@ -1,150 +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
- *******************************************************************************/
-// Based on version 1.6 of original xsdeditor
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import java.util.regex.Pattern;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.GC;
-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.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorContextIds;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-
-public class RegexTestingPage extends WizardPage
-{
-  /* Validator from xerces package. */
-//  private RegularExpression validator;
-  
-  /* Displays the status of the match. */
-  private Label matchLabel;
-
-
-  /* The regex. */
-  private Text value;
-  
-  /* The string the user is trying to match against the regex. */
-  private StyledText testString;
-
-  public RegexTestingPage()
-  {
-    super(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_TITLE"));
-
-    setTitle(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_TITLE"));
-    setDescription(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION"));
-  }
-
-
-  public void createControl(Composite parent)
-  {
-    Composite composite = ViewUtility.createComposite(parent, 1);
-    WorkbenchHelp.setHelp(composite, XSDEditorContextIds.XSDR_TEST_PAGE);
-
-    matchLabel = new Label(composite, SWT.WRAP);
-    matchLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION"));
-    FontData[] fontData = matchLabel.getFont().getFontData();
-    GridData dataF = new GridData();
-    dataF.widthHint = 400;
-    dataF.heightHint = 6 * fontData[0].getHeight();
-    matchLabel.setLayoutData(dataF);
-    
-    Composite controls = new Composite(composite, SWT.NONE);
-    GridLayout controlsLayout = new GridLayout();
-    controlsLayout.numColumns = 2;
-    controls.setLayout(controlsLayout);
-    controls.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-    new Label(controls, SWT.LEFT).setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_REGEX_LABEL"));
-    value = new Text(controls, SWT.BORDER | SWT.READ_ONLY);
-    value.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-
-    new Label(controls, SWT.LEFT).setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_SAMPLE_TEXT"));
-    testString = new StyledText(controls, SWT.SINGLE | SWT.BORDER);
-    WorkbenchHelp.setHelp(testString, XSDEditorContextIds.XSDR_TEST_SAMPLE);
-    testString.addListener(SWT.Modify, new TestStringListener());
-    testString.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-    
-    controls.pack();
-    
-    Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
-    GC gc = new GC(separator);
-    Point pointSize = gc.stringExtent(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION"));
-    GridData gd = new GridData();
-    gd.widthHint = (int)(pointSize.x / 2 + gc.getAdvanceWidth('M')*11);
-    gd.horizontalAlignment= GridData.FILL;
-    separator.setLayoutData(gd);
-    
-    composite.pack();
-
-    setControl(composite);
-  }
-
-
-  private String getPatternValue()
-  {
-    return ( (RegexCompositionPage)getPreviousPage() ).getPattern().getLexicalValue();
-  }
-
-  private String getFlags()
-  {
-    return ( (RegexCompositionPage)getPreviousPage() ).getFlags();
-  }
-
-  public void setVisible(boolean visible)
-  {
-    super.setVisible(visible);
-
-    String pattern = getPatternValue();
-    getFlags();
-
-    value.setText(pattern);
-    
-    updateMatchStatus();
-
-    testString.setFocus();
-  }
-
-  class TestStringListener implements Listener
-  {
-    public void handleEvent(Event e)
-    {
-      updateMatchStatus();
-    }
-  }
-
-  private void updateMatchStatus()
-  {
-    if (Pattern.matches(getPatternValue(), testString.getText()))
-    {
-//      matchLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_MATCHES"));
-      setMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_MATCHES"), 1);
-    }
-    else
-    {
-      setMessage(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_DOES_NOT_MATCH"), 2);
-//      matchLabel.setText(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_DOES_NOT_MATCH"));
-    }
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java
deleted file mode 100644
index 95da3f7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java
+++ /dev/null
@@ -1,63 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.xsd.XSDPatternFacet;
-import org.eclipse.xsd.impl.XSDFactoryImpl;
-
-
-public class RegexWizard extends Wizard 
-{
-  private RegexCompositionPage compositionPage;
-  private RegexTestingPage testingPage;
-
-  /* The original, unchanged pattern. */  
-  private XSDPatternFacet originalPattern;
-  
-  /* A copy of the original pattern that is passed into the wizard. */
-  private XSDPatternFacet modifiedPattern;
-
-  String pattern;
-
-  public RegexWizard(String expr)
-  {
-    super();
-    setWindowTitle(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TITLE"));
-    setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/regx_wiz.gif"));
-
-    XSDFactoryImpl factory = new XSDFactoryImpl();
-    modifiedPattern = factory.createXSDPatternFacet();
-    modifiedPattern.setLexicalValue(expr);
-
-    originalPattern = factory.createXSDPatternFacet();
-    originalPattern.setLexicalValue(expr);
-
-    compositionPage = new RegexCompositionPage(modifiedPattern);
-    addPage(compositionPage);
-
-    testingPage = new RegexTestingPage();
-    addPage(testingPage);
-  }
-
-  public String getPattern()
-  {
-    return pattern;
-  }
-
-  public boolean performFinish()
-  {
-    pattern = modifiedPattern.getLexicalValue();
-    return true;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java
deleted file mode 100644
index 204ff2d..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java
+++ /dev/null
@@ -1,69 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-
-public class XSDLocationChoicePage extends WizardPage 
-{
-  protected Button radioButton1;
-  protected Button radioButton2;
-    
-  public XSDLocationChoicePage()
-  {
-    super("XSDLocationChoicePage");
-
-    this.setTitle(XSDEditorPlugin.getXSDString("_UI_WIZARD_INCLUDE_FILE_TITLE"));
-    this.setDescription(XSDEditorPlugin.getXSDString("_UI_WIZARD_INCLUDE_FILE_DESC"));
-  }
-    
-  public boolean isPageComplete()
-  {
-    return true;
-  }
-    
-  public void createControl(Composite parent)
-  {
-    Composite base = new Composite(parent, SWT.NONE);
-    base.setLayout(new GridLayout());
-      
-    ViewUtility.createLabel(base, XSDEditorPlugin.getXSDString("_UI_LABEL_INCLUDE_URL_FILE"));
-    Composite radioButtonsGroup = ViewUtility.createComposite(base, 1, true);
-
-    radioButton1 = ViewUtility.createRadioButton(radioButtonsGroup, 
-                                                 XSDEditorPlugin.getXSDString("_UI_RADIO_FILE"));
-      
-    radioButton2 = ViewUtility.createRadioButton(radioButtonsGroup,
-                                                 XSDEditorPlugin.getXSDString("_UI_RADIO_URL"));
-
-    radioButton1.setSelection(true);
-
-    setControl(base);
-  }
-
-  // actions on finish
-  public boolean performFinish()
-  {
-    return true;
-  }
-
-  public boolean isURL()
-  {
-    return radioButton2.getSelection();
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java
deleted file mode 100644
index db12cd6..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java
+++ /dev/null
@@ -1,129 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.wizards;
- 
-import org.eclipse.core.resources.IContainer;
-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.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-
-
-public class XSDNewFilePage extends WizardNewFileCreationPage
-{
-  public XSDNewFilePage(IStructuredSelection selection) 
-  {
-    super(XSDEditorPlugin.getXSDString("_UI_CREATEXSD"), selection);
-    setTitle(XSDEditorPlugin.getXSDString("_UI_NEW_XML_SCHEMA_TITLE"));
-    setDescription(XSDEditorPlugin.getXSDString("_UI_CREATE_A_NEW_XML_SCHEMA_DESC"));
-  }
-
-  public void createControl(Composite parent) 
-  {
-    // inherit default container and name specification widgets
-    super.createControl(parent);
-
-    this.setFileName(computeDefaultFileName());
-
-    setPageComplete(validatePage());
-  }
-
-  protected boolean validatePage()
-  {
-    Path newName = new Path(getFileName());
-    String fullFileName = getFileName();
-    String extension = newName.getFileExtension();
-    if (extension == null || !extension.equalsIgnoreCase("xsd")) 
-    {
-      setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_FILENAME_MUST_END_XSD"));
-      return false;
-    }
-    else 
-    {
-      setErrorMessage(null);
-    }
-
-    // check for file should be case insensitive
-    String sameName = existsFileAnyCase(fullFileName);
-    if (sameName != null) 
-    {
-      setErrorMessage(XSDEditorPlugin.getPlugin().getString("_ERROR_FILE_ALREADY_EXISTS", sameName)); //$NON-NLS-1$
-      return false;
-    }
-
-    return super.validatePage();
-  }
-
-  public String defaultName = "NewXMLSchema"; //$NON-NLS-1$
-  public String defaultFileExtension = ".xsd"; //$NON-NLS-1$
-  public String[] filterExtensions = { "*.xsd"}; //$NON-NLS-1$
-
-  protected String computeDefaultFileName()
-  {
-    int count = 0;
-    String fileName = defaultName + defaultFileExtension;
-    IPath containerFullPath = getContainerFullPath();
-    if (containerFullPath != null)
-    {
-      while (true)
-      {
-        IPath path = containerFullPath.append(fileName);
-        if (ResourcesPlugin.getWorkspace().getRoot().exists(path))
-        {
-          count++;
-          fileName = defaultName + count + defaultFileExtension;
-        }
-        else
-        {
-          break;
-        }
-      }
-    }
-    return fileName;
-  }
-
-  // returns true if file of specified name exists in any case for selected container
-  protected String existsFileAnyCase(String fileName)
-  {
-    if ( (getContainerFullPath() != null) && (getContainerFullPath().isEmpty() == false)
-        && (fileName.compareTo("") != 0))
-    {
-      //look through all resources at the specified container - compare in upper case
-      IResource parent = ResourcesPlugin.getWorkspace().getRoot().findMember(getContainerFullPath());
-      if (parent instanceof IContainer)
-      {
-        IContainer container = (IContainer) parent;
-        try
-        {
-          IResource[] members = container.members();
-          String enteredFileUpper = fileName.toUpperCase();
-          for (int i=0; i<members.length; i++)
-          {
-            String resourceUpperName = members[i].getName().toUpperCase();
-            if (resourceUpperName.equals(enteredFileUpper))
-            {  
-              return members[i].getName();    
-            }
-          }
-        }
-        catch (CoreException e)
-        {
-        }
-      }
-    }
-    return null;
-  }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java
deleted file mode 100644
index 16e2ac7..0000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java
+++ /dev/null
@@ -1,371 +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
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.wizards;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.viewers.SelectSingleFilePage;
-import org.eclipse.wst.xsd.ui.internal.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDParser;
-
-
-/**
- * Extend the base wizard to select a file from the project or outside the workbench
- * and add error handling
- */
-public class XSDSelectIncludeFileWizard extends Wizard implements INewWizard
-{
-  boolean isInclude;
-  XSDSchema mainSchema;
-  XSDSchema externalSchema;
-
-  XSDLocationChoicePage choicePage;
-  XSDSelectSingleFilePage filePage;
-  XSDURLPage urlPage;
-
-  IFile resultFile;
-  String resultURL;
-  String namespace = "";
-
-  public XSDSelectIncludeFileWizard(XSDSchema mainSchema, boolean isInclude,
-                                    String title, String desc, 
-                                    ViewerFilter filter,
-                                    IStructuredSelection selection)
-  {
-    super();
-    setWindowTitle(title);
-    setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/NewXSD.gif"));
-
-    setNeedsProgressMonitor(true);
-
-    // Choice Page
-    choicePage = new XSDLocationChoicePage();
-
-    // Select File Page
-    filePage = new XSDSelectSingleFilePage(PlatformUI.getWorkbench(),  selection, true);
-    filePage.setTitle(title);
-    filePage.setDescription(desc);
-    filePage.addFilter(filter);
-
-    // URL Page
-    urlPage = new XSDURLPage();
-    urlPage.setTitle(title);
-    urlPage.setDescription(XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_URL"));
-    
-    this.mainSchema = mainSchema;
-    this.isInclude = isInclude;
-  }
-
-  public void init(IWorkbench aWorkbench, IStructuredSelection aSelection)
-  { 
-  }
-
-  public void addPages()
-  {
-    addPage(choicePage);
-    addPage(filePage);
-    addPage(urlPage);
-  }
-
-  public IWizardPage getNextPage(IWizardPage currentPage)
-  {
-    WizardPage nextPage = null;
-
-    if (currentPage == choicePage)
-    {
-      if (choicePage.isURL()) 
-      {
-        nextPage = urlPage;
-      }
-      else
-      {
-        nextPage = filePage;
-      }
-    }
-    return nextPage;
-  }
-
-  public boolean canFinish()
-  {
-    if (!choicePage.isURL())
-    {
-      return filePage.isPageComplete(); 
-    }
-    return true;
-  }
-
-  public boolean performFinish()
-  { 
-    if (choicePage.isURL())
-    {
-      try 
-      {
-        getContainer().run(false, true, urlPage.getRunnable());
-        resultURL = urlPage.getURL();
-      }
-      catch (Exception e)
-      {
-        return false;
-      }
-      return true;
-    }
-    else
-    {  
-      resultFile = filePage.getFile();
-    }
-    return true;
-  }
-
-  /**
-   * Get the MOF object that represents the external file
-   */
-  public XSDSchema getExternalSchema()
-  {
-    return externalSchema;
-  }
-
-  public IFile getResultFile()
-  {
-    return resultFile;
-  }
-
-  public String getURL()
-  {
-    return resultURL;
-  }
-  
-  public String getNamespace()
-  {
-  	return namespace;
-  }
-
-  /**
-   * Create a MOF model for the imported file
-   */
-  protected String doLoadExternalModel(IProgressMonitor monitor, String xsdModelFile, String xsdFileName)
-  { 
-    String errorMessage = null;
-    String currentNameSpace = mainSchema.getTargetNamespace();
-
-    monitor.beginTask("Loading XML Schema", 100);
-    monitor.worked(50);
-
-    XSDParser parser = new XSDParser();
-    parser.parse(xsdModelFile);
-
-    externalSchema = parser.getSchema();
-    if (externalSchema != null)
-    {
-      String extNamespace = externalSchema.getTargetNamespace();
-      namespace = extNamespace;
-     
-      if (externalSchema.getDiagnostics() != null &&
-          externalSchema.getDiagnostics().size() > 0)
-      {
-        errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_INCORRECT_XML_SCHEMA", xsdFileName);
-      }  
-      else
-      {
-        if (isInclude) 
-        {  
-          // Check the namespace to make sure they are the same as current file
-          if (extNamespace != null)
-          {
-            if (currentNameSpace != null && !extNamespace.equals(currentNameSpace))
-            {
-              errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_DIFFERENT_NAME_SPACE", xsdFileName);
-            }
-          }
-        }
-        else
-        {  
-          // Check the namespace to make sure they are different from the current file
-          if (extNamespace != null)
-          {
-            if (currentNameSpace != null && extNamespace.equals(currentNameSpace))
-            {
-              errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_SAME_NAME_SPACE", xsdFileName);
-            }
-          }
-        }
-      }
-    }
-    else
-    {
-      errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_INCORRECT_XML_SCHEMA", xsdFileName);
-    }
-
-    monitor.subTask("Finish Loading");
-    monitor.worked(80);
-
-    return errorMessage;
-  }
-
- 
-  /**
-   * URL page
-   */
-  class XSDURLPage extends WizardPage
-  { 
-    Text urlField;
-    String saveString;
-
-    public XSDURLPage()
-    {
-      super("URLPage");
-    }
-
-    public void createControl(Composite parent)
-    {
-      Composite client = ViewUtility.createComposite(parent,2);
-      ViewUtility.setComposite(client);
-
-      ViewUtility.createLabel(client, XSDEditorPlugin.getXSDString("_UI_LABEL_URL"));
-      ViewUtility.createLabel(client, "");
-
-      urlField = ViewUtility.createTextField(client, 50);
-      saveString = "http://";
-      urlField.setText(saveString);
-
-      setControl(client);
-    }
-
-    public String getURL()
-    {
-      return urlField.getText();
-    }
-
-    private boolean openExternalSchema(IProgressMonitor monitor)
-    {
-      String text = urlField.getText();
-//      if (text.equals(saveString)) 
-//      {
-//        return false;
-//      }
-//      saveString = text;
-
-      if (text.equals(""))
-      {
-        setErrorMessage(XSDEditorPlugin.getXSDString("_UI_SPECIFY_URL"));
-        return false;
-      }
-
-      if ( !text.startsWith("http://") )
-      {
-        setErrorMessage(XSDEditorPlugin.getXSDString("_UI_URL_START_WITH"));
-        return false;
-      }
-
-      setErrorMessage(null);
-      String errorMessage = doLoadExternalModel(monitor, text, text);
-      if (errorMessage != null) 
-      {
-        setErrorMessage(errorMessage); 
-        return false;
-      }
-      else
-      {
-        return true;
-      }
-    }
-
-    public IRunnableWithProgress getRunnable()
-    {
-      return new IRunnableWithProgress()
-      {
-        public void run(IProgressMonitor monitor)   
-          throws InvocationTargetException, InterruptedException
-        {
-          if (monitor == null)
-          {
-            monitor= new NullProgressMonitor();
-          }
-          monitor.beginTask("", 6);
-        
-          boolean ok = openExternalSchema(monitor);
-
-          if (!ok) 
-          { 
-            throw new InvocationTargetException(new java.lang.Error());
-          }
-
-          monitor.done();
-        }
-      };
-    }
-  }
-
-  /**
-   * Select XML Schema File
-   */
-  class XSDSelectSingleFilePage extends SelectSingleFilePage
-  {
-    public XSDSelectSingleFilePage(IWorkbench workbench, IStructuredSelection selection, boolean isFileMandatory)
-    {          
-      super(workbench,selection,isFileMandatory);
-    }
-
-    private boolean openExternalSchema()
-    {
-      // Get the fully-qualified file name
-      IFile iFile = getFile();
-      if (iFile == null) 
-        return false;
-
-      setErrorMessage(null);
-
-      String xsdModelFile = iFile.getLocation().toOSString();
-      String xsdFileName = iFile.getName();
-      String errorMessage = doLoadExternalModel(new NullProgressMonitor(), xsdModelFile, xsdFileName);
-
-      if (errorMessage != null) 
-      {
-        setErrorMessage(errorMessage);
-        return false;
-      }
-      else
-      {
-        return true;
-      }
-    }
-
-    public boolean isPageComplete()
-    {  
-      if (choicePage.isURL()) 
-      {
-        return true;
-      }
-
-      if (super.isPageComplete()) 
-      {
-        return openExternalSchema();
-      }
-      return super.isPageComplete();
-    }
-  }
-}
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/.cvsignore b/docs/org.eclipse.wst.sse.ui.infopop/.cvsignore
deleted file mode 100644
index c14487c..0000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/.project b/docs/org.eclipse.wst.sse.ui.infopop/.project
deleted file mode 100644
index 2d9cc84..0000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.sse.ui.infopop</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<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>
-	</natures>
-</projectDescription>
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/EditorContexts.xml b/docs/org.eclipse.wst.sse.ui.infopop/EditorContexts.xml
deleted file mode 100644
index b68067e..0000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/EditorContexts.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * 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
- *******************************************************************************/ -->
-<contexts>
-
-<context id="sted0001">
-<description>This page lets you customize the appearance of the structured text editors.
-When the <b>Highlight matching brackets</b> option is selected, whenever the cursor is next to a bracket or curly braces, its opening or closing counter part is highlighted.
-Select the <b>Report problems as you type</b> check box to update validity annotations (temporary annotations, such as missing required attributes based on a DTD, that go away when the editor is closed, or the problem is fixed) as the user types.
-In the <b>Appearance color options</b> table, you can adjust various editor appearance features.
-</description>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="sted0003">
-<description>This page lets you customize hover text in the structured text editors.
-</description>
-<topic label="Setting preferences for structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclispe.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="xmlm1010">
-<description>Content assist helps you to finish tags or lines of code and insert templates. Depending on the source markup language, the choices that are available in the content assist list are based on tags defined by DTD and schema files, tag library descriptors, or content model standard that is specified for the file being edited. HTML content assist choices are based on the W3C HTML 4.01 content model.
-
-If your cursor is in a position where content assist is available, a pop-up list of available choices is displayed. The content assist list displays all available completions for the current cursor position, including templates. Content assist is also available by pressing Ctrl+Space.
-</description>
-<topic label="Content assist" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt006.html"/>
-<topic label="Getting content assistance in structured text editors" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt005.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="xmlm1030">
-<description>Select this option to format an entire document. Formatting restores element and attribute indentation and positioning, which may have been offset during editing, to see nesting hierarchies and relationships more clearly in the file. Edit the appropriate Preferences pages to make changes in specific formatting behavior.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="xmlm1040">
-<description>Select this option to format selected elements. Formatting restores element and attribute indentation and positioning, which may have been offset during editing, to see nesting hierarchies and relationships more clearly in the file.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="xmlm1070">
-<description>Select this option to open the <b>Properties</b> view, which displays properties relevant to the current element if any exist.
-</description>
-<topic label="Properties view" href="../org.eclipse.platform.doc.user/concepts/cpropview.htm"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="xmlm2000">
-<description>This structured text editor lets you edit a text file that is coded in a markup language. The editor provides many text editing features, such as content assist, syntax highlighting, unlimited undo and redo, element selection and formatting, and document formatting. For a more specific list of editing features, see the first link below.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-
-<context id="webx0000">
-<description>This page lets you customize task tag discovery in the structured text editors.
-</description>
-</context>
-
-<context id="ecss0000">
-<description>The CSS source page editor lets you edit a cascading style sheet. The editor provides many text editing features, such as content assist, syntax highlighting, unlimited undo and redo, element selection and formatting, and document formatting.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-<context id="misc0180">
- <description>Use this dialog to edit the CSS content settings for a CSS file. You can specify CSS profile or restore the default by clicking <b>Restore Defaults</b>.
- </description>
-</context>
-</contexts>
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/EditorCssContexts2.xml b/docs/org.eclipse.wst.sse.ui.infopop/EditorCssContexts2.xml
deleted file mode 100644
index f8bc39d..0000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/EditorCssContexts2.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * 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
- *******************************************************************************/ -->
-<contexts>
-<context id="csssource_source_HelpId">
-<description>The CSS source page editor lets you edit a cascading style sheet. The editor provides many text editing features, such as content assist, syntax highlighting, unlimited undo and redo, element selection and formatting, and document formatting.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
-<context id="ecss0000">
-<description>The CSS source page editor lets you edit a cascading style sheet. The editor provides many text editing features, such as content assist, syntax highlighting, unlimited undo and redo, element selection and formatting, and document formatting.
-</description>
-<topic label="Structured text editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
-<topic label="Editing text coded in markup languages - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
-</context>
- <context id="misc0180">
- <description>Use this dialog to edit the CSS content settings for a CSS file. You can specify CSS profile or restore the default by clicking <b>Restore Defaults</b>.
- </description>
-</context>
-</contexts>
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.sse.ui.infopop/META-INF/MANIFEST.MF
deleted file mode 100644
index 6af73d3..0000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: SSE infopops
-Bundle-SymbolicName: org.eclipse.wst.sse.ui.infopop; singleton:=true
-Bundle-Version: 1.0.1.qualifier
-Bundle-Vendor: Eclipse.org
-Bundle-Localization: plugin
-Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/about.html b/docs/org.eclipse.wst.sse.ui.infopop/about.html
deleted file mode 100644
index 4c99086..0000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<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>February 24, 2005</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.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/build.properties b/docs/org.eclipse.wst.sse.ui.infopop/build.properties
deleted file mode 100644
index 6da2446..0000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-bin.includes = EditorContexts.xml,\
-               about.html,\
-               plugin.xml,\
-               META-INF/,\
-               EditorCssContexts2.xml
-src.includes = build.properties
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/plugin.xml b/docs/org.eclipse.wst.sse.ui.infopop/plugin.xml
deleted file mode 100644
index 2a3796f..0000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/plugin.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.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
- *******************************************************************************/ -->
-
-<plugin>
-
-<extension point="org.eclipse.help.contexts">
-       <contexts file="EditorContexts.xml" plugin ="org.eclipse.wst.sse.ui"/>
-       <contexts file="EditorCssContexts2.xml" plugin ="org.eclipse.wst.sse.ui"/>
-</extension>
-
-
-</plugin>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.web_core.feature/.cvsignore b/features/org.eclipse.wst.web_core.feature/.cvsignore
deleted file mode 100644
index 8a9b065..0000000
--- a/features/org.eclipse.wst.web_core.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.wst.web_core.feature_1.0.0.bin.dist.zip
diff --git a/features/org.eclipse.wst.web_core.feature/.project b/features/org.eclipse.wst.web_core.feature/.project
deleted file mode 100644
index fa0ce1f..0000000
--- a/features/org.eclipse.wst.web_core.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.web_core.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.web_core.feature/build.properties b/features/org.eclipse.wst.web_core.feature/build.properties
deleted file mode 100644
index 201c94e..0000000
--- a/features/org.eclipse.wst.web_core.feature/build.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-bin.includes = feature.xml,\
-               eclipse_update_120.jpg,\
-               epl-v10.html,\
-               license.html
-src.includes = license.html,\
-               feature.xml,\
-               epl-v10.html,\
-               eclipse_update_120.jpg,\
-               build.properties
diff --git a/features/org.eclipse.wst.web_core.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_core.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.web_core.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature/epl-v10.html b/features/org.eclipse.wst.web_core.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.web_core.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<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_core.feature/feature.xml b/features/org.eclipse.wst.web_core.feature/feature.xml
deleted file mode 100644
index 04d7f57..0000000
--- a/features/org.eclipse.wst.web_core.feature/feature.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.web_core.feature"
-      label="org.eclipse.wst.web_core.feature"
-      version="1.0.0">
-
-   <description>
-      %description
-   </description>
-
-   <license url="license.html">
-      %license
-   </license>
-
-   <requires>
-      <import feature="org.eclipse.platform" version="3.1.1" match="equivalent"/>
-      <import feature="org.eclipse.emf" version="2.1.1" match="equivalent"/>
-      <import feature="org.eclipse.jem" version="1.1.0.1" match="equivalent"/>
-      <import feature="org.eclipse.wst.server_core.feature" version="1.0.0" match="equivalent"/>
-      <import feature="org.eclipse.wst.common_core.feature" version="1.0.0" match="equivalent"/>
-   </requires>
-
-   <plugin
-         id="org.eclipse.wst.css.core"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.html.core"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.javascript.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"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.html.standard.dtds"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.web_core.feature/license.html b/features/org.eclipse.wst.web_core.feature/license.html
deleted file mode 100644
index 2347060..0000000
--- a/features/org.eclipse.wst.web_core.feature/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!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.web_core.feature/sourceTemplateFeature/build.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index f249e9f..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,16 +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
-###############################################################################
-bin.includes =\
-epl-v10.html,\
-eclipse_update_120.jpg,\
-feature.xml,\
-feature.properties,\
-license.html
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index 17bb8e3..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/epl-v10.html b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/epl-v10.html
deleted file mode 100644
index 022ad29..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<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>
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/license.html b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/license.html
deleted file mode 100644
index c6af966..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/license.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 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 &quot;CONTENT&quot;).  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
-   (&quot;EPL&quot;).  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, &quot;Program&quot; 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 (&quot;Repository&quot;) in CVS
-   modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-   
-<ul>
-	<li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-	<li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
-	<li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
-      and/or Fragments associated with that Feature.</li>
-	<li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>   
- 
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  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>
-	<li>Plug-in and Fragment directories</li>
-	<li>Inside Plug-ins and Fragments packaged as JARs</li>
-	<li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
-	<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 (&quot;Feature Update License&quot;) 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 &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-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>
-	<li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
-	<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>
-	<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>	
-	<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>
-	<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>
-   
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>   
-</body>
-</html>
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.html b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index 0a8aea0..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>February 24, 2005</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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.ini b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index 0dfb735..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 88a06c5..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +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
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Standard Tools SDK\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005.  All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/build.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index f95b457..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/eclipse32.gif b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index 0282f5d..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/eclipse32.png b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49d..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/plugin.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 165af04..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-pluginName=Web Standard Tools SDK - Common Component
-providerName=Eclipse.org
diff --git a/features/org.eclipse.wst.web_sdk.feature/.cvsignore b/features/org.eclipse.wst.web_sdk.feature/.cvsignore
deleted file mode 100644
index 2ad302e..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-build.xml
-features
-plugins
-org.eclipse.wst.web_sdk.feature_1.0.0.bin.dist.zip
diff --git a/features/org.eclipse.wst.web_sdk.feature/.project b/features/org.eclipse.wst.web_sdk.feature/.project
deleted file mode 100644
index b79f84b..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.web_sdk.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.web_sdk.feature/build.properties b/features/org.eclipse.wst.web_sdk.feature/build.properties
deleted file mode 100644
index 7c83ea4..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-bin.includes = feature.xml,\
-               eclipse_update_120.jpg,\
-               epl-v10.html,\
-               license.html
-
-generate.feature@org.eclipse.wst.web_ui.feature.source=org.eclipse.wst.web_ui.feature
-
-src.includes = eclipse_update_120.jpg,\
-               epl-v10.html,\
-               feature.xml,\
-               license.html
diff --git a/features/org.eclipse.wst.web_sdk.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_sdk.feature/epl-v10.html b/features/org.eclipse.wst.web_sdk.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<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_sdk.feature/feature.xml b/features/org.eclipse.wst.web_sdk.feature/feature.xml
deleted file mode 100644
index e1db923..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/feature.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.web_sdk.feature"
-      label="org.eclipse.wst.web_sdk.feature"
-      version="1.0.0">
-
-   <description>
-      %description
-   </description>
-
-
-
-   <license url="license.html">
-      %license
-   </license>
-
-
-
-  <includes
-         id="org.eclipse.wst.web_ui.feature.source"
-         version="0.0.0"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.web_sdk.feature/license.html b/features/org.eclipse.wst.web_sdk.feature/license.html
deleted file mode 100644
index 2347060..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!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.web_ui.feature/.cvsignore b/features/org.eclipse.wst.web_ui.feature/.cvsignore
deleted file mode 100644
index c14487c..0000000
--- a/features/org.eclipse.wst.web_ui.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/features/org.eclipse.wst.web_ui.feature/.project b/features/org.eclipse.wst.web_ui.feature/.project
deleted file mode 100644
index 024b477..0000000
--- a/features/org.eclipse.wst.web_ui.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.web_ui.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.web_ui.feature/build.properties b/features/org.eclipse.wst.web_ui.feature/build.properties
deleted file mode 100644
index 201c94e..0000000
--- a/features/org.eclipse.wst.web_ui.feature/build.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-bin.includes = feature.xml,\
-               eclipse_update_120.jpg,\
-               epl-v10.html,\
-               license.html
-src.includes = license.html,\
-               feature.xml,\
-               epl-v10.html,\
-               eclipse_update_120.jpg,\
-               build.properties
diff --git a/features/org.eclipse.wst.web_ui.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_ui.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.web_ui.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_ui.feature/epl-v10.html b/features/org.eclipse.wst.web_ui.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.web_ui.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<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/feature.xml b/features/org.eclipse.wst.web_ui.feature/feature.xml
deleted file mode 100644
index 5889530..0000000
--- a/features/org.eclipse.wst.web_ui.feature/feature.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.web_ui.feature"
-      label="org.eclipse.wst.web_ui.feature"
-      version="1.0.1">
-
-   <description>
-      %description
-   </description>
-
-   <license url="license.html">
-      %license
-   </license>
-
-   <includes
-         id="org.eclipse.wst.web_userdoc.feature"
-         version="0.0.0"/>
-
-   <requires>
-      <import feature="org.eclipse.wst.web_core.feature" version="1.0.0"/>
-   </requires>
-
-   <plugin
-         id="org.eclipse.wst.html.ui.infopop"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.javascript.ui.infopop"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-         
-   <plugin
-         id="org.eclipse.wst.web.ui.infopop"
-         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"/>
-
-   <plugin
-         id="org.eclipse.wst.javascript.ui"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.web.ui"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.web_ui.feature/license.html b/features/org.eclipse.wst.web_ui.feature/license.html
deleted file mode 100644
index 2347060..0000000
--- a/features/org.eclipse.wst.web_ui.feature/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!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.web_ui.feature/sourceTemplateFeature/build.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index dd8a618..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,19 +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
-###############################################################################
-bin.includes =\
-epl-v10.html,\
-eclipse_update_120.jpg,\
-feature.xml,\
-feature.properties,\
-license.html
-
-generate.feature@org.eclipse.wst.web_core.feature.source = org.eclipse.wst.web_core.feature
-
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index 17bb8e3..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/epl-v10.html b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/epl-v10.html
deleted file mode 100644
index 022ad29..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<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>
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 01950e3..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,132 +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
-###############################################################################
-# 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=Eclipse JDT Plug-in Developer Resources
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=Eclipse.org update site
-
-# "description" property - description of the feature
-description=API documentation and source code zips for Eclipse Java development tools.
-
-# "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\
-March 17, 2005\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/sourceTemplateFeature/feature.xml b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.xml
deleted file mode 100644
index babf24e..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-	primary="false"
-	label="org.eclipse.wst.web_ui.feature.source"
-	id="org.eclipse.wst.web_ui.feature.source"
-	version="1.0.0">
-	<description>
-		%description
-	</description>
-	<copyright url="http://www.example.com/copyright">
-		%copyright
-	</copyright>
-	<license url="license.html">%license</license>
-	
-	<includes
-         id="org.eclipse.wst.web_core.feature"
-         version="0.0.0"/>
-	<includes
-         id="org.eclipse.wst.web_core.feature.source"
-         version="0.0.0"/>
-    <plugin
-         id="org.eclipse.wst.web_ui.feature.source"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"/>   
-                          
-</feature>
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/license.html b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/license.html
deleted file mode 100644
index c6af966..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/license.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 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 &quot;CONTENT&quot;).  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
-   (&quot;EPL&quot;).  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, &quot;Program&quot; 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 (&quot;Repository&quot;) in CVS
-   modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-   
-<ul>
-	<li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-	<li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
-	<li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
-      and/or Fragments associated with that Feature.</li>
-	<li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>   
- 
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  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>
-	<li>Plug-in and Fragment directories</li>
-	<li>Inside Plug-ins and Fragments packaged as JARs</li>
-	<li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
-	<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 (&quot;Feature Update License&quot;) 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 &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-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>
-	<li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
-	<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>
-	<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>	
-	<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>
-	<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>
-   
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>   
-</body>
-</html>
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.html b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index 0a8aea0..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>February 24, 2005</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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.ini b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.mappings b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index 0dfb735..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 88a06c5..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +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
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Standard Tools SDK\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005.  All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/build.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 5895597..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/eclipse32.gif b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index 0282f5d..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/eclipse32.png b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49d..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/plugin.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index be01280..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-pluginName=Web Standard Tools SDK - WST Web Component
-providerName=Eclipse.org
diff --git a/features/org.eclipse.wst.web_userdoc.feature/.cvsignore b/features/org.eclipse.wst.web_userdoc.feature/.cvsignore
deleted file mode 100644
index 9cfe174..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.wst.web_userdoc.feature_1.0.0.jar
diff --git a/features/org.eclipse.wst.web_userdoc.feature/.project b/features/org.eclipse.wst.web_userdoc.feature/.project
deleted file mode 100644
index 1b5eb31..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.web_userdoc.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.web_userdoc.feature/build.properties b/features/org.eclipse.wst.web_userdoc.feature/build.properties
deleted file mode 100644
index a0b4899..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/build.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-bin.includes = feature.xml,\
-               eclipse_update_120.jpg,\
-               epl-v10.html,\
-               license.html
-src.includes = license.html,\
-               epl-v10.html,\
-               feature.xml,\
-               eclipse_update_120.jpg,\
-               build.properties
diff --git a/features/org.eclipse.wst.web_userdoc.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_userdoc.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_userdoc.feature/epl-v10.html b/features/org.eclipse.wst.web_userdoc.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<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_userdoc.feature/feature.xml b/features/org.eclipse.wst.web_userdoc.feature/feature.xml
deleted file mode 100644
index 38c5b20..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/feature.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.web_userdoc.feature"
-      label="org.eclipse.wst.web_userdoc.feature"
-      version="1.0.0">
-
-   <description>
-      %description
-   </description>
-
-
-
-   <license url="license.html">
-      %license
-   </license>
-
-   <plugin
-         id="org.eclipse.wst.doc.user"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-         
-   <plugin
-         id="org.eclipse.wst.webtools.doc.user"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.web_userdoc.feature/license.html b/features/org.eclipse.wst.web_userdoc.feature/license.html
deleted file mode 100644
index 2347060..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!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/.cvsignore b/features/org.eclipse.wst.xml_core.feature/.cvsignore
deleted file mode 100644
index c14487c..0000000
--- a/features/org.eclipse.wst.xml_core.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/features/org.eclipse.wst.xml_core.feature/.project b/features/org.eclipse.wst.xml_core.feature/.project
deleted file mode 100644
index 11ae248..0000000
--- a/features/org.eclipse.wst.xml_core.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.xml_core.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.xml_core.feature/build.properties b/features/org.eclipse.wst.xml_core.feature/build.properties
deleted file mode 100644
index 201c94e..0000000
--- a/features/org.eclipse.wst.xml_core.feature/build.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-bin.includes = feature.xml,\
-               eclipse_update_120.jpg,\
-               epl-v10.html,\
-               license.html
-src.includes = license.html,\
-               feature.xml,\
-               epl-v10.html,\
-               eclipse_update_120.jpg,\
-               build.properties
diff --git a/features/org.eclipse.wst.xml_core.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.xml_core.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.xml_core.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_core.feature/epl-v10.html b/features/org.eclipse.wst.xml_core.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.xml_core.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<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.xml_core.feature/feature.xml b/features/org.eclipse.wst.xml_core.feature/feature.xml
deleted file mode 100644
index 487684c..0000000
--- a/features/org.eclipse.wst.xml_core.feature/feature.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.xml_core.feature"
-      label="org.eclipse.wst.xml_core.feature"
-      version="1.0.0">
-
-   <description>
-      %description
-   </description>
-
-   <license url="license.html">
-      %license
-   </license>
-
-   <requires>
-      <import feature="org.apache.xerces.feature" version="2.7.0" match="equivalent"/>
-      <import feature="org.eclipse.rcp" version="3.1.1" match="equivalent"/>
-      <import feature="org.eclipse.platform" version="3.1.1" match="equivalent"/>
-      <import feature="org.eclipse.emf" version="2.1.1" match="equivalent"/>
-      <import feature="org.eclipse.wst.common_core.feature" version="1.0.0" match="equivalent"/>
-      <import feature="org.eclipse.xsd" version="2.1.1" match="equivalent"/>
-   </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>
diff --git a/features/org.eclipse.wst.xml_core.feature/license.html b/features/org.eclipse.wst.xml_core.feature/license.html
deleted file mode 100644
index 2347060..0000000
--- a/features/org.eclipse.wst.xml_core.feature/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!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/sourceTemplateFeature/build.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index f249e9f..0000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,16 +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
-###############################################################################
-bin.includes =\
-epl-v10.html,\
-eclipse_update_120.jpg,\
-feature.xml,\
-feature.properties,\
-license.html
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/eclipse_update_120.jpg b/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index 17bb8e3..0000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/epl-v10.html b/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/epl-v10.html
deleted file mode 100644
index 022ad29..0000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<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>
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/license.html b/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/license.html
deleted file mode 100644
index c6af966..0000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/license.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 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 &quot;CONTENT&quot;).  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
-   (&quot;EPL&quot;).  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, &quot;Program&quot; 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 (&quot;Repository&quot;) in CVS
-   modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-   
-<ul>
-	<li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-	<li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
-	<li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
-      and/or Fragments associated with that Feature.</li>
-	<li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>   
- 
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  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>
-	<li>Plug-in and Fragment directories</li>
-	<li>Inside Plug-ins and Fragments packaged as JARs</li>
-	<li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
-	<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 (&quot;Feature Update License&quot;) 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 &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-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>
-	<li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
-	<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>
-	<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>	
-	<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>
-	<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>
-   
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>   
-</body>
-</html>
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.html b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index 0a8aea0..0000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>February 24, 2005</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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.ini b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a..0000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.mappings b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index 0dfb735..0000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 88a06c5..0000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +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
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Standard Tools SDK\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005.  All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/build.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index f95b457..0000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/eclipse32.gif b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index 0282f5d..0000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/eclipse32.png b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49d..0000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/plugin.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 165af04..0000000
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-pluginName=Web Standard Tools SDK - Common Component
-providerName=Eclipse.org
diff --git a/features/org.eclipse.wst.xml_sdk.feature/.cvsignore b/features/org.eclipse.wst.xml_sdk.feature/.cvsignore
deleted file mode 100644
index 7a09e85..0000000
--- a/features/org.eclipse.wst.xml_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-features
-plugins
-build.xml
diff --git a/features/org.eclipse.wst.xml_sdk.feature/.project b/features/org.eclipse.wst.xml_sdk.feature/.project
deleted file mode 100644
index 4275fa6..0000000
--- a/features/org.eclipse.wst.xml_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.xml_sdk.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.xml_sdk.feature/build.properties b/features/org.eclipse.wst.xml_sdk.feature/build.properties
deleted file mode 100644
index f238b71..0000000
--- a/features/org.eclipse.wst.xml_sdk.feature/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-bin.includes = feature.xml,\
-               license.html,\
-               epl-v10.html,\
-               eclipse_update_120.jpg
-
-generate.feature@org.eclipse.wst.xml_ui.feature.source=org.eclipse.wst.xml_ui.feature
diff --git a/features/org.eclipse.wst.xml_sdk.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.xml_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.xml_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_sdk.feature/epl-v10.html b/features/org.eclipse.wst.xml_sdk.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.xml_sdk.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<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.xml_sdk.feature/feature.xml b/features/org.eclipse.wst.xml_sdk.feature/feature.xml
deleted file mode 100644
index 279168d..0000000
--- a/features/org.eclipse.wst.xml_sdk.feature/feature.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.xml_sdk.feature"
-      label="org.eclipse.wst.xml_sdk.feature"
-      version="1.0.0">
-
-   <description>
-      %description
-   </description>
-
-
-
-   <license url="license.html">
-      %license
-   </license>
-
-   <requires>
-      <import feature="org.eclipse.wst.xml_ui.feature" version="0.0.0"/>
-   </requires>
-
-         
-   <includes
-         id="org.eclipse.wst.xml_ui.feature.source"
-         version="0.0.0"/>
-
-
-
-</feature>
diff --git a/features/org.eclipse.wst.xml_sdk.feature/license.html b/features/org.eclipse.wst.xml_sdk.feature/license.html
deleted file mode 100644
index 2347060..0000000
--- a/features/org.eclipse.wst.xml_sdk.feature/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!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_ui.feature/.project b/features/org.eclipse.wst.xml_ui.feature/.project
deleted file mode 100644
index 69318c7..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.xml_ui.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.xml_ui.feature/build.properties b/features/org.eclipse.wst.xml_ui.feature/build.properties
deleted file mode 100644
index 03c689e..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/build.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-bin.includes = feature.xml,\
-               epl-v10.html,\
-               eclipse_update_120.jpg,\
-               license.html
-src.includes = license.html,\
-               epl-v10.html,\
-               feature.xml,\
-               eclipse_update_120.jpg,\
-               build.properties
diff --git a/features/org.eclipse.wst.xml_ui.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.xml_ui.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_ui.feature/epl-v10.html b/features/org.eclipse.wst.xml_ui.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<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.xml_ui.feature/feature.xml b/features/org.eclipse.wst.xml_ui.feature/feature.xml
deleted file mode 100644
index ea3d4a1..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/feature.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.xml_ui.feature"
-      label="org.eclipse.wst.xml_ui.feature"
-      version="1.0.0">
-
-   <description>
-      %description
-   </description>
-
-   <license url="license.html">
-      %license
-   </license>
-
-   <includes
-         id="org.eclipse.wst.xml_userdoc.feature"
-         version="0.0.0"/>
-
-   <requires>
-      <import feature="org.apache.xerces.feature" version="2.7.0" match="greaterOrEqual"/>
-      <import feature="org.eclipse.wst.xml_core.feature" version="1.0.0" match="equivalent"/>
-      <import feature="org.eclipse.wst.common_ui.feature" version="1.0.0" match="equivalent"/>
-      <import feature="org.eclipse.gef" version="3.1.1" match="equivalent"/>
-   </requires>
-
-   <plugin
-         id="org.eclipse.wst.dtd.ui"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.dtd.ui.infopop"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.sse.ui.infopop"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.xml.ui.infopop"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.dtd.ui"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.sse.ui"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.xml.ui"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.xsd.ui"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.xml_ui.feature/license.html b/features/org.eclipse.wst.xml_ui.feature/license.html
deleted file mode 100644
index 2347060..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!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_ui.feature/sourceTemplateFeature/build.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 19b7468..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,19 +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
-###############################################################################
-bin.includes =\
-epl-v10.html,\
-eclipse_update_120.jpg,\
-feature.xml,\
-feature.properties,\
-license.html
-
-generate.feature@org.eclipse.wst.xml_core.feature.source = org.eclipse.wst.xml_core.feature
-
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index 17bb8e3..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/epl-v10.html b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/epl-v10.html
deleted file mode 100644
index 022ad29..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<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>
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 01950e3..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,132 +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
-###############################################################################
-# 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=Eclipse JDT Plug-in Developer Resources
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=Eclipse.org update site
-
-# "description" property - description of the feature
-description=API documentation and source code zips for Eclipse Java development tools.
-
-# "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\
-March 17, 2005\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.xml_ui.feature/sourceTemplateFeature/feature.xml b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.xml
deleted file mode 100644
index 3d5ecd2..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-	primary="false"
-	label="org.eclipse.wst.xml_ui.feature.source"
-	id="org.eclipse.wst.xml_ui.feature.source"
-	version="1.0.0">
-	<description>
-		%description
-	</description>
-	<copyright url="http://www.example.com/copyright">
-		%copyright
-	</copyright>
-	<license url="license.html">%license</license>
-	
-	<includes
-         id="org.eclipse.wst.xml_core.feature"
-         version="0.0.0"/>
-   	<includes
-         id="org.eclipse.wst.xml_core.feature.source"
-         version="0.0.0"/>
-    <plugin
-         id="org.eclipse.wst.xml_ui.feature.source"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"/>   
-                          
-</feature>
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/license.html b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/license.html
deleted file mode 100644
index c6af966..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/license.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 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 &quot;CONTENT&quot;).  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
-   (&quot;EPL&quot;).  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, &quot;Program&quot; 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 (&quot;Repository&quot;) in CVS
-   modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-   
-<ul>
-	<li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-	<li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
-	<li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
-      and/or Fragments associated with that Feature.</li>
-	<li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>   
- 
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  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>
-	<li>Plug-in and Fragment directories</li>
-	<li>Inside Plug-ins and Fragments packaged as JARs</li>
-	<li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
-	<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 (&quot;Feature Update License&quot;) 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 &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-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>
-	<li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
-	<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>
-	<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>	
-	<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>
-	<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>
-   
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>   
-</body>
-</html>
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.html b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index 0a8aea0..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>February 24, 2005</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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.ini b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.mappings b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index 0dfb735..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 88a06c5..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +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
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Standard Tools SDK\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005.  All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/build.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 5895597..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/eclipse32.gif b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index 0282f5d..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/eclipse32.png b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49d..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/plugin.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 0e83dbb..0000000
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-pluginName=Web Standard Tools SDK - WST XML Component
-providerName=Eclipse.org
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/.cvsignore b/features/org.eclipse.wst.xml_userdoc.feature/.cvsignore
deleted file mode 100644
index c14487c..0000000
--- a/features/org.eclipse.wst.xml_userdoc.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/.project b/features/org.eclipse.wst.xml_userdoc.feature/.project
deleted file mode 100644
index 6b391b2..0000000
--- a/features/org.eclipse.wst.xml_userdoc.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.xml_userdoc.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/build.properties b/features/org.eclipse.wst.xml_userdoc.feature/build.properties
deleted file mode 100644
index 201c94e..0000000
--- a/features/org.eclipse.wst.xml_userdoc.feature/build.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-bin.includes = feature.xml,\
-               eclipse_update_120.jpg,\
-               epl-v10.html,\
-               license.html
-src.includes = license.html,\
-               feature.xml,\
-               epl-v10.html,\
-               eclipse_update_120.jpg,\
-               build.properties
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.xml_userdoc.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.xml_userdoc.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/epl-v10.html b/features/org.eclipse.wst.xml_userdoc.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.xml_userdoc.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<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.xml_userdoc.feature/feature.xml b/features/org.eclipse.wst.xml_userdoc.feature/feature.xml
deleted file mode 100644
index 82c3991..0000000
--- a/features/org.eclipse.wst.xml_userdoc.feature/feature.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.xml_userdoc.feature"
-      label="org.eclipse.wst.xml_userdoc.feature"
-      version="1.0.0">
-
-   <description>
-      %description
-   </description>
-
-
-
-   <license url="license.html">
-      %license
-   </license>
-
-   <plugin
-         id="org.eclipse.wst.dtdeditor.doc.user"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.sse.doc.user"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.xmleditor.doc.user"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.xsdeditor.doc.user"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/license.html b/features/org.eclipse.wst.xml_userdoc.feature/license.html
deleted file mode 100644
index 2347060..0000000
--- a/features/org.eclipse.wst.xml_userdoc.feature/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!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>
